pax_global_header00006660000000000000000000000064125755217040014522gustar00rootroot0000000000000052 comment=6b177c836eff45faa5b68646fe00f582d6f18dee freeradius-server/000077500000000000000000000000001257552170400145235ustar00rootroot00000000000000freeradius-server/.gitattributes000066400000000000000000000000151257552170400174120ustar00rootroot00000000000000* text=auto freeradius-server/.gitignore000066400000000000000000000004201257552170400165070ustar00rootroot00000000000000*~ *.o *.a *.d *.lo *.la *.so *.lai *.bz2 *.gz *.sig *.orig *.rej *.dSYM .libs .depends config.log config.status Make.inc libtool src/include/autoconf.h src/include/build-radpaths-h src/include/radpaths.h src/include/stamp-h autom4te.cache config.cache /libltdl/Makefile freeradius-server/.travis.yml000066400000000000000000000010521257552170400166320ustar00rootroot00000000000000language: c compiler: - clang - gcc before_install: - sudo apt-get update -qq - sudo apt-get install -qq libtalloc-dev libssl-dev - sudo apt-get install -qq -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" libmysqlclient-dev - sudo apt-get install -qq libkrb5-dev libgdbm-dev libhiredis-dev libldap2-dev libpam0g-dev libpcap-dev libperl-dev libpq-dev libreadline-dev firebird-dev freetds-dev python-dev ruby-dev unixodbc-dev script: ./configure -C --with-udpfromto --with-dhcp --with-vmps && make -j8 && make test freeradius-server/COPYRIGHT000066400000000000000000000054431257552170400160240ustar00rootroot000000000000001. COPYRIGHT Unless otherwise mentioned, the copyrights described in section 4, below, apply to all files in this distribution. 2. INDIVIDUAL DIRECTORIES 2.1 doc/rfc/ Most of the files in this directory are copyrighted by the Internet Society, Inc. See the contents of the files for details. 2.2 src/lib/ Copyright for files in this directory is held by the contributors. See the contents of the files for details 2.2.1 LICENSE The license for all files in the src/lib directory is the GNU LGPL version 2, which is included with this program in the file src/lib/LICENSE. 2.3 libltdl/ Most of the files in this directory are copyright the Free Software Foundation, Inc. See the contents of the files for details. 3. ALL OTHER FILES Copyright for files in this directory is held by the contributors. See the contents of the files for details. Files without explicit copyright notices are copyright The FreeRADIUS Server Project. See section 4.2 for more information. 3.1 LICENSE The license for all other source code and documentation except the files in src/lib directory is the GNU GPL version 2, which is included with this program in the LICENSE file in this directory. 3.2 LIST OF COPYRIGHT HOLDERS Portions of the source code and documentation included here are copyright by one or more of the following organizations and individuals. This list is not exhaustive. Consult the individual files for more detailed copyright statements. Copyright (C) 1999-2015 The FreeRADIUS Server Project Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Alan DeKok Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. Copyright (C) 2003, 2004, 2005 Kostas Kalevras Copyright (C) 2004 Cladju Consulting, Inc. Copyright (C) 2001, 2002, 2003, 2004, 2005 Google, Inc. Copyright (C) 2003, 2004 Michael Richardson Copyright (C) 2002, 2003, 2004 Novell, Inc. Copyright (C) 2002 Miguel A.L. Paraz Copyright (C) 2002 Simon Ekstrand Copyright (C) 2001 Chad Miller Copyright (C) 2001 hereUare Communications, Inc. Copyright (C) 2000 Jochen Friedrich Copyright (C) 2000, 2002 Miquel van Smoorenburg Copyright (C) 2000 Jeff Carneal Copyright (C) 2000 Alan Curry Copyright (C) 2000 David Kerry Copyright (C) 2000 Dmitri Ageev Copyright (C) 2000 Nathan Neulinger Copyright (C) 2000 Mike Machado Copyright (C) 2000, 2001 Chad Miller Copyright (C) 1997, 1998, 1999 Cistron Internet Services B.V. Copyright (C) 1999 Kunihiro Ishiguro freeradius-server/CREDITS000066400000000000000000000025471257552170400155530ustar00rootroot00000000000000 FreeRADIUS is the result of the work done by a large number of people. The major contributors are listed here. Miquel van Smoorenburg Wrote the original Cistron server, and started the FreeRADIUS source tree. Alan DeKok Registered and maintains www.freeradius.org. Wrote the module code. Made the server threaded. Maintains the autoconf and libtool scripts for the server. Alan Curry Contributed many patches for proxying, replication, realm support. Mike Machado (mike@innercite.com) Author of the SQL module. Adrian Pavlykevych LDAP module. Jeff Carneal, Apex Internet Services, Inc. Wrote the caching support for the Unix module. miguel a.l. paraz Wrote the original code which was the basis for the PAM module. Jochen Friedrich SMUX / SNMP support. Nathan Neulinger Kerberos authentication module. Brandon Lee Poyner Netscape-MTA-MD5 authentication module. Chris Parker Configuration parser enhancments, 'rlm_attr_filter' module, and proxy enhancements. Kostas Kalevras Contributed the 'dialup_admin' PHP server administration code. Chris Brotsos Memory allocation debugging and proxy enhancements. freeradius-server/INSTALL000066400000000000000000000151361257552170400155620ustar00rootroot000000000000001. INSTALLATION Ignore this file if you have a pre-installed binary package. 2. SIMPLE INSTALLATION If you do not need to modify the default configuration, then take the following steps to build and install the server: $ ./configure $ make $ make install The first time after installation, you should run the server as "root". This will cause the server to create the certificates it needs for EAP. $ radiusd -X Once that is done, the server can be run from an unpriviledged user account. 3. UPGRADING The installation process will not over-write your existing configuration files. It will, however, warn you about the files it did not install. For users upgrading from 1.x to 2.0, we STRONGLY recommend that 2.0 be installed in a different location than the existing 1.x installation. Any local policies can then be migrated gradually to the new 2.0 configuration. While we have put a lot of time into ensuring that 2.0 is mostly backwards compatible with 1.x, it is not COMPLETELY backwards compatible. There are differences that mean it is simpler and safer to migrate your configurations. If you are upgrading an existing installation, please be aware that at least one default virtual server SHOULD be used. If you don't need virtual servers, your configuration can remain mostly unchanged. If you do need virtual servers, we recommend creating a default one by editing radiusd.conf, and wrapping all of the authorize, authenticate, etc. sections in one server block, as follows: ... server { # line to add authorize { ... } authenticate { ... } accounting { ... } ... post-proxy { ... } } # matching line to add ... 4. CUSTOM INSTALLATION FreeRADIUS has autoconf support. This means you have to run ./configure, and then run make. To see which configuration options are supported, run './configure --help', and read it's output. The following list is a selection from the available flags: --enable-shared[=PKGS] build shared libraries [default=yes] --enable-static[=PKGS] build static libraries [default=yes] --enable-fast-install[=PKGS] optimize for fast installation [default=yes] --with-logdir=DIR Directory for logfiles [LOCALSTATEDIR/log] --with-radacctdir=PATH Directory for detail files [LOGDIR/radacct] --with-raddbdir=DIR Directory for config files [SYSCONFDIR/raddb] --with-threads Use threads, if available. (default=yes) --with-snmp Compile in SNMP support. (default=yes) --disable-ltdl-install Do not install libltdl --with-experimental-modules Use experimental and unstable modules. (default=no) --enable-developer Turns on super-duper-extra-compile-warnings when using gcc. --with-edir Compile with support for Novell eDirectory integration. The "make install" stage will install the binaries, the 'man' pages, and MAY install the configuration files. If you have not installed a RADIUS server before, then the configuration files for FreeRADIUS will be installed. If you already have a RADIUS server installed, then ** FreeRADIUS WILL NOT over-write your current configuration. ** The "make install" process will warn you about the files it could not install. If you DO see a warning message about files that could not be installed, the it is YOUR RESPONSIBILITY to ensure that the new server is using the new configuration files, and not the old configuration files. You may need to manually 'diff' the files. There MAY be changes in the dictionary files which are REQUIRED for a new version of the software. These files will NOT be installed over your current configuration, so you MUST verify and install any problem files by hand. It is EXTREMELY helpful to read the output of both 'configure', 'make', and 'make install'. If a particular module you expected to be installed was not installed, then the output of the 'configure;make;make install' sequence will tell you why that module was not installed. Please do NOT post questions to the FreeRADIUS users list without carefully reading the output of this process. 2. RUNNING THE SERVER If the server builds and installs, but doesn't run correctly, then you may use debugging mode (radiusd -X) to figure out the problem. This is your BEST HOPE for understanding the problem. Read ALL of the messages which are printed to the screen, the answer to your problem will often be in a warning or error message. We really can't emphasize that last sentence enough. Configuring a RADIUS server for complex local authentication isn't a trivial task. Your ONLY method for debugging it is to read the debug messages, where the server will tell you exactly what it's doing, and why. You should then compare its behaviour to what you intended, and edit the configuration files as appropriate. If you don't use debugging mode, and ask questions on the mailing list, then the responses will all tell you to use debugging mode. The server prints out a lot of information in this mode, including suggestions for fixes to common problems. Look for "WARNING" in the output, and read the related messages. Since the main developers of FreeRADIUS use debugging mode to track down their configuration problems with the server, it's a good idea for you to use it, too. If you don't, there is little hope for you to solve ANY configuration problem related to the server. To start the server in debugging mode, do: $ radiusd -X You should see a lot of text printed on the screen as it starts up. If you don't, or if you see error messages, please read the FAQ: http://www.freeradius.org/faq/ If the server says "Ready to process requests.", then it is running properly. From another shell (or another window), type: $ radtest test test localhost 0 testing123 You should see the server print out more messages as it receives the request, and responds to it. The 'radtest' program should receive the response within a few seconds. It doesn't matter if the authentication request is accepted or rejected, what matters is that the server received the request, and responded to it. You can now edit the 'radiusd.conf' file for your local system. Please read the ENTIRE file carefully, as many configuration options are only documented in comments in the file. Configuring and running the server MAY be complicated. Many modules have "man" pages. See "man rlm_pap", or "man rlm_*" for information. Please read the documentation in the doc/ directory. The comments in the configuration files also contain a lot of documentation. If you have any additional issues, the FAQ is also a good place to check. freeradius-server/LICENSE000066400000000000000000000431331257552170400155340ustar00rootroot00000000000000 GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 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) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 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) year 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. freeradius-server/Make.inc.in000066400000000000000000000050151257552170400165010ustar00rootroot00000000000000# -*- makefile -*- # Make.inc.in # # Version: $Id$ # # Location of files. prefix = @prefix@ exec_prefix = @exec_prefix@ sysconfdir = @sysconfdir@ localstatedir = @localstatedir@ libdir = @libdir@ bindir = @bindir@ sbindir = @sbindir@ docdir = @docdir@ mandir = @mandir@ datadir = @datadir@ dictdir = $(datadir)/freeradius logdir = @logdir@ includedir = @includedir@ raddbdir = @raddbdir@ radacctdir = @radacctdir@ top_builddir = @abs_top_builddir@ top_build_prefix=@abs_top_builddir@/ top_srcdir = @abs_top_srcdir@ datarootdir = @datarootdir@ MAKE = @MAKE@ CC = @CC@ RANLIB = @RANLIB@ INCLUDE = -I${top_srcdir} -I${top_srcdir}/src CFLAGS = $(INCLUDE) @CFLAGS@ CPPFLAGS = @CPPFLAGS@ LIBPREFIX = @LIBPREFIX@ EXEEXT = @EXEEXT@ LIBTOOL = @LIBTOOL@ ACLOCAL = @ACLOCAL@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ INSTALL = ${top_builddir}/install-sh -c INSTALL_PROGRAM = ${INSTALL} INSTALL_DATA = ${INSTALL} -m 644 INSTALL_SCRIPT = ${INSTALL_PROGRAM} INSTALLSTRIP = @INSTALLSTRIP@ LCRYPT = @CRYPTLIB@ LIBS = @LIBS@ LDFLAGS = @LDFLAGS@ LOGDIR = ${logdir} RADDBDIR = ${raddbdir} RUNDIR = ${localstatedir}/run/radiusd SBINDIR = ${sbindir} RADIR = ${radacctdir} LIBRADIUS = $(top_builddir)/src/lib/$(LIBPREFIX)freeradius-radius.la LIBLTDL = @LIBLTDL@ INCLTDL = @INCLTDL@ LTDL_SUBDIRS = @LTDL_SUBDIRS@ CFLAGS += $(INCLTDL) USE_SHARED_LIBS = @USE_SHARED_LIBS@ USE_STATIC_LIBS = @USE_STATIC_LIBS@ STATIC_MODULES = @STATIC_MODULES@ OPENSSL_LIBS = @OPENSSL_LIBS@ OPENSSL_INCLUDE = @OPENSSL_INCLUDE@ LIBREADLINE = @LIBREADLINE@ # # SQL driver defines # SQL_ODBC_LIBS = @ODBC_LIBS@ SQL_ODBC_INCLUDE = @ODBC_INCLUDE@ RADIUSD_MAJOR_VERSION = @RADIUSD_MAJOR_VERSION@ RADIUSD_MINOR_VERSION = @RADIUSD_MINOR_VERSION@ RADIUSD_INCRM_VERSION = @RADIUSD_INCRM_VERSION@ RADIUSD_VERSION = @RADIUSD_VERSION@ RADIUSD_VERSION_STRING = @RADIUSD_VERSION_STRING@ RADIUSD_VERSION_COMMIT = @RADIUSD_VERSION_COMMIT@ MODULES = @MODULES@ HOSTINFO = @HOSTINFO@ ifneq ($(WITH_OPENSSL_MD5),) LIBRADIUS_WITH_OPENSSL = 1 CFLAGS += -DWITH_OPENSSL_MD5 endif ifneq ($(WITH_OPENSSL_SHA1),) LIBRADIUS_WITH_OPENSSL = 1 CFLAGS += -DWITH_OPENSSL_SHA1 endif ifneq ($(LIBRADIUS_WITH_OPENSSL),) ifeq ($(OPENSSL_LIBS),) $(error OPENSSL_LIBS must be define in order to use WITH_OPENSSL_*) else LIBRADIUS += $(OPENSSL_LIBS) endif endif # http://clang.llvm.org/StaticAnalysis.html # # $ make SCAN=/path/to/checker/ # ifneq ($(SCAN),) CC := $(SCAN)/scan-build gcc -DFR_SCAN_BUILD LIBTOOL := endif ifeq "$(LIBTOOL)" "" $(error Building FreeRADIUS requires libtool) endif freeradius-server/Makefile000066400000000000000000000153371257552170400161740ustar00rootroot00000000000000# # Makefile # # NOTE: This top-level Makefile must not # use GNU-make extensions. The lower ones can. # # Version: $Id$ # include Make.inc .PHONY: all clean install SUBDIRS = $(LTDL_SUBDIRS) $(wildcard src raddb scripts doc) WHAT_TO_MAKE = all all: @$(MAKE) $(MFLAGS) WHAT_TO_MAKE=$@ common clean: @$(MAKE) $(MFLAGS) WHAT_TO_MAKE=$@ common @rm -f *~ .PHONY: test test: @$(MAKE) -C raddb/certs @$(MAKE) -C src/tests tests # # The $(R) is a magic variable not defined anywhere in this source. # It's purpose is to allow an admin to create an installation 'tar' # file *without* actually installing it. e.g.: # # $ R=/home/root/tmp make install # $ cd /home/root/tmp # $ tar -cf ~/freeradius-package.tar * # # The 'tar' file can then be un-tar'd on any similar machine. It's a # cheap way of creating packages, without using a package manager. # Many of the platform-specific packaging tools use the $(R) variable # when creating their packages. # # For compatibility with typical GNU packages (e.g. as seen in libltdl), # we make sure DESTDIR is defined. # export DESTDIR := $(R) install: $(INSTALL) -d -m 755 $(R)$(sbindir) $(INSTALL) -d -m 755 $(R)$(bindir) $(INSTALL) -d -m 755 $(R)$(raddbdir) $(INSTALL) -d -m 755 $(R)$(mandir) $(INSTALL) -d -m 755 $(R)$(RUNDIR) $(INSTALL) -d -m 700 $(R)$(logdir) $(INSTALL) -d -m 700 $(R)$(radacctdir) $(INSTALL) -d -m 755 $(R)$(datadir) $(INSTALL) -d -m 755 $(R)$(dictdir) for i in 1 5 8; do \ $(INSTALL) -d -m 755 $(R)$(mandir)/man$$i; \ for p in man/man$$i/*.$$i; do \ $(INSTALL) -m 644 $$p $(R)$(mandir)/man$$i; \ done \ done @$(MAKE) $(MFLAGS) WHAT_TO_MAKE=$@ common @echo "Installing dictionary files in $(R)$(dictdir)"; \ cd share; \ for i in dictionary*; do \ $(INSTALL) -m 644 $$i $(R)$(dictdir); \ done $(LIBTOOL) --finish $(R)$(libdir) ifneq ($(RADMIN),) ifneq ($(RGROUP),) .PHONY: install-chown install-chown: chown -R $(RADMIN) $(R)$(raddbdir) chgrp -R $(RGROUP) $(R)$(raddbdir) chmod u=rwx,g=rx,o= `find $(R)$(raddbdir) -type d -print` chmod u=rw,g=r,o= `find $(R)$(raddbdir) -type f -print` chown -R $(RADMIN) $(R)$(logdir) chgrp -R $(RGROUP) $(R)$(logdir) find $(R)$(logdir) -type d -exec chmod u=rwx,g=rwx,o= {} \; find $(R)$(logdir) -type d -exec chmod g+s {} \; find $(R)$(logdir) -type f -exec chmod u=rw,g=rw,o= {} \; chown -R $(RADMIN) $(R)$(RUNDIR) chgrp -R $(RGROUP) $(R)$(RUNDIR) find $(R)$(RUNDIR) -type d -exec chmod u=rwx,g=rwx,o= {} \; find $(R)$(RUNDIR) -type d -exec chmod g+s {} \; find $(R)$(RUNDIR) -type f -exec chmod u=rw,g=rw,o= {} \; endif endif .PHONY: common $(SUBDIRS) common: $(SUBDIRS) $(SUBDIRS): @echo "Making $(WHAT_TO_MAKE) in $@..." @$(MAKE) $(MFLAGS) -C $@ $(WHAT_TO_MAKE) distclean: clean rm -f config.cache config.log config.status libtool \ src/include/radpaths.h src/include/stamp-h \ libltdl/config.cache libltdl/config.log \ libltdl/config.status \ libltdl/libtool -find . ! -name configure.in -name \*.in -print | \ sed 's/\.in$$//' | \ while read file; do rm -f $$file; done -find src/modules -name config.mak | \ while read file; do rm -f $$file; done -find src/modules -name config.h | \ while read file; do rm -f $$file; done ###################################################################### # # Automatic remaking rules suggested by info:autoconf#Automatic_Remaking # ###################################################################### .PHONY: reconfig reconfig: @$(MAKE) $(MFLAGS) -C src reconfig @$(MAKE) configure @$(MAKE) src/include/autoconf.h.in configure: configure.in aclocal.m4 $(AUTOCONF) .PHONY: src/include/autoconf.h.in src/include/autoconf.h.in: $(AUTOHEADER) config.status: configure ./config.status --recheck configure.in: .PHONY: check-includes check-includes: scripts/min-includes.pl `find . -name "*.c" -print` TAGS: etags `find src -type f -name '*.[ch]' -print` # # Make test certificates. # .PHONY: certs certs: @cd raddb/certs && $(MAKE) ###################################################################### # # Make a release. # # Note that "Make.inc" has to be updated with the release number # BEFORE running this command! # ###################################################################### freeradius-server-$(RADIUSD_VERSION_STRING).tar.gz: .git git archive --format=tar --prefix=freeradius-server-$(RADIUSD_VERSION_STRING)/ v2.x.x | gzip > $@ freeradius-server-$(RADIUSD_VERSION_STRING).tar.gz.sig: freeradius-server-$(RADIUSD_VERSION_STRING).tar.gz gpg --default-key aland@freeradius.org -b $< freeradius-server-$(RADIUSD_VERSION_STRING).tar.bz2: .git git archive --format=tar --prefix=freeradius-server-$(RADIUSD_VERSION_STRING)/ v2.x.x | bzip2 > $@ freeradius-server-$(RADIUSD_VERSION_STRING).tar.bz2.sig: freeradius-server-$(RADIUSD_VERSION_STRING).tar.bz2 gpg --default-key aland@freeradius.org -b $< # high-level targets .PHONY: dist-check dist-check: redhat/freeradius.spec suse/freeradius.spec debian/changelog @if [ `grep ^Version: redhat/freeradius.spec | sed 's/.*://;s/ //'` != "$(RADIUSD_VERSION_STRING)" ]; then \ cat redhat/freeradius.spec | sed 's/^Version: .*/Version: $(RADIUSD_VERSION_STRING)/' > redhat/.foo; \ mv redhat/.foo redhat/freeradius.spec; \ echo redhat/freeradius.spec 'Version' needs to be updated; \ exit 1; \ fi @if [ `grep ^Version: suse/freeradius.spec | sed 's/.*://;s/ //'` != "$(RADIUSD_VERSION_STRING)" ]; then \ cat suse/freeradius.spec | sed 's/^Version: .*/Version: $(RADIUSD_VERSION_STRING)/' > suse/.foo; \ mv suse/.foo suse/freeradius.spec; \ echo suse/freeradius.spec 'Version' needs to be updated; \ exit 1; \ fi @if [ `head -n 1 debian/changelog | sed 's/.*(//;s/\+.*).*//;s/-1).*//;'` != "$(RADIUSD_VERSION_STRING)" ]; then \ echo debian/changelog needs to be updated; \ exit 1; \ fi dist: dist-check freeradius-server-$(RADIUSD_VERSION_STRING).tar.gz freeradius-server-$(RADIUSD_VERSION_STRING).tar.bz2 dist-sign: freeradius-server-$(RADIUSD_VERSION_STRING).tar.gz.sig freeradius-server-$(RADIUSD_VERSION_STRING).tar.bz2.sig dist-publish: freeradius-server-$(RADIUSD_VERSION_STRING).tar.gz.sig freeradius-server-$(RADIUSD_VERSION_STRING).tar.gz freeradius-server-$(RADIUSD_VERSION_STRING).tar.gz.sig freeradius-server-$(RADIUSD_VERSION_STRING).tar.bz2 freeradius-server-$(RADIUSD_VERSION_STRING).tar.gz.sig freeradius-server-$(RADIUSD_VERSION_STRING).tar.bz2.sig scp $^ freeradius.org@ftp.freeradius.org:public_ftp # scp $^ freeradius.org@www.tr.freeradius.org:public_ftp # # Note that we do NOT do the tagging here! We just print out what # to do! # dist-tag: freeradius-server-$(RADIUSD_VERSION_STRING).tar.gz freeradius-server-$(RADIUSD_VERSION_STRING).tar.bz2 @echo "git tag release_`echo $(RADIUSD_VERSION_STRING) | tr .- __`" # # Build a debian package # .PHONY: deb deb: fakeroot dpkg-buildpackage -b -uc freeradius-server/README.rst000066400000000000000000000173661257552170400162270ustar00rootroot00000000000000The FreeRADIUS server ===================== |BuildStatus|_ 1. INTRODUCTION --------------- The FreeRADIUS Server Project is a high performance and highly configurable AAA server. Is available under the terms of the GNU GPLv2. It has been in steady development for over a decade. It is the most widely used RADIUS server in the world, by quite a large margin. AAA stands for "Authentication, Authorization, and Accounting". The server can do any or all of the AAA functions, across three protocols: RADIUS, DHCP, and VMPS. The reason is that at its core, it is a policy engine. The policy engine connects network protocols to back-end systems such as SQL, LDAP, Active Directory, etc. FreeRADIUS started out as a RADIUS server, of course. We then added VMPS and DHCP when it became clear that doing so was both easy and useful. It supports all popular authentication methods for RADIUS. This includes PAP, CHAP, MS-CHAP, EAP, etc. It works with all known networking equipment. The authors of FreeRADIUS have written the official specifications for how RADIUS works (RFC 5080 and RFC 6158, among others). It is compliant with all RADIUS standards. This means that if a NAS does not inter-operate with FreeRADIUS, the most likely reason is that the NAS is wrong. FreeRADIUS can authenticate users on systems such as 802.1x (WiFi), dialup, PPPoE, VPN's, VoIP, and many others. It supports back-end databases such as MySQL, PostgreSQL, Oracle, Microsoft Active Directory, OpenLDAP, and many more. It is used daily to authenticate the Internet access for hundreds of millions of people, in sites ranging from 10 users, to 10 million and more users. It is used in appliances, WiFi boxes, ISPs, enterprises, and large telecommunications providers. Version 2.2 of the server is intended to be backwards compatible with previous versions. It has features not available in Version 1, many of which are also not available in any commercial server. * simple policy language (see ``man unlang``) * virtual servers (raddb/sites-available/README) * DHCP support (server and relay) * VMPS support * IPv6 support * better proxy support (raddb/proxy.conf) * More EAP types * verbose and descriptive Debugging output * Almost 50 "stable" modules, and many more experimental ones. * Sample SQL configuration for all major SQL databases. * Some support for on-the-fly changing of configuration (HUP) * check configuration test (``radiusd -C``) * Event-based server core. Please see http://freeradius.org and http://wiki.freeradius.org for more information. 2. INSTALLATION --------------- To install the server, please see the INSTALL file in this directory. In general, we recommend using a pre-packaged installation for your operating system. 3. DEBUGGING THE SERVER ----------------------- RADIUS systems can be complicated to configure. Unlike a simple "query-response" protocol such as DNS, RADIUS systems need to juggle large amounts of information. There may be dozens of attributes in the request. Processing the request may involve querying any or all of LDAP, SQL, flat files, external scripts, etc. There is no easy solution to creating a working RADIUS configuration. The only method that works is to run the server in debugging mode, (``radiusd -X``) and READ the output. We cannot emphasize this point strongly enough. The vast majority of problems can be solved by carefully reading the debugging output, which includes WARNINGs about common issues, and suggestions for how they may be fixed. Read the FAQ. Many questions are answered there. See the Wiki http://wiki.freeradius.org Read the configuration files. Many parts of the server have NO documentation, other than comments in the configuration file. That being said, there are dozens of examples in the configuration files. The configuration items are extensively commented, with all of their behavior documented. Search the mailing lists. Many questions come up repeatedly, and are answered there. There is a Google link on the bottom of the page: http://www.freeradius.org/list/users.html Type some key words into the search box, and you should find discussions about common problems and solution. 4. ADDITIONAL INFORMATION ------------------------- See 'doc/README' for more information about FreeRADIUS. See raddb/sites-available/README for documentation on virtual servers. 5. PROBLEMS AND CONCERNS ------------------------ We understand that the server may be difficult to configure, install, or administer. It is, after all, a complex system with many different configuration possibilities. The most common problem is that people change large amounts of the configuration without understanding what they're doing, and without testing their changes. The preferred method of operation is the following: 1. Start off with the default configuration files. 2. Save a copy of the default configuration: It WORKS. Don't change it! 3. Run the server in debugging mode. (radiusd -X) 4. Send it test packets using "radclient", or a NAS or AP. 5. Verify that the server does what you expect. - If it does not work, change the configuration, and go to step (3) If you're stuck, revert to using the "last working" configuration. - If it works, proceed to step (6). 6. Save a copy of the working configuration, along with a note of what you changed, and why. 7. Make a SMALL change to the configuration. 8. Repeat from step (3). This method will ensure that you have a working configuration that is customized to your site as quickly as possible. While it may seem frustrating to proceed via a series of small steps, the alternative will always take more time. The "fast and loose" way will be MORE frustrating than quickly making forward progress! 6. FEEDBACK ----------- If you have any comments, bug reports, problems, or concerns, please send them to the 'freeradius-users' list (see the URL above). We will do our best to answer your questions, to fix the problems, and to generally improve the server in any way we can. Please do NOT complain that the developers aren't answering your questions quickly enough, or aren't fixing the problems quickly enough. Please do NOT complain if you're told to go read documentation. We recognize that the documentation isn't perfect, but it *does* exist, and reading it can solve most common questions. The list policy changed in mid 2012, due to the high volume of inappropriate posts from a subset of users. These users would refuse to read the documentation, even when asked to. They would ask questions, and then refuse to follow the instructions given them on the list. They would argue over the answers given on the list, even when it was clear that they understood less about RADIUS than the people trying to help them. The new policy is to warn people engaging in this asocial behavior. If they continue after a warning, they are unsubscribed and banned permanently from the list. The decision to enforce etiquette came after over 10 years of having a more open policy. Sadly, a small subset of users abused the help given by the volunteers on the list. This behavior is unacceptable, and will not be tolerated. FreeRADIUS is the cumulative effort of many years of work by many people, and you've gotten it for free. No one gets paid to work on FreeRADIUS, and no one is getting paid to answer your questions. If you want the community to help you, you need to make it easy for the community to help you. Support is available. See http://networkradius.com/. Please submit bug reports, suggestions, or patches. That feedback gives the developers a guide as to where they should focus their work. If you like the server, feel free to mail the list and say so. .. |BuildStatus| image:: https://travis-ci.org/FreeRADIUS/freeradius-server.png?branch=v2.x.x .. _BuildStatus: https://travis-ci.org/FreeRADIUS/freeradius-server freeradius-server/VERSION000066400000000000000000000000061257552170400155670ustar00rootroot000000000000002.2.8 freeradius-server/acinclude.m4000066400000000000000000000253271257552170400167250ustar00rootroot00000000000000dnl See whether we need a declaration for a function. dnl RADIUSD_NEED_DECLARATION(FUNCTION [, EXTRA-HEADER-FILES]) AC_DEFUN([RADIUSD_NEED_DECLARATION], [AC_MSG_CHECKING([whether $1 must be declared]) AC_CACHE_VAL(radius_cv_decl_needed_$1, [AC_TRY_COMPILE([ #include #include #ifdef HAVE_UNISTD_H #include #endif #ifdef HAVE_CRYPT_H #include #endif #ifdef HAVE_ERRNO_H #include #endif #ifdef HAVE_RESOURCE_H #include #endif #ifdef HAVE_GETOPT_H #include #endif #ifdef HAVE_MALLOC_H #include #endif #ifdef HAVE_UTMP_H #include #endif #ifdef HAVE_UTMPX_H #include #endif #ifdef HAVE_SYS_SELECT_H #include #endif #ifdef HAVE_DLFCN_H #include #endif #ifdef HAVE_REGEX_H #include #endif #ifdef HAVE_SYSLOG_H #include #endif #ifdef HAVE_INTTYPES_H #include #endif #ifdef HAVE_STDINT_H #include #endif #ifdef HAVE_ARPA_INET_H #include #endif $2], [char *(*pfn) = (char *(*)) $1], eval "radius_cv_decl_needed_$1=no", eval "radius_cv_decl_needed_$1=yes")]) if eval "test \"`echo '$radius_cv_decl_needed_'$1`\" = yes"; then AC_MSG_RESULT(yes) radius_tr_decl=NEED_DECLARATION_`echo $1 | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` AC_DEFINE_UNQUOTED($radius_tr_decl) else AC_MSG_RESULT(no) fi ])dnl dnl Check multiple functions to see whether each needs a declaration. dnl RADIUSD_NEED_DECLARATIONS(FUNCTION... [, EXTRA-HEADER-FILES]) AC_DEFUN([RADIUSD_NEED_DECLARATIONS], [for ac_func in $1 do RADIUSD_NEED_DECLARATION($ac_func, $2) done ]) dnl Checks to see if this is SUNPro we're building with dnl Usage: dnl AC_PROG_CC_SUNPRO AC_DEFUN([AC_PROG_CC_SUNPRO], [AC_CACHE_CHECK(whether we are using SUNPro C, ac_cv_prog_suncc, [dnl The semicolon is to pacify NeXT's syntax-checking cpp. cat > conftest.c </dev/null 2>&1; then ac_cv_prog_suncc=yes else ac_cv_prog_suncc=no fi])]) dnl # dnl # FR_CHECK_TYPE_INCLUDE([#includes ...], type, default-C-types) dnl # dnl # This function is like AC_CHECK_TYPE, but you can give this one dnl # a list of include files to check. dnl # AC_DEFUN([FR_CHECK_TYPE_INCLUDE], [ AC_CACHE_CHECK(for $2, ac_cv_type_$2, [ ac_cv_type_$2=no AC_TRY_COMPILE($1, [$2 foo], ac_cv_type_$2=yes, ) ] ) if test "$ac_cv_type_$2" != "yes"; then AC_DEFINE($2, $3, $4) fi ]) dnl # dnl # Locate the directory in which a particular file is found. dnl # dnl # Usage: FR_LOCATE_DIR(MYSQLLIB_DIR, libmysqlclient.a) dnl # dnl # Defines the variable MYSQLLIB_DIR to be the directory(s) in dnl # which the file libmysqlclient.a is to be found. dnl # dnl # AC_DEFUN([FR_LOCATE_DIR], [ dnl # If we have the program 'locate', then the problem of finding a dnl # particular file becomes MUCH easier. dnl # dnl # dnl # No 'locate' defined, do NOT do anything. dnl # if test "x$LOCATE" != "x"; then dnl # dnl # Root through a series of directories, looking for the given file. dnl # DIRS= file=$2 for x in `${LOCATE} $file 2>/dev/null`; do dnl # dnl # When asked for 'foo', locate will also find 'foo_bar', which we dnl # don't want. We want that EXACT filename. dnl # dnl # We ALSO want to be able to look for files like 'mysql/mysql.h', dnl # and properly match them, too. So we try to strip off the last dnl # part of the filename, using the name of the file we're looking dnl # for. If we CANNOT strip it off, then the name will be unchanged. dnl # base=`echo $x | sed "s%/${file}%%"` if test "x$x" = "x$base"; then continue; fi dir=`${DIRNAME} $x 2>/dev/null` dnl # dnl # Exclude a number of directories. dnl # exclude=`echo ${dir} | ${GREP} /home` if test "x$exclude" != "x"; then continue fi dnl # dnl # OK, we have an exact match. Let's be sure that we only find ONE dnl # matching directory. dnl # already=`echo \$$1 ${DIRS} | ${GREP} ${dir}` if test "x$already" = "x"; then DIRS="$DIRS $dir" fi done fi dnl # dnl # And remember the directory in which we found the file. dnl # eval "$1=\"\$$1 $DIRS\"" ]) dnl ####################################################################### dnl # dnl # Look for a library in a number of places. dnl # dnl # FR_SMART_CHECK_LIB(library, function) dnl # AC_DEFUN([FR_SMART_CHECK_LIB], [ sm_lib_safe=`echo "$1" | sed 'y%./+-%__p_%'` sm_func_safe=`echo "$2" | sed 'y%./+-%__p_%'` AC_MSG_CHECKING([for $2 in -l$1]) old_LIBS="$LIBS" smart_lib= smart_lib_dir= dnl # dnl # Try first any user-specified directory, otherwise we may pick up dnl # the wrong version. dnl # if test "x$smart_try_dir" != "x"; then for try in $smart_try_dir; do LIBS="-L$try -l$1 $old_LIBS" AC_TRY_LINK([extern char $2();], [ $2()], smart_lib="-L$try -l$1") if test "x$smart_lib" != "x"; then break; fi done LIBS="$old_LIBS" fi dnl # dnl # Try using the default library path dnl # if test "x$smart_lib" = "x"; then LIBS="-l$1 $old_LIBS" AC_TRY_LINK([extern char $2();], [ $2()], smart_lib="-l$1") LIBS="$old_LIBS" fi dnl # dnl # Try to guess possible locations. dnl # if test "x$smart_lib" = "x"; then FR_LOCATE_DIR(smart_lib_dir,[lib$1${libltdl_cv_shlibext}]) FR_LOCATE_DIR(smart_lib_dir,[lib$1.a]) for try in $smart_lib_dir /usr/local/lib /opt/lib; do LIBS="-L$try -l$1 $old_LIBS" AC_TRY_LINK([extern char $2();], [ $2()], smart_lib="-L$try -l$1") if test "x$smart_lib" != "x"; then break; fi done LIBS="$old_LIBS" fi dnl # dnl # Found it, set the appropriate variable. dnl # if test "x$smart_lib" != "x"; then AC_MSG_RESULT(yes) eval "ac_cv_lib_${sm_lib_safe}_${sm_func_safe}=yes" LIBS="$smart_lib $old_LIBS" SMART_LIBS="$smart_lib $SMART_LIBS" else AC_MSG_RESULT(no) fi ]) dnl ####################################################################### dnl # dnl # Look for a header file in a number of places. dnl # dnl # FR_SMART_CHECK_INCLUDE(foo.h, [ #include ]) dnl # AC_DEFUN([FR_SMART_CHECK_INCLUDE], [ ac_safe=`echo "$1" | sed 'y%./+-%__pm%'` AC_MSG_CHECKING([for $1]) old_CFLAGS="$CFLAGS" smart_include= smart_include_dir= dnl # dnl # Try first any user-specified directory, otherwise we may pick up dnl # the wrong version. dnl # if test "x$smart_try_dir" != "x"; then for try in $smart_try_dir; do CFLAGS="$old_CFLAGS -I$try" AC_TRY_COMPILE([$2 #include <$1>], [ int a = 1;], smart_include="-I$try", smart_include=) if test "x$smart_include" != "x"; then break; fi done CFLAGS="$old_CFLAGS" fi dnl # dnl # Try using the default includes. dnl # if test "x$smart_include" = "x"; then AC_TRY_COMPILE([$2 #include <$1>], [ int a = 1;], smart_include=" ", smart_include=) fi dnl # dnl # Try to guess possible locations. dnl # if test "x$smart_include" = "x"; then FR_LOCATE_DIR(smart_include_dir,$1) for try in $smart_include_dir /usr/local/include /opt/include; do CFLAGS="$old_CFLAGS -I$try" AC_TRY_COMPILE([$2 #include <$1>], [ int a = 1;], smart_include="-I$try", smart_include=) if test "x$smart_include" != "x"; then break; fi done CFLAGS="$old_CFLAGS" fi dnl # dnl # Found it, set the appropriate variable. dnl # if test "x$smart_include" != "x"; then AC_MSG_RESULT(yes) eval "ac_cv_header_$ac_safe=yes" CFLAGS="$old_CFLAGS $smart_include" SMART_CFLAGS="$SMART_CFLAGS $smart_include" else AC_MSG_RESULT(no) fi ]) dnl ####################################################################### dnl # dnl # Look for a header file in a number of places. dnl # dnl # Usage: FR_CHECK_STRUCT_HAS_MEMBER([#include ], [struct foo], member) dnl # If the member is defined, then the variable dnl # ac_cv_type_struct_foo_has_member is set to 'yes' dnl # AC_DEFUN([FR_CHECK_STRUCT_HAS_MEMBER], [ AC_MSG_CHECKING([for $3 in $2]) dnl BASED on 'offsetof': dnl #define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER) dnl AC_TRY_COMPILE([ $1 #ifdef HAVE_STDDEF_H #include #endif #ifndef offsetof #define offsetof(TYPE, MEMBER) ((int) &((TYPE *)0)->MEMBER) #endif ], [ int foo = offsetof($2, $3) ], has_element=" ", has_element=) ac_safe_type=`echo "$2" | sed 'y% %_%'` if test "x$has_element" != "x"; then AC_MSG_RESULT(yes) eval "ac_cv_type_${ac_safe_type}_has_$3=yes" else AC_MSG_RESULT(no) eval "ac_cv_type_${ac_safe_type}_has_$3=" fi ]) dnl Autoconf 2.61 breaks the support for chained configure scripts dnl in combination with config.cache m4_pushdef([AC_OUTPUT], [ unset ac_cv_env_LIBS_set unset ac_cv_env_LIBS_value m4_popdef([AC_OUTPUT]) AC_OUTPUT([$1],[$2],[$3]) ]) # See if the compilation works with __thread, for thread-local storage # AC_DEFUN([FR_TLS], [ AC_MSG_CHECKING(for TLS) AC_RUN_IFELSE([AC_LANG_SOURCE([[ static __thread int val; int main(int argc, char *argv[]) { return val = argc; } ]])],[have_tls=yes],[have_tls=no],[have_tls=no ]) AC_MSG_RESULT($have_tls) if test "$have_tls" = "yes"; then AC_DEFINE([HAVE_THREAD_TLS],[1],[Define if the compiler supports __thread]) fi ]) AC_DEFUN([AC_LIB_READLINE], [ AC_CACHE_CHECK([for a readline compatible library], ac_cv_lib_readline, [ ORIG_LIBS=$LIBS for readline_lib in readline edit editline; do for termcap_lib in "" termcap curses ncurses; do if test -z "$termcap_lib"; then TRY_LIB="-l$readline_lib" else TRY_LIB="-l$readline_lib -l$termcap_lib" fi LIBS="$ORIG_LIBS $TRY_LIB" AC_TRY_LINK_FUNC(readline, ac_cv_lib_readline="$TRY_LIB") if test -n "$ac_cv_lib_readline"; then break fi done if test -n "$ac_cv_lib_readline"; then break fi done if test -z "$ac_cv_lib_readline"; then ac_cv_lib_readline="no" fi LIBS=$ORIG_LIBS ]) if test "$ac_cv_lib_readline" != "no"; then LIBREADLINE="$ac_cv_lib_readline" AC_DEFINE(HAVE_LIBREADLINE, 1, [Define if you have a readline compatible library]) AC_CHECK_HEADERS(readline.h readline/readline.h) AC_CACHE_CHECK([whether readline supports history], ac_cv_lib_readline_history, [ ac_cv_lib_readline_history="no" AC_TRY_LINK_FUNC(add_history, ac_cv_lib_readline_history="yes") ]) if test "$ac_cv_lib_readline_history" = "yes"; then AC_DEFINE(HAVE_READLINE_HISTORY, 1, [Define if your readline library has \`add_history']) AC_CHECK_HEADERS(history.h readline/history.h) fi fi AC_SUBST(LIBREADLINE) ]) AC_INCLUDE(aclocal.m4) freeradius-server/aclocal.m4000066400000000000000000007310511257552170400163720ustar00rootroot00000000000000# generated automatically by aclocal 1.10.1 -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # 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. # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- # serial 52 Debian 1.5.26-1ubuntu1 AC_PROG_LIBTOOL # AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED) # ----------------------------------------------------------- # If this macro is not defined by Autoconf, define it here. m4_ifdef([AC_PROVIDE_IFELSE], [], [m4_define([AC_PROVIDE_IFELSE], [m4_ifdef([AC_PROVIDE_$1], [$2], [$3])])]) # AC_PROG_LIBTOOL # --------------- AC_DEFUN([AC_PROG_LIBTOOL], [AC_REQUIRE([_AC_PROG_LIBTOOL])dnl dnl If AC_PROG_CXX has already been expanded, run AC_LIBTOOL_CXX dnl immediately, otherwise, hook it in at the end of AC_PROG_CXX. AC_PROVIDE_IFELSE([AC_PROG_CXX], [AC_LIBTOOL_CXX], [define([AC_PROG_CXX], defn([AC_PROG_CXX])[AC_LIBTOOL_CXX ])]) dnl And a similar setup for Fortran 77 support AC_PROVIDE_IFELSE([AC_PROG_F77], [AC_LIBTOOL_F77], [define([AC_PROG_F77], defn([AC_PROG_F77])[AC_LIBTOOL_F77 ])]) dnl Quote A][M_PROG_GCJ so that aclocal doesn't bring it in needlessly. dnl If either AC_PROG_GCJ or A][M_PROG_GCJ have already been expanded, run dnl AC_LIBTOOL_GCJ immediately, otherwise, hook it in at the end of both. AC_PROVIDE_IFELSE([AC_PROG_GCJ], [AC_LIBTOOL_GCJ], [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], [AC_LIBTOOL_GCJ], [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ], [AC_LIBTOOL_GCJ], [ifdef([AC_PROG_GCJ], [define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[AC_LIBTOOL_GCJ])]) ifdef([A][M_PROG_GCJ], [define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[AC_LIBTOOL_GCJ])]) ifdef([LT_AC_PROG_GCJ], [define([LT_AC_PROG_GCJ], defn([LT_AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])])]) ])])# AC_PROG_LIBTOOL # _AC_PROG_LIBTOOL # ---------------- AC_DEFUN([_AC_PROG_LIBTOOL], [AC_REQUIRE([AC_LIBTOOL_SETUP])dnl AC_BEFORE([$0],[AC_LIBTOOL_CXX])dnl AC_BEFORE([$0],[AC_LIBTOOL_F77])dnl AC_BEFORE([$0],[AC_LIBTOOL_GCJ])dnl # This can be used to rebuild libtool when needed LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh" # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' AC_SUBST(LIBTOOL)dnl # Prevent multiple expansion define([AC_PROG_LIBTOOL], []) ])# _AC_PROG_LIBTOOL # AC_LIBTOOL_SETUP # ---------------- AC_DEFUN([AC_LIBTOOL_SETUP], [AC_PREREQ(2.50)dnl AC_REQUIRE([AC_ENABLE_SHARED])dnl AC_REQUIRE([AC_ENABLE_STATIC])dnl AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_PROG_LD])dnl AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl AC_REQUIRE([AC_PROG_NM])dnl AC_REQUIRE([AC_PROG_LN_S])dnl AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl # Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers! AC_REQUIRE([AC_OBJEXT])dnl AC_REQUIRE([AC_EXEEXT])dnl dnl AC_LIBTOOL_SYS_MAX_CMD_LEN AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE AC_LIBTOOL_OBJDIR AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl _LT_AC_PROG_ECHO_BACKSLASH case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. 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 to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' # Constants: rm="rm -f" # Global variables: default_ofile=libtool can_build_shared=yes # All known linkers require a `.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a ltmain="$ac_aux_dir/ltmain.sh" ofile="$default_ofile" with_gnu_ld="$lt_cv_prog_gnu_ld" AC_CHECK_TOOL(AR, ar, false) AC_CHECK_TOOL(RANLIB, ranlib, :) AC_CHECK_TOOL(STRIP, strip, :) old_CC="$CC" old_CFLAGS="$CFLAGS" # Set sane defaults for various variables test -z "$AR" && AR=ar test -z "$AR_FLAGS" && AR_FLAGS=cru test -z "$AS" && AS=as test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$DLLTOOL" && DLLTOOL=dlltool test -z "$LD" && LD=ld test -z "$LN_S" && LN_S="ln -s" test -z "$MAGIC_CMD" && MAGIC_CMD=file test -z "$NM" && NM=nm test -z "$SED" && SED=sed test -z "$OBJDUMP" && OBJDUMP=objdump test -z "$RANLIB" && RANLIB=: test -z "$STRIP" && STRIP=: test -z "$ac_objext" && ac_objext=o # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" fi _LT_CC_BASENAME([$compiler]) # Only perform the check for file, if the check method requires it case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then AC_PATH_MAGIC fi ;; esac _LT_REQUIRED_DARWIN_CHECKS AC_PROVIDE_IFELSE([AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no) AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL], enable_win32_dll=yes, enable_win32_dll=no) AC_ARG_ENABLE([libtool-lock], [AC_HELP_STRING([--disable-libtool-lock], [avoid locking (might break parallel builds)])]) test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes AC_ARG_WITH([pic], [AC_HELP_STRING([--with-pic], [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], [pic_mode="$withval"], [pic_mode=default]) test -z "$pic_mode" && pic_mode=default # Use C for the default configuration in the libtool script tagname= AC_LIBTOOL_LANG_C_CONFIG _LT_AC_TAGCONFIG ])# AC_LIBTOOL_SETUP # _LT_AC_SYS_COMPILER # ------------------- AC_DEFUN([_LT_AC_SYS_COMPILER], [AC_REQUIRE([AC_PROG_CC])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_AC_SYS_COMPILER # _LT_CC_BASENAME(CC) # ------------------- # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. AC_DEFUN([_LT_CC_BASENAME], [for cc_temp in $1""; do case $cc_temp in compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` ]) # _LT_COMPILER_BOILERPLATE # ------------------------ # Check for compiler boilerplate output or warnings with # the simple compiler test code. AC_DEFUN([_LT_COMPILER_BOILERPLATE], [AC_REQUIRE([LT_AC_PROG_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. AC_DEFUN([_LT_LINKER_BOILERPLATE], [AC_REQUIRE([LT_AC_PROG_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 # -------------------------- # Check for some things on darwin AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS],[ case $host_os in rhapsody* | darwin*) AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:]) AC_CHECK_TOOL([NMEDIT], [nmedit], [:]) 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. echo "int foo(void){return 1;}" > conftest.c $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib ${wl}-single_module conftest.c if test -f libconftest.dylib; then lt_cv_apple_cc_single_mod=yes rm -rf libconftest.dylib* fi rm conftest.c fi]) AC_CACHE_CHECK([for -exported_symbols_list linker flag], [lt_cv_ld_exported_symbols_list], [lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [lt_cv_ld_exported_symbols_list=yes], [lt_cv_ld_exported_symbols_list=no]) LDFLAGS="$save_LDFLAGS" ]) case $host_os in rhapsody* | darwin1.[[0123]]) _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; darwin*) # if running on 10.5 or later, the deployment target defaults # to the OS version, if on x86, and 10.4, the deployment # target defaults to 10.4. Don't you love it? case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; 10.[[012]]*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; esac ;; esac if test "$lt_cv_apple_cc_single_mod" = "yes"; then _lt_dar_single_mod='$single_module' fi if test "$lt_cv_ld_exported_symbols_list" = "yes"; then _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' else _lt_dar_export_syms="~$NMEDIT -s \$output_objdir/\${libname}-symbols.expsym \${lib}" fi if test "$DSYMUTIL" != ":"; then _lt_dsymutil="~$DSYMUTIL \$lib || :" else _lt_dsymutil= fi ;; esac ]) # _LT_AC_SYS_LIBPATH_AIX # ---------------------- # Links a minimal program and checks the executable # for the system default hardcoded library path. In most cases, # this is /usr/lib:/lib, but when the MPI compilers are used # the location of the communication and MPI libs are included too. # If we don't find anything, use the default library path according # to the aix ld manual. AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX], [AC_REQUIRE([LT_AC_PROG_SED])dnl AC_LINK_IFELSE(AC_LANG_PROGRAM,[ lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/ p } }' aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi],[]) if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi ])# _LT_AC_SYS_LIBPATH_AIX # _LT_AC_SHELL_INIT(ARG) # ---------------------- AC_DEFUN([_LT_AC_SHELL_INIT], [ifdef([AC_DIVERSION_NOTICE], [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)], [AC_DIVERT_PUSH(NOTICE)]) $1 AC_DIVERT_POP ])# _LT_AC_SHELL_INIT # _LT_AC_PROG_ECHO_BACKSLASH # -------------------------- # Add some code to the start of the generated configure script which # will find an echo command which doesn't interpret backslashes. AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH], [_LT_AC_SHELL_INIT([ # Check that we are running under the correct shell. SHELL=${CONFIG_SHELL-/bin/sh} case X$ECHO in X*--fallback-echo) # Remove one level of quotation (which was required for Make). ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','` ;; esac echo=${ECHO-echo} if test "X[$]1" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test "X[$]1" = X--fallback-echo; then # Avoid inline document here, it may be left over : elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then # Yippee, $echo works! : else # Restart under the correct shell. exec $SHELL "[$]0" --no-reexec ${1+"[$]@"} fi if test "X[$]1" = X--fallback-echo; then # used as fallback echo shift cat </dev/null 2>&1 && unset CDPATH if test -z "$ECHO"; then if test "X${echo_test_string+set}" != Xset; then # find a string as large as possible, as long as the shell can cope with it for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... if (echo_test_string=`eval $cmd`) 2>/dev/null && echo_test_string=`eval $cmd` && (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null then break fi done fi if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then : else # The Solaris, AIX, and Digital Unix default echo programs unquote # backslashes. This makes it impossible to quote backslashes using # echo "$something" | sed 's/\\/\\\\/g' # # So, first we look for a working echo in the user's PATH. lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for dir in $PATH /usr/ucb; do IFS="$lt_save_ifs" if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then echo="$dir/echo" break fi done IFS="$lt_save_ifs" if test "X$echo" = Xecho; then # We didn't find a better echo, so look for alternatives. if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then # This shell has a builtin print -r that does the trick. echo='print -r' elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) && test "X$CONFIG_SHELL" != X/bin/ksh; then # If we have ksh, try running configure again with it. ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} export ORIGINAL_CONFIG_SHELL CONFIG_SHELL=/bin/ksh export CONFIG_SHELL exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"} else # Try using printf. echo='printf %s\n' if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then # Cool, printf works : elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && test "X$echo_testing_string" = 'X\t' && echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL export CONFIG_SHELL SHELL="$CONFIG_SHELL" export SHELL echo="$CONFIG_SHELL [$]0 --fallback-echo" elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && test "X$echo_testing_string" = 'X\t' && echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then echo="$CONFIG_SHELL [$]0 --fallback-echo" else # maybe with a smaller string... prev=: for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null then break fi prev="$cmd" done if test "$prev" != 'sed 50q "[$]0"'; then echo_test_string=`eval $prev` export echo_test_string exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"} else # Oops. We lost completely, so just stick with echo. echo=echo fi fi fi fi fi fi # Copy echo and quote the copy suitably for passing to libtool from # the Makefile, instead of quoting the original, which is used later. ECHO=$echo if test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo" fi AC_SUBST(ECHO) ])])# _LT_AC_PROG_ECHO_BACKSLASH # _LT_AC_LOCK # ----------- AC_DEFUN([_LT_AC_LOCK], [AC_ARG_ENABLE([libtool-lock], [AC_HELP_STRING([--disable-libtool-lock], [avoid locking (might break parallel builds)])]) test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE="32" ;; *ELF-64*) HPUX_IA64_MODE="64" ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out which ABI we are using. echo '[#]line __oline__ "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then if test "$lt_cv_prog_gnu_ld" = yes; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ s390*-*linux*|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*) 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_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) AC_LANG_POP]) if test x"$lt_cv_cc_needs_belf" != x"yes"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS="$SAVE_CFLAGS" fi ;; sparc*-*solaris*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) LD="${LD-ld} -m elf64_sparc" ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" fi ;; esac ;; esac fi rm -rf conftest* ;; AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL], [*-*-cygwin* | *-*-mingw* | *-*-pw32*) AC_CHECK_TOOL(DLLTOOL, dlltool, false) AC_CHECK_TOOL(AS, as, false) AC_CHECK_TOOL(OBJDUMP, objdump, false) ;; ]) esac need_locks="$enable_libtool_lock" ])# _LT_AC_LOCK # AC_LIBTOOL_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------------------- # Check whether the given compiler option works AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [AC_REQUIRE([LT_AC_PROG_SED]) AC_CACHE_CHECK([$1], [$2], [$2=no ifelse([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$3" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi fi $rm conftest* ]) if test x"[$]$2" = xyes; then ifelse([$5], , :, [$5]) else ifelse([$6], , :, [$6]) fi ])# AC_LIBTOOL_COMPILER_OPTION # AC_LIBTOOL_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [ACTION-SUCCESS], [ACTION-FAILURE]) # ------------------------------------------------------------ # Check whether the given compiler option works AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [AC_REQUIRE([LT_AC_PROG_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $3" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&AS_MESSAGE_LOG_FD $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi else $2=yes fi fi $rm -r conftest* LDFLAGS="$save_LDFLAGS" ]) if test x"[$]$2" = xyes; then ifelse([$4], , :, [$4]) else ifelse([$5], , :, [$5]) fi ])# AC_LIBTOOL_LINKER_OPTION # AC_LIBTOOL_SYS_MAX_CMD_LEN # -------------------------- AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [# 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*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} while (test "X"`$SHELL [$]0 --fallback-echo "X$teststring" 2>/dev/null` \ = "XX$teststring") >/dev/null 2>&1 && new_result=`expr "X$teststring" : ".*" 2>&1` && lt_cv_sys_max_cmd_len=$new_result && test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done 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 ])# AC_LIBTOOL_SYS_MAX_CMD_LEN # _LT_AC_CHECK_DLFCN # ------------------ AC_DEFUN([_LT_AC_CHECK_DLFCN], [AC_CHECK_HEADERS(dlfcn.h)dnl ])# _LT_AC_CHECK_DLFCN # _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, # ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) # --------------------------------------------------------------------- AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF], [AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl if test "$cross_compiling" = yes; then : [$4] else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < #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 #ifdef __cplusplus extern "C" void exit (int); #endif void fnord() { int i=42;} int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; /* dlclose (self); */ } else puts (dlerror ()); exit (status); }] 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_AC_TRY_DLOPEN_SELF # AC_LIBTOOL_DLOPEN_SELF # ---------------------- AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [AC_REQUIRE([_LT_AC_CHECK_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*) 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_AC_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_AC_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 ])# AC_LIBTOOL_DLOPEN_SELF # AC_LIBTOOL_PROG_CC_C_O([TAGNAME]) # --------------------------------- # Check to see if options -c and -o are simultaneously supported by compiler AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O], [AC_REQUIRE([LT_AC_PROG_SED])dnl AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)], [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no $rm -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then _LT_AC_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 .. rmdir conftest $rm conftest* ]) ])# AC_LIBTOOL_PROG_CC_C_O # AC_LIBTOOL_SYS_HARD_LINK_LOCKS([TAGNAME]) # ----------------------------------------- # Check to see if we can do hard links to lock some files if needed AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_REQUIRE([_LT_AC_LOCK])dnl hard_links="nottested" if test "$_LT_AC_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 ])# AC_LIBTOOL_SYS_HARD_LINK_LOCKS # AC_LIBTOOL_OBJDIR # ----------------- AC_DEFUN([AC_LIBTOOL_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 ])# AC_LIBTOOL_OBJDIR # AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH([TAGNAME]) # ---------------------------------------------- # Check hardcoding attributes. AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_MSG_CHECKING([how to hardcode library paths into programs]) _LT_AC_TAGVAR(hardcode_action, $1)= if test -n "$_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)" || \ test -n "$_LT_AC_TAGVAR(runpath_var, $1)" || \ test "X$_LT_AC_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then # We can hardcode non-existant directories. if test "$_LT_AC_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_AC_TAGVAR(hardcode_shlibpath_var, $1)" != no && test "$_LT_AC_TAGVAR(hardcode_minus_L, $1)" != no; then # Linking always hardcodes the temporary library directory. _LT_AC_TAGVAR(hardcode_action, $1)=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. _LT_AC_TAGVAR(hardcode_action, $1)=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. _LT_AC_TAGVAR(hardcode_action, $1)=unsupported fi AC_MSG_RESULT([$_LT_AC_TAGVAR(hardcode_action, $1)]) if test "$_LT_AC_TAGVAR(hardcode_action, $1)" = relink; 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 ])# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH # AC_LIBTOOL_SYS_LIB_STRIP # ------------------------ AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP], [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 ])# AC_LIBTOOL_SYS_LIB_STRIP # AC_LIBTOOL_SYS_DYNAMIC_LINKER # ----------------------------- # PORTME Fill in your ld.so characteristics AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_REQUIRE([LT_AC_PROG_SED])dnl AC_MSG_CHECKING([dynamic linker characteristics]) 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" m4_if($1,[],[ if test "$GCC" = yes; then case $host_os in darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; *) lt_awk_arg="/^libraries:/" ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$lt_search_path_spec" | grep ';' >/dev/null ; then # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. lt_search_path_spec=`echo "$lt_search_path_spec" | $SED -e 's/;/ /g'` else lt_search_path_spec=`echo "$lt_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary. lt_tmp_lt_search_path_spec= lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` for lt_sys_path in $lt_search_path_spec; do if test -d "$lt_sys_path/$lt_multi_os_dir"; then lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" else test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`echo $lt_tmp_lt_search_path_spec | awk ' BEGIN {RS=" "; FS="/|\n";} { lt_foo=""; lt_count=0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { lt_foo="/" $lt_i lt_foo; } else { lt_count--; } } } } if (lt_foo != "") { lt_freq[[lt_foo]]++; } if (lt_freq[[lt_foo]] == 1) { print lt_foo; } }'` sys_lib_search_path_spec=`echo $lt_search_path_spec` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi]) need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix[[4-9]]*) version_type=linux need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[[01]] | aix4.[[01]].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[[45]]*) version_type=linux need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$host_os in yes,cygwin* | yes,mingw* | yes,pw32*) 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' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $rm \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" ;; mingw*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | [grep ';[c-zC-Z]:/' >/dev/null]; then # It is most probably a Windows format PATH printed by # mingw gcc, but we are running on Cygwin. Gcc prints its search # path with ; separators, and with drive letters. We can handle the # drive letters (cygwin fileutils understands them), so leave them, # especially as we might pass files found there to a mingw objdump, # which wouldn't understand a cygwinified path. Ahh. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' ;; esac ;; *) library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' ;; esac dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' m4_if([$1], [],[ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"]) sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd1*) dynamic_linker=no ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[[123]]*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2*) shlibpath_overrides_runpath=yes ;; freebsd3.[[01]]* | freebsdelf3.[[01]]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \ freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555. postinstall_cmds='chmod 555 $lib' ;; interix[[3-9]]*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be Linux ELF. linux* | k*bsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsdelf*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='NetBSD ld.elf_so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; nto-qnx*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[[89]] | openbsd2.[[89]].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no export_dynamic_flag_spec='${wl}-Blargedynsym' runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' shlibpath_overrides_runpath=no else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' shlibpath_overrides_runpath=yes case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; uts4*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' 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 AC_CACHE_VAL([lt_cv_sys_lib_search_path_spec], [lt_cv_sys_lib_search_path_spec="$sys_lib_search_path_spec"]) sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" AC_CACHE_VAL([lt_cv_sys_lib_dlsearch_path_spec], [lt_cv_sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec"]) sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi ])# AC_LIBTOOL_SYS_DYNAMIC_LINKER # _LT_AC_TAGCONFIG # ---------------- AC_DEFUN([_LT_AC_TAGCONFIG], [AC_REQUIRE([LT_AC_PROG_SED])dnl AC_ARG_WITH([tags], [AC_HELP_STRING([--with-tags@<:@=TAGS@:>@], [include additional configurations @<:@automatic@:>@])], [tagnames="$withval"]) if test -f "$ltmain" && test -n "$tagnames"; then if test ! -f "${ofile}"; then AC_MSG_WARN([output file `$ofile' does not exist]) fi if test -z "$LTCC"; then eval "`$SHELL ${ofile} --config | grep '^LTCC='`" if test -z "$LTCC"; then AC_MSG_WARN([output file `$ofile' does not look like a libtool script]) else AC_MSG_WARN([using `LTCC=$LTCC', extracted from `$ofile']) fi fi if test -z "$LTCFLAGS"; then eval "`$SHELL ${ofile} --config | grep '^LTCFLAGS='`" fi # Extract list of available tagged configurations in $ofile. # Note that this assumes the entire list is on one line. available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'` lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for tagname in $tagnames; do IFS="$lt_save_ifs" # Check whether tagname contains only valid characters case `$echo "X$tagname" | $Xsed -e 's:[[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]]::g'` in "") ;; *) AC_MSG_ERROR([invalid tag name: $tagname]) ;; esac if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null then AC_MSG_ERROR([tag name \"$tagname\" already exists]) fi # Update the list of available tags. if test -n "$tagname"; then echo appending configuration tag \"$tagname\" to $ofile case $tagname in CXX) if test -n "$CXX" && ( test "X$CXX" != "Xno" && ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || (test "X$CXX" != "Xg++"))) ; then AC_LIBTOOL_LANG_CXX_CONFIG else tagname="" fi ;; F77) if test -n "$F77" && test "X$F77" != "Xno"; then AC_LIBTOOL_LANG_F77_CONFIG else tagname="" fi ;; GCJ) if test -n "$GCJ" && test "X$GCJ" != "Xno"; then AC_LIBTOOL_LANG_GCJ_CONFIG else tagname="" fi ;; RC) AC_LIBTOOL_LANG_RC_CONFIG ;; *) AC_MSG_ERROR([Unsupported tag name: $tagname]) ;; esac # Append the new tag name to the list of available tags. if test -n "$tagname" ; then available_tags="$available_tags $tagname" fi fi done IFS="$lt_save_ifs" # Now substitute the updated list of available tags. if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then mv "${ofile}T" "$ofile" chmod +x "$ofile" else rm -f "${ofile}T" AC_MSG_ERROR([unable to update list of available tagged configurations.]) fi fi ])# _LT_AC_TAGCONFIG # AC_LIBTOOL_DLOPEN # ----------------- # enable checks for dlopen support AC_DEFUN([AC_LIBTOOL_DLOPEN], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP]) ])# AC_LIBTOOL_DLOPEN # AC_LIBTOOL_WIN32_DLL # -------------------- # declare package support for building win32 DLLs AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_BEFORE([$0], [AC_LIBTOOL_SETUP]) ])# AC_LIBTOOL_WIN32_DLL # AC_ENABLE_SHARED([DEFAULT]) # --------------------------- # implement the --enable-shared flag # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. AC_DEFUN([AC_ENABLE_SHARED], [define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl AC_ARG_ENABLE([shared], [AC_HELP_STRING([--enable-shared@<:@=PKGS@:>@], [build shared libraries @<:@default=]AC_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=]AC_ENABLE_SHARED_DEFAULT) ])# AC_ENABLE_SHARED # AC_DISABLE_SHARED # ----------------- # set the default shared flag to --disable-shared AC_DEFUN([AC_DISABLE_SHARED], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl AC_ENABLE_SHARED(no) ])# AC_DISABLE_SHARED # AC_ENABLE_STATIC([DEFAULT]) # --------------------------- # implement the --enable-static flag # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. AC_DEFUN([AC_ENABLE_STATIC], [define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl AC_ARG_ENABLE([static], [AC_HELP_STRING([--enable-static@<:@=PKGS@:>@], [build static libraries @<:@default=]AC_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=]AC_ENABLE_STATIC_DEFAULT) ])# AC_ENABLE_STATIC # AC_DISABLE_STATIC # ----------------- # set the default static flag to --disable-static AC_DEFUN([AC_DISABLE_STATIC], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl AC_ENABLE_STATIC(no) ])# AC_DISABLE_STATIC # AC_ENABLE_FAST_INSTALL([DEFAULT]) # --------------------------------- # implement the --enable-fast-install flag # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. AC_DEFUN([AC_ENABLE_FAST_INSTALL], [define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl AC_ARG_ENABLE([fast-install], [AC_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], [optimize for fast installation @<:@default=]AC_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=]AC_ENABLE_FAST_INSTALL_DEFAULT) ])# AC_ENABLE_FAST_INSTALL # AC_DISABLE_FAST_INSTALL # ----------------------- # set the default to --disable-fast-install AC_DEFUN([AC_DISABLE_FAST_INSTALL], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl AC_ENABLE_FAST_INSTALL(no) ])# AC_DISABLE_FAST_INSTALL # AC_LIBTOOL_PICMODE([MODE]) # -------------------------- # implement the --with-pic flag # MODE is either `yes' or `no'. If omitted, it defaults to `both'. AC_DEFUN([AC_LIBTOOL_PICMODE], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl pic_mode=ifelse($#,1,$1,default) ])# AC_LIBTOOL_PICMODE # AC_PROG_EGREP # ------------- # This is predefined starting with Autoconf 2.54, so this conditional # definition can be removed once we require Autoconf 2.54 or later. m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP], [AC_CACHE_CHECK([for egrep], [ac_cv_prog_egrep], [if echo a | (grep -E '(a|b)') >/dev/null 2>&1 then ac_cv_prog_egrep='grep -E' else ac_cv_prog_egrep='egrep' fi]) EGREP=$ac_cv_prog_egrep AC_SUBST([EGREP]) ])]) # AC_PATH_TOOL_PREFIX # ------------------- # find a file program which can recognize shared library AC_DEFUN([AC_PATH_TOOL_PREFIX], [AC_REQUIRE([AC_PROG_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="ifelse([$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 <&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 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 ])# AC_PATH_TOOL_PREFIX # AC_PATH_MAGIC # ------------- # find a file program which can recognize a shared library AC_DEFUN([AC_PATH_MAGIC], [AC_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 AC_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) else MAGIC_CMD=: fi fi ])# AC_PATH_MAGIC # AC_PROG_LD # ---------- # find the pathname to the GNU or non-GNU linker AC_DEFUN([AC_PROG_LD], [AC_ARG_WITH([gnu-ld], [AC_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]) AC_REQUIRE([LT_AC_PROG_SED])dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. AC_MSG_CHECKING([for ld used by $CC]) case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [[\\/]]* | ?:[[\\/]]*) re_direlt='/[[^/]][[^/]]*/\.\./' # Canonicalize the pathname of ld ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'` while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then AC_MSG_CHECKING([for GNU ld]) else AC_MSG_CHECKING([for non-GNU ld]) fi AC_CACHE_VAL(lt_cv_path_LD, [if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &1 /dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | dragonfly*) if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; gnu*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]'] lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix[[3-9]]*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be Linux ELF. linux* | k*bsd*-gnu) lt_cv_deplibs_check_method=pass_all ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; nto-qnx*) lt_cv_deplibs_check_method=unknown ;; 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 ;; 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 ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; esac ]) file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown ])# AC_DEPLIBS_CHECK_METHOD # AC_PROG_NM # ---------- # find the pathname to a BSD-compatible name lister AC_DEFUN([AC_PROG_NM], [AC_CACHE_CHECK([for BSD-compatible 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 test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm fi]) NM="$lt_cv_path_NM" ])# AC_PROG_NM # AC_CHECK_LIBM # ------------- # check for math library AC_DEFUN([AC_CHECK_LIBM], [AC_REQUIRE([AC_CANONICAL_HOST])dnl LIBM= case $host in *-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*) # These system don't have libm, or don't need it ;; *-ncr-sysv4.3*) AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") ;; *) AC_CHECK_LIB(m, cos, LIBM="-lm") ;; esac ])# AC_CHECK_LIBM # AC_LIBLTDL_CONVENIENCE([DIRECTORY]) # ----------------------------------- # 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. If DIRECTORY is not provided, # it is assumed to be `libltdl'. LIBLTDL will be prefixed 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_builddir and top_srcdir appropriately in # the Makefiles. AC_DEFUN([AC_LIBLTDL_CONVENIENCE], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl 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='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) # For backwards non-gettext consistent compatibility... INCLTDL="$LTDLINCL" ])# AC_LIBLTDL_CONVENIENCE # AC_LIBLTDL_INSTALLABLE([DIRECTORY]) # ----------------------------------- # 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 here. If DIRECTORY is not provided, # and an installed libltdl is not found, it is assumed to be `libltdl'. # LIBLTDL will be prefixed with '${top_builddir}/'# and LTDLINCL with # '${top_srcdir}/' (note the single quotes!). If your package is not # flat and you're not using automake, define top_builddir and top_srcdir # appropriately in the Makefiles. # In the future, this macro may have to be called after AC_PROG_LIBTOOL. AC_DEFUN([AC_LIBLTDL_INSTALLABLE], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl AC_CHECK_LIB(ltdl, lt_dlinit, [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no], [if test x"$enable_ltdl_install" = xno; then AC_MSG_WARN([libltdl not installed, but installation disabled]) else enable_ltdl_install=yes fi ]) if test x"$enable_ltdl_install" = x"yes"; then ac_configure_args="$ac_configure_args --enable-ltdl-install" LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) else ac_configure_args="$ac_configure_args --enable-ltdl-install=no" LIBLTDL="-lltdl" LTDLINCL= fi # For backwards non-gettext consistent compatibility... INCLTDL="$LTDLINCL" ])# AC_LIBLTDL_INSTALLABLE # AC_LIBTOOL_CXX # -------------- # enable support for C++ libraries AC_DEFUN([AC_LIBTOOL_CXX], [AC_REQUIRE([_LT_AC_LANG_CXX]) ])# AC_LIBTOOL_CXX # _LT_AC_LANG_CXX # --------------- AC_DEFUN([_LT_AC_LANG_CXX], [AC_REQUIRE([AC_PROG_CXX]) AC_REQUIRE([_LT_AC_PROG_CXXCPP]) _LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}CXX]) ])# _LT_AC_LANG_CXX # _LT_AC_PROG_CXXCPP # ------------------ AC_DEFUN([_LT_AC_PROG_CXXCPP], [ AC_REQUIRE([AC_PROG_CXX]) if test -n "$CXX" && ( test "X$CXX" != "Xno" && ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || (test "X$CXX" != "Xg++"))) ; then AC_PROG_CXXCPP fi ])# _LT_AC_PROG_CXXCPP # AC_LIBTOOL_F77 # -------------- # enable support for Fortran 77 libraries AC_DEFUN([AC_LIBTOOL_F77], [AC_REQUIRE([_LT_AC_LANG_F77]) ])# AC_LIBTOOL_F77 # _LT_AC_LANG_F77 # --------------- AC_DEFUN([_LT_AC_LANG_F77], [AC_REQUIRE([AC_PROG_F77]) _LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}F77]) ])# _LT_AC_LANG_F77 # AC_LIBTOOL_GCJ # -------------- # enable support for GCJ libraries AC_DEFUN([AC_LIBTOOL_GCJ], [AC_REQUIRE([_LT_AC_LANG_GCJ]) ])# AC_LIBTOOL_GCJ # _LT_AC_LANG_GCJ # --------------- AC_DEFUN([_LT_AC_LANG_GCJ], [AC_PROVIDE_IFELSE([AC_PROG_GCJ],[], [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],[], [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],[], [ifdef([AC_PROG_GCJ],[AC_REQUIRE([AC_PROG_GCJ])], [ifdef([A][M_PROG_GCJ],[AC_REQUIRE([A][M_PROG_GCJ])], [AC_REQUIRE([A][C_PROG_GCJ_OR_A][M_PROG_GCJ])])])])])]) _LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}GCJ]) ])# _LT_AC_LANG_GCJ # AC_LIBTOOL_RC # ------------- # enable support for Windows resource files AC_DEFUN([AC_LIBTOOL_RC], [AC_REQUIRE([LT_AC_PROG_RC]) _LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}RC]) ])# AC_LIBTOOL_RC # AC_LIBTOOL_LANG_C_CONFIG # ------------------------ # Ensure that the configuration vars for the C compiler are # suitably defined. Those variables are subsequently used by # AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG], [_LT_AC_LANG_C_CONFIG]) AC_DEFUN([_LT_AC_LANG_C_CONFIG], [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_AC_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_AC_SYS_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1) AC_LIBTOOL_PROG_COMPILER_PIC($1) AC_LIBTOOL_PROG_CC_C_O($1) AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) AC_LIBTOOL_PROG_LD_SHLIBS($1) AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) AC_LIBTOOL_SYS_LIB_STRIP AC_LIBTOOL_DLOPEN_SELF # 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]) AC_LIBTOOL_CONFIG($1) AC_LANG_POP CC="$lt_save_CC" ])# AC_LIBTOOL_LANG_C_CONFIG # AC_LIBTOOL_LANG_CXX_CONFIG # -------------------------- # Ensure that the configuration vars for the C compiler are # suitably defined. Those variables are subsequently used by # AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG], [_LT_AC_LANG_CXX_CONFIG(CXX)]) AC_DEFUN([_LT_AC_LANG_CXX_CONFIG], [AC_LANG_PUSH(C++) AC_REQUIRE([AC_PROG_CXX]) AC_REQUIRE([_LT_AC_PROG_CXXCPP]) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no _LT_AC_TAGVAR(allow_undefined_flag, $1)= _LT_AC_TAGVAR(always_export_symbols, $1)=no _LT_AC_TAGVAR(archive_expsym_cmds, $1)= _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= _LT_AC_TAGVAR(hardcode_minus_L, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_AC_TAGVAR(hardcode_automatic, $1)=no _LT_AC_TAGVAR(module_cmds, $1)= _LT_AC_TAGVAR(module_expsym_cmds, $1)= _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown _LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_AC_TAGVAR(no_undefined_flag, $1)= _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Dependencies to place before and after the object being linked: _LT_AC_TAGVAR(predep_objects, $1)= _LT_AC_TAGVAR(postdep_objects, $1)= _LT_AC_TAGVAR(predeps, $1)= _LT_AC_TAGVAR(postdeps, $1)= _LT_AC_TAGVAR(compiler_lib_search_path, $1)= _LT_AC_TAGVAR(compiler_lib_search_dirs, $1)= # Source file extension for C++ test sources. ac_ext=cpp # Object file extension for compiled C++ test sources. objext=o _LT_AC_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(int, char *[[]]) { return(0); }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_AC_SYS_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_LD=$LD lt_save_GCC=$GCC GCC=$GXX lt_save_with_gnu_ld=$with_gnu_ld lt_save_path_LD=$lt_cv_path_LD if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx else $as_unset lt_cv_prog_gnu_ld fi if test -n "${lt_cv_path_LDCXX+set}"; then lt_cv_path_LD=$lt_cv_path_LDCXX else $as_unset lt_cv_path_LD fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} compiler=$CC _LT_AC_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) # We don't want -fno-exception wen compiling C++ code, so set the # no_builtin_flag separately if test "$GXX" = yes; then _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' else _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= fi if test "$GXX" = yes; then # Set up default GNU C++ configuration AC_PROG_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_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' _LT_AC_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_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else _LT_AC_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_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' fi # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' else GXX=no with_gnu_ld=no wlarc= fi # PORTME: fill in a description of your system's C++ link characteristics AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) _LT_AC_TAGVAR(ld_shlibs, $1)=yes case $host_os in aix3*) # FIXME: insert proper C++ library support _LT_AC_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_AC_TAGVAR(archive_cmds, $1)='' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_AC_TAGVAR(link_all_deplibs, $1)=yes 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_AC_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_AC_TAGVAR(hardcode_minus_L, $1)=yes _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then 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 # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. _LT_AC_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_AC_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an empty executable. _LT_AC_SYS_LIBPATH_AIX _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an empty executable. _LT_AC_SYS_LIBPATH_AIX _LT_AC_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_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' # Exported symbols can be pulled into shared objects from archives _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='$convenience' _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds its shared libraries. _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; beos*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; chorus*) case $cc_basename in *) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac ;; cygwin* | mingw* | pw32*) # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_AC_TAGVAR(always_export_symbols, $1)=no _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then 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_AC_TAGVAR(ld_shlibs, $1)=no fi ;; darwin* | rhapsody*) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_automatic, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='' _LT_AC_TAGVAR(link_all_deplibs, $1)=yes _LT_AC_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined" if test "$GXX" = yes ; then output_verbose_link_cmd='echo' _LT_AC_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_AC_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" _LT_AC_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_AC_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}" if test "$lt_cv_apple_cc_single_mod" != "yes"; then _LT_AC_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_AC_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 case $cc_basename in xlc*) output_verbose_link_cmd='echo' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $xlcverstring' _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $xlcverstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' ;; *) _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac fi ;; dgux*) case $cc_basename in ec++*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; ghcx*) # Green Hills C++ Compiler # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac ;; freebsd[[12]]*) # C++ shared libraries reported to be fairly broken before switch to ELF _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; freebsd-elf*) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no ;; freebsd* | dragonfly*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions _LT_AC_TAGVAR(ld_shlibs, $1)=yes ;; gnu*) ;; hpux9*) _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_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_AC_TAGVAR(ld_shlibs, $1)=no ;; aCC*) _LT_AC_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) | grep "[[-]]L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes; then _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; hpux10*|hpux11*) if test $with_gnu_ld = no; then _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) ;; *) _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ;; esac fi case $host_cpu in hppa*64*|ia64*) _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_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_AC_TAGVAR(ld_shlibs, $1)=no ;; aCC*) case $host_cpu in hppa*64*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes; then if test $with_gnu_ld = no; then case $host_cpu in hppa*64*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi else # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; interix[[3-9]]*) _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; irix5* | irix6*) case $cc_basename in CC*) # SGI C++ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -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_AC_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_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib' fi fi _LT_AC_TAGVAR(link_all_deplibs, $1)=yes ;; esac _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: ;; linux* | k*bsd*-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_AC_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_AC_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath,$libdir' _LT_AC_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_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; icpc*) # 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_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_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_AC_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_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_AC_TAGVAR(archive_cmds_need_lc, $1)=no _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' ;; pgCC* | pgcpp*) # Portland Group C++ compiler _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' _LT_AC_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' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' ;; cxx*) # Compaq C++ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_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_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' # Not sure whether something based on # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 # would be better. output_verbose_link_cmd='echo' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; esac ;; esac ;; lynxos*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; m88k*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; mvs*) case $cc_basename in cxx*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' wlarc= _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_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::"' ;; openbsd2*) # C++ shared libraries are fairly broken _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; openbsd*) if test -f /usr/libexec/ld.so; then _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' _LT_AC_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_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' fi output_verbose_link_cmd='echo' else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; osf3*) 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_AC_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_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; cxx*) _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' else # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; 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_AC_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_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: # Archives containing C++ object files must be created using # the KAI C++ compiler. _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; cxx*) _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' _LT_AC_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_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' else # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; psos*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; lcc*) # Lucid # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac ;; solaris*) case $cc_basename in CC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_AC_TAGVAR(archive_cmds_need_lc,$1)=yes _LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $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_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_AC_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_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;; esac _LT_AC_TAGVAR(link_all_deplibs, $1)=yes output_verbose_link_cmd='echo' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; gcx*) # Green Hills C++ Compiler _LT_AC_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_AC_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_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' if $CC --version | grep -v '^2\.7' > /dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" else # g++ 2.7 appears to require `-G' NOT `-shared' on this # platform. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) _LT_AC_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_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. # So that behaviour is only enabled if SCOABSPATH is set to a # non-empty value in the environment. Most likely only useful for # creating official distributions of packages. # This is a hack until libtool officially supports absolute path # names for shared libraries. _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_AC_TAGVAR(link_all_deplibs, $1)=yes _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac ;; vxworks*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)]) test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no _LT_AC_TAGVAR(GCC, $1)="$GXX" _LT_AC_TAGVAR(LD, $1)="$LD" AC_LIBTOOL_POSTDEP_PREDEP($1) AC_LIBTOOL_PROG_COMPILER_PIC($1) AC_LIBTOOL_PROG_CC_C_O($1) AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) AC_LIBTOOL_PROG_LD_SHLIBS($1) AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) AC_LIBTOOL_CONFIG($1) AC_LANG_POP CC=$lt_save_CC LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC with_gnu_ldcxx=$with_gnu_ld 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 ])# AC_LIBTOOL_LANG_CXX_CONFIG # AC_LIBTOOL_POSTDEP_PREDEP([TAGNAME]) # ------------------------------------ # Figure out "hidden" library dependencies from verbose # compiler output when linking a shared library. # Parse the compiler output and extract the necessary # objects, libraries and library flags. AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP], [AC_REQUIRE([LT_AC_PROG_SED])dnl 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... ifelse([$1],[],[cat > conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext <&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_AC_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' fi ;; esac ;; solaris*) case $cc_basename in CC*) # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as # -library=stlport4 depends on it. case " $CXX $CXXFLAGS " in *" -library=stlport4 "*) solaris_use_stlport4=yes ;; esac # Adding this requires a known-good setup of shared libraries for # Sun compiler versions before 5.6, else PIC objects from an old # archive will be linked into the output, leading to subtle bugs. if test "$solaris_use_stlport4" != yes; then _LT_AC_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' fi ;; esac ;; esac ]) case " $_LT_AC_TAGVAR(postdeps, $1) " in *" -lc "*) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no ;; esac ])# AC_LIBTOOL_POSTDEP_PREDEP # AC_LIBTOOL_LANG_F77_CONFIG # -------------------------- # Ensure that the configuration vars for the C compiler are # suitably defined. Those variables are subsequently used by # AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG], [_LT_AC_LANG_F77_CONFIG(F77)]) AC_DEFUN([_LT_AC_LANG_F77_CONFIG], [AC_REQUIRE([AC_PROG_F77]) AC_LANG_PUSH(Fortran 77) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no _LT_AC_TAGVAR(allow_undefined_flag, $1)= _LT_AC_TAGVAR(always_export_symbols, $1)=no _LT_AC_TAGVAR(archive_expsym_cmds, $1)= _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= _LT_AC_TAGVAR(hardcode_minus_L, $1)=no _LT_AC_TAGVAR(hardcode_automatic, $1)=no _LT_AC_TAGVAR(module_cmds, $1)= _LT_AC_TAGVAR(module_expsym_cmds, $1)= _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown _LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_AC_TAGVAR(no_undefined_flag, $1)= _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= _LT_AC_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_AC_TAGVAR(objext, $1)=$objext # 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_AC_SYS_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" CC=${F77-"f77"} compiler=$CC _LT_AC_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) 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_AC_TAGVAR(GCC, $1)="$G77" _LT_AC_TAGVAR(LD, $1)="$LD" AC_LIBTOOL_PROG_COMPILER_PIC($1) AC_LIBTOOL_PROG_CC_C_O($1) AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) AC_LIBTOOL_PROG_LD_SHLIBS($1) AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) AC_LIBTOOL_CONFIG($1) AC_LANG_POP CC="$lt_save_CC" ])# AC_LIBTOOL_LANG_F77_CONFIG # AC_LIBTOOL_LANG_GCJ_CONFIG # -------------------------- # Ensure that the configuration vars for the C compiler are # suitably defined. Those variables are subsequently used by # AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG], [_LT_AC_LANG_GCJ_CONFIG(GCJ)]) AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG], [AC_LANG_SAVE # Source file extension for Java test sources. ac_ext=java # Object file extension for compiled Java test sources. objext=o _LT_AC_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_AC_SYS_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" CC=${GCJ-"gcj"} compiler=$CC _LT_AC_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) # GCJ did not exist at the time GCC didn't implicitly link libc in. _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no _LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1) AC_LIBTOOL_PROG_COMPILER_PIC($1) AC_LIBTOOL_PROG_CC_C_O($1) AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) AC_LIBTOOL_PROG_LD_SHLIBS($1) AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) AC_LIBTOOL_CONFIG($1) AC_LANG_RESTORE CC="$lt_save_CC" ])# AC_LIBTOOL_LANG_GCJ_CONFIG # AC_LIBTOOL_LANG_RC_CONFIG # ------------------------- # Ensure that the configuration vars for the Windows resource compiler are # suitably defined. Those variables are subsequently used by # AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG], [_LT_AC_LANG_RC_CONFIG(RC)]) AC_DEFUN([_LT_AC_LANG_RC_CONFIG], [AC_LANG_SAVE # Source file extension for RC test sources. ac_ext=rc # Object file extension for compiled RC test sources. objext=o _LT_AC_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_AC_SYS_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" CC=${RC-"windres"} compiler=$CC _LT_AC_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes AC_LIBTOOL_CONFIG($1) AC_LANG_RESTORE CC="$lt_save_CC" ])# AC_LIBTOOL_LANG_RC_CONFIG # AC_LIBTOOL_CONFIG([TAGNAME]) # ---------------------------- # If TAGNAME is not passed, then 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 # TAGNAME from the matching tagged config vars. AC_DEFUN([AC_LIBTOOL_CONFIG], [# The else clause should only fire when bootstrapping the # libtool distribution, otherwise you forgot to ship ltmain.sh # with your package, and you will get complaints that there are # no rules to generate ltmain.sh. if test -f "$ltmain"; then # 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 # Now quote all the things that may contain metacharacters while being # careful not to overquote the AC_SUBSTed values. We take copies of the # variables and quote the copies for generation of the libtool script. for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \ SED SHELL STRIP \ libname_spec library_names_spec soname_spec extract_expsyms_cmds \ old_striplib striplib file_magic_cmd finish_cmds finish_eval \ deplibs_check_method reload_flag reload_cmds need_locks \ lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ old_postinstall_cmds old_postuninstall_cmds \ _LT_AC_TAGVAR(compiler, $1) \ _LT_AC_TAGVAR(CC, $1) \ _LT_AC_TAGVAR(LD, $1) \ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1) \ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1) \ _LT_AC_TAGVAR(lt_prog_compiler_static, $1) \ _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) \ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1) \ _LT_AC_TAGVAR(thread_safe_flag_spec, $1) \ _LT_AC_TAGVAR(whole_archive_flag_spec, $1) \ _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1) \ _LT_AC_TAGVAR(old_archive_cmds, $1) \ _LT_AC_TAGVAR(old_archive_from_new_cmds, $1) \ _LT_AC_TAGVAR(predep_objects, $1) \ _LT_AC_TAGVAR(postdep_objects, $1) \ _LT_AC_TAGVAR(predeps, $1) \ _LT_AC_TAGVAR(postdeps, $1) \ _LT_AC_TAGVAR(compiler_lib_search_path, $1) \ _LT_AC_TAGVAR(compiler_lib_search_dirs, $1) \ _LT_AC_TAGVAR(archive_cmds, $1) \ _LT_AC_TAGVAR(archive_expsym_cmds, $1) \ _LT_AC_TAGVAR(postinstall_cmds, $1) \ _LT_AC_TAGVAR(postuninstall_cmds, $1) \ _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) \ _LT_AC_TAGVAR(allow_undefined_flag, $1) \ _LT_AC_TAGVAR(no_undefined_flag, $1) \ _LT_AC_TAGVAR(export_symbols_cmds, $1) \ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) \ _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1) \ _LT_AC_TAGVAR(hardcode_libdir_separator, $1) \ _LT_AC_TAGVAR(hardcode_automatic, $1) \ _LT_AC_TAGVAR(module_cmds, $1) \ _LT_AC_TAGVAR(module_expsym_cmds, $1) \ _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1) \ _LT_AC_TAGVAR(fix_srcfile_path, $1) \ _LT_AC_TAGVAR(exclude_expsyms, $1) \ _LT_AC_TAGVAR(include_expsyms, $1); do case $var in _LT_AC_TAGVAR(old_archive_cmds, $1) | \ _LT_AC_TAGVAR(old_archive_from_new_cmds, $1) | \ _LT_AC_TAGVAR(archive_cmds, $1) | \ _LT_AC_TAGVAR(archive_expsym_cmds, $1) | \ _LT_AC_TAGVAR(module_cmds, $1) | \ _LT_AC_TAGVAR(module_expsym_cmds, $1) | \ _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) | \ _LT_AC_TAGVAR(export_symbols_cmds, $1) | \ extract_expsyms_cmds | reload_cmds | finish_cmds | \ postinstall_cmds | postuninstall_cmds | \ old_postinstall_cmds | old_postuninstall_cmds | \ sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) # Double-quote double-evaled strings. eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" ;; *) eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" ;; esac done case $lt_echo in *'\[$]0 --fallback-echo"') lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\[$]0 --fallback-echo"[$]/[$]0 --fallback-echo"/'` ;; esac ifelse([$1], [], [cfgfile="${ofile}T" trap "$rm \"$cfgfile\"; exit 1" 1 2 15 $rm -f "$cfgfile" AC_MSG_NOTICE([creating $ofile])], [cfgfile="$ofile"]) cat <<__EOF__ >> "$cfgfile" ifelse([$1], [], [#! $SHELL # `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) # NOTE: Changes made to this file will be lost: look at ltmain.sh. # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 # Free Software Foundation, Inc. # # This file is part of GNU Libtool: # Originally by Gordon Matzigkeit , 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 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # 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//" # 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 # The names of the tagged configurations supported by this script. available_tags= # ### BEGIN LIBTOOL CONFIG], [# ### BEGIN LIBTOOL TAG CONFIG: $tagname]) # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$_LT_AC_TAGVAR(archive_cmds_need_lc, $1) # Whether or not to disallow shared libs when runtime libs are static allow_libtool_libs_with_static_runtimes=$_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1) # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # An echo program that does not interpret backslashes. echo=$lt_echo # The archiver. AR=$lt_AR AR_FLAGS=$lt_AR_FLAGS # A C compiler. LTCC=$lt_LTCC # LTCC compiler flags. LTCFLAGS=$lt_LTCFLAGS # A language-specific compiler. CC=$lt_[]_LT_AC_TAGVAR(compiler, $1) # Is the compiler the GNU C compiler? with_gcc=$_LT_AC_TAGVAR(GCC, $1) # An ERE matcher. EGREP=$lt_EGREP # The linker used to build libraries. LD=$lt_[]_LT_AC_TAGVAR(LD, $1) # Whether we need hard or soft links. LN_S=$lt_LN_S # A BSD-compatible nm program. NM=$lt_NM # A symbol stripping program STRIP=$lt_STRIP # Used to examine libraries when file_magic_cmd begins "file" MAGIC_CMD=$MAGIC_CMD # Used on cygwin: DLL creation program. DLLTOOL="$DLLTOOL" # Used on cygwin: object dumper. OBJDUMP="$OBJDUMP" # Used on cygwin: assembler. AS="$AS" # The name of the directory that contains temporary libtool files. objdir=$objdir # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # How to pass a linker flag through the compiler. wl=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) # Object file suffix (normally "o"). objext="$ac_objext" # Old archive suffix (normally "a"). libext="$libext" # Shared library suffix (normally ".so"). shrext_cmds='$shrext_cmds' # Executable file suffix (normally ""). exeext="$exeext" # Additional compiler flags for building library objects. pic_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) pic_mode=$pic_mode # What is the maximum length of a command? max_cmd_len=$lt_cv_sys_max_cmd_len # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_[]_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1) # Must we lock files when doing compilation? need_locks=$lt_need_locks # 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 # 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 # Compiler flag to prevent dynamic linking. link_static_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_static, $1) # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_[]_LT_AC_TAGVAR(export_dynamic_flag_spec, $1) # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_[]_LT_AC_TAGVAR(whole_archive_flag_spec, $1) # Compiler flag to generate thread-safe objects. thread_safe_flag_spec=$lt_[]_LT_AC_TAGVAR(thread_safe_flag_spec, $1) # Library versioning type. version_type=$version_type # 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 # Commands used to build and install an old-style archive. RANLIB=$lt_RANLIB old_archive_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_cmds, $1) old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_new_cmds, $1) # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) # Commands used to build and install a shared archive. archive_cmds=$lt_[]_LT_AC_TAGVAR(archive_cmds, $1) archive_expsym_cmds=$lt_[]_LT_AC_TAGVAR(archive_expsym_cmds, $1) postinstall_cmds=$lt_postinstall_cmds postuninstall_cmds=$lt_postuninstall_cmds # Commands used to build a loadable module (assumed same as above if empty) module_cmds=$lt_[]_LT_AC_TAGVAR(module_cmds, $1) module_expsym_cmds=$lt_[]_LT_AC_TAGVAR(module_expsym_cmds, $1) # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # Dependencies to place before the objects being linked to create a # shared library. predep_objects=$lt_[]_LT_AC_TAGVAR(predep_objects, $1) # Dependencies to place after the objects being linked to create a # shared library. postdep_objects=$lt_[]_LT_AC_TAGVAR(postdep_objects, $1) # Dependencies to place before the objects being linked to create a # shared library. predeps=$lt_[]_LT_AC_TAGVAR(predeps, $1) # Dependencies to place after the objects being linked to create a # shared library. postdeps=$lt_[]_LT_AC_TAGVAR(postdeps, $1) # The directories searched by this compiler when creating a shared # library compiler_lib_search_dirs=$lt_[]_LT_AC_TAGVAR(compiler_lib_search_dirs, $1) # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_[]_LT_AC_TAGVAR(compiler_lib_search_path, $1) # 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 # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_[]_LT_AC_TAGVAR(allow_undefined_flag, $1) # Flag that forces no undefined symbols. no_undefined_flag=$lt_[]_LT_AC_TAGVAR(no_undefined_flag, $1) # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # Same as above, but a single script fragment to be evaled but not shown. finish_eval=$lt_finish_eval # 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 # This is the shared library runtime path variable. runpath_var=$runpath_var # This is the shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # How to hardcode a shared library path into an executable. hardcode_action=$_LT_AC_TAGVAR(hardcode_action, $1) # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist. hardcode_libdir_flag_spec=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) # If ld is used when linking, flag to hardcode \$libdir into # a binary during linking. This must work even if \$libdir does # not exist. hardcode_libdir_flag_spec_ld=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1) # Whether we need a single -rpath flag with a separated argument. hardcode_libdir_separator=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_separator, $1) # Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the # resulting binary. hardcode_direct=$_LT_AC_TAGVAR(hardcode_direct, $1) # Set to yes if using the -LDIR flag during linking hardcodes DIR into the # resulting binary. hardcode_minus_L=$_LT_AC_TAGVAR(hardcode_minus_L, $1) # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into # the resulting binary. hardcode_shlibpath_var=$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1) # 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=$_LT_AC_TAGVAR(hardcode_automatic, $1) # Variables whose values should be saved in libtool wrapper scripts and # restored at relink time. variables_saved_for_relink="$variables_saved_for_relink" # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$_LT_AC_TAGVAR(link_all_deplibs, $1) # 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 # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path=$lt_fix_srcfile_path # Set to yes if exported symbols are required. always_export_symbols=$_LT_AC_TAGVAR(always_export_symbols, $1) # The commands to list exported symbols. export_symbols_cmds=$lt_[]_LT_AC_TAGVAR(export_symbols_cmds, $1) # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_[]_LT_AC_TAGVAR(exclude_expsyms, $1) # Symbols that must always be exported. include_expsyms=$lt_[]_LT_AC_TAGVAR(include_expsyms, $1) ifelse([$1],[], [# ### END LIBTOOL CONFIG], [# ### END LIBTOOL TAG CONFIG: $tagname]) __EOF__ ifelse([$1],[], [ case $host_os in aix3*) cat <<\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 EOF ;; esac # 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) mv -f "$cfgfile" "$ofile" || \ (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" ]) else # If there is no Makefile yet, we rely on a make rule to execute # `config.status --recheck' to rerun these tests and create the # libtool script then. ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` if test -f "$ltmain_in"; then test -f Makefile && make "$ltmain" fi fi ])# AC_LIBTOOL_CONFIG # AC_LIBTOOL_PROG_COMPILER_NO_RTTI([TAGNAME]) # ------------------------------------------- AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= if test "$GCC" = yes; then _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], lt_cv_prog_compiler_rtti_exceptions, [-fno-rtti -fno-exceptions], [], [_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) fi ])# AC_LIBTOOL_PROG_COMPILER_NO_RTTI # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE # --------------------------------- AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_REQUIRE([AC_CANONICAL_HOST]) AC_REQUIRE([LT_AC_PROG_SED]) AC_REQUIRE([AC_PROG_NM]) AC_REQUIRE([AC_OBJEXT]) # 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]]*\)' # Transform an extracted symbol line into a proper C declaration lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \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\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" # Define system-specific variables. case $host_os in aix*) symcode='[[BCDT]]' ;; cygwin* | mingw* | pw32*) symcode='[[ABCDGISTW]]' ;; hpux*) # Its linker distinguishes data from code symbols if test "$host_cpu" = ia64; then symcode='[[ABCDEGRST]]' fi lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" ;; linux* | k*bsd*-gnu) if test "$host_cpu" = ia64; then symcode='[[ABCDGIRSTW]]' lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" 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 # 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 # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[[ABCDGIRSTW]]' ;; esac # Try without a prefix undercore, 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. lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext < $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 < conftest.$ac_ext #ifdef __cplusplus extern "C" { #endif EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext' cat <> conftest.$ac_ext #if defined (__STDC__) && __STDC__ # define lt_ptr_t void * #else # define lt_ptr_t char * # define const #endif /* The mapping between symbol names and symbols. */ const struct { const char *name; lt_ptr_t address; } lt_preloaded_symbols[[]] = { EOF $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext cat <<\EOF >> conftest.$ac_ext {0, (lt_ptr_t) 0} }; #ifdef __cplusplus } #endif EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_save_LIBS="$LIBS" lt_save_CFLAGS="$CFLAGS" LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then pipe_works=yes fi LIBS="$lt_save_LIBS" CFLAGS="$lt_save_CFLAGS" else echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD fi else echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD cat conftest.$ac_ext >&5 fi rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test "$pipe_works" = yes; then break else lt_cv_sys_global_symbol_pipe= fi done ]) if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then AC_MSG_RESULT(failed) else AC_MSG_RESULT(ok) fi ]) # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE # AC_LIBTOOL_PROG_COMPILER_PIC([TAGNAME]) # --------------------------------------- AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC], [_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)= _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= _LT_AC_TAGVAR(lt_prog_compiler_static, $1)= AC_MSG_CHECKING([for $compiler option to produce PIC]) ifelse([$1],[CXX],[ # C++ specific cases for pic, static, wl, etc. if test "$GXX" = yes; then _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_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_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; amigaos*) # 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_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | os2* | pw32*) # 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_AC_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_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; *djgpp*) # DJGPP does not support shared libraries at all _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= ;; interix[[3-9]]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; sysv4*MP*) if test -d /usr/nec; then _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; hpux*) # 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*) ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; *) _LT_AC_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_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; chorus*) case $cc_basename in cxch68*) # Green Hills C++ Compiler # _LT_AC_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 ;; darwin*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files case $cc_basename in xlc*) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon' _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ;; esac ;; dgux*) case $cc_basename in ec++*) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; ghcx*) # Green Hills C++ Compiler _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; freebsd* | dragonfly*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) case $cc_basename in CC*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' if test "$host_cpu" != ia64; then _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' fi ;; aCC*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_AC_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_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' # CC pic flag -KPIC is the default. ;; *) ;; esac ;; linux* | k*bsd*-gnu) case $cc_basename in KCC*) # KAI C++ Compiler _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; icpc* | ecpc*) # Intel C++ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; pgCC* | pgcpp*) # Portland Group C++ compiler. _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_AC_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_AC_TAGVAR(lt_prog_compiler_pic, $1)= _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; esac ;; esac ;; lynxos*) ;; m88k*) ;; mvs*) case $cc_basename in cxx*) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' ;; *) ;; esac ;; netbsd* | netbsdelf*-gnu) ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' ;; RCC*) # Rational C++ 2.4.1 _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; cxx*) # Digital/Compaq C++ _LT_AC_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_AC_TAGVAR(lt_prog_compiler_pic, $1)= _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; *) ;; esac ;; psos*) ;; solaris*) case $cc_basename in CC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; gcx*) # Green Hills C++ Compiler _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' ;; *) ;; esac ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; lcc*) # Lucid _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; *) ;; esac ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) case $cc_basename in CC*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; vxworks*) ;; *) _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ], [ if test "$GCC" = yes; then _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_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_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; amigaos*) # 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_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2*) # 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_AC_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_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; 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_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no enable_shared=no ;; sysv4*MP*) if test -d /usr/nec; then _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; hpux*) # 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_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; darwin*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files case $cc_basename in xlc*) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon' _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ;; esac ;; mingw* | cygwin* | pw32* | os2*) # 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_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; hpux9* | hpux10* | hpux11*) _LT_AC_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_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC (with -KPIC) is the default. _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; newsos6) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; linux* | k*bsd*-gnu) case $cc_basename in icc* | ecc*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; pgcc* | pgf77* | pgf90* | pgf95*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; ccc*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All Alpha code is PIC. _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ;; *Sun\ F*) # Sun Fortran 8.3 passes all unrecognized flags to the linker _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='' ;; esac ;; esac ;; osf3* | osf4* | osf5*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All OSF/1 code is PIC. _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; rdos*) _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; solaris*) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' case $cc_basename in f77* | f90* | f95*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; *) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; esac ;; sunos4*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; unicos*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; uts4*) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *) _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ]) AC_MSG_RESULT([$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)]) # # Check to make sure the PIC flag actually works. # if test -n "$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)"; then AC_LIBTOOL_COMPILER_OPTION([if $compiler PIC flag $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) works], _LT_AC_TAGVAR(lt_cv_prog_compiler_pic_works, $1), [$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])], [], [case $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) in "" | " "*) ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)" ;; esac], [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) fi case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])" ;; esac # # Check to make sure the static flag actually works. # wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_AC_TAGVAR(lt_prog_compiler_static, $1)\" AC_LIBTOOL_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], _LT_AC_TAGVAR(lt_cv_prog_compiler_static_works, $1), $lt_tmp_static_flag, [], [_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=]) ]) # AC_LIBTOOL_PROG_LD_SHLIBS([TAGNAME]) # ------------------------------------ # See if the linker supports building shared libraries. AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_REQUIRE([LT_AC_PROG_SED])dnl AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) ifelse([$1],[CXX],[ _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' case $host_os in aix[[4-9]]*) # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | grep 'GNU' > /dev/null; then _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' else _LT_AC_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_AC_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" ;; cygwin* | mingw*) _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;/^.*[[ ]]__nm__/s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' ;; linux* | k*bsd*-gnu) _LT_AC_TAGVAR(link_all_deplibs, $1)=no ;; *) _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac _LT_AC_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] ],[ runpath_var= _LT_AC_TAGVAR(allow_undefined_flag, $1)= _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no _LT_AC_TAGVAR(archive_cmds, $1)= _LT_AC_TAGVAR(archive_expsym_cmds, $1)= _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)= _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)= _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= _LT_AC_TAGVAR(thread_safe_flag_spec, $1)= _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_minus_L, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown _LT_AC_TAGVAR(hardcode_automatic, $1)=no _LT_AC_TAGVAR(module_cmds, $1)= _LT_AC_TAGVAR(module_expsym_cmds, $1)= _LT_AC_TAGVAR(always_export_symbols, $1)=no _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list _LT_AC_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_AC_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= # Just being paranoid about ensuring that cc_basename is set. _LT_CC_BASENAME([$compiler]) case $host_os in cygwin* | mingw* | pw32*) # 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_AC_TAGVAR(ld_shlibs, $1)=yes if test "$with_gnu_ld" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' _LT_AC_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_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= fi supports_anon_versioning=no case `$LD -v 2>/dev/null` in *\ [[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_AC_TAGVAR(ld_shlibs, $1)=no cat <&2 *** Warning: the GNU linker, at least up to release 2.9.1, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to modify your PATH *** so that a non-GNU linker is found, and then restart. EOF fi ;; amigaos*) _LT_AC_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_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Samuel A. Falvo II reports # that the semantics of dynamic libraries on AmigaOS, at least up # to version 4, is to share data among multiple programs linked # with the same dynamic library. Since this doesn't match the # behavior of shared libraries on other platforms, we can't use # them. _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; beos*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; cygwin* | mingw* | pw32*) # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_AC_TAGVAR(always_export_symbols, $1)=no _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/'\'' -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then 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_AC_TAGVAR(ld_shlibs, $1)=no fi ;; interix[[3-9]]*) _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | k*bsd*-gnu) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then tmp_addflag= case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; *) tmp_sharedflag='-shared' ;; esac _LT_AC_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test $supports_anon_versioning = yes; then _LT_AC_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 _LT_AC_TAGVAR(link_all_deplibs, $1)=no else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then _LT_AC_TAGVAR(ld_shlibs, $1)=no cat <&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. EOF elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_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_AC_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_AC_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib' else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; sunos4*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_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_AC_TAGVAR(ld_shlibs, $1)=no fi ;; esac if test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no; then runpath_var= _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= _LT_AC_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_AC_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_AC_TAGVAR(always_export_symbols, $1)=yes _LT_AC_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_AC_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_AC_TAGVAR(hardcode_direct, $1)=unsupported fi ;; aix[[4-9]]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | grep 'GNU' > /dev/null; then _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' else _LT_AC_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_AC_TAGVAR(archive_cmds, $1)='' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_AC_TAGVAR(link_all_deplibs, $1)=yes 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_AC_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_AC_TAGVAR(hardcode_minus_L, $1)=yes _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then 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 # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. _LT_AC_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_AC_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an empty executable. _LT_AC_SYS_LIBPATH_AIX _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an empty executable. _LT_AC_SYS_LIBPATH_AIX _LT_AC_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_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' # Exported symbols can be pulled into shared objects from archives _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='$convenience' _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds its shared libraries. _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${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*) _LT_AC_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_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # see comment about different semantics on the GNU ld section _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; bsdi[[45]]*) _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic ;; cygwin* | mingw* | pw32*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_AC_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_AC_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='true' # FIXME: Should let the user specify the lib program. _LT_AC_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs' _LT_AC_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`' _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; darwin* | rhapsody*) case $host_os in rhapsody* | darwin1.[[012]]) _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress' ;; *) # Darwin 1.3 on if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' else case ${MACOSX_DEPLOYMENT_TARGET} in 10.[[012]]) _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup' ;; esac fi ;; esac _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_automatic, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='' _LT_AC_TAGVAR(link_all_deplibs, $1)=yes if test "$GCC" = yes ; then output_verbose_link_cmd='echo' _LT_AC_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_AC_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" _LT_AC_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_AC_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}" else case $cc_basename in xlc*) output_verbose_link_cmd='echo' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $xlcverstring' _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $xlcverstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' ;; *) _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac fi ;; dgux*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; freebsd1*) _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; hpux9*) if test "$GCC" = yes; then _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else _LT_AC_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_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: _LT_AC_TAGVAR(hardcode_direct, $1)=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ;; hpux10*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test "$with_gnu_ld" = no; then _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes fi ;; hpux11*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac fi if test "$with_gnu_ld" = no; then _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir' fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: _LT_AC_TAGVAR(link_all_deplibs, $1)=yes ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; newsos6) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; openbsd*) if test -f /usr/libexec/ld.so; then _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' else case $host_os in openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' ;; *) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' ;; esac fi else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; os2*) _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_AC_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_AC_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' else _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' _LT_AC_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~ $LD -shared${allow_undefined_flag} -input $lib.exp $linker_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_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' fi _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: ;; solaris*) _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text' if test "$GCC" = yes; then wlarc='${wl}' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' else wlarc='' _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_AC_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_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' else _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' fi ;; esac _LT_AC_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_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4) case $host_vendor in sni) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_direct, $1)=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' _LT_AC_TAGVAR(hardcode_direct, $1)=no ;; motorola) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4.3*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes _LT_AC_TAGVAR(ld_shlibs, $1)=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_AC_TAGVAR(link_all_deplibs, $1)=yes _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac fi ]) AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)]) test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no # # Do we need to explicitly link libc? # case "x$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)" in x|xyes) # Assume -lc should be added _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $_LT_AC_TAGVAR(archive_cmds, $1) in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. AC_MSG_CHECKING([whether -lc should be explicitly linked in]) $rm conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if AC_TRY_EVAL(ac_compile) 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) pic_flag=$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$_LT_AC_TAGVAR(allow_undefined_flag, $1) _LT_AC_TAGVAR(allow_undefined_flag, $1)= if AC_TRY_EVAL(_LT_AC_TAGVAR(archive_cmds, $1) 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) then _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no else _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes fi _LT_AC_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $rm conftest* AC_MSG_RESULT([$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)]) ;; esac fi ;; esac ])# AC_LIBTOOL_PROG_LD_SHLIBS # _LT_AC_FILE_LTDLL_C # ------------------- # Be careful that the start marker always follows a newline. AC_DEFUN([_LT_AC_FILE_LTDLL_C], [ # /* ltdll.c starts here */ # #define WIN32_LEAN_AND_MEAN # #include # #undef WIN32_LEAN_AND_MEAN # #include # # #ifndef __CYGWIN__ # # ifdef __CYGWIN32__ # # define __CYGWIN__ __CYGWIN32__ # # endif # #endif # # #ifdef __cplusplus # extern "C" { # #endif # BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved); # #ifdef __cplusplus # } # #endif # # #ifdef __CYGWIN__ # #include # DECLARE_CYGWIN_DLL( DllMain ); # #endif # HINSTANCE __hDllInstance_base; # # BOOL APIENTRY # DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved) # { # __hDllInstance_base = hInst; # return TRUE; # } # /* ltdll.c ends here */ ])# _LT_AC_FILE_LTDLL_C # _LT_AC_TAGVAR(VARNAME, [TAGNAME]) # --------------------------------- AC_DEFUN([_LT_AC_TAGVAR], [ifelse([$2], [], [$1], [$1_$2])]) # old names AC_DEFUN([AM_PROG_LIBTOOL], [AC_PROG_LIBTOOL]) AC_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) AC_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) AC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) AC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) AC_DEFUN([AM_PROG_LD], [AC_PROG_LD]) AC_DEFUN([AM_PROG_NM], [AC_PROG_NM]) # This is just to silence aclocal about the macro not being used ifelse([AC_DISABLE_FAST_INSTALL]) AC_DEFUN([LT_AC_PROG_GCJ], [AC_CHECK_TOOL(GCJ, gcj, no) test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" AC_SUBST(GCJFLAGS) ]) AC_DEFUN([LT_AC_PROG_RC], [AC_CHECK_TOOL(RC, windres, no) ]) # Cheap backport of AS_EXECUTABLE_P and required macros # from Autoconf 2.59; we should not use $as_executable_p directly. # _AS_TEST_PREPARE # ---------------- m4_ifndef([_AS_TEST_PREPARE], [m4_defun([_AS_TEST_PREPARE], [if test -x / >/dev/null 2>&1; then as_executable_p='test -x' else as_executable_p='test -f' fi ])])# _AS_TEST_PREPARE # AS_EXECUTABLE_P # --------------- # Check whether a file is executable. m4_ifndef([AS_EXECUTABLE_P], [m4_defun([AS_EXECUTABLE_P], [AS_REQUIRE([_AS_TEST_PREPARE])dnl $as_executable_p $1[]dnl ])])# AS_EXECUTABLE_P # 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. # # LT_AC_PROG_SED # -------------- # Check for a fully-functional sed program, that truncates # as few characters as possible. Prefer GNU sed if found. AC_DEFUN([LT_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]) ]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets # $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to # `$srcdir', `$srcdir/..', or `$srcdir/../..'. # # Of course, Automake must honor this variable whenever it calls a # tool from the auxiliary directory. The problem is that $srcdir (and # therefore $ac_aux_dir as well) can be either absolute or relative, # depending on how configure is run. This is pretty annoying, since # it makes $ac_aux_dir quite unusable in subdirectories: in the top # source directory, any form will work fine, but in subdirectories a # relative path needs to be adjusted first. # # $ac_aux_dir/missing # fails when called from a subdirectory if $ac_aux_dir is relative # $top_srcdir/$ac_aux_dir/missing # fails if $ac_aux_dir is absolute, # fails when called from a subdirectory in a VPATH build with # a relative $ac_aux_dir # # The reason of the latter failure is that $top_srcdir and $ac_aux_dir # are both prefixed by $srcdir. In an in-source build this is usually # harmless because $srcdir is `.', but things will broke when you # start a VPATH build or use an absolute $srcdir. # # So we could use something similar to $top_srcdir/$ac_aux_dir/missing, # iff we strip the leading $srcdir from $ac_aux_dir. That would be: # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` # and then we would define $MISSING as # MISSING="\${SHELL} $am_aux_dir/missing" # This will work as long as MISSING is not called from configure, because # unfortunately $(top_srcdir) has no meaning in configure. # However there are other variables, like CC, which are often used in # configure, and could therefore not use this "fixed" $ac_aux_dir. # # Another solution, used here, is to always expand $ac_aux_dir to an # absolute PATH. The drawback is that using absolute paths prevent a # configured tree to be moved without reconfiguration. AC_DEFUN([AM_AUX_DIR_EXPAND], [dnl Rely on autoconf to set up CDPATH properly. AC_PREREQ([2.50])dnl # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` ]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- # Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 5 # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN]) $1=${$1-"${am_missing_run}$2"} AC_SUBST($1)]) # AM_MISSING_HAS_RUN # ------------------ # Define MISSING if not defined so far and test if it supports --run. # If it does, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([missing])dnl test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= AC_MSG_WARN([`missing' script is too old or missing]) fi ]) m4_include([acinclude.m4]) freeradius-server/autogen.sh000077500000000000000000000006461257552170400165320ustar00rootroot00000000000000#!/bin/sh -e parentdir=`dirname $0` cd $parentdir parentdir=`pwd` libtoolize -f -c #aclocal autoheader autoconf mysubdirs="$mysubdirs `find src/modules/ -name configure -print | sed 's%/configure%%'`" mysubdirs=`echo $mysubdirs` for F in $mysubdirs do echo "Configuring in $F..." (cd $F && grep "^AC_CONFIG_HEADER" configure.in > /dev/null || exit 0; autoheader -I$parentdir) (cd $F && autoconf -I$parentdir) done freeradius-server/config.guess000077500000000000000000001270741257552170400170560ustar00rootroot00000000000000#! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, # Inc. timestamp='2007-11-19' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA # 02110-1301, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Per Bothner . # Please send patches to . Submit a context # diff and a properly formatted ChangeLog entry. # # This script attempts to guess a canonical system name similar to # config.sub. If it succeeds, it prints the system name on stdout, and # exits with 0. Otherwise, it exits with 1. # # The plan is that this can be called by configure scripts if you # don't specify an explicit build system type. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; * ) break ;; esac done if test $# != 0; then echo "$me: too many arguments$help" >&2 exit 1 fi trap 'exit 1' 1 2 15 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a # headache to deal with in a portable fashion. # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. # Portable tmp directory creation inspired by the Autoconf team. set_cc_for_build=' trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; : ${TMPDIR=/tmp} ; { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; dummy=$tmp/dummy ; tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; case $CC_FOR_BUILD,$HOST_CC,$CC in ,,) echo "int x;" > $dummy.c ; for c in cc gcc c89 c99 ; do if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then CC_FOR_BUILD="$c"; break ; fi ; done ; if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found ; fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; esac ; set_cc_for_build= ;' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) if (test -f /.attbin/uname) >/dev/null 2>&1 ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ /usr/sbin/$sysctl 2>/dev/null || echo unknown)` case "${UNAME_MACHINE_ARCH}" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; sh5el) machine=sh5le-unknown ;; *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently, or will in the future. case "${UNAME_MACHINE_ARCH}" in arm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep __ELF__ >/dev/null then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? os=netbsd else os=netbsdelf fi ;; *) os=netbsd ;; esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. case "${UNAME_VERSION}" in Debian*) release='-gnu' ;; *) release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}" exit ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} exit ;; *:ekkoBSD:*:*) echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} exit ;; *:SolidBSD:*:*) echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} exit ;; macppc:MirBSD:*:*) echo powerpc-unknown-mirbsd${UNAME_RELEASE} exit ;; *:MirBSD:*:*) echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; *5.*) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on # OSF/1 and Tru64 systems produced since 1995. I hope that # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case "$ALPHA_CPU_TYPE" in "EV4 (21064)") UNAME_MACHINE="alpha" ;; "EV4.5 (21064)") UNAME_MACHINE="alpha" ;; "LCA4 (21066/21068)") UNAME_MACHINE="alpha" ;; "EV5 (21164)") UNAME_MACHINE="alphaev5" ;; "EV5.6 (21164A)") UNAME_MACHINE="alphaev56" ;; "EV5.6 (21164PC)") UNAME_MACHINE="alphapca56" ;; "EV5.7 (21164PC)") UNAME_MACHINE="alphapca57" ;; "EV6 (21264)") UNAME_MACHINE="alphaev6" ;; "EV6.7 (21264A)") UNAME_MACHINE="alphaev67" ;; "EV6.8CB (21264C)") UNAME_MACHINE="alphaev68" ;; "EV6.8AL (21264B)") UNAME_MACHINE="alphaev68" ;; "EV6.8CX (21264D)") UNAME_MACHINE="alphaev68" ;; "EV6.9A (21264/EV69A)") UNAME_MACHINE="alphaev69" ;; "EV7 (21364)") UNAME_MACHINE="alphaev7" ;; "EV7.9 (21364A)") UNAME_MACHINE="alphaev79" ;; esac # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` exit ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # Should we change UNAME_MACHINE based on the output of uname instead # of the specific Alpha model? echo alpha-pc-interix exit ;; 21064:Windows_NT:50:3) echo alpha-dec-winnt3.5 exit ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit ;; *:[Aa]miga[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-amigaos exit ;; *:[Mm]orph[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-morphos exit ;; *:OS/390:*:*) echo i370-ibm-openedition exit ;; *:z/VM:*:*) echo s390-ibm-zvmoe exit ;; *:OS400:*:*) echo powerpc-ibm-os400 exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit ;; arm:riscos:*:*|arm:RISCOS:*:*) echo arm-unknown-riscos exit ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit ;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then echo pyramid-pyramid-sysv3 else echo pyramid-pyramid-bsd fi exit ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit ;; DRS?6000:unix:4.0:6*) echo sparc-icl-nx6 exit ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7; exit ;; esac ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` exit ;; sun3*:SunOS:*:*) echo m68k-sun-sunos${UNAME_RELEASE} exit ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) echo m68k-sun-sunos${UNAME_RELEASE} ;; sun4) echo sparc-sun-sunos${UNAME_RELEASE} ;; esac exit ;; aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} exit ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor # > m68000). The system name ranges from "MiNT" over "FreeMiNT" # to the lowercase version "mint" (or "freemint"). Finally # the system name "TOS" denotes a system which is actually not # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint${UNAME_RELEASE} exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint${UNAME_RELEASE} exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} exit ;; m68k:machten:*:*) echo m68k-apple-machten${UNAME_RELEASE} exit ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} exit ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix${UNAME_RELEASE} exit ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix${UNAME_RELEASE} exit ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix${UNAME_RELEASE} exit ;; mips:*:*:UMIPS | mips:*:*:RISCos) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && SYSTEM_NAME=`$dummy $dummyarg` && { echo "$SYSTEM_NAME"; exit; } echo mips-mips-riscos${UNAME_RELEASE} exit ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax exit ;; Motorola:*:4.3:PL8-*) echo powerpc-harris-powermax exit ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) echo powerpc-harris-powermax exit ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 exit ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 exit ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 exit ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] then if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ [ ${TARGET_BINARY_INTERFACE}x = x ] then echo m88k-dg-dgux${UNAME_RELEASE} else echo m88k-dg-dguxbcs${UNAME_RELEASE} fi else echo i586-dg-dgux${UNAME_RELEASE} fi exit ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 exit ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 exit ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd exit ;; *:IRIX*:*:*) echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` exit ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix exit ;; ia64:AIX:*:*) if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} exit ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include main() { if (!__power_pc()) exit(1); puts("powerpc-ibm-aix3.2.5"); exit(0); } EOF if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` then echo "$SYSTEM_NAME" else echo rs6000-ibm-aix3.2.5 fi elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 else echo rs6000-ibm-aix3.2 fi exit ;; *:AIX:*:[45]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${IBM_ARCH}-ibm-aix${IBM_REV} exit ;; *:AIX:*:*) echo rs6000-ibm-aix exit ;; ibmrt:4.4BSD:*|romp-ibm:BSD:*) echo romp-ibm-bsd4.4 exit ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to exit ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx exit ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 exit ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd exit ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` case "${UNAME_MACHINE}" in 9000/31? ) HP_ARCH=m68000 ;; 9000/[34]?? ) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "${sc_cpu_version}" in 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case "${sc_kernel_bits}" in 32) HP_ARCH="hppa2.0n" ;; 64) HP_ARCH="hppa2.0w" ;; '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 esac ;; esac fi if [ "${HP_ARCH}" = "" ]; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #define _HPUX_SOURCE #include #include int main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); #endif long cpu = sysconf (_SC_CPU_VERSION); switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break; case CPU_PA_RISC2_0: #if defined(_SC_KERNEL_BITS) switch (bits) { case 64: puts ("hppa2.0w"); break; case 32: puts ("hppa2.0n"); break; default: puts ("hppa2.0"); break; } break; #else /* !defined(_SC_KERNEL_BITS) */ puts ("hppa2.0"); break; #endif default: puts ("hppa1.0"); break; } exit (0); } EOF (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac if [ ${HP_ARCH} = "hppa2.0w" ] then eval $set_cc_for_build # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler # generating 64-bit code. GNU and HP use different nomenclature: # # $ CC_FOR_BUILD=cc ./config.guess # => hppa2.0w-hp-hpux11.23 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess # => hppa64-hp-hpux11.23 if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | grep __LP64__ >/dev/null then HP_ARCH="hppa2.0w" else HP_ARCH="hppa64" fi fi echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit ;; ia64:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux${HPUX_REV} exit ;; 3050*:HI-UX:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include int main () { long cpu = sysconf (_SC_CPU_VERSION); /* The order matters, because CPU_IS_HP_MC68K erroneously returns true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct results, however. */ if (CPU_IS_PA_RISC (cpu)) { switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; default: puts ("hppa-hitachi-hiuxwe2"); break; } } else if (CPU_IS_HP_MC68K (cpu)) puts ("m68k-hitachi-hiuxwe2"); else puts ("unknown-hitachi-hiuxwe2"); exit (0); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } echo unknown-hitachi-hiuxwe2 exit ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) echo hppa1.1-hp-bsd exit ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) echo hppa1.1-hp-osf exit ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-unknown-osf1mk else echo ${UNAME_MACHINE}-unknown-osf1 fi exit ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd exit ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd exit ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*[A-Z]90:*:*:*) echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit ;; CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; *:UNICOS/mp:*:*) echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi${UNAME_RELEASE} exit ;; *:BSD/OS:*:*) echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit ;; *:FreeBSD:*:*) case ${UNAME_MACHINE} in pc98) echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; amd64) echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; *) echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; esac exit ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit ;; *:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; i*:windows32*:*) # uname -m includes "-pc" on this system. echo ${UNAME_MACHINE}-mingw32 exit ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit ;; *:Interix*:[3456]*) case ${UNAME_MACHINE} in x86) echo i586-pc-interix${UNAME_RELEASE} exit ;; EM64T | authenticamd) echo x86_64-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 ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we # UNAME_MACHINE based on the output of uname instead of i386? echo i586-pc-interix exit ;; i*:UWIN*:*) echo ${UNAME_MACHINE}-pc-uwin exit ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) echo x86_64-unknown-cygwin exit ;; p*:CYGWIN*:*) echo powerpcle-unknown-cygwin exit ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; *:GNU:*:*) # the GNU system echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu exit ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit ;; arm*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; avr32*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; cris:Linux:*:*) echo cris-axis-linux-gnu exit ;; crisv32:Linux:*:*) echo crisv32-axis-linux-gnu exit ;; frv:Linux:*:*) echo frv-unknown-linux-gnu exit ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; m32r*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; mips:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef mips #undef mipsel #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=mipsel #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=mips #else CPU= #endif #endif EOF eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' /^CPU/{ s: ::g p }'`" test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } ;; mips64:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef mips64 #undef mips64el #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=mips64el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=mips64 #else CPU= #endif #endif EOF eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' /^CPU/{ s: ::g p }'`" test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } ;; or32:Linux:*:*) echo or32-unknown-linux-gnu exit ;; ppc:Linux:*:*) echo powerpc-unknown-linux-gnu exit ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-gnu exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; PCA57) UNAME_MACHINE=alphapca56 ;; EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) echo hppa1.1-unknown-linux-gnu ;; PA8*) echo hppa2.0-unknown-linux-gnu ;; *) echo hppa-unknown-linux-gnu ;; esac exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-gnu exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux exit ;; sh64*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; vax:Linux:*:*) echo ${UNAME_MACHINE}-dec-linux-gnu exit ;; x86_64:Linux:*:*) echo x86_64-unknown-linux-gnu exit ;; xtensa*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; i*86:Linux:*:*) # The BFD linker knows what the default object file format is, so # first see if it will tell us. cd to the root directory to prevent # problems with other programs or directories called `ld' in the path. # Set LC_ALL=C to ensure ld outputs messages in English. ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \ | sed -ne '/supported targets:/!d s/[ ][ ]*/ /g s/.*supported targets: *// s/ .*// p'` case "$ld_supported_targets" in elf32-i386) TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" ;; a.out-i386-linux) echo "${UNAME_MACHINE}-pc-linux-gnuaout" exit ;; coff-i386) echo "${UNAME_MACHINE}-pc-linux-gnucoff" exit ;; "") # Either a pre-BFD a.out linker (linux-gnuoldld) or # one that does not give us useful --help. echo "${UNAME_MACHINE}-pc-linux-gnuoldld" exit ;; esac # Determine whether the default compiler is a.out or elf eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include #ifdef __ELF__ # ifdef __GLIBC__ # if __GLIBC__ >= 2 LIBC=gnu # else LIBC=gnulibc1 # endif # else LIBC=gnulibc1 # endif #else #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC) LIBC=gnu #else LIBC=gnuaout #endif #endif #ifdef __dietlibc__ LIBC=dietlibc #endif EOF eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' /^LIBC/{ s: ::g p }'`" test x"${LIBC}" != x && { echo "${UNAME_MACHINE}-pc-linux-${LIBC}" exit } test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; } ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. echo i386-sequent-sysv4 exit ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. echo ${UNAME_MACHINE}-pc-os2-emx exit ;; i*86:XTS-300:*:STOP) echo ${UNAME_MACHINE}-unknown-stop exit ;; i*86:atheos:*:*) echo ${UNAME_MACHINE}-unknown-atheos exit ;; i*86:syllable:*:*) echo ${UNAME_MACHINE}-pc-syllable exit ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit ;; i*86:*DOS:*:*) echo ${UNAME_MACHINE}-pc-msdosdjgpp exit ;; i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} else echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} fi exit ;; i*86:*:5:[678]*) # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} exit ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL else echo ${UNAME_MACHINE}-pc-sysv32 fi exit ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i386. echo i386-pc-msdosdjgpp exit ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit ;; paragon:*:*:*) echo i860-intel-osf1 exit ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 fi exit ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv exit ;; mc68k:UNIX:SYSTEM5:3.51m) echo m68k-convergent-sysv exit ;; M680?0:D-NIX:5.3:*) echo m68k-diab-dnix exit ;; M68*:*:R3V[5678]*:*) test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} exit ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} exit ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} exit ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 exit ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` echo ${UNAME_MACHINE}-sni-sysv4 else echo ns32k-sni-sysv fi exit ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says echo i586-unisys-sysv4 exit ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 exit ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. echo ${UNAME_MACHINE}-stratus-vos exit ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} exit ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv${UNAME_RELEASE} else echo mips-unknown-sysv${UNAME_RELEASE} fi exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos exit ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux${UNAME_RELEASE} exit ;; SX-6:SUPER-UX:*:*) echo sx6-nec-superux${UNAME_RELEASE} exit ;; SX-7:SUPER-UX:*:*) echo sx7-nec-superux${UNAME_RELEASE} exit ;; SX-8:SUPER-UX:*:*) echo sx8-nec-superux${UNAME_RELEASE} exit ;; SX-8R:SUPER-UX:*:*) echo sx8r-nec-superux${UNAME_RELEASE} exit ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit ;; *:Rhapsody:*:*) echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} exit ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown case $UNAME_PROCESSOR in unknown) UNAME_PROCESSOR=powerpc ;; esac echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = "x86"; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} exit ;; *:QNX:*:4*) echo i386-pc-qnx exit ;; NSE-?:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk${UNAME_RELEASE} exit ;; NSR-?:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux exit ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv exit ;; DS/*:UNIX_System_V:*:*) echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} exit ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. if test "$cputype" = "386"; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" fi echo ${UNAME_MACHINE}-unknown-plan9 exit ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 exit ;; *:TENEX:*:*) echo pdp10-unknown-tenex exit ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 exit ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 exit ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 exit ;; *:ITS:*:*) echo pdp10-unknown-its exit ;; SEI:*:*:SEIUX) echo mips-sei-seiux${UNAME_RELEASE} exit ;; *:DragonFly:*:*) echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` case "${UNAME_MACHINE}" in A*) echo alpha-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;; V*) echo vax-dec-vms ; exit ;; esac ;; *:XENIX:*:SysV) echo i386-pc-xenix exit ;; i*86:skyos:*:*) echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' exit ;; i*86:rdos:*:*) echo ${UNAME_MACHINE}-pc-rdos exit ;; esac #echo '(No uname command or uname output not recognized.)' 1>&2 #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 eval $set_cc_for_build cat >$dummy.c < # include #endif main () { #if defined (sony) #if defined (MIPSEB) /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, I don't know.... */ printf ("mips-sony-bsd\n"); exit (0); #else #include printf ("m68k-sony-newsos%s\n", #ifdef NEWSOS4 "4" #else "" #endif ); exit (0); #endif #endif #if defined (__arm) && defined (__acorn) && defined (__unix) printf ("arm-acorn-riscix\n"); exit (0); #endif #if defined (hp300) && !defined (hpux) printf ("m68k-hp-bsd\n"); exit (0); #endif #if defined (NeXT) #if !defined (__ARCHITECTURE__) #define __ARCHITECTURE__ "m68k" #endif int version; version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; if (version < 4) printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); else printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); exit (0); #endif #if defined (MULTIMAX) || defined (n16) #if defined (UMAXV) printf ("ns32k-encore-sysv\n"); exit (0); #else #if defined (CMU) printf ("ns32k-encore-mach\n"); exit (0); #else printf ("ns32k-encore-bsd\n"); exit (0); #endif #endif #endif #if defined (__386BSD__) printf ("i386-pc-bsd\n"); exit (0); #endif #if defined (sequent) #if defined (i386) printf ("i386-sequent-dynix\n"); exit (0); #endif #if defined (ns32000) printf ("ns32k-sequent-dynix\n"); exit (0); #endif #endif #if defined (_SEQUENT_) struct utsname un; uname(&un); if (strncmp(un.version, "V2", 2) == 0) { printf ("i386-sequent-ptx2\n"); exit (0); } if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ printf ("i386-sequent-ptx1\n"); exit (0); } printf ("i386-sequent-ptx\n"); exit (0); #endif #if defined (vax) # if !defined (ultrix) # include # if defined (BSD) # if BSD == 43 printf ("vax-dec-bsd4.3\n"); exit (0); # else # if BSD == 199006 printf ("vax-dec-bsd4.3reno\n"); exit (0); # else printf ("vax-dec-bsd\n"); exit (0); # endif # endif # else printf ("vax-dec-bsd\n"); exit (0); # endif # else printf ("vax-dec-ultrix\n"); exit (0); # endif #endif #if defined (alliant) && defined (i860) printf ("i860-alliant-bsd\n"); exit (0); #endif exit (1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } # Apollos put the system type in the environment. test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } # Convex versions that predate uname can use getsysinfo(1) if [ -x /usr/convex/getsysinfo ] then case `getsysinfo -f cpu_type` in c1*) echo c1-convex-bsd exit ;; c2*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; c34*) echo c34-convex-bsd exit ;; c38*) echo c38-convex-bsd exit ;; c4*) echo c4-convex-bsd exit ;; esac fi cat >&2 < in order to provide the needed information to handle your system. config.guess timestamp = $timestamp uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` /bin/uname -X = `(/bin/uname -X) 2>/dev/null` hostinfo = `(hostinfo) 2>/dev/null` /bin/universe = `(/bin/universe) 2>/dev/null` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` /bin/arch = `(/bin/arch) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` UNAME_MACHINE = ${UNAME_MACHINE} UNAME_RELEASE = ${UNAME_RELEASE} UNAME_SYSTEM = ${UNAME_SYSTEM} UNAME_VERSION = ${UNAME_VERSION} EOF exit 1 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: freeradius-server/config.sub000077500000000000000000001001231257552170400165030ustar00rootroot00000000000000#! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, # Inc. timestamp='2007-11-19' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software # can handle that machine. It does not imply ALL GNU software can. # # This file is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA # 02110-1301, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Please send patches to . Submit a context # diff and a properly formatted ChangeLog entry. # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS $0 [OPTION] ALIAS Canonicalize a configuration name. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.sub ($timestamp) Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" exit 1 ;; *local*) # First pass through any local machine types. echo $1 exit ;; * ) break ;; esac done case $# in 0) echo "$me: missing argument$help" >&2 exit 1;; 1) ;; *) echo "$me: too many arguments$help" >&2 exit 1;; esac # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \ uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; *) basic_machine=`echo $1 | sed 's/-[^-]*$//'` if [ $basic_machine != $1 ] then os=`echo $1 | sed 's/.*-/-/'` else os=; fi ;; esac ### Let's recognize common machines as not being operating systems so ### that things like config.sub decstation-3100 work. We also ### recognize some manufacturers as not being operating systems, so we ### can provide default operating systems below. case $os in -sun*os*) # Prevent following clause from handling this invalid input. ;; -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ -apple | -axis | -knuth | -cray) os= basic_machine=$1 ;; -sim | -cisco | -oki | -wec | -winbond) os= basic_machine=$1 ;; -scout) ;; -wrs) os=-vxworks basic_machine=$1 ;; -chorusos*) os=-chorusos basic_machine=$1 ;; -chorusrdb) os=-chorusrdb basic_machine=$1 ;; -hiux*) os=-hiuxwe2 ;; -sco6) os=-sco5v6 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5) os=-sco3.2v5 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco4) os=-sco3.2v4 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2.[4-9]*) os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2v[4-9]*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5v6*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco*) os=-sco3.2v2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -udk*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -isc) os=-isc2.2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -clix*) basic_machine=clipper-intergraph ;; -isc*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -lynx*) os=-lynxos ;; -ptx*) basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` ;; -windowsnt*) os=`echo $os | sed -e 's/windowsnt/winnt/'` ;; -psos*) os=-psos ;; -mint | -mint[0-9]*) basic_machine=m68k-atari os=-mint ;; esac # Decode aliases for certain CPU-COMPANY combinations. case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. 1750a | 580 \ | a29k \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ | bfin \ | c4x | clipper \ | d10v | d30v | dlx | dsp16xx \ | fido | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ | maxq | mb | microblaze | mcore | mep \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ | mips64vr | mips64vrel \ | mips64orion | mips64orionel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | mt \ | msp430 \ | nios | nios2 \ | ns16k | ns32k \ | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ | pyramid \ | score \ | sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ | spu | strongarm \ | tahoe | thumb | tic4x | tic80 | tron \ | v850 | v850e \ | we32k \ | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \ | z8k) basic_machine=$basic_machine-unknown ;; m6811 | m68hc11 | m6812 | m68hc12) # Motorola 68HC11/12. basic_machine=$basic_machine-unknown os=-none ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; ms1) basic_machine=mt-unknown ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. i*86 | x86_64) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. *-*-*) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | maxq-* | mcore-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ | mips64vr-* | mips64vrel-* \ | mips64orion-* | mips64orionel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ | mips64vr5900-* | mips64vr5900el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ | mt-* \ | msp430-* \ | nios-* | nios2-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ | pyramid-* \ | romp-* | rs6000-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \ | tahoe-* | thumb-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tron-* \ | v850-* | v850e-* | vax-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \ | xstormy16-* | xtensa*-* \ | ymp-* \ | z8k-*) ;; # Recognize the basic CPU types without company name, with glob match. xtensa*) basic_machine=$basic_machine-unknown ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) basic_machine=i386-unknown os=-bsd ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) basic_machine=m68000-att ;; 3b*) basic_machine=we32k-att ;; a29khif) basic_machine=a29k-amd os=-udi ;; abacus) basic_machine=abacus-unknown ;; adobe68k) basic_machine=m68010-adobe os=-scout ;; alliant | fx80) basic_machine=fx80-alliant ;; altos | altos3068) basic_machine=m68k-altos ;; am29k) basic_machine=a29k-none os=-bsd ;; amd64) basic_machine=x86_64-pc ;; amd64-*) basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; amdahl) basic_machine=580-amdahl os=-sysv ;; amiga | amiga-*) basic_machine=m68k-unknown ;; amigaos | amigados) basic_machine=m68k-unknown os=-amigaos ;; amigaunix | amix) basic_machine=m68k-unknown os=-sysv4 ;; apollo68) basic_machine=m68k-apollo os=-sysv ;; apollo68bsd) basic_machine=m68k-apollo os=-bsd ;; aux) basic_machine=m68k-apple os=-aux ;; balance) basic_machine=ns32k-sequent os=-dynix ;; c90) basic_machine=c90-cray os=-unicos ;; convex-c1) basic_machine=c1-convex os=-bsd ;; convex-c2) basic_machine=c2-convex os=-bsd ;; convex-c32) basic_machine=c32-convex os=-bsd ;; convex-c34) basic_machine=c34-convex os=-bsd ;; convex-c38) basic_machine=c38-convex os=-bsd ;; cray | j90) basic_machine=j90-cray os=-unicos ;; craynv) basic_machine=craynv-cray os=-unicosmp ;; cr16) basic_machine=cr16-unknown os=-elf ;; crds | unos) basic_machine=m68k-crds ;; crisv32 | crisv32-* | etraxfs*) basic_machine=crisv32-axis ;; cris | cris-* | etrax*) basic_machine=cris-axis ;; crx) basic_machine=crx-unknown os=-elf ;; da30 | da30-*) basic_machine=m68k-da30 ;; decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) basic_machine=mips-dec ;; decsystem10* | dec10*) basic_machine=pdp10-dec os=-tops10 ;; decsystem20* | dec20*) basic_machine=pdp10-dec os=-tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) basic_machine=m68k-motorola ;; delta88) basic_machine=m88k-motorola os=-sysv3 ;; djgpp) basic_machine=i586-pc os=-msdosdjgpp ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=-bosx ;; dpx2* | dpx2*-bull) basic_machine=m68k-bull os=-sysv3 ;; ebmon29k) basic_machine=a29k-amd os=-ebmon ;; elxsi) basic_machine=elxsi-elxsi os=-bsd ;; encore | umax | mmax) basic_machine=ns32k-encore ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson os=-ose ;; fx2800) basic_machine=i860-alliant ;; genix) basic_machine=ns32k-ns ;; gmicro) basic_machine=tron-gmicro os=-sysv ;; go32) basic_machine=i386-pc os=-go32 ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; h8300hms) basic_machine=h8300-hitachi os=-hms ;; h8300xray) basic_machine=h8300-hitachi os=-xray ;; h8500hms) basic_machine=h8500-hitachi os=-hms ;; harris) basic_machine=m88k-harris os=-sysv3 ;; hp300-*) basic_machine=m68k-hp ;; hp300bsd) basic_machine=m68k-hp os=-bsd ;; hp300hpux) basic_machine=m68k-hp os=-hpux ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) basic_machine=m68000-hp ;; hp9k3[2-9][0-9]) basic_machine=m68k-hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) basic_machine=hppa1.1-hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) basic_machine=hppa1.1-hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; hppa-next) os=-nextstep3 ;; hppaosf) basic_machine=hppa1.1-hp os=-osf ;; hppro) basic_machine=hppa1.1-hp os=-proelf ;; i370-ibm* | ibm*) basic_machine=i370-ibm ;; # I'm not sure what "Sysv32" means. Should this be sysv3.2? i*86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; i*86v4*) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; i*86v) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv ;; i*86sol2) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; i386mach) basic_machine=i386-mach os=-mach ;; i386-vsta | vsta) basic_machine=i386-unknown os=-vsta ;; iris | iris4d) basic_machine=mips-sgi case $os in -irix*) ;; *) os=-irix4 ;; esac ;; isi68 | isi) basic_machine=m68k-isi os=-sysv ;; m88k-omron*) basic_machine=m88k-omron ;; magnum | m3230) basic_machine=mips-mips os=-sysv ;; merlin) basic_machine=ns32k-utek os=-sysv ;; mingw32) basic_machine=i386-pc os=-mingw32 ;; mingw32ce) basic_machine=arm-unknown os=-mingw32ce ;; miniframe) basic_machine=m68000-convergent ;; *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) basic_machine=m68k-atari os=-mint ;; mips3*-*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` ;; mips3*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown ;; monitor) basic_machine=m68k-rom68k os=-coff ;; morphos) basic_machine=powerpc-unknown os=-morphos ;; msdos) basic_machine=i386-pc os=-msdos ;; ms1-*) basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` ;; mvs) basic_machine=i370-ibm os=-mvs ;; ncr3000) basic_machine=i486-ncr os=-sysv4 ;; netbsd386) basic_machine=i386-unknown os=-netbsd ;; netwinder) basic_machine=armv4l-rebel os=-linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony os=-newsos ;; news1000) basic_machine=m68030-sony os=-newsos ;; news-3600 | risc-news) basic_machine=mips-sony os=-newsos ;; necv70) basic_machine=v70-nec os=-sysv ;; next | m*-next ) basic_machine=m68k-next case $os in -nextstep* ) ;; -ns2*) os=-nextstep2 ;; *) os=-nextstep3 ;; esac ;; nh3000) basic_machine=m68k-harris os=-cxux ;; nh[45]000) basic_machine=m88k-harris os=-cxux ;; nindy960) basic_machine=i960-intel os=-nindy ;; mon960) basic_machine=i960-intel os=-mon960 ;; nonstopux) basic_machine=mips-compaq os=-nonstopux ;; np1) basic_machine=np1-gould ;; nsr-tandem) basic_machine=nsr-tandem ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf ;; openrisc | openrisc-*) basic_machine=or32-unknown ;; os400) basic_machine=powerpc-ibm os=-os400 ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=-ose ;; os68k) basic_machine=m68k-none os=-os68k ;; pa-hitachi) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; paragon) basic_machine=i860-intel os=-osf ;; pbd) basic_machine=sparc-tti ;; pbb) basic_machine=m68k-tti ;; pc532 | pc532-*) basic_machine=ns32k-pc532 ;; pc98) basic_machine=i386-pc ;; pc98-*) basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; pentiumpro | p6 | 6x86 | athlon | athlon_*) basic_machine=i686-pc ;; pentiumii | pentium2 | pentiumiii | pentium3) basic_machine=i686-pc ;; pentium4) basic_machine=i786-pc ;; pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium4-*) basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould ;; power) basic_machine=power-ibm ;; ppc) basic_machine=powerpc-unknown ;; ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle | ppc-le | powerpc-little) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64) basic_machine=powerpc64-unknown ;; ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64le | powerpc64little | ppc64-le | powerpc64-little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm ;; pw32) basic_machine=i586-unknown os=-pw32 ;; rdos) basic_machine=i386-pc os=-rdos ;; rom68k) basic_machine=m68k-rom68k os=-coff ;; rm[46]00) basic_machine=mips-siemens ;; rtpc | rtpc-*) basic_machine=romp-ibm ;; s390 | s390-*) basic_machine=s390-ibm ;; s390x | s390x-*) basic_machine=s390x-ibm ;; sa29200) basic_machine=a29k-amd os=-udi ;; sb1) basic_machine=mipsisa64sb1-unknown ;; sb1el) basic_machine=mipsisa64sb1el-unknown ;; sde) basic_machine=mipsisa32-sde os=-elf ;; sei) basic_machine=mips-sei os=-seiux ;; sequent) basic_machine=i386-sequent ;; sh) basic_machine=sh-hitachi os=-hms ;; sh5el) basic_machine=sh5le-unknown ;; sh64) basic_machine=sh64-unknown ;; sparclite-wrs | simso-wrs) basic_machine=sparclite-wrs os=-vxworks ;; sps7) basic_machine=m68k-bull os=-sysv2 ;; spur) basic_machine=spur-unknown ;; st2000) basic_machine=m68k-tandem ;; stratus) basic_machine=i860-stratus os=-sysv4 ;; sun2) basic_machine=m68000-sun ;; sun2os3) basic_machine=m68000-sun os=-sunos3 ;; sun2os4) basic_machine=m68000-sun os=-sunos4 ;; sun3os3) basic_machine=m68k-sun os=-sunos3 ;; sun3os4) basic_machine=m68k-sun os=-sunos4 ;; sun4os3) basic_machine=sparc-sun os=-sunos3 ;; sun4os4) basic_machine=sparc-sun os=-sunos4 ;; sun4sol2) basic_machine=sparc-sun os=-solaris2 ;; sun3 | sun3-*) basic_machine=m68k-sun ;; sun4) basic_machine=sparc-sun ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; sv1) basic_machine=sv1-cray os=-unicos ;; symmetry) basic_machine=i386-sequent os=-dynix ;; t3e) basic_machine=alphaev5-cray os=-unicos ;; t90) basic_machine=t90-cray os=-unicos ;; tic54x | c54x*) basic_machine=tic54x-unknown os=-coff ;; tic55x | c55x*) basic_machine=tic55x-unknown os=-coff ;; tic6x | c6x*) basic_machine=tic6x-unknown os=-coff ;; tx39) basic_machine=mipstx39-unknown ;; tx39el) basic_machine=mipstx39el-unknown ;; toad1) basic_machine=pdp10-xkl os=-tops20 ;; tower | tower-32) basic_machine=m68k-ncr ;; tpf) basic_machine=s390x-ibm os=-tpf ;; udi29k) basic_machine=a29k-amd os=-udi ;; ultra3) basic_machine=a29k-nyu os=-sym1 ;; v810 | necv810) basic_machine=v810-nec os=-none ;; vaxv) basic_machine=vax-dec os=-sysv ;; vms) basic_machine=vax-dec os=-vms ;; vpp*|vx|vx-*) basic_machine=f301-fujitsu ;; vxworks960) basic_machine=i960-wrs os=-vxworks ;; vxworks68) basic_machine=m68k-wrs os=-vxworks ;; vxworks29k) basic_machine=a29k-wrs os=-vxworks ;; w65*) basic_machine=w65-wdc os=-none ;; w89k-*) basic_machine=hppa1.1-winbond os=-proelf ;; xbox) basic_machine=i686-pc os=-mingw32 ;; xps | xps100) basic_machine=xps100-honeywell ;; ymp) basic_machine=ymp-cray os=-unicos ;; z8k-*-coff) basic_machine=z8k-unknown os=-sim ;; none) basic_machine=none-none os=-none ;; # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. w89k) basic_machine=hppa1.1-winbond ;; op50n) basic_machine=hppa1.1-oki ;; op60c) basic_machine=hppa1.1-oki ;; romp) basic_machine=romp-ibm ;; mmix) basic_machine=mmix-knuth ;; rs6000) basic_machine=rs6000-ibm ;; vax) basic_machine=vax-dec ;; pdp10) # there are many clones, so DEC is not a safe bet basic_machine=pdp10-unknown ;; pdp11) basic_machine=pdp11-dec ;; we32k) basic_machine=we32k-att ;; sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) basic_machine=sparc-sun ;; cydra) basic_machine=cydra-cydrome ;; orion) basic_machine=orion-highlevel ;; orion105) basic_machine=clipper-highlevel ;; mac | mpw | mac-mpw) basic_machine=m68k-apple ;; pmac | pmac-mpw) basic_machine=powerpc-apple ;; *-unknown) # Make sure to match an already-canonicalized machine name. ;; *) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; esac # Here we canonicalize certain aliases for manufacturers. case $basic_machine in *-digital*) basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` ;; *-commodore*) basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if [ x"$os" != x"" ] then case $os in # First match some system type aliases # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; -solaris) os=-solaris2 ;; -svr4*) os=-sysv4 ;; -unixware*) os=-sysv4.2uw ;; -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; # First accept the basic system types. # The portable systems comes first. # Each alternative MUST END IN A *, to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ | -openbsd* | -solidbsd* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* \ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ | -skyos* | -haiku* | -rdos* | -toppers* | -drops*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) case $basic_machine in x86-* | i*86-*) ;; *) os=-nto$os ;; esac ;; -nto-qnx*) ;; -nto*) os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) os=`echo $os | sed -e 's|mac|macos|'` ;; -linux-dietlibc) os=-linux-dietlibc ;; -linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; -sunos5*) os=`echo $os | sed -e 's|sunos5|solaris2|'` ;; -sunos6*) os=`echo $os | sed -e 's|sunos6|solaris3|'` ;; -opened*) os=-openedition ;; -os400*) os=-os400 ;; -wince*) os=-wince ;; -osfrose*) os=-osfrose ;; -osf*) os=-osf ;; -utek*) os=-bsd ;; -dynix*) os=-bsd ;; -acis*) os=-aos ;; -atheos*) os=-atheos ;; -syllable*) os=-syllable ;; -386bsd) os=-bsd ;; -ctix* | -uts*) os=-sysv ;; -nova*) os=-rtmk-nova ;; -ns2 ) os=-nextstep2 ;; -nsk*) os=-nsk ;; # Preserve the version number of sinix5. -sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; -sinix*) os=-sysv4 ;; -tpf*) os=-tpf ;; -triton*) os=-sysv3 ;; -oss*) os=-sysv3 ;; -svr4) os=-sysv4 ;; -svr3) os=-sysv3 ;; -sysvr4) os=-sysv4 ;; # This must come after -sysvr4. -sysv*) ;; -ose*) os=-ose ;; -es1800*) os=-ose ;; -xenix) os=-xenix ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) os=-mint ;; -aros*) os=-aros ;; -kaos*) os=-kaos ;; -zvmoe) os=-zvmoe ;; -none) ;; *) # Get rid of the `-' at the beginning of $os. os=`echo $os | sed 's/[^-]*-//'` echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 exit 1 ;; esac else # Here we handle the default operating systems that come with various machines. # The value should be what the vendor currently ships out the door with their # machine or put another way, the most popular os provided with the machine. # Note that if you're going to try to match "-MANUFACTURER" here (say, # "-sun"), then you have to tell the case statement up towards the top # that MANUFACTURER isn't an operating system. Otherwise, code above # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. case $basic_machine in score-*) os=-elf ;; spu-*) os=-elf ;; *-acorn) os=-riscix1.2 ;; arm*-rebel) os=-linux ;; arm*-semi) os=-aout ;; c4x-* | tic4x-*) os=-coff ;; # This must come before the *-dec entry. pdp10-*) os=-tops20 ;; pdp11-*) os=-none ;; *-dec | vax-*) os=-ultrix4.2 ;; m68*-apollo) os=-domain ;; i386-sun) os=-sunos4.0.2 ;; m68000-sun) os=-sunos3 # This also exists in the configure program, but was not the # default. # os=-sunos4 ;; m68*-cisco) os=-aout ;; mep-*) os=-elf ;; mips*-cisco) os=-elf ;; mips*-*) os=-elf ;; or32-*) os=-coff ;; *-tti) # must be before sparc entry or we get the wrong os. os=-sysv3 ;; sparc-* | *-sun) os=-sunos4.1.1 ;; *-be) os=-beos ;; *-haiku) os=-haiku ;; *-ibm) os=-aix ;; *-knuth) os=-mmixware ;; *-wec) os=-proelf ;; *-winbond) os=-proelf ;; *-oki) os=-proelf ;; *-hp) os=-hpux ;; *-hitachi) os=-hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) os=-sysv ;; *-cbm) os=-amigaos ;; *-dg) os=-dgux ;; *-dolphin) os=-sysv3 ;; m68k-ccur) os=-rtu ;; m88k-omron*) os=-luna ;; *-next ) os=-nextstep ;; *-sequent) os=-ptx ;; *-crds) os=-unos ;; *-ns) os=-genix ;; i370-*) os=-mvs ;; *-next) os=-nextstep3 ;; *-gould) os=-sysv ;; *-highlevel) os=-bsd ;; *-encore) os=-bsd ;; *-sgi) os=-irix ;; *-siemens) os=-sysv4 ;; *-masscomp) os=-rtu ;; f30[01]-fujitsu | f700-fujitsu) os=-uxpv ;; *-rom68k) os=-coff ;; *-*bug) os=-coff ;; *-apple) os=-macos ;; *-atari*) os=-mint ;; *) os=-none ;; esac fi # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. vendor=unknown case $basic_machine in *-unknown) case $os in -riscix*) vendor=acorn ;; -sunos*) vendor=sun ;; -aix*) vendor=ibm ;; -beos*) vendor=be ;; -hpux*) vendor=hp ;; -mpeix*) vendor=hp ;; -hiux*) vendor=hitachi ;; -unos*) vendor=crds ;; -dgux*) vendor=dg ;; -luna*) vendor=omron ;; -genix*) vendor=ns ;; -mvs* | -opened*) vendor=ibm ;; -os400*) vendor=ibm ;; -ptx*) vendor=sequent ;; -tpf*) vendor=ibm ;; -vxsim* | -vxworks* | -windiss*) vendor=wrs ;; -aux*) vendor=apple ;; -hms*) vendor=hitachi ;; -mpw* | -macos*) vendor=apple ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) vendor=atari ;; -vos*) vendor=stratus ;; esac basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; esac echo $basic_machine$os exit # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: freeradius-server/configure000077500000000000000000027210211257552170400164370ustar00rootroot00000000000000#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.69. # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. # # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # Use a proper internal environment variable to ensure we don't fall # into an infinite loop, continuously re-executing ourselves. if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then _as_can_reexec=no; export _as_can_reexec; # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 as_fn_exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi " as_required="as_fn_return () { (exit \$1); } as_fn_success () { as_fn_return 0; } as_fn_failure () { as_fn_return 1; } as_fn_ret_success () { return 0; } as_fn_ret_failure () { return 1; } exitcode=0 as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : else exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1 test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 test \$(( 1 + 1 )) = 2 || exit 1" if (eval "$as_required") 2>/dev/null; then : as_have_required=yes else as_have_required=no fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. as_shell=$as_dir/$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : CONFIG_SHELL=$as_shell as_have_required=yes if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : break 2 fi fi done;; esac as_found=false done $as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : CONFIG_SHELL=$SHELL as_have_required=yes fi; } IFS=$as_save_IFS if test "x$CONFIG_SHELL" != x; then : export CONFIG_SHELL # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi if test x$as_have_required = xno; then : $as_echo "$0: This script requires a shell more modern than all" $as_echo "$0: the shells that I found on your system." if test x${ZSH_VERSION+set} = xset ; then $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" $as_echo "$0: be upgraded to zsh 4.3.4 or later." else $as_echo "$0: Please tell bug-autoconf@gnu.org about your system, $0: including any error possibly output before this $0: message. Then install a modern shell, or manually run $0: the script under such a shell if you do have one." fi exit 1 fi fi fi SHELL=${CONFIG_SHELL-/bin/sh} export SHELL # Unset more variables known to interfere with behavior of common tools. CLICOLOR_FORCE= GREP_OPTIONS= unset CLICOLOR_FORCE GREP_OPTIONS ## --------------------- ## ## M4sh Shell Functions. ## ## --------------------- ## # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # If we had to re-execute with $CONFIG_SHELL, we're ensured to have # already done that, so ensure we don't try to do so again and fall # in an infinite loop. This has already happened in practice. _as_can_reexec=no; export _as_can_reexec # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" # Check that we are running under the correct shell. SHELL=${CONFIG_SHELL-/bin/sh} case X$ECHO in X*--fallback-echo) # Remove one level of quotation (which was required for Make). ECHO=`echo "$ECHO" | sed 's,\\\\\$\\$0,'$0','` ;; esac echo=${ECHO-echo} if test "X$1" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test "X$1" = X--fallback-echo; then # Avoid inline document here, it may be left over : elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then # Yippee, $echo works! : else # Restart under the correct shell. exec $SHELL "$0" --no-reexec ${1+"$@"} fi if test "X$1" = X--fallback-echo; then # used as fallback echo shift cat </dev/null 2>&1 && unset CDPATH if test -z "$ECHO"; then if test "X${echo_test_string+set}" != Xset; then # find a string as large as possible, as long as the shell can cope with it for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... if (echo_test_string=`eval $cmd`) 2>/dev/null && echo_test_string=`eval $cmd` && (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null then break fi done fi if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then : else # The Solaris, AIX, and Digital Unix default echo programs unquote # backslashes. This makes it impossible to quote backslashes using # echo "$something" | sed 's/\\/\\\\/g' # # So, first we look for a working echo in the user's PATH. lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for dir in $PATH /usr/ucb; do IFS="$lt_save_ifs" if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then echo="$dir/echo" break fi done IFS="$lt_save_ifs" if test "X$echo" = Xecho; then # We didn't find a better echo, so look for alternatives. if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then # This shell has a builtin print -r that does the trick. echo='print -r' elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) && test "X$CONFIG_SHELL" != X/bin/ksh; then # If we have ksh, try running configure again with it. ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} export ORIGINAL_CONFIG_SHELL CONFIG_SHELL=/bin/ksh export CONFIG_SHELL exec $CONFIG_SHELL "$0" --no-reexec ${1+"$@"} else # Try using printf. echo='printf %s\n' if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then # Cool, printf works : elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && test "X$echo_testing_string" = 'X\t' && echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL export CONFIG_SHELL SHELL="$CONFIG_SHELL" export SHELL echo="$CONFIG_SHELL $0 --fallback-echo" elif echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && test "X$echo_testing_string" = 'X\t' && echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then echo="$CONFIG_SHELL $0 --fallback-echo" else # maybe with a smaller string... prev=: for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null then break fi prev="$cmd" done if test "$prev" != 'sed 50q "$0"'; then echo_test_string=`eval $prev` export echo_test_string exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "$0" ${1+"$@"} else # Oops. We lost completely, so just stick with echo. echo=echo fi fi fi fi fi fi # Copy echo and quote the copy suitably for passing to libtool from # the Makefile, instead of quoting the original, which is used later. ECHO=$echo if test "X$ECHO" = "X$CONFIG_SHELL $0 --fallback-echo"; then ECHO="$CONFIG_SHELL \\\$\$0 --fallback-echo" fi tagnames=${tagnames+${tagnames},}CXX tagnames=${tagnames+${tagnames},}F77 test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= # Identity of this package. PACKAGE_NAME= PACKAGE_TARNAME= PACKAGE_VERSION= PACKAGE_STRING= PACKAGE_BUGREPORT= PACKAGE_URL= ac_unique_file="src/main/radiusd.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" enable_option_checking=no ac_subst_vars='LTLIBOBJS LIBOBJS RADIUSD_VERSION_COMMIT RADIUSD_VERSION_STRING RADIUSD_VERSION RADIUSD_INCRM_VERSION RADIUSD_MINOR_VERSION RADIUSD_MAJOR_VERSION STATIC_MODULES USE_STATIC_LIBS USE_SHARED_LIBS INSTALLSTRIP MODULES subdirs INCLTDL LIBLTDL HOSTINFO CRYPTLIB LIBPREFIX PCAP_LIBS OPENSSL_LIBS OPENSSL_INCLUDE REGEX_EXTENDED REGEX LIBREADLINE DIRNAME LOCATE AUTOHEADER AUTOCONF ACLOCAL RUSERS SNMPWALK SNMPGET PERL openssl_version_check_config raddbdir radacctdir logdir ac_ct_F77 FFLAGS F77 CXXCPP NMEDIT DSYMUTIL STRIP AR ECHO LN_S SED LIBTOOL LTDL_SUBDIRS GIT MAKE GMAKE RANLIB EGREP GREP CPP ac_ct_CXX CXXFLAGS CXX OBJEXT EXEEXT ac_ct_CC CPPFLAGS LDFLAGS CFLAGS CC target_os target_vendor target_cpu target host_os host_vendor host_cpu host build_os build_vendor build_cpu build 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_largefile with_system_libltdl with_system_libtool enable_shared enable_static enable_fast_install with_gnu_ld enable_libtool_lock with_pic with_tags enable_strict_dependencies with_docdir with_logdir with_radacctdir with_raddbdir with_ascend_binary with_threads with_vmps with_dhcp with_post_proxy_authorize with_static_modules with_modules enable_developer with_experimental_modules with_openssl with_openssl_includes with_openssl_libraries enable_openssl_version_check with_rlm_FOO_lib_dir with_rlm_FOO_include_dir with_udpfromto ' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CXX CXXFLAGS CCC CPP CXXCPP F77 FFLAGS' ac_subdirs_all='$LTDL_SUBDIRS $mysubdirs' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *=) ac_optarg= ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) as_fn_error $? "unrecognized option: \`$ac_option' Try \`$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error $? "pwd does not report name of working directory" # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures this package to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking ...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] --target=TARGET configure for building compilers for TARGET [HOST] _ACEOF fi if test -n "$ac_init_help"; then cat <<\_ACEOF Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --disable-largefile omit support for large files --enable-shared[=PKGS] build shared libraries [default=yes] --enable-static[=PKGS] build static libraries [default=yes] --enable-fast-install[=PKGS] optimize for fast installation [default=yes] --disable-libtool-lock avoid locking (might break parallel builds) --enable-strict-dependencies Fail configure on lack of module dependancy. --enable-developer Enables features of interest to developers. --disable-openssl-version-check Disable vulnerable OpenSSL version check. Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-system-libltdl Use the libltdl installed in your system (default=use our own) --with-system-libtool Use the libtool installed in your system (default=use our own) --with-gnu-ld assume the C compiler uses GNU ld [default=no] --with-pic try to use only PIC/non-PIC objects [default=use both] --with-tags[=TAGS] include additional configurations [automatic] --with-docdir=DIR Directory for documentation DATADIR/doc/freeradius --with-logdir=DIR Directory for logfiles LOCALSTATEDIR/log/radius --with-radacctdir=DIR Directory for detail files LOGDIR/radacct --with-raddbdir=DIR Directory for config files SYSCONFDIR/raddb --with-ascend-binary Include support for Ascend binary filter attributes (default=yes) --with-threads Use threads, if available. (default=yes) --with-vmps Compile in VMPS support. (default=yes) --with-dhcp Compile in DHCP support. (default=yes) --with-post-proxy-authorize 1.x compatibility (default=no) --with-static-modules=QUOTED-MODULE-LIST --with-modules=QUOTED-MODULE-LIST --with-experimental-modules Use experimental and unstable modules. (default=no) --with-openssl Use OpenSSL. (default=yes) --with-openssl-includes=DIR Directory to look for OpenSSL include files --with-openssl-libraries=DIR Directory to look for OpenSSL library files --with-rlm-FOO-lib-dir=DIR Directory to look for library files used by module FOO --with-rlm-FOO-include-dir=DIR Directory to look for include files used by module FOO --with-udpfromto Compile in UDPFROMTO support. (default=no) Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory LIBS libraries to pass to the linker, e.g. -l CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory CXX C++ compiler command CXXFLAGS C++ compiler flags CPP C preprocessor CXXCPP C++ preprocessor F77 Fortran 77 compiler command FFLAGS Fortran 77 compiler flags Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to the package provider. _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF configure generated by GNU Autoconf 2.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_cxx_try_compile LINENO # ---------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_cxx_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_cxx_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_cxx_try_compile # ac_fn_c_try_cpp LINENO # ---------------------- # Try to preprocess conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } > conftest.i && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_cpp # ac_fn_c_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;} ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=\$ac_header_compiler" fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_mongrel # ac_fn_c_try_run LINENO # ---------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. Assumes # that executables *can* be run. ac_fn_c_try_run () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then : ac_retval=0 else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_run # ac_fn_c_check_header_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_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_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_cxx_try_cpp LINENO # ------------------------ # Try to preprocess conftest.$ac_ext, and return whether this succeeded. ac_fn_cxx_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_cxx_preproc_warn_flag$ac_cxx_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_cxx_try_cpp # ac_fn_cxx_try_link LINENO # ------------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_cxx_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_cxx_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_cxx_try_link # ac_fn_f77_try_compile LINENO # ---------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_f77_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_f77_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_f77_try_compile # ac_fn_f77_try_link LINENO # ------------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_f77_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_f77_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_f77_try_link # 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_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 cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by $as_me, which was generated by GNU Autoconf 2.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 # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 $as_echo "$as_me: former value: \`$ac_old_val'" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## ## -------------------- ## ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_config_headers="$ac_config_headers src/include/autoconf.h" RADIUSD_MAJOR_VERSION=`cat VERSION | sed 's/\..*//'` RADIUSD_MINOR_VERSION=`cat VERSION | sed 's/^[^\.]*\.//' | sed 's/\..*$//'` RADIUSD_INCRM_VERSION=`cat VERSION | sed 's/^.*\..*\.//' | sed 's/[\.-].*$//'` RADIUSD_VERSION=`echo | awk -v major="$RADIUSD_MAJOR_VERSION" \ -v minor="$RADIUSD_MINOR_VERSION" \ -v incrm="$RADIUSD_INCRM_VERSION" \ '{ printf "%02i%02i%02i", major, minor, incrm }'` RADIUSD_VERSION_STRING=`cat VERSION` PACKAGE=freeradius 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. # 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking target system type" >&5 $as_echo_n "checking target system type... " >&6; } if ${ac_cv_target+:} false; then : $as_echo_n "(cached) " >&6 else if test "x$target_alias" = x; then ac_cv_target=$ac_cv_host else ac_cv_target=`$SHELL "$ac_aux_dir/config.sub" $target_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $target_alias failed" "$LINENO" 5 fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_target" >&5 $as_echo "$ac_cv_target" >&6; } case $ac_cv_target in *-*-*) ;; *) as_fn_error $? "invalid value of canonical target" "$LINENO" 5;; esac target=$ac_cv_target ac_save_IFS=$IFS; IFS='-' set x $ac_cv_target shift target_cpu=$1 target_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: target_os=$* IFS=$ac_save_IFS case $target_os in *\ *) target_os=`echo "$target_os" | sed 's/ /-/g'`;; esac # The aliases save the names the user supplied, while $host etc. # will get canonicalized. test -n "$target_alias" && test "$program_prefix$program_suffix$program_transform_name" = \ NONENONEs,x,x, && program_prefix=${target_alias}- 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=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu if test -z "$CXX"; then if test -n "$CCC"; then CXX=$CCC else if test -n "$ac_tool_prefix"; then for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC 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_CXX+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CXX"; then ac_cv_prog_CXX="$CXX" # 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_CXX="$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 CXX=$ac_cv_prog_CXX if test -n "$CXX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 $as_echo "$CXX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CXX" && break done fi if test -z "$CXX"; then ac_ct_CXX=$CXX for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC 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_CXX+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CXX"; then ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # 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_CXX="$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_CXX=$ac_cv_prog_ac_ct_CXX if test -n "$ac_ct_CXX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 $as_echo "$ac_ct_CXX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CXX" && break done if test "x$ac_ct_CXX" = x; then CXX="g++" 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 CXX=$ac_ct_CXX fi fi fi fi # 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 { $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_cxx_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_cxx_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_cxx_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5 $as_echo "$ac_cv_cxx_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GXX=yes else GXX= fi ac_test_CXXFLAGS=${CXXFLAGS+set} ac_save_CXXFLAGS=$CXXFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 $as_echo_n "checking whether $CXX accepts -g... " >&6; } if ${ac_cv_prog_cxx_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_cxx_werror_flag=$ac_cxx_werror_flag ac_cxx_werror_flag=yes ac_cv_prog_cxx_g=no CXXFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_prog_cxx_g=yes else CXXFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : else ac_cxx_werror_flag=$ac_save_cxx_werror_flag CXXFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_prog_cxx_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_cxx_werror_flag=$ac_save_cxx_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5 $as_echo "$ac_cv_prog_cxx_g" >&6; } if test "$ac_test_CXXFLAGS" = set; then CXXFLAGS=$ac_save_CXXFLAGS elif test $ac_cv_prog_cxx_g = yes; then if test "$GXX" = yes; then CXXFLAGS="-g -O2" else CXXFLAGS="-g" fi else if test "$GXX" = yes; then CXXFLAGS="-O2" else CXXFLAGS= fi 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 how to run the C preprocessor" >&5 $as_echo_n "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if ${ac_cv_prog_CPP+:} false; then : $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 $as_echo "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } if ${ac_cv_path_GREP+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$GREP"; then ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_GREP" || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_GREP"; then as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_GREP=$GREP fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 $as_echo "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } if ${ac_cv_path_EGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else if test -z "$EGREP"; then ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_EGREP" || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP"; then as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_EGREP=$EGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 $as_echo "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if ${ac_cv_header_stdc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_stdc=yes else ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : : else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : else ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then $as_echo "#define STDC_HEADERS 1" >>confdefs.h fi # 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 ac_fn_c_check_header_mongrel "$LINENO" "minix/config.h" "ac_cv_header_minix_config_h" "$ac_includes_default" if test "x$ac_cv_header_minix_config_h" = xyes; then : MINIX=yes else MINIX= fi if test "$MINIX" = yes; then $as_echo "#define _POSIX_SOURCE 1" >>confdefs.h $as_echo "#define _POSIX_1_SOURCE 2" >>confdefs.h $as_echo "#define _MINIX 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether it is safe to define __EXTENSIONS__" >&5 $as_echo_n "checking whether it is safe to define __EXTENSIONS__... " >&6; } if ${ac_cv_safe_to_define___extensions__+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ # define __EXTENSIONS__ 1 $ac_includes_default int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_safe_to_define___extensions__=yes else ac_cv_safe_to_define___extensions__=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_safe_to_define___extensions__" >&5 $as_echo "$ac_cv_safe_to_define___extensions__" >&6; } test $ac_cv_safe_to_define___extensions__ = yes && $as_echo "#define __EXTENSIONS__ 1" >>confdefs.h $as_echo "#define _ALL_SOURCE 1" >>confdefs.h $as_echo "#define _GNU_SOURCE 1" >>confdefs.h $as_echo "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h $as_echo "#define _TANDEM_SOURCE 1" >>confdefs.h if test $ac_cv_c_compiler_gnu = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC needs -traditional" >&5 $as_echo_n "checking whether $CC needs -traditional... " >&6; } if ${ac_cv_prog_gcc_traditional+:} false; then : $as_echo_n "(cached) " >&6 else ac_pattern="Autoconf.*'x'" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include Autoconf TIOCGETP _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "$ac_pattern" >/dev/null 2>&1; then : ac_cv_prog_gcc_traditional=yes else ac_cv_prog_gcc_traditional=no fi rm -f conftest* if test $ac_cv_prog_gcc_traditional = no; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include Autoconf TCGETA _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "$ac_pattern" >/dev/null 2>&1; then : ac_cv_prog_gcc_traditional=yes fi rm -f conftest* fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_gcc_traditional" >&5 $as_echo "$ac_cv_prog_gcc_traditional" >&6; } if test $ac_cv_prog_gcc_traditional = yes; then CC="$CC -traditional" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using SUNPro C" >&5 $as_echo_n "checking whether we are using SUNPro C... " >&6; } if ${ac_cv_prog_suncc+:} false; then : $as_echo_n "(cached) " >&6 else cat > conftest.c <&5 (eval $ac_try) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_suncc=yes else ac_cv_prog_suncc=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_suncc" >&5 $as_echo "$ac_cv_prog_suncc" >&6; } 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 if test "x$GCC" = "xyes"; then CFLAGS="$CFLAGS -Wall -D_GNU_SOURCE" fi # Check whether --enable-largefile was given. if test "${enable_largefile+set}" = set; then : enableval=$enable_largefile; fi if test "$enable_largefile" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for special C compiler options needed for large files" >&5 $as_echo_n "checking for special C compiler options needed for large files... " >&6; } if ${ac_cv_sys_largefile_CC+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_sys_largefile_CC=no if test "$GCC" != yes; then ac_save_CC=$CC while :; do # IRIX 6.2 and later do not support large files by default, # so use the C compiler's -n32 option if that helps. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : break fi rm -f core conftest.err conftest.$ac_objext CC="$CC -n32" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_sys_largefile_CC=' -n32'; break fi rm -f core conftest.err conftest.$ac_objext break done CC=$ac_save_CC rm -f conftest.$ac_ext fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_CC" >&5 $as_echo "$ac_cv_sys_largefile_CC" >&6; } if test "$ac_cv_sys_largefile_CC" != no; then CC=$CC$ac_cv_sys_largefile_CC fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _FILE_OFFSET_BITS value needed for large files" >&5 $as_echo_n "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; } if ${ac_cv_sys_file_offset_bits+:} false; then : $as_echo_n "(cached) " >&6 else while :; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_sys_file_offset_bits=no; break fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define _FILE_OFFSET_BITS 64 #include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_sys_file_offset_bits=64; break fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_sys_file_offset_bits=unknown break done fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_file_offset_bits" >&5 $as_echo "$ac_cv_sys_file_offset_bits" >&6; } case $ac_cv_sys_file_offset_bits in #( no | unknown) ;; *) cat >>confdefs.h <<_ACEOF #define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits _ACEOF ;; esac rm -rf conftest* if test $ac_cv_sys_file_offset_bits = unknown; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGE_FILES value needed for large files" >&5 $as_echo_n "checking for _LARGE_FILES value needed for large files... " >&6; } if ${ac_cv_sys_large_files+:} false; then : $as_echo_n "(cached) " >&6 else while :; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_sys_large_files=no; break fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define _LARGE_FILES 1 #include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_sys_large_files=1; break fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_sys_large_files=unknown break done fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_large_files" >&5 $as_echo "$ac_cv_sys_large_files" >&6; } case $ac_cv_sys_large_files in #( no | unknown) ;; *) cat >>confdefs.h <<_ACEOF #define _LARGE_FILES $ac_cv_sys_large_files _ACEOF ;; esac rm -rf conftest* fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5 $as_echo_n "checking whether byte ordering is bigendian... " >&6; } if ${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 # Extract the first word of "gmake", so it can be a program name with args. set dummy gmake; 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_GMAKE+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$GMAKE"; then ac_cv_prog_GMAKE="$GMAKE" # 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_GMAKE="yes" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_GMAKE" && ac_cv_prog_GMAKE="no" fi fi GMAKE=$ac_cv_prog_GMAKE if test -n "$GMAKE"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GMAKE" >&5 $as_echo "$GMAKE" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test $GMAKE = no; then # Extract the first word of "make", so it can be a program name with args. set dummy make; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_MAKE+:} false; then : $as_echo_n "(cached) " >&6 else case $MAKE in [\\/]* | ?:[\\/]*) ac_cv_path_MAKE="$MAKE" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_MAKE="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_MAKE" && ac_cv_path_MAKE="/usr/local/bin/make" ;; esac fi MAKE=$ac_cv_path_MAKE if test -n "$MAKE"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAKE" >&5 $as_echo "$MAKE" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi else # Extract the first word of "gmake", so it can be a program name with args. set dummy gmake; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_MAKE+:} false; then : $as_echo_n "(cached) " >&6 else case $MAKE in [\\/]* | ?:[\\/]*) ac_cv_path_MAKE="$MAKE" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_MAKE="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_MAKE" && ac_cv_path_MAKE="/usr/local/gnu/bin/make" ;; esac fi MAKE=$ac_cv_path_MAKE if test -n "$MAKE"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAKE" >&5 $as_echo "$MAKE" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi makever=`$ac_cv_path_MAKE --version 2>&1 | grep "GNU Make"` if test -z "$makever"; then as_fn_error $? "GNU Make is not installed. Please download and install it from ftp://prep.ai.mit.edu/pub/gnu/make/ before continuing." "$LINENO" 5 fi # Extract the first word of "git", so it can be a program name with args. set dummy git; 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_GIT+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$GIT"; then ac_cv_prog_GIT="$GIT" # 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_GIT="yes" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_GIT" && ac_cv_prog_GIT="no" fi fi GIT=$ac_cv_prog_GIT if test -n "$GIT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GIT" >&5 $as_echo "$GIT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Check whether --with-system-libltdl was given. if test "${with_system_libltdl+set}" = set; then : withval=$with_system_libltdl; LIBLTDL="-lltdl" INCLTDL=-DWITH_SYSTEM_LTDL LTDL_SUBDIRS= else test x"$enable_ltdl_install" = x && enable_ltdl_install=yes { $as_echo "$as_me:${as_lineno-$LINENO}: checking for lt_dlinit in -lltdl" >&5 $as_echo_n "checking for lt_dlinit in -lltdl... " >&6; } if ${ac_cv_lib_ltdl_lt_dlinit+:} 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_dlinit (); int main () { return lt_dlinit (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_ltdl_lt_dlinit=yes else ac_cv_lib_ltdl_lt_dlinit=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_dlinit" >&5 $as_echo "$ac_cv_lib_ltdl_lt_dlinit" >&6; } if test "x$ac_cv_lib_ltdl_lt_dlinit" = xyes; then : test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no else if test x"$enable_ltdl_install" = xno; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: libltdl not installed, but installation disabled" >&5 $as_echo "$as_me: WARNING: libltdl not installed, but installation disabled" >&2;} else enable_ltdl_install=yes fi fi if test x"$enable_ltdl_install" = x"yes"; then ac_configure_args="$ac_configure_args --enable-ltdl-install" LIBLTDL='${top_builddir}/''libltdl'/libltdl.la LTDLINCL='-I${top_srcdir}/''libltdl' else ac_configure_args="$ac_configure_args --enable-ltdl-install=no" LIBLTDL="-lltdl" LTDLINCL= fi # For backwards non-gettext consistent compatibility... INCLTDL="$LTDLINCL" if test x"$enable_ltdl_install" = x"yes"; then LTDL_SUBDIRS=libltdl fi fi LTCFLAGS=" " # Check whether --enable-shared was given. if test "${enable_shared+set}" = set; then : enableval=$enable_shared; p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS="$lt_save_ifs" ;; esac else enable_shared=yes fi # Check whether --enable-static was given. if test "${enable_static+set}" = set; then : enableval=$enable_static; p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS="$lt_save_ifs" ;; esac else enable_static=yes fi # Check whether --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 { $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 ${lt_cv_path_SED+:} false; then : $as_echo_n "(cached) " >&6 else # 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_fn_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 fi SED=$lt_cv_path_SED { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SED" >&5 $as_echo "$SED" >&6; } # 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 $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 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD-compatible nm" >&5 $as_echo_n "checking for BSD-compatible 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 test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 $as_echo "$lt_cv_path_NM" >&6; } NM="$lt_cv_path_NM" { $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 { $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. if ( file / ) >/dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | dragonfly*) if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; gnu*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]' lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix[3-9]*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be Linux ELF. linux* | k*bsd*-gnu) lt_cv_deplibs_check_method=pass_all ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; nto-qnx*) lt_cv_deplibs_check_method=unknown ;; 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 ;; 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 ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 $as_echo "$lt_cv_deplibs_check_method" >&6; } file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown # If 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 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 5755 "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*|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*) 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 ;; sparc*-*solaris*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) LD="${LD-ld} -m elf64_sparc" ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" fi ;; esac ;; esac fi rm -rf conftest* ;; esac need_locks="$enable_libtool_lock" for ac_header in dlfcn.h do : ac_fn_c_check_header_mongrel "$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 if test -n "$CXX" && ( test "X$CXX" != "Xno" && ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || (test "X$CXX" != "Xg++"))) ; then ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_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; } if test -z "$CXXCPP"; then if ${ac_cv_prog_CXXCPP+:} false; then : $as_echo_n "(cached) " >&6 else # Double quotes because CXXCPP needs to be expanded for CXXCPP in "$CXX -E" "/lib/cpp" do ac_preproc_ok=false for ac_cxx_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_cxx_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_cxx_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_CXXCPP=$CXXCPP fi CXXCPP=$ac_cv_prog_CXXCPP else ac_cv_prog_CXXCPP=$CXXCPP fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXXCPP" >&5 $as_echo "$CXXCPP" >&6; } ac_preproc_ok=false for ac_cxx_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_cxx_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_cxx_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 \"$CXXCPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu fi ac_ext=f ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5' ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_f77_compiler_gnu if test -n "$ac_tool_prefix"; then for ac_prog in g77 xlf f77 frt pgf77 cf77 fort77 fl32 af77 xlf90 f90 pgf90 pghpf epcf90 gfortran g95 xlf95 f95 fort ifort ifc efc pgfortran pgf95 lf95 ftn nagfor 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_F77+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$F77"; then ac_cv_prog_F77="$F77" # 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_F77="$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 F77=$ac_cv_prog_F77 if test -n "$F77"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $F77" >&5 $as_echo "$F77" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$F77" && break done fi if test -z "$F77"; then ac_ct_F77=$F77 for ac_prog in g77 xlf f77 frt pgf77 cf77 fort77 fl32 af77 xlf90 f90 pgf90 pghpf epcf90 gfortran g95 xlf95 f95 fort ifort ifc efc pgfortran pgf95 lf95 ftn nagfor 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_F77+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_F77"; then ac_cv_prog_ac_ct_F77="$ac_ct_F77" # 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_F77="$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_F77=$ac_cv_prog_ac_ct_F77 if test -n "$ac_ct_F77"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_F77" >&5 $as_echo "$ac_ct_F77" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_F77" && break done if test "x$ac_ct_F77" = x; then F77="" 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 F77=$ac_ct_F77 fi fi # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for Fortran 77 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 rm -f a.out # If we don't use `.F' as extension, the preprocessor is not run on the # input file. (Note that this only needs to work for GNU compilers.) ac_save_ext=$ac_ext ac_ext=F { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU Fortran 77 compiler" >&5 $as_echo_n "checking whether we are using the GNU Fortran 77 compiler... " >&6; } if ${ac_cv_f77_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat > conftest.$ac_ext <<_ACEOF program main #ifndef __GNUC__ choke me #endif end _ACEOF if ac_fn_f77_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_f77_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_f77_compiler_gnu" >&5 $as_echo "$ac_cv_f77_compiler_gnu" >&6; } ac_ext=$ac_save_ext ac_test_FFLAGS=${FFLAGS+set} ac_save_FFLAGS=$FFLAGS FFLAGS= { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $F77 accepts -g" >&5 $as_echo_n "checking whether $F77 accepts -g... " >&6; } if ${ac_cv_prog_f77_g+:} false; then : $as_echo_n "(cached) " >&6 else FFLAGS=-g cat > conftest.$ac_ext <<_ACEOF program main end _ACEOF if ac_fn_f77_try_compile "$LINENO"; then : ac_cv_prog_f77_g=yes else ac_cv_prog_f77_g=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_f77_g" >&5 $as_echo "$ac_cv_prog_f77_g" >&6; } if test "$ac_test_FFLAGS" = set; then FFLAGS=$ac_save_FFLAGS elif test $ac_cv_prog_f77_g = yes; then if test "x$ac_cv_f77_compiler_gnu" = xyes; then FFLAGS="-g -O2" else FFLAGS="-g" fi else if test "x$ac_cv_f77_compiler_gnu" = xyes; then FFLAGS="-O2" else FFLAGS= fi fi if test $ac_compiler_gnu = yes; then G77=yes else G77= 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 # Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers! # 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*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} while (test "X"`$SHELL $0 --fallback-echo "X$teststring" 2>/dev/null` \ = "XX$teststring") >/dev/null 2>&1 && new_result=`expr "X$teststring" : ".*" 2>&1` && lt_cv_sys_max_cmd_len=$new_result && test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done 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 # 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]*\)' # Transform an extracted symbol line into a proper C declaration lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \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\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" # Define system-specific variables. case $host_os in aix*) symcode='[BCDT]' ;; cygwin* | mingw* | pw32*) symcode='[ABCDGISTW]' ;; hpux*) # Its linker distinguishes data from code symbols if test "$host_cpu" = ia64; then symcode='[ABCDEGRST]' fi lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" ;; linux* | k*bsd*-gnu) if test "$host_cpu" = ia64; then symcode='[ABCDGIRSTW]' lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" 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 # 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 # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[ABCDGIRSTW]' ;; esac # Try without a prefix undercore, 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. lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <&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 < conftest.$ac_ext #ifdef __cplusplus extern "C" { #endif EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext' cat <> conftest.$ac_ext #if defined (__STDC__) && __STDC__ # define lt_ptr_t void * #else # define lt_ptr_t char * # define const #endif /* The mapping between symbol names and symbols. */ const struct { const char *name; lt_ptr_t address; } lt_preloaded_symbols[] = { EOF $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext cat <<\EOF >> conftest.$ac_ext {0, (lt_ptr_t) 0} }; #ifdef __cplusplus } #endif EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_save_LIBS="$LIBS" lt_save_CFLAGS="$CFLAGS" LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest${ac_exeext}; then pipe_works=yes fi LIBS="$lt_save_LIBS" CFLAGS="$lt_save_CFLAGS" else echo "cannot find nm_test_func in $nlist" >&5 fi else echo "cannot find nm_test_var in $nlist" >&5 fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 fi else echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test "$pipe_works" = yes; then break else lt_cv_sys_global_symbol_pipe= fi done fi if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5 $as_echo "failed" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 $as_echo "ok" >&6; } fi { $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 case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. 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 to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' # Constants: rm="rm -f" # Global variables: default_ofile=libtool can_build_shared=yes # All known linkers require a `.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a ltmain="$ac_aux_dir/ltmain.sh" ofile="$default_ofile" with_gnu_ld="$lt_cv_prog_gnu_ld" if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. set dummy ${ac_tool_prefix}ar; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${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}ar" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AR=$ac_cv_prog_AR if test -n "$AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 $as_echo "$AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_AR"; then ac_ct_AR=$AR # Extract the first word of "ar", so it can be a program name with args. set dummy ar; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${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="ar" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 $as_echo "$ac_ct_AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_AR" = x; then AR="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac AR=$ac_ct_AR fi else AR="$ac_cv_prog_AR" fi 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 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 old_CC="$CC" old_CFLAGS="$CFLAGS" # Set sane defaults for various variables test -z "$AR" && AR=ar test -z "$AR_FLAGS" && AR_FLAGS=cru test -z "$AS" && AS=as test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$DLLTOOL" && DLLTOOL=dlltool test -z "$LD" && LD=ld test -z "$LN_S" && LN_S="ln -s" test -z "$MAGIC_CMD" && MAGIC_CMD=file test -z "$NM" && NM=nm test -z "$SED" && SED=sed test -z "$OBJDUMP" && OBJDUMP=objdump test -z "$RANLIB" && RANLIB=: test -z "$STRIP" && STRIP=: test -z "$ac_objext" && ac_objext=o # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" fi for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` # Only perform the check for file, if the check method requires it 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 <&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 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 <&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 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 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 { $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. echo "int foo(void){return 1;}" > conftest.c $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib ${wl}-single_module conftest.c if test -f libconftest.dylib; then lt_cv_apple_cc_single_mod=yes rm -rf libconftest.dylib* fi rm conftest.c 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; } case $host_os in rhapsody* | darwin1.[0123]) _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; darwin*) # if running on 10.5 or later, the deployment target defaults # to the OS version, if on x86, and 10.4, the deployment # target defaults to 10.4. Don't you love it? case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*86*-darwin8*|10.0,*-darwin[91]*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; 10.[012]*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; esac ;; esac if test "$lt_cv_apple_cc_single_mod" = "yes"; then _lt_dar_single_mod='$single_module' fi if test "$lt_cv_ld_exported_symbols_list" = "yes"; then _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' else _lt_dar_export_syms="~$NMEDIT -s \$output_objdir/\${libname}-symbols.expsym \${lib}" fi if test "$DSYMUTIL" != ":"; then _lt_dsymutil="~$DSYMUTIL \$lib || :" else _lt_dsymutil= fi ;; esac enable_dlopen=yes enable_win32_dll=no # 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 # Check whether --with-pic was given. if test "${with_pic+set}" = set; then : withval=$with_pic; pic_mode="$withval" else pic_mode=default fi test -z "$pic_mode" && pic_mode=default # Use C for the default configuration in the libtool script tagname= 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 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* lt_prog_compiler_no_builtin_flag= if test "$GCC" = yes; then lt_prog_compiler_no_builtin_flag=' -fno-builtin' { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 $as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } if ${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:7521: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:7525: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_rtti_exceptions=yes fi fi $rm conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 $as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; } if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" else : fi fi lt_prog_compiler_wl= lt_prog_compiler_pic= lt_prog_compiler_static= { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 $as_echo_n "checking for $compiler option to produce PIC... " >&6; } if test "$GCC" = yes; then lt_prog_compiler_wl='-Wl,' lt_prog_compiler_static='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' fi ;; amigaos*) # 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' ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2*) # 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' ;; 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 ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic=-Kconform_pic fi ;; hpux*) # 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='-fPIC' ;; esac ;; *) lt_prog_compiler_pic='-fPIC' ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) lt_prog_compiler_wl='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' else lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' fi ;; darwin*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files case $cc_basename in xlc*) lt_prog_compiler_pic='-qnocommon' lt_prog_compiler_wl='-Wl,' ;; esac ;; mingw* | cygwin* | pw32* | os2*) # 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' ;; newsos6) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; linux* | k*bsd*-gnu) case $cc_basename in icc* | ecc*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-static' ;; pgcc* | pgf77* | pgf90* | pgf95*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; ccc*) lt_prog_compiler_wl='-Wl,' # All Alpha code is PIC. lt_prog_compiler_static='-non_shared' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Wl,' ;; *Sun\ F*) # Sun Fortran 8.3 passes all unrecognized flags to the linker lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='' ;; esac ;; esac ;; osf3* | osf4* | osf5*) lt_prog_compiler_wl='-Wl,' # All OSF/1 code is PIC. lt_prog_compiler_static='-non_shared' ;; rdos*) lt_prog_compiler_static='-non_shared' ;; solaris*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' case $cc_basename in f77* | f90* | f95*) lt_prog_compiler_wl='-Qoption ld ';; *) lt_prog_compiler_wl='-Wl,';; esac ;; sunos4*) lt_prog_compiler_wl='-Qoption ld ' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then lt_prog_compiler_pic='-Kconform_pic' lt_prog_compiler_static='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; unicos*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_can_build_shared=no ;; uts4*) lt_prog_compiler_pic='-pic' lt_prog_compiler_static='-Bstatic' ;; *) lt_prog_compiler_can_build_shared=no ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_prog_compiler_pic" >&5 $as_echo "$lt_prog_compiler_pic" >&6; } # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 $as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } if ${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:7811: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:7815: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_pic_works=yes fi fi $rm conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 $as_echo "$lt_cv_prog_compiler_pic_works" >&6; } if test x"$lt_cv_prog_compiler_pic_works" = xyes; then case $lt_prog_compiler_pic in "" | " "*) ;; *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; esac else lt_prog_compiler_pic= lt_prog_compiler_can_build_shared=no fi fi 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 # # 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 "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_static_works=yes fi else lt_cv_prog_compiler_static_works=yes fi fi $rm -r conftest* LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 $as_echo "$lt_cv_prog_compiler_static_works" >&6; } if test x"$lt_cv_prog_compiler_static_works" = xyes; then : else lt_prog_compiler_static= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${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:7915: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:7919: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes fi fi chmod u+w . 2>&5 $rm conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files $rm out/* && rmdir out cd .. rmdir 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= enable_shared_with_static_runtimes=no archive_cmds= archive_expsym_cmds= old_archive_From_new_cmds= old_archive_from_expsyms_cmds= export_dynamic_flag_spec= whole_archive_flag_spec= thread_safe_flag_spec= hardcode_libdir_flag_spec= hardcode_libdir_flag_spec_ld= hardcode_libdir_separator= hardcode_direct=no hardcode_minus_L=no hardcode_shlibpath_var=unsupported link_all_deplibs=unknown hardcode_automatic=no module_cmds= module_expsym_cmds= always_export_symbols=no export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' # 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= # Just being paranoid about ensuring that cc_basename is set. for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` case $host_os in cygwin* | mingw* | pw32*) # 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 if test "$with_gnu_ld" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir' export_dynamic_flag_spec='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec= fi supports_anon_versioning=no case `$LD -v 2>/dev/null` in *\ [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 <&2 *** Warning: the GNU linker, at least up to release 2.9.1, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to modify your PATH *** so that a non-GNU linker is found, and then restart. EOF fi ;; amigaos*) 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 # Samuel A. Falvo II reports # that the semantics of dynamic libraries on AmigaOS, at least up # to version 4, is to share data among multiple programs linked # with the same dynamic library. Since this doesn't match the # behavior of shared libraries on other platforms, we can't use # them. ld_shlibs=no ;; 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*) # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' allow_undefined_flag=unsupported always_export_symbols=no enable_shared_with_static_runtimes=yes export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/'\'' -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else ld_shlibs=no fi ;; interix[3-9]*) hardcode_direct=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='${wl}-rpath,$libdir' export_dynamic_flag_spec='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | k*bsd*-gnu) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then tmp_addflag= case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; *) tmp_sharedflag='-shared' ;; esac archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test $supports_anon_versioning = yes; 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 link_all_deplibs=no else ld_shlibs=no fi ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then ld_shlibs=no cat <&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. EOF elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib' else ld_shlibs=no fi ;; esac ;; sunos4*) archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= hardcode_direct=yes hardcode_shlibpath_var=no ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac if test "$ld_shlibs" = no; then runpath_var= hardcode_libdir_flag_spec= export_dynamic_flag_spec= whole_archive_flag_spec= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) allow_undefined_flag=unsupported always_export_symbols=yes archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L=yes if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct=unsupported fi ;; aix[4-9]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | grep 'GNU' > /dev/null; then export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds='' hardcode_direct=yes hardcode_libdir_separator=':' link_all_deplibs=yes 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 # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. always_export_symbols=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag='-berok' # Determine the default libpath from the value encoded in an empty executable. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/ p } }' aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${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. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/ p } }' aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag=' ${wl}-bernotok' allow_undefined_flag=' ${wl}-berok' # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec='$convenience' archive_cmds_need_lc=yes # This is similar to how AIX traditionally builds its shared libraries. archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) 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 # see comment about different semantics on the GNU ld section ld_shlibs=no ;; bsdi[45]*) export_dynamic_flag_spec=-rdynamic ;; cygwin* | mingw* | pw32*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_From_new_cmds='true' # FIXME: Should let the user specify the lib program. old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' fix_srcfile_path='`cygpath -w "$srcfile"`' enable_shared_with_static_runtimes=yes ;; darwin* | rhapsody*) case $host_os in rhapsody* | darwin1.[012]) allow_undefined_flag='${wl}-undefined ${wl}suppress' ;; *) # Darwin 1.3 on if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then allow_undefined_flag='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' else case ${MACOSX_DEPLOYMENT_TARGET} in 10.[012]) allow_undefined_flag='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) allow_undefined_flag='${wl}-undefined ${wl}dynamic_lookup' ;; esac fi ;; esac archive_cmds_need_lc=no hardcode_direct=no hardcode_automatic=yes hardcode_shlibpath_var=unsupported whole_archive_flag_spec='' link_all_deplibs=yes if test "$GCC" = yes ; then output_verbose_link_cmd='echo' archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" else case $cc_basename in xlc*) output_verbose_link_cmd='echo' archive_cmds='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $xlcverstring' module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $xlcverstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' module_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' ;; *) ld_shlibs=no ;; esac fi ;; dgux*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; freebsd1*) ld_shlibs=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; hpux9*) if test "$GCC" = yes; then archive_cmds='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else archive_cmds='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes export_dynamic_flag_spec='${wl}-E' ;; hpux10*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes export_dynamic_flag_spec='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes fi ;; hpux11*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: case $host_cpu in hppa*64*|ia64*) hardcode_libdir_flag_spec_ld='+b $libdir' hardcode_direct=no hardcode_shlibpath_var=no ;; *) hardcode_direct=yes export_dynamic_flag_spec='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_ld='-rpath $libdir' fi hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: link_all_deplibs=yes ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; newsos6) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: hardcode_shlibpath_var=no ;; openbsd*) if test -f /usr/libexec/ld.so; then hardcode_direct=yes hardcode_shlibpath_var=no if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' hardcode_libdir_flag_spec='${wl}-rpath,$libdir' export_dynamic_flag_spec='${wl}-E' else case $host_os in openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-R$libdir' ;; *) archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='${wl}-rpath,$libdir' ;; esac fi else ld_shlibs=no fi ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported archive_cmds='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' old_archive_From_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' fi hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${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='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -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; echo "-hidden">> $lib.exp~ $LD -shared${allow_undefined_flag} -input $lib.exp $linker_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 hardcode_libdir_separator=: ;; solaris*) no_undefined_flag=' -z text' if test "$GCC" = yes; then wlarc='${wl}' archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' else 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' 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='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' hardcode_libdir_separator=':' link_all_deplibs=yes export_dynamic_flag_spec='${wl}-Bexport' runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) 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 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 # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc" in x|xyes) # Assume -lc should be added archive_cmds_need_lc=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $archive_cmds in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 $as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } $rm conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl pic_flag=$lt_prog_compiler_pic compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag allow_undefined_flag= if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\""; } >&5 (eval $archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then archive_cmds_need_lc=no else archive_cmds_need_lc=yes fi allow_undefined_flag=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $rm conftest* { $as_echo "$as_me:${as_lineno-$LINENO}: result: $archive_cmds_need_lc" >&5 $as_echo "$archive_cmds_need_lc" >&6; } ;; esac fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 $as_echo_n "checking dynamic linker characteristics... " >&6; } 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" if test "$GCC" = yes; then case $host_os in darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; *) lt_awk_arg="/^libraries:/" ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$lt_search_path_spec" | grep ';' >/dev/null ; then # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. lt_search_path_spec=`echo "$lt_search_path_spec" | $SED -e 's/;/ /g'` else lt_search_path_spec=`echo "$lt_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary. lt_tmp_lt_search_path_spec= lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` for lt_sys_path in $lt_search_path_spec; do if test -d "$lt_sys_path/$lt_multi_os_dir"; then lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" else test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`echo $lt_tmp_lt_search_path_spec | awk ' BEGIN {RS=" "; FS="/|\n";} { lt_foo=""; lt_count=0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { lt_foo="/" $lt_i lt_foo; } else { lt_count--; } } } } if (lt_foo != "") { lt_freq[lt_foo]++; } if (lt_freq[lt_foo] == 1) { print lt_foo; } }'` sys_lib_search_path_spec=`echo $lt_search_path_spec` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix[4-9]*) version_type=linux need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$host_os in yes,cygwin* | yes,mingw* | yes,pw32*) 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' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $rm \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" ;; mingw*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH printed by # mingw gcc, but we are running on Cygwin. Gcc prints its search # path with ; separators, and with drive letters. We can handle the # drive letters (cygwin fileutils understands them), so leave them, # especially as we might pass files found there to a mingw objdump, # which wouldn't understand a cygwinified path. Ahh. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; esac ;; *) library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' ;; esac dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib" sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd1*) dynamic_linker=no ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[123]*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555. postinstall_cmds='chmod 555 $lib' ;; interix[3-9]*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be Linux ELF. linux* | k*bsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsdelf*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='NetBSD ld.elf_so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; nto-qnx*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[89] | openbsd2.[89].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no export_dynamic_flag_spec='${wl}-Blargedynsym' runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' shlibpath_overrides_runpath=no else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' shlibpath_overrides_runpath=yes case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; uts4*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' 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 if ${lt_cv_sys_lib_search_path_spec+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_sys_lib_search_path_spec="$sys_lib_search_path_spec" fi sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" if ${lt_cv_sys_lib_dlsearch_path_spec+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec" fi sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" 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 { $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-existant 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_AC_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; 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 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 if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it { $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 < #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 #ifdef __cplusplus extern "C" void exit (int); #endif void fnord() { int i=42;} int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; /* dlclose (self); */ } else puts (dlerror ()); exit (status); } 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 < #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 #ifdef __cplusplus extern "C" void exit (int); #endif void fnord() { int i=42;} int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; /* dlclose (self); */ } else puts (dlerror ()); exit (status); } 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 # 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; } # The else clause should only fire when bootstrapping the # libtool distribution, otherwise you forgot to ship ltmain.sh # with your package, and you will get complaints that there are # no rules to generate ltmain.sh. if test -f "$ltmain"; then # 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 # Now quote all the things that may contain metacharacters while being # careful not to overquote the AC_SUBSTed values. We take copies of the # variables and quote the copies for generation of the libtool script. for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \ SED SHELL STRIP \ libname_spec library_names_spec soname_spec extract_expsyms_cmds \ old_striplib striplib file_magic_cmd finish_cmds finish_eval \ deplibs_check_method reload_flag reload_cmds need_locks \ lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ old_postinstall_cmds old_postuninstall_cmds \ compiler \ CC \ LD \ lt_prog_compiler_wl \ lt_prog_compiler_pic \ lt_prog_compiler_static \ lt_prog_compiler_no_builtin_flag \ export_dynamic_flag_spec \ thread_safe_flag_spec \ whole_archive_flag_spec \ enable_shared_with_static_runtimes \ old_archive_cmds \ old_archive_from_new_cmds \ predep_objects \ postdep_objects \ predeps \ postdeps \ compiler_lib_search_path \ compiler_lib_search_dirs \ archive_cmds \ archive_expsym_cmds \ postinstall_cmds \ postuninstall_cmds \ old_archive_from_expsyms_cmds \ allow_undefined_flag \ no_undefined_flag \ export_symbols_cmds \ hardcode_libdir_flag_spec \ hardcode_libdir_flag_spec_ld \ hardcode_libdir_separator \ hardcode_automatic \ module_cmds \ module_expsym_cmds \ lt_cv_prog_compiler_c_o \ fix_srcfile_path \ exclude_expsyms \ include_expsyms; do case $var in old_archive_cmds | \ old_archive_from_new_cmds | \ archive_cmds | \ archive_expsym_cmds | \ module_cmds | \ module_expsym_cmds | \ old_archive_from_expsyms_cmds | \ export_symbols_cmds | \ extract_expsyms_cmds | reload_cmds | finish_cmds | \ postinstall_cmds | postuninstall_cmds | \ old_postinstall_cmds | old_postuninstall_cmds | \ sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) # Double-quote double-evaled strings. eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" ;; *) eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" ;; esac done case $lt_echo in *'\$0 --fallback-echo"') lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` ;; esac cfgfile="${ofile}T" trap "$rm \"$cfgfile\"; exit 1" 1 2 15 $rm -f "$cfgfile" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ofile" >&5 $as_echo "$as_me: creating $ofile" >&6;} cat <<__EOF__ >> "$cfgfile" #! $SHELL # `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) # NOTE: Changes made to this file will be lost: look at ltmain.sh. # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 # Free Software Foundation, Inc. # # This file is part of GNU Libtool: # Originally by Gordon Matzigkeit , 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 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # 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//" # 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 # The names of the tagged configurations supported by this script. available_tags= # ### BEGIN LIBTOOL CONFIG # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # 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 # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # An echo program that does not interpret backslashes. echo=$lt_echo # The archiver. AR=$lt_AR AR_FLAGS=$lt_AR_FLAGS # A C compiler. LTCC=$lt_LTCC # LTCC compiler flags. LTCFLAGS=$lt_LTCFLAGS # A language-specific compiler. CC=$lt_compiler # Is the compiler the GNU C compiler? with_gcc=$GCC # An ERE matcher. EGREP=$lt_EGREP # The linker used to build libraries. LD=$lt_LD # Whether we need hard or soft links. LN_S=$lt_LN_S # A BSD-compatible nm program. NM=$lt_NM # A symbol stripping program STRIP=$lt_STRIP # Used to examine libraries when file_magic_cmd begins "file" MAGIC_CMD=$MAGIC_CMD # Used on cygwin: DLL creation program. DLLTOOL="$DLLTOOL" # Used on cygwin: object dumper. OBJDUMP="$OBJDUMP" # Used on cygwin: assembler. AS="$AS" # The name of the directory that contains temporary libtool files. objdir=$objdir # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl # Object file suffix (normally "o"). objext="$ac_objext" # Old archive suffix (normally "a"). libext="$libext" # Shared library suffix (normally ".so"). shrext_cmds='$shrext_cmds' # Executable file suffix (normally ""). exeext="$exeext" # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic pic_mode=$pic_mode # What is the maximum length of a command? max_cmd_len=$lt_cv_sys_max_cmd_len # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o # Must we lock files when doing compilation? need_locks=$lt_need_locks # 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 # 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 # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag # 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 # Compiler flag to generate thread-safe objects. thread_safe_flag_spec=$lt_thread_safe_flag_spec # Library versioning type. version_type=$version_type # 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 # Commands used to build and install an old-style archive. RANLIB=$lt_RANLIB old_archive_cmds=$lt_old_archive_cmds old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # 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 and install a shared archive. archive_cmds=$lt_archive_cmds archive_expsym_cmds=$lt_archive_expsym_cmds postinstall_cmds=$lt_postinstall_cmds postuninstall_cmds=$lt_postuninstall_cmds # Commands used to build a loadable module (assumed same as above if empty) module_cmds=$lt_module_cmds module_expsym_cmds=$lt_module_expsym_cmds # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # Dependencies to place before the objects being linked to create a # shared library. predep_objects=$lt_predep_objects # Dependencies to place after the objects being linked to create a # shared library. postdep_objects=$lt_postdep_objects # Dependencies to place before the objects being linked to create a # shared library. predeps=$lt_predeps # Dependencies to place after the objects being linked to create a # shared library. postdeps=$lt_postdeps # The directories searched by this compiler when creating a shared # library compiler_lib_search_dirs=$lt_compiler_lib_search_dirs # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path # 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 # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag # Flag that forces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # Same as above, but a single script fragment to be evaled but not shown. finish_eval=$lt_finish_eval # 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 # This is the shared library runtime path variable. runpath_var=$runpath_var # This is the shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist. hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec # If ld is used when linking, flag to hardcode \$libdir into # a binary during linking. This must work even if \$libdir does # not exist. hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld # Whether we need a single -rpath flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator # Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the # resulting binary. hardcode_direct=$hardcode_direct # Set to yes if using 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 # Variables whose values should be saved in libtool wrapper scripts and # restored at relink time. variables_saved_for_relink="$variables_saved_for_relink" # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs # 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 # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path=$lt_fix_srcfile_path # Set to yes if exported symbols are required. always_export_symbols=$always_export_symbols # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_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 # ### END LIBTOOL CONFIG __EOF__ case $host_os in aix3*) cat <<\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 EOF ;; esac # 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) mv -f "$cfgfile" "$ofile" || \ (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" else # If there is no Makefile yet, we rely on a make rule to execute # `config.status --recheck' to rerun these tests and create the # libtool script then. ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` if test -f "$ltmain_in"; then test -f Makefile && make "$ltmain" fi 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" # Check whether --with-tags was given. if test "${with_tags+set}" = set; then : withval=$with_tags; tagnames="$withval" fi if test -f "$ltmain" && test -n "$tagnames"; then if test ! -f "${ofile}"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: output file \`$ofile' does not exist" >&5 $as_echo "$as_me: WARNING: output file \`$ofile' does not exist" >&2;} fi if test -z "$LTCC"; then eval "`$SHELL ${ofile} --config | grep '^LTCC='`" if test -z "$LTCC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: output file \`$ofile' does not look like a libtool script" >&5 $as_echo "$as_me: WARNING: output file \`$ofile' does not look like a libtool script" >&2;} else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&5 $as_echo "$as_me: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&2;} fi fi if test -z "$LTCFLAGS"; then eval "`$SHELL ${ofile} --config | grep '^LTCFLAGS='`" fi # Extract list of available tagged configurations in $ofile. # Note that this assumes the entire list is on one line. available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'` lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for tagname in $tagnames; do IFS="$lt_save_ifs" # Check whether tagname contains only valid characters case `$echo "X$tagname" | $Xsed -e 's:[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]::g'` in "") ;; *) as_fn_error $? "invalid tag name: $tagname" "$LINENO" 5 ;; esac if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null then as_fn_error $? "tag name \"$tagname\" already exists" "$LINENO" 5 fi # Update the list of available tags. if test -n "$tagname"; then echo appending configuration tag \"$tagname\" to $ofile case $tagname in CXX) if test -n "$CXX" && ( test "X$CXX" != "Xno" && ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || (test "X$CXX" != "Xg++"))) ; then ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu archive_cmds_need_lc_CXX=no allow_undefined_flag_CXX= always_export_symbols_CXX=no archive_expsym_cmds_CXX= export_dynamic_flag_spec_CXX= hardcode_direct_CXX=no hardcode_libdir_flag_spec_CXX= hardcode_libdir_flag_spec_ld_CXX= hardcode_libdir_separator_CXX= hardcode_minus_L_CXX=no hardcode_shlibpath_var_CXX=unsupported hardcode_automatic_CXX=no module_cmds_CXX= module_expsym_cmds_CXX= link_all_deplibs_CXX=unknown old_archive_cmds_CXX=$old_archive_cmds no_undefined_flag_CXX= whole_archive_flag_spec_CXX= enable_shared_with_static_runtimes_CXX=no # Dependencies to place before and after the object being linked: predep_objects_CXX= postdep_objects_CXX= predeps_CXX= postdeps_CXX= compiler_lib_search_path_CXX= compiler_lib_search_dirs_CXX= # Source file extension for C++ test sources. ac_ext=cpp # Object file extension for compiled C++ test sources. objext=o objext_CXX=$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(int, char *[]) { return(0); }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # 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* # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_LD=$LD lt_save_GCC=$GCC GCC=$GXX lt_save_with_gnu_ld=$with_gnu_ld lt_save_path_LD=$lt_cv_path_LD if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx else $as_unset lt_cv_prog_gnu_ld fi if test -n "${lt_cv_path_LDCXX+set}"; then lt_cv_path_LD=$lt_cv_path_LDCXX else $as_unset lt_cv_path_LD fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} compiler=$CC compiler_CXX=$CC for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` # We don't want -fno-exception wen compiling C++ code, so set the # no_builtin_flag separately if test "$GXX" = yes; then lt_prog_compiler_no_builtin_flag_CXX=' -fno-builtin' else lt_prog_compiler_no_builtin_flag_CXX= fi if test "$GXX" = yes; then # Set up default GNU C++ configuration # 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 # 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 archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir' export_dynamic_flag_spec_CXX='${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 whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec_CXX= 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. archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' fi # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' else GXX=no with_gnu_ld=no wlarc= fi # PORTME: fill in a description of your system's C++ link characteristics { $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; } ld_shlibs_CXX=yes case $host_os in aix3*) # FIXME: insert proper C++ library support ld_shlibs_CXX=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. archive_cmds_CXX='' hardcode_direct_CXX=yes hardcode_libdir_separator_CXX=':' link_all_deplibs_CXX=yes 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 hardcode_direct_CXX=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_CXX=yes hardcode_libdir_flag_spec_CXX='-L$libdir' hardcode_libdir_separator_CXX= 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 # 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_CXX=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_CXX='-berok' # Determine the default libpath from the value encoded in an empty executable. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/ p } }' aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds_CXX="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec_CXX='${wl}-R $libdir:/usr/lib:/lib' allow_undefined_flag_CXX="-z nodefs" archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an empty executable. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/ p } }' aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec_CXX='${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_CXX=' ${wl}-bernotok' allow_undefined_flag_CXX=' ${wl}-berok' # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec_CXX='$convenience' archive_cmds_need_lc_CXX=yes # This is similar to how AIX traditionally builds its shared libraries. archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; beos*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then allow_undefined_flag_CXX=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds_CXX='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else ld_shlibs_CXX=no fi ;; chorus*) case $cc_basename in *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; cygwin* | mingw* | pw32*) # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec_CXX='-L$libdir' allow_undefined_flag_CXX=unsupported always_export_symbols_CXX=no enable_shared_with_static_runtimes_CXX=yes if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then 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 ld_shlibs_CXX=no fi ;; darwin* | rhapsody*) archive_cmds_need_lc_CXX=no hardcode_direct_CXX=no hardcode_automatic_CXX=yes hardcode_shlibpath_var_CXX=unsupported whole_archive_flag_spec_CXX='' link_all_deplibs_CXX=yes allow_undefined_flag_CXX="$_lt_dar_allow_undefined" if test "$GXX" = yes ; then output_verbose_link_cmd='echo' archive_cmds_CXX="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" module_cmds_CXX="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" archive_expsym_cmds_CXX="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_CXX="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}" if test "$lt_cv_apple_cc_single_mod" != "yes"; then archive_cmds_CXX="\$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}" archive_expsym_cmds_CXX="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 case $cc_basename in xlc*) output_verbose_link_cmd='echo' archive_cmds_CXX='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $xlcverstring' module_cmds_CXX='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $xlcverstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' ;; *) ld_shlibs_CXX=no ;; esac fi ;; dgux*) case $cc_basename in ec++*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; ghcx*) # Green Hills C++ Compiler # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; freebsd[12]*) # C++ shared libraries reported to be fairly broken before switch to ELF ld_shlibs_CXX=no ;; freebsd-elf*) archive_cmds_need_lc_CXX=no ;; freebsd* | dragonfly*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions ld_shlibs_CXX=yes ;; gnu*) ;; hpux9*) hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' hardcode_libdir_separator_CXX=: export_dynamic_flag_spec_CXX='${wl}-E' hardcode_direct_CXX=yes hardcode_minus_L_CXX=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 ld_shlibs_CXX=no ;; aCC*) archive_cmds_CXX='$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) | grep "[-]L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes; then archive_cmds_CXX='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; hpux10*|hpux11*) if test $with_gnu_ld = no; then hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' hardcode_libdir_separator_CXX=: case $host_cpu in hppa*64*|ia64*) ;; *) export_dynamic_flag_spec_CXX='${wl}-E' ;; esac fi case $host_cpu in hppa*64*|ia64*) hardcode_direct_CXX=no hardcode_shlibpath_var_CXX=no ;; *) hardcode_direct_CXX=yes hardcode_minus_L_CXX=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 ld_shlibs_CXX=no ;; aCC*) case $host_cpu in hppa*64*) archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes; then if test $with_gnu_ld = no; then case $host_cpu in hppa*64*) archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; interix[3-9]*) hardcode_direct_CXX=no hardcode_shlibpath_var_CXX=no hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' export_dynamic_flag_spec_CXX='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds_CXX='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' archive_expsym_cmds_CXX='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; irix5* | irix6*) case $cc_basename in CC*) # SGI C++ archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -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. old_archive_cmds_CXX='$CC -ar -WR,-u -o $oldlib $oldobjs' ;; *) if test "$GXX" = yes; then if test "$with_gnu_ld" = no; then archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib' fi fi link_all_deplibs_CXX=yes ;; esac hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_CXX=: ;; linux* | k*bsd*-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. archive_cmds_CXX='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' archive_expsym_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' hardcode_libdir_flag_spec_CXX='${wl}--rpath,$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' ;; icpc*) # 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."*) archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$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 archive_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; esac archive_cmds_need_lc_CXX=no hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive' ;; pgCC* | pgcpp*) # Portland Group C++ compiler archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' archive_expsym_cmds_CXX='$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' hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' whole_archive_flag_spec_CXX='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' ;; cxx*) # Compaq C++ archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$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 hardcode_libdir_flag_spec_CXX='-rpath $libdir' hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 no_undefined_flag_CXX=' -zdefs' archive_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' archive_expsym_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' hardcode_libdir_flag_spec_CXX='-R$libdir' whole_archive_flag_spec_CXX='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' # Not sure whether something based on # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 # would be better. output_verbose_link_cmd='echo' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' ;; esac ;; esac ;; lynxos*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; m88k*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; mvs*) case $cc_basename in cxx*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds_CXX='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' wlarc= hardcode_libdir_flag_spec_CXX='-R$libdir' hardcode_direct_CXX=yes hardcode_shlibpath_var_CXX=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::"' ;; openbsd2*) # C++ shared libraries are fairly broken ld_shlibs_CXX=no ;; openbsd*) if test -f /usr/libexec/ld.so; then hardcode_direct_CXX=yes hardcode_shlibpath_var_CXX=no archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' export_dynamic_flag_spec_CXX='${wl}-E' whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' fi output_verbose_link_cmd='echo' else ld_shlibs_CXX=no fi ;; osf3*) 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. archive_cmds_CXX='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' hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' hardcode_libdir_separator_CXX=: # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; cxx*) allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; 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. archive_cmds_CXX='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' hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' hardcode_libdir_separator_CXX=: # Archives containing C++ object files must be created using # the KAI C++ compiler. old_archive_cmds_CXX='$CC -o $oldlib $oldobjs' ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; cxx*) allow_undefined_flag_CXX=' -expect_unresolved \*' archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds_CXX='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' hardcode_libdir_flag_spec_CXX='-rpath $libdir' hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; psos*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; lcc*) # Lucid # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; solaris*) case $cc_basename in CC*) # Sun C++ 4.2, 5.x and Centerline C++ archive_cmds_need_lc_CXX=yes no_undefined_flag_CXX=' -zdefs' archive_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' archive_expsym_cmds_CXX='$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' hardcode_libdir_flag_spec_CXX='-R$libdir' hardcode_shlibpath_var_CXX=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?) whole_archive_flag_spec_CXX='-z allextract$convenience -z defaultextract' ;; esac link_all_deplibs_CXX=yes output_verbose_link_cmd='echo' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' ;; gcx*) # Green Hills C++ Compiler archive_cmds_CXX='$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. old_archive_cmds_CXX='$CC $LDFLAGS -archive -o $oldlib $oldobjs' ;; *) # GNU C++ compiler with Solaris linker if test "$GXX" = yes && test "$with_gnu_ld" = no; then no_undefined_flag_CXX=' ${wl}-z ${wl}defs' if $CC --version | grep -v '^2\.7' > /dev/null; then archive_cmds_CXX='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" else # g++ 2.7 appears to require `-G' NOT `-shared' on this # platform. archive_cmds_CXX='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" fi hardcode_libdir_flag_spec_CXX='${wl}-R $wl$libdir' case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) whole_archive_flag_spec_CXX='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' ;; esac fi ;; esac ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) no_undefined_flag_CXX='${wl}-z,text' archive_cmds_need_lc_CXX=no hardcode_shlibpath_var_CXX=no runpath_var='LD_RUN_PATH' case $cc_basename in CC*) archive_cmds_CXX='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds_CXX='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. # So that behaviour is only enabled if SCOABSPATH is set to a # non-empty value in the environment. Most likely only useful for # creating official distributions of packages. # This is a hack until libtool officially supports absolute path # names for shared libraries. no_undefined_flag_CXX='${wl}-z,text' allow_undefined_flag_CXX='${wl}-z,nodefs' archive_cmds_need_lc_CXX=no hardcode_shlibpath_var_CXX=no hardcode_libdir_flag_spec_CXX='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' hardcode_libdir_separator_CXX=':' link_all_deplibs_CXX=yes export_dynamic_flag_spec_CXX='${wl}-Bexport' runpath_var='LD_RUN_PATH' case $cc_basename in CC*) archive_cmds_CXX='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds_CXX='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; vxworks*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5 $as_echo "$ld_shlibs_CXX" >&6; } test "$ld_shlibs_CXX" = no && can_build_shared=no GCC_CXX="$GXX" LD_CXX="$LD" cat > conftest.$ac_ext <&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; 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 # The `*' in the case matches for architectures that use `case' in # $output_verbose_cmd can trigger glob expansion during the loop # eval without this substitution. output_verbose_link_cmd=`$echo "X$output_verbose_link_cmd" | $Xsed -e "$no_glob_subst"` for p in `eval $output_verbose_link_cmd`; do case $p in -L* | -R* | -l*) # Some compilers place space between "-{L,R}" and the path. # Remove the space. if test $p = "-L" \ || test $p = "-R"; then prev=$p continue else prev= fi if test "$pre_test_object_deps_done" = no; then case $p in -L* | -R*) # Internal compiler library paths should come after those # provided the user. The postdeps already come after the # user supplied libs so there is no need to process them. if test -z "$compiler_lib_search_path_CXX"; then compiler_lib_search_path_CXX="${prev}${p}" else compiler_lib_search_path_CXX="${compiler_lib_search_path_CXX} ${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 "$postdeps_CXX"; then postdeps_CXX="${prev}${p}" else postdeps_CXX="${postdeps_CXX} ${prev}${p}" fi fi ;; *.$objext) # This assumes that the test object file only shows up # once in the compiler output. if test "$p" = "conftest.$objext"; then pre_test_object_deps_done=yes continue fi if test "$pre_test_object_deps_done" = no; then if test -z "$predep_objects_CXX"; then predep_objects_CXX="$p" else predep_objects_CXX="$predep_objects_CXX $p" fi else if test -z "$postdep_objects_CXX"; then postdep_objects_CXX="$p" else postdep_objects_CXX="$postdep_objects_CXX $p" fi fi ;; *) ;; # Ignore the rest. esac done # Clean up. rm -f a.out a.exe else echo "libtool.m4: error: problem compiling CXX test program" fi $rm -f confest.$objext compiler_lib_search_dirs_CXX= if test -n "$compiler_lib_search_path_CXX"; then compiler_lib_search_dirs_CXX=`echo " ${compiler_lib_search_path_CXX}" | ${SED} -e 's! -L! !g' -e 's!^ !!'` fi # PORTME: override above test on systems where it is broken 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. predep_objects_CXX= postdep_objects_CXX= postdeps_CXX= ;; 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 postdeps_CXX='-library=Cstd -library=Crun' fi ;; esac ;; solaris*) case $cc_basename in CC*) # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as # -library=stlport4 depends on it. case " $CXX $CXXFLAGS " in *" -library=stlport4 "*) solaris_use_stlport4=yes ;; esac # Adding this requires a known-good setup of shared libraries for # Sun compiler versions before 5.6, else PIC objects from an old # archive will be linked into the output, leading to subtle bugs. if test "$solaris_use_stlport4" != yes; then postdeps_CXX='-library=Cstd -library=Crun' fi ;; esac ;; esac case " $postdeps_CXX " in *" -lc "*) archive_cmds_need_lc_CXX=no ;; esac lt_prog_compiler_wl_CXX= lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX= { $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; } # C++ specific cases for pic, static, wl, etc. if test "$GXX" = yes; then lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='-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_CXX='-Bstatic' fi ;; amigaos*) # 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_CXX='-m68020 -resident32 -malways-restore-a4' ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | os2* | pw32*) # 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_CXX='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic_CXX='-fno-common' ;; *djgpp*) # DJGPP does not support shared libraries at all lt_prog_compiler_pic_CXX= ;; 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_prog_compiler_pic_CXX=-Kconform_pic fi ;; hpux*) # 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*) ;; *) lt_prog_compiler_pic_CXX='-fPIC' ;; esac ;; *) lt_prog_compiler_pic_CXX='-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_prog_compiler_static_CXX='-Bstatic' else lt_prog_compiler_static_CXX='-bnso -bI:/lib/syscalls.exp' fi ;; chorus*) case $cc_basename in cxch68*) # Green Hills C++ Compiler # _LT_AC_TAGVAR(lt_prog_compiler_static, CXX)="--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 ;; darwin*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files case $cc_basename in xlc*) lt_prog_compiler_pic_CXX='-qnocommon' lt_prog_compiler_wl_CXX='-Wl,' ;; esac ;; dgux*) case $cc_basename in ec++*) lt_prog_compiler_pic_CXX='-KPIC' ;; ghcx*) # Green Hills C++ Compiler lt_prog_compiler_pic_CXX='-pic' ;; *) ;; esac ;; freebsd* | dragonfly*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) case $cc_basename in CC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='${wl}-a ${wl}archive' if test "$host_cpu" != ia64; then lt_prog_compiler_pic_CXX='+Z' fi ;; aCC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='${wl}-a ${wl}archive' case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic_CXX='+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_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='-non_shared' # CC pic flag -KPIC is the default. ;; *) ;; esac ;; linux* | k*bsd*-gnu) case $cc_basename in KCC*) # KAI C++ Compiler lt_prog_compiler_wl_CXX='--backend -Wl,' lt_prog_compiler_pic_CXX='-fPIC' ;; icpc* | ecpc*) # Intel C++ lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-static' ;; pgCC* | pgcpp*) # Portland Group C++ compiler. lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-fpic' lt_prog_compiler_static_CXX='-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_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX='-non_shared' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-Bstatic' lt_prog_compiler_wl_CXX='-Qoption ld ' ;; esac ;; esac ;; lynxos*) ;; m88k*) ;; mvs*) case $cc_basename in cxx*) lt_prog_compiler_pic_CXX='-W c,exportall' ;; *) ;; esac ;; netbsd* | netbsdelf*-gnu) ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) lt_prog_compiler_wl_CXX='--backend -Wl,' ;; RCC*) # Rational C++ 2.4.1 lt_prog_compiler_pic_CXX='-pic' ;; cxx*) # Digital/Compaq C++ lt_prog_compiler_wl_CXX='-Wl,' # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX='-non_shared' ;; *) ;; esac ;; psos*) ;; solaris*) case $cc_basename in CC*) # Sun C++ 4.2, 5.x and Centerline C++ lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-Bstatic' lt_prog_compiler_wl_CXX='-Qoption ld ' ;; gcx*) # Green Hills C++ Compiler lt_prog_compiler_pic_CXX='-PIC' ;; *) ;; esac ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x lt_prog_compiler_pic_CXX='-pic' lt_prog_compiler_static_CXX='-Bstatic' ;; lcc*) # Lucid lt_prog_compiler_pic_CXX='-pic' ;; *) ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 lt_prog_compiler_pic_CXX='-KPIC' ;; *) ;; esac ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) case $cc_basename in CC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-Bstatic' ;; esac ;; vxworks*) ;; *) lt_prog_compiler_can_build_shared_CXX=no ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_prog_compiler_pic_CXX" >&5 $as_echo "$lt_prog_compiler_pic_CXX" >&6; } # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic_CXX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5 $as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... " >&6; } if ${lt_cv_prog_compiler_pic_works_CXX+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic_works_CXX=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic_CXX -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:12394: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:12398: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_pic_works_CXX=yes fi fi $rm conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works_CXX" >&5 $as_echo "$lt_cv_prog_compiler_pic_works_CXX" >&6; } if test x"$lt_cv_prog_compiler_pic_works_CXX" = xyes; then case $lt_prog_compiler_pic_CXX in "" | " "*) ;; *) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;; esac else lt_prog_compiler_pic_CXX= lt_prog_compiler_can_build_shared_CXX=no fi fi case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic_CXX= ;; *) lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC" ;; esac # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl_CXX eval lt_tmp_static_flag=\"$lt_prog_compiler_static_CXX\" { $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_CXX+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_static_works_CXX=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $lt_tmp_static_flag" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_static_works_CXX=yes fi else lt_cv_prog_compiler_static_works_CXX=yes fi fi $rm -r conftest* LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works_CXX" >&5 $as_echo "$lt_cv_prog_compiler_static_works_CXX" >&6; } if test x"$lt_cv_prog_compiler_static_works_CXX" = xyes; then : else lt_prog_compiler_static_CXX= 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_CXX+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o_CXX=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:12498: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:12502: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o_CXX=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 .. rmdir conftest $rm conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_CXX" >&5 $as_echo "$lt_cv_prog_compiler_c_o_CXX" >&6; } hard_links="nottested" if test "$lt_cv_prog_compiler_c_o_CXX" = 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; } export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' case $host_os in aix[4-9]*) # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | grep 'GNU' > /dev/null; then export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds_CXX='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' fi ;; pw32*) export_symbols_cmds_CXX="$ltdll_cmds" ;; cygwin* | mingw*) export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;/^.*[ ]__nm__/s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' ;; linux* | k*bsd*-gnu) link_all_deplibs_CXX=no ;; *) export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac exclude_expsyms_CXX='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5 $as_echo "$ld_shlibs_CXX" >&6; } test "$ld_shlibs_CXX" = no && can_build_shared=no # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc_CXX" in x|xyes) # Assume -lc should be added archive_cmds_need_lc_CXX=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $archive_cmds_CXX in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 $as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } $rm conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl_CXX pic_flag=$lt_prog_compiler_pic_CXX compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag_CXX allow_undefined_flag_CXX= if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\""; } >&5 (eval $archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then archive_cmds_need_lc_CXX=no else archive_cmds_need_lc_CXX=yes fi allow_undefined_flag_CXX=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $rm conftest* { $as_echo "$as_me:${as_lineno-$LINENO}: result: $archive_cmds_need_lc_CXX" >&5 $as_echo "$archive_cmds_need_lc_CXX" >&6; } ;; esac fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 $as_echo_n "checking dynamic linker characteristics... " >&6; } library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix[4-9]*) version_type=linux need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$host_os in yes,cygwin* | yes,mingw* | yes,pw32*) 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' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $rm \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" ;; mingw*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH printed by # mingw gcc, but we are running on Cygwin. Gcc prints its search # path with ; separators, and with drive letters. We can handle the # drive letters (cygwin fileutils understands them), so leave them, # especially as we might pass files found there to a mingw objdump, # which wouldn't understand a cygwinified path. Ahh. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; esac ;; *) library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' ;; esac dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${versuffix}$shared_ext ${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_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd1*) dynamic_linker=no ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[123]*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555. postinstall_cmds='chmod 555 $lib' ;; interix[3-9]*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be Linux ELF. linux* | k*bsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsdelf*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='NetBSD ld.elf_so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; nto-qnx*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[89] | openbsd2.[89].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no export_dynamic_flag_spec='${wl}-Blargedynsym' runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' shlibpath_overrides_runpath=no else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' shlibpath_overrides_runpath=yes case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; uts4*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' 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 if ${lt_cv_sys_lib_search_path_spec+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_sys_lib_search_path_spec="$sys_lib_search_path_spec" fi sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" if ${lt_cv_sys_lib_dlsearch_path_spec+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec" fi sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" 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 { $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_CXX= if test -n "$hardcode_libdir_flag_spec_CXX" || \ test -n "$runpath_var_CXX" || \ test "X$hardcode_automatic_CXX" = "Xyes" ; then # We can hardcode non-existant directories. if test "$hardcode_direct_CXX" != 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_AC_TAGVAR(hardcode_shlibpath_var, CXX)" != no && test "$hardcode_minus_L_CXX" != no; then # Linking always hardcodes the temporary library directory. hardcode_action_CXX=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action_CXX=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action_CXX=unsupported fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action_CXX" >&5 $as_echo "$hardcode_action_CXX" >&6; } if test "$hardcode_action_CXX" = relink; 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 # The else clause should only fire when bootstrapping the # libtool distribution, otherwise you forgot to ship ltmain.sh # with your package, and you will get complaints that there are # no rules to generate ltmain.sh. if test -f "$ltmain"; then # 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 # Now quote all the things that may contain metacharacters while being # careful not to overquote the AC_SUBSTed values. We take copies of the # variables and quote the copies for generation of the libtool script. for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \ SED SHELL STRIP \ libname_spec library_names_spec soname_spec extract_expsyms_cmds \ old_striplib striplib file_magic_cmd finish_cmds finish_eval \ deplibs_check_method reload_flag reload_cmds need_locks \ lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ old_postinstall_cmds old_postuninstall_cmds \ compiler_CXX \ CC_CXX \ LD_CXX \ lt_prog_compiler_wl_CXX \ lt_prog_compiler_pic_CXX \ lt_prog_compiler_static_CXX \ lt_prog_compiler_no_builtin_flag_CXX \ export_dynamic_flag_spec_CXX \ thread_safe_flag_spec_CXX \ whole_archive_flag_spec_CXX \ enable_shared_with_static_runtimes_CXX \ old_archive_cmds_CXX \ old_archive_from_new_cmds_CXX \ predep_objects_CXX \ postdep_objects_CXX \ predeps_CXX \ postdeps_CXX \ compiler_lib_search_path_CXX \ compiler_lib_search_dirs_CXX \ archive_cmds_CXX \ archive_expsym_cmds_CXX \ postinstall_cmds_CXX \ postuninstall_cmds_CXX \ old_archive_from_expsyms_cmds_CXX \ allow_undefined_flag_CXX \ no_undefined_flag_CXX \ export_symbols_cmds_CXX \ hardcode_libdir_flag_spec_CXX \ hardcode_libdir_flag_spec_ld_CXX \ hardcode_libdir_separator_CXX \ hardcode_automatic_CXX \ module_cmds_CXX \ module_expsym_cmds_CXX \ lt_cv_prog_compiler_c_o_CXX \ fix_srcfile_path_CXX \ exclude_expsyms_CXX \ include_expsyms_CXX; do case $var in old_archive_cmds_CXX | \ old_archive_from_new_cmds_CXX | \ archive_cmds_CXX | \ archive_expsym_cmds_CXX | \ module_cmds_CXX | \ module_expsym_cmds_CXX | \ old_archive_from_expsyms_cmds_CXX | \ export_symbols_cmds_CXX | \ extract_expsyms_cmds | reload_cmds | finish_cmds | \ postinstall_cmds | postuninstall_cmds | \ old_postinstall_cmds | old_postuninstall_cmds | \ sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) # Double-quote double-evaled strings. eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" ;; *) eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" ;; esac done case $lt_echo in *'\$0 --fallback-echo"') lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` ;; esac cfgfile="$ofile" cat <<__EOF__ >> "$cfgfile" # ### BEGIN LIBTOOL TAG CONFIG: $tagname # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc_CXX # Whether or not to disallow shared libs when runtime libs are static allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_CXX # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # An echo program that does not interpret backslashes. echo=$lt_echo # The archiver. AR=$lt_AR AR_FLAGS=$lt_AR_FLAGS # A C compiler. LTCC=$lt_LTCC # LTCC compiler flags. LTCFLAGS=$lt_LTCFLAGS # A language-specific compiler. CC=$lt_compiler_CXX # Is the compiler the GNU C compiler? with_gcc=$GCC_CXX # An ERE matcher. EGREP=$lt_EGREP # The linker used to build libraries. LD=$lt_LD_CXX # Whether we need hard or soft links. LN_S=$lt_LN_S # A BSD-compatible nm program. NM=$lt_NM # A symbol stripping program STRIP=$lt_STRIP # Used to examine libraries when file_magic_cmd begins "file" MAGIC_CMD=$MAGIC_CMD # Used on cygwin: DLL creation program. DLLTOOL="$DLLTOOL" # Used on cygwin: object dumper. OBJDUMP="$OBJDUMP" # Used on cygwin: assembler. AS="$AS" # The name of the directory that contains temporary libtool files. objdir=$objdir # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl_CXX # Object file suffix (normally "o"). objext="$ac_objext" # Old archive suffix (normally "a"). libext="$libext" # Shared library suffix (normally ".so"). shrext_cmds='$shrext_cmds' # Executable file suffix (normally ""). exeext="$exeext" # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic_CXX pic_mode=$pic_mode # What is the maximum length of a command? max_cmd_len=$lt_cv_sys_max_cmd_len # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX # Must we lock files when doing compilation? need_locks=$lt_need_locks # 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 # 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 # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static_CXX # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_CXX # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec_CXX # Compiler flag to generate thread-safe objects. thread_safe_flag_spec=$lt_thread_safe_flag_spec_CXX # Library versioning type. version_type=$version_type # 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 # Commands used to build and install an old-style archive. RANLIB=$lt_RANLIB old_archive_cmds=$lt_old_archive_cmds_CXX old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_CXX # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_CXX # Commands used to build and install a shared archive. archive_cmds=$lt_archive_cmds_CXX archive_expsym_cmds=$lt_archive_expsym_cmds_CXX postinstall_cmds=$lt_postinstall_cmds postuninstall_cmds=$lt_postuninstall_cmds # Commands used to build a loadable module (assumed same as above if empty) module_cmds=$lt_module_cmds_CXX module_expsym_cmds=$lt_module_expsym_cmds_CXX # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # Dependencies to place before the objects being linked to create a # shared library. predep_objects=$lt_predep_objects_CXX # Dependencies to place after the objects being linked to create a # shared library. postdep_objects=$lt_postdep_objects_CXX # Dependencies to place before the objects being linked to create a # shared library. predeps=$lt_predeps_CXX # Dependencies to place after the objects being linked to create a # shared library. postdeps=$lt_postdeps_CXX # The directories searched by this compiler when creating a shared # library compiler_lib_search_dirs=$lt_compiler_lib_search_dirs_CXX # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path_CXX # 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 # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag_CXX # Flag that forces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag_CXX # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # Same as above, but a single script fragment to be evaled but not shown. finish_eval=$lt_finish_eval # 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 # This is the shared library runtime path variable. runpath_var=$runpath_var # This is the shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action_CXX # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # 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_CXX # If ld is used when linking, flag to hardcode \$libdir into # a binary during linking. This must work even if \$libdir does # not exist. hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_CXX # Whether we need a single -rpath flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX # Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the # resulting binary. hardcode_direct=$hardcode_direct_CXX # Set to yes if using the -LDIR flag during linking hardcodes DIR into the # resulting binary. hardcode_minus_L=$hardcode_minus_L_CXX # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into # the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var_CXX # 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_CXX # Variables whose values should be saved in libtool wrapper scripts and # restored at relink time. variables_saved_for_relink="$variables_saved_for_relink" # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs_CXX # 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 # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path=$lt_fix_srcfile_path # Set to yes if exported symbols are required. always_export_symbols=$always_export_symbols_CXX # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds_CXX # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms_CXX # Symbols that must always be exported. include_expsyms=$lt_include_expsyms_CXX # ### END LIBTOOL TAG CONFIG: $tagname __EOF__ else # If there is no Makefile yet, we rely on a make rule to execute # `config.status --recheck' to rerun these tests and create the # libtool script then. ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` if test -f "$ltmain_in"; then test -f Makefile && make "$ltmain" fi 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 LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC with_gnu_ldcxx=$with_gnu_ld 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 else tagname="" fi ;; F77) if test -n "$F77" && test "X$F77" != "Xno"; then ac_ext=f ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5' ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_f77_compiler_gnu archive_cmds_need_lc_F77=no allow_undefined_flag_F77= always_export_symbols_F77=no archive_expsym_cmds_F77= export_dynamic_flag_spec_F77= hardcode_direct_F77=no hardcode_libdir_flag_spec_F77= hardcode_libdir_flag_spec_ld_F77= hardcode_libdir_separator_F77= hardcode_minus_L_F77=no hardcode_automatic_F77=no module_cmds_F77= module_expsym_cmds_F77= link_all_deplibs_F77=unknown old_archive_cmds_F77=$old_archive_cmds no_undefined_flag_F77= whole_archive_flag_spec_F77= enable_shared_with_static_runtimes_F77=no # Source file extension for f77 test sources. ac_ext=f # Object file extension for compiled f77 test sources. objext=o objext_F77=$objext # 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. # 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 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* # Allow CC to be a program name with arguments. lt_save_CC="$CC" CC=${F77-"f77"} compiler=$CC compiler_F77=$CC for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` { $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; } GCC_F77="$G77" LD_F77="$LD" lt_prog_compiler_wl_F77= lt_prog_compiler_pic_F77= lt_prog_compiler_static_F77= { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 $as_echo_n "checking for $compiler option to produce PIC... " >&6; } if test "$GCC" = yes; then lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_static_F77='-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_F77='-Bstatic' fi ;; amigaos*) # 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_F77='-m68020 -resident32 -malways-restore-a4' ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2*) # 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_F77='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic_F77='-fno-common' ;; 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_F77=no enable_shared=no ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic_F77=-Kconform_pic fi ;; hpux*) # 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_F77='-fPIC' ;; esac ;; *) lt_prog_compiler_pic_F77='-fPIC' ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) lt_prog_compiler_wl_F77='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_F77='-Bstatic' else lt_prog_compiler_static_F77='-bnso -bI:/lib/syscalls.exp' fi ;; darwin*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files case $cc_basename in xlc*) lt_prog_compiler_pic_F77='-qnocommon' lt_prog_compiler_wl_F77='-Wl,' ;; esac ;; mingw* | cygwin* | pw32* | os2*) # 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_F77='-DDLL_EXPORT' ;; hpux9* | hpux10* | hpux11*) lt_prog_compiler_wl_F77='-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_F77='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? lt_prog_compiler_static_F77='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) lt_prog_compiler_wl_F77='-Wl,' # PIC (with -KPIC) is the default. lt_prog_compiler_static_F77='-non_shared' ;; newsos6) lt_prog_compiler_pic_F77='-KPIC' lt_prog_compiler_static_F77='-Bstatic' ;; linux* | k*bsd*-gnu) case $cc_basename in icc* | ecc*) lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_pic_F77='-KPIC' lt_prog_compiler_static_F77='-static' ;; pgcc* | pgf77* | pgf90* | pgf95*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_pic_F77='-fpic' lt_prog_compiler_static_F77='-Bstatic' ;; ccc*) lt_prog_compiler_wl_F77='-Wl,' # All Alpha code is PIC. lt_prog_compiler_static_F77='-non_shared' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 lt_prog_compiler_pic_F77='-KPIC' lt_prog_compiler_static_F77='-Bstatic' lt_prog_compiler_wl_F77='-Wl,' ;; *Sun\ F*) # Sun Fortran 8.3 passes all unrecognized flags to the linker lt_prog_compiler_pic_F77='-KPIC' lt_prog_compiler_static_F77='-Bstatic' lt_prog_compiler_wl_F77='' ;; esac ;; esac ;; osf3* | osf4* | osf5*) lt_prog_compiler_wl_F77='-Wl,' # All OSF/1 code is PIC. lt_prog_compiler_static_F77='-non_shared' ;; rdos*) lt_prog_compiler_static_F77='-non_shared' ;; solaris*) lt_prog_compiler_pic_F77='-KPIC' lt_prog_compiler_static_F77='-Bstatic' case $cc_basename in f77* | f90* | f95*) lt_prog_compiler_wl_F77='-Qoption ld ';; *) lt_prog_compiler_wl_F77='-Wl,';; esac ;; sunos4*) lt_prog_compiler_wl_F77='-Qoption ld ' lt_prog_compiler_pic_F77='-PIC' lt_prog_compiler_static_F77='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_pic_F77='-KPIC' lt_prog_compiler_static_F77='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then lt_prog_compiler_pic_F77='-Kconform_pic' lt_prog_compiler_static_F77='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_pic_F77='-KPIC' lt_prog_compiler_static_F77='-Bstatic' ;; unicos*) lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_can_build_shared_F77=no ;; uts4*) lt_prog_compiler_pic_F77='-pic' lt_prog_compiler_static_F77='-Bstatic' ;; *) lt_prog_compiler_can_build_shared_F77=no ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_prog_compiler_pic_F77" >&5 $as_echo "$lt_prog_compiler_pic_F77" >&6; } # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic_F77"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works" >&5 $as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works... " >&6; } if ${lt_cv_prog_compiler_pic_works_F77+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic_works_F77=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic_F77" # 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:14096: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:14100: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_pic_works_F77=yes fi fi $rm conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works_F77" >&5 $as_echo "$lt_cv_prog_compiler_pic_works_F77" >&6; } if test x"$lt_cv_prog_compiler_pic_works_F77" = xyes; then case $lt_prog_compiler_pic_F77 in "" | " "*) ;; *) lt_prog_compiler_pic_F77=" $lt_prog_compiler_pic_F77" ;; esac else lt_prog_compiler_pic_F77= lt_prog_compiler_can_build_shared_F77=no fi fi case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic_F77= ;; *) lt_prog_compiler_pic_F77="$lt_prog_compiler_pic_F77" ;; esac # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl_F77 eval lt_tmp_static_flag=\"$lt_prog_compiler_static_F77\" { $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_F77+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_static_works_F77=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $lt_tmp_static_flag" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_static_works_F77=yes fi else lt_cv_prog_compiler_static_works_F77=yes fi fi $rm -r conftest* LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works_F77" >&5 $as_echo "$lt_cv_prog_compiler_static_works_F77" >&6; } if test x"$lt_cv_prog_compiler_static_works_F77" = xyes; then : else lt_prog_compiler_static_F77= 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_F77+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o_F77=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:14200: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:14204: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o_F77=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 .. rmdir conftest $rm conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_F77" >&5 $as_echo "$lt_cv_prog_compiler_c_o_F77" >&6; } hard_links="nottested" if test "$lt_cv_prog_compiler_c_o_F77" = 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_F77= enable_shared_with_static_runtimes_F77=no archive_cmds_F77= archive_expsym_cmds_F77= old_archive_From_new_cmds_F77= old_archive_from_expsyms_cmds_F77= export_dynamic_flag_spec_F77= whole_archive_flag_spec_F77= thread_safe_flag_spec_F77= hardcode_libdir_flag_spec_F77= hardcode_libdir_flag_spec_ld_F77= hardcode_libdir_separator_F77= hardcode_direct_F77=no hardcode_minus_L_F77=no hardcode_shlibpath_var_F77=unsupported link_all_deplibs_F77=unknown hardcode_automatic_F77=no module_cmds_F77= module_expsym_cmds_F77= always_export_symbols_F77=no export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list include_expsyms_F77= # 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_F77='_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= # Just being paranoid about ensuring that cc_basename is set. for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` case $host_os in cygwin* | mingw* | pw32*) # 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_F77=yes if test "$with_gnu_ld" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec_F77='${wl}--rpath ${wl}$libdir' export_dynamic_flag_spec_F77='${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_F77="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec_F77= fi supports_anon_versioning=no case `$LD -v 2>/dev/null` in *\ [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_F77=no cat <&2 *** Warning: the GNU linker, at least up to release 2.9.1, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to modify your PATH *** so that a non-GNU linker is found, and then restart. EOF fi ;; amigaos*) archive_cmds_F77='$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_F77='-L$libdir' hardcode_minus_L_F77=yes # Samuel A. Falvo II reports # that the semantics of dynamic libraries on AmigaOS, at least up # to version 4, is to share data among multiple programs linked # with the same dynamic library. Since this doesn't match the # behavior of shared libraries on other platforms, we can't use # them. ld_shlibs_F77=no ;; beos*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then allow_undefined_flag_F77=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds_F77='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else ld_shlibs_F77=no fi ;; cygwin* | mingw* | pw32*) # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, F77) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec_F77='-L$libdir' allow_undefined_flag_F77=unsupported always_export_symbols_F77=no enable_shared_with_static_runtimes_F77=yes export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/'\'' -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... archive_expsym_cmds_F77='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then 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_F77=no fi ;; interix[3-9]*) hardcode_direct_F77=no hardcode_shlibpath_var_F77=no hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir' export_dynamic_flag_spec_F77='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds_F77='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' archive_expsym_cmds_F77='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | k*bsd*-gnu) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then tmp_addflag= case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler whole_archive_flag_spec_F77='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers whole_archive_flag_spec_F77='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 whole_archive_flag_spec_F77='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; *) tmp_sharedflag='-shared' ;; esac archive_cmds_F77='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test $supports_anon_versioning = yes; then archive_expsym_cmds_F77='$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 link_all_deplibs_F77=no else ld_shlibs_F77=no fi ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds_F77='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then ld_shlibs_F77=no cat <&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. EOF elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs_F77=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) ld_shlibs_F77=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then hardcode_libdir_flag_spec_F77='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib' archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib' else ld_shlibs_F77=no fi ;; esac ;; sunos4*) archive_cmds_F77='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= hardcode_direct_F77=yes hardcode_shlibpath_var_F77=no ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs_F77=no fi ;; esac if test "$ld_shlibs_F77" = no; then runpath_var= hardcode_libdir_flag_spec_F77= export_dynamic_flag_spec_F77= whole_archive_flag_spec_F77= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) allow_undefined_flag_F77=unsupported always_export_symbols_F77=yes archive_expsym_cmds_F77='$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_F77=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_F77=unsupported fi ;; aix[4-9]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | grep 'GNU' > /dev/null; then export_symbols_cmds_F77='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds_F77='$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_F77='' hardcode_direct_F77=yes hardcode_libdir_separator_F77=':' link_all_deplibs_F77=yes 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_F77=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_F77=yes hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_libdir_separator_F77= 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 # 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_F77=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_F77='-berok' # Determine the default libpath from the value encoded in an empty executable. cat > conftest.$ac_ext <<_ACEOF program main end _ACEOF if ac_fn_f77_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/ p } }' aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec_F77='${wl}-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds_F77="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec_F77='${wl}-R $libdir:/usr/lib:/lib' allow_undefined_flag_F77="-z nodefs" archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an empty executable. cat > conftest.$ac_ext <<_ACEOF program main end _ACEOF if ac_fn_f77_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/ p } }' aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec_F77='${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_F77=' ${wl}-bernotok' allow_undefined_flag_F77=' ${wl}-berok' # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec_F77='$convenience' archive_cmds_need_lc_F77=yes # This is similar to how AIX traditionally builds its shared libraries. archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${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*) archive_cmds_F77='$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_F77='-L$libdir' hardcode_minus_L_F77=yes # see comment about different semantics on the GNU ld section ld_shlibs_F77=no ;; bsdi[45]*) export_dynamic_flag_spec_F77=-rdynamic ;; cygwin* | mingw* | pw32*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec_F77=' ' allow_undefined_flag_F77=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_F77='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_From_new_cmds_F77='true' # FIXME: Should let the user specify the lib program. old_archive_cmds_F77='lib -OUT:$oldlib$oldobjs$old_deplibs' fix_srcfile_path_F77='`cygpath -w "$srcfile"`' enable_shared_with_static_runtimes_F77=yes ;; darwin* | rhapsody*) case $host_os in rhapsody* | darwin1.[012]) allow_undefined_flag_F77='${wl}-undefined ${wl}suppress' ;; *) # Darwin 1.3 on if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then allow_undefined_flag_F77='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' else case ${MACOSX_DEPLOYMENT_TARGET} in 10.[012]) allow_undefined_flag_F77='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) allow_undefined_flag_F77='${wl}-undefined ${wl}dynamic_lookup' ;; esac fi ;; esac archive_cmds_need_lc_F77=no hardcode_direct_F77=no hardcode_automatic_F77=yes hardcode_shlibpath_var_F77=unsupported whole_archive_flag_spec_F77='' link_all_deplibs_F77=yes if test "$GCC" = yes ; then output_verbose_link_cmd='echo' archive_cmds_F77="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" module_cmds_F77="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" archive_expsym_cmds_F77="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_F77="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 case $cc_basename in xlc*) output_verbose_link_cmd='echo' archive_cmds_F77='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $xlcverstring' module_cmds_F77='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $xlcverstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' module_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' ;; *) ld_shlibs_F77=no ;; esac fi ;; dgux*) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_shlibpath_var_F77=no ;; freebsd1*) ld_shlibs_F77=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_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' hardcode_libdir_flag_spec_F77='-R$libdir' hardcode_direct_F77=yes hardcode_shlibpath_var_F77=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2*) archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_F77=yes hardcode_minus_L_F77=yes hardcode_shlibpath_var_F77=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) archive_cmds_F77='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec_F77='-R$libdir' hardcode_direct_F77=yes hardcode_shlibpath_var_F77=no ;; hpux9*) if test "$GCC" = yes; then archive_cmds_F77='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else archive_cmds_F77='$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_F77='${wl}+b ${wl}$libdir' hardcode_libdir_separator_F77=: hardcode_direct_F77=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L_F77=yes export_dynamic_flag_spec_F77='${wl}-E' ;; hpux10*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then archive_cmds_F77='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_F77='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir' hardcode_libdir_separator_F77=: hardcode_direct_F77=yes export_dynamic_flag_spec_F77='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L_F77=yes fi ;; hpux11*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) archive_cmds_F77='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds_F77='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds_F77='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) archive_cmds_F77='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds_F77='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds_F77='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir' hardcode_libdir_separator_F77=: case $host_cpu in hppa*64*|ia64*) hardcode_libdir_flag_spec_ld_F77='+b $libdir' hardcode_direct_F77=no hardcode_shlibpath_var_F77=no ;; *) hardcode_direct_F77=yes export_dynamic_flag_spec_F77='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L_F77=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else archive_cmds_F77='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_ld_F77='-rpath $libdir' fi hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_F77=: link_all_deplibs_F77=yes ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else archive_cmds_F77='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi hardcode_libdir_flag_spec_F77='-R$libdir' hardcode_direct_F77=yes hardcode_shlibpath_var_F77=no ;; newsos6) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_F77=yes hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_F77=: hardcode_shlibpath_var_F77=no ;; openbsd*) if test -f /usr/libexec/ld.so; then hardcode_direct_F77=yes hardcode_shlibpath_var_F77=no if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir' export_dynamic_flag_spec_F77='${wl}-E' else case $host_os in openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec_F77='-R$libdir' ;; *) archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir' ;; esac fi else ld_shlibs_F77=no fi ;; os2*) hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_minus_L_F77=yes allow_undefined_flag_F77=unsupported archive_cmds_F77='$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_F77='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_F77='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else allow_undefined_flag_F77=' -expect_unresolved \*' archive_cmds_F77='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' fi hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_F77=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_F77='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' else allow_undefined_flag_F77=' -expect_unresolved \*' archive_cmds_F77='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds_F77='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ $LD -shared${allow_undefined_flag} -input $lib.exp $linker_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_F77='-rpath $libdir' fi hardcode_libdir_separator_F77=: ;; solaris*) no_undefined_flag_F77=' -z text' if test "$GCC" = yes; then wlarc='${wl}' archive_cmds_F77='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' else wlarc='' archive_cmds_F77='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' fi hardcode_libdir_flag_spec_F77='-R$libdir' hardcode_shlibpath_var_F77=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_F77='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' else whole_archive_flag_spec_F77='-z allextract$convenience -z defaultextract' fi ;; esac link_all_deplibs_F77=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_F77='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_F77='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_direct_F77=yes hardcode_minus_L_F77=yes hardcode_shlibpath_var_F77=no ;; sysv4) case $host_vendor in sni) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_F77=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. archive_cmds_F77='$LD -G -o $lib $libobjs $deplibs $linker_flags' reload_cmds_F77='$CC -r -o $output$reload_objs' hardcode_direct_F77=no ;; motorola) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_F77=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' hardcode_shlibpath_var_F77=no ;; sysv4.3*) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var_F77=no export_dynamic_flag_spec_F77='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var_F77=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ld_shlibs_F77=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) no_undefined_flag_F77='${wl}-z,text' archive_cmds_need_lc_F77=no hardcode_shlibpath_var_F77=no runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds_F77='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_F77='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_F77='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_F77='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. no_undefined_flag_F77='${wl}-z,text' allow_undefined_flag_F77='${wl}-z,nodefs' archive_cmds_need_lc_F77=no hardcode_shlibpath_var_F77=no hardcode_libdir_flag_spec_F77='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' hardcode_libdir_separator_F77=':' link_all_deplibs_F77=yes export_dynamic_flag_spec_F77='${wl}-Bexport' runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds_F77='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_F77='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_F77='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_F77='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_shlibpath_var_F77=no ;; *) ld_shlibs_F77=no ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_F77" >&5 $as_echo "$ld_shlibs_F77" >&6; } test "$ld_shlibs_F77" = no && can_build_shared=no # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc_F77" in x|xyes) # Assume -lc should be added archive_cmds_need_lc_F77=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $archive_cmds_F77 in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 $as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } $rm conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl_F77 pic_flag=$lt_prog_compiler_pic_F77 compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag_F77 allow_undefined_flag_F77= if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds_F77 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\""; } >&5 (eval $archive_cmds_F77 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then archive_cmds_need_lc_F77=no else archive_cmds_need_lc_F77=yes fi allow_undefined_flag_F77=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $rm conftest* { $as_echo "$as_me:${as_lineno-$LINENO}: result: $archive_cmds_need_lc_F77" >&5 $as_echo "$archive_cmds_need_lc_F77" >&6; } ;; esac fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 $as_echo_n "checking dynamic linker characteristics... " >&6; } library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix[4-9]*) version_type=linux need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$host_os in yes,cygwin* | yes,mingw* | yes,pw32*) 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' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $rm \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" ;; mingw*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH printed by # mingw gcc, but we are running on Cygwin. Gcc prints its search # path with ; separators, and with drive letters. We can handle the # drive letters (cygwin fileutils understands them), so leave them, # especially as we might pass files found there to a mingw objdump, # which wouldn't understand a cygwinified path. Ahh. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; esac ;; *) library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' ;; esac dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${versuffix}$shared_ext ${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_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd1*) dynamic_linker=no ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[123]*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555. postinstall_cmds='chmod 555 $lib' ;; interix[3-9]*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be Linux ELF. linux* | k*bsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsdelf*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='NetBSD ld.elf_so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; nto-qnx*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[89] | openbsd2.[89].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no export_dynamic_flag_spec='${wl}-Blargedynsym' runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' shlibpath_overrides_runpath=no else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' shlibpath_overrides_runpath=yes case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; uts4*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' 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 if ${lt_cv_sys_lib_search_path_spec+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_sys_lib_search_path_spec="$sys_lib_search_path_spec" fi sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" if ${lt_cv_sys_lib_dlsearch_path_spec+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec" fi sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" 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 { $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_F77= if test -n "$hardcode_libdir_flag_spec_F77" || \ test -n "$runpath_var_F77" || \ test "X$hardcode_automatic_F77" = "Xyes" ; then # We can hardcode non-existant directories. if test "$hardcode_direct_F77" != 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_AC_TAGVAR(hardcode_shlibpath_var, F77)" != no && test "$hardcode_minus_L_F77" != no; then # Linking always hardcodes the temporary library directory. hardcode_action_F77=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action_F77=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action_F77=unsupported fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action_F77" >&5 $as_echo "$hardcode_action_F77" >&6; } if test "$hardcode_action_F77" = relink; 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 # The else clause should only fire when bootstrapping the # libtool distribution, otherwise you forgot to ship ltmain.sh # with your package, and you will get complaints that there are # no rules to generate ltmain.sh. if test -f "$ltmain"; then # 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 # Now quote all the things that may contain metacharacters while being # careful not to overquote the AC_SUBSTed values. We take copies of the # variables and quote the copies for generation of the libtool script. for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \ SED SHELL STRIP \ libname_spec library_names_spec soname_spec extract_expsyms_cmds \ old_striplib striplib file_magic_cmd finish_cmds finish_eval \ deplibs_check_method reload_flag reload_cmds need_locks \ lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ old_postinstall_cmds old_postuninstall_cmds \ compiler_F77 \ CC_F77 \ LD_F77 \ lt_prog_compiler_wl_F77 \ lt_prog_compiler_pic_F77 \ lt_prog_compiler_static_F77 \ lt_prog_compiler_no_builtin_flag_F77 \ export_dynamic_flag_spec_F77 \ thread_safe_flag_spec_F77 \ whole_archive_flag_spec_F77 \ enable_shared_with_static_runtimes_F77 \ old_archive_cmds_F77 \ old_archive_from_new_cmds_F77 \ predep_objects_F77 \ postdep_objects_F77 \ predeps_F77 \ postdeps_F77 \ compiler_lib_search_path_F77 \ compiler_lib_search_dirs_F77 \ archive_cmds_F77 \ archive_expsym_cmds_F77 \ postinstall_cmds_F77 \ postuninstall_cmds_F77 \ old_archive_from_expsyms_cmds_F77 \ allow_undefined_flag_F77 \ no_undefined_flag_F77 \ export_symbols_cmds_F77 \ hardcode_libdir_flag_spec_F77 \ hardcode_libdir_flag_spec_ld_F77 \ hardcode_libdir_separator_F77 \ hardcode_automatic_F77 \ module_cmds_F77 \ module_expsym_cmds_F77 \ lt_cv_prog_compiler_c_o_F77 \ fix_srcfile_path_F77 \ exclude_expsyms_F77 \ include_expsyms_F77; do case $var in old_archive_cmds_F77 | \ old_archive_from_new_cmds_F77 | \ archive_cmds_F77 | \ archive_expsym_cmds_F77 | \ module_cmds_F77 | \ module_expsym_cmds_F77 | \ old_archive_from_expsyms_cmds_F77 | \ export_symbols_cmds_F77 | \ extract_expsyms_cmds | reload_cmds | finish_cmds | \ postinstall_cmds | postuninstall_cmds | \ old_postinstall_cmds | old_postuninstall_cmds | \ sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) # Double-quote double-evaled strings. eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" ;; *) eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" ;; esac done case $lt_echo in *'\$0 --fallback-echo"') lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` ;; esac cfgfile="$ofile" cat <<__EOF__ >> "$cfgfile" # ### BEGIN LIBTOOL TAG CONFIG: $tagname # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc_F77 # Whether or not to disallow shared libs when runtime libs are static allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_F77 # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # An echo program that does not interpret backslashes. echo=$lt_echo # The archiver. AR=$lt_AR AR_FLAGS=$lt_AR_FLAGS # A C compiler. LTCC=$lt_LTCC # LTCC compiler flags. LTCFLAGS=$lt_LTCFLAGS # A language-specific compiler. CC=$lt_compiler_F77 # Is the compiler the GNU C compiler? with_gcc=$GCC_F77 # An ERE matcher. EGREP=$lt_EGREP # The linker used to build libraries. LD=$lt_LD_F77 # Whether we need hard or soft links. LN_S=$lt_LN_S # A BSD-compatible nm program. NM=$lt_NM # A symbol stripping program STRIP=$lt_STRIP # Used to examine libraries when file_magic_cmd begins "file" MAGIC_CMD=$MAGIC_CMD # Used on cygwin: DLL creation program. DLLTOOL="$DLLTOOL" # Used on cygwin: object dumper. OBJDUMP="$OBJDUMP" # Used on cygwin: assembler. AS="$AS" # The name of the directory that contains temporary libtool files. objdir=$objdir # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl_F77 # Object file suffix (normally "o"). objext="$ac_objext" # Old archive suffix (normally "a"). libext="$libext" # Shared library suffix (normally ".so"). shrext_cmds='$shrext_cmds' # Executable file suffix (normally ""). exeext="$exeext" # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic_F77 pic_mode=$pic_mode # What is the maximum length of a command? max_cmd_len=$lt_cv_sys_max_cmd_len # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o_F77 # Must we lock files when doing compilation? need_locks=$lt_need_locks # 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 # 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 # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static_F77 # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_F77 # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_F77 # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec_F77 # Compiler flag to generate thread-safe objects. thread_safe_flag_spec=$lt_thread_safe_flag_spec_F77 # Library versioning type. version_type=$version_type # 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 # Commands used to build and install an old-style archive. RANLIB=$lt_RANLIB old_archive_cmds=$lt_old_archive_cmds_F77 old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_F77 # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_F77 # Commands used to build and install a shared archive. archive_cmds=$lt_archive_cmds_F77 archive_expsym_cmds=$lt_archive_expsym_cmds_F77 postinstall_cmds=$lt_postinstall_cmds postuninstall_cmds=$lt_postuninstall_cmds # Commands used to build a loadable module (assumed same as above if empty) module_cmds=$lt_module_cmds_F77 module_expsym_cmds=$lt_module_expsym_cmds_F77 # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # Dependencies to place before the objects being linked to create a # shared library. predep_objects=$lt_predep_objects_F77 # Dependencies to place after the objects being linked to create a # shared library. postdep_objects=$lt_postdep_objects_F77 # Dependencies to place before the objects being linked to create a # shared library. predeps=$lt_predeps_F77 # Dependencies to place after the objects being linked to create a # shared library. postdeps=$lt_postdeps_F77 # The directories searched by this compiler when creating a shared # library compiler_lib_search_dirs=$lt_compiler_lib_search_dirs_F77 # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path_F77 # 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 # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag_F77 # Flag that forces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag_F77 # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # Same as above, but a single script fragment to be evaled but not shown. finish_eval=$lt_finish_eval # 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 # This is the shared library runtime path variable. runpath_var=$runpath_var # This is the shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action_F77 # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # 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_F77 # If ld is used when linking, flag to hardcode \$libdir into # a binary during linking. This must work even if \$libdir does # not exist. hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_F77 # Whether we need a single -rpath flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator_F77 # Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the # resulting binary. hardcode_direct=$hardcode_direct_F77 # Set to yes if using the -LDIR flag during linking hardcodes DIR into the # resulting binary. hardcode_minus_L=$hardcode_minus_L_F77 # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into # the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var_F77 # 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_F77 # Variables whose values should be saved in libtool wrapper scripts and # restored at relink time. variables_saved_for_relink="$variables_saved_for_relink" # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs_F77 # 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 # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path=$lt_fix_srcfile_path # Set to yes if exported symbols are required. always_export_symbols=$always_export_symbols_F77 # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds_F77 # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms_F77 # Symbols that must always be exported. include_expsyms=$lt_include_expsyms_F77 # ### END LIBTOOL TAG CONFIG: $tagname __EOF__ else # If there is no Makefile yet, we rely on a make rule to execute # `config.status --recheck' to rerun these tests and create the # libtool script then. ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` if test -f "$ltmain_in"; then test -f Makefile && make "$ltmain" fi 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" else tagname="" fi ;; GCJ) if test -n "$GCJ" && test "X$GCJ" != "Xno"; then # Source file extension for Java test sources. ac_ext=java # Object file extension for compiled Java test sources. objext=o objext_GCJ=$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. # 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 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* # Allow CC to be a program name with arguments. lt_save_CC="$CC" CC=${GCJ-"gcj"} compiler=$CC compiler_GCJ=$CC for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` # GCJ did not exist at the time GCC didn't implicitly link libc in. archive_cmds_need_lc_GCJ=no old_archive_cmds_GCJ=$old_archive_cmds lt_prog_compiler_no_builtin_flag_GCJ= if test "$GCC" = yes; then lt_prog_compiler_no_builtin_flag_GCJ=' -fno-builtin' { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 $as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } if ${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:16374: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:16378: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_rtti_exceptions=yes fi fi $rm conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 $as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; } if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then lt_prog_compiler_no_builtin_flag_GCJ="$lt_prog_compiler_no_builtin_flag_GCJ -fno-rtti -fno-exceptions" else : fi fi lt_prog_compiler_wl_GCJ= lt_prog_compiler_pic_GCJ= lt_prog_compiler_static_GCJ= { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 $as_echo_n "checking for $compiler option to produce PIC... " >&6; } if test "$GCC" = yes; then lt_prog_compiler_wl_GCJ='-Wl,' lt_prog_compiler_static_GCJ='-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_GCJ='-Bstatic' fi ;; amigaos*) # 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_GCJ='-m68020 -resident32 -malways-restore-a4' ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2*) # 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 ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic_GCJ='-fno-common' ;; 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_GCJ=no enable_shared=no ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic_GCJ=-Kconform_pic fi ;; hpux*) # 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_GCJ='-fPIC' ;; esac ;; *) lt_prog_compiler_pic_GCJ='-fPIC' ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) lt_prog_compiler_wl_GCJ='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_GCJ='-Bstatic' else lt_prog_compiler_static_GCJ='-bnso -bI:/lib/syscalls.exp' fi ;; darwin*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files case $cc_basename in xlc*) lt_prog_compiler_pic_GCJ='-qnocommon' lt_prog_compiler_wl_GCJ='-Wl,' ;; esac ;; mingw* | cygwin* | pw32* | os2*) # 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). ;; hpux9* | hpux10* | hpux11*) lt_prog_compiler_wl_GCJ='-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_GCJ='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? lt_prog_compiler_static_GCJ='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) lt_prog_compiler_wl_GCJ='-Wl,' # PIC (with -KPIC) is the default. lt_prog_compiler_static_GCJ='-non_shared' ;; newsos6) lt_prog_compiler_pic_GCJ='-KPIC' lt_prog_compiler_static_GCJ='-Bstatic' ;; linux* | k*bsd*-gnu) case $cc_basename in icc* | ecc*) lt_prog_compiler_wl_GCJ='-Wl,' lt_prog_compiler_pic_GCJ='-KPIC' lt_prog_compiler_static_GCJ='-static' ;; pgcc* | pgf77* | pgf90* | pgf95*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) lt_prog_compiler_wl_GCJ='-Wl,' lt_prog_compiler_pic_GCJ='-fpic' lt_prog_compiler_static_GCJ='-Bstatic' ;; ccc*) lt_prog_compiler_wl_GCJ='-Wl,' # All Alpha code is PIC. lt_prog_compiler_static_GCJ='-non_shared' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 lt_prog_compiler_pic_GCJ='-KPIC' lt_prog_compiler_static_GCJ='-Bstatic' lt_prog_compiler_wl_GCJ='-Wl,' ;; *Sun\ F*) # Sun Fortran 8.3 passes all unrecognized flags to the linker lt_prog_compiler_pic_GCJ='-KPIC' lt_prog_compiler_static_GCJ='-Bstatic' lt_prog_compiler_wl_GCJ='' ;; esac ;; esac ;; osf3* | osf4* | osf5*) lt_prog_compiler_wl_GCJ='-Wl,' # All OSF/1 code is PIC. lt_prog_compiler_static_GCJ='-non_shared' ;; rdos*) lt_prog_compiler_static_GCJ='-non_shared' ;; solaris*) lt_prog_compiler_pic_GCJ='-KPIC' lt_prog_compiler_static_GCJ='-Bstatic' case $cc_basename in f77* | f90* | f95*) lt_prog_compiler_wl_GCJ='-Qoption ld ';; *) lt_prog_compiler_wl_GCJ='-Wl,';; esac ;; sunos4*) lt_prog_compiler_wl_GCJ='-Qoption ld ' lt_prog_compiler_pic_GCJ='-PIC' lt_prog_compiler_static_GCJ='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) lt_prog_compiler_wl_GCJ='-Wl,' lt_prog_compiler_pic_GCJ='-KPIC' lt_prog_compiler_static_GCJ='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then lt_prog_compiler_pic_GCJ='-Kconform_pic' lt_prog_compiler_static_GCJ='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) lt_prog_compiler_wl_GCJ='-Wl,' lt_prog_compiler_pic_GCJ='-KPIC' lt_prog_compiler_static_GCJ='-Bstatic' ;; unicos*) lt_prog_compiler_wl_GCJ='-Wl,' lt_prog_compiler_can_build_shared_GCJ=no ;; uts4*) lt_prog_compiler_pic_GCJ='-pic' lt_prog_compiler_static_GCJ='-Bstatic' ;; *) lt_prog_compiler_can_build_shared_GCJ=no ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_prog_compiler_pic_GCJ" >&5 $as_echo "$lt_prog_compiler_pic_GCJ" >&6; } # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic_GCJ"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works" >&5 $as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works... " >&6; } if ${lt_cv_prog_compiler_pic_works_GCJ+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic_works_GCJ=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic_GCJ" # 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:16664: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:16668: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_pic_works_GCJ=yes fi fi $rm conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works_GCJ" >&5 $as_echo "$lt_cv_prog_compiler_pic_works_GCJ" >&6; } if test x"$lt_cv_prog_compiler_pic_works_GCJ" = xyes; then case $lt_prog_compiler_pic_GCJ in "" | " "*) ;; *) lt_prog_compiler_pic_GCJ=" $lt_prog_compiler_pic_GCJ" ;; esac else lt_prog_compiler_pic_GCJ= lt_prog_compiler_can_build_shared_GCJ=no fi fi case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic_GCJ= ;; *) lt_prog_compiler_pic_GCJ="$lt_prog_compiler_pic_GCJ" ;; esac # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl_GCJ eval lt_tmp_static_flag=\"$lt_prog_compiler_static_GCJ\" { $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_GCJ+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_static_works_GCJ=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $lt_tmp_static_flag" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_static_works_GCJ=yes fi else lt_cv_prog_compiler_static_works_GCJ=yes fi fi $rm -r conftest* LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works_GCJ" >&5 $as_echo "$lt_cv_prog_compiler_static_works_GCJ" >&6; } if test x"$lt_cv_prog_compiler_static_works_GCJ" = xyes; then : else lt_prog_compiler_static_GCJ= 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_GCJ+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o_GCJ=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:16768: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:16772: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o_GCJ=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 .. rmdir conftest $rm conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_GCJ" >&5 $as_echo "$lt_cv_prog_compiler_c_o_GCJ" >&6; } hard_links="nottested" if test "$lt_cv_prog_compiler_c_o_GCJ" = 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_GCJ= enable_shared_with_static_runtimes_GCJ=no archive_cmds_GCJ= archive_expsym_cmds_GCJ= old_archive_From_new_cmds_GCJ= old_archive_from_expsyms_cmds_GCJ= export_dynamic_flag_spec_GCJ= whole_archive_flag_spec_GCJ= thread_safe_flag_spec_GCJ= hardcode_libdir_flag_spec_GCJ= hardcode_libdir_flag_spec_ld_GCJ= hardcode_libdir_separator_GCJ= hardcode_direct_GCJ=no hardcode_minus_L_GCJ=no hardcode_shlibpath_var_GCJ=unsupported link_all_deplibs_GCJ=unknown hardcode_automatic_GCJ=no module_cmds_GCJ= module_expsym_cmds_GCJ= always_export_symbols_GCJ=no export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list include_expsyms_GCJ= # 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_GCJ='_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= # Just being paranoid about ensuring that cc_basename is set. for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` case $host_os in cygwin* | mingw* | pw32*) # 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_GCJ=yes if test "$with_gnu_ld" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec_GCJ='${wl}--rpath ${wl}$libdir' export_dynamic_flag_spec_GCJ='${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_GCJ="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec_GCJ= fi supports_anon_versioning=no case `$LD -v 2>/dev/null` in *\ [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_GCJ=no cat <&2 *** Warning: the GNU linker, at least up to release 2.9.1, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to modify your PATH *** so that a non-GNU linker is found, and then restart. EOF fi ;; amigaos*) archive_cmds_GCJ='$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_GCJ='-L$libdir' hardcode_minus_L_GCJ=yes # Samuel A. Falvo II reports # that the semantics of dynamic libraries on AmigaOS, at least up # to version 4, is to share data among multiple programs linked # with the same dynamic library. Since this doesn't match the # behavior of shared libraries on other platforms, we can't use # them. ld_shlibs_GCJ=no ;; beos*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then allow_undefined_flag_GCJ=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds_GCJ='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else ld_shlibs_GCJ=no fi ;; cygwin* | mingw* | pw32*) # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, GCJ) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec_GCJ='-L$libdir' allow_undefined_flag_GCJ=unsupported always_export_symbols_GCJ=no enable_shared_with_static_runtimes_GCJ=yes export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/'\'' -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... archive_expsym_cmds_GCJ='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then 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_GCJ=no fi ;; interix[3-9]*) hardcode_direct_GCJ=no hardcode_shlibpath_var_GCJ=no hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir' export_dynamic_flag_spec_GCJ='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds_GCJ='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' archive_expsym_cmds_GCJ='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | k*bsd*-gnu) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then tmp_addflag= case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler whole_archive_flag_spec_GCJ='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers whole_archive_flag_spec_GCJ='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 whole_archive_flag_spec_GCJ='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; *) tmp_sharedflag='-shared' ;; esac archive_cmds_GCJ='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test $supports_anon_versioning = yes; then archive_expsym_cmds_GCJ='$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 link_all_deplibs_GCJ=no else ld_shlibs_GCJ=no fi ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds_GCJ='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then ld_shlibs_GCJ=no cat <&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. EOF elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs_GCJ=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) ld_shlibs_GCJ=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then hardcode_libdir_flag_spec_GCJ='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib' archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib' else ld_shlibs_GCJ=no fi ;; esac ;; sunos4*) archive_cmds_GCJ='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= hardcode_direct_GCJ=yes hardcode_shlibpath_var_GCJ=no ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs_GCJ=no fi ;; esac if test "$ld_shlibs_GCJ" = no; then runpath_var= hardcode_libdir_flag_spec_GCJ= export_dynamic_flag_spec_GCJ= whole_archive_flag_spec_GCJ= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) allow_undefined_flag_GCJ=unsupported always_export_symbols_GCJ=yes archive_expsym_cmds_GCJ='$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_GCJ=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_GCJ=unsupported fi ;; aix[4-9]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | grep 'GNU' > /dev/null; then export_symbols_cmds_GCJ='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds_GCJ='$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_GCJ='' hardcode_direct_GCJ=yes hardcode_libdir_separator_GCJ=':' link_all_deplibs_GCJ=yes 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_GCJ=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_GCJ=yes hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_libdir_separator_GCJ= 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 # 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_GCJ=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_GCJ='-berok' # Determine the default libpath from the value encoded in an empty executable. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/ p } }' aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec_GCJ='${wl}-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds_GCJ="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec_GCJ='${wl}-R $libdir:/usr/lib:/lib' allow_undefined_flag_GCJ="-z nodefs" archive_expsym_cmds_GCJ="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an empty executable. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/ p } }' aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec_GCJ='${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_GCJ=' ${wl}-bernotok' allow_undefined_flag_GCJ=' ${wl}-berok' # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec_GCJ='$convenience' archive_cmds_need_lc_GCJ=yes # This is similar to how AIX traditionally builds its shared libraries. archive_expsym_cmds_GCJ="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${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*) archive_cmds_GCJ='$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_GCJ='-L$libdir' hardcode_minus_L_GCJ=yes # see comment about different semantics on the GNU ld section ld_shlibs_GCJ=no ;; bsdi[45]*) export_dynamic_flag_spec_GCJ=-rdynamic ;; cygwin* | mingw* | pw32*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec_GCJ=' ' allow_undefined_flag_GCJ=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_GCJ='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_From_new_cmds_GCJ='true' # FIXME: Should let the user specify the lib program. old_archive_cmds_GCJ='lib -OUT:$oldlib$oldobjs$old_deplibs' fix_srcfile_path_GCJ='`cygpath -w "$srcfile"`' enable_shared_with_static_runtimes_GCJ=yes ;; darwin* | rhapsody*) case $host_os in rhapsody* | darwin1.[012]) allow_undefined_flag_GCJ='${wl}-undefined ${wl}suppress' ;; *) # Darwin 1.3 on if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then allow_undefined_flag_GCJ='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' else case ${MACOSX_DEPLOYMENT_TARGET} in 10.[012]) allow_undefined_flag_GCJ='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) allow_undefined_flag_GCJ='${wl}-undefined ${wl}dynamic_lookup' ;; esac fi ;; esac archive_cmds_need_lc_GCJ=no hardcode_direct_GCJ=no hardcode_automatic_GCJ=yes hardcode_shlibpath_var_GCJ=unsupported whole_archive_flag_spec_GCJ='' link_all_deplibs_GCJ=yes if test "$GCC" = yes ; then output_verbose_link_cmd='echo' archive_cmds_GCJ="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" module_cmds_GCJ="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" archive_expsym_cmds_GCJ="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_GCJ="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 case $cc_basename in xlc*) output_verbose_link_cmd='echo' archive_cmds_GCJ='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $xlcverstring' module_cmds_GCJ='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $xlcverstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' module_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' ;; *) ld_shlibs_GCJ=no ;; esac fi ;; dgux*) archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_shlibpath_var_GCJ=no ;; freebsd1*) ld_shlibs_GCJ=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_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' hardcode_libdir_flag_spec_GCJ='-R$libdir' hardcode_direct_GCJ=yes hardcode_shlibpath_var_GCJ=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2*) archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_GCJ=yes hardcode_minus_L_GCJ=yes hardcode_shlibpath_var_GCJ=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) archive_cmds_GCJ='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec_GCJ='-R$libdir' hardcode_direct_GCJ=yes hardcode_shlibpath_var_GCJ=no ;; hpux9*) if test "$GCC" = yes; then archive_cmds_GCJ='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else archive_cmds_GCJ='$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_GCJ='${wl}+b ${wl}$libdir' hardcode_libdir_separator_GCJ=: hardcode_direct_GCJ=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L_GCJ=yes export_dynamic_flag_spec_GCJ='${wl}-E' ;; hpux10*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then archive_cmds_GCJ='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_GCJ='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir' hardcode_libdir_separator_GCJ=: hardcode_direct_GCJ=yes export_dynamic_flag_spec_GCJ='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L_GCJ=yes fi ;; hpux11*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) archive_cmds_GCJ='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds_GCJ='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds_GCJ='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) archive_cmds_GCJ='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds_GCJ='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds_GCJ='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir' hardcode_libdir_separator_GCJ=: case $host_cpu in hppa*64*|ia64*) hardcode_libdir_flag_spec_ld_GCJ='+b $libdir' hardcode_direct_GCJ=no hardcode_shlibpath_var_GCJ=no ;; *) hardcode_direct_GCJ=yes export_dynamic_flag_spec_GCJ='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L_GCJ=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else archive_cmds_GCJ='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_ld_GCJ='-rpath $libdir' fi hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_GCJ=: link_all_deplibs_GCJ=yes ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else archive_cmds_GCJ='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi hardcode_libdir_flag_spec_GCJ='-R$libdir' hardcode_direct_GCJ=yes hardcode_shlibpath_var_GCJ=no ;; newsos6) archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_GCJ=yes hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_GCJ=: hardcode_shlibpath_var_GCJ=no ;; openbsd*) if test -f /usr/libexec/ld.so; then hardcode_direct_GCJ=yes hardcode_shlibpath_var_GCJ=no if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir' export_dynamic_flag_spec_GCJ='${wl}-E' else case $host_os in openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec_GCJ='-R$libdir' ;; *) archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir' ;; esac fi else ld_shlibs_GCJ=no fi ;; os2*) hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_minus_L_GCJ=yes allow_undefined_flag_GCJ=unsupported archive_cmds_GCJ='$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_GCJ='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then allow_undefined_flag_GCJ=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_GCJ='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else allow_undefined_flag_GCJ=' -expect_unresolved \*' archive_cmds_GCJ='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' fi hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_GCJ=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then allow_undefined_flag_GCJ=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_GCJ='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' else allow_undefined_flag_GCJ=' -expect_unresolved \*' archive_cmds_GCJ='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds_GCJ='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ $LD -shared${allow_undefined_flag} -input $lib.exp $linker_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_GCJ='-rpath $libdir' fi hardcode_libdir_separator_GCJ=: ;; solaris*) no_undefined_flag_GCJ=' -z text' if test "$GCC" = yes; then wlarc='${wl}' archive_cmds_GCJ='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' else wlarc='' archive_cmds_GCJ='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' fi hardcode_libdir_flag_spec_GCJ='-R$libdir' hardcode_shlibpath_var_GCJ=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_GCJ='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' else whole_archive_flag_spec_GCJ='-z allextract$convenience -z defaultextract' fi ;; esac link_all_deplibs_GCJ=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_GCJ='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_GCJ='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_direct_GCJ=yes hardcode_minus_L_GCJ=yes hardcode_shlibpath_var_GCJ=no ;; sysv4) case $host_vendor in sni) archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_GCJ=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. archive_cmds_GCJ='$LD -G -o $lib $libobjs $deplibs $linker_flags' reload_cmds_GCJ='$CC -r -o $output$reload_objs' hardcode_direct_GCJ=no ;; motorola) archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_GCJ=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' hardcode_shlibpath_var_GCJ=no ;; sysv4.3*) archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var_GCJ=no export_dynamic_flag_spec_GCJ='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var_GCJ=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ld_shlibs_GCJ=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) no_undefined_flag_GCJ='${wl}-z,text' archive_cmds_need_lc_GCJ=no hardcode_shlibpath_var_GCJ=no runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds_GCJ='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_GCJ='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_GCJ='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_GCJ='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. no_undefined_flag_GCJ='${wl}-z,text' allow_undefined_flag_GCJ='${wl}-z,nodefs' archive_cmds_need_lc_GCJ=no hardcode_shlibpath_var_GCJ=no hardcode_libdir_flag_spec_GCJ='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' hardcode_libdir_separator_GCJ=':' link_all_deplibs_GCJ=yes export_dynamic_flag_spec_GCJ='${wl}-Bexport' runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds_GCJ='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_GCJ='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_GCJ='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_GCJ='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_shlibpath_var_GCJ=no ;; *) ld_shlibs_GCJ=no ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_GCJ" >&5 $as_echo "$ld_shlibs_GCJ" >&6; } test "$ld_shlibs_GCJ" = no && can_build_shared=no # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc_GCJ" in x|xyes) # Assume -lc should be added archive_cmds_need_lc_GCJ=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $archive_cmds_GCJ in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 $as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } $rm conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl_GCJ pic_flag=$lt_prog_compiler_pic_GCJ compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag_GCJ allow_undefined_flag_GCJ= if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds_GCJ 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\""; } >&5 (eval $archive_cmds_GCJ 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then archive_cmds_need_lc_GCJ=no else archive_cmds_need_lc_GCJ=yes fi allow_undefined_flag_GCJ=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $rm conftest* { $as_echo "$as_me:${as_lineno-$LINENO}: result: $archive_cmds_need_lc_GCJ" >&5 $as_echo "$archive_cmds_need_lc_GCJ" >&6; } ;; esac fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 $as_echo_n "checking dynamic linker characteristics... " >&6; } library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix[4-9]*) version_type=linux need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$host_os in yes,cygwin* | yes,mingw* | yes,pw32*) 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' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $rm \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" ;; mingw*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH printed by # mingw gcc, but we are running on Cygwin. Gcc prints its search # path with ; separators, and with drive letters. We can handle the # drive letters (cygwin fileutils understands them), so leave them, # especially as we might pass files found there to a mingw objdump, # which wouldn't understand a cygwinified path. Ahh. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; esac ;; *) library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' ;; esac dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${versuffix}$shared_ext ${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_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd1*) dynamic_linker=no ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[123]*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555. postinstall_cmds='chmod 555 $lib' ;; interix[3-9]*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be Linux ELF. linux* | k*bsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsdelf*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='NetBSD ld.elf_so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; nto-qnx*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[89] | openbsd2.[89].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no export_dynamic_flag_spec='${wl}-Blargedynsym' runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' shlibpath_overrides_runpath=no else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' shlibpath_overrides_runpath=yes case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; uts4*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' 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 if ${lt_cv_sys_lib_search_path_spec+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_sys_lib_search_path_spec="$sys_lib_search_path_spec" fi sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" if ${lt_cv_sys_lib_dlsearch_path_spec+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec" fi sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" 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 { $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_GCJ= if test -n "$hardcode_libdir_flag_spec_GCJ" || \ test -n "$runpath_var_GCJ" || \ test "X$hardcode_automatic_GCJ" = "Xyes" ; then # We can hardcode non-existant directories. if test "$hardcode_direct_GCJ" != 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_AC_TAGVAR(hardcode_shlibpath_var, GCJ)" != no && test "$hardcode_minus_L_GCJ" != no; then # Linking always hardcodes the temporary library directory. hardcode_action_GCJ=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action_GCJ=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action_GCJ=unsupported fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action_GCJ" >&5 $as_echo "$hardcode_action_GCJ" >&6; } if test "$hardcode_action_GCJ" = relink; 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 # The else clause should only fire when bootstrapping the # libtool distribution, otherwise you forgot to ship ltmain.sh # with your package, and you will get complaints that there are # no rules to generate ltmain.sh. if test -f "$ltmain"; then # 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 # Now quote all the things that may contain metacharacters while being # careful not to overquote the AC_SUBSTed values. We take copies of the # variables and quote the copies for generation of the libtool script. for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \ SED SHELL STRIP \ libname_spec library_names_spec soname_spec extract_expsyms_cmds \ old_striplib striplib file_magic_cmd finish_cmds finish_eval \ deplibs_check_method reload_flag reload_cmds need_locks \ lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ old_postinstall_cmds old_postuninstall_cmds \ compiler_GCJ \ CC_GCJ \ LD_GCJ \ lt_prog_compiler_wl_GCJ \ lt_prog_compiler_pic_GCJ \ lt_prog_compiler_static_GCJ \ lt_prog_compiler_no_builtin_flag_GCJ \ export_dynamic_flag_spec_GCJ \ thread_safe_flag_spec_GCJ \ whole_archive_flag_spec_GCJ \ enable_shared_with_static_runtimes_GCJ \ old_archive_cmds_GCJ \ old_archive_from_new_cmds_GCJ \ predep_objects_GCJ \ postdep_objects_GCJ \ predeps_GCJ \ postdeps_GCJ \ compiler_lib_search_path_GCJ \ compiler_lib_search_dirs_GCJ \ archive_cmds_GCJ \ archive_expsym_cmds_GCJ \ postinstall_cmds_GCJ \ postuninstall_cmds_GCJ \ old_archive_from_expsyms_cmds_GCJ \ allow_undefined_flag_GCJ \ no_undefined_flag_GCJ \ export_symbols_cmds_GCJ \ hardcode_libdir_flag_spec_GCJ \ hardcode_libdir_flag_spec_ld_GCJ \ hardcode_libdir_separator_GCJ \ hardcode_automatic_GCJ \ module_cmds_GCJ \ module_expsym_cmds_GCJ \ lt_cv_prog_compiler_c_o_GCJ \ fix_srcfile_path_GCJ \ exclude_expsyms_GCJ \ include_expsyms_GCJ; do case $var in old_archive_cmds_GCJ | \ old_archive_from_new_cmds_GCJ | \ archive_cmds_GCJ | \ archive_expsym_cmds_GCJ | \ module_cmds_GCJ | \ module_expsym_cmds_GCJ | \ old_archive_from_expsyms_cmds_GCJ | \ export_symbols_cmds_GCJ | \ extract_expsyms_cmds | reload_cmds | finish_cmds | \ postinstall_cmds | postuninstall_cmds | \ old_postinstall_cmds | old_postuninstall_cmds | \ sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) # Double-quote double-evaled strings. eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" ;; *) eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" ;; esac done case $lt_echo in *'\$0 --fallback-echo"') lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` ;; esac cfgfile="$ofile" cat <<__EOF__ >> "$cfgfile" # ### BEGIN LIBTOOL TAG CONFIG: $tagname # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc_GCJ # Whether or not to disallow shared libs when runtime libs are static allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_GCJ # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # An echo program that does not interpret backslashes. echo=$lt_echo # The archiver. AR=$lt_AR AR_FLAGS=$lt_AR_FLAGS # A C compiler. LTCC=$lt_LTCC # LTCC compiler flags. LTCFLAGS=$lt_LTCFLAGS # A language-specific compiler. CC=$lt_compiler_GCJ # Is the compiler the GNU C compiler? with_gcc=$GCC_GCJ # An ERE matcher. EGREP=$lt_EGREP # The linker used to build libraries. LD=$lt_LD_GCJ # Whether we need hard or soft links. LN_S=$lt_LN_S # A BSD-compatible nm program. NM=$lt_NM # A symbol stripping program STRIP=$lt_STRIP # Used to examine libraries when file_magic_cmd begins "file" MAGIC_CMD=$MAGIC_CMD # Used on cygwin: DLL creation program. DLLTOOL="$DLLTOOL" # Used on cygwin: object dumper. OBJDUMP="$OBJDUMP" # Used on cygwin: assembler. AS="$AS" # The name of the directory that contains temporary libtool files. objdir=$objdir # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl_GCJ # Object file suffix (normally "o"). objext="$ac_objext" # Old archive suffix (normally "a"). libext="$libext" # Shared library suffix (normally ".so"). shrext_cmds='$shrext_cmds' # Executable file suffix (normally ""). exeext="$exeext" # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic_GCJ pic_mode=$pic_mode # What is the maximum length of a command? max_cmd_len=$lt_cv_sys_max_cmd_len # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o_GCJ # Must we lock files when doing compilation? need_locks=$lt_need_locks # 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 # 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 # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static_GCJ # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_GCJ # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_GCJ # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec_GCJ # Compiler flag to generate thread-safe objects. thread_safe_flag_spec=$lt_thread_safe_flag_spec_GCJ # Library versioning type. version_type=$version_type # 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 # Commands used to build and install an old-style archive. RANLIB=$lt_RANLIB old_archive_cmds=$lt_old_archive_cmds_GCJ old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_GCJ # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_GCJ # Commands used to build and install a shared archive. archive_cmds=$lt_archive_cmds_GCJ archive_expsym_cmds=$lt_archive_expsym_cmds_GCJ postinstall_cmds=$lt_postinstall_cmds postuninstall_cmds=$lt_postuninstall_cmds # Commands used to build a loadable module (assumed same as above if empty) module_cmds=$lt_module_cmds_GCJ module_expsym_cmds=$lt_module_expsym_cmds_GCJ # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # Dependencies to place before the objects being linked to create a # shared library. predep_objects=$lt_predep_objects_GCJ # Dependencies to place after the objects being linked to create a # shared library. postdep_objects=$lt_postdep_objects_GCJ # Dependencies to place before the objects being linked to create a # shared library. predeps=$lt_predeps_GCJ # Dependencies to place after the objects being linked to create a # shared library. postdeps=$lt_postdeps_GCJ # The directories searched by this compiler when creating a shared # library compiler_lib_search_dirs=$lt_compiler_lib_search_dirs_GCJ # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path_GCJ # 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 # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag_GCJ # Flag that forces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag_GCJ # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # Same as above, but a single script fragment to be evaled but not shown. finish_eval=$lt_finish_eval # 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 # This is the shared library runtime path variable. runpath_var=$runpath_var # This is the shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action_GCJ # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # 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_GCJ # If ld is used when linking, flag to hardcode \$libdir into # a binary during linking. This must work even if \$libdir does # not exist. hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_GCJ # Whether we need a single -rpath flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator_GCJ # Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the # resulting binary. hardcode_direct=$hardcode_direct_GCJ # Set to yes if using the -LDIR flag during linking hardcodes DIR into the # resulting binary. hardcode_minus_L=$hardcode_minus_L_GCJ # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into # the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var_GCJ # 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_GCJ # Variables whose values should be saved in libtool wrapper scripts and # restored at relink time. variables_saved_for_relink="$variables_saved_for_relink" # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs_GCJ # 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 # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path=$lt_fix_srcfile_path # Set to yes if exported symbols are required. always_export_symbols=$always_export_symbols_GCJ # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds_GCJ # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms_GCJ # Symbols that must always be exported. include_expsyms=$lt_include_expsyms_GCJ # ### END LIBTOOL TAG CONFIG: $tagname __EOF__ else # If there is no Makefile yet, we rely on a make rule to execute # `config.status --recheck' to rerun these tests and create the # libtool script then. ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` if test -f "$ltmain_in"; then test -f Makefile && make "$ltmain" fi 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" else tagname="" fi ;; RC) # Source file extension for RC test sources. ac_ext=rc # Object file extension for compiled RC test sources. objext=o objext_RC=$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. # 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 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* # Allow CC to be a program name with arguments. lt_save_CC="$CC" CC=${RC-"windres"} compiler=$CC compiler_RC=$CC for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` lt_cv_prog_compiler_c_o_RC=yes # The else clause should only fire when bootstrapping the # libtool distribution, otherwise you forgot to ship ltmain.sh # with your package, and you will get complaints that there are # no rules to generate ltmain.sh. if test -f "$ltmain"; then # 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 # Now quote all the things that may contain metacharacters while being # careful not to overquote the AC_SUBSTed values. We take copies of the # variables and quote the copies for generation of the libtool script. for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \ SED SHELL STRIP \ libname_spec library_names_spec soname_spec extract_expsyms_cmds \ old_striplib striplib file_magic_cmd finish_cmds finish_eval \ deplibs_check_method reload_flag reload_cmds need_locks \ lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ old_postinstall_cmds old_postuninstall_cmds \ compiler_RC \ CC_RC \ LD_RC \ lt_prog_compiler_wl_RC \ lt_prog_compiler_pic_RC \ lt_prog_compiler_static_RC \ lt_prog_compiler_no_builtin_flag_RC \ export_dynamic_flag_spec_RC \ thread_safe_flag_spec_RC \ whole_archive_flag_spec_RC \ enable_shared_with_static_runtimes_RC \ old_archive_cmds_RC \ old_archive_from_new_cmds_RC \ predep_objects_RC \ postdep_objects_RC \ predeps_RC \ postdeps_RC \ compiler_lib_search_path_RC \ compiler_lib_search_dirs_RC \ archive_cmds_RC \ archive_expsym_cmds_RC \ postinstall_cmds_RC \ postuninstall_cmds_RC \ old_archive_from_expsyms_cmds_RC \ allow_undefined_flag_RC \ no_undefined_flag_RC \ export_symbols_cmds_RC \ hardcode_libdir_flag_spec_RC \ hardcode_libdir_flag_spec_ld_RC \ hardcode_libdir_separator_RC \ hardcode_automatic_RC \ module_cmds_RC \ module_expsym_cmds_RC \ lt_cv_prog_compiler_c_o_RC \ fix_srcfile_path_RC \ exclude_expsyms_RC \ include_expsyms_RC; do case $var in old_archive_cmds_RC | \ old_archive_from_new_cmds_RC | \ archive_cmds_RC | \ archive_expsym_cmds_RC | \ module_cmds_RC | \ module_expsym_cmds_RC | \ old_archive_from_expsyms_cmds_RC | \ export_symbols_cmds_RC | \ extract_expsyms_cmds | reload_cmds | finish_cmds | \ postinstall_cmds | postuninstall_cmds | \ old_postinstall_cmds | old_postuninstall_cmds | \ sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) # Double-quote double-evaled strings. eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" ;; *) eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" ;; esac done case $lt_echo in *'\$0 --fallback-echo"') lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` ;; esac cfgfile="$ofile" cat <<__EOF__ >> "$cfgfile" # ### BEGIN LIBTOOL TAG CONFIG: $tagname # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc_RC # Whether or not to disallow shared libs when runtime libs are static allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_RC # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # An echo program that does not interpret backslashes. echo=$lt_echo # The archiver. AR=$lt_AR AR_FLAGS=$lt_AR_FLAGS # A C compiler. LTCC=$lt_LTCC # LTCC compiler flags. LTCFLAGS=$lt_LTCFLAGS # A language-specific compiler. CC=$lt_compiler_RC # Is the compiler the GNU C compiler? with_gcc=$GCC_RC # An ERE matcher. EGREP=$lt_EGREP # The linker used to build libraries. LD=$lt_LD_RC # Whether we need hard or soft links. LN_S=$lt_LN_S # A BSD-compatible nm program. NM=$lt_NM # A symbol stripping program STRIP=$lt_STRIP # Used to examine libraries when file_magic_cmd begins "file" MAGIC_CMD=$MAGIC_CMD # Used on cygwin: DLL creation program. DLLTOOL="$DLLTOOL" # Used on cygwin: object dumper. OBJDUMP="$OBJDUMP" # Used on cygwin: assembler. AS="$AS" # The name of the directory that contains temporary libtool files. objdir=$objdir # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl_RC # Object file suffix (normally "o"). objext="$ac_objext" # Old archive suffix (normally "a"). libext="$libext" # Shared library suffix (normally ".so"). shrext_cmds='$shrext_cmds' # Executable file suffix (normally ""). exeext="$exeext" # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic_RC pic_mode=$pic_mode # What is the maximum length of a command? max_cmd_len=$lt_cv_sys_max_cmd_len # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o_RC # Must we lock files when doing compilation? need_locks=$lt_need_locks # 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 # 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 # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static_RC # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_RC # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_RC # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec_RC # Compiler flag to generate thread-safe objects. thread_safe_flag_spec=$lt_thread_safe_flag_spec_RC # Library versioning type. version_type=$version_type # 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 # Commands used to build and install an old-style archive. RANLIB=$lt_RANLIB old_archive_cmds=$lt_old_archive_cmds_RC old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_RC # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_RC # Commands used to build and install a shared archive. archive_cmds=$lt_archive_cmds_RC archive_expsym_cmds=$lt_archive_expsym_cmds_RC postinstall_cmds=$lt_postinstall_cmds postuninstall_cmds=$lt_postuninstall_cmds # Commands used to build a loadable module (assumed same as above if empty) module_cmds=$lt_module_cmds_RC module_expsym_cmds=$lt_module_expsym_cmds_RC # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # Dependencies to place before the objects being linked to create a # shared library. predep_objects=$lt_predep_objects_RC # Dependencies to place after the objects being linked to create a # shared library. postdep_objects=$lt_postdep_objects_RC # Dependencies to place before the objects being linked to create a # shared library. predeps=$lt_predeps_RC # Dependencies to place after the objects being linked to create a # shared library. postdeps=$lt_postdeps_RC # The directories searched by this compiler when creating a shared # library compiler_lib_search_dirs=$lt_compiler_lib_search_dirs_RC # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path_RC # 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 # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag_RC # Flag that forces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag_RC # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # Same as above, but a single script fragment to be evaled but not shown. finish_eval=$lt_finish_eval # 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 # This is the shared library runtime path variable. runpath_var=$runpath_var # This is the shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action_RC # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # 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_RC # If ld is used when linking, flag to hardcode \$libdir into # a binary during linking. This must work even if \$libdir does # not exist. hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_RC # Whether we need a single -rpath flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator_RC # Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the # resulting binary. hardcode_direct=$hardcode_direct_RC # Set to yes if using the -LDIR flag during linking hardcodes DIR into the # resulting binary. hardcode_minus_L=$hardcode_minus_L_RC # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into # the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var_RC # 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_RC # Variables whose values should be saved in libtool wrapper scripts and # restored at relink time. variables_saved_for_relink="$variables_saved_for_relink" # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs_RC # 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 # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path=$lt_fix_srcfile_path # Set to yes if exported symbols are required. always_export_symbols=$always_export_symbols_RC # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds_RC # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms_RC # Symbols that must always be exported. include_expsyms=$lt_include_expsyms_RC # ### END LIBTOOL TAG CONFIG: $tagname __EOF__ else # If there is no Makefile yet, we rely on a make rule to execute # `config.status --recheck' to rerun these tests and create the # libtool script then. ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` if test -f "$ltmain_in"; then test -f Makefile && make "$ltmain" fi 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" ;; *) as_fn_error $? "Unsupported tag name: $tagname" "$LINENO" 5 ;; esac # Append the new tag name to the list of available tags. if test -n "$tagname" ; then available_tags="$available_tags $tagname" fi fi done IFS="$lt_save_ifs" # Now substitute the updated list of available tags. if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then mv "${ofile}T" "$ofile" chmod +x "$ofile" else rm -f "${ofile}T" as_fn_error $? "unable to update list of available tagged configurations." "$LINENO" 5 fi fi # This can be used to rebuild libtool when needed LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh" # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' # Prevent multiple expansion # Check whether --with-system-libtool was given. if test "${with_system_libtool+set}" = set; then : withval=$with_system_libtool; # Extract the first word of "libtool", so it can be a program name with args. set dummy libtool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_LIBTOOL+:} false; then : $as_echo_n "(cached) " >&6 else case $LIBTOOL in [\\/]* | ?:[\\/]*) ac_cv_path_LIBTOOL="$LIBTOOL" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_dummy="$PATH:/usr/local/bin" for as_dir in $as_dummy do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_LIBTOOL="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi LIBTOOL=$ac_cv_path_LIBTOOL if test -n "$LIBTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBTOOL" >&5 $as_echo "$LIBTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi else LIBTOOL="`pwd`/libtool" fi # Check whether --enable-strict-dependencies was given. if test "${enable_strict_dependencies+set}" = set; then : enableval=$enable_strict_dependencies; fi docdir='${datadir}/doc/freeradius' { $as_echo "$as_me:${as_lineno-$LINENO}: checking docdir" >&5 $as_echo_n "checking docdir... " >&6; } # Check whether --with-docdir was given. if test "${with_docdir+set}" = set; then : withval=$with_docdir; case "$withval" in no) docdir=no ;; yes) ;; [\\/$]* | ?:[\\/]* ) docdir="$withval" ;; *) as_fn_error $? "expected an absolute directory name for --with-docdir: $withval" "$LINENO" 5 ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $docdir" >&5 $as_echo "$docdir" >&6; } if test "x$docdir" = xno; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Documentation files will NOT be installed." >&5 $as_echo "$as_me: WARNING: Documentation files will NOT be installed." >&2;} fi logdir='${localstatedir}/log/radius' { $as_echo "$as_me:${as_lineno-$LINENO}: checking logdir" >&5 $as_echo_n "checking logdir... " >&6; } # Check whether --with-logdir was given. if test "${with_logdir+set}" = set; then : withval=$with_logdir; case "$withval" in no) as_fn_error $? "Need logdir" "$LINENO" 5 ;; yes) ;; [\\/$]* | ?:[\\/]* ) logdir="$withval" ;; *) as_fn_error $? "expected an absolute directory name for --with-logdir: $withval" "$LINENO" 5 ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $logdir" >&5 $as_echo "$logdir" >&6; } radacctdir='${logdir}/radacct' { $as_echo "$as_me:${as_lineno-$LINENO}: checking radacctdir" >&5 $as_echo_n "checking radacctdir... " >&6; } # Check whether --with-radacctdir was given. if test "${with_radacctdir+set}" = set; then : withval=$with_radacctdir; case "$withval" in no) as_fn_error $? "Need radacctdir" "$LINENO" 5 ;; yes) ;; [\\/$]* | ?:[\\/]* ) radacctdir="$withval" ;; *) as_fn_error $? "expected an absolute directory name for --with-radacctdir: $withval" "$LINENO" 5 ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $radacctdir" >&5 $as_echo "$radacctdir" >&6; } raddbdir='${sysconfdir}/raddb' { $as_echo "$as_me:${as_lineno-$LINENO}: checking raddbdir" >&5 $as_echo_n "checking raddbdir... " >&6; } # Check whether --with-raddbdir was given. if test "${with_raddbdir+set}" = set; then : withval=$with_raddbdir; case "$withval" in no) as_fn_error $? "Need raddbdir" "$LINENO" 5 ;; yes) ;; [\\/$]* | ?:[\\/]* ) raddbdir="$withval" ;; *) as_fn_error $? "expected an absolute directory name for --with-raddbdir: $withval" "$LINENO" 5 ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $raddbdir" >&5 $as_echo "$raddbdir" >&6; } ASCEND_BINARY=yes # Check whether --with-ascend-binary was given. if test "${with_ascend_binary+set}" = set; then : withval=$with_ascend_binary; case "$withval" in yes) ;; *) ASCEND_BINARY="" esac fi if test "X$ASCEND_BINARY" = "Xyes"; then $as_echo "#define ASCEND_BINARY /**/" >>confdefs.h fi WITH_THREADS=yes # Check whether --with-threads was given. if test "${with_threads+set}" = set; then : withval=$with_threads; case "$withval" in yes) ;; *) WITH_THREADS="" esac fi WITH_VMPS=yes # Check whether --with-vmps was given. if test "${with_vmps+set}" = set; then : withval=$with_vmps; case "$withval" in yes) ;; *) WITH_VMPS=no esac fi if test "x$WITH_VMPS" = "xyes"; then $as_echo "#define WITH_VMPS 1" >>confdefs.h fi WITH_DHCP=yes # Check whether --with-dhcp was given. if test "${with_dhcp+set}" = set; then : withval=$with_dhcp; case "$withval" in yes) ;; *) WITH_DHCP=no esac fi if test "x$WITH_DHCP" = "xyes"; then $as_echo "#define WITH_DHCP 1" >>confdefs.h fi WITH_POST_PROXY_AUTHORIZE= # Check whether --with-post-proxy-authorize was given. if test "${with_post_proxy_authorize+set}" = set; then : withval=$with_post_proxy_authorize; case "$withval" in yes) WITH_POST_PROXY_AUTHORIZE="" ;; *) ;; esac fi STATIC_MODULES= # Check whether --with-static_modules was given. if test "${with_static_modules+set}" = set; then : withval=$with_static_modules; for i in $withval; do STATIC_MODULES="$STATIC_MODULES -dlpreopen ../modules/rlm_$i/rlm_$i.la" done fi MODULES= # Check whether --with-modules was given. if test "${with_modules+set}" = set; then : withval=$with_modules; for i in $withval; do MODULES="$MODULES $i" done fi # Check whether --enable-developer was given. if test "${enable_developer+set}" = set; then : enableval=$enable_developer; case "$enableval" in no) developer=no ;; *) developer=yes esac fi if test -d $srcdir/.git; then if test "x$developer" != "xno"; then developer="yes" fi if test "x$GIT" = "xyes"; then RADIUSD_VERSION_COMMIT=`git log --pretty=format:'%h' -n 1` fi fi EXPERIMENTAL= # Check whether --with-experimental-modules was given. if test "${with_experimental_modules+set}" = set; then : withval=$with_experimental_modules; case "$withval" in yes) EXPERIMENTAL=yes ;; *) esac fi WITH_OPENSSL=yes # Check whether --with-openssl was given. if test "${with_openssl+set}" = set; then : withval=$with_openssl; case "$withval" in no) WITH_OPENSSL=no ;; *) WITH_OPENSSL=yes ;; esac fi OPENSSL_INCLUDE_DIR= # Check whether --with-openssl-includes was given. if test "${with_openssl_includes+set}" = set; then : withval=$with_openssl_includes; case "$withval" in *) OPENSSL_INCLUDE_DIR="$withval" ;; esac fi OPENSSL_LIB_DIR= # Check whether --with-openssl-libraries was given. if test "${with_openssl_libraries+set}" = set; then : withval=$with_openssl_libraries; case "$withval" in *) OPENSSL_LIB_DIR="$withval" ;; esac fi # Check whether --enable-openssl-version-check was given. if test "${enable_openssl_version_check+set}" = set; then : enableval=$enable_openssl_version_check; fi if test "x$enable_openssl_version_check" != "xno"; then $as_echo "#define ENABLE_OPENSSL_VERSION_CHECK 1" >>confdefs.h openssl_version_check_config="\ # # allow_vulnerable_openssl: Allow the server to start with # versions of OpenSSL known to have critical vulnerabilities. # # This check is based on the version number reported by libssl # and may not reflect patches applied to libssl by # distribution maintainers. # allow_vulnerable_openssl = no" else openssl_version_check_config= fi # Check whether --with-rlm-FOO-lib-dir was given. if test "${with_rlm_FOO_lib_dir+set}" = set; then : withval=$with_rlm_FOO_lib_dir; case "$withval" in *) ;; esac fi # Check whether --with-rlm-FOO-include-dir was given. if test "${with_rlm_FOO_include_dir+set}" = set; then : withval=$with_rlm_FOO_include_dir; case "$withval" in *) ;; esac fi WITH_UDPFROMTO=no # Check whether --with-udpfromto was given. if test "${with_udpfromto+set}" = set; then : withval=$with_udpfromto; case "$withval" in yes) WITH_UDPFROMTO=yes ;; *) WITH_UDPFROMTO=no esac fi if test "x$WITH_UDPFROMTO" = "xyes"; then $as_echo "#define WITH_UDPFROMTO /**/" >>confdefs.h fi CHECKRAD=checkrad.pl # Extract the first word of "perl", so it can be a program name with args. set dummy perl; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_PERL+:} false; then : $as_echo_n "(cached) " >&6 else case $PERL in [\\/]* | ?:[\\/]*) ac_cv_path_PERL="$PERL" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_PERL="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_PERL" && ac_cv_path_PERL="/usr/local/bin/perl" ;; esac fi PERL=$ac_cv_path_PERL if test -n "$PERL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PERL" >&5 $as_echo "$PERL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_cv_path_PERL" = "x"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: perl not found - Simultaneous-Use and checkrad.pl may not work" >&5 $as_echo "$as_me: WARNING: perl not found - Simultaneous-Use and checkrad.pl may not work" >&2;} fi # Extract the first word of "snmpget", so it can be a program name with args. set dummy snmpget; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_SNMPGET+:} false; then : $as_echo_n "(cached) " >&6 else case $SNMPGET in [\\/]* | ?:[\\/]*) ac_cv_path_SNMPGET="$SNMPGET" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_SNMPGET="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi SNMPGET=$ac_cv_path_SNMPGET if test -n "$SNMPGET"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SNMPGET" >&5 $as_echo "$SNMPGET" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_cv_path_SNMPGET" = "x"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: snmpget not found - Simultaneous-Use and checkrad.pl may not work" >&5 $as_echo "$as_me: WARNING: snmpget not found - Simultaneous-Use and checkrad.pl may not work" >&2;} fi # Extract the first word of "snmpwalk", so it can be a program name with args. set dummy snmpwalk; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_SNMPWALK+:} false; then : $as_echo_n "(cached) " >&6 else case $SNMPWALK in [\\/]* | ?:[\\/]*) ac_cv_path_SNMPWALK="$SNMPWALK" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_SNMPWALK="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi SNMPWALK=$ac_cv_path_SNMPWALK if test -n "$SNMPWALK"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SNMPWALK" >&5 $as_echo "$SNMPWALK" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_cv_path_SNMPWALK" = "x"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: snmpwalk not found - Simultaneous-Use and checkrad.pl may not work" >&5 $as_echo "$as_me: WARNING: snmpwalk not found - Simultaneous-Use and checkrad.pl may not work" >&2;} fi # Extract the first word of "rusers", so it can be a program name with args. set dummy rusers; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_RUSERS+:} false; then : $as_echo_n "(cached) " >&6 else case $RUSERS in [\\/]* | ?:[\\/]*) ac_cv_path_RUSERS="$RUSERS" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_RUSERS="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_RUSERS" && ac_cv_path_RUSERS="/usr/bin/rusers" ;; esac fi RUSERS=$ac_cv_path_RUSERS if test -n "$RUSERS"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RUSERS" >&5 $as_echo "$RUSERS" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi missing_dir=`cd $ac_aux_dir && pwd` # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`missing' script is too old or missing" >&5 $as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} fi ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal"} AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} # Extract the first word of "locate", so it can be a program name with args. set dummy locate; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_LOCATE+:} false; then : $as_echo_n "(cached) " >&6 else case $LOCATE in [\\/]* | ?:[\\/]*) ac_cv_path_LOCATE="$LOCATE" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_LOCATE="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi LOCATE=$ac_cv_path_LOCATE if test -n "$LOCATE"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LOCATE" >&5 $as_echo "$LOCATE" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Extract the first word of "dirname", so it can be a program name with args. set dummy dirname; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_DIRNAME+:} false; then : $as_echo_n "(cached) " >&6 else case $DIRNAME in [\\/]* | ?:[\\/]*) ac_cv_path_DIRNAME="$DIRNAME" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_DIRNAME="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi DIRNAME=$ac_cv_path_DIRNAME if test -n "$DIRNAME"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DIRNAME" >&5 $as_echo "$DIRNAME" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Extract the first word of "grep", so it can be a program name with args. set dummy grep; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_GREP+:} false; then : $as_echo_n "(cached) " >&6 else case $GREP in [\\/]* | ?:[\\/]*) ac_cv_path_GREP="$GREP" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_GREP="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi GREP=$ac_cv_path_GREP if test -n "$GREP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GREP" >&5 $as_echo "$GREP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi old_CFLAGS=$CFLAGS if test "x$WITH_THREADS" = "xyes"; then if test $ac_cv_prog_suncc = "yes"; then CFLAGS="$CFLAGS -mt" fi for ac_header in pthread.h do : ac_fn_c_check_header_mongrel "$LINENO" "pthread.h" "ac_cv_header_pthread_h" "$ac_includes_default" if test "x$ac_cv_header_pthread_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_PTHREAD_H 1 _ACEOF else WITH_THREADS="no" fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_create in -lpthread" >&5 $as_echo_n "checking for pthread_create in -lpthread... " >&6; } if ${ac_cv_lib_pthread_pthread_create+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpthread $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char pthread_create (); int main () { return pthread_create (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_pthread_pthread_create=yes else ac_cv_lib_pthread_pthread_create=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_create" >&5 $as_echo "$ac_cv_lib_pthread_pthread_create" >&6; } if test "x$ac_cv_lib_pthread_pthread_create" = xyes; then : CFLAGS="$CFLAGS -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS" LIBS="-lpthread $LIBS" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_create in -lc_r" >&5 $as_echo_n "checking for pthread_create in -lc_r... " >&6; } if ${ac_cv_lib_c_r_pthread_create+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lc_r $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char pthread_create (); int main () { return pthread_create (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_c_r_pthread_create=yes else ac_cv_lib_c_r_pthread_create=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_r_pthread_create" >&5 $as_echo "$ac_cv_lib_c_r_pthread_create" >&6; } if test "x$ac_cv_lib_c_r_pthread_create" = xyes; then : CFLAGS="$CFLAGS -pthread -D_THREAD_SAFE" else WITH_THREADS="no" fi fi fi if test "x$WITH_THREADS" != "xyes"; then CFLAGS=$old_CFLAGS ac_cv_header_pthread_h="no" WITH_THREADS=no else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing sem_init" >&5 $as_echo_n "checking for library containing sem_init... " >&6; } if ${ac_cv_search_sem_init+:} 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 sem_init (); int main () { return sem_init (); ; return 0; } _ACEOF for ac_lib in '' pthread sem posix4 rt semaphore; 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_sem_init=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext if ${ac_cv_search_sem_init+:} false; then : break fi done if ${ac_cv_search_sem_init+:} false; then : else ac_cv_search_sem_init=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_sem_init" >&5 $as_echo "$ac_cv_search_sem_init" >&6; } ac_res=$ac_cv_search_sem_init if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" else as_fn_error $? "-lsem not found. You may want to download it from ftp://ftp.to.gd-es.com/pub/BSDI/libsem.tar.bz2 or ftp://ftp.freeradius.org/pub/radius/contrib/libsem.tar.gz" "$LINENO" 5 fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for getsockname in -lsocket" >&5 $as_echo_n "checking for getsockname in -lsocket... " >&6; } if ${ac_cv_lib_socket_getsockname+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsocket $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char getsockname (); int main () { return getsockname (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_socket_getsockname=yes else ac_cv_lib_socket_getsockname=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_getsockname" >&5 $as_echo "$ac_cv_lib_socket_getsockname" >&6; } if test "x$ac_cv_lib_socket_getsockname" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBSOCKET 1 _ACEOF LIBS="-lsocket $LIBS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inet_aton in -lresolv" >&5 $as_echo_n "checking for inet_aton in -lresolv... " >&6; } if ${ac_cv_lib_resolv_inet_aton+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lresolv $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char inet_aton (); int main () { return inet_aton (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_resolv_inet_aton=yes else ac_cv_lib_resolv_inet_aton=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_resolv_inet_aton" >&5 $as_echo "$ac_cv_lib_resolv_inet_aton" >&6; } if test "x$ac_cv_lib_resolv_inet_aton" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBRESOLV 1 _ACEOF LIBS="-lresolv $LIBS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inet_ntoa in -lnsl" >&5 $as_echo_n "checking for inet_ntoa in -lnsl... " >&6; } if ${ac_cv_lib_nsl_inet_ntoa+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lnsl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char inet_ntoa (); int main () { return inet_ntoa (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_nsl_inet_ntoa=yes else ac_cv_lib_nsl_inet_ntoa=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_inet_ntoa" >&5 $as_echo "$ac_cv_lib_nsl_inet_ntoa" >&6; } if test "x$ac_cv_lib_nsl_inet_ntoa" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBNSL 1 _ACEOF LIBS="-lnsl $LIBS" fi OPENSSL_LIBS= if test "x$WITH_OPENSSL" = xyes; then old_LIBS=$LIBS old_LDFLAGS="$LDFLAGS" if test "x$OPENSSL_LIB_DIR" != "x"; then LDFLAGS="-L$OPENSSL_LIB_DIR $LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for DH_new in -lcrypto" >&5 $as_echo_n "checking for DH_new in -lcrypto... " >&6; } if ${ac_cv_lib_crypto_DH_new+:} 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 DH_new (); int main () { return DH_new (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_crypto_DH_new=yes else ac_cv_lib_crypto_DH_new=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_DH_new" >&5 $as_echo "$ac_cv_lib_crypto_DH_new" >&6; } if test "x$ac_cv_lib_crypto_DH_new" = xyes; then : LIBS="-lcrypto $LIBS" $as_echo "#define HAVE_LIBCRYPTO 1" >>confdefs.h { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SSL_new in -lssl" >&5 $as_echo_n "checking for SSL_new in -lssl... " >&6; } if ${ac_cv_lib_ssl_SSL_new+:} 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_new (); int main () { return SSL_new (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_ssl_SSL_new=yes else ac_cv_lib_ssl_SSL_new=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_new" >&5 $as_echo "$ac_cv_lib_ssl_SSL_new" >&6; } if test "x$ac_cv_lib_ssl_SSL_new" = xyes; then : $as_echo "#define HAVE_LIBSSL 1" >>confdefs.h if test "x$OPENSSL_LIB_DIR" != "x"; then OPENSSL_LIBS="-L$OPENSSL_LIB_DIR" fi OPENSSL_LIBS="$OPENSSL_LIBS -lcrypto -lssl -lcrypto" fi fi LIBS=$old_LIBS LDFLAGS="$old_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for htonl in -lws2_32" >&5 $as_echo_n "checking for htonl in -lws2_32... " >&6; } if ${ac_cv_lib_ws2_32_htonl+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lws2_32 $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 htonl (); int main () { return htonl (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_ws2_32_htonl=yes else ac_cv_lib_ws2_32_htonl=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_ws2_32_htonl" >&5 $as_echo "$ac_cv_lib_ws2_32_htonl" >&6; } if test "x$ac_cv_lib_ws2_32_htonl" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBWS2_32 1 _ACEOF LIBS="-lws2_32 $LIBS" fi PCAP_LIBS= { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pcap_open_live in -lpcap" >&5 $as_echo_n "checking for pcap_open_live in -lpcap... " >&6; } if ${ac_cv_lib_pcap_pcap_open_live+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpcap $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 pcap_open_live (); int main () { return pcap_open_live (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_pcap_pcap_open_live=yes else ac_cv_lib_pcap_pcap_open_live=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_pcap_pcap_open_live" >&5 $as_echo "$ac_cv_lib_pcap_pcap_open_live" >&6; } if test "x$ac_cv_lib_pcap_pcap_open_live" = xyes; then : PCAP_LIBS="-lpcap" $as_echo "#define HAVE_LIBPCAP 1" >>confdefs.h else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: pcap library not found, silently disabling the RADIUS sniffer." >&5 $as_echo "$as_me: WARNING: pcap library not found, silently disabling the RADIUS sniffer." >&2;} fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a readline compatible library" >&5 $as_echo_n "checking for a readline compatible library... " >&6; } if ${ac_cv_lib_readline+:} false; then : $as_echo_n "(cached) " >&6 else ORIG_LIBS=$LIBS for readline_lib in readline edit editline; do for termcap_lib in "" termcap curses ncurses; do if test -z "$termcap_lib"; then TRY_LIB="-l$readline_lib" else TRY_LIB="-l$readline_lib -l$termcap_lib" fi LIBS="$ORIG_LIBS $TRY_LIB" 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 readline (); int main () { return readline (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_readline="$TRY_LIB" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -n "$ac_cv_lib_readline"; then break fi done if test -n "$ac_cv_lib_readline"; then break fi done if test -z "$ac_cv_lib_readline"; then ac_cv_lib_readline="no" fi LIBS=$ORIG_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_readline" >&5 $as_echo "$ac_cv_lib_readline" >&6; } if test "$ac_cv_lib_readline" != "no"; then LIBREADLINE="$ac_cv_lib_readline" $as_echo "#define HAVE_LIBREADLINE 1" >>confdefs.h for ac_header in readline.h readline/readline.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether readline supports history" >&5 $as_echo_n "checking whether readline supports history... " >&6; } if ${ac_cv_lib_readline_history+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_lib_readline_history="no" 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 add_history (); int main () { return add_history (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_readline_history="yes" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_readline_history" >&5 $as_echo "$ac_cv_lib_readline_history" >&6; } if test "$ac_cv_lib_readline_history" = "yes"; then $as_echo "#define HAVE_READLINE_HISTORY 1" >>confdefs.h for ac_header in history.h readline/history.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done fi fi case "$host" in *-interix*) CFLAGS="$CFLAGS -D_ALL_SOURCE" ;; *-darwin*) CFLAGS="$CFLAGS -DDARWIN" LIBS="-framework DirectoryService $LIBS" $as_echo "#define __APPLE_USE_RFC_3542 1" >>confdefs.h ;; esac ac_header_dirent=no for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do as_ac_Header=`$as_echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh` { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_hdr that defines DIR" >&5 $as_echo_n "checking for $ac_hdr that defines DIR... " >&6; } if eval \${$as_ac_Header+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include <$ac_hdr> int main () { if ((DIR *) 0) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$as_ac_Header=yes" else eval "$as_ac_Header=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$as_ac_Header { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_hdr" | $as_tr_cpp` 1 _ACEOF ac_header_dirent=$ac_hdr; break fi done # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. if test $ac_header_dirent = dirent.h; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5 $as_echo_n "checking for library containing opendir... " >&6; } if ${ac_cv_search_opendir+:} 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 opendir (); int main () { return opendir (); ; return 0; } _ACEOF for ac_lib in '' dir; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO"; then : ac_cv_search_opendir=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext if ${ac_cv_search_opendir+:} false; then : break fi done if ${ac_cv_search_opendir+:} false; then : else ac_cv_search_opendir=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5 $as_echo "$ac_cv_search_opendir" >&6; } ac_res=$ac_cv_search_opendir if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5 $as_echo_n "checking for library containing opendir... " >&6; } if ${ac_cv_search_opendir+:} 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 opendir (); int main () { return opendir (); ; return 0; } _ACEOF for ac_lib in '' x; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO"; then : ac_cv_search_opendir=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext if ${ac_cv_search_opendir+:} false; then : break fi done if ${ac_cv_search_opendir+:} false; then : else ac_cv_search_opendir=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5 $as_echo "$ac_cv_search_opendir" >&6; } ac_res=$ac_cv_search_opendir if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if ${ac_cv_header_stdc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_stdc=yes else ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : : else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : else ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then $as_echo "#define STDC_HEADERS 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether time.h and sys/time.h may both be included" >&5 $as_echo_n "checking whether time.h and sys/time.h may both be included... " >&6; } if ${ac_cv_header_time+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include int main () { if ((struct tm *) 0) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_time=yes else ac_cv_header_time=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_time" >&5 $as_echo "$ac_cv_header_time" >&6; } if test $ac_cv_header_time = yes; then $as_echo "#define TIME_WITH_SYS_TIME 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sys/wait.h that is POSIX.1 compatible" >&5 $as_echo_n "checking for sys/wait.h that is POSIX.1 compatible... " >&6; } if ${ac_cv_header_sys_wait_h+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #ifndef WEXITSTATUS # define WEXITSTATUS(stat_val) ((unsigned int) (stat_val) >> 8) #endif #ifndef WIFEXITED # define WIFEXITED(stat_val) (((stat_val) & 255) == 0) #endif int main () { int s; wait (&s); s = WIFEXITED (s) ? WEXITSTATUS (s) : 1; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_sys_wait_h=yes else ac_cv_header_sys_wait_h=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_sys_wait_h" >&5 $as_echo "$ac_cv_header_sys_wait_h" >&6; } if test $ac_cv_header_sys_wait_h = yes; then $as_echo "#define HAVE_SYS_WAIT_H 1" >>confdefs.h fi for ac_header in \ unistd.h \ crypt.h \ errno.h \ execinfo.h \ resource.h \ sys/resource.h \ getopt.h \ malloc.h \ utmp.h \ utmpx.h \ signal.h \ sys/select.h \ syslog.h \ inttypes.h \ stdint.h \ stdio.h \ netdb.h \ semaphore.h \ arpa/inet.h \ netinet/in.h \ sys/types.h \ sys/socket.h \ winsock.h \ sys/time.h \ sys/wait.h \ sys/security.h \ fcntl.h \ sys/fcntl.h \ sys/prctl.h \ sys/un.h \ glob.h \ prot.h \ pwd.h \ grp.h \ stddef.h \ fnmatch.h \ sia.h \ siad.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in net/if.h do : ac_fn_c_check_header_compile "$LINENO" "net/if.h" "ac_cv_header_net_if_h" "#ifdef HAVE_SYS_SOCKET_H # include # endif " if test "x$ac_cv_header_net_if_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_NET_IF_H 1 _ACEOF fi done REGEX=no ac_fn_c_check_header_mongrel "$LINENO" "regex.h" "ac_cv_header_regex_h" "$ac_includes_default" if test "x$ac_cv_header_regex_h" = xyes; then : $as_echo "#define HAVE_REGEX_H /**/" >>confdefs.h fi if test "x$ac_cv_header_regex_h" = "xyes"; then REGEX_EXTENDED=no REGEX=yes cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #ifdef REG_EXTENDED yes #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "yes" >/dev/null 2>&1; then : $as_echo "#define HAVE_REG_EXTENDED /**/" >>confdefs.h REGEX_EXTENDED=yes fi rm -f conftest* fi if test "x$ac_cv_header_sys_security_h" = "xyes" && test "x$ac_cv_header_prot_h" = "xyes" then $as_echo "#define OSFC2 /**/" >>confdefs.h fi if test "x$ac_cv_header_sia_h" = "xyes" && test "x$ac_cv_header_siad_h" = "xyes" then $as_echo "#define OSFSIA /**/" >>confdefs.h fi if test "x$WITH_OPENSSL" = xyes; then old_LIBS=$LIBS old_LDFLAGS="$LDFLAGS" OPENSSL_INCLUDE="-DNO_OPENSSL" OPENSSL_LIBS= if test "x$OPENSSL_LIB_DIR" != "x"; then LDFLAGS="-L$OPENSSL_LIB_DIR $LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for DH_new in -lcrypto" >&5 $as_echo_n "checking for DH_new in -lcrypto... " >&6; } if ${ac_cv_lib_crypto_DH_new+:} 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 DH_new (); int main () { return DH_new (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_crypto_DH_new=yes else ac_cv_lib_crypto_DH_new=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_DH_new" >&5 $as_echo "$ac_cv_lib_crypto_DH_new" >&6; } if test "x$ac_cv_lib_crypto_DH_new" = xyes; then : LIBS="-lcrypto $LIBS" $as_echo "#define HAVE_LIBCRYPTO 1" >>confdefs.h { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SSL_new in -lssl" >&5 $as_echo_n "checking for SSL_new in -lssl... " >&6; } if ${ac_cv_lib_ssl_SSL_new+:} 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_new (); int main () { return SSL_new (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_ssl_SSL_new=yes else ac_cv_lib_ssl_SSL_new=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_new" >&5 $as_echo "$ac_cv_lib_ssl_SSL_new" >&6; } if test "x$ac_cv_lib_ssl_SSL_new" = xyes; then : $as_echo "#define HAVE_LIBSSL 1" >>confdefs.h if test "x$OPENSSL_LIB_DIR" != "x"; then OPENSSL_LIBS="-L$OPENSSL_LIB_DIR" fi OPENSSL_LIBS="$OPENSSL_LIBS -lcrypto -lssl -lcrypto" LIBS="$OPENSSL_LIBS $LIBS" 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 $? "failed linking to libssl See \`config.log' for more details" "$LINENO" 5; } fi fi old_CPPFLAGS=$CPPFLAGS old_CFLAGS=$CFLAGS if test "x$OPENSSL_INCLUDE_DIR" != "x"; then CPPFLAGS="-I$OPENSSL_INCLUDE_DIR $CPPFLAGS" CFLAGS="-I$OPENSSL_INCLUDE_DIR $CFLAGS" fi CPPFLAGS="$CPPFLAGS -DOPENSSL_NO_KRB5" for ac_header in \ openssl/ssl.h \ openssl/crypto.h \ openssl/err.h \ openssl/evp.h \ openssl/md5.h \ openssl/md4.h \ openssl/sha.h \ openssl/ocsp.h \ openssl/engine.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF 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 $? "failed locating OpenSSL headers See \`config.log' for more details" "$LINENO" 5; } fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for OpenSSL version >= 0.9.7" >&5 $as_echo_n "checking for OpenSSL version >= 0.9.7... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #if (OPENSSL_VERSION_NUMBER >= 0x00907000L) yes #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "yes" >/dev/null 2>&1; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "OpenSSL version too old See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest* if test "x$OPENSSL_INCLUDE_DIR" != "x"; then OPENSSL_INCLUDE="-I$OPENSSL_INCLUDE_DIR -DOPENSSL_NO_KRB5" else OPENSSL_INCLUDE="-DOPENSSL_NO_KRB5" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking OpenSSL library and header version consistency" >&5 $as_echo_n "checking OpenSSL library and header version consistency... " >&6; } if test "$cross_compiling" = yes; then : { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run test program while cross compiling See \`config.log' for more details" "$LINENO" 5; } else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include int main () { if (SSLeay() == OPENSSL_VERSION_NUMBER) { return 0; } else { printf("library: %lx header: %lx... ", (unsigned long) SSLeay(), (unsigned long) OPENSSL_VERSION_NUMBER); return 1; } ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "OpenSSL library version does not match header version See \`config.log' for more details" "$LINENO" 5; } 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 "x$OPENSSL_LIBS" = x; then LIBS=$old_LIBS LDFLAGS="$old_LDFLAGS" fi if test "x$OPENSSL_INCLUDE" = x; then CPPFLAGS=$old_CPPFLAGS CFLAGS=$old_CFLAGS fi fi export OPENSSL_LIBS if test "x$PCAP_LIBS" = x; then { $as_echo "$as_me:${as_lineno-$LINENO}: skipping test for pcap.h." >&5 $as_echo "$as_me: skipping test for pcap.h." >&6;} else ac_fn_c_check_header_mongrel "$LINENO" "pcap.h" "ac_cv_header_pcap_h" "$ac_includes_default" if test "x$ac_cv_header_pcap_h" = xyes; then : $as_echo "#define HAVE_PCAP_H 1" >>confdefs.h else PCAP_LIBS= { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: pcap.h not found, silently disabling the RADIUS sniffer." >&5 $as_echo "$as_me: WARNING: pcap.h not found, silently disabling the RADIUS sniffer." >&2;} fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pcap_fopen_offline in -lpcap" >&5 $as_echo_n "checking for pcap_fopen_offline in -lpcap... " >&6; } if ${ac_cv_lib_pcap_pcap_fopen_offline+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpcap $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 pcap_fopen_offline (); int main () { return pcap_fopen_offline (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_pcap_pcap_fopen_offline=yes else ac_cv_lib_pcap_pcap_fopen_offline=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_pcap_pcap_fopen_offline" >&5 $as_echo "$ac_cv_lib_pcap_pcap_fopen_offline" >&6; } if test "x$ac_cv_lib_pcap_pcap_fopen_offline" = xyes; then : $as_echo "#define HAVE_PCAP_FOPEN_OFFLINE 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pcap_dump_fopen in -lpcap" >&5 $as_echo_n "checking for pcap_dump_fopen in -lpcap... " >&6; } if ${ac_cv_lib_pcap_pcap_dump_fopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpcap $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 pcap_dump_fopen (); int main () { return pcap_dump_fopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_pcap_pcap_dump_fopen=yes else ac_cv_lib_pcap_pcap_dump_fopen=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_pcap_pcap_dump_fopen" >&5 $as_echo "$ac_cv_lib_pcap_pcap_dump_fopen" >&6; } if test "x$ac_cv_lib_pcap_pcap_dump_fopen" = xyes; then : $as_echo "#define HAVE_PCAP_DUMP_FOPEN 1" >>confdefs.h fi fi ac_fn_c_check_type "$LINENO" "off_t" "ac_cv_type_off_t" "$ac_includes_default" if test "x$ac_cv_type_off_t" = xyes; then : else cat >>confdefs.h <<_ACEOF #define off_t long int _ACEOF fi ac_fn_c_check_type "$LINENO" "pid_t" "ac_cv_type_pid_t" "$ac_includes_default" if test "x$ac_cv_type_pid_t" = xyes; then : else cat >>confdefs.h <<_ACEOF #define pid_t int _ACEOF fi ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" if test "x$ac_cv_type_size_t" = xyes; then : else cat >>confdefs.h <<_ACEOF #define size_t unsigned int _ACEOF fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for uid_t in sys/types.h" >&5 $as_echo_n "checking for uid_t in sys/types.h... " >&6; } if ${ac_cv_type_uid_t+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "uid_t" >/dev/null 2>&1; then : ac_cv_type_uid_t=yes else ac_cv_type_uid_t=no fi rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_uid_t" >&5 $as_echo "$ac_cv_type_uid_t" >&6; } if test $ac_cv_type_uid_t = no; then $as_echo "#define uid_t int" >>confdefs.h $as_echo "#define gid_t int" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for socklen_t" >&5 $as_echo_n "checking for socklen_t... " >&6; } if ${ac_cv_type_socklen_t+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_type_socklen_t=no cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef HAVE_SYS_TYPES_H #include #endif #ifdef HAVE_SYS_SOCKET_H #include #endif int main () { socklen_t foo ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_type_socklen_t=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_socklen_t" >&5 $as_echo "$ac_cv_type_socklen_t" >&6; } if test "$ac_cv_type_socklen_t" != "yes"; then $as_echo "#define socklen_t int" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for uint8_t" >&5 $as_echo_n "checking for uint8_t... " >&6; } if ${ac_cv_type_uint8_t+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_type_uint8_t=no cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef HAVE_INTTYPES_H #include #endif #ifdef HAVE_STDINT_H #include #endif int main () { uint8_t foo ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_type_uint8_t=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_uint8_t" >&5 $as_echo "$ac_cv_type_uint8_t" >&6; } if test "$ac_cv_type_uint8_t" != "yes"; then $as_echo "#define uint8_t unsigned char" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for uint16_t" >&5 $as_echo_n "checking for uint16_t... " >&6; } if ${ac_cv_type_uint16_t+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_type_uint16_t=no cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef HAVE_INTTYPES_H #include #endif #ifdef HAVE_STDINT_H #include #endif int main () { uint16_t foo ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_type_uint16_t=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_uint16_t" >&5 $as_echo "$ac_cv_type_uint16_t" >&6; } if test "$ac_cv_type_uint16_t" != "yes"; then $as_echo "#define uint16_t unsigned short" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for uint32_t" >&5 $as_echo_n "checking for uint32_t... " >&6; } if ${ac_cv_type_uint32_t+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_type_uint32_t=no cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef HAVE_INTTYPES_H #include #endif #ifdef HAVE_STDINT_H #include #endif int main () { uint32_t foo ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_type_uint32_t=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_uint32_t" >&5 $as_echo "$ac_cv_type_uint32_t" >&6; } if test "$ac_cv_type_uint32_t" != "yes"; then $as_echo "#define uint32_t unsigned int" >>confdefs.h fi ac_fn_c_check_type "$LINENO" "sig_t" "ac_cv_type_sig_t" " #ifdef HAVE_SIGNAL_H # include #endif " if test "x$ac_cv_type_sig_t" = xyes; then : $as_echo "#define HAVE_SIG_T 1" >>confdefs.h fi ac_fn_c_check_type "$LINENO" "struct in6_addr" "ac_cv_type_struct_in6_addr" " #ifdef HAVE_NETINET_IN_H #include #endif " if test "x$ac_cv_type_struct_in6_addr" = xyes; then : $as_echo "#define HAVE_STRUCT_IN6_ADDR 1" >>confdefs.h fi ac_fn_c_check_type "$LINENO" "struct sockaddr_storage" "ac_cv_type_struct_sockaddr_storage" " #ifdef HAVE_NETINET_IN_H #include #endif #ifdef HAVE_SYS_SOCKET_H #include #endif " if test "x$ac_cv_type_struct_sockaddr_storage" = xyes; then : $as_echo "#define HAVE_STRUCT_SOCKADDR_STORAGE 1" >>confdefs.h fi ac_fn_c_check_type "$LINENO" "struct sockaddr_in6" "ac_cv_type_struct_sockaddr_in6" " #ifdef HAVE_NETINET_IN_H #include #endif " if test "x$ac_cv_type_struct_sockaddr_in6" = xyes; then : $as_echo "#define HAVE_STRUCT_SOCKADDR_IN6 1" >>confdefs.h fi ac_fn_c_check_type "$LINENO" "struct addrinfo" "ac_cv_type_struct_addrinfo" " #ifdef HAVE_SYS_TYPES_H #include #endif #ifdef HAVE_SYS_SOCKET_H #include #endif #ifdef HAVE_NETDB_H #include #endif " if test "x$ac_cv_type_struct_addrinfo" = xyes; then : $as_echo "#define HAVE_STRUCT_ADDRINFO 1" >>confdefs.h fi for ac_func in \ getopt_long \ lockf \ strsignal \ sigaction \ sigprocmask \ pthread_sigmask \ snprintf \ vsnprintf \ setsid \ strncasecmp \ strcasecmp \ localtime_r \ ctime_r \ gmtime_r \ strsep \ inet_aton \ inet_pton \ inet_ntop \ setlinebuf \ setvbuf \ getusershell \ initgroups \ getaddrinfo \ getnameinfo \ closefrom \ gettimeofday \ getpeereid \ setuid \ setresuid \ getresuid \ 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 fi done for ac_func in \ crypt \ strncasecmp \ strcasecmp \ inet_aton \ setlinebuf \ getusershell \ endusershell do { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $ac_func must be declared" >&5 $as_echo_n "checking whether $ac_func must be declared... " >&6; } if eval \${radius_cv_decl_needed_$ac_func+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #ifdef HAVE_UNISTD_H #include #endif #ifdef HAVE_CRYPT_H #include #endif #ifdef HAVE_ERRNO_H #include #endif #ifdef HAVE_RESOURCE_H #include #endif #ifdef HAVE_GETOPT_H #include #endif #ifdef HAVE_MALLOC_H #include #endif #ifdef HAVE_UTMP_H #include #endif #ifdef HAVE_UTMPX_H #include #endif #ifdef HAVE_SYS_SELECT_H #include #endif #ifdef HAVE_DLFCN_H #include #endif #ifdef HAVE_REGEX_H #include #endif #ifdef HAVE_SYSLOG_H #include #endif #ifdef HAVE_INTTYPES_H #include #endif #ifdef HAVE_STDINT_H #include #endif #ifdef HAVE_ARPA_INET_H #include #endif int main () { char *(*pfn) = (char *(*)) $ac_func ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "radius_cv_decl_needed_$ac_func=no" else eval "radius_cv_decl_needed_$ac_func=yes" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if eval "test \"`echo '$radius_cv_decl_needed_'$ac_func`\" = yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } radius_tr_decl=NEED_DECLARATION_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` cat >>confdefs.h <<_ACEOF #define $radius_tr_decl 1 _ACEOF else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking return type of signal handlers" >&5 $as_echo_n "checking return type of signal handlers... " >&6; } if ${ac_cv_type_signal+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { return *(signal (0, 0)) (0) == 1; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_type_signal=int else ac_cv_type_signal=void fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_signal" >&5 $as_echo "$ac_cv_type_signal" >&6; } cat >>confdefs.h <<_ACEOF #define RETSIGTYPE $ac_cv_type_signal _ACEOF if test "x$ac_cv_header_utmpx_h" = "xyes" then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ut_xtime in struct utmpx" >&5 $as_echo_n "checking for ut_xtime in struct utmpx... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #ifdef HAVE_STDDEF_H #include #endif #ifndef offsetof #define offsetof(TYPE, MEMBER) ((int) &((TYPE *)0)->MEMBER) #endif int main () { int foo = offsetof(struct utmpx, ut_xtime) ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : has_element=" " else has_element= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_safe_type=`echo "struct utmpx" | sed 'y% %_%'` if test "x$has_element" != "x"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } eval "ac_cv_type_${ac_safe_type}_has_ut_xtime=yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } eval "ac_cv_type_${ac_safe_type}_has_ut_xtime=" fi if test "x$ac_cv_type_struct_utmpx_has_ut_xtime" = "x" then $as_echo "#define ut_xtime ut_tv.tv_sec" >>confdefs.h fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ipi_addr in struct in_pktinfo" >&5 $as_echo_n "checking for ipi_addr in struct in_pktinfo... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #ifdef HAVE_STDDEF_H #include #endif #ifndef offsetof #define offsetof(TYPE, MEMBER) ((int) &((TYPE *)0)->MEMBER) #endif int main () { int foo = offsetof(struct in_pktinfo, ipi_addr) ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : has_element=" " else has_element= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_safe_type=`echo "struct in_pktinfo" | sed 'y% %_%'` if test "x$has_element" != "x"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } eval "ac_cv_type_${ac_safe_type}_has_ipi_addr=yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } eval "ac_cv_type_${ac_safe_type}_has_ipi_addr=" fi if test "x$ac_cv_type_struct_in_pktinfo_has_ipi_addr" = "xyes" then $as_echo "#define HAVE_IP_PKTINFO /**/" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ipi6_addr in struct in6_pktinfo" >&5 $as_echo_n "checking for ipi6_addr in struct in6_pktinfo... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #ifdef HAVE_STDDEF_H #include #endif #ifndef offsetof #define offsetof(TYPE, MEMBER) ((int) &((TYPE *)0)->MEMBER) #endif int main () { int foo = offsetof(struct in6_pktinfo, ipi6_addr) ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : has_element=" " else has_element= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_safe_type=`echo "struct in6_pktinfo" | sed 'y% %_%'` if test "x$has_element" != "x"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } eval "ac_cv_type_${ac_safe_type}_has_ipi6_addr=yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } eval "ac_cv_type_${ac_safe_type}_has_ipi6_addr=" fi if test "x$ac_cv_type_struct_in6_pktinfo_has_ipi6_addr" = "xyes" then $as_echo "#define HAVE_IN6_PKTINFO /**/" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5 $as_echo_n "checking for an ANSI C-conforming const... " >&6; } if ${ac_cv_c_const+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __cplusplus /* Ultrix mips cc rejects this sort of thing. */ typedef int charset[2]; const charset cs = { 0, 0 }; /* SunOS 4.1.1 cc rejects this. */ char const *const *pcpcc; char **ppc; /* NEC SVR4.0.2 mips cc rejects this. */ struct point {int x, y;}; static struct point const zero = {0,0}; /* AIX XL C 1.02.0.0 rejects this. It does not let you subtract one const X* pointer from another in an arm of an if-expression whose if-part is not a constant expression */ const char *g = "string"; pcpcc = &g + (g ? g-g : 0); /* HPUX 7.0 cc rejects these. */ ++pcpcc; ppc = (char**) pcpcc; pcpcc = (char const *const *) ppc; { /* SCO 3.2v4 cc rejects this sort of thing. */ char tx; char *t = &tx; char const *s = 0 ? (char *) 0 : (char const *) 0; *t++ = 0; if (s) return 0; } { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ int x[] = {25, 17}; const int *foo = &x[0]; ++foo; } { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ typedef const int *iptr; iptr p = 0; ++p; } { /* AIX XL C 1.02.0.0 rejects this sort of thing, saying "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ struct s { int j; const int *ap[3]; } bx; struct s *b = &bx; b->j = 5; } { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ const int foo = 10; if (!foo) return 0; } return !cs[0] && !zero.x; #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_c_const=yes else ac_cv_c_const=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5 $as_echo "$ac_cv_c_const" >&6; } if test $ac_cv_c_const = no; then $as_echo "#define const /**/" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking type of OS" >&5 $as_echo_n "checking type of OS... " >&6; } OS=`uname -s` { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OS" >&5 $as_echo "$OS" >&6; } if test "$OS" = "OS/2"; then LIBPREFIX= else LIBPREFIX=lib fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for developer gcc flags" >&5 $as_echo_n "checking for developer gcc flags... " >&6; } if test "x$developer" = "xyes" -a "x$GCC" = "xyes"; then devflags="-g -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -W -Wredundant-decls -Wundef" CFLAGS="$CFLAGS $devflags" INSTALLSTRIP="" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes. Using $devflags" >&5 $as_echo "yes. Using $devflags" >&6; } else devflags="" CFLAGS="$CFLAGS -DNDEBUG" INSTALLSTRIP="" { $as_echo "$as_me:${as_lineno-$LINENO}: result: no." >&5 $as_echo "no." >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for TLS" >&5 $as_echo_n "checking for TLS... " >&6; } if test "$cross_compiling" = yes; then : have_tls=no else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ static __thread int val; int main(int argc, char *argv[]) { return val = argc; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : have_tls=yes else have_tls=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_tls" >&5 $as_echo "$have_tls" >&6; } if test "$have_tls" = "yes"; then $as_echo "#define HAVE_THREAD_TLS 1" >>confdefs.h fi old_LIBS="$LIBS" LIBS="$LIBS $LIBLTDL" ac_fn_c_check_func "$LINENO" "lt_dladvise_init" "ac_cv_func_lt_dladvise_init" if test "x$ac_cv_func_lt_dladvise_init" = xyes; then : $as_echo "#define HAVE_LT_DLADVISE_INIT /**/" >>confdefs.h fi LIBS="$old_LIBS" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for crypt in -lcrypt" >&5 $as_echo_n "checking for crypt in -lcrypt... " >&6; } if ${ac_cv_lib_crypt_crypt+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypt $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 if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_crypt_crypt=yes else ac_cv_lib_crypt_crypt=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_crypt_crypt" >&5 $as_echo "$ac_cv_lib_crypt_crypt" >&6; } if test "x$ac_cv_lib_crypt_crypt" = xyes; then : CRYPTLIB="-lcrypt" fi if test "$CRYPTLIB" != ""; then $as_echo "#define HAVE_CRYPT /**/" >>confdefs.h else ac_fn_c_check_func "$LINENO" "crypt" "ac_cv_func_crypt" if test "x$ac_cv_func_crypt" = xyes; then : $as_echo "#define HAVE_CRYPT /**/" >>confdefs.h fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for setkey in -lcipher" >&5 $as_echo_n "checking for setkey in -lcipher... " >&6; } if ${ac_cv_lib_cipher_setkey+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcipher $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 setkey (); int main () { return setkey (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cipher_setkey=yes else ac_cv_lib_cipher_setkey=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_cipher_setkey" >&5 $as_echo "$ac_cv_lib_cipher_setkey" >&6; } if test "x$ac_cv_lib_cipher_setkey" = xyes; then : CRYPTLIB="${CRYPTLIB} -lcipher" fi $as_echo "#define GNUSTYLE 1" >>confdefs.h $as_echo "#define SYSVSTYLE 2" >>confdefs.h $as_echo "#define BSDSTYLE 3" >>confdefs.h gethostbyaddrrstyle="" { $as_echo "$as_me:${as_lineno-$LINENO}: checking gethostbyaddr_r() syntax" >&5 $as_echo_n "checking gethostbyaddr_r() syntax... " >&6; } case "$host" in *-freebsd*) ac_fn_c_check_decl "$LINENO" "gethostbyaddr_r" "ac_cv_have_decl_gethostbyaddr_r" " #ifdef HAVE_NETDB_H #include #endif " if test "x$ac_cv_have_decl_gethostbyaddr_r" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF #define HAVE_DECL_GETHOSTBYADDR_R $ac_have_decl _ACEOF if test $ac_have_decl = 1; then : else $as_echo "#define GETHOSTBYADDRRSTYLE BSDSTYLE" >>confdefs.h gethostbyaddrrstyle=BSD { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: FreeBSD overridden to BSD-style" >&5 $as_echo "$as_me: WARNING: FreeBSD overridden to BSD-style" >&2;} fi ;; esac if test "x$gethostbyaddrrstyle" = "x"; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { gethostbyaddr_r(NULL, 0, 0, NULL, NULL, 0, NULL, NULL) ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : $as_echo "#define GETHOSTBYADDRRSTYLE GNUSTYLE" >>confdefs.h gethostbyaddrrstyle=GNU fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi if test "x$gethostbyaddrrstyle" = "x"; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { gethostbyaddr_r(NULL, 0, 0, NULL, NULL, 0, NULL) ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : $as_echo "#define GETHOSTBYADDRRSTYLE SYSVSTYLE" >>confdefs.h gethostbyaddrrstyle=SYSV fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi if test "x$gethostbyaddrrstyle" = "x"; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { gethostbyaddr(NULL, 0, 0) ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : $as_echo "#define GETHOSTBYADDRRSTYLE BSDSTYLE" >>confdefs.h gethostbyaddrrstyle=BSD fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi if test "x$gethostbyaddrrstyle" = "x"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: none! It must not exist, here." >&5 $as_echo "none! It must not exist, here." >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${gethostbyaddrrstyle}-style" >&5 $as_echo "${gethostbyaddrrstyle}-style" >&6; } fi if test "x$gethostbyaddrrstyle" = "xBSD"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ****** BSD-style gethostbyaddr might NOT be thread-safe! ****** " >&5 $as_echo "$as_me: WARNING: ****** BSD-style gethostbyaddr might NOT be thread-safe! ****** " >&2;} fi gethostbynamerstyle="" { $as_echo "$as_me:${as_lineno-$LINENO}: checking gethostbyname_r() syntax" >&5 $as_echo_n "checking gethostbyname_r() syntax... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { gethostbyname_r(NULL, NULL, NULL, 0, NULL, NULL) ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : $as_echo "#define GETHOSTBYNAMERSTYLE GNUSTYLE" >>confdefs.h gethostbynamerstyle=GNU fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test "x$gethostbynamerstyle" = "x"; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { gethostbyname_r(NULL, NULL, NULL, 0, NULL) ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : $as_echo "#define GETHOSTBYNAMERSTYLE SYSVSTYLE" >>confdefs.h gethostbynamerstyle=SYSV fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi if test "x$gethostbynamerstyle" = "x"; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { gethostbyname(NULL) ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : $as_echo "#define GETHOSTBYNAMERSTYLE BSDSTYLE" >>confdefs.h gethostbynamerstyle=BSD fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi if test "x$gethostbynamerstyle" = "x"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: none! It must not exist, here." >&5 $as_echo "none! It must not exist, here." >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${gethostbynamerstyle}-style" >&5 $as_echo "${gethostbynamerstyle}-style" >&6; } fi if test "x$gethostbynamerstyle" = "xBSD"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ****** BSD-style gethostbyname might NOT be thread-safe! ****** " >&5 $as_echo "$as_me: WARNING: ****** BSD-style gethostbyname might NOT be thread-safe! ****** " >&2;} fi $as_echo "#define POSIXSTYLE 1" >>confdefs.h $as_echo "#define SOLARISSTYLE 2" >>confdefs.h ctimerstyle="" { $as_echo "$as_me:${as_lineno-$LINENO}: checking ctime_r() syntax" >&5 $as_echo_n "checking ctime_r() syntax... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { ctime_r(NULL, NULL, 0) ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : $as_echo "#define CTIMERSTYLE SOLARISSTYLE" >>confdefs.h ctimerstyle="SOLARIS" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test "x$ctimerstyle" = "x"; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { ctime_r(NULL, NULL) ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : $as_echo "#define CTIMERSTYLE POSIXSTYLE" >>confdefs.h ctimerstyle="POSIX" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi if test "x$ctimerstyle" = "x"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: none! It must not exist, here." >&5 $as_echo "none! It must not exist, here." >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${ctimerstyle}-style" >&5 $as_echo "${ctimerstyle}-style" >&6; } fi HOSTINFO=$host if test "x$WITH_POST_PROXY_AUTHORIZE" != "x"; then $as_echo "#define WITH_POST_PROXY_AUTHORIZE 1" >>confdefs.h fi top_builddir=`pwd` export top_builddir { $as_echo "$as_me:${as_lineno-$LINENO}: result: top_builddir=$top_builddir" >&5 $as_echo "top_builddir=$top_builddir" >&6; } mysubdirs="$LIBLTDLPATH" if test "x$EXPERIMENTAL" = "xyes"; then bar=`ls -1 "${srcdir}"/src/modules/rlm_*/configure | sed 's%/configure%%'` mysubdirs=`echo $mysubdirs $bar` else for bar in `cat "${srcdir}"/src/modules/stable`; do if test -f "${srcdir}"/src/modules/$bar/configure; then mysubdirs="$mysubdirs src/modules/$bar" fi done fi if test "x$EXPERIMENTAL" = "xyes"; then for foo in `ls -1 "${srcdir}"/src/modules | grep rlm_`; do MODULES="$MODULES $foo" done else for foo in `cat "${srcdir}"/src/modules/stable`; do MODULES="$MODULES $foo" done fi subdirs="$subdirs $LTDL_SUBDIRS $mysubdirs" ac_config_commands="$ac_config_commands stamp-h" ac_config_commands="$ac_config_commands build-radpaths-h" ac_config_commands="$ac_config_commands main-chmod" ac_config_commands="$ac_config_commands scripts-chmod" USE_SHARED_LIBS=$enable_shared USE_STATIC_LIBS=$enable_static unset ac_cv_env_LIBS_set unset ac_cv_env_LIBS_value ac_config_files="$ac_config_files ./Make.inc ./src/include/build-radpaths-h ./src/main/Makefile ./src/main/checkrad.pl ./src/main/radlast ./src/main/radtest ./scripts/rc.radiusd ./scripts/radwatch ./scripts/radiusd.cron.daily ./scripts/radiusd.cron.monthly ./scripts/cryptpasswd ./raddb/dictionary ./raddb/radrelay.conf ./raddb/radiusd.conf" 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 : "${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 $as_me, 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 the package provider." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ config.status configured by $0, generated by GNU Autoconf 2.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' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=?*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; --*=) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg= ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) $as_echo "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) $as_echo "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append CONFIG_HEADERS " '$ac_optarg'" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header as_fn_error $? "ambiguous option: \`$1' Try \`$0 --help' for more information.";; --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX $as_echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "src/include/autoconf.h") CONFIG_HEADERS="$CONFIG_HEADERS src/include/autoconf.h" ;; "stamp-h") CONFIG_COMMANDS="$CONFIG_COMMANDS stamp-h" ;; "build-radpaths-h") CONFIG_COMMANDS="$CONFIG_COMMANDS build-radpaths-h" ;; "main-chmod") CONFIG_COMMANDS="$CONFIG_COMMANDS main-chmod" ;; "scripts-chmod") CONFIG_COMMANDS="$CONFIG_COMMANDS scripts-chmod" ;; "./Make.inc") CONFIG_FILES="$CONFIG_FILES ./Make.inc" ;; "./src/include/build-radpaths-h") CONFIG_FILES="$CONFIG_FILES ./src/include/build-radpaths-h" ;; "./src/main/Makefile") CONFIG_FILES="$CONFIG_FILES ./src/main/Makefile" ;; "./src/main/checkrad.pl") CONFIG_FILES="$CONFIG_FILES ./src/main/checkrad.pl" ;; "./src/main/radlast") CONFIG_FILES="$CONFIG_FILES ./src/main/radlast" ;; "./src/main/radtest") CONFIG_FILES="$CONFIG_FILES ./src/main/radtest" ;; "./scripts/rc.radiusd") CONFIG_FILES="$CONFIG_FILES ./scripts/rc.radiusd" ;; "./scripts/radwatch") CONFIG_FILES="$CONFIG_FILES ./scripts/radwatch" ;; "./scripts/radiusd.cron.daily") CONFIG_FILES="$CONFIG_FILES ./scripts/radiusd.cron.daily" ;; "./scripts/radiusd.cron.monthly") CONFIG_FILES="$CONFIG_FILES ./scripts/radiusd.cron.monthly" ;; "./scripts/cryptpasswd") CONFIG_FILES="$CONFIG_FILES ./scripts/cryptpasswd" ;; "./raddb/dictionary") CONFIG_FILES="$CONFIG_FILES ./raddb/dictionary" ;; "./raddb/radrelay.conf") CONFIG_FILES="$CONFIG_FILES ./raddb/radrelay.conf" ;; "./raddb/radiusd.conf") CONFIG_FILES="$CONFIG_FILES ./raddb/radiusd.conf" ;; *) 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 # _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 $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 ;; :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 "stamp-h":C) echo timestamp > src/include/stamp-h ;; "build-radpaths-h":C) (cd ./src/include && /bin/sh ./build-radpaths-h) ;; "main-chmod":C) (cd ./src/main && chmod +x checkrad.pl radlast radtest) ;; "scripts-chmod":C) (cd ./scripts && chmod +x rc.radiusd radwatch radiusd.cron.daily radiusd.cron.monthly cryptpasswd) ;; 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 # # CONFIG_SUBDIRS section. # if test "$no_recursion" != yes; then # Remove --cache-file, --srcdir, and --disable-option-checking arguments # so they do not pile up. ac_sub_configure_args= ac_prev= eval "set x $ac_configure_args" shift for ac_arg do if test -n "$ac_prev"; then ac_prev= continue fi case $ac_arg in -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=*) ;; --config-cache | -C) ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) ;; --disable-option-checking) ;; *) case $ac_arg in *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append ac_sub_configure_args " '$ac_arg'" ;; esac done # Always prepend --prefix to ensure using the same prefix # in subdir configurations. ac_arg="--prefix=$prefix" case $ac_arg in *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac ac_sub_configure_args="'$ac_arg' $ac_sub_configure_args" # Pass --silent if test "$silent" = yes; then ac_sub_configure_args="--silent $ac_sub_configure_args" fi # Always prepend --disable-option-checking to silence warnings, since # different subdirs can have different --enable and --with options. ac_sub_configure_args="--disable-option-checking $ac_sub_configure_args" ac_popdir=`pwd` for ac_dir in : $subdirs; do test "x$ac_dir" = x: && continue # Do not complain, so a configure script can configure whichever # parts of a large source tree are present. test -d "$srcdir/$ac_dir" || continue ac_msg="=== configuring in $ac_dir (`pwd`/$ac_dir)" $as_echo "$as_me:${as_lineno-$LINENO}: $ac_msg" >&5 $as_echo "$ac_msg" >&6 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 cd "$ac_dir" # Check for guested configure; otherwise get Cygnus style configure. if test -f "$ac_srcdir/configure.gnu"; then ac_sub_configure=$ac_srcdir/configure.gnu elif test -f "$ac_srcdir/configure"; then ac_sub_configure=$ac_srcdir/configure elif test -f "$ac_srcdir/configure.in"; then # This should be Cygnus configure. ac_sub_configure=$ac_aux_dir/configure else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: no configuration information is in $ac_dir" >&5 $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2;} ac_sub_configure= fi # The recursion is here. if test -n "$ac_sub_configure"; then # Make the cache file name correct relative to the subdirectory. case $cache_file in [\\/]* | ?:[\\/]* ) ac_sub_cache_file=$cache_file ;; *) # Relative name. ac_sub_cache_file=$ac_top_build_prefix$cache_file ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: running $SHELL $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_srcdir" >&5 $as_echo "$as_me: running $SHELL $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_srcdir" >&6;} # The eval makes quoting arguments work. eval "\$SHELL \"\$ac_sub_configure\" $ac_sub_configure_args \ --cache-file=\"\$ac_sub_cache_file\" --srcdir=\"\$ac_srcdir\"" || as_fn_error $? "$ac_sub_configure failed for $ac_dir" "$LINENO" 5 fi cd "$ac_popdir" done 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 freeradius-server/configure.in000066400000000000000000001037511257552170400170430ustar00rootroot00000000000000dnl ############################################################# dnl # dnl # For information about autoconf, see: dnl # dnl # http://www.gnu.org/software/autoconf/ dnl # dnl # The recommended order is: dnl # dnl # AC_INIT(file) dnl # 0. checks for compiler, libtool, and command line options dnl # 1. checks for programs dnl # 2. checks for libraries dnl # 3. checks for header files dnl # 4. checks for typedefs dnl # 5. checks for structures and functions dnl # 6. checks for compiler characteristics dnl # 7. checks for library functions dnl # 8. checks for system services dnl # AC_OUTPUT([file...]) dnl # dnl ############################################################# AC_PREREQ([2.59]) export CFLAGS LIBS LDFLAGS CPPFLAGS m4_define(PACKAGE_MAIN, freeradius) AC_INIT(src/main/radiusd.c) AC_CONFIG_HEADER(src/include/autoconf.h) dnl # The version of the software RADIUSD_MAJOR_VERSION=`cat VERSION | sed 's/\..*//'` RADIUSD_MINOR_VERSION=`cat VERSION | sed 's/^[[^\.]]*\.//' | sed 's/\..*$//'` RADIUSD_INCRM_VERSION=`cat VERSION | sed 's/^.*\..*\.//' | sed 's/[[\.-]].*$//'` RADIUSD_VERSION=`echo | awk -v major="$RADIUSD_MAJOR_VERSION" \ -v minor="$RADIUSD_MINOR_VERSION" \ -v incrm="$RADIUSD_INCRM_VERSION" \ '{ printf "%02i%02i%02i", major, minor, incrm }'` dnl # Still useful for custom builds RADIUSD_VERSION_STRING=`cat VERSION` PACKAGE=PACKAGE_MAIN dnl ############################################################# dnl # dnl # 0. Checks for compiler, libtool, and command line options. dnl # dnl ############################################################# dnl Get system information AC_CANONICAL_SYSTEM dnl Check for GNU cc AC_PROG_CC AC_PROG_CXX dnl # dnl # check for AIX, to allow us to use some BSD functions dnl # must be before macros that call the compiler. dnl # AC_AIX AC_PROG_GCC_TRADITIONAL AC_PROG_CC_SUNPRO AC_PROG_RANLIB dnl # dnl # Set Default CFLAGS dnl # if test "x$GCC" = "xyes"; then CFLAGS="$CFLAGS -Wall -D_GNU_SOURCE" fi dnl Compile in large (2G+) file support. AC_SYS_LARGEFILE dnl # check for system bytesex dnl # AC_DEFINES WORDS_BIGENDIAN AC_C_BIGENDIAN dnl Find GNU Make. AC_CHECK_PROG(GMAKE, gmake, yes, no) if test $GMAKE = no; then AC_PATH_PROG(MAKE, make, /usr/local/bin/make) else AC_PATH_PROG(MAKE, gmake, /usr/local/gnu/bin/make) fi makever=`$ac_cv_path_MAKE --version 2>&1 | grep "GNU Make"` if test -z "$makever"; then AC_MSG_ERROR(GNU Make is not installed. Please download and install it from ftp://prep.ai.mit.edu/pub/gnu/make/ before continuing.) fi dnl See if we have Git. AC_CHECK_PROG(GIT, git, yes, no) AC_ARG_WITH(system-libltdl, [ --with-system-libltdl Use the libltdl installed in your system (default=use our own)], [ LIBLTDL="-lltdl" INCLTDL=-DWITH_SYSTEM_LTDL LTDL_SUBDIRS= ], [ dnl If libltdl isn't installable, set it to be installable. [test x"$enable_ltdl_install" = x && enable_ltdl_install=yes] AC_LIBLTDL_INSTALLABLE dnl tell Makefile to build ltdl if needed if test x"$enable_ltdl_install" = x"yes"; then LTDL_SUBDIRS=libltdl fi ]) AC_SUBST(LTDL_SUBDIRS) dnl set this shit so it doesn't force CFLAGS... LTCFLAGS=" " dnl use system-wide libtool, if it exists AC_ARG_WITH(system-libtool, [ --with-system-libtool Use the libtool installed in your system (default=use our own)], [ AC_PATH_PROG(LIBTOOL, libtool,,$PATH:/usr/local/bin) AC_LIBTOOL_DLOPEN AC_PROG_LIBTOOL], [ LIBTOOL="`pwd`/libtool" AC_SUBST(LIBTOOL) dnl ensure that we're looking for dlopen AC_LIBTOOL_DLOPEN dnl Figure out how to build shared libraries AC_PROG_LIBTOOL ]) dnl Put this in later, when all distributed modules use autoconf. dnl AC_ARG_WITH(disablemodulefoo, dnl [ --without-rlm_foo Disables module compilation. Module list:] dnl esyscmd([find src/modules -type d -name rlm_\* -print |\ dnl sed -e 's%src/modules/.*/% (sub)- %; s%.*/%- %' |\ dnl awk '{print " "$0}'])) AC_ARG_ENABLE(strict-dependencies, [ --enable-strict-dependencies Fail configure on lack of module dependancy.]) dnl extra argument: --with-docdir docdir='${datadir}/doc/freeradius' AC_MSG_CHECKING(docdir) AC_ARG_WITH(docdir, [ --with-docdir=DIR Directory for documentation [DATADIR/doc/freeradius] ], [ case "$withval" in no) docdir=no ;; yes) ;; [[\\/$]]* | ?:[[\\/]]* ) docdir="$withval" ;; *) AC_MSG_ERROR([expected an absolute directory name for --with-docdir: $withval]) ;; esac ] ) AC_SUBST(docdir) AC_MSG_RESULT($docdir) if test "x$docdir" = xno; then AC_MSG_WARN(Documentation files will NOT be installed.) fi dnl extra argument: --with-logdir logdir='${localstatedir}/log/radius' AC_MSG_CHECKING(logdir) AC_ARG_WITH(logdir, [ --with-logdir=DIR Directory for logfiles [LOCALSTATEDIR/log/radius] ], [ case "$withval" in no) AC_MSG_ERROR(Need logdir) ;; yes) ;; [[\\/$]]* | ?:[[\\/]]* ) logdir="$withval" ;; *) AC_MSG_ERROR([expected an absolute directory name for --with-logdir: $withval]) ;; esac ] ) AC_SUBST(logdir) AC_MSG_RESULT($logdir) dnl extra argument: --with-radacctdir radacctdir='${logdir}/radacct' AC_MSG_CHECKING(radacctdir) AC_ARG_WITH(radacctdir, [ --with-radacctdir=DIR Directory for detail files [LOGDIR/radacct] ], [ case "$withval" in no) AC_MSG_ERROR(Need radacctdir) ;; yes) ;; [[\\/$]]* | ?:[[\\/]]* ) radacctdir="$withval" ;; *) AC_MSG_ERROR([expected an absolute directory name for --with-radacctdir: $withval]) ;; esac ] ) AC_SUBST(radacctdir) AC_MSG_RESULT($radacctdir) dnl extra argument: --with-raddbdir raddbdir='${sysconfdir}/raddb' AC_MSG_CHECKING(raddbdir) AC_ARG_WITH(raddbdir, [ --with-raddbdir=DIR Directory for config files [SYSCONFDIR/raddb] ], [ case "$withval" in no) AC_MSG_ERROR(Need raddbdir) ;; yes) ;; [[\\/$]]* | ?:[[\\/]]* ) raddbdir="$withval" ;; *) AC_MSG_ERROR([expected an absolute directory name for --with-raddbdir: $withval]) ;; esac ] ) AC_SUBST(raddbdir) AC_MSG_RESULT($raddbdir) dnl extra argument: --with-ascend-binary ASCEND_BINARY=yes AC_ARG_WITH(ascend-binary, [ --with-ascend-binary Include support for Ascend binary filter attributes (default=yes)], [ case "$withval" in yes) ;; *) ASCEND_BINARY="" esac ] ) if test "X$ASCEND_BINARY" = "Xyes"; then AC_DEFINE(ASCEND_BINARY, [], [Include support for Ascend binary filter attributes]) fi dnl extra argument: --with-threads WITH_THREADS=yes AC_ARG_WITH(threads, [ --with-threads Use threads, if available. (default=yes) ], [ case "$withval" in yes) ;; *) WITH_THREADS="" esac ] ) dnl extra argument: --with-vmps WITH_VMPS=yes AC_ARG_WITH(vmps, [ --with-vmps Compile in VMPS support. (default=yes)], [ case "$withval" in yes) ;; *) WITH_VMPS=no esac ] ) if test "x$WITH_VMPS" = "xyes"; then AC_DEFINE(WITH_VMPS, [1], [define if you want VMPS support]) fi dnl extra argument: --with-dhcp WITH_DHCP=yes AC_ARG_WITH(dhcp, [ --with-dhcp Compile in DHCP support. (default=yes)], [ case "$withval" in yes) ;; *) WITH_DHCP=no esac ] ) if test "x$WITH_DHCP" = "xyes"; then AC_DEFINE(WITH_DHCP, [1], [define if you want DHCP support]) fi dnl extra argument: --with-post-proxy-authorize WITH_POST_PROXY_AUTHORIZE= AC_ARG_WITH(post-proxy-authorize, [ --with-post-proxy-authorize 1.x compatibility (default=no) ], [ case "$withval" in yes) WITH_POST_PROXY_AUTHORIZE="" ;; *) ;; esac ] ) dnl # dnl # Allow the user to specify a list of modules to be linked dnl # statically to the server. dnl # STATIC_MODULES= AC_ARG_WITH(static_modules, [ --with-static-modules=QUOTED-MODULE-LIST],[ for i in $withval; do STATIC_MODULES="$STATIC_MODULES -dlpreopen ../modules/rlm_$i/rlm_$i.la" done ]) MODULES= AC_ARG_WITH(modules, [ --with-modules=QUOTED-MODULE-LIST],[ for i in $withval; do MODULES="$MODULES $i" done ]) dnl # dnl # Enable developer C compiler warnings dnl # AC_ARG_ENABLE(developer, [ --enable-developer Enables features of interest to developers.], [ case "$enableval" in no) developer=no ;; *) developer=yes esac ] ) if test -d $srcdir/.git; then if test "x$developer" != "xno"; then dnl turn on the developer flag when taken from a git checkout (not a release) developer="yes" fi dnl append the current git hash onto the version string if test "x$GIT" = "xyes"; then RADIUSD_VERSION_COMMIT=`git log --pretty=format:'%h' -n 1` fi fi dnl extra argument: --with-experimental-modules EXPERIMENTAL= AC_ARG_WITH(experimental-modules, [ --with-experimental-modules Use experimental and unstable modules. (default=no) ], [ case "$withval" in yes) EXPERIMENTAL=yes ;; *) esac ] ) dnl extra argument: --with-openssl WITH_OPENSSL=yes AC_ARG_WITH(openssl, [ --with-openssl Use OpenSSL. (default=yes)], [ case "$withval" in no) WITH_OPENSSL=no ;; *) WITH_OPENSSL=yes ;; esac ] ) dnl # dnl # extra argument: --with-openssl-includes=dir dnl # OPENSSL_INCLUDE_DIR= AC_ARG_WITH(openssl-includes, [ --with-openssl-includes=DIR Directory to look for OpenSSL include files], [ case "$withval" in *) OPENSSL_INCLUDE_DIR="$withval" ;; esac ] ) dnl # dnl # extra argument: --with-openssl-libraries=dir dnl # OPENSSL_LIB_DIR= AC_ARG_WITH(openssl-libraries, [ --with-openssl-libraries=DIR Directory to look for OpenSSL library files], [ case "$withval" in *) OPENSSL_LIB_DIR="$withval" ;; esac ] ) dnl # dnl # extra argument: --disable-openssl-version-check dnl # AC_ARG_ENABLE(openssl-version-check, [ --disable-openssl-version-check Disable vulnerable OpenSSL version check.] ) if test "x$enable_openssl_version_check" != "xno"; then AC_DEFINE(ENABLE_OPENSSL_VERSION_CHECK, [1], [Define to 1 to have OpenSSL version check enabled]) openssl_version_check_config="\ # # allow_vulnerable_openssl: Allow the server to start with # versions of OpenSSL known to have critical vulnerabilities. # # This check is based on the version number reported by libssl # and may not reflect patches applied to libssl by # distribution maintainers. # allow_vulnerable_openssl = no" else openssl_version_check_config= fi AC_SUBST([openssl_version_check_config]) dnl # dnl # These next two arguments don't actually do anything. They're dnl # place holders so that the top-level configure script can tell dnl # the user how to configure lower-level modules dnl # dnl # dnl # extra argument: --with-rlm-FOO-lib-dir dnl # AC_ARG_WITH(rlm-FOO-lib-dir, [ --with-rlm-FOO-lib-dir=DIR Directory to look for library files used by module FOO], [ case "$withval" in *) ;; esac ] ) dnl # dnl # extra argument: --with-rlm-FOO-include-dir dnl # AC_ARG_WITH(rlm-FOO-include-dir, [ --with-rlm-FOO-include-dir=DIR Directory to look for include files used by module FOO], [ case "$withval" in *) ;; esac ] ) dnl See what include-style is used by the make program. dnl AC_MSG_CHECKING(include style for make) dnl echo "include /dev/null" > testmake.$$ dnl echo "all:" >> testmake.$$ dnl make -f testmake.$$ >/dev/null 2>&1 dnl if test $? = 0 dnl then dnl INCLUDE=include dnl IQUOTE= dnl else dnl INCLUDE=.include dnl IQUOTE='"' dnl fi dnl rm -f testmake.$$ dnl AC_MSG_RESULT(" $INCLUDE") dnl AC_SUBST(INCLUDE) dnl AC_SUBST(IQUOTE) dnl extra argument: --with-udpfromto WITH_UDPFROMTO=no AC_ARG_WITH(udpfromto, [ --with-udpfromto Compile in UDPFROMTO support. (default=no)], [ case "$withval" in yes) WITH_UDPFROMTO=yes ;; *) WITH_UDPFROMTO=no esac ] ) if test "x$WITH_UDPFROMTO" = "xyes"; then AC_DEFINE(WITH_UDPFROMTO, [], [define if you want udpfromto]) fi dnl ############################################################# dnl # dnl # 1. Checks for programs dnl # dnl ############################################################# CHECKRAD=checkrad.pl AC_PATH_PROG(PERL, perl, /usr/local/bin/perl) if test "x$ac_cv_path_PERL" = "x"; then AC_MSG_WARN(perl not found - Simultaneous-Use and checkrad.pl may not work) fi AC_PATH_PROG(SNMPGET, snmpget) if test "x$ac_cv_path_SNMPGET" = "x"; then AC_MSG_WARN(snmpget not found - Simultaneous-Use and checkrad.pl may not work) fi AC_PATH_PROG(SNMPWALK, snmpwalk) if test "x$ac_cv_path_SNMPWALK" = "x"; then AC_MSG_WARN(snmpwalk not found - Simultaneous-Use and checkrad.pl may not work) fi AC_PATH_PROG(RUSERS, rusers, /usr/bin/rusers) dnl FIXME This is truly gross. missing_dir=`cd $ac_aux_dir && pwd` AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir) AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir) AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir) AC_PATH_PROG(LOCATE,locate) AC_PATH_PROG(DIRNAME,dirname) AC_PATH_PROG(GREP,grep) dnl ############################################################# dnl # dnl # 2. Checks for libraries dnl # dnl ############################################################# dnl If using pthreads, check for -lpthread (posix) or -lc_r (*BSD) old_CFLAGS=$CFLAGS if test "x$WITH_THREADS" = "xyes"; then if test $ac_cv_prog_suncc = "yes"; then CFLAGS="$CFLAGS -mt" fi AC_CHECK_HEADERS(pthread.h, [], [ WITH_THREADS="no" ]) dnl # dnl # pthread stuff is usually in -lpthread dnl # or in -lc_r, on *BSD dnl # dnl # On Some systems, we need extra pre-processor flags, to get them to dnl # to do the threading properly. dnl # AC_CHECK_LIB(pthread, pthread_create, [ CFLAGS="$CFLAGS -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS" LIBS="-lpthread $LIBS" ], AC_CHECK_LIB(c_r, pthread_create, [ CFLAGS="$CFLAGS -pthread -D_THREAD_SAFE" ], [ WITH_THREADS="no" ] ) ) fi dnl # dnl # If we have NO pthread libraries, remove any knowledge of threads. dnl # if test "x$WITH_THREADS" != "xyes"; then CFLAGS=$old_CFLAGS ac_cv_header_pthread_h="no" WITH_THREADS=no else dnl # dnl # We need sem_init() and friends, as they're the friendliest dnl # semaphore functions for threading. dnl # dnl # HP/UX requires linking with librt, too, to get the sem_* symbols. dnl # Some systems have them in -lsem dnl # Solaris has them in -lposix4 dnl # NetBSD has them in -lsemaphore AC_SEARCH_LIBS(sem_init, pthread sem posix4 rt semaphore, [], [AC_MSG_ERROR(-lsem not found. You may want to download it from ftp://ftp.to.gd-es.com/pub/BSDI/libsem.tar.bz2 or ftp://ftp.freeradius.org/pub/radius/contrib/libsem.tar.gz)] ) fi dnl Check if we need -lsocket AC_CHECK_LIB(socket, getsockname) dnl Check for -lresolv dnl This library may be needed later. AC_CHECK_LIB(resolv, inet_aton) dnl Check if we need -lnsl. Usually if we want to dnl link against -lsocket we need to include -lnsl as well. AC_CHECK_LIB(nsl, inet_ntoa) dnl Check for OpenSSL libraries. OPENSSL_LIBS= if test "x$WITH_OPENSSL" = xyes; then old_LIBS=$LIBS old_LDFLAGS="$LDFLAGS" if test "x$OPENSSL_LIB_DIR" != "x"; then LDFLAGS="-L$OPENSSL_LIB_DIR $LDFLAGS" fi AC_CHECK_LIB(crypto, DH_new, [ LIBS="-lcrypto $LIBS" AC_DEFINE(HAVE_LIBCRYPTO, 1, [Define to 1 if you have the `crypto' library (-lcrypto).]) AC_CHECK_LIB(ssl, SSL_new, [ AC_DEFINE(HAVE_LIBSSL, 1, [Define to 1 if you have the `ssl' library (-lssl).]) if test "x$OPENSSL_LIB_DIR" != "x"; then OPENSSL_LIBS="-L$OPENSSL_LIB_DIR" fi OPENSSL_LIBS="$OPENSSL_LIBS -lcrypto -lssl -lcrypto" ], []) ], []) LIBS=$old_LIBS LDFLAGS="$old_LDFLAGS" fi AC_CHECK_LIB(ws2_32, htonl) dnl Check the pcap library for the RADIUS sniffer. PCAP_LIBS= AC_CHECK_LIB(pcap, pcap_open_live, [ PCAP_LIBS="-lpcap" AC_DEFINE(HAVE_LIBPCAP, 1, [Define to 1 if you have the `pcap' library (-lpcap).]) ], [ AC_MSG_WARN([pcap library not found, silently disabling the RADIUS sniffer.]) ]) AC_LIB_READLINE dnl ############################################################# dnl # dnl # 3. Checks for header files dnl # dnl ############################################################# dnl # dnl # Interix requires us to set -D_ALL_SOURCE, otherwise dnl # getopt will be #included, but won't link. dnl # dnl # case "$host" in *-interix*) CFLAGS="$CFLAGS -D_ALL_SOURCE" ;; *-darwin*) CFLAGS="$CFLAGS -DDARWIN" LIBS="-framework DirectoryService $LIBS" AC_DEFINE([__APPLE_USE_RFC_3542], 1, [Force OSX >= 10.7 Lion to use RFC2292 IPv6 socket options]) ;; esac AC_HEADER_DIRENT AC_HEADER_STDC AC_HEADER_TIME AC_HEADER_SYS_WAIT AC_CHECK_HEADERS( \ unistd.h \ crypt.h \ errno.h \ execinfo.h \ resource.h \ sys/resource.h \ getopt.h \ malloc.h \ utmp.h \ utmpx.h \ signal.h \ sys/select.h \ syslog.h \ inttypes.h \ stdint.h \ stdio.h \ netdb.h \ semaphore.h \ arpa/inet.h \ netinet/in.h \ sys/types.h \ sys/socket.h \ winsock.h \ sys/time.h \ sys/wait.h \ sys/security.h \ fcntl.h \ sys/fcntl.h \ sys/prctl.h \ sys/un.h \ glob.h \ prot.h \ pwd.h \ grp.h \ stddef.h \ fnmatch.h \ sia.h \ siad.h ) dnl FreeBSD requires sys/socket.h before net/if.h AC_CHECK_HEADERS(net/if.h, [], [], [#ifdef HAVE_SYS_SOCKET_H # include # endif ]) REGEX=no AC_CHECK_HEADER(regex.h, AC_DEFINE(HAVE_REGEX_H, [], [define this if we have the header file])) if test "x$ac_cv_header_regex_h" = "xyes"; then REGEX_EXTENDED=no REGEX=yes AC_EGREP_CPP(yes, [#include #ifdef REG_EXTENDED yes #endif ], [AC_DEFINE(HAVE_REG_EXTENDED, [], [define this if we have REG_EXTENDED (from )]) REGEX_EXTENDED=yes]) fi AC_SUBST(REGEX) AC_SUBST(REGEX_EXTENDED) dnl # dnl # other checks which require headers dnl # if test "x$ac_cv_header_sys_security_h" = "xyes" && test "x$ac_cv_header_prot_h" = "xyes" then AC_DEFINE(OSFC2, [], [define if you have OSFC2 authentication]) fi if test "x$ac_cv_header_sia_h" = "xyes" && test "x$ac_cv_header_siad_h" = "xyes" then AC_DEFINE(OSFSIA, [], [define if you have OSFSIA authentication]) fi dnl # dnl # Were we told to use OpenSSL, if we were and we find an error, call AC_MSG_FAILURE and exit dnl # if test "x$WITH_OPENSSL" = xyes; then old_LIBS=$LIBS old_LDFLAGS="$LDFLAGS" OPENSSL_INCLUDE="-DNO_OPENSSL" OPENSSL_LIBS= if test "x$OPENSSL_LIB_DIR" != "x"; then LDFLAGS="-L$OPENSSL_LIB_DIR $LDFLAGS" fi dnl # dnl # Check we can link to libssl dnl # AC_CHECK_LIB(crypto, DH_new, [ LIBS="-lcrypto $LIBS" AC_DEFINE(HAVE_LIBCRYPTO, 1, [Define to 1 if you have the `crypto' library (-lcrypto).]) AC_CHECK_LIB(ssl, SSL_new, [ AC_DEFINE(HAVE_LIBSSL, 1, [Define to 1 if you have the `ssl' library (-lssl).]) if test "x$OPENSSL_LIB_DIR" != "x"; then OPENSSL_LIBS="-L$OPENSSL_LIB_DIR" fi OPENSSL_LIBS="$OPENSSL_LIBS -lcrypto -lssl -lcrypto" LIBS="$OPENSSL_LIBS $LIBS" ], [ AC_MSG_FAILURE([failed linking to libssl]) ] ) ], [] ) dnl # dnl # Check we can find required headers dnl # old_CPPFLAGS=$CPPFLAGS old_CFLAGS=$CFLAGS if test "x$OPENSSL_INCLUDE_DIR" != "x"; then CPPFLAGS="-I$OPENSSL_INCLUDE_DIR $CPPFLAGS" CFLAGS="-I$OPENSSL_INCLUDE_DIR $CFLAGS" fi dnl # dnl # Stupid RedHat shit dnl # CPPFLAGS="$CPPFLAGS -DOPENSSL_NO_KRB5" AC_CHECK_HEADERS( \ openssl/ssl.h \ openssl/crypto.h \ openssl/err.h \ openssl/evp.h \ openssl/md5.h \ openssl/md4.h \ openssl/sha.h \ openssl/ocsp.h \ openssl/engine.h, [], [ AC_MSG_FAILURE([failed locating OpenSSL headers]) ] ) AC_MSG_CHECKING([for OpenSSL version >= 0.9.7]) AC_EGREP_CPP(yes, [#include #if (OPENSSL_VERSION_NUMBER >= 0x00907000L) yes #endif ], [ AC_MSG_RESULT(yes) ], [ AC_MSG_RESULT(no) AC_MSG_FAILURE([OpenSSL version too old]) ] ) if test "x$OPENSSL_INCLUDE_DIR" != "x"; then OPENSSL_INCLUDE="-I$OPENSSL_INCLUDE_DIR -DOPENSSL_NO_KRB5" else OPENSSL_INCLUDE="-DOPENSSL_NO_KRB5" fi dnl # dnl # Now check that the header versions match the library dnl # AC_MSG_CHECKING([OpenSSL library and header version consistency]) AC_RUN_IFELSE( [AC_LANG_PROGRAM( [[ #include #include #include ]], [[ if (SSLeay() == OPENSSL_VERSION_NUMBER) { return 0; } else { printf("library: %lx header: %lx... ", (unsigned long) SSLeay(), (unsigned long) OPENSSL_VERSION_NUMBER); return 1; } ]] )], [ AC_MSG_RESULT(yes) ], [ AC_MSG_RESULT(no) AC_MSG_FAILURE([OpenSSL library version does not match header version]) ] ) if test "x$OPENSSL_LIBS" = x; then LIBS=$old_LIBS LDFLAGS="$old_LDFLAGS" fi if test "x$OPENSSL_INCLUDE" = x; then CPPFLAGS=$old_CPPFLAGS CFLAGS=$old_CFLAGS fi fi AC_SUBST(OPENSSL_INCLUDE) AC_SUBST(OPENSSL_LIBS) export OPENSSL_LIBS dnl Check the pcap includes for the RADIUS sniffer. if test "x$PCAP_LIBS" = x; then AC_MSG_NOTICE([skipping test for pcap.h.]) else AC_CHECK_HEADER(pcap.h, AC_DEFINE(HAVE_PCAP_H, 1, [Define to 1 if you have the header file.]), [ PCAP_LIBS= AC_MSG_WARN([pcap.h not found, silently disabling the RADIUS sniffer.]) ]) AC_CHECK_LIB(pcap, pcap_fopen_offline, [ AC_DEFINE(HAVE_PCAP_FOPEN_OFFLINE, 1, [Define to 1 if you have the function pcap_fopen_offline.]) ]) AC_CHECK_LIB(pcap, pcap_dump_fopen, [ AC_DEFINE(HAVE_PCAP_DUMP_FOPEN, 1, [Define to 1 if you have the function pcap_dump_fopen.]) ]) fi AC_SUBST(PCAP_LIBS) dnl ############################################################# dnl # dnl # 4. Checks for typedefs dnl # dnl ############################################################# dnl # dnl # Ensure that these are defined dnl # AC_TYPE_OFF_T AC_TYPE_PID_T AC_TYPE_SIZE_T AC_TYPE_UID_T dnl check for socklen_t FR_CHECK_TYPE_INCLUDE([ #ifdef HAVE_SYS_TYPES_H #include #endif #ifdef HAVE_SYS_SOCKET_H #include #endif ],socklen_t, int, [socklen_t is generally 'int' on systems which don't use it]) dnl check for uint8_t FR_CHECK_TYPE_INCLUDE([ #ifdef HAVE_INTTYPES_H #include #endif #ifdef HAVE_STDINT_H #include #endif ],uint8_t, unsigned char, [uint8_t should be the canonical 'octet' for network traffic]) dnl check for uint16_t FR_CHECK_TYPE_INCLUDE([ #ifdef HAVE_INTTYPES_H #include #endif #ifdef HAVE_STDINT_H #include #endif ],uint16_t, unsigned short, [uint16_t should be the canonical '2 octets' for network traffic]) dnl check for uint32_t FR_CHECK_TYPE_INCLUDE([ #ifdef HAVE_INTTYPES_H #include #endif #ifdef HAVE_STDINT_H #include #endif ],uint32_t, unsigned int, [uint32_t should be the canonical 'network integer]) AC_CHECK_TYPE(sig_t, AC_DEFINE(HAVE_SIG_T, 1, [signal action callback function]), [], [ #ifdef HAVE_SIGNAL_H # include #endif ]) AC_CHECK_TYPE(struct in6_addr, AC_DEFINE(HAVE_STRUCT_IN6_ADDR, 1, [IPv6 address structure]), [], [ #ifdef HAVE_NETINET_IN_H #include #endif ]) AC_CHECK_TYPE(struct sockaddr_storage, AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE, 1, [Generic socket addresses]), [], [ #ifdef HAVE_NETINET_IN_H #include #endif #ifdef HAVE_SYS_SOCKET_H #include #endif ]) AC_CHECK_TYPE(struct sockaddr_in6, AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6, 1, [IPv6 socket addresses]), [], [ #ifdef HAVE_NETINET_IN_H #include #endif ]) AC_CHECK_TYPE(struct addrinfo, AC_DEFINE(HAVE_STRUCT_ADDRINFO, 1, [Generic DNS lookups]), [], [ #ifdef HAVE_SYS_TYPES_H #include #endif #ifdef HAVE_SYS_SOCKET_H #include #endif #ifdef HAVE_NETDB_H #include #endif ]) dnl ############################################################# dnl # dnl # 5. Checks for structures and functions dnl # dnl ############################################################# AC_CHECK_FUNCS( \ getopt_long \ lockf \ strsignal \ sigaction \ sigprocmask \ pthread_sigmask \ snprintf \ vsnprintf \ setsid \ strncasecmp \ strcasecmp \ localtime_r \ ctime_r \ gmtime_r \ strsep \ inet_aton \ inet_pton \ inet_ntop \ setlinebuf \ setvbuf \ getusershell \ initgroups \ getaddrinfo \ getnameinfo \ closefrom \ gettimeofday \ getpeereid \ setuid \ setresuid \ getresuid \ strlcat \ strlcpy ) RADIUSD_NEED_DECLARATIONS( \ crypt \ strncasecmp \ strcasecmp \ inet_aton \ setlinebuf \ getusershell \ endusershell ) AC_TYPE_SIGNAL dnl # check if we have utmpx.h dnl # if so, check if struct utmpx has entry ut_xtime dnl # if not, set it to define ut_xtime == ut_tv.tv_sec if test "x$ac_cv_header_utmpx_h" = "xyes" then FR_CHECK_STRUCT_HAS_MEMBER([#include ], [struct utmpx], ut_xtime) if test "x$ac_cv_type_struct_utmpx_has_ut_xtime" = "x" then AC_DEFINE(ut_xtime,ut_tv.tv_sec, [define to something if you don't have ut_xtime in struct utmpx]) fi fi dnl # struct ip_pktinfo FR_CHECK_STRUCT_HAS_MEMBER([#include ], [struct in_pktinfo], ipi_addr) if test "x$ac_cv_type_struct_in_pktinfo_has_ipi_addr" = "xyes" then AC_DEFINE(HAVE_IP_PKTINFO, [], [define if you have IP_PKTINFO (Linux)]) fi dnl # struct in6_pktinfo FR_CHECK_STRUCT_HAS_MEMBER([#include ], [struct in6_pktinfo], ipi6_addr) if test "x$ac_cv_type_struct_in6_pktinfo_has_ipi6_addr" = "xyes" then AC_DEFINE(HAVE_IN6_PKTINFO, [], [define if you have IN6_PKTINFO (Linux)]) fi dnl ############################################################# dnl # dnl # 6. Checks for compiler characteristics dnl # dnl ############################################################# dnl # dnl # Ensure that these are defined dnl # AC_C_CONST dnl # dnl # See if this is OS/2 dnl # AC_MSG_CHECKING(type of OS) OS=`uname -s` AC_MSG_RESULT($OS) if test "$OS" = "OS/2"; then LIBPREFIX= else LIBPREFIX=lib fi AC_SUBST(LIBPREFIX) AC_MSG_CHECKING(for developer gcc flags) if test "x$developer" = "xyes" -a "x$GCC" = "xyes"; then devflags="-g -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -W -Wredundant-decls -Wundef" CFLAGS="$CFLAGS $devflags" INSTALLSTRIP="" AC_MSG_RESULT(yes. Using $devflags) else devflags="" CFLAGS="$CFLAGS -DNDEBUG" INSTALLSTRIP="" AC_MSG_RESULT(no.) fi FR_TLS dnl ############################################################# dnl # dnl # 7. Checks for library functions dnl # dnl ############################################################# old_LIBS="$LIBS" LIBS="$LIBS $LIBLTDL" AC_CHECK_FUNC(lt_dladvise_init, AC_DEFINE(HAVE_LT_DLADVISE_INIT, [], [Do we have the lt_dladvise_init function])) LIBS="$old_LIBS" dnl Check for libcrypt dnl We use crypt(3) which may be in libc, or in libcrypt (eg FreeBSD) AC_CHECK_LIB(crypt, crypt, CRYPTLIB="-lcrypt" ) if test "$CRYPTLIB" != ""; then AC_DEFINE(HAVE_CRYPT, [], [Do we have the crypt function]) else AC_CHECK_FUNC(crypt, AC_DEFINE(HAVE_CRYPT, [], [Do we have the crypt function])) fi dnl Check for libcipher AC_CHECK_LIB(cipher, setkey, CRYPTLIB="${CRYPTLIB} -lcipher" ) AC_SUBST(CRYPTLIB) dnl Check the style of gethostbyaddr, in order of preference dnl GNU (_r eight args) AC_DEFINE(GNUSTYLE, [1], [GNU-Style get*byaddr_r]) dnl SYSV (_r six args) AC_DEFINE(SYSVSTYLE, [2], [SYSV-Style get*byaddr_r]) dnl BSD (three args, may not be thread safe) AC_DEFINE(BSDSTYLE, [3], [BSD-Style get*byaddr_r]) dnl Tru64 has BSD version, but it is thread safe dnl http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/V51B_HTML/MAN/MAN3/1739____.HTM dnl We need #stdio.h to define NULL on FreeBSD (at least) gethostbyaddrrstyle="" AC_MSG_CHECKING([gethostbyaddr_r() syntax]) case "$host" in *-freebsd*) dnl With FreeBSD, check if there's a prototype for gethostbyaddr_r. dnl Some versions (FreeBSD 5.1?) have a symbol but no prototype - so we dnl override this test to BSDSTYLE. FreeBSD 6.2 and up have proper GNU dnl style support. AC_CHECK_DECLS([gethostbyaddr_r], [], [ AC_DEFINE(GETHOSTBYADDRRSTYLE, BSDSTYLE, [style of gethostbyaddr_r functions ]) gethostbyaddrrstyle=BSD AC_MSG_WARN([FreeBSD overridden to BSD-style]) ], [ #ifdef HAVE_NETDB_H #include #endif ]) ;; esac if test "x$gethostbyaddrrstyle" = "x"; then AC_TRY_LINK([ #include #include ], [ gethostbyaddr_r(NULL, 0, 0, NULL, NULL, 0, NULL, NULL) ], [ AC_DEFINE(GETHOSTBYADDRRSTYLE, GNUSTYLE, [style of gethostbyaddr_r functions ]) gethostbyaddrrstyle=GNU ]) fi if test "x$gethostbyaddrrstyle" = "x"; then AC_TRY_LINK([ #include #include ], [ gethostbyaddr_r(NULL, 0, 0, NULL, NULL, 0, NULL) ] , [ AC_DEFINE(GETHOSTBYADDRRSTYLE, SYSVSTYLE, [style of gethostbyaddr_r functions ]) gethostbyaddrrstyle=SYSV ]) fi if test "x$gethostbyaddrrstyle" = "x"; then AC_TRY_LINK([ #include #include ], [ gethostbyaddr(NULL, 0, 0) ], [ AC_DEFINE(GETHOSTBYADDRRSTYLE, BSDSTYLE, [style of gethostbyaddr_r functions ]) gethostbyaddrrstyle=BSD ]) fi if test "x$gethostbyaddrrstyle" = "x"; then AC_MSG_RESULT([none! It must not exist, here.]) else AC_MSG_RESULT([${gethostbyaddrrstyle}-style]) fi if test "x$gethostbyaddrrstyle" = "xBSD"; then AC_MSG_WARN([ ****** BSD-style gethostbyaddr might NOT be thread-safe! ****** ]) fi dnl Check the style of gethostbyname, in order of preference dnl GNU (_r seven args) dnl SYSV (_r five args) dnl BSD (two args, may not be thread safe) dnl Tru64 has BSD version, but it _is_ thread safe dnl http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/V51B_HTML/MAN/MAN3/1946____.HTM dnl We need #stdio.h to define NULL on FreeBSD (at least) gethostbynamerstyle="" AC_MSG_CHECKING([gethostbyname_r() syntax]) AC_TRY_LINK([ #include #include ], [ gethostbyname_r(NULL, NULL, NULL, 0, NULL, NULL) ], [ AC_DEFINE(GETHOSTBYNAMERSTYLE, GNUSTYLE, [style of gethostbyname_r functions ]) gethostbynamerstyle=GNU ]) if test "x$gethostbynamerstyle" = "x"; then AC_TRY_LINK([ #include #include ], [ gethostbyname_r(NULL, NULL, NULL, 0, NULL) ] , [ AC_DEFINE(GETHOSTBYNAMERSTYLE, SYSVSTYLE, [style of gethostbyname_r functions ]) gethostbynamerstyle=SYSV ]) fi if test "x$gethostbynamerstyle" = "x"; then AC_TRY_LINK([ #include #include ], [ gethostbyname(NULL) ], [ AC_DEFINE(GETHOSTBYNAMERSTYLE, BSDSTYLE, [style of gethostbyname_r functions ]) gethostbynamerstyle=BSD ]) fi if test "x$gethostbynamerstyle" = "x"; then AC_MSG_RESULT([none! It must not exist, here.]) else AC_MSG_RESULT([${gethostbynamerstyle}-style]) fi if test "x$gethostbynamerstyle" = "xBSD"; then AC_MSG_WARN([ ****** BSD-style gethostbyname might NOT be thread-safe! ****** ]) fi dnl check for non-posix solaris ctime_r (extra buflen int arg) AC_DEFINE(POSIXSTYLE, [1], [Posix-Style ctime_r]) AC_DEFINE(SOLARISSTYLE, [2], [Solaris-Style ctime_r]) ctimerstyle="" AC_MSG_CHECKING([ctime_r() syntax]) AC_TRY_LINK([ #include ], [ ctime_r(NULL, NULL, 0) ], [ AC_DEFINE(CTIMERSTYLE, SOLARISSTYLE, [style of ctime_r function]) ctimerstyle="SOLARIS" ]) if test "x$ctimerstyle" = "x"; then AC_TRY_LINK([ #include ], [ ctime_r(NULL, NULL) ], [ AC_DEFINE(CTIMERSTYLE, POSIXSTYLE, [style of ctime_r function]) ctimerstyle="POSIX" ]) fi if test "x$ctimerstyle" = "x"; then AC_MSG_RESULT([none! It must not exist, here.]) else AC_MSG_RESULT([${ctimerstyle}-style]) fi AC_SUBST(HOSTINFO, $host) if test "x$WITH_POST_PROXY_AUTHORIZE" != "x"; then AC_DEFINE(WITH_POST_PROXY_AUTHORIZE, 1, [1.x compatibility]) fi dnl ############################################################# dnl # dnl # 8. Checks for system services dnl # dnl ############################################################# dnl # dnl # Figure out where libtool is located, dnl # top_builddir=`pwd` export top_builddir AC_MSG_RESULT([top_builddir=$top_builddir]) dnl # AC_SUBST(top_builddir) AC_SUBST(LIBLTDL) AC_SUBST(INCLTDL) dnl import libtool stuff dnl ############################################################# dnl # dnl # Configure in any module directories. dnl # dnl ############################################################# mysubdirs="$LIBLTDLPATH" if test "x$EXPERIMENTAL" = "xyes"; then bar=`ls -1 "${srcdir}"/src/modules/rlm_*/configure | sed 's%/configure%%'` dnl # get rid of LF's. mysubdirs=`echo $mysubdirs $bar` else dnl # dnl # Find 'configure' in ONLY the stable modules dnl # for bar in `cat "${srcdir}"/src/modules/stable`; do if test -f "${srcdir}"/src/modules/$bar/configure; then mysubdirs="$mysubdirs src/modules/$bar" fi done fi dnl ############################################################ dnl # make modules by list dnl ############################################################# if test "x$EXPERIMENTAL" = "xyes"; then for foo in `ls -1 "${srcdir}"/src/modules | grep rlm_`; do MODULES="$MODULES $foo" done else dnl # dnl # make ONLY the stable modules dnl # for foo in `cat "${srcdir}"/src/modules/stable`; do MODULES="$MODULES $foo" done fi dnl # dnl # Don't change the variable name here. Autoconf goes bonkers dnl # if you do. dnl # AC_CONFIG_SUBDIRS($LTDL_SUBDIRS $mysubdirs) AC_SUBST(MODULES) dnl ############################################################# dnl # dnl # And finally, output the results. dnl # dnl ############################################################# AC_CONFIG_COMMANDS([stamp-h], [echo timestamp > src/include/stamp-h]) AC_CONFIG_COMMANDS([build-radpaths-h], [(cd ./src/include && /bin/sh ./build-radpaths-h)]) AC_CONFIG_COMMANDS([main-chmod], [(cd ./src/main && chmod +x checkrad.pl radlast radtest)]) AC_CONFIG_COMMANDS([scripts-chmod], [(cd ./scripts && chmod +x rc.radiusd radwatch radiusd.cron.daily radiusd.cron.monthly cryptpasswd)]) dnl # dnl # Substitute whatever libraries we found to be necessary dnl # AC_SUBST(LIBS) AC_SUBST(INSTALLSTRIP) USE_SHARED_LIBS=$enable_shared AC_SUBST(USE_SHARED_LIBS) USE_STATIC_LIBS=$enable_static AC_SUBST(USE_STATIC_LIBS) AC_SUBST(STATIC_MODULES) AC_SUBST(RADIUSD_MAJOR_VERSION) AC_SUBST(RADIUSD_MINOR_VERSION) AC_SUBST(RADIUSD_INCRM_VERSION) AC_SUBST(RADIUSD_VERSION) AC_SUBST(RADIUSD_VERSION_STRING) AC_SUBST(RADIUSD_VERSION_COMMIT) AC_OUTPUT(\ ./Make.inc \ ./src/include/build-radpaths-h \ ./src/main/Makefile \ ./src/main/checkrad.pl \ ./src/main/radlast \ ./src/main/radtest \ ./scripts/rc.radiusd \ ./scripts/radwatch \ ./scripts/radiusd.cron.daily \ ./scripts/radiusd.cron.monthly \ ./scripts/cryptpasswd \ ./raddb/dictionary \ ./raddb/radrelay.conf \ ./raddb/radiusd.conf ) freeradius-server/debian/000077500000000000000000000000001257552170400157455ustar00rootroot00000000000000freeradius-server/debian/README.Debian000066400000000000000000000006311257552170400200060ustar00rootroot00000000000000Runlevel Changes ================ In freeradius 1.1.5-1, we changed our update-rc.d call so that we start at S50 and stop at K19 in order to fix dependency issues with various databases. This only takes effect for new installs however. If you want to update your existing install to do the same, a quick method is: update-rc.d -f freeradius remove update-rc.d freeradius start 50 2 3 4 5 . stop 19 0 1 6 . freeradius-server/debian/README.rfc000066400000000000000000000141311257552170400173760ustar00rootroot00000000000000These are the relevant RFC's that normally ship with freeradius. However, we have now decided that useful things like RFC's are not free enough, and so we can't ship them in Debian main. They are all available from the original freeradius tarball, available at ftp://ftp.freeradius.org/pub/radius/ and from http://www.rfc-editor.org/ Sorry for the inconvenience. Stephen Gran draft-kamath-pppext-eap-mschapv2-00 Change-Password pppext-eap-sim-12 Re-Authentication pppext-eap-sim-12 EAP-Request/SIM/Start pppext-eap-sim-12 EAP-Response/SIM/Start pppext-eap-sim-12 EAP-Request/SIM/Challenge pppext-eap-sim-12 EAP-Response/SIM/Challenge pppext-eap-sim-12 EAP-Request/SIM/Re-authentication pppext-eap-sim-12 EAP-Response/SIM/Re-authentication pppext-eap-sim-12 EAP-Response/SIM/Client-Error pppext-eap-sim-12 EAP-Request/SIM/Notification pppext-eap-sim-12 EAP-Response/SIM/Notification pppext-eap-sim-12 Man-in-the-middle rfc1227 Request-ID rfc2284 One-Time rfc2548 MS-CHAP-Challenge rfc2548 MS-CHAP-Response rfc2548 MS-CHAP-Domain rfc2548 MS-CHAP-Error rfc2548 MS-CHAP-CPW-1 rfc2548 MS-CHAP-CPW-2 rfc2548 MS-CHAP-LM-Enc-PW rfc2548 MS-CHAP-NT-Enc-PW rfc2548 MS-CHAP2-Response rfc2548 MS-CHAP2-Success rfc2548 MS-CHAP2-CPW rfc2548 MS-CHAP-MPPE-Keys rfc2548 MS-MPPE-Send-Key rfc2548 MS-MPPE-Recv-Key rfc2548 MS-MPPE-Encryption-Policy rfc2548 MS-MPPE-Encryption-Types rfc2548 MS-BAP-Usage rfc2548 MS-Link-Utilization-Threshold rfc2548 MS-Link-Drop-Time-Limit rfc2548 MS-Old-ARAP-Password rfc2548 MS-New-ARAP-Password rfc2548 MS-ARAP-Password-Change-Reason rfc2548 MS-ARAP-Challenge rfc2548 MS-RAS-Vendor rfc2548 MS-RAS-Version rfc2548 MS-Filter rfc2548 MS-Acct-Auth-Type rfc2548 MS-Acct-EAP-Type rfc2548 MS-Primary-DNS-Server rfc2548 MS-Secondary-DNS-Server rfc2548 MS-Primary-NBNS-Server rfc2548 MS-Secondary-NBNS-Server rfc2809 Telephone-number rfc2809 User-Name rfc2865 Keep-Alives rfc2865 Access-Request rfc2865 Access-Accept rfc2865 Access-Reject rfc2865 Access-Challenge rfc2865 User-Password rfc2865 CHAP-Password rfc2865 NAS-IP-Address rfc2865 NAS-Port rfc2865 Service-Type rfc2865 Framed-Protocol rfc2865 Framed-IP-Address rfc2865 Framed-IP-Netmask rfc2865 Framed-Routing rfc2865 Filter-Id rfc2865 Framed-MTU rfc2865 Framed-Compression rfc2865 Login-IP-Host rfc2865 Login-Service rfc2865 Login-TCP-Port rfc2865 Reply-Message rfc2865 Callback-Number rfc2865 Callback-Id rfc2865 Framed-Route rfc2865 Framed-IPX-Network rfc2865 Vendor-Specific rfc2865 Session-Timeout rfc2865 Idle-Timeout rfc2865 Termination-Action rfc2865 Called-Station-Id rfc2865 Calling-Station-Id rfc2865 NAS-Identifier rfc2865 Proxy-State rfc2865 Login-LAT-Service rfc2865 Login-LAT-Node rfc2865 Login-LAT-Group rfc2865 Framed-AppleTalk-Link rfc2865 Framed-AppleTalk-Network rfc2865 Framed-AppleTalk-Zone rfc2865 CHAP-Challenge rfc2865 NAS-Port-Type rfc2865 Port-Limit rfc2865 Login-LAT-Port rfc2866 Accounting-Request rfc2866 Accounting-Response rfc2866 Acct-Status-Type rfc2866 Acct-Delay-Time rfc2866 Acct-Input-Octets rfc2866 Acct-Output-Octets rfc2866 Acct-Session-Id rfc2866 Acct-Authentic rfc2866 Acct-Session-Time rfc2866 Acct-Input-Packets rfc2866 Acct-Output-Packets rfc2866 Acct-Terminate-Cause rfc2866 Acct-Multi-Session-Id rfc2866 Acct-Link-Count rfc2867 Tunnel-Start rfc2867 Tunnel-Stop rfc2867 Tunnel-Reject rfc2867 Tunnel-Link-Start rfc2867 Tunnel-Link-Stop rfc2867 Tunnel-Link-Reject rfc2867 Acct-Tunnel-Connection rfc2867 Acct-Tunnel-Packets-Lost rfc2868 Tunnel-Type rfc2868 Tunnel-Medium-Type rfc2868 Tunnel-Client-Endpoint rfc2868 Tunnel-Server-Endpoint rfc2868 Tunnel-Password rfc2868 Tunnel-Private-Group-ID rfc2868 Tunnel-Assignment-ID rfc2868 Tunnel-Preference rfc2868 Tunnel-Client-Auth-ID rfc2868 Tunnel-Server-Auth-ID rfc2869 Acct-Input-Gigawords rfc2869 Acct-Output-Gigawords rfc2869 Event-Timestamp rfc2869 ARAP-Password rfc2869 ARAP-Features rfc2869 ARAP-Zone-Access rfc2869 ARAP-Security rfc2869 ARAP-Security-Data rfc2869 Password-Retry rfc2869 Connect-Info rfc2869 Configuration-Token rfc2869 EAP-Message rfc2869 Message-Authenticator rfc2869 ARAP-Challenge-Response rfc2869 Acct-Interim-Interval rfc2869 NAS-Port-Id rfc2869 Framed-Pool rfc2924 ITU-T rfc3162 NAS-IPv6-Address rfc3162 Framed-Interface-Id rfc3162 Framed-IPv6-Prefix rfc3162 Login-IPv6-Host rfc3162 Framed-IPv6-Route rfc3162 Framed-IPv6-Pool rfc3576 Change-of-Authorization rfc3576 Error-Cause rfc3580 Filter-ID rfc3748 Pass-Through rfc3748 Peer-to-Peer rfc3748 Man-in-the-Middle rfc4372 Chargeable-User-Identity rfc4590 Digest-Response rfc4590 Digest-Realm rfc4590 Digest-Nonce rfc4590 Digest-Response-Auth rfc4590 Digest-Nextnonce rfc4590 Digest-Method rfc4590 Digest-URI rfc4590 Digest-Qop rfc4590 Digest-Algorithm rfc4590 Digest-Entity-Body-Hash rfc4590 Digest-CNonce rfc4590 Digest-Nonce-Count rfc4590 Digest-Username rfc4590 Digest-Opaque rfc4590 Digest-Auth-Param rfc4590 Digest-AKA-Auts rfc4590 Digest-Domain rfc4590 Digest-Stale rfc4590 Digest-HA1 rfc4590 SIP-AOR rfc4675 Egress-VLANID rfc4675 Ingress-Filters rfc4675 Egress-VLAN-Name rfc4675 User-Priority-Table rfc4679 Sub-attribute rfc4679 Agent-Circuit-Id rfc4679 Agent-Remote-Id rfc4679 Actual-Data-Rate-Upstream rfc4679 Actual-Data-Rate-Downstream rfc4679 Minimum-Data-Rate-Upstream rfc4679 Minimum-Data-Rate-Downstream rfc4679 Attainable-Data-Rate-Upstream rfc4679 Attainable-Data-Rate-Downstream rfc4679 Maximum-Data-Rate-Upstream rfc4679 Maximum-Data-Rate-Downstream rfc4679 Minimum-Data-Rate-Upstream-Low-Power rfc4679 Minimum-Data-Rate-Downstream-Low-Power rfc4679 Maximum-Interleaving-Delay-Upstream rfc4679 Actual-Interleaving-Delay-Upstream rfc4679 Maximum-Interleaving-Delay-Downstream rfc4679 Actual-Interleaving-Delay-Downstream rfc4679 Access-Loop-Encapsulation rfc4679 IWF-Session rfc4849 NAS-Filter-Rule rfc5080 Interim-Accounting-Interval rfc5080 Link-Local rfc5247 Lower-Layer rfc5247 Parent-Child rfc5247 Denial-of-Service rfc5281 EAP-TTLS rfc5281 MS-CHAP rfc5281 MS-CHAP-V2 rfc5281 Session-Id rfc5281 Peer-Id rfc5281 Server-Id rfc5281 Negotiating-Down rfc5580 Operator-Name rfc5580 Location-Information rfc5580 Location-Data rfc5580 Basic-Location-Policy-Rules rfc5580 Extended-Location-Policy-Rules rfc5580 Location-Capable rfc5580 Requested-Location-Info freeradius-server/debian/README.source000066400000000000000000000001171257552170400201230ustar00rootroot00000000000000 freeradius has a trivial quilt setup - see /usr/share/doc/quilt/README.source freeradius-server/debian/apache2.conf000066400000000000000000000020051257552170400201140ustar00rootroot00000000000000Alias /freeradius-dialupadmin /usr/share/freeradius-dialupadmin/htdocs Options Indexes FollowSymLinks php_flag register_globals off php_flag register_globals off # You may prefer a simple URL like http://dialupadmin.example.com # # DocumentRoot /usr/share/freeradius-dialupadmin/htdocs # ServerName dialupadmin.example.com # # redirect to https when available # # Note: There are multiple ways to do this, and which one is suitable for # your site's configuration depends. Consult the apache documentation if # you're unsure, as this example might not work everywhere. # # # # # RewriteEngine on # RewriteCond %{HTTPS} !^on$ [NC] # RewriteRule . https://%{HTTP_HOST}%{REQUEST_URI} [L] # # # freeradius-server/debian/changelog000066400000000000000000001117301257552170400176220ustar00rootroot00000000000000freeradius (2.2.8+git) unstable; urgency=medium * New upstream version. -- Arran Cudbard-Bell Thu, 30 April 2014 11:35:00 +0100 freeradius (2.2.7+git) unstable; urgency=medium * New upstream version. -- Arran Cudbard-Bell Tue, 18 Nov 2014 11:35:00 +0100 freeradius (2.2.6+git) unstable; urgency=medium * New upstream version. -- Arran Cudbard-Bell Tue, 18 Nov 2014 11:34:00 +0100 freeradius (2.2.5+git) unstable; urgency=medium * New upstream version. -- Arran Cudbard-Bell Thu, 20 Mar 2013 11:34:00 +0100 freeradius (2.2.4+git) unstable; urgency=medium * New upstream version. -- Arran Cudbard-Bell Mon, 16 Dec 2013 12:43:49 +0100 freeradius (2.2.3+git) unstable; urgency=medium * New upstream version. -- Arran Cudbard-Bell Mon, 16 Dec 2013 12:43:00 +0100 freeradius (2.2.2+git) unstable; urgency=medium * New upstream version. -- Alan DeKok Wed, 30 Oct 2013 9:30:00 -0400 freeradius (2.2.1+git) unstable; urgency=medium * New upstream version. -- Arran Cudbard-Bell Mon, 01 Oct 2012 17:13:00 +0100 freeradius (2.2.0+git) unstable; urgency=medium * New upstream version. -- Alan DeKok Sat, 18 Jan 2012 10:45:03 +0100 freeradius (2.1.12+git) unstable; urgency=medium * New upstream version. -- Alan DeKok Sat, 18 Jan 2012 10:45:03 +0100 freeradius (2.1.11+git) unstable; urgency=medium * New upstream version. -- Alan DeKok Sat, 18 Jun 2011 10:45:03 +0100 freeradius (2.1.10+git) unstable; urgency=medium * New upstream version. -- Alan DeKok Sat, 02 Jan 2010 20:22:47 +0100 * New upstream version. freeradius (2.1.8+dfsg-1) unstable; urgency=medium * New upstream version. + Fixes several showstopper bugs, hence increased urgency. + Includes OpenSSL+GPL license exception, closes: #499120. + Fixes typo in a warning, closes: #523074. * Added libssl-dev into build-depends and enabled the building of modules that just depend on OpenSSL, namely rlm_eap_peap, rlm_eap_tls, rlm_eap_ttls, and rlm_otp, closes: #266229. * Because the configuration of EAP+SSL modules now actually kicks in, its non-existent certificate file would break the server start by default. Depend on ssl-cert, make use of make-ssl-cert and openssl, and add freerad to the ssl-cert group in the postinst to get us past the problematic default settings so that we don't crash and burn on clean upgrades, but otherwise leave everything else to the admin. * Ship /etc/freeradius/attrs.access_challenge, like the others. * Moved otp.conf and snmp.conf statoverride handling to the preinst and used rm_conffile on them as well. * Updated upstream changelog handling a bit. -- Josip Rodin Sat, 02 Jan 2010 20:22:47 +0100 freeradius (2.1.7+dfsg-2) unstable; urgency=low * Ship radmin and raddebug in the freeradius package. * Correct section number inside raddebug(8) so it doesn't get misplaced. -- Josip Rodin Tue, 24 Nov 2009 15:29:59 +0100 freeradius (2.1.7+dfsg-1) unstable; urgency=low * Adopting the package, closes: #536623. * New upstream version, closes: #513484. + Fixes the blooper in unlang evaluation logic, closes: #526175. * Used quilt (and added README.source), and moved upstream file patching into debian/patches/. The source is no longer in collab-maint git (to make it simpler for me to finally get this out the door), but kept the .gitignore should we need that again. * Dropped the dialup_admin/bin/backup_radacct patch (integrated upstream). * Dropped the raddb/Makefile patch (problem no longer exists upstream). * Dropped the lib/packet.c lib/radius.c main/listen.c patches (was from upstream 2.0.5 anyway). * Dropped references to otp.conf, it no longer exists upstream. Keep removing the conffile statoverride in prerm. * Dropped references to snmp.conf, it no longer exists upstream. Keep removing the conffile statoverride in prerm. * Ship /etc/freeradius/modules/* in the freeradius package. * Stop shipping sites-enabled symlinks in the package and instead create them only on initial install, thanks to Matej Vela, closes: #533396. * Add export PATH="${PATH:+$PATH:}/usr/sbin:/sbin" to the init script at the request of John Morrissey, closes: #550143. * Stop installing /var/run/freeradius in the package to silence Lintian. The init script already recreates it at will. * Remove executable bit from example.pl to silence Lintian. -- Josip Rodin Mon, 23 Nov 2009 03:57:37 +0100 freeradius (2.0.4+dfsg-7) unstable; urgency=low * Ignore rmdir failure on clean (closes: #545932) * Do a better job of catching errors in the init script (closes: #533390) * Init headers fixup (closes: #541882) * Clean up some logs so dpkg can successfully rmdir (closes: #530727) -- Stephen Gran Sun, 13 Sep 2009 19:33:12 +0100 freeradius (2.0.4+dfsg-6) unstable; urgency=low * Fix unsafe use of tempfile (closes: #496389) -- Stephen Gran Mon, 25 Aug 2008 14:18:48 +0100 freeradius (2.0.4+dfsg-5) unstable; urgency=low [ Mark Hymers ] * Cherry pick commit from 2.0.5 which fixes port binding issues. Closes: #489773. [ Stephen Gran ] * add PERL_SYS_INIT3 and PERL_SYS_TERM calls to rlm_perl. (closes: #495073) * Make the SQL modules link against rlm_sql.so in the most horrific (and only) way possible. (closes: #448699) -- Stephen Gran Thu, 14 Aug 2008 19:15:30 +0100 freeradius (2.0.4+dfsg-4) unstable; urgency=low * Create links from sites-enabled to sites-available for the files that upstream enables by default (closes: #483914) -- Stephen Gran Sun, 01 Jun 2008 12:24:35 +0100 freeradius (2.0.4+dfsg-3) unstable; urgency=low * brown paper bag release * Really actually do the statoverride I thought we were doing with -2 (closes: #482380) -- Stephen Gran Thu, 22 May 2008 11:18:12 +0100 freeradius (2.0.4+dfsg-2) unstable; urgency=low * Install /var/log/freeradius 0750 so that people writing their passwords to logfiles don't accidentally leak them without noticing (closes: #482085) -- Stephen Gran Tue, 20 May 2008 19:38:27 +0100 freeradius (2.0.4+dfsg-1) unstable; urgency=low * Ok, actually remove all the cruft in debian/ shipped by upstream. This means repacking the tarball and all that, but it also means dpkg-source won't get the chance to ignore removed files, resulting in files reappearing, but not locally (closes: #481406) * Also remove config.{cache,log} in clean target - damn you gitignore -- Stephen Gran Mon, 19 May 2008 03:55:55 +0100 freeradius (2.0.4-3) unstable; urgency=low * I have no god damn idea why the buildds are adding manpages to the wrong binary. Reuploading with DH_VERBOSE=1 to see if we can find it. We certainly can't reproduce it in our local builds, even calling the same targets in the same order as the buildds. -- Stephen Gran Mon, 19 May 2008 00:17:06 +0100 freeradius (2.0.4-2) unstable; urgency=low * freeradius-{common,utils} needs to Conflict: with other radius implementations that share files (closes: #480682) -- Stephen Gran Sun, 11 May 2008 18:41:45 +0100 freeradius (2.0.4-1) unstable; urgency=low * New upstream release * Make all directories in /etc/freeradius group +x (closes: #479835) -- Stephen Gran Fri, 09 May 2008 12:58:55 +0100 freeradius (2.0.3-1) unstable; urgency=low [ Mark Hymers ] * New upstream release * Bump Build-Dep on debhelper to 6.0.7 as we use dh_lintian * Delete lots of obsolete conffiles [ Stephen Gran ] * Create a -common package for some extra file that the -utils package needs. Also stuff in manpages and other arch all files to reduce the size of the unnecessarily repeated stuff in the archive * Change chown/chmod calls to dpkg-statoverride -- Mark Hymers Sat, 03 May 2008 17:07:42 +0100 freeradius (2.0.2-1) unstable; urgency=low * Yet another new upstream version (closes: #465475) * Cleanup manpages * Add lintian overrides for rpath - this is intentional * Packaging is now being done in git, we're dropping dpatch * Split out client utilities (closes: #470977) - this means we also need to split the library so the two binary packages can use it * Major package rework -- Stephen Gran Sun, 16 Mar 2008 22:58:16 +0000 freeradius (2.0.0-1) unstable; urgency=low * New upstream version * Patches: - freshen 02-radiusd-to-freeradius - disable 03-dialupadmin-help until it's reworked properly -- Stephen Gran Thu, 10 Jan 2008 23:05:50 +0000 freeradius (1.1.7-1) unstable; urgency=low * New upstream version * Update debian/copyright to reflect reality: - package is GPL v2 only, so refer to the correct file in common-licenses - Remove explanation of wy postgres and snmp modules can't be shipped, since we do ship them. * Remove 04-configure-openssl.dpatch, --without-openssl applied upstream -- Stephen Gran Thu, 09 Aug 2007 10:09:20 +0100 freeradius (1.1.6-4) unstable; urgency=low The "Give me GPLv2 compatibility or give me FTBFS" release * Fix rlm_krb5 not to link with openssl unless it actually needs to * debian/rules: move dependency on patch target to config.status * debian/rules: FTBFS if a package accidentally directly links to openssl -- Stephen Gran Wed, 04 Jul 2007 17:08:45 +0100 freeradius (1.1.6-3) unstable; urgency=low * Change freeradius-dbg to Priority: extra. * After discussions with one of the ftp-assistants, we can ship freeradius-postgresql in main. Yey! (Closes: #264649, #382329) -- Mark Hymers Thu, 21 Jun 2007 13:32:09 +0100 freeradius (1.1.6-2) unstable; urgency=low [ Mark Hymers ] * Add freeradius-dbg package. [ Stephen Gran ] * Update debian/control for php5 (dialupadmin) (closes: #424788, #412701) -- Stephen Gran Thu, 31 May 2007 02:47:02 +0100 freeradius (1.1.6-1) unstable; urgency=low * New upstream release. Closes: #420003. -- Mark Hymers Thu, 19 Apr 2007 15:14:05 +0100 freeradius (1.1.5-1) unstable; urgency=low * New upstream release. Closes: #415980 * Remove 01-fix-proxy.dpatch as it was a backport from upstream. * otppasswd.sample is no longer provided so make sure we remove the conffile properly in preinst. * Update my email address and remove Paul from Uploaders. Thanks to him for previously maintaining the package. * Change so that we start at S50 and stop at K19 so that we start after services we depend on and stop before them. Closes: #408665. Note that is only for new installs. -- Mark Hymers Fri, 13 Apr 2007 13:14:08 +0100 freeradius (1.1.3-3) unstable; urgency=medium * Fix POSIX compliance problem in init script. Closes: #403384. -- Mark Hymers Sat, 16 Dec 2006 20:45:11 +0000 freeradius (1.1.3-2) unstable; urgency=low [ Stephen Gran ] * Check for existence of pidfile in initscript. * Clean some old cruft from debian/rules * Write dialup_admin/Makefile * Make binNMU safe * Some lsb init headers [ Mark Hymers ] * Merge upstream patch to deal with proxy port settings. Closes: #388024. * Rewrite large parts of the Debian build system. -- Stephen Gran Sat, 7 Oct 2006 21:08:35 +0100 freeradius (1.1.3-1) unstable; urgency=low [ Stephen Gran ] * Add and rework ubuntu /var/run/tmpfs patch * Add LSB init script headers * Actually trap errors in init script, how about? [ Mark Hymers ] * New upstream version. * New version of autotools in 1.1.3. Closes: #380204 * Remove previous patches merged upstream: - 01-actually_check_for_unset_password.dpatch * Only do user creation, group addition, chmod and chown stuff in postinst on an initial install to avoid clobbering local changes. -- Mark Hymers Wed, 23 Aug 2006 14:48:57 +0100 freeradius (1.1.2-2) unstable; urgency=low [ Stephen Gran ] * Acknowledge my previous NMU's (closes: #351732, #359042) * Init scripts overhaul: - now use reload on upgrade of modules - replace sleep statements with --retry, as time based tests are fragile - no longer exit with an error if stop fails because the daemon isn't running (closes: #374670, #351735) - stop using command -v in /bin/sh scripts * General maintainer script overhaul: - Don't rm -rf something in /etc (ouch) - Use chown -R instead of 'find .. -exec' - should not need to manually remove the init script on purge (it's a dpkg managed conffile) - Only do user management stuff if user is missing. No point rerunning it every upgrade. - Install /etc/freeradius/dictionary with relaxed permissions, but never touch it again (closes: #334299) - switch to debhelper files where possible. I like an easy to read Makefile. * Arg. Move README.rfc to the freeradius package where it belongs. [ Mark Hymers ] * Document building SSL/PostgreSQL modules in debian/rules, add control.postgresql to make it more convenient. Tested on AMD64 using system libtool. -- Stephen Gran Sun, 25 Jun 2006 23:06:16 +0100 freeradius (1.1.2-1) unstable; urgency=low [ Mark Hymers ] * New maintainers * New upstream version. * Remove previous patches merged upstream: - 01_NET-SNMP_build_support.dpatch - 02_document_actual_shared_secret_maximum_length.dpatch - 12_more_dialup_admin_various_fixes.dpatch - 14_broken_parse.dpatch - 15_CVE-2006-1354.dpatch * Use --with-system-libtool during configure. Add B-D: on libtool Removes obsolete dpatches: - 06_libtool14_vs_rlm_eap_tls.dpatch - 13_a_libtool_to_call_your_own.dpatch * Remove freeradius.undocumented as we don't install links to undocumented(7) anymore (not recommended since policy 3.5.8.0) [ Stephen Gran ] * Update to Standards Version 3.7.2 (no changes) * Remove doc/rfc/ to make -legal happy (closes: #365192) - this means repacked tarball. See README.rfc for details * Test for unset variable, rather than empty variable in clean_radacct, monthly_tot_stats and truncate_radacct (closes: #374053) -- Mark Hymers Sat, 17 Jun 2006 16:05:19 +0100 freeradius (1.1.0-1.2) unstable; urgency=high * Non-maintainer upload. * [ CVE-2006-1354 ]: src/modules/rlm_eap/types/rlm_eap_mschapv2/rlm_eap_mschapv2.c: Due to insufficient input validation it is possible for a remote attacker to bypass authentication or cause a denial of service. (closes: #359042) -- Stephen Gran Wed, 17 May 2006 11:22:28 -0500 freeradius (1.1.0-1.1) unstable; urgency=low * Non-maintainer upload. * Upstream patch to fix parsing config file (closes: #351732) Fixes: fails to start on amd64 (error in dictionary parsing code) -- Stephen Gran Sat, 1 Apr 2006 11:07:55 +0100 freeradius (1.1.0-1) unstable; urgency=low * ReDebianise upstream tarball: - Deleted RFCs: 2243 2289 2433 2548 2618 2619 2620 2621 2716 2759 2809 2865 2866 2867 2868 2869 2882 2924 3162 3575 3576 3579 3580 draft-kamath-pppext-eap-mschapv2-00 * New FreeRADIUS modules marked stable by new upstream release - rlm_perl - rlm_sqlcounter - rlm_sql_log + radsqlrelay - rlm_otp (formerly rlm_x99_token, not built as it depends on OpenSSL) * Remove upstream-integrated patches: - 02_EAP-SIM_doesnt_need_openssl - 03_X99_is_not_stable - 07_manpage_fixups - 09_use_crypth_if_we_have_it - 10_escape_entire_ldap_string - 11_dont_xlat_possibly_bad_usernames_in_bad_accounting_packets - 12_dialup_admin_various_fixes * More dialup-admin fixes from Arve Seljebu - Fix redirects in dialup-admin pages on servers with register_globals turned off. Closes: #333704 - HTTP form fields will always fail is_int, use in_numeric instead Closes: #335149 - Created 12_more_dialup_admin_various_fixes * Update to Policy 3.6.2.0 * Upgrade Debhelper support to V5 * Don't install the .in files with the examples * Prefer libmysqlclient15-dev Closes: #343779 * Shared secrets can only be 31 characters long, note this in clients.conf - Created 02_document_actual_shared_secret_maximum_length Closes: 344606 * Added support for lsb-init functions -- Paul Hampson Sun, 15 Jan 2006 13:34:13 +1100 freeradius (1.1.0-0) unstable; urgency=low * New upstream release. * Update set of patches: - 01_NET-SNMP_build_support.dpatch - 06_libtool14_vs_rlm_eap_tls.dpatch - 13_a_libtool14_to_call_your_own.dpatch -- Nicolas Baradakis Sun, 1 Jan 2006 18:15:47 +0100 freeradius (1.0.5-2) unstable; urgency=low * Stop dragging non-PIC code from libeap.a into rlm_eap_sim.so and rlm_eap.so. (Thanks to Peter Salinger) Closes: #288547 - Rename 06_libtool14_vs_rlm_eap_tls to 06_libtool14_vs_rlm_eap and modify with Peter's changes and some Makefile hackery to get it all linking * Don't rerun configure during the build. (Thanks to Kurt Roeckx) * A whole bunch of dialup-admin fixes from Arve Seljebu and Tobias - Report correct data transfer statistics for users Closes: #329672 - Lower-case sql column names to match creation scripts Closes: #333709 - Fix creation of empty groups Closes: #333739 - Put quote around usernames in HTML output Closes: #333742 - Properly notice when we've got a blank password to SQL Closes: #333744 - Created 12_dialup_admin_various_fixes * Stop using libtool1.4 to build against, now that we can't have it and libltdl3-dev installed at the same time Closes: #279391 - Created 13_a_libtool14_to_call_your_own to get most recent ltmain.sh -- Paul Hampson Sun, 16 Oct 2005 21:26:30 +1000 freeradius (1.0.5-1) unstable; urgency=high * Urgency high for security fixes below, all reported upstream * ReDebianise upstream tarball: - Deleted RFCs: 2243 2289 2433 2548 2618 2619 2620 2621 2716 2759 2809 2865 2866 2867 2868 2869 2882 2924 3162 3575 3576 3579 3580 draft-kamath-pppext-eap-mschapv2-00 * Add missed build-dependancy on dpatch (>=2) * Update to Standards-Version 3.6.2.0 - No changes needed * Repair some minorly broken manpages - Created 07_manpage_fixups.dpatch * Security fixes stolen from CVS release_1_0 branch: - Be sure we use crypt.h if we have it, to avoid segfaulting on a bad built-in crypt() definition, spotted by Konstantin Kubatkin + Created 09_use_crypth_if_we_have_it - Make sure we escape the entire LDAP string, instead of aborting as soon as it becomes possible to be out of space + Created 10_escape_entire_ldap_string - Don't xlat the UserName attribute before we can be sure of meeting any escape sequences it may contain, spotted by Primoz Bratanic + Created 11_dont_xlat_possibly_bad_usernames_in_bad_accounting_packets * Depend on adduser, so our postinst can create the freerad user * Don't install the .in versions of the example scripts. -- Paul Hampson Mon, 19 Sep 2005 15:10:40 +1000 freeradius (1.0.5-0) unstable; urgency=low * New Upstream release, from release_1_0 branch - Remove 04_bonus_control_code_in_clients_conf_5 - Remove 05_unbreak_quoted_sql_results * Fix my _name_ in the dpatches * Remove patch to CVS ID header from 05_unbreak_quoted_sql_values so as not to break things when comitting to FreeRADIUS CVS * Take linking fix from FreeRADIUS bugzilla #75 to allow rlm_eap_tls to be linked to by rlm_eap_ttls and rlm_eap_peap even though we don't build them in the Debian archive. (Thanks to Luca Landi for the patch) - Created 06_libtool14_vs_rlm_eap_tls * Fix ownership of files in /var/log/freeradius/ more efficiently (Caught by Guido Trotter) Closes: #326891 -- Paul Hampson Wed, 7 Sep 2005 01:08:07 +1000 freeradius (1.0.4-2) unstable; urgency=low * Fix my email address in the dpatches * Remove extraneous ^g from man/man5/clients.conf.5 - Created 04_bonus_control_code_in_clients_conf_5 * Correct handing of parameterless call of init script, and general init script neatening (Thanks to Derrick Karpo) Closes: #315438 * Correctly leave out the .in files in the examples * Correctly use debhelper after splitting binary make target into binary-arch and binary-indep. (Thanks to Kurt Roeckx for actually hitting the bug) Closes: #315770 * Steal fix from CVS release_1_0 tree for rlm_sql quoted values. (Thanks to Nicolas Baradakis for the fix) - Upstream bugzilla #242, src/modules/rlm_sql/sql.c 1.79.2.2 - Created 05_unbreak_quoted_sql_values -- Paul Hampson Mon, 27 Jun 2005 03:13:48 +1000 freeradius (1.0.4-1) unstable; urgency=low * ReDeianise upstream tarball: - Deleted RFCs: 2243 2289 2433 2548 2618 2619 2620 2621 2716 2759 2809 2865 2866 2867 2868 2869 2882 2924 3162 3575 3576 3579 3580 draft-kamath-pppext-eap-mschapv2-00 * Convert to dpatch, dpatch-2-style interface. - New build-dependancy on dpatch (>= 2) - Created 01_NET-SNMP_build_support - Created 02_EAP-SIM_doesnt_need_openssl - Created 03_X99_is_not_stable * Assemble the freeradius-dialupadmin in the binary-indep make target Closes: #313173 (Thanks to Santiago Vila for spotting this) * Include the example scripts in /usr/share/doc/freeradius/examples/scripts except those three which are installed into the binary by the Makefile. Closes: #314253 (Thanks to Michael Langer for spotting this) * Suggest libdate-manip-perl for freeradius-dialupadmin Closes: #306007 (Thanks to Feng Sian) -- Paul Hampson Wed, 22 Jun 2005 16:03:27 +1000 freeradius (1.0.4-0) unstable; urgency=medium * New upstream release, fixing build problems. * Prefer libpq-dev over postgresql-dev as a build-dependancy. - This requires us to use pgconfig to find the headers. -- Paul Hampson Thu, 16 Jun 2005 13:56:33 +1000 freeradius (1.0.3-0) unstable; urgency=high * New upstream release * Urgency high for some denial-of-service fixes: - SQL injection attacks and DoS (core dump) via buffer overflow. Closes: #307720 -- Alan DeKok Fri, 3 Jun 2005 11:29:34 -0700 freeradius (1.0.2-4) unstable; urgency=high * Security fix stolen from CVS release_1_0 branch: - Always use sql_escape_func when calling radius_xlat - Add a test in sql_escape_func() to check buffer bound when input character needs escaping. - Urgency high as these are (theoretical) security issues. Closes: #307720 (Thanks to Primoz Bratanic and Nicolas Baradakis) -- Paul Hampson Mon, 23 May 2005 18:53:51 +1000 freeradius (1.0.2-3) unstable; urgency=medium * Fixes stolen from CVS release_1_0 branch: - Fix missed SIGCHLD when waiting for external programs when threaded. (Medium urgency as this can easily livelock FreeRADIUS, which is an authentication server.) -- Paul Hampson Mon, 18 Apr 2005 23:46:41 +1000 freeradius (1.0.2-2) unstable; urgency=medium * Get rid of extraneous '%' at the start of every reference to /etc/freeradius-dialupadmin in freeradius-dialupadmin's configuration. Closes: #299749 * Fixes stolen from CVS release_1_0 branch: - Fix checkrad call for NAS ports > 9999999. (sprintf integer overrun, reason for urgency medium.) - Fix inverted test causing crash with pthreads and crypt Closes: #300219 (Thanks Manuel Menal) -- Paul Hampson Wed, 6 Apr 2005 12:33:05 +1000 freeradius (1.0.2-1) unstable; urgency=low * ReDebianise upstream tarball: - Deleted RFCs: 2243 2289 2433 2548 2618 2619 2620 2621 2716 2759 2809 2865 2866 2867 2868 2869 2882 2924 3162 3575 3576 3579 3580 * Allow rlm_eap_sim to build without OpenSSL * Make init script return 1 if reloading kills the server (Thanks to Nicolas Baradakis) Closes: #292170 * Enable Novell eDirectory integration * Enable udpfromto code so that replies come from the same address as the request arrived at * Build-depend on libmysqlclient12-dev as libmysqlclient10 has problems accessing 4.0 series mySQL servers, and libmysqlclient12 can access 4.1 series mySQL servers. -- Paul Hampson Fri, 4 Mar 2005 09:30:40 +1100 freeradius (1.0.2-0) unstable; urgency=low * New upstream release * Update for Debian Policy 3.6.1.1 - Change test if invoke-rc.d as per Policy 9.3.3.2 * freeradius-dialupadmin Suggests php4-mysql | php4-pgsql Closes: #279419 * Added a two-second pause to restart in init.d script Closes: #262635 * FreeRADIUS module packages now depend on the same source version of the main FreeRADIUS package. Closes: #284353 * FreeRADIUS-dialupadmin's default paths in admin.conf are now correct. Closes: #280942 * FreeRADIUS-dialupadmin's help.php3 can now find README. Closes: #280941 -- Paul Hampson Wed, 29 Dec 2004 20:12:52 +1100 freeradius (1.0.1-2) unstable; urgency=high * freeradius-dialupadmin Suggests php4-mysql | php4-pgsql Closes: #279419 * Added a two-second pause to restart in init.d script Closes: #262635 * FreeRADIUS module packages now depend on the same source version of the main FreeRADIUS package. Closes: #284353 * FreeRADIUS-dialupadmin's default paths in admin.conf are now correct. Closes: #280942 * FreeRADIUS-dialupadmin's help.php3 can now find README. Closes: #280941 * Fixes stolen from 1.0.2 CVS: - Bug fix to make udpfromto code work - radrelay shouldn't dump core if it can't read a VP from the detail file. - Only initialize the random pool once. - In rlm_sql, don't escape characters twice. - In rlm_ldap, only claim Auth-Type if a plain text password is present. - Locking fixes in threading code - Fix building on gcc-4.0 by not trying to access static auth_port from other files. -- Paul Hampson Wed, 29 Dec 2004 20:19:42 +1100 freeradius (1.0.1-1) unstable; urgency=high * ReDebianise upstream tarball: - Deleted RFCs: 2243 2289 2433 2548 2618 2619 2620 2621 2716 2759 2809 2865 2866 2867 2868 2869 2882 2924 3162 3575 3576 3579 3580 - Remove CVS directories. * Urgency high for security fix from 1.0.1-0 (CAN-2004-0938, closes: #275136). -- Paul Hampson Thu, 23 Sep 2004 22:28:11 +1000 freeradius (1.0.1-0) unstable; urgency=high * New upstream release * Urgency high for some denial-of-service fixes: - Fix two remote crashes and a remote memory leak in radius packet decoding. -- Paul Hampson Thu, 2 Sep 2004 17:12:23 +1000 freeradius (1.0.0-1) unstable; urgency=low * ReDebianise upstream tarball: - Deleted RFCs: 2243 2289 2433 2548 2618 2619 2620 2621 2716 2759 2809 2865 2866 2867 2868 2869 2882 2924 3162 3575 3576 3579 3580 * Support building with libsnmp5's UCD-SNMP compatiblity mode. - libsnmp{4.2,5} still depend on OpenSSL, so SNMP's still disabled. * Update for Debian Policy 3.6.11 - Change test for invoke-rc.d as per Policy 9.3.3.2 * Disable rlm_eap types PEAP, TLS and TTLS as they depend on OpenSSL. * Disable rlm_sql driver PostgreSQL as it depends on OpenSSL. * Disable rlm_x99_token as it depends on OpenSSL. * Finally, -v is documented in radius(8). - Closes: #151266 * Reword a sentence in radwatch(8) by removing the personal pronoun. - Closes: #264522 -- Paul Hampson Tue, 17 Aug 2004 17:42:40 +1000 freeradius (1.0.0-0) unstable; urgency=low * New upstream release * Added H323 billing stuff to the examples * Created Dialup-Admin package for the PHP-based web FreeRADIUS database (SQL/LDAP) frontend. -- Paul Hampson Sat, 17 Jul 2004 16:21:38 +1000 freeradius (0.9.3-1) unstable; urgency=low * New upstream release, incorporates security fix from 0.9.2-4. * Correct build-dependancy on debhelper. Closes: #234486 * Split iodbc SQL driver into its own package. -- Paul Hampson Tue, 24 Feb 2004 23:56:26 +1100 freeradius (0.9.2-4) unstable; urgency=high * Patch from upstream head: - Fix a remote DoS and possible exploit due to mis-handling of tagged attributes, and Tunnel-Password attribute. -- Paul Hampson Fri, 21 Nov 2003 09:52:51 +1100 freeradius (0.9.2-3) unstable; urgency=low * Removed redundant code to delete contents of a directory on purge which ends up being removed anyway. * Provide a default pam.d configuration. * Fix the usage of dh_installinit to not make the package uninstallable. * Change package removal to not abort if we cannot stop the server. * Debian-archive-fit version of freeradius. Closes: #208620 -- Paul Hampson Tue, 11 Nov 2003 02:12:55 +1100 freeradius (0.9.2-2) unstable; urgency=low * Use dh_installinit rather than doing it by hand This involves renaming the initfile in the source tarball * Only add user freerad to the group shadow on first installation * Only chmod /etc/freeradius to group-readable, not group-read/write * Removed the freerad user when the freerad group is removed * Removed spurious build-dependancy on autoconf2.13 and libtool(1.4) * Build-conflict against libssl-dev * Restore Kerberos and LDAP as they will build without OpenSSL * Make myself the maintainer * Update to Policy 3.6.1.0 - No changes needed -- Paul Hampson Sun, 9 Nov 2003 00:07:52 +1100 freeradius (0.9.2-1) unstable; urgency=low * Deleted RFCs: 2243 2289 2433 2548 2618 2616 2620 2621 2719 2759 2809 2865 2866 2867 2868 2869 2882 2924 3162 from source tarball due to non-DFSG-free copyright. * Disabled PostgreSQL, x.99 token, EAP/TLS, Kerberos, LDAP and SNMP agent support due to OpenSSL/GPL conflict. -- Paul Hampson Thu, 6 Nov 2003 22:40:32 +1100 freeradius (0.9.2-0) unstable; urgency=low * New upstream release * Added logrotate script for /var/log/freeradius/radius.log * Don't leave symlinks to config.{guess,sub} lying around to confuse dpkg-source. -- Paul Hampson Wed, 15 Oct 2003 05:02:17 +1000 freeradius (0.9.1-0) unstable; urgency=low * New upstream release. * Renamed radiusd(8) to freeradius(8) to match binary * Build-Depend on libtool1.4 | libtool (< 1.5) due to new libtool 1.5 package. * Merged multiple sed calls into a single sed call in debian/rules * Installed SQL database examples into /usr/share/doc/freeradius/examples * Modify initscript to only -HUP the parent process -- Paul Hampson Fri, 5 Sep 2003 00:54:41 +1000 freeradius (0.9.0-1) unstable; urgency=low * New Upstream release. - Upstream dictionary files are in /usr/share/freeradius. - Modified to 'configure{,.in}' to work with openssl 0.9.7 and 0.9.6 * Renamed pacakges to 'freeradius*' from 'radiusd-freeradius*'. * Moved file hierarchy around to be neater: - /etc/raddb -> /etc/freeradius - /usr/share/doc/radiusd-freeradius -> /usr/share/doc/freeradius - /var/log/radiusd-freeradius -> /var/log/freeradius - /var/run/radiusd/radiusd.pid -> /var/run/freeradius/freeradius.pid * Included RFCs in documentation. * Enabled the daemon to run under user 'freerad:freerad' by default. * Added support for DEB_BUILD_OPTIONS for policy 3.5.9 compliance. * Installed SNMP mibs for Radius -- Paul Hampson Sun, 20 Jul 2003 06:56:28 +1000 radiusd-freeradius (0.7+cvs20021113-1) unstable; urgency=low * Explicitly excluding modules not in the "stable" list. * Updated policy version number. * Moved from non-US/main to main. * Put pidfile in package's own directory. * Package not as buggy and unstable modules are easily identifiable. (closes: Bug#142217) * Init script handles failure better. (closes: Bug#151264) * New upstream release. (closes: Bug#140536) * Uses available version of postgresql. (closes: Bug#139290) * Removed "conflicts" with other radiusds. * Added new build-dep on libtool. * Changed section to "net" from "admin". * New config.guess. (closes: Bug#168647) * Run with freerad user and group. (closes: Bug#168272) * Added libssl-dev as build-dep. (closes: #131832) -- Chad Miller Wed, 13 Nov 2002 17:01:19 -0500 radiusd-freeradius (0.5+cvs20020408-1) unstable; urgency=high * New build-dep on libssl-dev, which is implied by another dep, but making explicit for builders on Potato. (closes: Bug#131832) * Built against new postgresql libraries, so automatic dep tracking has the correct version, now. (closes: Bug#139290) * Removed python example module. * Explicitly disabled beta ippool module. -- Chad Miller Mon, 8 Apr 2002 11:48:30 -0400 radiusd-freeradius (0.4-1) unstable; urgency=high * New release. * upstream: New EAP support. * upstream: Fixed security bug in string translation. -- Chad Miller Thu, 13 Dec 2001 09:26:45 -0500 radiusd-freeradius (0.3-2) unstable; urgency=low * Moved to using logrotate instead of cron for files. * Fixed permissions of log files. (closes: Bug#116242,#116243) * Close file descriptors of stdin, stdout, stderr, if not debugging. (closes: Bug#116768) * Made package "non-native". (An upload issue, not code.) (closes: Bug#119161) -- Chad Miller Tue, 20 Nov 2001 10:50:20 -0500 radiusd-freeradius (0.3-1) unstable; urgency=low * New release. -- Chad Miller Tue, 9 Oct 2001 18:16:23 -0400 radiusd-freeradius (0.2+20010917-1) unstable; urgency=low * Removed old mysql build-dep. (closes: Bug#112541) -- Chad Miller Mon, 17 Sep 2001 11:38:24 -0400 radiusd-freeradius (0.2+20010912-1) unstable; urgency=low * Build-dep mysql changed package names. * Added build-dep for libmysqlclient10-dev. (closes: Bug#111880) * In acct_users, keep reply pairs. * Integer values are printed as unsigned numbers, to comply with RFC2866. * Fixed broken/reversed auth comparisons in SQL module. * Sucked out CPPness from inside a printf, as printf is a macro in newer compilers (gcc3.0, e.g.). (closes: Bug#100889) * Sundry LDAP configuration, unresponsive thread, and proxying fixes. * Added user 'freerad' into the 'shadow' group. * Fixed UUCP-style of restricting time of log-in. * Changed debugging messages to give more info about execution flow. * Better counter module. * Inserted CHAP support for SQL modules. * Removed possible infinite loop. -- Chad Miller Wed, 12 Sep 2001 21:21:47 -0400 radiusd-freeradius (0.1+20010527-1) unstable; urgency=low * Updated config.{guess,sub} to recent versions. (closes: Bug#98183) * Updated build-dep to reflect supercession of libltdl0-dev by libltdl3-dev (closes: Bug#98914) -- Chad Miller Sun, 27 May 2001 11:44:40 -0400 radiusd-freeradius (0.1+20010517-1) unstable; urgency=low * Moved package to non-US to allow in Kerberos and PostgreSQL. * Set Suggests of modules to main package. * Better compile-time support of *BSD. -- Chad Miller Thu, 17 May 2001 14:46:51 -0400 radiusd-freeradius (0.1-1) unstable; urgency=low * First beta release! * Added generalized SQL support for ODBC, Oracle, MySQL, and Postgres. * Added shasta, microsoft, and redback dictionaries. * Fixed rc.d restart rule. * Added a user to own the daemon and logfiles. * SQL DB handles more forgiving of unreachable servers at startup. * SQL Crypt-Password attribute support. * Fixed cron log rotation. * Put module libraries in own directory. * Removed bogus build-dep. (closes: Bug#87277) * Better permissions on /etc/raddb * Use correct LDAP library. * Fork ldap, postgresql, and mysql modules into different packages. * Remove Kerberos, as it's restricted from export. -- Chad Miller Mon, 7 May 2001 16:37:46 -0400 radiusd-freeradius (0.0.20010109-1) unstable; urgency=low * Changed priority, from standard to optional. -- Chad Miller Tue, 9 Jan 2001 14:01:38 -0500 radiusd-freeradius (0.0.20001227-1) unstable; urgency=low * Initial revision. (closes: Bug#76476) -- Chad Miller Wed, 27 Dec 2000 11:58:56 -0500 freeradius-server/debian/compat000066400000000000000000000000021257552170400171430ustar00rootroot000000000000005 freeradius-server/debian/control000066400000000000000000000114111257552170400173460ustar00rootroot00000000000000Source: freeradius Build-Depends: debhelper (>= 6.0.7), quilt, dpkg-dev (>= 1.13.19), autotools-dev, libtool, libltdl3-dev, libssl-dev, libpam0g-dev, libmysqlclient-dev, libgdbm-dev, libldap2-dev, libsasl2-dev, libiodbc2-dev, libkrb5-dev, libperl-dev, libpcap-dev, python-dev, libsnmp-dev, libpq-dev, libssl-dev Section: net Priority: optional Maintainer: Josip Rodin Uploaders: Stephen Gran , Mark Hymers Standards-Version: 3.8.3 Homepage: http://www.freeradius.org/ Package: freeradius Architecture: any Depends: lsb-base (>= 3.1-23.2), ${shlibs:Depends}, freeradius-common, libfreeradius2 (= ${binary:Version}), ssl-cert, adduser Provides: radius-server Recommends: freeradius-utils Suggests: freeradius-ldap, freeradius-postgresql, freeradius-mysql, freeradius-krb5 Description: a high-performance and highly configurable RADIUS server FreeRADIUS is a high-performance RADIUS server with support for: - many vendor-specific attributes - proxying and replicating requests by any criteria - authentication on system passwd, SQL, Kerberos, LDAP, users file, or PAM - multiple DEFAULT configurations - regexp matching in string attributes and lots more. Package: freeradius-common Depends: adduser Architecture: all Conflicts: radiusd-livingston, xtradius, yardradius Replaces: freeradius (<< 2.0) Description: FreeRADIUS common files This package contains common files used by several of the other packages from the FreeRADIUS project. Package: freeradius-utils Architecture: any Replaces: freeradius (<< 2.0) Conflicts: radiusd-livingston, yardradius Depends: ${shlibs:Depends}, freeradius-common, libfreeradius2 (= ${binary:Version}) Recommends: libdbi-perl Description: FreeRADIUS client utilities This package contains various client programs and utilities from the FreeRADIUS Server project, including: - radclient - radeapclient - radlast - radsniff - radsqlrelay - radtest - radwho - radzap - rlm_dbm_cat - rlm_dbm_parser - rlm_ippool_tool - smbencrypt Package: libfreeradius2 Architecture: any Depends: ${shlibs:Depends} Description: FreeRADIUS shared library The FreeRADIUS projects' libfreeradius-radius and libfreeradius-eap, used by the FreeRADIUS server and some of the utilities. Package: libfreeradius-dev Architecture: any Section: libdevel Depends: ${shlibs:Depends}, libfreeradius2 (= ${binary:Version}) Description: FreeRADIUS shared library development files The FreeRADIUS projects' libfreeradius-radius and libfreeradius-eap, used by the FreeRADIUS server and some of the utilities. . This package contains the development headers and static library version. Package: freeradius-krb5 Architecture: any Depends: freeradius (= ${binary:Version}), ${shlibs:Depends} Description: kerberos module for FreeRADIUS server The FreeRADIUS server can use Kerberos to authenticate users, and this module is necessary for that. Package: freeradius-ldap Architecture: any Depends: freeradius (= ${binary:Version}), ${shlibs:Depends} Description: LDAP module for FreeRADIUS server The FreeRADIUS server can use LDAP to authenticate users, and this module is necessary for that. Package: freeradius-postgresql Architecture: any Depends: freeradius (= ${binary:Version}), ${shlibs:Depends} Description: PostgreSQL module for FreeRADIUS server The FreeRADIUS server can use PostgreSQL to authenticate users and do accounting, and this module is necessary for that. Package: freeradius-mysql Architecture: any Depends: freeradius (= ${binary:Version}), ${shlibs:Depends} Description: MySQL module for FreeRADIUS server The FreeRADIUS server can use MySQL to authenticate users and do accounting, and this module is necessary for that. Package: freeradius-iodbc Architecture: any Depends: freeradius (= ${binary:Version}), ${shlibs:Depends} Description: iODBC module for FreeRADIUS server The FreeRADIUS server can use iODBC to access databases to authenticate users and do accounting, and this module is necessary for that. Package: freeradius-dialupadmin Architecture: all Depends: php5 | libapache2-mod-php5 | php5-cgi, apache2-mpm-prefork | httpd, ${perl:Depends} Suggests: php5-mysql | php5-pgsql, php5-ldap, libdate-manip-perl Description: set of PHP scripts for administering a FreeRADIUS server These scripts provide a web-based interface for administering a FreeRADIUS server which stores authentication information in either SQL or LDAP. Package: freeradius-dbg Architecture: any Section: debug Priority: extra Depends: freeradius (= ${binary:Version}), ${shlibs:Depends}, ${misc:Depends} Description: debug symbols for the FreeRADIUS packages FreeRADIUS is a modular, high performance and feature-rich RADIUS server. This package contains the detached debugging symbols for the Debian FreeRADIUS packages. freeradius-server/debian/copyright000066400000000000000000000073341257552170400177070ustar00rootroot00000000000000This package was debianized by Chad Miller on Fri, 24 Nov 2000 16:25:57 -0500. The packaging was rearranged by Paul Hampson on Sun, 4 May 2003 03:51:20 +1000 The packaging was revamped by Stephen Gran on Sat, 15 Mar 2008 16:26:51 +0000. It was downloaded from http://www.freeradius.org/ FreeRADIUS is the result of the work done by a large number of people. The major contributors are listed here. Miquel van Smoorenburg Wrote the original Cistron server, and started the FreeRADIUS source tree. Alan DeKok Registered and maintains www.freeradius.org. Wrote the module code. Made the server threaded. Maintains the autoconf and libtool scripts for the server. Alan Curry Contributed many patches for proxying, replication, realm support. Mike Machado (mike@innercite.com) Author of the SQL module. Adrian Pavlykevych LDAP module. Jeff Carneal, Apex Internet Services, Inc. Wrote the caching support for the Unix module. miguel a.l. paraz Wrote the original code which was the basis for the PAM module. Jochen Friedrich SMUX / SNMP support. Nathan Neulinger Kerberos authentication module. Brandon Lee Poyner Netscape-MTA-MD5 authentication module. Chris Parker Configuration parser enhancments, 'rlm_attr_filter' module, and proxy enhancements. Kostas Kalevras Contributed the 'dialup_admin' PHP server administration code. Chris Brotsos Memory allocation debugging and proxy enhancements. Copyright: Copyright (C) 2000-2008 The FreeRADIUS Server Project Copyright (C) 1997-1999 Cistron Internet Services B.V. License: Except for /usr/lib/freeradius/libradius*, this package is licensed under the GNU GPL version 2. 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. On Debian systems, the complete text of the GNU General Public License can be found in /usr/share/common-licenses/GPL-2 file. -- /usr/lib/freeradius/libradius* is under the GNU LGPL version 2. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. On Debian systems, the complete text of the GNU Lesser General Public License can be found in /usr/share/common-licenses/LGPL. -- src/LICENSE.openssl includes a modification to the main LICENSE file, which is GPLv2. It applies only to the files in the "src" directory. (That directory contains the source code which has links to OpenSSL and from which the Debian binaries are produced.) In addition, as a special exception, the copyright holders give permission to link the code of this program with the OpenSSL library, and distribute linked combinations including the two. You must obey the GNU General Public License in all respects for all of the code used other than OpenSSL. If you modify file(s) with this exception, you may extend this exception to your version of the file(s), but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. If you delete this exception statement from all source files in the program, then also delete it here. -- The Debian packaging is (C) 2008, Stephen Gran and is licensed under the GPL, see /usr/share/common-licenses/GPL. freeradius-server/debian/freeradius-common.dirs000066400000000000000000000000441257552170400222450ustar00rootroot00000000000000etc/freeradius usr/share/freeradius freeradius-server/debian/freeradius-common.install000066400000000000000000000001151257552170400227510ustar00rootroot00000000000000usr/share/freeradius/* etc/freeradius/radiusd.conf etc/freeradius/dictionary freeradius-server/debian/freeradius-common.manpages000066400000000000000000000001401257552170400230740ustar00rootroot00000000000000debian/tmp/usr/share/man/man1/* debian/tmp/usr/share/man/man5/* debian/tmp/usr/share/man/man8/* freeradius-server/debian/freeradius-common.postinst000066400000000000000000000043061257552170400231740ustar00rootroot00000000000000#! /bin/sh set -e update_fs_from_statoverride() { # I wish a simple dpkg-statoverride --update $file just did # the right thing, but it doesn't, so we have to do it manually. type=$1 user=$2 group=$3 mode=$4 file=$5 if [ -n "$type" -a -n "$group" -a -n "$mode" -a -n "$file" ]; then if [ "$(find $file -maxdepth 0 -type $type -group $group -perm $mode)" = "" -a -$type $file ]; then chgrp $group $file chmod $mode $file fi fi } handle_config_files() { runmode=$1 set +e so=$(dpkg-statoverride --list /etc/freeradius) ret=$? set -e case "$runmode" in initial) if [ $ret != 0 ]; then dpkg-statoverride --add --update freerad freerad 2751 /etc/freeradius fi ;; upgrade) update_fs_from_statoverride d $so ;; esac set +e so=$(dpkg-statoverride --list /etc/freeradius/radiusd.conf) ret=$? set -e case "$runmode" in initial) if [ $ret != 0 ]; then dpkg-statoverride --add --update root freerad 0640 /etc/freeradius/radiusd.conf fi ;; upgrade) update_fs_from_statoverride f $so ;; esac # Relax permissions on local dictionary - allows radclient to run and should # not contain secrets. At any rate, only do it on fresh install set +e so=$(dpkg-statoverride --list /etc/freeradius/dictionary) ret=$? set -e case "$runmode" in initial) if [ $ret != 0 ]; then dpkg-statoverride --add --update root freerad 0644 /etc/freeradius/dictionary fi ;; upgrade) update_fs_from_statoverride f $so ;; esac } case "$1" in configure) if [ -z "$2" ]; then # On a fresh install, add the necessary user and group adduser --quiet --system --no-create-home --home /etc/freeradius --group --disabled-password freerad # Put user freerad in group shadow, so the daemon can auth locally # Only do this on fresh install as the admin may not want freerad in shadow # group if authenticating by another mechanism adduser --quiet freerad shadow handle_config_files initial else handle_config_files upgrade fi ;; esac #DEBHELPER# exit 0 freeradius-server/debian/freeradius-common.postrm000066400000000000000000000016311257552170400226330ustar00rootroot00000000000000#! /bin/sh set -e case "$1" in remove) ;; purge) rmdir --ignore-fail-on-non-empty /etc/freeradius # If we haven't managed to remove /etc/freeradius, make # sure that freerad:freerad doesn't own anything before # we remove the user and group test ! -d /etc/freeradius || find /etc/freeradius -user freerad -exec chown root "{}" \; || true test ! -d /etc/freeradius || find /etc/freeradius -group freerad -exec chgrp root "{}" \; || true if [ -x `which deluser` ]; then deluser --quiet freerad shadow || true deluser --quiet freerad || true fi if [ -x `which delgroup` ]; then delgroup --quiet freerad || true fi ;; *) ;; esac #DEBHELPER# exit 0 freeradius-server/debian/freeradius-common.prerm000066400000000000000000000006411257552170400224340ustar00rootroot00000000000000#!/bin/sh set -e case "$1" in remove) for file in /etc/freeradius/radiusd.conf /etc/freeradius/dictionary; do if dpkg-statoverride --list $file >/dev/null; then dpkg-statoverride --remove $file fi done if dpkg-statoverride --list /etc/freeradius >/dev/null; then dpkg-statoverride --remove /etc/freeradius fi ;; esac #DEBHELPER# freeradius-server/debian/freeradius-dialupadmin.README.Debian000066400000000000000000000006131257552170400244230ustar00rootroot00000000000000Dialup Admin Debian README Configuration is in /etc/freeradius-dialupadmin/ which is linked into the dialupadmin tree in /usr/share/freeradius-dialupadmin. To put this into production, add Include /etc/freeradius-dialupadmin/apache2.conf To the relevant section of your apache configuration. The scripts make use of .. to access the other paths, so symlinking into your webtree may not work. freeradius-server/debian/freeradius-dialupadmin.dirs000066400000000000000000000000761257552170400232510ustar00rootroot00000000000000etc/freeradius-dialupadmin/ usr/share/freeradius-dialupadmin/ freeradius-server/debian/freeradius-dialupadmin.docs000066400000000000000000000001701257552170400232330ustar00rootroot00000000000000dialup_admin/doc/AUTHORS dialup_admin/doc/FAQ dialup_admin/doc/HELP_WANTED dialup_admin/doc/HOWTO dialup_admin/doc/TODO freeradius-server/debian/freeradius-dialupadmin.examples000066400000000000000000000000431257552170400241200ustar00rootroot00000000000000dialup_admin/bin/dialup_admin.cron freeradius-server/debian/freeradius-dialupadmin.install000066400000000000000000000001411257552170400237470ustar00rootroot00000000000000etc/freeradius-dialupadmin usr/share/doc/freeradius-dialupadmin usr/share/freeradius-dialupadmin freeradius-server/debian/freeradius-dialupadmin.links000066400000000000000000000001021257552170400234160ustar00rootroot00000000000000etc/freeradius-dialupadmin/ usr/share/freeradius-dialupadmin/conf freeradius-server/debian/freeradius-iodbc.install000066400000000000000000000000451257552170400225430ustar00rootroot00000000000000usr/lib/freeradius/rlm_sql_iodbc*.so freeradius-server/debian/freeradius-iodbc.postinst000077500000000000000000000005211257552170400227620ustar00rootroot00000000000000#! /bin/sh set -e case "$1" in configure) if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then invoke-rc.d freeradius force-reload else /etc/init.d/freeradius force-reload fi ;; abort-upgrade) ;; abort-remove) ;; abort-deconfigure) ;; esac #DEBHELPER# freeradius-server/debian/freeradius-krb5.install000066400000000000000000000000401257552170400223210ustar00rootroot00000000000000usr/lib/freeradius/rlm_krb5*.so freeradius-server/debian/freeradius-krb5.lintian-overrides000066400000000000000000000000571257552170400243210ustar00rootroot00000000000000freeradius-krb5: binary-or-shlib-defines-rpath freeradius-server/debian/freeradius-krb5.postinst000077500000000000000000000005211257552170400225450ustar00rootroot00000000000000#! /bin/sh set -e case "$1" in configure) if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then invoke-rc.d freeradius force-reload else /etc/init.d/freeradius force-reload fi ;; abort-upgrade) ;; abort-remove) ;; abort-deconfigure) ;; esac #DEBHELPER# freeradius-server/debian/freeradius-ldap.install000066400000000000000000000000401257552170400223760ustar00rootroot00000000000000usr/lib/freeradius/rlm_ldap*.so freeradius-server/debian/freeradius-ldap.lintian-overrides000066400000000000000000000000571257552170400243760ustar00rootroot00000000000000freeradius-ldap: binary-or-shlib-defines-rpath freeradius-server/debian/freeradius-ldap.postinst000077500000000000000000000005211257552170400226220ustar00rootroot00000000000000#! /bin/sh set -e case "$1" in configure) if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then invoke-rc.d freeradius force-reload else /etc/init.d/freeradius force-reload fi ;; abort-upgrade) ;; abort-remove) ;; abort-deconfigure) ;; esac #DEBHELPER# freeradius-server/debian/freeradius-mysql.install000066400000000000000000000001001257552170400226200ustar00rootroot00000000000000usr/lib/freeradius/rlm_sql_mysql*.so etc/freeradius/sql/mysql/* freeradius-server/debian/freeradius-mysql.postinst000077500000000000000000000033571257552170400230610ustar00rootroot00000000000000#! /bin/sh set -e update_fs_from_statoverride() { # I wish a simple dpkg-statoverride --update $file just did # the right thing, but it doesn't, so we have to do it manually. type=$1 user=$2 group=$3 mode=$4 file=$5 if [ -n "$type" -a -n "$group" -a -n "$mode" -a -n "$file" ]; then if [ "$(find $file -maxdepth 0 -type $type -group $group -perm $mode)" = "" -a -$type $file ]; then chgrp $group $file chmod $mode $file fi fi } case "$1" in configure) for file in /etc/freeradius/sql/mysql/counter.conf \ /etc/freeradius/sql/mysql/dialup.conf \ /etc/freeradius/sql/mysql/ippool.conf \ /etc/freeradius/sql/mysql/ippool.sql \ /etc/freeradius/sql/mysql/nas.sql \ /etc/freeradius/sql/mysql/schema.sql do set +e so=$(dpkg-statoverride --list $file) ret=$? set -e if [ -z "$2" ]; then if [ $ret != 0 ]; then dpkg-statoverride --add --update root freerad 0640 $file fi else update_fs_from_statoverride f $so fi done for dir in /etc/freeradius/sql \ /etc/freeradius/sql/mysql do set +e so=$(dpkg-statoverride --list $dir) ret=$? set -e if [ -z "$2" ]; then if [ $ret != 0 ]; then dpkg-statoverride --add --update root freerad 2751 $dir fi else update_fs_from_statoverride d $so fi done if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then invoke-rc.d freeradius force-reload else /etc/init.d/freeradius force-reload fi ;; esac #DEBHELPER# exit 0 freeradius-server/debian/freeradius-mysql.prerm000066400000000000000000000013431257552170400223110ustar00rootroot00000000000000#! /bin/sh set -e case "$1" in remove) for file in /etc/freeradius/sql/mysql/counter.conf \ /etc/freeradius/sql/mysql/dialup.conf \ /etc/freeradius/sql/mysql/ippool.conf \ /etc/freeradius/sql/mysql/ippool.sql \ /etc/freeradius/sql/mysql/nas.sql \ /etc/freeradius/sql/mysql/schema.sql do if dpkg-statoverride --list $file >/dev/null; then dpkg-statoverride --remove $file fi done for dir in /etc/freeradius/sql \ /etc/freeradius/sql/mysql do if dpkg-statoverride --list $dir >/dev/null; then dpkg-statoverride --remove $dir fi done ;; esac #DEBHELPER# exit 0 freeradius-server/debian/freeradius-postgresql.install000066400000000000000000000001121257552170400236610ustar00rootroot00000000000000usr/lib/freeradius/rlm_sql_postgresql*.so etc/freeradius/sql/postgresql/* freeradius-server/debian/freeradius-postgresql.postinst000077500000000000000000000037401257552170400241130ustar00rootroot00000000000000#! /bin/sh set -e update_fs_from_statoverride() { # I wish a simple dpkg-statoverride --update $file just did # the right thing, but it doesn't, so we have to do it manually. type=$1 user=$2 group=$3 mode=$4 file=$5 if [ -n "$type" -a -n "$group" -a -n "$mode" -a -n "$file" ]; then if [ "$(find $file -maxdepth 0 -type $type -group $group -perm $mode)" = "" -a -$type $file ]; then chgrp $group $file chmod $mode $file fi fi } case "$1" in configure) for file in /etc/freeradius/sql/postgresql/cisco_h323_db_schema.sql \ /etc/freeradius/sql/postgresql/counter.conf \ /etc/freeradius/sql/postgresql/dialup.conf \ /etc/freeradius/sql/postgresql/ippool.conf \ /etc/freeradius/sql/postgresql/ippool.sql \ /etc/freeradius/sql/postgresql/nas.sql \ /etc/freeradius/sql/postgresql/schema.sql \ /etc/freeradius/sql/postgresql/update_radacct_group_trigger.sql \ /etc/freeradius/sql/postgresql/voip-postpaid.conf do set +e so=$(dpkg-statoverride --list $file) ret=$? set -e if [ -z "$2" ]; then if [ $ret != 0 ]; then dpkg-statoverride --add --update root freerad 0640 $file fi else update_fs_from_statoverride f $so fi done for dir in /etc/freeradius/sql \ /etc/freeradius/sql/postgresql do set +e so=$(dpkg-statoverride --list $dir) ret=$? set -e if [ -z "$2" ]; then if [ $ret != 0 ]; then dpkg-statoverride --add --update root freerad 2751 $dir fi else update_fs_from_statoverride d $so fi done if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then invoke-rc.d freeradius force-reload else /etc/init.d/freeradius force-reload fi ;; esac #DEBHELPER# exit 0 freeradius-server/debian/freeradius-postgresql.prerm000066400000000000000000000017251257552170400233530ustar00rootroot00000000000000#! /bin/sh set -e case "$1" in remove) for file in /etc/freeradius/sql/postgresql/cisco_h323_db_schema.sql \ /etc/freeradius/sql/postgresql/counter.conf \ /etc/freeradius/sql/postgresql/dialup.conf \ /etc/freeradius/sql/postgresql/ippool.conf \ /etc/freeradius/sql/postgresql/ippool.sql \ /etc/freeradius/sql/postgresql/nas.sql \ /etc/freeradius/sql/postgresql/schema.sql \ /etc/freeradius/sql/postgresql/update_radacct_group_trigger.sql \ /etc/freeradius/sql/postgresql/voip-postpaid.conf do if dpkg-statoverride --list $file >/dev/null; then dpkg-statoverride --remove $file fi done for dir in /etc/freeradius/sql \ /etc/freeradius/sql/postgresql do if dpkg-statoverride --list $dir >/dev/null; then dpkg-statoverride --remove $dir fi done ;; esac #DEBHELPER# exit 0 freeradius-server/debian/freeradius-utils.install000066400000000000000000000003401257552170400226210ustar00rootroot00000000000000usr/bin/rlm_dbm_cat usr/bin/rlm_dbm_parser usr/bin/radeapclient usr/bin/rlm_ippool_tool usr/bin/smbencrypt usr/bin/radclient usr/bin/radwho usr/bin/radsniff usr/bin/radlast usr/bin/radtest usr/bin/radzap usr/bin/radsqlrelay freeradius-server/debian/freeradius-utils.lintian-overrides000066400000000000000000000000601257552170400246100ustar00rootroot00000000000000freeradius-utils: binary-or-shlib-defines-rpath freeradius-server/debian/freeradius.default000066400000000000000000000002641257552170400214460ustar00rootroot00000000000000# Options for the FreeRADIUS deamon. FREERADIUS_CONF_LOCAL="/usr/local/etc/freeradius" if [ -d "$FREERADIUS_CONF_LOCAL" ]; then FREERADIUS_OPTIONS="-d $FREERADIUS_CONF_LOCAL" fi freeradius-server/debian/freeradius.dirs000066400000000000000000000001671257552170400207650ustar00rootroot00000000000000etc/freeradius/certs etc/freeradius/sites-enabled etc/freeradius/sites-available usr/lib/freeradius var/log/freeradius freeradius-server/debian/freeradius.docs000066400000000000000000000001001257552170400207370ustar00rootroot00000000000000debian/README.rfc CREDITS debian/tmp/usr/share/doc/freeradius/* freeradius-server/debian/freeradius.examples000066400000000000000000000010051257552170400216320ustar00rootroot00000000000000src/billing/ scripts/clients.pl scripts/create-users.pl scripts/cryptpasswd scripts/cryptpasswd.in scripts/exec-program-wait scripts/Makefile scripts/min-includes.pl scripts/radiusd2ldif.pl scripts/radiusd.cron.daily scripts/radiusd.cron.daily.in scripts/radiusd.cron.monthly scripts/radiusd.cron.monthly.in scripts/radiusd.sh scripts/radsqlrelay scripts/radwatch scripts/radwatch.in scripts/rc.radiusd scripts/rc.radiusd.in scripts/users2mysql.pl debian/tmp/etc/freeradius/example.pl debian/tmp/etc/freeradius/certs freeradius-server/debian/freeradius.init000077500000000000000000000047131257552170400207730ustar00rootroot00000000000000#!/bin/sh # Start/stop the FreeRADIUS daemon. ### BEGIN INIT INFO # Provides: freeradius # Required-Start: $remote_fs $network $syslog # Should-Start: $time mysql slapd postgresql samba krb5-kdc # Required-Stop: $remote_fs $syslog # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: Radius Daemon # Description: Extensible, configurable radius daemon ### END INIT INFO PROG="freeradius" PROGRAM="/usr/sbin/freeradius" PIDFILE="/var/run/freeradius/freeradius.pid" DESCR="FreeRADIUS daemon" set -e . /lib/lsb/init-functions test_freeradius_config() { log_action_begin_msg "Checking $DESCR configuration" out=`$PROGRAM -Cxl stdout $FREERADIUS_OPTIONS`; ret=$? out=`echo "${out}" | tail -n 1 | sed 's/^\s*ERROR:\s*\(.*\)\s*$/\1/'` log_action_end_msg $ret "$out" return $ret } if [ -r /etc/default/$PROG ]; then . /etc/default/$PROG fi test -f $PROGRAM || exit 0 # /var/run may be a tmpfs if [ ! -d /var/run/freeradius ]; then mkdir -p /var/run/freeradius chown freerad:freerad /var/run/freeradius fi export PATH="${PATH:+$PATH:}/usr/sbin:/sbin" ret=0 case "$1" in start) log_daemon_msg "Starting $DESCR" "$PROG" start_daemon -p "$PIDFILE" "$PROGRAM" $FREERADIUS_OPTIONS || ret=$? log_end_msg $ret ;; stop) log_daemon_msg "Stopping $DESCR" "$PROG" killproc -p "$PIDFILE" || ret=$? log_end_msg $ret ;; restart|force-reload) test_freeradius_config || exit $? $0 stop $0 start ;; reload) test_freeradius_config || exit $? if status_of_proc -p "$PIDFILE" "$PROG" "$DESCR"; then log_daemon_msg "Reloading $DESCR" "$PROG" start-stop-daemon --stop --signal HUP --quiet --pidfile $PIDFILE || ret=$? log_end_msg $ret fi ;; configtest|testconfig) test_freeradius_config || exit $? ;; debug) $PROGRAM -X $FREERADIUS_OPTIONS ;; status) status_of_proc -p "$PIDFILE" "$PROGRAM" "$PROG" && exit 0 || exit $? ;; *) echo "Usage: $0 start|stop|restart|force-reload|reload|configtest|debug|status" exit 1 ;; esac exit 0 freeradius-server/debian/freeradius.install000066400000000000000000000013451257552170400214710ustar00rootroot00000000000000etc/freeradius/acct_users etc/freeradius/attrs etc/freeradius/attrs.access_reject etc/freeradius/attrs.access_challenge etc/freeradius/attrs.accounting_response etc/freeradius/attrs.pre-proxy etc/freeradius/clients.conf etc/freeradius/eap.conf etc/freeradius/experimental.conf etc/freeradius/hints etc/freeradius/huntgroups etc/freeradius/ldap.attrmap etc/freeradius/modules/* etc/freeradius/policy.conf etc/freeradius/policy.txt etc/freeradius/preproxy_users etc/freeradius/proxy.conf etc/freeradius/sites-available/* etc/freeradius/sql.conf etc/freeradius/sqlippool.conf etc/freeradius/templates.conf etc/freeradius/users usr/lib/freeradius/rlm*.so usr/sbin/checkrad usr/sbin/freeradius usr/sbin/radwatch usr/sbin/raddebug usr/sbin/radmin freeradius-server/debian/freeradius.logrotate000066400000000000000000000003521257552170400220200ustar00rootroot00000000000000/var/log/freeradius/*.log { weekly rotate 52 compress delaycompress notifempty missingok postrotate /etc/init.d/freeradius reload > /dev/null endscript } freeradius-server/debian/freeradius.postinst000077500000000000000000000156671257552170400217250ustar00rootroot00000000000000#! /bin/sh set -e update_fs_from_statoverride() { # I wish a simple dpkg-statoverride --update $file just did # the right thing, but it doesn't, so we have to do it manually. type=$1 user=$2 group=$3 mode=$4 file=$5 if [ -n "$type" -a -n "$group" -a -n "$mode" -a -n "$file" ]; then if [ "$(find $file -maxdepth 0 -type $type -group $group -perm $mode)" = "" -a -$type $file ]; then chgrp $group $file chmod $mode $file fi fi } handle_config_files() { runmode=$1 for file in /etc/freeradius/preproxy_users \ /etc/freeradius/policy.conf \ /etc/freeradius/eap.conf \ /etc/freeradius/experimental.conf \ /etc/freeradius/huntgroups \ /etc/freeradius/proxy.conf \ /etc/freeradius/attrs.pre-proxy \ /etc/freeradius/hints \ /etc/freeradius/sql.conf \ /etc/freeradius/ldap.attrmap \ /etc/freeradius/attrs \ /etc/freeradius/policy.txt \ /etc/freeradius/attrs.accounting_response \ /etc/freeradius/attrs.access_reject \ /etc/freeradius/attrs.access_challenge \ /etc/freeradius/clients.conf \ /etc/freeradius/acct_users do set +e so=$(dpkg-statoverride --list $file) ret=$? set -e case "$runmode" in initial) if [ $ret != 0 ]; then dpkg-statoverride --add --update root freerad 0640 $file fi ;; upgrade) update_fs_from_statoverride f $so ;; esac done for dir in /etc/freeradius/certs \ /etc/freeradius/sites-available \ /etc/freeradius/sites-enabled do set +e so=$(dpkg-statoverride --list $dir) ret=$? set -e case "$runmode" in initial) if [ $ret != 0 ]; then dpkg-statoverride --add --update freerad freerad 2751 $dir fi ;; upgrade) update_fs_from_statoverride d $so ;; esac done } case "$1" in configure) if [ -z "$2" ]; then # Changed in 1.1.5-1 for new installs (we used to start at S50 # and stop at K50) We now start at S50 and stop at K19 so we # start after services which may be used and stop before them. update-rc.d freeradius start 50 2 3 4 5 . stop 19 0 1 6 . >/dev/null # Set up initial permissions on all the freeradius directories if ! dpkg-statoverride --list /var/run/freeradius >/dev/null; then dpkg-statoverride --add --update freerad freerad 0755 /var/run/freeradius fi if ! dpkg-statoverride --list /var/log/freeradius >/dev/null; then dpkg-statoverride --add --update freerad freerad 0750 /var/log/freeradius fi for file in radius.log radwtmp; do [ ! -f "/var/log/freeradius/${file}" ] && install -o freerad -g freerad -m 644 /dev/null /var/log/freeradius/${file} done handle_config_files initial action="start" else handle_config_files upgrade action="restart" fi # Create links for default sites, but only if this is an initial # install or an upgrade from before there were links; users may # want to remove them... if [ -z "$2" ] || dpkg --compare-versions "$2" lt 2.0.4+dfsg-4; then for site in default inner-tunnel; do if [ ! -e /etc/freeradius/sites-enabled/$site ]; then ln -s ../sites-available/$site /etc/freeradius/sites-enabled/$site fi done fi # Create stub SSL certificate file that became necessary in 2.1.8, # with analogous disclaimers, because the admin may yet choose to # switch to /usr/share/doc/freeradius/examples/certs/ stuff. if [ -z "$2" ] || dpkg --compare-versions "$2" lt 2.1.8+dfsg-1; then if egrep -q '^[ ]*\$INCLUDE eap.conf' /etc/freeradius/radiusd.conf && \ egrep -q '^[ ]*certdir = \${confdir}/certs' /etc/freeradius/eap.conf && \ egrep -q '^[ ]*cadir = \${confdir}/certs' /etc/freeradius/eap.conf then echo "Updating default SSL certificate settings, if any..." >&2 test -d /etc/freeradius/certs || mkdir /etc/freeradius/certs if test ! -e /etc/ssl/certs/ssl-cert-snakeoil.pem || \ test ! -e /etc/ssl/private/ssl-cert-snakeoil.key then make-ssl-cert generate-default-snakeoil fi if egrep -q '^[ ]*certificate_file = \${certdir}/server.pem' /etc/freeradius/eap.conf && \ test ! -f /etc/freeradius/certs/server.pem then serverpem=wasnotthere ln -s /etc/ssl/certs/ssl-cert-snakeoil.pem /etc/freeradius/certs/server.pem fi if ( egrep -q '^[ ]*private_key_file = \${certdir}/server.pem' /etc/freeradius/eap.conf && \ [ "$serverpem" = "wasnotthere" ] ) \ || \ ( egrep -q '^[ ]*private_key_file = \${certdir}/server.key' /etc/freeradius/eap.conf && \ test ! -f /etc/freeradius/certs/server.key ) then ln -s /etc/ssl/private/ssl-cert-snakeoil.key /etc/freeradius/certs/server.key sed -i -e 's,^\([ ]*private_key_file = \${certdir}\)/server.pem$,\1/server.key,' /etc/freeradius/eap.conf if getent group ssl-cert >/dev/null; then # freeradius-common dependency also provides us with adduser adduser --quiet freerad ssl-cert fi fi if egrep -q '^[ ]*CA_file = \${cadir}/ca.pem' /etc/freeradius/eap.conf && \ test ! -f /etc/freeradius/certs/ca.pem then ln -s /etc/ssl/certs/ca-certificates.crt /etc/freeradius/certs/ca.pem fi if egrep -q '^[ ]*random_file = \${certdir}/random' /etc/freeradius/eap.conf && \ test ! -f /etc/freeradius/certs/random then sed -i -e 's,^\([ ]*random_file = \)\${certdir}/random$,\1/dev/urandom,' /etc/freeradius/eap.conf fi if egrep -q '^[ ]*dh_file = \${certdir}/dh' /etc/freeradius/eap.conf && \ test ! -f /etc/freeradius/certs/dh then # ssl-cert dependency also provides us with openssl openssl dhparam -out /etc/freeradius/certs/dh 1024 fi fi fi if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then invoke-rc.d freeradius $action || true else /etc/init.d/freeradius $action fi ;; abort-upgrade) if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then invoke-rc.d freeradius restart || true else /etc/init.d/freeradius restart fi ;; abort-remove) if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then invoke-rc.d freeradius start || true else /etc/init.d/freeradius start fi ;; abort-deconfigure) ;; esac #DEBHELPER# exit 0 freeradius-server/debian/freeradius.postrm000077500000000000000000000017711257552170400213550ustar00rootroot00000000000000#! /bin/sh set -e case "$1" in remove) ;; purge) update-rc.d -f freeradius remove >/dev/null # Remove dangling links from sites-enabled. for link in /etc/freeradius/sites-enabled/*; do if [ -L "$link" ] && [ ! -e "$link" ]; then rm -f "$link" fi done if [ -L /etc/freeradius/certs/server.pem ]; then rm -f /etc/freeradius/certs/server.pem fi if [ -L /etc/freeradius/certs/server.key ]; then rm -f /etc/freeradius/certs/server.key fi if [ -L /etc/freeradius/certs/ca.pem ]; then rm -f /etc/freeradius/certs/ca.pem fi if [ -L /etc/freeradius/certs/random ]; then rm -f /etc/freeradius/certs/random fi rm -f /etc/freeradius/certs/dh rm -f /var/log/freeradius/radius.log* /var/log/freeradius/radwtmp* ;; esac #DEBHELPER# exit 0 freeradius-server/debian/freeradius.preinst000066400000000000000000000061721257552170400215120ustar00rootroot00000000000000#! /bin/sh set -e # Remove a no-longer used conffile; taken from http://wiki.debian.org/DpkgConffileHandling rm_conffile() { CONFFILE="$1" if [ -e "$CONFFILE" ]; then md5sum="`md5sum \"$CONFFILE\" | sed -e \"s/ .*//\"`" old_md5sum="`dpkg-query -W -f='${Conffiles}' $PKGNAME | sed -n -e \"\\\\' $CONFFILE'{s/ obsolete$//;s/.* //p}\"`" if [ "$md5sum" != "$old_md5sum" ]; then echo "Obsolete conffile $CONFFILE has been modified by you." echo "Saving as $CONFFILE.dpkg-bak ..." mv -f "$CONFFILE" "$CONFFILE".dpkg-bak else echo "Removing obsolete conffile $CONFFILE ..." rm -f "$CONFFILE" fi fi } case "$1" in upgrade) # Before 1.1.5, upstream shipped /etc/freeradius/otppasswd.sample # and we install it (I still don't know why). In 1.1.5 they # got rid of it so handle removing the conffile. if dpkg --compare-versions "$2" lt "1.1.5"; then rm_conffile "/etc/freeradius/otppasswd.sample" fi # There are huge changes between 1.x and 2.x (we cleaned things up # a lot), so sort it out here if dpkg --compare-versions "$2" lt "2.0.0"; then rm_conffile "/etc/freeradius/certs/demoCA/cacert.pem" rm_conffile "/etc/freeradius/certs/demoCA/index.txt" rm_conffile "/etc/freeradius/certs/demoCA/index.txt.old" rm_conffile "/etc/freeradius/certs/demoCA/serial" rm_conffile "/etc/freeradius/certs/demoCA/serial.old" test -d /etc/freeradius/certs/demoCA && rmdir --ignore-fail-on-non-empty /etc/freeradius/certs/demoCA/ rm_conffile "/etc/freeradius/certs/cert-clt.der" rm_conffile "/etc/freeradius/certs/cert-clt.p12" rm_conffile "/etc/freeradius/certs/cert-clt.pem" rm_conffile "/etc/freeradius/certs/cert-srv.der" rm_conffile "/etc/freeradius/certs/cert-srv.p12" rm_conffile "/etc/freeradius/certs/cert-srv.pem" rm_conffile "/etc/freeradius/certs/dh" rm_conffile "/etc/freeradius/certs/newcert.pem" rm_conffile "/etc/freeradius/certs/newreq.pem" rm_conffile "/etc/freeradius/certs/random" rm_conffile "/etc/freeradius/certs/README" rm_conffile "/etc/freeradius/certs/root.der" rm_conffile "/etc/freeradius/certs/root.p12" rm_conffile "/etc/freeradius/certs/root.pem" rm_conffile "/etc/freeradius/sqlippool.conf" rm_conffile "/etc/freeradius/mssql.conf" rm_conffile "/etc/freeradius/postgresql.conf" rm_conffile "/etc/freeradius/naslist" rm_conffile "/etc/freeradius/naspasswd" rm_conffile "/etc/freeradius/realms" fi # old files shipped by this package previously, but dropped upstream if dpkg --compare-versions "$2" lt "2.1.8"; then for file in \ /etc/freeradius/otp.conf \ /etc/freeradius/snmp.conf do rm_conffile "$file" # must get rid of the overrides otherwise they corrupt the database if dpkg-statoverride --list $file >/dev/null; then dpkg-statoverride --remove $file fi done fi esac #DEBHELPER# exit 0 freeradius-server/debian/freeradius.prerm000077500000000000000000000025601257552170400211530ustar00rootroot00000000000000#! /bin/sh set -e case "$1" in remove) if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then invoke-rc.d freeradius stop else /etc/init.d/freeradius stop fi for file in /etc/freeradius/preproxy_users \ /etc/freeradius/policy.conf \ /etc/freeradius/eap.conf \ /etc/freeradius/experimental.conf \ /etc/freeradius/huntgroups \ /etc/freeradius/proxy.conf \ /etc/freeradius/attrs.pre-proxy \ /etc/freeradius/hints \ /etc/freeradius/sql.conf \ /etc/freeradius/ldap.attrmap \ /etc/freeradius/attrs \ /etc/freeradius/policy.txt \ /etc/freeradius/attrs.accounting_response \ /etc/freeradius/attrs.access_reject \ /etc/freeradius/attrs.access_challenge \ /etc/freeradius/clients.conf \ /etc/freeradius/acct_users do if dpkg-statoverride --list $file >/dev/null; then dpkg-statoverride --remove $file fi done for dir in /etc/freeradius/certs \ /etc/freeradius/sites-available \ /etc/freeradius/sites-enabled \ /var/run/freeradius \ /var/log/freeradius do if dpkg-statoverride --list $dir >/dev/null; then dpkg-statoverride --remove $dir fi done ;; esac #DEBHELPER# exit 0 freeradius-server/debian/freeradius.radiusd.pam000066400000000000000000000003431257552170400222270ustar00rootroot00000000000000# # /etc/pam.d/radiusd - PAM configuration for FreeRADIUS # # We fall back to the system default in /etc/pam.d/common-* # @include common-auth @include common-account @include common-password @include common-session freeradius-server/debian/libfreeradius-dev.install000066400000000000000000000002771257552170400227370ustar00rootroot00000000000000usr/lib/freeradius/libfreeradius-radius.so usr/lib/freeradius/libfreeradius-eap.so usr/lib/freeradius/libfreeradius-radius.a usr/lib/freeradius/libfreeradius-eap.a usr/include/freeradius/*.h freeradius-server/debian/libfreeradius2.install000066400000000000000000000000471257552170400222400ustar00rootroot00000000000000usr/lib/freeradius/libfreeradius*2*.so freeradius-server/debian/libfreeradius2.lintian-overrides000066400000000000000000000000561257552170400242300ustar00rootroot00000000000000libfreeradius2: binary-or-shlib-defines-rpath freeradius-server/debian/patches/000077500000000000000000000000001257552170400173745ustar00rootroot00000000000000freeradius-server/debian/patches/dhcp_sqlippool-comment-out-mysql.diff000066400000000000000000000015051257552170400266570ustar00rootroot00000000000000diff --git a/raddb/modules/dhcp_sqlippool b/raddb/modules/dhcp_sqlippool index 39358b2..2a29daf 100644 --- a/raddb/modules/dhcp_sqlippool +++ b/raddb/modules/dhcp_sqlippool @@ -14,8 +14,11 @@ sqlippool dhcp_sqlippool { # Client's MAC address is mapped to Calling-Station-Id in policy.conf pool-key = "%{Calling-Station-Id}" - # For now, it only works with MySQL. - $INCLUDE ${confdir}/sql/mysql/ippool-dhcp.conf + # For now, it only works with MySQL. + # This line is commented by default to enable clean startup when you + # don't have freeradius-mysql installed. Uncomment this line if you + # use this module. + #$INCLUDE ${confdir}/sql/mysql/ippool-dhcp.conf sqlippool_log_exists = "DHCP: Existing IP: %{reply:Framed-IP-Address} (did %{Called-Station-Id} cli %{Calling-Station-Id} port %{NAS-Port} user %{User-Name})" freeradius-server/debian/patches/dialupadmin-help.diff000066400000000000000000000013111257552170400234370ustar00rootroot00000000000000## 02-dialupadmin-help.dpatch by Mark Hymers ## DP: Fix README location --- old/dialup_admin/htdocs/help/help.php (revision 1519) +++ new/dialup_admin/htdocs/help/help.php (working copy) @@ -48,13 +48,13 @@
freeradius-server/debian/patches/gitignore.diff000066400000000000000000000004051257552170400222140ustar00rootroot00000000000000--- freeradius-2.0.4+dfsg.orig/.gitignore +++ freeradius-2.0.4+dfsg/.gitignore @@ -0,0 +1,14 @@ +*.la +*.o +*.lo +.libs +.deps +build-arch-stamp +build-indep-stamp +config.h +config.log +config.status +config.cache +config.guess.dist +config.sub.dist +Make.inc freeradius-server/debian/patches/radiusd-to-freeradius.diff000066400000000000000000000030021257552170400244230ustar00rootroot00000000000000--- old/Make.inc.in +++ new/Make.inc.in @@ -48,7 +48,7 @@ LOGDIR = ${logdir} RADDBDIR = ${raddbdir} -RUNDIR = ${localstatedir}/run/radiusd +RUNDIR = ${localstatedir}/run/freeradius SBINDIR = ${sbindir} RADIR = ${radacctdir} --- old/raddb/radiusd.conf.in +++ new/raddb/radiusd.conf.in @@ -62,7 +62,7 @@ # # name of the running server. See also the "-n" command-line option. -name = radiusd +name = freeradius # Location of config and logfiles. confdir = ${raddbdir} @@ -164,8 +164,8 @@ # It will join all groups where "user" is a member. This can allow # for some finer-grained access controls. # -#user = radius -#group = radius +user = freerad +group = freerad # max_request_time: The maximum time (in seconds) to handle a request. # --- a/scripts/freeradius.monitrc +++ b/scripts/freeradius.monitrc @@ -8,9 +8,9 @@ # Totalmem limit should be lowered to 200.0 if none of the # interpreted language modules or rlm_cache are being used. # -check process radiusd with pidfile /var/run/radiusd/radiusd.pid - start program = "/etc/init.d/radiusd start" - stop program = "/etc/init.d/radiusd stop" +check process freeradius with pidfile /var/run/freeradius/freeradius.pid + start program = "/etc/init.d/freeradius start" + stop program = "/etc/init.d/freeradius stop" if failed host 127.0.0.1 port 1812 type udp protocol radius secret testing123 then alert if failed host 127.0.0.1 port 1813 type udp protocol radius secret testing123 then alert if cpu > 95% for 2 cycles then alert freeradius-server/debian/patches/rlm_sql.libs.diff000066400000000000000000000043171257552170400226340ustar00rootroot00000000000000--- freeradius-2.0.4+dfsg.orig/src/modules/rlm_sql_log/Makefile +++ freeradius-2.0.4+dfsg/src/modules/rlm_sql_log/Makefile @@ -6,5 +6,6 @@ TARGET = rlm_sql_log SRCS = rlm_sql_log.c +RLM_LIBS += $(top_builddir)/src/modules/rlm_sql/.libs/rlm_sql.la include ../rules.mak --- freeradius-2.0.4+dfsg.orig/src/modules/rlm_sqlcounter/Makefile.in +++ freeradius-2.0.4+dfsg/src/modules/rlm_sqlcounter/Makefile.in @@ -6,7 +6,7 @@ SRCS = rlm_sqlcounter.c HEADERS = RLM_CFLAGS = @sqlcounter_cflags@ -RLM_LIBS = @sqlcounter_ldflags@ +RLM_LIBS = @sqlcounter_ldflags@ $(top_builddir)/src/modules/rlm_sql/.libs/rlm_sql.la RLM_INSTALL = include ../rules.mak --- freeradius-2.0.4+dfsg.orig/src/modules/rlm_sqlippool/Makefile.in +++ freeradius-2.0.4+dfsg/src/modules/rlm_sqlippool/Makefile.in @@ -8,7 +8,7 @@ SRCS = rlm_sqlippool.c HEADERS = $(top_builddir)/src/modules/rlm_sql/rlm_sql.h RLM_CFLAGS = -I$(top_builddir)/src/modules/rlm_sql -RLM_LIBS = +RLM_LIBS += $(top_builddir)/src/modules/rlm_sql/.libs/rlm_sql.la RLM_INSTALL = include ../rules.mak --- freeradius-2.0.4+dfsg.orig/src/modules/rlm_sql/drivers/rlm_sql_postgresql/Makefile.in +++ freeradius-2.0.4+dfsg/src/modules/rlm_sql/drivers/rlm_sql_postgresql/Makefile.in @@ -4,5 +4,6 @@ SRCS = sql_postgresql.c RLM_SQL_CFLAGS = @postgresql_cflags@ RLM_SQL_LIBS = @postgresql_ldflags@ +RLM_LIBS += $(top_builddir)/src/modules/rlm_sql/.libs/rlm_sql.la include ../rules.mak --- freeradius-2.0.4+dfsg.orig/src/modules/rlm_sql/drivers/rlm_sql_iodbc/Makefile.in +++ freeradius-2.0.4+dfsg/src/modules/rlm_sql/drivers/rlm_sql_iodbc/Makefile.in @@ -4,5 +4,6 @@ SRCS = sql_iodbc.c RLM_SQL_CFLAGS = @sql_iodbc_cflags@ RLM_SQL_LIBS = @sql_iodbc_ldflags@ +RLM_LIBS += $(top_builddir)/src/modules/rlm_sql/.libs/rlm_sql.la include ../rules.mak --- freeradius-2.0.4+dfsg.orig/src/modules/rlm_sql/drivers/rlm_sql_mysql/Makefile.in +++ freeradius-2.0.4+dfsg/src/modules/rlm_sql/drivers/rlm_sql_mysql/Makefile.in @@ -4,5 +4,6 @@ SRCS = sql_mysql.c RLM_SQL_CFLAGS = @sql_mysql_cflags@ RLM_SQL_LIBS = @sql_mysql_ldflags@ +RLM_LIBS += $(top_builddir)/src/modules/rlm_sql/.libs/rlm_sql.la include ../rules.mak freeradius-server/debian/patches/series000066400000000000000000000001701257552170400206070ustar00rootroot00000000000000radiusd-to-freeradius.diff dialupadmin-help.diff gitignore.diff rlm_sql.libs.diff dhcp_sqlippool-comment-out-mysql.diff freeradius-server/debian/rules000077500000000000000000000141711257552170400170310ustar00rootroot00000000000000#!/usr/bin/make -f # -*- makefile -*- # Sample debian/rules that uses debhelper. # # This file was originally written by Joey Hess and Craig Small. # As a special exception, when this file is copied by dh-make into a # dh-make output file, you may use that output file without restriction. # This special exception was added by Craig Small in version 0.37 of dh-make. # # Modified to make a template file for a multi-binary package with separated # build-arch and build-indep targets by Bill Allombert 2001 # Uncomment this to turn on verbose mode. export DH_VERBOSE=1 .NOTPARALLEL: SHELL =/bin/bash package = freeradius freeradius_dir = $(CURDIR)/debian/tmp/ mandir = /usr/share/man libdir = /usr/lib/$(package) logdir = /var/log/$(package) pkgdocdir = /usr/share/doc/$(package) raddbdir = /etc/$(package) modulelist=krb5 ldap sql_mysql sql_iodbc sql_postgresql pkgs=$(shell dh_listpackages) # This has to be exported to make some magic below work. export DH_OPTIONS # These are used for cross-compiling and for saving the configure script # from having to guess our platform (since we know it already) export DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) export DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) CFLAGS += -O0 else CFLAGS += -O2 endif ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE)) confflags += --build $(DEB_HOST_GNU_TYPE) else confflags += --build $(DEB_BUILD_GNU_TYPE) --host $(DEB_HOST_GNU_TYPE) endif include /usr/share/quilt/quilt.make config.status: configure dh_testdir ifeq (config.sub.dist,$(wildcard config.sub.dist)) rm config.sub else mv config.sub config.sub.dist endif ifeq (config.guess.dist,$(wildcard config.guess.dist)) rm config.guess else mv config.guess config.guess.dist endif ln -s /usr/share/misc/config.sub config.sub ln -s /usr/share/misc/config.guess config.guess ./configure $(confflags) \ --prefix=/usr \ --exec-prefix=/usr \ --mandir=$(mandir) \ --sysconfdir=/etc \ --libdir=$(libdir) \ --datadir=/usr/share \ --localstatedir=/var \ --with-raddbdir=$(raddbdir) \ --with-logdir=/var/log/$(package) \ --enable-ltdl-install=no --enable-strict-dependencies \ --with-large-files --with-udpfromto --with-edir \ --enable-developer \ --config-cache \ --without-rlm_eap_tnc \ --with-rlm_sql_postgresql_lib_dir=`pg_config --libdir` \ --with-rlm_sql_postgresql_include_dir=`pg_config --includedir` \ --without-rlm_eap_ikev2 \ --without-rlm_sql_oracle \ --without-rlm_sql_unixodbc \ --with-system-libtool \ --with-system-libltdl #Architecture build: patch build-arch build-indep build-arch: build-arch-stamp build-arch-stamp: config.status $(MAKE) touch $@ build-indep: build-indep-stamp build-indep-stamp: config.status touch $@ clean: unpatch dh_testdir dh_testroot rm -f build-arch-stamp build-indep-stamp rm -f config.cache config.log rm -f src/freeradius-devel [ ! -d src/modules/lib ] || rm -fr src/modules/lib || true [ ! -d src/binary ] || rm -fr src/binary || true # Add here commands to clean up after the build process. ifeq (Make.inc,$(wildcard Make.inc)) $(MAKE) distclean endif ifeq (config.sub.dist,$(wildcard config.sub.dist)) rm -f config.sub mv config.sub.dist config.sub endif ifeq (config.guess.dist,$(wildcard config.guess.dist)) rm -f config.guess mv config.guess.dist config.guess endif dh_clean install: install-indep install-arch install-indep: build-indep-stamp dh_testdir dh_testroot dh_installdirs -i $(MAKE) -C dialup_admin DIALUP_PREFIX=/usr/share/freeradius-dialupadmin \ DIALUP_DOCDIR=/usr/share/doc/freeradius-dialupadmin \ DIALUP_CONFDIR=/etc/freeradius-dialupadmin \ R=$(freeradius_dir) install mv $(freeradius_dir)/usr/share/freeradius-dialupadmin/bin/dialup_admin.cron \ $(freeradius_dir)/usr/share/freeradius-dialupadmin/bin/freeradius-dialupadmin.cron mv $(freeradius_dir)/usr/share/doc/freeradius-dialupadmin/Changelog \ $(freeradius_dir)/usr/share/doc/freeradius-dialupadmin/changelog install -m0644 debian/apache2.conf $(freeradius_dir)/etc/freeradius-dialupadmin/ dh_install -i --sourcedir=$(freeradius_dir) dh_installdocs -p freeradius-dialupadmin dialup_admin/README install-arch: build-arch-stamp dh_testdir dh_testroot dh_installdirs -s test -d $(freeradius_dir)/usr/lib/freeradius || mkdir -p $(freeradius_dir)/usr/lib/freeradius ln -fs rlm_sql.so $(freeradius_dir)/usr/lib/freeradius/librlm_sql.so $(MAKE) install R=$(freeradius_dir) # rename radius binary to play nicely with others mv $(freeradius_dir)/usr/sbin/radiusd $(freeradius_dir)/usr/sbin/$(package) mv $(freeradius_dir)/$(mandir)/man8/radiusd.8 $(freeradius_dir)/$(mandir)/man8/$(package).8 dh_install --sourcedir=$(freeradius_dir) -p libfreeradius2 dh_install --sourcedir=$(freeradius_dir) -p libfreeradius-dev for mod in ${modulelist}; do \ pkg=$${mod##sql_} ; \ dh_install --sourcedir=$(freeradius_dir) -p freeradius-$$pkg ; \ rm -f $(freeradius_dir)/usr/lib/freeradius/rlm_$$mod*.so ; \ done dh_install --sourcedir=$(freeradius_dir) -p freeradius-utils dh_install --sourcedir=$(freeradius_dir) -p freeradius dh_strip -a --dbg-package=freeradius-dbg dh_makeshlibs -a -n dh_shlibdeps binary-common: dh_testdir dh_testroot dh_installchangelogs doc/ChangeLog dh_installdocs dh_installexamples chmod a-x debian/freeradius/usr/share/doc/freeradius/examples/example.pl dh_installlogrotate dh_installpam --name=radiusd dh_installinit --noscripts dh_installman dh_lintian dh_link dh_compress -Xexamples dh_fixperms dh_installdeb dh_gencontrol dh_md5sums dh_builddeb # Build architecture independant packages using the common target. binary-indep: build-indep install-indep $(MAKE) -f debian/rules DH_OPTIONS=-i binary-common # Build architecture dependant packages using the common target. binary-arch: build-arch install-arch $(MAKE) -f debian/rules DH_OPTIONS=-s binary-common binary: binary-arch binary-indep .PHONY: build clean binary-indep binary-arch binary install install-indep install-arch freeradius-server/dialup_admin/000077500000000000000000000000001257552170400171515ustar00rootroot00000000000000freeradius-server/dialup_admin/Changelog000066400000000000000000001165711257552170400207760ustar00rootroot00000000000000Ver X.XX: * add comparison operators "!=" and "not like" to Accounting * replace ereg -> preg_match, ereg_replace -> preg_replace, split -> preg_split for PHP5.3 compatibility * fix LIMIT not working when using MySQL * add configuration item "timezone" to make PHP 5.1+ happy Ver 1.80: * Remove snmp_clearsession. It is replaced by clearsession which supports both snmp and telnet methods of removing a user from an access server. Add corresponding configuration directives general_sessionclear_method and nasXX_sessionclear_method * Create a new function da_sql_limit() and use that to pass LIMIT arguments to the database layer since the syntax is different between db vendors * Rename the badusers date field to incidentdate to avoid reserved words in databases. Bug found by Peter Nixon * Count online users correctly (through a separate query) in user_finger. * Use the correct max results variable in lib/*/find.php3 * In time2strclock also show days if applicable * In lib/sql/attrmap.php3, only register variables once. Go through $show_attrs and set default attribute mappings for any attribute that a mapping does not exist. * Change the order of OID's used in snmpfinger for cisco NASes Ver 1.78: * Add a snmp_clearsession which can disconnect a user by using the Cisco AAA Session MIB * Add a configuration directive general_sessionclear_bin * Add a session disconnect button in the 'clear open sessions' page * Also clear sessions from the sql extra servers in the 'clear open sessions' page * In bin/snmpfinger also accept @,. in the username * If we are stripping realms, then if needed strip them from the data returned by snmpfinger in user_finger.php3 * Add a header with the page encoding before sending any page (header added in config.php3) This closes Bug #153 * Fix a problem when reading username.mappings * If date calculation fails, abort * Add a backup_radacct script * Add an sqlrelay functions file. The user_admin page does not currently work. Looking into it. * Add sqlrelay support in the scripts. Add a sqlrelay_query script to run sqlrelay commands * Update password_check to work with all password attributes and use the configuration directives * Add more documentation for per user counter limit attributes (daily/weekly/monthly limits) * Make all counter limits default to none so that people don't get confused * In clear_opensessions depending on sql type use either IS NULL or = 0 in the DELETE statement. We need to find a cleaner solution to this. This closes bug#175 * Log somewhat more verbose error messages when the sql_command binary is not found in the bin scripts * Make nasXX_finger_type actually work since the place where nas information was stored was changed a long time ago. Bug noted by Nick Bright * In user_finger only set LD_LIBRARY_PATH once, not each time we call snmpfinger * Add support for usrhiper in snmpfinger. Patch from Nick Bright * urlencode() all occurrences of the $login variable when used in url's. Bug noted by Dag Landau * Show the correct nas type in nas_admin. Bug noted by Nick Bright * Correctly calculate the nas ip in lib/sql/nas_list.php3. Add a check_ip() function in lib/functions.php3 Bug noted by Nick Bright * Correctly check nas validity in nas_admin.php3. Bug noted by Nick Bright * Don't use $num in stats.php3, change it to $stats_num Ver 1.75: * A LOT of security related fixes. Now dialupadmin should hopefully be secure enough to be accessed by normal users (not administrators). * Move a few elements in the CSS file from the body tag. Suggestion by Gary McKinney * Update FAQ about using php with no sql support. * Allow the user to select between viewing FAQ,HOWTO or README in the help page. * Use $_SERVER instead of $HTTP_SERVER_VARS * Add a drop down menu with existing groups in group_new.php3 * Check for sql in show_groups.php3 * In lib/sql/group_info.php3 if $login is not set, find available groups and place them in $existing_groups along with a count of users per group. Use the functionality in group_new.php3 and show_groups.php3 * Update TODO * Add the style sheet in the content.html * Enlarge the width for the left frame * Make show_groups and the drop down menu in group_new work * Use lower cased row names in badusers page * Wrong foreach in show_groups and group_new. * Fix operator escaping in lib/sql/change_attrs.php3 * In user_state also take into account any open sessions when calculating daily/weekly usage. Add two more lines in the output stating the number of current open sessions and the time used. * Move a few header() calls after including config.php3 so that we have access to the relevant variables. * Make pagesize 'all' work again. Bug found by apellido jr., wilfredo p. * Make 'Add NAS' function in the nas admin page more easily accessible * Fix a small bug in user_admin.php3 found by Joerg Staedele * Fix a small typo in the userinfo mysql schema. Found by Evert Meulie * Fix bug #136, bugs found by Pawel Foremski * Small type in login_time_create, close bug #141 * In config.php3 remove whitespaces from $login. Don't remove '-' * Add lib/sql/group_change.php3 to add and delete a user from groups * Add a new directive sql_show_all_groups. If set to true then in user edit page we show all available groups with the ones the user is a member of highlighted. The administrator can then directly change user group membership by changing membership in this group list. * On group creation, if member list is empty report that, not that the group was created. * In the show groups page, note that we only show groups with members * In lib/sql/group_info.php3 only unset variables if we need to. In lib/sql/defaults.php3 don't run for groups only for users * Fix Bug #167 Ver 1.72: * Move the xlat function to a separate file in lib/xlat.php3 * Add a lib/sql/nas_list.php3 to also get the nas list from sql (naslist.conf still works) * add realms nasdb and nasadmin in username.mappings. nasadmin is used to signify if the user is allowed to use the nas_admin page. nasdb is used to shorten the nas list to only a few specific entries. That way administrator responsible for a few access servers will only be able to administer those access servers and not see the rest of the nas list. * Add username searching in the find page as suggested by joram agten * Don't use nas_list in nas_admin * Add postgresql specific sql schema by apellido jr., wilfredo p. Move each sql schema to a separate directory (mysql and postgresql) * Change is_int to is_numeric. This closes Bug #90 * Escape special characters in the sql password. This closes bug #96 * Do an xlat for general_accounting_attrs_file and general_user_edit_attrs_file. That way we can have different mappings for each administrator. * Use require_once instead of require when including xlat.php3 * Add debug statements in sql connect functions * Add a missing.php3 file with functions that may be missing from the PHP version used. Include it if a function is missing. Currently only array_change_key_case() is included * Set general_restrict_nasadmin_access to no by default. It causes confusion. * Set the general_username_mappings_file variable * Fix a small error in lib/sql/find.php3. This closes bug #103 * Add a small note in the FAQ about checking for sql/ldap driver availability in PHP if the user get's a blank white page back. Ver 1.70.3: * Test for unset variable, rather than empty variable in clean_radacct, monthly_tot_stats and truncate_radacct. Ver 1.70.2: * Fix redirects in dialup-admin pages on servers with register_globals turned off. * HTTP form fields will always fail is_int, use in_numeric instead. Ver 1.70.1: * Report correct data transfer statistics for users. * Lower-case sql column names to match creation scripts. * Fix creation of empty groups. * Put quote around usernames in HTML output. * Properly notice when we've got a blank password to SQL. Ver 1.70: * Add the /bin postgresql compatibility patch from Guy Fraser * Add ldap_userdn as a configuration directive. If set we use that for user DN's (variables supported) instead of performing and ldap search for each user. That can be somewhat faster. * Add a check_user_passwd() and a get_user_dn() functions in lib/ldap/functions.php3 * Add general_restrict_badusers_access directive. If set to yes we only allow each administrator access to their own entries in the badusers table * Add a username.mappings table. We are able to map each administrator username to additional queries on the accounting and user settings tables. * Add an sql_accounting_extra_query directive. If set this query is included in all queries to the accounting tables. Combined with admin username mappings we are able to easily restrict access on specific accounting data to each administrator. * Escape bad characters in the $login variable * Add a da_sql_escape_string function. We use that for every element we pass to sql queries in order to protect ourselves from sql injection. * Use the ldap_userdn directive where applicable in the functions.php3 file * Add an sql_xlat function * Add a nas administration page for sql based clients * Fix small bugs in accounting.php3 and user_stats.php3. Add nas_admin.php3 to the buttons page * Add da_sql_escape_string for all relevant variables in lib/sql files * Keep the nas list in a separate array $nas_list. Update various pages to use that one now. * Make nas_list actually work * Also allow for '-' to exist in a nas name in bin/log_badlogins Ver 1.68: * Huge PostgreSQL compatibility patch by Guy Fraser * Also support the Crypt-Password attribute in lib/sql/password_check.php3. Patch by Guy Fraser * Small fix in user_finger.php3 * Add the ability to erase rows from the badusers table * In log_badlogins for multiple logins if it is a mppp attempt, log it * Add a message when adding a user in the badusers table * Close sql connections in add_badusers.php3 * Add a patch from Neil McCalden to not put spaces in the -p argument to the mysql binary. * Fix a bug in conf/config.php3. Patch from Neil McCalden * In log_badlogins add a newline after every sql query so that the resulting file can be editable * Add a force directive in log_badlogins. If uncommented it will force inserts even if there are sql errors. That can help in case there is one sql query which stops the whole failed logins logging system from working * Sort the servers list in failed_logins,user_stats,stats Ver 1.65: * Add a captions.conf file with a few configurable captions for now * Move the nas list to a separate file called naslist.conf * Add the ability to include configuration files in admin.conf * Add a page for clearing open sessions from the database called clear_opensessions.php3. Add it in the user toolbar * Move the userinfo page of user_admin to a separate file so that it can be easily changed to fit per installation needs * Add a conf/accounting.attrs allowing the customization of the attributes in the user_accounting, user_finger and failed_logins pages * Add a directive to determine if the administrator will be able to change the user password from the user edit page * Call mysql_escape_string before running the sql query * Use the sql_connect_timeout for the mysql driver * Add a help page for the badusers table * Also take the Session-Timeout in consideration when calcualting the remaining time in user_admin.php3 * Add regex matching in log_badlogins and don't expect the callerid to always be in numeric format * Small html corrections in user_toolbar.html.php3 * Add a HOWTO from Paris Stamatopoulos * create a doc directory and move the documentation files there * Add a note about the HOWTO in the README file * Add a few help pages for the nomadix radius attributes by Ulrich Walcher * Update the HOWTO with instructions about the ldap configuration directives and the scripts in the bin folder * Update the AUTHORS file * Check for the binaries used (mysql/snmpwalk) in the scripts in the bin folder before using them * Update the HOWTO file * Use the general_domain variable from the admin.conf file in log_badlogins instead of a new one * Add a sql_command directive in admin.conf containing the path to the mysql binary. That can be used by the scripts in the bin folder instead of setting a variable in each script * Add a general_nas_type and a per nas type directive and pass that to snmpfinger. Updated snmpfinger to also support lucent equipment apart from cisco * Update the HOWTO file with a few comments on the general_nas_type directive * Use the User-Password attribute instead of Password in user_test.php3 Ver 1.63: * Do an eval on the attribute description strings in the user_edit page. That will allow the login-time creation page to work properly. * Add a login-time creation page which will allow the administrator to create the login-time string through a gui instead of writing it directly in UUCP format. * Call lib/{ldap,sql}/user_info in user_info before displaying any information about the user * Add a configuration directive general_charset. Add a language meta tag in all pages * Use sql_extra_servers directive when adding users in the badusers table. Add a da_sql_host_connect() function to connect to a specific sql host * Fix a typo in lib/sql/attrmap.php3 * Add an entry in the FAQ about the Dialup-Access attribute * Add an entry in the FAQ about duplicate personal attributes in the user_admin page * Only show the personal attributes in the New User page if we have ldap or we are using the userinfo table in sql * Add a per nas finger_type directive * Update the TODO file * Add an entry in the FAQ about adding .php3 handling * Add a few installation notes * Fix a problem with user_stats.php3 * Update the README file with notes about the scripts present in the bin folder * Add a * Add support for regexp and like operators in accounting report generator * Limit the split() to 2 elements in lib/defaults.php3 * Create a AcctUniqueId before adding a row in radacct in log_badlogins. * Use Max-Monthly-Session not Max-Weekly-Session for the monthly limit * When checking the weekly limit check first that $remaining is numeric before doing any comparisons * Add a usage_summary parameter in user_finger. If it is passed then we only output a text like: "Online: Free: " which can be used in outside pages * Use $config[sql_usergroup_table] in show_groups.php3 * Add a config directive general_stats_use_totacct. If set we use the totacct table in the stats page instead of radacct * Small change in user_accounting.php3 * Escape " in login_time create page before parsing the login-time string * Add Service-Type in user_edit.attrs * In user_finger page if $user is NULL then set it to   * Add 3 more help pages from Stadler Karel for Service-Type,Framed-Protocol and Filter-ID * Make all scripts use the mysql binary instead of DBI and make the sql password even if it is empty * Make log_badlogins work with usernames containing spaces * Only delete sessions which are not open in truncate_radacct. Bug noted by Evren Yurtesen * Add a user input tag in user_stats.php3 * Change AcctStopTime = '0' with AcctStopTime IS NULL * Add a few more attribute help pages from Ulrich Walcher * Also check for $server != '' in stats.php3. Bug noted by Ulrich Walcher * Consider the account locked either if Dialup-Access == FALSE or if it is not set at all * Calculate weekly used time correctly (from Sunday 00:00:00) * Allow for defining the ldap_filter used when searching for a user. The filter supports dynamic variables like %u (username) and %U (username provided though http auth) * Add a configuration directive counter_monthly_calculate_usage to calculate the monthly usage time. Calculate it in user_admin if monthly_limit != 'none' or if this directive is set. Based on a report by "apellido jr., wilfredo p" * Add more comments in the admin.conf file * Show correct calculation of the montlhy usage time. * Don't show an account as locked if Dialup-Access does not exist and the mapping corresponds to 'none' attribute * Make clean_radacct and truncate_radacct work correctly * Fix a small bug in bytes2str. It will now also show GBs if appropriate * Add an entry about the failed_logins page * Update the help page for the lock message attribute * Update the badusers page to also use the general_accounting_info_order directive Ver 1.62: * Remove one sql query from user_admin which was not needed. * Instead of a query like "LIKE 'YYYY-MM-DD%'" use "AcctStopTime >= 'YYYY-MM-DD 00:00:00 AND AcctStopTime <= 'YYYY-MM-DD 23:59:59'" which will allow us to use sql indexes better. * Add a few comments in bin/clean_radacct * Add a new script bin/truncate_radacct which will delete all sessions from the radacct table which are older than a configurable number of days * Fix a typo in sql.attrmap. Fix by Evren Yurtesen * Work even when register_globals if off. Suggestion from Evren Yurtesen Also add an entry in the FAQ about that. * We don't need ORDER BY GroupName in show_groups.php3 since we have GROUP BY * Use CISCO-POP-MGMT-MIB in snmpfinger instead of CISCO-CALL-HISTORY-MIB. Thanks to Evren Yurtesen for the suggestion. * Remember a few things in the user_test page. Also add another configuration file directive general_radius_server_auth_proto specifying the default authentication protocol of the radius server (pap or chap). * Replace single quotes with double quotes in log_badlogins * Add a missing * Add sql_use_http_credentials configuration directive to connect to the sql database using the http user credentials (that way there can be more than one administrator usernames, each with different privileges on the sql database). * Add more error messages when interacting with the SQL database * Add sql_connect_timeout and sql_extra_servers configuration directives to be used by the log_badlogins script * In log_badlogins create a separate sql input file for each sql server and append sql commands to it. If the sql command succeeds we delete the corresponding input file. That way if an sql server is down we store the accounting info in the input file and then send it all when it comes back up. * Add a directive sql_debug. Add debugging statements in the sql library * Add a directive ldap_debug. Add debugging statements in the ldap library * Add debug statements in the pg driver * In debug, output the sql queries in italic. Refer to enabling debugging in the FAQ * Don't include user_info.php3 in the user_test page. * Make things a little bit more simple in lib/ldap/change_attrs.php3 * Fix a small bug in lib/ldap/create_user.php3. Unset the mod array before adding any values to it. * Fix a small problem with debugging * Do a write lock in radacct before truncating it in truncate_radacct * In user_new show a select box with all the available groups. Based on an idea by Karel Stadler (kstadler) * Add a column Admin in the badusers table which will contain the administrator username if that is available * Add two new tables totacct and mtotacct containing per user aggregated statistics for each day and month respectively. Also add two corresponding scripts in the bin folder, tot_stats and monthly_tot_stats. Lastly, create a new page, user_stats.php3 which will show the top users in connections or connections duration based on the data in the totacct table. * Add a few comments in the tot_stats and monthly_tot_stats scripts * Add support for ! in usernames in log_badlogins * Call gethostbyaddr with an @ in front to suppress error messages * Also add support for @ in usernames in log_badlogins Ver 1.61: * Add a string encoder for greek * If general_decode_normal_attributes is set then encode attributes in lib/ldap/change_info. In the near future language specific user attributes will be added in the change info and new user pages. Remove comments from admin.conf about the change info page not working if this directive is used. * When spliting cn in lib/ldap/create_user.php3 limit the split to 2 new elements not 3. * Fix a few bugs in log_badlogins * Fix a parse error in failed_logins.php3 * Fix a bug in lib/defaults.php3 which did not allow the default.vals file to be used correctly * Include password.php3 in lib/ldap/password_check.php3 * When searching a user in ldap through the find page only try to find the users which have a uid attribute (username) * Allow selecting a specific access server in the failed logins page * In the user admin page use AcctStartTime not AcctStopTime when calculating usage for the last 7 days * Also show server:port in the user test page (so that it shows when used for server checks) * Now the create user page should work with sql * Make the default general_lib_type sql instead of ldap Ver 1.60: * Use require_once when including lib/functions.php3 in lib/sql * In the buttons toolbar Edit User should not be clickable. * Add an arrow gif in htdocs/images to be used in the buttons page when adding multiple finger pages * In snmpfinger also consider '-' as a valid character for a username * Add support for realm in username and allow for realm striping in the web pages and in log_badlogins * Add a few more comments in the admin.conf * Update the FAQ with an entry about the Online Users page not showing anything. * Update the FAQ with an entry about sessions. * Allow the user to add extra attributes in the test user page * Add a few comments in log_badlogins, support auth logs containing the password, work nice when the client is localhost, add an option to scan the whole radius.log and add failed logins in the sql database (can be used for initialization). * html fixes in accounting.php3 * Fix a problem in user_accounting when NASIPAddress is not set. * Use CISCO-AAA-SESSION-MIB in snmpfinger * In lib/ldap/functions.php3 only ask for the cn attribute in ldap_search not the whole entry. That should make user_finger a lot faster when the user database is in ldap * In lib/functions.php3 pass a second argument to date2timediv with the current time. user_finger calls that function for each online user so we now don't need to do a lot of calls to time() but only one. That should make user_finger somewhat faster. * Fix a small issue with the general_accounting_info_order * Fix a problem in failed_logins when NASIPAddress is not set. * Allow for multiple regular profile attributes in a user entry. * Allow for normal ldap user attributes to be utf8 encoded instead of ascii. Changing attribute values through user_info will not work in that case. * Fix a small bug in lib/ldap/defaults.php3. We should not be using $i in a for() loop but a new variable * Add a comment in admin.conf about ldap server failover * Map a specific username to the directory manager if we are using ldap and http authentication Ver 1.59: * Small html fixes in user_edit.php3 and password.php3 * Show number of failed logins in the last 7 days in the user admin page * Show date in the user/server test page * In config.php3 include a relative admin.conf file not an absolute * Add an entry in the FAQ about php magic quotes * Escape double quotes in attribute values in the user edit page * Fix a bug in lib/sql/change_passwd.php3 when not using operators. Bug report from Sheldon Fougere * Add the caller id in the connection status attributes in the show user page * Allow for multiple default values. Also add a generic flag in ldap attrmap. If it exists then the attribute is generic and user values *do not* overwrite default values. The operators in the generic attribute can be used for that. The same is very difficult to implement for sql, so for now user values overwrite default values in sql (user edit page). A lot of code and a lot of files where changed so there may be bugs somewhere. * In the user edit page print a message under the User Password field about if it exists or not. Update the user_info.php3 lib files to check for it. * In lib/ldap/defaults.php3 Dialup-Access should not be added in the default_vals. It is not inherited. * If we are editing a group show a comment that in the radiusd sql module the group tables are evaluated after the user tables. As a result user values should in general overwrite default values. * Add support for the default_user_profile of the sql module in lib/sql/defaults.php3 * In sql.attrmap User-Password should map to User-Password, not Password * If an sql attribute is not contained in sql, assume that it has the same name as in dialup_admin and that it is a reply item. Add a comment for that in conf/sql.attrmap. * Change the way radius attributes are read from the sql database. The change should make things somewhat faster. Create a reverse mapping from radius attributes to dialup_admin attributes. * Add a configuration directive called ldap_use_http_credentials. If it is set to yes then we try to connect to the ldap server with the username/password given in http authentication, not those contained in admin.conf. That way multiple admins with different permissions on the ldap tree can work on a single dialup_admin. * With the same logic we allow for multiple buttons html pages. We now create a folder html/buttons which by default contains a folder default. If the user logs in with http authentication then we try to open the file html/buttons//buttons.html.php3. If we can't we open html/buttons/default/buttons.html.php3. That way we can create muiltiple views of say the online users page based on which admin requests the page. * Call config.php3 before outputing any html. * Add sessions in order to cache the various mappings. Add a corresponding configuration directive general_use_session. Also add a session cache destroy page. * Also cache the admin.conf if use_session is set to 1 in config.php3 * Fix a few bugs * Remove the auto password generator from the user edit page. It has no meaning since the password is not shown * In lib/sql/defaults.php3 instead of doing a select for each group the user belongs to, do one select with a where in () caluse. * Also cache the default.vals file. * Update documentation * Only connect and bind to the ldap server if we haven't done that before. * Remove previous change. It was causing problems * In the user test page ignore comments from the auth.request file * Add a new config directive, ldap_write_server. If it is set then when we update the directory we try to connect to that one instead of the ldap_server. That way we can read from the fast read-only replicas and write to a slower master. * Fix a few more bugs * Add a failed logins page, to show the most recent failed logins. * Fix a bug in the failed logins page * Change use of AcctStartTime with AcctStopTime in failed_logins.php3 to match that in user_admin * Fix a bug with failed logins in user_admin. * Add the failed logins page in the buttons page * Add a missing WHERE UserName = '$login' in the UPDATE statement in lib/sql/change_info.php3. Patch by Eddie Bindt Ver 1.55: * Update the FAQ about missing attributes from the user/group edit pages and add a few comments in the configuration files * Add support for the Expiration attribute. Add it in the sql attribute map, in user_edit.attrs and check for it in user_admin * Add a few more keys in the userinfo and badusers tables. * Fix a problem with lib/sql/defaults.php3 where the first character in the default value when using operators was set to the opeator * Add a user find page. User can be searched based on the full name, department or RADIUS attribute. The radius attribute should be included in the _user_ profile, not in a group/regular/default profile. * Add support for the user ldap regular profile attribute in user_edit.attrs * Fix a stupid bug in accounting.php3. We should not use the show_attrs array. Ver 1.54: * Add attributes for the sql group tables in admin.conf. Now SQL group support should really work! Ver 1.53: * html fixes in show_groups.php3 * When reporting sql errors also print the output of da_sql_error * When updating ldap user information don't do an update if the new attribute value is '-' (default value) * Comment out Reply-Message in conf/user_edit.attrs since in sql it maps to the same attribute as the lock message Ver 1.52: * Add Reply-Message in conf/user_edit.attrs so that it appears in the user/group edit pages * Allow the administrator to specify a group in the New User page. Update lib/sql/create_user.php3 to add the user to the specified group * Call user_info.php3 and defaults.php3 in user_new.php3 after creating a user * Only run if $login is not NULL in lib/sql/defaults.php3 * In group admin add a button to administer the selected user which will redirect the administrator to the corresponding user_admin page * Add a show_groups.php3 to show all active user groups Ver 1.51: * Only call user_info.php3 in user_new.php3 when we are creating a user * Fix a bug with personal information attributes in user_new.php3 Ver 1.50: * Add support for groups in SQL. Added several new files and modified a few more. * Default values in SQL are now extracted from the group membership. Added a lib/sql/defaults.php3 file. As a result the default operator is not '=' anymore but whatever we find in the group check and reply tables. * In lib/sql/user_info.php3 set user_exists in more than one places. * Add support for the '=*' and '!*' operators * Added a HELP_WANTED file describing what are the major things missing which people could contribute. * Updated TODO * Added a help page for the Session Timeout and Idle Timeout attributes. * The new group page should only be available if the general library type is sql. * Fix a small bug in lib/sql/create_user.php3 where work and home phone were stored in the wrong fields. * Set personal information attributes in lib/sql/user_info.php3 to default values. * Add a page to change the user's personal information. Changed the user toolbar and added htdocs/user_info.php3 along with lib/{sql,ldap}/change_info.php3 * Print a message if we can't connect to the ldap server in lib/ldap/user_info.php3 * Use a textarea for new members in group_admin.php3 and group_new.php3. Update lib/sql/create_group.php3 and lib/sql/group_admin.php3 * Set a few more personal information attributes to defaults in lib/sql/user_info.php3 * Fix a typo for department * Set personal information attributes to defaults in lib/ldap/user_info.php3 * Have adddress and home address in user personal info * Set $user_info in lib/{ldap,sql}/user_info.php3 and only if the user exists and has personal info * Show language attributes only if general_prefered_lang is not 'en' Ver 1.30: * Add limit of results returned in accounting.php3 * Fix a bug in time2strclock() in lib/functions.php3. Seconds ammount more than 9 would not show. Bug noted by Timophey * Reaarange a few things in user_admin. Put Subscription Analysis first and 'Account Status' second. Make a few things bold. * Change log_badlogins to use the mysql binary instead of the DBI module. That way we don't have any dependencies and we don't need to bother with connection maintainance (dead mysql connections etc). * html fixes in user_finger.php3 * Fix a bug in lib/add_badusers.php3 which did not allow inserts in the badusers table. * Make lib/ldap/password_check.php3 behave properly when it is passed a null password * Allow for daily/weekly/monthly limits to be set to none and show correct results in the show user page * Fix a small bug in user_admin.php3. * Pass the whole password as salt in da_encrypt() in password_check.php3 * Refresh the online users page every 50 secs. Patch by Alexandre Strube * Check if the last logged in server and client ip are valid before calling gethostbyaddr * If the same attribute appears more than once in the user edit page then show a count of the number of occurences next to the attribute name * Add a server argument to user_finger.php3. If it is set then the page will only show the logged in users in that access server instead of all of them. Update the README with documentation for that fact. Ver 1.29: * Add general_ld_library_path directive and set LD_LIBRARY_PATH accordingly (used in snmpfinger and radaclient). * Add general_finger_type directive to determine if we will use snmpfinger in user_finger.php3 * Fix a bug in config.php3 when we have a directive containing ':' * Fix a bug in lib/ldap/change_attrs.php3 that did not allow changing more than one value of a multivalued attribute simultaneously. * Added selection of ordering in user_accounting.php3. Now it can be either ascending (older records first) or descending (most recent records first). Added a corresponding configuration directive. * Added operator support in sql. The eq(=),set(:=) and add(+=) operators are supported. Added an sql_use_operators configuration directive. Hope everything works. * Fixed a bug in sql/change_attrs which did not allow multi valued attributes in sql. * unset item_vals before adding info in ldap and sql user_info files. * Add support for the rest of the operators. Created the lib/operators.php3 file containing helper functions * Fix a small bug in log_badlogins. The nas domain should be a variable not hard coded. * Fix a bug in lib/sql/delete_user.php3. Call da_sql_query with the correct arguments Ver 1.28: * Make user_delete.php3 print something when a user is deleted * Cache nas hostname lookups in user_accounting Ver 1.27: * Allow for variable expansion in the configuration file. Something like: general_base_dir: /usr/local/dialup_admin general_default_file: %{general_base_dir}/conf/default.vals * Small changes in the README file * A few corrections in the sql drivers * Enlarged the textboxes in the user_edit page * Created a folder help * Added a help page for: o Login-Time o Simultaneous-Use o Dialup-Access o Framed-Compression o Port-Limit o Lock Message o Framed-IP-Address Ver 1.26: * A few bugfixes for the general sql code (typo mistakes mostly) Ver 1.25: * Deleted a mysql_close from lib/mysql/create_user since we now have persistent sql connections * Removed the select_db() from accounting.php3 since it is not needed * A lot of html changes in accounting.php3 * Changed the sql code to be modular. Now under lib we don't have a mysql directory but a sql directory with a directory drivers which contains the database specific functions. As a result all calls to mysql* functions where changed to call da_sql* functions. Right now mysql should work and postgresql *may* work It is not tested though. Hopefully things will come back to being stable in a few days. * Added sql_port and sql_type configuration file directives Ver 1.20: * Fixed a bug in lib/ldap/change_attrs. When we modify an attribute do an ldap_mod_del($mod) and then a ldap_mod_add($add_r) * In accounting.php3 show the attribute description instead of the attribute name. Ver 1.19: * In lib/ldap/check_password.php3 don't do a user search but use the already available user DN * Remove the language support from the get_user_info() functions. They are only used in the user_finger page * In user_state show weekly usage for the week starting from sunday 00:00, not for the last 7 days * Show upload/download when connected or for the last time the user connected * Fixed a few minor problems with the help and about pages Ver 1.18: * Fixed a small problem with total upload,download numbers in user_admin * Fixed a major problem in the accounting report generator when adding an attribute check. Now it should be all OK. * Fixed a small bug in lib/mysql/functions.php3. Bug found be galileo@microsky.net Ver 1.17: * Fixed a few more problems in the mysql code * Updated README * the help page now prints the README file. It also has a common layout with the other pages * Changed the about page to have a common look with the other pages. Ver 1.16: * Fixed a few typing mistakes in mysql.attrmap * If the corresponding attribute name (in ldap or mysql) is 'none' then do not edit/add it. Based on a bug report by galileo@microsky.net * Fixed a few errors in lib/attrshow.php3 Ver 1.15: * Added user test page. It will use radclient to send a radius access-request to the radius server and check the response. This page is also used to check that the radius server is working fine. Added user_test.php3 and a few config file parameters. * Support for multi valued attributes. * Changed cleartext encryption name from none to clear * Renamed the general_sql_row_limit configuration directive to sql_row_limit Ver 1.12: * Added an FAQ * Small changes in html code * Small changes in the README file * Fixed a small problem in delete_user from ldap * Removed the Base64 encode since it was causing problems Ver 1.11: * Changed all ldap_bind() to use the ldap bind DN and password. Should have been the default behaviour * Do a Base64 encode in ldap/change_password.php3 before sending the password to the ldap server * Added support for module messages in log_badlogins and user_accounting * Updated documentation Ver 1.10: * Added support for users in mysql database. All bugs are welcome. To activate just use mysql as library_type * Added support for salt in crypt.php3 * Added userinfo table to keep information for users (Name,Phone etc). Added two corresponding values in admin.conf * Added mysql.attrmap for mysql support * Added TODO * Added persistent connections for mysql (mysql_pconnect()) Ver 1.00: * Added password change facility in user_edit. Support for multiple password encryption methods * Added user deletion page user_delete.php3 with corresponding ldap lib code * Moved the second user_info.php3 include in user_edit to the correct location. Also used isset instead of == '' * Moved the action toolbar (show,edit,accounting...) into a separate html file * Added the nas model in user_finger.php3 Ver 0.99.8: * Added the caller id in the finger facility * Changed the start date in the badusers file to 0000 * Added the out of quota message in user_admin * fixed a few problems with the html code in user_admin.php3 * calculate account status in user_admin for the last week only * Change font color to red if used time > corresponding limit (weekly or daily) * Added the user_stats.php3. It can be used by outside pages to get a quick overview of the status of the user. It will return the following fields separated by new lines: account_status(active or inactive),lock message,weekly limit,daily limit, weekly used,weekly connections,daily used,daily connections * fixed a bug in the subscription analysis in user_admin.php3 * calculate weekly used from sunday 00:00:00 when the counters reset * added clean_radacct which will clean radacct entries which have been open for more than a day. It will not do any harm even if it is incorrect since when rlm_sql runs if the update operation fails then it will fall back to insert (see sql.conf) * added log_badlogins. It will continuously read the radius.log file and log to the radacct table all login incorrect and multiple logins with a corresponding acctterminatecause. user_accounting.php3 is already prepared for this (it will show those entries in red) * fix a small bug with null values in change_vals.php3 of the ldap lib Ver 0.99: * Added the badusers table * Added the default and regular profile from ldap for user_edit * Added the snmpfinger in the finger facility so that it will not relly on the sql database. * Added the new user facility * Added support for the Lock Message facility * Various bug fixes and enhancements Ver 0.31: * Added the @ sign in the {mysql,ldap}_{open,close} functions so that they don't show error messages * Changed double quotes with single quotes where applicable for performance reasons freeradius-server/dialup_admin/Makefile000066400000000000000000000037161257552170400206200ustar00rootroot00000000000000# # Makefile # # Version: $Id$ # include ../Make.inc DIALUP_PREFIX := /usr/local/dialup_admin DIALUP_DOCDIR := $(DIALUP_PREFIX)/doc DIALUP_CONFDIR := $(DIALUP_PREFIX)/conf all: install: install -d -m 0755 $(R)/$(DIALUP_PREFIX) install -d -m 0755 $(R)/$(DIALUP_DOCDIR) install -d -m 0755 $(R)/$(DIALUP_CONFDIR) install -d -m 0755 $(R)/$(DIALUP_PREFIX)/bin find doc Changelog README -name CVS -prune -o -type f -print0 | \ xargs -0 install -m 0644 -t $(R)/$(DIALUP_DOCDIR) find conf -name CVS -prune -o -type f -print0 | \ xargs -0 install -m 0644 -t $(R)/$(DIALUP_CONFDIR) find htdocs html lib sql -name CVS -prune -o -print | \ while read file; do \ if [ -d "$$file" ]; then \ install -d -m 0755 "$(R)/$(DIALUP_PREFIX)/$$file"; \ else \ install -m 0644 "$$file" "$(R)/$(DIALUP_PREFIX)/$$file"; \ fi; \ done sed -e 's#/usr/local/dialup_admin#$(DIALUP_PREFIX)#' \ -e 's#/usr/local/radiusd#$(prefix)#' \ -e 's#general_raddb_dir: %{general_radiusd_base_dir}/etc/raddb#general_raddb_dir: $(raddbdir)#' \ -e 's#general_clients_conf: /usr/local/etc/raddb/clients.conf#general_clients_conf: $(raddbdir)/clients.conf#' \ -e 's#%{general_base_dir}/conf#$(DIALUP_CONFDIR)#' \ -e 's#/usr/local/bin#$(bindir)#' \ conf/admin.conf > $(R)/$(DIALUP_CONFDIR)/admin.conf sed -e 's#../../README#$(DIALUP_DOCDIR)/README#' \ htdocs/help/help.php > $(R)/$(DIALUP_PREFIX)/htdocs/help/help.php for binfile in backup_radacct clean_radacct clearsession log_badlogins monthly_tot_stats showmodem snmpfinger sqlrelay_query tot_stats truncate_radacct; do \ sed -e 's#/usr/local/bin/#${bindir}#' \ -e 's#/usr/local/dialup_admin/conf/#$(DIALUP_CONFDIR)/#' \ bin/$$binfile > $(R)/$(DIALUP_PREFIX)/bin/$$binfile ; \ chmod 0755 $(R)/$(DIALUP_PREFIX)/bin/$$binfile; \ done sed -e 's#/usr/local/dialup_admin#$(DIALUP_PREFIX)#' \ bin/dialup_admin.cron > $(R)/$(DIALUP_PREFIX)/bin/dialup_admin.cron .PHONY: all install freeradius-server/dialup_admin/README000066400000000000000000000134131257552170400200330ustar00rootroot00000000000000dialup_admin is a web based administration interface for the freeradius radius server. It is written in PHP4 (although the files have an extension of php for historical reasons). It is modular and right now it assumes that user information is stored in an ldap server or an sql database and accounting in an sql server. Extra documentation from Stadler Karel (): http://kstadler.ch/index.php?topgroupid=1&subgroupid=14&groupid=11 There is also a nice HOWTO in the doc folder INSTALLATION: Put dialup_admin in /usr/local/dialupadmin Create a link from your htdocs directory to /usr/local/dialupadmin/htdocs Edit /usr/local/dialupadmin/conf/* files to match your needs There are also a few more things included: * sql/badusers.sql: It will create a table named badusers which can be used to hold the history for badusers (date,action) * sql/userinfo.sql: It will create a table named userinfo which contains personal information for users stored in the sql database. This can be used if a sql database is used to store user profiles (not ldap). * bin/log_badlogins: It will constantly check the radiusd.log file and add all login-incorrect, invalid-user, outside of allowed login time and multiple-login cases to the radacct table with acctstarttime=acctstoptime, acctsessiontime=0 and acctterminatecause containing the reason. If the failing module sent back a module message then it will also appear in the terminate cause. You will need to setup the $mysql and $tmpfile variables to suite your mysql installation and needs. Perl module Date::Manip is needed by the script. * bin/clean_radacct: It will delete all entries in the radacct table with a starttime > 1 day and stoptime = 0. It will not do an harm even if it deletes valid entries since radiusd will fall back to insert if update fails. * bin/truncate_radacct: It will delete sessions from the radacct table which are older than a configurable number of days * bin/tot_stats: Update the totacct table with aggregated daily accounting information for each user. We keep a row per user for each day. * bin/monthly_tot_stats: Log in the mtotacct table aggregated accounting information for each user spaning in one month period. If the current month has not ended it will log information up to the current month day The structure of the tree is: conf:: Contains various configuration files. conf::admin.conf=> The main configuration file. The directives used should be easily understood conf::config.php=> Just a helper php4 for reading the admin.conf file. conf::default.vals=> Contains the default values for check and reply items. If you also use the users file except for the ldap/sql databases fill in the default values you have inserted for the users.Else comment them out. conf::sql.attrs=> Contains inmformation about the sql attributes. This is used by the accounting report generator (accounting.php). conf::user_edit.attrs=> Contains the attributes that user_edit.php will show. Just uncomment those which you want to be displayed. conf::extra.ldap-attrmap=> Contains a few items not included in ldap.attrmap which are used only by dialup_admin Things like User-Password and Dialup-Lock-Msg. Use none for attributes that are not known by the radius or ldap server. conf::sql.attrmap=> Contains the Attribute map for the sql database. Use none for attributes that are not known by the radius server. conf::auth.request=> Contains value pairs sent in the test packets which are sent from the test user/server pages. htdocs:: Contains the basic php files htdocs::index.html=> The main index file. Just contains the frames tags htdocs::content.html=> Change this file to include the greeting of your choise htdocs::buttons.php=> This will open the corresponding buttons html file in the html/buttons folder htdocs::style.css=> CSS style file. Change it to match your preferences htdocs:: user_state.php => It can be used by outside pages to get a quick overview of the status of a user. It will return the following fields separated by new lines: account_status(active or inactive),lock message,weekly limit,daily limit, weekly used,weekly connections,daily used,daily connections, active sessions number,active sessions time htdocs:: user_finger.php => It will finger the nas(es) and show the logged in users. If an argument server is passed then it will only show users for the specific access server. If an argument usage_summary is passed then it will only show a line like: "Online: Free: " which can be used by other pages htdocs::failed_logins.php => It will show all the failed logins as logged in the radacct table by the log_badlogins script html:: Contains the html code for a few pages html::user_admin.html.php => html code for the user_admin page html::stats.html.php => html code for the stats page html::user_toolbar.html.php => the user toolbar (show,edit,accounting...) which appears in almost all pages html::group_toolbar.html.php => the toolbar shown in the group manipulation pages html::/buttons contains a folder default which contains a buttons.html.php file. When a user is connecting with http authentication we first try to open the file in the folder . If that fails we open the file in the default folder. That way each admin can have a different view of the buttons bar (for example see different finger pages). lib:: Contains the library items lib::ldap=> The ldap files lib::lang=> Allow for multiple languages to be supported lib::crypt=> Allow for multiple encryption schemes (for user passwords) lib::sql=> Contains the sql library files. There is also a directory drivers which contains functions for various sql databases (mysql and postgresql for the time being). The rest: The rest are the php4 files. Normally, you should not need to change anything in them. freeradius-server/dialup_admin/bin/000077500000000000000000000000001257552170400177215ustar00rootroot00000000000000freeradius-server/dialup_admin/bin/Changelog.GuyFraser000066400000000000000000000033561257552170400234500ustar00rootroot00000000000000Fri Dec 19 2003 --------------- Fixed a couple bugs. Tested against current CVS, and all programs appear to work. Wed Dec 17 2003 --------------- Added configurable entries to admin.conf. TODO: Write a proper config file parser to get recursive entries from config file. Tue Dec 16 2003 --------------- File Compatiblity Change ----------------------- --------------- --------------------------------------- clean_radacct MySQL/PG Added PG compatability log_badlogins MySQL/PG Added PG compatability " Added routine to determine ip from the " FreeRadius clients.conf file. monthly_tot_stats MySQL/PG Added PG compatability showmodem UCD/NET Made compatabile with Net/UCD SNMP " Cleaned up output formatting. snmpfinger UCD/NET Made compatabile with Net/UCD SNMP tot_stats MySQL/PG Added PG compatability " Added a delete request. truncate_radacct MySQL/PG Added PG compatability These utilities have been updated to work with NET-SNMP, and have been modified to work with PostgreSQL. The argument order and options for NET-SNMP have changed from UCD-SNMP's requirements. Since most current Unix type systems are using the newer NET-SNMP, I have included the changes for everyones benefit. I have also modified some scripts : log_badlogins - I changed it to use the data from the FreeRadius clients.conf file to determine the IP address of each NAS. I did this because in my case, and likely that of many others, the shortname from the radius log file is not shortname.domain.com, where domain.com is defined in admin.conf. showmodem - I cleaned up the output presentation. Path to admin.conf, set to /usr/local/dialup_admin/conf/ for all scripts. Guy Fraser Network Administrator The Internet Centre Edmonton, Alberta, Canada. freeradius-server/dialup_admin/bin/backup_radacct000077500000000000000000000045731257552170400226060ustar00rootroot00000000000000#!/usr/bin/perl use POSIX; use File::Temp; $conf=shift||'/data/local/dialupadmin/conf/admin.conf'; $back_days = 80; $backup_directory = "/logs/radiusd/accounting"; open CONF, "<$conf" or die "Could not open configuration file\n"; while(){ chomp; ($key,$val)=(split /:\s*/,$_); $sql_server = $val if ($key eq 'sql_server'); $sql_type = $val if ($key eq 'sql_type'); $sql_port = $val if ($key eq 'sql_port'); $sql_username = $val if ($key eq 'sql_username'); $sql_password = $val if ($key eq 'sql_password'); $sql_database = $val if ($key eq 'sql_database'); $sql_accounting_table = $val if ($key eq 'sql_accounting_table'); $sqlcmd = $val if ($key eq 'sql_command'); } close CONF; die "sql_command directive is not set in admin.conf\n" if ($sqlcmd eq ''); die "sql command '$sqlcmd' not found or does not seem to be executable\n" if (! -x $sqlcmd); if ($sql_type eq 'mysql'){ $sql_password = ($sql_password eq '') ? '' : "-p$sql_password"; } $sql_password =~ s/(\W)/\\$1/g; ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime; $date = POSIX::strftime("%Y-%m-%d",$sec,$min,$hour,($mday - ($back_days - 1)),$mon,$year,$wday,$yday,$isdst); $date2 = POSIX::strftime("%Y-%m-%d",$sec,$min,$hour,($mday - ($back_days + 1)),$mon,$year,$wday,$yday,$isdst); $date3 = POSIX::strftime("%Y%m%d",$sec,$min,$hour,($mday - $back_days),$mon,$year,$wday,$yday,$isdst); if (POSIX::strftime("%Y-%m-%d %T",localtime) eq $date){ die "Could not set correct back date.\n"; } $query = "SELECT * FROM $sql_accounting_table WHERE AcctStopTime < '$date' AND AcctStopTime > '$date2';"; print "$query\n"; my ($fh, $tmp_filename) = tempfile() or die "Could not open tmp file\n"; print $fh "ALTER SESSION SET NLS_TIMESTAMP_TZ_FORMAT='YYYY-MM-DD HH24:MI:SS.FF TZH:TZM';\n" if ($sql_type eq 'oracle'); print $fh $query; close $fh; $comm = "$sqlcmd -B -h $sql_server -u $sql_username $sql_password $sql_database < $tmp_filename >$backup_directory/$date3" if ($sql_type eq 'mysql'); $comm = "$sqlcmd -U $sql_username -f $tmp_filename $sql_database >$backup_directory/$date3" if ($sql_type eq 'pg'); $command = "$sqlcmd $sql_username/$pass" . "@" . "$sql_database <$tmpfile.$server" if ($sql_type eq 'oracle'); $command = "$sqlcmd '$sql_server' '$sql_port' '' '$sql_username' '$sql_password' < $tmp_filename >$backup_directory/$date3" if ($sql_type eq 'sqlrelay'); `$comm`; `/usr/local/bin/gzip -9 $backup_directory/$date3`; freeradius-server/dialup_admin/bin/clean_radacct000077500000000000000000000036031257552170400224140ustar00rootroot00000000000000#!/usr/bin/perl # # Clean stale open sessions from the radacct table. # we only clean up sessions which are older than $back_days # Works with mysql and postgresql # use POSIX; use File::Temp; $conf=shift||'/usr/local/dialup_admin/conf/admin.conf'; $back_days = 35; open CONF, "<$conf" or die "Could not open configuration file\n"; while(){ chomp; ($key,$val)=(split /:\s*/,$_); $sql_type = $val if ($key eq 'sql_type'); $sql_server = $val if ($key eq 'sql_server'); $sql_username = $val if ($key eq 'sql_username'); $sql_password = $val if ($key eq 'sql_password'); $sql_database = $val if ($key eq 'sql_database'); $sql_accounting_table = $val if ($key eq 'sql_accounting_table'); $sqlcmd = $val if ($key eq 'sql_command'); } close CONF; die "sql_command directive is not set in admin.conf\n" if ($sqlcmd eq ''); die "sql command '$sqlcmd' not found or does not seem to be executable\n" if (! -x $sqlcmd); if ($sql_type eq 'mysql'){ $sql_password = (!$sql_password) ? '' : "-p$sql_password"; } $sql_password =~ s/(\W)/\\$1/g; ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime; $date = POSIX::strftime("%Y-%m-%d %T",$sec,$min,$hour,($mday - $back_days),$mon,$year,$wday,$yday,$isdst); print "$date\n"; if (POSIX::strftime("%Y-%m-%d %T",localtime) eq $date){ die "Could not set correct back date.\n"; } $query = "DELETE FROM $sql_accounting_table WHERE AcctStopTime IS NULL AND AcctStartTime < '$date';"; print "$query\n"; my ($fh, $tmp_filename) = tempfile() or die "Could not open tmp file\n"; print $fh $query; close $fh; $command = "$sqlcmd -h$sql_server -u$sql_username $sql_password $sql_database < $tmp_filename" if ($sql_type eq 'mysql'); $command = "$sqlcmd -U $sql_username -f $tmp_filename $sql_database" if ($sql_type eq 'pg'); $command = "$sqlcmd '$sql_server' '$sql_port' '' '$sql_username' '$sql_password' < $tmp_filename" if ($sql_type eq 'sqlrelay'); `$command`; freeradius-server/dialup_admin/bin/clearsession000077500000000000000000000037411257552170400223460ustar00rootroot00000000000000#!/usr/bin/perl $login = 'nas-login'; $passwd = 'nas-password'; $host=shift || ''; $type = shift || 'snmp'; $nastype = shift || 'cisco'; $username=shift || ''; $sessionid = shift || ''; $port = 0; $comm = ''; if ($type eq 'snmp'){ $comm = shift || 'public'; } if ($type eq 'telnet'){ $port = shift || 0; } die "No \$host argument given\n" if ($host eq ''); die "No \$username argument given\n" if ($username eq ''); if ($nastype eq 'cisco' && $type eq 'telnet'){ die "Usage: clearsession \$host telnet cisco \$username \$sessionid \$port\n" if ($port == 0); if (eval require Net::Telnet::Cisco){ Net::Telnet::Cisco->import(); my $session = Net::Telnet::Cisco->new(Host => $host); $session->login($login, $passwd); if ($port >= 20000){ my @output = $session->cmd("sh caller user $username"); foreach $line (@output){ if ($line =~ /User: $username, line (Vi\d+),/){ $session->cmd("clear interface $1"); } } } else{ $session->cmd("clear line $port\n"); } $session->close; } } if ($nastype eq 'cisco' && $type eq 'snmp'){ $SNMPGET="/usr/local/bin/snmpget"; $SNMPSET="/usr/local/bin/snmpset"; die "Could not find snmpwalk binary. Please make sure that the \$SNMPGET variable points to the right location\n" if (! -x $SNMPGET); die "Could not find snmpset binary. Please make sure that the \$SNMPSET variable points to the right location\n" if (! -x $SNMPSET); die "Usage: clearsession \$host snmp \$username cisco \$sessionid \$community\n" if ($sessionid eq '' || $comm eq ''); if ($sessionid ne '' && $username ne ''){ print "$SNMPGET -v2c -c $comm $host .iso.org.dod.internet.private.enterprises.9.9.150.1.1.3.1.2.$sessionid\n"; $walk =`$SNMPGET -v2c -c $comm $host .iso.org.dod.internet.private.enterprises.9.9.150.1.1.3.1.2.$sessionid`; unless ($walk =~ /^$/){ if ($walk =~ /$username/){ print "FOUND: $username\n"; `$SNMPSET -v2c -c $comm $host .iso.org.dod.internet.private.enterprises.9.9.150.1.1.3.1.5.$sessionid i 1`; } } } } freeradius-server/dialup_admin/bin/dialup_admin.cron000066400000000000000000000004251257552170400232330ustar00rootroot000000000000001 0 * * * /usr/local/dialup_admin/bin/tot_stats >/dev/null 2>&1 5 0 * * * /usr/local/dialup_admin/bin/monthly_tot_stats >/dev/null 2>&1 10 0 1 * * /usr/local/dialup_admin/bin/truncate_radacct >/dev/null 2>&1 15 0 1 * * /usr/local/dialup_admin/bin/clean_radacct >/dev/null 2>&1 freeradius-server/dialup_admin/bin/log_badlogins000077500000000000000000000162351257552170400224610ustar00rootroot00000000000000#!/usr/bin/perl # # Log failed logins in the sql database # Works with mysql, postgresql and Oracle # It will read the sql parameters from the admin.conf file # # Usage: # log_badlogins [] [all] # # Defaults: # radius.log: none # admin.conf: /usr/local/dialup_admin/conf/admin.conf # all: no. Go to the end of the file. Don't read it all. use Date::Manip qw(ParseDate UnixDate); use Digest::MD5; use File::Temp; $|=1; $file=shift||'none'; $conf=shift||'/usr/local/dialup_admin/conf/admin.conf'; $all_file=shift||'no'; # # Uncomment to force inserts even if there are sql errors. That can # help in case there is one sql query which stops the whole failed # logins logging system from working #$force=1; # # # CHANGE THESE TO MATCH YOUR SETUP # #$regexp = 'from client localhost port 135|from client blabla '; $tmpdir=tempdir( CLEANUP => 1 ); $tmpfile="$tmpdir/sql.input"; # $verbose = 0; # open CONF, "<$conf" or die "Could not open configuration file\n"; while(){ chomp; ($key,$val)=(split /:\s*/,$_); # Fixme : recursivly solve %{.*} replacement for $val # Fixme: Conf should be put in an associative array $sql_type = $val if ($key eq 'sql_type'); $sql_server = $val if ($key eq 'sql_server'); $sql_username = $val if ($key eq 'sql_username'); $sql_password = $val if ($key eq 'sql_password'); $sql_database = $val if ($key eq 'sql_database'); $sql_accounting_table = $val if ($key eq 'sql_accounting_table'); $realm_strip = $val if ($key eq 'general_strip_realms'); $realm_del = $val if ($key eq 'general_realm_delimiter'); $realm_for = $val if ($key eq 'general_realm_format'); $domain = $val if ($key eq 'general_domain'); $sql_timeout = $val if ($key eq 'sql_connect_timeout'); $sql_extra = $val if ($key eq 'sql_extra_servers'); $sqlcmd = $val if ($key eq 'sql_command'); $clients= $val if ($key eq 'general_clients_conf'); } close CONF; open CLIENTS, "<$clients" or die "Could not open $clients file\n"; while(){ chomp; s/^\s*//g; s/\s*#.*//g; if (!/^\s*$/ && /=/) { ($key,$val)=(split /\s*=\s*/,$_); $client_short = $val if ($key eq 'shortname'); } else { if (/\{/) { s/.*client\s+([^\s]*)\s+\{.*$/\1/; if (/^\d+\.\d+\.\d+\.\d+/) { $client = $_; } else { if (/\./ || /localhost/) { $name = $_ ; } else { $name = $_.".".$domain; } $addr = gethostbyname $name; ($a,$b,$c,$d)=unpack('C4',$addr); $client = "$a.$b.$c.$d"; #DEBUG# print $name." = ".$client."\n"; } } else { if (/\}/) { $client_array{$client_short} .= $client; } } } } close CLIENTS; $realm_del = '@' if ($realm_del eq ''); $realm_for = 'suffix' if ($realm_for eq ''); if ($sql_type eq 'mysql'){ $pass = (!$sql_password) ? '' : "-p$sql_password"; } else{ $pass = $sql_password; } $pass =~ s/(\W)/\\$1/g; die "SQL server not defined\n" if ($sql_server eq ''); die "sql_command directive is not set in admin.conf\n" if ($sqlcmd eq ''); die "sql command '$sqlcmd' not found or does not seem to be executable\n" if (! -x $sqlcmd); $opt = ""; $opt = "-O connect_timeout=$sql_timeout" if ($sql_timeout); $opt .= " -f" if ($force); @servers = (split /\s+/,$sql_extra) if ($sql_extra ne ''); unshift @servers, $sql_server; open LOG, "<$file" or die "Could not open file $file\n"; if ($verbose > 1) { print STDOUT "DEBUG: Opened $file\n" } seek LOG, 0, 2 if ($all_file eq 'no'); for(;;){ while(){ if ($verbose > 1) { print STDOUT "DEBUG: Reading $file\n" } $do=0; chomp; next if ($regexp ne '' && !/$regexp/); if ($_ ne ''){ $user = $nas = $port = $caller = '-'; if (/Login incorrect/){ if (/Login incorrect \((.+?)\):/){ $cause = "Login-Incorrect ($1)"; if ($verbose > 1) { print STDOUT "DEBUG: Login-Incorrect ($1)\n" } }else{ $cause='Login-Incorrect'; if ($verbose > 1) { print STDOUT "DEBUG: Login-Incorrect\n" } } $do=1; } elsif (/Invalid user/){ if (/Invalid user \((.+?)\):/){ $cause = "Invalid-User ($1)"; }else{ $cause='Invalid-User'; } $do=1; } elsif (/Multiple logins/){ if (/MPP attempt/){ $cause='Multiple-Logins (MPP Attempt)'; }else{ $cause='Multiple-Logins'; } $do=1; } elsif (/(Outside allowed timespan \(.+?\)):/){ $cause = "$1"; $do=1; } if ($do){ $date = (split / : /,$_)[0]; $date2 = ParseDate($date); if ($date2){ ($year,$mon,$mday,$hour,$min,$sec)=UnixDate($date2,'%Y','%m','%d','%H','%M','%S'); } $time = "$year-$mon-$mday $hour:$min:$sec"; if (/\[([\w\-\.\!\@\s]+?)\]\s+\(from (.+?)\)/){ $user = $1; ($nas,$port) = (split /\s+/,$2)[1,3]; if ($2 =~ /cli (.+?)$/){ $caller = $1; } } elsif (/\[([\w\-\.\!\@\s]+?)\/.+?\]\s+\(from (.+?)\)/){ $user = $1; ($nas,$port) = (split /\s+/,$2)[1,3]; if ($2 =~ /cli (.+?)$/){ $caller = $1; } } $caller='' if (!defined($caller)); $user =~s/[^\w\-\.\d\!\@\s]//g; $nas =~s/[^\w\.\-]//g; $port =~s/[^\d]//g; $addr = $client_array{$nas}; if ($user ne '' && $realm_strip eq 'yes'){ ($one,$two) = (split /$realm_del/, $user)[0,1]; if ($two ne ''){ $user = ($realm_for eq 'suffix') ? $one : $two; } } foreach $server (@servers){ unlink "$tmpfile.$server" if ($delete{$server}); open TMP, ">>$tmpfile.$server" or die "Could not open temporary file\n"; $ctx = Digest::MD5->new; $ctx->add($user); $ctx->add($addr); $ctx->add($port); $ctx->add($time); $ctx->add('badlogin'); $uniqueid = $ctx->hexdigest; print TMP "ALTER SESSION SET NLS_TIMESTAMP_TZ_FORMAT='YYYY-MM-DD HH24:MI:SS.FF TZH:TZM';\n" if ($sql_type eq 'oracle'); #DEBUG# print "INSERT INTO $sql_accounting_table (UserName,AcctUniqueId,NASIPAddress,NASPortId,AcctStartTime,AcctStopTime,AcctSessionTime,AcctInputOctets,AcctOutputOctets,CallingStationId,AcctTerminateCause) VALUES ('$user','$uniqueid','$addr','$port','$time','$time','0','0','0','$caller','$cause');\n"; print TMP "INSERT INTO $sql_accounting_table (UserName,AcctSessionId,AcctUniqueId,NASIPAddress,NASPortId,AcctStartTime,AcctStopTime,AcctSessionTime,AcctInputOctets,AcctOutputOctets,CallingStationId,AcctTerminateCause) VALUES ('$user','$uniqueid','$uniqueid','$addr','$port','$time','$time','0','0','0','$caller','$cause');\n"; close TMP; $command = "$sqlcmd -h$server $opt -u$sql_username $pass $sql_database <$tmpfile.$server" if ($sql_type eq 'mysql'); $command = "$sqlcmd -U $sql_username -f $tmpfile.$server $sql_database" if ($sql_type eq 'pg'); $command = "$sqlcmd $sql_username/$pass" . "@" . "$sql_database <$tmpfile.$server" if ($sql_type eq 'oracle'); $command = "$sqlcmd '$server' '$sql_port' '' '$sql_username' '$sql_pass' <$tmpfile.$server" if ($sql_type eq 'sqlrelay'); if ($verbose > 1) { print STDOUT "DEBUG: Sending datafile $tmpfile.$server to \"$sql_type\" database\n" } `$command`; if ($verbose > 1) { print STDOUT "DEBUG: Sent data to \"$sql_type\" database\n" } $exit = $? >> 8; $delete{$server} = ($exit == 0) ? 1 : 0; print STDERR "ERROR: SQL query failed for host $server\n" if ($exit != 0); } } } } if ($all_file ne 'once') { sleep 2; seek LOG,0,1; } else { exit(0); } } freeradius-server/dialup_admin/bin/monthly_tot_stats000077500000000000000000000050711257552170400234500ustar00rootroot00000000000000#!/usr/bin/perl use POSIX; use File::Temp; # Log in the mtotacct table aggregated accounting information for # each user spaning in one month period. # If the current month has not ended it will log information up to # the current month day # Works only with mysql and postgresql # $conf=shift||'/usr/local/dialup_admin/conf/admin.conf'; open CONF, "<$conf" or die "Could not open configuration file\n"; while(){ chomp; ($key,$val)=(split /:\s*/,$_); $sql_type = $val if ($key eq 'sql_type'); $sql_server = $val if ($key eq 'sql_server'); $sql_username = $val if ($key eq 'sql_username'); $sql_password = $val if ($key eq 'sql_password'); $sql_database = $val if ($key eq 'sql_database'); $sql_accounting_table = $val if ($key eq 'sql_accounting_table'); $sqlcmd = $val if ($key eq 'sql_command'); } close CONF; die "sql_command directive is not set in admin.conf\n" if ($sqlcmd eq ''); die "sql command '$sqlcmd' not found or does not seem to be executable\n" if (! -x $sqlcmd); if ($sql_type eq 'mysql'){ $sql_password = (!$sql_password) ? '' : "-p$sql_password"; } $sql_password =~ s/(\W)/\\$1/g; ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime; if ($mday == 1){ $mon--; } $date_start = POSIX::strftime("%Y-%m-%d",0,0,0,1,$mon,$year,$wday,$yday,$isdst); $date_end = POSIX::strftime("%Y-%m-%d",0,0,0,$mday,$mon,$year,$wday,$yday,$isdst); $query1 = "DELETE FROM mtotacct WHERE AcctDate = '$date_start';"; $query2 = "INSERT INTO mtotacct (UserName,AcctDate,ConnNum,ConnTotDuration, ConnMaxDuration,ConnMinDuration,InputOctets,OutputOctets,NASIPAddress) SELECT UserName,'$date_start',SUM(ConnNum),SUM(ConnTotDuration), MAX(ConnMaxDuration),MIN(ConnMinDuration),SUM(InputOctets), SUM(OutputOctets),NASIPAddress FROM totacct WHERE AcctDate >= '$date_start' AND AcctDate <= '$date_end' GROUP BY UserName,NASIPAddress;"; print "$query1\n"; print "$query2\n"; my ($fh, $tmp_filename) = tempfile() or die "Could not open tmp file\n"; print $fh "ALTER SESSION SET NLS_TIMESTAMP_TZ_FORMAT='YYYY-MM-DD HH24:MI:SS.FF TZH:TZM';\n" if ($sql_type eq 'oracle'); print $fh $query1; print $fh $query2; close $fh; $command = "$sqlcmd -h $sql_server -u $sql_username $sql_password $sql_database < $tmp_filename" if ($sql_type eq 'mysql'); $command = "$sqlcmd -U $sql_username -f $tmp_filename $sql_database" if ($sql_type eq 'pg'); $command = "$sqlcmd $sql_username/$pass" . "@" . "$sql_database <$tmpfile.$server" if ($sql_type eq 'oracle'); $command = "$sqlcmd '$sql_server' '$sql_port' '' '$sql_username' '$sql_password' < $tmp_filename" if ($sql_type eq 'sqlrelay'); `$command`; freeradius-server/dialup_admin/bin/showmodem000077500000000000000000000067041257552170400216600ustar00rootroot00000000000000#!/usr/bin/perl # # This works with Net-SNMP and UCD-SNMP $host=shift; $user=shift; $comm=shift || "public"; $type=shift|| "xml"; $conf='/usr/local/dialup_admin/conf/admin.conf'; open CONF, "<$conf" or die "Could not open configuration file\n"; while(){ chomp; ($key,$val)=(split /:\s*/,$_); $snmp_type = $val if ($key eq 'general_snmp_type'); $snmpget = $val if ($key eq 'general_snmpget_command'); $snmpwalk = $val if ($key eq 'general_snmpwalk_command'); } close CONF; die "general_snmp_type directive is not set in admin.conf\n" if ($snmp_type eq ''); die "Could not find snmpwalk binary. Please make sure that the \$snmpwalk variable points to the right location\n" if (! -x $snmpwalk); if ($snmp_type = 'ucd') { $snmpgetcmd="$snmpget $host $comm"; $snmpwalkcmd="$snmpwalk $host $comm"; } if ($snmp_type = 'net') { $snmpgetcmd="$snmpget -v 1 -c $comm $host"; $snmpwalkcmd="$snmpwalk -v 1 -c $comm $host"; } #DEBUG#print "$snmpwalkcmd\n"; print "$snmpgetcmd\n"; @ModulationScheme = ( "error", "unknown", "bell103a", "bell212a", "v21", "v22", "v22bis", "v32", "v32bis", "vfc", "v34", "v17", "v29", "v33", "k56flex", "v23", "v32terbo", "v34plus", "v90", "v27ter", ); @Protocol = ( "error", "normal", "direct", "reliableMNP", "reliableLAPM", "syncMode", "asyncMode", "ara10", "ara20", "unknown", ); #DEBUG#print "$snmpwalkcmd enterprises.9.2.9.2.1.18 | grep $user\n"; $modem=`$snmpwalkcmd enterprises.9.2.9.2.1.18 | grep $user`; if($modem=~/enterprises\.9\.2\.9\.2\.1\.18\.(\d+) =/){ $modem=$1; $slot=(1+int($modem/120)); $port=$modem%120-1; $modem="$slot.$port"; #DEBUG#print "$snmpgetcmd enterprises.9.9.47.1.3.1.1.9.$modem\n"; $duration=`$snmpgetcmd enterprises.9.9.47.1.3.1.1.9.$modem` or die "No MIB\n"; $duration=~/\) (.*)\./; $duration=$1; #DEBUG#print "$snmpgetcmd enterprises.9.9.47.1.3.1.1.12.$modem\n"; $modulation=`$snmpgetcmd enterprises.9.9.47.1.3.1.1.12.$modem` or die "No MIB\n"; $modulation=~/ \= (\d+)/; $modulation=$ModulationScheme[$1]; #DEBUG#print "$snmpgetcmd enterprises.9.9.47.1.3.1.1.13.$modem\n"; $protocol=`$snmpgetcmd enterprises.9.9.47.1.3.1.1.13.$modem` or die "No MIB\n"; $protocol=~/ \= (\d+)/; $protocol=$Protocol[$1]; #DEBUG#print "$snmpgetcmd enterprises.9.9.47.1.3.1.1.14.$modem\n"; $txrate=`$snmpgetcmd enterprises.9.9.47.1.3.1.1.14.$modem` or die "No MIB\n"; $txrate=~/Gauge32\: (\d+)/; $txrate=$1; #DEBUG#print "$snmpgetcmd enterprises.9.9.47.1.3.1.1.15.$modem\n"; $rxrate=`$snmpgetcmd enterprises.9.9.47.1.3.1.1.15.$modem` or die "No MIB\n"; $rxrate=~/Gauge32\: (\d+)/; $rxrate=$1; #DEBUG#print "$snmpgetcmd enterprises.9.9.47.1.3.1.1.17.$modem\n"; $rxsignal=`$snmpgetcmd enterprises.9.9.47.1.3.1.1.17.$modem` or die "No MIB\n"; # $rxsignal=~ s/INTEGER\://; $rxsignal=~/ \= (.*)\n/; $rxsignal=$1; if($type eq "xml"){ print "$user\n"; print "\t$duration\n"; print "\t$modulation\n"; print "\t$protocol\n"; print "\t$txrate\n"; print "\t$rxrate\n"; print "\t$rxsignal dBm\n\n"; }else{ printf("%14s\t%s\n","User",$user); printf("%14s\t%s\n","Duration",$duration); printf("%14s\t%s\n","Modulation",$modulation); printf("%14s\t%s\n","Protocol",$protocol); printf("%14s\t%s\n","TxRate",$txrate); printf("%14s\t%s\n","RxRate",$rxrate); printf("%14s\t%s dBm\n\n","RxSignal",$rxsignal); } } freeradius-server/dialup_admin/bin/snmpfinger000077500000000000000000000027541257552170400220270ustar00rootroot00000000000000#!/usr/bin/perl # # This works with Net-SNMP and UCD-SNMP $host=shift; $comm=shift || 'public'; $type=shift || 'cisco'; $conf='/usr/local/dialup_admin/conf/admin.conf'; open CONF, "<$conf" or die "Could not open configuration file\n"; while(){ chomp; ($key,$val)=(split /:\s*/,$_); $snmp_type = $val if ($key eq 'general_snmp_type'); $snmpwalk = $val if ($key eq 'general_snmpwalk_command'); } close CONF; die "general_snmp_type directive is not set in admin.conf\n" if ($snmp_type eq ''); die "Could not find snmpwalk binary. Please make sure that the \$snmpwalk variable points to the right location\n" if (! -x $snmpwalk); $snmpwalkcmd="$snmpwalk $host $comm" if ($snmp_type = 'ucd'); $snmpwalkcmd="$snmpwalk -v 1 -c $comm $host" if ($snmp_type = 'net'); if ($type eq 'cisco'){ $walk =`$snmpwalkcmd .iso.org.dod.internet.private.enterprises.9.9.150.1.1.3.1.2`; if ($walk =~ /^$/ || $walk =~ /No Such Object/){ $walk =`$snmpwalkcmd .iso.org.dod.internet.private.enterprises.9.10.19.1.3.1.1.3`; if ($walk =~ /^$/ || $walk =~ /No Such Object/){ $walk =`$snmpwalkcmd .iso.org.dod.internet.private.enterprises.9.2.9.2.1.18`; } } } elsif ($type eq 'lucent'){ $walk =`$snmpwalkcmd .iso.org.dod.internet.private.enterprises.529.10.4.1.12`; } elsif ($type eq 'usrhiper'){ $walk =`$snmpwalkcmd .iso.org.dod.internet.private.enterprises.429.4.10.1.1.18`; } while($walk=~/\"([\@\.\w\-]+?)\"/g){ $user=lc($1); if($out) { $out=$out.",'$user'"; }else{ $out="'$user'"; } } print "$out\n"; freeradius-server/dialup_admin/bin/sqlrelay_query000077500000000000000000000003741257552170400227340ustar00rootroot00000000000000#!/usr/bin/perl $sqlrelay = '/usr/bin/query'; $host=shift; $port=shift; $socket=shift; $user=shift; $passwd=shift; while(<>){ chomp; `$sqlrelay '$host' '$port' '$socket' '$user' '$passwd' '$_'`; $exit = $? >> 8; if ($exit != 0){ exit $exit; } } freeradius-server/dialup_admin/bin/tot_stats000077500000000000000000000051151257552170400216750ustar00rootroot00000000000000#!/usr/bin/perl use POSIX; use File::Temp; # Log in the totacct table aggregated daily accounting information for # each user. # We keep a row per user for each day. # Works with mysql and postgresql # $conf=shift||'/usr/local/dialup_admin/conf/admin.conf'; open CONF, "<$conf" or die "Could not open configuration file\n"; while(){ chomp; ($key,$val)=(split /:\s*/,$_); $sql_type = $val if ($key eq 'sql_type'); $sql_server = $val if ($key eq 'sql_server'); $sql_username = $val if ($key eq 'sql_username'); $sql_password = $val if ($key eq 'sql_password'); $sql_database = $val if ($key eq 'sql_database'); $sql_accounting_table = $val if ($key eq 'sql_accounting_table'); $sqlcmd = $val if ($key eq 'sql_command'); } close CONF; die "sql_command directive is not set in admin.conf\n" if ($sqlcmd eq ''); die "sql command '$sqlcmd' not found or does not seem to be executable\n" if (! -x $sqlcmd); if ($sql_type eq 'mysql'){ $sql_password = (!$sql_password) ? '' : "-p$sql_password"; } $sql_password =~ s/(\W)/\\$1/g; ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime; $date_start = POSIX::strftime("%Y-%m-%d %T",0,0,0,($mday - 1),$mon,$year,$wday,$yday,$isdst); $date_small_start = POSIX::strftime("%Y-%m-%d",0,0,0,($mday - 1),$mon,$year,$wday,$yday,$isdst); $date_end = POSIX::strftime("%Y-%m-%d %T",0,0,0,$mday,$mon,$year,$wday,$yday,$isdst); $query1 = "DELETE FROM totacct WHERE AcctDate = '$date_start';"; $query2 = "INSERT INTO totacct (UserName,AcctDate,ConnNum,ConnTotDuration, ConnMaxDuration,ConnMinDuration,InputOctets,OutputOctets,NASIPAddress) SELECT UserName,'$date_small_start',COUNT(*),SUM(AcctSessionTime), MAX(AcctSessionTime),MIN(AcctSessionTime),SUM(AcctInputOctets), SUM(AcctOutputOctets),NASIPAddress FROM radacct WHERE AcctStopTime >= '$date_start' AND AcctStopTime < '$date_end' GROUP BY UserName,NASIPAddress;"; print "$query1\n"; print "$query2\n"; my ($fh, $tmp_filename) = tempfile() or die "Could not open tmp file\n"; print $fh "ALTER SESSION SET NLS_TIMESTAMP_TZ_FORMAT='YYYY-MM-DD HH24:MI:SS.FF TZH:TZM';\n" if ($sql_type eq 'oracle'); print $fh $query1; print $fh $query2; close $fh; $command = "$sqlcmd -h $sql_server -u $sql_username $sql_password $sql_database < $tmp_filename" if ($sql_type eq 'mysql'); $command = "$sqlcmd -U $sql_username -f $tmp_filename $sql_database" if ($sql_type eq 'pg'); $command = "$sqlcmd $sql_username/$pass" . "@" . "$sql_database <$tmpfile.$server" if ($sql_type eq 'oracle'); $command = "$sqlcmd '$sql_server' '$sql_port' '' '$sql_username' '$sql_password' < $tmp_filename" if ($sql_type eq 'sqlrelay'); `$command`; freeradius-server/dialup_admin/bin/truncate_radacct000077500000000000000000000043341257552170400231610ustar00rootroot00000000000000#!/usr/bin/perl # # Delete sessions from the radacct table which are older than # $back_days # Works with mysql and postgresql # use POSIX; use File::Temp; $conf=shift||'/usr/local/dialup_admin/conf/admin.conf'; $back_days = 90; open CONF, "<$conf" or die "Could not open configuration file\n"; while(){ chomp; ($key,$val)=(split /:\s*/,$_); $sql_type = $val if ($key eq 'sql_type'); $sql_server = $val if ($key eq 'sql_server'); $sql_username = $val if ($key eq 'sql_username'); $sql_password = $val if ($key eq 'sql_password'); $sql_database = $val if ($key eq 'sql_database'); $sql_accounting_table = $val if ($key eq 'sql_accounting_table'); $sqlcmd = $val if ($key eq 'sql_command'); } close CONF; die "sql_command directive is not set in admin.conf\n" if ($sqlcmd eq ''); die "sql command '$sqlcmd' not found or does not seem to be executable\n" if (! -x $sqlcmd); if ($sql_type eq 'mysql'){ $sql_password = (!$sql_password) ? '' : "-p$sql_password"; } $sql_password =~ s/(\W)/\\$1/g; ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime; $date = POSIX::strftime("%Y-%m-%d %T",$sec,$min,$hour,($mday - $back_days),$mon,$year,$wday,$yday,$isdst); print "$date\n"; if (POSIX::strftime("%Y-%m-%d %T",localtime) eq $date){ die "Could not set correct back date.\n"; } $query = ""; $query = "LOCK TABLES $sql_accounting_table WRITE;" if ($sql_type eq 'mysql'); $query .= "DELETE FROM $sql_accounting_table WHERE AcctStopTime < '$date' AND AcctStopTime IS NOT NULL ;"; $query .= "UNLOCK TABLES;" if ($sql_type eq 'mysql'); print "$query\n"; my ($fh, $tmp_filename) = tempfile() or die "Could not open tmp file\n"; print $fh "ALTER SESSION SET NLS_TIMESTAMP_TZ_FORMAT='YYYY-MM-DD HH24:MI:SS.FF TZH:TZM';\n" if ($sql_type eq 'oracle'); print $fh $query; close $fh; $command = "$sqlcmd -h$sql_server -u$sql_username $sql_password $sql_database < $tmp_filename" if ($sql_type eq 'mysql'); $command = "$sqlcmd -U $sql_username -f $tmp_filename $sql_database" if ($sql_type eq 'pg'); $command = "$sqlcmd $sql_username/$pass" . "@" . "$sql_database <$tmpfile.$server" if ($sql_type eq 'oracle'); $command = "$sqlcmd '$sql_server' '$sql_port' '' '$sql_username' '$sql_password' < $tmp_filename" if ($sql_type eq 'sqlrelay'); `$command`; freeradius-server/dialup_admin/conf/000077500000000000000000000000001257552170400200765ustar00rootroot00000000000000freeradius-server/dialup_admin/conf/accounting.attrs000066400000000000000000000011771257552170400233150ustar00rootroot00000000000000# Used by the User Accounting, the User finger and the Failed Logins page # # For the user finger page only callerid(9) and # ip address(4) are applicable # # For the Failed Logins page only looged in(2), server(7), # terminate cause(8) and callerid(9) are applicable # # attribute number Description Show in Show in Show in # User Accounting User Finger Failed Logins # 1 type no no no 2 logged in yes no yes 3 session time yes no no 4 ip address no yes no 5 upload yes no no 6 download yes no no 7 server yes no yes 8 terminate cause yes no yes 9 callerid yes yes yes freeradius-server/dialup_admin/conf/admin.conf000066400000000000000000000260351257552170400220430ustar00rootroot00000000000000# # Main Configuration File # # it can be default or whatever language. Only greek are supported # from non latin alphabet languages # These attribute only apply for ldap not for sql # general_prefered_lang: en general_prefered_lang_name: English # # The charset which will be added as a meta tag in all pages # general_charset: iso-8859-1 # # Uncomment this if normal attributes (not the ;lang-xx ones) in ldap # are utf8 encoded. # #general_decode_normal_attributes: yes # # The directory where dialupadmin is installed # general_base_dir: /usr/local/dialup_admin # # The base directory of the freeradius radius installation # general_radiusd_base_dir: /usr/local/radiusd general_domain: company.com # # Set it to yes to use sessions and cache the various mappings # You can also set use_session = 1 in config.php to also cache # the admin.conf # # ---- IMPORTANT -- IMPORTANT -- IMPORTANT ---- #Remember to use the 'Clear Cache' page if you use sessions and do any changes #in any of the configuration files. # general_use_session: no # # This is used by the failed logins page. It states the default back time # in minutes. # general_most_recent_fl: 30 # # Realm setup # # Set general_strip_realms to yes in order to stip realms from usernames. # By default realms are not striped #general_strip_realms: yes # # The delimiter used in realms. Default is @ # general_realm_delimiter: @ # # The format of the realms. Can be either suffix (realm is after the username) # or prefix (realm is before the username). Default is suffix # general_realm_format: suffix # # # Determines if the administrator will be able to see and change the user password through # the user edit page general_show_user_password: yes general_raddb_dir: %{general_radiusd_base_dir}/etc/raddb general_ldap_attrmap: %{general_raddb_dir}/ldap.attrmap # Need to fix admin.conf file parser #general_clients_conf: %{general_raddb_dir}/clients.conf general_clients_conf: /usr/local/etc/raddb/clients.conf general_sql_attrmap: %{general_base_dir}/conf/sql.attrmap general_accounting_attrs_file: %{general_base_dir}/conf/accounting.attrs general_extra_ldap_attrmap: %{general_base_dir}/conf/extra.ldap-attrmap general_username_mappings_file: %{general_base_dir}/conf/username.mappings # # it can be either ldap or sql # This affects the user base not accounting. Accounting is always in sql # general_lib_type: sql # # Define which attributes will be visible in the user edit page # general_user_edit_attrs_file: %{general_base_dir}/conf/user_edit.attrs # # Used by the Accounting Report Generator # general_sql_attrs_file: %{general_base_dir}/conf/sql.attrs # # Set default values for various attributes # general_default_file: %{general_base_dir}/conf/default.vals #general_ld_library_path: /usr/local/snmpd/lib # # can be 'snmp' (for snmpfinger) or empty to query the radacct table without first # querying the nas # This is used by the online users page # general_finger_type: snmp # # Defines the nas type. This is only used by snmpfinger # cisco, usrhiper and lucent are supported for now # general_nas_type: cisco general_snmpfinger_bin: %{general_base_dir}/bin/snmpfinger # # Used by the 'Disconnect User' button in the Clear Open Sessions page # Uses the Cisco AAA Session MIB or a telnet session # general_sessionclear_bin: %{general_base_dir}/bin/clearsession # # Can be one of telnet or snmp # general_sessionclear_method: snmp general_radclient_bin: %{general_radiusd_base_dir}/bin/radclient # # this information is used from the server check page # general_test_account_login: test general_test_account_password: testpass # # These are used as default values for the user test page # general_radius_server: localhost general_radius_server_port: 1812 # # can be either pap or chap # general_radius_server_auth_proto: pap # # sorry, single valued for now. Should become something like # password[server-name]: xxxxx # general_radius_server_secret: XXXXXX general_auth_request_file: %{general_base_dir}/conf/auth.request # # can be one of crypt,md5,clear # general_encryption_method: crypt # # can be either asc (older dates first) or desc (recent dates first) # This is used in the user accounting and badusers pages # general_accounting_info_order: desc # # Use the totacct table in the user statistics page instead of the radacct # table. That will make the page run quicker. totacct should have data for # this to work :-) # general_stats_use_totacct: no # # If set to yes then we only allow each administrator to examine it's own entries # in the badusers table # general_restrict_badusers_access: no # # If set to yes then we restrict access to the nas administration page only to those # users which are allowed by their username mapping (nasadmin is set to yes) # general_restrict_nasadmin_access: no INCLUDE: %{general_base_dir}/conf/naslist.conf INCLUDE: %{general_base_dir}/conf/captions.conf # # The ldap server to connect to. # Both ldap_server and ldap_write_server can be a space-separated # list of ldap hostnames. In that case the library will try to connect # to the servers in the order that they appear. If the first host is down # ldap_connect will ask for the second ldap host and so on. # ldap_server: ldap.%{general_domain} # # There are many cases where we have a small write master and # a lot of fast read only replicas. If that is the case uncomment # ldap_write_server and point it to the write master. It will be # used only when writing to the directory, not when reading # #ldap_write_server: master.%{general_domain} ldap_base: dc=company,dc=com ldap_binddn: cn=Directory Manager ldap_bindpw: XXXXXXX ldap_default_new_entry_suffix: ou=dialup,ou=guests,%{ldap_base} ldap_default_dn: uid=default-dialup,%{ldap_base} ldap_regular_profile_attr: dialupregularprofile # # If set to yes then the HTTP credentials (http authentication) # will be used to bind to the ldap server instead of ldap_binddn # and ldap_bindpw. That way multiple admins with different rights # on the ldap database can connect through one dialup_admin interface. # The ldap_binddn and ldap_bindpw are still needed to find the DN # to bind with (http authentication will only provide us with a # username). As a result the ldap_binddn should be able to do a search # with a filter of (uid=). Normally, the anonymous (empty DN) # user can do that. #ldap_use_http_credentials: yes # # If we are using http credentials we can map a specific username to the # directory manager (which usually does not correspond to a specific username) # #ldap_directory_manager: cn=Directory Manager #ldap_map_to_directory_manager: admin # # Uncomment to enable ldap debug # ldap_debug: true # # Allow for defining the ldap filter used when searching for a user # Variables supported: # %u: username # %U: username provided though http authentication # %mu: mappings for userdb # %ma: mappings for accounting # %mn: mappings for nasdb # %mN: mappings for nas administration # # One use of this would be to restrict access to only the user's belonging to # a specific administrator like this: # ldap_filter: (&(uid=%u)(manager=uid=%U,ou=admins,o=company,c=com)) # #ldap_filter: (uid=%u) # # If ldap_userdn is set then we use that for user dns, we don't perform an ldap # search. This can be somewhat faster. The variables supported for ldap_filter # are also supported here # #ldap_userdn: uid=%u,%{ldap_base} # # can be one of mysql,pg,oracle,sqlrelay where: # mysq: MySQL database (port 3306) # pg: PostgreSQL database (port 5432) # oracle: Oracle database (port 1521) # sqlrelay: SQL Relay # sql_type: mysql sql_server: localhost sql_port: 3306 sql_username: dialup_admin sql_password: XXXXXX sql_database: radius sql_accounting_table: radacct sql_badusers_table: badusers sql_check_table: radcheck sql_reply_table: radreply sql_user_info_table: userinfo sql_groupcheck_table: radgroupcheck sql_groupreply_table: radgroupreply sql_usergroup_table: radusergroup sql_total_accounting_table: totacct sql_nas_table: nas # # If set to true then we show all the available groups with the groups # that the user is a member of highlighted in the user edit page. # Otherwise we only show the groups he is a member of. sql_show_all_groups: true # # This variable is used by the scripts in the bin folder # It should contain the path to the sql binary used to run # sql commands (mysql, psql, oracle and sqlrelay are only supported for now) sql_command: /usr/local/bin/mysql #sql_command: /usr/bin/psql #sql_command: /usr/bin/sqlplus # # This variable is used by the scripts in the bin folder # It should contain the snmp type and path to the binary # used to run snmp commands. # (ucd = UCD-Snmp and net = Net-Snmp are only supported for now) general_snmp_type: net general_snmpwalk_command: /usr/local/bin/snmpwalk general_snmpget_command: /usr/local/bin/snmpget # # Uncomment to enable sql debug # sql_debug: true # # If set to yes then the HTTP credentials (http authentication) # will be used to connect to the sql server instead of sql_username # and sql_password. That way multiple admins with different rights # on the sql database can connect through one dialup_admin interface. #sql_use_http_credentials: yes # # If set the query will be added to all of the queries on the accounting # table # Variables supported: # %u: username # %U: username provided though http authentication # %mu: mappings for userdb # %ma: mappings for accounting # %mn: mappings for nasdb # %mN: mappings for nas administration #sql_accounting_extra_query: %ma # # true or false # sql_use_user_info_table: true sql_use_operators: true # # Set this to the value of the default_user_profile in your # sql.conf if that one is set. If it is not set leave blank # or commented out #sql_default_user_profile: DEFAULT # # sql_password_attribute: User-Password sql_date_format: Y-m-d sql_full_date_format: Y-m-d H:i:s # # Used in the accounting report generator so that we # don't return too many results # sql_row_limit: 40 # # These options are used by the log_badlogins script and by the # mysql driver # # Set the sql connect timeout (secs) sql_connect_timeout: 3 # Give a space separated list of extra mysql servers to connect to when # logging bad logins or adding users in the badusers table #sql_extra_servers: sql2.company.com sql3.company.com # # Default values for the various user limits in case the counter module # is used to impose such limits. # The value should be the user limit in seconds or none for nothing # Check out conf/sql.attrmap or extra.ldap-attrmap (depending on if you are # using sql or ldap) for per user attributes. The mapping should be made to # the attributes configured in the counter module. The attributes used by # dialupadmin will always be the ones appearing in the attribute mapping files # so you should make sure they are mapped to the correct attributes # #counter_default_daily: 14400 #counter_default_weekly: 72000 counter_default_daily: none counter_default_weekly: none counter_default_monthly: none # # Since calculating monthly usage can be quite expensive we make # it configurable # This is not needed if the monthly limit is not none #counter_monthly_calculate_usage: true # some of the date/time related functions need to know what timezone we are in timezone: Europe/Luxembourg freeradius-server/dialup_admin/conf/auth.request000066400000000000000000000001711257552170400224500ustar00rootroot00000000000000# # Extra attributes that the test user/check server pages will send to # the RADIUS server # Service-Type = Framed-User freeradius-server/dialup_admin/conf/captions.conf000066400000000000000000000000561257552170400225660ustar00rootroot00000000000000general_caption_finger_free_lines: free lines freeradius-server/dialup_admin/conf/config.php000066400000000000000000000070511257552170400220570ustar00rootroot00000000000000= $testVer ) import_request_variables('GPC'); # If using sessions set use_session to 1 to also cache the config file # $use_session = 0; unset($config); unset($nas_list); if ($use_session){ // Start session @session_start(); if (isset($_SESSION['config'])) $config = $_SESSION['config']; if (isset($_SESSION['nas_list'])) $nas_list = $_SESSION['nas_list']; } if (!isset($config)){ $ARR=file("../conf/admin.conf"); $EXTRA_ARR = array(); foreach($ARR as $val) { $val=chop($val); if (preg_match('/^[[:space:]]*#/',$val) || preg_match('/^[[:space:]]*$/',$val)) continue; list($key,$v)=preg_split("/:[[:space:]]*/",$val,2); if (preg_match("/%\{(.+)\}/",$v,$matches)){ $val=$config[$matches[1]]; $v=preg_replace("/%\{$matches[1]\}/",$val,$v); } if (preg_match("/^nas(\d+)_(\w+)$/",$key,$matches)) $nas_list[$matches[1]][$matches[2]] = $v; if ($key == 'INCLUDE'){ if (is_readable($v)) array_push($EXTRA_ARR,file($v)); else echo "Error: File '$v' does not exist or is not readable
\n"; } else $config["$key"]="$v"; } foreach($EXTRA_ARR as $val1) { foreach($val1 as $val){ $val=chop($val); if (preg_match('/^[[:space:]]*#/',$val) || preg_match('/^[[:space:]]*$/',$val)) continue; list($key,$v)=preg_split("/:[[:space:]]*/",$val,2); if (preg_match("/%\{(.+)\}/",$v,$matches)){ $val=$config[$matches[1]]; $v=preg_replace("/%\{$matches[1]\}/",$val,$v); } if (preg_match("/^nas(\d+)_(\w+)$/",$key,$matches)) $nas_list[$matches[1]][$matches[2]] = $v; $config["$key"]="$v"; } } if ($use_session){ session_register('config'); session_register('nas_list'); } } if ($use_session == 0 && $config[general_use_session] == 'yes'){ // Start session @session_start(); if (isset($nas_list)) session_register('nas_list'); } //Make sure we are only passed allowed strings in username if ($login != '') $login = preg_replace("/[^\w\.\/\@\:\-]/",'',$login); if ($login != '' && $config[general_strip_realms] == 'yes'){ $realm_del = ($config[general_realm_delimiter] != '') ? $config[general_realm_delimiter] : '@'; $realm_for = ($config[general_realm_format] != '') ? $config[general_realm_format] : 'suffix'; $new = explode($realm_del,$login,2); if (count($new) == 2) $login = ($realm_for == 'suffix') ? $new[0] : $new[1]; } unset($mappings); if (isset($_SESSION['mappings'])) $mappings = $_SESSION['mappings']; if (!isset($mappings) && $config[general_username_mappings_file] != ''){ $ARR = file($config[general_username_mappings_file]); foreach($ARR as $val){ $val=chop($val); if (preg_match('/^[[:space:]]*#/',$val) || preg_match('/^[[:space:]]*$/',$val)) continue; list($key,$realm,$v)=preg_split("/:[[:space:]]*/",$val,3); if ($realm == 'accounting' || $realm == 'userdb' || $realm == 'nasdb' || $realm == 'nasadmin') $mappings["$key"][$realm] = $v; if ($realm == 'nasdb'){ $NAS_ARR = array(); $NAS_ARR = preg_split('/,/',$v); foreach ($nas_list as $key => $nas){ foreach ($NAS_ARR as $nas_check){ if ($nas_check == $nas[name]) unset($nas_list[$key]); } } } } if ($config[general_use_session] == 'yes') session_register('mappings'); } date_default_timezone_set($config[timezone]); //Include missing.php if needed if (!function_exists('array_change_key_case')) include_once('../lib/missing.php'); @header('Content-type: text/html; charset='.$config[general_charset].';'); ?> freeradius-server/dialup_admin/conf/default.vals000066400000000000000000000006341257552170400224140ustar00rootroot00000000000000# # Uncomment and edit these lines if you add corresponding default # values in the users file # #Simultaneous-Use: 1 #Framed-IP-Address: 255.255.255.254 #Framed-IP-Netmask: 255.255.255.255 #Framed-MTU: 1500 #Framed-Protocol: PPP #Framed-Compression: Van-Jacobson-TCP-IP #Session-Timeout: 14400 #Idle-Timeout: 600 #Port-Limit: 1 #Max-Weekly-Session: 72000 #Max-Daily-Session: 14400 #Login-Time: #Auth-Type: LDAP freeradius-server/dialup_admin/conf/extra.ldap-attrmap000066400000000000000000000006641257552170400235370ustar00rootroot00000000000000# # An extra file for radius -> ldap attribute mapping # checkItem Dialup-Lock-Msg radiuslockmsg checkItem User-Password userpassword checkItem Regular-Profile radiusProfileDn checkItem Check-Item radiusCheckItem generic checkItem Max-Daily-Session radiusMaxDailySession checkItem Max-Weekly-Session radiusMaxWeeklySession checkItem Max-Monthly-Session radiusMaxMonthlySession replyItem Reply-Item radiusReplyItem generic freeradius-server/dialup_admin/conf/naslist.conf000066400000000000000000000014131257552170400224210ustar00rootroot00000000000000# # This file contains the NAS list # nas1_name: nas1.%{general_domain} nas1_model: Cisco 2511 access server nas1_ip: 147.122.122.121 nas1_port_num: 16 nas1_community: public nas2_name: nas2.%{general_domain} nas2_model: Cisco 2511 access server nas2_ip: 147.122.122.123 nas2_port_num: 16 nas2_community: public # # finger type can also be set per NAS # snmp: Use snmp to query the NAS # database: Only query the sql database # # If it is not set, general_finger_type is assumed nas2_finger_type: database # nas type can also be set per NAS nas2_type: cisco nas3_name: nas3.%{general_domain} nas3_model: Cisco 5300 access server nas3_ip: 147.122.122.124 nas3_port_num: 210 nas3_community: public # # sessionclear method can also be set per NAS # nas3_sessionclear_method: telnet freeradius-server/dialup_admin/conf/sql.attrmap000066400000000000000000000040021257552170400222630ustar00rootroot00000000000000# # A mapping between the attributes used by dialup_admin and the attribute # names that will be stored in the SQL database # # Attributes that are not contained in this file are assumed to be reply # items and map to the same name as the one used by dialup_admin # # Format: # checkItem|replyItem Attribute-In-Dialup-Admin Attribute-In-SQL # # checkItem Auth-Type Auth-Type checkItem Simultaneous-Use Simultaneous-Use checkItem Called-Station-Id Called-Station-Id checkItem Calling-Station-Id Calling-Station-Id checkItem Dialup-Access none checkItem Max-Daily-Session Max-Daily-Session checkItem Max-Weekly-Session Max-Weekly-Session checkItem Max-Monthly-Session Max-Monthly-Session checkItem Login-Time Login-Time checkItem Expiration Expiration replyItem Service-Type Service-Type replyItem Framed-Protocol Framed-Protocol replyItem Framed-IP-Address Framed-IP-Address replyItem Framed-IP-Netmask Framed-IP-Netmask replyItem Framed-Route Framed-Route replyItem Framed-Routing Framed-Routing replyItem Filter-Id Filter-Id replyItem Framed-MTU Framed-MTU replyItem Framed-Compression Framed-Compression replyItem Login-IP-Host Login-IP-Host replyItem Login-Service Login-Service replyItem Login-TCP-Port Login-TCP-Port replyItem Callback-Number Callback-Number replyItem Callback-Id Callback-Id replyItem Framed-IPX-Network Framed-IPX-Network replyItem Class Class replyItem Session-Timeout Session-Timeout replyItem Idle-Timeout Idle-Timeout replyItem Termination-Action Termination-Action replyItem Login-LAT-Service Login-LAT-Service replyItem Login-LAT-Node Login-LAT-Node replyItem Login-LAT-Group Login-LAT-Group replyItem Framed-AppleTalk-Link Framed-AppleTalk-Link replyItem Framed-AppleTalk-Network Framed-AppleTalk-Network replyItem Framed-AppleTalk-Zone Framed-AppleTalk-Zone replyItem Port-Limit Port-Limit replyItem Login-LAT-Port Login-LAT-Port replyitem Reply-Message Reply-Message replyItem Dialup-Lock-Msg Reply-Message replyItem User-Password User-Password freeradius-server/dialup_admin/conf/sql.attrs000066400000000000000000000016671257552170400217660ustar00rootroot00000000000000# Used by the Accounting Report Generator page # # Mysql attributes Description Show Use function # RadAcctId Accounting Id no AcctSessionId Session Id no AcctUniqueId Unique Id no UserName User Name yes Realm Realm no NASIPAddress NAS IP Address yes NASPortId NAS Port yes NASPortType NAS Port Type no AcctStartTime Login Time yes AcctStopTime Logout Time yes AcctSessionTime Session Time yes time2str AcctAuthentic AcctAuthentic no ConnectInfo_start Start Connect Info no ConnectInfo_stop Stop Connect Info no AcctInputOctets Upload yes bytes2str AcctOutputOctets Download yes bytes2str CalledStationId CalledStationId no CallingStationId Caller Id no AcctTerminateCause Terminate Cause no ServiceType Service Type no FramedProtocol Protocol no FramedIPAddress Client IP Address yes AcctStartDelay Accounting Start Delay no time2str AcctStopDelay Accounting Stop Delay no time2str freeradius-server/dialup_admin/conf/user_edit.attrs000066400000000000000000000137511257552170400231470ustar00rootroot00000000000000# # Attributes which will be visible in the user/group edit pages # # Format: Attribute Comment # # #Auth-Type Auth-Type #Simultaneous-Use Simultaneous Use Framed-Protocol Protocol Framed-IP-Address IP Address Framed-IP-Netmask IP Netmask #Framed-Route Route #Framed-Routing #Filter-Id Filter ID Framed-MTU Framed-MTU Framed-Compression Compression Used Service-Type Service Type #Login-IP-Host #Login-Service #Login-TCP-Port #Callback-Number Callback-Number #Callback-Id Callback-ID #Framed-IPX-Network #Class Class Session-Timeout Session Timeout Idle-Timeout Idle Timeout #Termination-Action #Login-LAT-Service #Login-LAT-Node #Login-LAT-Group #Framed-AppleTalk-Link #Framed-AppleTalk-Network #Framed-AppleTalk-Zone Port-Limit Port Limit #Login-LAT-Port #Dialup-Access Dialup Access (use FALSE to lock) Dialup-Lock-Msg Lock Message #Reply-Message Reply-Message #Max-Daily-Session Daily Limit (secs) #Max-Weekly-Session Weekly Limit (secs) #Max-Monthly-Session Monthly Limit (secs) #Login-Time User Login Period (UUCP Format) #Expiration User Expiration Date # # Uncomment this if you are using ldap and you are using user regular profiles. # Also make sure that Regular-Profile maps to the correct ldap attribute in # extra.ldap-attrmap # #Regular-Profile User Regular Profile DN freeradius-server/dialup_admin/conf/username.mappings000066400000000000000000000012721257552170400234570ustar00rootroot00000000000000# Username mappings # Format: # Username:realm:query # # where realm is: # accounting: for the map to be used when querying the accounting db # userdb: for the map to be used when querying the user db # nasdb: To only map specific NASes to the username (separated by ,) # nasadmin: To allow the user to use the nas_admin page (yes or no) # library-admin:accounting:AND nasipaddress = '123.123.123.123' library-admin:userdb:AND Admin = 'library-admin' library-admin:nasdb:nas.lib.company.com library-admin:nasadmin:no # lab-admin:accounting:AND nasipaddress = '123.123.124.123' lab-admin:userdb:AND Admin = 'lab-admin' lab-admin:nasdb:nas.lab.company.com lab-admin:nasadmin:no # admin:nasadmin:yes freeradius-server/dialup_admin/doc/000077500000000000000000000000001257552170400177165ustar00rootroot00000000000000freeradius-server/dialup_admin/doc/AUTHORS000066400000000000000000000012621257552170400207670ustar00rootroot00000000000000Kostas Kalevras: kkalev@noc.ntua.gr Main developper Vasilis Pappas: vpappas@noc.ntua.gr parts of user_edit and user_admin Thanasis Duitsis: aduitsis@noc.ntua.gr Part of accounting report generator Panagiotis Christias: christia@noc.ntua.gr HTML pages layout designer Dragan Milivojevic: galileo@MICROSKY.NET A number of bug reports and a lot of crash testing Gary McKinney A number of bug reports and a lot of crash testing Alex Savguira: alexs@ravdata.com Ido Shavit Patches for auto generate password Nick Marino A number of bug reports Paris Stamatopoulos The HOWTO document Ulrich Walcher A few attribute help pages freeradius-server/dialup_admin/doc/FAQ000066400000000000000000000074571257552170400202650ustar00rootroot00000000000000> I was wondering if there is any more documentation about howto setup this > software other than what comes in the README? No, there isn't. It's easier for me to write code than to document it :-) Anyway, I always try to make better documentation. There's also this FAQ :-) > > When I try to access some page I see the php code instead of html > Make sure that you have configured php to handle files with .php extension > > What tables do I need to create in the MySQL database? It depends. If you are using ldap for user authentication/information then you only need to create the freeradius sql tables (in order to create the radacct table, the other tables will just sit around doing nothing) which can be created from a sql script in the freeradius distribution. If you are runing mysql it is in src/modules/rlm_sql/drivers/rlm_sql_mysql/db_mysql.sql If you are using mysql for user authentication/information then you will again need to create the freeradius sql tables and if you want you could also create the userinfo table to store user information (name,telephone etc) You could also create the badusers table if you want the functionality it provides. sql scripts to create the badusers and userinfo tables can be found in the directory sql (of dialup_admin distribution). > > Some attributes are missing from the user/group edit pages > First of all check conf/user_edit.atts and see if the attribute you are interested in is commented out. If it is just enable it by uncommenting it. If the attribute is not included in the file add it. If you use SQL check conf/sql.attrmap. If you use LDAP check ${freeradius_install_dir}/etc/raddb/ldap.attrmap and check if the attribute is included in the attribute mapping. If it is not then add it there also. Everything should work ok after that. > > When an attribute contains double (") or single (') quotes something goes wrong. > Make sure that magic quotes in PHP are turned off > > The Online Users page does not show me anything > Check conf/admin.conf and especially the comments about general_finger_type. Make sure that bin/snmpfinger uses the correct snmpwalk command and that it returns the correct results (snmfinger works on cisco access servers). Try commenting out general_finger_type so that the Online Users page will just query the radacct table and not try to do a finger on the NAS. > Even though I have uncommented Dialup-Access in user_edits.attrs, when > editing a user, that field is not available. Is this because in sql.attrmap > I have: > > checkItem Dialup-Access none > > What should the attribute be? Dialup-Access is an attribute used by the ldap module. It is not implemented in the sql module, that's why the mapping is set to none. You could set Auth-Type to Reject instead. > Why do the personal information fields show multiple > entries for attributes like name, department, etc in the user_admin page? > Is there a way to remove the duplicate fields in the display? Set general_prefered_lang to en > > After I make a few changes in one of the configuration files things only work like they worked before > If you are using sessions then remember to use the 'Clear Cache' page after making any changes > > When i try to access a dynamic web page it only shows a blank white page > You may have not enabled support for the corresponding sql driver in PHP. If you are also using ldap, check for php ldap support. > > It is still not working > Check that the register_globals in php.ini is set to on. As of PHP 4.2.0 this is set to off by default. The latest versions of dialup_admin will work even if register_globals is set to off if the php version is > 4.1.0 (Thanks to Evren Yurtesen for the suggestion). In latest versions you can also enable sql debug (sql_debug: true) and ldap debug (ldap_debug: true) -- kkalev freeradius-server/dialup_admin/doc/HELP_WANTED000066400000000000000000000003071257552170400214330ustar00rootroot00000000000000What you can contribute: o Billing and statistics pages. Fancy bars and diagrams are needed for dialup_admin to be complete. o Documentation. o Attribute help pages like those that already exist. freeradius-server/dialup_admin/doc/HOWTO000066400000000000000000000561331257552170400205510ustar00rootroot00000000000000 Dialup Admin HOWTO ------------------ Version 0.1 Sun Oct 26 04:03:00 EET 2003 1. Installation 1.1 Obtaining Dialup Admin 1.2 Prerequisities 1.3 Installing & System Configuration 1.3.1 Unpacking & Installation 1.3.2 Apache Configuration 1.3.2.1 Enabling PHP Support On Apache 1.3.2.2 Creating a more secure web interface 1.3.3 Creating the mySQL Tables 2. Configuration 2.1 Configuration Options 2.1.1 General Options 2.1.2 Realms Options 2.1.3 LDAP/SQL Options 2.1.4 NAS Quering 2.1.5 Test Variables 2.1.6 Encryption Methods 2.1.7 NAS Informations 2.1.8 LDAP Options 2.1.9 SQL Options 2.1.10 Limits Timers 2.1.11 Various Options 2.2 The bin/ scripts 2.2.1 The snmpfinger script 2.2.2 The log_badlogins script 2.2.3 The clean_radacct script 2.2.4 The truncate_radacct script 2.2.5 The tot_stats script 2.2.6 The monthly_tot_stats script 2.3 User Attributes 2.4 Finishing Off 3. Troubleshooting 3.1 When I try to access some page I see the php code instead of html 3.2 When an attribute contains double (") or single (') quotes something goes wrong 3.3 Even though I have uncommented Dialup-Access in user_edits.attrs, when editing a user, that field is not available... 3.4 Why do the personal information fields show multiple entries for attributes like name, department, etc in the user_admin page? 3.5 After I make a few changes in one of the configuration files things only work like they worked before 3.6 It is still not working 4. HOWTO Information 1. Installation --------------- This section will take you step by step to create system suitable for dialup admin to run properly. [1.1] Obtaining Dialup Admin Dialup_admin is included with FreeRADIUS. [1.2] Prerequisities Dialup Admin requires the following in order to have full functionality: o PHP Obtained at: http://www.php.net o Date::Manip Perl Module Obtained at: http://www.cise.ufl.edu/~sbeck/ [1.3] Installing & System Configuration At this point we presume that either you have successfully installed PHP and Date::Manip Perl Module or that your distribution has came with both of them precompiled and already installed. [1.3.1] Unpacking and installation shell> cd freeradius-server-VERSION shell> mv dialup_admin /usr/local The dialup admin contains a number of directories necessary for the program to operate. Let's concentrate on the htdocs directory. This directory contains the php scripts needed. In order to have it accessable through our web server we must set a symbolic link between the two locations. We presume that the DefaultRoot of the Apache Web Server is /var/www/htdocs shell> ln -s /usr/local/dialup_admin/htdocs /var/www/htdocs/dialup [1.3.2] Apache Configuration [1.3.2.1] Enabling PHP Support on Apache Apache must be configured to execute PHP scripts. In order to do so locate the httpd.conf file (for Slackware Linux this is /etc/apache). We must enter the following lines inside the httpd.conf LoadModule php4_module libexec/libphp4.so AddModule mod_php4.c AddType application/x-httpd-php .php AddType application/x-httpd-php .php # This is most important since many of the PHP scripts of Dialup Admin have this extension [1.3.2.2] Creating a more secure web interface. Since dialup admin does not come with any kind of administrators authorisation of its own it would be safe to protect this ourselves. Add the following to your httpd.conf file: AuthName "Restricted Area" AuthType Basic AuthUserFile /var/www/.htpasswd require valid-user Changing of course the directory path to match yours as well as the AuthUserFile argument to point to the place where the usernames/passwords are stored. In order to create the htpasswd file the htpasswd utility is required (It is provided with the apache web server) Let's create our first user: shell> htpasswd -c /var/www/.htpasswd -m administrator password Note: The -c argument should not be used from that point on since it creates a new password file. On the next restart of apache the dialup/ directory is only accessable by a username/password verification which in our case is administrator:password The HTTP authentication we have just configured can be used by dialupadmin when connecting to the ldap and sql databases (see sections on sql and ldap options). At this point when we connect to the url http://localhost/dialup we should see the Dialup Admin pages [1.3.3] Creating the mySQL tables In order to have dialup admin work to the maximum you should create a few tables in your mySQL. We assume at this point you have a fair ammount of mySQL knowledge and have a mySQL running somewhere on your network. First of all you should create a database for all the tables to be stored into it. We will call this radius. shell> mysql -h mysql.host.com -u username -p mysql> CREATE DATABASE radius; mysql> exit This step is only necessary if you haven't already created a corresponding database for the freeradius server. At dialup_admin/sql there are four files containg the SQL command to create the required tables. This is done as follows: shell> mysql -h mysql.host.com -u username -p radius < badusers.sql shell> mysql -h mysql.host.com -u username -p radius < mtotacct.sql shell> mysql -h mysql.host.com -u username -p radius < totacct.sql shell> mysql -h mysql.host.com -u username -p radius < userinfo.sql The userinfo table though is only needed if you want to keep your user database in sql. If you keep your users in ldap then it's not needed. NOTE: Remember we named our database "radius". Have you named it somewhat different replace the "radius" argument on the above commands with the name you used 2. Configuration ---------------- This is the most important part of this document since the configuration must match your needs. The configuration file is located at dialup_admin/conf/admin.conf [2.1] Configuration Options A few variables must be set to the correct values in order for dialup admin to work. [2.1.1] General Options General configuration options > general_base_dir: /usr/local/dialup_admin This is the location where we have installed dialup admin. Refer to section 1.3.1 for more information > general_radiusd_base_dir: /usr/local/bin This is the location where the radiusd binary and various radius related programs resides. Check where FreeRadius has been installed > general_domain: domain.gr Set the domain name of your network. [2.1.2] Realms Options For more informations on realms consult the documentations provided with FreeRadius under the doc/ directory > general_strip_realms : yes Should Dialup Admin strip the realm from the username when displaying this? Values: Yes / No (Default Yes) > general_realm_delimiter: @ The delimiter used in realms. Default is @ > general_realm_format: suffix The format of the realms. Can be either suffix (realm is after the username) or prefix (realm is before the username). Default is suffix [2.1.3] LDAP/SQL Options Options that specifies the way dialup admin handles users. SQL or LDAP > general_lib_type: sql This can have as values either ldap or sql. For the following values there shouldn't be any need for changes > general_ldap_attrmap: /etc/raddb/ldap.attrmap > general_sql_attrmap: %{general_base_dir}/conf/sql.attrmap > general_extra_ldap_attrmap: %{general_base_dir}/conf/extra.ldap-attrmap > general_user_edit_attrs_file: %{general_base_dir}/conf/user_edit.attrs > general_sql_attrs_file: %{general_base_dir}/conf/sql.attrs > general_default_file: %{general_base_dir}/conf/default.vals [2.1.4] NAS Quering In general the nas quering provides the dialup admin with information regarding the Online Users. > general_finger_type: snmp What should be the default quering method of the nas. It can be 'snmp' (for snmpfinger) or empty to query the radacct table without first querying the nas > general_snmpfinger_bin: %{general_base_dir}/bin/snmpfinger This probably does not need to be changed For now snmpfinger will only work with Cisco equipment. > general_radclient_bin: /usr/local/bin/radclient Must point to the radclient binary > general_nas_type: cisco Defines the nas type. This is only used by snmpfinger cisco and lucent are supported for now [2.1.5] Test Variables The following variables which are self explained are being used while the "Check Server" button is being pressed to verify that the radius server is working. The username and password must be of a valid dialup account > general_test_account_login: dummy > general_test_account_password: dummy_password > general_radius_server: localhost The hostname where the FreeRadius Server runs > general_radius_server_port: 1645 The port that FreeRadius uses on the hostname > general_radius_server_auth_proto: chap The method of connecting. Could be either 'chap' or 'pap' > general_radius_server_secret: secret_password The secret of the server that dialup admin should use while connecting. NOTE: You must have a correct entry in clients.conf for the host running the dialup admin. For more information consult the documentations that come with FreeRadius > general_auth_request_file: %{general_base_dir}/conf/auth.request The file conf/auth.request contains the options passed while the authentification is performed. Should you need to add anything edit this file [2.1.6] Encryption Method > general_encryption_method: md5 How the passwords of the users are stored (or should be) in the database. Could be 'clear', 'md5', 'des'. See Also Section 2.1.9 [2.1.7] NAS Information > nas1_name: host.%{general_domain} The name of the NAS. Only the host must be replaced to match yours, provided that the nas are on the general_domain specified above > nas1_model: Lucent The model of the NAS. > nas1_ip: 10.0.0.1 The IP of the NAS > nas1_port_num: 120 The port number to connect to on the NAS > nas1_community: community string The community string used by the nas for queries via snmp > nas1_finger_type: snmp The finger type for the specific nas. Comment out to use the general_finger_type from above. > nas1_type: cisco The nas type for the specific nas. Comment out to use the general_nas_type from above. [2.1.8] LDAP Options >ldap_server: ldap.%{general_domain} The ldap server to connect to Both ldap_server and ldap_write_server can be a space-separated list of ldap hostnames. In that case the library will try to connect to the servers in the order that they appear. If the first host is down ldap_connect will ask for the second ldap host and so on. >ldap_write_server: master.%{general_domain} There are many cases where we have a small write master and a lot of fast read only replicas. If that is the case uncomment ldap_write_server and point it to the write master. It will be used only when writing to the directory, not when reading >ldap_base: dc=company,dc=com The LDAP base for the ldap searches >ldap_binddn: cn=Directory Manager >ldap_bindpw: XXXXXXX The DN and password which will be used to bind to the LDAP server. If we don't use http credentials (see below) than these setting will be used for all ldap operations (both searches and modifies/adds). >ldap_default_new_entry_suffix: ou=dialup,ou=guests,%{ldap_base} The LDAP suffix under which all new user entries created through the new user page will be placed >ldap_default_dn: uid=default-dialup,%{ldap_base} The DN of an ldap entry containing radius user settings which will be applied for all users. Though these settings are applied *before* the regular profile and per user settings, so they can be easily overwritten. That way we could for example set Session-Timeout to 4 hours for all our users and set it to a lower/higher value for specific users or groups of users >ldap_regular_profile_attr: dialupregularprofile The ldap attribute which if present in a user entry will contain the DN of another ldap entry specifying radius user settings (check and reply items). That way we can keep these settings in only one entry and assign them to each user that we want through the regular profile attribute. >ldap_use_http_credentials: yes If set to yes then the HTTP credentials (http authentication) will be used to bind to the ldap server instead of ldap_binddn and ldap_bindpw directives. That way multiple admins with different rights on the ldap database can connect through one dialup_admin interface. The ldap_binddn and ldap_bindpw are still needed to find the DN of the user to bind with (http authentication will only provide us with a username). As a result the ldap_binddn should be able to do a search with a filter of (uid=). Normally, the anonymous (empty DN) user can do that. >ldap_directory_manager: cn=Directory Manager >ldap_map_to_directory_manager: admin If we are using http credentials we can map a specific username to the directory manager entry (which usually does not correspond to a specific username) > ldap_debug: true Set to true to enable ldap debugging >ldap_filter: (uid=%u) Allow for defining the ldap filter used when searching for a user Variables supported: %u: username %U: username provided though http authentication One use of this would be to restrict access to only the user's belonging to a specific administrator like this: ldap_filter: (&(uid=%u)(manager=uid=%U,ou=admins,o=company,c=com)) [2.1.9] SQL Options > sql_type: mysql The type of the database. Currenty dialup admin support mySQL ('mysql') and PostgreSQL('pg') > sql_server: localhost > sql_port: 3306 > sql_username: radius > sql_password: XXXXX Information regargind the SQL database such as hostname, port, username and password to be used for connection NOTE: The default port for mySQL is 3306 while for PostgreSQL is 5432. The Username and password are ones set in the database. Creating a new username is behond the scope of this documentation. > sql_database: radius The database where all our tables are stored. Read section 1.3.3 > sql_accounting_table: radacct > sql_check_table: radcheck > sql_groupcheck_table: radgroupcheck > sql_groupreply_table: radgroupreply > sql_reply_table: radreply The above tables are the ones used also directly through FreeRadius. The SQL file containing the way to create these tables are at freeradius-x.x.x/src/modules/rlm_sql/drivers/rlm_sql_/db_.sql For more information consult the documentation of FreeRadius > sql_badusers_table: badusers > sql_user_info_table: userinfo > sql_usergroup_table: usergroup > sql_total_accounting_table: totacct These are the tables created during section 1.3.3. There shouldn't be any need to change those > sql_use_user_info_table: true > sql_use_operators: true Could be true or false > sql_default_user_profile: DEFAULT Set this to the value of the default_user_profile in your sql.conf if that one is set. If it is not set leave blank or commented out > sql_password_attribute: User-Password The password attribute. Should be User-Password if encryption method is clear (See section 2.1.6) or Crypt-Password if either md5 or des is choosed > sql_date_format: Y-m-d > sql_full_date_format: Y-m-d H:i:s The date format > sql_row_limit: 40 The row limit used in the accounting page in order to limit the output > sql_connect_timeout: 3 > sql_extra_servers: sql2.company.com sql3.company.com The above options are used by bin/log_badlogins (See Section 2.x.x) The sql_connect_timeout is also used by the mysql driver and the sql_extra_servers is also used when adding users in the badusers table > sql_debug: false Set to true to enable SQL debugging > sql_use_http_credentials: no If set to yes then the HTTP credentials (http authentication) will be used to connect to the sql server instead of sql_username and sql_password. That way multiple admins with different rights on the sql database can connect through one dialup_admin interface. > sql_command: /usr/local/bin/mysql This variable is used by the scripts in the bin folder It should contain the path to the sql binary used to run sql commands (mysql is only supported for now) [2.1.10] Limits Timers > counter_default_daily: 14400 > counter_default_weekly: 72000 > counter_default_monthly: none The dialup limit displayed on the Dialup Admin. Set to none for no limit [2.1.11] Various Options > general_accounting_info_order: desc Can be either asc (older dates first) or desc (recent dates first) > general_stats_use_totacct: no Use the totacct table for statistics > general_use_session: yes Set it to yes to use sessions and cache the various mappings. You can also set use_session = 1 in config.php to also cache the admin.conf NOTE: Remember to use the 'Clear Cache' page if you use sessions and do any changes in any of the configuration files. > general_most_recent_fl: 30 This is used by the failed logins page. It states the default back time in minutes. > general_prefered_lang: el > general_prefered_lang_name: Greek It can be default or whatever language. Only greek are supported from non latin alphabet languages. These attribute only apply for ldap not for sql > general_charset: iso-8859-1 The charset which will be added as a meta tag in all pages > general_decode_normal_attributes: no Uncomment this if normal attributes (not the ;lang-xx ones) in ldap are utf8 encoded. [2.2] The bin/ scripts [2.2.1] The snmpfinger script This script make an snmp request to the nas server to retrieve the online users directly from the NAS and is being used by dialup admin when general_finger_type: snmp is set (or the per nas equivelant directive). (See section 2.1.4). You also must have installed the net-snmp package obtained at http://www.net-snmp.org The snmpfinger script must be edited in order to point to the correct snmpwalk binary. Edit the line $SNMPWALK="/usr/local/bin/snmpwalk"; to represent the location of snmpwalk binary Besides that the snmpfinger uses MIBs only for the CISCO XXXX NAS or for Lucent equipment (at least for the MAX 3000) which may not work if your NAS is different. However the snmpfinger is not actually required if your accounting is working properly. [2.2.2] The log_badlogins script The log_badlogins scripts actually does a tail -f to the radius.log and intercepts any authentification failure and passes it to the database. If you are interested in having the Failed Logins on the Dialup Admin you should execute it once like this: bin/log_badlogins /var/log/radius/radius.log /usr/local/dialup_admin/conf/admin.conf& Of cource the proper file locations must be set Also log_badlogins will concatenate the client shortname and the general_domain variable defined in admin.conf in order to find the nas ip address. So it is important to make sure that $client_shortname.$domain resolves to the correct nas ip address. regular expression matching is also supported. If the $regexp variable is set then only failed login lines matching the regular expression will be logged. [2.2.3] The clean_radacct script The clean_radacct script can be used to clear the database of stale open sessions (sessions for which an Accounting-Stop has not been received hence they remain open) The $back_days variable can be changed to specify how many days we should leave the sessions open before removing them. Make sure though that all your user sesions are short lived (no DSL users for example) before using the script. If that is not the case edit the sql query to only match short lived sessions (depending on the NAS-Port-Type for example). [2.2.4] The truncate_radacct script The truncate_radacct script can be used to delete all sessions which are older than a specified number of days. This number can be changed through the $back_days variable. The script will do a lock tables so make sure you run it during the night when the traffic is low. It will also only delete *closed* session, so the clean_radacct script should be used together to clear the possible open sessions. [2.2.4] The tot_stats script This script will log aggregated per user information in the totacct table. It will log a row per user, per day. It should be run *once* every day to create the corresponding entries in the totacct table. The general_stats_use_totacct configuration directive could then be set to yes in order for the statistics page to use the totacct table instead of the radacct table. [2.2.5] The monthly_tot_stats script This script can be used to aggregate the information from the totacct table into the mtotacct table creating aggregated accounting information for each spaning in one month period. If the current month has not ended it will log information up to the current month day. It should be run once a day to create the corresponding entries in the mtotacct table. [2.3] User Attributes First of all check conf/user_edit.atts and see if the attribute you are interested in is commented out. If it is just enable it by uncommenting it. If the attribute is not included in the file add it. If you use SQL check conf/sql.attrmap. Attributes that are not contained in this file are assumed to be reply items and map to the same name as the one used by dialup_admin If you use LDAP check ${freeradius_install_dir}/etc/raddb/ldap.attrmap and check if the attribute is included in the attribute mapping. If it is not then add it there also.Everything should work ok after that. [2.4] Finishing The above sections should propably have brought you to a working dialup admin. Note however that if you are interested in logging the failed logins (See section 2.3.2) you should execute the log_badlogins each time the system starts. 3. Troubleshooting -------------------------- [3.1] When I try to access some page I see the php code instead of html See section 1.3.2.1 [3.2] When an attribute contains double (") or single (') quotes something goes wrong Make sure that magic quotes in PHP are turned off [3.3] Even though I have uncommented Dialup-Access in user_edits.attrs, when editing a user, that field is not available... ...Is this because in sql.attrmap I have: checkItem Dialup-Access none What should the attribute be? Dialup-Access is an attribute used by the ldap module. It is not implemented in the sql module, that's why the mapping is set to none. You could set Auth-Type to Reject instead. [3.4] Why do the personal information fields show multiple entries for attributes like name, department, etc in the user_admin page? Set general_prefered_lang to en [3.5] After I make a few changes in one of the configuration files things only work like they worked before If you are using sessions then remember to use the 'Clear Cache' page after making any changes. See Section 2.1.11 [3.6] It is still not working Check that the register_globals in php.ini is set to on. As of PHP 4.2.0 this is set to off by default. The latest versions of dialup_admin will work even if register_globals is set to off if the php version is > 4.1.0 (Thanks to Evren Yurtesen for the suggestion). In latest versions you can also enable sql debug (sql_debug: true) and ldap debug (ldap_debug: true) 4. HOWTO Information --------------------------------- This document is distributed under the terms of the GPL (GNU Public License). Paris Stamatopoulos (main author) Kostas Kalevras (a few additions) freeradius-server/dialup_admin/doc/TODO000066400000000000000000000022501257552170400204050ustar00rootroot00000000000000* Minimize database (ldap,mysql) connections. * Clean up html code to make it smaller * More messages * Multilanguage support for ldap attributes * Add language attributes in user_new.php * Finger facility. Should find a way to make it work with all nases. That will mean that it should be made modular and fall back to simple queries to the sql db if it cannot get user info from the nas server * Check out dbx library. It seems very promising for database independent code. We 'll see where it goes. * Add billing and statistics pages. Billing is a must. The page should also create reports which could be printed or sent by email to the users containing their billing information. We also need more statistics pages with fancy bars and diagrams. Ideas are welcome. * Parse the radius dictionary files so that we can show a pull down menu of possible values for various attributes. * Also be able to keep username mappings in sql. Create an administration page * Improve sqlrelay support * Make the userinfo attributes configurable and create calculation formulas.Like: Attribute-Name:DB-Attribute:Internal-Attribute:Initial-Value:Editable Administrator:admin:admin:%U:No freeradius-server/dialup_admin/htdocs/000077500000000000000000000000001257552170400204355ustar00rootroot00000000000000freeradius-server/dialup_admin/htdocs/about.html000066400000000000000000000027111257552170400224360ustar00rootroot00000000000000 About page

dialup_admin About Page 


A web based administration interface for the freeradius radius server
written in PHP4


Copyright (C) 2001,2002 Kostas Kalevras


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.

Authors:
Kostas Kalevras (kkalev at noc.ntua.gr)
Basilis Pappas (vpappas at noc.ntua.gr)
Panagiotis Christias (christia at noc.ntua.gr)
Thanasis Duitsis (aduitsis at noc.ntua.gr)

freeradius-server/dialup_admin/htdocs/accounting.php000066400000000000000000000170101257552170400232770ustar00rootroot00000000000000 Accounting Report Generator
Could not include SQL library functions. Aborting EOM; exit(); } $operators=array( '=','<', '>', '<=', '>=', '!=', 'regexp', 'like', 'not like' ); if ($config[sql_type] == 'pg'){ $operators=array( '=','<', '>', '<=', '>=', '~', 'like', '~*', '~~*', '<<=' ); } $link = @da_sql_pconnect ($config) or die('cannot connect to sql databse'); $fields = @da_sql_list_fields($config[sql_accounting_table],$link,$config); $no_fields = @da_sql_num_fields($fields,$config); unset($items); for($i=0;$i<$no_fields;$i++){ $key = strtolower(@da_sql_field_name($fields,$i,$config)); $val = $sql_attrs[$key][desc]; if ($val == '') continue; $show = $sql_attrs[$key][show]; $selected[$key] = ($show == 'yes') ? 'selected' : ''; $items[$key] = "$val"; } asort($items); class Qi { var $name; var $item; var $_item; var $operator; var $type; var $typestr; var $value; function Qi($name,$item,$operator) { $this->name=$name; $this->item=$item; $this->operator=$operator; } function show() { global $operators; global $items; $nam = $this->item; echo << $items[$nam] EOM; } function get($designator) { global ${"item_of_$designator"}; global ${"value_of_$designator"}; global ${"operator_of_$designator"}; if(${"item_of_$designator"}){ $this->value= ${"value_of_$designator"}; $this->operator=${"operator_of_$designator"}; $this->item=${"item_of_$designator"}; } } function query(){ global $operators; global $items; return $items[$this->item]." $this->operator '$this->value'"; } } ?> Accounting Report Generator
Show the following attributes:
EOM; foreach($items as $key => $val) if ($val == 'username') echo <<$val EOM; else echo <<$val EOM; echo <<

Max results returned:
EOM; $number=1; $offset=0; while (${"item_of_w$number"}) { if(${"delete_w$number"}==1) {$offset=1;$number++;} else { $designator=$number-$offset; ${"w$designator"} = new Qi("w$designator","",""); ${"w$designator"}->get("w$number"); ${"w$designator"}->show(); $number++; } } if($add==1) { ${"w$number"} = new Qi("w$number","$item_name","$operators[0]"); ${"w$number"}->show(); } echo <<
Selection criteria:

EOM; } if ($queryflag == 1){ $i = 1; while (${"item_of_w$i"}){ $op_found = 0; foreach ($operators as $operator){ if (${"operator_of_w$i"} == $operator){ $op_found = 1; break; } } if (!$op_found) die("Operator passed is not valid. Exiting abnormaly."); ${"item_of_w$i"} = preg_replace('/\s/','',${"item_of_w$i"}); ${"value_of_w$i"} = da_sql_escape_string(${"value_of_w$i"}); $where .= ($i == 1) ? ' WHERE ' . ${"item_of_w$i"} . ' ' . ${"operator_of_w$i"} . " '" . ${"value_of_w$i"} . "'" : ' AND ' . ${"item_of_w$i"} . ' ' . ${"operator_of_w$i"} . " '" . ${"value_of_w$i"} . "'" ; $i++; } $order = ($order_by != '') ? "$order_by" : 'username'; if (preg_match("/[\s;]/",$order)) die("ORDER BY pattern is illegal. Exiting abnornally."); if (!is_numeric($maxresults)) die("Max Results is not in numeric form. Exiting abnormally."); unset($query_view); foreach ($accounting_show_attrs as $val) $query_view .= $val . ','; $query_view = preg_replace('/,$/','',$query_view); unset($sql_extra_query); if ($config[sql_accounting_extra_query] != '') $sql_extra_query = xlat($config[sql_accounting_extra_query],$login,$config); $sql_extra_query = da_sql_escape_string($sql_extra_query); $query="SELECT " . da_sql_limit($maxresults,0,$config) . " $query_view FROM $config[sql_accounting_table] $where $sql_extra_query " . da_sql_limit($maxresults,1,$config) . " ORDER BY $order " . da_sql_limit($maxresults,2,$config) . ";"; echo <<
Accounting Report Generator 

EOM; foreach($accounting_show_attrs as $val){ $desc = $sql_attrs[$val][desc]; echo "\n"; } echo "\n"; $search = @da_sql_query($link,$config,$query); if ($search){ while( $row = @da_sql_fetch_array($search,$config) ){ $num++; echo "\n"; foreach($accounting_show_attrs as $val){ $info = $row[$val]; if ($info == '') $info = '-'; $info = $sql_attrs[$val][func]($info); if ($val == 'username'){ $Info = urlencode($info); $info = "$info"; } echo <<$info EOM; } echo "\n"; } } else echo "Database query failed: " . da_sql_error($link,$config) . "
\n"; echo <<
$desc

EOM; } ?> freeradius-server/dialup_admin/htdocs/badusers.php000066400000000000000000000153531257552170400227650ustar00rootroot00000000000000 Unauthorized Service Usage History for $login
Could not include SQL library functions. Aborting EOM; exit(); } $now = time(); $now_str = ($now_str != '') ? "$now_str" : date($config[sql_date_format],$now + 86400); $prev_str = ($prev_str != '') ? "$prev_str" : "0001-01-01 00:00:00"; $now_str = da_sql_escape_string($now_str); $prev_str = da_sql_escape_string($prev_str); $num = 0; $pagesize = ($pagesize) ? $pagesize : 10; if (!is_numeric($pagesize) && $pagesize != 'all') $pagesize = 10; $limit = ($pagesize == 'all') ? '' : "$pagesize"; $selected[$pagesize] = 'selected'; $login = ($login != '') ? $login : 'anyone'; $usercheck = ($login == 'anyone') ? "LIKE '%'" : "= '$login'"; $order = ($order != '') ? $order : $config[general_accounting_info_order]; if ($order != 'desc' && $order != 'asc') $order = 'desc'; $selected[$order] = 'selected'; echo << Unauthorized Service Usage History for $login
EOM; if ($login != 'anyone'){ echo << EOM; include("../html/user_toolbar.html.php"); print << EOM; } if ($do_delete == 1 && ($row_id != 0 && is_numeric($row_id))){ $link = @da_sql_connect($config); if ($link){ $search = @da_sql_query($link,$config, "SELECT id,admin FROM $config[sql_badusers_table] WHERE id = '$row_id';"); if ($search){ $row = @da_sql_fetch_array($search,$config); if ($row[id] == $row_id){ $admin = "$row[admin]"; if (($admin != '-' && $_SERVER["PHP_AUTH_USER"] == $admin) || $admin == '-'){ $sql_servers = array(); if ($config[sql_extra_servers] != '') $sql_servers = explode(' ',$config[sql_extra_servers]); $sql_servers[] = $config[sql_server]; foreach ($sql_servers as $server){ $link2 = @da_sql_host_connect($server,$config); if ($link2){ $r = da_sql_query($link2,$config, "DELETE FROM $config[sql_badusers_table] WHERE id = '$row_id';"); if (!$r) echo "SQL Error:" . da_sql_error($link2,$config) . "
\n"; @da_sql_close($link2,$config); } else echo "SQL Error: Could not connect to SQL database: $server
\n"; } } } } else echo "Database query failed: " . da_sql_error($link,$config) . "
\n"; @da_sql_close($link,$config); } else echo "Could not connect to SQL database
\n"; } echo <<
Unauthorized Service Usage History for $login 
$prev_str up to $now_str
EOM; ?>

= '$prev_str' " . da_sql_limit($limit,1,$config) . " ORDER BY incidentdate $order " . da_sql_limit($limit,2,$config) . " ;"); if ($search){ while( $row = @da_sql_fetch_array($search,$config) ){ $num++; $id = $row[id]; $user = "$row[username]"; $User = urlencode($user); $date = "$row[incidentdate]"; $reason = "$row[reason]"; $admin = "$row[admin]"; if ($admin == $auth_user || $admin == '-') $action = ""; else $action = ""; if ($admin == '') $admin = '-'; if ($reason == '') $reason = '-'; echo << $action EOM; } } else echo "Database query failed: " . da_sql_error($link,$config) . "
\n"; } else echo "Could not connect to SQL database
\n"; echo <<
#userdateadminreasonadministrator action
-$num $user $date $admin $reason

  EOM; ?>
the from date matches any login after the 00:00 that day, and the to date any login before the 23:59 that day. the default values shown are the current week.
userfrom dateto datepagesizeorder

freeradius-server/dialup_admin/htdocs/buttons.php000066400000000000000000000006611257552170400226470ustar00rootroot00000000000000 freeradius-server/dialup_admin/htdocs/clear_opensessions.php000066400000000000000000000125741257552170400250550ustar00rootroot00000000000000Clear Open User Sessions for $login
Could not include SQL library functions. Aborting EOM; exit(); } echo << Clear Open User Sessions for $login
EOM; include("../html/user_toolbar.html.php"); $open_sessions = 0; $sql_extra_query = ''; if ($config[sql_accounting_extra_query] != ''){ $sql_extra_query = xlat($config[sql_accounting_extra_query],$login,$config); $sql_extra_query = da_sql_escape_string($sql_extra_query); } print <<
Clear open sessions for $login 
EOM; if ($drop_conns == 1){ $method = 'snmp'; $nastype = 'cisco'; if ($config[general_sessionclear_method] != '') $method = $config[general_sessionclear_method]; if ($config[general_nas_type] != '') $nastype = $config[general_nas_type]; if ($config[general_ld_library_path] != '') putenv("LD_LIBRARY_PATH=$config[general_ld_library_path]"); $nas_by_ip = array(); $meth_by_ip = array(); $nastype_by_ip = array(); foreach ($nas_list as $nas){ if ($nas[ip] != ''){ $ip = $nas[ip]; $nas_by_ip[$ip] = $nas[community]; $meth_by_ip[$ip] = $nas[sessionclear_method]; $nastype_by_ip[$ip] = $nas[nas_type]; } } $link = @da_sql_pconnect($config); if ($link){ $search = @da_sql_query($link,$config, "SELECT nasipaddress,acctsessionid FROM $config[sql_accounting_table] WHERE username = '$login' AND acctstoptime IS NULL;"); if ($search){ while($row = @da_sql_fetch_array($search,$config)){ $sessionid = $row[acctsessionid]; $sessionid = hexdec($sessionid); $nas = $row[nasipaddress]; $port = $row[nasportid]; $meth = $meth_by_ip[$nas]; $nastype = ($nastype_by_ip[$nas] != '') ? $nastype_by_ip[$nas] : $nastype; $comm = $nas_by_ip[$nas]; if ($meth == '') $meth = $method; if ($meth == 'snmp' && $comm != '') exec("$config[general_sessionclear_bin] $nas snmp $nastype $login $sessionid $comm"); if ($meth == 'telnet') exec("$config[general_sessionclear_bin] $nas telnet $nastype $login $sessionid $port"); } } else echo "Database query failed: " . da_sql_error($link,$config) . "
\n"; } else echo "Could not connect to SQL database
\n"; } if ($clear_sessions == 1){ $sql_servers = array(); if ($config[sql_extra_servers] != '') $sql_servers = explode(' ',$config[sql_extra_servers]); $quer = '= 0'; if ($config[sql_type] == 'pg') $quer = 'IS NULL'; $sql_servers[] = $config[sql_server]; foreach ($sql_servers as $server){ $link = @da_sql_host_connect($server,$config); if ($link){ $res = @da_sql_query($link,$config, "DELETE FROM $config[sql_accounting_table] WHERE username='$login' AND acctstoptime $quer $sql_extra_query;"); if ($res) echo "Deleted open sessions from accounting table on server $server
\n"; else echo "Error deleting open sessions for user" . da_sql_error($link,$config) . "
\n"; } else echo "Could not connect to SQL database
\n"; } echo <<
EOM; exit(); } else{ $link = @da_sql_pconnect($config); if ($link){ $search = @da_sql_query($link,$config, "SELECT COUNT(*) AS counter FROM $config[sql_accounting_table] WHERE username = '$login' AND acctstoptime IS NULL $sql_extra_query;"); if ($search){ if ($row = @da_sql_fetch_array($search,$config)) $open_sessions = $row[counter]; } else echo "Database query failed: " . da_sql_error($link,$config) . "
\n"; } else echo "Could not connect to SQL database
\n"; } ?>
>
User has open sessions

Are you sure you want to clear all open user sessions?



freeradius-server/dialup_admin/htdocs/content.html000066400000000000000000000003721257552170400227770ustar00rootroot00000000000000


A web based administration interface for the freeradius radius server

freeradius-server/dialup_admin/htdocs/failed_logins.php000066400000000000000000000160221257552170400237460ustar00rootroot00000000000000 Failed logins
Could not include SQL library functions. Aborting EOM; exit(); } $now = time(); if (!isset($last)) $last = ($config[general_most_recent_fl]) ? $config[general_most_recent_fl] : 5; if (!is_numeric($last)) $last = 5; $start = $now - ($last*60); $now_str = date($config[sql_full_date_format],$now); $prev_str = date($config[sql_full_date_format],$start); $now_str = da_sql_escape_string($now_str); $prev_str = da_sql_escape_string($prev_str); $pagesize = ($pagesize) ? $pagesize : 10; if (!is_numeric($pagesize) && $pagesize != 'all') $pagesize = 10; $limit = ($pagesize == 'all') ? '' : "$pagesize"; $selected[$pagesize] = 'selected'; $order = ($order != '') ? $order : $config[general_accounting_info_order]; if ($order != 'desc' && $order != 'asc') $order = 'desc'; $selected[$order] = 'selected'; if ($callerid != ''){ $callerid = da_sql_escape_string($callerid); $callerid_str = "AND callingstationid = '$callerid'"; } if ($server != '' && $server != 'all'){ $server = da_sql_escape_string($server); $server_str = "AND nasipaddress = '$server'"; } unset($da_name_cache); if (isset($_SESSION['da_name_cache'])) $da_name_cache = $_SESSION['da_name_cache']; ?> Failed Logins

Failed Logins 
$prev_str up to $now_str EOM; ?>

" . $acct_attrs['fl'][2] . "\n"; if ($acct_attrs['fl'][7] != '') echo "\n"; if ($acct_attrs['fl'][8] != '') echo "\n"; if ($acct_attrs['fl'][9] != '') echo "\n"; unset($sql_extra_query); if ($config[sql_accounting_extra_query] != ''){ $sql_extra_query = xlat($config[sql_accounting_extra_query],$login,$config); $sql_extra_query = da_sql_escape_string($sql_extra_query); } ?> = '$prev_str' AND (acctterminatecause LIKE 'Login-Incorrect%' OR acctterminatecause LIKE 'Invalid-User%' OR acctterminatecause LIKE 'Multiple-Logins%') $callerid_str $server_str $sql_extra_query " . da_sql_limit($limit,1,$config) . " ORDER BY acctstoptime $order " . da_sql_limit($limit,2,$config) . " ;"); if ($search){ while( $row = @da_sql_fetch_array($search,$config) ){ $num++; $acct_login = $row[username]; if ($acct_login == '') $acct_login = '-'; else $acct_login = "$acct_login"; $acct_time = $row[acctstoptime]; $acct_server = $row[nasipaddress]; if ($acct_server != ''){ $acct_server = $da_name_cache[$acct_server]; if (!isset($acct_server)){ $acct_server = $row[nasipaddress]; $acct_server = @gethostbyaddr($acct_server); if (!isset($da_name_cache) && $config[general_use_session] == 'yes'){ $da_name_cache[$row[nasipaddress]] = $acct_server; session_register('da_name_cache'); } else $da_name_cache[$row[nasipaddress]] = $acct_server; } } else $acct_server = '-'; $acct_server = "$acct_server:$row[nasportid]"; $acct_terminate_cause = "$row[acctterminatecause]"; if ($acct_terminate_cause == '') $acct_terminate_cause = '-'; $acct_callerid = "$row[callingstationid]"; if ($acct_callerid == '') $acct_callerid = '-'; echo << EOM; if ($acct_attrs['fl'][2] != '') echo "\n"; if ($acct_attrs['fl'][2] != '') echo "\n"; if ($acct_attrs['fl'][2] != '') echo "\n"; if ($acct_attrs['fl'][2] != '') echo "\n"; echo "\n"; } } else echo "Database query failed: " . da_sql_error($link,$config) . "
\n"; } else echo "Could not connect to SQL database
\n"; echo <<
#login " . $acct_attrs['fl'][7] . "" . $acct_attrs['fl'][8] . "" . $acct_attrs['fl'][9] . "
$num $acct_login$acct_time$acct_server$acct_terminate_cause$acct_callerid

EOM; ?>
time back (mins)pagesizecaller idorder
On Access Server:

freeradius-server/dialup_admin/htdocs/find.php000066400000000000000000000063561257552170400221000ustar00rootroot00000000000000 Find User Page

Find User Page 
EOM; foreach ($found_users as $user){ if ($user == '') $user = '-'; $User = urlencode($user); $num++; $msg .= << EOM; } $msg .= "
#user
$num $user
\n"; } else $msg = "No users found
\n"; } ?>
EOM; } ?>
Search Criteria
RADIUS Attribute
Criteria Contains
Max Results

$msg EOM; } ?>
freeradius-server/dialup_admin/htdocs/group_admin.php000066400000000000000000000066361257552170400234650ustar00rootroot00000000000000Group Administration Page
This page is only available if you are using sql as general library type EOM; exit(); } unset($group_members); if (is_file("../lib/$config[general_lib_type]/group_info.php")){ include("../lib/$config[general_lib_type]/group_info.php"); if ($group_exists == 'no'){ echo <<Group Administration Page
Group Name     does not exist
EOM; exit(); } } ?> Group Administration Page

Group Administration 
Group Members (Check to Delete)
New Group Member(s)
Separate group members
by whitespace or newline



freeradius-server/dialup_admin/htdocs/group_new.php000066400000000000000000000100731257552170400231540ustar00rootroot00000000000000New group creation page
This page is only available if you are using sql as general library type EOM; exit(); } require('../lib/attrshow.php'); require('../lib/defaults.php'); require("../lib/$config[general_lib_type]/group_info.php"); if ($config[general_lib_type] == 'sql' && $config[sql_use_operators] == 'true'){ $colspan=2; $show_ops=1; }else{ $show_ops = 0; $colspan=1; } ?> New group creation page

Preferences for new group 
The group $login already exists in the group database EOM; } else{ if (is_file("../lib/$config[general_lib_type]/create_group.php")) include("../lib/$config[general_lib_type]/create_group.php"); if (is_file("../lib/$config[general_lib_type]/group_info.php")) include("../lib/$config[general_lib_type]/group_info.php"); } } ?>
EOM; foreach($show_attrs as $key => $desc){ $name = $attrmap["$key"]; if ($name == 'none') continue; $oper_name = $name . '_op'; $val = ($item_vals["$key"][0] != "") ? $item_vals["$key"][0] : $default_vals["$key"][0]; print << EOM; if ($show_ops) print << EOM; print << EOM; } ?>
Available Groups EOM; if (!isset($existing_groups)) echo "No groups available\n"; else{ echo "\n"; } echo <<
Group name
First member(s)
Separate group members
by whitespace or newline
$desc



freeradius-server/dialup_admin/htdocs/help/000077500000000000000000000000001257552170400213655ustar00rootroot00000000000000freeradius-server/dialup_admin/htdocs/help/auth_type_help.html000066400000000000000000000021171257552170400252660ustar00rootroot00000000000000 Auth-Type Help Page
Auth-Type Help Page 

Value: String
The Auth-Type attribute describes which authentication module to call.
Standard values from a default FreeRADIUS setup my be:
PAP
CHAP
MSCHAP
PAM
UNIX
LADP
EAP
Close Window
freeradius-server/dialup_admin/htdocs/help/badusers_help.html000066400000000000000000000020221257552170400250670ustar00rootroot00000000000000 BADUSERS Help Page
Expiration Help Page 

The badusers table can be used to keep a history of unauthorized actions by
certain users.
To add a user to the badusers table you first have to insert a descriptive text
in the 'Lock Message' attribute
Close Window
freeradius-server/dialup_admin/htdocs/help/callback_id_help.html000066400000000000000000000026731257552170400255030ustar00rootroot00000000000000 Callback-ID Help Page
Callback-ID Help Page 

  Attribute Number: 20
  Value: String

  This attribute is used when a RADIUS implementation is set up to
  return a user's call. This is commonly used in corporate situations
  to avoid long-distance charges in hotel rooms and other remote
  locations. This value, A STRING, is often the identifier for a
  profile configured on the service equipment; there is no specific
  standrad for a string name, a triggered action, or something else.
  In other words, it is environment specific. RADIUS client gear is
  allowed to reject a connection if this attribute is present but
  not supported by the gear.
Close Window
freeradius-server/dialup_admin/htdocs/help/callback_number_help.html000066400000000000000000000030441257552170400263700ustar00rootroot00000000000000 Callback-Number Help Page
Callback-Number Help Page 

  Attribute Number: 19
  Value: String

  The value of this attribute is the number to which the RADIUS client
  gear should return a call to the authenticating user. Depending on
  what packet this attribute is found in, different actions may be
  configured. For instance, if Callback-Number is found in an
  Access Request packet, the implementation may assume that the
  end user is requesting callback service. If the attribute is found
  in the Access Accept packet, it can mean everything that the
  administrator configuring the gear wants it to mean. In fact, in
  some cases, Callback-ID and Callback-Number will not be found
  together in one packet.
Close Window
freeradius-server/dialup_admin/htdocs/help/class_help.html000066400000000000000000000024531257552170400243740ustar00rootroot00000000000000 Class Help Page
Class Help Page 

Attribute Number: 25
Value: String

The Class attribute mainly exists to funnel identification and
property information to the accounting systems of RADIUS
implementations.
From RFC2865:
"This Attribute is available to be sent by the server to the client in an Access-Accept and SHOULD be sent unmodified by the client to the accounting server as part of the Accounting-Request packet if accounting is supported. The client MUST NOT interpret the attribute locally."
Close Window
freeradius-server/dialup_admin/htdocs/help/dialup_access_help.html000066400000000000000000000020531257552170400260620ustar00rootroot00000000000000 Dialup Access Help Page
Dialup Access Help Page 

  If the Dialup-Access attribute is specified, the ldap module
  checks for its existance in user object. If it exists and is
  set to FALSE, user is denied remote access. Otherwise, the user
  is allowed remote access.
Close Window
freeradius-server/dialup_admin/htdocs/help/expiration_help.html000066400000000000000000000017311257552170400254470ustar00rootroot00000000000000 Expiration Help Page
Expiration Help Page 

  This attribute can be used to set the user expiration date. It
  should be in the format "$month_day $month_name $year" like:
  "20 May 2002"
Close Window
freeradius-server/dialup_admin/htdocs/help/filter_id_help.html000066400000000000000000000021451257552170400252260ustar00rootroot00000000000000 Framed-Id Help Page
Filter-Id Help Page 

  This Attribute indicates the name of the filter list for this
  user. Zero or more Filter-Id attributes MAY be sent in an
  Access-Accept packet.

  Identifying a filter list by name allows the filter to be used on
  different NASes without regard to filter-list implementation
  details.  
Close Window
freeradius-server/dialup_admin/htdocs/help/framed_compression_help.html000066400000000000000000000020541257552170400271430ustar00rootroot00000000000000 Framed Compression Help Page
Framed Compression Help Page 

  Framed-Compression indicates a compression protocol to be used for the link.
  Possible values are:
None
Van-Jacobson-TCP-IP
IPX-Header-Compression
Stac-LZS
Close Window
freeradius-server/dialup_admin/htdocs/help/framed_ip_address_help.html000066400000000000000000000022411257552170400267150ustar00rootroot00000000000000 Framed-IP-Address Help Page
Framed-IP-Address Help Page 

  Framed-IP-Address can be used to specify the IP address that
  a dialup user will use. There are two special values:
255.255.255.255: Assign the user requested IP
255.255.255.254: Assign an IP from the NAS IP pool
  All other values will be assigned as they are to the user dialup
  interface
Close Window
freeradius-server/dialup_admin/htdocs/help/framed_ip_netmask_help.html000066400000000000000000000017171257552170400267410ustar00rootroot00000000000000 Framed-IP-Netmask Help Page
Framed-IP-Netmask Help Page 

Attribute Number: 9
Value: IPADDR
This attribute can be used to assign a specific netmask to
a connection.
Close Window
freeradius-server/dialup_admin/htdocs/help/framed_mtu_help.html000066400000000000000000000020121257552170400254010ustar00rootroot00000000000000 Framed-MTU Help Page
Framed-MTU Help Page 

Attribute Numer: 12
Value: Integer
MTU, the Maximum Transfer Unit, is the largest
packet size that can be transmitted over a connection.
The value can be between 64 and 65535.
Close Window
freeradius-server/dialup_admin/htdocs/help/framed_protocol_help.html000066400000000000000000000023371257552170400264470ustar00rootroot00000000000000 Framed Protocol Help Page
Framed Protocol Help Page 

  This Attribute indicates the framing to be used for framed access.
  It MAY be used in both Access-Request and Access-Accept packets.

  Possible values are:
1 PPP
2 SLIP
3 AppleTalk Remote Access Protocol (ARAP)
4 Gandalf proprietary SingleLink/Multilink protocol
5 Xylogics proprietary IPX/SLIP
6 X.75 Synchronous
Close Window
freeradius-server/dialup_admin/htdocs/help/help.php000066400000000000000000000030631257552170400230300ustar00rootroot00000000000000 Help page

dialup_admin help page 

Please choose which file you wish to read:





freeradius-server/dialup_admin/htdocs/help/idle_timeout_help.html000066400000000000000000000017451257552170400257550ustar00rootroot00000000000000 Idle Timeout Help Page
Idle Timeout Help Page 

  This Attribute sets the maximum number of consecutive seconds of
  idle connection allowed to the user before termination of the
  session or prompt.
Close Window
freeradius-server/dialup_admin/htdocs/help/lock_message_help.html000066400000000000000000000022721257552170400257220ustar00rootroot00000000000000 Lock Message Help Page
Lock Message Help Page 

  The Lock Message will be included as a Reply-Item in all radius server responses for
  the user. It will also appear in the Usefull User Description in the user admin page.
  It is intended to be used as a hint to the user and to the administrator for the reason
  of the user lock out.
  In case it is a multi word message it should be enclosed in double quotes
Close Window
freeradius-server/dialup_admin/htdocs/help/login_time_help.html000066400000000000000000000032101257552170400254050ustar00rootroot00000000000000 Login-Time Help Page
Login-Time Help Page 

  Login-Time defines the time span a user may login to the system. The
  format of a so-called time string is like the format used by UUCP.
  A time string may be a list of simple time strings separated by "|" or ",".

  Each simple time string must begin with a day definition. That can be just
  one day, multiple days, or a range of days separated by a hyphen. A
  day is Mo, Tu, We, Th, Fr, Sa or Su, or Wk for Mo-Fr. "Any" or "Al"
  means all days.

  After that a range of hours follows in hhmm-hhmm format.

  For example, "Wk2305-0855,Sa,Su2305-1655".

  Radiusd calculates the number of seconds left in the time span, and
  sets the Session-Timeout to that number of seconds. So if someones
  Login-Time is "Al0800-1800" and he logs in at 17:30, Session-Timeout
  is set to 1800 seconds so that he is kicked off at 18:00.
Close Window
freeradius-server/dialup_admin/htdocs/help/nomadix/000077500000000000000000000000001257552170400230245ustar00rootroot00000000000000freeradius-server/dialup_admin/htdocs/help/nomadix/nomadix_bw_down_help.html000066400000000000000000000017601257552170400301040ustar00rootroot00000000000000 Nomadix-Bw-Down Help Page
Nomadix-Bw-Down Help Page 

Attribute Numer: 26
Value: Integer
  This Nomadix specific attribute limits the download bandwidth per
  user. The given value is interpreted as kbps.
Close Window
freeradius-server/dialup_admin/htdocs/help/nomadix/nomadix_bw_up_help.html000066400000000000000000000017521257552170400275620ustar00rootroot00000000000000 Nomadix-Bw-Up Help Page
Nomadix-Bw-Up Help Page 

Attribute Numer: 26
Value: Integer
  This Nomadix specific attribute limits the upload bandwidth per
  user. The given value is interpreted as kbps.
Close Window
freeradius-server/dialup_admin/htdocs/help/nomadix/nomadix_config_url_help.html000066400000000000000000000021061257552170400305670ustar00rootroot00000000000000 Nomadix-Config-URL Help Page
Nomadix-Config-URL Help Page 

Attribute Numer: 26
Value: String
  This Nomadix specific attribute specifies the ftp server where the Nomdix
  can download its configuration, thus allowing the administrator to change
  the configuration of many Nomadix' easily.
Close Window
freeradius-server/dialup_admin/htdocs/help/nomadix/nomadix_endofsession_help.html000066400000000000000000000020451257552170400311410ustar00rootroot00000000000000 Nomadix-EndofSession Help Page
Nomadix-EndofSession Help Page 

Attribute Numer: 26
Value: Integer
  This attribute makes the user being kicked off the line exactly
  at the end of the day at 0 o'clock. The user won't be able to
  reconnect after that date.
Close Window
freeradius-server/dialup_admin/htdocs/help/nomadix/nomadix_expiration_help.html000066400000000000000000000017421257552170400306270ustar00rootroot00000000000000 Nomadix-Expiration Help Page
Nomadix-Expiration Help Page 

Attribute Numer: 26
Value: String
  This attribute specifies a date after which the account of the
  user will no longer be valid.
Close Window
freeradius-server/dialup_admin/htdocs/help/nomadix/nomadix_ip_upsell_help.html000066400000000000000000000021071257552170400304350ustar00rootroot00000000000000 Nomadix-IP-Upsell Help Page
Nomadix-IP-Upsell Help Page 

Attribute Numer: 26
Value: Integer
  This Nomadix specific attribute assigns a special (normally public)
  ip address to the connecting user. There are two valid values:
0 - which means PrivatePool 1 - which means PublicPool
Close Window
freeradius-server/dialup_admin/htdocs/help/nomadix/nomadix_logoff_url_help.html000066400000000000000000000021071257552170400305770ustar00rootroot00000000000000 Nomadix-Logoff-URL Help Page
Nomadix-Logoff-URL Help Page 

Attribute Numer: 26
Value: String
  This Nomadix specific attribute defines the webpage that the user
  shall see on session termination. There is no differnence whether
  the Termination-Cause is a Session-Timeout or User-Request.
Close Window
freeradius-server/dialup_admin/htdocs/help/nomadix/nomadix_maxbytesdown_help.html000066400000000000000000000020061257552170400311630ustar00rootroot00000000000000 Nomadix-MaxBytesDown Help Page
Nomadix-MaxBytesDown Help Page 

Attribute Numer: 26
Value: Integer
  This attribute specifies the maximum number of single bytes a user
  is allowed to download, means receive from the internet.
Close Window
freeradius-server/dialup_admin/htdocs/help/nomadix/nomadix_maxbytesup_help.html000066400000000000000000000020141257552170400306370ustar00rootroot00000000000000 Nomadix-MaxBytesUp Help Page
Nomadix-MaxBytesUp Help Page 

Attribute Numer: 26
Value: Integer
  This attribute specifies the maximum number of single bytes a user
  is allowed to upload, means send from his machine to the internet.
Close Window
freeradius-server/dialup_admin/htdocs/help/nomadix/nomadix_subnet_help.html000066400000000000000000000020471257552170400277440ustar00rootroot00000000000000 Nomadix-Subnet Help Page
Nomadix-Subnet Help Page 

Attribute Numer: 26
Value: String
  As Nomadix has the possibility to set up more than one subnet
  for DHCP use this attribute specifies from which of the DHCP
  subnets/pools the user shall get it's lease.
Close Window
freeradius-server/dialup_admin/htdocs/help/nomadix/nomadix_url_redirection_help.html000066400000000000000000000020711257552170400316320ustar00rootroot00000000000000 Nomadix-URL-Redirection Help Page
Nomadix-URL-Redirection Help Page 

Attribute Numer: 26
Value: String
  This Nomadix specific attribute specifies the URL where the user
  should be directed to directly after login. Format:
http://www.the_domain.com/the_page_to_see.html
Close Window
freeradius-server/dialup_admin/htdocs/help/port_limit_help.html000066400000000000000000000020111257552170400254370ustar00rootroot00000000000000 Port Limit Help Page
Port Limit Help Page 

  Port-Limit is intended for use in conjuction with Multilink PPP or similar uses.
  It defines the maximum number of channels the user is allowed to open during
  a multilink dialup session.
Close Window
freeradius-server/dialup_admin/htdocs/help/reply_message_help.html000066400000000000000000000031751257552170400261300ustar00rootroot00000000000000 Reply-Message Help Page
Reply-Message Help Page 

Attribute Numer: 18
Value: String
The Reply-Message attribute is used to send a message back to the client
in response of another packet.
RFC2865 describes it as easy as:
"This attribute indicates text which MAY be displayed to the user. When used in an Access-Accept, it is the success message. When used in an Access-Reject, it is the failure message. It MAY indicate a dialog message to prompt the user before another Access-Request attempt. When used in an Access-Challenge, it MAY indicate a dialog message to prompt the user for a response. Multiple Reply-Message's MAY be included and if any are displayed, they MUST be displayed in the same order as they appear in the packet. A summary of the Reply-Message Attribute format is shown below. The fields are transmitted from left to right."
Close Window
freeradius-server/dialup_admin/htdocs/help/service_type_help.html000066400000000000000000000063721257552170400257740ustar00rootroot00000000000000 Service-Type Help Page
Service-Type Help Page 

  This Attribute indicates the type of service the user has
  requested, or the type of service to be provided. It MAY be used
  in both Access-Request and Access-Accept packets. A NAS is not
  required to implement all of these service types, and MUST treat
  unknown or unsupported Service-Types as though an Access-Reject
  had been received instead.

  Possible values are.
1 Login
2 Framed
3 Callback Login
4 Callback Framed
5 Outbound
6 Administrative
7 NAS Prompt
8 Authenticate Only
9 Callback NAS Prompt
  The service types are defined as follows when used in an Access-
  Accept.  When used in an Access-Request, they should be considered
  to be a hint to the RADIUS server that the NAS has reason to
  believe the user would prefer the kind of service indicated, but
  the server is not required to honor the hint.

      Login               The user should be connected to a host.
      Framed              A Framed Protocol should be started for the
                          User, such as PPP or SLIP.
      Callback Login      The user should be disconnected and called
                          back, then connected to a host.
      Callback Framed     The user should be disconnected and called
                          back, then a Framed Protocol should be started
                          for the User, such as PPP or SLIP.
      Outbound            The user should be granted access to outgoing
                          devices.
      Administrative      The user should be granted access to the
                          administrative interface to the NAS from which
                          privileged commands can be executed.
      NAS Prompt          The user should be provided a command prompt
                          on the NAS from which non-privileged commands
                          can be executed.
      Authenticate Only   Only Authentication is requested, and no
                          authorization information needs to be returned
                          in the Access-Accept (typically used by proxy
                          servers rather than the NAS itself).
      Callback NAS Prompt The user should be disconnected and called
                          back, then provided a command prompt on the
                          NAS from which non-privileged commands can be
                          executed.
Close Window
freeradius-server/dialup_admin/htdocs/help/session_timeout_help.html000066400000000000000000000017341257552170400265210ustar00rootroot00000000000000 Session Timeout Help Page
Session Timeout Help Page 

  This Attribute sets the maximum number of seconds of service to be
  provided to the user before termination of the session or prompt.
Close Window
freeradius-server/dialup_admin/htdocs/help/simultaneous_use_help.html000066400000000000000000000020051257552170400266640ustar00rootroot00000000000000 Simultaneous Use Help Page
Simultaneous Use Help Page 

  This attribute defines the maximum number of concurrent logins
  for a user. It is independent from the number of ports the user
  is allowed to open in a multilink session.
Close Window
freeradius-server/dialup_admin/htdocs/images/000077500000000000000000000000001257552170400217025ustar00rootroot00000000000000freeradius-server/dialup_admin/htdocs/images/arrow.gif000066400000000000000000000014701257552170400235250ustar00rootroot00000000000000GIF89a÷:o±ÿ:o±ÿ::::o:±:ÿ:oo:ooo±oÿo±±:±o±±±ÿ±ÿÿ:ÿoÿ±ÿÿÿ:o±ÿ:o±ÿ::::o:±:ÿ:oo:ooo±oÿo±±:±o±±±ÿ±ÿÿ:ÿoÿ±ÿÿÿ::::o:±:ÿ:::::o:±:ÿ::::::::o::±::ÿ::o:o::o:oo:±o:ÿo:±:±::±:o±:±±:ÿ±:ÿ:ÿ::ÿ:oÿ:±ÿ:ÿÿ:oo:ooo±oÿooo:ooo±oÿo:o:o::oo:o±:oÿ:ooooo:ooooo±ooÿoo±o±o:±oo±o±±oÿ±oÿoÿo:ÿooÿo±ÿoÿÿo±±:±o±±±ÿ±±±:±o±±±ÿ±:±:±::±o:±±:±ÿ:±o±o±:o±oo±±o±ÿo±±±±±:±±o±±±±±ÿ±±ÿ±ÿ±:ÿ±oÿ±±ÿ±ÿÿ±ÿÿ:ÿoÿ±ÿÿÿÿÿ:ÿoÿ±ÿÿÿ:ÿ:ÿ::ÿo:ÿ±:ÿÿ:ÿoÿoÿ:oÿooÿ±oÿÿoÿ±ÿ±ÿ:±ÿo±ÿ±±ÿÿ±ÿÿÿÿÿ:ÿÿoÿÿ±ÿÿÿÿÿ!ù×,@!\¡ A ¼vÐ Ã×;freeradius-server/dialup_admin/htdocs/images/bg.gif000066400000000000000000000007651257552170400227710ustar00rootroot00000000000000GIF89a\_ÕÿÀÀÀåܪçß°êã¹ìå¿îèÄñìÎòíÐóïÖõñÚ÷ôâù÷ëÌ»mͼnÏ¿rξqÐÀtÐÀuÕÆÔÆ~ÖÇ×ʆØË‡ÚÍŒÞÒ–ßÓ—ßÔ™áÖžâ× äÚ¥åÛ©çÞ®éà³óîÔ¹¤Jº¤L½¨P¾ªS¿«TÀ¬UÁ­WÉ·f̺k!ù,\_ÿ@€pH,ȤrÉl:ŸÐ¨ty@M¯Ø¬vËíz¿àäF$ ›Ïè´zÍ&6Èå¶|N¯Û»8ùÎïûÿr z{€…†‡ˆKƒp‰Žv(Œ‘—˜™[ •zš ¡¢Hžƒ£¨©—¦Œª¯°­•±¶·l³´µ¸½¾\¬»ž¿ÄÅO­ÆËÌCoÉÊÍÓ¾&Ñ»ÔÚ±ØÉÛà¢'ÞÑáç‘Ðåæèî… ììïõ|Èóóöûl ùãðø…€Š€ *Ô‚‡Jd"Ä‹'j2`Æ‹7°ø±$¡ü Ta²¥%”èB\(á²æ'˜ÚD°ÉÓNb <8èItØÏX °,ÊÔT;freeradius-server/dialup_admin/htdocs/images/black.gif000066400000000000000000000000611257552170400234420ustar00rootroot00000000000000GIF89a‘ÿÿÿÿÀÀÀ!ù,L;freeradius-server/dialup_admin/htdocs/images/greenlines1.gif000066400000000000000000000001041257552170400246000ustar00rootroot00000000000000GIF89a¢ÿÿÿÿžºeˆ WtˆJÀÀÀ!ù,(º:>!†;;freeradius-server/dialup_admin/htdocs/images/logo2.gif000066400000000000000000000045511257552170400234200ustar00rootroot00000000000000GIF89aKLÕèéæMZ1gyBOOM™´bXg9ûûûÃúº¹‘«] ××Ö¨¨§†Vˆx{|z††„r†I™š˜=>=¨±”ôôôÇѲdeb3;!ºÅ¤,-,@K*y‡\~”Q&-Y\RlEv‹Kqwd{‘OxM˜S`p=€–Ráâà{‚nŽÐ×Á‚™TÜÞÖš­tÎÏÎopm‚’`„œUîïí°°¯‹šk¥·  žpƒG‘¤ižºetˆJˆ Wÿÿÿ!ù,KLÿÀžpH,Hb£!“±N±gJuN¥«¹Lz¿àãÒuH4Ä`H"AΊÝv‘¼¼~Ïïûÿ9)(?‹Œ?(& –ƒ~;›œžŸ ¡;57/Šª0, ²¤¡a¶b ,%3«¿ª$V%2w·ËEc'/ÀÒª&!ÇÉ DÝÞ|‚ )ÓåŒ4”—™y¢ïðœ¤54æö?'=³̶˜°Á×½r&ÁÊ€·˜”Aî`¹ 7<ÈÁv‚ŶßBú ÷À EiLØ ®RŽA<âÉüD 'ËcÿüøÛñK®&*æ¶S‚J9Ht@VÔ‹ÄP,E :†#5I6O„ À¨°•)€6h bÐÌ»£°HÑÖí… B”àGª*’%F€xª/«·+¿b£j؈ŒÄ;Vµó/K`‘•y6­ 7ÿè<C€¹ërà•Y3 ͪ±Þz„ŒY•›É8ABmêÍ ­ @)‚TÁ•°è@Ä“ª“3À!êóÑà‰/múƒÖÕmäDAƒF¢p`KWöìM¤òç—• A‡q‹Ì08 pæT@Ã( " <às aa,Á„Ðéàÿ‚ 6d ¢¬°‚7àôƒ€>´èƒ*S‹/¢0à 0àðZsV\h•@,è¢-Ì(¼pÀíµ÷º @£ H L9‘ àÁg8w‚ €A ¬€- p\ðÁÔ©ÁÈ–LIe4ª¼€ƒŸ*á„/\0Až¶NIà|àír^ƒµ((‚±4â ÿ#(h0¥ $GÉPIx^1¶šN ®œ0À'ŒC§‹ðª4"¨‹8\Ђ#/@€Ã—ôÅMX Ò ~*0À"ðÚʨ¼²P6rÀ¼úP#Ø: ¯@—:RèÛ,D !‘ (0Р¦@ðÁÞp *ËÂ$»JÐp^€4ÀV± dT/h Qfôp.Ìð¦š>)‰‚¬¼òܼTgÈGß½Sm³Gi´0À­;M7 *ĉF”opvUPöÆó)êqLòÔ´K»èàHð44×úà &Ä.Àì&Ôðÿ@Œí„@àG0BDÝ'ŒÐB„$2 ÐðãÐ,}û\-WïÀ{¼Çsm4U´BäB]›a/¹ú ¬g Á "ä@Å$óöì 8lazÎGôP´ G—ªÅº½ }*¨À‘&ˆ$Hñ Pöè àùt¬u‰€;ðS“ àŒsÑò± ¼`i @C Y>Àq˜r# ªcºP«8a´Ä„À  °`@3ÐX¦”À*‚j(¹Ñ äÁðf|!ÂeF‚@×·’ç%ÕL[TÒ”n0 hÿqq]l‰sòF˜-8M Æå-:µð@à˜§Q pr—ž´A*áŽ3(Ûâ:Ø9²c¡K@XP´ì5”$'¨` ’A¤4€e —ä^p†x#Àï& â)‰Ø‹øh€GHœ«ÅÔ×Va²ÝPÔÆ-pŽ+0{ý„0C‰G:OPFÀ NP޲”§Lå*së0‹s—b$³jXC¤˜ÇLæ2›y±;’ƒm@¶s™g޳œÉüÏ–}®Ç’-¡ FvºSo€´ Yfç{W(F‚Æêå@"tÐŽ´¢ ÍÕß·*¡»N«ãÓT 5¨†G-êNË®西 `ƒ¦ÅÑ­ž¬gMëZϺӳcGƒ½“¢tx@b°‡Mìb›Ø\òƒ—9¡ëŒJ‚j[ûÚØÎ¶¶1í+ cÕöÝ.Jp±FûÜèN·º×},hÁ[öBHÆs–—ØûÞøÎ·¾÷=ð€î>8^‚;freeradius-server/dialup_admin/htdocs/images/pixel.gif000066400000000000000000000000531257552170400235100ustar00rootroot00000000000000GIF89aðÿÿÿ!ù,L;freeradius-server/dialup_admin/htdocs/images/title2.gif000066400000000000000000000153261257552170400236030ustar00rootroot00000000000000GIF89aôLÕÓØÊ‘«]™´b†V§¹„š©{ºÉr…ILZ1ÊÍÄTb5[k:–œŠz„gmu^u}c~”Qj|Dv‹K`q>†“kÎÒǤ{N[eGGS-£¬“«µ—‹knFŒ˜rdu@P^3³¾ÅÔ¨zˆ\fxABM*ÚàÎ;E&˜Sp{Y’ŸvŽ¥^ ±~bkPxL_iKWf7ƒšT–R”¦nYh9fqQjwNT]@^FO3Šžb„œUtˆJžºeÿÿÿˆ W!ù,ôLÿÀŸpH,ȤrÉl:ŸÐ¨tJ­Z¯Ø¬vËíz¿à°xL.›Ïè´zÍVòÞð¸|N¯Ûïø¼~Ïïûÿ€‚ƒ„…†‡ˆ‰Š‹Œq=‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬‘m¯°±²³´µ¶·¸¹º»¼½¾¿eÂÃÄÅÆÇÈÉÊËÌÍs­ÐÑÒÓÔÕÖרÙÚÛ“ÀÞßàáâãäåæçèéê[ÎíîïðñòóôõrÜøùúûüýþÿ%­H° Áƒ*\Ȱ¡{#JœH±¢EF3jÜȱ£Ç­ŠI²¤É“(Sªüv±¥Ë—0cÊ<²¦Í›8sꬶ²§ÏÿŸ@ƒ JôÜÌ£H“*]êr§Ó§P£Jµ)…€U+®bÕšõjW«_ (áJÖkY°Z«œÝzõÉÚ]Þ: ÖÈÛ»fÛÚÂkÕm^´Ùî;Ö+–ºDø ^Œ8‰Ü&tÓ–ñAÙÊ–1_®¼™rg;v `D³iΧ=c=:JêÌ•Y“Vòš€èÙXjß^òù³l!µƒ£Ž½[–pÊ¿iW½6säÅ‹hŽ^uõíÇk÷M}ˆîÖc_'wâçfçÓWF¿s„ˆc¾½}Êìñ«§ü>þü=õéwŸýÉgG€>ä—à{‚ ‚*0ø_ìG |ò=h!„8ÿ¡3èá–("†òð ŠTX™‡& (c‚î±H߆ÞáâŒ#îቯ±€™•I™‘>€DdsHF9$fJ2ÉÉ“Ïù€d•MV‚åv?°d)_ö昖ð—eNY¤›GR¦•ù´ùfe\Zbgœwòég’sv I™g ꉚ• !æžZÂÙhŸ€.ihŒŠµè%ˆf™ç&P f€*je¡’Š HA ³y:*e¥Âúª±ú€ªª¬6᪩¼Rv몸±«¬¤vÀÃ(+Ű´‚j,²Ê±’µþŠ ³Öªí¬¿æÚ³ÛVÖm´?€›í¹â¦ ÿì̪ðl²RL[£@€.±ø6›.®¸™[ì±ð!o¯¶ªë- P€ P0s°€Wl±ÅGL‚*ÀÂB$ìB$,@ÃÅKœòÅðª.Œ„V:,Ü0 /òÆ|DÂ6;œò¨ r@3,tÄD„hAg ñtàDòÄ,w-5<{|t4sÅ:ḵØ?+¬ô×\w}ñ×aû²Ûx`ÃÚ,è0—VØìÁUKàÂÈ%ŸlñÖ+Ëí2Ì2'Ýð×ð=vP¿½uÕ1“{Dt€Ù£—`ú騣Nze `æ_è%+€@©ŽÿÙ ©Ÿž ¼ß¦¾:e­Wö:}¢W6¼ äX^ò”-ßüóÑ×q€‚ËgÕD`»ò¹—_ÂòÅSv<2Á«ŽYú>¬ÿFèãWo~î軞!ý¬Ÿ—!;¢Qe¼·€ à›]í”w;óí®w¨šÿªW¿øý>Üà «&½:tBÀ ÞÀ€ H¡ WHÌ´°2‹ádpL`…4xf@P®ЀÁ ÐT‰×Tì„/¤L}C'…°2#¬ >Àƒ ¡ ©hÅI ê3Q¤ÌË\p&-²®‡(\¡—¸Ä&ZÈC¢ 1ãÆGdÿŠ$4aÕ¨B6ÒQRwT¢f$…‰LiÇ€.ˆhhCê°2<ÔãIÄ! *>c&1cÉI Œ˜ãœ8õ„Ø‹ÊËÀMƒVºgš„ß\p@À5¼¡+)VÁ쮄¬t¡•„XH•àa,13KdÍ”l€ŠvEVš¨$Þ4;PM$ÄIËs Žu >™q|å.—Y™f¢àrb0怩ÌGRÆÏ<%S¹Ju®Óž>p' ÊÙ¿õÐK¢AÂ>£ q@Èåv©€^þ2¤$1…€Í}z4 ´|'¾YAqòðÌBG™7º (€ÿ„#Lg*ÓÊUðVõº.#@S¢UðüM£wµƒÁ_”y —¸¼qqTŸ,eÝ6»yM¨¢oªÖ4I³é“^€ =çKcJÓ™Ú”«NR} Ô0õT›ÍJ­çR˜ µ¬5­USÕ%°ú~x—瀤%:”–;íé~Ê» u–ëzª9áʯ!lõ£&E)yøp€x€ x@@Zä ¼ƒéVËZÖ~´0­ð€8Ï€ïáé[«³Ðʶ´¸s^]+SÍ¡È-Ú”àÐõejq†€çŽ–¶  8¦‚ÿtö³¡miU9Í÷ â»°ÿ/iÉ =cÑ!>àmiàËçÉ4¾ê5-jÇÚÚþ¾Ö·×­ím#(Œä*—¹ p.tq§TêZw¶µÕ.w½ëÙôÎ÷´©í¯a+[ì8|ø%-maÀ pìC00ZÄ–´õm¯n‰ÆÚÞÆ6¿Á&qI`\8 7¼qH§"Ík¦X›ßç9k²Vvvò_ÿ¡ìè*CZÒO®L¥E­É6 Ê ¬ =@BÌ“ö˜Éle3KâϹu—> ÐC'ÚÒ•€Â\ß·M 44Ð NŒ¥£@´ZR|à΄v¶†j«òÐãÁáj81øÁ¯–×òëU©™Õ),[ªôö&81ãUy3»hÎŽv´§]RkŸ4¥ZÀNeÌÎt¯;vîÆ ¼¹ÍUiüÙßÁ¹Šƒ5š˜¹Ú;wðjó׾ζý]Þ};ܲ‰Ö½?ún  (ØwËQ~p/Ìü¯XÕwIy®Y#ü<³˜…Îé=û‚k#C ;ïIK°\›ù®j4ƒ~ÿ„ËF•2ýÞzÖµªs°=éX猘§×ë–:@›iu±s³Þ#-{Wyþq®.Ï1`èÐS.0«žœðLøyþÚIKÈ@ïHß,€"T /H€æÐ—¶· €å/ŸùÍ£{ìlåI¿ùœzœCèLPy¤ —ç¼tÇÊcøD€h0¸}î[ÜWÀ¾2]=æ[ßùòº7ª·üò7ßüÏ¿Wô¸Ÿ¾æ_>å—^óÕ7ïõG¯}×ßvÉŠ˜}í…þÝô÷øý‚Ÿ}Î÷È'÷™ïyñÏ!ôä÷}æ‡=”'}XzøG8ï!zë—{ €­Ç}©W€ÿ¬gzç{r}¨y¸y™g|Ïóáƒ}8€°ç#W 5`0h6hÈF)°‚-ø‚1hmÇvf „ƒ.ƒÀƒµ6h“ "€ƒ# L¨6ð2nöhfB+0:À‚LXM¸ ( @¨ƒ08ƒ{Vƒ›ðƒX(†2HƒƒÆ$a(„D(&oƒ6°!`"Ð"°‡"@|(7ˆ…0ˆÉ$JfH H¨„Mè„PRhfP…WØ‚.¸…]ø…?0‡cȆ^ˆ9‡$pl*˜†Bø‚L¸8p‡xÈ€ƒÀ„0ؠ؃”€†Ÿ¸ƒ¡X„š`‹Aƒÿ/0;ƒ¨…§˜Š­ˆš8„¹xˆ®PJ†‡oà†w–ygWxƒ×sL0Pånß·±1ÐW&WåÅ vÏh?gqéØuÒ8N}GsŽRr˜¡;…Ø…õØP °Ýøá˜bTŽçXqÓÔŽdWñøu ©I?á4F׌f‡xK xº³<YEÇëxT•'‘˜C‘{g‘J°RîÖl,Ú¶qõ=”Äè’öf’ìh“y§W7j WnÇ$] SV#žs*ùoE™Pì¢qãH295 Bàu =¹xkÇ‘wt$™’&ùÒ…7 WiÿL:âSÐRÎz Ò–•qz"8˜!—”A—èwu—ni}ÿ—õx[à—©ô–‚Зlù—þ' ˜sé<"¸–”—>`™~„G•]@Õ^x^”y™Œù|Ž ™yI˜†Y=ýGšqð˜©ézš–9›fT™¯©—v¹˜‘yh{y ²y— –Y›¢¹›u‰‚g&@{¶g|ðœX‹°œ•'|¸‡>¨œÌi€»¨ÕéœÐY†m8Ûéœ<˜,ÔÙœÆ7ž‚6 ´žÜéž5øIò‰žÉžì‰{)P{@˹œ  hy/U8ŽhI­ŸçÙžÑy„æžÿÆ—žpŸJž^¡ûÙùi¡¸gÎÙŸµW àÎ ¢šŒÙé¡J‹™À ÊŸØÓP{ ¢•G¢&š¢.š ÊXhÀDÊ/’Tù10‰ ¤Ej‘7‘A:¤D ¥_YL@Ú‚NZ¤/ v3Њ­¦bʤ[ÊV:“SZ¤FŠ¤ê˜¥MJ¥Dz¤z¦“–e¦rš¦ä´¦EŠôLSB 0;èä;gT §gj¤^`*¦@¦­ˆ§OêP<À§sê¦]G©UÚo˜Ê€: „ƒ¨J% § Z©WúT˜ª§ –Ÿú‹³>@ /PŠ1˜ªÿºªi‡“š*’˜å«^‰’X r‚$Oy’Riuš¤Nð‘Ï*t#‰•æäK»CˆÚšLÚúK³f5«Â”_°ŽŽ¢¬ƒ×¬4¬E`•‡GN×j:Ð=ç¯\IÕŠ–`MÛ(rd9Y;g¬I –¯)V€Yš·)™½9?¿iœ KŠi›º™/ R+–ùz…9±Ì³š Y°û^¦ › Û°•]ð:¯(kÔc±Å)±;+‹šk°Ùš!›¯é v>·c²Ë3³¼™›0+²C«.k™+Tsv«A›°GËd)Hœy†¡Ò PÞy„¬†Y‹ ˜¤Iš$%?™kJµÿŠE[ Egë$…ƵùIœÒdW<>t[·tû,º8 _KœbKé¶^¨p”¶kûEXû¶š©MªU+%Tµ?]ëDĹz’¶ƒha²(02 R–”A¹–ð£ÌY5Ðz6 ®#5£[ºšWQZ’«»y®ë«»›W¸Wy#àŸ»[{»k|¬[|–j»šwºÓZUěƋ몺«¼³‹•É[…[v{½áó,-I¦4½¹ ½«»¼;z¤+»Ãû¼¦‹º–å¼–½ý6½Õû»¸×™8@¾îK¬@¼Ñ‹¯X𼯠®·ÔYõ ¼Ìg¾´û¦±ª¾UÉ©húºD`Jÿ­êÀXú©~úK€¨bÈ« Œró‘ÀÇK¬¥¨J§Ì;R ¬§_«ÇAÕÂ.ì‡SKˆ !§lZÁÉtÁœ§–êÁ%|§Ìw Â³ú{¶:ˆ+‹Zz¦®Ú•ŠêÃüÀQ̦tÊM6gu<w¶š¨*Å‹[³˜P{œ²G²F‹Æx´Ài²÷ó´»I8‹˜Ð§Æ6ËšF–³#ë±ß#‚ðÈ‚<È6R nÌ–={?>«±[Ç‹³g>~<\ „LÏ3;˜Q›jŒ›H‹Ç«É¯¿71´C›û™Ž0µ‰›I…kGm+k*Z‹–ë +ËpÛC)¤aÿ«åV‡¸fkµ¡°·j Ì¿öÊŸ‹¸ƒ h DvF)ÎÜ$Ь ÂL<¸<\ÆËdŠÉòËïyµÙ,Šf»Ì!gáãf?€j>yÌ=*¹«\ËZËÍDBg°DËšð£SI­ÃÆÅÊ¿O–¿äC|d2št•èÊ9 ­M ­A\•ïè®Îúв x½GjDgÕšÐóFÑì°®§Sñ'TÜøUË*Á’u¯¯z¬’‡8ðV ÝÒ*•¿è»yËk§UɾåÛº*ýÝ›ÓÂ;ÅÒ‚ÓíÛzÔÛ;Ö{½$0À¸w¿3é¿ ÌŒTýÁÍ«¿ïKÔÊ[Õ±0ÔI}»Õ;·ÿN Õ?]ÔSÍÕ;¤1àÓRMNW À¸ô;oçÖìÏH}ÖûkÓ…wÕé)fýÖ|ý9œZÊ7À¦7`^ŠŠŽê¨Ù!°„MÊ ] KÙ“ÙL|Ù‹Ý§Ž½Ù¾™Ø¡M¤ÎU½ÐÚ®ÝÚ—­Ølб¨ÍØ£]Ú’ÍÙ¼mÚ ûþú\¸ýØ©Ùí¨–m˜Ù±yÛEzeLåܪ½_AõÚ®Û³Ú `Û =ܤ]Ü»ÙɽÜ=;²Ô­Øž‡*ñ>ð×#ÞzÙÛŽúÙÊÍÝ£JÜ”}ÚßýÜÑ:´*ÛÊMÛEêÉR›œTû°¶CƒØvÿÐsa‚ ¾ÊKô¾ök³œgÜÄkfÌ´¬Í‚»I«ü†Tâ˜1…_v0ÄIâ¯1¨É„=.&ðl„u’á«ibâáe»ÊšäâÍã.eeäãl8…HÎãÉ(á¯Ñj¯qáìœÌÃÜ̓Â$ äë| ú\q@9¶3¯ÉD”WÓå~‹¬e^õòNÁ"­V£æÙ6; 0çJ“\îå>@x.qp-p×´•çæC9Ò=¹Ð¹Àæ1sÙç)ÍÁt.v@ "èb¾]M¤ñæåòÑy,d~çfêh¾çâ*ÔÀŠÕì"ç,vZçw1¢/IÕ™' U’ê òPÿÎDÅûìŽs°3Â!‚ëXs<°â PÀž/…šn9µë·àÐ<­¤ïÈÑ”ì°ÎV²~,u÷ÒlÑ~Uëu>#¸.RGíìëÑ…mj¹غ7¢ð¾y Öv4·þÉ··y¨yøî >¿Ã°ì~ÑÝš$X~;ðÓÇŸðn|øîœ.3™<¥KõG|÷÷ðï€óžQ¾§ðá§Çñ å÷ñ wð˜ðØzýŽñ /ï¾DïÔñ)O}od&vïñÎ*ïîÜñ,+òHòã—}'¯°¨ Mö.P20Nˆm‡Bº\cŠcB÷…‹‰(Pì»Uc8óô nBÿÖ¼Z<Æ(°†"CM¿OßvßÖE^1pÀÝöc¤H1°ö`ãR?õ~[foIbò›Û¯Ó÷So2Gtõ…¢öNõ‡vpŽÏöÿöõ)÷tvO‰¤¤z¿­Q?ö×\õÏÓæÿe¡ßà‘?ùZ;÷uõct4[ÏS4¶Ë_/úbß_eöi¯úÏú˜ß†šû nˆ6¾ŒÑ*•Œ²ÛýÛê­œ®á82s¶fѲóý{q¸¡qÍÿüª4”ÅÖPC]|nÅPìäÏþÒ?ÿº_@Eé1wµ:¨Ù áHÌ @´Oljí;ˆ$²P 2ÿÙL’t¸Ä~añ˜\6ŸÑéßNFµbµ\/Ø»H4ö¨XDx$xª®ø²Š‹Ž’–šž¢¦á²ä¾Îìðôøü;&h@ 7‹@ü&˜dÄØÜ ãhº,ëîòö´8ÿ$dvÔ‚Íd\@EI…@–™››hV%œ\ÙŒ?¬FŸ“‡¸SýQ\ÈCG…`&!€Í¤'`’S¥;$\$ŽÓ•¿:Sް1¦ô ø-Ú´ja®)TÇÎ|€øçÕ P=þìs®<ùäŽÀ÷ ü=ìè+ð¾ )¬ÐB 0»¼oºüöÏ?pAè2|ð+üÿÛÑ<KTPÄ{Hq>`$ô0³;ñÂæ2úá ý\ØG‚%™lÒÉ'õqaÅ—Æ8ò‚$¡Ì2Ë$§$ǨT2Ê @á¦2v@á:,—äRb@!L-éÔÒM*¿œ³Î'ïô²0¯“Ë2Ï,ÒPC­dsLBÓHsMA¥|3N=÷´3R<ó ”ÉAÍlTMMÛŒN9A­tËKý4PE9-t GKíóЋ¢˜T†[qÍU×]q…Š2j•“×a‰õ5Õrv°µW38¶Ê(P¶×GšMVZb±ÖX`­Í¶ØG†é6×h¡pvÖsÕVWr›M£Úh×¥V]o½Ý–[eoe×Üró ½VÒrç¥[{É8_f÷5²ßxÅh¹¼ˆXâ‰)®ØââF»Xã1ÎØâ‡ÏºØ8ŽIÞ8³’9ÖLcYn™å•A†9.”QVYä˜ož™f’mþgŸYR衉.Ú裑NZ饙nÚé§¡ŽZê©©®ºht±ÎZë­¹îÚë¯Á[ì±É.Ûì³ÑN[íµÙnÛí·áŽ[î2\®Ûî»ñÎ[ï½ùîÛï¿\ðÁ / dialup administration <body bgcolor=yellow> <p><font color="darkblue"><h1>this page can only be seen by a frames capable browser. sorry...</h1></font> </p></body> freeradius-server/dialup_admin/htdocs/login_time_create.php000066400000000000000000000213541257552170400246240ustar00rootroot00000000000000 Login-Time Creation Page 'Monday', 'Tu' => 'Tuesday', 'We' => 'Wednesday', 'Th' => 'Thursday', 'Fr' => 'Friday', 'Sa' => 'Saturday', 'Su' => 'Sunday', 'Al' => 'All Days', 'Any' => 'All Days', 'Wk' => 'Weekdays'); $rules = array(); if ($add == 1){ if ($use == 'double' && $start_day != $stop_day){ $new = $start_day; if ($stop_day != '') $new .= "-$stop_day"; if ($Dstart_time != '' && $Dstop_time != '') $new .= "$Dstart_time-$Dstop_time"; } else if ($use == 'one'){ $new = $day; if ($Mstart_time != '' && $Mstop_time != '') $new .= "$Mstart_time-$Mstop_time"; } if ($new != ''){ if ($rulestr == '') $rulestr = $new; else $rulestr .= ",$new"; } } $Mstart_time = $Mstop_time = $Dstart_time = $Dstop_time = ''; if ($rulestr != ''){ $rulestr = str_replace('"','',$rulestr); $rules1 = preg_split('/[,|]/',$rulestr); } if ($rules1){ foreach ($rules1 as $rule){ if ($delete1 == 1 && $sel_rule == $rule) continue; $matches = array(); if (preg_match('/^\w{2,3}$/',$rule)){ if (!check_day($rule)){ $err_msg .= "Rule '$rule' is invalid
\n"; continue; } if ($sel_rule == $rule || $sel_rule == ''){ $checked[one] = 'checked'; $selected_more[$rule] = 'selected'; } $msg = $mapping[$rule]; } else if (preg_match('/^(\w{2,3})(\d{4})-(\d{4})$/',$rule,$matches)){ if (!check_day($matches[1])){ $err_msg .= "Rule '$rule' is invalid
\n"; continue; } if ($sel_rule == $rule || $sel_rule == ''){ $checked[one] = 'checked'; $selected_more[$matches[1]] = 'selected'; $Mstart_time = $matches[2]; $Mstop_time = $matches[3]; } $msg = $mapping[$matches[1]] . " $matches[2] - $matches[3]"; } else if (preg_match('/^(\w{2,3})-(\w{2,3})$/',$rule,$matches)){ if (!check_day($matches[1]) || !check_day($matches[2])){ $err_msg .= "Rule '$rule' is invalid
\n"; continue; } if ($sel_rule == $rule || $sel_rule == ''){ $checked[double] = 'checked'; $selected_start[$matches[1]] = 'selected'; $selected_stop[$matches[2]] = 'selected'; } $msg = $mapping[$matches[1]] . " - " . $mapping[$matches[2]]; } else if (preg_match('/^(\w{2,3})-(\w{2,3})(\d{4})-(\d{4})$/',$rule,$matches)){ if (!check_day($matches[1]) || !check_day($matches[2])){ $err_msg .= "Rule '$rule' is invalid
\n"; continue; } if ($sel_rule == $rule || $sel_rule == ''){ $checked[double] = 'checked'; $selected_start[$matches[1]] = 'selected'; $selected_stop[$matches[2]] = 'selected'; $Dstart_time = $matches[3]; $Dstop_time = $matches[4]; } $msg = $mapping[$matches[1]] . " - " . $mapping[$matches[2]] . " $matches[3] - $matches[4]"; } else{ $err_msg .= "Rule $rule is invalid
\n"; continue; } array_push($rules,$rule); $rule_msgs[$rule] = $msg; } } if ($sel_rule != '') $selected_rule[$sel_rule] = 'selected'; else $Mstart_time = $Mstop_time = $Dstart_time = $Dstop_time = ''; $rulestr = ''; foreach ($rules as $rule){ if ($rulestr == '') $rulestr = "$rule"; else $rulestr .= ",$rule"; } if ($update == 1 && $val != '') echo << window.opener.document.edituser.$val.value = "\"$rulestr\""; window.close(); EOM; if ($checked[double] == '' && $checked[one] == '') $checked[double] = 'checked'; ?>
Login-Time Create Page 
 Range EOM; ?>
  Start Day Stop Day Time (HHMM)
 - 
 Specific  - 
 
   

Rule Set
\n"; foreach ($rules as $rule) echo "
 
Rule string (UUCP Format)
 
window.document.ruleform.rulestr.value=window.opener.document.edituser.$val.value; window.document.ruleform.submit(); EOM; ?>
Close Window
freeradius-server/dialup_admin/htdocs/nas_admin.php000066400000000000000000000203531257552170400231020ustar00rootroot00000000000000NAS Administration Page
Could not include SQL library functions. Aborting EOM; exit(); } if ($config[general_restrict_nasadmin_access] == 'yes'){ $auth_user = $_SERVER["PHP_AUTH_USER"]; if ($auth_user == '' || $mappings[$auth_user][nasadmin] != 'yes'){ echo <<NAS Administration Page
Access is not allowed to this username. EOM; exit(); } } if ($clear_fields == 1 || ($do_it == 0 && $select_nas == 0)) $selected_nas = $readonly = ''; else $readonly = 'readonly'; $link = @da_sql_pconnect($config); if ($link){ if ($do_it == 1){ $selected_nas = da_sql_escape_string($selected_nas); switch ($action) { case 'check_nas': require_once('../lib/functions.php'); if (!check_ip($selected_nas) && $selected_nas == gethostbyname($selected_nas)) $msg = "The NAS name is not valid
\n"; else $msg = "The NAS name is valid
\n"; break; case 'del_nas': $res = @da_sql_query($link,$config, "DELETE FROM $config[sql_nas_table] WHERE nasname = '$selected_nas';"); if ($res){ $msg = "NAS '$selected_nas' was deleted successfully
\n"; $selected_nas = ''; } else $msg = "Error deleting NAS '$selected_nas' " . da_sql_error($link,$config) . "
\n"; break; case 'add_nas': if ($nasname == '' || $nassecret == '' || $nasshortname == '') $msg = "Error. Required fields are not set
\n"; else{ $nasshortname = da_sql_escape_string($nasshortname); $nastype = da_sql_escape_string($nastype); $nasportnum = da_sql_escape_string($nasportnum); $nassecret = da_sql_escape_string($nassecret); $nascommunity = da_sql_escape_string($nascommunity); $nasdescription = da_sql_escape_string($nasdescription); $nasname = da_sql_escape_string($nasname); $res = @da_sql_query($link,$config, "INSERT INTO $config[sql_nas_table] (nasname,shortname,type,ports,secret,community,description) VALUES ('$nasname','$nasshortname', '$nastype','$nasportnum', '$nassecret','$nascommunity','$nasdescription');"); if ($res){ $msg = "NAS '$nasname' was added successfully
\n"; $selected_nas = $nasname; } else $msg = "Error adding NAS '$nasname' " . da_sql_error($link,$config) . "
\n"; } break; case 'change_nas': if ($nassecret == '' || $nasshortname == '') $msg = "Error. Required fields are not set
\n"; else{ $nasshortname = da_sql_escape_string($nasshortname); $nastype = da_sql_escape_string($nastype); $nasportnum = da_sql_escape_string($nasportnum); $nassecret = da_sql_escape_string($nassecret); $nascommunity = da_sql_escape_string($nascommunity); $nasdescription = da_sql_escape_string($nasdescription); $nasname = da_sql_escape_string($nasname); $res = @da_sql_query($link,$config, "UPDATE $config[sql_nas_table] SET shortname = '$nasshortname', type = '$nastype', ports = '$nasportnum', secret = '$nassecret', community = '$nascommunity', description = '$nasdescription' WHERE nasname = '$nasname';"); if ($res) $msg = "NAS '$nasname' was updated successfully
\n"; else $msg = "Error updating NAS '$selected_nas' " . da_sql_error($link,$config) . "
\n"; } break; } } $search = @da_sql_query($link,$config, "SELECT * FROM $config[sql_nas_table] ORDER BY nasname;"); if ($search){ $num = 0; unset($my_nas_list); while($row = @da_sql_fetch_array($search,$config)){ $my_nas_name = $row['nasname']; if ($my_nas_name != ''){ $num++; $my_nas_list[$my_nas_name]['name'] = $my_nas_name; $my_nas_list[$my_nas_name]['shortname'] = $row['shortname']; $my_nas_list[$my_nas_name]['type'] = $row['type']; if ($clear_fields == 0 && $selected_nas == $my_nas_name){ $selected[$my_nas_name] = 'selected'; $selected[$my_nas_list[$my_nas_name]['type']] = 'selected'; } $my_nas_list[$my_nas_name]['ports'] = $row['ports']; $my_nas_list[$my_nas_name]['secret'] = $row['secret']; $my_nas_list[$my_nas_name]['community'] = $row['community']; $my_nas_list[$my_nas_name]['description'] = $row['description']; } } } } else echo "Could not connect to SQL database
\n"; ?> NAS Administration Page

NAS Administration 
EOM; ?>
NAS List
NAS Name
NAS Short Name
NAS Type
NAS Ports Number
NAS Secret
NAS SNMP community
NAS Description



freeradius-server/dialup_admin/htdocs/password.php000066400000000000000000000017021257552170400230100ustar00rootroot00000000000000
>
Check Password 
Password 
freeradius-server/dialup_admin/htdocs/password_generator.jsc000066400000000000000000000016411257552170400250500ustar00rootroot00000000000000 freeradius-server/dialup_admin/htdocs/session_destroy.php000066400000000000000000000003461257552170400244050ustar00rootroot00000000000000 Session Cache Destroy Page
Session Cache Destroyed freeradius-server/dialup_admin/htdocs/show_groups.php000066400000000000000000000045461257552170400235360ustar00rootroot00000000000000 User Groups
Could not include SQL library functions. Aborting EOM; exit(); } if ($config[general_lib_type] != 'sql'){ echo <<User Groups
This page is only available if you are using sql as general library type EOM; exit(); } ?> User Groups


User Groups 
Only groups with members are shown

$num_members){ $num++; $Group = urlencode($group); echo << EOM; } } else echo "Could not find any groups
\n"; ?>
#group# of members
$num $group $num_members

freeradius-server/dialup_admin/htdocs/stats.php000066400000000000000000000127611257552170400223130ustar00rootroot00000000000000 account analysis
Could not include SQL library functions. Aborting EOM; exit(); } $stats_num = array(); $date = strftime('%A, %e %B %Y, %T %Z'); $now = time(); if ($before == '') $before = date($config[sql_date_format], $now + 86400); $after = ($after != '') ? "$after" : date($config[sql_date_format], $now - 604800 ); $after_time = date2time($after); $before_time = date2time($before); $days[0] = $after; $counter = $after_time + 86400; $i = 1; while($counter < $before_time){ $days[$i++] = date($config[sql_date_format],$counter); $counter += 86400; } $days[$i] = $before; $num_days = $i; $column1 = ($column1 != '') ? "$column1" : 'sessions'; $column2 = ($column2 != '') ? "$column2" : 'usage'; $column3 = ($column3 != '') ? "$column3" : 'download'; $column[1] = "$column1"; $column[2] = "$column2"; $column[3] = "$column3"; $selected1["$column1"] = 'selected'; $selected2["$column2"] = 'selected'; $selected3["$column3"] = 'selected'; $message['sessions'] = 'sessions'; $message['usage'] = 'total usage time'; $message['upload'] = 'uploads'; $message['download'] = 'downloads'; if ($config[general_stats_use_totacct] == 'yes'){ $sql_val['sessions'] = 'connnum'; $sql_val['usage'] = 'conntotduration'; $sql_val['upload'] = 'inputoctets'; $sql_val['download'] = 'outputoctets'; } else{ $sql_val['usage'] = 'acctsessiontime'; $sql_val['upload'] = 'acctinputoctets'; $sql_val['download'] = 'acctoutputoctets'; } $fun['sessions'] = nothing; $fun['usage'] = time2strclock; $fun['upload'] = bytes2str; $fun['download'] = bytes2str; $sql_val['user'] = ($login == '') ? "WHERE username LIKE '%'" : "WHERE username = '$login'"; for ($j = 1; $j <= 3; $j++){ $tmp = "{$sql_val[$column[$j]]}"; $res[$j] = ($tmp == "") ? "COUNT(radacctid) AS res_$j" : "sum($tmp) AS res_$j"; } $i = 1; $servers[all] = 'all'; foreach ($nas_list as $nas){ $name = $nas[name]; if ($nas[ip] == '') continue; $servers[$name] = $nas[ip]; $i++; } ksort($servers); if ($server != 'all' && $server != ''){ $server = da_sql_escape_string($server); $s = "AND nasipaddress = '$server'"; } $sql_extra_query = ''; if ($config[sql_accounting_extra_query] != '') $sql_extra_query = xlat($config[sql_accounting_extra_query],$login,$config); $link = @da_sql_pconnect($config); if ($link){ for ($i = $num_days;$i > -1; $i--){ $day = "$days[$i]"; if ($config[general_stats_use_totacct] == 'yes') $search = @da_sql_query($link,$config, "SELECT $res[1],$res[2],$res[3] FROM $config[sql_total_accounting_table] $sql_val[user] AND acctdate = '$day' $s $sql_extra_query;"); else $search = @da_sql_query($link,$config, "SELECT $res[1],$res[2],$res[3] FROM $config[sql_accounting_table] $sql_val[user] AND acctstoptime >= '$day 00:00:00' AND acctstoptime <= '$day 23:59:59' $s $sql_extra_query;"); if ($search){ $row = @da_sql_fetch_array($search,$config); $data[$day][1] = $row[res_1]; $data[sum][1] += $row[res_1]; $stats_num[1] = ($data[$day][1]) ? $stats_num[1] + 1 : $stats_num[1]; $data[$day][2] = $row[res_2]; $data[sum][2] += $row[res_2]; $stats_num[2] = ($data[$day][2]) ? $stats_num[2] + 1 : $stats_num[2]; $data[$day][3] = $row[res_3]; $data[sum][3] += $row[res_3]; $stats_num[3] = ($data[$day][3]) ? $stats_num[3] + 1 : $stats_num[3]; } else echo "Database query failed: " . da_sql_error($link,$config) . "
\n"; } } else echo "Could not connect to SQL database
\n"; $stats_num[1] = ($stats_num[1]) ? $stats_num[1] : 1; $stats_num[2] = ($stats_num[2]) ? $stats_num[2] : 1; $stats_num[3] = ($stats_num[3]) ? $stats_num[3] : 1; $data['avg'][1] = ceil($data['sum'][1] / $stats_num[1]); $data['avg'][2] = ceil($data['sum'][2] / $stats_num[2]); $data['avg'][3] = ceil($data['sum'][3] / $stats_num[3]); $data['avg'][1] = $fun[$column[1]]($data['avg'][1]); $data['avg'][2] = $fun[$column[2]]($data['avg'][2]); $data['avg'][3] = $fun[$column[3]]($data['avg'][3]); $data['sum'][1] = $fun[$column[1]]($data['sum'][1]); $data['sum'][2] = $fun[$column[2]]($data['sum'][2]); $data['sum'][3] = $fun[$column[3]]($data['sum'][3]); for ($i = 0; $i <= $num_days; $i++){ $day = "$days[$i]"; $max[1] = ($max[1] > $data[$day][1] ) ? $max[1] : $data[$day][1]; $max[2] = ($max[2] > $data[$day][2] ) ? $max[2] : $data[$day][2]; $max[3] = ($max[3] > $data[$day][3] ) ? $max[3] : $data[$day][3]; } for ($i = 0; $i <= $num_days; $i++){ $day = "$days[$i]"; for ($j = 1; $j <= 3; $j++){ $tmp = $data[$day][$j]; if (!$max[$j]) $p = $w = $c = 0; else{ $p = floor(100 * ($tmp / $max[$j])); $w = floor(70 * ($tmp / $max[$j])); $c = hexdec('f0e9e2') - (258 * $p); $c = dechex($c); } if (!$w) $w++; $perc[$day][$j] = $p . "%"; $width[$day][$j] = $w; $color[$day][$j] = $c; } $data[$day][1] = $fun[$column[1]]($data[$day][1]); $data[$day][2] = $fun[$column[2]]($data[$day][2]); $data[$day][3] = $fun[$column[3]]($data[$day][3]); } $data[max][1] = $fun[$column[1]]($max[1]); $data[max][2] = $fun[$column[2]]($max[2]); $data[max][3] = $fun[$column[3]]($max[3]); require('../html/stats.html.php'); ?> freeradius-server/dialup_admin/htdocs/style.css000066400000000000000000000021741257552170400223130ustar00rootroot00000000000000td {font-family:verdana,sans-serif;text-decoration:none;font-size:11px} th {font-family:verdana,sans-serif;text-decoration:none;font-size:11px} A {FONT-FAMILY: verdana,sans-serif; FONT-SIZE: 11px; TEXT-DECORATION: none} H1 {FONT-FAMILY: lucida,sans-serif; FONT-SIZE: 24px; TEXT-DECORATION: none} INPUT{ BACKGROUND-COLOR: #FFFFFF; BORDER-BOTTOM: #3333CC 1px solid; BORDER-LEFT: #3333CC 1px solid; BORDER-RIGHT: #3333CC 1px solid; BORDER-TOP: #3333CC 1px solid; COLOR: #000000; FONT-FAMILY: Verdana } INPUT.button{ BACKGROUND-COLOR: #999999; BORDER-BOTTOM: #3333CC 1px solid; BORDER-LEFT: #3333CC 1px solid; BORDER-RIGHT: #3333CC 1px solid; BORDER-TOP: #3333CC 1px solid; COLOR: #000000; FONT-FAMILY: Verdana } body { scrollbar-track-color:#b0bd90; scrollbar-arrow-color:#000000; scrollbar-face-color:#d0ddb0; scrollbar-shadow-color:#909d70; scrollbar-highlight-color:#fffff0; scrollbar-3dlight-color:#000000; scrollbar-darkshadow-color:#000000; bgcolor:#80a040; background-image: url(images/greenlines1.gif); } a:link { color: #000000; } a:visited { color:#000000; } a:hover { color:#000000; } a:active { color:#000000; } freeradius-server/dialup_admin/htdocs/user_accounting.php000066400000000000000000000176271257552170400243530ustar00rootroot00000000000000 subscription analysis for $login
Could not include SQL library functions. Aborting EOM; exit(); } $now = time(); $now_str = ($now_str != '') ? "$now_str" : date($config[sql_date_format],$now + 86400); $prev_str = ($prev_str != '') ? "$prev_str" : date($config[sql_date_format], $now - 604800 ); $num = 0; $pagesize = ($pagesize) ? $pagesize : 10; if (!is_numeric($pagesize) && $pagesize != 'all') $pagesize = 10; $limit = ($pagesize == 'all') ? '' : "$pagesize"; $selected[$pagesize] = 'selected'; $order = ($order != '') ? $order : $config[general_accounting_info_order]; if ($order != 'desc' && $order != 'asc') $order = 'desc'; $selected[$order] = 'selected'; $now_str = da_sql_escape_string($now_str); $prev_str = da_sql_escape_string($prev_str); unset($da_name_cache); if (isset($_SESSION['da_name_cache'])) $da_name_cache = $_SESSION['da_name_cache']; echo << subscription analysis for $login
EOM; include("../html/user_toolbar.html.php"); print <<
Subscription Analysis for $login 
$prev_str up to $now_str EOM; ?>

" . $acct_attrs['ua']["$i"] . "\n"; } $sql_extra_query = ''; if ($config[sql_accounting_extra_query] != '') $sql_extra_query = xlat($config[sql_accounting_extra_query],$login,$config); ?> = '$prev_str' $sql_extra_query " . da_sql_limit($limit,1,$config) . " ORDER BY acctstarttime $order " . da_sql_limit($limit,2,$config). " ;"); if ($search){ while( $row = @da_sql_fetch_array($search,$config) ){ $tr_color='white'; $num++; $acct_type = "$row[framedprotocol]/$row[nasporttype]"; if ($acct_type == '') $acct_type = '-'; $acct_logedin = $row[acctstarttime]; $acct_sessiontime = $row[acctsessiontime]; $acct_sessiontime_sum += $acct_sessiontime; $acct_sessiontime = time2str($acct_sessiontime); $acct_ip = $row[framedipaddress]; if ($acct_ip == '') $acct_ip = '-'; $acct_upload = $row[acctinputoctets]; $acct_upload_sum += $acct_upload; $acct_upload = bytes2str($acct_upload); $acct_download = $row[acctoutputoctets]; $acct_download_sum += $acct_download; $acct_download = bytes2str($acct_download); $acct_server = $row[nasipaddress]; if ($acct_server != ''){ $acct_server = $da_name_cache[$row[nasipaddress]]; if (!isset($acct_server)){ $acct_server = @gethostbyaddr($row[nasipaddress]); if (!isset($da_name_cache) && $config[general_use_session] == 'yes'){ $da_name_cache[$row[nasipaddress]] = $acct_server; session_register('da_name_cache'); } else $da_name_cache[$row[nasipaddress]] = $acct_server; } } else $acct_server = '-'; $acct_server = "$acct_server:$row[nasportid]"; $acct_terminate_cause = "$row[acctterminatecause]"; if ($acct_terminate_cause == '') $acct_terminate_cause = '-'; if (preg_match('/Login-Incorrect/',$acct_terminate_cause) || preg_match('/Multiple-Logins/', $acct_terminate_cause) || preg_match('/Invalid-User/',$acct_terminate_cause)) $tr_color='#ffe8e0'; $acct_callerid = "$row[callingstationid]"; if ($acct_callerid == '') $acct_callerid = '-'; echo << EOM; if ($acct_attrs[ua][1] != '') echo "\n"; if ($acct_attrs[ua][2] != '') echo "\n"; if ($acct_attrs[ua][3] != '') echo "\n"; if ($acct_attrs[ua][4] != '') echo "\n"; if ($acct_attrs[ua][5] != '') echo "\n"; if ($acct_attrs[ua][6] != '') echo "\n"; if ($acct_attrs[ua][7] != '') echo "\n"; if ($acct_attrs[ua][8] != '') echo "\n"; if ($acct_attrs[ua][9] != '') echo "\n"; echo "\n"; } $acct_sessiontime_sum = time2str($acct_sessiontime_sum); $acct_upload_sum = bytes2str($acct_upload_sum); $acct_download_sum = bytes2str($acct_download_sum); } else echo "Database query failed: " . da_sql_error($link,$config) . "
\n"; } else echo "Could not connect to SQL database
\n"; $colspan = 3; if ($acct_attrs[ua][1] == '') $colspan--; if ($acct_attrs[ua][2] == '') $colspan--; echo << EOM; if ($acct_attrs[ua][3] != '') echo "\n"; if ($acct_attrs[ua][4] != '') echo "\n"; if ($acct_attrs[ua][5] != '') echo "\n"; if ($acct_attrs[ua][6] != '') echo "\n"; if ($acct_attrs[ua][7] != '') echo "\n"; if ($acct_attrs[ua][8] != '') echo "\n"; if ($acct_attrs[ua][9] != '') echo "\n"; ?>
#
$num$acct_type$acct_logedin$acct_sessiontime$acct_ip$acct_upload$acct_download$acct_server$acct_terminate_cause$acct_callerid
Page Total$acct_sessiontime_sum $acct_upload_sum$acct_download_sum   


EOM; ?>
the from date matches any login after the 00:00 that day, and the to date any login before the 23:59 that day. the default values shown are the current week.
userfrom dateto datepagesizeorder
freeradius-server/dialup_admin/htdocs/user_admin.php000066400000000000000000000270531257552170400233030ustar00rootroot00000000000000 user information page
User Name     does not exist
EOM; exit(); } } if (is_file("../lib/sql/drivers/$config[sql_type]/functions.php")) include_once("../lib/sql/drivers/$config[sql_type]/functions.php"); else{ echo <<user information page
Could not include SQL library functions. Aborting EOM; exit(); } $monthly_limit = ($item_vals['Max-Monthly-Session'][0] != '') ? $item_vals['Max-Monthly-Session'][0] : $default_vals['Max-Monthly-Session'][0]; $monthly_limit = ($monthly_limit) ? $monthly_limit : $config[counter_default_monthly]; $weekly_limit = ($item_vals['Max-Weekly-Session'][0] != '') ? $item_vals['Max-Weekly-Session'][0] : $default_vals['Max-Weekly-Session'][0]; $weekly_limit = ($weekly_limit) ? $weekly_limit : $config[counter_default_weekly]; $daily_limit = ($item_vals['Max-Daily-Session'][0] != '') ? $item_vals['Max-Daily-Session'][0] : $default_vals['Max-Daily-Session'][0]; $daily_limit = ($daily_limit) ? $daily_limit : $config[counter_default_daily]; $session_limit = ($item_vals['Session-Timeout'][0] != '') ? $item_vals['Session-Timeout'][0] : $default_vals['Session-Timeout'][0]; $session_limit = ($session_limit) ? $session_limit : 'none'; $remaining = 'unlimited time'; $log_color = 'green'; $now = time(); $week = $now - 604800; $now_str = date("$config[sql_date_format]",$now + 86400); $week_str = date("$config[sql_date_format]",$week); $day = date('w'); $week_start = date($config[sql_date_format],$now - ($day)*86400); $month_start = date($config[sql_date_format],$now - date('j')*86400); $today = $day; $now_tmp = $now; for ($i = $day; $i >-1; $i--){ $days[$i] = date($config[sql_date_format],$now_tmp); $now_tmp -= 86400; } $day++; //$now -= ($day * 86400); $now -= 604800; $now += 86400; for ($i = $day; $i <= 6; $i++){ $days[$i] = date($config[sql_date_format],$now); // $now -= 86400; $now += 86400; } $daily_used = $weekly_used = $monthly_used = $lastlog_session_time = '-'; $extra_msg = ''; $used = array('-','-','-','-','-','-','-'); $link = @da_sql_pconnect($config); if ($link){ $search = @da_sql_query($link,$config, "SELECT sum(acctsessiontime) AS sum_sess_time, sum(acctinputoctets) AS sum_in_octets, sum(acctoutputoctets) AS sum_out_octets, avg(acctsessiontime) AS avg_sess_time, avg(acctinputoctets) AS avg_in_octets, avg(acctoutputoctets) AS avg_out_octets, COUNT(*) as counter FROM $config[sql_accounting_table] WHERE username = '$login' AND acctstarttime >= '$week_str' AND acctstarttime <= '$now_str';"); if ($search){ $row = @da_sql_fetch_array($search,$config); $tot_time = time2str($row[sum_sess_time]); $tot_input = bytes2str($row[sum_in_octets]); $tot_output = bytes2str($row[sum_out_octets]); $avg_time = time2str($row[avg_sess_time]); $avg_input = bytes2str($row[avg_in_octets]); $avg_output = bytes2str($row[avg_out_octets]); $tot_conns = $row[counter]; } else echo "Database query failed: " . da_sql_error($link,$config) . "
\n"; $search = @da_sql_query($link,$config, "SELECT sum(acctsessiontime) AS sum_sess_time FROM $config[sql_accounting_table] WHERE username = '$login' AND acctstarttime >= '$week_start' AND acctstarttime <= '$now_str';"); if ($search){ $row = @da_sql_fetch_array($search,$config); $weekly_used = $row[sum_sess_time]; } else echo "Database query failed: " . da_sql_error($link,$config) . "
\n"; if ($monthly_limit != 'none' || $config[counter_monthly_calculate_usage] == 'true'){ $search = @da_sql_query($link,$config, "SELECT sum(acctsessiontime) AS sum_sess_time FROM $config[sql_accounting_table] WHERE username = '$login' AND acctstarttime >= '$month_start' AND acctstarttime <= '$now_str';"); if ($search){ $row = @da_sql_fetch_array($search,$config); $monthly_used = $row[sum_sess_time]; } else echo "Database query failed: " . da_sql_error($link,$config) . "
\n"; } $search = @da_sql_query($link,$config, "SELECT COUNT(*) AS counter FROM $config[sql_accounting_table] WHERE username = '$login' AND acctstoptime >= '$week_str' AND acctstoptime <= '$now_str' AND (acctterminatecause LIKE 'Login-Incorrect%' OR acctterminatecause LIKE 'Invalid-User%' OR acctterminatecause LIKE 'Multiple-Logins%');"); if ($search){ $row = @da_sql_fetch_array($search,$config); $tot_badlogins = $row[counter]; } else echo "Database query failed: " . da_sql_error($link,$config) . "
\n"; for($i = 0; $i <=6; $i++){ if ($days[$i] == '') continue; $search = @da_sql_query($link,$config, "SELECT sum(acctsessiontime) AS sum_sess_time FROM $config[sql_accounting_table] WHERE username = '$login' AND acctstoptime >= '$days[$i] 00:00:00' AND acctstoptime <= '$days[$i] 23:59:59';"); if ($search){ $row = @da_sql_fetch_array($search,$config); $used[$i] = $row[sum_sess_time]; if ($daily_limit != 'none' && $used[$i] > $daily_limit) $used[$i] = "" . time2str($used[$i]) . ""; else $used[$i] = time2str($used[$i]); if ($today == $i){ $daily_used = $row[sum_sess_time]; if ($daily_limit != 'none'){ $remaining = $daily_limit - $daily_used; if ($remaining <=0) $remaining = 0; $log_color = ($remaining) ? 'green' : 'red'; if (!$remaining) $extra_msg = '(Out of daily quota)'; } $daily_used = time2str($daily_used); if ($daily_limit != 'none' && !$remaining) $daily_used = "$daily_used"; } } else echo "Database query failed: " . da_sql_error($link,$config) . "
\n"; } if ($weekly_limit != 'none'){ $tmp = $weekly_limit - $weekly_used; if ($tmp <=0){ $tmp = 0; $extra_msg .= '(Out of weekly quota)'; } if (!is_numeric($remaining)) $remaining = $tmp; if ($remaining > $tmp) $remaining = $tmp; $log_color = ($remaining) ? 'green' : 'red'; } $weekly_used = time2str($weekly_used); if ($weekly_limit != 'none' && !$tmp) $weekly_used = "$weekly_used"; if ($monthly_limit != 'none'){ $tmp = $monthly_limit - $monthly_used; if ($tmp <=0){ $tmp = 0; $extra_msg .= '(Out of monthly quota)'; } if (!is_numeric($remaining)) $remaining = $tmp; if ($remaining > $tmp) $remaining = $tmp; $log_color = ($remaining) ? 'green' : 'red'; } if ($monthly_limit != 'none' || $config[counter_monthly_calculate_usage] == 'true'){ $monthly_used = time2str($monthly_used); if ($monthly_limit != 'none' && !$tmp) $monthly_used = "$monthly_used"; } if ($session_limit != 'none'){ if (!is_numeric($remaining)) $remaining = $session_limit; if ($remaining > $session_limit) $remaining = $session_limit; } $search = @da_sql_query($link,$config, "SELECT " . da_sql_limit(1,0,$config) . " * FROM $config[sql_accounting_table] WHERE username = '$login' AND acctstoptime IS NULL " . da_sql_limit(1,1,$config) . " ORDER BY acctstarttime DESC " . da_sql_limit(1,2,$config). " ;"); if ($search){ if (@da_sql_num_rows($search,$config)){ $logged_now = 1; $row = @da_sql_fetch_array($search,$config); $lastlog_time = $row['acctstarttime']; $lastlog_server_ip = $row['nasipaddress']; $lastlog_server_port = $row['nasportid']; $lastlog_session_time = date2timediv($lastlog_time,0); if ($daily_limit != 'none'){ $remaining = $remaining - $lastlog_session_time; if ($remaining < 0) $remaining = 0; $log_color = ($remaining) ? 'green' : 'red'; } $lastlog_session_time_jvs = 1000 * $lastlog_session_time; $lastlog_session_time = time2strclock($lastlog_session_time); $lastlog_client_ip = $row['framedipaddress']; $lastlog_server_name = @gethostbyaddr($lastlog_server_ip); $lastlog_client_name = @gethostbyaddr($lastlog_client_ip); $lastlog_callerid = $row['callingstationid']; if ($lastlog_callerid == '') $lastlog_callerid = 'not available'; $lastlog_input = $row['acctinputoctets']; if ($lastlog_input) $lastlog_input = bytes2str($lastlog_input); else $lastlog_input = 'not available'; $lastlog_output = $row['acctoutputoctets']; if ($lastlog_output) $lastlog_output = bytes2str($lastlog_output); else $lastlog_output = 'not available'; } } else echo "Database query failed: " . da_sql_error($link,$config) . "
\n"; if (! $logged_now){ $search = @da_sql_query($link,$config, "SELECT " . da_sql_limit(1,0,$config) . " * FROM $config[sql_accounting_table] WHERE username = '$login' AND acctsessiontime != '0' " . da_sql_limit(1,1,$config) . " ORDER BY acctstoptime DESC " . da_sql_limit(1,2,$config). " ;"); if ($search){ if (@da_sql_num_rows($search,$config)){ $row = @da_sql_fetch_array($search,$config); $lastlog_time = $row['acctstarttime']; $lastlog_server_ip = $row['nasipaddress']; $lastlog_server_port = $row['nasportid']; $lastlog_session_time = time2str($row['acctsessiontime']); $lastlog_client_ip = $row['framedipaddress']; $lastlog_server_name = ($lastlog_server_ip != '') ? @gethostbyaddr($lastlog_server_ip) : '-'; $lastlog_client_name = ($lastlog_client_ip != '') ? @gethostbyaddr($lastlog_client_ip) : '-'; $lastlog_callerid = $row['callingstationid']; if ($lastlog_callerid == '') $lastlog_callerid = 'not available'; $lastlog_input = $row['acctinputoctets']; $lastlog_input = bytes2str($lastlog_input); $lastlog_output = $row['acctoutputoctets']; $lastlog_output = bytes2str($lastlog_output); } else $not_known = 1; } else echo "Database query failed: " . da_sql_error($link,$config) . "
\n"; } } else echo "Could not connect to SQL database
\n"; $monthly_limit = (is_numeric($monthly_limit)) ? time2str($monthly_limit) : $monthly_limit; $weekly_limit = (is_numeric($weekly_limit)) ? time2str($weekly_limit) : $weekly_limit; $daily_limit = (is_numeric($daily_limit)) ? time2str($daily_limit) : $daily_limit; $session_limit = (is_numeric($session_limit)) ? time2str($session_limit) : $session_limit; $remaining = (is_numeric($remaining)) ? time2str($remaining) : $remaining; if ($item_vals['Dialup-Access'][0] == 'FALSE' || (!isset($item_vals['Dialup-Access'][0]) && $attrmap['Dialup-Access'] != '' && $attrmap['Dialup-Access'] != 'none')) $msg =<< The user account is locked EON; else $msg =<< $remaining $extra_msg EON; $lock_msg = $item_vals['Dialup-Lock-Msg'][0]; if ($lock_msg != '') $descr =<<$lock_msg EON; else $descr = '-'; $expiration = $default_vals['Expiration'][0]; if ($item_vals['Expiration'][0] != '') $expiration = $item_vals['Expiration'][0]; if ($expiration != ''){ $expiration = strtotime($expiration); if ($expiration != -1 && $expiration < time()) $descr = <<User Account has expired EOM; } require('../html/user_admin.html.php'); ?> freeradius-server/dialup_admin/htdocs/user_delete.php000066400000000000000000000047411257552170400234540ustar00rootroot00000000000000 EOM; if ($user_type != 'group') echo "delete user $login ($cn)\n"; else echo "delete group $login\n"; echo <<
EOM; if ($user_type != 'group') include("../html/user_toolbar.html.php"); else include("../html/group_toolbar.html.php"); print <<
$whatisL $login Deletion 
EOM; if ($delete_user == 1){ if ($user_type != 'group'){ if (is_file("../lib/$config[general_lib_type]/delete_user.php")) include("../lib/$config[general_lib_type]/delete_user.php"); } else{ if (is_file("../lib/$config[general_lib_type]/delete_group.php")) include("../lib/$config[general_lib_type]/delete_group.php"); } echo <<
EOM; exit(); } ?>
Are you sure you want to delete ?

freeradius-server/dialup_admin/htdocs/user_edit.php000066400000000000000000000177011257552170400231370ustar00rootroot00000000000000(The groups that the user is a member of are highlated)"; $saved_login = $login; $login = ''; if (is_file("../lib/sql/group_info.php")) include("../lib/sql/group_info.php"); $login = $saved_login; } } else{ if (is_file("../lib/$config[general_lib_type]/group_info.php")) include("../lib/$config[general_lib_type]/group_info.php"); } if ($config[general_lib_type] == 'sql' && $config[sql_use_operators] == 'true'){ $colspan=2; $show_ops = 1; include("../lib/operators.php"); } else{ $show_ops = 0; $colspan=1; } echo << EOM; if ($user_type != 'group') echo " subscription configuration for $login ($cn)\n"; else echo " subscription configuration for $login\n"; ?>

 
User Preferences for $login ($cn) 
EOM; if ($change == 1){ if (is_file("../lib/$config[general_lib_type]/change_attrs.php")) include("../lib/$config[general_lib_type]/change_attrs.php"); if ($user_type != 'group'){ if ($config[general_show_user_password] != 'no' && $passwd != '' && is_file("../lib/$config[general_lib_type]/change_passwd.php")) include("../lib/$config[general_lib_type]/change_passwd.php"); if (is_file("../lib/$config[general_lib_type]/user_info.php")) include("../lib/$config[general_lib_type]/user_info.php"); if ($group_change && $config[general_lib_type] == 'sql' && $config[sql_show_all_groups] == 'true'){ include("../lib/sql/group_change.php"); include("../lib/defaults.php"); } } else{ if (is_file("../lib/$config[general_lib_type]/group_info.php")) include("../lib/$config[general_lib_type]/group_info.php"); } } else if ($badusers == 1){ if (is_file("../lib/add_badusers.php")) include("../lib/add_badusers.php"); } ?>
> are extracted after the attributes in the radcheck/radreply tables.
Please take that into consideration when adding attributes in the group
and selecting operators.
EOM; if ($user_type != 'group' && $config[general_show_user_password] != 'no'){ echo << EOM; } foreach($show_attrs as $key => $desc){ $name = $attrmap["$key"]; $generic = $attrmap[generic]["$key"]; if ($name == 'none') continue; unset($vals); unset($ops); $def_added = 0; if ($item_vals["$key"][count]){ for($i=0;$i<$item_vals["$key"][count];$i++){ $vals[] = $item_vals["$key"][$i]; $ops[] = $item_vals["$key"][operator][$i]; } } else{ if ($default_vals["$key"][count]){ for($i=0;$i<$default_vals["$key"][count];$i++){ $vals[] = $default_vals["$key"][$i]; $ops[] = $default_vals["$key"][operator][$i]; } } else{ $vals[] = ''; $ops[] = '='; } $def_added = 1; } if ($generic == 'generic' && $def_added == 0){ for($i=0;$i<$default_vals["$key"][count];$i++){ $vals[] = $default_vals["$key"][$i]; $ops[] = $default_vals["$key"][operator][$i]; } } if ($add && $name == $add_attr){ $vals[] = $default_vals["$key"][0]; $ops[] = ($default_vals["$key"][operator][0] != '') ? $default_vals["$key"][operator][0] : '='; } $i = 0; foreach($vals as $val){ unset($selected); $name1 = $name . $i; $val = preg_replace('/"/','"',$val); $oper_name = $name1 . '_op'; $oper = $ops[$i]; $selected[$oper] = 'selected'; $i++; print << EOM; print << EOM; } } ?> EOM; } ?>
User Password (changes only)
EOM; if ($user_password_exists == 'yes') echo "User password exists\n"; else echo "User password does not exist\n"; echo <<
EOM; $desc = addslashes($desc); eval("\$desc = \"$desc\";"); $desc = stripslashes($desc); if ($i == 1) echo "$desc\n"; else echo "$desc ($i)\n"; print << EOM; if ($show_ops) print <<
bgcolor="#d0ddb0"> Add Attribute
Member of $extra_text


<--Help EOM; } ?>
freeradius-server/dialup_admin/htdocs/user_finger.php000066400000000000000000000153461257552170400234670ustar00rootroot00000000000000 User Finger Facility EOM; } if ($config[general_decode_normal_attributes] == 'yes'){ if (is_file("../lib/lang/$config[general_prefered_lang]/utf8.php")) include_once("../lib/lang/$config[general_prefered_lang]/utf8.php"); else include_once('../lib/lang/default/utf8.php'); $k = init_decoder(); $decode_normal = 1; } require_once('../lib/functions.php'); require("../lib/$config[general_lib_type]/functions.php"); if (is_file("../lib/sql/drivers/$config[sql_type]/functions.php")) include_once("../lib/sql/drivers/$config[sql_type]/functions.php"); else{ echo <<
Could not include SQL library functions. Aborting EOM; exit(); } $date = strftime('%A, %e %B %Y, %T %Z'); $sql_extra_query = ''; if ($config[sql_accounting_extra_query] != ''){ $sql_extra_query = xlat($config[sql_accounting_extra_query],$login,$config); $sql_extra_query = da_sql_escape_string($sql_extra_query); } $link = @da_sql_pconnect($config); $link2 = connect2db($config); $tot_in = $tot_rem = 0; if ($link){ $h = 21; $servers_num = 0; if ($config[general_ld_library_path] != '') putenv("LD_LIBRARY_PATH=$config[general_ld_library_path]"); foreach($nas_list as $nas){ $j = 0; $num = 0; if ($server != ''){ if ($nas[name] == $server) $servers_num++; else continue; } else $servers_num++; if ($nas[ip] == '') continue; $name_data = $nas[ip]; $community_data = $nas[community]; $server_name[$servers_num] = $nas[name]; $server_model[$servers_num] = $nas[model]; $extra = ""; $finger_type = $config[general_finger_type]; if ($nas[finger_type] != '') $finger_type = $nas[finger_type]; if ($finger_type == 'snmp'){ $nas_type = ($nas[type] != '') ? $nas[type] : $config[general_nas_type]; if ($nas_type == '') $nas_type = 'cisco'; $users=exec("$config[general_snmpfinger_bin] $name_data $community_data $nas_type"); if (strlen($users)){ $extra = "AND username IN ($users)"; if ($config[general_strip_realms] == 'yes'){ if ($config[general_realm_format] == 'prefix') $match = "'[^']+" . $config[general_realm_delimiter]; else $match = $config[general_realm_delimiter] . "[^']+'"; $extra = preg_replace("/$match/","'",$extra); } } } $search = @da_sql_query($link,$config, "SELECT COUNT(*) AS onlineusers FROM $config[sql_accounting_table] WHERE acctstoptime IS NULL AND nasipaddress = '$name_data' $extra $sql_extra_query;"); if ($search){ if (($row = @da_sql_fetch_array($search,$config))) $num = $row[onlineusers]; } $search = @da_sql_query($link,$config, "SELECT DISTINCT username,acctstarttime,framedipaddress,callingstationid FROM $config[sql_accounting_table] WHERE acctstoptime IS NULL AND nasipaddress = '$name_data' $extra $sql_extra_query GROUP BY username,acctstarttime,framedipaddress,callingstationid ORDER BY acctstarttime;"); if ($search){ $now = time(); while($row = @da_sql_fetch_array($search,$config)){ $j++; $h += 21; $user = $row['username']; $finger_info[$servers_num][$j]['ip'] = $row['framedipaddress']; if ($finger_info[$servers_num][$j]['ip'] == '') $finger_info[$servers_num][$j]['ip'] = '-'; $session_time = $row['acctstarttime']; $session_time = date2timediv($session_time,$now); $finger_info[$servers_num][$j]['session_time'] = time2strclock($session_time); $finger_info[$servers_num][$j]['user'] = $user; $finger_info[$servers_num][$j]['callerid'] = $row['callingstationid']; if ($finger_info[$servers_num][$j]['callerid'] == '') $finger_info[$servers_num][$j]['callerid'] = '-'; if ($user_info["$user"] == ''){ $user_info["$user"] = get_user_info($link2,$user,$config,$decode_normal,$k); if ($user_info["$user"] == '' || $user_info["$user"] == ' ') $user_info["$user"] = 'Unknown User'; } } $height[$servers_num] = $h; } $server_counting[$servers_num] = $j; $server_loggedin[$servers_num] = $num; $server_rem[$servers_num] = ($config[$portnum]) ? ($config[$portnum] - $num) : 'unknown'; $tot_in += $num; if (is_numeric($server_rem[$servers_num])) $tot_rem += $server_rem[$servers_num]; } } else echo "Could not connect to SQL database
\n"; if (isset($usage_summary)){ echo "Online: $tot_in Free: $tot_rem\n"; exit(); } ?>

Online Users 
$date EOM; for($j = 1; $j <= $servers_num; $j++){ echo <<
$server_name[$j]
$server_model[$j]
$server_loggedin[$j] users connected$server_rem[$j] $config[general_caption_finger_free_lines]
EOM; if ($acct_attrs['uf'][4] != '') echo "\n"; if ($acct_attrs['uf'][9] != '') echo "\n"; echo <<name EOM; for( $k = 1; $k <= $server_counting[$j]; $k++){ $user = $finger_info[$j][$k][user]; if ($user == '') $user = ' '; $User = urlencode($user); $time = $finger_info[$j][$k][session_time]; $ip = $finger_info[$j][$k][ip]; $cid = $finger_info[$j][$k][callerid]; $inf = $user_info[$user]; echo << EOM; if ($acct_attrs['uf'][4] != '') echo "\n"; if ($acct_attrs['uf'][9] != '') echo "\n"; echo <<$inf EOM; } echo << EOM; } ?>
#user" . $acct_attrs[uf][4] . "" . $acct_attrs[uf][9] . "duration
$k$user$ip$cid$time

freeradius-server/dialup_admin/htdocs/user_info.php000066400000000000000000000052731257552170400231460ustar00rootroot00000000000000 Personal information page


Personal information for  
EOM; ?>
Name (First Name Surname)
Mail
Department
Home Phone
Work Phone
Mobile Phone

freeradius-server/dialup_admin/htdocs/user_new.php000066400000000000000000000115461257552170400230040ustar00rootroot00000000000000 New user creation page

User Preferences for new user 
The username $login already exists in the user database EOM; } else{ if (is_file("../lib/$config[general_lib_type]/create_user.php")) include("../lib/$config[general_lib_type]/create_user.php"); require("../lib/defaults.php"); if (is_file("../lib/$config[general_lib_type]/user_info.php")) include("../lib/$config[general_lib_type]/user_info.php"); } } ?>
EOM; if ($config[general_lib_type] == 'sql'){ if (isset($member_groups)) $selected[$member_groups[0]] = 'selected'; echo << EOM; } if ($config[general_lib_type] == 'ldap' || ($config[general_lib_type] == 'sql' && $config[sql_use_user_info_table] == 'true')){ echo << EOM; } foreach($show_attrs as $key => $desc){ $name = $attrmap["$key"]; if ($name == 'none') continue; $oper_name = $name . '_op'; $val = ($item_vals["$key"][0] != "") ? $item_vals["$key"][0] : $default_vals["$key"][0]; print << EOM; if ($show_ops) print << EOM; print << EOM; } ?>
Username
Password
Group
Name (First Name Surname)
Mail
Department
Home Phone
Work Phone
Mobile Phone
$desc





freeradius-server/dialup_admin/htdocs/user_state.php000066400000000000000000000054151257552170400233310ustar00rootroot00000000000000 'TRUE','Dialup-Lock-Msg' => '-', 'Max-Weekly-Session' => 0,'Max-Daily-Session' => 0); foreach($vars as $key => $val){ $val = ($item_vals["$key"][0] != "") ? $item_vals["$key"][0] : $default_vals["$key"][0]; $vars["$key"]=$val; } $vars['Dialup-Access'] = ($vars['Dialup-Access'] == 'FALSE') ? 'inactive' : 'active'; $vars['Max-Daily-Session'] = time2strclock($vars['Max-Daily-Session']); $vars['Max-Weekly-Session'] = time2strclock($vars['Max-Weekly-Session']); $now = time(); $week = $now - date('w') * 86400; $now_str = date("$config[sql_date_format]",$now + 86400); $week_str = date("$config[sql_date_format]",$week); $today = date("$config[sql_date_format]",$now); $open_conns = $daily_conns = $weekly_conns = 0; $weekly_used = $daily_used = $online_time = time2strclock(0); $link = @da_sql_pconnect($config); if ($link){ $search = @da_sql_query($link,$config, "SELECT COUNT(*) AS counter, sum(acctsessiontime) AS sum_sess_time FROM $config[sql_accounting_table] WHERE username = '$login' AND acctstoptime >= '$week_str' AND acctstoptime <= '$now_str';"); if ($search){ if ($row = @da_sql_fetch_array($search,$config)){ $weekly_used = time2strclock($row[sum_sess_time]); $weekly_conns = $row[counter]; } } $search = @da_sql_query($link,$config, "SELECT COUNT(*) AS counter,sum(acctsessiontime) AS sum_sess_time FROM $config[sql_accounting_table] WHERE username = '$login' AND acctstoptime >= '$today 00:00:00' AND acctstoptime <= '$today 23:59:59';"); if ($search){ if ($row = @da_sql_fetch_array($search,$config)){ $daily_used = time2strclock($row[sum_sess_time]); $daily_conns = $row[counter]; } } $search = @da_sql_query($link,$config, "SELECT COUNT(*) AS counter, unix_timestamp() - unix_timestamp(acctstarttime) as diff FROM $config[sql_accounting_table] WHERE acctstoptime is null AND username = '$login' GROUP BY username;"); if ($search){ if ($row = @da_sql_fetch_array($search,$config)){ $open_conns = $row[counter]; $online_time = $row[diff]; $weekly_used += $online_time; $daily_used += $online_time; $daily_conns += $open_conns; $weekly_conns += $open_conns; $online_time = time2strclock($online_time); } } $weekly_used = time2strclock($weekly_used); $daily_used = time2strclock($daily_used); } foreach($vars as $val){ echo "$val\n"; } echo "$weekly_used\n$weekly_conns\n$daily_used\n$daily_conns\n$open_conns\n$online_time"; ?> freeradius-server/dialup_admin/htdocs/user_stats.php000066400000000000000000000147041257552170400233500ustar00rootroot00000000000000 User Statistics
Could not include SQL library functions. Aborting EOM; exit(); } if ($start == '' && $stop == ''){ $now = time(); $stop = date($config[sql_date_format],$now); $now -= 604800; $start = date($config[sql_date_format],$now); } $start = da_sql_escape_string($start); $stop = da_sql_escape_string($stop); $pagesize = ($pagesize) ? $pagesize : 10; if (!is_numeric($pagesize) && $pagesize != 'all') $pagezise = 10; if ($pagesize > 100) $pagesize = 100; $limit = ($pagesize == 'all') ? '100' : "$pagesize"; $selected[$pagesize] = 'selected'; $order = ($order) ? $order : $config[general_accounting_info_order]; if ($order != 'desc' && $order != 'asc') $order = 'desc'; if ($sortby != '') $order_attr = ($sortby == 'num') ? 'connnum' : 'conntotduration'; else $order_attr = 'connnum'; if ($server != '' && $server != 'all'){ $server = da_sql_escape_string($server); $server_str = "AND nasipaddress = '$server'"; } $login_str = ($login) ? "AND username = '$login' " : ''; $selected[$order] = 'selected'; $selected[$sortby] = 'selected'; $sql_extra_query = ''; if ($config[sql_accounting_extra_query] != ''){ $sql_extra_query = xlat($config[sql_accounting_extra_query],$login,$config); $sql_extra_query = da_sql_escape_string($sql_extra_query); } unset($da_name_cache); if (isset($_SESSION['da_name_cache'])) $da_name_cache = $_SESSION['da_name_cache']; ?> User Statistics

User Statistics 
$start up to $stop EOM; ?>

= '$start' AND acctdate <= '$stop' $server_str $login_str $sql_extra_query " . da_sql_limit($limit,1,$config) . " ORDER BY $order_attr $order " . da_sql_limit($limit,2,$config) . " ;"); if ($search){ while( $row = @da_sql_fetch_array($search,$config) ){ $num++; $acct_login = $row[username]; if ($acct_login == '') $acct_login = '-'; else{ $Acct_login = urlencode($acct_login); $acct_login = "$acct_login"; } $acct_time = $row[conntotduration]; $acct_time = time2str($acct_time); $acct_conn_num = $row[connnum]; $acct_date = $row[acctdate]; $acct_upload = $row[inputoctets]; $acct_download = $row[outputoctets]; $acct_upload = bytes2str($acct_upload); $acct_download = bytes2str($acct_download); $acct_server = $da_name_cache[$row[nasipaddress]]; if (!isset($acct_server)){ $acct_server = @gethostbyaddr($row[nasipaddress]); if (!isset($da_name_cache) && $config[general_use_session] == 'yes'){ $da_name_cache[$row[nasipaddress]] = $acct_server; session_register('da_name_cache'); } else $da_name_cache[$row[nasipaddress]] = $acct_server; } if ($acct_server == '') $acct_server = '-'; echo << EOM; } } } echo <<
#logindateserverconnections numberconnections durationuploaddownload
$num $acct_login $acct_date $acct_server $acct_conn_num $acct_time $acct_upload $acct_download

EOM; ?>
start timestop timepagesizesort byorder
On Access Server: User

freeradius-server/dialup_admin/htdocs/user_test.php000066400000000000000000000115361257552170400231710ustar00rootroot00000000000000 test user $login
EOM; if (!$test_login) include("../html/user_toolbar.html.php"); print <<
EOM; if ($test_login){ print <<Radius Server Test Page  EOM; }else{ print <<User $login Test Page  EOM; } ?>
' . $tmp_file; $fp = popen("$comm","w"); if ($fp){ foreach ($req as $val){ // Ignore comments if (preg_match('/^[[:space:]]*#/',$val) || preg_match('/^[[:space:]]*$/',$val)) continue; fwrite($fp,$val); } if ($test_login){ $test=1; fwrite($fp, "User-Name = \"$config[general_test_account_login]\"\n"); fwrite($fp, "User-Password = \"$config[general_test_account_password]\"\n"); pclose($fp); } else{ fwrite($fp, "User-Name = \"$login\"\n"); if ($auth_proto == 'chap') fwrite($fp, "CHAP-Password = \"$passwd\"\n"); else fwrite($fp, "User-Password = \"$passwd\"\n"); if (strlen($extra)) fwrite($fp,$extra); pclose($fp); } $reply = file($tmp_file); unlink($tmp_file); $msg = "" . strftime('%A, %e %B %Y, %T %Z') . "
\n"; $msg .= "Server: $server:$port

\n"; if (preg_match('/code 2/', $reply[0])) $msg .= "Authentication was successful"; else if (preg_match('/code 3/',$reply[0])) $msg .= "Authentication failed"; else if (preg_match('/no response from server/', $reply[0])) $msg .= "No response from server"; else if (preg_match('/Connection refused/',$reply[0])) $msg .= "Connection was refused"; if ($test_login) $msg .= " (test user $login)
\n"; else $msg .= "

\n"; array_shift($reply); if (count($reply)){ $msg .= "
Server response:
\n"; foreach ($reply as $val){ $msg .= "$val
\n"; } } if ($test_login){ print <<
EOM; exit(); } } } ?>
>
User Password
Radius Server
Radius Server Port
Extra Attributes
Authentication Protocol

$msg EOM; } ?>
freeradius-server/dialup_admin/html/000077500000000000000000000000001257552170400201155ustar00rootroot00000000000000freeradius-server/dialup_admin/html/buttons/000077500000000000000000000000001257552170400216135ustar00rootroot00000000000000freeradius-server/dialup_admin/html/buttons/default/000077500000000000000000000000001257552170400232375ustar00rootroot00000000000000freeradius-server/dialup_admin/html/buttons/default/buttons.html.php000066400000000000000000000126041257552170400264140ustar00rootroot00000000000000
\n"; ?>
Logged in as " . $_SERVER["PHP_AUTH_USER"] . "...

Main Menu
EOM; ?>
freeradius-server/dialup_admin/html/group_toolbar.html.php000066400000000000000000000011101257552170400244400ustar00rootroot00000000000000 ADMIN EDIT DELETE EOM; ?> freeradius-server/dialup_admin/html/stats.html.php000066400000000000000000000154101257552170400227300ustar00rootroot00000000000000
from date to date user on server  

  statistics period:
$after up to $before EOM; ?>

access statistics

statistics for all users EOM; else echo <<$login EOM; ?>

Daily Analysis 

$message[$column1] EOM; ?> EOM; } ?>
date $message[$column2] $message[$column3]
$day {$data[$day][1]} {$perc[$day][1]}
the $message[$column1] for $day is {$data[$day][1]}
{$data[$day][2]} {$perc[$day][2]}
the $message[$column3] for $day is {$data[$day][2]}
{$data[$day][3]} {$perc[$day][3]}
the $message[$column3] for $day is {$data[$day][3]}

Daily Summary 

$message[$column1] EOM; ?> EOM; ?>
  $message[$column2] $message[$column3]
maximum {$data[max][1]} {$data[max][2]} {$data[max][3]}
average {$data[avg][1]} {$data[avg][2]} {$data[avg][3]}
sum {$data[sum][1]} {$data[sum][2]} {$data[sum][3]}

freeradius-server/dialup_admin/html/user_admin.html.php000066400000000000000000000243671257552170400237330ustar00rootroot00000000000000user information for $cn EOM; if ($logged_now) print << EOM; print <<
EOM; include("../html/user_toolbar.html.php"); print <<
Connection Status for $login ($cn) 
EOM; if ($logged_now){ print << EOM; require('../html/user_admin_userinfo.html.php'); }else if ($not_known) print << EOM; else{ print << EOM; require('../html/user_admin_userinfo.html.php'); } print <<
User is online since $lastlog_time
Connection Duration
This user has never connected -
User is not online now
-
Last Connection Time $lastlog_time
Online Time $lastlog_session_time
Allowed Session $msg
Usefull User Description $descr
EOM; if (is_file("../lib/$config[general_lib_type]/password_check.php")) include("../lib/$config[general_lib_type]/password_check.php"); echo <<
Subscription Analysis 
-monthlyweeklydailyper session
limit$monthly_limit$weekly_limit$daily_limit$session_limit
used$monthly_used$weekly_used$daily_used$lastlog_session_time
daydaily limitused
sunday$daily_limit$used[0]
monday$daily_limit$used[1]
tuesday$daily_limit$used[2]
wednesday$daily_limit$used[3]
thursday$daily_limit$used[4]
friday$daily_limit$used[5]
saturday$daily_limit$used[6]

Account Status For The Last 7 Days 
Connections $tot_conns
Online time $tot_time
Failed Logins $tot_badlogins
Upload $tot_input
Download $tot_output
Average Time $avg_time
Average Upload $avg_input
Average Download $avg_output

EOM; if ($user_info){ echo <<
Personal Information
EOM; if ($config[general_prefered_lang] != 'en'){ echo << EOM; } echo << EOM; if ($config[general_prefered_lang] != 'en'){ echo << EOM; } echo << EOM; if ($config[general_prefered_lang] != 'en'){ echo << EOM; } echo << EOM; if ($config[general_prefered_lang] != 'en'){ echo << EOM; } echo << EOM; if ($config[general_prefered_lang] != 'en'){ echo << EOM; } echo <<
name $cn
name ($config[general_prefered_lang_name]) $cn_lang
department $ou
department ($config[general_prefered_lang_name]) $ou_lang
title $title
title ($config[general_prefered_lang_name]) $title_lang
address $address
address ($config[general_prefered_lang_name]) $address_lang
home address $homeaddress
home address ($config[general_prefered_lang_name]) $homeaddress_lang
phone $telephonenumber
home phone $homephone
mobile $mobile
fax $fax
home page $url
e-mail $mail
e-mail alias $mailalt
EOM; } ?> startcounter(); EOM; ?> freeradius-server/dialup_admin/html/user_admin_userinfo.html.php000066400000000000000000000010121257552170400256230ustar00rootroot00000000000000 Server $lastlog_server_name ($lastlog_server_ip) Server Port $lastlog_server_port Workstation $lastlog_callerid Upload $lastlog_input Download $lastlog_output EOM; ?> freeradius-server/dialup_admin/html/user_toolbar.html.php000066400000000000000000000030041257552170400242660ustar00rootroot00000000000000 SHOW EDIT USER INFO ACCOUNTING BADUSERS DELETE TEST OPEN SESSIONS EOM; ?> freeradius-server/dialup_admin/lib/000077500000000000000000000000001257552170400177175ustar00rootroot00000000000000freeradius-server/dialup_admin/lib/acctshow.php000066400000000000000000000012061257552170400222420ustar00rootroot00000000000000 freeradius-server/dialup_admin/lib/add_badusers.php000066400000000000000000000022521257552170400230510ustar00rootroot00000000000000Could not include SQL library
\n"; exit(); } $date=date($config[sql_full_date_format]); $lockmsg_name = $attrmap['Dialup-Lock-Msg'] . '0'; $msg = $$lockmsg_name; $admin = '-'; if ($_SERVER["PHP_AUTH_USER"] != '') $admin = $_SERVER["PHP_AUTH_USER"]; if ($msg == '') echo "Lock Message should not be empty
\n"; else{ $sql_servers = array(); if ($config[sql_extra_servers] != '') $sql_servers = explode(' ',$config[sql_extra_servers]); $sql_servers[] = $config[sql_server]; foreach ($sql_servers as $server){ $link = @da_sql_host_connect($server,$config); if ($link){ $r = da_sql_query($link,$config, "INSERT INTO $config[sql_badusers_table] (username,incidentdate,admin,reason) VALUES ('$login','$date','$admin','$msg');"); if (!$r) echo "SQL Error:" . da_sql_error($link,$config) . "
\n"; else echo "User added to badusers table
\n"; da_sql_close($link,$config); } else echo "SQL Error: Could not connect to SQL database: $server
\n"; } } ?> freeradius-server/dialup_admin/lib/attrshow.php000066400000000000000000000026461257552170400223130ustar00rootroot00000000000000 freeradius-server/dialup_admin/lib/crypt/000077500000000000000000000000001257552170400210605ustar00rootroot00000000000000freeradius-server/dialup_admin/lib/crypt/clear.php000066400000000000000000000001021257552170400226500ustar00rootroot00000000000000 freeradius-server/dialup_admin/lib/crypt/crypt.php000066400000000000000000000003071257552170400227320ustar00rootroot00000000000000 freeradius-server/dialup_admin/lib/crypt/md5.php000066400000000000000000000001071257552170400222540ustar00rootroot00000000000000 freeradius-server/dialup_admin/lib/defaults.php000066400000000000000000000015041257552170400222370ustar00rootroot00000000000000 freeradius-server/dialup_admin/lib/functions.php000066400000000000000000000047121257552170400224440ustar00rootroot00000000000000 536870912) $str = sprintf("%5.2f GBs", $bytes/1073741824); else if ($bytes > 524288) $str = sprintf("%5.2f MBs", $bytes/1048576); else $str = sprintf("%5.2f KBs", $bytes/1024); return $str; } function nothing($ret) { return $ret; } function check_defaults($val,$op,$def) { for($i=0;$i<$def[count];$i++){ if ($val == $def[$i] && ($op == '' || $op == $def[operator][$i])) return 1; } return 0; } function check_ip($ipaddr) { if(preg_match("/^([0-9]{1,3})\x2E([0-9]{1,3})\x2E([0-9]{1,3})\x2E([0-9]{1,3})$/", $ipaddr,$digit)) { if(($digit[1] <= 255) && ($digit[2] <= 255) && ($digit[3] <= 255) && ($digit[4] <= 255)) { return(1); } } return(0); } ?> freeradius-server/dialup_admin/lib/lang/000077500000000000000000000000001257552170400206405ustar00rootroot00000000000000freeradius-server/dialup_admin/lib/lang/default/000077500000000000000000000000001257552170400222645ustar00rootroot00000000000000freeradius-server/dialup_admin/lib/lang/default/utf8.php000066400000000000000000000001451257552170400236630ustar00rootroot00000000000000 freeradius-server/dialup_admin/lib/lang/el/000077500000000000000000000000001257552170400212405ustar00rootroot00000000000000freeradius-server/dialup_admin/lib/lang/el/utf8.php000066400000000000000000000073221257552170400226430ustar00rootroot00000000000000"€", "~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"=>"š", "~["=>"›", "~]"=>"Â" ); return $k; } function init_decoder() { $k = array( "€"=>"~@", "Â"=>"~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", "›"=>"~[", "Â"=>"~]" ); return $k; } function encode_string($line,$k) { for($i=0;$i freeradius-server/dialup_admin/lib/ldap/000077500000000000000000000000001257552170400206375ustar00rootroot00000000000000freeradius-server/dialup_admin/lib/ldap/attrmap.php000066400000000000000000000015421257552170400230220ustar00rootroot00000000000000 freeradius-server/dialup_admin/lib/ldap/change_attrs.php000066400000000000000000000044201257552170400240120ustar00rootroot00000000000000 $attr){ if ($attrmap["$key"] == 'none') continue; $i = 0; $j = -1; $name = $attrmap["$key"] . $i; while (isset($$name)){ $val = $$name; $i++; $j++; $name = $attrmap["$key"] . $i; // // if value is the same as the default and the corresponding attribute in ldap does not exist or // the value is the same as that in ldap then continue // if ( (check_defaults($val,'',$default_vals["$key"]) && !isset($item_vals["$key"][$j])) || $val == $item_vals["$key"][$j]) continue; // // if value is null and ldap attribute does not exist then continue // if ($val == '' && !isset($item_vals["$key"][$j])) continue; // // if values is the same as the default or if the value is null and the ldap attribute exists // then delete them // if ((check_defaults($val,'',$default_vals["$key"]) || $val == '') && isset($item_vals["$key"][$j])) $del[$attrmap["$key"]][] = $item_vals["$key"][$j]; // // else modify the ldap attribute // else{ if (isset($item_vals["$key"][$j])){ $del[$attrmap["$key"]][] = $item_vals["$key"][$j]; $add_r[$attrmap["$key"]][] = $val; } else{ $add_r[$attrmap["$key"]][] = $val; } } } } if (isset($del)){ if ($config[ldap_debug] == 'true'){ print "DEBUG(LDAP): ldap_mod_del(): DN='$dn'
\n"; print "DEBUG(LDAP): ldap_mod_del(): Data:"; print_r($del); print "
\n"; } @ldap_mod_del($ds,$dn,$del); } if (isset($add_r)){ if ($config[ldap_debug] == 'true'){ print "DEBUG(LDAP): ldap_mod_add(): DN='$dn'
\n"; print "DEBUG(LDAP): ldap_mod_add(): Data:"; print_r($add_r); print "
\n"; } @ldap_mod_add($ds,$dn,$add_r); } } if (@ldap_error($ds) == 'Success') echo "The changes were successfully commited to the directory
\n"; else echo "LDAP ERROR: " . ldap_error($ds) . "
\n"; @ldap_close($ds); } ?> freeradius-server/dialup_admin/lib/ldap/change_info.php000066400000000000000000000037121257552170400236130ustar00rootroot00000000000000DEBUG(LDAP): ldap_mod_replace(): DN='$dn'
\n"; print "DEBUG(LDAP): ldap_mod_replace(): Data:"; print_r($mod); print "
\n"; } @ldap_mod_replace($ds,$dn,$mod); if (@ldap_error($ds) != 'Success') echo "LDAP ERROR: " . ldap_error($ds) . "
\n"; else echo "User personal information updated successfully
\n"; } } @ldap_close($ds); } ?> freeradius-server/dialup_admin/lib/ldap/change_passwd.php000066400000000000000000000017451257552170400241650ustar00rootroot00000000000000DEBUG(LDAP): ldap_mod_replace(): DN='$dn'
\n"; print "DEBUG(LDAP): ldap_mod_replace(): Data:"; print_r($mod); print "
\n"; } @ldap_mod_replace($ds,$dn,$mod); if (@ldap_error($ds) != 'Success') echo "LDAP ERROR: " . ldap_error($ds) . "
\n"; } else echo "Could not open encryption library file.
\n"; } @ldap_close($ds); } ?> freeradius-server/dialup_admin/lib/ldap/create_user.php000066400000000000000000000051321257552170400236520ustar00rootroot00000000000000Could not open encryption library file.Password will be clear text.
\n"; $new_user_entry[$attrmap['User-Password']]="{clear}" . $passwd; } if ($config[ldap_debug] == 'true'){ print "DEBUG(LDAP): ldap_add(): DN='$dn'
\n"; print "DEBUG(LDAP): ldap_add(): Entry Data:"; print_r($new_user_entry); print "
\n"; } @ldap_add($ds,$dn,$new_user_entry); foreach($show_attrs as $key => $attr){ if ($attrmap["$key"] == 'none') continue; // // if value is the same as the default and the corresponding attribute in ldap does not exist or // the value is the same as that in ldap then continue // if ( check_defaults($$attrmap["$key"],'',$default_vals["$key"])) continue; if ( $$attrmap["$key"] == '') continue; unset($mod); $mod[$attrmap["$key"]] = $$attrmap["$key"]; if ($config[ldap_debug] == 'true'){ print "DEBUG(LDAP): ldap_mod_add(): DN='$dn'
\n"; print "DEBUG(LDAP): ldap_mod_add(): Data:"; print_r($mod); print "
\n"; } @ldap_mod_add($ds,$dn,$mod); } } if (@ldap_error($ds) == 'Success') echo "User was added in user database
\n"; else echo "LDAP ERROR: " . ldap_error($ds) . "
\n"; @ldap_close($ds); } ?> freeradius-server/dialup_admin/lib/ldap/defaults.php000066400000000000000000000050131257552170400231560ustar00rootroot00000000000000DEBUG(LDAP): Search Query: BASE='$config[ldap_default_dn]',FILTER='objectclass=*'
\n"; $sr=@ldap_search($ds,"$config[ldap_default_dn]", 'objectclass=*'); if ($info = @ldap_get_entries($ds, $sr)){ $dn = $info[0]['dn']; if ($dn != ''){ foreach($attrmap as $key => $val){ if ($info[0]["$val"][0] != '' && $key != 'Dialup-Access'){ if ($attrmap[generic]["$key"] == 'generic'){ for($i=0;$i<$info[0]["$val"][count];$i++) $default_vals["$key"][] = $info[0]["$val"][$i]; $default_vals["$key"][count] += $info[0]["$val"][count]; } else $default_vals["$key"] = $info[0]["$val"]; } } } } if ($regular_profile_attr != ''){ $get_attrs = array("$regular_profile_attr"); if ($config[ldap_filter] != '') $filter = xlat($config[ldap_filter],$login,$config); else $filter = 'uid=' . $login; if ($config[ldap_debug] == 'true') print "DEBUG(LDAP): Search Query: BASE='$config[ldap_base]',FILTER='$filter'
\n"; $sr=@ldap_search($ds,"$config[ldap_base]",$filter,$get_attrs); if ($info = @ldap_get_entries($ds,$sr)){ for($i=0;$i<$info[0][$regular_profile_attr]["count"];$i++){ $dn2 = $info[0][$regular_profile_attr][$i]; if ($dn2 != ''){ if ($config[ldap_debug] == 'true') print "DEBUG(LDAP): Search Query: BASE='$dn2',FILTER='objectclass=*'
\n"; $sr2=@ldap_search($ds,"$dn2",'objectclass=*'); if ($info2 = @ldap_get_entries($ds,$sr2)){ $dn3 = $info2[0]['dn']; if ($dn3 != ''){ foreach($attrmap as $key => $val){ if ($info2[0]["$val"][0] != '' && $key != 'Dialup-Access'){ if (!isset($default_vals["$key"])) $default_vals["$key"] = array(); if ($attrmap[generic]["$key"] == 'generic'){ for($j=0;$j<$info2[0]["$val"][count];$j++) $default_vals["$key"][] = $info2[0]["$val"][$j]; $default_vals["$key"][count] += $info2[0]["$val"][count]; } else $default_vals["$key"] = $info2[0]["$val"]; } } } } } } } } @ldap_close($ds); } } ?> freeradius-server/dialup_admin/lib/ldap/delete_user.php000066400000000000000000000010351257552170400236470ustar00rootroot00000000000000DEBUG(LDAP): Delete Request: DN='$dn'
\n"; @ldap_delete($ds,$dn); if (@ldap_error($ds) == 'Success') echo "User Deleted successfully
\n"; else echo "LDAP ERROR: " . ldap_error($ds) . "
\n"; @ldap_close($ds); } } ?> freeradius-server/dialup_admin/lib/ldap/find.php000066400000000000000000000015631257552170400222750ustar00rootroot00000000000000 500) $max = 10; $r=@da_ldap_bind($ds,$config); if ($search_IN == 'name' || $search_IN == 'ou') $attr = ($search_IN == 'name') ? 'cn' : 'ou'; else if ($search_IN == 'radius'){ require('../lib/ldap/attrmap.php'); $attr = $attrmap[$radius_attr]; } if ($config[ldap_debug] == 'true') print "DEBUG(LDAP): Search Query: BASE='$config[ldap_base]',FILTER='$attr=*$search*'
\n"; $sr=@ldap_search($ds,"$config[ldap_base]", "$attr=*$search*",array('uid'),0,$max); if (($info = @ldap_get_entries($ds, $sr))){ for ($i = 0; $i < $info["count"]; $i++) $found_users[] = $info[$i]['uid'][0]; } @ldap_close($ds); } else echo "Could not connect to the LDAP server
\n"; ?> freeradius-server/dialup_admin/lib/ldap/functions.php000066400000000000000000000072361257552170400233700ustar00rootroot00000000000000DEBUG(LDAP): Bind Request: DN='$din',PASSWD='$pass'
\n"; return @ldap_bind($ds,"$din","$pass"); } else{ // It's not a DN. Find a corresponding DN if ($config[ldap_debug] == 'true') print "DEBUG(LDAP): Bind Request: DN='$config[ldap_binddn]',PASSWD='$config[ldap_bindpw]'
\n"; $r=@ldap_bind($ds,"$config[ldap_binddn]",$config[ldap_bindpw]); if ($r){ $sr=@ldap_search($ds,"$config[ldap_base]", 'uid=' . $din); $info = @ldap_get_entries($ds, $sr); $din = $info[0]['dn']; if ($din != ''){ if ($config[ldap_debug] == 'true') print "DEBUG(LDAP): Bind Request: DN='$din',PASSWD='$pass'
\n"; return @ldap_bind($ds,"$din","$pass"); } } } } } function connect2db($config) { $ds=@ldap_connect("$config[ldap_server]"); // must be a valid ldap server! if ($ds) $r=@da_ldap_bind($ds,$config); return $ds; } function get_user_info($ds,$user,$config,$decode_normal,$k) { if ($ds){ $attrs = array('cn'); if ($config[ldap_userdn] == ''){ if ($config[ldap_filter] != '') $filter = xlat($config[ldap_filter],$login,$config); else $filter = 'uid=' . $login; } else $filter = xlat($config[ldap_userdn],$login,$config); if ($config[ldap_debug] == 'true'){ if ($config[ldap_userdn] == '') print "DEBUG(LDAP): Search Query: BASE='$config[ldap_base]',FILTER='$filter'
\n"; else print "DEBUG(LDAP): Search Query: BASE='$filter',FILTER='(objectclass=radiusprofile)'
\n"; } if ($config[ldap_userdn] == '') $sr=@ldap_search($ds,"$config[ldap_base]", $filter,$attrs); else $sr=@ldap_read($ds,$filter, '(objectclass=radiusprofile)',$attrs); $info = @ldap_get_entries($ds, $sr); $cn = $info[0]["cn"][0]; if ($cn != '' && $decode_normal == 1) $cn = decode_string($cn,$k); if ($cn == '') $cn = '-'; return $cn; } } function get_user_dn($ds,$user,$config) { if ($ds){ $attrs = array('dn'); if ($config[ldap_userdn] == ''){ if ($config[ldap_filter] != '') $filter = xlat($config[ldap_filter],$login,$config); else $filter = 'uid=' . $login; } else $filter = xlat($config[ldap_userdn],$login,$config); if ($config[ldap_debug] == 'true'){ if ($config[ldap_userdn] == '') print "DEBUG(LDAP): Search Query: BASE='$config[ldap_base]',FILTER='$filter'
\n"; else print "DEBUG(LDAP): Search Query: BASE='$filter',FILTER='(objectclass=radiusprofile)'
\n"; } if ($config[ldap_userdn] == '') $sr=@ldap_search($ds,"$config[ldap_base]", $filter,$attrs); else $sr=@ldap_read($ds,$filter, '(objectclass=radiusprofile)',$attrs); $entry = ldap_first_entry($ds, $sr); if ($entry) $dn = ldap_get_dn($ds,$entry); return $dn; } } function check_user_passwd($dn,$passwd,$config) { $ds=@ldap_connect("$config[ldap_server]"); if ($ds && $dn != '' && $passwd != ''){ $r = @ldap_bind($ds,$dn,$passwd); if ($r) return TRUE; else return FALSE; } else return FALSE; return FALSE; } function closedb($ds,$config) { if ($ds) @ldap_close($ds); } ?> freeradius-server/dialup_admin/lib/ldap/password_check.php000066400000000000000000000012001257552170400243400ustar00rootroot00000000000000YES It is that'; else $msg = 'NO It is wrong'; } else $msg = 'User DN is not available. Check your configuration'; @ldap_close($ds); } else $msg = 'Could not connect to LDAP server'; echo "$msg\n"; } ?> freeradius-server/dialup_admin/lib/ldap/personattrs.php000066400000000000000000000004641257552170400237400ustar00rootroot00000000000000 freeradius-server/dialup_admin/lib/ldap/user_info.php000066400000000000000000000075041257552170400233470ustar00rootroot00000000000000DEBUG(LDAP): Search Query: BASE='$config[ldap_base]',FILTER='$filter'
\n"; else print "DEBUG(LDAP): Search Query: BASE='$filter',FILTER='(objectclass=radiusprofile)'
\n"; } if ($config[ldap_userdn] == '') $sr=@ldap_search($ds,"$config[ldap_base]", $filter); else $sr=@ldap_read($ds,$filter, '(objectclass=radiusprofile)'); $info = @ldap_get_entries($ds, $sr); $dn = $info[0]['dn']; if ($dn == '') $user_exists = 'no'; else{ $user_exists = 'yes'; $user_info = 1; $k = init_decoder(); $cn = ($info[0]['cn'][0]) ? $info[0]['cn'][0] : '-'; if ($decode_normal) $cn = decode_string($cn,$k); $cn_lang = $info[0]["cn;lang-$config[general_prefered_lang]"][0]; $cn_lang = decode_string("$cn_lang", $k); $cn_lang = ($cn_lang) ? $cn_lang : '-'; $telephonenumber = ($info[0]['telephonenumber'][0]) ? $info[0]['telephonenumber'][0] : '-'; $homephone = ($info[0]['homephone'][0]) ? $info[0]['homephone'][0] : '-'; $address = ($info[0]['postaladdress'][0]) ? $info[0]['postaladdress'][0] : '-'; if ($decode_normal) $address = decode_string($address,$k); $address_lang = $info[0]["postaladdress;lang-$config[general_prefered_lang]"][0]; $address_lang = decode_string("$address_lang",$k); $address_lang = ($address_lang) ? $address_lang : '-'; $homeaddress = ($info[0]['homepostaladdress'][0]) ? $info[0]['homepostaladdress'][0] : '-'; $homeaddress_lang = $info[0]["homepostaladdress;lang-$config[general_prefered_lang]"][0]; $homeaddress_lang = decode_string("$homeaddress_lang", $k); $homeaddress_lang = ($homeaddress_lang) ? $homeaddress_lang : '-'; $mobile = ($info[0]['mobile'][0]) ? $info[0]['mobile'][0] : '-'; $fax = ($info[0]['facsimiletelephonenumber'][0]) ? $info[0]['facsimiletelephonenumber'][0] : '-'; $url = ($info[0]['labeleduri'][0]) ? $info[0]['labeleduri'][0] : '-'; $ou = $info[0]['ou'][0]; if ($decode_normal) $ou = decode_string($ou,$k); $ou_lang = $info[0]["ou;lang-$config[general_prefered_lang]"][0]; $ou_lang = decode_string("$ou_lang", $k); $ou_lang = ($ou_lang) ? $ou_lang : '-'; $mail = ($info[0]['mail'][0]) ? $info[0]['mail'][0] : '-'; $title = ($info[0]['title'][0]) ? $info[0]['title'][0] : '-'; if ($decode_normal) $title = decode_string($title,$k); $title_lang = $info[0]["title;lang-$config[general_prefered_lang]"][0]; $title_lang = decode_string("$title_lang", $k); $title_lang = ($title_lang) ? $title_lang : '-'; $mailalt = ($info[0]['mailalternateaddress'][0]) ? $info[0]['mailalternateaddress'][0] : '-'; $user_password_exists = ($info[0]['userpassword'][0] != '') ? 'yes' : 'no'; foreach($attrmap as $key => $val){ $item_vals["$key"] = $info[0]["$val"]; } } @ldap_close($ds); } else echo "Could not connect to the LDAP server
\n"; ?> freeradius-server/dialup_admin/lib/missing.php000066400000000000000000000004051257552170400221000ustar00rootroot00000000000000function array_change_key_case($input,$case) { $NEW_ARR = array(); foreach ($input as $val => $key){ if ($case == CASE_UPPER) $K = strtoupper($key); else if ($case == CASE_LOWER) $K = strtolower($key); $NEW_ARR[$K] = $val; } return $NEW_ARR; } freeradius-server/dialup_admin/lib/operators.php000066400000000000000000000012411257552170400224440ustar00rootroot00000000000000'; $op_ge = '>='; $op_lt = '<'; $op_le = '<='; $op_regeq = '=~'; $op_regne = '!~'; $op_exst = '=*'; $op_nexst = '!*'; // Check the operator if it is allowed for this type of // attribute (check or reply). // Arguments: // $op: The operator // $type: 1(check),2(reply) // Return value:0 for OK, -1 for error function check_operator($op,$type) { switch($op){ case '=': case ':=': case '+=': return 0; case '==': case '!=': case '>': case '>=': case '<': case '<=': case '=~': case '!~': case '=*': case '!*': return ($type == 1) ? 0 : -1; } } ?> freeradius-server/dialup_admin/lib/sql/000077500000000000000000000000001257552170400205165ustar00rootroot00000000000000freeradius-server/dialup_admin/lib/sql/attrmap.php000066400000000000000000000017271257552170400227060ustar00rootroot00000000000000 $desc){ if ($attrmap["$key"] == ''){ $attrmap["$key"] = $key; $attr_type["key"] = 'replyItem'; $rev_attrmap["$key"] = $key; } } } if ($config[general_use_session] == 'yes'){ session_register('attrmap'); session_register('rev_attrmap'); session_register('attr_type'); } } freeradius-server/dialup_admin/lib/sql/change_attrs.php000066400000000000000000000072021257552170400236720ustar00rootroot00000000000000Could not include SQL library
\n"; exit(); } if ($config[sql_use_operators] == 'true'){ $use_ops=1; $text1 = 'AND op ='; $text2 = ',op'; } $link = @da_sql_pconnect($config); if ($link){ foreach($show_attrs as $key => $desc){ if ($attrmap["$key"] == 'none') continue; if ($attrmap["$key"] == ''){ $attrmap["$key"] = $key; $attr_type["key"] = 'replyItem'; $rev_attrmap["$key"] = $key; } $i = 0; $j = -1; $name = $attrmap["$key"] . $i; while(isset($$name)){ $val=$$name; $val = da_sql_escape_string($val); $op_name = $name . '_op'; $i++; $j++; $name = $attrmap["$key"] . $i; $sql_attr=$attrmap["$key"]; $query_key = ($user_type == 'group') ? 'groupname' : 'username'; if ($attr_type["$key"] == 'checkItem'){ $table = ($user_type == 'group') ? $config[sql_groupcheck_table] : $config[sql_check_table]; $type = 1; } else if ($attr_type["$key"] == 'replyItem'){ $table = ($user_type == 'group') ? $config[sql_groupreply_table] : $config[sql_reply_table]; $type = 2; } if ($use_ops){ $op_val = $$op_name; if ($op_val != ''){ $op_val = da_sql_escape_string($op_val); if (check_operator($op_val,$type) == -1){ echo "Invalid operator ($op_val) for attribute $key
\n"; continue; } $op_val2 = ",'$op_val'"; } } $sql_attr = da_sql_escape_string($sql_attr); $val = da_sql_escape_string($val); // if we have operators, the operator has changed and the corresponding value exists then update if ($use_ops && isset($item_vals["$key"][operator][$j]) && $op_val != $item_vals["$key"][operator][$j] ){ $res = @da_sql_query($link,$config, "UPDATE $table SET op = '$op_val' WHERE $query_key = '$login' AND attribute = '$sql_attr' AND value = '$val';"); if (!$res || !@da_sql_affected_rows($link,$res,$config)) echo "Operator change failed for attribute $key: " . da_sql_error($link,$config) . "
\n"; } // if value is the same as that in the sql database do nothing if ($val == $item_vals["$key"][$j]) continue; // if value is null or equals the default value and corresponding value exists then delete else if ((check_defaults($val,$op_val,$default_vals["$key"]) || $val == '') && isset($item_vals["$key"][$j])){ $res = @da_sql_query($link,$config, "DELETE FROM $table WHERE $query_key = '$login' AND attribute = '$sql_attr';"); if (!$res || !@da_sql_affected_rows($link,$res,$config)) echo "Delete failed for attribute $key: " . da_sql_error($link,$config) . "
\n"; } // if value is null or equals the default value then don't add it else if ($val == '' || check_defaults($val,$op_val,$default_vals["$key"])) continue; // if value differs from the sql value then update else{ if (isset($item_vals["$key"][$j])){ $old_val = $item_vals["$key"][$j]; $old_val = da_sql_escape_string($old_val); $res = @da_sql_query($link,$config, "UPDATE $table SET value = '$val' WHERE $query_key = '$login' AND attribute = '$sql_attr' AND value = '$old_val';"); } else $res = @da_sql_query($link,$config, "INSERT INTO $table ($query_key,attribute,value $text2) VALUES ('$login','$sql_attr','$val' $op_val2);"); if (!$res || !@da_sql_affected_rows($link,$res,$config)) echo "Change failed for attribute $key: " . da_sql_error($link,$config) . "
\n"; } } } } else echo "Could not connect to SQL database
\n"; freeradius-server/dialup_admin/lib/sql/change_info.php000066400000000000000000000040521257552170400234700ustar00rootroot00000000000000Could not include SQL library
\n"; exit(); } $link = @da_sql_pconnect($config); $fail = 0; if ($link){ if ($config[sql_use_user_info_table] == 'true'){ $res = @da_sql_query($link,$config, "SELECT username FROM $config[sql_user_info_table] WHERE username = '$login';"); if ($res){ $Fcn = da_sql_escape_string($Fcn); $Fmail = da_sql_escape_string($Fmail); $Fou = da_sql_escape_string($Fou); $Ftelephonenumber = da_sql_escape_string($Ftelephonenumber); $Fhomephone = da_sql_escape_string($Fhomephone); $Fmobile = da_sql_escape_string($Fmobile); if (!@da_sql_num_rows($res,$config)){ $res = @da_sql_query($link,$config, "INSERT INTO $config[sql_user_info_table] (username,name,mail,department,homephone,workphone,mobile) VALUES ('$login','$Fcn','$Fmail','$Fou','$Ftelephonenumber','$Fhomephone','$Fmobile');"); if (!$res || !@da_sql_affected_rows($link,$res,$config)){ echo "Could not add user information in user info table: " . da_sql_error($link,$config) . "
\n"; $fail = 1; } } else{ $res = @da_sql_query($link,$config, "UPDATE $config[sql_user_info_table] SET name = '$Fcn',Mail = '$Fmail', department = '$Fou', homephone = '$Fhomephone', workphone = '$Ftelephonenumber', mobile = '$Fmobile' WHERE username = '$login';"); if (!$res || !@da_sql_affected_rows($link,$res,$config)){ echo "Could not update user information in user info table: " . da_sql_error($link,$config) . "
\n"; $fail = 1; } } } else{ echo "Could not find user in user info table: " . da_sql_error($link,$config) . "
\n"; $fail = 1; } if ($fail == 0) echo "User information updated successfully
\n"; } else echo "Cannot use the user info table. Check the sql_use_user_info_table directive in admin.conf
\n"; } else echo "Could not connect to SQL database
\n"; ?> freeradius-server/dialup_admin/lib/sql/change_passwd.php000066400000000000000000000034301257552170400240350ustar00rootroot00000000000000Could not include SQL library
\n"; exit(); } if ($config[sql_use_operators] == 'true'){ $text1 = ',op'; $text2 = ",':='"; $text3 = ", op = ':='"; } else{ $text1 = ''; $text2 = ''; $text3 = ''; } $link = @da_sql_pconnect($config); if ($link){ if (is_file("../lib/crypt/$config[general_encryption_method].php")){ include("../lib/crypt/$config[general_encryption_method].php"); $passwd = da_encrypt($passwd); $passwd = da_sql_escape_string($passwd); $res = @da_sql_query($link,$config, "SELECT value FROM $config[sql_check_table] WHERE username = '$login' AND attribute = '$config[sql_password_attribute]';"); if ($res){ $row = @da_sql_fetch_array($res,$config); if ($row){ $res = @da_sql_query($link,$config, "UPDATE $config[sql_check_table] SET value = '$passwd' $text3 WHERE attribute = '$config[sql_password_attribute]' AND username = '$login';"); if (!$res || !@da_sql_affected_rows($link,$res,$config)) echo "Error while changing password: " . da_sql_error($link,$config) . "
\n"; } else{ $res = @da_sql_query($link,$config, "INSERT INTO $config[sql_check_table] (attribute,value,username $text1) VALUES ('$config[sql_password_attribute]','$passwd','$login' $text2);"); if (!$res || !@da_sql_affected_rows($link,$res,$config)) echo "Error while changing password: " . da_sql_error($link,$config) . "
\n"; } } else echo "Error while executing query: " . da_sql_error($link,$config) . "
\n"; } else echo "Could not open encryption library file
\n"; } else echo "Could not connect to SQL database
\n"; ?> freeradius-server/dialup_admin/lib/sql/create_group.php000066400000000000000000000050531257552170400237110ustar00rootroot00000000000000Could not include SQL library
\n"; exit(); } if ($config[sql_use_operators] == 'true'){ include("../lib/operators.php"); $text = ',op'; $passwd_op = ",':='"; } $da_abort=0; $op_val2 = ''; $link = @da_sql_pconnect($config); if ($link){ $Members = preg_split("/[\n\s]+/",$members,-1,PREG_SPLIT_NO_EMPTY); if (!empty($Members)){ foreach ($Members as $member){ $member = da_sql_escape_string($member); $res = @da_sql_query($link,$config, "INSERT INTO $config[sql_usergroup_table] (username,groupname) VALUES ('$member','$login');"); if (!$res || !@da_sql_affected_rows($link,$res,$config)){ echo "Unable to add user $member in group $login: " . da_sql_error($link,$config) . "
\n"; $da_abort=1; } } } else { $res = @da_sql_query($link,$config, "INSERT INTO $config[sql_usergroup_table] (groupname) VALUES ('$login');"); if (!$res || !@da_sql_affected_rows($link,$res,$config)){ echo "Unable to create group $login: " . da_sql_error($link,$config) . "
\n"; $da_abort=1; } } if (!$da_abort){ foreach($show_attrs as $key => $attr){ if ($attrmap["$key"] == 'none') continue; if ($attrmap["$key"] == ''){ $attrmap["$key"] = $key; $attr_type["$key"] = 'replyItem'; $rev_attrmap["$key"] = $key; } if ($attr_type["$key"] == 'checkItem'){ $table = "$config[sql_groupcheck_table]"; $type = 1; } else if ($attr_type["$key"] == 'replyItem'){ $table = "$config[sql_groupreply_table]"; $type = 2; } $val = $$attrmap["$key"]; $val = da_sql_escape_string($val); $op_name = $attrmap["$key"] . '_op'; $op_val = $$op_name; if ($op_val != ''){ $op_val = da_sql_escape_string($op_val); if (check_operator($op_val,$type) == -1){ echo "Invalid operator ($op_val) for attribute $key
\n"; coninue; } $op_val2 = ",'$op_val'"; } if ($val == '' || check_defaults($val,$op_val,$default_vals["$key"])) continue; $res = @da_sql_query($link,$config, "INSERT INTO $table (attribute,value,groupname $text) VALUES ('$attrmap[$key]','$val','$login' $op_val2);"); if (!$res || !@da_sql_affected_rows($link,$res,$config)) echo "Query failed for attribute $key: " . da_sql_error($link,$config) . "
\n"; } echo "Group created successfully
\n"; } } else echo "Could not connect to SQL database
\n"; ?> freeradius-server/dialup_admin/lib/sql/create_user.php000066400000000000000000000105251257552170400235330ustar00rootroot00000000000000Could not include SQL library
\n"; exit(); } include_once('../lib/functions.php'); if ($config[sql_use_operators] == 'true'){ include("../lib/operators.php"); $text = ',op'; $passwd_op = ",':='"; } $da_abort=0; $op_val2 = ''; $link = @da_sql_pconnect($config); if ($link){ if (is_file("../lib/crypt/$config[general_encryption_method].php")){ include("../lib/crypt/$config[general_encryption_method].php"); $passwd = da_encrypt($passwd); $passwd = da_sql_escape_string($passwd); $res = @da_sql_query($link,$config, "INSERT INTO $config[sql_check_table] (attribute,value,username $text) VALUES ('$config[sql_password_attribute]','$passwd','$login' $passwd_op);"); if (!$res || !@da_sql_affected_rows($link,$res,$config)){ echo "Unable to add user $login: " . da_sql_error($link,$config) . "
\n"; $da_abort=1; } if ($config[sql_use_user_info_table] == 'true' && !$da_abort){ $res = @da_sql_query($link,$config, "SELECT username FROM $config[sql_user_info_table] WHERE username = '$login';"); if ($res){ if (!@da_sql_num_rows($res,$config)){ $Fcn = da_sql_escape_string($Fcn); $Fmail = da_sql_escape_string($Fmail); $Fou = da_sql_escape_string($Fou); $Fhomephone = da_sql_escape_string($Fhomephone); $Fworkphone = da_sql_escape_string($Fworkphone); $Fmobile = da_sql_escape_string($Fmobile); $res = @da_sql_query($link,$config, "INSERT INTO $config[sql_user_info_table] (username,name,mail,department,homephone,workphone,mobile) VALUES ('$login','$Fcn','$Fmail','$Fou','$Fhomephone','$Ftelephonenumber','$Fmobile');"); if (!$res || !@da_sql_affected_rows($link,$res,$config)) echo "Could not add user information in user info table: " . da_sql_error($link,$config) . "
\n"; } else echo "User already exists in user info table.
\n"; } else echo "Could not add user information in user info table: " . da_sql_error($link,$config) . "
\n"; } if ($Fgroup != ''){ $Fgroup = da_sql_escape_string($Fgroup); $res = @da_sql_query($link,$config, "SELECT username FROM $config[sql_usergroup_table] WHERE username = '$login' AND groupname = '$Fgroup';"); if ($res){ if (!@da_sql_num_rows($res,$config)){ $res = @da_sql_query($link,$config, "INSERT INTO $config[sql_usergroup_table] (username,groupname) VALUES ('$login','$Fgroup');"); if (!$res || !@da_sql_affected_rows($link,$res,$config)) echo "Could not add user to group $Fgroup. SQL Error
\n"; } else echo "User already is a member of group $Fgroup
\n"; } else echo "Could not add user to group $Fgroup: " . da_sql_error($link,$config) . "
\n"; } if (!$da_abort){ if ($Fgroup != '') require('../lib/defaults.php'); foreach($show_attrs as $key => $attr){ if ($attrmap["$key"] == 'none') continue; if ($attrmap["$key"] == ''){ $attrmap["$key"] = $key; $attr_type["$key"] = 'replyItem'; $rev_attrmap["$key"] = $key; } if ($attr_type["$key"] == 'checkItem'){ $table = "$config[sql_check_table]"; $type = 1; } else if ($attr_type["$key"] == 'replyItem'){ $table = "$config[sql_reply_table]"; $type = 2; } $val = $$attrmap["$key"]; $val = da_sql_escape_string($val); $op_name = $attrmap["$key"] . '_op'; $op_val = $$op_name; if ($op_val != ''){ $op_val = da_sql_escape_string($op_val); if (check_operator($op_val,$type) == -1){ echo "Invalid operator ($op_val) for attribute $key
\n"; coninue; } $op_val2 = ",'$op_val'"; } if ($val == '' || check_defaults($val,$op_val,$default_vals["$key"])) continue; $res = @da_sql_query($link,$config, "INSERT INTO $table (attribute,value,username $text) VALUES ('$attrmap[$key]','$val','$login' $op_val2);"); if (!$res || !@da_sql_affected_rows($link,$res,$config)) echo "Query failed for attribute $key: " . da_sql_error($link,$config) . "
\n"; } } echo "User created successfully
\n"; } else echo "Could not open encryption library file
\n"; } else echo "Could not connect to SQL database
\n"; ?> freeradius-server/dialup_admin/lib/sql/defaults.php000066400000000000000000000073751257552170400230520ustar00rootroot00000000000000Could not include SQL library
\n"; exit(); } if ($config[sql_use_operators] == 'true'){ $op = ',op'; $use_op = 1; }else{ $op = ""; $use_op = 0; } $overwrite_defaults = 1; $stop = 0; $times = 0; do{ unset($item_vals); unset($member_groups); unset($tmp); $times++; $link = @da_sql_pconnect($config); if ($link){ $res = @da_sql_query($link,$config, "SELECT groupname FROM $config[sql_usergroup_table] WHERE username = '$login';"); if ($res){ while(($row = @da_sql_fetch_array($res,$config))){ $group = $row[groupname]; $member_groups[$group] = $group; } if (isset($member_groups)) ksort($member_groups); } if (isset($member_groups)){ $in = '('; foreach ($member_groups as $group) $in .= "'$group',"; $in = substr($in,0,-1); $in .= ')'; $res = @da_sql_query($link,$config, "SELECT attribute,value $op FROM $config[sql_groupcheck_table] WHERE groupname IN $in;"); if ($res){ while(($row = @da_sql_fetch_array($res,$config))){ $attr = $row[attribute]; $val = $row[value]; if ($use_op){ $oper = $row[op]; $tmp["$attr"][operator][]="$oper"; } $tmp["$attr"][]="$val"; $tmp["$attr"][count]++; } $res = @da_sql_query($link,$config, "SELECT attribute,value $op FROM $config[sql_groupreply_table] WHERE groupname IN $in;"); if ($res){ while(($row = @da_sql_fetch_array($res,$config))){ $attr = $row[attribute]; $val = $row[value]; if ($use_op){ $oper = $row[op]; $tmp["$attr"][operator][]="$oper"; } $tmp["$attr"][] = "$val"; $tmp["$attr"][count]++; } } else echo "Database query failed partially: " . da_sql_error($link,$config) . "
\n"; } else echo "Database query failed: " . da_sql_error($link,$config) . "
\n"; if (isset($tmp)){ foreach(array_keys($tmp) as $val){ if ($val == '') continue; $key = $rev_attrmap["$val"]; if ($key == ''){ $key = $val; $attrmap["$key"] = $val; $attr_type["$key"] = 'replyItem'; $rev_attrmap["$val"] = $key; } if (!isset($default_vals["$key"]) || $overwrite_defaults){ if ($use_op) $default_vals["$key"][operator] = $tmp["$val"][operator]; if ($tmp[$val][0] != '') $default_vals["$key"] = $tmp["$val"]; } } } } if ($times == 1){ if ($config[sql_default_user_profile] == '') $stop = 1; else{ $saved_login = $login; $saved_member_groups = $member_groups; $login = $config[sql_default_user_profile]; $overwrite_defaults = 0; } } if ($times == 2){ $login = $saved_login; $member_groups = $saved_member_groups; $stop = 1; } } else echo "Could not connect to SQL database
\n"; }while($stop == 0); } else{ if (is_file("../lib/sql/drivers/$config[sql_type]/functions.php")) include_once("../lib/sql/drivers/$config[sql_type]/functions.php"); else{ echo "Could not include SQL library
\n"; exit(); } unset($member_groups); $link = @da_sql_pconnect($config); if ($link){ $res = @da_sql_query($link,$config, "SELECT DISTINCT groupname FROM $config[sql_usergroup_table];"); if ($res){ while(($row = @da_sql_fetch_array($res,$config))) $member_groups[] = $row[groupname]; } else echo "Database query failed: " . da_sql_error($link,$config) . "
\n"; } else echo "Could not connect to SQL database
\n"; } ?> freeradius-server/dialup_admin/lib/sql/delete_group.php000066400000000000000000000021531257552170400237060ustar00rootroot00000000000000Could not include SQL library
\n"; exit(); } $link = @da_sql_pconnect($config); if ($link){ $res = @da_sql_query($link,$config, "DELETE FROM $config[sql_groupreply_table] WHERE groupname = '$login';"); if ($res){ $res = @da_sql_query($link,$config, "DELETE FROM $config[sql_groupcheck_table] WHERE groupname = '$login';"); if ($res){ $res = @da_sql_query($link,$config, "DELETE FROM $config[sql_usergroup_table] WHERE groupname = '$login';"); if ($res) echo "Group $login deleted successfully
\n"; else echo "Error deleting group $login from usergroup table: " . da_sql_error($link,$config) . "
\n"; } else echo "Error deleting group $login from group check table: " . da_sql_error($link,$config) . "
\n"; } else echo "Error deleting group $login from group reply table: " . da_sql_error($link,$config) . "
\n"; } else echo "Could not connect to SQL database
\n"; ?> freeradius-server/dialup_admin/lib/sql/delete_user.php000066400000000000000000000025701257552170400235330ustar00rootroot00000000000000Could not include SQL library
\n"; exit(); } $link = @da_sql_pconnect($config); if ($link){ $res = @da_sql_query($link,$config, "DELETE FROM $config[sql_reply_table] WHERE username = '$login';"); if ($res){ $res = @da_sql_query($link,$config, "DELETE FROM $config[sql_check_table] WHERE username = '$login';"); if ($res){ $res = @da_sql_query($link,$config, "DELETE FROM $config[sql_usergroup_table] WHERE username = '$login';"); if (!$res) echo "Error deleting user $login from user group table: " . da_sql_error($link,$config) . "
\n"; if ($config[sql_use_user_info_table] == 'true'){ $res = @da_sql_query($link,$config, "DELETE FROM $config[sql_user_info_table] WHERE username = '$login';"); if ($res) echo "User $login deleted successfully
\n"; else echo "Error deleting user $login from user info table: " . da_sql_error($link,$config) . "
\n"; } } else echo "Error deleting user $login from check table: " . da_sql_error($link,$config) . "
\n"; } else echo "Error deleting user $login from reply table: " . da_sql_error($link,$config) . "
\n"; } else echo "Could not connect to SQL database
\n"; ?> freeradius-server/dialup_admin/lib/sql/drivers/000077500000000000000000000000001257552170400221745ustar00rootroot00000000000000freeradius-server/dialup_admin/lib/sql/drivers/dbx/000077500000000000000000000000001257552170400227515ustar00rootroot00000000000000freeradius-server/dialup_admin/lib/sql/drivers/dbx/functions.php000066400000000000000000000070751257552170400255030ustar00rootroot00000000000000DEBUG(SQL,PG DRIVER): Query: $query
\n"; } return @dbx_query($link,$query); } function da_sql_num_rows($result,$config) { if ($config[sql_debug] == 'true') print "DEBUG(SQL,PG DRIVER): Query Result: Num rows:: " . $result->rows . "
\n"; return $result->rows; } $dbx_global_record_counter = array() ; function da_sql_fetch_array($result,$config) { global $dbx_global_record_counter; if (!$dbx_global_record_counter[$result->handle]){ $dbx_global_record_counter[$result->handle] = 0; } if ($dbx_global_record_counter[$result->handle] <= $result->rows - 1 ){ return $result->data[$dbx_global_record_counter[$result->handle]++]; } elseif ($dbx_global_record_counter[$result->handle] > $result->rows - 1 ) { $dbx_global_record_counter[$result->handle]++; return NULL; } else { $dbx_global_record_counter[$result->handle]++; return FALSE; } } function da_sql_affected_rows($link,$result,$config) { // FIXME: This function is still Postgres specific. if ($config[sql_debug] == 'true') print "DEBUG(SQL,PG DRIVER): Query Result: Affected rows:: " . @pg_cmdtuples($result->handle) . "
\n"; return @pg_cmdtuples($result->handle); } function da_sql_list_fields($table,$link,$config) { $res = @dbx_query($link,"SELECT * FROM ".$table." LIMIT 1 ;"); if ($res){ $fields[num] = $res->cols; } $res = @dbx_query($link,"SELECT * FROM ".$table." LIMIT 1 ;"); if ($res) $fields[res] = $res->info[name]; else return NULL; return $fields; } function da_sql_num_fields($fields,$config) { if ($fields) return $fields[num]; } function da_sql_field_name($fields,$num,$config) { if ($fields) return $fields[res][$num]; } function da_sql_error($link,$config) { return dbx_error($link); } ?> freeradius-server/dialup_admin/lib/sql/drivers/mysql/000077500000000000000000000000001257552170400233415ustar00rootroot00000000000000freeradius-server/dialup_admin/lib/sql/drivers/mysql/functions.php000066400000000000000000000067301257552170400260700ustar00rootroot00000000000000DEBUG(SQL,MYSQL DRIVER): Connect: User=$SQL_user,Password=$SQL_passwd
\n"; return @mysql_connect("$server:$config[sql_port]",$SQL_user,$SQL_passwd); } function da_sql_connect($config) { if ($config[sql_use_http_credentials] == 'yes'){ global $HTTP_SERVER_VARS; $SQL_user = $HTTP_SERVER_VARS["PHP_AUTH_USER"]; $SQL_passwd = $HTTP_SERVER_VARS["PHP_AUTH_PW"]; } else{ $SQL_user = $config[sql_username]; $SQL_passwd = $config[sql_password]; } if ($config[sql_connect_timeout] != 0) @ini_set('mysql.connect_timeout',$config[sql_connect_timeout]); if ($config[sql_debug] == 'true') print "DEBUG(SQL,MYSQL DRIVER): Connect: User=$SQL_user,Password=$SQL_passwd
\n"; return @mysql_connect("$config[sql_server]:$config[sql_port]",$SQL_user,$SQL_passwd); } function da_sql_pconnect($config) { if ($config[sql_use_http_credentials] == 'yes'){ global $HTTP_SERVER_VARS; $SQL_user = $HTTP_SERVER_VARS["PHP_AUTH_USER"]; $SQL_passwd = $HTTP_SERVER_VARS["PHP_AUTH_PW"]; } else{ $SQL_user = $config[sql_username]; $SQL_passwd = $config[sql_password]; } if ($config[sql_connect_timeout] != 0) @ini_set('mysql.connect_timeout',$config[sql_connect_timeout]); if ($config[sql_debug] == 'true') print "DEBUG(SQL,MYSQL DRIVER): Connect: User=$SQL_user,Password=$SQL_passwd
\n"; return @mysql_pconnect("$config[sql_server]:$config[sql_port]",$SQL_user,$SQL_passwd); } function da_sql_close($link,$config) { return @mysql_close($link); } function da_sql_escape_string($string) { return @mysql_escape_string($string); } function da_sql_query($link,$config,$query) { if ($config[sql_debug] == 'true') print "DEBUG(SQL,MYSQL DRIVER): Query: $query
\n"; return @mysql_db_query($config[sql_database],$query,$link); } function da_sql_num_rows($result,$config) { if ($config[sql_debug] == 'true') print "DEBUG(SQL,MYSQL DRIVER): Query Result: Num rows:: " . @mysql_num_rows($result) . "
\n"; return @mysql_num_rows($result); } function da_sql_fetch_array($result,$config) { $row = array_change_key_case(@mysql_fetch_array($result, MYSQL_ASSOC),CASE_LOWER); if ($config[sql_debug] == 'true'){ print "DEBUG(SQL,MYSQL DRIVER): Query Result:
";
		print_r($row);
		print "
\n"; } return $row; } function da_sql_affected_rows($link,$result,$config) { if ($config[sql_debug] == 'true') print "DEBUG(SQL,MYSQL DRIVER): Query Result: Affected rows:: " . @mysql_affected_rows($result) . "
\n"; return @mysql_affected_rows($link); } function da_sql_list_fields($table,$link,$config) { return @mysql_list_fields($config[sql_database],$table); } function da_sql_num_fields($fields,$config) { return @mysql_num_fields($fields); } function da_sql_field_name($fields,$num,$config) { return @mysql_field_name($fields,$num); } function da_sql_error($link,$config) { return @mysql_error($link); } ?> freeradius-server/dialup_admin/lib/sql/drivers/oracle/000077500000000000000000000000001257552170400234415ustar00rootroot00000000000000freeradius-server/dialup_admin/lib/sql/drivers/oracle/functions.php000066400000000000000000000074761257552170400262000ustar00rootroot00000000000000DEBUG(SQL,OCI DRIVER): Query: $trimmed_query
\n"; } $statement = OCIParse($link,$trimmed_query); OCIExecute($statement); return $statement; } function da_sql_num_rows($statement,$config) { // Unfortunately we need to fetch the statement as ocirowcount doesn't work on SELECTs $rows = OCIFetchStatement($statement,$res); if ($config[sql_debug] == 'true'){ print "DEBUG(SQL,OCI DRIVER): Query Result: Num rows:: " . $rows . "
\n"; } // Unfortunately we need to re-execute because the statement cursor is reset after OCIFetchStatement :-( OCIExecute($statement); return $rows; } function da_sql_fetch_array($statement,$config) { OCIFetchInto($statement, $temprow, OCI_ASSOC); $row = array_change_key_case($temprow, CASE_LOWER); if ($config[sql_debug] == 'true') { print "DEBUG(SQL,OCI DRIVER): Query Result:
";
                print_r($row);
                print "
\n"; } return $row; } function da_sql_affected_rows($link,$statement,$config) { if ($config[sql_debug] == 'true') print "DEBUG(SQL,OCI DRIVER): Query Result: Affected rows:: " . @ocirowcount($statement) . "
\n"; return @ocirowcount($statement); } function da_sql_list_fields($table,$link,$config) { $res = @da_sql_query($link,$config,"SELECT * from $table WHERE ROWNUM <=1"); if ($res){ $fields[res]=Array(); for ($i = 1;$i<=ocinumcols($res);$i++) { array_push($fields[res],strtolower(OCIColumnName($res,$i))); } $fields[num]=@ocinumcols($res); }else{ return NULL; } return $fields; } function da_sql_num_fields($fields,$config) { return $fields[num]; } function da_sql_field_name($fields,$num,$config) { return $fields[res][$num]; } function da_sql_error($link,$config) { return ocierror($link); } ?> freeradius-server/dialup_admin/lib/sql/drivers/pg/000077500000000000000000000000001257552170400226025ustar00rootroot00000000000000freeradius-server/dialup_admin/lib/sql/drivers/pg/functions.php000066400000000000000000000074211257552170400253270ustar00rootroot00000000000000DEBUG(SQL,PG DRIVER): Connect: User=$SQL_user,Password=$SQL_passwd
\n"; return @pg_connect("host=$server port=$config[sql_port] dbname=$config[sql_database] user=$SQL_user password=$SQL_passwd"); } function da_sql_connect($config) { if ($config[sql_use_http_credentials] == 'yes'){ global $HTTP_SERVER_VARS; $SQL_user = $HTTP_SERVER_VARS["PHP_AUTH_USER"]; $SQL_passwd = $HTTP_SERVER_VARS["PHP_AUTH_PW"]; } else{ $SQL_user = $config[sql_username]; $SQL_passwd = $config[sql_password]; } if ($config[sql_debug] == 'true') print "DEBUG(SQL,PG DRIVER): Connect: User=$SQL_user,Password=$SQL_passwd
\n"; return @pg_connect("host=$config[sql_server] port=$config[sql_port] dbname=$config[sql_database] user=$SQL_user password=$SQL_passwd"); } function da_sql_pconnect($config) { if ($config[sql_use_http_credentials] == 'yes'){ global $HTTP_SERVER_VARS; $SQL_user = $HTTP_SERVER_VARS["PHP_AUTH_USER"]; $SQL_passwd = $HTTP_SERVER_VARS["PHP_AUTH_PW"]; } else{ $SQL_user = $config[sql_username]; $SQL_passwd = $config[sql_password]; } if ($config[sql_debug] == 'true') print "DEBUG(SQL,PG DRIVER): Connect: User=$SQL_user,Password=$SQL_passwd
\n"; return @pg_pconnect("host=$config[sql_server] port=$config[sql_port] dbname=$config[sql_database] user=$SQL_user password=$SQL_passwd"); } function da_sql_close($link,$config) { @pg_close($link); } function da_sql_escape_string($string) { return addslashes($string); } function da_sql_query($link,$config,$query) { if ($config[sql_debug] == 'true') print "DEBUG(SQL,PG DRIVER): Query: $query
\n"; return @pg_query($link,$query); } function da_sql_num_rows($result,$config) { if ($config[sql_debug] == 'true') print "DEBUG(SQL,PG DRIVER): Query Result: Num rows:: " . @pg_numrows($result) . "
\n"; return @pg_numrows($result); } function da_sql_fetch_array($result,$config) { $row = @pg_fetch_array($result,$config[tmp_pg_array_num][$result]++,PGSQL_ASSOC); if ($row && $config[sql_debug] == 'true'){ print "DEBUG(SQL,PG DRIVER): Query Result:
";
		print_r($row);
		print  "
\n"; } if (!$row) $config[tmp_pg_array_num][$result] = 0; return $row; } function da_sql_affected_rows($link,$result,$config) { if ($config[sql_debug] == 'true') print "DEBUG(SQL,PG DRIVER): Query Result: Affected rows:: " . @pg_cmdtuples($result) . "
\n"; return @pg_cmdtuples($result); } function da_sql_list_fields($table,$link,$config) { $res = @pg_query($link, "select count(*) from pg_attribute where attnum > '0' and attrelid = (select oid from pg_class where relname='$table');"); if ($res){ $row = @pg_fetch_row($res,0); if ($row){ if (!$row[0]) return NULL; $fields[num] = $row[0]; } } $res = @pg_query($link, "select attname from pg_attribute where attnum > '0' and attrelid = (select oid from pg_class where relname='$table');"); if ($res) $fields[res]=$res; else return NULL; return $fields; } function da_sql_num_fields($fields,$config) { if ($fields) return $fields[num]; } function da_sql_field_name($fields,$num,$config) { if ($fields){ $row = @pg_fetch_row($fields[res],$num); if ($row) return $row[0]; } } function da_sql_error($link,$config) { return pg_errormessage($link); } ?> freeradius-server/dialup_admin/lib/sql/drivers/sqlrelay/000077500000000000000000000000001257552170400240305ustar00rootroot00000000000000freeradius-server/dialup_admin/lib/sql/drivers/sqlrelay/functions.php000066400000000000000000000107031257552170400265520ustar00rootroot00000000000000DEBUG(SQL,SQLRELAY DRIVER): Connect: User=$SQL_user,Password=$SQL_passwd
\n"; $link[con] = @sqlrcon_alloc($server,$port,'',$SQL_user,$SQL_passwd,$retrytime,1); if ($link[con]){ $link[cur] = @sqlrcur_alloc($link[con]); if ($link[cur]) return $link; else return 0; } else return 0; } function da_sql_connect($config) { $retrytime = 0; if ($config[sql_use_http_credentials] == 'yes'){ global $HTTP_SERVER_VARS; $SQL_user = $HTTP_SERVER_VARS["PHP_AUTH_USER"]; $SQL_passwd = $HTTP_SERVER_VARS["PHP_AUTH_PW"]; } else{ $SQL_user = $config[sql_username]; $SQL_passwd = $config[sql_password]; } if ($config[sql_connect_timeout] != 0) $retrytime = $config[sql_connect_timeout]; if ($config[sql_debug] == 'true') print "DEBUG(SQL,SQLRELAY DRIVER): Connect: User=$SQL_user,Password=$SQL_passwd
\n"; $link[con] = @sqlrcon_alloc($config[sql_server],$config[sql_port],'',$SQL_user,$SQL_passwd,$retrytime,1); if ($link[con]){ $link[cur] = @sqlrcur_alloc($link[con]); if ($link[cur]) return $link; else return 0; } else return 0; } function da_sql_pconnect($config) { $retrytime = 0; if ($config[sql_use_http_credentials] == 'yes'){ global $HTTP_SERVER_VARS; $SQL_user = $HTTP_SERVER_VARS["PHP_AUTH_USER"]; $SQL_passwd = $HTTP_SERVER_VARS["PHP_AUTH_PW"]; } else{ $SQL_user = $config[sql_username]; $SQL_passwd = $config[sql_password]; } if ($config[sql_connect_timeout] != 0) $retrytime = $config[sql_connect_timeout]; if ($config[sql_debug] == 'true') print "DEBUG(SQL,SQLRELAY DRIVER): Connect: Host=$config[sql_server],Port=$config[sql_port],User=$SQL_user,Password=$SQL_passwd
\n"; $link[con] = sqlrcon_alloc($config[sql_server],$config[sql_port],'',$SQL_user,$SQL_passwd,$retrytime,1); if ($link[con]){ sqlrcon_debugOn($link[con]); $link[cur] = sqlrcur_alloc($link[con]); if ($link[cur]){ sqlrcur_setResultSetBufferSize($link[cur], 4); sqlrcur_lowerCaseColumnNames($link[cur]); return $link; } else return false; } else{ return false; } } function da_sql_close($link,$config) { if (sqlrcur_free($link[cur])) return sqlrcon_free($link[con]); else return 0; } function da_sql_escape_string($string) { return addslashes($string); } function da_sql_query($link,$config,$query) { if ($config[sql_debug] == 'true') print "DEBUG(SQL,SQLRELAY DRIVER): Query: $query
\n"; if (sqlrcur_sendQuery($link[cur],$query)){ sqlrcon_endSession($link[con]); $link[count] = sqlrcur_rowCount($link[cur]); return $link; } else{ return false; } } function da_sql_num_rows($result,$config) { if ($config[sql_debug] == 'true') print "DEBUG(SQL,SQLRELAY DRIVER): Query Result: Num rows:: " . @sqlrcur_rowCount($result[cur]) . "
\n"; return sqlrcur_rowCount($result[cur]); return 0; } function da_sql_fetch_array($result,$config) { static $counter = 0; if ($counter < $result[count]){ $row = sqlrcur_getRowAssoc($result[cur],$counter); $counter++; } else{ $counter = 0; return false; } if ($config[sql_debug] == 'true'){ print "DEBUG(SQL,SQLRELAY DRIVER): Query Result:
";
	}
	return $row;
}

function da_sql_affected_rows($link,$result,$config)
{
	if ($config[sql_debug] == 'true')
		print "DEBUG(SQL,SQLRELAY DRIVER): Query Result: Affected rows:: " . @sqlrcur_affectedRows($result[cur]) . "
\n"; return sqlrcur_affectedRows($result[cur]); } function da_sql_list_fields($table,$link,$config) { if (sqlrcur_sendQuery($link[cur],"SELECT * FROM $table WHERE 1 = 0;")){ sqlrcon_endSession($link[con]); return $link[cur]; } else return false; } function da_sql_num_fields($fields,$config) { return sqlrcur_colCount($fields); } function da_sql_field_name($fields,$num,$config) { return sqlrcur_getColumnName($fields,$num); } function da_sql_error($link,$config) { return sqlrcur_errorMessage($link[cur]); } ?> freeradius-server/dialup_admin/lib/sql/find.php000066400000000000000000000035321257552170400221520ustar00rootroot00000000000000Could not include SQL library

\n"; exit(); } unset($found_users); $link = @da_sql_pconnect($config); if ($link){ $search = da_sql_escape_string($search); if (!is_numeric($max)) $max = 10; if ($max > 500) $max = 10; if (($search_IN == 'name' || $search_IN == 'department' || $search_IN == 'username') && $config[sql_use_user_info_table] == 'true'){ $res = @da_sql_query($link,$config, "SELECT " . da_sql_limit($max,0,$config) . " username FROM $config[sql_user_info_table] WHERE lower($search_IN) LIKE '%$search%' " . da_sql_limit($max,1,$config) . " " . da_sql_limit($max,2,$config) . " ;"); if ($res){ while(($row = @da_sql_fetch_array($res,$config))) $found_users[] = $row[username]; } else "Database query failed: " . da_sql_error($link,$config) . "
\n"; } else if ($search_IN == 'radius' && $radius_attr != ''){ require("../lib/sql/attrmap.php"); if ($attrmap["$radius_attr"] == ''){ $attrmap["$radius_attr"] = $radius_attr; $attr_type["$radius_attr"] = 'replyItem'; } $table = ($attr_type[$radius_attr] == 'checkItem') ? $config[sql_check_table] : $config[sql_reply_table]; $attr = $attrmap[$radius_attr]; $attr = da_sql_escape_string($attr); $res = @da_sql_query($link,$config, "SELECT " . da_sql_limit($max,0,$config) . " username FROM $table WHERE attribute = '$attr' AND value LIKE '%$search%' " . da_sql_limit($max,1,$config) . " " . da_sql_limit($max,2,$config) . " ;"); if ($res){ while(($row = @da_sql_fetch_array($res,$config))) $found_users[] = $row[username]; } else "Database query failed: " . da_sql_error($link,$config) . "
\n"; } } else echo "Could not connect to SQL database
\n"; ?> freeradius-server/dialup_admin/lib/sql/functions.php000066400000000000000000000013451257552170400232420ustar00rootroot00000000000000Could not include SQL library
\n"; exit(); } require_once('../lib/xlat.php'); function connect2db($config) { $link=@da_sql_pconnect($config); return $link; } function get_user_info($link,$user,$config) { if ($link && $config[sql_use_user_info_table] == 'true'){ $user = da_sql_escape_string($user); $res=@da_sql_query($link,$config, "SELECT name FROM $config[sql_user_info_table] WHERE username = '$user';"); if ($res){ $row = @da_sql_fetch_array($res,$config); if ($row) return $row[name]; } } } function closedb($link,$config) { return 1; } ?> freeradius-server/dialup_admin/lib/sql/group_admin.php000066400000000000000000000031161257552170400235340ustar00rootroot00000000000000Could not include SQL library
\n"; exit(); } $link = @da_sql_pconnect($config); if ($link){ if (isset($del_members)){ foreach ($del_members as $del){ $del = da_sql_escape_string($del); $res = @da_sql_query($link,$config, "DELETE FROM $config[sql_usergroup_table] WHERE username = '$del' AND groupname = '$login';"); if (!$res) echo "Could not delete user $del from group: " . da_sql_error($link,$config) . "
\n"; } } if ($new_members != ''){ $Members = preg_split("/[\n\s]+/",$new_members,-1,PREG_SPLIT_NO_EMPTY); if (!empty($Members)){ foreach ($Members as $new_member){ $new_member = da_sql_escape_string($new_member); $res = @da_sql_query($link,$config, "SELECT username FROM $config[sql_usergroup_table] WHERE username = '$new_member' AND groupname = '$login';"); if ($res){ if (@da_sql_num_rows($res,$config)) echo "User $new_member already is a member of the group
\n"; else{ $res = @da_sql_query($link,$config, "INSERT INTO $config[sql_usergroup_table] (groupname,username) VALUES ('$login','$new_member');"); if (!$res) echo "Error while adding user $new_member to group: " . da_sql_error($link,$config) . "
\n"; } } else echo "Could not add new member $new_member: " . da_sql_error($link,$config) . "
\n"; } } } } else echo "Could not connect to SQL database
\n"; ?> freeradius-server/dialup_admin/lib/sql/group_change.php000066400000000000000000000025441257552170400236750ustar00rootroot00000000000000Could not include SQL library
\n"; exit(); } $link = @da_sql_pconnect($config); if ($link){ if (isset($member_groups) && isset($edited_groups)){ $del_groups = array_diff($member_groups,$edited_groups); if (isset($del_groups)){ foreach ($del_groups as $del){ $del = da_sql_escape_string($del); $res = @da_sql_query($link,$config, "DELETE FROM $config[sql_usergroup_table] WHERE username = '$login' AND groupname = '$del';"); if (!$res) echo "Could not delete user $login from group $del: " . da_sql_error($link,$config) . "
\n"; else echo "User $login deleted from group $del
\n"; } } $new_groups = array_diff($edited_groups,$member_groups); if (isset($new_groups)){ foreach($new_groups as $new){ $new = da_sql_escape_string($new); $res = @da_sql_query($link,$config, "INSERT INTO $config[sql_usergroup_table] (groupname,username) VALUES ('$new','$login');"); if (!$res) echo "Error while adding user $login to group $login: " . da_sql_error($link,$config) . "
\n"; else echo "User $login added to group $new
\n"; } } } } else echo "Could not connect to SQL database
\n"; ?> freeradius-server/dialup_admin/lib/sql/group_info.php000066400000000000000000000061171257552170400234030ustar00rootroot00000000000000Could not include SQL library
\n"; exit(); } if ($config[sql_use_operators] == 'true'){ $op = ',op'; $use_op = 1; }else{ $op = ""; $use_op = 0; } $group_exists = 'no'; $link = @da_sql_pconnect($config); if ($link){ if ($login == ''){ unset($existing_groups); $res = @da_sql_query($link,$config, "SELECT COUNT(*) as counter,groupname FROM $config[sql_usergroup_table] GROUP BY groupname;"); if ($res){ while(($row = @da_sql_fetch_array($res,$config))){ $name = $row[groupname]; $existing_groups["$name"] = $row[counter]; } if (isset($existing_groups)) ksort($existing_groups); } else echo "Database query failed: " . da_sql_error($link,$config) . "
\n"; } else{ unset($item_vals); unset($tmp); unset($group_members); unset($existing_groups); $res = @da_sql_query($link,$config, "SELECT attribute,value $op FROM $config[sql_groupcheck_table] WHERE groupname = '$login';"); if ($res){ if (@da_sql_num_rows($res,$config)) $group_exists = 'yes'; while(($row = @da_sql_fetch_array($res,$config))){ $attr = $row[attribute]; $val = $row[value]; if ($use_op){ $oper = $row[op]; $tmp["$attr"][operator][]="$oper"; } $tmp["$attr"][]="$val"; $tmp["$attr"][count]++; } $res = @da_sql_query($link,$config, "SELECT attribute,value $op FROM $config[sql_groupreply_table] WHERE groupname = '$login';"); if ($res){ if (@da_sql_num_rows($res,$config)) $group_exists = 'yes'; while(($row = @da_sql_fetch_array($res,$config))){ $attr = $row[attribute]; $val = $row[value]; if ($use_op){ $oper = $row[op]; $tmp["$attr"][operator][]="$oper"; } $tmp["$attr"][] = "$val"; $tmp["$attr"][count]++; } } else echo "Database query failed partially: " . da_sql_error($link,$config) . "
\n"; $res = @da_sql_query($link,$config, "SELECT username FROM $config[sql_usergroup_table] WHERE groupname = '$login' ORDER BY username;"); if ($res){ if (@da_sql_num_rows($res,$config)) $group_exists = 'yes'; while(($row = @da_sql_fetch_array($res,$config))){ $member = $row[username]; $group_members[] = "$member"; } } else echo "Database query failed partially: " . da_sql_error($link,$config) . "
\n"; if (isset($tmp)){ foreach(array_keys($tmp) as $val){ if ($val == '') continue; $key = $rev_attrmap["$val"]; if ($key == ''){ $key = $val; $attrmap["$key"] = $val; $attr_type["$key"] = 'replyItem'; $rev_attrmap["$val"] = $key; } $item_vals["$key"] = $tmp[$val]; $item_vals["$key"][count] = $tmp[$val][count]; if ($use_op) $item_vals["$key"][operator] = $tmp[$val][operator]; } } } else echo "Database query failed: " . da_sql_error($link,$config) . "
\n"; } } else echo "Could not connect to SQL database
\n"; ?> freeradius-server/dialup_admin/lib/sql/nas_list.php000066400000000000000000000042031257552170400230420ustar00rootroot00000000000000Could not include SQL library
\n"; exit(); } $link = @da_sql_pconnect($config); if ($link){ $auth_user = $_SERVER["PHP_AUTH_USER"]; $extra = ''; if (isset($mappings[$auth_user][nasdb])){ $NAS_ARR = array(); $NAS_ARR = preg_split('/,/',$mappings[$auth_user][nasdb]); $extra = 'WHERE nasname IN ('; foreach ($NAS_ARR as $nas) $extra .= "'$nasname',"; unset($NAS_ARR); $extra = rtrim($extra,","); $extra .= ')'; } $search = @da_sql_query($link,$config, "SELECT * FROM $config[sql_nas_table] $extra;"); if ($search){ while($row = @da_sql_fetch_array($search,$config)){ $num = 0; $my_nas_name = $row['nasname']; if ($my_nas_name != ''){ $nas_list[$my_nas_name]['name'] = $my_nas_name; $nas_server = $da_name_cache[$my_nas_name]; if (!isset($nas_server)){ if (!check_ip($my_nas_name)) $nas_server = @gethostbyname($my_nas_name); else $nas_server = $my_nas_name; if (!isset($da_name_cache) && $config[general_use_session] == 'yes'){ $da_name_cache[$my_nas_name] = $nas_server; session_register('da_name_cache'); } } if ($nas_server != $my_nas_name || check_ip($nas_server)) $nas_list[$my_nas_name]['ip'] = $nas_server; $nas_list[$my_nas_name]['port_num'] = $row['ports']; $nas_list[$my_nas_name]['community'] = $row['community']; $nas_list[$my_nas_name]['model'] = $row['description']; } } } } else echo "Could not connect to SQL database
\n"; } ?> freeradius-server/dialup_admin/lib/sql/password_check.php000066400000000000000000000020751257552170400242320ustar00rootroot00000000000000Could not include SQL library
\n"; exit(); } if ($action == 'checkpass'){ $link = @da_sql_pconnect($config); if ($link){ $res = @da_sql_query($link,$config, "SELECT attribute,value FROM $config[sql_check_table] WHERE username = '$login' AND attribute = '$config[sql_password_attribute]';"); if ($res){ $row = @da_sql_fetch_array($res,$config); if (is_file("../lib/crypt/$config[general_encryption_method].php")){ include("../lib/crypt/$config[general_encryption_method].php"); $enc_passwd = $row[value]; $passwd = da_encrypt($passwd,$enc_passwd); if ($passwd == $enc_passwd) $msg = 'YES It is that'; else $msg = 'NO It is wrong'; } else echo "Could not open encryption library file
\n"; } } echo "$msg\n"; } ?> freeradius-server/dialup_admin/lib/sql/user_info.php000066400000000000000000000063511257552170400232250ustar00rootroot00000000000000Could not include SQL library
\n"; exit(); } if ($config[sql_use_operators] == 'true'){ $op = ',op'; $use_op = 1; }else{ $op = ""; $use_op = 0; } $user_exists = 'no'; $cn = '-'; $cn_lang = '-'; $address = '-'; $address_lang = '-'; $homeaddress = '-'; $homeaddress_lang = '-'; $fax = '-'; $url = '-'; $ou = '-'; $ou_lang = '-'; $title = '-'; $title_lang = '-'; $telephonenumber = '-'; $homephone = '-'; $mobile = '-'; $mail = '-'; $mailalt = '-'; $user_password_exists = 'no'; unset($item_vals); unset($tmp); $link = @da_sql_pconnect($config); if ($link){ $res = @da_sql_query($link,$config, "SELECT attribute,value $op FROM $config[sql_check_table] WHERE username = '$login';"); if ($res){ if (@da_sql_num_rows($res,$config)) $user_exists = 'yes'; while(($row = @da_sql_fetch_array($res,$config))){ $attr = $row[attribute]; $val = $row[value]; if ($attr == $config[sql_password_attribute] && $val != '') $user_password_exists = 'yes'; if ($use_op){ $oper = $row[op]; $tmp["$attr"][operator][]="$oper"; } $tmp["$attr"][]="$val"; $tmp["$attr"][count]++; } $res = @da_sql_query($link,$config, "SELECT attribute,value $op FROM $config[sql_reply_table] WHERE username = '$login';"); if ($res){ if (@da_sql_num_rows($res,$config)) $user_exists = 'yes'; while(($row = @da_sql_fetch_array($res,$config))){ $attr = $row[attribute]; $val = $row[value]; if ($use_op){ $oper = $row[op]; $tmp["$attr"][operator][]="$oper"; } $tmp["$attr"][] = "$val"; $tmp["$attr"][count]++; } if ($config[sql_use_user_info_table] == 'true'){ $res = @da_sql_query($link,$config, "SELECT * FROM $config[sql_user_info_table] WHERE username = '$login';"); if ($res){ if (@da_sql_num_rows($res,$config)){ $user_exists = 'yes'; $user_info = 1; } if (($row = @da_sql_fetch_array($res,$config))){ $cn = ($row[name] != '') ? $row[name] : '-'; $telephonenumber = ($row[workphone] != '') ? $row[workphone] : '-'; $homephone = ($row[homephone] != '') ? $row[homephone] : '-'; $ou = ($row[department] != '') ? $row[department] : '-'; $mail = ($row[mail] != '') ? $row[mail] : '-'; $mobile = ($row[mobile] != '') ? $row[mobile] : '-'; } } else echo "Database query failed partially: " . da_sql_error($link,$config) . "
\n"; } } else echo "Database query failed partially: " . da_sql_error($link,$config) . "
\n"; if (isset($tmp)){ foreach(array_keys($tmp) as $val){ if ($val == '') continue; $key = $rev_attrmap["$val"]; if ($key == ''){ $key = $val; $attrmap["$key"] = $val; $attr_type["$key"] = 'replyItem'; $rev_attrmap["$val"] = $key; } $item_vals["$key"] = $tmp[$val]; $item_vals["$key"][count] = $tmp[$val][count]; if ($use_op) $item_vals["$key"][operator] = $tmp[$val][operator]; } } } else echo "Database query failed: " . da_sql_error($link,$config) . "
\n"; } else echo "Could not connect to SQL database
\n"; ?> freeradius-server/dialup_admin/lib/xlat.php000066400000000000000000000010171257552170400213770ustar00rootroot00000000000000 freeradius-server/dialup_admin/sql/000077500000000000000000000000001257552170400177505ustar00rootroot00000000000000freeradius-server/dialup_admin/sql/mysql/000077500000000000000000000000001257552170400211155ustar00rootroot00000000000000freeradius-server/dialup_admin/sql/mysql/badusers.sql000066400000000000000000000005151257552170400234470ustar00rootroot00000000000000# # Table structure for table 'badusers' # CREATE TABLE badusers ( id int(10) NOT NULL auto_increment, UserName varchar(30), IncidentDate datetime DEFAULT '0000-00-00 00:00:00' NOT NULL, Reason varchar(200), Admin varchar(30) DEFAULT '-', PRIMARY KEY (id), KEY UserName (UserName), KEY IncidentDate (IncidentDate) ); freeradius-server/dialup_admin/sql/mysql/mtotacct.sql000066400000000000000000000011361257552170400234550ustar00rootroot00000000000000CREATE TABLE mtotacct ( MTotAcctId bigint(21) NOT NULL auto_increment, UserName varchar(64) NOT NULL default '', AcctDate date NOT NULL default '0000-00-00', ConnNum bigint(12) default NULL, ConnTotDuration bigint(12) default NULL, ConnMaxDuration bigint(12) default NULL, ConnMinDuration bigint(12) default NULL, InputOctets bigint(12) default NULL, OutputOctets bigint(12) default NULL, NASIPAddress varchar(15) default NULL, PRIMARY KEY (MTotAcctId), KEY UserName (UserName), KEY AcctDate (AcctDate), KEY UserOnDate (UserName,AcctDate), KEY NASIPAddress (NASIPAddress) ); freeradius-server/dialup_admin/sql/mysql/totacct.sql000066400000000000000000000012151257552170400232760ustar00rootroot00000000000000CREATE TABLE totacct ( TotAcctId bigint(21) NOT NULL auto_increment, UserName varchar(64) NOT NULL default '', AcctDate date NOT NULL default '0000-00-00', ConnNum bigint(12) default NULL, ConnTotDuration bigint(12) default NULL, ConnMaxDuration bigint(12) default NULL, ConnMinDuration bigint(12) default NULL, InputOctets bigint(12) default NULL, OutputOctets bigint(12) default NULL, NASIPAddress varchar(15) default NULL, PRIMARY KEY (TotAcctId), KEY UserName (UserName), KEY AcctDate (AcctDate), KEY UserOnDate (UserName,AcctDate), KEY NASIPAddress (NASIPAddress), KEY NASIPAddressOnDate (AcctDate,NASIPAddress) ); freeradius-server/dialup_admin/sql/mysql/userinfo.sql000066400000000000000000000005551257552170400234750ustar00rootroot00000000000000# # Table structure for table 'userinfo' # CREATE TABLE userinfo ( id int(10) DEFAULT '0' NOT NULL auto_increment, UserName varchar(30), Name varchar(200), Mail varchar(200), Department varchar(200), WorkPhone varchar(200), HomePhone varchar(200), Mobile varchar(200), PRIMARY KEY (id), KEY UserName (UserName), KEY Department (Department) ); freeradius-server/dialup_admin/sql/oracle/000077500000000000000000000000001257552170400212155ustar00rootroot00000000000000freeradius-server/dialup_admin/sql/oracle/badusers.sql000066400000000000000000000015311257552170400235460ustar00rootroot00000000000000/* * $Id$ * */ /* * Table structure for table 'radcheck' */ CREATE TABLE badusers ( id INT PRIMARY KEY, username VARCHAR(30) DEFAULT '' NOT NULL, incidentdate TIMESTAMP WITH TIME ZONE DEFAULT sysdate NOT NULL, reason VARCHAR(128) DEFAULT '' NOT NULL, admin VARCHAR(128) DEFAULT '-' NOT NULL ); CREATE SEQUENCE badusers_seq START WITH 1 INCREMENT BY 1; CREATE INDEX badusers_incidentdate_idx ON badusers (incidentdate); CREATE INDEX badusers_username_idx ON badusers (username); /* Trigger to emulate a serial # on the primary key */ CREATE OR REPLACE TRIGGER badusers_serialnumber BEFORE INSERT OR UPDATE OF id ON badusers FOR EACH ROW BEGIN if ( :new.id = 0 or :new.id is null ) then SELECT badusers_seq.nextval into :new.id from dual; end if; END; / freeradius-server/dialup_admin/sql/oracle/mtotacct.sql000066400000000000000000000021441257552170400235550ustar00rootroot00000000000000/* * $Id$ * */ /* * Table structure for table 'mtotacct' */ CREATE TABLE mtotacct ( mtotacctid INT PRIMARY KEY, username varchar(64) DEFAULT '' NOT NULL, acctdate DATE DEFAULT sysdate NOT NULL, connnum NUMERIC(12), conntotduration NUMERIC(12), connmaxduration NUMERIC(12), connminduration NUMERIC(12), inputoctets NUMERIC(12), outputoctets NUMERIC(12), nasipaddress varchar(15) default NULL ); CREATE INDEX mtotacct_acctdate_idx ON mtotacct (acctdate); CREATE INDEX mtotacct_nasipaddress_idx ON mtotacct (nasipaddress); CREATE INDEX mtotacct_username_idx ON mtotacct (username); CREATE INDEX mtotacct_userondate_idx ON mtotacct (username, acctdate); CREATE SEQUENCE mtotacct_seq START WITH 1 INCREMENT BY 1; /* Trigger to emulate a serial # on the primary key */ CREATE OR REPLACE TRIGGER mtotacct_serialnumber BEFORE INSERT OR UPDATE OF mtotacctid ON mtotacct FOR EACH ROW BEGIN if ( :new.mtotacctid = 0 or :new.mtotacctid is null ) then SELECT mtotacct_seq.nextval into :new.mtotacctid from dual; end if; END; / freeradius-server/dialup_admin/sql/oracle/totacct.sql000066400000000000000000000023751257552170400234060ustar00rootroot00000000000000/* * $Id$ * */ /* * Table structure for table 'totacct' */ CREATE TABLE totacct ( totacctid INT PRIMARY KEY, username varchar(64) DEFAULT '' NOT NULL, acctdate DATE DEFAULT sysdate NOT NULL, connnum NUMERIC(12), conntotduration NUMERIC(12), connmaxduration NUMERIC(12), connminduration NUMERIC(12), inputoctets NUMERIC(12), outputoctets NUMERIC(12), nasipaddress varchar(15) default NULL ); CREATE INDEX totacct_acctdate_idx ON totacct (acctdate); CREATE INDEX totacct_nasipaddress_idx ON totacct (nasipaddress); CREATE INDEX totacct_nasondate_idx ON totacct (acctdate, nasipaddress); CREATE INDEX totacct_username_idx ON totacct (username); CREATE INDEX totacct_userondate_idx ON totacct (username, acctdate); CREATE SEQUENCE totacct_seq START WITH 1 INCREMENT BY 1; /* Trigger to emulate a serial # on the primary key */ CREATE OR REPLACE TRIGGER totacct_serialnumber BEFORE INSERT OR UPDATE OF totacctid ON totacct FOR EACH ROW BEGIN if ( :new.totacctid = 0 or :new.totacctid is null ) then SELECT totacct_seq.nextval into :new.totacctid from dual; end if; END; / freeradius-server/dialup_admin/sql/oracle/userinfo.sql000066400000000000000000000017051257552170400235730ustar00rootroot00000000000000/* * $Id$ * */ /* * Table structure for table 'userinfo' */ CREATE TABLE userinfo ( id INT PRIMARY KEY, username VARCHAR(128) DEFAULT '' NOT NULL, name VARCHAR(128) DEFAULT '' NOT NULL, mail VARCHAR(128) DEFAULT '' NOT NULL, department VARCHAR(128) DEFAULT '' NOT NULL, workphone VARCHAR(128) DEFAULT '' NOT NULL, homephone VARCHAR(128) DEFAULT '' NOT NULL, mobile VARCHAR(128) DEFAULT '' NOT NULL ); CREATE INDEX userinfo_department_idx ON userinfo (department); CREATE INDEX userinfo_username_idx ON userinfo (username); CREATE SEQUENCE userinfo_seq START WITH 1 INCREMENT BY 1; /* Trigger to emulate a serial # on the primary key */ CREATE OR REPLACE TRIGGER userinfo_serialnumber BEFORE INSERT OR UPDATE OF id ON userinfo FOR EACH ROW BEGIN if ( :new.id = 0 or :new.id is null ) then SELECT userinfo_seq.nextval into :new.id from dual; end if; END; / freeradius-server/dialup_admin/sql/postgresql/000077500000000000000000000000001257552170400221535ustar00rootroot00000000000000freeradius-server/dialup_admin/sql/postgresql/badusers.sql000066400000000000000000000006521257552170400245070ustar00rootroot00000000000000SET search_path = public, pg_catalog; --Table structure for table 'badusers' -- CREATE TABLE badusers ( id BIGSERIAL PRIMARY KEY, username TEXT NOT NULL, incidentdate timestamp with time zone DEFAULT 'now' NOT NULL, reason TEXT, admin TEXT DEFAULT '-' ); CREATE INDEX badusers_incidentdate_idx ON badusers USING btree (incidentdate); CREATE INDEX badusers_username_idx ON badusers USING btree (username); freeradius-server/dialup_admin/sql/postgresql/mtotacct.sql000066400000000000000000000013061257552170400245120ustar00rootroot00000000000000SET search_path = public, pg_catalog; -- -- Table structure for table 'mtotacct' -- CREATE TABLE mtotacct ( mtotacctid BIGSERIAL PRIMARY KEY, username TEXT DEFAULT '' NOT NULL, acctdate DATE DEFAULT 'now' NOT NULL, connnum BIGINT, conntotduration BIGINT, connmaxduration BIGINT, connminduration BIGINT, inputoctets BIGINT, outputoctets BIGINT, nasipaddress INET ); CREATE INDEX mtotacct_acctdate_idx ON mtotacct USING btree (acctdate); CREATE INDEX mtotacct_nasipaddress_idx ON mtotacct USING btree (nasipaddress); CREATE INDEX mtotacct_username_idx ON mtotacct USING btree (username); CREATE INDEX mtotacct_userondate_idx ON mtotacct USING btree (username, acctdate); freeradius-server/dialup_admin/sql/postgresql/totacct.sql000066400000000000000000000014171257552170400243400ustar00rootroot00000000000000SET search_path = public, pg_catalog; -- -- Table structure for table 'totacct' -- CREATE TABLE totacct ( totacctid bigSERIAL PRIMARY KEY, username TEXT DEFAULT '' NOT NULL, acctdate DATE DEFAULT 'now' NOT NULL, connnum BIGINT, conntotduration BIGINT, connmaxduration BIGINT, connminduration BIGINT, inputoctets BIGINT, outputoctets BIGINT, nasipaddress INET ); CREATE INDEX totacct_acctdate_idx ON totacct USING btree (acctdate); CREATE INDEX totacct_nasipaddress_idx ON totacct USING btree (nasipaddress); CREATE INDEX totacct_nasondate_idx ON totacct USING btree (acctdate, nasipaddress); CREATE INDEX totacct_username_idx ON totacct USING btree (username); CREATE INDEX totacct_userondate_idx ON totacct USING btree (username, acctdate); freeradius-server/dialup_admin/sql/postgresql/userinfo.sql000066400000000000000000000006351257552170400245320ustar00rootroot00000000000000SET search_path = public, pg_catalog; -- -- Table structure for table 'userinfo' -- CREATE TABLE userinfo ( id SERIAL PRIMARY KEY, username TEXT, name TEXT, mail TEXT, department TEXT, workphone TEXT, homephone TEXT, mobile TEXT ); CREATE INDEX userinfo_department_idx ON userinfo USING btree (department); CREATE INDEX userinfo_username_idx ON userinfo USING btree (username); freeradius-server/doc/000077500000000000000000000000001257552170400152705ustar00rootroot00000000000000freeradius-server/doc/.gitignore000066400000000000000000000000071257552170400172550ustar00rootroot00000000000000_build freeradius-server/doc/00-OLD/000077500000000000000000000000001257552170400161235ustar00rootroot00000000000000freeradius-server/doc/00-OLD/INSTALL.OLD000066400000000000000000000077141257552170400176020ustar00rootroot00000000000000 How to install RADIUS Last modified 95/01/06 (Also see the RADIUS Chapter in the manual.) The below examples assume you're installing RADIUS in /etc/raddb but you can place it anywhere if you change radius.h and recompile or use the -d flag to tell it what directory to find its configuration files in. If you have pminstall and aren't running NIS (Yellow Pages), run pminstall and choose "Install RADIUS", then as root do "chmod 700 /etc/raddb", then skip down to SETTING UP CLIENTS. If you don't have pminstall, do the following: Add the following 2 lines to /etc/services on your RADIUS server, or if you're running NIS (Yellow Pages) add these lines to your services NIS map on your NIS master and push the maps. radius 1645/udp radiusd radacct 1646/udp Now execute the following commands as root: umask 22 mkdir /etc/raddb /usr/adm/radacct chmod 700 /etc/raddb /usr/adm/radacct Copy the contents of /usr/portmaster/radius/raddb into /etc/raddb. Compile radiusd from /usr/portmaster/radius/src and place it in /etc/radiusd or wherever you prefer. SETTING UP CLIENTS The PortMaster's hostname and the shared secret are placed in /etc/raddb/clients, separated by a tab. Your user entries are placed in /etc/raddb/users. Examples of each can be found in clients.example and users.example. You shouldn't need to change the dictionary file. Start radiusd (you'll probably want to add this to /etc/rc.local or some other file that gets run at system boot time). /etc/radiusd radiusd -x will produce debugging output which may be helpful if things don't seem to be working. If radiusd has problems it'll print to /etc/raddb/logfile or /dev/console if it can. Note that Framed-Compression defaults to on if you don't specify it, so SLIP users who don't want VJ header compression MUST include Framed-Compression = None. Configure your PortMaster so that it knows which host the radiusd is running on and what the shared secret is. On the PortMaster, set the RADIUS server and the shared secret using the "set authentic" and "set secret" commands, or from the Edit RADIUS menu on pmconsole. The secret is case-sensitive and can be up to 16 characters long. Do not use control characters in the secret. You can configure a backup RADIUS server with "set alternate" but it's not required. Make sure all ports have passthrough disabled with "set all security on" followed by "reset all" (Warning! "reset all" will drop off anyone who's on the port at the moment.) On older versions of ComOS you'll need to do "set s0 security on", "set s1 security on", etc. Do a "save all" to save the changes to nonvolatile memory. The PortMaster will check its local User Table first, and if it doesn't find the user there AND passthrough is disabled AND a RADIUS server is set, it will then query the RADIUS server. Make sure your DNS has an in-addr.arpa entry for the PortMaster if you're using Rlogin to Linux. If you're using Rlogin or PortMaster service and get prompted for the password twice, you can add the PortMaster's hostname to your /etc/hosts.equiv file to get rid of the second password prompt. Do NOT do this if you're using Passthrough and not RADIUS!!! If you're already in production with the User Table, a good way to switch over to using RADIUS is first to add a user to RADIUS that's not in the PortMaster's User Table, test with that, and when everything checks out use pmreadpass (if on a supported platform) to copy everyone from the PortMaster to the /etc/raddb/users file, then get rid of the users in the PortMaster's local User Table. Edit the output from pmreadpass to remove the ", Client-ID = 192.9.200.1" clause (the IP address will match your PortMaster's IP address). pmreadpass is included in release 3.1 of the PortMaster administration software. You'll also need to modify Framed-Filter-Id if you have any. Framed-Filter-Id = "std.ppp" means that the input filter is std.ppp.in (if it exists) and the output filter is std.ppp.out (if it exists). freeradius-server/doc/Acct-Type.rst000066400000000000000000000044111257552170400176130ustar00rootroot00000000000000Acct-Type ========= FreeRADIUS supports the Acct-Type attribute to select between accounting methods based on arbitrary attribute/value pairs contained in an accounting packet. Its use follows the same general configuration syntax as Auth-Type and Autz-Type. The main difference in configuration between Acct-Type and Auth/Autz-Type lies in where the Acct-Type method is assigned. With Auth/Autz-Type, the method is typically assigned in the 'users' file. The 'users' file, naturally, is not processed during the handling of the accounting {} section. However, part of the default files {} module is the 'acct_users' file, which serves the same purpose as the 'users' file, but applies to accounting packets. For example, a server administrator is responsible for handling the accounting data for two different realms, foo.com and bar.com, and wishes to use different instances of the SQL module for each. In addition, there is one RADIUS client sending accounting data that is to be logged only to a specific detail file. Everything else should use a third SQL instance. The acct_users file would look something like this:: DEFAULT Realm == "foo.com", Acct-Type := "SQLFOO" DEFAULT Realm == "bar.com", Acct-Type := "SQLBAR" DEFAULT Client-IP-Address == "10.0.0.1", Acct-Type := "OTHERNAS" And in radiusd.conf:: $INCLUDE ${confdir}/sql0.conf # Instance named 'sql0'. $INCLUDE ${confdir}/sql1.conf # Instance named 'sql1'. $INCLUDE ${confdir}/sql2.conf # Instance named 'sql2'. detail othernas { detailfile = ${radacctdir}/10.0.0.1/detail-%Y%m%d } preacct { suffix # Add the Realm A/V pair. files # Add the Acct-Type A/V pair based on the Realm A/V pair. } accounting { # If Acct-Type is SQLFOO use the 'sql1' instance of the SQL module. Acct-Type SQLFOO { sql1 } # If Acct-Type is SQLBAR, use the 'sql2' instance of the SQL module. Acct-Type SQLBAR { sql2 } # If Acct-Type is OTHERNAS, use the 'othernas' instance of the detail # module Acct-Type OTHERNAS { othernas } # If we've made it this far, we haven't matched an Acct-Type, so use # the sql0 instance. sql0 } freeradius-server/doc/Autz-Type.rst000066400000000000000000000047731257552170400176770ustar00rootroot00000000000000Autz-Type ========= Like Auth-Type for authentication method selection freeradius also supports the Autz-Type to select between authorization methods. The only problem is that authorization is the first thing to be called when an authentication request is handled. As a result we first have to call the authorize section without checking for Autz-Type. After that we check for Autz-Type and if it exists we call the corresponding subsection in the authorize section. In other words the authorize section in radiusd.conf should look like this:: authorize{ suffix preprocess # whatever other authorize modules here Autz-Type Ldap{ ldap } Autz-Type SQL{ sql } files } What happens is that the first time the authorize section is examined the suffix, preprocess and files modules are executed. If Autz-Type is set after that the server core checks for any matching Autz-Type subsection. If one is found it is called. The users file should look something like this:: DEFAULT Called-Station-Id == "123456789", Autz-Type := Ldap DEFAULT Realm == "other.company.com", Autz-Type := SQL Autz-Type could also be used to select between multiple instances of a module (ie sql or ldap) which have been configured differently. For example based on the user realm different ldap servers (belonging to different companies) could be queried. If Auth-Type was also set then we could do both Authentication and Authorization with the user databases belonging to other companies. In detail: radiusd.conf:: authenticate{ Auth-Type customer1{ ldap1 } Auth-Type customer2{ ldap2 } } authorize{ preprocess suffix Autz-Type customer1{ ldap1 } Autz-Type customer2{ ldap2 } files } The users file:: DEFAULT Realm == "customer1", Autz-Type := customer1, Auth-Type := customer1 DEFAULT Realm == "customer2", Autz-Type := customer2, Auth-Type := customer2 Apart from Autz-Type the server also supports the use of Acct-Type, Session-Type and Post-Auth-Type for the corresponding sections. The corresponding section names in the radiusd.conf file are the same. So for example: users file:: DEFAULT Called-Station-Id == "236473", Session-Type := SQL radiusd.conf:: session { radutmp Session-Type SQL { sql } } freeradius-server/doc/CYGWIN.rst000066400000000000000000000255631257552170400170350ustar00rootroot00000000000000FreeRADIUS for EAP under CygWin =============================== From: "Philip Blow" To: Date: Wed, 29 Jan 2003 15:23:45 +1100 Here are some brief notes I but together for compiling FreeRADIUS 0.8.1 on Windows XP with EAP/TLS support. Configuring FreeRADIUS for EAP under CygWin. -------------------------------------------- #. Installing CygWin Install the latest version of CygWin (at time of writing 1.3.19-1) from http://www.cygwin.com #. Install the following packages (make as minimum list) +--------------------+-----------------+ | Package | Version | +====================+=================+ | _update-info-dir | 00126-1 | +--------------------+-----------------+ | ash | 20020731-1 | +--------------------+-----------------+ | autoconf | 2.54-1 | +--------------------+-----------------+ | autoconf-devel | 2.57-1 | +--------------------+-----------------+ | autoconf-stable | 2.13-4 | +--------------------+-----------------+ | automake | 1.7.1-1 | +--------------------+-----------------+ | automake-devel | 1.7.2-1 | +--------------------+-----------------+ | automake-stable | 1.4p5-5 | +--------------------+-----------------+ | base-files | 1.1-1 | +--------------------+-----------------+ | base-passwd | 1.0-1 | +--------------------+-----------------+ | bash | 2.05b-8 | +--------------------+-----------------+ | bc | 1.06-1 | +--------------------+-----------------+ | binutils | 20021117-1 | +--------------------+-----------------+ | byacc | 1.9-1 | +--------------------+-----------------+ | bzip2 | 1.0.2-2 | +--------------------+-----------------+ | crypt | 1.0-1 | +--------------------+-----------------+ | cygrunsrv | 0.95-1 | +--------------------+-----------------+ | cygutils | 1.1.3-1 | +--------------------+-----------------+ | cygwin | 1.3.19-1 | +--------------------+-----------------+ | cygwin-doc | 1.3-2 | +--------------------+-----------------+ | diff | 1.0-1 | +--------------------+-----------------+ | diffutils | 2.8.1-1 | +--------------------+-----------------+ | ed | 0.2-1 | +--------------------+-----------------+ | file | 3.37-1 | +--------------------+-----------------+ | fileutils | 4.1-1 | +--------------------+-----------------+ | findutils | 4.1.7-4 | +--------------------+-----------------+ | gawk | 3.1.1-5 | +--------------------+-----------------+ | gcc | 3.2-3 | +--------------------+-----------------+ | gcc-mingw | 20020817-5 | +--------------------+-----------------+ | gcc2 | 2.95.3-10 | +--------------------+-----------------+ | gdb | 20021218-1 | +--------------------+-----------------+ | gdbm | 1.8.0-4 | +--------------------+-----------------+ | gettext | 0.11.5-1 | +--------------------+-----------------+ | grep | 2.5-1 | +--------------------+-----------------+ | groff | 1.18.1-2 | +--------------------+-----------------+ | gzip | 1.3.3-4 | +--------------------+-----------------+ | inetutils | 1.3.2-20 | +--------------------+-----------------+ | initscripts | 0.9-1 | +--------------------+-----------------+ | less | 378-1 | +--------------------+-----------------+ | libbz2_0 | 1.0.2-1 | +--------------------+-----------------+ | libbz2_1 | 1.0.2-2 | +--------------------+-----------------+ | libiconv2 | 1.8-2 | +--------------------+-----------------+ | libintl | 0.10.38-3 | +--------------------+-----------------+ | libintl1 | 0.10.40-1 | +--------------------+-----------------+ | libintl2 | 0.11.5-1 | +--------------------+-----------------+ | libltdl3 | 20030103-1 | +--------------------+-----------------+ | libncurses5 | 5.2-1 | +--------------------+-----------------+ | libncurses6 | 5.2-8 | +--------------------+-----------------+ | libpng10 | 1.0.14-2 | +--------------------+-----------------+ | libpng12 | 1.2.4-2 | +--------------------+-----------------+ | libpopt0 | 1.6.4-4 | +--------------------+-----------------+ | libreadline4 | 4.1-2 | +--------------------+-----------------+ | libreadline5 | 4.3-2 | +--------------------+-----------------+ | libtool | 20020202a-1 | +--------------------+-----------------+ | libtool-devel | 20021227-1 | +--------------------+-----------------+ | libtool-stable | 1.4.2-2 | +--------------------+-----------------+ | libxml2 | 2.4.23-1 | +--------------------+-----------------+ | login | 1.7-1 | +--------------------+-----------------+ | m4 | 1.4-1 | +--------------------+-----------------+ | make | 3.79.1-7 | +--------------------+-----------------+ | man | 1.5j-1 | +--------------------+-----------------+ | mingw-runtime | 2.3-1 | +--------------------+-----------------+ | mktemp | 1.4-1 | +--------------------+-----------------+ | more | 2.11o-1 | +--------------------+-----------------+ | nasm | 0.98.35-1 | +--------------------+-----------------+ | ncurses | 5.2-8 | +--------------------+-----------------+ | newlib-man | 20020801 | +--------------------+-----------------+ | openssh | 3.5p1-3 | +--------------------+-----------------+ | openssl | 0.9.7-1 | +--------------------+-----------------+ | openssl-devel | 0.9.7-1 | +--------------------+-----------------+ | openssl096 | 0.9.6h-1 | +--------------------+-----------------+ | patch | 2.5.8-2 | +--------------------+-----------------+ | pcre | 3.7-1 | +--------------------+-----------------+ | perl | 5.6.1-2 | +--------------------+-----------------+ | readline | 4.3-2 | +--------------------+-----------------+ | sed | 4.0.5-1 | +--------------------+-----------------+ | sh-utils | 2.0.15-3 | +--------------------+-----------------+ | sharutils | 4.2.1-2 | +--------------------+-----------------+ | sysvinit | 2.84-3 | +--------------------+-----------------+ | tar | 1.13.25-1 | +--------------------+-----------------+ | tcltk | 20021218-1 | +--------------------+-----------------+ | termcap | 20020930-1 | +--------------------+-----------------+ | terminfo | 5.2-3 | +--------------------+-----------------+ | texinfo | 4.2-4 | +--------------------+-----------------+ | textutils | 2.0.21-1 | +--------------------+-----------------+ | tiff | 3.5.7-1 | +--------------------+-----------------+ | time | 1.7-1 | +--------------------+-----------------+ | unzip | 5.50-1 | +--------------------+-----------------+ | vim | 6.1-2 | +--------------------+-----------------+ | w32api | 2.1-1 | +--------------------+-----------------+ | wget | 1.8.2-2 | +--------------------+-----------------+ | which | 1.5-1 | +--------------------+-----------------+ | xinetd | 2.3.9-1 | +--------------------+-----------------+ | zip | 2.3-2 | +--------------------+-----------------+ | zlib | 1.1.4-1 | +--------------------+-----------------+ #. Download Download the FreeRADIUS source code from http://www.freeradius.org/ #. Expand the FreeRADIUS source file. #. Make the following changes to the source code (the diffs are reversed) :: src/main/Makefile.in 145,148c145,148 < $(LIBTOOL) --mode=install $(INSTALL) -m 755 $(INSTALLSTRIP) radiusd.exe $(R)$(sbindir) < $(INSTALL) -m 755 $(INSTALLSTRIP) radwho.exe $(R)$(bindir) < $(INSTALL) -m 755 $(INSTALLSTRIP) raduse.exe $(R)$(bindir) < $(INSTALL) -m 755 $(INSTALLSTRIP) radzap.exe $(R)$(bindir) --- > $(LIBTOOL) --mode=install $(INSTALL) -m 755 $(INSTALLSTRIP) radiusd $(R)$(sbindir) > $(INSTALL) -m 755 $(INSTALLSTRIP) radwho $(R)$(bindir) > $(INSTALL) -m 755 $(INSTALLSTRIP) raduse $(R)$(bindir) > $(INSTALL) -m 755 $(INSTALLSTRIP) radzap $(R)$(bindir) 150,151c150,151 < $(INSTALL) -m 755 radclient.exe $(R)$(bindir) < $(INSTALL) -m 755 radrelay.exe $(R)$(bindir) --- > $(INSTALL) -m 755 radclient $(R)$(bindir) > $(INSTALL) -m 755 radrelay $(R)$(bindir) src/modules/rlm_dbm/Makefile.in 22,23c22,23 < $(INSTALL) -m 755 $(INSTALLSTRIP) rlm_dbm_parser.exe $(R)$(bindir) < $(INSTALL) -m 755 $(INSTALLSTRIP) rlm_dbm_cat.exe $(R)$(bindir) --- > $(INSTALL) -m 755 $(INSTALLSTRIP) rlm_dbm_parser $(R)$(bindir) > $(INSTALL) -m 755 $(INSTALLSTRIP) rlm_dbm_cat $(R)$(bindir) src/modules/rlm_mschap/Makefile 20c20 < $(INSTALL) -m 755 $(INSTALLSTRIP) smbencrypt.exe $(R)$(bindir) --- > $(INSTALL) -m 755 $(INSTALLSTRIP) smbencrypt $(R)$(bindir) #. Run configure with the following command line :: ./configure -without-snmp -disable-shared -enable-static #. Execute make and then make install :: Philip Blow Senior Technical Manager Simply Wireless philipb@simplywireless.com.au freeradius-server/doc/ChangeLog000066400000000000000000000351011257552170400170420ustar00rootroot00000000000000FreeRADIUS 2.2.8 Thursday 09 Jul 2015 11:00:00 EDT, urgency=medium Feature improvements * None. Bug fixes * Fixes for clients tied to virtual servers. If there is no "listen" section there, clients use the main "listen" section. * Remove compiler warnings * Print out correct filenames in debug mode * Allow post-auth section to return "reject". This turns the response into Access-Reject. * Set X509_V_FLAG_CRL_CHECK_ALL, and add "check_all_crl" to eap.conf. Fixes oCert CVE-2015-4680. FreeRADIUS 2.2.7 Wednesday 22 Apr 2015 14:00:00 EST, urgency=medium Feature improvements * Allow "eap" to be listed in Post-Auth-Type Reject so that it sends EAP-Fail and Message-Authenticator. Bug fixes * Fix typo in code checking for blocked threads. Closes #880. * Added more $(EXEEXT) to module utilities so that it builds on Cygwin. Closes #875. * Note that we don't need to generate ephemeral RSA keys. * Port detail file fixes from v3. * Use correct destination port for replies to DHCP relay. * rlm_perl can store multiple tagged attributes of the same name. * Update EAP-TLS methods for TLSv1.2 * Fix load-balance sections. Closes #945 FreeRADIUS 2.2.6 Tuesday 18 Nov 2014 15:00:00 EST, urgency=medium Feature improvements * When supported by OpenSSL, allow TLS 1.1 and TLS 1.2 in EAP methods. Bug fixes * Fix redundant-load-balance blocks to try other modules in the group if one fails. * Fix potential read into uninitialised memory in rlm_pap when normalising octet type attributes containing password hashes. This is very unlikely to happen in the wild. * Don't stop decoding DHCP options if we find a padding option. * Define sig_t on systems which don't have it. Closes #765 * When clients are loaded from SQL, allow them to be tied to a virtual server. * Prevent race conditions between fork and wait for child. Patch from James Rouzier. * Allow UTF-8 characters in SQL. * Back-port udpfromto fixes from v3 FreeRADIUS 2.2.5 Monday 28 Apr 2014 15:20:00 EDT, urgency=medium Feature improvements * Update dictionary.terena. * expose server version via %v. Patch from Alan Buxey. * Forbid running with vulnerable versions of OpenSSL. See "allow_vulnerable_openssl" in the "security" subsection of "radiusd.conf" * Catch underlying "heartbleed" problem, so that nothing bad happens even when using a vulnerable version of OpenSSL. * Add dictionary.zte Bug fixes * Minor changes to build on Sun. * Print non-ASCII characters as octal in linelog. Closes #578 * close stdout in daemon mode. * Fix zombie period calculation. Closes #579 FreeRADIUS 2.2.4 Wednesday 19 Mar 2014 13:20:00 EDT, urgency=medium Feature improvements * A "panic_action" can be set to have the server dump a gdb log on SEGV or other fatal error. * allow radmin command "set module status " which can be used to forcibly enable/disable modules. Bug fixes * If the server fails to bind() after fork(), that is now reported to the parent, which exits with an error. * Session / delay times in MySQL are unsigned int. * Use --tag=CC for libtool. Closes #497. Because libtool is too stupid to notice that compiling means compilation. * Fix bug when copying attributes for vendors > 32767 * Fix behaviour on FreeBSD where sending packets from an interface bound to an IP address would fail when the server was built with udpfromto. * Don't fail config check if were listening on an IP which is also a home server. Some deployments have valid reasons to loop packets back to another virtual server. * Use correct port when DHCP relaying. * Set source IP address for DHCP packets from DHCP-Server-IP-Address, or DHCP-DHCP-Server-Identifier, if we're unable to otherwise determine the source IP. FreeRADIUS 2.2.3 Wednesday 11 Dec 2013 15:00:00 EST, urgency=medium Feature improvements * Added dictionary.efficientip, dictionary.alcatel-lucent-aaa * Allow zero length DN strings in rlm_ldap. * If Password-With-Header has no header, assume it is Cleartext-Password. Bug fixes * Make the server build when DHCP is enabled * Don't crash if there's no Post-Proxy-Type Reject. * Use correct fields for X509 attributes in certificates * Install threads.h making it possible to link against the installed headers again. * Initialize SSL once in "main", instead of rlm_eap_tls. Some client libraries may need SSL. FreeRADIUS 2.2.2 Wednesday 30 Oct 2013 9:30:00 DST, urgency=medium Feature improvements * Add "timeout" to exec, and "ntlm_auth_timeout" to mschap. So that run-away child processes are caught earlier. * Print out thread number for "unresponsive child". Bug fixes * Fix erroneous fall-through in "case" statements * Fix priority handling in new module handling code * Fix threading issue with Perl. Closes #436 * Fix EAP-TLS check_cert_issuer when X509v2 extensions existed. Patch from David Wood. * Fix pointer references in rlm_python. * Fix "unresponsive child" issue when proxying. * Set log output correctly when using -l. Fix ported from 3.0.0. * Buffer debug output when threaded, so that text from different threads isn't interspersed. * Fix SEGV in rlm_perl when using dynamic expansions. * Fix build for OSX Mavericks, which hid the header files in a magical place. * Port DHCP fixes from 3.0. FreeRADIUS 2.2.1 Tuesday 17 Sep 2013 12:00:00 CEST, urgency=medium Feature improvements * Updated dictionaries for alcatel, broadsoft, bskyb, dlink, meru, telkom, trapeze, proxim, zeus, rfc6677, 6911, and rfc6930. * Added %{randstr:..} support. Creates random strings in a controllable format. * Added operator support to rlm_python * Added %{hex:...} for hex version of raw attribute data * Added %{sha1:...} for SHA1 hashing of data * Added %{base64:...} for raw attribute data (e.g. 32-bit IP addr), and %{tobase64:...} for the printable string form (e.g. 1.2.3.4), and %{base64tohex:...} to convert a base64 string to a hex string. * rlm_expr is now responsible for registering many of the xlat expansions. This is cleaner than bundling them all in the server core. You should ensure 'expr' is listed in instantiate to ensure correct operation of xlat expansions. * Use correct terminology when printing errors regarding request/ response/message authenticators. * Added keytab support to Heimdal Kerberos. Patch from Ryan Steinmetz. * radsqlrelay does multiple INSERTs in one transaction. Patch from Uwe Meyer-Gruhl. * Run Post-Proxy-Type Reject {} if the upstream server rejected the request. * On startup, the server checks if it was linked with the correct OpenSSL libraries. If not, it errors out. This prevents later crashes in OpenSSL, due to library incompatibilities. * Added radmin command "hup main.log", to re-open the log files, without HUPing any other part of the server. * Added support for EAP-Key-Name. See raddb/sites-available/default, and look for comments mentioning EAP-Key-Name. MacSec now works. * Added support for hex numbers (0x...) to %{expr: ...} * Backported TLS client certificate validation from 3.0.0. * Run Post-Auth for EAP inner-tunnel methods. * Added more RFCs * Added "show config " to radmin. You can now examine any configuration item in a running server. * Added TLS-Client-Cert-X509v3-Extended-Key-Usage for TLS-based EAP methods. It is set automatically from the fields in the certificate. * Add CRLCP attribute in certificate creation script. Windows phones require it. Patch from Alan Buxey. Bug fixes * Skip OCSP if there's no host / port / url, with soft_fail * Properly decode AT_IDENTITY in EAP-SIM. Patch from Iliya Peregoudov * Thread max_queue_size has better bounds checking. * Use correct variable for warning message if the user misconfigures the server. * radtest is more generous about parsing ppphint * radeapclient now accepts -4 and -6, just like radclient. Patch from John Dennis. * Ignore ".rpmnew" and a bunch of other files when loading config files from a directory. * Wait for child threads before exiting. This prevents errors on exit, but may increase exit time if databases are blocked! Patch from Iliya Peregoudov. * Wrap rbtree calls in mutexes in rlm_cache to prevent memory corruption. Patch from Phil Mayers. * Port fix for %{3GPP-*} expansion from master branch. * Fix sample certificate scripts when multiple client certs are made * Track return code priorities across if/else/elsif in unlang. Closes #107 * In debug mode, print out DHCP options when sending a DHCP packet. * Fixes to the redis modules from Brian Candler * Print better debug message for LDAP "operations error" * Fix a number of minor issues as found by Coverity * Frees module config in order to prevent occasional crash on exit * Update DHCP debugging messages to make it clearer what's going on. * Print multiple DHCP options the correct number of times in debugging mode * On debug builds, don't dlclose() modules when '-m' is used. This allows valgrind to show module symbols. * Don't count Status-Server packets in Access-Request statistics * Minor cleanups to debug output * Be more careful handling module configurations to avoid crash on otherwise clean exit. * For raddebug, correctly set the group of the output file. * renamed dhclient to dhcpclient. People who install it shouldn't have their systems broken. * for EAP-TLS methods, random_file is no longer required. OpenSSL already reads /dev/urandom. * Fix Suse and Redhat scripts. Patches from Fajar Nugraha. * Minor bug fix for base64 decoding. * Allow two consecutive WiMAX TLVs of the same number. * Remove requirement that User-Name has to match MS-CHAP-User-Name. I18n issues means that the character sets could be different. * Don't use ephemeral thread states from PyGILState_Ensure(), use our own, generated one per thread and stored in TLS. * Port module processing fixes from v3. The code is simpler, and one or two esoteric bugs are now gone. * update code handling max_requests_per_server. It should now work correctly. * wrap ASCTIME_R for systems not supporting the standard API. FreeRADIUS 2.2.0 Mon 10 Sep 2012 12:00:00 CEST, urgency=medium Feature improvements * 100% configuration file compatible with 2.1.x. The only fix needed is to disallow "hashsize=0" for rlm_passwd * Update Aruba, Alcatel Lucent, APC, BT, PaloAlto, Pureware, Redback, and Mikrotik dictionaries * Switch to using SHA1 for certificate digests instead of MD5. See raddb/certs/*.cnf * Added copyright statements to the dictionaries, so that we know when people are using them. * Better documentation for radrelay and detail file writer. See raddb/modules/radrelay and raddb/radrelay.conf * Added TLS-Cert-Subject-Alt-Name-Email from patch by Luke Howard * Added -F to radwho * Added query timeouts to MySQL driver. Patch from Brian De Wolf. * Add /etc/default/freeradius to debian package. Patch from Matthew Newton * Finalize DHCP and DHCP relay code. It should now work everywhere. See raddb/sites-available/dhcp, src_ipaddr and src_interface. * DHCP capabilitiies are now compiled in by default. It runs as a DHCP server ONLY when manually enabled. * Added one letter expansions: %G - request minute and %I request ID. * Added script to convert ISC DHCP lease files to SQL pools. See scripts/isc2ippool.pl * Added rlm_cache to cache arbitrary attributes. * Added max_use to rlm_ldap to force connection to be re-established after a given number of queries. * Added configtest option to Debian init scripts, and automatic config test on restart. * Added cache config item to rlm_krb5. When set to "no" ticket caching is disabled which may increase performance. Bug fixes * Fix CVE-2012-3547. All users of 2.1.10, 2.1.11, 2.1.12, and 802.1X should upgrade immediately. * Fix typo in detail file writer, to skip writing if the packet was read from this detail file. * Free cached replies when closing resumed SSL sessions. * Fix a number of issues found by Coverity. * Fix memory leak and race condition in the EAP-TLS session cache. Thanks to Phil Mayers for tracking down OpenSSL APIs. * Restrict ATTRIBUTE names to character sets that make sense. * Fix EAP-TLS session Id length so that OpenSSL doesn't get excited. * Fix SQL IPPool logic for non-timer attributes. Closes bug #181 * Change some informational messages to DEBUG rather than error. * Portability fixes for FreeBSD. Closes bug #177 * A much better fix for the _lt__PROGRAM__LTX_preloaded_symbols nonsense. * Safely handle extremely long lines in conf file variable expansion * Fix for Debian bug #606450 * Mutex lock around rlm_perl Clone routines. Patch from Eike Dehling * The passwd module no longer permits "hashsize = 0". Setting that is pointless for a host of reasons. It will also break the server. * Fix proxied inner-tunnel packets sometimes having zero authentication vector. Found by Brian Julin. * Added $(EXEEXT) to Makefiles for portability. Closes bug #188. * Fix minor build issue which would cause rlm_eap to be built twice. * When using "status_check=request" for a home server, the username and password must be specified, or the server will not start. * EAP-SIM now calculates keys from the SIM identity, not from the EAP-Identity. Changing the EAP type via NAK may result in identities changing. Bug reported by Microsoft EAP team. * Use home server src_ipaddr when sending Status-Server packets * Decrypt encrypted ERX attributes in CoA packets. * Fix registration of internal xlat's so %{mschap:...} doesn't disappear after a HUP. * Can now reference tagged attributes in expansions. e.g. %{Tunnel-Type:1} and %{Tunnel-Type:1[0]} now work. * Correct calculation of Message-Authenticator for CoA and Disconnect replies. Patch from Jouni Malinen * Install rad_counter, for managing rlm_counter files. * Add unique index constraint to all SQL flavours so that alternate queries work correctly. * The TTLS diameter decoder is now more lenient. It ignores unknown attributes, instead of rejecting the TTLS session. * Use "globfree" in detail file reader. Prevents very slow leak. Closes bug #207. * Operator =~ shouldn't copy the attribute, like :=. It should instead behave more like ==. * Build main Debian package without SQL dependencies * Use max_queue_size in threading code * Update permissions in raddb/sql/postgresql/admin.sql * Added OpenSSL_add_all_algorithms() to fix issues where OpenSSL wouldn't use methods it knew about. * Add more sanity checks in dynamic_clients code so the server won't crash if it attempts to load a badly formated client definition. freeradius-server/doc/DIFFS.rst000066400000000000000000000167641257552170400166730ustar00rootroot00000000000000Submitting patches or diff's to the FreeRADIUS project ====================================================== For a person or company wishing to submit a change to the FreeRADIUS project, the process can sometimes be daunting if you're not familiar with "the system." This text is a collection of suggestions which can greatly increase the chances of your change being accepted. Creating and Sending Your Change -------------------------------- 1. "diff -u" Use "diff -u" or "diff -urN" to create patches. All changes to the source occur in the form of patches, as generated by diff(1). When creating your patch, make sure to create it in "unified diff" format, as supplied by the '-u' argument to diff(1). Patches should be based in the root source directory, not in any lower subdirectory. To create a patch for a single file, it is often sufficient to do: SRCTREE=/home/user/src/freeradiusd/ MYFILE=src/modules/rlm_foo/foo.c cd $SRCTREE cp $MYFILE $MYFILE.orig vi $MYFILE # make your change diff -u $MYFILE.orig $MYFILE > /tmp/patch To create a patch for multiple files, you should unpack a "vanilla", or unmodified source tree, and generate a diff against your own source tree. For example: MYSRC=/home/user/src/freeradiusd-feature/ gunzip freeradiusd-version.tar.gz tar xvf freeradiusd-version.tar diff -urN freeradiusd-version $MYSRC > ~/feature-version.patch 2. Describe your changes. Describe the technical detail of the change(s) your patch includes. Be as specific as possible. The WORST descriptions possible include things like "update file X", "bug fix for file X", or "this patch includes updates for subsystem X. Please apply." If your description starts to get long, that's a sign that you probably need to split up your patch. See #3, next. 3. Separate your changes. Separate each logical change into its own patch. For example, if your changes include both bug fixes and performance enhancements for a single module, separate those changes into two or more patches. On the other hand, if you make a single change to numerous files, group those changes into a single patch. Thus a single LOGICAL change is contained within a single patch. If one patch depends on another patch in order for a change to be complete, that is OK. Simply note "this patch depends on patch X" in your patch description. 4. Select e-mail destination. If you are on the developers mailing list, send the patch there. freeradius-devel@lists.freeradius.org Otherwise, send the patch to 'patches@freeradius.org' 5. No MIME, no links, no compression, no attachments. Just plain text. The developers need to be able to read and comment on the changes you are submitting. It is important for a developer to be able to "quote" your changes, using standard e-mail tools, so that they may comment on specific portions of your code. For this reason, all patches should be submitting e-mail "inline". Do not attach the patch as a MIME attachment, compressed or not. Many popular e-mail applications will not always transmit a MIME attachment as plain text, making it impossible to comment on your code. A MIME attachment also takes a bit more time to process, decreasing the likelihood of your MIME-attached change being accepted. Compressed patches are generally rejected outright. If the developer has to do additional work to read your patch, the odds are that it will be ignored completely. 6. E-mail size. When sending patches, always follow step #5. Large changes are not appropriate for mailing lists, and some maintainers. If your patch, exceeds 40Kb in size, it is preferred that you store your patch on an Internet-accessible server, and provide instead a URL (link) pointing to your patch. 7. Name the version of the server. It is important to note, either in the subject line or in the patch description, the server version to which this patch applies. 8. Don't get discouraged. Re-submit. After you have submitted your change, be patient and wait. If the patch is approved and applied, it will appear in the next version of the server. However, if your change doesn't appear in the next version of the server, there could be any number of reasons. It's YOUR job to narrow down those reasons, correct what was wrong, and submit your updated change. It is quite common a patch to be "dropped" without comment. That's the nature of the system. If your patch is dropped, it could be due to A style issue (see section 2, below), An e-mail formatting issue (see section item 5, above) A technical problem with your change Your patch got lost among other patches When in doubt, re-submit. Hints, Tips, and Tricks ----------------------- This section lists many of the common "rules" associated with code submitted to the project. There are always exceptions... but you must have a really good reason for doing so. 1. Read the Documentation and follow the CodingStyle The FreeRADIUS server has a common coding style. Use real tabs to indent. There is whitespace in variable assignments. (i = 1, NOT i=1). When in doubt, format your code to look the same as code already in the server. If your code deviates too much from the current style, it is likely to be rejected without further review, and without comment. 2. #ifdefs are ugly Code cluttered with ifdefs is difficult to read and maintain. Don't do it. Instead, put your ifdefs in a header, and conditionally define 'static inline' functions, or macros, which are used in the code. Let the compiler optimize away the "no-op" case. Simple example, of poor code:: #ifdef CONFIG_MY_FUNKINESS init_my_stuff(foo); #endif Cleaned-up example: (in header):: #ifndef CONFIG_MY_FUNKINESS static inline void init_my_stuff(char *foo) {} #endif (in the code itself):: init_my_stuff(dev); 3. 'static inline' is better than a macro Static inline functions are greatly preferred over macros. They provide type safety, have no length limitations, no formatting limitations, and under gcc they are as cheap as macros. Macros should only be used for cases where a static inline is clearly suboptimal [there a few, isolated cases of this in fast paths], or where it is impossible to use a static inline function [such as string-izing]. 'static inline' is preferred over 'static __inline__', 'extern inline', and 'extern __inline__'. 4. Don't over-design. Don't try to anticipate nebulous future cases which may or may not be useful: "Make it as simple as you can, and no simpler" Split up functionality as much as possible. If your code needs to do two unrelated things, write two functions. Mashing two kinds of work into one function makes the server difficult to debug and maintain. See the 'coding-methods.txt' document in this directory for further description of coding methods. freeradius-server/doc/MACOSX000066400000000000000000000020671257552170400162120ustar00rootroot00000000000000 Installing FreeRADIUS on MAC OSX -------------------------------- 1) download, unzip and untar freeradius.tar.gz 2) $ ./configure --disable-shared To build static libraries. MAC OSX has a strange dynamic library system, which FreeRADIUS doesn't currently support. 3) $ make 4) There may be issues building the rlm_eap and rlm_sql modules. The simplest way to work around them is to edit '../Make.inc'. The last line should start off with "MODULES". Delete 'rlm_eap' and 'rlm_sql' from that line, and do 'make' again. If you've deleted the 'eap' and 'sql' modules, double-check 'radiusd.conf' to delete any reference it has to 'eap' or 'sql'. 5) $ make install 6) Now run radiusd -X and test things out with radtest, as specified in the FAQ. 7) Assuming everything works, set up your clients.conf and other config files as appropriate to suit your needs and set radiusd to run on boot and you're done. See 'README' in this directory. That's about it. FreeRADIUS works for me and I'm happy now. :-) Author: Philip Kearney freeradius-server/doc/Makefile000066400000000000000000000015231257552170400167310ustar00rootroot00000000000000# # Makefile # # Version: $Id$ # include ../Make.inc SUBDIRS = examples rfc WHAT_TO_MAKE = all RST_FILES := $(wildcard *.rst) all: @$(MAKE) $(MFLAGS) WHAT_TO_MAKE=$@ common clean: @$(MAKE) $(MFLAGS) WHAT_TO_MAKE=$@ common @rm -f *~ install: @if [ "$(docdir)" = no ]; then \ echo 'Documentation files will NOT be installed.'; \ else \ $(INSTALL) -d -m 755 $(R)$(docdir); \ for file in *[!~]; do \ if [ -f $$file -a $$file != Makefile ]; then \ $(INSTALL) -m 644 $$file $(R)$(docdir); \ fi; \ done; \ $(MAKE) $(MFLAGS) WHAT_TO_MAKE=$@ common; \ fi common: $(SUBDIRS) $(SUBDIRS): @echo "Making $(WHAT_TO_MAKE) in $@..." @$(MAKE) $(MFLAGS) -C $@ $(WHAT_TO_MAKE) .PHONY: all clean install common $(SUBDIRS) %.html: %.rst @rst2html.py $^ > $@ .PHONY: html html: $(RST_FILES:.rst=.html) freeradius-server/doc/Makefile.sphinx000066400000000000000000000063451257552170400202500ustar00rootroot00000000000000# Makefile for Sphinx documentation # # You can set these variables from the command line. SPHINXOPTS = SPHINXBUILD = sphinx-build PAPER = BUILDDIR = _build # Internal variables. PAPEROPT_a4 = -D latex_paper_size=a4 PAPEROPT_letter = -D latex_paper_size=letter ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . .PHONY: help clean html dirhtml pickle json htmlhelp qthelp latex changes linkcheck doctest help: @echo "Please use \`make ' where is one of" @echo " html to make standalone HTML files" @echo " dirhtml to make HTML files named index.html in directories" @echo " pdf to make standalone PDF files" @echo " pickle to make pickle files" @echo " json to make JSON files" @echo " htmlhelp to make HTML files and a HTML help project" @echo " qthelp to make HTML files and a qthelp project" @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" @echo " changes to make an overview of all changed/added/deprecated items" @echo " linkcheck to check all external links for integrity" @echo " doctest to run all doctests embedded in the documentation (if enabled)" clean: -rm -rf $(BUILDDIR)/* html: $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html @echo @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." dirhtml: $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml @echo @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml." pdf: $(SPHINXBUILD) -b pdf $(ALLSPHINXOPTS) _build/pdf @echo @echo "Build finished. The PDFs are in _build/pdf." pickle: $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle @echo @echo "Build finished; now you can process the pickle files." json: $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json @echo @echo "Build finished; now you can process the JSON files." htmlhelp: $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp @echo @echo "Build finished; now you can run HTML Help Workshop with the" \ ".hhp project file in $(BUILDDIR)/htmlhelp." qthelp: $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp @echo @echo "Build finished; now you can run "qcollectiongenerator" with the" \ ".qhcp project file in $(BUILDDIR)/qthelp, like this:" @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/FreeRADIUS.qhcp" @echo "To view the help file:" @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/FreeRADIUS.qhc" latex: $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex @echo @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex." @echo "Run \`make all-pdf' or \`make all-ps' in that directory to" \ "run these through (pdf)latex." changes: $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes @echo @echo "The overview file is in $(BUILDDIR)/changes." linkcheck: $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck @echo @echo "Link check complete; look for any errors in the above output " \ "or in $(BUILDDIR)/linkcheck/output.txt." doctest: $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest @echo "Testing of doctests in the sources finished, look at the " \ "results in $(BUILDDIR)/doctest/output.txt." freeradius-server/doc/OS2000066400000000000000000000011041257552170400156120ustar00rootroot00000000000000Compiling FreeRADIUS under OS/2 To compile FreeRADIUS unde OS/2 you must have a full EMX environment with GNU utilities (like make,sh) The EMX can be get from http://hobbes.nmsu.edu To work with CVS repository you must install cvs110.zip from hobbes also before entering in sh.exe you must do SET SHELL=sh.exe before running ./configure you must set the shell the variables : export CC=gcc export MAKE=fullpathofyourmake.exe export PERL=fullpathofyourperl.exe The OS/2 version of FreeRADIUS can't directly execute checkrad.pl then the program will execute a checkrad.cmd freeradius-server/doc/Post-Auth-Type000066400000000000000000000024031257552170400177550ustar00rootroot00000000000000This is now called Post-Auth-Type, for consistency. O.INTRODUCTION Post-Auth-Type is used to select between groupings of modules in the post-auth stanza using arbitrary attributes. It is functionally identical to Acct-Type, apart from the name of the attribute and its dealing with rejected requests.. This means that (unlike Autz-Type) the attribute must be set before the stanza is run. Changes to Post-Auth-Type during post-auth will have no effect. 1.HOW IT WORKS If a request has been rejected, the value of Post-Auth-Type is overwritten with REJECT automatically, so anonymous modules outside the REJECT substanza will not be run, only modules within the appropriate substanza will be run. 2.EXAMPLES In the example below, when a request has been rejected, the module my_ippool will not be run, only the module my_detail will be run. If the request is not rejected, the my_ippool module will be run, but not the my_detail module post-auth { my_ippool Post-Auth-Type REJECT { my_detail } } In the following example, 2 different sql modules are used to store accepted requests and rejected requests. post-auth { my_sql_accept Post-Auth-Type REJECT { my_sql_reject } } freeradius-server/doc/RADIUS-LDAP-eDirectory000066400000000000000000000016401257552170400210300ustar00rootroot00000000000000"Integrating Novell eDirectory with FreeRADIUS" Overview You can integrate Novell® eDirectoryTM 8.7.1 or later with FreeRADIUS 1.0.2 onwards to allow wireless authentication for eDirectory users. By integrating eDirectory with FreeRADIUS, you can do the following: * Use universal password for RADIUS authentication. Universal password provides single login and authentication for eDirectory users. Therefore, the users need not have a separate password for RADIUS and eDirectory authentication. * Enforce eDirectory account policies for users. The existing eDirectory policies on the user accounts can still be applied even after integrating with RADIUS. Also, you can make use of the intruder lockout facility of eDirectory by logging the failed logins into eDirectory. For configuration information please refer to the Novell documentation http://www.novell.com/documentation/edir_radius/index.html freeradius-server/doc/RADIUS-SQL.schema000066400000000000000000000016021257552170400200750ustar00rootroot00000000000000RADIUS-SQL.schema 0.INTRODUCTION In order for your radius server to query an sql database, you must have a database schema on which the radius server can perform queries. The server ships with default database schema's for which the default queries are constructed. 1.DATABASE SCHEMA There isn't a generic SQL schema, but there is one for some databases: raddb/sql/mysql/schema.sql raddb/sql/postgresql/schema.sql raddb/sql/oracle/schema.sql raddb/sql/mssql/schema.sql 2.MYSQL More information about tips for configuring MySQL can be found at: http://www.mysql.com/doc/S/e/Server_parameters.html http://www.mysql.com/doc/E/X/EXPLAIN.html <-(useful) http://www.mysql.com/doc/T/i/Tips.html http://www.mysql.com/doc/M/e/Memory_use.html A good page for MySQL best practices is: http://www.onlamp.com/pub/a/onlamp/2002/07/11/MySQLtips.html freeradius-server/doc/README000066400000000000000000000234521257552170400161560ustar00rootroot000000000000001. INTRO All code in this server was written for this project. The server is mostly compatible with livingston radiusd-2.01 (no menus or s/key support though) but with more features, such as: o Can limit the maximum number of simultaneous logins on a per-user basis! o Multiple DEFAULT entries, that can optionally fall-through. o In fact, every entry can fall-through o Deny/permit access based on huntgroup users dials into o Set certain parameters (such as static IP address) based on huntgroup o Extra "hints" file that can select SLIP/PPP/rlogin based on username pattern (Puser or user.ppp is PPP, plain "user" is rlogin etc). o Can execute an external program when user has authenticated (for example to run a sendmail queue). o Can use `$INCLUDE filename' in radiusd.conf, users, and dictionary files o Can act as a proxy server, relaying requests to a remote server o Supports Vendor-Specific attributes o Supports many different plug-in modules for authentication, authorization, and accounting. o No good documentation at all, just like the original radiusd 1.16! Work on real manual pages is progressing slowly. For a large part you can use the documentation of the Livingston 2.01 server. Just remember that using Prefix and Suffix in both the "users" and the (FreeRadius specific) "hints" file will give unpredictable results. Well actually it will result in Prefix and Suffix probably not working in the "users" file if you already stripped them off in the "hints" file. 2. INSTALLATION See the INSTALL file, in the parent directory. 3. CONFIGURATION FILES For every file there is a fully commented example file included, that explains what is does, and how to use it. Read those sample files too! Again, many of the configuration files are ONLY documented in the comments included in the files. Reading the configuration files is REQUIRED to fully understand how to create complex configurations of the server. 3a. CLIENTS Make sure the clients (portmasters, Linux with portslave etc) are set up to use the host radiusd is running on as authentication and accounting host. Configure these clients to use a "radius secret password". For every client, also enter this "secret password" into the file /etc/raddb/clients. See also the manual page for clients(5). 3b. NASLIST Every NAS (Network Access Server, also known as terminal server) should have an entry in this file with an abbreviated name and the type of NAS it is. Currently FreeRadius supports the following NAS types: Terminal Server Type in naslist 3Com/USR Hiper Arc Total Control usrhiper 3Com/USR NetServer netserver 3Com/USR TotalControl tc Ascend Max 4000 family max40xx Cisco Access Server family cisco Cistron PortSlave portslave Computone PowerRack computone Cyclades PathRAS pathras Livingston PortMaster livingston Multitech CommPlete Server multitech Patton 2800 family patton Usually this is the same list as in the "clients" file, but not every NAS is a client and not every client is a NAS (this will start to make sense if you use radius proxy servers). 3c. NASPASSWD If ``checkrad'' needs to login on your terminal server to check who is online on a certain port (i.e. it's not possible to use SNMP or finger) you need to define a loginname and password here. This is normally ONLY needed for USR/3Com Total Control, NetServer and Cyclades PathRAS terminal servers! 3d. HINTS Customize the /etc/raddb/hints file. This file is used to give users a different login type based on a prefix/suffix of their loginname. For example, logging in as "user" may result in a rlogin session to a Unix system, and logging in as "Puser" could start a PPP session. 3e. HUNTGROUPS This is the /etc/raddb/huntgroups file. Here you can define different huntgroups. These can be used to: - restrict access to certain huntgroups to certain users/groups of users (define this in the huntgroups file itself) - match a loginname with a huntgroup in /etc/raddb/users. One use for this is to give a user a static IP address based on the huntgroup / Point of Presence (s)he dials in to. 3f. USERS With the original RADIUS server, every user had to be defined in this file. There could be one default entry, where you could for example define that a user not in the radius file would be checked agains the UNIX password file and on successful login would get a PPP connection. In the new style file, you can define multiple DEFAULT entries. All entries are processed in the order as they appear in the users file. If an entry matches the username, radiusd will stop scanning the users file unless the attribute "Fall-Through = Yes" is set. You can uses spaces in usernames by escaping them with \ or by using quotes. For example, "joe user" or joe\ user. The FreeRadius server does not trim any spaces from a username received from the portmaster (livingston does, in perl notation, $user =~ s/\s+.*//;) 3g. NEW RADIUS ATTRIBUTES (to be used in the USERS file). Name Type Descr. ---- ---- ------ Simultaneous-Use integer Max. number of concurrent logins Fall-Through integer Yes/No Login-Time string Defines when user may login. Current-Time string Allows you to perform time-based checks when a request is received. Login-Time defines the time span a user may login to the system. The format of a so-called time string is like the format used by UUCP. A time string may be a list of simple time strings separated by "|" or ",". Each simple time string must begin with a day definition. That can be just one day, multiple days, or a range of days separated by a hyphen. A day is Mo, Tu, We, Th, Fr, Sa or Su, or Wk for Mo-Fr. "Any" or "Al" means all days. After that a range of hours follows in hhmm-hhmm format. For example, "Wk2305-0855,Sa,Su2305-1655". Radiusd calculates the number of seconds left in the time span, and sets the Session-Timeout to that number of seconds. So if someones Login-Time is "Al0800-1800" and she logs in at 17:30, Session-Timeout is set to 1800 seconds so that she is kicked off at 18:00. 4. LOG FILES 4a. /var/log/radutmp In this file the currently logged in users are held. The program "radwho" reads this file and gives you a summary. Rogue sessions can be deleted from this file with the "radzap" program. 4b. /var/log/radwtmp This file is "wtmp" compatible and keeps a history of all radius logins/ logouts. This file can be read with the "last" program, and other Unix accounting programs (such as "ac" and "sac") can be used to produce a summary. 4c. /var/log/radius.log All RADIUS informational. diagnostic and error messages are logged in this file. If radiusd has been started with the "-y" flag, all logins attempts will be logged in this file. For failed logins, the wrong password will also be logged. With the "-z" flag, the passwords for successful logins will be logged as well. That's pretty dangerous though in case anyone unpriviliged ever manages to get access to this file! 4d. /var/log/radacct//detail This is the original radius logfile, as written by all the livingston radius servers. It's only created if the directory /var/log/radacct exists. The name is the short name if one is defined in /etc/raddb/naslist. For more configuration options on the detail file please see README.rlm_detail as it expands upon this greatly. 5. MORE INFO, SUPPORT We know that the documentation provided is sparse. However it is not in the scope of the radius server to provide a guide as to how terminal servers works and how the RADIUS protocol works and is used. The latest version of FreeRadius is always available through anonymous CVS from cvs.freeradius.org - for more info, see There are two GNU Mailman mailing lists hosted by Cistron Internet Services: a 'users' list, at: http://lists.freeradius.org/pipermail/freeradius-users/ and a 'developers only' list, at http://lists.freeradius.org/pipermail/freeradius-devel/ 6. OTHER INFORMATION The files in other directories are: debian/ Files to build a "freeradius" Debian Linux package. dialup_admin/ A PHP web front-end to manage an SQL database associated with the server. doc/ Various snippets of documentation doc/rfc/ Copies of the RFC's. If you have Perl, do a 'make' in that directory, and look at the HTML output. libltdl/ Libtool platform independent library system. man/ Unix Manual pages for the server, configuration files, and associated utilities. mibs/ SNMP Mibs for the server. raddb/ Sample configuration files for the server. redhat/ Additional files for a RedHat Linux system. scripts/ Sample scripts for startup and maintenance. src/ Source code src/main source code for the daemon and associated utilities src/lib source code for the RADIUS library src/include header files src/modules dynamic plug-in modules src/billing Some scripts and configuration files to assist in billing, Currently mostly VoIP related. suse/ Aditional files for a SuSE (UnitedLinux) system. todo/ TODO list and assorted files. If you have ANY problems, concerns, or surprises when running the server, then run it in debugging mode, as root, from the command line: $ radiusd -X It will produce a large number of messages. The answers to many questions, and the solution to many problems, can usually be found in these messages. For further details, see: http://www.freeradius.org/faq/ and the 'bugs' file, in this directory. $Date$ freeradius-server/doc/Session-Type000066400000000000000000000006311257552170400175550ustar00rootroot00000000000000Session-Type is used to select between groupings of modules in the session stanza using arbitrary attributes. It is functionally identical to Acct-Type, apart from the name of the attribute. This means that (unlike Autz-Type) the attribute must be set before the stanza is run. Changes to Session-Type during session will have no effect. This allows Simultaneous-Use checking behaviour to be very flexible. freeradius-server/doc/Simultaneous-Use000066400000000000000000000171141257552170400204410ustar00rootroot00000000000000 FreeRADIUS server and the Simultaneous-Use parameter. 0. INTRODUCTION Lots of people want to limit the number of times one user account can login, usually to one. This is hard to do with the radius protocol; the nature of the accounting stuff is such that the idea the radius server has about the list of logged-in users might be different from the idea the terminal server has about it. However, most terminal servers have an alternative way to get a list of logged-in users. Most support some way through telnet, some have a finger-daemon builtin and a lot of them support SNMP. So if the radius server thinks that someone is trying to login a second time, it is possible to check on the terminal server itself if the first login is indeed still active. Only then access is denied for the second login. 1. PREREQUISITES You need to have perl installed. For SNMP checks, you have 2 options. You can use the `snmpget' program from the cmu-snmp tools. You can probably get precompiled ones, maybe even packaged for your system (Debian/Linux, Redhat/Linux, FreeBSD ports collection etc). The source code is at http://www.net.cmu.edu/projects/snmp/snmpapps/. The Linux-specific version of this is at http://www.gaertner.de/snmp/ The other option is to install the SNMP_Session and BER modules that for example the well known `mrtg' package uses. This is recommended. In that case you need no external snmpget program, checkrad will speak SNMP directly. See http://www.switch.ch/misc/leinen/snmp/perl/ The checkroutine for USR/3Com Total Control racks uses the Net::Telnet module from CPAN, at least version 3.00. If you need that, obtain it from your local CPAN mirror (or see http://www.perl.com/CPAN/). The checkrad.pl perl script will autodetect if that module is installed. 2. USAGE. It works by adding the `check' parameter "Simultaneous-Use" to the entry for a users or DEFAULT in /etc/raddb/users. It should be at least one; it defines the maximum number of users logged in with the same account name. For example: # # Simultaneous use restrictions. # DEFAULT Group == "staff", Simultaneous-Use := 4 Fall-Through = 1 DEFAULT Group == "business", Simultaneous-Use := 2 Fall-Through = 1 DEFAULT Simultaneous-Use := 1 Fall-Through = 1 NOTE!!! The "Simultaneous-Use" parameter is in the "check" A/V pairs, and not in the Reply A/V pairs (it _is_ a check). For SQL, after creating and populating your schema, you should execute the following statement (for MySQL, others may vary): INSERT INTO radgroupcheck (GroupName, Attribute, op, Value) values("dialup", "Simultaneous-Use", ":=", "1"); Once that is done, your users should be limited to only one login at a time. 3. IMPLEMENTATION The server keeps a list of logged-in users in the /var/log/radutmp file. This is also called "the session database". When you execute "radwho", all that radwho really does is list the entries in this file in a pretty format. Only when someone tries to login who _already_ has an active session according to the radutmp file, the server executes the perl script /usr/local/sbin/checkrad (or /usr/sbin/checkrad, it checks for the presence of both and in that order). This script queries the terminal server to see if the user indeed already has an active session. The script uses SNMP for Livingston Portmasters and Ciscos, finger for Portslave, Computone and Ascend, and Net::Telnet for USR/3Com TC. Since the script has been witten in perl, it's easy to adjust for any type of terminal server. There are implementations in the script for checks using SNMP, finger, and telnet, so it should be easy to add your own check routine if your terminal server is not supported yet. You can find the script in the file src/checkrad.pl. You need to set the correct type in the file /etc/raddb/naslist so that checkrad KNOWS how it should interrogate the terminal server. At this time you can define the following types: type Vendor Uses method needs Need naspasswd ==== ====== =========== ===== ============== ascend Lucent SNMP SNMP No bay Nortel finger finger command No cisco Cisco SNMP SNMP Optional [1] computone Computone finger finger command No cvx Nortel SNMP SNMP No digitro Digitro rusers rusers command No livingston Livingston SNMP SNMP No [2] max40xx Lucent finger finger command No netserver USR/3com telnet CPAN Net::Telnet Yes pathras Cyclades telnet CPAN Net::Telnet Yes patton Patton SNMP SNMP No portslave ? finger finger command No pr3000 Cyclades SNMP snmpwalk command No pr4000 Cyclades SNMP snmpwalk command No tc USR/3com telnet CPAN Net::Telnet Yes usrhyper USR/3com SNMP SNMP No [3] versanet VersaNet SNMP SNMP No other none N/A - No [1] In naspasswd file: set username to SNMP, password is community. [2] Needs at least ComOS 3.5, SNMP enabled. [3] Set "Reported Port Density" to 256 (default) "other" means "don't bother checking, I believe what radutmp says". This really is not recommended, if a user has a "stuck" entry in the session database she will not be able to login again - hence the extra check that "checkrad" does. 4. IF IT DOESN'T WORK Note that you need to add the Simultaneous-Use parameter to the check item (first line), not the reply item, using the ':=' operator. You can edit the `checkrad' perl script and turn on debugging. Then watch the debug file. The `radius.log' file also gives some hints. You can also run the "checkrad" script manually, use the "-d" switch to get debug output on standard output instead of in the log. See also: http://wrath.geoweb.ge/simult.html which has a good discussion of the use of Simultaneous-Use. 5. CAVEATS This solution checks the radutmp file. This file is kept up-to-date from the Accounting records the NAS sends. Since some NASes delay these records for quite some time, it is possible to get a double login by logging in twice at _exactly_ the same time (plus or minus the mentioned delay time), since neither of the logins are registered yet. The solution would be to create a small 1-minute cache of Authentication records, that is also checked for double login attempts. Perhaps in the next version. When implementing this one thing was considered the most important: when trying to detect double logins, we always try to err on the safe side. So in rare cases, a double login is possible but we try never to limit access for a legitimate login. 6. PROBLEMS WITH DROPPED CONNECTIONS Our PM3, with 2 ISDN-30 lines coming into it, had the habit of sometimes dropping connections. In a few cases, the portmaster thought the session was still alive so if the user tried to login again, he or she was denied access. In our case, this problem was caused by a bad PRI line from the phone company. We tried to compensate this by setting the Idle-Timeout to 15 minutes. That way, even if a user did get locked out the portmaster would clear the rogue session within 15 minutes and the user could login again. freeradius-server/doc/SoH.txt000066400000000000000000000136551257552170400165340ustar00rootroot00000000000000== Intro == This release adds support for Microsoft Statement-of-Health (SoH), which is a form of network access protection. Client supprot is present in Windows XP SP3, Vista and 7. SoH data can come in from several places: * inside EAP-PEAP packets for 802.1x wireless/wired connections * inside a radius packet (Microsoft VSA #55, MS-Quarantine-SOH) - VPN and terminal services gateways can act as the radius client * inside a DHCP request, in vendor-specific options FreeRadius supports all three types. The SoH statement is decoded into radius-style attributes, and you can write a policy in "unlang" to act on them, and permit, restrict or deny network access. == PEAP support == SoH support in peap is enabled in eap.conf using config like so: eap { peap { soh = yes soh_virtual_server = "soh-server" } } When SoH is enabled, an EAP-PEAP client will be challenged to provide an SoH statement after providing it's identity (or resuming a PEAP session via SSL session resumption). Clients which do not support PEAP will NAK the request, and clients which do will answer it. The client reply will be written into a fake radius request and sent to the virtual server specified above; it will either look like: SoH-Supported = no ...or (from a Vista machine): SoH-Supported = yes SoH-MS-Machine-OS-vendor = Microsoft SoH-MS-Machine-OS-version = 6 SoH-MS-Machine-OS-release = 0 SoH-MS-Machine-OS-build = 6001 SoH-MS-Machine-SP-version = 1 SoH-MS-Machine-SP-release = 0 SoH-MS-Machine-Processor = x86_64 SoH-MS-Machine-Name = "netbios.example.com" SoH-MS-Correlation-Id = 0x54468936cb494374b127a6a3cc3bb11c01ca78d858ee1ef0 SoH-MS-Machine-Role = client SoH-MS-Windows-Health-Status = "firewall ok snoozed=0 microsoft=1 up2date=1 enabled=1" SoH-MS-Windows-Health-Status = "antivirus error not-installed" SoH-MS-Windows-Health-Status = "antispyware ok snoozed=0 microsoft=1 up2date=1 enabled=1" SoH-MS-Windows-Health-Status = "auto-updates ok action=install" SoH-MS-Windows-Health-Status = "security-updates warn some-missing" If you have "copy_request_to_tunnel = yes" set on the peap module, the request variables like NAS-IP-Address and so on will be copied to the fake request as well. Clients without SoH seem to just NAK the SoH request and continue with the inner EAP auth. This has been tested as working with Windows XP SP2 and lower, Linux clients using NetworkManager & wpa_supplicant, MacOS 10.5, Nokia/Symbian S60 and iPhone OS 3.x. It should therefore be safe to deploy. == Radius support == If you are running a Microsoft VPN or Terminal Services Gateway, these can be configured to send the SoH data to an upstream radius server, in this case presumably FreeRadius. To take advantage of this you will need to add the "soh" module to the "authorize" section of your virtual server, like so: server tsgateway { preprocess soh if () { ... policy goes here } } The SoH module simply looks for the Microsoft VSA #55 and decodes the SoH data, adding the SoH attributes to the request - see above for an example of the available attributes. The SoH module also does dynamic expansions - see below for more info. == DHCP support == If you compile FreeRadius with DHCP support, the "soh" module can challenge a DHCP client for SoH data in the DHCPOFFER packet. As with normal radius, the SoH attributes are added to the request. You would use like so: server dhcp { dhcp DHCP-Discover { soh # note - no SoH attributes are added here, the client hasn't sent them yet # other DHCP config } dhcp DHCP-Request { soh if () { # SoH policy } # other DHCP config } } == soh module == The "soh" module decodes the radius & DHCP payloads. It also makes some dynamic variables available, for example: authorize { soh update request { Tmp-String-0 = "%{soh:OS}" } } ...will give you a string like "Windows Vista 6.1.100 sp 1.0" or "Windows XP 5.x.x sp 3.0" At the moment, this is the only dynamic expansion; in future, we will make various bits of info available, for example non-Microsoft SoH records (see below) == Non-microsoft SoH data == The Windows SoH structure is extensible and, in principle, clients can be extended with .dll plugins to add vendor-specific info to the SoH, which can then be checked on the server. At the present time, few plugins are known and I have seen none, so can't add support for them. == Client configuration == The code works fine with Win XP SP3 & Vista on both wired & wireless. However contrary to what some sites claim, the NAP service is disabled by default, as are the many NAP remediation agents. These can be enabled from the command prompt with (for XP; instructions may differ for other windows versions): sc config napagent start= auto sc start napagent # optionally for wired 802.1x; the dot3svc should usually be made dependent # on the napagent service, else the machine might attempt 802.1x before NAP # has started... sc config dot3svc start= auto depend= napagent sc start dot3svc # enable the EAP agent netsh nap client show config # get the "ID" value for the "EAP Quarantine Enforcement Client" netsh nap client set enforce id=$ID admin=enable # repeat for DHCP, VPN or Terminal Services agents This can be automated via Group Policy. You then need to enable EAP, PEAP, Quarantine Checks & the relevant auth method on the relevant adapters. This can be done with "netsh xml profiles" or Group Policy - google for the relevant terms, or see the MS article: http://technet.microsoft.com/en-us/library/bb726965.aspx ...and related links. == TODO == Currently the code does not support sending the final SoH reply. This is because the SoH reply (see section 2.2.9 of MS-SOH version v20091104) needs various fields formatted in a manner which is not obvious to me, and I don't currently have access to a windows NAP server to look at a working example. The clients I have access don't seem to mind. Phil Mayers December 2009 freeradius-server/doc/aaa.rst000066400000000000000000000116171257552170400165520ustar00rootroot00000000000000Authorization, Authentication, and Accounting request handling ============================================================== There are a lot of questions about misconfigured FreeRADIUS servers because of misunderstanding of FreeRADIUS operations. This document explains how the server operates. Normally there are 2 steps in processing authentication request coming from NAS in FreeRADIUS (plus additional steps to proxy request if we use FreeRADIUS as a proxy): authorization and authentication. Authorization ------------- Authorization is a process of obtaining information about the user from external source (file, database or LDAP), and checking that the information in request is enough to authenticate user. Authorization modules deal with data sources, so ldap, sql, files, passwd are authorization modules. The authentication method is decided during the authorization phase, along with any reply attributes. The reason for this behaviour is that for example, a user may not be permitted to use a particular authentication method. So during the authorize phase, we can deny them the ability to use that kind of authentication. Authentication -------------- Authentication is simply a process of comparing user's credentials in request with credentials stored in database. Authentication usually deals with password encryption. PAP, CHAP, MS-CHAP are authentication modules. Few modules act as both authorization and authentication. For example, the MS-CHAP module is normally authentication only, but it may be used during authorization to verify that request contains MS-CHAP related attribute and only in this case perform MS-CHAP based authentication. LDAP is normally an authorization module, but it may be used for authentication (In this case FreeRADIUS will authenticate user in case he can connect to LDAP server with his account). SQL is only an authorization module, as dial-in users are not normally given passwords to access an SQL server. Request Processing ------------------ During authorization and authentication processes, there are 3 lists of RADIUS attributes supported by FreeRADIUS: request items, config items and reply items. (See 'man 5 users' for additional information.) Attributes from the RADIUS authentication request packet are included into request items list. Both authorization and authentication modules can add attributes into reply items list. These attributes will be added to reply will be sent by RADIUS server to NAS. There is third list, called config items. It's used for internal FreeRADIUS operations, for example to pass some data from authorization to authentication module. Before authorization begins FreeRADIUS creates request items list with attributes from request and empty config and reply lists. An authorization module searches a database with attributes (e.g. User-Name) taken from request list as a key, and fetches all relevant records. It retrieves 3 types of attributes: check attributes, configure attributes and reply attributes. It compares the check attributes with attributes from request items. If none of database record for this User-Name matches in check attributes with request items authorization will fail. If a matching record is found, then the configure attributes will be added to configure items, and the reply attributes will be added to reply items list. The check list may be required if we need to authenticate users with same name for different services (for example to treat User1 from NAS1 and User1 from NAS2 as different users). There should be at list one configure attribute provided by authorization module, called Auth-Type (since this attribute is from config items list it can't be in request or reply). This attribute decides which module will be used to authenticate the user. The Config items also contains information from database required to authenticate user, for example valid user's password or it's hash, login restrictions, etc. A quite common mistake is to place the attributes in the wrong lists, for example placing Auth-Type, Password, NT-Password etc in the check list, or in the reply list. When run in debugging mode, the server will normally issue 'WARNING' messages saying that the attributes are in the wrong list. If you place Password into check list and user does cleartext authentication it may work, because authorization module compares 2 cleartext passwords. But if user does some encrypted authentication (for example MS-CHAP), then the authorization will fail, because the Password in the request items will not match the password in the check attributes. You should place Password attribute obtained from database into configure items and also place Auth-Type attribute with value of 'MS-CHAP' into same list. The same goes for NT-Password (before calling MS-CHAP Password attribute should be converted to NT-Password, it may be achieved by calling mschap module in authorization section after module which does actual authorization). freeradius-server/doc/ascend000066400000000000000000000036001257552170400164470ustar00rootroot00000000000000 Ascend Radius Options or What happens when a big vendor ignores an RFC FreeRADIUS uses Vendor-Specific attributes to send the Ascend attributes. By default, Ascend NASes send the Ascend specific attributes as NON VSA's, which conflict with new RADIUS attributes assigned by the IETF. This was a very bad screw-up by Ascend that still causes many headaches, but sometimes we have to live with it, so we try to cope the best we can. If you see a large number of messages about invalid Message-Authenticator attribute, you most likely are affected by this problem, and should implement the first option. You have two options: o Enable VSA's on the Ascend/Lucent MAX: This is by far the preferred method ( as it solves many other problems ). Max6000/4000 Series TAOS with Menued Interface: Go to Ethernet->Mod Config->Auth. At the bottom of the menu, change Auth-Compat from "OLD" to "VSA". Save your changes, no reboot is needed. Go to Ethernet->Mod Config->Acct. At the bottom of the menu, change Acct-Compat from "OLD" to "VSA". Save your changes, no reboot is needed. Max TNT/Apex 8000 Series TAOS with CLI: nas> read external-auth nas> set rad-auth-client auth-radius-compat = vendor-specific nas> set rad-acct-client acct-radius-compat = vendor-specific nas> write o Enable OLD attributes in FreeRADIUS One note on this, Ciscos have an Ascend compatibility mode that accepts only the OLD style Ascend attributes, just to make life more interesting. :) You can make FreeRADIUS send the OLD style attributes by prefixing the Ascend attributes with 'X-' in the 'users' file, sql table, ldap directory, attr_filter module, etc... Thus the VSA Ascend attribute: Ascend-Data-Filter becomes the OLD Ascend attribute: X-Ascend-Data-Filter $Id$ freeradius-server/doc/bay000066400000000000000000000007461257552170400157750ustar00rootroot00000000000000 All versions of the BAY software prior to 18.0.2 are broken in regards to the Message-Authenticator. They send a strictly MD5 encoded secret instead of the encoding required by the RFC. This has been fixed in 18.0.2 and only 18.0.2. If you see messages in the radius log like: Received packet from xxx.xxx.xxx.xxx with invalid Message-Authenticator! and you are using a Bay Annex, then you MUST upgrade the software on your Annex. There is NO other solution to the problem. freeradius-server/doc/bugs000066400000000000000000000115141257552170400161550ustar00rootroot00000000000000BUGS 0.INTRODUCTION The FreeRADIUS web site is at , and most information referenced in this document can be found there. This is primarily for non-developers of the FreeRADIUS server. If you are able to patch the code to work correctly, then we invite you to join the development list to discuss it. If you're the type who know little about how to code, then this is the place for you! 1.YOU FOUND A BUG So you think you've found a bug in the FreeRADIUS server? You should first discuss it on the users list, to see if anyone can reproduce it. Often there's a simple explanation of why the server behaves as it does, and it's not necessarily a bug in the code, so browse the lists' archives of the last two months, and if you don't see messages about it, ask! If the behavior is correct but confusing, we think that's a bug too, and you should file a bug against our documentation. For more information about the users list, the lists' archives and the faq, please visit http://www.freeradius.org/list/users.html Please make sure to READ and RESPECT the house-rules. You will get much better response and much faster if you do! 2.CORE DUMPS If the server, or one of the accompyaning programs core dumps, then you should rebuild the server as follows: $ ./configure --enable-developer $ make $ make install and then run the program again. You may have to to enable core dumps, via: $ ulimit -c unlimited When it core dumps, do: $ gdb /path/to/executable /path/to/core/file Enable logging in gdb via the following commands: (gdb) set logging file gdb-radiusd.log (gdb) set logging on and follow the instructions in section 4, below. 3. DEBUGGING A LIVE SERVER If you can't get a core dump, or the problem doesn't result in a core dump, you may have to run the server under gdb. To do this, ensure that you have symbols in the binaries (i.e. a non-stripped binary) by re-building the server as described in the previous section. Then, run the server under gdb as follows: $ gdb radiusd Enable logging in gdb via the following commands: (gdb) set logging file gdb-radiusd.log (gdb) set logging on Tell gdb to pass any necessary command-line arguments to the server: (gdb) set args ... Where the "..." are the command-line arguments you normally pass to radiusd. Fo debugging, you probably want to do: (gdb) set args -f Then, do: (gdb) run When something interesting happens, you can hit CTRL-C in the window, and you should be back at the gdb prompt: (gdb) And follow the instructions in section 4, below. 4. OBTAINING USEFUL INFORMATION If the server was built with threads, you can do: (gdb) info threads Which will give you information about the threads. If the server isn't threaded, that command-line will print a message saying so. Then, do: (gdb) thread apply all bt full If the server isn't threaded, the "thread apply" section isn't necessary The output should be printed to the screen, and also sent to the gdb-radiusd.log file. Copy the log gile and mail it to the list, or put it on a web page if it's too large. Include the name of the operating system. Without this information, it's impossible for anyone to know why the program core dumped. You can also submit the information to the bug database at: http://bugs.freeradius.org/ Submitting it to the bug database ensures that the bug report won't get forgotten, and that someone will eventually respond to it. 5. VALGRIND On Linux systems, "valgrind" is a useful tool that can catch certain classes of bugs. To use it, run the server voa: $ valgrind --tool=memcheck --leak-check=full radiusd -Xm It will print out certain kinds of errors to the screen. There may be a number of errors related to OpenSSL, dlopen(), or libtldl. We cannot do anything about those problems. However, any errors that are inside of the FreeRADIUS source should be brought to our attention. 6. Running with "screen" If the bug is a crash of the server, and it takes a long time for the crash to happen, perform the following steps: * log in as root * open a screen session (http://blogamundo.net/code/screen/) $ screen bash * make sure FreeRADIUS is not running * make sure you have all the debug symbols about, or a debugable version of the server installed * configure screen to log to a file; 'Ctrl-A H' * type 'gdb /path/to/radius' (or /path/to/freeradius on Debian) * at the (gdb) prompt, type 'run -X' * detach from screen 'Ctrl-A D' * when you notice FreeRADIUS has died, reconnect to your screen session $ screen -D -r * at the (gdb) prompt type 'where' or for *lots* of info try 'thread apply all bt full' * tell screen to stop logging, 'Ctrl-A H' * logout from screen -- FreeRADIUS Project, copyright 2008 $Id$ freeradius-server/doc/cisco.rst000066400000000000000000000114711257552170400171260ustar00rootroot00000000000000Cisco IOS and Radius ==================== Introduction ------------ Cisco NAS equipment has become quite popular of late, but being Cisco equipment running IOS, the configuration can be a bit non-obvious to the unfamiliar. This document aims to describe the most common configuration options to make your Ciscos interoperate with radius as you would expect a well-behaved NAS to do. IOS 12.x -------- For Cisco 12.x ( 12.0 and 12.1 ), the following AAA configuration directives are suggested: :: aaa new-model aaa authentication login default group radius local aaa authentication login localauth local aaa authentication ppp default if-needed group radius local aaa authorization exec default group radius local aaa authorization network default group radius local aaa accounting delay-start aaa accounting exec default start-stop group radius aaa accounting network default start-stop group radius aaa processes 6 this configuration works very well with most radius servers. One of the more important configurations is: :: aaa accounting delay-start This directive will delay the sending of the Accounting Start packet until after an IP address has been assigned during the PPP negotiation process. This will supersede the need to enable the sending of "Alive" packets as described below for IOS versions 11.x *Note* with the above it will use the radius server to authenticate your inbound 'telnet' connections. You will need to create an entry in your users file similar to the following to allow access: :: !root Cleartext-Password := "somepass" Service-Type = NAS-Prompt-User This will let a user in for the first level of access to your Cisco. You will still need to 'enable' ( using the locally configured enable secret ) to perform any configuration changes or anything requiring a higher level of access. The username '!root' was used as an example here, you can make this any username you want, of course. Unique Acct-Session-Id's ^^^^^^^^^^^^^^^^^^^^^^^^ From: http://isp-lists.isp-planet.com/isp-australia/0201/msg05143.html Just a note to all cisco ISPs out there who want RFC2866 compliance need to enable the hidden command ``radius-server unique-ident `` Minimum IOS: 12.1(4.1)T. Acct-Session-Id should be unique and wrap after every 256 reboots. You must reboot after entering this command to take effect. If not, you will observe after 10 minutes of entering this command, the following message. :: %RADIUS-3-IDENTFAIL: Save of unique accounting ident aborted. IOS 11.x -------- For Cisco 11.1, you normally use :: aaa new-model aaa authentication ppp radppp if-needed radius aaa authorization network radius none aaa accounting network wait-start radius to get the Cisco to talk to a radius server. With IOS 11.3 ^^^^^^^^^^^^^ :: aaa accounting update newinfo If you want the IP address of the user to show up in the radutmp file (and thus, the output of "radwho"). This is because with IOS 11.3, the Cisco first sends a "Start" accounting packet without the IP address included. By setting "update newinfo" it will send an account "Alive" packet which updates the information. Also you might see a lot of "duplicates" in the logfile. That can be fixed by: :: aaa accounting network wait radius radius-server timeout 3 To disable the Ascend style attributes (which is a VERY good idea!): :: radius-server host X.Y.Z.A auth-port 1645 acct-port 1646 To enable the Ascend style attributes (which we do NOT recommend!): :: radius-server host X.Y.Z.A auth-port 1645 acct-port 1646 non-standard To see Cisco-AVPair attributes in the Cisco debugging log: radius-server vsa accounting Cisco 36xx & 26xx, keeping the NAS IP static -------------------------------------------- The Cisco 36/26 by default selects (it seems at random) any IP address assigned to it (serial, ethernet etc.) as it's RADIUS client source address, thus the access request may be dropped by the RADIUS server, because it can not verify the client. To make the cisco box always use one fixed address, add the following to your configuration: :: ip radius source-interface Loopback0 and configure the loopback interface on your router as follows: :: interface Loopback0 ip address 192.168.0.250 255.255.255.255 Use a real world IP address and check the Cisco documentation for why it is a good idea to have working loopback interface configured on your router. If you don't want to use the loopback interface of course you can set the source-interface to any interface on your Cisco box which has an IP address. Credits ------- Original - Alan DeKok 12.x Info - Chris Parker 2000-10-12 More Information ---------------- For more information, the following page on Cisco's web site may help: http://www.cisco.com/univercd/cc/td/doc/product/access/acs_serv/vapp_dev/vsaig3.htm freeradius-server/doc/coding-methods.rst000066400000000000000000000127571257552170400207420ustar00rootroot00000000000000Helpful coding methods ====================== The following is a short set of guidelines to follow while programming. It does not address coding styles, function naming methods, or debugging methods. Rather, it describes the processes which SHOULD go on in the programmers mind, while he is programming. Coding standards apply to function names, the look of the code, and coding consistency. Coding methods apply to the daily practices used by the programmer to write code. 1. Comment your code. If you don't, you'll be forced to debug it 6 months later, when you have no clue as to what it's doing. If someone REALLY hates you, you'll be forced to debug un-commented code that someone else wrote. You don't want to do that. 2. Give things reasonable names. Variables and functions should have names. Calling them 'x', 'xx', and 'xxx' makes your life hell. Even 'foo' and 'i' are problematic. 3. Check input parameters in the functions you write. Your function CANNOT do anything right if the user passed in garbage, and you were too lazy to check for garbage input. assert() is ugly. Use it. GIGO is wrong. If your function gets garbage input, it should complain loudly and with great descriptiveness. 4. Write useful error messages. "Function failed" is useless as an error message. It makes debugging the code impossible without source-level instrumentation. If you're going to instrument the code at source level for error messages, leave the error messages there, so the next sucker won't have to do the same work all over again. 5. Check error conditions from the functions you call. Your function CANNOT do anything right if you called another function, and they gave you garbage output. One of the most common mistakes is:: fp = fopen(...); fgetc(fp); /* core dumps! */ If the programmer had bothered to check for a NULL fp (error condition), then he could have produced a DESCRIPTIVE error message, instead of having his program core dump. 6. Core dumps are for weenies. If your program core dumps accidentally, you're a bad programmer. You don't know what your program is doing, or what it's supposed to be doing when anything goes wrong. If it hits an assert() and calls abort(), you're a genius. You've thought ahead to what MIGHT go wrong, and put in an assertion to ensure that it fails in a KNOWN MANNER when something DOES go wrong. (As it usually does...) 7. Initialize your variables. memset() is your friend. 'ptr = NULL' is nice, too. Having variables containing garbage values makes it easy for the code to do garbage things. The contents of local variables are inputs to your function. See #3. It's also nearly impossible for you to debug any problems, as you can't tell the variables with garbage values from the real ones. 8. Don't allow buffer over-runs. They're usually accidental, but they cause core dumps. strcpy() and strcat() are ugly. Use them under duress. sizeof() is your friend. 9. 'const' is your friend. If you don't mean to modify an input structure to your function, declare it 'const'. Declare string constants 'const'. It can't hurt, and it allows more errors to be found at compile time. Use 'const' everywhere. Once you throw a few into your code, and have it save you from stupid bugs, you'll blindly throw in 'const' everywhere. It's a life-saver. 10. Use C compiler warnings. Turn on all of the C compiler warnings possible. You might have to turn some off due to broken system header files, though. But the more warnings the merrier. Getting error messages at compile time is much preferable to getting core dumps at run time. See #7. Notice that the C compiler error messages are helpful? You should write error messages like this, too. See #4. 11. Avoid UNIXisms and ASCIIisms and visualisms. You don't know under what system someone will try to run your code. Don't demand that others use the same OS or character set as you use. Never assign numbers to pointers. If foo is a char*, and you want it to be be null, assign NULL, not 0. The zeroth location is perfectly as addressable as any other on plenty of OSes. Not all the world runs on Unix (though it should :) ). Another common mistake is to assume that the zeroth character in the character set is the string terminator. Instead of terminating a string with 0, use '\0', which is always right. Similarly, memset() with the appropriate value: NULL, '\0', or 0 for pointers, chars, and numbers. Don't put tabs in string constants, either. Always use '\t' to represent a tab, instead of ASCII 9. Literal tabs are presented to readers of your code as arbitrary whitespace, and it's easy to mess up. 12. Make conditionals explicit. Though it's legal to test "if (foo){}", if you test against the appropriate value (like NULL or '\0'), your code is prettier and easier for others to read without having to eyeball your prototypes continuously to figure out what you're doing (especially if your variables aren't well-named). See #2. 13. Test your code. Even Donald Knuth writes buggy code. You'll never find all of the bugs in your code unless you write a test program for it. This also means that you'll have to write your code so that it will be easily testable. As a result, it will look better, and be easier to debug. freeradius-server/doc/configurable_failover.rst000066400000000000000000000377271257552170400223710ustar00rootroot00000000000000Configurable Module Fail Over ============================= Before configurable module failover, we had this kind of entry in ``radiusd.conf``: :: #--- authorize { preprocess files } #--- This entry instructed the ``authorize`` section to first process the request through the ``preprocess`` module, and if that returned success, to process it through ``files`` module. If that sequence returned success, then the ``authorize`` stage itself would then return success. Processing was strictly linear and if one module failed, the whole section would fail immediately. Configurable failover provides more flexibility. It takes advantage of the tree structure of radiusd.conf to support a configuration language that allows you to ``group`` modules that should work together in ways other than simple lists. You can control the flow of any stage (e.g. ``authorize``) to fit your needs, without touching C code, just by altering radiusd.conf. This configurable fail-over has a convenient short-hand, too. Administrators commonly want to say things like "try SQL1, if it's down, try SQL2, otherwise drop the request." For example: :: #--- modules { sql sql1 { # configuration to connect to SQL database one } sql sql2 { # configuration to connect to SQL database two } always handled { rcode = handled } } # Handle accounting packets accounting { detail # always log to detail, stopping if it fails redundant { sql1 # try module sql1 sql2 # if that's down, try module sql2 handled # otherwise drop the request as # it's been ``handled`` by the ``always`` # module (see doc/rlm_always) } } #--- The ``redundant`` section is a configuration directive which tells the server to process the second module if the first one fails. Any number of modules can be listed in a ``redundant`` section. The server will process each in turn, until one of the modules succeeds. It will then stop processing the ``redundant`` list. Rewriting results for single modules ------------------------------------ Normally, when a module fails, the entire section (``authorize``, ``accounting``, etc.) stops being processed. In some cases, we may want to permit "soft failures". That is, we may want to tell the server that it is "ok" for a module to fail, and that the failure should not be treated as a fatal error. In this case, the module is treated as a "section", rather than just as a single lne in ``radiusd.conf``. The configuration entries for that section are taken from the ``configurable fail-over`` code, and not from the configuration information for that module. For example, the ``detail`` module normally returns ``fail`` if it is unable to write its information to the ``detail`` file. As a test, we can configure the server so that it continues processing the request, even if the ``detail`` module fails. The following example shows how: :: #-- # Handle accounting packets accounting { detail { fail = 1 } redundant { sql1 sql2 handled } } #-- The ``fail = 1`` entry tells the server to remember the ``fail`` code, with priority ``1``. The normal configuration is ``fail = return``, which means ``if the detail module fails, stop processing the accounting section``. Fail-over configuration entries ------------------------------- Modules normally return on of the following codes as their result: +-----------+-----------------------------------------------------+ |Code | Meaning | +===========+=====================================================+ |notfound | the user was not found | +-----------+-----------------------------------------------------+ |noop | the module did nothing | +-----------+-----------------------------------------------------+ |ok | the module succeeded | +-----------+-----------------------------------------------------+ |updated | the module updated information in the request | +-----------+-----------------------------------------------------+ |fail | the module failed | +-----------+-----------------------------------------------------+ |reject | the module rejected the user | +-----------+-----------------------------------------------------+ |userlock | the user was locked out | +-----------+-----------------------------------------------------+ |invalid | the user's configuration entry was invalid | +-----------+-----------------------------------------------------+ |handled | the module has done everything to handle the request| +-----------+-----------------------------------------------------+ In a configurable fail-over section, each of these codes may be listed, with a value. If the code is not listed, or a configurable fail-over section is not defined, then values that make sense for the requested ``group`` (group, redundant, load-balance, etc) are used. The special code ``default`` can be used to set all return codes to the specified value. This value will be used with a lower priority than ones that are explicitly set. The values for each code may be one of two things: +---------+---------------------------------------------------------------+ |Value | Meaning | +=========+===============================================================+ | | Priority for this return code. | +---------+---------------------------------------------------------------+ |return | Stop processing this configurable fail-over list. | +---------+---------------------------------------------------------------+ |reject | Stop processing this configurable fail-over list and | | | immediately return a reject. | +---------+---------------------------------------------------------------+ The ```` used for a value may be any decimal number between 1 and 99999. The number is used when processing a list of modules, to determine which code is returned from the list. For example, if ``module1`` returns ``fail`` with priority ``1``, and a later ``module2`` returns ``ok`` with priority ``3``, the return code from the list of modules will be ``ok``, because it has higher priority than ``fail``. This configurability allows the administrator to permit some modules to fail, so long as a later module succeeds. More Complex Configurations --------------------------- The ``authorize`` section is normally a list of module names. We can create sub-lists by using the section name ``group``. The ``redundant`` section above is just a short-hand for ``group``, with a set of default return codes, which are different than the normal ``stop processing the list on failure``. For example, we can configure two detail modules, and allow either to fail, so long as one of them succeeds. :: #-- # Handle accounting packets accounting { group { detail1 { fail = 1 # remember ``fail`` with priority 1 ok = return # if we succeed, don't do ``detail2`` } detail2 { fail = 1 # remember ``fail`` with priority 1 ok = return # if we succeed, return ``ok`` # if ``detail1`` returned ``fail`` } } # returns ``fail`` only if BOTH modules returned ``fail`` redundant { sql1 sql2 handled } } #-- This configuration says: - log to ``detail1``, and stop processing the ``group`` list if ``detail1`` returned OK. - If ``detail1`` returned ``fail``, then continue, but remember the ``fail`` code, with priority 1. - If ``detail2`` fails, then remember ``fail`` with priority 1. - If ``detail2`` returned ``ok``, return ``ok`` from the ``group``. The return code from the ``group`` is the return code which was either forced to return (e.g. ``ok`` for ``detail1``), or the highest priority return code found by processing the list. This process can be extended to any number of modules listed in a ``group`` section. Virtual Modules --------------- Some configurations may require using the same list of modules, in the same order, in multiple sections. For those systems, the configuration can be simplified through the use of ``virtual`` modules. These modules are configured as named sub-sections of the ``instantiate`` section, as follows: :: instantiate { ... redundant sql1_or_2 { sql1 sql2 } } The name ``sql1_or_2`` can then be used in any other section, such as ``authorize`` or ``accounting``. The result will be *exactly* as if that section was placed at the location of the ``sql1_or_2`` reference. These virtual modules are full-fledged objects in and of themselves. One virtual module can refer to another virtual module, and they can contain ``if`` conditions, or any other configuration permitted in a section. Redundancy and Load-Balancing ----------------------------- See ``man unlang`` or ``doc/load-balance`` for information on simple redundancy (fail-over) and load balancing. The Gory Details ----------------- The fundamental object is called a MODCALLABLE, because it is something that can be passed a specific radius request and returns one of the RLM_MODULE_* results. It is a function - if you can accept the fact that pieces of radiusd.conf are functions. There are two kinds of MODCALLABLEs: GROUPs and SINGLEs. A SINGLE is a reference to a module instance that was set up in the modules{} section of radiusd.conf, like ``preprocess`` or ``sql1``. When a SINGLE is called, the corresponding function in the rlm is invoked, and whichever RLM_MODULE_* it returns becomes the RESULT of the SINGLE. A GROUP is a section of radiusd.conf that includes some MODCALLABLEs. Examples of GROUPs above include ``authorize{...}``, which implements the C function module_authorize, and ``redundant{...}``, which contains two SINGLEs that refer to a couple of redundant databases. Note that a GROUP can contain other GROUPs - ``Auth-Type SQL{...}`` is also a GROUP, which implements the C function module_authenticate when Auth-Type is set to SQL. Now here's the fun part - what happens when a GROUP is called? It simply runs through all of its children in order, and calls each one, whether it is another GROUP or a SINGLE. It then looks at the RESULT of that child, and takes some ACTION, which is basically either ``return that RESULT immediately`` or ``Keep going``. In the first example, any ``bad`` RESULT from the preprocess module causes an immediate return, and any ``good`` RESULT causes the authorize{...} GROUP to proceed to the files module. We can see the exact rules by writing them out the long way: :: authorize { preprocess { notfound = 1 noop = 2 ok = 3 updated = 4 fail = return reject = return userlock = return invalid = return handled = return } files { notfound = 1 noop = 2 ok = 3 updated = 4 fail = return reject = return userlock = return invalid = return handled = return } } This is the same as the first example, with the behavior explicitly spelled out. Each SINGLE becomes its own section, containing a list of RESULTs that it may return and what ACTION should follow from them. So preprocess is called, and if it returns for example RLM_MODULE_REJECT, then the reject=return rule is applied, and the authorize{...} GROUP itself immediately returns RLM_MODULE_REJECT. If preprocess returns RLM_MODULE_NOOP, the corresponding ACTION is ``2``. An integer ACTION serves two purposes - first, it tells the parent GROUP to go on to the next module. Second, it is a hint as to how desirable this RESULT is as a candidate for the GROUP's own RESULT. So files is called... suppose it returns RLM_MODULE_NOTFOUND. The ACTION for notfound inside the files{...} block is ``1``. We have now reached the end of the authorize{...} GROUP and we look at the RESULTs we accumulated along the way - there is a noop with preference level 2, and a notfound with preference level 1, so the authorize{...} GROUP as a whole returns RLM_MODULE_NOOP, which makes sense because to say the user was not found at all would be a lie, since preprocess apparently found him, or else it would have returned RLM_MODULE_NOTFOUND too. We could use the ``default`` code to simplify the above example a little. The following two configurations are identical: :: files { notfound = 1 noop = 2 ok = 3 updated = 4 default = return } When putting the ``default`` first, later definitions over-ride it's return code: :: files { default = return notfound = 1 noop = 2 ok = 3 updated = 4 } [Take a deep breath - the worst is over] That RESULT preference/desirability stuff is pretty complex, but my hope is that it will be complex enough to handle the needs of everyone's real-world imperfect systems, while staying out of sight most of the time since the defaults will be right for the most common configurations. So where does redundant{...} fit in with all that? Well, redundant{...} is simply a group that changes the default ACTIONs to something like :: fail = 1 everythingelse = return so that when one module fails, we keep trying until we find one that doesn't fail, then return whatever it returned. And at the end, if they all failed, the redundant GROUP as a whole returns RLM_MODULE_FAIL, just as you'd want it to (I hope). There are two other kinds of grouping: ``group{...}`` which does not have any specialized default ACTIONs, and ``append{...}``, which should be used when you have separate but similarly structured databases that are guaranteed not to overlap. That's all that really needs to be said. But now a few random notes: GROUPs may have RESULT=ACTION ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ It would look like this: :: authorize { preprocess redundant { sql1 sql2 notfound = return } files } which would prevent ``files`` from being called if neither of the SQL instances could find the user. redundant{...} and append{...} are just shortcuts ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ You could write: :: group { sql1 { fail = 1 notfound = 2 noop = return ok = return updated = return reject = return userlock = return invalid = return handled = return } sql2 { fail = 1 notfound = 2 noop = return ok = return updated = return reject = return userlock = return invalid = return handled = return } } instead of redundant { sql1 sql2 } but the latter is just a whole lot easier to read. ``authenticate{...}`` is not a GROUP ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ even though it contains a list of ``Auth-Type`` GROUPs, because its semantics are totally different - it uses ``Auth-Type`` to decide which of its members to call, and their order is irrelevant. The default rules are context-sensitive ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ For ``authorize``, the defaults are what you saw above - notfound, noop, ok, and updated are considered success, and anything else has an ACTION of ``return``. For authenticate, the default is to return on success *or* reject, and only try the second and following items if the first one fails. You can read all the default ACTIONs in modcall.c (int defaultactions[][][]), or just trust me. They do the right thing. There are some rules that can't be implemented in this language ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ things like ``notfound = 1-reject``, ``noop = 2-ok``, ``ok = 3-ok``, etc. But I don't feel justified adding that complexity in the first draft. There are already enough things here that may never see real-world usage. Like append{...} -- Pac. 9/18/2000 freeradius-server/doc/examples/000077500000000000000000000000001257552170400171065ustar00rootroot00000000000000freeradius-server/doc/examples/Makefile000066400000000000000000000004621257552170400205500ustar00rootroot00000000000000# # Makefile # # Version: $Id$ # include ../../Make.inc all: clean: @rm -f *~ install: $(INSTALL) -d -m 755 $(R)$(docdir)/examples for file in *[!~]; do \ if [ -f $$file -a $$file != Makefile ]; then \ $(INSTALL) -m 644 $$file $(R)$(docdir)/examples; \ fi; \ done .PHONY: all clean install freeradius-server/doc/examples/iplanet.ldif000066400000000000000000000255171257552170400214140ustar00rootroot00000000000000# This is a LDAPv3 schema for RADIUS attributes. # Converted for use with iPlanet/Sun Directory Servers 5.x by Arne Brutschy # # Originally Tested on OpenLDAP 2.0.7 # Posted by Javier Fernandez-Sanguino Pena # LDAP v3 version by Jochen Friedrich # Updates by Adrian Pavlykevych ############## dn: cn=schema attributeTypes: ( 1.3.6.1.4.1.3317.4.3.1.1 NAME 'radiusArapFeatures' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) attributeTypes: ( 1.3.6.1.4.1.3317.4.3.1.2 NAME 'radiusArapSecurity' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) attributeTypes: ( 1.3.6.1.4.1.3317.4.3.1.3 NAME 'radiusArapZoneAccess' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) attributeTypes: ( 1.3.6.1.4.1.3317.4.3.1.44 NAME 'radiusAuthType' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) attributeTypes: ( 1.3.6.1.4.1.3317.4.3.1.4 NAME 'radiusCallbackId' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) attributeTypes: ( 1.3.6.1.4.1.3317.4.3.1.5 NAME 'radiusCallbackNumber' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) attributeTypes: ( 1.3.6.1.4.1.3317.4.3.1.6 NAME 'radiusCalledStationId' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) attributeTypes: ( 1.3.6.1.4.1.3317.4.3.1.7 NAME 'radiusCallingStationId' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) attributeTypes: ( 1.3.6.1.4.1.3317.4.3.1.8 NAME 'radiusClass' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 ) attributeTypes: ( 1.3.6.1.4.1.3317.4.3.1.45 NAME 'radiusClientIPAddress' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) attributeTypes: ( 1.3.6.1.4.1.3317.4.3.1.9 NAME 'radiusFilterId' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) attributeTypes: ( 1.3.6.1.4.1.3317.4.3.1.10 NAME 'radiusFramedAppleTalkLink' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) attributeTypes: ( 1.3.6.1.4.1.3317.4.3.1.11 NAME 'radiusFramedAppleTalkNetwork' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) attributeTypes: ( 1.3.6.1.4.1.3317.4.3.1.12 NAME 'radiusFramedAppleTalkZone' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) attributeTypes: ( 1.3.6.1.4.1.3317.4.3.1.13 NAME 'radiusFramedCompression' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) attributeTypes: ( 1.3.6.1.4.1.3317.4.3.1.14 NAME 'radiusFramedIPAddress' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) attributeTypes: ( 1.3.6.1.4.1.3317.4.3.1.15 NAME 'radiusFramedIPNetmask' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) attributeTypes: ( 1.3.6.1.4.1.3317.4.3.1.16 NAME 'radiusFramedIPXNetwork' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) attributeTypes: ( 1.3.6.1.4.1.3317.4.3.1.17 NAME 'radiusFramedMTU' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) attributeTypes: ( 1.3.6.1.4.1.3317.4.3.1.18 NAME 'radiusFramedProtocol' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) attributeTypes: ( 1.3.6.1.4.1.3317.4.3.1.19 NAME 'radiusFramedRoute' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 ) attributeTypes: ( 1.3.6.1.4.1.3317.4.3.1.20 NAME 'radiusFramedRouting' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) attributeTypes: ( 1.3.6.1.4.1.3317.4.3.1.46 NAME 'radiusGroupName' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 ) attributeTypes: ( 1.3.6.1.4.1.3317.4.3.1.47 NAME 'radiusHint' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) attributeTypes: ( 1.3.6.1.4.1.3317.4.3.1.48 NAME 'radiusHuntgroupName' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 ) attributeTypes: ( 1.3.6.1.4.1.3317.4.3.1.21 NAME 'radiusIdleTimeout' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) attributeTypes: ( 1.3.6.1.4.1.3317.4.3.1.22 NAME 'radiusLoginIPHost' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) attributeTypes: ( 1.3.6.1.4.1.3317.4.3.1.23 NAME 'radiusLoginLATGroup' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) attributeTypes: ( 1.3.6.1.4.1.3317.4.3.1.24 NAME 'radiusLoginLATNode' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) attributeTypes: ( 1.3.6.1.4.1.3317.4.3.1.25 NAME 'radiusLoginLATPort' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) attributeTypes: ( 1.3.6.1.4.1.3317.4.3.1.26 NAME 'radiusLoginLATService' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) attributeTypes: ( 1.3.6.1.4.1.3317.4.3.1.27 NAME 'radiusLoginService' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) attributeTypes: ( 1.3.6.1.4.1.3317.4.3.1.28 NAME 'radiusLoginTCPPort' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) attributeTypes: ( 1.3.6.1.4.1.3317.4.3.1.29 NAME 'radiusPasswordRetry' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) attributeTypes: ( 1.3.6.1.4.1.3317.4.3.1.30 NAME 'radiusPortLimit' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) attributeTypes: ( 1.3.6.1.4.1.3317.4.3.1.49 NAME 'radiusProfileDn' DESC '' EQUALITY distinguishedNameMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE ) attributeTypes: ( 1.3.6.1.4.1.3317.4.3.1.31 NAME 'radiusPrompt' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) attributeTypes: ( 1.3.6.1.4.1.3317.4.3.1.50 NAME 'radiusProxyToRealm' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) attributeTypes: ( 1.3.6.1.4.1.3317.4.3.1.51 NAME 'radiusReplicateToRealm' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) attributeTypes: ( 1.3.6.1.4.1.3317.4.3.1.52 NAME 'radiusRealm' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) attributeTypes: ( 1.3.6.1.4.1.3317.4.3.1.32 NAME 'radiusServiceType' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) attributeTypes: ( 1.3.6.1.4.1.3317.4.3.1.33 NAME 'radiusSessionTimeout' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) attributeTypes: ( 1.3.6.1.4.1.3317.4.3.1.34 NAME 'radiusTerminationAction' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) attributeTypes: ( 1.3.6.1.4.1.3317.4.3.1.35 NAME 'radiusTunnelAssignmentId' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 ) attributeTypes: ( 1.3.6.1.4.1.3317.4.3.1.36 NAME 'radiusTunnelMediumType' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 ) attributeTypes: ( 1.3.6.1.4.1.3317.4.3.1.37 NAME 'radiusTunnelPassword' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) attributeTypes: ( 1.3.6.1.4.1.3317.4.3.1.38 NAME 'radiusTunnelPreference' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 ) attributeTypes: ( 1.3.6.1.4.1.3317.4.3.1.39 NAME 'radiusTunnelPrivateGroupId' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 ) attributeTypes: ( 1.3.6.1.4.1.3317.4.3.1.40 NAME 'radiusTunnelServerEndpoint' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 ) attributeTypes: ( 1.3.6.1.4.1.3317.4.3.1.41 NAME 'radiusTunnelType' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 ) attributeTypes: ( 1.3.6.1.4.1.3317.4.3.1.42 NAME 'radiusVSA' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 ) attributeTypes: ( 1.3.6.1.4.1.3317.4.3.1.43 NAME 'radiusTunnelClientEndpoint' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 ) #need to change asn1.id attributeTypes: ( 1.3.6.1.4.1.3317.4.3.1.53 NAME 'radiusSimultaneousUse' DESC '' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE ) attributeTypes: ( 1.3.6.1.4.1.3317.4.3.1.54 NAME 'radiusLoginTime' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) attributeTypes: ( 1.3.6.1.4.1.3317.4.3.1.55 NAME 'radiusUserCategory' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) attributeTypes: ( 1.3.6.1.4.1.3317.4.3.1.56 NAME 'radiusStripUserName' DESC '' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE ) attributeTypes: ( 1.3.6.1.4.1.3317.4.3.1.57 NAME 'dialupAccess' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) attributeTypes: ( 1.3.6.1.4.1.3317.4.3.1.58 NAME 'radiusExpiration' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) attributeTypes: ( 1.3.6.1.4.1.3317.4.3.1.59 NAME 'radiusCheckItem' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 ) attributeTypes: ( 1.3.6.1.4.1.3317.4.3.1.60 NAME 'radiusReplyItem' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 ) objectClasses: ( 1.3.6.1.4.1.3317.4.3.2.1 NAME 'radiusprofile' DESC '' SUP top AUXILIARY MUST ( cn ) MAY ( radiusArapFeatures $ radiusArapSecurity $ radiusArapZoneAccess $ radiusAuthType $ radiusCallbackId $ radiusCallbackNumber $ radiusCalledStationId $ radiusCallingStationId $ radiusClass $ radiusClientIPAddress $ radiusFilterId $ radiusFramedAppleTalkLink $ radiusFramedAppleTalkNetwork $ radiusFramedAppleTalkZone $ radiusFramedCompression $ radiusFramedIPAddress $ radiusFramedIPNetmask $ radiusFramedIPXNetwork $ radiusFramedMTU $ radiusFramedProtocol $ radiusCheckItem $ radiusReplyItem $ radiusFramedRoute $ radiusFramedRouting $ radiusIdleTimeout $ radiusGroupName $ radiusHint $ radiusHuntgroupName $ radiusLoginIPHost $ radiusLoginLATGroup $ radiusLoginLATNode $ radiusLoginLATPort $ radiusLoginLATService $ radiusLoginService $ radiusLoginTCPPort $ radiusLoginTime $ radiusPasswordRetry $ radiusPortLimit $ radiusPrompt $ radiusProxyToRealm $ radiusRealm $ radiusReplicateToRealm $ radiusServiceType $ radiusSessionTimeout $ radiusStripUserName $ radiusTerminationAction $ radiusTunnelClientEndpoint $ radiusProfileDn $ radiusSimultaneousUse $ radiusTunnelAssignmentId $ radiusTunnelMediumType $ radiusTunnelPassword $ radiusTunnelPreference $ radiusTunnelPrivateGroupId $ radiusTunnelServerEndpoint $ radiusTunnelType $ radiusUserCategory $ radiusVSA $ radiusExpiration $ dialupAccess ) ) freeradius-server/doc/examples/iplanet.schema000066400000000000000000000302441257552170400217270ustar00rootroot00000000000000# This is a LDAPv3 schema for RADIUS attributes. # Tested on Sun One Directory server 5.2 # Created by Daniel Wilson (danielwilson_2k@yahoo.com) ############## dn: cn=schema objectClass: top objectClass: ldapSubentry objectClass: subschema cn: schema ####################### # aci to ensure that the standard schema attributes are visible to # all LDAP clients (anonymous access). # aci: (target="ldap:///cn=schema")(targetattr !="aci")(version 3.0;acl "anonymous, no acis"; allow (read, search, compare) userdn = "ldap:///anyone"; ####################### objectClasses: ( 1.3.6.1.4.1.3317.4.3.2.1 NAME 'radiusprofile' SUP top AUXILIARY DESC 'Free Radius schema for Directory Server 5.2' MUST (cn) MAY ( radiusArapFeatures $ radiusArapSecurity $ radiusArapZoneAccess $ radiusAuthType $ radiusCallbackId $ radiusCallbackNumber $ radiusCalledStationId $ radiusCallingStationId $ radiusClass $ radiusClientIPAddress $ radiusFilterId $ radiusFramedAppleTalkLink $ radiusFramedAppleTalkNetwork $ radiusFramedAppleTalkZone $ radiusFramedCompression $ radiusFramedIPAddress $ radiusFramedIPNetmask $ radiusFramedIPXNetwork $ radiusFramedMTU $ radiusFramedProtocol $ radiusCheckItem $ radiusReplyItem $ radiusFramedRoute $ radiusFramedRouting $ radiusIdleTimeout $ radiusGroupName $ radiusHint $ radiusHuntgroupName $ radiusLoginIPHost $ radiusLoginLATGroup $ radiusLoginLATNode $ radiusLoginLATPort $ radiusLoginLATService $ radiusLoginService $ radiusLoginTCPPort $ radiusLoginTime $ radiusPasswordRetry $ radiusPortLimit $ radiusPrompt $ radiusProxyToRealm $ radiusRealm $ radiusReplicateToRealm $ radiusServiceType $ radiusSessionTimeout $ radiusStripUserName $ radiusTerminationAction $ radiusTunnelClientEndpoint $ radiusProfileDn $ radiusSimultaneousUse $ radiusTunnelAssignmentId $ radiusTunnelMediumType $ radiusTunnelPassword $ radiusTunnelPreference $ radiusTunnelPrivateGroupId $ radiusTunnelServerEndpoint $ radiusTunnelType $ radiusUserCategory $ radiusVSA $ radiusExpiration $ dialupAccess) X-ORIGIN 'user defined') attributeTypes: ( 1.3.6.1.4.1.3317.4.3.1.1 NAME 'radiusArapFeatures' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE X-ORIGIN 'user defined') attributeTypes: ( 1.3.6.1.4.1.3317.4.3.1.2 NAME 'radiusArapSecurity' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE X-ORIGIN 'user defined') attributeTypes: ( 1.3.6.1.4.1.3317.4.3.1.3 NAME 'radiusArapZoneAccess' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE X-ORIGIN 'user defined') attributeTypes: ( 1.3.6.1.4.1.3317.4.3.1.44 NAME 'radiusAuthType' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE X-ORIGIN 'user defined' ) attributeTypes: ( 1.3.6.1.4.1.3317.4.3.1.4 NAME 'radiusCallbackId' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE X-ORIGIN 'user defined' ) attributeTypes: ( 1.3.6.1.4.1.3317.4.3.1.5 NAME 'radiusCallbackNumber' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE X-ORIGIN 'user defined' ) attributeTypes: ( 1.3.6.1.4.1.3317.4.3.1.6 NAME 'radiusCalledStationId' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE X-ORIGIN 'user defined' ) attributeTypes: ( 1.3.6.1.4.1.3317.4.3.1.7 NAME 'radiusCallingStationId' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE X-ORIGIN 'user defined' ) attributeTypes: ( 1.3.6.1.4.1.3317.4.3.1.8 NAME 'radiusClass' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 ) attributeTypes: ( 1.3.6.1.4.1.3317.4.3.1.45 NAME 'radiusClientIPAddress' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE X-ORIGIN 'user defined' ) attributeTypes: ( 1.3.6.1.4.1.3317.4.3.1.9 NAME 'radiusFilterId' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE X-ORIGIN 'user defined' ) attributeTypes: ( 1.3.6.1.4.1.3317.4.3.1.10 NAME 'radiusFramedAppleTalkLink' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE X-ORIGIN 'user defined' ) attributeTypes: ( 1.3.6.1.4.1.3317.4.3.1.11 NAME 'radiusFramedAppleTalkNetwork' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE X-ORIGIN 'user defined' ) attributeTypes: ( 1.3.6.1.4.1.3317.4.3.1.12 NAME 'radiusFramedAppleTalkZone' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE X-ORIGIN 'user defined' ) attributeTypes: ( 1.3.6.1.4.1.3317.4.3.1.13 NAME 'radiusFramedCompression' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE X-ORIGIN 'user defined' ) attributeTypes: ( 1.3.6.1.4.1.3317.4.3.1.14 NAME 'radiusFramedIPAddress' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE X-ORIGIN 'user defined' ) attributeTypes: ( 1.3.6.1.4.1.3317.4.3.1.15 NAME 'radiusFramedIPNetmask' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE X-ORIGIN 'user defined' ) attributeTypes: ( 1.3.6.1.4.1.3317.4.3.1.16 NAME 'radiusFramedIPXNetwork' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE X-ORIGIN 'user defined' ) attributeTypes: ( 1.3.6.1.4.1.3317.4.3.1.17 NAME 'radiusFramedMTU' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE X-ORIGIN 'user defined' ) attributeTypes: ( 1.3.6.1.4.1.3317.4.3.1.18 NAME 'radiusFramedProtocol' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE X-ORIGIN 'user defined' ) attributeTypes: ( 1.3.6.1.4.1.3317.4.3.1.19 NAME 'radiusFramedRoute' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 ) attributeTypes: ( 1.3.6.1.4.1.3317.4.3.1.20 NAME 'radiusFramedRouting' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE X-ORIGIN 'user defined' ) attributeTypes: ( 1.3.6.1.4.1.3317.4.3.1.46 NAME 'radiusGroupName' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 ) attributeTypes: ( 1.3.6.1.4.1.3317.4.3.1.47 NAME 'radiusHint' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE X-ORIGIN 'user defined' ) attributeTypes: ( 1.3.6.1.4.1.3317.4.3.1.48 NAME 'radiusHuntgroupName' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 ) attributeTypes: ( 1.3.6.1.4.1.3317.4.3.1.21 NAME 'radiusIdleTimeout' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE X-ORIGIN 'user defined' ) attributeTypes: ( 1.3.6.1.4.1.3317.4.3.1.22 NAME 'radiusLoginIPHost' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE X-ORIGIN 'user defined' ) attributeTypes: ( 1.3.6.1.4.1.3317.4.3.1.23 NAME 'radiusLoginLATGroup' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE X-ORIGIN 'user defined' ) attributeTypes: ( 1.3.6.1.4.1.3317.4.3.1.24 NAME 'radiusLoginLATNode' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE X-ORIGIN 'user defined' ) attributeTypes: ( 1.3.6.1.4.1.3317.4.3.1.25 NAME 'radiusLoginLATPort' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE X-ORIGIN 'user defined' ) attributeTypes: ( 1.3.6.1.4.1.3317.4.3.1.26 NAME 'radiusLoginLATService' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE X-ORIGIN 'user defined' ) attributeTypes: ( 1.3.6.1.4.1.3317.4.3.1.27 NAME 'radiusLoginService' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE X-ORIGIN 'user defined' ) attributeTypes: ( 1.3.6.1.4.1.3317.4.3.1.28 NAME 'radiusLoginTCPPort' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE X-ORIGIN 'user defined' ) attributeTypes: ( 1.3.6.1.4.1.3317.4.3.1.29 NAME 'radiusPasswordRetry' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE X-ORIGIN 'user defined' ) attributeTypes: ( 1.3.6.1.4.1.3317.4.3.1.30 NAME 'radiusPortLimit' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE X-ORIGIN 'user defined' ) attributeTypes: ( 1.3.6.1.4.1.3317.4.3.1.49 NAME 'radiusProfileDn' DESC '' EQUALITY distinguishedNameMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE X-ORIGIN 'user defined' ) attributeTypes: ( 1.3.6.1.4.1.3317.4.3.1.31 NAME 'radiusPrompt' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE X-ORIGIN 'user defined' ) attributeTypes: ( 1.3.6.1.4.1.3317.4.3.1.50 NAME 'radiusProxyToRealm' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE X-ORIGIN 'user defined' ) attributeTypes: ( 1.3.6.1.4.1.3317.4.3.1.51 NAME 'radiusReplicateToRealm' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE X-ORIGIN 'user defined' ) attributeTypes: ( 1.3.6.1.4.1.3317.4.3.1.52 NAME 'radiusRealm' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE X-ORIGIN 'user defined' ) attributeTypes: ( 1.3.6.1.4.1.3317.4.3.1.32 NAME 'radiusServiceType' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE X-ORIGIN 'user defined' ) attributeTypes: ( 1.3.6.1.4.1.3317.4.3.1.33 NAME 'radiusSessionTimeout' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE X-ORIGIN 'user defined' ) attributeTypes: ( 1.3.6.1.4.1.3317.4.3.1.34 NAME 'radiusTerminationAction' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE X-ORIGIN 'user defined' ) attributeTypes: ( 1.3.6.1.4.1.3317.4.3.1.35 NAME 'radiusTunnelAssignmentId' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 ) attributeTypes: ( 1.3.6.1.4.1.3317.4.3.1.36 NAME 'radiusTunnelMediumType' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 ) attributeTypes: ( 1.3.6.1.4.1.3317.4.3.1.37 NAME 'radiusTunnelPassword' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE X-ORIGIN 'user defined' ) attributeTypes: ( 1.3.6.1.4.1.3317.4.3.1.38 NAME 'radiusTunnelPreference' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 ) attributeTypes: ( 1.3.6.1.4.1.3317.4.3.1.39 NAME 'radiusTunnelPrivateGroupId' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 ) attributeTypes: ( 1.3.6.1.4.1.3317.4.3.1.40 NAME 'radiusTunnelServerEndpoint' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 ) attributeTypes: ( 1.3.6.1.4.1.3317.4.3.1.41 NAME 'radiusTunnelType' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 ) attributeTypes: ( 1.3.6.1.4.1.3317.4.3.1.42 NAME 'radiusVSA' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 ) attributeTypes: ( 1.3.6.1.4.1.3317.4.3.1.43 NAME 'radiusTunnelClientEndpoint' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 ) attributeTypes: ( 1.3.6.1.4.1.3317.4.3.1.53 NAME 'radiusSimultaneousUse' DESC '' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-ORIGIN 'user defined' ) attributeTypes: ( 1.3.6.1.4.1.3317.4.3.1.54 NAME 'radiusLoginTime' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE X-ORIGIN 'user defined' ) attributeTypes: ( 1.3.6.1.4.1.3317.4.3.1.55 NAME 'radiusUserCategory' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE X-ORIGIN 'user defined' ) attributeTypes: ( 1.3.6.1.4.1.3317.4.3.1.56 NAME 'radiusStripUserName' DESC '' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE X-ORIGIN 'user defined' ) attributeTypes: ( 1.3.6.1.4.1.3317.4.3.1.57 NAME 'dialupAccess' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE X-ORIGIN 'user defined' ) attributeTypes: ( 1.3.6.1.4.1.3317.4.3.1.58 NAME 'radiusExpiration' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE X-ORIGIN 'user defined' ) attributeTypes: ( 1.3.6.1.4.1.3317.4.3.1.59 NAME 'radiusCheckItem' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 ) attributeTypes: ( 1.3.6.1.4.1.3317.4.3.1.60 NAME 'radiusReplyItem' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 ) freeradius-server/doc/examples/openldap.schema000066400000000000000000000345461257552170400221060ustar00rootroot00000000000000# This is a LDAPv3 schema for RADIUS attributes. # Tested on OpenLDAP 2.0.7 # Posted by Javier Fernandez-Sanguino Pena # LDAP v3 version by Jochen Friedrich # Updates by Adrian Pavlykevych ############## attributetype ( 1.3.6.1.4.1.3317.4.3.1.1 NAME 'radiusArapFeatures' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.3317.4.3.1.2 NAME 'radiusArapSecurity' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.3317.4.3.1.3 NAME 'radiusArapZoneAccess' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.3317.4.3.1.44 NAME 'radiusAuthType' DESC 'checkItem: Auth-Type' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.3317.4.3.1.4 NAME 'radiusCallbackId' DESC 'replyItem: Callback-Id' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.3317.4.3.1.5 NAME 'radiusCallbackNumber' DESC 'replyItem: Callback-Number' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.3317.4.3.1.6 NAME 'radiusCalledStationId' DESC 'checkItem: Called-Station-Id' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.3317.4.3.1.7 NAME 'radiusCallingStationId' DESC 'checkItem: Calling-Station-Id' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.3317.4.3.1.8 NAME 'radiusClass' DESC 'replyItem: Class' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 ) attributetype ( 1.3.6.1.4.1.3317.4.3.1.45 NAME 'radiusClientIPAddress' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.3317.4.3.1.9 NAME 'radiusFilterId' DESC 'replyItem: Filter-Id' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 ) attributetype ( 1.3.6.1.4.1.3317.4.3.1.10 NAME 'radiusFramedAppleTalkLink' DESC 'replyItem: Framed-AppleTalk-Link' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.3317.4.3.1.11 NAME 'radiusFramedAppleTalkNetwork' DESC 'replyItem: Framed-AppleTalk-Network' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 ) attributetype ( 1.3.6.1.4.1.3317.4.3.1.12 NAME 'radiusFramedAppleTalkZone' DESC 'replyItem: Framed-AppleTalk-Zone' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.3317.4.3.1.13 NAME 'radiusFramedCompression' DESC 'replyItem: Framed-Compression' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 ) attributetype ( 1.3.6.1.4.1.3317.4.3.1.14 NAME 'radiusFramedIPAddress' DESC 'replyItem: Framed-IP-Address' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.3317.4.3.1.15 NAME 'radiusFramedIPNetmask' DESC 'replyItem: Framed-IP-Netmask' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.3317.4.3.1.16 NAME 'radiusFramedIPXNetwork' DESC 'replyItem: Framed-IPX-Network' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.3317.4.3.1.17 NAME 'radiusFramedMTU' DESC 'replyItem: Framed-MTU' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.3317.4.3.1.18 NAME 'radiusFramedProtocol' DESC 'replyItem: Framed-Protocol' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.3317.4.3.1.19 NAME 'radiusFramedRoute' DESC 'replyItem: Framed-Route' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 ) attributetype ( 1.3.6.1.4.1.3317.4.3.1.20 NAME 'radiusFramedRouting' DESC 'replyItem: Framed-Routing' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.3317.4.3.1.46 NAME 'radiusGroupName' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 ) attributetype ( 1.3.6.1.4.1.3317.4.3.1.47 NAME 'radiusHint' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.3317.4.3.1.48 NAME 'radiusHuntgroupName' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 ) attributetype ( 1.3.6.1.4.1.3317.4.3.1.21 NAME 'radiusIdleTimeout' DESC 'replyItem: Idle-Timeout' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.3317.4.3.1.22 NAME 'radiusLoginIPHost' DESC 'replyItem: Login-IP-Host' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 ) attributetype ( 1.3.6.1.4.1.3317.4.3.1.23 NAME 'radiusLoginLATGroup' DESC 'replyItem: Login-LAT-Group' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.3317.4.3.1.24 NAME 'radiusLoginLATNode' DESC 'replyItem: Login-LAT-Node' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.3317.4.3.1.25 NAME 'radiusLoginLATPort' DESC 'replyItem: Login-LAT-Port' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.3317.4.3.1.26 NAME 'radiusLoginLATService' DESC 'replyItem: Login-LAT-Service' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.3317.4.3.1.27 NAME 'radiusLoginService' DESC 'replyItem: Login-Service' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.3317.4.3.1.28 NAME 'radiusLoginTCPPort' DESC 'replyItem: Login-TCP-Port' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.3317.4.3.1.29 NAME 'radiusPasswordRetry' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.3317.4.3.1.30 NAME 'radiusPortLimit' DESC 'replyItem: Port-Limit' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.3317.4.3.1.49 NAME 'radiusProfileDn' DESC '' EQUALITY distinguishedNameMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.3317.4.3.1.31 NAME 'radiusPrompt' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.3317.4.3.1.50 NAME 'radiusProxyToRealm' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.3317.4.3.1.51 NAME 'radiusReplicateToRealm' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.3317.4.3.1.52 NAME 'radiusRealm' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.3317.4.3.1.32 NAME 'radiusServiceType' DESC 'replyItem: Service-Type' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.3317.4.3.1.33 NAME 'radiusSessionTimeout' DESC 'replyItem: Session-Timeout' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.3317.4.3.1.34 NAME 'radiusTerminationAction' DESC 'replyItem: Termination-Action' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.3317.4.3.1.35 NAME 'radiusTunnelAssignmentId' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 ) attributetype ( 1.3.6.1.4.1.3317.4.3.1.36 NAME 'radiusTunnelMediumType' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 ) attributetype ( 1.3.6.1.4.1.3317.4.3.1.37 NAME 'radiusTunnelPassword' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.3317.4.3.1.38 NAME 'radiusTunnelPreference' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 ) attributetype ( 1.3.6.1.4.1.3317.4.3.1.39 NAME 'radiusTunnelPrivateGroupId' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 ) attributetype ( 1.3.6.1.4.1.3317.4.3.1.40 NAME 'radiusTunnelServerEndpoint' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 ) attributetype ( 1.3.6.1.4.1.3317.4.3.1.41 NAME 'radiusTunnelType' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 ) attributetype ( 1.3.6.1.4.1.3317.4.3.1.42 NAME 'radiusVSA' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 ) attributetype ( 1.3.6.1.4.1.3317.4.3.1.43 NAME 'radiusTunnelClientEndpoint' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 ) #need to change asn1.id attributetype ( 1.3.6.1.4.1.3317.4.3.1.53 NAME 'radiusSimultaneousUse' DESC 'checkItem: Simultaneous-Use' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.3317.4.3.1.54 NAME 'radiusLoginTime' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.3317.4.3.1.55 NAME 'radiusUserCategory' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.3317.4.3.1.56 NAME 'radiusStripUserName' DESC '' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.3317.4.3.1.57 NAME 'dialupAccess' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.3317.4.3.1.58 NAME 'radiusExpiration' DESC 'checkItem: Expiration' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.3317.4.3.1.59 NAME 'radiusCheckItem' DESC 'checkItem: $GENERIC$' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 ) attributetype ( 1.3.6.1.4.1.3317.4.3.1.60 NAME 'radiusReplyItem' DESC 'replyItem: $GENERIC$' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 ) attributetype ( 1.3.6.1.4.1.3317.4.3.1.61 NAME 'radiusNASIpAddress' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.3317.4.3.1.62 NAME 'radiusReplyMessage' DESC 'replyItem: Reply-Message' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 ) objectclass ( 1.3.6.1.4.1.3317.4.3.2.1 NAME 'radiusprofile' SUP top AUXILIARY DESC '' MUST cn MAY ( radiusArapFeatures $ radiusArapSecurity $ radiusArapZoneAccess $ radiusAuthType $ radiusCallbackId $ radiusCallbackNumber $ radiusCalledStationId $ radiusCallingStationId $ radiusClass $ radiusClientIPAddress $ radiusFilterId $ radiusFramedAppleTalkLink $ radiusFramedAppleTalkNetwork $ radiusFramedAppleTalkZone $ radiusFramedCompression $ radiusFramedIPAddress $ radiusFramedIPNetmask $ radiusFramedIPXNetwork $ radiusFramedMTU $ radiusFramedProtocol $ radiusCheckItem $ radiusReplyItem $ radiusFramedRoute $ radiusFramedRouting $ radiusIdleTimeout $ radiusGroupName $ radiusHint $ radiusHuntgroupName $ radiusLoginIPHost $ radiusLoginLATGroup $ radiusLoginLATNode $ radiusLoginLATPort $ radiusLoginLATService $ radiusLoginService $ radiusLoginTCPPort $ radiusLoginTime $ radiusPasswordRetry $ radiusPortLimit $ radiusPrompt $ radiusProxyToRealm $ radiusRealm $ radiusReplicateToRealm $ radiusServiceType $ radiusSessionTimeout $ radiusStripUserName $ radiusTerminationAction $ radiusTunnelClientEndpoint $ radiusProfileDn $ radiusSimultaneousUse $ radiusTunnelAssignmentId $ radiusTunnelMediumType $ radiusTunnelPassword $ radiusTunnelPreference $ radiusTunnelPrivateGroupId $ radiusTunnelServerEndpoint $ radiusTunnelType $ radiusUserCategory $ radiusVSA $ radiusExpiration $ dialupAccess $ radiusNASIpAddress $ radiusReplyMessage ) ) objectclass ( 1.3.6.1.4.1.3317.4.3.2.2 NAME 'radiusObjectProfile' SUP top STRUCTURAL DESC 'A Container Objectclass to be used for creating radius profile object' MUST cn MAY ( uid $ userPassword $ description ) ) freeradius-server/doc/examples/postgresql_update_radacct_group_trigger.sql000066400000000000000000000017551257552170400300240ustar00rootroot00000000000000/* * $Id$ * * OPTIONAL Postgresql trigger for FreeRADIUS * * This trigger updates fills in the groupname field (which doesnt come in Accounting packets) * by querying the radusergroup table. * This makes it easier to do group summary reports, however note that it does add some extra * database load to 50% of your SQL accounting queries. If you dont care about group summary * reports then you dont need to install this. * */ CREATE OR REPLACE FUNCTION upd_radgroups() RETURNS trigger AS' DECLARE v_groupname varchar; BEGIN SELECT INTO v_groupname groupname FROM radusergroup WHERE calledstationid = NEW.calledstationid AND username = NEW.username; IF FOUND THEN UPDATE radacct SET groupname = v_groupname WHERE radacctid = NEW.radacctid; END IF; RETURN NEW; END 'LANGUAGE plpgsql; DROP TRIGGER upd_radgroups ON radacct; CREATE TRIGGER upd_radgroups AFTER INSERT ON radacct FOR EACH ROW EXECUTE PROCEDURE upd_radgroups(); freeradius-server/doc/index.rst000066400000000000000000000007751257552170400171420ustar00rootroot00000000000000.. FreeRADIUS documentation master file, created by sphinx-quickstart on Tue May 18 13:26:39 2010. You can adapt this file completely to your liking, but it should at least contain the root `toctree` directive. .. toctree:: :maxdepth: 2 aaa ldap_howto load-balance coding-methods DIFFS release-method cisco configurable_failover processing_users_file proxy variables Indices and tables ================== * :ref:`genindex` * :ref:`modindex` * :ref:`search` freeradius-server/doc/ldap_howto.rst000066400000000000000000001651411257552170400201720ustar00rootroot00000000000000LDAP Configuration ================== This document describes how to setup Freeradius on a Freebsd machine using LDAP as a backend. This is by no means complete and your mileage may vary. If you are having any problems with the setup of your freeradius installation, please read the documentation that comes with Freeradius first as that is where all the information for this project came from. If you find any bugs, typos, alternative ideas, or just plain wrong information, please let me know by sending an email to the address above. The radius servers in this document are built on Freebsd 4.8, using Freeradius .81 with OpenLDAP 2.0.27 as the backend. The servers are designed to support customers for multiple services. In this document we will use regular dialup and dialup ISDN as examples of two different services using the same radius server for authentication. OVERVIEW -------- The radius servers are to be provisioned by a some sort of system we will call Billing. Billing could simply be a script, a web front-end, or an actual integration into a billing system. Billing will provision to the master LDAP server. The master LDAP server is running slurpd, which will replicate all changes to the other radius servers. Each radius server will run a local instance of LDAP. The radius servers will be accepting Radius auth packets and Radius acct packets. The accounting packets will be stored locally on each radius server and then forwarded to the Accounting radius server, using radrelay. The Accounting radius server will store all the radius information in some sort of database such as MySQL, Postgres, or Oracle. The configuration of the actual Accounting radius server is outside the scope of this document. Please refer to the freeradius documentation for setting up that server. The Accounting radius server will help to provide a searchable interface to the accounting data for billing and usage purposes and could allow a web front-end to be built for helpdesk/customer service usage. If that is not needed for your purposes, then disregard all details about the Accounting radius server. In order to make sure no data is lost in the event of the Accounting radius server going down, the replication of data will take place using radrelay. Radrelay will do the equivalent of a tail on the detail file and will continually attempt to duplicate each radius packet that is stored in the detail file and send it off to the recipient(s) specified. Upon receipt of an accounting_response packet radrelay will consider that packet completed and continue working on the others. Each radius server will also be storing its own copy of all accounting packets that are sent to it. Each NAS will be setup with a primary radius server and a failover radius server. We will spread the load among the group of radius servers that we have so some are acting as a primary to some NAS's and acting as a secondary to others. In the event of a radius failure, the NAS should failover to the backup radius server. How to configure this is dependent on the particular NAS being used. :: Will use Radius acct data Billing will provision for real-time billing out to the Master LDAP server over LDAP +------------+ | Accounting | +---------+ | Radius | | Billing | +------------+ +----+----+ /|\ | | | | | | | | Provisioning | Message | | Duplicate | Acct | | | | \|/ | +------------+ | +------------------| LDAP Master| | | +------------+ | | | | Slurpd Slurpd Replication | Replication | | | | | | \|/ | | +------------+ | | | Radius2 | The Radius servers | | | LDAP Slave | will create a local | \|/ +------------+ copy of all acct +-------------+ packets and then | Radius1 | fwd a copy back | LDAP Slave | All Radius servers run a to accounting +-------------+ local copy of LDAP for /|\ /|\ Authorization and Authentication | | | | | | | | Auth Acct | | | | | | | | | | \|/ \|/ +-----------+ | | | | | NAS | | | +-----------+ The NAS will be setup to use one of the Radius servers as primary and the others as failover LDAP ---- The LDAP directory is designed to start with the top level of dc=mydomain,dc=com. The next level of the tree contains the different services that will be stored within the ldap server. For the radius users, it will be specified as ou=radius. Below ou=radius, will be the different types of accounts. For example, ou=users will store the users and ou=profiles will store the default radius profiles. The profiles are entries that will be used to store group-wide radius profiles. The group ou=admins will be a place to enter the users for Billing, Freeradius, and any other administrative accounts that are needed. :: +---------------------+ | | | Dc=mydomain,dc=com |Objectclass:organizationalUnit | |Objectclass:dcObject +---------------------+ | | \|/ +---------------+ | | | Ou=radius | Objectclass:organizationalUnit | | +---------------+ | +-----------------------+-------------------------| | | | \|/ \|/ \|/ +---------+ +---------------+ +-------------+ | | | | | | |Ou=users | | Ou=profiles | | Ou=admins | | | | | | | +---------+ +---------------+ +------|------+ | | | | | | \|/ | \|/ ----- Objectclass: | ----- Objectclass: // \\ radiusprofile | // \\ person | | | | | \\ // | \\ // ----- \|/ ----- Dn:cn=freeradius Dn: uid=example,ou=users, ----- ObjectClass: ou=admins,ou=radius dc=mydomain,dc=com // \\ radiusprofile dc=mydomain,dc=com | | | | \\ // ----- Dn: uid=dial,ou=profiles,ou=radius,dc=mydomain,dc=com An example LDIF file is below. NOTE: There are unique radius attribute types and objectclasses, these will be explained in the configuration section. :: dn: dc=mydomain,dc=com objectClass: dcObject objectClass: organizationUnit ou: Mydomain.com Radius dc: mydomain dn: ou=radius,dc=mydomain,dc=com objectclass: organizationalunit ou: radius dn: ou=profiles,ou=radius,dc=mydomain,dc=com objectclass: organizationalunit ou: profiles dn: ou=users,ou=radius,dc=mydomain,dc=com objectclass: organizationalunit ou: users dn: ou=admins,ou=radius,dc=mydomain,dc=com objectclass: organizationalunit ou: admins dn: uid=dial,ou=profiles,ou=radius,dc=mydomain,dc=com objectclass: radiusprofile uid: dial radiusServiceType: Framed-User radiusFramedProtocol: PPP radiusFramedIPNetmask: 255.255.255.0 radiusFramedRouting: None dn: uid=isdn,ou=profiles,ou=radius,dc=mydomain,dc=com objectclass: radiusprofile uid: isdn radiusServiceType: Framed-User radiusFramedProtocol: PPP radiusFramedIPNetmask: 255.255.255.0 radiusFramedRouting: None dn: uid=example,ou=users,ou=radius,dc=mydomain,dc=com objectclass: radiusProfile uid: example userPassword: test radiusGroupName: dial radiusGroupName: isdn dn: cn=freeradius,ou=admins,ou=radius,dc=mydomain,dc=com objectclass: person sn: freeradius cn: freeradius userPassword: freeradius dn: cn=billing,ou=admins,ou=radius,dc=mydomain,dc=com objectclass: person sn: freeradius cn: freeradius userPassword: billing dn: cn=replica,ou=admins,ou=radius,dc=mydomain,dc=com objectclass: person sn: replica cn: replica userPassword: replica In order to configure the ldap server to understand the radius schema that we are using, the attribute types and objectclasses must be defined in slapd.conf. The file is included with the following line in slapd.conf:: include /usr/local/etc/openldap/schema/RADIUS-LDAPv3.schema Below is the complete Schema:: ----Begin RADIUS-LDAPv3.schema---- ################################################# ##### custom radius attributes ################## objectIdentifier myOID 1.1 objectIdentifier mySNMP myOID:1 objectIdentifier myLDAP myOID:2 objectIdentifier myRadiusFlag myLDAP:1 objectIdentifier myObjectClass myLDAP:2 attributetype ( myRadiusFlag:1 NAME 'radiusAscendRouteIP' DESC 'Ascend VSA Route IP' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) attributetype (myRadiusFlag:2 NAME 'radiusAscendIdleLimit' DESC 'Ascend VSA Idle Limit' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) attributetype (myRadiusFlag:3 NAME 'radiusAscendLinkCompression' DESC 'Ascend VSA Link Compression' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) attributetype (myRadiusFlag:4 NAME 'radiusAscendAssignIPPool' DESC 'Ascend VSA AssignIPPool' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) attributetype (myRadiusFlag:5 NAME 'radiusAscendMetric' DESC 'Ascend VSA Metric' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) ################################################# attributetype ( 1.3.6.1.4.1.3317.4.3.1.1 NAME 'radiusArapFeatures' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.3317.4.3.1.2 NAME 'radiusArapSecurity' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.3317.4.3.1.3 NAME 'radiusArapZoneAccess' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.3317.4.3.1.44 NAME 'radiusAuthType' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.3317.4.3.1.4 NAME 'radiusCallbackId' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.3317.4.3.1.5 NAME 'radiusCallbackNumber' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.3317.4.3.1.6 NAME 'radiusCalledStationId' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.3317.4.3.1.7 NAME 'radiusCallingStationId' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.3317.4.3.1.8 NAME 'radiusClass' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 ) attributetype ( 1.3.6.1.4.1.3317.4.3.1.45 NAME 'radiusClientIPAddress' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.3317.4.3.1.9 NAME 'radiusFilterId' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.3317.4.3.1.10 NAME 'radiusFramedAppleTalkLink' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.3317.4.3.1.11 NAME 'radiusFramedAppleTalkNetwork' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.3317.4.3.1.12 NAME 'radiusFramedAppleTalkZone' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.3317.4.3.1.13 NAME 'radiusFramedCompression' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.3317.4.3.1.14 NAME 'radiusFramedIPAddress' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.3317.4.3.1.15 NAME 'radiusFramedIPNetmask' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.3317.4.3.1.16 NAME 'radiusFramedIPXNetwork' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.3317.4.3.1.17 NAME 'radiusFramedMTU' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.3317.4.3.1.18 NAME 'radiusFramedProtocol' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.3317.4.3.1.19 NAME 'radiusFramedRoute' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 ) attributetype ( 1.3.6.1.4.1.3317.4.3.1.20 NAME 'radiusFramedRouting' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.3317.4.3.1.46 NAME 'radiusGroupName' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 ) attributetype ( 1.3.6.1.4.1.3317.4.3.1.47 NAME 'radiusHint' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.3317.4.3.1.48 NAME 'radiusHuntgroupName' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.3317.4.3.1.21 NAME 'radiusIdleTimeout' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.3317.4.3.1.22 NAME 'radiusLoginIPHost' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.3317.4.3.1.23 NAME 'radiusLoginLATGroup' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.3317.4.3.1.24 NAME 'radiusLoginLATNode' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.3317.4.3.1.25 NAME 'radiusLoginLATPort' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.3317.4.3.1.26 NAME 'radiusLoginLATService' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.3317.4.3.1.27 NAME 'radiusLoginService' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.3317.4.3.1.28 NAME 'radiusLoginTCPPort' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.3317.4.3.1.29 NAME 'radiusPasswordRetry' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.3317.4.3.1.30 NAME 'radiusPortLimit' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.3317.4.3.1.49 NAME 'radiusProfileDn' DESC '' EQUALITY distinguishedNameMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.3317.4.3.1.31 NAME 'radiusPrompt' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.3317.4.3.1.50 NAME 'radiusProxyToRealm' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.3317.4.3.1.51 NAME 'radiusReplicateToRealm' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.3317.4.3.1.52 NAME 'radiusRealm' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.3317.4.3.1.32 NAME 'radiusServiceType' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.3317.4.3.1.33 NAME 'radiusSessionTimeout' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.3317.4.3.1.34 NAME 'radiusTerminationAction' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.3317.4.3.1.35 NAME 'radiusTunnelAssignmentId' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 ) attributetype ( 1.3.6.1.4.1.3317.4.3.1.36 NAME 'radiusTunnelMediumType' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 ) attributetype ( 1.3.6.1.4.1.3317.4.3.1.37 NAME 'radiusTunnelPassword' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.3317.4.3.1.38 NAME 'radiusTunnelPreference' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 ) attributetype ( 1.3.6.1.4.1.3317.4.3.1.39 NAME 'radiusTunnelPrivateGroupId' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 ) attributetype ( 1.3.6.1.4.1.3317.4.3.1.40 NAME 'radiusTunnelServerEndpoint' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 ) attributetype ( 1.3.6.1.4.1.3317.4.3.1.41 NAME 'radiusTunnelType' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 ) attributetype ( 1.3.6.1.4.1.3317.4.3.1.42 NAME 'radiusVSA' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 ) attributetype ( 1.3.6.1.4.1.3317.4.3.1.43 NAME 'radiusTunnelClientEndpoint' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 ) #need to change asn1.id attributetype ( 1.3.6.1.4.1.3317.4.3.1.53 NAME 'radiusSimultaneousUse' DESC '' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.3317.4.3.1.54 NAME 'radiusLoginTime' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.3317.4.3.1.55 NAME 'radiusUserCategory' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.3317.4.3.1.56 NAME 'radiusStripUserName' DESC '' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.3317.4.3.1.57 NAME 'dialupAccess' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.3317.4.3.1.58 NAME 'radiusExpiration' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.3317.4.3.1.59 NAME 'radiusCheckItem' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 ) attributetype ( 1.3.6.1.4.1.3317.4.3.1.60 NAME 'radiusReplyItem' DESC '' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 ) objectclass ( 1.3.6.1.4.1.3317.4.3.2.1 NAME 'radiusprofile' SUP top STRUCTURAL DESC '' MUST ( uid ) MAY ( userPassword $ radiusArapFeatures $ radiusArapSecurity $ radiusArapZoneAccess $ radiusAuthType $ radiusCallbackId $ radiusCallbackNumber $ radiusCalledStationId $ radiusCallingStationId $ radiusClass $ radiusClientIPAddress $ radiusFilterId $ radiusFramedAppleTalkLink $ radiusFramedAppleTalkNetwork $ radiusFramedAppleTalkZone $ radiusFramedCompression $ radiusFramedIPAddress $ radiusFramedIPNetmask $ radiusFramedIPXNetwork $ radiusFramedMTU $ radiusFramedProtocol $ radiusCheckItem $ radiusReplyItem $ radiusFramedRoute $ radiusFramedRouting $ radiusIdleTimeout $ radiusGroupName $ radiusHint $ radiusHuntgroupName $ radiusLoginIPHost $ radiusLoginLATGroup $ radiusLoginLATNode $ radiusLoginLATPort $ radiusLoginLATService $ radiusLoginService $ radiusLoginTCPPort $ radiusLoginTime $ radiusPasswordRetry $ radiusPortLimit $ radiusPrompt $ radiusProxyToRealm $ radiusRealm $ radiusReplicateToRealm $ radiusServiceType $ radiusSessionTimeout $ radiusStripUserName $ radiusTerminationAction $ radiusTunnelAssignmentId $ radiusTunnelClientEndpoint $ radiusIdleTimeout $ radiusLoginIPHost $ radiusLoginLATGroup $ radiusLoginLATNode $ radiusLoginLATPort $ radiusLoginLATService $ radiusLoginService $ radiusLoginTCPPort $ radiusPasswordRetry $ radiusPortLimit $ radiusPrompt $ radiusProfileDn $ radiusServiceType $ radiusSessionTimeout $ radiusSimultaneousUse $ radiusTerminationAction $ radiusTunnelAssignmentId $ radiusTunnelClientEndpoint $ radiusTunnelMediumType $ radiusTunnelPassword $ radiusTunnelPreference $ radiusTunnelPrivateGroupId $ radiusTunnelServerEndpoint $ radiusTunnelType $ radiusUserCategory $ radiusVSA $ radiusExpiration $ dialupAccess $ radiusAscendRouteIP $ radiusAscendIdleLimit $ radiusAscendLinkCompression $ radiusAscendAssignIPPool $ radiusAscendMetric ) ) ----End RADIUS-LDAPv3.schema---- Now we need to setup the permissions on the ldap server. Notice above we created three users in the admin ou. These users will be specific for billing, freeradius, and replication. On the master ldap server, we will set the following permissions:: access to attr=userPassword by self write by dn="cn=billing,ou=admins,ou=radius,dc=mydomain,dc=com" write by anonymous auth by * none access to * by self write by dn="cn=billing,ou=admins,ou=radius,dc=mydomain,dc=com" write by anonymous auth by * none This will give the billing user write access to add/delete users. For security we will not give read access to any other users. You can easily add another read-only user to this setup if you want to build some sort of web interface to do only reads. Now on the slave ldap servers (aka the radius servers) we will setup the following permissions:: access to attr=userPassword by self write by dn="cn=replica,ou=admins,ou=radius,dc=mydomain,dc=com" write by anonymous auth by * none access to dn="ou=users,ou=radius,dc=mydomain,dc=com" by dn="cn=replica,ou=admins,ou=radius,dc=mydomain,dc=com" write by dn="cn=freeradius,ou=admins,ou=radius,dc=mydomain,dc=com" read by anonymous auth by * none access to * by self write by dn="cn=replica,ou=admins,ou=radius,dc=mydomain,dc=com" write by anonymous auth by * none This will give the replica user write access. This user will be discussed below and it is involved in the process of replicating the master server to the slaves. The freeradius user only needs read access to do the lookups for authorization. Now we will want to setup indexes to speed up searches. At the minimum, below will work. Since all radius lookups are currently using the uid, we will want to index that. It is also a good idea to index the objectclass attribute. # Indices to maintain index objectClass eq index uid eq Now we need to setup the replication from the master to the slave servers. To do this, we will add the following to the slapd.conf file on the master: On the master LDAP server:: replica host=radius1.mydomain.com binddn=cn=replica,ou=admins,ou=radius,dc=mydomain,dc=com bindmethod=simple credentials=replica replica host=radius2.mydomain.com binddn=cn=replica,ou=admins,ou=radius,dc=mydomain,dc=com bindmethod=simple credentials=replica We will need to add a replica for each slave LDAP server. The binddn is the name that is used to bind to the slave server, and the credentials is the secret for that user. On the slave LDAP servers:: updatedn cn=replica,ou=admins,ou=radius,dc=mydomain,dc=com updateref ldap://ldapmaster.mydomain.com Those will determine what name is allowed to update the LDAP server and if an update is attempted directly, what server to refer the update to. RADIUS ------ The radius server is setup to use LDAP for both Authorization and Authentication. This section will describe what events will take place during an AAA session with a NAS. When the NAS sends a access_request to the radius server, the radius server will perform authorization and authentication based on a series of modules that are defined in radiusd.conf. For example, the module defined as ldap, will be used to make connections to the LDAP directory. An example is listed below:: ldap { server = localhost identity = cn=freeradius,ou=admins,ou=radius,dc=mydomain,dc=com password = example #this is the basedn to do searches on a user basedn = ou=users,ou=radius,dc=mydomain,dc=com #notice the username is the stripped user-name or user-name filter = (uid=%{Stripped-User-Name:-{User-Name}}) start_tls = no tls_mode = no #this maps ldap attributetypes to radius attributes dictionary_mapping = ${raddbdir}/ldap.attrmap ldap_cache_timeout = 120 ldap_cache_size = 0 ldap_connections_number = 10 #password_header = {clear} #While integrating FreeRADIUS with Novell eDirectory, set #'password_attribute = nspmpassword' in order to use the universal password #of the eDirectory users for RADIUS authentication. This will work only if #FreeRADIUS is configured to build with --with-edir option. password_attribute = userPassword #Comment out the following to disable the eDirectory account policy check and #intruder detection. This will work only if FreeRADIUS is configured to build #with --with-edir option. #edir_account_policy_check=no groupname_attribute = radiusGroupName groupmembership_filter = (&(uid=%{Stripped-User-Name:-%{User-Name}}) (objectclass=radiusprofile)) groupmembership_attribute = radiusGroupName timeout = 3 timelimit = 5 net_timeout = 1 compare_check_items = no #access_attr_used_for_allow = yes } The first thing that is done is authorization of the user. The radius server will process the modules in the order specified in the authorization section of radiusd.conf. Currently, they are in the following order. 1) preprocess 2) suffix 3) files 4) ldap The first module will be preprocess. This will first check the huntgroups of the user coming in. The huntgroups are defined in the file huntgroups and they are a group listing of the NAS-IP-Addresses that make the access_request. This is useful in creating specific actions based on the NAS-IP that the request is made from. An example, is below:: isdncombo NAS-IP-Address == 10.10.10.1 dialup NAS-IP-Address == 10.10.10.2 dialup NAS-IP-Address == 10.10.10.3 We will have one NAS that is used for both ISDN and regular dialup customers, the other NAS's will be only used for dialup. The preprocess module may also use the hints file, to load hints to the radius server, and add additional hacks that are based on the type of request that comes in. This is to help with certain NAS's that don't conform to radius RFC's. Check the comments in radiusd.conf for an explanation on those. The second module is suffix. This event will determine which realm the user is in, based on the User-Name attribute. It is currently setup to split the username at the occurence of the @symbol. For example, the username of example@mydomain.com, will be split into example and mydomain.com. The realm is then checked against the file proxy.conf, which will determine what actions should be taken for that realm. Certain realms can be setup to be proxied to a different radius server or set to authenticate locally. Also, the username can be setup to be stripped from the realm or left intact. An example of proxy.conf, is listed below. If the realm is to be proxied, then a secret is needed, which is the secret of the radius server it is to be proxied to. By default the User-Name will be stripped, unless the nostrip option is set. Currently we will not be using realms with our users, but adding this ability in the future will be much easier with already incorporating proxy.conf into the setup:: proxy server { synchronous = no retry_delay = 5 retry_count = 3 dead_time = 120 servers_per_realm = 15 default_fallback = yes } realm NULL { type = radius authhost = LOCAL accthost = LOCAL #secret = testing123 } realm DEFAULT { type = radius authhost = LOCAL accthost = LOCAL #secret = testing123 } The next module is files, which is commonly know as the users file. The users file will start with either a username to determine how to authorize a specific user, or a DEFAULT setting. In each line it will define what items must be present for there to be a match in the form of attribute == value. If all the required attributes are matched, then attributes specified with attribute := value will be set for that user. If no match is found the users file will continue to be processed until there is a match. The last DEFAULT setting will be set as a catch-all, in case there is no previous match. If a match is made, the statement of Fall-Through determines if the users file should continue to be processed or if it should stop right there. The Ldap-Group corresponds to the LDAP attribute of radiusGroupName (see ldap configuration above). The user may be assigned multiple radiusGroupNames, one for each of the services that the user is authorized for. If the user does belong to the correct group, then the user will be authorized for that type of access. If the user does not belong to that group, then there will not be a match and the users file will continue to be processed. If a match is made and there is a User-Profile set, then the radius server will lookup the attributes that exist in that User-Profile in the LDAP directory. These are radius attributes that will be sent to the NAS as a reply-item. An example users file is below:: DEFAULT Ldap-Group == disabled, Auth-Type := Reject Reply-Message = "Account disabled. Please call the helpdesk." DEFAULT Huntgroup-Name == isdncombo, NAS-Port-Type == Async, Ldap-Group == dial, User-Profile := "uid=dial,ou=profiles,ou=radius,dc=mydomain,dc=com" Fall-Through = no DEFAULT Huntgroup-Name == isdncombo, NAS-Port-Type == ISDN, Ldap-Group == isdn, User-Profile := "uid=isdn,ou=profiles,ou=radius,dc=mydomain,dc=com" Fall-Through = no DEFAULT Huntgroup-Name == dial, Ldap-Group == dial, User-Profile := "uid=dial,ou=profiles,ou=radius,dc=mydomain,dc=com" Fall-Through = no DEFAULT Auth-Type := Reject Reply-Message = "Please call the helpdesk." Notice that the catchall DEFAULT is set to Reject the user. This will stop the authorization and immediately send back an access_reject message. Because business rules are applied above to each scenario where the user will be authorized for access, if no match is found, then we will want to stop the process immediately to save resources. By using the Ldap-Group feature we can limit user logins to only the services they are subscribed to. Some examples of possible user setups are below:: #user with access to dial-up dn: uid=user1,ou=users,ou=radius,dc=mydomain,dc=com objectclass: radiusprofile uid: user1 userPassword: whatever radiusgroupname: dial #user with access to ISDN and dial dn: uid=user2,ou=users,ou=radius,dc=mydomain,dc=com objectclass: radiusprofile uid: user2 userPassword: whatever radiusgroupname: dial radiusgroupname: isdn #same user as above that was suspended for not paying dn: uid=user2,ou=users,ou=radius,dc=mydomain,dc=com objectclass: radiusprofile uid: user2 userPassword: whatever radiusgroupname: dial radiusgroupname: isdn radiusgroupname: disabled Now that we have authorized the user, the final piece is to authenticate the user. Authentication is currently done by checking if the password sent in the access_request packet is correct. This action will be done with an attempted bind to the LDAP server using the User-Name and User-Password attributes passed to it from the access_request. If the user is successfully authorized, then an access_accept message will be sent back to the NAS, with any reply items that were defined in the authorization section. If the user did not supply the correct password, then an access_reject message will be sent to the user. If the NAS is sent an access_accept packet then the user will be given access to the service and the NAS will then send an acct_request packet. This will be a request packet to start a radius accounting session. The way the server will log the accounting packets is determined in the detail module in the radiusd.conf file. Since we will be storing a local copy and forwarding on all accounting to the Accounting radius server, we will store two local copies on the machine. The first one is done in a regular detail file as defined in the following:: detail detail1 { detailfile = ${radacctdir}/%{Client-IP-Address}/detail-%Y%m%d detailperm = 0600 dirperm = 0755 } The second detail file will be used by the program radrelay to relay a copy of all accounting packets to the Accounting radius server. This file is stored as a catchall for all accounting packets. The radrelay program will basically do a tail on that file and will then attempt to send a copy of each addition to it to the Accounting server. If the copy is successfully sent, then it will be deleted from this file. If the Accounting server were to go down, then this file will continue to build up entries. As soon as the Accounting server is back online, an attempt to re-send the packets to the Accounting server will made. This file is defined in the following section of radiusd.conf:: detail detail2 { detailfile= ${radacctdir}/detail-combined detailperm = 0600 dirperm = 0755 locking = yes } INSTALLATION ------------ The new radius servers are currently built on Freebsd 4.8. As the version may eventually change, these instructions may no longer apply. The steps for building the server are the following: * Install FreeBSD * Install other FreeBSD items * Install OpenLDAP *NOTE: this must be done before installing Freeradius* * Install FreeRadius Under the assumption that FreeBSD is already installed and the kernel rebuilt to the specifications needed for the machine, there are several other things that may be needed at this time and the purpose of this is just as a reminder. install cvsup-without-gui from the ports collection run cvsup on all to update the ports to the most recent versions might be a good idea to upgrade the src edit and run cvsup on /usr/share/examples/cvsup/standard-supfile cd /usr/src - vi Makefile and follow instructions install sendmail from ports to keep up to date with the most recent versions. In the ports collection /ports/mail/sendmail run make; make install; make mailer.conf. Then edit rc.conf and change to sendmail_enable=NO radius servers only need the local interface to send daily reports edit rc.conf to make sure inetd_enable=NO no reason to have extra services running if you rebuilt the kernel to add support for IPFIREWALL, then remember to add a firewall rule to rc.conf firewall_enable=YES firewall_type=OPEN (or actually create a real firewall rule) add crontab to keep date accurate for accounting:: 15 03 * * * /usr/sbin/ntpdate -s thetimeserver.mydomain.com install openldap from ports download the freeradius source as the ports collection is often outdated the default settings are /usr/local/etc/raddb, /var/log/radius.log, /var/log/radacct since openldap was installed first, you should not need any special flags to add ldap support Now its time to configure openlap and freeradius. First we will be looking at configuring OpenLDAP copy RADIUS-LDAPv3.schema to /usr/local/etc/openldap/schema edit /usr/local/etc/openldap/slapd.conf :: ----Begin slapd.conf---- # $OpenLDAP: pkg/ldap/servers/slapd/slapd.conf,v 1.23.2.7 2003/03/24 03:54:12 #kurt Exp $ # # See slapd.conf(5) for details on configuration options. # This file should NOT be world readable. # include /usr/local/etc/openldap/schema/core.schema include /usr/local/etc/openldap/schema/RADIUS-LDAPv3.schema # Define global ACLs to disable default read access. # Do not enable referrals until AFTER you have a working directory # service AND an understanding of referrals. #referral ldap://root.openldap.org loglevel 296 pidfile /var/run/slapd.pid argsfile /var/run/slapd.args # Load dynamic backend modules: # modulepath /usr/local/libexec/openldap # moduleload back_bdb.la # moduleload back_ldap.la # moduleload back_ldbm.la # moduleload back_passwd.la # moduleload back_shell.la password-hash {SSHA} access to attr=userPassword by self write by dn="cn=replica,ou=admins,ou=radius,dc=mydomain,dc=com" write by anonymous auth by * none access to dn="ou=users,ou=radius,dc=mydomain,dc=com" by dn="cn=replica,ou=admins,ou=radius,dc=mydomain,dc=com" write by dn="cn=freeradius,ou=admins,ou=radius,dc=mydomain,dc=com" read by anonymous auth by * none access to * by self write by dn="cn=replica,ou=admins,ou=radius,dc=mydomain,dc=com" write by anonymous auth by * none ####################################################################### # ldbm database definitions ####################################################################### database bdb suffix "dc=mydomain,dc=com" rootdn "cn=root,dc=mydomain,dc=com" # Cleartext passwords, especially for the rootdn, should # be avoid. See slappasswd(8) and slapd.conf(5) for details. # Use of strong authentication encouraged. rootpw {SSHA}Eu5EwPxTrwhEGrXQ9SaQZyfpu4iHt3NP # The database directory MUST exist prior to running slapd AND # should only be accessible by the slapd and slap tools. # Mode 700 recommended. directory /var/db/openldap-data # Indices to maintain index objectClass eq index uid eq mode 0600 cachesize 2000 # replica one for each #replica host=radius1.mydomain.com # binddn="cn=replica,ou=admins,ou=radius,dc=mydomain,dc=com" # bindmethod=simple credentials=secret replogfile /var/db/openldap-slurp/replog ## REMEMBER TO ADD THIS TO THE SLAVES updatedn "cn=freeradius,ou=admins,ou=radius,dc=mydomain,dc=com" updateref ldap://ldapmaster.mydomain.com ----End slapd.conf---- To create a rootdn that is not stored in plain text, enter the following command:: $ slappasswd it will ask for password and verification:: New password: Re-enter new password:: while in the shell create the directory for the ldap database, this must be created before slapd can start:: $ mkdir /var/db/openldap-data move the slapd.sh.sample file to slapd.sh in /usr/local/etc/rc.d:: $ mv /usr/local/etc/rc.d/slapd.sh.sample slapd.sh enable logging in /etc/syslog.conf by adding the following:: local4.* /var/log/ldap.log restart syslogd start it up on both the master and slave ldap servers:: $ /usr/local/etc/rc.d/slapd start create the structural ldif, schema.ldif:: ----Begin schema.ldif---- dn: dc=mydomain,dc=com objectClass: dcObject objectClass: organizationUnit ou: Mydomain.com Radius dc: mydomain dn: ou=radius,dc=mydomain,dc=com objectclass: organizationalunit ou: radius dn: ou=profiles,ou=radius,dc=mydomain,dc=com objectclass: organizationalunit ou: profiles dn: ou=users,ou=radius,dc=mydomain,dc=com objectclass: organizationalunit ou: users dn: ou=admins,ou=radius,dc=mydomain,dc=com objectclass: organizationalunit ou: admins dn: uid=dial,ou=profiles,ou=radius,dc=mydomain,dc=com objectclass: radiusprofile uid: dial radiusServiceType: Framed-User radiusFramedProtocol: PPP radiusFramedIPNetmask: 255.255.255.0 radiusFramedRouting: None dn: uid=isdn,ou=profiles,ou=radius,dc=mydomain,dc=com objectclass: radiusprofile uid: isdn radiusServiceType: Framed-User radiusFramedProtocol: PPP radiusFramedIPNetmask: 255.255.255.0 radiusFramedRouting: None dn: uid=example,ou=users,ou=radius,dc=mydomain,dc=com objectclass: radiusProfile uid: example userPassword: test radiusGroupName: dial radiusGroupName: isdn dn: cn=freeradius,ou=admins,ou=radius,dc=mydomain,dc=com objectclass: person sn: freeradius cn: freeradius userPassword: freeradius dn: cn=billing,ou=admins,ou=radius,dc=mydomain,dc=com objectclass: person sn: freeradius cn: freeradius userPassword: billing dn: cn=replica,ou=admins,ou=radius,dc=mydomain,dc=com objectclass: person sn: replica cn: replica userPassword: replica ----End schema.ldif---- add the organizational structure to the master ldap database:: $ ldapadd -D uid=billing,ou=admins,ou=radius,dc=mydomain,dc=com -w billing -f schema.ldif -h ldapmaster.mydomain.com run slapcat to see what the directory looks like:: $ slapcat If all went well the LDAP directory should be up and running and propagated to the slaves. Now you can add your users to the master. Now its time to setup FreeRadius. First cd into /usr/local/etc/raddb and take a look at all the configuration files, they are heavily documented so you may wish to read through them all before making and changes. edit radiusd.conf:: ----Begin radiusd.conf---- ## ## radiusd.conf -- FreeRADIUS server configuration file. ## prefix = /usr/local exec_prefix = ${prefix} sysconfdir = /usr/local/etc/raddb localstatedir = ${prefix}/var sbindir = ${exec_prefix}/sbin logdir = /var/log raddbdir = /usr/local/etc/raddb radacctdir = /var/log/radacct # Location of config and logfiles. confdir = ${raddbdir} run_dir = ${localstatedir}/run/radiusd log_file = ${logdir}/radius.log libdir = ${exec_prefix}/lib pidfile = ${run_dir}/radiusd.pid #user = nobody #group = nobody max_request_time = 30 delete_blocked_requests = no cleanup_delay = 5 max_requests = 0 bind_address = * port = 0 hostname_lookups = no allow_core_dumps = no regular_expressions = yes extended_expressions = yes log_stripped_names = no log_auth = no log_auth_badpass = no log_auth_goodpass = no # The program to execute to do concurrency checks. #checkrad = ${sbindir}/checkrad security { max_attributes = 200 reject_delay = 0 status_server = no } proxy_requests = yes $INCLUDE ${confdir}/proxy.conf $INCLUDE ${confdir}/clients.conf thread pool { start_servers = 5 max_servers = 32 min_spare_servers = 3 max_spare_servers = 10 max_requests_per_server = 0 } modules { ldap { server = "localhost" identity = "uid=freeradius,ou=admins,ou=radius,dc=mydomain,dc=com" password = example basedn = "ou=users,ou=radius,dc=mydomain,dc=com" filter = "(&(uid=%{Stripped-User-Name:-%{User-Name}}) (objectclass=radiusprofile)" start_tls = no tls_mode = no #default_profile = "uid=dial,ou=profiles,ou=radius,dc=mydomain,dc=com" #profile_attribute = "radiusProfileDn" dictionary_mapping = ${raddbdir}/ldap.attrmap ldap_cache_timeout = 120 ldap_cache_size = 0 ldap_connections_number = 10 #password_header = "{clear}" password_attribute = userPassword groupname_attribute = radiusGroupName groupmembership_filter = "(&(uid=%{Stripped-User-Name:-%{User-Name}})) (objectclass=radiusProfile)" groupmembership_attribute = radiusGroupName timeout = 3 timelimit = 5 net_timeout = 1 compare_check_items = no #access_attr_used_for_allow = yes } realm suffix { format = suffix delimiter = "@" } preprocess { huntgroups = ${confdir}/huntgroups #hints = ${confdir}/hints with_ascend_hack = no ascend_channels_per_line = 23 with_ntdomain_hack = no with_specialix_jetstream_hack = no with_cisco_vsa_hack = no } files { usersfile = ${confdir}/users #acctusersfile = ${confdir}/acct_users compat = no #use old style users } # regular detail files detail detail1 { detailfile = ${radacctdir}/%{Client-IP-Address}/detail-%Y%m%d detailperm = 0600 dirperm = 0755 } # temp detail file to replicate to accountrad detail detail2 { detailfile= ${radacctdir}/detail-combined detailperm = 0600 dirperm = 0755 locking = yes } acct_unique { key = "User-Name, Acct-Session-Id, NAS-IP-Address, Client-IP-Address, NAS-Port-Id" } #radutmp { # filename = ${logdir}/radutmp # perm = 0600 # callerid = "yes" #} #radutmp sradutmp { # filename = ${logdir}/sradutmp # perm = 0644 # callerid = "no" #} #attr_filter { # attrsfile = ${confdir}/attrs #} # The "always" module is here for debugging purposes. Each # instance simply returns the same result, always, without # doing anything. always fail { rcode = fail } always reject { rcode = reject } always ok { rcode = ok simulcount = 0 mpp = no } # # The 'expression' module current has no configuration. expr { } } instantiate { expr } authorize { preprocess suffix files ldap } authenticate { authtype LDAP { ldap } } preacct { preprocess suffix files } accounting { acct_unique detail1 detail2 #radutmp #sradutmp } #session { #radutmp #} #post-auth { # Get an address from the IP Pool. #main_pool #} ----End radiusd.conf---- edit huntgroups to specify a NAS to a huntgroup:: ----Begin huntgroups---- # dialup and isdn isdncombo NAS-IP-Address == 10.10.10.1 # just dialup dialup NAS-IP-Address == 10.10.10.2 dialup NAS-IP-Address == 10.10.10.3 ----End huntgroups---- * edit proxy.conf to setup the different realms:: ----Begin proxy.conf---- proxy server { synchronous = no retry_delay = 5 retry_count = 3 dead_time = 120 servers_per_realm = 15 default_fallback = yes } realm NULL { type = radius authhost = LOCAL accthost = LOCAL #secret = testing123 } realm DEFAULT { type = radius authhost = LOCAL accthost = LOCAL #secret = testing123 } ----End proxy.conf---- -edit clients.conf to setup the NAS's that can talk to it ----Begin clients.conf---- client 127.0.0.1 { secret = example shortname = localhost nastype = other } # isdn and dialup nas client 10.10.10.1 { secret = example shortname = isdn nastype = cisco } #dialup only client 10.10.10.2 { secret = example shortname = dialup1 nastype = cisco } client 10.10.10.3 { secret = example shortname = dialup2 nastype = cisco } ----End clients.conf---- You may wish to look at the other files, but they should all be OK by default. create startup files in /usr/local/etc/rc.d radiusd.sh - the radiusd startup file:: ----Begin radiusd.sh---- #!/bin/sh case "$1" in start) /usr/local/sbin/radiusd echo -n ' radiusd' ;; stop) if [ -f /usr/local/var/run/radiusd/radiusd.pid ]; then kill -TERM `cat /usr/local/var/run/radiusd/radiusd.pid` rm -f /usr/local/var/run/radiusd/radiusd.pid echo -n ' radiusd' fi ;; restart) if [ -f /usr/local/var/run/radiusd/radiusd.pid ]; then kill -HUP `cat /usr/local/var/run/radiusd/radiusd.pid` echo 'radiusd restarted' fi ;; *) echo "Usage: ${0##*/}: { start | stop | restart }" 2>&1 exit 65 ;; esac ----End radiusd.sh---- radrelay.sh - the radrelay startup file:: ----Begin radrelay.sh---- #!/bin/sh case "$1" in start) /usr/local/bin/radrelay -a /var/log/radacct -d /usr/local/etc/raddb \ -S /usr/local/etc/raddb/radrelay_secret -f -r accounting.mydomain.com:1813 \ detail-combined echo -n ' radrelay started' ;; stop) /usr/bin/killall radrelay echo ' radrelay stopped' ;; *) echo "Usage: $[0##*/}: { start | stop }" 2>&1 exit 65 ;; esac ----End radrelay.sh---- create radrelay_secret in /usr/local/etc/radddb This file will contain the secret to connect to the Accounting radius server:: ----Begin radrelay_secret---- example ----End radrelay_secret---- Now fire them up:: $ /usr/local/etc/rc.d/radiusd.sh start $ /usr/local/etc/rc.d/radrelay.sh start You should be all set to start testing now. OTHER RANDOM NOTES AND THOUGHTS ------------------------------- The client programs used to connect to the ldap directory are: ldapadd: to add a record ldapmodify: to modify a record ldapdelete: to delete a record ldapsearch: to search for a record slapcat: to show the entire directory slappaswd: to generate a crypted password Read the man pages on those commands, they tell you everything you need to know. They all follow this basic syntax:: $ ldapwhatever -D "uid=someone,ou=admins,ou=radius,dc=mydomain,dc=com" -w thesecret -andthenotherstuff Finally, if you are having trouble with LDAP, run it in debug mode by changing the following in slapd.sh:: slapd_args= to:: slapd_args= '-d 3' There is a program included with freeradius to test the radius server, its called radclient. Typing it alone will tell you all the options. You will need to create a file that contains radius attributes, such as:: User-Name = example User-Password = test Service-Type = Framed-User NAS-IP-Address = 10.10.10.1 NAS-Port-Type = Async Then you fire that radius packet at the server by issuing:: $ radclient -f testradiusfile localhost auth thesecret -f = filename localhost is the server you are hitting auth or acct depending on the type of packet thesecret to connect to that server Finally, if you are having trouble you can run radius in debug mode and it will output everything that happens to the screen. To do that, kill the current process and run:: $ radiusd -X LINKS ----- FREERADIUS ++++++++++ * _`FreeRADIUS`: http://www.freeradius.org * _`FreeRADIUS Documentation`: http://www.freeradius.org/radiusd/doc * _`FreeRADIUS Wiki`: http://wiki.freeradius.org/ OPENLDAP ++++++++ * _`OpenLDAP`: http://www.openldap.org * _`OpenLDAP Administrator's Guide`: http://www.openldap.org/doc/admin21 RFCs ++++ * _`RFC2865: RADIUS Authentication`: http://www.freeradius.org/radiusd/doc/rfc/rfc2865.txt * _`RFC2866: RADIUS Accounting`: http://www.freeradius.org/radiusd/doc/rfc/rfc2866.txt * _`RFC2869: RADIUS Extentions`: http://www.freeradius.org/radiusd/doc/rfc/rfc2869.txt * _`RFC2251: LDAP v3`: http://www.ietf.org/rfc/rfc2251.txt * _`RFC2252: LDAP v3 Attribute Syntax Definitions`: http://www.ietf.org/rfc/rfc2252.txt * _`RFC2253: LDAP UTF-8 String Representation of Distinguishe d Names (DNs)`: http://www.ietf.org/rfc/rfc2252.txt * _`RFC2849: LDAP Data Interchange Fromat (LDIFs)`: http://www.ietf.org/rfc/rfc2849.txt * _`RFC3377: LDAP v3 Technical Specs`: http://www.ietf.org/rfc/rfc3377.txt freeradius-server/doc/load-balance.rst000066400000000000000000000117341257552170400203320ustar00rootroot00000000000000Load Balancing ============== As of version 2.0.0, the load balance documentation is in the available in the "unlang" man page. The text below may not be up to date, and is here only for historical purposes. As of version 1.1.0, FreeRADIUS supports load balancing in module sections. Please see the "configurable_failover" file in this directory for a more complete description of module sections. The short summary is that you can use a "load-balance" section in any place where a module name may be used. The semantics of the "load-balance" section are that one of the modules in the section will be chosen at random, evenly spread over the modules in the list. An example is below:: accounting { load-balance { sql1 sql2 sql2 } } In this case, 1/3 of the RADIUS requests will be processed by "sql1", one third by "sql2", and 1/3 by "sql3". The "load-balance" section can be nested in a "redundant" section, or vice-versa:: accounting { load-balance { # between two redundant sections below redundant { sql1 sql2 } redundant { sql2 sql1 } } } This says "load balance between sql1 and sql2, but if sql1 is down, use sql2, and if sql2 is down, use sql1". That way, you can guarantee both that load balancing occurs, and that the requests are *always* logged to one of the databases:: accounting { redundant { load-balance { sql1 sql2 } detail } } This says "load balance between sql1 and sql2, but if the one being used is down, then log to detail". And finally:: accounting { redundant { # between load-balance & detail load-balance { # between two redundant sections redundant { sql1 sql2 } redundant { sql2 sql1 } } detail } } This says "try to load balance between sql1 and sql2; if sql1 is down, use sql2; if sql2 is down use sql1; if both sql1 and sql2 are down, then log to the detail file" More complicated scenarios -------------------------- If you want to do redundancy and load-balancing among three modules, the configuration is quite complex:: load-balance { redundant { sql1 load-balance { redundant { sql2 sql3 } redundant { sql3 sql2 } } } # sql1, etc. redundant { sql2 load-balance { redundant { sql3 sql1 } redundant { sql1 sql3 } } } # sql2, etc. redundant { sql3 load-balance { redundant { sql1 sql2 } redundant { sql2 sql1 } } } # sql3, etc. } For four or more modules, it quickly becomes unmanageable. The solution is to use the "redundant-load-balance" section, which combines the features of "load-balance", with "redundant" fail-over between members. The above complex configuration for three modules then becomes:: redundant-load-balance { sql1 sql2 sql3 } Which means "load-balance evenly among all three servers. If the one picked for load-balancing is down, load-balance among the remaining two. If that one is down, pick the one remaining 'live' server". The "redundant-load-balance" section can contain any number of modules. Interaction with "if" and "else" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ It's best to have "if" and "else" blocks contain "load-balance" or "redundant-load-balance" sections, rather than the other way around. The "else" and "elsif" sections cannot appear inside of a "load-balance" or "redundant-load-balance" section, because the "else" condition would be chose as one of the modules for load-balancing, which is not what you want. It's OK to have a plain "if" block inside of a "load-balance" or "redundant-load-balance" section. In that case, the "if" condition checks the return code of the module or group that executed just before the "load-balance" section. It does *not* check the return code of the previous module in the section. freeradius-server/doc/misc-nas.rst000066400000000000000000000015231257552170400175350ustar00rootroot00000000000000Miscellaneous NASes and RADIUS ============================== Introduction ------------ Some NASes have quirks when it comes to speaking RADIUS. This document exposes those flaws and, where applicable, workarounds for those quirks. Proxim ^^^^^^ Proxim AP-2000 NASes up to and including firmware version 2.4.5 ignore the Session-Timeout attribute, despite the fact that Proxim's firmware release notes specifically state that it is supported. On top of this, firmware version 2.4.5 (the latest as of this writing) has a bug in which the reauthentication interval on the AP cannot be set to any value less than 2 hours. As such, fine-grained control of client session times is not currently possible with this NAS. Note that this NAS is OEMed to several vendors, including Avaya, and may be listed under different names with different vendors. freeradius-server/doc/module_interface.rst000066400000000000000000000163411257552170400213340ustar00rootroot00000000000000 RLM Module Interface (for developers) ===================================== Overview -------- Intent of the server ^^^^^^^^^^^^^^^^^^^^ FreeRADIUS is an authentication server. It does RADIUS authorization, authentication, and accounting. It does NOT do database management, user configuration updates, or email. All of those functions may be more easily (and correctly) performed in programs outside of the server. The only functionality performed by the server is: - receive a RADIUS request - process the request - look up information one or more databases - store information in one or more databases (proxying can be viewed this way) - respond to the request There is no room, or need, for timers, listening on sockets, or anything else in the server. Adding those functions to the server means that it will become more complex, more unstable, more insecure, and more difficult to maintain. Intent of the modules ^^^^^^^^^^^^^^^^^^^^^ The intent of modules is that they do small, simple, well-defined things when RADIUS packets are received. If the module does things when RADIUS packets are NOT received, then it has no business being in the server. Similarly, the module infrastructure is NOT intended to allow servers, applications, timed events, or anything other than handling incoming RADIUS packets. Modules perform an action when RADIUS packets are received. Modules which do more (creating threads, forking programs) will NOT be added to the server, and the server core will NOT be modified to enable these kinds of modules. Those functions more properly belong in a seperate application. Modules ARE permitted to open sockets to other network programs, and to send and receive data on those sockets. Modules are NOT permitted to open sockets, and to listen for requests. Only the server core has that functionality, and it only listens for RADIUS requests. Module outline ^^^^^^^^^^^^^^ The fundamental concepts of the rlm interface are module, instance, and component. A module is a chunk of code that knows how to deal with a particular kind of database, or perhaps a collection of similar databases. Examples: - rlm_sql contains code for talking to MySQL or Postgres, and for mapping RADIUS records onto SQL tables - rlm_unix contains code for making radiusd fit in well on unix-like systems, including getpw* authentication and utmp/wtmp-style logging. An instance specifies the actual location of a collection data that can be used by a module. Examples: - /var/log/radutmp - "the MySQL database on bigserver.theisp.com.example" A module can have multiple components which act on RADIUS requests at different stages. The components are: - authorization: check that a user exists, decide on an authentication method or proxy realm, and possibly apply some attributes to be returned in the reply packet. - authentication: verify that the password is correct. - preaccounting: decide whether to proxy the request, and possibly add attributes that should be included in any logs - accounting: record the request in the log - checksimul: count the number of active sessions for the user - postauth: process the response before it's sent to the NAS - preproxy: process a request before it's proxied - postproxy: filter attributes from a reply to a proxied request A module declares which components it supports by putting function pointers in its "module_t rlm_*" structure. Module configuration ^^^^^^^^^^^^^^^^^^^^ The administrator requests the creation of a module instance by adding it inside the modules{} block in radiusd.conf. The instance definition looks like this:: module_name [instance_name] { param1 = value1 param2 = value2 param3 = value3 ... } The module_name is used to load the module. To see the names of the available modules, look for the rlm\_\*.so files in $installprefix/lib. The module_name is that, minus the rlm\_ and the .so. instance_name is an identifier for distinguishing multiple instances of the same module. If you are only loading a module once, you can leave out the instance_name and it will be assumed to be the same as the module_name. The parameters inside the module block are passed without interpretation to the module and generally point to the exact location of a database or enable optional features of the module. Each module should document what parameters it accepts and what they do. For each Access-Request that comes to the server, the authorize{} block is called. Then one of the Auth-Type{} blocks from authenticate{} is called, depending on the Auth-Type attribute that was chosen by authorize{}. Finally, the post-auth{} block is called. If authorize{} set the Proxy-To-Realm attribute, then proxying takes over via pre-proxy{} and post-proxy{}, and the local authenticate{} phase is skipped. For each Accounting-Request that comes to the server, the preacct{} block is called, followed by the accounting{} block. accounting{} is skipped if preacct{} sets Proxy-To-Realm. For an explanation of what "calling" a config block means, see the "configurable_failover" file. The lifetime of a module ^^^^^^^^^^^^^^^^^^^^^^^^ When the server is starting up, or reinitializing itself as a result of a SIGHUP, it reads the modules{} section. Each configured module will be loaded and its init() method will be called:: int init(void) The init() method should take care of any setup that is not tied to a specific instance. It will only be called once, even if there are multiple instances configured. For each configured instance, after the init() method, the instantiate() method is called. It is given a handle to the configuration block holding its parameters, which it can access with cf_section_parse().:: int instantiate(CONF_SECTION \*cs, void \**instance) The instantiate() function should look up options in the config section, and open whatever files or network connections are necessary for the module to do its job. It also should create a structure holding all of the persistent variables that are particular to this instance (open file descriptors, configured pathnames, etc.) and store a pointer to it in \*instance. That void \* becomes a handle (some would call it a "cookie") representing this instance. The instance handle is passed as a parameter in all subsequent calls to the module's methods, so they can determine which database they are supposed to act on. The authorize(), authenticate(), preaccounting(), and accounting() functions are all called the same way:: int authorize(void \*instance, REQUEST \*request) int authenticate(void \*instance, REQUEST \*request) int preaccounting(void \*instance, REQUEST \*request) int accounting(void \*instance, REQUEST \*request) they each receive the instance handle and the request, and are expected to act on the request using the database pointed to by the instance handle (which was set by the instantiate() function). When the server is being shut down (as the first part of SIGHUP for example) detach() is called for each module instance.:: int detach(void \*instance) The detach() method should release whatever resources were allocated by the instantiate() method. After all instances are detached, the destroy() method is called.:: int destroy(void) It should release resources that were acquired by the init() method. --Alan Curry freeradius-server/doc/mssql000066400000000000000000000043161257552170400163560ustar00rootroot00000000000000"Duane Cox" says: Hope this helps. If you are running freeradius as other than root.root, make sure that this user or group can read /etc/odbc/ cd /usr/src && rm -fr unixODBC-2.2.11 tar -zxvf unixODBC-2.2.11.tar.gz && cd unixODBC-2.2.11 && sed -i "s/void yyerror/#define YY_FLUSH_BUFFER\n\n&/" sqp/lex.l && ./configure --prefix=/usr --libexecdir=/usr/sbin --localstatedir=/var --sysconfdir=/etc/odbc --enable-ltdllib --with-gnu-ld --disa ble-gui && make && make install && find doc -name "Makefile*" -exec rm {} \; && chmod 644 doc/{lst,ProgrammerManual/Tutorial}/* && install -v -m755 -d /usr/share/doc/unixODBC-2.2.11 && cp -v -R doc/* /usr/share/doc/unixODBC-2.2.11 && rmdir /etc/odbc/ODBCDataSources && chown -fR root.odbc /etc/odbc && chmod 750 /etc/odbc && chmod 640 /etc/odbc/* cd /usr/src && rm -fr freetds-0.63 tar -zxvf freetds-0.63.tar.gz && cd freetds-0.63 && ./configure --prefix=/usr --libexecdir=/usr/sbin --localstatedir=/var --sysconfdir=/etc --with-unixodbc=/usr/lib --disable-apps && make && make install && rm -f /etc/{freetds,locales}.conf cd /usr/src && rm -fr freeradius-1.0.5 && tar -zxvf freeradius-1.0.5.tar.gz && cd freeradius-1.0.5 && patch -Np1 -i ../freeradius-1.0.5-stdout_log-1.patch && ./configure --prefix=/usr --libexecdir=/usr/sbin --localstatedir=/var --sysconfdir=/etc --with-raddbdir=/srv/radiusd --with-logdir =/var/log --with-radacctdir=/srv/radiusd/acct --with-gnu-ld --without-rlm_x99_token && make && make install cat /etc/odbc.ini [MSSQL-DB] description = FreeRADIUS ODBC for MSSQL 7.0 driver = FreeTDS server = mssql.yourdomain.com port = 1433 database = mydatabase tds_version = 7.0 language = us_english cat /etc/odbcinst.ini [FreeTDS] description = FreeTDS driver for MSSQL driver = /usr/lib/libtdsodbc.so setup = /usr/lib/libtdsS.so fileusage = 1 cat /srv/radiusd/mssql.conf sql { driver = "rlm_sql_unixodbc" server = "MSSQL-DB" login = "mylogin" password = "mypassword" radius_db = "mydatabase" acct_table1 = "radacct" acct_table2 = "radacct" authcheck_table = "radcheck" authreply_table = "radreply" [SNIP...] freeradius-server/doc/performance-testing000066400000000000000000000141411257552170400211700ustar00rootroot00000000000000 Radius Test Procedures 0. INTRODUCTION This document describes how to test your radius server authentication using random usernames and passwords with the 'radclient' program. 1. WHY TEST Many people want to see the difference in efficiency behind the various authentication methods, compilation methods, etc of their radius server. Before now, this was difficult to do efficiently across a large number of users. However, with this document, you'll be able to test your radius server and determine the best options to use for your system. 2. GETTING STARTED First thing we have to do is generate a large number of users. You'll want to do this even if you have a large passwd file you want to use from your system, because the create user script sets up other files you need for testing. So head to the scripts/ directory, and do this: Make a tmp dir # mkdir tmp # cp create-users.pl tmp # cd tmp Run the script to create 10,000 (or however many you want) random users and passwords # ./create-users.pl 10000 Output from the script will include several files: passwd : A standard passwd file you can append to /etc/passwd shadow : A standard shadow file you can append to /etc/shadow passwd.nocrypt : A file with *unencrypted* users & passes in form "user:pass" radius.test : File you'll use as input for radclient radius.users : A standard radius 'users' file So, equipped with lots of users and passwords, there's several methods of authentication you can test: o System users (Auth-Type:=System) o Local users (Auth-Type:=Local) o Cached system (passwd) users o Others NOTE: Before moving on, you will probably want to add '/dev/null' to /etc/shells *temporarily* so that default system authentication will work. REMEMBER TO TAKE IT OUT! 3. TEST PROCEDURES A. System (/etc/passwd) users testing 1. Append the 'passwd' file from create-users.pl onto your system passwd file: # cat ./passwd >> /etc/passwd 2. If you have shadow, append the shadow file onto /etc/shadow # cat ./shadow >> /etc/shadow 3. Make sure you have a DEFAULT user similar to the following in your radius 'users' file: DEFAULT Auth-Type:=System Reply-Message = "Success!" 4. Start radiusd # /usr/local/sbin/radiusd 5. Run radclient with 'radius.test' as the input file. NOTE: First you need to setup a secret for your local machine in the 'clients' file and use that secret below # time /usr/local/bin/radclient -q -s -f radius.test \ auth NOTE: The above is to be put all on one line. NOTE: Some systems do not have the 'time' command, so you may need to break out the stopwatch instead :) Take note of the output of radclient. If there were lots of failures, something is wrong. All authentications should succeed. 6. Take note of the output from the above 'time' command. The output format should be something similar to the following (on linux, this for example only!): 1.72user 0.53system 5:11.34elapsed 0%CPU (0avgtext+0avgdata 0maxresident)k 0inputs+0outputs (340major+29minor)pagefaults 0swaps This means it took 5:11 (311 seconds) to authenticate 10,000 users. Simple division tells us this is: 10,000 auths / 311 seconds = 32.1543 auths/second B. Local users testing 1. Copy the 'radius.users' file from the script over your 'users' file. Make sure you do NOT have a DEFAULT entry or you will invalidate this test. 2. Restart radiusd (kill and restart) 3. Run radclient (See A-5 above for NOTES on this): # time /usr/local/bin/radclient -q -s -f radius.test \ auth 4. Take note of the output from the above 'time' command, and divide the number of auths (10,000 in this case) with the number of seconds it took to complete. See A6 above for more info. C. Cached system users 1. Set 'cache=yes' in your radiusd.conf file 2. Restart radiusd (ie, kill it and restart, not just a HUP) 3. Perform the same steps outlined above for testing System users (A) D. Other methods There is no reason why you can't use some of this to test modules for PAM, SQL, LDAP, etc, but that will require a little extra work on your end (ie, getting the users/passes you generated into the corresponding database). However, by now you should have a good idea of how to test once you do that. Also, play around with compile options like --with-thread, --with-thread-pool, etc. Run radiusd with '-s' so it runs one process only, etc etc. Play around with it. 4. CAVEATS The above test procedures make no allowances for users that login with incorrect usernames or passwords. If you want a true test of performance, you should add in lots of bad usernames and passwords to the radius.test file and then re-run 'radclient' with that file as input. Additionally, these tests make no reference to how the pre-authenticate, post-authenticate, and accounting methods you choose could affect server performance. For example, checking for simultaneous use after authenti- cating the user is obviously going to slow down authenticate performance. The numbers you get from this test are raw authentications/second in a perfect environment. Do not expect this kind of result in the real world. However, having tested in this manner, you will have a good idea of which authentication methods and compilation options give you the best base to start from, which is key to an efficient server. 5. RESULTS I'd really rather not post results because they will vary tremendously with other system-specific configuration. This is exactly the reason you should run tests of this nature, to find what's best for *your* system. Good luck! freeradius-server/doc/processing_users_file.rst000066400000000000000000000023031257552170400224140ustar00rootroot00000000000000How is the USERS file processed? ================================ See ``man users`` for more detailed documentation. After the items of a request have been mangled by the ``hints`` and ``huntgroups`` files, the ``users`` file is processed. A request has initially an empty check list and an empty reply list attached to it. So each request has 3 "value-pair" lists associated with it - the request list (as originated from the terminal server) - the check list (initially empty) - the reply list (initially empty) For every entry in the users file, the User-Name attribute (Value-Pair) is checked. If it matches, or it is a ``DEFAULT`` entry, then the items on the first line of the entry are compared with the attributes from the request. If all items match (logical "and") then the following actions are taken: - the check items from the current entry are added to the check list of the request. - The reply list of the ``users`` file entry is appended to the reply list of the request Then a check is made to see if the reply pairlist contains a special line of ``Fall-Through = Yes``. If so, the next entry in the ``users`` file is processed as above. If not, we stop processing the ``users`` file. freeradius-server/doc/proxy.rst000066400000000000000000000111121257552170400171770ustar00rootroot00000000000000FreeRADIUS as a proxy RADIUS server. ==================================== Introduction ------------ It is possible to use FreeRADIUS as a proxy RADIUS server. This means that it can consult a remote RADIUS server to validate a user. This is handy for roaming setups, or for renting ports to someone else. Files ----- If a user logs in with a defined realm syntax, the "realm" portion is matched against the configuration to determine how the request should be handled. Common realm formats are: :: username@realm realm/username username%realm realm\username The realm parsing syntax ( and search order ) is user definable via the realm module config in the ``/etc/raddb/radiusd.conf`` configuration file. You can define multiple instances of the realm module to support multiple realm syntax's at the same time. Be sure to pay close attention to the search order that you define, as you may inadvertently get unexpected behaviour ( by having a user use ``realm1/username@realm2`` for instance ). If you need to proxy to IPASS, it should go first, because usernames will be in the form ``IPASS/username@realm`` and you want to proxy these users to IPASS, not to the realm behind the ``@``. The realms are configured in the file ``/etc/raddb/proxy.conf``, which is included by ``radiusd.conf``. The formats and sample configurations are included as comments. The realm ``DEFAULT`` (without the quotes) matches all realms. The realm ``NULL`` matches any requests WITHOUT a realm. If you set the remote server to ``LOCAL``, the request will be handled locally as usual, without sending it to a remote radius server. There are several options you can add in both files: - nostrip: By default the realm is stripped from the username before sending it on to the remote radius server. By specifying the "nostrip" option the @realm suffix will not be stripped. - hints By default the original username is sent to the remote radius server. By specifying the "hints" option the username will be sent as it is after the "hints" file was processed. - notrealm: By default if a realm is matched, it will be proxied to the server specified. However, if you are using Replication functionality, you may want to override this behaviour. This option will prevent a user who enters ``user@foobar`` from being proxied if the ``foobar`` realm configuration contains ``notrealm``. This function used to be called ``notsuffix``, and the old syntax is still supported. The ``/etc/raddb/realms`` file is deprecated and should not be used anymore. If you use the ``/etc/raddb/realms`` file to enter realm configurations you will need to add the hostname and secret for the remote server in the file ``/etc/raddb/clients.conf``. It is not recommended to use both the realms file and the proxy.conf file, as that could cause confusion. Accounting ---------- All accounting data for proxied requests does `not` get stored in the standard logfiles, but in a separate directory. The name of this directory is the name of the remote radius server. Remote Server ---------------- When your server proxies requests to another server, it acts as a NAS for the remote server. On the remote server, you need to add the hostname of your server and the same secret to ``/etc/raddb/clients.conf`` as well. As you might not control the remote radius server, you might want to control the attributes sent back by the remote server in an Access-Accept packet. Have a look at the attrs file for this! What Happens --------------- The exact thing that happens is this: - A user logs in with a realm - The hints file gets processed as usual - The user is checked against the huntgroups file. At this point the user `might` already be rejected. - The realm is looked up in the realms file. If it isn't defined, the users file is processed normally. - If the ``notrealm`` option is defined, the user is processed locally. - The realm is stripped from the username unless ``nostrip`` was set, and the request is sent to a remote radius server. Note that any stripping done in the hints file doesn't have an effect on the username sent to the remote radius server unless you set the ``hints`` option. - The remote server replies with Access-Accept or Access-Reject :: On Access-Accept: The initial Auth-Type is set to Accept On Access-Reject: The initial Auth-Type is set to Reject Then the users file is processed as usual. The username used at this point is the one after hints file processing (regardless of the ``hints`` option). It also includes the realm (regardless of the setting of the ``nostrip`` option) unless the realm is ``LOCAL``. freeradius-server/doc/release-method.rst000066400000000000000000000014071257552170400207220ustar00rootroot00000000000000Release Method ============== As of 2.0, the release process is much simpler. Edit the Changelog with the version number and any last updates. vi doc/ChangeLog git commit doc/ChangeLog Change version numbers in the VERSION file: vi VERSION git commit VERSION Make the files Note that it also does "make dist-check", which checks the build rules for various packages. make dist Validate that the packages are OK. If so, tag the release. Note that this does NOT actually do the tagging! You will have to run the command it prints out yourself. make dist-tag Sign the packages. You will need the correct GPG key for this to work. make dist-sign Push to the FTP site. You will need write access to the FTP site for this to work. make dist-publish freeradius-server/doc/rlm_dbm000066400000000000000000000132101257552170400166240ustar00rootroot00000000000000Radius DBM module 0. INTRODUCTION rlm_dbm uses a Berkeley or GDBM <** database to store use information. It is a lot faster than the files and passwd modules, takes less memory than the fastusers module and does not require additional server software as the LDAP and SQL modules does. In addition it supports groups, and of course multiple entries per user or group. 1. WHAT DOES IT DO Basically, it opens the file you specifies in radiusd.conf and authenticates users out of it. The file has to be a Berkeley or GDBM <** file database, and may be created by rlm_dbm_parse or by a custom program of your choice. 2. HOW TO USE IT Put the module declaration in your radiusd.conf. It should in general look like this: dbm { usersfile = ${confdir}/users.db } Note: some dbm libraries add .db suffix by itself. Then put "dbm" in the "authorize {}" section of your radiusd.conf: authorize { preprocess realms dbm } 3. MODULE OPTIONS The only option is "usersfile", which is the path and filename of the database file you want rlm_dbm to look for users and groups in. This file needs to be generated, either by the rlm_dbm_parse program or by some custom program, for instance a Perl program using the DB_File or GDBM_File <** modules. 4. EXTERNAL UTILITIES rlm_dbm_cat rlm_dbm_cat: [-f file] [-w] [-i number] [-l number] [-v] [username ...] rlm_dbm_cat simply lists the definition(s) of the username(s) or group name(s), or the entire database. It takes the following options: -f The file name of the database to list. -w Long lines should be wrapped -i Set the left margin then wrapped. -l How long line should be to be wrapped (wrap threshold) -v Print the version number and exit. rlm_dbm_parse rlm_dbm_parser [-c] [-d raddb] [-i inputfile] [-o outputfile] [-x] [-v] [-q] [username ...] rlm_dbm_parses reads a file of the syntax defined below, and writes a database file usable by rlm_dbm or edits current database. It takes the following options: -i Use as the input file. If not defined then use standard input. -o Use as the output file. -c Create a new database (empty output file before writing) -x Enable debug mode. ; Multiple x flag increase debug level -q Do not print statistics (quiet). -v Print the version and exit. -r Remove a username or group name from the database. 5. INPUT FORMAT rlm_dbm_parse reads a format similar to the one used by the files module. In incomplete RFC2234 ABNF, it looks like this: entries = *entry entry = identifier TAB definition identifier = username / group-name username = +PCHAR groupname = +PCHAR definition = (check-item ",")* LF ( *( reply-item ",") / ";" ) LF check-item = AS IN FILES reply-item = AS IN FILES *** need definition of username and groupname *** As an example, these are the standard files definitions (files module). ---8<--- DEFAULT Service-Type == Framed-User Framed-IP-Address = 255.255.255.254, Framed-MTU = 576, Service-Type = Framed-User, Fall-Through = Yes #except who call from number 555-666 DEFAULT Auth-Type := Reject,Service-Type ==Framed-User, Calling-Station-ID == "555-666" #or call number 555-667 DEFAULT Auth-Type := Reject,Service-Type ==Framed-User, Calling-Station-ID == "555-667" ---8<--- To be a valid rlm_dbm input file, it should look like this: ---8<--- DEFAULT Service-Type == Framed-User # (1) Framed-IP-Address = 255.255.255.254, # comma, list cont'd Framed-MTU = 576, Service-Type = Framed-User, Fall-Through = Yes # \n, end of list Auth-Type := Reject,Service-Type ==Framed-User, # (2) Calling-Station-ID == "555-666" ; # ;, no reply items Auth-Type := Reject,Service-Type ==Framed-User, # (3) Calling-Station-ID == "555-667" ; # ditto ---8<--- This user (the DEFAULT user) contains three entries, 1, 2 and 3. The first entry has a list of reply items, terminated by a reply item without a trailing comma. Entries 2 and 3 has empty reply lists, as indicated by the semicolon. This is necessary to separate an empty line (which is ignored) from the empty list. Definition Fall-Through = Yes used in order to say module to check next record. By default Fall-Through = Yes. Groups This is implemented with the special User-Category attribute. Simply set this as a reply item, and rlm_dbm will include the groups definition when evaluating the check and reply items of the user. The group defined the same way as users. Here is a short example: ---8<--- # group definitions gendialup Service-Type = Framed-User, Cisco-AVPair += "ip:addr-pool=SANDY", Framed-Protocol = PPP locked Auth-Type := Reject Reply-Message = "Your account has been disabled." # user definitions ssalex Auth-Type := Local, Password == "passs" User-Category = "GenDialup" ssmike Auth-Type := Local, Password == "pass1" User-Category = "Locked" ---8<--- 6. ACKNOWLEDGMENTS Author - Andrei Koulik Documentation - Bjørn Nordbø 8. Bug reports: rlm_dbm_bug@agk.nnov.ru freeradius-server/doc/rlm_eap000066400000000000000000000316701257552170400166410ustar00rootroot00000000000000 Extensible Authentication Protocol (EAP) INTRODUCTION Extensible Authentication Protocol(EAP), rfc2284, is a general protocol that allows network access points to support multiple authentication methods. Each EAP-Type indicates a specific authentication mechanism. 802.1x standard authenticates wireless LAN users trying to access enterprise networks. RADIUS attribute used for EAP is EAP-Message, 79(rfc2869). RADIUS communicates all EAP messages by embedding them in this attribute. General Terminology Supplicant/EAP Client - is the software on the end-user/client machine (machine with the wireless card). Authenticator/NAS/Access Point(AP) - A network device providing users with a point of entry into the network. EAPOL - EAP over LAN as defined in 802.1x standard. EAPOW - EAP over Wireless. +----------+ +----------+ +----------+ | | EAPOL | | RADIUS | | | EAP |<------>| Access |<------>| RADIUS | | Client | EAPOW | Point | (EAP) | Server | | | | | | | +----------+ +----------+ +----------+ The sequence of events, for EAP-MD5, runs as follows: 1. The end-user associates with the Access Point(AP). 2. The supplicant specifies AP to use EAP by sending EAP-Start. 3. AP requests the supplicant to Identify itself (EAP-Identity). 4. Supplicant then sends its Identity (username) to the AP. 5. AP forwards this EAP-response AS-IS to the RADIUS server. (The supplicant and the RADIUS server mutually authenticate via AP. AP just acts as a passthru till authentication is finished.) 6. The server sends a challenge to the supplicant. 7. The supplicant carries out a hash on the password and sends this hashed password to the RADIUS server as its response. 8. The RADIUS server performs a hash on the password for that supplicant in its user database and compares the two hashed values and authenticates the client if the two values match(EAP-Success/EAP-Failure) 9. AP now opens a port to accept data from the end-user. Currently, EAP is widely used in wireless networks than in wired networks. In 802.11/wireless based networking, following sequence of events happen in addition to the above EAP events. 10. RADIUS server and the supplicant agree to a specific WEP key. 11. The supplicant loads the key ready for logging on. 12. The RADIUS server sends the key for this session (Session key) to the AP. 13. The AP encrypts its Broadcast key with the Session key 14. The AP sends the encypted key to the supplicant 15. The supplicant decrypts the Broadcast key with the Session key and the session continues using the Broadcast and Session keys until the session ends. References: The Implementation of EAP over RADIUS is based on the following RFCs rfc2869 -- RADIUS Extensions rfc2284 -- PPP Extensible Authentication Protocol (EAP) rfc2716 -- PPP EAP TLS Authentication Protocol Following links help to understand HOW EAP works www.ieee802.org/1/mirror/8021/docs2000/ieee_plenary.PDF EAP CODE ORGANIZATION EAP is implemented as a module in freeradius and the code is placed in src/modules/rlm_eap. All EAP-Types are organized as subdirectories in rlm_eap/types/. Each EAP-Type, like types/rlm_eap_md5, contains a chunk of code that knows how to deal with a particular kind of authentication mechanism. To add a new EAP-Type then a new directory should be created as rlm_eap/types/rlm_eap_XXXX, where XXXX is EAP-Type name ie for EAP-Type like ONE TIME PASSWORD (OTP) it would be rlm_eap_otp src/modules/rlm_eap -- contains the basic EAP and generalized interfaces to all the EAP-Types. rlm_eap/types -- contains all the supported EAP-Types rlm_eap/types/rlm_eap_md5 -- EAP-MD5 authentication. rlm_eap/types/rlm_eap_tls -- EAP-TLS based authentication. rlm_eap/types/rlm_eap_ttls -- TTLS based authentication. rlm_eap/types/rlm_eap_peap -- Windows PEAP based authentication. rlm_eap/types/rlm_eap_leap -- Cisco LEAP authentication. rlm_eap/types/rlm_eap_sim -- EAP-SIM (GSM) based authentication CONFIGURATION Add the eap configuration stanza to the modules section in radiusd.conf to load and control rlm_eap and all the supported EAP-Types: For example: modules { ... eap { default_eap_type = md5 md5 { } ... } ... } NOTE: You cannot have empty eap stanza. At least one EAP-Type sub-stanza should be defined as above, otherwise the server will not know what type of eap authentication mechanism to be used and the server will exit with error. All the various options and their associated default values for each EAP-Type are documented in the sample radiusd.conf that is provided with the distribution. Since the EAP requests may not contain a requested EAP type, the 'default_eap_type' configuration options is used by the EAP module to determine which EAP type to choose for authentication. NOTE: EAP cannot authorize a user. It can only authenticate. Other Freeradius modules authorize the user. EAP SIM server To configure EAP-SIM authentication, the following attributes must be set in the server. This can be done in the users file, but in many cases will be taken from a database server, via one of the SQL interface. If one has SIM cards that one controls (i.e. whose share secret you know), one should be able to write a module to generate these attributes (the triplets) in the server. If one has access to the SS7 based settlement network, then a module to fetch appropriate triplets could be written. This module would act as an authorization only module. The attributes are: EAP-Sim-Rand1 16 bytes EAP-Sim-SRES1 4 bytes EAP-Sim-KC1 8 bytes EAP-Sim-Rand2 16 bytes EAP-Sim-SRES2 4 bytes EAP-Sim-KC2 8 bytes EAP-Sim-Rand3 16 bytes EAP-Sim-SRES3 4 bytes EAP-Sim-KC3 8 bytes EAP-SIM will send WEP attributes to the resquestor. EAP CLIENTS 1. XSupplicant - freeradius (EAP/TLS) notes may be found at: http://www.eax.com/802/ or http://www.missl.cs.umd.edu/wireless/eaptls/ XSupplicant is hosted by: http://www.open1x.org/ 2. XP - freeradius (EAP/TLS) notes may be found at: http://www.denobula.com/EAPTLS.pdf 3. Freeradius has an "radeapclient" that can do EAP-MD5 (passwords), as well as EAP-SIM. It is in modules/rlm_eap/radeapclient. TESTING You will find several test cases in src/tests/ for the EAP-SIM code. HOW DO I USE IT (FAQ/Examples) 1. How can I enable EAP-MD5 authentication ? In radiusd.conf modules { ... eap { default_eap_type = md5 md5 { } ... } ... } # eap sets the authenticate type as EAP authorize { ... eap } # eap authentication takes place. authenticate { eap } # If you are proxying EAP-LEAP requests # This is required to make LEAP work. post-proxy { eap } 2. My Userbase is in LDAP and I want to use EAP-MD5 authentication In radiusd.conf modules { ... eap { default_eap_type = md5 md5 { } ... } ... } # ldap gets the Configured password. # eap sets the authenticate type as EAP authorize { ... ldap eap ... } # eap authentication takes place. authenticate { ... eap ... } 3. How can I Proxy EAP messages, with/without User-Name attribute in the Access-Request packets With User-Name attribute in Access-Request packet, EAP-proxying is just same as RADIUS-proxying. If User-Name attribute is not present in Access-Request packet, Freeradius can proxy the request with the following configuration in radiusd.conf # eap module should be configured as the First module in # the authorize stanza authorize { eap ... other modules. } With this configuration, eap_authorize creates User-Name attribute from EAP-Identity response, if it is not present. Once User-Name attribute is created, RADIUS proxying takes care of EAP proxying. 4. How Freeradius can handle EAP-START messages ? In most of the cases this is handled by the Authenticator. Only if it is required then, in radiusd.conf authorize { eap ... other modules. } With the above configuration, RADIUS server immediately responds with EAP-Identity request. NOTE: EAP does not check for any Identity or maintains any state in case of EAP-START. It blindly responds with EAP-Identity request. Proxying is handled only after EAP-Identity response is received. 5. I want to enable multiple EAP-Types, how can I configure ? In radiusd.conf modules { ... eap { default_eap_type = tls md5 { } tls { ... } ... } ... } The above configuration will let the server load all the EAP-Types, but the server can have only one default EAP-Type, as above. Once EAP-Identity response is received by the server, based on the default_eap_type, the server will send a new request (MD5-Challenge request incase of md5, TLS-START request incase of tls) to the supplicant. If the supplicant is rfc2284 compliant and doesnot support the EAP-Type sent by the server then it sends EAP-Acknowledge with the supported EAP-Type. If this EAP-Type is supported by the server then it will send the respective EAP-request. Example: If the supplicant supports only EAP-MD5 but the server default_eap_type is configured as EAP-TLS, as above, then the server will send TLS-START after EAP-Identity is received. Supplicant will respond with EAP-Acknowledge(EAP-MD5). Server now responds with MD5-Challenge. INSTALLATION EAP, EAP-MD5, and Cisco LEAP do not require any additional packages. Freeradius contains all the required packages. For EAP-TLS, EAP-TTLS, and PEAP, OPENSSL, , is required to be installed. Any version from 0.9.7, should fairly work with this module. EAP-SIM should not require any additional packages. IMPLEMENTATION (For Developers) The rlm_eap module only deals with EAP specific authentication mechanism and the generic interface to interact with all the EAP-Types. Currently, these are the existing interfaces, int attach(CONF_SECTION *conf, void **type_arg); int initiate(void *type_arg, EAP_HANDLER *handler); int authenticate(void *type_arg, EAP_HANDLER *handler); int detach(void **type_arg); attach() and detach() functions allocate and deallocate all the required resources. initiate() function begins the conversation when EAP-Identity response is received. Incase of EAP-MD5, initiate() function sends the challenge. authenticate() function uses specific EAP-Type authentication mechanism to authenticate the user. During authentication many EAP-Requests and EAP-Responses takes place for each authentication. Hence authenticate() function may be called many times. EAP_HANDLER contains the complete state information required. HOW EAP WORKS as posted to the list, by John Lindsay To make it clear for everyone, the supplicant is the software on the client (machine with the wireless card). The EAP process doesn't start until the client has associated with the Access Point using Open authentication. If this process isn't crystal clear you need to go away and gain understanding. Once the association is made the AP blocks all traffic that is not 802.1x so although associated the connection only has value for EAP. Any EAP traffic is passed to the radius server and any radius traffic is passed back to the client. So, after the client has associated to the Access Point, the supplicant starts the process for using EAP over LAN by asking the user for their logon and password. Using 802.1x and EAP the supplicant sends the username and a one-way hash of the password to the AP. The AP encapsulates the request and sends it to the RADIUS server. The radius server needs a plaintext password so that it can perform the same one-way hash to determine that the password is correct. If it is, the radius server issues an access challenge which goes back via to the AP to the client. (my study guide says client but my brain says 'supplicant') The client sends the EAP response to the challenge via the AP to the RADIUS server. If the response is valid the RADIUS server sends a success message and the session WEP key (EAP over wireless) to the client via the AP. The same session WEP key is also sent to the AP in the success packet. The client and the AP then begin using session WEP keys. The WEP key used for multicasts is then sent from the AP to the client. It is encrypted using the session WEP key. ACKNOWLEDGEMENTS Primary author - Raghu EAP-SIM - Michael Richardson The development of the EAP/SIM support was funded by Internet Foundation Austria (http://www.nic.at/ipa). freeradius-server/doc/rlm_expiration000066400000000000000000000013561257552170400202540ustar00rootroot00000000000000Module to expire user accounts. This module can be used to expire user accounts. Expired users receive an Access-Reject on every authentication attempt. Expiration is based on the Expiration attribute which should be present in the check item list for the user we wish to perform expiration checks. Expiration attribute format: You can use Expiration := "23 Sep 2004" and the user will no longer be able to connect at 00:00 (midnight) on September 23rd, 2004. If you want a certain time (other than midnight) you can do use Expiration := "23 Sep 2004 12:00". The nas will receive a Session-Timeout attribute calculated to kick the user off when the Expiration time occurs. Example entry (users files): user1 Expiration := "23 Sep 2004" freeradius-server/doc/rlm_fastusers000066400000000000000000000102051257552170400201020ustar00rootroot00000000000000 Radius FastUsers Module 0. INTRODUCTION The 'fastusers' module provides an interface for authentication exactly like the standard RADIUS 'users' file. It's function is is exactly like that of rlm_files in FreeRadius, but it is consid- ably faster. So why keep rlm_files around? Because it's good, working code, and rlm_fastusers may still have bugs causing it to behave differently from rlm_files in very exotic cases. 1. WHAT DOES IT DO Very simply, the module reads in the file you specify in radiusd.conf into a hash table and then authenticates the users out of it. This is very similar to the way that passwd caching works (see README.cache), but because of the 'users' file format, we can specify arbitrary check items and reply items for each user. 2. HOW DO I USE IT First thing you do is declare the module in radiusd.conf. The default setting looks like this: fastusers { usersfile = ${confdir}/users_fast hashsize = 1000 compat = no hash_reload = 600 } See below for a detailed explanation of the module options. Then you must put 'fastusers' in the 'authorize{}' section of your radiusd.conf. For example: authorize { preprocess realm fastusers } 3. MODULE OPTIONS A. usersfile The 'usersfile' is the path and filename of the file you want fastusers to read and use to authenticate users. The format is exactly like that used by rlm_files. B. hashsize The 'hashsize' variable controls how many 'buckets' or 'nodes' the hash table will have in it. This allows the admnistrator to control how much memory is allocated to the hash table. It also allows him/her to significantly impact the performance of the hash (for better or worse!!). Each hash 'bucket' is a pointer to a list of users that fit the requirements to be in that bucket. If the number of users is very high and the 'hashsize' is very small, that means you will have a large number of users per bucket. This will *negatively* impact performance. In an ideal world, you would have exactly one user per bucket, but this is very unlikely to happen. Conversely, if you have only 10 users in listed in the file and you set 'hashsize' to be 1000, you know that you have 100 times as many buckets as users, and are therefore wasting memory. So what should you shoot for? Well, I'll tell you as a general rule to simply take the number of users you list in the file and use that for the 'hashsize' value. However, the frugal admin could divide that number by 5 or 10 and still achieve much greater performance that that produced by 'users'. Still, if you aren't strapped for memory, I recommend going no lower than 'hashsize= # of users / 3'. It's up to you though, test it with different values and see how it affects performance (see README.testing). NOTE: If you use value of '1' for hashsize, you will have effectively created a singly linked list, and thus removed all performance benefit of using the module. C. compat This works the same as it does in the rlm_users config section. It allows you to declare cistron compatibility mode when reading in the 'users' file. D. hash_reload = 600 Number of seconds between automatic reloading of the users cache. Using this option means the module will double memory usage, but only while the reload is in progress. However, it will eliminate blocking of user access during a reload and allow longer times between server HUPs. You can disable this feature with hash_reload = 0; 4. CAVEATS It probably still has bugs. Most notably, there is a small memory leak somewhere in the reloading code. I suspect it's in pairlist_read from files.c, but I have no proof yet. 5. ACKNOWLEDGEMENTS Author - Jeff Carneal freeradius-server/doc/rlm_jradius000066400000000000000000000060661257552170400175360ustar00rootroot00000000000000 rlm_jradius JRadius is a Java RADIUS client and server framework. As a client, it provides a pure Java interface. When ran as a (pure Java) server, JRadius listens for requests from the rlm_jradius module running in FreeRADIUS. The module sends JRadius the RADIUS request, reply, and the internal FreeRADIUS 'config_items' attribute list and returns the same after processing. Configuring rlm_jradius for use with a running JRadius server starts with the module definition, in jradius.conf, as follows: jradius { name = "example" # Name of the JRadius Application # (known as "Sender" in JRadius) primary = "127.0.0.1" # Primary JRadius Server # (using default port of 1814) secondary = "192.168.1.2:1815" # Secondary JRadius Server (port 1815) tertiary = "192.168.1.2:1816" # Tertiary JRadius Server timeout = 1 # JRadius Server Connect Timeout (default 5) onfail = NOOP # What to do if no JRadius # Server is found. Options are: # FAIL (default), OK, REJECT, NOOP keepalive = yes # Keep connections to JRadius pooled connections = 8 # Number of pooled JRadius connections allow_codechange = yes # Allow the changing the RADIUS code/type allow_idchange = yes # Allow the change of the RADIUS pkt id } The 'name' can be used in the JRadius server to define a specific logic "chain" of handlers. Three JRadius servers can be defined for redundancy - making it easier to upgrade JRadius and its handlers. It is recommended to run the FreeRADIUS module in 'keepalive' mode whereby connections to JRadius are pool, similar to the rlm_sql module. The jradius.conf configuration file then needs to be included into the radiusd.conf modules block, for instance: modules { ... $INCLUDE ${confdir}/jradius.conf } And the 'jradius' module must be added to the appropriate handler blocks, commonly: authorize { ... jradius } preacct { ... jradius } accounting { ... jradius } ...and so on... JRadius Quick-start: Starting JRadius server: wget http://jradius.net/dist/jradius-current.zip unzip jradius-current.zip cd jradius sh jradius.sh Running the JRadius Simulator: sh jRadiusSimulator.sh Using RadClient: echo "User-Name = test" > radius.pkt echo "User-Password = test" >> radius.pkt sh radclient.sh localhost testing123 radius.pkt To build a new jradius-dictionary.jar for your specific FreeRADIUS dictionary, see the ant's build.xml or maven's dictionary/pom.xml in the source svn. JRadius does have some Vendor Specific Attributes; see dictionary.jradius and ensure it is included in your main dictionary file. For more information, see http://jradius.net/ freeradius-server/doc/rlm_krb5000066400000000000000000000010111257552170400167210ustar00rootroot00000000000000The rlm_krb5 module, by default, presumes you have the MIT Kerberos 5 distribution. Notes from that distribution: On linux, you may have to change: deplibs_test_method="pass_all" in ../libtool Otherwise, it complains if the krb5 libs aren't shared. ---- If you are using the Heimdal Kerberos 5 distribution, pass a --enable-heimdal-krb5 to the configure line. With Heimdal, you'll need to have a radius/your.hostname.example.org key in your keytab (which needs to be readable by the user running the RADIUS server). freeradius-server/doc/rlm_ldap000066400000000000000000000344371257552170400170200ustar00rootroot000000000000001. INSTALLATION This module depends on OpenLDAP v2.x SDK libraries. For details on obtaining source of OpenLDAP look at . OpenLDAP SDK in turn depends on OpenSSL crypto libraries and (optionaly) on Cyrus-SASL libraries. See also: http://www.tldp.org/HOWTO/LDAP-Implementation-HOWTO/radius.html It's not up to date, though. For example, you do NOT have to edit the "dictionary" file. 2. LDAP ATTRIBUTES The mapping between radius and ldap attributes is in raddb/ldap.attrmap. You should edit the file and add any new mapping which you need. The schema files is located in doc/examples/openldap.schema. Before adding any radius attributes the ldap server schema should be updated. All ldap entries containing radius attributes should contain at least "objectclass: radiusprofile" radiusCheckItem and radiusReplyItem are special. They allow the administrator to add any check or reply item respectively without adding it in the ldap schema. The format should be : ie radiusReplyItem: Cisco-AVPair := "ip:addr-pool=dialin_pool" 3. CONFIGURATION Add following subsection to the modules{} section of radiusd.conf to control the rlm_ldap module: modules { ... ldap { # server: LDAP server hostname/ip address # # Optionaly could contain space separated list of host[:port], but # redundancy/resiliency is better acheived configuring multiple rlm_ldap # module instances and invocing them in redundand/failover # configuration in authorize/authenticate sections # # You can also pass an ldap url like ldap://localhost # That way you can also specify alternative ldap schemas like # ldaps:// or ldapi:// # The port directive will be ignored in that case # # default: settings for your system, as set in etc/openldap/ldap.conf # server = localhost # port: LDAP server port # # If LDAP server port is set to 636 (ldaps), SSL connection is enforced. # This feature is useful for LDAP servers which support SSL, but don't # do TLS negotiation (like Novell eDirectory). # # default: 389 (ldap) # port = 636 # net_timeout: # of seconds to wait for response of the server (network # failures) default: 10 # net_timeout = 1 # timeout: # seconds to wait for LDAP query to finish default: 20 # timeout = 2 # timelimit: # of seconds server has to process the query (server-side # time limit) default: 20 # timelimit = 5 # ldap_debug: debug flag for LDAP SDK (see OpenLDAP documentation) # default: 0x0000 (no debugging messages) # Example:(LDAP_DEBUG_FILTER+LDAP_DEBUG_CONNS) ldap_debug = 0x0028 # identity: DN under which LDAP searches are done password: password # which authenticate this DN default: anonymous bind, no password # required NOTE: searches are done now over unencrypted connection! # # identity = "cn=admin,o=My Org,c=UA" password = mypass # ldap_connections_number: The number of ldap connections that the # module will keep open to use in requests. Usually it will not need to # be larger than 5-10 connections default: 5 ldap_connections_number = 5 # basedn = # basedn = "o=My Org,c=UA" # filter: LDAP search filter, to locate user object using name supplied # by client during Radius authentication # # default: filter = "(uid=%u)" # base_filter: The LDAP search filter used for base scope searches, like # when searching for the default or regular profiles # # deafault: base_filter = "(objectclass=radiusprofile)" filter = "(uid=%u)" # start_tls: When set to "yes" the StartTLS extended operation is used to # start TLS transport encryption. start_tls = no # tls_mode: When set to "yes" OR the server port is 636 we try to connect with TLS # Start TLS should be prefered, tls_mode is provided only for ldap servers # like Active Directory which do not support it. # default: no tls_mode = no # tls_cacertfile: A PEM-encoded file that contains the CA Certificates that # you trust tls_cacertfile = /path/to/cacert.pem # tls_cacertdir: Path the a directory of CA Certificates that you trust, the # directory must be in "hash format" (see openssl verify) tls_cacertdir = /path/to/ca/dir/ # tls_certfile: The PEM Encoded certificate file that we should present to # clients connecting tls_certfile = /path/to/radius.crt # tls_keyfile: The PEM Encoded private key that we should use to encrypt the # session tls_keyfile = /path/to/radius.key # tls_randfile: A file containing random data to seed the OpenSSL PRNG. Not # needed if your OpenSSL is already properly random. tls_randfile = /path/to/rnd # tls_require_cert: Certificate Verification requirements. Can be "never" # (don't even bother trying), "allow" (try, but don't fail if the cerificate # can't be verified), or "demand" (fail if the certificate doesn't verify.) # The default is "allow" tls_require_cert = "allow" # default_profile: DN of a LDAP object, which contains default RADIUS # attributes. default: NULL - use only user specific attributes or # attributes, supplied by other modules. # default_profile = "cn=RadProfile,o=My Org,c=UA" # profile_attribute: user object attribute, which contains DN of # radiusProfile object for this user. default: NULL - use only user # specific attributes or attributes, supplied by other modules. # # profile_attribute = "radiusProfileDn" # access_attr_used_for_allow: Define if the access attribute (described # below) will be used to allow access (meaning if it exists then user # remote access will be allowed) or to deny access. default: yes - used # to allow access # access_attr: if attribute is specified, module checks for its # existance in user object. If access_attr_used_for_allow is set to # yes: If it exists the user is allowed to get remote access. If it # exists and is set to FALSE the user is denied remote access. If it # does not exist user is denied remote access by default if # access_attr_used_for_allow is set to no: If it exists the user is # denied remote access. If it does not exist user is allowed remote # access. # # default: NULL - don't check for the attribute access_attr = "dialupAccess" # password_header: If the user password is available we add it to the # check items (to assist in CHAP ie) striping any headers first. # NOTE: The password_header directive is NOT case insensitive # default: NULL # # password_header = "{clear}" # password_attribute: Define the attribute which contains the user # password. # While integrating FreeRADIUS with Novell eDirectory, set # 'password_attribute = nspmpassword' in order to use the universal # password of the eDirectory users for RADIUS authentication. This will # work only if FreeRADIUS is configured to build with --with-edir option. # # default: NULL - don't add password # # password_attribute = "userPassword" # edir_account_policy_check: Specifies if the module has to enforce # Novell eDirectory account policy check and intruder detection for # RADIUS users. This will work only if FreeRADIUS is configured to build # with --with-edir option. # # default: yes - eDirectory account policy check enabled # # edir_account_policy_check = no # groupname_attribute: The attribute containing group name in the LDAP # server. It is used to search group by name. # # default: cn - Search filter is "(cn=%GroupName)" # # groupname_attribute = "cn" # compare_check_items: Specifies if the module will do a comparison on # the check items extracted from the ldap with the corresponding items # present in the incoming request. # # default: no - don't do any comparisons # # compare_check_items = yes # do_xlat: Specifies if the module will do an xlat on the radius attributes # extracted from the ldap database. Also the attribute operators will be # honored. If the directive is set to 'no' then we will fall back to the # pairadd() function which will just add the attributes at the end of the # corresponding attribute list (check or reply items). This can be used to # fall back to 0.8.1 behaviour without changing the ldap data or to gain a # little performance if the ldap data is rather simple (no special operators) # # default: yes - do an xlat and honor operators # # do_xlat = yes # groupmembership_filter: The filter to search for group membership of a # particular user after we have found the DN for the group. # # default: (|(&(objectClass=GroupOfNames)(member=%{control:Ldap-UserDn}))(&(objectClass=GroupOfUniqueNames)(uniquemember=%{control:Ldap-UserDn}))) # # groupmembership_filter = "(|(&(objectClass=GroupOfNames)(member=%{control:Ldap-UserDn}))(&(objectClass=GroupOfUniqueNames)(uniquemember=%{control:Ldap-UserDn})))" # groupmembership_attribute: The attribute in the user entry that states # the group the user belongs to. The attribute can either contain the # group name or the group DN. If it contains the group DN # groupmembership_attribute will also be used to find the group's name. # The attribute will be used after a search based on the # groupname_attribute and groupmembership_filter has failed. default: # NULL - don't search for a group based on attributes in the user entry. # # groupmembership_attribute = "radiusGroupName" } } MODULE MESSAGES: On user rejection rlm_ldap will return the following module messages: "rlm_ldap: User not found" "rlm_ldap: Access Attribute denies access" "rlm_ldap: Bind as user failed" These messages will be visible in radius.log as aditional information in "Login incorrect" and "Invalid user" log messages. LDAP XLAT: The ldap module now supports LDAP URLs in xlat strings. That is you can now add LDAP URLs in the configuration options and hopefully shortly also in the users file. The strings will be of the following form: %{ldap:ldap:///dc=company,dc=com?uid?sub?uid=%u} The requested attributes list MUST contain only ONE attribute. In case this attribute is multi valued which value is returned is considered UNDEFINED. Also, adding the host:port information SHOULD be avoided unless there are more than one ldap module instances in which case the host,port information can be used to distinguish which module will actually return the information (the xlat function will return NULL if the host,port information does not correspond to the configured attributes). If there are more than one instances the module instance name can be used instead of the string 'ldap' before the ldap url to decide which instance will return the information. That is the xlat string will be of the form: %{$instance_name:ldap:///dc=comapny,dc=com?uid?sub?uid=%u} i.e.: ${ldap_company1:ldap:///dc=company1,dc=com?uid?sub?uid=%u} USER PROFILE ATTRIBUTE: The module can use the User-Profile attribute. If it is set, it will assume that it contains the DN of a profile entry containing radius attributes. This entry will _replace_ the default profile directive. That way we can use different profiles based on checks on the radius attributes contained in the Access-Request packets. For example (users file): DEFAULT Service-Type == Outbound-User, User-Profile := "uid=outbound-dialup,dc=company,dc=com" GROUP SUPPORT: The module supports searching for ldap groups by use of the Ldap-Group attribute. As long as the module has been instanciated it can be used to do group membership checks through other modules. For example in the users file: DEFAULT Ldap-Group == "disabled", Auth-Type := Reject Reply-Message = "Sorry, you are not allowed to have dialup access" DNs are also accepted as Ldap-Group values, i.e.: DEFAULT Ldap-Group == "cn=disabled,dc=company,dc=com", Auth-Type := Reject Reply-Message = "Sorry, you are not allowed to have dialup access" Also if you are using multiple ldap module instances a per instance Ldap-Group attribute is registered and can be used. It is of the form -Ldap-Group. In other words if in radiusd.conf we configure an ldap module instance like: ldap myname { [...] } we can then use the myname-Ldap-Group attribute to match user groups. Make sure though that the ldap module is instantiated *before* the files module so that it will have time to register the corresponding attribute. One solution would be to add the ldap module in the instantiate{} block in radiusd.conf USERDN Attribute: When rlm_ldap has found the DN corresponding to the username provided in the access-request (all this happens in the authorize section) it will add an Ldap-UserDN attribute in the request items list containing that DN. The attribute will be searched for in the authenticate section and if present will be used for authentication (ldap bind with the user DN/password). Otherwise a search will be performed to find the user dn. If the administrator wishes to use rlm_ldap only for authentication or does not wish to populate the identity,password configuration attributes he can set this attribute by other means and avoid the ldap search completely. For instance it can be set through the hints file in the authorize section: DEFAULT Ldap-UserDN := `uid=%{User-Name},ou=people,dc=company,dc=com` The "users" file won't work, because it can't add items to the request. DIRECTORY COMPATIBILITY NOTE: If you use LDAP only for authorization and authentication (e.g. you can not afford schema extension), we suggest you set all necessary attributes in raddb/users file with following authorize section of radiusd.conf : authorize { ldap { notfound = return } files } LDAP and Active Directory ------------------------- Active directory does not return anything in the userPassword attribute, unlike other LDAP servers. As a result, you cannot use Active Directory to perform CHAP, MS-CHAP, or EAP-MD5 authentication. You can only use PAP, and then only if you list "ldap" in the "authenticate" section. To do MS-CHAP against an Active Directory domain, see the comments in radiusd.conf, about "ntlm_auth". You will need to install Samba. If you see "Operations error" returned from an LDAp query, you may need to set dsHeuristics to 0000002 in Active Directory. This allows searches to function similar to how they did in Active Directory 2k2. You can update dsHeuristics by launching ldp.exe, going to 'connection' and create a new connection. Then goto bind and bind to your ldap server. Next select the 'Browse' menu and choose 'modify'. The DN *might* look like this: CN=Directory Service,CN=Windows NT,CN=Services,CN=Configuration,DC=mycompany,DC=com Attribute is: dsHeuristics Value is: 0000002 Set the operation to replace and you should be set. This should solve the 'Operations error' error that happens when attempting to search without specifying an OU. freeradius-server/doc/rlm_pam000066400000000000000000000064101257552170400166430ustar00rootroot00000000000000 PAM Support for FreeRadius 0. INTRODUCTION PAM support was done by Jeph Blaize. Miguel a.l. Paraz ported it to FreeRADIUS' parent, Cistron-Radius. Chris Dent added the Pam-Auth attribute. 1. USAGE Use Auth-Type = Pam in the users file. You cannot use User-Password = "PAM" as in other radius servers. Sorry. You can also use ``Pam-Auth = "somestring"'' to specify an entry in /etc/pam.d. The default is "radius". Compile and install freeradius with pam support (./configure --help will tell you how) Within your radiusd.conf file, in the 'modules' section, make sure that the pam section is enabled: pam { # # The name to use for PAM authentication. # PAM looks in /etc/pam.d/${pam_auth_name} # for it's configuration. # # Note that any Pam-Auth attribute set in the 'users' # file over-rides this one. # pam_auth = radiusd } In the 'authenticate' section, do the same: authenticate { # Uncomment this if you want to use PAM (Auth-Type = PAM) pam ... In your /etc/pam.d/ directory create a file called radiusd with the following contents (or whatever you want for your pam configuration, this seems to work for me): #%PAM-1.0 auth required /lib/security/pam_unix_auth.so shadow md5 nullok auth required /lib/security/pam_nologin.so account required /lib/security/pam_unix_acct.so password required /lib/security/pam_cracklib.so password required /lib/security/pam_unix_passwd.so shadow md5 nullok use_authtok session required /lib/security/pam_unix_session.so If you don't want to run your freeradius server in debug mode as root (ie, run as an unpriviledged user) you will need to run freeradius with a group membership that is able to read the /etc/shadow file - otherwise pam will be unable to read the /etc/shadow file and will fail. I suggest a group called 'shadow' or the like. $ chgrp /etc/shadow shadow $ chmod g+w /etc/shadow And in the radiusd.conf file: # On systems with shadow passwords, you might have to set 'group = shadow' # for the server to be able to read the shadow password file. # # Change below to suit your setup. user = radius group = shadow Please understand that giving anything except root read permissions to the /etc/shadow file is something that you want to think a bit upon!! 2. NOTES None. 3. TODO: Real PAM support, figure out how we can write a module that will make it blend in with PAM more seamlessly. With this, we can replace the DENY_SHELL with something more flexible such as a database. 4. EXAMPLE: DEFAULT Auth-Type = Pam, NAS-IP-Address = 206.97.64.5 Service-Type = Framed-User, Framed-Protocol = PPP, Framed-IP-Address = 255.255.255.254, Filter-Id = "std.ppp", Framed-MTU = 1500, Framed-Compression = Van-Jacobson-TCP-IP DEFAULT Auth-Type = Pam, Pam-Auth = "radius2", NAS-IP-Address = 127.0.0.1 Service-Type = Framed-User, Framed-Protocol = PPP, Framed-IP-Address = 255.255.255.254, Filter-Id = "std.ppp", Framed-MTU = 1500, Framed-Compression = Van-Jacobson-TCP-IP freeradius-server/doc/rlm_passwd000066400000000000000000000043271257552170400173740ustar00rootroot00000000000000RADIUS rlm_passwd (passwd-like files authorization module) FAQ Q: Can I use rlm_passwd to authenticate user against Linux shadow password file or BSD-style master.passwd? A: Yes, but you need RADIUS running as root. Hint: use Crypt-Password attribute. You probably don't want to use this module with FreeBSD to authenticate against system file, as it already takes care of caching passwd file entries, but it may be helpfull to authenticate against alternate file. Q: Can I use rlm_passwd to authenticate user against SAMBA smbpasswd? A: Yes, you can. Hint: use LM-Password/NT-Password attribute, set authtype = MS-CHAP. Q: Can I use rlm_password to authenticate user against BLA-BLA-BLApasswd? A: Probably you can, if BLA-BLA-BLA stores password in some format supported by RADIUS, for example cleartext, NT/LM hashes, crypt, Netscape MD5 format. You have to set authtype to corresponding type, for example authtype = NS-MTA-MD5 for Netscape MD5. Q: Are where are differences between rlm_passwd and rlm_unix? A: rlm_passwd supports passwd files in any format and may be used, for example, to parse FreeBSD's master.passwd or SAMBA smbpasswd files, but it can't perform system authentication (for example to authenticate NIS user, like rlm_unix does). If you need system authentication you need rlm_unix, if you have to authenticate against files only under BSD you need rlm_passwd, if you need to authenticate against files only under Linux, you can choose between rlm_unix and rlm_passwd, probably you will have nearly same results in performance (I hope :) ). Q: I'm using realms with rlm_passwd. I see rlm_passwd do not strip realm from user name. How to configure rlm_passwd to strip realm? A: In case you configured realm to strip username, User-Password attribute is not changed. Instead, rlm_realm creates new attribute Stripped-User-Name. All you need is to use Stripped-User-Name instead of User-Name as a key field for passwd file. Q: How can I say passwd to add attribute even if it's value is empty? A: set ignoreempty to "no" in module configuration. 5. Acknowlegements: ZARAZA, <3APA3A@security.nnov.ru> Michael Chernyakhovsky - reply-items support freeradius-server/doc/rlm_python000066400000000000000000000034261257552170400174130ustar00rootroot00000000000000Python module for freeradius Copyright 2002 Miguel A Paraz Copyright 2002 Imperium Technology, Inc. PURPOSE: To allow module writers to write modules in a high-level language, for implementation or for prototyping. REQUIRES: Python - tested with 2.2 BUILDING: ./configure --with-experimental-modules USAGE: Make your module available to the Python interpreter by either putting it in a standard location, or 'EXPORT PYTHONPATH=$location'. BUGS: 1. Can't compile statically (./configure --enable-shared=no) - causes SIGSEGV on the first malloc() in main(). Design: 1. Support for all module functions. 2. One module per function allowed, for example, from experimental.conf: python { mod_instantiate = radiusd_test func_instantiate = instantiate mod_authorize = radiusd_test func_authorize = authorize mod_accounting = radiusd_test func_accounting = accounting mod_preacct = radiusd_test func_preacct = preacct mod_detach = radiusd_test func_detach = detach } 3. Different functions are wrappers around the same core. 4. func_detach is passed no parameters, returns module return value. 5. If functions returns None (plain 'return' no return), default to RLM_OK 6. Python instantation function can return -1 to signal failure and abort startup. Available to module: import radiusd radiusd.rad_log(radiusd.L_XXX, message_string) radiusd.RLM_XXX TODO: 1. Do we need to support other pair operations beyond set (:=) ? 2. Should we pass the value pair info as a dict and not a tuple? Faster? 2. Give access to more radiusd variables like the dictionary. 3. Give access to other C functions. Let the Python module deal with the structures directly, instead of letting our C code do it afterwards. What's a good way to represent this? freeradius-server/doc/rlm_sim_triplets000066400000000000000000000041371257552170400206100ustar00rootroot00000000000000 SIM Triplets INTRODUCTION The module rlm_sim_files reads challenges/responses for use by the EAP-SIM method. This module is a reference implementation for what someone might do via a database or other system. It provides for authorization only. RADIUSD.CONF To configure this module, list is in modules. An optional option to set the file name exists, it otherwise defaults to ${raddbdir}/simtriplets.dat. e.g: in radiusd.conf, modules {}, sim_files { simtriplets = "/some/file" } in radiusd.conf, authorize {}, add: sim_files before eap. SIMTRIPLETS.DAT: The format of the file is one triplet per line, with the userid, aka "imsi" first. Lines starting with # are considered comments. imsi,challenge,kc,sres for example: 232420100000015,34000000000000000000000000000000,34112233,445566778899AABB Types imsi - just a string challenge - 16-byte value in hex. sres - 4-byte value in hex, the secure response kc - 8-byte value in hex, the client key (Kc) Note that EAP-SIM requires *three* sets of triplets, so there must be three challenges found in the file. The first three challenges are used. Also note that the "0x" for hex is not required, and is illegal. Space and tabs are not permitted. AUTHORIZATION Note, if the NAS continues to send the User-Name attribute in subsequent access-requests (such as continuations of the EAP-sim protocol), then the authorization process will be repeated. EAP-sim will capture the first set of attributes, so if they change, that is okay. A future version of this module may look at the presence of the EAP-Identity attribute to determine if attributes must be retrieved. However, in the general case, one might not know one wants to even do the EAP-Start to ask for the identity, until one has seen the username. If this module is successful at retrieving three sets of triplets, then the EAP-Type: attribute will be set to SIM. The EAP module itself will set the Auth-Type to EAP when it sees the EAP-Message attribute. See rlm_eap for details about the attributes used in EAP-sim. $Id$ freeradius-server/doc/rlm_sql000066400000000000000000000221271257552170400166700ustar00rootroot00000000000000 SQL Module 0. Introduction The SQL module is composed of two parts: a generic SQL front-end (rlm_sql), and a series of database-dependent back-end drivers, (rlm_sql_mysql, rlm_sql_postgresql, etc.) In order to build the drivers, you MUST ALSO install the development versions of the database. That is, you must have the appropriate header files and client libraries for (say) MySQL. The rlm_sql_mysql driver is NOT a complete MySQL client implementation. Instead, it is a small 'shim' between the FreeRADIUS rlm_sql module, and the MySQL client libraries. In general, the SQL schemas mirror the layout of the 'users' file. So for configuring check items and reply items, see 'man 5 users', and the examples in the 'users' file. 1. Schema and usage The schemas are available in raddb/sql//*, where is the name of the database (mysql, postgresql, etc.) The SQL module employs two sets of check and reply item tables for processing in the authorization stage. One set of tables (radcheck and radreply) are specific to a single user. The other set of tables (radgroupcheck and radgroupreply) is used to apply check and reply items to users that are members of a certain SQL group. The usergroup table provides the list of groups each user is a member of along with a priority field to control the order in which groups are processed. When a request comes into the server and is processed by the SQL module, the flow goes something like this: 1. Search the radcheck table for any check attributes specific to the user 2. If check attributes are found, and there's a match, pull the reply items from the radreply table for this user and add them to the reply 3. Group processing then begins if any of the following conditions are met: a. The user IS NOT found in radcheck b. The user IS found in radcheck, but the check items don't match c. The user IS found in radcheck, the check items DO match AND Fall-Through is set in the radreply table d. The user IS found in radcheck, the check items DO match AND the read_groups directive is set to 'yes' 4. If groups are to be processed for this user, the first thing that is done is the list of groups this user is a member of is pulled from the usergroup table ordered by the priority field. The priority field of the usergroup table allows us to control the order in which groups are processed, so that we can emulate the ordering in the users file. This can be important in many cases. 5. For each group this user is a member of, the corresponding check items are pulled from radgroupcheck table and compared with the request. If there is a match, the reply items for this group are pulled from the radgroupreply table and applied. 6. Processing continues to the next group IF: a. There was not a match for the last group's check items OR b. Fall-Through was set in the last group's reply items (The above is exactly the same as in the users file) 7. Finally, if the user has a User-Profile attribute set or the Default Profile option is set in the sql.conf, then steps 4-6 are repeated for the groups that the profile is a member of. For any fairly complex setup, it is likely that most of the actual processing will be done in the groups. In these cases, the user entry in radcheck will be of limited use except for things like setting the user's password. So, one might have the following setup: radcheck table: joeuser Cleartext-Password := somepassword radreply table: joeuser Fall-Through = Yes radgroupcheck table: Check items for various connection scenarios radgroupreply table: reply items for the groups usergroup table: joeuser WLANgroup 1(this is the priority) joeuser PPPgroup 2 2. What NOT to do. One of the fields of the SQL schema is named 'op' This is for the 'operator' used by the attributes. e.g.: Framed-IP-Address = 1.2.3.4 ^ ATTRIBUTE ----^ ^ OP ^ VALUE If you want the server to be completely misconfigured, and to never do what you want, leave the 'op' field blank. If you want to be rudely told to RTFM, then post questions on the mailing list, asking "why doesn't my SQL configuration work when I leave the 'op' field empty?" The short answer is that with the op field empty, the server does not know what you want it to do with the attribute. Should it be added to the reply? Maybe you wanted to compare the operator to one in the request? The server simply doesn't know. So put a value in the field. The value is the string form of the operator: "=", ">=", etc. See Section 4, below, for more details. 3. Authentication versus Authorization Many people ask if they can "authenticate" users to their SQL database. The answer to this question is "You're asking the wrong question." An SQL database stores information. An SQL database is NOT an authentication server. The ONLY users who should be able to authenticate themselves to the database are the people who administer it. Most administrators do NOT want every user to be able to access the database, which means that most users will not be able to "authenticate" themselves to the database. Instead, the users will have their authorization information (name, password, configuration) stored in the database. The configuration files for FreeRADIUS contain a username and password used to authenticate FreeRADIUS to the SQL server. (See raddb/sql.conf). Once the FreeRADIUS authentication server is connected to the SQL database server, then FreeRADIUS can pull user names and passwords out of the database, and use that information to perform the authentication. 4. Operators The list of operators is given below. Op Example and documentation -- ------------------------- = "Attribute = Value" Not allowed as a check item for RADIUS protocol attributes. It is allowed for server configuration attributes (Auth-Type, etc), and sets the value of on attribute, only if there is no other item of the same attribute. As a reply item, it means "add the item to the reply list, but only if there is no other item of the same attribute." := "Attribute := Value" Always matches as a check item, and replaces in the configuration items any attribute of the same name. If no attribute of that name appears in the request, then this attribute is added. As a reply item, it has an identical meaning, but for the reply items, instead of the request items. == "Attribute == Value" As a check item, it matches if the named attribute is present in the request, AND has the given value. Not allowed as a reply item. += "Attribute += Value" Always matches as a check item, and adds the current attribute with value to the list of configuration items. As a reply item, it has an identical meaning, but the attribute is added to the reply items. != "Attribute != Value" As a check item, matches if the given attribute is in the request, AND does not have the given value. Not allowed as a reply item. > "Attribute > Value" As a check item, it matches if the request contains an attribute with a value greater than the one given. Not allowed as a reply item. >= "Attribute >= Value" As a check item, it matches if the request contains an attribute with a value greater than, or equal to the one given. Not allowed as a reply item. < "Attribute < Value" As a check item, it matches if the request contains an attribute with a value less than the one given. Not allowed as a reply item. <= "Attribute <= Value" As a check item, it matches if the request contains an attribute with a value less than, or equal to the one given. Not allowed as a reply item. =~ "Attribute =~ Expression" As a check item, it matches if the request contains an attribute which matches the given regular expression. This operator may only be applied to string attributes. Not allowed as a reply item. !~ "Attribute !~ Expression" As a check item, it matches if the request contains an attribute which does not match the given regular expression. This operator may only be applied to string attributes. Not allowed as a reply item. =* "Attribute =* Value" As a check item, it matches if the request contains the named attribute, no matter what the value is. Not allowed as a reply item. !* "Attribute !* Value" As a check item, it matches if the request does not contain the named attribute, no matter what the value is. Not allowed as a reply item. 5. Instances Just like any other module, multiple instances of the rlm_sql module can be defined and used wherever you like. The default .conf files for the different database types, contain 1 instance without a name like so: sql { ... } You can create multiple named instances like so: sql sql_instance1 { ... } sql sql_instance2 { ... } And then you can use a specific instance in radiusd.conf, like so: authorize { ... sql_instance1 ... } accounting { ... sql_instance1 sql_instance2 ... } freeradius-server/doc/rlm_sqlcounter000066400000000000000000000124421257552170400202670ustar00rootroot00000000000000rlm_sqlcounter installation and running guide by Ram Narula ram@princess1.net Internet for Education (Thailand) *) Pre-requisites: Make sure to have configured radiusd with rlm_sqlcounter installed > make clean > ./configure --with-experimental-modules > make > make install Make sure to have radiusd running properly under sql and there must be a "sql" entry under accounting{ } section of radiusd.conf *) Configuration: [1] Create a text file called sqlcounter.conf in the same directory where radiusd.conf resides (usually /usr/local/etc/raddb) with the following content (for mysql): #-----# sqlcounter noresetcounter { counter-name = Max-All-Session-Time check-name = Max-All-Session reply-name = Session-Timeout sqlmod-inst = sql key = User-Name reset = never query = "SELECT SUM(AcctSessionTime) FROM radacct WHERE UserName='%{%k}'" } sqlcounter dailycounter { driver = "rlm_sqlcounter" counter-name = Daily-Session-Time check-name = Max-Daily-Session reply-name = Session-Timeout sqlmod-inst = sqlcca3 key = User-Name reset = daily query = "SELECT SUM(AcctSessionTime - GREATEST((%b - UNIX_TIMESTAMP(AcctStartTime)), 0)) FROM radacct WHERE UserName='%{%k}' AND UNIX_TIMESTAMP(AcctStartTime) + AcctSessionTime > '%b'" } sqlcounter monthlycounter { counter-name = Monthly-Session-Time check-name = Max-Monthly-Session reply-name = Session-Timeout sqlmod-inst = sqlcca3 key = User-Name reset = monthly query = "SELECT SUM(AcctSessionTime - GREATEST((%b - UNIX_TIMESTAMP(AcctStartTime)), 0)) FROM radacct WHERE UserName='%{%k}' AND UNIX_TIMESTAMP(AcctStartTime) + AcctSessionTime > '%b'" } #-----# The respective lines for postgresql are: query = "SELECT SUM(AcctSessionTime) FROM radacct WHERE UserName='%{%k}'" query = "SELECT SUM(AcctSessionTime - GREATER((%b - AcctStartTime::ABSTIME::INT4), 0)) FROM radacct WHERE UserName='%{%k}' AND AcctStartTime::ABSTIME::INT4 + AcctSessionTime > '%b'" query = "SELECT SUM(AcctSessionTime - GREATER((%b - AcctStartTime::ABSTIME::INT4), 0)) FROM radacct WHERE UserName='%{%k}' AND AcctStartTime::ABSTIME::INT4 + AcctSessionTime > '%b'" If you are running postgres 7.x, you may not have a GREATER function. An example of one is: CREATE OR REPLACE FUNCTION "greater"(integer, integer) RETURNS integer AS ' DECLARE res INTEGER; one INTEGER := 0; two INTEGER := 0; BEGIN one = $1; two = $2; IF one IS NULL THEN one = 0; END IF; IF two IS NULL THEN two = 0; END IF; IF one > two THEN res := one; ELSE res := two; END IF; RETURN res; END; ' LANGUAGE 'plpgsql'; [2] Include the above file to radiusd.conf by adding a line in modules{ } section modules { $INCLUDE ${confdir}/sqlcounter.conf ...some other entries here... [3] Make sure to have the sqlcounter names under authorize section like the followings: authorize { ...some entries here... ...some entries here... ...some entries here... ...some entries here... noresetcounter dailycounter monthlycounter } noresetcounter: the counter that never resets, can be used for real session-time cumulation dailycounter: the counter that resets everyday, can be used for limiting daily access time (eg. 3 hours a day) monthlycounter: the counter that resets monthly, can be used for limiting monthly access time (eg. 50 hours per month) You can make your own names and directives for resetting the counter by reading the sample sqlcounter configuration in raddb/experimental.conf *) Implementation: Add sqlcounter names to be used into radcheck or radgroupcheck table appropriately for sql. For users file just follow the example below. Note: The users in the example below must be able to login normally as the example will only show how to apply sqlcounter counters. Scenarios [1] username test0001 have total time limit of 15 hours (user can login as many times as needed but can be online for total time of 15 hours which is 54000 seconds) If using normal users file authenication the entry can look like: test0001 Max-All-Session := 54000, User-Password == "blah" Service-Type = Framed-User, Framed-Protocol = PPP or for sql make sure to have Max-All-Session entry under either radcheck or radgroup check table: > INSERT into radcheck VALUES ('','test0001','Max-All-Session','54000',':='); [2] username test0002 have total time limit of 3 hours a day test0002 Max-Daily-Session := 10800, User-Password == "blah" Service-Type = Framed-User, Framed-Protocol = PPP or in sql: > INSERT into radcheck VALUES ('','test0002','Max-Daily-Session','10800',':='); [3] username test0003 have total time limit of 90 hours a month test0003 Max-Monthly-Session := 324000, User-Password == "blah" Service-Type = Framed-User, Framed-Protocol = PPP in sql: > INSERT into radcheck VALUES ('','test0003','Max-Monthly-Session','10800',':='); Note that Max-All-Session, Max-Daily-Session and Max-Monthly-Session are definied in sqlcounter.conf VERY IMPORTANT: Accounting must be done via sql or this will not work. freeradius-server/doc/rlm_sqlippool000066400000000000000000000042401257552170400201070ustar00rootroot00000000000000Welcome to the SQL Based IP Pool module. ********************************************************************** As of September 2006 this module is still under some development and currently is only tested by the developers on PostgreSQL (Version 8.1) Use it at your own risk! If plan to attempt to use a DB other than PostgreSQL please expect to have to do extra work which is not for SQL newbies. Having said that it works great for us in production and should (with some work) function correctly with other SQL server types. ********************************************************************** To use the sqlipool module you simply need to have an IP-Pool Attribute (Keep in mind that its a **CHECK** item, not reply) in the required configuration file, which is either in files(users), sql or any other type of configuration schema. The initialization of the radippool table is left to the user instead of being handled inside the module. This allows pool management to be done from any sql capable programming language and pools can be created, resized, deleted at run time without radiusd needing to be restarted. The only required fields are, pool_name and ip_address. A pool consists of one or more rows in the table with the same pool_name and a different ip_address. There is no restriction on which ip addresses/ranges may be in the same pool, and addresses do not need to be concurrent. We are currently using the variable definitions of the xlat module, so before editing the sqlippool.conf file, please go and read the variables.txt in the freeradius/doc directory. It will help you alot!.. As you may noticed, there is a pool-key variable in the config file which allows you to select which attribute is unique according to your NAS setup. On a standard dialup NAS this is going to be "NAS-Port" but on an ethernet or wireless network it will probably be "Calling-Station-Id". Other more exotic options like "3GPP-IMSI" may also exist depending on your NAS. The only requirement is that the pool-key must be unique and must be received in both Access-Request and Accounting packages so that we know to clear the lease on the ip when the session disconnects. freeradius-server/doc/snmp000066400000000000000000000014401257552170400161670ustar00rootroot00000000000000In 2.0, the RFC 2619 and RFC 2621 MIBs are more fully supported than in 1.x. Note that re-transmitted responses to duplicate requests do not increment these counters. total responses = Access-Accepts + Access-Challenges + Access-Rejects Pending requests mean "live" requests that the server is currently processing. pending requests = total requests - duplicate requests - bad authenticators - malformed requests - unknown types - packets dropped - total responses The IPv6-aware MIBS, (RFC 4669 and RFC 4671) are not currently supported. Perhaps in 2.1. The client table for the server is also more fully supported than in 1.x. However, the RADIUS client MIBs (RFC 2618, RFC 2620, RFC 4668, and RFC 2670) are not supported. Perhaps in 2.1. freeradius-server/doc/supervise-radiusd.rst000066400000000000000000000112701257552170400215010ustar00rootroot00000000000000 Supervising the Radiusd Daemon ============================== Introduction ------------ We all hope that our radius daemons won't die in the middle of the nite stranding customer and beeping beepers. But, alas, it's going to happen, and when you least expect it. That's why you want a another process watching your radius daemon, restarting it if and when it dies. This text describes how to setup both the free radius daemon so that it is automatically restarted if the process quits unexpectedly. To do this, we'll use either Dan Bernstein's 'daemontools' package or the inittab file. Note: The radwatch script that used to be part of this distribution, is depreciated and SHOULD NOT BE USED. Setting Up Daemontools ---------------------- First, download (and install) daemontools from: http://cr.yp.to/daemontools.html The latest version as of this writing is 0.70. It would be well worth your while to read all the documentation at that site too, as you can do much more with daemontools than I describe here. Next, we'll need a directory for the radius 'service' to use with daemontools. I usually create a dir '/var/svc' to hold all my daemontool supervised services. i.e.:: $ mkdir /var/svc $ mkdir /var/svc/radiusd Now we just need a short shell script called 'run' in our new service directory that will start our daemon. The following should get you started:: #!/bin/sh # Save as /var/svc/radiusd/run exec /usr/local/sbin/radiusd -s -f Of course you'll want to make that 'run' file executable:: $ chmod +x /var/svc/radiusd/run Note, you *MUST* use the '-f' option when supervising. That option tells radiusd not to detach from the tty when starting. If you don't use that option, the daemontools will always think that radiusd has just died and will (try to) restart it. Not good. Now the only left to do is to start the 'supervise' command that came with daemontools. Do that like so:: $ supervise /var/svc/radiusd Maintenance With Daemontools ---------------------------- Any maintenance you need to do with almost certainly be done with the 'svc' program in the deamontools package. i.e.:: Shutdown radiusd: $ svc -d /var/svc/radiusd Start it back up: $ svc -u /var/svc/radiusd Send HUP to radiusd: $ svc -h /var/svc/radiusd Shutdown and stop supervising radiusd: $ svc -dx /var/svc/radiusd Supervising With Inittab ------------------------ This is really pretty easy, but it is system dependent. I strongly suggest you read the man pages for your 'init' before playing with this. You can seriously hose your system if you screw up your inittab. Add this line (or something similar to it) to your inittab:: fr:23:respawn:/usr/local/sbin/radiusd -f -s &> /dev/null Now all that's left is to have the system reread the inittab. Usually that's done with one of the following:: $ telinit Q or:: $ init q Now you should see a 'radiusd' process when you issue a 'ps'. If you don't, try to run the radiusd command you put in inittab manually. If it works, that means you didn't tell the system to reread inittab properly. If it doesn't work, that means your radius start command is bad and you need to fix it. Acknowledgements ---------------- Document author : Jeff Carneal daemontools auther : Dan Bernstein Further daemontool notes (below): Antonio Dias Radwatch note : Andrey Melnikov Further Daemontools notes ========================= Here are some notes by Antonia Dias sent to the free radius mailing list. Some of you may find this useful after reading the above and the docs for daemontools. Daemontools Instructions ------------------------ I am running radiusd under supervise from daemontools without problems. The only thing I am missing right now is an option to force radiusd to send log to stderr so I can manage logs better with multilog (also included in daemontools package). Here is the procedure I've been following (for Cistron RADIUS):: $ groupadd log $ useradd -g log log $ mkdir /etc/radiusd $ mkdir /etc/radiusd/log $ mkdir /etc/radiusd/log/main $ chmod +t+s /etc/radiusd /etc/radiusd/log $ chown log.log /etc/radiusd/log/main Here are the contents of run files from '/etc/radiusd' and '/etc/radiusd/log':: $ cd /etc/radiusd $ cat run #!/bin/sh exec 2>&1 exec /usr/sbin/radiusd -fyzx $ cd /etc/radiusd/log $ cat run #!/bin/sh exec setuidgid log multilog t ./main To make service wake-up do:: $ ln -sf /etc/radiusd /service Hang-up (to reload config) it using:: $ svc -h /service/radiusd Disable (down) it using:: $ svc -d /service/radiusd Reenable (up) it using:: $ svc -u /service/radiusd freeradius-server/doc/tuning_guide000066400000000000000000000065501257552170400177020ustar00rootroot00000000000000------------ MAIN SERVER ------------- o If you have a large user base and/or many authentication requests try using a scalable authentication mechanism like ldap or sql. o Enable noatime on all the freeradius log files or better yet on the freeradius log directory. o Always use the latest cvs version. It will probably contain a few fixes and enhancements. o Always try to use the least modules possible. In particular if you can avoid it do not use the detail and radwtmp (files) modules. They will slow down your accounting. o Use the users file to only set default profiles. Do not place any users there. Keep it as small as possible. Always set default attributes in the users file and don't fill the user entries in ldap/sql with default values. In general the ldap/sql user profiles should contain user attributes only in special user cases. o Tune thread pool parameters to match your size requirements. Set max_requests_per_server to zero to avoid server thread restarts. o Enlarge the timeout (10 secs) and retries (5-7) in the access servers for accounting. That way you won't lose any accounting information. o Use well tuned Fast Ethernet connections to minimize latency. o freeradius is multi threaded and i/o bound. That means you should use the latest OS kernels/patches for improved multi processor and network performance. ------------ LDAP MODULE ------------- o Tune the ldap_connections_number to be larger than the number of simultaneous user authentication requests. o Try to maximize caching in the ldap server. In particular *always* enable indexing of the uid attribute (equality index) and the cn attribute (equality index - the cn attribute is used to search for groups). Make the ldap server entry/directory cache memory sizes as large as possible. In general try allocating as much memory as you can afford to your ldap server. o Put default profiles in ldap. User entries should only contain non standard values in order to remain small and maximize the gains of caching the user default/regular profiles. o Enable caching in the ldap module (try it first, the openldap code is not quite mature). ------------ SQL MODULE -------------- o Tune the num_sql_socks to be larger than the number of simultaneous authentication/accounting requests. o Use the sql module in the session section instead of the radutmp module. It works *much* quicker. o Create a multi column index for the (UserName,AcctStopTime) attributes especially if you are using sql for double login detection. o If you are using mysql and you do a lot of accounting try using InnoDB for the radacct table instead of MyISAM o Add AcctUniqueId in the accounting_stop query. Especially if you have a lot of access servers or your NAS does not send very random Session-Ids. That way you will always have one candidate row to search for, instead of all the rows that have the same AcctSessionId ------------ COUNTER MODULE ---------- o Enable noatime on the counter db files. o Tune the cache-size configuration directive to match your needs. The cache size should be set to 2-3 * number of available nas ports. o Keep the database in a memory mapped file if you can help. Backup the file every 10 mins to the disk and copy it to the memory mapped one on server startup. ------------ RADUTMP MODULE ---------- o Enable noatime on the radutmp file o Don't use it freeradius-server/doc/variables.rst000066400000000000000000000166631257552170400200060ustar00rootroot00000000000000Run-time variables ================== See "man unlang" for more complete documentation on the run-time variables. This file is here only for historical purposes. The above variable expansions also support the following meta-attributes. These are not normal RADIUS attributes, but are created by the server to be used like them, for ease of use. They can only be queried, and cannot be assigned. +-----------------------+-------------------------------------------------+ | Packet-Type | RADIUS packet type (Access-Request, etc.) | +-----------------------+-------------------------------------------------+ | Packet-Src-IP-Address | IP address from which the packet was sent | +-----------------------+-------------------------------------------------+ | Packet-Dst-IP-Address | IP address to which the packet was sent. | | | This may be "0.0.0.0", if the server | | | was configured with ``bind_address = *``. | +-----------------------+-------------------------------------------------+ | Packet-Src-Port | UDP port from which the packet was sent | +-----------------------+-------------------------------------------------+ | Packet-Dst-Port | UDP port to which the packet was sent. | +-----------------------+-------------------------------------------------+ ``%{config:section.subsection.item}`` Corresponding value in ``radiusd.conf`` for the string value of that item. The ``%{config:...}`` variables should be used VERY carefully, as they may leak secret information from your RADIUS server, if you use them in reply attributes to the NAS! :: DEFAULT User-Name =~ "^([^@]+)@(.*)" All-That-Matched = `%{0}` Just-The-User-Name = `%{1}` Just-The-Realm-Name = `%{2}` The variables are used in dynamically translated strings. Most of the configuration entries in ``radiusd.conf`` (and related files) will do dynamic string translation. To do the same dynamic translation in a RADIUS attribute (when pulling it from a database, or "users" file), you must put the string into an back-quoted string: :: Session-Timeout = `%{expr: 2 + 3}` To do the dynamic translation in the ``radiusd.conf`` (or some other configuration files), just use the variable as-is. See ``radiusd.conf`` for examples. Attributes as environment variables in executed programs -------------------------------------------------------- When calling an external program (e.g. from ``rlm_exec`` module), these variables can be passed on the command line to the program. In addition, the server places all of the attributes in the RADIUS request into environment variables for the external program. The variables are renamed under the following rules: #. All letters are made upper-case. #. All hyphens '-' are turned into underscores '_' so the attribute ``User-Name`` can be passed on the command line to the program as ``%{User-Name}``, or used inside the program as the environment variable ``USER_NAME`` (or ``$USER_NAME`` for shell scripts). If you want to see the list of all of the variables, try adding a line ``printenv > /tmp/exec-program-wait`` to the script. Then look in the file for a complete list of variables. One-character variables ----------------------- The following one-character variables are also defined. However, they are duplicates of the previous general cases, and are only provided for backwards compatibility. They WILL BE removed in a future release. They also do NOT permit the use of conditional syntax (i.e. ``:-``, as described above. +-----------+---------------------------+-----------------------+ | Variable | Description | Proper Equivalent | +===========+===========================+=======================+ |%a |Protocol (SLIP/PPP) |%{Framed-Protocol} | +-----------+---------------------------+-----------------------+ |%c |Callback-Number |%{Callback-Number} | +-----------+---------------------------+-----------------------+ |%d |request day (DD) | | +-----------+---------------------------+-----------------------+ |%f |Framed IP address |%{Framed-IP-Address} | +-----------+---------------------------+-----------------------+ |%i |Calling Station ID |%{Calling-Station-Id} | +-----------+---------------------------+-----------------------+ |%l |request timestamp | | +-----------+---------------------------+-----------------------+ |%m |request month (MM) | | +-----------+---------------------------+-----------------------+ |%n |NAS IP address |%{NAS-IP-Address} | +-----------+---------------------------+-----------------------+ |%p |Port number |%{NAS-Port} | +-----------+---------------------------+-----------------------+ |%s |Speed (PW_CONNECT_INFO) |%{Connect-Info} | +-----------+---------------------------+-----------------------+ |%t |request in ctime format | | +-----------+---------------------------+-----------------------+ |%u |User name |%{User-Name} | +-----------+---------------------------+-----------------------+ |%v |Server Version | | +-----------+---------------------------+-----------------------+ |%A |radacct_dir |%{config:radacctdir} | +-----------+---------------------------+-----------------------+ |%C |clientname | | +-----------+---------------------------+-----------------------+ |%D |request date (YYYYMMDD) | | +-----------+---------------------------+-----------------------+ |%G |request minute | | +-----------+---------------------------+-----------------------+ |%H |request hour | | +-----------+---------------------------+-----------------------+ |%I |request ID | | +-----------+---------------------------+-----------------------+ |%L |radlog_dir |%{config:logdir} | +-----------+---------------------------+-----------------------+ |%M |MTU |%{Framed-MTU} | +-----------+---------------------------+-----------------------+ |%R |radius_dir |%{config:raddbdir} | +-----------+---------------------------+-----------------------+ |%S |request timestamp | | | |in SQL format | | +-----------+---------------------------+-----------------------+ |%T |request timestamp | | | |in database format | | +-----------+---------------------------+-----------------------+ |%U |Stripped User name |%{Stripped-User-Name} | +-----------+---------------------------+-----------------------+ |%V |Request-Authenticator | | | |(Verified/None) | | +-----------+---------------------------+-----------------------+ |%Y |request year (YYYY) | | +-----------+---------------------------+-----------------------+ |%Z |All request attributes | | | |except password | | | |(must have a big buffer) | | +-----------+---------------------------+-----------------------+ $Id$ freeradius-server/install-sh000077500000000000000000000127361257552170400165400ustar00rootroot00000000000000#!/bin/sh # # install - install a program, script, or datafile # This comes from X11R5 (mit/util/scripts/install.sh). # # Copyright 1991 by the Massachusetts Institute of Technology # # Permission to use, copy, modify, distribute, and sell this software and its # documentation for any purpose is hereby granted without fee, provided that # the above copyright notice appear in all copies and that both that # copyright notice and this permission notice appear in supporting # documentation, and that the name of M.I.T. not be used in advertising or # publicity pertaining to distribution of the software without specific, # written prior permission. M.I.T. makes no representations about the # suitability of this software for any purpose. It is provided "as is" # without express or implied warranty. # # Calling this script install-sh is preferred over install.sh, to prevent # `make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. It can only install one file at a time, a restriction # shared with many OS's install programs. # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit="${DOITPROG-}" # put in absolute paths if you don't have them in your path; or use env. vars. mvprog="${MVPROG-mv}" cpprog="${CPPROG-cp}" chmodprog="${CHMODPROG-chmod}" chownprog="${CHOWNPROG-chown}" chgrpprog="${CHGRPPROG-chgrp}" stripprog="${STRIPPROG-strip}" rmprog="${RMPROG-rm}" mkdirprog="${MKDIRPROG-mkdir}" transformbasename="" transform_arg="" instcmd="$mvprog" chmodcmd="$chmodprog 0755" chowncmd="" chgrpcmd="" stripcmd="" rmcmd="$rmprog -f" mvcmd="$mvprog" src="" dst="" dir_arg="" while [ x"$1" != x ]; do case $1 in -c) instcmd="$cpprog" shift continue;; -d) dir_arg=true shift continue;; -m) chmodcmd="$chmodprog $2" shift shift continue;; -o) chowncmd="$chownprog $2" shift shift continue;; -g) chgrpcmd="$chgrpprog $2" shift shift continue;; -s) stripcmd="$stripprog" shift continue;; -t=*) transformarg=`echo $1 | sed 's/-t=//'` shift continue;; -b=*) transformbasename=`echo $1 | sed 's/-b=//'` shift continue;; *) if [ x"$src" = x ] then src=$1 else # this colon is to work around a 386BSD /bin/sh bug : dst=$1 fi shift continue;; esac done if [ x"$src" = x ] then echo "install: no input file specified" exit 1 else true fi if [ x"$dir_arg" != x ]; then dst=$src src="" if [ -d $dst ]; then instcmd=: chmodcmd="" else instcmd=mkdir fi else # Waiting for this to be detected by the "$instcmd $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if [ -f $src -o -d $src ] then true else echo "install: $src does not exist" exit 1 fi if [ x"$dst" = x ] then echo "install: no destination specified" exit 1 else true fi # If destination is a directory, append the input filename; if your system # does not like double slashes in filenames, you may need to add some logic if [ -d $dst ] then dst="$dst"/`basename $src` else true fi fi ## this sed command emulates the dirname command dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` # Make sure that the destination directory exists. # this part is taken from Noah Friedman's mkinstalldirs script # Skip lots of stat calls in the usual case. if [ ! -d "$dstdir" ]; then defaultIFS=' ' IFS="${IFS-${defaultIFS}}" oIFS="${IFS}" # Some sh's can't handle IFS=/ for some reason. IFS='%' set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'` IFS="${oIFS}" pathcomp='' while [ $# -ne 0 ] ; do pathcomp="${pathcomp}${1}" shift if [ ! -d "${pathcomp}" ] ; then $mkdirprog "${pathcomp}" else true fi pathcomp="${pathcomp}/" done fi if [ x"$dir_arg" != x ] then $doit $instcmd $dst && if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi && if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi && if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi && if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi else # If we're going to rename the final executable, determine the name now. if [ x"$transformarg" = x ] then dstfile=`basename $dst` else dstfile=`basename $dst $transformbasename | sed $transformarg`$transformbasename fi # don't allow the sed command to completely eliminate the filename if [ x"$dstfile" = x ] then dstfile=`basename $dst` else true fi # Make a temp file name in the proper directory. dsttmp=$dstdir/_inst.$$_ # Move or copy the file name to the temp name $doit $instcmd $src $dsttmp && trap "rm -f ${dsttmp}" 0 && # and set any options; do chmod last to preserve setuid bits # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $instcmd $src $dsttmp" command. if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi && if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi && if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi && if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi && # Now rename the file to the real destination. $doit $rmcmd -f $dstdir/$dstfile && $doit $mvcmd $dsttmp $dstdir/$dstfile fi && exit 0 freeradius-server/libltdl/000077500000000000000000000000001257552170400161515ustar00rootroot00000000000000freeradius-server/libltdl/.gitignore000066400000000000000000000001551257552170400201420ustar00rootroot00000000000000argz.c argz_.h config.h config libltdl loaders lt__*.c lt_dlloader.c lt_error.c m4 slist.c stamp-h1 Makefile freeradius-server/libltdl/COPYING.LIB000066400000000000000000000636561257552170400176310ustar00rootroot00000000000000 GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 Copyright (C) 1991, 1999 Free Software Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below. When we speak of free software, we are referring to freedom of use, 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 and use pieces of it in new free programs; and that you are informed that you can do these things. To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights. We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library. To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. ^L Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs. When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library. We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances. For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License. In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system. Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. ^L GNU LESSER GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, 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 library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete 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 distribute a copy of this License along with the Library. 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 Library or any portion of it, thus forming a work based on the Library, 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) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, 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 Library, 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 Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. ^L Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you 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. If distribution of 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 satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. ^L 6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with. c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be 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. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. ^L 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library 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. 9. 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 Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library 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 with this License. ^L 11. 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 Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library 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 Library. 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. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library 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. 13. The Free Software Foundation may publish revised and/or new versions of the Lesser 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 Library 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 Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. ^L 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, 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 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "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 LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. 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 LIBRARY 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 LIBRARY (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 LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS ^L How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. 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) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. , 1 April 1990 Ty Coon, President of Vice That's all there is to it! freeradius-server/libltdl/Makefile.am000066400000000000000000000013731257552170400202110ustar00rootroot00000000000000## Process this file with automake to produce Makefile.in AUTOMAKE_OPTIONS = no-dependencies foreign if INSTALL_LTDL include_HEADERS = ltdl.h lib_LTLIBRARIES = libltdl.la else noinst_HEADERS = ltdl.h endif if CONVENIENCE_LTDL noinst_LTLIBRARIES = libltdlc.la endif ## Make sure these will be cleaned even when they're not built by ## default. CLEANFILES = libltdl.la libltdlc.la libltdl_la_SOURCES = ltdl.c libltdl_la_LDFLAGS = -no-undefined -version-info 4:4:1 libltdl_la_LIBADD = $(LIBADD_DL) libltdlc_la_SOURCES = ltdl.c libltdlc_la_LIBADD = $(LIBADD_DL) ## Because we do not have automatic dependency tracking: ltdl.lo: ltdl.h config.h $(libltdl_la_OBJECTS) $(libltdlc_la_OBJECTS): libtool libtool: $(LIBTOOL_DEPS) $(SHELL) ./config.status --recheck freeradius-server/libltdl/Makefile.in000066400000000000000000000513051257552170400202220ustar00rootroot00000000000000# Makefile.in generated by automake 1.9a from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = . DIST_COMMON = README $(am__configure_deps) $(am__include_HEADERS_DIST) \ $(am__noinst_HEADERS_DIST) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(srcdir)/config-h.in \ $(top_srcdir)/configure COPYING.LIB config.guess config.sub \ install-sh ltmain.sh missing ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno configure.status.lineno mkinstalldirs = $(install_sh) -d CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(includedir)" libLTLIBRARIES_INSTALL = $(INSTALL) LTLIBRARIES = $(lib_LTLIBRARIES) $(noinst_LTLIBRARIES) am__DEPENDENCIES_1 = libltdl_la_DEPENDENCIES = $(am__DEPENDENCIES_1) am_libltdl_la_OBJECTS = ltdl.lo libltdl_la_OBJECTS = $(am_libltdl_la_OBJECTS) libltdl_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libltdl_la_LDFLAGS) $(LDFLAGS) -o $@ @INSTALL_LTDL_TRUE@am_libltdl_la_rpath = -rpath $(libdir) libltdlc_la_DEPENDENCIES = $(am__DEPENDENCIES_1) am_libltdlc_la_OBJECTS = ltdl.lo libltdlc_la_OBJECTS = $(am_libltdlc_la_OBJECTS) @CONVENIENCE_LTDL_TRUE@am_libltdlc_la_rpath = DEFAULT_INCLUDES = -I. -I$(srcdir) -I. depcomp = am__depfiles_maybe = COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libltdl_la_SOURCES) $(libltdlc_la_SOURCES) DIST_SOURCES = $(libltdl_la_SOURCES) $(libltdlc_la_SOURCES) am__include_HEADERS_DIST = ltdl.h includeHEADERS_INSTALL = $(INSTALL_HEADER) am__noinst_HEADERS_DIST = ltdl.h HEADERS = $(include_HEADERS) $(noinst_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ { test ! -d $(distdir) \ || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -fr $(distdir); }; } DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best distuninstallcheck_listfiles = find . -type f -print distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CONVENIENCE_LTDL_FALSE = @CONVENIENCE_LTDL_FALSE@ CONVENIENCE_LTDL_TRUE = @CONVENIENCE_LTDL_TRUE@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_LTDL_FALSE = @INSTALL_LTDL_FALSE@ INSTALL_LTDL_TRUE = @INSTALL_LTDL_TRUE@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LIBADD_DL = @LIBADD_DL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ 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@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AUTOMAKE_OPTIONS = no-dependencies foreign @INSTALL_LTDL_TRUE@include_HEADERS = ltdl.h @INSTALL_LTDL_TRUE@lib_LTLIBRARIES = libltdl.la @INSTALL_LTDL_FALSE@noinst_HEADERS = ltdl.h @CONVENIENCE_LTDL_TRUE@noinst_LTLIBRARIES = libltdlc.la CLEANFILES = libltdl.la libltdlc.la libltdl_la_SOURCES = ltdl.c libltdl_la_LDFLAGS = -no-undefined -version-info 4:4:1 libltdl_la_LIBADD = $(LIBADD_DL) libltdlc_la_SOURCES = ltdl.c libltdlc_la_LIBADD = $(LIBADD_DL) all: config.h $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj am--refresh: @: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ echo ' cd $(srcdir) && $(AUTOMAKE) --foreign '; \ cd $(srcdir) && $(AUTOMAKE) --foreign \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(top_srcdir)/configure: $(am__configure_deps) cd $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) config.h: stamp-h1 @if test ! -f $@; then \ rm -f stamp-h1; \ $(MAKE) $(AM_MAKEFLAGS) stamp-h1; \ else :; fi stamp-h1: $(srcdir)/config-h.in $(top_builddir)/config.status @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status config.h $(srcdir)/config-h.in: $(am__configure_deps) cd $(top_srcdir) && $(AUTOHEADER) rm -f stamp-h1 touch $@ distclean-hdr: -rm -f config.h stamp-h1 install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(libdir)" || $(mkdir_p) "$(DESTDIR)$(libdir)" @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ if test -f $$p; then \ f=$(am__strip_dir) \ echo " $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \ $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \ else :; fi; \ done uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ p=$(am__strip_dir) \ echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \ $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \ done clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libltdl.la: $(libltdl_la_OBJECTS) $(libltdl_la_DEPENDENCIES) $(libltdl_la_LINK) $(am_libltdl_la_rpath) $(libltdl_la_OBJECTS) $(libltdl_la_LIBADD) $(LIBS) libltdlc.la: $(libltdlc_la_OBJECTS) $(libltdlc_la_DEPENDENCIES) $(LINK) $(am_libltdlc_la_rpath) $(libltdlc_la_OBJECTS) $(libltdlc_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c .c.o: $(COMPILE) -c $< .c.obj: $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool install-includeHEADERS: $(include_HEADERS) @$(NORMAL_INSTALL) test -z "$(includedir)" || $(mkdir_p) "$(DESTDIR)$(includedir)" @list='$(include_HEADERS)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(includeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(includedir)/$$f'"; \ $(includeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(includedir)/$$f"; \ done uninstall-includeHEADERS: @$(NORMAL_UNINSTALL) @list='$(include_HEADERS)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(includedir)/$$f'"; \ rm -f "$(DESTDIR)$(includedir)/$$f"; \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) config-h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) config-h.in $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) config-h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) config-h.in $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) $(am__remove_distdir) mkdir $(distdir) @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r $(distdir) dist-gzip: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 $(am__remove_distdir) dist-tarZ: distdir tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__remove_distdir) dist-shar: distdir shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz $(am__remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__remove_distdir) dist dist-all: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac chmod -R a-w $(distdir); chmod a+w $(distdir) mkdir $(distdir)/_build mkdir $(distdir)/_inst chmod a-w $(distdir) dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && cd $(distdir)/_build \ && ../configure --srcdir=.. --prefix="$$dc_install_base" \ $(DISTCHECK_CONFIGURE_FLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ distuninstallcheck \ && chmod -R a-w "$$dc_install_base" \ && ({ \ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ } || { rm -rf "$$dc_destdir"; exit 1; }) \ && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && rm -rf $(DIST_ARCHIVES) \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck $(am__remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e '1{h;s/./=/g;p;x;}' -e '$${p;x;}' distuninstallcheck: @cd $(distuninstallcheck_dir) \ && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ fi ; \ $(distuninstallcheck_listfiles) ; \ exit 1; } >&2 distcleancheck: distclean @if test '$(srcdir)' = . ; then \ echo "ERROR: distcleancheck can only run from a VPATH build" ; \ exit 1 ; \ fi @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left in build directory after distclean:" ; \ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(HEADERS) config.h installdirs: for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(includedir)"; do \ test -z "$$dir" || $(mkdir_p) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ clean-noinstLTLIBRARIES mostlyclean-am distclean: distclean-am -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-hdr distclean-libtool distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-includeHEADERS install-dvi: install-dvi-am install-exec-am: install-libLTLIBRARIES install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am installcheck-am: maintainer-clean: maintainer-clean-am -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-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-includeHEADERS uninstall-libLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am am--refresh check check-am clean \ clean-generic clean-libLTLIBRARIES clean-libtool \ clean-noinstLTLIBRARIES ctags dist dist-all dist-bzip2 \ dist-gzip dist-shar dist-tarZ dist-zip distcheck distclean \ distclean-compile distclean-generic distclean-hdr \ distclean-libtool distclean-tags distcleancheck distdir \ distuninstallcheck dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-includeHEADERS install-info \ install-info-am install-libLTLIBRARIES install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-includeHEADERS \ uninstall-libLTLIBRARIES ltdl.lo: ltdl.h config.h $(libltdl_la_OBJECTS) $(libltdlc_la_OBJECTS): libtool libtool: $(LIBTOOL_DEPS) $(SHELL) ./config.status --recheck # 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: freeradius-server/libltdl/README000066400000000000000000000005331257552170400170320ustar00rootroot00000000000000This is GNU libltdl, a system independent dlopen wrapper for GNU libtool. It supports the following dlopen interfaces: * dlopen (Solaris, Linux and various BSD flavors) * shl_load (HP-UX) * LoadLibrary (Win16 and Win32) * load_add_on (BeOS) * GNU DLD (emulates dynamic linking for static libraries) * dyld (darwin/Mac OS X) * libtool's dlpreopen freeradius-server/libltdl/acinclude.m4000066400000000000000000007341401257552170400203530ustar00rootroot00000000000000# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- ## Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005 ## Free Software Foundation, Inc. ## Originally 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. # serial 48 AC_PROG_LIBTOOL # AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED) # ----------------------------------------------------------- # If this macro is not defined by Autoconf, define it here. m4_ifdef([AC_PROVIDE_IFELSE], [], [m4_define([AC_PROVIDE_IFELSE], [m4_ifdef([AC_PROVIDE_$1], [$2], [$3])])]) # AC_PROG_LIBTOOL # --------------- AC_DEFUN([AC_PROG_LIBTOOL], [AC_REQUIRE([_AC_PROG_LIBTOOL])dnl dnl If AC_PROG_CXX has already been expanded, run AC_LIBTOOL_CXX dnl immediately, otherwise, hook it in at the end of AC_PROG_CXX. AC_PROVIDE_IFELSE([AC_PROG_CXX], [AC_LIBTOOL_CXX], [define([AC_PROG_CXX], defn([AC_PROG_CXX])[AC_LIBTOOL_CXX ])]) dnl And a similar setup for Fortran 77 support AC_PROVIDE_IFELSE([AC_PROG_F77], [AC_LIBTOOL_F77], [define([AC_PROG_F77], defn([AC_PROG_F77])[AC_LIBTOOL_F77 ])]) dnl Quote A][M_PROG_GCJ so that aclocal doesn't bring it in needlessly. dnl If either AC_PROG_GCJ or A][M_PROG_GCJ have already been expanded, run dnl AC_LIBTOOL_GCJ immediately, otherwise, hook it in at the end of both. AC_PROVIDE_IFELSE([AC_PROG_GCJ], [AC_LIBTOOL_GCJ], [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], [AC_LIBTOOL_GCJ], [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ], [AC_LIBTOOL_GCJ], [ifdef([AC_PROG_GCJ], [define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[AC_LIBTOOL_GCJ])]) ifdef([A][M_PROG_GCJ], [define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[AC_LIBTOOL_GCJ])]) ifdef([LT_AC_PROG_GCJ], [define([LT_AC_PROG_GCJ], defn([LT_AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])])]) ])])# AC_PROG_LIBTOOL # _AC_PROG_LIBTOOL # ---------------- AC_DEFUN([_AC_PROG_LIBTOOL], [AC_REQUIRE([AC_LIBTOOL_SETUP])dnl AC_BEFORE([$0],[AC_LIBTOOL_CXX])dnl AC_BEFORE([$0],[AC_LIBTOOL_F77])dnl AC_BEFORE([$0],[AC_LIBTOOL_GCJ])dnl # This can be used to rebuild libtool when needed LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh" # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' AC_SUBST(LIBTOOL)dnl # Prevent multiple expansion define([AC_PROG_LIBTOOL], []) ])# _AC_PROG_LIBTOOL # AC_LIBTOOL_SETUP # ---------------- AC_DEFUN([AC_LIBTOOL_SETUP], [AC_PREREQ(2.50)dnl AC_REQUIRE([AC_ENABLE_SHARED])dnl AC_REQUIRE([AC_ENABLE_STATIC])dnl AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_PROG_LD])dnl AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl AC_REQUIRE([AC_PROG_NM])dnl AC_REQUIRE([AC_PROG_LN_S])dnl AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl # Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers! AC_REQUIRE([AC_OBJEXT])dnl AC_REQUIRE([AC_EXEEXT])dnl dnl AC_LIBTOOL_SYS_MAX_CMD_LEN AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE AC_LIBTOOL_OBJDIR AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl _LT_AC_PROG_ECHO_BACKSLASH case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. 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 to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' # Constants: rm="rm -f" # Global variables: default_ofile=libtool can_build_shared=yes # All known linkers require a `.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a ltmain="$ac_aux_dir/ltmain.sh" ofile="$default_ofile" with_gnu_ld="$lt_cv_prog_gnu_ld" AC_CHECK_TOOL(AR, ar, false) AC_CHECK_TOOL(RANLIB, ranlib, :) AC_CHECK_TOOL(STRIP, strip, :) old_CC="$CC" old_CFLAGS="$CFLAGS" # Set sane defaults for various variables test -z "$AR" && AR=ar test -z "$AR_FLAGS" && AR_FLAGS=cru test -z "$AS" && AS=as test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$DLLTOOL" && DLLTOOL=dlltool test -z "$LD" && LD=ld test -z "$LN_S" && LN_S="ln -s" test -z "$MAGIC_CMD" && MAGIC_CMD=file test -z "$NM" && NM=nm test -z "$SED" && SED=sed test -z "$OBJDUMP" && OBJDUMP=objdump test -z "$RANLIB" && RANLIB=: test -z "$STRIP" && STRIP=: test -z "$ac_objext" && ac_objext=o # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" fi _LT_CC_BASENAME([$compiler]) # Only perform the check for file, if the check method requires it case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then AC_PATH_MAGIC fi ;; esac AC_PROVIDE_IFELSE([AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no) AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL], enable_win32_dll=yes, enable_win32_dll=no) AC_ARG_ENABLE([libtool-lock], [AC_HELP_STRING([--disable-libtool-lock], [avoid locking (might break parallel builds)])]) test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes AC_ARG_WITH([pic], [AC_HELP_STRING([--with-pic], [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], [pic_mode="$withval"], [pic_mode=default]) test -z "$pic_mode" && pic_mode=default # Use C for the default configuration in the libtool script tagname= AC_LIBTOOL_LANG_C_CONFIG _LT_AC_TAGCONFIG ])# AC_LIBTOOL_SETUP # _LT_AC_SYS_COMPILER # ------------------- AC_DEFUN([_LT_AC_SYS_COMPILER], [AC_REQUIRE([AC_PROG_CC])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_AC_SYS_COMPILER # _LT_CC_BASENAME(CC) # ------------------- # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. AC_DEFUN([_LT_CC_BASENAME], [for cc_temp in $1""; do case $cc_temp in compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` ]) # _LT_COMPILER_BOILERPLATE # ------------------------ # Check for compiler boilerplate output or warnings with # the simple compiler test code. AC_DEFUN([_LT_COMPILER_BOILERPLATE], [ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/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. AC_DEFUN([_LT_LINKER_BOILERPLATE], [ac_outfile=conftest.$ac_objext printf "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $rm conftest* ])# _LT_LINKER_BOILERPLATE # _LT_AC_SYS_LIBPATH_AIX # ---------------------- # Links a minimal program and checks the executable # for the system default hardcoded library path. In most cases, # this is /usr/lib:/lib, but when the MPI compilers are used # the location of the communication and MPI libs are included too. # If we don't find anything, use the default library path according # to the aix ld manual. AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX], [AC_LINK_IFELSE(AC_LANG_PROGRAM,[ aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi],[]) if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi ])# _LT_AC_SYS_LIBPATH_AIX # _LT_AC_SHELL_INIT(ARG) # ---------------------- AC_DEFUN([_LT_AC_SHELL_INIT], [ifdef([AC_DIVERSION_NOTICE], [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)], [AC_DIVERT_PUSH(NOTICE)]) $1 AC_DIVERT_POP ])# _LT_AC_SHELL_INIT # _LT_AC_PROG_ECHO_BACKSLASH # -------------------------- # Add some code to the start of the generated configure script which # will find an echo command which doesn't interpret backslashes. AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH], [_LT_AC_SHELL_INIT([ # Check that we are running under the correct shell. SHELL=${CONFIG_SHELL-/bin/sh} case X$ECHO in X*--fallback-echo) # Remove one level of quotation (which was required for Make). ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','` ;; esac echo=${ECHO-echo} if test "X[$]1" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test "X[$]1" = X--fallback-echo; then # Avoid inline document here, it may be left over : elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then # Yippee, $echo works! : else # Restart under the correct shell. exec $SHELL "[$]0" --no-reexec ${1+"[$]@"} fi if test "X[$]1" = X--fallback-echo; then # used as fallback echo shift cat </dev/null 2>&1 && unset CDPATH if test -z "$ECHO"; then if test "X${echo_test_string+set}" != Xset; then # find a string as large as possible, as long as the shell can cope with it for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... if (echo_test_string=`eval $cmd`) 2>/dev/null && echo_test_string=`eval $cmd` && (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null then break fi done fi if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then : else # The Solaris, AIX, and Digital Unix default echo programs unquote # backslashes. This makes it impossible to quote backslashes using # echo "$something" | sed 's/\\/\\\\/g' # # So, first we look for a working echo in the user's PATH. lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for dir in $PATH /usr/ucb; do IFS="$lt_save_ifs" if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then echo="$dir/echo" break fi done IFS="$lt_save_ifs" if test "X$echo" = Xecho; then # We didn't find a better echo, so look for alternatives. if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then # This shell has a builtin print -r that does the trick. echo='print -r' elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) && test "X$CONFIG_SHELL" != X/bin/ksh; then # If we have ksh, try running configure again with it. ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} export ORIGINAL_CONFIG_SHELL CONFIG_SHELL=/bin/ksh export CONFIG_SHELL exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"} else # Try using printf. echo='printf %s\n' if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then # Cool, printf works : elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && test "X$echo_testing_string" = 'X\t' && echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL export CONFIG_SHELL SHELL="$CONFIG_SHELL" export SHELL echo="$CONFIG_SHELL [$]0 --fallback-echo" elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && test "X$echo_testing_string" = 'X\t' && echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then echo="$CONFIG_SHELL [$]0 --fallback-echo" else # maybe with a smaller string... prev=: for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null then break fi prev="$cmd" done if test "$prev" != 'sed 50q "[$]0"'; then echo_test_string=`eval $prev` export echo_test_string exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"} else # Oops. We lost completely, so just stick with echo. echo=echo fi fi fi fi fi fi # Copy echo and quote the copy suitably for passing to libtool from # the Makefile, instead of quoting the original, which is used later. ECHO=$echo if test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo" fi AC_SUBST(ECHO) ])])# _LT_AC_PROG_ECHO_BACKSLASH # _LT_AC_LOCK # ----------- AC_DEFUN([_LT_AC_LOCK], [AC_ARG_ENABLE([libtool-lock], [AC_HELP_STRING([--disable-libtool-lock], [avoid locking (might break parallel builds)])]) test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE="32" ;; *ELF-64*) HPUX_IA64_MODE="64" ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out which ABI we are using. echo '[#]line __oline__ "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then if test "$lt_cv_prog_gnu_ld" = yes; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|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-*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-*linux*) LD="${LD-ld} -m elf_x86_64" ;; ppc*-*linux*|powerpc*-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*) 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_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) AC_LANG_POP]) if test x"$lt_cv_cc_needs_belf" != x"yes"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS="$SAVE_CFLAGS" fi ;; sparc*-*solaris*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) LD="${LD-ld} -m elf64_sparc" ;; *) LD="${LD-ld} -64" ;; esac ;; esac fi rm -rf conftest* ;; AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL], [*-*-cygwin* | *-*-mingw* | *-*-pw32*) AC_CHECK_TOOL(DLLTOOL, dlltool, false) AC_CHECK_TOOL(AS, as, false) AC_CHECK_TOOL(OBJDUMP, objdump, false) ;; ]) esac need_locks="$enable_libtool_lock" ])# _LT_AC_LOCK # AC_LIBTOOL_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------------------- # Check whether the given compiler option works AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [AC_REQUIRE([LT_AC_PROG_SED]) AC_CACHE_CHECK([$1], [$2], [$2=no ifelse([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$3" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi fi $rm conftest* ]) if test x"[$]$2" = xyes; then ifelse([$5], , :, [$5]) else ifelse([$6], , :, [$6]) fi ])# AC_LIBTOOL_COMPILER_OPTION # AC_LIBTOOL_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [ACTION-SUCCESS], [ACTION-FAILURE]) # ------------------------------------------------------------ # Check whether the given compiler option works AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [AC_CACHE_CHECK([$1], [$2], [$2=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $3" printf "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&AS_MESSAGE_LOG_FD $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi else $2=yes fi fi $rm conftest* LDFLAGS="$save_LDFLAGS" ]) if test x"[$]$2" = xyes; then ifelse([$4], , :, [$4]) else ifelse([$5], , :, [$5]) fi ])# AC_LIBTOOL_LINKER_OPTION # AC_LIBTOOL_SYS_MAX_CMD_LEN # -------------------------- AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [# 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*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) # 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. SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} while (test "X"`$SHELL [$]0 --fallback-echo "X$teststring" 2>/dev/null` \ = "XX$teststring") >/dev/null 2>&1 && new_result=`expr "X$teststring" : ".*" 2>&1` && lt_cv_sys_max_cmd_len=$new_result && test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done 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` ;; 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 ])# AC_LIBTOOL_SYS_MAX_CMD_LEN # _LT_AC_CHECK_DLFCN # ------------------ AC_DEFUN([_LT_AC_CHECK_DLFCN], [AC_CHECK_HEADERS(dlfcn.h)dnl ])# _LT_AC_CHECK_DLFCN # _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, # ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) # --------------------------------------------------------------------- AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF], [AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl if test "$cross_compiling" = yes; then : [$4] else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < #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 #ifdef __cplusplus extern "C" void exit (int); #endif void fnord() { int i=42;} int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; /* dlclose (self); */ } else puts (dlerror ()); exit (status); }] 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_AC_TRY_DLOPEN_SELF # AC_LIBTOOL_DLOPEN_SELF # ---------------------- AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [AC_REQUIRE([_LT_AC_CHECK_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*) 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="-dld"], [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="-dld"]) ]) ]) ]) ]) ]) ;; 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_AC_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_AC_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 ])# AC_LIBTOOL_DLOPEN_SELF # AC_LIBTOOL_PROG_CC_C_O([TAGNAME]) # --------------------------------- # Check to see if options -c and -o are simultaneously supported by compiler AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O], [AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)], [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no $rm -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then _LT_AC_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 .. rmdir conftest $rm conftest* ]) ])# AC_LIBTOOL_PROG_CC_C_O # AC_LIBTOOL_SYS_HARD_LINK_LOCKS([TAGNAME]) # ----------------------------------------- # Check to see if we can do hard links to lock some files if needed AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_REQUIRE([_LT_AC_LOCK])dnl hard_links="nottested" if test "$_LT_AC_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 ])# AC_LIBTOOL_SYS_HARD_LINK_LOCKS # AC_LIBTOOL_OBJDIR # ----------------- AC_DEFUN([AC_LIBTOOL_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 ])# AC_LIBTOOL_OBJDIR # AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH([TAGNAME]) # ---------------------------------------------- # Check hardcoding attributes. AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_MSG_CHECKING([how to hardcode library paths into programs]) _LT_AC_TAGVAR(hardcode_action, $1)= if test -n "$_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)" || \ test -n "$_LT_AC_TAGVAR(runpath_var, $1)" || \ test "X$_LT_AC_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then # We can hardcode non-existant directories. if test "$_LT_AC_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_AC_TAGVAR(hardcode_shlibpath_var, $1)" != no && test "$_LT_AC_TAGVAR(hardcode_minus_L, $1)" != no; then # Linking always hardcodes the temporary library directory. _LT_AC_TAGVAR(hardcode_action, $1)=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. _LT_AC_TAGVAR(hardcode_action, $1)=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. _LT_AC_TAGVAR(hardcode_action, $1)=unsupported fi AC_MSG_RESULT([$_LT_AC_TAGVAR(hardcode_action, $1)]) if test "$_LT_AC_TAGVAR(hardcode_action, $1)" = relink; 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 ])# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH # AC_LIBTOOL_SYS_LIB_STRIP # ------------------------ AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP], [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" AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) fi ;; *) AC_MSG_RESULT([no]) ;; esac fi ])# AC_LIBTOOL_SYS_LIB_STRIP # AC_LIBTOOL_SYS_DYNAMIC_LINKER # ----------------------------- # PORTME Fill in your ld.so characteristics AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_MSG_CHECKING([dynamic linker characteristics]) 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" if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. 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 else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix4* | aix5*) version_type=linux need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[[01]] | aix4.[[01]].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[[45]]*) version_type=linux need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$host_os in yes,cygwin* | yes,mingw* | yes,pw32*) 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' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $rm \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" ;; mingw*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | [grep ';[c-zC-Z]:/' >/dev/null]; then # It is most probably a Windows format PATH printed by # mingw gcc, but we are running on Cygwin. Gcc prints its search # path with ; separators, and with drive letters. We can handle the # drive letters (cygwin fileutils understands them), so leave them, # especially as we might pass files found there to a mingw objdump, # which wouldn't understand a cygwinified path. Ahh. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' ;; esac ;; *) library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' ;; esac dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${versuffix}$shared_ext ${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`' # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` else sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' fi sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd1*) dynamic_linker=no ;; kfreebsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='GNU ld.so' ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[[123]]*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2*) shlibpath_overrides_runpath=yes ;; freebsd3.[[01]]* | freebsdelf3.[[01]]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \ freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; freebsd*) # from 4.6 on shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555. postinstall_cmds='chmod 555 $lib' ;; interix3*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be Linux ELF. linux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # 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)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; knetbsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='GNU ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; nto-qnx*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; 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" ;; solaris*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no export_dynamic_flag_spec='${wl}-Blargedynsym' runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' shlibpath_overrides_runpath=no else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' shlibpath_overrides_runpath=yes case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; uts4*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' 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 ])# AC_LIBTOOL_SYS_DYNAMIC_LINKER # _LT_AC_TAGCONFIG # ---------------- AC_DEFUN([_LT_AC_TAGCONFIG], [AC_ARG_WITH([tags], [AC_HELP_STRING([--with-tags@<:@=TAGS@:>@], [include additional configurations @<:@automatic@:>@])], [tagnames="$withval"]) if test -f "$ltmain" && test -n "$tagnames"; then if test ! -f "${ofile}"; then AC_MSG_WARN([output file `$ofile' does not exist]) fi if test -z "$LTCC"; then eval "`$SHELL ${ofile} --config | grep '^LTCC='`" if test -z "$LTCC"; then AC_MSG_WARN([output file `$ofile' does not look like a libtool script]) else AC_MSG_WARN([using `LTCC=$LTCC', extracted from `$ofile']) fi fi if test -z "$LTCFLAGS"; then eval "`$SHELL ${ofile} --config | grep '^LTCFLAGS='`" fi # Extract list of available tagged configurations in $ofile. # Note that this assumes the entire list is on one line. available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'` lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for tagname in $tagnames; do IFS="$lt_save_ifs" # Check whether tagname contains only valid characters case `$echo "X$tagname" | $Xsed -e 's:[[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]]::g'` in "") ;; *) AC_MSG_ERROR([invalid tag name: $tagname]) ;; esac if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null then AC_MSG_ERROR([tag name \"$tagname\" already exists]) fi # Update the list of available tags. if test -n "$tagname"; then echo appending configuration tag \"$tagname\" to $ofile case $tagname in CXX) if test -n "$CXX" && ( test "X$CXX" != "Xno" && ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || (test "X$CXX" != "Xg++"))) ; then AC_LIBTOOL_LANG_CXX_CONFIG else tagname="" fi ;; F77) if test -n "$F77" && test "X$F77" != "Xno"; then AC_LIBTOOL_LANG_F77_CONFIG else tagname="" fi ;; GCJ) if test -n "$GCJ" && test "X$GCJ" != "Xno"; then AC_LIBTOOL_LANG_GCJ_CONFIG else tagname="" fi ;; RC) AC_LIBTOOL_LANG_RC_CONFIG ;; *) AC_MSG_ERROR([Unsupported tag name: $tagname]) ;; esac # Append the new tag name to the list of available tags. if test -n "$tagname" ; then available_tags="$available_tags $tagname" fi fi done IFS="$lt_save_ifs" # Now substitute the updated list of available tags. if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then mv "${ofile}T" "$ofile" chmod +x "$ofile" else rm -f "${ofile}T" AC_MSG_ERROR([unable to update list of available tagged configurations.]) fi fi ])# _LT_AC_TAGCONFIG # AC_LIBTOOL_DLOPEN # ----------------- # enable checks for dlopen support AC_DEFUN([AC_LIBTOOL_DLOPEN], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP]) ])# AC_LIBTOOL_DLOPEN # AC_LIBTOOL_WIN32_DLL # -------------------- # declare package support for building win32 DLLs AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_BEFORE([$0], [AC_LIBTOOL_SETUP]) ])# AC_LIBTOOL_WIN32_DLL # AC_ENABLE_SHARED([DEFAULT]) # --------------------------- # implement the --enable-shared flag # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. AC_DEFUN([AC_ENABLE_SHARED], [define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl AC_ARG_ENABLE([shared], [AC_HELP_STRING([--enable-shared@<:@=PKGS@:>@], [build shared libraries @<:@default=]AC_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=]AC_ENABLE_SHARED_DEFAULT) ])# AC_ENABLE_SHARED # AC_DISABLE_SHARED # ----------------- # set the default shared flag to --disable-shared AC_DEFUN([AC_DISABLE_SHARED], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl AC_ENABLE_SHARED(no) ])# AC_DISABLE_SHARED # AC_ENABLE_STATIC([DEFAULT]) # --------------------------- # implement the --enable-static flag # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. AC_DEFUN([AC_ENABLE_STATIC], [define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl AC_ARG_ENABLE([static], [AC_HELP_STRING([--enable-static@<:@=PKGS@:>@], [build static libraries @<:@default=]AC_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=]AC_ENABLE_STATIC_DEFAULT) ])# AC_ENABLE_STATIC # AC_DISABLE_STATIC # ----------------- # set the default static flag to --disable-static AC_DEFUN([AC_DISABLE_STATIC], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl AC_ENABLE_STATIC(no) ])# AC_DISABLE_STATIC # AC_ENABLE_FAST_INSTALL([DEFAULT]) # --------------------------------- # implement the --enable-fast-install flag # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. AC_DEFUN([AC_ENABLE_FAST_INSTALL], [define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl AC_ARG_ENABLE([fast-install], [AC_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], [optimize for fast installation @<:@default=]AC_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=]AC_ENABLE_FAST_INSTALL_DEFAULT) ])# AC_ENABLE_FAST_INSTALL # AC_DISABLE_FAST_INSTALL # ----------------------- # set the default to --disable-fast-install AC_DEFUN([AC_DISABLE_FAST_INSTALL], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl AC_ENABLE_FAST_INSTALL(no) ])# AC_DISABLE_FAST_INSTALL # AC_LIBTOOL_PICMODE([MODE]) # -------------------------- # implement the --with-pic flag # MODE is either `yes' or `no'. If omitted, it defaults to `both'. AC_DEFUN([AC_LIBTOOL_PICMODE], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl pic_mode=ifelse($#,1,$1,default) ])# AC_LIBTOOL_PICMODE # AC_PROG_EGREP # ------------- # This is predefined starting with Autoconf 2.54, so this conditional # definition can be removed once we require Autoconf 2.54 or later. m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP], [AC_CACHE_CHECK([for egrep], [ac_cv_prog_egrep], [if echo a | (grep -E '(a|b)') >/dev/null 2>&1 then ac_cv_prog_egrep='grep -E' else ac_cv_prog_egrep='egrep' fi]) EGREP=$ac_cv_prog_egrep AC_SUBST([EGREP]) ])]) # AC_PATH_TOOL_PREFIX # ------------------- # find a file program which can recognise shared library AC_DEFUN([AC_PATH_TOOL_PREFIX], [AC_REQUIRE([AC_PROG_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="ifelse([$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 <&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 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 ])# AC_PATH_TOOL_PREFIX # AC_PATH_MAGIC # ------------- # find a file program which can recognise a shared library AC_DEFUN([AC_PATH_MAGIC], [AC_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 AC_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) else MAGIC_CMD=: fi fi ])# AC_PATH_MAGIC # AC_PROG_LD # ---------- # find the pathname to the GNU or non-GNU linker AC_DEFUN([AC_PROG_LD], [AC_ARG_WITH([gnu-ld], [AC_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]) AC_REQUIRE([LT_AC_PROG_SED])dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])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; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; gnu*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]'] lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix3*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be Linux ELF. linux*) 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=unknown ;; 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 ;; solaris*) 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 ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; esac ]) file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown ])# AC_DEPLIBS_CHECK_METHOD # AC_PROG_NM # ---------- # find the pathname to a BSD-compatible name lister AC_DEFUN([AC_PROG_NM], [AC_CACHE_CHECK([for BSD-compatible 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 test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm fi]) NM="$lt_cv_path_NM" ])# AC_PROG_NM # AC_CHECK_LIBM # ------------- # check for math library AC_DEFUN([AC_CHECK_LIBM], [AC_REQUIRE([AC_CANONICAL_HOST])dnl LIBM= case $host in *-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*) # These system don't have libm, or don't need it ;; *-ncr-sysv4.3*) AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") ;; *) AC_CHECK_LIB(m, cos, LIBM="-lm") ;; esac ])# AC_CHECK_LIBM # AC_LIBLTDL_CONVENIENCE([DIRECTORY]) # ----------------------------------- # 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. If DIRECTORY is not provided, # it is assumed to be `libltdl'. LIBLTDL will be prefixed 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_builddir and top_srcdir appropriately in # the Makefiles. AC_DEFUN([AC_LIBLTDL_CONVENIENCE], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl 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='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) # For backwards non-gettext consistent compatibility... INCLTDL="$LTDLINCL" ])# AC_LIBLTDL_CONVENIENCE # AC_LIBLTDL_INSTALLABLE([DIRECTORY]) # ----------------------------------- # 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 here. If DIRECTORY is not provided, # and an installed libltdl is not found, it is assumed to be `libltdl'. # LIBLTDL will be prefixed with '${top_builddir}/'# and LTDLINCL with # '${top_srcdir}/' (note the single quotes!). If your package is not # flat and you're not using automake, define top_builddir and top_srcdir # appropriately in the Makefiles. # In the future, this macro may have to be called after AC_PROG_LIBTOOL. AC_DEFUN([AC_LIBLTDL_INSTALLABLE], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl AC_CHECK_LIB(ltdl, lt_dlinit, [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no], [if test x"$enable_ltdl_install" = xno; then AC_MSG_WARN([libltdl not installed, but installation disabled]) else enable_ltdl_install=yes fi ]) if test x"$enable_ltdl_install" = x"yes"; then ac_configure_args="$ac_configure_args --enable-ltdl-install" LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) else ac_configure_args="$ac_configure_args --enable-ltdl-install=no" LIBLTDL="-lltdl" LTDLINCL= fi # For backwards non-gettext consistent compatibility... INCLTDL="$LTDLINCL" ])# AC_LIBLTDL_INSTALLABLE # AC_LIBTOOL_CXX # -------------- # enable support for C++ libraries AC_DEFUN([AC_LIBTOOL_CXX], [AC_REQUIRE([_LT_AC_LANG_CXX]) ])# AC_LIBTOOL_CXX # _LT_AC_LANG_CXX # --------------- AC_DEFUN([_LT_AC_LANG_CXX], [AC_REQUIRE([AC_PROG_CXX]) AC_REQUIRE([_LT_AC_PROG_CXXCPP]) _LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}CXX]) ])# _LT_AC_LANG_CXX # _LT_AC_PROG_CXXCPP # ------------------ AC_DEFUN([_LT_AC_PROG_CXXCPP], [ AC_REQUIRE([AC_PROG_CXX]) if test -n "$CXX" && ( test "X$CXX" != "Xno" && ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || (test "X$CXX" != "Xg++"))) ; then AC_PROG_CXXCPP fi ])# _LT_AC_PROG_CXXCPP # AC_LIBTOOL_F77 # -------------- # enable support for Fortran 77 libraries AC_DEFUN([AC_LIBTOOL_F77], [AC_REQUIRE([_LT_AC_LANG_F77]) ])# AC_LIBTOOL_F77 # _LT_AC_LANG_F77 # --------------- AC_DEFUN([_LT_AC_LANG_F77], [AC_REQUIRE([AC_PROG_F77]) _LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}F77]) ])# _LT_AC_LANG_F77 # AC_LIBTOOL_GCJ # -------------- # enable support for GCJ libraries AC_DEFUN([AC_LIBTOOL_GCJ], [AC_REQUIRE([_LT_AC_LANG_GCJ]) ])# AC_LIBTOOL_GCJ # _LT_AC_LANG_GCJ # --------------- AC_DEFUN([_LT_AC_LANG_GCJ], [AC_PROVIDE_IFELSE([AC_PROG_GCJ],[], [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],[], [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],[], [ifdef([AC_PROG_GCJ],[AC_REQUIRE([AC_PROG_GCJ])], [ifdef([A][M_PROG_GCJ],[AC_REQUIRE([A][M_PROG_GCJ])], [AC_REQUIRE([A][C_PROG_GCJ_OR_A][M_PROG_GCJ])])])])])]) _LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}GCJ]) ])# _LT_AC_LANG_GCJ # AC_LIBTOOL_RC # ------------- # enable support for Windows resource files AC_DEFUN([AC_LIBTOOL_RC], [AC_REQUIRE([LT_AC_PROG_RC]) _LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}RC]) ])# AC_LIBTOOL_RC # AC_LIBTOOL_LANG_C_CONFIG # ------------------------ # Ensure that the configuration vars for the C compiler are # suitably defined. Those variables are subsequently used by # AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG], [_LT_AC_LANG_C_CONFIG]) AC_DEFUN([_LT_AC_LANG_C_CONFIG], [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_AC_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;\n" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}\n' _LT_AC_SYS_COMPILER # 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... AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1) AC_LIBTOOL_PROG_COMPILER_PIC($1) AC_LIBTOOL_PROG_CC_C_O($1) AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) AC_LIBTOOL_PROG_LD_SHLIBS($1) AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) AC_LIBTOOL_SYS_LIB_STRIP AC_LIBTOOL_DLOPEN_SELF # 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 ;; aix4* | aix5*) 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]) AC_LIBTOOL_CONFIG($1) AC_LANG_POP CC="$lt_save_CC" ])# AC_LIBTOOL_LANG_C_CONFIG # AC_LIBTOOL_LANG_CXX_CONFIG # -------------------------- # Ensure that the configuration vars for the C compiler are # suitably defined. Those variables are subsequently used by # AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG], [_LT_AC_LANG_CXX_CONFIG(CXX)]) AC_DEFUN([_LT_AC_LANG_CXX_CONFIG], [AC_LANG_PUSH(C++) AC_REQUIRE([AC_PROG_CXX]) AC_REQUIRE([_LT_AC_PROG_CXXCPP]) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no _LT_AC_TAGVAR(allow_undefined_flag, $1)= _LT_AC_TAGVAR(always_export_symbols, $1)=no _LT_AC_TAGVAR(archive_expsym_cmds, $1)= _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= _LT_AC_TAGVAR(hardcode_minus_L, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_AC_TAGVAR(hardcode_automatic, $1)=no _LT_AC_TAGVAR(module_cmds, $1)= _LT_AC_TAGVAR(module_expsym_cmds, $1)= _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown _LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_AC_TAGVAR(no_undefined_flag, $1)= _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Dependencies to place before and after the object being linked: _LT_AC_TAGVAR(predep_objects, $1)= _LT_AC_TAGVAR(postdep_objects, $1)= _LT_AC_TAGVAR(predeps, $1)= _LT_AC_TAGVAR(postdeps, $1)= _LT_AC_TAGVAR(compiler_lib_search_path, $1)= # Source file extension for C++ test sources. ac_ext=cpp # Object file extension for compiled C++ test sources. objext=o _LT_AC_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;\n" # Code to be used in simple link tests lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }\n' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_AC_SYS_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_LD=$LD lt_save_GCC=$GCC GCC=$GXX lt_save_with_gnu_ld=$with_gnu_ld lt_save_path_LD=$lt_cv_path_LD if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx else $as_unset lt_cv_prog_gnu_ld fi if test -n "${lt_cv_path_LDCXX+set}"; then lt_cv_path_LD=$lt_cv_path_LDCXX else $as_unset lt_cv_path_LD fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} compiler=$CC _LT_AC_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) # We don't want -fno-exception wen compiling C++ code, so set the # no_builtin_flag separately if test "$GXX" = yes; then _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' else _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= fi if test "$GXX" = yes; then # Set up default GNU C++ configuration AC_PROG_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_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' _LT_AC_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_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else _LT_AC_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_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' fi # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' else GXX=no with_gnu_ld=no wlarc= fi # PORTME: fill in a description of your system's C++ link characteristics AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) _LT_AC_TAGVAR(ld_shlibs, $1)=yes case $host_os in aix3*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; aix4* | aix5*) 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]].*|aix5*) 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_AC_TAGVAR(archive_cmds, $1)='' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_AC_TAGVAR(link_all_deplibs, $1)=yes 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 _LT_AC_TAGVAR(hardcode_direct, $1)=yes else # We have old collect2 _LT_AC_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_AC_TAGVAR(hardcode_minus_L, $1)=yes _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then 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 # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. _LT_AC_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_AC_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an empty executable. _LT_AC_SYS_LIBPATH_AIX _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an empty executable. _LT_AC_SYS_LIBPATH_AIX _LT_AC_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_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' # Exported symbols can be pulled into shared objects from archives _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='$convenience' _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds its shared libraries. _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; beos*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; chorus*) case $cc_basename in *) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac ;; cygwin* | mingw* | pw32*) # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_AC_TAGVAR(always_export_symbols, $1)=no _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then 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_AC_TAGVAR(ld_shlibs, $1)=no fi ;; darwin* | rhapsody*) case $host_os in rhapsody* | darwin1.[[012]]) _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress' ;; *) # Darwin 1.3 on if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' else case ${MACOSX_DEPLOYMENT_TARGET} in 10.[[012]]) _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup' ;; esac fi ;; esac _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_automatic, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='' _LT_AC_TAGVAR(link_all_deplibs, $1)=yes if test "$GXX" = yes ; then lt_int_apple_cc_single_mod=no output_verbose_link_cmd='echo' if $CC -dumpspecs 2>&1 | $EGREP 'single_module' >/dev/null ; then lt_int_apple_cc_single_mod=yes fi if test "X$lt_int_apple_cc_single_mod" = Xyes ; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' else _LT_AC_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' fi _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds if test "X$lt_int_apple_cc_single_mod" = Xyes ; then _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "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~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' fi _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else case $cc_basename in xlc*) output_verbose_link_cmd='echo' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' ;; *) _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac fi ;; dgux*) case $cc_basename in ec++*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; ghcx*) # Green Hills C++ Compiler # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac ;; freebsd[[12]]*) # C++ shared libraries reported to be fairly broken before switch to ELF _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; freebsd-elf*) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no ;; freebsd* | kfreebsd*-gnu | dragonfly*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions _LT_AC_TAGVAR(ld_shlibs, $1)=yes ;; gnu*) ;; hpux9*) _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_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_AC_TAGVAR(ld_shlibs, $1)=no ;; aCC*) _LT_AC_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) | grep "[[-]]L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes; then _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; hpux10*|hpux11*) if test $with_gnu_ld = no; then _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' ;; *) _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ;; esac fi case $host_cpu in hppa*64*|ia64*) _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_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_AC_TAGVAR(ld_shlibs, $1)=no ;; aCC*) case $host_cpu in hppa*64*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes; then if test $with_gnu_ld = no; then case $host_cpu in hppa*64*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi else # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; interix3*) _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; irix5* | irix6*) case $cc_basename in CC*) # SGI C++ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -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_AC_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_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib' fi fi _LT_AC_TAGVAR(link_all_deplibs, $1)=yes ;; esac _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: ;; linux*) 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_AC_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_AC_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath,$libdir' _LT_AC_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_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; icpc*) # 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_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_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_AC_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_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_AC_TAGVAR(archive_cmds_need_lc, $1)=no _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' ;; pgCC*) # Portland Group C++ compiler _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' _LT_AC_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' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' ;; cxx*) # Compaq C++ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_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_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; esac ;; lynxos*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; m88k*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; mvs*) case $cc_basename in cxx*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' wlarc= _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_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::"' ;; openbsd2*) # C++ shared libraries are fairly broken _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; openbsd*) _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' _LT_AC_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_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' fi output_verbose_link_cmd='echo' ;; osf3*) 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_AC_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_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; cxx*) _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' else # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; 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_AC_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_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: # Archives containing C++ object files must be created using # the KAI C++ compiler. _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; cxx*) _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' _LT_AC_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_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' else # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; psos*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; lcc*) # Lucid # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac ;; solaris*) case $cc_basename in CC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_AC_TAGVAR(archive_cmds_need_lc,$1)=yes _LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $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_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The C++ compiler is used as linker so we must use $wl # flag to pass the commands to the underlying system # linker. We must also pass each convience library through # to the system linker between allextract/defaultextract. # The C++ compiler will combine linker options so we # cannot just pass the convience library names through # without $wl. # Supported since Solaris 2.6 (maybe 2.5.1?) _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; esac _LT_AC_TAGVAR(link_all_deplibs, $1)=yes output_verbose_link_cmd='echo' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; gcx*) # Green Hills C++ Compiler _LT_AC_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_AC_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_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' if $CC --version | grep -v '^2\.7' > /dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" else # g++ 2.7 appears to require `-G' NOT `-shared' on this # platform. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' fi ;; esac ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. # So that behaviour is only enabled if SCOABSPATH is set to a # non-empty value in the environment. Most likely only useful for # creating official distributions of packages. # This is a hack until libtool officially supports absolute path # names for shared libraries. _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_AC_TAGVAR(link_all_deplibs, $1)=yes _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac ;; vxworks*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)]) test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no _LT_AC_TAGVAR(GCC, $1)="$GXX" _LT_AC_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... AC_LIBTOOL_POSTDEP_PREDEP($1) AC_LIBTOOL_PROG_COMPILER_PIC($1) AC_LIBTOOL_PROG_CC_C_O($1) AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) AC_LIBTOOL_PROG_LD_SHLIBS($1) AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) AC_LIBTOOL_CONFIG($1) AC_LANG_POP CC=$lt_save_CC LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC with_gnu_ldcxx=$with_gnu_ld 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 ])# AC_LIBTOOL_LANG_CXX_CONFIG # AC_LIBTOOL_POSTDEP_PREDEP([TAGNAME]) # ------------------------------------ # Figure out "hidden" library dependencies from verbose # compiler output when linking a shared library. # Parse the compiler output and extract the necessary # objects, libraries and library flags. AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP],[ 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... ifelse([$1],[],[cat > conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext <> "$cfgfile" ifelse([$1], [], [#! $SHELL # `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) # NOTE: Changes made to this file will be lost: look at ltmain.sh. # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 # Free Software Foundation, Inc. # # This file is part of GNU Libtool: # Originally by Gordon Matzigkeit , 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 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # 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//" # 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 # The names of the tagged configurations supported by this script. available_tags= # ### BEGIN LIBTOOL CONFIG], [# ### BEGIN LIBTOOL TAG CONFIG: $tagname]) # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$_LT_AC_TAGVAR(archive_cmds_need_lc, $1) # Whether or not to disallow shared libs when runtime libs are static allow_libtool_libs_with_static_runtimes=$_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1) # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # An echo program that does not interpret backslashes. echo=$lt_echo # The archiver. AR=$lt_AR AR_FLAGS=$lt_AR_FLAGS # A C compiler. LTCC=$lt_LTCC # LTCC compiler flags. LTCFLAGS=$lt_LTCFLAGS # A language-specific compiler. CC=$lt_[]_LT_AC_TAGVAR(compiler, $1) # Is the compiler the GNU C compiler? with_gcc=$_LT_AC_TAGVAR(GCC, $1) # An ERE matcher. EGREP=$lt_EGREP # The linker used to build libraries. LD=$lt_[]_LT_AC_TAGVAR(LD, $1) # Whether we need hard or soft links. LN_S=$lt_LN_S # A BSD-compatible nm program. NM=$lt_NM # A symbol stripping program STRIP=$lt_STRIP # Used to examine libraries when file_magic_cmd begins "file" MAGIC_CMD=$MAGIC_CMD # Used on cygwin: DLL creation program. DLLTOOL="$DLLTOOL" # Used on cygwin: object dumper. OBJDUMP="$OBJDUMP" # Used on cygwin: assembler. AS="$AS" # The name of the directory that contains temporary libtool files. objdir=$objdir # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # How to pass a linker flag through the compiler. wl=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) # Object file suffix (normally "o"). objext="$ac_objext" # Old archive suffix (normally "a"). libext="$libext" # Shared library suffix (normally ".so"). shrext_cmds='$shrext_cmds' # Executable file suffix (normally ""). exeext="$exeext" # Additional compiler flags for building library objects. pic_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) pic_mode=$pic_mode # What is the maximum length of a command? max_cmd_len=$lt_cv_sys_max_cmd_len # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_[]_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1) # Must we lock files when doing compilation? need_locks=$lt_need_locks # 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 # 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 # Compiler flag to prevent dynamic linking. link_static_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_static, $1) # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_[]_LT_AC_TAGVAR(export_dynamic_flag_spec, $1) # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_[]_LT_AC_TAGVAR(whole_archive_flag_spec, $1) # Compiler flag to generate thread-safe objects. thread_safe_flag_spec=$lt_[]_LT_AC_TAGVAR(thread_safe_flag_spec, $1) # Library versioning type. version_type=$version_type # 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 # Commands used to build and install an old-style archive. RANLIB=$lt_RANLIB old_archive_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_cmds, $1) old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_new_cmds, $1) # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) # Commands used to build and install a shared archive. archive_cmds=$lt_[]_LT_AC_TAGVAR(archive_cmds, $1) archive_expsym_cmds=$lt_[]_LT_AC_TAGVAR(archive_expsym_cmds, $1) postinstall_cmds=$lt_postinstall_cmds postuninstall_cmds=$lt_postuninstall_cmds # Commands used to build a loadable module (assumed same as above if empty) module_cmds=$lt_[]_LT_AC_TAGVAR(module_cmds, $1) module_expsym_cmds=$lt_[]_LT_AC_TAGVAR(module_expsym_cmds, $1) # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # Dependencies to place before the objects being linked to create a # shared library. predep_objects=$lt_[]_LT_AC_TAGVAR(predep_objects, $1) # Dependencies to place after the objects being linked to create a # shared library. postdep_objects=$lt_[]_LT_AC_TAGVAR(postdep_objects, $1) # Dependencies to place before the objects being linked to create a # shared library. predeps=$lt_[]_LT_AC_TAGVAR(predeps, $1) # Dependencies to place after the objects being linked to create a # shared library. postdeps=$lt_[]_LT_AC_TAGVAR(postdeps, $1) # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_[]_LT_AC_TAGVAR(compiler_lib_search_path, $1) # 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 # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_[]_LT_AC_TAGVAR(allow_undefined_flag, $1) # Flag that forces no undefined symbols. no_undefined_flag=$lt_[]_LT_AC_TAGVAR(no_undefined_flag, $1) # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # Same as above, but a single script fragment to be evaled but not shown. finish_eval=$lt_finish_eval # 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 # This is the shared library runtime path variable. runpath_var=$runpath_var # This is the shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # How to hardcode a shared library path into an executable. hardcode_action=$_LT_AC_TAGVAR(hardcode_action, $1) # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist. hardcode_libdir_flag_spec=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) # If ld is used when linking, flag to hardcode \$libdir into # a binary during linking. This must work even if \$libdir does # not exist. hardcode_libdir_flag_spec_ld=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1) # Whether we need a single -rpath flag with a separated argument. hardcode_libdir_separator=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_separator, $1) # Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the # resulting binary. hardcode_direct=$_LT_AC_TAGVAR(hardcode_direct, $1) # Set to yes if using the -LDIR flag during linking hardcodes DIR into the # resulting binary. hardcode_minus_L=$_LT_AC_TAGVAR(hardcode_minus_L, $1) # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into # the resulting binary. hardcode_shlibpath_var=$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1) # 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=$_LT_AC_TAGVAR(hardcode_automatic, $1) # Variables whose values should be saved in libtool wrapper scripts and # restored at relink time. variables_saved_for_relink="$variables_saved_for_relink" # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$_LT_AC_TAGVAR(link_all_deplibs, $1) # 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 # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path="$_LT_AC_TAGVAR(fix_srcfile_path, $1)" # Set to yes if exported symbols are required. always_export_symbols=$_LT_AC_TAGVAR(always_export_symbols, $1) # The commands to list exported symbols. export_symbols_cmds=$lt_[]_LT_AC_TAGVAR(export_symbols_cmds, $1) # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_[]_LT_AC_TAGVAR(exclude_expsyms, $1) # Symbols that must always be exported. include_expsyms=$lt_[]_LT_AC_TAGVAR(include_expsyms, $1) ifelse([$1],[], [# ### END LIBTOOL CONFIG], [# ### END LIBTOOL TAG CONFIG: $tagname]) __EOF__ ifelse([$1],[], [ case $host_os in aix3*) cat <<\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 EOF ;; esac # 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) mv -f "$cfgfile" "$ofile" || \ (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" ]) else # If there is no Makefile yet, we rely on a make rule to execute # `config.status --recheck' to rerun these tests and create the # libtool script then. ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` if test -f "$ltmain_in"; then test -f Makefile && make "$ltmain" fi fi ])# AC_LIBTOOL_CONFIG # AC_LIBTOOL_PROG_COMPILER_NO_RTTI([TAGNAME]) # ------------------------------------------- AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= if test "$GCC" = yes; then _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], lt_cv_prog_compiler_rtti_exceptions, [-fno-rtti -fno-exceptions], [], [_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) fi ])# AC_LIBTOOL_PROG_COMPILER_NO_RTTI # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE # --------------------------------- AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_REQUIRE([AC_CANONICAL_HOST]) AC_REQUIRE([AC_PROG_NM]) AC_REQUIRE([AC_OBJEXT]) # 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]]*\)' # Transform an extracted symbol line into a proper C declaration lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \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\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" # Define system-specific variables. case $host_os in aix*) symcode='[[BCDT]]' ;; cygwin* | mingw* | pw32*) symcode='[[ABCDGISTW]]' ;; hpux*) # Its linker distinguishes data from code symbols if test "$host_cpu" = ia64; then symcode='[[ABCDEGRST]]' fi lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" ;; linux*) if test "$host_cpu" = ia64; then symcode='[[ABCDGIRSTW]]' lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" 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 # 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 # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[[ABCDGIRSTW]]' ;; esac # Try without a prefix undercore, 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. lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext < $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 < conftest.$ac_ext #ifdef __cplusplus extern "C" { #endif EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext' cat <> conftest.$ac_ext #if defined (__STDC__) && __STDC__ # define lt_ptr_t void * #else # define lt_ptr_t char * # define const #endif /* The mapping between symbol names and symbols. */ const struct { const char *name; lt_ptr_t address; } lt_preloaded_symbols[[]] = { EOF $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext cat <<\EOF >> conftest.$ac_ext {0, (lt_ptr_t) 0} }; #ifdef __cplusplus } #endif EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_save_LIBS="$LIBS" lt_save_CFLAGS="$CFLAGS" LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then pipe_works=yes fi LIBS="$lt_save_LIBS" CFLAGS="$lt_save_CFLAGS" else echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD fi else echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD cat conftest.$ac_ext >&5 fi rm -f 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 ]) # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE # AC_LIBTOOL_PROG_COMPILER_PIC([TAGNAME]) # --------------------------------------- AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC], [_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)= _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= _LT_AC_TAGVAR(lt_prog_compiler_static, $1)= AC_MSG_CHECKING([for $compiler option to produce PIC]) ifelse([$1],[CXX],[ # C++ specific cases for pic, static, wl, etc. if test "$GXX" = yes; then _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_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_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; amigaos*) # 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_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | os2* | pw32*) # 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_AC_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_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; *djgpp*) # DJGPP does not support shared libraries at all _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= ;; interix3*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; sysv4*MP*) if test -d /usr/nec; then _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; hpux*) # 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*) ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac else case $host_os in aix4* | aix5*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; chorus*) case $cc_basename in cxch68*) # Green Hills C++ Compiler # _LT_AC_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 ;; darwin*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files case $cc_basename in xlc*) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon' _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ;; esac ;; dgux*) case $cc_basename in ec++*) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; ghcx*) # Green Hills C++ Compiler _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; freebsd* | kfreebsd*-gnu | dragonfly*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) case $cc_basename in CC*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' if test "$host_cpu" != ia64; then _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' fi ;; aCC*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_AC_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_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' # CC pic flag -KPIC is the default. ;; *) ;; esac ;; linux*) case $cc_basename in KCC*) # KAI C++ Compiler _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; icpc* | ecpc*) # Intel C++ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; pgCC*) # Portland Group C++ compiler. _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_AC_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_AC_TAGVAR(lt_prog_compiler_pic, $1)= _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; *) ;; esac ;; lynxos*) ;; m88k*) ;; mvs*) case $cc_basename in cxx*) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' ;; *) ;; esac ;; netbsd*) ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' ;; RCC*) # Rational C++ 2.4.1 _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; cxx*) # Digital/Compaq C++ _LT_AC_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_AC_TAGVAR(lt_prog_compiler_pic, $1)= _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; *) ;; esac ;; psos*) ;; solaris*) case $cc_basename in CC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; gcx*) # Green Hills C++ Compiler _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' ;; *) ;; esac ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; lcc*) # Lucid _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; *) ;; esac ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) case $cc_basename in CC*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; vxworks*) ;; *) _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ], [ if test "$GCC" = yes; then _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_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_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; amigaos*) # 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_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | pw32* | os2*) # 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_AC_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_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; interix3*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no enable_shared=no ;; sysv4*MP*) if test -d /usr/nec; then _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; hpux*) # 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_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; darwin*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files case $cc_basename in xlc*) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon' _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ;; esac ;; mingw* | pw32* | os2*) # 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_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' ;; hpux9* | hpux10* | hpux11*) _LT_AC_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_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC (with -KPIC) is the default. _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; newsos6) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; linux*) case $cc_basename in icc* | ecc*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; pgcc* | pgf77* | pgf90* | pgf95*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; ccc*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All Alpha code is PIC. _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; esac ;; osf3* | osf4* | osf5*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All OSF/1 code is PIC. _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; solaris*) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' case $cc_basename in f77* | f90* | f95*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; *) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; esac ;; sunos4*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; unicos*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; uts4*) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *) _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ]) AC_MSG_RESULT([$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)]) # # Check to make sure the PIC flag actually works. # if test -n "$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)"; then AC_LIBTOOL_COMPILER_OPTION([if $compiler PIC flag $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) works], _LT_AC_TAGVAR(lt_prog_compiler_pic_works, $1), [$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])], [], [case $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) in "" | " "*) ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)" ;; esac], [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) fi case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])" ;; esac # # Check to make sure the static flag actually works. # wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_AC_TAGVAR(lt_prog_compiler_static, $1)\" AC_LIBTOOL_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], _LT_AC_TAGVAR(lt_prog_compiler_static_works, $1), $lt_tmp_static_flag, [], [_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=]) ]) # AC_LIBTOOL_PROG_LD_SHLIBS([TAGNAME]) # ------------------------------------ # See if the linker supports building shared libraries. AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) ifelse([$1],[CXX],[ _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' case $host_os in aix4* | aix5*) # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | grep 'GNU' > /dev/null; then _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' else _LT_AC_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_AC_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" ;; cygwin* | mingw*) _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]] /s/.* \([[^ ]]*\)/\1 DATA/;/^.* __nm__/s/^.* __nm__\([[^ ]]*\) [[^ ]]*/\1 DATA/;/^I /d;/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols' ;; *) _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac ],[ runpath_var= _LT_AC_TAGVAR(allow_undefined_flag, $1)= _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no _LT_AC_TAGVAR(archive_cmds, $1)= _LT_AC_TAGVAR(archive_expsym_cmds, $1)= _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)= _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)= _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= _LT_AC_TAGVAR(thread_safe_flag_spec, $1)= _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_minus_L, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown _LT_AC_TAGVAR(hardcode_automatic, $1)=no _LT_AC_TAGVAR(module_cmds, $1)= _LT_AC_TAGVAR(module_expsym_cmds, $1)= _LT_AC_TAGVAR(always_export_symbols, $1)=no _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list _LT_AC_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_AC_TAGVAR(exclude_expsyms, $1)="_GLOBAL_OFFSET_TABLE_" # 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. extract_expsyms_cmds= # Just being paranoid about ensuring that cc_basename is set. _LT_CC_BASENAME([$compiler]) case $host_os in cygwin* | mingw* | pw32*) # 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_AC_TAGVAR(ld_shlibs, $1)=yes if test "$with_gnu_ld" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' _LT_AC_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_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= fi supports_anon_versioning=no case `$LD -v 2>/dev/null` in *\ [[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 aix3* | aix4* | aix5*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then _LT_AC_TAGVAR(ld_shlibs, $1)=no cat <&2 *** Warning: the GNU linker, at least up to release 2.9.1, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to modify your PATH *** so that a non-GNU linker is found, and then restart. EOF fi ;; amigaos*) _LT_AC_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_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Samuel A. Falvo II reports # that the semantics of dynamic libraries on AmigaOS, at least up # to version 4, is to share data among multiple programs linked # with the same dynamic library. Since this doesn't match the # behavior of shared libraries on other platforms, we can't use # them. _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; beos*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; cygwin* | mingw* | pw32*) # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_AC_TAGVAR(always_export_symbols, $1)=no _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]] /s/.* \([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols' if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then 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_AC_TAGVAR(ld_shlibs, $1)=no fi ;; interix3*) _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; linux*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then tmp_addflag= case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; esac _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test $supports_anon_versioning = yes; then _LT_AC_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 -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then _LT_AC_TAGVAR(ld_shlibs, $1)=no cat <&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. EOF elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_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_AC_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_AC_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib' else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; sunos4*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_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_AC_TAGVAR(ld_shlibs, $1)=no fi ;; esac if test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no; then runpath_var= _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= _LT_AC_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_AC_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_AC_TAGVAR(always_export_symbols, $1)=yes _LT_AC_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_AC_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_AC_TAGVAR(hardcode_direct, $1)=unsupported fi ;; aix4* | aix5*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | grep 'GNU' > /dev/null; then _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' else _LT_AC_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]].*|aix5*) 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_AC_TAGVAR(archive_cmds, $1)='' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_AC_TAGVAR(link_all_deplibs, $1)=yes 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 _LT_AC_TAGVAR(hardcode_direct, $1)=yes else # We have old collect2 _LT_AC_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_AC_TAGVAR(hardcode_minus_L, $1)=yes _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then 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 # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. _LT_AC_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_AC_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an empty executable. _LT_AC_SYS_LIBPATH_AIX _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an empty executable. _LT_AC_SYS_LIBPATH_AIX _LT_AC_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_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' # Exported symbols can be pulled into shared objects from archives _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='$convenience' _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds its shared libraries. _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${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*) _LT_AC_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_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # see comment about different semantics on the GNU ld section _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; bsdi[[45]]*) _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic ;; cygwin* | mingw* | pw32*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_AC_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_AC_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='true' # FIXME: Should let the user specify the lib program. _LT_AC_TAGVAR(old_archive_cmds, $1)='lib /OUT:$oldlib$oldobjs$old_deplibs' _LT_AC_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`' _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; darwin* | rhapsody*) case $host_os in rhapsody* | darwin1.[[012]]) _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress' ;; *) # Darwin 1.3 on if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' else case ${MACOSX_DEPLOYMENT_TARGET} in 10.[[012]]) _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup' ;; esac fi ;; esac _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_automatic, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='' _LT_AC_TAGVAR(link_all_deplibs, $1)=yes if test "$GCC" = yes ; then output_verbose_link_cmd='echo' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else case $cc_basename in xlc*) output_verbose_link_cmd='echo' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' ;; *) _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac fi ;; dgux*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; freebsd1*) _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | kfreebsd*-gnu | dragonfly*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; hpux9*) if test "$GCC" = yes; then _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else _LT_AC_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_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: _LT_AC_TAGVAR(hardcode_direct, $1)=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ;; hpux10*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test "$with_gnu_ld" = no; then _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes fi ;; hpux11*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac fi if test "$with_gnu_ld" = no; then _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir' fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: _LT_AC_TAGVAR(link_all_deplibs, $1)=yes ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; newsos6) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; openbsd*) _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' else case $host_os in openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' ;; *) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' ;; esac fi ;; os2*) _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_AC_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_AC_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' else _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' _LT_AC_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~ $LD -shared${allow_undefined_flag} -input $lib.exp $linker_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_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' fi _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: ;; solaris*) _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text' if test "$GCC" = yes; then wlarc='${wl}' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' else wlarc='' _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine linker options so we # cannot just pass the convience library names through # without $wl, iff we do not link with $LD. # Luckily, gcc supports the same syntax we need for Sun Studio. # Supported since Solaris 2.6 (maybe 2.5.1?) case $wlarc in '') _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;; *) _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; esac ;; esac _LT_AC_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_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4) case $host_vendor in sni) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_direct, $1)=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' _LT_AC_TAGVAR(hardcode_direct, $1)=no ;; motorola) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4.3*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes _LT_AC_TAGVAR(ld_shlibs, $1)=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7*) _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_AC_TAGVAR(link_all_deplibs, $1)=yes _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac fi ]) AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)]) test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no # # Do we need to explicitly link libc? # case "x$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)" in x|xyes) # Assume -lc should be added _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $_LT_AC_TAGVAR(archive_cmds, $1) in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. AC_MSG_CHECKING([whether -lc should be explicitly linked in]) $rm conftest* printf "$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_AC_TAGVAR(lt_prog_compiler_wl, $1) pic_flag=$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$_LT_AC_TAGVAR(allow_undefined_flag, $1) _LT_AC_TAGVAR(allow_undefined_flag, $1)= if AC_TRY_EVAL(_LT_AC_TAGVAR(archive_cmds, $1) 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) then _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no else _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes fi _LT_AC_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $rm conftest* AC_MSG_RESULT([$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)]) ;; esac fi ;; esac ])# AC_LIBTOOL_PROG_LD_SHLIBS # _LT_AC_FILE_LTDLL_C # ------------------- # Be careful that the start marker always follows a newline. AC_DEFUN([_LT_AC_FILE_LTDLL_C], [ # /* ltdll.c starts here */ # #define WIN32_LEAN_AND_MEAN # #include # #undef WIN32_LEAN_AND_MEAN # #include # # #ifndef __CYGWIN__ # # ifdef __CYGWIN32__ # # define __CYGWIN__ __CYGWIN32__ # # endif # #endif # # #ifdef __cplusplus # extern "C" { # #endif # BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved); # #ifdef __cplusplus # } # #endif # # #ifdef __CYGWIN__ # #include # DECLARE_CYGWIN_DLL( DllMain ); # #endif # HINSTANCE __hDllInstance_base; # # BOOL APIENTRY # DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved) # { # __hDllInstance_base = hInst; # return TRUE; # } # /* ltdll.c ends here */ ])# _LT_AC_FILE_LTDLL_C # _LT_AC_TAGVAR(VARNAME, [TAGNAME]) # --------------------------------- AC_DEFUN([_LT_AC_TAGVAR], [ifelse([$2], [], [$1], [$1_$2])]) # old names AC_DEFUN([AM_PROG_LIBTOOL], [AC_PROG_LIBTOOL]) AC_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) AC_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) AC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) AC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) AC_DEFUN([AM_PROG_LD], [AC_PROG_LD]) AC_DEFUN([AM_PROG_NM], [AC_PROG_NM]) # This is just to silence aclocal about the macro not being used ifelse([AC_DISABLE_FAST_INSTALL]) AC_DEFUN([LT_AC_PROG_GCJ], [AC_CHECK_TOOL(GCJ, gcj, no) test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" AC_SUBST(GCJFLAGS) ]) AC_DEFUN([LT_AC_PROG_RC], [AC_CHECK_TOOL(RC, windres, no) ]) ############################################################ # 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. # ############################################################ # LT_AC_PROG_SED # -------------- # Check for a fully-functional sed program, that truncates # as few characters as possible. Prefer GNU sed if found. AC_DEFUN([LT_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 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_MSG_RESULT([$SED]) ]) ## ltdl.m4 - Configure ltdl for the target system. -*-Autoconf-*- ## Copyright (C) 1999-2000 Free Software Foundation, Inc. ## ## This file is free software; the Free Software Foundation gives ## unlimited permission to copy and/or distribute it, with or without ## modifications, as long as this notice is preserved. # serial 7 AC_LIB_LTDL # AC_WITH_LTDL # ------------ # 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. AC_DEFUN([AC_WITH_LTDL], [AC_REQUIRE([AC_LIB_LTDL]) AC_SUBST([LIBLTDL]) AC_SUBST([INCLTDL]) # Unless the user asks us to check, assume no installed ltdl exists. use_installed_libltdl=no AC_ARG_WITH([included_ltdl], [ --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_LIB([ltdl], [lt_dlcaller_register], [with_included_ltdl=no], [with_included_ltdl=yes]) ]) fi if test "x$enable_ltdl_install" != xyes; then # If the user did not specify an installable libltdl, then default # to a convenience lib. AC_LIBLTDL_CONVENIENCE fi if test "x$with_included_ltdl" = xno; then # 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 fi # Report our decision... AC_MSG_CHECKING([whether to use included libltdl]) AC_MSG_RESULT([$with_included_ltdl]) AC_CONFIG_SUBDIRS([libltdl]) ])# AC_WITH_LTDL # AC_LIB_LTDL # ----------- # Perform all the checks necessary for compilation of the ltdl objects # -- including compiler checks and header checks. AC_DEFUN([AC_LIB_LTDL], [AC_PREREQ(2.50) AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([AC_C_CONST]) AC_REQUIRE([AC_HEADER_STDC]) AC_REQUIRE([AC_HEADER_DIRENT]) AC_REQUIRE([_LT_AC_CHECK_DLFCN]) AC_REQUIRE([AC_LTDL_ENABLE_INSTALL]) AC_REQUIRE([AC_LTDL_SHLIBEXT]) AC_REQUIRE([AC_LTDL_SHLIBPATH]) AC_REQUIRE([AC_LTDL_SYSSEARCHPATH]) AC_REQUIRE([AC_LTDL_OBJDIR]) AC_REQUIRE([AC_LTDL_DLPREOPEN]) AC_REQUIRE([AC_LTDL_DLLIB]) AC_REQUIRE([AC_LTDL_SYMBOL_USCORE]) AC_REQUIRE([AC_LTDL_DLSYM_USCORE]) AC_REQUIRE([AC_LTDL_SYS_DLOPEN_DEPLIBS]) AC_REQUIRE([AC_LTDL_FUNC_ARGZ]) AC_CHECK_HEADERS([assert.h ctype.h errno.h malloc.h memory.h stdlib.h \ stdio.h unistd.h]) AC_CHECK_HEADERS([dl.h sys/dl.h dld.h mach-o/dyld.h]) AC_CHECK_HEADERS([string.h strings.h], [break]) AC_CHECK_FUNCS([strchr index], [break]) AC_CHECK_FUNCS([strrchr rindex], [break]) AC_CHECK_FUNCS([memcpy bcopy], [break]) AC_CHECK_FUNCS([memmove strcmp]) AC_CHECK_FUNCS([closedir opendir readdir]) ])# AC_LIB_LTDL # AC_LTDL_ENABLE_INSTALL # ---------------------- AC_DEFUN([AC_LTDL_ENABLE_INSTALL], [AC_ARG_ENABLE([ltdl-install], [AC_HELP_STRING([--enable-ltdl-install], [install libltdl])]) AM_CONDITIONAL(INSTALL_LTDL, test x"${enable_ltdl_install-no}" != xno) AM_CONDITIONAL(CONVENIENCE_LTDL, test x"${enable_ltdl_convenience-no}" != xno) ])# AC_LTDL_ENABLE_INSTALL # AC_LTDL_SYS_DLOPEN_DEPLIBS # -------------------------- AC_DEFUN([AC_LTDL_SYS_DLOPEN_DEPLIBS], [AC_REQUIRE([AC_CANONICAL_HOST]) AC_CACHE_CHECK([whether deplibs are loaded by dlopen], [libltdl_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. libltdl_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. libltdl_cv_sys_dlopen_deplibs=unknown ;; aix[[45]]*) libltdl_cv_sys_dlopen_deplibs=yes ;; 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 libltdl_cv_sys_dlopen_deplibs=yes ;; gnu* | linux* | kfreebsd*-gnu | knetbsd*-gnu) # GNU and its variants, using gnu ld.so (Glibc) libltdl_cv_sys_dlopen_deplibs=yes ;; hpux10*|hpux11*) libltdl_cv_sys_dlopen_deplibs=yes ;; interix*) libltdl_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. libltdl_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. libltdl_cv_sys_dlopen_deplibs=yes ;; netbsd*) libltdl_cv_sys_dlopen_deplibs=yes ;; openbsd*) libltdl_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 explictly say `no'. libltdl_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'. libltdl_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'. libltdl_cv_sys_dlopen_deplibs=yes ;; solaris*) libltdl_cv_sys_dlopen_deplibs=yes ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) libltdl_cv_sys_dlopen_deplibs=yes ;; esac ]) if test "$libltdl_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 ])# AC_LTDL_SYS_DLOPEN_DEPLIBS # AC_LTDL_SHLIBEXT # ---------------- AC_DEFUN([AC_LTDL_SHLIBEXT], [AC_REQUIRE([AC_LIBTOOL_SYS_DYNAMIC_LINKER]) AC_CACHE_CHECK([which extension is used for loadable modules], [libltdl_cv_shlibext], [ module=yes eval libltdl_cv_shlibext=$shrext_cmds ]) if test -n "$libltdl_cv_shlibext"; then AC_DEFINE_UNQUOTED([LTDL_SHLIB_EXT], ["$libltdl_cv_shlibext"], [Define to the extension used for shared libraries, say, ".so".]) fi ])# AC_LTDL_SHLIBEXT # AC_LTDL_SHLIBPATH # ----------------- AC_DEFUN([AC_LTDL_SHLIBPATH], [AC_REQUIRE([AC_LIBTOOL_SYS_DYNAMIC_LINKER]) AC_CACHE_CHECK([which variable specifies run-time library path], [libltdl_cv_shlibpath_var], [libltdl_cv_shlibpath_var="$shlibpath_var"]) if test -n "$libltdl_cv_shlibpath_var"; then AC_DEFINE_UNQUOTED([LTDL_SHLIBPATH_VAR], ["$libltdl_cv_shlibpath_var"], [Define to the name of the environment variable that determines the dynamic library search path.]) fi ])# AC_LTDL_SHLIBPATH # AC_LTDL_SYSSEARCHPATH # --------------------- AC_DEFUN([AC_LTDL_SYSSEARCHPATH], [AC_REQUIRE([AC_LIBTOOL_SYS_DYNAMIC_LINKER]) AC_CACHE_CHECK([for the default library search path], [libltdl_cv_sys_search_path], [libltdl_cv_sys_search_path="$sys_lib_dlsearch_path_spec"]) if test -n "$libltdl_cv_sys_search_path"; then sys_search_path= for dir in $libltdl_cv_sys_search_path; do if test -z "$sys_search_path"; then sys_search_path="$dir" else sys_search_path="$sys_search_path$PATH_SEPARATOR$dir" fi done AC_DEFINE_UNQUOTED([LTDL_SYSSEARCHPATH], ["$sys_search_path"], [Define to the system default library search path.]) fi ])# AC_LTDL_SYSSEARCHPATH # AC_LTDL_OBJDIR # -------------- AC_DEFUN([AC_LTDL_OBJDIR], [AC_CACHE_CHECK([for objdir], [libltdl_cv_objdir], [libltdl_cv_objdir="$objdir" if test -n "$objdir"; then : else rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then libltdl_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. libltdl_cv_objdir=_libs fi rmdir .libs 2>/dev/null fi ]) AC_DEFINE_UNQUOTED([LTDL_OBJDIR], ["$libltdl_cv_objdir/"], [Define to the sub-directory in which libtool stores uninstalled libraries.]) ])# AC_LTDL_OBJDIR # AC_LTDL_DLPREOPEN # ----------------- AC_DEFUN([AC_LTDL_DLPREOPEN], [AC_REQUIRE([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE]) 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 ])# AC_LTDL_DLPREOPEN # AC_LTDL_DLLIB # ------------- AC_DEFUN([AC_LTDL_DLLIB], [LIBADD_DL= AC_SUBST(LIBADD_DL) AC_LANG_PUSH([C]) AC_CHECK_FUNC([shl_load], [AC_DEFINE([HAVE_SHL_LOAD], [1], [Define if you have the shl_load function.])], [AC_CHECK_LIB([dld], [shl_load], [AC_DEFINE([HAVE_SHL_LOAD], [1], [Define if you have the shl_load function.]) LIBADD_DL="$LIBADD_DL -ldld"], [AC_CHECK_LIB([dl], [dlopen], [AC_DEFINE([HAVE_LIBDL], [1], [Define if you have the libdl library or equivalent.]) LIBADD_DL="-ldl" libltdl_cv_lib_dl_dlopen="yes"], [AC_TRY_LINK([#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"], [AC_CHECK_LIB([svld], [dlopen], [AC_DEFINE([HAVE_LIBDL], [1], [Define if you have the libdl library or equivalent.]) LIBADD_DL="-lsvld" libltdl_cv_func_dlopen="yes"], [AC_CHECK_LIB([dld], [dld_link], [AC_DEFINE([HAVE_DLD], [1], [Define if you have the GNU dld library.]) LIBADD_DL="$LIBADD_DL -ldld"], [AC_CHECK_FUNC([_dyld_func_lookup], [AC_DEFINE([HAVE_DYLD], [1], [Define if you have the _dyld_func_lookup function.])]) ]) ]) ]) ]) ]) ]) if test x"$libltdl_cv_func_dlopen" = xyes || test x"$libltdl_cv_lib_dl_dlopen" = xyes then lt_save_LIBS="$LIBS" LIBS="$LIBS $LIBADD_DL" AC_CHECK_FUNCS([dlerror]) LIBS="$lt_save_LIBS" fi AC_LANG_POP ])# AC_LTDL_DLLIB # AC_LTDL_SYMBOL_USCORE # --------------------- # does the compiler prefix global symbols with an underscore? AC_DEFUN([AC_LTDL_SYMBOL_USCORE], [AC_REQUIRE([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE]) AC_CACHE_CHECK([for _ prefix in compiled symbols], [ac_cv_sys_symbol_underscore], [ac_cv_sys_symbol_underscore=no cat > conftest.$ac_ext < $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 ac_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" >&AC_FD_CC fi fi else echo "configure: cannot run $lt_cv_sys_global_symbol_pipe" >&AC_FD_CC fi else echo "configure: failed program was:" >&AC_FD_CC cat conftest.c >&AC_FD_CC fi rm -rf conftest* ]) ])# AC_LTDL_SYMBOL_USCORE # AC_LTDL_DLSYM_USCORE # -------------------- AC_DEFUN([AC_LTDL_DLSYM_USCORE], [AC_REQUIRE([AC_LTDL_SYMBOL_USCORE]) if test x"$ac_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_DL" _LT_AC_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 ])# AC_LTDL_DLSYM_USCORE # AC_LTDL_FUNC_ARGZ # ----------------- AC_DEFUN([AC_LTDL_FUNC_ARGZ], [AC_CHECK_HEADERS([argz.h]) 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.])], [#if HAVE_ARGZ_H # include #endif]) AC_CHECK_FUNCS([argz_append argz_create_sep argz_insert argz_next argz_stringify]) ])# AC_LTDL_FUNC_ARGZ freeradius-server/libltdl/aclocal.m4000066400000000000000000000767471257552170400200360ustar00rootroot00000000000000# generated automatically by aclocal 1.9a -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 2005 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # 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. # Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_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.9a' 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.9a], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION so it can be traced. # This function is AC_REQUIREd by AC_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.9a])]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets # $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to # `$srcdir', `$srcdir/..', or `$srcdir/../..'. # # Of course, Automake must honor this variable whenever it calls a # tool from the auxiliary directory. The problem is that $srcdir (and # therefore $ac_aux_dir as well) can be either absolute or relative, # depending on how configure is run. This is pretty annoying, since # it makes $ac_aux_dir quite unusable in subdirectories: in the top # source directory, any form will work fine, but in subdirectories a # relative path needs to be adjusted first. # # $ac_aux_dir/missing # fails when called from a subdirectory if $ac_aux_dir is relative # $top_srcdir/$ac_aux_dir/missing # fails if $ac_aux_dir is absolute, # fails when called from a subdirectory in a VPATH build with # a relative $ac_aux_dir # # The reason of the latter failure is that $top_srcdir and $ac_aux_dir # are both prefixed by $srcdir. In an in-source build this is usually # harmless because $srcdir is `.', but things will broke when you # start a VPATH build or use an absolute $srcdir. # # So we could use something similar to $top_srcdir/$ac_aux_dir/missing, # iff we strip the leading $srcdir from $ac_aux_dir. That would be: # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` # and then we would define $MISSING as # MISSING="\${SHELL} $am_aux_dir/missing" # This will work as long as MISSING is not called from configure, because # unfortunately $(top_srcdir) has no meaning in configure. # However there are other variables, like CC, which are often used in # configure, and could therefore not use this "fixed" $ac_aux_dir. # # Another solution, used here, is to always expand $ac_aux_dir to an # absolute PATH. The drawback is that using absolute paths prevent a # configured tree to be moved without reconfiguration. AC_DEFUN([AM_AUX_DIR_EXPAND], [dnl Rely on autoconf to set up CDPATH properly. AC_PREREQ([2.50])dnl # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` ]) # AM_CONDITIONAL -*- Autoconf -*- # Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 7 # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ(2.52)dnl ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl AC_SUBST([$1_TRUE]) AC_SUBST([$1_FALSE]) if $2; then $1_TRUE= $1_FALSE='#' else $1_TRUE='#' $1_FALSE= fi AC_CONFIG_COMMANDS_PRE( [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then AC_MSG_ERROR([[conditional "$1" was never defined. Usually this means the macro was only invoked conditionally.]]) fi])]) # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 8 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, # will think it sees a *use*, and therefore will trigger all it's # C support machinery. Also note that it means that autoscan, seeing # CC etc. in the Makefile, will ask for an AC_PROG_CC use... # _AM_DEPENDENCIES(NAME) # ---------------------- # See how the compiler implements dependency checking. # NAME is "CC", "CXX", "GCJ", or "OBJC". # We try a few techniques and use that to set a single cache variable. # # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular # dependency, and given that the user is not expected to run this macro, # just rely on AC_PROG_CC. AC_DEFUN([_AM_DEPENDENCIES], [AC_REQUIRE([AM_SET_DEPDIR])dnl AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl AC_REQUIRE([AM_MAKE_INCLUDE])dnl AC_REQUIRE([AM_DEP_TRACK])dnl ifelse([$1], CC, [depcc="$CC" am_compiler_list=], [$1], CXX, [depcc="$CXX" am_compiler_list=], [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], [depcc="$$1" am_compiler_list=]) AC_CACHE_CHECK([dependency style of $depcc], [am_cv_$1_dependencies_compiler_type], [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_$1_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` fi for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf case $depmode in 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 ;; none) break ;; esac # 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. if depmode=$depmode \ source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_$1_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_$1_dependencies_compiler_type=none fi ]) AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) AM_CONDITIONAL([am__fastdep$1], [ test "x$enable_dependency_tracking" != xno \ && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) ]) # AM_SET_DEPDIR # ------------- # Choose a directory name for dependency files. # This macro is AC_REQUIREd in _AM_DEPENDENCIES AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl ]) # AM_DEP_TRACK # ------------ AC_DEFUN([AM_DEP_TRACK], [AC_ARG_ENABLE(dependency-tracking, [ --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors]) if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) AC_SUBST([AMDEPBACKSLASH]) ]) # Generate code to set up dependency tracking. -*- Autoconf -*- # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. #serial 3 # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [for mf in $CONFIG_FILES; 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. # So let's grep whole file. if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then dirpart=`AS_DIRNAME("$mf")` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running `make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n 's/^U = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`AS_DIRNAME(["$file"])` AS_MKDIR_P([$dirpart/$fdir]) # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done ])# _AM_OUTPUT_DEPENDENCY_COMMANDS # AM_OUTPUT_DEPENDENCY_COMMANDS # ----------------------------- # This macro should only be invoked once -- use via AC_REQUIRE. # # This code is only required when automatic dependency tracking # is enabled. FIXME. This creates each `.P' file that we will # need in order to bootstrap the dependency handling code. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) ]) # Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 8 # AM_CONFIG_HEADER is obsolete. It has been replaced by AC_CONFIG_HEADERS. AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)]) # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 12 # This macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) # ----------------------------------------------- # The call with PACKAGE and VERSION arguments is the old style # call (pre autoconf-2.50), which is being phased out. PACKAGE # and VERSION should now be passed to AC_INIT and removed from # the call to AM_INIT_AUTOMAKE. # We support both call styles for the transition. After # the next Automake release, Autoconf can make the AC_INIT # arguments mandatory, and then we can depend on a new Autoconf # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.59c])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 # test to see if srcdir already configured if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi AC_SUBST([CYGPATH_W]) # Define the identity of the package. dnl Distinguish between old-style and new-style calls. m4_ifval([$2], [m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl 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) AM_PROG_INSTALL_SH AM_PROG_INSTALL_STRIP AC_REQUIRE([AM_PROG_MKDIR_P])dnl # We need awk for the "check" target. The system "awk" is bad on # some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])])]) _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], [_AM_DEPENDENCIES(CC)], [define([AC_PROG_CC], defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], [_AM_DEPENDENCIES(CXX)], [define([AC_PROG_CXX], defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl ]) ]) # 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_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $1 | $1:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count]) # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"} AC_SUBST(install_sh)]) # Copyright (C) 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 2 # Check whether the underlying file-system supports filenames # with a leading dot. For instance MS-DOS doesn't. AC_DEFUN([AM_SET_LEADING_DOT], [rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null AC_SUBST([am__leading_dot])]) # Check to see how 'make' treats includes. -*- Autoconf -*- # Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 3 # 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 done .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 # We grep out `Entering directory' and `Leaving directory' # messages which can occur if `w' ends up in MAKEFLAGS. # In particular we don't look at `^make:' because GNU make might # be invoked under some other name (usually "gmake"), in which # case it prints its new name instead of `make'. if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then am__include=include am__quote= _am_result=GNU fi # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then am__include=.include am__quote="\"" _am_result=BSD fi fi AC_SUBST([am__include]) AC_SUBST([am__quote]) AC_MSG_RESULT([$_am_result]) rm -f confinc confmf ]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- # Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 5 # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN]) $1=${$1-"${am_missing_run}$2"} AC_SUBST($1)]) # AM_MISSING_HAS_RUN # ------------------ # Define MISSING if not defined so far and test if it supports --run. # If it does, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([missing])dnl test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= AC_MSG_WARN([`missing' script is too old or missing]) fi ]) # Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_MKDIR_P # --------------- # Check whether `mkdir -p' is supported, fallback to mkinstalldirs otherwise. # # Automake 1.8 used `mkdir -m 0755 -p --' to ensure that directories # created by `make install' are always world readable, even if the # installer happens to have an overly restrictive umask (e.g. 077). # This was a mistake. There are at least two reasons why we must not # use `-m 0755': # - it causes special bits like SGID to be ignored, # - it may be too restrictive (some setups expect 775 directories). # # Do not use -m 0755 and let people choose whatever they expect by # setting umask. # # We cannot accept any implementation of `mkdir' that recognizes `-p'. # Some implementations (such as Solaris 8's) are not thread-safe: if a # parallel make tries to run `mkdir -p a/b' and `mkdir -p a/c' # concurrently, both version can detect that a/ is missing, but only # one can create it and the other will error out. Consequently we # restrict ourselves to GNU mkdir (using the --version option ensures # this.) AC_DEFUN([AM_PROG_MKDIR_P], [if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then # We used to define $(mkdir_p) as `mkdir -p -- .', in order to # allow $(mkdir_p) to be used without argument. As in # $(mkdir_p) $(somedir) # where $(somedir) is conditionally defined. However we don't do # that anymore. # 1. before we restricted the check to GNU mkdir, `mkdir -p .' was # reported to fail in read-only directories. The system where this # happened has been forgotten. # 2. in practice we call $(mkdir_p) on directories such as # $(mkdir_p) "$(DESTDIR)$(somedir)" # and we don't want to create $(DESTDIR) if $(somedir) is empty. # To support the latter case, we have to write # test -z "$(somedir)" || $(mkdir_p) "$(DESTDIR)$(somedir)" # so $(mkdir_p) always has an argument. # We will have better chances of detecting a missing test if # $(mkdir_p) complains about missing arguments. # 3. $(mkdir_p) is named after `mkdir -p' and we don't expect this # to accept no argument. # 4. having something like `mkdir .' in the output is unsightly. mkdir_p='mkdir -p --' else # On NextStep and OpenStep, the `mkdir' command does not # recognize any option. It will interpret all options as # directories to create. for d in ./-p ./--version; do test -d $d && rmdir $d done # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists. if test -f "$ac_aux_dir/mkinstalldirs"; then mkdir_p='$(mkinstalldirs)' else mkdir_p='$(install_sh) -d' fi fi AC_SUBST([mkdir_p])]) # Helper functions for option handling. -*- Autoconf -*- # Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 3 # _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], [AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) # ------------------------------------------- # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) # Check to make sure that the build environment is sane. -*- Autoconf -*- # Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 4 # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # Just in case sleep 1 echo timestamp > conftest.file # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` if test "$[*]" = "X"; then # -L didn't work. set X `ls -t $srcdir/configure conftest.file` fi rm -f conftest.file if test "$[*]" != "X $srcdir/configure conftest.file" \ && test "$[*]" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken alias in your environment]) fi test "$[2]" = conftest.file ) then # Ok. : else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi AC_MSG_RESULT(yes)]) # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_STRIP # --------------------- # One issue with vendor `install' (even GNU) is that you can't # specify the program used to strip binaries. This is especially # annoying in cross-compiling environments, where the build's strip # is unlikely to handle the host's binaries. # Fortunately install-sh will honor a STRIPPROG variable, so we # always use install-sh in `make install-strip', and initialize # STRIPPROG with the value of the STRIP variable (set by the user). AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the `STRIP' environment variable to overrule this program. dnl Don't test for $cross_compiling = yes, because it might be `maybe'. if test "$cross_compiling" != no; then AC_CHECK_TOOL([STRIP], [strip], :) fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) # Check how to create a tarball. -*- Autoconf -*- # Copyright (C) 2004, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 2 # _AM_PROG_TAR(FORMAT) # -------------------- # Check how to create a tarball in format FORMAT. # FORMAT should be one of `v7', `ustar', or `pax'. # # Substitute a variable $(am__tar) that is a command # writing to stdout a FORMAT-tarball containing the directory # $tardir. # tardir=directory && $(am__tar) > result.tar # # Substitute a variable $(am__untar) that extract such # a tarball read from stdin. # $(am__untar) < result.tar AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility. AM_MISSING_PROG([AMTAR], [tar]) m4_if([$1], [v7], [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'], [m4_case([$1], [ustar],, [pax],, [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) # Loop over all known methods to create a tar archive until one works. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' _am_tools=${am_cv_prog_tar_$1-$_am_tools} # Do not fold the above two line into one, because Tru64 sh and # Solaris sh will not grok spaces in the rhs of `-'. for _am_tool in $_am_tools do case $_am_tool in gnutar) for _am_tar in tar gnutar gtar; do AM_RUN_LOG([$_am_tar --version]) && break done am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' am__untar="$_am_tar -xf -" ;; plaintar) # Must skip GNU tar: if it does not support --format= it doesn't create # ustar tarball either. (tar --version) >/dev/null 2>&1 && continue am__tar='tar chf - "$$tardir"' am__tar_='tar chf - "$tardir"' am__untar='tar xf -' ;; pax) am__tar='pax -L -x $1 -w "$$tardir"' am__tar_='pax -L -x $1 -w "$tardir"' am__untar='pax -r' ;; cpio) am__tar='find "$$tardir" -print | cpio -o -H $1 -L' am__tar_='find "$tardir" -print | cpio -o -H $1 -L' am__untar='cpio -i -H $1 -d' ;; none) am__tar=false am__tar_=false am__untar=false ;; esac # If the value was cached, stop now. We just wanted to have am__tar # and am__untar set. test -n "${am_cv_prog_tar_$1}" && break # tar/untar a dummy directory, and stop if the command works rm -rf conftest.dir mkdir conftest.dir echo GrepMe > conftest.dir/file AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) rm -rf conftest.dir if test -s conftest.tar; then AM_RUN_LOG([$am__untar /dev/null 2>&1 && break fi done rm -rf conftest.dir AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) AC_MSG_RESULT([$am_cv_prog_tar_$1])]) AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR m4_include([acinclude.m4]) freeradius-server/libltdl/config-h.in000066400000000000000000000122651257552170400202010ustar00rootroot00000000000000/* config-h.in. Generated from configure.ac by autoheader. */ /* Define to 1 if you have the `argz_append' function. */ #undef HAVE_ARGZ_APPEND /* 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 header file. */ #undef HAVE_ASSERT_H /* Define to 1 if you have the `bcopy' function. */ #undef HAVE_BCOPY /* Define to 1 if you have the `closedir' function. */ #undef HAVE_CLOSEDIR /* Define to 1 if you have the header file. */ #undef HAVE_CTYPE_H /* Define to 1 if you have the header file, and it defines `DIR'. */ #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 you have the header file. */ #undef HAVE_ERRNO_H /* Define to 1 if the system has the type `error_t'. */ #undef HAVE_ERROR_T /* Define to 1 if you have the `index' function. */ #undef HAVE_INDEX /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define if you have the libdl library or equivalent. */ #undef HAVE_LIBDL /* 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_MALLOC_H /* Define to 1 if you have the `memcpy' function. */ #undef HAVE_MEMCPY /* Define to 1 if you have the `memmove' function. */ #undef HAVE_MEMMOVE /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_NDIR_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 to 1 if you have the `rindex' function. */ #undef HAVE_RINDEX /* Define if you have the shl_load function. */ #undef HAVE_SHL_LOAD /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDIO_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the `strchr' function. */ #undef HAVE_STRCHR /* Define to 1 if you have the `strcmp' function. */ #undef HAVE_STRCMP /* 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 `strrchr' function. */ #undef HAVE_STRRCHR /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_SYS_DIR_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_DL_H /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_SYS_NDIR_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_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_UNISTD_H /* Define if the OS needs help to load dependent libraries for dlopen(). */ #undef LTDL_DLOPEN_DEPLIBS /* Define to the sub-directory in which libtool stores uninstalled libraries. */ #undef LTDL_OBJDIR /* Define to the name of the environment variable that determines the dynamic library search path. */ #undef LTDL_SHLIBPATH_VAR /* Define to the extension used for shared libraries, say, ".so". */ #undef LTDL_SHLIB_EXT /* Define to the system default library search path. */ #undef LTDL_SYSSEARCHPATH /* Define if dlsym() requires a leading underscore in symbol names. */ #undef NEED_USCORE /* 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 version of this package. */ #undef PACKAGE_VERSION /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* Define to empty if `const' does not conform to ANSI C. */ #undef const /* Define to a type to use for `error_t' if it is not otherwise available. */ #undef error_t /* Define to `__inline__' or `__inline' if that's what the C compiler calls it, or to nothing if 'inline' is not supported under any name. */ #ifndef __cplusplus #undef inline #endif freeradius-server/libltdl/config.guess000077500000000000000000001252241257552170400204770ustar00rootroot00000000000000#! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. timestamp='2005-12-13' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA # 02110-1301, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Per Bothner . # Please send patches to . Submit a context # diff and a properly formatted ChangeLog entry. # # This script attempts to guess a canonical system name similar to # config.sub. If it succeeds, it prints the system name on stdout, and # exits with 0. Otherwise, it exits with 1. # # The plan is that this can be called by configure scripts if you # don't specify an explicit build system type. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; * ) break ;; esac done if test $# != 0; then echo "$me: too many arguments$help" >&2 exit 1 fi trap 'exit 1' 1 2 15 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a # headache to deal with in a portable fashion. # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. # Portable tmp directory creation inspired by the Autoconf team. set_cc_for_build=' trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; : ${TMPDIR=/tmp} ; { tmp=`(umask 077 && mktemp -d -q "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; dummy=$tmp/dummy ; tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; case $CC_FOR_BUILD,$HOST_CC,$CC in ,,) echo "int x;" > $dummy.c ; for c in cc gcc c89 c99 ; do if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then CC_FOR_BUILD="$c"; break ; fi ; done ; if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found ; fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; esac ; set_cc_for_build= ;' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) if (test -f /.attbin/uname) >/dev/null 2>&1 ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ /usr/sbin/$sysctl 2>/dev/null || echo unknown)` case "${UNAME_MACHINE_ARCH}" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently, or will in the future. case "${UNAME_MACHINE_ARCH}" in arm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep __ELF__ >/dev/null then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? os=netbsd else os=netbsdelf fi ;; *) os=netbsd ;; esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. case "${UNAME_VERSION}" in Debian*) release='-gnu' ;; *) release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}" exit ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} exit ;; *:ekkoBSD:*:*) echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} exit ;; macppc:MirBSD:*:*) echo powerppc-unknown-mirbsd${UNAME_RELEASE} exit ;; *:MirBSD:*:*) echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; *5.*) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on # OSF/1 and Tru64 systems produced since 1995. I hope that # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case "$ALPHA_CPU_TYPE" in "EV4 (21064)") UNAME_MACHINE="alpha" ;; "EV4.5 (21064)") UNAME_MACHINE="alpha" ;; "LCA4 (21066/21068)") UNAME_MACHINE="alpha" ;; "EV5 (21164)") UNAME_MACHINE="alphaev5" ;; "EV5.6 (21164A)") UNAME_MACHINE="alphaev56" ;; "EV5.6 (21164PC)") UNAME_MACHINE="alphapca56" ;; "EV5.7 (21164PC)") UNAME_MACHINE="alphapca57" ;; "EV6 (21264)") UNAME_MACHINE="alphaev6" ;; "EV6.7 (21264A)") UNAME_MACHINE="alphaev67" ;; "EV6.8CB (21264C)") UNAME_MACHINE="alphaev68" ;; "EV6.8AL (21264B)") UNAME_MACHINE="alphaev68" ;; "EV6.8CX (21264D)") UNAME_MACHINE="alphaev68" ;; "EV6.9A (21264/EV69A)") UNAME_MACHINE="alphaev69" ;; "EV7 (21364)") UNAME_MACHINE="alphaev7" ;; "EV7.9 (21364A)") UNAME_MACHINE="alphaev79" ;; esac # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` exit ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # Should we change UNAME_MACHINE based on the output of uname instead # of the specific Alpha model? echo alpha-pc-interix exit ;; 21064:Windows_NT:50:3) echo alpha-dec-winnt3.5 exit ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit ;; *:[Aa]miga[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-amigaos exit ;; *:[Mm]orph[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-morphos exit ;; *:OS/390:*:*) echo i370-ibm-openedition exit ;; *:z/VM:*:*) echo s390-ibm-zvmoe exit ;; *:OS400:*:*) echo powerpc-ibm-os400 exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit ;; arm:riscos:*:*|arm:RISCOS:*:*) echo arm-unknown-riscos exit ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit ;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then echo pyramid-pyramid-sysv3 else echo pyramid-pyramid-bsd fi exit ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit ;; DRS?6000:unix:4.0:6*) echo sparc-icl-nx6 exit ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7; exit ;; esac ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; i86pc:SunOS:5.*:*) echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` exit ;; sun3*:SunOS:*:*) echo m68k-sun-sunos${UNAME_RELEASE} exit ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) echo m68k-sun-sunos${UNAME_RELEASE} ;; sun4) echo sparc-sun-sunos${UNAME_RELEASE} ;; esac exit ;; aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} exit ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor # > m68000). The system name ranges from "MiNT" over "FreeMiNT" # to the lowercase version "mint" (or "freemint"). Finally # the system name "TOS" denotes a system which is actually not # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint${UNAME_RELEASE} exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint${UNAME_RELEASE} exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} exit ;; m68k:machten:*:*) echo m68k-apple-machten${UNAME_RELEASE} exit ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} exit ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix${UNAME_RELEASE} exit ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix${UNAME_RELEASE} exit ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix${UNAME_RELEASE} exit ;; mips:*:*:UMIPS | mips:*:*:RISCos) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && SYSTEM_NAME=`$dummy $dummyarg` && { echo "$SYSTEM_NAME"; exit; } echo mips-mips-riscos${UNAME_RELEASE} exit ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax exit ;; Motorola:*:4.3:PL8-*) echo powerpc-harris-powermax exit ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) echo powerpc-harris-powermax exit ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 exit ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 exit ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 exit ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] then if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ [ ${TARGET_BINARY_INTERFACE}x = x ] then echo m88k-dg-dgux${UNAME_RELEASE} else echo m88k-dg-dguxbcs${UNAME_RELEASE} fi else echo i586-dg-dgux${UNAME_RELEASE} fi exit ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 exit ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 exit ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd exit ;; *:IRIX*:*:*) echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` exit ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix exit ;; ia64:AIX:*:*) if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} exit ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include main() { if (!__power_pc()) exit(1); puts("powerpc-ibm-aix3.2.5"); exit(0); } EOF if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` then echo "$SYSTEM_NAME" else echo rs6000-ibm-aix3.2.5 fi elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 else echo rs6000-ibm-aix3.2 fi exit ;; *:AIX:*:[45]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${IBM_ARCH}-ibm-aix${IBM_REV} exit ;; *:AIX:*:*) echo rs6000-ibm-aix exit ;; ibmrt:4.4BSD:*|romp-ibm:BSD:*) echo romp-ibm-bsd4.4 exit ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to exit ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx exit ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 exit ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd exit ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` case "${UNAME_MACHINE}" in 9000/31? ) HP_ARCH=m68000 ;; 9000/[34]?? ) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "${sc_cpu_version}" in 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case "${sc_kernel_bits}" in 32) HP_ARCH="hppa2.0n" ;; 64) HP_ARCH="hppa2.0w" ;; '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 esac ;; esac fi if [ "${HP_ARCH}" = "" ]; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #define _HPUX_SOURCE #include #include int main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); #endif long cpu = sysconf (_SC_CPU_VERSION); switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break; case CPU_PA_RISC2_0: #if defined(_SC_KERNEL_BITS) switch (bits) { case 64: puts ("hppa2.0w"); break; case 32: puts ("hppa2.0n"); break; default: puts ("hppa2.0"); break; } break; #else /* !defined(_SC_KERNEL_BITS) */ puts ("hppa2.0"); break; #endif default: puts ("hppa1.0"); break; } exit (0); } EOF (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac if [ ${HP_ARCH} = "hppa2.0w" ] then eval $set_cc_for_build # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler # generating 64-bit code. GNU and HP use different nomenclature: # # $ CC_FOR_BUILD=cc ./config.guess # => hppa2.0w-hp-hpux11.23 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess # => hppa64-hp-hpux11.23 if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | grep __LP64__ >/dev/null then HP_ARCH="hppa2.0w" else HP_ARCH="hppa64" fi fi echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit ;; ia64:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux${HPUX_REV} exit ;; 3050*:HI-UX:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include int main () { long cpu = sysconf (_SC_CPU_VERSION); /* The order matters, because CPU_IS_HP_MC68K erroneously returns true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct results, however. */ if (CPU_IS_PA_RISC (cpu)) { switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; default: puts ("hppa-hitachi-hiuxwe2"); break; } } else if (CPU_IS_HP_MC68K (cpu)) puts ("m68k-hitachi-hiuxwe2"); else puts ("unknown-hitachi-hiuxwe2"); exit (0); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } echo unknown-hitachi-hiuxwe2 exit ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) echo hppa1.1-hp-bsd exit ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) echo hppa1.1-hp-osf exit ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-unknown-osf1mk else echo ${UNAME_MACHINE}-unknown-osf1 fi exit ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd exit ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd exit ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*[A-Z]90:*:*:*) echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit ;; CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; *:UNICOS/mp:*:*) echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi${UNAME_RELEASE} exit ;; *:BSD/OS:*:*) echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit ;; *:FreeBSD:*:*) echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit ;; i*:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; i*:windows32*:*) # uname -m includes "-pc" on this system. echo ${UNAME_MACHINE}-mingw32 exit ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit ;; x86:Interix*:[345]*) echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//' exit ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks exit ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we # UNAME_MACHINE based on the output of uname instead of i386? echo i586-pc-interix exit ;; i*:UWIN*:*) echo ${UNAME_MACHINE}-pc-uwin exit ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) echo x86_64-unknown-cygwin exit ;; p*:CYGWIN*:*) echo powerpcle-unknown-cygwin exit ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; *:GNU:*:*) # the GNU system echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu exit ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit ;; arm*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; cris:Linux:*:*) echo cris-axis-linux-gnu exit ;; crisv32:Linux:*:*) echo crisv32-axis-linux-gnu exit ;; frv:Linux:*:*) echo frv-unknown-linux-gnu exit ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; m32r*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; mips:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef mips #undef mipsel #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=mipsel #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=mips #else CPU= #endif #endif EOF eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '/^CPU/{s: ::g;p;}'`" test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } ;; mips64:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef mips64 #undef mips64el #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=mips64el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=mips64 #else CPU= #endif #endif EOF eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '/^CPU/{s: ::g;p;}'`" test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } ;; or32:Linux:*:*) echo or32-unknown-linux-gnu exit ;; ppc:Linux:*:*) echo powerpc-unknown-linux-gnu exit ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-gnu exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; PCA57) UNAME_MACHINE=alphapca56 ;; EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) echo hppa1.1-unknown-linux-gnu ;; PA8*) echo hppa2.0-unknown-linux-gnu ;; *) echo hppa-unknown-linux-gnu ;; esac exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-gnu exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux exit ;; sh64*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; vax:Linux:*:*) echo ${UNAME_MACHINE}-dec-linux-gnu exit ;; x86_64:Linux:*:*) echo x86_64-unknown-linux-gnu exit ;; i*86:Linux:*:*) # The BFD linker knows what the default object file format is, so # first see if it will tell us. cd to the root directory to prevent # problems with other programs or directories called `ld' in the path. # Set LC_ALL=C to ensure ld outputs messages in English. ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \ | sed -ne '/supported targets:/!d s/[ ][ ]*/ /g s/.*supported targets: *// s/ .*// p'` case "$ld_supported_targets" in elf32-i386) TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" ;; a.out-i386-linux) echo "${UNAME_MACHINE}-pc-linux-gnuaout" exit ;; coff-i386) echo "${UNAME_MACHINE}-pc-linux-gnucoff" exit ;; "") # Either a pre-BFD a.out linker (linux-gnuoldld) or # one that does not give us useful --help. echo "${UNAME_MACHINE}-pc-linux-gnuoldld" exit ;; esac # Determine whether the default compiler is a.out or elf eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include #ifdef __ELF__ # ifdef __GLIBC__ # if __GLIBC__ >= 2 LIBC=gnu # else LIBC=gnulibc1 # endif # else LIBC=gnulibc1 # endif #else #if defined(__INTEL_COMPILER) || defined(__PGI) LIBC=gnu #else LIBC=gnuaout #endif #endif #ifdef __dietlibc__ LIBC=dietlibc #endif EOF eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '/^LIBC/{s: ::g;p;}'`" test x"${LIBC}" != x && { echo "${UNAME_MACHINE}-pc-linux-${LIBC}" exit } test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; } ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. echo i386-sequent-sysv4 exit ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. echo ${UNAME_MACHINE}-pc-os2-emx exit ;; i*86:XTS-300:*:STOP) echo ${UNAME_MACHINE}-unknown-stop exit ;; i*86:atheos:*:*) echo ${UNAME_MACHINE}-unknown-atheos exit ;; i*86:syllable:*:*) echo ${UNAME_MACHINE}-pc-syllable exit ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit ;; i*86:*DOS:*:*) echo ${UNAME_MACHINE}-pc-msdosdjgpp exit ;; i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} else echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} fi exit ;; i*86:*:5:[678]*) # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} exit ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL else echo ${UNAME_MACHINE}-pc-sysv32 fi exit ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i386. echo i386-pc-msdosdjgpp exit ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit ;; paragon:*:*:*) echo i860-intel-osf1 exit ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 fi exit ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv exit ;; mc68k:UNIX:SYSTEM5:3.51m) echo m68k-convergent-sysv exit ;; M680?0:D-NIX:5.3:*) echo m68k-diab-dnix exit ;; M68*:*:R3V[5678]*:*) test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} exit ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} exit ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} exit ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 exit ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` echo ${UNAME_MACHINE}-sni-sysv4 else echo ns32k-sni-sysv fi exit ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says echo i586-unisys-sysv4 exit ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 exit ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. echo ${UNAME_MACHINE}-stratus-vos exit ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} exit ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv${UNAME_RELEASE} else echo mips-unknown-sysv${UNAME_RELEASE} fi exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos exit ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux${UNAME_RELEASE} exit ;; SX-6:SUPER-UX:*:*) echo sx6-nec-superux${UNAME_RELEASE} exit ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit ;; *:Rhapsody:*:*) echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} exit ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown case $UNAME_PROCESSOR in unknown) UNAME_PROCESSOR=powerpc ;; esac echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = "x86"; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} exit ;; *:QNX:*:4*) echo i386-pc-qnx exit ;; NSE-?:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk${UNAME_RELEASE} exit ;; NSR-?:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux exit ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv exit ;; DS/*:UNIX_System_V:*:*) echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} exit ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. if test "$cputype" = "386"; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" fi echo ${UNAME_MACHINE}-unknown-plan9 exit ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 exit ;; *:TENEX:*:*) echo pdp10-unknown-tenex exit ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 exit ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 exit ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 exit ;; *:ITS:*:*) echo pdp10-unknown-its exit ;; SEI:*:*:SEIUX) echo mips-sei-seiux${UNAME_RELEASE} exit ;; *:DragonFly:*:*) echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` case "${UNAME_MACHINE}" in A*) echo alpha-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;; V*) echo vax-dec-vms ; exit ;; esac ;; *:XENIX:*:SysV) echo i386-pc-xenix exit ;; i*86:skyos:*:*) echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' exit ;; i*86:rdos:*:*) echo ${UNAME_MACHINE}-pc-rdos exit ;; esac #echo '(No uname command or uname output not recognized.)' 1>&2 #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 eval $set_cc_for_build cat >$dummy.c < # include #endif main () { #if defined (sony) #if defined (MIPSEB) /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, I don't know.... */ printf ("mips-sony-bsd\n"); exit (0); #else #include printf ("m68k-sony-newsos%s\n", #ifdef NEWSOS4 "4" #else "" #endif ); exit (0); #endif #endif #if defined (__arm) && defined (__acorn) && defined (__unix) printf ("arm-acorn-riscix\n"); exit (0); #endif #if defined (hp300) && !defined (hpux) printf ("m68k-hp-bsd\n"); exit (0); #endif #if defined (NeXT) #if !defined (__ARCHITECTURE__) #define __ARCHITECTURE__ "m68k" #endif int version; version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; if (version < 4) printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); else printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); exit (0); #endif #if defined (MULTIMAX) || defined (n16) #if defined (UMAXV) printf ("ns32k-encore-sysv\n"); exit (0); #else #if defined (CMU) printf ("ns32k-encore-mach\n"); exit (0); #else printf ("ns32k-encore-bsd\n"); exit (0); #endif #endif #endif #if defined (__386BSD__) printf ("i386-pc-bsd\n"); exit (0); #endif #if defined (sequent) #if defined (i386) printf ("i386-sequent-dynix\n"); exit (0); #endif #if defined (ns32000) printf ("ns32k-sequent-dynix\n"); exit (0); #endif #endif #if defined (_SEQUENT_) struct utsname un; uname(&un); if (strncmp(un.version, "V2", 2) == 0) { printf ("i386-sequent-ptx2\n"); exit (0); } if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ printf ("i386-sequent-ptx1\n"); exit (0); } printf ("i386-sequent-ptx\n"); exit (0); #endif #if defined (vax) # if !defined (ultrix) # include # if defined (BSD) # if BSD == 43 printf ("vax-dec-bsd4.3\n"); exit (0); # else # if BSD == 199006 printf ("vax-dec-bsd4.3reno\n"); exit (0); # else printf ("vax-dec-bsd\n"); exit (0); # endif # endif # else printf ("vax-dec-bsd\n"); exit (0); # endif # else printf ("vax-dec-ultrix\n"); exit (0); # endif #endif #if defined (alliant) && defined (i860) printf ("i860-alliant-bsd\n"); exit (0); #endif exit (1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } # Apollos put the system type in the environment. test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } # Convex versions that predate uname can use getsysinfo(1) if [ -x /usr/convex/getsysinfo ] then case `getsysinfo -f cpu_type` in c1*) echo c1-convex-bsd exit ;; c2*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; c34*) echo c34-convex-bsd exit ;; c38*) echo c38-convex-bsd exit ;; c4*) echo c4-convex-bsd exit ;; esac fi cat >&2 < in order to provide the needed information to handle your system. config.guess timestamp = $timestamp uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` /bin/uname -X = `(/bin/uname -X) 2>/dev/null` hostinfo = `(hostinfo) 2>/dev/null` /bin/universe = `(/bin/universe) 2>/dev/null` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` /bin/arch = `(/bin/arch) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` UNAME_MACHINE = ${UNAME_MACHINE} UNAME_RELEASE = ${UNAME_RELEASE} UNAME_SYSTEM = ${UNAME_SYSTEM} UNAME_VERSION = ${UNAME_VERSION} EOF exit 1 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: freeradius-server/libltdl/config.sub000077500000000000000000000766271257552170400201560ustar00rootroot00000000000000#! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. timestamp='2005-12-11' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software # can handle that machine. It does not imply ALL GNU software can. # # This file is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA # 02110-1301, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Please send patches to . Submit a context # diff and a properly formatted ChangeLog entry. # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS $0 [OPTION] ALIAS Canonicalize a configuration name. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.sub ($timestamp) Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" exit 1 ;; *local*) # First pass through any local machine types. echo $1 exit ;; * ) break ;; esac done case $# in 0) echo "$me: missing argument$help" >&2 exit 1;; 1) ;; *) echo "$me: too many arguments$help" >&2 exit 1;; esac # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \ uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; *) basic_machine=`echo $1 | sed 's/-[^-]*$//'` if [ $basic_machine != $1 ] then os=`echo $1 | sed 's/.*-/-/'` else os=; fi ;; esac ### Let's recognize common machines as not being operating systems so ### that things like config.sub decstation-3100 work. We also ### recognize some manufacturers as not being operating systems, so we ### can provide default operating systems below. case $os in -sun*os*) # Prevent following clause from handling this invalid input. ;; -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ -apple | -axis | -knuth | -cray) os= basic_machine=$1 ;; -sim | -cisco | -oki | -wec | -winbond) os= basic_machine=$1 ;; -scout) ;; -wrs) os=-vxworks basic_machine=$1 ;; -chorusos*) os=-chorusos basic_machine=$1 ;; -chorusrdb) os=-chorusrdb basic_machine=$1 ;; -hiux*) os=-hiuxwe2 ;; -sco6) os=-sco5v6 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5) os=-sco3.2v5 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco4) os=-sco3.2v4 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2.[4-9]*) os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2v[4-9]*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5v6*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco*) os=-sco3.2v2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -udk*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -isc) os=-isc2.2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -clix*) basic_machine=clipper-intergraph ;; -isc*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -lynx*) os=-lynxos ;; -ptx*) basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` ;; -windowsnt*) os=`echo $os | sed -e 's/windowsnt/winnt/'` ;; -psos*) os=-psos ;; -mint | -mint[0-9]*) basic_machine=m68k-atari os=-mint ;; esac # Decode aliases for certain CPU-COMPANY combinations. case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. 1750a | 580 \ | a29k \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \ | bfin \ | c4x | clipper \ | d10v | d30v | dlx | dsp16xx \ | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ | m32r | m32rle | m68000 | m68k | m88k | maxq | mcore \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ | mips64vr | mips64vrel \ | mips64orion | mips64orionel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | mt \ | msp430 \ | ns16k | ns32k \ | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ | pyramid \ | sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b \ | strongarm \ | tahoe | thumb | tic4x | tic80 | tron \ | v850 | v850e \ | we32k \ | x86 | xscale | xscalee[bl] | xstormy16 | xtensa \ | z8k) basic_machine=$basic_machine-unknown ;; m32c) basic_machine=$basic_machine-unknown ;; m6811 | m68hc11 | m6812 | m68hc12) # Motorola 68HC11/12. basic_machine=$basic_machine-unknown os=-none ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; ms1) basic_machine=mt-unknown ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. i*86 | x86_64) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. *-*-*) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ | f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | maxq-* | mcore-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ | mips64vr-* | mips64vrel-* \ | mips64orion-* | mips64orionel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ | mips64vr5900-* | mips64vr5900el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ | mt-* \ | msp430-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ | pyramid-* \ | romp-* | rs6000-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc86x-* | sparclet-* \ | sparclite-* \ | sparcv8-* | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \ | tahoe-* | thumb-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tron-* \ | v850-* | v850e-* | vax-* \ | we32k-* \ | x86-* | x86_64-* | xps100-* | xscale-* | xscalee[bl]-* \ | xstormy16-* | xtensa-* \ | ymp-* \ | z8k-*) ;; m32c-*) ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) basic_machine=i386-unknown os=-bsd ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) basic_machine=m68000-att ;; 3b*) basic_machine=we32k-att ;; a29khif) basic_machine=a29k-amd os=-udi ;; abacus) basic_machine=abacus-unknown ;; adobe68k) basic_machine=m68010-adobe os=-scout ;; alliant | fx80) basic_machine=fx80-alliant ;; altos | altos3068) basic_machine=m68k-altos ;; am29k) basic_machine=a29k-none os=-bsd ;; amd64) basic_machine=x86_64-pc ;; amd64-*) basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; amdahl) basic_machine=580-amdahl os=-sysv ;; amiga | amiga-*) basic_machine=m68k-unknown ;; amigaos | amigados) basic_machine=m68k-unknown os=-amigaos ;; amigaunix | amix) basic_machine=m68k-unknown os=-sysv4 ;; apollo68) basic_machine=m68k-apollo os=-sysv ;; apollo68bsd) basic_machine=m68k-apollo os=-bsd ;; aux) basic_machine=m68k-apple os=-aux ;; balance) basic_machine=ns32k-sequent os=-dynix ;; c90) basic_machine=c90-cray os=-unicos ;; convex-c1) basic_machine=c1-convex os=-bsd ;; convex-c2) basic_machine=c2-convex os=-bsd ;; convex-c32) basic_machine=c32-convex os=-bsd ;; convex-c34) basic_machine=c34-convex os=-bsd ;; convex-c38) basic_machine=c38-convex os=-bsd ;; cray | j90) basic_machine=j90-cray os=-unicos ;; craynv) basic_machine=craynv-cray os=-unicosmp ;; cr16c) basic_machine=cr16c-unknown os=-elf ;; crds | unos) basic_machine=m68k-crds ;; crisv32 | crisv32-* | etraxfs*) basic_machine=crisv32-axis ;; cris | cris-* | etrax*) basic_machine=cris-axis ;; crx) basic_machine=crx-unknown os=-elf ;; da30 | da30-*) basic_machine=m68k-da30 ;; decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) basic_machine=mips-dec ;; decsystem10* | dec10*) basic_machine=pdp10-dec os=-tops10 ;; decsystem20* | dec20*) basic_machine=pdp10-dec os=-tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) basic_machine=m68k-motorola ;; delta88) basic_machine=m88k-motorola os=-sysv3 ;; djgpp) basic_machine=i586-pc os=-msdosdjgpp ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=-bosx ;; dpx2* | dpx2*-bull) basic_machine=m68k-bull os=-sysv3 ;; ebmon29k) basic_machine=a29k-amd os=-ebmon ;; elxsi) basic_machine=elxsi-elxsi os=-bsd ;; encore | umax | mmax) basic_machine=ns32k-encore ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson os=-ose ;; fx2800) basic_machine=i860-alliant ;; genix) basic_machine=ns32k-ns ;; gmicro) basic_machine=tron-gmicro os=-sysv ;; go32) basic_machine=i386-pc os=-go32 ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; h8300hms) basic_machine=h8300-hitachi os=-hms ;; h8300xray) basic_machine=h8300-hitachi os=-xray ;; h8500hms) basic_machine=h8500-hitachi os=-hms ;; harris) basic_machine=m88k-harris os=-sysv3 ;; hp300-*) basic_machine=m68k-hp ;; hp300bsd) basic_machine=m68k-hp os=-bsd ;; hp300hpux) basic_machine=m68k-hp os=-hpux ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) basic_machine=m68000-hp ;; hp9k3[2-9][0-9]) basic_machine=m68k-hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) basic_machine=hppa1.1-hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) basic_machine=hppa1.1-hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; hppa-next) os=-nextstep3 ;; hppaosf) basic_machine=hppa1.1-hp os=-osf ;; hppro) basic_machine=hppa1.1-hp os=-proelf ;; i370-ibm* | ibm*) basic_machine=i370-ibm ;; # I'm not sure what "Sysv32" means. Should this be sysv3.2? i*86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; i*86v4*) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; i*86v) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv ;; i*86sol2) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; i386mach) basic_machine=i386-mach os=-mach ;; i386-vsta | vsta) basic_machine=i386-unknown os=-vsta ;; iris | iris4d) basic_machine=mips-sgi case $os in -irix*) ;; *) os=-irix4 ;; esac ;; isi68 | isi) basic_machine=m68k-isi os=-sysv ;; m88k-omron*) basic_machine=m88k-omron ;; magnum | m3230) basic_machine=mips-mips os=-sysv ;; merlin) basic_machine=ns32k-utek os=-sysv ;; mingw32) basic_machine=i386-pc os=-mingw32 ;; miniframe) basic_machine=m68000-convergent ;; *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) basic_machine=m68k-atari os=-mint ;; mips3*-*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` ;; mips3*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown ;; monitor) basic_machine=m68k-rom68k os=-coff ;; morphos) basic_machine=powerpc-unknown os=-morphos ;; msdos) basic_machine=i386-pc os=-msdos ;; ms1-*) basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` ;; mvs) basic_machine=i370-ibm os=-mvs ;; ncr3000) basic_machine=i486-ncr os=-sysv4 ;; netbsd386) basic_machine=i386-unknown os=-netbsd ;; netwinder) basic_machine=armv4l-rebel os=-linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony os=-newsos ;; news1000) basic_machine=m68030-sony os=-newsos ;; news-3600 | risc-news) basic_machine=mips-sony os=-newsos ;; necv70) basic_machine=v70-nec os=-sysv ;; next | m*-next ) basic_machine=m68k-next case $os in -nextstep* ) ;; -ns2*) os=-nextstep2 ;; *) os=-nextstep3 ;; esac ;; nh3000) basic_machine=m68k-harris os=-cxux ;; nh[45]000) basic_machine=m88k-harris os=-cxux ;; nindy960) basic_machine=i960-intel os=-nindy ;; mon960) basic_machine=i960-intel os=-mon960 ;; nonstopux) basic_machine=mips-compaq os=-nonstopux ;; np1) basic_machine=np1-gould ;; nsr-tandem) basic_machine=nsr-tandem ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf ;; openrisc | openrisc-*) basic_machine=or32-unknown ;; os400) basic_machine=powerpc-ibm os=-os400 ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=-ose ;; os68k) basic_machine=m68k-none os=-os68k ;; pa-hitachi) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; paragon) basic_machine=i860-intel os=-osf ;; pbd) basic_machine=sparc-tti ;; pbb) basic_machine=m68k-tti ;; pc532 | pc532-*) basic_machine=ns32k-pc532 ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; pentiumpro | p6 | 6x86 | athlon | athlon_*) basic_machine=i686-pc ;; pentiumii | pentium2 | pentiumiii | pentium3) basic_machine=i686-pc ;; pentium4) basic_machine=i786-pc ;; pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium4-*) basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould ;; power) basic_machine=power-ibm ;; ppc) basic_machine=powerpc-unknown ;; ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle | ppc-le | powerpc-little) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64) basic_machine=powerpc64-unknown ;; ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64le | powerpc64little | ppc64-le | powerpc64-little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm ;; pw32) basic_machine=i586-unknown os=-pw32 ;; rdos) basic_machine=i386-pc os=-rdos ;; rom68k) basic_machine=m68k-rom68k os=-coff ;; rm[46]00) basic_machine=mips-siemens ;; rtpc | rtpc-*) basic_machine=romp-ibm ;; s390 | s390-*) basic_machine=s390-ibm ;; s390x | s390x-*) basic_machine=s390x-ibm ;; sa29200) basic_machine=a29k-amd os=-udi ;; sb1) basic_machine=mipsisa64sb1-unknown ;; sb1el) basic_machine=mipsisa64sb1el-unknown ;; sei) basic_machine=mips-sei os=-seiux ;; sequent) basic_machine=i386-sequent ;; sh) basic_machine=sh-hitachi os=-hms ;; sh64) basic_machine=sh64-unknown ;; sparclite-wrs | simso-wrs) basic_machine=sparclite-wrs os=-vxworks ;; sps7) basic_machine=m68k-bull os=-sysv2 ;; spur) basic_machine=spur-unknown ;; st2000) basic_machine=m68k-tandem ;; stratus) basic_machine=i860-stratus os=-sysv4 ;; sun2) basic_machine=m68000-sun ;; sun2os3) basic_machine=m68000-sun os=-sunos3 ;; sun2os4) basic_machine=m68000-sun os=-sunos4 ;; sun3os3) basic_machine=m68k-sun os=-sunos3 ;; sun3os4) basic_machine=m68k-sun os=-sunos4 ;; sun4os3) basic_machine=sparc-sun os=-sunos3 ;; sun4os4) basic_machine=sparc-sun os=-sunos4 ;; sun4sol2) basic_machine=sparc-sun os=-solaris2 ;; sun3 | sun3-*) basic_machine=m68k-sun ;; sun4) basic_machine=sparc-sun ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; sv1) basic_machine=sv1-cray os=-unicos ;; symmetry) basic_machine=i386-sequent os=-dynix ;; t3e) basic_machine=alphaev5-cray os=-unicos ;; t90) basic_machine=t90-cray os=-unicos ;; tic54x | c54x*) basic_machine=tic54x-unknown os=-coff ;; tic55x | c55x*) basic_machine=tic55x-unknown os=-coff ;; tic6x | c6x*) basic_machine=tic6x-unknown os=-coff ;; tx39) basic_machine=mipstx39-unknown ;; tx39el) basic_machine=mipstx39el-unknown ;; toad1) basic_machine=pdp10-xkl os=-tops20 ;; tower | tower-32) basic_machine=m68k-ncr ;; tpf) basic_machine=s390x-ibm os=-tpf ;; udi29k) basic_machine=a29k-amd os=-udi ;; ultra3) basic_machine=a29k-nyu os=-sym1 ;; v810 | necv810) basic_machine=v810-nec os=-none ;; vaxv) basic_machine=vax-dec os=-sysv ;; vms) basic_machine=vax-dec os=-vms ;; vpp*|vx|vx-*) basic_machine=f301-fujitsu ;; vxworks960) basic_machine=i960-wrs os=-vxworks ;; vxworks68) basic_machine=m68k-wrs os=-vxworks ;; vxworks29k) basic_machine=a29k-wrs os=-vxworks ;; w65*) basic_machine=w65-wdc os=-none ;; w89k-*) basic_machine=hppa1.1-winbond os=-proelf ;; xbox) basic_machine=i686-pc os=-mingw32 ;; xps | xps100) basic_machine=xps100-honeywell ;; ymp) basic_machine=ymp-cray os=-unicos ;; z8k-*-coff) basic_machine=z8k-unknown os=-sim ;; none) basic_machine=none-none os=-none ;; # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. w89k) basic_machine=hppa1.1-winbond ;; op50n) basic_machine=hppa1.1-oki ;; op60c) basic_machine=hppa1.1-oki ;; romp) basic_machine=romp-ibm ;; mmix) basic_machine=mmix-knuth ;; rs6000) basic_machine=rs6000-ibm ;; vax) basic_machine=vax-dec ;; pdp10) # there are many clones, so DEC is not a safe bet basic_machine=pdp10-unknown ;; pdp11) basic_machine=pdp11-dec ;; we32k) basic_machine=we32k-att ;; sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; sparc | sparcv8 | sparcv9 | sparcv9b) basic_machine=sparc-sun ;; cydra) basic_machine=cydra-cydrome ;; orion) basic_machine=orion-highlevel ;; orion105) basic_machine=clipper-highlevel ;; mac | mpw | mac-mpw) basic_machine=m68k-apple ;; pmac | pmac-mpw) basic_machine=powerpc-apple ;; *-unknown) # Make sure to match an already-canonicalized machine name. ;; *) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; esac # Here we canonicalize certain aliases for manufacturers. case $basic_machine in *-digital*) basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` ;; *-commodore*) basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if [ x"$os" != x"" ] then case $os in # First match some system type aliases # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; -solaris) os=-solaris2 ;; -svr4*) os=-sysv4 ;; -unixware*) os=-sysv4.2uw ;; -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; # First accept the basic system types. # The portable systems comes first. # Each alternative MUST END IN A *, to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* | -openbsd* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* \ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ | -skyos* | -haiku* | -rdos*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) case $basic_machine in x86-* | i*86-*) ;; *) os=-nto$os ;; esac ;; -nto-qnx*) ;; -nto*) os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) os=`echo $os | sed -e 's|mac|macos|'` ;; -linux-dietlibc) os=-linux-dietlibc ;; -linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; -sunos5*) os=`echo $os | sed -e 's|sunos5|solaris2|'` ;; -sunos6*) os=`echo $os | sed -e 's|sunos6|solaris3|'` ;; -opened*) os=-openedition ;; -os400*) os=-os400 ;; -wince*) os=-wince ;; -osfrose*) os=-osfrose ;; -osf*) os=-osf ;; -utek*) os=-bsd ;; -dynix*) os=-bsd ;; -acis*) os=-aos ;; -atheos*) os=-atheos ;; -syllable*) os=-syllable ;; -386bsd) os=-bsd ;; -ctix* | -uts*) os=-sysv ;; -nova*) os=-rtmk-nova ;; -ns2 ) os=-nextstep2 ;; -nsk*) os=-nsk ;; # Preserve the version number of sinix5. -sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; -sinix*) os=-sysv4 ;; -tpf*) os=-tpf ;; -triton*) os=-sysv3 ;; -oss*) os=-sysv3 ;; -svr4) os=-sysv4 ;; -svr3) os=-sysv3 ;; -sysvr4) os=-sysv4 ;; # This must come after -sysvr4. -sysv*) ;; -ose*) os=-ose ;; -es1800*) os=-ose ;; -xenix) os=-xenix ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) os=-mint ;; -aros*) os=-aros ;; -kaos*) os=-kaos ;; -zvmoe) os=-zvmoe ;; -none) ;; *) # Get rid of the `-' at the beginning of $os. os=`echo $os | sed 's/[^-]*-//'` echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 exit 1 ;; esac else # Here we handle the default operating systems that come with various machines. # The value should be what the vendor currently ships out the door with their # machine or put another way, the most popular os provided with the machine. # Note that if you're going to try to match "-MANUFACTURER" here (say, # "-sun"), then you have to tell the case statement up towards the top # that MANUFACTURER isn't an operating system. Otherwise, code above # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. case $basic_machine in *-acorn) os=-riscix1.2 ;; arm*-rebel) os=-linux ;; arm*-semi) os=-aout ;; c4x-* | tic4x-*) os=-coff ;; # This must come before the *-dec entry. pdp10-*) os=-tops20 ;; pdp11-*) os=-none ;; *-dec | vax-*) os=-ultrix4.2 ;; m68*-apollo) os=-domain ;; i386-sun) os=-sunos4.0.2 ;; m68000-sun) os=-sunos3 # This also exists in the configure program, but was not the # default. # os=-sunos4 ;; m68*-cisco) os=-aout ;; mips*-cisco) os=-elf ;; mips*-*) os=-elf ;; or32-*) os=-coff ;; *-tti) # must be before sparc entry or we get the wrong os. os=-sysv3 ;; sparc-* | *-sun) os=-sunos4.1.1 ;; *-be) os=-beos ;; *-haiku) os=-haiku ;; *-ibm) os=-aix ;; *-knuth) os=-mmixware ;; *-wec) os=-proelf ;; *-winbond) os=-proelf ;; *-oki) os=-proelf ;; *-hp) os=-hpux ;; *-hitachi) os=-hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) os=-sysv ;; *-cbm) os=-amigaos ;; *-dg) os=-dgux ;; *-dolphin) os=-sysv3 ;; m68k-ccur) os=-rtu ;; m88k-omron*) os=-luna ;; *-next ) os=-nextstep ;; *-sequent) os=-ptx ;; *-crds) os=-unos ;; *-ns) os=-genix ;; i370-*) os=-mvs ;; *-next) os=-nextstep3 ;; *-gould) os=-sysv ;; *-highlevel) os=-bsd ;; *-encore) os=-bsd ;; *-sgi) os=-irix ;; *-siemens) os=-sysv4 ;; *-masscomp) os=-rtu ;; f30[01]-fujitsu | f700-fujitsu) os=-uxpv ;; *-rom68k) os=-coff ;; *-*bug) os=-coff ;; *-apple) os=-macos ;; *-atari*) os=-mint ;; *) os=-none ;; esac fi # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. vendor=unknown case $basic_machine in *-unknown) case $os in -riscix*) vendor=acorn ;; -sunos*) vendor=sun ;; -aix*) vendor=ibm ;; -beos*) vendor=be ;; -hpux*) vendor=hp ;; -mpeix*) vendor=hp ;; -hiux*) vendor=hitachi ;; -unos*) vendor=crds ;; -dgux*) vendor=dg ;; -luna*) vendor=omron ;; -genix*) vendor=ns ;; -mvs* | -opened*) vendor=ibm ;; -os400*) vendor=ibm ;; -ptx*) vendor=sequent ;; -tpf*) vendor=ibm ;; -vxsim* | -vxworks* | -windiss*) vendor=wrs ;; -aux*) vendor=apple ;; -hms*) vendor=hitachi ;; -mpw* | -macos*) vendor=apple ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) vendor=atari ;; -vos*) vendor=stratus ;; esac basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; esac echo $basic_machine$os exit # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: freeradius-server/libltdl/configure000077500000000000000000027320401257552170400200700ustar00rootroot00000000000000#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.59c for libltdl 1.2. # # Report bugs to . # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, # 2002, 2003, 2004, 2005 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 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 elif test -n "${BASH_VERSION+set}${KSH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi BIN_SH=xpg4; export BIN_SH # for Tru64 DUALCASE=1; export DUALCASE # for MKS sh # PATH needs CR # 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 # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # Find who we are. Look in the path if we contain no path at all # relative or not. 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 ;; 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 # FIXME: next line outputs $as_me, which is still unset. { echo "$as_me: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; }; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1; 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 # Name of the executable. as_me=`$as_basename "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)$' \| \ . : '\(.\)' 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } /^X\/\(\/\/\)$/{ s//\1/; q; } /^X\/\(\/\).*/{ s//\1/; q; } s/.*/./; q'` if test "x$CONFIG_SHELL" = x; then if (eval ":") 2>/dev/null; then as_have_required=yes else as_have_required=no fi if test $as_have_required = yes && (eval ": (as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=\$LINENO as_lineno_2=\$LINENO test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } ") 2> /dev/null; then : else as_candidate_shells= as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. case $as_dir in /*) for as_base in sh bash ksh sh5; do as_candidate_shells="$as_candidate_shells $as_dir/$as_base" done esac done for as_shell in $as_candidate_shells $SHELL; do if { ($as_shell) 2> /dev/null <<\_ASEOF # 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 elif test -n "${BASH_VERSION+set}${KSH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi BIN_SH=xpg4; export BIN_SH # for Tru64 DUALCASE=1; export DUALCASE # for MKS sh : _ASEOF }; then CONFIG_SHELL=$as_shell as_have_required=yes if { $as_shell 2> /dev/null <<\_ASEOF # 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 elif test -n "${BASH_VERSION+set}${KSH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi BIN_SH=xpg4; export BIN_SH # for Tru64 DUALCASE=1; export DUALCASE # for MKS sh : (as_func_return () { (exit $1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = "$1" ); then : else exitcode=1 echo positional parameters were not saved. fi test $exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } _ASEOF }; then break fi fi done if test "x$CONFIG_SHELL" != x; then for as_var in BASH_ENV ENV do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done export CONFIG_SHELL exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} fi if test $as_have_required = no; then echo This script requires a shell more modern than all the echo shells that I found on your system. Please install a echo modern shell, or manually run the script under such a echo shell if you do have one. { (exit 1); exit 1; } fi fi fi (eval "as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0") || { echo No shell found that supports shell functions. echo Please tell autoconf@gnu.org about your system, echo including any error possibly output before this echo message } as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, and appends # trailing '-' during substitution so that $LINENO is not a special # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # scripts with optimization help from Paolo Bonzini. 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 || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensible 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 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then # We could just check for DJGPP; but this test a) works b) is more generic # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). if test -f conf$$.exe; then # Don't use ln at all; we don't have any links as_ln_s='cp -p' else as_ln_s='ln -s' fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.file if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi # Find out whether ``test -x'' works. Don't use a zero-byte file, as # systems may use methods other than mode bits to determine executability. cat >conf$$.file <<_ASEOF #! /bin/sh exit 0 _ASEOF chmod +x conf$$.file if test -x conf$$.file >/dev/null 2>&1; then as_executable_p="test -x" else as_executable_p=: fi rm -f conf$$.file # 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'" # IFS # We need space, tab and new line, in precisely that order. as_nl=' ' IFS=" $as_nl" # CDPATH. $as_unset CDPATH # Check that we are running under the correct shell. SHELL=${CONFIG_SHELL-/bin/sh} case X$ECHO in X*--fallback-echo) # Remove one level of quotation (which was required for Make). ECHO=`echo "$ECHO" | sed 's,\\\\\$\\$0,'$0','` ;; esac echo=${ECHO-echo} if test "X$1" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test "X$1" = X--fallback-echo; then # Avoid inline document here, it may be left over : elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then # Yippee, $echo works! : else # Restart under the correct shell. exec $SHELL "$0" --no-reexec ${1+"$@"} fi if test "X$1" = X--fallback-echo; then # used as fallback echo shift cat </dev/null 2>&1 && unset CDPATH if test -z "$ECHO"; then if test "X${echo_test_string+set}" != Xset; then # find a string as large as possible, as long as the shell can cope with it for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... if (echo_test_string=`eval $cmd`) 2>/dev/null && echo_test_string=`eval $cmd` && (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null then break fi done fi if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then : else # The Solaris, AIX, and Digital Unix default echo programs unquote # backslashes. This makes it impossible to quote backslashes using # echo "$something" | sed 's/\\/\\\\/g' # # So, first we look for a working echo in the user's PATH. lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for dir in $PATH /usr/ucb; do IFS="$lt_save_ifs" if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then echo="$dir/echo" break fi done IFS="$lt_save_ifs" if test "X$echo" = Xecho; then # We didn't find a better echo, so look for alternatives. if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then # This shell has a builtin print -r that does the trick. echo='print -r' elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) && test "X$CONFIG_SHELL" != X/bin/ksh; then # If we have ksh, try running configure again with it. ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} export ORIGINAL_CONFIG_SHELL CONFIG_SHELL=/bin/ksh export CONFIG_SHELL exec $CONFIG_SHELL "$0" --no-reexec ${1+"$@"} else # Try using printf. echo='printf %s\n' if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then # Cool, printf works : elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && test "X$echo_testing_string" = 'X\t' && echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL export CONFIG_SHELL SHELL="$CONFIG_SHELL" export SHELL echo="$CONFIG_SHELL $0 --fallback-echo" elif echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && test "X$echo_testing_string" = 'X\t' && echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then echo="$CONFIG_SHELL $0 --fallback-echo" else # maybe with a smaller string... prev=: for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null then break fi prev="$cmd" done if test "$prev" != 'sed 50q "$0"'; then echo_test_string=`eval $prev` export echo_test_string exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "$0" ${1+"$@"} else # Oops. We lost completely, so just stick with echo. echo=echo fi fi fi fi fi fi # Copy echo and quote the copy suitably for passing to libtool from # the Makefile, instead of quoting the original, which is used later. ECHO=$echo if test "X$ECHO" = "X$CONFIG_SHELL $0 --fallback-echo"; then ECHO="$CONFIG_SHELL \\\$\$0 --fallback-echo" fi tagnames=${tagnames+${tagnames},}CXX tagnames=${tagnames+${tagnames},}F77 exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, 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= SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME='libltdl' PACKAGE_TARNAME='libltdl' PACKAGE_VERSION='1.2' PACKAGE_STRING='libltdl 1.2' PACKAGE_BUGREPORT='bug-libtool@gnu.org' ac_unique_file="ltdl.c" # Factoring default headers for most tests. ac_includes_default="\ #include #if HAVE_SYS_TYPES_H # include #endif #if HAVE_SYS_STAT_H # include #endif #if STDC_HEADERS # include # include #else # if HAVE_STDLIB_H # include # endif #endif #if HAVE_STRING_H # if !STDC_HEADERS && HAVE_MEMORY_H # include # endif # include #endif #if HAVE_STRINGS_H # include #endif #if HAVE_INTTYPES_H # include #endif #if HAVE_STDINT_H # include #endif #if HAVE_UNISTD_H # include #endif" ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datarootdir datadir sysconfdir sharedstatedir localstatedir includedir oldincludedir docdir infodir htmldir dvidir pdfdir psdir libdir localedir mandir DEFS ECHO_C ECHO_N ECHO_T LIBS build_alias host_alias target_alias INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE build build_cpu build_vendor build_os host host_cpu host_vendor host_os GREP EGREP LN_S ECHO AR RANLIB DLLTOOL AS OBJDUMP CPP CXX CXXFLAGS ac_ct_CXX CXXDEPMODE am__fastdepCXX_TRUE am__fastdepCXX_FALSE CXXCPP F77 FFLAGS ac_ct_F77 LIBTOOL LIBTOOL_DEPS INSTALL_LTDL_TRUE INSTALL_LTDL_FALSE CONVENIENCE_LTDL_TRUE CONVENIENCE_LTDL_FALSE LIBADD_DL LIBOBJS LTLIBOBJS' ac_subst_files='' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS CPPFLAGS CPP CXX CXXFLAGS CCC CXXCPP F77 FFLAGS' # Initialize some variables set by options. ac_init_help= ac_init_version=false # 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=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_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/-/_/g'` eval enable_$ac_feature=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_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/-/_/g'` eval enable_$ac_feature=\$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_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package| sed 's/-/_/g'` eval with_$ac_package=\$ac_optarg ;; -without-* | --without-*) ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/-/_/g'` eval with_$ac_package=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 ;; -*) { echo "$as_me: error: unrecognized option: $ac_option Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && 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'` { echo "$as_me: error: missing argument to $ac_option" >&2 { (exit 1); exit 1; }; } fi # Be sure to have absolute directory names. 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 case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; } 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 echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || { echo "$as_me: error: Working directory cannot be determined" >&2 { (exit 1); exit 1; }; } test "X$ac_ls_di" = "X$ac_pwd_ls_di" || { echo "$as_me: error: pwd does not report name of working directory" >&2 { (exit 1); exit 1; }; } # 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=`(dirname "$0") 2>/dev/null || $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$0" : 'X\(//\)[^/]' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$0" | 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 .." { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd $srcdir && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2 { (exit 1); exit 1; }; } 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 libltdl 1.2 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/libltdl] --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 libltdl 1.2:";; esac cat <<\_ACEOF Optional Features: --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors --enable-shared[=PKGS] build shared libraries [default=yes] --enable-static[=PKGS] build static libraries [default=yes] --enable-fast-install[=PKGS] optimize for fast installation [default=yes] --disable-libtool-lock avoid locking (might break parallel builds) --enable-ltdl-install install libltdl Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-gnu-ld assume the C compiler uses GNU ld [default=no] --with-pic try to use only PIC/non-PIC objects [default=use both] --with-tags[=TAGS] include additional configurations [automatic] 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 CPPFLAGS C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor CXX C++ compiler command CXXFLAGS C++ compiler flags CXXCPP C++ preprocessor F77 Fortran 77 compiler command FFLAGS Fortran 77 compiler flags 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 || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`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; otherwise get Cygnus style 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 elif test -f $ac_srcdir/configure.ac || test -f $ac_srcdir/configure.in; then echo && $ac_configure --help else 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 libltdl configure 1.2 generated by GNU Autoconf 2.59c Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 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 exec 5>config.log cat >&5 <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by libltdl $as_me 1.2, which was generated by GNU Autoconf 2.59c. Invocation command line was $ $0 $@ _ACEOF { 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=. echo "PATH: $as_dir" done } >&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_sep= 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=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; 2) ac_configure_args1="$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 ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" # Get rid of the leading space. ac_sep=" " ;; esac done done $as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } $as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export 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: Be sure not to use single quotes in there, as some shells, # such as our DU 5.0 friend, will then `close' the trap. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo cat <<\_ASBOX ## ---------------- ## ## Cache variables. ## ## ---------------- ## _ASBOX echo # The following way of writing the cache mishandles newlines in values, { (set) 2>&1 | case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in *ac_space=\ *) sed -n \ "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" ;; *) sed -n \ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; esac; } echo cat <<\_ASBOX ## ----------------- ## ## Output variables. ## ## ----------------- ## _ASBOX echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var echo "$ac_var='"'"'$ac_val'"'"'" done | sort echo if test -n "$ac_subst_files"; then cat <<\_ASBOX ## ------------------- ## ## File substitutions. ## ## ------------------- ## _ASBOX echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var echo "$ac_var='"'"'$ac_val'"'"'" done | sort echo fi if test -s confdefs.h; then cat <<\_ASBOX ## ----------- ## ## confdefs.h. ## ## ----------- ## _ASBOX echo sed "/^$/d" confdefs.h | sort echo fi test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" 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'; { (exit 1); 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 # 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 # Let the site file select an alternate cache file if it wants to. # Prefer explicitly selected file to automatically selected ones. if test -n "$CONFIG_SITE"; then set x "$CONFIG_SITE" elif test "x$prefix" != xNONE; then set x "$prefix/share/config.site" "$prefix/etc/config.site" else set x "$ac_default_prefix/share/config.site" \ "$ac_default_prefix/etc/config.site" fi shift for ac_site_file do if test -r "$ac_site_file"; then { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" 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. if test -f "$cache_file"; then { echo "$as_me:$LINENO: loading cache $cache_file" >&5 echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . $cache_file;; *) . ./$cache_file;; esac fi else { echo "$as_me:$LINENO: creating cache $cache_file" >&5 echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 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 { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 echo "$as_me: former value: $ac_old_val" >&2;} { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 echo "$as_me: current value: $ac_new_val" >&2;} ac_cache_corrupted=: fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *" "*|*" "*|*[\\\[\~\#\$\^\&\*\(\)\{\}\|\;\<\>\?\"\']*|*\]*) ac_arg=$ac_var=`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. *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 echo "$as_me: error: changes in the environment can compromise the build" >&2;} { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} { (exit 1); exit 1; }; } 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 ## ------------------------------- ## ## Libltdl specific configuration. ## ## ------------------------------- ## ac_aux_dir= for ac_dir in . $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 { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in . $srcdir/." >&5 echo "$as_me: error: cannot find install-sh or install.sh in . $srcdir/." >&2;} { (exit 1); exit 1; }; } fi ac_config_guess="$SHELL $ac_aux_dir/config.guess" ac_config_sub="$SHELL $ac_aux_dir/config.sub" ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. if test -z "$enable_ltdl_install$enable_ltdl_convenience"; then if test -f ${srcdir}/ltmain.sh; then # if libltdl is libtoolized, it is assumed to be stand-alone and # installed unless the command line overrides it (tested above) enable_ltdl_install=yes else { echo "$as_me:$LINENO: WARNING: *** The top-level configure must select either" >&5 echo "$as_me: WARNING: *** The top-level configure must select either" >&2;} { echo "$as_me:$LINENO: WARNING: *** A\"\"C_LIBLTDL_INSTALLABLE or A\"\"C_LIBLTDL_CONVENIENCE." >&5 echo "$as_me: WARNING: *** A\"\"C_LIBLTDL_INSTALLABLE or A\"\"C_LIBLTDL_CONVENIENCE." >&2;} { { echo "$as_me:$LINENO: error: *** Maybe you want to --enable-ltdl-install?" >&5 echo "$as_me: error: *** Maybe you want to --enable-ltdl-install?" >&2;} { (exit 1); exit 1; }; } fi fi ## ------------------------ ## ## Automake Initialisation. ## ## ------------------------ ## am__api_version='1.9a' # 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. { echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6; } if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in ./ | .// | /cC/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_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 ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi done done ;; esac done 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 { echo "$as_me:$LINENO: result: $INSTALL" >&5 echo "${ECHO_T}$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' { echo "$as_me:$LINENO: checking whether build environment is sane" >&5 echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6; } # Just in case sleep 1 echo timestamp > conftest.file # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t $srcdir/configure conftest.file` fi rm -f conftest.file if test "$*" != "X $srcdir/configure conftest.file" \ && test "$*" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". { { echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken alias in your environment" >&5 echo "$as_me: error: ls -t appears to fail. Make sure there is not a broken alias in your environment" >&2;} { (exit 1); exit 1; }; } fi test "$2" = conftest.file ) then # Ok. : else { { echo "$as_me:$LINENO: error: newly created file is older than distributed files! Check your system clock" >&5 echo "$as_me: error: newly created file is older than distributed files! Check your system clock" >&2;} { (exit 1); exit 1; }; } fi { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } test "$program_prefix" != NONE && program_transform_name="s&^&$program_prefix&;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s&\$&$program_suffix&;$program_transform_name" # Double any \ or $. echo might interpret backslashes. # By default was `s,x,x', remove it if useless. cat <<\_ACEOF >conftest.sed s/[\\$]/&&/g;s/;s,x,x,$// _ACEOF program_transform_name=`echo $program_transform_name | sed -f conftest.sed` rm -f conftest.sed # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= { echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5 echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} fi if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then # We used to define $(mkdir_p) as `mkdir -p -- .', in order to # allow $(mkdir_p) to be used without argument. As in # $(mkdir_p) $(somedir) # where $(somedir) is conditionally defined. However we don't do # that anymore. # 1. before we restricted the check to GNU mkdir, `mkdir -p .' was # reported to fail in read-only directories. The system where this # happened has been forgotten. # 2. in practice we call $(mkdir_p) on directories such as # $(mkdir_p) "$(DESTDIR)$(somedir)" # and we don't want to create $(DESTDIR) if $(somedir) is empty. # To support the latter case, we have to write # test -z "$(somedir)" || $(mkdir_p) "$(DESTDIR)$(somedir)" # so $(mkdir_p) always has an argument. # We will have better chances of detecting a missing test if # $(mkdir_p) complains about missing arguments. # 3. $(mkdir_p) is named after `mkdir -p' and we don't expect this # to accept no argument. # 4. having something like `mkdir .' in the output is unsightly. mkdir_p='mkdir -p --' else # On NextStep and OpenStep, the `mkdir' command does not # recognize any option. It will interpret all options as # directories to create. for d in ./-p ./--version; do test -d $d && rmdir $d done # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists. if test -f "$ac_aux_dir/mkinstalldirs"; then mkdir_p='$(mkinstalldirs)' else mkdir_p='$(install_sh) -d' fi fi 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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_AWK+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_AWK="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { echo "$as_me:$LINENO: result: $AWK" >&5 echo "${ECHO_T}$AWK" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi test -n "$AWK" && break done { echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6; } set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,:./+-,___p_,'` if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo 'ac_maketemp=X"$(MAKE)"' _ACEOF # GNU make sometimes prints "make[1]: Entering...", which would confuse us. eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=` if test "$ac_maketemp" != X ; then eval ac_cv_prog_make_${ac_make}_set=yes else eval ac_cv_prog_make_${ac_make}_set=no fi rm -f conftest.make fi if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } SET_MAKE= else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 # test to see if srcdir already configured if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5 echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;} { (exit 1); exit 1; }; } 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=libltdl VERSION=1.2 # 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"} install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"} # 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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { echo "$as_me:$LINENO: result: $STRIP" >&5 echo "${ECHO_T}$STRIP" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_STRIP="strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 echo "${ECHO_T}$ac_ct_STRIP" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else if test "$build" != "$host"; then { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} fi STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" # We need awk for the "check" target. The system "awk" is bad on # some platforms. # Always define AMTAR for backward compatibility. AMTAR=${AMTAR-"${am_missing_run}tar"} am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -' ac_config_headers="$ac_config_headers config.h:config-h.in" ## ------------------ ## ## C compiler checks. ## ## ------------------ ## 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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else if test "$build" != "$host"; then { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} fi 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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_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" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done 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 { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else if test "$build" != "$host"; then { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} fi CC=$ac_ct_CC fi fi fi test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&5 echo "$as_me: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } # Provide some information about the compiler. echo "$as_me:$LINENO: checking for C compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (eval echo "$as_me:$LINENO: \"$ac_compiler --version >&5\"") >&5 (eval $ac_compiler --version >&5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -v >&5\"") >&5 (eval $ac_compiler -v >&5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -V >&5\"") >&5 (eval $ac_compiler -V >&5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out 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. { echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6; } ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # # List of possible output files, starting from the most likely. # The algorithm is not robust to junk in `.', hence go to wildcards (a.*) # only as a last resort. b.out is created by i960 compilers. ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out' # # The IRIX 6 linker writes into existing files which may not be # executable, retaining their permissions. Remove them first so a # subsequent execution test works. ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5 (eval $ac_link_default) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # Be careful to initialize this variable, since it used to be cached. # Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile. ac_cv_exeext= 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 | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` # FIXME: I believe we export ac_cv_exeext for Libtool, # but it would be cool to find out if it's true. Does anybody # maintain Libtool? --akim. export ac_cv_exeext break;; * ) break;; esac done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: C compiler cannot create executables See \`config.log' for more details." >&5 echo "$as_me: error: C compiler cannot create executables See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } fi ac_exeext=$ac_cv_exeext { echo "$as_me:$LINENO: result: $ac_file" >&5 echo "${ECHO_T}$ac_file" >&6; } # Check the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { echo "$as_me:$LINENO: checking whether the C compiler works" >&5 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6; } # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then if { ac_try='./$ac_file' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { echo "$as_me:$LINENO: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&5 echo "$as_me: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi fi fi { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } rm -f a.out a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save # Check the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; } { echo "$as_me:$LINENO: result: $cross_compiling" >&5 echo "${ECHO_T}$cross_compiling" >&6; } { echo "$as_me:$LINENO: checking for suffix of executables" >&5 echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; } if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; 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 | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` export ac_cv_exeext break;; * ) break;; esac done else { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest$ac_cv_exeext { echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 echo "${ECHO_T}$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT { echo "$as_me:$LINENO: checking for suffix of object files" >&5 echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; } if test "${ac_cv_objext+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then 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 ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 echo "${ECHO_T}$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; } if test "${ac_cv_c_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; } GCC=`test $ac_compiler_gnu = yes && echo yes` ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CFLAGS="" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 echo "${ECHO_T}$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 { echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_c89+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; 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" rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cc_c89=$ac_arg else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f 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) { echo "$as_me:$LINENO: result: none needed" >&5 echo "${ECHO_T}none needed" >&6; } ;; xno) { echo "$as_me:$LINENO: result: unsupported" >&5 echo "${ECHO_T}unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;; esac # Some people use a C++ compiler to compile C. Since we use `exit', # in C++ we need to declare it. In case someone uses the same compiler # for both compiling C and C++ we need to have the C++ compiler decide # the declaration of exit, since it's the most demanding environment. cat >conftest.$ac_ext <<_ACEOF #ifndef __cplusplus choke me #endif _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then for ac_declaration in \ '' \ 'extern "C" void std::exit (int) throw (); using std::exit;' \ 'extern "C" void std::exit (int); using std::exit;' \ 'extern "C" void exit (int) throw ();' \ 'extern "C" void exit (int);' \ 'void exit (int);' do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_declaration #include int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 continue fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_declaration int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done rm -f conftest* if test -n "$ac_declaration"; then echo '#ifdef __cplusplus' >>confdefs.h echo $ac_declaration >>confdefs.h echo '#endif' >>confdefs.h fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext 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 DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo done .PHONY: am__doit END # If we don't find an include directive, just comment out the code. { echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5 echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&6; } am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # We grep out `Entering directory' and `Leaving directory' # messages which can occur if `w' ends up in MAKEFLAGS. # In particular we don't look at `^make:' because GNU make might # be invoked under some other name (usually "gmake"), in which # case it prints its new name instead of `make'. if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then am__include=include am__quote= _am_result=GNU fi # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then am__include=.include am__quote="\"" _am_result=BSD fi fi { echo "$as_me:$LINENO: result: $_am_result" >&5 echo "${ECHO_T}$_am_result" >&6; } rm -f confinc confmf # Check whether --enable-dependency-tracking was given. if test "${enable_dependency_tracking+set}" = set; then enableval=$enable_dependency_tracking; fi if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else AMDEP_TRUE='#' AMDEP_FALSE= fi depcc="$CC" am_compiler_list= { echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6; } if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf case $depmode in 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 ;; none) break ;; esac # 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. if depmode=$depmode \ source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftest.${OBJEXT-o} 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 { echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5 echo "${ECHO_T}$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 { echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5 echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6; } if test "${ac_cv_c_const+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { /* FIXME: Include the comments suggested by Paul. */ #ifndef __cplusplus /* Ultrix mips cc rejects this. */ typedef int charset[2]; const charset x; /* SunOS 4.1.1 cc rejects this. */ char const *const *ccp; char **p; /* NEC SVR4.0.2 mips cc rejects this. */ struct point {int x, y;}; static struct point const zero = {0,0}; /* AIX XL C 1.02.0.0 rejects this. It does not let you subtract one const X* pointer from another in an arm of an if-expression whose if-part is not a constant expression */ const char *g = "string"; ccp = &g + (g ? g-g : 0); /* HPUX 7.0 cc rejects these. */ ++ccp; p = (char**) ccp; ccp = (char const *const *) p; { /* SCO 3.2v4 cc rejects this. */ char *t; char const *s = 0 ? (char *) 0 : (char const *) 0; *t++ = 0; } { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ int x[] = {25, 17}; const int *foo = &x[0]; ++foo; } { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ typedef const int *iptr; iptr p = 0; ++p; } { /* AIX XL C 1.02.0.0 rejects this saying "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ struct s { int j; const int *ap[3]; }; struct s *b; b->j = 5; } { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ const int foo = 10; } #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_c_const=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_c_const=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5 echo "${ECHO_T}$ac_cv_c_const" >&6; } if test $ac_cv_c_const = no; then cat >>confdefs.h <<\_ACEOF #define const _ACEOF fi { echo "$as_me:$LINENO: checking for inline" >&5 echo $ECHO_N "checking for inline... $ECHO_C" >&6; } if test "${ac_cv_c_inline+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifndef __cplusplus typedef int foo_t; static $ac_kw foo_t static_foo () {return 0; } $ac_kw foo_t foo () {return 0; } #endif _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_c_inline=$ac_kw; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done fi { echo "$as_me:$LINENO: result: $ac_cv_c_inline" >&5 echo "${ECHO_T}$ac_cv_c_inline" >&6; } case $ac_cv_c_inline in inline | yes) ;; *) case $ac_cv_c_inline in no) ac_val=;; *) ac_val=$ac_cv_c_inline;; esac cat >>confdefs.h <<_ACEOF #ifndef __cplusplus #define inline $ac_val #endif _ACEOF ;; esac ## ----------------------- ## ## Libtool initialisation. ## ## ----------------------- ## # Check whether --enable-shared was given. if test "${enable_shared+set}" = set; then enableval=$enable_shared; p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS="$lt_save_ifs" ;; esac else enable_shared=yes fi # Check whether --enable-static was given. if test "${enable_static+set}" = set; then enableval=$enable_static; p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS="$lt_save_ifs" ;; esac else enable_static=yes fi # Check whether --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 # Make sure we can run config.sub. $ac_config_sub sun4 >/dev/null 2>&1 || { { echo "$as_me:$LINENO: error: cannot run $ac_config_sub" >&5 echo "$as_me: error: cannot run $ac_config_sub" >&2;} { (exit 1); exit 1; }; } { echo "$as_me:$LINENO: checking build system type" >&5 echo $ECHO_N "checking build system type... $ECHO_C" >&6; } if test "${ac_cv_build+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_build_alias=$build_alias test "x$ac_build_alias" = x && ac_build_alias=`$ac_config_guess` test "x$ac_build_alias" = x && { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 echo "$as_me: error: cannot guess build type; you must specify one" >&2;} { (exit 1); exit 1; }; } ac_cv_build=`$ac_config_sub $ac_build_alias` || { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_build_alias failed" >&5 echo "$as_me: error: $ac_config_sub $ac_build_alias failed" >&2;} { (exit 1); exit 1; }; } fi { echo "$as_me:$LINENO: result: $ac_cv_build" >&5 echo "${ECHO_T}$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; *) { { echo "$as_me:$LINENO: error: invalid value of canonical build" >&5 echo "$as_me: error: invalid value of canonical build" >&2;} { (exit 1); exit 1; }; };; esac build=$ac_cv_build ac_save_IFS=$IFS; IFS='-' set x $ac_cv_build shift build_cpu=$1 build_vendor=$2 shift; shift build_os=$* IFS=$ac_save_IFS { echo "$as_me:$LINENO: checking host system type" >&5 echo $ECHO_N "checking host system type... $ECHO_C" >&6; } if test "${ac_cv_host+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else ac_cv_host=`$ac_config_sub $host_alias` || { { echo "$as_me:$LINENO: error: $ac_config_sub $host_alias failed" >&5 echo "$as_me: error: $ac_config_sub $host_alias failed" >&2;} { (exit 1); exit 1; }; } fi fi { echo "$as_me:$LINENO: result: $ac_cv_host" >&5 echo "${ECHO_T}$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; *) { { echo "$as_me:$LINENO: error: invalid value of canonical host" >&5 echo "$as_me: error: invalid value of canonical host" >&2;} { (exit 1); exit 1; }; };; esac host=$ac_cv_host ac_save_IFS=$IFS; IFS='-' set x $ac_cv_host shift host_cpu=$1 host_vendor=$2 shift; shift host_os=$* IFS=$ac_save_IFS { echo "$as_me:$LINENO: checking for a sed that does not truncate output" >&5 echo $ECHO_N "checking for a sed that does not truncate output... $ECHO_C" >&6; } if test "${lt_cv_path_SED+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # 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 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 fi SED=$lt_cv_path_SED { echo "$as_me:$LINENO: result: $SED" >&5 echo "${ECHO_T}$SED" >&6; } { echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5 echo $ECHO_N "checking for grep that handles long lines and -e... $ECHO_C" >&6; } if test "${ac_cv_path_GREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Extract the first word of "grep ggrep" to use in msg output if test -z "$GREP"; then set dummy grep ggrep; ac_prog_name=$2 if test "${ac_cv_path_GREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else 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 as_dummy="$PATH:/usr/xpg4/bin" for as_dir in $as_dummy do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_GREP" && $as_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 echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" 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 ac_count=`expr $ac_count + 1` 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.*;; esac $ac_path_GREP_found && break 3 done done done fi GREP="$ac_cv_path_GREP" if test -z "$GREP"; then { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH:/usr/xpg4/bin" >&5 echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH:/usr/xpg4/bin" >&2;} { (exit 1); exit 1; }; } fi else ac_cv_path_GREP=$GREP fi fi { echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5 echo "${ECHO_T}$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { echo "$as_me:$LINENO: checking for egrep" >&5 echo $ECHO_N "checking for egrep... $ECHO_C" >&6; } if test "${ac_cv_path_EGREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else # Extract the first word of "egrep" to use in msg output if test -z "$EGREP"; then set dummy egrep; ac_prog_name=$2 if test "${ac_cv_path_EGREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else 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 as_dummy="$PATH:/usr/xpg4/bin" for as_dir in $as_dummy do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_EGREP" && $as_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 echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" 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 ac_count=`expr $ac_count + 1` 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.*;; esac $ac_path_EGREP_found && break 3 done done done fi EGREP="$ac_cv_path_EGREP" if test -z "$EGREP"; then { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH:/usr/xpg4/bin" >&5 echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH:/usr/xpg4/bin" >&2;} { (exit 1); exit 1; }; } fi else ac_cv_path_EGREP=$EGREP fi fi fi { echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 echo "${ECHO_T}$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" # 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. { echo "$as_me:$LINENO: checking for ld used by $CC" >&5 echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&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 { echo "$as_me:$LINENO: checking for GNU ld" >&5 echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6; } else { echo "$as_me:$LINENO: checking for non-GNU ld" >&5 echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6; } fi if test "${lt_cv_path_LD+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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 echo "${ECHO_T}$LD" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5 echo "$as_me: error: no acceptable ld found in \$PATH" >&2;} { (exit 1); exit 1; }; } { echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6; } if test "${lt_cv_prog_gnu_ld+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &5 echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6; } with_gnu_ld=$lt_cv_prog_gnu_ld { echo "$as_me:$LINENO: checking for $LD option to reload object files" >&5 echo $ECHO_N "checking for $LD option to reload object files... $ECHO_C" >&6; } if test "${lt_cv_ld_reload_flag+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_ld_reload_flag='-r' fi { echo "$as_me:$LINENO: result: $lt_cv_ld_reload_flag" >&5 echo "${ECHO_T}$lt_cv_ld_reload_flag" >&6; } reload_flag=$lt_cv_ld_reload_flag case $reload_flag in "" | " "*) ;; *) reload_flag=" $reload_flag" ;; esac reload_cmds='$LD$reload_flag -o $output$reload_objs' case $host_os in darwin*) if test "$GCC" = yes; then reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' else reload_cmds='$LD$reload_flag -o $output$reload_objs' fi ;; esac { echo "$as_me:$LINENO: checking for BSD-compatible nm" >&5 echo $ECHO_N "checking for BSD-compatible nm... $ECHO_C" >&6; } if test "${lt_cv_path_NM+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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 test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm fi fi { echo "$as_me:$LINENO: result: $lt_cv_path_NM" >&5 echo "${ECHO_T}$lt_cv_path_NM" >&6; } NM="$lt_cv_path_NM" { echo "$as_me:$LINENO: checking whether ln -s works" >&5 echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6; } LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } else { echo "$as_me:$LINENO: result: no, using $LN_S" >&5 echo "${ECHO_T}no, using $LN_S" >&6; } fi { echo "$as_me:$LINENO: checking how to recognise dependent libraries" >&5 echo $ECHO_N "checking how to recognise dependent libraries... $ECHO_C" >&6; } if test "${lt_cv_deplibs_check_method+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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 aix4* | aix5*) 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'. lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | kfreebsd*-gnu | dragonfly*) if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; gnu*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]' lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix3*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be Linux ELF. linux*) 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=unknown ;; 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 ;; solaris*) 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 ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; esac fi { echo "$as_me:$LINENO: result: $lt_cv_deplibs_check_method" >&5 echo "${ECHO_T}$lt_cv_deplibs_check_method" >&6; } file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown # If 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 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:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then case `/usr/bin/file conftest.$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 4543 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then 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-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then case `/usr/bin/file conftest.o` in *32-bit*) case $host in 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-*linux*) LD="${LD-ld} -m elf_x86_64" ;; ppc*-*linux*|powerpc*-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*) 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" { echo "$as_me:$LINENO: checking whether the C compiler needs -belf" >&5 echo $ECHO_N "checking whether the C compiler needs -belf... $ECHO_C" >&6; } if test "${lt_cv_cc_needs_belf+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then lt_cv_cc_needs_belf=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 lt_cv_cc_needs_belf=no fi rm -f 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 { echo "$as_me:$LINENO: result: $lt_cv_cc_needs_belf" >&5 echo "${ECHO_T}$lt_cv_cc_needs_belf" >&6; } if test x"$lt_cv_cc_needs_belf" != x"yes"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS="$SAVE_CFLAGS" fi ;; sparc*-*solaris*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) LD="${LD-ld} -m elf64_sparc" ;; *) LD="${LD-ld} -64" ;; esac ;; esac fi rm -rf conftest* ;; *-*-cygwin* | *-*-mingw* | *-*-pw32*) 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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_DLLTOOL+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi DLLTOOL=$ac_cv_prog_DLLTOOL if test -n "$DLLTOOL"; then { echo "$as_me:$LINENO: result: $DLLTOOL" >&5 echo "${ECHO_T}$DLLTOOL" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_DLLTOOL+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_DLLTOOL="dlltool" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL if test -n "$ac_ct_DLLTOOL"; then { echo "$as_me:$LINENO: result: $ac_ct_DLLTOOL" >&5 echo "${ECHO_T}$ac_ct_DLLTOOL" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_DLLTOOL" = x; then DLLTOOL="false" else if test "$build" != "$host"; then { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} fi DLLTOOL=$ac_ct_DLLTOOL fi else DLLTOOL="$ac_cv_prog_DLLTOOL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args. set dummy ${ac_tool_prefix}as; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_AS+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$AS"; then ac_cv_prog_AS="$AS" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_AS="${ac_tool_prefix}as" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi AS=$ac_cv_prog_AS if test -n "$AS"; then { echo "$as_me:$LINENO: result: $AS" >&5 echo "${ECHO_T}$AS" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi if test -z "$ac_cv_prog_AS"; then ac_ct_AS=$AS # Extract the first word of "as", so it can be a program name with args. set dummy as; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_AS+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_AS"; then ac_cv_prog_ac_ct_AS="$ac_ct_AS" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_AS="as" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_AS=$ac_cv_prog_ac_ct_AS if test -n "$ac_ct_AS"; then { echo "$as_me:$LINENO: result: $ac_ct_AS" >&5 echo "${ECHO_T}$ac_ct_AS" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_AS" = x; then AS="false" else if test "$build" != "$host"; then { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} fi AS=$ac_ct_AS fi else AS="$ac_cv_prog_AS" fi 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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_OBJDUMP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$OBJDUMP"; then ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi OBJDUMP=$ac_cv_prog_OBJDUMP if test -n "$OBJDUMP"; then { echo "$as_me:$LINENO: result: $OBJDUMP" >&5 echo "${ECHO_T}$OBJDUMP" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_OBJDUMP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_OBJDUMP"; then ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_OBJDUMP="objdump" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP if test -n "$ac_ct_OBJDUMP"; then { echo "$as_me:$LINENO: result: $ac_ct_OBJDUMP" >&5 echo "${ECHO_T}$ac_ct_OBJDUMP" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_OBJDUMP" = x; then OBJDUMP="false" else if test "$build" != "$host"; then { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} fi OBJDUMP=$ac_ct_OBJDUMP fi else OBJDUMP="$ac_cv_prog_OBJDUMP" fi ;; esac need_locks="$enable_libtool_lock" 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 { echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if test "${ac_cv_prog_CPP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f 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 { echo "$as_me:$LINENO: result: $CPP" >&5 echo "${ECHO_T}$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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&5 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } 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 { echo "$as_me:$LINENO: checking for ANSI C header files" >&5 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; } if test "${ac_cv_header_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_header_stdc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_stdc=no fi rm -f 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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* 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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* 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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* 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)) exit (2); exit (0); } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi { echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 echo "${ECHO_T}$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then cat >>confdefs.h <<\_ACEOF #define STDC_HEADERS 1 _ACEOF 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=`echo "ac_cv_header_$ac_header" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Header=no" fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in dlfcn.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? { echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ---------------------------------- ## ## Report this to bug-libtool@gnu.org ## ## ---------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu if test -z "$CXX"; then if test -n "$CCC"; then CXX=$CCC else if test -n "$ac_tool_prefix"; then for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC 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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CXX"; then ac_cv_prog_CXX="$CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CXX=$ac_cv_prog_CXX if test -n "$CXX"; then { echo "$as_me:$LINENO: result: $CXX" >&5 echo "${ECHO_T}$CXX" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi test -n "$CXX" && break done fi if test -z "$CXX"; then ac_ct_CXX=$CXX for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CXX"; then ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CXX="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CXX=$ac_cv_prog_ac_ct_CXX if test -n "$ac_ct_CXX"; then { echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5 echo "${ECHO_T}$ac_ct_CXX" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi test -n "$ac_ct_CXX" && break done if test "x$ac_ct_CXX" = x; then CXX="g++" else if test "$build" != "$host"; then { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} fi CXX=$ac_ct_CXX fi fi fi fi # Provide some information about the compiler. echo "$as_me:$LINENO: checking for C++ compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (eval echo "$as_me:$LINENO: \"$ac_compiler --version >&5\"") >&5 (eval $ac_compiler --version >&5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -v >&5\"") >&5 (eval $ac_compiler -v >&5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -V >&5\"") >&5 (eval $ac_compiler -V >&5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { echo "$as_me:$LINENO: checking whether we are using the GNU C++ compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C++ compiler... $ECHO_C" >&6; } if test "${ac_cv_cxx_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_cxx_compiler_gnu=$ac_compiler_gnu fi { echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_cxx_compiler_gnu" >&6; } GXX=`test $ac_compiler_gnu = yes && echo yes` ac_test_CXXFLAGS=${CXXFLAGS+set} ac_save_CXXFLAGS=$CXXFLAGS { echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5 echo $ECHO_N "checking whether $CXX accepts -g... $ECHO_C" >&6; } if test "${ac_cv_prog_cxx_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_save_cxx_werror_flag=$ac_cxx_werror_flag ac_cxx_werror_flag=yes ac_cv_prog_cxx_g=no CXXFLAGS="-g" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cxx_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CXXFLAGS="" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cxx_werror_flag=$ac_save_cxx_werror_flag CXXFLAGS="-g" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cxx_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_cxx_werror_flag=$ac_save_cxx_werror_flag fi { echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5 echo "${ECHO_T}$ac_cv_prog_cxx_g" >&6; } if test "$ac_test_CXXFLAGS" = set; then CXXFLAGS=$ac_save_CXXFLAGS elif test $ac_cv_prog_cxx_g = yes; then if test "$GXX" = yes; then CXXFLAGS="-g -O2" else CXXFLAGS="-g" fi else if test "$GXX" = yes; then CXXFLAGS="-O2" else CXXFLAGS= fi fi for ac_declaration in \ '' \ 'extern "C" void std::exit (int) throw (); using std::exit;' \ 'extern "C" void std::exit (int); using std::exit;' \ 'extern "C" void exit (int) throw ();' \ 'extern "C" void exit (int);' \ 'void exit (int);' do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_declaration #include int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 continue fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_declaration int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done rm -f conftest* if test -n "$ac_declaration"; then echo '#ifdef __cplusplus' >>confdefs.h echo $ac_declaration >>confdefs.h echo '#endif' >>confdefs.h fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu depcc="$CXX" am_compiler_list= { echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6; } if test "${am_cv_CXX_dependencies_compiler_type+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CXX_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf case $depmode in 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 ;; none) break ;; esac # 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. if depmode=$depmode \ source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftest.${OBJEXT-o} 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_CXX_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CXX_dependencies_compiler_type=none fi fi { echo "$as_me:$LINENO: result: $am_cv_CXX_dependencies_compiler_type" >&5 echo "${ECHO_T}$am_cv_CXX_dependencies_compiler_type" >&6; } CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then am__fastdepCXX_TRUE= am__fastdepCXX_FALSE='#' else am__fastdepCXX_TRUE='#' am__fastdepCXX_FALSE= fi if test -n "$CXX" && ( test "X$CXX" != "Xno" && ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || (test "X$CXX" != "Xg++"))) ; then ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu { echo "$as_me:$LINENO: checking how to run the C++ preprocessor" >&5 echo $ECHO_N "checking how to run the C++ preprocessor... $ECHO_C" >&6; } if test -z "$CXXCPP"; then if test "${ac_cv_prog_CXXCPP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Double quotes because CXXCPP needs to be expanded for CXXCPP in "$CXX -E" "/lib/cpp" do ac_preproc_ok=false for ac_cxx_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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_cxx_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_cxx_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then break fi done ac_cv_prog_CXXCPP=$CXXCPP fi CXXCPP=$ac_cv_prog_CXXCPP else ac_cv_prog_CXXCPP=$CXXCPP fi { echo "$as_me:$LINENO: result: $CXXCPP" >&5 echo "${ECHO_T}$CXXCPP" >&6; } ac_preproc_ok=false for ac_cxx_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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_cxx_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_cxx_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { echo "$as_me:$LINENO: error: C++ preprocessor \"$CXXCPP\" fails sanity check See \`config.log' for more details." >&5 echo "$as_me: error: C++ preprocessor \"$CXXCPP\" fails sanity check See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu fi ac_ext=f ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5' ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_f77_compiler_gnu if test -n "$ac_tool_prefix"; then for ac_prog in g77 f77 xlf frt pgf77 cf77 fort77 fl32 af77 f90 xlf90 pgf90 pghpf epcf90 gfortran g95 f95 fort xlf95 ifort ifc efc pgf95 lf95 ftn 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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_F77+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$F77"; then ac_cv_prog_F77="$F77" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_F77="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi F77=$ac_cv_prog_F77 if test -n "$F77"; then { echo "$as_me:$LINENO: result: $F77" >&5 echo "${ECHO_T}$F77" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi test -n "$F77" && break done fi if test -z "$F77"; then ac_ct_F77=$F77 for ac_prog in g77 f77 xlf frt pgf77 cf77 fort77 fl32 af77 f90 xlf90 pgf90 pghpf epcf90 gfortran g95 f95 fort xlf95 ifort ifc efc pgf95 lf95 ftn do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_F77+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_F77"; then ac_cv_prog_ac_ct_F77="$ac_ct_F77" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_F77="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_F77=$ac_cv_prog_ac_ct_F77 if test -n "$ac_ct_F77"; then { echo "$as_me:$LINENO: result: $ac_ct_F77" >&5 echo "${ECHO_T}$ac_ct_F77" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi test -n "$ac_ct_F77" && break done if test "x$ac_ct_F77" = x; then F77="" else if test "$build" != "$host"; then { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} fi F77=$ac_ct_F77 fi fi # Provide some information about the compiler. echo "$as_me:$LINENO: checking for Fortran 77 compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (eval echo "$as_me:$LINENO: \"$ac_compiler --version >&5\"") >&5 (eval $ac_compiler --version >&5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -v >&5\"") >&5 (eval $ac_compiler -v >&5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -V >&5\"") >&5 (eval $ac_compiler -V >&5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } rm -f a.out # If we don't use `.F' as extension, the preprocessor is not run on the # input file. (Note that this only needs to work for GNU compilers.) ac_save_ext=$ac_ext ac_ext=F { echo "$as_me:$LINENO: checking whether we are using the GNU Fortran 77 compiler" >&5 echo $ECHO_N "checking whether we are using the GNU Fortran 77 compiler... $ECHO_C" >&6; } if test "${ac_cv_f77_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF program main #ifndef __GNUC__ choke me #endif end _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_f77_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_f77_compiler_gnu=$ac_compiler_gnu fi { echo "$as_me:$LINENO: result: $ac_cv_f77_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_f77_compiler_gnu" >&6; } ac_ext=$ac_save_ext ac_test_FFLAGS=${FFLAGS+set} ac_save_FFLAGS=$FFLAGS FFLAGS= { echo "$as_me:$LINENO: checking whether $F77 accepts -g" >&5 echo $ECHO_N "checking whether $F77 accepts -g... $ECHO_C" >&6; } if test "${ac_cv_prog_f77_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else FFLAGS=-g cat >conftest.$ac_ext <<_ACEOF program main end _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_f77_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_f77_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_prog_f77_g=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_prog_f77_g" >&5 echo "${ECHO_T}$ac_cv_prog_f77_g" >&6; } if test "$ac_test_FFLAGS" = set; then FFLAGS=$ac_save_FFLAGS elif test $ac_cv_prog_f77_g = yes; then if test "x$ac_cv_f77_compiler_gnu" = xyes; then FFLAGS="-g -O2" else FFLAGS="-g" fi else if test "x$ac_cv_f77_compiler_gnu" = xyes; then FFLAGS="-O2" else FFLAGS= fi fi G77=`test $ac_compiler_gnu = yes && echo yes` 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 # Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers! # find the maximum length of command line arguments { echo "$as_me:$LINENO: checking the maximum length of command line arguments" >&5 echo $ECHO_N "checking the maximum length of command line arguments... $ECHO_C" >&6; } if test "${lt_cv_sys_max_cmd_len+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) # 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. SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} while (test "X"`$SHELL $0 --fallback-echo "X$teststring" 2>/dev/null` \ = "XX$teststring") >/dev/null 2>&1 && new_result=`expr "X$teststring" : ".*" 2>&1` && lt_cv_sys_max_cmd_len=$new_result && test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done 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` ;; esac fi if test -n $lt_cv_sys_max_cmd_len ; then { echo "$as_me:$LINENO: result: $lt_cv_sys_max_cmd_len" >&5 echo "${ECHO_T}$lt_cv_sys_max_cmd_len" >&6; } else { echo "$as_me:$LINENO: result: none" >&5 echo "${ECHO_T}none" >&6; } fi # Check for command to grab the raw symbol name followed by C symbol from nm. { echo "$as_me:$LINENO: checking command to parse $NM output from $compiler object" >&5 echo $ECHO_N "checking command to parse $NM output from $compiler object... $ECHO_C" >&6; } if test "${lt_cv_sys_global_symbol_pipe+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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]*\)' # Transform an extracted symbol line into a proper C declaration lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \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\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" # Define system-specific variables. case $host_os in aix*) symcode='[BCDT]' ;; cygwin* | mingw* | pw32*) symcode='[ABCDGISTW]' ;; hpux*) # Its linker distinguishes data from code symbols if test "$host_cpu" = ia64; then symcode='[ABCDEGRST]' fi lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" ;; linux*) if test "$host_cpu" = ia64; then symcode='[ABCDGIRSTW]' lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" 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 # 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 # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[ABCDGIRSTW]' ;; esac # Try without a prefix undercore, 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. lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # Now try to grab the symbols. nlist=conftest.nm if { (eval echo "$as_me:$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=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && 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 < conftest.$ac_ext #ifdef __cplusplus extern "C" { #endif EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext' cat <> conftest.$ac_ext #if defined (__STDC__) && __STDC__ # define lt_ptr_t void * #else # define lt_ptr_t char * # define const #endif /* The mapping between symbol names and symbols. */ const struct { const char *name; lt_ptr_t address; } lt_preloaded_symbols[] = { EOF $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext cat <<\EOF >> conftest.$ac_ext {0, (lt_ptr_t) 0} }; #ifdef __cplusplus } #endif EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_save_LIBS="$LIBS" lt_save_CFLAGS="$CFLAGS" LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s conftest${ac_exeext}; then pipe_works=yes fi LIBS="$lt_save_LIBS" CFLAGS="$lt_save_CFLAGS" else echo "cannot find nm_test_func in $nlist" >&5 fi else echo "cannot find nm_test_var in $nlist" >&5 fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 fi else echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -f 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 { echo "$as_me:$LINENO: result: failed" >&5 echo "${ECHO_T}failed" >&6; } else { echo "$as_me:$LINENO: result: ok" >&5 echo "${ECHO_T}ok" >&6; } fi { echo "$as_me:$LINENO: checking for objdir" >&5 echo $ECHO_N "checking for objdir... $ECHO_C" >&6; } if test "${lt_cv_objdir+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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 { echo "$as_me:$LINENO: result: $lt_cv_objdir" >&5 echo "${ECHO_T}$lt_cv_objdir" >&6; } objdir=$lt_cv_objdir case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. 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 to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' # Constants: rm="rm -f" # Global variables: default_ofile=libtool can_build_shared=yes # All known linkers require a `.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a ltmain="$ac_aux_dir/ltmain.sh" ofile="$default_ofile" with_gnu_ld="$lt_cv_prog_gnu_ld" if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. set dummy ${ac_tool_prefix}ar; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_AR+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$AR"; then ac_cv_prog_AR="$AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_AR="${ac_tool_prefix}ar" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi AR=$ac_cv_prog_AR if test -n "$AR"; then { echo "$as_me:$LINENO: result: $AR" >&5 echo "${ECHO_T}$AR" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi if test -z "$ac_cv_prog_AR"; then ac_ct_AR=$AR # Extract the first word of "ar", so it can be a program name with args. set dummy ar; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_AR+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_AR"; then ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_AR="ar" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then { echo "$as_me:$LINENO: result: $ac_ct_AR" >&5 echo "${ECHO_T}$ac_ct_AR" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_AR" = x; then AR="false" else if test "$build" != "$host"; then { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} fi AR=$ac_ct_AR fi else AR="$ac_cv_prog_AR" fi 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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_RANLIB+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then { echo "$as_me:$LINENO: result: $RANLIB" >&5 echo "${ECHO_T}$RANLIB" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_RANLIB="ranlib" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then { echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 echo "${ECHO_T}$ac_ct_RANLIB" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_RANLIB" = x; then RANLIB=":" else if test "$build" != "$host"; then { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} fi RANLIB=$ac_ct_RANLIB fi else RANLIB="$ac_cv_prog_RANLIB" 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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { echo "$as_me:$LINENO: result: $STRIP" >&5 echo "${ECHO_T}$STRIP" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_STRIP="strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 echo "${ECHO_T}$ac_ct_STRIP" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else if test "$build" != "$host"; then { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} fi STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi old_CC="$CC" old_CFLAGS="$CFLAGS" # Set sane defaults for various variables test -z "$AR" && AR=ar test -z "$AR_FLAGS" && AR_FLAGS=cru test -z "$AS" && AS=as test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$DLLTOOL" && DLLTOOL=dlltool test -z "$LD" && LD=ld test -z "$LN_S" && LN_S="ln -s" test -z "$MAGIC_CMD" && MAGIC_CMD=file test -z "$NM" && NM=nm test -z "$SED" && SED=sed test -z "$OBJDUMP" && OBJDUMP=objdump test -z "$RANLIB" && RANLIB=: test -z "$STRIP" && STRIP=: test -z "$ac_objext" && ac_objext=o # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" fi for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` # Only perform the check for file, if the check method requires it case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then { echo "$as_me:$LINENO: checking for ${ac_tool_prefix}file" >&5 echo $ECHO_N "checking for ${ac_tool_prefix}file... $ECHO_C" >&6; } if test "${lt_cv_path_MAGIC_CMD+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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 <&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 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 { echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 echo "${ECHO_T}$MAGIC_CMD" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then { echo "$as_me:$LINENO: checking for file" >&5 echo $ECHO_N "checking for file... $ECHO_C" >&6; } if test "${lt_cv_path_MAGIC_CMD+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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 <&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 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 { echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 echo "${ECHO_T}$MAGIC_CMD" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi else MAGIC_CMD=: fi fi fi ;; esac enable_dlopen=no enable_win32_dll=yes # 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 # Check whether --with-pic was given. if test "${with_pic+set}" = set; then withval=$with_pic; pic_mode="$withval" else pic_mode=default fi test -z "$pic_mode" && pic_mode=default # Use C for the default configuration in the libtool script tagname= 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;\n" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}\n' # 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 warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $rm conftest* ac_outfile=conftest.$ac_objext printf "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $rm 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... lt_prog_compiler_no_builtin_flag= if test "$GCC" = yes; then lt_prog_compiler_no_builtin_flag=' -fno-builtin' { echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6; } if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_rtti_exceptions=no ac_outfile=conftest.$ac_objext printf "$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:7676: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:7680: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_rtti_exceptions=yes fi fi $rm conftest* fi { echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 echo "${ECHO_T}$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= { echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; } if test "$GCC" = yes; then lt_prog_compiler_wl='-Wl,' lt_prog_compiler_static='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' fi ;; amigaos*) # 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' ;; beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | pw32* | os2*) # 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' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic='-fno-common' ;; interix3*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. lt_prog_compiler_can_build_shared=no enable_shared=no ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic=-Kconform_pic fi ;; hpux*) # 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='-fPIC' ;; esac ;; *) lt_prog_compiler_pic='-fPIC' ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) lt_prog_compiler_wl='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' else lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' fi ;; darwin*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files case $cc_basename in xlc*) lt_prog_compiler_pic='-qnocommon' lt_prog_compiler_wl='-Wl,' ;; esac ;; mingw* | pw32* | os2*) # 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' ;; newsos6) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; linux*) case $cc_basename in icc* | ecc*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-static' ;; pgcc* | pgf77* | pgf90* | pgf95*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; ccc*) lt_prog_compiler_wl='-Wl,' # All Alpha code is PIC. lt_prog_compiler_static='-non_shared' ;; esac ;; osf3* | osf4* | osf5*) lt_prog_compiler_wl='-Wl,' # All OSF/1 code is PIC. lt_prog_compiler_static='-non_shared' ;; solaris*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' case $cc_basename in f77* | f90* | f95*) lt_prog_compiler_wl='-Qoption ld ';; *) lt_prog_compiler_wl='-Wl,';; esac ;; sunos4*) lt_prog_compiler_wl='-Qoption ld ' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then lt_prog_compiler_pic='-Kconform_pic' lt_prog_compiler_static='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; unicos*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_can_build_shared=no ;; uts4*) lt_prog_compiler_pic='-pic' lt_prog_compiler_static='-Bstatic' ;; *) lt_prog_compiler_can_build_shared=no ;; esac fi { echo "$as_me:$LINENO: result: $lt_prog_compiler_pic" >&5 echo "${ECHO_T}$lt_prog_compiler_pic" >&6; } # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic"; then { echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic works... $ECHO_C" >&6; } if test "${lt_prog_compiler_pic_works+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_prog_compiler_pic_works=no ac_outfile=conftest.$ac_objext printf "$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:7944: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:7948: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_prog_compiler_pic_works=yes fi fi $rm conftest* fi { echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works" >&5 echo "${ECHO_T}$lt_prog_compiler_pic_works" >&6; } if test x"$lt_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 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 # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" { echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6; } if test "${lt_prog_compiler_static_works+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_prog_compiler_static_works=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $lt_tmp_static_flag" printf "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_prog_compiler_static_works=yes fi else lt_prog_compiler_static_works=yes fi fi $rm conftest* LDFLAGS="$save_LDFLAGS" fi { echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works" >&5 echo "${ECHO_T}$lt_prog_compiler_static_works" >&6; } if test x"$lt_prog_compiler_static_works" = xyes; then : else lt_prog_compiler_static= fi { echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6; } if test "${lt_cv_prog_compiler_c_o+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_c_o=no $rm -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out printf "$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:8048: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:8052: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes fi fi chmod u+w . 2>&5 $rm conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files $rm out/* && rmdir out cd .. rmdir conftest $rm conftest* fi { echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o" >&5 echo "${ECHO_T}$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 { echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&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 { echo "$as_me:$LINENO: result: $hard_links" >&5 echo "${ECHO_T}$hard_links" >&6; } if test "$hard_links" = no; then { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 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 { echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; } runpath_var= allow_undefined_flag= enable_shared_with_static_runtimes=no archive_cmds= archive_expsym_cmds= old_archive_From_new_cmds= old_archive_from_expsyms_cmds= export_dynamic_flag_spec= whole_archive_flag_spec= thread_safe_flag_spec= hardcode_libdir_flag_spec= hardcode_libdir_flag_spec_ld= hardcode_libdir_separator= hardcode_direct=no hardcode_minus_L=no hardcode_shlibpath_var=unsupported link_all_deplibs=unknown hardcode_automatic=no module_cmds= module_expsym_cmds= always_export_symbols=no export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' # 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_" # 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. extract_expsyms_cmds= # Just being paranoid about ensuring that cc_basename is set. for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` case $host_os in cygwin* | mingw* | pw32*) # 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 if test "$with_gnu_ld" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir' export_dynamic_flag_spec='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec= fi supports_anon_versioning=no case `$LD -v 2>/dev/null` in *\ [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 aix3* | aix4* | aix5*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then ld_shlibs=no cat <&2 *** Warning: the GNU linker, at least up to release 2.9.1, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to modify your PATH *** so that a non-GNU linker is found, and then restart. EOF fi ;; amigaos*) 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 # Samuel A. Falvo II reports # that the semantics of dynamic libraries on AmigaOS, at least up # to version 4, is to share data among multiple programs linked # with the same dynamic library. Since this doesn't match the # behavior of shared libraries on other platforms, we can't use # them. ld_shlibs=no ;; 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*) # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' allow_undefined_flag=unsupported always_export_symbols=no enable_shared_with_static_runtimes=yes export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else ld_shlibs=no fi ;; interix3*) hardcode_direct=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='${wl}-rpath,$libdir' export_dynamic_flag_spec='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; linux*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then tmp_addflag= case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; esac archive_cmds='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test $supports_anon_versioning = yes; 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 -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi 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 $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then ld_shlibs=no cat <&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. EOF elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib' else ld_shlibs=no fi ;; esac ;; sunos4*) archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= hardcode_direct=yes hardcode_shlibpath_var=no ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac if test "$ld_shlibs" = no; then runpath_var= hardcode_libdir_flag_spec= export_dynamic_flag_spec= whole_archive_flag_spec= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) allow_undefined_flag=unsupported always_export_symbols=yes archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L=yes if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct=unsupported fi ;; aix4* | aix5*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | grep 'GNU' > /dev/null; then export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix5*) 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_libdir_separator=':' link_all_deplibs=yes 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 hardcode_direct=yes 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 # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. always_export_symbols=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag='-berok' # Determine the default libpath from the value encoded in an empty executable. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${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. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag=' ${wl}-bernotok' allow_undefined_flag=' ${wl}-berok' # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec='$convenience' archive_cmds_need_lc=yes # This is similar to how AIX traditionally builds its shared libraries. archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) 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 # see comment about different semantics on the GNU ld section ld_shlibs=no ;; bsdi[45]*) export_dynamic_flag_spec=-rdynamic ;; cygwin* | mingw* | pw32*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_From_new_cmds='true' # FIXME: Should let the user specify the lib program. old_archive_cmds='lib /OUT:$oldlib$oldobjs$old_deplibs' fix_srcfile_path='`cygpath -w "$srcfile"`' enable_shared_with_static_runtimes=yes ;; darwin* | rhapsody*) case $host_os in rhapsody* | darwin1.[012]) allow_undefined_flag='${wl}-undefined ${wl}suppress' ;; *) # Darwin 1.3 on if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then allow_undefined_flag='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' else case ${MACOSX_DEPLOYMENT_TARGET} in 10.[012]) allow_undefined_flag='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) allow_undefined_flag='${wl}-undefined ${wl}dynamic_lookup' ;; esac fi ;; esac archive_cmds_need_lc=no hardcode_direct=no hardcode_automatic=yes hardcode_shlibpath_var=unsupported whole_archive_flag_spec='' link_all_deplibs=yes if test "$GCC" = yes ; then output_verbose_link_cmd='echo' archive_cmds='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' module_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else case $cc_basename in xlc*) output_verbose_link_cmd='echo' archive_cmds='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' module_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' ;; *) ld_shlibs=no ;; esac fi ;; dgux*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; freebsd1*) ld_shlibs=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | kfreebsd*-gnu | dragonfly*) archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; hpux9*) if test "$GCC" = yes; then archive_cmds='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else archive_cmds='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes export_dynamic_flag_spec='${wl}-E' ;; hpux10*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes export_dynamic_flag_spec='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes fi ;; hpux11*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: case $host_cpu in hppa*64*|ia64*) hardcode_libdir_flag_spec_ld='+b $libdir' hardcode_direct=no hardcode_shlibpath_var=no ;; *) hardcode_direct=yes export_dynamic_flag_spec='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_ld='-rpath $libdir' fi hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: 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 ;; openbsd*) hardcode_direct=yes hardcode_shlibpath_var=no 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 ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported archive_cmds='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' old_archive_From_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' fi hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${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='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -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; echo "-hidden">> $lib.exp~ $LD -shared${allow_undefined_flag} -input $lib.exp $linker_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 hardcode_libdir_separator=: ;; solaris*) no_undefined_flag=' -z text' if test "$GCC" = yes; then wlarc='${wl}' archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' else 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' 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 linker options so we # cannot just pass the convience library names through # without $wl, iff we do not link with $LD. # Luckily, gcc supports the same syntax we need for Sun Studio. # Supported since Solaris 2.6 (maybe 2.5.1?) case $wlarc in '') whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;; *) whole_archive_flag_spec='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; esac ;; 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*) 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='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' hardcode_libdir_separator=':' link_all_deplibs=yes export_dynamic_flag_spec='${wl}-Bexport' runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) 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 fi { echo "$as_me:$LINENO: result: $ld_shlibs" >&5 echo "${ECHO_T}$ld_shlibs" >&6; } test "$ld_shlibs" = no && can_build_shared=no # # 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. { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; } $rm conftest* printf "$lt_simple_compile_test_code" > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } 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:$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=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } then archive_cmds_need_lc=no else archive_cmds_need_lc=yes fi allow_undefined_flag=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $rm conftest* { echo "$as_me:$LINENO: result: $archive_cmds_need_lc" >&5 echo "${ECHO_T}$archive_cmds_need_lc" >&6; } ;; esac fi ;; esac { echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; } 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" if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. 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 else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix4* | aix5*) version_type=linux need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$host_os in yes,cygwin* | yes,mingw* | yes,pw32*) 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' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $rm \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" ;; mingw*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH printed by # mingw gcc, but we are running on Cygwin. Gcc prints its search # path with ; separators, and with drive letters. We can handle the # drive letters (cygwin fileutils understands them), so leave them, # especially as we might pass files found there to a mingw objdump, # which wouldn't understand a cygwinified path. Ahh. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; esac ;; *) library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' ;; esac dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${versuffix}$shared_ext ${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`' # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` else sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' fi sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd1*) dynamic_linker=no ;; kfreebsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='GNU ld.so' ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[123]*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; freebsd*) # from 4.6 on shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555. postinstall_cmds='chmod 555 $lib' ;; interix3*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be Linux ELF. linux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # 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)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; knetbsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='GNU ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; nto-qnx*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; 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" ;; solaris*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no export_dynamic_flag_spec='${wl}-Blargedynsym' runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' shlibpath_overrides_runpath=no else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' shlibpath_overrides_runpath=yes case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; uts4*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac { echo "$as_me:$LINENO: result: $dynamic_linker" >&5 echo "${ECHO_T}$dynamic_linker" >&6; } test "$dynamic_linker" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi { echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6; } hardcode_action= if test -n "$hardcode_libdir_flag_spec" || \ test -n "$runpath_var" || \ test "X$hardcode_automatic" = "Xyes" ; then # We can hardcode non-existant 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_AC_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 { echo "$as_me:$LINENO: result: $hardcode_action" >&5 echo "${ECHO_T}$hardcode_action" >&6; } if test "$hardcode_action" = relink; 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 striplib= old_striplib= { echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5 echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6; } if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi ;; *) { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } ;; esac fi if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it { echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6; } if test "${ac_cv_lib_dl_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any 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 rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dl_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dl_dlopen=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6; } if test $ac_cv_lib_dl_dlopen = yes; then lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else lt_cv_dlopen="dyld" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes fi ;; *) { echo "$as_me:$LINENO: checking for shl_load" >&5 echo $ECHO_N "checking for shl_load... $ECHO_C" >&6; } if test "${ac_cv_func_shl_load+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define shl_load to an innocuous variant, in case declares shl_load. For example, HP-UX 11i declares gettimeofday. */ #define shl_load innocuous_shl_load /* System header to define __stub macros and hopefully few prototypes, which can conflict with char shl_load (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef shl_load /* 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 (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_shl_load) || defined (__stub___shl_load) choke me #endif int main () { return shl_load (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_shl_load=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_shl_load=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5 echo "${ECHO_T}$ac_cv_func_shl_load" >&6; } if test $ac_cv_func_shl_load = yes; then lt_cv_dlopen="shl_load" else { echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6; } if test "${ac_cv_lib_dld_shl_load+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any 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 rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dld_shl_load=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dld_shl_load=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6; } if test $ac_cv_lib_dld_shl_load = yes; then lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld" else { echo "$as_me:$LINENO: checking for dlopen" >&5 echo $ECHO_N "checking for dlopen... $ECHO_C" >&6; } if test "${ac_cv_func_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define dlopen to an innocuous variant, in case declares dlopen. For example, HP-UX 11i declares gettimeofday. */ #define dlopen innocuous_dlopen /* System header to define __stub macros and hopefully few prototypes, which can conflict with char dlopen (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef dlopen /* 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 (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_dlopen) || defined (__stub___dlopen) choke me #endif int main () { return dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_dlopen=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5 echo "${ECHO_T}$ac_cv_func_dlopen" >&6; } if test $ac_cv_func_dlopen = yes; then lt_cv_dlopen="dlopen" else { echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6; } if test "${ac_cv_lib_dl_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any 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 rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dl_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dl_dlopen=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6; } if test $ac_cv_lib_dl_dlopen = yes; then lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else { echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5 echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6; } if test "${ac_cv_lib_svld_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsvld $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any 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 rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_svld_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_svld_dlopen=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5 echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6; } if test $ac_cv_lib_svld_dlopen = yes; then lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" else { echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5 echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6; } if test "${ac_cv_lib_dld_dld_link+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any 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 rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dld_dld_link=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dld_dld_link=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5 echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6; } if test $ac_cv_lib_dld_dld_link = yes; then lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld" fi fi fi fi fi fi ;; esac if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes else enable_dlopen=no fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS="$CPPFLAGS" test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS="$LDFLAGS" wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" { echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5 echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6; } if test "${lt_cv_dlopen_self+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < #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 #ifdef __cplusplus extern "C" void exit (int); #endif void fnord() { int i=42;} int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; /* dlclose (self); */ } else puts (dlerror ()); exit (status); } EOF if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;; esac else : # compilation failed lt_cv_dlopen_self=no fi fi rm -fr conftest* fi { echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5 echo "${ECHO_T}$lt_cv_dlopen_self" >&6; } if test "x$lt_cv_dlopen_self" = xyes; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" { echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5 echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6; } if test "${lt_cv_dlopen_self_static+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self_static=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < #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 #ifdef __cplusplus extern "C" void exit (int); #endif void fnord() { int i=42;} int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; /* dlclose (self); */ } else puts (dlerror ()); exit (status); } EOF if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;; esac else : # compilation failed lt_cv_dlopen_self_static=no fi fi rm -fr conftest* fi { echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5 echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6; } fi CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" LIBS="$save_LIBS" ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi # Report which library types will actually be built { echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5 echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6; } { echo "$as_me:$LINENO: result: $can_build_shared" >&5 echo "${ECHO_T}$can_build_shared" >&6; } { echo "$as_me:$LINENO: checking whether to build shared libraries" >&5 echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&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 ;; aix4* | aix5*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac { echo "$as_me:$LINENO: result: $enable_shared" >&5 echo "${ECHO_T}$enable_shared" >&6; } { echo "$as_me:$LINENO: checking whether to build static libraries" >&5 echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6; } # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes { echo "$as_me:$LINENO: result: $enable_static" >&5 echo "${ECHO_T}$enable_static" >&6; } # The else clause should only fire when bootstrapping the # libtool distribution, otherwise you forgot to ship ltmain.sh # with your package, and you will get complaints that there are # no rules to generate ltmain.sh. if test -f "$ltmain"; then # 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 # Now quote all the things that may contain metacharacters while being # careful not to overquote the AC_SUBSTed values. We take copies of the # variables and quote the copies for generation of the libtool script. for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \ SED SHELL STRIP \ libname_spec library_names_spec soname_spec extract_expsyms_cmds \ old_striplib striplib file_magic_cmd finish_cmds finish_eval \ deplibs_check_method reload_flag reload_cmds need_locks \ lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ old_postinstall_cmds old_postuninstall_cmds \ compiler \ CC \ LD \ lt_prog_compiler_wl \ lt_prog_compiler_pic \ lt_prog_compiler_static \ lt_prog_compiler_no_builtin_flag \ export_dynamic_flag_spec \ thread_safe_flag_spec \ whole_archive_flag_spec \ enable_shared_with_static_runtimes \ old_archive_cmds \ old_archive_from_new_cmds \ predep_objects \ postdep_objects \ predeps \ postdeps \ compiler_lib_search_path \ archive_cmds \ archive_expsym_cmds \ postinstall_cmds \ postuninstall_cmds \ old_archive_from_expsyms_cmds \ allow_undefined_flag \ no_undefined_flag \ export_symbols_cmds \ hardcode_libdir_flag_spec \ hardcode_libdir_flag_spec_ld \ hardcode_libdir_separator \ hardcode_automatic \ module_cmds \ module_expsym_cmds \ lt_cv_prog_compiler_c_o \ exclude_expsyms \ include_expsyms; do case $var in old_archive_cmds | \ old_archive_from_new_cmds | \ archive_cmds | \ archive_expsym_cmds | \ module_cmds | \ module_expsym_cmds | \ old_archive_from_expsyms_cmds | \ export_symbols_cmds | \ extract_expsyms_cmds | reload_cmds | finish_cmds | \ postinstall_cmds | postuninstall_cmds | \ old_postinstall_cmds | old_postuninstall_cmds | \ sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) # Double-quote double-evaled strings. eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" ;; *) eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" ;; esac done case $lt_echo in *'\$0 --fallback-echo"') lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` ;; esac cfgfile="${ofile}T" trap "$rm \"$cfgfile\"; exit 1" 1 2 15 $rm -f "$cfgfile" { echo "$as_me:$LINENO: creating $ofile" >&5 echo "$as_me: creating $ofile" >&6;} cat <<__EOF__ >> "$cfgfile" #! $SHELL # `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) # NOTE: Changes made to this file will be lost: look at ltmain.sh. # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 # Free Software Foundation, Inc. # # This file is part of GNU Libtool: # Originally by Gordon Matzigkeit , 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 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # 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//" # 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 # The names of the tagged configurations supported by this script. available_tags= # ### BEGIN LIBTOOL CONFIG # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # 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 # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # An echo program that does not interpret backslashes. echo=$lt_echo # The archiver. AR=$lt_AR AR_FLAGS=$lt_AR_FLAGS # A C compiler. LTCC=$lt_LTCC # LTCC compiler flags. LTCFLAGS=$lt_LTCFLAGS # A language-specific compiler. CC=$lt_compiler # Is the compiler the GNU C compiler? with_gcc=$GCC # An ERE matcher. EGREP=$lt_EGREP # The linker used to build libraries. LD=$lt_LD # Whether we need hard or soft links. LN_S=$lt_LN_S # A BSD-compatible nm program. NM=$lt_NM # A symbol stripping program STRIP=$lt_STRIP # Used to examine libraries when file_magic_cmd begins "file" MAGIC_CMD=$MAGIC_CMD # Used on cygwin: DLL creation program. DLLTOOL="$DLLTOOL" # Used on cygwin: object dumper. OBJDUMP="$OBJDUMP" # Used on cygwin: assembler. AS="$AS" # The name of the directory that contains temporary libtool files. objdir=$objdir # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl # Object file suffix (normally "o"). objext="$ac_objext" # Old archive suffix (normally "a"). libext="$libext" # Shared library suffix (normally ".so"). shrext_cmds='$shrext_cmds' # Executable file suffix (normally ""). exeext="$exeext" # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic pic_mode=$pic_mode # What is the maximum length of a command? max_cmd_len=$lt_cv_sys_max_cmd_len # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o # Must we lock files when doing compilation? need_locks=$lt_need_locks # 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 # 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 # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag # 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 # Compiler flag to generate thread-safe objects. thread_safe_flag_spec=$lt_thread_safe_flag_spec # Library versioning type. version_type=$version_type # 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 # Commands used to build and install an old-style archive. RANLIB=$lt_RANLIB old_archive_cmds=$lt_old_archive_cmds old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # 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 and install a shared archive. archive_cmds=$lt_archive_cmds archive_expsym_cmds=$lt_archive_expsym_cmds postinstall_cmds=$lt_postinstall_cmds postuninstall_cmds=$lt_postuninstall_cmds # Commands used to build a loadable module (assumed same as above if empty) module_cmds=$lt_module_cmds module_expsym_cmds=$lt_module_expsym_cmds # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # Dependencies to place before the objects being linked to create a # shared library. predep_objects=$lt_predep_objects # Dependencies to place after the objects being linked to create a # shared library. postdep_objects=$lt_postdep_objects # Dependencies to place before the objects being linked to create a # shared library. predeps=$lt_predeps # Dependencies to place after the objects being linked to create a # shared library. postdeps=$lt_postdeps # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path # 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 # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag # Flag that forces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # Same as above, but a single script fragment to be evaled but not shown. finish_eval=$lt_finish_eval # 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 # This is the shared library runtime path variable. runpath_var=$runpath_var # This is the shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist. hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec # If ld is used when linking, flag to hardcode \$libdir into # a binary during linking. This must work even if \$libdir does # not exist. hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld # Whether we need a single -rpath flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator # Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the # resulting binary. hardcode_direct=$hardcode_direct # Set to yes if using 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 # Variables whose values should be saved in libtool wrapper scripts and # restored at relink time. variables_saved_for_relink="$variables_saved_for_relink" # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs # 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 # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path="$fix_srcfile_path" # Set to yes if exported symbols are required. always_export_symbols=$always_export_symbols # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_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 # ### END LIBTOOL CONFIG __EOF__ case $host_os in aix3*) cat <<\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 EOF ;; esac # 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) mv -f "$cfgfile" "$ofile" || \ (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" else # If there is no Makefile yet, we rely on a make rule to execute # `config.status --recheck' to rerun these tests and create the # libtool script then. ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` if test -f "$ltmain_in"; then test -f Makefile && make "$ltmain" fi 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" # Check whether --with-tags was given. if test "${with_tags+set}" = set; then withval=$with_tags; tagnames="$withval" fi if test -f "$ltmain" && test -n "$tagnames"; then if test ! -f "${ofile}"; then { echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not exist" >&5 echo "$as_me: WARNING: output file \`$ofile' does not exist" >&2;} fi if test -z "$LTCC"; then eval "`$SHELL ${ofile} --config | grep '^LTCC='`" if test -z "$LTCC"; then { echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not look like a libtool script" >&5 echo "$as_me: WARNING: output file \`$ofile' does not look like a libtool script" >&2;} else { echo "$as_me:$LINENO: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&5 echo "$as_me: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&2;} fi fi if test -z "$LTCFLAGS"; then eval "`$SHELL ${ofile} --config | grep '^LTCFLAGS='`" fi # Extract list of available tagged configurations in $ofile. # Note that this assumes the entire list is on one line. available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'` lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for tagname in $tagnames; do IFS="$lt_save_ifs" # Check whether tagname contains only valid characters case `$echo "X$tagname" | $Xsed -e 's:[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]::g'` in "") ;; *) { { echo "$as_me:$LINENO: error: invalid tag name: $tagname" >&5 echo "$as_me: error: invalid tag name: $tagname" >&2;} { (exit 1); exit 1; }; } ;; esac if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null then { { echo "$as_me:$LINENO: error: tag name \"$tagname\" already exists" >&5 echo "$as_me: error: tag name \"$tagname\" already exists" >&2;} { (exit 1); exit 1; }; } fi # Update the list of available tags. if test -n "$tagname"; then echo appending configuration tag \"$tagname\" to $ofile case $tagname in CXX) if test -n "$CXX" && ( test "X$CXX" != "Xno" && ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || (test "X$CXX" != "Xg++"))) ; then ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu archive_cmds_need_lc_CXX=no allow_undefined_flag_CXX= always_export_symbols_CXX=no archive_expsym_cmds_CXX= export_dynamic_flag_spec_CXX= hardcode_direct_CXX=no hardcode_libdir_flag_spec_CXX= hardcode_libdir_flag_spec_ld_CXX= hardcode_libdir_separator_CXX= hardcode_minus_L_CXX=no hardcode_shlibpath_var_CXX=unsupported hardcode_automatic_CXX=no module_cmds_CXX= module_expsym_cmds_CXX= link_all_deplibs_CXX=unknown old_archive_cmds_CXX=$old_archive_cmds no_undefined_flag_CXX= whole_archive_flag_spec_CXX= enable_shared_with_static_runtimes_CXX=no # Dependencies to place before and after the object being linked: predep_objects_CXX= postdep_objects_CXX= predeps_CXX= postdeps_CXX= compiler_lib_search_path_CXX= # Source file extension for C++ test sources. ac_ext=cpp # Object file extension for compiled C++ test sources. objext=o objext_CXX=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;\n" # Code to be used in simple link tests lt_simple_link_test_code='int main(int, char *[]) { return(0); }\n' # ltmain only uses $CC for tagged configurations so make sure $CC is set. # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $rm conftest* ac_outfile=conftest.$ac_objext printf "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $rm conftest* # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_LD=$LD lt_save_GCC=$GCC GCC=$GXX lt_save_with_gnu_ld=$with_gnu_ld lt_save_path_LD=$lt_cv_path_LD if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx else $as_unset lt_cv_prog_gnu_ld fi if test -n "${lt_cv_path_LDCXX+set}"; then lt_cv_path_LD=$lt_cv_path_LDCXX else $as_unset lt_cv_path_LD fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} compiler=$CC compiler_CXX=$CC for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` # We don't want -fno-exception wen compiling C++ code, so set the # no_builtin_flag separately if test "$GXX" = yes; then lt_prog_compiler_no_builtin_flag_CXX=' -fno-builtin' else lt_prog_compiler_no_builtin_flag_CXX= fi if test "$GXX" = yes; then # Set up default GNU C++ configuration # 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. { echo "$as_me:$LINENO: checking for ld used by $CC" >&5 echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&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 { echo "$as_me:$LINENO: checking for GNU ld" >&5 echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6; } else { echo "$as_me:$LINENO: checking for non-GNU ld" >&5 echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6; } fi if test "${lt_cv_path_LD+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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 echo "${ECHO_T}$LD" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5 echo "$as_me: error: no acceptable ld found in \$PATH" >&2;} { (exit 1); exit 1; }; } { echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6; } if test "${lt_cv_prog_gnu_ld+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &5 echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6; } with_gnu_ld=$lt_cv_prog_gnu_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 archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir' export_dynamic_flag_spec_CXX='${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 whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec_CXX= 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. archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' fi # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' else GXX=no with_gnu_ld=no wlarc= fi # PORTME: fill in a description of your system's C++ link characteristics { echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; } ld_shlibs_CXX=yes case $host_os in aix3*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; aix4* | aix5*) 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].*|aix5*) 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. archive_cmds_CXX='' hardcode_direct_CXX=yes hardcode_libdir_separator_CXX=':' link_all_deplibs_CXX=yes 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 hardcode_direct_CXX=yes else # We have old collect2 hardcode_direct_CXX=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_CXX=yes hardcode_libdir_flag_spec_CXX='-L$libdir' hardcode_libdir_separator_CXX= 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 # 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_CXX=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_CXX='-berok' # Determine the default libpath from the value encoded in an empty executable. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds_CXX="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec_CXX='${wl}-R $libdir:/usr/lib:/lib' allow_undefined_flag_CXX="-z nodefs" archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an empty executable. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec_CXX='${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_CXX=' ${wl}-bernotok' allow_undefined_flag_CXX=' ${wl}-berok' # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec_CXX='$convenience' archive_cmds_need_lc_CXX=yes # This is similar to how AIX traditionally builds its shared libraries. archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; beos*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then allow_undefined_flag_CXX=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds_CXX='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else ld_shlibs_CXX=no fi ;; chorus*) case $cc_basename in *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; cygwin* | mingw* | pw32*) # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec_CXX='-L$libdir' allow_undefined_flag_CXX=unsupported always_export_symbols_CXX=no enable_shared_with_static_runtimes_CXX=yes if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then 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 ld_shlibs_CXX=no fi ;; darwin* | rhapsody*) case $host_os in rhapsody* | darwin1.[012]) allow_undefined_flag_CXX='${wl}-undefined ${wl}suppress' ;; *) # Darwin 1.3 on if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then allow_undefined_flag_CXX='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' else case ${MACOSX_DEPLOYMENT_TARGET} in 10.[012]) allow_undefined_flag_CXX='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) allow_undefined_flag_CXX='${wl}-undefined ${wl}dynamic_lookup' ;; esac fi ;; esac archive_cmds_need_lc_CXX=no hardcode_direct_CXX=no hardcode_automatic_CXX=yes hardcode_shlibpath_var_CXX=unsupported whole_archive_flag_spec_CXX='' link_all_deplibs_CXX=yes if test "$GXX" = yes ; then lt_int_apple_cc_single_mod=no output_verbose_link_cmd='echo' if $CC -dumpspecs 2>&1 | $EGREP 'single_module' >/dev/null ; then lt_int_apple_cc_single_mod=yes fi if test "X$lt_int_apple_cc_single_mod" = Xyes ; then archive_cmds_CXX='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' else archive_cmds_CXX='$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' fi module_cmds_CXX='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds if test "X$lt_int_apple_cc_single_mod" = Xyes ; then archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "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~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' fi module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else case $cc_basename in xlc*) output_verbose_link_cmd='echo' archive_cmds_CXX='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' module_cmds_CXX='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' ;; *) ld_shlibs_CXX=no ;; esac fi ;; dgux*) case $cc_basename in ec++*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; ghcx*) # Green Hills C++ Compiler # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; freebsd[12]*) # C++ shared libraries reported to be fairly broken before switch to ELF ld_shlibs_CXX=no ;; freebsd-elf*) archive_cmds_need_lc_CXX=no ;; freebsd* | kfreebsd*-gnu | dragonfly*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions ld_shlibs_CXX=yes ;; gnu*) ;; hpux9*) hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' hardcode_libdir_separator_CXX=: export_dynamic_flag_spec_CXX='${wl}-E' hardcode_direct_CXX=yes hardcode_minus_L_CXX=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 ld_shlibs_CXX=no ;; aCC*) archive_cmds_CXX='$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) | grep "[-]L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes; then archive_cmds_CXX='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; hpux10*|hpux11*) if test $with_gnu_ld = no; then hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' hardcode_libdir_separator_CXX=: case $host_cpu in hppa*64*|ia64*) hardcode_libdir_flag_spec_ld_CXX='+b $libdir' ;; *) export_dynamic_flag_spec_CXX='${wl}-E' ;; esac fi case $host_cpu in hppa*64*|ia64*) hardcode_direct_CXX=no hardcode_shlibpath_var_CXX=no ;; *) hardcode_direct_CXX=yes hardcode_minus_L_CXX=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 ld_shlibs_CXX=no ;; aCC*) case $host_cpu in hppa*64*) archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes; then if test $with_gnu_ld = no; then case $host_cpu in hppa*64*) archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; interix3*) hardcode_direct_CXX=no hardcode_shlibpath_var_CXX=no hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' export_dynamic_flag_spec_CXX='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds_CXX='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' archive_expsym_cmds_CXX='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; irix5* | irix6*) case $cc_basename in CC*) # SGI C++ archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -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. old_archive_cmds_CXX='$CC -ar -WR,-u -o $oldlib $oldobjs' ;; *) if test "$GXX" = yes; then if test "$with_gnu_ld" = no; then archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib' fi fi link_all_deplibs_CXX=yes ;; esac hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_CXX=: ;; linux*) 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. archive_cmds_CXX='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' archive_expsym_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' hardcode_libdir_flag_spec_CXX='${wl}--rpath,$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' ;; icpc*) # 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."*) archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$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 archive_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; esac archive_cmds_need_lc_CXX=no hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive' ;; pgCC*) # Portland Group C++ compiler archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' archive_expsym_cmds_CXX='$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' hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' whole_archive_flag_spec_CXX='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' ;; cxx*) # Compaq C++ archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$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 hardcode_libdir_flag_spec_CXX='-rpath $libdir' hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; esac ;; lynxos*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; m88k*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; mvs*) case $cc_basename in cxx*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds_CXX='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' wlarc= hardcode_libdir_flag_spec_CXX='-R$libdir' hardcode_direct_CXX=yes hardcode_shlibpath_var_CXX=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::"' ;; openbsd2*) # C++ shared libraries are fairly broken ld_shlibs_CXX=no ;; openbsd*) hardcode_direct_CXX=yes hardcode_shlibpath_var_CXX=no archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' export_dynamic_flag_spec_CXX='${wl}-E' whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' fi output_verbose_link_cmd='echo' ;; osf3*) 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. archive_cmds_CXX='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' hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' hardcode_libdir_separator_CXX=: # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; cxx*) allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; 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. archive_cmds_CXX='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' hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' hardcode_libdir_separator_CXX=: # Archives containing C++ object files must be created using # the KAI C++ compiler. old_archive_cmds_CXX='$CC -o $oldlib $oldobjs' ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; cxx*) allow_undefined_flag_CXX=' -expect_unresolved \*' archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds_CXX='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' hardcode_libdir_flag_spec_CXX='-rpath $libdir' hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; psos*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; lcc*) # Lucid # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; solaris*) case $cc_basename in CC*) # Sun C++ 4.2, 5.x and Centerline C++ archive_cmds_need_lc_CXX=yes no_undefined_flag_CXX=' -zdefs' archive_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' archive_expsym_cmds_CXX='$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' hardcode_libdir_flag_spec_CXX='-R$libdir' hardcode_shlibpath_var_CXX=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The C++ compiler is used as linker so we must use $wl # flag to pass the commands to the underlying system # linker. We must also pass each convience library through # to the system linker between allextract/defaultextract. # The C++ compiler will combine linker options so we # cannot just pass the convience library names through # without $wl. # Supported since Solaris 2.6 (maybe 2.5.1?) whole_archive_flag_spec_CXX='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; esac link_all_deplibs_CXX=yes output_verbose_link_cmd='echo' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' ;; gcx*) # Green Hills C++ Compiler archive_cmds_CXX='$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. old_archive_cmds_CXX='$CC $LDFLAGS -archive -o $oldlib $oldobjs' ;; *) # GNU C++ compiler with Solaris linker if test "$GXX" = yes && test "$with_gnu_ld" = no; then no_undefined_flag_CXX=' ${wl}-z ${wl}defs' if $CC --version | grep -v '^2\.7' > /dev/null; then archive_cmds_CXX='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" else # g++ 2.7 appears to require `-G' NOT `-shared' on this # platform. archive_cmds_CXX='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" fi hardcode_libdir_flag_spec_CXX='${wl}-R $wl$libdir' fi ;; esac ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) no_undefined_flag_CXX='${wl}-z,text' archive_cmds_need_lc_CXX=no hardcode_shlibpath_var_CXX=no runpath_var='LD_RUN_PATH' case $cc_basename in CC*) archive_cmds_CXX='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds_CXX='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. # So that behaviour is only enabled if SCOABSPATH is set to a # non-empty value in the environment. Most likely only useful for # creating official distributions of packages. # This is a hack until libtool officially supports absolute path # names for shared libraries. no_undefined_flag_CXX='${wl}-z,text' allow_undefined_flag_CXX='${wl}-z,nodefs' archive_cmds_need_lc_CXX=no hardcode_shlibpath_var_CXX=no hardcode_libdir_flag_spec_CXX='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' hardcode_libdir_separator_CXX=':' link_all_deplibs_CXX=yes export_dynamic_flag_spec_CXX='${wl}-Bexport' runpath_var='LD_RUN_PATH' case $cc_basename in CC*) archive_cmds_CXX='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds_CXX='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; vxworks*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac { echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5 echo "${ECHO_T}$ld_shlibs_CXX" >&6; } test "$ld_shlibs_CXX" = no && can_build_shared=no GCC_CXX="$GXX" LD_CXX="$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... cat > conftest.$ac_ext <&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; 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 # The `*' in the case matches for architectures that use `case' in # $output_verbose_cmd can trigger glob expansion during the loop # eval without this substitution. output_verbose_link_cmd=`$echo "X$output_verbose_link_cmd" | $Xsed -e "$no_glob_subst"` for p in `eval $output_verbose_link_cmd`; do case $p in -L* | -R* | -l*) # Some compilers place space between "-{L,R}" and the path. # Remove the space. if test $p = "-L" \ || test $p = "-R"; then prev=$p continue else prev= fi if test "$pre_test_object_deps_done" = no; then case $p in -L* | -R*) # Internal compiler library paths should come after those # provided the user. The postdeps already come after the # user supplied libs so there is no need to process them. if test -z "$compiler_lib_search_path_CXX"; then compiler_lib_search_path_CXX="${prev}${p}" else compiler_lib_search_path_CXX="${compiler_lib_search_path_CXX} ${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 "$postdeps_CXX"; then postdeps_CXX="${prev}${p}" else postdeps_CXX="${postdeps_CXX} ${prev}${p}" fi fi ;; *.$objext) # This assumes that the test object file only shows up # once in the compiler output. if test "$p" = "conftest.$objext"; then pre_test_object_deps_done=yes continue fi if test "$pre_test_object_deps_done" = no; then if test -z "$predep_objects_CXX"; then predep_objects_CXX="$p" else predep_objects_CXX="$predep_objects_CXX $p" fi else if test -z "$postdep_objects_CXX"; then postdep_objects_CXX="$p" else postdep_objects_CXX="$postdep_objects_CXX $p" fi fi ;; *) ;; # Ignore the rest. esac done # Clean up. rm -f a.out a.exe else echo "libtool.m4: error: problem compiling CXX test program" fi $rm -f confest.$objext # PORTME: override above test on systems where it is broken case $host_os in interix3*) # Interix 3.5 installs completely hosed .la files for C++, so rather than # hack all around it, let's just trust "g++" to DTRT. predep_objects_CXX= postdep_objects_CXX= postdeps_CXX= ;; solaris*) case $cc_basename in CC*) # 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. postdeps_CXX='-lCstd -lCrun' ;; esac ;; esac case " $postdeps_CXX " in *" -lc "*) archive_cmds_need_lc_CXX=no ;; esac lt_prog_compiler_wl_CXX= lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX= { echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; } # C++ specific cases for pic, static, wl, etc. if test "$GXX" = yes; then lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='-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_CXX='-Bstatic' fi ;; amigaos*) # 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_CXX='-m68020 -resident32 -malways-restore-a4' ;; beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | os2* | pw32*) # 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_CXX='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic_CXX='-fno-common' ;; *djgpp*) # DJGPP does not support shared libraries at all lt_prog_compiler_pic_CXX= ;; interix3*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic_CXX=-Kconform_pic fi ;; hpux*) # 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*) ;; *) lt_prog_compiler_pic_CXX='-fPIC' ;; esac ;; *) lt_prog_compiler_pic_CXX='-fPIC' ;; esac else case $host_os in aix4* | aix5*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_CXX='-Bstatic' else lt_prog_compiler_static_CXX='-bnso -bI:/lib/syscalls.exp' fi ;; chorus*) case $cc_basename in cxch68*) # Green Hills C++ Compiler # _LT_AC_TAGVAR(lt_prog_compiler_static, CXX)="--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 ;; darwin*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files case $cc_basename in xlc*) lt_prog_compiler_pic_CXX='-qnocommon' lt_prog_compiler_wl_CXX='-Wl,' ;; esac ;; dgux*) case $cc_basename in ec++*) lt_prog_compiler_pic_CXX='-KPIC' ;; ghcx*) # Green Hills C++ Compiler lt_prog_compiler_pic_CXX='-pic' ;; *) ;; esac ;; freebsd* | kfreebsd*-gnu | dragonfly*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) case $cc_basename in CC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='${wl}-a ${wl}archive' if test "$host_cpu" != ia64; then lt_prog_compiler_pic_CXX='+Z' fi ;; aCC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='${wl}-a ${wl}archive' case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic_CXX='+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_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='-non_shared' # CC pic flag -KPIC is the default. ;; *) ;; esac ;; linux*) case $cc_basename in KCC*) # KAI C++ Compiler lt_prog_compiler_wl_CXX='--backend -Wl,' lt_prog_compiler_pic_CXX='-fPIC' ;; icpc* | ecpc*) # Intel C++ lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-static' ;; pgCC*) # Portland Group C++ compiler. lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-fpic' lt_prog_compiler_static_CXX='-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_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX='-non_shared' ;; *) ;; esac ;; lynxos*) ;; m88k*) ;; mvs*) case $cc_basename in cxx*) lt_prog_compiler_pic_CXX='-W c,exportall' ;; *) ;; esac ;; netbsd*) ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) lt_prog_compiler_wl_CXX='--backend -Wl,' ;; RCC*) # Rational C++ 2.4.1 lt_prog_compiler_pic_CXX='-pic' ;; cxx*) # Digital/Compaq C++ lt_prog_compiler_wl_CXX='-Wl,' # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX='-non_shared' ;; *) ;; esac ;; psos*) ;; solaris*) case $cc_basename in CC*) # Sun C++ 4.2, 5.x and Centerline C++ lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-Bstatic' lt_prog_compiler_wl_CXX='-Qoption ld ' ;; gcx*) # Green Hills C++ Compiler lt_prog_compiler_pic_CXX='-PIC' ;; *) ;; esac ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x lt_prog_compiler_pic_CXX='-pic' lt_prog_compiler_static_CXX='-Bstatic' ;; lcc*) # Lucid lt_prog_compiler_pic_CXX='-pic' ;; *) ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 lt_prog_compiler_pic_CXX='-KPIC' ;; *) ;; esac ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) case $cc_basename in CC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-Bstatic' ;; esac ;; vxworks*) ;; *) lt_prog_compiler_can_build_shared_CXX=no ;; esac fi { echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_CXX" >&5 echo "${ECHO_T}$lt_prog_compiler_pic_CXX" >&6; } # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic_CXX"; then { echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5 echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... $ECHO_C" >&6; } if test "${lt_prog_compiler_pic_works_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_prog_compiler_pic_works_CXX=no ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic_CXX -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:12840: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:12844: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_prog_compiler_pic_works_CXX=yes fi fi $rm conftest* fi { echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_CXX" >&5 echo "${ECHO_T}$lt_prog_compiler_pic_works_CXX" >&6; } if test x"$lt_prog_compiler_pic_works_CXX" = xyes; then case $lt_prog_compiler_pic_CXX in "" | " "*) ;; *) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;; esac else lt_prog_compiler_pic_CXX= lt_prog_compiler_can_build_shared_CXX=no fi fi case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic_CXX= ;; *) lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC" ;; esac # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl_CXX eval lt_tmp_static_flag=\"$lt_prog_compiler_static_CXX\" { echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6; } if test "${lt_prog_compiler_static_works_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_prog_compiler_static_works_CXX=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $lt_tmp_static_flag" printf "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_prog_compiler_static_works_CXX=yes fi else lt_prog_compiler_static_works_CXX=yes fi fi $rm conftest* LDFLAGS="$save_LDFLAGS" fi { echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works_CXX" >&5 echo "${ECHO_T}$lt_prog_compiler_static_works_CXX" >&6; } if test x"$lt_prog_compiler_static_works_CXX" = xyes; then : else lt_prog_compiler_static_CXX= fi { echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6; } if test "${lt_cv_prog_compiler_c_o_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_c_o_CXX=no $rm -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out printf "$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:12944: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:12948: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o_CXX=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 .. rmdir conftest $rm conftest* fi { echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_CXX" >&5 echo "${ECHO_T}$lt_cv_prog_compiler_c_o_CXX" >&6; } hard_links="nottested" if test "$lt_cv_prog_compiler_c_o_CXX" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user { echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&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 { echo "$as_me:$LINENO: result: $hard_links" >&5 echo "${ECHO_T}$hard_links" >&6; } if test "$hard_links" = no; then { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 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 { echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; } export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' case $host_os in aix4* | aix5*) # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | grep 'GNU' > /dev/null; then export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds_CXX='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' fi ;; pw32*) export_symbols_cmds_CXX="$ltdll_cmds" ;; cygwin* | mingw*) export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/;/^.* __nm__/s/^.* __nm__\([^ ]*\) [^ ]*/\1 DATA/;/^I /d;/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' ;; *) export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac { echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5 echo "${ECHO_T}$ld_shlibs_CXX" >&6; } test "$ld_shlibs_CXX" = no && can_build_shared=no # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc_CXX" in x|xyes) # Assume -lc should be added archive_cmds_need_lc_CXX=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $archive_cmds_CXX 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. { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; } $rm conftest* printf "$lt_simple_compile_test_code" > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl_CXX pic_flag=$lt_prog_compiler_pic_CXX compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag_CXX allow_undefined_flag_CXX= if { (eval echo "$as_me:$LINENO: \"$archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 (eval $archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } then archive_cmds_need_lc_CXX=no else archive_cmds_need_lc_CXX=yes fi allow_undefined_flag_CXX=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $rm conftest* { echo "$as_me:$LINENO: result: $archive_cmds_need_lc_CXX" >&5 echo "${ECHO_T}$archive_cmds_need_lc_CXX" >&6; } ;; esac fi ;; esac { echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; } 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" if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. 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 else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix4* | aix5*) version_type=linux need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$host_os in yes,cygwin* | yes,mingw* | yes,pw32*) 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' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $rm \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" ;; mingw*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH printed by # mingw gcc, but we are running on Cygwin. Gcc prints its search # path with ; separators, and with drive letters. We can handle the # drive letters (cygwin fileutils understands them), so leave them, # especially as we might pass files found there to a mingw objdump, # which wouldn't understand a cygwinified path. Ahh. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; esac ;; *) library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' ;; esac dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${versuffix}$shared_ext ${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`' # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` else sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' fi sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd1*) dynamic_linker=no ;; kfreebsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='GNU ld.so' ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[123]*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; freebsd*) # from 4.6 on shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555. postinstall_cmds='chmod 555 $lib' ;; interix3*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be Linux ELF. linux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # 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)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; knetbsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='GNU ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; nto-qnx*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; 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" ;; solaris*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no export_dynamic_flag_spec='${wl}-Blargedynsym' runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' shlibpath_overrides_runpath=no else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' shlibpath_overrides_runpath=yes case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; uts4*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac { echo "$as_me:$LINENO: result: $dynamic_linker" >&5 echo "${ECHO_T}$dynamic_linker" >&6; } test "$dynamic_linker" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi { echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6; } hardcode_action_CXX= if test -n "$hardcode_libdir_flag_spec_CXX" || \ test -n "$runpath_var_CXX" || \ test "X$hardcode_automatic_CXX" = "Xyes" ; then # We can hardcode non-existant directories. if test "$hardcode_direct_CXX" != 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_AC_TAGVAR(hardcode_shlibpath_var, CXX)" != no && test "$hardcode_minus_L_CXX" != no; then # Linking always hardcodes the temporary library directory. hardcode_action_CXX=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action_CXX=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action_CXX=unsupported fi { echo "$as_me:$LINENO: result: $hardcode_action_CXX" >&5 echo "${ECHO_T}$hardcode_action_CXX" >&6; } if test "$hardcode_action_CXX" = relink; 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 # The else clause should only fire when bootstrapping the # libtool distribution, otherwise you forgot to ship ltmain.sh # with your package, and you will get complaints that there are # no rules to generate ltmain.sh. if test -f "$ltmain"; then # 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 # Now quote all the things that may contain metacharacters while being # careful not to overquote the AC_SUBSTed values. We take copies of the # variables and quote the copies for generation of the libtool script. for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \ SED SHELL STRIP \ libname_spec library_names_spec soname_spec extract_expsyms_cmds \ old_striplib striplib file_magic_cmd finish_cmds finish_eval \ deplibs_check_method reload_flag reload_cmds need_locks \ lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ old_postinstall_cmds old_postuninstall_cmds \ compiler_CXX \ CC_CXX \ LD_CXX \ lt_prog_compiler_wl_CXX \ lt_prog_compiler_pic_CXX \ lt_prog_compiler_static_CXX \ lt_prog_compiler_no_builtin_flag_CXX \ export_dynamic_flag_spec_CXX \ thread_safe_flag_spec_CXX \ whole_archive_flag_spec_CXX \ enable_shared_with_static_runtimes_CXX \ old_archive_cmds_CXX \ old_archive_from_new_cmds_CXX \ predep_objects_CXX \ postdep_objects_CXX \ predeps_CXX \ postdeps_CXX \ compiler_lib_search_path_CXX \ archive_cmds_CXX \ archive_expsym_cmds_CXX \ postinstall_cmds_CXX \ postuninstall_cmds_CXX \ old_archive_from_expsyms_cmds_CXX \ allow_undefined_flag_CXX \ no_undefined_flag_CXX \ export_symbols_cmds_CXX \ hardcode_libdir_flag_spec_CXX \ hardcode_libdir_flag_spec_ld_CXX \ hardcode_libdir_separator_CXX \ hardcode_automatic_CXX \ module_cmds_CXX \ module_expsym_cmds_CXX \ lt_cv_prog_compiler_c_o_CXX \ exclude_expsyms_CXX \ include_expsyms_CXX; do case $var in old_archive_cmds_CXX | \ old_archive_from_new_cmds_CXX | \ archive_cmds_CXX | \ archive_expsym_cmds_CXX | \ module_cmds_CXX | \ module_expsym_cmds_CXX | \ old_archive_from_expsyms_cmds_CXX | \ export_symbols_cmds_CXX | \ extract_expsyms_cmds | reload_cmds | finish_cmds | \ postinstall_cmds | postuninstall_cmds | \ old_postinstall_cmds | old_postuninstall_cmds | \ sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) # Double-quote double-evaled strings. eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" ;; *) eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" ;; esac done case $lt_echo in *'\$0 --fallback-echo"') lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` ;; esac cfgfile="$ofile" cat <<__EOF__ >> "$cfgfile" # ### BEGIN LIBTOOL TAG CONFIG: $tagname # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc_CXX # Whether or not to disallow shared libs when runtime libs are static allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_CXX # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # An echo program that does not interpret backslashes. echo=$lt_echo # The archiver. AR=$lt_AR AR_FLAGS=$lt_AR_FLAGS # A C compiler. LTCC=$lt_LTCC # LTCC compiler flags. LTCFLAGS=$lt_LTCFLAGS # A language-specific compiler. CC=$lt_compiler_CXX # Is the compiler the GNU C compiler? with_gcc=$GCC_CXX # An ERE matcher. EGREP=$lt_EGREP # The linker used to build libraries. LD=$lt_LD_CXX # Whether we need hard or soft links. LN_S=$lt_LN_S # A BSD-compatible nm program. NM=$lt_NM # A symbol stripping program STRIP=$lt_STRIP # Used to examine libraries when file_magic_cmd begins "file" MAGIC_CMD=$MAGIC_CMD # Used on cygwin: DLL creation program. DLLTOOL="$DLLTOOL" # Used on cygwin: object dumper. OBJDUMP="$OBJDUMP" # Used on cygwin: assembler. AS="$AS" # The name of the directory that contains temporary libtool files. objdir=$objdir # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl_CXX # Object file suffix (normally "o"). objext="$ac_objext" # Old archive suffix (normally "a"). libext="$libext" # Shared library suffix (normally ".so"). shrext_cmds='$shrext_cmds' # Executable file suffix (normally ""). exeext="$exeext" # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic_CXX pic_mode=$pic_mode # What is the maximum length of a command? max_cmd_len=$lt_cv_sys_max_cmd_len # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX # Must we lock files when doing compilation? need_locks=$lt_need_locks # 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 # 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 # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static_CXX # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_CXX # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec_CXX # Compiler flag to generate thread-safe objects. thread_safe_flag_spec=$lt_thread_safe_flag_spec_CXX # Library versioning type. version_type=$version_type # 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 # Commands used to build and install an old-style archive. RANLIB=$lt_RANLIB old_archive_cmds=$lt_old_archive_cmds_CXX old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_CXX # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_CXX # Commands used to build and install a shared archive. archive_cmds=$lt_archive_cmds_CXX archive_expsym_cmds=$lt_archive_expsym_cmds_CXX postinstall_cmds=$lt_postinstall_cmds postuninstall_cmds=$lt_postuninstall_cmds # Commands used to build a loadable module (assumed same as above if empty) module_cmds=$lt_module_cmds_CXX module_expsym_cmds=$lt_module_expsym_cmds_CXX # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # Dependencies to place before the objects being linked to create a # shared library. predep_objects=$lt_predep_objects_CXX # Dependencies to place after the objects being linked to create a # shared library. postdep_objects=$lt_postdep_objects_CXX # Dependencies to place before the objects being linked to create a # shared library. predeps=$lt_predeps_CXX # Dependencies to place after the objects being linked to create a # shared library. postdeps=$lt_postdeps_CXX # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path_CXX # 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 # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag_CXX # Flag that forces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag_CXX # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # Same as above, but a single script fragment to be evaled but not shown. finish_eval=$lt_finish_eval # 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 # This is the shared library runtime path variable. runpath_var=$runpath_var # This is the shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action_CXX # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # 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_CXX # If ld is used when linking, flag to hardcode \$libdir into # a binary during linking. This must work even if \$libdir does # not exist. hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_CXX # Whether we need a single -rpath flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX # Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the # resulting binary. hardcode_direct=$hardcode_direct_CXX # Set to yes if using the -LDIR flag during linking hardcodes DIR into the # resulting binary. hardcode_minus_L=$hardcode_minus_L_CXX # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into # the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var_CXX # 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_CXX # Variables whose values should be saved in libtool wrapper scripts and # restored at relink time. variables_saved_for_relink="$variables_saved_for_relink" # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs_CXX # 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 # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path="$fix_srcfile_path_CXX" # Set to yes if exported symbols are required. always_export_symbols=$always_export_symbols_CXX # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds_CXX # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms_CXX # Symbols that must always be exported. include_expsyms=$lt_include_expsyms_CXX # ### END LIBTOOL TAG CONFIG: $tagname __EOF__ else # If there is no Makefile yet, we rely on a make rule to execute # `config.status --recheck' to rerun these tests and create the # libtool script then. ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` if test -f "$ltmain_in"; then test -f Makefile && make "$ltmain" fi 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 LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC with_gnu_ldcxx=$with_gnu_ld 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 else tagname="" fi ;; F77) if test -n "$F77" && test "X$F77" != "Xno"; then ac_ext=f ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5' ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_f77_compiler_gnu archive_cmds_need_lc_F77=no allow_undefined_flag_F77= always_export_symbols_F77=no archive_expsym_cmds_F77= export_dynamic_flag_spec_F77= hardcode_direct_F77=no hardcode_libdir_flag_spec_F77= hardcode_libdir_flag_spec_ld_F77= hardcode_libdir_separator_F77= hardcode_minus_L_F77=no hardcode_automatic_F77=no module_cmds_F77= module_expsym_cmds_F77= link_all_deplibs_F77=unknown old_archive_cmds_F77=$old_archive_cmds no_undefined_flag_F77= whole_archive_flag_spec_F77= enable_shared_with_static_runtimes_F77=no # Source file extension for f77 test sources. ac_ext=f # Object file extension for compiled f77 test sources. objext=o objext_F77=$objext # Code to be used in simple compile tests lt_simple_compile_test_code=" subroutine t\n return\n end\n" # Code to be used in simple link tests lt_simple_link_test_code=" program t\n end\n" # ltmain only uses $CC for tagged configurations so make sure $CC is set. # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $rm conftest* ac_outfile=conftest.$ac_objext printf "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $rm conftest* # Allow CC to be a program name with arguments. lt_save_CC="$CC" CC=${F77-"f77"} compiler=$CC compiler_F77=$CC for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` { echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5 echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6; } { echo "$as_me:$LINENO: result: $can_build_shared" >&5 echo "${ECHO_T}$can_build_shared" >&6; } { echo "$as_me:$LINENO: checking whether to build shared libraries" >&5 echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&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 ;; aix4* | aix5*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac { echo "$as_me:$LINENO: result: $enable_shared" >&5 echo "${ECHO_T}$enable_shared" >&6; } { echo "$as_me:$LINENO: checking whether to build static libraries" >&5 echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6; } # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes { echo "$as_me:$LINENO: result: $enable_static" >&5 echo "${ECHO_T}$enable_static" >&6; } GCC_F77="$G77" LD_F77="$LD" lt_prog_compiler_wl_F77= lt_prog_compiler_pic_F77= lt_prog_compiler_static_F77= { echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; } if test "$GCC" = yes; then lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_static_F77='-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_F77='-Bstatic' fi ;; amigaos*) # 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_F77='-m68020 -resident32 -malways-restore-a4' ;; beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | pw32* | os2*) # 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_F77='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic_F77='-fno-common' ;; interix3*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. lt_prog_compiler_can_build_shared_F77=no enable_shared=no ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic_F77=-Kconform_pic fi ;; hpux*) # 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_F77='-fPIC' ;; esac ;; *) lt_prog_compiler_pic_F77='-fPIC' ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) lt_prog_compiler_wl_F77='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_F77='-Bstatic' else lt_prog_compiler_static_F77='-bnso -bI:/lib/syscalls.exp' fi ;; darwin*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files case $cc_basename in xlc*) lt_prog_compiler_pic_F77='-qnocommon' lt_prog_compiler_wl_F77='-Wl,' ;; esac ;; mingw* | pw32* | os2*) # 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_F77='-DDLL_EXPORT' ;; hpux9* | hpux10* | hpux11*) lt_prog_compiler_wl_F77='-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_F77='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? lt_prog_compiler_static_F77='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) lt_prog_compiler_wl_F77='-Wl,' # PIC (with -KPIC) is the default. lt_prog_compiler_static_F77='-non_shared' ;; newsos6) lt_prog_compiler_pic_F77='-KPIC' lt_prog_compiler_static_F77='-Bstatic' ;; linux*) case $cc_basename in icc* | ecc*) lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_pic_F77='-KPIC' lt_prog_compiler_static_F77='-static' ;; pgcc* | pgf77* | pgf90* | pgf95*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_pic_F77='-fpic' lt_prog_compiler_static_F77='-Bstatic' ;; ccc*) lt_prog_compiler_wl_F77='-Wl,' # All Alpha code is PIC. lt_prog_compiler_static_F77='-non_shared' ;; esac ;; osf3* | osf4* | osf5*) lt_prog_compiler_wl_F77='-Wl,' # All OSF/1 code is PIC. lt_prog_compiler_static_F77='-non_shared' ;; solaris*) lt_prog_compiler_pic_F77='-KPIC' lt_prog_compiler_static_F77='-Bstatic' case $cc_basename in f77* | f90* | f95*) lt_prog_compiler_wl_F77='-Qoption ld ';; *) lt_prog_compiler_wl_F77='-Wl,';; esac ;; sunos4*) lt_prog_compiler_wl_F77='-Qoption ld ' lt_prog_compiler_pic_F77='-PIC' lt_prog_compiler_static_F77='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_pic_F77='-KPIC' lt_prog_compiler_static_F77='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then lt_prog_compiler_pic_F77='-Kconform_pic' lt_prog_compiler_static_F77='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_pic_F77='-KPIC' lt_prog_compiler_static_F77='-Bstatic' ;; unicos*) lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_can_build_shared_F77=no ;; uts4*) lt_prog_compiler_pic_F77='-pic' lt_prog_compiler_static_F77='-Bstatic' ;; *) lt_prog_compiler_can_build_shared_F77=no ;; esac fi { echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_F77" >&5 echo "${ECHO_T}$lt_prog_compiler_pic_F77" >&6; } # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic_F77"; then { echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works" >&5 echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works... $ECHO_C" >&6; } if test "${lt_prog_compiler_pic_works_F77+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_prog_compiler_pic_works_F77=no ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic_F77" # 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:14514: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:14518: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_prog_compiler_pic_works_F77=yes fi fi $rm conftest* fi { echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_F77" >&5 echo "${ECHO_T}$lt_prog_compiler_pic_works_F77" >&6; } if test x"$lt_prog_compiler_pic_works_F77" = xyes; then case $lt_prog_compiler_pic_F77 in "" | " "*) ;; *) lt_prog_compiler_pic_F77=" $lt_prog_compiler_pic_F77" ;; esac else lt_prog_compiler_pic_F77= lt_prog_compiler_can_build_shared_F77=no fi fi case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic_F77= ;; *) lt_prog_compiler_pic_F77="$lt_prog_compiler_pic_F77" ;; esac # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl_F77 eval lt_tmp_static_flag=\"$lt_prog_compiler_static_F77\" { echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6; } if test "${lt_prog_compiler_static_works_F77+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_prog_compiler_static_works_F77=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $lt_tmp_static_flag" printf "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_prog_compiler_static_works_F77=yes fi else lt_prog_compiler_static_works_F77=yes fi fi $rm conftest* LDFLAGS="$save_LDFLAGS" fi { echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works_F77" >&5 echo "${ECHO_T}$lt_prog_compiler_static_works_F77" >&6; } if test x"$lt_prog_compiler_static_works_F77" = xyes; then : else lt_prog_compiler_static_F77= fi { echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6; } if test "${lt_cv_prog_compiler_c_o_F77+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_c_o_F77=no $rm -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out printf "$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:14618: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:14622: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o_F77=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 .. rmdir conftest $rm conftest* fi { echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_F77" >&5 echo "${ECHO_T}$lt_cv_prog_compiler_c_o_F77" >&6; } hard_links="nottested" if test "$lt_cv_prog_compiler_c_o_F77" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user { echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&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 { echo "$as_me:$LINENO: result: $hard_links" >&5 echo "${ECHO_T}$hard_links" >&6; } if test "$hard_links" = no; then { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 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 { echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; } runpath_var= allow_undefined_flag_F77= enable_shared_with_static_runtimes_F77=no archive_cmds_F77= archive_expsym_cmds_F77= old_archive_From_new_cmds_F77= old_archive_from_expsyms_cmds_F77= export_dynamic_flag_spec_F77= whole_archive_flag_spec_F77= thread_safe_flag_spec_F77= hardcode_libdir_flag_spec_F77= hardcode_libdir_flag_spec_ld_F77= hardcode_libdir_separator_F77= hardcode_direct_F77=no hardcode_minus_L_F77=no hardcode_shlibpath_var_F77=unsupported link_all_deplibs_F77=unknown hardcode_automatic_F77=no module_cmds_F77= module_expsym_cmds_F77= always_export_symbols_F77=no export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list include_expsyms_F77= # 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_F77="_GLOBAL_OFFSET_TABLE_" # 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. extract_expsyms_cmds= # Just being paranoid about ensuring that cc_basename is set. for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` case $host_os in cygwin* | mingw* | pw32*) # 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_F77=yes if test "$with_gnu_ld" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec_F77='${wl}--rpath ${wl}$libdir' export_dynamic_flag_spec_F77='${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_F77="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec_F77= fi supports_anon_versioning=no case `$LD -v 2>/dev/null` in *\ [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 aix3* | aix4* | aix5*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then ld_shlibs_F77=no cat <&2 *** Warning: the GNU linker, at least up to release 2.9.1, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to modify your PATH *** so that a non-GNU linker is found, and then restart. EOF fi ;; amigaos*) archive_cmds_F77='$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_F77='-L$libdir' hardcode_minus_L_F77=yes # Samuel A. Falvo II reports # that the semantics of dynamic libraries on AmigaOS, at least up # to version 4, is to share data among multiple programs linked # with the same dynamic library. Since this doesn't match the # behavior of shared libraries on other platforms, we can't use # them. ld_shlibs_F77=no ;; beos*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then allow_undefined_flag_F77=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds_F77='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else ld_shlibs_F77=no fi ;; cygwin* | mingw* | pw32*) # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, F77) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec_F77='-L$libdir' allow_undefined_flag_F77=unsupported always_export_symbols_F77=no enable_shared_with_static_runtimes_F77=yes export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... archive_expsym_cmds_F77='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then 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_F77=no fi ;; interix3*) hardcode_direct_F77=no hardcode_shlibpath_var_F77=no hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir' export_dynamic_flag_spec_F77='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds_F77='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' archive_expsym_cmds_F77='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; linux*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then tmp_addflag= case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler whole_archive_flag_spec_F77='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers whole_archive_flag_spec_F77='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; esac archive_cmds_F77='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test $supports_anon_versioning = yes; then archive_expsym_cmds_F77='$echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ $echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi else ld_shlibs_F77=no fi ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds_F77='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then ld_shlibs_F77=no cat <&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. EOF elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs_F77=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) ld_shlibs_F77=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then hardcode_libdir_flag_spec_F77='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib' archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib' else ld_shlibs_F77=no fi ;; esac ;; sunos4*) archive_cmds_F77='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= hardcode_direct_F77=yes hardcode_shlibpath_var_F77=no ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs_F77=no fi ;; esac if test "$ld_shlibs_F77" = no; then runpath_var= hardcode_libdir_flag_spec_F77= export_dynamic_flag_spec_F77= whole_archive_flag_spec_F77= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) allow_undefined_flag_F77=unsupported always_export_symbols_F77=yes archive_expsym_cmds_F77='$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_F77=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_F77=unsupported fi ;; aix4* | aix5*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | grep 'GNU' > /dev/null; then export_symbols_cmds_F77='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds_F77='$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].*|aix5*) 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_F77='' hardcode_direct_F77=yes hardcode_libdir_separator_F77=':' link_all_deplibs_F77=yes 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 hardcode_direct_F77=yes else # We have old collect2 hardcode_direct_F77=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_F77=yes hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_libdir_separator_F77= 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 # 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_F77=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_F77='-berok' # Determine the default libpath from the value encoded in an empty executable. cat >conftest.$ac_ext <<_ACEOF program main end _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_f77_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec_F77='${wl}-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds_F77="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec_F77='${wl}-R $libdir:/usr/lib:/lib' allow_undefined_flag_F77="-z nodefs" archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an empty executable. cat >conftest.$ac_ext <<_ACEOF program main end _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_f77_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec_F77='${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_F77=' ${wl}-bernotok' allow_undefined_flag_F77=' ${wl}-berok' # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec_F77='$convenience' archive_cmds_need_lc_F77=yes # This is similar to how AIX traditionally builds its shared libraries. archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${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*) archive_cmds_F77='$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_F77='-L$libdir' hardcode_minus_L_F77=yes # see comment about different semantics on the GNU ld section ld_shlibs_F77=no ;; bsdi[45]*) export_dynamic_flag_spec_F77=-rdynamic ;; cygwin* | mingw* | pw32*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec_F77=' ' allow_undefined_flag_F77=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_F77='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_From_new_cmds_F77='true' # FIXME: Should let the user specify the lib program. old_archive_cmds_F77='lib /OUT:$oldlib$oldobjs$old_deplibs' fix_srcfile_path_F77='`cygpath -w "$srcfile"`' enable_shared_with_static_runtimes_F77=yes ;; darwin* | rhapsody*) case $host_os in rhapsody* | darwin1.[012]) allow_undefined_flag_F77='${wl}-undefined ${wl}suppress' ;; *) # Darwin 1.3 on if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then allow_undefined_flag_F77='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' else case ${MACOSX_DEPLOYMENT_TARGET} in 10.[012]) allow_undefined_flag_F77='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) allow_undefined_flag_F77='${wl}-undefined ${wl}dynamic_lookup' ;; esac fi ;; esac archive_cmds_need_lc_F77=no hardcode_direct_F77=no hardcode_automatic_F77=yes hardcode_shlibpath_var_F77=unsupported whole_archive_flag_spec_F77='' link_all_deplibs_F77=yes if test "$GCC" = yes ; then output_verbose_link_cmd='echo' archive_cmds_F77='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' module_cmds_F77='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' module_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else case $cc_basename in xlc*) output_verbose_link_cmd='echo' archive_cmds_F77='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' module_cmds_F77='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' module_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' ;; *) ld_shlibs_F77=no ;; esac fi ;; dgux*) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_shlibpath_var_F77=no ;; freebsd1*) ld_shlibs_F77=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_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' hardcode_libdir_flag_spec_F77='-R$libdir' hardcode_direct_F77=yes hardcode_shlibpath_var_F77=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2*) archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_F77=yes hardcode_minus_L_F77=yes hardcode_shlibpath_var_F77=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | kfreebsd*-gnu | dragonfly*) archive_cmds_F77='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec_F77='-R$libdir' hardcode_direct_F77=yes hardcode_shlibpath_var_F77=no ;; hpux9*) if test "$GCC" = yes; then archive_cmds_F77='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else archive_cmds_F77='$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_F77='${wl}+b ${wl}$libdir' hardcode_libdir_separator_F77=: hardcode_direct_F77=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L_F77=yes export_dynamic_flag_spec_F77='${wl}-E' ;; hpux10*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then archive_cmds_F77='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_F77='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir' hardcode_libdir_separator_F77=: hardcode_direct_F77=yes export_dynamic_flag_spec_F77='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L_F77=yes fi ;; hpux11*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) archive_cmds_F77='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds_F77='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds_F77='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) archive_cmds_F77='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds_F77='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds_F77='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir' hardcode_libdir_separator_F77=: case $host_cpu in hppa*64*|ia64*) hardcode_libdir_flag_spec_ld_F77='+b $libdir' hardcode_direct_F77=no hardcode_shlibpath_var_F77=no ;; *) hardcode_direct_F77=yes export_dynamic_flag_spec_F77='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L_F77=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else archive_cmds_F77='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_ld_F77='-rpath $libdir' fi hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_F77=: link_all_deplibs_F77=yes ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else archive_cmds_F77='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi hardcode_libdir_flag_spec_F77='-R$libdir' hardcode_direct_F77=yes hardcode_shlibpath_var_F77=no ;; newsos6) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_F77=yes hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_F77=: hardcode_shlibpath_var_F77=no ;; openbsd*) hardcode_direct_F77=yes hardcode_shlibpath_var_F77=no if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir' export_dynamic_flag_spec_F77='${wl}-E' else case $host_os in openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec_F77='-R$libdir' ;; *) archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir' ;; esac fi ;; os2*) hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_minus_L_F77=yes allow_undefined_flag_F77=unsupported archive_cmds_F77='$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_F77='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_F77='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else allow_undefined_flag_F77=' -expect_unresolved \*' archive_cmds_F77='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' fi hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_F77=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_F77='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' else allow_undefined_flag_F77=' -expect_unresolved \*' archive_cmds_F77='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds_F77='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ $LD -shared${allow_undefined_flag} -input $lib.exp $linker_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_F77='-rpath $libdir' fi hardcode_libdir_separator_F77=: ;; solaris*) no_undefined_flag_F77=' -z text' if test "$GCC" = yes; then wlarc='${wl}' archive_cmds_F77='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' else wlarc='' archive_cmds_F77='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' fi hardcode_libdir_flag_spec_F77='-R$libdir' hardcode_shlibpath_var_F77=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The compiler driver will combine linker options so we # cannot just pass the convience library names through # without $wl, iff we do not link with $LD. # Luckily, gcc supports the same syntax we need for Sun Studio. # Supported since Solaris 2.6 (maybe 2.5.1?) case $wlarc in '') whole_archive_flag_spec_F77='-z allextract$convenience -z defaultextract' ;; *) whole_archive_flag_spec_F77='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; esac ;; esac link_all_deplibs_F77=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_F77='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_F77='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_direct_F77=yes hardcode_minus_L_F77=yes hardcode_shlibpath_var_F77=no ;; sysv4) case $host_vendor in sni) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_F77=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. archive_cmds_F77='$LD -G -o $lib $libobjs $deplibs $linker_flags' reload_cmds_F77='$CC -r -o $output$reload_objs' hardcode_direct_F77=no ;; motorola) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_F77=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' hardcode_shlibpath_var_F77=no ;; sysv4.3*) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var_F77=no export_dynamic_flag_spec_F77='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var_F77=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ld_shlibs_F77=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7*) no_undefined_flag_F77='${wl}-z,text' archive_cmds_need_lc_F77=no hardcode_shlibpath_var_F77=no runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds_F77='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_F77='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_F77='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_F77='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. no_undefined_flag_F77='${wl}-z,text' allow_undefined_flag_F77='${wl}-z,nodefs' archive_cmds_need_lc_F77=no hardcode_shlibpath_var_F77=no hardcode_libdir_flag_spec_F77='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' hardcode_libdir_separator_F77=':' link_all_deplibs_F77=yes export_dynamic_flag_spec_F77='${wl}-Bexport' runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds_F77='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_F77='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_F77='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_F77='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_shlibpath_var_F77=no ;; *) ld_shlibs_F77=no ;; esac fi { echo "$as_me:$LINENO: result: $ld_shlibs_F77" >&5 echo "${ECHO_T}$ld_shlibs_F77" >&6; } test "$ld_shlibs_F77" = no && can_build_shared=no # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc_F77" in x|xyes) # Assume -lc should be added archive_cmds_need_lc_F77=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $archive_cmds_F77 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. { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; } $rm conftest* printf "$lt_simple_compile_test_code" > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl_F77 pic_flag=$lt_prog_compiler_pic_F77 compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag_F77 allow_undefined_flag_F77= if { (eval echo "$as_me:$LINENO: \"$archive_cmds_F77 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 (eval $archive_cmds_F77 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } then archive_cmds_need_lc_F77=no else archive_cmds_need_lc_F77=yes fi allow_undefined_flag_F77=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $rm conftest* { echo "$as_me:$LINENO: result: $archive_cmds_need_lc_F77" >&5 echo "${ECHO_T}$archive_cmds_need_lc_F77" >&6; } ;; esac fi ;; esac { echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; } 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" if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. 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 else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix4* | aix5*) version_type=linux need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$host_os in yes,cygwin* | yes,mingw* | yes,pw32*) 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' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $rm \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" ;; mingw*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH printed by # mingw gcc, but we are running on Cygwin. Gcc prints its search # path with ; separators, and with drive letters. We can handle the # drive letters (cygwin fileutils understands them), so leave them, # especially as we might pass files found there to a mingw objdump, # which wouldn't understand a cygwinified path. Ahh. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; esac ;; *) library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' ;; esac dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${versuffix}$shared_ext ${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`' # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` else sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' fi sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd1*) dynamic_linker=no ;; kfreebsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='GNU ld.so' ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[123]*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; freebsd*) # from 4.6 on shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555. postinstall_cmds='chmod 555 $lib' ;; interix3*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be Linux ELF. linux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # 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)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; knetbsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='GNU ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; nto-qnx*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; 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" ;; solaris*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no export_dynamic_flag_spec='${wl}-Blargedynsym' runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' shlibpath_overrides_runpath=no else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' shlibpath_overrides_runpath=yes case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; uts4*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac { echo "$as_me:$LINENO: result: $dynamic_linker" >&5 echo "${ECHO_T}$dynamic_linker" >&6; } test "$dynamic_linker" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi { echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6; } hardcode_action_F77= if test -n "$hardcode_libdir_flag_spec_F77" || \ test -n "$runpath_var_F77" || \ test "X$hardcode_automatic_F77" = "Xyes" ; then # We can hardcode non-existant directories. if test "$hardcode_direct_F77" != 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_AC_TAGVAR(hardcode_shlibpath_var, F77)" != no && test "$hardcode_minus_L_F77" != no; then # Linking always hardcodes the temporary library directory. hardcode_action_F77=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action_F77=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action_F77=unsupported fi { echo "$as_me:$LINENO: result: $hardcode_action_F77" >&5 echo "${ECHO_T}$hardcode_action_F77" >&6; } if test "$hardcode_action_F77" = relink; 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 # The else clause should only fire when bootstrapping the # libtool distribution, otherwise you forgot to ship ltmain.sh # with your package, and you will get complaints that there are # no rules to generate ltmain.sh. if test -f "$ltmain"; then # 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 # Now quote all the things that may contain metacharacters while being # careful not to overquote the AC_SUBSTed values. We take copies of the # variables and quote the copies for generation of the libtool script. for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \ SED SHELL STRIP \ libname_spec library_names_spec soname_spec extract_expsyms_cmds \ old_striplib striplib file_magic_cmd finish_cmds finish_eval \ deplibs_check_method reload_flag reload_cmds need_locks \ lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ old_postinstall_cmds old_postuninstall_cmds \ compiler_F77 \ CC_F77 \ LD_F77 \ lt_prog_compiler_wl_F77 \ lt_prog_compiler_pic_F77 \ lt_prog_compiler_static_F77 \ lt_prog_compiler_no_builtin_flag_F77 \ export_dynamic_flag_spec_F77 \ thread_safe_flag_spec_F77 \ whole_archive_flag_spec_F77 \ enable_shared_with_static_runtimes_F77 \ old_archive_cmds_F77 \ old_archive_from_new_cmds_F77 \ predep_objects_F77 \ postdep_objects_F77 \ predeps_F77 \ postdeps_F77 \ compiler_lib_search_path_F77 \ archive_cmds_F77 \ archive_expsym_cmds_F77 \ postinstall_cmds_F77 \ postuninstall_cmds_F77 \ old_archive_from_expsyms_cmds_F77 \ allow_undefined_flag_F77 \ no_undefined_flag_F77 \ export_symbols_cmds_F77 \ hardcode_libdir_flag_spec_F77 \ hardcode_libdir_flag_spec_ld_F77 \ hardcode_libdir_separator_F77 \ hardcode_automatic_F77 \ module_cmds_F77 \ module_expsym_cmds_F77 \ lt_cv_prog_compiler_c_o_F77 \ exclude_expsyms_F77 \ include_expsyms_F77; do case $var in old_archive_cmds_F77 | \ old_archive_from_new_cmds_F77 | \ archive_cmds_F77 | \ archive_expsym_cmds_F77 | \ module_cmds_F77 | \ module_expsym_cmds_F77 | \ old_archive_from_expsyms_cmds_F77 | \ export_symbols_cmds_F77 | \ extract_expsyms_cmds | reload_cmds | finish_cmds | \ postinstall_cmds | postuninstall_cmds | \ old_postinstall_cmds | old_postuninstall_cmds | \ sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) # Double-quote double-evaled strings. eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" ;; *) eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" ;; esac done case $lt_echo in *'\$0 --fallback-echo"') lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` ;; esac cfgfile="$ofile" cat <<__EOF__ >> "$cfgfile" # ### BEGIN LIBTOOL TAG CONFIG: $tagname # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc_F77 # Whether or not to disallow shared libs when runtime libs are static allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_F77 # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # An echo program that does not interpret backslashes. echo=$lt_echo # The archiver. AR=$lt_AR AR_FLAGS=$lt_AR_FLAGS # A C compiler. LTCC=$lt_LTCC # LTCC compiler flags. LTCFLAGS=$lt_LTCFLAGS # A language-specific compiler. CC=$lt_compiler_F77 # Is the compiler the GNU C compiler? with_gcc=$GCC_F77 # An ERE matcher. EGREP=$lt_EGREP # The linker used to build libraries. LD=$lt_LD_F77 # Whether we need hard or soft links. LN_S=$lt_LN_S # A BSD-compatible nm program. NM=$lt_NM # A symbol stripping program STRIP=$lt_STRIP # Used to examine libraries when file_magic_cmd begins "file" MAGIC_CMD=$MAGIC_CMD # Used on cygwin: DLL creation program. DLLTOOL="$DLLTOOL" # Used on cygwin: object dumper. OBJDUMP="$OBJDUMP" # Used on cygwin: assembler. AS="$AS" # The name of the directory that contains temporary libtool files. objdir=$objdir # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl_F77 # Object file suffix (normally "o"). objext="$ac_objext" # Old archive suffix (normally "a"). libext="$libext" # Shared library suffix (normally ".so"). shrext_cmds='$shrext_cmds' # Executable file suffix (normally ""). exeext="$exeext" # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic_F77 pic_mode=$pic_mode # What is the maximum length of a command? max_cmd_len=$lt_cv_sys_max_cmd_len # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o_F77 # Must we lock files when doing compilation? need_locks=$lt_need_locks # 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 # 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 # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static_F77 # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_F77 # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_F77 # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec_F77 # Compiler flag to generate thread-safe objects. thread_safe_flag_spec=$lt_thread_safe_flag_spec_F77 # Library versioning type. version_type=$version_type # 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 # Commands used to build and install an old-style archive. RANLIB=$lt_RANLIB old_archive_cmds=$lt_old_archive_cmds_F77 old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_F77 # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_F77 # Commands used to build and install a shared archive. archive_cmds=$lt_archive_cmds_F77 archive_expsym_cmds=$lt_archive_expsym_cmds_F77 postinstall_cmds=$lt_postinstall_cmds postuninstall_cmds=$lt_postuninstall_cmds # Commands used to build a loadable module (assumed same as above if empty) module_cmds=$lt_module_cmds_F77 module_expsym_cmds=$lt_module_expsym_cmds_F77 # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # Dependencies to place before the objects being linked to create a # shared library. predep_objects=$lt_predep_objects_F77 # Dependencies to place after the objects being linked to create a # shared library. postdep_objects=$lt_postdep_objects_F77 # Dependencies to place before the objects being linked to create a # shared library. predeps=$lt_predeps_F77 # Dependencies to place after the objects being linked to create a # shared library. postdeps=$lt_postdeps_F77 # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path_F77 # 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 # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag_F77 # Flag that forces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag_F77 # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # Same as above, but a single script fragment to be evaled but not shown. finish_eval=$lt_finish_eval # 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 # This is the shared library runtime path variable. runpath_var=$runpath_var # This is the shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action_F77 # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # 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_F77 # If ld is used when linking, flag to hardcode \$libdir into # a binary during linking. This must work even if \$libdir does # not exist. hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_F77 # Whether we need a single -rpath flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator_F77 # Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the # resulting binary. hardcode_direct=$hardcode_direct_F77 # Set to yes if using the -LDIR flag during linking hardcodes DIR into the # resulting binary. hardcode_minus_L=$hardcode_minus_L_F77 # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into # the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var_F77 # 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_F77 # Variables whose values should be saved in libtool wrapper scripts and # restored at relink time. variables_saved_for_relink="$variables_saved_for_relink" # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs_F77 # 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 # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path="$fix_srcfile_path_F77" # Set to yes if exported symbols are required. always_export_symbols=$always_export_symbols_F77 # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds_F77 # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms_F77 # Symbols that must always be exported. include_expsyms=$lt_include_expsyms_F77 # ### END LIBTOOL TAG CONFIG: $tagname __EOF__ else # If there is no Makefile yet, we rely on a make rule to execute # `config.status --recheck' to rerun these tests and create the # libtool script then. ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` if test -f "$ltmain_in"; then test -f Makefile && make "$ltmain" fi 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" else tagname="" fi ;; GCJ) if test -n "$GCJ" && test "X$GCJ" != "Xno"; then # Source file extension for Java test sources. ac_ext=java # Object file extension for compiled Java test sources. objext=o objext_GCJ=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="class foo {}\n" # Code to be used in simple link tests lt_simple_link_test_code='public class conftest { public static void main(String[] argv) {}; }\n' # ltmain only uses $CC for tagged configurations so make sure $CC is set. # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $rm conftest* ac_outfile=conftest.$ac_objext printf "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $rm conftest* # Allow CC to be a program name with arguments. lt_save_CC="$CC" CC=${GCJ-"gcj"} compiler=$CC compiler_GCJ=$CC for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` # GCJ did not exist at the time GCC didn't implicitly link libc in. archive_cmds_need_lc_GCJ=no old_archive_cmds_GCJ=$old_archive_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... lt_prog_compiler_no_builtin_flag_GCJ= if test "$GCC" = yes; then lt_prog_compiler_no_builtin_flag_GCJ=' -fno-builtin' { echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6; } if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_rtti_exceptions=no ac_outfile=conftest.$ac_objext printf "$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:16828: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:16832: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_rtti_exceptions=yes fi fi $rm conftest* fi { echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6; } if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then lt_prog_compiler_no_builtin_flag_GCJ="$lt_prog_compiler_no_builtin_flag_GCJ -fno-rtti -fno-exceptions" else : fi fi lt_prog_compiler_wl_GCJ= lt_prog_compiler_pic_GCJ= lt_prog_compiler_static_GCJ= { echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; } if test "$GCC" = yes; then lt_prog_compiler_wl_GCJ='-Wl,' lt_prog_compiler_static_GCJ='-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_GCJ='-Bstatic' fi ;; amigaos*) # 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_GCJ='-m68020 -resident32 -malways-restore-a4' ;; beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | pw32* | os2*) # 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_GCJ='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic_GCJ='-fno-common' ;; interix3*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. lt_prog_compiler_can_build_shared_GCJ=no enable_shared=no ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic_GCJ=-Kconform_pic fi ;; hpux*) # 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_GCJ='-fPIC' ;; esac ;; *) lt_prog_compiler_pic_GCJ='-fPIC' ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) lt_prog_compiler_wl_GCJ='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_GCJ='-Bstatic' else lt_prog_compiler_static_GCJ='-bnso -bI:/lib/syscalls.exp' fi ;; darwin*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files case $cc_basename in xlc*) lt_prog_compiler_pic_GCJ='-qnocommon' lt_prog_compiler_wl_GCJ='-Wl,' ;; esac ;; mingw* | pw32* | os2*) # 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_GCJ='-DDLL_EXPORT' ;; hpux9* | hpux10* | hpux11*) lt_prog_compiler_wl_GCJ='-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_GCJ='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? lt_prog_compiler_static_GCJ='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) lt_prog_compiler_wl_GCJ='-Wl,' # PIC (with -KPIC) is the default. lt_prog_compiler_static_GCJ='-non_shared' ;; newsos6) lt_prog_compiler_pic_GCJ='-KPIC' lt_prog_compiler_static_GCJ='-Bstatic' ;; linux*) case $cc_basename in icc* | ecc*) lt_prog_compiler_wl_GCJ='-Wl,' lt_prog_compiler_pic_GCJ='-KPIC' lt_prog_compiler_static_GCJ='-static' ;; pgcc* | pgf77* | pgf90* | pgf95*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) lt_prog_compiler_wl_GCJ='-Wl,' lt_prog_compiler_pic_GCJ='-fpic' lt_prog_compiler_static_GCJ='-Bstatic' ;; ccc*) lt_prog_compiler_wl_GCJ='-Wl,' # All Alpha code is PIC. lt_prog_compiler_static_GCJ='-non_shared' ;; esac ;; osf3* | osf4* | osf5*) lt_prog_compiler_wl_GCJ='-Wl,' # All OSF/1 code is PIC. lt_prog_compiler_static_GCJ='-non_shared' ;; solaris*) lt_prog_compiler_pic_GCJ='-KPIC' lt_prog_compiler_static_GCJ='-Bstatic' case $cc_basename in f77* | f90* | f95*) lt_prog_compiler_wl_GCJ='-Qoption ld ';; *) lt_prog_compiler_wl_GCJ='-Wl,';; esac ;; sunos4*) lt_prog_compiler_wl_GCJ='-Qoption ld ' lt_prog_compiler_pic_GCJ='-PIC' lt_prog_compiler_static_GCJ='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) lt_prog_compiler_wl_GCJ='-Wl,' lt_prog_compiler_pic_GCJ='-KPIC' lt_prog_compiler_static_GCJ='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then lt_prog_compiler_pic_GCJ='-Kconform_pic' lt_prog_compiler_static_GCJ='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) lt_prog_compiler_wl_GCJ='-Wl,' lt_prog_compiler_pic_GCJ='-KPIC' lt_prog_compiler_static_GCJ='-Bstatic' ;; unicos*) lt_prog_compiler_wl_GCJ='-Wl,' lt_prog_compiler_can_build_shared_GCJ=no ;; uts4*) lt_prog_compiler_pic_GCJ='-pic' lt_prog_compiler_static_GCJ='-Bstatic' ;; *) lt_prog_compiler_can_build_shared_GCJ=no ;; esac fi { echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_GCJ" >&5 echo "${ECHO_T}$lt_prog_compiler_pic_GCJ" >&6; } # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic_GCJ"; then { echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works" >&5 echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works... $ECHO_C" >&6; } if test "${lt_prog_compiler_pic_works_GCJ+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_prog_compiler_pic_works_GCJ=no ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic_GCJ" # 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:17096: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:17100: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_prog_compiler_pic_works_GCJ=yes fi fi $rm conftest* fi { echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_GCJ" >&5 echo "${ECHO_T}$lt_prog_compiler_pic_works_GCJ" >&6; } if test x"$lt_prog_compiler_pic_works_GCJ" = xyes; then case $lt_prog_compiler_pic_GCJ in "" | " "*) ;; *) lt_prog_compiler_pic_GCJ=" $lt_prog_compiler_pic_GCJ" ;; esac else lt_prog_compiler_pic_GCJ= lt_prog_compiler_can_build_shared_GCJ=no fi fi case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic_GCJ= ;; *) lt_prog_compiler_pic_GCJ="$lt_prog_compiler_pic_GCJ" ;; esac # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl_GCJ eval lt_tmp_static_flag=\"$lt_prog_compiler_static_GCJ\" { echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6; } if test "${lt_prog_compiler_static_works_GCJ+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_prog_compiler_static_works_GCJ=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $lt_tmp_static_flag" printf "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_prog_compiler_static_works_GCJ=yes fi else lt_prog_compiler_static_works_GCJ=yes fi fi $rm conftest* LDFLAGS="$save_LDFLAGS" fi { echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works_GCJ" >&5 echo "${ECHO_T}$lt_prog_compiler_static_works_GCJ" >&6; } if test x"$lt_prog_compiler_static_works_GCJ" = xyes; then : else lt_prog_compiler_static_GCJ= fi { echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6; } if test "${lt_cv_prog_compiler_c_o_GCJ+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_c_o_GCJ=no $rm -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out printf "$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:17200: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:17204: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o_GCJ=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 .. rmdir conftest $rm conftest* fi { echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_GCJ" >&5 echo "${ECHO_T}$lt_cv_prog_compiler_c_o_GCJ" >&6; } hard_links="nottested" if test "$lt_cv_prog_compiler_c_o_GCJ" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user { echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&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 { echo "$as_me:$LINENO: result: $hard_links" >&5 echo "${ECHO_T}$hard_links" >&6; } if test "$hard_links" = no; then { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 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 { echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; } runpath_var= allow_undefined_flag_GCJ= enable_shared_with_static_runtimes_GCJ=no archive_cmds_GCJ= archive_expsym_cmds_GCJ= old_archive_From_new_cmds_GCJ= old_archive_from_expsyms_cmds_GCJ= export_dynamic_flag_spec_GCJ= whole_archive_flag_spec_GCJ= thread_safe_flag_spec_GCJ= hardcode_libdir_flag_spec_GCJ= hardcode_libdir_flag_spec_ld_GCJ= hardcode_libdir_separator_GCJ= hardcode_direct_GCJ=no hardcode_minus_L_GCJ=no hardcode_shlibpath_var_GCJ=unsupported link_all_deplibs_GCJ=unknown hardcode_automatic_GCJ=no module_cmds_GCJ= module_expsym_cmds_GCJ= always_export_symbols_GCJ=no export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list include_expsyms_GCJ= # 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_GCJ="_GLOBAL_OFFSET_TABLE_" # 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. extract_expsyms_cmds= # Just being paranoid about ensuring that cc_basename is set. for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` case $host_os in cygwin* | mingw* | pw32*) # 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_GCJ=yes if test "$with_gnu_ld" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec_GCJ='${wl}--rpath ${wl}$libdir' export_dynamic_flag_spec_GCJ='${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_GCJ="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec_GCJ= fi supports_anon_versioning=no case `$LD -v 2>/dev/null` in *\ [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 aix3* | aix4* | aix5*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then ld_shlibs_GCJ=no cat <&2 *** Warning: the GNU linker, at least up to release 2.9.1, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to modify your PATH *** so that a non-GNU linker is found, and then restart. EOF fi ;; amigaos*) archive_cmds_GCJ='$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_GCJ='-L$libdir' hardcode_minus_L_GCJ=yes # Samuel A. Falvo II reports # that the semantics of dynamic libraries on AmigaOS, at least up # to version 4, is to share data among multiple programs linked # with the same dynamic library. Since this doesn't match the # behavior of shared libraries on other platforms, we can't use # them. ld_shlibs_GCJ=no ;; beos*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then allow_undefined_flag_GCJ=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds_GCJ='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else ld_shlibs_GCJ=no fi ;; cygwin* | mingw* | pw32*) # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, GCJ) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec_GCJ='-L$libdir' allow_undefined_flag_GCJ=unsupported always_export_symbols_GCJ=no enable_shared_with_static_runtimes_GCJ=yes export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... archive_expsym_cmds_GCJ='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then 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_GCJ=no fi ;; interix3*) hardcode_direct_GCJ=no hardcode_shlibpath_var_GCJ=no hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir' export_dynamic_flag_spec_GCJ='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds_GCJ='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' archive_expsym_cmds_GCJ='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; linux*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then tmp_addflag= case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler whole_archive_flag_spec_GCJ='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers whole_archive_flag_spec_GCJ='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; esac archive_cmds_GCJ='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test $supports_anon_versioning = yes; then archive_expsym_cmds_GCJ='$echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ $echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi else ld_shlibs_GCJ=no fi ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds_GCJ='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then ld_shlibs_GCJ=no cat <&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. EOF elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs_GCJ=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) ld_shlibs_GCJ=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then hardcode_libdir_flag_spec_GCJ='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib' archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib' else ld_shlibs_GCJ=no fi ;; esac ;; sunos4*) archive_cmds_GCJ='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= hardcode_direct_GCJ=yes hardcode_shlibpath_var_GCJ=no ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs_GCJ=no fi ;; esac if test "$ld_shlibs_GCJ" = no; then runpath_var= hardcode_libdir_flag_spec_GCJ= export_dynamic_flag_spec_GCJ= whole_archive_flag_spec_GCJ= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) allow_undefined_flag_GCJ=unsupported always_export_symbols_GCJ=yes archive_expsym_cmds_GCJ='$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_GCJ=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_GCJ=unsupported fi ;; aix4* | aix5*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | grep 'GNU' > /dev/null; then export_symbols_cmds_GCJ='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds_GCJ='$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].*|aix5*) 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_GCJ='' hardcode_direct_GCJ=yes hardcode_libdir_separator_GCJ=':' link_all_deplibs_GCJ=yes 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 hardcode_direct_GCJ=yes else # We have old collect2 hardcode_direct_GCJ=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_GCJ=yes hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_libdir_separator_GCJ= 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 # 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_GCJ=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_GCJ='-berok' # Determine the default libpath from the value encoded in an empty executable. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec_GCJ='${wl}-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds_GCJ="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec_GCJ='${wl}-R $libdir:/usr/lib:/lib' allow_undefined_flag_GCJ="-z nodefs" archive_expsym_cmds_GCJ="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an empty executable. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec_GCJ='${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_GCJ=' ${wl}-bernotok' allow_undefined_flag_GCJ=' ${wl}-berok' # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec_GCJ='$convenience' archive_cmds_need_lc_GCJ=yes # This is similar to how AIX traditionally builds its shared libraries. archive_expsym_cmds_GCJ="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${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*) archive_cmds_GCJ='$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_GCJ='-L$libdir' hardcode_minus_L_GCJ=yes # see comment about different semantics on the GNU ld section ld_shlibs_GCJ=no ;; bsdi[45]*) export_dynamic_flag_spec_GCJ=-rdynamic ;; cygwin* | mingw* | pw32*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec_GCJ=' ' allow_undefined_flag_GCJ=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_GCJ='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_From_new_cmds_GCJ='true' # FIXME: Should let the user specify the lib program. old_archive_cmds_GCJ='lib /OUT:$oldlib$oldobjs$old_deplibs' fix_srcfile_path_GCJ='`cygpath -w "$srcfile"`' enable_shared_with_static_runtimes_GCJ=yes ;; darwin* | rhapsody*) case $host_os in rhapsody* | darwin1.[012]) allow_undefined_flag_GCJ='${wl}-undefined ${wl}suppress' ;; *) # Darwin 1.3 on if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then allow_undefined_flag_GCJ='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' else case ${MACOSX_DEPLOYMENT_TARGET} in 10.[012]) allow_undefined_flag_GCJ='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) allow_undefined_flag_GCJ='${wl}-undefined ${wl}dynamic_lookup' ;; esac fi ;; esac archive_cmds_need_lc_GCJ=no hardcode_direct_GCJ=no hardcode_automatic_GCJ=yes hardcode_shlibpath_var_GCJ=unsupported whole_archive_flag_spec_GCJ='' link_all_deplibs_GCJ=yes if test "$GCC" = yes ; then output_verbose_link_cmd='echo' archive_cmds_GCJ='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' module_cmds_GCJ='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' module_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else case $cc_basename in xlc*) output_verbose_link_cmd='echo' archive_cmds_GCJ='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' module_cmds_GCJ='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' module_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' ;; *) ld_shlibs_GCJ=no ;; esac fi ;; dgux*) archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_shlibpath_var_GCJ=no ;; freebsd1*) ld_shlibs_GCJ=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_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' hardcode_libdir_flag_spec_GCJ='-R$libdir' hardcode_direct_GCJ=yes hardcode_shlibpath_var_GCJ=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2*) archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_GCJ=yes hardcode_minus_L_GCJ=yes hardcode_shlibpath_var_GCJ=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | kfreebsd*-gnu | dragonfly*) archive_cmds_GCJ='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec_GCJ='-R$libdir' hardcode_direct_GCJ=yes hardcode_shlibpath_var_GCJ=no ;; hpux9*) if test "$GCC" = yes; then archive_cmds_GCJ='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else archive_cmds_GCJ='$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_GCJ='${wl}+b ${wl}$libdir' hardcode_libdir_separator_GCJ=: hardcode_direct_GCJ=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L_GCJ=yes export_dynamic_flag_spec_GCJ='${wl}-E' ;; hpux10*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then archive_cmds_GCJ='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_GCJ='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir' hardcode_libdir_separator_GCJ=: hardcode_direct_GCJ=yes export_dynamic_flag_spec_GCJ='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L_GCJ=yes fi ;; hpux11*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) archive_cmds_GCJ='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds_GCJ='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds_GCJ='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) archive_cmds_GCJ='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds_GCJ='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds_GCJ='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir' hardcode_libdir_separator_GCJ=: case $host_cpu in hppa*64*|ia64*) hardcode_libdir_flag_spec_ld_GCJ='+b $libdir' hardcode_direct_GCJ=no hardcode_shlibpath_var_GCJ=no ;; *) hardcode_direct_GCJ=yes export_dynamic_flag_spec_GCJ='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L_GCJ=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else archive_cmds_GCJ='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_ld_GCJ='-rpath $libdir' fi hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_GCJ=: link_all_deplibs_GCJ=yes ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else archive_cmds_GCJ='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi hardcode_libdir_flag_spec_GCJ='-R$libdir' hardcode_direct_GCJ=yes hardcode_shlibpath_var_GCJ=no ;; newsos6) archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_GCJ=yes hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_GCJ=: hardcode_shlibpath_var_GCJ=no ;; openbsd*) hardcode_direct_GCJ=yes hardcode_shlibpath_var_GCJ=no if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir' export_dynamic_flag_spec_GCJ='${wl}-E' else case $host_os in openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec_GCJ='-R$libdir' ;; *) archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir' ;; esac fi ;; os2*) hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_minus_L_GCJ=yes allow_undefined_flag_GCJ=unsupported archive_cmds_GCJ='$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_GCJ='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then allow_undefined_flag_GCJ=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_GCJ='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else allow_undefined_flag_GCJ=' -expect_unresolved \*' archive_cmds_GCJ='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' fi hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_GCJ=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then allow_undefined_flag_GCJ=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_GCJ='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' else allow_undefined_flag_GCJ=' -expect_unresolved \*' archive_cmds_GCJ='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds_GCJ='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ $LD -shared${allow_undefined_flag} -input $lib.exp $linker_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_GCJ='-rpath $libdir' fi hardcode_libdir_separator_GCJ=: ;; solaris*) no_undefined_flag_GCJ=' -z text' if test "$GCC" = yes; then wlarc='${wl}' archive_cmds_GCJ='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' else wlarc='' archive_cmds_GCJ='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' fi hardcode_libdir_flag_spec_GCJ='-R$libdir' hardcode_shlibpath_var_GCJ=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The compiler driver will combine linker options so we # cannot just pass the convience library names through # without $wl, iff we do not link with $LD. # Luckily, gcc supports the same syntax we need for Sun Studio. # Supported since Solaris 2.6 (maybe 2.5.1?) case $wlarc in '') whole_archive_flag_spec_GCJ='-z allextract$convenience -z defaultextract' ;; *) whole_archive_flag_spec_GCJ='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; esac ;; esac link_all_deplibs_GCJ=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_GCJ='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_GCJ='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_direct_GCJ=yes hardcode_minus_L_GCJ=yes hardcode_shlibpath_var_GCJ=no ;; sysv4) case $host_vendor in sni) archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_GCJ=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. archive_cmds_GCJ='$LD -G -o $lib $libobjs $deplibs $linker_flags' reload_cmds_GCJ='$CC -r -o $output$reload_objs' hardcode_direct_GCJ=no ;; motorola) archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_GCJ=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' hardcode_shlibpath_var_GCJ=no ;; sysv4.3*) archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var_GCJ=no export_dynamic_flag_spec_GCJ='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var_GCJ=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ld_shlibs_GCJ=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7*) no_undefined_flag_GCJ='${wl}-z,text' archive_cmds_need_lc_GCJ=no hardcode_shlibpath_var_GCJ=no runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds_GCJ='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_GCJ='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_GCJ='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_GCJ='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. no_undefined_flag_GCJ='${wl}-z,text' allow_undefined_flag_GCJ='${wl}-z,nodefs' archive_cmds_need_lc_GCJ=no hardcode_shlibpath_var_GCJ=no hardcode_libdir_flag_spec_GCJ='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' hardcode_libdir_separator_GCJ=':' link_all_deplibs_GCJ=yes export_dynamic_flag_spec_GCJ='${wl}-Bexport' runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds_GCJ='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_GCJ='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_GCJ='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_GCJ='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_shlibpath_var_GCJ=no ;; *) ld_shlibs_GCJ=no ;; esac fi { echo "$as_me:$LINENO: result: $ld_shlibs_GCJ" >&5 echo "${ECHO_T}$ld_shlibs_GCJ" >&6; } test "$ld_shlibs_GCJ" = no && can_build_shared=no # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc_GCJ" in x|xyes) # Assume -lc should be added archive_cmds_need_lc_GCJ=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $archive_cmds_GCJ 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. { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; } $rm conftest* printf "$lt_simple_compile_test_code" > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl_GCJ pic_flag=$lt_prog_compiler_pic_GCJ compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag_GCJ allow_undefined_flag_GCJ= if { (eval echo "$as_me:$LINENO: \"$archive_cmds_GCJ 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 (eval $archive_cmds_GCJ 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } then archive_cmds_need_lc_GCJ=no else archive_cmds_need_lc_GCJ=yes fi allow_undefined_flag_GCJ=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $rm conftest* { echo "$as_me:$LINENO: result: $archive_cmds_need_lc_GCJ" >&5 echo "${ECHO_T}$archive_cmds_need_lc_GCJ" >&6; } ;; esac fi ;; esac { echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; } 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" if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. 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 else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix4* | aix5*) version_type=linux need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$host_os in yes,cygwin* | yes,mingw* | yes,pw32*) 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' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $rm \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" ;; mingw*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH printed by # mingw gcc, but we are running on Cygwin. Gcc prints its search # path with ; separators, and with drive letters. We can handle the # drive letters (cygwin fileutils understands them), so leave them, # especially as we might pass files found there to a mingw objdump, # which wouldn't understand a cygwinified path. Ahh. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; esac ;; *) library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' ;; esac dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${versuffix}$shared_ext ${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`' # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` else sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' fi sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd1*) dynamic_linker=no ;; kfreebsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='GNU ld.so' ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[123]*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; freebsd*) # from 4.6 on shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555. postinstall_cmds='chmod 555 $lib' ;; interix3*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be Linux ELF. linux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # 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)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; knetbsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='GNU ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; nto-qnx*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; 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" ;; solaris*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no export_dynamic_flag_spec='${wl}-Blargedynsym' runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' shlibpath_overrides_runpath=no else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' shlibpath_overrides_runpath=yes case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; uts4*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac { echo "$as_me:$LINENO: result: $dynamic_linker" >&5 echo "${ECHO_T}$dynamic_linker" >&6; } test "$dynamic_linker" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi { echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6; } hardcode_action_GCJ= if test -n "$hardcode_libdir_flag_spec_GCJ" || \ test -n "$runpath_var_GCJ" || \ test "X$hardcode_automatic_GCJ" = "Xyes" ; then # We can hardcode non-existant directories. if test "$hardcode_direct_GCJ" != 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_AC_TAGVAR(hardcode_shlibpath_var, GCJ)" != no && test "$hardcode_minus_L_GCJ" != no; then # Linking always hardcodes the temporary library directory. hardcode_action_GCJ=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action_GCJ=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action_GCJ=unsupported fi { echo "$as_me:$LINENO: result: $hardcode_action_GCJ" >&5 echo "${ECHO_T}$hardcode_action_GCJ" >&6; } if test "$hardcode_action_GCJ" = relink; 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 # The else clause should only fire when bootstrapping the # libtool distribution, otherwise you forgot to ship ltmain.sh # with your package, and you will get complaints that there are # no rules to generate ltmain.sh. if test -f "$ltmain"; then # 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 # Now quote all the things that may contain metacharacters while being # careful not to overquote the AC_SUBSTed values. We take copies of the # variables and quote the copies for generation of the libtool script. for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \ SED SHELL STRIP \ libname_spec library_names_spec soname_spec extract_expsyms_cmds \ old_striplib striplib file_magic_cmd finish_cmds finish_eval \ deplibs_check_method reload_flag reload_cmds need_locks \ lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ old_postinstall_cmds old_postuninstall_cmds \ compiler_GCJ \ CC_GCJ \ LD_GCJ \ lt_prog_compiler_wl_GCJ \ lt_prog_compiler_pic_GCJ \ lt_prog_compiler_static_GCJ \ lt_prog_compiler_no_builtin_flag_GCJ \ export_dynamic_flag_spec_GCJ \ thread_safe_flag_spec_GCJ \ whole_archive_flag_spec_GCJ \ enable_shared_with_static_runtimes_GCJ \ old_archive_cmds_GCJ \ old_archive_from_new_cmds_GCJ \ predep_objects_GCJ \ postdep_objects_GCJ \ predeps_GCJ \ postdeps_GCJ \ compiler_lib_search_path_GCJ \ archive_cmds_GCJ \ archive_expsym_cmds_GCJ \ postinstall_cmds_GCJ \ postuninstall_cmds_GCJ \ old_archive_from_expsyms_cmds_GCJ \ allow_undefined_flag_GCJ \ no_undefined_flag_GCJ \ export_symbols_cmds_GCJ \ hardcode_libdir_flag_spec_GCJ \ hardcode_libdir_flag_spec_ld_GCJ \ hardcode_libdir_separator_GCJ \ hardcode_automatic_GCJ \ module_cmds_GCJ \ module_expsym_cmds_GCJ \ lt_cv_prog_compiler_c_o_GCJ \ exclude_expsyms_GCJ \ include_expsyms_GCJ; do case $var in old_archive_cmds_GCJ | \ old_archive_from_new_cmds_GCJ | \ archive_cmds_GCJ | \ archive_expsym_cmds_GCJ | \ module_cmds_GCJ | \ module_expsym_cmds_GCJ | \ old_archive_from_expsyms_cmds_GCJ | \ export_symbols_cmds_GCJ | \ extract_expsyms_cmds | reload_cmds | finish_cmds | \ postinstall_cmds | postuninstall_cmds | \ old_postinstall_cmds | old_postuninstall_cmds | \ sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) # Double-quote double-evaled strings. eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" ;; *) eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" ;; esac done case $lt_echo in *'\$0 --fallback-echo"') lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` ;; esac cfgfile="$ofile" cat <<__EOF__ >> "$cfgfile" # ### BEGIN LIBTOOL TAG CONFIG: $tagname # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc_GCJ # Whether or not to disallow shared libs when runtime libs are static allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_GCJ # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # An echo program that does not interpret backslashes. echo=$lt_echo # The archiver. AR=$lt_AR AR_FLAGS=$lt_AR_FLAGS # A C compiler. LTCC=$lt_LTCC # LTCC compiler flags. LTCFLAGS=$lt_LTCFLAGS # A language-specific compiler. CC=$lt_compiler_GCJ # Is the compiler the GNU C compiler? with_gcc=$GCC_GCJ # An ERE matcher. EGREP=$lt_EGREP # The linker used to build libraries. LD=$lt_LD_GCJ # Whether we need hard or soft links. LN_S=$lt_LN_S # A BSD-compatible nm program. NM=$lt_NM # A symbol stripping program STRIP=$lt_STRIP # Used to examine libraries when file_magic_cmd begins "file" MAGIC_CMD=$MAGIC_CMD # Used on cygwin: DLL creation program. DLLTOOL="$DLLTOOL" # Used on cygwin: object dumper. OBJDUMP="$OBJDUMP" # Used on cygwin: assembler. AS="$AS" # The name of the directory that contains temporary libtool files. objdir=$objdir # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl_GCJ # Object file suffix (normally "o"). objext="$ac_objext" # Old archive suffix (normally "a"). libext="$libext" # Shared library suffix (normally ".so"). shrext_cmds='$shrext_cmds' # Executable file suffix (normally ""). exeext="$exeext" # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic_GCJ pic_mode=$pic_mode # What is the maximum length of a command? max_cmd_len=$lt_cv_sys_max_cmd_len # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o_GCJ # Must we lock files when doing compilation? need_locks=$lt_need_locks # 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 # 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 # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static_GCJ # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_GCJ # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_GCJ # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec_GCJ # Compiler flag to generate thread-safe objects. thread_safe_flag_spec=$lt_thread_safe_flag_spec_GCJ # Library versioning type. version_type=$version_type # 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 # Commands used to build and install an old-style archive. RANLIB=$lt_RANLIB old_archive_cmds=$lt_old_archive_cmds_GCJ old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_GCJ # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_GCJ # Commands used to build and install a shared archive. archive_cmds=$lt_archive_cmds_GCJ archive_expsym_cmds=$lt_archive_expsym_cmds_GCJ postinstall_cmds=$lt_postinstall_cmds postuninstall_cmds=$lt_postuninstall_cmds # Commands used to build a loadable module (assumed same as above if empty) module_cmds=$lt_module_cmds_GCJ module_expsym_cmds=$lt_module_expsym_cmds_GCJ # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # Dependencies to place before the objects being linked to create a # shared library. predep_objects=$lt_predep_objects_GCJ # Dependencies to place after the objects being linked to create a # shared library. postdep_objects=$lt_postdep_objects_GCJ # Dependencies to place before the objects being linked to create a # shared library. predeps=$lt_predeps_GCJ # Dependencies to place after the objects being linked to create a # shared library. postdeps=$lt_postdeps_GCJ # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path_GCJ # 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 # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag_GCJ # Flag that forces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag_GCJ # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # Same as above, but a single script fragment to be evaled but not shown. finish_eval=$lt_finish_eval # 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 # This is the shared library runtime path variable. runpath_var=$runpath_var # This is the shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action_GCJ # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # 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_GCJ # If ld is used when linking, flag to hardcode \$libdir into # a binary during linking. This must work even if \$libdir does # not exist. hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_GCJ # Whether we need a single -rpath flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator_GCJ # Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the # resulting binary. hardcode_direct=$hardcode_direct_GCJ # Set to yes if using the -LDIR flag during linking hardcodes DIR into the # resulting binary. hardcode_minus_L=$hardcode_minus_L_GCJ # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into # the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var_GCJ # 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_GCJ # Variables whose values should be saved in libtool wrapper scripts and # restored at relink time. variables_saved_for_relink="$variables_saved_for_relink" # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs_GCJ # 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 # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path="$fix_srcfile_path_GCJ" # Set to yes if exported symbols are required. always_export_symbols=$always_export_symbols_GCJ # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds_GCJ # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms_GCJ # Symbols that must always be exported. include_expsyms=$lt_include_expsyms_GCJ # ### END LIBTOOL TAG CONFIG: $tagname __EOF__ else # If there is no Makefile yet, we rely on a make rule to execute # `config.status --recheck' to rerun these tests and create the # libtool script then. ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` if test -f "$ltmain_in"; then test -f Makefile && make "$ltmain" fi 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" else tagname="" fi ;; RC) # Source file extension for RC test sources. ac_ext=rc # Object file extension for compiled RC test sources. objext=o objext_RC=$objext # Code to be used in simple compile tests lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }\n' # 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. # 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 warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $rm conftest* ac_outfile=conftest.$ac_objext printf "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $rm conftest* # Allow CC to be a program name with arguments. lt_save_CC="$CC" CC=${RC-"windres"} compiler=$CC compiler_RC=$CC for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` lt_cv_prog_compiler_c_o_RC=yes # The else clause should only fire when bootstrapping the # libtool distribution, otherwise you forgot to ship ltmain.sh # with your package, and you will get complaints that there are # no rules to generate ltmain.sh. if test -f "$ltmain"; then # 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 # Now quote all the things that may contain metacharacters while being # careful not to overquote the AC_SUBSTed values. We take copies of the # variables and quote the copies for generation of the libtool script. for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \ SED SHELL STRIP \ libname_spec library_names_spec soname_spec extract_expsyms_cmds \ old_striplib striplib file_magic_cmd finish_cmds finish_eval \ deplibs_check_method reload_flag reload_cmds need_locks \ lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ old_postinstall_cmds old_postuninstall_cmds \ compiler_RC \ CC_RC \ LD_RC \ lt_prog_compiler_wl_RC \ lt_prog_compiler_pic_RC \ lt_prog_compiler_static_RC \ lt_prog_compiler_no_builtin_flag_RC \ export_dynamic_flag_spec_RC \ thread_safe_flag_spec_RC \ whole_archive_flag_spec_RC \ enable_shared_with_static_runtimes_RC \ old_archive_cmds_RC \ old_archive_from_new_cmds_RC \ predep_objects_RC \ postdep_objects_RC \ predeps_RC \ postdeps_RC \ compiler_lib_search_path_RC \ archive_cmds_RC \ archive_expsym_cmds_RC \ postinstall_cmds_RC \ postuninstall_cmds_RC \ old_archive_from_expsyms_cmds_RC \ allow_undefined_flag_RC \ no_undefined_flag_RC \ export_symbols_cmds_RC \ hardcode_libdir_flag_spec_RC \ hardcode_libdir_flag_spec_ld_RC \ hardcode_libdir_separator_RC \ hardcode_automatic_RC \ module_cmds_RC \ module_expsym_cmds_RC \ lt_cv_prog_compiler_c_o_RC \ exclude_expsyms_RC \ include_expsyms_RC; do case $var in old_archive_cmds_RC | \ old_archive_from_new_cmds_RC | \ archive_cmds_RC | \ archive_expsym_cmds_RC | \ module_cmds_RC | \ module_expsym_cmds_RC | \ old_archive_from_expsyms_cmds_RC | \ export_symbols_cmds_RC | \ extract_expsyms_cmds | reload_cmds | finish_cmds | \ postinstall_cmds | postuninstall_cmds | \ old_postinstall_cmds | old_postuninstall_cmds | \ sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) # Double-quote double-evaled strings. eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" ;; *) eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" ;; esac done case $lt_echo in *'\$0 --fallback-echo"') lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` ;; esac cfgfile="$ofile" cat <<__EOF__ >> "$cfgfile" # ### BEGIN LIBTOOL TAG CONFIG: $tagname # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc_RC # Whether or not to disallow shared libs when runtime libs are static allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_RC # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # An echo program that does not interpret backslashes. echo=$lt_echo # The archiver. AR=$lt_AR AR_FLAGS=$lt_AR_FLAGS # A C compiler. LTCC=$lt_LTCC # LTCC compiler flags. LTCFLAGS=$lt_LTCFLAGS # A language-specific compiler. CC=$lt_compiler_RC # Is the compiler the GNU C compiler? with_gcc=$GCC_RC # An ERE matcher. EGREP=$lt_EGREP # The linker used to build libraries. LD=$lt_LD_RC # Whether we need hard or soft links. LN_S=$lt_LN_S # A BSD-compatible nm program. NM=$lt_NM # A symbol stripping program STRIP=$lt_STRIP # Used to examine libraries when file_magic_cmd begins "file" MAGIC_CMD=$MAGIC_CMD # Used on cygwin: DLL creation program. DLLTOOL="$DLLTOOL" # Used on cygwin: object dumper. OBJDUMP="$OBJDUMP" # Used on cygwin: assembler. AS="$AS" # The name of the directory that contains temporary libtool files. objdir=$objdir # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl_RC # Object file suffix (normally "o"). objext="$ac_objext" # Old archive suffix (normally "a"). libext="$libext" # Shared library suffix (normally ".so"). shrext_cmds='$shrext_cmds' # Executable file suffix (normally ""). exeext="$exeext" # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic_RC pic_mode=$pic_mode # What is the maximum length of a command? max_cmd_len=$lt_cv_sys_max_cmd_len # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o_RC # Must we lock files when doing compilation? need_locks=$lt_need_locks # 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 # 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 # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static_RC # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_RC # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_RC # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec_RC # Compiler flag to generate thread-safe objects. thread_safe_flag_spec=$lt_thread_safe_flag_spec_RC # Library versioning type. version_type=$version_type # 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 # Commands used to build and install an old-style archive. RANLIB=$lt_RANLIB old_archive_cmds=$lt_old_archive_cmds_RC old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_RC # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_RC # Commands used to build and install a shared archive. archive_cmds=$lt_archive_cmds_RC archive_expsym_cmds=$lt_archive_expsym_cmds_RC postinstall_cmds=$lt_postinstall_cmds postuninstall_cmds=$lt_postuninstall_cmds # Commands used to build a loadable module (assumed same as above if empty) module_cmds=$lt_module_cmds_RC module_expsym_cmds=$lt_module_expsym_cmds_RC # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # Dependencies to place before the objects being linked to create a # shared library. predep_objects=$lt_predep_objects_RC # Dependencies to place after the objects being linked to create a # shared library. postdep_objects=$lt_postdep_objects_RC # Dependencies to place before the objects being linked to create a # shared library. predeps=$lt_predeps_RC # Dependencies to place after the objects being linked to create a # shared library. postdeps=$lt_postdeps_RC # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path_RC # 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 # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag_RC # Flag that forces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag_RC # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # Same as above, but a single script fragment to be evaled but not shown. finish_eval=$lt_finish_eval # 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 # This is the shared library runtime path variable. runpath_var=$runpath_var # This is the shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action_RC # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # 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_RC # If ld is used when linking, flag to hardcode \$libdir into # a binary during linking. This must work even if \$libdir does # not exist. hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_RC # Whether we need a single -rpath flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator_RC # Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the # resulting binary. hardcode_direct=$hardcode_direct_RC # Set to yes if using the -LDIR flag during linking hardcodes DIR into the # resulting binary. hardcode_minus_L=$hardcode_minus_L_RC # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into # the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var_RC # 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_RC # Variables whose values should be saved in libtool wrapper scripts and # restored at relink time. variables_saved_for_relink="$variables_saved_for_relink" # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs_RC # 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 # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path="$fix_srcfile_path_RC" # Set to yes if exported symbols are required. always_export_symbols=$always_export_symbols_RC # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds_RC # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms_RC # Symbols that must always be exported. include_expsyms=$lt_include_expsyms_RC # ### END LIBTOOL TAG CONFIG: $tagname __EOF__ else # If there is no Makefile yet, we rely on a make rule to execute # `config.status --recheck' to rerun these tests and create the # libtool script then. ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` if test -f "$ltmain_in"; then test -f Makefile && make "$ltmain" fi 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" ;; *) { { echo "$as_me:$LINENO: error: Unsupported tag name: $tagname" >&5 echo "$as_me: error: Unsupported tag name: $tagname" >&2;} { (exit 1); exit 1; }; } ;; esac # Append the new tag name to the list of available tags. if test -n "$tagname" ; then available_tags="$available_tags $tagname" fi fi done IFS="$lt_save_ifs" # Now substitute the updated list of available tags. if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then mv "${ofile}T" "$ofile" chmod +x "$ofile" else rm -f "${ofile}T" { { echo "$as_me:$LINENO: error: unable to update list of available tagged configurations." >&5 echo "$as_me: error: unable to update list of available tagged configurations." >&2;} { (exit 1); exit 1; }; } fi fi # This can be used to rebuild libtool when needed LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh" # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' # Prevent multiple expansion ac_header_dirent=no for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do as_ac_Header=`echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_hdr that defines DIR" >&5 echo $ECHO_N "checking for $ac_hdr that defines DIR... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include <$ac_hdr> int main () { if ((DIR *) 0) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Header=no" fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_hdr" | $as_tr_cpp` 1 _ACEOF ac_header_dirent=$ac_hdr; break fi done # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. if test $ac_header_dirent = dirent.h; then { echo "$as_me:$LINENO: checking for library containing opendir" >&5 echo $ECHO_N "checking for library containing opendir... $ECHO_C" >&6; } if test "${ac_cv_search_opendir+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_func_search_save_LIBS=$LIBS cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char opendir (); int main () { return opendir (); ; return 0; } _ACEOF for ac_lib in '' dir; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_search_opendir=$ac_res else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext if test "${ac_cv_search_opendir+set}" = set; then break fi done if test "${ac_cv_search_opendir+set}" = set; then : else ac_cv_search_opendir=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5 echo "${ECHO_T}$ac_cv_search_opendir" >&6; } ac_res=$ac_cv_search_opendir if test "$ac_res" != no; then test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi else { echo "$as_me:$LINENO: checking for library containing opendir" >&5 echo $ECHO_N "checking for library containing opendir... $ECHO_C" >&6; } if test "${ac_cv_search_opendir+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_func_search_save_LIBS=$LIBS cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char opendir (); int main () { return opendir (); ; return 0; } _ACEOF for ac_lib in '' x; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_search_opendir=$ac_res else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext if test "${ac_cv_search_opendir+set}" = set; then break fi done if test "${ac_cv_search_opendir+set}" = set; then : else ac_cv_search_opendir=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5 echo "${ECHO_T}$ac_cv_search_opendir" >&6; } ac_res=$ac_cv_search_opendir if test "$ac_res" != no; then test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi fi # Check whether --enable-ltdl-install was given. if test "${enable_ltdl_install+set}" = set; then enableval=$enable_ltdl_install; fi 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 { echo "$as_me:$LINENO: checking which extension is used for loadable modules" >&5 echo $ECHO_N "checking which extension is used for loadable modules... $ECHO_C" >&6; } if test "${libltdl_cv_shlibext+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else module=yes eval libltdl_cv_shlibext=$shrext_cmds fi { echo "$as_me:$LINENO: result: $libltdl_cv_shlibext" >&5 echo "${ECHO_T}$libltdl_cv_shlibext" >&6; } if test -n "$libltdl_cv_shlibext"; then cat >>confdefs.h <<_ACEOF #define LTDL_SHLIB_EXT "$libltdl_cv_shlibext" _ACEOF fi { echo "$as_me:$LINENO: checking which variable specifies run-time library path" >&5 echo $ECHO_N "checking which variable specifies run-time library path... $ECHO_C" >&6; } if test "${libltdl_cv_shlibpath_var+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else libltdl_cv_shlibpath_var="$shlibpath_var" fi { echo "$as_me:$LINENO: result: $libltdl_cv_shlibpath_var" >&5 echo "${ECHO_T}$libltdl_cv_shlibpath_var" >&6; } if test -n "$libltdl_cv_shlibpath_var"; then cat >>confdefs.h <<_ACEOF #define LTDL_SHLIBPATH_VAR "$libltdl_cv_shlibpath_var" _ACEOF fi { echo "$as_me:$LINENO: checking for the default library search path" >&5 echo $ECHO_N "checking for the default library search path... $ECHO_C" >&6; } if test "${libltdl_cv_sys_search_path+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else libltdl_cv_sys_search_path="$sys_lib_dlsearch_path_spec" fi { echo "$as_me:$LINENO: result: $libltdl_cv_sys_search_path" >&5 echo "${ECHO_T}$libltdl_cv_sys_search_path" >&6; } if test -n "$libltdl_cv_sys_search_path"; then sys_search_path= for dir in $libltdl_cv_sys_search_path; do if test -z "$sys_search_path"; then sys_search_path="$dir" else sys_search_path="$sys_search_path$PATH_SEPARATOR$dir" fi done cat >>confdefs.h <<_ACEOF #define LTDL_SYSSEARCHPATH "$sys_search_path" _ACEOF fi { echo "$as_me:$LINENO: checking for objdir" >&5 echo $ECHO_N "checking for objdir... $ECHO_C" >&6; } if test "${libltdl_cv_objdir+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else libltdl_cv_objdir="$objdir" if test -n "$objdir"; then : else rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then libltdl_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. libltdl_cv_objdir=_libs fi rmdir .libs 2>/dev/null fi fi { echo "$as_me:$LINENO: result: $libltdl_cv_objdir" >&5 echo "${ECHO_T}$libltdl_cv_objdir" >&6; } cat >>confdefs.h <<_ACEOF #define LTDL_OBJDIR "$libltdl_cv_objdir/" _ACEOF { echo "$as_me:$LINENO: checking whether libtool supports -dlopen/-dlpreopen" >&5 echo $ECHO_N "checking whether libtool supports -dlopen/-dlpreopen... $ECHO_C" >&6; } if test "${libltdl_cv_preloaded_symbols+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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 { echo "$as_me:$LINENO: result: $libltdl_cv_preloaded_symbols" >&5 echo "${ECHO_T}$libltdl_cv_preloaded_symbols" >&6; } if test x"$libltdl_cv_preloaded_symbols" = xyes; then cat >>confdefs.h <<\_ACEOF #define HAVE_PRELOADED_SYMBOLS 1 _ACEOF fi LIBADD_DL= 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 { echo "$as_me:$LINENO: checking for shl_load" >&5 echo $ECHO_N "checking for shl_load... $ECHO_C" >&6; } if test "${ac_cv_func_shl_load+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define shl_load to an innocuous variant, in case declares shl_load. For example, HP-UX 11i declares gettimeofday. */ #define shl_load innocuous_shl_load /* System header to define __stub macros and hopefully few prototypes, which can conflict with char shl_load (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef shl_load /* 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 (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_shl_load) || defined (__stub___shl_load) choke me #endif int main () { return shl_load (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_shl_load=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_shl_load=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5 echo "${ECHO_T}$ac_cv_func_shl_load" >&6; } if test $ac_cv_func_shl_load = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_SHL_LOAD 1 _ACEOF else { echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6; } if test "${ac_cv_lib_dld_shl_load+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any 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 rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dld_shl_load=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dld_shl_load=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6; } if test $ac_cv_lib_dld_shl_load = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_SHL_LOAD 1 _ACEOF LIBADD_DL="$LIBADD_DL -ldld" else { echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6; } if test "${ac_cv_lib_dl_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any 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 rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dl_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dl_dlopen=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6; } if test $ac_cv_lib_dl_dlopen = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_LIBDL 1 _ACEOF LIBADD_DL="-ldl" libltdl_cv_lib_dl_dlopen="yes" else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #if HAVE_DLFCN_H # include #endif int main () { dlopen(0, 0); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cat >>confdefs.h <<\_ACEOF #define HAVE_LIBDL 1 _ACEOF libltdl_cv_func_dlopen="yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5 echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6; } if test "${ac_cv_lib_svld_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsvld $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any 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 rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_svld_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_svld_dlopen=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5 echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6; } if test $ac_cv_lib_svld_dlopen = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_LIBDL 1 _ACEOF LIBADD_DL="-lsvld" libltdl_cv_func_dlopen="yes" else { echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5 echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6; } if test "${ac_cv_lib_dld_dld_link+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any 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 rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dld_dld_link=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dld_dld_link=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5 echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6; } if test $ac_cv_lib_dld_dld_link = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_DLD 1 _ACEOF LIBADD_DL="$LIBADD_DL -ldld" else { echo "$as_me:$LINENO: checking for _dyld_func_lookup" >&5 echo $ECHO_N "checking for _dyld_func_lookup... $ECHO_C" >&6; } if test "${ac_cv_func__dyld_func_lookup+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define _dyld_func_lookup to an innocuous variant, in case declares _dyld_func_lookup. For example, HP-UX 11i declares gettimeofday. */ #define _dyld_func_lookup innocuous__dyld_func_lookup /* System header to define __stub macros and hopefully few prototypes, which can conflict with char _dyld_func_lookup (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef _dyld_func_lookup /* 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 _dyld_func_lookup (); /* 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__dyld_func_lookup) || defined (__stub____dyld_func_lookup) choke me #endif int main () { return _dyld_func_lookup (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func__dyld_func_lookup=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func__dyld_func_lookup=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_func__dyld_func_lookup" >&5 echo "${ECHO_T}$ac_cv_func__dyld_func_lookup" >&6; } if test $ac_cv_func__dyld_func_lookup = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_DYLD 1 _ACEOF fi fi fi fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi fi 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_DL" for ac_func in dlerror do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* 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 $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_var'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done LIBS="$lt_save_LIBS" 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 { echo "$as_me:$LINENO: checking for _ prefix in compiled symbols" >&5 echo $ECHO_N "checking for _ prefix in compiled symbols... $ECHO_C" >&6; } if test "${ac_cv_sys_symbol_underscore+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_sys_symbol_underscore=no cat > conftest.$ac_ext <&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # Now try to grab the symbols. ac_nlist=conftest.nm if { (eval echo "$as_me:$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=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s "$ac_nlist"; then # See whether the symbols have a leading underscore. if grep '^. _nm_test_func' "$ac_nlist" >/dev/null; then ac_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 { echo "$as_me:$LINENO: result: $ac_cv_sys_symbol_underscore" >&5 echo "${ECHO_T}$ac_cv_sys_symbol_underscore" >&6; } if test x"$ac_cv_sys_symbol_underscore" = xyes; then if test x"$libltdl_cv_func_dlopen" = xyes || test x"$libltdl_cv_lib_dl_dlopen" = xyes ; then { echo "$as_me:$LINENO: checking whether we have to add an underscore for dlsym" >&5 echo $ECHO_N "checking whether we have to add an underscore for dlsym... $ECHO_C" >&6; } if test "${libltdl_cv_need_uscore+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else libltdl_cv_need_uscore=unknown save_LIBS="$LIBS" LIBS="$LIBS $LIBADD_DL" 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 < #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 #ifdef __cplusplus extern "C" void exit (int); #endif void fnord() { int i=42;} int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; /* dlclose (self); */ } else puts (dlerror ()); exit (status); } EOF if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) 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 { echo "$as_me:$LINENO: result: $libltdl_cv_need_uscore" >&5 echo "${ECHO_T}$libltdl_cv_need_uscore" >&6; } fi fi if test x"$libltdl_cv_need_uscore" = xyes; then cat >>confdefs.h <<\_ACEOF #define NEED_USCORE 1 _ACEOF fi { echo "$as_me:$LINENO: checking whether deplibs are loaded by dlopen" >&5 echo $ECHO_N "checking whether deplibs are loaded by dlopen... $ECHO_C" >&6; } if test "${libltdl_cv_sys_dlopen_deplibs+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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. libltdl_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. libltdl_cv_sys_dlopen_deplibs=unknown ;; aix[45]*) libltdl_cv_sys_dlopen_deplibs=yes ;; 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 libltdl_cv_sys_dlopen_deplibs=yes ;; gnu* | linux* | kfreebsd*-gnu | knetbsd*-gnu) # GNU and its variants, using gnu ld.so (Glibc) libltdl_cv_sys_dlopen_deplibs=yes ;; hpux10*|hpux11*) libltdl_cv_sys_dlopen_deplibs=yes ;; interix*) libltdl_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. libltdl_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. libltdl_cv_sys_dlopen_deplibs=yes ;; netbsd*) libltdl_cv_sys_dlopen_deplibs=yes ;; openbsd*) libltdl_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 explictly say `no'. libltdl_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'. libltdl_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'. libltdl_cv_sys_dlopen_deplibs=yes ;; solaris*) libltdl_cv_sys_dlopen_deplibs=yes ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) libltdl_cv_sys_dlopen_deplibs=yes ;; esac fi { echo "$as_me:$LINENO: result: $libltdl_cv_sys_dlopen_deplibs" >&5 echo "${ECHO_T}$libltdl_cv_sys_dlopen_deplibs" >&6; } if test "$libltdl_cv_sys_dlopen_deplibs" != yes; then cat >>confdefs.h <<\_ACEOF #define LTDL_DLOPEN_DEPLIBS 1 _ACEOF fi for ac_header in argz.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? { echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ---------------------------------- ## ## Report this to bug-libtool@gnu.org ## ## ---------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done { echo "$as_me:$LINENO: checking for error_t" >&5 echo $ECHO_N "checking for error_t... $ECHO_C" >&6; } if test "${ac_cv_type_error_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #if HAVE_ARGZ_H # include #endif int main () { if ((error_t *) 0) return 0; if (sizeof (error_t)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_error_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_error_t=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_type_error_t" >&5 echo "${ECHO_T}$ac_cv_type_error_t" >&6; } if test $ac_cv_type_error_t = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_ERROR_T 1 _ACEOF else cat >>confdefs.h <<\_ACEOF #define error_t int _ACEOF fi for ac_func in argz_append argz_create_sep argz_insert argz_next argz_stringify do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* 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 $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_var'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in assert.h ctype.h errno.h malloc.h memory.h stdlib.h \ stdio.h unistd.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? { echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ---------------------------------- ## ## Report this to bug-libtool@gnu.org ## ## ---------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in dl.h sys/dl.h dld.h mach-o/dyld.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? { echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ---------------------------------- ## ## Report this to bug-libtool@gnu.org ## ## ---------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in string.h strings.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? { echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ---------------------------------- ## ## Report this to bug-libtool@gnu.org ## ## ---------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF break fi done for ac_func in strchr index do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* 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 $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_var'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF break fi done for ac_func in strrchr rindex do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* 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 $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_var'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF break fi done for ac_func in memcpy bcopy do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* 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 $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_var'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF break fi done for ac_func in memmove strcmp do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* 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 $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_var'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done for ac_func in closedir opendir readdir do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* 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 $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_var'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done ## -------- ## ## Outputs. ## ## -------- ## ac_config_files="$ac_config_files 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, don't put newlines in cache variables' values. # 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. { (set) 2>&1 | case `(ac_space=' '; set | grep ac_space) 2>&1` in *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 \ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; esac; } | sed ' t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff $cache_file confcache >/dev/null 2>&1; then :; else if test -w $cache_file; then test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" cat confcache >$cache_file else echo "not updating unwritable cache $cache_file" 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= 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=`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. ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCXX\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"am__fastdepCXX\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${INSTALL_LTDL_TRUE}" && test -z "${INSTALL_LTDL_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"INSTALL_LTDL\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"INSTALL_LTDL\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${CONVENIENCE_LTDL_TRUE}" && test -z "${CONVENIENCE_LTDL_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"CONVENIENCE_LTDL\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"CONVENIENCE_LTDL\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi : ${CONFIG_STATUS=./config.status} ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >$CONFIG_STATUS <<_ACEOF #! $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} _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # 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 elif test -n "${BASH_VERSION+set}${KSH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi BIN_SH=xpg4; export BIN_SH # for Tru64 DUALCASE=1; export DUALCASE # for MKS sh # PATH needs CR # 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 # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # Find who we are. Look in the path if we contain no path at all # relative or not. 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 ;; 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 # FIXME: next line outputs $as_me, which is still unset. { echo "$as_me: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; }; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1; 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 # Name of the executable. as_me=`$as_basename "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)$' \| \ . : '\(.\)' 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } /^X\/\(\/\/\)$/{ s//\1/; q; } /^X\/\(\/\).*/{ s//\1/; q; } s/.*/./; q'` as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, and appends # trailing '-' during substitution so that $LINENO is not a special # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # scripts with optimization help from Paolo Bonzini. 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 || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensible 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 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then # We could just check for DJGPP; but this test a) works b) is more generic # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). if test -f conf$$.exe; then # Don't use ln at all; we don't have any links as_ln_s='cp -p' else as_ln_s='ln -s' fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.file if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi # Find out whether ``test -x'' works. Don't use a zero-byte file, as # systems may use methods other than mode bits to determine executability. cat >conf$$.file <<_ASEOF #! /bin/sh exit 0 _ASEOF chmod +x conf$$.file if test -x conf$$.file >/dev/null 2>&1; then as_executable_p="test -x" else as_executable_p=: fi rm -f conf$$.file # 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'" # IFS # We need space, tab and new line, in precisely that order. as_nl=' ' IFS=" $as_nl" # CDPATH. $as_unset CDPATH exec 6>&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 libltdl $as_me 1.2, which was generated by GNU Autoconf 2.59c. 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 cat >>$CONFIG_STATUS <<_ACEOF # 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_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. Usage: $0 [OPTIONS] [FILE]... -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 --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_cs_version="\\ libltdl config.status 1.2 configured by $0, generated by GNU Autoconf 2.59c, with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" Copyright (C) 2005 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' _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # If no file are specified by the user, then we need to provide default # value. By we need to know if files were specified by the user. 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=$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 ) echo "$ac_cs_version"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift CONFIG_FILES="$CONFIG_FILES $ac_optarg" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header { echo "$as_me: error: ambiguous option: $1 Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; };; --help | --hel | -h ) 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. -*) { echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *) ac_config_targets="$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 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF if \$ac_cs_recheck; then echo "running CONFIG_SHELL=$SHELL $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 CONFIG_SHELL=$SHELL export CONFIG_SHELL exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion fi # # INIT-COMMANDS # AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # 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:config-h.in" ;; depfiles) CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; Makefile) CONFIG_FILES="$CONFIG_FILES Makefile" ;; *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= trap 'exit_status=$? { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status ' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d -q "./confXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || { echo "$me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } # # Set up the sed scripts for CONFIG_FILES section. # # No need to generate the scripts if there are no CONFIG_FILES. # This happens for instance when ./config.status config.h if test -n "$CONFIG_FILES"; then _ACEOF ac_delim='%!_!# ' for ac_last_try in false false false false false :; do cat >conf$$subs.sed <<_ACEOF SHELL!$SHELL$ac_delim PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim PACKAGE_NAME!$PACKAGE_NAME$ac_delim PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim PACKAGE_STRING!$PACKAGE_STRING$ac_delim PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim exec_prefix!$exec_prefix$ac_delim prefix!$prefix$ac_delim program_transform_name!$program_transform_name$ac_delim bindir!$bindir$ac_delim sbindir!$sbindir$ac_delim libexecdir!$libexecdir$ac_delim datarootdir!$datarootdir$ac_delim datadir!$datadir$ac_delim sysconfdir!$sysconfdir$ac_delim sharedstatedir!$sharedstatedir$ac_delim localstatedir!$localstatedir$ac_delim includedir!$includedir$ac_delim oldincludedir!$oldincludedir$ac_delim docdir!$docdir$ac_delim infodir!$infodir$ac_delim htmldir!$htmldir$ac_delim dvidir!$dvidir$ac_delim pdfdir!$pdfdir$ac_delim psdir!$psdir$ac_delim libdir!$libdir$ac_delim localedir!$localedir$ac_delim mandir!$mandir$ac_delim DEFS!$DEFS$ac_delim ECHO_C!$ECHO_C$ac_delim ECHO_N!$ECHO_N$ac_delim ECHO_T!$ECHO_T$ac_delim LIBS!$LIBS$ac_delim build_alias!$build_alias$ac_delim host_alias!$host_alias$ac_delim target_alias!$target_alias$ac_delim INSTALL_PROGRAM!$INSTALL_PROGRAM$ac_delim INSTALL_SCRIPT!$INSTALL_SCRIPT$ac_delim INSTALL_DATA!$INSTALL_DATA$ac_delim CYGPATH_W!$CYGPATH_W$ac_delim PACKAGE!$PACKAGE$ac_delim VERSION!$VERSION$ac_delim ACLOCAL!$ACLOCAL$ac_delim AUTOCONF!$AUTOCONF$ac_delim AUTOMAKE!$AUTOMAKE$ac_delim AUTOHEADER!$AUTOHEADER$ac_delim MAKEINFO!$MAKEINFO$ac_delim install_sh!$install_sh$ac_delim STRIP!$STRIP$ac_delim INSTALL_STRIP_PROGRAM!$INSTALL_STRIP_PROGRAM$ac_delim mkdir_p!$mkdir_p$ac_delim AWK!$AWK$ac_delim SET_MAKE!$SET_MAKE$ac_delim am__leading_dot!$am__leading_dot$ac_delim AMTAR!$AMTAR$ac_delim am__tar!$am__tar$ac_delim am__untar!$am__untar$ac_delim CC!$CC$ac_delim CFLAGS!$CFLAGS$ac_delim LDFLAGS!$LDFLAGS$ac_delim CPPFLAGS!$CPPFLAGS$ac_delim ac_ct_CC!$ac_ct_CC$ac_delim EXEEXT!$EXEEXT$ac_delim OBJEXT!$OBJEXT$ac_delim DEPDIR!$DEPDIR$ac_delim am__include!$am__include$ac_delim am__quote!$am__quote$ac_delim AMDEP_TRUE!$AMDEP_TRUE$ac_delim AMDEP_FALSE!$AMDEP_FALSE$ac_delim AMDEPBACKSLASH!$AMDEPBACKSLASH$ac_delim CCDEPMODE!$CCDEPMODE$ac_delim am__fastdepCC_TRUE!$am__fastdepCC_TRUE$ac_delim am__fastdepCC_FALSE!$am__fastdepCC_FALSE$ac_delim build!$build$ac_delim build_cpu!$build_cpu$ac_delim build_vendor!$build_vendor$ac_delim build_os!$build_os$ac_delim host!$host$ac_delim host_cpu!$host_cpu$ac_delim host_vendor!$host_vendor$ac_delim host_os!$host_os$ac_delim GREP!$GREP$ac_delim EGREP!$EGREP$ac_delim LN_S!$LN_S$ac_delim ECHO!$ECHO$ac_delim AR!$AR$ac_delim RANLIB!$RANLIB$ac_delim DLLTOOL!$DLLTOOL$ac_delim AS!$AS$ac_delim OBJDUMP!$OBJDUMP$ac_delim CPP!$CPP$ac_delim CXX!$CXX$ac_delim CXXFLAGS!$CXXFLAGS$ac_delim ac_ct_CXX!$ac_ct_CXX$ac_delim CXXDEPMODE!$CXXDEPMODE$ac_delim am__fastdepCXX_TRUE!$am__fastdepCXX_TRUE$ac_delim am__fastdepCXX_FALSE!$am__fastdepCXX_FALSE$ac_delim _ACEOF if test `grep -c "$ac_delim\$" conf$$subs.sed` = 98; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done ac_eof= if grep '^CEOF$' conf$$subs.sed >/dev/null; then ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF//p' conf$$subs.sed | sort -nru | sed 1q` ac_eof=`expr 0$ac_eof + 1` fi cat >>$CONFIG_STATUS <<_ACEOF cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof /@[a-zA-Z_][a-zA-Z_0-9]*@/!b _ACEOF sed ' s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g s/^/s,@/; s/!/@,|#_!!_#|/ :n t n s/'"$ac_delim"'$/,g/; t s/$/\\/; p N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n ' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF CEOF$ac_eof _ACEOF ac_delim='%!_!# ' for ac_last_try in false false false false false :; do cat >conf$$subs.sed <<_ACEOF CXXCPP!$CXXCPP$ac_delim F77!$F77$ac_delim FFLAGS!$FFLAGS$ac_delim ac_ct_F77!$ac_ct_F77$ac_delim LIBTOOL!$LIBTOOL$ac_delim LIBTOOL_DEPS!$LIBTOOL_DEPS$ac_delim INSTALL_LTDL_TRUE!$INSTALL_LTDL_TRUE$ac_delim INSTALL_LTDL_FALSE!$INSTALL_LTDL_FALSE$ac_delim CONVENIENCE_LTDL_TRUE!$CONVENIENCE_LTDL_TRUE$ac_delim CONVENIENCE_LTDL_FALSE!$CONVENIENCE_LTDL_FALSE$ac_delim LIBADD_DL!$LIBADD_DL$ac_delim LIBOBJS!$LIBOBJS$ac_delim LTLIBOBJS!$LTLIBOBJS$ac_delim _ACEOF if test `grep -c "$ac_delim\$" conf$$subs.sed` = 13; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done ac_eof= if grep '^CEOF$' conf$$subs.sed >/dev/null; then ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF//p' conf$$subs.sed | sort -nru | sed 1q` ac_eof=`expr 0$ac_eof + 1` fi cat >>$CONFIG_STATUS <<_ACEOF cat >"\$tmp/subs-2.sed" <<\CEOF$ac_eof /@[a-zA-Z_][a-zA-Z_0-9]*@/!b end _ACEOF sed ' s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g s/^/s,@/; s/!/@,|#_!!_#|/ :n t n s/'"$ac_delim"'$/,g/; t s/$/\\/; p N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n ' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF :end s/|#_!!_#|//g CEOF$ac_eof _ACEOF # VPATH may cause trouble with some makes, so we remove $(srcdir), # ${srcdir} and @srcdir@ 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[ ]*=/{ s/:*\$(srcdir):*/:/; s/:*\${srcdir}:*/:/; s/:*@srcdir@:*/:/; s/^\([^=]*=[ ]*\):*/\1/; s/:*$//; s/^[^=]*=[ ]*$//; }' fi cat >>$CONFIG_STATUS <<\_ACEOF fi # test -n "$CONFIG_FILES" for ac_tag in :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5 echo "$as_me: error: Invalid tag $ac_tag." >&2;} { (exit 1); exit 1; }; };; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 echo "$as_me: error: cannot find input file: $ac_f" >&2;} { (exit 1); exit 1; }; };; esac ac_file_inputs="$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 "`IFS=: echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure." if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { echo "$as_me:$LINENO: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} fi case $ac_tag in *:-:* | *:-) cat >"$tmp/stdin";; esac ;; esac ac_dir=`(dirname "$ac_file") 2>/dev/null || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` { if $as_mkdir_p; then test -d "$ac_dir" || mkdir -p "$ac_dir" else as_dir="$ac_dir" as_dirs= while test ! -d "$as_dir"; do as_dirs="$as_dir $as_dirs" as_dir=`(dirname "$as_dir") 2>/dev/null || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` done test ! -n "$as_dirs" || mkdir $as_dirs fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac _ACEOF # 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 sed "$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s&@configure_input@&$configure_input&;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t " $ac_file_inputs | sed -f "$tmp/subs-1.sed" | sed -f "$tmp/subs-2.sed" >$tmp/out rm -f "$tmp/stdin" case $ac_file in -) cat "$tmp/out"; rm -f "$tmp/out";; *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;; esac ;; :H) # # CONFIG_HEADER # # These sed commands are passed to sed as "A NAME B PARAMS C VALUE D", where # NAME is the cpp macro being defined, VALUE is the value it is being given. # PARAMS is the parameter list in the macro definition--in most cases, it's # just an empty string. # ac_dA='s,^\([ ]*#[ ]*\)[^ ]*\([ ][ ]*' ac_dB='\)[ (].*$,\1define\2' ac_dC=' ' ac_dD=' ,' ac_word_regexp=[_$as_cr_Letters][_$as_cr_alnum]* _ACEOF # Transform confdefs.h into a sed script `conftest.defines', that # substitutes the proper values into config.h.in to produce config.h. rm -f conftest.defines conftest.tail # First, append a space to every undef/define line, to ease matching. echo 's/$/ /' >conftest.defines # Then, protect against being on the right side of a sed subst, or in # an unquoted here document, in config.status. If some macros were # called several times there might be several #defines for the same # symbol, which is useless. But do not sort them, since the last # AC_DEFINE must be honored. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* uniq confdefs.h | sed -n ' t rset :rset s/^[ ]*#[ ]*define[ ][ ]*// t ok d :ok s/[\\&,]/\\&/g s/[\\$`]/\\&/g s/^\('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/${ac_dA}\1$ac_dB\2${ac_dC}\3$ac_dD/p s/^\('"$ac_word_re"'\)[ ]*\(.*\)/${ac_dA}\1$ac_dB${ac_dC}\2$ac_dD/p ' >>conftest.defines # Remove the space that was appended to ease matching. # Then 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. # (The regexp can be short, since the line contains either #define or #undef.) echo 's/ $// s,^[ #]*u.*,/* & */,' >>conftest.defines # Break up conftest.defines: ac_max_sed_lines=97 # First sed command is: sed -f defines.sed $ac_file_inputs >"$tmp/out1" # Second one is: sed -f defines.sed "$tmp/out1" >"$tmp/out2" # Third one will be: sed -f defines.sed "$tmp/out2" >"$tmp/out1" # et cetera. ac_in='$ac_file_inputs' ac_out='"$tmp/out1"' ac_nxt='"$tmp/out2"' while : do # Write a here document: echo ' # First, check the format of the line: cat >"$tmp/defines.sed" <>$CONFIG_STATUS sed ${ac_max_sed_lines}q conftest.defines >>$CONFIG_STATUS echo 'CEOF sed -f "$tmp/defines.sed"' "$ac_in >$ac_out" >>$CONFIG_STATUS ac_in=$ac_out ac_out=$ac_nxt ac_nxt=$ac_in sed 1,${ac_max_sed_lines}d conftest.defines >conftest.tail grep . conftest.tail >/dev/null || break rm -f conftest.defines mv conftest.tail conftest.defines done rm -f conftest.defines conftest.tail echo "ac_result=$ac_in" >>$CONFIG_STATUS cat >>$CONFIG_STATUS <<\_ACEOF if test x"$ac_file" != x-; then echo "/* $configure_input */" >"$tmp/config.h" cat "$ac_result" >>"$tmp/config.h" if diff $ac_file "$tmp/config.h" >/dev/null 2>&1; then { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 echo "$as_me: $ac_file is unchanged" >&6;} else rm -f $ac_file mv "$tmp/config.h" $ac_file fi else echo "/* $configure_input */" cat "$ac_result" fi rm -f "$tmp/out12" # Compute $ac_file's index in $config_headers. _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $ac_file | $ac_file:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $ac_file" >`(dirname $ac_file) 2>/dev/null || $as_expr X$ac_file : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X$ac_file : 'X\(//\)[^/]' \| \ X$ac_file : 'X\(//\)$' \| \ X$ac_file : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X$ac_file | 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) { echo "$as_me:$LINENO: executing $ac_file commands" >&5 echo "$as_me: executing $ac_file commands" >&6;} ;; esac case $ac_file$ac_mode in depfiles:C) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; 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. # So let's grep whole file. if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then dirpart=`(dirname "$mf") 2>/dev/null || $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$mf" : 'X\(//\)[^/]' \| \ X"$mf" : 'X\(//\)$' \| \ X"$mf" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running `make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n 's/^U = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`(dirname "$file") 2>/dev/null || $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$file" : 'X\(//\)[^/]' \| \ X"$file" : 'X\(//\)$' \| \ X"$file" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` { if $as_mkdir_p; then test -d $dirpart/$fdir || mkdir -p $dirpart/$fdir else as_dir=$dirpart/$fdir as_dirs= while test ! -d "$as_dir"; do as_dirs="$as_dir $as_dirs" as_dir=`(dirname "$as_dir") 2>/dev/null || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` done test ! -n "$as_dirs" || mkdir $as_dirs fi || { { echo "$as_me:$LINENO: error: cannot create directory $dirpart/$fdir" >&5 echo "$as_me: error: cannot create directory $dirpart/$fdir" >&2;} { (exit 1); exit 1; }; }; } # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done ;; esac done # for ac_tag { (exit 0); exit 0; } _ACEOF chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save # 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 || { (exit 1); exit 1; } fi freeradius-server/libltdl/configure.ac000066400000000000000000000043141257552170400204410ustar00rootroot00000000000000## Process this file with autoconf to create configure. -*- autoconf -*- # Copyright 2001 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA dnl FIXME: Is this really new enough? AC_PREREQ(2.50) ## ------------------------ ## ## Autoconf initialisation. ## ## ------------------------ ## AC_INIT([libltdl], [1.2], [bug-libtool@gnu.org]) AC_CONFIG_SRCDIR([ltdl.c]) ## ------------------------------- ## ## Libltdl specific configuration. ## ## ------------------------------- ## AC_CONFIG_AUX_DIR([.]) if test -z "$enable_ltdl_install$enable_ltdl_convenience"; then if test -f ${srcdir}/ltmain.sh; then # if libltdl is libtoolized, it is assumed to be stand-alone and # installed unless the command line overrides it (tested above) enable_ltdl_install=yes else AC_MSG_WARN([*** The top-level configure must select either]) AC_MSG_WARN([*** [A""C_LIBLTDL_INSTALLABLE] or [A""C_LIBLTDL_CONVENIENCE].]) AC_MSG_ERROR([*** Maybe you want to --enable-ltdl-install?]) fi fi ## ------------------------ ## ## Automake Initialisation. ## ## ------------------------ ## AM_INIT_AUTOMAKE(AC_PACKAGE_TARNAME, AC_PACKAGE_VERSION, -) AM_CONFIG_HEADER([config.h:config-h.in]) ## ------------------ ## ## C compiler checks. ## ## ------------------ ## AC_PROG_CC AC_C_CONST AC_C_INLINE ## ----------------------- ## ## Libtool initialisation. ## ## ----------------------- ## AC_LIBTOOL_WIN32_DLL AC_PROG_LIBTOOL AC_SUBST([LIBTOOL_DEPS]) AC_LIB_LTDL ## -------- ## ## Outputs. ## ## -------- ## AC_CONFIG_FILES([Makefile]) AC_OUTPUT freeradius-server/libltdl/install-sh000077500000000000000000000253321257552170400201620ustar00rootroot00000000000000#!/bin/sh # install - install a program, script, or datafile scriptversion=2005-11-07.23 # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. # # Copyright (C) 1994 X Consortium # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the X Consortium shall not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # tium. # # # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent # `make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. It can only install one file at a time, a restriction # shared with many OS's install programs. # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit="${DOITPROG-}" # put in absolute paths if you don't have them in your path; or use env. vars. mvprog="${MVPROG-mv}" cpprog="${CPPROG-cp}" chmodprog="${CHMODPROG-chmod}" chownprog="${CHOWNPROG-chown}" chgrpprog="${CHGRPPROG-chgrp}" stripprog="${STRIPPROG-strip}" rmprog="${RMPROG-rm}" mkdirprog="${MKDIRPROG-mkdir}" posix_glob= posix_mkdir= # Symbolic mode for testing mkdir with directories. # It is the same as 755, but also tests that "u+" works. test_mode=u=rwx,g=rx,o=rx,u+wx # Desired mode of installed file. mode=0755 # Desired mode of newly created intermediate directories. # It is empty if not known yet. intermediate_mode= chmodcmd=$chmodprog chowncmd= chgrpcmd= stripcmd= rmcmd="$rmprog -f" mvcmd="$mvprog" src= dst= dir_arg= dstarg= no_target_directory= usage="Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE or: $0 [OPTION]... SRCFILES... DIRECTORY or: $0 [OPTION]... -t DIRECTORY SRCFILES... or: $0 [OPTION]... -d DIRECTORIES... In the 1st form, copy SRCFILE to DSTFILE. In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. In the 4th, create DIRECTORIES. Options: -c (ignored) -d create directories instead of installing files. -g GROUP $chgrpprog installed files to GROUP. -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. -s $stripprog installed files. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. --help display this help and exit. --version display version info and exit. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG " while test -n "$1"; do case $1 in -c) shift continue;; -d) dir_arg=true shift continue;; -g) chgrpcmd="$chgrpprog $2" shift shift continue;; --help) echo "$usage"; exit $?;; -m) mode=$2 shift shift continue;; -o) chowncmd="$chownprog $2" shift shift continue;; -s) stripcmd=$stripprog shift continue;; -t) dstarg=$2 shift shift continue;; -T) no_target_directory=true shift continue;; --version) echo "$0 $scriptversion"; exit $?;; *) # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. test -n "$dir_arg$dstarg" && break # Otherwise, the last argument is the destination. Remove it from $@. for arg do if test -n "$dstarg"; then # $@ is not empty: it contains at least $arg. set fnord "$@" "$dstarg" shift # fnord fi shift # arg dstarg=$arg done break;; esac done if test -z "$1"; then if test -z "$dir_arg"; then echo "$0: no input file specified." >&2 exit 1 fi # It's OK to call `install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi test -n "$dir_arg" || trap '(exit $?); exit' 1 2 13 15 for src do # Protect names starting with `-'. case $src in -*) src=./$src ;; esac if test -n "$dir_arg"; then dst=$src dstdir=$dst test -d "$dstdir" dstdir_status=$? else # Waiting for this to be detected by the "$cpprog $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if test ! -f "$src" && test ! -d "$src"; then echo "$0: $src does not exist." >&2 exit 1 fi if test -z "$dstarg"; then echo "$0: no destination specified." >&2 exit 1 fi dst=$dstarg # Protect names starting with `-'. case $dst in -*) dst=./$dst ;; esac # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. if test -d "$dst"; then if test -n "$no_target_directory"; then echo "$0: $dstarg: Is a directory" >&2 exit 1 fi dstdir=$dst dst=$dstdir/`basename "$src"` dstdir_status=0 else # Prefer dirname, but fall back on a substitute if dirname fails. dstdir=` (dirname "$dst") 2>/dev/null || expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$dst" : 'X\(//\)[^/]' \| \ X"$dst" : 'X\(//\)$' \| \ X"$dst" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$dst" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q' ` test -d "$dstdir" dstdir_status=$? fi fi obsolete_mkdir_used=false if test $dstdir_status != 0; then case $posix_mkdir in '') posix_mkdir=false if $mkdirprog -m $test_mode -p -- / >/dev/null 2>&1; then posix_mkdir=true else # Remove any dirs left behind by ancient mkdir implementations. rmdir ./-m "$test_mode" ./-p ./-- 2>/dev/null fi ;; esac if $posix_mkdir && { # With -d, create the new directory with the user-specified mode. # Otherwise, create it using the same intermediate mode that # mkdir -p would use when creating intermediate directories. # POSIX says that this mode is "$(umask -S),u+wx", so use that # if umask -S works. if test -n "$dir_arg"; then mkdir_mode=$mode else case $intermediate_mode in '') if umask_S=`(umask -S) 2>/dev/null`; then intermediate_mode=$umask_S,u+wx else intermediate_mode=$test_mode fi ;; esac mkdir_mode=$intermediate_mode fi $mkdirprog -m "$mkdir_mode" -p -- "$dstdir" } then : else # mkdir does not conform to POSIX, or it failed possibly due to # a race condition. Create the directory the slow way, step by # step, checking for races as we go. case $dstdir in /*) pathcomp=/ ;; -*) pathcomp=./ ;; *) pathcomp= ;; esac case $posix_glob in '') if (set -f) 2>/dev/null; then posix_glob=true else posix_glob=false fi ;; esac oIFS=$IFS IFS=/ $posix_glob && set -f set fnord $dstdir shift $posix_glob && set +f IFS=$oIFS for d do test "x$d" = x && continue pathcomp=$pathcomp$d if test ! -d "$pathcomp"; then $mkdirprog "$pathcomp" # Don't fail if two instances are running concurrently. test -d "$pathcomp" || exit 1 fi pathcomp=$pathcomp/ done obsolete_mkdir_used=true fi fi if test -n "$dir_arg"; then { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || test -z "$chmodcmd" || $doit $chmodcmd "$mode" "$dst"; } || exit 1 else # Make a couple of temp file names in the proper directory. dsttmp=$dstdir/_inst.$$_ rmtmp=$dstdir/_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 # Copy the file name to the temp name. $doit $cpprog "$src" "$dsttmp" && # and set any options; do chmod last to preserve setuid bits. # # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $cpprog $src $dsttmp" command. # { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \ && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \ && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \ && { test -z "$chmodcmd" || $doit $chmodcmd "$mode" "$dsttmp"; } && # Now rename the file to the real destination. { $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null \ || { # The rename failed, perhaps because mv can't rename something else # to itself, or perhaps because mv is so ancient that it does not # support -f. # Now remove or move aside any old file at destination location. # We try this two ways since rm can't unlink itself on some # systems and the destination file might be busy for other # reasons. In this case, the final cleanup might fail but the new # file should still install successfully. { if test -f "$dst"; then $doit $rmcmd -f "$dst" 2>/dev/null \ || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null \ && { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }; }\ || { echo "$0: cannot unlink or rename $dst" >&2 (exit 1); exit 1 } else : fi } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dst" } } || exit 1 trap '' 0 fi done # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-end: "$" # End: freeradius-server/libltdl/ltdl.c000066400000000000000000003016741257552170400172670ustar00rootroot00000000000000/* ltdl.c -- system independent dlopen wrapper Copyright (C) 1998, 1999, 2000, 2004, 2005 Free Software Foundation, Inc. Originally by Thomas Tanner This file is part of GNU Libtool. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. As a special exception to the GNU Lesser General Public License, if you distribute this file as part of a program or library that is built using GNU libtool, you may include it under the same distribution terms that you use for the rest of that program. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #if HAVE_CONFIG_H # include #endif #if HAVE_UNISTD_H # include #endif #if HAVE_STDIO_H # include #endif /* Include the header defining malloc. On K&R C compilers, that's , on ANSI C and ISO C compilers, that's . */ #if HAVE_STDLIB_H # include #else # if HAVE_MALLOC_H # include # endif #endif #if HAVE_STRING_H # include #else # if HAVE_STRINGS_H # include # endif #endif #if HAVE_CTYPE_H # include #endif #if HAVE_MEMORY_H # include #endif #if HAVE_ERRNO_H # include #endif #ifndef __WINDOWS__ # ifdef __WIN32__ # define __WINDOWS__ # endif #endif #undef LT_USE_POSIX_DIRENT #ifdef HAVE_CLOSEDIR # ifdef HAVE_OPENDIR # ifdef HAVE_READDIR # ifdef HAVE_DIRENT_H # define LT_USE_POSIX_DIRENT # endif /* HAVE_DIRENT_H */ # endif /* HAVE_READDIR */ # endif /* HAVE_OPENDIR */ #endif /* HAVE_CLOSEDIR */ #undef LT_USE_WINDOWS_DIRENT_EMULATION #ifndef LT_USE_POSIX_DIRENT # ifdef __WINDOWS__ # define LT_USE_WINDOWS_DIRENT_EMULATION # endif /* __WINDOWS__ */ #endif /* LT_USE_POSIX_DIRENT */ #ifdef LT_USE_POSIX_DIRENT # include # define LT_D_NAMLEN(dirent) (strlen((dirent)->d_name)) #else # ifdef LT_USE_WINDOWS_DIRENT_EMULATION # define LT_D_NAMLEN(dirent) (strlen((dirent)->d_name)) # else # define dirent direct # define LT_D_NAMLEN(dirent) ((dirent)->d_namlen) # if HAVE_SYS_NDIR_H # include # endif # if HAVE_SYS_DIR_H # include # endif # if HAVE_NDIR_H # include # endif # endif #endif #if HAVE_ARGZ_H # include #endif #if HAVE_ASSERT_H # include #else # define assert(arg) ((void) 0) #endif #include "ltdl.h" #if WITH_DMALLOC # include #endif /* --- WINDOWS SUPPORT --- */ #ifdef DLL_EXPORT # define LT_GLOBAL_DATA __declspec(dllexport) #else # define LT_GLOBAL_DATA #endif /* fopen() mode flags for reading a text file */ #undef LT_READTEXT_MODE #ifdef __WINDOWS__ # define LT_READTEXT_MODE "rt" #else # define LT_READTEXT_MODE "r" #endif #ifdef LT_USE_WINDOWS_DIRENT_EMULATION #include #define dirent lt_dirent #define DIR lt_DIR struct dirent { char d_name[2048]; int d_namlen; }; typedef struct _DIR { HANDLE hSearch; WIN32_FIND_DATA Win32FindData; BOOL firsttime; struct dirent file_info; } DIR; #endif /* LT_USE_WINDOWS_DIRENT_EMULATION */ /* --- MANIFEST CONSTANTS --- */ /* Standard libltdl search path environment variable name */ #undef LTDL_SEARCHPATH_VAR #define LTDL_SEARCHPATH_VAR "LTDL_LIBRARY_PATH" /* Standard libtool archive file extension. */ #undef LTDL_ARCHIVE_EXT #define LTDL_ARCHIVE_EXT ".la" /* max. filename length */ #ifndef LT_FILENAME_MAX # define LT_FILENAME_MAX 1024 #endif /* This is the maximum symbol size that won't require malloc/free */ #undef LT_SYMBOL_LENGTH #define LT_SYMBOL_LENGTH 128 /* This accounts for the _LTX_ separator */ #undef LT_SYMBOL_OVERHEAD #define LT_SYMBOL_OVERHEAD 5 /* --- MEMORY HANDLING --- */ /* These are the functions used internally. In addition to making use of the associated function pointers above, they also perform error handling. */ static char *lt_estrdup LT_PARAMS((const char *str)); static lt_ptr lt_emalloc LT_PARAMS((size_t size)); static lt_ptr lt_erealloc LT_PARAMS((lt_ptr addr, size_t size)); /* static lt_ptr rpl_realloc LT_PARAMS((lt_ptr ptr, size_t size)); */ #define rpl_realloc realloc /* These are the pointers that can be changed by the caller: */ LT_GLOBAL_DATA lt_ptr (*lt_dlmalloc) LT_PARAMS((size_t size)) = (lt_ptr (*) LT_PARAMS((size_t))) malloc; LT_GLOBAL_DATA lt_ptr (*lt_dlrealloc) LT_PARAMS((lt_ptr ptr, size_t size)) = (lt_ptr (*) LT_PARAMS((lt_ptr, size_t))) rpl_realloc; LT_GLOBAL_DATA void (*lt_dlfree) LT_PARAMS((lt_ptr ptr)) = (void (*) LT_PARAMS((lt_ptr))) free; /* The following macros reduce the amount of typing needed to cast assigned memory. */ #if WITH_DMALLOC #define LT_DLMALLOC(tp, n) ((tp *) xmalloc ((n) * sizeof(tp))) #define LT_DLREALLOC(tp, p, n) ((tp *) xrealloc ((p), (n) * sizeof(tp))) #define LT_DLFREE(p) \ LT_STMT_START { if (p) (p) = (xfree (p), (lt_ptr) 0); } LT_STMT_END #define LT_EMALLOC(tp, n) ((tp *) xmalloc ((n) * sizeof(tp))) #define LT_EREALLOC(tp, p, n) ((tp *) xrealloc ((p), (n) * sizeof(tp))) #else #define LT_DLMALLOC(tp, n) ((tp *) lt_dlmalloc ((n) * sizeof(tp))) #define LT_DLREALLOC(tp, p, n) ((tp *) lt_dlrealloc ((p), (n) * sizeof(tp))) #define LT_DLFREE(p) \ LT_STMT_START { if (p) (p) = (lt_dlfree (p), (lt_ptr) 0); } LT_STMT_END #define LT_EMALLOC(tp, n) ((tp *) lt_emalloc ((n) * sizeof(tp))) #define LT_EREALLOC(tp, p, n) ((tp *) lt_erealloc ((p), (n) * sizeof(tp))) #endif #define LT_DLMEM_REASSIGN(p, q) LT_STMT_START { \ if ((p) != (q)) { if (p) lt_dlfree (p); (p) = (q); (q) = 0; } \ } LT_STMT_END /* --- REPLACEMENT FUNCTIONS --- */ #undef strdup #define strdup rpl_strdup static char *strdup LT_PARAMS((const char *str)); static char * strdup(str) const char *str; { char *tmp = 0; if (str) { tmp = LT_DLMALLOC (char, 1+ strlen (str)); if (tmp) { strcpy(tmp, str); } } return tmp; } #if ! HAVE_STRCMP #undef strcmp #define strcmp rpl_strcmp static int strcmp LT_PARAMS((const char *str1, const char *str2)); static int strcmp (str1, str2) const char *str1; const char *str2; { if (str1 == str2) return 0; if (str1 == 0) return -1; if (str2 == 0) return 1; for (;*str1 && *str2; ++str1, ++str2) { if (*str1 != *str2) break; } return (int)(*str1 - *str2); } #endif #if ! HAVE_STRCHR # if HAVE_INDEX # define strchr index # else # define strchr rpl_strchr static const char *strchr LT_PARAMS((const char *str, int ch)); static const char* strchr(str, ch) const char *str; int ch; { const char *p; for (p = str; *p != (char)ch && *p != LT_EOS_CHAR; ++p) /*NOWORK*/; return (*p == (char)ch) ? p : 0; } # endif #endif /* !HAVE_STRCHR */ #if ! HAVE_STRRCHR # if HAVE_RINDEX # define strrchr rindex # else # define strrchr rpl_strrchr static const char *strrchr LT_PARAMS((const char *str, int ch)); static const char* strrchr(str, ch) const char *str; int ch; { const char *p, *q = 0; for (p = str; *p != LT_EOS_CHAR; ++p) { if (*p == (char) ch) { q = p; } } return q; } # endif #endif /* NOTE: Neither bcopy nor the memcpy implementation below can reliably handle copying in overlapping areas of memory. Use memmove (for which there is a fallback implmentation below) if you need that behaviour. */ #if ! HAVE_MEMCPY # if HAVE_BCOPY # define memcpy(dest, src, size) bcopy (src, dest, size) # else # define memcpy rpl_memcpy static lt_ptr memcpy LT_PARAMS((lt_ptr dest, const lt_ptr src, size_t size)); static lt_ptr memcpy (dest, src, size) lt_ptr dest; const lt_ptr src; size_t size; { const char * s = src; char * d = dest; size_t i = 0; for (i = 0; i < size; ++i) { d[i] = s[i]; } return dest; } # endif /* !HAVE_BCOPY */ #endif /* !HAVE_MEMCPY */ #if ! HAVE_MEMMOVE # define memmove rpl_memmove static lt_ptr memmove LT_PARAMS((lt_ptr dest, const lt_ptr src, size_t size)); static lt_ptr memmove (dest, src, size) lt_ptr dest; const lt_ptr src; size_t size; { const char * s = src; char * d = dest; size_t i; if (d < s) for (i = 0; i < size; ++i) { d[i] = s[i]; } else if (d > s && size > 0) for (i = size -1; ; --i) { d[i] = s[i]; if (i == 0) break; } return dest; } #endif /* !HAVE_MEMMOVE */ #ifdef LT_USE_WINDOWS_DIRENT_EMULATION static void closedir LT_PARAMS((DIR *entry)); static void closedir(entry) DIR *entry; { assert(entry != (DIR *) NULL); FindClose(entry->hSearch); lt_dlfree((lt_ptr)entry); } static DIR * opendir LT_PARAMS((const char *path)); static DIR* opendir (path) const char *path; { char file_specification[LT_FILENAME_MAX]; DIR *entry; assert(path != (char *) NULL); /* allow space for: path + '\\' '\\' '*' '.' '*' + '\0' */ (void) strncpy (file_specification, path, LT_FILENAME_MAX-6); file_specification[LT_FILENAME_MAX-6] = LT_EOS_CHAR; (void) strcat(file_specification,"\\"); entry = LT_DLMALLOC (DIR,sizeof(DIR)); if (entry != (DIR *) 0) { entry->firsttime = TRUE; entry->hSearch = FindFirstFile(file_specification,&entry->Win32FindData); } if (entry->hSearch == INVALID_HANDLE_VALUE) { (void) strcat(file_specification,"\\*.*"); entry->hSearch = FindFirstFile(file_specification,&entry->Win32FindData); if (entry->hSearch == INVALID_HANDLE_VALUE) { LT_DLFREE (entry); return (DIR *) 0; } } return(entry); } static struct dirent *readdir LT_PARAMS((DIR *entry)); static struct dirent *readdir(entry) DIR *entry; { int status; if (entry == (DIR *) 0) return((struct dirent *) 0); if (!entry->firsttime) { status = FindNextFile(entry->hSearch,&entry->Win32FindData); if (status == 0) return((struct dirent *) 0); } entry->firsttime = FALSE; (void) strncpy(entry->file_info.d_name,entry->Win32FindData.cFileName, LT_FILENAME_MAX-1); entry->file_info.d_name[LT_FILENAME_MAX - 1] = LT_EOS_CHAR; entry->file_info.d_namlen = strlen(entry->file_info.d_name); return(&entry->file_info); } #endif /* LT_USE_WINDOWS_DIRENT_EMULATION */ /* According to Alexandre Oliva , ``realloc is not entirely portable'' In any case we want to use the allocator supplied by the user without burdening them with an lt_dlrealloc function pointer to maintain. Instead implement our own version (with known boundary conditions) using lt_dlmalloc and lt_dlfree. */ /* #undef realloc #define realloc rpl_realloc */ #if 0 /* You can't (re)define realloc unless you also (re)define malloc. Right now, this code uses the size of the *destination* to decide how much to copy. That's not right, but you can't know the size of the source unless you know enough about, or wrote malloc. So this code is disabled... */ static lt_ptr realloc (ptr, size) lt_ptr ptr; size_t size; { if (size == 0) { /* For zero or less bytes, free the original memory */ if (ptr != 0) { lt_dlfree (ptr); } return (lt_ptr) 0; } else if (ptr == 0) { /* Allow reallocation of a NULL pointer. */ return lt_dlmalloc (size); } else { /* Allocate a new block, copy and free the old block. */ lt_ptr mem = lt_dlmalloc (size); if (mem) { memcpy (mem, ptr, size); lt_dlfree (ptr); } /* Note that the contents of PTR are not damaged if there is insufficient memory to realloc. */ return mem; } } #endif #if ! HAVE_ARGZ_APPEND # define argz_append rpl_argz_append static error_t argz_append LT_PARAMS((char **pargz, size_t *pargz_len, const char *buf, size_t buf_len)); static error_t argz_append (pargz, pargz_len, buf, buf_len) char **pargz; size_t *pargz_len; const char *buf; size_t buf_len; { size_t argz_len; char *argz; assert (pargz); assert (pargz_len); assert ((*pargz && *pargz_len) || (!*pargz && !*pargz_len)); /* If nothing needs to be appended, no more work is required. */ if (buf_len == 0) return 0; /* Ensure there is enough room to append BUF_LEN. */ argz_len = *pargz_len + buf_len; argz = LT_DLREALLOC (char, *pargz, argz_len); if (!argz) return ENOMEM; /* Copy characters from BUF after terminating '\0' in ARGZ. */ memcpy (argz + *pargz_len, buf, buf_len); /* Assign new values. */ *pargz = argz; *pargz_len = argz_len; return 0; } #endif /* !HAVE_ARGZ_APPEND */ #if ! HAVE_ARGZ_CREATE_SEP # define argz_create_sep rpl_argz_create_sep static error_t argz_create_sep LT_PARAMS((const char *str, int delim, char **pargz, size_t *pargz_len)); static error_t argz_create_sep (str, delim, pargz, pargz_len) const char *str; int delim; char **pargz; size_t *pargz_len; { size_t argz_len; char *argz = 0; assert (str); assert (pargz); assert (pargz_len); /* Make a copy of STR, but replacing each occurrence of DELIM with '\0'. */ argz_len = 1+ LT_STRLEN (str); if (argz_len) { const char *p; char *q; argz = LT_DLMALLOC (char, argz_len); if (!argz) return ENOMEM; for (p = str, q = argz; *p != LT_EOS_CHAR; ++p) { if (*p == delim) { /* Ignore leading delimiters, and fold consecutive delimiters in STR into a single '\0' in ARGZ. */ if ((q > argz) && (q[-1] != LT_EOS_CHAR)) *q++ = LT_EOS_CHAR; else --argz_len; } else *q++ = *p; } /* Copy terminating LT_EOS_CHAR. */ *q = *p; } /* If ARGZ_LEN has shrunk to nothing, release ARGZ's memory. */ if (!argz_len) LT_DLFREE (argz); /* Assign new values. */ *pargz = argz; *pargz_len = argz_len; return 0; } #endif /* !HAVE_ARGZ_CREATE_SEP */ #if ! HAVE_ARGZ_INSERT # define argz_insert rpl_argz_insert static error_t argz_insert LT_PARAMS((char **pargz, size_t *pargz_len, char *before, const char *entry)); static error_t argz_insert (pargz, pargz_len, before, entry) char **pargz; size_t *pargz_len; char *before; const char *entry; { assert (pargz); assert (pargz_len); assert (entry && *entry); /* No BEFORE address indicates ENTRY should be inserted after the current last element. */ if (!before) return argz_append (pargz, pargz_len, entry, 1+ LT_STRLEN (entry)); /* This probably indicates a programmer error, but to preserve semantics, scan back to the start of an entry if BEFORE points into the middle of it. */ while ((before > *pargz) && (before[-1] != LT_EOS_CHAR)) --before; { size_t entry_len = 1+ LT_STRLEN (entry); size_t argz_len = *pargz_len + entry_len; size_t offset = before - *pargz; char *argz = LT_DLREALLOC (char, *pargz, argz_len); if (!argz) return ENOMEM; /* Make BEFORE point to the equivalent offset in ARGZ that it used to have in *PARGZ incase realloc() moved the block. */ before = argz + offset; /* Move the ARGZ entries starting at BEFORE up into the new space at the end -- making room to copy ENTRY into the resulting gap. */ memmove (before + entry_len, before, *pargz_len - offset); memcpy (before, entry, entry_len); /* Assign new values. */ *pargz = argz; *pargz_len = argz_len; } return 0; } #endif /* !HAVE_ARGZ_INSERT */ #if ! HAVE_ARGZ_NEXT # define argz_next rpl_argz_next static char *argz_next LT_PARAMS((char *argz, size_t argz_len, const char *entry)); static char * argz_next (argz, argz_len, entry) char *argz; size_t argz_len; const char *entry; { assert ((argz && argz_len) || (!argz && !argz_len)); if (entry) { /* Either ARGZ/ARGZ_LEN is empty, or ENTRY points into an address within the ARGZ vector. */ assert ((!argz && !argz_len) || ((argz <= entry) && (entry < (argz + argz_len)))); /* Move to the char immediately after the terminating '\0' of ENTRY. */ entry = 1+ strchr (entry, LT_EOS_CHAR); /* Return either the new ENTRY, or else NULL if ARGZ is exhausted. */ return (entry >= argz + argz_len) ? 0 : (char *) entry; } else { /* This should probably be flagged as a programmer error, since starting an argz_next loop with the iterator set to ARGZ is safer. To preserve semantics, handle the NULL case by returning the start of ARGZ (if any). */ if (argz_len > 0) return argz; else return 0; } } #endif /* !HAVE_ARGZ_NEXT */ #if ! HAVE_ARGZ_STRINGIFY # define argz_stringify rpl_argz_stringify static void argz_stringify LT_PARAMS((char *argz, size_t argz_len, int sep)); static void argz_stringify (argz, argz_len, sep) char *argz; size_t argz_len; int sep; { assert ((argz && argz_len) || (!argz && !argz_len)); if (sep) { --argz_len; /* don't stringify the terminating EOS */ while (--argz_len > 0) { if (argz[argz_len] == LT_EOS_CHAR) argz[argz_len] = sep; } } } #endif /* !HAVE_ARGZ_STRINGIFY */ /* --- TYPE DEFINITIONS -- */ /* This type is used for the array of caller data sets in each handler. */ typedef struct { lt_dlcaller_id key; lt_ptr data; } lt_caller_data; /* --- OPAQUE STRUCTURES DECLARED IN LTDL.H --- */ /* Extract the diagnostic strings from the error table macro in the same order as the enumerated indices in ltdl.h. */ static const char *lt_dlerror_strings[] = { #define LT_ERROR(name, diagnostic) (diagnostic), lt_dlerror_table #undef LT_ERROR 0 }; /* This structure is used for the list of registered loaders. */ struct lt_dlloader { struct lt_dlloader *next; const char *loader_name; /* identifying name for each loader */ const char *sym_prefix; /* prefix for symbols */ lt_module_open *module_open; lt_module_close *module_close; lt_find_sym *find_sym; lt_dlloader_exit *dlloader_exit; lt_user_data dlloader_data; }; struct lt_dlhandle_struct { struct lt_dlhandle_struct *next; lt_dlloader *loader; /* dlopening interface */ lt_dlinfo info; int depcount; /* number of dependencies */ lt_dlhandle *deplibs; /* dependencies */ lt_module module; /* system module handle */ lt_ptr system; /* system specific data */ lt_caller_data *caller_data; /* per caller associated data */ int flags; /* various boolean stats */ }; /* Various boolean flags can be stored in the flags field of an lt_dlhandle_struct... */ #define LT_DLGET_FLAG(handle, flag) (((handle)->flags & (flag)) == (flag)) #define LT_DLSET_FLAG(handle, flag) ((handle)->flags |= (flag)) #define LT_DLRESIDENT_FLAG (0x01 << 0) /* ...add more flags here... */ #define LT_DLIS_RESIDENT(handle) LT_DLGET_FLAG(handle, LT_DLRESIDENT_FLAG) #define LT_DLSTRERROR(name) lt_dlerror_strings[LT_CONC(LT_ERROR_,name)] static const char objdir[] = LTDL_OBJDIR; static const char archive_ext[] = LTDL_ARCHIVE_EXT; #ifdef LTDL_SHLIB_EXT static const char shlib_ext[] = LTDL_SHLIB_EXT; #endif #ifdef LTDL_SYSSEARCHPATH static const char sys_search_path[] = LTDL_SYSSEARCHPATH; #endif /* --- MUTEX LOCKING --- */ /* Macros to make it easier to run the lock functions only if they have been registered. The reason for the complicated lock macro is to ensure that the stored error message from the last error is not accidentally erased if the current function doesn't generate an error of its own. */ #define LT_DLMUTEX_LOCK() LT_STMT_START { \ if (lt_dlmutex_lock_func) (*lt_dlmutex_lock_func)(); \ } LT_STMT_END #define LT_DLMUTEX_UNLOCK() LT_STMT_START { \ if (lt_dlmutex_unlock_func) (*lt_dlmutex_unlock_func)();\ } LT_STMT_END #define LT_DLMUTEX_SETERROR(errormsg) LT_STMT_START { \ if (lt_dlmutex_seterror_func) \ (*lt_dlmutex_seterror_func) (errormsg); \ else lt_dllast_error = (errormsg); } LT_STMT_END #define LT_DLMUTEX_GETERROR(errormsg) LT_STMT_START { \ if (lt_dlmutex_seterror_func) \ (errormsg) = (*lt_dlmutex_geterror_func) (); \ else (errormsg) = lt_dllast_error; } LT_STMT_END /* The mutex functions stored here are global, and are necessarily the same for all threads that wish to share access to libltdl. */ static lt_dlmutex_lock *lt_dlmutex_lock_func = 0; static lt_dlmutex_unlock *lt_dlmutex_unlock_func = 0; static lt_dlmutex_seterror *lt_dlmutex_seterror_func = 0; static lt_dlmutex_geterror *lt_dlmutex_geterror_func = 0; static const char *lt_dllast_error = 0; /* Either set or reset the mutex functions. Either all the arguments must be valid functions, or else all can be NULL to turn off locking entirely. The registered functions should be manipulating a static global lock from the lock() and unlock() callbacks, which needs to be reentrant. */ int lt_dlmutex_register (lock, unlock, seterror, geterror) lt_dlmutex_lock *lock; lt_dlmutex_unlock *unlock; lt_dlmutex_seterror *seterror; lt_dlmutex_geterror *geterror; { lt_dlmutex_unlock *old_unlock = unlock; int errors = 0; /* Lock using the old lock() callback, if any. */ LT_DLMUTEX_LOCK (); if ((lock && unlock && seterror && geterror) || !(lock || unlock || seterror || geterror)) { lt_dlmutex_lock_func = lock; lt_dlmutex_unlock_func = unlock; lt_dlmutex_geterror_func = geterror; } else { LT_DLMUTEX_SETERROR (LT_DLSTRERROR (INVALID_MUTEX_ARGS)); ++errors; } /* Use the old unlock() callback we saved earlier, if any. Otherwise record any errors using internal storage. */ if (old_unlock) (*old_unlock) (); /* Return the number of errors encountered during the execution of this function. */ return errors; } /* --- ERROR HANDLING --- */ static const char **user_error_strings = 0; static int errorcount = LT_ERROR_MAX; int lt_dladderror (diagnostic) const char *diagnostic; { int errindex = 0; int result = -1; const char **temp = (const char **) 0; assert (diagnostic); LT_DLMUTEX_LOCK (); errindex = errorcount - LT_ERROR_MAX; temp = LT_EREALLOC (const char *, user_error_strings, 1 + errindex); if (temp) { user_error_strings = temp; user_error_strings[errindex] = diagnostic; result = errorcount++; } LT_DLMUTEX_UNLOCK (); return result; } int lt_dlseterror (errindex) int errindex; { int errors = 0; LT_DLMUTEX_LOCK (); if (errindex >= errorcount || errindex < 0) { /* Ack! Error setting the error message! */ LT_DLMUTEX_SETERROR (LT_DLSTRERROR (INVALID_ERRORCODE)); ++errors; } else if (errindex < LT_ERROR_MAX) { /* No error setting the error message! */ LT_DLMUTEX_SETERROR (lt_dlerror_strings[errindex]); } else { /* No error setting the error message! */ LT_DLMUTEX_SETERROR (user_error_strings[errindex - LT_ERROR_MAX]); } LT_DLMUTEX_UNLOCK (); return errors; } static lt_ptr lt_emalloc (size) size_t size; { lt_ptr mem = lt_dlmalloc (size); if (size && !mem) LT_DLMUTEX_SETERROR (LT_DLSTRERROR (NO_MEMORY)); return mem; } static lt_ptr lt_erealloc (addr, size) lt_ptr addr; size_t size; { lt_ptr mem = lt_dlrealloc (addr, size); if (size && !mem) LT_DLMUTEX_SETERROR (LT_DLSTRERROR (NO_MEMORY)); return mem; } static char * lt_estrdup (str) const char *str; { char *copy = strdup (str); if (LT_STRLEN (str) && !copy) LT_DLMUTEX_SETERROR (LT_DLSTRERROR (NO_MEMORY)); return copy; } /* --- DLOPEN() INTERFACE LOADER --- */ #if HAVE_LIBDL /* dynamic linking with dlopen/dlsym */ #if HAVE_DLFCN_H # include #endif #if HAVE_SYS_DL_H # include #endif #ifdef RTLD_GLOBAL # define LT_GLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_GLOBAL DL_GLOBAL # endif #endif /* !RTLD_GLOBAL */ #ifndef LT_GLOBAL # define LT_GLOBAL 0 #endif /* !LT_GLOBAL */ /* We may have to define LT_LAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_LAZY_OR_NOW # ifdef RTLD_LAZY # define LT_LAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_LAZY_OR_NOW DL_LAZY # endif # endif /* !RTLD_LAZY */ #endif #ifndef LT_LAZY_OR_NOW # ifdef RTLD_NOW # define LT_LAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_LAZY_OR_NOW DL_NOW # endif # endif /* !RTLD_NOW */ #endif #ifndef LT_LAZY_OR_NOW # define LT_LAZY_OR_NOW 0 #endif /* !LT_LAZY_OR_NOW */ #if HAVE_DLERROR # define DLERROR(arg) dlerror () #else # define DLERROR(arg) LT_DLSTRERROR (arg) #endif static lt_module sys_dl_open (loader_data, filename) lt_user_data loader_data; const char *filename; { lt_module module = dlopen (filename, LT_GLOBAL | LT_LAZY_OR_NOW); if (!module) { LT_DLMUTEX_SETERROR (DLERROR (CANNOT_OPEN)); } return module; } static int sys_dl_close (loader_data, module) lt_user_data loader_data; lt_module module; { int errors = 0; if (dlclose (module) != 0) { LT_DLMUTEX_SETERROR (DLERROR (CANNOT_CLOSE)); ++errors; } return errors; } static lt_ptr sys_dl_sym (loader_data, module, symbol) lt_user_data loader_data; lt_module module; const char *symbol; { lt_ptr address = dlsym (module, symbol); if (!address) { LT_DLMUTEX_SETERROR (DLERROR (SYMBOL_NOT_FOUND)); } return address; } static struct lt_user_dlloader sys_dl = { # ifdef NEED_USCORE "_", # else 0, # endif sys_dl_open, sys_dl_close, sys_dl_sym, 0, 0 }; #endif /* HAVE_LIBDL */ /* --- SHL_LOAD() INTERFACE LOADER --- */ #if HAVE_SHL_LOAD /* dynamic linking with shl_load (HP-UX) (comments from gmodule) */ #ifdef HAVE_DL_H # include #endif /* some flags are missing on some systems, so we provide * harmless defaults. * * Mandatory: * BIND_IMMEDIATE - Resolve symbol references when the library is loaded. * BIND_DEFERRED - Delay code symbol resolution until actual reference. * * Optionally: * BIND_FIRST - Place the library at the head of the symbol search * order. * BIND_NONFATAL - The default BIND_IMMEDIATE behavior is to treat all * unsatisfied symbols as fatal. This flag allows * binding of unsatisfied code symbols to be deferred * until use. * [Perl: For certain libraries, like DCE, deferred * binding often causes run time problems. Adding * BIND_NONFATAL to BIND_IMMEDIATE still allows * unresolved references in situations like this.] * BIND_NOSTART - Do not call the initializer for the shared library * when the library is loaded, nor on a future call to * shl_unload(). * BIND_VERBOSE - Print verbose messages concerning possible * unsatisfied symbols. * * hp9000s700/hp9000s800: * BIND_RESTRICTED - Restrict symbols visible by the library to those * present at library load time. * DYNAMIC_PATH - Allow the loader to dynamically search for the * library specified by the path argument. */ #ifndef DYNAMIC_PATH # define DYNAMIC_PATH 0 #endif #ifndef BIND_RESTRICTED # define BIND_RESTRICTED 0 #endif #define LT_BIND_FLAGS (BIND_IMMEDIATE | BIND_NONFATAL | DYNAMIC_PATH) static lt_module sys_shl_open (loader_data, filename) lt_user_data loader_data; const char *filename; { static shl_t self = (shl_t) 0; lt_module module = shl_load (filename, LT_BIND_FLAGS, 0L); /* Since searching for a symbol against a NULL module handle will also look in everything else that was already loaded and exported with the -E compiler flag, we always cache a handle saved before any modules are loaded. */ if (!self) { lt_ptr address; shl_findsym (&self, "main", TYPE_UNDEFINED, &address); } if (!filename) { module = self; } else { module = shl_load (filename, LT_BIND_FLAGS, 0L); if (!module) { LT_DLMUTEX_SETERROR (LT_DLSTRERROR (CANNOT_OPEN)); } } return module; } static int sys_shl_close (loader_data, module) lt_user_data loader_data; lt_module module; { int errors = 0; if (module && (shl_unload ((shl_t) (module)) != 0)) { LT_DLMUTEX_SETERROR (LT_DLSTRERROR (CANNOT_CLOSE)); ++errors; } return errors; } static lt_ptr sys_shl_sym (loader_data, module, symbol) lt_user_data loader_data; lt_module module; const char *symbol; { lt_ptr address = 0; /* sys_shl_open should never return a NULL module handle */ if (module == (lt_module) 0) { LT_DLMUTEX_SETERROR (LT_DLSTRERROR (INVALID_HANDLE)); } else if (!shl_findsym((shl_t*) &module, symbol, TYPE_UNDEFINED, &address)) { if (!address) { LT_DLMUTEX_SETERROR (LT_DLSTRERROR (SYMBOL_NOT_FOUND)); } } return address; } static struct lt_user_dlloader sys_shl = { 0, sys_shl_open, sys_shl_close, sys_shl_sym, 0, 0 }; #endif /* HAVE_SHL_LOAD */ /* --- LOADLIBRARY() INTERFACE LOADER --- */ #ifdef __WINDOWS__ /* dynamic linking for Win32 */ #include /* Forward declaration; required to implement handle search below. */ static lt_dlhandle handles; static lt_module sys_wll_open (loader_data, filename) lt_user_data loader_data; const char *filename; { lt_dlhandle cur; lt_module module = 0; const char *errormsg = 0; char *searchname = 0; char *ext; char self_name_buf[MAX_PATH]; if (!filename) { /* Get the name of main module */ *self_name_buf = 0; GetModuleFileName (NULL, self_name_buf, sizeof (self_name_buf)); filename = ext = self_name_buf; } else { ext = strrchr (filename, '.'); } if (ext) { /* FILENAME already has an extension. */ searchname = lt_estrdup (filename); } else { /* Append a `.' to stop Windows from adding an implicit `.dll' extension. */ searchname = LT_EMALLOC (char, 2+ LT_STRLEN (filename)); if (searchname) sprintf (searchname, "%s.", filename); } if (!searchname) return 0; { /* Silence dialog from LoadLibrary on some failures. No way to get the error mode, but to set it, so set it twice to preserve any previous flags. */ UINT errormode = SetErrorMode(SEM_FAILCRITICALERRORS); SetErrorMode(errormode | SEM_FAILCRITICALERRORS); #if defined(__CYGWIN__) { char wpath[MAX_PATH]; cygwin_conv_to_full_win32_path (searchname, wpath); module = LoadLibrary (wpath); } #else module = LoadLibrary (searchname); #endif /* Restore the error mode. */ SetErrorMode(errormode); } LT_DLFREE (searchname); /* libltdl expects this function to fail if it is unable to physically load the library. Sadly, LoadLibrary will search the loaded libraries for a match and return one of them if the path search load fails. We check whether LoadLibrary is returning a handle to an already loaded module, and simulate failure if we find one. */ LT_DLMUTEX_LOCK (); cur = handles; while (cur) { if (!cur->module) { cur = 0; break; } if (cur->module == module) { break; } cur = cur->next; } LT_DLMUTEX_UNLOCK (); if (cur || !module) { LT_DLMUTEX_SETERROR (LT_DLSTRERROR (CANNOT_OPEN)); module = 0; } return module; } static int sys_wll_close (loader_data, module) lt_user_data loader_data; lt_module module; { int errors = 0; if (FreeLibrary(module) == 0) { LT_DLMUTEX_SETERROR (LT_DLSTRERROR (CANNOT_CLOSE)); ++errors; } return errors; } static lt_ptr sys_wll_sym (loader_data, module, symbol) lt_user_data loader_data; lt_module module; const char *symbol; { lt_ptr address = GetProcAddress (module, symbol); if (!address) { LT_DLMUTEX_SETERROR (LT_DLSTRERROR (SYMBOL_NOT_FOUND)); } return address; } static struct lt_user_dlloader sys_wll = { 0, sys_wll_open, sys_wll_close, sys_wll_sym, 0, 0 }; #endif /* __WINDOWS__ */ /* --- LOAD_ADD_ON() INTERFACE LOADER --- */ #ifdef __BEOS__ /* dynamic linking for BeOS */ #include static lt_module sys_bedl_open (loader_data, filename) lt_user_data loader_data; const char *filename; { image_id image = 0; if (filename) { image = load_add_on (filename); } else { image_info info; int32 cookie = 0; if (get_next_image_info (0, &cookie, &info) == B_OK) image = load_add_on (info.name); } if (image <= 0) { LT_DLMUTEX_SETERROR (LT_DLSTRERROR (CANNOT_OPEN)); image = 0; } return (lt_module) image; } static int sys_bedl_close (loader_data, module) lt_user_data loader_data; lt_module module; { int errors = 0; if (unload_add_on ((image_id) module) != B_OK) { LT_DLMUTEX_SETERROR (LT_DLSTRERROR (CANNOT_CLOSE)); ++errors; } return errors; } static lt_ptr sys_bedl_sym (loader_data, module, symbol) lt_user_data loader_data; lt_module module; const char *symbol; { lt_ptr address = 0; image_id image = (image_id) module; if (get_image_symbol (image, symbol, B_SYMBOL_TYPE_ANY, address) != B_OK) { LT_DLMUTEX_SETERROR (LT_DLSTRERROR (SYMBOL_NOT_FOUND)); address = 0; } return address; } static struct lt_user_dlloader sys_bedl = { 0, sys_bedl_open, sys_bedl_close, sys_bedl_sym, 0, 0 }; #endif /* __BEOS__ */ /* --- DLD_LINK() INTERFACE LOADER --- */ #if HAVE_DLD /* dynamic linking with dld */ #if HAVE_DLD_H #include #endif static lt_module sys_dld_open (loader_data, filename) lt_user_data loader_data; const char *filename; { lt_module module = strdup (filename); if (dld_link (filename) != 0) { LT_DLMUTEX_SETERROR (LT_DLSTRERROR (CANNOT_OPEN)); LT_DLFREE (module); module = 0; } return module; } static int sys_dld_close (loader_data, module) lt_user_data loader_data; lt_module module; { int errors = 0; if (dld_unlink_by_file ((char*)(module), 1) != 0) { LT_DLMUTEX_SETERROR (LT_DLSTRERROR (CANNOT_CLOSE)); ++errors; } else { LT_DLFREE (module); } return errors; } static lt_ptr sys_dld_sym (loader_data, module, symbol) lt_user_data loader_data; lt_module module; const char *symbol; { lt_ptr address = dld_get_func (symbol); if (!address) { LT_DLMUTEX_SETERROR (LT_DLSTRERROR (SYMBOL_NOT_FOUND)); } return address; } static struct lt_user_dlloader sys_dld = { 0, sys_dld_open, sys_dld_close, sys_dld_sym, 0, 0 }; #endif /* HAVE_DLD */ /* --- DYLD() MACOSX/DARWIN INTERFACE LOADER --- */ #if HAVE_DYLD #if HAVE_MACH_O_DYLD_H #if !defined(__APPLE_CC__) && !defined(__MWERKS__) && !defined(__private_extern__) /* Is this correct? Does it still function properly? */ #define __private_extern__ extern #endif # include #endif #include /* We have to put some stuff here that isn't in older dyld.h files */ #ifndef ENUM_DYLD_BOOL # define ENUM_DYLD_BOOL # undef FALSE # undef TRUE enum DYLD_BOOL { FALSE, TRUE }; #endif #ifndef LC_REQ_DYLD # define LC_REQ_DYLD 0x80000000 #endif #ifndef LC_LOAD_WEAK_DYLIB # define LC_LOAD_WEAK_DYLIB (0x18 | LC_REQ_DYLD) #endif static const struct mach_header * (*ltdl_NSAddImage)(const char *image_name, unsigned long options) = 0; static NSSymbol (*ltdl_NSLookupSymbolInImage)(const struct mach_header *image,const char *symbolName, unsigned long options) = 0; static enum DYLD_BOOL (*ltdl_NSIsSymbolNameDefinedInImage)(const struct mach_header *image, const char *symbolName) = 0; static enum DYLD_BOOL (*ltdl_NSMakePrivateModulePublic)(NSModule module) = 0; #ifndef NSADDIMAGE_OPTION_NONE #define NSADDIMAGE_OPTION_NONE 0x0 #endif #ifndef NSADDIMAGE_OPTION_RETURN_ON_ERROR #define NSADDIMAGE_OPTION_RETURN_ON_ERROR 0x1 #endif #ifndef NSADDIMAGE_OPTION_WITH_SEARCHING #define NSADDIMAGE_OPTION_WITH_SEARCHING 0x2 #endif #ifndef NSADDIMAGE_OPTION_RETURN_ONLY_IF_LOADED #define NSADDIMAGE_OPTION_RETURN_ONLY_IF_LOADED 0x4 #endif #ifndef NSADDIMAGE_OPTION_MATCH_FILENAME_BY_INSTALLNAME #define NSADDIMAGE_OPTION_MATCH_FILENAME_BY_INSTALLNAME 0x8 #endif #ifndef NSLOOKUPSYMBOLINIMAGE_OPTION_BIND #define NSLOOKUPSYMBOLINIMAGE_OPTION_BIND 0x0 #endif #ifndef NSLOOKUPSYMBOLINIMAGE_OPTION_BIND_NOW #define NSLOOKUPSYMBOLINIMAGE_OPTION_BIND_NOW 0x1 #endif #ifndef NSLOOKUPSYMBOLINIMAGE_OPTION_BIND_FULLY #define NSLOOKUPSYMBOLINIMAGE_OPTION_BIND_FULLY 0x2 #endif #ifndef NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR #define NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR 0x4 #endif static const char * lt_int_dyld_error(othererror) char* othererror; { /* return the dyld error string, or the passed in error string if none */ NSLinkEditErrors ler; int lerno; const char *errstr; const char *file; NSLinkEditError(&ler,&lerno,&file,&errstr); if (!errstr || !strlen(errstr)) errstr = othererror; return errstr; } static const struct mach_header * lt_int_dyld_get_mach_header_from_nsmodule(module) NSModule module; { /* There should probably be an apple dyld api for this */ int i=_dyld_image_count(); int j; const char *modname=NSNameOfModule(module); const struct mach_header *mh=NULL; if (!modname) return NULL; for (j = 0; j < i; j++) { if (!strcmp(_dyld_get_image_name(j),modname)) { mh=_dyld_get_image_header(j); break; } } return mh; } static const char* lt_int_dyld_lib_install_name(mh) const struct mach_header *mh; { /* NSAddImage is also used to get the loaded image, but it only works if the lib is installed, for uninstalled libs we need to check the install_names against each other. Note that this is still broken if DYLD_IMAGE_SUFFIX is set and a different lib was loaded as a result */ int j; struct load_command *lc; unsigned long offset = sizeof(struct mach_header); const char* retStr=NULL; for (j = 0; j < mh->ncmds; j++) { lc = (struct load_command*)(((unsigned long)mh) + offset); if (LC_ID_DYLIB == lc->cmd) { retStr=(char*)(((struct dylib_command*)lc)->dylib.name.offset + (unsigned long)lc); } offset += lc->cmdsize; } return retStr; } static const struct mach_header * lt_int_dyld_match_loaded_lib_by_install_name(const char *name) { int i=_dyld_image_count(); int j; const struct mach_header *mh=NULL; const char *id=NULL; for (j = 0; j < i; j++) { id=lt_int_dyld_lib_install_name(_dyld_get_image_header(j)); if ((id) && (!strcmp(id,name))) { mh=_dyld_get_image_header(j); break; } } return mh; } static NSSymbol lt_int_dyld_NSlookupSymbolInLinkedLibs(symbol,mh) const char *symbol; const struct mach_header *mh; { /* Safe to assume our mh is good */ int j; struct load_command *lc; unsigned long offset = sizeof(struct mach_header); NSSymbol retSym = 0; const struct mach_header *mh1; if ((ltdl_NSLookupSymbolInImage) && NSIsSymbolNameDefined(symbol) ) { for (j = 0; j < mh->ncmds; j++) { lc = (struct load_command*)(((unsigned long)mh) + offset); if ((LC_LOAD_DYLIB == lc->cmd) || (LC_LOAD_WEAK_DYLIB == lc->cmd)) { mh1=lt_int_dyld_match_loaded_lib_by_install_name((char*)(((struct dylib_command*)lc)->dylib.name.offset + (unsigned long)lc)); if (!mh1) { /* Maybe NSAddImage can find it */ mh1=ltdl_NSAddImage((char*)(((struct dylib_command*)lc)->dylib.name.offset + (unsigned long)lc), NSADDIMAGE_OPTION_RETURN_ONLY_IF_LOADED + NSADDIMAGE_OPTION_WITH_SEARCHING + NSADDIMAGE_OPTION_RETURN_ON_ERROR ); } if (mh1) { retSym = ltdl_NSLookupSymbolInImage(mh1, symbol, NSLOOKUPSYMBOLINIMAGE_OPTION_BIND_NOW | NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR ); if (retSym) break; } } offset += lc->cmdsize; } } return retSym; } static int sys_dyld_init() { int retCode = 0; int err = 0; if (!_dyld_present()) { retCode=1; } else { err = _dyld_func_lookup("__dyld_NSAddImage",(unsigned long*)<dl_NSAddImage); err = _dyld_func_lookup("__dyld_NSLookupSymbolInImage",(unsigned long*)<dl_NSLookupSymbolInImage); err = _dyld_func_lookup("__dyld_NSIsSymbolNameDefinedInImage",(unsigned long*)<dl_NSIsSymbolNameDefinedInImage); err = _dyld_func_lookup("__dyld_NSMakePrivateModulePublic",(unsigned long*)<dl_NSMakePrivateModulePublic); } return retCode; } static lt_module sys_dyld_open (loader_data, filename) lt_user_data loader_data; const char *filename; { lt_module module = 0; NSObjectFileImage ofi = 0; NSObjectFileImageReturnCode ofirc; if (!filename) return (lt_module)-1; ofirc = NSCreateObjectFileImageFromFile(filename, &ofi); switch (ofirc) { case NSObjectFileImageSuccess: module = NSLinkModule(ofi, filename, NSLINKMODULE_OPTION_RETURN_ON_ERROR | NSLINKMODULE_OPTION_PRIVATE | NSLINKMODULE_OPTION_BINDNOW); NSDestroyObjectFileImage(ofi); if (module) ltdl_NSMakePrivateModulePublic(module); break; case NSObjectFileImageInappropriateFile: if (ltdl_NSIsSymbolNameDefinedInImage && ltdl_NSLookupSymbolInImage) { module = (lt_module)ltdl_NSAddImage(filename, NSADDIMAGE_OPTION_RETURN_ON_ERROR); break; } default: LT_DLMUTEX_SETERROR (lt_int_dyld_error(LT_DLSTRERROR(CANNOT_OPEN))); return 0; } if (!module) LT_DLMUTEX_SETERROR (lt_int_dyld_error(LT_DLSTRERROR(CANNOT_OPEN))); return module; } static int sys_dyld_close (loader_data, module) lt_user_data loader_data; lt_module module; { int retCode = 0; int flags = 0; if (module == (lt_module)-1) return 0; #ifdef __BIG_ENDIAN__ if (((struct mach_header *)module)->magic == MH_MAGIC) #else if (((struct mach_header *)module)->magic == MH_CIGAM) #endif { LT_DLMUTEX_SETERROR("Can not close a dylib"); retCode = 1; } else { #if 1 /* Currently, if a module contains c++ static destructors and it is unloaded, we get a segfault in atexit(), due to compiler and dynamic loader differences of opinion, this works around that. */ if ((const struct section *)NULL != getsectbynamefromheader(lt_int_dyld_get_mach_header_from_nsmodule(module), "__DATA","__mod_term_func")) { flags += NSUNLINKMODULE_OPTION_KEEP_MEMORY_MAPPED; } #endif #ifdef __ppc__ flags += NSUNLINKMODULE_OPTION_RESET_LAZY_REFERENCES; #endif if (!NSUnLinkModule(module,flags)) { retCode=1; LT_DLMUTEX_SETERROR (lt_int_dyld_error(LT_DLSTRERROR(CANNOT_CLOSE))); } } return retCode; } static lt_ptr sys_dyld_sym (loader_data, module, symbol) lt_user_data loader_data; lt_module module; const char *symbol; { lt_ptr address = 0; NSSymbol *nssym = 0; void *unused; const struct mach_header *mh=NULL; char saveError[256] = "Symbol not found"; if (module == (lt_module)-1) { _dyld_lookup_and_bind(symbol,(unsigned long*)&address,&unused); return address; } #ifdef __BIG_ENDIAN__ if (((struct mach_header *)module)->magic == MH_MAGIC) #else if (((struct mach_header *)module)->magic == MH_CIGAM) #endif { if (ltdl_NSIsSymbolNameDefinedInImage && ltdl_NSLookupSymbolInImage) { mh=module; if (ltdl_NSIsSymbolNameDefinedInImage((struct mach_header*)module,symbol)) { nssym = ltdl_NSLookupSymbolInImage((struct mach_header*)module, symbol, NSLOOKUPSYMBOLINIMAGE_OPTION_BIND_NOW | NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR ); } } } else { nssym = NSLookupSymbolInModule(module, symbol); } if (!nssym) { strncpy(saveError, lt_int_dyld_error(LT_DLSTRERROR(SYMBOL_NOT_FOUND)), 255); saveError[255] = 0; if (!mh) mh=lt_int_dyld_get_mach_header_from_nsmodule(module); nssym = lt_int_dyld_NSlookupSymbolInLinkedLibs(symbol,mh); } if (!nssym) { LT_DLMUTEX_SETERROR (saveError); return NULL; } return NSAddressOfSymbol(nssym); } static struct lt_user_dlloader sys_dyld = { "_", sys_dyld_open, sys_dyld_close, sys_dyld_sym, 0, 0 }; #endif /* HAVE_DYLD */ /* --- DLPREOPEN() INTERFACE LOADER --- */ /* emulate dynamic linking using preloaded_symbols */ typedef struct lt_dlsymlists_t { struct lt_dlsymlists_t *next; const lt_dlsymlist *syms; } lt_dlsymlists_t; static const lt_dlsymlist *default_preloaded_symbols = 0; static lt_dlsymlists_t *preloaded_symbols = 0; static int presym_init (loader_data) lt_user_data loader_data; { int errors = 0; LT_DLMUTEX_LOCK (); preloaded_symbols = 0; if (default_preloaded_symbols) { errors = lt_dlpreload (default_preloaded_symbols); } LT_DLMUTEX_UNLOCK (); return errors; } static int presym_free_symlists () { lt_dlsymlists_t *lists; LT_DLMUTEX_LOCK (); lists = preloaded_symbols; while (lists) { lt_dlsymlists_t *tmp = lists; lists = lists->next; LT_DLFREE (tmp); } preloaded_symbols = 0; LT_DLMUTEX_UNLOCK (); return 0; } static int presym_exit (loader_data) lt_user_data loader_data; { presym_free_symlists (); return 0; } static int presym_add_symlist (preloaded) const lt_dlsymlist *preloaded; { lt_dlsymlists_t *tmp; lt_dlsymlists_t *lists; int errors = 0; LT_DLMUTEX_LOCK (); lists = preloaded_symbols; while (lists) { if (lists->syms == preloaded) { goto done; } lists = lists->next; } tmp = LT_EMALLOC (lt_dlsymlists_t, 1); if (tmp) { memset (tmp, 0, sizeof(lt_dlsymlists_t)); tmp->syms = preloaded; tmp->next = preloaded_symbols; preloaded_symbols = tmp; } else { ++errors; } done: LT_DLMUTEX_UNLOCK (); return errors; } static lt_module presym_open (loader_data, filename) lt_user_data loader_data; const char *filename; { lt_dlsymlists_t *lists; lt_module module = (lt_module) 0; LT_DLMUTEX_LOCK (); lists = preloaded_symbols; if (!lists) { LT_DLMUTEX_SETERROR (LT_DLSTRERROR (NO_SYMBOLS)); goto done; } /* Can't use NULL as the reflective symbol header, as NULL is used to mark the end of the entire symbol list. Self-dlpreopened symbols follow this magic number, chosen to be an unlikely clash with a real module name. */ if (!filename) { filename = "@PROGRAM@"; } while (lists) { const lt_dlsymlist *syms = lists->syms; while (syms->name) { if (!syms->address && strcmp(syms->name, filename) == 0) { module = (lt_module) syms; goto done; } ++syms; } lists = lists->next; } LT_DLMUTEX_SETERROR (LT_DLSTRERROR (FILE_NOT_FOUND)); done: LT_DLMUTEX_UNLOCK (); return module; } static int presym_close (loader_data, module) lt_user_data loader_data; lt_module module; { /* Just to silence gcc -Wall */ module = 0; return 0; } static lt_ptr presym_sym (loader_data, module, symbol) lt_user_data loader_data; lt_module module; const char *symbol; { lt_dlsymlist *syms = (lt_dlsymlist*) module; ++syms; while (syms->address) { if (strcmp(syms->name, symbol) == 0) { return syms->address; } ++syms; } LT_DLMUTEX_SETERROR (LT_DLSTRERROR (SYMBOL_NOT_FOUND)); return 0; } static struct lt_user_dlloader presym = { 0, presym_open, presym_close, presym_sym, presym_exit, 0 }; /* --- DYNAMIC MODULE LOADING --- */ /* The type of a function used at each iteration of foreach_dirinpath(). */ typedef int foreach_callback_func LT_PARAMS((char *filename, lt_ptr data1, lt_ptr data2)); static int foreach_dirinpath LT_PARAMS((const char *search_path, const char *base_name, foreach_callback_func *func, lt_ptr data1, lt_ptr data2)); static int find_file_callback LT_PARAMS((char *filename, lt_ptr data, lt_ptr ignored)); static int find_handle_callback LT_PARAMS((char *filename, lt_ptr data, lt_ptr ignored)); static int foreachfile_callback LT_PARAMS((char *filename, lt_ptr data1, lt_ptr data2)); static int canonicalize_path LT_PARAMS((const char *path, char **pcanonical)); static int argzize_path LT_PARAMS((const char *path, char **pargz, size_t *pargz_len)); static FILE *find_file LT_PARAMS((const char *search_path, const char *base_name, char **pdir)); static lt_dlhandle *find_handle LT_PARAMS((const char *search_path, const char *base_name, lt_dlhandle *handle)); static int find_module LT_PARAMS((lt_dlhandle *handle, const char *dir, const char *libdir, const char *dlname, const char *old_name, int installed)); static int free_vars LT_PARAMS((char *dlname, char *oldname, char *libdir, char *deplibs)); static int load_deplibs LT_PARAMS((lt_dlhandle handle, char *deplibs)); static int trim LT_PARAMS((char **dest, const char *str)); static int try_dlopen LT_PARAMS((lt_dlhandle *handle, const char *filename)); static int tryall_dlopen LT_PARAMS((lt_dlhandle *handle, const char *filename, const char * useloader)); static int unload_deplibs LT_PARAMS((lt_dlhandle handle)); static int lt_argz_insert LT_PARAMS((char **pargz, size_t *pargz_len, char *before, const char *entry)); static int lt_argz_insertinorder LT_PARAMS((char **pargz, size_t *pargz_len, const char *entry)); static int lt_argz_insertdir LT_PARAMS((char **pargz, size_t *pargz_len, const char *dirnam, struct dirent *dp)); static int lt_dlpath_insertdir LT_PARAMS((char **ppath, char *before, const char *dir)); static int list_files_by_dir LT_PARAMS((const char *dirnam, char **pargz, size_t *pargz_len)); static int file_not_found LT_PARAMS((void)); static char *user_search_path= 0; static lt_dlloader *loaders = 0; static lt_dlhandle handles = 0; static int initialized = 0; /* Initialize libltdl. */ int lt_dlinit () { int errors = 0; LT_DLMUTEX_LOCK (); /* Initialize only at first call. */ if (++initialized == 1) { handles = 0; user_search_path = 0; /* empty search path */ #if HAVE_LIBDL errors += lt_dlloader_add (lt_dlloader_next (0), &sys_dl, "dlopen"); #endif #if HAVE_SHL_LOAD errors += lt_dlloader_add (lt_dlloader_next (0), &sys_shl, "dlopen"); #endif #ifdef __WINDOWS__ errors += lt_dlloader_add (lt_dlloader_next (0), &sys_wll, "dlopen"); #endif #ifdef __BEOS__ errors += lt_dlloader_add (lt_dlloader_next (0), &sys_bedl, "dlopen"); #endif #if HAVE_DLD errors += lt_dlloader_add (lt_dlloader_next (0), &sys_dld, "dld"); #endif #if HAVE_DYLD errors += lt_dlloader_add (lt_dlloader_next (0), &sys_dyld, "dyld"); errors += sys_dyld_init(); #endif errors += lt_dlloader_add (lt_dlloader_next (0), &presym, "dlpreload"); if (presym_init (presym.dlloader_data)) { LT_DLMUTEX_SETERROR (LT_DLSTRERROR (INIT_LOADER)); ++errors; } else if (errors != 0) { LT_DLMUTEX_SETERROR (LT_DLSTRERROR (DLOPEN_NOT_SUPPORTED)); ++errors; } } LT_DLMUTEX_UNLOCK (); return errors; } int lt_dlpreload (preloaded) const lt_dlsymlist *preloaded; { int errors = 0; if (preloaded) { errors = presym_add_symlist (preloaded); } else { presym_free_symlists(); LT_DLMUTEX_LOCK (); if (default_preloaded_symbols) { errors = lt_dlpreload (default_preloaded_symbols); } LT_DLMUTEX_UNLOCK (); } return errors; } int lt_dlpreload_default (preloaded) const lt_dlsymlist *preloaded; { LT_DLMUTEX_LOCK (); default_preloaded_symbols = preloaded; LT_DLMUTEX_UNLOCK (); return 0; } int lt_dlexit () { /* shut down libltdl */ lt_dlloader *loader; int errors = 0; LT_DLMUTEX_LOCK (); loader = loaders; if (!initialized) { LT_DLMUTEX_SETERROR (LT_DLSTRERROR (SHUTDOWN)); ++errors; goto done; } /* shut down only at last call. */ if (--initialized == 0) { int level; while (handles && LT_DLIS_RESIDENT (handles)) { handles = handles->next; } /* close all modules */ for (level = 1; handles; ++level) { lt_dlhandle cur = handles; int saw_nonresident = 0; while (cur) { lt_dlhandle tmp = cur; cur = cur->next; if (!LT_DLIS_RESIDENT (tmp)) saw_nonresident = 1; if (!LT_DLIS_RESIDENT (tmp) && tmp->info.ref_count <= level) { if (lt_dlclose (tmp)) { ++errors; } } } /* done if only resident modules are left */ if (!saw_nonresident) break; } /* close all loaders */ while (loader) { lt_dlloader *next = loader->next; lt_user_data data = loader->dlloader_data; if (loader->dlloader_exit && loader->dlloader_exit (data)) { ++errors; } LT_DLMEM_REASSIGN (loader, next); } loaders = 0; LT_DLFREE (user_search_path); } done: LT_DLMUTEX_UNLOCK (); return errors; } static int tryall_dlopen (handle, filename, useloader) lt_dlhandle *handle; const char *filename; const char *useloader; { lt_dlhandle cur; lt_dlloader *loader; const char *saved_error; int errors = 0; LT_DLMUTEX_GETERROR (saved_error); LT_DLMUTEX_LOCK (); cur = handles; loader = loaders; /* check whether the module was already opened */ while (cur) { /* try to dlopen the program itself? */ if (!cur->info.filename && !filename) { break; } if (cur->info.filename && filename && strcmp (cur->info.filename, filename) == 0) { break; } cur = cur->next; } if (cur) { ++cur->info.ref_count; *handle = cur; goto done; } cur = *handle; if (filename) { /* Comment out the check of file permissions using access. This call seems to always return -1 with error EACCES. */ /* We need to catch missing file errors early so that file_not_found() can detect what happened. if (access (filename, R_OK) != 0) { LT_DLMUTEX_SETERROR (LT_DLSTRERROR (FILE_NOT_FOUND)); ++errors; goto done; } */ cur->info.filename = lt_estrdup (filename); if (!cur->info.filename) { ++errors; goto done; } } else { cur->info.filename = 0; } while (loader) { if (useloader && strcmp(loader->loader_name, useloader)) { loader = loader->next; continue; } lt_user_data data = loader->dlloader_data; cur->module = loader->module_open (data, filename); if (cur->module != 0) { break; } loader = loader->next; } if (!loader) { LT_DLFREE (cur->info.filename); ++errors; goto done; } cur->loader = loader; LT_DLMUTEX_SETERROR (saved_error); done: LT_DLMUTEX_UNLOCK (); return errors; } static int tryall_dlopen_module (handle, prefix, dirname, dlname) lt_dlhandle *handle; const char *prefix; const char *dirname; const char *dlname; { int error = 0; char *filename = 0; size_t filename_len = 0; size_t dirname_len = LT_STRLEN (dirname); assert (handle); assert (dirname); assert (dlname); #ifdef LT_DIRSEP_CHAR /* Only canonicalized names (i.e. with DIRSEP chars already converted) should make it into this function: */ assert (strchr (dirname, LT_DIRSEP_CHAR) == 0); #endif if (dirname_len > 0) if (dirname[dirname_len -1] == '/') --dirname_len; filename_len = dirname_len + 1 + LT_STRLEN (dlname); /* Allocate memory, and combine DIRNAME and MODULENAME into it. The PREFIX (if any) is handled below. */ filename = LT_EMALLOC (char, dirname_len + 1 + filename_len + 1); if (!filename) return 1; sprintf (filename, "%.*s/%s", (int) dirname_len, dirname, dlname); /* Now that we have combined DIRNAME and MODULENAME, if there is also a PREFIX to contend with, simply recurse with the arguments shuffled. Otherwise, attempt to open FILENAME as a module. */ if (prefix) { error += tryall_dlopen_module (handle, (const char *) 0, prefix, filename); } else if (tryall_dlopen (handle, filename, NULL) != 0) { ++error; } LT_DLFREE (filename); return error; } static int find_module (handle, dir, libdir, dlname, old_name, installed) lt_dlhandle *handle; const char *dir; const char *libdir; const char *dlname; const char *old_name; int installed; { /* Try to open the old library first; if it was dlpreopened, we want the preopened version of it, even if a dlopenable module is available. */ if (old_name && tryall_dlopen (handle, old_name, "dlpreload") == 0) { return 0; } /* Try to open the dynamic library. */ if (dlname) { /* try to open the installed module */ if (installed && libdir) { if (tryall_dlopen_module (handle, (const char *) 0, libdir, dlname) == 0) return 0; } /* try to open the not-installed module */ if (!installed) { if (tryall_dlopen_module (handle, dir, objdir, dlname) == 0) return 0; } /* maybe it was moved to another directory */ { if (dir && (tryall_dlopen_module (handle, (const char *) 0, dir, dlname) == 0)) return 0; } } return 1; } static int canonicalize_path (path, pcanonical) const char *path; char **pcanonical; { char *canonical = 0; assert (path && *path); assert (pcanonical); canonical = LT_EMALLOC (char, 1+ LT_STRLEN (path)); if (!canonical) return 1; { size_t dest = 0; size_t src; for (src = 0; path[src] != LT_EOS_CHAR; ++src) { /* Path separators are not copied to the beginning or end of the destination, or if another separator would follow immediately. */ if (path[src] == LT_PATHSEP_CHAR) { if ((dest == 0) || (path[1+ src] == LT_PATHSEP_CHAR) || (path[1+ src] == LT_EOS_CHAR)) continue; } /* Anything other than a directory separator is copied verbatim. */ if ((path[src] != '/') #ifdef LT_DIRSEP_CHAR && (path[src] != LT_DIRSEP_CHAR) #endif ) { canonical[dest++] = path[src]; } /* Directory separators are converted and copied only if they are not at the end of a path -- i.e. before a path separator or NULL terminator. */ else if ((path[1+ src] != LT_PATHSEP_CHAR) && (path[1+ src] != LT_EOS_CHAR) #ifdef LT_DIRSEP_CHAR && (path[1+ src] != LT_DIRSEP_CHAR) #endif && (path[1+ src] != '/')) { canonical[dest++] = '/'; } } /* Add an end-of-string marker at the end. */ canonical[dest] = LT_EOS_CHAR; } /* Assign new value. */ *pcanonical = canonical; return 0; } static int argzize_path (path, pargz, pargz_len) const char *path; char **pargz; size_t *pargz_len; { error_t error; assert (path); assert (pargz); assert (pargz_len); if ((error = argz_create_sep (path, LT_PATHSEP_CHAR, pargz, pargz_len))) { switch (error) { case ENOMEM: LT_DLMUTEX_SETERROR (LT_DLSTRERROR (NO_MEMORY)); break; default: LT_DLMUTEX_SETERROR (LT_DLSTRERROR (UNKNOWN)); break; } return 1; } return 0; } /* Repeatedly call FUNC with each LT_PATHSEP_CHAR delimited element of SEARCH_PATH and references to DATA1 and DATA2, until FUNC returns non-zero or all elements are exhausted. If BASE_NAME is non-NULL, it is appended to each SEARCH_PATH element before FUNC is called. */ static int foreach_dirinpath (search_path, base_name, func, data1, data2) const char *search_path; const char *base_name; foreach_callback_func *func; lt_ptr data1; lt_ptr data2; { int result = 0; int filenamesize = 0; size_t lenbase = LT_STRLEN (base_name); size_t argz_len = 0; char *argz = 0; char *filename = 0; char *canonical = 0; LT_DLMUTEX_LOCK (); if (!search_path || !*search_path) { LT_DLMUTEX_SETERROR (LT_DLSTRERROR (FILE_NOT_FOUND)); goto cleanup; } if (canonicalize_path (search_path, &canonical) != 0) goto cleanup; if (argzize_path (canonical, &argz, &argz_len) != 0) goto cleanup; { char *dir_name = 0; while ((dir_name = argz_next (argz, argz_len, dir_name))) { size_t lendir = LT_STRLEN (dir_name); if (lendir +1 +lenbase >= filenamesize) { LT_DLFREE (filename); filenamesize = lendir +1 +lenbase +1; /* "/d" + '/' + "f" + '\0' */ filename = LT_EMALLOC (char, filenamesize); if (!filename) goto cleanup; } assert (filenamesize > lendir); strcpy (filename, dir_name); if (base_name && *base_name) { if (filename[lendir -1] != '/') filename[lendir++] = '/'; strcpy (filename +lendir, base_name); } if ((result = (*func) (filename, data1, data2))) { break; } } } cleanup: LT_DLFREE (argz); LT_DLFREE (canonical); LT_DLFREE (filename); LT_DLMUTEX_UNLOCK (); return result; } /* If FILEPATH can be opened, store the name of the directory component in DATA1, and the opened FILE* structure address in DATA2. Otherwise DATA1 is unchanged, but DATA2 is set to a pointer to NULL. */ static int find_file_callback (filename, data1, data2) char *filename; lt_ptr data1; lt_ptr data2; { char **pdir = (char **) data1; FILE **pfile = (FILE **) data2; int is_done = 0; assert (filename && *filename); assert (pdir); assert (pfile); if ((*pfile = fopen (filename, LT_READTEXT_MODE))) { char *dirend = strrchr (filename, '/'); if (dirend > filename) *dirend = LT_EOS_CHAR; LT_DLFREE (*pdir); *pdir = lt_estrdup (filename); is_done = (*pdir == 0) ? -1 : 1; } return is_done; } static FILE * find_file (search_path, base_name, pdir) const char *search_path; const char *base_name; char **pdir; { FILE *file = 0; foreach_dirinpath (search_path, base_name, find_file_callback, pdir, &file); return file; } static int find_handle_callback (filename, data, ignored) char *filename; lt_ptr data; lt_ptr ignored; { lt_dlhandle *handle = (lt_dlhandle *) data; int notfound = access (filename, R_OK); /* Bail out if file cannot be read... */ if (notfound) return 0; /* Try to dlopen the file, but do not continue searching in any case. */ if (tryall_dlopen (handle, filename,NULL) != 0) *handle = 0; return 1; } /* If HANDLE was found return it, otherwise return 0. If HANDLE was found but could not be opened, *HANDLE will be set to 0. */ static lt_dlhandle * find_handle (search_path, base_name, handle) const char *search_path; const char *base_name; lt_dlhandle *handle; { if (!search_path) return 0; if (!foreach_dirinpath (search_path, base_name, find_handle_callback, handle, 0)) return 0; return handle; } static int load_deplibs (handle, deplibs) lt_dlhandle handle; char *deplibs; { #if LTDL_DLOPEN_DEPLIBS char *p, *save_search_path = 0; int depcount = 0; int i; char **names = 0; #endif int errors = 0; handle->depcount = 0; #if LTDL_DLOPEN_DEPLIBS if (!deplibs) { return errors; } ++errors; LT_DLMUTEX_LOCK (); if (user_search_path) { save_search_path = lt_estrdup (user_search_path); if (!save_search_path) goto cleanup; } /* extract search paths and count deplibs */ p = deplibs; while (*p) { if (!isspace ((int) *p)) { char *end = p+1; while (*end && !isspace((int) *end)) { ++end; } if (strncmp(p, "-L", 2) == 0 || strncmp(p, "-R", 2) == 0) { char save = *end; *end = 0; /* set a temporary string terminator */ if (lt_dladdsearchdir(p+2)) { goto cleanup; } *end = save; } else { ++depcount; } p = end; } else { ++p; } } if (!depcount) { errors = 0; goto cleanup; } names = LT_EMALLOC (char *, depcount * sizeof (char*)); if (!names) goto cleanup; /* now only extract the actual deplibs */ depcount = 0; p = deplibs; while (*p) { if (isspace ((int) *p)) { ++p; } else { char *end = p+1; while (*end && !isspace ((int) *end)) { ++end; } if (strncmp(p, "-L", 2) != 0 && strncmp(p, "-R", 2) != 0) { char *name; char save = *end; *end = 0; /* set a temporary string terminator */ if (strncmp(p, "-l", 2) == 0) { size_t name_len = 3+ /* "lib" */ LT_STRLEN (p + 2); name = LT_EMALLOC (char, 1+ name_len); if (name) sprintf (name, "lib%s", p+2); } else name = lt_estrdup(p); if (!name) goto cleanup_names; names[depcount++] = name; *end = save; } p = end; } } /* load the deplibs (in reverse order) At this stage, don't worry if the deplibs do not load correctly, they may already be statically linked into the loading application for instance. There will be a more enlightening error message later on if the loaded module cannot resolve all of its symbols. */ if (depcount) { int j = 0; handle->deplibs = (lt_dlhandle*) LT_EMALLOC (lt_dlhandle *, depcount); if (!handle->deplibs) goto cleanup; for (i = 0; i < depcount; ++i) { handle->deplibs[j] = lt_dlopenext(names[depcount-1-i]); if (handle->deplibs[j]) { ++j; } } handle->depcount = j; /* Number of successfully loaded deplibs */ errors = 0; } cleanup_names: for (i = 0; i < depcount; ++i) { LT_DLFREE (names[i]); } cleanup: LT_DLFREE (names); /* restore the old search path */ if (user_search_path) { LT_DLFREE (user_search_path); user_search_path = save_search_path; } LT_DLMUTEX_UNLOCK (); #endif return errors; } static int unload_deplibs (handle) lt_dlhandle handle; { int i; int errors = 0; if (handle->depcount) { for (i = 0; i < handle->depcount; ++i) { if (!LT_DLIS_RESIDENT (handle->deplibs[i])) { errors += lt_dlclose (handle->deplibs[i]); } } } return errors; } static int trim (dest, str) char **dest; const char *str; { /* remove the leading and trailing "'" from str and store the result in dest */ const char *end = strrchr (str, '\''); size_t len = LT_STRLEN (str); char *tmp; LT_DLFREE (*dest); if (!end) return 1; if (len > 3 && str[0] == '\'') { tmp = LT_EMALLOC (char, end - str); if (!tmp) return 1; strncpy(tmp, &str[1], (end - str) - 1); tmp[len-3] = LT_EOS_CHAR; *dest = tmp; } else { *dest = 0; } return 0; } static int free_vars (dlname, oldname, libdir, deplibs) char *dlname; char *oldname; char *libdir; char *deplibs; { LT_DLFREE (dlname); LT_DLFREE (oldname); LT_DLFREE (libdir); LT_DLFREE (deplibs); return 0; } static int try_dlopen (phandle, filename) lt_dlhandle *phandle; const char *filename; { const char * ext = 0; const char * saved_error = 0; char * canonical = 0; char * base_name = 0; char * dir = 0; char * name = 0; int errors = 0; lt_dlhandle newhandle; assert (phandle); assert (*phandle == 0); LT_DLMUTEX_GETERROR (saved_error); /* dlopen self? */ if (!filename) { *phandle = (lt_dlhandle) LT_EMALLOC (struct lt_dlhandle_struct, 1); if (*phandle == 0) return 1; memset (*phandle, 0, sizeof(struct lt_dlhandle_struct)); newhandle = *phandle; /* lt_dlclose()ing yourself is very bad! Disallow it. */ LT_DLSET_FLAG (*phandle, LT_DLRESIDENT_FLAG); if (tryall_dlopen (&newhandle, 0, NULL) != 0) { LT_DLFREE (*phandle); return 1; } goto register_handle; } assert (filename && *filename); /* Doing this immediately allows internal functions to safely assume only canonicalized paths are passed. */ if (canonicalize_path (filename, &canonical) != 0) { ++errors; goto cleanup; } /* If the canonical module name is a path (relative or absolute) then split it into a directory part and a name part. */ base_name = strrchr (canonical, '/'); if (base_name) { size_t dirlen = (1+ base_name) - canonical; dir = LT_EMALLOC (char, 1+ dirlen); if (!dir) { ++errors; goto cleanup; } strncpy (dir, canonical, dirlen); dir[dirlen] = LT_EOS_CHAR; ++base_name; } else base_name = canonical; assert (base_name && *base_name); /* Check whether we are opening a libtool module (.la extension). */ ext = strrchr (base_name, '.'); if (ext && strcmp (ext, archive_ext) == 0) { /* this seems to be a libtool module */ FILE * file = 0; char * dlname = 0; char * old_name = 0; char * libdir = 0; char * deplibs = 0; char * line = 0; size_t line_len; /* if we can't find the installed flag, it is probably an installed libtool archive, produced with an old version of libtool */ int installed = 1; /* extract the module name from the file name */ name = LT_EMALLOC (char, ext - base_name + 1); if (!name) { ++errors; goto cleanup; } /* canonicalize the module name */ { size_t i; for (i = 0; i < ext - base_name; ++i) { if (isalnum ((int)(base_name[i]))) { name[i] = base_name[i]; } else { name[i] = '_'; } } name[ext - base_name] = LT_EOS_CHAR; } /* Now try to open the .la file. If there is no directory name component, try to find it first in user_search_path and then other prescribed paths. Otherwise (or in any case if the module was not yet found) try opening just the module name as passed. */ if (!dir) { const char *search_path; LT_DLMUTEX_LOCK (); search_path = user_search_path; if (search_path) file = find_file (user_search_path, base_name, &dir); LT_DLMUTEX_UNLOCK (); if (!file) { search_path = getenv (LTDL_SEARCHPATH_VAR); if (search_path) file = find_file (search_path, base_name, &dir); } #ifdef LTDL_SHLIBPATH_VAR if (!file) { search_path = getenv (LTDL_SHLIBPATH_VAR); if (search_path) file = find_file (search_path, base_name, &dir); } #endif #ifdef LTDL_SYSSEARCHPATH if (!file && sys_search_path) { file = find_file (sys_search_path, base_name, &dir); } #endif } else { file = fopen (filename, LT_READTEXT_MODE); } /* If we didn't find the file by now, it really isn't there. Set the status flag, and bail out. */ if (!file) { LT_DLMUTEX_SETERROR (LT_DLSTRERROR (FILE_NOT_FOUND)); ++errors; goto cleanup; } line_len = LT_FILENAME_MAX; line = LT_EMALLOC (char, line_len); if (!line) { fclose (file); ++errors; goto cleanup; } /* read the .la file */ while (!feof (file)) { if (!fgets (line, (int) line_len, file)) { break; } /* Handle the case where we occasionally need to read a line that is longer than the initial buffer size. */ while ((line[LT_STRLEN(line) -1] != '\n') && (!feof (file))) { line = LT_DLREALLOC (char, line, line_len *2); if (!fgets (&line[line_len -1], (int) line_len +1, file)) { break; } line_len *= 2; } if (line[0] == '\n' || line[0] == '#') { continue; } #undef STR_DLNAME #define STR_DLNAME "dlname=" if (strncmp (line, STR_DLNAME, sizeof (STR_DLNAME) - 1) == 0) { errors += trim (&dlname, &line[sizeof (STR_DLNAME) - 1]); } #undef STR_OLD_LIBRARY #define STR_OLD_LIBRARY "old_library=" else if (strncmp (line, STR_OLD_LIBRARY, sizeof (STR_OLD_LIBRARY) - 1) == 0) { errors += trim (&old_name, &line[sizeof (STR_OLD_LIBRARY) - 1]); } #undef STR_LIBDIR #define STR_LIBDIR "libdir=" else if (strncmp (line, STR_LIBDIR, sizeof (STR_LIBDIR) - 1) == 0) { errors += trim (&libdir, &line[sizeof(STR_LIBDIR) - 1]); } #undef STR_DL_DEPLIBS #define STR_DL_DEPLIBS "dependency_libs=" else if (strncmp (line, STR_DL_DEPLIBS, sizeof (STR_DL_DEPLIBS) - 1) == 0) { errors += trim (&deplibs, &line[sizeof (STR_DL_DEPLIBS) - 1]); } else if (strcmp (line, "installed=yes\n") == 0) { installed = 1; } else if (strcmp (line, "installed=no\n") == 0) { installed = 0; } #undef STR_LIBRARY_NAMES #define STR_LIBRARY_NAMES "library_names=" else if (! dlname && strncmp (line, STR_LIBRARY_NAMES, sizeof (STR_LIBRARY_NAMES) - 1) == 0) { char *last_libname; errors += trim (&dlname, &line[sizeof (STR_LIBRARY_NAMES) - 1]); if (!errors && dlname && (last_libname = strrchr (dlname, ' ')) != 0) { last_libname = lt_estrdup (last_libname + 1); if (!last_libname) { ++errors; goto cleanup; } LT_DLMEM_REASSIGN (dlname, last_libname); } } if (errors) break; } fclose (file); LT_DLFREE (line); /* allocate the handle */ *phandle = (lt_dlhandle) LT_EMALLOC (struct lt_dlhandle_struct, 1); if (*phandle == 0) ++errors; if (errors) { free_vars (dlname, old_name, libdir, deplibs); LT_DLFREE (*phandle); goto cleanup; } assert (*phandle); memset (*phandle, 0, sizeof(struct lt_dlhandle_struct)); if (load_deplibs (*phandle, deplibs) == 0) { newhandle = *phandle; /* find_module may replace newhandle */ if (find_module (&newhandle, dir, libdir, dlname, old_name, installed)) { unload_deplibs (*phandle); ++errors; } } else { ++errors; } free_vars (dlname, old_name, libdir, deplibs); if (errors) { LT_DLFREE (*phandle); goto cleanup; } if (*phandle != newhandle) { unload_deplibs (*phandle); } } else { /* not a libtool module */ *phandle = (lt_dlhandle) LT_EMALLOC (struct lt_dlhandle_struct, 1); if (*phandle == 0) { ++errors; goto cleanup; } memset (*phandle, 0, sizeof (struct lt_dlhandle_struct)); newhandle = *phandle; /* If the module has no directory name component, try to find it first in user_search_path and then other prescribed paths. Otherwise (or in any case if the module was not yet found) try opening just the module name as passed. */ if ((dir || (!find_handle (user_search_path, base_name, &newhandle) && !find_handle (getenv (LTDL_SEARCHPATH_VAR), base_name, &newhandle) #ifdef LTDL_SHLIBPATH_VAR && !find_handle (getenv (LTDL_SHLIBPATH_VAR), base_name, &newhandle) #endif #ifdef LTDL_SYSSEARCHPATH && !find_handle (sys_search_path, base_name, &newhandle) #endif ))) { if (tryall_dlopen (&newhandle, filename, NULL) != 0) { newhandle = NULL; } } if (!newhandle) { LT_DLFREE (*phandle); ++errors; goto cleanup; } } register_handle: LT_DLMEM_REASSIGN (*phandle, newhandle); if ((*phandle)->info.ref_count == 0) { (*phandle)->info.ref_count = 1; LT_DLMEM_REASSIGN ((*phandle)->info.name, name); LT_DLMUTEX_LOCK (); (*phandle)->next = handles; handles = *phandle; LT_DLMUTEX_UNLOCK (); } LT_DLMUTEX_SETERROR (saved_error); cleanup: LT_DLFREE (dir); LT_DLFREE (name); LT_DLFREE (canonical); return errors; } lt_dlhandle lt_dlopen (filename) const char *filename; { lt_dlhandle handle = 0; /* Just incase we missed a code path in try_dlopen() that reports an error, but forgets to reset handle... */ if (try_dlopen (&handle, filename) != 0) return 0; return handle; } /* If the last error messge store was `FILE_NOT_FOUND', then return non-zero. */ static int file_not_found () { const char *error = 0; LT_DLMUTEX_GETERROR (error); if (error == LT_DLSTRERROR (FILE_NOT_FOUND)) return 1; return 0; } /* If FILENAME has an ARCHIVE_EXT or SHLIB_EXT extension, try to open the FILENAME as passed. Otherwise try appending ARCHIVE_EXT, and if a file is still not found try again with SHLIB_EXT appended instead. */ lt_dlhandle lt_dlopenext (filename) const char *filename; { lt_dlhandle handle = 0; char * tmp = 0; char * ext = 0; size_t len; int errors = 0; if (!filename) { return lt_dlopen (filename); } assert (filename); len = LT_STRLEN (filename); ext = strrchr (filename, '.'); /* If FILENAME already bears a suitable extension, there is no need to try appending additional extensions. */ if (ext && ((strcmp (ext, archive_ext) == 0) #ifdef LTDL_SHLIB_EXT || (strcmp (ext, shlib_ext) == 0) #endif )) { return lt_dlopen (filename); } /* First try appending ARCHIVE_EXT. */ tmp = LT_EMALLOC (char, len + LT_STRLEN (archive_ext) + 1); if (!tmp) return 0; strcpy (tmp, filename); strcat (tmp, archive_ext); errors = try_dlopen (&handle, tmp); if (handle && errors) { LT_DLMUTEX_SETERROR (LT_DLSTRERROR (FR_DEPLIB)); return 0; /* leaks tmp and handle */ } if (handle && errors) { LT_DLMUTEX_SETERROR (LT_DLSTRERROR (FR_DEPLIB)); return 0; /* leaks tmp and handle */ } /* If we found FILENAME, stop searching -- whether we were able to load the file as a module or not. If the file exists but loading failed, it is better to return an error message here than to report FILE_NOT_FOUND when the alternatives (foo.so etc) are not in the module search path. */ if (handle || ((errors > 0) && !file_not_found ())) { LT_DLFREE (tmp); return handle; } #ifdef LTDL_SHLIB_EXT /* Try appending SHLIB_EXT. */ if (LT_STRLEN (shlib_ext) > LT_STRLEN (archive_ext)) { LT_DLFREE (tmp); tmp = LT_EMALLOC (char, len + LT_STRLEN (shlib_ext) + 1); if (!tmp) return 0; strcpy (tmp, filename); } else { tmp[len] = LT_EOS_CHAR; if (handle && errors) { LT_DLMUTEX_SETERROR (LT_DLSTRERROR (FR_DEPLIB)); return 0; /* leaks tmp and handle */ } } strcat(tmp, shlib_ext); errors = try_dlopen (&handle, tmp); if (handle && errors) { LT_DLMUTEX_SETERROR (LT_DLSTRERROR (FR_DEPLIB)); return 0; /* leaks tmp and handle */ } /* As before, if the file was found but loading failed, return now with the current error message. */ if (handle || ((errors > 0) && !file_not_found ())) { LT_DLFREE (tmp); return handle; } #endif /* Still here? Then we really did fail to locate any of the file names we tried. */ LT_DLMUTEX_SETERROR (LT_DLSTRERROR (FILE_NOT_FOUND)); LT_DLFREE (tmp); return 0; } static int lt_argz_insert (pargz, pargz_len, before, entry) char **pargz; size_t *pargz_len; char *before; const char *entry; { error_t error; /* Prior to Sep 8, 2005, newlib had a bug where argz_insert(pargz, pargz_len, NULL, entry) failed with EINVAL. */ if (before) error = argz_insert (pargz, pargz_len, before, entry); else error = argz_append (pargz, pargz_len, entry, 1 + LT_STRLEN (entry)); if (error) { switch (error) { case ENOMEM: LT_DLMUTEX_SETERROR (LT_DLSTRERROR (NO_MEMORY)); break; default: LT_DLMUTEX_SETERROR (LT_DLSTRERROR (UNKNOWN)); break; } return 1; } return 0; } static int lt_argz_insertinorder (pargz, pargz_len, entry) char **pargz; size_t *pargz_len; const char *entry; { char *before = 0; assert (pargz); assert (pargz_len); assert (entry && *entry); if (*pargz) while ((before = argz_next (*pargz, *pargz_len, before))) { int cmp = strcmp (entry, before); if (cmp < 0) break; if (cmp == 0) return 0; /* No duplicates! */ } return lt_argz_insert (pargz, pargz_len, before, entry); } static int lt_argz_insertdir (pargz, pargz_len, dirnam, dp) char **pargz; size_t *pargz_len; const char *dirnam; struct dirent *dp; { char *buf = 0; size_t buf_len = 0; char *end = 0; size_t end_offset = 0; size_t dir_len = 0; int errors = 0; assert (pargz); assert (pargz_len); assert (dp); dir_len = LT_STRLEN (dirnam); end = dp->d_name + LT_D_NAMLEN(dp); /* Ignore version numbers. */ { char *p; for (p = end; p -1 > dp->d_name; --p) if (strchr (".0123456789", p[-1]) == 0) break; if (*p == '.') end = p; } /* Ignore filename extension. */ { char *p; for (p = end -1; p > dp->d_name; --p) if (*p == '.') { end = p; break; } } /* Prepend the directory name. */ end_offset = end - dp->d_name; buf_len = dir_len + 1+ end_offset; buf = LT_EMALLOC (char, 1+ buf_len); if (!buf) return ++errors; assert (buf); strcpy (buf, dirnam); strcat (buf, "/"); strncat (buf, dp->d_name, end_offset); buf[buf_len] = LT_EOS_CHAR; /* Try to insert (in order) into ARGZ/ARGZ_LEN. */ if (lt_argz_insertinorder (pargz, pargz_len, buf) != 0) ++errors; LT_DLFREE (buf); return errors; } static int list_files_by_dir (dirnam, pargz, pargz_len) const char *dirnam; char **pargz; size_t *pargz_len; { DIR *dirp = 0; int errors = 0; assert (dirnam && *dirnam); assert (pargz); assert (pargz_len); assert (dirnam[LT_STRLEN(dirnam) -1] != '/'); dirp = opendir (dirnam); if (dirp) { struct dirent *dp = 0; while ((dp = readdir (dirp))) if (dp->d_name[0] != '.') if (lt_argz_insertdir (pargz, pargz_len, dirnam, dp)) { ++errors; break; } closedir (dirp); } else ++errors; return errors; } /* If there are any files in DIRNAME, call the function passed in DATA1 (with the name of each file and DATA2 as arguments). */ static int foreachfile_callback (dirname, data1, data2) char *dirname; lt_ptr data1; lt_ptr data2; { int (*func) LT_PARAMS((const char *filename, lt_ptr data)) = (int (*) LT_PARAMS((const char *filename, lt_ptr data))) data1; int is_done = 0; char *argz = 0; size_t argz_len = 0; if (list_files_by_dir (dirname, &argz, &argz_len) != 0) goto cleanup; if (!argz) goto cleanup; { char *filename = 0; while ((filename = argz_next (argz, argz_len, filename))) if ((is_done = (*func) (filename, data2))) break; } cleanup: LT_DLFREE (argz); return is_done; } /* Call FUNC for each unique extensionless file in SEARCH_PATH, along with DATA. The filenames passed to FUNC would be suitable for passing to lt_dlopenext. The extensions are stripped so that individual modules do not generate several entries (e.g. libfoo.la, libfoo.so, libfoo.so.1, libfoo.so.1.0.0). If SEARCH_PATH is NULL, then the same directories that lt_dlopen would search are examined. */ int lt_dlforeachfile (search_path, func, data) const char *search_path; int (*func) LT_PARAMS ((const char *filename, lt_ptr data)); lt_ptr data; { int is_done = 0; if (search_path) { /* If a specific path was passed, search only the directories listed in it. */ is_done = foreach_dirinpath (search_path, 0, foreachfile_callback, func, data); } else { /* Otherwise search the default paths. */ is_done = foreach_dirinpath (user_search_path, 0, foreachfile_callback, func, data); if (!is_done) { is_done = foreach_dirinpath (getenv("LTDL_LIBRARY_PATH"), 0, foreachfile_callback, func, data); } #ifdef LTDL_SHLIBPATH_VAR if (!is_done) { is_done = foreach_dirinpath (getenv(LTDL_SHLIBPATH_VAR), 0, foreachfile_callback, func, data); } #endif #ifdef LTDL_SYSSEARCHPATH if (!is_done) { is_done = foreach_dirinpath (getenv(LTDL_SYSSEARCHPATH), 0, foreachfile_callback, func, data); } #endif } return is_done; } int lt_dlclose (handle) lt_dlhandle handle; { lt_dlhandle cur, last; int errors = 0; LT_DLMUTEX_LOCK (); /* check whether the handle is valid */ last = cur = handles; while (cur && handle != cur) { last = cur; cur = cur->next; } if (!cur) { LT_DLMUTEX_SETERROR (LT_DLSTRERROR (INVALID_HANDLE)); ++errors; goto done; } handle->info.ref_count--; /* Note that even with resident modules, we must track the ref_count correctly incase the user decides to reset the residency flag later (even though the API makes no provision for that at the moment). */ if (handle->info.ref_count <= 0 && !LT_DLIS_RESIDENT (handle)) { lt_user_data data = handle->loader->dlloader_data; if (handle != handles) { last->next = handle->next; } else { handles = handle->next; } errors += handle->loader->module_close (data, handle->module); errors += unload_deplibs(handle); /* It is up to the callers to free the data itself. */ LT_DLFREE (handle->caller_data); LT_DLFREE (handle->info.filename); LT_DLFREE (handle->info.name); LT_DLFREE (handle); goto done; } if (LT_DLIS_RESIDENT (handle)) { LT_DLMUTEX_SETERROR (LT_DLSTRERROR (CLOSE_RESIDENT_MODULE)); ++errors; } done: LT_DLMUTEX_UNLOCK (); return errors; } lt_ptr lt_dlsym (handle, symbol) lt_dlhandle handle; const char *symbol; { size_t lensym; char lsym[LT_SYMBOL_LENGTH]; char *sym; lt_ptr address; lt_user_data data; if (!handle) { LT_DLMUTEX_SETERROR (LT_DLSTRERROR (INVALID_HANDLE)); return 0; } if (!symbol) { LT_DLMUTEX_SETERROR (LT_DLSTRERROR (SYMBOL_NOT_FOUND)); return 0; } lensym = LT_STRLEN (symbol) + LT_STRLEN (handle->loader->sym_prefix) + LT_STRLEN (handle->info.name); if (lensym + LT_SYMBOL_OVERHEAD < LT_SYMBOL_LENGTH) { sym = lsym; } else { sym = LT_EMALLOC (char, lensym + LT_SYMBOL_OVERHEAD + 1); if (!sym) { LT_DLMUTEX_SETERROR (LT_DLSTRERROR (BUFFER_OVERFLOW)); return 0; } } data = handle->loader->dlloader_data; if (handle->info.name) { const char *saved_error; LT_DLMUTEX_GETERROR (saved_error); /* this is a libtool module */ if (handle->loader->sym_prefix) { strcpy(sym, handle->loader->sym_prefix); strcat(sym, handle->info.name); } else { strcpy(sym, handle->info.name); } strcat(sym, "_LTX_"); strcat(sym, symbol); /* try "modulename_LTX_symbol" */ address = handle->loader->find_sym (data, handle->module, sym); if (address) { if (sym != lsym) { LT_DLFREE (sym); } return address; } LT_DLMUTEX_SETERROR (saved_error); } /* otherwise try "symbol" */ if (handle->loader->sym_prefix) { strcpy(sym, handle->loader->sym_prefix); strcat(sym, symbol); } else { strcpy(sym, symbol); } address = handle->loader->find_sym (data, handle->module, sym); if (sym != lsym) { LT_DLFREE (sym); } return address; } const char * lt_dlerror () { const char *error; LT_DLMUTEX_GETERROR (error); LT_DLMUTEX_SETERROR (0); return error ? error : NULL; } static int lt_dlpath_insertdir (ppath, before, dir) char **ppath; char *before; const char *dir; { int errors = 0; char *canonical = 0; char *argz = 0; size_t argz_len = 0; assert (ppath); assert (dir && *dir); if (canonicalize_path (dir, &canonical) != 0) { ++errors; goto cleanup; } assert (canonical && *canonical); /* If *PPATH is empty, set it to DIR. */ if (*ppath == 0) { assert (!before); /* BEFORE cannot be set without PPATH. */ assert (dir); /* Without DIR, don't call this function! */ *ppath = lt_estrdup (dir); if (*ppath == 0) ++errors; return errors; } assert (ppath && *ppath); if (argzize_path (*ppath, &argz, &argz_len) != 0) { ++errors; goto cleanup; } /* Convert BEFORE into an equivalent offset into ARGZ. This only works if *PPATH is already canonicalized, and hence does not change length with respect to ARGZ. We canonicalize each entry as it is added to the search path, and don't call this function with (uncanonicalized) user paths, so this is a fair assumption. */ if (before) { assert (*ppath <= before); assert (before - *ppath <= strlen (*ppath)); before = before - *ppath + argz; } if (lt_argz_insert (&argz, &argz_len, before, dir) != 0) { ++errors; goto cleanup; } argz_stringify (argz, argz_len, LT_PATHSEP_CHAR); LT_DLMEM_REASSIGN (*ppath, argz); cleanup: LT_DLFREE (canonical); LT_DLFREE (argz); return errors; } int lt_dladdsearchdir (search_dir) const char *search_dir; { int errors = 0; if (search_dir && *search_dir) { LT_DLMUTEX_LOCK (); if (lt_dlpath_insertdir (&user_search_path, 0, search_dir) != 0) ++errors; LT_DLMUTEX_UNLOCK (); } return errors; } int lt_dlinsertsearchdir (before, search_dir) const char *before; const char *search_dir; { int errors = 0; if (before) { LT_DLMUTEX_LOCK (); if ((before < user_search_path) || (before >= user_search_path + LT_STRLEN (user_search_path))) { LT_DLMUTEX_UNLOCK (); LT_DLMUTEX_SETERROR (LT_DLSTRERROR (INVALID_POSITION)); return 1; } LT_DLMUTEX_UNLOCK (); } if (search_dir && *search_dir) { LT_DLMUTEX_LOCK (); if (lt_dlpath_insertdir (&user_search_path, (char *) before, search_dir) != 0) { ++errors; } LT_DLMUTEX_UNLOCK (); } return errors; } int lt_dlsetsearchpath (search_path) const char *search_path; { int errors = 0; LT_DLMUTEX_LOCK (); LT_DLFREE (user_search_path); LT_DLMUTEX_UNLOCK (); if (!search_path || !LT_STRLEN (search_path)) { return errors; } LT_DLMUTEX_LOCK (); if (canonicalize_path (search_path, &user_search_path) != 0) ++errors; LT_DLMUTEX_UNLOCK (); return errors; } const char * lt_dlgetsearchpath () { const char *saved_path; LT_DLMUTEX_LOCK (); saved_path = user_search_path; LT_DLMUTEX_UNLOCK (); return saved_path; } int lt_dlmakeresident (handle) lt_dlhandle handle; { int errors = 0; if (!handle) { LT_DLMUTEX_SETERROR (LT_DLSTRERROR (INVALID_HANDLE)); ++errors; } else { LT_DLSET_FLAG (handle, LT_DLRESIDENT_FLAG); } return errors; } int lt_dlisresident (handle) lt_dlhandle handle; { if (!handle) { LT_DLMUTEX_SETERROR (LT_DLSTRERROR (INVALID_HANDLE)); return -1; } return LT_DLIS_RESIDENT (handle); } /* --- MODULE INFORMATION --- */ const lt_dlinfo * lt_dlgetinfo (handle) lt_dlhandle handle; { if (!handle) { LT_DLMUTEX_SETERROR (LT_DLSTRERROR (INVALID_HANDLE)); return 0; } return &(handle->info); } lt_dlhandle lt_dlhandle_next (place) lt_dlhandle place; { return place ? place->next : handles; } int lt_dlforeach (func, data) int (*func) LT_PARAMS((lt_dlhandle handle, lt_ptr data)); lt_ptr data; { int errors = 0; lt_dlhandle cur; LT_DLMUTEX_LOCK (); cur = handles; while (cur) { lt_dlhandle tmp = cur; cur = cur->next; if ((*func) (tmp, data)) { ++errors; break; } } LT_DLMUTEX_UNLOCK (); return errors; } lt_dlcaller_id lt_dlcaller_register () { static lt_dlcaller_id last_caller_id = 0; int result; LT_DLMUTEX_LOCK (); result = ++last_caller_id; LT_DLMUTEX_UNLOCK (); return result; } lt_ptr lt_dlcaller_set_data (key, handle, data) lt_dlcaller_id key; lt_dlhandle handle; lt_ptr data; { int n_elements = 0; lt_ptr stale = (lt_ptr) 0; int i; /* This needs to be locked so that the caller data can be updated simultaneously by different threads. */ LT_DLMUTEX_LOCK (); if (handle->caller_data) while (handle->caller_data[n_elements].key) ++n_elements; for (i = 0; i < n_elements; ++i) { if (handle->caller_data[i].key == key) { stale = handle->caller_data[i].data; break; } } /* Ensure that there is enough room in this handle's caller_data array to accept a new element (and an empty end marker). */ if (i == n_elements) { lt_caller_data *temp = LT_DLREALLOC (lt_caller_data, handle->caller_data, 2+ n_elements); if (!temp) { stale = 0; goto done; } handle->caller_data = temp; /* We only need this if we needed to allocate a new caller_data. */ handle->caller_data[i].key = key; handle->caller_data[1+ i].key = 0; } handle->caller_data[i].data = data; done: LT_DLMUTEX_UNLOCK (); return stale; } lt_ptr lt_dlcaller_get_data (key, handle) lt_dlcaller_id key; lt_dlhandle handle; { lt_ptr result = (lt_ptr) 0; /* This needs to be locked so that the caller data isn't updated by another thread part way through this function. */ LT_DLMUTEX_LOCK (); /* Locate the index of the element with a matching KEY. */ { int i; for (i = 0; handle->caller_data[i].key; ++i) { if (handle->caller_data[i].key == key) { result = handle->caller_data[i].data; break; } } } LT_DLMUTEX_UNLOCK (); return result; } /* --- USER MODULE LOADER API --- */ int lt_dlloader_add (place, dlloader, loader_name) lt_dlloader *place; const struct lt_user_dlloader *dlloader; const char *loader_name; { int errors = 0; lt_dlloader *node = 0, *ptr = 0; if ((dlloader == 0) /* diagnose null parameters */ || (dlloader->module_open == 0) || (dlloader->module_close == 0) || (dlloader->find_sym == 0)) { LT_DLMUTEX_SETERROR (LT_DLSTRERROR (INVALID_LOADER)); return 1; } /* Create a new dlloader node with copies of the user callbacks. */ node = LT_EMALLOC (lt_dlloader, 1); if (!node) return 1; node->next = 0; node->loader_name = loader_name; node->sym_prefix = dlloader->sym_prefix; node->dlloader_exit = dlloader->dlloader_exit; node->module_open = dlloader->module_open; node->module_close = dlloader->module_close; node->find_sym = dlloader->find_sym; node->dlloader_data = dlloader->dlloader_data; LT_DLMUTEX_LOCK (); if (!loaders) { /* If there are no loaders, NODE becomes the list! */ loaders = node; } else if (!place) { /* If PLACE is not set, add NODE to the end of the LOADERS list. */ for (ptr = loaders; ptr->next; ptr = ptr->next) { /*NOWORK*/; } ptr->next = node; } else if (loaders == place) { /* If PLACE is the first loader, NODE goes first. */ node->next = place; loaders = node; } else { /* Find the node immediately preceding PLACE. */ for (ptr = loaders; ptr->next != place; ptr = ptr->next) { /*NOWORK*/; } if (ptr->next != place) { LT_DLMUTEX_SETERROR (LT_DLSTRERROR (INVALID_LOADER)); ++errors; } else { /* Insert NODE between PTR and PLACE. */ node->next = place; ptr->next = node; } } LT_DLMUTEX_UNLOCK (); return errors; } int lt_dlloader_remove (loader_name) const char *loader_name; { lt_dlloader *place = lt_dlloader_find (loader_name); lt_dlhandle handle; int errors = 0; if (!place) { LT_DLMUTEX_SETERROR (LT_DLSTRERROR (INVALID_LOADER)); return 1; } LT_DLMUTEX_LOCK (); /* Fail if there are any open modules which use this loader. */ for (handle = handles; handle; handle = handle->next) { if (handle->loader == place) { LT_DLMUTEX_SETERROR (LT_DLSTRERROR (REMOVE_LOADER)); ++errors; goto done; } } if (place == loaders) { /* PLACE is the first loader in the list. */ loaders = loaders->next; } else { /* Find the loader before the one being removed. */ lt_dlloader *prev; for (prev = loaders; prev->next; prev = prev->next) { if (!strcmp (prev->next->loader_name, loader_name)) { break; } } place = prev->next; prev->next = prev->next->next; } if (place->dlloader_exit) { errors = place->dlloader_exit (place->dlloader_data); } LT_DLFREE (place); done: LT_DLMUTEX_UNLOCK (); return errors; } lt_dlloader * lt_dlloader_next (place) lt_dlloader *place; { lt_dlloader *next; LT_DLMUTEX_LOCK (); next = place ? place->next : loaders; LT_DLMUTEX_UNLOCK (); return next; } const char * lt_dlloader_name (place) lt_dlloader *place; { const char *name = 0; if (place) { LT_DLMUTEX_LOCK (); name = place ? place->loader_name : 0; LT_DLMUTEX_UNLOCK (); } else { LT_DLMUTEX_SETERROR (LT_DLSTRERROR (INVALID_LOADER)); } return name; } lt_user_data * lt_dlloader_data (place) lt_dlloader *place; { lt_user_data *data = 0; if (place) { LT_DLMUTEX_LOCK (); data = place ? &(place->dlloader_data) : 0; LT_DLMUTEX_UNLOCK (); } else { LT_DLMUTEX_SETERROR (LT_DLSTRERROR (INVALID_LOADER)); } return data; } lt_dlloader * lt_dlloader_find (loader_name) const char *loader_name; { lt_dlloader *place = 0; LT_DLMUTEX_LOCK (); for (place = loaders; place; place = place->next) { if (strcmp (place->loader_name, loader_name) == 0) { break; } } LT_DLMUTEX_UNLOCK (); return place; } freeradius-server/libltdl/ltdl.h000066400000000000000000000273241257552170400172710ustar00rootroot00000000000000/* ltdl.h -- generic dlopen functions Copyright (C) 1998-2000 Free Software Foundation, Inc. Originally by Thomas Tanner This file is part of GNU Libtool. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. As a special exception to the GNU Lesser General Public License, if you distribute this file as part of a program or library that is built using GNU libtool, you may include it under the same distribution terms that you use for the rest of that program. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ /* Only include this header file once. */ #ifndef LTDL_H #define LTDL_H 1 #include /* for size_t declaration */ /* --- MACROS FOR PORTABILITY --- */ /* Saves on those hard to debug '\0' typos.... */ #define LT_EOS_CHAR '\0' /* LTDL_BEGIN_C_DECLS should be used at the beginning of your declarations, so that C++ compilers don't mangle their names. Use LTDL_END_C_DECLS at the end of C declarations. */ #ifdef __cplusplus # define LT_BEGIN_C_DECLS extern "C" { # define LT_END_C_DECLS } #else # define LT_BEGIN_C_DECLS /* empty */ # define LT_END_C_DECLS /* empty */ #endif LT_BEGIN_C_DECLS /* LT_PARAMS is a macro used to wrap function prototypes, so that compilers that don't understand ANSI C prototypes still work, and ANSI C compilers can issue warnings about type mismatches. */ #if defined (__STDC__) || defined (_AIX) || (defined (__mips) && defined (_SYSTYPE_SVR4)) || defined(WIN32) || defined(__cplusplus) # define LT_PARAMS(protos) protos # define lt_ptr void* #else # define LT_PARAMS(protos) () # define lt_ptr char* #endif /* LT_STMT_START/END are used to create macros which expand to a a single compound statement in a portable way. */ #if defined (__GNUC__) && !defined (__STRICT_ANSI__) && !defined (__cplusplus) # define LT_STMT_START (void)( # define LT_STMT_END ) #else # if (defined (sun) || defined (__sun__)) # define LT_STMT_START if (1) # define LT_STMT_END else (void)0 # else # define LT_STMT_START do # define LT_STMT_END while (0) # endif #endif /* LT_CONC creates a new concatenated symbol for the compiler in a portable way. */ #if defined(__STDC__) || defined(__cplusplus) || defined(_MSC_VER) # define LT_CONC(s,t) s##t #else # define LT_CONC(s,t) s/**/t #endif /* LT_STRLEN can be used safely on NULL pointers. */ #define LT_STRLEN(s) (((s) && (s)[0]) ? strlen (s) : 0) /* --- WINDOWS SUPPORT --- */ /* Canonicalise Windows and Cygwin recognition macros. */ #ifdef __CYGWIN32__ # ifndef __CYGWIN__ # define __CYGWIN__ __CYGWIN32__ # endif #endif #if defined(_WIN32) || defined(WIN32) # ifndef __WINDOWS__ # ifdef _WIN32 # define __WINDOWS__ _WIN32 # else # ifdef WIN32 # define __WINDOWS__ WIN32 # endif # endif # endif #endif #ifdef __WINDOWS__ # ifndef __CYGWIN__ /* LT_DIRSEP_CHAR is accepted *in addition* to '/' as a directory separator when it is set. */ # define LT_DIRSEP_CHAR '\\' # define LT_PATHSEP_CHAR ';' # endif #endif #ifndef LT_PATHSEP_CHAR # define LT_PATHSEP_CHAR ':' #endif /* DLL building support on win32 hosts; mostly to workaround their ridiculous implementation of data symbol exporting. */ #ifndef LT_SCOPE # ifdef __WINDOWS__ # ifdef DLL_EXPORT /* defined by libtool (if required) */ # define LT_SCOPE __declspec(dllexport) # endif # ifdef LIBLTDL_DLL_IMPORT /* define if linking with this dll */ # define LT_SCOPE extern __declspec(dllimport) # endif # endif # ifndef LT_SCOPE /* static linking or !__WINDOWS__ */ # define LT_SCOPE extern # endif #endif #if defined(_MSC_VER) /* Visual Studio */ # define R_OK 4 #endif /* --- DYNAMIC MODULE LOADING API --- */ typedef struct lt_dlhandle_struct *lt_dlhandle; /* A loaded module. */ /* Initialisation and finalisation functions for libltdl. */ LT_SCOPE int lt_dlinit LT_PARAMS((void)); LT_SCOPE int lt_dlexit LT_PARAMS((void)); /* Module search path manipulation. */ LT_SCOPE int lt_dladdsearchdir LT_PARAMS((const char *search_dir)); LT_SCOPE int lt_dlinsertsearchdir LT_PARAMS((const char *before, const char *search_dir)); LT_SCOPE int lt_dlsetsearchpath LT_PARAMS((const char *search_path)); LT_SCOPE const char *lt_dlgetsearchpath LT_PARAMS((void)); LT_SCOPE int lt_dlforeachfile LT_PARAMS(( const char *search_path, int (*func) (const char *filename, lt_ptr data), lt_ptr data)); /* Portable libltdl versions of the system dlopen() API. */ LT_SCOPE lt_dlhandle lt_dlopen LT_PARAMS((const char *filename)); LT_SCOPE lt_dlhandle lt_dlopenext LT_PARAMS((const char *filename)); LT_SCOPE lt_ptr lt_dlsym LT_PARAMS((lt_dlhandle handle, const char *name)); LT_SCOPE const char *lt_dlerror LT_PARAMS((void)); LT_SCOPE int lt_dlclose LT_PARAMS((lt_dlhandle handle)); /* Module residency management. */ LT_SCOPE int lt_dlmakeresident LT_PARAMS((lt_dlhandle handle)); LT_SCOPE int lt_dlisresident LT_PARAMS((lt_dlhandle handle)); /* --- MUTEX LOCKING --- */ typedef void lt_dlmutex_lock LT_PARAMS((void)); typedef void lt_dlmutex_unlock LT_PARAMS((void)); typedef void lt_dlmutex_seterror LT_PARAMS((const char *errmsg)); typedef const char *lt_dlmutex_geterror LT_PARAMS((void)); LT_SCOPE int lt_dlmutex_register LT_PARAMS((lt_dlmutex_lock *lock, lt_dlmutex_unlock *unlock, lt_dlmutex_seterror *seterror, lt_dlmutex_geterror *geterror)); /* --- MEMORY HANDLING --- */ /* By default, the realloc function pointer is set to our internal realloc implementation which iself uses lt_dlmalloc and lt_dlfree. libltdl relies on a featureful realloc, but if you are sure yours has the right semantics then you can assign it directly. Generally, it is safe to assign just a malloc() and a free() function. */ LT_SCOPE lt_ptr (*lt_dlmalloc) LT_PARAMS((size_t size)); LT_SCOPE lt_ptr (*lt_dlrealloc) LT_PARAMS((lt_ptr ptr, size_t size)); LT_SCOPE void (*lt_dlfree) LT_PARAMS((lt_ptr ptr)); /* --- PRELOADED MODULE SUPPORT --- */ /* A preopened symbol. Arrays of this type comprise the exported symbols for a dlpreopened module. */ typedef struct { const char *name; lt_ptr address; } lt_dlsymlist; LT_SCOPE int lt_dlpreload LT_PARAMS((const lt_dlsymlist *preloaded)); LT_SCOPE int lt_dlpreload_default LT_PARAMS((const lt_dlsymlist *preloaded)); #define LTDL_SET_PRELOADED_SYMBOLS() LT_STMT_START{ \ extern const lt_dlsymlist lt_preloaded_symbols[]; \ lt_dlpreload_default(lt_preloaded_symbols); \ }LT_STMT_END /* --- MODULE INFORMATION --- */ /* Read only information pertaining to a loaded module. */ typedef struct { char *filename; /* file name */ char *name; /* module name */ int ref_count; /* number of times lt_dlopened minus number of times lt_dlclosed. */ } lt_dlinfo; LT_SCOPE const lt_dlinfo *lt_dlgetinfo LT_PARAMS((lt_dlhandle handle)); LT_SCOPE lt_dlhandle lt_dlhandle_next LT_PARAMS((lt_dlhandle place)); LT_SCOPE int lt_dlforeach LT_PARAMS(( int (*func) (lt_dlhandle handle, lt_ptr data), lt_ptr data)); /* Associating user data with loaded modules. */ typedef unsigned lt_dlcaller_id; LT_SCOPE lt_dlcaller_id lt_dlcaller_register LT_PARAMS((void)); LT_SCOPE lt_ptr lt_dlcaller_set_data LT_PARAMS((lt_dlcaller_id key, lt_dlhandle handle, lt_ptr data)); LT_SCOPE lt_ptr lt_dlcaller_get_data LT_PARAMS((lt_dlcaller_id key, lt_dlhandle handle)); /* --- USER MODULE LOADER API --- */ typedef struct lt_dlloader lt_dlloader; typedef lt_ptr lt_user_data; typedef lt_ptr lt_module; /* Function pointer types for creating user defined module loaders. */ typedef lt_module lt_module_open LT_PARAMS((lt_user_data loader_data, const char *filename)); typedef int lt_module_close LT_PARAMS((lt_user_data loader_data, lt_module handle)); typedef lt_ptr lt_find_sym LT_PARAMS((lt_user_data loader_data, lt_module handle, const char *symbol)); typedef int lt_dlloader_exit LT_PARAMS((lt_user_data loader_data)); struct lt_user_dlloader { const char *sym_prefix; lt_module_open *module_open; lt_module_close *module_close; lt_find_sym *find_sym; lt_dlloader_exit *dlloader_exit; lt_user_data dlloader_data; }; LT_SCOPE lt_dlloader *lt_dlloader_next LT_PARAMS((lt_dlloader *place)); LT_SCOPE lt_dlloader *lt_dlloader_find LT_PARAMS(( const char *loader_name)); LT_SCOPE const char *lt_dlloader_name LT_PARAMS((lt_dlloader *place)); LT_SCOPE lt_user_data *lt_dlloader_data LT_PARAMS((lt_dlloader *place)); LT_SCOPE int lt_dlloader_add LT_PARAMS((lt_dlloader *place, const struct lt_user_dlloader *dlloader, const char *loader_name)); LT_SCOPE int lt_dlloader_remove LT_PARAMS(( const char *loader_name)); /* --- ERROR MESSAGE HANDLING --- */ /* Defining error strings alongside their symbolic names in a macro in this way allows us to expand the macro in different contexts with confidence that the enumeration of symbolic names will map correctly onto the table of error strings. */ #define lt_dlerror_table \ LT_ERROR(UNKNOWN, "unknown error") \ LT_ERROR(DLOPEN_NOT_SUPPORTED, "dlopen support not available") \ LT_ERROR(INVALID_LOADER, "invalid loader") \ LT_ERROR(INIT_LOADER, "loader initialization failed") \ LT_ERROR(REMOVE_LOADER, "loader removal failed") \ LT_ERROR(FILE_NOT_FOUND, "file not found") \ LT_ERROR(DEPLIB_NOT_FOUND, "dependency library not found") \ LT_ERROR(NO_SYMBOLS, "no symbols defined") \ LT_ERROR(CANNOT_OPEN, "can't open the module") \ LT_ERROR(CANNOT_CLOSE, "can't close the module") \ LT_ERROR(SYMBOL_NOT_FOUND, "symbol not found") \ LT_ERROR(NO_MEMORY, "not enough memory") \ LT_ERROR(INVALID_HANDLE, "invalid module handle") \ LT_ERROR(BUFFER_OVERFLOW, "internal buffer overflow") \ LT_ERROR(INVALID_ERRORCODE, "invalid errorcode") \ LT_ERROR(SHUTDOWN, "library already shutdown") \ LT_ERROR(CLOSE_RESIDENT_MODULE, "can't close resident module") \ LT_ERROR(INVALID_MUTEX_ARGS, "invalid mutex handler registration") \ LT_ERROR(INVALID_POSITION, "invalid search path insert position") \ LT_ERROR(FR_DEPLIB, "dep lib loading bug, please report to freeradius-devel@lists.freeradius.org") /* Enumerate the symbolic error names. */ enum { #define LT_ERROR(name, diagnostic) LT_CONC(LT_ERROR_, name), lt_dlerror_table #undef LT_ERROR LT_ERROR_MAX }; /* These functions are only useful from inside custom module loaders. */ LT_SCOPE int lt_dladderror LT_PARAMS((const char *diagnostic)); LT_SCOPE int lt_dlseterror LT_PARAMS((int errorcode)); /* --- SOURCE COMPATIBILITY WITH OLD LIBLTDL --- */ #ifdef LT_NON_POSIX_NAMESPACE # define lt_ptr_t lt_ptr # define lt_module_t lt_module # define lt_module_open_t lt_module_open # define lt_module_close_t lt_module_close # define lt_find_sym_t lt_find_sym # define lt_dlloader_exit_t lt_dlloader_exit # define lt_dlloader_t lt_dlloader # define lt_dlloader_data_t lt_user_data #endif LT_END_C_DECLS #endif /* !LTDL_H */ freeradius-server/libltdl/ltmain.sh000077500000000000000000005775301257552170400200150ustar00rootroot00000000000000# ltmain.sh - Provide generalized library-building support services. # NOTE: Changing this file will not affect anything until you rerun configure. # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005 # Free Software Foundation, Inc. # Originally by Gordon Matzigkeit , 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 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. basename="s,^.*/,,g" # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh # is ksh but when the shell is invoked as "sh" and the current value of # the _XPG environment variable is not equal to 1 (one), the special # positional parameter $0, within a function call, is the name of the # function. progpath="$0" # The name of this program: progname=`echo "$progpath" | $SED $basename` modename="$progname" # Global variables: EXIT_SUCCESS=0 EXIT_FAILURE=1 PROGRAM=ltmain.sh PACKAGE=libtool VERSION=1.5.22 TIMESTAMP=" (1.1220.2.365 2005/12/18 22:14:06)" # 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 # Check that we have a working $echo. if test "X$1" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test "X$1" = X--fallback-echo; then # Avoid inline document here, it may be left over : elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then # Yippee, $echo works! : else # Restart under the correct shell, and then maybe $echo will work. exec $SHELL "$progpath" --no-reexec ${1+"$@"} fi if test "X$1" = X--fallback-echo; then # used as fallback echo shift cat <&2 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 exit $EXIT_FAILURE fi # Global variables. mode=$default_mode nonopt= prev= prevopt= run= show="$echo" show_help= execute_dlfiles= duplicate_deps=no preserve_args= lo2o="s/\\.lo\$/.${objext}/" o2lo="s/\\.${objext}\$/.lo/" ##################################### # Shell function definitions: # This seems to be the best place for them # 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 "$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" || { $echo "cannot create temporary directory \`$my_tmpdir'" 1>&2 exit $EXIT_FAILURE } fi $echo "X$my_tmpdir" | $Xsed } # func_win32_libid arg # return the library type of file 'arg' # # Need a lot of goo to handle *both* DLLs and import libs # Has to be a shell function in order to 'eat' the argument # that is supplied when $file_magic_command is called. func_win32_libid () { win32_libid_type="unknown" win32_fileres=`file -L $1 2>/dev/null` case $win32_fileres in *ar\ archive\ import\ library*) # definitely import win32_libid_type="x86 archive import" ;; *ar\ archive*) # could be an import, or static if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \ $EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then win32_nmres=`eval $NM -f posix -A $1 | \ $SED -n -e '1,100{/ I /{s,.*,import,;p;q;};}'` case $win32_nmres in import*) win32_libid_type="x86 archive import";; *) win32_libid_type="x86 archive static";; esac fi ;; *DLL*) win32_libid_type="x86 DLL" ;; *executable*) # but shell scripts are "executable" too... case $win32_fileres in *MS\ Windows\ PE\ Intel*) win32_libid_type="x86 DLL" ;; esac ;; esac $echo $win32_libid_type } # func_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 () { if test -n "$available_tags" && test -z "$tagname"; then CC_quoted= for arg in $CC; do case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac CC_quoted="$CC_quoted $arg" done case $@ in # Blanks in the command may have been stripped by the calling shell, # but not from the CC environment variable when configure was run. " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) ;; # Blanks at the start of $base_compile will cause this to fail # if we don't check for them as well. *) for z in $available_tags; do if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then # Evaluate the configuration. eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" CC_quoted= for arg in $CC; do # Double-quote args containing other shell metacharacters. case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac CC_quoted="$CC_quoted $arg" done case "$@ " in " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) # The compiler in the base compile command matches # the one in the tagged configuration. # Assume this is the tagged configuration we want. tagname=$z break ;; esac fi done # If $tagname still isn't set, then no tagged configuration # was found and let the user know that the "--tag" command # line option must be used. if test -z "$tagname"; then $echo "$modename: unable to infer tagged configuration" $echo "$modename: specify a tag with \`--tag'" 1>&2 exit $EXIT_FAILURE # else # $echo "$modename: using $tagname tagged configuration" fi ;; esac fi } # func_extract_an_archive dir oldlib func_extract_an_archive () { f_ex_an_ar_dir="$1"; shift f_ex_an_ar_oldlib="$1" $show "(cd $f_ex_an_ar_dir && $AR x $f_ex_an_ar_oldlib)" $run eval "(cd \$f_ex_an_ar_dir && $AR x \$f_ex_an_ar_oldlib)" || exit $? if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then : else $echo "$modename: ERROR: object name conflicts: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" 1>&2 exit $EXIT_FAILURE fi } # func_extract_archives gentop oldlib ... func_extract_archives () { my_gentop="$1"; shift my_oldlibs=${1+"$@"} my_oldobjs="" my_xlib="" my_xabs="" my_xdir="" my_status="" $show "${rm}r $my_gentop" $run ${rm}r "$my_gentop" $show "$mkdir $my_gentop" $run $mkdir "$my_gentop" my_status=$? if test "$my_status" -ne 0 && test ! -d "$my_gentop"; then exit $my_status fi 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 my_xlib=`$echo "X$my_xlib" | $Xsed -e 's%^.*/%%'` my_xdir="$my_gentop/$my_xlib" $show "${rm}r $my_xdir" $run ${rm}r "$my_xdir" $show "$mkdir $my_xdir" $run $mkdir "$my_xdir" exit_status=$? if test "$exit_status" -ne 0 && test ! -d "$my_xdir"; then exit $exit_status fi case $host in *-darwin*) $show "Extracting $my_xabs" # Do not bother doing anything if just a dry run if test -z "$run"; then darwin_orig_dir=`pwd` cd $my_xdir || exit $? darwin_archive=$my_xabs darwin_curdir=`pwd` darwin_base_archive=`$echo "X$darwin_archive" | $Xsed -e 's%^.*/%%'` darwin_arches=`lipo -info "$darwin_archive" 2>/dev/null | $EGREP Architectures 2>/dev/null` if test -n "$darwin_arches"; then darwin_arches=`echo "$darwin_arches" | $SED -e 's/.*are://'` darwin_arch= $show "$darwin_base_archive has multiple architectures $darwin_arches" for darwin_arch in $darwin_arches ; do 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 have a bunch of thin objects, gotta fatten them up :) darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print| xargs basename | sort -u | $NL2SP` darwin_file= darwin_files= for darwin_file in $darwin_filelist; do darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP` lipo -create -output "$darwin_file" $darwin_files done # $darwin_filelist ${rm}r unfat-$$ cd "$darwin_orig_dir" else cd "$darwin_orig_dir" func_extract_an_archive "$my_xdir" "$my_xabs" fi # $darwin_arches fi # $run ;; *) func_extract_an_archive "$my_xdir" "$my_xabs" ;; esac my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP` done func_extract_archives_result="$my_oldobjs" } # End of Shell function definitions ##################################### # Darwin sucks eval std_shrext=\"$shrext_cmds\" disable_libs=no # Parse our command line options once, thoroughly. while test "$#" -gt 0 do arg="$1" shift case $arg in -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;; *) optarg= ;; esac # If the previous option needs an argument, assign it. if test -n "$prev"; then case $prev in execute_dlfiles) execute_dlfiles="$execute_dlfiles $arg" ;; tag) tagname="$arg" preserve_args="${preserve_args}=$arg" # Check whether tagname contains only valid characters case $tagname in *[!-_A-Za-z0-9,/]*) $echo "$progname: invalid tag name: $tagname" 1>&2 exit $EXIT_FAILURE ;; esac case $tagname in CC) # Don't test for the "default" C tag, as we know, it's there, but # not specially marked. ;; *) if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$progpath" > /dev/null; then taglist="$taglist $tagname" # Evaluate the configuration. eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $progpath`" else $echo "$progname: ignoring unknown tag $tagname" 1>&2 fi ;; esac ;; *) eval "$prev=\$arg" ;; esac prev= prevopt= continue fi # Have we seen a non-optional argument yet? case $arg in --help) show_help=yes ;; --version) $echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP" $echo $echo "Copyright (C) 2005 Free Software Foundation, Inc." $echo "This is free software; see the source for copying conditions. There is NO" $echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." exit $? ;; --config) ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $progpath # Now print the configurations for the tags. for tagname in $taglist; do ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath" done exit $? ;; --debug) $echo "$progname: enabling shell trace mode" set -x preserve_args="$preserve_args $arg" ;; --dry-run | -n) run=: ;; --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 $? ;; --finish) mode="finish" ;; --mode) prevopt="--mode" prev=mode ;; --mode=*) mode="$optarg" ;; --preserve-dup-deps) duplicate_deps="yes" ;; --quiet | --silent) show=: preserve_args="$preserve_args $arg" ;; --tag) prevopt="--tag" prev=tag preserve_args="$preserve_args --tag" ;; --tag=*) set tag "$optarg" ${1+"$@"} shift prev=tag preserve_args="$preserve_args --tag" ;; -dlopen) prevopt="-dlopen" prev=execute_dlfiles ;; -*) $echo "$modename: unrecognized option \`$arg'" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE ;; *) nonopt="$arg" break ;; esac done if test -n "$prevopt"; then $echo "$modename: option \`$prevopt' requires an argument" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi case $disable_libs in no) ;; shared) build_libtool_libs=no build_old_libs=yes ;; static) build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` ;; esac # 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= if test -z "$show_help"; then # Infer the operation mode. if test -z "$mode"; then $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2 $echo "*** Future versions of Libtool will require --mode=MODE be specified." 1>&2 case $nonopt in *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*) mode=link for arg do case $arg in -c) mode=compile break ;; esac done ;; *db | *dbx | *strace | *truss) mode=execute ;; *install*|cp|mv) mode=install ;; *rm) mode=uninstall ;; *) # If we have no mode, but dlfiles were specified, then do execute mode. test -n "$execute_dlfiles" && mode=execute # Just use the default operation mode. if test -z "$mode"; then if test -n "$nonopt"; then $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2 else $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2 fi fi ;; esac fi # Only execute mode is allowed to have -dlopen flags. if test -n "$execute_dlfiles" && test "$mode" != execute; then $echo "$modename: unrecognized option \`-dlopen'" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi # Change the help message to a mode-specific one. generic_help="$help" help="Try \`$modename --help --mode=$mode' for more information." # These modes are in order of execution frequency so that they run quickly. case $mode in # libtool compile mode compile) modename="$modename: compile" # 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= 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) if test -n "$libobj" ; then $echo "$modename: you cannot specify \`-o' more than once" 1>&2 exit $EXIT_FAILURE fi arg_mode=target continue ;; -static | -prefer-pic | -prefer-non-pic) later="$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,*) args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"` lastarg= save_ifs="$IFS"; IFS=',' for arg in $args; do IFS="$save_ifs" # Double-quote args containing other shell metacharacters. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac lastarg="$lastarg $arg" done IFS="$save_ifs" lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"` # Add the arguments to base_compile. base_compile="$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. lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"` case $lastarg in # Double-quote args containing other shell metacharacters. # Many Bourne shells cannot handle close brackets correctly # in scan sets, and some SunOS ksh mistreat backslash-escaping # in scan sets (worked around with variable expansion), # and furthermore cannot handle '|' '&' '(' ')' in scan sets # at all, so we specify them separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") lastarg="\"$lastarg\"" ;; esac base_compile="$base_compile $lastarg" done # for arg case $arg_mode in arg) $echo "$modename: you must specify an argument for -Xcompile" exit $EXIT_FAILURE ;; target) $echo "$modename: you must specify a target with \`-o'" 1>&2 exit $EXIT_FAILURE ;; *) # Get the name of the library object. [ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'` ;; esac # Recognize several different file suffixes. # If the user specifies -o file.o, it is replaced with file.lo xform='[cCFSifmso]' case $libobj in *.ada) xform=ada ;; *.adb) xform=adb ;; *.ads) xform=ads ;; *.asm) xform=asm ;; *.c++) xform=c++ ;; *.cc) xform=cc ;; *.ii) xform=ii ;; *.class) xform=class ;; *.cpp) xform=cpp ;; *.cxx) xform=cxx ;; *.f90) xform=f90 ;; *.for) xform=for ;; *.java) xform=java ;; esac libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"` case $libobj in *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;; *) $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2 exit $EXIT_FAILURE ;; esac func_infer_tag $base_compile for arg in $later; do case $arg in -static) build_old_libs=yes continue ;; -prefer-pic) pic_mode=yes continue ;; -prefer-non-pic) pic_mode=no continue ;; esac done qlibobj=`$echo "X$libobj" | $Xsed -e "$sed_quote_subst"` case $qlibobj in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") qlibobj="\"$qlibobj\"" ;; esac test "X$libobj" != "X$qlibobj" \ && $echo "X$libobj" | grep '[]~#^*{};<>?"'"'"' &()|`$[]' \ && $echo "$modename: libobj name \`$libobj' may not contain shell special characters." objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'` xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'` if test "X$xdir" = "X$obj"; then xdir= else xdir=$xdir/ fi lobj=${xdir}$objdir/$objname if test -z "$base_compile"; then $echo "$modename: you must specify a compilation command" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi # 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 $run $rm $removelist trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15 # On Cygwin there's no "real" PIC flag so we must build both object types case $host_os in cygwin* | mingw* | pw32* | os2*) pic_mode=default ;; esac if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then # non-PIC code in shared libraries is not supported pic_mode=default fi # Calculate the filename of the output object if compiler does # not support -o with -c if test "$compiler_c_o" = no; then output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext} lockfile="$output_obj.lock" removelist="$removelist $output_obj $lockfile" trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15 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 $run ln "$progpath" "$lockfile" 2>/dev/null; do $show "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." $run $rm $removelist exit $EXIT_FAILURE fi $echo "$srcfile" > "$lockfile" fi if test -n "$fix_srcfile_path"; then eval srcfile=\"$fix_srcfile_path\" fi qsrcfile=`$echo "X$srcfile" | $Xsed -e "$sed_quote_subst"` case $qsrcfile in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") qsrcfile="\"$qsrcfile\"" ;; esac $run $rm "$libobj" "${libobj}T" # Create a libtool object file (analogous to a ".la" file), # but don't create it if we're doing a dry run. test -z "$run" && cat > ${libobj}T </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." $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 $show "$mv $output_obj $lobj" if $run $mv $output_obj $lobj; then : else error=$? $run $rm $removelist exit $error fi fi # Append the name of the PIC object to the libtool object file. test -z "$run" && cat >> ${libobj}T <> ${libobj}T </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." $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 $show "$mv $output_obj $obj" if $run $mv $output_obj $obj; then : else error=$? $run $rm $removelist exit $error fi fi # Append the name of the non-PIC object the libtool object file. # Only append if the libtool object file exists. test -z "$run" && cat >> ${libobj}T <> ${libobj}T <&2 fi if test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes else if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=built fi 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 case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test ;; *) qarg=$arg ;; esac libtool_args="$libtool_args $qarg" # If the previous option needs an argument, assign it. if test -n "$prev"; then case $prev in output) compile_command="$compile_command @OUTPUT@" finalize_command="$finalize_command @OUTPUT@" ;; esac case $prev in dlfiles|dlprefiles) if test "$preload" = no; then # Add the symbol object into the linking commands. compile_command="$compile_command @SYMFILE@" finalize_command="$finalize_command @SYMFILE@" preload=yes fi case $arg in *.la | *.lo) ;; # We handle these cases below. force) if test "$dlself" = no; then dlself=needless export_dynamic=yes fi prev= continue ;; self) if test "$prev" = dlprefiles; then dlself=yes elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then dlself=yes else dlself=needless export_dynamic=yes fi prev= continue ;; *) if test "$prev" = dlfiles; then dlfiles="$dlfiles $arg" else dlprefiles="$dlprefiles $arg" fi prev= continue ;; esac ;; expsyms) export_symbols="$arg" if test ! -f "$arg"; then $echo "$modename: symbol file \`$arg' does not exist" exit $EXIT_FAILURE fi prev= continue ;; expsyms_regex) export_symbols_regex="$arg" prev= continue ;; inst_prefix) inst_prefix_dir="$arg" prev= continue ;; precious_regex) precious_files_regex="$arg" prev= continue ;; release) release="-$arg" prev= continue ;; objectlist) if test -f "$arg"; then save_arg=$arg moreargs= for fil in `cat $save_arg` do # moreargs="$moreargs $fil" arg=$fil # A libtool-controlled object. # Check to see that this really is a libtool object. if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then pic_object= non_pic_object= # Read the .lo file # If there is no directory component, then add one. case $arg in */* | *\\*) . $arg ;; *) . ./$arg ;; esac if test -z "$pic_object" || \ test -z "$non_pic_object" || test "$pic_object" = none && \ test "$non_pic_object" = none; then $echo "$modename: cannot find name of object for \`$arg'" 1>&2 exit $EXIT_FAILURE fi # Extract subdirectory from the argument. xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` if test "X$xdir" = "X$arg"; then xdir= else xdir="$xdir/" fi if test "$pic_object" != none; then # Prepend the subdirectory the object is found in. pic_object="$xdir$pic_object" if test "$prev" = dlfiles; then if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then dlfiles="$dlfiles $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test "$prev" = dlprefiles; then # Preload the old-style object. dlprefiles="$dlprefiles $pic_object" prev= fi # A PIC object. libobjs="$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 non_pic_objects="$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" non_pic_objects="$non_pic_objects $non_pic_object" fi else # Only an error if not doing a dry-run. if test -z "$run"; then $echo "$modename: \`$arg' is not a valid libtool object" 1>&2 exit $EXIT_FAILURE else # Dry-run case. # Extract subdirectory from the argument. xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` if test "X$xdir" = "X$arg"; then xdir= else xdir="$xdir/" fi pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"` non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"` libobjs="$libobjs $pic_object" non_pic_objects="$non_pic_objects $non_pic_object" fi fi done else $echo "$modename: link input file \`$save_arg' does not exist" exit $EXIT_FAILURE fi arg=$save_arg prev= continue ;; rpath | xrpath) # We need an absolute path. case $arg in [\\/]* | [A-Za-z]:[\\/]*) ;; *) $echo "$modename: only absolute run-paths are allowed" 1>&2 exit $EXIT_FAILURE ;; esac if test "$prev" = rpath; then case "$rpath " in *" $arg "*) ;; *) rpath="$rpath $arg" ;; esac else case "$xrpath " in *" $arg "*) ;; *) xrpath="$xrpath $arg" ;; esac fi prev= continue ;; xcompiler) compiler_flags="$compiler_flags $qarg" prev= compile_command="$compile_command $qarg" finalize_command="$finalize_command $qarg" continue ;; xlinker) linker_flags="$linker_flags $qarg" compiler_flags="$compiler_flags $wl$qarg" prev= compile_command="$compile_command $wl$qarg" finalize_command="$finalize_command $wl$qarg" continue ;; xcclinker) linker_flags="$linker_flags $qarg" compiler_flags="$compiler_flags $qarg" prev= compile_command="$compile_command $qarg" finalize_command="$finalize_command $qarg" continue ;; shrext) shrext_cmds="$arg" prev= continue ;; darwin_framework|darwin_framework_skip) test "$prev" = "darwin_framework" && compiler_flags="$compiler_flags $arg" compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" prev= 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 compile_command="$compile_command $link_static_flag" finalize_command="$finalize_command $link_static_flag" fi continue ;; -allow-undefined) # FIXME: remove this flag sometime in the future. $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2 continue ;; -avoid-version) avoid_version=yes continue ;; -dlopen) prev=dlfiles continue ;; -dlpreopen) prev=dlprefiles continue ;; -export-dynamic) export_dynamic=yes continue ;; -export-symbols | -export-symbols-regex) if test -n "$export_symbols" || test -n "$export_symbols_regex"; then $echo "$modename: more than one -exported-symbols argument is not allowed" exit $EXIT_FAILURE fi if test "X$arg" = "X-export-symbols"; then prev=expsyms else prev=expsyms_regex fi continue ;; -framework|-arch|-isysroot) case " $CC " in *" ${arg} ${1} "* | *" ${arg} ${1} "*) prev=darwin_framework_skip ;; *) compiler_flags="$compiler_flags $arg" prev=darwin_framework ;; esac compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" 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*) compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" ;; esac continue ;; -L*) dir=`$echo "X$arg" | $Xsed -e 's/^-L//'` # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) absdir=`cd "$dir" && pwd` if test -z "$absdir"; then $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2 absdir="$dir" notinst_path="$notinst_path $dir" fi dir="$absdir" ;; esac case "$deplibs " in *" -L$dir "*) ;; *) deplibs="$deplibs -L$dir" lib_search_path="$lib_search_path $dir" ;; esac case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) testbindir=`$echo "X$dir" | $Xsed -e 's*/lib$*/bin*'` case :$dllsearchpath: in *":$dir:"*) ;; *) dllsearchpath="$dllsearchpath:$dir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; *) dllsearchpath="$dllsearchpath:$testbindir";; esac ;; esac continue ;; -l*) if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos*) # These systems don't actually have a C or math library (as such) continue ;; *-*-os2*) # These systems don't actually have a C library (as such) test "X$arg" = "X-lc" && continue ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc due to us having libc/libc_r. test "X$arg" = "X-lc" && continue ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C and math libraries are in the System framework deplibs="$deplibs -framework System" continue ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype test "X$arg" = "X-lc" && continue ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work test "X$arg" = "X-lc" && continue ;; esac elif test "X$arg" = "X-lc_r"; then case $host in *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc_r directly, use -pthread flag. continue ;; esac fi deplibs="$deplibs $arg" continue ;; # Tru64 UNIX uses -model [arg] to determine the layout of C++ # classes, name mangling, and exception handling. -model) compile_command="$compile_command $arg" compiler_flags="$compiler_flags $arg" finalize_command="$finalize_command $arg" prev=xcompiler continue ;; -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe) compiler_flags="$compiler_flags $arg" compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" continue ;; -module) module=yes continue ;; # -64, -mips[0-9] enable 64-bit mode on the SGI compiler # -r[0-9][0-9]* specifies the processor on the SGI compiler # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler # +DA*, +DD* enable 64-bit mode on the HP compiler # -q* pass through compiler args for the IBM compiler # -m* pass through architecture-specific compiler args for GCC # -m*, -t[45]*, -txscale* pass through architecture-specific # compiler args for GCC # -pg pass through profiling flag for GCC # @file GCC response files -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*|-pg| \ -t[45]*|-txscale*|@*) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" compiler_flags="$compiler_flags $arg" continue ;; -shrext) prev=shrext continue ;; -no-fast-install) fast_install=no continue ;; -no-install) case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) # The PATH hackery in wrapper scripts is required on Windows # in order for the loader to find any dlls it needs. $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2 $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2 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*) dir=`$echo "X$arg" | $Xsed -e 's/^-R//'` # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) $echo "$modename: only absolute run-paths are allowed" 1>&2 exit $EXIT_FAILURE ;; esac case "$xrpath " in *" $dir "*) ;; *) xrpath="$xrpath $dir" ;; esac continue ;; -static) # 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 ;; -Wc,*) args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'` arg= save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" case $flag in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") flag="\"$flag\"" ;; esac arg="$arg $wl$flag" compiler_flags="$compiler_flags $flag" done IFS="$save_ifs" arg=`$echo "X$arg" | $Xsed -e "s/^ //"` ;; -Wl,*) args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'` arg= save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" case $flag in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") flag="\"$flag\"" ;; esac arg="$arg $wl$flag" compiler_flags="$compiler_flags $wl$flag" linker_flags="$linker_flags $flag" done IFS="$save_ifs" arg=`$echo "X$arg" | $Xsed -e "s/^ //"` ;; -Xcompiler) prev=xcompiler continue ;; -Xlinker) prev=xlinker continue ;; -XCClinker) prev=xcclinker continue ;; # Some other compiler flag. -* | +*) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac ;; *.$objext) # A standard object. objs="$objs $arg" ;; *.lo) # A libtool-controlled object. # Check to see that this really is a libtool object. if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then pic_object= non_pic_object= # Read the .lo file # If there is no directory component, then add one. case $arg in */* | *\\*) . $arg ;; *) . ./$arg ;; esac if test -z "$pic_object" || \ test -z "$non_pic_object" || test "$pic_object" = none && \ test "$non_pic_object" = none; then $echo "$modename: cannot find name of object for \`$arg'" 1>&2 exit $EXIT_FAILURE fi # Extract subdirectory from the argument. xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` if test "X$xdir" = "X$arg"; then xdir= else xdir="$xdir/" fi if test "$pic_object" != none; then # Prepend the subdirectory the object is found in. pic_object="$xdir$pic_object" if test "$prev" = dlfiles; then if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then dlfiles="$dlfiles $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test "$prev" = dlprefiles; then # Preload the old-style object. dlprefiles="$dlprefiles $pic_object" prev= fi # A PIC object. libobjs="$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 non_pic_objects="$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" non_pic_objects="$non_pic_objects $non_pic_object" fi else # Only an error if not doing a dry-run. if test -z "$run"; then $echo "$modename: \`$arg' is not a valid libtool object" 1>&2 exit $EXIT_FAILURE else # Dry-run case. # Extract subdirectory from the argument. xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` if test "X$xdir" = "X$arg"; then xdir= else xdir="$xdir/" fi pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"` non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"` libobjs="$libobjs $pic_object" non_pic_objects="$non_pic_objects $non_pic_object" fi fi ;; *.$libext) # An archive. deplibs="$deplibs $arg" old_deplibs="$old_deplibs $arg" continue ;; *.la) # A libtool-controlled library. if test "$prev" = dlfiles; then # This library was specified with -dlopen. dlfiles="$dlfiles $arg" prev= elif test "$prev" = dlprefiles; then # The library was specified with -dlpreopen. dlprefiles="$dlprefiles $arg" prev= else deplibs="$deplibs $arg" fi continue ;; # Some other compiler argument. *) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac ;; esac # arg # Now actually substitute the argument into the commands. if test -n "$arg"; then compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" fi done # argument parsing loop if test -n "$prev"; then $echo "$modename: the \`$prevarg' option requires an argument" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then eval arg=\"$export_dynamic_flag_spec\" compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" fi oldlibs= # calculate the name of the file, without its directory outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'` libobjs_save="$libobjs" if test -n "$shlibpath_var"; then # get the directories listed in $shlibpath_var eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\` else shlib_search_path= fi eval sys_lib_search_path=\"$sys_lib_search_path_spec\" eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'` if test "X$output_objdir" = "X$output"; then output_objdir="$objdir" else output_objdir="$output_objdir/$objdir" fi # Create the object directory. if test ! -d "$output_objdir"; then $show "$mkdir $output_objdir" $run $mkdir $output_objdir exit_status=$? if test "$exit_status" -ne 0 && test ! -d "$output_objdir"; then exit $exit_status fi fi # Determine the type of output case $output in "") $echo "$modename: you must specify an output file" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE ;; *.$libext) linkmode=oldlib ;; *.lo | *.$objext) linkmode=obj ;; *.la) linkmode=lib ;; *) linkmode=prog ;; # Anything else should be a program. esac case $host in *cygwin* | *mingw* | *pw32*) # don't eliminate duplications in $postdeps and $predeps duplicate_compiler_generated_deps=yes ;; *) duplicate_compiler_generated_deps=$duplicate_deps ;; 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 test "X$duplicate_deps" = "Xyes" ; then case "$libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi libs="$libs $deplib" done if test "$linkmode" = lib; then libs="$predeps $libs $compiler_lib_search_path $postdeps" # Compute libraries that are listed more than once in $predeps # $postdeps and mark them as special (i.e., whose duplicates are # not to be eliminated). pre_post_deps= if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then for pre_post_dep in $predeps $postdeps; do case "$pre_post_deps " in *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;; esac pre_post_deps="$pre_post_deps $pre_post_dep" done fi pre_post_deps= fi deplibs= newdependency_libs= newlib_search_path= need_relink=no # whether we're linking any uninstalled libtool libraries notinst_deplibs= # not-installed libtool libraries case $linkmode in lib) passes="conv link" for file in $dlfiles $dlprefiles; do case $file in *.la) ;; *) $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2 exit $EXIT_FAILURE ;; 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 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 "$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) if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else compiler_flags="$compiler_flags $deplib" fi continue ;; -l*) if test "$linkmode" != lib && test "$linkmode" != prog; then $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2 continue fi name=`$echo "X$deplib" | $Xsed -e 's/^-l//'` for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; 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 (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then library_names= old_library= case $lib in */* | *\\*) . $lib ;; *) . ./$lib ;; esac 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 ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'` test "X$ladir" = "X$lib" && ladir="." 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 -L*) case $linkmode in lib) deplibs="$deplib $deplibs" test "$pass" = conv && continue newdependency_libs="$deplib $newdependency_libs" newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` ;; 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 newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` ;; *) $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2 ;; esac # linkmode continue ;; # -L -R*) if test "$pass" = link; then dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'` # Make sure the xrpath contains only unique directories. case "$xrpath " in *" $dir "*) ;; *) xrpath="$xrpath $dir" ;; esac fi deplibs="$deplib $deplibs" continue ;; *.la) lib="$deplib" ;; *.$libext) if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi case $linkmode in lib) valid_a_lib=no case $deplibs_check_method in match_pattern*) set dummy $deplibs_check_method match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` 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 used here." else $echo $echo "*** Warning: Linking the shared library $output against the" $echo "*** static library $deplib is not portable!" deplibs="$deplib $deplibs" fi continue ;; prog) if test "$pass" != link; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi continue ;; esac # linkmode ;; # *.$libext *.lo | *.$objext) if test "$pass" = conv; then deplibs="$deplib $deplibs" elif test "$linkmode" = prog; then if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlopen support or we're linking statically, # we need to preload. newdlprefiles="$newdlprefiles $deplib" compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else newdlfiles="$newdlfiles $deplib" fi fi continue ;; %DEPLIBS%) alldeplibs=yes continue ;; esac # case $deplib if test "$found" = yes || test -f "$lib"; then : else $echo "$modename: cannot find the library \`$lib' or unhandled argument \`$deplib'" 1>&2 exit $EXIT_FAILURE fi # Check to see that this really is a libtool archive. if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : else $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 exit $EXIT_FAILURE fi ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'` test "X$ladir" = "X$lib" && ladir="." dlname= dlopen= dlpreopen= libdir= library_names= old_library= # 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 case $lib in */* | *\\*) . $lib ;; *) . ./$lib ;; esac if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan" || { test "$linkmode" != prog && test "$linkmode" != lib; }; then test -n "$dlopen" && dlfiles="$dlfiles $dlopen" test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen" fi if test "$pass" = conv; then # Only check for convenience libraries deplibs="$lib $deplibs" if test -z "$libdir"; then if test -z "$old_library"; then $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 exit $EXIT_FAILURE fi # It is a libtool convenience library, so add in its objects. convenience="$convenience $ladir/$objdir/$old_library" old_convenience="$old_convenience $ladir/$objdir/$old_library" tmp_libs= for deplib in $dependency_libs; do deplibs="$deplib $deplibs" if test "X$duplicate_deps" = "Xyes" ; then case "$tmp_libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi tmp_libs="$tmp_libs $deplib" done elif test "$linkmode" != prog && test "$linkmode" != lib; then $echo "$modename: \`$lib' is not a convenience library" 1>&2 exit $EXIT_FAILURE fi continue fi # $pass = conv # Get the name of the library we link against. linklib= for l in $old_library $library_names; do linklib="$l" done if test -z "$linklib"; then $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 exit $EXIT_FAILURE fi # This library was specified with -dlopen. if test "$pass" = dlopen; then if test -z "$libdir"; then $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2 exit $EXIT_FAILURE fi if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlname, no dlopen support or we're linking # statically, we need to preload. We also need to preload any # dependent libraries so libltdl's deplib preloader doesn't # bomb out in the load deplibs phase. dlprefiles="$dlprefiles $lib $dependency_libs" else newdlfiles="$newdlfiles $lib" fi continue fi # $pass = dlopen # We need an absolute path. case $ladir in [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; *) abs_ladir=`cd "$ladir" && pwd` if test -z "$abs_ladir"; then $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2 $echo "$modename: passing it literally to the linker, although it might fail" 1>&2 abs_ladir="$ladir" fi ;; esac laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` # Find the relevant object directory and library name. if test "X$installed" = Xyes; then if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then $echo "$modename: warning: library \`$lib' was moved." 1>&2 dir="$ladir" absdir="$abs_ladir" libdir="$abs_ladir" else dir="$libdir" absdir="$libdir" fi test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes else if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then dir="$ladir" absdir="$abs_ladir" # Remove this search path later notinst_path="$notinst_path $abs_ladir" else dir="$ladir/$objdir" absdir="$abs_ladir/$objdir" # Remove this search path later notinst_path="$notinst_path $abs_ladir" fi fi # $installed = yes name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` # This library was specified with -dlpreopen. if test "$pass" = dlpreopen; then if test -z "$libdir"; then $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2 exit $EXIT_FAILURE fi # Prefer using a static library (so that no silly _DYNAMIC symbols # are required to link). if test -n "$old_library"; then newdlprefiles="$newdlprefiles $dir/$old_library" # Otherwise, use the dlname, so that lt_dlopen finds it. elif test -n "$dlname"; then newdlprefiles="$newdlprefiles $dir/$dlname" else newdlprefiles="$newdlprefiles $dir/$linklib" fi fi # $pass = dlpreopen if test -z "$libdir"; then # Link the convenience library if test "$linkmode" = lib; then deplibs="$dir/$old_library $deplibs" elif test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$dir/$old_library $compile_deplibs" finalize_deplibs="$dir/$old_library $finalize_deplibs" else deplibs="$lib $deplibs" # used for prog,scan pass fi continue fi if test "$linkmode" = prog && test "$pass" != link; then newlib_search_path="$newlib_search_path $ladir" deplibs="$lib $deplibs" linkalldeplibs=no if test "$link_all_deplibs" != no || test -z "$library_names" || test "$build_libtool_libs" = no; then linkalldeplibs=yes fi tmp_libs= for deplib in $dependency_libs; do case $deplib in -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test 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 test "X$duplicate_deps" = "Xyes" ; then case "$tmp_libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi tmp_libs="$tmp_libs $deplib" done # for deplib continue fi # $linkmode = prog... if test "$linkmode,$pass" = "prog,link"; then if test -n "$library_names" && { test "$prefer_static_libs" = no || test -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 *" $dir "*) ;; *" $absdir "*) ;; *) temp_rpath="$temp_rpath $absdir" ;; esac fi # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) compile_rpath="$compile_rpath $absdir" esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" esac ;; esac fi # $linkmode,$pass = prog,link... if test "$alldeplibs" = yes && { test "$deplibs_check_method" = pass_all || { test "$build_libtool_libs" = yes && test -n "$library_names"; }; }; then # We only need to search for static libraries continue fi fi link_static=no # Whether the deplib will be linked statically use_static_libs=$prefer_static_libs if test "$use_static_libs" = built && test "$installed" = yes ; then use_static_libs=no fi if test -n "$library_names" && { test "$use_static_libs" = no || test -z "$old_library"; }; then if test "$installed" = no; then notinst_deplibs="$notinst_deplibs $lib" need_relink=yes fi # This is a shared library # Warn about portability, can't link against -module's on # some systems (darwin) if test "$shouldnotlink" = yes && test "$pass" = link ; then $echo if test "$linkmode" = prog; then $echo "*** Warning: Linking the executable $output against the loadable module" else $echo "*** Warning: Linking the shared library $output against the loadable module" fi $echo "*** $linklib is not portable!" fi if test "$linkmode" = lib && test "$hardcode_into_libs" = yes; then # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) compile_rpath="$compile_rpath $absdir" esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" esac ;; esac fi if test -n "$old_archive_from_expsyms_cmds"; then # figure out the soname set dummy $library_names realname="$2" shift; 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*) major=`expr $current - $age` versuffix="-$major" ;; esac eval soname=\"$soname_spec\" else soname="$realname" fi # Make a new name for the extract_expsyms_cmds to use soroot="$soname" soname=`$echo $soroot | ${SED} -e 's/^.*\///'` newlib="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a" # If the library has no export list, then create one now if test -f "$output_objdir/$soname-def"; then : else $show "extracting exported symbol list from \`$soname'" save_ifs="$IFS"; IFS='~' cmds=$extract_expsyms_cmds for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" fi # Create $newlib if test -f "$output_objdir/$newlib"; then :; else $show "generating import library for \`$soname'" save_ifs="$IFS"; IFS='~' cmds=$old_archive_from_expsyms_cmds for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" fi # make sure the library variables are pointing to the new library dir=$output_objdir linklib=$newlib fi # test -n "$old_archive_from_expsyms_cmds" if test "$linkmode" = prog || test "$mode" != relink; then add_shlibpath= add_dir= add= lib_linked=yes case $hardcode_action in immediate | unsupported) if test "$hardcode_direct" = no; then add="$dir/$linklib" case $host in *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;; *-*-sysv4*uw2*) add_dir="-L$dir" ;; *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ *-*-unixware7*) add_dir="-L$dir" ;; *-*-darwin* ) # if the lib is a module then we can not link against # it, someone is ignoring the new warnings I added if /usr/bin/file -L $add 2> /dev/null | $EGREP ": [^:]* bundle" >/dev/null ; 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 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; then add="$dir/$linklib" elif test "$hardcode_minus_L" = yes; then add_dir="-L$dir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) add_dir="$add_dir -L$inst_prefix_dir$libdir" ;; esac fi add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then add_shlibpath="$dir" add="-l$name" else lib_linked=no fi ;; *) lib_linked=no ;; esac if test "$lib_linked" != yes; then $echo "$modename: configuration error: unsupported hardcode properties" exit $EXIT_FAILURE fi if test -n "$add_shlibpath"; then case :$compile_shlibpath: in *":$add_shlibpath:"*) ;; *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;; esac fi if test "$linkmode" = prog; then test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" test -n "$add" && compile_deplibs="$add $compile_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" if test "$hardcode_direct" != yes && \ test "$hardcode_minus_L" != yes && \ test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; esac fi fi fi if test "$linkmode" = prog || test "$mode" = relink; then add_shlibpath= add_dir= add= # Finalize command for both is simple: just hardcode it. if test "$hardcode_direct" = yes; then add="$libdir/$linklib" elif test "$hardcode_minus_L" = yes; then add_dir="-L$libdir" add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; esac add="-l$name" elif test "$hardcode_automatic" = yes; then if test -n "$inst_prefix_dir" && test -f "$inst_prefix_dir$libdir/$linklib" ; then add="$inst_prefix_dir$libdir/$linklib" else add="$libdir/$linklib" fi else # We cannot seem to hardcode it, guess we'll fake it. add_dir="-L$libdir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) add_dir="$add_dir -L$inst_prefix_dir$libdir" ;; esac fi add="-l$name" fi if test "$linkmode" = prog; then test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" test -n "$add" && finalize_deplibs="$add $finalize_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" fi fi elif test "$linkmode" = prog; then # Here we assume that one of hardcode_direct or hardcode_minus_L # is not unsupported. This is valid on all known static and # shared platforms. if test "$hardcode_direct" != unsupported; then test -n "$old_library" && linklib="$old_library" compile_deplibs="$dir/$linklib $compile_deplibs" finalize_deplibs="$dir/$linklib $finalize_deplibs" else compile_deplibs="-l$name -L$dir $compile_deplibs" finalize_deplibs="-l$name -L$dir $finalize_deplibs" fi elif test "$build_libtool_libs" = yes; then # Not a shared library if test "$deplibs_check_method" != pass_all; then # We're trying link a shared library against a static one # but the system doesn't support it. # Just print a warning and add the library to dependency_libs so # that the program can be linked against the static library. $echo $echo "*** Warning: This system can not link to static lib archive $lib." $echo "*** I have the capability to make that library automatically link in when" $echo "*** you link to this library. But I can only do this if you have a" $echo "*** shared version of the library, which you do not appear to have." if test "$module" = yes; then $echo "*** But as you try to build a module library, libtool will still create " $echo "*** a static module, that should work as long as the dlopening application" $echo "*** is linked with the -dlopen flag to resolve symbols at runtime." if test -z "$global_symbol_pipe"; then $echo $echo "*** However, this would only work if libtool was able to extract symbol" $echo "*** lists from a program, using \`nm' or equivalent, but libtool could" $echo "*** not find such a program. So, this module is probably useless." $echo "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi else deplibs="$dir/$old_library $deplibs" link_static=yes fi fi # link shared/static library? if test "$linkmode" = lib; then if test -n "$dependency_libs" && { test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes || test "$link_static" = yes; }; then # Extract -R from dependency_libs temp_deplibs= for libdir in $dependency_libs; do case $libdir in -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'` case " $xrpath " in *" $temp_xrpath "*) ;; *) xrpath="$xrpath $temp_xrpath";; esac;; *) temp_deplibs="$temp_deplibs $libdir";; esac done dependency_libs="$temp_deplibs" fi newlib_search_path="$newlib_search_path $absdir" # Link against this library test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" # ... and its dependency_libs tmp_libs= for deplib in $dependency_libs; do newdependency_libs="$deplib $newdependency_libs" if test "X$duplicate_deps" = "Xyes" ; then case "$tmp_libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi tmp_libs="$tmp_libs $deplib" done if test "$link_all_deplibs" != no; then # Add the search paths of all dependency libraries for deplib in $dependency_libs; do case $deplib in -L*) path="$deplib" ;; *.la) dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'` test "X$dir" = "X$deplib" && dir="." # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; *) absdir=`cd "$dir" && pwd` if test -z "$absdir"; then $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2 absdir="$dir" fi ;; esac if grep "^installed=no" $deplib > /dev/null; then path="$absdir/$objdir" else eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` if test -z "$libdir"; then $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 exit $EXIT_FAILURE fi if test "$absdir" != "$libdir"; then $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2 fi path="$absdir" fi depdepl= case $host in *-*-darwin*) # we do not want to link against static libs, # but need to link against shared 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 "$path/$depdepl" ; then depdepl="$path/$depdepl" fi # do not add paths which are already there case " $newlib_search_path " in *" $path "*) ;; *) newlib_search_path="$newlib_search_path $path";; esac fi path="" ;; *) path="-L$path" ;; esac ;; -l*) case $host in *-*-darwin*) # Again, we only want to link against shared libraries eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"` for tmp in $newlib_search_path ; do if test -f "$tmp/lib$tmp_libs.dylib" ; then eval depdepl="$tmp/lib$tmp_libs.dylib" break fi done path="" ;; *) continue ;; esac ;; *) continue ;; esac case " $deplibs " in *" $path "*) ;; *) deplibs="$path $deplibs" ;; esac case " $deplibs " in *" $depdepl "*) ;; *) deplibs="$depdepl $deplibs" ;; esac done fi # link_all_deplibs != no fi # linkmode = lib done # for deplib in $libs dependency_libs="$newdependency_libs" if test "$pass" = dlpreopen; then # Link the dlpreopened libraries before other libraries for deplib in $save_deplibs; do deplibs="$deplib $deplibs" done fi if test "$pass" != dlopen; then if test "$pass" != conv; then # Make sure lib_search_path contains only unique directories. lib_search_path= for dir in $newlib_search_path; do case "$lib_search_path " in *" $dir "*) ;; *) lib_search_path="$lib_search_path $dir" ;; esac done newlib_search_path= fi if test "$linkmode,$pass" != "prog,link"; then vars="deplibs" else vars="compile_deplibs finalize_deplibs" fi for var in $vars dependency_libs; do # Add libraries to $var in reverse order eval tmp_libs=\"\$$var\" new_libs= for deplib in $tmp_libs; do # FIXME: Pedantically, this is the right thing to do, so # that some nasty dependency loop isn't accidentally # broken: #new_libs="$deplib $new_libs" # Pragmatically, this seems to cause very few problems in # practice: case $deplib in -L*) new_libs="$deplib $new_libs" ;; -R*) ;; *) # And here is the reason: when a library appears more # than once as an explicit dependence of a library, or # is implicitly linked in more than once by the # compiler, it is considered special, and multiple # occurrences thereof are not removed. Compare this # with having the same library being listed as a # dependency of multiple other libraries: in this case, # we know (pedantically, we assume) the library does not # need to be listed more than once, so we keep only the # last copy. This is not always right, but it is rare # enough that we require users that really mean to play # such unportable linking tricks to link the library # using -Wl,-lname, so that libtool does not consider it # for duplicate removal. case " $specialdeplibs " in *" $deplib "*) new_libs="$deplib $new_libs" ;; *) case " $new_libs " in *" $deplib "*) ;; *) new_libs="$deplib $new_libs" ;; esac ;; esac ;; esac done tmp_libs= for deplib in $new_libs; do case $deplib in -L*) case " $tmp_libs " in *" $deplib "*) ;; *) tmp_libs="$tmp_libs $deplib" ;; esac ;; *) tmp_libs="$tmp_libs $deplib" ;; esac done eval $var=\"$tmp_libs\" done # for var fi # Last step: remove runtime libs from dependency_libs # (they stay in deplibs) tmp_libs= for i in $dependency_libs ; do case " $predeps $postdeps $compiler_lib_search_path " in *" $i "*) i="" ;; esac if test -n "$i" ; then tmp_libs="$tmp_libs $i" fi done dependency_libs=$tmp_libs done # for pass if test "$linkmode" = prog; then dlfiles="$newdlfiles" dlprefiles="$newdlprefiles" fi case $linkmode in oldlib) if test -n "$deplibs"; then $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2 fi if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2 fi if test -n "$rpath"; then $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2 fi if test -n "$xrpath"; then $echo "$modename: warning: \`-R' is ignored for archives" 1>&2 fi if test -n "$vinfo"; then $echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2 fi if test -n "$release"; then $echo "$modename: warning: \`-release' is ignored for archives" 1>&2 fi if test -n "$export_symbols" || test -n "$export_symbols_regex"; then $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2 fi # Now set the variables for building old libraries. build_libtool_libs=no oldlibs="$output" objs="$objs$old_deplibs" ;; lib) # Make sure we only generate libraries of the form `libNAME.la'. case $outputname in lib*) name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" ;; *) if test "$module" = no; then $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi if test "$need_lib_prefix" != no; then # Add the "lib" prefix for modules if required name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" else libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` fi ;; esac if test -n "$objs"; then if test "$deplibs_check_method" != pass_all; then $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1 exit $EXIT_FAILURE else $echo $echo "*** Warning: Linking the shared library $output against the non-libtool" $echo "*** objects $objs is not portable!" libobjs="$libobjs $objs" fi fi if test "$dlself" != no; then $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2 fi set dummy $rpath if test "$#" -gt 2; then $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2 fi install_libdir="$2" 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 if test -n "$vinfo"; then $echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2 fi if test -n "$release"; then $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2 fi else # Parse the version information argument. save_ifs="$IFS"; IFS=':' set dummy $vinfo 0 0 0 IFS="$save_ifs" if test -n "$8"; then $echo "$modename: too many parameters to \`-version-info'" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi # 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="$2" number_minor="$3" number_revision="$4" # # There are really only two kinds -- those that # use the current revision as the major version # and those that subtract age and use age as # a minor version. But, then there is irix # which has an extra 1 added just for fun # case $version_type in darwin|linux|osf|windows) current=`expr $number_major + $number_minor` age="$number_minor" revision="$number_revision" ;; freebsd-aout|freebsd-elf|sunos) current="$number_major" revision="$number_minor" age="0" ;; irix|nonstopux) current=`expr $number_major + $number_minor - 1` age="$number_minor" revision="$number_minor" ;; esac ;; no) current="$2" revision="$3" age="$4" ;; 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]) ;; *) $echo "$modename: CURRENT \`$current' must be a nonnegative integer" 1>&2 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 exit $EXIT_FAILURE ;; 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]) ;; *) $echo "$modename: REVISION \`$revision' must be a nonnegative integer" 1>&2 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 exit $EXIT_FAILURE ;; 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]) ;; *) $echo "$modename: AGE \`$age' must be a nonnegative integer" 1>&2 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 exit $EXIT_FAILURE ;; esac if test "$age" -gt "$current"; then $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 exit $EXIT_FAILURE 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 major=.`expr $current - $age` versuffix="$major.$age.$revision" # Darwin ld doesn't like 0 for these options... minor_current=`expr $current + 1` verstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision" ;; freebsd-aout) major=".$current" versuffix=".$current.$revision"; ;; freebsd-elf) major=".$current" versuffix=".$current"; ;; irix | nonstopux) major=`expr $current - $age + 1` 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 iface=`expr $revision - $loop` loop=`expr $loop - 1` verstring="$verstring_prefix$major.$iface:$verstring" done # Before this point, $major must not contain `.'. major=.$major versuffix="$major.$revision" ;; linux) major=.`expr $current - $age` versuffix="$major.$age.$revision" ;; osf) major=.`expr $current - $age` 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 iface=`expr $current - $loop` loop=`expr $loop - 1` verstring="$verstring:${iface}.0" done # Make executables depend on our current version. verstring="$verstring:${current}.0" ;; sunos) major=".$current" versuffix=".$current.$revision" ;; windows) # Use '-' rather than '.', since we only want one # extension on DOS 8.3 filesystems. major=`expr $current - $age` versuffix="-$major" ;; *) $echo "$modename: unknown library version type \`$version_type'" 1>&2 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 exit $EXIT_FAILURE ;; 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 $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2 build_libtool_libs=no build_old_libs=yes fi else # Don't allow undefined symbols. allow_undefined_flag="$no_undefined_flag" fi fi if test "$mode" != relink; then # Remove our outputs, but don't remove object files since they # may have been created when compiling PIC objects. removelist= tempremovelist=`$echo "$output_objdir/*"` for p in $tempremovelist; do case $p in *.$objext) ;; $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) if test "X$precious_files_regex" != "X"; then if echo $p | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 then continue fi fi removelist="$removelist $p" ;; *) ;; esac done if test -n "$removelist"; then $show "${rm}r $removelist" $run ${rm}r $removelist fi fi # Now set the variables for building old libraries. if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then oldlibs="$oldlibs $output_objdir/$libname.$libext" # Transform .lo files to .o files. oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP` fi # Eliminate all temporary directories. for path in $notinst_path; do lib_search_path=`$echo "$lib_search_path " | ${SED} -e "s% $path % %g"` deplibs=`$echo "$deplibs " | ${SED} -e "s% -L$path % %g"` dependency_libs=`$echo "$dependency_libs " | ${SED} -e "s% -L$path % %g"` done if test -n "$xrpath"; then # If the user specified any rpath flags, then add them. temp_xrpath= for libdir in $xrpath; do temp_xrpath="$temp_xrpath -R$libdir" case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" ;; esac done if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then dependency_libs="$temp_xrpath $dependency_libs" fi fi # Make sure dlfiles contains only unique files that won't be dlpreopened old_dlfiles="$dlfiles" dlfiles= for lib in $old_dlfiles; do case " $dlprefiles $dlfiles " in *" $lib "*) ;; *) dlfiles="$dlfiles $lib" ;; esac done # Make sure dlprefiles contains only unique files old_dlprefiles="$dlprefiles" dlprefiles= for lib in $old_dlprefiles; do case "$dlprefiles " in *" $lib "*) ;; *) dlprefiles="$dlprefiles $lib" ;; esac done if test "$build_libtool_libs" = yes; then if test -n "$rpath"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*) # these systems don't actually have a c library (as such)! ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C library is in the System framework deplibs="$deplibs -framework System" ;; *-*-netbsd*) # Don't link with libc until the a.out ld.so is fixed. ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc due to us having libc/libc_r. ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work ;; *) # Add libc to deplibs on all other systems if necessary. if test "$build_libtool_need_lc" = "yes"; then deplibs="$deplibs -lc" fi ;; esac fi # Transform deplibs into only deplibs that can be linked in shared. name_save=$name libname_save=$libname release_save=$release versuffix_save=$versuffix major_save=$major # I'm not sure if I'm treating the release correctly. I think # release should show up in the -l (ie -lgmp5) so we don't want to # add it in twice. Is that correct? release="" versuffix="" major="" newdeplibs= droppeddeps=no case $deplibs_check_method in pass_all) # Don't check for shared/static. Everything works. # This might be a little naive. We might want to check # whether the library exists or not. But this is on # osf3 & osf4 and I'm not really sure... Just # implementing what was already the behavior. newdeplibs=$deplibs ;; test_compile) # This code stresses the "libraries are programs" paradigm to its # limits. Maybe even breaks it. We compile a program, linking it # against the deplibs as a proxy for the library. Then we can check # whether they linked in statically or dynamically with ldd. $rm conftest.c cat > conftest.c </dev/null` for potent_lib in $potential_libs; do # Follow soft links. if ls -lLd "$potent_lib" 2>/dev/null \ | grep " -> " >/dev/null; then continue fi # The statement above tries to avoid entering an # endless loop below, in case of cyclic links. # We might still enter an endless loop, since a link # loop can be closed while we follow links, # but so what? potlib="$potent_lib" while test -h "$potlib" 2>/dev/null; do potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'` case $potliblink in [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";; esac done if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \ | ${SED} 10q \ | $EGREP "$file_magic_regex" > /dev/null; then newdeplibs="$newdeplibs $a_deplib" a_deplib="" break 2 fi done done fi if test -n "$a_deplib" ; then droppeddeps=yes $echo $echo "*** Warning: linker path does not have real file for library $a_deplib." $echo "*** I have the capability to make that library automatically link in when" $echo "*** you link to this library. But I can only do this if you have a" $echo "*** shared version of the library, which you do not appear to have" $echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then $echo "*** with $libname but no candidates were found. (...for file magic test)" else $echo "*** with $libname and none of the candidates passed a file format test" $echo "*** using a file magic. Last file checked: $potlib" fi fi else # Add a -L argument. newdeplibs="$newdeplibs $a_deplib" fi done # Gone through all deplibs. ;; match_pattern*) set dummy $deplibs_check_method match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` for a_deplib in $deplibs; do name=`expr $a_deplib : '-l\(.*\)'` # If $name is empty we are operating on a -L argument. if test -n "$name" && test "$name" != "0"; then if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $a_deplib "*) newdeplibs="$newdeplibs $a_deplib" a_deplib="" ;; esac fi if test -n "$a_deplib" ; then libname=`eval \\$echo \"$libname_spec\"` for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do potential_libs=`ls $i/$libname[.-]* 2>/dev/null` for potent_lib in $potential_libs; do potlib="$potent_lib" # see symlink-check above in file_magic test if eval $echo \"$potent_lib\" 2>/dev/null \ | ${SED} 10q \ | $EGREP "$match_pattern_regex" > /dev/null; then newdeplibs="$newdeplibs $a_deplib" a_deplib="" break 2 fi done done fi if test -n "$a_deplib" ; then droppeddeps=yes $echo $echo "*** Warning: linker path does not have real file for library $a_deplib." $echo "*** I have the capability to make that library automatically link in when" $echo "*** you link to this library. But I can only do this if you have a" $echo "*** shared version of the library, which you do not appear to have" $echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then $echo "*** with $libname but no candidates were found. (...for regex pattern test)" else $echo "*** with $libname and none of the candidates passed a file format test" $echo "*** using a regex pattern. Last file checked: $potlib" fi fi else # Add a -L argument. newdeplibs="$newdeplibs $a_deplib" fi done # Gone through all deplibs. ;; none | unknown | *) newdeplibs="" tmp_deplibs=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \ -e 's/ -[LR][^ ]*//g'` if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then for i in $predeps $postdeps ; do # can't use Xsed below, because $i might contain '/' tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"` done fi if $echo "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' \ | grep . >/dev/null; then $echo if test "X$deplibs_check_method" = "Xnone"; then $echo "*** Warning: inter-library dependencies are not supported in this platform." else $echo "*** Warning: inter-library dependencies are not known to be supported." fi $echo "*** All declared inter-library dependencies are being dropped." droppeddeps=yes fi ;; esac versuffix=$versuffix_save major=$major_save release=$release_save libname=$libname_save name=$name_save case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library is the System framework newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'` ;; 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 # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $deplibs " in *" -L$path/$objdir "*) new_libs="$new_libs -L$path/$objdir" ;; esac ;; esac done for deplib in $deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) new_libs="$new_libs $deplib" ;; esac ;; *) new_libs="$new_libs $deplib" ;; esac done deplibs="$new_libs" # All the library-specific variables (install_libdir is set above). library_names= old_library= dlname= # Test again, we may have decided not to build it any more if test "$build_libtool_libs" = yes; then if test "$hardcode_into_libs" = yes; then # Hardcode the library paths hardcode_libdirs= dep_rpath= rpath="$finalize_rpath" test "$mode" != relink && rpath="$compile_rpath$rpath" for libdir in $rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" dep_rpath="$dep_rpath $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) perm_rpath="$perm_rpath $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" if test -n "$hardcode_libdir_flag_spec_ld"; then eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\" else eval dep_rpath=\"$hardcode_libdir_flag_spec\" fi fi if test -n "$runpath_var" && test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do rpath="$rpath$dir:" done eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" fi test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" fi shlibpath="$finalize_shlibpath" test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath" if test -n "$shlibpath"; then eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" fi # Get the real and link names of the library. eval shared_ext=\"$shrext_cmds\" eval library_names=\"$library_names_spec\" set dummy $library_names realname="$2" shift; shift if test -n "$soname_spec"; then eval soname=\"$soname_spec\" else soname="$realname" fi if test -z "$dlname"; then dlname=$soname fi lib="$output_objdir/$realname" linknames= for link do linknames="$linknames $link" done # Use standard objects if they are pic test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` # Prepare the list of exported symbols if test -z "$export_symbols"; then if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then $show "generating symbol list for \`$libname.la'" export_symbols="$output_objdir/$libname.exp" $run $rm $export_symbols cmds=$export_symbols_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" if len=`expr "X$cmd" : ".*"` && test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then $show "$cmd" $run eval "$cmd" || exit $? skipped_export=false else # The command line is too long to execute in one step. $show "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"; then $show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\"" $run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' $show "$mv \"${export_symbols}T\" \"$export_symbols\"" $run eval '$mv "${export_symbols}T" "$export_symbols"' fi fi fi if test -n "$export_symbols" && test -n "$include_expsyms"; then $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"' fi tmp_deplibs= for test_deplib in $deplibs; do case " $convenience " in *" $test_deplib "*) ;; *) tmp_deplibs="$tmp_deplibs $test_deplib" ;; esac done deplibs="$tmp_deplibs" if test -n "$convenience"; then if test -n "$whole_archive_flag_spec"; then save_libobjs=$libobjs eval libobjs=\"\$libobjs $whole_archive_flag_spec\" else gentop="$output_objdir/${outputname}x" generated="$generated $gentop" func_extract_archives $gentop $convenience libobjs="$libobjs $func_extract_archives_result" fi fi if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then eval flag=\"$thread_safe_flag_spec\" linker_flags="$linker_flags $flag" fi # Make a backup of the uninstalled library when relinking if test "$mode" = relink; then $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:" && len=`expr "X$test_cmds" : ".*" 2>/dev/null` && test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then : else # The command line is too long to link in one step, link piecewise. $echo "creating reloadable object files..." # Save the value of $output and $libobjs because we want to # use them later. If we have whole_archive_flag_spec, we # want to use save_libobjs as it was before # whole_archive_flag_spec was expanded, because we can't # assume the linker understands whole_archive_flag_spec. # This may have to be revisited, in case too many # convenience libraries get linked in and end up exceeding # the spec. if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then save_libobjs=$libobjs fi save_output=$output output_la=`$echo "X$output" | $Xsed -e "$basename"` # Clear the reloadable object creation command queue and # initialize k to one. test_cmds= concat_cmds= objlist= delfiles= last_robj= k=1 output=$output_objdir/$output_la-${k}.$objext # Loop over the list of objects to be linked. for obj in $save_libobjs do eval test_cmds=\"$reload_cmds $objlist $last_robj\" if test "X$objlist" = X || { len=`expr "X$test_cmds" : ".*" 2>/dev/null` && test "$len" -le "$max_cmd_len"; }; then objlist="$objlist $obj" else # The command $test_cmds is almost too long, add a # command to the queue. if test "$k" -eq 1 ; then # The first file doesn't have a previous command to add. eval concat_cmds=\"$reload_cmds $objlist $last_robj\" else # All subsequent reloadable object files will link in # the last one created. eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\" fi last_robj=$output_objdir/$output_la-${k}.$objext k=`expr $k + 1` output=$output_objdir/$output_la-${k}.$objext objlist=$obj len=1 fi done # Handle the remaining objects by creating one last # reloadable object file. All subsequent reloadable object # files will link in the last one created. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\" if ${skipped_export-false}; then $show "generating symbol list for \`$libname.la'" export_symbols="$output_objdir/$libname.exp" $run $rm $export_symbols libobjs=$output # Append the command to create the export file. eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\" fi # Set up a command to remove the reloadable object files # after they are used. i=0 while test "$i" -lt "$k" do i=`expr $i + 1` delfiles="$delfiles $output_objdir/$output_la-${i}.$objext" done $echo "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" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" 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\" 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 # Append the command to remove the reloadable object files # to the just-reset $cmds. eval cmds=\"\$cmds~\$rm $delfiles\" fi save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test "$mode" = relink; then $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)' fi exit $lt_exit } done IFS="$save_ifs" # Restore the uninstalled library and exit if test "$mode" = relink; then $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 $show "${rm}r $gentop" $run ${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 $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)" $run 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 "$deplibs"; then $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2 fi if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2 fi if test -n "$rpath"; then $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2 fi if test -n "$xrpath"; then $echo "$modename: warning: \`-R' is ignored for objects" 1>&2 fi if test -n "$vinfo"; then $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2 fi if test -n "$release"; then $echo "$modename: warning: \`-release' is ignored for objects" 1>&2 fi case $output in *.lo) if test -n "$objs$old_deplibs"; then $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2 exit $EXIT_FAILURE fi libobj="$output" obj=`$echo "X$output" | $Xsed -e "$lo2o"` ;; *) libobj= obj="$output" ;; esac # Delete the old objects. $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 wl= if test -n "$convenience"; then if test -n "$whole_archive_flag_spec"; then eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\" else gentop="$output_objdir/${obj}x" generated="$generated $gentop" func_extract_archives $gentop $convenience reload_conv_objs="$reload_objs $func_extract_archives_result" fi fi # Create the old-style object. reload_objs="$objs$old_deplibs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test output="$obj" cmds=$reload_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" # Exit if we aren't doing a library object file. if test -z "$libobj"; then if test -n "$gentop"; then $show "${rm}r $gentop" $run ${rm}r $gentop fi exit $EXIT_SUCCESS fi if test "$build_libtool_libs" != yes; then if test -n "$gentop"; then $show "${rm}r $gentop" $run ${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" # $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" cmds=$reload_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" fi if test -n "$gentop"; then $show "${rm}r $gentop" $run ${rm}r $gentop fi exit $EXIT_SUCCESS ;; prog) case $host in *cygwin*) output=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;; esac if test -n "$vinfo"; then $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2 fi if test -n "$release"; then $echo "$modename: warning: \`-release' is ignored for programs" 1>&2 fi if test "$preload" = yes; then if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown && test "$dlopen_self_static" = unknown; then $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support." fi fi case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library is the System framework compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'` finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'` ;; esac case $host in *darwin*) # Don't allow lazy linking, it breaks C++ global constructors if test "$tagname" = CXX ; then compile_command="$compile_command ${wl}-bind_at_load" finalize_command="$finalize_command ${wl}-bind_at_load" fi ;; esac # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $compile_deplibs " in *" -L$path/$objdir "*) new_libs="$new_libs -L$path/$objdir" ;; esac ;; esac done for deplib in $compile_deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) new_libs="$new_libs $deplib" ;; esac ;; *) new_libs="$new_libs $deplib" ;; esac done compile_deplibs="$new_libs" compile_command="$compile_command $compile_deplibs" finalize_command="$finalize_command $finalize_deplibs" if test -n "$rpath$xrpath"; then # If the user specified any rpath flags, then add them. for libdir in $rpath $xrpath; do # This is the magic to use -rpath. case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" ;; esac done fi # Now hardcode the library paths rpath= hardcode_libdirs= for libdir in $compile_rpath $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" rpath="$rpath $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) perm_rpath="$perm_rpath $libdir" ;; esac fi case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) testbindir=`$echo "X$libdir" | $Xsed -e 's*/lib$*/bin*'` case :$dllsearchpath: in *":$libdir:"*) ;; *) dllsearchpath="$dllsearchpath:$libdir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; *) dllsearchpath="$dllsearchpath:$testbindir";; esac ;; esac done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi compile_rpath="$rpath" rpath= hardcode_libdirs= for libdir in $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" rpath="$rpath $flag" fi elif test -n "$runpath_var"; then case "$finalize_perm_rpath " in *" $libdir "*) ;; *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi finalize_rpath="$rpath" if test -n "$libobjs" && test "$build_old_libs" = yes; then # Transform all the library objects into standard objects. compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` fi dlsyms= if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then if test -n "$NM" && test -n "$global_symbol_pipe"; then dlsyms="${outputname}S.c" else $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2 fi fi if test -n "$dlsyms"; then case $dlsyms in "") ;; *.c) # Discover the nlist of each of the dlfiles. nlist="$output_objdir/${outputname}.nm" $show "$rm $nlist ${nlist}S ${nlist}T" $run $rm "$nlist" "${nlist}S" "${nlist}T" # Parse the name list into a source file. $show "creating $output_objdir/$dlsyms" test -z "$run" && $echo > "$output_objdir/$dlsyms" "\ /* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */ /* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */ #ifdef __cplusplus extern \"C\" { #endif /* Prevent the only kind of declaration conflicts we can make. */ #define lt_preloaded_symbols some_other_symbol /* External symbol declarations for the compiler. */\ " if test "$dlself" = yes; then $show "generating symbol list for \`$output'" test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist" # Add our own program objects to the symbol list. progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` for arg in $progfiles; do $show "extracting global C symbols from \`$arg'" $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" done if test -n "$exclude_expsyms"; then $run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' $run eval '$mv "$nlist"T "$nlist"' fi if test -n "$export_symbols_regex"; then $run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' $run eval '$mv "$nlist"T "$nlist"' fi # Prepare the list of exported symbols if test -z "$export_symbols"; then export_symbols="$output_objdir/$outputname.exp" $run $rm $export_symbols $run eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' case $host in *cygwin* | *mingw* ) $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' $run eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' ;; esac else $run eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' $run eval 'grep -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' $run eval 'mv "$nlist"T "$nlist"' case $host in *cygwin* | *mingw* ) $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' $run eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' ;; esac fi fi for arg in $dlprefiles; do $show "extracting global C symbols from \`$arg'" name=`$echo "$arg" | ${SED} -e 's%^.*/%%'` $run eval '$echo ": $name " >> "$nlist"' $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" done if test -z "$run"; then # 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/$dlsyms"' else $echo '/* NONE */' >> "$output_objdir/$dlsyms" fi $echo >> "$output_objdir/$dlsyms" "\ #undef lt_preloaded_symbols #if defined (__STDC__) && __STDC__ # define lt_ptr void * #else # define lt_ptr char * # define const #endif /* The mapping between symbol names and symbols. */ " case $host in *cygwin* | *mingw* ) $echo >> "$output_objdir/$dlsyms" "\ /* DATA imports from DLLs on WIN32 can't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs */ struct { " ;; * ) $echo >> "$output_objdir/$dlsyms" "\ const struct { " ;; esac $echo >> "$output_objdir/$dlsyms" "\ const char *name; lt_ptr address; } lt_preloaded_symbols[] = {\ " eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms" $echo >> "$output_objdir/$dlsyms" "\ {0, (lt_ptr) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt_preloaded_symbols; } #endif #ifdef __cplusplus } #endif\ " fi pic_flag_for_symtable= 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*) case "$compile_command " in *" -static "*) ;; *) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND";; esac;; *-*-hpux*) case "$compile_command " in *" -static "*) ;; *) pic_flag_for_symtable=" $pic_flag";; esac esac # Now compile the dynamic symbol file. $show "(cd $output_objdir && $LTCC $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")" $run eval '(cd $output_objdir && $LTCC $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $? # Clean up the generated files. $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T" $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T" # Transform the symbol file into the correct name. case $host in *cygwin* | *mingw* ) if test -f "$output_objdir/${outputname}.def" ; then compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%"` finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%"` else compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` fi ;; * ) compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` ;; esac ;; *) $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2 exit $EXIT_FAILURE ;; esac else # We keep going just in case the user didn't refer to # lt_preloaded_symbols. The linker will fail if global_symbol_pipe # really was required. # Nullify the symbol file. compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"` finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"` fi if test "$need_relink" = no || test "$build_libtool_libs" != yes; then # Replace the output file specification. compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` link_command="$compile_command$compile_rpath" # We have no uninstalled library dependencies, so finalize right now. $show "$link_command" $run eval "$link_command" exit_status=$? # Delete the generated files. if test -n "$dlsyms"; then $show "$rm $output_objdir/${outputname}S.${objext}" $run $rm "$output_objdir/${outputname}S.${objext}" fi exit $exit_status fi if test -n "$shlibpath_var"; then # We should set the shlibpath_var rpath= for dir in $temp_rpath; do case $dir in [\\/]* | [A-Za-z]:[\\/]*) # Absolute path. rpath="$rpath$dir:" ;; *) # Relative path: add a thisdir entry. rpath="$rpath\$thisdir/$dir:" ;; esac done temp_rpath="$rpath" fi if test -n "$compile_shlibpath$finalize_shlibpath"; then compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" fi if test -n "$finalize_shlibpath"; then finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" fi compile_var= finalize_var= if test -n "$runpath_var"; then if test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do rpath="$rpath$dir:" done compile_var="$runpath_var=\"$rpath\$$runpath_var\" " fi if test -n "$finalize_perm_rpath"; then # We should set the runpath_var. rpath= for dir in $finalize_perm_rpath; do rpath="$rpath$dir:" done finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " fi fi if test "$no_install" = yes; then # We don't need to create a wrapper script. link_command="$compile_var$compile_command$compile_rpath" # Replace the output file specification. link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` # Delete the old output file. $run $rm $output # Link the executable and exit $show "$link_command" $run eval "$link_command" || exit $? exit $EXIT_SUCCESS fi if test "$hardcode_action" = relink; then # Fast installation is not supported link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2 $echo "$modename: \`$output' will be relinked during installation" 1>&2 else if test "$fast_install" != no; then link_command="$finalize_var$compile_command$finalize_rpath" if test "$fast_install" = yes; then relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'` else # fast_install is set to needless relink_command= fi else link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" fi fi # Replace the output file specification. link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` # Delete the old output files. $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname $show "$link_command" $run eval "$link_command" || exit $? # Now create the wrapper script. $show "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}\" || 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 var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"` relink_command="$var=\"$var_value\"; export $var; $relink_command" fi done relink_command="(cd `pwd`; $relink_command)" relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"` fi # Quote $echo for shipping. if test "X$echo" = "X$SHELL $progpath --fallback-echo"; then case $progpath in [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";; *) qecho="$SHELL `pwd`/$progpath --fallback-echo";; esac qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"` else qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"` fi # Only actually do things if our run command is non-null. if test -z "$run"; then # win32 will think the script is a binary if it has # a .exe suffix, so we strip it off here. case $output in *.exe) output=`$echo $output|${SED} 's,.exe$,,'` ;; esac # test for cygwin because mv fails w/o .exe extensions case $host in *cygwin*) exeext=.exe outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;; *) exeext= ;; esac case $host in *cygwin* | *mingw* ) output_name=`basename $output` output_path=`dirname $output` 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 cat > $cwrappersource <> $cwrappersource<<"EOF" #include #include #include #include #include #include #include #include #include #if defined(PATH_MAX) # define LT_PATHMAX PATH_MAX #elif defined(MAXPATHLEN) # define LT_PATHMAX MAXPATHLEN #else # define LT_PATHMAX 1024 #endif #ifndef DIR_SEPARATOR # define DIR_SEPARATOR '/' # define PATH_SEPARATOR ':' #endif #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ defined (__OS2__) # define HAVE_DOS_BASED_FILE_SYSTEM # 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 */ #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) #define XFREE(stale) do { \ if (stale) { free ((void *) stale); stale = 0; } \ } while (0) /* -DDEBUG is fairly common in CFLAGS. */ #undef DEBUG #if defined DEBUGWRAPPER # define DEBUG(format, ...) fprintf(stderr, format, __VA_ARGS__) #else # define DEBUG(format, ...) #endif const char *program_name = NULL; void * xmalloc (size_t num); char * xstrdup (const char *string); const char * base_name (const char *name); char * find_executable(const char *wrapper); int check_executable(const char *path); char * strendzap(char *str, const char *pat); void lt_fatal (const char *message, ...); int main (int argc, char *argv[]) { char **newargz; int i; program_name = (char *) xstrdup (base_name (argv[0])); DEBUG("(main) argv[0] : %s\n",argv[0]); DEBUG("(main) program_name : %s\n",program_name); newargz = XMALLOC(char *, argc+2); EOF cat >> $cwrappersource <> $cwrappersource <<"EOF" newargz[1] = find_executable(argv[0]); if (newargz[1] == NULL) lt_fatal("Couldn't find %s", argv[0]); DEBUG("(main) found exe at : %s\n",newargz[1]); /* we know the script has the same name, without the .exe */ /* so make sure newargz[1] doesn't end in .exe */ strendzap(newargz[1],".exe"); for (i = 1; i < argc; i++) newargz[i+1] = xstrdup(argv[i]); newargz[argc+1] = NULL; for (i=0; i> $cwrappersource <> $cwrappersource <> $cwrappersource <<"EOF" return 127; } void * xmalloc (size_t num) { void * p = (void *) malloc (num); if (!p) lt_fatal ("Memory exhausted"); return p; } char * xstrdup (const char *string) { return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL ; } const char * base_name (const char *name) { const char *base; #if defined (HAVE_DOS_BASED_FILE_SYSTEM) /* Skip over the disk name in MSDOS pathnames. */ if (isalpha ((unsigned char)name[0]) && name[1] == ':') name += 2; #endif for (base = name; *name; name++) if (IS_DIR_SEPARATOR (*name)) base = name + 1; return base; } int check_executable(const char * path) { struct stat st; DEBUG("(check_executable) : %s\n", path ? (*path ? path : "EMPTY!") : "NULL!"); if ((!path) || (!*path)) return 0; if ((stat (path, &st) >= 0) && ( /* MinGW & native WIN32 do not support S_IXOTH or S_IXGRP */ #if defined (S_IXOTH) ((st.st_mode & S_IXOTH) == S_IXOTH) || #endif #if defined (S_IXGRP) ((st.st_mode & S_IXGRP) == S_IXGRP) || #endif ((st.st_mode & S_IXUSR) == S_IXUSR)) ) return 1; else return 0; } /* Searches for the full path of the wrapper. Returns newly allocated full path name if found, NULL otherwise */ 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; DEBUG("(find_executable) : %s\n", wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!"); if ((wrapper == NULL) || (*wrapper == '\0')) return NULL; /* Absolute path? */ #if defined (HAVE_DOS_BASED_FILE_SYSTEM) if (isalpha ((unsigned char)wrapper[0]) && wrapper[1] == ':') { concat_name = xstrdup (wrapper); if (check_executable(concat_name)) return concat_name; XFREE(concat_name); } else { #endif if (IS_DIR_SEPARATOR (wrapper[0])) { concat_name = xstrdup (wrapper); if (check_executable(concat_name)) return concat_name; XFREE(concat_name); } #if defined (HAVE_DOS_BASED_FILE_SYSTEM) } #endif for (p = wrapper; *p; p++) if (*p == '/') { has_slash = 1; break; } if (!has_slash) { /* no slashes; search PATH */ const char* path = getenv ("PATH"); if (path != NULL) { for (p = path; *p; p = p_next) { const char* q; size_t p_len; for (q = p; *q; q++) if (IS_PATH_SEPARATOR(*q)) break; p_len = q - p; p_next = (*q == '\0' ? q : q + 1); if (p_len == 0) { /* empty path: current directory */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal ("getcwd failed"); tmp_len = strlen(tmp); concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); } else { concat_name = XMALLOC(char, p_len + 1 + strlen(wrapper) + 1); memcpy (concat_name, p, p_len); concat_name[p_len] = '/'; strcpy (concat_name + p_len + 1, wrapper); } if (check_executable(concat_name)) return concat_name; XFREE(concat_name); } } /* not found in PATH; assume curdir */ } /* Relative path | not found in path: prepend cwd */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal ("getcwd failed"); tmp_len = strlen(tmp); concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); if (check_executable(concat_name)) return concat_name; XFREE(concat_name); return NULL; } char * strendzap(char *str, const char *pat) { size_t len, patlen; assert(str != NULL); assert(pat != NULL); len = strlen(str); patlen = strlen(pat); if (patlen <= len) { str += len - patlen; if (strcmp(str, pat) == 0) *str = '\0'; } return str; } static void lt_error_core (int exit_status, const char * mode, const char * message, va_list ap) { fprintf (stderr, "%s: %s: ", program_name, mode); vfprintf (stderr, message, ap); fprintf (stderr, ".\n"); if (exit_status >= 0) exit (exit_status); } void lt_fatal (const char *message, ...) { va_list ap; va_start (ap, message); lt_error_core (EXIT_FAILURE, "FATAL", message, ap); va_end (ap); } EOF # we should really use a build-platform specific compiler # here, but OTOH, the wrappers (shell script and this C one) # are only useful if you want to execute the "real" binary. # Since the "real" binary is built for $host, then this # wrapper might as well be built for $host, too. $run $LTCC $LTCFLAGS -s -o $cwrapper $cwrappersource ;; esac $rm $output trap "$rm $output; exit $EXIT_FAILURE" 1 2 15 $echo > $output "\ #! $SHELL # $output - temporary wrapper script for $objdir/$outputname # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP # # The $output program cannot be directly executed until all the libtool # libraries that it depends on are installed. # # This wrapper script should never be moved out of the build directory. # If it is, it will not operate correctly. # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. Xsed='${SED} -e 1s/^X//' sed_quote_subst='$sed_quote_subst' # 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 variable: notinst_deplibs='$notinst_deplibs' else # When we are sourced in execute mode, \$file and \$echo are already set. if test \"\$libtool_execute_magic\" != \"$magic\"; then echo=\"$qecho\" file=\"\$0\" # Make sure echo works. if test \"X\$1\" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then # Yippee, \$echo works! : else # Restart under the correct shell, and then maybe \$echo will work. exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"} fi fi\ " $echo >> $output "\ # Find the directory that this script lives in. thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\` test \"x\$thisdir\" = \"x\$file\" && thisdir=. # Follow symbolic links until we get to the real thisdir. file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\` while test -n \"\$file\"; do destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\` # If there was a directory component, then change thisdir. if test \"x\$destdir\" != \"x\$file\"; then case \"\$destdir\" in [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; *) thisdir=\"\$thisdir/\$destdir\" ;; esac fi file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\` file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\` done # Try to get the absolute directory name. absdir=\`cd \"\$thisdir\" && pwd\` test -n \"\$absdir\" && thisdir=\"\$absdir\" " if test "$fast_install" = yes; then $echo >> $output "\ 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 >> $output "\ # 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 $EXIT_FAILURE fi fi $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || { $rm \"\$progdir/\$program\"; $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; } $rm \"\$progdir/\$file\" fi" else $echo >> $output "\ program='$outputname' progdir=\"\$thisdir/$objdir\" " fi $echo >> $output "\ if test -f \"\$progdir/\$program\"; then" # Export our shlibpath_var if we have one. if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then $echo >> $output "\ # Add our own library path to $shlibpath_var $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" # Some systems cannot cope with colon-terminated $shlibpath_var # The second colon is a workaround for a bug in BeOS R4 sed $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\` export $shlibpath_var " fi # fixup the dll searchpath if we need to. if test -n "$dllsearchpath"; then $echo >> $output "\ # Add the dll search path components to the executable PATH PATH=$dllsearchpath:\$PATH " fi $echo >> $output "\ if test \"\$libtool_execute_magic\" != \"$magic\"; then # Run the actual program with our arguments. " case $host in # Backslashes separate directories on plain windows *-*-mingw | *-*-os2*) $echo >> $output "\ exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} " ;; *) $echo >> $output "\ exec \"\$progdir/\$program\" \${1+\"\$@\"} " ;; esac $echo >> $output "\ \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\" exit $EXIT_FAILURE 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 $EXIT_FAILURE fi fi\ " chmod +x $output fi 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" 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" fi addlibs="$old_convenience" fi if test -n "$addlibs"; then gentop="$output_objdir/${outputname}x" generated="$generated $gentop" func_extract_archives $gentop $addlibs oldobjs="$oldobjs $func_extract_archives_result" fi # Do each command in the archive commands. if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then cmds=$old_archive_from_new_cmds else # 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 $echo "X$obj" | $Xsed -e 's%^.*/%%' done | sort | sort -uc >/dev/null 2>&1); then : else $echo "copying selected object files to avoid basename conflicts..." if test -z "$gentop"; then gentop="$output_objdir/${outputname}x" generated="$generated $gentop" $show "${rm}r $gentop" $run ${rm}r "$gentop" $show "$mkdir $gentop" $run $mkdir "$gentop" exit_status=$? if test "$exit_status" -ne 0 && test ! -d "$gentop"; then exit $exit_status fi fi save_oldobjs=$oldobjs oldobjs= counter=1 for obj in $save_oldobjs do objbase=`$echo "X$obj" | $Xsed -e 's%^.*/%%'` case " $oldobjs " in " ") oldobjs=$obj ;; *[\ /]"$objbase "*) while :; do # Make sure we don't pick an alternate name that also # overlaps. newobj=lt$counter-$objbase counter=`expr $counter + 1` case " $oldobjs " in *[\ /]"$newobj "*) ;; *) if test ! -f "$gentop/$newobj"; then break; fi ;; esac done $show "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" $run ln "$obj" "$gentop/$newobj" || $run cp "$obj" "$gentop/$newobj" oldobjs="$oldobjs $gentop/$newobj" ;; *) oldobjs="$oldobjs $obj" ;; esac done fi eval cmds=\"$old_archive_cmds\" if len=`expr "X$cmds" : ".*"` && test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then cmds=$old_archive_cmds else # the command line is too long to link in one step, link in parts $echo "using piecewise archive linking..." save_RANLIB=$RANLIB RANLIB=: objlist= concat_cmds= save_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 for obj in $save_oldobjs do oldobjs="$objlist $obj" objlist="$objlist $obj" eval test_cmds=\"$old_archive_cmds\" if len=`expr "X$test_cmds" : ".*" 2>/dev/null` && test "$len" -le "$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= 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 save_ifs="$IFS"; IFS='~' for cmd in $cmds; do eval cmd=\"$cmd\" IFS="$save_ifs" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" done if test -n "$generated"; then $show "${rm}r$generated" $run ${rm}r$generated fi # Now create the libtool archive. case $output in *.la) old_library= test "$build_old_libs" = yes && old_library="$libname.$libext" $show "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}\" || 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 var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"` relink_command="$var=\"$var_value\"; export $var; $relink_command" fi done # Quote the link command for shipping. relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"` if test "$hardcode_automatic" = yes ; then relink_command= fi # Only create the output if not a dry run. if test -z "$run"; then 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) name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'` eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` if test -z "$libdir"; then $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 exit $EXIT_FAILURE fi newdependency_libs="$newdependency_libs $libdir/$name" ;; *) newdependency_libs="$newdependency_libs $deplib" ;; esac done dependency_libs="$newdependency_libs" newdlfiles= for lib in $dlfiles; do name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` if test -z "$libdir"; then $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 exit $EXIT_FAILURE fi newdlfiles="$newdlfiles $libdir/$name" done dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` if test -z "$libdir"; then $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 exit $EXIT_FAILURE fi newdlprefiles="$newdlprefiles $libdir/$name" done dlprefiles="$newdlprefiles" else newdlfiles= for lib in $dlfiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac newdlfiles="$newdlfiles $abs" done dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac newdlprefiles="$newdlprefiles $abs" done dlprefiles="$newdlprefiles" fi $rm $output # place dlname in correct position for cygwin tdlname=$dlname case $host,$output,$installed,$module,$dlname in *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;; esac $echo > $output "\ # $outputname - a libtool library file # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP # # 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' # Libraries that this one depends upon. dependency_libs='$dependency_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 fi # Do a symbolic link so that the libtool archive can be found in # LD_LIBRARY_PATH before the program is installed. $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)" $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $? ;; esac exit $EXIT_SUCCESS ;; # libtool install mode install) modename="$modename: install" # There may be an optional sh(1) argument at the beginning of # install_prog (especially on Windows NT). if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || # Allow the use of GNU shtool's install command. $echo "X$nonopt" | grep shtool > /dev/null; then # Aesthetically quote it. arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"` case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac install_prog="$arg " arg="$1" shift else install_prog= arg=$nonopt fi # The real first argument should be the name of the installation program. # Aesthetically quote it. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac install_prog="$install_prog$arg" # We need to accept at least all the BSD install flags. dest= files= opts= prev= install_type= isdir=no stripme= for arg do if test -n "$dest"; then files="$files $dest" dest=$arg continue fi case $arg in -d) isdir=yes ;; -f) case " $install_prog " in *[\\\ /]cp\ *) ;; *) prev=$arg ;; esac ;; -g | -m | -o) prev=$arg ;; -s) stripme=" -s" continue ;; -*) ;; *) # If the previous option needed an argument, then skip it. if test -n "$prev"; then prev= else dest=$arg continue fi ;; esac # Aesthetically quote the argument. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac install_prog="$install_prog $arg" done if test -z "$install_prog"; then $echo "$modename: you must specify an install program" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi if test -n "$prev"; then $echo "$modename: the \`$prev' option requires an argument" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi if test -z "$files"; then if test -z "$dest"; then $echo "$modename: no file or destination specified" 1>&2 else $echo "$modename: you must specify a destination" 1>&2 fi $echo "$help" 1>&2 exit $EXIT_FAILURE fi # Strip any trailing slash from the destination. dest=`$echo "X$dest" | $Xsed -e 's%/$%%'` # Check to see that the destination is a directory. test -d "$dest" && isdir=yes if test "$isdir" = yes; then destdir="$dest" destname= else destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'` test "X$destdir" = "X$dest" && destdir=. destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'` # Not a directory, so check to see that there is only one file specified. set dummy $files if test "$#" -gt 2; then $echo "$modename: \`$dest' is not a directory" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi fi case $destdir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) for file in $files; do case $file in *.lo) ;; *) $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE ;; esac done ;; esac # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" staticlibs= future_libdirs= current_libdirs= for file in $files; do # Do each installation. case $file in *.$libext) # Do the static libraries later. staticlibs="$staticlibs $file" ;; *.la) # Check to see that this really is a libtool archive. if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : else $echo "$modename: \`$file' is not a valid libtool archive" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi library_names= old_library= relink_command= # If there is no directory component, then add one. case $file in */* | *\\*) . $file ;; *) . ./$file ;; esac # Add the libdir to current_libdirs if it is the destination. if test "X$destdir" = "X$libdir"; then case "$current_libdirs " in *" $libdir "*) ;; *) current_libdirs="$current_libdirs $libdir" ;; esac else # Note the libdir as a future libdir. case "$future_libdirs " in *" $libdir "*) ;; *) future_libdirs="$future_libdirs $libdir" ;; esac fi dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/ test "X$dir" = "X$file/" && dir= dir="$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 "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. if test "$inst_prefix_dir" = "$destdir"; then $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2 exit $EXIT_FAILURE fi 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 $echo "$modename: warning: relinking \`$file'" 1>&2 $show "$relink_command" if $run eval "$relink_command"; then : else $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 exit $EXIT_FAILURE fi fi # See the names of the shared library. set dummy $library_names if test -n "$2"; then realname="$2" shift shift srcname="$realname" test -n "$relink_command" && srcname="$realname"T # Install the shared library and build the symlinks. $show "$install_prog $dir/$srcname $destdir/$realname" $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $? if test -n "$stripme" && test -n "$striplib"; then $show "$striplib $destdir/$realname" $run 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 if test "$linkname" != "$realname"; then $show "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })" $run eval "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })" fi done fi # Do each command in the postinstall commands. lib="$destdir/$realname" cmds=$postinstall_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test "$mode" = relink; then $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)' fi exit $lt_exit } done IFS="$save_ifs" fi # Install the pseudo-library for information purposes. name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` instname="$dir/$name"i $show "$install_prog $instname $destdir/$name" $run eval "$install_prog $instname $destdir/$name" || exit $? # Maybe install the static library, too. test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library" ;; *.lo) # Install (i.e. copy) a libtool object. # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'` destfile="$destdir/$destfile" fi # Deduce the name of the destination old-style object file. case $destfile in *.lo) staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"` ;; *.$objext) staticdest="$destfile" destfile= ;; *) $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE ;; esac # Install the libtool object if requested. if test -n "$destfile"; then $show "$install_prog $file $destfile" $run eval "$install_prog $file $destfile" || exit $? fi # Install the old object if enabled. if test "$build_old_libs" = yes; then # Deduce the name of the old-style object file. staticobj=`$echo "X$file" | $Xsed -e "$lo2o"` $show "$install_prog $staticobj $staticdest" $run 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 destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'` 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 file=`$echo $file|${SED} 's,.exe$,,'` stripped_ext=".exe" fi ;; esac # Do a test to see if this is really a libtool program. case $host in *cygwin*|*mingw*) wrapper=`$echo $file | ${SED} -e 's,.exe$,,'` ;; *) wrapper=$file ;; esac if (${SED} -e '4q' $wrapper | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then notinst_deplibs= relink_command= # Note that it is not necessary on cygwin/mingw to append a dot to # foo even if both foo 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. # # If there is no directory component, then add one. case $wrapper in */* | *\\*) . ${wrapper} ;; *) . ./${wrapper} ;; esac # Check the variables that should have been set. if test -z "$notinst_deplibs"; then $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2 exit $EXIT_FAILURE fi finalize=yes for lib in $notinst_deplibs; do # Check to see that each library is installed. libdir= if test -f "$lib"; then # If there is no directory component, then add one. case $lib in */* | *\\*) . $lib ;; *) . ./$lib ;; esac fi libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test if test -n "$libdir" && test ! -f "$libfile"; then $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2 finalize=no fi done relink_command= # Note that it is not necessary on cygwin/mingw to append a dot to # foo even if both foo 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. # # If there is no directory component, then add one. case $wrapper in */* | *\\*) . ${wrapper} ;; *) . ./${wrapper} ;; esac outputname= if test "$fast_install" = no && test -n "$relink_command"; then if test "$finalize" = yes && test -z "$run"; then tmpdir=`func_mktempdir` file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'` outputname="$tmpdir/$file" # Replace the output file specification. relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'` $show "$relink_command" if $run eval "$relink_command"; then : else $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 ${rm}r "$tmpdir" continue fi file="$outputname" else $echo "$modename: warning: cannot relink \`$file'" 1>&2 fi else # Install the binary that we compiled earlier. file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"` fi fi # remove .exe since cygwin /usr/bin/install will append another # one anyway case $install_prog,$host in */usr/bin/install*,*cygwin*) case $file:$destfile in *.exe:*.exe) # this is ok ;; *.exe:*) destfile=$destfile.exe ;; *:*.exe) destfile=`$echo $destfile | ${SED} -e 's,.exe$,,'` ;; esac ;; esac $show "$install_prog$stripme $file $destfile" $run eval "$install_prog\$stripme \$file \$destfile" || exit $? test -n "$outputname" && ${rm}r "$tmpdir" ;; esac done for file in $staticlibs; do name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` # Set up the ranlib parameters. oldlib="$destdir/$name" $show "$install_prog $file $oldlib" $run eval "$install_prog \$file \$oldlib" || exit $? if test -n "$stripme" && test -n "$old_striplib"; then $show "$old_striplib $oldlib" $run eval "$old_striplib $oldlib" || exit $? fi # Do each command in the postinstall commands. cmds=$old_postinstall_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" done if test -n "$future_libdirs"; then $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2 fi if test -n "$current_libdirs"; then # Maybe just do a dry run. test -n "$run" && current_libdirs=" -n$current_libdirs" exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs' else exit $EXIT_SUCCESS fi ;; # libtool finish mode finish) modename="$modename: finish" libdirs="$nonopt" admincmds= if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then for dir do libdirs="$libdirs $dir" done for libdir in $libdirs; do if test -n "$finish_cmds"; then # Do each command in the finish commands. cmds=$finish_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || admincmds="$admincmds $cmd" done IFS="$save_ifs" fi if test -n "$finish_eval"; then # Do the single finish_eval. eval cmds=\"$finish_eval\" $run eval "$cmds" || admincmds="$admincmds $cmds" fi done fi # Exit here if they wanted silent mode. test "$show" = : && exit $EXIT_SUCCESS $echo "X----------------------------------------------------------------------" | $Xsed $echo "Libraries have been installed in:" for libdir in $libdirs; do $echo " $libdir" done $echo $echo "If you ever happen to want to link against installed libraries" $echo "in a given directory, LIBDIR, you must either use libtool, and" $echo "specify the full pathname of the library, or use the \`-LLIBDIR'" $echo "flag during linking and do at least one of the following:" if test -n "$shlibpath_var"; then $echo " - add LIBDIR to the \`$shlibpath_var' environment variable" $echo " during execution" fi if test -n "$runpath_var"; then $echo " - add LIBDIR to the \`$runpath_var' environment variable" $echo " during linking" fi if test -n "$hardcode_libdir_flag_spec"; then libdir=LIBDIR eval flag=\"$hardcode_libdir_flag_spec\" $echo " - use the \`$flag' linker flag" fi if test -n "$admincmds"; then $echo " - have your system administrator run these commands:$admincmds" fi if test -f /etc/ld.so.conf; then $echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" fi $echo $echo "See any operating system documentation about shared libraries for" $echo "more information, such as the ld(1) and ld.so(8) manual pages." $echo "X----------------------------------------------------------------------" | $Xsed exit $EXIT_SUCCESS ;; # libtool execute mode execute) modename="$modename: execute" # The first argument is the command name. cmd="$nonopt" if test -z "$cmd"; then $echo "$modename: you must specify a COMMAND" 1>&2 $echo "$help" exit $EXIT_FAILURE fi # Handle -dlopen flags immediately. for file in $execute_dlfiles; do if test ! -f "$file"; then $echo "$modename: \`$file' is not a file" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi dir= case $file in *.la) # Check to see that this really is a libtool archive. if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : else $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi # Read the libtool library. dlname= library_names= # If there is no directory component, then add one. case $file in */* | *\\*) . $file ;; *) . ./$file ;; esac # Skip this library if it cannot be dlopened. if test -z "$dlname"; then # Warn if it was a shared library. test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'" continue fi dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` test "X$dir" = "X$file" && dir=. if test -f "$dir/$objdir/$dlname"; then dir="$dir/$objdir" else $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2 exit $EXIT_FAILURE fi ;; *.lo) # Just add the directory containing the .lo file. dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` test "X$dir" = "X$file" && dir=. ;; *) $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2 continue ;; esac # Get the absolute pathname. absdir=`cd "$dir" && pwd` test -n "$absdir" && dir="$absdir" # Now add the directory to shlibpath_var. if eval "test -z \"\$$shlibpath_var\""; then eval "$shlibpath_var=\"\$dir\"" else eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" fi done # This variable tells wrapper scripts just to set shlibpath_var # rather than running their programs. libtool_execute_magic="$magic" # Check if any of the arguments is a wrapper script. args= for file do case $file in -*) ;; *) # Do a test to see if this is really a libtool program. if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then # If there is no directory component, then add one. case $file in */* | *\\*) . $file ;; *) . ./$file ;; esac # Transform arg to wrapped name. file="$progdir/$program" fi ;; esac # Quote arguments (to preserve shell metacharacters). file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"` args="$args \"$file\"" done if test -z "$run"; then if test -n "$shlibpath_var"; then # Export the shlibpath_var. eval "export $shlibpath_var" fi # Restore saved environment variables if test "${save_LC_ALL+set}" = set; then LC_ALL="$save_LC_ALL"; export LC_ALL fi if test "${save_LANG+set}" = set; then LANG="$save_LANG"; export LANG fi # 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 ;; # libtool clean and uninstall mode clean | uninstall) modename="$modename: $mode" rm="$nonopt" files= rmforce= exit_status=0 # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" for arg do case $arg in -f) rm="$rm $arg"; rmforce=yes ;; -*) rm="$rm $arg" ;; *) files="$files $arg" ;; esac done if test -z "$rm"; then $echo "$modename: you must specify an RM program" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi rmdirs= origobjdir="$objdir" for file in $files; do dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` if test "X$dir" = "X$file"; then dir=. objdir="$origobjdir" else objdir="$dir/$origobjdir" fi name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` test "$mode" = uninstall && objdir="$dir" # Remember objdir for removal later, being careful to avoid duplicates if test "$mode" = clean; then case " $rmdirs " in *" $objdir "*) ;; *) rmdirs="$rmdirs $objdir" ;; esac fi # Don't error if the file doesn't exist and rm -f was used. if (test -L "$file") >/dev/null 2>&1 \ || (test -h "$file") >/dev/null 2>&1 \ || test -f "$file"; then : elif test -d "$file"; then exit_status=1 continue elif test "$rmforce" = yes; then continue fi rmfiles="$file" case $name in *.la) # Possibly a libtool archive, so verify it. if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then . $dir/$name # Delete the libtool libraries and symlinks. for n in $library_names; do rmfiles="$rmfiles $objdir/$n" done test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library" case "$mode" in clean) case " $library_names " in # " " in the beginning catches empty $dlname *" $dlname "*) ;; *) rmfiles="$rmfiles $objdir/$dlname" ;; esac test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i" ;; uninstall) if test -n "$library_names"; then # Do each command in the postuninstall commands. cmds=$postuninstall_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" if test "$?" -ne 0 && test "$rmforce" != yes; then exit_status=1 fi done IFS="$save_ifs" fi if test -n "$old_library"; then # Do each command in the old_postuninstall commands. cmds=$old_postuninstall_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" if test "$?" -ne 0 && test "$rmforce" != yes; then exit_status=1 fi done IFS="$save_ifs" fi # FIXME: should reinstall the best remaining shared library. ;; esac fi ;; *.lo) # Possibly a libtool object, so verify it. if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then # Read the .lo file . $dir/$name # Add PIC object to the list of files to remove. if test -n "$pic_object" \ && test "$pic_object" != none; then rmfiles="$rmfiles $dir/$pic_object" fi # Add non-PIC object to the list of files to remove. if test -n "$non_pic_object" \ && test "$non_pic_object" != none; then rmfiles="$rmfiles $dir/$non_pic_object" fi fi ;; *) if test "$mode" = clean ; then noexename=$name case $file in *.exe) file=`$echo $file|${SED} 's,.exe$,,'` noexename=`$echo $name|${SED} 's,.exe$,,'` # $file with .exe has already been added to rmfiles, # add $file without .exe rmfiles="$rmfiles $file" ;; esac # Do a test to see if this is a libtool program. if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then relink_command= . $dir/$noexename # note $name still contains .exe if it was in $file originally # as does the version of $file that was added into $rmfiles rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}" if test "$fast_install" = yes && test -n "$relink_command"; then rmfiles="$rmfiles $objdir/lt-$name" fi if test "X$noexename" != "X$name" ; then rmfiles="$rmfiles $objdir/lt-${noexename}.c" fi fi fi ;; esac $show "$rm $rmfiles" $run $rm $rmfiles || exit_status=1 done objdir="$origobjdir" # Try to remove the ${objdir}s in the directories where we deleted files for dir in $rmdirs; do if test -d "$dir"; then $show "rmdir $dir" $run rmdir $dir >/dev/null 2>&1 fi done exit $exit_status ;; "") $echo "$modename: you must specify a MODE" 1>&2 $echo "$generic_help" 1>&2 exit $EXIT_FAILURE ;; esac if test -z "$exec_cmd"; then $echo "$modename: invalid operation mode \`$mode'" 1>&2 $echo "$generic_help" 1>&2 exit $EXIT_FAILURE fi fi # test -z "$show_help" if test -n "$exec_cmd"; then eval exec $exec_cmd exit $EXIT_FAILURE fi # We need to display help for each of the modes. case $mode in "") $echo \ "Usage: $modename [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 --finish same as \`--mode=finish' --help display this help message and exit --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS] --quiet same as \`--silent' --silent don't print informational messages --tag=TAG use configuration variables from tag TAG --version print version information MODE must be one of the following: clean remove files from the build directory compile compile a source file into a libtool object execute automatically set library path, then run a program finish complete the installation of libtool libraries install install libraries or executables link create a library or an executable uninstall remove libraries from an installed directory MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for a more detailed description of MODE. Report bugs to ." exit $EXIT_SUCCESS ;; clean) $echo \ "Usage: $modename [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: $modename [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 -prefer-pic try to building PIC objects only -prefer-non-pic try to building non-PIC objects only -static always build a \`.o' file suitable for static linking COMPILE-COMMAND is a command to be used in creating a \`standard' object file from the given SOURCEFILE. The output file name is determined by removing the directory component from SOURCEFILE, then substituting the C source code suffix \`.c' with the library object suffix, \`.lo'." ;; execute) $echo \ "Usage: $modename [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: $modename [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: $modename [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 rest of the components are interpreted as arguments to that command (only BSD-compatible install options are recognized)." ;; link) $echo \ "Usage: $modename [OPTION]... --mode=link LINK-COMMAND... Link object files or libraries together to form another library, or to create an executable program. LINK-COMMAND is a command using the C compiler that you would use to create a program from several object files. The following components of LINK-COMMAND are treated specially: -all-static do not do any dynamic linking at all -avoid-version do not add a version suffix if possible -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) -export-symbols SYMFILE try to export only the symbols listed in SYMFILE -export-symbols-regex REGEX try to export only the symbols matching REGEX -LLIBDIR search LIBDIR for required installed libraries -lNAME OUTPUT-FILE requires the installed library libNAME -module build a library that can dlopened -no-fast-install disable the fast-install mode -no-install link a not-installable executable -no-undefined declare that a library does not refer to external symbols -o OUTPUT-FILE create OUTPUT-FILE from the specified objects -objectlist FILE Use a list of object files found in FILE to specify objects -precious-files-regex REGEX don't remove output files matching REGEX -release RELEASE specify package release information -rpath LIBDIR the created library will eventually be installed in LIBDIR -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries -static do not do any dynamic linking of libtool libraries -version-info CURRENT[:REVISION[:AGE]] specify library version info [each variable defaults to 0] 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: $modename [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." ;; *) $echo "$modename: invalid operation mode \`$mode'" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE ;; esac $echo $echo "Try \`$modename --help' for more information about other modes." exit $? # 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 disable_libs=shared # ### END LIBTOOL TAG CONFIG: disable-shared # ### BEGIN LIBTOOL TAG CONFIG: disable-static disable_libs=static # ### END LIBTOOL TAG CONFIG: disable-static # Local Variables: # mode:shell-script # sh-indentation:2 # End: freeradius-server/libltdl/missing000077500000000000000000000245331257552170400175570ustar00rootroot00000000000000#! /bin/sh # Common stub for a few missing GNU programs while installing. scriptversion=2004-09-07.08 # Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004 # Free Software Foundation, Inc. # Originally by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. if test $# -eq 0; then echo 1>&2 "Try \`$0 --help' for more information" exit 1 fi run=: # In the cases where this matters, `missing' is being run in the # srcdir already. if test -f configure.ac; then configure_ac=configure.ac else configure_ac=configure.in fi msg="missing on your system" case "$1" in --run) # Try to run requested program, and just exit if it succeeds. run= shift "$@" && exit 0 # Exit code 63 means version mismatch. This often happens # when the user try to use an ancient version of a tool on # a file that requires a minimum version. In this case we # we should proceed has if the program had been absent, or # if --run hadn't been passed. if test $? = 63; then run=: msg="probably too old" fi ;; -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an error status if there is no known handling for PROGRAM. Options: -h, --help display this help and exit -v, --version output version information and exit --run try to run the given command, and emulate it if it fails Supported PROGRAM values: aclocal touch file \`aclocal.m4' autoconf touch file \`configure' autoheader touch file \`config.h.in' automake touch all \`Makefile.in' files bison create \`y.tab.[ch]', if possible, from existing .[ch] flex create \`lex.yy.c', if possible, from existing .c help2man touch the output file lex create \`lex.yy.c', if possible, from existing .c makeinfo touch the output file tar try tar, gnutar, gtar, then tar without non-portable flags yacc create \`y.tab.[ch]', if possible, from existing .[ch] Send bug reports to ." exit 0 ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing $scriptversion (GNU Automake)" exit 0 ;; -*) echo 1>&2 "$0: Unknown \`$1' option" echo 1>&2 "Try \`$0 --help' for more information" exit 1 ;; esac # Now exit if we have it, but it failed. Also exit now if we # don't have it and --version was passed (most likely to detect # the program). case "$1" in lex|yacc) # Not GNU programs, they don't have --version. ;; tar) if test -n "$run"; then echo 1>&2 "ERROR: \`tar' requires --run" exit 1 elif test "x$2" = "x--version" || test "x$2" = "x--help"; then exit 1 fi ;; *) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 elif test "x$2" = "x--version" || test "x$2" = "x--help"; then # Could not run --version or --help. This is probably someone # running `$TOOL --version' or `$TOOL --help' to check whether # $TOOL exists and not knowing $TOOL uses missing. exit 1 fi ;; esac # If it does not exist, or fails to run (possibly an outdated version), # try to emulate it. case "$1" in aclocal*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." touch aclocal.m4 ;; autoconf) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." touch configure ;; autoheader) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`acconfig.h' or \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` test -z "$files" && files="config.h" touch_files= for f in $files; do case "$f" in *:*) touch_files="$touch_files "`echo "$f" | sed -e 's/^[^:]*://' -e 's/:.*//'`;; *) touch_files="$touch_files $f.in";; esac done touch $touch_files ;; automake*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." find . -type f -name Makefile.am -print | sed 's/\.am$/.in/' | while read f; do touch "$f"; done ;; autom4te) echo 1>&2 "\ WARNING: \`$1' is needed, but is $msg. You might have modified some files without having the proper tools for further handling them. You can get \`$1' as part of \`Autoconf' from any GNU archive site." file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'` test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'` if test -f "$file"; then touch $file else test -z "$file" || exec >$file echo "#! /bin/sh" echo "# Created by GNU Automake missing as a replacement of" echo "# $ $@" echo "exit 0" chmod +x $file exit 1 fi ;; bison|yacc) echo 1>&2 "\ WARNING: \`$1' $msg. You should only need it if you modified a \`.y' file. You may need the \`Bison' package in order for those modifications to take effect. You can get \`Bison' from any GNU archive site." rm -f y.tab.c y.tab.h if [ $# -ne 1 ]; then eval LASTARG="\${$#}" case "$LASTARG" in *.y) SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" y.tab.c fi SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" y.tab.h fi ;; esac fi if [ ! -f y.tab.h ]; then echo >y.tab.h fi if [ ! -f y.tab.c ]; then echo 'main() { return 0; }' >y.tab.c fi ;; lex|flex) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a \`.l' file. You may need the \`Flex' package in order for those modifications to take effect. You can get \`Flex' from any GNU archive site." rm -f lex.yy.c if [ $# -ne 1 ]; then eval LASTARG="\${$#}" case "$LASTARG" in *.l) SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" lex.yy.c fi ;; esac fi if [ ! -f lex.yy.c ]; then echo 'main() { return 0; }' >lex.yy.c fi ;; help2man) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a dependency of a manual page. You may need the \`Help2man' package in order for those modifications to take effect. You can get \`Help2man' from any GNU archive site." file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` if test -z "$file"; then file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'` fi if [ -f "$file" ]; then touch $file else test -z "$file" || exec >$file echo ".ab help2man is required to generate this page" exit 1 fi ;; makeinfo) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a \`.texi' or \`.texinfo' file, or any other file indirectly affecting the aspect of the manual. The spurious call might also be the consequence of using a buggy \`make' (AIX, DU, IRIX). You might want to install the \`Texinfo' package or the \`GNU make' package. Grab either from any GNU archive site." file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` if test -z "$file"; then file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file` fi touch $file ;; tar) shift # We have already tried tar in the generic part. # Look for gnutar/gtar before invocation to avoid ugly error # messages. if (gnutar --version > /dev/null 2>&1); then gnutar "$@" && exit 0 fi if (gtar --version > /dev/null 2>&1); then gtar "$@" && exit 0 fi firstarg="$1" if shift; then case "$firstarg" in *o*) firstarg=`echo "$firstarg" | sed s/o//` tar "$firstarg" "$@" && exit 0 ;; esac case "$firstarg" in *h*) firstarg=`echo "$firstarg" | sed s/h//` tar "$firstarg" "$@" && exit 0 ;; esac fi echo 1>&2 "\ WARNING: I can't seem to be able to run \`tar' with the given arguments. You may want to install GNU tar or Free paxutils, or check the command line arguments." exit 1 ;; *) echo 1>&2 "\ WARNING: \`$1' is needed, and is $msg. You might have modified some files without having the proper tools for further handling them. Check the \`README' file, it often tells you about the needed prerequisites for installing this package. You may also peek at any GNU archive site, in case some other package would contain this missing \`$1' program." exit 1 ;; esac exit 0 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-end: "$" # End: freeradius-server/libtool.m4000066400000000000000000007023021257552170400164350ustar00rootroot00000000000000# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- ## Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005 ## Free Software Foundation, Inc. ## Originally 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. # serial 48 AC_PROG_LIBTOOL # AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED) # ----------------------------------------------------------- # If this macro is not defined by Autoconf, define it here. m4_ifdef([AC_PROVIDE_IFELSE], [], [m4_define([AC_PROVIDE_IFELSE], [m4_ifdef([AC_PROVIDE_$1], [$2], [$3])])]) # AC_PROG_LIBTOOL # --------------- AC_DEFUN([AC_PROG_LIBTOOL], [AC_REQUIRE([_AC_PROG_LIBTOOL])dnl dnl If AC_PROG_CXX has already been expanded, run AC_LIBTOOL_CXX dnl immediately, otherwise, hook it in at the end of AC_PROG_CXX. AC_PROVIDE_IFELSE([AC_PROG_CXX], [AC_LIBTOOL_CXX], [define([AC_PROG_CXX], defn([AC_PROG_CXX])[AC_LIBTOOL_CXX ])]) dnl And a similar setup for Fortran 77 support AC_PROVIDE_IFELSE([AC_PROG_F77], [AC_LIBTOOL_F77], [define([AC_PROG_F77], defn([AC_PROG_F77])[AC_LIBTOOL_F77 ])]) dnl Quote A][M_PROG_GCJ so that aclocal doesn't bring it in needlessly. dnl If either AC_PROG_GCJ or A][M_PROG_GCJ have already been expanded, run dnl AC_LIBTOOL_GCJ immediately, otherwise, hook it in at the end of both. AC_PROVIDE_IFELSE([AC_PROG_GCJ], [AC_LIBTOOL_GCJ], [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], [AC_LIBTOOL_GCJ], [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ], [AC_LIBTOOL_GCJ], [ifdef([AC_PROG_GCJ], [define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[AC_LIBTOOL_GCJ])]) ifdef([A][M_PROG_GCJ], [define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[AC_LIBTOOL_GCJ])]) ifdef([LT_AC_PROG_GCJ], [define([LT_AC_PROG_GCJ], defn([LT_AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])])]) ])])# AC_PROG_LIBTOOL # _AC_PROG_LIBTOOL # ---------------- AC_DEFUN([_AC_PROG_LIBTOOL], [AC_REQUIRE([AC_LIBTOOL_SETUP])dnl AC_BEFORE([$0],[AC_LIBTOOL_CXX])dnl AC_BEFORE([$0],[AC_LIBTOOL_F77])dnl AC_BEFORE([$0],[AC_LIBTOOL_GCJ])dnl # This can be used to rebuild libtool when needed LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh" # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' AC_SUBST(LIBTOOL)dnl # Prevent multiple expansion define([AC_PROG_LIBTOOL], []) ])# _AC_PROG_LIBTOOL # AC_LIBTOOL_SETUP # ---------------- AC_DEFUN([AC_LIBTOOL_SETUP], [AC_PREREQ(2.50)dnl AC_REQUIRE([AC_ENABLE_SHARED])dnl AC_REQUIRE([AC_ENABLE_STATIC])dnl AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_PROG_LD])dnl AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl AC_REQUIRE([AC_PROG_NM])dnl AC_REQUIRE([AC_PROG_LN_S])dnl AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl # Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers! AC_REQUIRE([AC_OBJEXT])dnl AC_REQUIRE([AC_EXEEXT])dnl dnl AC_LIBTOOL_SYS_MAX_CMD_LEN AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE AC_LIBTOOL_OBJDIR AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl _LT_AC_PROG_ECHO_BACKSLASH case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. 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 to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' # Constants: rm="rm -f" # Global variables: default_ofile=libtool can_build_shared=yes # All known linkers require a `.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a ltmain="$ac_aux_dir/ltmain.sh" ofile="$default_ofile" with_gnu_ld="$lt_cv_prog_gnu_ld" AC_CHECK_TOOL(AR, ar, false) AC_CHECK_TOOL(RANLIB, ranlib, :) AC_CHECK_TOOL(STRIP, strip, :) old_CC="$CC" old_CFLAGS="$CFLAGS" # Set sane defaults for various variables test -z "$AR" && AR=ar test -z "$AR_FLAGS" && AR_FLAGS=cru test -z "$AS" && AS=as test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$DLLTOOL" && DLLTOOL=dlltool test -z "$LD" && LD=ld test -z "$LN_S" && LN_S="ln -s" test -z "$MAGIC_CMD" && MAGIC_CMD=file test -z "$NM" && NM=nm test -z "$SED" && SED=sed test -z "$OBJDUMP" && OBJDUMP=objdump test -z "$RANLIB" && RANLIB=: test -z "$STRIP" && STRIP=: test -z "$ac_objext" && ac_objext=o # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" fi _LT_CC_BASENAME([$compiler]) # Only perform the check for file, if the check method requires it case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then AC_PATH_MAGIC fi ;; esac AC_PROVIDE_IFELSE([AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no) AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL], enable_win32_dll=yes, enable_win32_dll=no) AC_ARG_ENABLE([libtool-lock], [AC_HELP_STRING([--disable-libtool-lock], [avoid locking (might break parallel builds)])]) test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes AC_ARG_WITH([pic], [AC_HELP_STRING([--with-pic], [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], [pic_mode="$withval"], [pic_mode=default]) test -z "$pic_mode" && pic_mode=default # Use C for the default configuration in the libtool script tagname= AC_LIBTOOL_LANG_C_CONFIG _LT_AC_TAGCONFIG ])# AC_LIBTOOL_SETUP # _LT_AC_SYS_COMPILER # ------------------- AC_DEFUN([_LT_AC_SYS_COMPILER], [AC_REQUIRE([AC_PROG_CC])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_AC_SYS_COMPILER # _LT_CC_BASENAME(CC) # ------------------- # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. AC_DEFUN([_LT_CC_BASENAME], [for cc_temp in $1""; do case $cc_temp in compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` ]) # _LT_COMPILER_BOILERPLATE # ------------------------ # Check for compiler boilerplate output or warnings with # the simple compiler test code. AC_DEFUN([_LT_COMPILER_BOILERPLATE], [ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/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. AC_DEFUN([_LT_LINKER_BOILERPLATE], [ac_outfile=conftest.$ac_objext printf "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $rm conftest* ])# _LT_LINKER_BOILERPLATE # _LT_AC_SYS_LIBPATH_AIX # ---------------------- # Links a minimal program and checks the executable # for the system default hardcoded library path. In most cases, # this is /usr/lib:/lib, but when the MPI compilers are used # the location of the communication and MPI libs are included too. # If we don't find anything, use the default library path according # to the aix ld manual. AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX], [AC_LINK_IFELSE(AC_LANG_PROGRAM,[ aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi],[]) if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi ])# _LT_AC_SYS_LIBPATH_AIX # _LT_AC_SHELL_INIT(ARG) # ---------------------- AC_DEFUN([_LT_AC_SHELL_INIT], [ifdef([AC_DIVERSION_NOTICE], [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)], [AC_DIVERT_PUSH(NOTICE)]) $1 AC_DIVERT_POP ])# _LT_AC_SHELL_INIT # _LT_AC_PROG_ECHO_BACKSLASH # -------------------------- # Add some code to the start of the generated configure script which # will find an echo command which doesn't interpret backslashes. AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH], [_LT_AC_SHELL_INIT([ # Check that we are running under the correct shell. SHELL=${CONFIG_SHELL-/bin/sh} case X$ECHO in X*--fallback-echo) # Remove one level of quotation (which was required for Make). ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','` ;; esac echo=${ECHO-echo} if test "X[$]1" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test "X[$]1" = X--fallback-echo; then # Avoid inline document here, it may be left over : elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then # Yippee, $echo works! : else # Restart under the correct shell. exec $SHELL "[$]0" --no-reexec ${1+"[$]@"} fi if test "X[$]1" = X--fallback-echo; then # used as fallback echo shift cat </dev/null 2>&1 && unset CDPATH if test -z "$ECHO"; then if test "X${echo_test_string+set}" != Xset; then # find a string as large as possible, as long as the shell can cope with it for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... if (echo_test_string=`eval $cmd`) 2>/dev/null && echo_test_string=`eval $cmd` && (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null then break fi done fi if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then : else # The Solaris, AIX, and Digital Unix default echo programs unquote # backslashes. This makes it impossible to quote backslashes using # echo "$something" | sed 's/\\/\\\\/g' # # So, first we look for a working echo in the user's PATH. lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for dir in $PATH /usr/ucb; do IFS="$lt_save_ifs" if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then echo="$dir/echo" break fi done IFS="$lt_save_ifs" if test "X$echo" = Xecho; then # We didn't find a better echo, so look for alternatives. if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then # This shell has a builtin print -r that does the trick. echo='print -r' elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) && test "X$CONFIG_SHELL" != X/bin/ksh; then # If we have ksh, try running configure again with it. ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} export ORIGINAL_CONFIG_SHELL CONFIG_SHELL=/bin/ksh export CONFIG_SHELL exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"} else # Try using printf. echo='printf %s\n' if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then # Cool, printf works : elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && test "X$echo_testing_string" = 'X\t' && echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL export CONFIG_SHELL SHELL="$CONFIG_SHELL" export SHELL echo="$CONFIG_SHELL [$]0 --fallback-echo" elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && test "X$echo_testing_string" = 'X\t' && echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then echo="$CONFIG_SHELL [$]0 --fallback-echo" else # maybe with a smaller string... prev=: for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null then break fi prev="$cmd" done if test "$prev" != 'sed 50q "[$]0"'; then echo_test_string=`eval $prev` export echo_test_string exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"} else # Oops. We lost completely, so just stick with echo. echo=echo fi fi fi fi fi fi # Copy echo and quote the copy suitably for passing to libtool from # the Makefile, instead of quoting the original, which is used later. ECHO=$echo if test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo" fi AC_SUBST(ECHO) ])])# _LT_AC_PROG_ECHO_BACKSLASH # _LT_AC_LOCK # ----------- AC_DEFUN([_LT_AC_LOCK], [AC_ARG_ENABLE([libtool-lock], [AC_HELP_STRING([--disable-libtool-lock], [avoid locking (might break parallel builds)])]) test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE="32" ;; *ELF-64*) HPUX_IA64_MODE="64" ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out which ABI we are using. echo '[#]line __oline__ "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then if test "$lt_cv_prog_gnu_ld" = yes; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|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-*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-*linux*) LD="${LD-ld} -m elf_x86_64" ;; ppc*-*linux*|powerpc*-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*) 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_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) AC_LANG_POP]) if test x"$lt_cv_cc_needs_belf" != x"yes"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS="$SAVE_CFLAGS" fi ;; sparc*-*solaris*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) LD="${LD-ld} -m elf64_sparc" ;; *) LD="${LD-ld} -64" ;; esac ;; esac fi rm -rf conftest* ;; AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL], [*-*-cygwin* | *-*-mingw* | *-*-pw32*) AC_CHECK_TOOL(DLLTOOL, dlltool, false) AC_CHECK_TOOL(AS, as, false) AC_CHECK_TOOL(OBJDUMP, objdump, false) ;; ]) esac need_locks="$enable_libtool_lock" ])# _LT_AC_LOCK # AC_LIBTOOL_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------------------- # Check whether the given compiler option works AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [AC_REQUIRE([LT_AC_PROG_SED]) AC_CACHE_CHECK([$1], [$2], [$2=no ifelse([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$3" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi fi $rm conftest* ]) if test x"[$]$2" = xyes; then ifelse([$5], , :, [$5]) else ifelse([$6], , :, [$6]) fi ])# AC_LIBTOOL_COMPILER_OPTION # AC_LIBTOOL_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [ACTION-SUCCESS], [ACTION-FAILURE]) # ------------------------------------------------------------ # Check whether the given compiler option works AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [AC_CACHE_CHECK([$1], [$2], [$2=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $3" printf "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&AS_MESSAGE_LOG_FD $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi else $2=yes fi fi $rm conftest* LDFLAGS="$save_LDFLAGS" ]) if test x"[$]$2" = xyes; then ifelse([$4], , :, [$4]) else ifelse([$5], , :, [$5]) fi ])# AC_LIBTOOL_LINKER_OPTION # AC_LIBTOOL_SYS_MAX_CMD_LEN # -------------------------- AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [# 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*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) # 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. SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} while (test "X"`$SHELL [$]0 --fallback-echo "X$teststring" 2>/dev/null` \ = "XX$teststring") >/dev/null 2>&1 && new_result=`expr "X$teststring" : ".*" 2>&1` && lt_cv_sys_max_cmd_len=$new_result && test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done 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` ;; 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 ])# AC_LIBTOOL_SYS_MAX_CMD_LEN # _LT_AC_CHECK_DLFCN # ------------------ AC_DEFUN([_LT_AC_CHECK_DLFCN], [AC_CHECK_HEADERS(dlfcn.h)dnl ])# _LT_AC_CHECK_DLFCN # _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, # ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) # --------------------------------------------------------------------- AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF], [AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl if test "$cross_compiling" = yes; then : [$4] else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < #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 #ifdef __cplusplus extern "C" void exit (int); #endif void fnord() { int i=42;} int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; /* dlclose (self); */ } else puts (dlerror ()); exit (status); }] 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_AC_TRY_DLOPEN_SELF # AC_LIBTOOL_DLOPEN_SELF # ---------------------- AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [AC_REQUIRE([_LT_AC_CHECK_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*) 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="-dld"], [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="-dld"]) ]) ]) ]) ]) ]) ;; 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_AC_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_AC_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 ])# AC_LIBTOOL_DLOPEN_SELF # AC_LIBTOOL_PROG_CC_C_O([TAGNAME]) # --------------------------------- # Check to see if options -c and -o are simultaneously supported by compiler AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O], [AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)], [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no $rm -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then _LT_AC_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 .. rmdir conftest $rm conftest* ]) ])# AC_LIBTOOL_PROG_CC_C_O # AC_LIBTOOL_SYS_HARD_LINK_LOCKS([TAGNAME]) # ----------------------------------------- # Check to see if we can do hard links to lock some files if needed AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_REQUIRE([_LT_AC_LOCK])dnl hard_links="nottested" if test "$_LT_AC_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 ])# AC_LIBTOOL_SYS_HARD_LINK_LOCKS # AC_LIBTOOL_OBJDIR # ----------------- AC_DEFUN([AC_LIBTOOL_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 ])# AC_LIBTOOL_OBJDIR # AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH([TAGNAME]) # ---------------------------------------------- # Check hardcoding attributes. AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_MSG_CHECKING([how to hardcode library paths into programs]) _LT_AC_TAGVAR(hardcode_action, $1)= if test -n "$_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)" || \ test -n "$_LT_AC_TAGVAR(runpath_var, $1)" || \ test "X$_LT_AC_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then # We can hardcode non-existant directories. if test "$_LT_AC_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_AC_TAGVAR(hardcode_shlibpath_var, $1)" != no && test "$_LT_AC_TAGVAR(hardcode_minus_L, $1)" != no; then # Linking always hardcodes the temporary library directory. _LT_AC_TAGVAR(hardcode_action, $1)=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. _LT_AC_TAGVAR(hardcode_action, $1)=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. _LT_AC_TAGVAR(hardcode_action, $1)=unsupported fi AC_MSG_RESULT([$_LT_AC_TAGVAR(hardcode_action, $1)]) if test "$_LT_AC_TAGVAR(hardcode_action, $1)" = relink; 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 ])# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH # AC_LIBTOOL_SYS_LIB_STRIP # ------------------------ AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP], [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" AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) fi ;; *) AC_MSG_RESULT([no]) ;; esac fi ])# AC_LIBTOOL_SYS_LIB_STRIP # AC_LIBTOOL_SYS_DYNAMIC_LINKER # ----------------------------- # PORTME Fill in your ld.so characteristics AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_MSG_CHECKING([dynamic linker characteristics]) 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" if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. 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 else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix4* | aix5*) version_type=linux need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[[01]] | aix4.[[01]].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[[45]]*) version_type=linux need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$host_os in yes,cygwin* | yes,mingw* | yes,pw32*) 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' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $rm \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" ;; mingw*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | [grep ';[c-zC-Z]:/' >/dev/null]; then # It is most probably a Windows format PATH printed by # mingw gcc, but we are running on Cygwin. Gcc prints its search # path with ; separators, and with drive letters. We can handle the # drive letters (cygwin fileutils understands them), so leave them, # especially as we might pass files found there to a mingw objdump, # which wouldn't understand a cygwinified path. Ahh. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' ;; esac ;; *) library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' ;; esac dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${versuffix}$shared_ext ${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`' # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` else sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' fi sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd1*) dynamic_linker=no ;; kfreebsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='GNU ld.so' ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[[123]]*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2*) shlibpath_overrides_runpath=yes ;; freebsd3.[[01]]* | freebsdelf3.[[01]]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \ freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; freebsd*) # from 4.6 on shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555. postinstall_cmds='chmod 555 $lib' ;; interix3*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be Linux ELF. linux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # 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)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; knetbsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='GNU ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; nto-qnx*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; 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" ;; solaris*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no export_dynamic_flag_spec='${wl}-Blargedynsym' runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' shlibpath_overrides_runpath=no else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' shlibpath_overrides_runpath=yes case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; uts4*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' 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 ])# AC_LIBTOOL_SYS_DYNAMIC_LINKER # _LT_AC_TAGCONFIG # ---------------- AC_DEFUN([_LT_AC_TAGCONFIG], [AC_ARG_WITH([tags], [AC_HELP_STRING([--with-tags@<:@=TAGS@:>@], [include additional configurations @<:@automatic@:>@])], [tagnames="$withval"]) if test -f "$ltmain" && test -n "$tagnames"; then if test ! -f "${ofile}"; then AC_MSG_WARN([output file `$ofile' does not exist]) fi if test -z "$LTCC"; then eval "`$SHELL ${ofile} --config | grep '^LTCC='`" if test -z "$LTCC"; then AC_MSG_WARN([output file `$ofile' does not look like a libtool script]) else AC_MSG_WARN([using `LTCC=$LTCC', extracted from `$ofile']) fi fi if test -z "$LTCFLAGS"; then eval "`$SHELL ${ofile} --config | grep '^LTCFLAGS='`" fi # Extract list of available tagged configurations in $ofile. # Note that this assumes the entire list is on one line. available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'` lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for tagname in $tagnames; do IFS="$lt_save_ifs" # Check whether tagname contains only valid characters case `$echo "X$tagname" | $Xsed -e 's:[[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]]::g'` in "") ;; *) AC_MSG_ERROR([invalid tag name: $tagname]) ;; esac if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null then AC_MSG_ERROR([tag name \"$tagname\" already exists]) fi # Update the list of available tags. if test -n "$tagname"; then echo appending configuration tag \"$tagname\" to $ofile case $tagname in CXX) if test -n "$CXX" && ( test "X$CXX" != "Xno" && ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || (test "X$CXX" != "Xg++"))) ; then AC_LIBTOOL_LANG_CXX_CONFIG else tagname="" fi ;; F77) if test -n "$F77" && test "X$F77" != "Xno"; then AC_LIBTOOL_LANG_F77_CONFIG else tagname="" fi ;; GCJ) if test -n "$GCJ" && test "X$GCJ" != "Xno"; then AC_LIBTOOL_LANG_GCJ_CONFIG else tagname="" fi ;; RC) AC_LIBTOOL_LANG_RC_CONFIG ;; *) AC_MSG_ERROR([Unsupported tag name: $tagname]) ;; esac # Append the new tag name to the list of available tags. if test -n "$tagname" ; then available_tags="$available_tags $tagname" fi fi done IFS="$lt_save_ifs" # Now substitute the updated list of available tags. if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then mv "${ofile}T" "$ofile" chmod +x "$ofile" else rm -f "${ofile}T" AC_MSG_ERROR([unable to update list of available tagged configurations.]) fi fi ])# _LT_AC_TAGCONFIG # AC_LIBTOOL_DLOPEN # ----------------- # enable checks for dlopen support AC_DEFUN([AC_LIBTOOL_DLOPEN], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP]) ])# AC_LIBTOOL_DLOPEN # AC_LIBTOOL_WIN32_DLL # -------------------- # declare package support for building win32 DLLs AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_BEFORE([$0], [AC_LIBTOOL_SETUP]) ])# AC_LIBTOOL_WIN32_DLL # AC_ENABLE_SHARED([DEFAULT]) # --------------------------- # implement the --enable-shared flag # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. AC_DEFUN([AC_ENABLE_SHARED], [define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl AC_ARG_ENABLE([shared], [AC_HELP_STRING([--enable-shared@<:@=PKGS@:>@], [build shared libraries @<:@default=]AC_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=]AC_ENABLE_SHARED_DEFAULT) ])# AC_ENABLE_SHARED # AC_DISABLE_SHARED # ----------------- # set the default shared flag to --disable-shared AC_DEFUN([AC_DISABLE_SHARED], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl AC_ENABLE_SHARED(no) ])# AC_DISABLE_SHARED # AC_ENABLE_STATIC([DEFAULT]) # --------------------------- # implement the --enable-static flag # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. AC_DEFUN([AC_ENABLE_STATIC], [define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl AC_ARG_ENABLE([static], [AC_HELP_STRING([--enable-static@<:@=PKGS@:>@], [build static libraries @<:@default=]AC_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=]AC_ENABLE_STATIC_DEFAULT) ])# AC_ENABLE_STATIC # AC_DISABLE_STATIC # ----------------- # set the default static flag to --disable-static AC_DEFUN([AC_DISABLE_STATIC], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl AC_ENABLE_STATIC(no) ])# AC_DISABLE_STATIC # AC_ENABLE_FAST_INSTALL([DEFAULT]) # --------------------------------- # implement the --enable-fast-install flag # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. AC_DEFUN([AC_ENABLE_FAST_INSTALL], [define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl AC_ARG_ENABLE([fast-install], [AC_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], [optimize for fast installation @<:@default=]AC_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=]AC_ENABLE_FAST_INSTALL_DEFAULT) ])# AC_ENABLE_FAST_INSTALL # AC_DISABLE_FAST_INSTALL # ----------------------- # set the default to --disable-fast-install AC_DEFUN([AC_DISABLE_FAST_INSTALL], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl AC_ENABLE_FAST_INSTALL(no) ])# AC_DISABLE_FAST_INSTALL # AC_LIBTOOL_PICMODE([MODE]) # -------------------------- # implement the --with-pic flag # MODE is either `yes' or `no'. If omitted, it defaults to `both'. AC_DEFUN([AC_LIBTOOL_PICMODE], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl pic_mode=ifelse($#,1,$1,default) ])# AC_LIBTOOL_PICMODE # AC_PROG_EGREP # ------------- # This is predefined starting with Autoconf 2.54, so this conditional # definition can be removed once we require Autoconf 2.54 or later. m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP], [AC_CACHE_CHECK([for egrep], [ac_cv_prog_egrep], [if echo a | (grep -E '(a|b)') >/dev/null 2>&1 then ac_cv_prog_egrep='grep -E' else ac_cv_prog_egrep='egrep' fi]) EGREP=$ac_cv_prog_egrep AC_SUBST([EGREP]) ])]) # AC_PATH_TOOL_PREFIX # ------------------- # find a file program which can recognise shared library AC_DEFUN([AC_PATH_TOOL_PREFIX], [AC_REQUIRE([AC_PROG_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="ifelse([$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 <&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 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 ])# AC_PATH_TOOL_PREFIX # AC_PATH_MAGIC # ------------- # find a file program which can recognise a shared library AC_DEFUN([AC_PATH_MAGIC], [AC_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 AC_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) else MAGIC_CMD=: fi fi ])# AC_PATH_MAGIC # AC_PROG_LD # ---------- # find the pathname to the GNU or non-GNU linker AC_DEFUN([AC_PROG_LD], [AC_ARG_WITH([gnu-ld], [AC_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]) AC_REQUIRE([LT_AC_PROG_SED])dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])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; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; gnu*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]'] lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix3*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be Linux ELF. linux*) 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=unknown ;; 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 ;; solaris*) 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 ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; esac ]) file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown ])# AC_DEPLIBS_CHECK_METHOD # AC_PROG_NM # ---------- # find the pathname to a BSD-compatible name lister AC_DEFUN([AC_PROG_NM], [AC_CACHE_CHECK([for BSD-compatible 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 test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm fi]) NM="$lt_cv_path_NM" ])# AC_PROG_NM # AC_CHECK_LIBM # ------------- # check for math library AC_DEFUN([AC_CHECK_LIBM], [AC_REQUIRE([AC_CANONICAL_HOST])dnl LIBM= case $host in *-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*) # These system don't have libm, or don't need it ;; *-ncr-sysv4.3*) AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") ;; *) AC_CHECK_LIB(m, cos, LIBM="-lm") ;; esac ])# AC_CHECK_LIBM # AC_LIBLTDL_CONVENIENCE([DIRECTORY]) # ----------------------------------- # 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. If DIRECTORY is not provided, # it is assumed to be `libltdl'. LIBLTDL will be prefixed 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_builddir and top_srcdir appropriately in # the Makefiles. AC_DEFUN([AC_LIBLTDL_CONVENIENCE], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl 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='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) # For backwards non-gettext consistent compatibility... INCLTDL="$LTDLINCL" ])# AC_LIBLTDL_CONVENIENCE # AC_LIBLTDL_INSTALLABLE([DIRECTORY]) # ----------------------------------- # 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 here. If DIRECTORY is not provided, # and an installed libltdl is not found, it is assumed to be `libltdl'. # LIBLTDL will be prefixed with '${top_builddir}/'# and LTDLINCL with # '${top_srcdir}/' (note the single quotes!). If your package is not # flat and you're not using automake, define top_builddir and top_srcdir # appropriately in the Makefiles. # In the future, this macro may have to be called after AC_PROG_LIBTOOL. AC_DEFUN([AC_LIBLTDL_INSTALLABLE], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl AC_CHECK_LIB(ltdl, lt_dlinit, [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no], [if test x"$enable_ltdl_install" = xno; then AC_MSG_WARN([libltdl not installed, but installation disabled]) else enable_ltdl_install=yes fi ]) if test x"$enable_ltdl_install" = x"yes"; then ac_configure_args="$ac_configure_args --enable-ltdl-install" LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) else ac_configure_args="$ac_configure_args --enable-ltdl-install=no" LIBLTDL="-lltdl" LTDLINCL= fi # For backwards non-gettext consistent compatibility... INCLTDL="$LTDLINCL" ])# AC_LIBLTDL_INSTALLABLE # AC_LIBTOOL_CXX # -------------- # enable support for C++ libraries AC_DEFUN([AC_LIBTOOL_CXX], [AC_REQUIRE([_LT_AC_LANG_CXX]) ])# AC_LIBTOOL_CXX # _LT_AC_LANG_CXX # --------------- AC_DEFUN([_LT_AC_LANG_CXX], [AC_REQUIRE([AC_PROG_CXX]) AC_REQUIRE([_LT_AC_PROG_CXXCPP]) _LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}CXX]) ])# _LT_AC_LANG_CXX # _LT_AC_PROG_CXXCPP # ------------------ AC_DEFUN([_LT_AC_PROG_CXXCPP], [ AC_REQUIRE([AC_PROG_CXX]) if test -n "$CXX" && ( test "X$CXX" != "Xno" && ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || (test "X$CXX" != "Xg++"))) ; then AC_PROG_CXXCPP fi ])# _LT_AC_PROG_CXXCPP # AC_LIBTOOL_F77 # -------------- # enable support for Fortran 77 libraries AC_DEFUN([AC_LIBTOOL_F77], [AC_REQUIRE([_LT_AC_LANG_F77]) ])# AC_LIBTOOL_F77 # _LT_AC_LANG_F77 # --------------- AC_DEFUN([_LT_AC_LANG_F77], [AC_REQUIRE([AC_PROG_F77]) _LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}F77]) ])# _LT_AC_LANG_F77 # AC_LIBTOOL_GCJ # -------------- # enable support for GCJ libraries AC_DEFUN([AC_LIBTOOL_GCJ], [AC_REQUIRE([_LT_AC_LANG_GCJ]) ])# AC_LIBTOOL_GCJ # _LT_AC_LANG_GCJ # --------------- AC_DEFUN([_LT_AC_LANG_GCJ], [AC_PROVIDE_IFELSE([AC_PROG_GCJ],[], [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],[], [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],[], [ifdef([AC_PROG_GCJ],[AC_REQUIRE([AC_PROG_GCJ])], [ifdef([A][M_PROG_GCJ],[AC_REQUIRE([A][M_PROG_GCJ])], [AC_REQUIRE([A][C_PROG_GCJ_OR_A][M_PROG_GCJ])])])])])]) _LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}GCJ]) ])# _LT_AC_LANG_GCJ # AC_LIBTOOL_RC # ------------- # enable support for Windows resource files AC_DEFUN([AC_LIBTOOL_RC], [AC_REQUIRE([LT_AC_PROG_RC]) _LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}RC]) ])# AC_LIBTOOL_RC # AC_LIBTOOL_LANG_C_CONFIG # ------------------------ # Ensure that the configuration vars for the C compiler are # suitably defined. Those variables are subsequently used by # AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG], [_LT_AC_LANG_C_CONFIG]) AC_DEFUN([_LT_AC_LANG_C_CONFIG], [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_AC_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;\n" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}\n' _LT_AC_SYS_COMPILER # 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... AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1) AC_LIBTOOL_PROG_COMPILER_PIC($1) AC_LIBTOOL_PROG_CC_C_O($1) AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) AC_LIBTOOL_PROG_LD_SHLIBS($1) AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) AC_LIBTOOL_SYS_LIB_STRIP AC_LIBTOOL_DLOPEN_SELF # 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 ;; aix4* | aix5*) 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]) AC_LIBTOOL_CONFIG($1) AC_LANG_POP CC="$lt_save_CC" ])# AC_LIBTOOL_LANG_C_CONFIG # AC_LIBTOOL_LANG_CXX_CONFIG # -------------------------- # Ensure that the configuration vars for the C compiler are # suitably defined. Those variables are subsequently used by # AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG], [_LT_AC_LANG_CXX_CONFIG(CXX)]) AC_DEFUN([_LT_AC_LANG_CXX_CONFIG], [AC_LANG_PUSH(C++) AC_REQUIRE([AC_PROG_CXX]) AC_REQUIRE([_LT_AC_PROG_CXXCPP]) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no _LT_AC_TAGVAR(allow_undefined_flag, $1)= _LT_AC_TAGVAR(always_export_symbols, $1)=no _LT_AC_TAGVAR(archive_expsym_cmds, $1)= _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= _LT_AC_TAGVAR(hardcode_minus_L, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_AC_TAGVAR(hardcode_automatic, $1)=no _LT_AC_TAGVAR(module_cmds, $1)= _LT_AC_TAGVAR(module_expsym_cmds, $1)= _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown _LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_AC_TAGVAR(no_undefined_flag, $1)= _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Dependencies to place before and after the object being linked: _LT_AC_TAGVAR(predep_objects, $1)= _LT_AC_TAGVAR(postdep_objects, $1)= _LT_AC_TAGVAR(predeps, $1)= _LT_AC_TAGVAR(postdeps, $1)= _LT_AC_TAGVAR(compiler_lib_search_path, $1)= # Source file extension for C++ test sources. ac_ext=cpp # Object file extension for compiled C++ test sources. objext=o _LT_AC_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;\n" # Code to be used in simple link tests lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }\n' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_AC_SYS_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_LD=$LD lt_save_GCC=$GCC GCC=$GXX lt_save_with_gnu_ld=$with_gnu_ld lt_save_path_LD=$lt_cv_path_LD if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx else $as_unset lt_cv_prog_gnu_ld fi if test -n "${lt_cv_path_LDCXX+set}"; then lt_cv_path_LD=$lt_cv_path_LDCXX else $as_unset lt_cv_path_LD fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} compiler=$CC _LT_AC_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) # We don't want -fno-exception wen compiling C++ code, so set the # no_builtin_flag separately if test "$GXX" = yes; then _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' else _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= fi if test "$GXX" = yes; then # Set up default GNU C++ configuration AC_PROG_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_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' _LT_AC_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_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else _LT_AC_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_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' fi # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' else GXX=no with_gnu_ld=no wlarc= fi # PORTME: fill in a description of your system's C++ link characteristics AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) _LT_AC_TAGVAR(ld_shlibs, $1)=yes case $host_os in aix3*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; aix4* | aix5*) 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]].*|aix5*) 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_AC_TAGVAR(archive_cmds, $1)='' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_AC_TAGVAR(link_all_deplibs, $1)=yes 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 _LT_AC_TAGVAR(hardcode_direct, $1)=yes else # We have old collect2 _LT_AC_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_AC_TAGVAR(hardcode_minus_L, $1)=yes _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then 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 # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. _LT_AC_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_AC_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an empty executable. _LT_AC_SYS_LIBPATH_AIX _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an empty executable. _LT_AC_SYS_LIBPATH_AIX _LT_AC_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_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' # Exported symbols can be pulled into shared objects from archives _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='$convenience' _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds its shared libraries. _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; beos*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; chorus*) case $cc_basename in *) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac ;; cygwin* | mingw* | pw32*) # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_AC_TAGVAR(always_export_symbols, $1)=no _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then 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_AC_TAGVAR(ld_shlibs, $1)=no fi ;; darwin* | rhapsody*) case $host_os in rhapsody* | darwin1.[[012]]) _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress' ;; *) # Darwin 1.3 on if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' else case ${MACOSX_DEPLOYMENT_TARGET} in 10.[[012]]) _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup' ;; esac fi ;; esac _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_automatic, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='' _LT_AC_TAGVAR(link_all_deplibs, $1)=yes if test "$GXX" = yes ; then lt_int_apple_cc_single_mod=no output_verbose_link_cmd='echo' if $CC -dumpspecs 2>&1 | $EGREP 'single_module' >/dev/null ; then lt_int_apple_cc_single_mod=yes fi if test "X$lt_int_apple_cc_single_mod" = Xyes ; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' else _LT_AC_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' fi _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds if test "X$lt_int_apple_cc_single_mod" = Xyes ; then _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "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~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' fi _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else case $cc_basename in xlc*) output_verbose_link_cmd='echo' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' ;; *) _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac fi ;; dgux*) case $cc_basename in ec++*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; ghcx*) # Green Hills C++ Compiler # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac ;; freebsd[[12]]*) # C++ shared libraries reported to be fairly broken before switch to ELF _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; freebsd-elf*) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no ;; freebsd* | kfreebsd*-gnu | dragonfly*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions _LT_AC_TAGVAR(ld_shlibs, $1)=yes ;; gnu*) ;; hpux9*) _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_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_AC_TAGVAR(ld_shlibs, $1)=no ;; aCC*) _LT_AC_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) | grep "[[-]]L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes; then _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; hpux10*|hpux11*) if test $with_gnu_ld = no; then _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' ;; *) _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ;; esac fi case $host_cpu in hppa*64*|ia64*) _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_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_AC_TAGVAR(ld_shlibs, $1)=no ;; aCC*) case $host_cpu in hppa*64*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes; then if test $with_gnu_ld = no; then case $host_cpu in hppa*64*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi else # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; interix3*) _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; irix5* | irix6*) case $cc_basename in CC*) # SGI C++ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -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_AC_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_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib' fi fi _LT_AC_TAGVAR(link_all_deplibs, $1)=yes ;; esac _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: ;; linux*) 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_AC_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_AC_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath,$libdir' _LT_AC_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_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; icpc*) # 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_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_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_AC_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_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_AC_TAGVAR(archive_cmds_need_lc, $1)=no _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' ;; pgCC*) # Portland Group C++ compiler _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' _LT_AC_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' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' ;; cxx*) # Compaq C++ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_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_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; esac ;; lynxos*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; m88k*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; mvs*) case $cc_basename in cxx*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' wlarc= _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_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::"' ;; openbsd2*) # C++ shared libraries are fairly broken _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; openbsd*) _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' _LT_AC_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_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' fi output_verbose_link_cmd='echo' ;; osf3*) 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_AC_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_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; cxx*) _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' else # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; 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_AC_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_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: # Archives containing C++ object files must be created using # the KAI C++ compiler. _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; cxx*) _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' _LT_AC_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_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' else # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; psos*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; lcc*) # Lucid # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac ;; solaris*) case $cc_basename in CC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_AC_TAGVAR(archive_cmds_need_lc,$1)=yes _LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $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_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The C++ compiler is used as linker so we must use $wl # flag to pass the commands to the underlying system # linker. We must also pass each convience library through # to the system linker between allextract/defaultextract. # The C++ compiler will combine linker options so we # cannot just pass the convience library names through # without $wl. # Supported since Solaris 2.6 (maybe 2.5.1?) _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; esac _LT_AC_TAGVAR(link_all_deplibs, $1)=yes output_verbose_link_cmd='echo' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; gcx*) # Green Hills C++ Compiler _LT_AC_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_AC_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_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' if $CC --version | grep -v '^2\.7' > /dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" else # g++ 2.7 appears to require `-G' NOT `-shared' on this # platform. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' fi ;; esac ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. # So that behaviour is only enabled if SCOABSPATH is set to a # non-empty value in the environment. Most likely only useful for # creating official distributions of packages. # This is a hack until libtool officially supports absolute path # names for shared libraries. _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_AC_TAGVAR(link_all_deplibs, $1)=yes _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac ;; vxworks*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)]) test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no _LT_AC_TAGVAR(GCC, $1)="$GXX" _LT_AC_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... AC_LIBTOOL_POSTDEP_PREDEP($1) AC_LIBTOOL_PROG_COMPILER_PIC($1) AC_LIBTOOL_PROG_CC_C_O($1) AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) AC_LIBTOOL_PROG_LD_SHLIBS($1) AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) AC_LIBTOOL_CONFIG($1) AC_LANG_POP CC=$lt_save_CC LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC with_gnu_ldcxx=$with_gnu_ld 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 ])# AC_LIBTOOL_LANG_CXX_CONFIG # AC_LIBTOOL_POSTDEP_PREDEP([TAGNAME]) # ------------------------------------ # Figure out "hidden" library dependencies from verbose # compiler output when linking a shared library. # Parse the compiler output and extract the necessary # objects, libraries and library flags. AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP],[ 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... ifelse([$1],[],[cat > conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext <> "$cfgfile" ifelse([$1], [], [#! $SHELL # `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) # NOTE: Changes made to this file will be lost: look at ltmain.sh. # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 # Free Software Foundation, Inc. # # This file is part of GNU Libtool: # Originally by Gordon Matzigkeit , 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 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # 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//" # 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 # The names of the tagged configurations supported by this script. available_tags= # ### BEGIN LIBTOOL CONFIG], [# ### BEGIN LIBTOOL TAG CONFIG: $tagname]) # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$_LT_AC_TAGVAR(archive_cmds_need_lc, $1) # Whether or not to disallow shared libs when runtime libs are static allow_libtool_libs_with_static_runtimes=$_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1) # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # An echo program that does not interpret backslashes. echo=$lt_echo # The archiver. AR=$lt_AR AR_FLAGS=$lt_AR_FLAGS # A C compiler. LTCC=$lt_LTCC # LTCC compiler flags. LTCFLAGS=$lt_LTCFLAGS # A language-specific compiler. CC=$lt_[]_LT_AC_TAGVAR(compiler, $1) # Is the compiler the GNU C compiler? with_gcc=$_LT_AC_TAGVAR(GCC, $1) # An ERE matcher. EGREP=$lt_EGREP # The linker used to build libraries. LD=$lt_[]_LT_AC_TAGVAR(LD, $1) # Whether we need hard or soft links. LN_S=$lt_LN_S # A BSD-compatible nm program. NM=$lt_NM # A symbol stripping program STRIP=$lt_STRIP # Used to examine libraries when file_magic_cmd begins "file" MAGIC_CMD=$MAGIC_CMD # Used on cygwin: DLL creation program. DLLTOOL="$DLLTOOL" # Used on cygwin: object dumper. OBJDUMP="$OBJDUMP" # Used on cygwin: assembler. AS="$AS" # The name of the directory that contains temporary libtool files. objdir=$objdir # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # How to pass a linker flag through the compiler. wl=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) # Object file suffix (normally "o"). objext="$ac_objext" # Old archive suffix (normally "a"). libext="$libext" # Shared library suffix (normally ".so"). shrext_cmds='$shrext_cmds' # Executable file suffix (normally ""). exeext="$exeext" # Additional compiler flags for building library objects. pic_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) pic_mode=$pic_mode # What is the maximum length of a command? max_cmd_len=$lt_cv_sys_max_cmd_len # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_[]_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1) # Must we lock files when doing compilation? need_locks=$lt_need_locks # 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 # 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 # Compiler flag to prevent dynamic linking. link_static_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_static, $1) # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_[]_LT_AC_TAGVAR(export_dynamic_flag_spec, $1) # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_[]_LT_AC_TAGVAR(whole_archive_flag_spec, $1) # Compiler flag to generate thread-safe objects. thread_safe_flag_spec=$lt_[]_LT_AC_TAGVAR(thread_safe_flag_spec, $1) # Library versioning type. version_type=$version_type # 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 # Commands used to build and install an old-style archive. RANLIB=$lt_RANLIB old_archive_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_cmds, $1) old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_new_cmds, $1) # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) # Commands used to build and install a shared archive. archive_cmds=$lt_[]_LT_AC_TAGVAR(archive_cmds, $1) archive_expsym_cmds=$lt_[]_LT_AC_TAGVAR(archive_expsym_cmds, $1) postinstall_cmds=$lt_postinstall_cmds postuninstall_cmds=$lt_postuninstall_cmds # Commands used to build a loadable module (assumed same as above if empty) module_cmds=$lt_[]_LT_AC_TAGVAR(module_cmds, $1) module_expsym_cmds=$lt_[]_LT_AC_TAGVAR(module_expsym_cmds, $1) # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # Dependencies to place before the objects being linked to create a # shared library. predep_objects=$lt_[]_LT_AC_TAGVAR(predep_objects, $1) # Dependencies to place after the objects being linked to create a # shared library. postdep_objects=$lt_[]_LT_AC_TAGVAR(postdep_objects, $1) # Dependencies to place before the objects being linked to create a # shared library. predeps=$lt_[]_LT_AC_TAGVAR(predeps, $1) # Dependencies to place after the objects being linked to create a # shared library. postdeps=$lt_[]_LT_AC_TAGVAR(postdeps, $1) # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_[]_LT_AC_TAGVAR(compiler_lib_search_path, $1) # 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 # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_[]_LT_AC_TAGVAR(allow_undefined_flag, $1) # Flag that forces no undefined symbols. no_undefined_flag=$lt_[]_LT_AC_TAGVAR(no_undefined_flag, $1) # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # Same as above, but a single script fragment to be evaled but not shown. finish_eval=$lt_finish_eval # 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 # This is the shared library runtime path variable. runpath_var=$runpath_var # This is the shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # How to hardcode a shared library path into an executable. hardcode_action=$_LT_AC_TAGVAR(hardcode_action, $1) # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist. hardcode_libdir_flag_spec=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) # If ld is used when linking, flag to hardcode \$libdir into # a binary during linking. This must work even if \$libdir does # not exist. hardcode_libdir_flag_spec_ld=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1) # Whether we need a single -rpath flag with a separated argument. hardcode_libdir_separator=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_separator, $1) # Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the # resulting binary. hardcode_direct=$_LT_AC_TAGVAR(hardcode_direct, $1) # Set to yes if using the -LDIR flag during linking hardcodes DIR into the # resulting binary. hardcode_minus_L=$_LT_AC_TAGVAR(hardcode_minus_L, $1) # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into # the resulting binary. hardcode_shlibpath_var=$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1) # 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=$_LT_AC_TAGVAR(hardcode_automatic, $1) # Variables whose values should be saved in libtool wrapper scripts and # restored at relink time. variables_saved_for_relink="$variables_saved_for_relink" # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$_LT_AC_TAGVAR(link_all_deplibs, $1) # 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 # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path="$_LT_AC_TAGVAR(fix_srcfile_path, $1)" # Set to yes if exported symbols are required. always_export_symbols=$_LT_AC_TAGVAR(always_export_symbols, $1) # The commands to list exported symbols. export_symbols_cmds=$lt_[]_LT_AC_TAGVAR(export_symbols_cmds, $1) # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_[]_LT_AC_TAGVAR(exclude_expsyms, $1) # Symbols that must always be exported. include_expsyms=$lt_[]_LT_AC_TAGVAR(include_expsyms, $1) ifelse([$1],[], [# ### END LIBTOOL CONFIG], [# ### END LIBTOOL TAG CONFIG: $tagname]) __EOF__ ifelse([$1],[], [ case $host_os in aix3*) cat <<\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 EOF ;; esac # 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) mv -f "$cfgfile" "$ofile" || \ (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" ]) else # If there is no Makefile yet, we rely on a make rule to execute # `config.status --recheck' to rerun these tests and create the # libtool script then. ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` if test -f "$ltmain_in"; then test -f Makefile && make "$ltmain" fi fi ])# AC_LIBTOOL_CONFIG # AC_LIBTOOL_PROG_COMPILER_NO_RTTI([TAGNAME]) # ------------------------------------------- AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= if test "$GCC" = yes; then _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], lt_cv_prog_compiler_rtti_exceptions, [-fno-rtti -fno-exceptions], [], [_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) fi ])# AC_LIBTOOL_PROG_COMPILER_NO_RTTI # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE # --------------------------------- AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_REQUIRE([AC_CANONICAL_HOST]) AC_REQUIRE([AC_PROG_NM]) AC_REQUIRE([AC_OBJEXT]) # 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]]*\)' # Transform an extracted symbol line into a proper C declaration lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \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\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" # Define system-specific variables. case $host_os in aix*) symcode='[[BCDT]]' ;; cygwin* | mingw* | pw32*) symcode='[[ABCDGISTW]]' ;; hpux*) # Its linker distinguishes data from code symbols if test "$host_cpu" = ia64; then symcode='[[ABCDEGRST]]' fi lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" ;; linux*) if test "$host_cpu" = ia64; then symcode='[[ABCDGIRSTW]]' lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" 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 # 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 # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[[ABCDGIRSTW]]' ;; esac # Try without a prefix undercore, 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. lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext < $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 < conftest.$ac_ext #ifdef __cplusplus extern "C" { #endif EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext' cat <> conftest.$ac_ext #if defined (__STDC__) && __STDC__ # define lt_ptr_t void * #else # define lt_ptr_t char * # define const #endif /* The mapping between symbol names and symbols. */ const struct { const char *name; lt_ptr_t address; } lt_preloaded_symbols[[]] = { EOF $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext cat <<\EOF >> conftest.$ac_ext {0, (lt_ptr_t) 0} }; #ifdef __cplusplus } #endif EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_save_LIBS="$LIBS" lt_save_CFLAGS="$CFLAGS" LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then pipe_works=yes fi LIBS="$lt_save_LIBS" CFLAGS="$lt_save_CFLAGS" else echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD fi else echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD cat conftest.$ac_ext >&5 fi rm -f 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 ]) # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE # AC_LIBTOOL_PROG_COMPILER_PIC([TAGNAME]) # --------------------------------------- AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC], [_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)= _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= _LT_AC_TAGVAR(lt_prog_compiler_static, $1)= AC_MSG_CHECKING([for $compiler option to produce PIC]) ifelse([$1],[CXX],[ # C++ specific cases for pic, static, wl, etc. if test "$GXX" = yes; then _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_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_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; amigaos*) # 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_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | os2* | pw32*) # 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_AC_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_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; *djgpp*) # DJGPP does not support shared libraries at all _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= ;; interix3*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; sysv4*MP*) if test -d /usr/nec; then _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; hpux*) # 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*) ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac else case $host_os in aix4* | aix5*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; chorus*) case $cc_basename in cxch68*) # Green Hills C++ Compiler # _LT_AC_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 ;; darwin*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files case $cc_basename in xlc*) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon' _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ;; esac ;; dgux*) case $cc_basename in ec++*) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; ghcx*) # Green Hills C++ Compiler _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; freebsd* | kfreebsd*-gnu | dragonfly*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) case $cc_basename in CC*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' if test "$host_cpu" != ia64; then _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' fi ;; aCC*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_AC_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_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' # CC pic flag -KPIC is the default. ;; *) ;; esac ;; linux*) case $cc_basename in KCC*) # KAI C++ Compiler _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; icpc* | ecpc*) # Intel C++ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; pgCC*) # Portland Group C++ compiler. _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_AC_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_AC_TAGVAR(lt_prog_compiler_pic, $1)= _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; *) ;; esac ;; lynxos*) ;; m88k*) ;; mvs*) case $cc_basename in cxx*) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' ;; *) ;; esac ;; netbsd*) ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' ;; RCC*) # Rational C++ 2.4.1 _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; cxx*) # Digital/Compaq C++ _LT_AC_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_AC_TAGVAR(lt_prog_compiler_pic, $1)= _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; *) ;; esac ;; psos*) ;; solaris*) case $cc_basename in CC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; gcx*) # Green Hills C++ Compiler _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' ;; *) ;; esac ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; lcc*) # Lucid _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; *) ;; esac ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) case $cc_basename in CC*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; vxworks*) ;; *) _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ], [ if test "$GCC" = yes; then _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_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_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; amigaos*) # 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_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | pw32* | os2*) # 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_AC_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_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; interix3*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no enable_shared=no ;; sysv4*MP*) if test -d /usr/nec; then _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; hpux*) # 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_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; darwin*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files case $cc_basename in xlc*) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon' _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ;; esac ;; mingw* | pw32* | os2*) # 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_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' ;; hpux9* | hpux10* | hpux11*) _LT_AC_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_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC (with -KPIC) is the default. _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; newsos6) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; linux*) case $cc_basename in icc* | ecc*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; pgcc* | pgf77* | pgf90* | pgf95*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; ccc*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All Alpha code is PIC. _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; esac ;; osf3* | osf4* | osf5*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All OSF/1 code is PIC. _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; solaris*) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' case $cc_basename in f77* | f90* | f95*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; *) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; esac ;; sunos4*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; unicos*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; uts4*) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *) _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ]) AC_MSG_RESULT([$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)]) # # Check to make sure the PIC flag actually works. # if test -n "$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)"; then AC_LIBTOOL_COMPILER_OPTION([if $compiler PIC flag $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) works], _LT_AC_TAGVAR(lt_prog_compiler_pic_works, $1), [$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])], [], [case $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) in "" | " "*) ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)" ;; esac], [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) fi case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])" ;; esac # # Check to make sure the static flag actually works. # wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_AC_TAGVAR(lt_prog_compiler_static, $1)\" AC_LIBTOOL_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], _LT_AC_TAGVAR(lt_prog_compiler_static_works, $1), $lt_tmp_static_flag, [], [_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=]) ]) # AC_LIBTOOL_PROG_LD_SHLIBS([TAGNAME]) # ------------------------------------ # See if the linker supports building shared libraries. AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) ifelse([$1],[CXX],[ _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' case $host_os in aix4* | aix5*) # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | grep 'GNU' > /dev/null; then _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' else _LT_AC_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_AC_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" ;; cygwin* | mingw*) _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]] /s/.* \([[^ ]]*\)/\1 DATA/;/^.* __nm__/s/^.* __nm__\([[^ ]]*\) [[^ ]]*/\1 DATA/;/^I /d;/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols' ;; *) _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac ],[ runpath_var= _LT_AC_TAGVAR(allow_undefined_flag, $1)= _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no _LT_AC_TAGVAR(archive_cmds, $1)= _LT_AC_TAGVAR(archive_expsym_cmds, $1)= _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)= _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)= _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= _LT_AC_TAGVAR(thread_safe_flag_spec, $1)= _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_minus_L, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown _LT_AC_TAGVAR(hardcode_automatic, $1)=no _LT_AC_TAGVAR(module_cmds, $1)= _LT_AC_TAGVAR(module_expsym_cmds, $1)= _LT_AC_TAGVAR(always_export_symbols, $1)=no _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list _LT_AC_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_AC_TAGVAR(exclude_expsyms, $1)="_GLOBAL_OFFSET_TABLE_" # 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. extract_expsyms_cmds= # Just being paranoid about ensuring that cc_basename is set. _LT_CC_BASENAME([$compiler]) case $host_os in cygwin* | mingw* | pw32*) # 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_AC_TAGVAR(ld_shlibs, $1)=yes if test "$with_gnu_ld" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' _LT_AC_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_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= fi supports_anon_versioning=no case `$LD -v 2>/dev/null` in *\ [[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 aix3* | aix4* | aix5*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then _LT_AC_TAGVAR(ld_shlibs, $1)=no cat <&2 *** Warning: the GNU linker, at least up to release 2.9.1, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to modify your PATH *** so that a non-GNU linker is found, and then restart. EOF fi ;; amigaos*) _LT_AC_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_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Samuel A. Falvo II reports # that the semantics of dynamic libraries on AmigaOS, at least up # to version 4, is to share data among multiple programs linked # with the same dynamic library. Since this doesn't match the # behavior of shared libraries on other platforms, we can't use # them. _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; beos*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; cygwin* | mingw* | pw32*) # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_AC_TAGVAR(always_export_symbols, $1)=no _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]] /s/.* \([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols' if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then 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_AC_TAGVAR(ld_shlibs, $1)=no fi ;; interix3*) _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; linux*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then tmp_addflag= case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; esac _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test $supports_anon_versioning = yes; then _LT_AC_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 -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then _LT_AC_TAGVAR(ld_shlibs, $1)=no cat <&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. EOF elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_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_AC_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_AC_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib' else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; sunos4*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_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_AC_TAGVAR(ld_shlibs, $1)=no fi ;; esac if test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no; then runpath_var= _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= _LT_AC_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_AC_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_AC_TAGVAR(always_export_symbols, $1)=yes _LT_AC_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_AC_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_AC_TAGVAR(hardcode_direct, $1)=unsupported fi ;; aix4* | aix5*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | grep 'GNU' > /dev/null; then _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' else _LT_AC_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]].*|aix5*) 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_AC_TAGVAR(archive_cmds, $1)='' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_AC_TAGVAR(link_all_deplibs, $1)=yes 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 _LT_AC_TAGVAR(hardcode_direct, $1)=yes else # We have old collect2 _LT_AC_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_AC_TAGVAR(hardcode_minus_L, $1)=yes _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then 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 # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. _LT_AC_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_AC_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an empty executable. _LT_AC_SYS_LIBPATH_AIX _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an empty executable. _LT_AC_SYS_LIBPATH_AIX _LT_AC_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_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' # Exported symbols can be pulled into shared objects from archives _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='$convenience' _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds its shared libraries. _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${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*) _LT_AC_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_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # see comment about different semantics on the GNU ld section _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; bsdi[[45]]*) _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic ;; cygwin* | mingw* | pw32*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_AC_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_AC_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='true' # FIXME: Should let the user specify the lib program. _LT_AC_TAGVAR(old_archive_cmds, $1)='lib /OUT:$oldlib$oldobjs$old_deplibs' _LT_AC_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`' _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; darwin* | rhapsody*) case $host_os in rhapsody* | darwin1.[[012]]) _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress' ;; *) # Darwin 1.3 on if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' else case ${MACOSX_DEPLOYMENT_TARGET} in 10.[[012]]) _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup' ;; esac fi ;; esac _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_automatic, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='' _LT_AC_TAGVAR(link_all_deplibs, $1)=yes if test "$GCC" = yes ; then output_verbose_link_cmd='echo' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else case $cc_basename in xlc*) output_verbose_link_cmd='echo' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' ;; *) _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac fi ;; dgux*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; freebsd1*) _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | kfreebsd*-gnu | dragonfly*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; hpux9*) if test "$GCC" = yes; then _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else _LT_AC_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_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: _LT_AC_TAGVAR(hardcode_direct, $1)=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ;; hpux10*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test "$with_gnu_ld" = no; then _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes fi ;; hpux11*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac fi if test "$with_gnu_ld" = no; then _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir' fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: _LT_AC_TAGVAR(link_all_deplibs, $1)=yes ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; newsos6) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; openbsd*) _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' else case $host_os in openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' ;; *) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' ;; esac fi ;; os2*) _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_AC_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_AC_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' else _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' _LT_AC_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~ $LD -shared${allow_undefined_flag} -input $lib.exp $linker_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_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' fi _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: ;; solaris*) _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text' if test "$GCC" = yes; then wlarc='${wl}' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' else wlarc='' _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine linker options so we # cannot just pass the convience library names through # without $wl, iff we do not link with $LD. # Luckily, gcc supports the same syntax we need for Sun Studio. # Supported since Solaris 2.6 (maybe 2.5.1?) case $wlarc in '') _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;; *) _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; esac ;; esac _LT_AC_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_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4) case $host_vendor in sni) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_direct, $1)=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' _LT_AC_TAGVAR(hardcode_direct, $1)=no ;; motorola) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4.3*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes _LT_AC_TAGVAR(ld_shlibs, $1)=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7*) _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_AC_TAGVAR(link_all_deplibs, $1)=yes _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac fi ]) AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)]) test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no # # Do we need to explicitly link libc? # case "x$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)" in x|xyes) # Assume -lc should be added _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $_LT_AC_TAGVAR(archive_cmds, $1) in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. AC_MSG_CHECKING([whether -lc should be explicitly linked in]) $rm conftest* printf "$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_AC_TAGVAR(lt_prog_compiler_wl, $1) pic_flag=$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$_LT_AC_TAGVAR(allow_undefined_flag, $1) _LT_AC_TAGVAR(allow_undefined_flag, $1)= if AC_TRY_EVAL(_LT_AC_TAGVAR(archive_cmds, $1) 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) then _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no else _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes fi _LT_AC_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $rm conftest* AC_MSG_RESULT([$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)]) ;; esac fi ;; esac ])# AC_LIBTOOL_PROG_LD_SHLIBS # _LT_AC_FILE_LTDLL_C # ------------------- # Be careful that the start marker always follows a newline. AC_DEFUN([_LT_AC_FILE_LTDLL_C], [ # /* ltdll.c starts here */ # #define WIN32_LEAN_AND_MEAN # #include # #undef WIN32_LEAN_AND_MEAN # #include # # #ifndef __CYGWIN__ # # ifdef __CYGWIN32__ # # define __CYGWIN__ __CYGWIN32__ # # endif # #endif # # #ifdef __cplusplus # extern "C" { # #endif # BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved); # #ifdef __cplusplus # } # #endif # # #ifdef __CYGWIN__ # #include # DECLARE_CYGWIN_DLL( DllMain ); # #endif # HINSTANCE __hDllInstance_base; # # BOOL APIENTRY # DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved) # { # __hDllInstance_base = hInst; # return TRUE; # } # /* ltdll.c ends here */ ])# _LT_AC_FILE_LTDLL_C # _LT_AC_TAGVAR(VARNAME, [TAGNAME]) # --------------------------------- AC_DEFUN([_LT_AC_TAGVAR], [ifelse([$2], [], [$1], [$1_$2])]) # old names AC_DEFUN([AM_PROG_LIBTOOL], [AC_PROG_LIBTOOL]) AC_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) AC_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) AC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) AC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) AC_DEFUN([AM_PROG_LD], [AC_PROG_LD]) AC_DEFUN([AM_PROG_NM], [AC_PROG_NM]) # This is just to silence aclocal about the macro not being used ifelse([AC_DISABLE_FAST_INSTALL]) AC_DEFUN([LT_AC_PROG_GCJ], [AC_CHECK_TOOL(GCJ, gcj, no) test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" AC_SUBST(GCJFLAGS) ]) AC_DEFUN([LT_AC_PROG_RC], [AC_CHECK_TOOL(RC, windres, no) ]) ############################################################ # 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. # ############################################################ # LT_AC_PROG_SED # -------------- # Check for a fully-functional sed program, that truncates # as few characters as possible. Prefer GNU sed if found. AC_DEFUN([LT_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 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_MSG_RESULT([$SED]) ]) freeradius-server/ltmain.sh000077500000000000000000005775301257552170400163670ustar00rootroot00000000000000# ltmain.sh - Provide generalized library-building support services. # NOTE: Changing this file will not affect anything until you rerun configure. # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005 # Free Software Foundation, Inc. # Originally by Gordon Matzigkeit , 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 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. basename="s,^.*/,,g" # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh # is ksh but when the shell is invoked as "sh" and the current value of # the _XPG environment variable is not equal to 1 (one), the special # positional parameter $0, within a function call, is the name of the # function. progpath="$0" # The name of this program: progname=`echo "$progpath" | $SED $basename` modename="$progname" # Global variables: EXIT_SUCCESS=0 EXIT_FAILURE=1 PROGRAM=ltmain.sh PACKAGE=libtool VERSION=1.5.22 TIMESTAMP=" (1.1220.2.365 2005/12/18 22:14:06)" # 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 # Check that we have a working $echo. if test "X$1" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test "X$1" = X--fallback-echo; then # Avoid inline document here, it may be left over : elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then # Yippee, $echo works! : else # Restart under the correct shell, and then maybe $echo will work. exec $SHELL "$progpath" --no-reexec ${1+"$@"} fi if test "X$1" = X--fallback-echo; then # used as fallback echo shift cat <&2 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 exit $EXIT_FAILURE fi # Global variables. mode=$default_mode nonopt= prev= prevopt= run= show="$echo" show_help= execute_dlfiles= duplicate_deps=no preserve_args= lo2o="s/\\.lo\$/.${objext}/" o2lo="s/\\.${objext}\$/.lo/" ##################################### # Shell function definitions: # This seems to be the best place for them # 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 "$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" || { $echo "cannot create temporary directory \`$my_tmpdir'" 1>&2 exit $EXIT_FAILURE } fi $echo "X$my_tmpdir" | $Xsed } # func_win32_libid arg # return the library type of file 'arg' # # Need a lot of goo to handle *both* DLLs and import libs # Has to be a shell function in order to 'eat' the argument # that is supplied when $file_magic_command is called. func_win32_libid () { win32_libid_type="unknown" win32_fileres=`file -L $1 2>/dev/null` case $win32_fileres in *ar\ archive\ import\ library*) # definitely import win32_libid_type="x86 archive import" ;; *ar\ archive*) # could be an import, or static if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \ $EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then win32_nmres=`eval $NM -f posix -A $1 | \ $SED -n -e '1,100{/ I /{s,.*,import,;p;q;};}'` case $win32_nmres in import*) win32_libid_type="x86 archive import";; *) win32_libid_type="x86 archive static";; esac fi ;; *DLL*) win32_libid_type="x86 DLL" ;; *executable*) # but shell scripts are "executable" too... case $win32_fileres in *MS\ Windows\ PE\ Intel*) win32_libid_type="x86 DLL" ;; esac ;; esac $echo $win32_libid_type } # func_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 () { if test -n "$available_tags" && test -z "$tagname"; then CC_quoted= for arg in $CC; do case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac CC_quoted="$CC_quoted $arg" done case $@ in # Blanks in the command may have been stripped by the calling shell, # but not from the CC environment variable when configure was run. " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) ;; # Blanks at the start of $base_compile will cause this to fail # if we don't check for them as well. *) for z in $available_tags; do if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then # Evaluate the configuration. eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" CC_quoted= for arg in $CC; do # Double-quote args containing other shell metacharacters. case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac CC_quoted="$CC_quoted $arg" done case "$@ " in " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) # The compiler in the base compile command matches # the one in the tagged configuration. # Assume this is the tagged configuration we want. tagname=$z break ;; esac fi done # If $tagname still isn't set, then no tagged configuration # was found and let the user know that the "--tag" command # line option must be used. if test -z "$tagname"; then $echo "$modename: unable to infer tagged configuration" $echo "$modename: specify a tag with \`--tag'" 1>&2 exit $EXIT_FAILURE # else # $echo "$modename: using $tagname tagged configuration" fi ;; esac fi } # func_extract_an_archive dir oldlib func_extract_an_archive () { f_ex_an_ar_dir="$1"; shift f_ex_an_ar_oldlib="$1" $show "(cd $f_ex_an_ar_dir && $AR x $f_ex_an_ar_oldlib)" $run eval "(cd \$f_ex_an_ar_dir && $AR x \$f_ex_an_ar_oldlib)" || exit $? if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then : else $echo "$modename: ERROR: object name conflicts: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" 1>&2 exit $EXIT_FAILURE fi } # func_extract_archives gentop oldlib ... func_extract_archives () { my_gentop="$1"; shift my_oldlibs=${1+"$@"} my_oldobjs="" my_xlib="" my_xabs="" my_xdir="" my_status="" $show "${rm}r $my_gentop" $run ${rm}r "$my_gentop" $show "$mkdir $my_gentop" $run $mkdir "$my_gentop" my_status=$? if test "$my_status" -ne 0 && test ! -d "$my_gentop"; then exit $my_status fi 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 my_xlib=`$echo "X$my_xlib" | $Xsed -e 's%^.*/%%'` my_xdir="$my_gentop/$my_xlib" $show "${rm}r $my_xdir" $run ${rm}r "$my_xdir" $show "$mkdir $my_xdir" $run $mkdir "$my_xdir" exit_status=$? if test "$exit_status" -ne 0 && test ! -d "$my_xdir"; then exit $exit_status fi case $host in *-darwin*) $show "Extracting $my_xabs" # Do not bother doing anything if just a dry run if test -z "$run"; then darwin_orig_dir=`pwd` cd $my_xdir || exit $? darwin_archive=$my_xabs darwin_curdir=`pwd` darwin_base_archive=`$echo "X$darwin_archive" | $Xsed -e 's%^.*/%%'` darwin_arches=`lipo -info "$darwin_archive" 2>/dev/null | $EGREP Architectures 2>/dev/null` if test -n "$darwin_arches"; then darwin_arches=`echo "$darwin_arches" | $SED -e 's/.*are://'` darwin_arch= $show "$darwin_base_archive has multiple architectures $darwin_arches" for darwin_arch in $darwin_arches ; do 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 have a bunch of thin objects, gotta fatten them up :) darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print| xargs basename | sort -u | $NL2SP` darwin_file= darwin_files= for darwin_file in $darwin_filelist; do darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP` lipo -create -output "$darwin_file" $darwin_files done # $darwin_filelist ${rm}r unfat-$$ cd "$darwin_orig_dir" else cd "$darwin_orig_dir" func_extract_an_archive "$my_xdir" "$my_xabs" fi # $darwin_arches fi # $run ;; *) func_extract_an_archive "$my_xdir" "$my_xabs" ;; esac my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP` done func_extract_archives_result="$my_oldobjs" } # End of Shell function definitions ##################################### # Darwin sucks eval std_shrext=\"$shrext_cmds\" disable_libs=no # Parse our command line options once, thoroughly. while test "$#" -gt 0 do arg="$1" shift case $arg in -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;; *) optarg= ;; esac # If the previous option needs an argument, assign it. if test -n "$prev"; then case $prev in execute_dlfiles) execute_dlfiles="$execute_dlfiles $arg" ;; tag) tagname="$arg" preserve_args="${preserve_args}=$arg" # Check whether tagname contains only valid characters case $tagname in *[!-_A-Za-z0-9,/]*) $echo "$progname: invalid tag name: $tagname" 1>&2 exit $EXIT_FAILURE ;; esac case $tagname in CC) # Don't test for the "default" C tag, as we know, it's there, but # not specially marked. ;; *) if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$progpath" > /dev/null; then taglist="$taglist $tagname" # Evaluate the configuration. eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $progpath`" else $echo "$progname: ignoring unknown tag $tagname" 1>&2 fi ;; esac ;; *) eval "$prev=\$arg" ;; esac prev= prevopt= continue fi # Have we seen a non-optional argument yet? case $arg in --help) show_help=yes ;; --version) $echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP" $echo $echo "Copyright (C) 2005 Free Software Foundation, Inc." $echo "This is free software; see the source for copying conditions. There is NO" $echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." exit $? ;; --config) ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $progpath # Now print the configurations for the tags. for tagname in $taglist; do ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath" done exit $? ;; --debug) $echo "$progname: enabling shell trace mode" set -x preserve_args="$preserve_args $arg" ;; --dry-run | -n) run=: ;; --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 $? ;; --finish) mode="finish" ;; --mode) prevopt="--mode" prev=mode ;; --mode=*) mode="$optarg" ;; --preserve-dup-deps) duplicate_deps="yes" ;; --quiet | --silent) show=: preserve_args="$preserve_args $arg" ;; --tag) prevopt="--tag" prev=tag preserve_args="$preserve_args --tag" ;; --tag=*) set tag "$optarg" ${1+"$@"} shift prev=tag preserve_args="$preserve_args --tag" ;; -dlopen) prevopt="-dlopen" prev=execute_dlfiles ;; -*) $echo "$modename: unrecognized option \`$arg'" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE ;; *) nonopt="$arg" break ;; esac done if test -n "$prevopt"; then $echo "$modename: option \`$prevopt' requires an argument" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi case $disable_libs in no) ;; shared) build_libtool_libs=no build_old_libs=yes ;; static) build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` ;; esac # 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= if test -z "$show_help"; then # Infer the operation mode. if test -z "$mode"; then $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2 $echo "*** Future versions of Libtool will require --mode=MODE be specified." 1>&2 case $nonopt in *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*) mode=link for arg do case $arg in -c) mode=compile break ;; esac done ;; *db | *dbx | *strace | *truss) mode=execute ;; *install*|cp|mv) mode=install ;; *rm) mode=uninstall ;; *) # If we have no mode, but dlfiles were specified, then do execute mode. test -n "$execute_dlfiles" && mode=execute # Just use the default operation mode. if test -z "$mode"; then if test -n "$nonopt"; then $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2 else $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2 fi fi ;; esac fi # Only execute mode is allowed to have -dlopen flags. if test -n "$execute_dlfiles" && test "$mode" != execute; then $echo "$modename: unrecognized option \`-dlopen'" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi # Change the help message to a mode-specific one. generic_help="$help" help="Try \`$modename --help --mode=$mode' for more information." # These modes are in order of execution frequency so that they run quickly. case $mode in # libtool compile mode compile) modename="$modename: compile" # 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= 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) if test -n "$libobj" ; then $echo "$modename: you cannot specify \`-o' more than once" 1>&2 exit $EXIT_FAILURE fi arg_mode=target continue ;; -static | -prefer-pic | -prefer-non-pic) later="$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,*) args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"` lastarg= save_ifs="$IFS"; IFS=',' for arg in $args; do IFS="$save_ifs" # Double-quote args containing other shell metacharacters. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac lastarg="$lastarg $arg" done IFS="$save_ifs" lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"` # Add the arguments to base_compile. base_compile="$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. lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"` case $lastarg in # Double-quote args containing other shell metacharacters. # Many Bourne shells cannot handle close brackets correctly # in scan sets, and some SunOS ksh mistreat backslash-escaping # in scan sets (worked around with variable expansion), # and furthermore cannot handle '|' '&' '(' ')' in scan sets # at all, so we specify them separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") lastarg="\"$lastarg\"" ;; esac base_compile="$base_compile $lastarg" done # for arg case $arg_mode in arg) $echo "$modename: you must specify an argument for -Xcompile" exit $EXIT_FAILURE ;; target) $echo "$modename: you must specify a target with \`-o'" 1>&2 exit $EXIT_FAILURE ;; *) # Get the name of the library object. [ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'` ;; esac # Recognize several different file suffixes. # If the user specifies -o file.o, it is replaced with file.lo xform='[cCFSifmso]' case $libobj in *.ada) xform=ada ;; *.adb) xform=adb ;; *.ads) xform=ads ;; *.asm) xform=asm ;; *.c++) xform=c++ ;; *.cc) xform=cc ;; *.ii) xform=ii ;; *.class) xform=class ;; *.cpp) xform=cpp ;; *.cxx) xform=cxx ;; *.f90) xform=f90 ;; *.for) xform=for ;; *.java) xform=java ;; esac libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"` case $libobj in *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;; *) $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2 exit $EXIT_FAILURE ;; esac func_infer_tag $base_compile for arg in $later; do case $arg in -static) build_old_libs=yes continue ;; -prefer-pic) pic_mode=yes continue ;; -prefer-non-pic) pic_mode=no continue ;; esac done qlibobj=`$echo "X$libobj" | $Xsed -e "$sed_quote_subst"` case $qlibobj in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") qlibobj="\"$qlibobj\"" ;; esac test "X$libobj" != "X$qlibobj" \ && $echo "X$libobj" | grep '[]~#^*{};<>?"'"'"' &()|`$[]' \ && $echo "$modename: libobj name \`$libobj' may not contain shell special characters." objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'` xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'` if test "X$xdir" = "X$obj"; then xdir= else xdir=$xdir/ fi lobj=${xdir}$objdir/$objname if test -z "$base_compile"; then $echo "$modename: you must specify a compilation command" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi # 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 $run $rm $removelist trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15 # On Cygwin there's no "real" PIC flag so we must build both object types case $host_os in cygwin* | mingw* | pw32* | os2*) pic_mode=default ;; esac if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then # non-PIC code in shared libraries is not supported pic_mode=default fi # Calculate the filename of the output object if compiler does # not support -o with -c if test "$compiler_c_o" = no; then output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext} lockfile="$output_obj.lock" removelist="$removelist $output_obj $lockfile" trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15 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 $run ln "$progpath" "$lockfile" 2>/dev/null; do $show "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." $run $rm $removelist exit $EXIT_FAILURE fi $echo "$srcfile" > "$lockfile" fi if test -n "$fix_srcfile_path"; then eval srcfile=\"$fix_srcfile_path\" fi qsrcfile=`$echo "X$srcfile" | $Xsed -e "$sed_quote_subst"` case $qsrcfile in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") qsrcfile="\"$qsrcfile\"" ;; esac $run $rm "$libobj" "${libobj}T" # Create a libtool object file (analogous to a ".la" file), # but don't create it if we're doing a dry run. test -z "$run" && cat > ${libobj}T </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." $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 $show "$mv $output_obj $lobj" if $run $mv $output_obj $lobj; then : else error=$? $run $rm $removelist exit $error fi fi # Append the name of the PIC object to the libtool object file. test -z "$run" && cat >> ${libobj}T <> ${libobj}T </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." $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 $show "$mv $output_obj $obj" if $run $mv $output_obj $obj; then : else error=$? $run $rm $removelist exit $error fi fi # Append the name of the non-PIC object the libtool object file. # Only append if the libtool object file exists. test -z "$run" && cat >> ${libobj}T <> ${libobj}T <&2 fi if test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes else if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=built fi 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 case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test ;; *) qarg=$arg ;; esac libtool_args="$libtool_args $qarg" # If the previous option needs an argument, assign it. if test -n "$prev"; then case $prev in output) compile_command="$compile_command @OUTPUT@" finalize_command="$finalize_command @OUTPUT@" ;; esac case $prev in dlfiles|dlprefiles) if test "$preload" = no; then # Add the symbol object into the linking commands. compile_command="$compile_command @SYMFILE@" finalize_command="$finalize_command @SYMFILE@" preload=yes fi case $arg in *.la | *.lo) ;; # We handle these cases below. force) if test "$dlself" = no; then dlself=needless export_dynamic=yes fi prev= continue ;; self) if test "$prev" = dlprefiles; then dlself=yes elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then dlself=yes else dlself=needless export_dynamic=yes fi prev= continue ;; *) if test "$prev" = dlfiles; then dlfiles="$dlfiles $arg" else dlprefiles="$dlprefiles $arg" fi prev= continue ;; esac ;; expsyms) export_symbols="$arg" if test ! -f "$arg"; then $echo "$modename: symbol file \`$arg' does not exist" exit $EXIT_FAILURE fi prev= continue ;; expsyms_regex) export_symbols_regex="$arg" prev= continue ;; inst_prefix) inst_prefix_dir="$arg" prev= continue ;; precious_regex) precious_files_regex="$arg" prev= continue ;; release) release="-$arg" prev= continue ;; objectlist) if test -f "$arg"; then save_arg=$arg moreargs= for fil in `cat $save_arg` do # moreargs="$moreargs $fil" arg=$fil # A libtool-controlled object. # Check to see that this really is a libtool object. if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then pic_object= non_pic_object= # Read the .lo file # If there is no directory component, then add one. case $arg in */* | *\\*) . $arg ;; *) . ./$arg ;; esac if test -z "$pic_object" || \ test -z "$non_pic_object" || test "$pic_object" = none && \ test "$non_pic_object" = none; then $echo "$modename: cannot find name of object for \`$arg'" 1>&2 exit $EXIT_FAILURE fi # Extract subdirectory from the argument. xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` if test "X$xdir" = "X$arg"; then xdir= else xdir="$xdir/" fi if test "$pic_object" != none; then # Prepend the subdirectory the object is found in. pic_object="$xdir$pic_object" if test "$prev" = dlfiles; then if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then dlfiles="$dlfiles $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test "$prev" = dlprefiles; then # Preload the old-style object. dlprefiles="$dlprefiles $pic_object" prev= fi # A PIC object. libobjs="$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 non_pic_objects="$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" non_pic_objects="$non_pic_objects $non_pic_object" fi else # Only an error if not doing a dry-run. if test -z "$run"; then $echo "$modename: \`$arg' is not a valid libtool object" 1>&2 exit $EXIT_FAILURE else # Dry-run case. # Extract subdirectory from the argument. xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` if test "X$xdir" = "X$arg"; then xdir= else xdir="$xdir/" fi pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"` non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"` libobjs="$libobjs $pic_object" non_pic_objects="$non_pic_objects $non_pic_object" fi fi done else $echo "$modename: link input file \`$save_arg' does not exist" exit $EXIT_FAILURE fi arg=$save_arg prev= continue ;; rpath | xrpath) # We need an absolute path. case $arg in [\\/]* | [A-Za-z]:[\\/]*) ;; *) $echo "$modename: only absolute run-paths are allowed" 1>&2 exit $EXIT_FAILURE ;; esac if test "$prev" = rpath; then case "$rpath " in *" $arg "*) ;; *) rpath="$rpath $arg" ;; esac else case "$xrpath " in *" $arg "*) ;; *) xrpath="$xrpath $arg" ;; esac fi prev= continue ;; xcompiler) compiler_flags="$compiler_flags $qarg" prev= compile_command="$compile_command $qarg" finalize_command="$finalize_command $qarg" continue ;; xlinker) linker_flags="$linker_flags $qarg" compiler_flags="$compiler_flags $wl$qarg" prev= compile_command="$compile_command $wl$qarg" finalize_command="$finalize_command $wl$qarg" continue ;; xcclinker) linker_flags="$linker_flags $qarg" compiler_flags="$compiler_flags $qarg" prev= compile_command="$compile_command $qarg" finalize_command="$finalize_command $qarg" continue ;; shrext) shrext_cmds="$arg" prev= continue ;; darwin_framework|darwin_framework_skip) test "$prev" = "darwin_framework" && compiler_flags="$compiler_flags $arg" compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" prev= 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 compile_command="$compile_command $link_static_flag" finalize_command="$finalize_command $link_static_flag" fi continue ;; -allow-undefined) # FIXME: remove this flag sometime in the future. $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2 continue ;; -avoid-version) avoid_version=yes continue ;; -dlopen) prev=dlfiles continue ;; -dlpreopen) prev=dlprefiles continue ;; -export-dynamic) export_dynamic=yes continue ;; -export-symbols | -export-symbols-regex) if test -n "$export_symbols" || test -n "$export_symbols_regex"; then $echo "$modename: more than one -exported-symbols argument is not allowed" exit $EXIT_FAILURE fi if test "X$arg" = "X-export-symbols"; then prev=expsyms else prev=expsyms_regex fi continue ;; -framework|-arch|-isysroot) case " $CC " in *" ${arg} ${1} "* | *" ${arg} ${1} "*) prev=darwin_framework_skip ;; *) compiler_flags="$compiler_flags $arg" prev=darwin_framework ;; esac compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" 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*) compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" ;; esac continue ;; -L*) dir=`$echo "X$arg" | $Xsed -e 's/^-L//'` # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) absdir=`cd "$dir" && pwd` if test -z "$absdir"; then $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2 absdir="$dir" notinst_path="$notinst_path $dir" fi dir="$absdir" ;; esac case "$deplibs " in *" -L$dir "*) ;; *) deplibs="$deplibs -L$dir" lib_search_path="$lib_search_path $dir" ;; esac case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) testbindir=`$echo "X$dir" | $Xsed -e 's*/lib$*/bin*'` case :$dllsearchpath: in *":$dir:"*) ;; *) dllsearchpath="$dllsearchpath:$dir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; *) dllsearchpath="$dllsearchpath:$testbindir";; esac ;; esac continue ;; -l*) if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos*) # These systems don't actually have a C or math library (as such) continue ;; *-*-os2*) # These systems don't actually have a C library (as such) test "X$arg" = "X-lc" && continue ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc due to us having libc/libc_r. test "X$arg" = "X-lc" && continue ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C and math libraries are in the System framework deplibs="$deplibs -framework System" continue ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype test "X$arg" = "X-lc" && continue ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work test "X$arg" = "X-lc" && continue ;; esac elif test "X$arg" = "X-lc_r"; then case $host in *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc_r directly, use -pthread flag. continue ;; esac fi deplibs="$deplibs $arg" continue ;; # Tru64 UNIX uses -model [arg] to determine the layout of C++ # classes, name mangling, and exception handling. -model) compile_command="$compile_command $arg" compiler_flags="$compiler_flags $arg" finalize_command="$finalize_command $arg" prev=xcompiler continue ;; -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe) compiler_flags="$compiler_flags $arg" compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" continue ;; -module) module=yes continue ;; # -64, -mips[0-9] enable 64-bit mode on the SGI compiler # -r[0-9][0-9]* specifies the processor on the SGI compiler # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler # +DA*, +DD* enable 64-bit mode on the HP compiler # -q* pass through compiler args for the IBM compiler # -m* pass through architecture-specific compiler args for GCC # -m*, -t[45]*, -txscale* pass through architecture-specific # compiler args for GCC # -pg pass through profiling flag for GCC # @file GCC response files -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*|-pg| \ -t[45]*|-txscale*|@*) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" compiler_flags="$compiler_flags $arg" continue ;; -shrext) prev=shrext continue ;; -no-fast-install) fast_install=no continue ;; -no-install) case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) # The PATH hackery in wrapper scripts is required on Windows # in order for the loader to find any dlls it needs. $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2 $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2 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*) dir=`$echo "X$arg" | $Xsed -e 's/^-R//'` # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) $echo "$modename: only absolute run-paths are allowed" 1>&2 exit $EXIT_FAILURE ;; esac case "$xrpath " in *" $dir "*) ;; *) xrpath="$xrpath $dir" ;; esac continue ;; -static) # 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 ;; -Wc,*) args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'` arg= save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" case $flag in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") flag="\"$flag\"" ;; esac arg="$arg $wl$flag" compiler_flags="$compiler_flags $flag" done IFS="$save_ifs" arg=`$echo "X$arg" | $Xsed -e "s/^ //"` ;; -Wl,*) args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'` arg= save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" case $flag in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") flag="\"$flag\"" ;; esac arg="$arg $wl$flag" compiler_flags="$compiler_flags $wl$flag" linker_flags="$linker_flags $flag" done IFS="$save_ifs" arg=`$echo "X$arg" | $Xsed -e "s/^ //"` ;; -Xcompiler) prev=xcompiler continue ;; -Xlinker) prev=xlinker continue ;; -XCClinker) prev=xcclinker continue ;; # Some other compiler flag. -* | +*) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac ;; *.$objext) # A standard object. objs="$objs $arg" ;; *.lo) # A libtool-controlled object. # Check to see that this really is a libtool object. if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then pic_object= non_pic_object= # Read the .lo file # If there is no directory component, then add one. case $arg in */* | *\\*) . $arg ;; *) . ./$arg ;; esac if test -z "$pic_object" || \ test -z "$non_pic_object" || test "$pic_object" = none && \ test "$non_pic_object" = none; then $echo "$modename: cannot find name of object for \`$arg'" 1>&2 exit $EXIT_FAILURE fi # Extract subdirectory from the argument. xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` if test "X$xdir" = "X$arg"; then xdir= else xdir="$xdir/" fi if test "$pic_object" != none; then # Prepend the subdirectory the object is found in. pic_object="$xdir$pic_object" if test "$prev" = dlfiles; then if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then dlfiles="$dlfiles $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test "$prev" = dlprefiles; then # Preload the old-style object. dlprefiles="$dlprefiles $pic_object" prev= fi # A PIC object. libobjs="$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 non_pic_objects="$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" non_pic_objects="$non_pic_objects $non_pic_object" fi else # Only an error if not doing a dry-run. if test -z "$run"; then $echo "$modename: \`$arg' is not a valid libtool object" 1>&2 exit $EXIT_FAILURE else # Dry-run case. # Extract subdirectory from the argument. xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` if test "X$xdir" = "X$arg"; then xdir= else xdir="$xdir/" fi pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"` non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"` libobjs="$libobjs $pic_object" non_pic_objects="$non_pic_objects $non_pic_object" fi fi ;; *.$libext) # An archive. deplibs="$deplibs $arg" old_deplibs="$old_deplibs $arg" continue ;; *.la) # A libtool-controlled library. if test "$prev" = dlfiles; then # This library was specified with -dlopen. dlfiles="$dlfiles $arg" prev= elif test "$prev" = dlprefiles; then # The library was specified with -dlpreopen. dlprefiles="$dlprefiles $arg" prev= else deplibs="$deplibs $arg" fi continue ;; # Some other compiler argument. *) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac ;; esac # arg # Now actually substitute the argument into the commands. if test -n "$arg"; then compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" fi done # argument parsing loop if test -n "$prev"; then $echo "$modename: the \`$prevarg' option requires an argument" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then eval arg=\"$export_dynamic_flag_spec\" compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" fi oldlibs= # calculate the name of the file, without its directory outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'` libobjs_save="$libobjs" if test -n "$shlibpath_var"; then # get the directories listed in $shlibpath_var eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\` else shlib_search_path= fi eval sys_lib_search_path=\"$sys_lib_search_path_spec\" eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'` if test "X$output_objdir" = "X$output"; then output_objdir="$objdir" else output_objdir="$output_objdir/$objdir" fi # Create the object directory. if test ! -d "$output_objdir"; then $show "$mkdir $output_objdir" $run $mkdir $output_objdir exit_status=$? if test "$exit_status" -ne 0 && test ! -d "$output_objdir"; then exit $exit_status fi fi # Determine the type of output case $output in "") $echo "$modename: you must specify an output file" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE ;; *.$libext) linkmode=oldlib ;; *.lo | *.$objext) linkmode=obj ;; *.la) linkmode=lib ;; *) linkmode=prog ;; # Anything else should be a program. esac case $host in *cygwin* | *mingw* | *pw32*) # don't eliminate duplications in $postdeps and $predeps duplicate_compiler_generated_deps=yes ;; *) duplicate_compiler_generated_deps=$duplicate_deps ;; 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 test "X$duplicate_deps" = "Xyes" ; then case "$libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi libs="$libs $deplib" done if test "$linkmode" = lib; then libs="$predeps $libs $compiler_lib_search_path $postdeps" # Compute libraries that are listed more than once in $predeps # $postdeps and mark them as special (i.e., whose duplicates are # not to be eliminated). pre_post_deps= if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then for pre_post_dep in $predeps $postdeps; do case "$pre_post_deps " in *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;; esac pre_post_deps="$pre_post_deps $pre_post_dep" done fi pre_post_deps= fi deplibs= newdependency_libs= newlib_search_path= need_relink=no # whether we're linking any uninstalled libtool libraries notinst_deplibs= # not-installed libtool libraries case $linkmode in lib) passes="conv link" for file in $dlfiles $dlprefiles; do case $file in *.la) ;; *) $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2 exit $EXIT_FAILURE ;; 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 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 "$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) if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else compiler_flags="$compiler_flags $deplib" fi continue ;; -l*) if test "$linkmode" != lib && test "$linkmode" != prog; then $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2 continue fi name=`$echo "X$deplib" | $Xsed -e 's/^-l//'` for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; 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 (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then library_names= old_library= case $lib in */* | *\\*) . $lib ;; *) . ./$lib ;; esac 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 ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'` test "X$ladir" = "X$lib" && ladir="." 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 -L*) case $linkmode in lib) deplibs="$deplib $deplibs" test "$pass" = conv && continue newdependency_libs="$deplib $newdependency_libs" newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` ;; 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 newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` ;; *) $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2 ;; esac # linkmode continue ;; # -L -R*) if test "$pass" = link; then dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'` # Make sure the xrpath contains only unique directories. case "$xrpath " in *" $dir "*) ;; *) xrpath="$xrpath $dir" ;; esac fi deplibs="$deplib $deplibs" continue ;; *.la) lib="$deplib" ;; *.$libext) if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi case $linkmode in lib) valid_a_lib=no case $deplibs_check_method in match_pattern*) set dummy $deplibs_check_method match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` 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 used here." else $echo $echo "*** Warning: Linking the shared library $output against the" $echo "*** static library $deplib is not portable!" deplibs="$deplib $deplibs" fi continue ;; prog) if test "$pass" != link; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi continue ;; esac # linkmode ;; # *.$libext *.lo | *.$objext) if test "$pass" = conv; then deplibs="$deplib $deplibs" elif test "$linkmode" = prog; then if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlopen support or we're linking statically, # we need to preload. newdlprefiles="$newdlprefiles $deplib" compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else newdlfiles="$newdlfiles $deplib" fi fi continue ;; %DEPLIBS%) alldeplibs=yes continue ;; esac # case $deplib if test "$found" = yes || test -f "$lib"; then : else $echo "$modename: cannot find the library \`$lib' or unhandled argument \`$deplib'" 1>&2 exit $EXIT_FAILURE fi # Check to see that this really is a libtool archive. if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : else $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 exit $EXIT_FAILURE fi ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'` test "X$ladir" = "X$lib" && ladir="." dlname= dlopen= dlpreopen= libdir= library_names= old_library= # 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 case $lib in */* | *\\*) . $lib ;; *) . ./$lib ;; esac if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan" || { test "$linkmode" != prog && test "$linkmode" != lib; }; then test -n "$dlopen" && dlfiles="$dlfiles $dlopen" test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen" fi if test "$pass" = conv; then # Only check for convenience libraries deplibs="$lib $deplibs" if test -z "$libdir"; then if test -z "$old_library"; then $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 exit $EXIT_FAILURE fi # It is a libtool convenience library, so add in its objects. convenience="$convenience $ladir/$objdir/$old_library" old_convenience="$old_convenience $ladir/$objdir/$old_library" tmp_libs= for deplib in $dependency_libs; do deplibs="$deplib $deplibs" if test "X$duplicate_deps" = "Xyes" ; then case "$tmp_libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi tmp_libs="$tmp_libs $deplib" done elif test "$linkmode" != prog && test "$linkmode" != lib; then $echo "$modename: \`$lib' is not a convenience library" 1>&2 exit $EXIT_FAILURE fi continue fi # $pass = conv # Get the name of the library we link against. linklib= for l in $old_library $library_names; do linklib="$l" done if test -z "$linklib"; then $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 exit $EXIT_FAILURE fi # This library was specified with -dlopen. if test "$pass" = dlopen; then if test -z "$libdir"; then $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2 exit $EXIT_FAILURE fi if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlname, no dlopen support or we're linking # statically, we need to preload. We also need to preload any # dependent libraries so libltdl's deplib preloader doesn't # bomb out in the load deplibs phase. dlprefiles="$dlprefiles $lib $dependency_libs" else newdlfiles="$newdlfiles $lib" fi continue fi # $pass = dlopen # We need an absolute path. case $ladir in [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; *) abs_ladir=`cd "$ladir" && pwd` if test -z "$abs_ladir"; then $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2 $echo "$modename: passing it literally to the linker, although it might fail" 1>&2 abs_ladir="$ladir" fi ;; esac laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` # Find the relevant object directory and library name. if test "X$installed" = Xyes; then if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then $echo "$modename: warning: library \`$lib' was moved." 1>&2 dir="$ladir" absdir="$abs_ladir" libdir="$abs_ladir" else dir="$libdir" absdir="$libdir" fi test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes else if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then dir="$ladir" absdir="$abs_ladir" # Remove this search path later notinst_path="$notinst_path $abs_ladir" else dir="$ladir/$objdir" absdir="$abs_ladir/$objdir" # Remove this search path later notinst_path="$notinst_path $abs_ladir" fi fi # $installed = yes name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` # This library was specified with -dlpreopen. if test "$pass" = dlpreopen; then if test -z "$libdir"; then $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2 exit $EXIT_FAILURE fi # Prefer using a static library (so that no silly _DYNAMIC symbols # are required to link). if test -n "$old_library"; then newdlprefiles="$newdlprefiles $dir/$old_library" # Otherwise, use the dlname, so that lt_dlopen finds it. elif test -n "$dlname"; then newdlprefiles="$newdlprefiles $dir/$dlname" else newdlprefiles="$newdlprefiles $dir/$linklib" fi fi # $pass = dlpreopen if test -z "$libdir"; then # Link the convenience library if test "$linkmode" = lib; then deplibs="$dir/$old_library $deplibs" elif test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$dir/$old_library $compile_deplibs" finalize_deplibs="$dir/$old_library $finalize_deplibs" else deplibs="$lib $deplibs" # used for prog,scan pass fi continue fi if test "$linkmode" = prog && test "$pass" != link; then newlib_search_path="$newlib_search_path $ladir" deplibs="$lib $deplibs" linkalldeplibs=no if test "$link_all_deplibs" != no || test -z "$library_names" || test "$build_libtool_libs" = no; then linkalldeplibs=yes fi tmp_libs= for deplib in $dependency_libs; do case $deplib in -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test 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 test "X$duplicate_deps" = "Xyes" ; then case "$tmp_libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi tmp_libs="$tmp_libs $deplib" done # for deplib continue fi # $linkmode = prog... if test "$linkmode,$pass" = "prog,link"; then if test -n "$library_names" && { test "$prefer_static_libs" = no || test -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 *" $dir "*) ;; *" $absdir "*) ;; *) temp_rpath="$temp_rpath $absdir" ;; esac fi # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) compile_rpath="$compile_rpath $absdir" esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" esac ;; esac fi # $linkmode,$pass = prog,link... if test "$alldeplibs" = yes && { test "$deplibs_check_method" = pass_all || { test "$build_libtool_libs" = yes && test -n "$library_names"; }; }; then # We only need to search for static libraries continue fi fi link_static=no # Whether the deplib will be linked statically use_static_libs=$prefer_static_libs if test "$use_static_libs" = built && test "$installed" = yes ; then use_static_libs=no fi if test -n "$library_names" && { test "$use_static_libs" = no || test -z "$old_library"; }; then if test "$installed" = no; then notinst_deplibs="$notinst_deplibs $lib" need_relink=yes fi # This is a shared library # Warn about portability, can't link against -module's on # some systems (darwin) if test "$shouldnotlink" = yes && test "$pass" = link ; then $echo if test "$linkmode" = prog; then $echo "*** Warning: Linking the executable $output against the loadable module" else $echo "*** Warning: Linking the shared library $output against the loadable module" fi $echo "*** $linklib is not portable!" fi if test "$linkmode" = lib && test "$hardcode_into_libs" = yes; then # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) compile_rpath="$compile_rpath $absdir" esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" esac ;; esac fi if test -n "$old_archive_from_expsyms_cmds"; then # figure out the soname set dummy $library_names realname="$2" shift; 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*) major=`expr $current - $age` versuffix="-$major" ;; esac eval soname=\"$soname_spec\" else soname="$realname" fi # Make a new name for the extract_expsyms_cmds to use soroot="$soname" soname=`$echo $soroot | ${SED} -e 's/^.*\///'` newlib="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a" # If the library has no export list, then create one now if test -f "$output_objdir/$soname-def"; then : else $show "extracting exported symbol list from \`$soname'" save_ifs="$IFS"; IFS='~' cmds=$extract_expsyms_cmds for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" fi # Create $newlib if test -f "$output_objdir/$newlib"; then :; else $show "generating import library for \`$soname'" save_ifs="$IFS"; IFS='~' cmds=$old_archive_from_expsyms_cmds for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" fi # make sure the library variables are pointing to the new library dir=$output_objdir linklib=$newlib fi # test -n "$old_archive_from_expsyms_cmds" if test "$linkmode" = prog || test "$mode" != relink; then add_shlibpath= add_dir= add= lib_linked=yes case $hardcode_action in immediate | unsupported) if test "$hardcode_direct" = no; then add="$dir/$linklib" case $host in *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;; *-*-sysv4*uw2*) add_dir="-L$dir" ;; *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ *-*-unixware7*) add_dir="-L$dir" ;; *-*-darwin* ) # if the lib is a module then we can not link against # it, someone is ignoring the new warnings I added if /usr/bin/file -L $add 2> /dev/null | $EGREP ": [^:]* bundle" >/dev/null ; 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 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; then add="$dir/$linklib" elif test "$hardcode_minus_L" = yes; then add_dir="-L$dir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) add_dir="$add_dir -L$inst_prefix_dir$libdir" ;; esac fi add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then add_shlibpath="$dir" add="-l$name" else lib_linked=no fi ;; *) lib_linked=no ;; esac if test "$lib_linked" != yes; then $echo "$modename: configuration error: unsupported hardcode properties" exit $EXIT_FAILURE fi if test -n "$add_shlibpath"; then case :$compile_shlibpath: in *":$add_shlibpath:"*) ;; *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;; esac fi if test "$linkmode" = prog; then test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" test -n "$add" && compile_deplibs="$add $compile_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" if test "$hardcode_direct" != yes && \ test "$hardcode_minus_L" != yes && \ test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; esac fi fi fi if test "$linkmode" = prog || test "$mode" = relink; then add_shlibpath= add_dir= add= # Finalize command for both is simple: just hardcode it. if test "$hardcode_direct" = yes; then add="$libdir/$linklib" elif test "$hardcode_minus_L" = yes; then add_dir="-L$libdir" add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; esac add="-l$name" elif test "$hardcode_automatic" = yes; then if test -n "$inst_prefix_dir" && test -f "$inst_prefix_dir$libdir/$linklib" ; then add="$inst_prefix_dir$libdir/$linklib" else add="$libdir/$linklib" fi else # We cannot seem to hardcode it, guess we'll fake it. add_dir="-L$libdir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) add_dir="$add_dir -L$inst_prefix_dir$libdir" ;; esac fi add="-l$name" fi if test "$linkmode" = prog; then test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" test -n "$add" && finalize_deplibs="$add $finalize_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" fi fi elif test "$linkmode" = prog; then # Here we assume that one of hardcode_direct or hardcode_minus_L # is not unsupported. This is valid on all known static and # shared platforms. if test "$hardcode_direct" != unsupported; then test -n "$old_library" && linklib="$old_library" compile_deplibs="$dir/$linklib $compile_deplibs" finalize_deplibs="$dir/$linklib $finalize_deplibs" else compile_deplibs="-l$name -L$dir $compile_deplibs" finalize_deplibs="-l$name -L$dir $finalize_deplibs" fi elif test "$build_libtool_libs" = yes; then # Not a shared library if test "$deplibs_check_method" != pass_all; then # We're trying link a shared library against a static one # but the system doesn't support it. # Just print a warning and add the library to dependency_libs so # that the program can be linked against the static library. $echo $echo "*** Warning: This system can not link to static lib archive $lib." $echo "*** I have the capability to make that library automatically link in when" $echo "*** you link to this library. But I can only do this if you have a" $echo "*** shared version of the library, which you do not appear to have." if test "$module" = yes; then $echo "*** But as you try to build a module library, libtool will still create " $echo "*** a static module, that should work as long as the dlopening application" $echo "*** is linked with the -dlopen flag to resolve symbols at runtime." if test -z "$global_symbol_pipe"; then $echo $echo "*** However, this would only work if libtool was able to extract symbol" $echo "*** lists from a program, using \`nm' or equivalent, but libtool could" $echo "*** not find such a program. So, this module is probably useless." $echo "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi else deplibs="$dir/$old_library $deplibs" link_static=yes fi fi # link shared/static library? if test "$linkmode" = lib; then if test -n "$dependency_libs" && { test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes || test "$link_static" = yes; }; then # Extract -R from dependency_libs temp_deplibs= for libdir in $dependency_libs; do case $libdir in -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'` case " $xrpath " in *" $temp_xrpath "*) ;; *) xrpath="$xrpath $temp_xrpath";; esac;; *) temp_deplibs="$temp_deplibs $libdir";; esac done dependency_libs="$temp_deplibs" fi newlib_search_path="$newlib_search_path $absdir" # Link against this library test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" # ... and its dependency_libs tmp_libs= for deplib in $dependency_libs; do newdependency_libs="$deplib $newdependency_libs" if test "X$duplicate_deps" = "Xyes" ; then case "$tmp_libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi tmp_libs="$tmp_libs $deplib" done if test "$link_all_deplibs" != no; then # Add the search paths of all dependency libraries for deplib in $dependency_libs; do case $deplib in -L*) path="$deplib" ;; *.la) dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'` test "X$dir" = "X$deplib" && dir="." # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; *) absdir=`cd "$dir" && pwd` if test -z "$absdir"; then $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2 absdir="$dir" fi ;; esac if grep "^installed=no" $deplib > /dev/null; then path="$absdir/$objdir" else eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` if test -z "$libdir"; then $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 exit $EXIT_FAILURE fi if test "$absdir" != "$libdir"; then $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2 fi path="$absdir" fi depdepl= case $host in *-*-darwin*) # we do not want to link against static libs, # but need to link against shared 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 "$path/$depdepl" ; then depdepl="$path/$depdepl" fi # do not add paths which are already there case " $newlib_search_path " in *" $path "*) ;; *) newlib_search_path="$newlib_search_path $path";; esac fi path="" ;; *) path="-L$path" ;; esac ;; -l*) case $host in *-*-darwin*) # Again, we only want to link against shared libraries eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"` for tmp in $newlib_search_path ; do if test -f "$tmp/lib$tmp_libs.dylib" ; then eval depdepl="$tmp/lib$tmp_libs.dylib" break fi done path="" ;; *) continue ;; esac ;; *) continue ;; esac case " $deplibs " in *" $path "*) ;; *) deplibs="$path $deplibs" ;; esac case " $deplibs " in *" $depdepl "*) ;; *) deplibs="$depdepl $deplibs" ;; esac done fi # link_all_deplibs != no fi # linkmode = lib done # for deplib in $libs dependency_libs="$newdependency_libs" if test "$pass" = dlpreopen; then # Link the dlpreopened libraries before other libraries for deplib in $save_deplibs; do deplibs="$deplib $deplibs" done fi if test "$pass" != dlopen; then if test "$pass" != conv; then # Make sure lib_search_path contains only unique directories. lib_search_path= for dir in $newlib_search_path; do case "$lib_search_path " in *" $dir "*) ;; *) lib_search_path="$lib_search_path $dir" ;; esac done newlib_search_path= fi if test "$linkmode,$pass" != "prog,link"; then vars="deplibs" else vars="compile_deplibs finalize_deplibs" fi for var in $vars dependency_libs; do # Add libraries to $var in reverse order eval tmp_libs=\"\$$var\" new_libs= for deplib in $tmp_libs; do # FIXME: Pedantically, this is the right thing to do, so # that some nasty dependency loop isn't accidentally # broken: #new_libs="$deplib $new_libs" # Pragmatically, this seems to cause very few problems in # practice: case $deplib in -L*) new_libs="$deplib $new_libs" ;; -R*) ;; *) # And here is the reason: when a library appears more # than once as an explicit dependence of a library, or # is implicitly linked in more than once by the # compiler, it is considered special, and multiple # occurrences thereof are not removed. Compare this # with having the same library being listed as a # dependency of multiple other libraries: in this case, # we know (pedantically, we assume) the library does not # need to be listed more than once, so we keep only the # last copy. This is not always right, but it is rare # enough that we require users that really mean to play # such unportable linking tricks to link the library # using -Wl,-lname, so that libtool does not consider it # for duplicate removal. case " $specialdeplibs " in *" $deplib "*) new_libs="$deplib $new_libs" ;; *) case " $new_libs " in *" $deplib "*) ;; *) new_libs="$deplib $new_libs" ;; esac ;; esac ;; esac done tmp_libs= for deplib in $new_libs; do case $deplib in -L*) case " $tmp_libs " in *" $deplib "*) ;; *) tmp_libs="$tmp_libs $deplib" ;; esac ;; *) tmp_libs="$tmp_libs $deplib" ;; esac done eval $var=\"$tmp_libs\" done # for var fi # Last step: remove runtime libs from dependency_libs # (they stay in deplibs) tmp_libs= for i in $dependency_libs ; do case " $predeps $postdeps $compiler_lib_search_path " in *" $i "*) i="" ;; esac if test -n "$i" ; then tmp_libs="$tmp_libs $i" fi done dependency_libs=$tmp_libs done # for pass if test "$linkmode" = prog; then dlfiles="$newdlfiles" dlprefiles="$newdlprefiles" fi case $linkmode in oldlib) if test -n "$deplibs"; then $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2 fi if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2 fi if test -n "$rpath"; then $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2 fi if test -n "$xrpath"; then $echo "$modename: warning: \`-R' is ignored for archives" 1>&2 fi if test -n "$vinfo"; then $echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2 fi if test -n "$release"; then $echo "$modename: warning: \`-release' is ignored for archives" 1>&2 fi if test -n "$export_symbols" || test -n "$export_symbols_regex"; then $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2 fi # Now set the variables for building old libraries. build_libtool_libs=no oldlibs="$output" objs="$objs$old_deplibs" ;; lib) # Make sure we only generate libraries of the form `libNAME.la'. case $outputname in lib*) name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" ;; *) if test "$module" = no; then $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi if test "$need_lib_prefix" != no; then # Add the "lib" prefix for modules if required name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" else libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` fi ;; esac if test -n "$objs"; then if test "$deplibs_check_method" != pass_all; then $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1 exit $EXIT_FAILURE else $echo $echo "*** Warning: Linking the shared library $output against the non-libtool" $echo "*** objects $objs is not portable!" libobjs="$libobjs $objs" fi fi if test "$dlself" != no; then $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2 fi set dummy $rpath if test "$#" -gt 2; then $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2 fi install_libdir="$2" 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 if test -n "$vinfo"; then $echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2 fi if test -n "$release"; then $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2 fi else # Parse the version information argument. save_ifs="$IFS"; IFS=':' set dummy $vinfo 0 0 0 IFS="$save_ifs" if test -n "$8"; then $echo "$modename: too many parameters to \`-version-info'" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi # 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="$2" number_minor="$3" number_revision="$4" # # There are really only two kinds -- those that # use the current revision as the major version # and those that subtract age and use age as # a minor version. But, then there is irix # which has an extra 1 added just for fun # case $version_type in darwin|linux|osf|windows) current=`expr $number_major + $number_minor` age="$number_minor" revision="$number_revision" ;; freebsd-aout|freebsd-elf|sunos) current="$number_major" revision="$number_minor" age="0" ;; irix|nonstopux) current=`expr $number_major + $number_minor - 1` age="$number_minor" revision="$number_minor" ;; esac ;; no) current="$2" revision="$3" age="$4" ;; 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]) ;; *) $echo "$modename: CURRENT \`$current' must be a nonnegative integer" 1>&2 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 exit $EXIT_FAILURE ;; 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]) ;; *) $echo "$modename: REVISION \`$revision' must be a nonnegative integer" 1>&2 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 exit $EXIT_FAILURE ;; 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]) ;; *) $echo "$modename: AGE \`$age' must be a nonnegative integer" 1>&2 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 exit $EXIT_FAILURE ;; esac if test "$age" -gt "$current"; then $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 exit $EXIT_FAILURE 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 major=.`expr $current - $age` versuffix="$major.$age.$revision" # Darwin ld doesn't like 0 for these options... minor_current=`expr $current + 1` verstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision" ;; freebsd-aout) major=".$current" versuffix=".$current.$revision"; ;; freebsd-elf) major=".$current" versuffix=".$current"; ;; irix | nonstopux) major=`expr $current - $age + 1` 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 iface=`expr $revision - $loop` loop=`expr $loop - 1` verstring="$verstring_prefix$major.$iface:$verstring" done # Before this point, $major must not contain `.'. major=.$major versuffix="$major.$revision" ;; linux) major=.`expr $current - $age` versuffix="$major.$age.$revision" ;; osf) major=.`expr $current - $age` 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 iface=`expr $current - $loop` loop=`expr $loop - 1` verstring="$verstring:${iface}.0" done # Make executables depend on our current version. verstring="$verstring:${current}.0" ;; sunos) major=".$current" versuffix=".$current.$revision" ;; windows) # Use '-' rather than '.', since we only want one # extension on DOS 8.3 filesystems. major=`expr $current - $age` versuffix="-$major" ;; *) $echo "$modename: unknown library version type \`$version_type'" 1>&2 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 exit $EXIT_FAILURE ;; 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 $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2 build_libtool_libs=no build_old_libs=yes fi else # Don't allow undefined symbols. allow_undefined_flag="$no_undefined_flag" fi fi if test "$mode" != relink; then # Remove our outputs, but don't remove object files since they # may have been created when compiling PIC objects. removelist= tempremovelist=`$echo "$output_objdir/*"` for p in $tempremovelist; do case $p in *.$objext) ;; $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) if test "X$precious_files_regex" != "X"; then if echo $p | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 then continue fi fi removelist="$removelist $p" ;; *) ;; esac done if test -n "$removelist"; then $show "${rm}r $removelist" $run ${rm}r $removelist fi fi # Now set the variables for building old libraries. if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then oldlibs="$oldlibs $output_objdir/$libname.$libext" # Transform .lo files to .o files. oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP` fi # Eliminate all temporary directories. for path in $notinst_path; do lib_search_path=`$echo "$lib_search_path " | ${SED} -e "s% $path % %g"` deplibs=`$echo "$deplibs " | ${SED} -e "s% -L$path % %g"` dependency_libs=`$echo "$dependency_libs " | ${SED} -e "s% -L$path % %g"` done if test -n "$xrpath"; then # If the user specified any rpath flags, then add them. temp_xrpath= for libdir in $xrpath; do temp_xrpath="$temp_xrpath -R$libdir" case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" ;; esac done if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then dependency_libs="$temp_xrpath $dependency_libs" fi fi # Make sure dlfiles contains only unique files that won't be dlpreopened old_dlfiles="$dlfiles" dlfiles= for lib in $old_dlfiles; do case " $dlprefiles $dlfiles " in *" $lib "*) ;; *) dlfiles="$dlfiles $lib" ;; esac done # Make sure dlprefiles contains only unique files old_dlprefiles="$dlprefiles" dlprefiles= for lib in $old_dlprefiles; do case "$dlprefiles " in *" $lib "*) ;; *) dlprefiles="$dlprefiles $lib" ;; esac done if test "$build_libtool_libs" = yes; then if test -n "$rpath"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*) # these systems don't actually have a c library (as such)! ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C library is in the System framework deplibs="$deplibs -framework System" ;; *-*-netbsd*) # Don't link with libc until the a.out ld.so is fixed. ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc due to us having libc/libc_r. ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work ;; *) # Add libc to deplibs on all other systems if necessary. if test "$build_libtool_need_lc" = "yes"; then deplibs="$deplibs -lc" fi ;; esac fi # Transform deplibs into only deplibs that can be linked in shared. name_save=$name libname_save=$libname release_save=$release versuffix_save=$versuffix major_save=$major # I'm not sure if I'm treating the release correctly. I think # release should show up in the -l (ie -lgmp5) so we don't want to # add it in twice. Is that correct? release="" versuffix="" major="" newdeplibs= droppeddeps=no case $deplibs_check_method in pass_all) # Don't check for shared/static. Everything works. # This might be a little naive. We might want to check # whether the library exists or not. But this is on # osf3 & osf4 and I'm not really sure... Just # implementing what was already the behavior. newdeplibs=$deplibs ;; test_compile) # This code stresses the "libraries are programs" paradigm to its # limits. Maybe even breaks it. We compile a program, linking it # against the deplibs as a proxy for the library. Then we can check # whether they linked in statically or dynamically with ldd. $rm conftest.c cat > conftest.c </dev/null` for potent_lib in $potential_libs; do # Follow soft links. if ls -lLd "$potent_lib" 2>/dev/null \ | grep " -> " >/dev/null; then continue fi # The statement above tries to avoid entering an # endless loop below, in case of cyclic links. # We might still enter an endless loop, since a link # loop can be closed while we follow links, # but so what? potlib="$potent_lib" while test -h "$potlib" 2>/dev/null; do potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'` case $potliblink in [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";; esac done if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \ | ${SED} 10q \ | $EGREP "$file_magic_regex" > /dev/null; then newdeplibs="$newdeplibs $a_deplib" a_deplib="" break 2 fi done done fi if test -n "$a_deplib" ; then droppeddeps=yes $echo $echo "*** Warning: linker path does not have real file for library $a_deplib." $echo "*** I have the capability to make that library automatically link in when" $echo "*** you link to this library. But I can only do this if you have a" $echo "*** shared version of the library, which you do not appear to have" $echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then $echo "*** with $libname but no candidates were found. (...for file magic test)" else $echo "*** with $libname and none of the candidates passed a file format test" $echo "*** using a file magic. Last file checked: $potlib" fi fi else # Add a -L argument. newdeplibs="$newdeplibs $a_deplib" fi done # Gone through all deplibs. ;; match_pattern*) set dummy $deplibs_check_method match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` for a_deplib in $deplibs; do name=`expr $a_deplib : '-l\(.*\)'` # If $name is empty we are operating on a -L argument. if test -n "$name" && test "$name" != "0"; then if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $a_deplib "*) newdeplibs="$newdeplibs $a_deplib" a_deplib="" ;; esac fi if test -n "$a_deplib" ; then libname=`eval \\$echo \"$libname_spec\"` for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do potential_libs=`ls $i/$libname[.-]* 2>/dev/null` for potent_lib in $potential_libs; do potlib="$potent_lib" # see symlink-check above in file_magic test if eval $echo \"$potent_lib\" 2>/dev/null \ | ${SED} 10q \ | $EGREP "$match_pattern_regex" > /dev/null; then newdeplibs="$newdeplibs $a_deplib" a_deplib="" break 2 fi done done fi if test -n "$a_deplib" ; then droppeddeps=yes $echo $echo "*** Warning: linker path does not have real file for library $a_deplib." $echo "*** I have the capability to make that library automatically link in when" $echo "*** you link to this library. But I can only do this if you have a" $echo "*** shared version of the library, which you do not appear to have" $echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then $echo "*** with $libname but no candidates were found. (...for regex pattern test)" else $echo "*** with $libname and none of the candidates passed a file format test" $echo "*** using a regex pattern. Last file checked: $potlib" fi fi else # Add a -L argument. newdeplibs="$newdeplibs $a_deplib" fi done # Gone through all deplibs. ;; none | unknown | *) newdeplibs="" tmp_deplibs=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \ -e 's/ -[LR][^ ]*//g'` if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then for i in $predeps $postdeps ; do # can't use Xsed below, because $i might contain '/' tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"` done fi if $echo "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' \ | grep . >/dev/null; then $echo if test "X$deplibs_check_method" = "Xnone"; then $echo "*** Warning: inter-library dependencies are not supported in this platform." else $echo "*** Warning: inter-library dependencies are not known to be supported." fi $echo "*** All declared inter-library dependencies are being dropped." droppeddeps=yes fi ;; esac versuffix=$versuffix_save major=$major_save release=$release_save libname=$libname_save name=$name_save case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library is the System framework newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'` ;; 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 # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $deplibs " in *" -L$path/$objdir "*) new_libs="$new_libs -L$path/$objdir" ;; esac ;; esac done for deplib in $deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) new_libs="$new_libs $deplib" ;; esac ;; *) new_libs="$new_libs $deplib" ;; esac done deplibs="$new_libs" # All the library-specific variables (install_libdir is set above). library_names= old_library= dlname= # Test again, we may have decided not to build it any more if test "$build_libtool_libs" = yes; then if test "$hardcode_into_libs" = yes; then # Hardcode the library paths hardcode_libdirs= dep_rpath= rpath="$finalize_rpath" test "$mode" != relink && rpath="$compile_rpath$rpath" for libdir in $rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" dep_rpath="$dep_rpath $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) perm_rpath="$perm_rpath $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" if test -n "$hardcode_libdir_flag_spec_ld"; then eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\" else eval dep_rpath=\"$hardcode_libdir_flag_spec\" fi fi if test -n "$runpath_var" && test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do rpath="$rpath$dir:" done eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" fi test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" fi shlibpath="$finalize_shlibpath" test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath" if test -n "$shlibpath"; then eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" fi # Get the real and link names of the library. eval shared_ext=\"$shrext_cmds\" eval library_names=\"$library_names_spec\" set dummy $library_names realname="$2" shift; shift if test -n "$soname_spec"; then eval soname=\"$soname_spec\" else soname="$realname" fi if test -z "$dlname"; then dlname=$soname fi lib="$output_objdir/$realname" linknames= for link do linknames="$linknames $link" done # Use standard objects if they are pic test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` # Prepare the list of exported symbols if test -z "$export_symbols"; then if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then $show "generating symbol list for \`$libname.la'" export_symbols="$output_objdir/$libname.exp" $run $rm $export_symbols cmds=$export_symbols_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" if len=`expr "X$cmd" : ".*"` && test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then $show "$cmd" $run eval "$cmd" || exit $? skipped_export=false else # The command line is too long to execute in one step. $show "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"; then $show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\"" $run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' $show "$mv \"${export_symbols}T\" \"$export_symbols\"" $run eval '$mv "${export_symbols}T" "$export_symbols"' fi fi fi if test -n "$export_symbols" && test -n "$include_expsyms"; then $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"' fi tmp_deplibs= for test_deplib in $deplibs; do case " $convenience " in *" $test_deplib "*) ;; *) tmp_deplibs="$tmp_deplibs $test_deplib" ;; esac done deplibs="$tmp_deplibs" if test -n "$convenience"; then if test -n "$whole_archive_flag_spec"; then save_libobjs=$libobjs eval libobjs=\"\$libobjs $whole_archive_flag_spec\" else gentop="$output_objdir/${outputname}x" generated="$generated $gentop" func_extract_archives $gentop $convenience libobjs="$libobjs $func_extract_archives_result" fi fi if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then eval flag=\"$thread_safe_flag_spec\" linker_flags="$linker_flags $flag" fi # Make a backup of the uninstalled library when relinking if test "$mode" = relink; then $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:" && len=`expr "X$test_cmds" : ".*" 2>/dev/null` && test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then : else # The command line is too long to link in one step, link piecewise. $echo "creating reloadable object files..." # Save the value of $output and $libobjs because we want to # use them later. If we have whole_archive_flag_spec, we # want to use save_libobjs as it was before # whole_archive_flag_spec was expanded, because we can't # assume the linker understands whole_archive_flag_spec. # This may have to be revisited, in case too many # convenience libraries get linked in and end up exceeding # the spec. if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then save_libobjs=$libobjs fi save_output=$output output_la=`$echo "X$output" | $Xsed -e "$basename"` # Clear the reloadable object creation command queue and # initialize k to one. test_cmds= concat_cmds= objlist= delfiles= last_robj= k=1 output=$output_objdir/$output_la-${k}.$objext # Loop over the list of objects to be linked. for obj in $save_libobjs do eval test_cmds=\"$reload_cmds $objlist $last_robj\" if test "X$objlist" = X || { len=`expr "X$test_cmds" : ".*" 2>/dev/null` && test "$len" -le "$max_cmd_len"; }; then objlist="$objlist $obj" else # The command $test_cmds is almost too long, add a # command to the queue. if test "$k" -eq 1 ; then # The first file doesn't have a previous command to add. eval concat_cmds=\"$reload_cmds $objlist $last_robj\" else # All subsequent reloadable object files will link in # the last one created. eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\" fi last_robj=$output_objdir/$output_la-${k}.$objext k=`expr $k + 1` output=$output_objdir/$output_la-${k}.$objext objlist=$obj len=1 fi done # Handle the remaining objects by creating one last # reloadable object file. All subsequent reloadable object # files will link in the last one created. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\" if ${skipped_export-false}; then $show "generating symbol list for \`$libname.la'" export_symbols="$output_objdir/$libname.exp" $run $rm $export_symbols libobjs=$output # Append the command to create the export file. eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\" fi # Set up a command to remove the reloadable object files # after they are used. i=0 while test "$i" -lt "$k" do i=`expr $i + 1` delfiles="$delfiles $output_objdir/$output_la-${i}.$objext" done $echo "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" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" 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\" 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 # Append the command to remove the reloadable object files # to the just-reset $cmds. eval cmds=\"\$cmds~\$rm $delfiles\" fi save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test "$mode" = relink; then $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)' fi exit $lt_exit } done IFS="$save_ifs" # Restore the uninstalled library and exit if test "$mode" = relink; then $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 $show "${rm}r $gentop" $run ${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 $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)" $run 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 "$deplibs"; then $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2 fi if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2 fi if test -n "$rpath"; then $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2 fi if test -n "$xrpath"; then $echo "$modename: warning: \`-R' is ignored for objects" 1>&2 fi if test -n "$vinfo"; then $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2 fi if test -n "$release"; then $echo "$modename: warning: \`-release' is ignored for objects" 1>&2 fi case $output in *.lo) if test -n "$objs$old_deplibs"; then $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2 exit $EXIT_FAILURE fi libobj="$output" obj=`$echo "X$output" | $Xsed -e "$lo2o"` ;; *) libobj= obj="$output" ;; esac # Delete the old objects. $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 wl= if test -n "$convenience"; then if test -n "$whole_archive_flag_spec"; then eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\" else gentop="$output_objdir/${obj}x" generated="$generated $gentop" func_extract_archives $gentop $convenience reload_conv_objs="$reload_objs $func_extract_archives_result" fi fi # Create the old-style object. reload_objs="$objs$old_deplibs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test output="$obj" cmds=$reload_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" # Exit if we aren't doing a library object file. if test -z "$libobj"; then if test -n "$gentop"; then $show "${rm}r $gentop" $run ${rm}r $gentop fi exit $EXIT_SUCCESS fi if test "$build_libtool_libs" != yes; then if test -n "$gentop"; then $show "${rm}r $gentop" $run ${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" # $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" cmds=$reload_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" fi if test -n "$gentop"; then $show "${rm}r $gentop" $run ${rm}r $gentop fi exit $EXIT_SUCCESS ;; prog) case $host in *cygwin*) output=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;; esac if test -n "$vinfo"; then $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2 fi if test -n "$release"; then $echo "$modename: warning: \`-release' is ignored for programs" 1>&2 fi if test "$preload" = yes; then if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown && test "$dlopen_self_static" = unknown; then $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support." fi fi case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library is the System framework compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'` finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'` ;; esac case $host in *darwin*) # Don't allow lazy linking, it breaks C++ global constructors if test "$tagname" = CXX ; then compile_command="$compile_command ${wl}-bind_at_load" finalize_command="$finalize_command ${wl}-bind_at_load" fi ;; esac # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $compile_deplibs " in *" -L$path/$objdir "*) new_libs="$new_libs -L$path/$objdir" ;; esac ;; esac done for deplib in $compile_deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) new_libs="$new_libs $deplib" ;; esac ;; *) new_libs="$new_libs $deplib" ;; esac done compile_deplibs="$new_libs" compile_command="$compile_command $compile_deplibs" finalize_command="$finalize_command $finalize_deplibs" if test -n "$rpath$xrpath"; then # If the user specified any rpath flags, then add them. for libdir in $rpath $xrpath; do # This is the magic to use -rpath. case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" ;; esac done fi # Now hardcode the library paths rpath= hardcode_libdirs= for libdir in $compile_rpath $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" rpath="$rpath $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) perm_rpath="$perm_rpath $libdir" ;; esac fi case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) testbindir=`$echo "X$libdir" | $Xsed -e 's*/lib$*/bin*'` case :$dllsearchpath: in *":$libdir:"*) ;; *) dllsearchpath="$dllsearchpath:$libdir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; *) dllsearchpath="$dllsearchpath:$testbindir";; esac ;; esac done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi compile_rpath="$rpath" rpath= hardcode_libdirs= for libdir in $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" rpath="$rpath $flag" fi elif test -n "$runpath_var"; then case "$finalize_perm_rpath " in *" $libdir "*) ;; *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi finalize_rpath="$rpath" if test -n "$libobjs" && test "$build_old_libs" = yes; then # Transform all the library objects into standard objects. compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` fi dlsyms= if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then if test -n "$NM" && test -n "$global_symbol_pipe"; then dlsyms="${outputname}S.c" else $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2 fi fi if test -n "$dlsyms"; then case $dlsyms in "") ;; *.c) # Discover the nlist of each of the dlfiles. nlist="$output_objdir/${outputname}.nm" $show "$rm $nlist ${nlist}S ${nlist}T" $run $rm "$nlist" "${nlist}S" "${nlist}T" # Parse the name list into a source file. $show "creating $output_objdir/$dlsyms" test -z "$run" && $echo > "$output_objdir/$dlsyms" "\ /* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */ /* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */ #ifdef __cplusplus extern \"C\" { #endif /* Prevent the only kind of declaration conflicts we can make. */ #define lt_preloaded_symbols some_other_symbol /* External symbol declarations for the compiler. */\ " if test "$dlself" = yes; then $show "generating symbol list for \`$output'" test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist" # Add our own program objects to the symbol list. progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` for arg in $progfiles; do $show "extracting global C symbols from \`$arg'" $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" done if test -n "$exclude_expsyms"; then $run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' $run eval '$mv "$nlist"T "$nlist"' fi if test -n "$export_symbols_regex"; then $run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' $run eval '$mv "$nlist"T "$nlist"' fi # Prepare the list of exported symbols if test -z "$export_symbols"; then export_symbols="$output_objdir/$outputname.exp" $run $rm $export_symbols $run eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' case $host in *cygwin* | *mingw* ) $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' $run eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' ;; esac else $run eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' $run eval 'grep -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' $run eval 'mv "$nlist"T "$nlist"' case $host in *cygwin* | *mingw* ) $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' $run eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' ;; esac fi fi for arg in $dlprefiles; do $show "extracting global C symbols from \`$arg'" name=`$echo "$arg" | ${SED} -e 's%^.*/%%'` $run eval '$echo ": $name " >> "$nlist"' $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" done if test -z "$run"; then # 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/$dlsyms"' else $echo '/* NONE */' >> "$output_objdir/$dlsyms" fi $echo >> "$output_objdir/$dlsyms" "\ #undef lt_preloaded_symbols #if defined (__STDC__) && __STDC__ # define lt_ptr void * #else # define lt_ptr char * # define const #endif /* The mapping between symbol names and symbols. */ " case $host in *cygwin* | *mingw* ) $echo >> "$output_objdir/$dlsyms" "\ /* DATA imports from DLLs on WIN32 can't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs */ struct { " ;; * ) $echo >> "$output_objdir/$dlsyms" "\ const struct { " ;; esac $echo >> "$output_objdir/$dlsyms" "\ const char *name; lt_ptr address; } lt_preloaded_symbols[] = {\ " eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms" $echo >> "$output_objdir/$dlsyms" "\ {0, (lt_ptr) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt_preloaded_symbols; } #endif #ifdef __cplusplus } #endif\ " fi pic_flag_for_symtable= 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*) case "$compile_command " in *" -static "*) ;; *) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND";; esac;; *-*-hpux*) case "$compile_command " in *" -static "*) ;; *) pic_flag_for_symtable=" $pic_flag";; esac esac # Now compile the dynamic symbol file. $show "(cd $output_objdir && $LTCC $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")" $run eval '(cd $output_objdir && $LTCC $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $? # Clean up the generated files. $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T" $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T" # Transform the symbol file into the correct name. case $host in *cygwin* | *mingw* ) if test -f "$output_objdir/${outputname}.def" ; then compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%"` finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%"` else compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` fi ;; * ) compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` ;; esac ;; *) $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2 exit $EXIT_FAILURE ;; esac else # We keep going just in case the user didn't refer to # lt_preloaded_symbols. The linker will fail if global_symbol_pipe # really was required. # Nullify the symbol file. compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"` finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"` fi if test "$need_relink" = no || test "$build_libtool_libs" != yes; then # Replace the output file specification. compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` link_command="$compile_command$compile_rpath" # We have no uninstalled library dependencies, so finalize right now. $show "$link_command" $run eval "$link_command" exit_status=$? # Delete the generated files. if test -n "$dlsyms"; then $show "$rm $output_objdir/${outputname}S.${objext}" $run $rm "$output_objdir/${outputname}S.${objext}" fi exit $exit_status fi if test -n "$shlibpath_var"; then # We should set the shlibpath_var rpath= for dir in $temp_rpath; do case $dir in [\\/]* | [A-Za-z]:[\\/]*) # Absolute path. rpath="$rpath$dir:" ;; *) # Relative path: add a thisdir entry. rpath="$rpath\$thisdir/$dir:" ;; esac done temp_rpath="$rpath" fi if test -n "$compile_shlibpath$finalize_shlibpath"; then compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" fi if test -n "$finalize_shlibpath"; then finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" fi compile_var= finalize_var= if test -n "$runpath_var"; then if test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do rpath="$rpath$dir:" done compile_var="$runpath_var=\"$rpath\$$runpath_var\" " fi if test -n "$finalize_perm_rpath"; then # We should set the runpath_var. rpath= for dir in $finalize_perm_rpath; do rpath="$rpath$dir:" done finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " fi fi if test "$no_install" = yes; then # We don't need to create a wrapper script. link_command="$compile_var$compile_command$compile_rpath" # Replace the output file specification. link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` # Delete the old output file. $run $rm $output # Link the executable and exit $show "$link_command" $run eval "$link_command" || exit $? exit $EXIT_SUCCESS fi if test "$hardcode_action" = relink; then # Fast installation is not supported link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2 $echo "$modename: \`$output' will be relinked during installation" 1>&2 else if test "$fast_install" != no; then link_command="$finalize_var$compile_command$finalize_rpath" if test "$fast_install" = yes; then relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'` else # fast_install is set to needless relink_command= fi else link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" fi fi # Replace the output file specification. link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` # Delete the old output files. $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname $show "$link_command" $run eval "$link_command" || exit $? # Now create the wrapper script. $show "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}\" || 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 var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"` relink_command="$var=\"$var_value\"; export $var; $relink_command" fi done relink_command="(cd `pwd`; $relink_command)" relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"` fi # Quote $echo for shipping. if test "X$echo" = "X$SHELL $progpath --fallback-echo"; then case $progpath in [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";; *) qecho="$SHELL `pwd`/$progpath --fallback-echo";; esac qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"` else qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"` fi # Only actually do things if our run command is non-null. if test -z "$run"; then # win32 will think the script is a binary if it has # a .exe suffix, so we strip it off here. case $output in *.exe) output=`$echo $output|${SED} 's,.exe$,,'` ;; esac # test for cygwin because mv fails w/o .exe extensions case $host in *cygwin*) exeext=.exe outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;; *) exeext= ;; esac case $host in *cygwin* | *mingw* ) output_name=`basename $output` output_path=`dirname $output` 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 cat > $cwrappersource <> $cwrappersource<<"EOF" #include #include #include #include #include #include #include #include #include #if defined(PATH_MAX) # define LT_PATHMAX PATH_MAX #elif defined(MAXPATHLEN) # define LT_PATHMAX MAXPATHLEN #else # define LT_PATHMAX 1024 #endif #ifndef DIR_SEPARATOR # define DIR_SEPARATOR '/' # define PATH_SEPARATOR ':' #endif #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ defined (__OS2__) # define HAVE_DOS_BASED_FILE_SYSTEM # 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 */ #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) #define XFREE(stale) do { \ if (stale) { free ((void *) stale); stale = 0; } \ } while (0) /* -DDEBUG is fairly common in CFLAGS. */ #undef DEBUG #if defined DEBUGWRAPPER # define DEBUG(format, ...) fprintf(stderr, format, __VA_ARGS__) #else # define DEBUG(format, ...) #endif const char *program_name = NULL; void * xmalloc (size_t num); char * xstrdup (const char *string); const char * base_name (const char *name); char * find_executable(const char *wrapper); int check_executable(const char *path); char * strendzap(char *str, const char *pat); void lt_fatal (const char *message, ...); int main (int argc, char *argv[]) { char **newargz; int i; program_name = (char *) xstrdup (base_name (argv[0])); DEBUG("(main) argv[0] : %s\n",argv[0]); DEBUG("(main) program_name : %s\n",program_name); newargz = XMALLOC(char *, argc+2); EOF cat >> $cwrappersource <> $cwrappersource <<"EOF" newargz[1] = find_executable(argv[0]); if (newargz[1] == NULL) lt_fatal("Couldn't find %s", argv[0]); DEBUG("(main) found exe at : %s\n",newargz[1]); /* we know the script has the same name, without the .exe */ /* so make sure newargz[1] doesn't end in .exe */ strendzap(newargz[1],".exe"); for (i = 1; i < argc; i++) newargz[i+1] = xstrdup(argv[i]); newargz[argc+1] = NULL; for (i=0; i> $cwrappersource <> $cwrappersource <> $cwrappersource <<"EOF" return 127; } void * xmalloc (size_t num) { void * p = (void *) malloc (num); if (!p) lt_fatal ("Memory exhausted"); return p; } char * xstrdup (const char *string) { return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL ; } const char * base_name (const char *name) { const char *base; #if defined (HAVE_DOS_BASED_FILE_SYSTEM) /* Skip over the disk name in MSDOS pathnames. */ if (isalpha ((unsigned char)name[0]) && name[1] == ':') name += 2; #endif for (base = name; *name; name++) if (IS_DIR_SEPARATOR (*name)) base = name + 1; return base; } int check_executable(const char * path) { struct stat st; DEBUG("(check_executable) : %s\n", path ? (*path ? path : "EMPTY!") : "NULL!"); if ((!path) || (!*path)) return 0; if ((stat (path, &st) >= 0) && ( /* MinGW & native WIN32 do not support S_IXOTH or S_IXGRP */ #if defined (S_IXOTH) ((st.st_mode & S_IXOTH) == S_IXOTH) || #endif #if defined (S_IXGRP) ((st.st_mode & S_IXGRP) == S_IXGRP) || #endif ((st.st_mode & S_IXUSR) == S_IXUSR)) ) return 1; else return 0; } /* Searches for the full path of the wrapper. Returns newly allocated full path name if found, NULL otherwise */ 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; DEBUG("(find_executable) : %s\n", wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!"); if ((wrapper == NULL) || (*wrapper == '\0')) return NULL; /* Absolute path? */ #if defined (HAVE_DOS_BASED_FILE_SYSTEM) if (isalpha ((unsigned char)wrapper[0]) && wrapper[1] == ':') { concat_name = xstrdup (wrapper); if (check_executable(concat_name)) return concat_name; XFREE(concat_name); } else { #endif if (IS_DIR_SEPARATOR (wrapper[0])) { concat_name = xstrdup (wrapper); if (check_executable(concat_name)) return concat_name; XFREE(concat_name); } #if defined (HAVE_DOS_BASED_FILE_SYSTEM) } #endif for (p = wrapper; *p; p++) if (*p == '/') { has_slash = 1; break; } if (!has_slash) { /* no slashes; search PATH */ const char* path = getenv ("PATH"); if (path != NULL) { for (p = path; *p; p = p_next) { const char* q; size_t p_len; for (q = p; *q; q++) if (IS_PATH_SEPARATOR(*q)) break; p_len = q - p; p_next = (*q == '\0' ? q : q + 1); if (p_len == 0) { /* empty path: current directory */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal ("getcwd failed"); tmp_len = strlen(tmp); concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); } else { concat_name = XMALLOC(char, p_len + 1 + strlen(wrapper) + 1); memcpy (concat_name, p, p_len); concat_name[p_len] = '/'; strcpy (concat_name + p_len + 1, wrapper); } if (check_executable(concat_name)) return concat_name; XFREE(concat_name); } } /* not found in PATH; assume curdir */ } /* Relative path | not found in path: prepend cwd */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal ("getcwd failed"); tmp_len = strlen(tmp); concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); if (check_executable(concat_name)) return concat_name; XFREE(concat_name); return NULL; } char * strendzap(char *str, const char *pat) { size_t len, patlen; assert(str != NULL); assert(pat != NULL); len = strlen(str); patlen = strlen(pat); if (patlen <= len) { str += len - patlen; if (strcmp(str, pat) == 0) *str = '\0'; } return str; } static void lt_error_core (int exit_status, const char * mode, const char * message, va_list ap) { fprintf (stderr, "%s: %s: ", program_name, mode); vfprintf (stderr, message, ap); fprintf (stderr, ".\n"); if (exit_status >= 0) exit (exit_status); } void lt_fatal (const char *message, ...) { va_list ap; va_start (ap, message); lt_error_core (EXIT_FAILURE, "FATAL", message, ap); va_end (ap); } EOF # we should really use a build-platform specific compiler # here, but OTOH, the wrappers (shell script and this C one) # are only useful if you want to execute the "real" binary. # Since the "real" binary is built for $host, then this # wrapper might as well be built for $host, too. $run $LTCC $LTCFLAGS -s -o $cwrapper $cwrappersource ;; esac $rm $output trap "$rm $output; exit $EXIT_FAILURE" 1 2 15 $echo > $output "\ #! $SHELL # $output - temporary wrapper script for $objdir/$outputname # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP # # The $output program cannot be directly executed until all the libtool # libraries that it depends on are installed. # # This wrapper script should never be moved out of the build directory. # If it is, it will not operate correctly. # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. Xsed='${SED} -e 1s/^X//' sed_quote_subst='$sed_quote_subst' # 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 variable: notinst_deplibs='$notinst_deplibs' else # When we are sourced in execute mode, \$file and \$echo are already set. if test \"\$libtool_execute_magic\" != \"$magic\"; then echo=\"$qecho\" file=\"\$0\" # Make sure echo works. if test \"X\$1\" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then # Yippee, \$echo works! : else # Restart under the correct shell, and then maybe \$echo will work. exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"} fi fi\ " $echo >> $output "\ # Find the directory that this script lives in. thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\` test \"x\$thisdir\" = \"x\$file\" && thisdir=. # Follow symbolic links until we get to the real thisdir. file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\` while test -n \"\$file\"; do destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\` # If there was a directory component, then change thisdir. if test \"x\$destdir\" != \"x\$file\"; then case \"\$destdir\" in [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; *) thisdir=\"\$thisdir/\$destdir\" ;; esac fi file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\` file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\` done # Try to get the absolute directory name. absdir=\`cd \"\$thisdir\" && pwd\` test -n \"\$absdir\" && thisdir=\"\$absdir\" " if test "$fast_install" = yes; then $echo >> $output "\ 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 >> $output "\ # 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 $EXIT_FAILURE fi fi $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || { $rm \"\$progdir/\$program\"; $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; } $rm \"\$progdir/\$file\" fi" else $echo >> $output "\ program='$outputname' progdir=\"\$thisdir/$objdir\" " fi $echo >> $output "\ if test -f \"\$progdir/\$program\"; then" # Export our shlibpath_var if we have one. if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then $echo >> $output "\ # Add our own library path to $shlibpath_var $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" # Some systems cannot cope with colon-terminated $shlibpath_var # The second colon is a workaround for a bug in BeOS R4 sed $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\` export $shlibpath_var " fi # fixup the dll searchpath if we need to. if test -n "$dllsearchpath"; then $echo >> $output "\ # Add the dll search path components to the executable PATH PATH=$dllsearchpath:\$PATH " fi $echo >> $output "\ if test \"\$libtool_execute_magic\" != \"$magic\"; then # Run the actual program with our arguments. " case $host in # Backslashes separate directories on plain windows *-*-mingw | *-*-os2*) $echo >> $output "\ exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} " ;; *) $echo >> $output "\ exec \"\$progdir/\$program\" \${1+\"\$@\"} " ;; esac $echo >> $output "\ \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\" exit $EXIT_FAILURE 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 $EXIT_FAILURE fi fi\ " chmod +x $output fi 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" 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" fi addlibs="$old_convenience" fi if test -n "$addlibs"; then gentop="$output_objdir/${outputname}x" generated="$generated $gentop" func_extract_archives $gentop $addlibs oldobjs="$oldobjs $func_extract_archives_result" fi # Do each command in the archive commands. if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then cmds=$old_archive_from_new_cmds else # 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 $echo "X$obj" | $Xsed -e 's%^.*/%%' done | sort | sort -uc >/dev/null 2>&1); then : else $echo "copying selected object files to avoid basename conflicts..." if test -z "$gentop"; then gentop="$output_objdir/${outputname}x" generated="$generated $gentop" $show "${rm}r $gentop" $run ${rm}r "$gentop" $show "$mkdir $gentop" $run $mkdir "$gentop" exit_status=$? if test "$exit_status" -ne 0 && test ! -d "$gentop"; then exit $exit_status fi fi save_oldobjs=$oldobjs oldobjs= counter=1 for obj in $save_oldobjs do objbase=`$echo "X$obj" | $Xsed -e 's%^.*/%%'` case " $oldobjs " in " ") oldobjs=$obj ;; *[\ /]"$objbase "*) while :; do # Make sure we don't pick an alternate name that also # overlaps. newobj=lt$counter-$objbase counter=`expr $counter + 1` case " $oldobjs " in *[\ /]"$newobj "*) ;; *) if test ! -f "$gentop/$newobj"; then break; fi ;; esac done $show "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" $run ln "$obj" "$gentop/$newobj" || $run cp "$obj" "$gentop/$newobj" oldobjs="$oldobjs $gentop/$newobj" ;; *) oldobjs="$oldobjs $obj" ;; esac done fi eval cmds=\"$old_archive_cmds\" if len=`expr "X$cmds" : ".*"` && test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then cmds=$old_archive_cmds else # the command line is too long to link in one step, link in parts $echo "using piecewise archive linking..." save_RANLIB=$RANLIB RANLIB=: objlist= concat_cmds= save_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 for obj in $save_oldobjs do oldobjs="$objlist $obj" objlist="$objlist $obj" eval test_cmds=\"$old_archive_cmds\" if len=`expr "X$test_cmds" : ".*" 2>/dev/null` && test "$len" -le "$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= 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 save_ifs="$IFS"; IFS='~' for cmd in $cmds; do eval cmd=\"$cmd\" IFS="$save_ifs" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" done if test -n "$generated"; then $show "${rm}r$generated" $run ${rm}r$generated fi # Now create the libtool archive. case $output in *.la) old_library= test "$build_old_libs" = yes && old_library="$libname.$libext" $show "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}\" || 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 var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"` relink_command="$var=\"$var_value\"; export $var; $relink_command" fi done # Quote the link command for shipping. relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"` if test "$hardcode_automatic" = yes ; then relink_command= fi # Only create the output if not a dry run. if test -z "$run"; then 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) name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'` eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` if test -z "$libdir"; then $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 exit $EXIT_FAILURE fi newdependency_libs="$newdependency_libs $libdir/$name" ;; *) newdependency_libs="$newdependency_libs $deplib" ;; esac done dependency_libs="$newdependency_libs" newdlfiles= for lib in $dlfiles; do name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` if test -z "$libdir"; then $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 exit $EXIT_FAILURE fi newdlfiles="$newdlfiles $libdir/$name" done dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` if test -z "$libdir"; then $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 exit $EXIT_FAILURE fi newdlprefiles="$newdlprefiles $libdir/$name" done dlprefiles="$newdlprefiles" else newdlfiles= for lib in $dlfiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac newdlfiles="$newdlfiles $abs" done dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac newdlprefiles="$newdlprefiles $abs" done dlprefiles="$newdlprefiles" fi $rm $output # place dlname in correct position for cygwin tdlname=$dlname case $host,$output,$installed,$module,$dlname in *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;; esac $echo > $output "\ # $outputname - a libtool library file # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP # # 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' # Libraries that this one depends upon. dependency_libs='$dependency_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 fi # Do a symbolic link so that the libtool archive can be found in # LD_LIBRARY_PATH before the program is installed. $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)" $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $? ;; esac exit $EXIT_SUCCESS ;; # libtool install mode install) modename="$modename: install" # There may be an optional sh(1) argument at the beginning of # install_prog (especially on Windows NT). if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || # Allow the use of GNU shtool's install command. $echo "X$nonopt" | grep shtool > /dev/null; then # Aesthetically quote it. arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"` case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac install_prog="$arg " arg="$1" shift else install_prog= arg=$nonopt fi # The real first argument should be the name of the installation program. # Aesthetically quote it. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac install_prog="$install_prog$arg" # We need to accept at least all the BSD install flags. dest= files= opts= prev= install_type= isdir=no stripme= for arg do if test -n "$dest"; then files="$files $dest" dest=$arg continue fi case $arg in -d) isdir=yes ;; -f) case " $install_prog " in *[\\\ /]cp\ *) ;; *) prev=$arg ;; esac ;; -g | -m | -o) prev=$arg ;; -s) stripme=" -s" continue ;; -*) ;; *) # If the previous option needed an argument, then skip it. if test -n "$prev"; then prev= else dest=$arg continue fi ;; esac # Aesthetically quote the argument. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac install_prog="$install_prog $arg" done if test -z "$install_prog"; then $echo "$modename: you must specify an install program" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi if test -n "$prev"; then $echo "$modename: the \`$prev' option requires an argument" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi if test -z "$files"; then if test -z "$dest"; then $echo "$modename: no file or destination specified" 1>&2 else $echo "$modename: you must specify a destination" 1>&2 fi $echo "$help" 1>&2 exit $EXIT_FAILURE fi # Strip any trailing slash from the destination. dest=`$echo "X$dest" | $Xsed -e 's%/$%%'` # Check to see that the destination is a directory. test -d "$dest" && isdir=yes if test "$isdir" = yes; then destdir="$dest" destname= else destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'` test "X$destdir" = "X$dest" && destdir=. destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'` # Not a directory, so check to see that there is only one file specified. set dummy $files if test "$#" -gt 2; then $echo "$modename: \`$dest' is not a directory" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi fi case $destdir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) for file in $files; do case $file in *.lo) ;; *) $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE ;; esac done ;; esac # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" staticlibs= future_libdirs= current_libdirs= for file in $files; do # Do each installation. case $file in *.$libext) # Do the static libraries later. staticlibs="$staticlibs $file" ;; *.la) # Check to see that this really is a libtool archive. if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : else $echo "$modename: \`$file' is not a valid libtool archive" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi library_names= old_library= relink_command= # If there is no directory component, then add one. case $file in */* | *\\*) . $file ;; *) . ./$file ;; esac # Add the libdir to current_libdirs if it is the destination. if test "X$destdir" = "X$libdir"; then case "$current_libdirs " in *" $libdir "*) ;; *) current_libdirs="$current_libdirs $libdir" ;; esac else # Note the libdir as a future libdir. case "$future_libdirs " in *" $libdir "*) ;; *) future_libdirs="$future_libdirs $libdir" ;; esac fi dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/ test "X$dir" = "X$file/" && dir= dir="$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 "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. if test "$inst_prefix_dir" = "$destdir"; then $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2 exit $EXIT_FAILURE fi 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 $echo "$modename: warning: relinking \`$file'" 1>&2 $show "$relink_command" if $run eval "$relink_command"; then : else $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 exit $EXIT_FAILURE fi fi # See the names of the shared library. set dummy $library_names if test -n "$2"; then realname="$2" shift shift srcname="$realname" test -n "$relink_command" && srcname="$realname"T # Install the shared library and build the symlinks. $show "$install_prog $dir/$srcname $destdir/$realname" $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $? if test -n "$stripme" && test -n "$striplib"; then $show "$striplib $destdir/$realname" $run 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 if test "$linkname" != "$realname"; then $show "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })" $run eval "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })" fi done fi # Do each command in the postinstall commands. lib="$destdir/$realname" cmds=$postinstall_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test "$mode" = relink; then $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)' fi exit $lt_exit } done IFS="$save_ifs" fi # Install the pseudo-library for information purposes. name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` instname="$dir/$name"i $show "$install_prog $instname $destdir/$name" $run eval "$install_prog $instname $destdir/$name" || exit $? # Maybe install the static library, too. test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library" ;; *.lo) # Install (i.e. copy) a libtool object. # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'` destfile="$destdir/$destfile" fi # Deduce the name of the destination old-style object file. case $destfile in *.lo) staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"` ;; *.$objext) staticdest="$destfile" destfile= ;; *) $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE ;; esac # Install the libtool object if requested. if test -n "$destfile"; then $show "$install_prog $file $destfile" $run eval "$install_prog $file $destfile" || exit $? fi # Install the old object if enabled. if test "$build_old_libs" = yes; then # Deduce the name of the old-style object file. staticobj=`$echo "X$file" | $Xsed -e "$lo2o"` $show "$install_prog $staticobj $staticdest" $run 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 destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'` 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 file=`$echo $file|${SED} 's,.exe$,,'` stripped_ext=".exe" fi ;; esac # Do a test to see if this is really a libtool program. case $host in *cygwin*|*mingw*) wrapper=`$echo $file | ${SED} -e 's,.exe$,,'` ;; *) wrapper=$file ;; esac if (${SED} -e '4q' $wrapper | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then notinst_deplibs= relink_command= # Note that it is not necessary on cygwin/mingw to append a dot to # foo even if both foo 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. # # If there is no directory component, then add one. case $wrapper in */* | *\\*) . ${wrapper} ;; *) . ./${wrapper} ;; esac # Check the variables that should have been set. if test -z "$notinst_deplibs"; then $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2 exit $EXIT_FAILURE fi finalize=yes for lib in $notinst_deplibs; do # Check to see that each library is installed. libdir= if test -f "$lib"; then # If there is no directory component, then add one. case $lib in */* | *\\*) . $lib ;; *) . ./$lib ;; esac fi libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test if test -n "$libdir" && test ! -f "$libfile"; then $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2 finalize=no fi done relink_command= # Note that it is not necessary on cygwin/mingw to append a dot to # foo even if both foo 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. # # If there is no directory component, then add one. case $wrapper in */* | *\\*) . ${wrapper} ;; *) . ./${wrapper} ;; esac outputname= if test "$fast_install" = no && test -n "$relink_command"; then if test "$finalize" = yes && test -z "$run"; then tmpdir=`func_mktempdir` file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'` outputname="$tmpdir/$file" # Replace the output file specification. relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'` $show "$relink_command" if $run eval "$relink_command"; then : else $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 ${rm}r "$tmpdir" continue fi file="$outputname" else $echo "$modename: warning: cannot relink \`$file'" 1>&2 fi else # Install the binary that we compiled earlier. file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"` fi fi # remove .exe since cygwin /usr/bin/install will append another # one anyway case $install_prog,$host in */usr/bin/install*,*cygwin*) case $file:$destfile in *.exe:*.exe) # this is ok ;; *.exe:*) destfile=$destfile.exe ;; *:*.exe) destfile=`$echo $destfile | ${SED} -e 's,.exe$,,'` ;; esac ;; esac $show "$install_prog$stripme $file $destfile" $run eval "$install_prog\$stripme \$file \$destfile" || exit $? test -n "$outputname" && ${rm}r "$tmpdir" ;; esac done for file in $staticlibs; do name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` # Set up the ranlib parameters. oldlib="$destdir/$name" $show "$install_prog $file $oldlib" $run eval "$install_prog \$file \$oldlib" || exit $? if test -n "$stripme" && test -n "$old_striplib"; then $show "$old_striplib $oldlib" $run eval "$old_striplib $oldlib" || exit $? fi # Do each command in the postinstall commands. cmds=$old_postinstall_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" done if test -n "$future_libdirs"; then $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2 fi if test -n "$current_libdirs"; then # Maybe just do a dry run. test -n "$run" && current_libdirs=" -n$current_libdirs" exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs' else exit $EXIT_SUCCESS fi ;; # libtool finish mode finish) modename="$modename: finish" libdirs="$nonopt" admincmds= if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then for dir do libdirs="$libdirs $dir" done for libdir in $libdirs; do if test -n "$finish_cmds"; then # Do each command in the finish commands. cmds=$finish_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || admincmds="$admincmds $cmd" done IFS="$save_ifs" fi if test -n "$finish_eval"; then # Do the single finish_eval. eval cmds=\"$finish_eval\" $run eval "$cmds" || admincmds="$admincmds $cmds" fi done fi # Exit here if they wanted silent mode. test "$show" = : && exit $EXIT_SUCCESS $echo "X----------------------------------------------------------------------" | $Xsed $echo "Libraries have been installed in:" for libdir in $libdirs; do $echo " $libdir" done $echo $echo "If you ever happen to want to link against installed libraries" $echo "in a given directory, LIBDIR, you must either use libtool, and" $echo "specify the full pathname of the library, or use the \`-LLIBDIR'" $echo "flag during linking and do at least one of the following:" if test -n "$shlibpath_var"; then $echo " - add LIBDIR to the \`$shlibpath_var' environment variable" $echo " during execution" fi if test -n "$runpath_var"; then $echo " - add LIBDIR to the \`$runpath_var' environment variable" $echo " during linking" fi if test -n "$hardcode_libdir_flag_spec"; then libdir=LIBDIR eval flag=\"$hardcode_libdir_flag_spec\" $echo " - use the \`$flag' linker flag" fi if test -n "$admincmds"; then $echo " - have your system administrator run these commands:$admincmds" fi if test -f /etc/ld.so.conf; then $echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" fi $echo $echo "See any operating system documentation about shared libraries for" $echo "more information, such as the ld(1) and ld.so(8) manual pages." $echo "X----------------------------------------------------------------------" | $Xsed exit $EXIT_SUCCESS ;; # libtool execute mode execute) modename="$modename: execute" # The first argument is the command name. cmd="$nonopt" if test -z "$cmd"; then $echo "$modename: you must specify a COMMAND" 1>&2 $echo "$help" exit $EXIT_FAILURE fi # Handle -dlopen flags immediately. for file in $execute_dlfiles; do if test ! -f "$file"; then $echo "$modename: \`$file' is not a file" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi dir= case $file in *.la) # Check to see that this really is a libtool archive. if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : else $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi # Read the libtool library. dlname= library_names= # If there is no directory component, then add one. case $file in */* | *\\*) . $file ;; *) . ./$file ;; esac # Skip this library if it cannot be dlopened. if test -z "$dlname"; then # Warn if it was a shared library. test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'" continue fi dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` test "X$dir" = "X$file" && dir=. if test -f "$dir/$objdir/$dlname"; then dir="$dir/$objdir" else $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2 exit $EXIT_FAILURE fi ;; *.lo) # Just add the directory containing the .lo file. dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` test "X$dir" = "X$file" && dir=. ;; *) $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2 continue ;; esac # Get the absolute pathname. absdir=`cd "$dir" && pwd` test -n "$absdir" && dir="$absdir" # Now add the directory to shlibpath_var. if eval "test -z \"\$$shlibpath_var\""; then eval "$shlibpath_var=\"\$dir\"" else eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" fi done # This variable tells wrapper scripts just to set shlibpath_var # rather than running their programs. libtool_execute_magic="$magic" # Check if any of the arguments is a wrapper script. args= for file do case $file in -*) ;; *) # Do a test to see if this is really a libtool program. if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then # If there is no directory component, then add one. case $file in */* | *\\*) . $file ;; *) . ./$file ;; esac # Transform arg to wrapped name. file="$progdir/$program" fi ;; esac # Quote arguments (to preserve shell metacharacters). file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"` args="$args \"$file\"" done if test -z "$run"; then if test -n "$shlibpath_var"; then # Export the shlibpath_var. eval "export $shlibpath_var" fi # Restore saved environment variables if test "${save_LC_ALL+set}" = set; then LC_ALL="$save_LC_ALL"; export LC_ALL fi if test "${save_LANG+set}" = set; then LANG="$save_LANG"; export LANG fi # 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 ;; # libtool clean and uninstall mode clean | uninstall) modename="$modename: $mode" rm="$nonopt" files= rmforce= exit_status=0 # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" for arg do case $arg in -f) rm="$rm $arg"; rmforce=yes ;; -*) rm="$rm $arg" ;; *) files="$files $arg" ;; esac done if test -z "$rm"; then $echo "$modename: you must specify an RM program" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi rmdirs= origobjdir="$objdir" for file in $files; do dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` if test "X$dir" = "X$file"; then dir=. objdir="$origobjdir" else objdir="$dir/$origobjdir" fi name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` test "$mode" = uninstall && objdir="$dir" # Remember objdir for removal later, being careful to avoid duplicates if test "$mode" = clean; then case " $rmdirs " in *" $objdir "*) ;; *) rmdirs="$rmdirs $objdir" ;; esac fi # Don't error if the file doesn't exist and rm -f was used. if (test -L "$file") >/dev/null 2>&1 \ || (test -h "$file") >/dev/null 2>&1 \ || test -f "$file"; then : elif test -d "$file"; then exit_status=1 continue elif test "$rmforce" = yes; then continue fi rmfiles="$file" case $name in *.la) # Possibly a libtool archive, so verify it. if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then . $dir/$name # Delete the libtool libraries and symlinks. for n in $library_names; do rmfiles="$rmfiles $objdir/$n" done test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library" case "$mode" in clean) case " $library_names " in # " " in the beginning catches empty $dlname *" $dlname "*) ;; *) rmfiles="$rmfiles $objdir/$dlname" ;; esac test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i" ;; uninstall) if test -n "$library_names"; then # Do each command in the postuninstall commands. cmds=$postuninstall_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" if test "$?" -ne 0 && test "$rmforce" != yes; then exit_status=1 fi done IFS="$save_ifs" fi if test -n "$old_library"; then # Do each command in the old_postuninstall commands. cmds=$old_postuninstall_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" if test "$?" -ne 0 && test "$rmforce" != yes; then exit_status=1 fi done IFS="$save_ifs" fi # FIXME: should reinstall the best remaining shared library. ;; esac fi ;; *.lo) # Possibly a libtool object, so verify it. if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then # Read the .lo file . $dir/$name # Add PIC object to the list of files to remove. if test -n "$pic_object" \ && test "$pic_object" != none; then rmfiles="$rmfiles $dir/$pic_object" fi # Add non-PIC object to the list of files to remove. if test -n "$non_pic_object" \ && test "$non_pic_object" != none; then rmfiles="$rmfiles $dir/$non_pic_object" fi fi ;; *) if test "$mode" = clean ; then noexename=$name case $file in *.exe) file=`$echo $file|${SED} 's,.exe$,,'` noexename=`$echo $name|${SED} 's,.exe$,,'` # $file with .exe has already been added to rmfiles, # add $file without .exe rmfiles="$rmfiles $file" ;; esac # Do a test to see if this is a libtool program. if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then relink_command= . $dir/$noexename # note $name still contains .exe if it was in $file originally # as does the version of $file that was added into $rmfiles rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}" if test "$fast_install" = yes && test -n "$relink_command"; then rmfiles="$rmfiles $objdir/lt-$name" fi if test "X$noexename" != "X$name" ; then rmfiles="$rmfiles $objdir/lt-${noexename}.c" fi fi fi ;; esac $show "$rm $rmfiles" $run $rm $rmfiles || exit_status=1 done objdir="$origobjdir" # Try to remove the ${objdir}s in the directories where we deleted files for dir in $rmdirs; do if test -d "$dir"; then $show "rmdir $dir" $run rmdir $dir >/dev/null 2>&1 fi done exit $exit_status ;; "") $echo "$modename: you must specify a MODE" 1>&2 $echo "$generic_help" 1>&2 exit $EXIT_FAILURE ;; esac if test -z "$exec_cmd"; then $echo "$modename: invalid operation mode \`$mode'" 1>&2 $echo "$generic_help" 1>&2 exit $EXIT_FAILURE fi fi # test -z "$show_help" if test -n "$exec_cmd"; then eval exec $exec_cmd exit $EXIT_FAILURE fi # We need to display help for each of the modes. case $mode in "") $echo \ "Usage: $modename [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 --finish same as \`--mode=finish' --help display this help message and exit --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS] --quiet same as \`--silent' --silent don't print informational messages --tag=TAG use configuration variables from tag TAG --version print version information MODE must be one of the following: clean remove files from the build directory compile compile a source file into a libtool object execute automatically set library path, then run a program finish complete the installation of libtool libraries install install libraries or executables link create a library or an executable uninstall remove libraries from an installed directory MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for a more detailed description of MODE. Report bugs to ." exit $EXIT_SUCCESS ;; clean) $echo \ "Usage: $modename [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: $modename [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 -prefer-pic try to building PIC objects only -prefer-non-pic try to building non-PIC objects only -static always build a \`.o' file suitable for static linking COMPILE-COMMAND is a command to be used in creating a \`standard' object file from the given SOURCEFILE. The output file name is determined by removing the directory component from SOURCEFILE, then substituting the C source code suffix \`.c' with the library object suffix, \`.lo'." ;; execute) $echo \ "Usage: $modename [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: $modename [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: $modename [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 rest of the components are interpreted as arguments to that command (only BSD-compatible install options are recognized)." ;; link) $echo \ "Usage: $modename [OPTION]... --mode=link LINK-COMMAND... Link object files or libraries together to form another library, or to create an executable program. LINK-COMMAND is a command using the C compiler that you would use to create a program from several object files. The following components of LINK-COMMAND are treated specially: -all-static do not do any dynamic linking at all -avoid-version do not add a version suffix if possible -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) -export-symbols SYMFILE try to export only the symbols listed in SYMFILE -export-symbols-regex REGEX try to export only the symbols matching REGEX -LLIBDIR search LIBDIR for required installed libraries -lNAME OUTPUT-FILE requires the installed library libNAME -module build a library that can dlopened -no-fast-install disable the fast-install mode -no-install link a not-installable executable -no-undefined declare that a library does not refer to external symbols -o OUTPUT-FILE create OUTPUT-FILE from the specified objects -objectlist FILE Use a list of object files found in FILE to specify objects -precious-files-regex REGEX don't remove output files matching REGEX -release RELEASE specify package release information -rpath LIBDIR the created library will eventually be installed in LIBDIR -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries -static do not do any dynamic linking of libtool libraries -version-info CURRENT[:REVISION[:AGE]] specify library version info [each variable defaults to 0] 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: $modename [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." ;; *) $echo "$modename: invalid operation mode \`$mode'" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE ;; esac $echo $echo "Try \`$modename --help' for more information about other modes." exit $? # 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 disable_libs=shared # ### END LIBTOOL TAG CONFIG: disable-shared # ### BEGIN LIBTOOL TAG CONFIG: disable-static disable_libs=static # ### END LIBTOOL TAG CONFIG: disable-static # Local Variables: # mode:shell-script # sh-indentation:2 # End: freeradius-server/man/000077500000000000000000000000001257552170400152765ustar00rootroot00000000000000freeradius-server/man/man1/000077500000000000000000000000001257552170400161325ustar00rootroot00000000000000freeradius-server/man/man1/radclient.1000066400000000000000000000136561257552170400201740ustar00rootroot00000000000000.TH RADCLIENT 1 "2 April 2009" "" "FreeRADIUS Daemon" .SH NAME radclient - send packets to a RADIUS server, show reply .SH SYNOPSIS .B radclient .RB [ \-4 ] .RB [ \-6 ] .RB [ \-d .IR raddb_directory ] .RB [ \-c .IR count ] .RB [ \-f .IR file ] .RB [ \-F ] .RB [ \-h ] .RB [ \-i .IR id ] .RB [ \-n .IR num_requests_per_second ] .RB [ \-p .IR num_requests_in_parallel ] .RB [ \-q ] .RB [ \-r .IR num_retries ] .RB [ \-s ] .RB [ \-S .IR shared_secret_file ] .RB [ \-t .IR timeout ] .RB [ \-v ] .RB [ \-x ] \fIserver {acct|auth|status|disconnect|auto} secret\fP .SH DESCRIPTION \fBradclient\fP is a radius client program. It can send arbitrary radius packets to a radius server, then shows the reply. It can be used to test changes you made in the configuration of the radius server, or it can be used to monitor if a radius server is up. .PP \fBradclient\fP reads radius attribute/value pairs from it standard input, or from a file specified on the command line. It then encodes these attribute/value pairs using the dictionary, and sends them to the remote server. .PP The \fIUser-Password\fP and \fICHAP-Password\fP attributes are automatically encrypted before the packet is sent to the server. .SH OPTIONS .IP \-4 Use IPv4 (default) .IP \-6 Use IPv6 .IP \-c\ \fIcount\fP Send each packet \fIcount\fP times. .IP \-d\ \fIraddb_directory\fP The directory that contains the RADIUS dictionary files. Defaults to \fI/etc/raddb\fP. .IP \-f\ \fIfile\fP File to read the attribute/value pairs from. If this is not specified, they are read from stdin. This option can be specified multiple times, in which case packets are sent in order by file, and within each file, by first packet to last packet. A blank line separates logical packets within a file. .IP \-F Print the file name, packet number and reply code. .IP \-h Print usage help information. .IP \-i\ \fIid\fP Use \fIid\fP as the RADIUS request Id. .IP \-n\ \fInum_requests_per_second\fP Try to send \fInum_requests_per_second\fP, evenly spaced. This option allows you to slow down the rate at which radclient sends requests. When not using -n, the default is to send packets as quickly as possible, with no inter-packet delays. Due to limitations in radclient, this option does not accurately send the requested number of packets per second. .IP \-p\ \fInum_requests_in_parallel\fP Send \fInum_requests_in_parallel\fP, without waiting for a response for each one. By default, radclient sends the first request it has read, waits for the response, and once the response is received, sends the second request in its list. This option allows you to send many requests at simultaneously. Once \fInum_requests_in_parallel\fP are sent, radclient waits for all of the responses to arrive (or for the requests to time out), before sending any more packets. This option permits you to discover the maximum load accepted by a RADIUS server. .IP \-q Go to quiet mode, and do not print out anything. .IP \-r\ \fInum_retries\fP Try to send each packet \fInum_retries\fP times, before giving up on it. The default is 10. .IP \-s Print out some summaries of packets sent and received. .IP \-S\ \fIshared_secret_file\fP Rather than reading the shared secret from the command-line (where it can be seen by others on the local system), read it instead from \fIshared_secret_file\fP. .IP \-t\ \fItimeout\fP Wait \fItimeout\fP seconds before deciding that the NAS has not responded to a request, and re-sending the packet. The default timeout is 3. .IP \-v Print out version information. .IP \-x Print out debugging information. .IP server[:port] The hostname or IP address of the remote server. Optionally a UDP port can be specified. If no UDP port is specified, it is looked up in \fI/etc/services\fP. The service name looked for is \fBradacct\fP for accounting packets, and \fBradius\fP for all other requests. If a service is not found in \fI/etc/services\fP, 1813 and 1812 are used respectively. The RADIUS attributes read by \fIradclient\fP can contain the special attribute \fBPacket-Dst-IP-Address\fP. If this attribute exists, then that IP address is where the packet is sent, and the \fBserver\fP specified on the command-line is ignored. If the RADIUS attribute list always contains the \fBPacket-Dst-IP-Address\fP attribute, then the \fBserver\fP parameter can be given as \fB-\fP. The RADIUS attributes read by \fIradclient\fP can contain the special attribute \fBPacket-Dst-Port\fP. If this attribute exists, then that UDP port is where the packet is sent, and the \fB:port\fP specified on the command-line is ignored. .IP acct\ |\ auth\ |\ status\ |\ disconnect\ |\ auto Use \fBauth\fP to send an authentication packet (Access-Request), \fBacct\fP to send an accounting packet (Accounting-Request), \fBstatus\fP to send an status packet (Status-Server), or \fBdisconnect\fP to send a disconnection request. Instead of these values, you can also use a decimal code here. For example, code 12 is also \fBStatus-Server\fP. The RADIUS attributes read by \fIradclient\fP can contain the special attribute \fBPacket-Type\fP. If this attribute exists, then that type of packet is sent, and the \fItype\fP specified on the command-line is ignored. If the RADIUS attribute list always contains the \fBPacket-Type\fP attribute, then the \fBtype\fP parameter can be given as \fBauto\fP. .IP secret The shared secret for this client. It needs to be defined on the radius server side too, for the IP address you are sending the radius packets from. .SH EXAMPLE A sample session that queries the remote server for \fIStatus-Server\fP (not all servers support this, but FreeRADIUS has configurable support for it). .RS .sp .nf .ne 3 $ echo "Message-Authenticator = 0x00" | radclient 192.168.1.42 status s3cr3t Sending request to server 192.168.1.42, port 1812. radrecv: Packet from host 192.168.1.42 code=2, id=140, length=54 Reply-Message = "FreeRADIUS up 21 days, 02:05" .fi .sp .RE .SH SEE ALSO radiusd(8), .SH AUTHORS Miquel van Smoorenburg, miquels@cistron.nl. Alan DeKok freeradius-server/man/man1/radeapclient.1000066400000000000000000000043771257552170400206620ustar00rootroot00000000000000.TH RADEAPCLIENT 1 "08 September 2003" "" "FreeRADIUS Daemon" .SH NAME radeapclient - send EAP packets to a RADIUS server, calculate responses .SH SYNOPSIS .B radeapclient .RB [ \-4 ] .RB [ \-6 ] .RB [ \-c .IR count ] .RB [ \-d .IR raddb_directory ] .RB [ \-f .IR file ] .RB [ \-h ] .RB [ \-i .IR source_ip ] .RB [ \-q ] .RB [ \-s ] .RB [ \-r .IR retries ] .RB [ \-S .IR file ] .RB [ \-t .IR timeout ] .RB [ \-v ] .RB [ \-x ] \fIserver {acct|auth} secret\fP .SH DESCRIPTION \fBradeapclient\fP is a radius client program. It can send arbitrary radius packets to a radius server, then shows the reply. Radeapclient differs from radclient in that if there is an EAP-MD5 challenge, then it will be responded to. .PP \fBradeapclient\fP is otherwise identical to \fBradclient\fP. .PP The \fIEAP-Identity\fP attribute, if present is used to construct an EAP Identity message. .PP .PP The \fIEAP-MD5-Password\fP attribute, if present is used to respond to an MD5 challenge. .PP No other EAP types are currently supported. .SH OPTIONS .IP \-4 Use IPv4 (default) .IP \-6 Use IPv6 .IP \-c\ \fIcount\fP Send each packet \fIcount\fP times. .IP \-d\ \fIraddb\fP Set dictionary directory. .IP \-f\ \fIfile\fP Read packets from \fIfile\fP, not stdin. .IP \-r\ \fIretries\fP If timeout, retry sending the packet \fIretries\fP times. .IP \-t\ \fItimeout\fP Wait \fItimeout\fP seconds before retrying (may be a floating point number). .IP \-h Print usage help information. .IP \-i\ \fIid\fP Set request id to '\fIid\fP'. Values may be 0..255 .IP \-S\ \fIfile\fP Read secret from \fIfile\fP, not command line. .IP \-q Quiet, do not print anything out. .IP \-s Print out summary information of auth results. .IP \-v Show program version information. .IP \-x Enable debugging mode. .SH EXAMPLE A sample session that queries the remote server with an EAP-MD5 challenge. .RS .sp .nf .ne 3 ( echo 'User-Name = "bob"'; echo 'EAP-MD5-Password = "hello"'; echo 'NAS-IP-Address = marajade.sandelman.ottawa.on.c'; echo 'EAP-Code = Response'; echo 'EAP-Id = 210'; echo 'EAP-Type-Identity = "bob"; echo 'Message-Authenticator = 0x00'; echo 'NAS-Port = 0' ) >req.txt radeapclient -x localhost auth testing123 freeradius-server/man/man1/radlast.1000066400000000000000000000012241257552170400176450ustar00rootroot00000000000000.TH RADLAST 1 "22 February 2001" "" "FreeRADIUS Daemon" .SH NAME radlast - show "last" info from the radwtmp file .SH SYNOPSIS .B radlast .IR [ options ] .SH DESCRIPTION The FreeRADIUS server can write an accounting log in the \fIwtmp\fP format of the local system. \fBradlast\fP is a frontend for the systems \fBlast\fP command - it just calls \fBlast\fP with the \fI-f path_to_radwtmp_file\fP argument, and passes all options on the command line to the system \fBlast\fP command. .SH OPTIONS See the manpage of the system \fBlast\fP command. .SH SEE ALSO radiusd(8), radiusd.conf(5), wtmp(5), last(1). .SH AUTHOR Miquel van Smoorenburg, miquels@cistron.nl. freeradius-server/man/man1/radtest.1000066400000000000000000000036601257552170400176670ustar00rootroot00000000000000.TH RADTEST 1 "5 April 2010" "" "FreeRADIUS Daemon" .SH NAME radtest - send packets to a RADIUS server, show reply .SH SYNOPSIS .B radtest .RB [ \-d .IR raddb_directory ] .RB [ \-t .IR pap/chap/mschap ] .RB [ \-x .IR ] .RB [ \-4 .IR ] .RB [ \-6 .IR ] .I user password radius-server nas-port-number secret .RB [ ppphint ] .RB [ nasname ] .SH DESCRIPTION \fBradtest\fP is a frontend to \fBradclient\fP(1). It generates a list of attribute/value pairs based on the command line arguments, and feeds these into \fBradclient\fP. It's a fast and convenient way to test a radius server. .SH OPTIONS .IP "\-d \fIraddb_directory\fP" The directory that contains the RADIUS dictionary files. Defaults to \fI/etc/raddb\fP. .IP "\-t \fIpap/chap/mschap/eap-md5\fP" Choose the authentiction method to use. e.g. "-t pap", "-t chap", "-t mschap", or "-t eap-md5",. Defaults to "pap". Using EAP-MD5 requires that the "radeapclient" program is installed. .IP "\-x" Enables debugging output for the RADIUS client. .IP "\-4" Use NAS-IP-Address for the NAS address (default) .IP "\-6" Use NAS-IPv6-Address for the NAS address (default) .IP user Username to send. .IP password Password of the user. .IP radius-server Hostname or IP address of the radius server. Optionally, you may specify a port by appending :port .IP nas-port-number The value of the NAS-Port attribute. Is an integer between 0 and 2^31, and it really doesn't matter what you put here. \fI10\fP will do fine. .IP secret The shared secret for this client. .IP ppphint If you put an integer > 0 here, radtest (or actually radclient) will add the attribute \fIFramed-Protocol = PPP\fP to the request packet. .IP nasname If present, this will be resolved to an IP address and added to the request packet as the \fINAS-IP-Address\fP attribute. If you don't specify it, the local hostname of the system will be used. .SH SEE ALSO radiusd(8), radclient(1). .SH AUTHOR Miquel van Smoorenburg, miquels@cistron.nl. freeradius-server/man/man1/radwho.1000066400000000000000000000053071257552170400175050ustar00rootroot00000000000000.TH RADWHO 1 "26 Dec 2011" "" "FreeRADIUS Daemon" .SH NAME radwho - show online users .SH SYNOPSIS .B radwho .RB [ \-c ] .RB [ \-d .IR raddb_directory ] .RB [ \-f ] .RB [ \-F .IR radutmp_file ] .RB [ \-i ] .RB [ \-n ] .RB [ \-N .IR nas_ip_address ] .RB [ \-p ] .RB [ \-P .IR nas_port ] .RB [ \-r ] .RB [ \-R ] .RB [ \-s ] .RB [ \-S ] .RB [ \-u .IR user ] .RB [ \-U .IR user ] .RB [ \-Z ] .SH DESCRIPTION The FreeRADIUS server can be configured to maintain an active session database in a file called \fIradutmp\fP. This utility shows the content of that session database. .SH OPTIONS .IP \-c Shows caller ID (if available) instead of the full name. .IP \-d\ \fIraddb_directory\fP The directory that contains the RADIUS configuration files. Defaults to \fI/etc/raddb\fP. .IP \-f Behave as the 'fingerd' daemon - waits for one line of input, then prints the output with lines \\r\\n terminated. .IP \-F\ \fIradutmp_file\fP The file that contains the radutmp file. If this is specified, -d is not necessary. .IP \-i Shows the session ID instead of the full name. .IP \-n Normally radwho looks up the username in the systems password file, and shows the full username as well. The \fB-n\fP flags prevents this. .IP \-N\ \fInas_ip_address\fP Show only those entries which match the given NAS IP address. .IP \-p Adds an extra column for the port type - I for ISDN, A for Analog. .IP \-P\ \fInas_port\fP Show only those entries which match the given NAS port. .IP \-r Outputs all data in \fIraw\fP format - no headers, no formatting, fields are comma-separated. .IP \-R Output all data in RADIUS attribute format. All fields are printed. .IP \-s Show full name. .IP \-S Hide shell users. Doesn't show the entries for users that do not have a SLIP or PPP session. .IP \-u\ \fIuser\fP Show only those entries which match the given username (case insensitive). .IP \-U\ \fIuser\fP Show only those entries which match the given username (case sensitive). .IP \-Z When combined with \fI-R\fP, prints out the contents of an Accounting-Request packet which can be passed to \fIradclient\fP, in order to "zap" that users session from \fIradutmp\fP. .PP For example, .RS .sp .nf .ne 3 $ radwho -ZRN 10.0.0.1 | radclient -f - radius.example.net acct testing123 .fi .sp .RE will result in all an Accounting-Request packet being sent to the RADIUS server, which tells the server that the NAS rebooted. i.e. It "zaps" all of the users on that NAS. To "zap" one user, specifiy NAS, username, and NAS port: .RS .sp .nf .ne 3 $ radwho -ZRN 10.0.0.1 -u user -P 10 | radclient -f - radius.example.net acct testing123 .fi .sp .RE Other combinations are also possible. .SH SEE ALSO radiusd(8), radclient(1), radiusd.conf(5). .SH AUTHOR Miquel van Smoorenburg, miquels@cistron.nl. freeradius-server/man/man1/radzap.1000066400000000000000000000043471257552170400175050ustar00rootroot00000000000000.TH RADZAP 1 "8 April 2005" "" "FreeRadius Daemon" .SH NAME radzap - remove rogue entries from the active sessions database .SH SYNOPSIS .B radzap .RB [ \-d .IR raddb_directory ] .RB [ \-h ] .RB [ \-N .IR nas_ip_address ] .RB [ \-P .IR nas_port ] .RB [ \-u .IR user ] .RB [ \-U .IR user ] .RB [ \-x ] \fIserver[:port] secret\fP .SH DESCRIPTION The FreeRadius server can be configured to maintain an active session database in a file called \fIradutmp\fP. Commands like \fBradwho\fP(1) use this database. Sometimes that database can get out of sync, and then it might contain rogue entries. \fBradzap\fP can clean up this database. As of FreeRADIUS 1.1.0, \fBradzap\fP is a simple shell-script wrapper around \fBradwho\fP(1) and \fBradclient\fP(1). The sessions are "zapped" by sending an Accounting-Request packet which contains the information necessary for the server to delete the session record. \fBradzap\fP sends a packet to the server, rather than writing to \fIradutmp\fP directly, because session records may also be maintained in SQL. .SH OPTIONS .IP \-d\ \fIraddb_directory\fP The directory that contains the RADIUS configuration files. \fBradzap\fP reads \fIradiusd.conf\fP to determine the location of the \fIradutmp\fP file. .IP \-h Print usage help information. .IP \-N\ \fInas_ip_address\fP Zap the entries which match the given NAS IP address. .IP \-P\ \fInas_port\fP Zap the entries which match the given NAS port. .IP \-u\ \fIuser\fP Zap the entries which match the given username (case insensitive). .IP \-U\ \fIuser\fP Zap the entries which match the given username (case sensitive). .IP \-x Enable debugging output. .IP server[:port] The hostname or IP address of the remote server. Optionally a UDP port can be specified. If no UDP port is specified, it is looked up in \fI/etc/services\fP. The service name looked for is \fBradacct\fP for accounting packets, and \fBradius\fP for all other requests. If a service is not found in \fI/etc/services\fP, 1813 and 1812 are used respectively. .IP secret The shared secret for this client. It needs to be defined on the radius server side too, for the IP address you are sending the radius packets from. .SH SEE ALSO radwho(1), radclient(1), radiusd(8), radiusd.conf(5). .SH AUTHOR Alan DeKok freeradius-server/man/man1/smbencrypt.1000066400000000000000000000011651257552170400204050ustar00rootroot00000000000000.TH SMBENCRYPT 1 .SH NAME smbencrypt - produce LM & NT password hashes from cleartext passwords .SH SYNOPSIS .B smbencrypt \fIpassword\fP [\fIpassword ...\fP] .SH DESCRIPTION \fBsmbencrypt\fP For each cleartext password passed on the command line emit the LM-Password and NT-Password hashes for that password. .SH EXAMPLE .nf $ smbencrypt foo bar LM Hash NT Hash -------------------------------- -------------------------------- 5BFAFBEBFB6A0942AAD3B435B51404EE AC8E657F83DF82BEEA5D43BDAF7800CC A6428F2551EDEE1BAAD3B435B51404EE 86C156FC198B358CCCF6278D8BD49B6A .fi .SH SEE ALSO radiusd(8) .SH AUTHORS freeradius-server/man/man5/000077500000000000000000000000001257552170400161365ustar00rootroot00000000000000freeradius-server/man/man5/acct_users.5000066400000000000000000000013001257552170400203510ustar00rootroot00000000000000.TH ACCT_USERS 5 "05 August 2000" "" "FreeRADIUS user accounting file" .SH NAME acct_users \- user accounting file for the FreeRADIUS server .SH DESCRIPTION The \fBacct_users\fP file resides in the radius database directory, by default \fB/etc/raddb\fP. It contains a series of configuration directives which are used by the \fIfiles\fP module to decide how to log accounting messages. The format of this file is identical to that of the \fBusers\fP file, except that it controls the response to accounting requests, not authentication requests. .SH FILES /etc/raddb/acct_users .SH "SEE ALSO" .BR radclient (1), .BR radiusd (8), .BR dictionary (5), .BR users (5) .SH AUTHOR Alan DeKok freeradius-server/man/man5/checkrad.5000066400000000000000000000026561257552170400200010ustar00rootroot00000000000000.TH CHECKRAD 5 "13 January 2006" .SH NAME checkrad -- See if a user is (still) logged in on a certain port. .SH SYNOPSIS .B checkrad .RB [ -d ] .I nas-type nas-ip nas-port login session-id .SH DESCRIPTION \fBCheckrad\fP is used by the radius server to check if its idea of a user logged in on a certain port/NAS is correct if a double login is detected. Returns: 0 = no duplicate, 1 = duplicate, >1 = error. .SH OPTIONS .IP -d Enable printing of debugging informations. .IP nas-type Type of port/NAS. Can be one of: .RS .IP \(bu ascend .IP \(bu bay .IP \(bu cisco .IP \(bu cisco_l2tp .IP \(bu computone .IP \(bu cvx .IP \(bu digitro .IP \(bu dot1x .IP \(bu livingston .IP \(bu max40xx .IP \(bu mikrotik .IP \(bu mikrotik_snmp .IP \(bu multitech .IP \(bu netserver .IP \(bu other .IP \(bu pathras .IP \(bu patton .IP \(bu portslave .IP \(bu pr3000 .IP \(bu pr4000 .IP \(bu redback .IP \(bu tc .IP \(bu usrhiper .IP \(bu versanet .P The "other" type cause \fBcheckrad\fP to skip any check and always returns 1. .RE .IP nas-ip IP address of the NAS to check. .IP nas-port The NAS port to check (may be ignored by some nas-type). .IP login The login name to check. .IP session-id Session to check. (actually ignored by all nas-type) .SH SEE ALSO radiusd(8) .SH AUTHOR Written by Miquel van Smoorenburg, miquels@cistron.nl. This manual page was written by Marco Nenciarini for the Debian project (but may be used by others). freeradius-server/man/man5/clients.conf.5000066400000000000000000000045751257552170400206240ustar00rootroot00000000000000.TH clients.conf 5 "13 June 2005" "" "FreeRADIUS client configuration" .SH NAME clients.conf \- FreeRADIUS client configuration .SH DESCRIPTION The .I clients.conf file contains definitions of RADIUS clients. .PP The information in this file overrides any information provided in the deprecated .BR clients (5) and .BR naslist (5) files. .PP The file format is the same as that used for .I radiusd.conf. See .BR radiusd.conf (5) for more details. .PP Each RADIUS client entry has the following basic form: .IP .nf client { = } .fi .SH ATTRIBUTES The attributes that can appear in a .B client section are listed below. Required attributes are labelled as such. All other attributes are optional. .TP 0.5i .B ipaddr [Required] The IP address of the client. For IPv6, use "ipv6addr" .TP 0.5i .B secret [Required] The RADIUS shared secret used for communication between the client/NAS and the RADIUS server. .TP 0.5i .B shortname [optional] A short alias that can be used in place of the IP address or fully qualified hostname provided in the first line of the section. .TP 0.5i .B nastype The nastype attribute is used to tell the .BR checkrad.pl script which NAS-specific method it should use when checking simultaneous use. The following values are currently recognized: .nf cisco computone livingston max40xx multitech netserver pathras patton portslave tc usrhiper other .fi .TP 0.5i .B login Reserved for future use. .TP 0.5i .B password Reserved for future use. .SH EXAMPLES .IP .nf client localhost { ipaddr = 127.0.0.1 secret = testing123 shortname = localhost nastype = other } .fi .LP This adds a client for the loopback address. This is useful in testing the server locally, for example with .BR radclient (1). .IP .nf client private-network-1 { ipaddr = 192.168.0.0 netmask = 24 secret = testing123-1 shortname = private-network-1 } .fi .LP This entry represents any client from the 192.168.0.0/24 network. The old-style format from 1.x is still accepted by the server, but that form is deprecated. .SH FILES .I /etc/raddb/clients.conf .I /etc/raddb/radiusd.conf .SH "SEE ALSO" .BR radiusd (8), .BR radiusd.conf (5), .BR clients (5), .BR naslist (5) .SH AUTHOR FreeRADIUS is authored by the FreeRADIUS team. http://freeradius.org/ freeradius-server/man/man5/dictionary.5000066400000000000000000000117111257552170400203720ustar00rootroot00000000000000.\" # DS - begin display .de DS .RS .nf .sp .. .\" # DE - end display .de DE .fi .RE .sp .. .TH dictionary 5 "31 Oct 2005" .SH NAME dictionary \- RADIUS dictionary file .SH DESCRIPTION The master RADIUS dictionary file resides in \fI/etc/raddb/dictionary\fP. It references other \fIdictionary\fP files located in \fI/usr/local/share/freeradius/\fP. Each dictionary file contains a list of RADIUS attributes and values, which the server uses to map between descriptive names and on-the-wire data. The names have no meaning outside of the RADIUS server itself, and are never exchanged between server and clients. .PP That is, editing the dictionaries will have NO EFFECT on anything other than the server that is reading those files. Adding new attributes to the dictionaries will have NO EFFECT on RADIUS clients, and will not make RADIUS clients magically understand those attributes. The dictionaries are solely for local administrator convenience, and are specific to each version of FreeRADIUS. .PP The dictionaries in \fI/usr/local/share\fP SHOULD NOT be edited unless you know exactly what you are doing. Changing them will most likely break your RADIUS deployment. .PP If you need to add new attributes, please edit the \fI/etc/raddb/dictionary\fP file. It's sole purpose is to contain site-local defintions that are added by the local administrator. .SH FORMAT Every line starting with a hash sign .RB (' # ') is treated as comment and ignored. .PP Each line of the file can contain one of the following strings .TP 0.5i .B ATTRIBUTE name number type [vendor|options] Define a RADIUS attribute name to number mapping. The \fIname\fP field can be any non-space text, but is usually taken from \fIRFC2865\fP, and other related documents. The \fInumber\fP field is also taken from the relevant documents, for that name. The \fItype\fP field can be one of \fIstring\fP, \fIoctets\fP, \fIipaddr\fP, \fIinteger\fP, \fIdate\fP, \fIifid\fP, \fIipv6addr\fP, \fIipv6prefix\fP, or \fIether\fP \fIabinary\fP. See the RFC's, or the main \fIdictionary\fP file for a description of the various types. The last (optional) field of an attribute definition can have either a vendor name, or options for that attribute. When a vendor name is given, the attribute is defined to be a vendor specific attribute. Alternately, the options may be the a comma-separated list of the following options: .TP 0.5i .DS encrypt=[1-3] .DE .RS Mark the attribute as being encrypted with one of three methods. "1" means that the attribute is encrypted with the method as defined in \fIRFC2865\fP for the User-Password attribute. "2" means that the password is encrypted with the method as defined in \fIRFC2868\fP for the Tunnel-Password attribute. "3" means that the attribute is encrypted as per Ascend's definitions for the Ascend-Send-Secret attribute. .RE .DS has_tag .DE .RS Mark the attribute as being permitted to have a tag, as defined in \fIRFC2868\fP. The purpose of the tag is to allow grouping of attributes for tunnelled users. See \fIRFC2868\fP for more details. .RE When the server receives an encoded attribute in a RADIUS packet, it looks up that attribute by number in the dictionary, and uses the name found there for printing diagnostic and log messages. .TP 0.5i .B VALUE attribute-name value-name number Define an attribute value name to number mapping, for an attribute of type \fIinteger\fP. The \fIattribute-name\fP field MUST be previously defined by an \fIATTRIBUTE\fP entry. The \fIvalue-name\fP field can be any non-space text, but is usually taken from \fIRFC2865\fP, or other documents.. The \fInumber\fP field is also taken from the relevant documents, for that name. When the server receives an encoded value in a RADIUS packet, it looks up the value of that attribute by number in the dictionary, and uses the name found there for printing diagnostic and log messages. .TP 0.5i .B VENDOR vendor-name number [format=t,l] Define a Vendor Specific Attribute encapsulation for \fIvendor-name\fP to \fInumber\fP. For a list of vendor names and numbers, see http://www.iana.org/enterprise-numbers.txt. .PP The "format=t,l" statement tells the server how many octets to use to encode/decode the vendor "type" and "length" fields in the attributes. The default is "format=1,1", which does not have to be specified. For USR VSA's, the format is "format=4,0", for Lucent VSA's it's "format=2,1", and for Starent VSA's it's "format=2,2". .PP The supported values for the number of type octets (i.e. the first digit) are 1, 2, and 4. The support values for the number of length octets (i.e. the second digit) are 0, 1, and 2. Any combination of those values will work. .TP 0.5i .B $INCLUDE filename Include dictionary entries from the file \fIfilename\fP. The \fIfilename\fP is taken as relative to the location of the file which is asking for the inclusion. .PP .SH FILES .I /etc/raddb/dictionary, .I /usr/share/freeradius/dictionary.* .SH "SEE ALSO" .BR radiusd (8), .BR naslist (5), .BR RFC2865, .BR RFC2866, .BR RFC2868 freeradius-server/man/man5/radiusd.conf.5000066400000000000000000000101641257552170400206050ustar00rootroot00000000000000.\" # DS - begin display .de DS .RS .nf .sp .. .\" # DE - end display .de DE .fi .RE .sp .. .TH radiusd.conf 5 "12 Jun 2007" "" "FreeRADIUS configuration file" .SH NAME radiusd.conf \- configuration file for the FreeRADIUS server .SH DESCRIPTION The \fBradiusd.conf\fP file resides in the radius database directory, by default \fB/etc/raddb\fP. It defines the global configuration for the FreeRADIUS RADIUS server. .SH "CONTENTS" There are a large number of configuration parameters for the server. Most are documented in the file itself as comments. This page documents only the format of the file. Please read the \fBradiusd.conf\fP file itself for more information. The configuration file parser is independent of the server configuration. This means that you can put almost anything into the configuration file. So long as it is properly formatted, the server will start. When the server parses the configuration file, it looks only for those configurations it understands. Extra configuration items are ignored. This "feature" can be (ab)used in certain interesting ways. .SH "FILE FORMAT" The file format is line-based, like many other Unix configuration files. Each entry in the file must be placed on a line by itself, although continuations are supported. The file consists of configuration items (variable = value pairs), sections, and comments. .IP Variables Variables can be set via: .DS .br name = value .DE Single and double-quoted strings are permitted: .DS .br string1 = "hello world" .br string2 = 'hello mom' .DE .IP Sections A section begins with a section name, followed on the same line by an open bracket '\fB{\fP'. Section may contain other sections, comments, or variables. Sections may be nested to any depth, limited only by available memory. A section ends with a close bracket \'\fB}\fP', on a line by itself. .DS .br section { .br ... .br } .DE Sections can sometimes have a second name following the first one. The situations where this is legal depend on the context. See the examples and comments in the \fBradiusd.conf\fP file for more information. .DS .br section foo { .br ... .br } .DE .IP Comments Any line beginning with a (\fB#\fP) is deemed to be a comment, and is ignored. Comments can appear after a variable or section definitions. .DS .br # comment .br foo = bar # set variable 'foo' to value 'bar' .br section { # start of section .br ... .br } # end of section .DE .IP Continuations Long lines can be broken up via continuations, using '\\' as the last character of the line. For example, the following entry: .DS .br foo = "blah \\ .br blah \\ .br blah" .DE will set the value of the variable "foo" to "blah blah blah". Any CR or LF is not turned into a space, but all other whitespace is preserved in the final value. .SH "REFERENCES" The value of a variable can reference another variable. These references are evaluated when the configuration file is loaded, which means that there is no run-time cost associated with them. This feature is most useful for turning long, repeated pieces of text into short ones. Variables are referenced by ${variable_name}, as in the following examples. .DS foo = bar # set variable 'foo' to value 'bar' .br who = ${foo} # sets variable 'who' to value of variable 'foo' .br my = "${foo} a" # sets variable 'my' to "bar a" .DE If the variable exists in a section or subsection, it can be referenced as ${section.subsection.variable}. Forward references are not allowed. Relative references are allowed, by pre-pending the name with one or more period. .DS blogs = ${.foo} .DE Will set variable \fBblogs\fP to the value of variable \fBfoo\fP, from the current section. .DS blogs = ${..foo} .DE Will set variable \fBblogs\fP to the value of variable \fBfoo\fP, from the section which contains the current section. .DS blogs = ${modules.detail.detailfile} .DE Will set variable \fBblogs\fP to the value of variable \fBdetailfile\fP, of the \fBdetail\fP module, which is in the \fBmodules\fP section of the configuration file. .SH FILES /etc/raddb/radiusd.conf .SH "SEE ALSO" .BR radiusd (8) .BR unlang (5) .SH AUTHOR Alan DeKok freeradius-server/man/man5/radrelay.conf.5000066400000000000000000000106761257552170400207650ustar00rootroot00000000000000.\" # DS - begin display .de DS .RS .nf .sp .. .\" # DE - end display .de DE .fi .RE .sp .. .TH radrelay.conf 5 "27 May 2005" "" "FreeRADIUS configuration file" .SH NAME radrelay.conf \- configuration file for the FreeRADIUS server "radrelay" personality .SH DESCRIPTION The \fBradrelay.conf\fP file resides in the radius database directory, by default \fB/etc/raddb\fP. It defines the global configuration for the FreeRADIUS server, when the server is operating as "radrelay". .SH "FILE FORMAT" For a detailed description of the file format, see "man radiusd.conf". The configuration entries are much the same for radrelay.conf, with a few differences as noted here. .SH "REPLICATION FOR BACKUPS" Many sites run multiple radius servers; at least one primary and one backup server. When the primary goes down, most NASes detect that and switch to the backup server. That will cause your accounting packets to go the the backup server - and some NASes don't even switch back to the primary server when it comes back up. The result is that accounting records are missed, and/or the administrator must jump through hoops in order to combine the different detail files from multiple servers. It also means that the session database ("radutmp", used for radwho and simultaneous use detection) gets out of sync. radrelay solves this issue by "relaying" packets from one server to another, so they both have the same set of accounting data. .SH "BUFFERING FOR HIGH-LOAD SERVERS" If the RADIUS server suddenly receives a many accounting packets, there may be insufficient CPU power to process them all in a timely manner. This problem is especially noticable when the accounting packets are going to a back-end database. Similarly, you may have one database that tracks "live" sessions, and another that tracks historical accounting data. In that case, accessing the first database is fast, as it is small. Accessing the second database many be slower, as it may contain multiple gigabytes of data. In addition, writing to the first database in a timely manner is important, while data may be written to the second database with a few minutes delay, without any harm being done. .SH "RELAYING OF ACCOUNTING PACKETS" The \fBradrelay.conf\fP file controls the "radrelay" personality of the server, which can perform both of the functions above at the same time. .SH USAGE First, you should configure the main radius server to log to an extra, single detail file. This may be done by adding an extra instance of the detail module to \fBradiusd.conf\fP: For example: .DS detail radrelay-detail { .br detailfile = ${radacctdir}/radrelay/detail .br detailperm = 0600 .br dirperm = 0755 .br locking = yes .br } .br ... .br accounting { .br ... .br radrelay-detail .br ... .br } .br .DE This configuration will cause accounting packets to be logged to the \fI${radacctdir}/radrelay/detail\fP file. This file should not be rotated by standard log rotation scripts, as the \fBradrelay\fP program will read and rotate it. .SH RADRELAY.CONF EXAMPLE See the \fBradrelay.conf\fP file for detailed instructions on configuration entries, what they mean, and how to use them. To have the "radrelay" portion of the server read the above detail file, configure \fBradrelay.conf\fP with the following section: .DS .br listen { .br type = detail .br detail = ${radacctdir}/radrelay/detail .br max_outstanding = 100 .br identity = radrelay .br } .br .DE The server will read the accounting packets from the detail file, and process them just as if it had received them from the NAS. Therefore, you should configure the "accounting" section of \fBradrelay.conf\fP to write the accounting records to an "sql" module, or to proxy them to another RADIUS server. Then, start the server via the following command: $ radiusd -n radrelay The server should start up, read the detail file, and process accounting packets from it. .SH NOTES The \fBradiusd.conf\fP file is not read at all when the server is running as radrelay. Please edit \fBradrelay.conf\fP. .SH CREDITS The original "radrelay" program was written by Miquel van Smoorenburg for the Cistron radius project, and ported to FreeRADIUS by Simon Ekstrand. The "radsqlrelay" was written by Kostas Kalavras. It was never released as part of an offical FreeRADIUS release, but served as a basis for the design of this implementation. .PP .SH FILES /etc/raddb/radrelay.conf .SH "SEE ALSO" .BR radiusd (8), .BR radiusd.conf (5) .SH AUTHOR Alan DeKok freeradius-server/man/man5/rlm_acct_unique.5000066400000000000000000000037451257552170400214070ustar00rootroot00000000000000.\" # DS - begin display .de DS .RS .nf .sp .. .\" # DE - end display .de DE .fi .RE .sp .. .TH rlm_acct_unique 5 "3 February 2004" "" "FreeRADIUS Module" .SH NAME rlm_acct_unique \- FreeRADIUS Module .SH DESCRIPTION The \fIrlm_acct_unique\fP module creates a unique accounting session Id. .PP Many NAS vendors have their equipment supply an Acct-Session-Id attribute which is not unique over reboots. This makes accounting difficult, as there will be many independent sessions with the same Acct-Session-Id attribute. This module uses the Acct-Session-Id attribute, along with other attributes in the request, to create a more unique session ID, called Acct-Unique-Session-Id. .PP The main configuration items to be aware of are: .IP key A list of the attributes used in calculating an MD5 hash which is used as the value for the unique session id. .SH CONFIGURATION .DS modules { ... .br acct_unique { .br key = "User-Name, Acct-Session-Id, NAS-IP-Address, NAS-Port" .br } .br ... .br } .br ... .br preacct { ... .br acct_unique ... .br } .DE .PP After generating the MD5 hash, the module adds it to the accounting request packet received from the client. It will look something like this in your detail file: .PP .DS Acct-Unique-Session-Id = "c66ef57e480b9d26" .DE .PP NOTE: Any attribute you specify that is not found in the 'dictionary' file will cause the server to fail and exit with an error. .PP NOTE: If you want the Acct-Unique-Session-Id of the Start and the Stop packet of a particular session to match, you must use values for the key that will stay the same for the Start and Stop. The above example is a good start. Adding 'Acct-Session-Time', for example, would cause a mismatch because that value is not the same on the Start and Stop accounting packets. .PP .SH SECTIONS .BR authorization, .BR pre-accounting, .BR accounting .PP .SH FILES .I /etc/raddb/radiusd.conf .PP .SH "SEE ALSO" .BR radiusd (8), .BR radiusd.conf (5) .SH AUTHORS Chris Parker, cparker@segv.org freeradius-server/man/man5/rlm_always.5000066400000000000000000000027131257552170400204010ustar00rootroot00000000000000.\" # DS - begin display .de DS .RS .nf .sp .. .\" # DE - end display .de DE .fi .RE .sp .. .TH rlm_always 5 "3 February 2004" "" "FreeRADIUS Module" .SH NAME rlm_always \- FreeRADIUS Module .SH DESCRIPTION The \fIrlm_always\fP module provides a simple way to "always" return a value during the processing of a configuration section. The module does nothing other than return a configured value. .PP .PP The main configuration item to be aware of is: .IP rcode This module will always return with the rcode specified. The default, if none specified is: fail (RLM_MODULE_FAIL). .PP The valid options are: .IP reject RLM_MODULE_REJECT .IP fail RLM_MODULE_FAIL .IP ok RLM_MODULE_OK .IP handled RLM_MODULE_HANDLED .IP invalid RLM_MODULE_INVALID .IP userlock RLM_MODULE_USERLOCK .IP notfound RLM_MODULE_NOTFOUND .IP noop RLM_MODULE_NOOP .IP updated RLM_MODULE_UPDATED .SH CONFIGURATION .DS modules { ... .br always ok { .br rcode = ok .br } .br ... .br } .br ... .br authorize { ... .br redundant { sql1 # try to find the user in sql1 .br sql2 # try to find the user in sql2 .br ok # if still not found, it's OK. .br } ... .br } .DE .PP .SH SECTIONS .BR authorization, .BR authentication, .BR postauthentication, .BR preaccounting, .BR accounting, .BR preproxy, .BR postproxy .PP .SH FILES .I /etc/raddb/radiusd.conf .PP .SH "SEE ALSO" .BR radiusd (8), .BR radiusd.conf (5) .SH AUTHOR Chris Parker, cparker@segv.org freeradius-server/man/man5/rlm_attr_filter.5000066400000000000000000000106071257552170400214210ustar00rootroot00000000000000.\" # DS - begin display .de DS .RS .nf .sp .. .\" # DE - end display .de DE .fi .RE .sp .. .TH rlm_attr_filter 5 "12 February 2008" "" "FreeRADIUS Module" .SH NAME rlm_attr_filter \- FreeRADIUS Module .SH DESCRIPTION The \fIrlm_attr_filter\fP module exists for filtering certain attributes and values in received ( or transmitted ) radius packets. It gives the server a flexible framework to filter the attributes we send to or receive from home servers or NASes. This makes sense, for example, in an out-sourced dialup situation to various policy decisions, such as restricting a client to certain ranges of Idle-Timeout or Session-Timeout. .PP Filter rules are normally defined and applied on a per-realm basis, where the realm is anything that is defined and matched based on the configuration of the \fIrlm_realm\fP module. Filter rules can optionally be applied using another attribute, by editing the \fIkey\fP configuration for this module. .PP In 2.0.1 and earlier versions, the "accounting" section filtered the Accounting-Request, even though it was documented as filtering the response. This issue has been fixed in version 2.0.2 and later versions. The "preacct" section may now be used to filter Accounting-Request packets. The "accounting" section now filters Accounting-Response packets. Administrators using "attr_filter" in the "accounting" section SHOULD move the reference to "attr_filter" from "accounting" to "preacct". .PP The file that defines the attribute filtering rules follows a similar syntax to the \fIusers\fP file. There are a few differences however: .PP .DS There are no check-items allowed other than the name of the key. .PP There can only be a single DEFAULT entry. .PP The rules for each entry are parsed to top to bottom, and an attribute must pass *all* the rules which affect it in order to make it past the filter. Order of the rules is important. The operators and their purpose in defining the rules are as follows: .TP .B = THIS OPERATOR IS NOT ALLOWED. If used, and warning message is printed and it is treated as == .TP .B := Set, this attribute and value will always be placed in the output A/V Pairs. If the attribute exists, it is overwritten. .TP .B == Equal, value must match exactly. .TP .B =* Always Equal, allow all values for the specified attribute. .TP .B !* Never Equal, disallow all values for the specified attribute. ( This is redundant, as any A/V Pair not explicitly permitted will be dropped ). .TP .B != Not Equal, value must not match. .TP .B >= Greater Than or Equal .TP .B <= Less Than or Equal .TP .B > Greater Than .TP .B < Less Than .PP If regular expressions are enabled the following operators are also possible. ( Regular Expressions are included by default unless your system doesn't support them, which should be rare ). The value field uses standard regular expression syntax. .PP .TP .B =~ Regular Expression Equal .TP .B !~ Regular Expression Not Equal .PP See the default \fI/etc/raddb/attrs\fP for working examples of sample rule ordering and how to use the different operators. .DE .PP The configuration items are: .IP attrsfile This specifies the location of the file used to load the filter rules. This file is used to filter the accounting response, packet before it is proxied, proxy response from the home server, or our response to the NAS. .IP key Usually %{Realm} (the default). Can also be %{User-Name}, or other attribute that exists in the request. Note that the module always keys off of attributes in the request, and NOT in any other packet. .IP relaxed If set to 'yes', then attributes which do not match any filter rules explicitly, will also be allowed. This behaviour may be overridden for an individual filter block using the Relax-Filter check item. The default for this configuration item is 'no'. .PP .SH SECTIONS .IP preacct Filters Accounting-Request packets. .IP accounting Filters Accounting-Response packets. .IP pre-proxy Filters Accounting-Request or Access-Request packets prior to proxying them. .IP post-proxy Filters Accounting-Response, Access-Accept, Access-Reject, or Access-Challenge responses from a home server. .IP authorize Filters Access-Request packets. .IP post-auth Filters Access-Accept or Access-Reject packets. .PP .SH FILES .I /etc/raddb/radiusd.conf .I /etc/raddb/attrs .PP .SH "SEE ALSO" .BR radiusd (8), .BR radiusd.conf (5) .SH AUTHOR Chris Parker, cparker@segv.org freeradius-server/man/man5/rlm_attr_rewrite.5000066400000000000000000000026471257552170400216220ustar00rootroot00000000000000.TH rlm_attr_rewrite 5 "3 February 2004" "" "FreeRADIUS Module" .SH NAME rlm_attr_rewrite \- FreeRADIUS Module .SH DESCRIPTION The \fIrlm_attr_rewrite\fP module provides functionality to rewrite data in radius packets on the fly. This can be useful in authorization and accounting functions. .PP The main configuration items to be aware of are: .IP attribute The name of the attribute that you want to be rewritten .IP searchfor String to be replaced. .IP searchin Where to look for the attribute. Valid values are: .BR packet, .BR reply, .BR proxy, .BR proxy_reply, .BR config .IP replacewith String to replace "searchfor". .IP append Set to yes or no. If set to yes then the replace string will be appended to the original string. .IP ignore_case Set to yes or no. Determines whether search will be case insensitive or case sensitive. .IP new_attribute Set to yes or no. If set to yes, then new attribute will be created with values from "searchin" and "replacewith". Other options will be ignored. .IP max_matches Set the max number of attributes to match against. This is useful if you need to rewrite the value in multiple Vendor Specific Attributes. .PP .SH SECTIONS .BR authorization, .BR authentication, .BR postauthentication, .BR preaccounting, .BR accounting, .BR preproxy, .BR postproxy .PP .SH FILES .I /etc/raddb/radiusd.conf .PP .SH "SEE ALSO" .BR radiusd (8), .BR radiusd.conf (5) .SH AUTHOR Chris Parker, cparker@segv.org freeradius-server/man/man5/rlm_chap.5000066400000000000000000000014321257552170400200110ustar00rootroot00000000000000.TH rlm_chap 5 "3 February 2004" "" "FreeRADIUS Module" .SH NAME rlm_chap \- FreeRADIUS Module .SH DESCRIPTION The \fIrlm_chap\fP module provides CHAP functionality. .PP This module validates a user with CHAP authentication. If called in Authorize, it will look for CHAP-Password attribute in the Acess-Request and adds an Auth-Type attribute set to CHAP if the Config-Items list unless Auth-Type has already set. .PP CHAP authentication requires access to the clear-text password for the user. Standard Unix system authentication or passwords encrypted via crypt() are not compatible with CHAP. .PP .SH SECTIONS .BR authorization, .BR authentication .PP .SH FILES .I /etc/raddb/radiusd.conf .PP .SH "SEE ALSO" .BR radiusd (8), .BR radiusd.conf (5) .SH AUTHOR Chris Parker, cparker@segv.org freeradius-server/man/man5/rlm_counter.5000066400000000000000000000057131257552170400205630ustar00rootroot00000000000000.\" # DS - begin display .de DS .RS .nf .sp .. .\" # DE - end display .de DE .fi .RE .sp .. .TH rlm_counter 5 "13 March 2004" "" "FreeRADIUS Module" .SH NAME rlm_counter \- FreeRADIUS Module .SH DESCRIPTION The \fIrlm_counter\fP module provides a general framework to allow access based on accumulated usage of a resource, such as total time online in a given period, total data transferred in a given period, etc. This is very useful in a 'Prepaid Service' situation, where a user has paid for a finite amount of usage and should not be allowed to use more than that service. Collection, monitoring, and replenishment of prepaid services are beyond the scope of this module. .PP The main configuration items to be aware of are: .IP filename The filename where the usage data is stored. .IP key An attribute which will be present in the Access-Request to be used as the 'index' value for the counter. A counter entry is tracked for each unique key. The most likely key you will want to use is User-Name. .IP count-attribute An attribute which will be used to increment the counter value. If this attribute is Acct-Session-Time or an integer value the counter data is incremented by the Attribute value. For all other attribute types the counter is incremented by one. .IP reset How frequently the counter data should be set back to 0. Valid values for this variable are: .BR hourly, .BR daily, .BR weekly, .BR monthly, .BR or never Alternatively, it can be user defined, in the form: num[hdwm]. num is a numeric value, followed by one or none of the following letters. h: hours, d: days, w: weeks, m: months. .IP check-name This defines an attribute name which will be registered by the counter module and can be used to set the maximum allowed value for the counter after which the user is rejected. If Daily-Session-Time is set, you can use the following syntax in the Users file to set a cap of 3600 seconds ( 8 hours ): .PP .DS DEFAULT Max-Daily-Session := 3600 .DE .PP .IP reply-name This is the name of the attribute which will contain the remaining value for the counter in the reply packet when the user is successfully authorized. The default attribute name is "Session-Timeout". .IP allowed-servicetype This can be used to only apply the limitations to specific service types of sessions. For example, setting this to Framed-User will only apply the counter module to Framed sessions, excluding other types such as Telnet or Rlogin. .IP cache-size The maximum size of the cache to be used by the module. The default is 1000. .SH NOTES This module registers an attribute, so it should be added to the instantiate section, to be called on server startup. When used in the authorize section, it must come after any modules which set the 'check-name' attribute. .PP .SH SECTIONS .BR instantiate, .BR authorize, .BR accounting .PP .SH FILES .I /etc/raddb/radiusd.conf .PP .SH "SEE ALSO" .BR radiusd (8), .BR radiusd.conf (5) .BR rlm_sqlcounter (5) .SH AUTHOR Chris Parker, cparker@segv.org freeradius-server/man/man5/rlm_detail.5000066400000000000000000000035221257552170400203420ustar00rootroot00000000000000.\" # DS - begin display .de DS .RS .nf .sp .. .\" # DE - end display .de DE .fi .RE .sp .. .TH rlm_detail 5 "5 February 2004" "" "FreeRADIUS Module" .SH NAME rlm_detail \- FreeRADIUS Module .SH DESCRIPTION The \fIrlm_detail\fP module writes radius packets to 'detail' files. It is primarily used for storing accounting information, but can be used in other sections to write packet details as well. .PP The file format is similar to that of the old Livingston servers, and many 'detail' file parsers should work with FreeRADIUS. .PP The main configuration items to be aware of are: .IP detailfile The file name in which to store the radius packet records. NOTE: this variable is run through dynamic string expansion, and can include FreeRADIUS variables to create a dynamic filename. .PP %{radacctdir}/%{Client-IP-Address}/detail-%Y%m .PP This will create one file per month, for each client. This accomplishes 'file rotation' automatically from within the server. .PP .IP detailperm The file permissions of the detailfile. If omitted, the default is 0600. .IP dirperm The directory permissions of the directory where the detail files are created. The default is 0755. .IP locking This option is set to 'yes' or 'no'. By default it is 'no'. Set this to yes to enable file locking, which is used with the 'radrelay' program. .SH CONFIGURATION .PP .DS modules { ... .br detail { .br detailfile = %A/%{Client-IP-Address}/detail-%Y%m .br detailperm = 0600 .br dirperm = 0755 .br locking = no .br } .br ... .br } ... .br accounting { ... .br detail ... .br } .DE .PP .SH SECTIONS .BR authorization, .BR accounting, .BR pre_proxy, .BR post_proxy, .BR post_authentication .PP .SH FILES .I /etc/raddb/radiusd.conf .PP .SH "SEE ALSO" .BR radiusd (8), .BR radiusd.conf (5) .SH AUTHORS Chris Parker, cparker@segv.org freeradius-server/man/man5/rlm_digest.5000066400000000000000000000032261257552170400203600ustar00rootroot00000000000000.\" # DS - begin display .de DS .RS .nf .sp .. .\" # DE - end display .de DE .fi .RE .sp .. .TH rlm_digest 5 "31 March 2005" "" "FreeRADIUS Module" .SH NAME rlm_digest \- FreeRADIUS Module .SH DESCRIPTION The \fIrlm_digest\fP module authenticates RADIUS Access-Request packets that contain Cisco SIP digest authentication attributes. The module should be listed in the \fIauthorize\fP and \fIauthenticate\fP sections of \fIradiusd.conf\fP. .SH CONFIGURATION The digest module requires no additional configuration items. When it is being used to authenticate requests, however, it does require access to the clear-text password for the user. Hashed passwords are not acceptable, and will not work. .SH EXAMPLES Add the following lines to the top of your 'raddb/users' file: .PP .DS #--- .br test Auth-Type := Digest, User-Password = "test" .br Reply-Message = "Hello, test with digest" .br #--- .DE Once the server has been started (debugging mode is recommended), use '\fIradclient\fP to send the following packet to the server: .PP .DS $ radclient -f digest localhost auth testing123 .DE Where 'digest' is a file containing: .PP .DS User-Name = "test", .br Digest-Response = "631d6d73147add2f9e437f59bbc3aeb7", .br Digest-Realm = "testrealm", .br Digest-Nonce = "1234abcd", .br Digest-Method = "INVITE", .br Digest-URI = "sip:5555551212@example.com", .br Digest-Algorithm = "MD5", .br Digest-User-Name = "test", .br Message-Authenticator = "" .DE You should see the authentication succeed. .SH SECTIONS .BR authorize, .BR authenticate .PP .SH FILES .I /etc/raddb/radiusd.conf, .I draft-sterman-aaa-sip-00.txt .PP .SH AUTHOR Alan DeKok freeradius-server/man/man5/rlm_expr.5000066400000000000000000000037641257552170400200660ustar00rootroot00000000000000.\" # DS - begin display .de DS .RS .nf .sp .. .\" # DE - end display .de DE .fi .RE .sp .. .TH rlm_expr 5 "5 February 2004" "" "FreeRADIUS Module" .SH NAME rlm_expr \- FreeRADIUS Module .SH DESCRIPTION The \fIrlm_expr\fP module allows the server to perform limited mathematical calculations. This module is not called directly in any section, it is invoked through the dynamic expansion of strings. .PP For example, some NAS boxes send a NAS-Port attribute which is a 32-bit number composed of port, card, and interface, all in different bytes. To see these attributes split into pieces, you can have an entry in the 'users' file like: .DS DEFAULT .br Vendor-Interface = `%{expr: %{NAS-Port} / (256 * 256)}`, .br Vendor-Card = `%{expr: (%{NAS-Port} / 256) %% 256}`, .br Vendor-Port = `%{expr: %{NAS-Port} %% 256}` .br .DE where the attributes Vendor-Interface, Vendor-Card, and Vendor-Port are attributes created by either you or a vendor-supplied dictionary. The methematical operators supported by the expression module are: .TP .B + addition .TP .B - subtraction .TP .B / division .TP .B %% modulo remainder .TP .B * multiplication .TP .B & boolean AND .TP .B | boolean OR .TP .B () grouping of sub-expressions .PP NOTE: The modulo remainder operator is '%%', and not '%'. This is due to the '%' character being used as a special character for dynamic translation. .PP NOTE: These operators do NOT have precedence. The parsing of the input string, and the calculation of the answer, is done strictly left to right. If you wish to order the expressions, you MUST group them into sub-expression, as shown in the previous example. .PP All of the calculations are performed as unsigned 32-bit integers. .DE .SH CONFIGURATION .DS modules { ... .br expr { .br } .br ... .br } .br ... .br instantiate { ... .br expr ... .br } .SH SECTIONS .BR instantiate .PP .SH FILES .I /etc/raddb/radiusd.conf .PP .SH "SEE ALSO" .BR radiusd (8), .BR radiusd.conf (5) .SH AUTHOR Chris Parker, cparker@segv.org freeradius-server/man/man5/rlm_files.5000066400000000000000000000047661257552170400202150ustar00rootroot00000000000000.\" # DS - begin display .de DS .RS .nf .sp .. .\" # DE - end display .de DE .fi .RE .sp .. .TH rlm_files 5 "5 February 2004" "" "FreeRADIUS Module" .SH NAME rlm_files \- FreeRADIUS Module .SH DESCRIPTION The \fIrlm_files\fP module uses the 'users' file for accessing authorization information for users. Additionally, it supports a 'users' file syntax to be applied to the accounting and pre-proxy sections. .PP The main configuration items to be aware of are: .IP usersfile The filename of the 'users' file, which is parsed during the authorization stage of this module. .IP acctusersfile The filename of the 'users' file, which is parsed during the accounting stage of this module. .IP preproxy_usersfile The filename of the 'users' file, which is parsed during the pre_proxy stage of this module. .IP compat This option allows FreeRADIUS to parse an old style Cistron syntax. The default is 'no'. If you need to parse an old style Cistron file, set this option to 'cistron'. .IP key This option lets you set the attribute to use as a key to find entries. The default is "%{Stripped-User-Name:-%{User-Name}}". Note that the key MUST supply real data. Dynamic attributes like "Group" will not work, because the "Group" attribute can only be used as a comparison, to see if a user is in a Unix group. It will not return the name of the Unix group that a user is in. .PP If you want to use groups as a key, see the \fIrlm_passwd\fP, which will create a real attribute that contains the group name. .PP This configuration entry enables you to have configurations that perform per-group checks, and return per-group attributes, where the group membership is dynamically defined by a previous module. It also lets you do things like key off of attributes in the reply, and express policies like like "when I send replies containing attribute FOO with value BAR, do more checks, and maybe send additional attributes". .SH CONFIGURATION .PP .DS modules { ... stuff here ... .br files { .br usersfile = %{confdir}/users .br acctusersfile = %{confdir}/acct_users .br preproxy_usersfile = %{confdir}/preproxy_users .br compat = no .br key = %{Stripped-User-Name:-%{User-Name}} .br } .br ... stuff here ... .br } .DE .PP .SH SECTIONS .BR authorization, .BR accounting, .BR pre_proxy .PP .SH FILES .I /etc/raddb/radiusd.conf, .I /etc/raddb/users, .I /etc/raddb/acct_users, .I /etc/raddb/preproxy_users .PP .SH "SEE ALSO" .BR radiusd (8), .BR radiusd.conf (5), .BR users (5) .SH AUTHORS Chris Parker, cparker@segv.org freeradius-server/man/man5/rlm_mschap.5000066400000000000000000000046731257552170400203630ustar00rootroot00000000000000.\" # DS - begin display .de DS .RS .nf .sp .. .\" # DE - end display .de DE .fi .RE .sp .. .TH rlm_mschap 5 "13 March 2004" "" "FreeRADIUS Module" .SH NAME rlm_mschap \- FreeRADIUS Module .SH DESCRIPTION The \fIrlm_mschap\fP module provides MS-CHAP and MS-CHAPv2 authentication support. .PP This module validates a user with MS-CHAP or MS-CHAPv2 authentication. If called in Authorize, it will look for MS-CHAP Challenge/Response attributes in the Acess-Request and adds an Auth-Type attribute set to MS-CHAP in the Config-Items list unless Auth-Type has already set. .PP The module can authenticate the MS-CHAP session via plain-text passwords (User-Password attribute), or NT passwords (NT-Password attribute). The module cannot perform authentication against an NT domain. .PP The module also enforces the SMB-Account-Ctrl attribute. See the Samba documentation for the meaning of SMB account control. The module does not read Samba password files. Instead, the fIrlm_passwd\fP module can be used to read a Samba password file, and supply an NT-Password attribute which this module can use. .PP The main configuration items to be aware of are: .IP authtype This is the string used to set the authtype. Normally it should be left to the default value of MS-CHAP. .IP use_mppe Unless this is set to 'no', FreeRADIUS will add MS-CHAP-MPPE-Keys for MS-CHAPv1 and MS-MPPE-Recv-Key/MS-MPPE-Send-Key for MS-CHAPv2. The default is 'yes'. .IP require_encryption If MPPE is enabled, setting this attribute to 'yes' will cause the MS-MPPE-Encryption-Policy attribute to be set to require encryption. The default is 'no'. .IP require_strong If MPPE is enabled, setting this attribute to 'yes' will cause the MS-MPPE-Encryption-Types attribute to be set to require a 128 bit key. The default is 'no'. .IP with_ntdomain_hack Windows clients send User-Name in the form of "DOMAIN\\User", but send the challenge/response based only on the User portion. Setting this value to yes, enables a work-around for this error. The default is 'no'. .PP .SH CONFIGURATION .DS modules { ... .br mschap { .br authtype = MS-CHAP .br use_mppe = yes .br } .br ... .br } .br ... .br authorize { ... .br mschap .br ... .br } ... .br authenticate { ... .br mschap .br ... .br } .DE .PP .SH SECTIONS .BR authorization, .BR authentication .PP .SH FILES .I /etc/raddb/radiusd.conf .PP .SH "SEE ALSO" .BR radiusd (8), .BR radiusd.conf (5) .SH AUTHOR Chris Parker, cparker@segv.org freeradius-server/man/man5/rlm_pap.5000066400000000000000000000060031257552170400176550ustar00rootroot00000000000000.\" # DS - begin display .de DS .RS .nf .sp .. .\" # DE - end display .de DE .fi .RE .sp .. .TH rlm_pap 5 "6 June 2008" "" "FreeRADIUS Module" .SH NAME rlm_pap \- FreeRADIUS Module .SH DESCRIPTION The \fIrlm_pap\fP module authenticates RADIUS Access-Request packets that contain a User-Password attribute. The module should also be listed last in the \fIauthorize\fP section, so that it can set the Auth-Type attribute as appropriate. .PP When a RADIUS packet contains a clear-text password in the form of a User-Password attribute, the \fIrlm_pap\fP module may be used for authentication. The module requires a "known good" password, which it uses to validate the password given in the RADIUS packet. That "known good" password must be supplied by another module (e.g. \fIrlm_files\fP, \fIrlm_ldap\fP, etc.), and is usually taken from a database. .SH CONFIGURATION .PP The only relevant configuration item is: .IP auto_header If set to "yes", the module will look inside of the User-Password attribute for the headers {crypt}, {clear}, etc., and will automatically create the appropriate attribute, with the correct value. .PP This module understands many kinds of password hashing methods, as given by the following table. .PP .DS .br Header Attribute Description .br ------ --------- ----------- .br {clear} Cleartext-Password clear-text passwords .br {cleartext} Cleartext-Password clear-text passwords .br {crypt} Crypt-Password Unix-style "crypt"ed passwords .br {md5} MD5-Password MD5 hashed passwords .br {smd5} SMD5-Password MD5 hashed passwords, with a salt .br {sha} SHA-Password SHA1 hashed passwords .br {ssha} SSHA-Password SHA1 hashed passwords, with a salt .br {nt} NT-Password Windows NT hashed passwords .br {x-nthash} NT-Password Windows NT hashed passwords .br {lm} LM-Password Windows Lan Manager (LM) passwords. .DE The module tries to be flexible when handling the various password formats. It will automatically handle Base-64 encoded data, hex strings, and binary data, and convert them to a format that the server can use. .PP It is important to understand the difference between the User-Password and Cleartext-Password attributes. The Cleartext-Password attribute is the "known good" password for the user. Simply supplying the Cleartext-Password to the server will result in most authentication methods working. The User-Password attribute is the password as typed in by the user on their private machine. The two are not the same, and should be treated very differently. That is, you should generally not use the User-Password attribute anywhere in the RADIUS configuration. .PP For backwards compatibility, there are old configuration parameters which may be work, although we do not recommend using them. .SH SECTIONS .BR authorize .BR authenticate .PP .SH FILES .I /etc/raddb/radiusd.conf .PP .SH "SEE ALSO" .BR radiusd (8), .BR radiusd.conf (5) .SH AUTHOR Alan DeKok freeradius-server/man/man5/rlm_passwd.5000066400000000000000000000076651257552170400204150ustar00rootroot00000000000000.\" # DS - begin display .de DS .RS .nf .sp .. .\" # DE - end display .de DE .fi .RE .sp .. .TH rlm_passwd 5 "14 April 2004" "" "FreeRADIUS Module" .SH NAME rlm_passwd \- FreeRADIUS Module .SH DESCRIPTION The \fIrlm_passwd\fP module provides authorization via files similar in format to /etc/passwd. .PP The \frlm_passwd\fP module allows you to retrieve any account information from any files with passwd-like format (/etc/passwd, /etc/group, smbpasswd, .htpasswd, etc). Every field of the file may be mapped to a RADIUS attribute, with one of the fields used as a key. .PP The module reads the file when it initializes, and caches the data in memory. As a result, it does not support dynamic updates of the files (the server has to be HUP'd), but it is very fast, even for files with thousands of lines. .PP The configuration item(s): .IP filename The path to the file. .IP delimiter\ =\ ":" The character to use as a delimiter between fields. The default is ":" .IP hashsize The size of the hashtable. If 0, then the passwords are not cached and the passwd file is parsed for every request. We do not recommend such a configuration. A larger hashsize means less probability of collision and faster search in hashtable. Having a hashsize in the range of 30-100% of the number of passwd file records is reasonable. .IP allowmultiplekeys If set to 'yes', and more than one record in file matches the request, then the attributes from all records will be used. If set to 'no' (the default) the module will warn about duplicated records. .IP ignorenislike If set to 'yes', then all records from the file beginning with the '+' sign will be ignored. The default is 'no'. .IP format The format of the fields in the file, given as an example line from the file, with the content of the fields as the RADIUS attributes which the fields map to. The fields are seperated by the ':' character. .PP The key field is signified by being preceded with a '*' character, which indicates that the field has only one key, like the /etc/passwd file. The key field may instead be preceded with '*,', which indicates that the field has multiple possible keys, like the /etc/group file. .PP The other fields signify RADIUS attributes which, by default, are added to the configuration items for a request. .PP To add an attribute to the request (as though it was sent by the NAS), prefix the attribute name in the "format" string with the '~' character. .PP To add an attribute to the reply (to be sent back to the NAS) prefix the attribute name in the "format" string with the '=' character. .IP ignoreempty This configuration item defaults to "yes". If there is no value for the attribute, then the attribute is not added. By setting this value to "no", you can force the attribute to be added, even if there is no value. .SH EXAMPLES .DS format = "My-Group:::*,User-Name" .DE .IP Parse a file similar to the /etc/group file. An entry matches a request when the name in a User-Name attribute exists in the comma-seperated list of a line in the file. When an entry matches, a "My-Group" attribute will be created and added to the configuration items for the request. The value of that attribute will be taken from the first field of the matching line in the file. .IP The ":::" in the format string means that there are extra two fields in the line, in between the group name and list of user names. Those fields do not map to any RADIUS attribute, and are therefore ignored. .IP For this example to work in practice, you will have to add the My-Group attribute to the dictionary file. See the dictionary manual page for details on how this may be done. .PP .DS format = "~My-Group:::*,User-Name" .DE .IP Similar to the previous entry, except the My-Group attribute is added to the request, as though it was sent by the NAS. .SH SECTIONS .BR authorize .PP .SH FILES .I /etc/raddb/radiusd.conf .PP .SH "SEE ALSO" .BR radiusd (8), .BR radiusd.conf (5) .BR dictionary (5), .SH AUTHOR Alan DeKok freeradius-server/man/man5/rlm_policy.5000066400000000000000000000126071257552170400204030ustar00rootroot00000000000000.\" # DS - begin display .de DS .RS .nf .sp .. .\" # DE - end display .de DE .fi .RE .sp .. .TH rlm_policy 5 "7 December 2004" "" "FreeRADIUS Module" .SH NAME rlm_policy \- FreeRADIUS Module .SH DESCRIPTION The \fBrlm_policy\fP module implements a simple "policy" language. .PP The policy language implemented by this module is simple, and specific to RADIUS. It does not implement variables, arrays, loops, goto's, or any other feature of a real language. If those features are needed for your system, we suggest using \fBrlm_perl\fP. .PP What the policy module implements is a simple way to look for attributes in the request packet (or other places), and to add attributes to the reply packet (or other places) based on those decisions. Where the module shines is that it is significantly more flexible than the old-style \fBusers\fP file. .PP The module has one configuration item: .IP filename The file where the policy is stored. .SH POLICY LANGUAGE .SS Named policies The policy is composed of a series of named policies. The following example defines a policy named "foo". .PP .DS policy foo { .br ... .br } .DE .PP Policy names MAY NOT be the same as attributes in the dictionary. Defining a policy with the same name as a dictionary attribute will cause an error message to be printed, and the policy will not be loaded. .PP When the policy module is listed in a module section like "authorize", the module calls a policy named "authorize". The "post-auth", etc. sections behave the same. These names cannot be changed. .PP .DS include "policy.txt" .DE .PP The filename must be in a double-quoted string, and is assumed to be relative to the location of the current file. If the filename ends with a '/', then it is assumed to be a directory, and all files in that directory will be read. .PP .DS include "dir/" .DE .PP All file in "dir/" will be read and included into the policy definition. Any dot files (".", "..", etc.) will not be included, however. .PP .SS Including multiple files The main file referred to from the \fIradiusd.conf\fP may include one or more other files, as in the following example. .PP .SS Referencing a named policy The following example references a named policy .DS foo() .DE While the brackets are required, no arguments may be passed. .PP .SS Conditions "if" statements are supported. .PP if (expression) { .br ... .br } .DE .PP and "else" .PP if (expression) { .br ... .br } else { .br ... .br } .DE .PP also, "else if" .PP if (expression) { .br ... .br } else if (expression) { .br ... .br } .DE .PP .SS Expressions within "if" statements Always have to have brackets around them. Sorry. .PP The following kinds of expressions may be used, with their meanings. .IP (attribute-reference) TRUE if the referenced attribute exists, FALSE otherwise. See below for details on attribute references. .IP (!(expression)) FALSE if the expression returned TRUE, and TRUE if the nested expression returned FALSE. .IP "(attribute-reference == value)" Compares the attribute to the value. The operators here can be "==", "!=", "=~", "!~", "<", "<=", ">", and ">=". .IP "(string1 == string2)" A special case of the above. The "string1" is dynamically expanded at run time, while "string2" is not. The operators here can be "==", "!=", "=~",and "!~". Of these, the most useful is "=~', which lets you do things like ("%{ldap:query...}" =~ "foo=(.*) "). The results of the regular expression match are put into %{1}, and can be used later. See "doc/variables.txt" for more information. .IP "((expression1) || (expression2))" Short-circuit "or". If expression1 is TRUE, expression2 is not evaluated. .IP "((expression1) && (expression2))" Short-circuit "and". If expression1 is FALSE, expression2 is not evaluated. .IP Limitations. The && and || operators have equal precedence. You can't call a function as a expression. .PP .PP .SS Attribute references Attribute references are: .IP Attribute-Name Refers to an attribute of that name in the Access-Request or Accounting-Request packet. May also refer to "server-side" attributes, which are not documented anywhere. .IP request:Attribute-Name An alternate way of referencing an attribute in the request packet. .PP .IP reply:Attribute-Name An attribute in the reply packet .PP .IP proxy-request:Attribute-Name An attribute in the Access-Request or Accounting-Request packet which will be proxied to the home server. .PP .IP proxy-reply:Attribute-Name An attribute in the Access-Accept or other packet which was received from a home server. .PP .IP control:Attribute-Name An attribute in the per-request configuration and control attributes. Also known as "check" attributes (doc/variables.txt). .PP .PP .SS Adding attributes to reply packet (or other location) reply .= { .br attribute-name = value .br ... .br attribute-name = value .br } .DE .PP The first name can be "request", "reply", "control", "proxy-request", or "proxy-reply". .PP The operator can be .PP .= - appends attributes to end of the list .PP := - replaces existing list with the attributes in the list (bad idea) .PP = - use operators from "attribute = value" to decide what to do. (see "users") .PP The block must contain only attributes and values. Nothing else is permitted. .SH SECTIONS .BR authorize .BR post-auth .BR pre-proxy .BR post-proxy .PP .SH FILES .I /etc/raddb/radiusd.conf .PP .SH "SEE ALSO" .BR radiusd (8), .BR users (5), .BR radiusd.conf (5) .SH AUTHOR Alan DeKok freeradius-server/man/man5/rlm_realm.5000066400000000000000000000044301257552170400201770ustar00rootroot00000000000000.\" # DS - begin display .de DS .RS .nf .sp .. .\" # DE - end display .de DE .fi .RE .sp .. .TH rlm_realm 5 "14 March 2004" "" "FreeRADIUS Module" .SH NAME rlm_realm \- FreeRADIUS Module .SH DESCRIPTION The \fIrlm_realm\fP module parses the User-Name attribute into a User section and a Realm section. This is used primarily in a proxy situation, however, Realms can also be used locally to provide different service profiles based on the Realm being used. .PP The main configuration items to be aware of are: .IP format This can be either 'prefix' or 'suffix'. It specifies whether the Realm is before or after the User portion in the User-Name string. .IP delimiter A single character in quotes, which is used as the delimiting character that separates the Realm and User sections of the string. .IP ignore_default This is set to either 'yes' or 'no'. If set to 'yes', this will prevent the module instance from matching a realm against the DEFAULT entry. This may be useful if you have multiple realm module instances. The default is 'no'. .IP ignore_null This is set to either 'yes' or 'no'. If set to 'yes', this will prevent the module instance from matching a realm against the NULL entry. This may be useful if you have multiple realm module instances. The default is 'no'. .PP This module parses the realm from the User-Name attrbiute according to the instance configuration, and then performs a lookup to find a matching realm in the '/etc/raddb/proxy.conf' file. Depending on the configuration of the Realm as matched in the file, the username may be rewritten in a 'stripped' format, or with the Realm portion removed. In either case, a Realm attribute is created and added to the packet on a match, which can be used by other modules. .SH CONFIGURATION .PP .DS modules { ... stuff here ... .br .br # useranme@realm syntax .br realm suffix { .br format = suffix .br delimiter = "@" .br } .br .br # realm/username syntax .br realm prefix { .br format = prefix .br delimiter = "/" .br } .br .br ... stuff here ... .br } .DE .PP .SH SECTIONS .BR authorization, .BR pre-accounting .PP .SH FILES .I /etc/raddb/radiusd.conf, .I /etc/raddb/proxy.conf .PP .SH "SEE ALSO" .BR radiusd (8), .BR radiusd.conf (5), .BR proxy.conf (5) .SH AUTHORS Chris Parker, cparker@segv.org freeradius-server/man/man5/rlm_sql.5000066400000000000000000000116111257552170400176750ustar00rootroot00000000000000.\" # DS - begin display .de DS .RS .nf .sp .. .\" # DE - end display .de DE .fi .RE .sp .. .TH rlm_sql 5 "5 February 2004" "" "FreeRADIUS Module" .SH NAME rlm_sql \- FreeRADIUS Module .SH DESCRIPTION The \fIrlm_sql\fP module provides an SQL interface to retrieve authorization information and store accounting information. It can be used in conjunction with, or in lieu of the files and detail modules. The SQL module has drivers to support the following SQL databases: .PP .DS .br db2 .br iodbc .br mysql .br oracle .br postgresql .br sybase .br unixodbc .br .DE .PP Due to the size of the configuration variables, the sql module is usually configured in a separate file, which is included in the main radiusd.conf via an include directive. .PP The main configuration items to be aware of are: .IP driver This variable specifies the driver to be loaded. .IP server .IP login .IP password These specify the servername, username, and password the module will use to connect to the database. .IP radius_db The name of the database where the radius tables are stored. .IP acct_table1 .IP acct_table2 These specify the tables names for accounting records. acct_table1 specifies the table where Start records are stored. acct_table2 specifies the table where Stop records are stored. In most cases, this should be the same table. .IP postauth_table The name of the table to store post-authentication data. .IP authcheck_table .IP authreply_table The tables where individual Check-Items and Reply-Items are stored. .IP groupcheck_table .IP groupreply_table The tables where group Check-Items and Reply-Items are stored. .IP usergroup_table The table where username to group relationships are stored. .IP deletestatlesessions This option is set to 'yes' or 'no'. If you are doing Simultaneous-Use checking, and this is set to yes, stale sessions ( defined as sessions for which a Stop record was not received ) will be cleared. .IP sqltrace .IP sqltracefile These two options are useful for debugging sql problems. If sqltrace is set to yes, then all sql queries being executed are written to the file listed in sqltracefile. This is disabled in normal operation. .IP num_sql_socks The number of sql connections to make to the database. .IP connect_failure_retry_delay The number of seconds to wait before attempting to reconnect to a failed database connection. .IP sql_user_name This is the definition of the SQL-User-Name attribute. This is set once, so that you can use %{SQL-User-Name} in the SQL queries, rather than the nested username substitution. This ensures that Username is parsed consistently for all SQL queries executed. .IP default_user_profile This is the default profile name that will be applied to all users if set. This is not set by default. .IP query_on_not_found This option is set to 'yes' or 'no'. If set to yes, then the default user profile is returned if no specific match was found for the user. .IP authorize_check_query .IP authorize_reply_query These queries are run during the authorization stage to extract the user authorization information from the ${authcheck_table} and ${authreply_table}. .IP authorize_group_check_query .IP authorize_group_reply_query These queries are run during the authorization stage to extract the group authorization information from the ${groupcheck_table} and ${groupreply_table}. .IP accounting_onoff_query The query to be run when receiving an Accounting On or Accounting Off packet. .IP accounting_update_query .IP accounting_update_query_alt The query to be run when receiving an Accounting Update packet. If the primary query fails, the alt query is run. .IP accounting_start_query .IP accounting_start_query_alt The query to be run when receiving an Accounting Start packet. If the primary query fails, the alt query is run. .IP accounting_stop_query .IP accounting_stop_query_alt The query to be run when receiving an Accounting Stop packet. If the primary query fails, the alt query is run. .IP simul_count_query The query to be run to return the number simultaneous sessions for the purposes of limiting Simultaneous Use. .IP simul_verify_query The query to return the detail information needed to confirm that all suspected connected sessions are valid, and are not stale sessions. .IP group_membership_query The query to run to check user group membership. .IP postauth_query The query to run during the post-authentication stage. .SH CONFIGURATION .PP Due to the size of the configuration for this module, it is not included in this manual page. Please review the supplied configuration files for example queries and configuration details. .SH SECTIONS .BR authorization, .BR accounting, .BR checksimul, .BR post-authentication .PP .SH FILES .I /etc/raddb/radiusd.conf, .I /etc/raddb/sql.conf, .I /etc/raddb/sql//dialup.conf, .I /etc/raddb/sql//schema.sql, .BR .PP .SH "SEE ALSO" .BR radiusd (8), .BR radiusd.conf (5), .SH AUTHORS Chris Parker, cparker@segv.org freeradius-server/man/man5/rlm_sql_log.5000066400000000000000000000070461257552170400205450ustar00rootroot00000000000000.\" # DS - begin display .de DS .RS .nf .sp .. .\" # DE - end display .de DE .fi .RE .sp .. .TH rlm_sql_log 5 "28 May 2005" "" "FreeRADIUS Module" .SH NAME rlm_sql_log \- FreeRADIUS Module .SH DESCRIPTION The \fBrlm_sql_log\fP module appends the SQL queries in a log file which is read later by the scripts/radsqlrelay Perl program. .PP The purpose of this module is to de-couple the storage of long-term accounting data in SQL from "live" information needed by the RADIUS server as it's running. If you are not using SQL for simultaneous login restrictions (i.e. "sql" is not listed in the "session" section of "radiusd.conf"), then this module allows you to log SQL queries to a file, and then process them at your leisure. .PP The benefit of this approach is that for a busy server, the overhead of performing SQL qeuries may be significant. Also, if the SQL databases are large (as is typical for ones storing months of data), the INSERTs and UPDATEs may take a relatively long time. Rather than slowing down the RADIUS server by having it interact with a database, you can just log the queries to a file, and then run those queries on another machine, or at a time when the RADIUS server is typically lightly loaded. .PP If the "sql" module is listed in the "session" section of "radiusd.conf", then a similar system can still be used. In that case, one database would be used to maintain "live" session information. That database would be small, fast, and information would be deleted from it when a user logs out. A second database would store long-term accounting information, as described above. .SH LIMITATIONS This module only performs the dynamic expansion of the variables found in the SQL statements. No operation is executed on the database server. (this would be done later by an external program) That means the module is useful only with non-"SELECT" statements. .SH CONFIGURATION The main configuration items to be aware of are the path of the log file and the different SQL queries. .IP "path" An entry named "path" sets the full path of the file where the SQL queries are recorded. (this variable is run through dynamic string expansion, and can include FreeRADIUS variables to create a dynamic filename) .IP "Accounting queries" When a accounting record is processed, the module searches a config entry keyed by the Acct-Status-Type attribute present in the packet. For example, the SQL to be run on an accounting start must be named "Start" in the configuration for the module. Other usual values for Acct-Status-Type are "Stop", "Alive", "Accounting-On", etc. See the VALUEs for Acct-Status-Type in the dictionary.rfc2866 file. .IP "Post-Auth query" An entry named "Post-Auth" sets the query to run during the post-authentication stage. This query is mainly used to log sessions where there may not be a later accounting packet. .PP .DS modules { ... .br sql_log { .br path = "${radacctdir}/sql-relay" .br acct_table = "radacct" .br postauth_table = "radpostauth" .br sql_user_name = "%{%{User-Name}:-DEFAULT}" .br .br Start = "INSERT INTO ${acct_table} ..." .br Stop = "UPDATE ${acct_table} SET ..." .br Alive = "UPDATE ${acct_table} SET ..." .br .br Post-Auth = "INSERT INTO ${postauth_table} ..." .br } .br ... .br } .br accounting { ... .br sql_log ... .br } .br .br post-auth { ... .br sql_log ... .br } .DE .SH SECTIONS .BR accounting, .BR post-auth .SH FILES .I /etc/raddb/radiusd.conf .SH SEE ALSO .BR radsqlrelay (8), .BR radiusd (8), .BR radiusd.conf (5) .SH AUTHOR Nicolas Baradakis freeradius-server/man/man5/rlm_unix.5000066400000000000000000000027541257552170400200710ustar00rootroot00000000000000.\" # DS - begin display .de DS .RS .nf .sp .. .\" # DE - end display .de DE .fi .RE .sp .. .TH rlm_unix 5 "17 February 2005" "" "FreeRADIUS Module" .SH NAME rlm_unix \- FreeRADIUS Module .SH DESCRIPTION The \fIrlm_unix\fP module reads crypt(3) passwords from the system password file, and allows the server to use them for authentication. The module also provides FreeRADIUS an interface into a radwtmp file (used by "radlast") when added to the accounting section. .PP The \fIrlm_unix\fP module does provides the functionality for "Auth-Type = System". The module should be listed in the "authenticate" section. Please see the default \fIradiusd.conf\fP shipped with the server for an example of the correct usage of this module. .PP As of FreeRADIUS 1.1.0, the module no longer reads, or caches /etc/passwd, /etc/shadow, or /etc/group. If you wish to cache those files, see \fIrlm_passwd\fP. Most, if not all, configurations should not need those files to be cached. .PP The main configuration items to be aware of are: .IP radwtmp The path to the system wtmp file to be used for keeping the database of online users as read by the 'radlast' program. .SH CONFIGURATION .PP .DS modules { ... .br unix { .br radwtmp = ${logdir}/radwtmp .br } .br ... .br } .DE .PP .SH SECTIONS .BR authentication, .BR accounting .PP .SH FILES .I /etc/raddb/radiusd.conf, .PP .SH "SEE ALSO" .BR radiusd (8), .BR radiusd.conf (5), .BR rlm_passwd (5), .BR radlast (1) .SH AUTHORS Chris Parker, cparker@segv.org freeradius-server/man/man5/unlang.5000066400000000000000000000540011257552170400175100ustar00rootroot00000000000000.\" # DS - begin display .de DS .RS .nf .sp .. .\" # DE - end display .de DE .fi .RE .sp .. .TH unlang 5 "19 May 2010" "" "FreeRADIUS Processing un-language" .SH NAME unlang \- FreeRADIUS Processing un\-language .SH DESCRIPTION FreeRADIUS supports a simple processing language in its configuration files. We call it an "un-language" because the intention is NOT to create yet another programming language. If you need something more complicated than what is described here, we suggest using the Perl or Python modules rlm_perl, or rlm_python. The goal of the language is to allow simple policies to be written with minimal effort. Those policies are then applied when a request is being processed. Requests are processed through virtual servers (including the default one), in the sections titled "authorize", "authenticate", "post-auth", "preacct", "accounting", "pre-proxy", "post-proxy", and "session". These policies cannot be used in any other part of the configuration files, such as module or client configuration. .SH KEYWORDS The keywords for the language are a combination of pre-defined keywords, and references to loadable module names. We document only the pre-defined keywords here. Subject to a few limitations described below, any keyword can appear in any context. The language consists of a series of entries, each one one line. Each entry begins with a keyword. Entries are organized into lists. Processing of the language is line by line, from the start of the list to the end. Actions are executed per-keyword. .IP module-name A reference to the named module. When processing reaches this point, the pre-compiled module is called. The module may succeed or fail, and will return a status to "unlang" if so. This status can be tested in a condition. See the "Simple Conditions" text in the CONDITIONS section, and MODULE RETURN CODES, below. .DS chap # call the CHAP module .br sql # call the SQL module .br ... .DE .IP if .br Checks for a particular condition. If true, the block after the condition is processed. Otherwise, the block is ignored. See CONDITIONS, below, for documentation on the format of the conditions. .DS if (condition) { .br ... .br } .DE .IP else .br Define a block to be executed only if the previous "if" condition returned false. .DS else { .br ... .br } .DE .IP elsif .br Define a block to be executed only if the previous "if" condition returned false, and if the specified condition evaluates to true. .DS elsif (condition) { .br ... .br } .DE .IP switch .br Evaluate the given string, and choose the first matching "case" statement inside of the current block. If the string is surrounded by double quotes, it is expanded as described in the DATA TYPES section, below. No statement other than "case" can appear in a "switch" block. .DS switch "string" { .br ... .br } .DE .IP case .br Define a static string to match a parent "switch" statement. The strings given here are not expanded as is done with the parent "switch" statement. A "case" statement cannot appear outside of a "switch" block. .DS case string { .br ... .br } .DE A default entry can be defined by omitting the static string. This entry will be used if no other "case" entry matches. Only one default entry can exist in a "switch" section. .DS case { .br ... .br } .DE .IP update .br Update a particular attribute list, based on the attributes given in the current block. .DS update { .br attribute = value .br ... .br } .DE The can be one of "request", "reply", "proxy-request", "proxy-reply", "coa", "disconnect", or "control". The "control" list is the list of attributes maintainted internally by the server that controls how the server processes the request. Any attribute that does not go in a packet on the network will generally be placed in the "control" list. For backwards compatibility with older versions, "check" is accepted as a synonym for "control". The use of "check" is deprecated, and will be removed in a future release. For EAP methods with tunneled authentication sessions (i.e. PEAP and EAP-TTLS), the inner tunnel session can also reference "outer.request", "outer.reply", and "outer.control". Those references allow you to address the relevant list in the outer tunnel session. The "coa" and "disconnect" sections can only be used when the server receives an Access-Request or Accounting-Request. Use "request" and "reply" instead of "coa" when the server receives a CoA-Request or Disconnect-Request packet. Adding one or more attributes to either of the "coa" or "disconnect" list causes server to originate a CoA-Request or Disconnect-Request packet. That packet is sent when the current Access-Request or Accounting-Request has been finished, and a reply sent to the NAS. See raddb/sites-available/originate-coa for additional information. The only contents permitted in an "update" section are attributes and values. The contents of the "update" section are described in the ATTRIBUTES section below. .IP redundant This section contains a simple list of modules. The first module is called when the section is being processed. If the first module succeeds in its operation, then the server stops processing the section, and returns to the parent section. If, however, the module fails, then the next module in the list is tried, as described above. The processing continues until one module succeeds, or until the list has been exhausted. Redundant sections can contain only a list of modules, and cannot contain keywords that perform conditional operations (if, else, etc) or update an attribute list. .DS redundant { .br sql1 # try this .br sql2 # try this only if sql1 fails. .br ... .br } .DE .IP load-balance This section contains a simple list of modules. When the section is entered, one module is chosen at random to process the request. All of the modules in the list should be the same type (e.g. ldap or sql). All of the modules in the list should behave identically, otherwise the load-balance section will return different results for the same request. Load-balance sections can contain only a list of modules, and cannot contain keywords that perform conditional operations (if, else, etc) or update an attribute list. .DS load-balance { .br ldap1 # 50% of requests go here .br ldap2 # 50% of requests go here .br } .DE In general, we recommend using "redundant-load-balance" instead of "load-balance". .IP redundant-load-balance This section contains a simple list of modules. When the section is entered, one module is chosen at random to process the request. If that module succeeds, then the server stops processing the section. If, however, the module fails, then one of the remaining modules is chosen at random to process the request. This process repeats until one module succeeds, or until the list has been exhausted. All of the modules in the list should be the same type (e.g. ldap or sql). All of the modules in the list should behave identically, otherwise the load-balance section will return different results for the same request. Load-balance sections can contain only a list of modules, and cannot contain keywords that perform conditional operations (if, else, etc) or update an attribute list. .DS redundant-load-balance { .br ldap1 # 50%, unless ldap2 is down, then 100% .br ldap2 # 50%, unless ldap1 is down, then 100% .br } .DE .SH CONDITIONS The conditions are similar to C conditions in syntax, though quoted strings are supported, as with the Unix shell. .IP Simple conditions .br .DS (foo) .DE Evalutes to true if 'foo' is a non-empty string (single quotes, double quotes, or back-quoted). Also evaluates to true if 'foo' is a non-zero number. Note that the language is poorly typed, so the string "0000" can be interpreted as a numerical zero. This issue can be avoided by comparings strings to an empty string, rather than by evaluating the string by itself. If the word 'foo' is not a quoted string, then it can be taken as a reference to a named attribute. See "Referencing attribute lists", below, for examples of attribute references. The condition evaluates to true if the named attribute exists. Otherwise, if the word 'foo' is not a quoted string, and is not an attribute reference, then it is interpreted as a reference to a module return code. The condition evaluates to true if the most recent module return code matches the name given here. Valid module return codes are given in MODULE RETURN CODES, below. .IP Negation .DS (!foo) .DE Evalutes to true if 'foo' evaluates to false, and vice-versa. .PP Short-circuit operators .RS .br .DS (foo || bar) .br (foo && bar) .DE "&&" and "||" are short-circuit operators. "&&" evaluates the first condition, and evaluates the second condition if and only if the result of the first condition is true. "||" is similar, but executes the second command if and only if the result of the first condition is false. .RE .IP Comparisons .DS (foo == bar) .DE Compares 'foo' to 'bar', and evaluates to true if the comparison holds true. Valid comparison operators are "==", "!=", "<", "<=", ">", ">=", "=~", and "!~", all with their usual meanings. Invalid comparison operators are ":=" and "=". .PP Conditions may be nested to any depth, subject only to line length limitations (8192 bytes). .SH DATA TYPES There are only a few data types supported in the language. Reference to attributes, numbers, and strings. Any data type can appear in stand-alone condition, in which case they are evaluated as described in "Simple conditions", above. They can also appear (with some exceptions noted below) on the left-hand or on the right-hand side of a comparison. .IP numbers Numbers are composed of decimal digits. Floating point, hex, and octal numbers are not supported. The maximum value for a number is machine-dependent, but is usually 32-bits, including one bit for a sign value. .PP word .RS Text that is not enclosed in quotes is interpreted differently depending on where it occurs in a condition. On the left hand side of a condition, it is interpreted as a reference to an attribute. On the right hand side, it is interpreted as a simple string, in the same manner as a single-quoted string. Using attribute references permits limited type-specific comparisons, as seen in the examples below. .DS if (User-Name == "bob") { .br ... .br if (Framed-IP-Address > 127.0.0.1) { .br ... .br if (Service-Type == Login-User) { .DE .RE .IP """strings""" .RS Double-quoted strings are expanded by inserting the value of any variables (see VARIABLES, below) before being evaluated. If the result is a number it is evaluated in a numerical context. String length is limited by line-length, usually about 8000 characters. A double quote character can be used in a string via the normal back-slash escaping method. ("like \\"this\\" !") .RE .IP 'strings' Single-quoted strings are evaluated as-is. Their values are not expanded as with double-quoted strings above, and they are not interpreted as attribute references. .IP `strings` Back-quoted strings are evaluated by expanding the contents of the string, as described above for double-quoted strings. The resulting command given inside of the string in a sub-shell, and taking the output as a string. This behavior is much the same as that of Unix shells. Note that for security reasons, the input string is split into command and arguments before variable expansion is done. For performance reasons, we suggest that the use of back-quoted strings be kept to a minimum. Executing external programs is relatively expensive, and executing a large number of programs for every request can quickly use all of the CPU time in a server. If you believe that you need to execute many programs, we suggest finding alternative ways to achieve the same result. In some cases, using a real language may be sufficient. .IP /regex/i These strings are valid only on the right-hand side of a comparison, and then only when the comparison operator is "=~" or "!~". They are regular expressions, as implemented by the local regular expression library on the system. This is usually Posix regular expressions. The trailing 'i' is optional, and indicates that the regular expression match should be done in a case-insensitive fashion. If the comparison operator is "=~", then parantheses in the regular expression will define variables containing the matching text, as described below in the VARIABLES section. .SH VARIABLES Run-time variables are referenced using the following syntax .DS %{Variable-Name} .DE Note that unlike C, there is no way to declare variables, or to refer to them outside of a string context. All references to variables MUST be contained inside of a double-quoted or back-quoted string. Many potential variables are defined in the dictionaries that accompany the server. These definitions define only the name and type, and do not define the value of the variable. When the server receives a packet, it uses the packet contents to look up entries in the dictionary, and instantiates variables with a name taken from the dictionaries, and a value taken from the packet contents. This process means that if a variable does not exist, it is usually because it was not mentioned in a packet that the server received. Once the variable is instantiated, it is added to an appropriate attribute list, as described below. In many cases, attributes and variables are inter-changeble, and are often talked about that way. However, variables can also refer to run-time calls to modules, which may perform operations like SQL SELECTs, and which may return the result as the value of the variable. .PP Referencing attribute lists .RS Attribute lists may be referenced via the following syntax .DS %{:Attribute-Name} .DE Where is one of "request", "reply", "control", "proxy-request", "proxy-reply", or "outer.request", "outer.reply", "outer.control", "outer.proxy-request", or "outer.proxy-reply". just as with the "update" section, above. The ":" prefix is optional, and if omitted, is assumed to refer to the "request" list. When a variable is encountered, the given list is examined for an attribute of the given name. If found, the variable reference in the string is replaced with the value of that attribute. Some examples are: .DS %{User-Name} .br %{request:User-Name} # same as above .br %{reply:User-Name} .br %{outer.request:User-Name} # from inside of a TTLS/PEAP tunnel .DE .RE .PP Results of regular expression matches .RS If a regular expression match has previously been performed, then the special variable %{0} will contain a copy of the input string. The variables %{1} through %{8} will contain the substring matches, starting from the left-most parantheses, and onwards. If there are more than 8 parantheses, the additional results will not be placed into any variables. .RE .PP Obtaining results from databases .RS It is useful to query a database for some information, and to use the result in a condition. The following syntax will call a module, pass it the given string, and replace the variable reference with the resulting string returned from the module. .DS %{module: string ...} .DE The syntax of the string is module-specific. Please read the module documentation for additional details. .RE .PP Conditional Syntax .RS Conditional syntax similar to that used in Unix shells may also be used. .IP %{%{Foo}:-bar} If %{Foo} has a value, returns that value. .br Otherwise, returns literal string "bar". .IP %{%{Foo}:-%{Bar}} If %{Foo} has a value, returns that value. .br Otherwise, returns the expansion of %{Bar}. These conditional expansions can be nested to almost any depth, such as with %{%{One}:-%{%{Two}:-%{Three}}} .RE .PP String lengths and arrays .RS Similar to a Unix shell, there are ways to reference string lenths, and the second or more instance of an attribute in a list. If you need this functionality, we recommend using a real language. .IP %{#string} The number of characters in %{string}. If %{string} is not set, then the length is not set. e.g. %{#Junk-junk:-foo} will yeild the string "foo". .IP %{Attribute-Name#} Will print the integer value of the attribute, rather than a decoded VALUE or date. This feature applies only to attributes of type "date", "integer", "byte", and "short". It has no effect on any other attributes. It is used when the numerical value is needed (e.g. Unix seconds), rather than a humanly-readable string. e.g. If a request contains "Service-Type = Login-User", the expansion of %{Service-Type#} will yeild "1". .IP %{Attribute-Name[index]} Reference the N'th occurance of the given attribute. The syntax %{:Attribute-Name[index]} may also be used. The indexes start at zero. This feature is NOT available for non-attribute dynamic translations, like %{sql:...}. For example, %{User-Name[0]} is the same as %{User-Name} The variable %{Cisco-AVPair[2]} will reference the value of the THIRD Cisco-AVPair attribute (if it exists) in the request packet, .IP %{Attribute-Name[#]} Returns the total number of attributes of that name in the relevant attribute list. The number will usually be between 0 and 200. For most requests, %{request:User-Name[#]} == 1 .IP %{Attribute-Name[*]} Expands to a single string, with the value of each array member separated by a newline. .IP %{#Attribute-Name[index]} Expands to the length of the string %{Attribute-Name[index]}. .SH ATTRIBUTES The attribute lists described above may be edited by listing one or more attributes in an "update" section. Once the attributes have been defined, they may be referenced as described above in the VARIABLES section. The following syntax defines attributes in an "update" section. Each attribute and value has to be all on one line in the configuration file. There is no need for commas or semi-colons after the value. .DS Attribute-Name = value .DE .PP Attribute names .RS The Attribute-Name must be a name previously defined in a dictionary. If an undefined name is used, the server will return an error, and will not start. .RE .IP Operators The operator used to assign the value of the attribute may be one of the following, with the given meaning. .RS .IP = Add the attribute to the list, if and only if an attribute of the same name is not already present in that list. .IP := Add the attribute to the list. If any attribute of the same name is already present in that list, its value is replaced with the value of the current attribute. .IP += Add the attribute to the tail of the list, even if attributes of the same name are already present in the list. .RE .PP Enforcement and Filtering Operators .RS The following operators may also be used in addition to the ones listed above. Their function is to perform enforcement or filtering on attributes in a list. .IP -= Remove all matching attributes from the list. Both the attribute name and value have to match in order for the attribute to be removed from the list. .IP == Keep all matching attributes. Both the attribute name and value have to match in order for the attribute to remain in the list. Note that this operator is very different than the '=' operator listed above! .IP <= Keep all attributes having values less than, or equal to, the value given here. Any larger value is replaced by the value given here. If no attribute exists, it is added with the value given here, as with "+=". This operator is valid only for attributes of integer type. .IP >= Keep all attributes having values greater than, or equal to, the value given here. Any larger value is replaced by the value given here. If no attribute exists, it is added with the value given here, as with "+=". This operator is valid only for attributes of integer type. .IP !* Delete all occurances of the named attribute, no matter what the value. .RE .IP Values .br The format of the value is attribute-specific, and is usually a string, integer, IP address, etc. Prior to the attribute being instantiated, the value may be expanded as described above in the DATA TYPES section, above. This flexibility means that, for example, you can assign an IP address value to an attribute by specifying the IP address directly, or by having the address returned from a database query, or by having the address returned as the output of a program that is executed. When string values are finally assigned to a variable, they can have a maximum length of 253 characters. This limit is due in part to both protocol and internal server requirements. That is, the strings in the language can be nearly 8k in length, say for a long SQL query. However, the output of that SQL query should be no more than 253 characters in length. .SH OTHER KEYWORDS Other keywords in the language are taken from the names of modules loaded by the server. These keywords are dependent on both the modules, and the local configuration. Some use keywords that are defined in the default configuration file are: .IP fail Cause the request to be treated as if a database failure had occurred. .IP noop Do nothing. This also serves as an instruction to the configurable failover tracking that nothing was done in the current section. .IP ok Instructs the server that the request was processed properly. This keyword can be used to over-ride earlier failures, if the local administrator determines that the faiures are not catastrophic. .IP reject Causes the request to be immediately rejected .SH MODULE RETURN CODES When a module is called, it returns one of the following codes to "unlang", with the following meaning. .DS notfound information was not found .br noop the module did nothing .br ok the module succeeded .br updated the module updated the request .br fail the module failed .br reject the module rejected the request .br userlock the user was locked out .br invalid the configuration was invalid .br handled the module has handled the request itself .DE These return codes can be tested for in a condition, as described above in the CONDITIONS section. See also the file doc/configurable_failover for additional methods of trapping and modifying module return codes. .SH FILES /etc/raddb/radiusd.conf .SH "SEE ALSO" .BR radiusd.conf (5), .BR dictionary (5) .SH AUTHOR Alan DeKok freeradius-server/man/man5/users.5000066400000000000000000000170531257552170400173730ustar00rootroot00000000000000.\" # DS - begin display .de DS .RS .nf .sp .. .\" # DE - end display .de DE .fi .RE .sp .. .TH USERS 5 "04 Jan 2004" "" "FreeRADIUS user authorization file" .SH NAME users \- user authorization file for the FreeRADIUS server .SH DESCRIPTION The \fBusers\fP file resides in the RADIUS database directory, by default \fB/etc/raddb\fP. It contains a series of configuration directives which are used by the \fIfiles\fP module to decide how to authorize and authenticate each user request. Every line starting with a hash sign .RB (' # ') is treated as comment and ignored. .PP Each entry of the file begins with a username, followed by a (possibly empty) list of check items, all on one line. The next line begins with a tab, and a (possibly empty) list of reply items. Each item in the check or reply item list is an attribute of the form \fBname = value\fP. Multiple items may be placed on one line, in which case they must be seperated by commas. The reply items may be specified over multiple lines, in which case each line must end with a comma, and the last line of the reply items must not end with a comma. The check items are a list of attributes used to match the incoming request. If the username matches, AND all of the check items match the incoming request, then the reply items are added to the list of attributes which will be used in the reply to that request. This process is repeated for all of the entries in the users file. If the incoming request matches NO entry, then the request is rejected. .SH CAVEATS The special username \fBDEFAULT\fP matches any usernames. The entries are processed in order, from the top of the \fBusers\fP file, on down. If an entry contains the special item \fBFall-Through = No\fP as a reply attribute, then the processing of the file stops, and no more entries are matched. Any reply item list without any \fBFall-Through\fP attribute is treated as though it included a \fBFall-Through = No\fP attribute. If an entry contains the special item \fBFall-Through = Yes\fP as a reply attribute, then the processing proceeds to the next entry in order. Care should be taken when using \fBFall-Through\fP. The server should be tested in debugging mode with a number of test requests, in order to verify that the configured entries behave as expected. The special attribute \fBAuth-Type\fP is used to identify the authentication type to be used for that user. See the \fBdictionary\fP file for a list of permitted values for the \fBAuth-Type\fP attribute. Once the \fBusers\fP file has been processed, the request is authenticated, using the method given by \fBAuth-Type\fP. .SH OPERATORS Additional operators other than \fB=\fP may be used for the attributes in either the check item, or reply item list. The following is a list of operators, and their meaning. .TP 0.5i .B "Attribute = Value" Not allowed as a check item for RADIUS protocol attributes. It is allowed for server configuration attributes (Auth-Type, etc), and sets the value of on attribute, only if there is no other item of the same attribute. .br As a reply item, it means "add the item to the reply list, but only if there is no other item of the same attribute." .TP 0.5i .B "Attribute := Value" Always matches as a check item, and replaces in the configuration items any attribute of the same name. If no attribute of that name appears in the request, then this attribute is added. .br As a reply item, it has an identical meaning, but for the reply items, instead of the request items. .TP 0.5i .B "Attribute == Value" As a check item, it matches if the named attribute is present in the request, AND has the given value. .br Not allowed as a reply item. .TP 0.5i .B "Attribute += Value" Always matches as a check item, and adds the current attribute with value to the list of configuration items. .br As a reply item, it has an identical meaning, but the attribute is added to the reply items. .TP 0.5i .B "Attribute != Value" As a check item, matches if the given attribute is in the request, AND does not have the given value. .br Not allowed as a reply item. .TP 0.5i .B "Attribute > Value" As a check item, it matches if the request contains an attribute with a value greater than the one given. .br Not allowed as a reply item. .TP 0.5i .B "Attribute >= Value" As a check item, it matches if the request contains an attribute with a value greater than, or equal to the one given. .br Not allowed as a reply item. .TP 0.5i .B "Attribute < Value" As a check item, it matches if the request contains an attribute with a value less than the one given. .br Not allowed as a reply item. .TP 0.5i .B "Attribute <= Value" As a check item, it matches if the request contains an attribute with a value less than, or equal to the one given. .br Not allowed as a reply item. .TP 0.5i .B "Attribute =~ Expression" As a check item, it matches if the request contains an attribute which matches the given regular expression. This operator may only be applied to string attributes. .br Not allowed as a reply item. .TP 0.5i .B "Attribute !~ Expression" As a check item, it matches if the request contains an attribute which does not match the given regular expression. This operator may only be applied to string attributes. .br Not allowed as a reply item. .TP 0.5i .B "Attribute =* Value" As a check item, it matches if the request contains the named attribute, no matter what the value is. .br Not allowed as a reply item. .TP 0.5i .B "Attribute !* Value" As a check item, it matches if the request does not contain the named attribute, no matter what the value is. .br Not allowed as a reply item. .SH EXAMPLES .DS bob Cleartext-Password := "hello" .DE .RS Requests containing the User-Name attribute, with value "bob", will be authenticated using the "known good" password "hello". There are no reply items, so the reply will be empty. .RE .DS DEFAULT Auth-Type = System .br Fall-Through = Yes .DE .RS For all users reaching this entry, perform authentication against the system, unless Auth-Type has already been set. Also, process any following entries which may match. .RE .DS DEFAULT Service-Type == Framed-User, Framed-Protocol == PPP .br Service-Type = Framed-User, .br Framed-Protocol = PPP, .br Fall-Through = Yes .DE .RS If the request packet contains the attributes Service-Type and Framed-Protocol, with the given values, then include those attributes in the reply. That is, give the user what they ask for. This entry also shows how to specify multiple reply items. .RE See the \fBusers\fP file supplied with the server for more examples and comments. .SH HINTS Run the server in debugging mode (\fB-X\fP), and use the \fBradclient\fP program to send it test packets which you think will match specific entries. The server will print out which entries were matched for that request, so you can verify your expectations. This should be the FIRST thing you do if you suspect problems with the file. Care should be taken when writing entries for the \fBusers\fP file. It is easy to misconfigure the server so that requests are accepted when you wish to reject them. The entries should be ordered, and the Fall-Through item should be used ONLY where it is required. Entries rejecting certain requests should go at the top of the file, and should not have a Fall-Through item in their reply items. Entries for specific users, who do not have a Fall-Through item, should come next. Any DEFAULT entries should usually come last, except as fall-through entries that set reply attributes. .SH FILES /etc/raddb/users .SH "SEE ALSO" .BR radclient (1), .BR radiusd (8), .BR dictionary (5), .BR naslist (5) .SH AUTHOR The FreeRADIUS team. freeradius-server/man/man8/000077500000000000000000000000001257552170400161415ustar00rootroot00000000000000freeradius-server/man/man8/radconf2xml.8000066400000000000000000000014631257552170400204550ustar00rootroot00000000000000.TH RADCONF2XML 8 .SH NAME radconf2xml - converts radiusd.conf to XML .SH SYNOPSIS .B radconf2xml .RB [ \-d .IR raddb_dir ] .RB [ \-h ] .RB [ \-n .IR name ] .RB [ \-o .IR out_file ] .SH DESCRIPTION \fBradconf2xml\fP reads the radiusd configuration file specified by \fIraddb_dir\fP/\fIname\fP.conf and converts it to XML format. The result is written to \fIout_file\fP which by default is stdout. .SH OPTIONS .IP \-d\ \fIraddb_dir\fP The radius configuration directory (typically /etc/raddb). .IP \-d\ \fIname\fP The name of the configuration file without the .conf extension. Defaults to radiusd. .IP \-h Print usage help information. .IP \-d\ \fIout_file\fP The output file the XML formatted file will be written to. Defaults to stdout. .SH SEE ALSO radiusd(8), .SH AUTHORS Alan DeKok freeradius-server/man/man8/radcrypt.8000066400000000000000000000027211257552170400200640ustar00rootroot00000000000000.TH RADCRYPT 8 .SH NAME radcrypt - generate password hash for use with radius, or validates a password hash .SH SYNOPSIS .B radcrypt .RB [ \-d | --des ] .RB [ \-m | --md5 ] .RB [ \-c | --check ] \fIplaintext_password\fP [\fIhashed_password\fP] .SH DESCRIPTION \fBradcrypt\fP generates a hashed digest of a plaintext password, or can validate if a password hash matches a plaintext password. DES and MD5 hashes are currently supported. When generating a password hash a random salt is generated and applied. .PP A hashed password can be validated by specifying \fI-c\fP or \fI--check\fP and passing \fIhashed_password\fP after \fIplaintext_password\fP on the command line. In this case \fIhashed_password\fP will be checked to see if it matches \fIplaintext_password\fP. If so "Password OK" will be printed and the exit status will be 1, otherwise "Password BAD" will be printed and exit status will be 0 (Note this is the opposite of a normal successful shell status). .SH OPTIONS .IP "-d --des" Use a DES (Data Encryption Standard) hash (default). Ignored if performing a password check. .IP "-m --md5" Use a MD5 (Message Digest 5) hash. Ignored if performing a password check. .IP "-c --check" Perform a validation check on a password hash to verify if it matches the plantext password. .SH EXAMPLES .nf $ radcrypt foobar HaX0xn7Qy650Q $ radcrypt -c foobar HaX0xn7Qy650Q Password OK .fi .SH SEE ALSO radiusd(8), crypt(3) .SH AUTHORS Miquel van Smoorenburg freeradius-server/man/man8/raddebug.8000066400000000000000000000061431257552170400200130ustar00rootroot00000000000000.TH RADDEBUG 8 "1 September 2010" "" "FreeRADIUS Daemon" .SH NAME raddebug - Display debugging output from a running server. .SH SYNOPSIS .B raddebug .RB [ \-c .IR condition ] .RB [ \-d .IR config_directory ] .RB [ \-i .IR ipv4-address ] .RB [ \-I .IR ipv6-address ] .RB [ \-f .IR socket_file ] .RB [ \-t .IR timeout ] .RB [ \-u .IR user-name ] .SH DESCRIPTION \fBraddebug\fP is a shell script wrapper around \fBradmin\fP that automates the process of obtaining debugging output from a running server. It does this without impacting service availability, unlike using \fBradiusd -X\fP. There are a number of prerequisites that are required for its proper operation: .PP .in +0.3i * \fBradmin\fP must be available in the PATH. .br * The user running \fBraddebug\fP must have permission to connect to the server control socket. .br * The control socket must be configured. For instructions, see raddb/sites-available/control-socket .br * The control socket must be marked as "mode = rw". .br * The user running \fBraddebug\fP must have permission to read and write files in the "logdir" directory. This is usually /var/log/radiusd. .in -0.3i .PP For a number of reasons, the debugging output is placed in an intermediate file, rather than being sent directly to standard output. In order to prevent this file from growing too large, the \fBraddebug\fP program is automatically terminated after 10 seconds. This timeout can be changed via the "-t" parameter. .PP When the script exits, debug mode in the server is disabled, and the intermediate file is deleted. .PP Debug output from a live server can be redirected to only one location. If a second instance of \fIraddebug\fP is started while the first one is still running, the later one will over-ride the first one, and the first will stop producing output. .SH OPTIONS .IP \-c\ \fIcondition\fP Set a specific debug condition. The format of the condition is as specified in the CONDITIONS section of the \fIunlang\fP manual page. .IP \-f\ \fIsocket_file\fP The path to the control socket. See the \fIradmin\fP manual page for more description of this option. .IP \-i\ \fIipv4-address\fP Show debug output for the client having the given IPv4 address. This option is equivalent to using: .br .in +0.3i -c '(Packet-Src-IP-Address == ipv4-address)' .in -0.3i .IP "\-d \fIconfig directory\fP" The radius configuration directory, usually /etc/raddb. See the \fIradmin\fP manual page for more description of this option. .IP \-I\ \fIipv6-address\fP Show debug output for the client having the given IPv6 address. This option is equivalent to using: .br .in +0.3i -c '(Packet-Src-IPv6-Address == ipv6-address)' .in -0.3i .IP \-t\ \fItimeout\fP Stop printing debug output after "timeout" seconds. The default timeout is sixty (60) seconds. Use "-t 0" to print debugging output forever, or until the script exits. .IP \-u\ \fIname\fP Show debug output for users having the given name. This option is equivalent to using: .br .in +0.3i -c '(User-Name == name)' .in -0.3i .SH SEE ALSO radmin(8), raddb/sites-available/control-socket, unlang(5), radiusd.conf(5) .SH AUTHORS Alan DeKok freeradius-server/man/man8/radiusd.8000066400000000000000000000215771257552170400177010ustar00rootroot00000000000000.TH RADIUSD 8 "26 Apr 2012" "" "FreeRADIUS Daemon" .SH NAME radiusd - Authentication, Authorization and Accounting server .SH SYNOPSIS .B radiusd .RB [ \-C ] .RB [ \-d .IR config_directory ] .RB [ \-f ] .RB [ \-h ] .RB [ \-i .IR ip-address ] .RB [ \-l .IR log_file ] .RB [ \-m ] .RB [ \-n .IR name ] .RB [ \-p .IR port ] .RB [ \-s ] .RB [ \-t ] .RB [ \-v ] .RB [ \-x ] .RB [ \-X ] .SH DESCRIPTION FreeRADIUS is a high-performance and highly configurable RADIUS server. It supports many database back-ends such as flat-text files, SQL, LDAP, Perl, Python, etc. It also supports many authentication protocols such as PAP, CHAP, MS-CHAP(v2), HTTP Digest, and EAP (EAP-MD5, EAP-TLS, PEAP, EAP-TTLS, EAP-SIM, etc.). It also has fullsupport for Cisco's VLAN Query Protocol (VMPS) and DHCP. Please read the DEBUGGING section below. It contains instructions for quickly configuring the server for your local system. .SH OPTIONS The following command-line options are accepted by the server: .IP \-C Check the configuration and exit immediately. If there is a problem reading the configuration, then the server will exit with a non-zero status code. If the configuration appears to be acceptable, then the server will exit with a zero status code. Note that there are limitations to this check. Due to the complexities involved in \fIalmost\fP starting a RADIUS server, these checks are necessarily incomplete. The server can return a zero status code when run with -C, but may still exit with an error when run normally. See the output of .B "radiusd -XC" for an informative list of which modules are checked for correct configuration, and which modules are skipped, and therefore not checked. .IP "\-d \fIconfig directory\fP" Defaults to \fI/etc/raddb\fP. \fBRadiusd\fP looks here for its configuration files such as the \fIdictionary\fP and the \fIusers\fP files. .IP \-f Do not fork, stay running as a foreground process. .IP \-h Print usage help information. .IP "\-i \fIip-address\fP" Defines which IP address that the server uses for sending and receiving packets. If this command-line option is given, then the "bind_address" and all "listen{}" entries in \fIradiusd.conf\fP are ignored. This option MUST be used in conjunction with "-p". .IP "\-l \fIlog_file\fP" Defaults to \fI${logdir}/radius.log\fP. \fBRadiusd\fP writes it's logging information to this file. If log_file is the string "stdout" logging will be written to stdout. .IP \-m On SIGINT or SIGQUIT exit cleanly instead of immediately. This is most useful for when running the server with "valgrind". .IP "\-n \fIname\fP" Read \fIraddb/name.conf\fP instead of \fIraddb/radiusd.conf\fP. .IP "\-p \fIport\fP" Defines which port is used for receiving authentication packets. Accounting packets are received on "port + 1". When this command-line option is given, all "listen" sections in \fIradiusd.conf\fP are ignored. This option MUST be used in conjunction with "-i". .IP \-s Run in "single server" mode. The server normally runs with multiple threads and/or processes, which can lower its response time to requests. Some systems have issues with threading, however, so running in "single server" mode may help to address those issues. In single server mode, the server will also not "daemonize" (auto-background) itself. .IP \-t Do not spawn threads. .IP \-v Print server version information and exit. .IP \-X Debugging mode. Equivalent to "-sfxx -l stdout". When trying to understand how the server works, ALWAYS run it with "radiusd -X". For production servers, use "raddebug" .IP \-x Finer-grained debug mode. In this mode the server will print details of every request on it's \fBstdout\fP output. You can specify this option multiple times (-x -x or -xx) to get more detailed output. .SH DEBUGGING The default configuration is set to work in the widest possible circumstances. It requires minimal changes for your system. However, your needs may be complex, and may require significant changes to the server configuration. Making random changes is a guaranteed method of failure. Instead, we STRONGLY RECOMMEND proceeding via the following steps: .PP 1) Always run the server in debugging mode ( .B radiusd -X ) after making a configuration change. We cannot emphasize this enough. If you are not running the server in debugging mode, you \fIwill not\fP be able to see what is doing, and you \fIwill not\fP be able to correct any problems. If you ask questions on the mailing list, the first response will be to tell you "run the server in debugging mode". Please, follow these instructions. .PP 2) Change as little as possible in the default configuration files. The server contains a decade of experience with protocols, databases, and different systems. Its default configuration is designed to work almost everywhere, and to do almost everything you need. .PP 3) When you make a small change, testing it before changing anything else. If the change works, save a copy of the configuration, and make another change. If the change doesn't work, debug it, and try to understand why it doesn't work. .PP If you begin by making large changes to the server configuration, it will never work, and you will never be able to debug the problem. .PP 4) If you need to add a connection to a database FOO (e.g. LDAP or SQL), then: .PP .in +0.3i a) Edit raddb/modules/foo .br This file contains the default configuration for the module. It contains comments describing what can be configured, and what those configuration entries mean. .br .br b) Edit raddb/sites-available/default .br This file contains the default policy for the server. e.g. "enable CHAP, MS-CHAP, and EAP authentication". Look in this file for all references to your module "foo". Read the comments, and remove the leading hash '#' from the lines referencing the module. This enables the module. .br .br c) Edit raddb/sites-available/inner-tunnel .br This file contains the default policy for the "tunneled" portion of certain EAP methods. Perform the same kind of edits as above, for the "default" file.. If you are not using EAP (802.1X), then this step can be skipped. .br .br d) Start the server in debugging mode ( .B radiusd -X ), and start testing. .in -0.3i .PP 5) Ask questions on the mailing list (freeradius-users@lists.freeradius.org). When asking questions, include the output from debugging mode ( .B radiusd -X ). This information will allow people to help you. If you do not include it, the first response to your message will be "post the output of debug mode". .PP Ask questions earlier, rather than later. If you cannot solve a problem in a day, ask a question on the mailing list. Most questions have been seen before, and can be answered quickly. .SH BACKGROUND \fBRADIUS\fP is a protocol spoken between an access server, typically a device connected to several modems or ISDN lines, and a \fBradius\fP server. When a user connects to the access server, (s)he is asked for a loginname and a password. This information is then sent to the \fBradius\fP server. The server replies with "access denied", or "access OK". In the latter case login information is sent along, such as the IP address in the case of a PPP connection. .PP The access server also sends login and logout records to the \fBradius\fP server so accounting can be done. These records are kept for each terminal server seperately in a file called \fBdetail\fP, and in the \fIwtmp\fP compatible logfile \fB/var/log/radwtmp\fP. .SH CONFIGURATION \fBRadiusd\fP uses a number of configuration files. Each file has it's own manpage describing the format of the file. These files are: .IP radiusd.conf The main configuration file, which sets the administrator-controlled items. .IP dictionary This file is usually static. It defines all the possible RADIUS attributes used in the other configuration files. You don't have to modify it. It includes other dictionary files in the same directory. .IP hints Defines certain hints to the radius server based on the users's loginname or other attributes sent by the access server. It also provides for mapping user names (such as Pusername -> username). This provides the functionality that the \fILivingston 2.0\fP server has as "Prefix" and "Suffix" support in the \fIusers\fP file, but is more general. Ofcourse the Livingston way of doing things is also supported, and you can even use both at the same time (within certain limits). .IP huntgroups Defines the huntgroups that you have, and makes it possible to restrict access to certain huntgroups to certain (groups of) users. .IP users Here the users are defined. On a typical setup, this file mainly contains DEFAULT entries to process the different types of logins, based on hints from the hints file. Authentication is then based on the contents of the UNIX \fI/etc/passwd\fP file. However it is also possible to define all users, and their passwords, in this file. .SH SEE ALSO rradiusd.conf(5), users(5), huntgroups(5), hints(5), dictionary(5), raddebug(8) .SH AUTHOR The FreeRADIUS Server Project (http://www.freeradius.org) freeradius-server/man/man8/radmin.8000066400000000000000000000145061257552170400175120ustar00rootroot00000000000000.TH RADMIN 8 "14 Mar 2011" "" "FreeRADIUS Server Administration Tool" .SH NAME radmin - FreeRADIUS Administration tool .SH SYNOPSIS .B radmin .RB [ \-d .IR config_directory ] .RB [ \-e .IR command ] .RB [ \-E ] .RB [ \-f .IR socket_file ] .RB [ \-h ] .RB [ \-i .IR input_file ] .RB [ \-n .IR name ] .RB [ \-o .IR output_file ] .RB [ \-q ] .SH DESCRIPTION FreeRADIUS Server administration tool that connects to the control socket of a running server, and gives a command-line interface to it. At this time, only a few commands are supported. Please type "help" at the command prompt for detailed information about the supported commands. .SH WARNING The security protections offered by this command are limited to the permissions on the Unix domain socket, and the server configuration. If someone can connect to the Unix domain socket, they have a substantial amount of control over the server. .SH OPTIONS The following command-line options are accepted by the program. .IP "\-d \fIconfig directory\fP" Defaults to \fI/etc/raddb\fP. \fBradmin\fP looks here for the server configuration files to find the "listen" section that defines the control socket filename. .IP "\-e \fIcommand\fP" Run \fIcommand\fP and exit. .IP \-E Echo commands as they are being executed. .IP "\-f \fIsocket_file\fP" Specify the socket filename directly. The radiusd.conf file is not read. .IP \-h Print usage help information. .IP "\-i \fIinput_file\fP" Reads input from the specified file. If not specified, stdin is used. This also sets "-q". .IP "\-n \fImname\fP" Read \fIraddb/name.conf\fP instead of \fIraddb/radiusd.conf\fP. .IP "\-o \fIoutput_file\fP" Write output to the specified file. If not specified, stdout is used. This also sets "-q". .IP \-q Quiet mode. .SH COMMANDS The commands implemented by the command-line interface are almost completely controlled by the server. There are a few commands interpreted locally by radmin: .IP reconnect Reconnect to the server. .IP quit Exit from radmin. .IP exit Exit from radmin. .PP The other commands are implemented by the server. Type "help" at the prompt for more information. .SH EXAMPLES .IP debug\ file\ /var/log/radius/bob.log Set debug logs to /var/log/radius/bob.log. There is very little checking of this filename. Rogue administrators may be able use this command to over-write almost any file on the system. If those administrators have write access to "radius.conf", they can do the same thing without radmin, too. .IP debug\ condition\ '(User-Name\ ==\ "bob")' Enable debugging output for all requests that match the condition. Any "unlang" condition is valid here. The condition is parsed as a string, so it must be enclosed in single or double quotes. Strings enclosed in double-quotes must have back-slashes and the quotation marks escaped inside of the string. Only one debug condition can be active at a time. .IP debug\ condition\ '((User-Name\ ==\ "bob")\ ||\ (Packet-Src-IP-Address\ ==\ 192.0.2.22))' A more complex condition that enables debugging output for requests containing User-Name "bob", or requests that originate from source IP address 192.0.2.22. .IP debug\ condition Disable debug conditionals. .SH FULL LIST OF COMMANDS .IP add\ do sub-command of add .IP add\ client\ Add client configuration commands .IP add\ client\ file\ Add new client definition from .IP debug\ debugging commands .IP debug\ condition\ [condition] Enable debugging for requests matching [condition] .IP debug\ level\ Set debug level to . Higher is more debugging. .IP debug\ file\ [filename] Send all debugging output to [filename] .IP del\ do sub-command of del .IP del\ client\ Delete client configuration commands .IP del\ client\ ipaddr\ Delete a dynamically created client .IP hup\ [module] sends a HUP signal to the server, or optionally to one module .IP inject\ commands to inject packets into a running server .IP inject\ to\ \ Inject packets to the destination IP and port. .IP inject\ from\ Inject packets as if they came from .IP inject\ file\ \ Inject packet from input-file>, with results sent to .IP reconnect reconnect to a running server .IP terminate terminates the server, and cause it to exit .IP set\ do sub-command of set .IP set\ module\ set module commands .IP set\ module\ config\ \ variable\ value set configuration for .IP set\ module\ status\ [alive|dead] set the module to be alive or dead (always return "fail") .IP set\ home_server\ set home server commands .IP set\ home_server\ state\ \ \ [alive|dead] set state for given home server .IP show\ do sub-command of show .IP show\ client\ do sub-command of client .IP show\ client\ config\ show configuration for given client .IP show\ client\ list shows list of global clients .IP show\ debug\ show debug properties .IP show\ debug\ condition Shows current debugging condition. .IP show\ debug\ level Shows current debugging level. .IP show\ debug\ file Shows current debugging file. .IP show\ home_server\ do sub-command of home_server .IP show\ home_server\ config\ \ show configuration for given home server .IP show\ home_server\ list shows list of home servers .IP show\ home_server\ state\ \ shows state of given home server .IP show\ module\ do sub-command of module .IP show\ module\ config\ show configuration for given module .IP show\ module\ flags\ show other module properties .IP show\ module\ list shows list of loaded modules .IP show\ module\ methods\ show sections where may be used .IP show\ uptime shows time at which server started .IP show\ version Prints version of the running server .IP show\ xml\ Prints out configuration as XML .IP stats\ do sub-command of stats .IP stats\ client\ [auth/acct]\ show statistics for given client, or for all clients (auth or acct) .IP stats\ home_server\ [/auth/acct]\ show statistics for given home server (ipaddr and port), or for all home servers (auth or acct) .IP stats\ detail\ show statistics for the given detail file .SH SEE ALSO unlang(5), radiusd.conf(5), raddb/sites-available/control-socket .SH AUTHOR Alan DeKok freeradius-server/man/man8/radrelay.8000066400000000000000000000040761257552170400200440ustar00rootroot00000000000000.TH RADRELAY 8 "23 October 2007" "" "FreeRADIUS Daemon" .SH NAME radrelay -- Deprecated command. .SH DESCRIPTION The functions of \fIradrelay\fP have been added to \fIradiusd\fP. One benefit is that one instance of \fIradiusd\fP can read multiple detail files, among others. .PP The \fIrlm_sql_log\fP module does something similar, but for SQL queries. See it's man page for details. .SH "REPLICATION FOR BACKUPS" Many sites run multiple radius servers; at least one primary and one backup server. When the primary goes down, most NASes detect that and switch to the backup server. That will cause your accounting packets to go the the backup server - and some NASes don't even switch back to the primary server when it comes back up. The result is that accounting records are missed, and/or the administrator must jump through hoops in order to combine the different detail files from multiple servers. It also means that the session database ("radutmp", used for radwho and simultaneous use detection) gets out of sync. We solve this issue by "relaying" packets from one server to another, so they both have the same set of accounting data. See raddb/sites-available/buffered-sql for more information. .SH "BUFFERING FOR HIGH-LOAD SERVERS" If the RADIUS server suddenly receives a many accounting packets, there may be insufficient CPU power to process them all in a timely manner. This problem is especially noticable when the accounting packets are going to a back-end database. Similarly, you may have one database that tracks "live" sessions, and another that tracks historical accounting data. In that case, accessing the first database is fast, as it is small. Accessing the second database many be slower, as it may contain multiple gigabytes of data. In addition, writing to the first database in a timely manner is important, while data may be written to the second database with a few minutes delay, without any harm being done. See raddb/sites-available/copy-to-home-server for more information. .SH SEE ALSO .BR radiusd(8), .BR rlm_sql_log(5) .SH AUTHOR The FreeRADIUS Server Project freeradius-server/man/man8/radsniff.8000066400000000000000000000025421257552170400200310ustar00rootroot00000000000000.TH RADSNIFF 8 .SH NAME radsniff - dump radius protocol .SH SYNOPSIS .B radsniff .RB [ \-c .IR count ] .RB [ \-d .IR directory ] .RB [ \-F ] .RB [ \-f .IR filter ] .RB [ \-h ] .RB [ \-i .IR interface ] .RB [ \-I .IR filename ] .RB [ \-m ] .RB [ \-p .IR port ] .RB [ \-r .IR filter ] .RB [ \-s .IR secret ] .RB [ \-S ] .RB [ \-w .IR file ] .RB [ \-x ] .SH DESCRIPTION \fBradsniff\fP is a simple wrapper around libpcap. It can also print out the contents of RADIUS packets using the FreeRADIUS dictionaries. .SH OPTIONS .IP \-c\ \fIcount\fP Number of packets to capture. .IP \-d\ \fIdirectory\fP Directory where the dictionaries are found. .IP \-F Filter PCAP file from stdin to stdout. Output file will contain RADIUS packets. .IP \-f\ \fIfilter\fP PCAP filter. (default is udp port 1812 or 1813) .IP \-h Print usage help information. .IP \-i\ \fIinterface\fP Interface to capture. .IP \-I\ \fIfilename\fP Read packets from filename. .IP \-m Print packet headers only, not contents. .IP \-p\ \fIport\fP \tListen for packets on port. .IP \-r\ \fIfilter\fP RADIUS attribute filter. .IP \-s\ \fIsecret\fP RADIUS secret. .IP \-S Sort attributes in the packet. Used to compare server results. .IP \-w\ \fIfile\fP Write output packets to file. .IP \-x Print out debugging information. .SH SEE ALSO radiusd(8),pcap(3) .SH AUTHORS Nicolas Baradakis freeradius-server/man/man8/radsqlrelay.8000066400000000000000000000035461257552170400205650ustar00rootroot00000000000000.\" # DS - begin display .de DS .RS .nf .sp .. .\" # DE - end display .de DE .fi .RE .sp .. .TH RADSQLRELAY 8 "19 June 2005" "" "FreeRADIUS helper program" .SH NAME radsqlrelay - relay SQL queries to a central database server .SH SYNOPSIS .B radsqlrelay .RB [ \-? ] .RB [ \-d .IR sql_driver ] .RB [ \-b .IR database ] .RB [ \-f .IR file ] .RB [ \-h .IR host ] .RB [ \-u .IR user ] .RB [ \-P .IR port ] .RB [ \-p .IR password ] .RB [ \-1 ] .RB [ \-x ] \fIfile_path\fP .SH DESCRIPTION \fBradsqlrelay\fP tails a SQL \fIlogfile\fP and forwards the queries to a database server. Used to replicate accounting records to one (central) database, even if the database has extended downtime. .PP The SQL logfile is created by the \fBrlm_sql_log\fP module. The module must be configured in the \fBradiusd\fP server before you can use \fBradsqlrelay\fP. .SH OPTIONS .IP "\-?" Print usage help information. .IP "\-d \fIsql_driver\fP" Driver to use: mysql, pg, oracle. .IP "\-b \fIdatabase\fP" Name of the database to use. .IP "\-f \fIfile\fP" Read password from file, instead of command line. .IP "\-h \fIhost\fP" Connect to host. .IP "\-u \fIuser\fP" User for login. .IP "\-P \fIport\fP" Port number to use for connection. .IP "\-p \fIpassword\fP" Password to use when connecting to server. .IP "\-1" One-shot mode: push the file to database and exit. .IP "\-x" Turn on debugging. .IP "file_path" The pathname of the SQL logfile to use. .SH NOTES .SS Oracle driver The command "radsqlrelay -d oracle -b db.domain.tld sql-relay" reads the database description stored in $TNS_ADMIN/tnsnames.ora: .PP .DS db.domain.tld = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = db.domain.tld)(PORT = 1521)) ) (CONNECT_DATA = (SERVICE_NAME = ) ) ) .DE .SH SEE ALSO .BR rlm_sql_log (5) .SH AUTHOR Nicolas Baradakis freeradius-server/man/man8/radwatch.8000066400000000000000000000015001257552170400200230ustar00rootroot00000000000000.TH RADWATCH 8 "24 February 2001" "" "FreeRADIUS Daemon" .SH NAME radwatch - wrapper for radiusd .SH SYNOPSIS .B radwatch .IR [ options ] .SH DESCRIPTION This is a wrapper for \fIradiusd\fP. It starts the radius server, then waits for it to terminate, which should never happen. If it does happen, \fBradwatch\fP sends a notification email to \fIroot\fP about the event, waits 10 seconds, then restarts the server. .PP This script \fBSHOULD NOT BE USED\fP! It's only here for historical purposes, and WILL be deleted in a future version of the the server. .PP Please see '\fIdoc/supervise-radiusd.txt\fP' for info on methods of supervising your radius installation. .SH OPTIONS Passed directly to the radius server - see the manpage of \fBradiusd\fP. .SH SEE ALSO radiusd(8). .SH AUTHOR Miquel van Smoorenburg, miquels@cistron.nl. freeradius-server/mibs/000077500000000000000000000000001257552170400154555ustar00rootroot00000000000000freeradius-server/mibs/FREERADIUS-PRODUCT-RADIUSD-MIB.txt000066400000000000000000000016071257552170400224670ustar00rootroot00000000000000FREERADIUS-PRODUCT-RADIUSD-MIB DEFINITIONS ::= BEGIN IMPORTS MODULE-IDENTITY, OBJECT-IDENTITY FROM SNMPv2-SMI freeRadiusProducts FROM FREERADIUS-SMI; freeradius MODULE-IDENTITY LAST-UPDATED "200712170000Z" ORGANIZATION "FreeRADIUS Project" CONTACT-INFO "FreeRADIUS Network Object Model Environment project see http://www.freeradius.org for contact persons of a particular area or subproject of FREERADIUS. Administrative contact for MIB module: Alan DeKok email: aland@freeradius.org" DESCRIPTION "The product registrations for the FreeRADIUS SNMP subagent. These registrations are guaranteed to be unique and are used for SMUX registration by default (if not overridden manually)." ::= { freeRadiusProducts 1 } radiusd OBJECT-IDENTITY STATUS current DESCRIPTION "radiusd is the RADIUS protocol deamon of the FreeRADIUS project." ::= { freeradius 1 } END freeradius-server/mibs/FREERADIUS-SMI.txt000066400000000000000000000021631257552170400202770ustar00rootroot00000000000000FREERADIUS-SMI DEFINITIONS ::= BEGIN IMPORTS MODULE-IDENTITY, OBJECT-IDENTITY, enterprises FROM SNMPv2-SMI; freeRadius MODULE-IDENTITY LAST-UPDATED "200712170000Z" ORGANIZATION "FREERADIUS project" CONTACT-INFO "FreeRADIUS Network Object Model Environment project see http://www.freeradius.org for contact persons of a particular area or subproject of FREERADIUS. Administrative contact for MIB module: Alan DeKok email: aland@freeradius.org" DESCRIPTION "The Structure of FREERADIUS." ::= { enterprises 11344 } -- assigned by IANA freeRadiusProducts OBJECT-IDENTITY STATUS current DESCRIPTION "freeRadiusProducts is the root OBJECT IDENTIFIER from which sysObjectID values are assigned." ::= { freeRadius 1 } freeRadiusMgmt OBJECT-IDENTITY STATUS current DESCRIPTION "freeRadiusMgmt defines the subtree for production FREERADIUS related MIB registrations." ::= { freeRadius 2 } freeRadiusTest OBJECT-IDENTITY STATUS current DESCRIPTION "freeRadiusTest defines the subtree for testing FREERADIUS related MIB registrations." ::= { freeRadius 3 } -- more to come if necessary. END freeradius-server/mibs/RADIUS-ACC-SERVER-MIB.chart000066400000000000000000000030161257552170400214640ustar00rootroot00000000000000+-(67) radiusMIB +-(2) radiusAccounting +-(1) radiusAccServMIB +-(1) radiusAccServMIBObjects | +-(1) radiusAccServ | +-(1) radiusAccServIdent | +-(2) radiusAccServUpTime | +-(3) radiusAccServResetTime | +-(4) radiusAccServConfigReset * | +-(5) radiusAccServTotalRequests | +-(6) radiusAccServTotalInvalidRequests | +-(7) radiusAccServTotalDupRequests | +-(8) radiusAccServTotalResponses | +-(9) radiusAccServTotalMalformedRequests | +-(10) radiusAccServTotalBadAuthenticators | +-(11) radiusAccServTotalPacketsDropped | +-(12) radiusAccServTotalNoRecords | +-(13) radiusAccServTotalUnknownTypes | +-(14) radiusAccClientTable | +-(1) radiusAccClientEntry | +-(1) radiusAccClientIndex | +-(2) radiusAccClientAddress | +-(3) radiusAccClientID | +-(4) radiusAccServPacketsDropped | +-(5) radiusAccServRequests | +-(6) radiusAccServDupRequests | +-(7) radiusAccServResponses | +-(8) radiusAccServBadAuthenticators | +-(9) radiusAccServMalformedRequests | +-(10) radiusAccServNoRecords | +-(11) radiusAccServUnknownTypes | +-(2) radiusAccServMIBConformance +-(1) radiusAccServMIBCompliances | +-(1) radiusAccServMIBCompliance | +-(2) radiusAccServMIBGroups +-(1) radiusAccServMIBGroup freeradius-server/mibs/RADIUS-ACC-SERVER-MIB.txt000066400000000000000000000325021257552170400212040ustar00rootroot00000000000000RADIUS-ACC-SERVER-MIB DEFINITIONS ::= BEGIN IMPORTS MODULE-IDENTITY, OBJECT-TYPE, OBJECT-IDENTITY, Counter32, Integer32, IpAddress, TimeTicks, mib-2 FROM SNMPv2-SMI SnmpAdminString FROM SNMP-FRAMEWORK-MIB MODULE-COMPLIANCE, OBJECT-GROUP FROM SNMPv2-CONF; radiusAccServMIB MODULE-IDENTITY LAST-UPDATED "9906110000Z" -- 11 Jun 1999 ORGANIZATION "IETF RADIUS Working Group." CONTACT-INFO " Bernard Aboba Microsoft One Microsoft Way Redmond, WA 98052 US Phone: +1 425 936 6605 EMail: bernarda@microsoft.com" DESCRIPTION "The MIB module for entities implementing the server side of the Remote Access Dialin User Service (RADIUS) accounting protocol." REVISION "9906110000Z" -- 11 Jun 1999 DESCRIPTION "Initial version as published in RFC 2621" ::= { radiusAccounting 1 } radiusMIB OBJECT-IDENTITY STATUS current DESCRIPTION "The OID assigned to RADIUS MIB work by the IANA." ::= { mib-2 67 } radiusAccounting OBJECT IDENTIFIER ::= {radiusMIB 2} radiusAccServMIBObjects OBJECT IDENTIFIER ::= { radiusAccServMIB 1 } radiusAccServ OBJECT IDENTIFIER ::= { radiusAccServMIBObjects 1 } radiusAccServIdent OBJECT-TYPE SYNTAX SnmpAdminString MAX-ACCESS read-only STATUS current DESCRIPTION "The implementation identification string for the RADIUS accounting server software in use on the system, for example; `FNS-2.1'" ::= {radiusAccServ 1} radiusAccServUpTime OBJECT-TYPE SYNTAX TimeTicks MAX-ACCESS read-only STATUS current DESCRIPTION "If the server has a persistent state (e.g., a process), this value will be the time elapsed (in hundredths of a second) since the server process was started. For software without persistent state, this value will be zero." ::= {radiusAccServ 2} radiusAccServResetTime OBJECT-TYPE SYNTAX TimeTicks MAX-ACCESS read-only STATUS current DESCRIPTION "If the server has a persistent state (e.g., a process) and supports a `reset' operation (e.g., can be told to re-read configuration files), this value will be the time elapsed (in hundredths of a second) since the server was `reset.' For software that does not have persistence or does not support a `reset' operation, this value will be zero." ::= {radiusAccServ 3} radiusAccServConfigReset OBJECT-TYPE SYNTAX INTEGER { other(1), reset(2), initializing(3), running(4)} MAX-ACCESS read-write STATUS current DESCRIPTION "Status/action object to reinitialize any persistent server state. When set to reset(2), any persistent server state (such as a process) is reinitialized as if the server had just been started. This value will never be returned by a read operation. When read, one of the following values will be returned: other(1) - server in some unknown state; initializing(3) - server (re)initializing; running(4) - server currently running." ::= {radiusAccServ 4} -- New Stats proposed by Dale E. Reed Jr (daler@iea.com) radiusAccServTotalRequests OBJECT-TYPE SYNTAX Counter32 MAX-ACCESS read-only STATUS current DESCRIPTION "The number of packets received on the accounting port." ::= { radiusAccServ 5 } radiusAccServTotalInvalidRequests OBJECT-TYPE SYNTAX Counter32 MAX-ACCESS read-only STATUS current DESCRIPTION "The number of RADIUS Accounting-Request packets received from unknown addresses." ::= { radiusAccServ 6 } radiusAccServTotalDupRequests OBJECT-TYPE SYNTAX Counter32 MAX-ACCESS read-only STATUS current DESCRIPTION "The number of duplicate RADIUS Accounting-Request packets received." ::= { radiusAccServ 7 } radiusAccServTotalResponses OBJECT-TYPE SYNTAX Counter32 MAX-ACCESS read-only STATUS current DESCRIPTION "The number of RADIUS Accounting-Response packets sent." ::= { radiusAccServ 8 } radiusAccServTotalMalformedRequests OBJECT-TYPE SYNTAX Counter32 MAX-ACCESS read-only STATUS current DESCRIPTION "The number of malformed RADIUS Accounting-Request packets received. Bad authenticators or unknown types are not included as malformed Access-Requests." ::= { radiusAccServ 9 } radiusAccServTotalBadAuthenticators OBJECT-TYPE SYNTAX Counter32 MAX-ACCESS read-only STATUS current DESCRIPTION "The number of RADIUS Accounting-Request packets which contained invalid Signature attributes." ::= { radiusAccServ 10 } radiusAccServTotalPacketsDropped OBJECT-TYPE SYNTAX Counter32 MAX-ACCESS read-only STATUS current DESCRIPTION "The number of incoming packets silently discarded for a reason other than malformed, bad authenticators, or unknown types." ::= { radiusAccServ 11 } radiusAccServTotalNoRecords OBJECT-TYPE SYNTAX Counter32 MAX-ACCESS read-only STATUS current DESCRIPTION "The number of RADIUS Accounting-Request packets which were received and responded to but not recorded." ::= { radiusAccServ 12 } radiusAccServTotalUnknownTypes OBJECT-TYPE SYNTAX Counter32 MAX-ACCESS read-only STATUS current DESCRIPTION "The number of RADIUS packets of unknowntype which were received." ::= { radiusAccServ 13 } -- End of new radiusAccClientTable OBJECT-TYPE SYNTAX SEQUENCE OF RadiusAccClientEntry MAX-ACCESS not-accessible STATUS current DESCRIPTION "The (conceptual) table listing the RADIUS accounting clients with which the server shares a secret." ::= { radiusAccServ 14 } radiusAccClientEntry OBJECT-TYPE SYNTAX RadiusAccClientEntry MAX-ACCESS not-accessible STATUS current DESCRIPTION "An entry (conceptual row) representing a RADIUS accounting client with which the server shares a secret." INDEX { radiusAccClientIndex } ::= { radiusAccClientTable 1 } RadiusAccClientEntry ::= SEQUENCE { radiusAccClientIndex Integer32, radiusAccClientAddress IpAddress, radiusAccClientID SnmpAdminString, radiusAccServPacketsDropped Counter32, radiusAccServRequests Counter32, radiusAccServDupRequests Counter32, radiusAccServResponses Counter32, radiusAccServBadAuthenticators Counter32, radiusAccServMalformedRequests Counter32, radiusAccServNoRecords Counter32, radiusAccServUnknownTypes Counter32 } radiusAccClientIndex OBJECT-TYPE SYNTAX Integer32 (1..2147483647) MAX-ACCESS not-accessible STATUS current DESCRIPTION "A number uniquely identifying each RADIUS accounting client with which this server communicates." ::= { radiusAccClientEntry 1 } radiusAccClientAddress OBJECT-TYPE SYNTAX IpAddress MAX-ACCESS read-only STATUS current DESCRIPTION "The NAS-IP-Address of the RADIUS accounting client referred to in this table entry." ::= { radiusAccClientEntry 2 } radiusAccClientID OBJECT-TYPE SYNTAX SnmpAdminString MAX-ACCESS read-only STATUS current DESCRIPTION "The NAS-Identifier of the RADIUS accounting client referred to in this table entry. This is not necessarily the same as sysName in MIB II." ::= { radiusAccClientEntry 3 } -- Server Counters -- -- Requests - DupRequests - BadAuthenticators - MalformedRequests - -- UnknownTypes - PacketsDropped - Responses = Pending -- -- Requests - DupRequests - BadAuthenticators - MalformedRequests - -- UnknownTypes - PacketsDropped - NoRecords = entries logged radiusAccServPacketsDropped OBJECT-TYPE SYNTAX Counter32 MAX-ACCESS read-only STATUS current DESCRIPTION "The number of incoming packets received from this client and silently discarded for a reason other than malformed, bad authenticators, or unknown types." ::= { radiusAccClientEntry 4 } radiusAccServRequests OBJECT-TYPE SYNTAX Counter32 MAX-ACCESS read-only STATUS current DESCRIPTION "The number of packets received from this client on the accounting port." ::= { radiusAccClientEntry 5 } radiusAccServDupRequests OBJECT-TYPE SYNTAX Counter32 MAX-ACCESS read-only STATUS current DESCRIPTION "The number of duplicate RADIUS Accounting-Request packets received from this client." ::= { radiusAccClientEntry 6 } radiusAccServResponses OBJECT-TYPE SYNTAX Counter32 MAX-ACCESS read-only STATUS current DESCRIPTION "The number of RADIUS Accounting-Response packets sent to this client." ::= { radiusAccClientEntry 7 } radiusAccServBadAuthenticators OBJECT-TYPE SYNTAX Counter32 MAX-ACCESS read-only STATUS current DESCRIPTION "The number of RADIUS Accounting-Request packets which contained invalid authenticators received from this client." ::= { radiusAccClientEntry 8 } radiusAccServMalformedRequests OBJECT-TYPE SYNTAX Counter32 MAX-ACCESS read-only STATUS current DESCRIPTION "The number of malformed RADIUS Accounting-Request packets which were received from this client. Bad authenticators and unknown types are not included as malformed Accounting-Requests." ::= { radiusAccClientEntry 9 } radiusAccServNoRecords OBJECT-TYPE SYNTAX Counter32 MAX-ACCESS read-only STATUS current DESCRIPTION "The number of RADIUS Accounting-Request packets which were received and responded to but not recorded." ::= { radiusAccClientEntry 10 } radiusAccServUnknownTypes OBJECT-TYPE SYNTAX Counter32 MAX-ACCESS read-only STATUS current DESCRIPTION "The number of RADIUS packets of unknown type which were received from this client." ::= { radiusAccClientEntry 11 } -- conformance information radiusAccServMIBConformance OBJECT IDENTIFIER ::= { radiusAccServMIB 2 } radiusAccServMIBCompliances OBJECT IDENTIFIER ::= { radiusAccServMIBConformance 1 } radiusAccServMIBGroups OBJECT IDENTIFIER ::= { radiusAccServMIBConformance 2 } -- compliance statements radiusAccServMIBCompliance MODULE-COMPLIANCE STATUS current DESCRIPTION "The compliance statement for accounting servers implementing the RADIUS Accounting Server MIB." MODULE -- this module MANDATORY-GROUPS { radiusAccServMIBGroup } OBJECT radiusAccServConfigReset WRITE-SYNTAX INTEGER { reset(2) } DESCRIPTION "The only SETable value is 'reset' (2)." ::= { radiusAccServMIBCompliances 1 } -- units of conformance radiusAccServMIBGroup OBJECT-GROUP OBJECTS {radiusAccServIdent, radiusAccServUpTime, radiusAccServResetTime, radiusAccServConfigReset, radiusAccServTotalRequests, radiusAccServTotalInvalidRequests, radiusAccServTotalDupRequests, radiusAccServTotalResponses, radiusAccServTotalMalformedRequests, radiusAccServTotalBadAuthenticators, radiusAccServTotalPacketsDropped, radiusAccServTotalNoRecords, radiusAccServTotalUnknownTypes, radiusAccClientAddress, radiusAccClientID, radiusAccServPacketsDropped, radiusAccServRequests, radiusAccServDupRequests, radiusAccServResponses, radiusAccServBadAuthenticators, radiusAccServMalformedRequests, radiusAccServNoRecords, radiusAccServUnknownTypes } STATUS current DESCRIPTION "The collection of objects providing management of a RADIUS Accounting Server." ::= { radiusAccServMIBGroups 1 } END freeradius-server/mibs/RADIUS-AUTH-SERVER-MIB.chart000066400000000000000000000032121257552170400216350ustar00rootroot00000000000000+-(67) radiusMIB +-(1) radiusAuthentication +-(1) radiusAuthServMIB | +-(1) radiusAuthServMIBObjects | +-(1) radiusAuthServ | +-(1) radiusAuthServIdent | +-(2) radiusAuthServUpTime | +-(3) radiusAuthServResetTime | +-(4) radiusAuthServConfigReset | +-(5) radiusAuthServTotalAccessRequests | +-(6) radiusAuthServTotalInvalidRequests | +-(7) radiusAuthServTotalDupAccessRequests | +-(8) radiusAuthServTotalAccessAccepts | +-(9) radiusAuthServTotalAccessRejects | +-(10) radiusAuthServTotalAccessChallenges | +-(11) radiusAuthServTotalMalformedAccessRequests | +-(12) radiusAuthServTotalBadAuthenticators | +-(13) radiusAuthServTotalPacketsDropped | +-(14) radiusAuthServTotalUnknownTypes | +-(15) radiusAuthClientTable | +-(1) radiusAuthClientEntry | +-(1) radiusAuthClientIndex | +-(2) radiusAuthClientAddress | +-(3) radiusAuthClientID | +-(4) radiusAuthServAccessRequests | +-(5) radiusAuthServDupAccessRequests | +-(6) radiusAuthServAccessAccepts | +-(7) radiusAuthServAccessRejects | +-(8) radiusAuthServAccessChallenges | +-(9) radiusAuthServMalformedAccessRequests | +-(10) radiusAuthServBadAuthenticators | +-(11) radiusAuthServPacketsDropped | +-(12) radiusAuthServUnknownTypes +-(2) radiusAuthServMIBConformance +-(1) radiusAuthServMIBCompliances +-(1) radiusAuthServMIBCompliance +-(2) radiusAuthServMIBGroups +-(1) radiusAuthServMIBGroup freeradius-server/mibs/RADIUS-AUTH-SERVER-MIB.txt000066400000000000000000000344311257552170400213620ustar00rootroot00000000000000RADIUS-AUTH-SERVER-MIB DEFINITIONS ::= BEGIN IMPORTS MODULE-IDENTITY, OBJECT-TYPE, OBJECT-IDENTITY, Counter32, Integer32, IpAddress, TimeTicks, mib-2 FROM SNMPv2-SMI SnmpAdminString FROM SNMP-FRAMEWORK-MIB MODULE-COMPLIANCE, OBJECT-GROUP FROM SNMPv2-CONF; radiusAuthServMIB MODULE-IDENTITY LAST-UPDATED "9906110000Z" ORGANIZATION "IETF RADIUS Working Group." CONTACT-INFO " Bernard Aboba Microsoft One Microsoft Way Redmond, WA 98052 US Phone: +1 425 936 6605 EMail: bernarda@microsoft.com" DESCRIPTION "The MIB module for entities implementing the server side of the Remote Access Dialin User Service (RADIUS) authentication protocol." REVISION "9906110000Z" -- 11 Jun 1999 DESCRIPTION "Initial version as published in RFC 2619" ::= { radiusAuthentication 1 } radiusMIB OBJECT-IDENTITY STATUS current DESCRIPTION "The OID assigned to RADIUS MIB work by the IANA." ::= { mib-2 67 } radiusAuthentication OBJECT IDENTIFIER ::= {radiusMIB 1} radiusAuthServMIBObjects OBJECT IDENTIFIER ::= { radiusAuthServMIB 1 } radiusAuthServ OBJECT IDENTIFIER ::= { radiusAuthServMIBObjects 1 } radiusAuthServIdent OBJECT-TYPE SYNTAX SnmpAdminString MAX-ACCESS read-only STATUS current DESCRIPTION "The implementation identification string for the RADIUS authentication server software in use on the system, for example; `FNS-2.1'" ::= {radiusAuthServ 1} radiusAuthServUpTime OBJECT-TYPE SYNTAX TimeTicks MAX-ACCESS read-only STATUS current DESCRIPTION "If the server has a persistent state (e.g., a process), this value will be the time elapsed (in hundredths of a seco) since the server process was started. For software without persistent state, this value will be zero." ::= {radiusAuthServ 2} radiusAuthServResetTime OBJECT-TYPE SYNTAX TimeTicks MAX-ACCESS read-only STATUS current DESCRIPTION "If the server has a persistent state (e.g., a process) and supports a `reset' operation (e.g., can be told to re-read configuration files), this value will be the time elapsed (in hundredths of a second) since the server was `reset.' For software that does not have persistence or does not support a `reset' operation, this value will be zero." ::= {radiusAuthServ 3} radiusAuthServConfigReset OBJECT-TYPE SYNTAX INTEGER { other(1), reset(2), initializing(3), running(4)} MAX-ACCESS read-write STATUS current DESCRIPTION "Status/action object to reinitialize any persistent server state. When set to reset(2), any persistent server state (such as a process) is reinitialized as if the server had just been started. This value will never be returned by a read operation. When read, one of the following values will be returned: other(1) - server in some unknown state; initializing(3) - server (re)initializing; running(4) - server currently running." ::= {radiusAuthServ 4} -- New Stats proposed by Dale E. Reed Jr (daler@iea-software.com) radiusAuthServTotalAccessRequests OBJECT-TYPE SYNTAX Counter32 MAX-ACCESS read-only STATUS current DESCRIPTION "The number of packets received on the authentication port." ::= { radiusAuthServ 5} radiusAuthServTotalInvalidRequests OBJECT-TYPE SYNTAX Counter32 MAX-ACCESS read-only STATUS current DESCRIPTION "The number of RADIUS Access-Request packets received from unknown addresses." ::= { radiusAuthServ 6 } radiusAuthServTotalDupAccessRequests OBJECT-TYPE SYNTAX Counter32 MAX-ACCESS read-only STATUS current DESCRIPTION "The number of duplicate RADIUS Access-Request packets received." ::= { radiusAuthServ 7 } radiusAuthServTotalAccessAccepts OBJECT-TYPE SYNTAX Counter32 MAX-ACCESS read-only STATUS current DESCRIPTION "The number of RADIUS Access-Accept packets sent." ::= { radiusAuthServ 8 } radiusAuthServTotalAccessRejects OBJECT-TYPE SYNTAX Counter32 MAX-ACCESS read-only STATUS current DESCRIPTION "The number of RADIUS Access-Reject packets sent." ::= { radiusAuthServ 9 } radiusAuthServTotalAccessChallenges OBJECT-TYPE SYNTAX Counter32 MAX-ACCESS read-only STATUS current DESCRIPTION "The number of RADIUS Access-Challenge packets sent." ::= { radiusAuthServ 10 } radiusAuthServTotalMalformedAccessRequests OBJECT-TYPE SYNTAX Counter32 MAX-ACCESS read-only STATUS current DESCRIPTION "The number of malformed RADIUS Access-Request packets received. Bad authenticators and unknown types are not included as malformed Access-Requests." ::= { radiusAuthServ 11 } radiusAuthServTotalBadAuthenticators OBJECT-TYPE SYNTAX Counter32 MAX-ACCESS read-only STATUS current DESCRIPTION "The number of RADIUS Authentication-Request packets which contained invalid Signature attributes received." ::= { radiusAuthServ 12 } radiusAuthServTotalPacketsDropped OBJECT-TYPE SYNTAX Counter32 MAX-ACCESS read-only STATUS current DESCRIPTION "The number of incoming packets silently discarded for some reason other than malformed, bad authenticators or unknown types." ::= { radiusAuthServ 13 } radiusAuthServTotalUnknownTypes OBJECT-TYPE SYNTAX Counter32 MAX-ACCESS read-only STATUS current DESCRIPTION "The number of RADIUS packets of unknown type which were received." ::= { radiusAuthServ 14 } -- End of new radiusAuthClientTable OBJECT-TYPE SYNTAX SEQUENCE OF RadiusAuthClientEntry MAX-ACCESS not-accessible STATUS current DESCRIPTION "The (conceptual) table listing the RADIUS authentication clients with which the server shares a secret." ::= { radiusAuthServ 15 } radiusAuthClientEntry OBJECT-TYPE SYNTAX RadiusAuthClientEntry MAX-ACCESS not-accessible STATUS current DESCRIPTION "An entry (conceptual row) representing a RADIUS authentication client with which the server shares a secret." INDEX { radiusAuthClientIndex } ::= { radiusAuthClientTable 1 } RadiusAuthClientEntry ::= SEQUENCE { radiusAuthClientIndex Integer32, radiusAuthClientAddress IpAddress, radiusAuthClientID SnmpAdminString, radiusAuthServAccessRequests Counter32, radiusAuthServDupAccessRequests Counter32, radiusAuthServAccessAccepts Counter32, radiusAuthServAccessRejects Counter32, radiusAuthServAccessChallenges Counter32, radiusAuthServMalformedAccessRequests Counter32, radiusAuthServBadAuthenticators Counter32, radiusAuthServPacketsDropped Counter32, radiusAuthServUnknownTypes Counter32 } radiusAuthClientIndex OBJECT-TYPE SYNTAX Integer32 (1..2147483647) MAX-ACCESS not-accessible STATUS current DESCRIPTION "A number uniquely identifying each RADIUS authentication client with which this server communicates." ::= { radiusAuthClientEntry 1 } radiusAuthClientAddress OBJECT-TYPE SYNTAX IpAddress MAX-ACCESS read-only STATUS current DESCRIPTION "The NAS-IP-Address of the RADIUS authentication client referred to in this table entry." ::= { radiusAuthClientEntry 2 } radiusAuthClientID OBJECT-TYPE SYNTAX SnmpAdminString MAX-ACCESS read-only STATUS current DESCRIPTION "The NAS-Identifier of the RADIUS authentication client referred to in this table entry. This is not necessarily the same as sysName in MIB II." ::= { radiusAuthClientEntry 3 } -- Server Counters -- -- Responses = AccessAccepts + AccessRejects + AccessChallenges -- -- Requests - DupRequests - BadAuthenticators - MalformedRequests - -- UnknownTypes - PacketsDropped - Responses = Pending -- -- Requests - DupRequests - BadAuthenticators - MalformedRequests - -- UnknownTypes - PacketsDropped = entries logged radiusAuthServAccessRequests OBJECT-TYPE SYNTAX Counter32 MAX-ACCESS read-only STATUS current DESCRIPTION "The number of packets received on the authentication port from this client." ::= { radiusAuthClientEntry 4 } radiusAuthServDupAccessRequests OBJECT-TYPE SYNTAX Counter32 MAX-ACCESS read-only STATUS current DESCRIPTION "The number of duplicate RADIUS Access-Request packets received from this client." ::= { radiusAuthClientEntry 5 } radiusAuthServAccessAccepts OBJECT-TYPE SYNTAX Counter32 MAX-ACCESS read-only STATUS current DESCRIPTION "The number of RADIUS Access-Accept packets sent to this client." ::= { radiusAuthClientEntry 6 } radiusAuthServAccessRejects OBJECT-TYPE SYNTAX Counter32 MAX-ACCESS read-only STATUS current DESCRIPTION "The number of RADIUS Access-Reject packets sent to this client." ::= { radiusAuthClientEntry 7 } radiusAuthServAccessChallenges OBJECT-TYPE SYNTAX Counter32 MAX-ACCESS read-only STATUS current DESCRIPTION "The number of RADIUS Access-Challenge packets sent to this client." ::= { radiusAuthClientEntry 8 } radiusAuthServMalformedAccessRequests OBJECT-TYPE SYNTAX Counter32 MAX-ACCESS read-only STATUS current DESCRIPTION "The number of malformed RADIUS Access-Request packets received from this client. Bad authenticators and unknown types are not included as malformed Access-Requests." ::= { radiusAuthClientEntry 9 } radiusAuthServBadAuthenticators OBJECT-TYPE SYNTAX Counter32 MAX-ACCESS read-only STATUS current DESCRIPTION "The number of RADIUS Authentication-Request packets which contained invalid Signature attributes received from this client." ::= { radiusAuthClientEntry 10 } radiusAuthServPacketsDropped OBJECT-TYPE SYNTAX Counter32 MAX-ACCESS read-only STATUS current DESCRIPTION "The number of incoming packets from this client silently discarded for some reason other than malformed, bad authenticators or unknown types." ::= { radiusAuthClientEntry 11 } radiusAuthServUnknownTypes OBJECT-TYPE SYNTAX Counter32 MAX-ACCESS read-only STATUS current DESCRIPTION "The number of RADIUS packets of unknown type which were received from this client." ::= { radiusAuthClientEntry 12 } -- conformance information radiusAuthServMIBConformance OBJECT IDENTIFIER ::= { radiusAuthServMIB 2 } radiusAuthServMIBCompliances OBJECT IDENTIFIER ::= { radiusAuthServMIBConformance 1 } radiusAuthServMIBGroups OBJECT IDENTIFIER ::= { radiusAuthServMIBConformance 2 } -- compliance statements radiusAuthServMIBCompliance MODULE-COMPLIANCE STATUS current DESCRIPTION "The compliance statement for authentication servers implementing the RADIUS Authentication Server MIB." MODULE -- this module MANDATORY-GROUPS { radiusAuthServMIBGroup } OBJECT radiusAuthServConfigReset WRITE-SYNTAX INTEGER { reset(2) } DESCRIPTION "The only SETable value is 'reset' (2)." ::= { radiusAuthServMIBCompliances 1 } -- units of conformance radiusAuthServMIBGroup OBJECT-GROUP OBJECTS {radiusAuthServIdent, radiusAuthServUpTime, radiusAuthServResetTime, radiusAuthServConfigReset, radiusAuthServTotalAccessRequests, radiusAuthServTotalInvalidRequests, radiusAuthServTotalDupAccessRequests, radiusAuthServTotalAccessAccepts, radiusAuthServTotalAccessRejects, radiusAuthServTotalAccessChallenges, radiusAuthServTotalMalformedAccessRequests, radiusAuthServTotalBadAuthenticators, radiusAuthServTotalPacketsDropped, radiusAuthServTotalUnknownTypes, radiusAuthClientAddress, radiusAuthClientID, radiusAuthServAccessRequests, radiusAuthServDupAccessRequests, radiusAuthServAccessAccepts, radiusAuthServAccessRejects, radiusAuthServAccessChallenges, radiusAuthServMalformedAccessRequests, radiusAuthServBadAuthenticators, radiusAuthServPacketsDropped, radiusAuthServUnknownTypes } STATUS current DESCRIPTION "The collection of objects providing management of a RADIUS Authentication Server." ::= { radiusAuthServMIBGroups 1 } END freeradius-server/mibs/RADIUS-STAT-MIB.txt000066400000000000000000000253371257552170400203750ustar00rootroot00000000000000RADIUS-STAT-MIB DEFINITIONS ::= BEGIN IMPORTS MODULE-IDENTITY, OBJECT-TYPE, OBJECT-IDENTITY, Counter32, Integer32, IpAddress, TimeTicks, mib-2 FROM SNMPv2-SMI SnmpAdminString FROM SNMP-FRAMEWORK-MIB; radiusStatMIB MODULE-IDENTITY LAST-UPDATED "0001020000Z" ORGANIZATION "IETF RADIUS Working Group." CONTACT-INFO " Sergey Poznyakoff email: gray@farlep.net" DESCRIPTION "The MIB module for entities implementing the statistics side of the Remote Access Dialin User Service (RADIUS) authentication protocol." REVISION "0001020000Z" DESCRIPTION "Experimental Version" ::= { radiusStatistics 1 } radiusMIB OBJECT-IDENTITY STATUS current DESCRIPTION "The OID assigned to RADIUS MIB work by the IANA." ::= { mib-2 67 } radiusStatistics OBJECT IDENTIFIER ::= {radiusMIB 3} radiusStatIdent OBJECT-TYPE SYNTAX SnmpAdminString MAX-ACCESS read-only STATUS current DESCRIPTION "The implementation identification string for the RADIUS statistics server software in use on the system" ::= {radiusStatMIB 1} radiusStatUpTime OBJECT-TYPE SYNTAX TimeTicks MAX-ACCESS read-only STATUS current DESCRIPTION "Time (in hundredths of a second) since the statistics was started." ::= {radiusStatMIB 2} radiusStatConfigReset OBJECT-TYPE SYNTAX INTEGER { other(1), reset(2), initializing(3), running(4)} MAX-ACCESS read-write STATUS current DESCRIPTION "Status/action object to reinitialize any persistent server state. When set to reset(2), any persistent server state (such as a process) is reinitialized as if the server had just been started. This value will never be returned by a read operation. When read, one of the following values will be returned: other(1) - server in some unknown state; initializing(3) - server (re)initializing; running(4) - server currently running." ::= {radiusStatMIB 3} radiusStatTotalLines OBJECT-TYPE SYNTAX Counter32 MAX-ACCESS read-only STATUS current DESCRIPTION "The number of dialup lines registered by the statistics module" ::= { radiusStatMIB 4} radiusStatTotalLinesInUse OBJECT-TYPE SYNTAX Counter32 MAX-ACCESS read-only STATUS current DESCRIPTION "The number dial-up lines currently in use" ::= { radiusStatMIB 5 } radiusStatTotalLinesIdle OBJECT-TYPE SYNTAX Counter32 MAX-ACCESS read-only STATUS current DESCRIPTION "The number dial-up lines currently idle" ::= { radiusStatMIB 6 } radiusStatNASTable OBJECT-TYPE SYNTAX SEQUENCE OF RadiusStatNASEntry MAX-ACCESS not-accessible STATUS current DESCRIPTION "The (conceptual) table listing the available Network Access Servers" ::= { radiusStatMIB 7 } radiusStatNASEntry OBJECT-TYPE SYNTAX RadiusNASStatEntry MAX-ACCESS not-accessible STATUS current DESCRIPTION "An entry (conceptual row) representing a Network Access Server" INDEX { NASIndex } ::= { radiusStatNASTable 1 } RadiusStatNASEntry ::= SEQUENCE { NASIndex Integer32, NASAddress IpAddress, NASID SnmpAdminString, NASLines Counter32, NASLinesInUse Counter32, NASLinesIdle Counter32, } NASIndex OBJECT-TYPE SYNTAX Integer32 (1..2147483647) MAX-ACCESS not-accessible STATUS current DESCRIPTION "A number uniquely identifying each NAS" ::= { radiusStatNASEntry 1 } NASAddress OBJECT-TYPE SYNTAX IpAddress MAX-ACCESS read-only STATUS current DESCRIPTION "The NAS-IP-Address" ::= { radiusStatNASEntry 2 } NASID OBJECT-TYPE SYNTAX SnmpAdminString MAX-ACCESS read-only STATUS current DESCRIPTION "The NAS-Identifier" ::= { radiusStatNASEntry 3 } NASLines OBJECT-TYPE SYNTAX Counter32 MAX-ACCESS read-only STATUS current DESCRIPTION "The number of lines served by the NAS" ::= { radiusStatNASEntry 4 } NASLinesInUse OBJECT-TYPE SYNTAX Counter32 MAX-ACCESS read-only STATUS current DESCRIPTION "The number of lines currently in use on this NAS" ::= { radiusStatNASEntry 5 } NASLinesIdle OBJECT-TYPE SYNTAX Counter32 MAX-ACCESS read-only STATUS current DESCRIPTION "The number of lines currently idle on this NAS" ::= { radiusStatNASEntry 6 } radiusStatNASPortTable OBJECT-TYPE SYNTAX SEQUENCE OF RadiusStatNASPortEntry MAX-ACCESS not-accessible STATUS current DESCRIPTION "The (conceptual) table listing the available ports" ::= { radiusStatMIB 8 } radiusStatNASPortEntry OBJECT-TYPE SYNTAX RadiusStatNASPortEntry MAX-ACCESS not-accessible STATUS current DESCRIPTION "An entry (conceptual row) representing a port" INDEX { PortIndex } ::= { radiusStatNASPortTable 1 } RadiusStatNASPortEntry ::= SEQUENCE { radiusStatPortIndex Integer32, radiusStatNASIndex Integer32, radiusStatPortID Integer32, radiusStatPortFramedAddress IpAddress, radiusStatPortTotalLogins Counter32, radiusStatPortStatus Counter32, radiusStatPortStatusDate SnmpAdminString, radiusStatPortUpTime TimeTicks, radiusStatPortLastLogin SnmpAdminString, radiusStatPortLastLoginDate SnmpAdminString, radiusStatPortLastLogoutDate SnmpAdminString, radiusStatPortIdleTotalTime TimeTicks, radiusStatPortIdleMaxTime TimeTicks, radiusStatPortIdleMaxDate SnmpAdminString, radiusStatPortInUseTotalTime TimeTicks, radiusStatPortInUseMaxTime TimeTicks, radiusStatPortInUseMaxDate SnmpAdminString, } radiusStatPortIndex OBJECT-TYPE SYNTAX Integer32 (1..2147483647) MAX-ACCESS read-only STATUS current DESCRIPTION "A number uniquely identifying each port" ::= { radiusStatNASPortEntry 1 } radiusStatNASIndex OBJECT-TYPE SYNTAX Integer32 (1..2147483647) MAX-ACCESS read-only STATUS current DESCRIPTION "A number uniquely identifying each port" ::= { radiusStatNASPortEntry 2 } radiusStatPortID OBJECT-TYPE SYNTAX Integer32 (1..2147483647) MAX-ACCESS read-only STATUS current DESCRIPTION "The Port-Identifier" ::= { radiusStatNASPortEntry 3 } radiusStatPortFramedAddress OBJECT-TYPE SYNTAX IpAddress MAX-ACCESS read-only STATUS current DESCRIPTION "The Port-Identifier" ::= { radiusStatNASPortEntry 4 } radiusStatPortTotalLogins OBJECT-TYPE SYNTAX Counter32 MAX-ACCESS read-only STATUS current DESCRIPTION "The number of logins registered so far" ::= { radiusStatNASPortEntry 5 } radiusStatPortStatus OBJECT-TYPE SYNTAX INTEGER { idle(1), inUse(2) } MAX-ACCESS read-only STATUS current DESCRIPTION "The status of the port" ::= { radiusStatNASPortEntry 6 } radiusStatPortStatusDate OBJECT-TYPE SYNTAX SnmpAdminString MAX-ACCESS read-only STATUS current DESCRIPTION "Time of the last change in port status" ::= { radiusStatNASPortEntry 7 } radiusStatPortUpTime OBJECT-TYPE SYNTAX TimeTicks MAX-ACCESS read-only STATUS current DESCRIPTION "Time in thousandths of a second since the port changed its status" ::= { radiusStatNASPortEntry 8 } radiusStatPortLastLoginName OBJECT-TYPE SYNTAX SnmpAdminString MAX-ACCESS read-only STATUS current DESCRIPTION "The username of the last user logged in on that port" ::= { radiusStatNASPortEntry 9 } radiusStatPortLastLoginDate OBJECT-TYPE SYNTAX SnmpAdminString MAX-ACCESS read-only STATUS current DESCRIPTION "Time of the last login" ::= { radiusStatNASPortEntry 10 } radiusStatPortLastLogoutDate OBJECT-TYPE SYNTAX SnmpAdminString MAX-ACCESS read-only STATUS current DESCRIPTION "Time of the last logout" ::= { radiusStatNASPortEntry 11 } radiusStatPortIdleTotalTime OBJECT-TYPE SYNTAX TimeTicks MAX-ACCESS read-only STATUS current DESCRIPTION "Total time the port was idle" ::= { radiusStatNASPortEntry 12 } radiusStatPortIdleMaxTime OBJECT-TYPE SYNTAX TimeTicks MAX-ACCESS read-only STATUS current DESCRIPTION "Maximum time the port was idle" ::= { radiusStatNASPortEntry 13 } radiusStatPortIdleMaxDate OBJECT-TYPE SYNTAX SnmpAdminString MAX-ACCESS read-only STATUS current DESCRIPTION "Date when the maximum idle time was registered" ::= { radiusStatNASPortEntry 14 } radiusStatPortInUseTotalTime OBJECT-TYPE SYNTAX TimeTicks MAX-ACCESS read-only STATUS current DESCRIPTION "Total time the port was in use" ::= { radiusStatNASPortEntry 15 } radiusStatPortInUseMaxTime OBJECT-TYPE SYNTAX TimeTicks MAX-ACCESS read-only STATUS current DESCRIPTION "Maximum time the port was in use" ::= { radiusStatNASPortEntry 16 } radiusStatPortInUseMaxDate OBJECT-TYPE SYNTAX SnmpAdminString MAX-ACCESS read-only STATUS current DESCRIPTION "Date when the maximum in use time was registered" ::= { radiusStatNASPortEntry 17 } END freeradius-server/mibs/README000066400000000000000000000007271257552170400163430ustar00rootroot00000000000000This directory contains the ASN.1 specification of the SNMP OIDs assigned to RADIUS MIB work by the IANA. The specifications in RADIUS-ACC-SERVER-MIB.txt and RADIUS-AUTH-SERVER-MIB.txt are extracted from RFCs 2621 and 2619 accordingly. The corresponding RFCs can be found in subdirectory doc/rfc of the package. Both RFCs allow unlimited distribution of the information contained therein. *.chart files contain the graphic representation of the corresponding MIB trees. freeradius-server/missing000077500000000000000000000240361257552170400161270ustar00rootroot00000000000000#! /bin/sh # Common stub for a few missing GNU programs while installing. # Copyright (C) 1996, 1997, 1999, 2000, 2002 Free Software Foundation, Inc. # Originally by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. if test $# -eq 0; then echo 1>&2 "Try \`$0 --help' for more information" exit 1 fi run=: # In the cases where this matters, `missing' is being run in the # srcdir already. if test -f configure.ac; then configure_ac=configure.ac else configure_ac=configure.in fi case "$1" in --run) # Try to run requested program, and just exit if it succeeds. run= shift "$@" && exit 0 ;; esac # If it does not exist, or fails to run (possibly an outdated version), # try to emulate it. case "$1" in -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an error status if there is no known handling for PROGRAM. Options: -h, --help display this help and exit -v, --version output version information and exit --run try to run the given command, and emulate it if it fails Supported PROGRAM values: aclocal touch file \`aclocal.m4' autoconf touch file \`configure' autoheader touch file \`config.h.in' automake touch all \`Makefile.in' files bison create \`y.tab.[ch]', if possible, from existing .[ch] flex create \`lex.yy.c', if possible, from existing .c help2man touch the output file lex create \`lex.yy.c', if possible, from existing .c makeinfo touch the output file tar try tar, gnutar, gtar, then tar without non-portable flags yacc create \`y.tab.[ch]', if possible, from existing .[ch]" ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing 0.4 - GNU automake" ;; -*) echo 1>&2 "$0: Unknown \`$1' option" echo 1>&2 "Try \`$0 --help' for more information" exit 1 ;; aclocal*) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 fi echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." touch aclocal.m4 ;; autoconf) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 fi echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." touch configure ;; autoheader) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 fi echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified \`acconfig.h' or \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` test -z "$files" && files="config.h" touch_files= for f in $files; do case "$f" in *:*) touch_files="$touch_files "`echo "$f" | sed -e 's/^[^:]*://' -e 's/:.*//'`;; *) touch_files="$touch_files $f.in";; esac done touch $touch_files ;; automake*) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 fi echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." find . -type f -name Makefile.am -print | sed 's/\.am$/.in/' | while read f; do touch "$f"; done ;; autom4te) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 fi echo 1>&2 "\ WARNING: \`$1' is needed, and you do not seem to have it handy on your system. You might have modified some files without having the proper tools for further handling them. You can get \`$1Help2man' as part of \`Autoconf' from any GNU archive site." file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'` test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'` if test -f "$file"; then touch $file else test -z "$file" || exec >$file echo "#! /bin/sh" echo "# Created by GNU Automake missing as a replacement of" echo "# $ $@" echo "exit 0" chmod +x $file exit 1 fi ;; bison|yacc) echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified a \`.y' file. You may need the \`Bison' package in order for those modifications to take effect. You can get \`Bison' from any GNU archive site." rm -f y.tab.c y.tab.h if [ $# -ne 1 ]; then eval LASTARG="\${$#}" case "$LASTARG" in *.y) SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" y.tab.c fi SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" y.tab.h fi ;; esac fi if [ ! -f y.tab.h ]; then echo >y.tab.h fi if [ ! -f y.tab.c ]; then echo 'main() { return 0; }' >y.tab.c fi ;; lex|flex) echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified a \`.l' file. You may need the \`Flex' package in order for those modifications to take effect. You can get \`Flex' from any GNU archive site." rm -f lex.yy.c if [ $# -ne 1 ]; then eval LASTARG="\${$#}" case "$LASTARG" in *.l) SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" lex.yy.c fi ;; esac fi if [ ! -f lex.yy.c ]; then echo 'main() { return 0; }' >lex.yy.c fi ;; help2man) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 fi echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified a dependency of a manual page. You may need the \`Help2man' package in order for those modifications to take effect. You can get \`Help2man' from any GNU archive site." file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` if test -z "$file"; then file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'` fi if [ -f "$file" ]; then touch $file else test -z "$file" || exec >$file echo ".ab help2man is required to generate this page" exit 1 fi ;; makeinfo) if test -z "$run" && (makeinfo --version) > /dev/null 2>&1; then # We have makeinfo, but it failed. exit 1 fi echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified a \`.texi' or \`.texinfo' file, or any other file indirectly affecting the aspect of the manual. The spurious call might also be the consequence of using a buggy \`make' (AIX, DU, IRIX). You might want to install the \`Texinfo' package or the \`GNU make' package. Grab either from any GNU archive site." file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` if test -z "$file"; then file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file` fi touch $file ;; tar) shift if test -n "$run"; then echo 1>&2 "ERROR: \`tar' requires --run" exit 1 fi # We have already tried tar in the generic part. # Look for gnutar/gtar before invocation to avoid ugly error # messages. if (gnutar --version > /dev/null 2>&1); then gnutar "$@" && exit 0 fi if (gtar --version > /dev/null 2>&1); then gtar "$@" && exit 0 fi firstarg="$1" if shift; then case "$firstarg" in *o*) firstarg=`echo "$firstarg" | sed s/o//` tar "$firstarg" "$@" && exit 0 ;; esac case "$firstarg" in *h*) firstarg=`echo "$firstarg" | sed s/h//` tar "$firstarg" "$@" && exit 0 ;; esac fi echo 1>&2 "\ WARNING: I can't seem to be able to run \`tar' with the given arguments. You may want to install GNU tar or Free paxutils, or check the command line arguments." exit 1 ;; *) echo 1>&2 "\ WARNING: \`$1' is needed, and you do not seem to have it handy on your system. You might have modified some files without having the proper tools for further handling them. Check the \`README' file, it often tells you about the needed prerequirements for installing this package. You may also peek at any GNU archive site, in case some other package would contain this missing \`$1' program." exit 1 ;; esac exit 0 freeradius-server/raddb/000077500000000000000000000000001257552170400155775ustar00rootroot00000000000000freeradius-server/raddb/.gitignore000066400000000000000000000000641257552170400175670ustar00rootroot00000000000000dictionary radiusd.conf sites-enabled radrelay.conf freeradius-server/raddb/Makefile000066400000000000000000000060611257552170400172420ustar00rootroot00000000000000# # Makefile # # Version: $Id$ # include ../Make.inc # # The list of files to install. # FILES = acct_users attrs attrs.access_reject attrs.accounting_response \ attrs.pre-proxy clients.conf dictionary eap.conf templates.conf \ experimental.conf hints huntgroups ldap.attrmap \ panic.gdb policy.txt preproxy_users proxy.conf radiusd.conf \ sql.conf sqlippool.conf users policy.conf attrs.access_challenge # # This target is here for local debugging # all: @if [ ! -d sites-enabled ]; then \ mkdir sites-enabled; \ fi @if [ ! -f sites-enabled/default ]; then \ cd sites-enabled && ln -s ../sites-available/default; \ fi @if [ ! -f sites-enabled/inner-tunnel ]; then \ cd sites-enabled && ln -s ../sites-available/inner-tunnel; \ fi install: $(INSTALL) -d -m 750 $(R)$(raddbdir) $(INSTALL) -d -m 750 $(R)$(raddbdir)/sites-available $(INSTALL) -d -m 750 $(R)$(raddbdir)/sites-enabled $(INSTALL) -d -m 750 $(R)$(raddbdir)/modules @echo "Creating/updating files in $(R)$(raddbdir)"; \ for i in $(FILES) `find sites-available/ modules/ -type f -print | sed 's/.*CVS.*//;s/.*~//;s/.*#.*//' `; do \ [ ! -f $(R)$(raddbdir)/$$i ] && $(INSTALL) -m 640 $$i $(R)$(raddbdir)/$$i; \ if [ "`find $$i -newer $(R)$(raddbdir)/$$i`" ]; then \ echo "** $(R)$(raddbdir)/$$i"; \ nt=1; \ fi; \ done; \ if [ "$$nt" ]; then \ echo "**";\ echo "** WARNING ** WARNING ** WARNING ** WARNING ** WARNING ** WARNING ** WARNING **";\ echo "** WARNING ** WARNING ** WARNING ** WARNING ** WARNING ** WARNING ** WARNING **";\ echo "**";\ echo "** The sample configuration files in `pwd`";\ echo "** are newer than those in $(R)$(raddbdir)";\ echo "**";\ echo "** Please investigate and manually copy (if appropriate) the files listed above.";\ echo "**";\ echo "** WARNING ** WARNING ** WARNING ** WARNING ** WARNING ** WARNING ** WARNING **";\ echo "** WARNING ** WARNING ** WARNING ** WARNING ** WARNING ** WARNING ** WARNING **";\ fi chmod 640 $(R)$(raddbdir)/clients.conf if [ ! -d $(R)$(raddbdir)/certs ]; then \ $(INSTALL) -d -m 750 $(R)$(raddbdir)/certs; \ $(INSTALL) -m 750 certs/bootstrap $(R)$(raddbdir)/certs; \ for i in Makefile README xpextensions ca.cnf server.cnf client.cnf; do \ $(INSTALL) -m 640 certs/$$i $(R)$(raddbdir)/certs; \ done; \ fi if [ ! -d $(R)$(raddbdir)/sql ]; then \ find sql -name CVS -prune -o -print | \ while read file; do \ if [ -d "$$file" ]; then \ $(INSTALL) -d -m 750 "$(R)$(raddbdir)/$$file"; \ else \ $(INSTALL) -m 640 "$$file" "$(R)$(raddbdir)/$$file"; \ fi; \ done; \ fi if [ ! -f $(R)$(raddbdir)/sites-enabled/default ]; then \ cd $(R)$(raddbdir)/sites-enabled/; \ ln -s ../sites-available/default; \ fi if [ ! -f $(R)$(raddbdir)/sites-enabled/inner-tunnel ]; then \ cd $(R)$(raddbdir)/sites-enabled/; \ ln -s ../sites-available/inner-tunnel; \ fi if [ ! -f $(R)$(raddbdir)/sites-enabled/control-socket ]; then \ cd $(R)$(raddbdir)/sites-enabled/; \ ln -s ../sites-available/control-socket; \ fi clean: rm -rf sites-enabled/inner-tunnel sites-enabled/default freeradius-server/raddb/acct_users000066400000000000000000000012371257552170400176600ustar00rootroot00000000000000# # $Id$ # # This is like the 'users' file, but it is processed only for # accounting packets. # # Select between different accounting methods based for example on the # Realm, the Huntgroup-Name or any combinaison of the attribute/value # pairs contained in an accounting packet. # #DEFAULT Realm == "foo.net", Acct-Type := sql_log.foo # #DEFAULT Huntgroup-Name == "wifi", Acct-Type := sql_log.wifi # #DEFAULT Client-IP-Address == 10.0.0.1, Acct-Type := sql_log.other # #DEFAULT Acct-Status-Type == Start, Acct-Type := sql_log.start # Replace the User-Name with the Stripped-User-Name, if it exists. # #DEFAULT # User-Name := "%{Stripped-User-Name:-%{User-Name}}" freeradius-server/raddb/attrs000066400000000000000000000102171257552170400166600ustar00rootroot00000000000000# # Configuration file for the rlm_attr_filter module. # Please see rlm_attr_filter(5) manpage for more information. # # $Id$ # # This file contains security and configuration information # for each realm. The first field is the realm name and # can be up to 253 characters in length. This is followed (on # the next line) with the list of filter rules to be used to # decide what attributes and/or values we allow proxy servers # to pass to the NAS for this realm. # # When a proxy-reply packet is received from a home server, # these attributes and values are tested. Only the first match # is used unless the "Fall-Through" variable is set to "Yes". # In that case the rules defined in the DEFAULT case are # processed as well. # # A special realm named "DEFAULT" matches on all realm names. # You can have only one DEFAULT entry. All entries are processed # in the order they appear in this file. The first entry that # matches the login-request will stop processing unless you use # the Fall-Through variable. # # Indented (with the tab character) lines following the first # line indicate the filter rules. # # You can include another `attrs' file with `$INCLUDE attrs.other' # # # This is a complete entry for realm "fisp". Note that there is no # Fall-Through entry so that no DEFAULT entry will be used, and the # server will NOT allow any other a/v pairs other than the ones # listed here. # # These rules allow: # o Only Framed-User Service-Types ( no telnet, rlogin, tcp-clear ) # o PPP sessions ( no SLIP, CSLIP, etc. ) # o dynamic ip assignment ( can't assign a static ip ) # o an idle timeout value set to 600 seconds (10 min) or less # o a max session time set to 28800 seconds (8 hours) or less # #fisp # Service-Type == Framed-User, # Framed-Protocol == PPP, # Framed-IP-Address == 255.255.255.254, # Idle-Timeout <= 600, # Session-Timeout <= 28800 # # This is a complete entry for realm "tisp". Note that there is no # Fall-Through entry so that no DEFAULT entry will be used, and the # server will NOT allow any other a/v pairs other than the ones # listed here. # # These rules allow: # o Only Login-User Service-Type ( no framed/ppp sessions ) # o Telnet sessions only ( no rlogin, tcp-clear ) # o Login hosts of either 192.168.1.1 or 192.168.1.2 # #tisp # Service-Type == Login-User, # Login-Service == Telnet, # Login-TCP-Port == 23, # Login-IP-Host == 192.168.1.1, # Login-IP-Host == 192.168.1.2 # # The following example can be used for a home server which is only # allowed to supply a Reply-Message, a Session-Timeout attribute of # maximum 86400, a Idle-Timeout attribute of maximum 600 and a # Acct-Interim-Interval attribute between 300 and 3600. # All other attributes sent back will be filtered out. # #strictrealm # Reply-Message =* ANY, # Session-Timeout <= 86400, # Idle-Timeout <= 600, # Acct-Interim-Interval >= 300, # Acct-Interim-Interval <= 3600 # # This is a complete entry for realm "spamrealm". Fall-Through is used, # so that the DEFAULT filter rules are used in addition to these. # # These rules allow: # o Force the application of Filter-ID attribute to be returned # in the proxy reply, whether the proxy sent it or not. # o The standard DEFAULT rules as defined below # #spamrealm # Framed-Filter-Id := "nosmtp.in", # Fall-Through = Yes # # The rest of this file contains the DEFAULT entry. # DEFAULT matches with all realm names. (except if the realm previously # matched an entry with no Fall-Through) # DEFAULT Service-Type == Framed-User, Service-Type == Login-User, Login-Service == Telnet, Login-Service == Rlogin, Login-Service == TCP-Clear, Login-TCP-Port <= 65536, Framed-IP-Address == 255.255.255.254, Framed-IP-Netmask == 255.255.255.255, Framed-Protocol == PPP, Framed-Protocol == SLIP, Framed-Compression == Van-Jacobson-TCP-IP, Framed-MTU >= 576, Framed-Filter-ID =* ANY, Reply-Message =* ANY, Proxy-State =* ANY, EAP-Message =* ANY, Message-Authenticator =* ANY, MS-MPPE-Recv-Key =* ANY, MS-MPPE-Send-Key =* ANY, MS-CHAP-MPPE-Keys =* ANY, State =* ANY, Session-Timeout <= 28800, Idle-Timeout <= 600, Calling-Station-Id =* ANY, Operator-Name =* ANY, Port-Limit <= 2 freeradius-server/raddb/attrs.access_challenge000066400000000000000000000010011257552170400221110ustar00rootroot00000000000000# # Configuration file for the rlm_attr_filter module. # Please see rlm_attr_filter(5) manpage for more information. # # $Id$ # # This configuration file is used to remove almost all of the # attributes From an Access-Challenge message. The RFC's say # that an Access-Challenge packet can contain only a few # attributes. We enforce that here. # DEFAULT EAP-Message =* ANY, State =* ANY, Message-Authenticator =* ANY, Reply-Message =* ANY, Proxy-State =* ANY, Session-Timeout =* ANY, Idle-Timeout =* ANY freeradius-server/raddb/attrs.access_reject000066400000000000000000000007411257552170400214550ustar00rootroot00000000000000# # Configuration file for the rlm_attr_filter module. # Please see rlm_attr_filter(5) manpage for more information. # # $Id$ # # This configuration file is used to remove almost all of the attributes # From an Access-Reject message. The RFC's say that an Access-Reject # packet can contain only a few attributes. We enforce that here. # DEFAULT EAP-Message =* ANY, State =* ANY, Message-Authenticator =* ANY, Reply-Message =* ANY, MS-CHAP-Error =* ANY, Proxy-State =* ANY freeradius-server/raddb/attrs.accounting_response000066400000000000000000000006651257552170400227350ustar00rootroot00000000000000# # Configuration file for the rlm_attr_filter module. # Please see rlm_attr_filter(5) manpage for more information. # # $Id$ # # This configuration file is used to remove almost all of the attributes # From an Accounting-Response message. The RFC's say that an # Accounting-Response packet can contain only a few attributes. # We enforce that here. # DEFAULT Vendor-Specific =* ANY, Message-Authenticator =* ANY, Proxy-State =* ANY freeradius-server/raddb/attrs.pre-proxy000066400000000000000000000037461257552170400206350ustar00rootroot00000000000000# # Configuration file for the rlm_attr_filter module. # Please see rlm_attr_filter(5) manpage for more information. # # $Id$ # # This file contains security and configuration information # for each realm. It can be used be an rlm_attr_filter module # instance to filter attributes before sending packets to the # home server of a realm. # # When a packet is sent to a home server, these attributes # and values are tested. Only the first match is used unless # the "Fall-Through" variable is set to "Yes". In that case # the rules defined in the DEFAULT case are processed as well. # # A special realm named "DEFAULT" matches on all realm names. # You can have only one DEFAULT entry. All entries are processed # in the order they appear in this file. The first entry that # matches the login-request will stop processing unless you use # the Fall-Through variable. # # The first line indicates the realm to which the rules apply. # Indented (with the tab character) lines following the first # line indicate the filter rules. # # This is a complete entry for 'nochap' realm. It allows to send very # basic attributes to the home server. Note that there is no Fall-Through # entry so that no DEFAULT entry will be used. Only the listed attributes # will be sent in the packet, all other attributes will be filtered out. # #nochap # User-Name =* ANY, # User-Password =* ANY, # NAS-Ip-Address =* ANY, # NAS-Identifier =* ANY # The entry for the 'brokenas' realm removes the attribute NAS-Port-Type # if its value is different from 'Ethernet'. Then the default rules are # applied. # #brokenas # NAS-Port-Type == Ethernet # Fall-Through = Yes # The rest of this file contains the DEFAULT entry. # DEFAULT matches with all realm names. DEFAULT User-Name =* ANY, User-Password =* ANY, CHAP-Password =* ANY, CHAP-Challenge =* ANY, MS-CHAP-Challenge =* ANY, MS-CHAP-Response =* ANY, EAP-Message =* ANY, Message-Authenticator =* ANY, State =* ANY, NAS-IP-Address =* ANY, NAS-Identifier =* ANY, Proxy-State =* ANY freeradius-server/raddb/certs/000077500000000000000000000000001257552170400167175ustar00rootroot00000000000000freeradius-server/raddb/certs/.gitignore000066400000000000000000000001231257552170400207030ustar00rootroot00000000000000*.pem *.key *.crt *.csr *.p12 *.old *.attr dh index.txt random serial passwords.mk freeradius-server/raddb/certs/Makefile000066400000000000000000000106431257552170400203630ustar00rootroot00000000000000###################################################################### # # Make file to be installed in /etc/raddb/certs to enable # the easy creation of certificates. # # See the README file in this directory for more information. # # $Id$ # ###################################################################### DH_KEY_SIZE = 2048 # # Set the passwords # -include passwords.mk ###################################################################### # # Make the necessary files, but not client certificates. # ###################################################################### .PHONY: all all: index.txt serial dh random server ca .PHONY: client client: client.pem .PHONY: ca ca: ca.der .PHONY: server server: server.pem server.vrfy passwords.mk: server.cnf ca.cnf client.cnf @echo "PASSWORD_SERVER = '$(shell grep output_password server.cnf | sed 's/.*=//;s/^ *//')'" > $@ @echo "PASSWORD_CA = '$(shell grep output_password ca.cnf | sed 's/.*=//;s/^ *//')'" >> $@ @echo "PASSWORD_CLIENT = '$(shell grep output_password client.cnf | sed 's/.*=//;s/^ *//')'" >> $@ @echo "USER_NAME = '$(shell grep emailAddress client.cnf | grep '@' | sed 's/.*=//;s/^ *//')'" >> $@ @echo "CA_DEFAULT_DAYS = '$(shell grep default_days ca.cnf | sed 's/.*=//;s/^ *//')'" >> $@ ###################################################################### # # Diffie-Hellman parameters # ###################################################################### dh: openssl gendh -out dh -2 $(DH_KEY_SIZE) ###################################################################### # # Create a new self-signed CA certificate # ###################################################################### ca.key ca.pem: ca.cnf @[ -f index.txt ] || $(MAKE) index.txt @[ -f serial ] || $(MAKE) serial openssl req -new -x509 -keyout ca.key -out ca.pem \ -days $(CA_DEFAULT_DAYS) -config ./ca.cnf ca.der: ca.pem openssl x509 -inform PEM -outform DER -in ca.pem -out ca.der ###################################################################### # # Create a new server certificate, signed by the above CA. # ###################################################################### server.csr server.key: server.cnf openssl req -new -out server.csr -keyout server.key -config ./server.cnf server.crt: server.csr ca.key ca.pem openssl ca -batch -keyfile ca.key -cert ca.pem -in server.csr -key $(PASSWORD_CA) -out server.crt -extensions xpserver_ext -extfile xpextensions -config ./server.cnf server.p12: server.crt openssl pkcs12 -export -in server.crt -inkey server.key -out server.p12 -passin pass:$(PASSWORD_SERVER) -passout pass:$(PASSWORD_SERVER) server.pem: server.p12 openssl pkcs12 -in server.p12 -out server.pem -passin pass:$(PASSWORD_SERVER) -passout pass:$(PASSWORD_SERVER) .PHONY: server.vrfy server.vrfy: ca.pem openssl verify -CAfile ca.pem server.pem ###################################################################### # # Create a new client certificate, signed by the the above CA # ###################################################################### client.csr client.key: client.cnf openssl req -new -out client.csr -keyout client.key -config ./client.cnf client.crt: client.csr ca.pem ca.key openssl ca -batch -keyfile ca.key -cert ca.pem -in client.csr -key $(PASSWORD_CA) -out client.crt -extensions xpclient_ext -extfile xpextensions -config ./client.cnf client.p12: client.crt openssl pkcs12 -export -in client.crt -inkey client.key -out client.p12 -passin pass:$(PASSWORD_CLIENT) -passout pass:$(PASSWORD_CLIENT) client.pem: client.p12 openssl pkcs12 -in client.p12 -out client.pem -passin pass:$(PASSWORD_CLIENT) -passout pass:$(PASSWORD_CLIENT) cp client.pem $(USER_NAME).pem .PHONY: client.vrfy client.vrfy: ca.pem client.pem c_rehash . openssl verify -CApath . client.pem ###################################################################### # # Miscellaneous rules. # ###################################################################### index.txt: @touch index.txt serial: @echo '01' > serial random: @if [ -c /dev/urandom ] ; then \ dd if=/dev/urandom of=./random count=10 >/dev/null 2>&1; \ else \ date > ./random; \ fi print: openssl x509 -text -in server.crt printca: openssl x509 -text -in ca.pem clean: @rm -f *~ *old client.csr client.key client.crt client.p12 client.pem # # Make a target that people won't run too often. # destroycerts: rm -f *~ dh *.csr *.crt *.p12 *.der *.pem *.key index.txt* \ serial* random *\.0 *\.1 freeradius-server/raddb/certs/README000066400000000000000000000204301257552170400175760ustar00rootroot00000000000000 This directory contains scripts to create the server certificates. To make a set of default (i.e. test) certificates, simply type: $ ./bootstrap The "openssl" command will be run against the sample configuration files included here, and will make a self-signed certificate authority (i.e. root CA), and a server certificate. This "root CA" should be installed on any client machine needing to do EAP-TLS, PEAP, or EAP-TTLS. The Microsoft "XP Extensions" will be automatically included in the server certificate. Without those extensions Windows clients will refuse to authenticate to FreeRADIUS. The root CA and the "XP Extensions" file also contain a crlDistributionPoints attribute. The latest release of Windows Phone needs this to be present for the handset to validate the RADIUS server certificate. The RADIUS server must have the URI defined but the CA need not have...however it is best practice for a CA to have a recovation URI. Note that whilst the Windows Mobile client cannot actually use the CRL when doing 802.1X it is recommended that the URI be an actual working URL and contain a recovation format file as there may be other OS behaviour at play and future OSes that may do something with that URI. In general, you should use self-signed certificates for 802.1x (EAP) authentication. When you list root CAs from other organizations in the "CA_file", you permit them to masquerade as you, to authenticate your users, and to issue client certificates for EAP-TLS. If FreeRADIUS was configured to use OpenSSL, then simply starting the server in root in debugging mode should also create test certificates, i.e.: $ radiusd -X That will cause the EAP-TLS module to run the "bootstrap" script in this directory. The script will be executed only once, the first time the server has been installed on a particular machine. This bootstrap script SHOULD be run on installation of any pre-built binary package for your OS. In any case, the script will ensure that it is not run twice, and that it does not over-write any existing certificates. If you already have CA and server certificates, rename (or delete) this directory, and create a new "certs" directory containing your certificates. Note that the "make install" command will NOT over-write your existing "raddb/certs" directory, which means that the "bootstrap" command will not be run. NEW INSTALLATIONS OF FREERADIUS We suggest that new installations use the test certificates for initial tests, and then create real certificates to use for normal user authentication. See the instructions below for how to create the various certificates. The old test certificates can be deleted by running the following command: $ rm -f *.pem *.der *.csr *.crt *.key *.p12 serial* index.txt* Then, follow the instructions below for creating real certificates. Once the final certificates have been created, you can delete the "bootstrap" command from this directory, and delete the "make_cert_command" configuration from the "tls" sub-section of eap.conf. If you do not want to enable EAP-TLS, PEAP, or EAP-TTLS, then delete the relevant sub-sections from the "eap.conf" file. MAKING A ROOT CERTIFICATE $ vi ca.cnf Edit the "input_password" and "output_password" fields to be the password for the CA certificate. Edit the [certificate_authority] section to have the correct values for your country, state, etc. $ make ca.pem This step creates the CA certificate. $ make ca.der This step creates the DER format of the self-signed certificate, which is can be imported into Windows. MAKING A SERVER CERTIFICATE $ vi server.cnf Edit the "input_password" and "output_password" fields to be the password for the server certificate. Edit the [server] section to have the correct values for your country, state, etc. Be sure that the commonName field here is different from the commonName for the CA certificate. $ make server.pem This step creates the server certificate. If you have an existing certificate authority, and wish to create a certificate signing request for the server certificate, edit server.cnf as above, and type the following command. $ make server.csr You will have to ensure that the certificate contains the XP extensions needed by Microsoft clients. MAKING A CLIENT CERTIFICATE Client certificates are used by EAP-TLS, and optionally by EAP-TTLS and PEAP. The following steps outline how to create a client certificate that is signed by the server certificate created above. You will have to have the password for the server certificate in the "input_password" and "output_password" fields of the server.cnf file. $ vi client.cnf Edit the "input_password" and "output_password" fields to be the password for the client certificate. You will have to give these passwords to the end user who will be using the certificates. Edit the [client] section to have the correct values for your country, state, etc. Be sure that the commonName field here is the User-Name that will be used for logins! $ make client.pem The users certificate will be in "emailAddress.pem", i.e. "user@example.com.pem". To create another client certificate, just repeat the steps for making a client certificate, being sure to enter a different login name for "commonName", and a different password. PERFORMANCE EAP performance for EAP-TLS, TTLS, and PEAP is dominated by SSL calculations. That is, a normal system can handle PAP authentication at a rate of 10k packets/s. However, SSL involves RSA calculations, which are very expensive. To benchmark your system, do: $ openssl speed rsa or $ openssl speed rsa2048 to test 2048 bit keys. A 1GHz system will likely do 30 calculations/s. A 2Ghz system may do 50 calculations/s, or more. That number is also the number of authentications/s that can be done for EAP-TLS (or TTLS, or PEAP). COMPATIBILITY The certificates created using this method are known to be compatible with ALL operating systems. Some common issues are: - Windows requires certain OID's in the certificates. If it doesn't see them, it will stop doing EAP. The most visibile effect is that the client starts EAP, gets a few Access-Challenge packets, and then a little while later re-starts EAP. If this happens, see the FAQ, and the comments in raddb/eap.conf for how to fix it. - Windows requires the root certificates to be on the client PC. If it doesn't have them, you will see the same issue as above. - Windows XP post SP2 has a bug where it has problems with certificate chains. i.e. if the server certificate is an intermediate one, and not a root one, then authentication will silently fail, as above. - Some versions of Windows CE cannot handle 4K RSA certificates. They will (again) silently fail, as above. - In none of these cases will Windows give the end user any reasonable error message describing what went wrong. This leads people to blame the RADIUS server. That blame is misplaced. - Certificate chains of more than 64K bytes are known to not work. This is a problem in FreeRADIUS. However, most clients cannot handle 64K certificate chains. Most Access Points will shut down the EAP session after about 50 round trips, while 64K certificate chains will take about 60 round trips. So don't use large certificate chains. They will only work after everyone upgrade everything in the network. - All other operating systems are known to work with EAP and FreeRADIUS. This includes Linux, *BSD, Mac OS X, Solaris, Symbian, along with all known embedded systems, phones, WiFi devices, etc. - Someone needs to ask Microsoft to please stop making life hard for their customers. SECURITY CONSIDERATIONS The default certificate configuration files used to use MD5 for message digests, to maintain compatibility with network equipment that supports only this algorithm. They now use SHA1. MD5 has known weaknesses and is discouraged in favor of SHA1 (see http://www.kb.cert.org/vuls/id/836068 for details). If your network equipment requires the MD5 signature algorithm, we recommend that you change the "ca.cnf", "server.cnf", and "client.cnf" files to specify the use of SHA1 for the certificates. To do this, change the 'default_md' entry in those files from 'sha1' to 'md5'. freeradius-server/raddb/certs/bootstrap000077500000000000000000000052051257552170400206640ustar00rootroot00000000000000#!/bin/sh # # This is a wrapper script to create default certificates when the # server first starts in debugging mode. Once the certificates have been # created, this file should be deleted. # # Ideally, this program should be run as part of the installation of any # binary package. The installation should also ensure that the permissions # and owners are correct for the files generated by this script. # # $Id$ # umask 027 cd `dirname $0` make -h > /dev/null 2>&1 # # If we have a working "make", then use it. Otherwise, run the commands # manually. # if [ "$?" = "0" ]; then make all exit $? fi # # The following commands were created by running "make -n", and edited # to remove the trailing backslash, and to add "exit 1" after the commands. # # Don't edit the following text. Instead, edit the Makefile, and # re-generate these commands. # if [ ! -f dh ]; then openssl dhparam -out dh 1024 || exit 1 if [ -e /dev/urandom ] ; then dd if=/dev/urandom of=./random count=10 >/dev/null 2>&1; else date > ./random; fi fi if [ ! -f server.key ]; then openssl req -new -out server.csr -keyout server.key -config ./server.cnf || exit 1 fi if [ ! -f ca.key ]; then openssl req -new -x509 -keyout ca.key -out ca.pem -days `grep default_days ca.cnf | sed 's/.*=//;s/^ *//'` -config ./ca.cnf || exit 1 fi if [ ! -f index.txt ]; then touch index.txt fi if [ ! -f serial ]; then echo '01' > serial fi if [ ! -f server.crt ]; then openssl ca -batch -keyfile ca.key -cert ca.pem -in server.csr -key `grep output_password ca.cnf | sed 's/.*=//;s/^ *//'` -out server.crt -extensions xpserver_ext -extfile xpextensions -config ./server.cnf || exit 1 fi if [ ! -f server.p12 ]; then openssl pkcs12 -export -in server.crt -inkey server.key -out server.p12 -passin pass:`grep output_password server.cnf | sed 's/.*=//;s/^ *//'` -passout pass:`grep output_password server.cnf | sed 's/.*=//;s/^ *//'` || exit 1 fi if [ ! -f server.pem ]; then openssl pkcs12 -in server.p12 -out server.pem -passin pass:`grep output_password server.cnf | sed 's/.*=//;s/^ *//'` -passout pass:`grep output_password server.cnf | sed 's/.*=//;s/^ *//'` || exit 1 openssl verify -CAfile ca.pem server.pem || exit 1 fi if [ ! -f ca.der ]; then openssl x509 -inform PEM -outform DER -in ca.pem -out ca.der || exit 1 fi if [ ! -f client.key ]; then openssl req -new -out client.csr -keyout client.key -config ./client.cnf fi if [ ! -f client.crt ]; then openssl ca -batch -keyfile ca.key -cert ca.pem -in client.csr -key `grep output_password ca.cnf | sed 's/.*=//;s/^ *//'` -out client.crt -extensions xpclient_ext -extfile xpextensions -config ./client.cnf fi freeradius-server/raddb/certs/ca.cnf000066400000000000000000000026201257552170400177720ustar00rootroot00000000000000[ ca ] default_ca = CA_default [ CA_default ] dir = ./ certs = $dir crl_dir = $dir/crl database = $dir/index.txt new_certs_dir = $dir certificate = $dir/ca.pem serial = $dir/serial crl = $dir/crl.pem private_key = $dir/ca.key RANDFILE = $dir/.rand name_opt = ca_default cert_opt = ca_default default_days = 365 default_crl_days = 30 default_md = sha256 preserve = no policy = policy_match crlDistributionPoints = URI:http://www.example.com/example_ca.crl [ policy_match ] countryName = match stateOrProvinceName = match organizationName = match organizationalUnitName = optional commonName = supplied emailAddress = optional [ policy_anything ] countryName = optional stateOrProvinceName = optional localityName = optional organizationName = optional organizationalUnitName = optional commonName = supplied emailAddress = optional [ req ] prompt = no distinguished_name = certificate_authority default_bits = 2048 input_password = whatever output_password = whatever x509_extensions = v3_ca [certificate_authority] countryName = FR stateOrProvinceName = Radius localityName = Somewhere organizationName = Example Inc. emailAddress = admin@example.com commonName = "Example Certificate Authority" [v3_ca] subjectKeyIdentifier = hash authorityKeyIdentifier = keyid:always,issuer:always basicConstraints = CA:true crlDistributionPoints = URI:http://www.example.com/example_ca.crl freeradius-server/raddb/certs/client.cnf000066400000000000000000000021201257552170400206600ustar00rootroot00000000000000[ ca ] default_ca = CA_default [ CA_default ] dir = ./ certs = $dir crl_dir = $dir/crl database = $dir/index.txt new_certs_dir = $dir certificate = $dir/ca.pem serial = $dir/serial crl = $dir/crl.pem private_key = $dir/ca.key RANDFILE = $dir/.rand name_opt = ca_default cert_opt = ca_default default_days = 365 default_crl_days = 30 default_md = sha256 preserve = no policy = policy_match [ policy_match ] countryName = match stateOrProvinceName = match organizationName = match organizationalUnitName = optional commonName = supplied emailAddress = optional [ policy_anything ] countryName = optional stateOrProvinceName = optional localityName = optional organizationName = optional organizationalUnitName = optional commonName = supplied emailAddress = optional [ req ] prompt = no distinguished_name = client default_bits = 2048 input_password = whatever output_password = whatever [client] countryName = FR stateOrProvinceName = Radius localityName = Somewhere organizationName = Example Inc. emailAddress = user@example.com commonName = user@example.com freeradius-server/raddb/certs/demoCA/000077500000000000000000000000001257552170400200475ustar00rootroot00000000000000freeradius-server/raddb/certs/demoCA/cacert.pem000066400000000000000000000025021257552170400220120ustar00rootroot00000000000000-----BEGIN CERTIFICATE----- MIIDtjCCAx+gAwIBAgIBADANBgkqhkiG9w0BAQQFADCBnzELMAkGA1UEBhMCQ0Ex ETAPBgNVBAgTCFByb3ZpbmNlMRIwEAYDVQQHEwlTb21lIENpdHkxFTATBgNVBAoT DE9yZ2FuaXphdGlvbjESMBAGA1UECxMJbG9jYWxob3N0MRswGQYDVQQDExJDbGll bnQgY2VydGlmaWNhdGUxITAfBgkqhkiG9w0BCQEWEmNsaWVudEBleGFtcGxlLmNv bTAeFw0wNDAxMjUxMzI2MDdaFw0wNjAxMjQxMzI2MDdaMIGfMQswCQYDVQQGEwJD QTERMA8GA1UECBMIUHJvdmluY2UxEjAQBgNVBAcTCVNvbWUgQ2l0eTEVMBMGA1UE ChMMT3JnYW5pemF0aW9uMRIwEAYDVQQLEwlsb2NhbGhvc3QxGzAZBgNVBAMTEkNs aWVudCBjZXJ0aWZpY2F0ZTEhMB8GCSqGSIb3DQEJARYSY2xpZW50QGV4YW1wbGUu Y29tMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDUxbGXJPFkrPH/sYnbHI+/ 9PFDlup8sekPeNaUUXJTd4ld/lLMuZtB6A3etYsSepQ/T1jLxWKHgZL73G/s6fhx 58Ew01z1GIgX6bEzJJ7dKhx10xBDrodVPOx6d+8mqn10KB25t34XxkRsXdmxiLQy UMoCKZY3IqEjpyawC0An/QIDAQABo4H/MIH8MB0GA1UdDgQWBBRo020+Hue8nVoF cCHDY9oTZdGt4zCBzAYDVR0jBIHEMIHBgBRo020+Hue8nVoFcCHDY9oTZdGt46GB paSBojCBnzELMAkGA1UEBhMCQ0ExETAPBgNVBAgTCFByb3ZpbmNlMRIwEAYDVQQH EwlTb21lIENpdHkxFTATBgNVBAoTDE9yZ2FuaXphdGlvbjESMBAGA1UECxMJbG9j YWxob3N0MRswGQYDVQQDExJDbGllbnQgY2VydGlmaWNhdGUxITAfBgkqhkiG9w0B CQEWEmNsaWVudEBleGFtcGxlLmNvbYIBADAMBgNVHRMEBTADAQH/MA0GCSqGSIb3 DQEBBAUAA4GBADPAC2ax5Xnvc6BnmCUtq41eVRH8AP0nbYDRL4NHd8Z0P9wnQ/yh UHcE5LwJeeT2CsOtnug+bzRzaSKdH3cim6LpgjWdpWMCSgAWPbptbJhsC60or4UT L/jw12UBvxt8Lf9ljOHmLAGZe25k4+jUNzNUzpkShHZRU5BjuFu8VIXF -----END CERTIFICATE----- freeradius-server/raddb/certs/server.cnf000066400000000000000000000021361257552170400207170ustar00rootroot00000000000000[ ca ] default_ca = CA_default [ CA_default ] dir = ./ certs = $dir crl_dir = $dir/crl database = $dir/index.txt new_certs_dir = $dir certificate = $dir/ca.pem serial = $dir/serial crl = $dir/crl.pem private_key = $dir/ca.key RANDFILE = $dir/.rand name_opt = ca_default cert_opt = ca_default default_days = 365 default_crl_days = 30 default_md = sha256 preserve = no policy = policy_match [ policy_match ] countryName = match stateOrProvinceName = match organizationName = match organizationalUnitName = optional commonName = supplied emailAddress = optional [ policy_anything ] countryName = optional stateOrProvinceName = optional localityName = optional organizationName = optional organizationalUnitName = optional commonName = supplied emailAddress = optional [ req ] prompt = no distinguished_name = server default_bits = 2048 input_password = whatever output_password = whatever [server] countryName = FR stateOrProvinceName = Radius localityName = Somewhere organizationName = Example Inc. emailAddress = admin@example.com commonName = "Example Server Certificate" freeradius-server/raddb/certs/xpextensions000066400000000000000000000013061257552170400214110ustar00rootroot00000000000000# # File containing the OID's required for Windows. # # http://support.microsoft.com/kb/814394/en-us # [ xpclient_ext] extendedKeyUsage = 1.3.6.1.5.5.7.3.2 crlDistributionPoints = URI:http://www.example.com/example_ca.crl [ xpserver_ext] extendedKeyUsage = 1.3.6.1.5.5.7.3.1 crlDistributionPoints = URI:http://www.example.com/example_ca.crl # # Add this to the PKCS#7 keybag attributes holding the client's private key # for machine authentication. # # the presence of this OID tells Windows XP that the cert is intended # for use by the computer itself, and not by an end-user. # # The other solution is to use Microsoft's web certificate server # to generate these certs. # # 1.3.6.1.4.1.311.17.2 freeradius-server/raddb/clients.conf000066400000000000000000000150721257552170400201140ustar00rootroot00000000000000# -*- text -*- ## ## clients.conf -- client configuration directives ## ## $Id$ ####################################################################### # # Define RADIUS clients (usually a NAS, Access Point, etc.). # # Defines a RADIUS client. # # '127.0.0.1' is another name for 'localhost'. It is enabled by default, # to allow testing of the server after an initial installation. If you # are not going to be permitting RADIUS queries from localhost, we suggest # that you delete, or comment out, this entry. # # # # Each client has a "short name" that is used to distinguish it from # other clients. # # In version 1.x, the string after the word "client" was the IP # address of the client. In 2.0, the IP address is configured via # the "ipaddr" or "ipv6addr" fields. For compatibility, the 1.x # format is still accepted. # client localhost { # Allowed values are: # dotted quad (1.2.3.4) # hostname (radius.example.com) ipaddr = 127.0.0.1 # OR, you can use an IPv6 address, but not both # at the same time. # ipv6addr = :: # any. ::1 == localhost # # A note on DNS: We STRONGLY recommend using IP addresses # rather than host names. Using host names means that the # server will do DNS lookups when it starts, making it # dependent on DNS. i.e. If anything goes wrong with DNS, # the server won't start! # # The server also looks up the IP address from DNS once, and # only once, when it starts. If the DNS record is later # updated, the server WILL NOT see that update. # # One client definition can be applied to an entire network. # e.g. 127/8 should be defined with "ipaddr = 127.0.0.0" and # "netmask = 8" # # If not specified, the default netmask is 32 (i.e. /32) # # We do NOT recommend using anything other than 32. There # are usually other, better ways to achieve the same goal. # Using netmasks of other than 32 can cause security issues. # # You can specify overlapping networks (127/8 and 127.0/16) # In that case, the smallest possible network will be used # as the "best match" for the client. # # Clients can also be defined dynamically at run time, based # on any criteria. e.g. SQL lookups, keying off of NAS-Identifier, # etc. # See raddb/sites-available/dynamic-clients for details. # # netmask = 32 # # The shared secret use to "encrypt" and "sign" packets between # the NAS and FreeRADIUS. You MUST change this secret from the # default, otherwise it's not a secret any more! # # The secret can be any string, up to 8k characters in length. # # Control codes can be entered vi octal encoding, # e.g. "\101\102" == "AB" # Quotation marks can be entered by escaping them, # e.g. "foo\"bar" # # A note on security: The security of the RADIUS protocol # depends COMPLETELY on this secret! We recommend using a # shared secret that is composed of: # # upper case letters # lower case letters # numbers # # And is at LEAST 8 characters long, preferably 16 characters in # length. The secret MUST be random, and should not be words, # phrase, or anything else that is recognizable. # # The default secret below is only for testing, and should # not be used in any real environment. # secret = testing123 # # Old-style clients do not send a Message-Authenticator # in an Access-Request. RFC 5080 suggests that all clients # SHOULD include it in an Access-Request. The configuration # item below allows the server to require it. If a client # is required to include a Message-Authenticator and it does # not, then the packet will be silently discarded. # # allowed values: yes, no require_message_authenticator = no # # The short name is used as an alias for the fully qualified # domain name, or the IP address. # # It is accepted for compatibility with 1.x, but it is no # longer necessary in 2.0 # # shortname = localhost # # the following three fields are optional, but may be used by # checkrad.pl for simultaneous use checks # # # The nastype tells 'checkrad.pl' which NAS-specific method to # use to query the NAS for simultaneous use. # # Permitted NAS types are: # # cisco # computone # livingston # juniper # max40xx # multitech # netserver # pathras # patton # portslave # tc # usrhiper # other # for all other types # nastype = other # localhost isn't usually a NAS... # # The following two configurations are for future use. # The 'naspasswd' file is currently used to store the NAS # login name and password, which is used by checkrad.pl # when querying the NAS for simultaneous use. # # login = !root # password = someadminpas # # As of 2.0, clients can also be tied to a virtual server. # This is done by setting the "virtual_server" configuration # item, as in the example below. # # virtual_server = home1 # # A pointer to the "home_server_pool" OR a "home_server" # section that contains the CoA configuration for this # client. For an example of a coa home server or pool, # see raddb/sites-available/originate-coa # coa_server = coa } # IPv6 Client #client ::1 { # secret = testing123 # shortname = localhost #} # # All IPv6 Site-local clients #client fe80::/16 { # secret = testing123 # shortname = localhost #} #client some.host.org { # secret = testing123 # shortname = localhost #} # # You can now specify one secret for a network of clients. # When a client request comes in, the BEST match is chosen. # i.e. The entry from the smallest possible network. # #client 192.168.0.0/24 { # secret = testing123-1 # shortname = private-network-1 #} # #client 192.168.0.0/16 { # secret = testing123-2 # shortname = private-network-2 #} #client 10.10.10.10 { # # secret and password are mapped through the "secrets" file. # secret = testing123 # shortname = liv1 # # the following three fields are optional, but may be used by # # checkrad.pl for simultaneous usage checks # nastype = livingston # login = !root # password = someadminpas #} ####################################################################### # # Per-socket client lists. The configuration entries are exactly # the same as above, but they are nested inside of a section. # # You can have as many per-socket client lists as you have "listen" # sections, or you can re-use a list among multiple "listen" sections. # # Un-comment this section, and edit a "listen" section to add: # "clients = per_socket_clients". That IP address/port combination # will then accept ONLY the clients listed in this section. # #clients per_socket_clients { # client 192.168.3.4 { # secret = testing123 # } #} freeradius-server/raddb/debug.conf000066400000000000000000000004461257552170400175400ustar00rootroot00000000000000# # Minimal configuration file used when debugging the source code. # # This file should not be installed by "make install", or by any # packaging system. It is only for developers. # dictionary = ${confdir}/../share libdir = ${confdir}/../src/modules/lib $INCLUDE ${confdir}/radiusd.conf freeradius-server/raddb/dictionary.in000066400000000000000000000015611257552170400202770ustar00rootroot00000000000000# # This is the master dictionary file, which references the # pre-defined dictionary files included with the server. # # Any new/changed attributes MUST be placed in this file, as # the pre-defined dictionaries SHOULD NOT be edited. # # $Id$ # # # The filename given here should be an absolute path. # $INCLUDE @prefix@/share/freeradius/dictionary # # Place additional attributes or $INCLUDEs here. They will # over-ride the definitions in the pre-defined dictionaries. # # See the 'man' page for 'dictionary' for information on # the format of the dictionary files. # # If you want to add entries to the dictionary file, # which are NOT going to be placed in a RADIUS packet, # add them here. The numbers you pick should be between # 3000 and 4000. # #ATTRIBUTE My-Local-String 3000 string #ATTRIBUTE My-Local-IPAddr 3001 ipaddr #ATTRIBUTE My-Local-Integer 3002 integer freeradius-server/raddb/eap.conf000066400000000000000000000540731257552170400172240ustar00rootroot00000000000000# -*- text -*- ## ## eap.conf -- Configuration for EAP types (PEAP, TTLS, etc.) ## ## $Id$ ####################################################################### # # Whatever you do, do NOT set 'Auth-Type := EAP'. The server # is smart enough to figure this out on its own. The most # common side effect of setting 'Auth-Type := EAP' is that the # users then cannot use ANY other authentication method. # # EAP types NOT listed here may be supported via the "eap2" module. # See experimental.conf for documentation. # eap { # Invoke the default supported EAP type when # EAP-Identity response is received. # # The incoming EAP messages DO NOT specify which EAP # type they will be using, so it MUST be set here. # # For now, only one default EAP type may be used at a time. # # If the EAP-Type attribute is set by another module, # then that EAP type takes precedence over the # default type configured here. # default_eap_type = md5 # A list is maintained to correlate EAP-Response # packets with EAP-Request packets. After a # configurable length of time, entries in the list # expire, and are deleted. # timer_expire = 60 # There are many EAP types, but the server has support # for only a limited subset. If the server receives # a request for an EAP type it does not support, then # it normally rejects the request. By setting this # configuration to "yes", you can tell the server to # instead keep processing the request. Another module # MUST then be configured to proxy the request to # another RADIUS server which supports that EAP type. # # If another module is NOT configured to handle the # request, then the request will still end up being # rejected. ignore_unknown_eap_types = no # Cisco AP1230B firmware 12.2(13)JA1 has a bug. When given # a User-Name attribute in an Access-Accept, it copies one # more byte than it should. # # We can work around it by configurably adding an extra # zero byte. cisco_accounting_username_bug = no # # Help prevent DoS attacks by limiting the number of # sessions that the server is tracking. For simplicity, # this is taken from the "max_requests" directive in # radiusd.conf. max_sessions = ${max_requests} # Supported EAP-types # # We do NOT recommend using EAP-MD5 authentication # for wireless connections. It is insecure, and does # not provide for dynamic WEP keys. # md5 { } # Cisco LEAP # # We do not recommend using LEAP in new deployments. See: # http://www.securiteam.com/tools/5TP012ACKE.html # # Cisco LEAP uses the MS-CHAP algorithm (but not # the MS-CHAP attributes) to perform it's authentication. # # As a result, LEAP *requires* access to the plain-text # User-Password, or the NT-Password attributes. # 'System' authentication is impossible with LEAP. # leap { } # Generic Token Card. # # Currently, this is only permitted inside of EAP-TTLS, # or EAP-PEAP. The module "challenges" the user with # text, and the response from the user is taken to be # the User-Password. # # Proxying the tunneled EAP-GTC session is a bad idea, # the users password will go over the wire in plain-text, # for anyone to see. # gtc { # The default challenge, which many clients # ignore.. #challenge = "Password: " # The plain-text response which comes back # is put into a User-Password attribute, # and passed to another module for # authentication. This allows the EAP-GTC # response to be checked against plain-text, # or crypt'd passwords. # # If you say "Local" instead of "PAP", then # the module will look for a User-Password # configured for the request, and do the # authentication itself. # auth_type = PAP } ## EAP-TLS # # See raddb/certs/README for additional comments # on certificates. # # If OpenSSL was not found at the time the server was # built, the "tls", "ttls", and "peap" sections will # be ignored. # # Otherwise, when the server first starts in debugging # mode, test certificates will be created. See the # "make_cert_command" below for details, and the README # file in raddb/certs # # These test certificates SHOULD NOT be used in a normal # deployment. They are created only to make it easier # to install the server, and to perform some simple # tests with EAP-TLS, TTLS, or PEAP. # # See also: # # http://www.dslreports.com/forum/remark,9286052~mode=flat # # Note that you should NOT use a globally known CA here! # e.g. using a Verisign cert as a "known CA" means that # ANYONE who has a certificate signed by them can # authenticate via EAP-TLS! This is likely not what you want. tls { # # These is used to simplify later configurations. # certdir = ${confdir}/certs cadir = ${confdir}/certs private_key_password = whatever private_key_file = ${certdir}/server.pem # If Private key & Certificate are located in # the same file, then private_key_file & # certificate_file must contain the same file # name. # # If CA_file (below) is not used, then the # certificate_file below MUST include not # only the server certificate, but ALSO all # of the CA certificates used to sign the # server certificate. certificate_file = ${certdir}/server.pem # Trusted Root CA list # # ALL of the CA's in this list will be trusted # to issue client certificates for authentication. # # In general, you should use self-signed # certificates for 802.1x (EAP) authentication. # In that case, this CA file should contain # *one* CA certificate. # # This parameter is used only for EAP-TLS, # when you issue client certificates. If you do # not use client certificates, and you do not want # to permit EAP-TLS authentication, then delete # this configuration item. CA_file = ${cadir}/ca.pem # # For DH cipher suites to work, you have to # run OpenSSL to create the DH file first: # # openssl dhparam -out certs/dh 1024 # dh_file = ${certdir}/dh # # If your system doesn't have /dev/urandom, # you will need to create this file, and # periodically change its contents. # # For security reasons, FreeRADIUS doesn't # write to files in its configuration # directory. # # random_file = ${certdir}/random # # This can never exceed the size of a RADIUS # packet (4096 bytes), and is preferably half # that, to accomodate other attributes in # RADIUS packet. On most APs the MAX packet # length is configured between 1500 - 1600 # In these cases, fragment size should be # 1024 or less. # # fragment_size = 1024 # include_length is a flag which is # by default set to yes If set to # yes, Total Length of the message is # included in EVERY packet we send. # If set to no, Total Length of the # message is included ONLY in the # First packet of a fragment series. # # include_length = yes # Check the Certificate Revocation List # # 1) Copy CA certificates and CRLs to same directory. # 2) Execute 'c_rehash '. # 'c_rehash' is OpenSSL's command. # 3) uncomment the lines below. # 5) Restart radiusd # check_crl = yes # Check if intermediate CAs have been revoked. # check_all_crl = yes CA_path = ${cadir} # # If check_cert_issuer is set, the value will # be checked against the DN of the issuer in # the client certificate. If the values do not # match, the cerficate verification will fail, # rejecting the user. # # In 2.1.10 and later, this check can be done # more generally by checking the value of the # TLS-Client-Cert-Issuer attribute. This check # can be done via any mechanism you choose. # # check_cert_issuer = "/C=GB/ST=Berkshire/L=Newbury/O=My Company Ltd" # # If check_cert_cn is set, the value will # be xlat'ed and checked against the CN # in the client certificate. If the values # do not match, the certificate verification # will fail rejecting the user. # # This check is done only if the previous # "check_cert_issuer" is not set, or if # the check succeeds. # # In 2.1.10 and later, this check can be done # more generally by checking the value of the # TLS-Client-Cert-CN attribute. This check # can be done via any mechanism you choose. # # check_cert_cn = %{User-Name} # # Set this option to specify the allowed # TLS cipher suites. The format is listed # in "man 1 ciphers". cipher_list = "DEFAULT" # # As part of checking a client certificate, the EAP-TLS # sets some attributes such as TLS-Client-Cert-CN. This # virtual server has access to these attributes, and can # be used to accept or reject the request. # # virtual_server = check-eap-tls # This command creates the initial "snake oil" # certificates when the server is run as root, # and via "radiusd -X". # # As of 2.1.11, it *also* checks the server # certificate for validity, including expiration. # This means that radiusd will refuse to start # when the certificate has expired. The alternative # is to have the 802.1X clients refuse to connect # when they discover the certificate has expired. # # Debugging client issues is hard, so it's better # for the server to print out an error message, # and refuse to start. # make_cert_command = "${certdir}/bootstrap" # # Elliptical cryptography configuration # # Only for OpenSSL >= 0.9.8.f # ecdh_curve = "prime256v1" # # Session resumption / fast reauthentication # cache. # # The cache contains the following information: # # session Id - unique identifier, managed by SSL # User-Name - from the Access-Accept # Stripped-User-Name - from the Access-Request # Cached-Session-Policy - from the Access-Accept # # The "Cached-Session-Policy" is the name of a # policy which should be applied to the cached # session. This policy can be used to assign # VLANs, IP addresses, etc. It serves as a useful # way to re-apply the policy from the original # Access-Accept to the subsequent Access-Accept # for the cached session. # # On session resumption, these attributes are # copied from the cache, and placed into the # reply list. # # You probably also want "use_tunneled_reply = yes" # when using fast session resumption. # cache { # # Enable it. The default is "no". # Deleting the entire "cache" subsection # Also disables caching. # # You can disallow resumption for a # particular user by adding the following # attribute to the control item list: # # Allow-Session-Resumption = No # # If "enable = no" below, you CANNOT # enable resumption for just one user # by setting the above attribute to "yes". # enable = no # # Lifetime of the cached entries, in hours. # The sessions will be deleted after this # time. # lifetime = 24 # hours # # The maximum number of entries in the # cache. Set to "0" for "infinite". # # This could be set to the number of users # who are logged in... which can be a LOT. # max_entries = 255 } # # As of version 2.1.10, client certificates can be # validated via an external command. This allows # dynamic CRLs or OCSP to be used. # # This configuration is commented out in the # default configuration. Uncomment it, and configure # the correct paths below to enable it. # verify { # A temporary directory where the client # certificates are stored. This directory # MUST be owned by the UID of the server, # and MUST not be accessible by any other # users. When the server starts, it will do # "chmod go-rwx" on the directory, for # security reasons. The directory MUST # exist when the server starts. # # You should also delete all of the files # in the directory when the server starts. # tmpdir = /tmp/radiusd # The command used to verify the client cert. # We recommend using the OpenSSL command-line # tool. # # The ${..CA_path} text is a reference to # the CA_path variable defined above. # # The %{TLS-Client-Cert-Filename} is the name # of the temporary file containing the cert # in PEM format. This file is automatically # deleted by the server when the command # returns. # client = "/path/to/openssl verify -CApath ${..CA_path} %{TLS-Client-Cert-Filename}" } # # OCSP Configuration # Certificates can be verified against an OCSP # Responder. This makes it possible to immediately # revoke certificates without the distribution of # new Certificate Revokation Lists (CRLs). # ocsp { # # Enable it. The default is "no". # Deleting the entire "ocsp" subsection # Also disables ocsp checking # enable = no # # The OCSP Responder URL can be automatically # extracted from the certificate in question. # To override the OCSP Responder URL set # "override_cert_url = yes". # override_cert_url = yes # # If the OCSP Responder address is not # extracted from the certificate, the # URL can be defined here. # # Limitation: Currently the HTTP # Request is not sending the "Host: " # information to the web-server. This # can be a problem if the OCSP # Responder is running as a vhost. # url = "http://127.0.0.1/ocsp/" # # If the OCSP Responder can not cope with nonce # in the request, then it can be disabled here. # # For security reasons, disabling this option # is not recommended as nonce protects against # replay attacks. # # Note that Microsoft AD Certificate Services OCSP # Responder does not enable nonce by default. It is # more secure to enable nonce on the responder than # to disable it in the query here. # See http://technet.microsoft.com/en-us/library/cc770413%28WS.10%29.aspx # # use_nonce = yes # # Number of seconds before giving up waiting # for OCSP response. 0 uses system default. # # timeout = 0 # # Normally an error in querying the OCSP # responder (no response from server, server did # not understand the request, etc) will result in # a validation failure. # # To treat these errors as 'soft' failures and # still accept the certificate, enable this # option. # # Warning: this may enable clients with revoked # certificates to connect if the OCSP responder # is not available. Use with caution. # # softfail = no } } # The TTLS module implements the EAP-TTLS protocol, # which can be described as EAP inside of Diameter, # inside of TLS, inside of EAP, inside of RADIUS... # # Surprisingly, it works quite well. # # The TTLS module needs the TLS module to be installed # and configured, in order to use the TLS tunnel # inside of the EAP packet. You will still need to # configure the TLS module, even if you do not want # to deploy EAP-TLS in your network. Users will not # be able to request EAP-TLS, as it requires them to # have a client certificate. EAP-TTLS does not # require a client certificate. # # You can make TTLS require a client cert by setting # # EAP-TLS-Require-Client-Cert = Yes # # in the control items for a request. # ttls { # The tunneled EAP session needs a default # EAP type which is separate from the one for # the non-tunneled EAP module. Inside of the # TTLS tunnel, we recommend using EAP-MD5. # If the request does not contain an EAP # conversation, then this configuration entry # is ignored. default_eap_type = md5 # The tunneled authentication request does # not usually contain useful attributes # like 'Calling-Station-Id', etc. These # attributes are outside of the tunnel, # and normally unavailable to the tunneled # authentication request. # # By setting this configuration entry to # 'yes', any attribute which NOT in the # tunneled authentication request, but # which IS available outside of the tunnel, # is copied to the tunneled request. # # allowed values: {no, yes} copy_request_to_tunnel = no # The reply attributes sent to the NAS are # usually based on the name of the user # 'outside' of the tunnel (usually # 'anonymous'). If you want to send the # reply attributes based on the user name # inside of the tunnel, then set this # configuration entry to 'yes', and the reply # to the NAS will be taken from the reply to # the tunneled request. # # allowed values: {no, yes} use_tunneled_reply = no # # The inner tunneled request can be sent # through a virtual server constructed # specifically for this purpose. # # If this entry is commented out, the inner # tunneled request will be sent through # the virtual server that processed the # outer requests. # virtual_server = "inner-tunnel" # This has the same meaning as the # same field in the "tls" module, above. # The default value here is "yes". # include_length = yes } ################################################## # # !!!!! WARNINGS for Windows compatibility !!!!! # ################################################## # # If you see the server send an Access-Challenge, # and the client never sends another Access-Request, # then # # STOP! # # The server certificate has to have special OID's # in it, or else the Microsoft clients will silently # fail. See the "scripts/xpextensions" file for # details, and the following page: # # http://support.microsoft.com/kb/814394/en-us # # For additional Windows XP SP2 issues, see: # # http://support.microsoft.com/kb/885453/en-us # # # If is still doesn't work, and you're using Samba, # you may be encountering a Samba bug. See: # # https://bugzilla.samba.org/show_bug.cgi?id=6563 # # Note that we do not necessarily agree with their # explanation... but the fix does appear to work. # ################################################## # # The tunneled EAP session needs a default EAP type # which is separate from the one for the non-tunneled # EAP module. Inside of the TLS/PEAP tunnel, we # recommend using EAP-MS-CHAPv2. # # The PEAP module needs the TLS module to be installed # and configured, in order to use the TLS tunnel # inside of the EAP packet. You will still need to # configure the TLS module, even if you do not want # to deploy EAP-TLS in your network. Users will not # be able to request EAP-TLS, as it requires them to # have a client certificate. EAP-PEAP does not # require a client certificate. # # # You can make PEAP require a client cert by setting # # EAP-TLS-Require-Client-Cert = Yes # # in the control items for a request. # peap { # The tunneled EAP session needs a default # EAP type which is separate from the one for # the non-tunneled EAP module. Inside of the # PEAP tunnel, we recommend using MS-CHAPv2, # as that is the default type supported by # Windows clients. default_eap_type = mschapv2 # the PEAP module also has these configuration # items, which are the same as for TTLS. copy_request_to_tunnel = no use_tunneled_reply = no # When the tunneled session is proxied, the # home server may not understand EAP-MSCHAP-V2. # Set this entry to "no" to proxy the tunneled # EAP-MSCHAP-V2 as normal MSCHAPv2. # proxy_tunneled_request_as_eap = yes # # The inner tunneled request can be sent # through a virtual server constructed # specifically for this purpose. # # If this entry is commented out, the inner # tunneled request will be sent through # the virtual server that processed the # outer requests. # virtual_server = "inner-tunnel" # This option enables support for MS-SoH # see doc/SoH.txt for more info. # It is disabled by default. # # soh = yes # # The SoH reply will be turned into a request which # can be sent to a specific virtual server: # # soh_virtual_server = "soh-server" } # # This takes no configuration. # # Note that it is the EAP MS-CHAPv2 sub-module, not # the main 'mschap' module. # # Note also that in order for this sub-module to work, # the main 'mschap' module MUST ALSO be configured. # # This module is the *Microsoft* implementation of MS-CHAPv2 # in EAP. There is another (incompatible) implementation # of MS-CHAPv2 in EAP by Cisco, which FreeRADIUS does not # currently support. # mschapv2 { # Prior to version 2.1.11, the module never # sent the MS-CHAP-Error message to the # client. This worked, but it had issues # when the cached password was wrong. The # server *should* send "E=691 R=0" to the # client, which tells it to prompt the user # for a new password. # # The default is to behave as in 2.1.10 and # earlier, which is known to work. If you # set "send_error = yes", then the error # message will be sent back to the client. # This *may* help some clients work better, # but *may* also cause other clients to stop # working. # # send_error = no } } freeradius-server/raddb/experimental.conf000066400000000000000000000312251257552170400211460ustar00rootroot00000000000000# # This file contains the configuration for experimental modules. # # By default, it is NOT included in the build. # # $Id$ # # Configuration for the Python module. # # Where radiusd is a Python module, radiusd.py, and the # function 'authorize' is called. Here is a dummy piece # of code: # # def authorize(params): # print params # return (5, ('Reply-Message', 'banned')) # # The RADIUS value-pairs are passed as a tuple of tuple # pairs as the first argument, e.g. (('attribute1', # 'value1'), ('attribute2', 'value2')) # # The function return is a tuple with the first element # being the return value of the function. # The 5 corresponds to RLM_MODULE_USERLOCK. I plan to # write the return values as Python symbols to avoid # confusion. # # The remaining tuple members are the string form of # value-pairs which are passed on to pairmake(). # python { mod_instantiate = radiusd_test func_instantiate = instantiate mod_authorize = radiusd_test func_authorize = authorize mod_accounting = radiusd_test func_accounting = accounting mod_pre_proxy = radiusd_test func_pre_proxy = pre_proxy mod_post_proxy = radiusd_test func_post_proxy = post_proxy mod_post_auth = radiusd_test func_post_auth = post_auth mod_recv_coa = radiusd_test func_recv_coa = recv_coa mod_send_coa = radiusd_test func_send_coa = send_coa mod_detach = radiusd_test func_detach = detach } # Configuration for the example module. Uncommenting it will cause it # to get loaded and initialized, but should have no real effect as long # it is not referencened in one of the autz/auth/preacct/acct sections example { # Boolean variable. # allowed values: {no, yes} boolean = yes # An integer, of any value. integer = 16 # A string. string = "This is an example configuration string" # An IP address, either in dotted quad (1.2.3.4) or hostname # (example.com) ipaddr = 127.0.0.1 # A subsection mysubsection { anotherinteger = 1000 # They nest deeply nested { string = "This is a different string" } } } # # To create a dbm users file, do: # # cat test.users | rlm_dbm_parser -f /etc/raddb/users_db # # Then add 'dbm' in 'authorize' section. # # Note that even if the file has a ".db" or ".dbm" extension, # you may have to specify it here without that extension. This # is because the DBM libraries "helpfully" add a ".db" to the # filename, but don't check if it's already there. # dbm { usersfile = ${confdir}/users_db } # # Perform NT-Domain authentication. This only works # with PAP authentication. That is, Authentication-Request # packets containing a User-Password attribute. # # To use it, add 'smb' into the 'authenticate' section, # and then in another module (usually the 'users' file), # set 'Auth-Type := SMB' # # WARNING: this module is not only experimental, it's also # a security threat. It's not recommended to use it until # it gets fixed. # smb { server = ntdomain.server.example.com backup = backup.server.example.com domain = NTDOMAIN } # See doc/rlm_fastusers before using this # module or changing these values. # fastusers { usersfile = ${confdir}/users_fast hashsize = 1000 compat = no # Reload the hash every 600 seconds (10mins) hash_reload = 600 } # Caching module # # Should be added in the post-auth section (after all other modules) # and in the authorize section (before any other modules) # # authorize { # caching { # ok = return # } # [... other modules ...] # } # post-auth { # [... other modules ...] # caching # } # # The caching module will cache the Auth-Type and reply items # and send them back on any subsequent requests for the same key # # Configuration: # # filename: The gdbm file to use for the cache database # (can be memory mapped for more speed) # # key: A string to xlat and use as a key. For instance, # "%{Acct-Unique-Session-Id}" # # post-auth: If we find a cached entry, set the post-auth to that value # # cache-ttl: The time to cache the entry. The same time format # as the counter module apply here. # num[hdwm] where: # h: hours, d: days, w: weeks, m: months # If the letter is ommited days will be assumed. # e.g. 1d == one day # # cache-size: The gdbm cache size to request (default 1000) # # hit-ratio: If set to non-zero we print out statistical # information after so many cache requests # # cache-rejects: Do we also cache rejects, or not? (default 'yes') # caching { filename = ${db_dir}/db.cache cache-ttl = 1d hit-ratio = 1000 key = "%{Acct-Unique-Session-Id}" #post-auth = "" # cache-size = 2000 # cache-rejects = yes } # Simple module for logging of Account packets to radiusd.log # You need to declare it in the accounting section for it to work acctlog { acctlog_update = "" acctlog_start = "Connect: [%{User-Name}] (did %{Called-Station-Id} cli %{Calling-Station-Id} port %{NAS-Port} ip %{Framed-IP-Address})" acctlog_stop = "Disconnect: [%{User-Name}] (did %{Called-Station-Id} cli %{Calling-Station-Id} port %{NAS-Port} ip %{Framed-IP-Address}) %{Acct-Session-Time} seconds" acctlog_on = "NAS %C (%{NAS-IP-Address}) just came online" acctlog_off = "NAS %C (%{NAS-IP-Address}) just went offline" } # Another implementation of the EAP module. # # This module requires the libeap.so file from the hostap # software (http://hostap.epitest.fi/hostapd/). It has been # tested on the development version of hostapd (0.6.1) ONLY. # # In order to use it, you MUST build a "libeap.so" in hostapd, # which is not done by default. # # You MUST also edit the file: src/modules/rlm_eap2/Makefile # to point to the location of the hostap include files. # # This module CANNOT be used in the same way as the current # FreeRADIUS "eap" module. There is NO way to look inside of # a tunneled request. There is NO way to proxy a tunneled # request. There is NO way to even look at the user name inside # of the tunneled request. There is NO way to control the # choice of EAP types inside of the tunnel. You MUST force # the server to choose "eap2" for authentication, because this # module has no "authorize" section. # # If you want to use this module for experimentation, please # post your comments to the freeradius-devel list: # # http://lists.freeradius.org/mailman/listinfo/freeradius-devel # # If you want to use this module in a production (i.e. real-world) # environment: # # !!! DO NOT USE IT IN A PRODUCTION ENVIRONMENT !!! # # The module needs additional work to make it ready for # production use.. Please supply patches, or sponsor the # work by hiring a developer. Do NOT ask when the work will # be done, because there is no plan to finish this module # unless there is demand for it. # eap2 { # EAP types are chosen in the order that they are # listed in this section. There is no "default_eap_type" # as with rlm_eap. Instead, the *first* EAP type is # used as the default type. # peap { } ttls { } # This is the ONLY EAP type that has any configuration. # All other EAP types have no configuration. # tls { ca_cert = ${confdir}/certs/ca.pem server_cert = ${confdir}/certs/server.pem private_key_file = ${confdir}/certs/server.pem private_key_password = whatever } # # These next two methods do not supply keying material. # md5 { } mschapv2 { } fast { pac_opaque_encr_key = 000102030405060708090a0b0c0d0e0f eap_fast_a_id = xxxxxx eap_fast_a_id_info = my_server eap_fast_prov = 3 pac_key_lifetime = 604800 # 7 days pac_key_refresh_tim = 86400 } # LEAP is NOT supported by this module. # Use the "eap" module instead. # For other methods that MIGHT work, see the # configuration of hostap. The methods are statically # linked in at compile time, and cannot be controlled # here. } # Configuration for experimental EAP types. The sub-sections # can be copied into eap.conf. eap { ikev2 { # Server auth type # Allowed values are: # cert - for certificate based server authentication, # other required settings for this type are # 'private_key_file' and 'certificate_file' # secret - for shared secret based server authentication, # other required settings for this type is 'id' # Default value of this option is 'secret' # server_authtype=cert # Allowed default client auth types # Allowed values are: # secret - for shared secret based client authentication # cert - for certificate based client authentication # both - shared secret and certificate is allowed # none - authentication will always fail # Default value for this option is 'both'. This option could # be overwritten within 'usersfile' file by EAP-IKEv2-Auth # option. # default_authtype = both # path to trusted CA certificate file CA_file="/path/to/CA/cacert.pem" # path to CRL file, if not set, then there will be no # checks against CRL # crl_file="/path/to/crl.pem" # path to file with user settings # # Note that this file is read ONLY on module initialization! # # default ${confdir}/eap_ikev2_users # usersfile=${confdir}/eap_ikev2_users # # Sample "eap_ikev2_users" file entry: # #username EAP-IKEv2-IDType := KEY_ID, EAP-IKEv2-Secret := "tajne" ## where: ## username - client user name from IKE-AUTH (IDr) or CommonName ## from x509 certificate ## EAP-IKEv2-IDType - ID Type - same as in expected IDType payload ## allowable attributes for EAP-IKEv2-IDType: ## IPV4_ADDR FQDN RFC822_ADDR IPV6_ADDR DER_ASN1_DN ## DER_ASN1_GN KEY_ID ## EAP-IKEv2-Secret - shared secret ## EAP-IKEv2-AuthType - optional parameter which defines expected client auth ## type. Allowed values are: secret,cert,both,none. ## For the meaning of this values, please see the ## description of 'default_authtype'. ## This attribute can overwrite 'default_authtype' value. # path to file with server private key private_key_file="/path/to/srv-private-key.pem" # password to private key file private_key_password="passwd" # path to file with server certificate certificate_file="/path/to/srv-cert.pem" # server identity string id="deMaio" # Server identity type. Allowed values are: # IPV4_ADDR, FQDN, RFC822_ADDR, IPV6_ADDR, ASN1_DN, ASN1_GN, # KEY_ID # Default value is: KEY_ID # id_type = KEY_ID # MTU (default: 1398) # fragment_size = 1398 # maximal allowed number of resends SA_INIT after receiving # 'invalid KEY' notification (default 3) # DH_counter_max = 3 # option which is used to control whenever send CERT REQ # payload or not. # Allowed values for this option are "yes" or "no". #Default value is "no". # certreq = "yes" # option which cotrols fast reconnect capability. # Allowed valuse for this option are "yes" or "no". # Default value is "yes". # enable_fast_reauth = "no" # option which is used to control performing of DH exchange # during fast rekeying protocol run. # Allowed values for this option are "yes" or "no". # Default value is "no" # fast_DH_exchange = "yes" # Option which is used to set up expiration time of inactive # IKEv2 session. # After selected period of time (in seconds), inactive # session data will be deleted. # Default value of this option is set to 900 seconds # fast_timer_expire = 900 # list of server proposals of available cryptographic # suites proposals { # proposal number #1 proposal { # Supported transforms types: encryption, # prf, integrity, dhgroup. For multiple # transforms just simple repeat key (i.e. # integity). # encryption algorithm # supported algorithms: # null,3des,aes_128_cbc,aes_192_cbc, # aes_256_cbc,idea # blowfish:n, where n range from 8 to 448 bits, # step 8 bits # cast:n, where n range from 40 to 128 bits, # step 8 bits encryption = 3des # pseudo random function. Supported prf's: # hmac_md5, hmac_sha1, hmac_tiger prf = hmac_sha1 # integrity algorithm. Supported algorithms: # hmac_md5_96, hmac_sha1_96,des_mac integrity = hmac_sha1_96 integrity = hmac_md5_96 # Diffie-Hellman groups: # modp768, modp1024, modp1536, modp2048, # modp3072, modp4096, modp6144, modp8192 dhgroup = modp2048 } # proposal number #2 proposal { encryption = 3des prf = hmac_md5 integrity = hmac_md5_96 dhgroup = modp1024 } # proposal number #3 proposal { encryption=3des prf=hmac_md5 integrity=hmac_md5_96 dhgroup=modp2048 } } } } freeradius-server/raddb/hints000066400000000000000000000044601257552170400166530ustar00rootroot00000000000000# hints # # The hints file. This file is used to match # a request, and then add attributes to it. This # process allows a user to login as "bob.ppp" (for example), # and receive a PPP connection, even if the NAS doesn't # ask for PPP. The "hints" file is used to match the # ".ppp" portion of the username, and to add a set of # "user requested PPP" attributes to the request. # # Matching can take place with the the Prefix and Suffix # attributes, just like in the "users" file. # These attributes operate ONLY on the username, though. # # Note that the attributes that are set for each # entry are _NOT_ passed back to the terminal server. # Instead they are added to the information that has # been _SENT_ by the terminal server. # # This extra information can be used in the users file to # match on. Usually this is done in the DEFAULT entries, # of which there can be more than one. # # In addition a matching entry can transform a username # for authentication purposes if the "Strip-User-Name" # variable is set to Yes in an entry (default is Yes). # # A special non-protocol name-value pair called "Hint" # can be set to match on in the "users" file. # # The following is how most ISPs want to set this up. # # Version: $Id$ # DEFAULT Suffix == ".ppp", Strip-User-Name = Yes Hint = "PPP", Service-Type = Framed-User, Framed-Protocol = PPP DEFAULT Suffix == ".slip", Strip-User-Name = Yes Hint = "SLIP", Service-Type = Framed-User, Framed-Protocol = SLIP DEFAULT Suffix == ".cslip", Strip-User-Name = Yes Hint = "CSLIP", Service-Type = Framed-User, Framed-Protocol = SLIP, Framed-Compression = Van-Jacobson-TCP-IP ###################################################################### # # These entries are old, and commented out by default. # They confuse too many people when "Peter" logs in, and the # server thinks that the user "eter" is asking for PPP. # #DEFAULT Prefix == "U", Strip-User-Name = No # Hint = "UUCP" #DEFAULT Prefix == "P", Strip-User-Name = Yes # Hint = "PPP", # Service-Type = Framed-User, # Framed-Protocol = PPP #DEFAULT Prefix == "S", Strip-User-Name = Yes # Hint = "SLIP", # Service-Type = Framed-User, # Framed-Protocol = SLIP #DEFAULT Prefix == "C", Strip-User-Name = Yes # Hint = "CSLIP", # Service-Type = Framed-User, # Framed-Protocol = SLIP, # Framed-Compression = Van-Jacobson-TCP-IP freeradius-server/raddb/huntgroups000066400000000000000000000031041257552170400177360ustar00rootroot00000000000000# # huntgroups This file defines the `huntgroups' that you have. A # huntgroup is defined by specifying the IP address of # the NAS and possibly a port range. Port can be identified # as just one port, or a range (from-to), and multiple ports # or ranges of ports must be seperated by a comma. For # example: 1,2,3-8 # # Matching is done while RADIUS scans the user file; if it # includes the selection criterium "Huntgroup-Name == XXX" # the huntgroup is looked up in this file to see if it # matches. There can be multiple definitions of the same # huntgroup; the first one that matches will be used. # # This file can also be used to define restricted access # to certain huntgroups. The second and following lines # define the access restrictions (based on username and # UNIX usergroup) for the huntgroup. # # # Our POP in Alphen a/d Rijn has 3 terminal servers. Create a Huntgroup-Name # called Alphen that matches on all three terminal servers. # #alphen NAS-IP-Address == 192.168.2.5 #alphen NAS-IP-Address == 192.168.2.6 #alphen NAS-IP-Address == 192.168.2.7 # # The POP in Delft consists of only one terminal server. # #delft NAS-IP-Address == 192.168.3.5 # # Ports 0-7 on the first terminal server in Alphen are connected to # a huntgroup that is for business users only. Note that only one # of the username or groupname has to match to get access (OR/OR). # # Note that this huntgroup is a subset of the "alphen" huntgroup. # #business NAS-IP-Address == 192.168.2.5, NAS-Port-Id == 0-7 # User-Name = rogerl, # User-Name = henks, # Group = business, # Group = staff freeradius-server/raddb/ldap.attrmap000066400000000000000000000062221257552170400201130ustar00rootroot00000000000000# # Mapping of RADIUS dictionary attributes to LDAP directory attributes # to be used by LDAP authentication and authorization module (rlm_ldap) # # Format: # ItemType RADIUS-Attribute-Name ldapAttributeName [operator] # # Where: # ItemType = checkItem or replyItem # RADIUS-Attribute-Name = attribute name in RADIUS dictionary # ldapAttributeName = attribute name in LDAP schema # operator = optional, and may not be present. # If not present, defaults to "==" for checkItems, # and "=" for replyItems. # If present, the operator here should be one # of the same operators as defined in the "users"3 # file ("man users", or "man 5 users"). # If an operator is present in the value of the # LDAP entry (i.e. ":=foo"), then it over-rides # both the default, and any operator given here. # # If $GENERIC$ is specified as RADIUS-Attribute-Name, the line specifies # a LDAP attribute which can be used to store any RADIUS # attribute/value-pair in LDAP directory. # # You should edit this file to suit it to your needs. # checkItem $GENERIC$ radiusCheckItem replyItem $GENERIC$ radiusReplyItem checkItem Auth-Type radiusAuthType checkItem Simultaneous-Use radiusSimultaneousUse checkItem Called-Station-Id radiusCalledStationId checkItem Calling-Station-Id radiusCallingStationId checkItem LM-Password lmPassword checkItem NT-Password ntPassword checkItem LM-Password sambaLmPassword checkItem NT-Password sambaNtPassword checkItem LM-Password dBCSPwd checkitem Password-With-Header userPassword checkItem SMB-Account-CTRL-TEXT acctFlags checkItem Expiration radiusExpiration checkItem NAS-IP-Address radiusNASIpAddress replyItem Service-Type radiusServiceType replyItem Framed-Protocol radiusFramedProtocol replyItem Framed-IP-Address radiusFramedIPAddress replyItem Framed-IP-Netmask radiusFramedIPNetmask replyItem Framed-Route radiusFramedRoute replyItem Framed-Routing radiusFramedRouting replyItem Filter-Id radiusFilterId replyItem Framed-MTU radiusFramedMTU replyItem Framed-Compression radiusFramedCompression replyItem Login-IP-Host radiusLoginIPHost replyItem Login-Service radiusLoginService replyItem Login-TCP-Port radiusLoginTCPPort replyItem Callback-Number radiusCallbackNumber replyItem Callback-Id radiusCallbackId replyItem Framed-IPX-Network radiusFramedIPXNetwork replyItem Class radiusClass replyItem Session-Timeout radiusSessionTimeout replyItem Idle-Timeout radiusIdleTimeout replyItem Termination-Action radiusTerminationAction replyItem Login-LAT-Service radiusLoginLATService replyItem Login-LAT-Node radiusLoginLATNode replyItem Login-LAT-Group radiusLoginLATGroup replyItem Framed-AppleTalk-Link radiusFramedAppleTalkLink replyItem Framed-AppleTalk-Network radiusFramedAppleTalkNetwork replyItem Framed-AppleTalk-Zone radiusFramedAppleTalkZone replyItem Port-Limit radiusPortLimit replyItem Login-LAT-Port radiusLoginLATPort replyItem Reply-Message radiusReplyMessage replyItem Tunnel-Type radiusTunnelType replyItem Tunnel-Medium-Type radiusTunnelMediumType replyItem Tunnel-Private-Group-Id radiusTunnelPrivateGroupId freeradius-server/raddb/modules/000077500000000000000000000000001257552170400172475ustar00rootroot00000000000000freeradius-server/raddb/modules/acct_unique000066400000000000000000000007061257552170400214750ustar00rootroot00000000000000# -*- text -*- # # $Id$ # # Create a unique accounting session Id. Many NASes re-use # or repeat values for Acct-Session-Id, causing no end of # confusion. # # This module will add a (probably) unique session id # to an accounting packet based on the attributes listed # below found in the packet. See doc/rlm_acct_unique for # more information. # acct_unique { key = "User-Name, Acct-Session-Id, NAS-IP-Address, NAS-Identifier, NAS-Port" } freeradius-server/raddb/modules/always000066400000000000000000000006441257552170400204760ustar00rootroot00000000000000# -*- text -*- # # $Id$ # # The "always" module is here for debugging purposes. Each # instance simply returns the same result, always, without # doing anything. always fail { rcode = fail } always reject { rcode = reject } always noop { rcode = noop } always handled { rcode = handled } always updated { rcode = updated } always notfound { rcode = notfound } always ok { rcode = ok simulcount = 0 mpp = no } freeradius-server/raddb/modules/attr_filter000066400000000000000000000023471257552170400215170ustar00rootroot00000000000000# -*- text -*- # # $Id$ # # This file defines a number of instances of the "attr_filter" module. # # attr_filter - filters the attributes received in replies from # proxied servers, to make sure we send back to our RADIUS client # only allowed attributes. attr_filter attr_filter.post-proxy { attrsfile = ${confdir}/attrs } # attr_filter - filters the attributes in the packets we send to # the RADIUS home servers. attr_filter attr_filter.pre-proxy { attrsfile = ${confdir}/attrs.pre-proxy } # Enforce RFC requirements on the contents of Access-Reject # packets. See the comments at the top of the file for # more details. # attr_filter attr_filter.access_reject { key = %{User-Name} attrsfile = ${confdir}/attrs.access_reject } # Enforce RFC requirements on the contents of Access-Reject # packets. See the comments at the top of the file for # more details. # attr_filter attr_filter.access_challenge { key = %{User-Name} attrsfile = ${confdir}/attrs.access_challenge } # Enforce RFC requirements on the contents of the # Accounting-Response packets. See the comments at the # top of the file for more details. # attr_filter attr_filter.accounting_response { key = %{User-Name} attrsfile = ${confdir}/attrs.accounting_response } freeradius-server/raddb/modules/attr_rewrite000066400000000000000000000024701257552170400217100ustar00rootroot00000000000000# -*- text -*- # # $Id$ # rewrite arbitrary packets. Useful in accounting and authorization. # # As of 2.0, much of the functionality of this module is in "unlang". # You should probably investigate using that before trying to use # the "attr_rewrite" module. # # # The module can also use the Rewrite-Rule attribute. If it # is set and matches the name of the module instance, then # that module instance will be the only one which runs. # # Also if new_attribute is set to yes then a new attribute # will be created containing the value replacewith and it # will be added to searchin (packet, reply, proxy, # proxy_reply or config). # # searchfor,ignore_case and max_matches will be ignored in that case. # # Backreferences are supported. # %{0} will contain the string the whole match # %{1} to %{8} will contain the contents of the 1st to # the 8th parentheses # # If max_matches is greater than one, the backreferences will # correspond to the first attributed that matched. # attr_rewrite sanecallerid { attribute = Called-Station-Id # may be "packet", "reply", "proxy", "proxy_reply" or "config" searchin = packet searchfor = "[+ ]" replacewith = "" ignore_case = no new_attribute = no max_matches = 10 ## If set to yes then the replace string will be ## appended to the original string append = no } freeradius-server/raddb/modules/cache000066400000000000000000000047561257552170400202510ustar00rootroot00000000000000# -*- text -*- # # $Id$ # # A module to cache attributes. The idea is that you can look # up information in a database, and then cache it. Repeated # requests for the same information will then have the cached # values added to the request. # # The module can cache a fixed set of attributes per key. # It can be listed in "authorize", "post-auth", "pre-proxy" # and "post-proxy". # # If you want different things cached for authorize and post-auth, # you will need to define two instances of the "cache" module. # # The module returns "ok" if it found a cache entry. # The module returns "updated" if it added a new cache entry. # The module returns "noop" if it did nothing. # cache { # The key used to index the cache. It is dynamically expanded # at run time. key = "%{User-Name}" # The TTL of cache entries, in seconds. Entries older than this # will be expired. # # You can set the TTL per cache entry, but adding a control # variable "Cache-TTL". The value there will over-ride this one. # Setting a Cache-TTL of 0 means "delete this entry". # # This value should be between 10 and 86400. ttl = 10 # A timestamp used to flush the cache, via # # radmin -e "set module config cache epoch 123456789" # # Where last value is a 32-bit Unix timestamp. Cache entries # older than this are expired, and new entries added. # # You should ALWAYS leave it as "epoch = 0" here. epoch = 0 # The module can also operate in status-only mode where it will # not add new cache entries, or merge existing ones. # # To enable set the control variable "Cache-Status-Only" to "yes" # The module will return "ok" if it found a cache entry. # The module will return "notfound" if it failed to find a cache entry, # or the entry had expired. # # Note: expired entries will still be removed. # If yes the following attributes will be added to the request list: # * Cache-Entry-Hits - The number of times this entry has been # retrieved. add-stats = no # The list of attributes to cache for a particular key. # Each key gets the same set of cached attributes. # The attributes are dynamically expanded at run time. # # You can specify which list the attribute goes into by # prefixing the attribute name with the list. This allows # you to update multiple lists with one configuration. # # If no list is specified the request list will be updated. update { # list:Attr-Name reply:Reply-Message += "I'm the cached reply from %t" control:Class := 0x010203 } } freeradius-server/raddb/modules/chap000066400000000000000000000002131257552170400201010ustar00rootroot00000000000000# -*- text -*- # # $Id$ # CHAP module # # To authenticate requests containing a CHAP-Password attribute. # chap { # no configuration } freeradius-server/raddb/modules/checkval000066400000000000000000000025401257552170400207530ustar00rootroot00000000000000# -*- text -*- # # $Id$ # A simple value checking module # # As of 2.0, much of the functionality of this module is in "unlang". # You should probably investigate using that before trying to use # the "checkval" module. # # It can be used to check if an attribute value in the request # matches a (possibly multi valued) attribute in the check # items This can be used for example for caller-id # authentication. For the module to run, both the request # attribute and the check items attribute must exist # # i.e. # A user has an ldap entry with 2 radiusCallingStationId # attributes with values "12345678" and "12345679". If we # enable rlm_checkval, then any request which contains a # Calling-Station-Id with one of those two values will be # accepted. Requests with other values for # Calling-Station-Id will be rejected. # # Regular expressions in the check attribute value are allowed # as long as the operator is '=~' # checkval { # The attribute to look for in the request item-name = Calling-Station-Id # The attribute to look for in check items. Can be multi valued check-name = Calling-Station-Id # The data type. Can be # string,integer,ipaddr,date,abinary,octets data-type = string # If set to yes and we dont find the item-name attribute in the # request then we send back a reject # DEFAULT is no #notfound-reject = no } freeradius-server/raddb/modules/counter000066400000000000000000000055271257552170400206620ustar00rootroot00000000000000# -*- text -*- # # $Id$ # counter module: # This module takes an attribute (count-attribute). # It also takes a key, and creates a counter for each unique # key. The count is incremented when accounting packets are # received by the server. The value of the increment depends # on the attribute type. # If the attribute is Acct-Session-Time or of an integer type we add # the value of the attribute. If it is anything else we increase the # counter by one. # # The 'reset' parameter defines when the counters are all reset to # zero. It can be hourly, daily, weekly, monthly or never. # # hourly: Reset on 00:00 of every hour # daily: Reset on 00:00:00 every day # weekly: Reset on 00:00:00 on sunday # monthly: Reset on 00:00:00 of the first day of each month # # It can also be user defined. It should be of the form: # num[hdwm] where: # h: hours, d: days, w: weeks, m: months # If the letter is ommited days will be assumed. In example: # reset = 10h (reset every 10 hours) # reset = 12 (reset every 12 days) # # # The check-name attribute defines an attribute which will be # registered by the counter module and can be used to set the # maximum allowed value for the counter after which the user # is rejected. # Something like: # # DEFAULT Max-Daily-Session := 36000 # Fall-Through = 1 # # You should add the counter module in the instantiate # section so that it registers check-name before the files # module reads the users file. # # If check-name is set and the user is to be rejected then we # send back a Reply-Message and we log a Failure-Message in # the radius.log # # If the count attribute is Acct-Session-Time then on each # login we send back the remaining online time as a # Session-Timeout attribute ELSE and if the reply-name is # set, we send back that attribute. The reply-name attribute # MUST be of an integer type. # # The counter-name can also be used instead of using the check-name # like below: # # DEFAULT Daily-Session-Time > 3600, Auth-Type = Reject # Reply-Message = "You've used up more than one hour today" # # The allowed-servicetype attribute can be used to only take # into account specific sessions. For example if a user first # logs in through a login menu and then selects ppp there will # be two sessions. One for Login-User and one for Framed-User # service type. We only need to take into account the second one. # # The module should be added in the instantiate, authorize and # accounting sections. Make sure that in the authorize # section it comes after any module which sets the # 'check-name' attribute. # counter daily { filename = ${db_dir}/db.daily key = User-Name count-attribute = Acct-Session-Time reset = daily counter-name = Daily-Session-Time check-name = Max-Daily-Session reply-name = Session-Timeout allowed-servicetype = Framed-User cache-size = 5000 } freeradius-server/raddb/modules/cui000066400000000000000000000007751257552170400177630ustar00rootroot00000000000000# -*- text -*- # # $Id$ # # Write Chargeable-User-Identity to the database. # # Schema raddb/sql/mysql/cui.sql # Queries raddb/sql/mysql/cui.conf # sql cui { database = "mysql" driver = "rlm_sql_${database}" server = "localhost" login = "db_login_name" password = "db_password" radius_db = "db_name" # sqltrace = yes # sqltracefile = ${logdir}/cuitrace.sql num_sql_socks = 5 connect_failure_retry_delay = 60 cui_table = "cui" sql_user_name = "%{User-Name}" #$INCLUDE sql/${database}/cui.conf } freeradius-server/raddb/modules/detail000066400000000000000000000054061257552170400204410ustar00rootroot00000000000000# -*- text -*- # # $Id$ # Write a detailed log of all accounting records received. # detail { # Note that we do NOT use NAS-IP-Address here, as # that attribute MAY BE from the originating NAS, and # NOT from the proxy which actually sent us the # request. # # The following line creates a new detail file for # every radius client (by IP address or hostname). # In addition, a new detail file is created every # day, so that the detail file doesn't have to go # through a 'log rotation' # # If your detail files are large, you may also want # to add a ':%H' (see doc/variables.txt) to the end # of it, to create a new detail file every hour, e.g.: # # ..../detail-%Y%m%d:%H # # This will create a new detail file for every hour. # # If you are reading detail files via the "listen" section # (e.g. as in raddb/sites-available/robust-proxy-accounting), # you MUST use a unique directory for each combination of a # detail file writer, and reader. That is, there can only # be ONE "listen" section reading detail files from a # particular directory. # detailfile = ${radacctdir}/%{%{Packet-Src-IP-Address}:-%{Packet-Src-IPv6-Address}}/detail-%Y%m%d # # If you are using radrelay, delete the above line for "detailfile", # and use this one instead: # # detailfile = ${radacctdir}/detail # # Most file systems can handly nearly the full range of UTF-8 # characters. Ones that can deal with a limited range should # set this to "yes". # escape_filenames = no # # The Unix-style permissions on the 'detail' file. # # The detail file often contains secret or private # information about users. So by keeping the file # permissions restrictive, we can prevent unwanted # people from seeing that information. detailperm = 0600 # The Unix group of the log file. # # The user that the server runs as must be in the specified # system group otherwise this will fail to work. # # group = freerad # # Every entry in the detail file has a header which # is a timestamp. By default, we use the ctime # format (see "man ctime" for details). # # The header can be customized by editing this # string. See "doc/variables.txt" for a description # of what can be put here. # header = "%t" # # Uncomment this line if the detail file reader will be # reading this detail file. # # locking = yes # # Log the Packet src/dst IP/port. This is disabled by # default, as that information isn't used by many people. # # log_packet_header = yes # # Certain attributes such as User-Password may be # "sensitive", so they should not be printed in the # detail file. This section lists the attributes # that should be suppressed. # # The attributes should be listed one to a line. # #suppress { # User-Password #} } freeradius-server/raddb/modules/detail.example.com000066400000000000000000000016371257552170400226520ustar00rootroot00000000000000# -*- text -*- # # Detail file writer, used in the following examples: # # raddb/sites-available/robust-proxy-accounting # raddb/sites-available/decoupled-accounting # # Note that this module can write detail files that are read by # only ONE "listen" section. If you use BOTH of the examples # above, you will need to define TWO "detail" modules. # # e.g. detail1.example.com && detail2.example.com # # # We write *multiple* detail files here. They will be processed by # the detail "listen" section in the order that they were created. # The directory containing these files should NOT be used for any # other purposes. i.e. It should have NO other files in it. # # Writing multiple detail enables the server to process the pieces # in smaller chunks. This helps in certain catastrophic corner cases. # # $Id$ # detail detail.example.com { detailfile = ${radacctdir}/detail.example.com/detail-%Y%m%d:%H:%G } freeradius-server/raddb/modules/detail.log000066400000000000000000000035101257552170400212130ustar00rootroot00000000000000# -*- text -*- # # $Id$ # # More examples of doing detail logs. # # Many people want to log authentication requests. # Rather than modifying the server core to print out more # messages, we can use a different instance of the 'detail' # module, to log the authentication requests to a file. # # You will also need to un-comment the 'auth_log' line # in the 'authorize' section, below. # detail auth_log { detailfile = ${radacctdir}/%{%{Packet-Src-IP-Address}:-%{Packet-Src-IPv6-Address}}/auth-detail-%Y%m%d # # This MUST be 0600, otherwise anyone can read # the users passwords! detailperm = 0600 # You may also strip out passwords completely suppress { User-Password } } # # This module logs authentication reply packets sent # to a NAS. Both Access-Accept and Access-Reject packets # are logged. # # You will also need to un-comment the 'reply_log' line # in the 'post-auth' section, below. # detail reply_log { detailfile = ${radacctdir}/%{%{Packet-Src-IP-Address}:-%{Packet-Src-IPv6-Address}}/reply-detail-%Y%m%d detailperm = 0600 } # # This module logs packets proxied to a home server. # # You will also need to un-comment the 'pre_proxy_log' line # in the 'pre-proxy' section, below. # detail pre_proxy_log { detailfile = ${radacctdir}/%{%{Packet-Src-IP-Address}:-%{Packet-Src-IPv6-Address}}/pre-proxy-detail-%Y%m%d # # This MUST be 0600, otherwise anyone can read # the users passwords! detailperm = 0600 # You may also strip out passwords completely #suppress { # User-Password #} } # # This module logs response packets from a home server. # # You will also need to un-comment the 'post_proxy_log' line # in the 'post-proxy' section, below. # detail post_proxy_log { detailfile = ${radacctdir}/%{%{Packet-Src-IP-Address}:-%{Packet-Src-IPv6-Address}}/post-proxy-detail-%Y%m%d detailperm = 0600 } freeradius-server/raddb/modules/dhcp_sqlippool000066400000000000000000000023121257552170400222100ustar00rootroot00000000000000## Configuration for DHCP to use SQL IP Pools. ## ## See sqlippool.conf for common configuration explanation ## ## $Id$ sqlippool dhcp_sqlippool { sql-instance-name = "sql" ippool_table = "radippool" lease-duration = 7200 # Client's MAC address is mapped to Calling-Station-Id in policy.conf pool-key = "%{Calling-Station-Id}" # For now, it only works with MySQL. $INCLUDE ${confdir}/sql/mysql/ippool-dhcp.conf sqlippool_log_exists = "DHCP: Existing IP: %{reply:Framed-IP-Address} (did %{Called-Station-Id} cli %{Calling-Station-Id} port %{NAS-Port} user %{User-Name})" sqlippool_log_success = "DHCP: Allocated IP: %{reply:Framed-IP-Address} from %{control:Pool-Name} (did %{Called-Station-Id} cli %{Calling-Station-Id} port %{NAS-Port} user %{User-Name})" sqlippool_log_clear = "DHCP: Released IP %{Framed-IP-Address} (did %{Called-Station-Id} cli %{Calling-Station-Id} user %{User-Name})" sqlippool_log_failed = "DHCP: IP Allocation FAILED from %{control:Pool-Name} (did %{Called-Station-Id} cli %{Calling-Station-Id} port %{NAS-Port} user %{User-Name})" sqlippool_log_nopool = "DHCP: No Pool-Name defined (did %{Called-Station-Id} cli %{Calling-Station-Id} port %{NAS-Port} user %{User-Name})" } freeradius-server/raddb/modules/digest000066400000000000000000000004211257552170400204460ustar00rootroot00000000000000# -*- text -*- # # $Id$ # # The 'digest' module currently has no configuration. # # "Digest" authentication against a Cisco SIP server. # See 'doc/rfc/draft-sterman-aaa-sip-00.txt' for details # on performing digest authentication for Cisco SIP servers. # digest { } freeradius-server/raddb/modules/dynamic_clients000066400000000000000000000015651257552170400223460ustar00rootroot00000000000000# -*- text -*- # # $Id$ # This module loads RADIUS clients as needed, rather than when the server # starts. # # There are no configuration entries for this module. Instead, it # relies on the "client" configuration. You must: # # 1) link raddb/sites-enabled/dyanmic_clients to # raddb/sites-available/dyanmic_clients # # 2) Define a client network/mask (see top of the above file) # # 3) uncomment the "directory" entry in that client definition # # 4) list "dynamic_clients" in the "authorize" section of the # "dynamic_clients' virtual server. The default example already # does this. # # 5) put files into the above directory, one per IP. # e.g. file "192.168.1.1" should contain a normal client definition # for a client with IP address 192.168.1.1. # # For more documentation, see the file: # # raddb/sites-available/dynamic-clients # dynamic_clients { } freeradius-server/raddb/modules/echo000066400000000000000000000071551257552170400201200ustar00rootroot00000000000000# -*- text -*- # # $Id$ # # This is a more general example of the execute module. # # This one is called "echo". # # Attribute-Name = `%{echo:/path/to/program args}` # # If you wish to execute an external program in more than # one section (e.g. 'authorize', 'pre_proxy', etc), then it # is probably best to define a different instance of the # 'exec' module for every section. # # The return value of the program run determines the result # of the exec instance call as follows: # (See doc/configurable_failover for details) # # < 0 : fail the module failed # = 0 : ok the module succeeded # = 1 : reject the module rejected the user # = 2 : fail the module failed # = 3 : ok the module succeeded # = 4 : handled the module has done everything to handle the request # = 5 : invalid the user's configuration entry was invalid # = 6 : userlock the user was locked out # = 7 : notfound the user was not found # = 8 : noop the module did nothing # = 9 : updated the module updated information in the request # > 9 : fail the module failed # exec echo { # # Wait for the program to finish. # # If we do NOT wait, then the program is "fire and # forget", and any output attributes from it are ignored. # # If we are looking for the program to output # attributes, and want to add those attributes to the # request, then we MUST wait for the program to # finish, and therefore set 'wait=yes' # # allowed values: {no, yes} wait = yes # # The name of the program to execute, and it's # arguments. Dynamic translation is done on this # field, so things like the following example will # work. # program = "/bin/echo %{User-Name}" # # The attributes which are placed into the # environment variables for the program. # # Allowed values are: # # request attributes from the request # config attributes from the configuration items list # reply attributes from the reply # proxy-request attributes from the proxy request # proxy-reply attributes from the proxy reply # # Note that some attributes may not exist at some # stages. e.g. There may be no proxy-reply # attributes if this module is used in the # 'authorize' section. # input_pairs = request # # Where to place the output attributes (if any) from # the executed program. The values allowed, and the # restrictions as to availability, are the same as # for the input_pairs. # output_pairs = reply # # When to execute the program. If the packet # type does NOT match what's listed here, then # the module does NOT execute the program. # # For a list of allowed packet types, see # the 'dictionary' file, and look for VALUEs # of the Packet-Type attribute. # # By default, the module executes on ANY packet. # Un-comment out the following line to tell the # module to execute only if an Access-Accept is # being sent to the NAS. # #packet_type = Access-Accept # # Should we escape the environment variables? # # If this is set, all the RADIUS attributes # are capitalised and dashes replaced with # underscores. Also, RADIUS values are surrounded # with double-quotes. # # That is to say: User-Name=BobUser => USER_NAME="BobUser" shell_escape = yes # # How long should we wait for the program to finish? # # Default is 10 seconds, which should be plenty for nearly # anything. Range is 1 to 30 seconds. You are strongly # encouraged to NOT increase this value. Decreasing can # be used to cause authentication to fail sooner when you # know it's going to fail anyway due to the time taken, # thereby saving resources. # #timeout = 10 } freeradius-server/raddb/modules/etc_group000066400000000000000000000014601257552170400211620ustar00rootroot00000000000000# -*- text -*- # # $Id$ # "passwd" configuration, for the /etc/group file. Adds a Etc-Group-Name # attribute for every group that the user is member of. # # You will have to define the Etc-Group-Name in the 'dictionary' file # as a 'string' type. # # The Group and Group-Name attributes are automatically created by # the Unix module, and do checking against /etc/group automatically. # This means that you CANNOT use Group or Group-Name to do any other # kind of grouping in the server. You MUST define a new group # attribute. # # i.e. this module should NOT be used as-is, but should be edited to # point to a different group file. # passwd etc_group { filename = /etc/group format = "=Etc-Group-Name:::*,User-Name" hashsize = 50 ignorenislike = yes allowmultiplekeys = yes delimiter = ":" } freeradius-server/raddb/modules/exec000066400000000000000000000014141257552170400201160ustar00rootroot00000000000000# -*- text -*- # # $Id$ # # Execute external programs # # This module is useful only for 'xlat'. To use it, # put 'exec' into the 'instantiate' section. You can then # do dynamic translation of attributes like: # # Attribute-Name = `%{exec:/path/to/program args}` # # The value of the attribute will be replaced with the output # of the program which is executed. Due to RADIUS protocol # limitations, any output over 253 bytes will be ignored. # # The RADIUS attributes from the user request will be placed # into environment variables of the executed program, as # described in "man unlang" and in doc/variables.txt # # See also "echo" for more sample configuration. # exec { wait = no input_pairs = request shell_escape = yes output = none timeout = 10 } freeradius-server/raddb/modules/expiration000066400000000000000000000010441257552170400213530ustar00rootroot00000000000000# -*- text -*- # # $Id$ # # The expiration module. This handles the Expiration attribute # It should be included in the *end* of the authorize section # in order to handle user Expiration. It should also be included # in the instantiate section in order to register the Expiration # compare function # expiration { # # The Reply-Message which will be sent back in case the # account has expired. Dynamic substitution is supported # reply-message = "Password Has Expired\r\n" #reply-message = "Your account has expired, %{User-Name}\r\n" } freeradius-server/raddb/modules/expr000066400000000000000000000010561257552170400201520ustar00rootroot00000000000000# -*- text -*- # # $Id$ # # The 'expression' module currently has no configuration. # # This module is useful only for 'xlat'. To use it, # put 'expr' into the 'instantiate' section. You can then # do dynamic translation of attributes like: # # Attribute-Name = `%{expr:2 + 3 + %{exec: uid -u}}` # # The value of the attribute will be replaced with the output # of the program which is executed. Due to RADIUS protocol # limitations, any output over 253 bytes will be ignored. # # The module also registers a few paircompare functions expr { } freeradius-server/raddb/modules/files000066400000000000000000000027701257552170400203020ustar00rootroot00000000000000# -*- text -*- # # $Id$ # Livingston-style 'users' file # files { # The default key attribute to use for matches. The content # of this attribute is used to match the "name" of the # entry. #key = "%{%{Stripped-User-Name}:-%{User-Name}}" usersfile = ${confdir}/users acctusersfile = ${confdir}/acct_users preproxy_usersfile = ${confdir}/preproxy_users # If you want to use the old Cistron 'users' file # with FreeRADIUS, you should change the next line # to 'compat = cistron'. You can the copy your 'users' # file from Cistron. compat = no } # An example which defines a second instance of the "files" module. # This instance is named "second_files". In order for it to be used # in a virtual server, it needs to be listed as "second_files" # inside of the "authorize" section (or other section). If you just # list "files", that will refer to the configuration defined above. # # The two names here mean: # "files" - this is a configuration for the "rlm_files" module # "second_files" - this is a named configuration, which isn't # the default configuration. files second_files { #key = "%{%{Stripped-User-Name}:-%{User-Name}}" # The names here don't matter. They just need to be different # from the names for the "files" configuration above. If they # are the same, then this configuration will end up being the # same as the one above. usersfile = ${confdir}/second_users acctusersfile = ${confdir}/second_acct_users preproxy_usersfile = ${confdir}/second_preproxy_users } freeradius-server/raddb/modules/inner-eap000066400000000000000000000105611257552170400210530ustar00rootroot00000000000000# -*- text -*- # # $Id$ # # Sample configuration for an EAP module that occurs *inside* # of a tunneled method. It is used to limit the EAP types that # can occur inside of the inner tunnel. # # See also raddb/sites-available/inner-tunnel # # To use this module, edit raddb/sites-available/inner-tunnel, and # replace the references to "eap" with "inner-eap". # # See raddb/eap.conf for full documentation on the meaning of the # configuration entries here. # eap inner-eap { # This is the best choice for PEAP. default_eap_type = mschapv2 timer_expire = 60 # This should be the same as the outer eap "max sessions" max_sessions = 2048 # Supported EAP-types md5 { } gtc { # The default challenge, which many clients # ignore.. #challenge = "Password: " auth_type = PAP } mschapv2 { } # No TTLS or PEAP configuration should be listed here. ## EAP-TLS # # You SHOULD use different certificates than are used # for the outer EAP configuration! # # Support for PEAP/TLS and RFC 5176 TLS/TLS is experimental. # tls { # # These is used to simplify later configurations. # certdir = ${confdir}/certs cadir = ${confdir}/certs private_key_password = whatever private_key_file = ${certdir}/server.pem # If Private key & Certificate are located in # the same file, then private_key_file & # certificate_file must contain the same file # name. # # If CA_file (below) is not used, then the # certificate_file below MUST include not # only the server certificate, but ALSO all # of the CA certificates used to sign the # server certificate. certificate_file = ${certdir}/server.pem # Trusted Root CA list # # ALL of the CA's in this list will be trusted # to issue client certificates for authentication. # # In general, you should use self-signed # certificates for 802.1x (EAP) authentication. # In that case, this CA file should contain # *one* CA certificate. # # This parameter is used only for EAP-TLS, # when you issue client certificates. If you do # not use client certificates, and you do not want # to permit EAP-TLS authentication, then delete # this configuration item. CA_file = ${cadir}/ca.pem # # For DH cipher suites to work, you have to # run OpenSSL to create the DH file first: # # openssl dhparam -out certs/dh 1024 # dh_file = ${certdir}/dh random_file = ${certdir}/random # # This can never exceed the size of a RADIUS # packet (4096 bytes), and is preferably half # that, to accomodate other attributes in # RADIUS packet. On most APs the MAX packet # length is configured between 1500 - 1600 # In these cases, fragment size should be # 1024 or less. # # fragment_size = 1024 # include_length is a flag which is # by default set to yes If set to # yes, Total Length of the message is # included in EVERY packet we send. # If set to no, Total Length of the # message is included ONLY in the # First packet of a fragment series. # # include_length = yes # Check the Certificate Revocation List # # 1) Copy CA certificates and CRLs to same directory. # 2) Execute 'c_rehash '. # 'c_rehash' is OpenSSL's command. # 3) uncomment the line below. # 5) Restart radiusd # check_crl = yes # CA_path = /path/to/directory/with/ca_certs/and/crls/ # # If check_cert_issuer is set, the value will # be checked against the DN of the issuer in # the client certificate. If the values do not # match, the cerficate verification will fail, # rejecting the user. # # check_cert_issuer = "/C=GB/ST=Berkshire/L=Newbury/O=My Company Ltd" # # If check_cert_cn is set, the value will # be xlat'ed and checked against the CN # in the client certificate. If the values # do not match, the certificate verification # will fail rejecting the user. # # This check is done only if the previous # "check_cert_issuer" is not set, or if # the check succeeds. # # check_cert_cn = %{User-Name} # # Set this option to specify the allowed # TLS cipher suites. The format is listed # in "man 1 ciphers". cipher_list = "DEFAULT" # # The session resumption / fast reauthentication # cache CANNOT be used for inner sessions. # } } freeradius-server/raddb/modules/ippool000066400000000000000000000042301257552170400204730ustar00rootroot00000000000000# -*- text -*- # # $Id$ # Do server side ip pool management. Should be added in # post-auth and accounting sections. # # The module also requires the existance of the Pool-Name # attribute. That way the administrator can add the Pool-Name # attribute in the user profiles and use different pools for # different users. The Pool-Name attribute is a *check* item # not a reply item. # # The Pool-Name should be set to the ippool module instance # name or to DEFAULT to match any module. # # Example: # radiusd.conf: ippool students { [...] } # ippool teachers { [...] } # users file : DEFAULT Group == students, Pool-Name := "students" # DEFAULT Group == teachers, Pool-Name := "teachers" # DEFAULT Group == other, Pool-Name := "DEFAULT" # # ********* IF YOU CHANGE THE RANGE PARAMETERS YOU MUST ********* # ********* THEN ERASE THE DB FILES ********* # ippool main_pool { # range-start,range-stop: # The start and end ip addresses for this pool. range-start = 192.168.1.1 range-stop = 192.168.3.254 # netmask: # The network mask used for this pool. netmask = 255.255.255.0 # cache-size: # The gdbm cache size for the db files. Should # be equal to the number of ip's available in # the ip pool cache-size = 800 # session-db: # The main db file used to allocate addresses. session-db = ${db_dir}/db.ippool # ip-index: # Helper db index file used in multilink ip-index = ${db_dir}/db.ipindex # override: # If set, the Framed-IP-Address already in the # reply (if any) will be discarded, and replaced # with a Framed-IP-Address assigned here. override = no # maximum-timeout: # Specifies the maximum time in seconds that an # entry may be active. If set to zero, means # "no timeout". The default value is 0 maximum-timeout = 0 # key: # The key to use for the session database (which # holds the allocated ip's) normally it should # just be the nas ip/port (which is the default). # # If your NAS sends the same value of NAS-Port # all requests, the key should be based on some # other attribute that is in ALL requests, AND # is unique to each machine needing an IP address. #key = "%{NAS-IP-Address} %{NAS-Port}" } freeradius-server/raddb/modules/krb5000066400000000000000000000002311257552170400200310ustar00rootroot00000000000000# -*- text -*- # # $Id$ # # Kerberos. See doc/rlm_krb5 for minimal docs. # krb5 { keytab = /path/to/keytab service_principal = name_of_principle } freeradius-server/raddb/modules/ldap000066400000000000000000000136361257552170400201230ustar00rootroot00000000000000# -*- text -*- # # $Id$ # Lightweight Directory Access Protocol (LDAP) # # This module definition allows you to use LDAP for # authorization and authentication. # # See raddb/sites-available/default for reference to the # ldap module in the authorize and authenticate sections. # # However, LDAP can be used for authentication ONLY when the # Access-Request packet contains a clear-text User-Password # attribute. LDAP authentication will NOT work for any other # authentication method. # # This means that LDAP servers don't understand EAP. If you # force "Auth-Type = LDAP", and then send the server a # request containing EAP authentication, then authentication # WILL NOT WORK. # # The solution is to use the default configuration, which does # work. # # Setting "Auth-Type = LDAP" is ALMOST ALWAYS WRONG. We # really can't emphasize this enough. # ldap { # # Note that this needs to match the name in the LDAP # server certificate, if you're using ldaps. server = "ldap.your.domain" #identity = "cn=admin,o=My Org,c=UA" #password = mypass basedn = "o=My Org,c=UA" filter = "(uid=%{%{Stripped-User-Name}:-%{User-Name}})" #base_filter = "(objectclass=radiusprofile)" # How many connections to keep open to the LDAP server. # This saves time over opening a new LDAP socket for # every authentication request. ldap_connections_number = 5 # How many times the connection can be used before # being re-established. This is useful for things # like load balancers, which may exhibit sticky # behaviour without it. (0) is unlimited. max_uses = 0 # Port to connect on, defaults to 389. Setting this to # 636 will enable LDAPS if start_tls (see below) is not # able to be used. #port = 389 # seconds to wait for LDAP query to finish. default: 20 timeout = 4 # seconds LDAP server has to process the query (server-side # time limit). default: 20 # # LDAP_OPT_TIMELIMIT is set to this value. timelimit = 3 # # seconds to wait for response of the server. (network # failures) default: 10 # # LDAP_OPT_NETWORK_TIMEOUT is set to this value. net_timeout = 1 # # This subsection configures the tls related items # that control how FreeRADIUS connects to an LDAP # server. It contains all of the "tls_*" configuration # entries used in older versions of FreeRADIUS. Those # configuration entries can still be used, but we recommend # using these. # tls { # Set this to 'yes' to use TLS encrypted connections # to the LDAP database by using the StartTLS extended # operation. # # The StartTLS operation is supposed to be # used with normal ldap connections instead of # using ldaps (port 636) connections start_tls = no # cacertfile = /path/to/cacert.pem # cacertdir = /path/to/ca/dir/ # certfile = /path/to/radius.crt # keyfile = /path/to/radius.key # randfile = /path/to/rnd # Certificate Verification requirements. Can be: # "never" (don't even bother trying) # "allow" (try, but don't fail if the cerificate # can't be verified) # "demand" (fail if the certificate doesn't verify.) # # The default is "allow" # require_cert = "demand" } # default_profile = "cn=radprofile,ou=dialup,o=My Org,c=UA" # profile_attribute = "radiusProfileDn" # access_attr = "dialupAccess" # Mapping of RADIUS dictionary attributes to LDAP # directory attributes. dictionary_mapping = ${confdir}/ldap.attrmap # Set password_attribute = nspmPassword to get the # user's password from a Novell eDirectory # backend. This will work ONLY IF FreeRADIUS has been # built with the --with-edir configure option. # # See also the following links: # # http://www.novell.com/coolsolutions/appnote/16745.html # https://secure-support.novell.com/KanisaPlatform/Publishing/558/3009668_f.SAL_Public.html # # Novell may require TLS encrypted sessions before returning # the user's password. # # password_attribute = userPassword # Un-comment the following to disable Novell # eDirectory account policy check and intruder # detection. This will work *only if* FreeRADIUS is # configured to build with --with-edir option. # edir_account_policy_check = no # # Group membership checking. Disabled by default. # # groupname_attribute = cn # groupmembership_filter = "(|(&(objectClass=GroupOfNames)(member=%{control:Ldap-UserDn}))(&(objectClass=GroupOfUniqueNames)(uniquemember=%{control:Ldap-UserDn})))" # groupmembership_attribute = radiusGroupName # compare_check_items = yes # do_xlat = yes # access_attr_used_for_allow = yes # # The following two configuration items are for Active Directory # compatibility. If you see the helpful "operations error" # being returned to the LDAP module, uncomment the next # two lines. # # chase_referrals = yes # rebind = yes # # By default, if the packet contains a User-Password, # and no other module is configured to handle the # authentication, the LDAP module sets itself to do # LDAP bind for authentication. # # THIS WILL ONLY WORK FOR PAP AUTHENTICATION. # # THIS WILL NOT WORK FOR CHAP, MS-CHAP, or 802.1x (EAP). # # You can disable this behavior by setting the following # configuration entry to "no". # # allowed values: {no, yes} # set_auth_type = yes # ldap_debug: debug flag for LDAP SDK # (see OpenLDAP documentation). Set this to enable # huge amounts of LDAP debugging on the screen. # You should only use this if you are an LDAP expert. # # default: 0x0000 (no debugging messages) # Example:(LDAP_DEBUG_FILTER+LDAP_DEBUG_CONNS) #ldap_debug = 0x0028 # # Keepalive configuration. This MAY NOT be supported by your # LDAP library. If these configuration entries appear in the # output of "radiusd -X", then they are supported. Otherwise, # they are unsupported, and changing them will do nothing. # keepalive { # LDAP_OPT_X_KEEPALIVE_IDLE idle = 60 # LDAP_OPT_X_KEEPALIVE_PROBES probes = 3 # LDAP_OPT_X_KEEPALIVE_INTERVAL interval = 3 } } freeradius-server/raddb/modules/linelog000066400000000000000000000060201257552170400206210ustar00rootroot00000000000000# -*- text -*- # # $Id$ # # The "linelog" module will log one line of text to a file. # Both the filename and the line of text are dynamically expanded. # # We STRONGLY suggest that you do not use data from the # packet as part of the filename. # linelog { # # The file where the logs will go. # # If the filename is "syslog", then the log messages will # go to syslog. filename = ${logdir}/linelog # # The Unix-style permissions on the log file. # # Depending on format string, the log file may contain secret or # private information about users. Keep the file permissions as # restrictive as possible. permissions = 0600 # # The Unix group of the log file. # # The user that freeradius runs as must be in the specified # group, otherwise it will not be possible to set the group. # # group = freerad # # If logging via syslog, the facility can be set here. Otherwise # the syslog_facility option in radiusd.conf will be used. # # syslog_facility = daemon # # The default format string. format = "This is a log message for %{User-Name}" # # This next line can be omitted. If it is omitted, then # the log message is static, and is always given by "format", # above. # # If it is defined, then the string is dynamically expanded, # and the result is used to find another configuration entry # here, with the given name. That name is then used as the # format string. # # If the configuration entry cannot be found, then no log # message is printed. # # i.e. You can have many log messages in one "linelog" module. # If this two-step expansion did not exist, you would have # needed to configure one "linelog" module for each log message. # # Reference the Packet-Type (Access-Request, etc.) If it doesn't # exist, reference the "format" entry, above. reference = "%{%{Packet-Type}:-format}" # # Followed by a series of log messages. Access-Request = "Requested access: %{User-Name}" Access-Reject = "Rejected access: %{User-Name}" Access-Challenge = "Sent challenge: %{User-Name}" # # The log messages can be grouped into sections and # sub-sections, too. The "reference" item needs to have a "." # for every section. e.g. reference = foo.bar will reference # the "foo" section, "bar" configuration item. # # # Used if: reference = "foo.bar". foo { bar = "Example log. Please ignore" } # # Another example: # reference = "Accounting-Request.%{%{Acct-Status-Type}:-unknown}" # Accounting-Request { Start = "Connect: [%{User-Name}] (did %{Called-Station-Id} cli %{Calling-Station-Id} port %{NAS-Port} ip %{Framed-IP-Address})" Stop = "Disconnect: [%{User-Name}] (did %{Called-Station-Id} cli %{Calling-Station-Id} port %{NAS-Port} ip %{Framed-IP-Address}) %{Acct-Session-Time} seconds" # Don't log anything for these packets. Alive = "" Accounting-On = "NAS %C (%{NAS-IP-Address}) just came online" Accounting-Off = "NAS %C (%{NAS-IP-Address}) just went offline" # don't log anything for other Acct-Status-Types. unknown = "" } } freeradius-server/raddb/modules/logintime000066400000000000000000000021001257552170400211520ustar00rootroot00000000000000# -*- text -*- # # $Id$ # The logintime module. This handles the Login-Time, # Current-Time, and Time-Of-Day attributes. It should be # included in the *end* of the authorize section in order to # handle Login-Time checks. It should also be included in the # instantiate section in order to register the Current-Time # and Time-Of-Day comparison functions. # # When the Login-Time attribute is set to some value, and the # user has bene permitted to log in, a Session-Timeout is # calculated based on the remaining time. See "doc/README". # logintime { # # The Reply-Message which will be sent back in case # the account is calling outside of the allowed # timespan. Dynamic substitution is supported. # reply-message = "You are calling outside your allowed timespan\r\n" #reply-message = "Outside allowed timespan (%{control:Login-Time}), %{User-Name}\r\n" # The minimum timeout (in seconds) a user is allowed # to have. If the calculated timeout is lower we don't # allow the logon. Some NASes do not handle values # lower than 60 seconds well. minimum-timeout = 60 } freeradius-server/raddb/modules/mac2ip000066400000000000000000000012501257552170400203430ustar00rootroot00000000000000# -*- text -*- # # $Id$ ###################################################################### # # This next section is a sample configuration for the "passwd" # module, that reads flat-text files. # # The file is in the format , # # 00:01:02:03:04:05,192.168.1.100 # 01:01:02:03:04:05,192.168.1.101 # 02:01:02:03:04:05,192.168.1.102 # # This lets you perform simple static IP assignments from a flat-text # file. You will have to define lease times yourself. # ###################################################################### passwd mac2ip { filename = ${confdir}/mac2ip format = "*DHCP-Client-Hardware-Address:=DHCP-Your-IP-Address" delimiter = "," } freeradius-server/raddb/modules/mac2vlan000066400000000000000000000005331257552170400206760ustar00rootroot00000000000000# -*- text -*- # # $Id$ # A simple file to map a MAC address to a VLAN. # # The file should be in the format MAC,VLAN # the VLAN name cannot have spaces in it, for example: # # 00:01:02:03:04:05,VLAN1 # 03:04:05:06:07:08,VLAN2 # ... # passwd mac2vlan { filename = ${confdir}/mac2vlan format = "*VMPS-Mac:=VMPS-VLAN-Name" delimiter = "," } freeradius-server/raddb/modules/mschap000066400000000000000000000053711257552170400204530ustar00rootroot00000000000000# -*- text -*- # # $Id$ # Microsoft CHAP authentication # # This module supports MS-CHAP and MS-CHAPv2 authentication. # It also enforces the SMB-Account-Ctrl attribute. # mschap { # # If you are using /etc/smbpasswd, see the 'passwd' # module for an example of how to use /etc/smbpasswd # if use_mppe is not set to no mschap will # add MS-CHAP-MPPE-Keys for MS-CHAPv1 and # MS-MPPE-Recv-Key/MS-MPPE-Send-Key for MS-CHAPv2 # # use_mppe = no # if mppe is enabled require_encryption makes # encryption moderate # # require_encryption = yes # require_strong always requires 128 bit key # encryption # # require_strong = yes # Windows sends us a username in the form of # DOMAIN\user, but sends the challenge response # based on only the user portion. This hack # corrects for that incorrect behavior. # # with_ntdomain_hack = no # The module can perform authentication itself, OR # use a Windows Domain Controller. This configuration # directive tells the module to call the ntlm_auth # program, which will do the authentication, and return # the NT-Key. Note that you MUST have "winbindd" and # "nmbd" running on the local machine for ntlm_auth # to work. See the ntlm_auth program documentation # for details. # # If ntlm_auth is configured below, then the mschap # module will call ntlm_auth for every MS-CHAP # authentication request. If there is a cleartext # or NT hashed password available, you can set # "MS-CHAP-Use-NTLM-Auth := No" in the control items, # and the mschap module will do the authentication itself, # without calling ntlm_auth. # # Be VERY careful when editing the following line! # # You can also try setting the user name as: # # ... --username=%{mschap:User-Name} ... # # In that case, the mschap module will look at the User-Name # attribute, and do prefix/suffix checks in order to obtain # the "best" user name for the request. # # ntlm_auth = "/path/to/ntlm_auth --request-nt-key --username=%{%{Stripped-User-Name}:-%{%{User-Name}:-None}} --challenge=%{%{mschap:Challenge}:-00} --nt-response=%{%{mschap:NT-Response}:-00}" # The default is to wait 10 seconds for ntlm_auth to # complete. This is a long time, and if it's taking that # long then you likely have other problems in your domain. # The length of time can be decreased with the following # option, which can save clients waiting if your ntlm_auth # usually finishes quicker. Range 1 to 10 seconds. # # ntlm_auth_timeout = 10 # For Apple Server, when running on the same machine as # Open Directory. It has no effect on other systems. # # use_open_directory = yes # On failure, set (or not) the MS-CHAP error code saying # "retries allowed". # allow_retry = yes # An optional retry message. # retry_msg = "Re-enter (or reset) the password" } freeradius-server/raddb/modules/ntlm_auth000066400000000000000000000005731257552170400211720ustar00rootroot00000000000000# # For testing ntlm_auth authentication with PAP. # # If you have problems with authentication failing, even when the # password is good, it may be a bug in Samba: # # https://bugzilla.samba.org/show_bug.cgi?id=6563 # exec ntlm_auth { wait = yes program = "/path/to/ntlm_auth --request-nt-key --domain=MYDOMAIN --username=%{mschap:User-Name} --password=%{User-Password}" } freeradius-server/raddb/modules/opendirectory000066400000000000000000000004371257552170400220640ustar00rootroot00000000000000# -*- text -*- # # $Id$ # This module is only used when the server is running on the same # system as OpenDirectory. The configuration of the module is hard-coded # by Apple, and cannot be changed here. # # There are no configuration entries for this module. # opendirectory { } freeradius-server/raddb/modules/otp000066400000000000000000000064351257552170400200040ustar00rootroot00000000000000# # Configuration for the OTP module. # # This module allows you to use various handheld OTP tokens # for authentication (Auth-Type := otp). These tokens are # available from various vendors. # # It works in conjunction with otpd, which implements token # management and OTP verification functions; and lsmd or gsmd, # which implements synchronous state management functions. # otpd, lsmd and gsmd are available from TRI-D Systems: # # You must list this module in BOTH the authorize and authenticate # sections in order to use it. otp { # otpd rendezvous point. # (default: /var/run/otpd/socket) #otpd_rp = /var/run/otpd/socket # Text to use for the challenge. The '%' character is # disallowed, except that you MUST have a single "%s" # sequence in the string; the challenge itself is # inserted there. (default "Challenge: %s\n Response: ") #challenge_prompt = "Challenge: %s\n Response: " # Length of the challenge. Most tokens probably support a # max of 8 digits. (range: 5-32 digits, default 6) #challenge_length = 6 # Maximum time, in seconds, that a challenge is valid. # (The user must respond to a challenge within this time.) # It is also the minimal time between consecutive async mode # authentications, a necessary restriction due to an inherent # weakness of the RADIUS protocol which allows replay attacks. # (default: 30) #challenge_delay = 30 # Whether or not to allow asynchronous ("pure" challenge/ # response) mode authentication. Since sync mode is much more # usable, and all reasonable tokens support it, the typical # use of async mode is to allow resync of event based tokens. # But because of the vulnerability of async mode with some tokens, # you probably want to disable this and require that out-of-sync # users resync from specifically secured terminals. # See the otpd docs for more info. # (default: no) #allow_async = no # Whether or not to allow synchronous mode authentication. # When using otpd with lsmd, it is *CRITICALLY IMPORTANT* # that if your OTP users can authenticate to multiple RADIUS # servers, this must be "yes" for the primary/default server, # and "no" for the others. This is because lsmd does not # share state information across multiple servers. Using "yes" # on all your RADIUS servers would allow replay attacks! # Also, for event based tokens, the user will be out of sync # on the "other" servers. In order to use "yes" on all your # servers, you must either use gsmd, which synchronizes state # globally, or implement your own state synchronization method. # (default: yes) #allow_sync = yes # If both allow_async and allow_sync are "yes", a challenge is # always presented to the user. This is incompatible with NAS's # that can't present or don't handle Access-Challenge's, e.g. # PPTP servers. Even though a challenge is presented, the user # can still enter their synchronous passcode. # The following are MPPE settings. Note that MS-CHAP (v1) is # strongly discouraged. All possible values are listed as # {value = meaning}. Default values are first. #mschapv2_mppe = {2 = required, 1 = optional, 0 = forbidden} #mschapv2_mppe_bits = {2 = 128, 1 = 128 or 40, 0 = 40} #mschap_mppe = {2 = required, 1 = optional, 0 = forbidden} #mschap_mppe_bits = {2 = 128} } freeradius-server/raddb/modules/pam000066400000000000000000000012021257552170400177420ustar00rootroot00000000000000# -*- text -*- # # $Id$ # Pluggable Authentication Modules # # For Linux, see: # http://www.kernel.org/pub/linux/libs/pam/index.html # # WARNING: On many systems, the system PAM libraries have # memory leaks! We STRONGLY SUGGEST that you do not # use PAM for authentication, due to those memory leaks. # pam { # # The name to use for PAM authentication. # PAM looks in /etc/pam.d/${pam_auth_name} # for it's configuration. See 'redhat/radiusd-pam' # for a sample PAM configuration file. # # Note that any Pam-Auth attribute set in the 'authorize' # section will over-ride this one. # pam_auth = radiusd } freeradius-server/raddb/modules/pap000066400000000000000000000012671257552170400177600ustar00rootroot00000000000000# -*- text -*- # # $Id$ # PAP module to authenticate users based on their stored password # # Supports multiple encryption/hash schemes. See "man rlm_pap" # for details. # # The "auto_header" configuration item can be set to "yes". # In this case, the module will look inside of the User-Password # attribute for the headers {crypt}, {clear}, etc., and will # automatically create the attribute on the right-hand side, # with the correct value. It will also automatically handle # Base-64 encoded data, hex strings, and binary data. # # For instructions on creating the various types of passwords, see: # # http://www.openldap.org/faq/data/cache/347.html pap { auto_header = no } freeradius-server/raddb/modules/passwd000066400000000000000000000033371257552170400205010ustar00rootroot00000000000000# -*- text -*- # # $Id$ # passwd module allows to do authorization via any passwd-like # file and to extract any attributes from these files. # # See the "smbpasswd" and "etc_group" files for more examples. # # parameters are: # filename - path to filename # # format - format for filename record. This parameters # correlates record in the passwd file and RADIUS # attributes. # # Field marked as '*' is a key field. That is, the parameter # with this name from the request is used to search for # the record from passwd file # # Attributes marked as '=' are added to reply_items instead # of default configure_itmes # # Attributes marked as '~' are added to request_items # # Field marked as ',' may contain a comma separated list # of attributes. # # hashsize - hashtable size. Setting it to 0 is no longer permitted # A future version of the server will have the module # automatically determine the hash size. Having it set # manually should not be necessary. # # allowmultiplekeys - if many records for a key are allowed # # ignorenislike - ignore NIS-related records # # delimiter - symbol to use as a field separator in passwd file, # for format ':' symbol is always used. '\0', '\n' are # not allowed # # An example configuration for using /etc/passwd. # # This is an example which will NOT WORK if you have shadow passwords, # NIS, etc. The "unix" module is normally responsible for reading # system passwords. You should use it instead of this example. # passwd etc_passwd { filename = /etc/passwd format = "*User-Name:Crypt-Password:" hashsize = 100 ignorenislike = no allowmultiplekeys = no } freeradius-server/raddb/modules/perl000066400000000000000000000030631257552170400201360ustar00rootroot00000000000000# -*- text -*- # # $Id$ # Persistent, embedded Perl interpreter. # perl { # # The Perl script to execute on authorize, authenticate, # accounting, xlat, etc. This is very similar to using # 'rlm_exec' module, but it is persistent, and therefore # faster. # module = ${confdir}/example.pl # # The following hashes are given to the module and # filled with value-pairs (Attribute names and values) # # %RAD_CHECK Check items # %RAD_REQUEST Attributes from the request # %RAD_REPLY Attributes for the reply # # The return codes from functions in the perl_script # are passed directly back to the server. These # codes are defined in doc/configurable_failover, # src/include/modules.h (RLM_MODULE_REJECT, etc), # and are pre-defined in the 'example.pl' program # which is included. # # # List of functions in the module to call. # Uncomment and change if you want to use function # names other than the defaults. # #func_authenticate = authenticate #func_authorize = authorize #func_preacct = preacct #func_accounting = accounting #func_checksimul = checksimul #func_pre_proxy = pre_proxy #func_post_proxy = post_proxy #func_post_auth = post_auth #func_recv_coa = recv_coa #func_send_coa = send_coa #func_xlat = xlat #func_detach = detach # # Uncomment the following lines if you wish # to use separate functions for Start and Stop # accounting packets. In that case, the # func_accounting function is not called. # #func_start_accounting = accounting_start #func_stop_accounting = accounting_stop } freeradius-server/raddb/modules/policy000066400000000000000000000010571257552170400204740ustar00rootroot00000000000000# -*- text -*- # # $Id$ # # Module implementing a DIFFERENT policy language. # The syntax here is NOT "unlang", but something else. # # See the "raddb/policy.txt" file for documentation and examples. # There isn't much else in the way of documentation, sorry. # policy { # The only configuration item is a filename containing # the policies to execute. # # When "policy" is listed in a section (e.g. "authorize"), # it will run a policy named for that section. # filename = ${confdir}/policy.txt } freeradius-server/raddb/modules/preprocess000066400000000000000000000031751257552170400213650ustar00rootroot00000000000000# -*- text -*- # # $Id$ # Preprocess the incoming RADIUS request, before handing it off # to other modules. # # This module processes the 'huntgroups' and 'hints' files. # In addition, it re-writes some weird attributes created # by some NASes, and converts the attributes into a form which # is a little more standard. # preprocess { huntgroups = ${confdir}/huntgroups hints = ${confdir}/hints # This hack changes Ascend's wierd port numberings # to standard 0-??? port numbers so that the "+" works # for IP address assignments. with_ascend_hack = no ascend_channels_per_line = 23 # Windows NT machines often authenticate themselves as # NT_DOMAIN\username # # If this is set to 'yes', then the NT_DOMAIN portion # of the user-name is silently discarded. # # This configuration entry SHOULD NOT be used. # See the "realms" module for a better way to handle # NT domains. with_ntdomain_hack = no # Specialix Jetstream 8500 24 port access server. # # If the user name is 10 characters or longer, a "/" # and the excess characters after the 10th are # appended to the user name. # # If you're not running that NAS, you don't need # this hack. with_specialix_jetstream_hack = no # Cisco (and Quintum in Cisco mode) sends it's VSA attributes # with the attribute name *again* in the string, like: # # H323-Attribute = "h323-attribute=value". # # If this configuration item is set to 'yes', then # the redundant data in the the attribute text is stripped # out. The result is: # # H323-Attribute = "value" # # If you're not running a Cisco or Quintum NAS, you don't # need this hack. with_cisco_vsa_hack = no } freeradius-server/raddb/modules/radrelay000066400000000000000000000010211257552170400207670ustar00rootroot00000000000000# -*- text -*- # # $Id$ # Write "detail" files which can be read by radrelay. # This module should be used only by a server which receives # Accounting-Request packets from the network. # # It should NOT be used in the radrelay.conf file. # # Use it by adding "radrelay" to the "accounting" section: # # accounting { # ... # radrelay # ... # } # detail radrelay { detailfile = ${radacctdir}/detail locking = yes # The other directives from the main detail module # can be used here, but they're not required. } freeradius-server/raddb/modules/radutmp000066400000000000000000000027461257552170400206570ustar00rootroot00000000000000# -*- text -*- # # $Id$ # Write a 'utmp' style file, of which users are currently # logged in, and where they've logged in from. # # This file is used mainly for Simultaneous-Use checking, # and also 'radwho', to see who's currently logged in. # radutmp { # Where the file is stored. It's not a log file, # so it doesn't need rotating. # filename = ${logdir}/radutmp # The field in the packet to key on for the # 'user' name, If you have other fields which you want # to use to key on to control Simultaneous-Use, # then you can use them here. # # Note, however, that the size of the field in the # 'utmp' data structure is small, around 32 # characters, so that will limit the possible choices # of keys. # # You may want instead: %{Stripped-User-Name:-%{User-Name}} username = %{User-Name} # Whether or not we want to treat "user" the same # as "USER", or "User". Some systems have problems # with case sensitivity, so this should be set to # 'no' to enable the comparisons of the key attribute # to be case insensitive. # case_sensitive = yes # Accounting information may be lost, so the user MAY # have logged off of the NAS, but we haven't noticed. # If so, we can verify this information with the NAS, # # If we want to believe the 'utmp' file, then this # configuration entry can be set to 'no'. # check_with_nas = yes # Set the file permissions, as the contents of this file # are usually private. perm = 0600 callerid = "yes" } freeradius-server/raddb/modules/realm000066400000000000000000000015171257552170400202760ustar00rootroot00000000000000# -*- text -*- # # $Id$ # Realm module, for proxying. # # You can have multiple instances of the realm module to # support multiple realm syntaxs at the same time. The # search order is defined by the order that the modules are listed # in the authorize and preacct sections. # # Four config options: # format - must be "prefix" or "suffix" # The special cases of "DEFAULT" # and "NULL" are allowed, too. # delimiter - must be a single character # 'realm/username' # # Using this entry, IPASS users have their realm set to "IPASS". realm IPASS { format = prefix delimiter = "/" } # 'username@realm' # realm suffix { format = suffix delimiter = "@" } # 'username%realm' # realm realmpercent { format = suffix delimiter = "%" } # # 'domain\user' # realm ntdomain { format = prefix delimiter = "\\" } freeradius-server/raddb/modules/redis000066400000000000000000000015101257552170400202750ustar00rootroot00000000000000# -*- text -*- # # $Id$ # # Configuration file for the "redis" module. This module does nothing # Other than provide connections to a redis database, and a %{redis: ...} # expansion. # redis { # Host where the redis server is located. # We recommend using ONLY 127.0.0.1 ! hostname = 127.0.0.1 # The default port. port = 6379 # The password used to authenticate to the server. # We recommend using a strong password. # password = thisisreallysecretandhardtoguess # The number of connections to open to the database. num_connections = 20 # If a connection fails, retry after this time. connect_failure_retry_delay = 60 # Set the maximum lifetime for one connection. # Use 0 for "lives forever" lifetime = 86400 # Set the maximum queries used for one connection. # Use 0 for "no limit" max_queries = 0 }freeradius-server/raddb/modules/rediswho000066400000000000000000000025631257552170400210240ustar00rootroot00000000000000# -*- text -*- # # $Id$ # # Configuration file for the "rediswho" module. # rediswho { # How many sessions to keep track of per user. # If there are more than this number, older sessions are deleted. trim-count = 15 # Expiry time in seconds. Any sessions which have not received # an update in this time will be automatically expired. expire-time = 86400 start-insert = "LPUSH %{User-Name} %l,%{Acct-Session-Id},%{NAS-IP-Address},%{Acct-Session-Time},%{Framed-IP-Address},%{%{Acct-Input-Gigawords}:-0},%{%{Acct-Output-Gigawords}:-0},%{%{Acct-Input-Octets}:-0},%{%{Acct-Output-Octets}:-0}" start-trim = "LTRIM %{User-Name} 0 ${trim-count}" start-expire = "EXPIRE %{User-Name} ${expire-time}" alive-insert = "LPUSH %{User-Name} %l,%{Acct-Session-Id},%{NAS-IP-Address},%{Acct-Session-Time},%{Framed-IP-Address},%{%{Acct-Input-Gigawords}:-0},%{%{Acct-Output-Gigawords}:-0},%{%{Acct-Input-Octets}:-0},%{%{Acct-Output-Octets}:-0}" alive-trim = "LTRIM %{User-Name} 0 ${trim-count}" alive-expire = "EXPIRE %{User-Name} ${expire-time}" stop-insert = "LPUSH %{User-Name} %l,%{Acct-Session-Id},%{NAS-IP-Address},%{Acct-Session-Time},%{Framed-IP-Address},%{%{Acct-Input-Gigawords}:-0},%{%{Acct-Output-Gigawords}:-0},%{%{Acct-Input-Octets}:-0},%{%{Acct-Output-Octets}:-0}" stop-trim = "LTRIM %{User-Name} 0 ${trim-count}" stop-expire = "EXPIRE %{User-Name} ${expire-time}" } freeradius-server/raddb/modules/replicate000066400000000000000000000032371257552170400211470ustar00rootroot00000000000000# Replicate packet(s) to a home server. # # This module will open a new socket for each packet, and "clone" # the incoming packet to the destination realm (i.e. home server). # # Use it by setting "Replicate-To-Realm = name" in the control list, # just like Proxy-To-Realm. The configurations for the two attributes # are identical. The realm must exist, the home_server_pool must exist, # and the home_server must exist. # # The only difference is that the "replicate" module sends requests # and does not expect a reply. Any reply is ignored. # # Both Replicate-To-Realm and Proxy-To-Realm can be used at the same time. # # To use this module, list "replicate" in the "authorize" or # "accounting" section. Then, ensure that Replicate-To-Realm is set. # The contents of the "packet" attribute list will be sent to the # home server. The usual load-balancing, etc. features of the home # server will be used. # # "radmin" can be used to mark home servers alive/dead, in order to # enable/disable replication to specific servers. # # Packets can be replicated to multiple destinations. Just set # Replicate-To-Realm multiple times. One packet will be sent for # each of the Replicate-To-Realm attribute in the "control" list. # # If no packets are sent, the module returns "noop". If at least one # packet is sent, the module returns "ok". If an error occurs, the # module returns "fail" # # Note that replication does NOT change any of the packet statistics. # If you use "radmin" to look at the statistics for a home server, # the replicated packets will cause NO counters to increment. This # is not a bug, this is how replication works. # replicate { } freeradius-server/raddb/modules/smbpasswd000066400000000000000000000005421257552170400211760ustar00rootroot00000000000000# -*- text -*- # # $Id$ # An example configuration for using /etc/smbpasswd. # # See the "passwd" file for documentation on the configuration items # for this module. # passwd smbpasswd { filename = /etc/smbpasswd format = "*User-Name::LM-Password:NT-Password:SMB-Account-CTRL-TEXT::" hashsize = 100 ignorenislike = no allowmultiplekeys = no } freeradius-server/raddb/modules/smsotp000066400000000000000000000023201257552170400205140ustar00rootroot00000000000000# -*- text -*- # # $Id$ # SMS One-time Password system. # # This module will extend FreeRadius with a socks interface to create and # validate One-Time-Passwords. The program for that creates the socket # and interacts with this module is not included here. # # The module does not check the User-Password, this should be done with # the "pap" module. See the example below. # # The module must be used in the "authorize" section to set # Auth-Type properly. The first time through, the module is called # in the "authenticate" section to authenticate the user password, and # to send the challenge. The second time through, it authenticates # the response to the challenge. e.g.: # # authorize { # ... # smsotp # ... # } # # authenticate { # ... # Auth-Type smsotp { # pap # smsotp # } # # Auth-Type smsotp-reply { # smsotp # } # ... # } # smsotp { # The location of the socket. socket = "/var/run/smsotp_socket" # Defines the challenge message that will be send to the # NAS. Default is "Enter Mobile PIN" } challenge_message = "Enter Mobile PIN:" # Defines the Auth-Type section that is run for the response to # the challenge. Default is "smsotp-reply". challenge_type = "smsotp-reply" } freeradius-server/raddb/modules/soh000066400000000000000000000000411257552170400177560ustar00rootroot00000000000000# SoH module soh { dhcp = yes } freeradius-server/raddb/modules/sql_log000066400000000000000000000067031257552170400206400ustar00rootroot00000000000000# -*- text -*- # # $Id$ # # The rlm_sql_log module appends the SQL queries in a log # file which is read later by the radsqlrelay program. # # This module only performs the dynamic expansion of the # variables found in the SQL statements. No operation is # executed on the database server. (this could be done # later by an external program) That means the module is # useful only with non-"SELECT" statements. # # See rlm_sql_log(5) manpage. # # This same functionality could also be implemented by logging # to a "detail" file, reading that, and then writing to SQL. # See raddb/sites-available/buffered-sql for an example. # sql_log { path = "${radacctdir}/sql-relay" acct_table = "radacct" postauth_table = "radpostauth" sql_user_name = "%{%{User-Name}:-DEFAULT}" # # Setting this to "yes" will allow UTF-8 characters to be # written to the log file. Otherwise, they are escaped # as being potentially invalid. # utf8 = no # # The names here are taken from the Acct-Status-Type names. # Just add another entry here for Accounting-On, # Accounting-Off, etc. # Start = "INSERT INTO ${acct_table} (AcctSessionId, UserName, \ NASIPAddress, FramedIPAddress, AcctStartTime, AcctStopTime, \ AcctSessionTime, AcctTerminateCause) VALUES \ ('%{Acct-Session-Id}', '%{User-Name}', '%{NAS-IP-Address}', \ '%{Framed-IP-Address}', '%S', '0', '0', '');" Stop = "INSERT INTO ${acct_table} (AcctSessionId, UserName, \ NASIPAddress, FramedIPAddress, AcctStartTime, AcctStopTime, \ AcctSessionTime, AcctTerminateCause) VALUES \ ('%{Acct-Session-Id}', '%{User-Name}', '%{NAS-IP-Address}', \ '%{Framed-IP-Address}', '0', '%S', '%{Acct-Session-Time}', \ '%{Acct-Terminate-Cause}');" Alive = "INSERT INTO ${acct_table} (AcctSessionId, UserName, \ NASIPAddress, FramedIPAddress, AcctStartTime, AcctStopTime, \ AcctSessionTime, AcctTerminateCause) VALUES \ ('%{Acct-Session-Id}', '%{User-Name}', '%{NAS-IP-Address}', \ '%{Framed-IP-Address}', '0', '0', '%{Acct-Session-Time}','');" # The same as "Alive" Interim-Update = "INSERT INTO ${acct_table} (AcctSessionId, UserName, \ NASIPAddress, FramedIPAddress, AcctStartTime, AcctStopTime, \ AcctSessionTime, AcctTerminateCause) VALUES \ ('%{Acct-Session-Id}', '%{User-Name}', '%{NAS-IP-Address}', \ '%{Framed-IP-Address}', '0', '0', '%{Acct-Session-Time}','');" Post-Auth = "INSERT INTO ${postauth_table} \ (username, pass, reply, authdate) VALUES \ ('%{User-Name}', '%{User-Password:-Chap-Password}', \ '%{reply:Packet-Type}', '%S');" Accounting-On = "UPDATE ${acct_table} \ SET \ acctstoptime = '%S', \ acctsessiontime = unix_timestamp('%S') - \ unix_timestamp(acctstarttime), \ acctterminatecause = '%{Acct-Terminate-Cause}', \ acctstopdelay = %{%{Acct-Delay-Time}:-0} \ WHERE acctstoptime IS NULL \ AND nasipaddress = '%{NAS-IP-Address}' \ AND acctstarttime <= '%S'"" Accounting-Off = "UPDATE ${acct_table} \ SET \ acctstoptime = '%S', \ acctsessiontime = unix_timestamp('%S') - \ unix_timestamp(acctstarttime), \ acctterminatecause = '%{Acct-Terminate-Cause}', \ acctstopdelay = %{%{Acct-Delay-Time}:-0} \ WHERE acctstoptime IS NULL \ AND nasipaddress = '%{NAS-IP-Address}' \ AND acctstarttime <= '%S'"" } freeradius-server/raddb/modules/sqlcounter_expire_on_login000066400000000000000000000016561257552170400246410ustar00rootroot00000000000000# -*- text -*- # # $Id$ # # Set an account to expire T seconds after first login. # Requires the Expire-After attribute to be set, in seconds. # You may need to edit raddb/dictionary to add the Expire-After # attribute. # # This example is for MySQL. Other SQL variants should be similar. # # For versions prior to 2.1.11, this module defined the following # expansion strings: # # %k key_name # %S sqlmod_inst # # These SHOULD NOT be used. If these are used in your configuration, # they should be replaced by the following strings, which will work # identically to the previous ones: # # %k ${key} # %S ${sqlmod-inst} # sqlcounter expire_on_login { counter-name = Expire-After-Initial-Login check-name = Expire-After sqlmod-inst = sql key = User-Name reset = never query = "SELECT TIME_TO_SEC(TIMEDIFF(NOW(), acctstarttime)) \ FROM radacct \ WHERE UserName='%{${key}}' \ ORDER BY acctstarttime \ LIMIT 1;" } freeradius-server/raddb/modules/sradutmp000066400000000000000000000006721257552170400210360ustar00rootroot00000000000000# -*- text -*- # # $Id$ # "Safe" radutmp - does not contain caller ID, so it can be # world-readable, and radwho can work for normal users, without # exposing any information that isn't already exposed by who(1). # # This is another 'instance' of the radutmp module, but it is given # then name "sradutmp" to identify it later in the "accounting" # section. radutmp sradutmp { filename = ${logdir}/sradutmp perm = 0644 callerid = "no" } freeradius-server/raddb/modules/unix000066400000000000000000000013121257552170400201520ustar00rootroot00000000000000# -*- text -*- # # $Id$ # Unix /etc/passwd style authentication # # This module calls the system functions to get the "known good" # password. This password is usually in the "crypt" form, and is # incompatible with CHAP, MS-CHAP, PEAP, etc. # # If passwords are in /etc/shadow, you will need to set the "group" # configuration in radiusd.conf. Look for "shadow", and follow the # instructions there. # unix { # # The location of the "wtmp" file. # The only use for 'radlast'. If you don't use # 'radlast', then you can comment out this item. # # Note that the radwtmp file may get large! You should # rotate it (cp /dev/null radwtmp), or just not use it. # radwtmp = ${logdir}/radwtmp } freeradius-server/raddb/modules/wimax000066400000000000000000000067061257552170400203300ustar00rootroot00000000000000# # The WiMAX module currently takes no configuration. # # It should be listed in the "authorize" and "preacct" sections. # This enables the module to fix the horrible binary version # of Calling-Station-Id to the normal format, as specified in # RFC 3580, Section 3.21. # # In order to calculate the various WiMAX keys, the module should # be listed in the "post-auth" section. If EAP authentication # has been used, AND the EAP method derives MSK and EMSK, then # the various WiMAX keys can be calculated. # # Some useful things to remember: # # WiMAX-MSK = EAP MSK, but is 64 octets. # # MIP-RK-1 = HMAC-SHA256(ESMK, "miprk@wimaxforum.org" | 0x00020001) # MIP-RK-2 = HMAC-SHA256(ESMK, MIP-RK-1 | "miprk@wimaxforum.org" | 0x00020002) # MIP-RK = MIP-RK-1 | MIP-RK-2 # # MIP-SPI = first 4 octets of HMAC-SHA256(MIP-RK, "SPI CMIP PMIP") # plus some magic... you've got to track *all* MIP-SPI's # on your system! # # SPI-CMIP4 = MIP-SPI # SPI-PMIP4 = MIP-SPI + 1 # SPI-CMIP6 = MIP-SPI + 2 # # MN-NAI is the Mobile node NAI. You have to create it, and put # it into the request or reply as something like: # # WiMAX-MN-NAI = "%{User-Name}" # # You will also have to have the appropriate IP address (v4 or v6) # in order to calculate the keys below. # # Lifetimes are derived from Session-Timeout. It needs to be set # to some useful number. # # The hash function below H() is HMAC-SHA1. # # # MN-HA-CMIP4 = H(MIP-RK, "CMIP4 MN HA" | HA-IPv4 | MN-NAI) # # Where HA-IPv4 is WiMAX-hHA-IP-MIP4 # or maybe WiMAX-vHA-IP-MIP4 # # Which goes into WiMAX-MN-hHA-MIP4-Key # or maybe WiMAX-RRQ-MN-HA-Key # or maybe even WiMAX-vHA-MIP4-Key # # The corresponding SPI is SPI-CMIP4, which is MIP-SPI, # # which goes into WiMAX-MN-hHA-MIP4-SPI # or maybe WiMAX-RRQ-MN-HA-SPI # or even WiMAX-MN-vHA-MIP4-SPI # # MN-HA-PMIP4 = H(MIP-RK, "PMIP4 MN HA" | HA-IPv4 | MN-NAI) # MN-HA-CMIP6 = H(MIP-RK, "CMIP6 MN HA" | HA-IPv6 | MN-NAI) # # both with similar comments to above for MN-HA-CMIP4. # # In order to tell which one to use (CMIP4, PMIP4, or CMIP6), # you have to set WiMAX-IP-Technology in the reply to one of # the appropriate values. # # # FA-RK = H(MIP-RK, "FA-RK") # # MN-FA = H(FA-RK, "MN FA" | FA-IP | MN-NAI) # # Where does the FA-IP come from? No idea... # # # The next two keys (HA-RK and FA-HA) are not generated # for every authentication request, but only on demand. # # HA-RK = 160-bit random number assigned by the AAA server # to a specific HA. # # FA-HA = H(HA-RK, "FA-HA" | HA-IPv4 | FA-CoAv4 | SPI) # # where HA-IPv4 is as above. # and FA-CoAv4 address of the FA as seen by the HA # and SPI is the relevant SPI for the HA-RK. # # DHCP-RK = 160-bit random number assigned by the AAA server # to a specific DHCP server. vDHCP-RK is the same # thing. # wimax { # # Some WiMAX equipement requires that the MS-MPPE-*-Key # attributes are sent in the Access-Accept, in addition to # the WiMAX-MSK attribute. # # Other WiMAX equipment request that the MS-MPPE-*-Key # attributes are NOT sent in the Access-Accept. # # By default, the EAP modules sends MS-MPPE-*-Key attributes. # The default virtual server (raddb/sites-available/default) # contains examples of adding the WiMAX-MSK. # # This configuration option makes the WiMAX module delete # the MS-MPPE-*-Key attributes. The default is to leave # them in place. # # If the keys are deleted (by setting this to "yes"), then # the WiMAX-MSK attribute is automatically added to the reply. delete_mppe_keys = no } freeradius-server/raddb/panic.gdb000066400000000000000000000000641257552170400173470ustar00rootroot00000000000000info locals info args thread apply all bt full quit freeradius-server/raddb/policy.conf000066400000000000000000000143361257552170400177540ustar00rootroot00000000000000# -*- text -*- ## ## policy.conf -- FreeRADIUS server configuration file. ## ## http://www.freeradius.org/ ## $Id$ ## # # Policies are virtual modules, similar to those defined in the # "instantate" section of radiusd.conf. # # Defining a policy here means that it can be referenced in multiple # places as a *name*, rather than as a series of conditions to match, # and actions to take. # # Policies are something like subroutines in a normal language, but # they cannot be called recursively. They MUST be defined in order. # If policy A calls policy B, then B MUST be defined before A. # policy { # # Forbid all EAP types. # forbid_eap { if (EAP-Message) { reject } } # # Forbid all non-EAP types outside of an EAP tunnel. # permit_only_eap { if (!EAP-Message) { # We MAY be inside of a TTLS tunnel. # PEAP and EAP-FAST require EAP inside of # the tunnel, so this check is OK. # If so, then there MUST be an outer EAP message. if (!"%{outer.request:EAP-Message}") { reject } } } # # Forbid all attempts to login via realms. # deny_realms { if (User-Name =~ /@|\\/) { reject } } # # If you want the server to pretend that it is dead, # then use the "do_not_respond" policy. # do_not_respond { update control { Response-Packet-Type := Do-Not-Respond } handled } # # Force some sanity on User-Name. This helps to avoid issues # issues where the back-end database is "forgiving" about # what constitutes a user name. # filter_username { # # reject mixed case # e.g. "UseRNaMe" # #if (User-Name != "%{tolower:%{User-Name}}") { # reject #} # # reject all whitespace # e.g. "user@ site.com", or "us er", or " user", or "user " # if (User-Name =~ / /) { update reply { Reply-Message += "Rejected: Username contains whitespace" } reject } # # reject Multiple @'s # e.g. "user@site.com@site.com" # if(User-Name =~ /@.*@/ ) { update reply { Reply-Message += "Rejected: Multiple @ in username" } reject } # # reject double dots # e.g. "user@site..com" # if (User-Name =~ /\\.\\./ ) { update reply { Reply-Message += "Rejected: Username comtains ..s" } reject } # # must have at least 1 string-dot-string after @ # e.g. "user@site.com" # if (User-Name !~ /@(.+)\\.(.+)$/) { update reply { Reply-Message += "Rejected: Realm does not have at least one dot seperator" } reject } # # Realm ends with a dot # e.g. "user@site.com." # if (User-Name =~ /\\.$/) { update reply { Reply-Message += "Rejected: Realm ends with a dot" } reject } # # Realm begins with a dot # e.g. "user@.site.com" # if (User-Name =~ /@\\./) { update reply { Reply-Message += "Rejected: Realm begins with a dot" } reject } } # # The following policies are for the Chargeable-User-Identity # (CUI) configuration. # # # The client indicates it can do CUI by sending a CUI attribute # containing one zero byte # cui_authorize { update request { Chargeable-User-Identity:='\\000' } } # # Add a CUI attribute based on the User-Name, and a secret key # known only to this server. # cui_postauth { if (FreeRadius-Proxied-To == 127.0.0.1) { if (outer.request:Chargeable-User-Identity) { update outer.reply { Chargeable-User-Identity:="%{md5:%{config:cui_hash_key}%{User-Name}}" } } } else { if (Chargeable-User-Identity) { update reply { Chargeable-User-Identity="%{md5:%{config:cui_hash_key}%{User-Name}}" } } } } # # If there is a CUI attribute in the reply, add it to the DB. # cui_updatedb { if (reply:Chargeable-User-Identity) { cui } } # # If we had stored a CUI for the User, add it to the request. # cui_accounting { # # If the CUI isn't in the packet, see if we can find it # in the DB. # if (!Chargeable-User-Identity) { update request { Chargeable-User-Identity := "%{cui: SELECT cui FROM cui WHERE clientipaddress = '%{Client-IP-Address}' AND callingstationid = '%{Calling-Station-Id}' AND username = '%{User-Name}'}" } } # # If it exists now, then write out when we last saw # this CUI. # if (Chargeable-User-Identity && (Chargeable-User-Identity != "")) { cui } } # # Normalize the MAC Addresses in the Calling/Called-Station-Id # mac-addr = ([0-9a-f]{2})[^0-9a-f]?([0-9a-f]{2})[^0-9a-f]?([0-9a-f]{2})[^0-9a-f]?([0-9a-f]{2})[^0-9a-f]?([0-9a-f]{2})[^0-9a-f]?([0-9a-f]{2}) # Add "rewrite.called_station_id" in the "authorize" and "preacct" # sections. rewrite.called_station_id { if((Called-Station-Id) && "%{Called-Station-Id}" =~ /^%{config:policy.mac-addr}(:(.+))?$/i) { update request { Called-Station-Id := "%{tolower:%{1}-%{2}-%{3}-%{4}-%{5}-%{6}}" } # SSID component? if ("%{8}") { update request { Called-Station-Id := "%{Called-Station-Id}:%{8}" } } updated } else { noop } } # Add "rewrite.calling_station_id" in the "authorize" and "preacct" # sections. rewrite.calling_station_id { if((Calling-Station-Id) && "%{Calling-Station-Id}" =~ /^%{config:policy.mac-addr}$/i) { update request { Calling-Station-Id := "%{tolower:%{1}-%{2}-%{3}-%{4}-%{5}-%{6}}" } updated } else { noop } } # Assign compatibility data to request for sqlippool dhcp_sqlippool.post-auth { # Do some minor hacks to the request so that it looks # like a RADIUS request to the SQL IP Pool module. update request { User-Name = "DHCP-%{DHCP-Client-Hardware-Address}" Calling-Station-Id = "%{DHCP-Client-Hardware-Address}" NAS-IP-Address = "%{%{DHCP-Gateway-IP-Address}:-127.0.0.1}" Acct-Status-Type = Start } # Call the actual module # # Uncomment this in order to really call it! # dhcp_sqlippool fail # Convert Framed-IP-Address to DHCP, but only if we # actually allocated an address. if (ok) { update reply { DHCP-Your-IP-Address = "%{reply:Framed-IP-Address}" } } } } freeradius-server/raddb/policy.txt000077500000000000000000000114111257552170400176400ustar00rootroot00000000000000# # Sample of a policy language for rlm_policy. # # This is NOT the "unlang" policy, and has NO RELATION to "unlang"! # The syntax is different, and the functionality is different. # # As of 2.0.0, the new configuration "un-language" is better # tested, has more features, and is better integrated into the # server than the rlm_policy module. rlm_policy is deprecated, # and will likely be removed in a future release. # # There is no documentation other than this file. # # The syntax is odd, but it sort of works. # # A number of sites are using it in production servers, # so it appears to be stable. However, we cannot answer # questions about it, because we use "unlang", instead of # this file. # # $Id$ # # Debugging statements # #debug print_tokens # as we're parsing this file debug print_policy # once the file has been parsed # Using this requires code edits to rlm_policy/evaluate.c #debug evaluate # print limited information during evaluation # # A named policy. # policy 3pm { if (Time-Of-Day < "15:00") { # # The general form of edits to the attribute lists: # # name s-operator { # Attribute-Name = Value # } # # name is: request, reply, control, proxy-request, proxy-reply # # s-operator is operator for section, not attributes: # # = append, using operators from attributes # .= append attributes, ignoring operators from attributes # ^= add to head of list # ^== add BEFORE matching attribute # ^. append # ^.= append BEFORE matching attribute # $= add AFTER (same as =) # $== add AFTER matching attribute # $. add after (same as .=) # $.= add after matching # # If the above explanation confuses you, don't ask. Try various # configurations to see what happens. The results are difficult # to explain, but easy to understand once you see them in action. # # The "matching attribute" text above refers to the syntax: # # name s-operator (match) { # Attribute-Name = Value # } # # Where "match" is something like: User-Name == "bob" # # This lets you insert/edit/update attributes by selected # position, which can be useful. # reply .= { # Use ARAP-Password for testing because it's an attribute # no one cares about. ARAP-Password = "< 15:00" } } } # # A named policy, executed during the "authorize" phase, # because it's named "authorize". # policy authorize { if (CHAP-Password) { if (!CHAP-Challenge) { print "Adding CHAP-Challenge = %{request:Packet-Authentication-Vector}\n" # # Append all attributes to the specified list. # The per-attribute operators MUST be '=' # request .= { CHAP-Challenge = "%{request:Packet-Authentication-Vector}" } } # # Use per-attribute operators to do override, replace, etc. # It's "control", not "check items", because "check items" # is a hold-over from the "users" file, and we no longer like that. # control = { Auth-Type := CHAP } } # # This could just as well be "%{ldap: query...}" =~ ... # # if ("%{User-Name}" =~ "^(b)") { # reply .= { # Arap-Password = "Hello, %{1}" # } # } # # Execute "3pm", as if it was in-line here. # # call 3pm } ###################################################################### # # The following entries are for example purposes only. # # Insert the attribute at the top of the list. # #reply ^= { # Attribute1 += "Value1" #} # Insert attribute1 before Attribute2 if found, otherwise it behaves # like ^= #reply ^== ( Attribute2 == "Value2" ) { # Attribute1 += "Value1" #} # ^. and ^.= have the same difference as .= and = # namely they append the attribute list instead of looking at the # attribute operators. # # Otherwise they are the same. # Motivation: # # Cisco NAS's will kick users who assign a VRF after assigning an IP # address. The VRF must come first. # # A sample policy to fix this is: # policy add_inter_vrf { # # If there's a matching lcp:..., # then add the vrf entry before it. # reply ^== ( reply:Cisco-Avpair =~ "lcp:interface-config") { Cisco-Avpair += "lcp:interface-config=ip vrf forwarding CHL-PRIVATE" } # # If there's no ip address thingy, # add ip unnumbered after the vrf stuff. # if (!reply:Cisco-Avpair =~ "lcp:interface-config=ip address.*") { reply $== (reply:Cisco-AVpair == "lcp:interface-config=ip vrf forwarding CHL-PRIVATE") { Cisco-Avpair += "lcp:interface-config=ip unnumbered l10" } } # # No IP address assigned through RADIUS, tell the Cisco # NAS to assign it from it's own private IP pool. # if (!reply:Framed-IP-Address =* "") { reply = { Cisco-Avpair += "ip:addr-pool=privatepool" } } } freeradius-server/raddb/preproxy_users000066400000000000000000000017301257552170400206340ustar00rootroot00000000000000# # Configuration file for the rlm_files module. # Please see rlm_files(5) manpage for more information. # # $Id$ # # This file is similar to the "users" file. The check items # are compared against the request, but the "reply" items are # used to update the proxied packet, not the reply to the NAS. # # You can use this file to re-write requests which are about to # be sent to a home server. # # # Requests destinated to realm "extisp" are sent to a RADIUS # home server hosted by an other company which doesn't know about # the IP addresses of our NASes. Therefore we replace the value of # the NAS-IP-Address attribute by a unique value we communicated # to them. # #DEFAULT Realm == "extisp" # NAS-IP-Address := 10.1.2.3 # # For all proxied packets, set the User-Name in the proxied packet # to the Stripped-User-Name, if it exists. If not, set it to the # User-Name from the original request. # #DEFAULT # User-Name := `%{Stripped-User-Name:-%{User-Name}}` freeradius-server/raddb/proxy.conf000066400000000000000000000643731257552170400176440ustar00rootroot00000000000000# -*- text -*- ## ## proxy.conf -- proxy radius and realm configuration directives ## ## $Id$ ####################################################################### # # Proxy server configuration # # This entry controls the servers behaviour towards ALL other servers # to which it sends proxy requests. # proxy server { # # Note that as of 2.0, the "synchronous", "retry_delay", # "retry_count", and "dead_time" have all been deprecated. # For backwards compatibility, they are are still accepted # by the server, but they ONLY apply to the old-style realm # configuration. i.e. realms with "authhost" and/or "accthost" # entries. # # i.e. "retry_delay" and "retry_count" have been replaced # with per-home-server configuration. See the "home_server" # example below for details. # # i.e. "dead_time" has been replaced with a per-home-server # "revive_interval". We strongly recommend that this not # be used, however. The new method is much better. # # In 2.0, the server is always "synchronous", and setting # "synchronous = no" is impossible. This simplifies the # server and increases the stability of the network. # However, it means that the server (i.e. proxy) NEVER # originates packets. It proxies packets ONLY when it receives # a packet or a re-transmission from the NAS. If the NAS never # re-transmits, the proxy never re-transmits, either. This can # affect fail-over, where a packet does *not* fail over to a # second home server.. because the NAS never retransmits the # packet. # # If you need to set "synchronous = no", please send a # message to the list # explaining why this feature is vital for your network. # # If a realm exists, but there are no live home servers for # it, we can fall back to using the "DEFAULT" realm. This is # most useful for accounting, where the server can proxy # accounting requests to home servers, but if they're down, # use a DEFAULT realm that is LOCAL (i.e. accthost = LOCAL), # and then store the packets in the "detail" file. That data # can be later proxied to the home servers by radrelay, when # those home servers come back up again. # Setting this to "yes" may have issues for authentication. # i.e. If you are proxying for two different ISP's, and then # act as a general dial-up for Gric. If one of the first two # ISP's has their RADIUS server go down, you do NOT want to # proxy those requests to GRIC. Instead, you probably want # to just drop the requests on the floor. In that case, set # this value to 'no'. # # allowed values: {yes, no} # default_fallback = no } ####################################################################### # # Configuration for the proxy realms. # # As of 2.0. the old-style "realms" file is deprecated, and is not # used by FreeRADIUS. # # As of 2.0, the "realm" configuration has changed. Instead of # specifying "authhost" and "accthost" in a realm section, the home # servers are specified seperately in a "home_server" section. For # backwards compatibility, you can still use the "authhost" and # "accthost" directives. If you only have one home server for a # realm, it is easier to use the old-style configuration. # # However, if you have multiple servers for a realm, we STRONGLY # suggest moving to the new-style configuration. # # # Load-balancing and failover between home servers is handled via # a "home_server_pool" section. # # Finally, The "realm" section defines the realm, some options, and # indicates which server pool should be used for the realm. # # This change means that simple configurations now require multiple # sections to define a realm. However, complex configurations # are much simpler than before, as multiple realms can share the same # server pool. # # That is, realms point to server pools, and server pools point to # home servers. Multiple realms can point to one server pool. One # server pool can point to multiple home servers. Each home server # can appear in one or more pools. # ###################################################################### # # This section defines a "Home Server" which is another RADIUS # server that gets sent proxied requests. In earlier versions # of FreeRADIUS, home servers were defined in "realm" sections, # which was awkward. In 2.0, they have been made independent # from realms, which is better for a number of reasons. # home_server localhost { # # Home servers can be sent Access-Request packets # or Accounting-Request packets. # # Allowed values are: # auth - Handles Access-Request packets # acct - Handles Accounting-Request packets # auth+acct - Handles Access-Request packets at "port", # and Accounting-Request packets at "port + 1" # coa - Handles CoA-Request and Disconnect-Request packets. # See also raddb/sites-available/originate-coa type = auth # # Configure ONE OF the following entries: # # IPv4 address # ipaddr = 127.0.0.1 # OR IPv6 address # ipv6addr = ::1 # OR virtual server # virtual_server = foo # Note that while both ipaddr and ipv6addr will accept # both addresses and host names, we do NOT recommend # using host names. When you specify a host name, the # server has to do a DNS lookup to find the IP address # of the home server. If the DNS server is slow or # unresponsive, it means that FreeRADIUS will NOT be # able to determine the address, and will therefore NOT # start. # # Also, the mapping of host name to address is done ONCE # when the server starts. If DNS is later updated to # change the address, FreeRADIUS will NOT discover that # until after a re-start, or a HUP. # # If you specify a virtual_server here, then requests # will be proxied internally to that virtual server. # These requests CANNOT be proxied again, however. The # intent is to have the local server handle packets # when all home servers are dead. # # Requests proxied to a virtual server will be passed # through the pre-proxy and post-proxy sections, just # like any other request. See also the sample "realm" # configuration, below. # # None of the rest of the home_server configuration is used # for the "virtual_server" configuration. # # The port to which packets are sent. # # Usually 1812 for type "auth", and 1813 for type "acct". # Older servers may use 1645 and 1646. # Use 3799 for type "coa" # port = 1812 # # The shared secret use to "encrypt" and "sign" packets between # FreeRADIUS and the home server. # # The secret can be any string, up to 8k characters in length. # # Control codes can be entered vi octal encoding, # e.g. "\101\102" == "AB" # Quotation marks can be entered by escaping them, # e.g. "foo\"bar" # Spaces or other "special" characters can be entered # by putting quotes around the string. # e.g. "foo bar" # "foo;bar" # secret = testing123 ############################################################ # # The rest of the configuration items listed here are optional, # and do not have to appear in every home server definition. # ############################################################ # # You can optionally specify the source IP address used when # proxying requests to this home server. When the src_ipaddr # it set, the server will automatically create a proxy # listener for that IP address. # # If you specify this field for one home server, you will # likely need to specify it for ALL home servers. # # If you don't care about the source IP address, leave this # entry commented. # # src_ipaddr = 127.0.0.1 # RFC 5080 suggests that all clients SHOULD include it in an # Access-Request. The configuration item below tells the # proxying server (i.e. this one) whether or not the home # server requires a Message-Authenticator attribute. If it # is required (value set to "yes"), then all Access-Request # packets sent to that home server will have a # Message-Authenticator attribute. # # We STRONGLY recommend that this flag be set to "yes" # for ALL home servers. Doing so will have no performance # impact on the proxy or on the home servers. It will, # however, allow administrators to detect problems earlier. # # allowed values: yes, no require_message_authenticator = yes # # If the home server does not respond to a request within # this time, this server will initiate "zombie_period". # # The response window is large because responses MAY be slow, # especially when proxying across the Internet. # # Useful range of values: 5 to 60 response_window = 20 # # If you want the old behavior of the server rejecting # proxied requests after "response_window" timeout, set # the following configuration item to "yes". # # This configuration WILL be removed in a future release # If you believe you need it, email the freeradius-users # list, and explain why it should stay in the server. # # no_response_fail = no # # If the home server does not respond to ANY packets during # the "zombie period", it will be considered to be dead. # # A home server that is marked "zombie" will be used for # proxying as a low priority. If there are live servers, # they will always be preferred to a zombie. Requests will # be proxied to a zombie server ONLY when there are no # live servers. # # Any request that is proxied to a home server will continue # to be sent to that home server until the home server is # marked dead. At that point, it will fail over to another # server, if a live server is available. If none is available, # then the "post-proxy-type fail" handler will be called. # # If "status_check" below is something other than "none", then # the server will start sending status checks at the start of # the zombie period. It will continue sending status checks # until the home server is marked "alive". # # Useful range of values: 20 to 120 zombie_period = 40 ############################################################ # # As of 2.0, FreeRADIUS supports RADIUS layer "status # checks". These are used by a proxy server to see if a home # server is alive. # # These status packets are sent ONLY if the proxying server # believes that the home server is dead. They are NOT sent # if the proxying server believes that the home server is # alive. They are NOT sent if the proxying server is not # proxying packets. # # If the home server responds to the status check packet, # then it is marked alive again, and is returned to use. # ############################################################ # # Some home servers do not support status checks via the # Status-Server packet. Others may not have a "test" user # configured that can be used to query the server, to see if # it is alive. For those servers, we have NO WAY of knowing # when it becomes alive again. Therefore, after the server # has been marked dead, we wait a period of time, and mark # it alive again, in the hope that it has come back to # life. # # If it has NOT come back to life, then FreeRADIUS will wait # for "zombie_period" before marking it dead again. During # the "zombie_period", ALL AUTHENTICATIONS WILL FAIL, because # the home server is still dead. There is NOTHING that can # be done about this, other than to enable the status checks, # as documented below. # # e.g. if "zombie_period" is 40 seconds, and "revive_interval" # is 300 seconds, the for 40 seconds out of every 340, or about # 10% of the time, all authentications will fail. # # If the "zombie_period" and "revive_interval" configurations # are set smaller, than it is possible for up to 50% of # authentications to fail. # # As a result, we recommend enabling status checks, and # we do NOT recommend using "revive_interval". # # The "revive_interval" is used ONLY if the "status_check" # entry below is "none". Otherwise, it will not be used, # and should be deleted. # # Useful range of values: 60 to 3600 revive_interval = 120 # # The proxying server (i.e. this one) can do periodic status # checks to see if a dead home server has come back alive. # # If set to "none", then the other configuration items listed # below are not used, and the "revive_interval" time is used # instead. # # If set to "status-server", the Status-Server packets are # sent. Many RADIUS servers support Status-Server. If a # server does not support it, please contact the server # vendor and request that they add it. # # If set to "request", then Access-Request, or Accounting-Request # packets are sent, depending on the "type" entry above (auth/acct). # # Allowed values: none, status-server, request status_check = status-server # # If the home server does not support Status-Server packets, # then the server can still send Access-Request or # Accounting-Request packets, with a pre-defined user name. # # This practice is NOT recommended, as it may potentially let # users gain network access by using these "test" accounts! # # If it is used, we recommend that the home server ALWAYS # respond to these Access-Request status checks with # Access-Reject. The status check just needs an answer, it # does not need an Access-Accept. # # For Accounting-Request status checks, only the username # needs to be set. The rest of the accounting attribute are # set to default values. The home server that receives these # accounting packets SHOULD NOT treat them like normal user # accounting packets. i.e It should probably NOT log them to # a database. # # username = "test_user_please_reject_me" # password = "this is really secret" # # Configure the interval between sending status check packets. # # Setting it too low increases the probability of spurious # fail-over and fallback attempts. # # Useful range of values: 6 to 120 check_interval = 30 # # Configure the number of status checks in a row that the # home server needs to respond to before it is marked alive. # # If you want to mark a home server as alive after a short # time period of being responsive, it is best to use a small # "check_interval", and a large value for # "num_answers_to_alive". Using a long "check_interval" and # a small number for "num_answers_to_alive" increases the # probability of spurious fail-over and fallback attempts. # # Useful range of values: 3 to 10 num_answers_to_alive = 3 # # Limit the total number of outstanding packets to the home # server. # # if ((#request sent) - (#requests received)) > max_outstanding # then stop sending more packets to the home server # # This lets us gracefully fall over when the home server # is overloaded. max_outstanding = 65536 # # The configuration items in the next sub-section are used ONLY # when "type = coa". It is ignored for all other type of home # servers. # # See RFC 5080 for the definitions of the following terms. # RAND is a function (internal to FreeRADIUS) returning # random numbers between -0.1 and +0.1 # # First Re-transmit occurs after: # # RT = IRT + RAND*IRT # # Subsequent Re-transmits occur after: # # RT = 2 * RTprev + RAND * RTprev # # Re-trasnmits are capped at: # # if (MRT && (RT > MRT)) RT = MRT + RAND * MRT # # For a maximum number of attempts: MRC # # For a maximum (total) period of time: MRD. # coa { # Initial retransmit interval: 1..5 irt = 2 # Maximum Retransmit Timeout: 1..30 (0 == no maximum) mrt = 16 # Maximum Retransmit Count: 1..20 (0 == retransmit forever) mrc = 5 # Maximum Retransmit Duration: 5..60 mrd = 30 } } # Sample virtual home server. # # #home_server virtual.example.com { # virtual_server = virtual.example.com #} ###################################################################### # # This section defines a pool of home servers that is used # for fail-over and load-balancing. In earlier versions of # FreeRADIUS, fail-over and load-balancing were defined per-realm. # As a result, if a server had 5 home servers, each of which served # the same 10 realms, you would need 50 "realm" entries. # # In version 2.0, you would need 5 "home_server" sections, # 10 'realm" sections, and one "home_server_pool" section to tie the # two together. # home_server_pool my_auth_failover { # # The type of this pool controls how home servers are chosen. # # fail-over - the request is sent to the first live # home server in the list. i.e. If the first home server # is marked "dead", the second one is chosen, etc. # # load-balance - the least busy home server is chosen, # where "least busy" is counted by taking the number of # requests sent to that home server, and subtracting the # number of responses received from that home server. # # If there are two or more servers with the same low # load, then one of those servers is chosen at random. # This configuration is most similar to the old # "round-robin" method, though it is not exactly the same. # # Note that load balancing does not work well with EAP, # as EAP requires packets for an EAP conversation to be # sent to the same home server. The load balancing method # does not keep state in between packets, meaning that # EAP packets for the same conversation may be sent to # different home servers. This will prevent EAP from # working. # # For non-EAP authentication methods, and for accounting # packets, we recommend using "load-balance". It will # ensure the highest availability for your network. # # client-balance - the home server is chosen by hashing the # source IP address of the packet. If that home server # is down, the next one in the list is used, just as # with "fail-over". # # There is no way of predicting which source IP will map # to which home server. # # This configuration is most useful to do simple load # balancing for EAP sessions, as the EAP session will # always be sent to the same home server. # # client-port-balance - the home server is chosen by hashing # the source IP address and source port of the packet. # If that home server is down, the next one in the list # is used, just as with "fail-over". # # This method provides slightly better load balancing # for EAP sessions than "client-balance". However, it # also means that authentication and accounting packets # for the same session MAY go to different home servers. # # keyed-balance - the home server is chosen by hashing (FNV) # the contents of the Load-Balance-Key attribute from the # control items. The request is then sent to home server # chosen by taking: # # server = (hash % num_servers_in_pool). # # If there is no Load-Balance-Key in the control items, # the load balancing method is identical to "load-balance". # # For most non-EAP authentication methods, The User-Name # attribute provides a good key. An "unlang" policy can # be used to copy the User-Name to the Load-Balance-Key # attribute. This method may not work for EAP sessions, # as the User-Name outside of the TLS tunnel is often # static, e.g. "anonymous@realm". # # # The default type is fail-over. type = fail-over # # A virtual_server may be specified here. If so, the # "pre-proxy" and "post-proxy" sections are called when # the request is proxied, and when a response is received. # # This lets you have one policy for all requests that are proxied # to a home server. This policy is completely independent of # any policies used to receive, or process the request. # #virtual_server = pre_post_proxy_for_pool # # Next, a list of one or more home servers. The names # of the home servers are NOT the hostnames, but the names # of the sections. (e.g. home_server foo {...} has name "foo". # # Note that ALL home servers listed here have to be of the same # type. i.e. they all have to be "auth", or they all have to # be "acct", or the all have to be "auth+acct". # home_server = localhost # Additional home servers can be listed. # There is NO LIMIT to the number of home servers that can # be listed, though using more than 10 or so will become # difficult to manage. # # home_server = foo.example.com # home_server = bar.example.com # home_server = baz.example.com # home_server = ... # # If ALL home servers are dead, then this "fallback" home server # is used. If set, it takes precedence over any realm-based # fallback, such as the DEFAULT realm. # # For reasons of stability, this home server SHOULD be a virtual # server. Otherwise, the fallback may itself be dead! # #fallback = virtual.example.com } ###################################################################### # # # This section defines a new-style "realm". Note the in version 2.0, # there are many fewer configuration items than in 1.x for a realm. # # Automatic proxying is done via the "realms" module (see "man # rlm_realm"). To manually proxy the request put this entry in the # "users" file: # # #DEFAULT Proxy-To-Realm := "realm_name" # # realm example.com { # # Realms point to pools of home servers. # # For authentication, the "auth_pool" configuration item # should point to a "home_server_pool" that was previously # defined. All of the home servers in the "auth_pool" must # be of type "auth". # # For accounting, the "acct_pool" configuration item # should point to a "home_server_pool" that was previously # defined. All of the home servers in the "acct_pool" must # be of type "acct". # # If you have a "home_server_pool" where all of the home servers # are of type "auth+acct", you can just use the "pool" # configuration item, instead of specifying both "auth_pool" # and "acct_pool". auth_pool = my_auth_failover # acct_pool = acct # # Normally, when an incoming User-Name is matched against the # realm, the realm name is "stripped" off, and the "stripped" # user name is used to perform matches. # # e.g. User-Name = "bob@example.com" will result in two new # attributes being created by the "realms" module: # # Stripped-User-Name = "bob" # Realm = "example.com" # # The Stripped-User-Name is then used as a key in the "users" # file, for example. # # If you do not want this to happen, uncomment "nostrip" below. # # nostrip # There are no more configuration entries for a realm. } # # This is a sample entry for iPass. # Note that you have to define "ipass_auth_pool" and # "ipass_acct_pool", along with home_servers for them, too. # #realm IPASS { # nostrip # # auth_pool = ipass_auth_pool # acct_pool = ipass_acct_pool #} # # This realm is used mainly to cancel proxying. You can have # the "realm suffix" module configured to proxy all requests for # a realm, and then later cancel the proxying, based on other # configuration. # # For example, you want to terminate PEAP or EAP-TTLS locally, # you can add the following to the "users" file: # # DEFAULT EAP-Type == PEAP, Proxy-To-Realm := LOCAL # realm LOCAL { # If we do not specify a server pool, the realm is LOCAL, and # requests are not proxied to it. } # # This realm is for requests which don't have an explicit realm # prefix or suffix. User names like "bob" will match this one. # #realm NULL { # authhost = radius.company.com:1600 # accthost = radius.company.com:1601 # secret = testing123 #} # # This realm is for ALL OTHER requests. # #realm DEFAULT { # authhost = radius.company.com:1600 # accthost = radius.company.com:1601 # secret = testing123 #} # This realm "proxies" requests internally to a virtual server. # The pre-proxy and post-proxy sections are run just as with any # other kind of home server. The virtual server then receives # the request, and replies, just as with any other packet. # # Once proxied internally like this, the request CANNOT be proxied # internally or externally. # #realm virtual.example.com { # virtual_server = virtual.example.com #} # # # Regular expressions may also be used as realm names. If these are used, # then the "find matching realm" process is as follows: # # 1) Look for a non-regex realm with an *exact* match for the name. # If found, it is used in preference to any regex matching realm. # # 2) Look for a regex realm, in the order that they are listed # in the configuration files. Any regex match is performed in # a case-insensitive fashion. # # 3) If no realm is found, return the DEFAULT realm, if any. # # The order of the realms matters in step (2). For example, defining # two realms ".*\.example.net$" and ".*\.test\.example\.net$" will result in # the second realm NEVER matching. This is because all of the realms # which match the second regex also match the first one. Since the # first regex matches, it is returned. # # The solution is to list the realms in the opposite order,. e.g. # ".*\.test\.example.net$", followed by ".*\.example\.net$". # # # Some helpful rules: # # - always place a '~' character at the start of the realm name. # This signifies that it is a regex match, and not an exact match # for the realm. # # - place the regex in double quotes. This helps the configuration # file parser ignore any "special" characters in the regex. # Yes, this rule is different than the normal "unlang" rules for # regular expressions. That may be fixed in a future release. # # - use two back-slashes '\\' whenever you need one backslash in the # regex. e.g. "~.*\\.example\\.net$", and not "~\.example\.net$". # This is because the regex is in a double-quoted string, and normal # rules apply for double-quoted strings. # # - If you are matching domain names, use two backslashes in front of # every '.' (dot or period). This is because '.' has special meaning # in a regular expression: match any character. If you do not do this, # then "~.*.example.net$" will match "fooXexampleYnet", which is likely # not what you want # # - If you are matching domain names, put a '$' at the end of the regex # that matches the domain name. This tells the regex matching code # that the realm ENDS with the domain name, so it does not match # realms with the domain name in the middle. e.g. "~.*\\.example\\.net" # will match "test.example.netFOO", which is likely not what you want. # Using "~(.*\\.)example\\.net$" is better. # # The more regex realms that are defined, the more time it takes to # process them. You should define as few regex realms as possible # in order to maximize server performance. # #realm "~(.*\\.)*example\\.net$" { # auth_pool = my_auth_failover #} freeradius-server/raddb/radiusd.conf.in000066400000000000000000000710521257552170400205130ustar00rootroot00000000000000# -*- text -*- ## ## radiusd.conf -- FreeRADIUS server configuration file. ## ## http://www.freeradius.org/ ## $Id$ ## ###################################################################### # # Read "man radiusd" before editing this file. See the section # titled DEBUGGING. It outlines a method where you can quickly # obtain the configuration you want, without running into # trouble. # # Run the server in debugging mode, and READ the output. # # $ radiusd -X # # We cannot emphasize this point strongly enough. The vast # majority of problems can be solved by carefully reading the # debugging output, which includes warnings about common issues, # and suggestions for how they may be fixed. # # There may be a lot of output, but look carefully for words like: # "warning", "error", "reject", or "failure". The messages there # will usually be enough to guide you to a solution. # # If you are going to ask a question on the mailing list, then # explain what you are trying to do, and include the output from # debugging mode (radiusd -X). Failure to do so means that all # of the responses to your question will be people telling you # to "post the output of radiusd -X". ###################################################################### # # The location of other config files and logfiles are declared # in this file. # # Also general configuration for modules can be done in this # file, it is exported through the API to modules that ask for # it. # # See "man radiusd.conf" for documentation on the format of this # file. Note that the individual configuration items are NOT # documented in that "man" page. They are only documented here, # in the comments. # # As of 2.0.0, FreeRADIUS supports a simple processing language # in the "authorize", "authenticate", "accounting", etc. sections. # See "man unlang" for details. # prefix = @prefix@ exec_prefix = @exec_prefix@ sysconfdir = @sysconfdir@ localstatedir = @localstatedir@ sbindir = @sbindir@ logdir = @logdir@ raddbdir = @raddbdir@ radacctdir = @radacctdir@ # # name of the running server. See also the "-n" command-line option. name = radiusd # Location of config and logfiles. confdir = ${raddbdir} run_dir = ${localstatedir}/run/${name} # Should likely be ${localstatedir}/lib/radiusd db_dir = ${raddbdir} # # libdir: Where to find the rlm_* modules. # # This should be automatically set at configuration time. # # If the server builds and installs, but fails at execution time # with an 'undefined symbol' error, then you can use the libdir # directive to work around the problem. # # The cause is usually that a library has been installed on your # system in a place where the dynamic linker CANNOT find it. When # executing as root (or another user), your personal environment MAY # be set up to allow the dynamic linker to find the library. When # executing as a daemon, FreeRADIUS MAY NOT have the same # personalized configuration. # # To work around the problem, find out which library contains that symbol, # and add the directory containing that library to the end of 'libdir', # with a colon separating the directory names. NO spaces are allowed. # # e.g. libdir = /usr/local/lib:/opt/package/lib # # You can also try setting the LD_LIBRARY_PATH environment variable # in a script which starts the server. # # If that does not work, then you can re-configure and re-build the # server to NOT use shared libraries, via: # # ./configure --disable-shared # make # make install # libdir = @libdir@ # pidfile: Where to place the PID of the RADIUS server. # # The server may be signalled while it's running by using this # file. # # This file is written when ONLY running in daemon mode. # # e.g.: kill -HUP `cat /var/run/radiusd/radiusd.pid` # pidfile = ${run_dir}/${name}.pid # chroot: directory where the server does "chroot". # # The chroot is done very early in the process of starting the server. # After the chroot has been performed it switches to the "user" listed # below (which MUST be specified). If "group" is specified, it switchs # to that group, too. Any other groups listed for the specified "user" # in "/etc/group" are also added as part of this process. # # The current working directory (chdir / cd) is left *outside* of the # chroot until all of the modules have been initialized. This allows # the "raddb" directory to be left outside of the chroot. Once the # modules have been initialized, it does a "chdir" to ${logdir}. This # means that it should be impossible to break out of the chroot. # # If you are worried about security issues related to this use of chdir, # then simply ensure that the "raddb" directory is inside of the chroot, # end be sure to do "cd raddb" BEFORE starting the server. # # If the server is statically linked, then the only files that have # to exist in the chroot are ${run_dir} and ${logdir}. If you do the # "cd raddb" as discussed above, then the "raddb" directory has to be # inside of the chroot directory, too. # #chroot = /path/to/chroot/directory # user/group: The name (or #number) of the user/group to run radiusd as. # # If these are commented out, the server will run as the user/group # that started it. In order to change to a different user/group, you # MUST be root ( or have root privleges ) to start the server. # # We STRONGLY recommend that you run the server with as few permissions # as possible. That is, if you're not using shadow passwords, the # user and group items below should be set to radius'. # # NOTE that some kernels refuse to setgid(group) when the value of # (unsigned)group is above 60000; don't use group nobody on these systems! # # On systems with shadow passwords, you might have to set 'group = shadow' # for the server to be able to read the shadow password file. If you can # authenticate users while in debug mode, but not in daemon mode, it may be # that the debugging mode server is running as a user that can read the # shadow info, and the user listed below can not. # # The server will also try to use "initgroups" to read /etc/groups. # It will join all groups where "user" is a member. This can allow # for some finer-grained access controls. # #user = radius #group = radius # panic_action: Command to execute if the server dies unexpectedly. # # FOR PRODUCTION SYSTEMS, ACTIONS SHOULD ALWAYS EXIT. # AN INTERACTIVE ACTION MEANS THE SERVER IS NOT RESPONDING TO REQUESTS. # AN INTERACTICE ACTION MEANS THE SERVER WILL NOT RESTART. # # The panic action is a command which will be executed if the server # receives a fatal, non user generated signal, i.e. SIGSEGV, SIGBUS, # SIGABRT or SIGFPE. # # This can be used to start an interactive debugging session so # that information regarding the current state of the server can # be acquired. # # The following string substitutions are available: # - %e The currently executing program e.g. /sbin/radiusd # - %p The PID of the currently executing program e.g. 12345 # # Standard ${} substitutions are also allowed. # # An example panic action for opening an interactive session in GDB would be: # #panic_action = "gdb %e %p" # # Again, don't use that on a production system. # # An example panic action for opening an automated session in GDB would be: # #panic_action = "gdb -silent -x ${raddbdir}/panic.gdb %e %p > ${logdir}/gdb-%e-%p.log 2>&1" # # That command can be used on a production system. # # max_request_time: The maximum time (in seconds) to handle a request. # # Requests which take more time than this to process may be killed, and # a REJECT message is returned. # # WARNING: If you notice that requests take a long time to be handled, # then this MAY INDICATE a bug in the server, in one of the modules # used to handle a request, OR in your local configuration. # # This problem is most often seen when using an SQL database. If it takes # more than a second or two to receive an answer from the SQL database, # then it probably means that you haven't indexed the database. See your # SQL server documentation for more information. # # Useful range of values: 5 to 120 # max_request_time = 30 # cleanup_delay: The time to wait (in seconds) before cleaning up # a reply which was sent to the NAS. # # The RADIUS request is normally cached internally for a short period # of time, after the reply is sent to the NAS. The reply packet may be # lost in the network, and the NAS will not see it. The NAS will then # re-send the request, and the server will respond quickly with the # cached reply. # # If this value is set too low, then duplicate requests from the NAS # MAY NOT be detected, and will instead be handled as seperate requests. # # If this value is set too high, then the server will cache too many # requests, and some new requests may get blocked. (See 'max_requests'.) # # Useful range of values: 2 to 10 # cleanup_delay = 5 # max_requests: The maximum number of requests which the server keeps # track of. This should be 256 multiplied by the number of clients. # e.g. With 4 clients, this number should be 1024. # # If this number is too low, then when the server becomes busy, # it will not respond to any new requests, until the 'cleanup_delay' # time has passed, and it has removed the old requests. # # If this number is set too high, then the server will use a bit more # memory for no real benefit. # # If you aren't sure what it should be set to, it's better to set it # too high than too low. Setting it to 1000 per client is probably # the highest it should be. # # Useful range of values: 256 to infinity # max_requests = 1024 # listen: Make the server listen on a particular IP address, and send # replies out from that address. This directive is most useful for # hosts with multiple IP addresses on one interface. # # If you want the server to listen on additional addresses, or on # additionnal ports, you can use multiple "listen" sections. # # Each section make the server listen for only one type of packet, # therefore authentication and accounting have to be configured in # different sections. # # The server ignore all "listen" section if you are using '-i' and '-p' # on the command line. # listen { # Type of packets to listen for. # Allowed values are: # auth listen for authentication packets # acct listen for accounting packets # proxy IP to use for sending proxied packets # detail Read from the detail file. For examples, see # raddb/sites-available/copy-acct-to-home-server # status listen for Status-Server packets. For examples, # see raddb/sites-available/status # coa listen for CoA-Request and Disconnect-Request # packets. For examples, see the file # raddb/sites-available/coa # type = auth # Note: "type = proxy" lets you control the source IP used for # proxying packets, with some limitations: # # * A proxy listener CANNOT be used in a virtual server section. # * You should probably set "port = 0". # * Any "clients" configuration will be ignored. # # See also proxy.conf, and the "src_ipaddr" configuration entry # in the sample "home_server" section. When you specify the # source IP address for packets sent to a home server, the # proxy listeners are automatically created. # IP address on which to listen. # Allowed values are: # dotted quad (1.2.3.4) # hostname (radius.example.com) # wildcard (*) ipaddr = * # OR, you can use an IPv6 address, but not both # at the same time. # ipv6addr = :: # any. ::1 == localhost # Port on which to listen. # Allowed values are: # integer port number (1812) # 0 means "use /etc/services for the proper port" port = 0 # Some systems support binding to an interface, in addition # to the IP address. This feature isn't strictly necessary, # but for sites with many IP addresses on one interface, # it's useful to say "listen on all addresses for eth0". # # If your system does not support this feature, you will # get an error if you try to use it. # # interface = eth0 # Per-socket lists of clients. This is a very useful feature. # # The name here is a reference to a section elsewhere in # radiusd.conf, or clients.conf. Having the name as # a reference allows multiple sockets to use the same # set of clients. # # If this configuration is used, then the global list of clients # is IGNORED for this "listen" section. Take care configuring # this feature, to ensure you don't accidentally disable a # client you need. # # See clients.conf for the configuration of "per_socket_clients". # # clients = per_socket_clients } # This second "listen" section is for listening on the accounting # port, too. # listen { ipaddr = * # ipv6addr = :: port = 0 type = acct # interface = eth0 # clients = per_socket_clients } # hostname_lookups: Log the names of clients or just their IP addresses # e.g., www.freeradius.org (on) or 206.47.27.232 (off). # # The default is 'off' because it would be overall better for the net # if people had to knowingly turn this feature on, since enabling it # means that each client request will result in AT LEAST one lookup # request to the nameserver. Enabling hostname_lookups will also # mean that your server may stop randomly for 30 seconds from time # to time, if the DNS requests take too long. # # Turning hostname lookups off also means that the server won't block # for 30 seconds, if it sees an IP address which has no name associated # with it. # # allowed values: {no, yes} # hostname_lookups = no # Core dumps are a bad thing. This should only be set to 'yes' # if you're debugging a problem with the server. # # allowed values: {no, yes} # allow_core_dumps = no # Regular expressions # # These items are set at configure time. If they're set to "yes", # then setting them to "no" turns off regular expression support. # # If they're set to "no" at configure time, then setting them to "yes" # WILL NOT WORK. It will give you an error. # regular_expressions = @REGEX@ extended_expressions = @REGEX_EXTENDED@ # # Logging section. The various "log_*" configuration items # will eventually be moved here. # log { # # Destination for log messages. This can be one of: # # files - log to "file", as defined below. # syslog - to syslog (see also the "syslog_facility", below. # stdout - standard output # stderr - standard error. # # The command-line option "-X" over-rides this option, and forces # logging to go to stdout. # destination = files # # The logging messages for the server are appended to the # tail of this file if destination == "files" # # If the server is running in debugging mode, this file is # NOT used. # file = ${logdir}/radius.log # # If this configuration parameter is set, then log messages for # a *request* go to this file, rather than to radius.log. # # i.e. This is a log file per request, once the server has accepted # the request as being from a valid client. Messages that are # not associated with a request still go to radius.log. # # Not all log messages in the server core have been updated to use # this new internal API. As a result, some messages will still # go to radius.log. Please submit patches to fix this behavior. # # The file name is expanded dynamically. You should ONLY user # server-side attributes for the filename (e.g. things you control). # Using this feature MAY also slow down the server substantially, # especially if you do thinks like SQL calls as part of the # expansion of the filename. # # The name of the log file should use attributes that don't change # over the lifetime of a request, such as User-Name, # Virtual-Server or Packet-Src-IP-Address. Otherwise, the log # messages will be distributed over multiple files. # # Logging can be enabled for an individual request by a special # dynamic expansion macro: %{debug: 1}, where the debug level # for this request is set to '1' (or 2, 3, etc.). e.g. # # ... # update control { # Tmp-String-0 = "%{debug:1}" # } # ... # # The attribute that the value is assigned to is unimportant, # and should be a "throw-away" attribute with no side effects. # #requests = ${logdir}/radiusd-%{%{Virtual-Server}:-DEFAULT}-%Y%m%d.log # # Which syslog facility to use, if ${destination} == "syslog" # # The exact values permitted here are OS-dependent. You probably # don't want to change this. # syslog_facility = daemon # Log the full User-Name attribute, as it was found in the request. # # allowed values: {no, yes} # stripped_names = no # Log authentication requests to the log file. # # allowed values: {no, yes} # auth = no # Log passwords with the authentication requests. # auth_badpass - logs password if it's rejected # auth_goodpass - logs password if it's correct # # allowed values: {no, yes} # auth_badpass = no auth_goodpass = no # Log additional text at the end of the "Login OK" messages. # for these to work, the "auth" and "auth_goopass" or "auth_badpass" # configurations above have to be set to "yes". # # The strings below are dynamically expanded, which means that # you can put anything you want in them. However, note that # this expansion can be slow, and can negatively impact server # performance. # # msg_goodpass = "" # msg_badpass = "" } # The program to execute to do concurrency checks. checkrad = ${sbindir}/checkrad # SECURITY CONFIGURATION # # There may be multiple methods of attacking on the server. This # section holds the configuration items which minimize the impact # of those attacks # security { # # max_attributes: The maximum number of attributes # permitted in a RADIUS packet. Packets which have MORE # than this number of attributes in them will be dropped. # # If this number is set too low, then no RADIUS packets # will be accepted. # # If this number is set too high, then an attacker may be # able to send a small number of packets which will cause # the server to use all available memory on the machine. # # Setting this number to 0 means "allow any number of attributes" max_attributes = 200 # # reject_delay: When sending an Access-Reject, it can be # delayed for a few seconds. This may help slow down a DoS # attack. It also helps to slow down people trying to brute-force # crack a users password. # # Setting this number to 0 means "send rejects immediately" # # If this number is set higher than 'cleanup_delay', then the # rejects will be sent at 'cleanup_delay' time, when the request # is deleted from the internal cache of requests. # # Useful ranges: 1 to 5 reject_delay = 1 # # status_server: Whether or not the server will respond # to Status-Server requests. # # When sent a Status-Server message, the server responds with # an Access-Accept or Accounting-Response packet. # # This is mainly useful for administrators who want to "ping" # the server, without adding test users, or creating fake # accounting packets. # # It's also useful when a NAS marks a RADIUS server "dead". # The NAS can periodically "ping" the server with a Status-Server # packet. If the server responds, it must be alive, and the # NAS can start using it for real requests. # # See also raddb/sites-available/status # status_server = yes @openssl_version_check_config@ } # PROXY CONFIGURATION # # proxy_requests: Turns proxying of RADIUS requests on or off. # # The server has proxying turned on by default. If your system is NOT # set up to proxy requests to another server, then you can turn proxying # off here. This will save a small amount of resources on the server. # # If you have proxying turned off, and your configuration files say # to proxy a request, then an error message will be logged. # # To disable proxying, change the "yes" to "no", and comment the # $INCLUDE line. # # allowed values: {no, yes} # proxy_requests = yes $INCLUDE proxy.conf # CLIENTS CONFIGURATION # # Client configuration is defined in "clients.conf". # # The 'clients.conf' file contains all of the information from the old # 'clients' and 'naslist' configuration files. We recommend that you # do NOT use 'client's or 'naslist', although they are still # supported. # # Anything listed in 'clients.conf' will take precedence over the # information from the old-style configuration files. # $INCLUDE clients.conf # THREAD POOL CONFIGURATION # # The thread pool is a long-lived group of threads which # take turns (round-robin) handling any incoming requests. # # You probably want to have a few spare threads around, # so that high-load situations can be handled immediately. If you # don't have any spare threads, then the request handling will # be delayed while a new thread is created, and added to the pool. # # You probably don't want too many spare threads around, # otherwise they'll be sitting there taking up resources, and # not doing anything productive. # # The numbers given below should be adequate for most situations. # thread pool { # Number of servers to start initially --- should be a reasonable # ballpark figure. start_servers = 5 # Limit on the total number of servers running. # # If this limit is ever reached, clients will be LOCKED OUT, so it # should NOT BE SET TOO LOW. It is intended mainly as a brake to # keep a runaway server from taking the system with it as it spirals # down... # # You may find that the server is regularly reaching the # 'max_servers' number of threads, and that increasing # 'max_servers' doesn't seem to make much difference. # # If this is the case, then the problem is MOST LIKELY that # your back-end databases are taking too long to respond, and # are preventing the server from responding in a timely manner. # # The solution is NOT do keep increasing the 'max_servers' # value, but instead to fix the underlying cause of the # problem: slow database, or 'hostname_lookups=yes'. # # For more information, see 'max_request_time', above. # max_servers = 32 # Server-pool size regulation. Rather than making you guess # how many servers you need, FreeRADIUS dynamically adapts to # the load it sees, that is, it tries to maintain enough # servers to handle the current load, plus a few spare # servers to handle transient load spikes. # # It does this by periodically checking how many servers are # waiting for a request. If there are fewer than # min_spare_servers, it creates a new spare. If there are # more than max_spare_servers, some of the spares die off. # The default values are probably OK for most sites. # min_spare_servers = 3 max_spare_servers = 10 # When the server receives a packet, it places it onto an # internal queue, where the worker threads (configured above) # pick it up for processing. The maximum size of that queue # is given here. # # When the queue is full, any new packets will be silently # discarded. # # The most common cause of the queue being full is that the # server is dependent on a slow database, and it has received # a large "spike" of traffic. When that happens, there is # very little you can do other than make sure the server # receives less traffic, or make sure that the database can # handle the load. # # max_queue_size = 65536 # There may be memory leaks or resource allocation problems with # the server. If so, set this value to 300 or so, so that the # resources will be cleaned up periodically. # # This should only be necessary if there are serious bugs in the # server which have not yet been fixed. # # '0' is a special value meaning 'infinity', or 'the servers never # exit' max_requests_per_server = 0 } # MODULE CONFIGURATION # # The names and configuration of each module is located in this section. # # After the modules are defined here, they may be referred to by name, # in other sections of this configuration file. # modules { # # Each module has a configuration as follows: # # name [ instance ] { # config_item = value # ... # } # # The 'name' is used to load the 'rlm_name' library # which implements the functionality of the module. # # The 'instance' is optional. To have two different instances # of a module, it first must be referred to by 'name'. # The different copies of the module are then created by # inventing two 'instance' names, e.g. 'instance1' and 'instance2' # # The instance names can then be used in later configuration # INSTEAD of the original 'name'. See the 'radutmp' configuration # for an example. # # # As of 2.0.5, most of the module configurations are in a # sub-directory. Files matching the regex /[a-zA-Z0-9_.]+/ # are loaded. The modules are initialized ONLY if they are # referenced in a processing section, such as authorize, # authenticate, accounting, pre/post-proxy, etc. # $INCLUDE ${confdir}/modules/ # Extensible Authentication Protocol # # For all EAP related authentications. # Now in another file, because it is very large. # $INCLUDE eap.conf # Include another file that has the SQL-related configuration. # This is another file only because it tends to be big. # # $INCLUDE sql.conf # # This module is an SQL enabled version of the counter module. # # Rather than maintaining seperate (GDBM) databases of # accounting info for each counter, this module uses the data # stored in the raddacct table by the sql modules. This # module NEVER does any database INSERTs or UPDATEs. It is # totally dependent on the SQL module to process Accounting # packets. # # $INCLUDE sql/mysql/counter.conf # # IP addresses managed in an SQL table. # # $INCLUDE sqlippool.conf } # Instantiation # # This section orders the loading of the modules. Modules # listed here will get loaded BEFORE the later sections like # authorize, authenticate, etc. get examined. # # This section is not strictly needed. When a section like # authorize refers to a module, it's automatically loaded and # initialized. However, some modules may not be listed in any # of the following sections, so they can be listed here. # # Also, listing modules here ensures that you have control over # the order in which they are initalized. If one module needs # something defined by another module, you can list them in order # here, and ensure that the configuration will be OK. # instantiate { # # Allows the execution of external scripts. # The entire command line (and output) must fit into 253 bytes. # # e.g. Framed-Pool = `%{exec:/bin/echo foo}` exec # # The expression module doesn't do authorization, # authentication, or accounting. It only does dynamic # translation, of the form: # # Session-Timeout = `%{expr:2 + 3}` # # This module needs to be instantiated, but CANNOT be # listed in any other section. See 'doc/rlm_expr' for # more information. # # rlm_expr is also responsible for registering many # other xlat functions such as md5, sha1 and lc. # # We do not recommend removing it's listing here. expr # # We add the counter module here so that it registers # the check-name attribute before any module which sets # it # daily expiration logintime # subsections here can be thought of as "virtual" modules. # # e.g. If you have two redundant SQL servers, and you want to # use them in the authorize and accounting sections, you could # place a "redundant" block in each section, containing the # exact same text. Or, you could uncomment the following # lines, and list "redundant_sql" in the authorize and # accounting sections. # #redundant redundant_sql { # sql1 # sql2 #} } ###################################################################### # # Policies that can be applied in multiple places are listed # globally. That way, they can be defined once, and referred # to multiple times. # ###################################################################### $INCLUDE policy.conf ###################################################################### # # Load virtual servers. # # This next $INCLUDE line loads files in the directory that # match the regular expression: /[a-zA-Z0-9_.]+/ # # It allows you to define new virtual servers simply by placing # a file into the raddb/sites-enabled/ directory. # $INCLUDE sites-enabled/ ###################################################################### # # All of the other configuration sections like "authorize {}", # "authenticate {}", "accounting {}", have been moved to the # the file: # # raddb/sites-available/default # # This is the "default" virtual server that has the same # configuration as in version 1.0.x and 1.1.x. The default # installation enables this virtual server. You should # edit it to create policies for your local site. # # For more documentation on virtual servers, see: # # raddb/sites-available/README # ###################################################################### freeradius-server/raddb/radrelay.conf.in000066400000000000000000000063371257552170400206670ustar00rootroot00000000000000# -*- text -*- ## ## radrelay.conf -- FreeRADIUS server configuration file. ## ## Use with: radiusd -n radrelay ## ## http://www.freeradius.org/ ## $Id$ ## ###################################################################### # # This file is a sample configuration that replaces the old # "radrelay" program. It is a *minimal* configuration that # does little more than read the detail file, and proxy the # packets to a home server. If you need it to do more than # just replace radrelay, you will need to add additional # configuration. # # See raddb/sites-available/copy-acct-to-home-server for a # more complete example. That example is intended to be run # as part of a larger radius configuration, where the server # also listens on ports 1812, etc. The example given here # is a minimal example that has ONLY radrelay functionality. # # See radiusd.conf for a complete description of the configuration # parameters used here. # ###################################################################### prefix = @prefix@ exec_prefix = @exec_prefix@ sysconfdir = @sysconfdir@ localstatedir = @localstatedir@ sbindir = @sbindir@ logdir = @logdir@ raddbdir = @raddbdir@ radacctdir = @radacctdir@ # # name of the running server. See also the "-n" command-line option. # name = radrelay # # Generic configuration # confdir = ${raddbdir} run_dir = ${localstatedir}/run/${name} libdir = @libdir@ pidfile = ${run_dir}/${name}.pid # # Request handling configuration # max_request_time = 30 cleanup_delay = 5 max_requests = 65536 # # Logging section. # log { destination = files file = ${logdir}/${name}.log } # # Security configuration # security { max_attributes = 200 # reject_delay && status_server don't apply when we are # only reading accounting packets from the detail file } # # If you need more modules, add them here. # modules { $INCLUDE ${confdir}/modules/always } # # If you need to instantiate modules, add them here. # instantiate { } # # Configuration of home servers, etc. # proxy_requests = yes # # See proxy.conf for additional home server configuration. # home_server home1 { type = acct # # This directive replaces the "-r" command-line option # in radrelay # ipaddr = 192.168.10.20 port = 1812 # # This directive replaces the "-i" command-line option # in radrelay # # src_ipaddr = 192.168.1.1 # # This directive replaces the "-s", "-S", and "-n" command-line # options in radrelay # secret = testing123 } # # List one or more home servers here for fail-over, load-balancing, etc. # home_server_pool radrelay { type = fail-over home_server = home1 } # # A dummy realm. # realm radrelay { acct_pool = radrelay } # # Read the detail file. # listen { type = detail # # The filename here should be the same as the one used by the # main radiusd program. It writes the file using the "detail" # module (see raddb/modules/detail). # filename = ${radacctdir}/detail load_factor = 90 } # # See also raddb/sites-available/copy-acct-to-home-server # for additional description. # preacct { # # Proxy the packet using the given realm. # Note that we do not use the realm for anything else such # as prefix/suffix stripping or comparisons. # update control { Proxy-To-Realm := "radrelay" } } freeradius-server/raddb/sites-available/000077500000000000000000000000001257552170400206445ustar00rootroot00000000000000freeradius-server/raddb/sites-available/README000066400000000000000000000205371257552170400215330ustar00rootroot000000000000001. Virtual Servers. FreeRADIUS 2.0 supports virtual servers. This is probably the single largest change that is NOT backwards compatible with 1.x. The virtual servers do NOT have to be set up with the "sites-available" and "sites-enabled" directories. You can still have one "radiusd.conf" file, and put the server configuration there: ... server { authorize { ... } authenticate { ... } ... } ... The power of virtual servers lies in their ability to separate policies. A policy can be placed into a virtual server, where it is guaranteed to affect only the requests that are passed through that virtual server. In 1.x, the policies were global, and it sometimes took much effort to write a policy so that it only applied in certain limited situations. 2. What do we mean by "virtual server"? A virtual server is a (nearly complete) RADIUS server, just like a configuration for FreeRADIUS 1.x. However, FreeRADIUS can now run multiple virtual servers at the same time. The virtual servers can even proxy requests to each other! The simplest way to create a virtual server is to take the all of the request processing sections from radius.conf, ("authorize" , "authenticate", etc.) and wrap them in a "server {}" block, as above. You can create another virtual server by: 1) defining a new "server foo {...}" section in radiusd.conf 2) Putting the normal "authorize", etc. sections inside of it 3) Adding a "listen" section *inside* of the "server" section. e.g. ... server foo { listen { ipaddr = 127.0.0.1 port = 2000 type = auth } authorize { update control { Cleartext-Password := "bob" } pap } authenticate { pap } } ... With that text added to "radiusd.conf", run the server in debugging mode (radiusd -X), and in another terminal window, type: $ radtest bob bob localhost:2000 0 testing123 You should see the server return an Access-Accept. 3. Capabilities and limitations The only sub-sections that can appear in a virtual server section are: listen client authorize authenticate post-auth pre-proxy post-proxy preacct accounting session All other configuration parameters (modules, etc.) are global. Inside of a virtual server, the authorize, etc. sections have their normal meaning, and can contain anything that an authorize section could contain in 1.x. When a "listen" section is inside of a virtual server definition, it means that all requests sent to that IP/port will be processed through the virtual server. There cannot be two "listen" sections with the same IP address and port number. When a "client" section is inside of a virtual server definition, it means that that client is known only to the "listen" sections that are also inside of that virtual server. Not only is this client definition available only to this virtual server, but the details of the client configuration is also available only to this virtual server. i.e. Two virtual servers can listen on different IP address and ports, but both can have a client with IP address 127.0.0.1. The shared secret for that client can be different for each virtual server. 4. More complex "listen" capabilities The "listen" sections have a few additional configuration items that were not in 1.x, and were not mentioned above. These configuration items enable almost any mapping of IP / port to clients to virtual servers. The configuration items are: virtual_server = If set, all requests sent to this IP / port are processed through the named virtual server. This directive can be used only for "listen" sections that are global. i.e. It CANNOT be used if the "listen" section is inside of a virtual server. clients = If set, the "listen" section looks for a "clients" section: clients { ... } It looks inside of that named "clients" section for "client" subsections, at least one of which must exist. Each client in that section is added to the list of known clients for this IP / port. No other clients are known. If it is set, it over-rides the list of clients (if any) in the same virtual server. Note that the clients are NOT additive! If it is not set, then the clients from the current virtual server (if any) are used. If there are no clients in this virtual server, then the global clients are used. i.e. The most specific directive is used: * configuration in this "listen" section * clients in the same virtual server * global clients The directives are also *exclusive*, not *additive*. If you have one client in a virtual server, and another client referenced from a "listen" section, then that "listen" section will ONLY use the second client. It will NOT use both clients. 5. More complex "client" capabilities The "client" sections have a few additional configuration items that were not in 1.x, and were not mentioned above. These configuration items enable almost any mapping of IP / port to clients to virtual servers. The configuration items are: virtual_server = If set, all requests from this client are processed through the named virtual server. This directive can be used only for "client" sections that are global. i.e. It CANNOT be used if the "client" section is inside of a virtual server. If the "listen" section has a "server" entry, and a matching client is found ALSO with a "server" entry, then the clients server is used for that request. 6. Worked examples Listening on one socket, and mapping requests from two clients to two different servers. listen { ... } client one { ... virtual_server = server_one } client two { ... virtual_server = server_two } server server_one { authorize { ... } ... } server server_two { authorize { ... } ... } This could also be done as: listen { ... virtual_server = server_one } client one { ... } client two { ... virtual_server = server_two } server server_one { authorize { ... } ... } server server_two { authorize { ... } ... } In this case, the default server for the socket is "server_one", so there is no need to set that in the client "one" configuration. The "server_two" configuration for client "two" over-rides the default setting for the socket. Note that the following configuration will NOT work: listen { ... virtual_server = server_one } client one { ... } server server_one { authorize { ... } ... } server server_two { client two { ... } authorize { ... } ... } In this example, client "two" is hidden inside of the virtual server, where the "listen" section cannot find it. 7. Outlined examples This section outlines a number of examples, with alternatives. One server, multiple sockets - multiple "listen" sections in a "server" section one server per client - define multiple servers - have a global "listen" section - have multiple global "clients", each with "virtual_server = X" two servers, each with their own sockets - define multiple servers - put "client" sections into each "server" - put a "listen" section into each "server" Each server can list the same client IP, and the secret can be different two sockets, sharing a list of clients, but pointing to different servers - define global "listen" sections - in each, set "virtual_server = X" - in each, set "clients = Y" - define "clients Y" section, containing multiple clients. This also means that you can have a third socket, which doesn't share any of these clients. 8. How to decide what to do If you want *completely* separate policies for a socket or a client, then create a separate virtual server. Then, map the request to that server by setting configuration entries in a "listen" section or in a "client" section. Start off with the common cases first. If most of the clients and/or sockets get a particular policy, make that policy the default. Configure it without paying attention to the sockets or clients you want to add later, and without adding a second virtual server. Once it works, then add the second virtual server. If you want to re-use the previously defined sockets with the second virtual server, then you will need one or more global "client" sections. Those clients will contain a "virtual_server = ..." entry that will direct requests from those clients to the appropriate virtual server. freeradius-server/raddb/sites-available/buffered-sql000066400000000000000000000100031257552170400231400ustar00rootroot00000000000000# -*- text -*- ###################################################################### # # In 2.0.0, radrelay functionality is integrated into the # server core. This virtual server gives an example of # using radrelay functionality inside of the server. # # In this example, the detail file is read, and the data # is put into SQL. This configuration is used when a RADIUS # server on this machine is receiving accounting packets, # and writing them to the detail file. # # The purpose of this virtual server is to de-couple the storage # of long-term accounting data in SQL from "live" information # needed by the RADIUS server as it is running. # # The benefit of this approach is that for a busy server, the # overhead of performing SQL qeuries may be significant. Also, # if the SQL databases are large (as is typical for ones storing # months of data), the INSERTs and UPDATEs may take a relatively # long time. Rather than slowing down the RADIUS server by # having it interact with a database, you can just log the # packets to a detail file, and then read that file later at a # time when the RADIUS server is typically lightly loaded. # # If you use on virtual server to log to the detail file, # and another virtual server (i.e. this one) to read from # the detail file, then this process will happen automatically. # A sudden spike of RADIUS traffic means that the detail file # will grow in size, and the server will be able to handle # large volumes of traffic quickly. When the traffic dies down, # the server will have time to read the detail file, and insert # the data into a long-term SQL database. # # $Id$ # ###################################################################### server buffered-sql { listen { type = detail # The location where the detail file is located. # This should be on local disk, and NOT on an NFS # mounted location! filename = "${radacctdir}/detail-*" # # The server can read accounting packets from the # detail file much more quickly than those packets # can be written to a database. If the database is # overloaded, then bad things can happen. # # The server will keep track of how long it takes to # process an entry from the detail file. It will # then pause between handling entries. This pause # allows databases to "catch up", and gives the # server time to notice that other packets may have # arrived. # # The pause is calculated dynamically, to ensure that # the load due to reading the detail files is limited # to a small percentage of CPU time. The # "load_factor" configuration item is a number # between 1 and 100. The server will try to keep the # percentage of time taken by "detail" file entries # to "load_factor" percentage of the CPU time. # # If the "load_factor" is set to 100, then the server # will read packets as fast as it can, usually # causing databases to go into overload. # load_factor = 10 # # Set the interval for polling the detail file. # If the detail file doesn't exist, the server will # wake up, and poll for it every N seconds. # # Useful range of values: 1 to 60 poll_interval = 1 # # Set the retry interval for when the home server # does not respond. The current packet will be # sent repeatedly, at this interval, until the # home server responds. # # Useful range of values: 5 to 30 retry_interval = 30 } # # Pre-accounting. Decide which accounting type to use. # preacct { preprocess # # Ensure that we have a semi-unique identifier for every # request, and many NAS boxes are broken. acct_unique # # Read the 'acct_users' file. This isn't always # necessary, and can be deleted if you do not use it. files } # # Accounting. Log the accounting data. # accounting { # # Log traffic to an SQL database. # # See "Accounting queries" in sql.conf # sql # Cisco VoIP specific bulk accounting # pgsql-voip } # The requests are not being proxied, so no pre/post-proxy # sections are necessary. } freeradius-server/raddb/sites-available/coa000066400000000000000000000021171257552170400213320ustar00rootroot00000000000000# -*- text -*- ###################################################################### # # Sample virtual server for receiving a CoA or Disconnect-Request packet. # # Listen on the CoA port. # # This uses the normal set of clients, with the same secret as for # authentication and accounting. # listen { type = coa ipaddr = * port = 3799 server = coa } server coa { # When a packet is received, it is processed through the # recv-coa section. This applies to *both* CoA-Request and # Disconnect-Request packets. recv-coa { # CoA && Disconnect packets can be proxied in the same # way as authentication or accounting packets. # Just set Proxy-To-Realm, or Home-Server-Pool, and the # packets will be proxied. # Insert your own policies here. ok } # When a packet is sent, it is processed through the # recv-coa section. This applies to *both* CoA-Request and # Disconnect-Request packets. send-coa { # Sample module. ok } # You can use pre-proxy and post-proxy sections here, too. # They will be processed for sending && receiving proxy packets. } freeradius-server/raddb/sites-available/control-socket000066400000000000000000000036521257552170400235430ustar00rootroot00000000000000# -*- text -*- ###################################################################### # # Control socket interface. # # In the future, we will add username/password checking for # connections to the control socket. We will also add # command authorization, where the commands entered by the # administrator are run through a virtual server before # they are executed. # # For now, anyone who has permission to connect to the socket # has nearly complete control over the server. Be warned! # # This functionality is NOT enabled by default. # # See also the "radmin" program, which is used to communicate # with the server over the control socket. # # $Id$ # ###################################################################### listen { # # Listen on the control socket. # type = control # # Socket location. # # This file is created with the server's uid and gid. # It's permissions are r/w for that user and group, and # no permissions for "other" users. These permissions form # minimal security, and should not be relied on. # socket = ${run_dir}/${name}.sock # # The following two parameters perform authentication and # authorization of connections to the control socket. # # If not set, then ANYONE can connect to the control socket, # and have complete control over the server. This is likely # not what you want. # # One, or both, of "uid" and "gid" should be set. If set, the # corresponding value is checked. Unauthorized users result # in an error message in the log file, and the connection is # closed. # # # Name of user that is allowed to connect to the control socket. # # uid = radius # # Name of group that is allowed to connect to the control socket. # # gid = radius # # Access mode. # # This can be used to give *some* administrators access to # monitor the system, but not to change it. # # ro = read only access (default) # rw = read/write access. # # mode = rw } freeradius-server/raddb/sites-available/copy-acct-to-home-server000066400000000000000000000123361257552170400253300ustar00rootroot00000000000000# -*- text -*- ###################################################################### # # In 2.0.0, radrelay functionality is integrated into the # server core. This virtual server gives an example of # using radrelay functionality inside of the server. # # In this example, the detail file is read, and the packets # are proxied to a home server. You will have to configure # realms, home_server_pool, and home_server in proxy.conf # for this to work. # # The purpose of this virtual server is to enable duplication # of information across a load-balanced, or fail-over set of # servers. For example, if a group of clients lists two # home servers (primary, secondary), then RADIUS accounting # messages will go only to one server at a time. This file # configures a server (primary, secondary) to send copies of # the accounting information to each other. # # That way, each server has the same set of information, and # can make the same decision about the user. # # $Id$ # ###################################################################### server copy-acct-to-home-server { listen { type = detail ###################################################### # # !!!! WARNING !!!! # # The detail file reader acts just like a NAS. # # This means that if accounting fails, the packet # is re-tried FOREVER. It is YOUR responsibility # to write an accounting policy that returns "ok" # if the packet was processed properly, "fail" on # a database error, AND "ok" if you want to ignore # the packet (e.g. no Acct-Status-Type). # # Neither the detail file write OR the detail file # reader look at the contents of the packets. They # just either dump the packet verbatim to the file, # or read it verbatim from the file and pass it to # the server. # ###################################################### # The location where the detail file is located. # This should be on local disk, and NOT on an NFS # mounted location! # # On most systems, this should support file globbing # e.g. "${radacctdir}/detail-*:*" # This lets you write many smaller detail files as in # the example in radiusd.conf: ".../detail-%Y%m%d:%H" # Writing many small files is often better than writing # one large file. File globbing also means that with # a common naming scheme for detail files, then you can # have many detail file writers, and only one reader. filename = ${radacctdir}/detail # # The server can read accounting packets from the # detail file much more quickly than those packets # can be written to a database. If the database is # overloaded, then bad things can happen. # # The server will keep track of how long it takes to # process an entry from the detail file. It will # then pause between handling entries. This pause # allows databases to "catch up", and gives the # server time to notice that other packets may have # arrived. # # The pause is calculated dynamically, to ensure that # the load due to reading the detail files is limited # to a small percentage of CPU time. The # "load_factor" configuration item is a number # between 1 and 100. The server will try to keep the # percentage of time taken by "detail" file entries # to "load_factor" percentage of the CPU time. # # If the "load_factor" is set to 100, then the server # will read packets as fast as it can, usually # causing databases to go into overload. # load_factor = 10 } # # Pre-accounting. Decide which accounting type to use. # preacct { preprocess # Since we're just proxying, we don't need acct_unique. # # Look for IPASS-style 'realm/', and if not found, look for # '@realm', and decide whether or not to proxy, based on # that. # # Accounting requests are generally proxied to the same # home server as authentication requests. # IPASS suffix # ntdomain # # Read the 'acct_users' file. This isn't always # necessary, and can be deleted if you do not use it. files } # # Accounting. Log the accounting data. # accounting { # # Since we're proxying, we don't log anything # locally. Ensure that the accounting section # "succeeds" by forcing an "ok" return. ok } # # When the server decides to proxy a request to a home server, # the proxied request is first passed through the pre-proxy # stage. This stage can re-write the request, or decide to # cancel the proxy. # # Only a few modules currently have this method. # pre-proxy { # attr_rewrite # If you want to have a log of packets proxied to a home # server, un-comment the following line, and the # 'detail pre_proxy_log' section in radiusd.conf. # pre_proxy_log } # # When the server receives a reply to a request it proxied # to a home server, the request may be massaged here, in the # post-proxy stage. # post-proxy { # # If you want to have a log of replies from a home # server, un-comment the following line, and the # 'detail post_proxy_log' section in radiusd.conf. # post_proxy_log # attr_rewrite # Uncomment the following line if you want to filter # replies from remote proxies based on the rules # defined in the 'attrs' file. # attr_filter } } freeradius-server/raddb/sites-available/decoupled-accounting000066400000000000000000000066641257552170400246770ustar00rootroot00000000000000# -*- text -*- ###################################################################### # # This is a sample configuration for "decoupled" accounting. # "Decoupled" accounting is where the accounting packets are # NOT written "live" to the back-end database. This method # can only be used if you are not interested in "live" # accounting. i.e. Where you can tolerate delays that may be # a few seconds, before accounting packets get written to # the DB. # # Oddly enough, this method can speed up the processing of # accounting packets, as all database activity is serialized. # # This file is NOT meant to be used as-is. It needs to be # edited to match your local configuration. # # $Id$ # ###################################################################### # Define a virtual server to write the accounting packets. # Any "listen" section that listens on an accounting port should # set "virtual_server = write-detail.example.com server write_detail.example.com { accounting { # # Write the "detail" files. # # See raddb/modules/detail.example.com for more info. detail.example.com } # That's it! } # Define a virtual server to process the accounting packets. server read-detail.example.com { # Read accounting packets from the detail file(s) for # the home server. listen { type = detail filename = "${radacctdir}/detail.example.com/detail-*:*" load_factor = 10 } # All packets read from the detail file are processed through # the preacct && accounting sections. # # The following text is copied verbatim from sites-available/default. # You should edit it for your own local configuration. # # Pre-accounting. Decide which accounting type to use. # preacct { preprocess # # Ensure that we have a semi-unique identifier for every # request, and many NAS boxes are broken. acct_unique # # Look for IPASS-style 'realm/', and if not found, look for # '@realm', and decide whether or not to proxy, based on # that. # # Accounting requests are generally proxied to the same # home server as authentication requests. # IPASS suffix # ntdomain # # Read the 'acct_users' file files } # # Accounting. Log the accounting data. # accounting { # # Create a 'detail'ed log of the packets. # Note that accounting requests which are proxied # are also logged in the detail file. detail # daily # Update the wtmp file # # If you don't use "radlast", you can delete this line. unix # # For Simultaneous-Use tracking. # # Due to packet losses in the network, the data here # may be incorrect. There is little we can do about it. radutmp # sradutmp # Return an address to the IP Pool when we see a stop record. # main_pool # # Log traffic to an SQL database. # # NOTE! You will have to ensure that any accounting packets # NOT handled by the SQL module (e.g. "stop with zero session length" # result in the accounting section still returning "ok". # # Otherwise, the server will think that the accounting packet # was NOT handled properly, and will keep trying to process it # through this virtual server! # # See "Accounting queries" in sql.conf # sql # # Instead of sending the query to the SQL server, # write it into a log file. # # sql_log # Cisco VoIP specific bulk accounting # pgsql-voip # Filter attributes from the accounting response. attr_filter.accounting_response # # See "Autz-Type Status-Server" for how this works. # # Acct-Type Status-Server { # # } } } freeradius-server/raddb/sites-available/default000066400000000000000000000455001257552170400222170ustar00rootroot00000000000000###################################################################### # # As of 2.0.0, FreeRADIUS supports virtual hosts using the # "server" section, and configuration directives. # # Virtual hosts should be put into the "sites-available" # directory. Soft links should be created in the "sites-enabled" # directory to these files. This is done in a normal installation. # # If you are using 802.1X (EAP) authentication, please see also # the "inner-tunnel" virtual server. You wll likely have to edit # that, too, for authentication to work. # # $Id$ # ###################################################################### # # Read "man radiusd" before editing this file. See the section # titled DEBUGGING. It outlines a method where you can quickly # obtain the configuration you want, without running into # trouble. See also "man unlang", which documents the format # of this file. # # This configuration is designed to work in the widest possible # set of circumstances, with the widest possible number of # authentication methods. This means that in general, you should # need to make very few changes to this file. # # The best way to configure the server for your local system # is to CAREFULLY edit this file. Most attempts to make large # edits to this file will BREAK THE SERVER. Any edits should # be small, and tested by running the server with "radiusd -X". # Once the edits have been verified to work, save a copy of these # configuration files somewhere. (e.g. as a "tar" file). Then, # make more edits, and test, as above. # # There are many "commented out" references to modules such # as ldap, sql, etc. These references serve as place-holders. # If you need the functionality of that module, then configure # it in radiusd.conf, and un-comment the references to it in # this file. In most cases, those small changes will result # in the server being able to connect to the DB, and to # authenticate users. # ###################################################################### # # In 1.x, the "authorize", etc. sections were global in # radiusd.conf. As of 2.0, they SHOULD be in a server section. # # The server section with no virtual server name is the "default" # section. It is used when no server name is specified. # # We don't indent the rest of this file, because doing so # would make it harder to read. # # Authorization. First preprocess (hints and huntgroups files), # then realms, and finally look in the "users" file. # # Any changes made here should also be made to the "inner-tunnel" # virtual server. # # The order of the realm modules will determine the order that # we try to find a matching realm. # # Make *sure* that 'preprocess' comes before any realm if you # need to setup hints for the remote radius server authorize { # # Security settings. Take a User-Name, and do some simple # checks on it, for spaces and other invalid characters. If # it looks like the user is trying to play games, reject it. # # This should probably be enabled by default. # # See policy.conf for the definition of the filter_username policy. # # filter_username # # The preprocess module takes care of sanitizing some bizarre # attributes in the request, and turning them into attributes # which are more standard. # # It takes care of processing the 'raddb/hints' and the # 'raddb/huntgroups' files. preprocess # # If you want to have a log of authentication requests, # un-comment the following line, and the 'detail auth_log' # section, above. # auth_log # # The chap module will set 'Auth-Type := CHAP' if we are # handling a CHAP request and Auth-Type has not already been set chap # # If the users are logging in with an MS-CHAP-Challenge # attribute for authentication, the mschap module will find # the MS-CHAP-Challenge attribute, and add 'Auth-Type := MS-CHAP' # to the request, which will cause the server to then use # the mschap module for authentication. mschap # # If you have a Cisco SIP server authenticating against # FreeRADIUS, uncomment the following line, and the 'digest' # line in the 'authenticate' section. digest # # The WiMAX specification says that the Calling-Station-Id # is 6 octets of the MAC. This definition conflicts with # RFC 3580, and all common RADIUS practices. Un-commenting # the "wimax" module here means that it will fix the # Calling-Station-Id attribute to the normal format as # specified in RFC 3580 Section 3.21 # wimax # # Look for IPASS style 'realm/', and if not found, look for # '@realm', and decide whether or not to proxy, based on # that. # IPASS # # If you are using multiple kinds of realms, you probably # want to set "ignore_null = yes" for all of them. # Otherwise, when the first style of realm doesn't match, # the other styles won't be checked. # suffix # ntdomain # # This module takes care of EAP-MD5, EAP-TLS, and EAP-LEAP # authentication. # # It also sets the EAP-Type attribute in the request # attribute list to the EAP type from the packet. # # As of 2.0, the EAP module returns "ok" in the authorize stage # for TTLS and PEAP. In 1.x, it never returned "ok" here, so # this change is compatible with older configurations. # # The example below uses module failover to avoid querying all # of the following modules if the EAP module returns "ok". # Therefore, your LDAP and/or SQL servers will not be queried # for the many packets that go back and forth to set up TTLS # or PEAP. The load on those servers will therefore be reduced. # eap { ok = return } # # Pull crypt'd passwords from /etc/passwd or /etc/shadow, # using the system API's to get the password. If you want # to read /etc/passwd or /etc/shadow directly, see the # passwd module in radiusd.conf. # # unix # # Read the 'users' file files # # Look in an SQL database. The schema of the database # is meant to mirror the "users" file. # # See "Authorization Queries" in sql.conf # sql # # If you are using /etc/smbpasswd, and are also doing # mschap authentication, the un-comment this line, and # configure the 'smbpasswd' module. # smbpasswd # # The ldap module will set Auth-Type to LDAP if it has not # already been set # ldap # # Enforce daily limits on time spent logged in. # daily # # Use the checkval module # checkval expiration logintime # # If no other module has claimed responsibility for # authentication, then try to use PAP. This allows the # other modules listed above to add a "known good" password # to the request, and to do nothing else. The PAP module # will then see that password, and use it to do PAP # authentication. # # This module should be listed last, so that the other modules # get a chance to set Auth-Type for themselves. # pap # # If "status_server = yes", then Status-Server messages are passed # through the following section, and ONLY the following section. # This permits you to do DB queries, for example. If the modules # listed here return "fail", then NO response is sent. # # Autz-Type Status-Server { # # } } # Authentication. # # # This section lists which modules are available for authentication. # Note that it does NOT mean 'try each module in order'. It means # that a module from the 'authorize' section adds a configuration # attribute 'Auth-Type := FOO'. That authentication type is then # used to pick the apropriate module from the list below. # # In general, you SHOULD NOT set the Auth-Type attribute. The server # will figure it out on its own, and will do the right thing. The # most common side effect of erroneously setting the Auth-Type # attribute is that one authentication method will work, but the # others will not. # # The common reasons to set the Auth-Type attribute by hand # is to either forcibly reject the user (Auth-Type := Reject), # or to or forcibly accept the user (Auth-Type := Accept). # # Note that Auth-Type := Accept will NOT work with EAP. # # Please do not put "unlang" configurations into the "authenticate" # section. Put them in the "post-auth" section instead. That's what # the post-auth section is for. # authenticate { # # PAP authentication, when a back-end database listed # in the 'authorize' section supplies a password. The # password can be clear-text, or encrypted. Auth-Type PAP { pap } # # Most people want CHAP authentication # A back-end database listed in the 'authorize' section # MUST supply a CLEAR TEXT password. Encrypted passwords # won't work. Auth-Type CHAP { chap } # # MSCHAP authentication. Auth-Type MS-CHAP { mschap } # # If you have a Cisco SIP server authenticating against # FreeRADIUS, uncomment the following line, and the 'digest' # line in the 'authorize' section. digest # # Pluggable Authentication Modules. # pam # # See 'man getpwent' for information on how the 'unix' # module checks the users password. Note that packets # containing CHAP-Password attributes CANNOT be authenticated # against /etc/passwd! See the FAQ for details. # # For normal "crypt" authentication, the "pap" module should # be used instead of the "unix" module. The "unix" module should # be used for authentication ONLY for compatibility with legacy # FreeRADIUS configurations. # unix # Uncomment it if you want to use ldap for authentication # # Note that this means "check plain-text password against # the ldap database", which means that EAP won't work, # as it does not supply a plain-text password. # Auth-Type LDAP { # ldap # } # # Allow EAP authentication. eap # # The older configurations sent a number of attributes in # Access-Challenge packets, which wasn't strictly correct. # If you want to filter out these attributes, uncomment # the following lines. # # Auth-Type eap { # eap { # handled = 1 # } # if (handled && (Response-Packet-Type == Access-Challenge)) { # attr_filter.access_challenge.post-auth # handled # override the "updated" code from attr_filter # } # } } # # Pre-accounting. Decide which accounting type to use. # preacct { preprocess # # Session start times are *implied* in RADIUS. # The NAS never sends a "start time". Instead, it sends # a start packet, *possibly* with an Acct-Delay-Time. # The server is supposed to conclude that the start time # was "Acct-Delay-Time" seconds in the past. # # The code below creates an explicit start time, which can # then be used in other modules. # # The start time is: NOW - delay - session_length # # update request { # FreeRADIUS-Acct-Session-Start-Time = "%{expr: %l - %{%{Acct-Session-Time}:-0} - %{%{Acct-Delay-Time}:-0}}" # } # # Ensure that we have a semi-unique identifier for every # request, and many NAS boxes are broken. acct_unique # # Look for IPASS-style 'realm/', and if not found, look for # '@realm', and decide whether or not to proxy, based on # that. # # Accounting requests are generally proxied to the same # home server as authentication requests. # IPASS suffix # ntdomain # # Read the 'acct_users' file files } # # Accounting. Log the accounting data. # accounting { # # Create a 'detail'ed log of the packets. # Note that accounting requests which are proxied # are also logged in the detail file. detail # daily # Update the wtmp file # # If you don't use "radlast", you can delete this line. # unix # # For Simultaneous-Use tracking. # # Due to packet losses in the network, the data here # may be incorrect. There is little we can do about it. # radutmp # sradutmp # Return an address to the IP Pool when we see a stop record. # main_pool # # Log traffic to an SQL database. # # See "Accounting queries" in sql.conf # sql # # If you receive stop packets with zero session length, # they will NOT be logged in the database. The SQL module # will print a message (only in debugging mode), and will # return "noop". # # You can ignore these packets by uncommenting the following # three lines. Otherwise, the server will not respond to the # accounting request, and the NAS will retransmit. # # if (noop) { # ok # } # # Instead of sending the query to the SQL server, # write it into a log file. # # sql_log # Cisco VoIP specific bulk accounting # pgsql-voip # For Exec-Program and Exec-Program-Wait exec # Filter attributes from the accounting response. attr_filter.accounting_response # # See "Autz-Type Status-Server" for how this works. # # Acct-Type Status-Server { # # } } # Session database, used for checking Simultaneous-Use. Either the radutmp # or rlm_sql module can handle this. # The rlm_sql module is *much* faster session { radutmp # # See "Simultaneous Use Checking Queries" in sql.conf # sql } # Post-Authentication # Once we KNOW that the user has been authenticated, there are # additional steps we can take. post-auth { # Get an address from the IP Pool. # main_pool # # If you want to have a log of authentication replies, # un-comment the following line, and the 'detail reply_log' # section, above. # reply_log # # After authenticating the user, do another SQL query. # # See "Authentication Logging Queries" in sql.conf # sql # # Instead of sending the query to the SQL server, # write it into a log file. # # sql_log # # Un-comment the following if you have set # 'edir_account_policy_check = yes' in the ldap module sub-section of # the 'modules' section. # # ldap # For Exec-Program and Exec-Program-Wait exec # # Calculate the various WiMAX keys. In order for this to work, # you will need to define the WiMAX NAI, usually via # # update request { # WiMAX-MN-NAI = "%{User-Name}" # } # # If you want various keys to be calculated, you will need to # update the reply with "template" values. The module will see # this, and replace the template values with the correct ones # taken from the cryptographic calculations. e.g. # # update reply { # WiMAX-FA-RK-Key = 0x00 # WiMAX-MSK = "%{EAP-MSK}" # } # # You may want to delete the MS-MPPE-*-Keys from the reply, # as some WiMAX clients behave badly when those attributes # are included. See "raddb/modules/wimax", configuration # entry "delete_mppe_keys" for more information. # # wimax # If there is a client certificate (EAP-TLS, sometimes PEAP # and TTLS), then some attributes are filled out after the # certificate verification has been performed. These fields # MAY be available during the authentication, or they may be # available only in the "post-auth" section. # # The first set of attributes contains information about the # issuing certificate which is being used. The second # contains information about the client certificate (if # available). # # update reply { # Reply-Message += "%{TLS-Cert-Serial}" # Reply-Message += "%{TLS-Cert-Expiration}" # Reply-Message += "%{TLS-Cert-Subject}" # Reply-Message += "%{TLS-Cert-Issuer}" # Reply-Message += "%{TLS-Cert-Common-Name}" # Reply-Message += "%{TLS-Cert-Subject-Alt-Name-Email}" # # Reply-Message += "%{TLS-Client-Cert-Serial}" # Reply-Message += "%{TLS-Client-Cert-Expiration}" # Reply-Message += "%{TLS-Client-Cert-Subject}" # Reply-Message += "%{TLS-Client-Cert-Issuer}" # Reply-Message += "%{TLS-Client-Cert-Common-Name}" # Reply-Message += "%{TLS-Client-Cert-Subject-Alt-Name-Email}" # } # MacSEC requires the use of EAP-Key-Name. However, we don't # want to send it for all EAP sessions. Therefore, the EAP # modules put required data into the EAP-Session-Id attribute. # This attribute is never put into a request or reply packet. # # Uncomment the next few lines to copy the required data into # the EAP-Key-Name attribute # if (reply:EAP-Session-Id) { # update reply { # EAP-Key-Name := "%{reply:EAP-Session-Id}" # } # } # If the WiMAX module did it's work, you may want to do more # things here, like delete the MS-MPPE-*-Key attributes. # # if (updated) { # update reply { # MS-MPPE-Recv-Key !* 0x00 # MS-MPPE-Send-Key !* 0x00 # } # } # # Access-Reject packets are sent through the REJECT sub-section of the # post-auth section. # # Add the ldap module name (or instance) if you have set # 'edir_account_policy_check = yes' in the ldap module configuration # Post-Auth-Type REJECT { # log failed authentications in SQL, too. # sql # Insert EAP-Failure message if the request was # rejected by policy instead of because of an # authentication failure eap attr_filter.access_reject } } # # When the server decides to proxy a request to a home server, # the proxied request is first passed through the pre-proxy # stage. This stage can re-write the request, or decide to # cancel the proxy. # # Only a few modules currently have this method. # pre-proxy { # attr_rewrite # Uncomment the following line if you want to change attributes # as defined in the preproxy_users file. # files # Uncomment the following line if you want to filter requests # sent to remote servers based on the rules defined in the # 'attrs.pre-proxy' file. # attr_filter.pre-proxy # If you want to have a log of packets proxied to a home # server, un-comment the following line, and the # 'detail pre_proxy_log' section, above. # pre_proxy_log } # # When the server receives a reply to a request it proxied # to a home server, the request may be massaged here, in the # post-proxy stage. # post-proxy { # If you want to have a log of replies from a home server, # un-comment the following line, and the 'detail post_proxy_log' # section, above. # post_proxy_log # attr_rewrite # Uncomment the following line if you want to filter replies from # remote proxies based on the rules defined in the 'attrs' file. # attr_filter.post-proxy # # If you are proxying LEAP, you MUST configure the EAP # module, and you MUST list it here, in the post-proxy # stage. # # You MUST also use the 'nostrip' option in the 'realm' # configuration. Otherwise, the User-Name attribute # in the proxied request will not match the user name # hidden inside of the EAP packet, and the end server will # reject the EAP request. # eap # # If the server tries to proxy a request and fails, then the # request is processed through the modules in this section. # # The main use of this section is to permit robust proxying # of accounting packets. The server can be configured to # proxy accounting packets as part of normal processing. # Then, if the home server goes down, accounting packets can # be logged to a local "detail" file, for processing with # radrelay. When the home server comes back up, radrelay # will read the detail file, and send the packets to the # home server. # # With this configuration, the server always responds to # Accounting-Requests from the NAS, but only writes # accounting packets to disk if the home server is down. # # Post-Proxy-Type Fail { # detail # } } freeradius-server/raddb/sites-available/dhcp000066400000000000000000000167471257552170400215240ustar00rootroot00000000000000# -*- text -*- ###################################################################### # # This is a virtual server that handles DHCP. # # !!!! WARNING !!!! # # This code is experimental, and SHOULD NOT be used in a # production system. It is intended for validation and # experimentation ONLY. # # In order for this to work, you will need to run configure: # # $ ./configure --with-dhcp # $ make # $ vi share/dictionary # # ## Un-comment the line containing $INCLUDE dictionary.dhcp # ## Then, save the file. # # $ make install # # DHCP is NOT enabled by default. # # The goal of this effort is to get the code in front of # people who are interested in another DHCP server. # We NEED FEEDBACK, patches, bug reports, etc. Especially patches! # # Please contribute, or this work will be nothing more than # a curiosity. # # # Q: What does it do? # A: It allows the server to receive DHCP packets, and to # respond with static, pre-configured DHCP responses. # # Q: Does it do static/dynamic IP assignment? # A: No. Or, maybe. Try it and see. # # Q: Does it read ISC configuration or lease files? # A: No. Please submit patches. # # Q: Does it have DHCP feature X? # A: No. Please submit patches. # # Q: Does it support option 82? # A: Yes. # # Q: Does it support other options? # A: Maybe. See dictionary.dhcp. Please submit patches. # # Q: It doesn't seem to do much of anything! # A: Exactly. # # $Id$ # ###################################################################### # # The DHCP functionality goes into a virtual server. # server dhcp { # Define a DHCP socket. # # The default port below is 6700, so you don't break your network. # If you want it to do real DHCP, change this to 67, and good luck! # # You can also bind the DHCP socket to an interface. # See below, and raddb/radiusd.conf for examples. # # This lets you run *one* DHCP server instance and have it listen on # multiple interfaces, each with a separate policy. # # If you have multiple interfaces, it is a good idea to bind the # listen section to an interface. You will also need one listen # section per interface. # # FreeBSD does *not* support binding sockets to interfaces. Therefore, # if you have multiple interfaces, broadcasts may go out of the wrong # one, or even all interfaces. The solution is to use the "setfib" command. # If you have a network "10.10.0/24" on LAN1, you will need to do: # # Pick any IP on the 10.10.0/24 network # $ setfib 1 route add default 10.10.0.1 # # Edit /etc/rc.local, and add a line: # setfib 1 /path/to/radiusd # # The kern must be built with the following options: # options ROUTETABLES=2 # or any value larger than 2. # # The other only solution is to update FreeRADIUS to use BPF sockets. # # So that we only specify these values once, and then # use them in all of the listen sections. port = 6700 ipaddr = 127.0.0.1 interface = lo0 # When the machine is not Linux, or has only one network # interface, use the following listener. It receives # broadcast *and* unicast packets. listen { type = dhcp ipaddr = * port = ${..port} interface = ${..interface} # The DHCP server defaults to allowing broadcast packets. # Set this to "no" only when the server receives *all* packets # from a relay agent. i.e. when *no* clients are on the same # LAN as the DHCP server. # # It's set to "no" here for testing. broadcast = no } # When the machine is Linux and has multiple network interfaces, use # the following two listeners instead of the one above. # Listen for broadcasts on a specific interface. listen { type = dhcp ipaddr = 255.255.255.255 port = ${..port} interface = ${..interface} # # The source IP for unicast packets is chosen from the first # one of the following items which returns a valid IP # address: # # src_ipaddr # ipaddr # reply:DHCP-Server-IP-Address # reply:DHCP-DHCP-Server-Identifier # # For now, use the parent's "ipaddr", not the one # in this listen section # src_ipaddr = ${..ipaddr} } # Listen for unicasts on an IP, but not bound to any interface. # This allows Linux systems to receive packets on interface X # when the IP is associated with interface Y. # # Then, define which interface the packets go out of, via # "src_interface". This means that the outbound packets # get sent via the correct interface. listen { type = dhcp ipaddr = ${..ipaddr} port = ${..port} # # When sending unicast responses, this interface is # used as the source interface. If unset, the value # is taken from the "interface" field in this # section. # # This interface is also used when adding ARP entries. # FreeRADIUS doesn't open "raw" network sockets to send # unicast DHCP responses on the local network. Instead, # it updates the ARP table for this interface with the # MAX and IP of the DHCP client. The server can then # send a normal UDP unicast socket. # # NOTE: The server MUST be running as "root" in order # to update the ARP table. Or, it must have the # apropriate capabilities added to it after it starts up. # src_interface = ${..interface} } # Packets received on the socket will be processed through one # of the following sections, named after the DHCP packet type. # See dictionary.dhcp for the packet types. dhcp DHCP-Discover { update reply { DHCP-Message-Type = DHCP-Offer } # The contents here are invented. Change them! update reply { DHCP-Domain-Name-Server = 127.0.0.1 DHCP-Domain-Name-Server = 127.0.0.2 DHCP-Subnet-Mask = 255.255.255.0 DHCP-Router-Address = 192.168.1.1 DHCP-IP-Address-Lease-Time = 86400 DHCP-DHCP-Server-Identifier = 192.168.1.1 } # Do a simple mapping of MAC to assigned IP. # # See below for the definition of the "mac2ip" # module. # #mac2ip # If the MAC wasn't found in that list, do something else. # You could call a Perl, Python, or Java script here. #if (notfound) { # ... #} # Or, allocate IPs from the DHCP pool in SQL. # dhcp_sqlippool ok } dhcp DHCP-Request { update reply { DHCP-Message-Type = DHCP-Ack } # The contents here are invented. Change them! update reply { DHCP-Domain-Name-Server = 127.0.0.1 DHCP-Domain-Name-Server = 127.0.0.2 DHCP-Subnet-Mask = 255.255.255.0 DHCP-Router-Address = 192.168.1.1 DHCP-IP-Address-Lease-Time = 86400 DHCP-DHCP-Server-Identifier = 192.168.1.1 } # Do a simple mapping of MAC to assigned IP. # # See below for the definition of the "mac2ip" # module. # #mac2ip # If the MAC wasn't found in that list, do something else. # You could call a Perl, Python, or Java script here. #if (notfound) { # ... #} # Or, allocate IPs from the DHCP pool in SQL. # dhcp_sqlippool ok } # If there's no named section for the packet type, then the packet # is processed through this section. dhcp { # send a DHCP NAK. reject } } ###################################################################### # # This next section is a sample configuration for the "passwd" # module, that reads flat-text files. It should go into # radiusd.conf, in the "modules" section. # # The file is in the format , # # 00:01:02:03:04:05,192.168.1.100 # 01:01:02:03:04:05,192.168.1.101 # 02:01:02:03:04:05,192.168.1.102 # # This lets you perform simple static IP assignment. # ###################################################################### #passwd mac2ip { # filename = ${confdir}/mac2ip # format = "*DHCP-Client-Hardware-Address:=DHCP-Your-IP-Address" # delimiter = "," #} freeradius-server/raddb/sites-available/dhcp.relay000066400000000000000000000031211257552170400226150ustar00rootroot00000000000000# -*- text -*- ###################################################################### # # This is a virtual server that handles DHCP relaying # # Only one server can listen on a socket, so you cannot # do DHCP relaying && run a DHCP server at the same time. # ###################################################################### server dhcp.eth1 { # When the machine is not Linux, or has only one network interface, use # the following listener: listen { # Listen for broadcasts + unicast on eth1 ipaddr = * port = 67 type = dhcp interface = eth1 } # When the machine is Linux and has multiple network interfaces, use # the following listeners instead: listen { # Listen for broadcasts on eth1 ipaddr = 255.255.255.255 port = 67 type = dhcp interface = eth1 } listen { # Listen for unicast on our IP address, not bound to any # interface but telling on which interface to forward the # packets to. ipaddr = 192.0.100.2 port = 67 type = dhcp arp_interface = eth1 } # Packets received on the socket will be processed through one # of the following sections, named after the DHCP packet type. # See dictionary.dhcp for the packet types. dhcp DHCP-Discover { update config { # IP Address of the DHCP server DHCP-Relay-To-IP-Address := 192.0.1.2 } update request { # IP Address of the DHCP relay (eth1) DHCP-Gateway-IP-Address := 192.0.100.2 } ok } dhcp DHCP-Request { update config { # IP Address of the DHCP server DHCP-Relay-To-IP-Address := 192.0.1.2 } update request { DHCP-Gateway-IP-Address := 192.0.100.2 } ok } } freeradius-server/raddb/sites-available/dynamic-clients000066400000000000000000000156331257552170400236620ustar00rootroot00000000000000# -*- text -*- ###################################################################### # # Sample configuration file for dynamically updating the list # of RADIUS clients at run time. # # Everything is keyed off of a client "network". (e.g. 192.168/16) # This configuration lets the server know that clients within # that network are defined dynamically. # # When the server receives a packet from an unknown IP address # within that network, it tries to find a dynamic definition # for that client. If the definition is found, the IP address # (and other configuration) is added to the server's internal # cache of "known clients", with a configurable lifetime. # # Further packets from that IP address result in the client # definition being found in the cache. Once the lifetime is # reached, the client definition is deleted, and any new requests # from that client are looked up as above. # # If the dynamic definition is not found, then the request is # treated as if it came from an unknown client. i.e. It is # silently discarded. # # As part of protection from Denial of Service (DoS) attacks, # the server will add only one new client per second. This CANNOT # be changed, and is NOT configurable. # # $Id$ # ###################################################################### # # Define a network where clients may be dynamically defined. client dynamic { ipaddr = 192.168.0.0 # # You MUST specify a netmask! # IPv4 /32 or IPv6 /128 are NOT allowed! netmask = 16 # # Any other configuration normally found in a "client" # entry can be used here. # # A shared secret does NOT have to be defined. It can # be left out. # # Define the virtual server used to discover dynamic clients. dynamic_clients = dynamic_client_server # # The directory where client definitions are stored. This # needs to be used ONLY if the client definitions are stored # in flat-text files. Each file in that directory should be # ONE and only one client definition. The name of the file # should be the IP address of the client. # # If you are storing clients in SQL, this entry should not # be used. # directory = ${confdir}/dynamic-clients/ # # Define the lifetime (in seconds) for dynamic clients. # They will be cached for this lifetime, and deleted afterwards. # # If the lifetime is "0", then the dynamic client is never # deleted. The only way to delete the client is to re-start # the server. lifetime = 3600 } # # This is the virtual server referenced above by "dynamic_clients". server dynamic_client_server { # # The only contents of the virtual server is the "authorize" section. authorize { # # Put any modules you want here. SQL, LDAP, "exec", # Perl, etc. The only requirements is that the # attributes MUST go into the control item list. # # The request that is processed through this section # is EMPTY. There are NO attributes. The request is fake, # and is NOT the packet that triggered the lookup of # the dynamic client. # # The ONLY piece of useful information is either # # Packet-Src-IP-Address (IPv4 clients) # Packet-Src-IPv6-Address (IPv6 clients) # # The attributes used to define a dynamic client mirror # the configuration items in the "client" structure. # # # Example 1: Hard-code a client IP. This example is # useless, but it documents the attributes # you need. # update control { # # Echo the IP address of the client. FreeRADIUS-Client-IP-Address = "%{Packet-Src-IP-Address}" # require_message_authenticator FreeRADIUS-Client-Require-MA = no # secret FreeRADIUS-Client-Secret = "testing123" # shortname FreeRADIUS-Client-Shortname = "%{Packet-Src-IP-Address}" # nastype FreeRADIUS-Client-NAS-Type = "other" # virtual_server # # This can ONLY be used if the network client # definition (e.g. "client dynamic" above) has # NO virtual_server defined. # # If the network client definition does have a # virtual_server defined, then that is used, # and there is no need to define this attribute. # FreeRADIUS-Client-Virtual-Server = "something" } # # Example 2: Read the clients from "clients" files # in a directory. # # This requires you to uncomment the # "directory" configuration in the # "client dynamic" configuration above, # and then put one file per IP address in # that directory. # dynamic_clients # # Example 3: Look the clients up in SQL. # # This requires the SQL module to be configured, of course. if ("%{sql: SELECT nasname FROM nas WHERE nasname = '%{Packet-Src-IP-Address}'}") { update control { # # Echo the IP. FreeRADIUS-Client-IP-Address = "%{Packet-Src-IP-Address}" # # Do multiple SELECT statements to grab # the various definitions. FreeRADIUS-Client-Shortname = "%{sql: SELECT shortname FROM nas WHERE nasname = '%{Packet-Src-IP-Address}'}" FreeRADIUS-Client-Secret = "%{sql: SELECT secret FROM nas WHERE nasname = '%{Packet-Src-IP-Address}'}" FreeRADIUS-Client-NAS-Type = "%{sql: SELECT type FROM nas WHERE nasname = '%{Packet-Src-IP-Address}'}" FreeRADIUS-Client-Virtual-Server = "%{sql: SELECT server FROM nas WHERE nasname = '%{Packet-Src-IP-Address}'}" } } # Do an LDAP lookup in the elements OU, check to see if # the Packet-Src-IP-Address object has a "ou" # attribute, if it does continue. Change "ACME.COM" to # the real OU of your organization. # # Assuming the following schema: # # OU=Elements,OU=Radius,DC=ACME,DC=COM # # Elements will hold a record of every NAS in your # Network. Create Group objects based on the IP # Address of the NAS and set the "Location" or "l" # attribute to the NAS Huntgroup the NAS belongs to # allow them to be centrally managed in LDAP. # # e.g. CN=10.1.2.3,OU=Elements,OU=Radius,DC=ACME,DC=COM # # With a "l" value of "CiscoRTR" for a Cisco Router # that has a NAS-IP-Address or Source-IP-Address of # 10.1.2.3. # # And with a "ou" value of the shared secret password # for the NAS element. ie "password" if ("%{ldap:ldap:///OU=Elements,OU=Radius,DC=ACME,DC=COM?ou?sub?cn=%{Packet-Src-IP-Address}}") { update control { FreeRADIUS-Client-IP-Address = "%{Packet-Src-IP-Address}" # Set the Client-Shortname to be the Location # "l" just like in the Huntgroups, but this # time to the shortname. FreeRADIUS-Client-Shortname = "%{ldap:ldap:///OU=Elements,OU=Radius,DC=ACME,DC=COM?l?sub?cn=%{Packet-Src-IP-Address}}" # Lookup and set the Shared Secret based on # the "ou" attribute. FreeRADIUS-Client-Secret = "%{ldap:ldap:///OU=Elements,OU=Radius,DC=ACME,DC=COM?ou?sub?cn=%{Packet-Src-IP-Address}}" } } # # Tell the caller that the client was defined properly. # # If the authorize section does NOT return "ok", then # the new client is ignored. ok } } freeradius-server/raddb/sites-available/example000066400000000000000000000064141257552170400222270ustar00rootroot00000000000000###################################################################### # # An example virtual server configuration. # # $Id$ # ###################################################################### # # This client will be available to any "listen" section that # are defined outside of a virtual server section. However, # when the server receives a packet from this client, the # request will be processed through the "example" virtual # server, as the "client" section contains a configuration item # to that effect. # # Note that this client will be able to send requests to any # port defined in a global "listen" section. It will NOT, # however, be able to send requests to a port defined in a # "listen" section that is contained in a "server" section. # # With careful matching of configurations, you should be able # to: # # - Define one authentication port, but process each client # through a separate virtual server. # # - define multiple authentication ports, each with a private # list of clients. # # - define multiple authentication ports, each of which may # have the same client listed, but with different shared # secrets # # FYI: We use an address in the 192.0.2.* space for this example, # as RFC 3330 says that that /24 range is used for documenation # and examples, and should not appear on the net. You shouldn't # use it for anything, either. # client 192.0.2.10 { shortname = example-client secret = testing123 virtual_server = example } ###################################################################### # # An example virtual server. It starts off with "server name {" # The "name" is used to reference this server from a "listen" # or "client" section. # ###################################################################### server example { # # Listen on 192.0.2.1:1812 for Access-Requests # # When the server receives a packet, it is processed # through the "authorize", etc. sections listed here, # NOT the global ones the "default" site. # listen { ipaddr = 192.0.2.1 port = 1821 type = auth } # # This client is listed within the "server" section, # and is therefore known ONLY to the socket defined # in the "listen" section above. If the client IP # sends a request to a different socket, the server # will treat it as an unknown client, and will not # respond. # # In contrast, the client listed at the top of this file # is outside of any "server" section, and is therefore # global in scope. It can send packets to any port # defined in a global "listen" section. It CANNOT send # packets to the listen section defined above, though. # # Note that you don't have to have a "virtual_server = example" # line here, as the client is encapsulated within # the "server" section. # client 192.0.2.9 { shortname = example-client secret = testing123 } authorize { # # Some example policies. See "man unlang" for more. # if ("%{User-Name}" == "bob") { update control { Cleartext-Password := "bob" } } # # And then reject the user. The next line requires # that the "always reject {}" section is defined in # the "modules" section of radiusd.conf. # reject } authenticate { } post-auth { Post-Auth-Type Reject { update reply { Reply-Message = "This is only an example." } } } } freeradius-server/raddb/sites-available/inner-tunnel000066400000000000000000000277751257552170400232270ustar00rootroot00000000000000# -*- text -*- ###################################################################### # # This is a virtual server that handles *only* inner tunnel # requests for EAP-TTLS and PEAP types. # # $Id$ # ###################################################################### server inner-tunnel { # # This next section is here to allow testing of the "inner-tunnel" # authentication methods, independently from the "default" server. # It is listening on "localhost", so that it can only be used from # the same machine. # # $ radtest USER PASSWORD 127.0.0.1:18120 0 testing123 # # If it works, you have configured the inner tunnel correctly. To check # if PEAP will work, use: # # $ radtest -t mschap USER PASSWORD 127.0.0.1:18120 0 testing123 # # If that works, PEAP should work. If that command doesn't work, then # # FIX THE INNER TUNNEL CONFIGURATION SO THAT IT WORKS. # # Do NOT do any PEAP tests. It won't help. Instead, concentrate # on fixing the inner tunnel configuration. DO NOTHING ELSE. # listen { ipaddr = 127.0.0.1 port = 18120 type = auth } # Authorization. First preprocess (hints and huntgroups files), # then realms, and finally look in the "users" file. # # The order of the realm modules will determine the order that # we try to find a matching realm. # # Make *sure* that 'preprocess' comes before any realm if you # need to setup hints for the remote radius server authorize { # # The chap module will set 'Auth-Type := CHAP' if we are # handling a CHAP request and Auth-Type has not already been set chap # # If the users are logging in with an MS-CHAP-Challenge # attribute for authentication, the mschap module will find # the MS-CHAP-Challenge attribute, and add 'Auth-Type := MS-CHAP' # to the request, which will cause the server to then use # the mschap module for authentication. mschap # # Pull crypt'd passwords from /etc/passwd or /etc/shadow, # using the system API's to get the password. If you want # to read /etc/passwd or /etc/shadow directly, see the # passwd module, above. # # unix # # Look for IPASS style 'realm/', and if not found, look for # '@realm', and decide whether or not to proxy, based on # that. # IPASS # # If you are using multiple kinds of realms, you probably # want to set "ignore_null = yes" for all of them. # Otherwise, when the first style of realm doesn't match, # the other styles won't be checked. # # Note that proxying the inner tunnel authentication means # that the user MAY use one identity in the outer session # (e.g. "anonymous", and a different one here # (e.g. "user@example.com"). The inner session will then be # proxied elsewhere for authentication. If you are not # careful, this means that the user can cause you to forward # the authentication to another RADIUS server, and have the # accounting logs *not* sent to the other server. This makes # it difficult to bill people for their network activity. # suffix # ntdomain # # The "suffix" module takes care of stripping the domain # (e.g. "@example.com") from the User-Name attribute, and the # next few lines ensure that the request is not proxied. # # If you want the inner tunnel request to be proxied, delete # the next few lines. # update control { Proxy-To-Realm := LOCAL } # # This module takes care of EAP-MSCHAPv2 authentication. # # It also sets the EAP-Type attribute in the request # attribute list to the EAP type from the packet. # # The example below uses module failover to avoid querying all # of the following modules if the EAP module returns "ok". # Therefore, your LDAP and/or SQL servers will not be queried # for the many packets that go back and forth to set up TTLS # or PEAP. The load on those servers will therefore be reduced. # eap { ok = return } # # Read the 'users' file files # # Look in an SQL database. The schema of the database # is meant to mirror the "users" file. # # See "Authorization Queries" in sql.conf # sql # # If you are using /etc/smbpasswd, and are also doing # mschap authentication, the un-comment this line, and # configure the 'etc_smbpasswd' module, above. # etc_smbpasswd # # The ldap module will set Auth-Type to LDAP if it has not # already been set # ldap # # Enforce daily limits on time spent logged in. # daily # # Use the checkval module # checkval expiration logintime # # If no other module has claimed responsibility for # authentication, then try to use PAP. This allows the # other modules listed above to add a "known good" password # to the request, and to do nothing else. The PAP module # will then see that password, and use it to do PAP # authentication. # # This module should be listed last, so that the other modules # get a chance to set Auth-Type for themselves. # pap } # Authentication. # # # This section lists which modules are available for authentication. # Note that it does NOT mean 'try each module in order'. It means # that a module from the 'authorize' section adds a configuration # attribute 'Auth-Type := FOO'. That authentication type is then # used to pick the apropriate module from the list below. # # In general, you SHOULD NOT set the Auth-Type attribute. The server # will figure it out on its own, and will do the right thing. The # most common side effect of erroneously setting the Auth-Type # attribute is that one authentication method will work, but the # others will not. # # The common reasons to set the Auth-Type attribute by hand # is to either forcibly reject the user, or forcibly accept him. # authenticate { # # PAP authentication, when a back-end database listed # in the 'authorize' section supplies a password. The # password can be clear-text, or encrypted. Auth-Type PAP { pap } # # Most people want CHAP authentication # A back-end database listed in the 'authorize' section # MUST supply a CLEAR TEXT password. Encrypted passwords # won't work. Auth-Type CHAP { chap } # # MSCHAP authentication. Auth-Type MS-CHAP { mschap } # # Pluggable Authentication Modules. # pam # # See 'man getpwent' for information on how the 'unix' # module checks the users password. Note that packets # containing CHAP-Password attributes CANNOT be authenticated # against /etc/passwd! See the FAQ for details. # unix # Uncomment it if you want to use ldap for authentication # # Note that this means "check plain-text password against # the ldap database", which means that EAP won't work, # as it does not supply a plain-text password. # Auth-Type LDAP { # ldap # } # # Allow EAP authentication. eap } ###################################################################### # # There are no accounting requests inside of EAP-TTLS or PEAP # tunnels. # ###################################################################### # Session database, used for checking Simultaneous-Use. Either the radutmp # or rlm_sql module can handle this. # The rlm_sql module is *much* faster session { radutmp # # See "Simultaneous Use Checking Queries" in sql.conf # sql } # Post-Authentication # Once we KNOW that the user has been authenticated, there are # additional steps we can take. post-auth { # Note that we do NOT assign IP addresses here. # If you try to assign IP addresses for EAP authentication types, # it WILL NOT WORK. You MUST use DHCP. # # If you want to have a log of authentication replies, # un-comment the following line, and the 'detail reply_log' # section, above. # reply_log # # After authenticating the user, do another SQL query. # # See "Authentication Logging Queries" in sql.conf # sql # # Instead of sending the query to the SQL server, # write it into a log file. # # sql_log # # Un-comment the following if you have set # 'edir_account_policy_check = yes' in the ldap module sub-section of # the 'modules' section. # # ldap # # Access-Reject packets are sent through the REJECT sub-section of the # post-auth section. # # Add the ldap module name (or instance) if you have set # 'edir_account_policy_check = yes' in the ldap module configuration # Post-Auth-Type REJECT { # log failed authentications in SQL, too. # sql attr_filter.access_reject } # # The example policy below updates the outer tunnel reply # (usually Access-Accept) with the User-Name from the inner # tunnel User-Name. Since this section is processed in the # context of the inner tunnel, "request" here means "inner # tunnel request", and "outer.reply" means "outer tunnel # reply attributes". # # This example is most useful when the outer session contains # a User-Name of "anonymous@....", or a MAC address. If it # is enabled, the NAS SHOULD use the inner tunnel User-Name # in subsequent accounting packets. This makes it easier to # track user sessions, as they will all be based on the real # name, and not on "anonymous". # # The problem with doing this is that it ALSO exposes the # real user name to any intermediate proxies. People use # "anonymous" identifiers outside of the tunnel for a very # good reason: it gives them more privacy. Setting the reply # to contain the real user name removes ALL privacy from # their session. # # If you want privacy to remain, see the # Chargeable-User-Identity attribute from RFC 4372. In order # to use that attribute, you will have to allocate a # per-session identifier for the user, and store it in a # long-term database (e.g. SQL). You should also use that # attribute INSTEAD of the configuration below. # #update outer.reply { # User-Name = "%{request:User-Name}" #} } # # When the server decides to proxy a request to a home server, # the proxied request is first passed through the pre-proxy # stage. This stage can re-write the request, or decide to # cancel the proxy. # # Only a few modules currently have this method. # pre-proxy { # attr_rewrite # Uncomment the following line if you want to change attributes # as defined in the preproxy_users file. # files # Uncomment the following line if you want to filter requests # sent to remote servers based on the rules defined in the # 'attrs.pre-proxy' file. # attr_filter.pre-proxy # If you want to have a log of packets proxied to a home # server, un-comment the following line, and the # 'detail pre_proxy_log' section, above. # pre_proxy_log } # # When the server receives a reply to a request it proxied # to a home server, the request may be massaged here, in the # post-proxy stage. # post-proxy { # If you want to have a log of replies from a home server, # un-comment the following line, and the 'detail post_proxy_log' # section, above. # post_proxy_log # attr_rewrite # Uncomment the following line if you want to filter replies from # remote proxies based on the rules defined in the 'attrs' file. # attr_filter.post-proxy # # If you are proxying LEAP, you MUST configure the EAP # module, and you MUST list it here, in the post-proxy # stage. # # You MUST also use the 'nostrip' option in the 'realm' # configuration. Otherwise, the User-Name attribute # in the proxied request will not match the user name # hidden inside of the EAP packet, and the end server will # reject the EAP request. # eap # # If the server tries to proxy a request and fails, then the # request is processed through the modules in this section. # # The main use of this section is to permit robust proxying # of accounting packets. The server can be configured to # proxy accounting packets as part of normal processing. # Then, if the home server goes down, accounting packets can # be logged to a local "detail" file, for processing with # radrelay. When the home server comes back up, radrelay # will read the detail file, and send the packets to the # home server. # # With this configuration, the server always responds to # Accounting-Requests from the NAS, but only writes # accounting packets to disk if the home server is down. # # Post-Proxy-Type Fail { # detail # } } } # inner-tunnel server block freeradius-server/raddb/sites-available/originate-coa000066400000000000000000000122251257552170400233120ustar00rootroot00000000000000# -*- text -*- ###################################################################### # # The server can originate Change of Authorization (CoA) or # Disconnect request packets. These packets are used to dynamically # change the parameters of a users session (bandwidth, etc.), or # to forcibly disconnect the user. # # There are some caveats. Not all NAS vendors support this # functionality. Even for the ones that do, it may be difficult to # find out what needs to go into a CoA-Request or Disconnect-Request # packet. All we can suggest is to read the NAS documentation # available from the vendor. That documentation SHOULD describe # what information their equipment needs to see in a CoA packet. # # This information is usually a list of attributes such as: # # NAS-IP-Address (or NAS-IPv6 address) # NAS-Identifier # User-Name # Acct-Session-Id # # CoA packets can be originated when a normal Access-Request or # Accounting-Request packet is received. Simply update the # "coa" list: # # update coa { # User-Name = "%{User-Name}" # Acct-Session-Id = "%{Acct-Session-Id}" # NAS-IP-Address = "%{NAS-IP-Address}" # } # # And the CoA packet will be sent. You can also send Disconnect # packets by using "update disconnect { ...". # # This "update coa" entry can be placed in any section (authorize, # preacct, etc.), EXCEPT for pre-proxy and post-proxy. The CoA # packets CANNOT be sent if the original request has been proxied. # # The CoA functionality works best when the RADIUS server and # the NAS receiving CoA packets are on the same network. # # If "update coa { ... " is used, and then later it becomes necessary # to not send a CoA request, the following example can suppress the # CoA packet: # # update control { # Send-CoA-Request = No # } # # The default destination of a CoA packet is the NAS (or client) # the sent the original Access-Request or Accounting-Request. See # raddb/clients.conf for a "coa_server" configuration that ties # a client to a specific home server, or to a home server pool. # # If you need to send the packet to a different destination, update # the "coa" list with one of: # # Packet-Dst-IP-Address = ... # Packet-Dst-IPv6-Address = ... # Home-Server-Pool = ... # # That specifies an Ipv4 or IPv6 address, or a home server pool # (such as the "coa" pool example below). This use is not # recommended, however, It is much better to point the client # configuration directly at the CoA server/pool, as outlined # earlier. # # If the CoA port is non-standard, you can also set: # # Packet-Dst-Port # # to have the value of the port. # ###################################################################### # # When CoA packets are sent to a NAS, the NAS is acting as a # server (see RFC 5176). i.e. it has a type (accepts CoA and/or # Disconnect packets), an IP address (or IPv6 address), a # destination port, and a shared secret. # # This information *cannot* go into a "client" section. In the future, # FreeRADIUS will be able to receive, and to proxy CoA packets. # Having the CoA configuration as below means that we can later do # load-balancing, fail-over, etc. of CoA servers. If the CoA # configuration went into a "client" section, it would be impossible # to do proper proxying of CoA requests. # home_server localhost-coa { type = coa # # Note that a home server of type "coa" MUST be a real NAS, # with an ipaddr or ipv6addr. It CANNOT point to a virtual # server. # ipaddr = 127.0.0.1 port = 3799 # This secret SHOULD NOT be the same as the shared # secret in a "client" section. secret = testing1234 # CoA specific parameters. See raddb/proxy.conf for details. coa { irt = 2 mrt = 16 mrc = 5 mrd = 30 } } # # CoA servers can be put into pools, just like normal servers. # home_server_pool coa { type = fail-over # Point to the CoA server above. home_server = localhost-coa # CoA requests are run through the pre-proxy section. # CoA responses are run through the post-proxy section. virtual_server = originate-coa.example.com # # Home server pools of type "coa" cannot (currently) have # a "fallback" configuration. # } # # When this virtual server is run, the original request has FINISHED # processing. i.e. the reply has already been sent to the NAS. # You can access the attributes in the original packet, reply, and # control items, but changing them will have NO EFFECT. # # The CoA packet is in the "proxy-request" attribute list. # The CoA reply (if any) is in the "proxy-reply" attribute list. # server originate-coa.example.com { pre-proxy { update proxy-request { NAS-IP-Address = 127.0.0.1 } } # # Handle the responses here. # post-proxy { switch "%{proxy-reply:Packet-Type}" { case CoA-ACK { ok } case CoA-NAK { # the NAS didn't like the CoA request ok } case Disconnect-ACK { ok } case Disconnect-NAK { # the NAS didn't like the Disconnect request ok } # Invalid packet type. This shouldn't happen. case { fail } } # # These methods are run when there is NO response # to the request. # Post-Proxy-Type Fail-CoA { ok } Post-Proxy-Type Fail-Disconnect { ok } } } freeradius-server/raddb/sites-available/proxy-inner-tunnel000066400000000000000000000017261257552170400243720ustar00rootroot00000000000000# -*- text -*- ###################################################################### # # This is a virtual server that handles *only* inner tunnel # requests for EAP-TTLS and PEAP types. # # $Id$ # ###################################################################### server proxy-inner-tunnel { # # This example is very simple. All inner tunnel requests get # proxied to another RADIUS server. # authorize { # # Do other things here, as necessary. # # e.g. run the "realms" module, to decide how to proxy # the inner tunnel request. # update control { # You should update this to be one of your realms. Proxy-To-Realm := "example.com" } } authenticate { # # This is necessary so that the inner tunnel EAP-MSCHAPv2 # method can be called. That method takes care of turning # EAP-MSCHAPv2 into plain MS-CHAPv2, if necessary. eap } post-proxy { # # This is necessary for LEAP, or if you set: # # proxy_tunneled_request_as_eap = no # eap } } freeradius-server/raddb/sites-available/robust-proxy-accounting000066400000000000000000000117011257552170400254140ustar00rootroot00000000000000# -*- text -*- ###################################################################### # # This is a sample configuration for robust proxy accounting. # accounting packets are proxied, OR logged locally if all # home servers are down. When the home servers come back up, # the accounting packets are forwarded. # # This method enables the server to proxy all packets to the # home servers when they're up, AND to avoid writing to the # detail file in most situations. # # In most situations, proxying of accounting messages is done # in a "pass-through" fashion. If the home server does not # respond, then the proxy server does not respond to the NAS. # That means that the NAS must retransmit packets, sometimes # forever. This example shows how the proxy server can still # respond to the NAS, even if all home servers are down. # # This configuration could be done MUCH more simply if ALL # packets were written to the detail file. But that would # involve a lot more disk writes, which may not be a good idea. # # This file is NOT meant to be used as-is. It needs to be # edited to match your local configuration. # # $Id$ # ###################################################################### # (1) Define two home servers. home_server home1.example.com { type = acct ipaddr = 192.0.2.10 port = 1813 secret = testing123 # Mark this home server alive ONLY when it starts being responsive status_check = request username = "test_user_status_check" # Set the response timeout aggressively low. # You MAY have to increase this, depending on tests with # your local installation. response_window = 6 } home_server home2.example.com { type = acct ipaddr = 192.0.2.20 port = 1813 secret = testing123 # Mark this home server alive ONLY when it starts being responsive status_check = request username = "test_user_status_check" # Set the response timeout aggressively low. # You MAY have to increase this, depending on tests with # your local installation. response_window = 6 } # (2) Define a virtual server to be used when both of the # home servers are down. home_server acct_detail.example.com { virtual_server = acct_detail.example.com } # Put all of the servers into a pool. home_server_pool acct_pool.example.com { type = load-balance # other types are OK, too. home_server = home1.example.com home_server = home2.example.com # add more home_server's here. # If all home servers are down, try a home server that # is a local virtual server. fallback = acct_detail.example.com # for pre/post-proxy policies virtual_server = home.example.com } # (3) Define a realm for these home servers. # It should NOT be used as part of normal proxying decisions! realm acct_realm.example.com { acct_pool = acct_pool.example.com } # (4) Define a detail file writer. # See raddb/modules/detail.example.com # (5) Define the virtual server to write the packets to the detail file # This will be called when ALL home servers are down, because of the # "fallback" configuration in the home server pool. server acct_detail.example.com { accounting { detail.example.com } } # (6) Define a virtual server to handle pre/post-proxy re-writing server home.example.com { pre-proxy { # Insert pre-proxy rules here } post-proxy { # Insert post-proxy rules here # This will be called when the CURRENT packet failed # to be proxied. This may happen when one home server # suddenly goes down, even though another home server # may be alive. # # i.e. the current request has run out of time, so it # cannot fail over to another (possibly) alive server. # # We want to respond to the NAS, so that it can stop # re-sending the packet. We write the packet to the # "detail" file, where it will be read, and sent to # another home server. # Post-Proxy-Type Fail { detail.example.com } } # Read accounting packets from the detail file(s) for # the home server. # # Note that you can have only ONE "listen" section reading # detail files from a particular directory. That is why the # destination host name is used as part of the directory name # below. Having two "listen" sections reading detail files # from the same directory WILL cause problems. The packets # may be read by one, the other, or both "listen" sections. listen { type = detail filename = "${radacctdir}/detail.example.com/detail-*:*" load_factor = 10 } # All packets read from the detail file are proxied back to # the home servers. # # The normal pre/post-proxy rules are applied to them, too. # # If the home servers are STILL down, then the server stops # reading the detail file, and queues the packets for a later # retransmission. The Post-Proxy-Type "Fail" handler is NOT # called. # # When the home servers come back up, the packets are forwarded, # and the detail file processed as normal. accounting { # You may want accounting policies here... update control { Proxy-To-Realm := "acct_realm.example.com" } } } freeradius-server/raddb/sites-available/soh000066400000000000000000000014561257552170400213660ustar00rootroot00000000000000# This is a simple server for the MS SoH requests generated by the # peap module - see "eap.conf" for more info # Requests are ONLY passed through the authorize section, and cannot # current be proxied (in any event, the radius attributes used are # internal). server soh-server { authorize { if (SoH-Supported == no) { # client NAKed our request for SoH - not supported, or turned off update config { Auth-Type = Accept } } else { # client replied; check something - this is a local policy issue! if (SoH-MS-Windows-Health-Status =~ /antivirus (warn|error) /) { update config { Auth-Type = Reject } update reply { Reply-Message = "You must have antivirus enabled & installed!" } } else { update config { Auth-Type = Accept } } } } } freeradius-server/raddb/sites-available/status000066400000000000000000000077121257552170400221210ustar00rootroot00000000000000# -*- text -*- ###################################################################### # # A virtual server to handle ONLY Status-Server packets. # # Server statistics can be queried with a properly formatted # Status-Server request. See dictionary.freeradius for comments. # # If radiusd.conf has "status_server = yes", then any client # will be able to send a Status-Server packet to any port # (listen section type "auth", "acct", or "status"), and the # server will respond. # # If radiusd.conf has "status_server = no", then the server will # ignore Status-Server packets to "auth" and "acct" ports. It # will respond only if the Status-Server packet is sent to a # "status" port. # # The server statistics are available ONLY on socket of type # "status". Qeuries for statistics sent to any other port # are ignored. # # Similarly, a socket of type "status" will not process # authentication or accounting packets. This is for security. # # $Id$ # ###################################################################### server status { listen { # ONLY Status-Server is allowed to this port. # ALL other packets are ignored. type = status ipaddr = 127.0.0.1 port = 18121 } # # We recommend that you list ONLY management clients here. # i.e. NOT your NASes or Access Points, and for an ISP, # DEFINITELY not any RADIUS servers that are proxying packets # to you. # # If you do NOT list a client here, then any client that is # globally defined (i.e. all of them) will be able to query # these statistics. # # Do you really want your partners seeing the internal details # of what your RADIUS server is doing? # client admin { ipaddr = 127.0.0.1 secret = adminsecret } # # Simple authorize section. The "Autz-Type Status-Server" # section will work here, too. See "raddb/sites-available/default". authorize { ok # respond to the Status-Server request. Autz-Type Status-Server { ok } } } # Statistics can be queried via a number of methods: # # All packets received/sent by the server (1 = auth, 2 = acct) # FreeRADIUS-Statistics-Type = 3 # # All packets proxied by the server (4 = proxy-auth, 8 = proxy-acct) # FreeRADIUS-Statistics-Type = 12 # # All packets sent && received: # FreeRADIUS-Statistics-Type = 15 # # Internal server statistics: # FreeRADIUS-Statistics-Type = 16 # # All packets for a particular client (globally defined) # FreeRADIUS-Statistics-Type = 35 # FreeRADIUS-Stats-Client-IP-Address = 192.168.1.1 # # All packets for a client attached to a "listen" ip/port # FreeRADIUS-Statistics-Type = 35 # FreeRADIUS-Stats-Client-IP-Address = 192.168.1.1 # FreeRADIUS-Stats-Server-IP-Address = 127.0.0.1 # FreeRADIUS-Stats-Server-Port = 1812 # # All packets for a "listen" IP/port # FreeRADIUS-Statistics-Type = 67 # FreeRADIUS-Stats-Server-IP-Address = 127.0.0.1 # FreeRADIUS-Stats-Server-Port = 1812 # # All packets for a home server IP / port # FreeRADIUS-Statistics-Type = 131 # FreeRADIUS-Stats-Server-IP-Address = 192.168.1.2 # FreeRADIUS-Stats-Server-Port = 1812 # # You can also get exponentially weighted moving averages of # response times (in usec) of home servers. Just set the config # item "historic_average_window" in a home_server section. # # By default it is zero (don't calculate it). Useful values # are between 100, and 10,000. The server will calculate and # remember the moving average for this window, and for 10 times # that window. # # # Some of this could have been simplified. e.g. the proxy-auth and # proxy-acct bits aren't completely necessary. But using them permits # the server to be queried for ALL inbound && outbound packets at once. # This gives a good snapshot of what the server is doing. # # Due to internal limitations, the statistics might not be exactly up # to date. Do not expect all of the numbers to add up perfectly. # The Status-Server packets are also counted in the total requests && # responses. The responses are counted only AFTER the response has # been sent. # freeradius-server/raddb/sites-available/virtual.example.com000066400000000000000000000015211257552170400244630ustar00rootroot00000000000000# -*- text -*- ###################################################################### # # Sample virtual server for internally proxied requests. # # See the "realm virtual.example.com" example in "proxy.conf". # # $Id$ # ###################################################################### # # Sample contents: just do everything that the default configuration does. # # You WILL want to edit this to your local needs. We suggest copying # the "default" file here, and then editing it. That way, any # changes to the 'default" file will not affect this virtual server, # and vice-versa. # # When this virtual server receives the request, the original # attributes can be accessed as "outer.request", "outer.control", etc. # See "man unlang" for more details. # server virtual.example.com { $INCLUDE ${confdir}/sites-available/default } freeradius-server/raddb/sites-available/vmps000066400000000000000000000047521257552170400215640ustar00rootroot00000000000000# -*- text -*- ###################################################################### # # As of version 2.0.0, the server also supports the VMPS # protocol. # # $Id$ # ###################################################################### server vmps { listen { # VMPS sockets only support IPv4 addresses. ipaddr = * # Port on which to listen. # Allowed values are: # integer port number # 1589 is the default VMPS port. port = 1589 # Type of packets to listen for. Here, it is VMPS. type = vmps # Some systems support binding to an interface, in addition # to the IP address. This feature isn't strictly necessary, # but for sites with many IP addresses on one interface, # it's useful to say "listen on all addresses for # eth0". # # If your system does not support this feature, you will # get an error if you try to use it. # # interface = eth0 } # If you have switches that are allowed to send VMPS, but NOT # RADIUS packets, then list them here as "client" sections. # # Note that for compatibility with RADIUS, you still have to # list a "secret" for each client, though that secret will not # be used for anything. # And the REAL contents. This section is just like the # "post-auth" section of radiusd.conf. In fact, it calls the # "post-auth" component of the modules that are listed here. # But it's called "vmps" to highlight that it's for VMPS. # vmps { # # Some requests may not have a MAC address. Try to # create one using other attributes. if (!VMPS-Mac) { if (VMPS-Ethernet-Frame =~ /0x.{12}(..)(..)(..)(..)(..)(..).*/) { update request { VMPS-Mac = "%{1}:%{2}:%{3}:%{4}:%{5}:%{6}" } } else { update request { VMPS-Mac = "%{VMPS-Cookie}" } } } # Do a simple mapping of MAC to VLAN. # # See radiusd.conf for the definition of the "mac2vlan" # module. # #mac2vlan # required VMPS reply attributes update reply { VMPS-Packet-Type = VMPS-Join-Response VMPS-Cookie = "%{VMPS-Mac}" VMPS-VLAN-Name = "please_use_real_vlan_here" # # If you have VLAN's in a database, you can select # the VLAN name based on the MAC address. # #VMPS-VLAN-Name = "%{sql:select ... where mac='%{VMPS-Mac}'}" } # correct reply packet type for reconfirmation requests # if (VMPS-Packet-Type == VMPS-Reconfirm-Request){ update reply { VMPS-Packet-Type := VMPS-Reconfirm-Response } } } # Proxying of VMPS requests is NOT supported. } freeradius-server/raddb/sql.conf000066400000000000000000000064431257552170400172540ustar00rootroot00000000000000# -*- text -*- ## ## sql.conf -- SQL modules ## ## $Id$ ###################################################################### # # Configuration for the SQL module # # The database schemas and queries are located in subdirectories: # # sql/DB/schema.sql Schema # sql/DB/dialup.conf Basic dialup (including policy) queries # sql/DB/counter.conf counter # sql/DB/ippool.conf IP Pools in SQL # sql/DB/ippool.sql schema for IP pools. # # Where "DB" is mysql, mssql, oracle, or postgresql. # sql { # # Set the database to one of: # # mysql, mssql, oracle, postgresql # database = "mysql" # # Which FreeRADIUS driver to use. # driver = "rlm_sql_${database}" # Connection info: server = "localhost" #port = 3306 login = "radius" password = "radpass" # Database table configuration for everything except Oracle radius_db = "radius" # If you are using Oracle then use this instead # radius_db = "(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521))(CONNECT_DATA=(SID=your_sid)))" # If you want both stop and start records logged to the # same SQL table, leave this as is. If you want them in # different tables, put the start table in acct_table1 # and stop table in acct_table2 acct_table1 = "radacct" acct_table2 = "radacct" # Allow for storing data after authentication postauth_table = "radpostauth" authcheck_table = "radcheck" authreply_table = "radreply" groupcheck_table = "radgroupcheck" groupreply_table = "radgroupreply" # Table to keep group info usergroup_table = "radusergroup" # If set to 'yes' (default) we read the group tables # If set to 'no' the user MUST have Fall-Through = Yes in the radreply table # read_groups = yes # Remove stale session if checkrad does not see a double login deletestalesessions = yes # Print all SQL statements when in debug mode (-x) sqltrace = no sqltracefile = ${logdir}/sqltrace.sql # number of sql connections to make to server # # Setting this to LESS than the number of threads means # that some threads may starve, and you will see errors # like "No connections available and at max connection limit" # # Setting this to MORE than the number of threads means # that there are more connections than necessary. # num_sql_socks = ${thread[pool].max_servers} # number of seconds to dely retrying on a failed database # connection (per_socket) connect_failure_retry_delay = 60 # lifetime of an SQL socket. If you are having network issues # such as TCP sessions expiring, you may need to set the socket # lifetime. If set to non-zero, any open connections will be # closed "lifetime" seconds after they were first opened. lifetime = 0 # Maximum number of queries used by an SQL socket. If you are # having issues with SQL sockets lasting "too long", you can # limit the number of queries performed over one socket. After # "max_qeuries", the socket will be closed. Use 0 for "no limit". max_queries = 0 # Set to 'yes' to read radius clients from the database ('nas' table) # Clients will ONLY be read on server startup. For performance # and security reasons, finding clients via SQL queries CANNOT # be done "live" while the server is running. # #readclients = yes # Table to keep radius client info nas_table = "nas" # Read driver-specific configuration $INCLUDE sql/${database}/dialup.conf } freeradius-server/raddb/sql/000077500000000000000000000000001257552170400163765ustar00rootroot00000000000000freeradius-server/raddb/sql/mssql/000077500000000000000000000000001257552170400175355ustar00rootroot00000000000000freeradius-server/raddb/sql/mssql/dialup.conf000066400000000000000000000214551257552170400216710ustar00rootroot00000000000000# -*- text -*- ## ## dialup.conf -- MSSQL configuration for default schema (schema.sql) ## ## $Id$ # Safe characters list for sql queries. Everything else is replaced # with their mime-encoded equivalents. # The default list should be ok #safe-characters = "@abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.-_: /" ####################################################################### # Query config: Username ####################################################################### # This is the username that will get substituted, escaped, and added # as attribute 'SQL-User-Name'. '%{SQL-User-Name}' should be used # below everywhere a username substitution is needed so you you can # be sure the username passed from the client is escaped properly. # # Uncomment the next line, if you want the sql_user_name to mean: # # Use Stripped-User-Name, if it's there. # Else use User-Name, if it's there, # Else use hard-coded string "none" as the user name. #sql_user_name = "%{%{Stripped-User-Name}:-%{User-Name:-none}}" # sql_user_name = "%{User-Name}" ####################################################################### # Authorization Queries ####################################################################### # These queries compare the check items for the user # in ${authcheck_table} and setup the reply items in # ${authreply_table}. You can use any query/tables # you want, but the return data for each row MUST # be in the following order: # # 0. Row ID (currently unused) # 1. UserName/GroupName # 2. Item Attr Name # 3. Item Attr Value # 4. Item Attr Operation ####################################################################### # Query for case sensitive usernames was removed. Please contact with me, # if you know analog of STRCMP functions for MS SQL. authorize_check_query = "SELECT id,UserName,Attribute,Value,op FROM ${authcheck_table} WHERE Username = '%{SQL-User-Name}' ORDER BY id" authorize_reply_query = "SELECT id,UserName,Attribute,Value,op FROM ${authreply_table} WHERE Username = '%{SQL-User-Name}' ORDER BY id" authorize_group_check_query = "SELECT ${groupcheck_table}.id,${groupcheck_table}.GroupName,${groupcheck_table}.Attribute,${groupcheck_table}.Value,${groupcheck_table}.op FROM ${groupcheck_table},${usergroup_table} WHERE ${usergroup_table}.Username = '%{SQL-User-Name}' AND ${usergroup_table}.GroupName = ${groupcheck_table}.GroupName ORDER BY ${groupcheck_table}.id" authorize_group_reply_query = "SELECT ${groupreply_table}.id,${groupreply_table}.GroupName,${groupreply_table}.Attribute,${groupreply_table}.Value,${groupreply_table}.op FROM ${groupreply_table},${usergroup_table} WHERE ${usergroup_table}.Username = '%{SQL-User-Name}' AND ${usergroup_table}.GroupName = ${groupreply_table}.GroupName ORDER BY ${groupreply_table}.id" group_membership_query = "SELECT groupname \ FROM ${usergroup_table} \ WHERE username = '%{SQL-User-Name}' \ ORDER BY priority" ####################################################################### # Accounting Queries ####################################################################### # accounting_onoff_query - query for Accounting On/Off packets # accounting_update_query - query for Accounting update packets # accounting_update_query_alt - query for Accounting update packets # (alternate in case first query fails) # accounting_start_query - query for Accounting start packets # accounting_start_query_alt - query for Accounting start packets # (alternate in case first query fails) # accounting_stop_query - query for Accounting stop packets # accounting_stop_query_alt - query for Accounting start packets # (alternate in case first query doesn't # affect any existing rows in the table) ####################################################################### accounting_onoff_query = "UPDATE ${acct_table1} SET AcctStopTime='%S', AcctSessionTime=unix_timestamp('%S') - unix_timestamp(AcctStartTime), AcctTerminateCause='%{Acct-Terminate-Cause}', AcctStopDelay = %{Acct-Delay-Time:-0} WHERE AcctStopTime=0 AND NASIPAddress= '%{NAS-IP-Address}' AND AcctStartTime <= '%S'" accounting_update_query = "UPDATE ${acct_table1} SET FramedIPAddress = '%{Framed-IP-Address}' WHERE AcctSessionId = '%{Acct-Session-Id}' AND UserName = '%{SQL-User-Name}' AND NASIPAddress= '%{NAS-IP-Address}' AND AcctStopTime = 0" accounting_update_query_alt = "INSERT into ${acct_table1} (AcctSessionId, AcctUniqueId, UserName, Realm, NASIPAddress, NASPort, NASPortType, AcctSessionTime, AcctAuthentic, ConnectInfo_start, AcctInputOctets, AcctOutputOctets, CalledStationId, CallingStationId, ServiceType, FramedProtocol, FramedIPAddress, AcctStartDelay, XAscendSessionSvrKey) \ VALUES('%{Acct-Session-Id}', '%{Acct-Unique-Session-Id}', '%{SQL-User-Name}', '%{Realm}', '%{NAS-IP-Address}', '%{NAS-Port-Id}', '%{NAS-Port-Type}', '%{Acct-Session-Time}', '%{Acct-Authentic}', '', '%{Acct-Input-Octets}', '%{Acct-Output-Octets}', '%{Called-Station-Id}', '%{Calling-Station-Id}', '%{Service-Type}', '%{Framed-Protocol}', '%{Framed-IP-Address}', '0', '%{X-Ascend-Session-Svr-Key}')" # accounting_start_query: Inserting of RadAcctId and AcctStopTime was # removed. These fields are processing by a database accounting_start_query = "INSERT into ${acct_table1} (AcctSessionId, AcctUniqueId, UserName, Realm, NASIPAddress, NASPort, NASPortType, AcctStartTime, AcctSessionTime, AcctAuthentic, ConnectInfo_start, ConnectInfo_stop, AcctInputOctets, AcctOutputOctets, CalledStationId, CallingStationId, AcctTerminateCause, ServiceType, FramedProtocol, FramedIPAddress, AcctStartDelay, AcctStopDelay, XAscendSessionSvrKey) \ VALUES('%{Acct-Session-Id}', '%{Acct-Unique-Session-Id}', '%{SQL-User-Name}', '%{Realm}', '%{NAS-IP-Address}', '%{NAS-Port-Id}', '%{NAS-Port-Type}', '%S', '0', '%{Acct-Authentic}', '%{Connect-Info}', '', '0', '0', '%{Called-Station-Id}', '%{Calling-Station-Id}', '', '%{Service-Type}', '%{Framed-Protocol}', '%{Framed-IP-Address}', '%{Acct-Delay-Time}', '0', '%{X-Ascend-Session-Svr-Key}')" accounting_start_query_alt = "UPDATE ${acct_table1} SET AcctStartTime = '%S', AcctStartDelay = '%{Acct-Delay-Time:-0}', ConnectInfo_start = '%{Connect-Info}' WHERE AcctSessionId = '%{Acct-Session-Id}' AND UserName = '%{SQL-User-Name}' AND NASIPAddress = '%{NAS-IP-Address}' AND AcctStopTime = 0" accounting_stop_query = "UPDATE ${acct_table2} SET AcctStopTime = '%S', AcctSessionTime = '%{Acct-Session-Time}', AcctInputOctets = convert(bigint, '%{%{Acct-Input-Gigawords}:-0}' * POWER(2.0, 32)) | '%{%{Acct-Input-Octets}:-0}', AcctOutputOctets = convert(bigint, '%{%{Acct-Output-Gigawords}:-0}' * POWER(2.0, 32)) | '%{%{Acct-Output-Octets}:-0}', AcctTerminateCause = '%{Acct-Terminate-Cause}', AcctStopDelay = '%{Acct-Delay-Time:-0}', ConnectInfo_stop = '%{Connect-Info}' WHERE AcctSessionId = '%{Acct-Session-Id}' AND UserName = '%{SQL-User-Name}' AND NASIPAddress = '%{NAS-IP-Address}' AND AcctStopTime IS NULL AND UserVLANID = '%{Aruba-User-Vlan}'" # accounting_stop_query_alt: Inserting of RadAcctId and AcctStartTime was # removed. These fields are processing by a database accounting_stop_query_alt = "INSERT into ${acct_table2} (AcctSessionId, AcctUniqueId, UserName, Realm, NASIPAddress, NASPortId, NASPortType, AcctStopTime, AcctSessionTime, AcctAuthentic, ConnectInfo_start, ConnectInfo_stop, AcctInputOctets, AcctOutputOctets, CalledStationId, CallingStationId, AcctTerminateCause, ServiceType, FramedProtocol, FramedIPAddress, AcctStartDelay, AcctStopDelay, UserVLANID) values('%{Acct-Session-Id}', '%{Acct-Unique-Session-Id}', '%{SQL-User-Name}', '%{Realm}', '%{NAS-IP-Address}', '%{NAS-Port-Id}', '%{NAS-Port-Type}', '%S', '%{Acct-Session-Time}', '%{Acct-Authentic}', '', '%{Connect-Info}', convert(bigint, '%{%{Acct-Input-Gigawords}:-0}' * POWER(2.0, 32)) | '%{%{Acct-Intput-Octets}:-0}', convert(bigint, '%{%{Acct-Output-Gigawords}:-0}' * POWER(2.0, 32)) | '%{%{Acct-Output-Octets}:-0}', '%{Called-Station-Id}', '%{Calling-Station-Id}', '%{Acct-Terminate-Cause}', '%{Service-Type}', '%{Framed-Protocol}', '%{Framed-IP-Address}', '0', '%{Acct-Delay-Time:-0}', '%{Aruba-User-Vlan}')" ####################################################################### # Authentication Logging Queries ####################################################################### # postauth_query - Insert some info after authentication ####################################################################### postauth_query = "INSERT INTO ${postauth_table} \ (username, pass, reply, authdate) \ VALUES ( \ '%{User-Name}', \ '%{%{User-Password}:-%{Chap-Password}}', \ '%{reply:Packet-Type}', '%S')" freeradius-server/raddb/sql/mssql/schema.sql000066400000000000000000000215161257552170400215230ustar00rootroot00000000000000/*************************************************************************** * $Id$ * * * * db_mssql.sql * * * * Database schema for MSSQL server * * * * To load: * * isql -S db_ip_addr -d db_name -U db_login -P db_passwd -i db_mssql.sql * * * * Based on: db_mysql.sql (Mike Machado ) * * * * Dmitri Ageev * ***************************************************************************/ /****** Object: Table [radacct] Script Date: 26.03.02 16:55:17 ******/ CREATE TABLE [radacct] ( [RadAcctId] [numeric](21, 0) IDENTITY (1, 1) NOT NULL , [AcctSessionId] [varchar] (64) DEFAULT ('') FOR [AcctSessionId], [AcctUniqueId] [varchar] (32) DEFAULT ('') FOR [AcctUniqueId], [UserName] [varchar] (64) DEFAULT ('') FOR [UserName], [GroupName] [varchar] (64) DEFAULT ('') FOR [GroupName], [Realm] [varchar] (64) DEFAULT ('') FOR [Realm], [NASIPAddress] [varchar] (15) DEFAULT ('') FOR [NASIPAddress], [NASPortId] [varchar] (15) NULL , [NASPortType] [varchar] (32) NULL , [AcctStartTime] [datetime] NOT NULL , [AcctStopTime] [datetime] NOT NULL , [AcctSessionTime] [bigint] NULL , [AcctAuthentic] [varchar] (32) NULL , [ConnectInfo_start] [varchar] (32) DEFAULT (null) FOR [ConnectInfo_start], [ConnectInfo_stop] [varchar] (32) DEFAULT (null) FOR [ConnectInfo_stop], [AcctInputOctets] [bigint] NULL , [AcctOutputOctets] [bigint] NULL , [CalledStationId] [varchar] (30) DEFAULT ('') FOR [CalledStationId], [CallingStationId] [varchar] (30) DEFAULT ('') FOR [CallingStationId], [AcctTerminateCause] [varchar] (32) DEFAULT ('') FOR [AcctTerminateCause], [ServiceType] [varchar] (32) NULL , [FramedProtocol] [varchar] (32) NULL , [FramedIPAddress] [varchar] (15) DEFAULT ('') FOR [FramedIPAddress], [XAscendSessionSvrKey] [varchar] (10) DEFAULT (null) FOR [XAscendSessionSvrKey], [AcctStartDelay] [int] NULL , [AcctStopDelay] [int] NULL ) ON [PRIMARY] GO /****** Object: Table [radcheck] Script Date: 26.03.02 16:55:17 ******/ CREATE TABLE [radcheck] ( [id] [int] IDENTITY (1, 1) NOT NULL , [UserName] [varchar] (64) NOT NULL , [Attribute] [varchar] (32) NOT NULL , [Value] [varchar] (253) NOT NULL , [op] [char] (2) NULL ) ON [PRIMARY] GO /****** Object: Table [radgroupcheck] Script Date: 26.03.02 16:55:17 ******/ CREATE TABLE [radgroupcheck] ( [id] [int] IDENTITY (1, 1) NOT NULL , [GroupName] [varchar] (64) NOT NULL , [Attribute] [varchar] (32) NOT NULL , [Value] [varchar] (253) NOT NULL , [op] [char] (2) NULL ) ON [PRIMARY] GO /****** Object: Table [radgroupreply] Script Date: 26.03.02 16:55:17 ******/ CREATE TABLE [radgroupreply] ( [id] [int] IDENTITY (1, 1) NOT NULL , [GroupName] [varchar] (64) NOT NULL , [Attribute] [varchar] (32) NOT NULL , [Value] [varchar] (253) NOT NULL , [op] [char] (2) NULL , [prio] [int] NOT NULL ) ON [PRIMARY] GO /****** Object: Table [radreply] Script Date: 26.03.02 16:55:18 ******/ CREATE TABLE [radreply] ( [id] [int] IDENTITY (1, 1) NOT NULL , [UserName] [varchar] (64) NOT NULL , [Attribute] [varchar] (32) NOT NULL , [Value] [varchar] (253) NOT NULL , [op] [char] (2) NULL ) ON [PRIMARY] GO /****** Object: Table [radusergroup] Script Date: 26.03.02 16:55:18 ******/ CREATE TABLE [radusergroup] ( [id] [int] IDENTITY (1, 1) NOT NULL , [UserName] [varchar] (64) NOT NULL , [GroupName] [varchar] (64) NULL ) ON [PRIMARY] GO /****** Object: Table [radusergroup] Script Date: 16.04.08 19:44:11 ******/ CREATE TABLE [radpostauth] ( [id] [int] IDENTITY (1, 1) NOT NULL , [userName] [varchar] (64) NOT NULL , [pass] [varchar] (64) NOT NULL , [reply] [varchar] (32) NOT NULL , [authdate] [datetime] NOT NULL ) GO ALTER TABLE [radacct] WITH NOCHECK ADD CONSTRAINT [DF_radacct_GroupName] DEFAULT ('') FOR [GroupName], CONSTRAINT [DF_radacct_AcctSessionId] DEFAULT ('') FOR [AcctSessionId], CONSTRAINT [DF_radacct_AcctUniqueId] DEFAULT ('') FOR [AcctUniqueId], CONSTRAINT [DF_radacct_UserName] DEFAULT ('') FOR [UserName], CONSTRAINT [DF_radacct_Realm] DEFAULT ('') FOR [Realm], CONSTRAINT [DF_radacct_NASIPAddress] DEFAULT ('') FOR [NASIPAddress], CONSTRAINT [DF_radacct_NASPortId] DEFAULT (null) FOR [NASPortId], CONSTRAINT [DF_radacct_NASPortType] DEFAULT (null) FOR [NASPortType], CONSTRAINT [DF_radacct_AcctStartTime] DEFAULT ('1900-01-01 00:00:00') FOR [AcctStartTime], CONSTRAINT [DF_radacct_AcctStopTime] DEFAULT ('1900-01-01 00:00:00') FOR [AcctStopTime], CONSTRAINT [DF_radacct_AcctSessionTime] DEFAULT (null) FOR [AcctSessionTime], CONSTRAINT [DF_radacct_AcctAuthentic] DEFAULT (null) FOR [AcctAuthentic], CONSTRAINT [DF_radacct_ConnectInfo_start] DEFAULT (null) FOR [ConnectInfo_start], CONSTRAINT [DF_radacct_ConnectInfo_stop] DEFAULT (null) FOR [ConnectInfo_stop], CONSTRAINT [DF_radacct_AcctInputOctets] DEFAULT (null) FOR [AcctInputOctets], CONSTRAINT [DF_radacct_AcctOutputOctets] DEFAULT (null) FOR [AcctOutputOctets], CONSTRAINT [DF_radacct_CalledStationId] DEFAULT ('') FOR [CalledStationId], CONSTRAINT [DF_radacct_CallingStationId] DEFAULT ('') FOR [CallingStationId], CONSTRAINT [DF_radacct_AcctTerminateCause] DEFAULT ('') FOR [AcctTerminateCause], CONSTRAINT [DF_radacct_ServiceType] DEFAULT (null) FOR [ServiceType], CONSTRAINT [DF_radacct_FramedProtocol] DEFAULT (null) FOR [FramedProtocol], CONSTRAINT [DF_radacct_FramedIPAddress] DEFAULT ('') FOR [FramedIPAddress], CONSTRAINT [DF_radacct_AcctStartDelay] DEFAULT (null) FOR [AcctStartDelay], CONSTRAINT [DF_radacct_AcctStopDelay] DEFAULT (null) FOR [AcctStopDelay], CONSTRAINT [PK_radacct] PRIMARY KEY NONCLUSTERED ( [RadAcctId] ) ON [PRIMARY] GO ALTER TABLE [radcheck] WITH NOCHECK ADD CONSTRAINT [DF_radcheck_UserName] DEFAULT ('') FOR [UserName], CONSTRAINT [DF_radcheck_Attribute] DEFAULT ('') FOR [Attribute], CONSTRAINT [DF_radcheck_Value] DEFAULT ('') FOR [Value], CONSTRAINT [DF_radcheck_op] DEFAULT (null) FOR [op], CONSTRAINT [PK_radcheck] PRIMARY KEY NONCLUSTERED ( [id] ) ON [PRIMARY] GO ALTER TABLE [radgroupcheck] WITH NOCHECK ADD CONSTRAINT [DF_radgroupcheck_GroupName] DEFAULT ('') FOR [GroupName], CONSTRAINT [DF_radgroupcheck_Attribute] DEFAULT ('') FOR [Attribute], CONSTRAINT [DF_radgroupcheck_Value] DEFAULT ('') FOR [Value], CONSTRAINT [DF_radgroupcheck_op] DEFAULT (null) FOR [op], CONSTRAINT [PK_radgroupcheck] PRIMARY KEY NONCLUSTERED ( [id] ) ON [PRIMARY] GO ALTER TABLE [radgroupreply] WITH NOCHECK ADD CONSTRAINT [DF_radgroupreply_GroupName] DEFAULT ('') FOR [GroupName], CONSTRAINT [DF_radgroupreply_Attribute] DEFAULT ('') FOR [Attribute], CONSTRAINT [DF_radgroupreply_Value] DEFAULT ('') FOR [Value], CONSTRAINT [DF_radgroupreply_op] DEFAULT (null) FOR [op], CONSTRAINT [DF_radgroupreply_prio] DEFAULT (0) FOR [prio], CONSTRAINT [PK_radgroupreply] PRIMARY KEY NONCLUSTERED ( [id] ) ON [PRIMARY] GO ALTER TABLE [radreply] WITH NOCHECK ADD CONSTRAINT [DF_radreply_UserName] DEFAULT ('') FOR [UserName], CONSTRAINT [DF_radreply_Attribute] DEFAULT ('') FOR [Attribute], CONSTRAINT [DF_radreply_Value] DEFAULT ('') FOR [Value], CONSTRAINT [DF_radreply_op] DEFAULT (null) FOR [op], CONSTRAINT [PK_radreply] PRIMARY KEY NONCLUSTERED ( [id] ) ON [PRIMARY] GO ALTER TABLE [radusergroup] WITH NOCHECK ADD CONSTRAINT [DF_radusergroup_UserName] DEFAULT ('') FOR [UserName], CONSTRAINT [DF_radusergroup_GroupName] DEFAULT ('') FOR [GroupName], CONSTRAINT [PK_radusergroup] PRIMARY KEY NONCLUSTERED ( [id] ) ON [PRIMARY] GO ALTER TABLE [radpostauth] WITH NOCHECK ADD CONSTRAINT [DF_radpostauth_userName] DEFAULT ('') FOR [userName], CONSTRAINT [DF_radpostauth_pass] DEFAULT ('') FOR [pass], CONSTRAINT [DF_radpostauth_reply] DEFAULT ('') FOR [reply], CONSTRAINT [DF_radpostauth_authdate] DEFAULT (getdate()) FOR [authdate], CONSTRAINT [PK_radpostauth] PRIMARY KEY NONCLUSTERED ( [id] ) ON [PRIMARY] GO CREATE INDEX [UserName] ON [radacct]([UserName]) ON [PRIMARY] GO CREATE INDEX [FramedIPAddress] ON [radacct]([FramedIPAddress]) ON [PRIMARY] GO CREATE INDEX [AcctSessionId] ON [radacct]([AcctSessionId]) ON [PRIMARY] GO CREATE UNIQUE INDEX [AcctUniqueId] ON [radacct]([AcctUniqueId]) ON [PRIMARY] GO CREATE INDEX [AcctStartTime] ON [radacct]([AcctStartTime]) ON [PRIMARY] GO CREATE INDEX [AcctStopTime] ON [radacct]([AcctStopTime]) ON [PRIMARY] GO CREATE INDEX [NASIPAddress] ON [radacct]([NASIPAddress]) ON [PRIMARY] GO CREATE INDEX [UserName] ON [radcheck]([UserName]) ON [PRIMARY] GO CREATE INDEX [GroupName] ON [radgroupcheck]([GroupName]) ON [PRIMARY] GO CREATE INDEX [GroupName] ON [radgroupreply]([GroupName]) ON [PRIMARY] GO CREATE INDEX [UserName] ON [radreply]([UserName]) ON [PRIMARY] GO CREATE INDEX [UserName] ON [radusergroup]([UserName]) ON [PRIMARY] GO freeradius-server/raddb/sql/mysql/000077500000000000000000000000001257552170400175435ustar00rootroot00000000000000freeradius-server/raddb/sql/mysql/admin.sql000077500000000000000000000012251257552170400213570ustar00rootroot00000000000000# -*- text -*- ## ## admin.sql -- MySQL commands for creating the RADIUS user. ## ## WARNING: You should change 'localhost' and 'radpass' ## to something else. Also update raddb/sql.conf ## with the new RADIUS password. ## ## $Id$ # # Create default administrator for RADIUS # CREATE USER 'radius'@'localhost'; SET PASSWORD FOR 'radius'@'localhost' = PASSWORD('radpass'); # The server can read any table in SQL GRANT SELECT ON radius.* TO 'radius'@'localhost'; # The server can write to the accounting and post-auth logging table. # # i.e. GRANT ALL on radius.radacct TO 'radius'@'localhost'; GRANT ALL on radius.radpostauth TO 'radius'@'localhost'; freeradius-server/raddb/sql/mysql/counter.conf000066400000000000000000000106771257552170400221040ustar00rootroot00000000000000# -*- text -*- ## ## counter.conf -- PostgreSQL queries for rlm_sqlcounter ## ## $Id$ # Rather than maintaining seperate (GDBM) databases of # accounting info for each counter, this module uses the data # stored in the raddacct table by the sql modules. This # module NEVER does any database INSERTs or UPDATEs. It is # totally dependent on the SQL module to process Accounting # packets. # # The 'sqlmod_inst' parameter holds the instance of the sql # module to use when querying the SQL database. Normally it # is just "sql". If you define more and one SQL module # instance (usually for failover situations), you can # specify which module has access to the Accounting Data # (radacct table). # # The 'reset' parameter defines when the counters are all # reset to zero. It can be hourly, daily, weekly, monthly or # never. It can also be user defined. It should be of the # form: # num[hdwm] where: # h: hours, d: days, w: weeks, m: months # If the letter is ommited days will be assumed. In example: # reset = 10h (reset every 10 hours) # reset = 12 (reset every 12 days) # # The 'key' parameter specifies the unique identifier for the # counter records (usually 'User-Name'). # # The 'query' parameter specifies the SQL query used to get # the current Counter value from the database. There are 3 # parameters that can be used in the query: # %k 'key' parameter # %b unix time value of beginning of reset period # %e unix time value of end of reset period # # The 'check-name' parameter is the name of the 'check' # attribute to use to access the counter in the 'users' file # or SQL radcheck or radcheckgroup tables. # # DEFAULT Max-Daily-Session > 3600, Auth-Type = Reject # Reply-Message = "You've used up more than one hour today" # sqlcounter dailycounter { counter-name = Daily-Session-Time check-name = Max-Daily-Session reply-name = Session-Timeout sqlmod-inst = sql key = User-Name reset = daily # This query properly handles calls that span from the # previous reset period into the current period but # involves more work for the SQL server than those # below query = "SELECT SUM(acctsessiontime - \ GREATEST((%b - UNIX_TIMESTAMP(acctstarttime)), 0)) \ FROM radacct WHERE username = '%{%k}' AND \ UNIX_TIMESTAMP(acctstarttime) + acctsessiontime > '%b'" # This query ignores calls that started in a previous # reset period and continue into into this one. But it # is a little easier on the SQL server # query = "SELECT SUM(acctsessiontime) FROM radacct WHERE \ # username = '%{%k}' AND acctstarttime > FROM_UNIXTIME('%b')" # This query is the same as above, but demonstrates an # additional counter parameter '%e' which is the # timestamp for the end of the period # query = "SELECT SUM(acctsessiontime) FROM radacct \ # WHERE username = '%{%k}' AND acctstarttime BETWEEN \ # FROM_UNIXTIME('%b') AND FROM_UNIXTIME('%e')" } sqlcounter monthlycounter { counter-name = Monthly-Session-Time check-name = Max-Monthly-Session reply-name = Session-Timeout sqlmod-inst = sql key = User-Name reset = monthly # This query properly handles calls that span from the # previous reset period into the current period but # involves more work for the SQL server than those # below query = "SELECT SUM(acctsessiontime - \ GREATEST((%b - UNIX_TIMESTAMP(acctstarttime)), 0)) \ FROM radacct WHERE username='%{%k}' AND \ UNIX_TIMESTAMP(acctstarttime) + acctsessiontime > '%b'" # This query ignores calls that started in a previous # reset period and continue into into this one. But it # is a little easier on the SQL server # query = "SELECT SUM(acctsessiontime) FROM radacct WHERE \ # username='%{%k}' AND acctstarttime > FROM_UNIXTIME('%b')" # This query is the same as above, but demonstrates an # additional counter parameter '%e' which is the # timestamp for the end of the period # query = "SELECT SUM(acctsessiontime) FROM radacct \ # WHERE username='%{%k}' AND acctstarttime BETWEEN \ # FROM_UNIXTIME('%b') AND FROM_UNIXTIME('%e')" } sqlcounter noresetcounter { counter-name = Max-All-Session-Time check-name = Max-All-Session sqlmod-inst = sql key = User-Name reset = never query = "SELECT IFNULL(SUM(AcctSessionTime),0) FROM radacct WHERE UserName='%{%k}'" } freeradius-server/raddb/sql/mysql/cui.conf000066400000000000000000000023321257552170400211720ustar00rootroot00000000000000# -*- text -*- ## ## Queries to update the CUI table. ## postauth_query = "INSERT IGNORE INTO ${cui_table} \ (clientipaddress, callingstationid, username, cui, lastaccounting) \ VALUES \ ('%{Client-IP-Address}', '%{Calling-Station-Id}', '%{User-Name}', '%{reply:Chargeable-User-Identity}', NULL) ON DUPLICATE KEY UPDATE lastaccounting='0000-00-00 00:00:00', cui='%{reply:Chargeable-User-Identity}'"; accounting_start_query = "UPDATE ${cui_table} \ SET \ lastaccounting = CURRENT_TIMESTAMP \ WHERE clientipaddress = '%{Client-IP-Address}' \ AND callingstationid = '%{Calling-Station-Id}' \ AND username = '%{User-Name}' \ AND cui = '%{Chargeable-User-Identity}'"; accounting_update_query = "UPDATE ${cui_table} \ SET \ lastaccounting = CURRENT_TIMESTAMP \ WHERE clientipaddress = '%{Client-IP-Address}' \ AND callingstationid = '%{Calling-Station-Id}' \ AND username = '%{User-Name}' \ AND cui = '%{Chargeable-User-Identity}'"; accounting_stop_query = "DELETE FROM ${cui_table} WHERE \ clientipaddress = '%{Client-IP-Address}' \ AND callingstationid = '%{Calling-Station-Id}' \ AND username = '%{User-Name}' \ AND cui = '%{Chargeable-User-Identity}'"; freeradius-server/raddb/sql/mysql/cui.sql000066400000000000000000000007041257552170400210450ustar00rootroot00000000000000CREATE TABLE `cui` ( `clientipaddress` varchar(15) NOT NULL default '', `callingstationid` varchar(50) NOT NULL default '', `username` varchar(64) NOT NULL default '', `cui` varchar(32) NOT NULL default '', `creationdate` timestamp NOT NULL default CURRENT_TIMESTAMP, `lastaccounting` timestamp NOT NULL default '0000-00-00 00:00:00', PRIMARY KEY (`username`,`clientipaddress`,`callingstationid`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1; freeradius-server/raddb/sql/mysql/dialup.conf000066400000000000000000000351351257552170400216770ustar00rootroot00000000000000# -*- text -*- ## ## dialup.conf -- MySQL configuration for default schema (schema.sql) ## ## $Id$ # Safe characters list for sql queries. Everything else is replaced # with their mime-encoded equivalents. # The default list should be ok #safe-characters = "@abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.-_: /" ####################################################################### # Connection config ####################################################################### # The character set is not configurable. The default character set of # the mysql client library is used. To control the character set, # create/edit my.cnf (typically in /etc/mysql/my.cnf or /etc/my.cnf) # and enter # [client] # default-character-set = utf8 # ####################################################################### # Query config: Username ####################################################################### # This is the username that will get substituted, escaped, and added # as attribute 'SQL-User-Name'. '%{SQL-User-Name}' should be used below # everywhere a username substitution is needed so you you can be sure # the username passed from the client is escaped properly. # # Uncomment the next line, if you want the sql_user_name to mean: # # Use Stripped-User-Name, if it's there. # Else use User-Name, if it's there, # Else use hard-coded string "DEFAULT" as the user name. #sql_user_name = "%{%{Stripped-User-Name}:-%{%{User-Name}:-DEFAULT}}" # sql_user_name = "%{User-Name}" ####################################################################### # Default profile ####################################################################### # This is the default profile. It is found in SQL by group membership. # That means that this profile must be a member of at least one group # which will contain the corresponding check and reply items. # This profile will be queried in the authorize section for every user. # The point is to assign all users a default profile without having to # manually add each one to a group that will contain the profile. # The SQL module will also honor the User-Profile attribute. This # attribute can be set anywhere in the authorize section (ie the users # file). It is found exactly as the default profile is found. # If it is set then it will *overwrite* the default profile setting. # The idea is to select profiles based on checks on the incoming packets, # not on user group membership. For example: # -- users file -- # DEFAULT Service-Type == Outbound-User, User-Profile := "outbound" # DEFAULT Service-Type == Framed-User, User-Profile := "framed" # # By default the default_user_profile is not set # #default_user_profile = "DEFAULT" ####################################################################### # NAS Query ####################################################################### # This query retrieves the radius clients # # 0. Row ID (currently unused) # 1. Name (or IP address) # 2. Shortname # 3. Type # 4. Secret # 5. Server ####################################################################### nas_query = "SELECT id, nasname, shortname, type, secret, server FROM ${nas_table}" ####################################################################### # Authorization Queries ####################################################################### # These queries compare the check items for the user # in ${authcheck_table} and setup the reply items in # ${authreply_table}. You can use any query/tables # you want, but the return data for each row MUST # be in the following order: # # 0. Row ID (currently unused) # 1. UserName/GroupName # 2. Item Attr Name # 3. Item Attr Value # 4. Item Attr Operation ####################################################################### # Use these for case sensitive usernames. # authorize_check_query = "SELECT id, username, attribute, value, op \ # FROM ${authcheck_table} \ # WHERE username = BINARY '%{SQL-User-Name}' \ # ORDER BY id" # authorize_reply_query = "SELECT id, username, attribute, value, op \ # FROM ${authreply_table} \ # WHERE username = BINARY '%{SQL-User-Name}' \ # ORDER BY id" # The default queries are case insensitive. (for compatibility with # older versions of FreeRADIUS) authorize_check_query = "SELECT id, username, attribute, value, op \ FROM ${authcheck_table} \ WHERE username = '%{SQL-User-Name}' \ ORDER BY id" authorize_reply_query = "SELECT id, username, attribute, value, op \ FROM ${authreply_table} \ WHERE username = '%{SQL-User-Name}' \ ORDER BY id" # Use these for case sensitive usernames. # group_membership_query = "SELECT groupname \ # FROM ${usergroup_table} \ # WHERE username = BINARY '%{SQL-User-Name}' \ # ORDER BY priority" group_membership_query = "SELECT groupname \ FROM ${usergroup_table} \ WHERE username = '%{SQL-User-Name}' \ ORDER BY priority" authorize_group_check_query = "SELECT id, groupname, attribute, \ Value, op \ FROM ${groupcheck_table} \ WHERE groupname = '%{Sql-Group}' \ ORDER BY id" authorize_group_reply_query = "SELECT id, groupname, attribute, \ value, op \ FROM ${groupreply_table} \ WHERE groupname = '%{Sql-Group}' \ ORDER BY id" ####################################################################### # Accounting Queries ####################################################################### # accounting_onoff_query - query for Accounting On/Off packets # accounting_update_query - query for Accounting update packets # accounting_update_query_alt - query for Accounting update packets # (alternate in case first query fails) # accounting_start_query - query for Accounting start packets # accounting_start_query_alt - query for Accounting start packets # (alternate in case first query fails) # accounting_stop_query - query for Accounting stop packets # accounting_stop_query_alt - query for Accounting start packets # (alternate in case first query doesn't # affect any existing rows in the table) ####################################################################### accounting_onoff_query = "\ UPDATE ${acct_table1} \ SET \ acctstoptime = '%S', \ acctsessiontime = unix_timestamp('%S') - \ unix_timestamp(acctstarttime), \ acctterminatecause = '%{Acct-Terminate-Cause}', \ acctstopdelay = %{%{Acct-Delay-Time}:-0} \ WHERE acctstoptime IS NULL \ AND nasipaddress = '%{NAS-IP-Address}' \ AND acctstarttime <= '%S'" accounting_update_query = " \ UPDATE ${acct_table1} \ SET \ framedipaddress = '%{Framed-IP-Address}', \ acctsessiontime = '%{%{Acct-Session-Time}:-0}', \ acctinputoctets = '%{%{Acct-Input-Gigawords}:-0}' << 32 | \ '%{%{Acct-Input-Octets}:-0}', \ acctoutputoctets = '%{%{Acct-Output-Gigawords}:-0}' << 32 | \ '%{%{Acct-Output-Octets}:-0}' \ WHERE acctsessionid = '%{Acct-Session-Id}' \ AND username = '%{SQL-User-Name}' \ AND nasipaddress = '%{NAS-IP-Address}'" accounting_update_query_alt = " \ INSERT INTO ${acct_table1} \ (acctsessionid, acctuniqueid, username, \ realm, nasipaddress, nasportid, \ nasporttype, acctstarttime, acctsessiontime, \ acctauthentic, connectinfo_start, acctinputoctets, \ acctoutputoctets, calledstationid, callingstationid, \ servicetype, framedprotocol, framedipaddress, \ acctstartdelay, xascendsessionsvrkey) \ VALUES \ ('%{Acct-Session-Id}', '%{Acct-Unique-Session-Id}', \ '%{SQL-User-Name}', \ '%{Realm}', '%{NAS-IP-Address}', '%{NAS-Port}', \ '%{NAS-Port-Type}', \ DATE_SUB('%S', \ INTERVAL (%{%{Acct-Session-Time}:-0} + \ %{%{Acct-Delay-Time}:-0}) SECOND), \ '%{%{Acct-Session-Time}:-0}', \ '%{Acct-Authentic}', '', \ '%{%{Acct-Input-Gigawords}:-0}' << 32 | \ '%{%{Acct-Input-Octets}:-0}', \ '%{%{Acct-Output-Gigawords}:-0}' << 32 | \ '%{%{Acct-Output-Octets}:-0}', \ '%{Called-Station-Id}', '%{Calling-Station-Id}', \ '%{Service-Type}', '%{Framed-Protocol}', \ '%{Framed-IP-Address}', \ '0', '%{X-Ascend-Session-Svr-Key}')" accounting_start_query = " \ INSERT INTO ${acct_table1} \ (acctsessionid, acctuniqueid, username, \ realm, nasipaddress, nasportid, \ nasporttype, acctstarttime, acctstoptime, \ acctsessiontime, acctauthentic, connectinfo_start, \ connectinfo_stop, acctinputoctets, acctoutputoctets, \ calledstationid, callingstationid, acctterminatecause, \ servicetype, framedprotocol, framedipaddress, \ acctstartdelay, acctstopdelay, xascendsessionsvrkey) \ VALUES \ ('%{Acct-Session-Id}', '%{Acct-Unique-Session-Id}', \ '%{SQL-User-Name}', \ '%{Realm}', '%{NAS-IP-Address}', '%{NAS-Port}', \ '%{NAS-Port-Type}', '%S', NULL, \ '0', '%{Acct-Authentic}', '%{Connect-Info}', \ '', '0', '0', \ '%{Called-Station-Id}', '%{Calling-Station-Id}', '', \ '%{Service-Type}', '%{Framed-Protocol}', '%{Framed-IP-Address}', \ '%{%{Acct-Delay-Time}:-0}', '0', '%{X-Ascend-Session-Svr-Key}')" accounting_start_query_alt = " \ UPDATE ${acct_table1} SET \ acctstarttime = '%S', \ acctstartdelay = '%{%{Acct-Delay-Time}:-0}', \ connectinfo_start = '%{Connect-Info}' \ WHERE acctsessionid = '%{Acct-Session-Id}' \ AND username = '%{SQL-User-Name}' \ AND nasipaddress = '%{NAS-IP-Address}'" accounting_stop_query = " \ UPDATE ${acct_table2} SET \ acctstoptime = '%S', \ acctsessiontime = '%{%{Acct-Session-Time}:-0}', \ acctinputoctets = '%{%{Acct-Input-Gigawords}:-0}' << 32 | \ '%{%{Acct-Input-Octets}:-0}', \ acctoutputoctets = '%{%{Acct-Output-Gigawords}:-0}' << 32 | \ '%{%{Acct-Output-Octets}:-0}', \ acctterminatecause = '%{Acct-Terminate-Cause}', \ acctstopdelay = '%{%{Acct-Delay-Time}:-0}', \ connectinfo_stop = '%{Connect-Info}' \ WHERE acctsessionid = '%{Acct-Session-Id}' \ AND username = '%{SQL-User-Name}' \ AND nasipaddress = '%{NAS-IP-Address}'" accounting_stop_query_alt = " \ INSERT INTO ${acct_table2} \ (acctsessionid, acctuniqueid, username, \ realm, nasipaddress, nasportid, \ nasporttype, acctstarttime, acctstoptime, \ acctsessiontime, acctauthentic, connectinfo_start, \ connectinfo_stop, acctinputoctets, acctoutputoctets, \ calledstationid, callingstationid, acctterminatecause, \ servicetype, framedprotocol, framedipaddress, \ acctstartdelay, acctstopdelay) \ VALUES \ ('%{Acct-Session-Id}', '%{Acct-Unique-Session-Id}', \ '%{SQL-User-Name}', \ '%{Realm}', '%{NAS-IP-Address}', '%{NAS-Port}', \ '%{NAS-Port-Type}', \ DATE_SUB('%S', \ INTERVAL (%{%{Acct-Session-Time}:-0} + \ %{%{Acct-Delay-Time}:-0}) SECOND), \ '%S', '%{%{Acct-Session-Time}:-0}', '%{Acct-Authentic}', '', \ '%{Connect-Info}', \ '%{%{Acct-Input-Gigawords}:-0}' << 32 | \ '%{%{Acct-Input-Octets}:-0}', \ '%{%{Acct-Output-Gigawords}:-0}' << 32 | \ '%{%{Acct-Output-Octets}:-0}', \ '%{Called-Station-Id}', '%{Calling-Station-Id}', \ '%{Acct-Terminate-Cause}', \ '%{Service-Type}', '%{Framed-Protocol}', '%{Framed-IP-Address}', \ '0', '%{%{Acct-Delay-Time}:-0}')" ####################################################################### # Simultaneous Use Checking Queries ####################################################################### # simul_count_query - query for the number of current connections # - If this is not defined, no simultaneouls use checking # - will be performed by this module instance # simul_verify_query - query to return details of current connections for verification # - Leave blank or commented out to disable verification step # - Note that the returned field order should not be changed. ####################################################################### # Uncomment simul_count_query to enable simultaneous use checking #simul_count_query = "SELECT COUNT(*) \ #FROM ${acct_table1} \ #WHERE username = '%{SQL-User-Name}' \ #AND acctstoptime IS NULL" simul_verify_query = "SELECT radacctid, acctsessionid, username, \ nasipaddress, nasportid, framedipaddress, \ callingstationid, framedprotocol \ FROM ${acct_table1} \ WHERE username = '%{SQL-User-Name}' \ AND acctstoptime IS NULL" ####################################################################### # Authentication Logging Queries ####################################################################### # postauth_query - Insert some info after authentication ####################################################################### postauth_query = "INSERT INTO ${postauth_table} \ (username, pass, reply, authdate) \ VALUES ( \ '%{User-Name}', \ '%{%{User-Password}:-%{Chap-Password}}', \ '%{reply:Packet-Type}', '%S')" freeradius-server/raddb/sql/mysql/ippool-dhcp.conf000066400000000000000000000053741257552170400226410ustar00rootroot00000000000000# -*- text -*- ## ## ippool-dhcp.conf -- MySQL queries for sqlippool-dhcp instance ## Only post-auth method is used ## ## $Id$ ## This series of queries allocates an IP address ## First, clear expired entries allocate-clear = "UPDATE ${ippool_table} \ SET nasipaddress = '', pool_key = 0, \ callingstationid = '', username = '', \ expiry_time = NULL \ WHERE expiry_time <= NOW() - INTERVAL 1 SECOND \ " ## Then find an available IP address ## The ORDER BY clause of this query tries to allocate the same IP address ## which user had last session regardless of expiry time ## to handle DHCP request and duplicates from the same client allocate-find = "SELECT framedipaddress FROM ${ippool_table} \ WHERE pool_name = '%{control:Pool-Name}' AND \ ( \ (callingstationid = '%{Calling-Station-Id}') OR \ (expiry_time < NOW() OR expiry_time IS NULL) \ ) \ ORDER BY (callingstationid = '%{Calling-Station-Id}') DESC, \ expiry_time DESC\ LIMIT 1 \ FOR UPDATE" ## If an IP could not be allocated, check to see if the pool exists or not ## This allows the module to differentiate between a full pool and no pool ## Note: If you are not running redundant pool modules this query may be ## commented out to save running this query every time an ip is not allocated. pool-check = "SELECT id FROM ${ippool_table} \ WHERE pool_name='%{control:Pool-Name}' LIMIT 1" ## This is the final IP Allocation query, which saves the allocated ip details allocate-update = "UPDATE ${ippool_table} \ SET nasipaddress = '%{NAS-IP-Address}', pool_key = '${pool-key}', \ callingstationid = '%{Calling-Station-Id}', username = '%{User-Name}', \ calledstationid = 'Freeradius-DHCP', \ expiry_time = GREATEST( \ IF(ISNULL(expiry_time),'0000-00-00 00:00:00',expiry_time), \ NOW() + INTERVAL ${lease-duration} SECOND) \ WHERE framedipaddress = '%I' AND \ ( \ (callingstationid = '%{Calling-Station-Id}') OR \ (expiry_time < NOW() OR expiry_time IS NULL) \ ) \ " ## This series of queries frees an IP number when an accounting ## START record arrives. Unused, but must be set to non-empty query start-update = "SELECT NOW()" ## This series of queries frees an IP number when an accounting ## STOP record arrives. Unused, but must be set to non-empty query stop-clear = "SELECT NOW()" ## This series of queries frees an IP number when an accounting ## ALIVE record arrives. Unused, but must be set to non-empty query alive-update = "SELECT NOW()" ## This series of queries frees the IP numbers allocate to a ## NAS when an accounting ON record arrives. Unused, but must be set ## to non-empty query on-clear = "SELECT NOW()" ## This series of queries frees the IP numbers allocate to a ## NAS when an accounting OFF record arrives. Unused, but must be set ## to non-empty query off-clear = "SELECT NOW()" freeradius-server/raddb/sql/mysql/ippool.conf000066400000000000000000000077331257552170400217260ustar00rootroot00000000000000# -*- text -*- ## ## ippool.conf -- MySQL queries for rlm_sqlippool ## ## $Id$ # ## This series of queries allocates an IP address # allocate-clear = "UPDATE ${ippool_table} \ # SET nasipaddress = '', pool_key = 0, \ # callingstationid = '', username = '', \ # expiry_time = NULL \ # WHERE pool_key = '${pool-key}'" ## This series of queries allocates an IP address ## (Note: If your pool-key is set to Calling-Station-Id and not NAS-Port ## then you may wish to delete the "AND nasipaddress = '%{Nas-IP-Address}' ## from the WHERE clause) allocate-clear = "UPDATE ${ippool_table} \ SET nasipaddress = '', pool_key = 0, \ callingstationid = '', username = '', \ expiry_time = NULL \ WHERE expiry_time <= NOW() - INTERVAL 1 SECOND \ AND nasipaddress = '%{Nas-IP-Address}'" ## The ORDER BY clause of this query tries to allocate the same IP-address ## which user had last session... allocate-find = "SELECT framedipaddress FROM ${ippool_table} \ WHERE pool_name = '%{control:Pool-Name}' AND (expiry_time < NOW() OR expiry_time IS NULL) \ ORDER BY (username <> '%{User-Name}'), \ (callingstationid <> '%{Calling-Station-Id}'), \ expiry_time \ LIMIT 1 \ FOR UPDATE" # ## If you prefer to allocate a random IP address every time, i # ## use this query instead # allocate-find = "SELECT framedipaddress FROM ${ippool_table} \ # WHERE pool_name = '%{control:Pool-Name}' \ # AND expiry_time IS NULL \ # ORDER BY RAND() \ # LIMIT 1 \ # FOR UPDATE" ## If an IP could not be allocated, check to see if the pool exists or not ## This allows the module to differentiate between a full pool and no pool ## Note: If you are not running redundant pool modules this query may be ## commented out to save running this query every time an ip is not allocated. pool-check = "SELECT id FROM ${ippool_table} \ WHERE pool_name='%{control:Pool-Name}' LIMIT 1" ## This is the final IP Allocation query, which saves the allocated ip details allocate-update = "UPDATE ${ippool_table} \ SET nasipaddress = '%{NAS-IP-Address}', pool_key = '${pool-key}', \ callingstationid = '%{Calling-Station-Id}', username = '%{User-Name}', \ expiry_time = NOW() + INTERVAL ${lease-duration} SECOND \ WHERE framedipaddress = '%I' AND expiry_time IS NULL" ## This series of queries frees an IP number when an accounting ## START record arrives start-update = "UPDATE ${ippool_table} \ SET expiry_time = NOW() + INTERVAL ${lease-duration} SECOND \ WHERE nasipaddress = '%{NAS-IP-Address}' AND pool_key = '${pool-key}' \ AND username = '%{User-Name}' \ AND callingstationid = '%{Calling-Station-Id}' \ AND framedipaddress = '%{Framed-IP-Address}'" ## This series of queries frees an IP number when an accounting ## STOP record arrives stop-clear = "UPDATE ${ippool_table} \ SET nasipaddress = '', pool_key = 0, callingstationid = '', username = '', \ expiry_time = NULL \ WHERE nasipaddress = '%{Nas-IP-Address}' AND pool_key = '${pool-key}' \ AND username = '%{User-Name}' \ AND callingstationid = '%{Calling-Station-Id}' \ AND framedipaddress = '%{Framed-IP-Address}'" ## This series of queries frees an IP number when an accounting ## ALIVE record arrives alive-update = "UPDATE ${ippool_table} \ SET expiry_time = NOW() + INTERVAL ${lease-duration} SECOND \ WHERE nasipaddress = '%{Nas-IP-Address}' AND pool_key = '${pool-key}' \ AND username = '%{User-Name}' \ AND callingstationid = '%{Calling-Station-Id}' \ AND framedipaddress = '%{Framed-IP-Address}'" ## This series of queries frees the IP numbers allocate to a ## NAS when an accounting ON record arrives on-clear = "UPDATE ${ippool_table} \ SET nasipaddress = '', pool_key = 0, callingstationid = '', username = '', \ expiry_time = NULL \ WHERE nasipaddress = '%{Nas-IP-Address}'" ## This series of queries frees the IP numbers allocate to a ## NAS when an accounting OFF record arrives off-clear = "UPDATE ${ippool_table} \ SET nasipaddress = '', pool_key = 0, callingstationid = '', username = '', \ expiry_time = NULL \ WHERE nasipaddress = '%{Nas-IP-Address}'" freeradius-server/raddb/sql/mysql/ippool.sql000066400000000000000000000013711257552170400215700ustar00rootroot00000000000000# # Table structure for table 'radippool' # CREATE TABLE radippool ( id int(11) unsigned NOT NULL auto_increment, pool_name varchar(30) NOT NULL, framedipaddress varchar(15) NOT NULL default '', nasipaddress varchar(15) NOT NULL default '', calledstationid VARCHAR(30) NOT NULL, callingstationid VARCHAR(30) NOT NULL, expiry_time DATETIME NULL default NULL, username varchar(64) NOT NULL default '', pool_key varchar(30) NOT NULL, PRIMARY KEY (id), KEY radippool_poolname_expire (pool_name, expiry_time), KEY framedipaddress (framedipaddress), KEY radippool_nasip_poolkey_ipaddress (nasipaddress, pool_key, framedipaddress) ) ENGINE=InnoDB; freeradius-server/raddb/sql/mysql/nas.sql000066400000000000000000000006171257552170400210510ustar00rootroot00000000000000# # Table structure for table 'nas' # CREATE TABLE nas ( id int(10) NOT NULL auto_increment, nasname varchar(128) NOT NULL, shortname varchar(32), type varchar(30) DEFAULT 'other', ports int(5), secret varchar(60) DEFAULT 'secret' NOT NULL, server varchar(64), community varchar(50), description varchar(200) DEFAULT 'RADIUS Client', PRIMARY KEY (id), KEY nasname (nasname) ); freeradius-server/raddb/sql/mysql/schema.sql000066400000000000000000000104361257552170400215300ustar00rootroot00000000000000########################################################################### # $Id$ # # # # schema.sql rlm_sql - FreeRADIUS SQL Module # # # # Database schema for MySQL rlm_sql module # # # # To load: # # mysql -uroot -prootpass radius < schema.sql # # # # Mike Machado # ########################################################################### # # Table structure for table 'radacct' # CREATE TABLE radacct ( radacctid bigint(21) NOT NULL auto_increment, acctsessionid varchar(64) NOT NULL default '', acctuniqueid varchar(32) NOT NULL default '', username varchar(64) NOT NULL default '', groupname varchar(64) NOT NULL default '', realm varchar(64) default '', nasipaddress varchar(15) NOT NULL default '', nasportid varchar(15) default NULL, nasporttype varchar(32) default NULL, acctstarttime datetime NULL default NULL, acctstoptime datetime NULL default NULL, acctsessiontime int(12) unsigned default NULL, acctauthentic varchar(32) default NULL, connectinfo_start varchar(50) default NULL, connectinfo_stop varchar(50) default NULL, acctinputoctets bigint(20) default NULL, acctoutputoctets bigint(20) default NULL, calledstationid varchar(50) NOT NULL default '', callingstationid varchar(50) NOT NULL default '', acctterminatecause varchar(32) NOT NULL default '', servicetype varchar(32) default NULL, framedprotocol varchar(32) default NULL, framedipaddress varchar(15) NOT NULL default '', acctstartdelay int(12) unsigned default NULL, acctstopdelay int(12) unsigned default NULL, xascendsessionsvrkey varchar(10) default NULL, PRIMARY KEY (radacctid), UNIQUE KEY acctuniqueid (acctuniqueid), KEY username (username), KEY framedipaddress (framedipaddress), KEY acctsessionid (acctsessionid), KEY acctsessiontime (acctsessiontime), KEY acctstarttime (acctstarttime), KEY acctstoptime (acctstoptime), KEY nasipaddress (nasipaddress) ) ENGINE = INNODB; # # Table structure for table 'radcheck' # CREATE TABLE radcheck ( id int(11) unsigned NOT NULL auto_increment, username varchar(64) NOT NULL default '', attribute varchar(64) NOT NULL default '', op char(2) NOT NULL DEFAULT '==', value varchar(253) NOT NULL default '', PRIMARY KEY (id), KEY username (username(32)) ) ; # # Table structure for table 'radgroupcheck' # CREATE TABLE radgroupcheck ( id int(11) unsigned NOT NULL auto_increment, groupname varchar(64) NOT NULL default '', attribute varchar(64) NOT NULL default '', op char(2) NOT NULL DEFAULT '==', value varchar(253) NOT NULL default '', PRIMARY KEY (id), KEY groupname (groupname(32)) ) ; # # Table structure for table 'radgroupreply' # CREATE TABLE radgroupreply ( id int(11) unsigned NOT NULL auto_increment, groupname varchar(64) NOT NULL default '', attribute varchar(64) NOT NULL default '', op char(2) NOT NULL DEFAULT '=', value varchar(253) NOT NULL default '', PRIMARY KEY (id), KEY groupname (groupname(32)) ) ; # # Table structure for table 'radreply' # CREATE TABLE radreply ( id int(11) unsigned NOT NULL auto_increment, username varchar(64) NOT NULL default '', attribute varchar(64) NOT NULL default '', op char(2) NOT NULL DEFAULT '=', value varchar(253) NOT NULL default '', PRIMARY KEY (id), KEY username (username(32)) ) ; # # Table structure for table 'radusergroup' # CREATE TABLE radusergroup ( username varchar(64) NOT NULL default '', groupname varchar(64) NOT NULL default '', priority int(11) NOT NULL default '1', KEY username (username(32)) ) ; # # Table structure for table 'radpostauth' # CREATE TABLE radpostauth ( id int(11) NOT NULL auto_increment, username varchar(64) NOT NULL default '', pass varchar(64) NOT NULL default '', reply varchar(32) NOT NULL default '', authdate timestamp NOT NULL, PRIMARY KEY (id) ) ENGINE = INNODB; freeradius-server/raddb/sql/mysql/wimax.conf000066400000000000000000000034641257552170400215460ustar00rootroot00000000000000# -*- text -*- ## ## wimax.conf -- MySQL configuration for WiMAX keying ## ## $Id$ # Safe characters list for sql queries. Everything else is replaced # with their mime-encoded equivalents. # The default list should be ok #safe-characters = "@abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.-_: /" ####################################################################### # Query config: Username ####################################################################### # This is the username that will get substituted, escaped, and added # as attribute 'SQL-User-Name'. '%{SQL-User-Name}' should be used below # everywhere a username substitution is needed so you you can be sure # the username passed from the client is escaped properly. # # Uncomment the next line, if you want the sql_user_name to mean: # # Use Stripped-User-Name, if it's there. # Else use User-Name, if it's there, # Else use hard-coded string "DEFAULT" as the user name. #sql_user_name = "%{%{Stripped-User-Name}:-%{%{User-Name}:-DEFAULT}}" # sql_user_name = "%{User-Name}" ####################################################################### # Logging of WiMAX SPI -> key mappings ####################################################################### # postauth_query - Insert some info after authentication ####################################################################### postauth_query = "INSERT INTO wimax \ (username, authdate, spi, mipkey, lifetime) \ VALUES ( \ '%{User-Name}', '%S' \ '%{%{reply:WiMAX-MN-hHA-MIP4-SPI}:-%{reply:WiMAX-MN-hHA-MIP6-SPI}}', \ '%{%{reply:WiMAX-MN-hHA-MIP4-Key}:-%{reply:WiMAX-MN-hHA-MIP6-Key}}', '%{%{reply:Session-Timeout}:-86400}' )" freeradius-server/raddb/sql/mysql/wimax.sql000066400000000000000000000006271257552170400214160ustar00rootroot00000000000000# # WiMAX Table structure for table 'wimax', # which replaces the "radpostauth" table. # CREATE TABLE wimax ( id int(11) NOT NULL auto_increment, username varchar(64) NOT NULL default '', authdate timestamp NOT NULL, spi varchar(16) NOT NULL default '', mipkey varchar(400) NOT NULL default '', lifetime int(12) default NULL, PRIMARY KEY (id), KEY username (username), KEY spi (spi) ) ; freeradius-server/raddb/sql/ndb/000077500000000000000000000000001257552170400171415ustar00rootroot00000000000000freeradius-server/raddb/sql/ndb/README000066400000000000000000000003461257552170400200240ustar00rootroot00000000000000 The SQL schema and 'create admin user" scripts are here in order to simplify the process of using MySQL cluster. The queries are NOT located here, because the database driver for MySQL cluster is just "mysql", and not "ndb". freeradius-server/raddb/sql/ndb/admin.sql000066400000000000000000000014331257552170400207530ustar00rootroot00000000000000# -*- text -*- ## ## admin.sql -- MySQL commands for creating the RADIUS user. ## ## WARNING: You should change 'localhost' and 'radpass' ## to something else. Also update raddb/sql.conf ## with the new RADIUS password. ## ## $Id$ # # Create default administrator for RADIUS # CREATE USER 'radius'@'localhost'; SET PASSWORD FOR 'radius'@'localhost' = PASSWORD('radpass'); # The server can read any table in SQL GRANT ALL ON radius.* TO 'radius'@'localhost' identified by 'radpass'; GRANT ALL ON radius.* TO 'radius'@'radsrvr' identified by 'radpass'; # The server can write to the accounting and post-auth logging table. # # i.e. #GRANT ALL on radius.radacct TO 'radius'@'localhost' identified by 'radpass'; #GRANT ALL on radius.radacct TO 'radius'@'radsrvr' identified by 'radpass'; freeradius-server/raddb/sql/ndb/schema.sql000066400000000000000000000107301257552170400211230ustar00rootroot00000000000000########################################################################### # $Id$ # # # # schema.sql rlm_sql - FreeRADIUS SQL Module # # # # Database schema for MySQL Cluster. # # The only difference between this file and ../mysql/schema.sql # # is the definition of the storage engine. # # # # To load: # # mysql -uroot -prootpass radius < schema.sql # # # # Mike Machado # ########################################################################### # # Table structure for table 'radacct' # CREATE TABLE radacct ( radacctid bigint(21) NOT NULL auto_increment, acctsessionid varchar(64) NOT NULL default '', acctuniqueid varchar(32) NOT NULL default '', username varchar(64) NOT NULL default '', groupname varchar(64) NOT NULL default '', realm varchar(64) default '', nasipaddress varchar(15) NOT NULL default '', nasportid varchar(15) default NULL, nasporttype varchar(32) default NULL, acctstarttime datetime NULL default NULL, acctstoptime datetime NULL default NULL, acctsessiontime int(12) default NULL, acctauthentic varchar(32) default NULL, connectinfo_start varchar(50) default NULL, connectinfo_stop varchar(50) default NULL, acctinputoctets bigint(20) default NULL, acctoutputoctets bigint(20) default NULL, calledstationid varchar(50) NOT NULL default '', callingstationid varchar(50) NOT NULL default '', acctterminatecause varchar(32) NOT NULL default '', servicetype varchar(32) default NULL, framedprotocol varchar(32) default NULL, framedipaddress varchar(15) NOT NULL default '', acctstartdelay int(12) default NULL, acctstopdelay int(12) default NULL, xascendsessionsvrkey varchar(10) default NULL, PRIMARY KEY (radacctid), UNIQUE KEY acctuniqueid (acctuniqueid), KEY username (username), KEY framedipaddress (framedipaddress), KEY acctsessionid (acctsessionid), KEY acctsessiontime (acctsessiontime), KEY acctstarttime (acctstarttime), KEY acctstoptime (acctstoptime), KEY nasipaddress (nasipaddress) ) ENGINE=ndbcluster; # # Table structure for table 'radcheck' # CREATE TABLE radcheck ( id int(11) unsigned NOT NULL auto_increment, username varchar(64) NOT NULL default '', attribute varchar(64) NOT NULL default '', op char(2) NOT NULL DEFAULT '==', value varchar(253) NOT NULL default '', PRIMARY KEY (id), KEY username (username(32)) ) ENGINE=ndbcluster; # # Table structure for table 'radgroupcheck' # CREATE TABLE radgroupcheck ( id int(11) unsigned NOT NULL auto_increment, groupname varchar(64) NOT NULL default '', attribute varchar(64) NOT NULL default '', op char(2) NOT NULL DEFAULT '==', value varchar(253) NOT NULL default '', PRIMARY KEY (id), KEY groupname (groupname(32)) ) ENGINE=ndbcluster; # # Table structure for table 'radgroupreply' # CREATE TABLE radgroupreply ( id int(11) unsigned NOT NULL auto_increment, groupname varchar(64) NOT NULL default '', attribute varchar(64) NOT NULL default '', op char(2) NOT NULL DEFAULT '=', value varchar(253) NOT NULL default '', PRIMARY KEY (id), KEY groupname (groupname(32)) ) ENGINE=ndbcluster; # # Table structure for table 'radreply' # CREATE TABLE radreply ( id int(11) unsigned NOT NULL auto_increment, username varchar(64) NOT NULL default '', attribute varchar(64) NOT NULL default '', op char(2) NOT NULL DEFAULT '=', value varchar(253) NOT NULL default '', PRIMARY KEY (id), KEY username (username(32)) ) ENGINE=ndbcluster; # # Table structure for table 'radusergroup' # CREATE TABLE radusergroup ( username varchar(64) NOT NULL default '', groupname varchar(64) NOT NULL default '', priority int(11) NOT NULL default '1', KEY username (username(32)) ) ENGINE=ndbcluster; # # Table structure for table 'radpostauth' # CREATE TABLE radpostauth ( id int(11) NOT NULL auto_increment, username varchar(64) NOT NULL default '', pass varchar(64) NOT NULL default '', reply varchar(32) NOT NULL default '', authdate timestamp NOT NULL, PRIMARY KEY (id) ) ENGINE=ndbcluster; freeradius-server/raddb/sql/oracle/000077500000000000000000000000001257552170400176435ustar00rootroot00000000000000freeradius-server/raddb/sql/oracle/dialup.conf000066400000000000000000000324061257552170400217750ustar00rootroot00000000000000# -*- text -*- ## ## dialup.conf -- Oracle configuration for default schema (schema.sql) ## ## $Id$ ####################################################################### # Query config: Username ####################################################################### # This is the username that will get substituted, escaped, and added # as attribute 'SQL-User-Name'. '%{SQL-User-Name}' should be used below # everywhere a username substitution is needed so you you can be sure # the username passed from the client is escaped properly. # # Uncomment the next line, if you want the sql_user_name to mean: # # Use Stripped-User-Name, if it's there. # Else use User-Name, if it's there, # Else use hard-coded string "DEFAULT" as the user name. #sql_user_name = "%{Stripped-User-Name:-%{User-Name:-DEFAULT}}" # sql_user_name = "%{User-Name}" ####################################################################### # Default profile ####################################################################### # This is the default profile. It is found in SQL by group membership. # That means that this profile must be a member of at least one group # which will contain the corresponding check and reply items. # This profile will be queried in the authorize section for every user. # The point is to assign all users a default profile without having to # manually add each one to a group that will contain the profile. # The SQL module will also honor the User-Profile attribute. This # attribute can be set anywhere in the authorize section (ie the users # file). It is found exactly as the default profile is found. # If it is set then it will *overwrite* the default profile setting. # The idea is to select profiles based on checks on the incoming packets, # not on user group membership. For example: # -- users file -- # DEFAULT Service-Type == Outbound-User, User-Profile := "outbound" # DEFAULT Service-Type == Framed-User, User-Profile := "framed" # # By default the default_user_profile is not set # #default_user_profile = "DEFAULT" # # Determines if we will query the default_user_profile or the User-Profile # if the user is not found. If the profile is found then we consider the user # found. By default this is set to 'no'. # #query_on_not_found = no ####################################################################### # NAS Query ####################################################################### # This query retrieves the radius clients # # 0. Row ID (currently unused) # 1. Name (or IP address) # 2. Shortname # 3. Type # 4. Secret # 5. Virtual server ####################################################################### nas_query = "SELECT id, nasname, shortname, type, secret, server FROM ${nas_table}" ####################################################################### # Authorization Queries ####################################################################### # These queries compare the check items for the user # in ${authcheck_table} and setup the reply items in # ${authreply_table}. You can use any query/tables # you want, but the return data for each row MUST # be in the following order: # # 0. Row ID (currently unused) # 1. UserName/GroupName # 2. Item Attr Name # 3. Item Attr Value # 4. Item Attr Operation ####################################################################### # # WARNING: Oracle is case sensitive # # The main difference between MySQL and Oracle queries is the date format. # You must use the TO_DATE function to transform the radius date format to # the Oracle date format, and put NULL otherwise '0' in a void date field. # ####################################################################### authorize_check_query = "SELECT id,UserName,Attribute,Value,op FROM ${authcheck_table} WHERE Username = '%{SQL-User-Name}' ORDER BY id" authorize_reply_query = "SELECT id,UserName,Attribute,Value,op FROM ${authreply_table} WHERE Username = '%{SQL-User-Name}' ORDER BY id" authorize_group_check_query = "SELECT ${groupcheck_table}.id,${groupcheck_table}.GroupName,${groupcheck_table}.Attribute,${groupcheck_table}.Value,${groupcheck_table}.op FROM ${groupcheck_table},${usergroup_table} WHERE ${usergroup_table}.Username = '%{SQL-User-Name}' AND ${usergroup_table}.GroupName = ${groupcheck_table}.GroupName ORDER BY ${groupcheck_table}.id" authorize_group_reply_query = "SELECT ${groupreply_table}.id,${groupreply_table}.GroupName,${groupreply_table}.Attribute,${groupreply_table}.Value,${groupreply_table}.op FROM ${groupreply_table},${usergroup_table} WHERE ${usergroup_table}.Username = '%{SQL-User-Name}' AND ${usergroup_table}.GroupName = ${groupreply_table}.GroupName ORDER BY ${groupreply_table}.id" ####################################################################### # Accounting Queries ####################################################################### # accounting_onoff_query - query for Accounting On/Off packets # accounting_update_query - query for Accounting update packets # accounting_update_query_alt - query for Accounting update packets # (alternate in case first query fails) # accounting_start_query - query for Accounting start packets # accounting_start_query_alt - query for Accounting start packets # (alternate in case first query fails) # accounting_stop_query - query for Accounting stop packets # accounting_stop_query_alt - query for Accounting start packets # (alternate in case first query doesn't # affect any existing rows in the table) ####################################################################### accounting_onoff_query = "UPDATE ${acct_table1} SET AcctStopTime=TO_DATE('%S','yyyy-mm-dd hh24:mi:ss'), AcctSessionTime=round((TO_DATE('%S','yyyy-mm-dd hh24:mi:ss')-TO_DATE(TO_CHAR(acctstarttime, 'yyyy-mm-dd hh24:mi:ss'),'yyyy-mm-dd hh24:mi:ss'))*86400), AcctTerminateCause='%{Acct-Terminate-Cause}', AcctStopDelay = %{Acct-Delay-Time:-0} WHERE AcctStopTime IS NULL AND NASIPAddress = '%{NAS-IP-Address}' AND AcctStartTime <= TO_DATE('%S','yyyy-mm-dd hh24:mi:ss')" accounting_update_query = "UPDATE ${acct_table1} \ SET FramedIPAddress = NULLIF('%{Framed-IP-Address}', ''), \ AcctSessionTime = '%{Acct-Session-Time}', \ AcctInputOctets = '%{Acct-Input-Octets}' + ('%{%{Acct-Input-Gigawords}:-0}' * 4294967296), \ AcctOutputOctets = '%{Acct-Output-Octets}' + ('%{%{Acct-Output-Gigawords}:-0}' * 4294967296) \ WHERE \ AcctSessionId = '%{Acct-Session-Id}' AND \ UserName = '%{SQL-User-Name}' AND \ NASIPAddress= '%{NAS-IP-Address}' AND \ AcctStopTime IS NULL" accounting_update_query_alt = "INSERT into ${acct_table1} (RadAcctId, AcctSessionId, AcctUniqueId, UserName, Realm, NASIPAddress, NASPortId, NASPortType, AcctStartTime, AcctSessionTime, AcctAuthentic, ConnectInfo_start, AcctInputOctets, AcctOutputOctets, CalledStationId, CallingStationId, ServiceType, FramedProtocol, FramedIPAddress, AcctStartDelay, XAscendSessionSvrKey) \ VALUES('', '%{Acct-Session-Id}', '%{Acct-Unique-Session-Id}', \ '%{SQL-User-Name}', '%{Realm}', '%{NAS-IP-Address}', '%{NAS-Port-Id}', \ '%{NAS-Port-Type}', NULL, '%{Acct-Session-Time}', '%{Acct-Authentic}', '', \ '%{Acct-Input-Octets}' + ('%{%{Acct-Input-Gigawords}:-0}' * 4294967296), \ '%{Acct-Output-Octets}' + ('%{%{Acct-Output-Gigawords}:-0}' * 4294967296), \ '%{Called-Station-Id}', '%{Calling-Station-Id}', '%{Service-Type}', \ '%{Framed-Protocol}', '%{Framed-IP-Address}', '0', '%{X-Ascend-Session-Svr-Key}')" accounting_start_query = "INSERT into ${acct_table1} (RadAcctId, AcctSessionId, AcctUniqueId, UserName, Realm, NASIPAddress, NASPortId, NASPortType, AcctStartTime, AcctStopTime, AcctSessionTime, AcctAuthentic, ConnectInfo_start, ConnectInfo_stop, AcctInputOctets, AcctOutputOctets, CalledStationId, CallingStationId, AcctTerminateCause, ServiceType, FramedProtocol, FramedIPAddress, AcctStartDelay, AcctStopDelay, XAscendSessionSvrKey) \ VALUES('', '%{Acct-Session-Id}', '%{Acct-Unique-Session-Id}', '%{SQL-User-Name}', '%{Realm}', '%{NAS-IP-Address}', '%{NAS-Port-Id}', '%{NAS-Port-Type}', TO_DATE('%S','yyyy-mm-dd hh24:mi:ss'), NULL, '0', '%{Acct-Authentic}', '%{Connect-Info}', '', '0', '0', '%{Called-Station-Id}', '%{Calling-Station-Id}', '', '%{Service-Type}', '%{Framed-Protocol}', '%{Framed-IP-Address}', '%{Acct-Delay-Time}', '0', '%{X-Ascend-Session-Svr-Key}')" accounting_start_query_alt = "UPDATE ${acct_table1} SET AcctStartTime = TO_DATE('%S','yyyy-mm-dd hh24:mi:ss'), AcctStartDelay = '%{Acct-Delay-Time:-0}', ConnectInfo_start = '%{Connect-Info}' WHERE AcctSessionId = '%{Acct-Session-Id}' AND UserName = '%{SQL-User-Name}' AND NASIPAddress = '%{NAS-IP-Address}' AND AcctStopTime IS NULL" accounting_stop_query = "UPDATE ${acct_table2} \ SET AcctStopTime = TO_DATE('%S','yyyy-mm-dd hh24:mi:ss'), \ AcctSessionTime = '%{Acct-Session-Time}', \ AcctInputOctets = '%{Acct-Input-Octets}' + ('%{%{Acct-Input-Gigawords}:-0}' * 4294967296), \ AcctOutputOctets = '%{Acct-Output-Octets}' + ('%{%{Acct-Output-Gigawords}:-0}' * 4294967296), \ AcctTerminateCause = '%{Acct-Terminate-Cause}', AcctStopDelay = '%{Acct-Delay-Time:-0}', ConnectInfo_stop = '%{Connect-Info}' WHERE AcctSessionId = '%{Acct-Session-Id}' AND UserName = '%{SQL-User-Name}' AND NASIPAddress = '%{NAS-IP-Address}' AND AcctStopTime IS NULL" # Optional Query - pnixon #accounting_stop_query =3D "UPDATE ${acct_table2} SET AcctStopTime = TO_DATE('%S','yyyy-mm-dd hh24:mi:ss'), AcctSessionTime = (substr((sysdate-acctstarttime),instr((sysdate-acctstarttime),' ')+7,2) + substr((sysdate-acctstarttime),instr((sysdate-acctstarttime),' ')+4,2)*60 + substr((sysdate-acctstarttime),instr((sysdate-acctstarttime),' ')+1,2)*3600 + trunc(to_number(substr((sysdate-acctstarttime),1,instr(sysdate-acctstarttime,' '))))*86400), AcctInputOctets = '%{Acct-Input-Octets}', AcctOutputOctets = '%{Acct-Output-Octets}', AcctTerminateCause = '%{Acct-Terminate-Cause}', AcctStopDelay = '%{Acct-Delay-Time}', ConnectInfo_stop = '%{Connect-Info}' WHERE AcctSessionId =3D '%{Acct-Session-Id}' AND UserName = '%{SQL-User-Name}' AND NASIPAddress = '%{NAS-IP-Address}' AND AcctStopTime IS NULL" accounting_stop_query_alt = "INSERT into ${acct_table2} (RadAcctId, AcctSessionId, AcctUniqueId, UserName, Realm, NASIPAddress, NASPortId, NASPortType, AcctStartTime, AcctStopTime, AcctSessionTime, AcctAuthentic, ConnectInfo_start, ConnectInfo_stop, AcctInputOctets, AcctOutputOctets, CalledStationId, CallingStationId, AcctTerminateCause, ServiceType, FramedProtocol, FramedIPAddress, AcctStartDelay, AcctStopDelay) \ VALUES('', '%{Acct-Session-Id}', '%{Acct-Unique-Session-Id}', '%{SQL-User-Name}', '%{Realm}', \ '%{NAS-IP-Address}', '%{NAS-Port-Id}', '%{NAS-Port-Type}', NULL, TO_DATE('%S','yyyy-mm-dd hh24:mi:ss'), \ '%{Acct-Session-Time}', '%{Acct-Authentic}', '', '%{Connect-Info}', \ '%{Acct-Input-Octets}' + ('%{%{Acct-Input-Gigawords}:-0}' * 4294967296), \ '%{Acct-Output-Octets}' + ('%{%{Acct-Output-Gigawords}:-0}' * 4294967296), \ '%{Called-Station-Id}', '%{Calling-Station-Id}', '%{Acct-Terminate-Cause}', '%{Service-Type}', \ '%{Framed-Protocol}', '%{Framed-IP-Address}', '0', '%{Acct-Delay-Time:-0}')" ####################################################################### # Simultaneous Use Checking Queries ####################################################################### # simul_count_query - query for the number of current connections # - If this is not defined, no simultaneouls use checking # - will be performed by this module instance # simul_verify_query - query to return details of current connections for verification # - Leave blank or commented out to disable verification step # - Note that the returned field order should not be changed. ####################################################################### # Uncomment simul_count_query to enable simultaneous use checking # simul_count_query = "SELECT COUNT(*) FROM ${acct_table1} WHERE UserName='%{SQL-User-Name}' AND AcctStopTime IS NULL" simul_verify_query = "SELECT RadAcctId, AcctSessionId, UserName, NASIPAddress, NASPortId, FramedIPAddress, CallingStationId, FramedProtocol FROM ${acct_table1} WHERE UserName='%{SQL-User-Name}' AND AcctStopTime IS NULL" ####################################################################### # Group Membership Queries ####################################################################### # group_membership_query - Check user group membership ####################################################################### group_membership_query = "SELECT GroupName FROM ${usergroup_table} WHERE UserName='%{SQL-User-Name}'" # Authentication Logging Queries ####################################################################### # postauth_query - Insert some info after authentication ####################################################################### postauth_query = "INSERT INTO ${postauth_table} \ (username, pass, reply, authdate) \ VALUES ( \ '%{User-Name}', \ '%{%{User-Password}:-%{Chap-Password}}', \ '%{reply:Packet-Type}', TO_TIMESTAMP('%S','YYYY-MM-DDHH24:MI:SS'))" freeradius-server/raddb/sql/oracle/ippool.conf000066400000000000000000000107701257552170400220210ustar00rootroot00000000000000# -*- text -*- ## ## ippool.conf -- Oracle queries for rlm_sqlippool ## ## $Id$ allocate-begin = "commit" start-begin = "commit" alive-begin = "commit" stop-begin = "commit" on-begin = "commit" off-begin = "commit" ## This query allocates an IP address from the Pool ## The ORDER BY clause of this query tries to allocate the same IP-address ## to the user that they had last session... allocate-find = "SELECT framedipaddress FROM ${ippool_table} \ WHERE pool_name = '%{control:Pool-Name}' AND expiry_time < current_timestamp \ AND rownum <= 1 \ ORDER BY (username <> '%{SQL-User-Name}'), \ (callingstationid <> '%{Calling-Station-Id}'), expiry_time \ FOR UPDATE" ## This function is available if you want to use multiple pools # allocate-find = "select msqlippool('%{SQL-User-Name}','%{control:Pool-Name}') from dual" ## If you prefer to allocate a random IP address every time, use this query instead #allocate-find = "SELECT framedipaddress FROM ${ippool_table} \ # WHERE pool_name = '%{control:Pool-Name}' AND expiry_time < current_timestamp \ # AND rownum <= 1 \ # ORDER BY RANDOM() \ # FOR UPDATE" ## If an IP could not be allocated, check to see whether the pool exists or not ## This allows the module to differentiate between a full pool and no pool ## Note: If you are not running redundant pool modules this query may be commented ## out to save running this query every time an ip is not allocated. pool-check = "SELECT id FROM (SELECT id FROM ${ippool_table} \ WHERE pool_name='%{control:Pool-Name}') WHERE ROWNUM = 1" ## This query marks the IP address handed out by "allocate-find" as used ## for the period of "lease-duration" after which time it may be reused. allocate-update = "UPDATE ${ippool_table} \ SET nasipaddress = '%{NAS-IP-Address}', pool_key = '${pool-key}', \ callingstationid = '%{Calling-Station-Id}', username = '%{SQL-User-Name}', \ expiry_time = current_timestamp + INTERVAL '${lease-duration}' second(1) \ WHERE framedipaddress = '%I'" ## This query frees the IP address assigned to "pool-key" when a new request ## comes in for the same "pool-key". This means that either you are losing ## accounting Stop records or you use Calling-Station-Id instead of NAS-Port ## as your "pool-key" and your users are able to reconnect before your NAS ## has timed out their previous session. (Generally on wireless networks) ## (Note: If your pool-key is set to Calling-Station-Id and not NAS-Port ## then you may wish to delete the "AND nasipaddress = '%{Nas-IP-Address}' ## from the WHERE clause) allocate-clear = "UPDATE ${ippool_table} \ SET nasipaddress = '', pool_key = 0, callingstationid = '', \ expiry_time = current_timestamp - INTERVAL '1' second(1) \ WHERE pool_key = '${pool-key}'" ## This query extends an IP address lease by "lease-duration" when an accounting ## START record arrives start-update = "UPDATE ${ippool_table} \ SET expiry_time = current_timestamp + INTERVAL '${lease-duration}' second(1) \ WHERE nasipaddress = '%{NAS-IP-Address}' \ AND pool_key = '${pool-key}'" ## This query frees an IP address when an accounting ## STOP record arrives stop-clear = "UPDATE ${ippool_table} \ SET nasipaddress = '', pool_key = 0, callingstationid = '', \ expiry_time = current_timestamp - INTERVAL '1' second(1) \ WHERE nasipaddress = '%{Nas-IP-Address}' \ AND pool_key = '${pool-key}' \ AND username = '%{SQL-User-Name}' \ AND callingstationid = '%{Calling-Station-Id}'" ## This query extends an IP address lease by "lease-duration" when an accounting ## ALIVE record arrives alive-update = "UPDATE ${ippool_table} \ SET expiry_time = current_timestamp + INTERVAL '${lease-duration}' second(1) \ WHERE nasipaddress = '%{Nas-IP-Address}' \ AND pool_key = '${pool-key}' \ AND framedipaddress = '%{Framed-IP-Address}' \ AND username = '%{SQL-User-Name}' \ AND callingstationid = '%{Calling-Station-Id}'" ## This query frees all IP addresses allocated to a NAS when an ## accounting ON record arrives from that NAS on-clear = "UPDATE ${ippool_table} \ SET nasipaddress = '', pool_key = 0, callingstationid = '', \ expiry_time = current_timestamp - INTERVAL '1' second(1) \ WHERE nasipaddress = '%{Nas-IP-Address}'" ## This query frees all IP addresses allocated to a NAS when an ## accounting OFF record arrives from that NAS off-clear = "UPDATE ${ippool_table} \ SET nasipaddress = '', pool_key = 0, callingstationid = '', \ expiry_time = current_timestamp - INTERVAL '1' second(1) \ WHERE nasipaddress = '%{Nas-IP-Address}'" freeradius-server/raddb/sql/oracle/ippool.sql000066400000000000000000000022341257552170400216670ustar00rootroot00000000000000CREATE TABLE radippool ( id INT PRIMARY KEY, pool_name VARCHAR(30) NOT NULL, framedipaddress VARCHAR(30) NOT NULL, nasipaddress VARCHAR(30) NOT NULL, pool_key INT NOT NULL, CalledStationId VARCHAR(64), CallingStationId VARCHAR(64) NOT NULL, expiry_time timestamp(0) NOT NULL, username VARCHAR(100) ); CREATE INDEX radippool_poolname_ipaadr ON radippool (pool_name, framedipaddress); CREATE INDEX radippool_poolname_expire ON radippool (pool_name, expiry_time); CREATE INDEX radippool_nasipaddr_key ON radippool (nasipaddress, pool_key); CREATE INDEX radippool_nasipaddr_calling ON radippool (nasipaddress, callingstationid); CREATE SEQUENCE radippool_seq START WITH 1 INCREMENT BY 1; CREATE OR REPLACE TRIGGER radippool_serialnumber BEFORE INSERT OR UPDATE OF id ON radippool FOR EACH ROW BEGIN if ( :new.id = 0 or :new.id is null ) then SELECT radippool_seq.nextval into :new.id from dual; end if; END; / freeradius-server/raddb/sql/oracle/msqlippool.txt000066400000000000000000000025521257552170400226070ustar00rootroot00000000000000CREATE OR REPLACE FUNCTION msqlippool(user varchar2, pool varchar2) RETURN varchar2 IS PRAGMA AUTONOMOUS_TRANSACTION; ip_temp varchar2(20); BEGIN -- If the user's pool is dynamic, get an ipaddress (oldest one) from the corresponding pool if pool = 'Dynamic' then select framedipaddress into ip_temp from (select framedipaddress from radippool where expiry_time < current_timestamp and pool_name = pool ORDER BY expiry_time) where rownum = 1; return (ip_temp); -- Else, then get the static ipaddress for that user from the corresponding pool else select framedipaddress into ip_temp from radippool where username = user and pool_name = pool; return (ip_temp); end if; exception -- This block is executed if there's no free ipaddresses or no static ip assigned to the user when NO_DATA_FOUND then if pool = 'Dynamic' then return(''); -- so sqlippool can log it on radius.log end if; -- Else, grabs a free IP from the static pool and saves it in radippool so the user will always get the same IP the next time select framedipaddress into ip_temp from (select framedipaddress from radippool where expiry_time < current_timestamp and username is null and pool_name = pool) where rownum = 1; UPDATE radippool SET username = user where framedipaddress = ip_temp; commit; return (ip_temp); when others then return('Oracle Exception'); END; / freeradius-server/raddb/sql/oracle/nas.sql000066400000000000000000000004751257552170400211530ustar00rootroot00000000000000/* * Table structure for table 'nas' */ CREATE TABLE nas ( id INT PRIMARY KEY, nasname VARCHAR(128), shortname VARCHAR(32), type VARCHAR(30), ports INT, secret VARCHAR(60), server VARCHAR(64), community VARCHAR(50), description VARCHAR(200) ); CREATE SEQUENCE nas_seq START WITH 1 INCREMENT BY 1; freeradius-server/raddb/sql/oracle/schema.sql000066400000000000000000000125241257552170400216300ustar00rootroot00000000000000/* * $Id$ * * Oracle schema for FreeRADIUS * * * NOTE: Which columns are NULLable?? */ /* * Table structure for table 'radacct' */ CREATE TABLE radacct ( radacctid INT PRIMARY KEY, acctsessionid VARCHAR(96) NOT NULL, acctuniqueid VARCHAR(32), username VARCHAR(64) NOT NULL, groupname VARCHAR(32), realm VARCHAR(30), nasipaddress VARCHAR(15) NOT NULL, nasportid VARCHAR(32), nasporttype VARCHAR(32), acctstarttime TIMESTAMP WITH TIME ZONE, acctstoptime TIMESTAMP WITH TIME ZONE, acctsessiontime NUMERIC(19), acctauthentic VARCHAR(32), connectinfo_start VARCHAR(50), connectinfo_stop VARCHAR(50), acctinputoctets NUMERIC(19), acctoutputoctets NUMERIC(19), calledstationid VARCHAR(50), callingstationid VARCHAR(50), acctterminatecause VARCHAR(32), servicetype VARCHAR(32), framedprotocol VARCHAR(32), framedipaddress VARCHAR(15), acctstartdelay NUMERIC(12), acctstopdelay NUMERIC(12), XAscendSessionSvrKey VARCHAR(10) ); CREATE UNIUQE INDEX radacct_idx0 ON radacct(acctuniqueid); CREATE UNIQUE INDEX radacct_idx1 ON radacct(acctsessionid,username,acctstarttime, acctstoptime,nasipaddress,framedipaddress); CREATE SEQUENCE radacct_seq START WITH 1 INCREMENT BY 1; /* Trigger to emulate a serial # on the primary key */ CREATE OR REPLACE TRIGGER radacct_serialnumber BEFORE INSERT OR UPDATE OF radacctid ON radacct FOR EACH ROW BEGIN if ( :new.radacctid = 0 or :new.radacctid is null ) then SELECT radacct_seq.nextval into :new.radacctid from dual; end if; END; / /* * Table structure for table 'radcheck' */ CREATE TABLE radcheck ( id INT PRIMARY KEY, username VARCHAR(30) NOT NULL, attribute VARCHAR(64), op VARCHAR(2) NOT NULL, value VARCHAR(40) ); CREATE SEQUENCE radcheck_seq START WITH 1 INCREMENT BY 1; /* Trigger to emulate a serial # on the primary key */ CREATE OR REPLACE TRIGGER radcheck_serialnumber BEFORE INSERT OR UPDATE OF id ON radcheck FOR EACH ROW BEGIN if ( :new.id = 0 or :new.id is null ) then SELECT radcheck_seq.nextval into :new.id from dual; end if; END; / /* * Table structure for table 'radgroupcheck' */ CREATE TABLE radgroupcheck ( id INT PRIMARY KEY, groupname VARCHAR(20) UNIQUE NOT NULL, attribute VARCHAR(64), op CHAR(2) NOT NULL, value VARCHAR(40) ); CREATE SEQUENCE radgroupcheck_seq START WITH 1 INCREMENT BY 1; /* * Table structure for table 'radgroupreply' */ CREATE TABLE radgroupreply ( id INT PRIMARY KEY, GroupName VARCHAR(20) UNIQUE NOT NULL, Attribute VARCHAR(64), op CHAR(2) NOT NULL, Value VARCHAR(40) ); CREATE SEQUENCE radgroupreply_seq START WITH 1 INCREMENT BY 1; /* * Table structure for table 'radreply' */ CREATE TABLE radreply ( id INT PRIMARY KEY, UserName VARCHAR(30) NOT NULL, Attribute VARCHAR(64), op CHAR(2) NOT NULL, Value VARCHAR(40) ); CREATE INDEX radreply_idx1 ON radreply(UserName); CREATE SEQUENCE radreply_seq START WITH 1 INCREMENT BY 1; /* Trigger to emulate a serial # on the primary key */ CREATE OR REPLACE TRIGGER radreply_serialnumber BEFORE INSERT OR UPDATE OF id ON radreply FOR EACH ROW BEGIN if ( :new.id = 0 or :new.id is null ) then SELECT radreply_seq.nextval into :new.id from dual; end if; END; / /* * Table structure for table 'radusergroup' */ CREATE TABLE radusergroup ( id INT PRIMARY KEY, UserName VARCHAR(30) UNIQUE NOT NULL, GroupName VARCHAR(30) ); CREATE SEQUENCE radusergroup_seq START WITH 1 INCREMENT BY 1; /* Trigger to emulate a serial # on the primary key */ CREATE OR REPLACE TRIGGER radusergroup_serialnumber BEFORE INSERT OR UPDATE OF id ON radusergroup FOR EACH ROW BEGIN if ( :new.id = 0 or :new.id is null ) then SELECT radusergroup_seq.nextval into :new.id from dual; end if; END; / /* * Table structure for table 'realmgroup' */ CREATE TABLE realmgroup ( id INT PRIMARY KEY, RealmName VARCHAR(30) UNIQUE NOT NULL, GroupName VARCHAR(30) ); CREATE SEQUENCE realmgroup_seq START WITH 1 INCREMENT BY 1; CREATE TABLE realms ( id INT PRIMARY KEY, realmname VARCHAR(64), nas VARCHAR(128), authport INT, options VARCHAR(128) ); CREATE SEQUENCE realms_seq START WITH 1 INCREMENT BY 1; CREATE TABLE radhuntgroup ( id INT PRIMARY KEY, GroupName VARCHAR(64) NOT NULL, Nasipaddress VARCHAR(15) UNIQUE NOT NULL, NASPortID VARCHAR(15) ); CREATE SEQUENCE radhuntgroup_seq START WITH 1 INCREMENT BY 1; CREATE OR REPLACE TRIGGER radhuntgroup_serialnumber BEFORE INSERT OR UPDATE OF id ON radhuntgroup FOR EACH ROW BEGIN if ( :new.id = 0 or :new.id is null ) then SELECT radhuntgroup_seq.nextval into :new.id from dual; end if; END; CREATE TABLE radpostauth ( id INT PRIMARY KEY, UserName VARCHAR(64) NOT NULL, Pass VARCHAR(64), Reply VARCHAR(64), AuthDate DATE ); CREATE SEQUENCE radpostauth_seq START WITH 1 INCREMENT BY 1; CREATE OR REPLACE TRIGGER radpostauth_TRIG BEFORE INSERT OR UPDATE OF id ON radpostauth FOR EACH ROW BEGIN if ( :new.id = 0 or :new.id is null ) then SELECT radpostauth_seq.nextval into :new.id from dual; end if; if (:new.AuthDate is null) then select sysdate into :new.AuthDate from dual; end if; END; / freeradius-server/raddb/sql/postgresql/000077500000000000000000000000001257552170400206015ustar00rootroot00000000000000freeradius-server/raddb/sql/postgresql/admin.sql000066400000000000000000000015521257552170400224150ustar00rootroot00000000000000/* * admin.sql -- PostgreSQL commands for creating the RADIUS user. * * WARNING: You should change 'localhost' and 'radpass' * to something else. Also update raddb/sql.conf * with the new RADIUS password. * * WARNING: This example file is untested. Use at your own risk. * Please send any bug fixes to the mailing list. * * $Id$ */ /* * Create default administrator for RADIUS */ CREATE USER radius WITH PASSWORD 'radpass'; /* * The server can read any table in SQL */ GRANT SELECT ON radcheck TO radius; GRANT SELECT ON radreply TO radius; GRANT SELECT ON radgroupcheck TO radius; GRANT SELECT ON radgroupreply TO radius; GRANT SELECT ON radusergroup TO radius; /* * The server can write to the accounting and post-auth logging table. */ GRANT SELECT, INSERT, UPDATE on radacct TO radius; GRANT SELECT, INSERT, UPDATE on radpostauth TO radius; freeradius-server/raddb/sql/postgresql/cisco_h323_db_schema.sql000066400000000000000000000430131257552170400251470ustar00rootroot00000000000000/* * $Id$ * * --- Peter Nixon [ codemonkey@peternixon.net ] * * This is a custom SQL schema for doing H323 and SIP VoIP accounting * with FreeRadius and Cisco equipment. It is currently known to work * with 3640, 5300 and 5350 series as well as CSPS (Cisco SIP Proxy * Server). It will scale A LOT better than the default radius schema * which is designed for simple dialup installations of FreeRadius. * * For this schema to work properly you MUST use * raddb/sql/postgresql/voip-postpaid.conf rather than * raddb/sql/postgresql/dialup.conf * * If you wish to do RADIUS Authentication using the same database, * you MUST use use raddb/sql/postgresql/schema.sql as well as this schema. */ /* * Table structure for 'Start' tables */ CREATE TABLE StartVoIP ( RadAcctId BIGSERIAL PRIMARY KEY, AcctTime TIMESTAMP with time zone NOT NULL, h323SetupTime TIMESTAMP with time zone, H323ConnectTime TIMESTAMP with time zone, UserName VARCHAR(64), RadiusServerName VARCHAR(32), NASIPAddress INET NOT NULL, CalledStationId VARCHAR(80), CallingStationId VARCHAR(80), AcctDelayTime INTEGER, H323GWID VARCHAR(32), h323CallOrigin VARCHAR(10), CallID VARCHAR(80) NOT NULL, processed BOOLEAN DEFAULT false ); create index startvoipcombo on startvoip (AcctTime, nasipaddress); CREATE TABLE StartTelephony ( RadAcctId BIGSERIAL PRIMARY KEY, AcctTime TIMESTAMP with time zone NOT NULL, h323SetupTime TIMESTAMP with time zone, H323ConnectTime TIMESTAMP with time zone, UserName VARCHAR(64), RadiusServerName VARCHAR(32), NASIPAddress INET NOT NULL, CalledStationId VARCHAR(80), CallingStationId VARCHAR(80), AcctDelayTime INTEGER, H323GWID VARCHAR(32), h323CallOrigin VARCHAR(10), CallID VARCHAR(80) NOT NULL, processed BOOLEAN DEFAULT false ); create index starttelephonycombo on starttelephony (AcctTime, nasipaddress); /* * Table structure for 'Stop' tables */ CREATE TABLE StopVoIP ( RadAcctId BIGSERIAL PRIMARY KEY, AcctTime TIMESTAMP with time zone NOT NULL, H323SetupTime TIMESTAMP with time zone, H323ConnectTime TIMESTAMP with time zone, H323DisconnectTime TIMESTAMP with time zone, UserName VARCHAR(32), RadiusServerName VARCHAR(32), NASIPAddress INET NOT NULL, AcctSessionTime BIGINT, AcctInputOctets BIGINT, AcctOutputOctets BIGINT, CalledStationId VARCHAR(80), CallingStationId VARCHAR(80), AcctDelayTime SMALLINT, CiscoNASPort VARCHAR(1), H323GWID VARCHAR(32), H323CallOrigin VARCHAR(10), H323DisconnectCause VARCHAR(20), H323RemoteAddress INET, H323VoiceQuality INTEGER, CallID VARCHAR(80) NOT NULL, processed BOOLEAN DEFAULT false ); create UNIQUE index stopvoipcombo on stopvoip (AcctTime, nasipaddress, CallID); CREATE TABLE StopTelephony ( RadAcctId BIGSERIAL PRIMARY KEY, AcctTime TIMESTAMP with time zone NOT NULL, H323SetupTime TIMESTAMP with time zone NOT NULL, H323ConnectTime TIMESTAMP with time zone NOT NULL, H323DisconnectTime TIMESTAMP with time zone NOT NULL, UserName VARCHAR(32) DEFAULT '' NOT NULL, RadiusServerName VARCHAR(32), NASIPAddress INET NOT NULL, AcctSessionTime BIGINT, AcctInputOctets BIGINT, AcctOutputOctets BIGINT, CalledStationId VARCHAR(80), CallingStationId VARCHAR(80), AcctDelayTime SMALLINT, CiscoNASPort VARCHAR(16), H323GWID VARCHAR(32), H323CallOrigin VARCHAR(10), H323DisconnectCause VARCHAR(20), H323RemoteAddress INET, H323VoiceQuality INTEGER, CallID VARCHAR(80) NOT NULL, processed BOOLEAN DEFAULT false ); -- You can have more than one record that is identical except for CiscoNASPort if you have a dial peer hungroup -- configured for multiple PRIs. create UNIQUE index stoptelephonycombo on stoptelephony (AcctTime, nasipaddress, CallID, CiscoNASPort); /* * Table structure for 'gateways' * * This table should list the IP addresses, names and locations of all your gateways * This can be used to make more useful reports. * * Note: This table should be removed in favour of using the "nas" table. */ CREATE TABLE gateways ( gw_ip INET NOT NULL, gw_name VARCHAR(32) NOT NULL, gw_city VARCHAR(32) ); /* * Table structure for 'customers' * * This table should list your Customers names and company * This can be used to make more useful reports. */ CREATE TABLE customers ( cust_id SERIAL NOT NULL, company VARCHAR(32), customer VARCHAR(32) ); /* * Table structure for 'cust_gw' * * This table should list the IP addresses and Customer IDs of all your Customers gateways * This can be used to make more useful reports. */ CREATE TABLE cust_gw ( cust_gw INET PRIMARY KEY, cust_id INTEGER NOT NULL, "location" VARCHAR(32) ); CREATE VIEW customerip AS SELECT gw.cust_gw AS ipaddr, cust.company, cust.customer, gw."location" FROM customers cust, cust_gw gw WHERE (cust.cust_id = gw.cust_id); -- create plpgsql language (You need to be a database superuser to be able to do this) CREATE FUNCTION "plpgsql_call_handler" () RETURNS LANGUAGE_HANDLER AS '$libdir/plpgsql' LANGUAGE C; CREATE TRUSTED LANGUAGE "plpgsql" HANDLER "plpgsql_call_handler"; /* * Function 'strip_dot' * removes "." from the start of cisco timestamps * * From the cisco website: * "A timestamp that is preceded by an asterisk (*) or a dot (.) may not be accurate. * An asterisk (*) means that after a gateway reboot, the gateway clock was not manually set * and the gateway has not synchronized with an NTP server yet. A dot (.) means the gateway * NTP has lost synchronization with an NTP server." * * We therefore do not bother to strip asterisks (*) from timestamps, as you NEED ntp setup * unless you don't care about billing at all! * * * Example useage: * insert into mytable values (strip_dot('.16:46:02.356 EET Wed Dec 11 2002')); * */ CREATE OR REPLACE FUNCTION strip_dot (VARCHAR) RETURNS TIMESTAMPTZ AS ' DECLARE original_timestamp ALIAS FOR $1; BEGIN IF original_timestamp = '''' THEN RETURN NULL; END IF; IF substring(original_timestamp from 1 for 1) = ''.'' THEN RETURN substring(original_timestamp from 2); ELSE RETURN original_timestamp; END IF; END; ' LANGUAGE 'plpgsql'; CREATE OR REPLACE FUNCTION pick_id (VARCHAR, VARCHAR) RETURNS VARCHAR AS ' DECLARE h323confid ALIAS FOR $1; callid ALIAS FOR $2; BEGIN IF h323confid <> '''' THEN RETURN h323confid; END IF; IF callid <> '''' THEN RETURN callid; END IF; RETURN NULL; END; ' LANGUAGE 'plpgsql'; /* * Table structure for 'isdn_error_codes' table * * Taken from cisco.com this data can be JOINED against h323DisconnectCause to * give human readable error reports. * */ CREATE TABLE isdn_error_codes ( error_code VARCHAR(2) PRIMARY KEY, desc_short VARCHAR(90), desc_long TEXT ); /* * Data for 'isdn_error_codes' table */ INSERT INTO isdn_error_codes VALUES ('1', 'Unallocated (unassigned) number', 'The ISDN number was sent to the switch in the correct format; however, the number is not assigned to any destination equipment.'); INSERT INTO isdn_error_codes VALUES ('10', 'Normal call clearing', 'Normal call clearing has occurred.'); INSERT INTO isdn_error_codes VALUES ('11', 'User busy', 'The called system acknowledges the connection request but is unable to accept the call because all B channels are in use.'); INSERT INTO isdn_error_codes VALUES ('12', 'No user responding', 'The connection cannot be completed because the destination does not respond to the call.'); INSERT INTO isdn_error_codes VALUES ('13', 'No answer from user (user alerted)', 'The destination responds to the connection request but fails to complete the connection within the prescribed time. The problem is at the remote end of the connection.'); INSERT INTO isdn_error_codes VALUES ('15', 'Call rejected', 'The destination is capable of accepting the call but rejected the call for an unknown reason.'); INSERT INTO isdn_error_codes VALUES ('16', 'Number changed', 'The ISDN number used to set up the call is not assigned to any system.'); INSERT INTO isdn_error_codes VALUES ('1A', 'Non-selected user clearing', 'The destination is capable of accepting the call but rejected the call because it was not assigned to the user.'); INSERT INTO isdn_error_codes VALUES ('1B', 'Designation out of order', 'The destination cannot be reached because the interface is not functioning correctly, and a signaling message cannot be delivered. This might be a temporary condition, but it could last for an extended period of time. For example, the remote equipment might be turned off.'); INSERT INTO isdn_error_codes VALUES ('1C', 'Invalid number format', 'The connection could be established because the destination address was presented in an unrecognizable format or because the destination address was incomplete.'); INSERT INTO isdn_error_codes VALUES ('1D', 'Facility rejected', 'The facility requested by the user cannot be provided by the network.'); INSERT INTO isdn_error_codes VALUES ('1E', 'Response to STATUS ENQUIRY', 'The status message was generated in direct response to the prior receipt of a status enquiry message.'); INSERT INTO isdn_error_codes VALUES ('1F', 'Normal, unspecified', 'Reports the occurrence of a normal event when no standard cause applies. No action required.'); INSERT INTO isdn_error_codes VALUES ('2', 'No route to specified transit network', 'The ISDN exchange is asked to route the call through an unrecognized intermediate network.'); INSERT INTO isdn_error_codes VALUES ('22', 'No circuit/channel available', 'The connection cannot be established because no appropriate channel is available to take the call.'); INSERT INTO isdn_error_codes VALUES ('26', 'Network out of order', 'The destination cannot be reached because the network is not functioning correctly, and the condition might last for an extended period of time. An immediate reconnect attempt will probably be unsuccessful.'); INSERT INTO isdn_error_codes VALUES ('29', 'Temporary failure', 'An error occurred because the network is not functioning correctly. The problem will be resolved shortly.'); INSERT INTO isdn_error_codes VALUES ('2A', 'Switching equipment congestion', 'The destination cannot be reached because the network switching equipment is temporarily overloaded.'); INSERT INTO isdn_error_codes VALUES ('2B', 'Access information discarded', 'The network cannot provide the requested access information.'); INSERT INTO isdn_error_codes VALUES ('2C', 'Requested circuit/channel not available', 'The remote equipment cannot provide the requested channel for an unknown reason. This might be a temporary problem.'); INSERT INTO isdn_error_codes VALUES ('2F', 'Resources unavailable, unspecified', 'The requested channel or service is unavailable for an unknown reason. This might be a temporary problem.'); INSERT INTO isdn_error_codes VALUES ('3', 'No route to destination', 'The call was routed through an intermediate network that does not serve the destination address.'); INSERT INTO isdn_error_codes VALUES ('31', 'Quality of service unavailable', 'The requested quality of service cannot be provided by the network. This might be a subscription problem.'); INSERT INTO isdn_error_codes VALUES ('32', 'Requested facility not subscribed', 'The remote equipment supports the requested supplementary service by subscription only.'); INSERT INTO isdn_error_codes VALUES ('39', 'Bearer capability not authorized', 'The user requested a bearer capability that the network provides, but the user is not authorized to use it. This might be a subscription problem.'); INSERT INTO isdn_error_codes VALUES ('3A', 'Bearer capability not presently available', 'The network normally provides the requested bearer capability, but it is unavailable at the present time. This might be due to a temporary network problem or to a subscription problem.'); INSERT INTO isdn_error_codes VALUES ('3F', 'Service or option not available, unspecified', 'The network or remote equipment was unable to provide the requested service option for an unspecified reason. This might be a subscription problem.'); INSERT INTO isdn_error_codes VALUES ('41', 'Bearer capability not implemented', 'The network cannot provide the bearer capability requested by the user.'); INSERT INTO isdn_error_codes VALUES ('42', 'Channel type not implemented', 'The network or the destination equipment does not support the requested channel type.'); INSERT INTO isdn_error_codes VALUES ('45', 'Requested facility not implemented', 'The remote equipment does not support the requested supplementary service.'); INSERT INTO isdn_error_codes VALUES ('46', 'Only restricted digital information bearer capability is available', 'The network is unable to provide unrestricted digital information bearer capability.'); INSERT INTO isdn_error_codes VALUES ('4F', 'Service or option not implemented, unspecified', 'The network or remote equipment is unable to provide the requested service option for an unspecified reason. This might be a subscription problem.'); INSERT INTO isdn_error_codes VALUES ('51', 'Invalid call reference value', 'The remote equipment received a call with a call reference that is not currently in use on the user-network interface.'); INSERT INTO isdn_error_codes VALUES ('52', 'Identified channel does not exist', 'The receiving equipment is requested to use a channel that is not activated on the interface for calls.'); INSERT INTO isdn_error_codes VALUES ('53', 'A suspended call exists, but this call identity does not', 'The network received a call resume request. The call resume request contained a Call Identify information element that indicates that the call identity is being used for a suspended call.'); INSERT INTO isdn_error_codes VALUES ('54', 'Call identity in use', 'The network received a call resume request. The call resume request contained a Call Identify information element that indicates that it is in use for a suspended call.'); INSERT INTO isdn_error_codes VALUES ('55', 'No call suspended', 'The network received a call resume request when there was not a suspended call pending. This might be a transient error that will be resolved by successive call retries.'); INSERT INTO isdn_error_codes VALUES ('56', 'Call having the requested call identity has been cleared', 'The network received a call resume request. The call resume request contained a Call Identity information element, which once indicated a suspended call. However, the suspended call was cleared either by timeout or by the remote user.'); INSERT INTO isdn_error_codes VALUES ('58', 'Incompatible destination', 'Indicates that an attempt was made to connect to non-ISDN equipment. For example, to an analog line.'); INSERT INTO isdn_error_codes VALUES ('5B', 'Invalid transit network selection', 'The ISDN exchange was asked to route the call through an unrecognized intermediate network.'); INSERT INTO isdn_error_codes VALUES ('5F', 'Invalid message, unspecified', 'An invalid message was received, and no standard cause applies. This is usually due to a D-channel error. If this error occurs systematically, report it to your ISDN service provider.'); INSERT INTO isdn_error_codes VALUES ('6', 'Channel unacceptable', 'The service quality of the specified channel is insufficient to accept the connection.'); INSERT INTO isdn_error_codes VALUES ('60', 'Mandatory information element is missing', 'The receiving equipment received a message that did not include one of the mandatory information elements. This is usually due to a D-channel error. If this error occurs systematically, report it to your ISDN service provider.'); INSERT INTO isdn_error_codes VALUES ('61', 'Message type non-existent or not implemented', 'The receiving equipment received an unrecognized message, either because the message type was invalid or because the message type was valid but not supported. The cause is due to either a problem with the remote configuration or a problem with the local D channel.'); INSERT INTO isdn_error_codes VALUES ('62', 'Message not compatible with call state or message type non-existent or not implemented', 'The remote equipment received an invalid message, and no standard cause applies. This cause is due to a D-channel error. If this error occurs systematically, report it to your ISDN service provider.'); INSERT INTO isdn_error_codes VALUES ('63', 'Information element non-existent or not implemented', 'The remote equipment received a message that includes information elements, which were not recognized. This is usually due to a D-channel error. If this error occurs systematically, report it to your ISDN service provider.'); INSERT INTO isdn_error_codes VALUES ('64', 'Invalid information element contents', 'The remote equipment received a message that includes invalid information in the information element. This is usually due to a D-channel error.'); INSERT INTO isdn_error_codes VALUES ('65', 'Message not compatible with call state', 'The remote equipment received an unexpected message that does not correspond to the current state of the connection. This is usually due to a D-channel error.'); INSERT INTO isdn_error_codes VALUES ('66', 'Recovery on timer expires', 'An error-handling (recovery) procedure was initiated by a timer expiry. This is usually a temporary problem.'); INSERT INTO isdn_error_codes VALUES ('6F', 'Protocol error, unspecified', 'An unspecified D-channel error when no other standard cause applies.'); INSERT INTO isdn_error_codes VALUES ('7', 'Call awarded and being delivered in an established channel', 'The user is assigned an incoming call that is being connected to an already-established call channel.'); INSERT INTO isdn_error_codes VALUES ('7F', 'Internetworking, unspecified', 'An event occurred, but the network does not provide causes for the action that it takes. The precise problem is unknown.'); freeradius-server/raddb/sql/postgresql/counter.conf000066400000000000000000000106051257552170400231310ustar00rootroot00000000000000# -*- text -*- ## ## counter.conf -- PostgreSQL queries for rlm_sqlcounter ## ## $Id$ # Rather than maintaining seperate (GDBM) databases of # accounting info for each counter, this module uses the data # stored in the raddacct table by the sql modules. This # module NEVER does any database INSERTs or UPDATEs. It is # totally dependent on the SQL module to process Accounting # packets. # # The 'sqlmod_inst' parameter holds the instance of the sql # module to use when querying the SQL database. Normally it # is just "sql". If you define more and one SQL module # instance (usually for failover situations), you can # specify which module has access to the Accounting Data # (radacct table). # # The 'reset' parameter defines when the counters are all # reset to zero. It can be hourly, daily, weekly, monthly or # never. It can also be user defined. It should be of the # form: # num[hdwm] where: # h: hours, d: days, w: weeks, m: months # If the letter is ommited days will be assumed. In example: # reset = 10h (reset every 10 hours) # reset = 12 (reset every 12 days) # # The 'key' parameter specifies the unique identifier for the # counter records (usually 'User-Name'). # # The 'query' parameter specifies the SQL query used to get # the current Counter value from the database. There are 3 # parameters that can be used in the query: # %k 'key' parameter # %b unix time value of beginning of reset period # %e unix time value of end of reset period # # The 'check-name' parameter is the name of the 'check' # attribute to use to access the counter in the 'users' file # or SQL radcheck or radcheckgroup tables. # # DEFAULT Max-Daily-Session > 3600, Auth-Type = Reject # Reply-Message = "You've used up more than one hour today" # sqlcounter dailycounter { counter-name = Daily-Session-Time check-name = Max-Daily-Session reply-name = Session-Timeout sqlmod-inst = sql key = User-Name reset = daily # This query properly handles calls that span from the # previous reset period into the current period but # involves more work for the SQL server than those # below query = "SELECT SUM(AcctSessionTime - \ GREATER((%b - AcctStartTime::ABSTIME::INT4), 0)) \ FROM radacct WHERE UserName='%{%k}' AND \ AcctStartTime::ABSTIME::INT4 + AcctSessionTime > '%b'" # This query ignores calls that started in a previous # reset period and continue into into this one. But it # is a little easier on the SQL server # query = "SELECT SUM(AcctSessionTime) FROM radacct WHERE \ # UserName='%{%k}' AND AND AcctStartTime::ABSTIME::INT4 > '%b'" # This query is the same as above, but demonstrates an # additional counter parameter '%e' which is the # timestamp for the end of the period # query = "SELECT SUM(AcctSessionTime) FROM radacct \ # WHERE UserName='%{%k}' AND AcctStartTime::ABSTIME::INT4 \ # BETWEEN '%b' AND '%e'" } sqlcounter monthlycounter { counter-name = Monthly-Session-Time check-name = Max-Monthly-Session reply-name = Session-Timeout sqlmod-inst = sql key = User-Name reset = monthly # This query properly handles calls that span from the # previous reset period into the current period but # involves more work for the SQL server than those # below query = "SELECT SUM(AcctSessionTime - \ GREATER((%b - AcctStartTime::ABSTIME::INT4), 0)) \ FROM radacct WHERE UserName='%{%k}' AND \ AcctStartTime::ABSTIME::INT4 + AcctSessionTime > '%b'" # This query ignores calls that started in a previous # reset period and continue into into this one. But it # is a little easier on the SQL server # query = "SELECT SUM(AcctSessionTime) FROM radacct WHERE \ # UserName='%{%k}' AND AND AcctStartTime::ABSTIME::INT4 > '%b'" # This query is the same as above, but demonstrates an # additional counter parameter '%e' which is the # timestamp for the end of the period # query = "SELECT SUM(AcctSessionTime) FROM radacct \ # WHERE UserName='%{%k}' AND AcctStartTime::ABSTIME::INT4 \ # BETWEEN '%b' AND '%e'" } sqlcounter noresetcounter { counter-name = Max-All-Session-Time check-name = Max-All-Session sqlmod-inst = sql key = User-Name reset = never query = "SELECT SUM(AcctSessionTime) FROM radacct WHERE UserName='%{%k}'" } freeradius-server/raddb/sql/postgresql/dialup.conf000066400000000000000000000333161257552170400227340ustar00rootroot00000000000000# -*- text -*- ## ## dialup.conf -- PostgreSQL configuration for default schema (schema.sql) ## ## $Id$ # Safe characters list for sql queries. Everything else is replaced # with their mime-encoded equivalents. # The default list should be ok # safe-characters = "@abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.-_: /" ####################################################################### # Query config: Username ####################################################################### # This is the username that will get substituted, escaped, and added # as attribute 'SQL-User-Name'. '%{SQL-User-Name}' should be used # below everywhere a username substitution is needed so you you can # be sure the username passed from the client is escaped properly. # # Uncomment the next line, if you want the sql_user_name to mean: # # Use Stripped-User-Name, if it's there. # Else use User-Name, if it's there, # Else use hard-coded string "none" as the user name. # #sql_user_name = "%{%{Stripped-User-Name}:-%{%{User-Name}:-none}}" sql_user_name = "%{User-Name}" ####################################################################### # Default profile ####################################################################### # This is the default profile. It is found in SQL by group membership. # That means that this profile must be a member of at least one group # which will contain the corresponding check and reply items. # This profile will be queried in the authorize section for every user. # The point is to assign all users a default profile without having to # manually add each one to a group that will contain the profile. # The SQL module will also honor the User-Profile attribute. This # attribute can be set anywhere in the authorize section (ie the users # file). It is found exactly as the default profile is found. # If it is set then it will *overwrite* the default profile setting. # The idea is to select profiles based on checks on the incoming # packets, not on user group membership. For example: # -- users file -- # DEFAULT Service-Type == Outbound-User, User-Profile := "outbound" # DEFAULT Service-Type == Framed-User, User-Profile := "framed" # # By default the default_user_profile is not set # # default_user_profile = "DEFAULT" ####################################################################### # NAS Query ####################################################################### # This query retrieves the radius clients # # 0. Row ID (currently unused) # 1. Name (or IP address) # 2. Shortname # 3. Type # 4. Secret # 5. Server ####################################################################### nas_query = "SELECT id, nasname, shortname, type, secret, server FROM ${nas_table}" ####################################################################### # Authorization Queries ####################################################################### # These queries compare the check items for the user # in ${authcheck_table} and setup the reply items in # ${authreply_table}. You can use any query/tables # you want, but the return data for each row MUST # be in the following order: # # 0. Row ID (currently unused) # 1. UserName/GroupName # 2. Item Attr Name # 3. Item Attr Value # 4. Item Attr Operation ####################################################################### # Use these for case insensitive usernames. WARNING: Slower queries! # authorize_check_query = "SELECT id, UserName, Attribute, Value, Op \ # FROM ${authcheck_table} \ # WHERE LOWER(UserName) = LOWER('%{SQL-User-Name}') \ # ORDER BY id" # authorize_reply_query = "SELECT id, UserName, Attribute, Value, Op \ # FROM ${authreply_table} \ # WHERE LOWER(UserName) = LOWER('%{SQL-User-Name}') \ # ORDER BY id" authorize_check_query = "SELECT id, UserName, Attribute, Value, Op \ FROM ${authcheck_table} \ WHERE Username = '%{SQL-User-Name}' \ ORDER BY id" authorize_reply_query = "SELECT id, UserName, Attribute, Value, Op \ FROM ${authreply_table} \ WHERE Username = '%{SQL-User-Name}' \ ORDER BY id" # Use these for case insensitive usernames. WARNING: Slower queries! # authorize_group_check_query = "SELECT ${groupcheck_table}.id, ${groupcheck_table}.GroupName, \ # ${groupcheck_table}.Attribute, ${groupcheck_table}.Value, ${groupcheck_table}.Op \ # FROM ${groupcheck_table}, ${usergroup_table} \ # WHERE LOWER(${usergroup_table}.UserName) = LOWER('%{SQL-User-Name}') AND ${usergroup_table}.GroupName = ${groupcheck_table}.GroupName \ # ORDER BY ${groupcheck_table}.id" # authorize_group_reply_query = "SELECT ${groupreply_table}.id, ${groupreply_table}.GroupName, \ # ${groupreply_table}.Attribute, ${groupreply_table}.Value, ${groupreply_table}.Op \ # FROM ${groupreply_table}, ${usergroup_table} \ # WHERE LOWER(${usergroup_table}.UserName) = LOWER('%{SQL-User-Name}') AND ${usergroup_table}.GroupName = ${groupreply_table}.GroupName \ # ORDER BY ${groupreply_table}.id" authorize_group_check_query = "SELECT id, GroupName, Attribute, Value, op \ FROM ${groupcheck_table} \ WHERE GroupName = '%{Sql-Group}' \ ORDER BY id" authorize_group_reply_query = "SELECT id, GroupName, Attribute, Value, op \ FROM ${groupreply_table} \ WHERE GroupName = '%{Sql-Group}' \ ORDER BY id" ####################################################################### # Simultaneous Use Checking Queries ####################################################################### # simul_count_query - query for the number of current connections # - If this is not defined, no simultaneous use checking # - will be performed by this module instance # simul_verify_query - query to return details of current connections for verification # - Leave blank or commented out to disable verification step # - Note that the returned field order should not be changed. ####################################################################### # Uncomment simul_count_query to enable simultaneous use checking # simul_count_query = "SELECT COUNT(*) FROM ${acct_table1} WHERE UserName='%{SQL-User-Name}' AND AcctStopTime IS NULL" # simul_verify_query = "SELECT RadAcctId, AcctSessionId, UserName, NASIPAddress, NASPortId, FramedIPAddress, CallingStationId, FramedProtocol FROM ${acct_table1} WHERE UserName='%{SQL-User-Name}' AND AcctStopTime IS NULL" ####################################################################### # Accounting Queries ####################################################################### # accounting_onoff_query - query for Accounting On/Off packets # accounting_update_query - query for Accounting update packets # accounting_update_query_alt - query for Accounting update packets # (alternate in case first query fails) # accounting_start_query - query for Accounting start packets # accounting_start_query_alt - query for Accounting start packets # (alternate in case first query fails) # accounting_stop_query - query for Accounting stop packets # accounting_stop_query_alt - query for Accounting start packets # (alternate in case first query doesn't # affect any existing rows in the table) ####################################################################### accounting_onoff_query = "UPDATE ${acct_table1} \ SET AcctStopTime = ('%S'::timestamp - '%{%{Acct-Delay-Time}:-0}'::interval), \ AcctSessionTime = (EXTRACT(EPOCH FROM ('%S'::timestamp with time zone - AcctStartTime::timestamp with time zone \ - '%{%{Acct-Delay-Time}:-0}'::interval)))::BIGINT, \ AcctTerminateCause = '%{Acct-Terminate-Cause}', \ AcctStopDelay = 0 \ WHERE AcctStopTime IS NULL \ AND NASIPAddress= '%{NAS-IP-Address}' \ AND AcctStartTime <= '%S'::timestamp" accounting_update_query = "UPDATE ${acct_table1} \ SET FramedIPAddress = NULLIF('%{Framed-IP-Address}', '')::inet, \ AcctSessionTime = NULLIF('%{Acct-Session-Time}','')::BIGINT, \ AcctInputOctets = (('%{%{Acct-Input-Gigawords}:-0}'::bigint << 32) + '%{%{Acct-Input-Octets}:-0}'::bigint), \ AcctOutputOctets = (('%{%{Acct-Output-Gigawords}:-0}'::bigint << 32) + '%{%{Acct-Output-Octets}:-0}'::bigint) \ WHERE AcctSessionId = '%{Acct-Session-Id}' AND UserName = '%{SQL-User-Name}' \ AND NASIPAddress= '%{NAS-IP-Address}' AND AcctStopTime IS NULL" accounting_update_query_alt = "INSERT INTO ${acct_table1} \ (AcctSessionId, AcctUniqueId, UserName, Realm, NASIPAddress, \ NASPortId, NASPortType, AcctStartTime, \ AcctSessionTime, AcctAuthentic, AcctInputOctets, \ AcctOutputOctets, CalledStationId, CallingStationId, \ ServiceType, FramedProtocol, FramedIPAddress, XAscendSessionSvrKey) \ VALUES('%{Acct-Session-Id}', '%{Acct-Unique-Session-Id}', \ '%{SQL-User-Name}', NULLIF('%{Realm}', ''), '%{NAS-IP-Address}', \ %{%{NAS-Port}:-NULL}, '%{NAS-Port-Type}', \ ('%S'::timestamp - '%{%{Acct-Delay-Time}:-0}'::interval - '%{%{Acct-Session-Time}:-0}'::interval), \ NULLIF('%{Acct-Session-Time}','')::BIGINT, '%{Acct-Authentic}', \ (('%{%{Acct-Input-Gigawords}:-0}'::bigint << 32) + '%{%{Acct-Input-Octets}:-0}'::bigint), \ (('%{%{Acct-Output-Gigawords}:-0}'::bigint << 32) + '%{%{Acct-Output-Octets}:-0}'::bigint), \ '%{Called-Station-Id}', \ '%{Calling-Station-Id}', '%{Service-Type}', '%{Framed-Protocol}', \ NULLIF('%{Framed-IP-Address}', '')::inet, '%{X-Ascend-Session-Svr-Key}')" accounting_start_query = "INSERT INTO ${acct_table1} \ (AcctSessionId, AcctUniqueId, UserName, Realm, NASIPAddress, \ NASPortId, NASPortType, AcctStartTime, AcctAuthentic, \ ConnectInfo_start, CalledStationId, CallingStationId, ServiceType, \ FramedProtocol, FramedIPAddress, AcctStartDelay, XAscendSessionSvrKey) \ VALUES('%{Acct-Session-Id}', \ '%{Acct-Unique-Session-Id}', \ '%{SQL-User-Name}', \ NULLIF('%{Realm}', ''), \ '%{NAS-IP-Address}', \ %{%{NAS-Port}:-NULL}, \ '%{NAS-Port-Type}', \ ('%S'::timestamp - '%{%{Acct-Delay-Time}:-0}'::interval), \ '%{Acct-Authentic}', \ '%{Connect-Info}', \ '%{Called-Station-Id}', \ '%{Calling-Station-Id}', \ '%{Service-Type}', \ '%{Framed-Protocol}', \ NULLIF('%{Framed-IP-Address}', '')::inet, \ 0, \ '%{X-Ascend-Session-Svr-Key}')" accounting_start_query_alt = "UPDATE ${acct_table1} \ SET AcctStartTime = ('%S'::timestamp - '%{%{Acct-Delay-Time}:-0}'::interval), \ AcctStartDelay = 0, \ ConnectInfo_start = '%{Connect-Info}' \ WHERE AcctSessionId = '%{Acct-Session-Id}' \ AND UserName = '%{SQL-User-Name}' \ AND NASIPAddress = '%{NAS-IP-Address}' \ AND AcctStopTime IS NULL" accounting_stop_query = "UPDATE ${acct_table2} \ SET AcctStopTime = ('%S'::timestamp - '%{%{Acct-Delay-Time}:-0}'::interval), \ AcctSessionTime = CASE WHEN '%{Acct-Session-Time}' = '' THEN \ (EXTRACT(EPOCH FROM ('%S'::TIMESTAMP WITH TIME ZONE - AcctStartTime::TIMESTAMP WITH TIME ZONE \ - '%{%{Acct-Delay-Time}:-0}'::INTERVAL)))::BIGINT \ ELSE NULLIF('%{Acct-Session-Time}','')::BIGINT END, \ AcctInputOctets = (('%{%{Acct-Input-Gigawords}:-0}'::bigint << 32) + '%{%{Acct-Input-Octets}:-0}'::bigint), \ AcctOutputOctets = (('%{%{Acct-Output-Gigawords}:-0}'::bigint << 32) + '%{%{Acct-Output-Octets}:-0}'::bigint), \ AcctTerminateCause = '%{Acct-Terminate-Cause}', \ AcctStopDelay = 0, \ FramedIPAddress = NULLIF('%{Framed-IP-Address}', '')::inet, \ ConnectInfo_stop = '%{Connect-Info}' \ WHERE AcctSessionId = '%{Acct-Session-Id}' \ AND UserName = '%{SQL-User-Name}' \ AND NASIPAddress = '%{NAS-IP-Address}' \ AND AcctStopTime IS NULL" accounting_stop_query_alt = "INSERT INTO ${acct_table2} \ (AcctSessionId, AcctUniqueId, UserName, Realm, NASIPAddress, NASPortId, NASPortType, AcctStartTime, AcctStopTime, \ AcctSessionTime, AcctAuthentic, ConnectInfo_stop, AcctInputOctets, AcctOutputOctets, CalledStationId, \ CallingStationId, AcctTerminateCause, ServiceType, FramedProtocol, FramedIPAddress, AcctStopDelay) \ values('%{Acct-Session-Id}', \ '%{Acct-Unique-Session-Id}', \ '%{SQL-User-Name}', \ NULLIF('%{Realm}', ''), \ '%{NAS-IP-Address}', \ %{%{NAS-Port}:-NULL}, \ '%{NAS-Port-Type}', \ ('%S'::timestamp - '%{%{Acct-Delay-Time}:-0}'::interval - '%{%{Acct-Session-Time}:-0}'::interval), \ ('%S'::timestamp - '%{%{Acct-Delay-Time}:-0}'::interval), \ NULLIF('%{Acct-Session-Time}', '')::bigint, '%{Acct-Authentic}', \ '%{Connect-Info}', \ (('%{%{Acct-Input-Gigawords}:-0}'::bigint << 32) + '%{%{Acct-Input-Octets}:-0}'::bigint), \ (('%{%{Acct-Output-Gigawords}:-0}'::bigint << 32) + '%{%{Acct-Output-Octets}:-0}'::bigint), \ '%{Called-Station-Id}', \ '%{Calling-Station-Id}', \ '%{Acct-Terminate-Cause}', \ '%{Service-Type}', \ '%{Framed-Protocol}', \ NULLIF('%{Framed-IP-Address}', '')::inet, 0)" ####################################################################### # Group Membership Queries ####################################################################### # group_membership_query - Check user group membership ####################################################################### # Use these for case insensitive usernames. WARNING: Slower queries! # group_membership_query = "SELECT GroupName FROM ${usergroup_table} WHERE LOWER(UserName) = LOWER('%{SQL-User-Name}') ORDER BY priority" group_membership_query = "SELECT GroupName FROM ${usergroup_table} WHERE UserName='%{SQL-User-Name}' ORDER BY priority" ####################################################################### # Authentication Logging Queries ####################################################################### # postauth_query - Insert some info after authentication ####################################################################### postauth_query = "INSERT INTO ${postauth_table} (username, pass, reply, authdate) \ VALUES ('%{User-Name}', '%{%{User-Password}:-Chap-Password}', '%{reply:Packet-Type}', NOW())" freeradius-server/raddb/sql/postgresql/ippool.conf000066400000000000000000000104151257552170400227530ustar00rootroot00000000000000# -*- text -*- ## ## ippool.conf -- PostgreSQL queries for rlm_sqlippool ## ## $Id$ ## This query allocates an IP address from the Pool ## The ORDER BY clause of this query tries to allocate the same IP-address ## to the user that they had last session... allocate-find = "SELECT framedipaddress FROM ${ippool_table} \ WHERE pool_name = '%{control:Pool-Name}' AND expiry_time < 'now'::timestamp(0) \ ORDER BY (username <> '%{SQL-User-Name}'), \ (callingstationid <> '%{Calling-Station-Id}'), expiry_time \ LIMIT 1 \ FOR UPDATE" ## If you prefer to allocate a random IP address every time, use this query instead #allocate-find = "SELECT framedipaddress FROM ${ippool_table} \ # WHERE pool_name = '%{control:Pool-Name}' AND expiry_time < 'now'::timestamp(0) \ # ORDER BY RANDOM() \ # LIMIT 1 \ # FOR UPDATE" ## If an IP could not be allocated, check to see whether the pool exists or not ## This allows the module to differentiate between a full pool and no pool ## Note: If you are not running redundant pool modules this query may be commented ## out to save running this query every time an ip is not allocated. pool-check = "SELECT id FROM ${ippool_table} \ WHERE pool_name='%{control:Pool-Name}' LIMIT 1" ## This query marks the IP address handed out by "allocate-find" as used ## for the period of "lease-duration" after which time it may be reused. allocate-update = "UPDATE ${ippool_table} \ SET nasipaddress = '%{NAS-IP-Address}', pool_key = '${pool-key}', \ callingstationid = '%{Calling-Station-Id}', username = '%{SQL-User-Name}', \ expiry_time = 'now'::timestamp(0) + '${lease-duration} second'::interval \ WHERE framedipaddress = '%I'" ## This query frees the IP address assigned to "pool-key" when a new request ## comes in for the same "pool-key". This means that either you are losing ## accounting Stop records or you use Calling-Station-Id instead of NAS-Port ## as your "pool-key" and your users are able to reconnect before your NAS ## has timed out their previous session. (Generally on wireless networks) ## (Note: If your pool-key is set to Calling-Station-Id and not NAS-Port ## then you may wish to delete the "AND nasipaddress = '%{Nas-IP-Address}' ## from the WHERE clause) allocate-clear = "UPDATE ${ippool_table} \ SET nasipaddress = '', pool_key = 0, callingstationid = '', \ expiry_time = 'now'::timestamp(0) - '1 second'::interval \ WHERE nasipaddress = '%{NAS-IP-Address}' \ AND pool_key = '${pool-key}'" ## This query extends an IP address lease by "lease-duration" when an accounting ## START record arrives start-update = "UPDATE ${ippool_table} \ SET expiry_time = 'now'::timestamp(0) + '${lease-duration} second'::interval \ WHERE nasipaddress = '%{NAS-IP-Address}' \ AND pool_key = '${pool-key}'" ## This query frees an IP address when an accounting ## STOP record arrives stop-clear = "UPDATE ${ippool_table} \ SET nasipaddress = '', pool_key = 0, callingstationid = '', \ expiry_time = 'now'::timestamp(0) - '1 second'::interval \ WHERE nasipaddress = '%{Nas-IP-Address}' \ AND pool_key = '${pool-key}' \ AND username = '%{SQL-User-Name}' \ AND callingstationid = '%{Calling-Station-Id}' \ AND framedipaddress = '%{Framed-IP-Address}'" ## This query extends an IP address lease by "lease-duration" when an accounting ## ALIVE record arrives alive-update = "UPDATE ${ippool_table} \ SET expiry_time = 'now'::timestamp(0) + '${lease-duration} seconds'::interval \ WHERE nasipaddress = '%{Nas-IP-Address}' \ AND pool_key = '${pool-key}' \ AND framedipaddress = '%{Framed-IP-Address}' \ AND username = '%{SQL-User-Name}' \ AND callingstationid = '%{Calling-Station-Id}'" ## This query frees all IP addresses allocated to a NAS when an ## accounting ON record arrives from that NAS on-clear = "UPDATE ${ippool_table} \ SET nasipaddress = '', pool_key = 0, callingstationid = '', \ expiry_time = 'now'::timestamp(0) - '1 second'::interval \ WHERE nasipaddress = '%{Nas-IP-Address}'" ## This query frees all IP addresses allocated to a NAS when an ## accounting OFF record arrives from that NAS off-clear = "UPDATE ${ippool_table} \ SET nasipaddress = '', pool_key = 0, callingstationid = '', \ expiry_time = 'now'::timestamp(0) - '1 second'::interval \ WHERE nasipaddress = '%{Nas-IP-Address}'" freeradius-server/raddb/sql/postgresql/ippool.sql000066400000000000000000000013551257552170400226300ustar00rootroot00000000000000-- -- Table structure for table 'radippool' -- CREATE TABLE radippool ( id BIGSERIAL PRIMARY KEY, pool_name varchar(64) NOT NULL, FramedIPAddress INET NOT NULL, NASIPAddress VARCHAR(16) NOT NULL default '', pool_key VARCHAR(64) NOT NULL default 0, CalledStationId VARCHAR(64), CallingStationId text NOT NULL default ''::text, expiry_time TIMESTAMP(0) without time zone NOT NULL default 'now'::timestamp(0), username text DEFAULT ''::text ); CREATE INDEX radippool_poolname_expire ON radippool USING btree (pool_name, expiry_time); CREATE INDEX radippool_framedipaddress ON radippool USING btree (framedipaddress); CREATE INDEX radippool_nasip_poolkey_ipaddress ON radippool USING btree (nasipaddress, pool_key, framedipaddress); freeradius-server/raddb/sql/postgresql/nas.sql000066400000000000000000000005501257552170400221030ustar00rootroot00000000000000/* * Table structure for table 'nas' */ CREATE TABLE nas ( id SERIAL PRIMARY KEY, nasname VARCHAR(128) NOT NULL, shortname VARCHAR(32) NOT NULL, type VARCHAR(30) NOT NULL DEFAULT 'other', ports int4, secret VARCHAR(60) NOT NULL, server VARCHAR(64), community VARCHAR(50), description VARCHAR(200) ); create index nas_nasname on nas (nasname); freeradius-server/raddb/sql/postgresql/schema.sql000066400000000000000000000123041257552170400225620ustar00rootroot00000000000000/* * $Id$ * * Postgresql schema for FreeRADIUS * * All field lengths need checking as some are still suboptimal. -pnixon 2003-07-13 * */ /* * Table structure for table 'radacct' * * Note: Column type BIGSERIAL does not exist prior to Postgres 7.2 * If you run an older version you need to change this to SERIAL */ CREATE TABLE radacct ( RadAcctId BIGSERIAL PRIMARY KEY, AcctSessionId VARCHAR(64) NOT NULL, AcctUniqueId VARCHAR(32) NOT NULL UNIQUE, UserName VARCHAR(253), GroupName VARCHAR(253), Realm VARCHAR(64), NASIPAddress INET NOT NULL, NASPortId VARCHAR(15), NASPortType VARCHAR(32), AcctStartTime TIMESTAMP with time zone, AcctStopTime TIMESTAMP with time zone, AcctSessionTime BIGINT, AcctAuthentic VARCHAR(32), ConnectInfo_start VARCHAR(50), ConnectInfo_stop VARCHAR(50), AcctInputOctets BIGINT, AcctOutputOctets BIGINT, CalledStationId VARCHAR(50), CallingStationId VARCHAR(50), AcctTerminateCause VARCHAR(32), ServiceType VARCHAR(32), XAscendSessionSvrKey VARCHAR(10), FramedProtocol VARCHAR(32), FramedIPAddress INET, AcctStartDelay INTEGER, AcctStopDelay INTEGER ); -- This index may be usefull.. -- CREATE UNIQUE INDEX radacct_whoson on radacct (AcctStartTime, nasipaddress); -- For use by onoff-, update-, stop- and simul_* queries CREATE INDEX radacct_active_user_idx ON radacct (UserName, NASIPAddress, AcctSessionId) WHERE AcctStopTime IS NULL; -- and for common statistic queries: CREATE INDEX radacct_start_user_idx ON radacct (AcctStartTime, UserName); -- and, optionally -- CREATE INDEX radacct_stop_user_idx ON radacct (acctStopTime, UserName); /* * There was WAAAY too many indexes previously. This combo index * should take care of the most common searches. * I have commented out all the old indexes, but left them in case * someone wants them. I don't recomend anywone use them all at once * as they will slow down your DB too much. * - pnixon 2003-07-13 */ /* * create index radacct_UserName on radacct (UserName); * create index radacct_AcctSessionId on radacct (AcctSessionId); * create index radacct_AcctUniqueId on radacct (AcctUniqueId); * create index radacct_FramedIPAddress on radacct (FramedIPAddress); * create index radacct_NASIPAddress on radacct (NASIPAddress); * create index radacct_AcctStartTime on radacct (AcctStartTime); * create index radacct_AcctStopTime on radacct (AcctStopTime); */ /* * Table structure for table 'radcheck' */ CREATE TABLE radcheck ( id SERIAL PRIMARY KEY, UserName VARCHAR(64) NOT NULL DEFAULT '', Attribute VARCHAR(64) NOT NULL DEFAULT '', op CHAR(2) NOT NULL DEFAULT '==', Value VARCHAR(253) NOT NULL DEFAULT '' ); create index radcheck_UserName on radcheck (UserName,Attribute); /* * Use this index if you use case insensitive queries */ -- create index radcheck_UserName_lower on radcheck (lower(UserName),Attribute); /* * Table structure for table 'radgroupcheck' */ CREATE TABLE radgroupcheck ( id SERIAL PRIMARY KEY, GroupName VARCHAR(64) NOT NULL DEFAULT '', Attribute VARCHAR(64) NOT NULL DEFAULT '', op CHAR(2) NOT NULL DEFAULT '==', Value VARCHAR(253) NOT NULL DEFAULT '' ); create index radgroupcheck_GroupName on radgroupcheck (GroupName,Attribute); /* * Table structure for table 'radgroupreply' */ CREATE TABLE radgroupreply ( id SERIAL PRIMARY KEY, GroupName VARCHAR(64) NOT NULL DEFAULT '', Attribute VARCHAR(64) NOT NULL DEFAULT '', op CHAR(2) NOT NULL DEFAULT '=', Value VARCHAR(253) NOT NULL DEFAULT '' ); create index radgroupreply_GroupName on radgroupreply (GroupName,Attribute); /* * Table structure for table 'radreply' */ CREATE TABLE radreply ( id SERIAL PRIMARY KEY, UserName VARCHAR(64) NOT NULL DEFAULT '', Attribute VARCHAR(64) NOT NULL DEFAULT '', op CHAR(2) NOT NULL DEFAULT '=', Value VARCHAR(253) NOT NULL DEFAULT '' ); create index radreply_UserName on radreply (UserName,Attribute); /* * Use this index if you use case insensitive queries */ -- create index radreply_UserName_lower on radreply (lower(UserName),Attribute); /* * Table structure for table 'radusergroup' */ CREATE TABLE radusergroup ( UserName VARCHAR(64) NOT NULL DEFAULT '', GroupName VARCHAR(64) NOT NULL DEFAULT '', priority INTEGER NOT NULL DEFAULT 0 ); create index radusergroup_UserName on radusergroup (UserName); /* * Use this index if you use case insensitive queries */ -- create index radusergroup_UserName_lower on radusergroup (lower(UserName)); /* * Table structure for table 'realmgroup' * Commented out because currently not used */ --CREATE TABLE realmgroup ( -- id SERIAL PRIMARY KEY, -- RealmName VARCHAR(30) DEFAULT '' NOT NULL, -- GroupName VARCHAR(30) --); --create index realmgroup_RealmName on realmgroup (RealmName); /* * Table structure for table 'realms' * This is not yet used by FreeRADIUS */ --CREATE TABLE realms ( -- id SERIAL PRIMARY KEY, -- realmname VARCHAR(64), -- nas VARCHAR(128), -- authport int4, -- options VARCHAR(128) DEFAULT '' --); -- -- Table structure for table 'radpostauth' -- CREATE TABLE radpostauth ( id BIGSERIAL PRIMARY KEY, username VARCHAR(253) NOT NULL, pass VARCHAR(128), reply VARCHAR(32), CalledStationId VARCHAR(50), CallingStationId VARCHAR(50), authdate TIMESTAMP with time zone NOT NULL default 'now()' ); freeradius-server/raddb/sql/postgresql/update_radacct_group_trigger.sql000066400000000000000000000017551257552170400272340ustar00rootroot00000000000000/* * $Id$ * * OPTIONAL Postgresql trigger for FreeRADIUS * * This trigger updates fills in the groupname field (which doesnt come in Accounting packets) * by querying the radusergroup table. * This makes it easier to do group summary reports, however note that it does add some extra * database load to 50% of your SQL accounting queries. If you dont care about group summary * reports then you dont need to install this. * */ CREATE OR REPLACE FUNCTION upd_radgroups() RETURNS trigger AS' DECLARE v_groupname varchar; BEGIN SELECT INTO v_groupname GroupName FROM radusergroup WHERE CalledStationId = NEW.CalledStationId AND UserName = NEW.UserName; IF FOUND THEN UPDATE radacct SET GroupName = v_groupname WHERE RadAcctId = NEW.RadAcctId; END IF; RETURN NEW; END 'LANGUAGE plpgsql; DROP TRIGGER upd_radgroups ON radacct; CREATE TRIGGER upd_radgroups AFTER INSERT ON radacct FOR EACH ROW EXECUTE PROCEDURE upd_radgroups(); freeradius-server/raddb/sql/postgresql/voip-postpaid.conf000066400000000000000000000110541257552170400242470ustar00rootroot00000000000000# -*- text -*- ## ## voip-postpaid.conf -- PostgreSQL configuration for H323 VoIP billingx ## (cisco_h323_db_schema.sql) ## ## $Id$ sql pgsql-voip { # Database type currently must be rlm_sql_postgresql to work with this setup. driver = "rlm_sql_postgresql" # Connect info server = "localhost" login = "postgres" password = "" # Database configuration radius_db = "radius" # Database table configuration acct_table1 = "Start" acct_table2 = "Stop" authcheck_table = "radcheck" authreply_table = "radreply" groupcheck_table = "radgroupcheck" groupreply_table = "radgroupreply" usergroup_table = "radusergroup" # Remove stale session if checkrad does not see a double login deletestalesessions = yes # Print all SQL statements when in debug mode (-x) sqltrace = no sqltracefile = ${logdir}/sqltrace.sql # number of sql connections to make to server num_sql_socks = 25 # Radius server name so you can tell which radius server handled a request # when you have multiple radius servers and one database. radius_server_name = FreeRADIUS ####################################################################### # Query config: Username ####################################################################### # This is the username that will get substituted, escaped, and added # as attribute 'SQL-User-Name'. '%{SQL-User-Name}' should be used below # everywhere a username substitution is needed so you you can be sure # the username passed from the client is escaped properly. # # Uncomment the next line, if you want the sql_user_name to mean: # # Use Stripped-User-Name, if it's there. # Else use User-Name, if it's there, # Else use hard-coded string "none" as the user name. # #sql_user_name = "%{Stripped-User-Name:-%{User-Name:-none}}" # sql_user_name = "%{User-Name}" ####################################################################### # Accounting Queries ####################################################################### # accounting_onoff_query - query for Accounting On/Off packets # accounting_update_query - query for Accounting update packets # accounting_update_query_alt - query for Accounting update packets # (alternate in case first query fails) # accounting_start_query - query for Accounting start packets # accounting_start_query_alt - query for Accounting start packets # (alternate in case first query fails) # accounting_stop_query - query for Accounting stop packets # accounting_stop_query_alt - query for Accounting start packets # (alternate in case first query doesn't # affect any existing rows in the table) ####################################################################### # Note: The VoIP accouting does not need Alternate queries in the shipped # configuration as all queries are INSERTS, hence should always work. # If they do not work then you probably have duplicate records in your table. accounting_start_query = "INSERT into ${acct_table1}%{h323-call-type} \ (RadiusServerName, UserName, NASIPAddress, AcctTime, CalledStationId, \ CallingStationId, AcctDelayTime, h323gwid, h323callorigin, h323setuptime, H323ConnectTime, callid) \ values('${radius_server_name}', '%{SQL-User-Name}', \ '%{NAS-IP-Address}', now(), '%{Called-Station-Id}', \ '%{Calling-Station-Id}', '%{Acct-Delay-Time:-0}', '%{h323-gw-id}', \ '%{h323-call-origin}', strip_dot('%{h323-setup-time}'), strip_dot('%{h323-connect-time}'), pick_id('%{h323-conf-id}', '%{call-id}'))" accounting_stop_query = "INSERT into ${acct_table2}%{h323-call-type} \ (RadiusServerName, UserName, NASIPAddress, AcctTime, \ AcctSessionTime, AcctInputOctets, AcctOutputOctets, CalledStationId, CallingStationId, \ AcctDelayTime, H323RemoteAddress, H323VoiceQuality, CiscoNASPort, h323callorigin, callid, \ h323connecttime, h323disconnectcause, h323disconnecttime, h323gwid, h323setuptime) \ values('${radius_server_name}', '%{SQL-User-Name}', '%{NAS-IP-Address}', now(), '%{Acct-Session-Time:-0}', \ '%{Acct-Input-Octets:-0}', '%{Acct-Output-Octets:-0}', '%{Called-Station-Id}', '%{Calling-Station-Id}', \ '%{Acct-Delay-Time:-0}', NULLIF('%{h323-remote-address}', '')::inet, NULLIF('%{h323-voice-quality}','')::integer, NULLIF('%{Cisco-NAS-Port}', ''), \ '%{h323-call-origin}', pick_id('%{h323-conf-id}', '%{call-id}'), strip_dot('%{h323-connect-time}'), '%{h323-disconnect-cause}', \ strip_dot('%{h323-disconnect-time}'), '%{h323-gw-id}', strip_dot('%{h323-setup-time}'))" } freeradius-server/raddb/sqlippool.conf000066400000000000000000000046531257552170400205000ustar00rootroot00000000000000## Configuration for the SQL based IP Pool module (rlm_sqlippool) ## ## The database schemas are available at: ## ## raddb/sql/DB/ippool.sql ## ## $Id$ sqlippool { ######################################### ## SQL instance to use (from sql.conf) ## ## ## If you have multiple sql instances, such as "sql sql1 {...}", ## use the *instance* name here: sql1. ######################################### sql-instance-name = "sql" ## SQL table to use for ippool range and lease info ippool_table = "radippool" ## IP lease duration. (Leases expire even if Acct Stop packet is lost) lease-duration = 3600 ## Attribute which should be considered unique per NAS ## Using NAS-Port gives behaviour similar to rlm_ippool. (And ACS) ## Using Calling-Station-Id works for NAS that send fixed NAS-Port ## ONLY change this if you know what you are doing! pool-key = "%{NAS-Port}" # pool-key = "%{Calling-Station-Id}" ################################################################ # # WARNING: MySQL has certain limitations that means it can # hand out the same IP address to 2 different users. # # We suggest using an SQL DB with proper transaction # support, such as PostgreSQL, or using MySQL # with InnoDB. # ################################################################ # # Use the same database as configured in the "sql" module, "database" # configuration item. Change the "postgresql" name below to be the # same as the "database" field of the SQL module referred to in the # "sql-instance-name", above. # $INCLUDE sql/postgresql/ippool.conf ## Logging configuration. (Comment out to disable logging) sqlippool_log_exists = "Existing IP: %{reply:Framed-IP-Address} \ (did %{Called-Station-Id} cli %{Calling-Station-Id} port %{NAS-Port} user %{User-Name})" sqlippool_log_success = "Allocated IP: %{reply:Framed-IP-Address} from %{control:Pool-Name} \ (did %{Called-Station-Id} cli %{Calling-Station-Id} port %{NAS-Port} user %{User-Name})" sqlippool_log_clear = "Released IP %{Framed-IP-Address}\ (did %{Called-Station-Id} cli %{Calling-Station-Id} user %{User-Name})" sqlippool_log_failed = "IP Allocation FAILED from %{control:Pool-Name} \ (did %{Called-Station-Id} cli %{Calling-Station-Id} port %{NAS-Port} user %{User-Name})" sqlippool_log_nopool = "No Pool-Name defined \ (did %{Called-Station-Id} cli %{Calling-Station-Id} port %{NAS-Port} user %{User-Name})" } freeradius-server/raddb/templates.conf000066400000000000000000000070151257552170400204470ustar00rootroot00000000000000# -*- text -*- ## ## templates.conf -- configurations to be used in multiple places ## ## $Id$ ###################################################################### # # Version 2.0 has a useful new feature called "templates". # # Use templates by adding a line in radiusd.conf: # # $INCLUDE templates.conf # # The goal of the templates is to have common configuration located # in this file, and to list only the *differences* in the individual # sections. This feature is most useful for sections like "clients" # or "home_servers", where many may be defined, and each one has # similar repeated configuration. # # Something similar to templates can be done by putting common # configuration into separate files, and using "$INCLUDE file...", # but this is more flexible, and simpler to understand. It's also # cheaper for the server, because "$INCLUDE" makes a copy of the # configuration for inclusion, and templates are simply referenced. # # The templates are defined in the "templates" section, so that they # do not affect the rest of the server configuration. # # A section can reference a template by using "$template name" # templates { # # The contents of the templates section are other # configuration sections that would normally go into # the configuration files. # # # This is a default template for the "home_server" section. # Note that there is no name for the section. # # Any configuration item that is valid for a "home_server" # section is also valid here. When a "home_server" section # is defined in proxy.conf, this section is referenced as # the template. # # Configuration items that are explicitly listed in a # "home_server" section of proxy.conf are used in # preference to the configuration items listed here. # # However, if a configuration item is NOT listed in a # "home_server" section of proxy.conf, then the value here # is used. # # This functionality lets you put common configuration into # a template, and to put only the unique configuration # items in "proxy.conf". Each section in proxy.conf can # then contain a line "$template home_server", which will # cause it to reference this template. # home_server { response_window = 20 zombie_period = 40 revive_interval = 120 # # Etc. } # # You can also have named templates. For example, if you # are proxying to 3 different home servers all at the same # site, with identical configurations (other than IP # addresses), you can use this named template. # # Then, each "home_server" section in "proxy.conf" would # only list the IP address of that home server, and a # line saying # # $template example_com # # That would tell FreeRADIUS to look in the section below # for the rest of the configuration items. # # For various reasons, you shouldn't have a "." in the template # name. Doing so means that the server will be unable to find # the template. # example_com { type = auth port = 1812 secret = testing123 response_window = 20 # # Etc... } # # You can have templates for other sections, too, but they # seem to be most useful for home_servers. # # For now, you can use templates only for sections in # radiusd.conf, not sub-sections. So you still have to use # the "$INCLUDE file.." method for things like defining # multiple "sql" modules, each with similar configuration. # } freeradius-server/raddb/users000066400000000000000000000145741257552170400166760ustar00rootroot00000000000000# # Please read the documentation file ../doc/processing_users_file, # or 'man 5 users' (after installing the server) for more information. # # This file contains authentication security and configuration # information for each user. Accounting requests are NOT processed # through this file. Instead, see 'acct_users', in this directory. # # The first field is the user's name and can be up to # 253 characters in length. This is followed (on the same line) with # the list of authentication requirements for that user. This can # include password, comm server name, comm server port number, protocol # type (perhaps set by the "hints" file), and huntgroup name (set by # the "huntgroups" file). # # If you are not sure why a particular reply is being sent by the # server, then run the server in debugging mode (radiusd -X), and # you will see which entries in this file are matched. # # When an authentication request is received from the comm server, # these values are tested. Only the first match is used unless the # "Fall-Through" variable is set to "Yes". # # A special user named "DEFAULT" matches on all usernames. # You can have several DEFAULT entries. All entries are processed # in the order they appear in this file. The first entry that # matches the login-request will stop processing unless you use # the Fall-Through variable. # # If you use the database support to turn this file into a .db or .dbm # file, the DEFAULT entries _have_ to be at the end of this file and # you can't have multiple entries for one username. # # Indented (with the tab character) lines following the first # line indicate the configuration values to be passed back to # the comm server to allow the initiation of a user session. # This can include things like the PPP configuration values # or the host to log the user onto. # # You can include another `users' file with `$INCLUDE users.other' # # # For a list of RADIUS attributes, and links to their definitions, # see: # # http://www.freeradius.org/rfc/attributes.html # # # Deny access for a specific user. Note that this entry MUST # be before any other 'Auth-Type' attribute which results in the user # being authenticated. # # Note that there is NO 'Fall-Through' attribute, so the user will not # be given any additional resources. # #lameuser Auth-Type := Reject # Reply-Message = "Your account has been disabled." # # Deny access for a group of users. # # Note that there is NO 'Fall-Through' attribute, so the user will not # be given any additional resources. # #DEFAULT Group == "disabled", Auth-Type := Reject # Reply-Message = "Your account has been disabled." # # # This is a complete entry for "steve". Note that there is no Fall-Through # entry so that no DEFAULT entry will be used, and the user will NOT # get any attributes in addition to the ones listed here. # #steve Cleartext-Password := "testing" # Service-Type = Framed-User, # Framed-Protocol = PPP, # Framed-IP-Address = 172.16.3.33, # Framed-IP-Netmask = 255.255.255.0, # Framed-Routing = Broadcast-Listen, # Framed-Filter-Id = "std.ppp", # Framed-MTU = 1500, # Framed-Compression = Van-Jacobsen-TCP-IP # # This is an entry for a user with a space in their name. # Note the double quotes surrounding the name. # #"John Doe" Cleartext-Password := "hello" # Reply-Message = "Hello, %{User-Name}" # # Dial user back and telnet to the default host for that port # #Deg Cleartext-Password := "ge55ged" # Service-Type = Callback-Login-User, # Login-IP-Host = 0.0.0.0, # Callback-Number = "9,5551212", # Login-Service = Telnet, # Login-TCP-Port = Telnet # # Another complete entry. After the user "dialbk" has logged in, the # connection will be broken and the user will be dialed back after which # he will get a connection to the host "timeshare1". # #dialbk Cleartext-Password := "callme" # Service-Type = Callback-Login-User, # Login-IP-Host = timeshare1, # Login-Service = PortMaster, # Callback-Number = "9,1-800-555-1212" # # user "swilson" will only get a static IP number if he logs in with # a framed protocol on a terminal server in Alphen (see the huntgroups file). # # Note that by setting "Fall-Through", other attributes will be added from # the following DEFAULT entries # #swilson Service-Type == Framed-User, Huntgroup-Name == "alphen" # Framed-IP-Address = 192.168.1.65, # Fall-Through = Yes # # If the user logs in as 'username.shell', then authenticate them # using the default method, give them shell access, and stop processing # the rest of the file. # #DEFAULT Suffix == ".shell" # Service-Type = Login-User, # Login-Service = Telnet, # Login-IP-Host = your.shell.machine # # The rest of this file contains the several DEFAULT entries. # DEFAULT entries match with all login names. # Note that DEFAULT entries can also Fall-Through (see first entry). # A name-value pair from a DEFAULT entry will _NEVER_ override # an already existing name-value pair. # # # Set up different IP address pools for the terminal servers. # Note that the "+" behind the IP address means that this is the "base" # IP address. The Port-Id (S0, S1 etc) will be added to it. # #DEFAULT Service-Type == Framed-User, Huntgroup-Name == "alphen" # Framed-IP-Address = 192.168.1.32+, # Fall-Through = Yes #DEFAULT Service-Type == Framed-User, Huntgroup-Name == "delft" # Framed-IP-Address = 192.168.2.32+, # Fall-Through = Yes # # Sample defaults for all framed connections. # #DEFAULT Service-Type == Framed-User # Framed-IP-Address = 255.255.255.254, # Framed-MTU = 576, # Service-Type = Framed-User, # Fall-Through = Yes # # Default for PPP: dynamic IP address, PPP mode, VJ-compression. # NOTE: we do not use Hint = "PPP", since PPP might also be auto-detected # by the terminal server in which case there may not be a "P" suffix. # The terminal server sends "Framed-Protocol = PPP" for auto PPP. # DEFAULT Framed-Protocol == PPP Framed-Protocol = PPP, Framed-Compression = Van-Jacobson-TCP-IP # # Default for CSLIP: dynamic IP address, SLIP mode, VJ-compression. # DEFAULT Hint == "CSLIP" Framed-Protocol = SLIP, Framed-Compression = Van-Jacobson-TCP-IP # # Default for SLIP: dynamic IP address, SLIP mode. # DEFAULT Hint == "SLIP" Framed-Protocol = SLIP # # Last default: rlogin to our main server. # #DEFAULT # Service-Type = Login-User, # Login-Service = Rlogin, # Login-IP-Host = shellbox.ispdomain.com # # # # Last default: shell on the local terminal server. # # # DEFAULT # Service-Type = Administrative-User # On no match, the user is denied access. freeradius-server/raddb/vmpsd.conf.in000066400000000000000000000323601257552170400202100ustar00rootroot00000000000000## ## vmpsd.conf -- FreeRADIUS VMPS server configuration file. ## ## http://www.freeradius.org/ ## $Id$ ## # # This configuration file is for a stand-alone VMPS server that # does not do RADIUS. For an integrated radius + vmps server, # edit "radiusd.conf", and add two sections to it: # # listen { # type = vmps # ... # } # # vmps { # ... # } # # # See the text below for additional documentation on those two # sections. # # The location of other config files and # logfiles are declared in this file # # Also general configuration for modules can be done # in this file, it is exported through the API to # modules that ask for it. # # The configuration variables defined here are of the form ${foo} # They are local to this file, and do not change from request to # request. # # The per-request variables are of the form %{Attribute-Name}, and # are taken from the values of the attribute in the incoming # request. See 'doc/variables.txt' for more information. # # Standard includes, etc. # # FIXME: to make this work: prefix, etc. See radiusd.conf... # prefix = @prefix@ exec_prefix = @exec_prefix@ sysconfdir = @sysconfdir@ localstatedir = @localstatedir@ sbindir = @sbindir@ logdir = @logdir@ raddbdir = @raddbdir@ radacctdir = @radacctdir@ # # The logging messages for the server are appended to the # tail of this file. # log_file = ${logdir}/vmpsd.log # # Destination for log messages. This can be one of: # # files - log to ${log_file}, as defined above. # syslog - to syslog (see also the log{} section, below) # stdout - standard output # stderr - standard error. # # The command-line option "-X" over-rides this option, and forces # logging to go to stdout. # log_destination = files # # libdir: Where to find the rlm_* modules. # # This should be automatically set at configuration time. # # If the server builds and installs, but fails at execution time # with an 'undefined symbol' error, then you can use the libdir # directive to work around the problem. # # The cause is usually that a library has been installed on your # system in a place where the dynamic linker CANNOT find it. When # executing as root (or another user), your personal environment MAY # be set up to allow the dynamic linker to find the library. When # executing as a daemon, FreeRADIUS MAY NOT have the same # personalized configuration. # # To work around the problem, find out which library contains that symbol, # and add the directory containing that library to the end of 'libdir', # with a colon separating the directory names. NO spaces are allowed. # # e.g. libdir = /usr/local/lib:/opt/package/lib # # You can also try setting the LD_LIBRARY_PATH environment variable # in a script which starts the server. # # If that does not work, then you can re-configure and re-build the # server to NOT use shared libraries, via: # # ./configure --disable-shared # make # make install # libdir = @libdir@ # pidfile: Where to place the PID of the RADIUS server. # # The server may be signalled while it's running by using this # file. # # This file is written when ONLY running in daemon mode. # # e.g.: kill -HUP `cat /var/run/radiusd/radiusd.pid` # pidfile = ${run_dir}/vmpsd.pid # user/group: The name (or #number) of the user/group to run vmpsd as. # # If these are commented out, the server will run as the user/group # that started it. In order to change to a different user/group, you # MUST be root ( or have root privleges ) to start the server. # # We STRONGLY recommend that you run the server with as few permissions # as possible. That is, if you're not using shadow passwords, the # user and group items below should be set to 'nobody'. # # On SCO (ODT 3) use "user = nouser" and "group = nogroup". # # NOTE that some kernels refuse to setgid(group) when the value of # (unsigned)group is above 60000; don't use group nobody on these systems! # # On systems with shadow passwords, you might have to set 'group = shadow' # for the server to be able to read the shadow password file. If you can # authenticate users while in debug mode, but not in daemon mode, it may be # that the debugging mode server is running as a user that can read the # shadow info, and the user listed below can not. # #user = nobody #group = nobody # max_request_time: The maximum time (in seconds) to handle a request. # # Requests which take more time than this to process may be killed, and # a REJECT message is returned. # # WARNING: If you notice that requests take a long time to be handled, # then this MAY INDICATE a bug in the server, in one of the modules # used to handle a request, OR in your local configuration. # # This problem is most often seen when using an SQL database. If it takes # more than a second or two to receive an answer from the SQL database, # then it probably means that you haven't indexed the database. See your # SQL server documentation for more information. # # Useful range of values: 5 to 120 # max_request_time = 30 # cleanup_delay: The time to wait (in seconds) before cleaning up # a reply which was sent to the NAS. # # The VMPS request is normally cached internally for a short period # of time, after the reply is sent to the NAS. The reply packet may be # lost in the network, and the NAS will not see it. The NAS will then # re-send the request, and the server will respond quickly with the # cached reply. # # If this value is set too low, then duplicate requests from the NAS # MAY NOT be detected, and will instead be handled as seperate requests. # # If this value is set too high, then the server will cache too many # requests, and some new requests may get blocked. (See 'max_requests'.) # # Useful range of values: 2 to 10 # cleanup_delay = 5 # listen: Make the server listen on a particular IP address, and send # replies out from that address. This directive is most useful for # hosts with multiple IP addresses on one interface. # # If you want the server to listen on additional addresses, or on # additionnal ports, you can use multiple "listen" sections. # # Each section make the server listen for only one type of packet, # therefore authentication and accounting have to be configured in # different sections. # # The server ignore all "listen" section if you are using '-i' and '-p' # on the command line. # listen { # IP address on which to listen. # Allowed values are: # dotted quad (1.2.3.4) # hostname (radius.example.com) # wildcard (*) ipaddr = * # OR, you can use an IPv6 address, but not both # at the same time. # ipv6addr = :: # any. ::1 == localhost # Port on which to listen. # Allowed values are: # integer port number # 1589 is the default VMPS port. port = 1589 # Type of packets to listen for. Use "vmps" for VMPSd. # type = vmps # Some systems support binding to an interface, in addition # to the IP address. This feature isn't strictly necessary, # but for sites with many IP addresses on one interface, # it's useful to say "listen on all addresses for eth0". # # If your system does not support this feature, you will # get an error if you try to use it. # # interface = eth0 # Per-socket lists of clients. This is a very useful feature. # # The name here is a reference to a section elsewhere in # radiusd.conf, or clients.conf. Having the name as # a reference allows multiple sockets to use the same # set of clients. # # If this configuration is used, then the global list of clients # is IGNORED for this "listen" section. Take care configuring # this feature, to ensure you don't accidentally disable a # client you need. # # See clients.conf for the configuration of "per_socket_clients". # # clients = per_socket_clients } # hostname_lookups: Log the names of clients or just their IP addresses # e.g., www.freeradius.org (on) or 206.47.27.232 (off). # # The default is 'off' because it would be overall better for the net # if people had to knowingly turn this feature on, since enabling it # means that each client request will result in AT LEAST one lookup # request to the nameserver. Enabling hostname_lookups will also # mean that your server may stop randomly for 30 seconds from time # to time, if the DNS requests take too long. # # Turning hostname lookups off also means that the server won't block # for 30 seconds, if it sees an IP address which has no name associated # with it. # # allowed values: {no, yes} # hostname_lookups = no # Core dumps are a bad thing. This should only be set to 'yes' # if you're debugging a problem with the server. # # allowed values: {no, yes} # allow_core_dumps = no # Regular expressions # # These items are set at configure time. If they're set to "yes", # then setting them to "no" turns off regular expression support. # # If they're set to "no" at configure time, then setting them to "yes" # WILL NOT WORK. It will give you an error. # regular_expressions = yes extended_expressions = yes # # Logging section. The various "log_*" configuration items # will eventually be moved here. # log { # # Which syslog facility to use, if ${log_destination} == "syslog" # # The exact values permitted here are OS-dependent. You probably # don't want to change this. # syslog_facility = daemon } # THREAD POOL CONFIGURATION # # The thread pool is a long-lived group of threads which # take turns (round-robin) handling any incoming requests. # # You probably want to have a few spare threads around, # so that high-load situations can be handled immediately. If you # don't have any spare threads, then the request handling will # be delayed while a new thread is created, and added to the pool. # # You probably don't want too many spare threads around, # otherwise they'll be sitting there taking up resources, and # not doing anything productive. # # The numbers given below should be adequate for most situations. # thread pool { # Number of servers to start initially --- should be a reasonable # ballpark figure. start_servers = 5 # Limit on the total number of servers running. # # If this limit is ever reached, clients will be LOCKED OUT, so it # should NOT BE SET TOO LOW. It is intended mainly as a brake to # keep a runaway server from taking the system with it as it spirals # down... # # You may find that the server is regularly reaching the # 'max_servers' number of threads, and that increasing # 'max_servers' doesn't seem to make much difference. # # If this is the case, then the problem is MOST LIKELY that # your back-end databases are taking too long to respond, and # are preventing the server from responding in a timely manner. # # The solution is NOT do keep increasing the 'max_servers' # value, but instead to fix the underlying cause of the # problem: slow database, or 'hostname_lookups=yes'. # # For more information, see 'max_request_time', above. # max_servers = 32 # Server-pool size regulation. Rather than making you guess # how many servers you need, The server dynamically adapts to # the load it sees, that is, it tries to maintain enough # servers to handle the current load, plus a few spare # servers to handle transient load spikes. # # It does this by periodically checking how many servers are # waiting for a request. If there are fewer than # min_spare_servers, it creates a new spare. If there are # more than max_spare_servers, some of the spares die off. # The default values are probably OK for most sites. # min_spare_servers = 3 max_spare_servers = 10 # There may be memory leaks or resource allocation problems with # the server. If so, set this value to 300 or so, so that the # resources will be cleaned up periodically. # # This should only be necessary if there are serious bugs in the # server which have not yet been fixed. # # '0' is a special value meaning 'infinity', or 'the servers never # exit' max_requests_per_server = 0 } # MODULE CONFIGURATION # # The names and configuration of each module is located in this section. # # After the modules are defined here, they may be referred to by name, # in other sections of this configuration file. # modules { # # Add modules here. See "radiusd.conf" for examples. # } # Instantiation # # This section orders the loading of the modules. Modules # listed here will get loaded BEFORE the later sections like # authorize, authenticate, etc. get examined. # # This section is not strictly needed. When a section like # authorize refers to a module, it's automatically loaded and # initialized. However, some modules may not be listed in any # of the following sections, so they can be listed here. # # Also, listing modules here ensures that you have control over # the order in which they are initalized. If one module needs # something defined by another module, you can list them in order # here, and ensure that the configuration will be OK. # instantiate { # # Add modules here. See "radiusd.conf" for examples. # } # # And the REAL contents. This section is just like the "post-auth" # section of radiusd.conf. In fact, it calls the "post-auth" component # of the modules that are listed here. But it's called "vmps" for # simplicity. # vmps { # # This is a hack for testing # update reply { VMPS-Packet-Type = VMPS-Join-Response VMPS-VLAN-Name = "foo" VMPS-Cookie = "%{VMPS-Mac}" } } freeradius-server/redhat/000077500000000000000000000000001257552170400157725ustar00rootroot00000000000000freeradius-server/redhat/README000066400000000000000000000007531257552170400166570ustar00rootroot00000000000000 The files in this directory are intended only for "generic" systems. If you need to build FreeRADIUS from source on a RedHat system (RHEL, Fedora, or CentOS), please read the following FAQ: http://wiki.freeradius.org/guide/Red_Hat_FAQ It was written by the person who maintains the RedHat FreeRADIUS packages, and contains detailed instructions for creating an RPM from the original RedHat spec files. This ensures that the RPMs on your system closely match the RedHat requirements. freeradius-server/redhat/freeradius-cert-config.patch000066400000000000000000000010331257552170400233370ustar00rootroot00000000000000diff --git a/raddb/eap.conf b/raddb/eap.conf index d2c2b65..8d47925 100644 --- a/raddb/eap.conf +++ b/raddb/eap.conf @@ -297,7 +297,11 @@ # for the server to print out an error message, # and refuse to start. # - make_cert_command = "${certdir}/bootstrap" + # Redhat RPM's run the bootstrap certificate creation + # as part of the RPM install (not upgrade), therefore + # the make_cert_command is commented out. + # + #make_cert_command = "${certdir}/bootstrap" # # Elliptical cryptography configuration freeradius-server/redhat/freeradius-logrotate000066400000000000000000000020731257552170400220460ustar00rootroot00000000000000# You can use this to rotate the /var/log/radius/* files, simply copy # it to /etc/logrotate.d/radiusd # There are different detail-rotating strategies you can use. One is # to write to a single detail file per IP and use the rotate config # below. Another is to write to a daily detail file per IP with: # detailfile = ${radacctdir}/%{Client-IP-Address}/%Y%m%d-detail # (or similar) in radiusd.conf, without rotation. If you go with the # second technique, you will need another cron job that removes old # detail files. You do not need to comment out the below for method #2. /var/log/radius/radacct/*/detail { monthly rotate 4 nocreate missingok compress } /var/log/radius/checkrad.log { monthly rotate 4 create missingok compress } /var/log/radius/radius.log { monthly rotate 4 create missingok compress postrotate /sbin/service radiusd reload endscript } /var/log/radius/radwtmp { monthly rotate 4 create compress missingok } /var/log/radius/sqltrace.sql { monthly rotate 4 create compress missingok } freeradius-server/redhat/freeradius-pam-conf000066400000000000000000000002611257552170400215430ustar00rootroot00000000000000#%PAM-1.0 auth include password-auth account required pam_nologin.so account include password-auth password include password-auth session include password-auth freeradius-server/redhat/freeradius-radiusd-init000077500000000000000000000044661257552170400224550ustar00rootroot00000000000000#!/bin/sh # # radiusd Start/Stop the FreeRADIUS daemon # # chkconfig: - 88 10 # description: Extensible, configurable, high performance RADIUS server. ### BEGIN INIT INFO # Provides: radiusd # Required-Start: $network # Required-Stop: # Default-Start: # Default-Stop: # Should-Start: $time $syslog mysql ldap postgresql samba krb5-kdc # Should-Stop: # Short-Description: FreeRADIUS server # Description: Extensible, configurable, high performance RADIUS server. ### END INIT INFO # Source function library. . /etc/rc.d/init.d/functions prog=radiusd [ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog exec=${exec:=/usr/sbin/$prog} config_dir=${config_dir:=/etc/raddb} config=${config:=$config_dir/radiusd.conf} pidfile=${pidfile:=/var/run/$prog/$prog.pid} lockfile=${lockfile:=/var/lock/subsys/radiusd} start() { [ -x $exec ] || exit 5 [ -f $config ] || exit 6 echo -n $"Starting $prog: " daemon --pidfile $pidfile $exec -d $config_dir retval=$? echo [ $retval -eq 0 ] && touch $lockfile return $retval } stop() { echo -n $"Stopping $prog: " killproc -p $pidfile $prog retval=$? echo [ $retval -eq 0 ] && rm -f $lockfile return $retval } restart() { stop start } reload() { # radiusd may not be capable of a 100% configuration reload depending # on which loadable modules are in use, if sending the server a # HUP is not sufficient then use restart here instead. However, we # prefer by default to use HUP since it's what is usually desired. # # restart kill -HUP `pidofproc -p $pidfile $prog` } force_reload() { restart } rh_status() { # run checks to determine if the service is running or use generic status status -p $pidfile $prog } rh_status_q() { rh_status >/dev/null 2>&1 } case "$1" in start) rh_status_q && exit 0 $1 ;; stop) rh_status_q || exit 0 $1 ;; restart) $1 ;; reload) rh_status_q || exit 7 $1 ;; force-reload) force_reload ;; status) rh_status ;; condrestart|try-restart) rh_status_q || exit 0 restart ;; *) echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}" exit 2 esac exit $? freeradius-server/redhat/freeradius.spec000066400000000000000000000310121257552170400207740ustar00rootroot00000000000000Summary: High-performance and highly configurable free RADIUS server Name: freeradius Version: 2.2.8 Release: 1%{?dist} License: GPLv2+ and LGPLv2+ Group: System Environment/Daemons URL: http://www.freeradius.org/ Source0: ftp://ftp.freeradius.org/pub/radius/freeradius-server-%{version}.tar.bz2 Source100: freeradius-radiusd-init Source102: freeradius-logrotate Source103: freeradius-pam-conf Patch1: freeradius-cert-config.patch Obsoletes: freeradius-devel Obsoletes: freeradius-libs %define docdir %{_docdir}/freeradius-%{version} %define initddir %{?_initddir:%{_initddir}}%{!?_initddir:%{_initrddir}} BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: autoconf BuildRequires: gdbm-devel BuildRequires: libtool BuildRequires: libtool-ltdl-devel BuildRequires: make BuildRequires: openssl-devel BuildRequires: pam-devel BuildRequires: zlib-devel BuildRequires: net-snmp-devel BuildRequires: net-snmp-utils BuildRequires: readline-devel BuildRequires: libpcap-devel Requires(pre): shadow-utils glibc-common Requires(post): /sbin/chkconfig Requires(preun): /sbin/chkconfig %description The FreeRADIUS Server Project is a high performance and highly configurable GPL'd free RADIUS server. The server is similar in some respects to Livingston's 2.0 server. While FreeRADIUS started as a variant of the Cistron RADIUS server, they don't share a lot in common any more. It now has many more features than Cistron or Livingston, and is much more configurable. FreeRADIUS is an Internet authentication daemon, which implements the RADIUS protocol, as defined in RFC 2865 (and others). It allows Network Access Servers (NAS boxes) to perform authentication for dial-up users. There are also RADIUS clients available for Web servers, firewalls, Unix logins, and more. Using RADIUS allows authentication and authorization for a network to be centralized, and minimizes the amount of re-configuration which has to be done when adding or deleting new users. %package utils Group: System Environment/Daemons Summary: FreeRADIUS utilities Requires: %{name} = %{version}-%{release} Requires: libpcap >= 0.9.4 %description utils The FreeRADIUS server has a number of features found in other servers, and additional features not found in any other server. Rather than doing a feature by feature comparison, we will simply list the features of the server, and let you decide if they satisfy your needs. Support for RFC and VSA Attributes Additional server configuration attributes Selecting a particular configuration Authentication methods %package ldap Summary: LDAP support for freeradius Group: System Environment/Daemons Requires: %{name} = %{version}-%{release} BuildRequires: openldap-devel %description ldap This plugin provides the LDAP support for the FreeRADIUS server project. %package krb5 Summary: Kerberos 5 support for freeradius Group: System Environment/Daemons Requires: %{name} = %{version}-%{release} BuildRequires: krb5-devel %description krb5 This plugin provides the Kerberos 5 support for the FreeRADIUS server project. %package perl Summary: Perl support for freeradius Group: System Environment/Daemons Requires: %{name} = %{version}-%{release} Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version)) %{?fedora:BuildRequires: perl-devel} %if 0%{?rhel} <= 5 BuildRequires: perl %endif %if 0%{?rhel} >= 6 BuildRequires: perl-devel %endif BuildRequires: perl(ExtUtils::Embed) %description perl This plugin provides the Perl support for the FreeRADIUS server project. %package python Summary: Python support for freeradius Group: System Environment/Daemons Requires: %{name} = %{version}-%{release} BuildRequires: python-devel %description python This plugin provides the Python support for the FreeRADIUS server project. %package mysql Summary: MySQL support for freeradius Group: System Environment/Daemons Requires: %{name} = %{version}-%{release} BuildRequires: mysql-devel %description mysql This plugin provides the MySQL support for the FreeRADIUS server project. %package postgresql Summary: Postgresql support for freeradius Group: System Environment/Daemons Requires: %{name} = %{version}-%{release} BuildRequires: postgresql-devel %description postgresql This plugin provides the postgresql support for the FreeRADIUS server project. %package unixODBC Summary: Unix ODBC support for freeradius Group: System Environment/Daemons Requires: %{name} = %{version}-%{release} BuildRequires: unixODBC-devel %description unixODBC This plugin provides the unixODBC support for the FreeRADIUS server project. %prep %setup -q -n freeradius-server-%{version} %patch1 -p1 -b .cert-config # Some source files mistakenly have execute permissions set find $RPM_BUILD_DIR/freeradius-server-%{version} \( -name '*.c' -o -name '*.h' \) -a -perm /0111 -exec chmod a-x {} + %build %ifarch s390 s390x export CFLAGS="$RPM_OPT_FLAGS -fPIC" %else export CFLAGS="$RPM_OPT_FLAGS -fpic" %endif %configure \ --libdir=%{_libdir}/freeradius \ --with-system-libtool \ --with-system-libltdl \ --disable-ltdl-install \ --with-udpfromto \ --with-gnu-ld \ --with-threads \ --with-thread-pool \ --with-docdir=%{docdir} \ --with-rlm-sql_postgresql-include-dir=/usr/include/pgsql \ --with-rlm-sql-postgresql-lib-dir=%{_libdir} \ --with-rlm-sql_mysql-include-dir=/usr/include/mysql \ --with-mysql-lib-dir=%{_libdir}/mysql \ --with-unixodbc-lib-dir=%{_libdir} \ --with-rlm-dbm-lib-dir=%{_libdir} \ --with-rlm-krb5-include-dir=/usr/kerberos/include \ --with-modules="rlm_wimax" \ --without-rlm_eap_ikev2 \ --without-rlm_sql_iodbc \ --without-rlm_sql_firebird \ --without-rlm_sql_db2 \ --without-rlm_sql_oracle %if "%{_lib}" == "lib64" perl -pi -e 's:sys_lib_search_path_spec=.*:sys_lib_search_path_spec="/lib64 /usr/lib64 /usr/local/lib64":' libtool %endif make LINK_MODE=-pie %install mkdir -p $RPM_BUILD_ROOT/%{_localstatedir}/lib/radiusd # fix for bad libtool bug - can not rebuild dependent libs and bins #FIXME export LD_LIBRARY_PATH=$RPM_BUILD_ROOT/%{_libdir} make install R=$RPM_BUILD_ROOT # modify default configuration RADDB=$RPM_BUILD_ROOT%{_sysconfdir}/raddb perl -i -pe 's/^#user =.*$/user = radiusd/' $RADDB/radiusd.conf perl -i -pe 's/^#group =.*$/group = radiusd/' $RADDB/radiusd.conf # logs mkdir -p $RPM_BUILD_ROOT/var/log/radius/radacct touch $RPM_BUILD_ROOT/var/log/radius/{radutmp,radius.log} install -D -m 755 %{SOURCE100} $RPM_BUILD_ROOT/%{initddir}/radiusd install -D -m 644 %{SOURCE102} $RPM_BUILD_ROOT/%{_sysconfdir}/logrotate.d/radiusd install -D -m 644 %{SOURCE103} $RPM_BUILD_ROOT/%{_sysconfdir}/pam.d/radiusd mkdir -p %{buildroot}%{_localstatedir}/run/ install -d -m 0710 %{buildroot}%{_localstatedir}/run/radiusd/ # remove unneeded stuff rm -rf doc/00-OLD rm -f $RPM_BUILD_ROOT/usr/sbin/rc.radiusd rm -rf $RPM_BUILD_ROOT/%{_libdir}/freeradius/*.a rm -rf $RPM_BUILD_ROOT/%{_libdir}/freeradius/*.la rm -rf $RPM_BUILD_ROOT/%{_sysconfdir}/raddb/sql/mssql rm -rf $RPM_BUILD_ROOT/%{_sysconfdir}/raddb/sql/oracle rm -rf $RPM_BUILD_ROOT/%{_datadir}/dialup_admin/sql/oracle rm -rf $RPM_BUILD_ROOT/%{_datadir}/dialup_admin/lib/sql/oracle rm -rf $RPM_BUILD_ROOT/%{_datadir}/dialup_admin/lib/sql/drivers/oracle # remove header files, we don't ship a devel package and the # headers have multilib conflicts rm -rf $RPM_BUILD_ROOT/%{_includedir} # remove unsupported config files rm -f $RPM_BUILD_ROOT/%{_sysconfdir}/raddb/experimental.conf # install doc files omitted by standard install for f in COPYRIGHT CREDITS INSTALL README.rst; do cp $f $RPM_BUILD_ROOT/%{docdir} done cp LICENSE $RPM_BUILD_ROOT/%{docdir}/LICENSE.gpl cp src/lib/LICENSE $RPM_BUILD_ROOT/%{docdir}/LICENSE.lgpl cp src/LICENSE.openssl $RPM_BUILD_ROOT/%{docdir}/LICENSE.openssl # add Red Hat specific documentation cat >> $RPM_BUILD_ROOT/%{docdir}/REDHAT << EOF Red Hat, RHEL, Fedora, and CentOS specific information can be found on the FreeRADIUS Wiki in the Red Hat FAQ. http://wiki.freeradius.org/guide/Red_Hat_FAQ Please reference that document. EOF # Make sure our user/group is present prior to any package or subpackage installation %pre getent group radiusd >/dev/null || /usr/sbin/groupadd -r -g 95 radiusd > /dev/null 2>&1 getent passwd radiusd >/dev/null || /usr/sbin/useradd -r -g radiusd -u 95 -c "radiusd user" -s /sbin/nologin radiusd > /dev/null 2>&1 exit 0 %post if [ $1 -eq 1 ]; then # install /sbin/chkconfig --add radiusd if [ ! -e /etc/raddb/certs/server.pem ]; then /sbin/runuser -g radiusd -c 'umask 007; /etc/raddb/certs/bootstrap' > /dev/null 2>&1 fi fi exit 0 %preun if [ $1 -eq 0 ]; then # uninstall /sbin/service radiusd stop > /dev/null 2>&1 /sbin/chkconfig --del radiusd fi exit 0 %postun if [ $1 -ge 1 ]; then # upgrade /sbin/service radiusd condrestart >/dev/null 2>&1 fi if [ $1 -eq 0 ]; then # uninstall getent passwd radiusd >/dev/null && /usr/sbin/userdel radiusd > /dev/null 2>&1 getent group radiusd >/dev/null && /usr/sbin/groupdel radiusd > /dev/null 2>&1 fi exit 0 %files %defattr(-,root,root) %doc %{docdir}/ %config(noreplace) %{_sysconfdir}/pam.d/radiusd %config(noreplace) %{_sysconfdir}/logrotate.d/radiusd %{initddir}/radiusd %dir %attr(710,radiusd,radiusd) %{_localstatedir}/run/radiusd %dir %attr(755,radiusd,radiusd) %{_localstatedir}/lib/radiusd # configs %dir %attr(755,root,radiusd) /etc/raddb %defattr(-,root,radiusd) %attr(644,root,radiusd) %config(noreplace) /etc/raddb/dictionary %config(noreplace) /etc/raddb/acct_users %config(noreplace) /etc/raddb/attrs %config(noreplace) /etc/raddb/attrs.access_challenge %config(noreplace) /etc/raddb/attrs.access_reject %config(noreplace) /etc/raddb/attrs.accounting_response %config(noreplace) /etc/raddb/attrs.pre-proxy %dir %attr(770,root,radiusd) /etc/raddb/certs %attr(750,root,radiusd) /etc/raddb/certs/bootstrap %config(noreplace) /etc/raddb/certs/Makefile %config(noreplace) /etc/raddb/certs/README %config(noreplace) /etc/raddb/certs/xpextensions %attr(640,root,radiusd) %config(noreplace) /etc/raddb/certs/*.cnf %attr(640,root,radiusd) %config(noreplace) /etc/raddb/clients.conf %attr(640,root,radiusd) %config(noreplace) /etc/raddb/eap.conf %config(noreplace) %attr(640,root,radiusd) /etc/raddb/example.pl %config(noreplace) /etc/raddb/hints %config(noreplace) /etc/raddb/huntgroups %config(noreplace) /etc/raddb/ldap.attrmap %dir %attr(750,root,radiusd) /etc/raddb/modules %attr(640,root,radiusd) %config(noreplace) /etc/raddb/modules/* %attr(640,root,radiusd) %config(noreplace) /etc/raddb/panic.gdb %attr(640,root,radiusd) %config(noreplace) /etc/raddb/policy.conf %config(noreplace) /etc/raddb/policy.txt %attr(640,root,radiusd) %config(noreplace) /etc/raddb/preproxy_users %attr(640,root,radiusd) %config(noreplace) /etc/raddb/proxy.conf %attr(640,root,radiusd) %config(noreplace) /etc/raddb/radiusd.conf %dir %attr(750,root,radiusd) /etc/raddb/sql %dir %attr(750,root,radiusd) /etc/raddb/sql/* %attr(640,root,radiusd) %config(noreplace) /etc/raddb/sql/*/* %attr(640,root,radiusd) %config(noreplace) /etc/raddb/sql.conf %attr(640,root,radiusd) %config(noreplace) /etc/raddb/sqlippool.conf %dir %attr(750,root,radiusd) /etc/raddb/sites-available %attr(640,root,radiusd) %config(noreplace) /etc/raddb/sites-available/* %dir %attr(750,root,radiusd) /etc/raddb/sites-enabled %attr(640,root,radiusd) %config(noreplace) /etc/raddb/sites-enabled/* %attr(640,root,radiusd) %config(noreplace) /etc/raddb/templates.conf %attr(640,root,radiusd) %config(noreplace) /etc/raddb/users # binaries %defattr(-,root,root) /usr/sbin/* # man-pages %doc %{_mandir}/man5/* %doc %{_mandir}/man8/* # dictionaries %dir %attr(755,root,root) /usr/share/freeradius /usr/share/freeradius/* # logs %dir %attr(700,radiusd,radiusd) /var/log/radius/ %dir %attr(700,radiusd,radiusd) /var/log/radius/radacct/ %ghost %attr(644,radiusd,radiusd) /var/log/radius/radutmp %ghost %attr(600,radiusd,radiusd) /var/log/radius/radius.log # RADIUS shared libs %attr(755,root,root) %{_libdir}/freeradius/lib*.so* # RADIUS Loadable Modules %dir %attr(755,root,root) %{_libdir}/freeradius %{_libdir}/freeradius/rlm_*.so %files utils /usr/bin/* # man-pages %doc %{_mandir}/man1/* %files krb5 %files perl %files python %files mysql %files postgresql %files ldap %files unixODBC %changelog * Thu May 9 2013 Fajar A. Nugraha - 2.2.1-1 - bump version number to 2.2.1 - package everything in only two RPM: freeradius and freeradius-utils - adapted spec file to be more generic * Tue Apr 10 2012 John Dennis - 2.1.12-2 - resolves: bug#810605 Segfault with freeradius-perl threading freeradius-server/scripts/000077500000000000000000000000001257552170400162125ustar00rootroot00000000000000freeradius-server/scripts/.gitignore000066400000000000000000000001461257552170400202030ustar00rootroot00000000000000check-radiusd-config cryptpasswd radiusd.cron.daily radiusd.cron.monthly radwatch rc.radiusd radcrypt freeradius-server/scripts/Makefile000066400000000000000000000005261257552170400176550ustar00rootroot00000000000000# $Id$ include ../Make.inc all: radwatch: $(INSTALL) -m 755 radwatch $(R)$(sbindir) install: $(INSTALL) -m 755 rc.radiusd $(R)$(sbindir) $(INSTALL) -m 755 radsqlrelay $(R)$(bindir) $(INSTALL) -m 755 radwatch $(R)$(sbindir) $(INSTALL) -m 755 raddebug $(R)$(sbindir) $(INSTALL) -m 755 cryptpasswd $(R)$(bindir)/radcrypt clean: freeradius-server/scripts/clients.pl000077500000000000000000000031131257552170400202110ustar00rootroot00000000000000#!/usr/bin/env perl # # Convert old-style "clients" file to new "clients.conf" format. # # Usage: clients.pl clients [naslist] new-clients.conf # The "new-clients.conf" will be created if it does not exist. # If it does exist, it will be over-written. # # # $Id$ # if (($#ARGV < 1) || ($#ARGV > 2)) { print "Usage: clients.pl clients [naslist] new-clients.conf\n"; print " The \"new-clients.conf\" will be created if it does not exist.\n"; print " If it does exist, it will be over-written.\n"; exit(1); } $old = shift; $new = shift; if ($new =~ /naslist/) { $naslist = $new; $new = shift; } open OLD, "< $old" or die "Failed to open $old: $!\n"; while () { next if (/^\s*\#/); next if (/^\s*$/); split; $clients{$_[0]}{"secret"} = $_[1]; } close OLD; if (defined $naslist) { open OLD, "< $naslist" or die "Failed to open $naslist: $!\n"; while () { next if (/^\s*\#/); next if (/^\s*$/); split; if (!defined $clients{$_[0]}) { print "WARNING! client $_[0] is defined in naslist, but not in clients!"; next; } $clients{$_[0]}{"shortname"} = $_[1]; $clients{$_[0]}{"nastype"} = $_[2]; } } open NEW, "> $new" or die "Failed to open $new: $!\n"; foreach $client (keys %clients) { print NEW "client $client {\n"; print NEW "\tsecret = ", $clients{$client}{"secret"}, "\n"; if (defined $clients{$client}{"shortname"}) { print NEW "\tshortname = ", $clients{$client}{"shortname"}, "\n"; print NEW "\tnastype = ", $clients{$client}{"nastype"}, "\n"; } print NEW "}\n"; print NEW "\n"; } freeradius-server/scripts/create-users.pl000077500000000000000000000033701257552170400211570ustar00rootroot00000000000000#!/usr/bin/perl # Purpose: create lots of random users and passes # for testing your radius server # Read doc/README.testing for more information $passfile = "./passwd"; $shadfile = "./shadow"; $radfile = "./radius.test"; $nocrypt = "./passwd.nocrypt"; $users = "./radius.users"; if($ARGV[0] eq "") { print "\n\tUsage: $0 \n\n"; exit(1); } else { $numusers = $ARGV[0]; } $userlen = 6; $passlen = 6; open(PASS, ">$passfile") || die "Can't open $passfile"; open(SHAD, ">$shadfile") || die "Can't open $shadfile"; open(RAD, ">$radfile") || die "Can't open $radfile"; open(NOCRYPT, ">$nocrypt") || die "Can't open $nocrypt"; open(USERS, ">$users") || die "Can't open $users"; for ($num=0; $num<$numusers; $num++) { # generate username $username = ""; for($i=0; $i # # $Id$ # use Getopt::Long; sub check_des { return (crypt("fnord", "aa") =~ m/^aa/); } sub check_md5 { return (crypt("fnord", "\$1\$aa") =~ m/^\$1\$/); } sub usage { $name = $0; $name =~ s,.*/,,; die "Usage: $name [--des|--md5|--check] plaintext_password [crypted_password]\n"; } @saltc = ( '.', '/', '0'..'9', 'A'..'Z', 'a'..'z' ); # # MAIN # sub main { Getopt::Long::Configure("no_ignore_case", "bundling"); my @options = ( "des|d+", "md5|m+", "check|c+" ); usage() unless (eval { Getopt::Long::GetOptions(@options) } ); if ($opt_check) { usage unless ($#ARGV == 1); if (crypt($ARGV[0], $ARGV[1]) ne $ARGV[1]) { print "Password BAD\n"; return 0; } else { print "Password OK\n"; return 1; } } $opt_des = 1 unless ($opt_des || $opt_md5); usage() unless ($#ARGV == 0); die "DES password hashing not available\n" if ($opt_des && !check_des()); die "MD5 password hashing not available\n" if ($opt_md5 && !check_md5()); $salt = ($opt_md5 ? '$1$' : ''); for ($i = 0; $i < ($opt_md5 ? 8 : 2); $i++) { $salt .= $saltc[rand 64]; } $salt .= '$' if ($opt_md5); print crypt($ARGV[0], $salt), "\n"; 1; } exit !main(); freeradius-server/scripts/exec-program-wait000077500000000000000000000037111257552170400214750ustar00rootroot00000000000000#!/bin/sh # # $Id$ # # Sample script to add Attribute/Value pairs in the reply sent to # the NAS. # # Before version 2.0 of FreeRADIUS, the script could be run from the # deprecated attributes 'Exec-Program' and 'Exec-Program-Wait'. # However, these attributes are no longer supported and you have to # use the module 'rlm_exec' instead. # # An entry for the module 'rlm_exec' must be added to the file # 'radiusd.conf' with the path of the script. # #modules { # exec { # program = "/path/to/program/exec-program-wait" # wait = yes # input_pairs = request # output_pairs = reply # } # ... #} # #authorize { # ... # exec # ... #} # # Each of the attributes in the request will be available in an # environment variable. The name of the variable depends on the # name of the attribute. All letters are converted to upper case, # and all hyphens '-' to underlines. # # For example, the User-Name attribute will be in the $USER_NAME # environment variable. If you want to see the list of all of # the variables, try adding a line 'printenv > /tmp/exec-program-wait' # to the script. Then look in the file for a complete list of # variables. # # The return value of the program run determines the result # of the exec instance call as follows: # (See doc/configurable_failover for details) # < 0 : fail the module failed # = 0 : okthe module succeeded # = 1 : reject the module rejected the user # = 2 : fail the module failed # = 3 : okthe module succeeded # = 4 : handled the module has done everything to handle the request # = 5 : invalid the user's configuration entry was invalid # = 6 : userlock the user was locked out # = 7 : notfound the user was not found # = 8 : noop the module did nothing # = 9 : updated the module updated information in the request # > 9 : fail the module failed # echo "Reply-Message += \"Hello, %u\"," echo "Reply-Message += \"PATH=$PATH\"," echo Framed-IP-Address = 255.255.255.255 exit 0 freeradius-server/scripts/freeradius.monitrc000066400000000000000000000012341257552170400217400ustar00rootroot00000000000000# # Script for use with Monit # # http://mmonit.com/monit/ # # # Totalmem limit should be lowered to 200.0 if none of the # interpreted language modules or rlm_cache are being used. # check process radiusd with pidfile /var/run/radiusd/radiusd.pid start program = "/etc/init.d/radiusd start" stop program = "/etc/init.d/radiusd stop" if failed host 127.0.0.1 port 1812 type udp protocol radius secret testing123 then alert if failed host 127.0.0.1 port 1813 type udp protocol radius secret testing123 then alert if cpu > 95% for 2 cycles then alert if totalmem > 1024.0 MB for 5 cycles then restart if 5 restarts within 5 cycles then timeout freeradius-server/scripts/freeradius_acct000077500000000000000000000054431257552170400212710ustar00rootroot00000000000000#!/bin/sh # # Plugin to count the daily amount of freeradius authentication packets. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA # # Copyright (C) 2008 Alan DeKok # # Magic markers - optional - used by installation scripts and # munin-config: # #%# family=manual #%# capabilities=autoconf RADMIN=radmin SOCKETFILE=/var/run/radiusd/radiusd.sock if [ "$1" = "autoconf" ]; then # # FIXME: Check if FreeRADIUS is running. # echo yes exit 0 fi if [ "$1" = "config" ]; then echo 'graph_title FreeRADIUS Accounting Requests' echo 'graph_args --base 1000 -l 0 ' echo 'graph_period second' echo 'graph_vlabel requests / ${graph_period}' echo 'graph_category Other' echo 'requests.label Accounting-Requests' echo 'requests.info total received request packets' echo 'requests.type DERIVE' echo 'requests.min 0' echo 'responses.label Accounting-Responses' echo 'responses.info total sent response packets' echo 'responses.type DERIVE' echo 'responses.min 0' echo 'dup.label Duplicate requests' echo 'dup.info total duplicate request packets' echo 'dup.type DERIVE' echo 'dup.min 0' echo 'invalid.label Invalid requests' echo 'invalid.info total invalid request packets' echo 'invalid.type DERIVE' echo 'invalid.min 0' echo 'malformed.label Malformed requests' echo 'malformed.info total malformed request packets' echo 'malformed.type DERIVE' echo 'malformed.min 0' echo 'bad_signature.label Requests with bad signature' echo 'bad_signature.info total request packets with a bad signature' echo 'bad_signature.type DERIVE' echo 'bad_signature.min 0' echo 'dropped.label Dropped requests' echo 'dropped.info total request packets dropped for other reasons' echo 'dropped.type DERIVE' echo 'dropped.min 0' echo 'unknown_types.label Unknown type' echo 'unknown_types.info total request packets of unknown type' echo 'unknown_types.type DERIVE' echo 'unknown_types.min 0' exit 0 fi $RADMIN -f $SOCKETFILE -e "stats client acct" | awk '{print $1".value " $2}' freeradius-server/scripts/freeradius_auth000077500000000000000000000064041257552170400213160ustar00rootroot00000000000000#!/bin/sh # # Plugin to count the daily amount of freeradius authentication packets. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA # # Copyright (C) 2008 Alan DeKok # # Magic markers - optional - used by installation scripts and # munin-config: # #%# family=manual #%# capabilities=autoconf RADMIN=radmin SOCKETFILE=/var/run/radiusd/radiusd.sock if [ "$1" = "autoconf" ]; then # # FIXME: Check if FreeRADIUS is running. # echo yes exit 0 fi if [ "$1" = "config" ]; then echo 'graph_title FreeRADIUS Authentication Requests' echo 'graph_args --base 1000 -l 0 ' echo 'graph_period second' echo 'graph_vlabel requests / ${graph_period}' echo 'graph_category Other' echo 'requests.label Access-Requests' echo 'requests.info total received request packets' echo 'requests.type DERIVE' echo 'requests.min 0' echo 'responses.label responses (all types)' echo 'responses.info total sent response packets' echo 'responses.type DERIVE' echo 'responses.min 0' echo 'accepts.label Access-Accepts' echo 'accepts.info total sent Access-Accept packets' echo 'accepts.type DERIVE' echo 'accepts.min 0' echo 'rejects.label Access-Rejects' echo 'rejects.info total sent Access-Reject packets' echo 'rejects.type DERIVE' echo 'rejects.min 0' echo 'challenges.label Access-Challenges' echo 'challenges.info total sent Access-Challenge packets' echo 'challenges.type DERIVE' echo 'challenges.min 0' echo 'dup.label Duplicate requests' echo 'dup.info total duplicate request packets' echo 'dup.type DERIVE' echo 'dup.min 0' echo 'invalid.label Invalid requests' echo 'invalid.info total invalid request packets' echo 'invalid.type DERIVE' echo 'invalid.min 0' echo 'malformed.label Malformed requests' echo 'malformed.info total malformed request packets' echo 'malformed.type DERIVE' echo 'malformed.min 0' echo 'bad_signature.label Requests with bad signature' echo 'bad_signature.info total request packets with a bad signature' echo 'bad_signature.type DERIVE' echo 'bad_signature.min 0' echo 'dropped.label Dropped requests' echo 'dropped.info total request packets dropped for other reasons' echo 'dropped.type DERIVE' echo 'dropped.min 0' echo 'unknown_types.label Unknown type' echo 'unknown_types.info total request packets of unknown type' echo 'unknown_types.type DERIVE' echo 'unknown_types.min 0' exit 0 fi $RADMIN -f $SOCKETFILE -e "stats client auth" | awk '{print $1".value " $2}' freeradius-server/scripts/freeradius_proxy_acct000077500000000000000000000054531257552170400225330ustar00rootroot00000000000000#!/bin/sh # # Plugin to count the daily amount of freeradius authentication packets. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA # # Copyright (C) 2008 Alan DeKok # # Magic markers - optional - used by installation scripts and # munin-config: # #%# family=manual #%# capabilities=autoconf RADMIN=radmin SOCKETFILE=/var/run/radiusd/radiusd.sock if [ "$1" = "autoconf" ]; then # # FIXME: Check if FreeRADIUS is running. # echo yes exit 0 fi if [ "$1" = "config" ]; then echo 'graph_title FreeRADIUS Proxied Accounting Requests' echo 'graph_args --base 1000 -l 0 ' echo 'graph_period second' echo 'graph_vlabel requests / ${graph_period}' echo 'graph_category Other' echo 'requests.label Accounting-Requests' echo 'requests.info total sent request packets' echo 'requests.type DERIVE' echo 'requests.min 0' echo 'responses.label Accounting-Responses' echo 'responses.info total received response packets' echo 'responses.type DERIVE' echo 'responses.min 0' echo 'dup.label Duplicate requests' echo 'dup.info total duplicate request packets' echo 'dup.type DERIVE' echo 'dup.min 0' echo 'invalid.label Invalid requests' echo 'invalid.info total invalid request packets' echo 'invalid.type DERIVE' echo 'invalid.min 0' echo 'malformed.label Malformed requests' echo 'malformed.info total malformed request packets' echo 'malformed.type DERIVE' echo 'malformed.min 0' echo 'bad_signature.label Requests with bad signature' echo 'bad_signature.info total request packets with a bad signature' echo 'bad_signature.type DERIVE' echo 'bad_signature.min 0' echo 'dropped.label Dropped requests' echo 'dropped.info total request packets dropped for other reasons' echo 'dropped.type DERIVE' echo 'dropped.min 0' echo 'unknown_types.label Unknown type' echo 'unknown_types.info total request packets of unknown type' echo 'unknown_types.type DERIVE' echo 'unknown_types.min 0' exit 0 fi $RADMIN -f $SOCKETFILE -e "stats client acct" | awk '{print $1".value " $2}' freeradius-server/scripts/freeradius_proxy_auth000077500000000000000000000064361257552170400225640ustar00rootroot00000000000000#!/bin/sh # # Plugin to count the daily amount of freeradius authentication packets. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA # # Copyright (C) 2008 Alan DeKok # # Magic markers - optional - used by installation scripts and # munin-config: # #%# family=manual #%# capabilities=autoconf RADMIN=radmin SOCKETFILE=/var/run/radiusd/radiusd.sock if [ "$1" = "autoconf" ]; then # # FIXME: Check if FreeRADIUS is running. # echo yes exit 0 fi if [ "$1" = "config" ]; then echo 'graph_title FreeRADIUS Proxied Authentication Requests' echo 'graph_args --base 1000 -l 0 ' echo 'graph_period second' echo 'graph_vlabel requests / ${graph_period}' echo 'graph_category Other' echo 'requests.label Access-Requests' echo 'requests.info total sent request packets' echo 'requests.type DERIVE' echo 'requests.min 0' echo 'responses.label responses (all types)' echo 'responses.info total received response packets' echo 'responses.type DERIVE' echo 'responses.min 0' echo 'accepts.label Access-Accepts' echo 'accepts.info total received Access-Accept packets' echo 'accepts.type DERIVE' echo 'accepts.min 0' echo 'rejects.label Access-Rejects' echo 'rejects.info total received Access-Reject packets' echo 'rejects.type DERIVE' echo 'rejects.min 0' echo 'challenges.label Access-Challenges' echo 'challenges.info total received Access-Challenge packets' echo 'challenges.type DERIVE' echo 'challenges.min 0' echo 'dup.label Duplicate requests' echo 'dup.info total duplicate request packets' echo 'dup.type DERIVE' echo 'dup.min 0' echo 'invalid.label Invalid requests' echo 'invalid.info total invalid request packets' echo 'invalid.type DERIVE' echo 'invalid.min 0' echo 'malformed.label Malformed requests' echo 'malformed.info total malformed request packets' echo 'malformed.type DERIVE' echo 'malformed.min 0' echo 'bad_signature.label Requests with bad signature' echo 'bad_signature.info total request packets with a bad signature' echo 'bad_signature.type DERIVE' echo 'bad_signature.min 0' echo 'dropped.label Dropped requests' echo 'dropped.info total request packets dropped for other reasons' echo 'dropped.type DERIVE' echo 'dropped.min 0' echo 'unknown_types.label Unknown type' echo 'unknown_types.info total request packets of unknown type' echo 'unknown_types.type DERIVE' echo 'unknown_types.min 0' exit 0 fi $RADMIN -f $SOCKETFILE -e "stats home_server auth" | awk '{print $1".value " $2}' freeradius-server/scripts/git/000077500000000000000000000000001257552170400167755ustar00rootroot00000000000000freeradius-server/scripts/git/post-receive000077500000000000000000000063401257552170400213330ustar00rootroot00000000000000#!/bin/sh # git Post-receive configuration update script # # To install: # * Enable r/w control socket for the user you're pushing with # * cd /raddb git config receive.denyCurrentBranch ignore # * cp ./post-receive /raddb/.git/hooks/ # * # Edit the capitalized variables below to match your environment. # # Copyright 2012 Arran Cudbard-Bell # Tag to update when we successfully manage to start the server with a new configuration : ${STABLE_TAG='stable'} # Descriptive name of daemon : ${DAEMON_DESC='FreeRADIUS'} # Command used to restart the RADIUS daemon : ${DAEMON_REST='radmin -e hup'} # Command used to verify the new configuration : ${DAEMON_CONF='radiusd -Cxl stdout'} # Command used to execute git functions : ${GIT_EXEC='env -i git'} # Abort if there are local untracked files : ${ABORT_UNTRACKED=true} # Push changes to any remotes we have configured : ${PUSH_TO_REMOTES=false} while read oldrev newrev refname do : done status () { if [ $1 -ne 0 ]; then echo "failed" else echo "ok" fi } conf_rollback () { # Use stable tag if it exists... if $GIT_EXEC show-ref $STABLE_TAG > /dev/null 2>&1; then echo -n "Attempting to roll config back to tag: \"$STABLE_TAG\"... " $GIT_EXEC reset -q --hard $STABLE_TAG; ret=$? else echo -n "Attempting to roll config back to commit: \"$oldrev\"... " $GIT_EXEC reset -q --hard $oldrev; ret=$? fi status $ret return $ret } conf_check () { echo -n "Checking new configuration... " $DAEMON_CONF; ret=$? status $ret return $ret } daemon_restart () { echo -n "Restarting server... " $DAEMON_REST > /dev/null 2>&1; ret=$? status $ret return $ret } # Reset the current working directory state cd .. # Friendly update of working copy to head state $GIT_EXEC checkout -f if $ABORT_UNTRACKED && [ `$GIT_EXEC status --porcelain | wc -l` -gt 0 ]; then echo "WARNING: Untracked changes have been made to this git repository," echo "changes have been committed but untracked files should be removed," echo "committed or added to .gitignore and $DAEMON_DESC restarted manually." $GIT_EXEC status --short if ! conf_check then exit 64 fi echo "WARNING: $DAEMON_DESC found errors in the configuration," echo "these errors should be corrected before updating working copy." exit 65 fi # Clean out all untracked files and directories (if there are local files you # wish to keep, they should be add to .gitignore) if ! $GIT_EXEC clean -d -f then exit $? fi # Reset all tracked files to the HEAD state if ! $GIT_EXEC reset --hard then exit $? fi # Check if the server finds any errors in the new config if ! conf_check then echo "WARNING: $DAEMON_DESC found errors in the configuration," echo "please fix the errors and push the corrected configuration." conf_rollback exit 64 else if ! daemon_restart; then if ! conf_rollback; then echo "WARNING: Manually verify $DAEMON_DESC status immediately!" exit 64 fi if ! daemon_restart; then echo "WARNING: Manually verify $DAEMON_DESC status immediately!" exit 64 fi exit 64 fi $GIT_EXEC tag -f $STABLE_TAG $newrev fi if $PUSH_TO_REMOTES; then echo "Pushing to remote repositories" for remote in `$GIT_EXEC remote`; do $GIT_EXEC push "$remote" done fi exit 0 freeradius-server/scripts/isc2ippool.pl000077500000000000000000000114071257552170400206400ustar00rootroot00000000000000#!/usr/bin/perl # isc2ippool Insert ISC DHCPD lease entries into SQL database (ippool). # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA # # Copyright (C) 2012 Arran Cudbard-Bell (a.cudbardb@freeradius.org) use warnings; use strict; use DateTime; use DateTime::Format::Strptime; use DateTime::Format::DBI; use Getopt::Long; use Text::DHCPLeases; use DBI; my $lease_file = '/var/db/dhcpd.leases'; my $sql_type = 'mysql'; my $sql_host = 'localhost'; my $sql_user = 'radius'; my $sql_pass = 'radpass'; my $sql_database = 'radius'; my $sql_table = 'radippool'; my $pool_name = ''; my $pool_key = 'Calling-Station-Id'; my $insert_only = 0; my $verbose; my $help; sub error { print STDERR @_, "\n"; exit(64); } sub notice { if ($verbose) { printf(shift . "\n", @_); } } sub help { my @this = split('/', $0); print < Options: -leases - The lease file to parse (defaults to '$lease_file') -pool-key - The attribute used to identify the user (defaults to '$pool_key') -no-update - Don't update existing lease entries -type - SQL database type (defaults to '$sql_type') -table - SQL table (defaults to '$sql_table') -h | -host - SQL host to connect to -u | -user - SQL user -p | -pass - SQL password -v - Verbose -help - This help text HELP ; exit(0); } GetOptions ( 'leases=s' => \$lease_file, 'pool-key=s' => \$pool_key, 'no-update' => \$insert_only, 'type=s' => \$sql_type, 'table=s' => \$sql_table, 'h|host=s' => \$sql_host, 'u|user=s' => \$sql_user, 'p|pass=s' => \$sql_pass, 'v' => \$verbose, 'help' => \$help ) or error('Failed parsing options'); # # Poolname must be provided, and we need at least some arguments... # help if !scalar @ARGV or ($pool_name = $ARGV[$#ARGV]) =~ /^-/; -r $lease_file or error("Lease file ($lease_file) doesn\'t exist or isn't readable"); my $leases = Text::DHCPLeases->new(file => $lease_file) or error("Failed parsing leases file (or lease file empty)"); my $handle = DBI->connect( "DBI:$sql_type:database=$sql_database;host=$sql_host", $sql_user, $sql_pass, {RaiseError => 1} ); my $dt_isc = DateTime::Format::Strptime->new(pattern => '%Y/%m/%d %H:%M:%S'); my $dt_sql = DateTime::Format::DBI->new($handle); for my $lease ($leases->get_objects) { next unless ($lease->binding_state && $lease->binding_state eq 'active'); my($query, @result); eval { $query = $handle->prepare(" SELECT expiry_time, framedipaddress FROM $sql_table WHERE pool_name = ? AND callingstationid = ?;" , undef); $query->bind_param(1, $pool_name); $query->bind_param(2, $lease->mac_address); $query->execute(); @result = $query->fetchrow_array(); }; error($@) if $@; my $ends_isc = $dt_isc->parse_datetime($lease->ends =~ m{^(?:[0-9]+) (.+)}); if (!$query->rows) { eval { $handle->do(" INSERT INTO $sql_table ( pool_name, framedipaddress, calledstationid, callingstationid expiry_time, pool_key) VALUES (?, ?, ?, ?, ?, ?);" , undef , $pool_name , $lease->ip_address , '00:00:00:00:00:00' , $lease->mac_address , $dt_sql->format_datetime($ends_isc) , $pool_key ); }; error($@) if $@; notice("MAC:'%s' inserted with IP:'%s'.", $lease->mac_address, $lease->ip_address); next; } my $ends_sql = $dt_sql->parse_datetime($result[0]); if ($insert_only && (($result[1] ne $lease->ip_address) || (DateTime->compare($ends_sql, $ends_isc) < 0))) { eval { $handle->do(" UPDATE $sql_table SET framedipaddress = ?, expiry_time = ? WHERE pool_name = ? AND callingstationid = ?;" , undef , $lease->ip_address , $dt_sql->format_datetime($ends_isc) , $pool_name , $lease->mac_address ); }; error($@) if $@; notice("MAC:'%s' updated. ISC-TS: '%s', SQL-TS: '%s', ISC-IP: '%s', SQL-IP: '%s'.", $lease->mac_address, $dt_sql->format_datetime($ends_isc), $dt_sql->format_datetime($ends_sql), $lease->ip_address, $result[1]); next; } notice("MAC:'%s' skipped (no update %s). ", $lease->mac_address, $insert_only ? 'allowed' : 'needed'); } exit(0); freeradius-server/scripts/logrotate.freeradius000066400000000000000000000004261257552170400222670ustar00rootroot00000000000000# # Sample logrotate file for FreeRADIUS. # # It needs to be edited for your local configuration. # /var/log/radius/radius.log { daily rotate 14 compress delaycompress missingok notifempty postrotate kill -HUP `cat /var/run/radiusd.pid` > /dev/null 2>&1 endscript } freeradius-server/scripts/min-includes.pl000077500000000000000000000127121257552170400211440ustar00rootroot00000000000000#!/usr/bin/env perl ###################################################################### # # This script find duplicates of #include files, ignoring #ifdef's, etc. # from C source files, and (at your command) removes the duplicates. # # It is meant to be run ONLY by FreeRADUS developers, and has nothing # whatsoever to do with RADIUS, FreeRADIUS, or confguring a RADIUS server. # ###################################################################### # # Run as: ./min-includes.pl `find . -name "*.c" -print` # prints out duplicate includes from files. # # ./min-includes.pl +n `find . -name "*.c" -print` # removes the duplicate includes from each file. # Remember to check that it still builds! # # It has to be run from the TOP of the FreeRADIUS build tree, # i.e. where the top-level "configure" script is located. # ###################################################################### # # FIXME: We don't handle include files taken from the current # directory... # # FIXME: we should take -I from the command line. # ###################################################################### # # Copyright (C) 2006 Alan DeKok # # $Id$ # ###################################################################### my %processed; $any_dups = 0; $debug = 0; # # Find the #include's for one file. # sub process($) { my $file = shift; return if ($processed{$file}); $processed{$file}++; open FILE, "<$file" or die "Failed to open $file: $!\n"; $line = 0; while () { $line++; next if (!/^\s*\#\s*include\s+/); if (/^\s*\#\s*include\s+"(.+?)"/) { $refs{$file}{$1} = $line; # FIXME: local header files? # src/foo/bar.c: #include "foo.h" # src/foo/foo.h do stuff.. $include{$1}++; } elsif (/^\s*\#\s*include\s+<(.+?)>/) { $refs{$file}{$1} = $line; $include{$1}++; } } close FILE; } # # Where include files are located. # # FIXME: # @directories = ("src/lib", "src"); $do_it = 0; # # Horrid. # if ($ARGV[0] eq "+n") { shift; $do_it = 1; } # # Bootstrap the basic C files. # foreach $file (@ARGV) { process($file); } # # Process the include files referenced from the C files, to find out # what they include Note that we create a temporary array, rather # than walking over %include, because the process() function adds # entries to the %include hash. # @work = sort keys %include; foreach $inc (@work) { foreach $dir (@directories) { $path = $dir . "/" . $inc; # normalize path $path =~ s:/.*?/\.\.::; $path =~ s:/.*?/\.\.::; next if (! -e $path); process($path); $forward{$inc} = $path; $reverse{$path} = $inc; # ignore system include files next if ((scalar keys %{$refs{$path}}) == 0); # Remember that X includes Y, and push Y onto the list # of files to scan. foreach $inc2 (sort keys %{$refs{$path}}) { $maps{$inc}{$inc2} = 0; push @work, $inc2; } } } # # Process all of the forward refs, so that we have a complete # list of who's referencing who. # # This doesn't find the shortest path from A to B, but it does # find one path. # foreach $inc (sort keys %maps) { foreach $inc2 (sort keys %{$maps{$inc}}) { foreach $inc3 (sort keys %{$maps{$inc2}}) { # map is already there... next if (defined $maps{$inc}{$inc3}); $maps{$inc}{$inc3} = $maps{$inc2}{$inc3} + 1; } } } # # Walk through the files again, looking for includes that are # unnecessary. Note that we process header files, too. # foreach $file (sort keys %refs) { # print out some debugging information. if ($debug > 0) { if (defined $reverse{$file}) { print $file, "\t(", $reverse{$file}, ")\n"; } else { print $file, "\n"; } } # walk of the list of include's in this file foreach $ref (sort keys %{$refs{$file}}) { # walk over the include files we include, or included by # files that we include. foreach $inc2 (sort keys %{$maps{$ref}}) { # # If we include X, and X includes Y, and we include # Y ourselves *after* X, it's a definite dupe. # # Note that this is a *guaranteed* duplicate. # # Sometimes order matters, so we can't always delete X if # we include Y after X, and Y includes X # if (defined $refs{$file}{$inc2} && ($refs{$file}{$inc2} > $refs{$file}{$ref})) { $duplicate{$file}{$inc2} = $ref; # mark the line to be deleted. $delete_line{$file}{$refs{$file}{$inc2}}++; $any_dups++; } } print "\t", $ref, "\n" if ($debug > 0); } } if ($debug > 0) { print "------------------------------------\n"; } # # Maybe just print out the dups so that a person can validate them. # if (!$do_it) { foreach $file (sort keys %duplicate) { print $file, "\n"; foreach $inc (sort keys %{$duplicate{$file}}) { print "\t[", $refs{$file}{$inc}, "] ", $inc, " (", $duplicate{$file}{$inc}, " at ", $refs{$file}{$duplicate{$file}{$inc}}, ")\n"; } } } else { foreach $file (sort keys %duplicate) { open FILE, "<$file" or die "Failed to open $file: $!\n"; open OUTPUT, ">$file.tmp" or die "Failed to create $file.tmp: $!\n"; $line = 0; while () { $line++; # supposed to delete this line, don't print it to the output. next if (defined $delete_line{$file}{$line}); print OUTPUT; } rename "$file.tmp", $file; } } # If we succeeded in re-writing the files, it's OK. exit 0 if ($do_it); # If there are no duplicates, then we're OK. exit 0 if (!$any_dups); # Else there are duplicates, complain. exit 1 freeradius-server/scripts/raddebug000077500000000000000000000062461257552170400177250ustar00rootroot00000000000000#!/bin/sh ###################################################################### # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA # # Copyright (C) 2009 Network RADIUS SARL # ###################################################################### # # This script assumes that "radmin" is in PATH, and that the user # running this script has permission to connect to the radmin socket, # and to read/write files in the "logdir" directory. If none of this is # true, then it won't work. # # Usage: raddebug [-c condition] [-i client-ip-address] [-I client-ipv6-address] [-f socket_file] [-t timeout] [-u username] # # usage() { printf "Usage: %s: [-c condition] [-d directory] [-i client-ip-address] [-I client-ipv6-address] [-f socket_file] [-t timeout] [-u user]\n" $(basename $0) >&2 exit 2 } extra= condition=1 timeout=60 while getopts 'd:c:i:I:f:t:u:' OPTION do case $OPTION in c) condition="$OPTARG" ;; d) [ "$extra" = "" ] || usage extra="-d $OPTARG" ;; i) condition="(Packet-Src-IP-Address == $OPTARG)" ;; I) condition="(Packet-Src-IPv6-Address == $OPTARG)" ;; f) [ "$extra" = "" ] || usage extra="-f $OPTARG" ;; t) timeout="$OPTARG" [ "$timeout" = "0" ] && timeout=1000000 ;; u) condition="(User-Name == $OPTARG)" ;; ?) usage ;; esac done shift $(($OPTIND - 1)) radmin="radmin $extra" # # Start off by turning off debugging. # If there's a problem, die. # $radmin -e "debug condition" if [ "$?" != "0" ]; then exit 1 fi # # Debug to a file, and then tell us where the file is. # outfile=`$radmin -e "debug file radmin.debug.$$" -e "show debug file"` group=`$radmin -e "debug file radmin.debug.$$" -e "show config group"` # # If there was an error setting the debug output, re-set the # debug condition, echo the error, and exit. # echo $outfile | grep 'ERROR' >/dev/null 2>&1 if [ "$?" = "0" ]; then $radmin -e "debug condition" echo $outfile exit 1 fi # # Truncate the file, and ensure it's writable by radiusd # cp /dev/null $outfile [ "$group" != "" ] && chgrp $group $outfile chmod g+w $outfile TAILPID=$$ # # Set the trap to clean up on exit and any interrupts. # trap '$radmin -e "debug condition" -e "debug file"; rm -f $outfile;kill -TERM $TAILPID;exit 0' 1 2 15 # # Set the debug condition # $radmin -e "debug condition \"$condition\"" # # Print the output, and wait for "timeout". Then, stop printing. # tail -f $outfile & TAILPID=$! sleep $timeout kill -TERM $TAILPID $radmin -e "debug condition" -e "debug file" rm -f $outfile freeradius-server/scripts/radiusd.cron.daily.in000066400000000000000000000007301257552170400222360ustar00rootroot00000000000000#! /bin/sh # # radiusd Cron script to rotate radiusd log files daily. # prefix=@prefix@ localstatedir=@localstatedir@ logdir=@logdir@ umask 027 cd $logdir # Take care of the standard logfiles. cd $logdir if [ -f radius.log ] then savelog -g adm -m 640 -c 3 radius.log > /dev/null fi # Rotate "details" files. if [ ! -d radacct/. ] then exit 0 fi cd radacct for LOG in */detail do if [ -f $LOG ] then savelog -g adm -m 640 -u root -c 3 $LOG >/dev/null fi done freeradius-server/scripts/radiusd.cron.monthly.in000066400000000000000000000004271257552170400226310ustar00rootroot00000000000000#! /bin/sh # # radiusd Cron script to rotate radwtmp file monthly. # prefix=@prefix@ localstatedir=@localstatedir@ logdir=@logdir@ umask 022 cd $logdir # Take care of the standard logfiles. cd $logdir if [ -f radwtmp ] then savelog -g adm -m 644 -c 6 radwtmp > /dev/null fi freeradius-server/scripts/radiusd.sh000066400000000000000000000007461257552170400202100ustar00rootroot00000000000000#!/bin/sh # # The purpose of this script is to forcibly load the *correct* version # of OpenSSL for FreeRADIUS, when you have more than one version of OpenSSL # installed on your system. # # You'll have to edit the directories to the correct location # for your local system. # # $Id$ # LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/ssl/lib:/usr/local/radius/lib LD_PRELOAD=/usr/local/ssl/lib/libcrypto.so export LD_LIBRARY_PATH LD_PRELOAD exec /usr/local/radius/sbin/radiusd $@ freeradius-server/scripts/radiusd2ldif.pl000077500000000000000000000251371257552170400211360ustar00rootroot00000000000000#!/usr/bin/perl # radius2ldif.pl # # To test this program, do the following #Take a radius users' file, for example with: # #myuser Password = "apassword" # User-Service = Framed-User, # Framed-Protocol = PPP, # Framed-Address = 255.255.255.255, # Framed-Netmask = 255.255.255.255, # Ascend-Metric = 2, # Framed-Routing = None, # Framed-Compression = 0, # Ascend-Idle-Limit = 0, # Ascend-Maximum-Time = 36000 # #and do: # #cat users | ./radius2ldif # #Output is: #dn: cn=myuser, ou=Hardware, ou=EDUCAMADRID, ou=People, o=icm.es #objectclass: top #objectclass: person #objectclass: radiusprofile #cn: myuser #sn: myuser #userpassword: apassword #radiusServiceType: Framed-User #radiusFramedProtocol: PPP #radiusFramedIPAddress: 255.255.255.255 #radiusFramedIPNetmask: 255.255.255.255 #radiusFramedRouting: None #radiusFramedCompression: 0 # #dn: ou=RadiusUser, ou=Groups, o=icm.es #description: RadiusUser #objectclass: top #objectclass: groupOfUniqueNames #cn: RadiusUser #uniquemember: dn: cn=myuser, ou=Hardware, ou=EDUCAMADRID, ou=People, o=icm.es # # (c) 2000 Javier Fern'andez-Sanguino Pen~a # ------------------------------------------------------------------------- # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA # ----------------------------------------------------------------------- # TODO: # currently does not encrypt passwords (takes them from outside file) # Command line options # -d : debugging output # -p : give only password # -m : set entry to modify ldap attributes # -f : read encrypted passwords from file use Getopt::Std; getopts('dpmf:'); $debug = $opt_d; %passwords; # This might or might not be necessary depending if your LDAP server # when importing from ldif introduces crypted passwords in the LDAP db # (not necessary for Netscape's Directory Server) read_passwds ($opt_f) if $opt_f; # USER CONFIGURATION # ------------------ $usermatch = ".*"; # only add users matching this # WARNING: in order to add *all* users set this to ".*" NOT "" # LDAP configuration $domain = "o=icm.es"; $basedn = ", ou=Hardware, ou=EDUCAMADRID, ou=People, $domain"; $predn = "dn: cn="; $uniquemembers = 1; $groupname = "RadiusUser"; # group to add in the LDAP, if null will not add $group = "\n\ndn: ou=$groupname, ou=Groups, $domain"; # Only useful for adding the group (not yet implemented) $addgroup = $group."\ndescription: $groupname\nobjectclass: top"; if ( $uniquemembers ) { $addgroup = $addgroup."\nobjectclass: groupOfUniqueNames"; } else { $addgroup = $addgroup."\nobjectclass: groupOfNames"; } $addgroup = $addgroup."\ncn: $groupname"; # The following group must be created first # (ldif entry), the script will *not* create it #cn=$group,ou=Groups,o=icm.es #description=whatever #objectclass=top #objectclass=groupOfUniqueNames # (or objectclass=groupOfNames) #cn=$group # Required: person (for userpasswords) and radiusprofile ( 5 February 1998) @objectClass = ( "top", "person" , "radiusprofile" ); # Mapping of entries (use lower case so no check needs to be make) # From freeradius: rlm_ldap.c # { "radiusServiceType", "Service-Type" }, # { "radiusFramedProtocol", "Framed-Protocol" }, # { "radiusFramedIPAddress", "Framed-IP-Address" }, # { "radiusFramedIPNetmask", "Framed-IP-Netmask" }, # { "radiusFramedRoute", "Framed-Route" }, # { "radiusFramedRouting", "Framed-Routing" }, # { "radiusFilterId", "Filter-Id" }, # { "radiusFramedMTU", "Framed-MTU" }, # { "radiusFramedCompression", "Framed-Compression" }, # { "radiusLoginIPHost", "Login-IP-Host" }, # { "radiusLoginService", "Login-Service" }, # { "radiusLoginTCPPort", "Login-TCP-Port" }, # { "radiusCallbackNumber", "Callback-Number" }, # { "radiusCallbackId", "Callback-Id" }, # { "radiusFramedRoute", "Framed-Route" }, # { "radiusFramedIPXNetwork", "Framed-IPX-Network" }, # { "radiusClass", "Class" }, # { "radiusSessionTimeout", "Session-Timeout" }, # { "radiusIdleTimeout", "Idle-Timeout" }, # { "radiusTerminationAction", "Termination-Action" }, # { "radiusCalledStationId", "Called-Station-Id" }, # { "radiusCallingStationId", "Calling-Station-Id" }, # { "radiusLoginLATService", "Login-LAT-Service" }, # { "radiusLoginLATNode", "Login-LAT-Node" }, # { "radiusLoginLATGroup", "Login-LAT-Group" }, # { "radiusFramedAppleTalkLink", "Framed-AppleTalk-Link" }, # { "radiusFramedAppleTalkNetwork", "Framed-AppleTalk-Network" }, # { "radiusFramedAppleTalkZone", "Framed-AppleTalk-Zone" }, # { "radiusPortLimit", "Port-Limit" }, # { "radiusLoginLATPort", "Login-LAT-Port" }, # You can change to the mappings below like this # cat radius2ldif.pl | grep ^# | \ # perl -ne 'if ( /\{ \"(.*?)\", \"(.*?)\" \}/ ) \ # { $attr=lc $2; print "\$mapping{\"$attr\"} = \"$1\";\n" ; } ' # Warning: sometimes password must be encrypted before sent to the LDAP # Which Perl libraries are available? Only way I find is through # Netscape's NDS getpwenc. # However NDS does the cyphering even if sending plain passwords # (do all LDAP's do this?) # TODO: test with OpenLDAP $mapping{'password'} = "userpassword"; $mapping{'service-type'} = "radiusServiceType"; $mapping{'framed-protocol'} = "radiusFramedProtocol"; $mapping{'framed-ip-address'} = "radiusFramedIPAddress"; $mapping{'framed-ip-netmask'} = "radiusFramedIPNetmask"; $mapping{'framed-route'} = "radiusFramedRoute"; $mapping{'framed-routing'} = "radiusFramedRouting"; $mapping{'filter-id'} = "radiusFilterId"; $mapping{'framed-mtu'} = "radiusFramedMTU"; $mapping{'framed-compression'} = "radiusFramedCompression"; $mapping{'login-ip-host'} = "radiusLoginIPHost"; $mapping{'login-service'} = "radiusLoginService"; $mapping{'login-tcp-port'} = "radiusLoginTCPPort"; $mapping{'callback-number'} = "radiusCallbackNumber"; $mapping{'callback-id'} = "radiusCallbackId"; $mapping{'framed-ipx-network'} = "radiusFramedIPXNetwork"; $mapping{'class'} = "radiusClass"; $mapping{'session-timeout'} = "radiusSessionTimeout"; $mapping{'idle-timeout'} = "radiusIdleTimeout"; $mapping{'termination-action'} = "radiusTerminationAction"; $mapping{'called-station-id'} = "radiusCalledStationId"; $mapping{'calling-station-id'} = "radiusCallingStationId"; $mapping{'login-lat-service'} = "radiusLoginLATService"; $mapping{'login-lat-node'} = "radiusLoginLATNode"; $mapping{'login-lat-group'} = "radiusLoginLATGroup"; $mapping{'framed-appletalk-link'} = "radiusFramedAppleTalkLink"; $mapping{'framed-appletalk-network'} = "radiusFramedAppleTalkNetwork"; $mapping{'framed-appletalk-zone'} = "radiusFramedAppleTalkZone"; $mapping{'port-limit'} = "radiusPortLimit"; $mapping{'login-lat-port'} = "radiusLoginLATPort"; # Must be added to rlm_ldap.c (change this to suite your needs) # (really not all since they are in the /etc/raddb/dictionary.compat) $mapping{'framed-address'} = "radiusFramedIPAddress"; $mapping{'framed-ip-route'} = "radiusFramedRoute"; $mapping{'framed-netmask'} = "radiusFramedIPNetmask"; $mapping{'user-service'} = "radiusServiceType"; # Since this might not change they could be placed in the DEFAULT # user insted of the LDAP #$mapping{'ascend-metric'} = "radiusAscendMetric"; #$mapping{'ascend-idle-limit'} = "radiusAscendIdleLimit"; # But this really ought to be there : $mapping{'callback_number'} = "radiusCallbackNumber"; # Footer of ldif entries $footer = "\n\n"; $startentry = 0; while ($line=) { chomp $line; if ( $line =~ /^[\s\t]*$/ && $startentry) { $startentry = 0 ; print $footer; } # Start line is hardcoded must be uid followed by password # this could be changed to use any other parameter however if ( $line =~ /^(\w+)\s*\t*(?:User-)?Password=(\w+)/ ) { $uid = $1; $password= $2; $password = $passwords{$password} if $opt_f; if ( $uid =~ /$usermatch/ ) { $startentry = 1; $dn=$predn.$uid.$basedn; # Start of LDIF entry $header = "$dn\n"; push @userlist, $dn; if ( $opt_m ) { $header= $header."changetype: modify\n"; } else { for (my $i=0; $i < $#objectClass+1; $i++) { $header = $header."objectclass: ".$objectClass[$i]."\n"; } } print $header if !$opt_m; print_entry ("cn",$uid); print_entry ("sn",$uid); # The following might be necessary (depending on the groups) # of the object #print "replace: uid\n" if $opt_m; #print "uid: $uid\n"; #print "replace: givenname\n" if $opt_m; #print "givenname: $uid\n"; print_entry ($mapping{'password'},$password); } } # Do this only for entries detected if ( $startentry && ! $opt_p ) { #Take anything that starts with a tab or spaces # and ends (sometimes) with a comma if ( $line =~ /^[\t\s]+(.*?)\s+=\s+(.*?),*$/ ) { $parameter = lc $1; $value = $2; print "DEBUG: Got :$parameter=$value\n" if $debug; if ( defined $mapping{$parameter} && $mapping{$parameter} ne "" ) { print_entry ($mapping{$parameter},$value); } # of if defined mapping else { print "DEBUG: Parameter $parameter not known\n" if $debug; } } # of if line } # of if startentry } # of while # The list of users in the group if ( $group ) { if ( ! $opt_m ) { print "$addgroup\n"; } else { print "\n\n$group\n"; print "changetype: modify\n" ; } foreach $user ( @userlist ) { $member = "member: "; $member = "uniquemember: " if $uniquemembers; print "$member$user\n"; } } exit 0; sub read_passwds { # Reads passwords from a file in order to get the crypted # version, the file must be of the following format: # password cryptedversion my ($file)=@_; open (PASSWD,"< $file") or die ("Could not open $file: $!\n"); while ($line = ) { chomp $line; if ( $line =~ /^(\w+)[\t\s]+(.*?)$/ ) { $passwords{$1}=$2; } } close PASSWD; return 0; } sub print_entry { # Prints and ldif entry given name and value # if this is a modification it will print header and footer my ($name, $value) = @_; print $header."replace: $name\n" if $opt_m; print $name.": ".$value."\n"; print $footer if $opt_m; return 0; } freeradius-server/scripts/radsqlrelay000077500000000000000000000145201257552170400204650ustar00rootroot00000000000000#!/usr/bin/perl ## ## radsqlrelay.pl This program tails a SQL logfile and forwards ## the queries to a database server. Used to ## replicate accounting records to one (central) ## database, even if the database has extended ## downtime. ## ## Version: $Id$ ## ## Author: Nicolas Baradakis ## ## Copyright (C) 2005 Cegetel ## ## This program is free software; you can redistribute it and/or ## modify it under the terms of the GNU General Public License ## as published by the Free Software Foundation; either version 2 ## of the License, or (at your option) any later version. ## ## This program is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with this program; if not, write to the Free Software ## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA ## use DBI; use Fcntl; use Getopt::Std; use POSIX qw(:unistd_h :errno_h); use warnings; use strict; my $maxcollect = 100; # tunable, works for MySQL! my $lastinsert; my @values; my $need_exit = 0; sub got_signal() { $need_exit = 1; } # /!\ OS-dependent structure # Linux struct flock # short l_type; # short l_whence; # off_t l_start; # off_t l_len; # pid_t l_pid; # c2ph says: typedef='s2 l2 i', sizeof=16 my $FLOCK_STRUCT = 's2l2i'; sub setlock($;$$) { my ($fh, $start, $len) = @_; $start = 0 unless defined $start; $len = 0 unless defined $len; #type whence start till pid my $packed = pack($FLOCK_STRUCT, F_WRLCK, SEEK_SET, $start, $len, 0); if (fcntl($fh, F_SETLKW, $packed)) { return 1 } else { return 0 } } sub usage() { print STDERR <connect($dbinfo->{base}, $dbinfo->{user}, $dbinfo->{pass}, { RaiseError => 0, PrintError => 0, AutoCommit => 1 }); sleep (1) if !$dbh; exit if $need_exit; } $dbinfo->{handle} = $dbh; } sub process_file($$) { my ($dbinfo, $path) = @_; sub do_inserts($) { my $dbinfo = shift; if (scalar(@values) > 0) { my $query = $lastinsert . " "; $query .= join(" ), ( ",@values); $query .= " );"; do_query($dbinfo,$query); } @values = (); } sub do_query($$) { my ($dbinfo,$query) = @_; until ($dbinfo->{handle}->do($query)) { print $dbinfo->{handle}->errstr."\n"; if ($dbinfo->{handle}->ping) { sleep (1); } else { print "error: Lost connection to database\n"; $dbinfo->{handle}->disconnect; connect_wait($dbinfo); } } } unless (-e $path.'.work') { until (rename($path, $path.'.work')) { if ($! == ENOENT) { sleep(1); return if $need_exit; } else { print STDERR "error: Couldn't move $path to $path.work: $!\n"; exit 1; } } } open(FILE, "+< $path.work") or die "error: Couldn't open $path.work: $!\n"; setlock(\*FILE) or die "error: Couldn't lock $path.work: $!\n"; $lastinsert = ""; @values = (); while () { chomp (my $line = $_); if (!($line =~ /^\s*insert\s+into\s+`?\w+`?\s+(?:\(.*?\)\s+)? values\s*\(.*\)\s*;\s*$/ix)) { # This is no INSERT, so start new collection do_inserts($dbinfo); $lastinsert = ""; # must output this line do_query($dbinfo, "$line"); } else { # This is an INSERT, so collect it my $insert = $line; my $values = $line; $insert =~ s/^\s*(insert\s+into\s+`?\w+`?\s+(?:\(.*?\)\s+)? values\s*\().*\)\s*;\s*$/$1/ix; $values =~ s/^\s*insert\s+into\s+`?\w+`?\s+(?:\(.*?\)\s+)? values\s*\((.*)\)\s*;\s*$/$1/ix; if (($lastinsert ne "") && ($insert ne $lastinsert)) { # This is different from the last one do_inserts($dbinfo); } push(@values, $values); $lastinsert = $insert; # start new collection } # limit to $maxcollect collected lines if (scalar(@values) >= $maxcollect) { do_inserts($dbinfo); } } # Cleanup do_inserts($dbinfo); unlink($path.'.work'); close(FILE); # and unlock } # sub main() my %args = ( b => 'radius', d => 'mysql', h => 'localhost', p => 'radius', u => 'radius', ); my $ret = getopts("b:d:f:h:P:p:u:x1?", \%args); if (!$ret or @ARGV != 1) { usage(); exit 1; } if ($args{'?'}) { usage(); exit 0; } my $data_source; if (lc($args{d}) eq 'mysql') { $data_source = "DBI:mysql:database=$args{b};host=$args{h}"; } elsif (lc($args{d}) eq 'pg') { $data_source = "DBI:Pg:dbname=$args{b};host=$args{h}"; } elsif (lc($args{d}) eq 'oracle') { $data_source = "DBI:Oracle:$args{b}"; # Oracle does not conform to the SQL standard for multirow INSERTs $maxcollect = 1; } else { print STDERR "error: SQL driver not supported yet: $args{d}\n"; exit 1; } $data_source .= ";port=$args{P}" if $args{'P'}; my $pw; if($args{f}) { open(FILE, "< $args{f}") or die "error: Couldn't open $args{f}: $!\n"; $pw = ; chomp($pw); close(FILE); } else { # args{p} is always defined. $pw = $args{p}; } $SIG{INT} = \&got_signal; $SIG{TERM} = \&got_signal; my %dbinfo = ( base => $data_source, user => $args{u}, pass => $pw, ); connect_wait(\%dbinfo); my $path = shift @ARGV; until ($need_exit) { process_file(\%dbinfo, $path); last if ($args{1} || $need_exit); sleep(10); } $dbinfo{handle}->disconnect; freeradius-server/scripts/radtee000077500000000000000000000356341257552170400174170ustar00rootroot00000000000000#!/usr/bin/env python from __future__ import with_statement # RADIUS comparison tee v1.0 # Sniffs local RADIUS traffic, replays incoming requests to a test # server, and compares the sniffed responses with the responses # generated by the test server. # # Copyright (c) 2009, Frontier Communications # Copyright (c) 2010, John Morrissey # # 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. # Requires # ======== # - python 2.4 or newer # - impacket # - pcapy # - pyrad, ideally 1.2 or newer # Output # ====== # - .: 50 successful, matching responses processed. # - C=x.x.x.x: Ignored packet sniffed from unknown client. # - D: Dropped sniffed packet due to processing bottleneck. Consider # increasing THREADS. # - I: Invalid/unparseable packet sniffed. # - Mreq: Response was sniffed without sniffing a corresponding request. # - Mresp: Request was sniffed without sniffing a corresponding response. # - T: Request to test server timed out. import fcntl from getopt import gnu_getopt, GetoptError import os import Queue import re import signal import socket import struct import sys import thread from threading import Thread from time import sleep, time from impacket.ImpactDecoder import EthDecoder import pcapy from pyrad.client import Client from pyrad.dictionary import Dictionary from pyrad import packet TEST_DEST = 'server.example.com' TEST_SECRET = 'examplesecret' # Dictionary to use when decoding RADIUS packets. pyrad earlier than # v1.2 can't parse $INCLUDE directives, so you must combine FreeRADIUS' # dictionary manually, with something like this: # # import re # import sys # # def combine(file): # for line in open(file): # matches = re.search(r'^\$INCLUDE\s+(.*)$', line) # if not matches: # sys.stdout.write(line) # continue # # combine(matches.group(1)) # # combine('/etc/freeradius/dictionary') DICTIONARY = '/etc/freeradius/dictionary' # Number of worker threads to run. THREADS = 32 # Mapping of RADIUS request source addresses to shared secrets, # so we can decode incoming RADIUS requests. # # For example: # '127.0.0.1': 'test', CLIENTS = { } # Ignore any sniffed requests from these IP addresses. IGNORE_CLIENTS = [ ] # Expected mismatches to ignore and consider the packet matching. # Only the differences are compared to these items, so only the # differing attrs need be listed in the attrs array. # # Examples: # - Ignore mismatched AccessRejects whose sole difference is a # Reply-Message attribute with the values given. # { # 'sniffed': { # 'code': packet.AccessReject, # 'attrs': [ # 'Reply-Message=Request Denied', # ], # }, # 'test': { # 'code': packet.AccessReject, # 'attrs': [ # 'Reply-Message=Account is disabled.', # ], # } # }, # # - Ignore mismatched AccessRejects with Reply-Message=Request Denied # and arbitrary Cisco dns-servers in the sniffed packet, and # no Reply-Message and Cisco-AVPair attrs in the response from the # test RADIUS server. # { # 'sniffed': { # 'code': packet.AccessReject, # 'attrs': [ # 'Reply-Message=Request Denied', # 'regex:^Cisco-AVPair=ip:dns-servers=.*$', # ], # }, # 'test': { # 'code': packet.AccessReject, # 'attrs': [ # ], # } # }, # # - Only apply this stanza to sniffed requests with # 'User-Name= user@example.com' (note the leading whitespace). # { # 'check': [ # 'User-Name= user@example.com', # ], # 'sniffed': { # 'code': packet.AccessReject, # 'attrs': [ # 'Reply-Message=Request Denied', # ], # }, # 'test': { # 'code': packet.AccessAccept, # 'attrs': [ # 'Service-Type=Framed-User', # 'Framed-Protocol=PPP', # 'Framed-IP-Address=255.255.255.255', # 'Framed-MTU=1500', # 'Framed-Compression=Van-Jacobson-TCP-IP', # ], # } # }, IGNORE = [ ] QUEUE = Queue.Queue(maxsize=25000) DICT = Dictionary(DICTIONARY) def code2str(code): if code == packet.AccessRequest: return "Access-Request" elif code == packet.AccessAccept: return "Access-Accept" elif code == packet.AccessReject: return "Access-Reject" elif code == packet.AccountingRequest: return "Accounting-Request" elif code == packet.AccountingResponse: return "Accounting-Response" elif code == packet.AccessChallenge: return "Access-Challenge" elif code == packet.StatusServer: return "Status-Server" elif code == packet.StatusClient: return "Status-Client" elif code == packet.DisconnectRequest: return "Disconnect-Request" elif code == packet.DisconnectACK: return "Disconnect-ACK" elif code == packet.DisconnectNAK: return "Disconnect-NAK" elif code == packet.CoARequest: return "CoA-Request" elif code == packet.CoAACK: return "CoA-ACK" elif code == packet.CoANAK: return "CoA-NAK" def handlePacket(header, data): """Place captured packets in the queue to be picked up by worker threads.""" global QUEUE try: QUEUE.put_nowait(data) except Queue.Full: sys.stdout.write('D') sys.stdout.flush() def ignore_applies(pkt, ignore): """Determine whether an ignore stanza (based on its check items) applies to a packet.""" # All check items must match for this ignore stanza to apply. stanza_applies = True for pair in ignore.get('check', []): attr, value = pair.split('=') if attr not in pkt: return False if value.startswith('regex:'): if not re.search(value.replace('regex:', '', 1), value): return False elif pkt[attr] != value: return False return True def ignores_match(pkt, mismatched, ignore): """Determine whether mismatched AV pairs remain after accounting for ignored differences.""" non_regex_ignore = [ q for q in ignore['attrs'] if not q.startswith('regex:') ] regex_ignore = [ q for q in ignore['attrs'] if q.startswith('regex:') ] unmatched_av = mismatched[:] unmatched_rules = ignore['attrs'][:] for av in mismatched: if av in non_regex_ignore: unmatched_av.remove(av) unmatched_rules.remove(av) continue for regex in regex_ignore: if re.search(regex.replace('regex:', '', 1), av): unmatched_av.remove(av) if regex in unmatched_rules: unmatched_rules.remove(regex) break if unmatched_av or unmatched_rules: return False return True def matches(req, sniffed_pkt, test_pkt): """Determine whether a response from the test server matches the response sniffed from the wire, accounting for ignored differences.""" global IGNORE mis_attrs_sniffed = [] for k in sniffed_pkt.keys(): if sorted(sniffed_pkt[k]) == sorted(test_pkt.get(k, [])): continue mis_attrs_sniffed.append('%s=%s' % ( k, ', '.join([str(v) for v in sorted(sniffed_pkt[k])]))) mis_attrs_test = [] for k in test_pkt.keys(): if sorted(test_pkt[k]) == sorted(sniffed_pkt.get(k, [])): continue mis_attrs_test.append('%s=%s' % ( k, ', '.join([str(v) for v in sorted(test_pkt[k])]))) # The packets match without having to consider any ignores. if sniffed_pkt.code == test_pkt.code and \ not mis_attrs_sniffed and not mis_attrs_test: return True for ignore in IGNORE: if not ignore_applies(req, ignore): continue if ignore['sniffed']['code'] != sniffed_pkt.code or \ ignore['test']['code'] != test_pkt.code: continue if ignores_match(sniffed_pkt, mis_attrs_sniffed, i['sniffed']): return True if ignores_match(test_pkt, mis_attrs_test, i['test']): return True return False def log_mismatch(nas, req, passwd, expected, got): """Emit notification that the test server has returned a response that differs from the sniffed response.""" print 'Mismatch: %s' % nas print 'Request: %s' % code2str(req.code) for key in req.keys(): if key == 'User-Password': print '\t%s: %s' % (key, passwd) continue print '\t%s: %s' % ( key, ', '.join([str(v) for v in req[key]])) print 'Expected: %s' % code2str(expected.code) for key in expected.keys(): print '\t%s: %s' % ( key, ', '.join([str(v) for v in expected[key]])) print 'Got: %s' % code2str(got.code) for key in got.keys(): print '\t%s: %s' % ( key, ', '.join([str(v) for v in got[key]])) print REQUESTS = {} REQUESTS_LOCK = thread.allocate_lock() NUM_SUCCESSFUL = 0 def check_for_match(key, req_resp): """Send a copy of the original request to the test server and determine whether the response matches the response sniffed from the wire.""" global DICT, NUM_SUCCESSFUL, TEST_DEST, TEST_SECRET global REQUESTS, REQUESTS_LOCK client = Client(server=TEST_DEST, secret=TEST_SECRET, dict=DICT) fwd_req = client.CreateAuthPacket(code=packet.AccessRequest) fwd_req.authenticator = req_resp['req']['pkt'].authenticator keys = req_resp['req']['pkt'].keys() for k in keys: for value in req_resp['req']['pkt'][k]: fwd_req.AddAttribute(k, value) if 'User-Password' in keys: fwd_req['User-Password'] = fwd_req.PwCrypt(req_resp['req']['passwd']) if 'NAS-IP-Address' in fwd_req: del fwd_req['NAS-IP-Address'] fwd_req.AddAttribute('NAS-IP-Address', req_resp['req']['ip']) try: test_reply = client.SendPacket(fwd_req) except: # Request to test server timed out. sys.stdout.write('T') sys.stdout.flush() with REQUESTS_LOCK: del REQUESTS[key] return if not matches(req_resp['req']['pkt'], req_resp['response']['pkt'], test_reply): print log_mismatch(req_resp['req']['ip'], req_resp['req']['pkt'], req_resp['req']['passwd'], req_resp['response']['pkt'], test_reply) with REQUESTS_LOCK: # Occasionally, this key isn't present. Maybe retransmissions # due to a short timeout on the remote RADIUS client's end # and a subsequent race? if key in REQUESTS: del REQUESTS[key] NUM_SUCCESSFUL += 1 if NUM_SUCCESSFUL % 50 == 0: sys.stdout.write('.') sys.stdout.flush() class RadiusComparer(Thread): def run(self): global DICT, IGNORE_CLIENTS, QUEUE, REQUESTS, REQUESTS_LOCK while True: data = QUEUE.get() if not data: return frame = EthDecoder().decode(data) ip = frame.child() udp = ip.child() rad_raw = udp.child().get_buffer_as_string() try: pkt = packet.Packet(dict=DICT, packet=rad_raw) except packet.PacketError: sys.stdout.write('I') sys.stdout.flush() continue if ip.get_ip_src() in IGNORE_CLIENTS: continue if pkt.code == packet.AccessRequest: auth = packet.AuthPacket(data[42:]) auth.authenticator = pkt.authenticator auth.secret = clients.CLIENTS.get(ip.get_ip_src(), None) if not auth.secret: # No configuration for this client. sys.stdout.write('C=%s' % ip.get_ip_src()) sys.stdout.flush() continue passwd = None if 'User-Password' in pkt.keys(): passwd = auth.PwDecrypt(pkt['User-Password'][0]) key = '%s:%d:%d' % (ip.get_ip_src(), udp.get_uh_sport(), pkt.id) do_compare = None with REQUESTS_LOCK: if key not in REQUESTS: REQUESTS[key] = {} REQUESTS[key]['req'] = { 'ip': ip.get_ip_src(), 'port': udp.get_uh_sport(), 'pkt': pkt, 'passwd': passwd, } REQUESTS[key]['tstamp'] = time() if 'response' in REQUESTS[key]: do_compare = REQUESTS[key] if do_compare: check_for_match(key, do_compare) elif pkt.code in [packet.AccessAccept, packet.AccessReject]: key = '%s:%d:%d' % (ip.get_ip_dst(), udp.get_uh_dport(), pkt.id) do_compare = None with REQUESTS_LOCK: if key not in REQUESTS: REQUESTS[key] = {} REQUESTS[key]['response'] = { 'ip': ip.get_ip_src(), 'port': udp.get_uh_sport(), 'pkt': pkt, } REQUESTS[key]['tstamp'] = time() if 'req' in REQUESTS[key]: do_compare = REQUESTS[key] if do_compare: check_for_match(key, do_compare) else: print >>sys.stderr, \ 'Unsupported packet type received: %d' % pkt.code class RequestsPruner(Thread): """Prune stale request state periodically.""" def run(self): global REQUESTS, REQUESTS_LOCK while True: sleep(30) now = time() with REQUESTS_LOCK: keys = REQUESTS.keys() for key in keys: if REQUESTS[key]['tstamp'] + 60 >= now: continue if 'req' not in REQUESTS[key]: sys.stdout.write('Mreq') sys.stdout.flush() if 'response' not in REQUESTS[key]: sys.stdout.write('Mresp') sys.stdout.flush() del REQUESTS[key] def usage(): print 'Usage: %s INTERFACE' % os.path.basename(sys.argv[0]) print '' print ' -h, --help display this help and exit' if __name__ == '__main__': global PID_FILE progname = os.path.basename(sys.argv[0]) try: options, iface = gnu_getopt(sys.argv[1:], 'h', ['help']) except GetoptError, e: print '%s: %s' % (progname, str(e)) usage() sys.exit(1) for option in options: if option[0] == '-h' or option[0] == '--help': usage() sys.exit(0) if len(iface) != 1: usage() sys.exit(1) iface = iface[0] if os.geteuid() != 0: print >>sys.stderr, '%s: must be run as root.' % progname sys.exit(1) for i in range(0, THREADS): RadiusComparer().start() RequestsPruner().start() s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) # This is Linux-specific, and there's no tenable way to make # it portable. # # Unfortunately, we need the interface's IP address to filter out # only RADIUS traffic destined for this host (avoiding traffic sent # *by* this host, such as proxied requests or our own traffic) to # avoid replaying requests not directed to the local radiusd. # # Furthermore, this only obtains the interface's *first* IP address, # so we won't notice traffic sent to additional IP addresses on # the given interface. # # This is Good Enough For Me given the effort I care to invest. # Of course, patches enhancing this are welcome. if os.uname()[0] == 'Linux': local_ipaddr = socket.inet_ntoa(fcntl.ioctl( s.fileno(), 0x8915, # SIOCGIFADDR struct.pack('256s', iface[:15]) )[20:24]) else: raise Exception('Only the Linux operating system is currently supported.') p = pcapy.open_live(iface, 1600, 0, 100) p.setfilter(''' (dst host %s and udp and dst port 1812) or (src host %s and udp and src port 1812)''' % \ (local_ipaddr, local_ipaddr)) while True: try: p.dispatch(1, handlePacket) except KeyboardInterrupt: sys.exit(0) freeradius-server/scripts/radwatch.in000066400000000000000000000160271257552170400203450ustar00rootroot00000000000000#!/bin/sh ###################################################################### # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA # # Copyright (C) 2009 Network RADIUS SARL # ###################################################################### # # radwatch - Start the radius daemon and restart upon crash. # # It also catches signals sent to it, and then re-sends those signals # to the radius server it is watching. # # If you want to watch and re-start the server, we recommend # reading the file doc/supervise-radiusd.txt # # This simplifies the script, and avoids most issues with (say) # Debian re-naming "radiusd" to "freeradius". # name=radiusd prefix=@prefix@ exec_prefix=@exec_prefix@ sbindir=@sbindir@ localstatedir=@localstatedir@ logdir=@logdir@ rundir=${localstatedir}/run/${name} sysconfdir=@sysconfdir@ pid_file=${rundir}/${name}.pid log_file=${logdir}/${name}_safe.log # # Figure out what arguments to pass tail # tail="tail -n " echo foo | ${tail}1 > /dev/null 2>&1 if test "$?" != "0" then tail="tail -" fi RADIUSD=$sbindir/${name} RADDBDIR=${sysconfdir}/raddb # # If you want to send email, define this field to be an email address. # This part of the functionality hasn't been well tested, so please # test it before putting it into production. # # It also presumes that you have a functioning mail system on # the maching running RADIUS. You will need to check that the # "mail" command exists, and sends mail to the address below, e.g.: # # echo test | mail -s "Testing" $MAILTO # # If you receive the message, then enable MAILTO. Otherwise, fix # your mail system so that it delivers mail. # MAILTO= # # Allow "radiusd_safe -X" for testing the radiusd_safe functionality. # ARGS="$@" test -f $RADIUSD || exit 0 test -f $RADDBDIR/radiusd.conf || exit 0 ulimit -c unlimited # # See if the PID file exists. It might have been left over after # a crash, or it might be because the RADIUS server is still running. # if test -f $pid_file then PID=`cat $pid_file` # # Check if the process exists, AND if it has the right name # if ps -p $PID | grep $name > /dev/null then echo "`date +'%a %b %e %H:%M:%S %Y'` : Fatal: A $name process already exists at PID $PID. We cannot start another one." >> $log_file echo "A $name process already exists" exit 1 fi # # A RADIUS server doesn't exist. Delete the stale PID file. # rm -f $pid_file if test -f $pid_file then echo "`date +'%a %b %e %H:%M:%S %Y'` : Fatal: Cannot remove the pid file: $pid_file" >> $log_file echo "Fatal error: Cannot remove the pid file: $pid_file" echo "Please remove it manually and start $0 again" echo "$name daemon not started" exit 1 fi fi started=0 restarts=0 last_email=0 now=0 # # Save our PID. # echo $$ > ${rundir}/${name}_safe.pid # # Loop forever, or until we're told to exit via a signal. # while : do # # The first time around, just start the server. # After that, see if we are re-starting in the same second # as the last time. If so, sleep for a second. Otherwise, # if we're not starting in the same second, then just restart # the server. # # This helps prevent CPU spikes when something goes catastrophically # wrong, and the server re-starts continuously. (e.g. disk full, etc.) # now_s=`date +'%a %b %e %H:%M:%S %Y'` if test "$started" != "0" then # Send mail when the server starts if test "$MAILTO" != "" then # don't print minutes and seconds: cheap way # of sending email only once an hour. now=`date +'%a %b %e %H %Y'` restarts=`expr $restarts + 1` # send email the first time it restarts if test "$last_email" = "0" then cat | mail -s "ERROR - $name died, restarting.." $MAILTO <> $log_file 2>&1 &" PID=$! if test "$?" != "0" then echo "Failed to start $name. See $log_file for details" echo "$name daemon not started" exit 1 fi echo $PID > $pid_file # # Wait for the process to exit. # wait $PID code=$? # # On *BSD and Linux, sending *us* a signal results in "wait" returning # with 128+sig. On Solaris, it results in "wait" returning with "0". # # If this happens, we reset our expectations here so that the code # below will work correctly. # if test "$code" = "0" then if test "$mysig" != "" then code=`expr $mysig + 128` fi fi case "$code" in 0) echo "`date +'%a %b %e %H:%M:%S %Y'` : Info: $name exited normally. Exiting" | tee -a $log_file break ;; 127) echo "`date +'%a %b %e %H:%M:%S %Y'` : Info: $name exited unexpectedly. Restarting it." | tee -a $log_file ;; *) # # The server exited of its own accord. # if test "$code" -lt 128 then echo "`date +'%a %b %e %H:%M:%S %Y'` : Info: $name exited unexpectedly on exit code $code. Restarting it." | tee -a $log_file else sig=`expr $code - 128` # # Was the signal sent to us, or to the child process? # if test "$mysig" != "" then echo "`date +'%a %b %e %H:%M:%S %Y'` : Info: Caught signal $sig: Signalling $name to exit." | tee -a $log_file kill -$sig $PID break else echo "`date +'%a %b %e %H:%M:%S %Y'` : Info: $name exited unexpectedly on signal $sig. Restarting it." | tee -a $log_file fi fi ;; esac done rm -f $pid_file ${rundir}/${name}_safe.pid exit 0 freeradius-server/scripts/rc.radiusd.in000077500000000000000000000047311257552170400206100ustar00rootroot00000000000000#!/bin/sh # # radiusd Start the radius daemon. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA # # Copyright (C) 2001-2008 The FreeRADIUS Project http://www.freeradius.org prefix=@prefix@ exec_prefix=@exec_prefix@ sbindir=@sbindir@ localstatedir=@localstatedir@ logdir=@logdir@ rundir=${localstatedir}/run/radiusd sysconfdir=@sysconfdir@ # # If you have issues with OpenSSL, uncomment these next lines. # # Something similar may work for MySQL, and you may also # have to LD_PRELOAD libz.so # #LD_LIBRARY_PATH=@OPENSSL_LIBS@ #LD_RUN_PATH=@OPENSSL_LIBS@: #LD_PRELOAD=@OPENSSL_LIBS@libcrypto.so export LD_LIBRARY_PATH LD_RUN_PATH LD_PRELOAD RADIUSD=$sbindir/radiusd RADDBDIR=@raddbdir@ DESC="FreeRADIUS" # # See 'man radiusd' for details on command-line options. # ARGS="" test -f $RADIUSD || exit 0 test -f $RADDBDIR/radiusd.conf || exit 0 #if [ ! -d $rundir ] ; then # mkdir $rundir # chown radmin:radius $rundir # chmod 775 $rundir #fi # #if [ ! -d $logdir ] ; then # mkdir $logdir # chown radmin:radius $logdir # chmod 770 $logdir # chmod g+s $logdir #fi # #if [ ! -f $logdir/radius.log ]; then # touch $logdir/radius.log #fi # #chown radmin:radius $logdir/radius.log #chmod 660 $logdir/radius.log case "$1" in start) echo -n "Starting $DESC:" $RADIUSD $ARGS echo "radiusd" ;; stop) [ -z "$2" ] && echo -n "Stopping $DESC: " [ -f $rundir/radiusd.pid ] && kill -TERM `cat $rundir/radiusd.pid` [ -z "$2" ] && echo "radiusd." ;; reload|force-reload) echo "Reloading $DESC configuration files." [ -f $rundir/radiusd.pid ] && kill -HUP `cat $rundir/radiusd.pid` ;; restart) sh $0 stop quiet sleep 3 sh $0 start ;; check) $RADIUSD -CX $ARGS exit $? ;; *) echo "Usage: /etc/init.d/$RADIUS {start|stop|reload|restart|check}" exit 1 esac exit 0 freeradius-server/scripts/snmp-proxy/000077500000000000000000000000001257552170400203465ustar00rootroot00000000000000freeradius-server/scripts/snmp-proxy/README000066400000000000000000000016451257552170400212340ustar00rootroot00000000000000 The files in this directory replace the old FreeRADIUS SNMP implementantion with a new one. net-radius-freeradius-dictionary.diff Patch to enable the Perl Net::RADIUS module to read the FreeRADIUS dictionary file format. dictionary.hacked Dictionary used by Perl Net::RADIUS if it is NOT patched. Do NOT use this dictionary with the FreeRADIUS server! freeradius-snmp.pl Perl module that implements the connection between SNMP and FreeRADIUS. See raddb/sites-available/status for information on using Status-Server packets to obtain internal server statistics. make sure snmpd is agentx master (snmpd.conf): master agentx run the script (no demonizing support yet): $ ./freeradius-snmp.pl then you can walk the tree (default oid): $ snmpbulkwalk -On -v2c -cpublic localhost .1.3.6.1.2.1.67 This code is ALPHA. Please test, and return any fixes back to the mailing list, or to bugs.freeradius.org. freeradius-server/scripts/snmp-proxy/dictionary.hacked000066400000000000000000000132251257552170400236570ustar00rootroot00000000000000# # This is a dictionary that should be used by the Perl module Net::RADIUS, # if it has NOT been updated to parse the FreeRADIUS format dictionaries. # # It SHOULD NOT be used in the FreeRADIUS server or client! # ATTRIBUTE Message-Authenticator 80 octets VENDOR FreeRADIUS 11344 ATTRIBUTE FreeRADIUS-Proxied-To 1 ipaddr # # This attribute is really a bitmask. # ATTRIBUTE FreeRADIUS-Statistics-Type 127 integer FreeRADIUS VALUE FreeRADIUS-Statistics-Type None 0 FreeRADIUS VALUE FreeRADIUS-Statistics-Type Authentication 1 VALUE FreeRADIUS-Statistics-Type Accounting 2 VALUE FreeRADIUS-Statistics-Type Proxy-Authentication 4 VALUE FreeRADIUS-Statistics-Type Proxy-Accounting 8 VALUE FreeRADIUS-Statistics-Type Internal 0x10 VALUE FreeRADIUS-Statistics-Type Client 0x20 VALUE FreeRADIUS-Statistics-Type Server 0x40 VALUE FreeRADIUS-Statistics-Type Home-Server 0x80 VALUE FreeRADIUS-Statistics-Type Auth-Acct 0x03 VALUE FreeRADIUS-Statistics-Type Proxy-Auth-Acct 0x0c VALUE FreeRADIUS-Statistics-Type All 0x1f # # Global authentication statistics for packets received by the server. # ATTRIBUTE FreeRADIUS-Total-Access-Requests 128 integer FreeRADIUS ATTRIBUTE FreeRADIUS-Total-Access-Accepts 129 integer FreeRADIUS ATTRIBUTE FreeRADIUS-Total-Access-Rejects 130 integer FreeRADIUS ATTRIBUTE FreeRADIUS-Total-Access-Challenges 131 integer FreeRADIUS ATTRIBUTE FreeRADIUS-Total-Auth-Responses 132 integer FreeRADIUS ATTRIBUTE FreeRADIUS-Total-Auth-Duplicate-Requests 133 integer FreeRADIUS ATTRIBUTE FreeRADIUS-Total-Auth-Malformed-Requests 134 integer FreeRADIUS ATTRIBUTE FreeRADIUS-Total-Auth-Invalid-Requests 135 integer FreeRADIUS ATTRIBUTE FreeRADIUS-Total-Auth-Dropped-Requests 136 integer FreeRADIUS ATTRIBUTE FreeRADIUS-Total-Auth-Unknown-Types 137 integer FreeRADIUS # # Global statistics for auth packets sent by the server to all home servers # ATTRIBUTE FreeRADIUS-Total-Proxy-Access-Requests 138 integer FreeRADIUS ATTRIBUTE FreeRADIUS-Total-Proxy-Access-Accepts 139 integer FreeRADIUS ATTRIBUTE FreeRADIUS-Total-Proxy-Access-Rejects 140 integer FreeRADIUS ATTRIBUTE FreeRADIUS-Total-Proxy-Access-Challenges 141 integer FreeRADIUS ATTRIBUTE FreeRADIUS-Total-Proxy-Auth-Responses 142 integer FreeRADIUS ATTRIBUTE FreeRADIUS-Total-Proxy-Auth-Duplicate-Requests 143 integer FreeRADIUS ATTRIBUTE FreeRADIUS-Total-Proxy-Auth-Malformed-Requests 144 integer FreeRADIUS ATTRIBUTE FreeRADIUS-Total-Proxy-Auth-Invalid-Requests 145 integer FreeRADIUS ATTRIBUTE FreeRADIUS-Total-Proxy-Auth-Dropped-Requests 146 integer FreeRADIUS ATTRIBUTE FreeRADIUS-Total-Proxy-Auth-Unknown-Types 147 integer FreeRADIUS # # Global accounting statistics for packets received by the server. # ATTRIBUTE FreeRADIUS-Total-Accounting-Requests 148 integer FreeRADIUS ATTRIBUTE FreeRADIUS-Total-Accounting-Responses 149 integer FreeRADIUS ATTRIBUTE FreeRADIUS-Total-Acct-Duplicate-Requests 150 integer FreeRADIUS ATTRIBUTE FreeRADIUS-Total-Acct-Malformed-Requests 151 integer FreeRADIUS ATTRIBUTE FreeRADIUS-Total-Acct-Invalid-Requests 152 integer FreeRADIUS ATTRIBUTE FreeRADIUS-Total-Acct-Dropped-Requests 153 integer FreeRADIUS ATTRIBUTE FreeRADIUS-Total-Acct-Unknown-Types 154 integer FreeRADIUS # # Global statistics for acct packets sent by the server to all home servers # ATTRIBUTE FreeRADIUS-Total-Proxy-Accounting-Requests 155 integer FreeRADIUS ATTRIBUTE FreeRADIUS-Total-Proxy-Accounting-Responses 156 integer FreeRADIUS ATTRIBUTE FreeRADIUS-Total-Proxy-Acct-Duplicate-Requests 157 integer FreeRADIUS ATTRIBUTE FreeRADIUS-Total-Proxy-Acct-Malformed-Requests 158 integer FreeRADIUS ATTRIBUTE FreeRADIUS-Total-Proxy-Acct-Invalid-Requests 159 integer FreeRADIUS ATTRIBUTE FreeRADIUS-Total-Proxy-Acct-Dropped-Requests 160 integer FreeRADIUS ATTRIBUTE FreeRADIUS-Total-Proxy-Acct-Unknown-Types 161 integer FreeRADIUS # # Internal queues. Different packet types are put into different queues. # ATTRIBUTE FreeRADIUS-Queue-Len-Internal 162 integer FreeRADIUS ATTRIBUTE FreeRADIUS-Queue-Len-Proxy 163 integer FreeRADIUS ATTRIBUTE FreeRADIUS-Queue-Len-Auth 164 integer FreeRADIUS ATTRIBUTE FreeRADIUS-Queue-Len-Acct 165 integer FreeRADIUS ATTRIBUTE FreeRADIUS-Queue-Len-Detail 166 integer FreeRADIUS ATTRIBUTE FreeRADIUS-Stats-Client-IP-Address 167 ipaddr FreeRADIUS ATTRIBUTE FreeRADIUS-Stats-Client-Number 168 integer FreeRADIUS ATTRIBUTE FreeRADIUS-Stats-Client-Netmask 169 integer FreeRADIUS ATTRIBUTE FreeRADIUS-Stats-Server-IP-Address 170 ipaddr FreeRADIUS ATTRIBUTE FreeRADIUS-Stats-Server-Port 171 integer FreeRADIUS ATTRIBUTE FreeRADIUS-Stats-Server-Outstanding-Requests 172 integer FreeRADIUS ATTRIBUTE FreeRADIUS-Stats-Server-State 173 integer FreeRADIUS VALUE FreeRADIUS-Stats-Server-State Alive 0 VALUE FreeRADIUS-Stats-Server-State Zombie 1 VALUE FreeRADIUS-Stats-Server-State Dead 2 # # When a home server is marked "dead" or "alive" # ATTRIBUTE FreeRADIUS-Stats-Server-Time-Of-Death 174 date FreeRADIUS ATTRIBUTE FreeRADIUS-Stats-Server-Time-Of-Life 175 date FreeRADIUS # # When this server was started. If start == hup, it hasn't been # hup'd yet. This is friendlier than having hup == 0 on start. # ATTRIBUTE FreeRADIUS-Stats-Start-Time 176 date FreeRADIUS ATTRIBUTE FreeRADIUS-Stats-HUP-Time 177 date FreeRADIUS # # Exponential moving average of home server response time # Window-1 is the average is calculated over "window" packets. # Window-10 is the average is calculated over "10 * window" packets. # # Both Window-1 and Window-10 are times in microseconds # (1/1000000 of a second). # ATTRIBUTE FreeRADIUS-Server-EMA-Window 178 integer FreeRADIUS ATTRIBUTE FreeRADIUS-Server-EMA-USEC-Window-1 179 integer FreeRADIUS ATTRIBUTE FreeRADIUS-Server-EMA-USEC-Window-10 180 integer FreeRADIUS freeradius-server/scripts/snmp-proxy/freeradius-snmp.pl000066400000000000000000000467011257552170400240170ustar00rootroot00000000000000#!/usr/bin/perl # # Copyright (C) 2008 Sky Network Services. All Rights Reserved. # # This program is free software; you can redistribute it and/or modify it # under the same terms as Perl itself. # use strict; use warnings; use threads; use threads::shared; use Net::Radius::Packet; use Net::Radius::Dictionary; use NetSNMP::agent qw/:all/; use NetSNMP::ASN qw/:all/; use IO::Socket::INET; use Digest::HMAC_MD5; use Log::Log4perl qw/:easy/; #use Data::Dumper; #$Data::Dumper::Indent = 1; #$Data::Dumper::Sortkeys = 1; #$| = 1; # config. should be really loaded from some file my $cfg = { snmp => { agent => { Name => 'freeradius-snmp', AgentX => 1, }, oid_root => '1.3.6.1.2.1.67', oid_sub => { 1 => [qw/auth proxyauth/], 2 => [qw/acct proxyacct/], }, }, radius => { host => 'localhost', port => 18120, secret => 'adminsecret', # dictionary => '../radiusd/share/dictionary', dictionary => 'dictionary.hacked', refresh_rate => 20, }, log => { level => $DEBUG, layout => '%d{ISO8601} <%p> (%L) %m%n', file => 'STDERR' }, clients => undef, }; Log::Log4perl->easy_init($cfg->{log}); INFO 'starting'; my %snmp_data :shared; my @snmp_data_k :shared; INFO 'initializing snmp'; my $agent = new NetSNMP::agent(%{$cfg->{snmp}->{agent}}); #lets create the thread as early as possible (but it has to be AFTER initializing snmp) INFO 'launching radius client thread'; threads->create(\&radius_updater); #we export only subtrees, not the whole tree $agent->register( $cfg->{snmp}->{agent}->{Name}, $cfg->{snmp}->{oid_root}.'.'.$_, \&snmp_handler) or die foreach keys %{$cfg->{snmp}->{oid_sub}}; INFO 'entering client main loop'; $agent->main_loop; WARN 'something caused me to exit'; exit 0; # initialize common radius client stuff sub radius_stats_init { our ( $d, $s, $rid ); $d = new Net::Radius::Dictionary; $d->readfile($cfg->{radius}->{dictionary}); srand ($$ ^ time); $rid = int rand 255; $s = new IO::Socket::INET( PeerHost => $cfg->{radius}->{host}, PeerPort => $cfg->{radius}->{port}, Proto => 'udp', Timeout => 5) or die; } # build server status packet, send it, fetch and parse the result sub radius_stats_get { my ( $type, %args ) = @_; our ( $d, $s, $rid ); my $p_req = new Net::Radius::Packet $d; $p_req->set_code('Status-Server'); $p_req->set_vsattr('FreeRADIUS', 'FreeRADIUS-Statistics-Type', $type); $p_req->set_vsattr('FreeRADIUS', $_, $args{$_}) foreach keys %args; #update id $p_req->set_identifier($rid++); $p_req->set_authenticator(pack 'C*', map { int rand 255 } 0..15); #recalc authenticator $p_req->set_attr('Message-Authenticator', "\0"x16, 1); $p_req->set_attr('Message-Authenticator', Digest::HMAC_MD5::hmac_md5($p_req->pack, $cfg->{radius}->{secret}), 1); #send brand new and shiny request $s->send($p_req->pack) or die; my $p_data; if ( defined $s->recv($p_data, 2048) ) { my $p_res = new Net::Radius::Packet $d, $p_data; my %response = map { $_ => $p_res->vsattr($d->vendor_num('FreeRADIUS'), $_)->[0] } $p_res->vsattributes($d->vendor_num('FreeRADIUS')); return \%response; }else { warn "no answer, $!\n"; return undef; } } #wrappers for specific types of stats sub radius_stats_get_global { return radius_stats_get(0x1f); } sub radius_stats_get_client { return radius_stats_get(0x3f, 'FreeRADIUS-Stats-Client-Number' => $_[0]); } #main loop of thread fetching status from freeradius server sub radius_updater { radius_stats_init(); while (1) { INFO 'fetching new data'; my $main_stat = radius_stats_get_global(); if ( defined $main_stat ) { my @clients_stat = (); if ( $cfg->{clients} ) { my $client_id = 0; while (1) { my $client_stat = radius_stats_get_client($client_id); last unless exists $client_stat->{'FreeRADIUS-Stats-Client-IP-Address'}; push @clients_stat, $client_stat; $client_id += 1; } } #todo ng: update on demand, and update only parts of snmp visible stats INFO 'got data, updating stats'; radius_snmp_stats($main_stat, \@clients_stat); }else { WARN 'problem with fetching data'; } INFO 'stats updated, sleeping'; sleep $cfg->{radius}->{refresh_rate}; } } #helper to get string from NetSNMP::OID sub oid_s { return join '.', $_[0]->to_array; } #handler for snmp requests from master agent(clients) sub snmp_handler { DEBUG 'got new request'; my ($handler, $registration_info, $request_info, $requests) = @_; lock %snmp_data; lock @snmp_data_k; for ( my $request = $requests; $request; $request = $request->next() ) { INFO 'request type '.$request_info->getMode.' for oid: '.oid_s($request->getOID); if ( $request_info->getMode == MODE_GET ) { my $oid_s = oid_s($request->getOID); if ( exists $snmp_data{$oid_s} ) { $request->setValue($snmp_data{$oid_s}->[0], ''.$snmp_data{$oid_s}->[1]); } }elsif ( $request_info->getMode == MODE_GETNEXT ) { foreach my $oid ( @snmp_data_k ) { #the keys is sorted in ascending order, so we are looking for #first value bigger than one in request if ( $request->getOID < NetSNMP::OID->new($oid) ) { $request->setValue($snmp_data{$oid}->[0], ''.$snmp_data{$oid}->[1]); $request->setOID($oid); last; } } }else { #no write support $request->setError($request_info, SNMP_ERR_READONLY); } } DEBUG 'finished processing the request'; } #init part of subtree for handling radius auth statistics sub radius_snmp_stats_init_auth { my ( $snmp_data_n, $oid, $clients ) = @_; @{$snmp_data_n->{$oid.'.1.1.1.1'} = &share([])} = (ASN_OCTET_STR, ''); #radiusAuthServIdent @{$snmp_data_n->{$oid.'.1.1.1.2'} = &share([])} = (ASN_TIMETICKS, 0); #radiusAuthServUpTime @{$snmp_data_n->{$oid.'.1.1.1.3'} = &share([])} = (ASN_TIMETICKS, 0); #radiusAuthServResetTime @{$snmp_data_n->{$oid.'.1.1.1.4'} = &share([])} = (ASN_INTEGER, 0); #radiusAuthServConfigReset @{$snmp_data_n->{$oid.'.1.1.1.5'} = &share([])} = (ASN_COUNTER, 0); #radiusAuthServTotalAccessRequests @{$snmp_data_n->{$oid.'.1.1.1.6'} = &share([])} = (ASN_COUNTER, 0); #radiusAuthServTotalInvalidRequests @{$snmp_data_n->{$oid.'.1.1.1.7'} = &share([])} = (ASN_COUNTER, 0); #radiusAuthServTotalDupAccessRequests @{$snmp_data_n->{$oid.'.1.1.1.8'} = &share([])} = (ASN_COUNTER, 0); #radiusAuthServTotalAccessAccepts @{$snmp_data_n->{$oid.'.1.1.1.9'} = &share([])} = (ASN_COUNTER, 0); #radiusAuthServTotalAccessRejects @{$snmp_data_n->{$oid.'.1.1.1.10'} = &share([])} = (ASN_COUNTER, 0); #radiusAuthServTotalAccessChallenges @{$snmp_data_n->{$oid.'.1.1.1.11'} = &share([])} = (ASN_COUNTER, 0); #radiusAuthServTotalMalformedAccessRequests @{$snmp_data_n->{$oid.'.1.1.1.12'} = &share([])} = (ASN_COUNTER, 0); #radiusAuthServTotalBadAuthenticators @{$snmp_data_n->{$oid.'.1.1.1.13'} = &share([])} = (ASN_COUNTER, 0); #radiusAuthServTotalPacketsDropped @{$snmp_data_n->{$oid.'.1.1.1.14'} = &share([])} = (ASN_COUNTER, 0); #radiusAuthServTotalUnknownTypes #radiusAuthClientTable for (1 .. scalar @$clients) { @{$snmp_data_n->{$oid.'.1.1.1.15.1.1.'.$_} = &share([])} = (ASN_INTEGER, $_); #radiusAuthClientIndex @{$snmp_data_n->{$oid.'.1.1.1.15.1.2.'.$_} = &share([])} = (ASN_IPADDRESS, pack 'C4', split /\./, $clients->[$_-1]->{'FreeRADIUS-Stats-Client-IP-Address'}); #radiusAuthClientAddress @{$snmp_data_n->{$oid.'.1.1.1.15.1.3.'.$_} = &share([])} = (ASN_OCTET_STR, $clients->[$_-1]->{'FreeRADIUS-Stats-Client-Number'}); #radiusAuthClientID # @{$snmp_data_n->{$oid.'.1.1.1.15.1.4.'.$_} = &share([])} = (ASN_COUNTER, 0); #radiusAuthServAccessRequests # @{$snmp_data_n->{$oid.'.1.1.1.15.1.5.'.$_} = &share([])} = (ASN_COUNTER, 0); #radiusAuthServDupAccessRequests # @{$snmp_data_n->{$oid.'.1.1.1.15.1.6.'.$_} = &share([])} = (ASN_COUNTER, 0); #radiusAuthServAccessAccepts # @{$snmp_data_n->{$oid.'.1.1.1.15.1.7.'.$_} = &share([])} = (ASN_COUNTER, 0); #radiusAuthServAccessRejects # @{$snmp_data_n->{$oid.'.1.1.1.15.1.8.'.$_} = &share([])} = (ASN_COUNTER, 0); #radiusAuthServAccessChallenges # @{$snmp_data_n->{$oid.'.1.1.1.15.1.9.'.$_} = &share([])} = (ASN_COUNTER, 0); #radiusAuthServMalformedAccessRequests # @{$snmp_data_n->{$oid.'.1.1.1.15.1.10.'.$_} = &share([])} = (ASN_COUNTER, 0); #radiusAuthServBadAuthenticators # @{$snmp_data_n->{$oid.'.1.1.1.15.1.11.'.$_} = &share([])} = (ASN_COUNTER, 0); #radiusAuthServPacketsDropped # @{$snmp_data_n->{$oid.'.1.1.1.15.1.12.'.$_} = &share([])} = (ASN_COUNTER, 0); #radiusAuthServUnknownTypes } } #init part of subtree for handling radius acct statistics sub radius_snmp_stats_init_acct { my ( $snmp_data_n, $oid, $clients ) = @_; @{$snmp_data_n->{$oid.'.1.1.1.1'} = &share([])} = (ASN_OCTET_STR, ''); #radiusAccServIdent @{$snmp_data_n->{$oid.'.1.1.1.2'} = &share([])} = (ASN_TIMETICKS, 0); #radiusAccServUpTime @{$snmp_data_n->{$oid.'.1.1.1.3'} = &share([])} = (ASN_TIMETICKS, 0); #radiusAccServResetTime @{$snmp_data_n->{$oid.'.1.1.1.4'} = &share([])} = (ASN_INTEGER, 0); #radiusAccServConfigReset @{$snmp_data_n->{$oid.'.1.1.1.5'} = &share([])} = (ASN_COUNTER, 0); #radiusAccServTotalRequests @{$snmp_data_n->{$oid.'.1.1.1.6'} = &share([])} = (ASN_COUNTER, 0); #radiusAccServTotalInvalidRequests @{$snmp_data_n->{$oid.'.1.1.1.7'} = &share([])} = (ASN_COUNTER, 0); #radiusAccServTotalDupRequests @{$snmp_data_n->{$oid.'.1.1.1.8'} = &share([])} = (ASN_COUNTER, 0); #radiusAccServTotalResponses @{$snmp_data_n->{$oid.'.1.1.1.9'} = &share([])} = (ASN_COUNTER, 0); #radiusAccServTotalMalformedRequests @{$snmp_data_n->{$oid.'.1.1.1.10'} = &share([])} = (ASN_COUNTER, 0); #radiusAccServTotalBadAuthenticators @{$snmp_data_n->{$oid.'.1.1.1.11'} = &share([])} = (ASN_COUNTER, 0); #radiusAccServTotalPacketsDropped @{$snmp_data_n->{$oid.'.1.1.1.12'} = &share([])} = (ASN_COUNTER, 0); #radiusAccServTotalNoRecords @{$snmp_data_n->{$oid.'.1.1.1.13'} = &share([])} = (ASN_COUNTER, 0); #radiusAccServTotalUnknownTypes #radiusAccClientTable for (1 .. scalar @$clients) { @{$snmp_data_n->{$oid.'.1.1.1.14.1.1.'.$_} = &share([])} = (ASN_INTEGER, $_); #radiusAccClientIndex @{$snmp_data_n->{$oid.'.1.1.1.14.1.2.'.$_} = &share([])} = (ASN_IPADDRESS, pack 'C4', split /\./, $clients->[$_-1]->{'FreeRADIUS-Stats-Client-IP-Address'}); #radiusAccClientAddress @{$snmp_data_n->{$oid.'.1.1.1.14.1.3.'.$_} = &share([])} = (ASN_OCTET_STR, $clients->[$_-1]->{'FreeRADIUS-Stats-Client-Number'}); #radiusAccClientID # @{$snmp_data_n->{$oid.'.1.1.1.14.1.4.'.$_} = &share([])} = (ASN_COUNTER, 0); #radiusAccServPacketsDropped # @{$snmp_data_n->{$oid.'.1.1.1.14.1.5.'.$_} = &share([])} = (ASN_COUNTER, 0); #radiusAccServRequests # @{$snmp_data_n->{$oid.'.1.1.1.14.1.6.'.$_} = &share([])} = (ASN_COUNTER, 0); #radiusAccServDupRequests # @{$snmp_data_n->{$oid.'.1.1.1.14.1.7.'.$_} = &share([])} = (ASN_COUNTER, 0); #radiusAccServResponses # @{$snmp_data_n->{$oid.'.1.1.1.14.1.8.'.$_} = &share([])} = (ASN_COUNTER, 0); #radiusAccServBadAuthenticators # @{$snmp_data_n->{$oid.'.1.1.1.14.1.9.'.$_} = &share([])} = (ASN_COUNTER, 0); #radiusAccServMalformedRequests # @{$snmp_data_n->{$oid.'.1.1.1.14.1.10.'.$_} = &share([])} = (ASN_COUNTER, 0); #radiusAccServNoRecords # @{$snmp_data_n->{$oid.'.1.1.1.14.1.11.'.$_} = &share([])} = (ASN_COUNTER, 0); #radiusAccServUnknownTypes } } #fill part of subtree with data from radius auth statistics sub radius_snmp_stats_fill_auth { my ( $snmp_data_n, $oid, $prefix, $main, $clients ) = @_; #hmm .. proxy? my $time = time; $snmp_data_n->{$oid.'.1.1.1.1'}->[1] = 'snmp(over)radius'; $snmp_data_n->{$oid.'.1.1.1.2'}->[1] = ($time - $main->{'FreeRADIUS-Stats-Start-Time'})*100; $snmp_data_n->{$oid.'.1.1.1.3'}->[1] = ($time - $main->{'FreeRADIUS-Stats-HUP-Time'})*100; $snmp_data_n->{$oid.'.1.1.1.4'}->[1] = 0; $snmp_data_n->{$oid.'.1.1.1.5'}->[1] += $main->{$prefix.'Access-Requests'}; $snmp_data_n->{$oid.'.1.1.1.6'}->[1] += $main->{$prefix.'Auth-Invalid-Requests'}; $snmp_data_n->{$oid.'.1.1.1.7'}->[1] += $main->{$prefix.'Auth-Duplicate-Requests'}; $snmp_data_n->{$oid.'.1.1.1.8'}->[1] += $main->{$prefix.'Access-Accepts'}; $snmp_data_n->{$oid.'.1.1.1.9'}->[1] += $main->{$prefix.'Access-Rejects'}; $snmp_data_n->{$oid.'.1.1.1.10'}->[1] += $main->{$prefix.'Access-Challenges'}; $snmp_data_n->{$oid.'.1.1.1.11'}->[1] += $main->{$prefix.'Auth-Malformed-Requests'}; $snmp_data_n->{$oid.'.1.1.1.12'}->[1] += 0; $snmp_data_n->{$oid.'.1.1.1.13'}->[1] += $main->{$prefix.'Auth-Dropped-Requests'}; $snmp_data_n->{$oid.'.1.1.1.14'}->[1] += $main->{$prefix.'Auth-Unknown-Types'}; for (1 .. scalar @$clients) { # $snmp_data_n->{$oid.'.1.1.1.15.1.4.'.$_}->[1] += $clients->[$_-1]->{$prefix.'Access-Requests'}; # $snmp_data_n->{$oid.'.1.1.1.15.1.5.'.$_}->[1] += $clients->[$_-1]->{$prefix.'Auth-Duplicate-Requests'}; # $snmp_data_n->{$oid.'.1.1.1.15.1.6.'.$_}->[1] += $clients->[$_-1]->{$prefix.'Access-Accepts'}; # $snmp_data_n->{$oid.'.1.1.1.15.1.7.'.$_}->[1] += $clients->[$_-1]->{$prefix.'Access-Rejects'}; # $snmp_data_n->{$oid.'.1.1.1.15.1.8.'.$_}->[1] += $clients->[$_-1]->{$prefix.'Access-Challenges'}; # $snmp_data_n->{$oid.'.1.1.1.15.1.9.'.$_}->[1] += $clients->[$_-1]->{$prefix.'Auth-Malformed-Requests'}; # $snmp_data_n->{$oid.'.1.1.1.15.1.10.'.$_}->[1] += 0; # $snmp_data_n->{$oid.'.1.1.1.15.1.11.'.$_}->[1] += $clients->[$_-1]->{$prefix.'Auth-Dropped-Requests'}; # $snmp_data_n->{$oid.'.1.1.1.15.1.12.'.$_}->[1] += $clients->[$_-1]->{$prefix.'Auth-Unknown-Types'}; } } #fill part of subtree with data from radius acct statistics sub radius_snmp_stats_fill_acct { my ( $snmp_data_n, $oid, $prefix, $main, $clients ) = @_; #hmm .. proxy? my $time = time; $snmp_data_n->{$oid.'.1.1.1.1'}->[1] = 'snmp(over)radius'; $snmp_data_n->{$oid.'.1.1.1.2'}->[1] = ($time - $main->{'FreeRADIUS-Stats-Start-Time'})*100; $snmp_data_n->{$oid.'.1.1.1.3'}->[1] = ($time - $main->{'FreeRADIUS-Stats-HUP-Time'})*100; $snmp_data_n->{$oid.'.1.1.1.4'}->[1] = 0; $snmp_data_n->{$oid.'.1.1.1.5'}->[1] += $main->{$prefix.'Accounting-Requests'}; $snmp_data_n->{$oid.'.1.1.1.6'}->[1] += $main->{$prefix.'Acct-Invalid-Requests'}; $snmp_data_n->{$oid.'.1.1.1.7'}->[1] += $main->{$prefix.'Acct-Duplicate-Requests'}; $snmp_data_n->{$oid.'.1.1.1.8'}->[1] += $main->{$prefix.'Accounting-Responses'}; $snmp_data_n->{$oid.'.1.1.1.9'}->[1] += $main->{$prefix.'Acct-Malformed-Requests'}; $snmp_data_n->{$oid.'.1.1.1.10'}->[1] += 0; $snmp_data_n->{$oid.'.1.1.1.11'}->[1] += $main->{$prefix.'Acct-Dropped-Requests'}; $snmp_data_n->{$oid.'.1.1.1.12'}->[1] += 0; $snmp_data_n->{$oid.'.1.1.1.13'}->[1] += $main->{$prefix.'Acct-Unknown-Types'}; for (1 .. scalar @$clients) { # $snmp_data_n->{$oid.'.1.1.1.14.1.4.'.$_}->[1] += $clients->[$_-1]->{$prefix.''};# 'radiusAccServPacketsDropped'; # $snmp_data_n->{$oid.'.1.1.1.14.1.5.'.$_}->[1] += $clients->[$_-1]->{$prefix.''};# 'radiusAccServRequests'; # $snmp_data_n->{$oid.'.1.1.1.14.1.6.'.$_}->[1] += $clients->[$_-1]->{$prefix.''};# 'radiusAccServDupRequests'; # $snmp_data_n->{$oid.'.1.1.1.14.1.7.'.$_}->[1] += $clients->[$_-1]->{$prefix.''};# 'radiusAccServResponses'; # $snmp_data_n->{$oid.'.1.1.1.14.1.8.'.$_}->[1] += $clients->[$_-1]->{$prefix.''};# 'radiusAccServBadAuthenticators'; # $snmp_data_n->{$oid.'.1.1.1.14.1.9.'.$_}->[1] += $clients->[$_-1]->{$prefix.''};# 'radiusAccServMalformedRequests'; # $snmp_data_n->{$oid.'.1.1.1.14.1.10.'.$_}->[1] += $clients->[$_-1]->{$prefix.''};# 'radiusAccServNoRecords'; # $snmp_data_n->{$oid.'.1.1.1.14.1.11.'.$_}->[1] += $clients->[$_-1]->{$prefix.''};# 'radiusAccServUnknownTypes'; } } #update statistics sub radius_snmp_stats { my ( $main, $clients ) = @_; #print Dumper($main, $clients); my %snmp_data_n; # we have to go through all oid's foreach my $oid_s ( keys %{$cfg->{snmp}->{oid_sub}} ) { #we're rebuilding the tree for data #we could do it only once, but it will change when we will start handling more dynamic #tree (clients) my %types = map { $_ => 1 } map { /(?:proxy)?(\w+)/; $1 } @{$cfg->{snmp}->{oid_sub}->{$oid_s}}; WARN 'two conflicting types for oid '.$oid_s if scalar keys %types > 1; if ( (keys %types)[0] eq 'auth' ) { radius_snmp_stats_init_auth(\%snmp_data_n, $cfg->{snmp}->{oid_root}.'.'.$oid_s, $clients); }elsif ( (keys %types)[0] eq 'acct' ) { radius_snmp_stats_init_acct(\%snmp_data_n, $cfg->{snmp}->{oid_root}.'.'.$oid_s, $clients); }else { WARN 'unknown subtree type '.(keys %types)[0]; } #now lets refill the statistics foreach my $type ( @{$cfg->{snmp}->{oid_sub}->{$oid_s}} ) { if ( $type eq 'auth' ) { radius_snmp_stats_fill_auth( \%snmp_data_n, $cfg->{snmp}->{oid_root}.'.'.$oid_s, 'FreeRADIUS-Total-', $main, $clients); }elsif ( $type eq 'proxyauth' ) { radius_snmp_stats_fill_auth( \%snmp_data_n, $cfg->{snmp}->{oid_root}.'.'.$oid_s, 'FreeRADIUS-Total-Proxy-', $main, $clients); }elsif ( $type eq 'acct' ) { radius_snmp_stats_fill_acct( \%snmp_data_n, $cfg->{snmp}->{oid_root}.'.'.$oid_s, 'FreeRADIUS-Total-', $main, $clients); }elsif ( $type eq 'proxyacct' ) { radius_snmp_stats_fill_acct( \%snmp_data_n, $cfg->{snmp}->{oid_root}.'.'.$oid_s, 'FreeRADIUS-Total-Proxy-', $main, $clients); }else { WARN 'unknown subtree type '.$type; } } } #we rebuild the tree, so lets now lock the shared variables and push new data there lock %snmp_data; lock @snmp_data_k; %snmp_data = %snmp_data_n; @snmp_data_k = map { oid_s($_) } sort { $a <=> $b } map { NetSNMP::OID->new($_) } keys %snmp_data_n; } =head1 NAME freeradius snmp agentx subagent =head1 VERSION =head1 SYNOPSIS make sure snmpd is agentx master (snmpd.conf): master agentx run the script (no demonizing support yet): ./freeradius-snmp.pl then you can walk the tree (default oid): snmpbulkwalk -On -v2c -cpublic localhost .1.3.6.1.2.1.67 =head1 DESCRIPTION =head1 DEPENDENCIES Net-Radius (either 1.56 + net-radius-freeradius-dictionary.diff to use freeradius dictionaries or vanilla upstream one + dictionary.hacked) NetSNMP perl modules (available with net-snmp distribution) Digest::HMAC Log::Log4perl =head1 AUTHOR Stanislaw Sawa =head1 COPYRIGHT Copyright (C) 2008 Sky Network Services. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. freeradius-server/scripts/snmp-proxy/net-radius-freeradius-dictionary.diff000066400000000000000000000035421257552170400275510ustar00rootroot00000000000000--- Net-Radius-1.56.orig/Radius/Dictionary.pm 2008-06-20 14:08:57.000000000 +0100 +++ Net-Radius-1.56.1/Radius/Dictionary.pm 2008-06-20 15:54:33.000000000 +0100 @@ -30,14 +30,23 @@ sub readfile { my ($self, $filename) = @_; + my $dict; - open DICT, "<$filename"; + open $dict, "<$filename"; - while (defined(my $l = )) { + my @in_vendor = (); + + while (defined(my $l = <$dict>)) { next if $l =~ /^\#/; next unless my @l = split /\s+/, $l; - if ($l[0] =~ m/^vendor$/i) + if ($l[0] =~ m/^\$include$/i) + { + my @fn = split /\//, $filename; + $fn[$#fn] = $l[1]; + $self->readfile(join '/', @fn); + } + elsif ($l[0] =~ m/^vendor$/i) { if (defined $l[1] and defined $l[2] and $l[2] =~ /^[xo0-9]+$/) { @@ -53,8 +62,42 @@ warn "Garbled VENDOR line $l\n"; } } + elsif ($l[0] =~ m/^begin-vendor$/i) + { + if ( defined $l[1] ) + { + push @in_vendor, $l[1]; + } + else + { + warn "Garbled BEGIN-VENDOR line $l\n"; + } + } + elsif ($l[0] =~ m/^end-vendor$/i) + { + if ( defined $l[1] ) + { + if ( $in_vendor[$#in_vendor] eq $l[1] ) { + pop @in_vendor; + }else { + warn "mismatched END-VENDOR line $l\n"; + } + } + else + { + warn "Garbled END-VENDOR line $l\n"; + } + } elsif ($l[0] =~ m/^attribute$/i) { + if (@l == 5) { + my @tags = grep { not ( m/^encrypt=\d$/ or m/^has_tag$/ ) } split /,/, pop @l; + push @l, join ',', @tags if scalar @tags; + } + if (@l == 4 and scalar @in_vendor) { + push @l, $in_vendor[$#in_vendor]; + } + if (@l == 4) { $self->{attr}->{$l[1]} = [@l[2,3]]; @@ -166,7 +209,7 @@ warn "Warning: Weird dictionary line: $l\n"; } } - close DICT; + close $dict; } # Accessors for standard attributes freeradius-server/scripts/solaris/000077500000000000000000000000001257552170400176665ustar00rootroot00000000000000freeradius-server/scripts/solaris/.gitignore000066400000000000000000000000131257552170400216500ustar00rootroot00000000000000svc-radius freeradius-server/scripts/solaris/README.md000066400000000000000000000026461257552170400211550ustar00rootroot00000000000000# Solaris startup scripts SMF is the Solaris version of upstart (or the reverse), it imports XML configuration file for services, and manages service dependencies. It will automatically restart daemons in they die, and provides a standard interface for checking the status of a service and administratively disabling/enabling it. # Installation/configuration ## Solaris 10 Do the following as the root user ``sudo -s``. Copy the service management script ``svc-radius`` to ``/lib/srv/method/``: ```bash cp ./svc-radius /lib/svc/method/ chown root:bin /lib/svc/method/svc-radius chmod 555 /lib/svc/method/svc-radius ``` Copy the ``radius.xml`` manifest to ``/var/svc/manifest/network/``, and import it into SMF: ```bash cp ./radius.xml /var/svc/manifest/network/ svccfg import /var/svc/manifest/network/radius.xml ``` ### Authorizing additional users First create an authorisation entry for the radius service: ```bash echo "solaris.smf.manage.radius/server:::FreeRADIUS Server management::" >> /etc/security/auth_attr ``` Next instruct SMF to use RBAC for authorising actions on this particular service (only works with local accounts): ```bash svccfg -s radius setprop general/action_authorization=astring: 'solaris.smf.manage.radius/server' ``` Then assign this authorisation to our one or more users: ```bash usermod -A solaris.smf.manage.radius/server ``` And finally test with (as authorized user): ```bash svcs radius ``` freeradius-server/scripts/solaris/radius.xml000066400000000000000000000042041257552170400216770ustar00rootroot00000000000000 freeradius-server/scripts/solaris/svc-radius.in000077500000000000000000000050441257552170400223040ustar00rootroot00000000000000#!/bin/sh . /lib/svc/share/smf_include.sh # # # radiusd Start the radius daemon. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA # # Copyright (C) 2001-2012 The FreeRADIUS Project http://www.freeradius.org prefix=@prefix@ exec_prefix=@exec_prefix@ sbindir=@sbindir@ localstatedir=@localstatedir@ logdir=@logdir@ rundir=${localstatedir}/run/radiusd sysconfdir=@sysconfdir@ # # If you have issues with OpenSSL, uncomment these next lines. # # Something similar may work for MySQL, and you may also # have to LD_PRELOAD libz.so # #LD_LIBRARY_PATH= -lcrypto -lssl -lcrypto #LD_RUN_PATH= -lcrypto -lssl -lcrypto: #LD_PRELOAD= -lcrypto -lssl -lcryptolibcrypto.so export LD_LIBRARY_PATH LD_RUN_PATH LD_PRELOAD RADIUSD=$sbindir/radiusd RADDBDIR=@raddbdir@ DESC="FreeRADIUS" # # See 'man radiusd' for details on command-line options. # ARGS="" test -f $RADIUSD || exit $SMF_EXIT_ERR_CONFIG test -f $RADDBDIR/radiusd.conf || exit $SMF_EXIT_ERR_CONFIG #if [ ! -d $rundir ] ; then # mkdir $rundir # chown radmin:radius # chmod 775 $rundir #fi # #if [ ! -d $logdir ] ; then # mkdir $logdir # chown radmin:radius $logdir # chmod 770 $logdir # chmod g+s $logdir #fi # #if [ ! -f $logdir/radius.log ]; then # touch $logdir/radius.log #fi # #chown radmin:radius $logdir/radius.log #chmod 660 $logdir/radius.log case "$1" in start) echo -n "Starting $DESC: " $RADIUSD $ARGS echo "radiusd" ;; stop) echo -n "Stopping $DESC: " smf_kill_contract $2 TERM 1 [ $? -ne 0 ] && exit 1 echo "radiusd." ;; refresh) echo "Reloading $DESC configuration files." [ -f $rundir/radiusd.pid ] && kill -HUP `cat $rundir/radiusd.pid` ;; check) $RADIUSD -CX $ARGS exit $? ;; *) echo "Usage: $0 {start|stop|refresh|check}" exit 1 esac exit $SMF_EXIT_OK freeradius-server/scripts/users2mysql.pl000066400000000000000000000101041257552170400210540ustar00rootroot00000000000000#!/usr/bin/perl -w # # users2mysql.pl -- a script to parse a RADIUS users file and fill # a freeradius mysql database... # # # Script developed by Rich Puhek, Znet Telecom # # last change: Aug 8th, 2002. # #Modify to suit your db. $database="radius"; $hostname="localhost"; $user="radius"; $password="passwd"; #location of source users file: $users_file="/etc/raddb_cistron_backup/users"; #The following are defaults from freeradius 0.7 # ...shouldn't have to change. $groups_table="usergroup"; $check_table="radcheck"; $reply_table="radreply"; $debug=3; use DBD::mysql; #open the users file, and the db. open USERS, $users_file or die "ERROR: Unable to open $users_file $!\n"; $database = DBI->connect("DBI:mysql:$database:$hostname",$user, $password) or die "ERROR: Unable to connect to $database on $hostname $!\n"; sub check_attribs { if (!defined($_[0]) or !defined($_[1])) { print "undefined parameter!\n"; return undef; }; $attr = $_[0]; $val = $_[1]; if ($attr !~ /Password|Framed-IP-Address|Framed-IP-Netmask|Framed-IP-Routing|Framed-Routing|Framed-IP-Route|Password|Simultaneous-Use|Idle-Timeout|Auth-Type|Service-Type|Netmask|Framed-Protocol/ ) { print "unrecognized attribute: $attr\n" if $debug>1; return undef; }; return undef if ( (! defined($val) ) or ( ($attr =~ /Simultaneous\-Use/i) && ( $val !~ /^[0-9]*$/ ) ) ); print "attribs ok!\n" if $debug>3; return "TRUE"; }; sub cleanup { #clean up variables: strip leading/trailing spaces and trailing commas... my $myval; $myval = $_[0]; $myval =~ s/^\s//g; $myval =~ s/\s$//g; $myval =~ s/,$//; return $myval; }; sub user_attribute { #push values into db... $dtable=$_[0]; $duser=$_[1]; $dattrib=$_[2]; $dval=$_[3]; print "inserting \"$dattrib\", \"$dval\" for \"$duser\" in rad$dtable\n" if ( $dtable !~ /group/ and $debug>2); print "inserting \"$duser\" into usergroup table as member of \"$dattrib\"\n" if ( $dtable =~ /group/ and $debug>2); if ( $dtable =~ /group/ ) { $table = "usergroup"; } elsif ( $dtable =~ /check/ ) { $table = "radcheck"; } elsif ( $dtable =~ /reply/ ) { $table = "radreply"; } else { die "argh! what table is $dtable?\n"; }; if ( $table =~ /usergroup/ ) { if ( $dattrib =~ /static/ ) { #Delete the "dynamic" entry... $return = $database->do ("DELETE FROM `$table` WHERE `UserName`='$duser' LIMIT 1"); }; $return = $database->do ("INSERT INTO `$table` SET `UserName`='$duser',`GroupName`='$dattrib'"); } else { $return = $database->do ("INSERT INTO `$table` SET `UserName`='$duser',`Attribute`='$dattrib',`Value`='$dval', `op`=':='"); }; return $return; }; while () { chop; #Skip comment lines and blank lines... next if ( /^\#/ ); next if ( /^$/ ); next if ( /^\s*$/ ); if ( /^[a-zA-Z0-9]+/ ) { print "located a user entry: $_\n" if $debug>6; ($user,$rest) = split /\s/, $_, 2; #Put user into usergroup as dynamic, if the user's attributes # include an IP address, the script will change that later... user_attribute("group",$user,"dynamic",""); @attribs = split /,/, $rest; } else { # Already found the user, now finding attributes... @attribs = $_; }; foreach $attr (@attribs) { ($attrib,$value) = split /=/, $attr, 2; #TODO: insert sanity checks here! $value = cleanup($value) if (defined($value)); $attrib = cleanup($attrib) if (defined($attrib)); unless (check_attribs($attrib,$value)) { print "ERROR: something bad with line $.: \"$attrib\", \"$value\"\n"; next; }; print "attrib: $attrib has value: $value\n" if $debug>8; if ( $attrib =~ /Framed-IP-Address/ ) { #user is a static IP user... $static{$user} = 1; user_attribute("group",$user,"static",""); }; if ( $attrib =~ /Password|Simultaneous-Use/ ) { #This is an individual check attribute, so we'll pass it along... user_attribute("check",$user,$attrib,$value); }; if ( $attrib =~ /Framed-IP-Address|Framed-IP-Routing|Framed-Routing/ ) { #This is an individual reply attribute, so we'll pass this along... user_attribute("reply",$user,$attrib,$value); }; }; }; close USERS; exit($database->disconnect);freeradius-server/share/000077500000000000000000000000001257552170400156255ustar00rootroot00000000000000freeradius-server/share/Makefile000066400000000000000000000003421257552170400172640ustar00rootroot00000000000000# # Scripts to format dictionary files. # # $Id$ # # # This should only be run by hand, and then sanity checked by hand! # format: $(wildcard dictionary*) @for x in $(wildcard dictionary*) ; do \ ./format.pl $$x; \ done freeradius-server/share/attrnew.pl000077500000000000000000000036161257552170400176570ustar00rootroot00000000000000#!/usr/bin/env perl # # Print out the ATTRIBUTE's which are defined only once on input, # and any VALUE's which are defined for those attributes. It does NOT # print out unique VALUEs for multiple-defined attributes, though. # # Usage: cat dictionary1 dictionary2 | ./attrnew.pl > unique # # This is a bit of a hack. In order to make it work, you've got to # add a "fake" attribute to the end of dictionary1, so that you know # which attributes belong to which dictionary... # # $Id$ # $line = 0; while (<>) { $line++; # # Get attribute. # if (/^ATTRIBUTE\s+([\w-]+)\s+(\w+)\s+(\w+)(.*)/) { $name=$1; $value = $2; $type = $3; $stuff = $4; $value =~ tr/[A-F]/[a-f]/; # normal form for hex $value =~ tr/X/x/; if ($value =~ /^0x/) { $index = hex $value; } else { $index = $value; } if (defined $attributes{$index}) { $dup{$index}++; } else { $first_ref{$line} = $index; } $attributes{$index} = "$name $value $type$stuff"; $name2val{$name} = $index; next; } # # Values. # if (/^VALUE\s+([\w-]+)\s+([\w-\/,.]+)\s+(\w+)(.*)/) { $attr = $1; $name = $2; $value = $3; $stuff = $d; $value =~ tr/[A-F]/[a-f]/; # normal form for hex $value =~ tr/X/x/; if ($value =~ /^0x/) { $index = hex $value; } else { $index = $value; } if (!defined $name2val{$attr}) { print "# FIXME: FORWARD REF?\nVALUE $attr $name $value$stuff\n"; next; } $values{$name2val{$attr}}{$index} = "$attr $name $value$stuff"; next; } } # # Print out the attributes sorted by number. # foreach $line (sort {$a <=> $b} keys %first_ref) { $attr_val = $first_ref{$line}; next if (defined $dup{$attr_val}); print "ATTRIBUTE ", $attributes{$attr_val}, "\n"; next if (!defined %{$values{$attr_val}}); foreach $value (sort {$a <=> $b} keys %{$values{$attr_val}}) { print "VALUE ", $values{$attr_val}{$value}, "\n"; } } freeradius-server/share/attrsort.pl000077500000000000000000000033651257552170400200560ustar00rootroot00000000000000#!/usr/bin/env perl # # Sort the attributes in a dictionary, and put them into a canonical # form. This will DESTROY any comments! # # Usage: cat dictionary | ./attrsort.pl > new # # This is a bit of a hack. The main purpose is to be able to quickly # "diff" two dictionaries which have significant differences... # # $Id$ # while (<>) { # # Get attribute. # if (/^ATTRIBUTE\s+([\w-]+)\s+(\w+)\s+(\w+)(.*)/) { $name=$1; $value = $2; $type = $3; $stuff = $4; $value =~ tr/[A-F]/[a-f]/; # normal form for hex $value =~ tr/X/x/; if ($value =~ /^0x/) { $index = hex $value; } else { $index = $value; } $attributes{$index} = "$name $value $type$stuff"; $name2val{$name} = $index; next; } # # Values. # if (/^VALUE\s+([\w-]+)\s+([\w-\/,.]+)\s+(\w+)(.*)/) { $attr = $1; $name = $2; $value = $3; $stuff = $d; $value =~ tr/[A-F]/[a-f]/; # normal form for hex $value =~ tr/X/x/; if ($value =~ /^0x/) { $index = hex $value; } else { $index = $value; } if (!defined $name2val{$attr}) { print "# FIXME: FORWARD REF?\nVALUE $attr $name $value$stuff\n"; next; } $values{$name2val{$attr}}{$index} = "$attr $name $value$stuff"; next; } } # # Print out the attributes sorted by number. # foreach $attr_val (sort {$a <=> $b} keys %attributes) { print "ATTRIBUTE ", $attributes{$attr_val}, "\n"; } foreach $value (sort {$a <=> $b} keys %values) { print $value, "\t", $attributes{$value}, "\n"; } # # And again, this time printing out values. # foreach $attr_val (sort {$a <=> $b} keys %attributes) { next if (!defined %{$values{$attr_val}}); foreach $value (sort {$a <=> $b} keys %{$values{$attr_val}}) { print "VALUE ", $values{$attr_val}{$value}, "\n"; } } freeradius-server/share/backref.pl000077500000000000000000000057241257552170400175720ustar00rootroot00000000000000#!/usr/bin/env perl # # Cross-reference RFC attributes. # # $Id$ # $begin_vendor = 0; $blank = 0; while (@ARGV) { $filename = shift; open FILE, "<$filename" or die "Failed to open $filename: $!\n"; @output = (); while () { # # Clear out trailing whitespace # s/[ \t]+$//; # # And CR's # s/\r//g; # # Suppress multiple blank lines # if (/^\s+$/) { next if ($blank == 1); $blank = 1; next; } $blank = 0; # # Remember the vendor # if (/^VENDOR\s+([\w-]+)\s+(\w+)(.*)/) { $name=$1; $len = length $name; if ($len < 32) { $lenx = 32 - $len; $lenx += 7; # round up $lenx /= 8; $lenx = int $lenx; $tabs = "\t" x $lenx; } else { $tabs = " "; } $vendor = $name; next; } # # Remember if we did begin-vendor. # if (/^BEGIN-VENDOR\s+([\w-]+)/) { $begin_vendor = 1; if (!defined $vendor) { $vendor = $1; } elsif ($vendor ne $1) { # do something smart } next; } # # Get attribute. # if (/^ATTRIBUTE\s+([\w-]+)\s+(\w+)\s+(\w+)(.*)/) { $name=$1; $len = length $name; if ($len < 40) { $lenx = 40 - $len; $lenx += 7; # round up $lenx /= 8; $lenx = int $lenx; $tabs = "\t" x $lenx; if ($tabs eq "") { $tabs = " "; } } else { $tabs = " "; } $value = $2; $type = $3; $stuff = $4; if ($begin_vendor == 0) { # # FIXME: Catch and print conflicting attributes. # $file{$value} = $filename; $file{$value} =~ s/dictionary\.//; $name{$value} = $name . $tabs; } # # See if it's old format, with the vendor at the end of # the line. If so, make it the new format. # if ($stuff =~ /$vendor/) { if ($begin_vendor == 0) { $begin_vendor = 1; } $stuff =~ s/$vendor//; $stuff =~ s/\s+$//; } next; } # # Values. # if (/^VALUE\s+([\w-]+)\s+([\w-\/,.]+)\s+(\w+)(.*)/) { $attr=$1; $len = length $attr; if ($len < 32) { $lenx = 32 - $len; $lenx += 7; # round up $lenx /= 8; $lenx = int $lenx; $tabsa = "\t" x $lenx; if ($tabsa eq "") { $tabsa = " "; $len += 1; } else { $len -= $len % 8; $len += 8 * length $tabsa; } } else { $tabsa = " "; $len += 1; } # # For the code below, we assume that the attribute lengths # if ($len < 32) { $lena = 0; } else { $lena = $len - 32; } $name = $2; $len = length $name; if ($len < 24) { $lenx = 24 - $lena - $len; $lenx += 7; # round up $lenx /= 8; $lenx = int $lenx; $tabsn = "\t" x $lenx; if ($tabsn eq "") { $tabsn = " "; } } else { $tabsn = " "; } next; } # # Remember if we did this. # if (/^END-VENDOR/) { $begin_vendor = 0; } # # Everything else gets dumped out as-is. # } close FILE; } # # Print out the attributes. # foreach $attr (sort {$a <=> $b} keys %file) { print $name{$attr}, $attr, "\t", $file{$attr}, "\n"; } freeradius-server/share/dct2fr000077500000000000000000000013221257552170400167350ustar00rootroot00000000000000#!/usr/bin/perl # # Horrible hack to convert Funk dictionaries to FreeRADIUS ones. # # It won't convert everything, and the files still need to be # edited afterwards, but it's a start. # # ./dct2fr foo.dct > dictionary.foo # vi dictionary.foo # replace 'foo' with the real vendor name # ./format.pl dictionary.foo # while (<>) { if (/^MACRO\s+([^ \t\(]+)\(t,s\)\s+26\s+\[vid=(\d+)\s+type1=\%t\%\s+len1=\+2\s+data=\%s\%/) { $name = $1; $vendor = $2; print "VENDOR foo $2\n"; print "BEGIN-VENDOR foo\n"; } # if (/^ATTRIBUTE\s+([^ \t]+)\s+$name\s*\((\d+),s+(\w+)\)/i) { if (/^ATTRIBUTE\s+([^ \t]+)\s+$name\s*\((\d+)\s*,\s*(\w+)/i) { print "ATTRIBUTE $1 $2 $3\n"; } } print "END-VENDOR foo\n"; freeradius-server/share/dictionary000066400000000000000000000176461257552170400177330ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2011 The FreeRADIUS Server project and contributors # # Version $Id$ # # DO NOT EDIT THE FILES IN THIS DIRECTORY # # The files in this directory are maintained and updated by # the FreeRADIUS project. Newer releases of software may update # or change these files. # # Use the main dictionary file (usually /etc/raddb/dictionary) # for local system attributes and $INCLUDEs. # # # # This file contains dictionary translations for parsing # requests and generating responses. All transactions are # composed of Attribute/Value Pairs. The value of each attribute # is specified as one of 4 data types. Valid data types are: # # text - printable, generally UTF-8 encoded (subset of 'string') # string - 0-253 octets # ipaddr - 4 octets in network byte order # integer - 32 bit value in big endian order (high byte first) # date - 32 bit value in big endian order - seconds since # 00:00:00 GMT, Jan. 1, 1970 # ifid - 8 octets in network byte order # ipv6addr - 16 octets in network byte order # ipv6prefix - 18 octets in network byte order # # FreeRADIUS includes extended data types which are not defined # in the RFC's. These data types are: # # abinary - Ascend's binary filter format. # byte - 8 bit unsigned integer # ether - 6 octets of hh:hh:hh:hh:hh:hh # where 'h' is hex digits, upper or lowercase. # short - 16-bit unsigned integer # octets - raw octets, printed and input as hex strings. # e.g.: 0x123456789abcdef # tlv - type-length-value (only for certain WiMAX attributes) # # # Enumerated values are stored in the user file with dictionary # VALUE translations for easy administration. # # Example: # # ATTRIBUTE VALUE # --------------- ----- # Framed-Protocol = PPP # 7 = 1 (integer encoding) # # # Include compatibility dictionary for older users file. Move # this directive to the end of this file if you want to see the # old names in the logfiles, INSTEAD OF the new names. # $INCLUDE dictionary.compat $INCLUDE dictionary.usr.illegal $INCLUDE dictionary.ascend.illegal # # Include the RFC dictionaries next. # # For a complete list of the standard attributes and values, # see: # http://www.iana.org/assignments/radius-types # $INCLUDE dictionary.rfc2865 $INCLUDE dictionary.rfc2866 $INCLUDE dictionary.rfc2867 $INCLUDE dictionary.rfc2868 $INCLUDE dictionary.rfc2869 $INCLUDE dictionary.rfc3162 $INCLUDE dictionary.rfc3576 $INCLUDE dictionary.rfc3580 $INCLUDE dictionary.rfc4072 $INCLUDE dictionary.rfc4372 $INCLUDE dictionary.rfc4603 $INCLUDE dictionary.rfc4675 $INCLUDE dictionary.rfc4679 $INCLUDE dictionary.rfc4818 $INCLUDE dictionary.rfc4849 $INCLUDE dictionary.rfc5176 $INCLUDE dictionary.rfc5447 $INCLUDE dictionary.rfc5580 $INCLUDE dictionary.rfc5607 $INCLUDE dictionary.rfc5904 $INCLUDE dictionary.rfc6519 $INCLUDE dictionary.rfc6572 $INCLUDE dictionary.rfc6677 $INCLUDE dictionary.rfc6911 $INCLUDE dictionary.rfc6930 $INCLUDE dictionary.rfc7055 $INCLUDE dictionary.rfc7268 # # Include vendor dictionaries after the standard ones. # $INCLUDE dictionary.3com $INCLUDE dictionary.3gpp $INCLUDE dictionary.3gpp2 $INCLUDE dictionary.acc $INCLUDE dictionary.acme $INCLUDE dictionary.airespace $INCLUDE dictionary.alcatel $INCLUDE dictionary.alcatel.sr $INCLUDE dictionary.alcatel-lucent.aaa $INCLUDE dictionary.alteon $INCLUDE dictionary.alvarion $INCLUDE dictionary.apc $INCLUDE dictionary.aruba $INCLUDE dictionary.azaire $INCLUDE dictionary.ascend $INCLUDE dictionary.bay $INCLUDE dictionary.bintec $INCLUDE dictionary.bluecoat $INCLUDE dictionary.broadsoft $INCLUDE dictionary.brocade $INCLUDE dictionary.bskyb $INCLUDE dictionary.bt $INCLUDE dictionary.cablelabs $INCLUDE dictionary.cabletron $INCLUDE dictionary.camiant $INCLUDE dictionary.chillispot $INCLUDE dictionary.cisco # # The Cisco VPN300 dictionary is the same as the altiga one. # You shouldn't use both at the same time. # #$INCLUDE dictionary.cisco.vpn3000 $INCLUDE dictionary.cisco.vpn5000 $INCLUDE dictionary.cisco.bbsm $INCLUDE dictionary.citrix $INCLUDE dictionary.clavister $INCLUDE dictionary.colubris $INCLUDE dictionary.compatible $INCLUDE dictionary.cosine $INCLUDE dictionary.dante $INCLUDE dictionary.dhcp $INCLUDE dictionary.dlink $INCLUDE dictionary.digium $INCLUDE dictionary.dragonwave $INCLUDE dictionary.efficientip $INCLUDE dictionary.eltex $INCLUDE dictionary.epygi $INCLUDE dictionary.erx $INCLUDE dictionary.ericsson $INCLUDE dictionary.ericsson.packet.core.networks $INCLUDE dictionary.extreme $INCLUDE dictionary.f5 $INCLUDE dictionary.fdxtended $INCLUDE dictionary.freeradius $INCLUDE dictionary.freeswitch $INCLUDE dictionary.fortinet $INCLUDE dictionary.foundry $INCLUDE dictionary.gandalf $INCLUDE dictionary.gemtek $INCLUDE dictionary.h3c $INCLUDE dictionary.hp $INCLUDE dictionary.huawei $INCLUDE dictionary.iea $INCLUDE dictionary.infonet $INCLUDE dictionary.issanni $INCLUDE dictionary.itk $INCLUDE dictionary.ipunplugged $INCLUDE dictionary.juniper $INCLUDE dictionary.jradius $INCLUDE dictionary.karlnet $INCLUDE dictionary.kineto $INCLUDE dictionary.lancom $INCLUDE dictionary.livingston $INCLUDE dictionary.localweb $INCLUDE dictionary.lucent $INCLUDE dictionary.manzara $INCLUDE dictionary.merit $INCLUDE dictionary.meru $INCLUDE dictionary.microsoft $INCLUDE dictionary.mikrotik $INCLUDE dictionary.motorola $INCLUDE dictionary.motorola.wimax $INCLUDE dictionary.navini $INCLUDE dictionary.netscreen $INCLUDE dictionary.networkphysics $INCLUDE dictionary.nexans $INCLUDE dictionary.ntua $INCLUDE dictionary.nokia # # Commented out because of attribute conflicts. # #$INCLUDE dictionary.nokia.conflict $INCLUDE dictionary.nomadix $INCLUDE dictionary.nortel # # Commented out because of attribute conflicts. # #$INCLUDE dictionary.openser $INCLUDE dictionary.packeteer $INCLUDE dictionary.paloalto $INCLUDE dictionary.patton $INCLUDE dictionary.propel $INCLUDE dictionary.prosoft $INCLUDE dictionary.proxim $INCLUDE dictionary.purewave $INCLUDE dictionary.quiconnect $INCLUDE dictionary.quintum $INCLUDE dictionary.redback $INCLUDE dictionary.redcreek $INCLUDE dictionary.riverbed $INCLUDE dictionary.riverstone $INCLUDE dictionary.roaringpenguin $INCLUDE dictionary.ruckus $INCLUDE dictionary.shasta $INCLUDE dictionary.sg $INCLUDE dictionary.shiva $INCLUDE dictionary.siemens $INCLUDE dictionary.slipstream $INCLUDE dictionary.sonicwall $INCLUDE dictionary.springtide $INCLUDE dictionary.starent $INCLUDE dictionary.symbol $INCLUDE dictionary.telebit $INCLUDE dictionary.terena $INCLUDE dictionary.trapeze $INCLUDE dictionary.tropos $INCLUDE dictionary.t_systems_nova $INCLUDE dictionary.ukerna $INCLUDE dictionary.unix $INCLUDE dictionary.usr $INCLUDE dictionary.utstarcom $INCLUDE dictionary.valemount $INCLUDE dictionary.versanet $INCLUDE dictionary.vqp $INCLUDE dictionary.waverider $INCLUDE dictionary.walabi $INCLUDE dictionary.wichorus $INCLUDE dictionary.wimax $INCLUDE dictionary.wispr $INCLUDE dictionary.xedia $INCLUDE dictionary.xylan $INCLUDE dictionary.zeus $INCLUDE dictionary.zte $INCLUDE dictionary.zyxel # # And finally the server internal attributes. # $INCLUDE dictionary.freeradius.internal # # Miscellaneous attributes defined in weird places that # don't really belong anywhere else... # ATTRIBUTE Originating-Line-Info 94 string # As defined in draft-sterman-aaa-sip-00.txt ATTRIBUTE Digest-Response 206 string ATTRIBUTE Digest-Attributes 207 octets # stupid format # # Integer Translations # VALUE Service-Type Voice 12 VALUE Service-Type Fax 13 VALUE Service-Type Modem-Relay 14 VALUE Service-Type IAPP-Register 15 VALUE Service-Type IAPP-AP-Check 16 VALUE Framed-Protocol GPRS-PDP-Context 7 VALUE NAS-Port-Type Wireless-CDMA2000 22 VALUE NAS-Port-Type Wireless-UMTS 23 VALUE NAS-Port-Type Wireless-1X-EV 24 VALUE NAS-Port-Type IAPP 25 VALUE NAS-Port-Type FTTP 26 VALUE NAS-Port-Type Wireless-802.16 27 VALUE NAS-Port-Type Wireless-802.20 28 VALUE NAS-Port-Type Wireless-802.22 29 VALUE NAS-Port-Type xPON 35 VALUE NAS-Port-Type Wireless-XGP 36 VALUE Framed-Protocol PPTP 9 freeradius-server/share/dictionary.3com000066400000000000000000000026601257552170400205610ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2011 The FreeRADIUS Server project and contributors # # 3com SuperStack Firewall dictionary # Bought from Sonicwall, apparently, from Enterprise number 8741. # # $Id$ # VENDOR 3com 43 # # These attributes contain the access-level value. # BEGIN-VENDOR 3com ATTRIBUTE 3Com-User-Access-Level 1 integer # Read-only access to basic network tools (ping, etc) VALUE 3Com-User-Access-Level 3Com-Visitor 0 # Read-only access to manageable (not security) parameters VALUE 3Com-User-Access-Level 3Com-Monitor 1 # Read-write access to manageable (not security) parameters VALUE 3Com-User-Access-Level 3Com-Manager 2 # Read-write access to all manageable parameters VALUE 3Com-User-Access-Level 3Com-Administrator 3 ATTRIBUTE 3Com-VLAN-Name 2 string ATTRIBUTE 3Com-Mobility-Profile 3 string ATTRIBUTE 3Com-Encryption-Type 4 string ATTRIBUTE 3Com-Time-Of-Day 5 string ATTRIBUTE 3Com-SSID 6 string # String formatted as: YY/MM/DD-HH:MM # NOT as a "date" attribute! ATTRIBUTE 3Com-End-Date 7 string # Commented out, because the 3Com documentation # gives it the same number as End-Date, above. #ATTRIBUTE 3Com-Start-Date 7 string # URL where the user is redirected after WebAAA ATTRIBUTE 3Com-URL 8 string ATTRIBUTE 3Com-Connect_Id 26 integer ATTRIBUTE 3Com-NAS-Startup-Timestamp 59 integer ATTRIBUTE 3Com-Ip-Host-Addr 60 string ATTRIBUTE 3Com-Product-ID 255 string END-VENDOR 3com freeradius-server/share/dictionary.3gpp000066400000000000000000000042341257552170400205700ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2011 The FreeRADIUS Server project and contributors # # 3GPP stuff. # # ftp://ftp.3gpp.org/specs/2002-06/R1999/29_series/29061-3a0.zip # # $Id$ # VENDOR 3GPP 10415 BEGIN-VENDOR 3GPP # # Most of the 'string' attributes are UTF-8 encoded text. # Maybe we want a UTF-8 'type' in the server... # ATTRIBUTE 3GPP-IMSI 1 string ATTRIBUTE 3GPP-Charging-ID 2 integer ATTRIBUTE 3GPP-PDP-Type 3 integer ATTRIBUTE 3GPP-Charging-Gateway-Address 4 ipaddr ATTRIBUTE 3GPP-GPRS-Negotiated-QoS-profile 5 string ATTRIBUTE 3GPP-SGSN-Address 6 ipaddr ATTRIBUTE 3GPP-GGSN-Address 7 ipaddr ATTRIBUTE 3GPP-IMSI-MCC-MNC 8 string ATTRIBUTE 3GPP-GGSN-MCC-MNC 9 string ATTRIBUTE 3GPP-NSAPI 10 string ATTRIBUTE 3GPP-Session-Stop-Indicator 11 byte ATTRIBUTE 3GPP-Selection-Mode 12 string ATTRIBUTE 3GPP-Charging-Characteristics 13 string ATTRIBUTE 3GPP-Charging-Gateway-IPv6-Address 14 ipv6addr ATTRIBUTE 3GPP-SGSN-IPv6-Address 15 ipv6addr ATTRIBUTE 3GPP-GGSN-IPv6-Address 16 ipv6addr # # This attribute is really an array of IPv6 addresses. # Why the heck couldn't they just send multiple attributes? # ATTRIBUTE 3GPP-IPv6-DNS-Servers 17 octets ATTRIBUTE 3GPP-SGSN-MCC-MNC 18 string ATTRIBUTE 3GPP-Teardown-Indicator 19 byte ATTRIBUTE 3GPP-IMEISV 20 string ATTRIBUTE 3GPP-RAT-Type 21 byte ATTRIBUTE 3GPP-Location-Info 22 octets ATTRIBUTE 3GPP-MS-Time-Zone 23 octets ATTRIBUTE 3GPP-Camel-Charging-Info 24 octets ATTRIBUTE 3GPP-Packet-Filter 25 octets ATTRIBUTE 3GPP-Negotiated-DSCP 26 byte ATTRIBUTE 3GPP-Allocate-IP-Type 27 byte VALUE 3GPP-RAT-Type UTRAN 1 VALUE 3GPP-RAT-TYPE GERAN 2 VALUE 3GPP-RAT-TYPE WLAN 3 VALUE 3GPP-RAT-TYPE GAN 4 VALUE 3GPP-RAT-TYPE HSPA-Evolution 5 VALUE 3GPP-RAT-TYPE EUTRAN 6 VALUE 3GPP-RAT-TYPE Virtual 7 VALUE 3GPP-RAT-Type IEEE-802.16e 101 VALUE 3GPP-RAT-Type 3GPP2-eHRPD 102 VALUE 3GPP-RAT-Type 3GPP2-HRPD 103 VALUE 3GPP-RAT-Type 3GPP2-1xRTT 104 VALUE 3GPP-Allocate-IP-Type Do-Not-Allocate 0 VALUE 3GPP-Allocate-IP-Type Allocate-IPv4-Address 1 VALUE 3GPP-Allocate-IP-Type Allocate-IPv6-Prefix 2 VALUE 3GPP-Allocate-IP-Type Allocate-IPv4-and-IPv6 3 END-VENDOR 3GPP freeradius-server/share/dictionary.3gpp2000066400000000000000000000115741257552170400206570ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2011 The FreeRADIUS Server project and contributors # # 3GPP2 stuff. # # http://www.3gpp2.org/Public_html/specs/index.cfm # X.S0011-005-C v1.0 # http://www.3gpp2.org/Public_html/specs/X.S0011-005-C_v2.0_050708.pdf # http://www.3gpp2.org/public_html/specs/X.S0011-005-C_v3.0_061030.pdf # # $Id$ # VENDOR 3GPP2 5535 BEGIN-VENDOR 3GPP2 ATTRIBUTE 3GPP2-Ike-Preshared-Secret-Request 1 integer ATTRIBUTE 3GPP2-Security-Level 2 integer ATTRIBUTE 3GPP2-Pre-Shared-Secret 3 string # 18 octets ATTRIBUTE 3GPP2-Reverse-Tunnel-Spec 4 integer ATTRIBUTE 3GPP2-Diffserv-Class-Option 5 integer # Contains embedded 3GPP2 accounting attributes. ATTRIBUTE 3GPP2-Accounting-Container 6 octets ATTRIBUTE 3GPP2-Home-Agent-IP-Address 7 ipaddr # A number formed from the concatenation of the home RADIUS IP address, # the FA IP address, and a 32-bit Unix timestamp, all encoded as 8 ASCII # hex characters. ATTRIBUTE 3GPP2-KeyID 8 string # 22 octets ATTRIBUTE 3GPP2-PCF-IP-Address 9 ipaddr ATTRIBUTE 3GPP2-BSID 10 string ATTRIBUTE 3GPP2-User-Id 11 integer ATTRIBUTE 3GPP2-Forward-FCH-Mux-Option 12 integer ATTRIBUTE 3GPP2-Reverse-FCH-Mux-Option 13 integer # # 14-15 ? # ATTRIBUTE 3GPP2-Service-Option 16 integer ATTRIBUTE 3GPP2-Forward-Traffic-Type 17 integer ATTRIBUTE 3GPP2-Reverse-Traffic-Type 18 integer ATTRIBUTE 3GPP2-FCH-Frame-Size 19 integer ATTRIBUTE 3GPP2-Forward-FCH-RC 20 integer ATTRIBUTE 3GPP2-Reverse-FCH-RC 21 integer ATTRIBUTE 3GPP2-IP-Technology 22 integer ATTRIBUTE 3GPP2-Compulsory-Tunnel-Indicator 23 integer ATTRIBUTE 3GPP2-Release-Indicator 24 integer ATTRIBUTE 3GPP2-Bad-PPP-Frame-Count 25 integer # # 26-29 ? # ATTRIBUTE 3GPP2-Number-Active-Transitions 30 integer ATTRIBUTE 3GPP2-Terminating-SDB-Octet-Count 31 integer ATTRIBUTE 3GPP2-Originating-SDB-OCtet-Count 32 integer ATTRIBUTE 3GPP2-Terminating-Number-SDBs 33 integer ATTRIBUTE 3GPP2-Originating-Number-SDBs 34 integer # 35 ? ATTRIBUTE 3GPP2-IP-QoS 36 integer # 37-38 ? ATTRIBUTE 3GPP2-Airlink-Priority 39 integer ATTRIBUTE 3GPP2-Airlink-Record-Type 40 integer # ? #ATTRIBUTE 3GPP2-R-P-Session-ID 41 string ATTRIBUTE 3GPP2-Airlink-Sequence-Number 42 integer # ? ATTRIBUTE 3GPP2-Received-HDLC-Octets 43 integer ATTRIBUTE 3GPP2-Correlation-Id 44 string ATTRIBUTE 3GPP2-Module-Orig-Term-Indicator 45 octets # ? ATTRIBUTE 3GPP2-Inbound-Mobile-IP-Sig-Octets 46 integer ATTRIBUTE 3GPP2-Outbound-Mobile-IP-Sig-Octets 47 integer ATTRIBUTE 3GPP2-Session-Continue 48 integer ATTRIBUTE 3GPP2-Active-Time 49 integer ATTRIBUTE 3GPP2-DCCH-Frame-Size 50 integer ATTRIBUTE 3GPP2-Begin-Session 51 integer ATTRIBUTE 3GPP2-ESN 52 string # 53 ? ATTRIBUTE 3GPP2-S-Key 54 octets ATTRIBUTE 3GPP2-S-Request 55 integer ATTRIBUTE 3GPP2-S-Lifetime 56 date ATTRIBUTE 3GPP2-MN-HA-SPI 57 integer ATTRIBUTE 3GPP2-MN-HA-Shared-Key 58 string encrypt=2 # The next set of attributes contain sub-types ATTRIBUTE 3GPP2-Remote-IP-Address 59 octets # 60 - 69 are marked "reserved" ATTRIBUTE 3GPP2-Remote-IPv6-Address 70 octets ATTRIBUTE 3GPP2-Remote-Address-Table-Index 71 octets ATTRIBUTE 3GPP2-Remote-IPv4-Addr-Octet-Count 72 octets ATTRIBUTE 3GPP2-Allowed-Diffserv-Marking 73 octets ATTRIBUTE 3GPP2-Service-Option-Profile 74 octets # the following don't contain subtypes ATTRIBUTE 3GPP2-DNS-Update-Required 75 integer # Is this 76 or 78? Check... #ATTRIBUTE 3GPP2-Always-On 76 integer # 77 ? #ATTRIBUTE 3GPP2-Always-On 78 integer ATTRIBUTE 3GPP2-Foreign-Agent-Address 79 ipaddr ATTRIBUTE 3GPP2-Last-User-Activity-Time 80 integer ATTRIBUTE 3GPP2-MN-AAA-Removal-Indication 81 integer ATTRIBUTE 3GPP2-RN-Packet-Data-Inactivity-Timer 82 integer ATTRIBUTE 3GPP2-Forward-PDCH-RC 83 integer ATTRIBUTE 3GPP2-Forward-DCCH-Mux-Option 84 integer ATTRIBUTE 3GPP2-Reverse-DCCH-Mux-Option 85 integer ATTRIBUTE 3GPP2-Forward-DCCH-RC 86 integer ATTRIBUTE 3GPP2-Reverse-DHHC-RC 87 integer ATTRIBUTE 3GPP2-Session-Termination-Capability 88 integer ATTRIBUTE 3GPP2-Allowed-Persistent-TFTs 89 integer # The next set of attributes contain sub-types ATTRIBUTE 3GPP2-Prepaid-Acct-Quota 90 octets ATTRIBUTE 3GPP2-Prepaid-acct-Capability 91 octets ATTRIBUTE 3GPP2-MIP-Lifetime 92 octets ATTRIBUTE 3GPP2-Acct-Stop-Trigger 93 integer # contains subtypes ATTRIBUTE 3GPP2-Service-Reference-Id 94 octets ATTRIBUTE 3GPP2-DNS-Update-Capability 95 integer ATTRIBUTE 3GPP2-Disconnect-Reason 96 integer # The next set of attributes contain sub-types ATTRIBUTE 3GPP2-Remote-IPv6-Octet-Count 97 octets ATTRIBUTE 3GPP2-PrePaid-Tariff-Switching 98 octets ATTRIBUTE 3GPP2-MEID 116 octets ATTRIBUTE 3GPP2-DNS-Server-IP-Address 117 octets ATTRIBUTE 3GPP2-Carrier-ID 142 string # More sub-types ATTRIBUTE 3GPP2-GMT-Time-Zone-Offset 143 signed ATTRIBUTE 3GPP2-HA-Request 168 integer ATTRIBUTE 3GPP2-HA-Authorised 169 integer ATTRIBUTE 3GPP2-IP-Ver-Authorised 172 integer ATTRIBUTE 3GPP2-MIPv4-Mesg-Id 173 string END-VENDOR 3GPP2 freeradius-server/share/dictionary.acc000066400000000000000000000252501257552170400204460ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2011 The FreeRADIUS Server project and contributors # # dictionary.acc # Dictionary for Acc/Newbridge, models Tigris, Amazon, etc. # Written by Stephane Marzloff # based on specifications available through ftp and the web. # # Version: @(#)dictionary.acc 1.00 smarzloff 21-Jun-1999 # VENDOR Acc 5 # # Acc specific BEGIN-VENDOR Acc ATTRIBUTE Acc-Reason-Code 1 integer ATTRIBUTE Acc-Ccp-Option 2 integer ATTRIBUTE Acc-Input-Errors 3 integer ATTRIBUTE Acc-Output-Errors 4 integer ATTRIBUTE Acc-Access-Partition 5 string ATTRIBUTE Acc-Customer-Id 6 string ATTRIBUTE Acc-Ip-Gateway-Pri 7 ipaddr ATTRIBUTE Acc-Ip-Gateway-Sec 8 ipaddr ATTRIBUTE Acc-Route-Policy 9 integer ATTRIBUTE Acc-ML-MLX-Admin-State 10 integer ATTRIBUTE Acc-ML-Call-Threshold 11 integer ATTRIBUTE Acc-ML-Clear-Threshold 12 integer ATTRIBUTE Acc-ML-Damping-Factor 13 integer ATTRIBUTE Acc-Tunnel-Secret 14 string ATTRIBUTE Acc-Clearing-Cause 15 integer ATTRIBUTE Acc-Clearing-Location 16 integer ATTRIBUTE Acc-Service-Profile 17 string ATTRIBUTE Acc-Request-Type 18 integer ATTRIBUTE Acc-Bridging-Support 19 integer ATTRIBUTE Acc-Apsm-Oversubscribed 20 integer ATTRIBUTE Acc-Acct-On-Off-Reason 21 integer ATTRIBUTE Acc-Tunnel-Port 22 integer ATTRIBUTE Acc-Dns-Server-Pri 23 ipaddr ATTRIBUTE Acc-Dns-Server-Sec 24 ipaddr ATTRIBUTE Acc-Nbns-Server-Pri 25 ipaddr ATTRIBUTE Acc-Nbns-Server-Sec 26 ipaddr ATTRIBUTE Acc-Dial-Port-Index 27 integer ATTRIBUTE Acc-Ip-Compression 28 integer ATTRIBUTE Acc-Ipx-Compression 29 integer ATTRIBUTE Acc-Connect-Tx-Speed 30 integer ATTRIBUTE Acc-Connect-Rx-Speed 31 integer ATTRIBUTE Acc-Modem-Modulation-Type 32 string ATTRIBUTE Acc-Modem-Error-Protocol 33 string ATTRIBUTE Acc-Callback-Delay 34 integer ATTRIBUTE Acc-Callback-Num-Valid 35 string ATTRIBUTE Acc-Callback-Mode 36 integer ATTRIBUTE Acc-Callback-CBCP-Type 37 integer ATTRIBUTE Acc-Dialout-Auth-Mode 38 integer ATTRIBUTE Acc-Dialout-Auth-Password 39 string ATTRIBUTE Acc-Dialout-Auth-Username 40 string ATTRIBUTE Acc-Access-Community 42 integer ATTRIBUTE Acc-Vpsm-Reject-Cause 43 integer ATTRIBUTE Acc-Ace-Token 44 string ATTRIBUTE Acc-Ace-Token-Ttl 45 integer ATTRIBUTE Acc-Ip-Pool-Name 46 string ATTRIBUTE Acc-Igmp-Admin-State 47 integer ATTRIBUTE Acc-Igmp-Version 48 integer ATTRIBUTE Acc-MN-HA-Secret 73 string ATTRIBUTE Acc-Location-Id 98 string ATTRIBUTE Acc-Calling-Station-Category 99 integer VALUE Acc-Reason-Code No-reason-No-Failure 0 VALUE Acc-Reason-Code Resource-shortage 1 VALUE Acc-Reason-Code Session-already-open 2 VALUE Acc-Reason-Code Too-many-RADIUS-users 3 VALUE Acc-Reason-Code No-authentication-server 4 VALUE Acc-Reason-Code No-authentication-response 5 VALUE Acc-Reason-Code No-accounting-server 6 VALUE Acc-Reason-Code No-accounting-response 7 VALUE Acc-Reason-Code Access-Denied 8 VALUE Acc-Reason-Code Temporary-buffer-shortage 9 VALUE Acc-Reason-Code Protocol-error 10 VALUE Acc-Reason-Code Invalid-attribute 11 VALUE Acc-Reason-Code Invalid-service-type 12 VALUE Acc-Reason-Code Invalid-framed-protocol 13 VALUE Acc-Reason-Code Invalid-attribute-value 14 VALUE Acc-Reason-Code Invalid-user-information 15 VALUE Acc-Reason-Code Invalid-IP-address 16 VALUE Acc-Reason-Code Invalid-integer-syntax 17 VALUE Acc-Reason-Code Invalid-NAS-port 18 VALUE Acc-Reason-Code Requested-by-user 19 VALUE Acc-Reason-Code Network-disconnect 20 VALUE Acc-Reason-Code Service-interruption 21 VALUE Acc-Reason-Code Physical-port-error 22 VALUE Acc-Reason-Code Idle-timeout 23 VALUE Acc-Reason-Code Session-timeout 24 VALUE Acc-Reason-Code Administrative-reset 25 VALUE Acc-Reason-Code NAS-reload-or-reset 26 VALUE Acc-Reason-Code NAS-error 27 VALUE Acc-Reason-Code NAS-request 28 VALUE Acc-Reason-Code Undefined-reason-given 29 VALUE Acc-Reason-Code Conflicting-attributes 30 VALUE Acc-Reason-Code Port-limit-exceeded 31 VALUE Acc-Reason-Code Facility-not-available 32 VALUE Acc-Reason-Code Internal-config-error 33 VALUE Acc-Reason-Code Bad-route-specification 34 VALUE Acc-Reason-Code Access-Partition-bind-failure 35 VALUE Acc-Reason-Code Security-violation 36 VALUE Acc-Reason-Code Request-type-conflict 37 VALUE Acc-Reason-Code Configuration-disallowed 38 VALUE Acc-Reason-Code Missing-attribute 39 VALUE Acc-Reason-Code Invalid-request 40 VALUE Acc-Reason-Code Missing-parameter 41 VALUE Acc-Reason-Code Invalid-parameter 42 VALUE Acc-Reason-Code Call-cleared-with-cause 43 VALUE Acc-Reason-Code Inopportune-config-request 44 VALUE Acc-Reason-Code Invalid-config-parameter 45 VALUE Acc-Reason-Code Missing-config-parameter 46 VALUE Acc-Reason-Code Incompatible-service-profile 47 VALUE Acc-Reason-Code Administrative-reset-2 48 VALUE Acc-Reason-Code Administrative-reload 49 VALUE Acc-Reason-Code Port-unneeded 50 VALUE Acc-Reason-Code Port-preempted 51 VALUE Acc-Reason-Code Port-suspended 52 VALUE Acc-Reason-Code Service-unavailable 53 VALUE Acc-Reason-Code Callback 54 VALUE Acc-Reason-Code User-error 55 VALUE Acc-Reason-Code Host-request 56 VALUE Acc-Ccp-Option Disabled 1 VALUE Acc-Ccp-Option Enabled 2 VALUE Acc-Route-Policy Funnel 1 VALUE Acc-Route-Policy Direct 2 VALUE Acc-ML-MLX-Admin-State Enabled 1 VALUE Acc-ML-MLX-Admin-State Disabled 2 VALUE Acc-Clearing-Cause Cause-unspecified 0 VALUE Acc-Clearing-Cause Unassigned-number 1 VALUE Acc-Clearing-Cause No-route-to-transit-network 2 VALUE Acc-Clearing-Cause No-route-to-destination 3 VALUE Acc-Clearing-Cause Channel-unacceptable 6 VALUE Acc-Clearing-Cause Call-awarded-being-delivered 7 VALUE Acc-Clearing-Cause Normal-clearing 16 VALUE Acc-Clearing-Cause User-busy 17 VALUE Acc-Clearing-Cause No-user-responding 18 VALUE Acc-Clearing-Cause User-alerted-no-answer 19 VALUE Acc-Clearing-Cause Call-rejected 21 VALUE Acc-Clearing-Cause Number-changed 22 VALUE Acc-Clearing-Cause Non-selected-user-clearing 26 VALUE Acc-Clearing-Cause Destination-out-of-order 27 VALUE Acc-Clearing-Cause Invalid-or-incomplete-number 28 VALUE Acc-Clearing-Cause Facility-rejected 29 VALUE Acc-Clearing-Cause Response-to-status-inquiry 30 VALUE Acc-Clearing-Cause Normal-unspecified-cause 31 VALUE Acc-Clearing-Cause No-circuit-or-channel-available 34 VALUE Acc-Clearing-Cause Network-out-of-order 38 VALUE Acc-Clearing-Cause Temporary-failure 41 VALUE Acc-Clearing-Cause Switching-equipment-congestion 42 VALUE Acc-Clearing-Cause Access-information-discarded 43 VALUE Acc-Clearing-Cause Circuit-or-channel-unavailable 44 VALUE Acc-Clearing-Cause Circuit-or-channed-preempted 45 VALUE Acc-Clearing-Cause Resources-unavailable 47 VALUE Acc-Clearing-Cause Quality-of-service-unavailable 49 VALUE Acc-Clearing-Cause Facility-not-subscribed 50 VALUE Acc-Clearing-Cause Outgoing-calls-barred 52 VALUE Acc-Clearing-Cause Incoming-calls-barred 54 VALUE Acc-Clearing-Cause Bearer-capability-unauthorized 57 VALUE Acc-Clearing-Cause Bearer-capability-not-available 58 VALUE Acc-Clearing-Cause Service-not-available 63 VALUE Acc-Clearing-Cause Bearer-capablity-not-implmented 65 VALUE Acc-Clearing-Cause Channel-type-not-implemented 66 VALUE Acc-Clearing-Cause Facility-not-implemented 69 VALUE Acc-Clearing-Cause Restrcted-digtal-infrmtion-only 70 VALUE Acc-Clearing-Cause Service-not-implemented 79 VALUE Acc-Clearing-Cause Invalid-call-reference 81 VALUE Acc-Clearing-Cause Identified-channel-doesnt-exist 82 VALUE Acc-Clearing-Cause Call-identify-in-use 84 VALUE Acc-Clearing-Cause No-call-suspended 85 VALUE Acc-Clearing-Cause Suspended-call-cleared 86 VALUE Acc-Clearing-Cause Incompatible-destination 88 VALUE Acc-Clearing-Cause Invalid-transit-network-selctin 91 VALUE Acc-Clearing-Cause Invalid-message 95 VALUE Acc-Clearing-Cause Mandtory-infrmtion-elment-miss 96 VALUE Acc-Clearing-Cause Message-not-implemented 97 VALUE Acc-Clearing-Cause Inopportune-message 98 VALUE Acc-Clearing-Cause Infrmtion-elemnt-not-implmented 99 VALUE Acc-Clearing-Cause Invlid-infrmtion-element-contnt 100 VALUE Acc-Clearing-Cause Message-incompatible-with-state 101 VALUE Acc-Clearing-Cause Recovery-on-timer-expiration 102 VALUE Acc-Clearing-Cause Mndtry-infrmtion-elmnt-lngt-err 103 VALUE Acc-Clearing-Cause Protocol-error 111 VALUE Acc-Clearing-Cause Interworking 127 VALUE Acc-Clearing-Location Local-or-remote-user 0 VALUE Acc-Clearing-Location Prvte-ntwork-serving-local-user 1 VALUE Acc-Clearing-Location Pblic-ntwork-serving-local-user 2 VALUE Acc-Clearing-Location Transit-network 3 VALUE Acc-Clearing-Location Prvte-ntwork-serv-remote-user 4 VALUE Acc-Clearing-Location Pblic-ntwork-serv-remote-user 5 VALUE Acc-Clearing-Location International-network 6 VALUE Acc-Clearing-Location Beyond-interworking-point 10 VALUE Acc-Request-Type Ring-Indication 1 VALUE Acc-Request-Type Dial-Request 2 VALUE Acc-Request-Type User-Authentication 3 VALUE Acc-Request-Type Tunnel-Authentication 4 VALUE Acc-Bridging-Support Disabled 1 VALUE Acc-Bridging-Support Enabled 2 VALUE Acc-Apsm-Oversubscribed False 1 VALUE Acc-Apsm-Oversubscribed True 2 VALUE Acc-Acct-On-Off-Reason NAS-Reset 0 VALUE Acc-Acct-On-Off-Reason NAS-Reload 1 VALUE Acc-Acct-On-Off-Reason Configuration-Reset 2 VALUE Acc-Acct-On-Off-Reason Configuration-Reload 3 VALUE Acc-Acct-On-Off-Reason Enabled 4 VALUE Acc-Acct-On-Off-Reason Disabled 5 VALUE Acc-Ip-Compression Disabled 1 VALUE Acc-Ip-Compression Enabled 2 VALUE Acc-Ipx-Compression Disabled 1 VALUE Acc-Ipx-Compression Enabled 2 VALUE Acc-Callback-Mode User-Auth 0 VALUE Acc-Callback-Mode User-Specified-E-164 3 VALUE Acc-Callback-Mode CBCP-Callback 6 VALUE Acc-Callback-Mode CLI-Callback 7 VALUE Acc-Callback-CBCP-Type CBCP-None 1 VALUE Acc-Callback-CBCP-Type CBCP-User-Specified 2 VALUE Acc-Callback-CBCP-Type CBCP-Pre-Specified 3 VALUE Acc-Dialout-Auth-Mode PAP 1 VALUE Acc-Dialout-Auth-Mode CHAP 2 VALUE Acc-Dialout-Auth-Mode CHAP-PAP 3 VALUE Acc-Dialout-Auth-Mode NONE 4 VALUE Acc-Access-Community PUBLIC 1 VALUE Acc-Access-Community NETMAN 2 # Acc-Vpsm-Reject-Cause values (available in access-reject packets only) VALUE Acc-Vpsm-Reject-Cause No-Access-Partition 1 VALUE Acc-Vpsm-Reject-Cause Access-Partition-Disabled 2 VALUE Acc-Vpsm-Reject-Cause Partition-Portlimit-Exceeded 3 VALUE Acc-Vpsm-Reject-Cause License-Portlimit-Exceeded 4 VALUE Acc-Vpsm-Reject-Cause Home-Server-Down 5 VALUE Acc-Vpsm-Reject-Cause Rejected-By-Home-Server 6 VALUE Acc-Vpsm-Reject-Cause NAS-Administratively-Disabled 7 # Acc-Igmp-Admin-State values VALUE Acc-Igmp-Admin-State Enabled 1 VALUE Acc-Igmp-Admin-State Disabled 2 # Acc-Igmp-Version values VALUE Acc-Igmp-Version V1 1 VALUE Acc-Igmp-Version V2 2 END-VENDOR Acc freeradius-server/share/dictionary.acme000066400000000000000000000226051257552170400206260ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2011 The FreeRADIUS Server project and contributors # # dictionary.acme # Acme Packet RADIUS Dictionary # # https://support.acmepacket.com # # Version: 6.2.0 30-Oct-2009 Hadriel Kaplan # VENDOR Acme 9148 BEGIN-VENDOR Acme # # Voice over IP attributes. # ATTRIBUTE Acme-FlowID_FS1_F 1 string ATTRIBUTE Acme-FlowType_FS1_F 2 string ATTRIBUTE Acme-Session-Ingress-CallId 3 string ATTRIBUTE Acme-Session-Egress-CallId 4 string ATTRIBUTE Acme-Flow-In-Realm_FS1_F 10 string ATTRIBUTE Acme-Flow-In-Src-Addr_FS1_F 11 ipaddr ATTRIBUTE Acme-Flow-In-Src-Port_FS1_F 12 integer ATTRIBUTE Acme-Flow-In-Dst-Addr_FS1_F 13 ipaddr ATTRIBUTE Acme-Flow-In-Dst-Port_FS1_F 14 integer ATTRIBUTE Acme-Flow-Out-Realm_FS1_F 20 string ATTRIBUTE Acme-Flow-Out-Src-Addr_FS1_F 21 ipaddr ATTRIBUTE Acme-Flow-Out-Src-Port_FS1_F 22 integer ATTRIBUTE Acme-Flow-Out-Dst-Addr_FS1_F 23 ipaddr ATTRIBUTE Acme-Flow-Out-Dst-Port_FS1_F 24 integer ATTRIBUTE Acme-Calling-Octets_FS1 28 integer ATTRIBUTE Acme-Calling-Packets_FS1 29 integer ATTRIBUTE Acme-Calling-RTCP-Packets-Lost_FS1 32 integer ATTRIBUTE Acme-Calling-RTCP-Avg-Jitter_FS1 33 integer ATTRIBUTE Acme-Calling-RTCP-Avg-Latency_FS1 34 integer ATTRIBUTE Acme-Calling-RTCP-MaxJitter_FS1 35 integer ATTRIBUTE Acme-Calling-RTCP-MaxLatency_FS1 36 integer ATTRIBUTE Acme-Calling-RTP-Packets-Lost_FS1 37 integer ATTRIBUTE Acme-Calling-RTP-Avg-Jitter_FS1 38 integer ATTRIBUTE Acme-Calling-RTP-MaxJitter_FS1 39 integer ATTRIBUTE Acme-Session-Generic-Id 40 string ATTRIBUTE Acme-Session-Ingress-Realm 41 string ATTRIBUTE Acme-Session-Egress-Realm 42 string ATTRIBUTE Acme-Session-Protocol-Type 43 string ATTRIBUTE Acme-Called-Octets_FS1 44 integer ATTRIBUTE Acme-Called-Packets_FS1 45 integer ATTRIBUTE Acme-Called-RTCP-Packets-Lost_FS1 46 integer ATTRIBUTE Acme-Called-RTCP-Avg-Jitter_FS1 47 integer ATTRIBUTE Acme-Called-RTCP-Avg-Latency_FS1 48 integer ATTRIBUTE Acme-Called-RTCP-MaxJitter_FS1 49 integer ATTRIBUTE Acme-Called-RTCP-MaxLatency_FS1 50 integer ATTRIBUTE Acme-Called-RTP-Packets-Lost_FS1 51 integer ATTRIBUTE Acme-Called-RTP-Avg-Jitter_FS1 52 integer ATTRIBUTE Acme-Called-RTP-MaxJitter_FS1 53 integer ATTRIBUTE Acme-Session-Charging-Vector 54 string ATTRIBUTE Acme-Session-Charging-Function_Address 55 string ATTRIBUTE Acme-Firmware-Version 56 string ATTRIBUTE Acme-Local-Time-Zone 57 string ATTRIBUTE Acme-Post-Dial-Delay 58 integer ATTRIBUTE Acme-CDR-Sequence-Number 59 integer ATTRIBUTE Acme-Session-Disposition 60 integer ATTRIBUTE Acme-Disconnect-Initiator 61 integer ATTRIBUTE Acme-Disconnect-Cause 62 integer ATTRIBUTE Acme-Intermediate_Time 63 string ATTRIBUTE Acme-Primary-Routing-Number 64 string ATTRIBUTE Acme-Originating-Trunk-Group 65 string ATTRIBUTE Acme-Terminating-Trunk-Group 66 string ATTRIBUTE Acme-Originating-Trunk-Context 67 string ATTRIBUTE Acme-Terminating-Trunk-Context 68 string ATTRIBUTE Acme-P-Asserted-ID 69 string ATTRIBUTE Acme-SIP-Diversion 70 string ATTRIBUTE Acme-SIP-Status 71 integer # 72 unused # 73 unused ATTRIBUTE Acme-Ingress-Local-Addr 74 string ATTRIBUTE Acme-Ingress-Remote-Addr 75 string ATTRIBUTE Acme-Egress-Local-Addr 76 string ATTRIBUTE Acme-Egress-Remote-Addr 77 string ATTRIBUTE Acme-FlowID_FS1_R 78 string ATTRIBUTE Acme-FlowType_FS1_R 79 string ATTRIBUTE Acme-Flow-In-Realm_FS1_R 80 string ATTRIBUTE Acme-Flow-In-Src-Addr_FS1_R 81 ipaddr ATTRIBUTE Acme-Flow-In-Src-Port_FS1_R 82 integer ATTRIBUTE Acme-Flow-In-Dst-Addr_FS1_R 83 ipaddr ATTRIBUTE Acme-Flow-In-Dst-Port_FS1_R 84 integer ATTRIBUTE Acme-Flow-Out-Realm_FS1_R 85 string ATTRIBUTE Acme-Flow-Out-Src-Addr_FS1_R 86 ipaddr ATTRIBUTE Acme-Flow-Out-Src-Port_FS1_R 87 integer ATTRIBUTE Acme-Flow-Out-Dst-Addr_FS1_R 88 ipaddr ATTRIBUTE Acme-Flow-Out-Dst-Port_FS1_R 89 integer ATTRIBUTE Acme-FlowID_FS2_F 90 string ATTRIBUTE Acme-FlowType_FS2_F 91 string ATTRIBUTE Acme-Flow-In-Realm_FS2_F 92 string ATTRIBUTE Acme-Flow-In-Src-Addr_FS2_F 93 ipaddr ATTRIBUTE Acme-Flow-In-Src-Port_FS2_F 94 integer ATTRIBUTE Acme-Flow-In-Dst-Addr_FS2_F 95 ipaddr ATTRIBUTE Acme-Flow-In-Dst-Port_FS2_F 96 integer ATTRIBUTE Acme-Flow-Out-Realm_FS2_F 97 string ATTRIBUTE Acme-Flow-Out-Src-Addr_FS2_F 98 ipaddr ATTRIBUTE Acme-Flow-Out-Src-Port_FS2_F 99 integer ATTRIBUTE Acme-Flow-Out-Dst-Addr_FS2_F 100 ipaddr ATTRIBUTE Acme-Flow-Out-Dst-Port_FS2_F 101 integer ATTRIBUTE Acme-Calling-Octets_FS2 102 integer ATTRIBUTE Acme-Calling-Packets_FS2 103 integer ATTRIBUTE Acme-Calling-RTCP-Packets-Lost_FS2 104 integer ATTRIBUTE Acme-Calling-RTCP-Avg-Jitter_FS2 105 integer ATTRIBUTE Acme-Calling-RTCP-Avg-Latency_FS2 106 integer ATTRIBUTE Acme-Calling-RTCP-MaxJitter_FS2 107 integer ATTRIBUTE Acme-Calling-RTCP-MaxLatency_FS2 108 integer ATTRIBUTE Acme-Calling-RTP-Packets-Lost_FS2 109 integer ATTRIBUTE Acme-Calling-RTP-Avg-Jitter_FS2 110 integer ATTRIBUTE Acme-Calling-RTP-MaxJitter_FS2 111 integer ATTRIBUTE Acme-FlowID_FS2_R 112 string ATTRIBUTE Acme-FlowType_FS2_R 113 string ATTRIBUTE Acme-Flow-In-Realm_FS2_R 114 string ATTRIBUTE Acme-Flow-In-Src-Addr_FS2_R 115 ipaddr ATTRIBUTE Acme-Flow-In-Src-Port_FS2_R 116 integer ATTRIBUTE Acme-Flow-In-Dst-Addr_FS2_R 117 ipaddr ATTRIBUTE Acme-Flow-In-Dst-Port_FS2_R 118 integer ATTRIBUTE Acme-Flow-Out-Realm_FS2_R 119 string ATTRIBUTE Acme-Flow-Out-Src-Addr_FS2_R 120 ipaddr ATTRIBUTE Acme-Flow-Out-Src-Port_FS2_R 121 integer ATTRIBUTE Acme-Flow-Out-Dst-Addr_FS2_R 122 ipaddr ATTRIBUTE Acme-Flow-Out-Dst-Port_FS2_R 123 integer ATTRIBUTE Acme-Called-Octets_FS2 124 integer ATTRIBUTE Acme-Called-Packets_FS2 125 integer ATTRIBUTE Acme-Called-RTCP-Packets-Lost_FS2 126 integer ATTRIBUTE Acme-Called-RTCP-Avg-Jitter_FS2 127 integer ATTRIBUTE Acme-Called-RTCP-Avg-Latency_FS2 128 integer ATTRIBUTE Acme-Called-RTCP-MaxJitter_FS2 129 integer ATTRIBUTE Acme-Called-RTCP-MaxLatency_FS2 130 integer ATTRIBUTE Acme-Called-RTP-Packets-Lost_FS2 131 integer ATTRIBUTE Acme-Called-RTP-Avg-Jitter_FS2 132 integer ATTRIBUTE Acme-Called-RTP-MaxJitter_FS2 133 integer ATTRIBUTE Acme-Egress-Final-Routing-Number 134 string ATTRIBUTE Acme-Session-Ingress-RPH 135 string ATTRIBUTE Acme-Session-Egress-RPH 136 string ATTRIBUTE Acme-Ingress-Network-Interface-Id 137 string ATTRIBUTE Acme-Ingress-Vlan-Tag-Value 138 integer ATTRIBUTE Acme-Egress-Network-Interface-Id 139 string ATTRIBUTE Acme-Egress-Vlan-Tag-Value 140 integer ATTRIBUTE Acme-Refer-Call-Transfer-Id 141 string # Transcoding attributes ATTRIBUTE Acme-FlowMediaType_FS1_F 142 string ATTRIBUTE Acme-FlowMediaType_FS1_R 143 string ATTRIBUTE Acme-FlowMediaType_FS2_F 144 string ATTRIBUTE Acme-FlowMediaType_FS2_R 145 string ATTRIBUTE Acme-Flow-PTime_FS1_F 146 integer ATTRIBUTE Acme-Flow-PTime_FS1_R 147 integer ATTRIBUTE Acme-Flow-PTime_FS2_F 148 integer ATTRIBUTE Acme-Flow-PTime_FS2_R 149 integer ATTRIBUTE Acme-Session-Media-Process 150 string # QoS measurement attributes ATTRIBUTE Acme-Calling-R-Factor 151 integer ATTRIBUTE Acme-Calling-MOS 152 integer ATTRIBUTE Acme-Called-R-Factor 153 integer ATTRIBUTE Acme-Called-MOS 154 integer # IPV6 attributes ATTRIBUTE Acme-Flow-In-Src-IPv6_Addr_FS1_F 155 ipv6addr ATTRIBUTE Acme-Flow-In-Dst-IPv6_Addr_FS1_F 156 ipv6addr ATTRIBUTE Acme-Flow-Out-Src-IPv6_Addr_FS1_F 157 ipv6addr ATTRIBUTE Acme-Flow-Out-Dst-IPv6_Addr_FS1_F 158 ipv6addr ATTRIBUTE Acme-Flow-In-Src-IPv6_Addr_FS1_R 159 ipv6addr ATTRIBUTE Acme-Flow-In-Dst-IPv6_Addr_FS1_R 160 ipv6addr ATTRIBUTE Acme-Flow-Out-Src-IPv6_Addr_FS1_R 161 ipv6addr ATTRIBUTE Acme-Flow-Out-Dst-IPv6_Addr_FS1_R 162 ipv6addr ATTRIBUTE Acme-Flow-In-Src-IPv6_Addr_FS2_F 163 ipv6addr ATTRIBUTE Acme-Flow-In-Dst-IPv6_Addr_FS2_F 164 ipv6addr ATTRIBUTE Acme-Flow-Out-Src-IPv6_Addr_FS2_F 165 ipv6addr ATTRIBUTE Acme-Flow-Out-Dst-IPv6_Addr_FS2_F 166 ipv6addr ATTRIBUTE Acme-Flow-In-Src-IPv6_Addr_FS2_R 167 ipv6addr ATTRIBUTE Acme-Flow-In-Dst-IPv6_Addr_FS2_R 168 ipv6addr ATTRIBUTE Acme-Flow-Out-Src-IPv6_Addr_FS2_R 169 ipv6addr ATTRIBUTE Acme-Flow-Out-Dst-IPv6_Addr_FS2_R 170 ipv6addr ATTRIBUTE Acme-Session-Forked-Call-Id 171 string # # Customizable attributes - all strings, but content based on system config # ATTRIBUTE Acme-Custom-VSA-200 200 string ATTRIBUTE Acme-Custom-VSA-201 201 string ATTRIBUTE Acme-Custom-VSA-202 202 string ATTRIBUTE Acme-Custom-VSA-203 203 string ATTRIBUTE Acme-Custom-VSA-204 204 string ATTRIBUTE Acme-Custom-VSA-205 205 string ATTRIBUTE Acme-Custom-VSA-206 206 string ATTRIBUTE Acme-Custom-VSA-207 207 string ATTRIBUTE Acme-Custom-VSA-208 208 string ATTRIBUTE Acme-Custom-VSA-209 209 string ATTRIBUTE Acme-Custom-VSA-210 210 string ATTRIBUTE Acme-Custom-VSA-211 211 string ATTRIBUTE Acme-Custom-VSA-212 212 string ATTRIBUTE Acme-Custom-VSA-213 213 string ATTRIBUTE Acme-Custom-VSA-214 214 string ATTRIBUTE Acme-Custom-VSA-215 215 string ATTRIBUTE Acme-Custom-VSA-216 216 string ATTRIBUTE Acme-Custom-VSA-217 217 string ATTRIBUTE Acme-Custom-VSA-218 218 string ATTRIBUTE Acme-Custom-VSA-219 219 string ATTRIBUTE Acme-Custom-VSA-220 220 string ATTRIBUTE Acme-Custom-VSA-221 221 string ATTRIBUTE Acme-Custom-VSA-222 222 string ATTRIBUTE Acme-Custom-VSA-223 223 string ATTRIBUTE Acme-Custom-VSA-224 224 string ATTRIBUTE Acme-Custom-VSA-225 225 string ATTRIBUTE Acme-Custom-VSA-226 226 string ATTRIBUTE Acme-Custom-VSA-227 227 string ATTRIBUTE Acme-Custom-VSA-228 228 string ATTRIBUTE Acme-Custom-VSA-229 229 string ATTRIBUTE Acme-Custom-VSA-230 230 string ATTRIBUTE Acme-User-Class 254 string END-VENDOR Acme freeradius-server/share/dictionary.aerohive000066400000000000000000000011151257552170400215140ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2013 The FreeRADIUS Server project and contributors # # dictionary.aerohive # # Aerohive # # $Id$ # VENDOR Aerohive 26928 BEGIN-VENDOR Aerohive # The following ATTRIBUTE and VALUE definitions are required. ATTRIBUTE AH-HM-Admin-Group-Id 1 integer VALUE AH-HM-Admin-Group-Id Read-Only-Admin 0 VALUE AH-HM-Admin-Group-Id Super-Admin 1 VALUE AH-HM-Admin-Group-Id Read-Write-Admin 2 # The following is an example of an admin group that you can define. #VALUE AH-HM-Admin-Group-Id Admin-Group100 100 END-VENDOR Aerohive freeradius-server/share/dictionary.airespace000066400000000000000000000011161257552170400216470ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2011 The FreeRADIUS Server project and contributors # # As found on the net. # # $Id$ # VENDOR Airespace 14179 BEGIN-VENDOR Airespace ATTRIBUTE Airespace-Wlan-Id 1 integer ATTRIBUTE Airespace-QOS-Level 2 integer ATTRIBUTE Airespace-DSCP 3 integer ATTRIBUTE Airespace-8021p-Tag 4 integer ATTRIBUTE Airespace-Interface-Name 5 string ATTRIBUTE Airespace-ACL-Name 6 string VALUE Airespace-QOS-Level Bronze 3 VALUE Airespace-QOS-Level Silver 0 VALUE Airespace-QOS-Level Gold 1 VALUE Airespace-QOS-Level Platinum 2 END-VENDOR Airespace freeradius-server/share/dictionary.alcatel000066400000000000000000000070311257552170400213220ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2011 The FreeRADIUS Server project and contributors ############################################################################## # # Alcatel Broadband Access Server dictionary. # # $Id$ # ############################################################################## VENDOR Alcatel 3041 BEGIN-VENDOR Alcatel ATTRIBUTE AAT-Client-Primary-DNS 5 ipaddr ATTRIBUTE AAT-Client-Primary-WINS-NBNS 6 ipaddr ATTRIBUTE AAT-Client-Secondary-WINS-NBNS 7 ipaddr ATTRIBUTE AAT-Client-Secondary-DNS 8 ipaddr ATTRIBUTE AAT-PPP-Address 9 ipaddr ATTRIBUTE AAT-PPP-Netmask 10 ipaddr ATTRIBUTE AAT-Primary-Home-Agent 12 string ATTRIBUTE AAT-Secondary-Home-Agent 13 string ATTRIBUTE AAT-Home-Agent-Password 14 string ATTRIBUTE AAT-Home-Network-Name 15 string ATTRIBUTE AAT-Home-Agent-UDP-Port 16 integer ATTRIBUTE AAT-IP-Direct 17 ipaddr ATTRIBUTE AAT-FR-Direct 18 integer ATTRIBUTE AAT-FR-Direct-Profile 19 string ATTRIBUTE AAT-FR-Direct-DLCI 20 integer ATTRIBUTE AAT-ATM-Direct 21 string ATTRIBUTE AAT-IP-TOS 22 integer ATTRIBUTE AAT-IP-TOS-Precedence 23 integer ATTRIBUTE AAT-IP-TOS-Apply-To 24 integer ATTRIBUTE AAT-MCast-Client 27 integer ATTRIBUTE AAT-Modem-Port-No 28 integer ATTRIBUTE AAT-Modem-Slot-No 29 integer ATTRIBUTE AAT-Modem-Shelf-No 30 integer ATTRIBUTE AAT-Filter 60 string ATTRIBUTE AAT-Vrouter-Name 61 string ATTRIBUTE AAT-Require-Auth 62 integer ATTRIBUTE AAT-IP-Pool-Definition 63 string ATTRIBUTE AAT-Assign-IP-Pool 64 integer ATTRIBUTE AAT-Data-Filter 65 string ATTRIBUTE AAT-Source-IP-Check 66 integer ATTRIBUTE AAT-Modem-Answer-String 67 string ATTRIBUTE AAT-Auth-Type 68 integer ATTRIBUTE AAT-Qos 70 integer ATTRIBUTE AAT-Qoa 71 integer ATTRIBUTE AAT-Client-Assign-DNS 72 integer ATTRIBUTE AAT-ATM-VPI 128 integer ATTRIBUTE AAT-ATM-VCI 129 integer ATTRIBUTE AAT-Input-Octets-Diff 130 integer ATTRIBUTE AAT-Output-Octets-Diff 131 integer ATTRIBUTE AAT-User-MAC-Address 132 string ATTRIBUTE AAT-ATM-Traffic-Profile 133 string VALUE AAT-MCast-Client Multicast-No 0 VALUE AAT-MCast-Client Multicast-Yes 1 VALUE AAT-Require-Auth Not-Require-Auth 0 VALUE AAT-Require-Auth Require-Auth 1 VALUE AAT-FR-Direct No 0 VALUE AAT-FR-Direct Yes 1 VALUE AAT-Source-IP-Check Source-IP-Check-No 0 VALUE AAT-Source-IP-Check Source-IP-Check-Yes 1 VALUE AAT-IP-TOS IP-TOS-Normal 0 VALUE AAT-IP-TOS IP-TOS-Disabled 1 VALUE AAT-IP-TOS IP-TOS-Cost 2 VALUE AAT-IP-TOS IP-TOS-Reliability 4 VALUE AAT-IP-TOS IP-TOS-Throughput 8 VALUE AAT-IP-TOS IP-TOS-Latency 16 VALUE AAT-IP-TOS-Apply-To IP-TOS-Apply-To-Incoming 1024 VALUE AAT-IP-TOS-Apply-To IP-TOS-Apply-To-Both 3072 VALUE AAT-IP-TOS-Apply-To IP-TOS-Apply-To-Outgoing 2048 VALUE AAT-IP-TOS-Precedence IP-TOS-Precedence-Pri-Normal 0 VALUE AAT-IP-TOS-Precedence IP-TOS-Precedence-Pri-One 32 VALUE AAT-IP-TOS-Precedence IP-TOS-Precedence-Pri-Two 64 VALUE AAT-IP-TOS-Precedence IP-TOS-Precedence-Pri-Three 96 VALUE AAT-IP-TOS-Precedence IP-TOS-Precedence-Pri-Four 128 VALUE AAT-IP-TOS-Precedence IP-TOS-Precedence-Pri-Five 160 VALUE AAT-IP-TOS-Precedence IP-TOS-Precedence-Pri-Six 192 VALUE AAT-IP-TOS-Precedence IP-TOS-Precedence-Pri-Seven 224 VALUE AAT-Auth-Type AAT-Auth-None 0 VALUE AAT-Auth-Type AAT-Auth-Default 1 VALUE AAT-Auth-Type AAT-Auth-Any 2 VALUE AAT-Auth-Type AAT-Auth-PAP 3 VALUE AAT-Auth-Type AAT-Auth-CHAP 4 VALUE AAT-Auth-Type AAT-Auth-MS-CHAP 5 VALUE AAT-Client-Assign-DNS DNS-Assign-No 0 VALUE AAT-Client-Assign-DNS DNS-Assign-Yes 1 END-VENDOR Alcatel freeradius-server/share/dictionary.alcatel-lucent.aaa000066400000000000000000000062741257552170400233430ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2013 The FreeRADIUS Server project and contributors ############################################################################## # # ALU-AAA AAA dictionary # # $Id$ # ############################################################################## VENDOR ALU-AAA 831 BEGIN-VENDOR ALU-AAA ATTRIBUTE ALU-AAA-Access-Rule 1 string ATTRIBUTE ALU-AAA-AV-Pair 2 string ATTRIBUTE ALU-AAA-GSM-Triplets-Needed 3 integer ATTRIBUTE ALU-AAA-GSM-Triplet 4 octets ATTRIBUTE ALU-AAA-AKA-Quintets-Needed 5 integer ATTRIBUTE ALU-AAA-AKA-Quintet 6 octets ATTRIBUTE ALU-AAA-AKA-RAND 7 octets ATTRIBUTE ALU-AAA-AKA-AUTS 8 octets ATTRIBUTE ALU-AAA-Service-Profile 9 string ATTRIBUTE ALU-AAA-Lawful-Intercept-Status 10 byte ATTRIBUTE ALU-AAA-DF-CC-Address 11 ipaddr ATTRIBUTE ALU-AAA-DF-CC-Port 12 short ATTRIBUTE ALU-AAA-Client-Program 13 string ATTRIBUTE ALU-AAA-Client-Error-Action 14 integer ATTRIBUTE ALU-AAA-Client-OS 15 string ATTRIBUTE ALU-AAA-Client-Version 16 string ATTRIBUTE ALU-AAA-Nonce 17 octets ATTRIBUTE ALU-AAA-Femto-Public-Key-Hash 18 octets ATTRIBUTE ALU-AAA-Femto-Associated-User-Name 19 string ATTRIBUTE ALU-AAA-String-0 100 string ATTRIBUTE ALU-AAA-String-1 101 string ATTRIBUTE ALU-AAA-String-2 102 string ATTRIBUTE ALU-AAA-String-3 103 string ATTRIBUTE ALU-AAA-Integer-0 104 integer ATTRIBUTE ALU-AAA-Integer-1 105 integer ATTRIBUTE ALU-AAA-Integer-2 106 integer ATTRIBUTE ALU-AAA-Integer-3 107 integer ATTRIBUTE ALU-AAA-Address-0 108 combo-ip ATTRIBUTE ALU-AAA-Address-1 109 combo-ip ATTRIBUTE ALU-AAA-Address-2 110 combo-ip ATTRIBUTE ALU-AAA-Address-3 111 combo-ip ATTRIBUTE ALU-AAA-Value-0 112 octets ATTRIBUTE ALU-AAA-Value-1 113 octets ATTRIBUTE ALU-AAA-Value-2 114 octets ATTRIBUTE ALU-AAA-Value-3 115 octets ATTRIBUTE ALU-AAA-Key-0 116 octets encrypt=2 ATTRIBUTE ALU-AAA-Key-1 117 octets encrypt=2 ATTRIBUTE ALU-AAA-Key-2 118 octets encrypt=2 ATTRIBUTE ALU-AAA-Key-3 119 octets encrypt=2 ATTRIBUTE ALU-AAA-Opaque-0 120 octets ATTRIBUTE ALU-AAA-Opaque-1 121 octets ATTRIBUTE ALU-AAA-Opaque-2 122 octets ATTRIBUTE ALU-AAA-Opaque-3 123 octets ATTRIBUTE ALU-AAA-Eval-0 124 string ATTRIBUTE ALU-AAA-Eval-1 125 string ATTRIBUTE ALU-AAA-Eval-2 126 string ATTRIBUTE ALU-AAA-Eval-3 127 string ATTRIBUTE ALU-AAA-Exec-0 128 string ATTRIBUTE ALU-AAA-Exec-1 129 string ATTRIBUTE ALU-AAA-Exec-2 130 string ATTRIBUTE ALU-AAA-Exec-3 131 string ATTRIBUTE ALU-AAA-Original-Receipt-Time 199 octets ATTRIBUTE ALU-AAA-Reply-Message 201 string ATTRIBUTE ALU-AAA-Called-Station-Id 202 string ATTRIBUTE ALU-AAA-NAS-IP-Address 203 ipaddr ATTRIBUTE ALU-AAA-NAS-Port 204 integer ATTRIBUTE ALU-AAA-Old-State 205 string ATTRIBUTE ALU-AAA-New-State 206 string ATTRIBUTE ALU-AAA-Event 207 string ATTRIBUTE ALU-AAA-Old-Timestamp 208 date ATTRIBUTE ALU-AAA-New-Timestamp 209 date ATTRIBUTE ALU-AAA-Delta-Session 210 integer ATTRIBUTE ALU-AAA-Civic-Location 211 octets ATTRIBUTE ALU-AAA-Geospatial-Location 212 octets VALUE ALU-AAA-Client-Error-Action Ignore 1 VALUE ALU-AAA-Client-Error-Action Disconnect 2 VALUE ALU-AAA-Delta-Session False 0 VALUE ALU-AAA-Delta-Session True 1 END-VENDOR ALU-AAA freeradius-server/share/dictionary.alcatel.esam000066400000000000000000000166311257552170400222540ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2011 The FreeRADIUS Server project and contributors # # Alcatel ESAM's VSAs # # # The vendor specific attribute type is two bytes, where the # first is the project ID and the second is the project specific # attribute ID. The project ID 7 is assigned to 7302 ISAM # project. VENDOR Alcatel-ESAM 637 format=2,1 BEGIN-VENDOR Alcatel-ESAM ATTRIBUTE A-ESAM-VRF-Name 0x0700 string ATTRIBUTE A-ESAM-Vlan-Id 0x0701 integer ATTRIBUTE A-ESAM-QOS-Profile-Name 0x0702 string ATTRIBUTE A-ESAM-QOS-Params 0x0703 string ATTRIBUTE A-ESAM-Termination-Cause 0x0704 integer # # Integer Translations # # A-ESAM-Termination-Cause Values VALUE A-ESAM-Termination-Cause Unknown-VRF 1 VALUE A-ESAM-Termination-Cause No-VRF 2 VALUE A-ESAM-Termination-Cause Unknown-Vlan 3 VALUE A-ESAM-Termination-Cause No-Vlan 4 VALUE A-ESAM-Termination-Cause Unknown-Pool-Id 5 VALUE A-ESAM-Termination-Cause Pool-Admin-Locked 6 VALUE A-ESAM-Termination-Cause No-Pool-Id 7 VALUE A-ESAM-Termination-Cause Pool-VRF-Inconsistent 8 VALUE A-ESAM-Termination-Cause Unknown-QOS-Profile 9 VALUE A-ESAM-Termination-Cause QOS-Params-Syntax-Err 10 VALUE A-ESAM-Termination-Cause IP-Addr-In-Use 11 VALUE A-ESAM-Termination-Cause No-IP-Addr-Available 12 VALUE A-ESAM-Termination-Cause No-User-IP-Addr 13 VALUE A-ESAM-Termination-Cause Missing-Attributes 14 # VSAs for Operator Authentication ATTRIBUTE A-AL-Maintenance 0x0600 integer ATTRIBUTE A-AL-Provisioning 0x0601 integer ATTRIBUTE A-AL-TL1-Security 0x0602 integer ATTRIBUTE A-AL-Test 0x0603 integer ATTRIBUTE A-AL-AAA 0x0709 integer ATTRIBUTE A-AL-ATM 0x070A integer ATTRIBUTE A-AL-Alarm 0x070B integer ATTRIBUTE A-AL-DHCP 0x070C integer ATTRIBUTE A-AL-EQP 0x070D integer ATTRIBUTE A-AL-IGMP 0x070E integer ATTRIBUTE A-AL-CPEProxy 0x070F integer ATTRIBUTE A-AL-IP 0x0710 integer ATTRIBUTE A-AL-PPPoE 0x0711 integer ATTRIBUTE A-AL-QoS 0x0712 integer ATTRIBUTE A-AL-SWMgt 0x0713 integer ATTRIBUTE A-AL-Transport 0x0714 integer ATTRIBUTE A-AL-VLAN 0x0715 integer ATTRIBUTE A-AL-XDSL 0x0716 integer ATTRIBUTE A-AL-Security 0x0717 integer ATTRIBUTE A-AL-Cluster 0x0718 integer ATTRIBUTE A-AL-Prompt 0x0719 string ATTRIBUTE A-AL-Pwd-Timeout 0x071A integer ATTRIBUTE A-AL-Description 0x071B string ATTRIBUTE A-AL-SLOT-NUMBERING 0x071C integer ####FTTU TL1 values############################################### ATTRIBUTE A-AL-MAINTENANCE-BACKWARD 0x0705 integer ATTRIBUTE A-AL-PROVISIONING-BACKWARD 0x0706 integer ATTRIBUTE A-AL-TL1-SECURITY-BACKWARD 0x0707 integer ATTRIBUTE A-AL-TEST-BACKWARD 0x0708 integer ################################################################### # A-AL-Maintenance Values VALUE A-AL-Maintenance Alcatel-No-Maint-Priv-Level 0 VALUE A-AL-Maintenance Alcatel-Maint-Priv-Level-1 1 VALUE A-AL-Maintenance Alcatel-Maint-Priv-Level-2 2 VALUE A-AL-Maintenance Alcatel-Maint-Priv-Level-3 3 VALUE A-AL-Maintenance Alcatel-Maint-Priv-Level-4 4 VALUE A-AL-Maintenance Alcatel-Maint-Priv-Level-5 5 VALUE A-AL-Maintenance Alcatel-Maint-Priv-Level-6 6 VALUE A-AL-Maintenance Alcatel-Maint-Priv-Level-7 7 # A-AL-Provisioning Values VALUE A-AL-Provisioning Alcatel-No-Maint-Priv-Level 0 VALUE A-AL-Provisioning Alcatel-Maint-Priv-Level-1 1 VALUE A-AL-Provisioning Alcatel-Maint-Priv-Level-2 2 VALUE A-AL-Provisioning Alcatel-Maint-Priv-Level-3 3 VALUE A-AL-Provisioning Alcatel-Maint-Priv-Level-4 4 VALUE A-AL-Provisioning Alcatel-Maint-Priv-Level-5 5 VALUE A-AL-Provisioning Alcatel-Maint-Priv-Level-6 6 VALUE A-AL-Provisioning Alcatel-Maint-Priv-Level-7 7 # A-AL-Security Values VALUE A-AL-Security Alcatel-No-Maint-Priv-Level 0 VALUE A-AL-Security Alcatel-Maint-Priv-Level-1 1 VALUE A-AL-Security Alcatel-Maint-Priv-Level-2 2 VALUE A-AL-Security Alcatel-Maint-Priv-Level-3 3 VALUE A-AL-Security Alcatel-Maint-Priv-Level-4 4 VALUE A-AL-Security Alcatel-Maint-Priv-Level-5 5 VALUE A-AL-Security Alcatel-Maint-Priv-Level-6 6 VALUE A-AL-Security Alcatel-Maint-Priv-Level-7 7 # A-AL-Test Values VALUE A-AL-Test Alcatel-No-Maint-Priv-Level 0 VALUE A-AL-Test Alcatel-Maint-Priv-Level-1 1 VALUE A-AL-Test Alcatel-Maint-Priv-Level-2 2 VALUE A-AL-Test Alcatel-Maint-Priv-Level-3 3 VALUE A-AL-Test Alcatel-Maint-Priv-Level-4 4 VALUE A-AL-Test Alcatel-Maint-Priv-Level-5 5 VALUE A-AL-Test Alcatel-Maint-Priv-Level-6 6 VALUE A-AL-Test Alcatel-Maint-Priv-Level-7 7 # A-AL-AAA Value VALUE A-AL-AAA Alcatel-No-Priv 0 VALUE A-AL-AAA Alcatel-Read-Priv 1 VALUE A-AL-AAA Alcatel-Write-Priv 2 VALUE A-AL-AAA Alcatel-RW-Priv 3 # A-AL-ATM Value VALUE A-AL-ATM Alcatel-No-Priv 0 VALUE A-AL-ATM Alcatel-Read-Priv 1 VALUE A-AL-ATM Alcatel-Write-Priv 2 VALUE A-AL-ATM Alcatel-RW-Priv 3 # A-AL-Alarm Value VALUE A-AL-Alarm Alcatel-No-Priv 0 VALUE A-AL-Alarm Alcatel-Read-Priv 1 VALUE A-AL-Alarm Alcatel-Write-Priv 2 VALUE A-AL-Alarm Alcatel-RW-Priv 3 # A-AL-DHCP Value VALUE A-AL-DHCP Alcatel-No-Priv 0 VALUE A-AL-DHCP Alcatel-Read-Priv 1 VALUE A-AL-DHCP Alcatel-Write-Priv 2 VALUE A-AL-DHCP Alcatel-RW-Priv 3 # A-AL-EQP Value VALUE A-AL-EQP Alcatel-No-Priv 0 VALUE A-AL-EQP Alcatel-Read-Priv 1 VALUE A-AL-EQP Alcatel-Write-Priv 2 VALUE A-AL-EQP Alcatel-RW-Priv 3 # A-AL-IGMP Value VALUE A-AL-IGMP Alcatel-No-Priv 0 VALUE A-AL-IGMP Alcatel-Read-Priv 1 VALUE A-AL-IGMP Alcatel-Write-Priv 2 VALUE A-AL-IGMP Alcatel-RW-Priv 3 # A-AL-CPEProxy Value VALUE A-AL-CPEProxy Alcatel-No-Priv 0 VALUE A-AL-CPEProxy Alcatel-Read-Priv 1 VALUE A-AL-CPEProxy Alcatel-Write-Priv 2 VALUE A-AL-CPEProxy Alcatel-RW-Priv 3 # A-AL-IP Value VALUE A-AL-IP Alcatel-No-Priv 0 VALUE A-AL-IP Alcatel-Read-Priv 1 VALUE A-AL-IP Alcatel-Write-Priv 2 VALUE A-AL-IP Alcatel-RW-Priv 3 # A-AL-PPPoE Value VALUE A-AL-PPPoE Alcatel-No-Priv 0 VALUE A-AL-PPPoE Alcatel-Read-Priv 1 VALUE A-AL-PPPoE Alcatel-Write-Priv 2 VALUE A-AL-PPPoE Alcatel-RW-Priv 3 # A-AL-QoS Value VALUE A-AL-QoS Alcatel-No-Priv 0 VALUE A-AL-QoS Alcatel-Read-Priv 1 VALUE A-AL-QoS Alcatel-Write-Priv 2 VALUE A-AL-QoS Alcatel-RW-Priv 3 # A-AL-SWMgt Value VALUE A-AL-SWMgt Alcatel-No-Priv 0 VALUE A-AL-SWMgt Alcatel-Read-Priv 1 VALUE A-AL-SWMgt Alcatel-Write-Priv 2 VALUE A-AL-SWMgt Alcatel-RW-Priv 3 # A-AL-Transport Value VALUE A-AL-Transport Alcatel-No-Priv 0 VALUE A-AL-Transport Alcatel-Read-Priv 1 VALUE A-AL-Transport Alcatel-Write-Priv 2 VALUE A-AL-Transport Alcatel-RW-Priv 3 # A-AL-VLAN Value VALUE A-AL-VLAN Alcatel-No-Priv 0 VALUE A-AL-VLAN Alcatel-Read-Priv 1 VALUE A-AL-VLAN Alcatel-Write-Priv 2 VALUE A-AL-VLAN Alcatel-RW-Priv 3 # A-AL-XDSL Value VALUE A-AL-XDSL Alcatel-No-Priv 0 VALUE A-AL-XDSL Alcatel-Read-Priv 1 VALUE A-AL-XDSL Alcatel-Write-Priv 2 VALUE A-AL-XDSL Alcatel-RW-Priv 3 # A-AL-Security Value VALUE A-AL-Security Alcatel-No-Priv 0 VALUE A-AL-Security Alcatel-Read-Priv 1 VALUE A-AL-Security Alcatel-Write-Priv 2 VALUE A-AL-Security Alcatel-RW-Priv 3 # A-AL-Cluster Value VALUE A-AL-Cluster Alcatel-No-Priv 0 VALUE A-AL-Cluster Alcatel-Read-Priv 1 VALUE A-AL-Cluster Alcatel-Write-Priv 2 VALUE A-AL-Cluster Alcatel-RW-Priv 3 # A-AL-Cluster Value VALUE A-AL-SLOT-NUMBERING SLOT-NUMBERING-TYPE 1 VALUE A-AL-SLOT-NUMBERING SLOT-NUMBERING-POSITION 2 VALUE A-AL-SLOT-NUMBERING SLOT-NUMBERING-LEGACY 3 END-VENDOR Alcatel-ESAM freeradius-server/share/dictionary.alcatel.sr000066400000000000000000000271521257552170400217530ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2012 The FreeRADIUS Server project and contributors ############################################################################## # # Alcatel-Lucent Service Router dictionary. # # $Id$ # ############################################################################## VENDOR Alcatel-Lucent-Service-Router 6527 BEGIN-VENDOR Alcatel-Lucent-Service-Router # Alcatel Timetra attributes ATTRIBUTE Timetra-Access 1 integer VALUE Timetra-Access ftp 1 VALUE Timetra-Access console 2 VALUE Timetra-Access both 3 ATTRIBUTE Timetra-Home-Directory 2 string VALUE Timetra-Restrict-To-Home true 1 VALUE Timetra-Restrict-To-Home false 2 ATTRIBUTE Timetra-Restrict-To-Home 3 integer ATTRIBUTE Timetra-Profile 4 string ATTRIBUTE Timetra-Default-Action 5 integer VALUE Timetra-Default-Action permit-all 1 VALUE Timetra-Default-Action deny-all 2 VALUE Timetra-Default-Action none 3 ATTRIBUTE Timetra-Cmd 6 string ATTRIBUTE Timetra-Action 7 integer VALUE Timetra-Action permit 1 VALUE Timetra-Action deny 2 ATTRIBUTE Timetra-Exec-File 8 string # RADIUS subscriber authorization and CoA VSAs ATTRIBUTE Alc-Primary-Dns 9 ipaddr ATTRIBUTE Alc-Secondary-Dns 10 ipaddr ATTRIBUTE Alc-Subsc-ID-Str 11 string ATTRIBUTE Alc-Subsc-Prof-Str 12 string ATTRIBUTE Alc-SLA-Prof-Str 13 string ATTRIBUTE Alc-Force-Renew 14 string ATTRIBUTE Alc-Create-Host 15 string # CoA ATTRIBUTE Alc-ANCP-Str 16 string # CoA ATTRIBUTE Alc-Retail-Serv-Id 17 integer ATTRIBUTE Alc-Default-Router 18 ipaddr ATTRIBUTE Alc-Client-Hardware-Addr 27 string # RADIUS subscriber accounting VSAs ATTRIBUTE Alc-Acct-I-Inprof-Octets-64 19 octets ATTRIBUTE Alc-Acct-I-Outprof-Octets-64 20 octets ATTRIBUTE Alc-Acct-O-Inprof-Octets-64 21 octets ATTRIBUTE Alc-Acct-O-Outprof-Octets-64 22 octets ATTRIBUTE Alc-Acct-I-Inprof-Pkts-64 23 octets ATTRIBUTE Alc-Acct-I-Outprof-Pkts-64 24 octets ATTRIBUTE Alc-Acct-O-Inprof-Pkts-64 25 octets ATTRIBUTE Alc-Acct-O-Outprof-Pkts-64 26 octets ATTRIBUTE Alc-Int-Dest-Id-Str 28 string ATTRIBUTE Alc-Primary-Nbns 29 ipaddr ATTRIBUTE Alc-Secondary-Nbns 30 ipaddr ATTRIBUTE Alc-MSAP-Serv-Id 31 integer ATTRIBUTE Alc-MSAP-Policy 32 string ATTRIBUTE Alc-MSAP-Interface 33 string ATTRIBUTE Alc-PPPoE-PADO-Delay 34 integer ATTRIBUTE Alc-PPPoE-Service-Name 35 string ATTRIBUTE Alc-DHCP-Vendor-Class-Id 36 string # RADIUS subscriber accounting VSAs (HSMDA override counters) ATTRIBUTE Alc-Acct-OC-I-Inprof-Octets-64 37 octets ATTRIBUTE Alc-Acct-OC-I-Outprof-Octets-64 38 octets ATTRIBUTE Alc-Acct-OC-O-Inprof-Octets-64 39 octets ATTRIBUTE Alc-Acct-OC-O-Outprof-Octets-64 40 octets ATTRIBUTE Alc-Acct-OC-I-Inprof-Pkts-64 41 octets ATTRIBUTE Alc-Acct-OC-I-Outprof-Pkts-64 42 octets ATTRIBUTE Alc-Acct-OC-O-Inprof-Pkts-64 43 octets ATTRIBUTE Alc-Acct-OC-O-Outprof-Pkts-64 44 octets ATTRIBUTE Alc-App-Prof-Str 45 string ATTRIBUTE Alc-Tunnel-Group 46 string ATTRIBUTE Alc-Tunnel-Algorithm 47 integer VALUE Alc-Tunnel-Algorithm weighted-access 1 VALUE Alc-Tunnel-Algorithm existing-first 2 ATTRIBUTE Alc-Tunnel-Max-Sessions 48 integer has_tag ATTRIBUTE Alc-Tunnel-Idle-Timeout 49 integer has_tag ATTRIBUTE Alc-Tunnel-Hello-Interval 50 integer has_tag ATTRIBUTE Alc-Tunnel-Destruct-Timeout 51 integer has_tag ATTRIBUTE Alc-Tunnel-Max-Retries-Estab 52 integer has_tag ATTRIBUTE Alc-Tunnel-Max-Retries-Not-Estab 53 integer has_tag ATTRIBUTE Alc-Tunnel-AVP-Hiding 54 integer has_tag VALUE Alc-Tunnel-AVP-Hiding nothing 1 VALUE Alc-Tunnel-AVP-Hiding sensitive-only 2 VALUE Alc-Tunnel-AVP-Hiding all 3 ATTRIBUTE Alc-BGP-Policy 55 string ATTRIBUTE Alc-BGP-Auth-Keychain 56 string ATTRIBUTE Alc-BGP-Auth-Key 57 octets ATTRIBUTE Alc-BGP-Export-Policy 58 string ATTRIBUTE Alc-BGP-Import-Policy 59 string ATTRIBUTE Alc-BGP-PeerAS 60 integer ATTRIBUTE Alc-IPsec-Serv-Id 61 integer ATTRIBUTE Alc-IPsec-Interface 62 string ATTRIBUTE Alc-IPsec-Tunnel-Template-Id 63 integer ATTRIBUTE Alc-IPsec-SA-Lifetime 64 integer ATTRIBUTE Alc-IPsec-SA-PFS-Group 65 integer # Match TC TmnxIkePolicyDHGroup in TIMETRA-IPSEC-MIB VALUE Alc-IPsec-SA-PFS-Group group1 1 VALUE Alc-IPsec-SA-PFS-Group group2 2 VALUE Alc-IPsec-SA-PFS-Group group5 5 ATTRIBUTE Alc-IPsec-SA-Encr-Algorithm 66 integer # Match TC TmnxEncrAlgorithm in TIMETRA-IPSEC-MIB VALUE Alc-IPsec-SA-Encr-Algorithm null 1 VALUE Alc-IPsec-SA-Encr-Algorithm des 2 VALUE Alc-IPsec-SA-Encr-Algorithm des3 3 VALUE Alc-IPsec-SA-Encr-Algorithm aes128 4 VALUE Alc-IPsec-SA-Encr-Algorithm aes192 5 VALUE Alc-IPsec-SA-Encr-Algorithm aes256 6 ATTRIBUTE Alc-IPsec-SA-Auth-Algorithm 67 integer # Match TC TmnxAuthAlgorithm in TIMETRA-IPSEC-MIB VALUE Alc-IPsec-SA-Auth-Algorithm null 1 VALUE Alc-IPsec-SA-Auth-Algorithm md5 2 VALUE Alc-IPsec-SA-Auth-Algorithm sha1 3 ATTRIBUTE Alc-IPsec-SA-Replay-Window 68 integer # RADIUS subscriber accounting VSAs (custom records) ATTRIBUTE Alc-Acct-I-High-Octets-Drop_64 69 octets ATTRIBUTE Alc-Acct-I-Low-Octets-Drop_64 70 octets ATTRIBUTE Alc-Acct-I-High-Pack-Drop_64 71 octets ATTRIBUTE Alc-Acct-I-Low-Pack-Drop_64 72 octets ATTRIBUTE Alc-Acct-I-High-Octets-Offer_64 73 octets ATTRIBUTE Alc-Acct-I-Low-Octets-Offer_64 74 octets ATTRIBUTE Alc-Acct-I-High-Pack-Offer_64 75 octets ATTRIBUTE Alc-Acct-I-Low-Pack-Offer_64 76 octets ATTRIBUTE Alc-Acct-I-Unc-Octets-Offer_64 77 octets ATTRIBUTE Alc-Acct-I-Unc-Pack-Offer_64 78 octets ATTRIBUTE Alc-Acct-I-All-Octets-Offer_64 79 octets ATTRIBUTE Alc-Acct-I-All-Pack-Offer_64 80 octets ATTRIBUTE Alc-Acct-O-Inprof-Pack-Drop_64 81 octets ATTRIBUTE Alc-Acct-O-Outprof-Pack-Drop_64 82 octets ATTRIBUTE Alc-Acct-O-Inprof-Octs-Drop_64 83 octets ATTRIBUTE Alc-Acct-O-Outprof-Octs-Drop_64 84 octets # RADIUS subscriber accounting VSAs (custom records, HSMDA) ATTRIBUTE Alc-Acct-OC-I-All-Octs-Offer_64 85 octets ATTRIBUTE Alc-Acct-OC-I-All-Pack-Offer_64 86 octets ATTRIBUTE Alc-Acct-OC-I-Inpr-Octs-Drop_64 87 octets ATTRIBUTE Alc-Acct-OC-I-Outpr-Octs-Drop_64 88 octets ATTRIBUTE Alc-Acct-OC-I-Inpr-Pack-Drop_64 89 octets ATTRIBUTE Alc-Acct-OC-I-Outpr-Pack-Drop_64 90 octets ATTRIBUTE Alc-Acct-OC-O-Inpr-Pack-Drop_64 91 octets ATTRIBUTE Alc-Acct-OC-O-Outpr-Pack-Drop_64 92 octets ATTRIBUTE Alc-Acct-OC-O-Inpr-Octs-Drop_64 93 octets ATTRIBUTE Alc-Acct-OC-O-Outpr-Octs-Drop_64 94 octets # Credit control VSAs ATTRIBUTE Alc-Credit-Control-CategoryMap 95 string ATTRIBUTE Alc-Credit-Control-Quota 96 string ATTRIBUTE Alc-Tunnel-Challenge 97 integer has_tag ATTRIBUTE Alc-Force-Nak 98 string # CoA VALUE Alc-Tunnel-Challenge never 1 VALUE Alc-Tunnel-Challenge always 2 ATTRIBUTE Alc-Ipv6-Address 99 ipv6addr ATTRIBUTE Alc-Serv-Id 100 integer ATTRIBUTE Alc-Interface 101 string ATTRIBUTE Alc-ToServer-Dhcp-Options 102 octets ATTRIBUTE Alc-ToClient-Dhcp-Options 103 octets ATTRIBUTE Alc-Tunnel-Serv-Id 104 integer ATTRIBUTE Alc-Ipv6-Primary-Dns 105 ipv6addr ATTRIBUTE Alc-Ipv6-Secondary-Dns 106 ipv6addr # RADIUS subscriber accounting VSAs (Policers) ATTRIBUTE Alc-Acct-I-statmode 107 string ATTRIBUTE Alc-Acct-I-Hiprio-Octets_64 108 octets ATTRIBUTE Alc-Acct-I-Lowprio-Octets_64 109 octets ATTRIBUTE Alc-Acct-O-Hiprio-Octets_64 110 octets ATTRIBUTE Alc-Acct-O-Lowprio-Octets_64 111 octets ATTRIBUTE Alc-Acct-I-Hiprio-Packets_64 112 octets ATTRIBUTE Alc-Acct-I-Lowprio-Packets_64 113 octets ATTRIBUTE Alc-Acct-O-Hiprio-Packets_64 114 octets ATTRIBUTE Alc-Acct-O-Lowprio-Packets_64 115 octets ATTRIBUTE Alc-Acct-I-All-Octets_64 116 octets ATTRIBUTE Alc-Acct-O-All-Octets_64 117 octets ATTRIBUTE Alc-Acct-I-All-Packets_64 118 octets ATTRIBUTE Alc-Acct-O-All-Packets_64 119 octets ATTRIBUTE Alc-Tunnel-Rx-Window-Size 120 integer has_tag # NAT Subscriber ATTRIBUTE Alc-Nat-Port-Range 121 string # Lawful intercept VSAs ATTRIBUTE Alc-LI-Action 122 integer encrypt=2 ATTRIBUTE Alc-LI-Destination 123 string encrypt=2 # This VSA can occur multiple times (for each FC that must be intercepted) # If this VSA is not present, all FCs will be intercepted. ATTRIBUTE Alc-LI-FC 124 integer encrypt=2 # If this VSA is not present, both directions will be intercepted. ATTRIBUTE Alc-LI-Direction 125 integer encrypt=2 VALUE Alc-LI-Action no-action 1 VALUE Alc-LI-Action enable 2 VALUE Alc-LI-Action disable 3 VALUE Alc-LI-FC be 0 VALUE Alc-LI-FC l2 1 VALUE Alc-LI-FC af 2 VALUE Alc-LI-FC l1 3 VALUE Alc-LI-FC h2 4 VALUE Alc-LI-FC ef 5 VALUE Alc-LI-FC h1 6 VALUE Alc-LI-FC nc 7 VALUE Alc-LI-Direction ingress 1 VALUE Alc-LI-Direction egress 2 # Subscriber QoS overrides ATTRIBUTE Alc-Subscriber-QoS-Override 126 string # RADIUS subscriber accounting VSAs (Policers) ATTRIBUTE Alc-Acct-O-statmode 127 string # ATM Traffic Descriptor Profiles ATTRIBUTE Alc-ATM-Ingress-TD-Profile 128 integer ATTRIBUTE Alc-ATM-Egress-TD-Profile 129 integer # Application-assurance transit ip (CoA) ATTRIBUTE Alc-AA-Transit-IP 130 integer # CoA VALUE Alc-AA-Transit-IP host 1 VALUE Alc-AA-Transit-IP audit-start 2 VALUE Alc-AA-Transit-IP audit-end 3 # DHCPv6 Relay pool selection attributes ATTRIBUTE Alc-Delegated-IPv6-Pool 131 string ATTRIBUTE Alc-Access-Loop-Rate-Down 132 integer ATTRIBUTE Alc-Access-Loop-Encap-Offset 133 octets # Submgt SLA-profile filter overrrule ATTRIBUTE Alc-Subscriber-Filter 134 string ATTRIBUTE Alc-PPP-Force-IPv6CP 135 integer # One-Time HTTP Redirection ATTRIBUTE Alc-Onetime-Http-Redirection-Filter-Id 136 string # Used when clearing all radius li triggered sources from a mirror destination # via CoA. The value of this attribute is used to authenticate the coa. ATTRIBUTE Alc-Authentication-Policy-Name 137 string # CoA # Lawful intercept VSAs continued ATTRIBUTE Alc-LI-Intercept-Id 138 integer encrypt=2 ATTRIBUTE Alc-LI-Session-Id 139 integer encrypt=2 # NAT ATTRIBUTE Alc-Nat-Outside-Serv-Id 140 integer ATTRIBUTE Alc-Nat-Outside-Ip-Addr 141 ipaddr # Mobile-Gateway APN-Password VSA (password used for the next APN AccessReq) ATTRIBUTE Alc-APN-Password 142 string encrypt=2 # Mobile-Gateway Next-APN-Name VSA (PGW-APN to be used for the session) ATTRIBUTE Alc-APN-Name 143 string ATTRIBUTE Alc-Tunnel-Acct-Policy 144 string has_tag # Wlan-Gateway ATTRIBUTE Alc-Mgw-Interface-Type 145 integer VALUE Alc-Mgw-Interface-Type gn 1 VALUE Alc-Mgw-Interface-Type s2a 2 VALUE Alc-Mgw-Interface-Type s2b 3 ATTRIBUTE Alc-Wlan-APN-Name 146 string ATTRIBUTE Alc-MsIsdn 147 string # WIFI Received Signal Strength Indication ATTRIBUTE Alc-RSSI 148 integer # Number of attached WIFI UEs ATTRIBUTE Alc-Num-Attached-UEs 149 integer # Mobile-Gateway Charging-profile-ID VSA ATTRIBUTE Alc-Charging-Prof-ID 150 integer # 151-155 are currently unused # Application-Assurance Radius Accounting Attributes ATTRIBUTE Alc-AA-Group-Partition-Isa-Id 156 string # Application-Assurance Radius Peer Information ATTRIBUTE Alc-AA-Peer-Identifier 157 string # Relative Session-Timeout ATTRIBUTE Alc-Relative-Session-Timeout 160 integer # 161-162 are currently unused # Accounting interim update trigger reason ATTRIBUTE Alc-Acct-Triggered-Reason 163 integer VALUE Alc-Acct-Triggered-Reason regular 1 VALUE Alc-Acct-Triggered-Reason sla-start 2 VALUE Alc-Acct-Triggered-Reason sla-stop 3 VALUE Alc-Acct-Triggered-Reason Framed-IP-Address-up 4 VALUE Alc-Acct-Triggered-Reason Framed-IP-Address-down 5 VALUE Alc-Acct-Triggered-Reason Alc-Ipv6-Address-up 6 VALUE Alc-Acct-Triggered-Reason Alc-Ipv6-Address-down 7 VALUE Alc-Acct-Triggered-Reason Delegated-IPv6-Prefix-up 8 VALUE Alc-Acct-Triggered-Reason Delegated-IPv6-Prefix-down 9 VALUE Alc-Acct-Triggered-Reason Framed-IPv6-Prefix-up 10 VALUE Alc-Acct-Triggered-Reason Framed-IPv6-Prefix-down 11 END-VENDOR Alcatel-Lucent-Service-Router freeradius-server/share/dictionary.alteon000066400000000000000000000016311257552170400211770ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2011 The FreeRADIUS Server project and contributors # # dictionary.alteon # # Alteon Webswitch # # $Id$ # VENDOR Alteon 1872 BEGIN-VENDOR Alteon ATTRIBUTE Alteon-Group-Mapping 1 string ATTRIBUTE Alteon-VPN-Id 3 integer ATTRIBUTE Alteon-Client-IP-Address 4 ipaddr ATTRIBUTE Alteon-Client-Netmask 5 ipaddr ATTRIBUTE Alteon-Primary-NBNS-Server 6 ipaddr ATTRIBUTE Alteon-Secondary-NBNS-Server 7 ipaddr ATTRIBUTE Alteon-Primary-DNS-Server 8 ipaddr ATTRIBUTE Alteon-Secondary-DNS-Server 9 ipaddr ATTRIBUTE Alteon-Domain-Name 10 string ATTRIBUTE Alteon-Service-Type 26 integer VALUE Alteon-Service-Type Alteon-L4admin 250 VALUE Alteon-Service-Type Alteon-Slbadmin 251 VALUE Alteon-Service-Type Alteon-Oper 252 VALUE Alteon-Service-Type Alteon-L4oper 253 VALUE Alteon-Service-Type Alteon-Slboper 254 VALUE Alteon-Service-Type Alteon-User 255 END-VENDOR Alteon freeradius-server/share/dictionary.altiga000066400000000000000000000163511257552170400211630ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2014 The FreeRADIUS Server project and contributors # # Altiga vendor attributes # # Altiga networks was acquired by Cisco in 2000. # # $Id$ # VENDOR Altiga 3076 BEGIN-VENDOR Altiga ATTRIBUTE Altiga-Access-Hours-G/U 1 string ATTRIBUTE Altiga-Simultaneous-Logins-G/U 2 integer ATTRIBUTE Altiga-Min-Password-Length-G 3 integer ATTRIBUTE Altiga-Allow-Alpha-Only-Passwords-G 4 integer ATTRIBUTE Altiga-Primary-DNS-G 5 ipaddr ATTRIBUTE Altiga-Secondary-DNS-G 6 ipaddr ATTRIBUTE Altiga-Primary-WINS-G 7 ipaddr ATTRIBUTE Altiga-Secondary-WINS-G 8 ipaddr ATTRIBUTE Altiga-SEP-Card-Assignment-G/U 9 integer ATTRIBUTE Altiga-Priority-on-SEP-G/U 10 integer ATTRIBUTE Altiga-Tunneling-Protocols-G/U 11 integer ATTRIBUTE Altiga-IPSec-Sec-Association-G/U 12 string ATTRIBUTE Altiga-IPSec-Authentication-G 13 integer ATTRIBUTE Altiga-IPSec-Banner-G 15 string ATTRIBUTE Altiga-IPSec-Allow-Passwd-Store-G/U 16 integer ATTRIBUTE Altiga-Use-Client-Address-G/U 17 integer ATTRIBUTE Altiga-PPTP-Min-Authentication-G/U 18 integer ATTRIBUTE Altiga-L2TP-Min-Authentication-G/U 19 integer ATTRIBUTE Altiga-PPTP-Encryption-G 20 integer ATTRIBUTE Altiga-L2TP-Encryption-G 21 integer ATTRIBUTE Altiga-Argument-Authentication-Server-Type 22 integer ATTRIBUTE Altiga-IPSec-L2L-Keepalives-G 25 integer ATTRIBUTE Altiga-Argument-IPSec-Group-Name 26 integer ATTRIBUTE Altiga-IPSec-Split-Tunnel-List-G 27 string ATTRIBUTE Altiga-IPSec-Default-Domain-G 28 string ATTRIBUTE Altiga-IPSec-Secondary-Domains-G 29 string ATTRIBUTE Altiga-IPSec-Tunnel-Type-G 30 integer ATTRIBUTE Altiga-IPSec-Mode-Config-G 31 integer ATTRIBUTE Altiga-Argument-Authentication-Server-Priority 32 integer ATTRIBUTE Altiga-IPSec-User-Group-Lock-G 33 integer ATTRIBUTE Altiga-IPSec-Over-NAT-G 34 integer ATTRIBUTE Altiga-IPSec-Over-NAT-Port-Num-G 35 integer ATTRIBUTE Altiga-Partitioning-Primary-DHCP 128 ipaddr ATTRIBUTE Altiga-Partitioning-Secondary-DHCP 129 ipaddr ATTRIBUTE Altiga-Partitioning-Premise-Rout 131 ipaddr ATTRIBUTE Altiga-Partitioning-Partition-Max-Sessions 132 string ATTRIBUTE Altiga-Partitioning-Mobile-IP-Key 133 string ATTRIBUTE Altiga-Partitioning-Mobile-IP-Address 134 ipaddr ATTRIBUTE Altiga-Partitioning-Mobile-IP-SPI 135 ipaddr ATTRIBUTE Altiga-Partitioning-Strip-Realm 136 integer ATTRIBUTE Altiga-Partitioning-Group 137 integer ATTRIBUTE Altiga-Group-Name 250 string # Altiga value VALUE Altiga-Allow-Alpha-Only-Passwords-G Allow 1 VALUE Altiga-Allow-Alpha-Only-Passwords-G Disallow 0 VALUE Altiga-SEP-Card-Assignment-G/U SEP1 1 VALUE Altiga-SEP-Card-Assignment-G/U SEP2 2 VALUE Altiga-SEP-Card-Assignment-G/U SEP3 4 VALUE Altiga-SEP-Card-Assignment-G/U SEP4 8 VALUE Altiga-SEP-Card-Assignment-G/U Any-SEP 15 VALUE Altiga-Priority-on-SEP-G/U High 1 VALUE Altiga-Priority-on-SEP-G/U Med-High 2 VALUE Altiga-Priority-on-SEP-G/U Medium 3 VALUE Altiga-Priority-on-SEP-G/U Med-Low 4 VALUE Altiga-Priority-on-SEP-G/U Low 5 VALUE Altiga-Tunneling-Protocols-G/U PPTP 1 VALUE Altiga-Tunneling-Protocols-G/U L2TP 2 VALUE Altiga-Tunneling-Protocols-G/U IPSec 4 VALUE Altiga-Tunneling-Protocols-G/U L2TP/IPSec 8 VALUE Altiga-Tunneling-Protocols-G/U PPTP-and-IPSec 5 VALUE Altiga-Tunneling-Protocols-G/U All 15 VALUE Altiga-IPSec-Authentication-G None 0 VALUE Altiga-IPSec-Authentication-G RADIUS 1 VALUE Altiga-IPSec-Authentication-G LDAP 2 VALUE Altiga-IPSec-Authentication-G NTDomain 3 VALUE Altiga-IPSec-Authentication-G SDI 4 VALUE Altiga-IPSec-Authentication-G Internal 5 VALUE Altiga-IPSec-Allow-Passwd-Store-G/U Allow 1 VALUE Altiga-IPSec-Allow-Passwd-Store-G/U Disallow 0 VALUE Altiga-Use-Client-Address-G/U Allow 1 VALUE Altiga-Use-Client-Address-G/U Disallow 0 VALUE Altiga-PPTP-Min-Authentication-G/U PAP 1 VALUE Altiga-PPTP-Min-Authentication-G/U CHAP 2 VALUE Altiga-PPTP-Min-Authentication-G/U EAP-MD5 4 VALUE Altiga-PPTP-Min-Authentication-G/U EAP-GTC 8 VALUE Altiga-PPTP-Min-Authentication-G/U EAP-TLS 16 VALUE Altiga-PPTP-Min-Authentication-G/U MSCHAPv1 32 VALUE Altiga-PPTP-Min-Authentication-G/U MSCHAPv2 64 VALUE Altiga-PPTP-Min-Authentication-G/U Default 102 VALUE Altiga-L2TP-Min-Authentication-G/U PAP 1 VALUE Altiga-L2TP-Min-Authentication-G/U CHAP 2 VALUE Altiga-L2TP-Min-Authentication-G/U EAP-MD5 4 VALUE Altiga-L2TP-Min-Authentication-G/U EAP-GTC 8 VALUE Altiga-L2TP-Min-Authentication-G/U EAP-TLS 16 VALUE Altiga-L2TP-Min-Authentication-G/U MSCHAPv1 32 VALUE Altiga-L2TP-Min-Authentication-G/U MSCHAPv2 64 VALUE Altiga-L2TP-Min-Authentication-G/U Default 102 VALUE Altiga-PPTP-Encryption-G PPTP-40bit 2 VALUE Altiga-PPTP-Encryption-G PPTP-40-Encryption-Req 3 VALUE Altiga-PPTP-Encryption-G PPTP-128 4 VALUE Altiga-PPTP-Encryption-G PPTP-128-Encryption-Req 5 VALUE Altiga-PPTP-Encryption-G PPTP-40-or-128 6 VALUE Altiga-PPTP-Encryption-G PPTP-40-or-128-Encry-Req 7 VALUE Altiga-PPTP-Encryption-G PPTP-40-Stateless-Req 10 VALUE Altiga-PPTP-Encryption-G PPTP-40-Enc/Stateless-Req 11 VALUE Altiga-PPTP-Encryption-G PPTP-128-Stateless-Req 12 VALUE Altiga-PPTP-Encryption-G PPTP-128-Enc/Stateless-Req 13 VALUE Altiga-PPTP-Encryption-G PPTP-40/128-Stateless-Req 14 VALUE Altiga-PPTP-Encryption-G PPTP-40/128-Enc/Statls-Req 15 VALUE Altiga-L2TP-Encryption-G L2TP-40bit 2 VALUE Altiga-L2TP-Encryption-G L2TP-40-Encryption-Req 3 VALUE Altiga-L2TP-Encryption-G L2TP-128 4 VALUE Altiga-L2TP-Encryption-G L2TP-128-Encryption-Req 5 VALUE Altiga-L2TP-Encryption-G L2TP-40-or-128 6 VALUE Altiga-L2TP-Encryption-G L2TP-40-or-128-Encry-Req 7 VALUE Altiga-L2TP-Encryption-G L2TP-40-Stateless-Req 10 VALUE Altiga-L2TP-Encryption-G L2TP-40-Enc/Stateless-Req 11 VALUE Altiga-L2TP-Encryption-G L2TP-128-Stateless-Req 12 VALUE Altiga-L2TP-Encryption-G L2TP-128-Enc/Stateless-Req 13 VALUE Altiga-L2TP-Encryption-G L2TP-40/128-Stateless-Req 14 VALUE Altiga-L2TP-Encryption-G L2TP-40/128-Enc/Statls-Req 15 VALUE Altiga-Argument-Authentication-Server-Type FirstActiveServer 1 VALUE Altiga-Argument-Authentication-Server-Type RADIUS 1 VALUE Altiga-Argument-Authentication-Server-Type LDAP 2 VALUE Altiga-Argument-Authentication-Server-Type NT 3 VALUE Altiga-Argument-Authentication-Server-Type SDI 4 VALUE Altiga-Argument-Authentication-Server-Type Internal 5 VALUE Altiga-IPSec-L2L-Keepalives-G ON 1 VALUE Altiga-IPSec-L2L-Keepalives-G OFF 0 VALUE Altiga-IPSec-Tunnel-Type-G LAN-to-LAN 1 VALUE Altiga-IPSec-Tunnel-Type-G Remote-Access 2 VALUE Altiga-IPSec-Mode-Config-G ON 1 VALUE Altiga-IPSec-Mode-Config-G OFF 0 VALUE Altiga-IPSec-User-Group-Lock-G ON 1 VALUE Altiga-IPSec-User-Group-Lock-G OFF 0 VALUE Altiga-IPSec-Over-NAT-G ON 1 VALUE Altiga-IPSec-Over-NAT-G OFF 0 VALUE Altiga-Partitioning-Strip-Realm ON 1 VALUE Altiga-Partitioning-Strip-Realm OFF 0 END-VENDOR Altiga freeradius-server/share/dictionary.alvarion000066400000000000000000000271231257552170400215340ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2011 The FreeRADIUS Server project and contributors ############################################################################## # # Alvarion VSAs, also known as Breezecom / Breezenet. # # # These are retarded beyond belief. The only VSA's it sends in # accounting packets are text strings for accounting. And, it # doesn't use the same VSA numbers consistently. WTF? # # Here's what it does, and we'll let you decide if this is: # # a) Sane # b) Easier than doing it the way everyone else does # c) none of the above. # # * The NAS sends up to 11 VSA's in each accounting packet. # * The VSA numbers start off at 1, 2, 3, ... 11. This part is # somewhat sane. # * The *next* packet has up to 11 VSA's, but the NAS remembers # that it sent the first packet, and starts the VSA numbers # off at 12, 13, 14, ... 22. Huh? # * This process continues with the next packet, at 23, 24,... 33. # * eventually the numbers space wraps at 256 modulo 11, and it # keeps going. # # Why anyone thought this was a good idea is beyond rational # understanding. # # $Id$ # ############################################################################## VENDOR Alvarion 12394 BEGIN-VENDOR Alvarion ATTRIBUTE Alvarion-VSA-1 1 string ATTRIBUTE Alvarion-VSA-2 2 string ATTRIBUTE Alvarion-VSA-3 3 string ATTRIBUTE Alvarion-VSA-4 4 string ATTRIBUTE Alvarion-VSA-5 5 string ATTRIBUTE Alvarion-VSA-6 6 string ATTRIBUTE Alvarion-VSA-7 7 string ATTRIBUTE Alvarion-VSA-8 8 string ATTRIBUTE Alvarion-VSA-9 9 string ATTRIBUTE Alvarion-VSA-10 10 string ATTRIBUTE Alvarion-VSA-11 11 string ATTRIBUTE Alvarion-VSA-12 12 string ATTRIBUTE Alvarion-VSA-13 13 string ATTRIBUTE Alvarion-VSA-14 14 string ATTRIBUTE Alvarion-VSA-15 15 string ATTRIBUTE Alvarion-VSA-16 16 string ATTRIBUTE Alvarion-VSA-17 17 string ATTRIBUTE Alvarion-VSA-18 18 string ATTRIBUTE Alvarion-VSA-19 19 string ATTRIBUTE Alvarion-VSA-20 20 string ATTRIBUTE Alvarion-VSA-21 21 string ATTRIBUTE Alvarion-VSA-22 22 string ATTRIBUTE Alvarion-VSA-23 23 string ATTRIBUTE Alvarion-VSA-24 24 string ATTRIBUTE Alvarion-VSA-25 25 string ATTRIBUTE Alvarion-VSA-26 26 string ATTRIBUTE Alvarion-VSA-27 27 string ATTRIBUTE Alvarion-VSA-28 28 string ATTRIBUTE Alvarion-VSA-29 29 string ATTRIBUTE Alvarion-VSA-30 30 string ATTRIBUTE Alvarion-VSA-31 31 string ATTRIBUTE Alvarion-VSA-32 32 string ATTRIBUTE Alvarion-VSA-33 33 string ATTRIBUTE Alvarion-VSA-34 34 string ATTRIBUTE Alvarion-VSA-35 35 string ATTRIBUTE Alvarion-VSA-36 36 string ATTRIBUTE Alvarion-VSA-37 37 string ATTRIBUTE Alvarion-VSA-38 38 string ATTRIBUTE Alvarion-VSA-39 39 string ATTRIBUTE Alvarion-VSA-40 40 string ATTRIBUTE Alvarion-VSA-41 41 string ATTRIBUTE Alvarion-VSA-42 42 string ATTRIBUTE Alvarion-VSA-43 43 string ATTRIBUTE Alvarion-VSA-44 44 string ATTRIBUTE Alvarion-VSA-45 45 string ATTRIBUTE Alvarion-VSA-46 46 string ATTRIBUTE Alvarion-VSA-47 47 string ATTRIBUTE Alvarion-VSA-48 48 string ATTRIBUTE Alvarion-VSA-49 49 string ATTRIBUTE Alvarion-VSA-50 50 string ATTRIBUTE Alvarion-VSA-51 51 string ATTRIBUTE Alvarion-VSA-52 52 string ATTRIBUTE Alvarion-VSA-53 53 string ATTRIBUTE Alvarion-VSA-54 54 string ATTRIBUTE Alvarion-VSA-55 55 string ATTRIBUTE Alvarion-VSA-56 56 string ATTRIBUTE Alvarion-VSA-57 57 string ATTRIBUTE Alvarion-VSA-58 58 string ATTRIBUTE Alvarion-VSA-59 59 string ATTRIBUTE Alvarion-VSA-60 60 string ATTRIBUTE Alvarion-VSA-61 61 string ATTRIBUTE Alvarion-VSA-62 62 string ATTRIBUTE Alvarion-VSA-63 63 string ATTRIBUTE Alvarion-VSA-64 64 string ATTRIBUTE Alvarion-VSA-65 65 string ATTRIBUTE Alvarion-VSA-66 66 string ATTRIBUTE Alvarion-VSA-67 67 string ATTRIBUTE Alvarion-VSA-68 68 string ATTRIBUTE Alvarion-VSA-69 69 string ATTRIBUTE Alvarion-VSA-70 70 string ATTRIBUTE Alvarion-VSA-71 71 string ATTRIBUTE Alvarion-VSA-72 72 string ATTRIBUTE Alvarion-VSA-73 73 string ATTRIBUTE Alvarion-VSA-74 74 string ATTRIBUTE Alvarion-VSA-75 75 string ATTRIBUTE Alvarion-VSA-76 76 string ATTRIBUTE Alvarion-VSA-77 77 string ATTRIBUTE Alvarion-VSA-78 78 string ATTRIBUTE Alvarion-VSA-79 79 string ATTRIBUTE Alvarion-VSA-80 80 string ATTRIBUTE Alvarion-VSA-81 81 string ATTRIBUTE Alvarion-VSA-82 82 string ATTRIBUTE Alvarion-VSA-83 83 string ATTRIBUTE Alvarion-VSA-84 84 string ATTRIBUTE Alvarion-VSA-85 85 string ATTRIBUTE Alvarion-VSA-86 86 string ATTRIBUTE Alvarion-VSA-87 87 string ATTRIBUTE Alvarion-VSA-88 88 string ATTRIBUTE Alvarion-VSA-89 89 string ATTRIBUTE Alvarion-VSA-90 90 string ATTRIBUTE Alvarion-VSA-91 91 string ATTRIBUTE Alvarion-VSA-92 92 string ATTRIBUTE Alvarion-VSA-93 93 string ATTRIBUTE Alvarion-VSA-94 94 string ATTRIBUTE Alvarion-VSA-95 95 string ATTRIBUTE Alvarion-VSA-96 96 string ATTRIBUTE Alvarion-VSA-97 97 string ATTRIBUTE Alvarion-VSA-98 98 string ATTRIBUTE Alvarion-VSA-99 99 string ATTRIBUTE Alvarion-VSA-100 100 string ATTRIBUTE Alvarion-VSA-101 101 string ATTRIBUTE Alvarion-VSA-102 102 string ATTRIBUTE Alvarion-VSA-103 103 string ATTRIBUTE Alvarion-VSA-104 104 string ATTRIBUTE Alvarion-VSA-105 105 string ATTRIBUTE Alvarion-VSA-106 106 string ATTRIBUTE Alvarion-VSA-107 107 string ATTRIBUTE Alvarion-VSA-108 108 string ATTRIBUTE Alvarion-VSA-109 109 string ATTRIBUTE Alvarion-VSA-110 110 string ATTRIBUTE Alvarion-VSA-111 111 string ATTRIBUTE Alvarion-VSA-112 112 string ATTRIBUTE Alvarion-VSA-113 113 string ATTRIBUTE Alvarion-VSA-114 114 string ATTRIBUTE Alvarion-VSA-115 115 string ATTRIBUTE Alvarion-VSA-116 116 string ATTRIBUTE Alvarion-VSA-117 117 string ATTRIBUTE Alvarion-VSA-118 118 string ATTRIBUTE Alvarion-VSA-119 119 string ATTRIBUTE Alvarion-VSA-120 120 string ATTRIBUTE Alvarion-VSA-121 121 string ATTRIBUTE Alvarion-VSA-122 122 string ATTRIBUTE Alvarion-VSA-123 123 string ATTRIBUTE Alvarion-VSA-124 124 string ATTRIBUTE Alvarion-VSA-125 125 string ATTRIBUTE Alvarion-VSA-126 126 string ATTRIBUTE Alvarion-VSA-127 127 string ATTRIBUTE Alvarion-VSA-128 128 string ATTRIBUTE Alvarion-VSA-129 129 string ATTRIBUTE Alvarion-VSA-130 130 string ATTRIBUTE Alvarion-VSA-131 131 string ATTRIBUTE Alvarion-VSA-132 132 string ATTRIBUTE Alvarion-VSA-133 133 string ATTRIBUTE Alvarion-VSA-134 134 string ATTRIBUTE Alvarion-VSA-135 135 string ATTRIBUTE Alvarion-VSA-136 136 string ATTRIBUTE Alvarion-VSA-137 137 string ATTRIBUTE Alvarion-VSA-138 138 string ATTRIBUTE Alvarion-VSA-139 139 string ATTRIBUTE Alvarion-VSA-140 140 string ATTRIBUTE Alvarion-VSA-141 141 string ATTRIBUTE Alvarion-VSA-142 142 string ATTRIBUTE Alvarion-VSA-143 143 string ATTRIBUTE Alvarion-VSA-144 144 string ATTRIBUTE Alvarion-VSA-145 145 string ATTRIBUTE Alvarion-VSA-146 146 string ATTRIBUTE Alvarion-VSA-147 147 string ATTRIBUTE Alvarion-VSA-148 148 string ATTRIBUTE Alvarion-VSA-149 149 string ATTRIBUTE Alvarion-VSA-150 150 string ATTRIBUTE Alvarion-VSA-151 151 string ATTRIBUTE Alvarion-VSA-152 152 string ATTRIBUTE Alvarion-VSA-153 153 string ATTRIBUTE Alvarion-VSA-154 154 string ATTRIBUTE Alvarion-VSA-155 155 string ATTRIBUTE Alvarion-VSA-156 156 string ATTRIBUTE Alvarion-VSA-157 157 string ATTRIBUTE Alvarion-VSA-158 158 string ATTRIBUTE Alvarion-VSA-159 159 string ATTRIBUTE Alvarion-VSA-160 160 string ATTRIBUTE Alvarion-VSA-161 161 string ATTRIBUTE Alvarion-VSA-162 162 string ATTRIBUTE Alvarion-VSA-163 163 string ATTRIBUTE Alvarion-VSA-164 164 string ATTRIBUTE Alvarion-VSA-165 165 string ATTRIBUTE Alvarion-VSA-166 166 string ATTRIBUTE Alvarion-VSA-167 167 string ATTRIBUTE Alvarion-VSA-168 168 string ATTRIBUTE Alvarion-VSA-169 169 string ATTRIBUTE Alvarion-VSA-170 170 string ATTRIBUTE Alvarion-VSA-171 171 string ATTRIBUTE Alvarion-VSA-172 172 string ATTRIBUTE Alvarion-VSA-173 173 string ATTRIBUTE Alvarion-VSA-174 174 string ATTRIBUTE Alvarion-VSA-175 175 string ATTRIBUTE Alvarion-VSA-176 176 string ATTRIBUTE Alvarion-VSA-177 177 string ATTRIBUTE Alvarion-VSA-178 178 string ATTRIBUTE Alvarion-VSA-179 179 string ATTRIBUTE Alvarion-VSA-180 180 string ATTRIBUTE Alvarion-VSA-181 181 string ATTRIBUTE Alvarion-VSA-182 182 string ATTRIBUTE Alvarion-VSA-183 183 string ATTRIBUTE Alvarion-VSA-184 184 string ATTRIBUTE Alvarion-VSA-185 185 string ATTRIBUTE Alvarion-VSA-186 186 string ATTRIBUTE Alvarion-VSA-187 187 string ATTRIBUTE Alvarion-VSA-188 188 string ATTRIBUTE Alvarion-VSA-189 189 string ATTRIBUTE Alvarion-VSA-190 190 string ATTRIBUTE Alvarion-VSA-191 191 string ATTRIBUTE Alvarion-VSA-192 192 string ATTRIBUTE Alvarion-VSA-193 193 string ATTRIBUTE Alvarion-VSA-194 194 string ATTRIBUTE Alvarion-VSA-195 195 string ATTRIBUTE Alvarion-VSA-196 196 string ATTRIBUTE Alvarion-VSA-197 197 string ATTRIBUTE Alvarion-VSA-198 198 string ATTRIBUTE Alvarion-VSA-199 199 string ATTRIBUTE Alvarion-VSA-200 200 string ATTRIBUTE Alvarion-VSA-201 201 string ATTRIBUTE Alvarion-VSA-202 202 string ATTRIBUTE Alvarion-VSA-203 203 string ATTRIBUTE Alvarion-VSA-204 204 string ATTRIBUTE Alvarion-VSA-205 205 string ATTRIBUTE Alvarion-VSA-206 206 string ATTRIBUTE Alvarion-VSA-207 207 string ATTRIBUTE Alvarion-VSA-208 208 string ATTRIBUTE Alvarion-VSA-209 209 string ATTRIBUTE Alvarion-VSA-210 210 string ATTRIBUTE Alvarion-VSA-211 211 string ATTRIBUTE Alvarion-VSA-212 212 string ATTRIBUTE Alvarion-VSA-213 213 string ATTRIBUTE Alvarion-VSA-214 214 string ATTRIBUTE Alvarion-VSA-215 215 string ATTRIBUTE Alvarion-VSA-216 216 string ATTRIBUTE Alvarion-VSA-217 217 string ATTRIBUTE Alvarion-VSA-218 218 string ATTRIBUTE Alvarion-VSA-219 219 string ATTRIBUTE Alvarion-VSA-220 220 string ATTRIBUTE Alvarion-VSA-221 221 string ATTRIBUTE Alvarion-VSA-222 222 string ATTRIBUTE Alvarion-VSA-223 223 string ATTRIBUTE Alvarion-VSA-224 224 string ATTRIBUTE Alvarion-VSA-225 225 string ATTRIBUTE Alvarion-VSA-226 226 string ATTRIBUTE Alvarion-VSA-227 227 string ATTRIBUTE Alvarion-VSA-228 228 string ATTRIBUTE Alvarion-VSA-229 229 string ATTRIBUTE Alvarion-VSA-230 230 string ATTRIBUTE Alvarion-VSA-231 231 string ATTRIBUTE Alvarion-VSA-232 232 string ATTRIBUTE Alvarion-VSA-233 233 string ATTRIBUTE Alvarion-VSA-234 234 string ATTRIBUTE Alvarion-VSA-235 235 string ATTRIBUTE Alvarion-VSA-236 236 string ATTRIBUTE Alvarion-VSA-237 237 string ATTRIBUTE Alvarion-VSA-238 238 string ATTRIBUTE Alvarion-VSA-239 239 string ATTRIBUTE Alvarion-VSA-240 240 string ATTRIBUTE Alvarion-VSA-241 241 string ATTRIBUTE Alvarion-VSA-242 242 string ATTRIBUTE Alvarion-VSA-243 243 string ATTRIBUTE Alvarion-VSA-244 244 string ATTRIBUTE Alvarion-VSA-245 245 string ATTRIBUTE Alvarion-VSA-246 246 string ATTRIBUTE Alvarion-VSA-247 247 string ATTRIBUTE Alvarion-VSA-248 248 string ATTRIBUTE Alvarion-VSA-249 249 string ATTRIBUTE Alvarion-VSA-250 250 string ATTRIBUTE Alvarion-VSA-251 251 string ATTRIBUTE Alvarion-VSA-252 252 string ATTRIBUTE Alvarion-VSA-253 253 string ATTRIBUTE Alvarion-VSA-254 254 string ATTRIBUTE Alvarion-VSA-255 255 string # # And these are what the above attributes should get mapped to, # once we get around to caring. # ATTRIBUTE Breezecom-Attr1 1 string ATTRIBUTE Breezecom-Attr2 2 string ATTRIBUTE Breezecom-Attr3 3 string ATTRIBUTE Breezecom-Attr4 4 string ATTRIBUTE Breezecom-Attr5 5 string ATTRIBUTE Breezecom-Attr6 6 string ATTRIBUTE Breezecom-Attr7 7 string ATTRIBUTE Breezecom-Attr8 8 string ATTRIBUTE Breezecom-Attr9 9 string ATTRIBUTE Breezecom-Attr10 10 string ATTRIBUTE Breezecom-Attr11 11 string END-VENDOR Alvarion freeradius-server/share/dictionary.apc000066400000000000000000000021031257552170400204530ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2011 The FreeRADIUS Server project and contributors ############################################################################## # # http://nam-en.apc.com/cgi-bin/nam_en.cfg/php/enduser/std_adp.php?p_faqid=8012 # # $Id$ # ############################################################################## VENDOR APC 318 BEGIN-VENDOR APC ATTRIBUTE APC-Service-Type 1 integer ATTRIBUTE APC-Outlets 2 string ATTRIBUTE APC-Perms 3 string ATTRIBUTE APC-Username 4 string ATTRIBUTE APC-Contact 5 string ATTRIBUTE APC-ACCPX-Doors 6 string ATTRIBUTE APC-ACCPX-Status 7 string ATTRIBUTE APC-ACCPX-Access1 8 string ATTRIBUTE APC-ACCPX-Access2 9 string ATTRIBUTE APC-ACCPX-Access3 10 string ATTRIBUTE APC-ACCPX-Access4 11 string ATTRIBUTE APC-ACCPX-Access5 12 string ATTRIBUTE APC-ACCPX-Access6 13 string ATTRIBUTE APC-ACCPX-Access7 14 string VALUE APC-Service-Type Admin 1 VALUE APC-Service-Type Device 2 VALUE APC-Service-Type ReadOnly 3 VALUE APC-Service-Type Outlet 4 VALUE APC-Service-Type Card 5 END-VENDOR APC freeradius-server/share/dictionary.aptis000066400000000000000000000203261257552170400210370ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2011 The FreeRADIUS Server project and contributors # # $Id$ # VENDOR Aptis 2637 BEGIN-VENDOR Aptis ATTRIBUTE CVX-Identification 1 string ATTRIBUTE CVX-VPOP-ID 2 integer ATTRIBUTE CVX-SS7-Session-ID-Type 3 integer ATTRIBUTE CVX-Radius-Redirect 4 integer ATTRIBUTE CVX-IPSVC-AZNLVL 5 integer ATTRIBUTE CVX-IPSVC-Mask 6 integer ATTRIBUTE CVX-Multilink-Match-Info 7 integer ATTRIBUTE CVX-Multilink-Group-Number 8 integer ATTRIBUTE CVX-PPP-Log-Mask 9 integer ATTRIBUTE CVX-Modem-Begin-Modulation 10 string ATTRIBUTE CVX-Modem-End-Modulation 11 string ATTRIBUTE CVX-Modem-Error-Correction 12 string ATTRIBUTE CVX-Modem-Data-Compression 13 string ATTRIBUTE CVX-Modem-Tx-Packets 14 integer ATTRIBUTE CVX-Modem-ReTx-Packets 15 integer ATTRIBUTE CVX-Modem-SNR 16 integer ATTRIBUTE CVX-Modem-Local-Retrains 17 integer ATTRIBUTE CVX-Modem-Remote-Retrains 18 integer ATTRIBUTE CVX-Modem-Local-Rate-Negs 19 integer ATTRIBUTE CVX-Modem-Remote-Rate-Negs 20 integer ATTRIBUTE CVX-Modem-Begin-Recv-Line-Lvl 21 integer ATTRIBUTE CVX-Modem-End-Recv-Line-Lvl 22 integer ATTRIBUTE CVX-Terminate-Component 23 integer ATTRIBUTE CVX-Terminate-Cause 24 integer ATTRIBUTE CVX-Reject-Reason 25 integer # # These are similar to the Ascend attributes # ATTRIBUTE CVX-Primary-DNS 135 ipaddr ATTRIBUTE CVX-Secondary-DNS 136 ipaddr ATTRIBUTE CVX-Client-Assign-DNS 137 integer ATTRIBUTE CVX-Multicast-Rate-Limit 152 integer ATTRIBUTE CVX-Multicast-Client 155 integer ATTRIBUTE CVX-Disconnect-Cause 195 integer ATTRIBUTE CVX-Data-Rate 197 integer ATTRIBUTE CVX-PreSession-Time 198 integer ATTRIBUTE CVX-Assign-IP-Pool 218 integer ATTRIBUTE CVX-Maximum-Channels 235 integer ATTRIBUTE CVX-Data-Filter 242 string ATTRIBUTE CVX-Idle-Limit 244 integer ATTRIBUTE CVX-PPP-Address 253 ipaddr ATTRIBUTE CVX-Xmit-Rate 255 integer # # Aptis VSAs may have either one-octet or four-octet # fields. One-octet types always have a type less than or equal # to 127 (i.e. the upper bit is set to 0); four-octet types # always have the upper bit set to 1. # # The 4-byte ones *appear* to also have a length, unlike the USR # attributes, but there's no way of knowing for sure. # # http://samuel.labs.nic.at/at43/dictionary # says a number of these are "boolean", which means what, exactly? # # These are commented out until we figure out how to parse them. # #ATTRIBUTE CVX-VPOP-DSByteEnabled 0x84c80001 integer #ATTRIBUTE CVX-VPOP-DSByteValue 0x84c80002 integer #ATTRIBUTE CVX-PPP-EstablishTimeLimit 0x85210065 integer #ATTRIBUTE CVX-PPP-ConnectLimit 0x85210066 integer #ATTRIBUTE CVX-PPP-InactivityLimit 0x85210067 integer #ATTRIBUTE CVX-PPP-MonitorTxActivity 0x85210068 integer #ATTRIBUTE CVX-PPP-MonitorRxActivity 0x85210069 integer #ATTRIBUTE CVX-PPP-CountRIP 0x8521006a integer #ATTRIBUTE CVX-PPP-CountPings 0x8521006b integer #ATTRIBUTE CVX-PPP-CountIGMP 0x8521006c integer #ATTRIBUTE CVX-PPP-UseEchoes 0x852100c9 integer #ATTRIBUTE CVX-PPP-SendID 0x852100ca integer #ATTRIBUTE CVX-PPP-SendTimeRemaining 0x852100cb integer #ATTRIBUTE CVX-PPP-SendMRU 0x8521012d integer #ATTRIBUTE CVX-PPP-SendACCM 0x8521012e integer #ATTRIBUTE CVX-PPP-SendMagic 0x8521012f integer #ATTRIBUTE CVX-PPP-SendPFC 0x85210130 integer #ATTRIBUTE CVX-PPP-SendACFC 0x85210131 integer #ATTRIBUTE CVX-PPP-SendShortSeq 0x85210132 integer #ATTRIBUTE CVX-PPP-SendEndpointDisc 0x85210133 integer #ATTRIBUTE CVX-PPP-AllowMRU 0x85210137 integer #ATTRIBUTE CVX-PPP-AllowACCM 0x85210138 integer #ATTRIBUTE CVX-PPP-AllowMagic 0x85210139 integer #ATTRIBUTE CVX-PPP-AllowPFC 0x8521013a integer #ATTRIBUTE CVX-PPP-AllowACFC 0x8521013b integer #ATTRIBUTE CVX-PPP-AllowShortSeq 0x8521013c integer #ATTRIBUTE CVX-PPP-AllowEndpointDisc 0x8521013d integer #ATTRIBUTE CVX-PPP-LCPMaxConfigure 0x85210191 integer #ATTRIBUTE CVX-PPP-LCPRestartTimer 0x85210192 integer #ATTRIBUTE CVX-PPP-PassiveLCP 0x85210193 integer #ATTRIBUTE CVX-PPP-PassiveLCPTimeout 0x85210194 integer #ATTRIBUTE CVX-PPP-MinRemoteMRU 0x852101f5 integer #ATTRIBUTE CVX-PPP-MinLocalMRU 0x852101f6 integer #ATTRIBUTE CVX-PPP-DesiredLocalMRU 0x852101f7 integer #ATTRIBUTE CVX-PPP-TransmitACCM 0x852101f8 integer #ATTRIBUTE CVX-PPP-ReceiveACCM 0x852101f9 integer #ATTRIBUTE CVX-PPP-MinRemoteMRRU 0x852101fa integer #ATTRIBUTE CVX-PPP-DesiredRemoteMRRU 0x852101fb integer #ATTRIBUTE CVX-PPP-MinLocalMRRU 0x852101fc integer #ATTRIBUTE CVX-PPP-DesiredLocalMRRU 0x852101fd integer #ATTRIBUTE CVX-PPP-LCPEchoRetries 0x852101fe integer #ATTRIBUTE CVX-PPP-LCPEchoTimeout 0x852101ff integer #ATTRIBUTE CVX-PPP-LCPEchoErrorTimeout 0x85210200 integer #ATTRIBUTE CVX-PPP-TimeRemainingInterval 0x85210201 integer #ATTRIBUTE CVX-PPP-IDText 0x85210202 string #ATTRIBUTE CVX-PPP-AuthRequire 0x85210259 integer #ATTRIBUTE CVX-PPP-AuthAllow 0x8521025a integer #ATTRIBUTE CVX-PPP-AuthServerProtocol1 0x85210262 integer #ATTRIBUTE CVX-PPP-AuthServerProtocol2 0x85210263 integer #ATTRIBUTE CVX-PPP-AuthServerProtocol3 0x85210264 integer #ATTRIBUTE CVX-PPP-AuthServerProtocol4 0x85210265 integer #ATTRIBUTE CVX-PPP-AuthClientProtocol1 0x8521026d integer #ATTRIBUTE CVX-PPP-AuthClientProtocol2 0x8521026e integer #ATTRIBUTE CVX-PPP-AuthClientProtocol3 0x8521026f integer #ATTRIBUTE CVX-PPP-AuthClientProtocol4 0x85210270 integer #ATTRIBUTE CVX-PPP-PAPClientRetries 0x85210277 integer #ATTRIBUTE CVX-PPP-PAPClientTimeout 0x85210278 integer #ATTRIBUTE CVX-PPP-PAPServerRetries 0x85210279 integer #ATTRIBUTE CVX-PPP-PAPServerTimeout 0x8521027a integer #ATTRIBUTE CVX-PPP-CHAPClientRetries 0x85210281 integer #ATTRIBUTE CVX-PPP-CHAPClientTimeout 0x85210282 integer #ATTRIBUTE CVX-PPP-CHAPServerRetries 0x85210283 integer #ATTRIBUTE CVX-PPP-CHAPServerChallenges 0x85210284 integer #ATTRIBUTE CVX-PPP-CHAPServerTimeout 0x85210285 integer #ATTRIBUTE CVX-PPP-CHAPValueLength 0x85210286 integer #ATTRIBUTE CVX-PPP-AuthFailureRenegotiatesLCP 0x85210287 integer #ATTRIBUTE CVX-PPP-UserName 0x8521028b string #ATTRIBUTE CVX-PPP-Password 0x8521028c string #ATTRIBUTE CVX-PPP-IPCPEnabled 0x852102bd integer #ATTRIBUTE CVX-PPP-LocalIPAddress 0x852102be ipaddr #ATTRIBUTE CVX-PPP-RemoteIPAddress 0x852102bf ipaddr #ATTRIBUTE CVX-PPP-AllowPeerIPAddress 0x852102c0 integer #ATTRIBUTE CVX-PPP-VJEnabled 0x852102c1 integer #ATTRIBUTE CVX-PPP-VJSlots 0x852102c2 integer #ATTRIBUTE CVX-PPP-SendDNS 0x852102c3 integer #ATTRIBUTE CVX-PPP-SendNBNS 0x852102c4 integer #ATTRIBUTE CVX-PPP-IPCPMaxConfigure 0x852102c5 integer #ATTRIBUTE CVX-PPP-IPCPRestartTimer 0x852102c6 integer #ATTRIBUTE CVX-PPP-PassiveIPCP 0x852102c7 integer #ATTRIBUTE CVX-PPP-PassiveIPCPTimeout 0x852102c8 integer #ATTRIBUTE CVX-PPP-DNS1 0x852102c9 ipaddr #ATTRIBUTE CVX-PPP-DNS2 0x852102ca ipaddr #ATTRIBUTE CVX-PPP-NBNS1 0x852102cb ipaddr #ATTRIBUTE CVX-PPP-NBNS2 0x852102cc ipaddr #ATTRIBUTE CVX-PPP-SendLocalIPAddress 0x852102cd integer #ATTRIBUTE CVX-PPP-RejectUnknownNS 0x852102ce integer #ATTRIBUTE CVX-PPP-PeerNSStrategy 0x852102cf integer #ATTRIBUTE CVX-PPP-MLPEnabled 0x85210321 integer #ATTRIBUTE CVX-PPP-MLPMaxLinks 0x85210322 integer #ATTRIBUTE CVX-PPP-MLPFragmentSize 0x85210323 integer #ATTRIBUTE CVX-PPP-MLPMaxFragments 0x85210324 integer #ATTRIBUTE CVX-PPP-MLPScaleFragments 0x85210325 integer #ATTRIBUTE CVX-PPP-MLPSendNullFragments 0x85210326 integer #ATTRIBUTE CVX-PPP-MLPNullFragmentTimeout 0x85210327 integer #ATTRIBUTE CVX-PPP-MLPEndpointDisc 0x85210328 integer #ATTRIBUTE CVX-PPP-MLPGroupNumber 0x85210329 integer #ATTRIBUTE CVX-PPP-LogEnabled 0x85210385 integer #ATTRIBUTE CVX-PPP-LogDump 0x85210386 integer #ATTRIBUTE CVX-PPP-LogSize 0x8521038e integer #ATTRIBUTE CVX-PPP-LogControlFrames 0x8521038f integer #ATTRIBUTE CVX-PPP-LogProtocolFrames 0x85210390 integer #ATTRIBUTE CVX-PPP-LogOptions 0x85210391 integer #ATTRIBUTE CVX-PPP-LogStates 0x85210392 integer #ATTRIBUTE CVX-PPP-LogCompression 0x85210393 integer #ATTRIBUTE CVX-PPP-LogMLP 0x85210394 integer #ATTRIBUTE CVX-PPP-LogVJ 0x85210395 integer #ATTRIBUTE CVX-PPP-CCPEnabled 0x852103e9 integer #ATTRIBUTE CVX-PPP-CompressFrames 0x852103ea integer #ATTRIBUTE CVX-PPP-Stac3Enabled 0x852103eb integer #ATTRIBUTE CVX-PPP-Stac4Enabled 0x852103ec integer #ATTRIBUTE CVX-PPP-MPPCEnabled 0x852103ed integer #ATTRIBUTE CVX-PPP-StacPerformance 0x852103ee integer #ATTRIBUTE CVX-PPP-StacMode 0x852103ef integer END-VENDOR Aptis freeradius-server/share/dictionary.aruba000066400000000000000000000030571257552170400210130ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2013 The FreeRADIUS Server project and contributors # # Version: $Id$ # VENDOR Aruba 14823 BEGIN-VENDOR Aruba ATTRIBUTE Aruba-User-Role 1 string ATTRIBUTE Aruba-User-Vlan 2 integer ATTRIBUTE Aruba-Priv-Admin-User 3 integer ATTRIBUTE Aruba-Admin-Role 4 string ATTRIBUTE Aruba-Essid-Name 5 string ATTRIBUTE Aruba-Location-Id 6 string ATTRIBUTE Aruba-Port-Identifier 7 string ATTRIBUTE Aruba-MMS-User-Template 8 string ATTRIBUTE Aruba-Named-User-Vlan 9 string ATTRIBUTE Aruba-AP-Group 10 string ATTRIBUTE Aruba-Framed-IPv6-Address 11 string ATTRIBUTE Aruba-Device-Type 12 string ATTRIBUTE Aruba-No-DHCP-Fingerprint 14 integer ATTRIBUTE Aruba-Mdps-Device-Udid 15 string ATTRIBUTE Aruba-Mdps-Device-Imei 16 string ATTRIBUTE Aruba-Mdps-Device-Iccid 17 string ATTRIBUTE Aruba-Mdps-Max-Devices 18 integer ATTRIBUTE Aruba-Mdps-Device-Name 19 string ATTRIBUTE Aruba-Mdps-Device-Product 20 string ATTRIBUTE Aruba-Mdps-Device-Version 21 string ATTRIBUTE Aruba-Mdps-Device-Serial 22 string ATTRIBUTE Aruba-CPPM-Role 23 string ATTRIBUTE Aruba-AirGroup-User-Name 24 string ATTRIBUTE Aruba-AirGroup-Shared-User 25 string ATTRIBUTE Aruba-AirGroup-Shared-Role 26 string ATTRIBUTE Aruba-AirGroup-Device-Type 27 integer ATTRIBUTE Aruba-Auth-Survivability 28 string ATTRIBUTE Aruba-AS-User-Name 29 string ATTRIBUTE Aruba-AS-Credential-Hash 30 string ATTRIBUTE Aruba-WorkSpace-App-Name 31 string ATTRIBUTE Aruba-Mdps-Provisioning-Settings 32 string ATTRIBUTE Aruba-Mdps-Device-Profile 33 string END-VENDOR Aruba freeradius-server/share/dictionary.ascend000066400000000000000000001137641257552170400211650ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2011 The FreeRADIUS Server project and contributors ############################################################################## # # Ascend dictionary. # # $Id$ # ############################################################################## # # For 16-bit Ascend VSA's, see dictionary.lucent. Those VSA's # are in the Lucent namespace, and belong in that file, rather # than here. # # # The Ascend-Data-Filter and Ascend-Call-Filter are case insensitive # strings, with the following format: # # IP FILTERS: # # ip dir action [ dstip n.n.n.n/nn ] [ srcip n.n.n.n/nn ] # [ proto [ dstport cmp value ] [ srcport cmd value ] [ est ] ] # # Fields in [...] are optional. # where: # # ip: Keyword to designate an IP filter. Actually this # has been determined by parseFilter. # # dir: Filter direction. "IN" or "OUT" # # action: Filter action. "FORWARD" or "DROP" # # dstip: Keyword for destination IP address. # n.n.n.n = IP address. /nn - netmask. # # srcip: Keyword for source IP address. # n.n.n.n = IP address. /nn - netmask. # # proto: Optional protocol field. Either a name or # number. Known names are in FilterProtoName[]. # # dstport: Keyword for destination port. Only valid with tcp # or udp. 'cmp' are in FilterPortType[]. 'value' can be # a name or number. # # srcport: Keyword for source port. Only valid with tcp # or udp. 'cmp' are in FilterPortType[]. 'value' can be # a name or number. # # est: Keyword for TCP established. Valid only for tcp. # # IPX FILTERS # # ipx dir action [ srcipxnet nnnn srcipxnode mmmmm [srcipxsoc cmd value ]] # [ dstipxnet nnnn dstipxnode mmmmm [dstipxsoc cmd value ]] # # Fields in [...] are optional. # where: # # ipx: Keyword to designate an IPX filter. Actually this # has been determined by parseFilter. # # dir: Filter direction. "IN" or "OUT" # # action: Filter action. "FORWARD" or "DROP" # # srcipxnet: Keyword for source IPX address. # nnnn = IPX Node address. # # srcipxnode: Keyword for source IPX Node address. # mmmmm = IPX Node Address, could be FFFFFF. # A vlid ipx node number should accompany ipx net number. # # srcipxsoc: Keyword for source IPX socket address. # # cmd: One of ">" or "<" or "=" or "!=". # (without the quotes) # # value: Socket value to be compared against, in hex. # # dstipxnet: Keyword for destination IPX address. # nnnn = IPX Node address. # # dstipxnode: Keyword for destination IPX Node address. # mmmmm = IPX Node Address, could be FFFFFF. # A vlid ipx node number should accompany ipx net number. # # dstipxsoc: Keyword for destination IPX socket address. # # cmd: One of ">" or "<" or "=" or "!=". # (without the quotes) # # value: Socket value to be compared against, in hex. # # GENERIC FILTERS # # generic dir action offset mask value [== or != ] [more] # # Fields in [...] are optional. # where: # # generic: Keyword to indicate a generic filter. This # has been determined by parseFilter. # # dir: Filter direction. "IN" or "OUT" # # action: Filter action. "FORWARD" or "DROP" # # offset: A Number. Specifies an offset into a frame # to start comparing. # # mask: A hexadecimal mask of bits to compare. # # value: A value to compare with the masked data. # # compNeq: Defines type of comparison. ( "==" or "!=") # Default is "==". # # more: Optional keyword MORE, to represent the attachment # to the next entry. VENDOR Ascend 529 # # Ascend vendor-specific attributes. # BEGIN-VENDOR Ascend ATTRIBUTE Ascend-Max-Shared-Users 2 integer ATTRIBUTE Ascend-UU-Info 7 string ATTRIBUTE Ascend-CIR-Timer 9 integer ATTRIBUTE Ascend-FR-08-Mode 10 integer ATTRIBUTE Ascend-Destination-Nas-Port 11 integer ATTRIBUTE Ascend-FR-SVC-Addr 12 string ATTRIBUTE Ascend-NAS-Port-Format 13 integer ATTRIBUTE Ascend-ATM-Fault-Management 14 integer ATTRIBUTE Ascend-ATM-Loopback-Cell-Loss 15 integer ATTRIBUTE Ascend-Ckt-Type 16 integer ATTRIBUTE Ascend-SVC-Enabled 17 integer ATTRIBUTE Ascend-Session-Type 18 integer ATTRIBUTE Ascend-H323-Gatekeeper 19 ipaddr ATTRIBUTE Ascend-Global-Call-Id 20 string ATTRIBUTE Ascend-H323-Conference-Id 21 integer ATTRIBUTE Ascend-H323-Fegw-Address 22 ipaddr ATTRIBUTE Ascend-H323-Dialed-Time 23 integer ATTRIBUTE Ascend-Dialed-Number 24 string ATTRIBUTE Ascend-Inter-Arrival-Jitter 25 integer ATTRIBUTE Ascend-Dropped-Octets 26 integer ATTRIBUTE Ascend-Dropped-Packets 27 integer ATTRIBUTE Ascend-Auth-Delay 28 integer ATTRIBUTE Ascend-X25-Pad-X3-Profile 29 integer ATTRIBUTE Ascend-X25-Pad-X3-Parameters 30 string ATTRIBUTE Ascend-Tunnel-VRouter-Name 31 string ATTRIBUTE Ascend-X25-Reverse-Charging 32 integer ATTRIBUTE Ascend-X25-Nui-Prompt 33 string ATTRIBUTE Ascend-X25-Nui-Password-Prompt 34 string ATTRIBUTE Ascend-X25-Cug 35 string ATTRIBUTE Ascend-X25-Pad-Alias-1 36 string ATTRIBUTE Ascend-X25-Pad-Alias-2 37 string ATTRIBUTE Ascend-X25-Pad-Alias-3 38 string ATTRIBUTE Ascend-X25-X121-Address 39 string ATTRIBUTE Ascend-X25-Nui 40 string ATTRIBUTE Ascend-X25-Rpoa 41 string ATTRIBUTE Ascend-X25-Pad-Prompt 42 string ATTRIBUTE Ascend-X25-Pad-Banner 43 string ATTRIBUTE Ascend-X25-Profile-Name 44 string ATTRIBUTE Ascend-Recv-Name 45 string ATTRIBUTE Ascend-Bi-Directional-Auth 46 integer ATTRIBUTE Ascend-MTU 47 integer ATTRIBUTE Ascend-Call-Direction 48 integer ATTRIBUTE Ascend-Service-Type 49 integer ATTRIBUTE Ascend-Filter-Required 50 integer ATTRIBUTE Ascend-Traffic-Shaper 51 integer ATTRIBUTE Ascend-Access-Intercept-LEA 52 string ATTRIBUTE Ascend-Access-Intercept-Log 53 string ATTRIBUTE Ascend-Private-Route-Table-ID 54 string ATTRIBUTE Ascend-Private-Route-Required 55 integer ATTRIBUTE Ascend-Cache-Refresh 56 integer ATTRIBUTE Ascend-Cache-Time 57 integer ATTRIBUTE Ascend-Egress-Enabled 58 integer ATTRIBUTE Ascend-QOS-Upstream 59 string ATTRIBUTE Ascend-QOS-Downstream 60 string ATTRIBUTE Ascend-ATM-Connect-Vpi 61 integer ATTRIBUTE Ascend-ATM-Connect-Vci 62 integer ATTRIBUTE Ascend-ATM-Connect-Group 63 integer ATTRIBUTE Ascend-ATM-Group 64 integer ATTRIBUTE Ascend-IPX-Header-Compression 65 integer ATTRIBUTE Ascend-Calling-Id-Type-Of-Num 66 integer ATTRIBUTE Ascend-Calling-Id-Number-Plan 67 integer ATTRIBUTE Ascend-Calling-Id-Presentatn 68 integer ATTRIBUTE Ascend-Calling-Id-Screening 69 integer ATTRIBUTE Ascend-BIR-Enable 70 integer ATTRIBUTE Ascend-BIR-Proxy 71 integer ATTRIBUTE Ascend-BIR-Bridge-Group 72 integer ATTRIBUTE Ascend-IPSEC-Profile 73 string ATTRIBUTE Ascend-PPPoE-Enable 74 integer ATTRIBUTE Ascend-Bridge-Non-PPPoE 75 integer ATTRIBUTE Ascend-ATM-Direct 76 integer ATTRIBUTE Ascend-ATM-Direct-Profile 77 string ATTRIBUTE Ascend-Client-Primary-WINS 78 ipaddr ATTRIBUTE Ascend-Client-Secondary-WINS 79 ipaddr ATTRIBUTE Ascend-Client-Assign-WINS 80 integer ATTRIBUTE Ascend-Auth-Type 81 integer ATTRIBUTE Ascend-Port-Redir-Protocol 82 integer ATTRIBUTE Ascend-Port-Redir-Portnum 83 integer ATTRIBUTE Ascend-Port-Redir-Server 84 ipaddr ATTRIBUTE Ascend-IP-Pool-Chaining 85 integer ATTRIBUTE Ascend-Owner-IP-Addr 86 ipaddr ATTRIBUTE Ascend-IP-TOS 87 integer ATTRIBUTE Ascend-IP-TOS-Precedence 88 integer ATTRIBUTE Ascend-IP-TOS-Apply-To 89 integer ATTRIBUTE Ascend-Filter 90 string ATTRIBUTE Ascend-Telnet-Profile 91 string ATTRIBUTE Ascend-Dsl-Rate-Type 92 integer ATTRIBUTE Ascend-Redirect-Number 93 string ATTRIBUTE Ascend-ATM-Vpi 94 integer ATTRIBUTE Ascend-ATM-Vci 95 integer ATTRIBUTE Ascend-Source-IP-Check 96 integer ATTRIBUTE Ascend-Dsl-Rate-Mode 97 integer ATTRIBUTE Ascend-Dsl-Upstream-Limit 98 integer ATTRIBUTE Ascend-Dsl-Downstream-Limit 99 integer ATTRIBUTE Ascend-Dsl-CIR-Recv-Limit 100 integer ATTRIBUTE Ascend-Dsl-CIR-Xmit-Limit 101 integer ATTRIBUTE Ascend-VRouter-Name 102 string ATTRIBUTE Ascend-Source-Auth 103 string ATTRIBUTE Ascend-Private-Route 104 string ATTRIBUTE Ascend-Numbering-Plan-ID 105 integer ATTRIBUTE Ascend-FR-Link-Status-DLCI 106 integer ATTRIBUTE Ascend-Calling-Subaddress 107 string ATTRIBUTE Ascend-Callback-Delay 108 integer ATTRIBUTE Ascend-Endpoint-Disc 109 string ATTRIBUTE Ascend-Remote-FW 110 string ATTRIBUTE Ascend-Multicast-GLeave-Delay 111 integer ATTRIBUTE Ascend-CBCP-Enable 112 integer ATTRIBUTE Ascend-CBCP-Mode 113 integer ATTRIBUTE Ascend-CBCP-Delay 114 integer ATTRIBUTE Ascend-CBCP-Trunk-Group 115 integer ATTRIBUTE Ascend-Appletalk-Route 116 string ATTRIBUTE Ascend-Appletalk-Peer-Mode 117 integer ATTRIBUTE Ascend-Route-Appletalk 118 integer ATTRIBUTE Ascend-FCP-Parameter 119 string ATTRIBUTE Ascend-Modem-PortNo 120 integer ATTRIBUTE Ascend-Modem-SlotNo 121 integer ATTRIBUTE Ascend-Modem-ShelfNo 122 integer ATTRIBUTE Ascend-Call-Attempt-Limit 123 integer ATTRIBUTE Ascend-Call-Block-Duration 124 integer ATTRIBUTE Ascend-Maximum-Call-Duration 125 integer ATTRIBUTE Ascend-Temporary-Rtes 126 integer ATTRIBUTE Ascend-Tunneling-Protocol 127 integer ATTRIBUTE Ascend-Shared-Profile-Enable 128 integer ATTRIBUTE Ascend-Primary-Home-Agent 129 string ATTRIBUTE Ascend-Secondary-Home-Agent 130 string ATTRIBUTE Ascend-Dialout-Allowed 131 integer ATTRIBUTE Ascend-Client-Gateway 132 ipaddr ATTRIBUTE Ascend-BACP-Enable 133 integer ATTRIBUTE Ascend-DHCP-Maximum-Leases 134 integer ATTRIBUTE Ascend-Client-Primary-DNS 135 ipaddr ATTRIBUTE Ascend-Client-Secondary-DNS 136 ipaddr ATTRIBUTE Ascend-Client-Assign-DNS 137 integer ATTRIBUTE Ascend-User-Acct-Type 138 integer ATTRIBUTE Ascend-User-Acct-Host 139 ipaddr ATTRIBUTE Ascend-User-Acct-Port 140 integer ATTRIBUTE Ascend-User-Acct-Key 141 string ATTRIBUTE Ascend-User-Acct-Base 142 integer ATTRIBUTE Ascend-User-Acct-Time 143 integer ATTRIBUTE Ascend-Assign-IP-Client 144 ipaddr ATTRIBUTE Ascend-Assign-IP-Server 145 ipaddr ATTRIBUTE Ascend-Assign-IP-Global-Pool 146 string ATTRIBUTE Ascend-DHCP-Reply 147 integer ATTRIBUTE Ascend-DHCP-Pool-Number 148 integer ATTRIBUTE Ascend-Expect-Callback 149 integer ATTRIBUTE Ascend-Event-Type 150 integer ATTRIBUTE Ascend-Session-Svr-Key 151 string ATTRIBUTE Ascend-Multicast-Rate-Limit 152 integer ATTRIBUTE Ascend-IF-Netmask 153 ipaddr ATTRIBUTE Ascend-Remote-Addr 154 ipaddr ATTRIBUTE Ascend-Multicast-Client 155 integer ATTRIBUTE Ascend-FR-Circuit-Name 156 string ATTRIBUTE Ascend-FR-LinkUp 157 integer ATTRIBUTE Ascend-FR-Nailed-Grp 158 integer ATTRIBUTE Ascend-FR-Type 159 integer ATTRIBUTE Ascend-FR-Link-Mgt 160 integer ATTRIBUTE Ascend-FR-N391 161 integer ATTRIBUTE Ascend-FR-DCE-N392 162 integer ATTRIBUTE Ascend-FR-DTE-N392 163 integer ATTRIBUTE Ascend-FR-DCE-N393 164 integer ATTRIBUTE Ascend-FR-DTE-N393 165 integer ATTRIBUTE Ascend-FR-T391 166 integer ATTRIBUTE Ascend-FR-T392 167 integer ATTRIBUTE Ascend-Bridge-Address 168 string ATTRIBUTE Ascend-TS-Idle-Limit 169 integer ATTRIBUTE Ascend-TS-Idle-Mode 170 integer ATTRIBUTE Ascend-DBA-Monitor 171 integer ATTRIBUTE Ascend-Base-Channel-Count 172 integer ATTRIBUTE Ascend-Minimum-Channels 173 integer ATTRIBUTE Ascend-IPX-Route 174 string ATTRIBUTE Ascend-FT1-Caller 175 integer ATTRIBUTE Ascend-Backup 176 string ATTRIBUTE Ascend-Call-Type 177 integer ATTRIBUTE Ascend-Group 178 string ATTRIBUTE Ascend-FR-DLCI 179 integer ATTRIBUTE Ascend-FR-Profile-Name 180 string ATTRIBUTE Ascend-Ara-PW 181 string ATTRIBUTE Ascend-IPX-Node-Addr 182 string ATTRIBUTE Ascend-Home-Agent-IP-Addr 183 ipaddr ATTRIBUTE Ascend-Home-Agent-Password 184 string ATTRIBUTE Ascend-Home-Network-Name 185 string ATTRIBUTE Ascend-Home-Agent-UDP-Port 186 integer ATTRIBUTE Ascend-Multilink-ID 187 integer ATTRIBUTE Ascend-Num-In-Multilink 188 integer ATTRIBUTE Ascend-First-Dest 189 ipaddr ATTRIBUTE Ascend-Pre-Input-Octets 190 integer ATTRIBUTE Ascend-Pre-Output-Octets 191 integer ATTRIBUTE Ascend-Pre-Input-Packets 192 integer ATTRIBUTE Ascend-Pre-Output-Packets 193 integer ATTRIBUTE Ascend-Maximum-Time 194 integer ATTRIBUTE Ascend-Disconnect-Cause 195 integer ATTRIBUTE Ascend-Connect-Progress 196 integer ATTRIBUTE Ascend-Data-Rate 197 integer ATTRIBUTE Ascend-PreSession-Time 198 integer ATTRIBUTE Ascend-Token-Idle 199 integer ATTRIBUTE Ascend-Token-Immediate 200 integer ATTRIBUTE Ascend-Require-Auth 201 integer ATTRIBUTE Ascend-Number-Sessions 202 string ATTRIBUTE Ascend-Authen-Alias 203 string ATTRIBUTE Ascend-Token-Expiry 204 integer ATTRIBUTE Ascend-Menu-Selector 205 string ATTRIBUTE Ascend-Menu-Item 206 string ATTRIBUTE Ascend-PW-Warntime 207 integer ATTRIBUTE Ascend-PW-Lifetime 208 integer ATTRIBUTE Ascend-IP-Direct 209 ipaddr ATTRIBUTE Ascend-PPP-VJ-Slot-Comp 210 integer ATTRIBUTE Ascend-PPP-VJ-1172 211 integer ATTRIBUTE Ascend-PPP-Async-Map 212 integer ATTRIBUTE Ascend-Third-Prompt 213 string ATTRIBUTE Ascend-Send-Secret 214 string encrypt=3 ATTRIBUTE Ascend-Receive-Secret 215 string encrypt=3 ATTRIBUTE Ascend-IPX-Peer-Mode 216 integer ATTRIBUTE Ascend-IP-Pool-Definition 217 string ATTRIBUTE Ascend-Assign-IP-Pool 218 integer ATTRIBUTE Ascend-FR-Direct 219 integer ATTRIBUTE Ascend-FR-Direct-Profile 220 string ATTRIBUTE Ascend-FR-Direct-DLCI 221 integer ATTRIBUTE Ascend-Handle-IPX 222 integer ATTRIBUTE Ascend-Netware-timeout 223 integer ATTRIBUTE Ascend-IPX-Alias 224 integer ATTRIBUTE Ascend-Metric 225 integer ATTRIBUTE Ascend-PRI-Number-Type 226 integer ATTRIBUTE Ascend-Dial-Number 227 string ATTRIBUTE Ascend-Route-IP 228 integer ATTRIBUTE Ascend-Route-IPX 229 integer ATTRIBUTE Ascend-Bridge 230 integer ATTRIBUTE Ascend-Send-Auth 231 integer ATTRIBUTE Ascend-Send-Passwd 232 string ATTRIBUTE Ascend-Link-Compression 233 integer ATTRIBUTE Ascend-Target-Util 234 integer ATTRIBUTE Ascend-Maximum-Channels 235 integer ATTRIBUTE Ascend-Inc-Channel-Count 236 integer ATTRIBUTE Ascend-Dec-Channel-Count 237 integer ATTRIBUTE Ascend-Seconds-Of-History 238 integer ATTRIBUTE Ascend-History-Weigh-Type 239 integer ATTRIBUTE Ascend-Add-Seconds 240 integer ATTRIBUTE Ascend-Remove-Seconds 241 integer ATTRIBUTE Ascend-Data-Filter 242 abinary ATTRIBUTE Ascend-Call-Filter 243 abinary ATTRIBUTE Ascend-Idle-Limit 244 integer ATTRIBUTE Ascend-Preempt-Limit 245 integer ATTRIBUTE Ascend-Callback 246 integer ATTRIBUTE Ascend-Data-Svc 247 integer ATTRIBUTE Ascend-Force-56 248 integer ATTRIBUTE Ascend-Billing-Number 249 string ATTRIBUTE Ascend-Call-By-Call 250 integer ATTRIBUTE Ascend-Transit-Number 251 string ATTRIBUTE Ascend-Host-Info 252 string ATTRIBUTE Ascend-PPP-Address 253 ipaddr ATTRIBUTE Ascend-MPP-Idle-Percent 254 integer ATTRIBUTE Ascend-Xmit-Rate 255 integer # Ascend protocols VALUE Framed-Protocol Ascend-ARA 255 VALUE Framed-Protocol Ascend-MPP 256 VALUE Framed-Protocol Ascend-EURAW 257 VALUE Framed-Protocol Ascend-EUUI 258 VALUE Framed-Protocol Ascend-X25 259 VALUE Framed-Protocol Ascend-COMB 260 VALUE Framed-Protocol Ascend-FR 261 VALUE Framed-Protocol Ascend-MP 262 VALUE Framed-Protocol Ascend-FR-CIR 263 # # Ascend specific extensions # Used by ASCEND MAX/Pipeline products (see above) # VALUE Ascend-Source-IP-Check Source-IP-Check-No 0 VALUE Ascend-Source-IP-Check Source-IP-Check-Yes 1 VALUE Ascend-CBCP-Enable CBCP-Not-Enabled 0 VALUE Ascend-CBCP-Enable CBCP-Enabled 1 VALUE Ascend-CBCP-Mode CBCP-No-Callback 1 VALUE Ascend-CBCP-Mode CBCP-User-Callback 2 VALUE Ascend-CBCP-Mode CBCP-Profile-Callback 3 VALUE Ascend-CBCP-Mode CBCP-Any-Or-No 7 VALUE Ascend-CBCP-Mode CBCP-Off 8 VALUE Ascend-FR-Direct FR-Direct-No 0 VALUE Ascend-FR-Direct FR-Direct-Yes 1 VALUE Ascend-Handle-IPX Handle-IPX-None 0 VALUE Ascend-Handle-IPX Handle-IPX-Client 1 VALUE Ascend-Handle-IPX Handle-IPX-Server 2 VALUE Ascend-IPX-Peer-Mode IPX-Peer-Router 0 VALUE Ascend-IPX-Peer-Mode IPX-Peer-Dialin 1 VALUE Ascend-Call-Type Switched 0 VALUE Ascend-Call-Type Nailed 1 VALUE Ascend-Call-Type Nailed/Mpp 2 VALUE Ascend-Call-Type Perm/Switched 3 VALUE Ascend-Call-Type AO/DI 6 VALUE Ascend-Call-Type MegaMax 7 VALUE Ascend-FT1-Caller FT1-No 0 VALUE Ascend-FT1-Caller FT1-Yes 1 VALUE Ascend-PRI-Number-Type Unknown-Number 0 VALUE Ascend-PRI-Number-Type Intl-Number 1 VALUE Ascend-PRI-Number-Type National-Number 2 VALUE Ascend-PRI-Number-Type Net-Specific-Number 3 VALUE Ascend-PRI-Number-Type Local-Number 4 VALUE Ascend-PRI-Number-Type Abbrev-Number 5 VALUE Ascend-Route-IP Route-IP-No 0 VALUE Ascend-Route-IP Route-IP-Yes 1 VALUE Ascend-Route-IPX Route-IPX-No 0 VALUE Ascend-Route-IPX Route-IPX-Yes 1 VALUE Ascend-Bridge Bridge-No 0 VALUE Ascend-Bridge Bridge-Yes 1 VALUE Ascend-TS-Idle-Mode TS-Idle-None 0 VALUE Ascend-TS-Idle-Mode TS-Idle-Input 1 VALUE Ascend-TS-Idle-Mode TS-Idle-Input-Output 2 VALUE Ascend-Send-Auth Send-Auth-None 0 VALUE Ascend-Send-Auth Send-Auth-PAP 1 VALUE Ascend-Send-Auth Send-Auth-CHAP 2 VALUE Ascend-Send-Auth Send-Auth-MS-CHAP 3 VALUE Ascend-Link-Compression Link-Comp-None 0 VALUE Ascend-Link-Compression Link-Comp-Stac 1 VALUE Ascend-Link-Compression Link-Comp-Stac-Draft-9 2 VALUE Ascend-Link-Compression Link-Comp-MS-Stac 3 VALUE Ascend-History-Weigh-Type History-Constant 0 VALUE Ascend-History-Weigh-Type History-Linear 1 VALUE Ascend-History-Weigh-Type History-Quadratic 2 VALUE Ascend-Callback Callback-No 0 VALUE Ascend-Callback Callback-Yes 1 VALUE Ascend-Expect-Callback Expect-Callback-No 0 VALUE Ascend-Expect-Callback Expect-Callback-Yes 1 VALUE Ascend-Data-Svc Switched-Voice-Bearer 0 VALUE Ascend-Data-Svc Nailed-56KR 1 VALUE Ascend-Data-Svc Nailed-64K 2 VALUE Ascend-Data-Svc Switched-64KR 3 VALUE Ascend-Data-Svc Switched-56K 4 VALUE Ascend-Data-Svc Switched-384KR 5 VALUE Ascend-Data-Svc Switched-384K 6 VALUE Ascend-Data-Svc Switched-1536K 7 VALUE Ascend-Data-Svc Switched-1536KR 8 VALUE Ascend-Data-Svc Switched-128K 9 VALUE Ascend-Data-Svc Switched-192K 10 VALUE Ascend-Data-Svc Switched-256K 11 VALUE Ascend-Data-Svc Switched-320K 12 VALUE Ascend-Data-Svc Switched-384K-MR 13 VALUE Ascend-Data-Svc Switched-448K 14 VALUE Ascend-Data-Svc Switched-512K 15 VALUE Ascend-Data-Svc Switched-576K 16 VALUE Ascend-Data-Svc Switched-640K 17 VALUE Ascend-Data-Svc Switched-704K 18 VALUE Ascend-Data-Svc Switched-768K 19 VALUE Ascend-Data-Svc Switched-832K 20 VALUE Ascend-Data-Svc Switched-896K 21 VALUE Ascend-Data-Svc Switched-960K 22 VALUE Ascend-Data-Svc Switched-1024K 23 VALUE Ascend-Data-Svc Switched-1088K 24 VALUE Ascend-Data-Svc Switched-1152K 25 VALUE Ascend-Data-Svc Switched-1216K 26 VALUE Ascend-Data-Svc Switched-1280K 27 VALUE Ascend-Data-Svc Switched-1344K 28 VALUE Ascend-Data-Svc Switched-1408K 29 VALUE Ascend-Data-Svc Switched-1472K 30 VALUE Ascend-Data-Svc Switched-1600K 31 VALUE Ascend-Data-Svc Switched-1664K 32 VALUE Ascend-Data-Svc Switched-1728K 33 VALUE Ascend-Data-Svc Switched-1792K 34 VALUE Ascend-Data-Svc Switched-1856K 35 VALUE Ascend-Data-Svc Switched-1920K 36 VALUE Ascend-Data-Svc Switched-inherited 37 VALUE Ascend-Data-Svc Switched-restricted-bearer-x30 38 VALUE Ascend-Data-Svc Switched-clear-bearer-v110 39 VALUE Ascend-Data-Svc Switched-restricted-64-x30 40 VALUE Ascend-Data-Svc Switched-clear-56-v110 41 VALUE Ascend-Data-Svc Switched-modem 42 VALUE Ascend-Data-Svc Switched-atmodem 43 VALUE Ascend-Data-Svc Switched-V110-24-56 45 VALUE Ascend-Data-Svc Switched-V110-48-56 46 VALUE Ascend-Data-Svc Switched-V110-96-56 47 VALUE Ascend-Data-Svc Switched-V110-192-56 48 VALUE Ascend-Data-Svc Switched-V110-384-56 49 VALUE Ascend-Data-Svc Switched-V110-24-56R 50 VALUE Ascend-Data-Svc Switched-V110-48-56R 51 VALUE Ascend-Data-Svc Switched-V110-96-56R 52 VALUE Ascend-Data-Svc Switched-V110-192-56R 53 VALUE Ascend-Data-Svc Switched-V110-384-56R 54 VALUE Ascend-Data-Svc Switched-V110-24-64 55 VALUE Ascend-Data-Svc Switched-V110-48-64 56 VALUE Ascend-Data-Svc Switched-V110-96-64 57 VALUE Ascend-Data-Svc Switched-V110-192-64 58 VALUE Ascend-Data-Svc Switched-V110-384-64 59 VALUE Ascend-Data-Svc Switched-V110-24-64R 60 VALUE Ascend-Data-Svc Switched-V110-48-64R 61 VALUE Ascend-Data-Svc Switched-V110-96-64R 62 VALUE Ascend-Data-Svc Switched-V110-384-64R 64 VALUE Ascend-Data-Svc Switched-V110-192-64R 63 VALUE Ascend-Data-Svc Switched-Pots 68 VALUE Ascend-Data-Svc Switched-ATM 69 VALUE Ascend-Data-Svc Switched-FR 70 VALUE Ascend-Force-56 Force-56-No 0 VALUE Ascend-Force-56 Force-56-Yes 1 VALUE Ascend-PW-Lifetime Lifetime-In-Days 0 VALUE Ascend-PW-Warntime Days-Of-Warning 0 VALUE Ascend-PPP-VJ-1172 PPP-VJ-1172 1 VALUE Ascend-PPP-VJ-Slot-Comp VJ-Slot-Comp-No 1 VALUE Ascend-Require-Auth Not-Require-Auth 0 VALUE Ascend-Require-Auth Require-Auth 1 VALUE Ascend-Token-Immediate Tok-Imm-No 0 VALUE Ascend-Token-Immediate Tok-Imm-Yes 1 VALUE Ascend-DBA-Monitor DBA-Transmit 0 VALUE Ascend-DBA-Monitor DBA-Transmit-Recv 1 VALUE Ascend-DBA-Monitor DBA-None 2 VALUE Ascend-FR-Type Ascend-FR-DTE 0 VALUE Ascend-FR-Type Ascend-FR-DCE 1 VALUE Ascend-FR-Type Ascend-FR-NNI 2 VALUE Ascend-FR-Link-Mgt Ascend-FR-No-Link-Mgt 0 VALUE Ascend-FR-Link-Mgt Ascend-FR-T1-617D 1 VALUE Ascend-FR-Link-Mgt Ascend-FR-Q-933A 2 VALUE Ascend-FR-LinkUp Ascend-LinkUp-Default 0 VALUE Ascend-FR-LinkUp Ascend-LinkUp-AlwaysUp 1 VALUE Ascend-Multicast-Client Multicast-No 0 VALUE Ascend-Multicast-Client Multicast-Yes 1 VALUE Ascend-User-Acct-Type Ascend-User-Acct-None 0 VALUE Ascend-User-Acct-Type Ascend-User-Acct-User 1 VALUE Ascend-User-Acct-Type Ascend-User-Acct-User-Default 2 VALUE Ascend-User-Acct-Base Base-10 0 VALUE Ascend-User-Acct-Base Base-16 1 VALUE Ascend-DHCP-Reply DHCP-Reply-No 0 VALUE Ascend-DHCP-Reply DHCP-Reply-Yes 1 VALUE Ascend-Client-Assign-DNS DNS-Assign-No 0 VALUE Ascend-Client-Assign-DNS DNS-Assign-Yes 1 VALUE Ascend-Event-Type Ascend-ColdStart 1 VALUE Ascend-Event-Type Ascend-Session-Event 2 VALUE Ascend-BACP-Enable BACP-No 0 VALUE Ascend-BACP-Enable BACP-Yes 1 VALUE Ascend-Dialout-Allowed Dialout-Not-Allowed 0 VALUE Ascend-Dialout-Allowed Dialout-Allowed 1 VALUE Ascend-Shared-Profile-Enable Shared-Profile-No 0 VALUE Ascend-Shared-Profile-Enable Shared-Profile-Yes 1 VALUE Ascend-Temporary-Rtes Temp-Rtes-No 0 VALUE Ascend-Temporary-Rtes Temp-Rtes-Yes 1 # Ascend Disconnect Cause Values VALUE Ascend-Disconnect-Cause No-Reason 0 VALUE Ascend-Disconnect-Cause Not-Applicable 1 VALUE Ascend-Disconnect-Cause Unknown 2 VALUE Ascend-Disconnect-Cause Call-Disconnected 3 VALUE Ascend-Disconnect-Cause CLID-Authentication-Failed 4 VALUE Ascend-Disconnect-Cause CLID-RADIUS-Timeout 5 VALUE Ascend-Disconnect-Cause Modem-No-DCD 10 VALUE Ascend-Disconnect-Cause DCD-Detected-Then-Inactive 11 VALUE Ascend-Disconnect-Cause Modem-Invalid-Result-Codes 12 VALUE Ascend-Disconnect-Cause TermSrv-User-Quit 20 VALUE Ascend-Disconnect-Cause TermSrv-Idle-Timeout 21 VALUE Ascend-Disconnect-Cause TermSrv-Exit-Telnet 22 VALUE Ascend-Disconnect-Cause TermSrv-No-IPaddr 23 VALUE Ascend-Disconnect-Cause TermSrv-Exit-Raw-TCP 24 VALUE Ascend-Disconnect-Cause TermSrv-Exit-Login-Failed 25 VALUE Ascend-Disconnect-Cause TermSrv-Exit-Raw-TCP-Disabled 26 VALUE Ascend-Disconnect-Cause TermSrv-CTRL-C-In-Login 27 VALUE Ascend-Disconnect-Cause TermSrv-Destroyed 28 VALUE Ascend-Disconnect-Cause TermSrv-User-Closed-VCon 29 VALUE Ascend-Disconnect-Cause TermSrv-VCon-Destroyed 30 VALUE Ascend-Disconnect-Cause TermSrv-Exit-Rlogin 31 VALUE Ascend-Disconnect-Cause TermSrv-Bad-Rlogin-Option 32 VALUE Ascend-Disconnect-Cause TermSrv-Not-Enough-Resources 33 VALUE Ascend-Disconnect-Cause MPP-No-NULL-Msg-Timeout 35 VALUE Ascend-Disconnect-Cause PPP-LCP-Timeout 40 VALUE Ascend-Disconnect-Cause PPP-LCP-Negotion-Failed 41 VALUE Ascend-Disconnect-Cause PPP-PAP-Auth-Failed 42 VALUE Ascend-Disconnect-Cause PPP-CHAP-Auth-Failed 43 VALUE Ascend-Disconnect-Cause PPP-Rmt-Auth-Failed 44 VALUE Ascend-Disconnect-Cause PPP-Rcv-Terminate-Req 45 VALUE Ascend-Disconnect-Cause PPP-Rcv-Close-Event 46 VALUE Ascend-Disconnect-Cause PPP-No-NCPs-Open 47 VALUE Ascend-Disconnect-Cause PPP-MP-Bundle-Unknown 48 VALUE Ascend-Disconnect-Cause PPP-LCP-Close-MP-Add-Fail 49 VALUE Ascend-Disconnect-Cause Session-Table-Full 50 VALUE Ascend-Disconnect-Cause Out-Of-Resources 51 VALUE Ascend-Disconnect-Cause Invalid-IP-Address 52 VALUE Ascend-Disconnect-Cause Hostname-Resolution-Failed 53 VALUE Ascend-Disconnect-Cause Bad-Or-Missing-Port-Number 54 VALUE Ascend-Disconnect-Cause Host-Reset 60 VALUE Ascend-Disconnect-Cause Connection-Refused 61 VALUE Ascend-Disconnect-Cause Connection-Timeout 62 VALUE Ascend-Disconnect-Cause Connection-Closed 63 VALUE Ascend-Disconnect-Cause Network-Unreachable 64 VALUE Ascend-Disconnect-Cause Host-Unreachable 65 VALUE Ascend-Disconnect-Cause Network-Unreachable-Admin 66 VALUE Ascend-Disconnect-Cause Host-Unreachable-Admin 67 VALUE Ascend-Disconnect-Cause Port-Unreachable 68 VALUE Ascend-Disconnect-Cause Session-Timeout 100 VALUE Ascend-Disconnect-Cause Invalid-Incoming-User 101 VALUE Ascend-Disconnect-Cause Disconnect-Due-To-Callback 102 VALUE Ascend-Disconnect-Cause Proto-Disabled-Or-Unsupported 120 VALUE Ascend-Disconnect-Cause Disconnect-Req-By-RADIUS 150 VALUE Ascend-Disconnect-Cause Disconnect-Req-By-Local-Admin 151 VALUE Ascend-Disconnect-Cause V110-Timeout-Sync-Retry-Exceed 160 VALUE Ascend-Disconnect-Cause PPP-Auth-Timeout-Exceeded 170 VALUE Ascend-Disconnect-Cause User-Executed-Do-Hangup 180 VALUE Ascend-Disconnect-Cause Remote-End-Hung-Up 185 VALUE Ascend-Disconnect-Cause Resource-Has-Been-Quiesced 190 VALUE Ascend-Disconnect-Cause Max-Call-Duration-Reached 195 # ascend connect progress codes VALUE Ascend-Connect-Progress No-Progress 0 VALUE Ascend-Connect-Progress Call-Up 10 VALUE Ascend-Connect-Progress Modem-Up 30 VALUE Ascend-Connect-Progress Modem-Awaiting-DCD 31 VALUE Ascend-Connect-Progress Modem-Awaiting-Codes 32 VALUE Ascend-Connect-Progress TermSrv-Started 40 VALUE Ascend-Connect-Progress TermSrv-Raw-TCP-Started 41 VALUE Ascend-Connect-Progress TermSrv-Telnet-Started 42 VALUE Ascend-Connect-Progress TermSrv-Raw-TCP-Connected 43 VALUE Ascend-Connect-Progress TermSrv-Telnet-Connected 44 VALUE Ascend-Connect-Progress TermSrv-Rlogin-Started 45 VALUE Ascend-Connect-Progress TermSrv-Rlogin-Connected 46 VALUE Ascend-Connect-Progress Modem-Outdial-Call-Up 50 VALUE Ascend-Connect-Progress LAN-Session-Up 60 VALUE Ascend-Connect-Progress LCP-Opening 61 VALUE Ascend-Connect-Progress CCP-Opening 62 VALUE Ascend-Connect-Progress IPNCP-Opening 63 VALUE Ascend-Connect-Progress BNCP-Opening 64 VALUE Ascend-Connect-Progress LCP-Opened 65 VALUE Ascend-Connect-Progress CCP-Opened 66 VALUE Ascend-Connect-Progress IPNCP-Opened 67 VALUE Ascend-Connect-Progress BNCP-Opened 68 VALUE Ascend-Connect-Progress LCP-State-Initial 69 VALUE Ascend-Connect-Progress LCP-State-Starting 70 VALUE Ascend-Connect-Progress LCP-State-Closed 71 VALUE Ascend-Connect-Progress LCP-State-Stopped 72 VALUE Ascend-Connect-Progress LCP-State-Closing 73 VALUE Ascend-Connect-Progress LCP-State-Stopping 74 VALUE Ascend-Connect-Progress LCP-State-Request-Sent 75 VALUE Ascend-Connect-Progress LCP-State-Ack-Received 76 VALUE Ascend-Connect-Progress LCP-State-Ack-Sent 77 VALUE Ascend-Connect-Progress IPXNCP-Opened 80 VALUE Ascend-Connect-Progress ATNCP-Opened 81 VALUE Ascend-Connect-Progress BACP-Opening 82 VALUE Ascend-Connect-Progress BACP-Opened 83 VALUE Ascend-Connect-Progress V110-Up 90 VALUE Ascend-Connect-Progress V110-State-Opened 91 VALUE Ascend-Connect-Progress V110-State-Carrier 92 VALUE Ascend-Connect-Progress V110-State-Reset 93 VALUE Ascend-Connect-Progress V110-State-Closed 94 VALUE Ascend-ATM-Direct ATM-Direct-No 0 VALUE Ascend-ATM-Direct ATM-Direct-Yes 1 VALUE Ascend-ATM-Fault-Management VC-End-To-End-Loopback 2 VALUE Ascend-ATM-Fault-Management VC-No-Loopback 0 VALUE Ascend-ATM-Fault-Management VC-Segment-Loopback 1 VALUE Ascend-Appletalk-Peer-Mode Appletalk-Peer-Dialin 1 VALUE Ascend-Appletalk-Peer-Mode Appletalk-Peer-Router 0 VALUE Ascend-Auth-Type Auth-Any 2 VALUE Ascend-Auth-Type Auth-CHAP 4 VALUE Ascend-Auth-Type Auth-Default 1 VALUE Ascend-Auth-Type Auth-MS-CHAP 5 VALUE Ascend-Auth-Type Auth-None 0 VALUE Ascend-Auth-Type Auth-PAP 3 VALUE Ascend-BIR-Enable BIR-Enable-No 0 VALUE Ascend-BIR-Enable BIR-Enable-Yes 1 VALUE Ascend-BIR-Proxy BIR-Proxy-No 0 VALUE Ascend-BIR-Proxy BIR-Proxy-Yes 1 VALUE Ascend-Bi-Directional-Auth Bi-Directional-Auth-Allowed 1 VALUE Ascend-Bi-Directional-Auth Bi-Directional-Auth-None 0 VALUE Ascend-Bi-Directional-Auth Bi-Directional-Auth-Required 2 VALUE Ascend-Bridge-Non-PPPoE Bridge-Non-PPPoE-No 0 VALUE Ascend-Bridge-Non-PPPoE Bridge-Non-PPPoE-Yes 1 VALUE Ascend-Cache-Refresh Refresh-No 0 VALUE Ascend-Cache-Refresh Refresh-Yes 1 VALUE Ascend-Call-Direction Ascend-Call-Direction-Incoming 0 VALUE Ascend-Call-Direction Ascend-Call-Direction-Outgoing 1 VALUE Ascend-Calling-Id-Number-Plan Data 3 VALUE Ascend-Calling-Id-Number-Plan ISDN-Telephony 1 VALUE Ascend-Calling-Id-Number-Plan National 8 VALUE Ascend-Calling-Id-Number-Plan Private 9 VALUE Ascend-Calling-Id-Number-Plan Telex 4 VALUE Ascend-Calling-Id-Number-Plan Unknown 0 VALUE Ascend-Calling-Id-Presentatn Allowed 0 VALUE Ascend-Calling-Id-Presentatn Number-Not-Available 2 VALUE Ascend-Calling-Id-Presentatn Restricted 1 VALUE Ascend-Calling-Id-Screening Network-Provided 3 VALUE Ascend-Calling-Id-Screening User-Not-Screened 0 VALUE Ascend-Calling-Id-Screening User-Provided-Failed 2 VALUE Ascend-Calling-Id-Screening User-Provided-Passed 1 VALUE Ascend-Calling-Id-Type-Of-Num Abbreviated-Number 6 VALUE Ascend-Calling-Id-Type-Of-Num International-Number 1 VALUE Ascend-Calling-Id-Type-Of-Num National-Number 2 VALUE Ascend-Calling-Id-Type-Of-Num Network-Specific 3 VALUE Ascend-Calling-Id-Type-Of-Num Subscriber-Number 4 VALUE Ascend-Calling-Id-Type-Of-Num Unknown 0 VALUE Ascend-Ckt-Type Ascend-PVC 0 VALUE Ascend-Ckt-Type Ascend-SVC 1 VALUE Ascend-Client-Assign-WINS WINS-Assign-No 0 VALUE Ascend-Client-Assign-WINS WINS-Assign-Yes 1 VALUE Ascend-Dsl-Downstream-Limit adslcap-dn-1280000 10 VALUE Ascend-Dsl-Downstream-Limit adslcap-dn-1600000 9 VALUE Ascend-Dsl-Downstream-Limit adslcap-dn-1920000 8 VALUE Ascend-Dsl-Downstream-Limit adslcap-dn-2240000 7 VALUE Ascend-Dsl-Downstream-Limit adslcap-dn-2560000 6 VALUE Ascend-Dsl-Downstream-Limit adslcap-dn-2688000 5 VALUE Ascend-Dsl-Downstream-Limit adslcap-dn-3200000 4 VALUE Ascend-Dsl-Downstream-Limit adslcap-dn-4480000 3 VALUE Ascend-Dsl-Downstream-Limit adslcap-dn-5120000 2 VALUE Ascend-Dsl-Downstream-Limit adslcap-dn-6272000 1 VALUE Ascend-Dsl-Downstream-Limit adslcap-dn-640000 12 VALUE Ascend-Dsl-Downstream-Limit adslcap-dn-7168000 0 VALUE Ascend-Dsl-Downstream-Limit adslcap-dn-960000 11 VALUE Ascend-Dsl-Downstream-Limit adsldmt-dn-128000 121 VALUE Ascend-Dsl-Downstream-Limit adsldmt-dn-1280000 114 VALUE Ascend-Dsl-Downstream-Limit adsldmt-dn-1600000 113 VALUE Ascend-Dsl-Downstream-Limit adsldmt-dn-1920000 112 VALUE Ascend-Dsl-Downstream-Limit adsldmt-dn-2240000 111 VALUE Ascend-Dsl-Downstream-Limit adsldmt-dn-256000 120 VALUE Ascend-Dsl-Downstream-Limit adsldmt-dn-2560000 110 VALUE Ascend-Dsl-Downstream-Limit adsldmt-dn-2688000 109 VALUE Ascend-Dsl-Downstream-Limit adsldmt-dn-3200000 108 VALUE Ascend-Dsl-Downstream-Limit adsldmt-dn-384000 119 VALUE Ascend-Dsl-Downstream-Limit adsldmt-dn-4480000 107 VALUE Ascend-Dsl-Downstream-Limit adsldmt-dn-512000 118 VALUE Ascend-Dsl-Downstream-Limit adsldmt-dn-5120000 106 VALUE Ascend-Dsl-Downstream-Limit adsldmt-dn-6272000 105 VALUE Ascend-Dsl-Downstream-Limit adsldmt-dn-640000 117 VALUE Ascend-Dsl-Downstream-Limit adsldmt-dn-7168000 104 VALUE Ascend-Dsl-Downstream-Limit adsldmt-dn-768000 116 VALUE Ascend-Dsl-Downstream-Limit adsldmt-dn-8000000 103 VALUE Ascend-Dsl-Downstream-Limit adsldmt-dn-8960000 102 VALUE Ascend-Dsl-Downstream-Limit adsldmt-dn-9504000 101 VALUE Ascend-Dsl-Downstream-Limit adsldmt-dn-960000 115 VALUE Ascend-Dsl-Downstream-Limit adsldmt-dn-auto 100 VALUE Ascend-Dsl-Rate-Mode Rate-Mode-AutoBaud 1 VALUE Ascend-Dsl-Rate-Mode Rate-Mode-Single 2 VALUE Ascend-Dsl-Rate-Type Rate-Type-AdslCap 2 VALUE Ascend-Dsl-Rate-Type Rate-Type-AdslDmt 4 VALUE Ascend-Dsl-Rate-Type Rate-Type-AdslDmtCell 3 VALUE Ascend-Dsl-Rate-Type Rate-Type-Disabled 0 VALUE Ascend-Dsl-Rate-Type Rate-Type-Sdsl 1 VALUE Ascend-Dsl-Upstream-Limit adsldmt-up-896000 153 VALUE Ascend-Dsl-Upstream-Limit adslcap-up-1088000 50 VALUE Ascend-Dsl-Upstream-Limit adslcap-up-272000 56 VALUE Ascend-Dsl-Upstream-Limit adslcap-up-408000 55 VALUE Ascend-Dsl-Upstream-Limit adslcap-up-544000 54 VALUE Ascend-Dsl-Upstream-Limit adslcap-up-680000 53 VALUE Ascend-Dsl-Upstream-Limit adslcap-up-816000 52 VALUE Ascend-Dsl-Upstream-Limit adslcap-up-952000 51 VALUE Ascend-Dsl-Upstream-Limit adsldmt-up-1088000 151 VALUE Ascend-Dsl-Upstream-Limit adsldmt-up-128000 160 VALUE Ascend-Dsl-Upstream-Limit adsldmt-up-256000 159 VALUE Ascend-Dsl-Upstream-Limit adsldmt-up-384000 158 VALUE Ascend-Dsl-Upstream-Limit adsldmt-up-512000 157 VALUE Ascend-Dsl-Upstream-Limit adsldmt-up-640000 156 VALUE Ascend-Dsl-Upstream-Limit adsldmt-up-768000 155 VALUE Ascend-Dsl-Upstream-Limit adsldmt-up-800000 154 VALUE Ascend-Dsl-Upstream-Limit adsldmt-up-928000 152 VALUE Ascend-Dsl-Upstream-Limit adsldmt-up-auto 150 VALUE Ascend-Dsl-Upstream-Limit sdsl-1168000 5 VALUE Ascend-Dsl-Upstream-Limit sdsl-144000 0 VALUE Ascend-Dsl-Upstream-Limit sdsl-1552000 6 VALUE Ascend-Dsl-Upstream-Limit sdsl-2320000 7 VALUE Ascend-Dsl-Upstream-Limit sdsl-272000 1 VALUE Ascend-Dsl-Upstream-Limit sdsl-400000 2 VALUE Ascend-Dsl-Upstream-Limit sdsl-528000 3 VALUE Ascend-Dsl-Upstream-Limit sdsl-784000 4 VALUE Ascend-FR-Link-Status-DLCI Ascend-FR-LMI-Dlci-0 0 VALUE Ascend-FR-Link-Status-DLCI Ascend-FR-LMI-Dlci-1023 1023 VALUE Ascend-Filter-Required Required-No 0 VALUE Ascend-Filter-Required Required-Yes 1 VALUE Ascend-IP-Pool-Chaining IP-Pool-Chaining-No 0 VALUE Ascend-IP-Pool-Chaining IP-Pool-Chaining-Yes 1 VALUE Ascend-IP-TOS IP-TOS-Cost 2 VALUE Ascend-IP-TOS IP-TOS-Disabled 1 VALUE Ascend-IP-TOS IP-TOS-Latency 16 VALUE Ascend-IP-TOS IP-TOS-Normal 0 VALUE Ascend-IP-TOS IP-TOS-Reliability 4 VALUE Ascend-IP-TOS IP-TOS-Throughput 8 VALUE Ascend-IP-TOS-Apply-To IP-TOS-Apply-To-Both 3072 VALUE Ascend-IP-TOS-Apply-To IP-TOS-Apply-To-Incoming 1024 VALUE Ascend-IP-TOS-Apply-To IP-TOS-Apply-To-Outgoing 2048 VALUE Ascend-IP-TOS-Precedence IP-TOS-Precedence-Pri-Five 160 VALUE Ascend-IP-TOS-Precedence IP-TOS-Precedence-Pri-Four 128 VALUE Ascend-IP-TOS-Precedence IP-TOS-Precedence-Pri-Normal 0 VALUE Ascend-IP-TOS-Precedence IP-TOS-Precedence-Pri-One 32 VALUE Ascend-IP-TOS-Precedence IP-TOS-Precedence-Pri-Seven 224 VALUE Ascend-IP-TOS-Precedence IP-TOS-Precedence-Pri-Six 192 VALUE Ascend-IP-TOS-Precedence IP-TOS-Precedence-Pri-Three 96 VALUE Ascend-IP-TOS-Precedence IP-TOS-Precedence-Pri-Two 64 VALUE Ascend-IPX-Header-Compression IPX-Header-Compression-No 0 VALUE Ascend-IPX-Header-Compression IPX-Header-Compression-Yes 1 VALUE Ascend-NAS-Port-Format 1_2_2 3 VALUE Ascend-NAS-Port-Format 2_4_5_5 2 VALUE Ascend-NAS-Port-Format 2_4_6_4 1 VALUE Ascend-NAS-Port-Format Unknown 0 VALUE Ascend-Numbering-Plan-ID ISDN-Numbering-Plan 1 VALUE Ascend-Numbering-Plan-ID Private-Numbering-Plan 9 VALUE Ascend-Numbering-Plan-ID Unknown-Numbering-Plan 0 VALUE Ascend-PPPoE-Enable PPPoE-No 0 VALUE Ascend-PPPoE-Enable PPPoE-Yes 1 VALUE Ascend-Port-Redir-Protocol Ascend-Proto-TCP 6 VALUE Ascend-Port-Redir-Protocol Ascend-Proto-UDP 17 VALUE Ascend-Private-Route-Required Required-No 0 VALUE Ascend-Private-Route-Required Required-Yes 1 VALUE Ascend-Route-Appletalk Route-Appletalk-No 0 VALUE Ascend-Route-Appletalk Route-Appletalk-Yes 1 VALUE Ascend-SVC-Enabled Ascend-SVC-Enabled-No 0 VALUE Ascend-SVC-Enabled Ascend-SVC-Enabled-Yes 1 VALUE Ascend-Service-Type Ascend-Service-Type-ATM 20 VALUE Ascend-Service-Type Ascend-Service-Type-Combinet 7 VALUE Ascend-Service-Type Ascend-Service-Type-EuRaw 9 VALUE Ascend-Service-Type Ascend-Service-Type-EuUi 10 VALUE Ascend-Service-Type Ascend-Service-Type-FR 8 VALUE Ascend-Service-Type Ascend-Service-Type-HdlcNrm 21 VALUE Ascend-Service-Type Ascend-Service-Type-IpFax 19 VALUE Ascend-Service-Type Ascend-Service-Type-MP 15 VALUE Ascend-Service-Type Ascend-Service-Type-MPP 5 VALUE Ascend-Service-Type Ascend-Service-Type-NetToNet 25 VALUE Ascend-Service-Type Ascend-Service-Type-None 1 VALUE Ascend-Service-Type Ascend-Service-Type-NotUsed 0 VALUE Ascend-Service-Type Ascend-Service-Type-Other 2 VALUE Ascend-Service-Type Ascend-Service-Type-PPP 3 VALUE Ascend-Service-Type Ascend-Service-Type-PseuTunPPP 18 VALUE Ascend-Service-Type Ascend-Service-Type-RawTcp 13 VALUE Ascend-Service-Type Ascend-Service-Type-Slip 4 VALUE Ascend-Service-Type Ascend-Service-Type-Telnet 11 VALUE Ascend-Service-Type Ascend-Service-Type-TelnetBin 12 VALUE Ascend-Service-Type Ascend-Service-Type-TermServer 14 VALUE Ascend-Service-Type Ascend-Service-Type-VirtualConn 16 VALUE Ascend-Service-Type Ascend-Service-Type-Visa2 23 VALUE Ascend-Service-Type Ascend-Service-Type-VoIp 22 VALUE Ascend-Service-Type Ascend-Service-Type-X25 6 VALUE Ascend-Service-Type Ascend-Service-Type-X25DChan 17 VALUE Ascend-Session-Type Ascend-Session-G711-Alaw 3 VALUE Ascend-Session-Type Ascend-Session-G711-Ulaw 2 VALUE Ascend-Session-Type Ascend-Session-G723 4 VALUE Ascend-Session-Type Ascend-Session-G723-64KPS 6 VALUE Ascend-Session-Type Ascend-Session-G728 7 VALUE Ascend-Session-Type Ascend-Session-G729 5 VALUE Ascend-Session-Type Ascend-Session-RT24 8 VALUE Ascend-Session-Type Ascend-Session-Unknown 1 VALUE Ascend-Session-Type Ascend-Session-Unused 0 VALUE Ascend-Tunneling-Protocol ATMP-Tunnel 0 VALUE Ascend-Tunneling-Protocol VTP-Tunnel 1 VALUE Ascend-X25-Pad-X3-Profile CC_SSP 4 VALUE Ascend-X25-Pad-X3-Profile CC_TSP 5 VALUE Ascend-X25-Pad-X3-Profile CRT 0 VALUE Ascend-X25-Pad-X3-Profile CUSTOM 11 VALUE Ascend-X25-Pad-X3-Profile DEFAULT 2 VALUE Ascend-X25-Pad-X3-Profile HARDCOPY 6 VALUE Ascend-X25-Pad-X3-Profile HDX 7 VALUE Ascend-X25-Pad-X3-Profile INFONET 1 VALUE Ascend-X25-Pad-X3-Profile NULL 10 VALUE Ascend-X25-Pad-X3-Profile POS 9 VALUE Ascend-X25-Pad-X3-Profile SCEN 3 VALUE Ascend-X25-Pad-X3-Profile SHARK 8 VALUE Ascend-X25-Reverse-Charging Reverse-Charging-No 0 VALUE Ascend-X25-Reverse-Charging Reverse-Charging-Yes 1 END-VENDOR Ascend freeradius-server/share/dictionary.ascend.illegal000066400000000000000000000474611257552170400225750ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2011 The FreeRADIUS Server project and contributors ############################################################################## # # Ascend dictionary that illegally uses the RFC space. # # $Id$ # ############################################################################## # # Ascend specific extensions # Used by ASCEND MAX/Pipeline products # # This next block is renamed because they share the same # names as the vendor-specific attributes, BUT they occur # in the lower (1-255) RADIUS attribute space. # # Older Ascend software will send these, rather than the # vendor specific attributes. # ATTRIBUTE X-Ascend-FCP-Parameter 119 string ATTRIBUTE X-Ascend-Modem-PortNo 120 integer ATTRIBUTE X-Ascend-Modem-SlotNo 121 integer ATTRIBUTE X-Ascend-Modem-ShelfNo 122 integer ATTRIBUTE X-Ascend-Call-Attempt-Limit 123 integer ATTRIBUTE X-Ascend-Call-Block-Duration 124 integer ATTRIBUTE X-Ascend-Maximum-Call-Duration 125 integer ATTRIBUTE X-Ascend-Temporary-Rtes 126 integer ATTRIBUTE X-Ascend-Tunneling-Protocol 127 integer ATTRIBUTE X-Ascend-Shared-Profile-Enable 128 integer ATTRIBUTE X-Ascend-Primary-Home-Agent 129 string ATTRIBUTE X-Ascend-Secondary-Home-Agent 130 string ATTRIBUTE X-Ascend-Dialout-Allowed 131 integer ATTRIBUTE X-Ascend-Client-Gateway 132 ipaddr ATTRIBUTE X-Ascend-BACP-Enable 133 integer ATTRIBUTE X-Ascend-DHCP-Maximum-Leases 134 integer ATTRIBUTE X-Ascend-Client-Primary-DNS 135 ipaddr ATTRIBUTE X-Ascend-Client-Secondary-DNS 136 ipaddr ATTRIBUTE X-Ascend-Client-Assign-DNS 137 integer ATTRIBUTE X-Ascend-User-Acct-Type 138 integer ATTRIBUTE X-Ascend-User-Acct-Host 139 ipaddr ATTRIBUTE X-Ascend-User-Acct-Port 140 integer ATTRIBUTE X-Ascend-User-Acct-Key 141 string ATTRIBUTE X-Ascend-User-Acct-Base 142 integer ATTRIBUTE X-Ascend-User-Acct-Time 143 integer ATTRIBUTE X-Ascend-Assign-IP-Client 144 ipaddr ATTRIBUTE X-Ascend-Assign-IP-Server 145 ipaddr ATTRIBUTE X-Ascend-Assign-IP-Global-Pool 146 string ATTRIBUTE X-Ascend-DHCP-Reply 147 integer ATTRIBUTE X-Ascend-DHCP-Pool-Number 148 integer ATTRIBUTE X-Ascend-Expect-Callback 149 integer ATTRIBUTE X-Ascend-Event-Type 150 integer ATTRIBUTE X-Ascend-Session-Svr-Key 151 string ATTRIBUTE X-Ascend-Multicast-Rate-Limit 152 integer ATTRIBUTE X-Ascend-IF-Netmask 153 ipaddr ATTRIBUTE X-Ascend-Remote-Addr 154 ipaddr ATTRIBUTE X-Ascend-Multicast-Client 155 integer ATTRIBUTE X-Ascend-FR-Circuit-Name 156 string ATTRIBUTE X-Ascend-FR-LinkUp 157 integer ATTRIBUTE X-Ascend-FR-Nailed-Grp 158 integer ATTRIBUTE X-Ascend-FR-Type 159 integer ATTRIBUTE X-Ascend-FR-Link-Mgt 160 integer ATTRIBUTE X-Ascend-FR-N391 161 integer ATTRIBUTE X-Ascend-FR-DCE-N392 162 integer ATTRIBUTE X-Ascend-FR-DTE-N392 163 integer ATTRIBUTE X-Ascend-FR-DCE-N393 164 integer ATTRIBUTE X-Ascend-FR-DTE-N393 165 integer ATTRIBUTE X-Ascend-FR-T391 166 integer ATTRIBUTE X-Ascend-FR-T392 167 integer ATTRIBUTE X-Ascend-Bridge-Address 168 string ATTRIBUTE X-Ascend-TS-Idle-Limit 169 integer ATTRIBUTE X-Ascend-TS-Idle-Mode 170 integer ATTRIBUTE X-Ascend-DBA-Monitor 171 integer ATTRIBUTE X-Ascend-Base-Channel-Count 172 integer ATTRIBUTE X-Ascend-Minimum-Channels 173 integer ATTRIBUTE X-Ascend-IPX-Route 174 string ATTRIBUTE X-Ascend-FT1-Caller 175 integer ATTRIBUTE X-Ascend-Backup 176 string ATTRIBUTE X-Ascend-Call-Type 177 integer ATTRIBUTE X-Ascend-Group 178 string ATTRIBUTE X-Ascend-FR-DLCI 179 integer ATTRIBUTE X-Ascend-FR-Profile-Name 180 string ATTRIBUTE X-Ascend-Ara-PW 181 string ATTRIBUTE X-Ascend-IPX-Node-Addr 182 string ATTRIBUTE X-Ascend-Home-Agent-IP-Addr 183 ipaddr ATTRIBUTE X-Ascend-Home-Agent-Password 184 string ATTRIBUTE X-Ascend-Home-Network-Name 185 string ATTRIBUTE X-Ascend-Home-Agent-UDP-Port 186 integer ATTRIBUTE X-Ascend-Multilink-ID 187 integer ATTRIBUTE X-Ascend-Num-In-Multilink 188 integer ATTRIBUTE X-Ascend-First-Dest 189 ipaddr ATTRIBUTE X-Ascend-Pre-Input-Octets 190 integer ATTRIBUTE X-Ascend-Pre-Output-Octets 191 integer ATTRIBUTE X-Ascend-Pre-Input-Packets 192 integer ATTRIBUTE X-Ascend-Pre-Output-Packets 193 integer ATTRIBUTE X-Ascend-Maximum-Time 194 integer ATTRIBUTE X-Ascend-Disconnect-Cause 195 integer ATTRIBUTE X-Ascend-Connect-Progress 196 integer ATTRIBUTE X-Ascend-Data-Rate 197 integer ATTRIBUTE X-Ascend-PreSession-Time 198 integer ATTRIBUTE X-Ascend-Token-Idle 199 integer ATTRIBUTE X-Ascend-Token-Immediate 200 integer ATTRIBUTE X-Ascend-Require-Auth 201 integer ATTRIBUTE X-Ascend-Number-Sessions 202 string ATTRIBUTE X-Ascend-Authen-Alias 203 string ATTRIBUTE X-Ascend-Token-Expiry 204 integer ATTRIBUTE X-Ascend-Menu-Selector 205 string # # These next two attributes conflict with the Digest attributes! # ATTRIBUTE X-Ascend-Menu-Item 206 string ATTRIBUTE X-Ascend-PW-Warntime 207 integer ATTRIBUTE X-Ascend-PW-Lifetime 208 integer ATTRIBUTE X-Ascend-IP-Direct 209 ipaddr ATTRIBUTE X-Ascend-PPP-VJ-Slot-Comp 210 integer ATTRIBUTE X-Ascend-PPP-VJ-1172 211 integer ATTRIBUTE X-Ascend-PPP-Async-Map 212 integer ATTRIBUTE X-Ascend-Third-Prompt 213 string ATTRIBUTE X-Ascend-Send-Secret 214 string encrypt=3 ATTRIBUTE X-Ascend-Receive-Secret 215 string encrypt=3 ATTRIBUTE X-Ascend-IPX-Peer-Mode 216 integer ATTRIBUTE X-Ascend-IP-Pool-Definition 217 string ATTRIBUTE X-Ascend-Assign-IP-Pool 218 integer ATTRIBUTE X-Ascend-FR-Direct 219 integer ATTRIBUTE X-Ascend-FR-Direct-Profile 220 string ATTRIBUTE X-Ascend-FR-Direct-DLCI 221 integer ATTRIBUTE X-Ascend-Handle-IPX 222 integer ATTRIBUTE X-Ascend-Netware-timeout 223 integer ATTRIBUTE X-Ascend-IPX-Alias 224 integer ATTRIBUTE X-Ascend-Metric 225 integer ATTRIBUTE X-Ascend-PRI-Number-Type 226 integer ATTRIBUTE X-Ascend-Dial-Number 227 string ATTRIBUTE X-Ascend-Route-IP 228 integer ATTRIBUTE X-Ascend-Route-IPX 229 integer ATTRIBUTE X-Ascend-Bridge 230 integer ATTRIBUTE X-Ascend-Send-Auth 231 integer ATTRIBUTE X-Ascend-Send-Passwd 232 string ATTRIBUTE X-Ascend-Link-Compression 233 integer ATTRIBUTE X-Ascend-Target-Util 234 integer ATTRIBUTE X-Ascend-Maximum-Channels 235 integer ATTRIBUTE X-Ascend-Inc-Channel-Count 236 integer ATTRIBUTE X-Ascend-Dec-Channel-Count 237 integer ATTRIBUTE X-Ascend-Seconds-Of-History 238 integer ATTRIBUTE X-Ascend-History-Weigh-Type 239 integer ATTRIBUTE X-Ascend-Add-Seconds 240 integer ATTRIBUTE X-Ascend-Remove-Seconds 241 integer ATTRIBUTE X-Ascend-Data-Filter 242 abinary ATTRIBUTE X-Ascend-Call-Filter 243 abinary ATTRIBUTE X-Ascend-Idle-Limit 244 integer ATTRIBUTE X-Ascend-Preempt-Limit 245 integer ATTRIBUTE X-Ascend-Callback 246 integer ATTRIBUTE X-Ascend-Data-Svc 247 integer ATTRIBUTE X-Ascend-Force-56 248 integer ATTRIBUTE X-Ascend-Billing-Number 249 string ATTRIBUTE X-Ascend-Call-By-Call 250 integer ATTRIBUTE X-Ascend-Transit-Number 251 string ATTRIBUTE X-Ascend-Host-Info 252 string ATTRIBUTE X-Ascend-PPP-Address 253 ipaddr ATTRIBUTE X-Ascend-MPP-Idle-Percent 254 integer ATTRIBUTE X-Ascend-Xmit-Rate 255 integer # # VALUEs for X-Ascend-* attributes, copied verbatim from the # VALUEs above, for the VSA versions of Ascend-*. # # Do NOT edit the following VALUEs! Instead, re-generate them via: # # (for x in `egrep ^ATTRIBUTE dictionary.ascend | egrep 'X-Ascend-' | awk '{print $2}' | uniq`;do y=`echo $x | sed 's/X-//'`;egrep VALUE dictionary.ascend | egrep $y[^-] | sed "s/$y/X-$y/" ; done) > new-value # # VALUE X-Ascend-Temporary-Rtes Temp-Rtes-No 0 VALUE X-Ascend-Temporary-Rtes Temp-Rtes-Yes 1 VALUE X-Ascend-Tunneling-Protocol ATMP-Tunnel 0 VALUE X-Ascend-Tunneling-Protocol VTP-Tunnel 1 VALUE X-Ascend-Shared-Profile-Enable Shared-Profile-No 0 VALUE X-Ascend-Shared-Profile-Enable Shared-Profile-Yes 1 VALUE X-Ascend-Dialout-Allowed Dialout-Not-Allowed 0 VALUE X-Ascend-Dialout-Allowed Dialout-Allowed 1 VALUE X-Ascend-BACP-Enable BACP-No 0 VALUE X-Ascend-BACP-Enable BACP-Yes 1 VALUE X-Ascend-Client-Assign-DNS DNS-Assign-No 0 VALUE X-Ascend-Client-Assign-DNS DNS-Assign-Yes 1 VALUE X-Ascend-User-Acct-Type Ascend-User-Acct-None 0 VALUE X-Ascend-User-Acct-Type Ascend-User-Acct-User 1 VALUE X-Ascend-User-Acct-Type Ascend-User-Acct-User-Default 2 VALUE X-Ascend-User-Acct-Base Base-10 0 VALUE X-Ascend-User-Acct-Base Base-16 1 VALUE X-Ascend-DHCP-Reply DHCP-Reply-No 0 VALUE X-Ascend-DHCP-Reply DHCP-Reply-Yes 1 VALUE X-Ascend-Expect-Callback Expect-Callback-No 0 VALUE X-Ascend-Expect-Callback Expect-Callback-Yes 1 VALUE X-Ascend-Event-Type Ascend-ColdStart 1 VALUE X-Ascend-Event-Type Ascend-Session-Event 2 VALUE X-Ascend-Multicast-Client Multicast-No 0 VALUE X-Ascend-Multicast-Client Multicast-Yes 1 VALUE X-Ascend-FR-LinkUp Ascend-LinkUp-Default 0 VALUE X-Ascend-FR-LinkUp Ascend-LinkUp-AlwaysUp 1 VALUE X-Ascend-FR-Type Ascend-FR-DTE 0 VALUE X-Ascend-FR-Type Ascend-FR-DCE 1 VALUE X-Ascend-FR-Type Ascend-FR-NNI 2 VALUE X-Ascend-FR-Link-Mgt Ascend-FR-No-Link-Mgt 0 VALUE X-Ascend-FR-Link-Mgt Ascend-FR-T1-617D 1 VALUE X-Ascend-FR-Link-Mgt Ascend-FR-Q-933A 2 VALUE X-Ascend-TS-Idle-Mode TS-Idle-None 0 VALUE X-Ascend-TS-Idle-Mode TS-Idle-Input 1 VALUE X-Ascend-TS-Idle-Mode TS-Idle-Input-Output 2 VALUE X-Ascend-DBA-Monitor DBA-Transmit 0 VALUE X-Ascend-DBA-Monitor DBA-Transmit-Recv 1 VALUE X-Ascend-DBA-Monitor DBA-None 2 VALUE X-Ascend-FT1-Caller FT1-No 0 VALUE X-Ascend-FT1-Caller FT1-Yes 1 VALUE X-Ascend-Call-Type Switched 0 VALUE X-Ascend-Call-Type Nailed 1 VALUE X-Ascend-Call-Type Nailed/Mpp 2 VALUE X-Ascend-Call-Type Perm/Switched 3 VALUE X-Ascend-Call-Type AO/DI 6 VALUE X-Ascend-Call-Type MegaMax 7 VALUE X-Ascend-Disconnect-Cause No-Reason 0 VALUE X-Ascend-Disconnect-Cause Not-Applicable 1 VALUE X-Ascend-Disconnect-Cause Unknown 2 VALUE X-Ascend-Disconnect-Cause Call-Disconnected 3 VALUE X-Ascend-Disconnect-Cause CLID-Authentication-Failed 4 VALUE X-Ascend-Disconnect-Cause CLID-RADIUS-Timeout 5 VALUE X-Ascend-Disconnect-Cause Modem-No-DCD 10 VALUE X-Ascend-Disconnect-Cause DCD-Detected-Then-Inactive 11 VALUE X-Ascend-Disconnect-Cause Modem-Invalid-Result-Codes 12 VALUE X-Ascend-Disconnect-Cause TermSrv-User-Quit 20 VALUE X-Ascend-Disconnect-Cause TermSrv-Idle-Timeout 21 VALUE X-Ascend-Disconnect-Cause TermSrv-Exit-Telnet 22 VALUE X-Ascend-Disconnect-Cause TermSrv-No-IPaddr 23 VALUE X-Ascend-Disconnect-Cause TermSrv-Exit-Raw-TCP 24 VALUE X-Ascend-Disconnect-Cause TermSrv-Exit-Login-Failed 25 VALUE X-Ascend-Disconnect-Cause TermSrv-Exit-Raw-TCP-Disabled 26 VALUE X-Ascend-Disconnect-Cause TermSrv-CTRL-C-In-Login 27 VALUE X-Ascend-Disconnect-Cause TermSrv-Destroyed 28 VALUE X-Ascend-Disconnect-Cause TermSrv-User-Closed-VCon 29 VALUE X-Ascend-Disconnect-Cause TermSrv-VCon-Destroyed 30 VALUE X-Ascend-Disconnect-Cause TermSrv-Exit-Rlogin 31 VALUE X-Ascend-Disconnect-Cause TermSrv-Bad-Rlogin-Option 32 VALUE X-Ascend-Disconnect-Cause TermSrv-Not-Enough-Resources 33 VALUE X-Ascend-Disconnect-Cause MPP-No-NULL-Msg-Timeout 35 VALUE X-Ascend-Disconnect-Cause PPP-LCP-Timeout 40 VALUE X-Ascend-Disconnect-Cause PPP-LCP-Negotion-Failed 41 VALUE X-Ascend-Disconnect-Cause PPP-PAP-Auth-Failed 42 VALUE X-Ascend-Disconnect-Cause PPP-CHAP-Auth-Failed 43 VALUE X-Ascend-Disconnect-Cause PPP-Rmt-Auth-Failed 44 VALUE X-Ascend-Disconnect-Cause PPP-Rcv-Terminate-Req 45 VALUE X-Ascend-Disconnect-Cause PPP-Rcv-Close-Event 46 VALUE X-Ascend-Disconnect-Cause PPP-No-NCPs-Open 47 VALUE X-Ascend-Disconnect-Cause PPP-MP-Bundle-Unknown 48 VALUE X-Ascend-Disconnect-Cause PPP-LCP-Close-MP-Add-Fail 49 VALUE X-Ascend-Disconnect-Cause Session-Table-Full 50 VALUE X-Ascend-Disconnect-Cause Out-Of-Resources 51 VALUE X-Ascend-Disconnect-Cause Invalid-IP-Address 52 VALUE X-Ascend-Disconnect-Cause Hostname-Resolution-Failed 53 VALUE X-Ascend-Disconnect-Cause Bad-Or-Missing-Port-Number 54 VALUE X-Ascend-Disconnect-Cause Host-Reset 60 VALUE X-Ascend-Disconnect-Cause Connection-Refused 61 VALUE X-Ascend-Disconnect-Cause Connection-Timeout 62 VALUE X-Ascend-Disconnect-Cause Connection-Closed 63 VALUE X-Ascend-Disconnect-Cause Network-Unreachable 64 VALUE X-Ascend-Disconnect-Cause Host-Unreachable 65 VALUE X-Ascend-Disconnect-Cause Network-Unreachable-Admin 66 VALUE X-Ascend-Disconnect-Cause Host-Unreachable-Admin 67 VALUE X-Ascend-Disconnect-Cause Port-Unreachable 68 VALUE X-Ascend-Disconnect-Cause Session-Timeout 100 VALUE X-Ascend-Disconnect-Cause Invalid-Incoming-User 101 VALUE X-Ascend-Disconnect-Cause Disconnect-Due-To-Callback 102 VALUE X-Ascend-Disconnect-Cause Proto-Disabled-Or-Unsupported 120 VALUE X-Ascend-Disconnect-Cause Disconnect-Req-By-RADIUS 150 VALUE X-Ascend-Disconnect-Cause Disconnect-Req-By-Local-Admin 151 VALUE X-Ascend-Disconnect-Cause V110-Timeout-Sync-Retry-Exceed 160 VALUE X-Ascend-Disconnect-Cause PPP-Auth-Timeout-Exceeded 170 VALUE X-Ascend-Disconnect-Cause User-Executed-Do-Hangup 180 VALUE X-Ascend-Disconnect-Cause Remote-End-Hung-Up 185 VALUE X-Ascend-Disconnect-Cause Resource-Has-Been-Quiesced 190 VALUE X-Ascend-Disconnect-Cause Max-Call-Duration-Reached 195 VALUE X-Ascend-Connect-Progress No-Progress 0 VALUE X-Ascend-Connect-Progress Call-Up 10 VALUE X-Ascend-Connect-Progress Modem-Up 30 VALUE X-Ascend-Connect-Progress Modem-Awaiting-DCD 31 VALUE X-Ascend-Connect-Progress Modem-Awaiting-Codes 32 VALUE X-Ascend-Connect-Progress TermSrv-Started 40 VALUE X-Ascend-Connect-Progress TermSrv-Raw-TCP-Started 41 VALUE X-Ascend-Connect-Progress TermSrv-Telnet-Started 42 VALUE X-Ascend-Connect-Progress TermSrv-Raw-TCP-Connected 43 VALUE X-Ascend-Connect-Progress TermSrv-Telnet-Connected 44 VALUE X-Ascend-Connect-Progress TermSrv-Rlogin-Started 45 VALUE X-Ascend-Connect-Progress TermSrv-Rlogin-Connected 46 VALUE X-Ascend-Connect-Progress Modem-Outdial-Call-Up 50 VALUE X-Ascend-Connect-Progress LAN-Session-Up 60 VALUE X-Ascend-Connect-Progress LCP-Opening 61 VALUE X-Ascend-Connect-Progress CCP-Opening 62 VALUE X-Ascend-Connect-Progress IPNCP-Opening 63 VALUE X-Ascend-Connect-Progress BNCP-Opening 64 VALUE X-Ascend-Connect-Progress LCP-Opened 65 VALUE X-Ascend-Connect-Progress CCP-Opened 66 VALUE X-Ascend-Connect-Progress IPNCP-Opened 67 VALUE X-Ascend-Connect-Progress BNCP-Opened 68 VALUE X-Ascend-Connect-Progress LCP-State-Initial 69 VALUE X-Ascend-Connect-Progress LCP-State-Starting 70 VALUE X-Ascend-Connect-Progress LCP-State-Closed 71 VALUE X-Ascend-Connect-Progress LCP-State-Stopped 72 VALUE X-Ascend-Connect-Progress LCP-State-Closing 73 VALUE X-Ascend-Connect-Progress LCP-State-Stopping 74 VALUE X-Ascend-Connect-Progress LCP-State-Request-Sent 75 VALUE X-Ascend-Connect-Progress LCP-State-Ack-Received 76 VALUE X-Ascend-Connect-Progress LCP-State-Ack-Sent 77 VALUE X-Ascend-Connect-Progress IPXNCP-Opened 80 VALUE X-Ascend-Connect-Progress ATNCP-Opened 81 VALUE X-Ascend-Connect-Progress BACP-Opening 82 VALUE X-Ascend-Connect-Progress BACP-Opened 83 VALUE X-Ascend-Connect-Progress V110-Up 90 VALUE X-Ascend-Connect-Progress V110-State-Opened 91 VALUE X-Ascend-Connect-Progress V110-State-Carrier 92 VALUE X-Ascend-Connect-Progress V110-State-Reset 93 VALUE X-Ascend-Connect-Progress V110-State-Closed 94 VALUE X-Ascend-Token-Immediate Tok-Imm-No 0 VALUE X-Ascend-Token-Immediate Tok-Imm-Yes 1 VALUE X-Ascend-Require-Auth Not-Require-Auth 0 VALUE X-Ascend-Require-Auth Require-Auth 1 VALUE X-Ascend-PW-Warntime Days-Of-Warning 0 VALUE X-Ascend-PW-Lifetime Lifetime-In-Days 0 VALUE X-Ascend-PPP-VJ-Slot-Comp VJ-Slot-Comp-No 1 VALUE X-Ascend-PPP-VJ-1172 PPP-VJ-1172 1 VALUE X-Ascend-IPX-Peer-Mode IPX-Peer-Router 0 VALUE X-Ascend-IPX-Peer-Mode IPX-Peer-Dialin 1 VALUE X-Ascend-FR-Direct FR-Direct-No 0 VALUE X-Ascend-FR-Direct FR-Direct-Yes 1 VALUE X-Ascend-Handle-IPX Handle-IPX-None 0 VALUE X-Ascend-Handle-IPX Handle-IPX-Client 1 VALUE X-Ascend-Handle-IPX Handle-IPX-Server 2 VALUE X-Ascend-PRI-Number-Type Unknown-Number 0 VALUE X-Ascend-PRI-Number-Type Intl-Number 1 VALUE X-Ascend-PRI-Number-Type National-Number 2 VALUE X-Ascend-PRI-Number-Type Net-Specific-Number 3 VALUE X-Ascend-PRI-Number-Type Local-Number 4 VALUE X-Ascend-PRI-Number-Type Abbrev-Number 5 VALUE X-Ascend-Route-IP Route-IP-No 0 VALUE X-Ascend-Route-IP Route-IP-Yes 1 VALUE X-Ascend-Route-IPX Route-IPX-No 0 VALUE X-Ascend-Route-IPX Route-IPX-Yes 1 VALUE X-Ascend-Route-IPX Route-IPX-No 0 VALUE X-Ascend-Route-IPX Route-IPX-Yes 1 VALUE X-Ascend-Bridge Bridge-No 0 VALUE X-Ascend-Bridge Bridge-Yes 1 VALUE X-Ascend-Send-Auth Send-Auth-None 0 VALUE X-Ascend-Send-Auth Send-Auth-PAP 1 VALUE X-Ascend-Send-Auth Send-Auth-CHAP 2 VALUE X-Ascend-Send-Auth Send-Auth-MS-CHAP 3 VALUE X-Ascend-Link-Compression Link-Comp-None 0 VALUE X-Ascend-Link-Compression Link-Comp-Stac 1 VALUE X-Ascend-Link-Compression Link-Comp-Stac-Draft-9 2 VALUE X-Ascend-Link-Compression Link-Comp-MS-Stac 3 VALUE X-Ascend-History-Weigh-Type History-Constant 0 VALUE X-Ascend-History-Weigh-Type History-Linear 1 VALUE X-Ascend-History-Weigh-Type History-Quadratic 2 VALUE X-Ascend-Callback Callback-No 0 VALUE X-Ascend-Callback Callback-Yes 1 VALUE X-Ascend-Data-Svc Switched-Voice-Bearer 0 VALUE X-Ascend-Data-Svc Nailed-56KR 1 VALUE X-Ascend-Data-Svc Nailed-64K 2 VALUE X-Ascend-Data-Svc Switched-64KR 3 VALUE X-Ascend-Data-Svc Switched-56K 4 VALUE X-Ascend-Data-Svc Switched-384KR 5 VALUE X-Ascend-Data-Svc Switched-384K 6 VALUE X-Ascend-Data-Svc Switched-1536K 7 VALUE X-Ascend-Data-Svc Switched-1536KR 8 VALUE X-Ascend-Data-Svc Switched-128K 9 VALUE X-Ascend-Data-Svc Switched-192K 10 VALUE X-Ascend-Data-Svc Switched-256K 11 VALUE X-Ascend-Data-Svc Switched-320K 12 VALUE X-Ascend-Data-Svc Switched-384K-MR 13 VALUE X-Ascend-Data-Svc Switched-448K 14 VALUE X-Ascend-Data-Svc Switched-512K 15 VALUE X-Ascend-Data-Svc Switched-576K 16 VALUE X-Ascend-Data-Svc Switched-640K 17 VALUE X-Ascend-Data-Svc Switched-704K 18 VALUE X-Ascend-Data-Svc Switched-768K 19 VALUE X-Ascend-Data-Svc Switched-832K 20 VALUE X-Ascend-Data-Svc Switched-896K 21 VALUE X-Ascend-Data-Svc Switched-960K 22 VALUE X-Ascend-Data-Svc Switched-1024K 23 VALUE X-Ascend-Data-Svc Switched-1088K 24 VALUE X-Ascend-Data-Svc Switched-1152K 25 VALUE X-Ascend-Data-Svc Switched-1216K 26 VALUE X-Ascend-Data-Svc Switched-1280K 27 VALUE X-Ascend-Data-Svc Switched-1344K 28 VALUE X-Ascend-Data-Svc Switched-1408K 29 VALUE X-Ascend-Data-Svc Switched-1472K 30 VALUE X-Ascend-Data-Svc Switched-1600K 31 VALUE X-Ascend-Data-Svc Switched-1664K 32 VALUE X-Ascend-Data-Svc Switched-1728K 33 VALUE X-Ascend-Data-Svc Switched-1792K 34 VALUE X-Ascend-Data-Svc Switched-1856K 35 VALUE X-Ascend-Data-Svc Switched-1920K 36 VALUE X-Ascend-Data-Svc Switched-inherited 37 VALUE X-Ascend-Data-Svc Switched-restricted-bearer-x30 38 VALUE X-Ascend-Data-Svc Switched-clear-bearer-v110 39 VALUE X-Ascend-Data-Svc Switched-restricted-64-x30 40 VALUE X-Ascend-Data-Svc Switched-clear-56-v110 41 VALUE X-Ascend-Data-Svc Switched-modem 42 VALUE X-Ascend-Data-Svc Switched-atmodem 43 VALUE X-Ascend-Data-Svc Switched-V110-24-56 45 VALUE X-Ascend-Data-Svc Switched-V110-48-56 46 VALUE X-Ascend-Data-Svc Switched-V110-96-56 47 VALUE X-Ascend-Data-Svc Switched-V110-192-56 48 VALUE X-Ascend-Data-Svc Switched-V110-384-56 49 VALUE X-Ascend-Data-Svc Switched-V110-24-56R 50 VALUE X-Ascend-Data-Svc Switched-V110-48-56R 51 VALUE X-Ascend-Data-Svc Switched-V110-96-56R 52 VALUE X-Ascend-Data-Svc Switched-V110-192-56R 53 VALUE X-Ascend-Data-Svc Switched-V110-384-56R 54 VALUE X-Ascend-Data-Svc Switched-V110-24-64 55 VALUE X-Ascend-Data-Svc Switched-V110-48-64 56 VALUE X-Ascend-Data-Svc Switched-V110-96-64 57 VALUE X-Ascend-Data-Svc Switched-V110-192-64 58 VALUE X-Ascend-Data-Svc Switched-V110-384-64 59 VALUE X-Ascend-Data-Svc Switched-V110-24-64R 60 VALUE X-Ascend-Data-Svc Switched-V110-48-64R 61 VALUE X-Ascend-Data-Svc Switched-V110-96-64R 62 VALUE X-Ascend-Data-Svc Switched-V110-384-64R 64 VALUE X-Ascend-Data-Svc Switched-V110-192-64R 63 VALUE X-Ascend-Data-Svc Switched-Pots 68 VALUE X-Ascend-Data-Svc Switched-ATM 69 VALUE X-Ascend-Data-Svc Switched-FR 70 VALUE X-Ascend-Force-56 Force-56-No 0 VALUE X-Ascend-Force-56 Force-56-Yes 1 freeradius-server/share/dictionary.asn000066400000000000000000000057661257552170400205130ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2011 The FreeRADIUS Server project and contributors ############################################################################## # # ASN Attributes. # # Taken from http://svn.asn.pl/misc/freeradius/dictionary.asn # # $Id$ # ############################################################################## VENDOR ASN 23782 BEGIN-VENDOR ASN ## Server-side extensions # dynamic IP pool name ATTRIBUTE ASN-IP-Pool-Name 1 string ### 2-99: free ### ## limits ATTRIBUTE ASN-Kbps-Down 100 integer ATTRIBUTE ASN-Kbps-Down-Localmedia 112 integer ATTRIBUTE ASN-Kbps-Up 101 integer ATTRIBUTE ASN-Pps-Down 102 integer ATTRIBUTE ASN-Pps-Up 103 integer ATTRIBUTE ASN-TCP-Connlimit 104 integer ## firewall ATTRIBUTE ASN-Firewall-Available 110 integer VALUE ASN-Firewall-Available Yes 1 VALUE ASN-Firewall-Available No 2 ATTRIBUTE ASN-Firewall-State 105 integer VALUE ASN-Firewall-State Enabled 1 VALUE ASN-Firewall-State Disabled 2 ATTRIBUTE ASN-Firewall-Block-Ping 107 integer VALUE ASN-Firewall-Block-Ping Enabled 1 VALUE ASN-Firewall-Block-Ping Disabled 2 # hosts to allow " " ATTRIBUTE ASN-Firewall-Open 106 string ## QoS ATTRIBUTE ASN-QoS-Available 111 integer VALUE ASN-QoS-Available Yes 1 VALUE ASN-QoS-Available No 2 ATTRIBUTE ASN-QoS-State 108 integer VALUE ASN-QoS-State Enabled 1 VALUE ASN-QoS-State Disabled 2 # IP redirection, with optional randomness # " src/dst [:] : []" # where src/dst decides whether to match source or destination ports # random is an integer number from 1 to 99, or null - no randomness ATTRIBUTE ASN-IP-Redirect 109 string ## web filtering # decides whether to deny or to allow only the specified web topics ATTRIBUTE ASN-Webfilter-Mode 113 integer VALUE ASN-Webfilter-Mode Deny 1 VALUE ASN-Webfilter-Mode Allow 2 # where to redirect blocked request # "[301:302]" # 301/302 - redirect permanently (301) or temporarily (302) (default 302) # - an URL address, with following possible substitutions: # %a - IP address of the client # %i - user ID (RFC931) or "unknown" # %n - domainname of the client or "unknown" # %p - REQUEST_URI, ie. the path and the optional # query string of %u, but note for convenience # without the leading "/". # %t - matched destination group or "unknown" # %u - requested URL # %% - single '%' # ATTRIBUTE ASN-Webfilter-Redirect 114 string # squidGuard destination group to match # destinations available by default: sglists- - tags: # ads adult audioandvideo banks blogs chatandforum finance freemail games # home jobsearch keylogger news onlineGames phishing proxies recreation # reference science searchengine ATTRIBUTE ASN-Webfilter-Destination 115 string # web domain to match (will match all subdomains, too) ATTRIBUTE ASN-Webfilter-Domain 116 string END-VENDOR ASN freeradius-server/share/dictionary.audiocodes000066400000000000000000000011141257552170400220300ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2011 The FreeRADIUS Server project and contributors ############################################################################## # # Audiocodes # # http://www.audiocodes.com/filehandler.ashx?fileid=36358 # # $Id$ # ############################################################################## VENDOR AudioCodes 5003 BEGIN-VENDOR AudioCodes ATTRIBUTE ACL-Auth-Level 35 integer VALUE ACL-Auth-Level ACL-Auth-UserLevel 50 VALUE ACL-Auth-Level ACL-Auth-AdminLevel 100 VALUE ACL-Auth-Level ACL-Auth-SecurityAdminLevel 200 END-VENDOR AudioCodes freeradius-server/share/dictionary.avaya000066400000000000000000000015731257552170400210230ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2011 The FreeRADIUS Server project and contributors # # Avaya P330 dictionary file # $Id$ # # http://support.avaya.com/elmodocs2/p330/P330/Configuring%20FreeRadius.pdf # VENDOR Cajun_p330 2167 BEGIN-VENDOR Cajun_p330 ATTRIBUTE Cajun-Service-Type 1 integer VALUE Cajun-Service-Type Cajun-Read-Only-User 1 VALUE Cajun-Service-Type Cajun-Read-Write-User 2 VALUE Cajun-Service-Type Cajun-Admin-User 3 ATTRIBUTE Avaya-StaticVlan-Type 12 string ATTRIBUTE Avaya-PortPriority-Type 13 integer VALUE Avaya-PortPriority-Type Type-0 0 VALUE Avaya-PortPriority-Type Type-1 1 VALUE Avaya-PortPriority-Type Type-2 2 VALUE Avaya-PortPriority-Type Type-3 3 VALUE Avaya-PortPriority-Type Type-4 4 VALUE Avaya-PortPriority-Type Type-5 5 VALUE Avaya-PortPriority-Type Type-6 6 VALUE Avaya-PortPriority-Type Type-7 7 END-VENDOR Cajun_p330 freeradius-server/share/dictionary.azaire000066400000000000000000000030251257552170400211670ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2011 The FreeRADIUS Server project and contributors ############################################################################## # # Azaire VSAs # # $Id$ # ############################################################################## VENDOR Azaire 7751 BEGIN-VENDOR Azaire ATTRIBUTE Azaire-Triplets 1 octets ATTRIBUTE Azaire-IMSI 2 octets ATTRIBUTE Azaire-MSISDN 3 octets ATTRIBUTE Azaire-APN 4 string ATTRIBUTE Azaire-QoS 5 octets ATTRIBUTE Azaire-Selection-Mode 6 integer ATTRIBUTE Azaire-APN-Resolution-Req 7 integer ATTRIBUTE Azaire-Start-Time 8 octets ATTRIBUTE Azaire-NAS-Type 9 integer ATTRIBUTE Azaire-Status 10 integer ATTRIBUTE Azaire-APN-OI 11 string ATTRIBUTE Azaire-Auth-Type 12 integer ATTRIBUTE Azaire-Gn-User-Name 13 string ATTRIBUTE Azaire-Brand-Code 14 string ATTRIBUTE Azaire-Policy-Name 15 string ATTRIBUTE Azaire-Client-Local-IP 16 ipaddr VALUE Azaire-Selection-Mode Subscribed 0 VALUE Azaire-Selection-Mode Sent-By-MS 1 VALUE Azaire-Selection-Mode Chosen-By-SGSN 2 VALUE Azaire-APN-Resolution-Req Not-Required 0 VALUE Azaire-APN-Resolution-Req Required 1 VALUE Azaire-Status Success 0 VALUE Azaire-Status Failure 1 VALUE Azaire-Auth-Type PPP-SIM 1 VALUE Azaire-Auth-Type Dummy-IMSI 2 VALUE Azaire-Auth-Type Soft-SIM 3 VALUE Azaire-Auth-Type Radius-SIM 4 VALUE Azaire-Auth-Type Post-paid 5 VALUE Azaire-Auth-Type Pre-paid 6 VALUE Azaire-Auth-Type Local-Radius 7 VALUE Azaire-Auth-Type Proxy-Radius 8 END-VENDOR Azaire freeradius-server/share/dictionary.bay000066400000000000000000000272031257552170400204730ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2011 The FreeRADIUS Server project and contributors # # Bay Networks # http://www.baynetworks.com/ # # From MegaZone , as posted to the bay-isp list. # Modified for libradius by Alan DeKok # # Bay Networks was acquired by Nortel in 1998. Some Avaya products continue # to use attributes from this dictionary as result of the Nortel acquisitions. # VENDOR Bay-Networks 1584 BEGIN-VENDOR Bay-Networks # Bay Networks Extensions ATTRIBUTE Annex-Filter 28 string ATTRIBUTE Annex-CLI-Command 29 string ATTRIBUTE Annex-CLI-Filter 30 string ATTRIBUTE Annex-Host-Restrict 31 string ATTRIBUTE Annex-Host-Allow 32 string ATTRIBUTE Annex-Product-Name 33 string ATTRIBUTE Annex-SW-Version 34 string ATTRIBUTE Annex-Local-IP-Address 35 ipaddr ATTRIBUTE Annex-Callback-Portlist 36 integer ATTRIBUTE Annex-Sec-Profile-Index 37 integer ATTRIBUTE Annex-Tunnel-Authen-Type 38 integer ATTRIBUTE Annex-Tunnel-Authen-Mode 39 integer ATTRIBUTE Annex-Authen-Servers 40 string ATTRIBUTE Annex-Acct-Servers 41 string ATTRIBUTE Annex-User-Server-Location 42 integer ATTRIBUTE Annex-Local-Username 43 string ATTRIBUTE Annex-System-Disc-Reason 44 integer ATTRIBUTE Annex-Modem-Disc-Reason 45 integer ATTRIBUTE Annex-Disconnect-Reason 46 integer ATTRIBUTE Annex-Addr-Resolution-Protocol 47 integer ATTRIBUTE Annex-Addr-Resolution-Servers 48 string ATTRIBUTE Annex-Domain-Name 49 string ATTRIBUTE Annex-Transmit-Speed 50 integer ATTRIBUTE Annex-Receive-Speed 51 integer ATTRIBUTE Annex-Input-Filter 52 string ATTRIBUTE Annex-Output-Filter 53 string ATTRIBUTE Annex-Primary-DNS-Server 54 ipaddr ATTRIBUTE Annex-Secondary-DNS-Server 55 ipaddr ATTRIBUTE Annex-Primary-NBNS-Server 56 ipaddr ATTRIBUTE Annex-Secondary-NBNS-Server 57 ipaddr ATTRIBUTE Annex-Syslog-Tap 58 integer ATTRIBUTE Annex-Keypress-Timeout 59 integer ATTRIBUTE Annex-Unauthenticated-Time 60 integer ATTRIBUTE Annex-Re-CHAP-Timeout 61 integer ATTRIBUTE Annex-MRRU 62 integer ATTRIBUTE Annex-EDO 63 string # Annex R18.0 software ATTRIBUTE Annex-PPP-Trace-Level 64 integer ATTRIBUTE Annex-Pre-Input-Octets 65 integer ATTRIBUTE Annex-Pre-Output-Octets 66 integer ATTRIBUTE Annex-Pre-Input-Packets 67 integer ATTRIBUTE Annex-Pre-Output-Packets 68 integer ATTRIBUTE Annex-Connect-Progress 69 integer ATTRIBUTE Annex-Multicast-Rate-Limit 73 integer ATTRIBUTE Annex-Maximum-Call-Duration 74 integer ATTRIBUTE Annex-Multilink-Id 75 integer ATTRIBUTE Annex-Num-In-Multilink 76 integer ATTRIBUTE Annex-Secondary-Srv-Endpoint 79 string ATTRIBUTE Annex-Gwy-Selection-Mode 80 integer ATTRIBUTE Annex-Logical-Channel-Number 81 integer ATTRIBUTE Annex-Wan-Number 82 integer ATTRIBUTE Annex-Port 83 integer ATTRIBUTE Annex-Pool-Id 85 integer ATTRIBUTE Annex-Compression-Protocol 86 string ATTRIBUTE Annex-Transmitted-Packets 87 integer ATTRIBUTE Annex-Retransmitted-Packets 88 integer ATTRIBUTE Annex-Signal-to-Noise-Ratio 89 integer ATTRIBUTE Annex-Retrain-Requests-Sent 90 integer ATTRIBUTE Annex-Retrain-Requests-Rcvd 91 integer ATTRIBUTE Annex-Rate-Reneg-Req-Sent 92 integer ATTRIBUTE Annex-Rate-Reneg-Req-Rcvd 93 integer ATTRIBUTE Annex-Begin-Receive-Line-Level 94 integer ATTRIBUTE Annex-End-Receive-Line-Level 95 integer ATTRIBUTE Annex-Begin-Modulation 96 string ATTRIBUTE Annex-Error-Correction-Prot 97 string ATTRIBUTE Annex-End-Modulation 98 string # Bay Router Specific Attributes # ATTRIBUTE Annex-User-Level 100 integer ATTRIBUTE Annex-Audit-Level 101 integer # Contivity ATTRIBUTE CES-Group 102 string # Passport 8000 Series Specific Attributes # ATTRIBUTE Passport-Access-Priority 192 integer VALUE Passport-Access-Priority None-Access 0 VALUE Passport-Access-Priority Read-Only-Access 1 VALUE Passport-Access-Priority L1-Read-Write-Access 2 VALUE Passport-Access-Priority L2-Read-Write-Access 3 VALUE Passport-Access-Priority L3-Read-Write-Access 4 VALUE Passport-Access-Priority Read-Write-Access 5 VALUE Passport-Access-Priority Read-Write-All-Access 6 ATTRIBUTE Annex-Cli-Commands 193 string ATTRIBUTE Annex-Command-Access 194 integer VALUE Annex-Command-Access False 0 VALUE Annex-Command-Access True 1 ATTRIBUTE Commands 195 string # Annex Tunnel Authen Type Values VALUE Annex-Tunnel-Authen-Type none 0 VALUE Annex-Tunnel-Authen-Type kmd5-128 1 # Annex Tunnel Authen Mode Values VALUE Annex-Tunnel-Authen-Mode none 0 VALUE Annex-Tunnel-Authen-Mode prefix-suffix 1 # Annex User Server Location Values VALUE Annex-User-Server-Location local 1 VALUE Annex-User-Server-Location remote 2 # Annex Addr Resolution Protocol Values VALUE Annex-Addr-Resolution-Protocol none 0 VALUE Annex-Addr-Resolution-Protocol DHCP 1 # Annex System Disconnect Reason Values VALUE Annex-System-Disc-Reason Unknown 0 VALUE Annex-System-Disc-Reason Line-disconnected 1 VALUE Annex-System-Disc-Reason Dial-failed 2 VALUE Annex-System-Disc-Reason WAN-manager-error 3 VALUE Annex-System-Disc-Reason Disconnect-reset 4 VALUE Annex-System-Disc-Reason Error-from-adm_notify 5 VALUE Annex-System-Disc-Reason Modem-down-adm_notify 6 VALUE Annex-System-Disc-Reason PPP-protocol-disconnect 7 VALUE Annex-System-Disc-Reason Inactivity-timer 8 VALUE Annex-System-Disc-Reason CLI-Hangup-command 9 VALUE Annex-System-Disc-Reason CLI-last-job 10 VALUE Annex-System-Disc-Reason Session-timeout 11 VALUE Annex-System-Disc-Reason Slave-termination 12 VALUE Annex-System-Disc-Reason Abnormal-termination 13 VALUE Annex-System-Disc-Reason DCD-wait-failed 14 VALUE Annex-System-Disc-Reason CLI-inactivity 15 VALUE Annex-System-Disc-Reason Admin-port-reset 16 VALUE Annex-System-Disc-Reason CLI-auth-failed 17 VALUE Annex-System-Disc-Reason Slave-auth-failed 18 VALUE Annex-System-Disc-Reason PAP-auth-failed 19 VALUE Annex-System-Disc-Reason CHAP-auth-failed 20 VALUE Annex-System-Disc-Reason Local-modem-reset 21 VALUE Annex-System-Disc-Reason Modem-dead 22 VALUE Annex-System-Disc-Reason PPP-LCP-failure 23 VALUE Annex-System-Disc-Reason PPP-IPCP-failure 24 VALUE Annex-System-Disc-Reason PPP-IPXCP-failure 25 VALUE Annex-System-Disc-Reason PPP-ATCP-failure 26 VALUE Annex-System-Disc-Reason PPP-CCP-failure 27 VALUE Annex-System-Disc-Reason PPP-MP-failure 28 VALUE Annex-System-Disc-Reason PPP-IPCP-timeout 29 VALUE Annex-System-Disc-Reason PPP-IPXCP-timeout 30 VALUE Annex-System-Disc-Reason PPP-ATCP-timeout 31 VALUE Annex-System-Disc-Reason PPP-CCP-timeout 32 VALUE Annex-System-Disc-Reason PPP-MP-timeout 33 VALUE Annex-System-Disc-Reason PPP-init-failure 34 VALUE Annex-System-Disc-Reason PPP-Unknown 35 VALUE Annex-System-Disc-Reason PPP-Dialback-failed 36 VALUE Annex-System-Disc-Reason PPP-Address-In-Use 37 VALUE Annex-System-Disc-Reason PPP-No-device 38 VALUE Annex-System-Disc-Reason PPP-Modem-hangup-rcvd 39 VALUE Annex-System-Disc-Reason PPP-Hangup-rcvd 40 VALUE Annex-System-Disc-Reason PPP-Termination-rcvd 41 VALUE Annex-System-Disc-Reason PPP-Kill-rcvd 42 VALUE Annex-System-Disc-Reason PPP-Time-rcvd 43 VALUE Annex-System-Disc-Reason PPP-No-memory 44 VALUE Annex-System-Disc-Reason PPP-Connection-Abort 45 VALUE Annex-System-Disc-Reason PPP-VPN-LCP-failure 46 VALUE Annex-System-Disc-Reason PPP-VPN-Auth-failure 47 VALUE Annex-System-Disc-Reason PPP-MP-invalid-port 48 VALUE Annex-System-Disc-Reason PPP-Invalid-device 49 VALUE Annex-System-Disc-Reason PPP-MMP-bundle-failure 50 VALUE Annex-System-Disc-Reason DVS-Registration-failure 51 VALUE Annex-System-Disc-Reason DVS-Home-agent-dereg 52 VALUE Annex-System-Disc-Reason DVS-Tunnel-no-renew 53 VALUE Annex-System-Disc-Reason DVS-Tunnel-expired 54 # Annex Modem Disconnect Reason Values VALUE Annex-Modem-Disc-Reason Unknown 0 VALUE Annex-Modem-Disc-Reason Local-disconnect 1 VALUE Annex-Modem-Disc-Reason CD-Timer-Expired 2 VALUE Annex-Modem-Disc-Reason Remote-protocol-disc 4 VALUE Annex-Modem-Disc-Reason Clear-down 5 VALUE Annex-Modem-Disc-Reason Long-Space-disconnect 6 VALUE Annex-Modem-Disc-Reason Carrier-Lost 7 VALUE Annex-Modem-Disc-Reason Modem-Retrain-Timeout 8 # Annex Connection Progress Values #VALUE Annex-Connect-Progress Progress-Unknown 2 #VALUE Annex-Connect-Progress Call-Is-Up 10 #VALUE Annex-Connect-Progress CLI-Started 40 #VALUE Annex-Connect-Progress LAN-Session-Is-Up 60 #VALUE Annex-Connect-Progress LCP-Negotiations-Allowed 61 #VALUE Annex-Connect-Progress CCP-Negotiations-Allowed 62 #VALUE Annex-Connect-Progress IPCP-Negotiations-Allowed 63 #VALUE Annex-Connect-Progress LCP-Is-In-Open-State 65 #VALUE Annex-Connect-Progress CCP-Is-In-Open-State 66 #VALUE Annex-Connect-Progress IPCP-Is-In-Open-State 67 #VALUE Annex-Connect-Progress LCP-Is-In-Closed-State 71 #VALUE Annex-Connect-Progress LCP-Is-In-Stopped-State 72 #VALUE Annex-Connect-Progress LCP-Is-In-Closing-State 73 #VALUE Annex-Connect-Progress LCP-Is-In-Request-Sent-State 75 #VALUE Annex-Connect-Progress LCP-Is-In-Ack-Recvd-State 76 #VALUE Annex-Connect-Progress LCP-Is-In-Ack-Sent-State 77 #VALUE Annex-Connect-Progress IPXCP-Is-In-Open-State 80 #VALUE Annex-Multicast-Client Multicast-No 0 #VALUE Annex-Multicast-Client Multicast-Yes 1 #VALUE Annex-Inbound-Precedence Routine 0 #VALUE Annex-Inbound-Precedence Priority 1 #VALUE Annex-Inbound-Precedence Immediate 2 #VALUE Annex-Inbound-Precedence Flash 3 #VALUE Annex-Inbound-Precedence Flash-Override 4 #VALUE Annex-Inbound-Precedence CRITIC/ECP 5 #VALUE Annex-Inbound-Precedence Internetwork-Control 6 #VALUE Annex-Inbound-Precedence Network-Control 7 #VALUE Annex-Outbound-Precedence Routine 0 #VALUE Annex-Outbound-Precedence Priority 1 #VALUE Annex-Outbound-Precedence Immediate 2 #VALUE Annex-Outbound-Precedence Flash 3 #VALUE Annex-Outbound-Precedence Flash-Override 4 #VALUE Annex-Outbound-Precedence CRITIC/ECP 5 #VALUE Annex-Outbound-Precedence Internetwork-Control 6 #VALUE Annex-Outbound-Precedence Network-Control 7 #VALUE Annex-Gwy-Selection-Mode Normal 0 #VALUE Annex-Gwy-Selection-Mode Backup 1 #VALUE Annex-Gwy-Selection-Mode Distribution 2 #VALUE Annex-Pool-Id Pool-One 1 #VALUE Annex-Pool-Id Pool-Two 2 #VALUE Annex-Pool-Id Pool-Three 3 #VALUE Annex-Pool-Id Pool-Four 4 #VALUE Annex-Pool-Id Pool-Five 5 #VALUE Annex-Pool-Id Pool-Six 6 VALUE Annex-User-Level Manager 2 VALUE Annex-User-Level User 4 VALUE Annex-User-Level Operator 8 VALUE Annex-Audit-Level Manager 2 VALUE Annex-Audit-Level User 4 VALUE Annex-Audit-Level Operator 8 END-VENDOR Bay-Networks # # Define additional Bay Networks specific values for the main # RADIUS dictionary # # Note that '0x0630' == 1584, which is the Vendor-ID for Bay Networks. # Nice design, and probably the best way of adding vendor-specific # VALUE extensions to the standard RADIUS attributes. # VALUE Service-Type Annex-Authorize-Only 0x06300001 VALUE Service-Type Annex-Framed-Tunnel 0x06300002 VALUE Acct-Status-Type Annex-User-Reject 0x06300001 VALUE Acct-Status-Type Annex-Call-Reject 0x06300002 VALUE Acct-Status-Type Annex-IPCP-Start 0x06300003 VALUE Acct-Status-Type Annex-IPXCP-Start 0x06300004 VALUE Acct-Status-Type Annex-ATCP-Start 0x06300005 VALUE Acct-Status-Type Annex-Accounting-Restart 0x06300006 VALUE Acct-Status-Type Annex-Accounting-Shutoff 0x06300007 VALUE Acct-Status-Type Annex-Tunnel-Start 0x06300008 VALUE Acct-Status-Type Annex-Tunnel-Stop 0x06300009 VALUE Acct-Status-Type Annex-Tunnel-Reject 0x0630000a VALUE Acct-Status-Type Annex-Tunnel-Link-Start 0x0630000b VALUE Acct-Status-Type Annex-Tunnel-Link-Stop 0x0630000c VALUE Acct-Status-Type Annex-MP-Start 0x0630000d VALUE Acct-Status-Type Annex-MP-Stop 0x0630000e VALUE Acct-Status-Type Annex-Line-Seizure 0x0630000f VALUE Acct-Status-Type Annex-Rlogin-Start 0x06300010 VALUE Acct-Status-Type Annex-Rlogin-Stop 0x06300011 freeradius-server/share/dictionary.bintec000066400000000000000000000030521257552170400211600ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2011 The FreeRADIUS Server project and contributors # # Bintec dictionary # $Id$ # # # VENDOR BinTec 272 # (272 << 16) | N # VALUE Framed-Protocol Bintec-X25 0x01100002 VALUE Framed-Protocol Bintec-X25-PPP 0x01100003 VALUE Framed-Protocol Bintec-IP-LAPB 0x01100004 VALUE Framed-Protocol Bintec-IP-HDLC 0x01100006 VALUE Framed-Protocol Bintec-MPR-LAPB 0x01100007 VALUE Framed-Protocol Bintec-MPR-HDLC 0x01100008 VALUE Framed-Protocol Bintec-FRAME-RELAY 0x01100009 VALUE Framed-Protocol Bintec-X31-BCHAN 0x0110000a VALUE Framed-Protocol Bintec-X75-PPP 0x0110000b VALUE Framed-Protocol Bintec-X75BTX-PPP 0x0110000c VALUE Framed-Protocol Bintec-X25-NOSIG 0x0110000d VALUE Framed-Protocol Bintec-X25-PPP-OPT 0x0110000e # # BEGIN-VENDOR BinTec ATTRIBUTE BinTec-biboPPPTable 224 string ATTRIBUTE BinTec-biboDialTable 225 string ATTRIBUTE BinTec-ipExtIfTable 226 string ATTRIBUTE BinTec-ipRouteTable 227 string ATTRIBUTE BinTec-ipExtRtTable 228 string ATTRIBUTE BinTec-ipNatPresetTable 229 string ATTRIBUTE BinTec-ipxCircTable 230 string ATTRIBUTE BinTec-ripCircTable 231 string ATTRIBUTE BinTec-sapCircTable 232 string ATTRIBUTE BinTec-ipxStaticRouteTable 233 string ATTRIBUTE BinTec-ipxStaticServTable 234 string ATTRIBUTE BinTec-ospfIfTable 235 string ATTRIBUTE BinTec-pppExtIfTable 236 string ATTRIBUTE BinTec-ipFilterTable 237 string ATTRIBUTE BinTec-ipQoSTable 238 string ATTRIBUTE BinTec-qosIfTable 239 string ATTRIBUTE BinTec-qosPolicyTable 240 string END-VENDOR BinTec freeradius-server/share/dictionary.bluecoat000066400000000000000000000012641257552170400215150ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2014 The FreeRADIUS Server project and contributors ############################################################################## # # BlueCoat VSAs # # See also dictionary.packeteer for former Packeteer products. # # $Id$ # ############################################################################## VENDOR BlueCoat 14501 BEGIN-VENDOR BlueCoat # Accepts multiple groups as comma-separated list. ATTRIBUTE Blue-Coat-Group 1 string ATTRIBUTE Blue-Coat-Authorization 2 integer VALUE Blue-Coat-Authorization No-Access 0 VALUE Blue-Coat-Authorization Read-Only-Access 1 VALUE Blue-Coat-Authorization Read-Write-Access 2 END-VENDOR BlueCoat freeradius-server/share/dictionary.bristol000066400000000000000000000006711257552170400213760ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2011 The FreeRADIUS Server project and contributors # # dictionary.bristol # # RoamNode VSA's # # Version: $Id$ # VENDOR Bristol 4363 # # Standard attribute # BEGIN-VENDOR Bristol ATTRIBUTE NN-Data-Rate 1 integer ATTRIBUTE NN-Data-Rate-Ceiling 2 integer ATTRIBUTE NN-Homenode 3 ipaddr ATTRIBUTE NN-Homeservice 4 ipaddr ATTRIBUTE NN-Homeservice-Name 5 string END-VENDOR Bristol freeradius-server/share/dictionary.broadsoft000066400000000000000000000423621257552170400217060ustar00rootroot00000000000000# # dictionary.broadsoft # # # VENDOR BroadSoft 6431 # BEGIN-VENDOR BroadSoft ATTRIBUTE BWAS-Call-Detail-Record-Version 0 string ATTRIBUTE BWAS-Record-id 1 string ATTRIBUTE BWAS-Service-provider 2 string ATTRIBUTE BWAS-Type 3 string ATTRIBUTE BWAS-User-Number 4 string ATTRIBUTE BWAS-Group-Number 5 string ATTRIBUTE BWAS-Direction 6 string ATTRIBUTE BWAS-Calling-Number 7 string ATTRIBUTE BWAS-Calling-Presentation-Indic 8 string ATTRIBUTE BWAS-Called-Number 9 string ATTRIBUTE BWAS-Start-Time 10 string ATTRIBUTE BWAS-User-Timezone 11 string ATTRIBUTE BWAS-Answer-Indic 12 string ATTRIBUTE BWAS-Answer-Time 13 string ATTRIBUTE BWAS-Release-Time 14 string ATTRIBUTE BWAS-Termination-Cause 15 string ATTRIBUTE BWAS-Network-Type 16 string ATTRIBUTE BWAS-Carrier-Identification-Code 17 string ATTRIBUTE BWAS-Dialed-Digits 18 string ATTRIBUTE BWAS-Call-Category 19 string ATTRIBUTE BWAS-Network-Call-Type 20 string ATTRIBUTE BWAS-Network-Translated-Number 21 string ATTRIBUTE BWAS-Network-Translated-Group 22 string ATTRIBUTE BWAS-Releasing-Party 23 string ATTRIBUTE BWAS-Route 24 string ATTRIBUTE BWAS-Network-Callid 25 string ATTRIBUTE BWAS-Codec 26 string ATTRIBUTE BWAS-Access-Device-Address 27 string ATTRIBUTE BWAS-Access-Callid 28 string ATTRIBUTE BWAS-Spare-29 29 string ATTRIBUTE BWAS-Failover-Correlation-Id 30 string ATTRIBUTE BWAS-Spare-31 31 string ATTRIBUTE BWAS-Group 32 string ATTRIBUTE BWAS-Department 33 string ATTRIBUTE BWAS-Account-Code 34 string ATTRIBUTE BWAS-Authorization-Code 35 string ATTRIBUTE BWAS-Original-Called-Number 36 string ATTRIBUTE BWAS-Original-Called-Presentation-Indic 37 string ATTRIBUTE BWAS-Original-Called-Reason 38 string ATTRIBUTE BWAS-Redirecting-Number 39 string ATTRIBUTE BWAS-Redirecting-Presentation-Indic 40 string ATTRIBUTE BWAS-Redirecting-Reason 41 string ATTRIBUTE BWAS-Charge-Indic 42 string ATTRIBUTE BWAS-Type-Of-Network 43 string ATTRIBUTE BWAS-VP-Calling-Invoke-Time 44 string ATTRIBUTE BWAS-Local-Callid 45 string ATTRIBUTE BWAS-Remote-Callid 46 string ATTRIBUTE BWAS-Calling-Party-Category 47 string ATTRIBUTE BWAS-Conference-Invoke-Time 48 string ATTRIBUTE BWAS-Conference-Callid 49 string ATTRIBUTE BWAS-Conference-To 50 string ATTRIBUTE BWAS-Conference-From 51 string ATTRIBUTE BWAS-Conference-Id 52 string ATTRIBUTE BWAS-Conference-Role 53 string ATTRIBUTE BWAS-Conference-Bridge 54 string ATTRIBUTE BWAS-Conference-Owner 55 string ATTRIBUTE BWAS-Conference-Owner-Dn 56 string ATTRIBUTE BWAS-Conference-Title 57 string ATTRIBUTE BWAS-Conference-Project-Code 58 string ATTRIBUTE BWAS-Charging-Vector-Key 59 string ATTRIBUTE BWAS-Charging-Vection-Creator 60 string ATTRIBUTE BWAS-Charging-Vection-Orig 61 string ATTRIBUTE BWAS-Charging-Vection-Term 62 string ATTRIBUTE BWAS-Acc-Per-Call-Invoke-Time 63 string ATTRIBUTE BWAS-Acc-Per-Call-Fac-Result 64 string ATTRIBUTE BWAS-Acb-Act-Invoke-Time 65 string ATTRIBUTE BWAS-Acb-Act-Fac-Result 66 string ATTRIBUTE BWAS-Acb-Deact-Invoke-Time 67 string ATTRIBUTE BWAS-Acb-Deact-Fac-Result 68 string ATTRIBUTE BWAS-Call-Park-Invoke-Time 69 string ATTRIBUTE BWAS-Call-Park-Fac-Result 70 string ATTRIBUTE BWAS-Call-Park-Retr-Invoke-Time 71 string ATTRIBUTE BWAS-Call-Park-Retr-Fac-Result 72 string ATTRIBUTE BWAS-Call-Pickup-Invoke-Time 73 string ATTRIBUTE BWAS-Call-Pickup-Fac-Result 74 string ATTRIBUTE BWAS-Directed-Call-Pickup-Invoke-Time 75 string ATTRIBUTE BWAS-Directed-Call-Pickup-Fac-Result 76 string ATTRIBUTE BWAS-Dpubi-Invoke-Time 77 string ATTRIBUTE BWAS-Dpubi-Fac-Result 78 string ATTRIBUTE BWAS-Cancel-Cwt-Per-Call-Invoke-Time 79 string ATTRIBUTE BWAS-Cancel-Cwt-Per-Call-Fac-Result 80 string ATTRIBUTE BWAS-Cfa-Act-Invoke-Time 81 string ATTRIBUTE BWAS-Cfa-Act-Fac-Result 82 string ATTRIBUTE BWAS-Cfa-Deact-Invoke-Time 83 string ATTRIBUTE BWAS-Cfa-Deact-Fac-Result 84 string ATTRIBUTE BWAS-Cfb-Act-Invoke-Time 85 string ATTRIBUTE BWAS-Cfb-Act-Fac-Result 86 string ATTRIBUTE BWAS-Cfb-Deact-Invoke-Time 87 string ATTRIBUTE BWAS-Cfb-Deact-Fac-Result 88 string ATTRIBUTE BWAS-Cfna-Act-Invoke-Time 89 string ATTRIBUTE BWAS-Cfna-Act-Fac-Result 90 string ATTRIBUTE BWAS-Cfna-Deact-Invoke-Time 91 string ATTRIBUTE BWAS-Cfna-Deact-Fac-Result 92 string ATTRIBUTE BWAS-Clid-Delivery-Per-Call-Invoke-Time 93 string ATTRIBUTE BWAS-Clid-Delivery-Per-Call-Fac-Result 94 string ATTRIBUTE BWAS-Clid-Blocking-Per-Call-Invoke-Time 95 string ATTRIBUTE BWAS-Clid-Blocking-Per-Call-Fac-Result 96 string ATTRIBUTE BWAS-Cot-Invoke-Time 97 string ATTRIBUTE BWAS-Cot-Fac-Result 98 string ATTRIBUTE BWAS-Direct-Vm-Xfer-Invoke-Time 99 string ATTRIBUTE BWAS-Direct-Vm-Xfer-Fac-Result 100 string ATTRIBUTE BWAS-Dnd-Act-Invoke-Time 101 string ATTRIBUTE BWAS-Dnd-Act-Fac-Result 102 string ATTRIBUTE BWAS-Dnd-Deact-Invoke-Time 103 string ATTRIBUTE BWAS-Dnd-Deact-Fac-Result 104 string ATTRIBUTE BWAS-Sac-Lock-Invoke-Time 105 string ATTRIBUTE BWAS-Sac-Lock-Fac-Result 106 string ATTRIBUTE BWAS-Sac-Unlock-Invoke-Time 107 string ATTRIBUTE BWAS-Sac-Unlock-Fac-Result 108 string ATTRIBUTE BWAS-Flash-Call-Hold-Invoke-Time 109 string ATTRIBUTE BWAS-Flash-Call-Hold-Fac-Result 110 string ATTRIBUTE BWAS-Last-Number-Redial-Invoke-Time 111 string ATTRIBUTE BWAS-Last-Number-Redial-Fac-Result 112 string ATTRIBUTE BWAS-Return-Call-Invoke-Time 113 string ATTRIBUTE BWAS-Return-Call-Fac-Result 114 string ATTRIBUTE BWAS-Sd100-Programming-Invoke-Time 115 string ATTRIBUTE BWAS-Sd100-Programming-Fac-Result 116 string ATTRIBUTE BWAS-Sd8-Programming-Invoke-Time 117 string ATTRIBUTE BWAS-Sd8-Programming-Fac-Result 118 string ATTRIBUTE BWAS-Clear-Mwi-Invoke-Time 119 string ATTRIBUTE BWAS-Clear-Mwi-Fac-Result 120 string ATTRIBUTE BWAS-UserId 121 string ATTRIBUTE BWAS-Other-Party-Name 122 string ATTRIBUTE BWAS-Other-Party-Name-Pres-Indic 123 string ATTRIBUTE BWAS-Moh-Deact-Fac-Result 125 string ATTRIBUTE BWAS-Push-to-Talk-Invoke-Time 126 string ATTRIBUTE BWAS-Push-to-Talk-Fac-Result 127 string ATTRIBUTE BWAS-Hoteling-Invoke-Time 128 string ATTRIBUTE BWAS-Hoteling-Group 129 string ATTRIBUTE BWAS-Hoteling-UserId 130 string ATTRIBUTE BWAS-Hoteling-User-Number 131 string ATTRIBUTE BWAS-Hoteling-Group-Number 132 string ATTRIBUTE BWAS-Diversion-Inhibitor-Invoke-time 133 string ATTRIBUTE BWAS-Diversion-Inhibitor-Fac-Result 134 string ATTRIBUTE BWAS-Trunk-Group-Name 135 string ATTRIBUTE BWAS-Spare-136 136 string ATTRIBUTE BWAS-InstantGroupCall-Invoke-Time 137 string ATTRIBUTE BWAS-InstantGroupCall-PushToTalk 138 string ATTRIBUTE BWAS-InstantGroupCall-Related-Callid 139 string ATTRIBUTE BWAS-CustomRingback-Invoke-Time 140 string ATTRIBUTE BWAS-CLID-Permitted 141 string ATTRIBUTE BWAS-AHR-Invoke-Time 142 string ATTRIBUTE BWAS-AHR-Action 143 string ATTRIBUTE BWAS-Access-Network-Info 144 string ATTRIBUTE BWAS-Charging-Function-Addresses 145 string ATTRIBUTE BWAS-Charge-Number 146 string ATTRIBUTE BWAS-Related-CallId 147 string ATTRIBUTE BWAS-Related-CallId-Reason 148 string ATTRIBUTE BWAS-Transfer-Invoke-Time 149 string ATTRIBUTE BWAS-Transfer-Result 150 string ATTRIBUTE BWAS-Transfer-Related-CallId 151 string ATTRIBUTE BWAS-Transfer-Type 152 string ATTRIBUTE BWAS-Conf-Start-Time 153 string ATTRIBUTE BWAS-Conf-Stop-Time 154 string ATTRIBUTE BWAS-Conf-Id 155 string ATTRIBUTE BWAS-Conf-Type 156 string ATTRIBUTE BWAS-Codec-Usage 157 string ATTRIBUTE BWAS-Vmb-Act-Invoke-Time 158 string ATTRIBUTE BWAS-Vmb-Act-Fac-Result 159 string ATTRIBUTE BWAS-Vmb-Deact-Invoke-Time 160 string ATTRIBUTE BWAS-Vmb-Deact-Fac-Result 161 string ATTRIBUTE BWAS-Vmna-Act-Invoke-Time 162 string ATTRIBUTE BWAS-Vmna-Act-Fac-Result 163 string ATTRIBUTE BWAS-Vmna-Deact-Invoke-Time 164 string ATTRIBUTE BWAS-Vmna-Deact-Fac-Result 165 string ATTRIBUTE BWAS-Vma-Act-Invoke-Time 166 string ATTRIBUTE BWAS-Vma-Act-Fac-Result 167 string ATTRIBUTE BWAS-Vma-Deact-Invoke-Time 168 string ATTRIBUTE BWAS-Vma-Deact-Fac-Result 169 string ATTRIBUTE BWAS-No-Answer-Set-Invoke-Time 170 string ATTRIBUTE BWAS-No-Answer-Set-Fac-Result 171 string ATTRIBUTE BWAS-Clid-Blocking-Act-Invoke-Time 172 string ATTRIBUTE BWAS-Clid-Blocking-Act-Fac-Result 173 string ATTRIBUTE BWAS-Clid-Blocking-Deact-Invoke-Time 174 string ATTRIBUTE BWAS-Clid-Blocking-Deact-Fac-Result 175 string ATTRIBUTE BWAS-Call-Waiting-Act-Invoke-Time 176 string ATTRIBUTE BWAS-Call-Waiting-Act-Fac-Result 177 string ATTRIBUTE BWAS-Call-Waiting-Deact-Invoke-Time 178 string ATTRIBUTE BWAS-Call-Waiting-Deact-Fac-Result 179 string ATTRIBUTE BWAS-Fax-Messaging 180 string ATTRIBUTE BWAS-TSD-Digits 181 string ATTRIBUTE BWAS-Trunk-Group-Info 182 string ATTRIBUTE BWAS-Recall-Type 183 string ATTRIBUTE BWAS-Cfnrc-Act-Invoke-Time 184 string ATTRIBUTE BWAS-Cfnrc-Act-Fac-Result 185 string ATTRIBUTE BWAS-Cfnrc-Deact-Invoke-Time 186 string ATTRIBUTE BWAS-Cfnrc-Deact-Fac-Result 187 string ATTRIBUTE BWAS-Q850-Cause 188 string ATTRIBUTE BWAS-Dialed-Digits-Context 189 string ATTRIBUTE BWAS-Called-Number-Context 190 string ATTRIBUTE BWAS-Network-Translated-Number-Context 191 string ATTRIBUTE BWAS-Calling-Number-Context 192 string ATTRIBUTE BWAS-Original-Called-Number-Context 193 string ATTRIBUTE BWAS-Redirecting-Number-Context 194 string ATTRIBUTE BWAS-Location-Control-Act-Result 195 string ATTRIBUTE BWAS-Location-Control-Deact-Result 196 string ATTRIBUTE BWAS-Call-Retrieve-Result 197 string ATTRIBUTE BWAS-Routing-Number 198 string ATTRIBUTE BWAS-Origination-Method 199 string ATTRIBUTE BWAS-Call-Parked-Invoke-Time 200 string ATTRIBUTE BWAS-BA-Related-Call-Id 201 string ATTRIBUTE BWAS-Acr-Act-Invoke-Time 202 string ATTRIBUTE BWAS-Acr-Act-Fac-Result 203 string ATTRIBUTE BWAS-Acr-Deact-Invoke-Time 204 string ATTRIBUTE BWAS-Acr-Deact-Fac-Result 205 string ATTRIBUTE BWAS-Outside-Access-Code 206 string ATTRIBUTE BWAS-Primary-Device-Line-Port 207 string ATTRIBUTE BWAS-Called-Asserted-Identity 208 string ATTRIBUTE BWAS-Called-Asserted-Pres-Indicator 209 string ATTRIBUTE BWAS-SDP 210 string ATTRIBUTE BWAS-Media-Initiator-Flag 211 string ATTRIBUTE BWAS-SDP-Offer-Timestamp 212 string ATTRIBUTE BWAS-SDP-Answer-Timestamp 213 string ATTRIBUTE BWAS-Early-Media-SDP 214 string ATTRIBUTE BWAS-Early-Media-Initiator-Flag 215 string ATTRIBUTE BWAS-Body-Content-Type 216 string ATTRIBUTE BWAS-Body-Content-Length 217 string ATTRIBUTE BWAS-Body-Content-Disposition 218 string ATTRIBUTE BWAS-Body-Originator 219 string ATTRIBUTE BWAS-SIP-Error-Code 220 string ATTRIBUTE BWAS-OtherInfoInPCV 221 string ATTRIBUTE BWAS-Received-Calling-Number 222 string ATTRIBUTE BWAS-CustomRingback-Media-Selection 223 string ATTRIBUTE BWAS-AOC-Type 224 string ATTRIBUTE BWAS-AOC-Charge 225 string ATTRIBUTE BWAS-AOC-Currency 226 string ATTRIBUTE BWAS-AOC-Time 227 string ATTRIBUTE BWAS-AOC-Sum 228 string ATTRIBUTE BWAS-AOC-Activation-Time 229 string ATTRIBUTE BWAS-AOC-Result 230 string ATTRIBUTE BWAS-AS-Call-Type 231 string ATTRIBUTE BWAS-Scf-Act-Invoke-Time 232 string ATTRIBUTE BWAS-Scf-Act-Fac-Result 233 string ATTRIBUTE BWAS-Scf-Deact-Invoke-Time 234 string ATTRIBUTE BWAS-Scf-Deact-Fac-Result 235 string ATTRIBUTE BWAS-Cfa-Inter-Invoke-Time 236 string ATTRIBUTE BWAS-Cfa-Inter-Fac-Result 237 string ATTRIBUTE BWAS-Cfna-Inter-Invoke-Time 238 string ATTRIBUTE BWAS-Cfna-Inter-Fac-Result 239 string ATTRIBUTE BWAS-Cfb-Inter-Invoke-Time 240 string ATTRIBUTE BWAS-Cfb-Inter-Fac-Result 241 string ATTRIBUTE BWAS-CBF-Auth-Code 242 string ATTRIBUTE BWAS-Call-Bridge-Result 243 string ATTRIBUTE BWAS-Return-Call-Number-Deletion-Invoke-Time 244 string ATTRIBUTE BWAS-Return-Call-Number-Deletion-Fac-Result 245 string ATTRIBUTE BWAS-Prepaid-Status 246 string ATTRIBUTE BWAS-Configurable-CLID 247 string ATTRIBUTE BWAS-Call-Center-Night-Service-Act-Result 248 string ATTRIBUTE BWAS-Call-Center-Night-Service-Deact-Result 249 string ATTRIBUTE BWAS-Call-Center-Forced-Forwarding-Act-Result 250 string ATTRIBUTE BWAS-Call-Center-Forced-Forwarding-Deact-Result 251 string ATTRIBUTE BWAS-Call-Center-Outgoing-Call-Fac-Result 252 string ATTRIBUTE BWAS-Call-Center-Outgoing-Personal-Call-Fac-Result 253 string ATTRIBUTE BWAS-Call-Center-Outgoing-Phone-Number 254 string ATTRIBUTE BroadSoft-Attr-255 255 string # # These are "special" attributes. They get sent in Broadsoft-Attr-255, # with their number as the leading value. e.g. # # Broadsoft-Attr-255 = "256=12345" # # Which means "BWAS-Intercept-Group-Routing-Number" has value 12345. # # No other vendor does this, for the simple reason that it's # ridiculous. # #ATTRIBUTE BWAS-Intercept-Group-Routing-Number 256 string #ATTRIBUTE BWAS-CB-Activation-Invoke-Time 257 string #ATTRIBUTE BWAS-CB-Activation-Fac-Result 258 string #ATTRIBUTE BWAS-CB-Deactivation-Invoke-Time 259 string #ATTRIBUTE BWAS-CB-Deactivation-Fac-Result 260 string #ATTRIBUTE BWAS-CB-Query-Invoke-Time 261 string #ATTRIBUTE BWAS-CB-Query-Fac-Result 262 string #ATTRIBUTE BWAS-Cfnrc-Inter-Invoke-Time 263 string #ATTRIBUTE BWAS-Cfnrc-Inter-Fac-Result 264 string #ATTRIBUTE BWAS-VMR-Dialing-Invoke-Time 265 string #ATTRIBUTE BWAS-VMR-Dialing-Fac-result 266 string #ATTRIBUTE BWAS-VP-Dialing-Invoke-Time 267 string #ATTRIBUTE BWAS-VP-Dialing-Fac-result 268 string #ATTRIBUTE BWAS-Camel-Loc-Info 269 string #ATTRIBUTE BWAS-Camel-Msc-Address 270 string #ATTRIBUTE BWAS-Camel-CellId-Or-LAI 271 string #ATTRIBUTE BWAS-NAME-Permitted 272 string #ATTRIBUTE BWAS-Call-Center-User-Id 273 string #ATTRIBUTE BWAS-Call-Center-Outgoing-Group-Phone-Number 274 string #ATTRIBUTE BWAS-VON-Type 275 string #ATTRIBUTE BWAS-PreAlertingAnncmtDuration 276 string #ATTRIBUTE BWAS-CC-Disp-Code-Tagging-Invoke-Time 277 string #ATTRIBUTE BWAS-CC-Disp-Code-Tagging-Result 278 string #ATTRIBUTE BWAS-CC-Escalated-Call-Invoke-Time 279 string #ATTRIBUTE BWAS-CC-Escalated-Call-FAC-Result 280 string #ATTRIBUTE BWAS-CC-Monitoring-BI-Invoke-Time 281 string #ATTRIBUTE BWAS-CC-Monitoring-BI-FAC-Result 282 string #ATTRIBUTE BWAS-Mid-Call-Cot-Invoke-Time 283 string #ATTRIBUTE BWAS-Office-Zone 284 string #ATTRIBUTE BWAS-Primary-Zone 285 string #ATTRIBUTE BWAS-Roaming-MSC-Address 286 string #ATTRIBUTE BWAS-CC-Emergency-Call-Invoke-Time 287 string #ATTRIBUTE BWAS-Monitoring-Next-Call-Invoke-Time 288 string #ATTRIBUTE BWAS-Monitoring-Next-Call-FAC-Result 289 string #ATTRIBUTE BWAS-Legacy-Acb-Act-Invoke-Time 290 string #ATTRIBUTE BWAS-Legacy-Acb-Act-Fac-Result 291 string #ATTRIBUTE BWAS-Legacy-Acb-Deact-Invoke-Time 292 string #ATTRIBUTE BWAS-Legacy-Acb-Deact-Fac-Result 293 string #ATTRIBUTE BWAS-Custom-Schema-Version 294 string #ATTRIBUTE BWAS-Group-Paging-Invoke-Time 295 string #ATTRIBUTE BWAS-Group-Paging-Related-CallId 296 string #ATTRIBUTE BWAS-DCLID 297 string #ATTRIBUTE BWAS-MeetMeConferencing-InvokeTime 298 string #ATTRIBUTE BWAS-Call-Me-Now-Type 299 string #ATTRIBUTE BWAS-Call-Me-Now-Transaction-Id 300 string #ATTRIBUTE BWAS-Call-Me-Now-Related-Call-Id 301 string #ATTRIBUTE BWAS-MeetMeConferencing-ConferenceId 302 string #ATTRIBUTE BWAS-MeetMeConferencing-Role 303 string #ATTRIBUTE BWAS-MeetMeConferencing-Bridge 304 string #ATTRIBUTE BWAS-MeetMeConferencing-Owner 305 string #ATTRIBUTE BWAS-MeetMeConferencing-OwnerDn 306 string #ATTRIBUTE BWAS-MeetMeConferencing-Title 307 string #ATTRIBUTE BWAS-MeetMeConferencing-ProjectCode 308 string #ATTRIBUTE BWAS-MeetMeConferencing-RecordDuration 309 string #ATTRIBUTE BWAS-MobilityNumber 310 string #ATTRIBUTE BWAS-MobilityRoutingNumber 311 string #ATTRIBUTE BWAS-Location 312 string #ATTRIBUTE BWAS-Location-Type 313 string #ATTRIBUTE BWAS-Location-Usage 314 string #ATTRIBUTE BWAS-Call-Recording-Invocation-Time 315 string #ATTRIBUTE BWAS-Call-Recording-FAC-Result 316 string #ATTRIBUTE BWAS-Call-Recording-Trigger 317 string #ATTRIBUTE BWAS-Call-Recording-Destination 318 string #ATTRIBUTE BWAS-Call-Recording-Result 319 string #ATTRIBUTE BWAS-Calling-Pres-Number 320 string #ATTRIBUTE BWAS-Calling-Pres-Number-Context 321 string #ATTRIBUTE BWAS-Calling-Asserted-Number 322 string #ATTRIBUTE BWAS-Calling-Asserted-Number-Context 323 string #ATTRIBUTE BWAS-SCC-Invocation-Time 324 string #ATTRIBUTE BWAS-SCC-Call-Id 325 string #ATTRIBUTE BWAS-SCC-Number 326 string #ATTRIBUTE BWAS-Acr-Inter-Invoke-Time 327 string #ATTRIBUTE BWAS-Acr-Inter-Fac-Result 328 string #ATTRIBUTE BWAS-CW-Inter-Invoke-Time 329 string #ATTRIBUTE BWAS-CW-Inter-Fac-Result 330 string #ATTRIBUTE BWAS-Clid-Blocking-Inter-Invoke-Time 331 string #ATTRIBUTE BWAS-Clid-Blocking-Inter-Fac-Result 332 string #ATTRIBUTE BWAS-Colr-Inter-Invoke-Time 333 string #ATTRIBUTE BWAS-Colr-Inter-Fac-Result 334 string #ATTRIBUTE BWAS-Scr-Inter-Invoke-Time 335 string #ATTRIBUTE BWAS-Scr-Inter-Fac-Result 336 string #ATTRIBUTE BWAS-HuntGroupBusy-Activation-Invocation-Time 337 string #ATTRIBUTE BWAS-HuntGroupBusy-Activation-FAC-Result 338 string #ATTRIBUTE BWAS-HuntGroupBusy-Activation-Target-HuntGroupId 339 string #ATTRIBUTE BWAS-HuntGroupBusy-Deactivation-Invocation-Time 340 string #ATTRIBUTE BWAS-HuntGroupBusy-Deactivation-FAC-Result 341 string #ATTRIBUTE BWAS-HuntGroupBusy-Deactivation-Target-HuntGroupId 342 string #ATTRIBUTE BWAS-HuntGroupBusy-Interrogation-Invocation-Time 343 string #ATTRIBUTE BWAS-HuntGroupBusy-Interrogation-FAC-Result 344 string #ATTRIBUTE BWAS-HuntGroupBusy-Interrogation-Target-HuntGroupId 345 string #ATTRIBUTE BWAS-User-Agent 346 string #ATTRIBUTE BWAS-FMFM-Call-Push-Invocation-Time 347 string #ATTRIBUTE BWAS-FMFM-Call-Push-FAC-Result 348 string #ATTRIBUTE BWAS-SCC-Cause 349 string END-VENDOR BroadSoft freeradius-server/share/dictionary.brocade000066400000000000000000000003041257552170400213100ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2013 The FreeRADIUS Server project and contributors # VENDOR Brocade 1588 BEGIN-VENDOR Brocade ATTRIBUTE Brocade-Auth-Role 1 string END-VENDOR Brocade freeradius-server/share/dictionary.bskyb000066400000000000000000000011461257552170400210300ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2012 The FreeRADIUS Server project and contributors ############################################################################## # # British Sky Broadcasting Group plc VSA's # # $Id$ # ############################################################################## VENDOR BSkyB 16924 BEGIN-VENDOR BSkyB ATTRIBUTE Sky-Wifi-AP-ID 1 integer ATTRIBUTE Sky-Wifi-Service-ID 2 integer ATTRIBUTE Sky-Wifi-Filter-Profile 3 string ATTRIBUTE Sky-Wifi-Billing-Class 4 octets ATTRIBUTE Sky-Wifi-Provider-ID 5 integer ATTRIBUTE Sky-Wifi-Credentials 6 string END-VENDOR BSkyB freeradius-server/share/dictionary.bt000066400000000000000000000005511257552170400203220ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2012 The FreeRADIUS Server project and contributors ############################################################################## # # British Telecom VSA's # # $Id$ # ############################################################################## VENDOR BT 594 BEGIN-VENDOR BT ATTRIBUTE SID-Auth 1 string END-VENDOR BT freeradius-server/share/dictionary.cablelabs000066400000000000000000000211101257552170400216170ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2011 The FreeRADIUS Server project and contributors ############################################################################## # # CableLabs # # $Id$ # ############################################################################## VENDOR CableLabs 4491 BEGIN-VENDOR CableLabs ATTRIBUTE CableLabs-Reserved 0 octets ATTRIBUTE CableLabs-Event-Message 1 octets ATTRIBUTE CableLabs-MTA-Endpoint-Name 3 string ATTRIBUTE CableLabs-Calling-Party-Number 4 string ATTRIBUTE CableLabs-Called-Party-Number 5 string ATTRIBUTE CableLabs-Database-ID 6 string ATTRIBUTE CableLabs-Query-Type 7 integer ATTRIBUTE CableLabs-Returned-Number 9 string ATTRIBUTE CableLabs-Call-Termination-Cause 11 octets #ATTRIBUTE CableLabs-Related-Call-Billing-Correlation-ID 13 octets ATTRIBUTE CableLabs-Related-Call-Billing-Crl-ID 13 octets #ATTRIBUTE CableLabs-First-Call-Calling-Party-Number 14 string #ATTRIBUTE CableLabs-Second-Call-Calling-Party-Number 15 string ATTRIBUTE CableLabs-First-Call-Calling-Party-Num 14 string ATTRIBUTE CableLabs-Second-Call-Calling-Party-Num 15 string ATTRIBUTE CableLabs-Charge-Number 16 string ATTRIBUTE CableLabs-Forwarded-Number 17 string ATTRIBUTE CableLabs-Service-Name 18 string ATTRIBUTE CableLabs-Intl-Code 20 string ATTRIBUTE CableLabs-Dial-Around-Code 21 string ATTRIBUTE CableLabs-Location-Routing-Number 22 string ATTRIBUTE CableLabs-Carrier-Identification-Code 23 string ATTRIBUTE CableLabs-Trunk-Group-ID 24 octets ATTRIBUTE CableLabs-Routing-Number 25 string ATTRIBUTE CableLabs-MTA-UDP-Portnum 26 integer ATTRIBUTE CableLabs-Channel-State 29 integer ATTRIBUTE CableLabs-SF-ID 30 integer ATTRIBUTE CableLabs-Error-Description 31 string ATTRIBUTE CableLabs-QoS-Descriptor 32 octets ATTRIBUTE CableLabs-Direction-indicator 37 integer ATTRIBUTE CableLabs-Time-Adjustment 38 octets ATTRIBUTE CableLabs-SDP-Upstream 39 string ATTRIBUTE CableLabs-SDP-Downstream 40 string ATTRIBUTE CableLabs-User-Input 41 string ATTRIBUTE CableLabs-Translation-Input 42 string ATTRIBUTE CableLabs-Redirected-From-Info 43 octets #ATTRIBUTE CableLabs-Electronic-Surveillance-Indication 44 octets ATTRIBUTE CableLabs-Electronic-Surveillance-Ind 44 octets ATTRIBUTE CableLabs-Redirected-From-Party-Number 45 string ATTRIBUTE CableLabs-Redirected-To-Party-Number 46 string #ATTRIBUTE CableLabs-Electronic-Surveillance-DF-Security 47 octets ATTRIBUTE CableLabs-El-Surveillance-DF-Security 47 octets ATTRIBUTE CableLabs-CCC-ID 48 octets ATTRIBUTE CableLabs-Financial-Entity-ID 49 string ATTRIBUTE CableLabs-Flow-Direction 50 integer ATTRIBUTE CableLabs-Signal-Type 51 integer ATTRIBUTE CableLabs-Alerting-Signal 52 integer ATTRIBUTE CableLabs-Subject-Audible-Signal 53 integer ATTRIBUTE CableLabs-Terminal-Display-Info 54 octets ATTRIBUTE CableLabs-Switch-Hook-Flash 55 string ATTRIBUTE CableLabs-Dialed-Digits 56 string ATTRIBUTE CableLabs-Misc-Signaling-Information 57 string ATTRIBUTE CableLabs-AM-Opaque-Data 61 integer ATTRIBUTE CableLabs-Subscriber-ID 62 integer ATTRIBUTE CableLabs-Volume-Usage-Limit 63 integer ATTRIBUTE CableLabs-Gate-Usage-Info 64 integer ATTRIBUTE CableLabs-Element-Requesting-QoS 65 integer ATTRIBUTE CableLabs-QoS-Release-Reason 66 integer ATTRIBUTE CableLabs-Policy-Denied-Reason 67 integer ATTRIBUTE CableLabs-Policy-Deleted-Reason 68 integer ATTRIBUTE CableLabs-Policy-Update-Reason 69 integer ATTRIBUTE CableLabs-Policy-Decision-Status 70 integer ATTRIBUTE CableLabs-Application-Manager-ID 71 integer ATTRIBUTE CableLabs-Time-Usage-Limit 72 integer ATTRIBUTE CableLabs-Gate-Time-Info 73 integer ATTRIBUTE CableLabs-Account-Code 80 string ATTRIBUTE CableLabs-Authorization-Code 81 string VALUE CableLabs-Event-Message Reserved 0 VALUE CableLabs-Event-Message Signaling-Start 1 VALUE CableLabs-Event-Message Signaling-Stop 2 VALUE CableLabs-Event-Message Database-Query 3 VALUE CableLabs-Event-Message Intelligent-Peripheral-Usage-Start 4 VALUE CableLabs-Event-Message Intelligent-Peripheral-Usage-Stop 5 VALUE CableLabs-Event-Message Service-Instance 6 VALUE CableLabs-Event-Message QoS-Reserve 7 VALUE CableLabs-Event-Message QoS-Release 8 VALUE CableLabs-Event-Message Service-Activation 9 VALUE CableLabs-Event-Message Service-Deactivation 10 VALUE CableLabs-Event-Message Media-Report 11 VALUE CableLabs-Event-Message Signal-Instance 12 VALUE CableLabs-Event-Message Interconnect-Signaling-Start 13 VALUE CableLabs-Event-Message Interconnect-Signaling-Stop 14 VALUE CableLabs-Event-Message Call-Answer 15 VALUE CableLabs-Event-Message Call-Disconnect 16 VALUE CableLabs-Event-Message Time-Change 17 VALUE CableLabs-Event-Message QoS-Commit 19 VALUE CableLabs-Event-Message Media-Alive 20 VALUE CableLabs-Event-Message Policy-Request 31 VALUE CableLabs-Event-Message Policy-Delete 32 VALUE CableLabs-Event-Message Policy-Update 33 VALUE CableLabs-Query-Type Reserved 0 VALUE CableLabs-Query-Type Toll-Free-Number-Looukp 1 VALUE CableLabs-Query-Type LNP-Number-Lookup 2 VALUE CableLabs-Query-Type Calling-Name-Delivery-Lookup 3 VALUE CableLabs-Channel-State Reserved 0 VALUE CableLabs-Channel-State Open 1 VALUE CableLabs-Channel-State Change 2 VALUE CableLabs-Channel-State Close 3 VALUE CableLabs-Direction-indicator Undefined 0 VALUE CableLabs-Direction-indicator Originating 1 VALUE CableLabs-Direction-indicator Terminating 2 VALUE CableLabs-Flow-Direction Reserved 0 VALUE CableLabs-Flow-Direction Upstream 1 VALUE CableLabs-Flow-Direction Downstream 2 VALUE CableLabs-Signal-Type Reserved 0 VALUE CableLabs-Signal-Type Network-Signal 1 VALUE CableLabs-Signal-Type Subject-Signal 2 VALUE CableLabs-Alerting-Signal Reserved-0 0 VALUE CableLabs-Alerting-Signal Ringing 1 VALUE CableLabs-Alerting-Signal Distinctive-Ringing-2 2 VALUE CableLabs-Alerting-Signal Distinctive-Ringing-3 3 VALUE CableLabs-Alerting-Signal Distinctive-Ringing-4 4 VALUE CableLabs-Alerting-Signal Ringsplash 5 VALUE CableLabs-Alerting-Signal Call-Waiting-Tone-1 6 VALUE CableLabs-Alerting-Signal Call-Waiting-Tone-2 7 VALUE CableLabs-Alerting-Signal Call-Waiting-Tone-3 8 VALUE CableLabs-Alerting-Signal Call-Waiting-Tone-4 9 VALUE CableLabs-Alerting-Signal Reserved-10 10 VALUE CableLabs-Alerting-Signal Distinctive-Ringing-0 11 VALUE CableLabs-Alerting-Signal Distinctive-Ringing-1 12 VALUE CableLabs-Alerting-Signal Distinctive-Ringing-5 13 VALUE CableLabs-Alerting-Signal Distinctive-Ringing-6 14 VALUE CableLabs-Alerting-Signal Distinctive-Ringing-7 15 VALUE CableLabs-AM-Opaque-Data Reserved-0 0 VALUE CableLabs-AM-Opaque-Data Dial-Tone 1 VALUE CableLabs-AM-Opaque-Data Stutter-Dial-Tone 2 VALUE CableLabs-AM-Opaque-Data Ring-Back-Tone 3 VALUE CableLabs-AM-Opaque-Data Reorder-Tone 4 VALUE CableLabs-AM-Opaque-Data Busy-Tone 5 VALUE CableLabs-AM-Opaque-Data Confirmation-Tone 6 VALUE CableLabs-AM-Opaque-Data Reserved-7 7 VALUE CableLabs-AM-Opaque-Data Message-Waiting-Indicator 8 VALUE CableLabs-AM-Opaque-Data Off-hook-Warning-Tone 9 VALUE CableLabs-Element-Requesting-QoS Client 0 VALUE CableLabs-Element-Requesting-QoS Policy-Server 1 VALUE CableLabs-Element-Requesting-QoS Embedded-Client 2 VALUE CableLabs-QoS-Release-Reason Gate-Closed-By-PS 1 VALUE CableLabs-QoS-Release-Reason Inactivity-Resource-Recovery-Timer-Expiration 2 VALUE CableLabs-QoS-Release-Reason CM-Failure 3 VALUE CableLabs-QoS-Release-Reason Pre-Empted 4 VALUE CableLabs-QoS-Release-Reason RSVP-PathTear-request 5 VALUE CableLabs-QoS-Release-Reason CM-Request 6 VALUE CableLabs-QoS-Release-Reason Admitted-Timer-Expiration 7 VALUE CableLabs-QoS-Release-Reason Other 127 VALUE CableLabs-Policy-Denied-Reason Policy-Server-Admission-Control-Failure 1 VALUE CableLabs-Policy-Denied-Reason Insufficient-Resources 2 VALUE CableLabs-Policy-Denied-Reason Unknown-Subscriber 3 VALUE CableLabs-Policy-Denied-Reason Unauthorized-AMID 4 VALUE CableLabs-Policy-Denied-Reason Undefined-Service-Class-Name 5 VALUE CableLabs-Policy-Denied-Reason Incompatible-Envelope 6 VALUE CableLabs-Policy-Denied-Reason Other 127 VALUE CableLabs-Policy-Deleted-Reason Application-Manager-Request 1 VALUE CableLabs-Policy-Deleted-Reason CMTS-Decistion 2 VALUE CableLabs-Policy-Deleted-Reason Other 127 VALUE CableLabs-Policy-Update-Reason Traffic-Profile 1 VALUE CableLabs-Policy-Update-Reason Classifier 2 VALUE CableLabs-Policy-Update-Reason Volume-Limit 3 VALUE CableLabs-Policy-Update-Reason Time-Limit 4 VALUE CableLabs-Policy-Update-Reason Opaque-Data 5 VALUE CableLabs-Policy-Update-Reason Multiple-Updates 6 VALUE CableLabs-Policy-Update-Reason Other 127 VALUE CableLabs-Policy-Decision-Status Policy-Approved 1 VALUE CableLabs-Policy-Decision-Status Policy-Denied 2 END-VENDOR CableLabs freeradius-server/share/dictionary.cabletron000066400000000000000000000014751257552170400216740ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2011 The FreeRADIUS Server project and contributors # # http://www.cabletron.com (now http://www.enterasys.com) # $Id$ # VENDOR Cabletron 52 BEGIN-VENDOR Cabletron ATTRIBUTE Cabletron-Protocol-Enable 201 integer ATTRIBUTE Cabletron-Protocol-Callable 202 integer VALUE Cabletron-Protocol-Enable IP-Enable 1 VALUE Cabletron-Protocol-Enable Bridge-Enable 2 VALUE Cabletron-Protocol-Enable IP-BR-Enable 3 VALUE Cabletron-Protocol-Enable BR-IPX-Enable 6 VALUE Cabletron-Protocol-Enable IP-BR-IPX-Enable 7 VALUE Cabletron-Protocol-Callable IP-Callable 1 VALUE Cabletron-Protocol-Callable Bridge-Callable 2 VALUE Cabletron-Protocol-Callable IP-BR-Callable 3 VALUE Cabletron-Protocol-Callable BR-IPX-Callable 6 VALUE Cabletron-Protocol-Callable IP-BR-IPX-Callable 7 END-VENDOR Cabletron freeradius-server/share/dictionary.camiant000066400000000000000000000011141257552170400213250ustar00rootroot00000000000000# -*- text -*- ############################################################################## # # Tekelec (Formerly Camiant) MSR dictionary # http://www.tekelec.com/products/policy-management.asp # ############################################################################## VENDOR Camiant 21274 BEGIN-VENDOR Camiant ATTRIBUTE Camiant-MI-role 1 string ATTRIBUTE Camiant-SUI-role 2 integer ATTRIBUTE Camiant-MI-scope 3 string VALUE Camiant-SUI-role camiantView 101 VALUE Camiant-SUI-role camiantUser 102 VALUE Camiant-SUI-role camiantService 104 END-VENDOR Camiant freeradius-server/share/dictionary.chillispot000066400000000000000000000025351257552170400220730ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2011 The FreeRADIUS Server project and contributors ############################################################################## # # ChilliSpot (and CoovaChilli) captive portal # http://www.chillispot.org # http://coova.org/wiki/index.php/CoovaChilli # # $Id$ # ############################################################################## VENDOR ChilliSpot 14559 BEGIN-VENDOR ChilliSpot ATTRIBUTE ChilliSpot-Max-Input-Octets 1 integer ATTRIBUTE ChilliSpot-Max-Output-Octets 2 integer ATTRIBUTE ChilliSpot-Max-Total-Octets 3 integer ATTRIBUTE ChilliSpot-Bandwidth-Max-Up 4 integer ATTRIBUTE ChilliSpot-Bandwidth-Max-Down 5 integer ATTRIBUTE ChilliSpot-Config 6 string ATTRIBUTE ChilliSpot-Lang 7 string ATTRIBUTE ChilliSpot-Version 8 string ATTRIBUTE ChilliSpot-OriginalURL 9 string # Configuration management parameters (ChilliSpot Only) ATTRIBUTE ChilliSpot-UAM-Allowed 100 string ATTRIBUTE ChilliSpot-MAC-Allowed 101 string ATTRIBUTE ChilliSpot-Interval 102 integer # Inline with RFC 2882 use of VSE-Authorize-Only for remote config # Note that 14559 = 0x38df is used as prefix for the VSE. # This is recognized as the best (but bad) way of doing VSEs. # (ChilliSpot Only - CoovaChilli uses Service-Type = Administrative-User) VALUE Service-Type ChilliSpot-Authorize-Only 0x38df0001 END-VENDOR ChilliSpot freeradius-server/share/dictionary.cisco000066400000000000000000000134211257552170400210150ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2011 The FreeRADIUS Server project and contributors # # dictionary.cisco # # Accounting VSAs originally by # "Marcelo M. Sosa Lugones" # # Version: $Id$ # # For documentation on Cisco RADIUS attributes, see: # # http://www.cisco.com/univercd/cc/td/doc/product/access/acs_serv/vapp_dev/vsaig3.htm # # For general documentation on Cisco RADIUS configuration, see: # # http://www.cisco.com/en/US/partner/tech/tk583/tk547/tsd_technology_support_sub-protocol_home.html # VENDOR Cisco 9 # # Standard attribute # BEGIN-VENDOR Cisco ATTRIBUTE Cisco-AVPair 1 string ATTRIBUTE Cisco-NAS-Port 2 string # # T.37 Store-and-Forward attributes. # ATTRIBUTE Cisco-Fax-Account-Id-Origin 3 string ATTRIBUTE Cisco-Fax-Msg-Id 4 string ATTRIBUTE Cisco-Fax-Pages 5 string ATTRIBUTE Cisco-Fax-Coverpage-Flag 6 string ATTRIBUTE Cisco-Fax-Modem-Time 7 string ATTRIBUTE Cisco-Fax-Connect-Speed 8 string ATTRIBUTE Cisco-Fax-Recipient-Count 9 string ATTRIBUTE Cisco-Fax-Process-Abort-Flag 10 string ATTRIBUTE Cisco-Fax-Dsn-Address 11 string ATTRIBUTE Cisco-Fax-Dsn-Flag 12 string ATTRIBUTE Cisco-Fax-Mdn-Address 13 string ATTRIBUTE Cisco-Fax-Mdn-Flag 14 string ATTRIBUTE Cisco-Fax-Auth-Status 15 string ATTRIBUTE Cisco-Email-Server-Address 16 string ATTRIBUTE Cisco-Email-Server-Ack-Flag 17 string ATTRIBUTE Cisco-Gateway-Id 18 string ATTRIBUTE Cisco-Call-Type 19 string ATTRIBUTE Cisco-Port-Used 20 string ATTRIBUTE Cisco-Abort-Cause 21 string # # Voice over IP attributes. # ATTRIBUTE h323-remote-address 23 string ATTRIBUTE h323-conf-id 24 string ATTRIBUTE h323-setup-time 25 string ATTRIBUTE h323-call-origin 26 string ATTRIBUTE h323-call-type 27 string ATTRIBUTE h323-connect-time 28 string ATTRIBUTE h323-disconnect-time 29 string ATTRIBUTE h323-disconnect-cause 30 string ATTRIBUTE h323-voice-quality 31 string ATTRIBUTE h323-gw-id 33 string ATTRIBUTE h323-incoming-conf-id 35 string ATTRIBUTE Cisco-Policy-Up 37 string ATTRIBUTE Cisco-Policy-Down 38 string ATTRIBUTE sip-conf-id 100 string ATTRIBUTE h323-credit-amount 101 string ATTRIBUTE h323-credit-time 102 string ATTRIBUTE h323-return-code 103 string ATTRIBUTE h323-prompt-id 104 string ATTRIBUTE h323-time-and-day 105 string ATTRIBUTE h323-redirect-number 106 string ATTRIBUTE h323-preferred-lang 107 string ATTRIBUTE h323-redirect-ip-address 108 string ATTRIBUTE h323-billing-model 109 string ATTRIBUTE h323-currency 110 string ATTRIBUTE subscriber 111 string ATTRIBUTE gw-rxd-cdn 112 string ATTRIBUTE gw-final-xlated-cdn 113 string ATTRIBUTE remote-media-address 114 string ATTRIBUTE release-source 115 string ATTRIBUTE gw-rxd-cgn 116 string ATTRIBUTE gw-final-xlated-cgn 117 string # SIP Attributes ATTRIBUTE call-id 141 string ATTRIBUTE session-protocol 142 string ATTRIBUTE method 143 string ATTRIBUTE prev-hop-via 144 string ATTRIBUTE prev-hop-ip 145 string ATTRIBUTE incoming-req-uri 146 string ATTRIBUTE outgoing-req-uri 147 string ATTRIBUTE next-hop-ip 148 string ATTRIBUTE next-hop-dn 149 string ATTRIBUTE sip-hdr 150 string # # Extra attributes sent by the Cisco, if you configure # "radius-server vsa accounting" (requires IOS11.2+). # ATTRIBUTE Cisco-Multilink-ID 187 integer ATTRIBUTE Cisco-Num-In-Multilink 188 integer ATTRIBUTE Cisco-Pre-Input-Octets 190 integer ATTRIBUTE Cisco-Pre-Output-Octets 191 integer ATTRIBUTE Cisco-Pre-Input-Packets 192 integer ATTRIBUTE Cisco-Pre-Output-Packets 193 integer ATTRIBUTE Cisco-Maximum-Time 194 integer ATTRIBUTE Cisco-Disconnect-Cause 195 integer ATTRIBUTE Cisco-Data-Rate 197 integer ATTRIBUTE Cisco-PreSession-Time 198 integer ATTRIBUTE Cisco-PW-Lifetime 208 integer ATTRIBUTE Cisco-IP-Direct 209 integer ATTRIBUTE Cisco-PPP-VJ-Slot-Comp 210 integer ATTRIBUTE Cisco-PPP-Async-Map 212 integer ATTRIBUTE Cisco-IP-Pool-Definition 217 string ATTRIBUTE Cisco-Assign-IP-Pool 218 integer ATTRIBUTE Cisco-Route-IP 228 integer ATTRIBUTE Cisco-Link-Compression 233 integer ATTRIBUTE Cisco-Target-Util 234 integer ATTRIBUTE Cisco-Maximum-Channels 235 integer ATTRIBUTE Cisco-Data-Filter 242 integer ATTRIBUTE Cisco-Call-Filter 243 integer ATTRIBUTE Cisco-Idle-Limit 244 integer ATTRIBUTE Cisco-Subscriber-Password 249 string ATTRIBUTE Cisco-Account-Info 250 string ATTRIBUTE Cisco-Service-Info 251 string ATTRIBUTE Cisco-Command-Code 252 string ATTRIBUTE Cisco-Control-Info 253 string ATTRIBUTE Cisco-Xmit-Rate 255 integer VALUE Cisco-Disconnect-Cause Unknown 2 VALUE Cisco-Disconnect-Cause CLID-Authentication-Failure 4 VALUE Cisco-Disconnect-Cause No-Carrier 10 VALUE Cisco-Disconnect-Cause Lost-Carrier 11 VALUE Cisco-Disconnect-Cause No-Detected-Result-Codes 12 VALUE Cisco-Disconnect-Cause User-Ends-Session 20 VALUE Cisco-Disconnect-Cause Idle-Timeout 21 VALUE Cisco-Disconnect-Cause Exit-Telnet-Session 22 VALUE Cisco-Disconnect-Cause No-Remote-IP-Addr 23 VALUE Cisco-Disconnect-Cause Exit-Raw-TCP 24 VALUE Cisco-Disconnect-Cause Password-Fail 25 VALUE Cisco-Disconnect-Cause Raw-TCP-Disabled 26 VALUE Cisco-Disconnect-Cause Control-C-Detected 27 VALUE Cisco-Disconnect-Cause EXEC-Program-Destroyed 28 VALUE Cisco-Disconnect-Cause Timeout-PPP-LCP 40 VALUE Cisco-Disconnect-Cause Failed-PPP-LCP-Negotiation 41 VALUE Cisco-Disconnect-Cause Failed-PPP-PAP-Auth-Fail 42 VALUE Cisco-Disconnect-Cause Failed-PPP-CHAP-Auth 43 VALUE Cisco-Disconnect-Cause Failed-PPP-Remote-Auth 44 VALUE Cisco-Disconnect-Cause PPP-Remote-Terminate 45 VALUE Cisco-Disconnect-Cause PPP-Closed-Event 46 VALUE Cisco-Disconnect-Cause Session-Timeout 100 VALUE Cisco-Disconnect-Cause Session-Failed-Security 101 VALUE Cisco-Disconnect-Cause Session-End-Callback 102 VALUE Cisco-Disconnect-Cause Invalid-Protocol 120 END-VENDOR Cisco freeradius-server/share/dictionary.cisco.bbsm000066400000000000000000000005501257552170400217360ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2011 The FreeRADIUS Server project and contributors # # Cisco Building Broadband Service Manager Dictionary # # http://www.cisco.com/univercd/cc/td/doc/product/access/acs_soft/csacs4nt/csnt30/user/ad.htm # # $Id$ # VENDOR Cisco-BBSM 5263 BEGIN-VENDOR Cisco-BBSM ATTRIBUTE CBBSM-Bandwidth 1 integer END-VENDOR Cisco-BBSM freeradius-server/share/dictionary.cisco.vpn3000000066400000000000000000000223461257552170400221300ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2011 The FreeRADIUS Server project and contributors # # Cisco VPN 3000 Concentrator Dictionary # # http://www.cisco.com/univercd/cc/td/doc/product/access/acs_soft/csacs4nt/csnt30/user/ad.htm # http://www.cisco.com/univercd/cc/td/doc/product/access/acs_soft/csacs4nt/acs31/acsuser/ad.htm # # http://www.cisco.com/en/US/docs/security/asa/asa80/configuration/guide/extsvr.html#wp1661512 # # $Id$ # VENDOR Cisco-VPN3000 3076 BEGIN-VENDOR Cisco-VPN3000 ATTRIBUTE CVPN3000-Access-Hours 1 string ATTRIBUTE CVPN3000-Simultaneous-Logins 2 integer ATTRIBUTE CVPN3000-Min-Password-Length 3 integer ATTRIBUTE CVPN3000-Allow-Alpha-Only-Passwords 4 integer ATTRIBUTE CVPN3000-Primary-DNS 5 ipaddr ATTRIBUTE CVPN3000-Secondary-DNS 6 ipaddr ATTRIBUTE CVPN3000-Primary-WINS 7 ipaddr ATTRIBUTE CVPN3000-Secondary-WINS 8 ipaddr ATTRIBUTE CVPN3000-SEP-Card-Assignment 9 integer ATTRIBUTE CVPN3000-Priority-On-SEP 10 integer ATTRIBUTE CVPN3000-Tunneling-Protocols 11 integer ATTRIBUTE CVPN3000-IPSec-Sec-Association 12 string ATTRIBUTE CVPN3000-IPSec-Authentication 13 integer ATTRIBUTE CVPN3000-IPSec-Banner1 15 string ATTRIBUTE CVPN3000-IPSec-Allow-Passwd-Store 16 integer ATTRIBUTE CVPN3000-Use-Client-Address 17 integer ATTRIBUTE CVPN3000-PPTP-Min-Auth-Protocol 18 integer ATTRIBUTE CVPN3000-L2TP-Min-Auth-Protocol 19 integer ATTRIBUTE CVPN3000-PPTP-Encryption 20 integer ATTRIBUTE CVPN3000-L2TP-Encryption 21 integer ATTRIBUTE CVPN3000-Auth-Server-Type 22 integer ATTRIBUTE CVPN3000-Auth-Server-Password 23 string ATTRIBUTE CVPN3000-Request-Auth-Vector 24 string ATTRIBUTE CVPN3000-IPSec-LTL-Keepalives 25 integer ATTRIBUTE CVPN3000-IPSec-Group-Name 26 string ATTRIBUTE CVPN3000-IPSec-Split-Tunnel-List 27 string ATTRIBUTE CVPN3000-IPSec-Default-Domain 28 string ATTRIBUTE CVPN3000-IPSec-Split-DNS-Names 29 string ATTRIBUTE CVPN3000-IPSec-Tunnel-Type 30 integer ATTRIBUTE CVPN3000-IPSec-Mode-Config 31 integer ATTRIBUTE CVPN3000-Auth-Server-Priority 32 integer ATTRIBUTE CVPN3000-IPSec-User-Group-Lock 33 integer ATTRIBUTE CVPN3000-IPSec-Over-UDP 34 integer ATTRIBUTE CVPN3000-IPSec-Over-UDP-Port 35 integer ATTRIBUTE CVPN3000-IPSec-Banner2 36 string ATTRIBUTE CVPN3000-PPTP-MPPC-Compression 37 integer ATTRIBUTE CVPN3000-L2TP-MPPC-Compression 38 integer ATTRIBUTE CVPN3000-IPSec-IP-Compression 39 integer ATTRIBUTE CVPN3000-IPSec-IKE-Peer-ID-Check 40 integer ATTRIBUTE CVPN3000-IKE-Keep-Alives 41 integer ATTRIBUTE CVPN3000-IPSec-Auth-On-Rekey 42 integer ATTRIBUTE CVPN3000-Reqrd-Client-Fw-Vendor-Code 45 integer ATTRIBUTE CVPN3000-Reqrd-Client-Fw-Product-Code 46 integer ATTRIBUTE CVPN3000-Reqrd-Client-Fw-Description 47 string ATTRIBUTE CVPN3000-Require-HW-Client-Auth 48 integer ATTRIBUTE CVPN3000-Require-Individual-User-Auth 49 integer ATTRIBUTE CVPN3000-Authd-User-Idle-Timeout 50 integer ATTRIBUTE CVPN3000-Cisco-IP-Phone-Bypass 51 integer ATTRIBUTE CVPN3000-User-Auth-Server-Name 52 string ATTRIBUTE CVPN3000-User-Auth-Server-Port 53 integer ATTRIBUTE CVPN3000-User-Auth-Server-Secret 54 string ATTRIBUTE CVPN3000-IPSec-Split-Tunneling-Policy 55 integer ATTRIBUTE CVPN3000-IPSec-Reqrd-Client-Fw-Cap 56 integer ATTRIBUTE CVPN3000-IPSec-Client-Fw-Filter-Name 57 string ATTRIBUTE CVPN3000-IPSec-Client-Fw-Filter-Opt 58 integer ATTRIBUTE CVPN3000-IPSec-Backup-Servers 59 integer ATTRIBUTE CVPN3000-IPSec-Backup-Server-List 60 string ATTRIBUTE CVPN3000-DHCP-Network-Scope 61 ipaddr ATTRIBUTE CVPN3000-MS-Client-Icpt-DHCP-Conf-Msg 62 integer ATTRIBUTE CVPN3000-MS-Client-Subnet-Mask 63 ipaddr ATTRIBUTE CVPN3000-Allow-Network-Extension-Mode 64 integer ATTRIBUTE CVPN3000-IPSec-Authorization-Type 65 integer ATTRIBUTE CVPN3000-IPSec-Authorization-Required 66 integer ATTRIBUTE CVPN3000-IPSec-DN-Field 67 string ATTRIBUTE CVPN3000-IPSec-Confidence-Level 68 integer ATTRIBUTE CVPN3000-WebVPN-Content-Filter 69 integer ATTRIBUTE CVPN3000-WebVPN-Enable-functions 70 integer ATTRIBUTE CVPN3000-WebVPN-Exchange-Addr 74 string ATTRIBUTE CVPN3000-LEAP-Bypass 75 integer ATTRIBUTE CVPN3000-WebVPN-Exchange-NETBIOS-name 78 string ATTRIBUTE CVPN3000-Port-Forwarding-Name 79 string ATTRIBUTE CVPN3000-Partition-Primary-DHCP 128 ipaddr ATTRIBUTE CVPN3000-Partition-Secondary-DHCP 129 ipaddr ATTRIBUTE CVPN3000-Partition-Premise-Router 131 ipaddr ATTRIBUTE CVPN3000-Partition-Max-Sessions 132 integer ATTRIBUTE CVPN3000-Partition-Mobile-IP-Key 133 string ATTRIBUTE CVPN3000-Partition-Mobile-IP-Address 134 ipaddr ATTRIBUTE CVPN3000-Partition-Mobile-IP-SPI 135 integer ATTRIBUTE CVPN3000-Strip-Realm 136 integer ATTRIBUTE CVPN3000-Group-Name 137 integer ATTRIBUTE CVPN3000-Smart-Tunnel-Auto 138 integer ATTRIBUTE CVPN3000-VLAN 140 integer ATTRIBUTE CVPN3000-NAC-Settings 141 string ATTRIBUTE CVPN3000-Member-Of 145 string ATTRIBUTE CVPN3000-Address-Pools 217 string ATTRIBUTE CVPN3000-IPv6-Address-Pools 218 string ATTRIBUTE CVPN3000-IPv6-VPN-Filter 219 string ATTRIBUTE CVPN3000-Privilege-Level 220 integer ATTRIBUTE CVPN3000-WebVPN-Macro-Value1 223 string ATTRIBUTE CVPN3000-WebVPN-Macro-Value2 224 string VALUE CVPN3000-Allow-Alpha-Only-Passwords Disallow 0 VALUE CVPN3000-Allow-Alpha-Only-Passwords Allow 1 VALUE CVPN3000-SEP-Card-Assignment SEP1 1 VALUE CVPN3000-SEP-Card-Assignment SEP2 2 VALUE CVPN3000-SEP-Card-Assignment SEP3 4 VALUE CVPN3000-SEP-Card-Assignment SEP4 8 VALUE CVPN3000-SEP-Card-Assignment Any-SEP 15 VALUE CVPN3000-Priority-On-SEP High 1 VALUE CVPN3000-Priority-On-SEP Med-High 2 VALUE CVPN3000-Priority-On-SEP Medium 3 VALUE CVPN3000-Priority-On-SEP Med-Low 4 VALUE CVPN3000-Priority-On-SEP Low 5 VALUE CVPN3000-Tunneling-Protocols PPTP 1 VALUE CVPN3000-Tunneling-Protocols L2TP 2 VALUE CVPN3000-Tunneling-Protocols IPSec 4 VALUE CVPN3000-Tunneling-Protocols PPTP-and-IPSec 5 VALUE CVPN3000-Tunneling-Protocols L2TP/IPSec 8 VALUE CVPN3000-Tunneling-Protocols All 15 VALUE CVPN3000-IPSec-Authentication None 0 VALUE CVPN3000-IPSec-Authentication RADIUS 1 VALUE CVPN3000-IPSec-Authentication LDAP 2 VALUE CVPN3000-IPSec-Authentication NTDomain 3 VALUE CVPN3000-IPSec-Authentication SDI 4 VALUE CVPN3000-IPSec-Authentication Internal 5 VALUE CVPN3000-IPSec-Allow-Passwd-Store Disallow 0 VALUE CVPN3000-IPSec-Allow-Passwd-Store Allow 1 VALUE CVPN3000-Use-Client-Address Disallow 0 VALUE CVPN3000-Use-Client-Address Allow 1 VALUE CVPN3000-PPTP-Min-Auth-Protocol PAP 1 VALUE CVPN3000-PPTP-Min-Auth-Protocol CHAP 2 VALUE CVPN3000-PPTP-Min-Auth-Protocol EAP-MD5 4 VALUE CVPN3000-PPTP-Min-Auth-Protocol EAP-GTC 8 VALUE CVPN3000-PPTP-Min-Auth-Protocol EAP-TLS 16 VALUE CVPN3000-PPTP-Min-Auth-Protocol MSCHAPv1 32 VALUE CVPN3000-PPTP-Min-Auth-Protocol MSCHAPv2 64 VALUE CVPN3000-PPTP-Min-Auth-Protocol Default 102 VALUE CVPN3000-L2TP-Min-Auth-Protocol PAP 1 VALUE CVPN3000-L2TP-Min-Auth-Protocol CHAP 2 VALUE CVPN3000-L2TP-Min-Auth-Protocol EAP-MD5 4 VALUE CVPN3000-L2TP-Min-Auth-Protocol EAP-GTC 8 VALUE CVPN3000-L2TP-Min-Auth-Protocol EAP-TLS 16 VALUE CVPN3000-L2TP-Min-Auth-Protocol MSCHAPv1 32 VALUE CVPN3000-L2TP-Min-Auth-Protocol MSCHAPv2 64 VALUE CVPN3000-L2TP-Min-Auth-Protocol Default 102 VALUE CVPN3000-PPTP-Encryption PPTP-40bit 2 VALUE CVPN3000-PPTP-Encryption PPTP-40-Encryption-Req 3 VALUE CVPN3000-PPTP-Encryption PPTP-128 4 VALUE CVPN3000-PPTP-Encryption PPTP-128-Encryption-Req 5 VALUE CVPN3000-PPTP-Encryption PPTP-40-or-128 6 VALUE CVPN3000-PPTP-Encryption PPTP-40-or-128-Encry-Req 7 VALUE CVPN3000-PPTP-Encryption PPTP-40-Stateless-Req 10 VALUE CVPN3000-PPTP-Encryption PPTP-40-Enc/Stateless-Req 11 VALUE CVPN3000-PPTP-Encryption PPTP-128-Stateless-Req 12 VALUE CVPN3000-PPTP-Encryption PPTP-128-Enc/Stateless-Req 13 VALUE CVPN3000-PPTP-Encryption PPTP-40/128-Stateless-Req 14 VALUE CVPN3000-PPTP-Encryption PPTP-40/128-Enc/Statls-Req 15 VALUE CVPN3000-L2TP-Encryption L2TP-40bit 2 VALUE CVPN3000-L2TP-Encryption L2TP-40-Encryption-Req 3 VALUE CVPN3000-L2TP-Encryption L2TP-128 4 VALUE CVPN3000-L2TP-Encryption L2TP-128-Encryption-Req 5 VALUE CVPN3000-L2TP-Encryption L2TP-40-or-128 6 VALUE CVPN3000-L2TP-Encryption L2TP-40-or-128-Encry-Req 7 VALUE CVPN3000-L2TP-Encryption L2TP-40-Stateless-Req 10 VALUE CVPN3000-L2TP-Encryption L2TP-40-Enc/Stateless-Req 11 VALUE CVPN3000-L2TP-Encryption L2TP-128-Stateless-Req 12 VALUE CVPN3000-L2TP-Encryption L2TP-128-Enc/Stateless-Req 13 VALUE CVPN3000-L2TP-Encryption L2TP-40/128-Stateless-Req 14 VALUE CVPN3000-L2TP-Encryption L2TP-40/128-Enc/Statls-Req 15 VALUE CVPN3000-Auth-Server-Type First-Active-Server 0 VALUE CVPN3000-Auth-Server-Type RADIUS 1 VALUE CVPN3000-Auth-Server-Type LDAP 2 VALUE CVPN3000-Auth-Server-Type NT 3 VALUE CVPN3000-Auth-Server-Type SDI 4 VALUE CVPN3000-Auth-Server-Type Internal 5 VALUE CVPN3000-IPSec-LTL-Keepalives OFF 0 VALUE CVPN3000-IPSec-LTL-Keepalives ON 1 VALUE CVPN3000-IPSec-Tunnel-Type LAN-to-LAN 1 VALUE CVPN3000-IPSec-Tunnel-Type Remote-Access 2 VALUE CVPN3000-IPSec-Mode-Config ON 1 VALUE CVPN3000-IPSec-Mode-Config OFF 0 VALUE CVPN3000-IPSec-User-Group-Lock OFF 0 VALUE CVPN3000-IPSec-User-Group-Lock ON 1 VALUE CVPN3000-IPSec-Over-UDP OFF 0 VALUE CVPN3000-IPSec-Over-UDP ON 1 VALUE CVPN3000-Strip-Realm FALSE 0 VALUE CVPN3000-Strip-Realm TRUE 1 VALUE CVPN3000-Smart-Tunnel-Auto Disabled 0 VALUE CVPN3000-Smart-Tunnel-Auto Enabled 1 VALUE CVPN3000-Smart-Tunnel-Auto Auto 2 END-VENDOR Cisco-VPN3000 freeradius-server/share/dictionary.cisco.vpn5000000066400000000000000000000011671257552170400221300ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2011 The FreeRADIUS Server project and contributors # # Cisco VPN 5000 Concentrator Dictionary # # http://www.cisco.com/univercd/cc/td/doc/product/access/acs_soft/csacs4nt/csnt30/user/ad.htm # # $Id$ # VENDOR Cisco-VPN5000 255 BEGIN-VENDOR Cisco-VPN5000 ATTRIBUTE CVPN5000-Tunnel-Throughput 1 integer ATTRIBUTE CVPN5000-Client-Assigned-IP 2 string ATTRIBUTE CVPN5000-Client-Real-IP 3 string ATTRIBUTE CVPN5000-VPN-GroupInfo 4 string ATTRIBUTE CVPN5000-VPN-Password 5 string ATTRIBUTE CVPN5000-Echo 6 integer ATTRIBUTE CVPN5000-Client-Assigned-IPX 7 integer END-VENDOR Cisco-VPN5000 freeradius-server/share/dictionary.citrix000066400000000000000000000011211257552170400212110ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2014 The FreeRADIUS Server project and contributors ############################################################################## # # Citrix VSAs # # $Id$ # ############################################################################## VENDOR Citrix 66 BEGIN-VENDOR Citrix ATTRIBUTE Citrix-UID 10 integer ATTRIBUTE Citrix-GID 11 integer ATTRIBUTE Citrix-Home 12 string ATTRIBUTE Citrix-Shell 13 string ATTRIBUTE Citrix-Group-Names 14 string ATTRIBUTE Citrix-Group-Ids 15 string ATTRIBUTE Citrix-User-Groups 16 string END-VENDOR Citrix freeradius-server/share/dictionary.clavister000066400000000000000000000006351257552170400217140ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2011 The FreeRADIUS Server project and contributors ############################################################################## # # Clavister VSAs # # $Id$ # ############################################################################## VENDOR Clavister 5089 # # User group attribute # BEGIN-VENDOR Clavister ATTRIBUTE Clavister-User-Group 1 string END-VENDOR Clavister freeradius-server/share/dictionary.colubris000066400000000000000000000004731257552170400215420ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2011 The FreeRADIUS Server project and contributors # Colubris dictionary - dictionary.colubris # VENDOR Colubris 8744 # # Vendor-specific attributes # BEGIN-VENDOR Colubris ATTRIBUTE Colubris-AVPair 0 string ATTRIBUTE Colubris-Intercept 1 integer END-VENDOR Colubris freeradius-server/share/dictionary.columbia_university000066400000000000000000000011261257552170400240100ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2011 The FreeRADIUS Server project and contributors VALUE Service-Type Sip-session 12 # Columbia University VSAs, from: # # http://www.cs.columbia.edu/IRT/cinema/release/radius_notes.html # # $Id$ # VENDOR Columbia-University 11862 BEGIN-VENDOR Columbia-University ATTRIBUTE Sip-Method 0 integer ATTRIBUTE Sip-From 1 string ATTRIBUTE Sip-To 2 string ATTRIBUTE Sip-Translated-Request-URI 4 string VALUE Sip-Method INVITE 0 VALUE Sip-Method BYE 1 VALUE Sip-Method REGISTER 2 VALUE Sip-Method OTHER 3 END-VENDOR Columbia-University freeradius-server/share/dictionary.compat000066400000000000000000000026571257552170400212110ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2011 The FreeRADIUS Server project and contributors # # Obsolete names for backwards compatibility with older users files. # Move the $INCLUDE in the main dictionary file to the end if you want # these names to be used in the "details" logfile. # ATTRIBUTE Password 2 string encrypt=1 ATTRIBUTE Client-Id 4 ipaddr ATTRIBUTE Client-Port-Id 5 integer ATTRIBUTE User-Service-Type 6 integer ATTRIBUTE Framed-Address 8 ipaddr ATTRIBUTE Framed-Netmask 9 ipaddr ATTRIBUTE Framed-Filter-Id 11 string ATTRIBUTE Login-Host 14 ipaddr ATTRIBUTE Login-Port 16 integer ATTRIBUTE Old-Password 17 string ATTRIBUTE Port-Message 18 string ATTRIBUTE Dialback-No 19 string ATTRIBUTE Dialback-Name 20 string ATTRIBUTE Challenge-State 24 string VALUE Framed-Compression Van-Jacobsen-TCP-IP 1 VALUE Framed-Compression VJ-TCP-IP 1 VALUE Service-Type Shell-User 6 VALUE Auth-Type Unix 1 VALUE Service-Type Dialback-Login-User 3 VALUE Service-Type Dialback-Framed-User 4 VALUE Service-Type Dialout-Framed-User 5 # # For compatibility with MERIT users files. # ATTRIBUTE Login-Callback-Number 19 string ATTRIBUTE Framed-Callback-Id 20 string ATTRIBUTE Client-Port-DNIS 30 string ATTRIBUTE Caller-ID 31 string VALUE Service-Type Login 1 VALUE Service-Type Framed 2 VALUE Service-Type Callback-Login 3 VALUE Service-Type Callback-Framed 4 VALUE Service-Type Exec-User 7 freeradius-server/share/dictionary.compatible000066400000000000000000000011211257552170400220260ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2014 The FreeRADIUS Server project and contributors # # Compatible Systems Corporation dictionary # # Compatible Systems was acquired by Cisco in 2000. # VENDOR Compatible 255 BEGIN-VENDOR Compatible ATTRIBUTE Compatible-Tunnel-Delay 0 integer ATTRIBUTE Compatible-Tunnel-Throughput 1 integer ATTRIBUTE Compatible-Tunnel-Server-Endpoint 3 ipaddr ATTRIBUTE Compatible-Tunnel-Group-Info 4 string ATTRIBUTE Compatible-Tunnel-Password 5 string ATTRIBUTE Compatible-Echo 6 integer ATTRIBUTE Compatible-Tunnel-IPX 7 integer END-VENDOR Compatible freeradius-server/share/dictionary.cosine000066400000000000000000000012561257552170400212000ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2011 The FreeRADIUS Server project and contributors ############################################################################## # # Cosine IPSX Dictionary # # $Id$ # ############################################################################## VENDOR Cosine 3085 BEGIN-VENDOR Cosine ATTRIBUTE Cosine-Connection-Profile-Name 1 string ATTRIBUTE Cosine-Enterprise-ID 2 string ATTRIBUTE Cosine-Address-Pool-Name 3 string ATTRIBUTE Cosine-DS-Byte 4 integer ATTRIBUTE Cosine-VPI-VCI 5 octets ATTRIBUTE Cosine-DLCI 6 integer ATTRIBUTE Cosine-LNS-IP-Address 7 ipaddr ATTRIBUTE Cosine-CLI-User-Permission-ID 8 string END-VENDOR Cosine freeradius-server/share/dictionary.dante000066400000000000000000000006761257552170400210200ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2013 The FreeRADIUS Server project and contributors ############################################################################## # # DANTE Vendor Specific Attributes Dictionary # # Created by Alan Buxey # ############################################################################## VENDOR DANTE 27262 BEGIN-VENDOR DANTE ATTRIBUTE Default-TTL 1 integer END-VENDOR DANTE freeradius-server/share/dictionary.dhcp000066400000000000000000000441021257552170400206330ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2011 The FreeRADIUS Server project and contributors ############################################################################## # # DHCP to RADUS gateway dictionary. # # http://www.iana.org/assignments/bootp-dhcp-parameters # # Also http://www.networksorcery.com/enp/protocol/bootp/options.htm # # http://www.bind9.net/rfc-dhcp # # $Id$ # ############################################################################## # # This is really Apollo's number, but since they're out of business, # I don't think they'll be needing this. # # HP owns the Apollo assets, but let's not worry about that. # # The vendor codes are 2 octets, because we need 256 numbers # for the base DHCP options, PLUS a few for the DHCP headers, # which aren't in option format. # # On top of that, a number of options are really TLV's. # We need to be able to understand them, too. # VENDOR DHCP 54 format=2,1 BEGIN-VENDOR DHCP ATTRIBUTE DHCP-Opcode 256 byte ATTRIBUTE DHCP-Hardware-Type 257 byte ATTRIBUTE DHCP-Hardware-Address-Length 258 byte ATTRIBUTE DHCP-Hop-Count 259 byte ATTRIBUTE DHCP-Transaction-Id 260 integer ATTRIBUTE DHCP-Number-of-Seconds 261 short ATTRIBUTE DHCP-Flags 262 short ATTRIBUTE DHCP-Client-IP-Address 263 ipaddr ATTRIBUTE DHCP-Your-IP-Address 264 ipaddr ATTRIBUTE DHCP-Server-IP-Address 265 ipaddr ATTRIBUTE DHCP-Gateway-IP-Address 266 ipaddr ATTRIBUTE DHCP-Client-Hardware-Address 267 ether # 16 octets ATTRIBUTE DHCP-Server-Host-Name 268 string # 64 octets ATTRIBUTE DHCP-Boot-Filename 269 string # 128 octets ATTRIBUTE DHCP-Relay-To-IP-Address 270 ipaddr ATTRIBUTE DHCP-Relay-Max-Hop-Count 271 integer # This is copied from the request packet, giaddr, and # added to the reply packet by the server core. ATTRIBUTE DHCP-Relay-IP-Address 272 ipaddr VALUE DHCP-Flags Broadcast 0x8000 VALUE DHCP-Hardware-Type Ethernet 1 VALUE DHCP-Hardware-Type Experiemental-Ethernet 2 VALUE DHCP-Hardware-Type AX.25 3 VALUE DHCP-Hardware-Type Proteon-Token-Ring 4 VALUE DHCP-Hardware-Type Chaos 5 VALUE DHCP-Hardware-Type IEEE-802 6 VALUE DHCP-Hardware-Type Arcnet 7 VALUE DHCP-Hardware-Type Hyperchannel 8 VALUE DHCP-Hardware-Type Lanstar 9 VALUE DHCP-Hardware-Type Autonet-Short-Address 10 VALUE DHCP-Hardware-Type LocalTalk 11 VALUE DHCP-Hardware-Type LocalNet 12 VALUE DHCP-Hardware-Type Ultra-Link 13 VALUE DHCP-Hardware-Type SMDS 14 VALUE DHCP-Hardware-Type Frame-Relay 15 VALUE DHCP-Hardware-Type ATM-16 16 VALUE DHCP-Hardware-Type HDLC 17 VALUE DHCP-Hardware-Type Fibre-Channel 18 VALUE DHCP-Hardware-Type ATM-19 19 VALUE DHCP-Hardware-Type Serial-Line 20 VALUE DHCP-Hardware-Type ATM-21 21 VALUE DHCP-Hardware-Type MIL-STD-188-220 22 VALUE DHCP-Hardware-Type Metricom 23 VALUE DHCP-Hardware-Type IEEE-1394 24 VALUE DHCP-Hardware-Type MAPOS 25 VALUE DHCP-Hardware-Type Twinaxial 26 VALUE DHCP-Hardware-Type EUI-64 27 VALUE DHCP-Hardware-Type HIPARP 28 VALUE DHCP-Hardware-Type IP-Over-ISO-7816-3 29 VALUE DHCP-Hardware-Type ARPSec 30 VALUE DHCP-Hardware-Type IPSec-Tunnel 31 VALUE DHCP-Hardware-Type Infiniband 32 VALUE DHCP-Hardware-Type CAI-TIA-102 33 ############################################################################## # # DHCP Options, with comments. For now, many are "octets", # as FreeRADIUS doesn't handle complex data structures. # ############################################################################## #ATTRIBUTE DHCP-Pad 0 octets ATTRIBUTE DHCP-Subnet-Mask 1 ipaddr # Time Offset in twos-complement notation. ATTRIBUTE DHCP-Time-Offset 2 integer ATTRIBUTE DHCP-Router-Address 3 ipaddr array ATTRIBUTE DHCP-Time-Server 4 ipaddr array ATTRIBUTE DHCP-IEN-116-Name-Server 5 ipaddr array ATTRIBUTE DHCP-Domain-Name-Server 6 ipaddr array # Logging-Server addresses ATTRIBUTE DHCP-Log-Server 7 ipaddr array ATTRIBUTE DHCP-Quotes-Server 8 ipaddr array ATTRIBUTE DHCP-LPR-Server 9 ipaddr array ATTRIBUTE DHCP-Impress-Server 10 ipaddr array ATTRIBUTE DHCP-RLP-Server 11 ipaddr array # Hostname string ATTRIBUTE DHCP-Hostname 12 string # Size of boot file in 512 byte ATTRIBUTE DHCP-Boot-File-Size 13 short # Client to dump and name ATTRIBUTE DHCP-Merit-Dump-File 14 octets ATTRIBUTE DHCP-Domain-Name 15 string ATTRIBUTE DHCP-Swap-Server 16 ipaddr # Path name for root disk ATTRIBUTE DHCP-Root-Path 17 string ATTRIBUTE DHCP-Bootp-Extensions-Path 18 string ATTRIBUTE DHCP-IP-Forward-Enable 19 byte ATTRIBUTE DHCP-Source-Route-Enable 20 byte # Routing Policy Filters ATTRIBUTE DHCP-Policy-Filter 21 octets ATTRIBUTE DHCP-Max-Datagram-Reassembly-Sz 22 short ATTRIBUTE DHCP-Default-IP-TTL 23 octets ATTRIBUTE DHCP-Path-MTU-Aging-Timeout 24 integer ATTRIBUTE DHCP-Path-MTU-Plateau-Table 25 short array ATTRIBUTE DHCP-Interface-MTU-Size 26 short ATTRIBUTE DHCP-All-Subnets-Are-Local 27 byte ATTRIBUTE DHCP-Broadcast-Address 28 ipaddr ATTRIBUTE DHCP-Perform-Mask-Discovery 29 byte ATTRIBUTE DHCP-Provide-Mask-To-Others 30 byte ATTRIBUTE DHCP-Perform-Router-Discovery 31 byte ATTRIBUTE DHCP-Router-Solicitation-Address 32 ipaddr # first is destination address, second is router. ATTRIBUTE DHCP-Static-Routes 33 ipaddr array ATTRIBUTE DHCP-Trailer-Encapsulation 34 byte ATTRIBUTE DHCP-ARP-Cache-Timeout 35 integer ATTRIBUTE DHCP-Ethernet-Encapsulation 36 byte ATTRIBUTE DHCP-Default-TCP-TTL 37 byte ATTRIBUTE DHCP-Keep-Alive-Interval 38 integer ATTRIBUTE DHCP-Keep-Alive-Garbage 39 byte ATTRIBUTE DHCP-NIS-Domain-Name 40 string ATTRIBUTE DHCP-NIS-Servers 41 ipaddr array ATTRIBUTE DHCP-NTP-Servers 42 ipaddr array # N Vendor Specific Information ATTRIBUTE DHCP-Vendor 43 octets # tlv ATTRIBUTE DHCP-NETBIOS-Name-Servers 44 ipaddr array ATTRIBUTE DHCP-NETBIOS-Dgm-Dist-Servers 45 ipaddr array ATTRIBUTE DHCP-NETBIOS-Node-Type 46 byte # N NETBIOS Scope ATTRIBUTE DHCP-NETBIOS 47 octets ATTRIBUTE DHCP-X-Window-Font-Server 48 ipaddr array ATTRIBUTE DHCP-X-Window-Display-Mgr 49 ipaddr array ATTRIBUTE DHCP-Requested-IP-Address 50 ipaddr ATTRIBUTE DHCP-IP-Address-Lease-Time 51 integer # Overload "sname" or "file" ATTRIBUTE DHCP-Overload 52 byte ATTRIBUTE DHCP-Message-Type 53 byte ATTRIBUTE DHCP-DHCP-Server-Identifier 54 ipaddr # Array of 1-byte numbers indicating which options the client # would like to see in the response. ATTRIBUTE DHCP-Parameter-Request-List 55 byte array ATTRIBUTE DHCP-DHCP-Error-Message 56 octets ATTRIBUTE DHCP-DHCP-Maximum-Msg-Size 57 short ATTRIBUTE DHCP-Renewal-Time 58 integer ATTRIBUTE DHCP-Rebinding-Time 59 integer ATTRIBUTE DHCP-Vendor-Class-Identifier 60 string # Client Identifier # First octets is DHCP-Hardware-Type, rest are type-specific data, # e.g. MAC address. ATTRIBUTE DHCP-Client-Identifier 61 octets ATTRIBUTE DHCP-Netware-Domain-Name 62 octets ATTRIBUTE DHCP-Netware-Sub-Options 63 octets ATTRIBUTE DHCP-NIS-Client-Domain-Name 64 octets ATTRIBUTE DHCP-NIS-Server-Address 65 ipaddr ATTRIBUTE DHCP-TFTP-Server-Name 66 string ATTRIBUTE DHCP-Boot-File-Name 67 string # Home Agent Addresses ATTRIBUTE DHCP-Home-Agent-Address 68 octets ATTRIBUTE DHCP-SMTP-Server-Address 69 ipaddr array ATTRIBUTE DHCP-POP3-Server-Address 70 ipaddr array ATTRIBUTE DHCP-NNTP-Server-Address 71 ipaddr array ATTRIBUTE DHCP-WWW-Server-Address 72 ipaddr array ATTRIBUTE DHCP-Finger-Server-Address 73 ipaddr array ATTRIBUTE DHCP-IRC-Server-Address 74 ipaddr array ATTRIBUTE DHCP-StreetTalk-Server-Address 75 ipaddr array ATTRIBUTE DHCP-STDA-Server-Address 76 ipaddr array # User Class Information ATTRIBUTE DHCP-User-Class 77 octets # directory agent information ATTRIBUTE DHCP-Directory-Agent 78 octets # service location agent scope ATTRIBUTE DHCP-Service-Scope 79 octets # Rapid Commit ATTRIBUTE DHCP-Rapid-Commit 80 octets # Fully Qualified Domain Name ATTRIBUTE DHCP-Client-FQDN 81 string # Relay Agent Information ATTRIBUTE DHCP-Relay-Agent-Information 82 tlv BEGIN-TLV DHCP-Relay-Agent-Information ATTRIBUTE DHCP-Agent-Circuit-Id 1 octets ATTRIBUTE DHCP-Agent-Remote-Id 2 octets ATTRIBUTE DHCP-Relay-Circuit-Id 1 octets ATTRIBUTE DHCP-Relay-Remote-Id 2 octets # 3 is reserved and shouldn't be used for anything ATTRIBUTE DHCP-Docsis-Device-Class 4 integer ATTRIBUTE DHCP-Relay-Link-Selection 5 ipaddr ATTRIBUTE DHCP-Subscriber-Id 6 string # AGH! RADIUS inside of DHCP! ATTRIBUTE DHCP-RADIUS-Attributes 7 octets # Horribly complicated ATTRIBUTE DHCP-Authentication-Information 8 octets ATTRIBUTE DHCP-Vendor-Specific-Information 9 octets ATTRIBUTE DHCP-Relay-Agent-Flags 10 byte ATTRIBUTE DHCP-Server-Identifier-Override 11 ipaddr END-TLV DHCP-Relay-Agent-Information # Internet Storage Name Service ATTRIBUTE DHCP-iSNS 83 octets # Novell Directory Services ATTRIBUTE DHCP-NDS-Servers 85 octets # Novell Directory Services ATTRIBUTE DHCP-NDS-Tree-Name 86 octets # Novell Directory Services ATTRIBUTE DHCP-NDS-Context 87 octets # Authentication ATTRIBUTE DHCP-Authentication 90 octets ATTRIBUTE DHCP-Client-Last-Txn-Time 91 octets ATTRIBUTE DHCP-associated-ip 92 octets # Client System Architecture ATTRIBUTE DHCP-Client-System 93 octets # Client Network Device Interface ATTRIBUTE DHCP-Client-NDI 94 octets # Lightweight Directory Access Protocol ATTRIBUTE DHCP-LDAP 95 octets # UUID/GUID-based Client Identifier ATTRIBUTE DHCP-UUID/GUID 97 octets # Open Group's User Authentication ATTRIBUTE DHCP-User-Auth 98 octets # NetInfo Parent-Server Address ATTRIBUTE DHCP-Netinfo-Address 112 octets # NetInfo Parent-Server Tag ATTRIBUTE DHCP-Netinfo-Tag 113 octets # URL ATTRIBUTE DHCP-URL 114 octets # DHCP Auto-Configuration ATTRIBUTE DHCP-Auto-Config 116 byte # Name Service Search ATTRIBUTE DHCP-Name-Service-Search 117 octets # Subnet Selection Option ATTRIBUTE DHCP-Subnet-Selection-Option 118 octets # DNS domain serach list ATTRIBUTE DHCP-Domain-Search 119 octets # SIP-Servers DHCP Option ATTRIBUTE DHCP-SIP-Servers-DHCP-Option 120 octets # Classless Static Route Option ATTRIBUTE DHCP-Classless-Static-Route 121 octets # CableLabs Client Configuration ATTRIBUTE DHCP-CCC 122 octets # 16 GeoConf Option ATTRIBUTE DHCP-GeoConf-Option 123 octets # Vendor Class # # String name that defines the vendor space used for the TLV's # in option 125. # ATTRIBUTE DHCP-V-I-Vendor-Class 124 octets # Vendor-Specific ATTRIBUTE DHCP-V-I-Vendor-Specific 125 octets # tlv ATTRIBUTE DHCP-Etherboot 128 ether # (for IP Phone software load) ATTRIBUTE DHCP-TFTP-Server-IP-Address 128 octets ATTRIBUTE DHCP-Call-Server-IP-address 129 octets ATTRIBUTE DHCP-Ethernet-Interface 130 octets ATTRIBUTE DHCP-Vendor-Discrimination-Str 130 octets ATTRIBUTE DHCP-Remote-Stats-Svr-IP-Address 131 octets ATTRIBUTE DHCP-IEEE-802.1Q-L2-Priority 132 octets ATTRIBUTE DHCP-IEEE-802.1P-VLAN-ID 133 octets ATTRIBUTE DHCP-Diffserv-Code-Point 134 octets ATTRIBUTE DHCP-HTTP-Proxy 135 octets ATTRIBUTE DHCP-Cisco-TFTP-Server-IP-Addresses 150 ipaddr array ATTRIBUTE DHCP-End-Of-Options 255 byte VALUE DHCP-Opcode Client-Message 1 VALUE DHCP-Opcode Server-Message 2 VALUE DHCP-Message-Type DHCP-Discover 1 VALUE DHCP-Message-Type DHCP-Offer 2 VALUE DHCP-Message-Type DHCP-Request 3 VALUE DHCP-Message-Type DHCP-Decline 4 VALUE DHCP-Message-Type DHCP-Ack 5 VALUE DHCP-Message-Type DHCP-NAK 6 VALUE DHCP-Message-Type DHCP-Release 7 VALUE DHCP-Message-Type DHCP-Inform 8 VALUE DHCP-Message-Type DHCP-Force-Renew 9 VALUE DHCP-Parameter-Request-List DHCP-Subnet-Mask 1 VALUE DHCP-Parameter-Request-List DHCP-Time-Offset 2 VALUE DHCP-Parameter-Request-List DHCP-Router-Address 3 VALUE DHCP-Parameter-Request-List DHCP-Time-Server 4 VALUE DHCP-Parameter-Request-List DHCP-IEN-116-Name-Server 5 VALUE DHCP-Parameter-Request-List DHCP-Domain-Name-Server 6 VALUE DHCP-Parameter-Request-List DHCP-Log-Server 7 VALUE DHCP-Parameter-Request-List DHCP-Quotes-Server 8 VALUE DHCP-Parameter-Request-List DHCP-LPR-Server 9 VALUE DHCP-Parameter-Request-List DHCP-Impress-Server 10 VALUE DHCP-Parameter-Request-List DHCP-RLP-Server 11 VALUE DHCP-Parameter-Request-List DHCP-Hostname 12 VALUE DHCP-Parameter-Request-List DHCP-Boot-File-Size 13 VALUE DHCP-Parameter-Request-List DHCP-Merit-Dump-File 14 VALUE DHCP-Parameter-Request-List DHCP-Domain-Name 15 VALUE DHCP-Parameter-Request-List DHCP-Swap-Server 16 VALUE DHCP-Parameter-Request-List DHCP-Root-Path 17 VALUE DHCP-Parameter-Request-List DHCP-Bootp-Extensions-Path 18 VALUE DHCP-Parameter-Request-List DHCP-IP-Forward-Enable 19 VALUE DHCP-Parameter-Request-List DHCP-Source-Route-Enable 20 VALUE DHCP-Parameter-Request-List DHCP-Policy-Filter 21 VALUE DHCP-Parameter-Request-List DHCP-Max-Datagram-Reassembly-Sz 22 VALUE DHCP-Parameter-Request-List DHCP-Default-IP-TTL 23 VALUE DHCP-Parameter-Request-List DHCP-Path-MTU-Aging-Timeout 24 VALUE DHCP-Parameter-Request-List DHCP-Path-MTU-Plateau-Table 25 VALUE DHCP-Parameter-Request-List DHCP-Interface-MTU-Size 26 VALUE DHCP-Parameter-Request-List DHCP-All-Subnets-Are-Local 27 VALUE DHCP-Parameter-Request-List DHCP-Broadcast-Address 28 VALUE DHCP-Parameter-Request-List DHCP-Perform-Mask-Discovery 29 VALUE DHCP-Parameter-Request-List DHCP-Provide-Mask-To-Others 30 VALUE DHCP-Parameter-Request-List DHCP-Perform-Router-Discovery 31 VALUE DHCP-Parameter-Request-List DHCP-Router-Solicitation-Address 32 VALUE DHCP-Parameter-Request-List DHCP-Static-Routes 33 VALUE DHCP-Parameter-Request-List DHCP-Trailer-Encapsulation 34 VALUE DHCP-Parameter-Request-List DHCP-ARP-Cache-Timeout 35 VALUE DHCP-Parameter-Request-List DHCP-Ethernet-Encapsulation 36 VALUE DHCP-Parameter-Request-List DHCP-Default-TCP-TTL 37 VALUE DHCP-Parameter-Request-List DHCP-Keep-Alive-Interval 38 VALUE DHCP-Parameter-Request-List DHCP-Keep-Alive-Garbage 39 VALUE DHCP-Parameter-Request-List DHCP-NIS-Domain-Name 40 VALUE DHCP-Parameter-Request-List DHCP-NIS-Servers 41 VALUE DHCP-Parameter-Request-List DHCP-NTP-Servers 42 VALUE DHCP-Parameter-Request-List DHCP-Vendor 43 VALUE DHCP-Parameter-Request-List DHCP-NETBIOS-Name-Servers 44 VALUE DHCP-Parameter-Request-List DHCP-NETBIOS-Dgm-Dist-Servers 45 VALUE DHCP-Parameter-Request-List DHCP-NETBIOS-Node-Type 46 VALUE DHCP-Parameter-Request-List DHCP-NETBIOS 47 VALUE DHCP-Parameter-Request-List DHCP-X-Window-Font-Server 48 VALUE DHCP-Parameter-Request-List DHCP-X-Window-Display-Mgr 49 VALUE DHCP-Parameter-Request-List DHCP-Requested-IP-Address 50 VALUE DHCP-Parameter-Request-List DHCP-IP-Address-Lease-Time 51 VALUE DHCP-Parameter-Request-List DHCP-Overload 52 VALUE DHCP-Parameter-Request-List DHCP-Message-Type 53 VALUE DHCP-Parameter-Request-List DHCP-DHCP-Server-Identifier 54 VALUE DHCP-Parameter-Request-List DHCP-Parameter-Request-List 55 VALUE DHCP-Parameter-Request-List DHCP-DHCP-Error-Message 56 VALUE DHCP-Parameter-Request-List DHCP-DHCP-Maximum-Msg-Size 57 VALUE DHCP-Parameter-Request-List DHCP-Renewal-Time 58 VALUE DHCP-Parameter-Request-List DHCP-Rebinding-Time 59 VALUE DHCP-Parameter-Request-List DHCP-Class-Identifier 60 VALUE DHCP-Parameter-Request-List DHCP-Client-Identifier 61 VALUE DHCP-Parameter-Request-List DHCP-Netware-Domain-Name 62 VALUE DHCP-Parameter-Request-List DHCP-Netware-Sub-Options 63 VALUE DHCP-Parameter-Request-List DHCP-NIS-Client-Domain-Name 64 VALUE DHCP-Parameter-Request-List DHCP-NIS-Server-Address 65 VALUE DHCP-Parameter-Request-List DHCP-TFTP-Server-Name 66 VALUE DHCP-Parameter-Request-List DHCP-Boot-File-Name 67 VALUE DHCP-Parameter-Request-List DHCP-Home-Agent-Address 68 VALUE DHCP-Parameter-Request-List DHCP-SMTP-Server-Address 69 VALUE DHCP-Parameter-Request-List DHCP-POP3-Server-Address 70 VALUE DHCP-Parameter-Request-List DHCP-NNTP-Server-Address 71 VALUE DHCP-Parameter-Request-List DHCP-WWW-Server-Address 72 VALUE DHCP-Parameter-Request-List DHCP-Finger-Server-Address 73 VALUE DHCP-Parameter-Request-List DHCP-IRC-Server-Address 74 VALUE DHCP-Parameter-Request-List DHCP-StreetTalk-Server-Address 75 VALUE DHCP-Parameter-Request-List DHCP-STDA-Server-Address 76 VALUE DHCP-Parameter-Request-List DHCP-User-Class 77 VALUE DHCP-Parameter-Request-List DHCP-Directory-Agent 78 VALUE DHCP-Parameter-Request-List DHCP-Service-Scope 79 VALUE DHCP-Parameter-Request-List DHCP-Rapid-Commit 80 VALUE DHCP-Parameter-Request-List DHCP-Client-FQDN 81 VALUE DHCP-Parameter-Request-List DHCP-Relay-Agent-Information 82 VALUE DHCP-Parameter-Request-List DHCP-iSNS 83 VALUE DHCP-Parameter-Request-List DHCP-NDS-Servers 85 VALUE DHCP-Parameter-Request-List DHCP-NDS-Tree-Name 86 VALUE DHCP-Parameter-Request-List DHCP-NDS-Context 87 VALUE DHCP-Parameter-Request-List DHCP-Authentication 90 VALUE DHCP-Parameter-Request-List DHCP-Client-Last-Txn-Time 91 VALUE DHCP-Parameter-Request-List DHCP-associated-ip 92 VALUE DHCP-Parameter-Request-List DHCP-Client-System 93 VALUE DHCP-Parameter-Request-List DHCP-Client-NDI 94 VALUE DHCP-Parameter-Request-List DHCP-LDAP 95 VALUE DHCP-Parameter-Request-List DHCP-UUID/GUID 97 VALUE DHCP-Parameter-Request-List DHCP-User-Auth 98 VALUE DHCP-Parameter-Request-List DHCP-Netinfo-Address 112 VALUE DHCP-Parameter-Request-List DHCP-Netinfo-Tag 113 VALUE DHCP-Parameter-Request-List DHCP-URL 114 VALUE DHCP-Parameter-Request-List DHCP-Auto-Config 116 VALUE DHCP-Parameter-Request-List DHCP-Name-Service-Search 117 VALUE DHCP-Parameter-Request-List DHCP-Subnet-Selection-Option 118 VALUE DHCP-Parameter-Request-List DHCP-Domain-Search 119 VALUE DHCP-Parameter-Request-List DHCP-SIP-Servers-DHCP-Option 120 VALUE DHCP-Parameter-Request-List DHCP-Classless-Static-Route 121 VALUE DHCP-Parameter-Request-List DHCP-CCC 122 VALUE DHCP-Parameter-Request-List DHCP-GeoConf-Option 123 VALUE DHCP-Parameter-Request-List DHCP-V-I-Vendor-Class 124 VALUE DHCP-Parameter-Request-List DHCP-V-I-Vendor-Specific 125 VALUE DHCP-Parameter-Request-List DHCP-Etherboot 128 VALUE DHCP-Parameter-Request-List DHCP-TFTP-Server-IP-Address 128 VALUE DHCP-Parameter-Request-List DHCP-Call-Server-IP-address 129 VALUE DHCP-Parameter-Request-List DHCP-Ethernet-Interface 130 VALUE DHCP-Parameter-Request-List DHCP-Vendor-Discrimination-Str 130 VALUE DHCP-Parameter-Request-List DHCP-Remote-Stats-Svr-IP-Address 131 VALUE DHCP-Parameter-Request-List DHCP-IEEE-802.1P-VLAN-ID 132 VALUE DHCP-Parameter-Request-List DHCP-IEEE-802.1Q-L2-Priority 133 VALUE DHCP-Parameter-Request-List DHCP-Diffserv-Code-Point 134 VALUE DHCP-Parameter-Request-List DHCP-HTTP-Proxy 135 END-VENDOR DHCP freeradius-server/share/dictionary.digium000066400000000000000000000022621257552170400211740ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2011 The FreeRADIUS Server project and contributors ############################################################################## # # Digium's Asterisk specific radius attributes # markster@digium.com # # http://bugs.digium.com/file_download.php\?file_id=9688\&type=bug # # $Id$ # ############################################################################## VENDOR Digium 22736 BEGIN-VENDOR Digium ATTRIBUTE Asterisk-Acc-Code 101 string ATTRIBUTE Asterisk-Src 102 string ATTRIBUTE Asterisk-Dst 103 string ATTRIBUTE Asterisk-Dst-Ctx 104 string ATTRIBUTE Asterisk-Clid 105 string ATTRIBUTE Asterisk-Chan 106 string ATTRIBUTE Asterisk-Dst-Chan 107 string ATTRIBUTE Asterisk-Last-App 108 string ATTRIBUTE Asterisk-Last-Data 109 string ATTRIBUTE Asterisk-Start-Time 110 string ATTRIBUTE Asterisk-Answer-Time 111 string ATTRIBUTE Asterisk-End-Time 112 string ATTRIBUTE Asterisk-Duration 113 integer ATTRIBUTE Asterisk-Bill-Sec 114 integer ATTRIBUTE Asterisk-Disposition 115 string ATTRIBUTE Asterisk-AMA-Flags 116 string ATTRIBUTE Asterisk-Unique-ID 117 string ATTRIBUTE Asterisk-User-Field 118 string END-VENDOR Digium freeradius-server/share/dictionary.dlink000066400000000000000000000020101257552170400210060ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2013 The FreeRADIUS Server project and contributors ############################################################################## # # D-Link Vendor Specific Attributes Dictionary # # Created by Sylph Lin # # Version $Id$ # ############################################################################## VENDOR Dlink 171 BEGIN-VENDOR Dlink ATTRIBUTE Dlink-User-Level 1 integer ATTRIBUTE Dlink-Ingress-Bandwidth-Assignment 2 integer ATTRIBUTE Dlink-Egress-Bandwidth-Assignment 3 integer ATTRIBUTE Dlink-1p-Priority 4 integer ATTRIBUTE Dlink-VLAN-Name 10 string ATTRIBUTE Dlink-VLAN-ID 11 string ATTRIBUTE Dlink-ACL-Profile 12 string ATTRIBUTE Dlink-ACL-Rule 13 string ATTRIBUTE Dlink-ACL-Script 14 string VALUE Dlink-User-Level User-Legacy 1 VALUE Dlink-User-Level User 3 VALUE Dlink-User-Level Operator 4 VALUE Dlink-User-Level Admin 5 VALUE Dlink-User-Level Power-User 6 VALUE Dlink-User-Level Admin-Legacy 15 END-VENDOR Dlink freeradius-server/share/dictionary.dragonwave000066400000000000000000000013621257552170400220530ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2014 The FreeRADIUS Server project and contributors ############################################################################## # # Dragonwave # http://www.dragonwaveinc.comw # # $Id$ # ############################################################################## VENDOR DragonWave 7262 BEGIN-VENDOR DragonWave # Used to determine the user login privilege level. ATTRIBUTE DragonWave-Privilege-Level 1 integer # Read-only access. VALUE DragonWave-Privilege-Level DragonWave-Admin-User 1 # Limited read-write access. VALUE DragonWave-Privilege-Level DragonWave-NOC-User 2 # Unlimited read-write access. VALUE DragonWave-Privilege-Level DragonWave-Super-User 3 END-VENDOR DragonWave freeradius-server/share/dictionary.efficientip000066400000000000000000000016511257552170400222040ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2013 The FreeRADIUS Server project and contributors ############################################################################## # # Efficient IP VSA's # # $Id$ # ############################################################################## VENDOR EfficientIP 2440 BEGIN-VENDOR EfficientIP ATTRIBUTE EfficientIP-Version 1 integer ATTRIBUTE EfficientIP-Service-Class 2 integer ATTRIBUTE EfficientIP-Identity-Type 3 integer ATTRIBUTE EfficientIP-First-Name 16 string ATTRIBUTE EfficientIP-Last-Name 17 string ATTRIBUTE EfficientIP-Pseudonym 18 string ATTRIBUTE EfficientIP-IP-Host 19 string ATTRIBUTE EfficientIP-Email 20 string ATTRIBUTE EfficientIP-First-Login-Path 32 string ATTRIBUTE EfficientIP-Maintainer-Group 33 string ATTRIBUTE EfficientIP-Groups 34 string ATTRIBUTE EfficientIP-Admin-Group 35 string ATTRIBUTE EfficientIP-Extra-Blob 64 string END-VENDOR EfficientIP freeradius-server/share/dictionary.eltex000066400000000000000000000015211257552170400210340ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2011 The FreeRADIUS Server project and contributors # # dictionary.eltex # VENDOR Eltex 35265 BEGIN-VENDOR Eltex ATTRIBUTE Eltex-AVPair 1 string ATTRIBUTE Eltex-Disconnect-Code-Local 11 integer VALUE Eltex-Disconnect-Code-Local User-Answer 1 VALUE Eltex-Disconnect-Code-Local Incomplete-Number 2 VALUE Eltex-Disconnect-Code-Local Unassigned-Number 3 VALUE Eltex-Disconnect-Code-Local Unsuccesfull-Other-Cause 4 VALUE Eltex-Disconnect-Code-Local User-Busy 5 VALUE Eltex-Disconnect-Code-Local Out-of-Order 6 VALUE Eltex-Disconnect-Code-Local No-Answer 7 VALUE Eltex-Disconnect-Code-Local Unavailable-Trunk 8 VALUE Eltex-Disconnect-Code-Local Access-Denied 9 VALUE Eltex-Disconnect-Code-Local Unavailable-Voice-Channel 10 VALUE Eltex-Disconnect-Code-Local RADIUS-Server-Unavailable 11 END-VENDOR Eltex freeradius-server/share/dictionary.epygi000066400000000000000000000103661257552170400210370ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2011 The FreeRADIUS Server project and contributors # # dictionary.Epygi # VENDOR Epygi 16459 # # Standard attribute # BEGIN-VENDOR Epygi ATTRIBUTE Epygi-AVPair 1 string ATTRIBUTE Epygi-NAS-Port 2 string # # Voice over IP attributes. # ATTRIBUTE Epygi-h323-remote-address 23 string ATTRIBUTE Epygi-h323-conf-id 24 string ATTRIBUTE Epygi-h323-setup-time 25 string ATTRIBUTE Epygi-h323-call-origin 26 string ATTRIBUTE Epygi-h323-call-type 27 string ATTRIBUTE Epygi-h323-connect-time 28 string ATTRIBUTE Epygi-h323-disconnect-time 29 string ATTRIBUTE Epygi-h323-disconnect-cause 30 string ATTRIBUTE Epygi-h323-voice-quality 31 string ATTRIBUTE Epygi-h323-gw-id 33 string ATTRIBUTE Epygi-h323-incoming-conf-id 35 string ATTRIBUTE Epygi-h323-credit-amount 101 string ATTRIBUTE Epygi-h323-credit-time 102 string ATTRIBUTE Epygi-h323-return-code 103 string ATTRIBUTE Epygi-h323-prompt-id 104 string ATTRIBUTE Epygi-h323-time-and-day 105 string ATTRIBUTE Epygi-h323-redirect-number 106 string ATTRIBUTE Epygi-h323-preferred-lang 107 string ATTRIBUTE Epygi-h323-redirect-ip-address 108 string ATTRIBUTE Epygi-h323-billing-model 109 string ATTRIBUTE Epygi-h323-currency 110 string ATTRIBUTE Epygi-RegExpDate 150 string ATTRIBUTE Epygi-FiadID 151 string ATTRIBUTE Epygi-PortID 152 string ATTRIBUTE Epygi-AccessType 153 string ATTRIBUTE Epygi-CallInfo 154 string ATTRIBUTE Epygi-OrigCallID 170 string ATTRIBUTE Epygi-ParentCallID 171 string ATTRIBUTE Epygi-CallType 172 integer ATTRIBUTE Epygi-DeviceName 173 string ATTRIBUTE Epygi-InterfaceName 174 integer ATTRIBUTE Epygi-InterfaceNumber 175 integer ATTRIBUTE Epygi-TimeslotNumber 176 integer ATTRIBUTE Epygi-OrigIpAddr 177 integer ATTRIBUTE Epygi-DestIpAddr 178 integer ATTRIBUTE Epygi-OrigIpPort 179 integer ATTRIBUTE Epygi-DestIpPort 180 integer ATTRIBUTE Epygi-CallingPartyNumber 181 string ATTRIBUTE Epygi-CalledPartyNumber 182 string ATTRIBUTE Epygi-DateTimeOrigination 183 integer ATTRIBUTE Epygi-DateTimeConnect 184 integer ATTRIBUTE Epygi-DateTimeDisconnect 185 integer ATTRIBUTE Epygi-Duration 186 integer ATTRIBUTE Epygi-OutSourceRTP_IP 187 integer ATTRIBUTE Epygi-OutDestRTP_IP 188 integer ATTRIBUTE Epygi-InSourceRTP_IP 189 integer ATTRIBUTE Epygi-InDestRTP_IP 190 integer ATTRIBUTE Epygi-OutSourceRTP_port 191 integer ATTRIBUTE Epygi-OutDestRTP_port 192 integer ATTRIBUTE Epygi-InSourceRTP_port 193 integer ATTRIBUTE Epygi-InDestRTP_port 194 integer ATTRIBUTE Epygi-CallRedirectReason 195 integer ATTRIBUTE Epygi-CallDisconnectReason 196 integer ATTRIBUTE Epygi-OutRTP_Payload 197 integer ATTRIBUTE Epygi-OutRTP_PacketSize 198 integer ATTRIBUTE Epygi-OutRTP_Packets 199 integer ATTRIBUTE Epygi-OutRTP_Octets 200 integer ATTRIBUTE Epygi-InRTP_Payload 201 integer ATTRIBUTE Epygi-InRTP_PacketSize 202 integer ATTRIBUTE Epygi-InRTP_Packets 203 integer ATTRIBUTE Epygi-InRTP_Octets 204 integer ATTRIBUTE Epygi-InRTP_PacketsLost 205 integer ATTRIBUTE Epygi-InRTP_PacketsDupl 206 integer ATTRIBUTE Epygi-InRTP_Jitter 207 integer ATTRIBUTE Epygi-InRTP_Latency 208 integer VALUE Epygi-CallType Internal 0 VALUE Epygi-CallType SIP 1 VALUE Epygi-CallType H.323 2 VALUE Epygi-CallType FXO 3 VALUE Epygi-CallType T1-E1-CAS 4 VALUE Epygi-CallType T1-E1-CCS 5 VALUE Epygi-CallType ISDN-PRI 6 VALUE Epygi-InterfaceName Ethernet 0 VALUE Epygi-InterfaceName FXO 1 VALUE Epygi-InterfaceName T1-E1-User 2 VALUE Epygi-InterfaceName T1-E1-Network 3 VALUE Epygi-InterfaceName ISDN 4 VALUE Epygi-CallRedirectReason No-Reason 0 VALUE Epygi-CallRedirectReason Call-Forward-Uncondit 1 VALUE Epygi-CallRedirectReason Call-Forward-Busy 2 VALUE Epygi-CallRedirectReason Call-Forward-NoAnswer 3 VALUE Epygi-CallRedirectReason Call-Tranfer 4 VALUE Epygi-CallRedirectReason Call-Park 5 VALUE Epygi-CallRedirectReason Call-Pickup 6 VALUE Epygi-CallRedirectReason ManyExtension-Ringing 7 VALUE Epygi-CallRedirectReason Hunt-Group 8 VALUE Epygi-CallDisconnectReason Call-Is-Redirected 0 VALUE Epygi-CallDisconnectReason Call-Origin-OnHook 1 VALUE Epygi-CallDisconnectReason Call-Temin-OnHook 2 VALUE Epygi-CallDisconnectReason Disconected-by-CAC 3 VALUE Epygi-CallDisconnectReason Other 4 END-VENDOR Epygi freeradius-server/share/dictionary.ericsson000066400000000000000000000141671257552170400215520ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2011 The FreeRADIUS Server project and contributors ############################################################################## # # Ericsson dictionary # # $Id$ # ############################################################################## VENDOR Ericsson 193 BEGIN-VENDOR Ericsson ATTRIBUTE Ericsson-ViG-Balance 3 integer ATTRIBUTE Ericsson-ViG-Codec 4 integer ATTRIBUTE Ericsson-ViG-Currency 5 string ATTRIBUTE Ericsson-ViG-Currency-Quote 6 string ATTRIBUTE Ericsson-ViG-Endpoint-Type 8 integer ATTRIBUTE Ericsson-ViG-Sequence-Number 9 integer ATTRIBUTE Ericsson-ViG-Access-Agent-IP-Address 11 ipaddr ATTRIBUTE Ericsson-ViG-QoS-Class 12 integer # # These next two attributes look to be similar to Digest-Response (206) and # Digest-Attributes (207) # ATTRIBUTE Ericsson-ViG-Digest-Response 14 string ATTRIBUTE Ericsson-ViG-Digest-Attributes 15 octets ATTRIBUTE Ericsson-ViG-Business-Agreement-Name 16 string ATTRIBUTE Ericsson-ViG-Call-Role 17 integer ATTRIBUTE Ericsson-ViG-Remote-SK-UA-IP-Address 20 ipaddr ATTRIBUTE Ericsson-ViG-Site 23 string ATTRIBUTE Ericsson-ViG-TTL-relative 32 integer ATTRIBUTE Ericsson-ViG-Account-error-reason 33 integer ATTRIBUTE Ericsson-ViG-Layer-identity 34 integer ATTRIBUTE Ericsson-ViG-Major-protocol-version 35 integer ATTRIBUTE Ericsson-ViG-Minor-protocol-version 36 integer ATTRIBUTE Ericsson-ViG-Authentication-type 37 integer ATTRIBUTE Ericsson-ViG-Trusted-access 38 integer ATTRIBUTE Ericsson-ViG-User-name 39 string ATTRIBUTE Ericsson-ViG-Global-unique-call-ID 40 string ATTRIBUTE Ericsson-ViG-Global-unique-service-ID 41 string ATTRIBUTE Ericsson-ViG-Interim-interval 42 integer ATTRIBUTE Ericsson-ViG-Alive-Indicator 43 integer ATTRIBUTE Ericsson-ViG-TTL-Absolute 44 integer ATTRIBUTE Ericsson-ViG-TTL-Start-Event 45 integer ATTRIBUTE Ericsson-ViG-SK-IP-address 46 ipaddr ATTRIBUTE Ericsson-ViG-UA-IP-address 47 ipaddr ATTRIBUTE Ericsson-ViG-SA-IP-address 48 ipaddr ATTRIBUTE Ericsson-ViG-Calling-e164-number 49 string ATTRIBUTE Ericsson-ViG-Calling-H323Id 50 string ATTRIBUTE Ericsson-ViG-Calling-Email-address 51 string ATTRIBUTE Ericsson-ViG-Dialled-e164-number 52 string ATTRIBUTE Ericsson-ViG-Dialled-H323Id 53 string ATTRIBUTE Ericsson-ViG-Dialled-Email-address 54 string ATTRIBUTE Ericsson-ViG-Routed-e164-number 55 string ATTRIBUTE Ericsson-ViG-Routed-H323Id 56 string ATTRIBUTE Ericsson-ViG-Routed-Email-address 57 string ATTRIBUTE Ericsson-ViG-SiteKeeper-name 58 string ATTRIBUTE Ericsson-ViG-Access-Group-name 59 string ATTRIBUTE Ericsson-ViG-Access-Agent-name 60 string ATTRIBUTE Ericsson-ViG-User-agent-group-name 61 string ATTRIBUTE Ericsson-ViG-User-agent-name 62 string ATTRIBUTE Ericsson-ViG-Routing-tariff 63 integer ATTRIBUTE Ericsson-ViG-Re-selection-counter 64 integer ATTRIBUTE Ericsson-ViG-CPN-digits 65 string ATTRIBUTE Ericsson-ViG-CPN-TON 66 integer ATTRIBUTE Ericsson-ViG-CPN-NP 67 integer ATTRIBUTE Ericsson-ViG-CPN-PI 68 integer ATTRIBUTE Ericsson-ViG-CPN-SI 69 integer ATTRIBUTE Ericsson-ViG-Dialled-num-digits 70 string ATTRIBUTE Ericsson-ViG-Dialled-num-TON 71 integer ATTRIBUTE Ericsson-ViG-Dialled-num-NP 72 integer ATTRIBUTE Ericsson-ViG-Routing-num-digits 73 string ATTRIBUTE Ericsson-ViG-Routing-num-TON 74 integer ATTRIBUTE Ericsson-ViG-Routing-num-NP 75 integer ATTRIBUTE Ericsson-ViG-Redirecting-num-digits 76 string ATTRIBUTE Ericsson-ViG-Redirecting-num-TON 77 integer ATTRIBUTE Ericsson-ViG-Redirecting-num-NP 78 integer ATTRIBUTE Ericsson-ViG-Redirecting-num-PI 79 integer ATTRIBUTE Ericsson-ViG-Redirecting-num-RFD 80 integer ATTRIBUTE Ericsson-ViG-Time-stamp-UTC 81 integer ATTRIBUTE Ericsson-ViG-Time-stamp-UTC 81 integer ATTRIBUTE Ericsson-ViG-Time-stamp-TZ 82 integer ATTRIBUTE Ericsson-ViG-Time-stamp-DST 83 integer ATTRIBUTE Ericsson-ViG-Session-routing-duration 84 integer ATTRIBUTE Ericsson-ViG-Session-ringing-duration 85 integer ATTRIBUTE Ericsson-ViG-Access-type 86 integer ATTRIBUTE Ericsson-ViG-Requested-bandwidth 87 integer ATTRIBUTE Ericsson-ViG-Allowed-bandwidth 88 integer ATTRIBUTE Ericsson-ViG-Media-channel-count 89 integer ATTRIBUTE Ericsson-ViG-Voice-media-rec-forward 90 string ATTRIBUTE Ericsson-ViG-Voice-media-rec-backward 91 string ATTRIBUTE Ericsson-ViG-Video-media-rec-forward 92 string ATTRIBUTE Ericsson-ViG-Video-media-rec-backward 93 string ATTRIBUTE Ericsson-ViG-Fax-media-rec-forward 94 string ATTRIBUTE Ericsson-ViG-Fax-media-rec-backward 95 string ATTRIBUTE Ericsson-ViG-Data-media-rec-forward 96 string ATTRIBUTE Ericsson-ViG-Data-media-rec-backward 97 string ATTRIBUTE Ericsson-ViG-Charging-Case 98 integer ATTRIBUTE Ericsson-ViG-Rel-cause-coding-std 99 integer ATTRIBUTE Ericsson-ViG-Rel-cause-location 100 integer ATTRIBUTE Ericsson-ViG-Rel-cause-class 101 integer ATTRIBUTE Ericsson-ViG-Rel-cause-value 102 integer ATTRIBUTE Ericsson-ViG-Rel-reason 103 integer ATTRIBUTE Ericsson-ViG-Internal-Rel-reason-val 104 integer ATTRIBUTE Ericsson-ViG-Internal-Rel-reason-orig 105 integer ATTRIBUTE Ericsson-ViG-Service-ID 106 integer ATTRIBUTE Ericsson-ViG-User-ID 107 string ATTRIBUTE Ericsson-ViG-Service-Name 108 string ATTRIBUTE Ericsson-ViG-Test-Call-Indicator 109 integer ATTRIBUTE Ericsson-ViG-Test-Call-Indicator 109 integer ATTRIBUTE Ericsson-ViG-Emergency-Call-Indicator 110 integer ATTRIBUTE Ericsson-ViG-Calling-ID 111 string ATTRIBUTE Ericsson-ViG-Called-ID 112 string ATTRIBUTE Ericsson-ViG-Translated-ID 113 string ATTRIBUTE Ericsson-ViG-Calling-User-Group-ID 114 string ATTRIBUTE Ericsson-ViG-Calling-Usr-Sub-Group-ID 115 string ATTRIBUTE Ericsson-ViG-Called-Usr-Group-ID 116 string ATTRIBUTE Ericsson-ViG-Called-Usr-Sub-Group-ID 117 string ATTRIBUTE Ericsson-ViG-Terminal-Type 118 string ATTRIBUTE Ericsson-ViG-Service-Duration 119 integer ATTRIBUTE Ericsson-ViG-Service-Execution-Result 120 integer ATTRIBUTE Ericsson-ViG-Service-Exe-Rslt-Desc 121 string ATTRIBUTE Ericsson-ViG-Service-Description 122 string ATTRIBUTE Ericsson-ViG-Service-Specific-Info 123 string ATTRIBUTE Ericsson-ViG-Proxy-IP-Address 124 ipaddr ATTRIBUTE Ericsson-ViG-Auth-DataRequest 125 integer ATTRIBUTE Ericsson-ViG-IPT-Time-Stamp 126 integer ATTRIBUTE Ericsson-ViG-User-Name-Info 127 integer END-VENDOR Ericsson freeradius-server/share/dictionary.ericsson.packet.core.networks000066400000000000000000000004561257552170400256160ustar00rootroot00000000000000# # dictionary.ericsson.packet.core.networks # VENDOR Ericsson-Packet-Core-Networks 10923 # # Ericsson specific BEGIN-VENDOR Ericsson-Packet-Core-Networks ATTRIBUTE Suggested-Rule-Space 30 string ATTRIBUTE Suggested-Secondary-Rule-Space 31 string END-VENDOR Ericsson-Packet-Core-Networks freeradius-server/share/dictionary.erx000066400000000000000000000307041257552170400205160ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2011 The FreeRADIUS Server project and contributors # # dictionary.erx # # Juniper's (was Unisphere's) broadband RAS # From Terje Krogdahl # # Version: $Id$ # # This dictionary applies to access services on Juniper JUNOS (M/MX) # based platforms as well as JUNOSe, although some of the attributes # have been given new names on JUNOS: # http://www.juniper.net/techpubs/software/junos/junos112/radius-dictionary/unisphereDictionary_for_JUNOS_v11-2.dct # http://www.juniper.net/techpubs/en_US/junos10.3/topics/reference/general/aaa-subscriber-access-radius-vsa.html # # In this file, we keep the ERX prefix and the JUNOSe attribute names # for backwards compatibility # # Juniper ERX dictionaries are available at: # http://www.juniper.net/techpubs/software/erx/junose71/unisphere7-1.dct # http://www.juniper.net/techpubs/software/erx/junose700/unisphere7-0.dct # http://www.juniper.net/techpubs/software/erx/junose700/swconfig-broadband/html/radius-attributes.html # http://www.juniper.net/techpubs/software/erx/junose52/unisphere5-2.dct # http://www.juniper.net/techpubs/software/erx/erx50x/swconfig-broadband/html/radius-attributes.html # (The below are from when it was the Unisphere ERX) # http://www.juniper.net/techpubs/software/erx/erx410/unisphere4-1.dct # http://www.juniper.net/techpubs/software/erx/erx403/unisphere4-0.dct # http://www.juniper.net/techpubs/software/erx/erx3xx/unisphere3-2.dct # http://www.juniper.net/techpubs/software/erx/erx3xx/unisphere3-0.dct # # As a note on ERX broken-ness, If you don't send a Framed-IP-Address # in the Access-Accept packet, the ERX disconnects the user, and # sends an Accounting-Request packet with Acct-Status-Type = Stop # # It does NOT send a 'Start' packet, so this behaviour confuses the # heck out of most admins, who do everything right, but have the ERX # do stupid things. # # The ERX supports Ascend "abinary" format. See: # # http://www.juniper.net/techpubs/software/erx/junose71/swconfig-policy/html/policy-mgmt-apply5.html # # For this to work in FreeRADIUS, you will have to specify the attribute # in hex, as in: # # Ascend-Data-Filter = 0x010203... # VENDOR ERX 4874 BEGIN-VENDOR ERX ATTRIBUTE ERX-Virtual-Router-Name 1 string ATTRIBUTE ERX-Address-Pool-Name 2 string ATTRIBUTE ERX-Local-Loopback-Interface 3 string ATTRIBUTE ERX-Primary-Dns 4 ipaddr ATTRIBUTE ERX-Secondary-Dns 5 ipaddr ATTRIBUTE ERX-Primary-Wins 6 ipaddr ATTRIBUTE ERX-Secondary-Wins 7 ipaddr ATTRIBUTE ERX-Tunnel-Virtual-Router 8 string ATTRIBUTE ERX-Tunnel-Password 9 string ATTRIBUTE ERX-Ingress-Policy-Name 10 string ATTRIBUTE ERX-Egress-Policy-Name 11 string ATTRIBUTE ERX-Ingress-Statistics 12 integer ATTRIBUTE ERX-Egress-Statistics 13 integer ATTRIBUTE ERX-Atm-Service-Category 14 integer ATTRIBUTE ERX-Atm-PCR 15 integer ATTRIBUTE ERX-Atm-SCR 16 integer ATTRIBUTE ERX-Atm-MBS 17 integer ATTRIBUTE ERX-Cli-Initial-Access-Level 18 string ATTRIBUTE ERX-Cli-Allow-All-VR-Access 19 integer ATTRIBUTE ERX-Alternate-Cli-Access-Level 20 string ATTRIBUTE ERX-Alternate-Cli-Vrouter-Name 21 string ATTRIBUTE ERX-Sa-Validate 22 integer ATTRIBUTE ERX-Igmp-Enable 23 integer ATTRIBUTE ERX-Pppoe-Description 24 string ATTRIBUTE ERX-Redirect-VR-Name 25 string ATTRIBUTE ERX-Qos-Profile-Name 26 string ATTRIBUTE ERX-Pppoe-Max-Sessions 27 integer ATTRIBUTE ERX-Pppoe-Url 28 string ATTRIBUTE ERX-Qos-Profile-Interface-Type 29 integer ATTRIBUTE ERX-Tunnel-Nas-Port-Method 30 integer ATTRIBUTE ERX-Service-Bundle 31 string ATTRIBUTE ERX-Tunnel-Tos 32 integer ATTRIBUTE ERX-Tunnel-Maximum-Sessions 33 integer ATTRIBUTE ERX-Framed-Ip-Route-Tag 34 string ATTRIBUTE ERX-Dial-Out-Number 35 string ATTRIBUTE ERX-PPP-Username 36 string ATTRIBUTE ERX-PPP-Password 37 string ATTRIBUTE ERX-PPP-Auth-Protocol 38 integer ATTRIBUTE ERX-Minimum-BPS 39 integer ATTRIBUTE ERX-Maximum-BPS 40 integer ATTRIBUTE ERX-Bearer-Type 41 integer ATTRIBUTE ERX-Input-Gigapkts 42 integer ATTRIBUTE ERX-Output-Gigapkts 43 integer ATTRIBUTE ERX-Tunnel-Interface-Id 44 string ATTRIBUTE ERX-IpV6-Virtual-Router 45 string ATTRIBUTE ERX-IpV6-Local-Interface 46 string ATTRIBUTE ERX-Ipv6-Primary-Dns 47 ipv6addr ATTRIBUTE ERX-Ipv6-Secondary-Dns 48 ipv6addr ATTRIBUTE Sdx-Service-Name 49 string ATTRIBUTE Sdx-Session-Volume-Quota 50 string ATTRIBUTE Sdx-Tunnel-Disconnect-Cause-Info 51 string ATTRIBUTE ERX-Radius-Client-Address 52 ipaddr ATTRIBUTE ERX-Service-Description 53 string ATTRIBUTE ERX-L2tp-Recv-Window-Size 54 integer ATTRIBUTE ERX-Dhcp-Options 55 octets ATTRIBUTE ERX-Dhcp-Mac-Addr 56 string ATTRIBUTE ERX-Dhcp-Gi-Address 57 ipaddr ATTRIBUTE ERX-LI-Action 58 integer encrypt=2 ATTRIBUTE ERX-Med-Dev-Handle 59 octets encrypt=2 ATTRIBUTE ERX-Med-Ip-Address 60 ipaddr encrypt=2 ATTRIBUTE ERX-Med-Port-Number 61 integer encrypt=2 ATTRIBUTE ERX-MLPPP-Bundle-Name 62 string ATTRIBUTE ERX-Interface-Desc 63 string ATTRIBUTE ERX-Tunnel-Group 64 string ATTRIBUTE ERX-Service-Activate 65 string has_tag ATTRIBUTE ERX-Service-Deactivate 66 string ATTRIBUTE ERX-Service-Volume 67 integer has_tag ATTRIBUTE ERX-Service-Timeout 68 integer has_tag ATTRIBUTE ERX-Service-Statistics 69 integer has_tag ATTRIBUTE ERX-DF-Bit 70 integer ATTRIBUTE ERX-IGMP-Access-Name 71 string ATTRIBUTE ERX-IGMP-Access-Src-Name 72 string ATTRIBUTE ERX-IGMP-OIF-Map-Name 73 string ATTRIBUTE ERX-MLD-Access-Name 74 string ATTRIBUTE ERX-MLD-Access-Src-Name 75 string ATTRIBUTE ERX-MLD-OIF-Map-Name 76 string ATTRIBUTE ERX-MLD-Version 77 integer ATTRIBUTE ERX-IGMP-Version 78 integer ATTRIBUTE ERX-IP-Mcast-Adm-Bw-Limit 79 integer ATTRIBUTE ERX-IPv6-Mcast-Adm-Bw-Limit 80 integer ATTRIBUTE ERX-Qos-Parameters 82 string ATTRIBUTE ERX-Service-Session 83 string ATTRIBUTE ERX-Mobile-IP-Algorithm 84 integer ATTRIBUTE ERX-Mobile-IP-SPI 85 integer ATTRIBUTE ERX-Mobile-IP-Key 86 string ATTRIBUTE ERX-Mobile-IP-Replay 87 integer ATTRIBUTE ERX-Mobile-IP-Access-Control 88 string ATTRIBUTE ERX-Mobile-IP-Lifetime 89 integer ATTRIBUTE ERX-L2TP-Resynch-Method 90 integer ATTRIBUTE ERX-Tunnel-Switch-Profile 91 string ATTRIBUTE ERX-L2c-Up-Stream-Data 92 string ATTRIBUTE ERX-L2c-Down-Stream-Data 93 string ATTRIBUTE ERX-Tunnel-Tx-Speed-Method 94 integer ATTRIBUTE ERX-IGMP-Query-Interval 95 integer ATTRIBUTE ERX-IGMP-Max-Resp-Time 96 integer ATTRIBUTE ERX-IGMP-Immediate-Leave 97 integer ATTRIBUTE ERX-MLD-Query-Interval 98 integer ATTRIBUTE ERX-MLD-Max-Resp-Time 99 integer ATTRIBUTE ERX-MLD-Immediate-Leave 100 integer ATTRIBUTE ERX-IP-Block-Multicast 101 integer ATTRIBUTE ERX-IGMP-Explicit-Tracking 102 integer ATTRIBUTE ERX-IGMP-No-Tracking-V2-Grps 103 integer ATTRIBUTE ERX-MLD-Explicit-Tracking 104 integer ATTRIBUTE ERX-MLD-No-Tracking-V1-Grps 105 integer ATTRIBUTE ERX-IPv6-Ingress-Policy-Name 106 string ATTRIBUTE ERX-IPv6-Egress-Policy-Name 107 string ATTRIBUTE ERX-CoS-Shaping-Pmt-Type 108 string ATTRIBUTE ERX-DHCP-Guided-Relay-Server 109 ipaddr ATTRIBUTE ERX-Acc-Loop-Cir-Id 110 string ATTRIBUTE ERX-Acc-Aggr-Cir-Id-Bin 111 octets ATTRIBUTE ERX-Acc-Aggr-Cir-Id-Asc 112 string ATTRIBUTE ERX-Act-Data-Rate-Up 113 integer ATTRIBUTE ERX-Act-Data-Rate-Dn 114 integer ATTRIBUTE ERX-Min-Data-Rate-Up 115 integer ATTRIBUTE ERX-Min-Data-Rate-Dn 116 integer ATTRIBUTE ERX-Att-Data-Rate-Up 117 integer ATTRIBUTE ERX-Att-Data-Rate-Dn 118 integer ATTRIBUTE ERX-Max-Data-Rate-Up 119 integer ATTRIBUTE ERX-Max-Data-Rate-Dn 120 integer ATTRIBUTE ERX-Min-LP-Data-Rate-Up 121 integer ATTRIBUTE ERX-Min-LP-Data-Rate-Dn 122 integer ATTRIBUTE ERX-Max-Interlv-Delay-Up 123 integer ATTRIBUTE ERX-Act-Interlv-Delay-Up 124 integer ATTRIBUTE ERX-Max-Interlv-Delay-Dn 125 integer ATTRIBUTE ERX-Act-Interlv-Delay-Dn 126 integer ATTRIBUTE ERX-DSL-Line-State 127 integer ATTRIBUTE ERX-DSL-Type 128 integer ATTRIBUTE ERX-IPv6-NdRa-Prefix 129 ipv6prefix ATTRIBUTE ERX-Qos-Set-Name 130 string ATTRIBUTE ERX-Service-Acct-Interval 140 integer has_tag ATTRIBUTE ERX-DownStream-Calc-Rate 141 integer ATTRIBUTE ERX-UpStream-Calc-Rate 142 integer ATTRIBUTE ERX-Max-Clients-Per-Interface 143 integer ATTRIBUTE ERX-PPP-Monitor-Ingress-Only 144 integer ATTRIBUTE ERX-CoS-Scheduler-Pmt-Type 146 string ATTRIBUTE ERX-Backup-Address-Pool 147 string ATTRIBUTE ERX-ICR-Partition-Id 150 string ATTRIBUTE ERX-IPv6-Acct-Input-Octets 151 integer ATTRIBUTE ERX-IPv6-Acct-Output-Octets 152 integer ATTRIBUTE ERX-IPv6-Acct-Input-Packets 153 integer ATTRIBUTE ERX-IPv6-Acct-Output-Packets 154 integer ATTRIBUTE ERX-IPv6-Acct-Input-Gigawords 155 integer ATTRIBUTE ERX-IPv6-Acct-Output-Gigawords 156 integer ATTRIBUTE ERX-IPv6-NdRa-Pool-Name 157 string ATTRIBUTE ERX-PppoE-Padn 158 string ATTRIBUTE ERX-Dhcp-Option-82 159 octets ATTRIBUTE ERX-Vlan-Map-Id 160 integer ATTRIBUTE ERX-IPv6-Delegated-Pool-Name 161 string ATTRIBUTE Juniper-Tx-Connect-Speed 162 integer ATTRIBUTE Juniper-Rx-Connect-Speed 163 integer # ATTRIBUTE 164 - 173 RESERVED ATTRIBUTE Unisphere-Client-Profile-Name 174 string ATTRIBUTE Juniper-Redirect-GW-Address 175 ipaddr ATTRIBUTE Juniper-APN-Name 176 string # # Values Attribute Name Number # VALUE ERX-Ingress-Statistics disable 0 VALUE ERX-Ingress-Statistics enable 1 VALUE ERX-Egress-Statistics disable 0 VALUE ERX-Egress-Statistics enable 1 VALUE ERX-Atm-Service-Category UBR 1 VALUE ERX-Atm-Service-Category UBRPCR 2 VALUE ERX-Atm-Service-Category nrtVBR 3 VALUE ERX-Atm-Service-Category CBR 4 VALUE ERX-Cli-Allow-All-VR-Access disable 0 VALUE ERX-Cli-Allow-All-VR-Access enable 1 VALUE ERX-Sa-Validate disable 0 VALUE ERX-Sa-Validate enable 1 VALUE ERX-Igmp-Enable disable 0 VALUE ERX-Igmp-Enable enable 1 VALUE ERX-Qos-Profile-Interface-Type IP 1 VALUE ERX-Qos-Profile-Interface-Type ATM 2 VALUE ERX-Qos-Profile-Interface-Type HDLC 3 VALUE ERX-Qos-Profile-Interface-Type ETHERNET 4 VALUE ERX-Qos-Profile-Interface-Type SERVER-PORT 5 VALUE ERX-Qos-Profile-Interface-Type ATM-1483 6 VALUE ERX-Qos-Profile-Interface-Type FRAME-RELAY 7 VALUE ERX-Qos-Profile-Interface-Type MPLS-MINOR 8 VALUE ERX-Qos-Profile-Interface-Type CBF 9 VALUE ERX-Qos-Profile-Interface-Type IP-TUNNEL 10 VALUE ERX-Qos-Profile-Interface-Type VLAN-SUB 11 VALUE ERX-Qos-Profile-Interface-Type PPPOE-SUB 12 VALUE ERX-Tunnel-Nas-Port-Method None 0 VALUE ERX-Tunnel-Nas-Port-Method CISCO-CLID 1 VALUE ERX-PPP-Auth-Protocol None 0 VALUE ERX-PPP-Auth-Protocol PAP 1 VALUE ERX-PPP-Auth-Protocol CHAP 2 VALUE ERX-PPP-Auth-Protocol PAP-CHAP 3 VALUE ERX-PPP-Auth-Protocol CHAP-PAP 4 VALUE ERX-Bearer-Type None 0 VALUE ERX-Bearer-Type Analog 1 VALUE ERX-Bearer-Type Digital 2 VALUE ERX-LI-Action off 0 VALUE ERX-LI-Action on 1 VALUE ERX-LI-Action noop 2 VALUE ERX-DF-Bit dont-ignore-df-bit 0 VALUE ERX-DF-Bit ignore-df-bit 1 VALUE ERX-MLD-Version v1 1 VALUE ERX-MLD-Version v2 2 VALUE ERX-IGMP-Version v1 1 VALUE ERX-IGMP-Version v2 2 VALUE ERX-IGMP-Version v3 3 VALUE ERX-Service-Statistics disabled 0 VALUE ERX-Service-Statistics time 1 VALUE ERX-Service-Statistics time-volume 2 VALUE ERX-L2TP-Resynch-Method disable 0 VALUE ERX-L2TP-Resynch-Method failover 1 VALUE ERX-L2TP-Resynch-Method silent-failover 2 VALUE ERX-L2TP-Resynch-Method failover-with-silent-backup 3 VALUE ERX-Tunnel-Tx-Speed-Method static-layer2 1 VALUE ERX-Tunnel-Tx-Speed-Method dynamic-layer2 2 VALUE ERX-Tunnel-Tx-Speed-Method qos 3 VALUE ERX-Tunnel-Tx-Speed-Method actual 4 VALUE ERX-IGMP-Immediate-Leave disabled 0 VALUE ERX-IGMP-Immediate-Leave enabled 1 VALUE ERX-MLD-Immediate-Leave disabled 0 VALUE ERX-MLD-Immediate-Leave enabled 1 VALUE ERX-IP-Block-Multicast disabled 0 VALUE ERX-IP-Block-Multicast enabled 1 VALUE ERX-IGMP-Explicit-Tracking disabled 0 VALUE ERX-IGMP-Explicit-Tracking enabled 1 VALUE ERX-IGMP-No-Tracking-V2-Grps disabled 0 VALUE ERX-IGMP-No-Tracking-V2-Grps enabled 1 VALUE ERX-MLD-Explicit-Tracking disabled 0 VALUE ERX-MLD-Explicit-Tracking enabled 1 VALUE ERX-MLD-No-Tracking-V1-Grps disabled 0 VALUE ERX-MLD-No-Tracking-V1-Grps enabled 1 VALUE ERX-DSL-Line-State SHOWTIME 1 VALUE ERX-DSL-Line-State IDLE 2 VALUE ERX-DSL-Line-State SILENT 3 VALUE ERX-DSL-Type ADSL1 1 VALUE ERX-DSL-Type ADSL2 2 VALUE ERX-DSL-Type ADSL2PLUS 3 VALUE ERX-DSL-Type VDSL1 4 VALUE ERX-DSL-Type VDSL2 5 VALUE ERX-DSL-Type SDSL 6 VALUE ERX-DSL-Type UNKNOWN 7 VALUE ERX-PPP-Monitor-Ingress-Only disabled 0 VALUE ERX-PPP-Monitor-Ingress-Only enabled 1 END-VENDOR ERX freeradius-server/share/dictionary.extreme000066400000000000000000000021031257552170400213610ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2013 The FreeRADIUS Server project and contributors # # Dictionary for Extreme Networks VSA's. # http://www.extremenetworks.com/ # # $Id$ # VENDOR Extreme 1916 BEGIN-VENDOR Extreme ATTRIBUTE Extreme-CLI-Authorization 201 integer ATTRIBUTE Extreme-Shell-Command 202 string ATTRIBUTE Extreme-Netlogin-Vlan 203 string ATTRIBUTE Extreme-Netlogin-Url 204 string ATTRIBUTE Extreme-Netlogin-Url-Desc 205 string ATTRIBUTE Extreme-Netlogin-Only 206 integer ATTRIBUTE Extreme-User-Location 208 string ATTRIBUTE Extreme-Netlogin-Vlan-Tag 209 integer ATTRIBUTE Extreme-Netlogin-Extended-Vlan 211 string ATTRIBUTE Extreme-Security-Profile 212 string ATTRIBUTE Extreme-VM-Name 213 string ATTRIBUTE Extreme-VM-VPP-Name 214 string ATTRIBUTE Extreme-VM-IP-Addr 215 ipaddr ATTRIBUTE Extreme-VM-VLAN-ID 216 integer ATTRIBUTE Extreme-VM-VR-Name 217 string VALUE Extreme-CLI-Authorization Disabled 0 VALUE Extreme-CLI-Authorization Enabled 1 VALUE Extreme-Netlogin-Only Disabled 0 VALUE Extreme-Netlogin-Only Enabled 1 END-VENDOR Extreme freeradius-server/share/dictionary.f5000066400000000000000000000033071257552170400202310ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2014 The FreeRADIUS Server project and contributors ############################################################################## # # F5 VSAs # # $Id$ # ############################################################################## VENDOR F5 3375 BEGIN-VENDOR F5 ATTRIBUTE F5-LTM-User-Role 1 integer ATTRIBUTE F5-LTM-User-Role-Universal 2 integer # enable/disable ATTRIBUTE F5-LTM-User-Partition 3 string ATTRIBUTE F5-LTM-User-Console 4 integer # enable/disable ATTRIBUTE F5-LTM-User-Shell 5 string # supported values are disable, tmsh, and bpsh ATTRIBUTE F5-LTM-User-Context-1 10 integer ATTRIBUTE F5-LTM-User-Context-2 11 integer ATTRIBUTE F5-LTM-User-Info-1 12 string ATTRIBUTE F5-LTM-User-Info-2 13 string ATTRIBUTE F5-LTM-Audit-Msg 14 string VALUE F5-LTM-User-Role Administrator 0 VALUE F5-LTM-User-Role Resource-Admin 20 VALUE F5-LTM-User-Role User-Manager 40 VALUE F5-LTM-User-Role Manager 100 VALUE F5-LTM-User-Role App-Editor 300 VALUE F5-LTM-User-Role Advanced-Operator 350 VALUE F5-LTM-User-Role Operator 400 VALUE F5-LTM-User-Role Firewall-Manager 450 VALUE F5-LTM-User-Role Fraud-Protection-Manager 480 VALUE F5-LTM-User-Role Certificate-Manager 500 VALUE F5-LTM-User-Role IRule-Manager 510 VALUE F5-LTM-User-Role Guest 700 VALUE F5-LTM-User-Role Web-Application-Security-Administrator 800 VALUE F5-LTM-User-Role Web-Application-Security-Editor 810 VALUE F5-LTM-User-Role Acceleration-Policy-Editor 850 VALUE F5-LTM-User-Role No-Access 900 VALUE F5-LTM-User-Role-Universal Disabled 0 VALUE F5-LTM-User-Role-Universal Enabled 1 VALUE F5-LTM-User-Console Disabled 0 VALUE F5-LTM-User-Console Enabled 1 END-VENDOR F5 freeradius-server/share/dictionary.fdxtended000066400000000000000000000010571257552170400216640ustar00rootroot00000000000000VENDOR fdXtended 34536 BEGIN-VENDOR fdXtended ATTRIBUTE fdXtended-Bandwidth-Up 1 integer ATTRIBUTE fdXtended-Bandwidth-Down 2 integer ATTRIBUTE fdXtended-PostAuthURL 3 string ATTRIBUTE fdXtended-One2onenat-IP 4 string ATTRIBUTE fdXtended-ContentFilter 5 integer ATTRIBUTE fdXtended-NetworkPolicy 6 integer ATTRIBUTE fdXtended-BytesDown 7 integer ATTRIBUTE fdXtended-BytesUp 8 integer ATTRIBUTE fdXtended-Expiration 9 string ATTRIBUTE fdXtended-SessionTimeout 10 integer ATTRIBUTE fdXtended-Wan-Interface 11 string END-VENDOR fdXtended freeradius-server/share/dictionary.fortinet000066400000000000000000000012751257552170400215530ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2011 The FreeRADIUS Server project and contributors ############################################################################## # # Fortinet's VSA's # As posted to the list by Richie Lee. # # $Id$ # ############################################################################## # # Fortinet's VSA's # VENDOR Fortinet 12356 BEGIN-VENDOR Fortinet ATTRIBUTE Fortinet-Group-Name 1 string ATTRIBUTE Fortinet-Client-IP-Address 2 ipaddr ATTRIBUTE Fortinet-Vdom-Name 3 string ATTRIBUTE Fortinet-Client-IPv6-Address 4 octets ATTRIBUTE Fortinet-Interface-Name 5 string ATTRIBUTE Fortinet-Access-Profile 6 string # # Integer Translations # END-VENDOR Fortinet freeradius-server/share/dictionary.foundry000066400000000000000000000033621257552170400214060ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2011 The FreeRADIUS Server project and contributors # # dictionary.foundry # # As posted to the list by Thomas Keitel # # Version: $Id$ # VENDOR Foundry 1991 BEGIN-VENDOR Foundry ATTRIBUTE Foundry-Privilege-Level 1 integer ATTRIBUTE Foundry-Command-String 2 string ATTRIBUTE Foundry-Command-Exception-Flag 3 integer ATTRIBUTE Foundry-INM-Privilege 4 integer ATTRIBUTE Foundry-Access-List 5 string ATTRIBUTE Foundry-MAC-Authent-needs-802.1x 6 integer ATTRIBUTE Foundry-802.1x-Valid-Lookup 7 integer ATTRIBUTE Foundry-MAC-Based-Vlan-QoS 8 integer ATTRIBUTE Foundry-INM-Role-Aor-List 9 string VALUE Foundry-INM-Privilege AAA_pri_0 0 VALUE Foundry-INM-Privilege AAA_pri_1 1 VALUE Foundry-INM-Privilege AAA_pri_2 2 VALUE Foundry-INM-Privilege AAA_pri_3 3 VALUE Foundry-INM-Privilege AAA_pri_4 4 VALUE Foundry-INM-Privilege AAA_pri_5 5 VALUE Foundry-INM-Privilege AAA_pri_6 6 VALUE Foundry-INM-Privilege AAA_pri_7 7 VALUE Foundry-INM-Privilege AAA_pri_8 8 VALUE Foundry-INM-Privilege AAA_pri_9 9 VALUE Foundry-INM-Privilege AAA_pri_10 10 VALUE Foundry-INM-Privilege AAA_pri_11 11 VALUE Foundry-INM-Privilege AAA_pri_12 12 VALUE Foundry-INM-Privilege AAA_pri_13 13 VALUE Foundry-INM-Privilege AAA_pri_14 14 VALUE Foundry-INM-Privilege AAA_pri_15 15 VALUE Foundry-MAC-Based-Vlan-QoS QoS_priority_0 0 VALUE Foundry-MAC-Based-Vlan-QoS QoS_priority_1 1 VALUE Foundry-MAC-Based-Vlan-QoS QoS_priority_2 2 VALUE Foundry-MAC-Based-Vlan-QoS QoS_priority_3 3 VALUE Foundry-MAC-Based-Vlan-QoS QoS_priority_4 4 VALUE Foundry-MAC-Based-Vlan-QoS QoS_priority_5 5 VALUE Foundry-MAC-Based-Vlan-QoS QoS_priority_6 6 VALUE Foundry-MAC-Based-Vlan-QoS QoS_priority_7 7 END-VENDOR Foundry freeradius-server/share/dictionary.freeradius000066400000000000000000000122421257552170400220460ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2011 The FreeRADIUS Server project and contributors # # The FreeRADIUS Vendor-Specific dictionary. # # Version: $Id$ # # For a complete list of Private Enterprise Codes, see: # # http://www.isi.edu/in-notes/iana/assignments/enterprise-numbers # VENDOR FreeRADIUS 11344 BEGIN-VENDOR FreeRADIUS ATTRIBUTE FreeRADIUS-Proxied-To 1 ipaddr ATTRIBUTE FreeRADIUS-Acct-Session-Start-Time 2 date # # This attribute is really a bitmask. # ATTRIBUTE FreeRADIUS-Statistics-Type 127 integer VALUE FreeRADIUS-Statistics-Type None 0 VALUE FreeRADIUS-Statistics-Type Authentication 1 VALUE FreeRADIUS-Statistics-Type Accounting 2 VALUE FreeRADIUS-Statistics-Type Proxy-Authentication 4 VALUE FreeRADIUS-Statistics-Type Proxy-Accounting 8 VALUE FreeRADIUS-Statistics-Type Internal 0x10 VALUE FreeRADIUS-Statistics-Type Client 0x20 VALUE FreeRADIUS-Statistics-Type Server 0x40 VALUE FreeRADIUS-Statistics-Type Home-Server 0x80 VALUE FreeRADIUS-Statistics-Type Auth-Acct 0x03 VALUE FreeRADIUS-Statistics-Type Proxy-Auth-Acct 0x0c VALUE FreeRADIUS-Statistics-Type All 0x1f # # Global authentication statistics for packets received by the server. # ATTRIBUTE FreeRADIUS-Total-Access-Requests 128 integer ATTRIBUTE FreeRADIUS-Total-Access-Accepts 129 integer ATTRIBUTE FreeRADIUS-Total-Access-Rejects 130 integer ATTRIBUTE FreeRADIUS-Total-Access-Challenges 131 integer ATTRIBUTE FreeRADIUS-Total-Auth-Responses 132 integer ATTRIBUTE FreeRADIUS-Total-Auth-Duplicate-Requests 133 integer ATTRIBUTE FreeRADIUS-Total-Auth-Malformed-Requests 134 integer ATTRIBUTE FreeRADIUS-Total-Auth-Invalid-Requests 135 integer ATTRIBUTE FreeRADIUS-Total-Auth-Dropped-Requests 136 integer ATTRIBUTE FreeRADIUS-Total-Auth-Unknown-Types 137 integer # # Global statistics for auth packets sent by the server to all home servers # ATTRIBUTE FreeRADIUS-Total-Proxy-Access-Requests 138 integer ATTRIBUTE FreeRADIUS-Total-Proxy-Access-Accepts 139 integer ATTRIBUTE FreeRADIUS-Total-Proxy-Access-Rejects 140 integer ATTRIBUTE FreeRADIUS-Total-Proxy-Access-Challenges 141 integer ATTRIBUTE FreeRADIUS-Total-Proxy-Auth-Responses 142 integer ATTRIBUTE FreeRADIUS-Total-Proxy-Auth-Duplicate-Requests 143 integer ATTRIBUTE FreeRADIUS-Total-Proxy-Auth-Malformed-Requests 144 integer ATTRIBUTE FreeRADIUS-Total-Proxy-Auth-Invalid-Requests 145 integer ATTRIBUTE FreeRADIUS-Total-Proxy-Auth-Dropped-Requests 146 integer ATTRIBUTE FreeRADIUS-Total-Proxy-Auth-Unknown-Types 147 integer # # Global accounting statistics for packets received by the server. # ATTRIBUTE FreeRADIUS-Total-Accounting-Requests 148 integer ATTRIBUTE FreeRADIUS-Total-Accounting-Responses 149 integer ATTRIBUTE FreeRADIUS-Total-Acct-Duplicate-Requests 150 integer ATTRIBUTE FreeRADIUS-Total-Acct-Malformed-Requests 151 integer ATTRIBUTE FreeRADIUS-Total-Acct-Invalid-Requests 152 integer ATTRIBUTE FreeRADIUS-Total-Acct-Dropped-Requests 153 integer ATTRIBUTE FreeRADIUS-Total-Acct-Unknown-Types 154 integer # # Global statistics for acct packets sent by the server to all home servers # ATTRIBUTE FreeRADIUS-Total-Proxy-Accounting-Requests 155 integer ATTRIBUTE FreeRADIUS-Total-Proxy-Accounting-Responses 156 integer ATTRIBUTE FreeRADIUS-Total-Proxy-Acct-Duplicate-Requests 157 integer ATTRIBUTE FreeRADIUS-Total-Proxy-Acct-Malformed-Requests 158 integer ATTRIBUTE FreeRADIUS-Total-Proxy-Acct-Invalid-Requests 159 integer ATTRIBUTE FreeRADIUS-Total-Proxy-Acct-Dropped-Requests 160 integer ATTRIBUTE FreeRADIUS-Total-Proxy-Acct-Unknown-Types 161 integer # # Internal queues. Different packet types are put into different queues. # ATTRIBUTE FreeRADIUS-Queue-Len-Internal 162 integer ATTRIBUTE FreeRADIUS-Queue-Len-Proxy 163 integer ATTRIBUTE FreeRADIUS-Queue-Len-Auth 164 integer ATTRIBUTE FreeRADIUS-Queue-Len-Acct 165 integer ATTRIBUTE FreeRADIUS-Queue-Len-Detail 166 integer ATTRIBUTE FreeRADIUS-Stats-Client-IP-Address 167 ipaddr ATTRIBUTE FreeRADIUS-Stats-Client-Number 168 integer ATTRIBUTE FreeRADIUS-Stats-Client-Netmask 169 integer ATTRIBUTE FreeRADIUS-Stats-Server-IP-Address 170 ipaddr ATTRIBUTE FreeRADIUS-Stats-Server-Port 171 integer ATTRIBUTE FreeRADIUS-Stats-Server-Outstanding-Requests 172 integer ATTRIBUTE FreeRADIUS-Stats-Server-State 173 integer VALUE FreeRADIUS-Stats-Server-State Alive 0 VALUE FreeRADIUS-Stats-Server-State Zombie 1 VALUE FreeRADIUS-Stats-Server-State Dead 2 # # When a home server is marked "dead" or "alive" # ATTRIBUTE FreeRADIUS-Stats-Server-Time-Of-Death 174 date ATTRIBUTE FreeRADIUS-Stats-Server-Time-Of-Life 175 date # # When this server was started. If start == hup, it hasn't been # hup'd yet. This is friendlier than having hup == 0 on start. # ATTRIBUTE FreeRADIUS-Stats-Start-Time 176 date ATTRIBUTE FreeRADIUS-Stats-HUP-Time 177 date # # Exponential moving average of home server response time # Window-1 is the average is calculated over "window" packets. # Window-10 is the average is calculated over "10 * window" packets. # # Both Window-1 and Window-10 are times in microseconds # (1/1000000 of a second). # ATTRIBUTE FreeRADIUS-Server-EMA-Window 178 integer ATTRIBUTE FreeRADIUS-Server-EMA-USEC-Window-1 179 integer ATTRIBUTE FreeRADIUS-Server-EMA-USEC-Window-10 180 integer END-VENDOR FreeRADIUS freeradius-server/share/dictionary.freeradius.internal000066400000000000000000000547511257552170400236740ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2011 The FreeRADIUS Server project and contributors # # Non Protocol Attributes used by FreeRADIUS # # $Id$ # # The attributes number ranges are allocates as follows: # # Range: 500-999 # server-side attributes which can go in a reply list # These attributes CAN go in the reply item list. ATTRIBUTE Fall-Through 500 integer ATTRIBUTE Relax-Filter 501 integer ATTRIBUTE Exec-Program 502 string ATTRIBUTE Exec-Program-Wait 503 string # These attributes CANNOT go in the reply item list. # # Range: 1000+ # Attributes which cannot go in a reply list. # # # Range: 1000-1199 # Miscellaneous server attributes. # # # Non-Protocol Attributes # These attributes are used internally by the server # ATTRIBUTE Auth-Type 1000 integer ATTRIBUTE Menu 1001 string ATTRIBUTE Termination-Menu 1002 string ATTRIBUTE Prefix 1003 string ATTRIBUTE Suffix 1004 string ATTRIBUTE Group 1005 string ATTRIBUTE Crypt-Password 1006 string ATTRIBUTE Connect-Rate 1007 integer ATTRIBUTE Add-Prefix 1008 string ATTRIBUTE Add-Suffix 1009 string ATTRIBUTE Expiration 1010 date ATTRIBUTE Autz-Type 1011 integer ATTRIBUTE Acct-Type 1012 integer ATTRIBUTE Session-Type 1013 integer ATTRIBUTE Post-Auth-Type 1014 integer ATTRIBUTE Pre-Proxy-Type 1015 integer ATTRIBUTE Post-Proxy-Type 1016 integer ATTRIBUTE Pre-Acct-Type 1017 integer # # This is the EAP type of authentication, which is set # by the EAP module, for informational purposes only. # ATTRIBUTE EAP-Type 1018 integer ATTRIBUTE EAP-TLS-Require-Client-Cert 1019 integer ATTRIBUTE EAP-Id 1020 integer ATTRIBUTE EAP-Code 1021 integer # Attribute 1022 unused, was EAP-MD5-Password, which was # used only be radeapclient. It's been replaced by Cleartext-Password ATTRIBUTE PEAP-Version 1023 integer ATTRIBUTE Client-Shortname 1024 string ATTRIBUTE Load-Balance-Key 1025 string ATTRIBUTE Raw-Attribute 1026 octets ATTRIBUTE TNC-VLAN-Access 1027 string ATTRIBUTE TNC-VLAN-Isolate 1028 string ATTRIBUTE User-Category 1029 string ATTRIBUTE Group-Name 1030 string ATTRIBUTE Huntgroup-Name 1031 string ATTRIBUTE Simultaneous-Use 1034 integer ATTRIBUTE Strip-User-Name 1035 integer ATTRIBUTE Hint 1040 string ATTRIBUTE Pam-Auth 1041 string ATTRIBUTE Login-Time 1042 string ATTRIBUTE Stripped-User-Name 1043 string ATTRIBUTE Current-Time 1044 string ATTRIBUTE Realm 1045 string ATTRIBUTE No-Such-Attribute 1046 string ATTRIBUTE Packet-Type 1047 integer ATTRIBUTE Proxy-To-Realm 1048 string ATTRIBUTE Replicate-To-Realm 1049 string ATTRIBUTE Acct-Session-Start-Time 1050 date ATTRIBUTE Acct-Unique-Session-Id 1051 string ATTRIBUTE Client-IP-Address 1052 ipaddr ATTRIBUTE Ldap-UserDn 1053 string ATTRIBUTE NS-MTA-MD5-Password 1054 string ATTRIBUTE SQL-User-Name 1055 string ATTRIBUTE LM-Password 1057 octets ATTRIBUTE NT-Password 1058 octets ATTRIBUTE SMB-Account-CTRL 1059 integer ATTRIBUTE SMB-Account-CTRL-TEXT 1061 string ATTRIBUTE User-Profile 1062 string ATTRIBUTE Digest-Realm 1063 string ATTRIBUTE Digest-Nonce 1064 string ATTRIBUTE Digest-Method 1065 string ATTRIBUTE Digest-URI 1066 string ATTRIBUTE Digest-QOP 1067 string ATTRIBUTE Digest-Algorithm 1068 string ATTRIBUTE Digest-Body-Digest 1069 string ATTRIBUTE Digest-CNonce 1070 string ATTRIBUTE Digest-Nonce-Count 1071 string ATTRIBUTE Digest-User-Name 1072 string ATTRIBUTE Pool-Name 1073 string ATTRIBUTE Ldap-Group 1074 string ATTRIBUTE Module-Success-Message 1075 string ATTRIBUTE Module-Failure-Message 1076 string # X99-Fast 1077 integer ATTRIBUTE Rewrite-Rule 1078 string ATTRIBUTE Sql-Group 1079 string ATTRIBUTE Response-Packet-Type 1080 integer ATTRIBUTE Digest-HA1 1081 string ATTRIBUTE MS-CHAP-Use-NTLM-Auth 1082 integer ATTRIBUTE NTLM-User-Name 1083 string ATTRIBUTE MS-CHAP-User-Name 1083 string ATTRIBUTE Packet-Src-IP-Address 1084 ipaddr ATTRIBUTE Packet-Dst-IP-Address 1085 ipaddr ATTRIBUTE Packet-Src-Port 1086 integer ATTRIBUTE Packet-Dst-Port 1087 integer ATTRIBUTE Packet-Authentication-Vector 1088 octets ATTRIBUTE Time-Of-Day 1089 string ATTRIBUTE Request-Processing-Stage 1090 string ATTRIBUTE Cache-No-Caching 1091 string ATTRIBUTE Cache-Delete-Cache 1092 string ATTRIBUTE SHA-Password 1093 octets ATTRIBUTE SSHA-Password 1094 octets ATTRIBUTE SHA1-Password 1093 octets ATTRIBUTE SSHA1-Password 1094 octets ATTRIBUTE MD5-Password 1095 octets ATTRIBUTE SMD5-Password 1096 octets ATTRIBUTE Packet-Src-IPv6-Address 1097 ipv6addr ATTRIBUTE Packet-Dst-IPv6-Address 1098 ipv6addr ATTRIBUTE Virtual-Server 1099 string ATTRIBUTE Cleartext-Password 1100 string ATTRIBUTE Password-With-Header 1101 string ATTRIBUTE Inner-Tunnel-User-Name 1102 string # # EAP-IKEv2 is experimental. # ATTRIBUTE EAP-IKEv2-IDType 1103 integer VALUE EAP-IKEv2-IDType IPV4_ADDR 1 VALUE EAP-IKEv2-IDType FQDN 2 VALUE EAP-IKEv2-IDType RFC822_ADDR 3 VALUE EAP-IKEv2-IDType IPV6_ADDR 5 VALUE EAP-IKEv2-IDType DER_ASN1_DN 9 VALUE EAP-IKEv2-IDType DER_ASN1_GN 10 VALUE EAP-IKEv2-IDType KEY_ID 11 ATTRIBUTE EAP-IKEv2-ID 1104 string ATTRIBUTE EAP-IKEv2-Secret 1105 string ATTRIBUTE EAP-IKEv2-AuthType 1106 integer VALUE EAP-IKEv2-AuthType none 0 VALUE EAP-IKEv2-AuthType secret 1 VALUE EAP-IKEv2-AuthType cert 2 VALUE EAP-IKEv2-AuthType both 3 ATTRIBUTE Send-Disconnect-Request 1107 integer ATTRIBUTE Send-CoA-Request 1107 integer VALUE Send-CoA-Request No 0 VALUE Send-CoA-Request Yes 1 ATTRIBUTE Module-Return-Code 1108 integer VALUE Module-Return-Code reject 0 VALUE Module-Return-Code fail 1 VALUE Module-Return-Code ok 2 VALUE Module-Return-Code handled 3 VALUE Module-Return-Code invalid 4 VALUE Module-Return-Code userlock 5 VALUE Module-Return-Code notfound 6 VALUE Module-Return-Code noop 7 VALUE Module-Return-Code updated 8 ATTRIBUTE Packet-Original-Timestamp 1109 date ATTRIBUTE SQL-Table-Name 1110 string ATTRIBUTE Home-Server-Pool 1111 string ATTRIBUTE FreeRADIUS-Client-IP-Address 1120 ipaddr ATTRIBUTE FreeRADIUS-Client-IPv6-Address 1121 ipv6addr ATTRIBUTE FreeRADIUS-Client-Require-MA 1122 integer VALUE FreeRADIUS-Client-Require-MA no 0 VALUE FreeRADIUS-Client-Require-MA yes 1 ATTRIBUTE FreeRADIUS-Client-Secret 1123 string ATTRIBUTE FreeRADIUS-Client-Shortname 1124 string ATTRIBUTE FreeRADIUS-Client-NAS-Type 1125 string ATTRIBUTE FreeRADIUS-Client-Virtual-Server 1126 string # For session resumption ATTRIBUTE Allow-Session-Resumption 1127 integer VALUE Allow-Session-Resumption no 0 VALUE Allow-Session-Resumption yes 1 ATTRIBUTE EAP-Session-Resumed 1128 integer VALUE EAP-Session-Resumed no 0 VALUE EAP-Session-Resumed yes 1 # # Expose EAP keys in the reply. # ATTRIBUTE EAP-MSK 1129 octets ATTRIBUTE EAP-EMSK 1130 octets # # For send/recv CoA packets (like Auth-Type, Acct-Type, etc.) # ATTRIBUTE Recv-CoA-Type 1131 integer ATTRIBUTE Send-CoA-Type 1132 integer ATTRIBUTE MS-CHAP-Password 1133 string ATTRIBUTE Packet-Transmit-Counter 1134 integer ATTRIBUTE Cached-Session-Policy 1135 string ATTRIBUTE Cache-TTL 1140 integer ATTRIBUTE Cache-Status-Only 1141 integer ATTRIBUTE Cache-Entry-Hits 1142 integer VALUE Cache-Status-Only no 0 VALUE Cache-Status-Only yes 1 ATTRIBUTE EAP-Session-Id 1146 octets # # Range: 1200-1279 # EAP-SIM (and other EAP type) weirdness. # # For EAP-SIM, some attribute definitions for database interface # ATTRIBUTE EAP-Sim-Subtype 1200 integer ATTRIBUTE EAP-Sim-Rand1 1201 octets ATTRIBUTE EAP-Sim-Rand2 1202 octets ATTRIBUTE EAP-Sim-Rand3 1203 octets ATTRIBUTE EAP-Sim-SRES1 1204 octets ATTRIBUTE EAP-Sim-SRES2 1205 octets ATTRIBUTE EAP-Sim-SRES3 1206 octets VALUE EAP-Sim-Subtype Start 10 VALUE EAP-Sim-Subtype Challenge 11 VALUE EAP-Sim-Subtype Notification 12 VALUE EAP-Sim-Subtype Re-authentication 13 # this attribute is used internally by the client code. ATTRIBUTE EAP-Sim-State 1207 integer ATTRIBUTE EAP-Sim-IMSI 1208 string ATTRIBUTE EAP-Sim-HMAC 1209 string ATTRIBUTE EAP-Sim-KEY 1210 octets ATTRIBUTE EAP-Sim-EXTRA 1211 octets ATTRIBUTE EAP-Sim-KC1 1212 octets ATTRIBUTE EAP-Sim-KC2 1213 octets ATTRIBUTE EAP-Sim-KC3 1214 octets # # Range: 1280 - 1535 # EAP-type specific attributes # # These are used mostly for radeapclient, and aren't # that useful for anyone else. # # egrep VALUE dictionary.freeradius.internal | grep EAP-Type | awk '{print "ATTRIBUTE EAP-Type-" $3 " " 1280+$4 " octets"}' > foo;./format.pl foo # ATTRIBUTE EAP-Type-VALUE 1280 octets ATTRIBUTE EAP-Type-None 1280 octets ATTRIBUTE EAP-Type-Identity 1281 octets ATTRIBUTE EAP-Type-Notification 1282 octets ATTRIBUTE EAP-Type-NAK 1283 octets ATTRIBUTE EAP-Type-MD5-Challenge 1284 octets ATTRIBUTE EAP-Type-One-Time-Password 1285 octets ATTRIBUTE EAP-Type-Generic-Token-Card 1286 octets ATTRIBUTE EAP-Type-RSA-Public-Key 1289 octets ATTRIBUTE EAP-Type-DSS-Unilateral 1290 octets ATTRIBUTE EAP-Type-KEA 1291 octets ATTRIBUTE EAP-Type-KEA-Validate 1292 octets ATTRIBUTE EAP-Type-EAP-TLS 1293 octets ATTRIBUTE EAP-Type-Defender-Token 1294 octets ATTRIBUTE EAP-Type-RSA-SecurID-EAP 1295 octets ATTRIBUTE EAP-Type-Arcot-Systems-EAP 1296 octets ATTRIBUTE EAP-Type-Cisco-LEAP 1297 octets ATTRIBUTE EAP-Type-Nokia-IP-Smart-Card 1298 octets ATTRIBUTE EAP-Type-SIM 1298 octets ATTRIBUTE EAP-Type-SRP-SHA1 1299 octets ATTRIBUTE EAP-Type-EAP-TTLS 1301 octets ATTRIBUTE EAP-Type-Remote-Access-Service 1302 octets ATTRIBUTE EAP-Type-AKA 1303 octets ATTRIBUTE EAP-Type-EAP-3Com-Wireless 1304 octets ATTRIBUTE EAP-Type-PEAP 1305 octets ATTRIBUTE EAP-Type-MS-EAP-Authentication 1306 octets ATTRIBUTE EAP-Type-MAKE 1307 octets ATTRIBUTE EAP-Type-CRYPTOCard 1308 octets ATTRIBUTE EAP-Type-EAP-MSCHAP-V2 1309 octets ATTRIBUTE EAP-Type-DynamID 1310 octets ATTRIBUTE EAP-Type-Rob-EAP 1311 octets ATTRIBUTE EAP-Type-SecurID-EAP 1312 octets ATTRIBUTE EAP-Type-MS-Authentication-TLV 1313 octets ATTRIBUTE EAP-Type-SentriNET 1314 octets ATTRIBUTE EAP-Type-EAP-Actiontec-Wireless 1315 octets ATTRIBUTE EAP-Type-Cogent-Biomentric-EAP 1316 octets ATTRIBUTE EAP-Type-AirFortress-EAP 1317 octets ATTRIBUTE EAP-Type-EAP-HTTP-Digest 1318 octets ATTRIBUTE EAP-Type-SecuriSuite-EAP 1319 octets ATTRIBUTE EAP-Type-DeviceConnect-EAP 1320 octets ATTRIBUTE EAP-Type-EAP-SPEKE 1321 octets ATTRIBUTE EAP-Type-EAP-MOBAC 1322 octets ATTRIBUTE EAP-Type-EAP-FAST 1323 octets ATTRIBUTE EAP-Type-Zonelabs 1324 octets ATTRIBUTE EAP-Type-EAP-Link 1325 octets ATTRIBUTE EAP-Type-EAP-PAX 1326 octets ATTRIBUTE EAP-Type-EAP-PSK 1327 octets ATTRIBUTE EAP-Type-EAP-SAKE 1328 octets ATTRIBUTE EAP-Type-EAP-IKEv2 1329 octets ATTRIBUTE EAP-Type-EAP-AKA2 1330 octets ATTRIBUTE EAP-Type-EAP-GPSK 1331 octets ATTRIBUTE EAP-Type-EAP-PWD 1332 octets ATTRIBUTE EAP-Type-EAP-EVEv1 1333 octets ATTRIBUTE EAP-Type-Microsoft-MS-CHAPv2 1306 octets ATTRIBUTE EAP-Type-Cisco-MS-CHAPv2 1309 octets ATTRIBUTE EAP-Type-MS-CHAP-V2 1306 octets # # Range: 1536 - 1791 # EAP Sim sub-types. # # these are PW_EAP_SIM_X + 1536 ATTRIBUTE EAP-Sim-RAND 1537 octets ATTRIBUTE EAP-Sim-PADDING 1542 octets ATTRIBUTE EAP-Sim-NONCE_MT 1543 octets ATTRIBUTE EAP-Sim-PERMANENT_ID_REQ 1546 octets ATTRIBUTE EAP-Sim-MAC 1547 octets ATTRIBUTE EAP-Sim-NOTIFICATION 1548 octets ATTRIBUTE EAP-Sim-ANY_ID_REQ 1549 octets ATTRIBUTE EAP-Sim-IDENTITY 1550 octets ATTRIBUTE EAP-Sim-VERSION_LIST 1551 octets ATTRIBUTE EAP-Sim-SELECTED_VERSION 1552 octets ATTRIBUTE EAP-Sim-FULLAUTH_ID_REQ 1553 octets ATTRIBUTE EAP-Sim-COUNTER 1555 octets ATTRIBUTE EAP-Sim-COUNTER_TOO_SMALL 1556 octets ATTRIBUTE EAP-Sim-NONCE_S 1557 octets ATTRIBUTE EAP-Sim-IV 1665 octets ATTRIBUTE EAP-Sim-ENCR_DATA 1666 octets ATTRIBUTE EAP-Sim-NEXT_PSEUDONUM 1668 octets ATTRIBUTE EAP-Sim-NEXT_REAUTH_ID 1669 octets ATTRIBUTE EAP-Sim-CHECKCODE 1670 octets # # Range: 1800-1899 # Temporary attributes, for local storage. # ATTRIBUTE Tmp-String-0 1800 string ATTRIBUTE Tmp-String-1 1801 string ATTRIBUTE Tmp-String-2 1802 string ATTRIBUTE Tmp-String-3 1803 string ATTRIBUTE Tmp-String-4 1804 string ATTRIBUTE Tmp-String-5 1805 string ATTRIBUTE Tmp-String-6 1806 string ATTRIBUTE Tmp-String-7 1807 string ATTRIBUTE Tmp-String-8 1808 string ATTRIBUTE Tmp-String-9 1809 string ATTRIBUTE Tmp-Integer-0 1810 integer ATTRIBUTE Tmp-Integer-1 1811 integer ATTRIBUTE Tmp-Integer-2 1812 integer ATTRIBUTE Tmp-Integer-3 1813 integer ATTRIBUTE Tmp-Integer-4 1814 integer ATTRIBUTE Tmp-Integer-5 1815 integer ATTRIBUTE Tmp-Integer-6 1816 integer ATTRIBUTE Tmp-Integer-7 1817 integer ATTRIBUTE Tmp-Integer-8 1818 integer ATTRIBUTE Tmp-Integer-9 1819 integer ATTRIBUTE Tmp-IP-Address-0 1820 ipaddr ATTRIBUTE Tmp-IP-Address-1 1821 ipaddr ATTRIBUTE Tmp-IP-Address-2 1822 ipaddr ATTRIBUTE Tmp-IP-Address-3 1823 ipaddr ATTRIBUTE Tmp-IP-Address-4 1824 ipaddr ATTRIBUTE Tmp-IP-Address-5 1825 ipaddr ATTRIBUTE Tmp-IP-Address-6 1826 ipaddr ATTRIBUTE Tmp-IP-Address-7 1827 ipaddr ATTRIBUTE Tmp-IP-Address-8 1828 ipaddr ATTRIBUTE Tmp-IP-Address-9 1829 ipaddr ATTRIBUTE Tmp-Octets-0 1830 octets ATTRIBUTE Tmp-Octets-1 1831 octets ATTRIBUTE Tmp-Octets-2 1832 octets ATTRIBUTE Tmp-Octets-3 1833 octets ATTRIBUTE Tmp-Octets-4 1834 octets ATTRIBUTE Tmp-Octets-5 1835 octets ATTRIBUTE Tmp-Octets-6 1836 octets ATTRIBUTE Tmp-Octets-7 1837 octets ATTRIBUTE Tmp-Octets-8 1838 octets ATTRIBUTE Tmp-Octets-9 1839 octets # Range: 1900-1909 # WiMAX server-side attributes. # # These are NOT sent in a packet, but are otherwise # available for testing and validation. The various # things that *are* sent in a packet are derived from # these attributes. # ATTRIBUTE WiMAX-MN-NAI 1900 string # Range: 1910-1930 # Certificate attributes # # ATTRIBUTE TLS-Cert-Serial 1910 string ATTRIBUTE TLS-Cert-Expiration 1911 string ATTRIBUTE TLS-Cert-Issuer 1912 string ATTRIBUTE TLS-Cert-Subject 1913 string ATTRIBUTE TLS-Cert-Common-Name 1914 string ATTRIBUTE TLS-Cert-Subject-Alt-Name-Email 1915 string # 1916 - 1919: reserved for future cert attributes ATTRIBUTE TLS-Client-Cert-Serial 1920 string ATTRIBUTE TLS-Client-Cert-Expiration 1921 string ATTRIBUTE TLS-Client-Cert-Issuer 1922 string ATTRIBUTE TLS-Client-Cert-Subject 1923 string ATTRIBUTE TLS-Client-Cert-Common-Name 1924 string ATTRIBUTE TLS-Client-Cert-Filename 1925 string ATTRIBUTE TLS-Client-Cert-Subject-Alt-Name-Email 1926 string ATTRIBUTE TLS-Client-Cert-X509v3-Extended-Key-Usage 1927 string ATTRIBUTE TLS-Client-Cert-X509v3-Subject-Key-Identifier 1928 string ATTRIBUTE TLS-Client-Cert-X509v3-Authority-Key-Identifier 1929 string ATTRIBUTE TLS-Client-Cert-X509v3-Basic-Constraints 1930 string # 1931 - 1939: reserved for future cert attributes # Range: 1930-2099 # Free # # Range: 2100-2199 # SoH attributes; FIXME: these should really be protocol attributes # so that the SoH radius request can be proxied, but from which # vendor? Sigh... # ATTRIBUTE SoH-MS-Machine-OS-vendor 2100 integer VALUE SoH-MS-Machine-OS-vendor Microsoft 311 ATTRIBUTE SoH-MS-Machine-OS-version 2101 integer ATTRIBUTE SoH-MS-Machine-OS-release 2102 integer ATTRIBUTE SoH-MS-Machine-OS-build 2103 integer ATTRIBUTE SoH-MS-Machine-SP-version 2104 integer ATTRIBUTE SoH-MS-Machine-SP-release 2105 integer ATTRIBUTE SoH-MS-Machine-Processor 2106 integer VALUE SoH-MS-Machine-Processor x86 0 VALUE SoH-MS-Machine-Processor i64 6 VALUE SoH-MS-Machine-Processor x86_64 9 ATTRIBUTE SoH-MS-Machine-Name 2107 string ATTRIBUTE SoH-MS-Correlation-Id 2108 octets ATTRIBUTE SoH-MS-Machine-Role 2109 integer VALUE SoH-MS-Machine-Role client 1 VALUE SoH-MS-Machine-Role dc 2 VALUE SoH-MS-Machine-Role server 3 ATTRIBUTE SoH-Supported 2119 integer VALUE SoH-Supported no 0 VALUE SoH-Supported yes 1 ATTRIBUTE SoH-MS-Windows-Health-Status 2120 string ATTRIBUTE SoH-MS-Health-Other 2129 string # # Range: 2200-2999 # Free # # Range: 3000-3999 # Site-local attributes (see raddb/dictionary.in) # Do NOT define attributes in this range! # # Range: 4000-65535 # Unused # # Range: 65536- # Invalid. Don't use. # # # Non-Protocol Integer Translations # VALUE Auth-Type Local 0 VALUE Auth-Type System 1 VALUE Auth-Type SecurID 2 VALUE Auth-Type Crypt-Local 3 VALUE Auth-Type Reject 4 VALUE Auth-Type ActivCard 5 VALUE Auth-Type EAP 6 VALUE Auth-Type ARAP 7 # # FreeRADIUS extensions (most originally from Cistron) # VALUE Auth-Type Accept 254 VALUE Auth-Type PAP 1024 VALUE Auth-Type CHAP 1025 # 1026 was LDAP, but we deleted it. Adding it back will break the # ldap module. VALUE Auth-Type PAM 1027 VALUE Auth-Type MS-CHAP 1028 VALUE Auth-Type MSCHAP 1028 VALUE Auth-Type Kerberos 1029 VALUE Auth-Type CRAM 1030 VALUE Auth-Type NS-MTA-MD5 1031 # 1032 is unused (was a duplicate of CRAM) VALUE Auth-Type SMB 1033 VALUE Auth-Type MS-CHAP-V2 1034 # # Authorization type, too. # VALUE Autz-Type Local 0 # # And accounting # VALUE Acct-Type Local 0 # # And Session handling # VALUE Session-Type Local 0 # # And Post-Auth VALUE Post-Auth-Type Local 0 VALUE Post-Auth-Type Reject 2 # # Experimental Non-Protocol Integer Translations for FreeRADIUS # VALUE Fall-Through No 0 VALUE Fall-Through Yes 1 VALUE Relax-Filter No 0 VALUE Relax-Filter Yes 1 VALUE Strip-User-Name No 0 VALUE Strip-User-Name Yes 1 VALUE Packet-Type Access-Request 1 VALUE Packet-Type Access-Accept 2 VALUE Packet-Type Access-Reject 3 VALUE Packet-Type Accounting-Request 4 VALUE Packet-Type Accounting-Response 5 VALUE Packet-Type Accounting-Status 6 VALUE Packet-Type Password-Request 7 VALUE Packet-Type Password-Accept 8 VALUE Packet-Type Password-Reject 9 VALUE Packet-Type Accounting-Message 10 VALUE Packet-Type Access-Challenge 11 VALUE Packet-Type Status-Server 12 VALUE Packet-Type Status-Client 13 # # The following packet types are described in RFC 2882, # but they are NOT part of the RADIUS standard. Instead, # they are informational about vendor-specific extensions # to the RADIUS standard. # VALUE Packet-Type Resource-Free-Request 21 VALUE Packet-Type Resource-Free-Response 22 VALUE Packet-Type Resource-Query-Request 23 VALUE Packet-Type Resource-Query-Response 24 VALUE Packet-Type Alternate-Resource-Reclaim-Request 25 VALUE Packet-Type NAS-Reboot-Request 26 VALUE Packet-Type NAS-Reboot-Response 27 VALUE Packet-Type Next-Passcode 29 VALUE Packet-Type New-Pin 30 VALUE Packet-Type Terminate-Session 31 VALUE Packet-Type Password-Expired 32 VALUE Packet-Type Event-Request 33 VALUE Packet-Type Event-Response 34 # RFC 3576 allocates packet types 40-45 VALUE Packet-Type Disconnect-Request 40 VALUE Packet-Type Disconnect-ACK 41 VALUE Packet-Type Disconnect-NAK 42 VALUE Packet-Type CoA-Request 43 VALUE Packet-Type CoA-ACK 44 VALUE Packet-Type CoA-NAK 45 VALUE Packet-Type IP-Address-Allocate 50 VALUE Packet-Type IP-Address-Release 51 VALUE Response-Packet-Type Access-Request 1 VALUE Response-Packet-Type Access-Accept 2 VALUE Response-Packet-Type Access-Reject 3 VALUE Response-Packet-Type Accounting-Request 4 VALUE Response-Packet-Type Accounting-Response 5 VALUE Response-Packet-Type Accounting-Status 6 VALUE Response-Packet-Type Password-Request 7 VALUE Response-Packet-Type Password-Accept 8 VALUE Response-Packet-Type Password-Reject 9 VALUE Response-Packet-Type Accounting-Message 10 VALUE Response-Packet-Type Access-Challenge 11 VALUE Response-Packet-Type Status-Server 12 VALUE Response-Packet-Type Status-Client 13 VALUE Response-Packet-Type Disconnect-Request 40 VALUE Response-Packet-Type Disconnect-ACK 41 VALUE Response-Packet-Type Disconnect-NAK 42 VALUE Response-Packet-Type CoA-Request 43 VALUE Response-Packet-Type CoA-ACK 44 VALUE Response-Packet-Type CoA-NAK 45 # # Special value # VALUE Response-Packet-Type Do-Not-Respond 256 # # EAP Sub-types, inside of Request and Response packets # # http://www.iana.org/assignments/ppp-numbers # "PPP EAP REQUEST/RESPONSE TYPES" # # # See dictionary.microsoft, MS-Acct-EAP-Type for similar definitions # VALUE EAP-Type None 0 VALUE EAP-Type Identity 1 VALUE EAP-Type Notification 2 VALUE EAP-Type NAK 3 VALUE EAP-Type MD5-Challenge 4 VALUE EAP-Type One-Time-Password 5 VALUE EAP-Type Generic-Token-Card 6 VALUE EAP-Type RSA-Public-Key 9 VALUE EAP-Type DSS-Unilateral 10 VALUE EAP-Type KEA 11 VALUE EAP-Type KEA-Validate 12 VALUE EAP-Type EAP-TLS 13 VALUE EAP-Type Defender-Token 14 VALUE EAP-Type RSA-SecurID-EAP 15 VALUE EAP-Type Arcot-Systems-EAP 16 VALUE EAP-Type Cisco-LEAP 17 VALUE EAP-Type Nokia-IP-Smart-Card 18 VALUE EAP-Type SIM 18 VALUE EAP-Type SRP-SHA1 19 # 20 is unassigned VALUE EAP-Type EAP-TTLS 21 VALUE EAP-Type Remote-Access-Service 22 VALUE EAP-Type AKA 23 VALUE EAP-Type EAP-3Com-Wireless 24 VALUE EAP-Type PEAP 25 VALUE EAP-Type MS-EAP-Authentication 26 VALUE EAP-Type MAKE 27 VALUE EAP-Type CRYPTOCard 28 VALUE EAP-Type EAP-MSCHAP-V2 29 VALUE EAP-Type DynamID 30 VALUE EAP-Type Rob-EAP 31 VALUE EAP-Type SecurID-EAP 32 VALUE EAP-Type MS-Authentication-TLV 33 VALUE EAP-Type SentriNET 34 VALUE EAP-Type EAP-Actiontec-Wireless 35 VALUE EAP-Type Cogent-Biomentric-EAP 36 VALUE EAP-Type AirFortress-EAP 37 VALUE EAP-Type EAP-HTTP-Digest 38 VALUE EAP-Type SecuriSuite-EAP 39 VALUE EAP-Type DeviceConnect-EAP 40 VALUE EAP-Type EAP-SPEKE 41 VALUE EAP-Type EAP-MOBAC 42 VALUE EAP-Type EAP-FAST 43 VALUE EAP-Type Zonelabs 44 VALUE EAP-Type EAP-Link 45 VALUE EAP-Type EAP-PAX 46 VALUE EAP-Type EAP-PSK 47 VALUE EAP-Type EAP-SAKE 48 VALUE EAP-Type EAP-IKEv2 49 VALUE EAP-Type EAP-AKA2 50 VALUE EAP-Type EAP-GPSK 51 VALUE EAP-Type EAP-PWD 52 VALUE EAP-Type EAP-EVEv1 53 # # These are duplicate values, to get around the problem of # having two MS-CHAPv2 EAP types. # VALUE EAP-Type Microsoft-MS-CHAPv2 26 VALUE EAP-Type Cisco-MS-CHAPv2 29 # # And this is what most people mean by MS-CHAPv2 # VALUE EAP-Type MS-CHAP-V2 26 # # This says TLS, but it's only valid for TTLS & PEAP. # EAP-TLS *always* requires a client certificate. # VALUE EAP-TLS-Require-Client-Cert No 0 VALUE EAP-TLS-Require-Client-Cert Yes 1 # # These are the EAP-Code values. # VALUE EAP-Code Request 1 VALUE EAP-Code Response 2 VALUE EAP-Code Success 3 VALUE EAP-Code Failure 4 # # For MS-CHAP, do we run ntlm_auth, or not. # VALUE MS-CHAP-Use-NTLM-Auth No 0 VALUE MS-CHAP-Use-NTLM-Auth Yes 1 freeradius-server/share/dictionary.freeswitch000066400000000000000000000107221257552170400220610ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2011 The FreeRADIUS Server project and contributors # # dictionary.freeswitch # # cparker@segv.org # # Version: $Id$ # VENDOR Freeswitch 27880 # # Standard attribute # BEGIN-VENDOR Freeswitch ATTRIBUTE Freeswitch-AVPair 1 string ATTRIBUTE Freeswitch-CLID 2 string ATTRIBUTE Freeswitch-Dialplan 3 string ATTRIBUTE Freeswitch-Src 4 string ATTRIBUTE Freeswitch-Dst 5 string ATTRIBUTE Freeswitch-Src-Channel 6 string ATTRIBUTE Freeswitch-Dst-Channel 7 string ATTRIBUTE Freeswitch-Ani 8 string ATTRIBUTE Freeswitch-Aniii 9 string ATTRIBUTE Freeswitch-Lastapp 10 string ATTRIBUTE Freeswitch-Lastdata 11 string ATTRIBUTE Freeswitch-Disposition 12 string ATTRIBUTE Freeswitch-Hangupcause 13 integer ATTRIBUTE Freeswitch-Billusec 15 integer ATTRIBUTE Freeswitch-AMAFlags 16 integer ATTRIBUTE Freeswitch-RDNIS 17 string ATTRIBUTE Freeswitch-Context 18 string ATTRIBUTE Freeswitch-Source 19 string ATTRIBUTE Freeswitch-Callstartdate 20 string ATTRIBUTE Freeswitch-Callanswerdate 21 string ATTRIBUTE Freeswitch-Calltransferdate 22 string ATTRIBUTE Freeswitch-Callenddate 23 string ATTRIBUTE Freeswitch-Signalbond 24 string # # Freeswitch-Hangupcause # VALUE Freeswitch-Hangupcause None 0 VALUE Freeswitch-Hangupcause Unallocated-Number 1 VALUE Freeswitch-Hangupcause No-Route-Transit-Net 2 VALUE Freeswitch-Hangupcause No-Route-Destination 3 VALUE Freeswitch-Hangupcause Channel-Unacceptable 6 VALUE Freeswitch-Hangupcause Call-Awarded-Delivery 7 VALUE Freeswitch-Hangupcause Normal-Clearing 16 VALUE Freeswitch-Hangupcause User-Busy 17 VALUE Freeswitch-Hangupcause No-User-Response 18 VALUE Freeswitch-Hangupcause No-Answer 19 VALUE Freeswitch-Hangupcause Subscriber-Absent 20 VALUE Freeswitch-Hangupcause Call-Rejected 21 VALUE Freeswitch-Hangupcause Number-Changed 22 VALUE Freeswitch-Hangupcause Redirecto-To-New-Destination 23 VALUE Freeswitch-Hangupcause Exchange-Routing-Error 25 VALUE Freeswitch-Hangupcause Destination-Out-Of-Order 27 VALUE Freeswitch-Hangupcause Invalid-Number-Format 28 VALUE Freeswitch-Hangupcause Facility-Rejected 29 VALUE Freeswitch-Hangupcause Response-To-Status-Enquiry 30 VALUE Freeswitch-Hangupcause Normal-Unspecified 31 VALUE Freeswitch-Hangupcause Normal-Circuit-Congestion 34 VALUE Freeswitch-Hangupcause Network-Out-Of-Order 38 VALUE Freeswitch-Hangupcause Normal-Temporary-Failure 41 VALUE Freeswitch-Hangupcause Switch-Congestion 42 VALUE Freeswitch-Hangupcause Access-Info-Discarded 43 VALUE Freeswitch-Hangupcause Requested-Chan-Unavail 44 VALUE Freeswitch-Hangupcause Pre-Empted 45 VALUE Freeswitch-Hangupcause Facility-Not-Subscribed 50 VALUE Freeswitch-Hangupcause Outgoing-Call-Barred 52 VALUE Freeswitch-Hangupcause Incoming-Call-Barred 54 VALUE Freeswitch-Hangupcause Bearercapability-Notauth 57 VALUE Freeswitch-Hangupcause Bearercapability-Notavail 58 VALUE Freeswitch-Hangupcause Service-Unavailable 63 VALUE Freeswitch-Hangupcause Bearercapability-Notimpl 65 VALUE Freeswitch-Hangupcause Chan-Not-Implemented 66 VALUE Freeswitch-Hangupcause Facility-Not-Implemented 69 VALUE Freeswitch-Hangupcause Service-Not-Implemented 79 VALUE Freeswitch-Hangupcause Invalid-Call-Reference 81 VALUE Freeswitch-Hangupcause Incompatible-Destination 88 VALUE Freeswitch-Hangupcause Invalid-Msg-Unspecified 95 VALUE Freeswitch-Hangupcause Mandatory-IE-Missing 96 VALUE Freeswitch-Hangupcause Message-Type-Nonexist 97 VALUE Freeswitch-Hangupcause Wrong-Message 98 VALUE Freeswitch-Hangupcause IE-Nonexist 99 VALUE Freeswitch-Hangupcause Invalid-IE-Contents 100 VALUE Freeswitch-Hangupcause Wrong-Call-State 101 VALUE Freeswitch-Hangupcause Recovery-On-Timer-Expire 102 VALUE Freeswitch-Hangupcause Mandatory-IE-Length-Error 103 VALUE Freeswitch-Hangupcause Protocol-Error 111 VALUE Freeswitch-Hangupcause Interworking 127 VALUE Freeswitch-Hangupcause Success 142 VALUE Freeswitch-Hangupcause Originator-Cancel 487 VALUE Freeswitch-Hangupcause Crash 500 VALUE Freeswitch-Hangupcause System-Shutdown 501 VALUE Freeswitch-Hangupcause Lose-Race 502 VALUE Freeswitch-Hangupcause Manager-Request 503 VALUE Freeswitch-Hangupcause Blind-Transfer 600 VALUE Freeswitch-Hangupcause Attended-Transfer 601 VALUE Freeswitch-Hangupcause Allotted-Timeout 602 VALUE Freeswitch-Hangupcause User-Challenge 603 VALUE Freeswitch-Hangupcause Media-Timeout 604 VALUE Freeswitch-Hangupcause Picked-Off 605 VALUE Freeswitch-Hangupcause User-Not-Registered 606 # # # END-VENDOR Freeswitch freeradius-server/share/dictionary.gandalf000066400000000000000000000070471257552170400213200ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2011 The FreeRADIUS Server project and contributors # Gandalf dictionary # # Version: 1.00 24-July-2003 Blaise St-Laurent # # Notes: Dictionary was made specifically for the Gandalf XpressWay # RLAN with Link Authentication through RADIUS # # $Id$ # VENDOR Gandalf 64 # # Vendor-specific attributes # BEGIN-VENDOR Gandalf ATTRIBUTE Gandalf-Remote-LAN-Name 0 string ATTRIBUTE Gandalf-Operational-Modes 1 integer ATTRIBUTE Gandalf-Compression-Status 2 integer ATTRIBUTE Gandalf-Min-Outgoing-Bearer 3 integer ATTRIBUTE Gandalf-Authentication-String 5 string ATTRIBUTE Gandalf-PPP-Authentication 6 integer ATTRIBUTE Gandalf-PPP-NCP-Type 7 integer ATTRIBUTE Gandalf-Fwd-Multicast-In 8 integer ATTRIBUTE Gandalf-Fwd-Broadcast-In 9 integer ATTRIBUTE Gandalf-Fwd-Unicast-In 10 integer ATTRIBUTE Gandalf-Fwd-Multicast-Out 11 integer ATTRIBUTE Gandalf-Fwd-Broadcast-Out 12 integer ATTRIBUTE Gandalf-Fwd-Unicast-Out 13 integer ATTRIBUTE Gandalf-Around-The-Corner 14 integer ATTRIBUTE Gandalf-Channel-Group-Name-1 15 string ATTRIBUTE Gandalf-Dial-Prefix-Name-1 16 string ATTRIBUTE Gandalf-Phone-Number-1 17 string ATTRIBUTE Gandalf-Calling-Line-ID-1 18 string ATTRIBUTE Gandalf-Channel-Group-Name-2 19 string ATTRIBUTE Gandalf-Dial-Prefix-Name-2 20 string ATTRIBUTE Gandalf-Phone-Number-2 21 string ATTRIBUTE Gandalf-Calling-Line-ID-2 22 string ATTRIBUTE Gandalf-IPX-Spoofing-State 23 integer ATTRIBUTE Gandalf-IPX-Watchdog-Spoof 24 integer ATTRIBUTE Gandalf-SAP-Group-Name-1 25 string ATTRIBUTE Gandalf-SAP-Group-Name-2 26 string ATTRIBUTE Gandalf-SAP-Group-Name-3 27 string ATTRIBUTE Gandalf-SAP-Group-Name-4 28 string ATTRIBUTE Gandalf-SAP-Group-Name-5 29 string ATTRIBUTE Gandalf-Hunt-Group 30 string ATTRIBUTE Gandalf-Modem-Mode 31 integer ATTRIBUTE Gandalf-Modem-Required-1 32 integer ATTRIBUTE Gandalf-Modem-Required-2 33 integer VALUE Gandalf-Operational-Modes Disabled 1 VALUE Gandalf-Operational-Modes Called-Only 2 VALUE Gandalf-Operational-Modes Calling-Called 3 VALUE Gandalf-Operational-Modes Calling-Only 4 VALUE Gandalf-Compression-Status Disabled 1 VALUE Gandalf-Compression-Status Enabled 2 VALUE Gandalf-Min-Outgoing-Bearer Unrestricted-64K 1 VALUE Gandalf-Min-Outgoing-Bearer Digital-56K 2 VALUE Gandalf-Min-Outgoing-Bearer 3100Hz-Audio 3 VALUE Gandalf-PPP-Authentication CHAP 1 VALUE Gandalf-PPP-Authentication PAP 2 VALUE Gandalf-PPP-Authentication PAP-Sending-on-Incoming-Calls 3 VALUE Gandalf-PPP-NCP-Type BCP 2 VALUE Gandalf-PPP-NCP-Type IPCP 3 VALUE Gandalf-Fwd-Multicast-In Disabled 1 VALUE Gandalf-Fwd-Multicast-In Enabled 2 VALUE Gandalf-Fwd-Broadcast-In Disabled 1 VALUE Gandalf-Fwd-Broadcast-In Enabled 2 VALUE Gandalf-Fwd-Unicast-In Disabled 1 VALUE Gandalf-Fwd-Unicast-In Enabled 2 VALUE Gandalf-Fwd-Multicast-Out Disabled 1 VALUE Gandalf-Fwd-Multicast-Out Enabled 2 VALUE Gandalf-Fwd-Broadcast-Out Disabled 1 VALUE Gandalf-Fwd-Broadcast-Out Enabled 2 VALUE Gandalf-Fwd-Unicast-Out Disabled 1 VALUE Gandalf-Fwd-Unicast-Out Enabled 2 VALUE Gandalf-IPX-Spoofing-State Forward 1 VALUE Gandalf-IPX-Spoofing-State Spoof 2 VALUE Gandalf-IPX-Spoofing-State Filter-all-outgoing-RIP-SAP 3 VALUE Gandalf-IPX-Watchdog-Spoof Disabled 1 VALUE Gandalf-IPX-Watchdog-Spoof Enabled 2 VALUE Gandalf-Modem-Mode Disabled 1 VALUE Gandalf-Modem-Mode Enabled 2 VALUE Gandalf-Modem-Required-1 Disabled 1 VALUE Gandalf-Modem-Required-1 Enabled 2 VALUE Gandalf-Modem-Required-2 Disabled 1 VALUE Gandalf-Modem-Required-2 Enabled 2 END-VENDOR Gandalf freeradius-server/share/dictionary.garderos000066400000000000000000000007211257552170400215220ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2011 The FreeRADIUS Server project and contributors # # dictionary.garderos # # Version: $Id$ # # For documentation on Garderos attributes, see: # # http://www.garderos.com VENDOR Garderos 16108 # # Standard attribute # BEGIN-VENDOR Garderos ATTRIBUTE Garderos-Location-Name 1 string ATTRIBUTE Garderos-Service-Name 2 string ATTRIBUTE Garderos-MSISDN 3 string ATTRIBUTE Garderos-Proxy 4 string END-VENDOR Garderos freeradius-server/share/dictionary.gemtek000066400000000000000000000010501257552170400211640ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2011 The FreeRADIUS Server project and contributors # # Gemtek Systems VSA's # Version: dictionary.gemtek, v1.2 2004/07/13 VENDOR Gemtek 10529 BEGIN-VENDOR Gemtek # Attributes for volume accounting limit. ATTRIBUTE Acct-Session-Input-Octets 21 integer ATTRIBUTE Acct-Session-Input-Gigawords 22 integer ATTRIBUTE Acct-Session-Output-Octets 23 integer ATTRIBUTE Acct-Session-Output-Gigawords 24 integer ATTRIBUTE Acct-Session-Octets 25 integer ATTRIBUTE Acct-Session-Gigawords 26 integer END-VENDOR Gemtek freeradius-server/share/dictionary.h3c000066400000000000000000000010551257552170400203720ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2011 The FreeRADIUS Server project and contributors ############################################################################## # # Dictionary for Huawei-3Com. See also dictionary.huawei # # http://www.h3c.com # # $Id$ # ############################################################################## VENDOR H3C 25506 BEGIN-VENDOR H3C ATTRIBUTE H3C-Connect_Id 26 integer ATTRIBUTE H3C-NAS-Startup-Timestamp 59 integer ATTRIBUTE H3C-Ip-Host-Addr 60 string ATTRIBUTE H3C-Product-ID 255 string END-VENDOR H3C freeradius-server/share/dictionary.hp000066400000000000000000000044741257552170400203340ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2011 The FreeRADIUS Server project and contributors ############################################################################## # # HP ProCurve VSA's # # $Id$ # ############################################################################## VENDOR HP 11 # # Attributes supported by HP ProCurve wired networking devices # BEGIN-VENDOR HP # Management authorization ATTRIBUTE HP-Privilege-Level 1 integer ATTRIBUTE HP-Command-String 2 string ATTRIBUTE HP-Command-Exception 3 integer ATTRIBUTE HP-Management-Protocol 26 integer # Dynamic port-access attributes ATTRIBUTE HP-Port-Client-Limit-Dot1x 10 integer ATTRIBUTE HP-Port-Client-Limit-MA 11 integer ATTRIBUTE HP-Port-Client-Limit-WA 12 integer ATTRIBUTE HP-Port-Auth-Mode-Dot1x 13 integer # Client QoS attributes ATTRIBUTE HP-Port-Priority-Regeneration-Table 40 string # Access control ATTRIBUTE HP-Cos 40 string #ATTRIBUTE HP-Rate-Limit 46 integer ATTRIBUTE HP-Bandwidth-Max-Ingress 46 integer ATTRIBUTE HP-Bandwidth-Max-Egress 48 integer ATTRIBUTE HP-Ip-Filter-Raw 61 string # Client ACL attributes ATTRIBUTE HP-Nas-Filter-Rule 61 string ATTRIBUTE HP-Nas-Rules-IPv6 63 integer # VLAN assignment attributes ATTRIBUTE HP-Egress-VLANID 64 integer ATTRIBUTE HP-Egress-VLAN-Name 65 string # See http://wiki.freeradius.org/vendor/HP#Capability-advertisements ATTRIBUTE HP-Capability-Advert 255 octets # HP-Port-Auth-Mode-Dot1x Attribute Values VALUE HP-Port-Auth-Mode-Dot1x Port-Based 1 VALUE HP-Port-Auth-Mode-Dot1x User-Based 2 # HP-Command-Exception Attribute Values VALUE HP-Command-Exception Permit-List 0 VALUE HP-Command-Exception Deny-List 1 # HP-Management-Protocol VALUE HP-Management-Protocol HTTP 5 VALUE HP-Management-Protocol HTTPS 6 # # Conflicting attributes are commented out. # #ATTRIBUTE HP-Management-Role 26 integer # HP-Management-Role #VALUE HP-Management-Role SuperUser 1 #VALUE HP-Management-Role Monitor 2 #VALUE HP-Management-Role HelpDeskManager 16 #VALUE HP-Management-Role NetworkAdministrator 17 #VALUE HP-Management-Role SystemAdministrator 18 #VALUE HP-Management-Role WebUserAdminstrator 19 # Privilege attributes for HP-GbE2c, HP 1:10Gb, and HP 10Gb # Ethernet Blade Switches # VALUE Service-Type HP-Oper 252 VALUE Service-Type HP-User 255 END-VENDOR HP freeradius-server/share/dictionary.huawei000066400000000000000000000130671257552170400212050ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2011 The FreeRADIUS Server project and contributors ############################################################################## # # Dictionary for Huawei. See also dictionary.h3c # # $Id$ # ############################################################################## VENDOR Huawei 2011 BEGIN-VENDOR Huawei ATTRIBUTE Huawei-Input-Burst-Size 1 integer ATTRIBUTE Huawei-Input-Average-Rate 2 integer ATTRIBUTE Huawei-Input-Peak-Rate 3 integer ATTRIBUTE Huawei-Output-Burst-Size 4 integer ATTRIBUTE Huawei-Output-Average-Rate 5 integer ATTRIBUTE Huawei-Output-Peak-Rate 6 integer ATTRIBUTE Huawei-In-Kb-Before-T-Switch 7 integer ATTRIBUTE Huawei-Out-Kb-Before-T-Switch 8 integer ATTRIBUTE Huawei-In-Pkt-Before-T-Switch 9 integer ATTRIBUTE Huawei-Out-Pkt-Before-T-Switch 10 integer ATTRIBUTE Huawei-In-Kb-After-T-Switch 11 integer ATTRIBUTE Huawei-Out-Kb-After-T-Switch 12 integer ATTRIBUTE Huawei-In-Pkt-After-T-Switch 13 integer ATTRIBUTE Huawei-Out-Pkt-After-T-Switch 14 integer ATTRIBUTE Huawei-Remanent-Volume 15 integer ATTRIBUTE Huawei-Tariff-Switch-Interval 16 integer ATTRIBUTE Huawei-ISP-ID 17 string ATTRIBUTE Huawei-Max-Users-Per-Logic-Port 18 integer ATTRIBUTE Huawei-Command 20 integer ATTRIBUTE Huawei-Priority 22 integer ATTRIBUTE Huawei-Control-Identifier 24 integer ATTRIBUTE Huawei-Result-Code 25 integer ATTRIBUTE Huawei-Connect-ID 26 integer ATTRIBUTE Huawei-PortalURL 27 string ATTRIBUTE Huawei-FTP-Directory 28 string ATTRIBUTE Huawei-Exec-Privilege 29 integer ATTRIBUTE Huawei-IP-Address 30 integer ATTRIBUTE Huawei-Qos-Profile-Name 31 string ATTRIBUTE Huawei-Destnation-IP-Addr 39 string ATTRIBUTE Huawei-Destnation-Volume 40 string ATTRIBUTE Huawei-Startup-Stamp 59 integer ATTRIBUTE Huawei-IPHost-Addr 60 string ATTRIBUTE Huawei-VT-Name 64 integer ATTRIBUTE Huawei-PPP-NCP-Type 70 integer ATTRIBUTE Huawei-VSI-Name 71 string ATTRIBUTE Huawei-Subnet-Mask 72 ipaddr ATTRIBUTE Huawei-Gateway-Address 73 ipaddr ATTRIBUTE Huawei-Lease-Time 74 integer ATTRIBUTE Huawei-Primary-WINS 75 ipaddr ATTRIBUTE Huawei-Secondary-WINS 76 ipaddr ATTRIBUTE Huawei-Input-Peak-Burst-Size 77 integer ATTRIBUTE Huawei-Output-Peak-Burst-Size 78 integer ATTRIBUTE Huawei-Reduced-CIR 79 integer ATTRIBUTE Huawei-Tunnel-Session-Limit 80 integer ATTRIBUTE Huawei-Zone-Name 81 string ATTRIBUTE Huawei-Data-Filter 82 string ATTRIBUTE Huawei-Access-Service 83 string ATTRIBUTE Huawei-HW-Accounting-Level 84 integer ATTRIBUTE Huawei-HW-Portal-Mode 85 integer ATTRIBUTE Huawei-HW-DPI-Policy-Name 86 string ATTRIBUTE huawei-Policy-Route 87 ipaddr ATTRIBUTE Huawei-Framed-Pool 88 string ATTRIBUTE Huawei-HW-L2TP-Terminate-Cause 89 string ATTRIBUTE Huawei-HW-Multi-Account-Mode 90 integer ATTRIBUTE Huawei-Queue-Profile 91 string ATTRIBUTE Huawei-Layer4-Session-Limit 92 integer ATTRIBUTE Huawei-Multicast-Profile 93 string ATTRIBUTE Huawei-VPN-Instance 94 string ATTRIBUTE Huawei-Policy-Name 95 string ATTRIBUTE Huawei-Tunnel-Group-Name 96 string ATTRIBUTE Huawei-Multicast-Source-Group 97 string ATTRIBUTE Huawei-Multicast-Receive-Group 98 ipaddr ATTRIBUTE Huawei-User-Multicast-Type 99 integer ATTRIBUTE Huawei-Reduced-PIR 100 integer ATTRIBUTE Huawei-LI-ID 101 string ATTRIBUTE Huawei-LI-Md-Address 102 ipaddr ATTRIBUTE Huawei-LI-Md-Port 103 integer ATTRIBUTE Huawei-LI-Md-VpnInstance 104 string ATTRIBUTE Huawei-Service-Chg-Cmd 105 integer ATTRIBUTE Huawei-Acct-Packet-Type 106 integer ATTRIBUTE Huawei-Call-Reference 107 integer ATTRIBUTE Huawei-PSTN-Port 108 integer ATTRIBUTE Huawei-Voip-Service-Type 109 integer ATTRIBUTE Huawei-Acct-Connection-Time 110 integer ATTRIBUTE Huawei-Error-Reason 112 integer ATTRIBUTE Huawei-Remain-Monney 113 integer ATTRIBUTE Huawei-Org-GK-ipaddr 123 ipaddr ATTRIBUTE Huawei-Org-GW-ipaddr 124 ipaddr ATTRIBUTE Huawei-Dst-GK-ipaddr 125 ipaddr ATTRIBUTE Huawei-Dst-GW-ipaddr 126 ipaddr ATTRIBUTE Huawei-Access-Num 127 string ATTRIBUTE Huawei-Remain-Time 128 integer ATTRIBUTE Huawei-Codec-Type 131 integer ATTRIBUTE Huawei-Transfer-Num 132 string ATTRIBUTE Huawei-New-User-Name 133 string ATTRIBUTE Huawei-Transfer-Station-Id 134 string ATTRIBUTE Huawei-Primary-DNS 135 ipaddr ATTRIBUTE Huawei-Secondary-DNS 136 ipaddr ATTRIBUTE Huawei-ONLY-Account-Type 137 integer ATTRIBUTE Huawei-Domain-Name 138 string ATTRIBUTE Huawei-ANCP-Profile 139 string ATTRIBUTE Huawei-HTTP-Redirect-URL 140 string ATTRIBUTE Huawei-Loopback-Address 141 string ATTRIBUTE Huawei-QoS-Profile-Type 142 integer ATTRIBUTE Huawei-HW-Max-List-Num 143 integer ATTRIBUTE Huawei-Flow-Info 211 string ATTRIBUTE Huawei-Flow-Id 212 integer ATTRIBUTE Huawei-DHCP-Server-IP 214 ipaddr ATTRIBUTE Huawei-Application-Type 215 integer ATTRIBUTE Huawei-Indication-Flag 216 octets # integer?? ATTRIBUTE Huawei-Original_NAS-IP_Address 217 ipaddr ATTRIBUTE Huawei-User-Priority 218 integer ATTRIBUTE Huawei-ACS-Url 219 string ATTRIBUTE Huawei-Provision-Code 220 string ATTRIBUTE Huawei-Application-Scene 221 octets ATTRIBUTE Huawei-MS-Maximum-MAC-Study-Number 222 octets # ether?? ATTRIBUTE Huawei-Version 254 string ATTRIBUTE Huawei-Product-ID 255 string # # Integer translations # VALUE Huawei-User-Priority Common 0 VALUE Huawei-User-Priority Copper 1 VALUE Huawei-User-Priority Silver 2 VALUE Huawei-User-Priority Gold 3 VALUE Huawei-Application-Type Fixed 1 VALUE Huawei-Application-Type Nomadic 2 VALUE Huawei-Application-Type Portable 3 VALUE Huawei-Application-Type Simple-Mobile 4 VALUE Huawei-Application-Type Full-Mobile 5 END-VENDOR Huawei freeradius-server/share/dictionary.iea000066400000000000000000000007441257552170400204570ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2011 The FreeRADIUS Server project and contributors # # IEA Software, Inc. # RADIUS VSA Dictionary # http://www.iea-software.com VENDOR IEA-Software 24023 BEGIN-VENDOR IEA-Software # AirMarshal Attributes [1-30] ATTRIBUTE AM-Interrupt-HTMLFile 1 string ATTRIBUTE AM-Interrupt-Interval 2 integer ATTRIBUTE AM-Interrupt-Timeout 3 integer ATTRIBUTE AM-Status-HTMLFile 4 string ATTRIBUTE AM-HTTP-Proxy-Port 5 integer END-VENDOR IEA-Software freeradius-server/share/dictionary.infonet000066400000000000000000000030151257552170400213550ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2011 The FreeRADIUS Server project and contributors # # dictionary.infonet # # Accounting VSAs by # "Bernard Lhoas from Infonet" # # Version: @(#)dictionary.infonet 1.00 # VENDOR infonet 4453 # # Standard attribute # # I would like to change the attribute number of Infonet-Account-Number # but we are already using it in production and changing could get # messy. Same with Infonet-Type. -Clark BEGIN-VENDOR infonet ATTRIBUTE Infonet-Proxy 238 string ATTRIBUTE Infonet-Config 239 string ATTRIBUTE Infonet-MCS-Country 240 string ATTRIBUTE Infonet-MCS-Region 241 string ATTRIBUTE Infonet-MCS-Off-Peak 242 string ATTRIBUTE Infonet-MCS-Overflow 243 string ATTRIBUTE Infonet-MCS-Port 244 string ATTRIBUTE Infonet-MCS-Port-Count 245 string ATTRIBUTE Infonet-Account-Number 247 string ATTRIBUTE Infonet-Type 248 string # # Infonet-Specific Attributes # # Note: Only Attributes < 256 will go on the wire. They are known as # "wire attributes". # Attributes > 256 don't get sent to a NAS and don't get forwarded # to a proxy site. This includes accounting packets as well as # auth packets. # ATTRIBUTE Infonet-Pool-Request 252 string ATTRIBUTE Infonet-Surcharge-Type 254 integer ATTRIBUTE Infonet-NAS-Location 255 string ATTRIBUTE Infonet-Random-IP-Pool 246 string # ATTRIBUTE Infonet-Realm-Type 249 string ATTRIBUTE Infonet-LoginHost-Dest 250 string ATTRIBUTE Infonet-Tunnel-Decision-IP 251 string END-VENDOR infonet freeradius-server/share/dictionary.ipunplugged000066400000000000000000000013751257552170400222450ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2011 The FreeRADIUS Server project and contributors ############################################################################## # # ipUnplugged # http://www.ipunplugged.com/ # # $Id$ # ############################################################################## VENDOR ipUnplugged 5925 BEGIN-VENDOR ipUnplugged ATTRIBUTE IPU-MIP-Spi 51 integer ATTRIBUTE IPU-MIP-Key 52 string ATTRIBUTE IPU-MIP-Alg-Type 53 integer ATTRIBUTE IPU-MIP-Alg-Mode 54 integer ATTRIBUTE IPU-MIP-Replay-Prot 55 integer ATTRIBUTE IPU-IKE-Remote-Addr 61 ipaddr ATTRIBUTE IPU-IKE-Local-Addr 62 ipaddr ATTRIBUTE IPU-IKE-Auth 63 string ATTRIBUTE IPU-IKE-Conf-Name 64 string ATTRIBUTE IPU-IKE-Cmd 65 string END-VENDOR ipUnplugged freeradius-server/share/dictionary.issanni000066400000000000000000000023571257552170400213670ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2011 The FreeRADIUS Server project and contributors ############################################################################## # # UTStarcom Issanni DSL router. # # $Id$ # ############################################################################## VENDOR Issanni 5948 BEGIN-VENDOR Issanni # # UTStarcom Issanni DSL router. # ATTRIBUTE Issanni-SoftFlow-Template 1 string ATTRIBUTE Issanni-NAT-Support 2 string ATTRIBUTE Issanni-Routing-Context 3 string ATTRIBUTE Issanni-Tunnel-Name 4 string ATTRIBUTE Issanni-IP-Pool-Name 5 string ATTRIBUTE Issanni-PPPoE-URL 6 string ATTRIBUTE Issanni-PPPoE-MOTM 7 string ATTRIBUTE Issanni-Service 8 string ATTRIBUTE Issanni-Pri-DNS 9 ipaddr ATTRIBUTE Issanni-Sec-DNS 10 ipaddr ATTRIBUTE Issanni-Pri-NBNS 11 ipaddr ATTRIBUTE Issanni-Sec-NBNS 12 ipaddr ATTRIBUTE Issanni-Traffic-Class 13 string ATTRIBUTE Issanni-Tunnel-Type 14 integer ATTRIBUTE Issanni-NAT-Type 15 integer ATTRIBUTE Issanni-QOS-Class 16 string ATTRIBUTE Issanni-Interface-Name 17 string VALUE Issanni-Tunnel-Type IP-IP 1 VALUE Issanni-Tunnel-Type ESP 2 VALUE Issanni-Tunnel-Type L2TP 3 VALUE Issanni-NAT-Type NAT 1 VALUE Issanni-NAT-Type NAPT 2 END-VENDOR Issanni freeradius-server/share/dictionary.itk000066400000000000000000000027151257552170400205100ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2011 The FreeRADIUS Server project and contributors # # http://www.digieurope.com/ # $Id$ # VENDOR ITK 1195 BEGIN-VENDOR ITK ATTRIBUTE ITK-Auth-Serv-IP 100 ipaddr ATTRIBUTE ITK-Auth-Serv-Prot 101 integer ATTRIBUTE ITK-Provider-Id 102 integer ATTRIBUTE ITK-Usergroup 103 integer ATTRIBUTE ITK-Banner 104 string ATTRIBUTE ITK-Username-Prompt 105 string ATTRIBUTE ITK-Password-Prompt 106 string ATTRIBUTE ITK-Welcome-Message 107 string ATTRIBUTE ITK-Prompt 108 string ATTRIBUTE ITK-IP-Pool 109 integer ATTRIBUTE ITK-Tunnel-IP 110 ipaddr ATTRIBUTE ITK-Tunnel-Prot 111 integer ATTRIBUTE ITK-Acct-Serv-IP 112 ipaddr ATTRIBUTE ITK-Acct-Serv-Prot 113 integer ATTRIBUTE ITK-Filter-Rule 114 string ATTRIBUTE ITK-Channel-Binding 115 integer ATTRIBUTE ITK-Start-Delay 116 integer ATTRIBUTE ITK-NAS-Name 117 string ATTRIBUTE ITK-ISDN-Prot 118 integer ATTRIBUTE ITK-PPP-Auth-Type 119 integer ATTRIBUTE ITK-Dialout-Type 120 integer ATTRIBUTE ITK-Ftp-Auth-IP 121 ipaddr ATTRIBUTE ITK-Users-Default-Entry 122 string ATTRIBUTE ITK-Users-Default-Pw 123 string ATTRIBUTE ITK-Auth-Req-Type 124 string ATTRIBUTE ITK-Modem-Pool-Id 125 integer ATTRIBUTE ITK-Modem-Init-String 126 string ATTRIBUTE ITK-PPP-Client-Server-Mode 127 integer ATTRIBUTE ITK-PPP-Compression-Prot 128 string ATTRIBUTE ITK-Username 129 string ATTRIBUTE ITK-Dest-No 130 string ATTRIBUTE ITK-DDI 131 string END-VENDOR ITK freeradius-server/share/dictionary.jradius000066400000000000000000000007451257552170400213630ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2011 The FreeRADIUS Server project and contributors ############################################################################## # # jradius VSAs. See http://jradius.org # # $Id$ # ############################################################################## VENDOR JRadius 19211 BEGIN-VENDOR JRadius ATTRIBUTE JRadius-Request-Id 1 string ATTRIBUTE JRadius-Session-Id 2 string ATTRIBUTE JRadius-Proxy-Client 3 octets END-VENDOR JRadius freeradius-server/share/dictionary.juniper000066400000000000000000000011641257552170400213720ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2011 The FreeRADIUS Server project and contributors # # dictionary.juniper # # As posted to the list by Eric Kilfoil # # Version: $Id$ # VENDOR Juniper 2636 BEGIN-VENDOR Juniper ATTRIBUTE Juniper-Local-User-Name 1 string ATTRIBUTE Juniper-Allow-Commands 2 string ATTRIBUTE Juniper-Deny-Commands 3 string ATTRIBUTE Juniper-Allow-Configuration 4 string ATTRIBUTE Juniper-Deny-Configuration 5 string ATTRIBUTE Juniper-Interactive-Command 8 string ATTRIBUTE Juniper-Configuration-Change 9 string ATTRIBUTE Juniper-User-Permissions 10 string END-VENDOR Juniper freeradius-server/share/dictionary.karlnet000066400000000000000000003105731257552170400213650ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2011 The FreeRADIUS Server project and contributors # -------------------------------------- # KarlNet Vendor-specific information # -------------------------------------- #--------------------------------------------------------------------------- # "VENDOR" VENDOR-NAME VENDOR-ID #--------------------------------------------------------------------------- VENDOR KarlNet 762 #--------------------------------------------------------------------------- # "ATTRIBUTE" ATTRIBUTE-NAME ATTR-NUMBER ATTRTYPE VENDOR-NAME #--------------------------------------------------------------------------- # Sets the remote client's Station Name BEGIN-VENDOR KarlNet ATTRIBUTE KarlNet-TurboCell-Name 151 string # Sets the remote client's Data Transmit Rate ATTRIBUTE KarlNet-TurboCell-TxRate 152 integer #--------------------------------------------------------------------------- # "VALUE" ATTRIBUTE-NAME SETTING-NAME SETTING-VALUE #--------------------------------------------------------------------------- # 0x00 // Use the locally defined Data Rate VALUE KarlNet-TurboCell-TxRate TxRate-Local 0 # 0x08 // Use the maximum data rate possible VALUE KarlNet-TurboCell-TxRate TxRate-MaxSpeed 8 VALUE KarlNet-TurboCell-TxRate TxRate-11k 11 VALUE KarlNet-TurboCell-TxRate TxRate-12k 12 VALUE KarlNet-TurboCell-TxRate TxRate-13k 13 VALUE KarlNet-TurboCell-TxRate TxRate-14k 14 VALUE KarlNet-TurboCell-TxRate TxRate-15k 15 VALUE KarlNet-TurboCell-TxRate TxRate-16k 16 VALUE KarlNet-TurboCell-TxRate TxRate-17k 17 VALUE KarlNet-TurboCell-TxRate TxRate-18k 18 VALUE KarlNet-TurboCell-TxRate TxRate-19k 19 VALUE KarlNet-TurboCell-TxRate TxRate-20k 20 VALUE KarlNet-TurboCell-TxRate TxRate-21k 21 VALUE KarlNet-TurboCell-TxRate TxRate-22k 22 VALUE KarlNet-TurboCell-TxRate TxRate-23k 23 VALUE KarlNet-TurboCell-TxRate TxRate-24k 24 VALUE KarlNet-TurboCell-TxRate TxRate-25k 25 VALUE KarlNet-TurboCell-TxRate TxRate-26k 26 VALUE KarlNet-TurboCell-TxRate TxRate-27k 27 VALUE KarlNet-TurboCell-TxRate TxRate-28k 28 VALUE KarlNet-TurboCell-TxRate TxRate-29k 29 VALUE KarlNet-TurboCell-TxRate TxRate-30k 30 VALUE KarlNet-TurboCell-TxRate TxRate-31k 31 VALUE KarlNet-TurboCell-TxRate TxRate-32k 32 VALUE KarlNet-TurboCell-TxRate TxRate-33k 33 VALUE KarlNet-TurboCell-TxRate TxRate-34k 34 VALUE KarlNet-TurboCell-TxRate TxRate-35k 35 VALUE KarlNet-TurboCell-TxRate TxRate-36k 36 VALUE KarlNet-TurboCell-TxRate TxRate-37k 37 VALUE KarlNet-TurboCell-TxRate TxRate-38k 38 VALUE KarlNet-TurboCell-TxRate TxRate-39k 39 VALUE KarlNet-TurboCell-TxRate TxRate-40k 40 VALUE KarlNet-TurboCell-TxRate TxRate-41k 41 VALUE KarlNet-TurboCell-TxRate TxRate-42k 42 VALUE KarlNet-TurboCell-TxRate TxRate-43k 43 VALUE KarlNet-TurboCell-TxRate TxRate-44k 44 VALUE KarlNet-TurboCell-TxRate TxRate-45k 45 VALUE KarlNet-TurboCell-TxRate TxRate-46k 46 VALUE KarlNet-TurboCell-TxRate TxRate-47k 47 VALUE KarlNet-TurboCell-TxRate TxRate-48k 48 VALUE KarlNet-TurboCell-TxRate TxRate-49k 49 VALUE KarlNet-TurboCell-TxRate TxRate-50k 50 VALUE KarlNet-TurboCell-TxRate TxRate-51k 51 VALUE KarlNet-TurboCell-TxRate TxRate-52k 52 VALUE KarlNet-TurboCell-TxRate TxRate-53k 53 VALUE KarlNet-TurboCell-TxRate TxRate-54k 54 VALUE KarlNet-TurboCell-TxRate TxRate-55k 55 VALUE KarlNet-TurboCell-TxRate TxRate-56k 56 VALUE KarlNet-TurboCell-TxRate TxRate-57k 57 VALUE KarlNet-TurboCell-TxRate TxRate-58k 58 VALUE KarlNet-TurboCell-TxRate TxRate-59k 59 VALUE KarlNet-TurboCell-TxRate TxRate-60k 60 VALUE KarlNet-TurboCell-TxRate TxRate-61k 61 VALUE KarlNet-TurboCell-TxRate TxRate-62k 62 VALUE KarlNet-TurboCell-TxRate TxRate-63k 63 VALUE KarlNet-TurboCell-TxRate TxRate-64k 64 VALUE KarlNet-TurboCell-TxRate TxRate-65k 65 VALUE KarlNet-TurboCell-TxRate TxRate-66k 66 VALUE KarlNet-TurboCell-TxRate TxRate-67k 67 VALUE KarlNet-TurboCell-TxRate TxRate-68k 68 VALUE KarlNet-TurboCell-TxRate TxRate-69k 69 VALUE KarlNet-TurboCell-TxRate TxRate-70k 70 VALUE KarlNet-TurboCell-TxRate TxRate-71k 71 VALUE KarlNet-TurboCell-TxRate TxRate-72k 72 VALUE KarlNet-TurboCell-TxRate TxRate-73k 73 VALUE KarlNet-TurboCell-TxRate TxRate-74k 74 VALUE KarlNet-TurboCell-TxRate TxRate-75k 75 VALUE KarlNet-TurboCell-TxRate TxRate-76k 76 VALUE KarlNet-TurboCell-TxRate TxRate-77k 77 VALUE KarlNet-TurboCell-TxRate TxRate-78k 78 VALUE KarlNet-TurboCell-TxRate TxRate-79k 79 VALUE KarlNet-TurboCell-TxRate TxRate-80k 80 VALUE KarlNet-TurboCell-TxRate TxRate-81k 81 VALUE KarlNet-TurboCell-TxRate TxRate-82k 82 VALUE KarlNet-TurboCell-TxRate TxRate-83k 83 VALUE KarlNet-TurboCell-TxRate TxRate-84k 84 VALUE KarlNet-TurboCell-TxRate TxRate-85k 85 VALUE KarlNet-TurboCell-TxRate TxRate-86k 86 VALUE KarlNet-TurboCell-TxRate TxRate-87k 87 VALUE KarlNet-TurboCell-TxRate TxRate-88k 88 VALUE KarlNet-TurboCell-TxRate TxRate-89k 89 VALUE KarlNet-TurboCell-TxRate TxRate-90k 90 VALUE KarlNet-TurboCell-TxRate TxRate-91k 91 VALUE KarlNet-TurboCell-TxRate TxRate-92k 92 VALUE KarlNet-TurboCell-TxRate TxRate-93k 93 VALUE KarlNet-TurboCell-TxRate TxRate-94k 94 VALUE KarlNet-TurboCell-TxRate TxRate-95k 95 VALUE KarlNet-TurboCell-TxRate TxRate-96k 96 VALUE KarlNet-TurboCell-TxRate TxRate-97k 97 VALUE KarlNet-TurboCell-TxRate TxRate-98k 98 VALUE KarlNet-TurboCell-TxRate TxRate-99k 99 VALUE KarlNet-TurboCell-TxRate TxRate-100k 100 VALUE KarlNet-TurboCell-TxRate TxRate-101k 101 VALUE KarlNet-TurboCell-TxRate TxRate-102k 102 VALUE KarlNet-TurboCell-TxRate TxRate-103k 103 VALUE KarlNet-TurboCell-TxRate TxRate-104k 104 VALUE KarlNet-TurboCell-TxRate TxRate-105k 105 VALUE KarlNet-TurboCell-TxRate TxRate-106k 106 VALUE KarlNet-TurboCell-TxRate TxRate-107k 107 VALUE KarlNet-TurboCell-TxRate TxRate-108k 108 VALUE KarlNet-TurboCell-TxRate TxRate-109k 109 VALUE KarlNet-TurboCell-TxRate TxRate-110k 110 VALUE KarlNet-TurboCell-TxRate TxRate-111k 111 VALUE KarlNet-TurboCell-TxRate TxRate-112k 112 VALUE KarlNet-TurboCell-TxRate TxRate-113k 113 VALUE KarlNet-TurboCell-TxRate TxRate-114k 114 VALUE KarlNet-TurboCell-TxRate TxRate-115k 115 VALUE KarlNet-TurboCell-TxRate TxRate-116k 116 VALUE KarlNet-TurboCell-TxRate TxRate-117k 117 VALUE KarlNet-TurboCell-TxRate TxRate-118k 118 VALUE KarlNet-TurboCell-TxRate TxRate-119k 119 VALUE KarlNet-TurboCell-TxRate TxRate-120k 120 VALUE KarlNet-TurboCell-TxRate TxRate-121k 121 VALUE KarlNet-TurboCell-TxRate TxRate-122k 122 VALUE KarlNet-TurboCell-TxRate TxRate-123k 123 VALUE KarlNet-TurboCell-TxRate TxRate-124k 124 VALUE KarlNet-TurboCell-TxRate TxRate-125k 125 VALUE KarlNet-TurboCell-TxRate TxRate-126k 126 VALUE KarlNet-TurboCell-TxRate TxRate-127k 127 VALUE KarlNet-TurboCell-TxRate TxRate-128k 128 VALUE KarlNet-TurboCell-TxRate TxRate-129k 129 VALUE KarlNet-TurboCell-TxRate TxRate-130k 130 VALUE KarlNet-TurboCell-TxRate TxRate-131k 131 VALUE KarlNet-TurboCell-TxRate TxRate-132k 132 VALUE KarlNet-TurboCell-TxRate TxRate-133k 133 VALUE KarlNet-TurboCell-TxRate TxRate-134k 134 VALUE KarlNet-TurboCell-TxRate TxRate-135k 135 VALUE KarlNet-TurboCell-TxRate TxRate-136k 136 VALUE KarlNet-TurboCell-TxRate TxRate-137k 137 VALUE KarlNet-TurboCell-TxRate TxRate-138k 138 VALUE KarlNet-TurboCell-TxRate TxRate-139k 139 VALUE KarlNet-TurboCell-TxRate TxRate-140k 140 VALUE KarlNet-TurboCell-TxRate TxRate-141k 141 VALUE KarlNet-TurboCell-TxRate TxRate-142k 142 VALUE KarlNet-TurboCell-TxRate TxRate-143k 143 VALUE KarlNet-TurboCell-TxRate TxRate-144k 144 VALUE KarlNet-TurboCell-TxRate TxRate-145k 145 VALUE KarlNet-TurboCell-TxRate TxRate-146k 146 VALUE KarlNet-TurboCell-TxRate TxRate-147k 147 VALUE KarlNet-TurboCell-TxRate TxRate-148k 148 VALUE KarlNet-TurboCell-TxRate TxRate-149k 149 VALUE KarlNet-TurboCell-TxRate TxRate-150k 150 VALUE KarlNet-TurboCell-TxRate TxRate-151k 151 VALUE KarlNet-TurboCell-TxRate TxRate-152k 152 VALUE KarlNet-TurboCell-TxRate TxRate-153k 153 VALUE KarlNet-TurboCell-TxRate TxRate-154k 154 VALUE KarlNet-TurboCell-TxRate TxRate-155k 155 VALUE KarlNet-TurboCell-TxRate TxRate-156k 156 VALUE KarlNet-TurboCell-TxRate TxRate-157k 157 VALUE KarlNet-TurboCell-TxRate TxRate-158k 158 VALUE KarlNet-TurboCell-TxRate TxRate-159k 159 VALUE KarlNet-TurboCell-TxRate TxRate-160k 160 VALUE KarlNet-TurboCell-TxRate TxRate-161k 161 VALUE KarlNet-TurboCell-TxRate TxRate-162k 162 VALUE KarlNet-TurboCell-TxRate TxRate-163k 163 VALUE KarlNet-TurboCell-TxRate TxRate-164k 164 VALUE KarlNet-TurboCell-TxRate TxRate-165k 165 VALUE KarlNet-TurboCell-TxRate TxRate-166k 166 VALUE KarlNet-TurboCell-TxRate TxRate-167k 167 VALUE KarlNet-TurboCell-TxRate TxRate-168k 168 VALUE KarlNet-TurboCell-TxRate TxRate-169k 169 VALUE KarlNet-TurboCell-TxRate TxRate-170k 170 VALUE KarlNet-TurboCell-TxRate TxRate-171k 171 VALUE KarlNet-TurboCell-TxRate TxRate-172k 172 VALUE KarlNet-TurboCell-TxRate TxRate-173k 173 VALUE KarlNet-TurboCell-TxRate TxRate-174k 174 VALUE KarlNet-TurboCell-TxRate TxRate-175k 175 VALUE KarlNet-TurboCell-TxRate TxRate-176k 176 VALUE KarlNet-TurboCell-TxRate TxRate-177k 177 VALUE KarlNet-TurboCell-TxRate TxRate-178k 178 VALUE KarlNet-TurboCell-TxRate TxRate-179k 179 VALUE KarlNet-TurboCell-TxRate TxRate-180k 180 VALUE KarlNet-TurboCell-TxRate TxRate-181k 181 VALUE KarlNet-TurboCell-TxRate TxRate-182k 182 VALUE KarlNet-TurboCell-TxRate TxRate-183k 183 VALUE KarlNet-TurboCell-TxRate TxRate-184k 184 VALUE KarlNet-TurboCell-TxRate TxRate-185k 185 VALUE KarlNet-TurboCell-TxRate TxRate-186k 186 VALUE KarlNet-TurboCell-TxRate TxRate-187k 187 VALUE KarlNet-TurboCell-TxRate TxRate-188k 188 VALUE KarlNet-TurboCell-TxRate TxRate-189k 189 VALUE KarlNet-TurboCell-TxRate TxRate-190k 190 VALUE KarlNet-TurboCell-TxRate TxRate-191k 191 VALUE KarlNet-TurboCell-TxRate TxRate-192k 192 VALUE KarlNet-TurboCell-TxRate TxRate-193k 193 VALUE KarlNet-TurboCell-TxRate TxRate-194k 194 VALUE KarlNet-TurboCell-TxRate TxRate-195k 195 VALUE KarlNet-TurboCell-TxRate TxRate-196k 196 VALUE KarlNet-TurboCell-TxRate TxRate-197k 197 VALUE KarlNet-TurboCell-TxRate TxRate-198k 198 VALUE KarlNet-TurboCell-TxRate TxRate-199k 199 VALUE KarlNet-TurboCell-TxRate TxRate-200k 200 VALUE KarlNet-TurboCell-TxRate TxRate-201k 201 VALUE KarlNet-TurboCell-TxRate TxRate-202k 202 VALUE KarlNet-TurboCell-TxRate TxRate-203k 203 VALUE KarlNet-TurboCell-TxRate TxRate-204k 204 VALUE KarlNet-TurboCell-TxRate TxRate-205k 205 VALUE KarlNet-TurboCell-TxRate TxRate-206k 206 VALUE KarlNet-TurboCell-TxRate TxRate-207k 207 VALUE KarlNet-TurboCell-TxRate TxRate-208k 208 VALUE KarlNet-TurboCell-TxRate TxRate-209k 209 VALUE KarlNet-TurboCell-TxRate TxRate-210k 210 VALUE KarlNet-TurboCell-TxRate TxRate-211k 211 VALUE KarlNet-TurboCell-TxRate TxRate-212k 212 VALUE KarlNet-TurboCell-TxRate TxRate-213k 213 VALUE KarlNet-TurboCell-TxRate TxRate-214k 214 VALUE KarlNet-TurboCell-TxRate TxRate-215k 215 VALUE KarlNet-TurboCell-TxRate TxRate-216k 216 VALUE KarlNet-TurboCell-TxRate TxRate-217k 217 VALUE KarlNet-TurboCell-TxRate TxRate-218k 218 VALUE KarlNet-TurboCell-TxRate TxRate-219k 219 VALUE KarlNet-TurboCell-TxRate TxRate-220k 220 VALUE KarlNet-TurboCell-TxRate TxRate-221k 221 VALUE KarlNet-TurboCell-TxRate TxRate-222k 222 VALUE KarlNet-TurboCell-TxRate TxRate-223k 223 VALUE KarlNet-TurboCell-TxRate TxRate-224k 224 VALUE KarlNet-TurboCell-TxRate TxRate-225k 225 VALUE KarlNet-TurboCell-TxRate TxRate-226k 226 VALUE KarlNet-TurboCell-TxRate TxRate-227k 227 VALUE KarlNet-TurboCell-TxRate TxRate-228k 228 VALUE KarlNet-TurboCell-TxRate TxRate-229k 229 VALUE KarlNet-TurboCell-TxRate TxRate-230k 230 VALUE KarlNet-TurboCell-TxRate TxRate-231k 231 VALUE KarlNet-TurboCell-TxRate TxRate-232k 232 VALUE KarlNet-TurboCell-TxRate TxRate-233k 233 VALUE KarlNet-TurboCell-TxRate TxRate-234k 234 VALUE KarlNet-TurboCell-TxRate TxRate-235k 235 VALUE KarlNet-TurboCell-TxRate TxRate-236k 236 VALUE KarlNet-TurboCell-TxRate TxRate-237k 237 VALUE KarlNet-TurboCell-TxRate TxRate-238k 238 VALUE KarlNet-TurboCell-TxRate TxRate-239k 239 VALUE KarlNet-TurboCell-TxRate TxRate-240k 240 VALUE KarlNet-TurboCell-TxRate TxRate-241k 241 VALUE KarlNet-TurboCell-TxRate TxRate-242k 242 VALUE KarlNet-TurboCell-TxRate TxRate-243k 243 VALUE KarlNet-TurboCell-TxRate TxRate-244k 244 VALUE KarlNet-TurboCell-TxRate TxRate-245k 245 VALUE KarlNet-TurboCell-TxRate TxRate-246k 246 VALUE KarlNet-TurboCell-TxRate TxRate-247k 247 VALUE KarlNet-TurboCell-TxRate TxRate-248k 248 VALUE KarlNet-TurboCell-TxRate TxRate-249k 249 VALUE KarlNet-TurboCell-TxRate TxRate-250k 250 VALUE KarlNet-TurboCell-TxRate TxRate-251k 251 VALUE KarlNet-TurboCell-TxRate TxRate-252k 252 VALUE KarlNet-TurboCell-TxRate TxRate-253k 253 VALUE KarlNet-TurboCell-TxRate TxRate-254k 254 VALUE KarlNet-TurboCell-TxRate TxRate-255k 255 VALUE KarlNet-TurboCell-TxRate TxRate-256k 256 VALUE KarlNet-TurboCell-TxRate TxRate-257k 257 VALUE KarlNet-TurboCell-TxRate TxRate-258k 258 VALUE KarlNet-TurboCell-TxRate TxRate-259k 259 VALUE KarlNet-TurboCell-TxRate TxRate-260k 260 VALUE KarlNet-TurboCell-TxRate TxRate-261k 261 VALUE KarlNet-TurboCell-TxRate TxRate-262k 262 VALUE KarlNet-TurboCell-TxRate TxRate-263k 263 VALUE KarlNet-TurboCell-TxRate TxRate-264k 264 VALUE KarlNet-TurboCell-TxRate TxRate-265k 265 VALUE KarlNet-TurboCell-TxRate TxRate-266k 266 VALUE KarlNet-TurboCell-TxRate TxRate-267k 267 VALUE KarlNet-TurboCell-TxRate TxRate-268k 268 VALUE KarlNet-TurboCell-TxRate TxRate-269k 269 VALUE KarlNet-TurboCell-TxRate TxRate-270k 270 VALUE KarlNet-TurboCell-TxRate TxRate-271k 271 VALUE KarlNet-TurboCell-TxRate TxRate-272k 272 VALUE KarlNet-TurboCell-TxRate TxRate-273k 273 VALUE KarlNet-TurboCell-TxRate TxRate-274k 274 VALUE KarlNet-TurboCell-TxRate TxRate-275k 275 VALUE KarlNet-TurboCell-TxRate TxRate-276k 276 VALUE KarlNet-TurboCell-TxRate TxRate-277k 277 VALUE KarlNet-TurboCell-TxRate TxRate-278k 278 VALUE KarlNet-TurboCell-TxRate TxRate-279k 279 VALUE KarlNet-TurboCell-TxRate TxRate-280k 280 VALUE KarlNet-TurboCell-TxRate TxRate-281k 281 VALUE KarlNet-TurboCell-TxRate TxRate-282k 282 VALUE KarlNet-TurboCell-TxRate TxRate-283k 283 VALUE KarlNet-TurboCell-TxRate TxRate-284k 284 VALUE KarlNet-TurboCell-TxRate TxRate-285k 285 VALUE KarlNet-TurboCell-TxRate TxRate-286k 286 VALUE KarlNet-TurboCell-TxRate TxRate-287k 287 VALUE KarlNet-TurboCell-TxRate TxRate-288k 288 VALUE KarlNet-TurboCell-TxRate TxRate-289k 289 VALUE KarlNet-TurboCell-TxRate TxRate-290k 290 VALUE KarlNet-TurboCell-TxRate TxRate-291k 291 VALUE KarlNet-TurboCell-TxRate TxRate-292k 292 VALUE KarlNet-TurboCell-TxRate TxRate-293k 293 VALUE KarlNet-TurboCell-TxRate TxRate-294k 294 VALUE KarlNet-TurboCell-TxRate TxRate-295k 295 VALUE KarlNet-TurboCell-TxRate TxRate-296k 296 VALUE KarlNet-TurboCell-TxRate TxRate-297k 297 VALUE KarlNet-TurboCell-TxRate TxRate-298k 298 VALUE KarlNet-TurboCell-TxRate TxRate-299k 299 VALUE KarlNet-TurboCell-TxRate TxRate-300k 300 VALUE KarlNet-TurboCell-TxRate TxRate-301k 301 VALUE KarlNet-TurboCell-TxRate TxRate-302k 302 VALUE KarlNet-TurboCell-TxRate TxRate-303k 303 VALUE KarlNet-TurboCell-TxRate TxRate-304k 304 VALUE KarlNet-TurboCell-TxRate TxRate-305k 305 VALUE KarlNet-TurboCell-TxRate TxRate-306k 306 VALUE KarlNet-TurboCell-TxRate TxRate-307k 307 VALUE KarlNet-TurboCell-TxRate TxRate-308k 308 VALUE KarlNet-TurboCell-TxRate TxRate-309k 309 VALUE KarlNet-TurboCell-TxRate TxRate-310k 310 VALUE KarlNet-TurboCell-TxRate TxRate-311k 311 VALUE KarlNet-TurboCell-TxRate TxRate-312k 312 VALUE KarlNet-TurboCell-TxRate TxRate-313k 313 VALUE KarlNet-TurboCell-TxRate TxRate-314k 314 VALUE KarlNet-TurboCell-TxRate TxRate-315k 315 VALUE KarlNet-TurboCell-TxRate TxRate-316k 316 VALUE KarlNet-TurboCell-TxRate TxRate-317k 317 VALUE KarlNet-TurboCell-TxRate TxRate-318k 318 VALUE KarlNet-TurboCell-TxRate TxRate-319k 319 VALUE KarlNet-TurboCell-TxRate TxRate-320k 320 VALUE KarlNet-TurboCell-TxRate TxRate-321k 321 VALUE KarlNet-TurboCell-TxRate TxRate-322k 322 VALUE KarlNet-TurboCell-TxRate TxRate-323k 323 VALUE KarlNet-TurboCell-TxRate TxRate-324k 324 VALUE KarlNet-TurboCell-TxRate TxRate-325k 325 VALUE KarlNet-TurboCell-TxRate TxRate-326k 326 VALUE KarlNet-TurboCell-TxRate TxRate-327k 327 VALUE KarlNet-TurboCell-TxRate TxRate-328k 328 VALUE KarlNet-TurboCell-TxRate TxRate-329k 329 VALUE KarlNet-TurboCell-TxRate TxRate-330k 330 VALUE KarlNet-TurboCell-TxRate TxRate-331k 331 VALUE KarlNet-TurboCell-TxRate TxRate-332k 332 VALUE KarlNet-TurboCell-TxRate TxRate-333k 333 VALUE KarlNet-TurboCell-TxRate TxRate-334k 334 VALUE KarlNet-TurboCell-TxRate TxRate-335k 335 VALUE KarlNet-TurboCell-TxRate TxRate-336k 336 VALUE KarlNet-TurboCell-TxRate TxRate-337k 337 VALUE KarlNet-TurboCell-TxRate TxRate-338k 338 VALUE KarlNet-TurboCell-TxRate TxRate-339k 339 VALUE KarlNet-TurboCell-TxRate TxRate-340k 340 VALUE KarlNet-TurboCell-TxRate TxRate-341k 341 VALUE KarlNet-TurboCell-TxRate TxRate-342k 342 VALUE KarlNet-TurboCell-TxRate TxRate-343k 343 VALUE KarlNet-TurboCell-TxRate TxRate-344k 344 VALUE KarlNet-TurboCell-TxRate TxRate-345k 345 VALUE KarlNet-TurboCell-TxRate TxRate-346k 346 VALUE KarlNet-TurboCell-TxRate TxRate-347k 347 VALUE KarlNet-TurboCell-TxRate TxRate-348k 348 VALUE KarlNet-TurboCell-TxRate TxRate-349k 349 VALUE KarlNet-TurboCell-TxRate TxRate-350k 350 VALUE KarlNet-TurboCell-TxRate TxRate-351k 351 VALUE KarlNet-TurboCell-TxRate TxRate-352k 352 VALUE KarlNet-TurboCell-TxRate TxRate-353k 353 VALUE KarlNet-TurboCell-TxRate TxRate-354k 354 VALUE KarlNet-TurboCell-TxRate TxRate-355k 355 VALUE KarlNet-TurboCell-TxRate TxRate-356k 356 VALUE KarlNet-TurboCell-TxRate TxRate-357k 357 VALUE KarlNet-TurboCell-TxRate TxRate-358k 358 VALUE KarlNet-TurboCell-TxRate TxRate-359k 359 VALUE KarlNet-TurboCell-TxRate TxRate-360k 360 VALUE KarlNet-TurboCell-TxRate TxRate-361k 361 VALUE KarlNet-TurboCell-TxRate TxRate-362k 362 VALUE KarlNet-TurboCell-TxRate TxRate-363k 363 VALUE KarlNet-TurboCell-TxRate TxRate-364k 364 VALUE KarlNet-TurboCell-TxRate TxRate-365k 365 VALUE KarlNet-TurboCell-TxRate TxRate-366k 366 VALUE KarlNet-TurboCell-TxRate TxRate-367k 367 VALUE KarlNet-TurboCell-TxRate TxRate-368k 368 VALUE KarlNet-TurboCell-TxRate TxRate-369k 369 VALUE KarlNet-TurboCell-TxRate TxRate-370k 370 VALUE KarlNet-TurboCell-TxRate TxRate-371k 371 VALUE KarlNet-TurboCell-TxRate TxRate-372k 372 VALUE KarlNet-TurboCell-TxRate TxRate-373k 373 VALUE KarlNet-TurboCell-TxRate TxRate-374k 374 VALUE KarlNet-TurboCell-TxRate TxRate-375k 375 VALUE KarlNet-TurboCell-TxRate TxRate-376k 376 VALUE KarlNet-TurboCell-TxRate TxRate-377k 377 VALUE KarlNet-TurboCell-TxRate TxRate-378k 378 VALUE KarlNet-TurboCell-TxRate TxRate-379k 379 VALUE KarlNet-TurboCell-TxRate TxRate-380k 380 VALUE KarlNet-TurboCell-TxRate TxRate-381k 381 VALUE KarlNet-TurboCell-TxRate TxRate-382k 382 VALUE KarlNet-TurboCell-TxRate TxRate-383k 383 VALUE KarlNet-TurboCell-TxRate TxRate-384k 384 VALUE KarlNet-TurboCell-TxRate TxRate-385k 385 VALUE KarlNet-TurboCell-TxRate TxRate-386k 386 VALUE KarlNet-TurboCell-TxRate TxRate-387k 387 VALUE KarlNet-TurboCell-TxRate TxRate-388k 388 VALUE KarlNet-TurboCell-TxRate TxRate-389k 389 VALUE KarlNet-TurboCell-TxRate TxRate-390k 390 VALUE KarlNet-TurboCell-TxRate TxRate-391k 391 VALUE KarlNet-TurboCell-TxRate TxRate-392k 392 VALUE KarlNet-TurboCell-TxRate TxRate-393k 393 VALUE KarlNet-TurboCell-TxRate TxRate-394k 394 VALUE KarlNet-TurboCell-TxRate TxRate-395k 395 VALUE KarlNet-TurboCell-TxRate TxRate-396k 396 VALUE KarlNet-TurboCell-TxRate TxRate-397k 397 VALUE KarlNet-TurboCell-TxRate TxRate-398k 398 VALUE KarlNet-TurboCell-TxRate TxRate-399k 399 VALUE KarlNet-TurboCell-TxRate TxRate-400k 400 VALUE KarlNet-TurboCell-TxRate TxRate-401k 401 VALUE KarlNet-TurboCell-TxRate TxRate-402k 402 VALUE KarlNet-TurboCell-TxRate TxRate-403k 403 VALUE KarlNet-TurboCell-TxRate TxRate-404k 404 VALUE KarlNet-TurboCell-TxRate TxRate-405k 405 VALUE KarlNet-TurboCell-TxRate TxRate-406k 406 VALUE KarlNet-TurboCell-TxRate TxRate-407k 407 VALUE KarlNet-TurboCell-TxRate TxRate-408k 408 VALUE KarlNet-TurboCell-TxRate TxRate-409k 409 VALUE KarlNet-TurboCell-TxRate TxRate-410k 410 VALUE KarlNet-TurboCell-TxRate TxRate-411k 411 VALUE KarlNet-TurboCell-TxRate TxRate-412k 412 VALUE KarlNet-TurboCell-TxRate TxRate-413k 413 VALUE KarlNet-TurboCell-TxRate TxRate-414k 414 VALUE KarlNet-TurboCell-TxRate TxRate-415k 415 VALUE KarlNet-TurboCell-TxRate TxRate-416k 416 VALUE KarlNet-TurboCell-TxRate TxRate-417k 417 VALUE KarlNet-TurboCell-TxRate TxRate-418k 418 VALUE KarlNet-TurboCell-TxRate TxRate-419k 419 VALUE KarlNet-TurboCell-TxRate TxRate-420k 420 VALUE KarlNet-TurboCell-TxRate TxRate-421k 421 VALUE KarlNet-TurboCell-TxRate TxRate-422k 422 VALUE KarlNet-TurboCell-TxRate TxRate-423k 423 VALUE KarlNet-TurboCell-TxRate TxRate-424k 424 VALUE KarlNet-TurboCell-TxRate TxRate-425k 425 VALUE KarlNet-TurboCell-TxRate TxRate-426k 426 VALUE KarlNet-TurboCell-TxRate TxRate-427k 427 VALUE KarlNet-TurboCell-TxRate TxRate-428k 428 VALUE KarlNet-TurboCell-TxRate TxRate-429k 429 VALUE KarlNet-TurboCell-TxRate TxRate-430k 430 VALUE KarlNet-TurboCell-TxRate TxRate-431k 431 VALUE KarlNet-TurboCell-TxRate TxRate-432k 432 VALUE KarlNet-TurboCell-TxRate TxRate-433k 433 VALUE KarlNet-TurboCell-TxRate TxRate-434k 434 VALUE KarlNet-TurboCell-TxRate TxRate-435k 435 VALUE KarlNet-TurboCell-TxRate TxRate-436k 436 VALUE KarlNet-TurboCell-TxRate TxRate-437k 437 VALUE KarlNet-TurboCell-TxRate TxRate-438k 438 VALUE KarlNet-TurboCell-TxRate TxRate-439k 439 VALUE KarlNet-TurboCell-TxRate TxRate-440k 440 VALUE KarlNet-TurboCell-TxRate TxRate-441k 441 VALUE KarlNet-TurboCell-TxRate TxRate-442k 442 VALUE KarlNet-TurboCell-TxRate TxRate-443k 443 VALUE KarlNet-TurboCell-TxRate TxRate-444k 444 VALUE KarlNet-TurboCell-TxRate TxRate-445k 445 VALUE KarlNet-TurboCell-TxRate TxRate-446k 446 VALUE KarlNet-TurboCell-TxRate TxRate-447k 447 VALUE KarlNet-TurboCell-TxRate TxRate-448k 448 VALUE KarlNet-TurboCell-TxRate TxRate-449k 449 VALUE KarlNet-TurboCell-TxRate TxRate-450k 450 VALUE KarlNet-TurboCell-TxRate TxRate-451k 451 VALUE KarlNet-TurboCell-TxRate TxRate-452k 452 VALUE KarlNet-TurboCell-TxRate TxRate-453k 453 VALUE KarlNet-TurboCell-TxRate TxRate-454k 454 VALUE KarlNet-TurboCell-TxRate TxRate-455k 455 VALUE KarlNet-TurboCell-TxRate TxRate-456k 456 VALUE KarlNet-TurboCell-TxRate TxRate-457k 457 VALUE KarlNet-TurboCell-TxRate TxRate-458k 458 VALUE KarlNet-TurboCell-TxRate TxRate-459k 459 VALUE KarlNet-TurboCell-TxRate TxRate-460k 460 VALUE KarlNet-TurboCell-TxRate TxRate-461k 461 VALUE KarlNet-TurboCell-TxRate TxRate-462k 462 VALUE KarlNet-TurboCell-TxRate TxRate-463k 463 VALUE KarlNet-TurboCell-TxRate TxRate-464k 464 VALUE KarlNet-TurboCell-TxRate TxRate-465k 465 VALUE KarlNet-TurboCell-TxRate TxRate-466k 466 VALUE KarlNet-TurboCell-TxRate TxRate-467k 467 VALUE KarlNet-TurboCell-TxRate TxRate-468k 468 VALUE KarlNet-TurboCell-TxRate TxRate-469k 469 VALUE KarlNet-TurboCell-TxRate TxRate-470k 470 VALUE KarlNet-TurboCell-TxRate TxRate-471k 471 VALUE KarlNet-TurboCell-TxRate TxRate-472k 472 VALUE KarlNet-TurboCell-TxRate TxRate-473k 473 VALUE KarlNet-TurboCell-TxRate TxRate-474k 474 VALUE KarlNet-TurboCell-TxRate TxRate-475k 475 VALUE KarlNet-TurboCell-TxRate TxRate-476k 476 VALUE KarlNet-TurboCell-TxRate TxRate-477k 477 VALUE KarlNet-TurboCell-TxRate TxRate-478k 478 VALUE KarlNet-TurboCell-TxRate TxRate-479k 479 VALUE KarlNet-TurboCell-TxRate TxRate-480k 480 VALUE KarlNet-TurboCell-TxRate TxRate-481k 481 VALUE KarlNet-TurboCell-TxRate TxRate-482k 482 VALUE KarlNet-TurboCell-TxRate TxRate-483k 483 VALUE KarlNet-TurboCell-TxRate TxRate-484k 484 VALUE KarlNet-TurboCell-TxRate TxRate-485k 485 VALUE KarlNet-TurboCell-TxRate TxRate-486k 486 VALUE KarlNet-TurboCell-TxRate TxRate-487k 487 VALUE KarlNet-TurboCell-TxRate TxRate-488k 488 VALUE KarlNet-TurboCell-TxRate TxRate-489k 489 VALUE KarlNet-TurboCell-TxRate TxRate-490k 490 VALUE KarlNet-TurboCell-TxRate TxRate-491k 491 VALUE KarlNet-TurboCell-TxRate TxRate-492k 492 VALUE KarlNet-TurboCell-TxRate TxRate-493k 493 VALUE KarlNet-TurboCell-TxRate TxRate-494k 494 VALUE KarlNet-TurboCell-TxRate TxRate-495k 495 VALUE KarlNet-TurboCell-TxRate TxRate-496k 496 VALUE KarlNet-TurboCell-TxRate TxRate-497k 497 VALUE KarlNet-TurboCell-TxRate TxRate-498k 498 VALUE KarlNet-TurboCell-TxRate TxRate-499k 499 VALUE KarlNet-TurboCell-TxRate TxRate-500k 500 VALUE KarlNet-TurboCell-TxRate TxRate-501k 501 VALUE KarlNet-TurboCell-TxRate TxRate-502k 502 VALUE KarlNet-TurboCell-TxRate TxRate-503k 503 VALUE KarlNet-TurboCell-TxRate TxRate-504k 504 VALUE KarlNet-TurboCell-TxRate TxRate-505k 505 VALUE KarlNet-TurboCell-TxRate TxRate-506k 506 VALUE KarlNet-TurboCell-TxRate TxRate-507k 507 VALUE KarlNet-TurboCell-TxRate TxRate-508k 508 VALUE KarlNet-TurboCell-TxRate TxRate-509k 509 VALUE KarlNet-TurboCell-TxRate TxRate-510k 510 VALUE KarlNet-TurboCell-TxRate TxRate-511k 511 VALUE KarlNet-TurboCell-TxRate TxRate-512k 512 VALUE KarlNet-TurboCell-TxRate TxRate-513k 513 VALUE KarlNet-TurboCell-TxRate TxRate-514k 514 VALUE KarlNet-TurboCell-TxRate TxRate-515k 515 VALUE KarlNet-TurboCell-TxRate TxRate-516k 516 VALUE KarlNet-TurboCell-TxRate TxRate-517k 517 VALUE KarlNet-TurboCell-TxRate TxRate-518k 518 VALUE KarlNet-TurboCell-TxRate TxRate-519k 519 VALUE KarlNet-TurboCell-TxRate TxRate-520k 520 VALUE KarlNet-TurboCell-TxRate TxRate-521k 521 VALUE KarlNet-TurboCell-TxRate TxRate-522k 522 VALUE KarlNet-TurboCell-TxRate TxRate-523k 523 VALUE KarlNet-TurboCell-TxRate TxRate-524k 524 VALUE KarlNet-TurboCell-TxRate TxRate-525k 525 VALUE KarlNet-TurboCell-TxRate TxRate-526k 526 VALUE KarlNet-TurboCell-TxRate TxRate-527k 527 VALUE KarlNet-TurboCell-TxRate TxRate-528k 528 VALUE KarlNet-TurboCell-TxRate TxRate-529k 529 VALUE KarlNet-TurboCell-TxRate TxRate-530k 530 VALUE KarlNet-TurboCell-TxRate TxRate-531k 531 VALUE KarlNet-TurboCell-TxRate TxRate-532k 532 VALUE KarlNet-TurboCell-TxRate TxRate-533k 533 VALUE KarlNet-TurboCell-TxRate TxRate-534k 534 VALUE KarlNet-TurboCell-TxRate TxRate-535k 535 VALUE KarlNet-TurboCell-TxRate TxRate-536k 536 VALUE KarlNet-TurboCell-TxRate TxRate-537k 537 VALUE KarlNet-TurboCell-TxRate TxRate-538k 538 VALUE KarlNet-TurboCell-TxRate TxRate-539k 539 VALUE KarlNet-TurboCell-TxRate TxRate-540k 540 VALUE KarlNet-TurboCell-TxRate TxRate-541k 541 VALUE KarlNet-TurboCell-TxRate TxRate-542k 542 VALUE KarlNet-TurboCell-TxRate TxRate-543k 543 VALUE KarlNet-TurboCell-TxRate TxRate-544k 544 VALUE KarlNet-TurboCell-TxRate TxRate-545k 545 VALUE KarlNet-TurboCell-TxRate TxRate-546k 546 VALUE KarlNet-TurboCell-TxRate TxRate-547k 547 VALUE KarlNet-TurboCell-TxRate TxRate-548k 548 VALUE KarlNet-TurboCell-TxRate TxRate-549k 549 VALUE KarlNet-TurboCell-TxRate TxRate-550k 550 VALUE KarlNet-TurboCell-TxRate TxRate-551k 551 VALUE KarlNet-TurboCell-TxRate TxRate-552k 552 VALUE KarlNet-TurboCell-TxRate TxRate-553k 553 VALUE KarlNet-TurboCell-TxRate TxRate-554k 554 VALUE KarlNet-TurboCell-TxRate TxRate-555k 555 VALUE KarlNet-TurboCell-TxRate TxRate-556k 556 VALUE KarlNet-TurboCell-TxRate TxRate-557k 557 VALUE KarlNet-TurboCell-TxRate TxRate-558k 558 VALUE KarlNet-TurboCell-TxRate TxRate-559k 559 VALUE KarlNet-TurboCell-TxRate TxRate-560k 560 VALUE KarlNet-TurboCell-TxRate TxRate-561k 561 VALUE KarlNet-TurboCell-TxRate TxRate-562k 562 VALUE KarlNet-TurboCell-TxRate TxRate-563k 563 VALUE KarlNet-TurboCell-TxRate TxRate-564k 564 VALUE KarlNet-TurboCell-TxRate TxRate-565k 565 VALUE KarlNet-TurboCell-TxRate TxRate-566k 566 VALUE KarlNet-TurboCell-TxRate TxRate-567k 567 VALUE KarlNet-TurboCell-TxRate TxRate-568k 568 VALUE KarlNet-TurboCell-TxRate TxRate-569k 569 VALUE KarlNet-TurboCell-TxRate TxRate-570k 570 VALUE KarlNet-TurboCell-TxRate TxRate-571k 571 VALUE KarlNet-TurboCell-TxRate TxRate-572k 572 VALUE KarlNet-TurboCell-TxRate TxRate-573k 573 VALUE KarlNet-TurboCell-TxRate TxRate-574k 574 VALUE KarlNet-TurboCell-TxRate TxRate-575k 575 VALUE KarlNet-TurboCell-TxRate TxRate-576k 576 VALUE KarlNet-TurboCell-TxRate TxRate-577k 577 VALUE KarlNet-TurboCell-TxRate TxRate-578k 578 VALUE KarlNet-TurboCell-TxRate TxRate-579k 579 VALUE KarlNet-TurboCell-TxRate TxRate-580k 580 VALUE KarlNet-TurboCell-TxRate TxRate-581k 581 VALUE KarlNet-TurboCell-TxRate TxRate-582k 582 VALUE KarlNet-TurboCell-TxRate TxRate-583k 583 VALUE KarlNet-TurboCell-TxRate TxRate-584k 584 VALUE KarlNet-TurboCell-TxRate TxRate-585k 585 VALUE KarlNet-TurboCell-TxRate TxRate-586k 586 VALUE KarlNet-TurboCell-TxRate TxRate-587k 587 VALUE KarlNet-TurboCell-TxRate TxRate-588k 588 VALUE KarlNet-TurboCell-TxRate TxRate-589k 589 VALUE KarlNet-TurboCell-TxRate TxRate-590k 590 VALUE KarlNet-TurboCell-TxRate TxRate-591k 591 VALUE KarlNet-TurboCell-TxRate TxRate-592k 592 VALUE KarlNet-TurboCell-TxRate TxRate-593k 593 VALUE KarlNet-TurboCell-TxRate TxRate-594k 594 VALUE KarlNet-TurboCell-TxRate TxRate-595k 595 VALUE KarlNet-TurboCell-TxRate TxRate-596k 596 VALUE KarlNet-TurboCell-TxRate TxRate-597k 597 VALUE KarlNet-TurboCell-TxRate TxRate-598k 598 VALUE KarlNet-TurboCell-TxRate TxRate-599k 599 VALUE KarlNet-TurboCell-TxRate TxRate-600k 600 VALUE KarlNet-TurboCell-TxRate TxRate-601k 601 VALUE KarlNet-TurboCell-TxRate TxRate-602k 602 VALUE KarlNet-TurboCell-TxRate TxRate-603k 603 VALUE KarlNet-TurboCell-TxRate TxRate-604k 604 VALUE KarlNet-TurboCell-TxRate TxRate-605k 605 VALUE KarlNet-TurboCell-TxRate TxRate-606k 606 VALUE KarlNet-TurboCell-TxRate TxRate-607k 607 VALUE KarlNet-TurboCell-TxRate TxRate-608k 608 VALUE KarlNet-TurboCell-TxRate TxRate-609k 609 VALUE KarlNet-TurboCell-TxRate TxRate-610k 610 VALUE KarlNet-TurboCell-TxRate TxRate-611k 611 VALUE KarlNet-TurboCell-TxRate TxRate-612k 612 VALUE KarlNet-TurboCell-TxRate TxRate-613k 613 VALUE KarlNet-TurboCell-TxRate TxRate-614k 614 VALUE KarlNet-TurboCell-TxRate TxRate-615k 615 VALUE KarlNet-TurboCell-TxRate TxRate-616k 616 VALUE KarlNet-TurboCell-TxRate TxRate-617k 617 VALUE KarlNet-TurboCell-TxRate TxRate-618k 618 VALUE KarlNet-TurboCell-TxRate TxRate-619k 619 VALUE KarlNet-TurboCell-TxRate TxRate-620k 620 VALUE KarlNet-TurboCell-TxRate TxRate-621k 621 VALUE KarlNet-TurboCell-TxRate TxRate-622k 622 VALUE KarlNet-TurboCell-TxRate TxRate-623k 623 VALUE KarlNet-TurboCell-TxRate TxRate-624k 624 VALUE KarlNet-TurboCell-TxRate TxRate-625k 625 VALUE KarlNet-TurboCell-TxRate TxRate-626k 626 VALUE KarlNet-TurboCell-TxRate TxRate-627k 627 VALUE KarlNet-TurboCell-TxRate TxRate-628k 628 VALUE KarlNet-TurboCell-TxRate TxRate-629k 629 VALUE KarlNet-TurboCell-TxRate TxRate-630k 630 VALUE KarlNet-TurboCell-TxRate TxRate-631k 631 VALUE KarlNet-TurboCell-TxRate TxRate-632k 632 VALUE KarlNet-TurboCell-TxRate TxRate-633k 633 VALUE KarlNet-TurboCell-TxRate TxRate-634k 634 VALUE KarlNet-TurboCell-TxRate TxRate-635k 635 VALUE KarlNet-TurboCell-TxRate TxRate-636k 636 VALUE KarlNet-TurboCell-TxRate TxRate-637k 637 VALUE KarlNet-TurboCell-TxRate TxRate-638k 638 VALUE KarlNet-TurboCell-TxRate TxRate-639k 639 VALUE KarlNet-TurboCell-TxRate TxRate-640k 640 VALUE KarlNet-TurboCell-TxRate TxRate-641k 641 VALUE KarlNet-TurboCell-TxRate TxRate-642k 642 VALUE KarlNet-TurboCell-TxRate TxRate-643k 643 VALUE KarlNet-TurboCell-TxRate TxRate-644k 644 VALUE KarlNet-TurboCell-TxRate TxRate-645k 645 VALUE KarlNet-TurboCell-TxRate TxRate-646k 646 VALUE KarlNet-TurboCell-TxRate TxRate-647k 647 VALUE KarlNet-TurboCell-TxRate TxRate-648k 648 VALUE KarlNet-TurboCell-TxRate TxRate-649k 649 VALUE KarlNet-TurboCell-TxRate TxRate-650k 650 VALUE KarlNet-TurboCell-TxRate TxRate-651k 651 VALUE KarlNet-TurboCell-TxRate TxRate-652k 652 VALUE KarlNet-TurboCell-TxRate TxRate-653k 653 VALUE KarlNet-TurboCell-TxRate TxRate-654k 654 VALUE KarlNet-TurboCell-TxRate TxRate-655k 655 VALUE KarlNet-TurboCell-TxRate TxRate-656k 656 VALUE KarlNet-TurboCell-TxRate TxRate-657k 657 VALUE KarlNet-TurboCell-TxRate TxRate-658k 658 VALUE KarlNet-TurboCell-TxRate TxRate-659k 659 VALUE KarlNet-TurboCell-TxRate TxRate-660k 660 VALUE KarlNet-TurboCell-TxRate TxRate-661k 661 VALUE KarlNet-TurboCell-TxRate TxRate-662k 662 VALUE KarlNet-TurboCell-TxRate TxRate-663k 663 VALUE KarlNet-TurboCell-TxRate TxRate-664k 664 VALUE KarlNet-TurboCell-TxRate TxRate-665k 665 VALUE KarlNet-TurboCell-TxRate TxRate-666k 666 VALUE KarlNet-TurboCell-TxRate TxRate-667k 667 VALUE KarlNet-TurboCell-TxRate TxRate-668k 668 VALUE KarlNet-TurboCell-TxRate TxRate-669k 669 VALUE KarlNet-TurboCell-TxRate TxRate-670k 670 VALUE KarlNet-TurboCell-TxRate TxRate-671k 671 VALUE KarlNet-TurboCell-TxRate TxRate-672k 672 VALUE KarlNet-TurboCell-TxRate TxRate-673k 673 VALUE KarlNet-TurboCell-TxRate TxRate-674k 674 VALUE KarlNet-TurboCell-TxRate TxRate-675k 675 VALUE KarlNet-TurboCell-TxRate TxRate-676k 676 VALUE KarlNet-TurboCell-TxRate TxRate-677k 677 VALUE KarlNet-TurboCell-TxRate TxRate-678k 678 VALUE KarlNet-TurboCell-TxRate TxRate-679k 679 VALUE KarlNet-TurboCell-TxRate TxRate-680k 680 VALUE KarlNet-TurboCell-TxRate TxRate-681k 681 VALUE KarlNet-TurboCell-TxRate TxRate-682k 682 VALUE KarlNet-TurboCell-TxRate TxRate-683k 683 VALUE KarlNet-TurboCell-TxRate TxRate-684k 684 VALUE KarlNet-TurboCell-TxRate TxRate-685k 685 VALUE KarlNet-TurboCell-TxRate TxRate-686k 686 VALUE KarlNet-TurboCell-TxRate TxRate-687k 687 VALUE KarlNet-TurboCell-TxRate TxRate-688k 688 VALUE KarlNet-TurboCell-TxRate TxRate-689k 689 VALUE KarlNet-TurboCell-TxRate TxRate-690k 690 VALUE KarlNet-TurboCell-TxRate TxRate-691k 691 VALUE KarlNet-TurboCell-TxRate TxRate-692k 692 VALUE KarlNet-TurboCell-TxRate TxRate-693k 693 VALUE KarlNet-TurboCell-TxRate TxRate-694k 694 VALUE KarlNet-TurboCell-TxRate TxRate-695k 695 VALUE KarlNet-TurboCell-TxRate TxRate-696k 696 VALUE KarlNet-TurboCell-TxRate TxRate-697k 697 VALUE KarlNet-TurboCell-TxRate TxRate-698k 698 VALUE KarlNet-TurboCell-TxRate TxRate-699k 699 VALUE KarlNet-TurboCell-TxRate TxRate-700k 700 VALUE KarlNet-TurboCell-TxRate TxRate-701k 701 VALUE KarlNet-TurboCell-TxRate TxRate-702k 702 VALUE KarlNet-TurboCell-TxRate TxRate-703k 703 VALUE KarlNet-TurboCell-TxRate TxRate-704k 704 VALUE KarlNet-TurboCell-TxRate TxRate-705k 705 VALUE KarlNet-TurboCell-TxRate TxRate-706k 706 VALUE KarlNet-TurboCell-TxRate TxRate-707k 707 VALUE KarlNet-TurboCell-TxRate TxRate-708k 708 VALUE KarlNet-TurboCell-TxRate TxRate-709k 709 VALUE KarlNet-TurboCell-TxRate TxRate-710k 710 VALUE KarlNet-TurboCell-TxRate TxRate-711k 711 VALUE KarlNet-TurboCell-TxRate TxRate-712k 712 VALUE KarlNet-TurboCell-TxRate TxRate-713k 713 VALUE KarlNet-TurboCell-TxRate TxRate-714k 714 VALUE KarlNet-TurboCell-TxRate TxRate-715k 715 VALUE KarlNet-TurboCell-TxRate TxRate-716k 716 VALUE KarlNet-TurboCell-TxRate TxRate-717k 717 VALUE KarlNet-TurboCell-TxRate TxRate-718k 718 VALUE KarlNet-TurboCell-TxRate TxRate-719k 719 VALUE KarlNet-TurboCell-TxRate TxRate-720k 720 VALUE KarlNet-TurboCell-TxRate TxRate-721k 721 VALUE KarlNet-TurboCell-TxRate TxRate-722k 722 VALUE KarlNet-TurboCell-TxRate TxRate-723k 723 VALUE KarlNet-TurboCell-TxRate TxRate-724k 724 VALUE KarlNet-TurboCell-TxRate TxRate-725k 725 VALUE KarlNet-TurboCell-TxRate TxRate-726k 726 VALUE KarlNet-TurboCell-TxRate TxRate-727k 727 VALUE KarlNet-TurboCell-TxRate TxRate-728k 728 VALUE KarlNet-TurboCell-TxRate TxRate-729k 729 VALUE KarlNet-TurboCell-TxRate TxRate-730k 730 VALUE KarlNet-TurboCell-TxRate TxRate-731k 731 VALUE KarlNet-TurboCell-TxRate TxRate-732k 732 VALUE KarlNet-TurboCell-TxRate TxRate-733k 733 VALUE KarlNet-TurboCell-TxRate TxRate-734k 734 VALUE KarlNet-TurboCell-TxRate TxRate-735k 735 VALUE KarlNet-TurboCell-TxRate TxRate-736k 736 VALUE KarlNet-TurboCell-TxRate TxRate-737k 737 VALUE KarlNet-TurboCell-TxRate TxRate-738k 738 VALUE KarlNet-TurboCell-TxRate TxRate-739k 739 VALUE KarlNet-TurboCell-TxRate TxRate-740k 740 VALUE KarlNet-TurboCell-TxRate TxRate-741k 741 VALUE KarlNet-TurboCell-TxRate TxRate-742k 742 VALUE KarlNet-TurboCell-TxRate TxRate-743k 743 VALUE KarlNet-TurboCell-TxRate TxRate-744k 744 VALUE KarlNet-TurboCell-TxRate TxRate-745k 745 VALUE KarlNet-TurboCell-TxRate TxRate-746k 746 VALUE KarlNet-TurboCell-TxRate TxRate-747k 747 VALUE KarlNet-TurboCell-TxRate TxRate-748k 748 VALUE KarlNet-TurboCell-TxRate TxRate-749k 749 VALUE KarlNet-TurboCell-TxRate TxRate-750k 750 VALUE KarlNet-TurboCell-TxRate TxRate-751k 751 VALUE KarlNet-TurboCell-TxRate TxRate-752k 752 VALUE KarlNet-TurboCell-TxRate TxRate-753k 753 VALUE KarlNet-TurboCell-TxRate TxRate-754k 754 VALUE KarlNet-TurboCell-TxRate TxRate-755k 755 VALUE KarlNet-TurboCell-TxRate TxRate-756k 756 VALUE KarlNet-TurboCell-TxRate TxRate-757k 757 VALUE KarlNet-TurboCell-TxRate TxRate-758k 758 VALUE KarlNet-TurboCell-TxRate TxRate-759k 759 VALUE KarlNet-TurboCell-TxRate TxRate-760k 760 VALUE KarlNet-TurboCell-TxRate TxRate-761k 761 VALUE KarlNet-TurboCell-TxRate TxRate-762k 762 VALUE KarlNet-TurboCell-TxRate TxRate-763k 763 VALUE KarlNet-TurboCell-TxRate TxRate-764k 764 VALUE KarlNet-TurboCell-TxRate TxRate-765k 765 VALUE KarlNet-TurboCell-TxRate TxRate-766k 766 VALUE KarlNet-TurboCell-TxRate TxRate-767k 767 VALUE KarlNet-TurboCell-TxRate TxRate-768k 768 VALUE KarlNet-TurboCell-TxRate TxRate-769k 769 VALUE KarlNet-TurboCell-TxRate TxRate-770k 770 VALUE KarlNet-TurboCell-TxRate TxRate-771k 771 VALUE KarlNet-TurboCell-TxRate TxRate-772k 772 VALUE KarlNet-TurboCell-TxRate TxRate-773k 773 VALUE KarlNet-TurboCell-TxRate TxRate-774k 774 VALUE KarlNet-TurboCell-TxRate TxRate-775k 775 VALUE KarlNet-TurboCell-TxRate TxRate-776k 776 VALUE KarlNet-TurboCell-TxRate TxRate-777k 777 VALUE KarlNet-TurboCell-TxRate TxRate-778k 778 VALUE KarlNet-TurboCell-TxRate TxRate-779k 779 VALUE KarlNet-TurboCell-TxRate TxRate-780k 780 VALUE KarlNet-TurboCell-TxRate TxRate-781k 781 VALUE KarlNet-TurboCell-TxRate TxRate-782k 782 VALUE KarlNet-TurboCell-TxRate TxRate-783k 783 VALUE KarlNet-TurboCell-TxRate TxRate-784k 784 VALUE KarlNet-TurboCell-TxRate TxRate-785k 785 VALUE KarlNet-TurboCell-TxRate TxRate-786k 786 VALUE KarlNet-TurboCell-TxRate TxRate-787k 787 VALUE KarlNet-TurboCell-TxRate TxRate-788k 788 VALUE KarlNet-TurboCell-TxRate TxRate-789k 789 VALUE KarlNet-TurboCell-TxRate TxRate-790k 790 VALUE KarlNet-TurboCell-TxRate TxRate-791k 791 VALUE KarlNet-TurboCell-TxRate TxRate-792k 792 VALUE KarlNet-TurboCell-TxRate TxRate-793k 793 VALUE KarlNet-TurboCell-TxRate TxRate-794k 794 VALUE KarlNet-TurboCell-TxRate TxRate-795k 795 VALUE KarlNet-TurboCell-TxRate TxRate-796k 796 VALUE KarlNet-TurboCell-TxRate TxRate-797k 797 VALUE KarlNet-TurboCell-TxRate TxRate-798k 798 VALUE KarlNet-TurboCell-TxRate TxRate-799k 799 VALUE KarlNet-TurboCell-TxRate TxRate-800k 800 VALUE KarlNet-TurboCell-TxRate TxRate-801k 801 VALUE KarlNet-TurboCell-TxRate TxRate-802k 802 VALUE KarlNet-TurboCell-TxRate TxRate-803k 803 VALUE KarlNet-TurboCell-TxRate TxRate-804k 804 VALUE KarlNet-TurboCell-TxRate TxRate-805k 805 VALUE KarlNet-TurboCell-TxRate TxRate-806k 806 VALUE KarlNet-TurboCell-TxRate TxRate-807k 807 VALUE KarlNet-TurboCell-TxRate TxRate-808k 808 VALUE KarlNet-TurboCell-TxRate TxRate-809k 809 VALUE KarlNet-TurboCell-TxRate TxRate-810k 810 VALUE KarlNet-TurboCell-TxRate TxRate-811k 811 VALUE KarlNet-TurboCell-TxRate TxRate-812k 812 VALUE KarlNet-TurboCell-TxRate TxRate-813k 813 VALUE KarlNet-TurboCell-TxRate TxRate-814k 814 VALUE KarlNet-TurboCell-TxRate TxRate-815k 815 VALUE KarlNet-TurboCell-TxRate TxRate-816k 816 VALUE KarlNet-TurboCell-TxRate TxRate-817k 817 VALUE KarlNet-TurboCell-TxRate TxRate-818k 818 VALUE KarlNet-TurboCell-TxRate TxRate-819k 819 VALUE KarlNet-TurboCell-TxRate TxRate-820k 820 VALUE KarlNet-TurboCell-TxRate TxRate-821k 821 VALUE KarlNet-TurboCell-TxRate TxRate-822k 822 VALUE KarlNet-TurboCell-TxRate TxRate-823k 823 VALUE KarlNet-TurboCell-TxRate TxRate-824k 824 VALUE KarlNet-TurboCell-TxRate TxRate-825k 825 VALUE KarlNet-TurboCell-TxRate TxRate-826k 826 VALUE KarlNet-TurboCell-TxRate TxRate-827k 827 VALUE KarlNet-TurboCell-TxRate TxRate-828k 828 VALUE KarlNet-TurboCell-TxRate TxRate-829k 829 VALUE KarlNet-TurboCell-TxRate TxRate-830k 830 VALUE KarlNet-TurboCell-TxRate TxRate-831k 831 VALUE KarlNet-TurboCell-TxRate TxRate-832k 832 VALUE KarlNet-TurboCell-TxRate TxRate-833k 833 VALUE KarlNet-TurboCell-TxRate TxRate-834k 834 VALUE KarlNet-TurboCell-TxRate TxRate-835k 835 VALUE KarlNet-TurboCell-TxRate TxRate-836k 836 VALUE KarlNet-TurboCell-TxRate TxRate-837k 837 VALUE KarlNet-TurboCell-TxRate TxRate-838k 838 VALUE KarlNet-TurboCell-TxRate TxRate-839k 839 VALUE KarlNet-TurboCell-TxRate TxRate-840k 840 VALUE KarlNet-TurboCell-TxRate TxRate-841k 841 VALUE KarlNet-TurboCell-TxRate TxRate-842k 842 VALUE KarlNet-TurboCell-TxRate TxRate-843k 843 VALUE KarlNet-TurboCell-TxRate TxRate-844k 844 VALUE KarlNet-TurboCell-TxRate TxRate-845k 845 VALUE KarlNet-TurboCell-TxRate TxRate-846k 846 VALUE KarlNet-TurboCell-TxRate TxRate-847k 847 VALUE KarlNet-TurboCell-TxRate TxRate-848k 848 VALUE KarlNet-TurboCell-TxRate TxRate-849k 849 VALUE KarlNet-TurboCell-TxRate TxRate-850k 850 VALUE KarlNet-TurboCell-TxRate TxRate-851k 851 VALUE KarlNet-TurboCell-TxRate TxRate-852k 852 VALUE KarlNet-TurboCell-TxRate TxRate-853k 853 VALUE KarlNet-TurboCell-TxRate TxRate-854k 854 VALUE KarlNet-TurboCell-TxRate TxRate-855k 855 VALUE KarlNet-TurboCell-TxRate TxRate-856k 856 VALUE KarlNet-TurboCell-TxRate TxRate-857k 857 VALUE KarlNet-TurboCell-TxRate TxRate-858k 858 VALUE KarlNet-TurboCell-TxRate TxRate-859k 859 VALUE KarlNet-TurboCell-TxRate TxRate-860k 860 VALUE KarlNet-TurboCell-TxRate TxRate-861k 861 VALUE KarlNet-TurboCell-TxRate TxRate-862k 862 VALUE KarlNet-TurboCell-TxRate TxRate-863k 863 VALUE KarlNet-TurboCell-TxRate TxRate-864k 864 VALUE KarlNet-TurboCell-TxRate TxRate-865k 865 VALUE KarlNet-TurboCell-TxRate TxRate-866k 866 VALUE KarlNet-TurboCell-TxRate TxRate-867k 867 VALUE KarlNet-TurboCell-TxRate TxRate-868k 868 VALUE KarlNet-TurboCell-TxRate TxRate-869k 869 VALUE KarlNet-TurboCell-TxRate TxRate-870k 870 VALUE KarlNet-TurboCell-TxRate TxRate-871k 871 VALUE KarlNet-TurboCell-TxRate TxRate-872k 872 VALUE KarlNet-TurboCell-TxRate TxRate-873k 873 VALUE KarlNet-TurboCell-TxRate TxRate-874k 874 VALUE KarlNet-TurboCell-TxRate TxRate-875k 875 VALUE KarlNet-TurboCell-TxRate TxRate-876k 876 VALUE KarlNet-TurboCell-TxRate TxRate-877k 877 VALUE KarlNet-TurboCell-TxRate TxRate-878k 878 VALUE KarlNet-TurboCell-TxRate TxRate-879k 879 VALUE KarlNet-TurboCell-TxRate TxRate-880k 880 VALUE KarlNet-TurboCell-TxRate TxRate-881k 881 VALUE KarlNet-TurboCell-TxRate TxRate-882k 882 VALUE KarlNet-TurboCell-TxRate TxRate-883k 883 VALUE KarlNet-TurboCell-TxRate TxRate-884k 884 VALUE KarlNet-TurboCell-TxRate TxRate-885k 885 VALUE KarlNet-TurboCell-TxRate TxRate-886k 886 VALUE KarlNet-TurboCell-TxRate TxRate-887k 887 VALUE KarlNet-TurboCell-TxRate TxRate-888k 888 VALUE KarlNet-TurboCell-TxRate TxRate-889k 889 VALUE KarlNet-TurboCell-TxRate TxRate-890k 890 VALUE KarlNet-TurboCell-TxRate TxRate-891k 891 VALUE KarlNet-TurboCell-TxRate TxRate-892k 892 VALUE KarlNet-TurboCell-TxRate TxRate-893k 893 VALUE KarlNet-TurboCell-TxRate TxRate-894k 894 VALUE KarlNet-TurboCell-TxRate TxRate-895k 895 VALUE KarlNet-TurboCell-TxRate TxRate-896k 896 VALUE KarlNet-TurboCell-TxRate TxRate-897k 897 VALUE KarlNet-TurboCell-TxRate TxRate-898k 898 VALUE KarlNet-TurboCell-TxRate TxRate-899k 899 VALUE KarlNet-TurboCell-TxRate TxRate-900k 900 VALUE KarlNet-TurboCell-TxRate TxRate-901k 901 VALUE KarlNet-TurboCell-TxRate TxRate-902k 902 VALUE KarlNet-TurboCell-TxRate TxRate-903k 903 VALUE KarlNet-TurboCell-TxRate TxRate-904k 904 VALUE KarlNet-TurboCell-TxRate TxRate-905k 905 VALUE KarlNet-TurboCell-TxRate TxRate-906k 906 VALUE KarlNet-TurboCell-TxRate TxRate-907k 907 VALUE KarlNet-TurboCell-TxRate TxRate-908k 908 VALUE KarlNet-TurboCell-TxRate TxRate-909k 909 VALUE KarlNet-TurboCell-TxRate TxRate-910k 910 VALUE KarlNet-TurboCell-TxRate TxRate-911k 911 VALUE KarlNet-TurboCell-TxRate TxRate-912k 912 VALUE KarlNet-TurboCell-TxRate TxRate-913k 913 VALUE KarlNet-TurboCell-TxRate TxRate-914k 914 VALUE KarlNet-TurboCell-TxRate TxRate-915k 915 VALUE KarlNet-TurboCell-TxRate TxRate-916k 916 VALUE KarlNet-TurboCell-TxRate TxRate-917k 917 VALUE KarlNet-TurboCell-TxRate TxRate-918k 918 VALUE KarlNet-TurboCell-TxRate TxRate-919k 919 VALUE KarlNet-TurboCell-TxRate TxRate-920k 920 VALUE KarlNet-TurboCell-TxRate TxRate-921k 921 VALUE KarlNet-TurboCell-TxRate TxRate-922k 922 VALUE KarlNet-TurboCell-TxRate TxRate-923k 923 VALUE KarlNet-TurboCell-TxRate TxRate-924k 924 VALUE KarlNet-TurboCell-TxRate TxRate-925k 925 VALUE KarlNet-TurboCell-TxRate TxRate-926k 926 VALUE KarlNet-TurboCell-TxRate TxRate-927k 927 VALUE KarlNet-TurboCell-TxRate TxRate-928k 928 VALUE KarlNet-TurboCell-TxRate TxRate-929k 929 VALUE KarlNet-TurboCell-TxRate TxRate-930k 930 VALUE KarlNet-TurboCell-TxRate TxRate-931k 931 VALUE KarlNet-TurboCell-TxRate TxRate-932k 932 VALUE KarlNet-TurboCell-TxRate TxRate-933k 933 VALUE KarlNet-TurboCell-TxRate TxRate-934k 934 VALUE KarlNet-TurboCell-TxRate TxRate-935k 935 VALUE KarlNet-TurboCell-TxRate TxRate-936k 936 VALUE KarlNet-TurboCell-TxRate TxRate-937k 937 VALUE KarlNet-TurboCell-TxRate TxRate-938k 938 VALUE KarlNet-TurboCell-TxRate TxRate-939k 939 VALUE KarlNet-TurboCell-TxRate TxRate-940k 940 VALUE KarlNet-TurboCell-TxRate TxRate-941k 941 VALUE KarlNet-TurboCell-TxRate TxRate-942k 942 VALUE KarlNet-TurboCell-TxRate TxRate-943k 943 VALUE KarlNet-TurboCell-TxRate TxRate-944k 944 VALUE KarlNet-TurboCell-TxRate TxRate-945k 945 VALUE KarlNet-TurboCell-TxRate TxRate-946k 946 VALUE KarlNet-TurboCell-TxRate TxRate-947k 947 VALUE KarlNet-TurboCell-TxRate TxRate-948k 948 VALUE KarlNet-TurboCell-TxRate TxRate-949k 949 VALUE KarlNet-TurboCell-TxRate TxRate-950k 950 VALUE KarlNet-TurboCell-TxRate TxRate-951k 951 VALUE KarlNet-TurboCell-TxRate TxRate-952k 952 VALUE KarlNet-TurboCell-TxRate TxRate-953k 953 VALUE KarlNet-TurboCell-TxRate TxRate-954k 954 VALUE KarlNet-TurboCell-TxRate TxRate-955k 955 VALUE KarlNet-TurboCell-TxRate TxRate-956k 956 VALUE KarlNet-TurboCell-TxRate TxRate-957k 957 VALUE KarlNet-TurboCell-TxRate TxRate-958k 958 VALUE KarlNet-TurboCell-TxRate TxRate-959k 959 VALUE KarlNet-TurboCell-TxRate TxRate-960k 960 VALUE KarlNet-TurboCell-TxRate TxRate-961k 961 VALUE KarlNet-TurboCell-TxRate TxRate-962k 962 VALUE KarlNet-TurboCell-TxRate TxRate-963k 963 VALUE KarlNet-TurboCell-TxRate TxRate-964k 964 VALUE KarlNet-TurboCell-TxRate TxRate-965k 965 VALUE KarlNet-TurboCell-TxRate TxRate-966k 966 VALUE KarlNet-TurboCell-TxRate TxRate-967k 967 VALUE KarlNet-TurboCell-TxRate TxRate-968k 968 VALUE KarlNet-TurboCell-TxRate TxRate-969k 969 VALUE KarlNet-TurboCell-TxRate TxRate-970k 970 VALUE KarlNet-TurboCell-TxRate TxRate-971k 971 VALUE KarlNet-TurboCell-TxRate TxRate-972k 972 VALUE KarlNet-TurboCell-TxRate TxRate-973k 973 VALUE KarlNet-TurboCell-TxRate TxRate-974k 974 VALUE KarlNet-TurboCell-TxRate TxRate-975k 975 VALUE KarlNet-TurboCell-TxRate TxRate-976k 976 VALUE KarlNet-TurboCell-TxRate TxRate-977k 977 VALUE KarlNet-TurboCell-TxRate TxRate-978k 978 VALUE KarlNet-TurboCell-TxRate TxRate-979k 979 VALUE KarlNet-TurboCell-TxRate TxRate-980k 980 VALUE KarlNet-TurboCell-TxRate TxRate-981k 981 VALUE KarlNet-TurboCell-TxRate TxRate-982k 982 VALUE KarlNet-TurboCell-TxRate TxRate-983k 983 VALUE KarlNet-TurboCell-TxRate TxRate-984k 984 VALUE KarlNet-TurboCell-TxRate TxRate-985k 985 VALUE KarlNet-TurboCell-TxRate TxRate-986k 986 VALUE KarlNet-TurboCell-TxRate TxRate-987k 987 VALUE KarlNet-TurboCell-TxRate TxRate-988k 988 VALUE KarlNet-TurboCell-TxRate TxRate-989k 989 VALUE KarlNet-TurboCell-TxRate TxRate-990k 990 VALUE KarlNet-TurboCell-TxRate TxRate-991k 991 VALUE KarlNet-TurboCell-TxRate TxRate-992k 992 VALUE KarlNet-TurboCell-TxRate TxRate-993k 993 VALUE KarlNet-TurboCell-TxRate TxRate-994k 994 VALUE KarlNet-TurboCell-TxRate TxRate-995k 995 VALUE KarlNet-TurboCell-TxRate TxRate-996k 996 VALUE KarlNet-TurboCell-TxRate TxRate-997k 997 VALUE KarlNet-TurboCell-TxRate TxRate-998k 998 VALUE KarlNet-TurboCell-TxRate TxRate-999k 999 VALUE KarlNet-TurboCell-TxRate TxRate-1000k 1000 VALUE KarlNet-TurboCell-TxRate TxRate-1001k 1001 VALUE KarlNet-TurboCell-TxRate TxRate-1002k 1002 VALUE KarlNet-TurboCell-TxRate TxRate-1003k 1003 VALUE KarlNet-TurboCell-TxRate TxRate-1004k 1004 VALUE KarlNet-TurboCell-TxRate TxRate-1005k 1005 VALUE KarlNet-TurboCell-TxRate TxRate-1006k 1006 VALUE KarlNet-TurboCell-TxRate TxRate-1007k 1007 VALUE KarlNet-TurboCell-TxRate TxRate-1008k 1008 VALUE KarlNet-TurboCell-TxRate TxRate-1009k 1009 VALUE KarlNet-TurboCell-TxRate TxRate-1010k 1010 VALUE KarlNet-TurboCell-TxRate TxRate-1011k 1011 VALUE KarlNet-TurboCell-TxRate TxRate-1012k 1012 VALUE KarlNet-TurboCell-TxRate TxRate-1013k 1013 VALUE KarlNet-TurboCell-TxRate TxRate-1014k 1014 VALUE KarlNet-TurboCell-TxRate TxRate-1015k 1015 VALUE KarlNet-TurboCell-TxRate TxRate-1016k 1016 VALUE KarlNet-TurboCell-TxRate TxRate-1017k 1017 VALUE KarlNet-TurboCell-TxRate TxRate-1018k 1018 VALUE KarlNet-TurboCell-TxRate TxRate-1019k 1019 VALUE KarlNet-TurboCell-TxRate TxRate-1020k 1020 VALUE KarlNet-TurboCell-TxRate TxRate-1021k 1021 VALUE KarlNet-TurboCell-TxRate TxRate-1022k 1022 VALUE KarlNet-TurboCell-TxRate TxRate-1023k 1023 VALUE KarlNet-TurboCell-TxRate TxRate-1024k 1024 VALUE KarlNet-TurboCell-TxRate TxRate-1152k 1025 VALUE KarlNet-TurboCell-TxRate TxRate-1280k 1026 VALUE KarlNet-TurboCell-TxRate TxRate-1408k 1027 VALUE KarlNet-TurboCell-TxRate TxRate-1536k 1028 VALUE KarlNet-TurboCell-TxRate TxRate-1664k 1029 VALUE KarlNet-TurboCell-TxRate TxRate-1792k 1030 VALUE KarlNet-TurboCell-TxRate TxRate-1920k 1031 VALUE KarlNet-TurboCell-TxRate TxRate-2048k 1032 VALUE KarlNet-TurboCell-TxRate TxRate-2176k 1033 VALUE KarlNet-TurboCell-TxRate TxRate-2304k 1034 VALUE KarlNet-TurboCell-TxRate TxRate-2432k 1035 VALUE KarlNet-TurboCell-TxRate TxRate-2560k 1036 VALUE KarlNet-TurboCell-TxRate TxRate-2688k 1037 VALUE KarlNet-TurboCell-TxRate TxRate-2816k 1038 VALUE KarlNet-TurboCell-TxRate TxRate-2944k 1039 VALUE KarlNet-TurboCell-TxRate TxRate-3072k 1040 VALUE KarlNet-TurboCell-TxRate TxRate-3200k 1041 VALUE KarlNet-TurboCell-TxRate TxRate-3328k 1042 VALUE KarlNet-TurboCell-TxRate TxRate-3456k 1043 VALUE KarlNet-TurboCell-TxRate TxRate-3584k 1044 VALUE KarlNet-TurboCell-TxRate TxRate-3712k 1045 VALUE KarlNet-TurboCell-TxRate TxRate-3840k 1046 VALUE KarlNet-TurboCell-TxRate TxRate-3968k 1047 VALUE KarlNet-TurboCell-TxRate TxRate-4096k 1048 VALUE KarlNet-TurboCell-TxRate TxRate-4224k 1049 VALUE KarlNet-TurboCell-TxRate TxRate-4352k 1050 VALUE KarlNet-TurboCell-TxRate TxRate-4480k 1051 VALUE KarlNet-TurboCell-TxRate TxRate-4608k 1052 VALUE KarlNet-TurboCell-TxRate TxRate-4736k 1053 VALUE KarlNet-TurboCell-TxRate TxRate-4864k 1054 VALUE KarlNet-TurboCell-TxRate TxRate-4992k 1055 VALUE KarlNet-TurboCell-TxRate TxRate-5120k 1056 VALUE KarlNet-TurboCell-TxRate TxRate-5248k 1057 VALUE KarlNet-TurboCell-TxRate TxRate-5376k 1058 VALUE KarlNet-TurboCell-TxRate TxRate-5504k 1059 VALUE KarlNet-TurboCell-TxRate TxRate-5632k 1060 VALUE KarlNet-TurboCell-TxRate TxRate-5760k 1061 VALUE KarlNet-TurboCell-TxRate TxRate-5888k 1062 VALUE KarlNet-TurboCell-TxRate TxRate-6016k 1063 VALUE KarlNet-TurboCell-TxRate TxRate-6144k 1064 VALUE KarlNet-TurboCell-TxRate TxRate-6272k 1065 VALUE KarlNet-TurboCell-TxRate TxRate-6400k 1066 VALUE KarlNet-TurboCell-TxRate TxRate-6528k 1067 VALUE KarlNet-TurboCell-TxRate TxRate-6656k 1068 VALUE KarlNet-TurboCell-TxRate TxRate-6784k 1069 VALUE KarlNet-TurboCell-TxRate TxRate-6912k 1070 VALUE KarlNet-TurboCell-TxRate TxRate-7040k 1071 VALUE KarlNet-TurboCell-TxRate TxRate-7168k 1072 VALUE KarlNet-TurboCell-TxRate TxRate-7296k 1073 VALUE KarlNet-TurboCell-TxRate TxRate-7424k 1074 VALUE KarlNet-TurboCell-TxRate TxRate-7552k 1075 VALUE KarlNet-TurboCell-TxRate TxRate-7680k 1076 VALUE KarlNet-TurboCell-TxRate TxRate-7808k 1077 VALUE KarlNet-TurboCell-TxRate TxRate-7936k 1078 VALUE KarlNet-TurboCell-TxRate TxRate-8064k 1079 VALUE KarlNet-TurboCell-TxRate TxRate-8192k 1080 VALUE KarlNet-TurboCell-TxRate TxRate-8320k 1081 VALUE KarlNet-TurboCell-TxRate TxRate-8448k 1082 VALUE KarlNet-TurboCell-TxRate TxRate-8576k 1083 VALUE KarlNet-TurboCell-TxRate TxRate-8704k 1084 VALUE KarlNet-TurboCell-TxRate TxRate-8832k 1085 VALUE KarlNet-TurboCell-TxRate TxRate-8960k 1086 VALUE KarlNet-TurboCell-TxRate TxRate-9088k 1087 VALUE KarlNet-TurboCell-TxRate TxRate-9216k 1088 VALUE KarlNet-TurboCell-TxRate TxRate-9344k 1089 VALUE KarlNet-TurboCell-TxRate TxRate-9472k 1090 VALUE KarlNet-TurboCell-TxRate TxRate-9600k 1091 VALUE KarlNet-TurboCell-TxRate TxRate-9728k 1092 VALUE KarlNet-TurboCell-TxRate TxRate-9856k 1093 VALUE KarlNet-TurboCell-TxRate TxRate-9984k 1094 VALUE KarlNet-TurboCell-TxRate TxRate-10112k 1095 VALUE KarlNet-TurboCell-TxRate TxRate-10240k 1096 VALUE KarlNet-TurboCell-TxRate TxRate-10368k 1097 VALUE KarlNet-TurboCell-TxRate TxRate-10496k 1098 VALUE KarlNet-TurboCell-TxRate TxRate-10624k 1099 VALUE KarlNet-TurboCell-TxRate TxRate-10752k 1100 VALUE KarlNet-TurboCell-TxRate TxRate-10880k 1101 VALUE KarlNet-TurboCell-TxRate TxRate-11008k 1102 VALUE KarlNet-TurboCell-TxRate TxRate-11136k 1103 VALUE KarlNet-TurboCell-TxRate TxRate-11264k 1104 VALUE KarlNet-TurboCell-TxRate TxRate-11392k 1105 VALUE KarlNet-TurboCell-TxRate TxRate-11520k 1106 VALUE KarlNet-TurboCell-TxRate TxRate-11648k 1107 VALUE KarlNet-TurboCell-TxRate TxRate-11776k 1108 VALUE KarlNet-TurboCell-TxRate TxRate-11904k 1109 VALUE KarlNet-TurboCell-TxRate TxRate-12032k 1110 VALUE KarlNet-TurboCell-TxRate TxRate-12160k 1111 VALUE KarlNet-TurboCell-TxRate TxRate-12288k 1112 VALUE KarlNet-TurboCell-TxRate TxRate-12416k 1113 VALUE KarlNet-TurboCell-TxRate TxRate-12544k 1114 VALUE KarlNet-TurboCell-TxRate TxRate-12672k 1115 VALUE KarlNet-TurboCell-TxRate TxRate-12800k 1116 VALUE KarlNet-TurboCell-TxRate TxRate-12928k 1117 VALUE KarlNet-TurboCell-TxRate TxRate-13056k 1118 VALUE KarlNet-TurboCell-TxRate TxRate-13184k 1119 VALUE KarlNet-TurboCell-TxRate TxRate-13312k 1120 VALUE KarlNet-TurboCell-TxRate TxRate-13440k 1121 VALUE KarlNet-TurboCell-TxRate TxRate-13568k 1122 VALUE KarlNet-TurboCell-TxRate TxRate-13696k 1123 VALUE KarlNet-TurboCell-TxRate TxRate-13824k 1124 VALUE KarlNet-TurboCell-TxRate TxRate-13952k 1125 VALUE KarlNet-TurboCell-TxRate TxRate-14080k 1126 VALUE KarlNet-TurboCell-TxRate TxRate-14208k 1127 VALUE KarlNet-TurboCell-TxRate TxRate-14336k 1128 VALUE KarlNet-TurboCell-TxRate TxRate-14464k 1129 VALUE KarlNet-TurboCell-TxRate TxRate-14592k 1130 VALUE KarlNet-TurboCell-TxRate TxRate-14720k 1131 VALUE KarlNet-TurboCell-TxRate TxRate-14848k 1132 VALUE KarlNet-TurboCell-TxRate TxRate-14976k 1133 VALUE KarlNet-TurboCell-TxRate TxRate-15104k 1134 VALUE KarlNet-TurboCell-TxRate TxRate-15232k 1135 VALUE KarlNet-TurboCell-TxRate TxRate-15360k 1136 VALUE KarlNet-TurboCell-TxRate TxRate-15488k 1137 VALUE KarlNet-TurboCell-TxRate TxRate-15616k 1138 VALUE KarlNet-TurboCell-TxRate TxRate-15744k 1139 VALUE KarlNet-TurboCell-TxRate TxRate-15872k 1140 VALUE KarlNet-TurboCell-TxRate TxRate-16000k 1141 VALUE KarlNet-TurboCell-TxRate TxRate-16128k 1142 VALUE KarlNet-TurboCell-TxRate TxRate-16256k 1143 VALUE KarlNet-TurboCell-TxRate TxRate-16384k 1144 VALUE KarlNet-TurboCell-TxRate TxRate-16512k 1145 VALUE KarlNet-TurboCell-TxRate TxRate-16640k 1146 VALUE KarlNet-TurboCell-TxRate TxRate-16768k 1147 VALUE KarlNet-TurboCell-TxRate TxRate-16896k 1148 VALUE KarlNet-TurboCell-TxRate TxRate-17024k 1149 VALUE KarlNet-TurboCell-TxRate TxRate-17152k 1150 VALUE KarlNet-TurboCell-TxRate TxRate-17280k 1151 VALUE KarlNet-TurboCell-TxRate TxRate-17408k 1152 VALUE KarlNet-TurboCell-TxRate TxRate-17536k 1153 VALUE KarlNet-TurboCell-TxRate TxRate-17664k 1154 VALUE KarlNet-TurboCell-TxRate TxRate-17792k 1155 VALUE KarlNet-TurboCell-TxRate TxRate-17920k 1156 VALUE KarlNet-TurboCell-TxRate TxRate-18048k 1157 VALUE KarlNet-TurboCell-TxRate TxRate-18176k 1158 VALUE KarlNet-TurboCell-TxRate TxRate-18304k 1159 VALUE KarlNet-TurboCell-TxRate TxRate-18432k 1160 VALUE KarlNet-TurboCell-TxRate TxRate-18560k 1161 VALUE KarlNet-TurboCell-TxRate TxRate-18688k 1162 VALUE KarlNet-TurboCell-TxRate TxRate-18816k 1163 VALUE KarlNet-TurboCell-TxRate TxRate-18944k 1164 VALUE KarlNet-TurboCell-TxRate TxRate-19072k 1165 VALUE KarlNet-TurboCell-TxRate TxRate-19200k 1166 VALUE KarlNet-TurboCell-TxRate TxRate-19328k 1167 VALUE KarlNet-TurboCell-TxRate TxRate-19456k 1168 VALUE KarlNet-TurboCell-TxRate TxRate-19584k 1169 VALUE KarlNet-TurboCell-TxRate TxRate-19712k 1170 VALUE KarlNet-TurboCell-TxRate TxRate-19840k 1171 VALUE KarlNet-TurboCell-TxRate TxRate-19968k 1172 VALUE KarlNet-TurboCell-TxRate TxRate-20096k 1173 VALUE KarlNet-TurboCell-TxRate TxRate-20224k 1174 VALUE KarlNet-TurboCell-TxRate TxRate-20352k 1175 VALUE KarlNet-TurboCell-TxRate TxRate-20480k 1176 VALUE KarlNet-TurboCell-TxRate TxRate-20608k 1177 VALUE KarlNet-TurboCell-TxRate TxRate-20736k 1178 VALUE KarlNet-TurboCell-TxRate TxRate-20864k 1179 VALUE KarlNet-TurboCell-TxRate TxRate-20992k 1180 VALUE KarlNet-TurboCell-TxRate TxRate-21120k 1181 VALUE KarlNet-TurboCell-TxRate TxRate-21248k 1182 VALUE KarlNet-TurboCell-TxRate TxRate-21376k 1183 VALUE KarlNet-TurboCell-TxRate TxRate-21504k 1184 VALUE KarlNet-TurboCell-TxRate TxRate-21632k 1185 VALUE KarlNet-TurboCell-TxRate TxRate-21760k 1186 VALUE KarlNet-TurboCell-TxRate TxRate-21888k 1187 VALUE KarlNet-TurboCell-TxRate TxRate-22016k 1188 VALUE KarlNet-TurboCell-TxRate TxRate-22144k 1189 VALUE KarlNet-TurboCell-TxRate TxRate-22272k 1190 VALUE KarlNet-TurboCell-TxRate TxRate-22400k 1191 VALUE KarlNet-TurboCell-TxRate TxRate-22528k 1192 VALUE KarlNet-TurboCell-TxRate TxRate-22656k 1193 VALUE KarlNet-TurboCell-TxRate TxRate-22784k 1194 VALUE KarlNet-TurboCell-TxRate TxRate-22912k 1195 VALUE KarlNet-TurboCell-TxRate TxRate-23040k 1196 VALUE KarlNet-TurboCell-TxRate TxRate-23168k 1197 VALUE KarlNet-TurboCell-TxRate TxRate-23296k 1198 VALUE KarlNet-TurboCell-TxRate TxRate-23424k 1199 VALUE KarlNet-TurboCell-TxRate TxRate-23552k 1200 VALUE KarlNet-TurboCell-TxRate TxRate-23680k 1201 VALUE KarlNet-TurboCell-TxRate TxRate-23808k 1202 VALUE KarlNet-TurboCell-TxRate TxRate-23936k 1203 VALUE KarlNet-TurboCell-TxRate TxRate-24064k 1204 VALUE KarlNet-TurboCell-TxRate TxRate-24192k 1205 VALUE KarlNet-TurboCell-TxRate TxRate-24320k 1206 VALUE KarlNet-TurboCell-TxRate TxRate-24448k 1207 VALUE KarlNet-TurboCell-TxRate TxRate-24576k 1208 VALUE KarlNet-TurboCell-TxRate TxRate-24704k 1209 VALUE KarlNet-TurboCell-TxRate TxRate-24832k 1210 VALUE KarlNet-TurboCell-TxRate TxRate-24960k 1211 VALUE KarlNet-TurboCell-TxRate TxRate-25088k 1212 VALUE KarlNet-TurboCell-TxRate TxRate-25216k 1213 VALUE KarlNet-TurboCell-TxRate TxRate-25344k 1214 VALUE KarlNet-TurboCell-TxRate TxRate-25472k 1215 VALUE KarlNet-TurboCell-TxRate TxRate-25600k 1216 VALUE KarlNet-TurboCell-TxRate TxRate-25728k 1217 VALUE KarlNet-TurboCell-TxRate TxRate-25856k 1218 VALUE KarlNet-TurboCell-TxRate TxRate-25984k 1219 VALUE KarlNet-TurboCell-TxRate TxRate-26112k 1220 VALUE KarlNet-TurboCell-TxRate TxRate-26240k 1221 VALUE KarlNet-TurboCell-TxRate TxRate-26368k 1222 VALUE KarlNet-TurboCell-TxRate TxRate-26496k 1223 VALUE KarlNet-TurboCell-TxRate TxRate-26624k 1224 VALUE KarlNet-TurboCell-TxRate TxRate-26752k 1225 VALUE KarlNet-TurboCell-TxRate TxRate-26880k 1226 VALUE KarlNet-TurboCell-TxRate TxRate-27008k 1227 VALUE KarlNet-TurboCell-TxRate TxRate-27136k 1228 VALUE KarlNet-TurboCell-TxRate TxRate-27264k 1229 VALUE KarlNet-TurboCell-TxRate TxRate-27392k 1230 VALUE KarlNet-TurboCell-TxRate TxRate-27520k 1231 VALUE KarlNet-TurboCell-TxRate TxRate-27648k 1232 VALUE KarlNet-TurboCell-TxRate TxRate-27776k 1233 VALUE KarlNet-TurboCell-TxRate TxRate-27904k 1234 VALUE KarlNet-TurboCell-TxRate TxRate-28032k 1235 VALUE KarlNet-TurboCell-TxRate TxRate-28160k 1236 VALUE KarlNet-TurboCell-TxRate TxRate-28288k 1237 VALUE KarlNet-TurboCell-TxRate TxRate-28416k 1238 VALUE KarlNet-TurboCell-TxRate TxRate-28544k 1239 VALUE KarlNet-TurboCell-TxRate TxRate-28672k 1240 VALUE KarlNet-TurboCell-TxRate TxRate-28800k 1241 VALUE KarlNet-TurboCell-TxRate TxRate-28928k 1242 VALUE KarlNet-TurboCell-TxRate TxRate-29056k 1243 VALUE KarlNet-TurboCell-TxRate TxRate-29184k 1244 VALUE KarlNet-TurboCell-TxRate TxRate-29312k 1245 VALUE KarlNet-TurboCell-TxRate TxRate-29440k 1246 VALUE KarlNet-TurboCell-TxRate TxRate-29568k 1247 VALUE KarlNet-TurboCell-TxRate TxRate-29696k 1248 VALUE KarlNet-TurboCell-TxRate TxRate-29824k 1249 VALUE KarlNet-TurboCell-TxRate TxRate-29952k 1250 VALUE KarlNet-TurboCell-TxRate TxRate-30080k 1251 VALUE KarlNet-TurboCell-TxRate TxRate-30208k 1252 VALUE KarlNet-TurboCell-TxRate TxRate-30336k 1253 VALUE KarlNet-TurboCell-TxRate TxRate-30464k 1254 VALUE KarlNet-TurboCell-TxRate TxRate-30592k 1255 VALUE KarlNet-TurboCell-TxRate TxRate-30720k 1256 VALUE KarlNet-TurboCell-TxRate TxRate-30848k 1257 VALUE KarlNet-TurboCell-TxRate TxRate-30976k 1258 VALUE KarlNet-TurboCell-TxRate TxRate-31104k 1259 VALUE KarlNet-TurboCell-TxRate TxRate-31232k 1260 VALUE KarlNet-TurboCell-TxRate TxRate-31360k 1261 VALUE KarlNet-TurboCell-TxRate TxRate-31488k 1262 VALUE KarlNet-TurboCell-TxRate TxRate-31616k 1263 VALUE KarlNet-TurboCell-TxRate TxRate-31744k 1264 VALUE KarlNet-TurboCell-TxRate TxRate-31872k 1265 VALUE KarlNet-TurboCell-TxRate TxRate-32000k 1266 VALUE KarlNet-TurboCell-TxRate TxRate-32128k 1267 VALUE KarlNet-TurboCell-TxRate TxRate-32256k 1268 VALUE KarlNet-TurboCell-TxRate TxRate-32384k 1269 VALUE KarlNet-TurboCell-TxRate TxRate-32512k 1270 VALUE KarlNet-TurboCell-TxRate TxRate-32640k 1271 VALUE KarlNet-TurboCell-TxRate TxRate-32768k 1272 VALUE KarlNet-TurboCell-TxRate TxRate-32896k 1273 VALUE KarlNet-TurboCell-TxRate TxRate-33024k 1274 VALUE KarlNet-TurboCell-TxRate TxRate-33152k 1275 VALUE KarlNet-TurboCell-TxRate TxRate-33280k 1276 VALUE KarlNet-TurboCell-TxRate TxRate-33408k 1277 VALUE KarlNet-TurboCell-TxRate TxRate-33536k 1278 VALUE KarlNet-TurboCell-TxRate TxRate-33664k 1279 VALUE KarlNet-TurboCell-TxRate TxRate-33792k 1280 VALUE KarlNet-TurboCell-TxRate TxRate-33920k 1281 VALUE KarlNet-TurboCell-TxRate TxRate-34048k 1282 VALUE KarlNet-TurboCell-TxRate TxRate-34176k 1283 VALUE KarlNet-TurboCell-TxRate TxRate-34304k 1284 VALUE KarlNet-TurboCell-TxRate TxRate-34432k 1285 VALUE KarlNet-TurboCell-TxRate TxRate-34560k 1286 VALUE KarlNet-TurboCell-TxRate TxRate-34688k 1287 VALUE KarlNet-TurboCell-TxRate TxRate-34816k 1288 VALUE KarlNet-TurboCell-TxRate TxRate-34944k 1289 VALUE KarlNet-TurboCell-TxRate TxRate-35072k 1290 VALUE KarlNet-TurboCell-TxRate TxRate-35200k 1291 VALUE KarlNet-TurboCell-TxRate TxRate-35328k 1292 VALUE KarlNet-TurboCell-TxRate TxRate-35456k 1293 VALUE KarlNet-TurboCell-TxRate TxRate-35584k 1294 VALUE KarlNet-TurboCell-TxRate TxRate-35712k 1295 VALUE KarlNet-TurboCell-TxRate TxRate-35840k 1296 VALUE KarlNet-TurboCell-TxRate TxRate-35968k 1297 VALUE KarlNet-TurboCell-TxRate TxRate-36096k 1298 VALUE KarlNet-TurboCell-TxRate TxRate-36224k 1299 VALUE KarlNet-TurboCell-TxRate TxRate-36352k 1300 VALUE KarlNet-TurboCell-TxRate TxRate-36480k 1301 VALUE KarlNet-TurboCell-TxRate TxRate-36608k 1302 VALUE KarlNet-TurboCell-TxRate TxRate-36736k 1303 VALUE KarlNet-TurboCell-TxRate TxRate-36864k 1304 VALUE KarlNet-TurboCell-TxRate TxRate-36992k 1305 VALUE KarlNet-TurboCell-TxRate TxRate-37120k 1306 VALUE KarlNet-TurboCell-TxRate TxRate-37248k 1307 VALUE KarlNet-TurboCell-TxRate TxRate-37376k 1308 VALUE KarlNet-TurboCell-TxRate TxRate-37504k 1309 VALUE KarlNet-TurboCell-TxRate TxRate-37632k 1310 VALUE KarlNet-TurboCell-TxRate TxRate-37760k 1311 VALUE KarlNet-TurboCell-TxRate TxRate-37888k 1312 VALUE KarlNet-TurboCell-TxRate TxRate-38016k 1313 VALUE KarlNet-TurboCell-TxRate TxRate-38144k 1314 VALUE KarlNet-TurboCell-TxRate TxRate-38272k 1315 VALUE KarlNet-TurboCell-TxRate TxRate-38400k 1316 VALUE KarlNet-TurboCell-TxRate TxRate-38528k 1317 VALUE KarlNet-TurboCell-TxRate TxRate-38656k 1318 VALUE KarlNet-TurboCell-TxRate TxRate-38784k 1319 VALUE KarlNet-TurboCell-TxRate TxRate-38912k 1320 VALUE KarlNet-TurboCell-TxRate TxRate-39040k 1321 VALUE KarlNet-TurboCell-TxRate TxRate-39168k 1322 VALUE KarlNet-TurboCell-TxRate TxRate-39296k 1323 VALUE KarlNet-TurboCell-TxRate TxRate-39424k 1324 VALUE KarlNet-TurboCell-TxRate TxRate-39552k 1325 VALUE KarlNet-TurboCell-TxRate TxRate-39680k 1326 VALUE KarlNet-TurboCell-TxRate TxRate-39808k 1327 VALUE KarlNet-TurboCell-TxRate TxRate-39936k 1328 VALUE KarlNet-TurboCell-TxRate TxRate-40064k 1329 VALUE KarlNet-TurboCell-TxRate TxRate-40192k 1330 VALUE KarlNet-TurboCell-TxRate TxRate-40320k 1331 VALUE KarlNet-TurboCell-TxRate TxRate-40448k 1332 VALUE KarlNet-TurboCell-TxRate TxRate-40576k 1333 VALUE KarlNet-TurboCell-TxRate TxRate-40704k 1334 VALUE KarlNet-TurboCell-TxRate TxRate-40832k 1335 VALUE KarlNet-TurboCell-TxRate TxRate-40960k 1336 VALUE KarlNet-TurboCell-TxRate TxRate-41088k 1337 VALUE KarlNet-TurboCell-TxRate TxRate-41216k 1338 VALUE KarlNet-TurboCell-TxRate TxRate-41344k 1339 VALUE KarlNet-TurboCell-TxRate TxRate-41472k 1340 VALUE KarlNet-TurboCell-TxRate TxRate-41600k 1341 VALUE KarlNet-TurboCell-TxRate TxRate-41728k 1342 VALUE KarlNet-TurboCell-TxRate TxRate-41856k 1343 VALUE KarlNet-TurboCell-TxRate TxRate-41984k 1344 VALUE KarlNet-TurboCell-TxRate TxRate-42112k 1345 VALUE KarlNet-TurboCell-TxRate TxRate-42240k 1346 VALUE KarlNet-TurboCell-TxRate TxRate-42368k 1347 VALUE KarlNet-TurboCell-TxRate TxRate-42496k 1348 VALUE KarlNet-TurboCell-TxRate TxRate-42624k 1349 VALUE KarlNet-TurboCell-TxRate TxRate-42752k 1350 VALUE KarlNet-TurboCell-TxRate TxRate-42880k 1351 VALUE KarlNet-TurboCell-TxRate TxRate-43008k 1352 VALUE KarlNet-TurboCell-TxRate TxRate-43136k 1353 VALUE KarlNet-TurboCell-TxRate TxRate-43264k 1354 VALUE KarlNet-TurboCell-TxRate TxRate-43392k 1355 VALUE KarlNet-TurboCell-TxRate TxRate-43520k 1356 VALUE KarlNet-TurboCell-TxRate TxRate-43648k 1357 VALUE KarlNet-TurboCell-TxRate TxRate-43776k 1358 VALUE KarlNet-TurboCell-TxRate TxRate-43904k 1359 VALUE KarlNet-TurboCell-TxRate TxRate-44032k 1360 VALUE KarlNet-TurboCell-TxRate TxRate-44160k 1361 VALUE KarlNet-TurboCell-TxRate TxRate-44288k 1362 VALUE KarlNet-TurboCell-TxRate TxRate-44416k 1363 VALUE KarlNet-TurboCell-TxRate TxRate-44544k 1364 VALUE KarlNet-TurboCell-TxRate TxRate-44672k 1365 VALUE KarlNet-TurboCell-TxRate TxRate-44800k 1366 VALUE KarlNet-TurboCell-TxRate TxRate-44928k 1367 VALUE KarlNet-TurboCell-TxRate TxRate-45056k 1368 VALUE KarlNet-TurboCell-TxRate TxRate-45184k 1369 VALUE KarlNet-TurboCell-TxRate TxRate-45312k 1370 VALUE KarlNet-TurboCell-TxRate TxRate-45440k 1371 VALUE KarlNet-TurboCell-TxRate TxRate-45568k 1372 VALUE KarlNet-TurboCell-TxRate TxRate-45696k 1373 VALUE KarlNet-TurboCell-TxRate TxRate-45824k 1374 VALUE KarlNet-TurboCell-TxRate TxRate-45952k 1375 VALUE KarlNet-TurboCell-TxRate TxRate-46080k 1376 VALUE KarlNet-TurboCell-TxRate TxRate-46208k 1377 VALUE KarlNet-TurboCell-TxRate TxRate-46336k 1378 VALUE KarlNet-TurboCell-TxRate TxRate-46464k 1379 VALUE KarlNet-TurboCell-TxRate TxRate-46592k 1380 VALUE KarlNet-TurboCell-TxRate TxRate-46720k 1381 VALUE KarlNet-TurboCell-TxRate TxRate-46848k 1382 VALUE KarlNet-TurboCell-TxRate TxRate-46976k 1383 VALUE KarlNet-TurboCell-TxRate TxRate-47104k 1384 VALUE KarlNet-TurboCell-TxRate TxRate-47232k 1385 VALUE KarlNet-TurboCell-TxRate TxRate-47360k 1386 VALUE KarlNet-TurboCell-TxRate TxRate-47488k 1387 VALUE KarlNet-TurboCell-TxRate TxRate-47616k 1388 VALUE KarlNet-TurboCell-TxRate TxRate-47744k 1389 VALUE KarlNet-TurboCell-TxRate TxRate-47872k 1390 VALUE KarlNet-TurboCell-TxRate TxRate-48000k 1391 VALUE KarlNet-TurboCell-TxRate TxRate-48128k 1392 VALUE KarlNet-TurboCell-TxRate TxRate-48256k 1393 VALUE KarlNet-TurboCell-TxRate TxRate-48384k 1394 VALUE KarlNet-TurboCell-TxRate TxRate-48512k 1395 VALUE KarlNet-TurboCell-TxRate TxRate-48640k 1396 VALUE KarlNet-TurboCell-TxRate TxRate-48768k 1397 VALUE KarlNet-TurboCell-TxRate TxRate-48896k 1398 VALUE KarlNet-TurboCell-TxRate TxRate-49024k 1399 VALUE KarlNet-TurboCell-TxRate TxRate-49152k 1400 VALUE KarlNet-TurboCell-TxRate TxRate-49280k 1401 VALUE KarlNet-TurboCell-TxRate TxRate-49408k 1402 VALUE KarlNet-TurboCell-TxRate TxRate-49536k 1403 VALUE KarlNet-TurboCell-TxRate TxRate-49664k 1404 VALUE KarlNet-TurboCell-TxRate TxRate-49792k 1405 VALUE KarlNet-TurboCell-TxRate TxRate-49920k 1406 VALUE KarlNet-TurboCell-TxRate TxRate-50048k 1407 VALUE KarlNet-TurboCell-TxRate TxRate-50176k 1408 VALUE KarlNet-TurboCell-TxRate TxRate-50304k 1409 VALUE KarlNet-TurboCell-TxRate TxRate-50432k 1410 VALUE KarlNet-TurboCell-TxRate TxRate-50560k 1411 VALUE KarlNet-TurboCell-TxRate TxRate-50688k 1412 VALUE KarlNet-TurboCell-TxRate TxRate-50816k 1413 VALUE KarlNet-TurboCell-TxRate TxRate-50944k 1414 VALUE KarlNet-TurboCell-TxRate TxRate-51072k 1415 VALUE KarlNet-TurboCell-TxRate TxRate-51200k 1416 VALUE KarlNet-TurboCell-TxRate TxRate-51328k 1417 VALUE KarlNet-TurboCell-TxRate TxRate-51456k 1418 VALUE KarlNet-TurboCell-TxRate TxRate-51584k 1419 VALUE KarlNet-TurboCell-TxRate TxRate-51712k 1420 VALUE KarlNet-TurboCell-TxRate TxRate-51840k 1421 VALUE KarlNet-TurboCell-TxRate TxRate-51968k 1422 VALUE KarlNet-TurboCell-TxRate TxRate-52096k 1423 VALUE KarlNet-TurboCell-TxRate TxRate-52224k 1424 VALUE KarlNet-TurboCell-TxRate TxRate-52352k 1425 VALUE KarlNet-TurboCell-TxRate TxRate-52480k 1426 VALUE KarlNet-TurboCell-TxRate TxRate-52608k 1427 VALUE KarlNet-TurboCell-TxRate TxRate-52736k 1428 VALUE KarlNet-TurboCell-TxRate TxRate-52864k 1429 VALUE KarlNet-TurboCell-TxRate TxRate-52992k 1430 VALUE KarlNet-TurboCell-TxRate TxRate-53120k 1431 VALUE KarlNet-TurboCell-TxRate TxRate-53248k 1432 VALUE KarlNet-TurboCell-TxRate TxRate-53376k 1433 VALUE KarlNet-TurboCell-TxRate TxRate-53504k 1434 VALUE KarlNet-TurboCell-TxRate TxRate-53632k 1435 VALUE KarlNet-TurboCell-TxRate TxRate-53760k 1436 VALUE KarlNet-TurboCell-TxRate TxRate-53888k 1437 VALUE KarlNet-TurboCell-TxRate TxRate-54016k 1438 VALUE KarlNet-TurboCell-TxRate TxRate-54144k 1439 VALUE KarlNet-TurboCell-TxRate TxRate-54272k 1440 VALUE KarlNet-TurboCell-TxRate TxRate-54400k 1441 VALUE KarlNet-TurboCell-TxRate TxRate-54528k 1442 VALUE KarlNet-TurboCell-TxRate TxRate-54656k 1443 VALUE KarlNet-TurboCell-TxRate TxRate-54784k 1444 VALUE KarlNet-TurboCell-TxRate TxRate-54912k 1445 VALUE KarlNet-TurboCell-TxRate TxRate-55040k 1446 VALUE KarlNet-TurboCell-TxRate TxRate-55168k 1447 VALUE KarlNet-TurboCell-TxRate TxRate-55296k 1448 VALUE KarlNet-TurboCell-TxRate TxRate-55424k 1449 VALUE KarlNet-TurboCell-TxRate TxRate-55552k 1450 VALUE KarlNet-TurboCell-TxRate TxRate-55680k 1451 VALUE KarlNet-TurboCell-TxRate TxRate-55808k 1452 VALUE KarlNet-TurboCell-TxRate TxRate-55936k 1453 VALUE KarlNet-TurboCell-TxRate TxRate-56064k 1454 VALUE KarlNet-TurboCell-TxRate TxRate-56192k 1455 VALUE KarlNet-TurboCell-TxRate TxRate-56320k 1456 VALUE KarlNet-TurboCell-TxRate TxRate-56448k 1457 VALUE KarlNet-TurboCell-TxRate TxRate-56576k 1458 VALUE KarlNet-TurboCell-TxRate TxRate-56704k 1459 VALUE KarlNet-TurboCell-TxRate TxRate-56832k 1460 VALUE KarlNet-TurboCell-TxRate TxRate-56960k 1461 VALUE KarlNet-TurboCell-TxRate TxRate-57088k 1462 VALUE KarlNet-TurboCell-TxRate TxRate-57216k 1463 VALUE KarlNet-TurboCell-TxRate TxRate-57344k 1464 VALUE KarlNet-TurboCell-TxRate TxRate-57472k 1465 VALUE KarlNet-TurboCell-TxRate TxRate-57600k 1466 VALUE KarlNet-TurboCell-TxRate TxRate-57728k 1467 VALUE KarlNet-TurboCell-TxRate TxRate-57856k 1468 VALUE KarlNet-TurboCell-TxRate TxRate-57984k 1469 VALUE KarlNet-TurboCell-TxRate TxRate-58112k 1470 VALUE KarlNet-TurboCell-TxRate TxRate-58240k 1471 VALUE KarlNet-TurboCell-TxRate TxRate-58368k 1472 VALUE KarlNet-TurboCell-TxRate TxRate-58496k 1473 VALUE KarlNet-TurboCell-TxRate TxRate-58624k 1474 VALUE KarlNet-TurboCell-TxRate TxRate-58752k 1475 VALUE KarlNet-TurboCell-TxRate TxRate-58880k 1476 VALUE KarlNet-TurboCell-TxRate TxRate-59008k 1477 VALUE KarlNet-TurboCell-TxRate TxRate-59136k 1478 VALUE KarlNet-TurboCell-TxRate TxRate-59264k 1479 VALUE KarlNet-TurboCell-TxRate TxRate-59392k 1480 VALUE KarlNet-TurboCell-TxRate TxRate-59520k 1481 VALUE KarlNet-TurboCell-TxRate TxRate-59648k 1482 VALUE KarlNet-TurboCell-TxRate TxRate-59776k 1483 VALUE KarlNet-TurboCell-TxRate TxRate-59904k 1484 VALUE KarlNet-TurboCell-TxRate TxRate-60032k 1485 VALUE KarlNet-TurboCell-TxRate TxRate-60160k 1486 VALUE KarlNet-TurboCell-TxRate TxRate-60288k 1487 VALUE KarlNet-TurboCell-TxRate TxRate-60416k 1488 VALUE KarlNet-TurboCell-TxRate TxRate-60544k 1489 VALUE KarlNet-TurboCell-TxRate TxRate-60672k 1490 VALUE KarlNet-TurboCell-TxRate TxRate-60800k 1491 VALUE KarlNet-TurboCell-TxRate TxRate-60928k 1492 VALUE KarlNet-TurboCell-TxRate TxRate-61056k 1493 VALUE KarlNet-TurboCell-TxRate TxRate-61184k 1494 VALUE KarlNet-TurboCell-TxRate TxRate-61312k 1495 VALUE KarlNet-TurboCell-TxRate TxRate-61440k 1496 VALUE KarlNet-TurboCell-TxRate TxRate-61568k 1497 VALUE KarlNet-TurboCell-TxRate TxRate-61696k 1498 VALUE KarlNet-TurboCell-TxRate TxRate-61824k 1499 VALUE KarlNet-TurboCell-TxRate TxRate-61952k 1500 VALUE KarlNet-TurboCell-TxRate TxRate-62080k 1501 VALUE KarlNet-TurboCell-TxRate TxRate-62208k 1502 VALUE KarlNet-TurboCell-TxRate TxRate-62336k 1503 VALUE KarlNet-TurboCell-TxRate TxRate-62464k 1504 VALUE KarlNet-TurboCell-TxRate TxRate-62592k 1505 VALUE KarlNet-TurboCell-TxRate TxRate-62720k 1506 VALUE KarlNet-TurboCell-TxRate TxRate-62848k 1507 VALUE KarlNet-TurboCell-TxRate TxRate-62976k 1508 VALUE KarlNet-TurboCell-TxRate TxRate-63104k 1509 VALUE KarlNet-TurboCell-TxRate TxRate-63232k 1510 VALUE KarlNet-TurboCell-TxRate TxRate-63360k 1511 VALUE KarlNet-TurboCell-TxRate TxRate-63488k 1512 VALUE KarlNet-TurboCell-TxRate TxRate-63616k 1513 VALUE KarlNet-TurboCell-TxRate TxRate-63744k 1514 VALUE KarlNet-TurboCell-TxRate TxRate-63872k 1515 VALUE KarlNet-TurboCell-TxRate TxRate-64000k 1516 VALUE KarlNet-TurboCell-TxRate TxRate-64128k 1517 VALUE KarlNet-TurboCell-TxRate TxRate-64256k 1518 VALUE KarlNet-TurboCell-TxRate TxRate-64384k 1519 VALUE KarlNet-TurboCell-TxRate TxRate-64512k 1520 VALUE KarlNet-TurboCell-TxRate TxRate-64640k 1521 VALUE KarlNet-TurboCell-TxRate TxRate-64768k 1522 VALUE KarlNet-TurboCell-TxRate TxRate-64896k 1523 VALUE KarlNet-TurboCell-TxRate TxRate-65024k 1524 VALUE KarlNet-TurboCell-TxRate TxRate-65152k 1525 VALUE KarlNet-TurboCell-TxRate TxRate-65280k 1526 VALUE KarlNet-TurboCell-TxRate TxRate-65408k 1527 VALUE KarlNet-TurboCell-TxRate TxRate-65536k 1528 VALUE KarlNet-TurboCell-TxRate TxRate-65664k 1529 VALUE KarlNet-TurboCell-TxRate TxRate-65792k 1530 VALUE KarlNet-TurboCell-TxRate TxRate-65920k 1531 VALUE KarlNet-TurboCell-TxRate TxRate-66048k 1532 VALUE KarlNet-TurboCell-TxRate TxRate-66176k 1533 VALUE KarlNet-TurboCell-TxRate TxRate-66304k 1534 VALUE KarlNet-TurboCell-TxRate TxRate-66432k 1535 VALUE KarlNet-TurboCell-TxRate TxRate-66560k 1536 VALUE KarlNet-TurboCell-TxRate TxRate-66688k 1537 VALUE KarlNet-TurboCell-TxRate TxRate-66816k 1538 VALUE KarlNet-TurboCell-TxRate TxRate-66944k 1539 VALUE KarlNet-TurboCell-TxRate TxRate-67072k 1540 VALUE KarlNet-TurboCell-TxRate TxRate-67200k 1541 VALUE KarlNet-TurboCell-TxRate TxRate-67328k 1542 VALUE KarlNet-TurboCell-TxRate TxRate-67456k 1543 VALUE KarlNet-TurboCell-TxRate TxRate-67584k 1544 VALUE KarlNet-TurboCell-TxRate TxRate-67712k 1545 VALUE KarlNet-TurboCell-TxRate TxRate-67840k 1546 VALUE KarlNet-TurboCell-TxRate TxRate-67968k 1547 VALUE KarlNet-TurboCell-TxRate TxRate-68096k 1548 VALUE KarlNet-TurboCell-TxRate TxRate-68224k 1549 VALUE KarlNet-TurboCell-TxRate TxRate-68352k 1550 VALUE KarlNet-TurboCell-TxRate TxRate-68480k 1551 VALUE KarlNet-TurboCell-TxRate TxRate-68608k 1552 VALUE KarlNet-TurboCell-TxRate TxRate-68736k 1553 VALUE KarlNet-TurboCell-TxRate TxRate-68864k 1554 VALUE KarlNet-TurboCell-TxRate TxRate-68992k 1555 VALUE KarlNet-TurboCell-TxRate TxRate-69120k 1556 VALUE KarlNet-TurboCell-TxRate TxRate-69248k 1557 VALUE KarlNet-TurboCell-TxRate TxRate-69376k 1558 VALUE KarlNet-TurboCell-TxRate TxRate-69504k 1559 VALUE KarlNet-TurboCell-TxRate TxRate-69632k 1560 VALUE KarlNet-TurboCell-TxRate TxRate-69760k 1561 VALUE KarlNet-TurboCell-TxRate TxRate-69888k 1562 VALUE KarlNet-TurboCell-TxRate TxRate-70016k 1563 VALUE KarlNet-TurboCell-TxRate TxRate-70144k 1564 VALUE KarlNet-TurboCell-TxRate TxRate-70272k 1565 VALUE KarlNet-TurboCell-TxRate TxRate-70400k 1566 VALUE KarlNet-TurboCell-TxRate TxRate-70528k 1567 VALUE KarlNet-TurboCell-TxRate TxRate-70656k 1568 VALUE KarlNet-TurboCell-TxRate TxRate-70784k 1569 VALUE KarlNet-TurboCell-TxRate TxRate-70912k 1570 VALUE KarlNet-TurboCell-TxRate TxRate-71040k 1571 VALUE KarlNet-TurboCell-TxRate TxRate-71168k 1572 VALUE KarlNet-TurboCell-TxRate TxRate-71296k 1573 VALUE KarlNet-TurboCell-TxRate TxRate-71424k 1574 VALUE KarlNet-TurboCell-TxRate TxRate-71552k 1575 VALUE KarlNet-TurboCell-TxRate TxRate-71680k 1576 VALUE KarlNet-TurboCell-TxRate TxRate-71808k 1577 VALUE KarlNet-TurboCell-TxRate TxRate-71936k 1578 VALUE KarlNet-TurboCell-TxRate TxRate-72064k 1579 VALUE KarlNet-TurboCell-TxRate TxRate-72192k 1580 VALUE KarlNet-TurboCell-TxRate TxRate-72320k 1581 VALUE KarlNet-TurboCell-TxRate TxRate-72448k 1582 VALUE KarlNet-TurboCell-TxRate TxRate-72576k 1583 VALUE KarlNet-TurboCell-TxRate TxRate-72704k 1584 VALUE KarlNet-TurboCell-TxRate TxRate-72832k 1585 VALUE KarlNet-TurboCell-TxRate TxRate-72960k 1586 VALUE KarlNet-TurboCell-TxRate TxRate-73088k 1587 VALUE KarlNet-TurboCell-TxRate TxRate-73216k 1588 VALUE KarlNet-TurboCell-TxRate TxRate-73344k 1589 VALUE KarlNet-TurboCell-TxRate TxRate-73472k 1590 VALUE KarlNet-TurboCell-TxRate TxRate-73600k 1591 VALUE KarlNet-TurboCell-TxRate TxRate-73728k 1592 VALUE KarlNet-TurboCell-TxRate TxRate-73856k 1593 VALUE KarlNet-TurboCell-TxRate TxRate-73984k 1594 VALUE KarlNet-TurboCell-TxRate TxRate-74112k 1595 VALUE KarlNet-TurboCell-TxRate TxRate-74240k 1596 VALUE KarlNet-TurboCell-TxRate TxRate-74368k 1597 VALUE KarlNet-TurboCell-TxRate TxRate-74496k 1598 VALUE KarlNet-TurboCell-TxRate TxRate-74624k 1599 VALUE KarlNet-TurboCell-TxRate TxRate-74752k 1600 VALUE KarlNet-TurboCell-TxRate TxRate-74880k 1601 VALUE KarlNet-TurboCell-TxRate TxRate-75008k 1602 VALUE KarlNet-TurboCell-TxRate TxRate-75136k 1603 VALUE KarlNet-TurboCell-TxRate TxRate-75264k 1604 VALUE KarlNet-TurboCell-TxRate TxRate-75392k 1605 VALUE KarlNet-TurboCell-TxRate TxRate-75520k 1606 VALUE KarlNet-TurboCell-TxRate TxRate-75648k 1607 VALUE KarlNet-TurboCell-TxRate TxRate-75776k 1608 VALUE KarlNet-TurboCell-TxRate TxRate-75904k 1609 VALUE KarlNet-TurboCell-TxRate TxRate-76032k 1610 VALUE KarlNet-TurboCell-TxRate TxRate-76160k 1611 VALUE KarlNet-TurboCell-TxRate TxRate-76288k 1612 VALUE KarlNet-TurboCell-TxRate TxRate-76416k 1613 VALUE KarlNet-TurboCell-TxRate TxRate-76544k 1614 VALUE KarlNet-TurboCell-TxRate TxRate-76672k 1615 VALUE KarlNet-TurboCell-TxRate TxRate-76800k 1616 VALUE KarlNet-TurboCell-TxRate TxRate-76928k 1617 VALUE KarlNet-TurboCell-TxRate TxRate-77056k 1618 VALUE KarlNet-TurboCell-TxRate TxRate-77184k 1619 VALUE KarlNet-TurboCell-TxRate TxRate-77312k 1620 VALUE KarlNet-TurboCell-TxRate TxRate-77440k 1621 VALUE KarlNet-TurboCell-TxRate TxRate-77568k 1622 VALUE KarlNet-TurboCell-TxRate TxRate-77696k 1623 VALUE KarlNet-TurboCell-TxRate TxRate-77824k 1624 VALUE KarlNet-TurboCell-TxRate TxRate-77952k 1625 VALUE KarlNet-TurboCell-TxRate TxRate-78080k 1626 VALUE KarlNet-TurboCell-TxRate TxRate-78208k 1627 VALUE KarlNet-TurboCell-TxRate TxRate-78336k 1628 VALUE KarlNet-TurboCell-TxRate TxRate-78464k 1629 VALUE KarlNet-TurboCell-TxRate TxRate-78592k 1630 VALUE KarlNet-TurboCell-TxRate TxRate-78720k 1631 VALUE KarlNet-TurboCell-TxRate TxRate-78848k 1632 VALUE KarlNet-TurboCell-TxRate TxRate-78976k 1633 VALUE KarlNet-TurboCell-TxRate TxRate-79104k 1634 VALUE KarlNet-TurboCell-TxRate TxRate-79232k 1635 VALUE KarlNet-TurboCell-TxRate TxRate-79360k 1636 VALUE KarlNet-TurboCell-TxRate TxRate-79488k 1637 VALUE KarlNet-TurboCell-TxRate TxRate-79616k 1638 VALUE KarlNet-TurboCell-TxRate TxRate-79744k 1639 VALUE KarlNet-TurboCell-TxRate TxRate-79872k 1640 VALUE KarlNet-TurboCell-TxRate TxRate-80000k 1641 VALUE KarlNet-TurboCell-TxRate TxRate-80128k 1642 VALUE KarlNet-TurboCell-TxRate TxRate-80256k 1643 VALUE KarlNet-TurboCell-TxRate TxRate-80384k 1644 VALUE KarlNet-TurboCell-TxRate TxRate-80512k 1645 VALUE KarlNet-TurboCell-TxRate TxRate-80640k 1646 VALUE KarlNet-TurboCell-TxRate TxRate-80768k 1647 VALUE KarlNet-TurboCell-TxRate TxRate-80896k 1648 VALUE KarlNet-TurboCell-TxRate TxRate-81024k 1649 VALUE KarlNet-TurboCell-TxRate TxRate-81152k 1650 VALUE KarlNet-TurboCell-TxRate TxRate-81280k 1651 VALUE KarlNet-TurboCell-TxRate TxRate-81408k 1652 VALUE KarlNet-TurboCell-TxRate TxRate-81536k 1653 VALUE KarlNet-TurboCell-TxRate TxRate-81664k 1654 VALUE KarlNet-TurboCell-TxRate TxRate-81792k 1655 VALUE KarlNet-TurboCell-TxRate TxRate-81920k 1656 VALUE KarlNet-TurboCell-TxRate TxRate-82048k 1657 VALUE KarlNet-TurboCell-TxRate TxRate-82176k 1658 VALUE KarlNet-TurboCell-TxRate TxRate-82304k 1659 VALUE KarlNet-TurboCell-TxRate TxRate-82432k 1660 VALUE KarlNet-TurboCell-TxRate TxRate-82560k 1661 VALUE KarlNet-TurboCell-TxRate TxRate-82688k 1662 VALUE KarlNet-TurboCell-TxRate TxRate-82816k 1663 VALUE KarlNet-TurboCell-TxRate TxRate-82944k 1664 VALUE KarlNet-TurboCell-TxRate TxRate-83072k 1665 VALUE KarlNet-TurboCell-TxRate TxRate-83200k 1666 VALUE KarlNet-TurboCell-TxRate TxRate-83328k 1667 VALUE KarlNet-TurboCell-TxRate TxRate-83456k 1668 VALUE KarlNet-TurboCell-TxRate TxRate-83584k 1669 VALUE KarlNet-TurboCell-TxRate TxRate-83712k 1670 VALUE KarlNet-TurboCell-TxRate TxRate-83840k 1671 VALUE KarlNet-TurboCell-TxRate TxRate-83968k 1672 VALUE KarlNet-TurboCell-TxRate TxRate-84096k 1673 VALUE KarlNet-TurboCell-TxRate TxRate-84224k 1674 VALUE KarlNet-TurboCell-TxRate TxRate-84352k 1675 VALUE KarlNet-TurboCell-TxRate TxRate-84480k 1676 VALUE KarlNet-TurboCell-TxRate TxRate-84608k 1677 VALUE KarlNet-TurboCell-TxRate TxRate-84736k 1678 VALUE KarlNet-TurboCell-TxRate TxRate-84864k 1679 VALUE KarlNet-TurboCell-TxRate TxRate-84992k 1680 VALUE KarlNet-TurboCell-TxRate TxRate-85120k 1681 VALUE KarlNet-TurboCell-TxRate TxRate-85248k 1682 VALUE KarlNet-TurboCell-TxRate TxRate-85376k 1683 VALUE KarlNet-TurboCell-TxRate TxRate-85504k 1684 VALUE KarlNet-TurboCell-TxRate TxRate-85632k 1685 VALUE KarlNet-TurboCell-TxRate TxRate-85760k 1686 VALUE KarlNet-TurboCell-TxRate TxRate-85888k 1687 VALUE KarlNet-TurboCell-TxRate TxRate-86016k 1688 VALUE KarlNet-TurboCell-TxRate TxRate-86144k 1689 VALUE KarlNet-TurboCell-TxRate TxRate-86272k 1690 VALUE KarlNet-TurboCell-TxRate TxRate-86400k 1691 VALUE KarlNet-TurboCell-TxRate TxRate-86528k 1692 VALUE KarlNet-TurboCell-TxRate TxRate-86656k 1693 VALUE KarlNet-TurboCell-TxRate TxRate-86784k 1694 VALUE KarlNet-TurboCell-TxRate TxRate-86912k 1695 VALUE KarlNet-TurboCell-TxRate TxRate-87040k 1696 VALUE KarlNet-TurboCell-TxRate TxRate-87168k 1697 VALUE KarlNet-TurboCell-TxRate TxRate-87296k 1698 VALUE KarlNet-TurboCell-TxRate TxRate-87424k 1699 VALUE KarlNet-TurboCell-TxRate TxRate-87552k 1700 VALUE KarlNet-TurboCell-TxRate TxRate-87680k 1701 VALUE KarlNet-TurboCell-TxRate TxRate-87808k 1702 VALUE KarlNet-TurboCell-TxRate TxRate-87936k 1703 VALUE KarlNet-TurboCell-TxRate TxRate-88064k 1704 VALUE KarlNet-TurboCell-TxRate TxRate-88192k 1705 VALUE KarlNet-TurboCell-TxRate TxRate-88320k 1706 VALUE KarlNet-TurboCell-TxRate TxRate-88448k 1707 VALUE KarlNet-TurboCell-TxRate TxRate-88576k 1708 VALUE KarlNet-TurboCell-TxRate TxRate-88704k 1709 VALUE KarlNet-TurboCell-TxRate TxRate-88832k 1710 VALUE KarlNet-TurboCell-TxRate TxRate-88960k 1711 VALUE KarlNet-TurboCell-TxRate TxRate-89088k 1712 VALUE KarlNet-TurboCell-TxRate TxRate-89216k 1713 VALUE KarlNet-TurboCell-TxRate TxRate-89344k 1714 VALUE KarlNet-TurboCell-TxRate TxRate-89472k 1715 VALUE KarlNet-TurboCell-TxRate TxRate-89600k 1716 VALUE KarlNet-TurboCell-TxRate TxRate-89728k 1717 VALUE KarlNet-TurboCell-TxRate TxRate-89856k 1718 VALUE KarlNet-TurboCell-TxRate TxRate-89984k 1719 VALUE KarlNet-TurboCell-TxRate TxRate-90112k 1720 VALUE KarlNet-TurboCell-TxRate TxRate-90240k 1721 VALUE KarlNet-TurboCell-TxRate TxRate-90368k 1722 VALUE KarlNet-TurboCell-TxRate TxRate-90496k 1723 VALUE KarlNet-TurboCell-TxRate TxRate-90624k 1724 VALUE KarlNet-TurboCell-TxRate TxRate-90752k 1725 VALUE KarlNet-TurboCell-TxRate TxRate-90880k 1726 VALUE KarlNet-TurboCell-TxRate TxRate-91008k 1727 VALUE KarlNet-TurboCell-TxRate TxRate-91136k 1728 VALUE KarlNet-TurboCell-TxRate TxRate-91264k 1729 VALUE KarlNet-TurboCell-TxRate TxRate-91392k 1730 VALUE KarlNet-TurboCell-TxRate TxRate-91520k 1731 VALUE KarlNet-TurboCell-TxRate TxRate-91648k 1732 VALUE KarlNet-TurboCell-TxRate TxRate-91776k 1733 VALUE KarlNet-TurboCell-TxRate TxRate-91904k 1734 VALUE KarlNet-TurboCell-TxRate TxRate-92032k 1735 VALUE KarlNet-TurboCell-TxRate TxRate-92160k 1736 VALUE KarlNet-TurboCell-TxRate TxRate-92288k 1737 VALUE KarlNet-TurboCell-TxRate TxRate-92416k 1738 VALUE KarlNet-TurboCell-TxRate TxRate-92544k 1739 VALUE KarlNet-TurboCell-TxRate TxRate-92672k 1740 VALUE KarlNet-TurboCell-TxRate TxRate-92800k 1741 VALUE KarlNet-TurboCell-TxRate TxRate-92928k 1742 VALUE KarlNet-TurboCell-TxRate TxRate-93056k 1743 VALUE KarlNet-TurboCell-TxRate TxRate-93184k 1744 VALUE KarlNet-TurboCell-TxRate TxRate-93312k 1745 VALUE KarlNet-TurboCell-TxRate TxRate-93440k 1746 VALUE KarlNet-TurboCell-TxRate TxRate-93568k 1747 VALUE KarlNet-TurboCell-TxRate TxRate-93696k 1748 VALUE KarlNet-TurboCell-TxRate TxRate-93824k 1749 VALUE KarlNet-TurboCell-TxRate TxRate-93952k 1750 VALUE KarlNet-TurboCell-TxRate TxRate-94080k 1751 VALUE KarlNet-TurboCell-TxRate TxRate-94208k 1752 VALUE KarlNet-TurboCell-TxRate TxRate-94336k 1753 VALUE KarlNet-TurboCell-TxRate TxRate-94464k 1754 VALUE KarlNet-TurboCell-TxRate TxRate-94592k 1755 VALUE KarlNet-TurboCell-TxRate TxRate-94720k 1756 VALUE KarlNet-TurboCell-TxRate TxRate-94848k 1757 VALUE KarlNet-TurboCell-TxRate TxRate-94976k 1758 VALUE KarlNet-TurboCell-TxRate TxRate-95104k 1759 VALUE KarlNet-TurboCell-TxRate TxRate-95232k 1760 VALUE KarlNet-TurboCell-TxRate TxRate-95360k 1761 VALUE KarlNet-TurboCell-TxRate TxRate-95488k 1762 VALUE KarlNet-TurboCell-TxRate TxRate-95616k 1763 VALUE KarlNet-TurboCell-TxRate TxRate-95744k 1764 VALUE KarlNet-TurboCell-TxRate TxRate-95872k 1765 VALUE KarlNet-TurboCell-TxRate TxRate-96000k 1766 VALUE KarlNet-TurboCell-TxRate TxRate-96128k 1767 VALUE KarlNet-TurboCell-TxRate TxRate-96256k 1768 VALUE KarlNet-TurboCell-TxRate TxRate-96384k 1769 VALUE KarlNet-TurboCell-TxRate TxRate-96512k 1770 VALUE KarlNet-TurboCell-TxRate TxRate-96640k 1771 VALUE KarlNet-TurboCell-TxRate TxRate-96768k 1772 VALUE KarlNet-TurboCell-TxRate TxRate-96896k 1773 VALUE KarlNet-TurboCell-TxRate TxRate-97024k 1774 VALUE KarlNet-TurboCell-TxRate TxRate-97152k 1775 VALUE KarlNet-TurboCell-TxRate TxRate-97280k 1776 VALUE KarlNet-TurboCell-TxRate TxRate-97408k 1777 VALUE KarlNet-TurboCell-TxRate TxRate-97536k 1778 VALUE KarlNet-TurboCell-TxRate TxRate-97664k 1779 VALUE KarlNet-TurboCell-TxRate TxRate-97792k 1780 VALUE KarlNet-TurboCell-TxRate TxRate-97920k 1781 VALUE KarlNet-TurboCell-TxRate TxRate-98048k 1782 VALUE KarlNet-TurboCell-TxRate TxRate-98176k 1783 VALUE KarlNet-TurboCell-TxRate TxRate-98304k 1784 VALUE KarlNet-TurboCell-TxRate TxRate-98432k 1785 VALUE KarlNet-TurboCell-TxRate TxRate-98560k 1786 VALUE KarlNet-TurboCell-TxRate TxRate-98688k 1787 VALUE KarlNet-TurboCell-TxRate TxRate-98816k 1788 VALUE KarlNet-TurboCell-TxRate TxRate-98944k 1789 VALUE KarlNet-TurboCell-TxRate TxRate-99072k 1790 VALUE KarlNet-TurboCell-TxRate TxRate-99200k 1791 VALUE KarlNet-TurboCell-TxRate TxRate-99328k 1792 VALUE KarlNet-TurboCell-TxRate TxRate-99456k 1793 VALUE KarlNet-TurboCell-TxRate TxRate-99584k 1794 VALUE KarlNet-TurboCell-TxRate TxRate-99712k 1795 VALUE KarlNet-TurboCell-TxRate TxRate-99840k 1796 VALUE KarlNet-TurboCell-TxRate TxRate-99968k 1797 VALUE KarlNet-TurboCell-TxRate TxRate-100096k 1798 VALUE KarlNet-TurboCell-TxRate TxRate-100224k 1799 VALUE KarlNet-TurboCell-TxRate TxRate-100352k 1800 VALUE KarlNet-TurboCell-TxRate TxRate-100480k 1801 VALUE KarlNet-TurboCell-TxRate TxRate-100608k 1802 VALUE KarlNet-TurboCell-TxRate TxRate-100736k 1803 VALUE KarlNet-TurboCell-TxRate TxRate-100864k 1804 VALUE KarlNet-TurboCell-TxRate TxRate-100992k 1805 VALUE KarlNet-TurboCell-TxRate TxRate-101120k 1806 VALUE KarlNet-TurboCell-TxRate TxRate-101248k 1807 VALUE KarlNet-TurboCell-TxRate TxRate-101376k 1808 VALUE KarlNet-TurboCell-TxRate TxRate-101504k 1809 VALUE KarlNet-TurboCell-TxRate TxRate-101632k 1810 VALUE KarlNet-TurboCell-TxRate TxRate-101760k 1811 VALUE KarlNet-TurboCell-TxRate TxRate-101888k 1812 VALUE KarlNet-TurboCell-TxRate TxRate-102016k 1813 VALUE KarlNet-TurboCell-TxRate TxRate-102144k 1814 VALUE KarlNet-TurboCell-TxRate TxRate-102272k 1815 VALUE KarlNet-TurboCell-TxRate TxRate-102400k 1816 VALUE KarlNet-TurboCell-TxRate TxRate-102528k 1817 VALUE KarlNet-TurboCell-TxRate TxRate-102656k 1818 VALUE KarlNet-TurboCell-TxRate TxRate-102784k 1819 VALUE KarlNet-TurboCell-TxRate TxRate-102912k 1820 VALUE KarlNet-TurboCell-TxRate TxRate-103040k 1821 VALUE KarlNet-TurboCell-TxRate TxRate-103168k 1822 VALUE KarlNet-TurboCell-TxRate TxRate-103296k 1823 VALUE KarlNet-TurboCell-TxRate TxRate-103424k 1824 VALUE KarlNet-TurboCell-TxRate TxRate-103552k 1825 VALUE KarlNet-TurboCell-TxRate TxRate-103680k 1826 VALUE KarlNet-TurboCell-TxRate TxRate-103808k 1827 VALUE KarlNet-TurboCell-TxRate TxRate-103936k 1828 VALUE KarlNet-TurboCell-TxRate TxRate-104064k 1829 VALUE KarlNet-TurboCell-TxRate TxRate-104192k 1830 VALUE KarlNet-TurboCell-TxRate TxRate-104320k 1831 VALUE KarlNet-TurboCell-TxRate TxRate-104448k 1832 VALUE KarlNet-TurboCell-TxRate TxRate-104576k 1833 VALUE KarlNet-TurboCell-TxRate TxRate-104704k 1834 VALUE KarlNet-TurboCell-TxRate TxRate-104832k 1835 VALUE KarlNet-TurboCell-TxRate TxRate-104960k 1836 VALUE KarlNet-TurboCell-TxRate TxRate-105088k 1837 VALUE KarlNet-TurboCell-TxRate TxRate-105216k 1838 VALUE KarlNet-TurboCell-TxRate TxRate-105344k 1839 VALUE KarlNet-TurboCell-TxRate TxRate-105472k 1840 VALUE KarlNet-TurboCell-TxRate TxRate-105600k 1841 VALUE KarlNet-TurboCell-TxRate TxRate-105728k 1842 VALUE KarlNet-TurboCell-TxRate TxRate-105856k 1843 VALUE KarlNet-TurboCell-TxRate TxRate-105984k 1844 VALUE KarlNet-TurboCell-TxRate TxRate-106112k 1845 VALUE KarlNet-TurboCell-TxRate TxRate-106240k 1846 VALUE KarlNet-TurboCell-TxRate TxRate-106368k 1847 VALUE KarlNet-TurboCell-TxRate TxRate-106496k 1848 VALUE KarlNet-TurboCell-TxRate TxRate-106624k 1849 VALUE KarlNet-TurboCell-TxRate TxRate-106752k 1850 VALUE KarlNet-TurboCell-TxRate TxRate-106880k 1851 VALUE KarlNet-TurboCell-TxRate TxRate-107008k 1852 VALUE KarlNet-TurboCell-TxRate TxRate-107136k 1853 VALUE KarlNet-TurboCell-TxRate TxRate-107264k 1854 VALUE KarlNet-TurboCell-TxRate TxRate-107392k 1855 VALUE KarlNet-TurboCell-TxRate TxRate-107520k 1856 VALUE KarlNet-TurboCell-TxRate TxRate-107648k 1857 VALUE KarlNet-TurboCell-TxRate TxRate-107776k 1858 VALUE KarlNet-TurboCell-TxRate TxRate-107904k 1859 VALUE KarlNet-TurboCell-TxRate TxRate-108032k 1860 VALUE KarlNet-TurboCell-TxRate TxRate-108160k 1861 VALUE KarlNet-TurboCell-TxRate TxRate-108288k 1862 VALUE KarlNet-TurboCell-TxRate TxRate-108416k 1863 VALUE KarlNet-TurboCell-TxRate TxRate-108544k 1864 VALUE KarlNet-TurboCell-TxRate TxRate-108672k 1865 VALUE KarlNet-TurboCell-TxRate TxRate-108800k 1866 VALUE KarlNet-TurboCell-TxRate TxRate-108928k 1867 VALUE KarlNet-TurboCell-TxRate TxRate-109056k 1868 VALUE KarlNet-TurboCell-TxRate TxRate-109184k 1869 VALUE KarlNet-TurboCell-TxRate TxRate-109312k 1870 VALUE KarlNet-TurboCell-TxRate TxRate-109440k 1871 VALUE KarlNet-TurboCell-TxRate TxRate-109568k 1872 VALUE KarlNet-TurboCell-TxRate TxRate-109696k 1873 VALUE KarlNet-TurboCell-TxRate TxRate-109824k 1874 VALUE KarlNet-TurboCell-TxRate TxRate-109952k 1875 VALUE KarlNet-TurboCell-TxRate TxRate-110080k 1876 VALUE KarlNet-TurboCell-TxRate TxRate-110208k 1877 VALUE KarlNet-TurboCell-TxRate TxRate-110336k 1878 VALUE KarlNet-TurboCell-TxRate TxRate-110464k 1879 VALUE KarlNet-TurboCell-TxRate TxRate-110592k 1880 VALUE KarlNet-TurboCell-TxRate TxRate-110720k 1881 VALUE KarlNet-TurboCell-TxRate TxRate-110848k 1882 VALUE KarlNet-TurboCell-TxRate TxRate-110976k 1883 VALUE KarlNet-TurboCell-TxRate TxRate-111104k 1884 VALUE KarlNet-TurboCell-TxRate TxRate-111232k 1885 VALUE KarlNet-TurboCell-TxRate TxRate-111360k 1886 VALUE KarlNet-TurboCell-TxRate TxRate-111488k 1887 VALUE KarlNet-TurboCell-TxRate TxRate-111616k 1888 VALUE KarlNet-TurboCell-TxRate TxRate-111744k 1889 VALUE KarlNet-TurboCell-TxRate TxRate-111872k 1890 VALUE KarlNet-TurboCell-TxRate TxRate-112000k 1891 VALUE KarlNet-TurboCell-TxRate TxRate-112128k 1892 VALUE KarlNet-TurboCell-TxRate TxRate-112256k 1893 VALUE KarlNet-TurboCell-TxRate TxRate-112384k 1894 VALUE KarlNet-TurboCell-TxRate TxRate-112512k 1895 VALUE KarlNet-TurboCell-TxRate TxRate-112640k 1896 VALUE KarlNet-TurboCell-TxRate TxRate-112768k 1897 VALUE KarlNet-TurboCell-TxRate TxRate-112896k 1898 VALUE KarlNet-TurboCell-TxRate TxRate-113024k 1899 VALUE KarlNet-TurboCell-TxRate TxRate-113152k 1900 VALUE KarlNet-TurboCell-TxRate TxRate-113280k 1901 VALUE KarlNet-TurboCell-TxRate TxRate-113408k 1902 VALUE KarlNet-TurboCell-TxRate TxRate-113536k 1903 VALUE KarlNet-TurboCell-TxRate TxRate-113664k 1904 VALUE KarlNet-TurboCell-TxRate TxRate-113792k 1905 VALUE KarlNet-TurboCell-TxRate TxRate-113920k 1906 VALUE KarlNet-TurboCell-TxRate TxRate-114048k 1907 VALUE KarlNet-TurboCell-TxRate TxRate-114176k 1908 VALUE KarlNet-TurboCell-TxRate TxRate-114304k 1909 VALUE KarlNet-TurboCell-TxRate TxRate-114432k 1910 VALUE KarlNet-TurboCell-TxRate TxRate-114560k 1911 VALUE KarlNet-TurboCell-TxRate TxRate-114688k 1912 VALUE KarlNet-TurboCell-TxRate TxRate-114816k 1913 VALUE KarlNet-TurboCell-TxRate TxRate-114944k 1914 VALUE KarlNet-TurboCell-TxRate TxRate-115072k 1915 VALUE KarlNet-TurboCell-TxRate TxRate-115200k 1916 VALUE KarlNet-TurboCell-TxRate TxRate-115328k 1917 VALUE KarlNet-TurboCell-TxRate TxRate-115456k 1918 VALUE KarlNet-TurboCell-TxRate TxRate-115584k 1919 VALUE KarlNet-TurboCell-TxRate TxRate-115712k 1920 VALUE KarlNet-TurboCell-TxRate TxRate-115840k 1921 VALUE KarlNet-TurboCell-TxRate TxRate-115968k 1922 VALUE KarlNet-TurboCell-TxRate TxRate-116096k 1923 VALUE KarlNet-TurboCell-TxRate TxRate-116224k 1924 VALUE KarlNet-TurboCell-TxRate TxRate-116352k 1925 VALUE KarlNet-TurboCell-TxRate TxRate-116480k 1926 VALUE KarlNet-TurboCell-TxRate TxRate-116608k 1927 VALUE KarlNet-TurboCell-TxRate TxRate-116736k 1928 VALUE KarlNet-TurboCell-TxRate TxRate-116864k 1929 VALUE KarlNet-TurboCell-TxRate TxRate-116992k 1930 VALUE KarlNet-TurboCell-TxRate TxRate-117120k 1931 VALUE KarlNet-TurboCell-TxRate TxRate-117248k 1932 VALUE KarlNet-TurboCell-TxRate TxRate-117376k 1933 VALUE KarlNet-TurboCell-TxRate TxRate-117504k 1934 VALUE KarlNet-TurboCell-TxRate TxRate-117632k 1935 VALUE KarlNet-TurboCell-TxRate TxRate-117760k 1936 VALUE KarlNet-TurboCell-TxRate TxRate-117888k 1937 VALUE KarlNet-TurboCell-TxRate TxRate-118016k 1938 VALUE KarlNet-TurboCell-TxRate TxRate-118144k 1939 VALUE KarlNet-TurboCell-TxRate TxRate-118272k 1940 VALUE KarlNet-TurboCell-TxRate TxRate-118400k 1941 VALUE KarlNet-TurboCell-TxRate TxRate-118528k 1942 VALUE KarlNet-TurboCell-TxRate TxRate-118656k 1943 VALUE KarlNet-TurboCell-TxRate TxRate-118784k 1944 VALUE KarlNet-TurboCell-TxRate TxRate-118912k 1945 VALUE KarlNet-TurboCell-TxRate TxRate-119040k 1946 VALUE KarlNet-TurboCell-TxRate TxRate-119168k 1947 VALUE KarlNet-TurboCell-TxRate TxRate-119296k 1948 VALUE KarlNet-TurboCell-TxRate TxRate-119424k 1949 VALUE KarlNet-TurboCell-TxRate TxRate-119552k 1950 VALUE KarlNet-TurboCell-TxRate TxRate-119680k 1951 VALUE KarlNet-TurboCell-TxRate TxRate-119808k 1952 VALUE KarlNet-TurboCell-TxRate TxRate-119936k 1953 VALUE KarlNet-TurboCell-TxRate TxRate-120064k 1954 VALUE KarlNet-TurboCell-TxRate TxRate-120192k 1955 VALUE KarlNet-TurboCell-TxRate TxRate-120320k 1956 VALUE KarlNet-TurboCell-TxRate TxRate-120448k 1957 VALUE KarlNet-TurboCell-TxRate TxRate-120576k 1958 VALUE KarlNet-TurboCell-TxRate TxRate-120704k 1959 VALUE KarlNet-TurboCell-TxRate TxRate-120832k 1960 VALUE KarlNet-TurboCell-TxRate TxRate-120960k 1961 VALUE KarlNet-TurboCell-TxRate TxRate-121088k 1962 VALUE KarlNet-TurboCell-TxRate TxRate-121216k 1963 VALUE KarlNet-TurboCell-TxRate TxRate-121344k 1964 VALUE KarlNet-TurboCell-TxRate TxRate-121472k 1965 VALUE KarlNet-TurboCell-TxRate TxRate-121600k 1966 VALUE KarlNet-TurboCell-TxRate TxRate-121728k 1967 VALUE KarlNet-TurboCell-TxRate TxRate-121856k 1968 VALUE KarlNet-TurboCell-TxRate TxRate-121984k 1969 VALUE KarlNet-TurboCell-TxRate TxRate-122112k 1970 VALUE KarlNet-TurboCell-TxRate TxRate-122240k 1971 VALUE KarlNet-TurboCell-TxRate TxRate-122368k 1972 VALUE KarlNet-TurboCell-TxRate TxRate-122496k 1973 VALUE KarlNet-TurboCell-TxRate TxRate-122624k 1974 VALUE KarlNet-TurboCell-TxRate TxRate-122752k 1975 VALUE KarlNet-TurboCell-TxRate TxRate-122880k 1976 VALUE KarlNet-TurboCell-TxRate TxRate-123008k 1977 VALUE KarlNet-TurboCell-TxRate TxRate-123136k 1978 VALUE KarlNet-TurboCell-TxRate TxRate-123264k 1979 VALUE KarlNet-TurboCell-TxRate TxRate-123392k 1980 VALUE KarlNet-TurboCell-TxRate TxRate-123520k 1981 VALUE KarlNet-TurboCell-TxRate TxRate-123648k 1982 VALUE KarlNet-TurboCell-TxRate TxRate-123776k 1983 VALUE KarlNet-TurboCell-TxRate TxRate-123904k 1984 VALUE KarlNet-TurboCell-TxRate TxRate-124032k 1985 VALUE KarlNet-TurboCell-TxRate TxRate-124160k 1986 VALUE KarlNet-TurboCell-TxRate TxRate-124288k 1987 VALUE KarlNet-TurboCell-TxRate TxRate-124416k 1988 VALUE KarlNet-TurboCell-TxRate TxRate-124544k 1989 VALUE KarlNet-TurboCell-TxRate TxRate-124672k 1990 VALUE KarlNet-TurboCell-TxRate TxRate-124800k 1991 VALUE KarlNet-TurboCell-TxRate TxRate-124928k 1992 VALUE KarlNet-TurboCell-TxRate TxRate-125056k 1993 VALUE KarlNet-TurboCell-TxRate TxRate-125184k 1994 VALUE KarlNet-TurboCell-TxRate TxRate-125312k 1995 VALUE KarlNet-TurboCell-TxRate TxRate-125440k 1996 VALUE KarlNet-TurboCell-TxRate TxRate-125568k 1997 VALUE KarlNet-TurboCell-TxRate TxRate-125696k 1998 VALUE KarlNet-TurboCell-TxRate TxRate-125824k 1999 VALUE KarlNet-TurboCell-TxRate TxRate-125952k 2000 VALUE KarlNet-TurboCell-TxRate TxRate-126080k 2001 VALUE KarlNet-TurboCell-TxRate TxRate-126208k 2002 VALUE KarlNet-TurboCell-TxRate TxRate-126336k 2003 VALUE KarlNet-TurboCell-TxRate TxRate-126464k 2004 VALUE KarlNet-TurboCell-TxRate TxRate-126592k 2005 VALUE KarlNet-TurboCell-TxRate TxRate-126720k 2006 VALUE KarlNet-TurboCell-TxRate TxRate-126848k 2007 VALUE KarlNet-TurboCell-TxRate TxRate-126976k 2008 VALUE KarlNet-TurboCell-TxRate TxRate-127104k 2009 VALUE KarlNet-TurboCell-TxRate TxRate-127232k 2010 VALUE KarlNet-TurboCell-TxRate TxRate-127360k 2011 VALUE KarlNet-TurboCell-TxRate TxRate-127488k 2012 VALUE KarlNet-TurboCell-TxRate TxRate-127616k 2013 VALUE KarlNet-TurboCell-TxRate TxRate-127744k 2014 VALUE KarlNet-TurboCell-TxRate TxRate-127872k 2015 VALUE KarlNet-TurboCell-TxRate TxRate-128000k 2016 VALUE KarlNet-TurboCell-TxRate TxRate-128128k 2017 VALUE KarlNet-TurboCell-TxRate TxRate-128256k 2018 VALUE KarlNet-TurboCell-TxRate TxRate-128384k 2019 VALUE KarlNet-TurboCell-TxRate TxRate-128512k 2020 VALUE KarlNet-TurboCell-TxRate TxRate-128640k 2021 VALUE KarlNet-TurboCell-TxRate TxRate-128768k 2022 VALUE KarlNet-TurboCell-TxRate TxRate-128896k 2023 VALUE KarlNet-TurboCell-TxRate TxRate-129024k 2024 VALUE KarlNet-TurboCell-TxRate TxRate-129152k 2025 VALUE KarlNet-TurboCell-TxRate TxRate-129280k 2026 VALUE KarlNet-TurboCell-TxRate TxRate-129408k 2027 VALUE KarlNet-TurboCell-TxRate TxRate-129536k 2028 VALUE KarlNet-TurboCell-TxRate TxRate-129664k 2029 VALUE KarlNet-TurboCell-TxRate TxRate-129792k 2030 VALUE KarlNet-TurboCell-TxRate TxRate-129920k 2031 VALUE KarlNet-TurboCell-TxRate TxRate-130048k 2032 VALUE KarlNet-TurboCell-TxRate TxRate-130176k 2033 VALUE KarlNet-TurboCell-TxRate TxRate-130304k 2034 VALUE KarlNet-TurboCell-TxRate TxRate-130432k 2035 VALUE KarlNet-TurboCell-TxRate TxRate-130560k 2036 VALUE KarlNet-TurboCell-TxRate TxRate-130688k 2037 VALUE KarlNet-TurboCell-TxRate TxRate-130816k 2038 VALUE KarlNet-TurboCell-TxRate TxRate-130944k 2039 VALUE KarlNet-TurboCell-TxRate TxRate-131072k 2040 VALUE KarlNet-TurboCell-TxRate TxRate-131200k 2041 VALUE KarlNet-TurboCell-TxRate TxRate-131328k 2042 VALUE KarlNet-TurboCell-TxRate TxRate-131456k 2043 VALUE KarlNet-TurboCell-TxRate TxRate-131584k 2044 VALUE KarlNet-TurboCell-TxRate TxRate-131712k 2045 VALUE KarlNet-TurboCell-TxRate TxRate-131840k 2046 VALUE KarlNet-TurboCell-TxRate TxRate-131968k 2047 # Sets the remote client's Operating State ATTRIBUTE KarlNet-TurboCell-OpState 153 integer VALUE KarlNet-TurboCell-OpState Up 0 VALUE KarlNet-TurboCell-OpState Down 1 # Sets the remote client's Operating Mode ATTRIBUTE KarlNet-TurboCell-OpMode 154 integer VALUE KarlNet-TurboCell-OpMode Peer-to-Peer 0 VALUE KarlNet-TurboCell-OpMode Base 1 VALUE KarlNet-TurboCell-OpMode Base-Polling 2 VALUE KarlNet-TurboCell-OpMode Satellite-NT 3 # ---------------------------------------------- # END OF KarlNet Vendor-specific information # ---------------------------------------------- END-VENDOR KarlNet freeradius-server/share/dictionary.kineto000066400000000000000000000107711257552170400212130ustar00rootroot00000000000000# Kineto Wireless Dictionary # dictionary.kineto # # Copyright (C) 2011 The FreeRADIUS Server project and contributors # # Version $Id$ # # As posted to the list by Swaran Sethi # # For documentation on Kineto Wireless RADIUS attributes, see: # http://www.kinetowireless.com/ # VENDOR Kineto 16445 format=2,1 BEGIN-VENDOR Kineto # Kineto Vendor Specific Attributes Based on UMA Information Elements # # For documentation on UMA Information Elements, see: # http://www.umatechnology.org/specifications/index.htm # Unlicensed Mobile Access (UMA) Protocols (Stage 3), Release 1.0.4, # May 2005 # ATTRIBUTE Kineto-UMA-Release-Indicator 2 octets ATTRIBUTE Kineto-UMA-AP-Radio-Identity 3 octets ATTRIBUTE Kineto-UMA-Cell-Identity 4 octets ATTRIBUTE Kineto-UMA-Location-Area-Identification 5 octets ATTRIBUTE Kineto-UMA-Coverage-Indicator 6 octets ATTRIBUTE Kineto-UMA-Classmark 7 octets ATTRIBUTE Kineto-UMA-Geographical-Location 8 octets ATTRIBUTE Kineto-UMA-SGW-IP-Address 9 octets ATTRIBUTE Kineto-UMA-SGW-FQDN 10 octets ATTRIBUTE Kineto-UMA-Redirection-Counter 11 octets ATTRIBUTE Kineto-UMA-Discovery-Reject-Cause 12 octets ATTRIBUTE Kineto-UMA-RRC-State 17 octets ATTRIBUTE Kineto-UMA-Register-Reject-Cause 21 octets ATTRIBUTE Kineto-UMA-Routing-Area-Code 41 octets ATTRIBUTE Kineto-UMA-AP-Location 42 octets ATTRIBUTE Kineto-UMA-Location-Status 44 octets ATTRIBUTE Kineto-UMA-Utran-Cell-Identity 49 octets ATTRIBUTE Kineto-UMA-Location-Blacklist-Indicator 58 octets ATTRIBUTE Kineto-UMA-AP-Service-Name 61 octets ATTRIBUTE Kineto-UMA-Service-Zone-Information 62 octets ATTRIBUTE Kineto-UMA-Serving-UNC-Table-Indicator 67 octets ATTRIBUTE Kineto-UMA-Registration-Indicators 68 octets ATTRIBUTE Kineto-UMA-UMA-PLMN-List 69 octets ATTRIBUTE Kineto-UMA-Required-UMA-Services 71 octets ATTRIBUTE Kineto-UMA-3G-Cell-Identity 73 octets ATTRIBUTE Kineto-UMA-MS-Radio-Identity 96 octets ATTRIBUTE Kineto-UMA-UNC-IP-Address 97 octets ATTRIBUTE Kineto-UMA-UNC-FQDN 98 octets # Kineto Vendor Specific Attributes # ATTRIBUTE Kineto-URR-Transaction-Type 0xff01 octets ATTRIBUTE Kineto-Location-Key 0xff02 octets ATTRIBUTE Kineto-UP-Client-Remote-Address 0xff03 octets ATTRIBUTE Kineto-Hand-In-Control-Flag 0xff04 octets ATTRIBUTE Kineto-Hand-Out-Control-Flag 0xff05 octets ATTRIBUTE Kineto-Billing-Rate-Indicator 0xff06 octets ATTRIBUTE Kineto-Service-Area-Code 0xff09 octets ATTRIBUTE KW-IUH-MESSAGE-TYPE 65408 string ATTRIBUTE KW-HNB-REMOTE-ADDRESS 65409 ipaddr ATTRIBUTE KW-HNB-IDENTITY 65410 string ATTRIBUTE KW-HNB-LOC-INFO-MACRO-COVERAGE-IND 65411 integer ATTRIBUTE KW-HNB-LOC-INFO-GERAN-CELL-ID 65412 string ATTRIBUTE KW-HNB-LOC-INFO-UTRAN-CELL-ID 65413 string ATTRIBUTE KW-HNB-LOC-INFO-GEO-COORDINATES 65414 integer ATTRIBUTE KW-HNB-LOC-INFO-ALTITUDE-Direction 65415 integer ATTRIBUTE KW-HNB-LOC-INFO-IP-ADDRESS 65416 string ATTRIBUTE KW-HNB-PLMN-ID 65417 string ATTRIBUTE KW-HNB-CELL-ID 65418 string ATTRIBUTE KW-HNB-LAC 65419 string ATTRIBUTE KW-HNB-RAC 65420 string ATTRIBUTE KW-HNB-SAC 65421 string ATTRIBUTE KW-HNB-CSG-ID 65422 string ATTRIBUTE KW-UE-Capabilities 65423 integer ATTRIBUTE KW-HNB-LOCATION-AREA-IND 0xff90 octets ATTRIBUTE KW-IUH-BILLING-RATE-INDICATOR 0xff91 octets ATTRIBUTE KW-REGISTRATION-REJECT-CAUSE 0xff92 octets ATTRIBUTE KW-HNB-LOCATION-BLACKLIST-IND 0xff93 octets # (please refer Iuh-AAA-KS1 Rel 2.0.doc ) ATTRIBUTE KW-HNB-CELL-ACCESS-MODE 0xff94 octets ATTRIBUTE KW-UE-MEMBERSHIP-STATUS 0xff95 octets # (please refer Iuh-AAA-S1.doc, 0xff93 are defined Blacklist & Reg-reject # in Iuh. by kbnao #ATTRIBUTE KW-HNB-REGISTER-REJECT-CAUSE 0xff94 octets #ATTRIBUTE KW-HNB-LOC-INFO-MACRO-COVERAGE-IND VALUE KW-HNB-LOC-INFO-MACRO-COVERAGE-IND GERAN 0 VALUE KW-HNB-LOC-INFO-MACRO-COVERAGE-IND UTRAN 1 VALUE KW-HNB-LOC-INFO-MACRO-COVERAGE-IND NONE 2 #ATTRIBUTE KW-HNB-LOC-INFO-GEO-COORDINATES VALUE KW-HNB-LOC-INFO-GEO-COORDINATES North 0 VALUE KW-HNB-LOC-INFO-GEO-COORDINATES South 1 #ATTRIBUTE KW-HNB-LOC-INFO-ALTITUDE-Direction VALUE KW-HNB-LOC-INFO-ALTITUDE-Direction Height 0 VALUE KW-HNB-LOC-INFO-ALTITUDE-Direction Depth 1 #ATTRIBUTE KW-UE-Capabilities VALUE KW-UE-Capabilities R99 0 VALUE KW-UE-Capabilities Rel-4 1 VALUE KW-UE-Capabilities Rel-5 2 VALUE KW-UE-Capabilities Rel-6 3 VALUE KW-UE-Capabilities Rel-7 4 VALUE KW-UE-Capabilities Rel-8 5 VALUE KW-UE-Capabilities CSG-Capable 0 VALUE KW-UE-Capabilities Not-CSG-Capable 1 END-VENDOR Kineto freeradius-server/share/dictionary.lancom000066400000000000000000000011611257552170400211640ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2011 The FreeRADIUS Server project and contributors # # dictionary.lcs # # originally by # "Eugen K. " <> # VENDOR Lancom 2356 BEGIN-VENDOR Lancom # Attributes ATTRIBUTE LCS-Traffic-Limit 1 integer ATTRIBUTE LCS-Mac-Address 2 string ATTRIBUTE LCS-Redirection-URL 3 string ATTRIBUTE LCS-Comment 4 string ATTRIBUTE LCS-Account-End 5 integer ATTRIBUTE LCS-WPA-Passphrase 6 string ATTRIBUTE LCS-PbSpotUserName 7 string ATTRIBUTE LCS-TxRateLimit 8 integer ATTRIBUTE LCS-RxRateLimit 9 integer END-VENDOR Lancom freeradius-server/share/dictionary.livingston000066400000000000000000000042621257552170400221140ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2011 The FreeRADIUS Server project and contributors # # Vendor-Specific attributes use the SMI Network Management Private # Enterprise Code from the "Assigned Numbers" RFC # VENDOR Livingston 307 # # Livingston Vendor-Specific Attributes (requires ComOS 3.8) # BEGIN-VENDOR Livingston ATTRIBUTE LE-Terminate-Detail 2 string ATTRIBUTE LE-Advice-of-Charge 3 string ATTRIBUTE LE-Connect-Detail 4 string ATTRIBUTE LE-IP-Pool 6 string ATTRIBUTE LE-IP-Gateway 7 ipaddr ATTRIBUTE LE-Modem-Info 8 string ATTRIBUTE LE-IPSec-Log-Options 9 integer ATTRIBUTE LE-IPSec-Deny-Action 10 integer ATTRIBUTE LE-IPSec-Active-Profile 11 string ATTRIBUTE LE-IPSec-Outsource-Profile 12 string ATTRIBUTE LE-IPSec-Passive-Profile 13 string ATTRIBUTE LE-NAT-TCP-Session-Timeout 14 integer ATTRIBUTE LE-NAT-Other-Session-Timeout 15 integer ATTRIBUTE LE-NAT-Log-Options 16 integer ATTRIBUTE LE-NAT-Sess-Dir-Fail-Action 17 integer ATTRIBUTE LE-NAT-Inmap 18 string ATTRIBUTE LE-NAT-Outmap 19 string ATTRIBUTE LE-NAT-Outsource-Inmap 20 string ATTRIBUTE LE-NAT-Outsource-Outmap 21 string ATTRIBUTE LE-Admin-Group 22 string ATTRIBUTE LE-Multicast-Client 23 integer VALUE LE-IPSec-Deny-Action Drop 1 VALUE LE-IPSec-Deny-Action ICMP-Reject 2 VALUE LE-IPSec-Deny-Action Pass-Through 3 VALUE LE-IPSec-Log-Options SA-Success-On 1 VALUE LE-IPSec-Log-Options SA-Failure-On 2 VALUE LE-IPSec-Log-Options Console-On 3 VALUE LE-IPSec-Log-Options Syslog-On 4 VALUE LE-IPSec-Log-Options SA-Success-Off 5 VALUE LE-IPSec-Log-Options SA-Failure-Off 6 VALUE LE-IPSec-Log-Options Console-Off 7 VALUE LE-IPSec-Log-Options Syslog-Off 8 VALUE LE-NAT-Sess-Dir-Fail-Action Drop 1 VALUE LE-NAT-Sess-Dir-Fail-Action ICMP-Reject 2 VALUE LE-NAT-Sess-Dir-Fail-Action Pass-Through 3 VALUE LE-NAT-Log-Options Session-Success-On 1 VALUE LE-NAT-Log-Options Session-Failure-On 2 VALUE LE-NAT-Log-Options Console-On 3 VALUE LE-NAT-Log-Options Syslog-On 4 VALUE LE-NAT-Log-Options Success-Off 5 VALUE LE-NAT-Log-Options Failure-Off 6 VALUE LE-NAT-Log-Options Console-Off 7 VALUE LE-NAT-Log-Options Syslog-Off 8 VALUE LE-Multicast-Client On 1 END-VENDOR Livingston freeradius-server/share/dictionary.localweb000066400000000000000000000021051257552170400215020ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2011 The FreeRADIUS Server project and contributors ############################################################################## # # Local-Web Accesspoints # ############################################################################## VENDOR Local-Web 19220 BEGIN-VENDOR Local-Web ATTRIBUTE Local-Web-Client-Ip 192 string ATTRIBUTE Local-Web-Border-Router 193 string ATTRIBUTE Local-Web-Tx-Limit 200 integer ATTRIBUTE Local-Web-Rx-Limit 201 integer ATTRIBUTE Local-Web-Acct-Time 210 integer ATTRIBUTE Local-Web-Acct-Duration 211 integer ATTRIBUTE Local-Web-Acct-Interim-Tx-Bytes 212 integer ATTRIBUTE Local-Web-Acct-Interim-Rx-Bytes 213 integer ATTRIBUTE Local-Web-Acct-Interim-Tx-Gigawords 214 integer ATTRIBUTE Local-Web-Acct-Interim-Rx-Gigawords 215 integer ATTRIBUTE Local-Web-Acct-Interim-Tx-Mgmt 216 integer ATTRIBUTE Local-Web-Acct-Interim-Rx-Mgmt 217 integer ATTRIBUTE Local-Web-Acct-Tx-Mgmt 230 integer ATTRIBUTE Local-Web-Acct-Rx-Mgmt 231 integer ATTRIBUTE Local-Web-Reauth-Counter 240 integer END-VENDOR Local-Web freeradius-server/share/dictionary.lucent000066400000000000000000000512061257552170400212120ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2011 The FreeRADIUS Server project and contributors ############################################################################## # # Lucent VSAs, in their own "magic" 16-bit format. # # $Id$ # ############################################################################## VENDOR Lucent 4846 format=2,1 BEGIN-VENDOR Lucent ATTRIBUTE Lucent-Max-Shared-Users 2 integer ATTRIBUTE Lucent-IP-DSCP 3 integer ATTRIBUTE Lucent-X25-X121-Source-Address 4 string ATTRIBUTE Lucent-PPP-Circuit 5 integer ATTRIBUTE Lucent-PPP-Circuit-Name 6 string ATTRIBUTE Lucent-UU-Info 7 string ATTRIBUTE Lucent-User-Priority 8 integer ATTRIBUTE Lucent-CIR-Timer 9 integer ATTRIBUTE Lucent-FR-08-Mode 10 integer ATTRIBUTE Lucent-Destination-NAS-Port 11 integer ATTRIBUTE Lucent-FR-SVC-Addr 12 string ATTRIBUTE Lucent-NAS-Port-Format 13 integer ATTRIBUTE Lucent-ATM-Fault-Management 14 integer ATTRIBUTE Lucent-ATM-Loopback-Cell-Loss 15 integer ATTRIBUTE Lucent-Ckt-Type 16 integer ATTRIBUTE Lucent-SVC-Enabled 17 integer ATTRIBUTE Lucent-Session-Type 18 integer ATTRIBUTE Lucent-H323-Gatekeeper 19 ipaddr ATTRIBUTE Lucent-Global-Call-Id 20 string ATTRIBUTE Lucent-H323-Conference-Id 21 integer ATTRIBUTE Lucent-H323-Destination-NAS-ID 22 ipaddr ATTRIBUTE Lucent-H323-Dialed-Time 23 integer ATTRIBUTE Lucent-Dialed-Number 24 string ATTRIBUTE Lucent-Inter-Arrival-Jitter 25 integer ATTRIBUTE Lucent-Dropped-Octets 26 integer ATTRIBUTE Lucent-Dropped-Packets 27 integer ATTRIBUTE Lucent-Auth-Delay 28 integer ATTRIBUTE Lucent-X25-Pad-X3-Profile 29 integer ATTRIBUTE Lucent-X25-Pad-X3-Parameters 30 string ATTRIBUTE Lucent-Tunnel-VRouter-Name 31 string ATTRIBUTE Lucent-X25-Reverse-Charging 32 integer ATTRIBUTE Lucent-X25-Nui-Prompt 33 string ATTRIBUTE Lucent-X25-Nui-Password-Prompt 34 string ATTRIBUTE Lucent-X25-Cug 35 string ATTRIBUTE Lucent-X25-Pad-Alias-1 36 string ATTRIBUTE Lucent-X25-Pad-Alias-2 37 string ATTRIBUTE Lucent-X25-Pad-Alias-3 38 string ATTRIBUTE Lucent-X25-X121-Address 39 string ATTRIBUTE Lucent-X25-Nui 40 string ATTRIBUTE Lucent-X25-Rpoa 41 string ATTRIBUTE Lucent-X25-Pad-Prompt 42 string ATTRIBUTE Lucent-X25-Pad-Banner 43 string ATTRIBUTE Lucent-X25-Profile-Name 44 string ATTRIBUTE Lucent-Recv-Name 45 string ATTRIBUTE Lucent-Bi-Directional-Auth 46 integer ATTRIBUTE Lucent-MTU 47 integer ATTRIBUTE Lucent-Call-Direction 48 integer ATTRIBUTE Lucent-Service-Type 49 integer ATTRIBUTE Lucent-Filter-Required 50 integer ATTRIBUTE Lucent-Traffic-Shaper 51 integer ATTRIBUTE Lucent-Access-Intercept-LEA 52 string ATTRIBUTE Lucent-Access-Intercept-Log 53 string ATTRIBUTE Lucent-Private-Route-Table-ID 54 string ATTRIBUTE Lucent-Private-Route-Required 55 integer ATTRIBUTE Lucent-Cache-Refresh 56 integer ATTRIBUTE Lucent-Cache-Time 57 integer ATTRIBUTE Lucent-Egress-Enabled 58 integer ATTRIBUTE Lucent-QOS-Upstream 59 string ATTRIBUTE Lucent-QOS-Downstream 60 string ATTRIBUTE Lucent-ATM-Connect-Vpi 61 integer ATTRIBUTE Lucent-ATM-Connect-Vci 62 integer ATTRIBUTE Lucent-ATM-Connect-Group 63 integer ATTRIBUTE Lucent-ATM-Group 64 integer ATTRIBUTE Lucent-IPX-Header-Compression 65 integer ATTRIBUTE Lucent-Calling-Id-Type-Of-Number 66 integer ATTRIBUTE Lucent-Calling-Id-Numbering-Plan 67 integer ATTRIBUTE Lucent-Calling-Id-Presentation 68 integer ATTRIBUTE Lucent-Calling-Id-Screening 69 integer ATTRIBUTE Lucent-BIR-Enable 70 integer ATTRIBUTE Lucent-BIR-Proxy 71 integer ATTRIBUTE Lucent-BIR-Bridge-Group 72 integer ATTRIBUTE Lucent-IPSEC-Profile 73 string ATTRIBUTE Lucent-PPPoE-Enable 74 integer ATTRIBUTE Lucent-Bridge-Non-PPPoE 75 integer ATTRIBUTE Lucent-ATM-Direct 76 integer ATTRIBUTE Lucent-ATM-Direct-Profile 77 string ATTRIBUTE Lucent-Client-Primary-WINS 78 ipaddr ATTRIBUTE Lucent-Client-Secondary-WINS 79 ipaddr ATTRIBUTE Lucent-Client-Assign-WINS 80 integer ATTRIBUTE Lucent-Auth-Type 81 integer ATTRIBUTE Lucent-Port-Redir-Protocol 82 integer ATTRIBUTE Lucent-Port-Redir-Portnum 83 integer ATTRIBUTE Lucent-Port-Redir-Server 84 ipaddr ATTRIBUTE Lucent-IP-Pool-Chaining 85 integer ATTRIBUTE Lucent-Owner-IP-Addr 86 ipaddr ATTRIBUTE Lucent-IP-TOS 87 integer ATTRIBUTE Lucent-IP-TOS-Precedence 88 integer ATTRIBUTE Lucent-IP-TOS-Apply-To 89 integer ATTRIBUTE Lucent-Filter 90 string ATTRIBUTE Lucent-Telnet-Profile 91 string ATTRIBUTE Lucent-Dsl-Rate-Type 92 integer ATTRIBUTE Lucent-Redirect-Number 93 string ATTRIBUTE Lucent-ATM-Vpi 94 integer ATTRIBUTE Lucent-ATM-Vci 95 integer ATTRIBUTE Lucent-Source-IP-Check 96 integer ATTRIBUTE Lucent-Dsl-Rate-Mode 97 integer ATTRIBUTE Lucent-Dsl-Upstream-Limit 98 integer ATTRIBUTE Lucent-Dsl-Downstream-Limit 99 integer ATTRIBUTE Lucent-Dsl-CIR-Recv-Limit 100 integer ATTRIBUTE Lucent-Dsl-CIR-Xmit-Limit 101 integer ATTRIBUTE Lucent-VRouter-Name 102 string ATTRIBUTE Lucent-Source-Auth 103 string ATTRIBUTE Lucent-Private-Route 104 string ATTRIBUTE Lucent-Numbering-Plan-ID 105 integer ATTRIBUTE Lucent-FR-Link-Status-DLCI 106 integer ATTRIBUTE Lucent-Calling-Subaddress 107 string ATTRIBUTE Lucent-Callback-Delay 108 integer ATTRIBUTE Lucent-Endpoint-Disc 109 octets ATTRIBUTE Lucent-Remote-FW 110 string ATTRIBUTE Lucent-Multicast-GLeave-Delay 111 integer ATTRIBUTE Lucent-CBCP-Enable 112 integer ATTRIBUTE Lucent-CBCP-Mode 113 integer ATTRIBUTE Lucent-CBCP-Delay 114 integer ATTRIBUTE Lucent-CBCP-Trunk-Group 115 integer ATTRIBUTE Lucent-Appletalk-Route 116 string ATTRIBUTE Lucent-Appletalk-Peer-Mode 117 integer ATTRIBUTE Lucent-Route-Appletalk 118 integer ATTRIBUTE Lucent-FCP-Parameter 119 string ATTRIBUTE Lucent-Modem-PortNo 120 integer ATTRIBUTE Lucent-Modem-SlotNo 121 integer ATTRIBUTE Lucent-Modem-ShelfNo 122 integer ATTRIBUTE Lucent-Call-Attempt-Limit 123 integer ATTRIBUTE Lucent-Call-Block-Duration 124 integer ATTRIBUTE Lucent-Maximum-Call-Duration 125 integer ATTRIBUTE Lucent-Route-Preference 126 integer ATTRIBUTE Lucent-Tunneling-Protocol 127 integer ATTRIBUTE Lucent-Shared-Profile-Enable 128 integer ATTRIBUTE Lucent-Primary-Home-Agent 129 string ATTRIBUTE Lucent-Secondary-Home-Agent 130 string ATTRIBUTE Lucent-Dialout-Allowed 131 integer ATTRIBUTE Lucent-Client-Gateway 132 ipaddr ATTRIBUTE Lucent-BACP-Enable 133 integer ATTRIBUTE Lucent-DHCP-Maximum-Leases 134 integer ATTRIBUTE Lucent-Client-Primary-DNS 135 ipaddr ATTRIBUTE Lucent-Client-Secondary-DNS 136 ipaddr ATTRIBUTE Lucent-Client-Assign-DNS 137 integer ATTRIBUTE Lucent-User-Acct-Type 138 integer ATTRIBUTE Lucent-User-Acct-Host 139 ipaddr ATTRIBUTE Lucent-User-Acct-Port 140 integer ATTRIBUTE Lucent-User-Acct-Key 141 string ATTRIBUTE Lucent-User-Acct-Base 142 integer ATTRIBUTE Lucent-User-Acct-Time 143 integer ATTRIBUTE Lucent-Assign-IP-Client 144 ipaddr ATTRIBUTE Lucent-Assign-IP-Server 145 ipaddr ATTRIBUTE Lucent-Assign-IP-Global-Pool 146 string ATTRIBUTE Lucent-DHCP-Reply 147 integer ATTRIBUTE Lucent-DHCP-Pool-Number 148 integer ATTRIBUTE Lucent-Expect-Callback 149 integer ATTRIBUTE Lucent-Event-Type 150 integer ATTRIBUTE Lucent-Session-Svr-Key 151 string ATTRIBUTE Lucent-Multicast-Rate-Limit 152 integer ATTRIBUTE Lucent-IF-Netmask 153 ipaddr ATTRIBUTE Lucent-Remote-Addr 154 ipaddr ATTRIBUTE Lucent-Multicast-Client 155 integer ATTRIBUTE Lucent-FR-Circuit-Name 156 string ATTRIBUTE Lucent-FR-LinkUp 157 integer ATTRIBUTE Lucent-FR-Nailed-Grp 158 integer ATTRIBUTE Lucent-FR-Type 159 integer ATTRIBUTE Lucent-FR-Link-Mgt 160 integer ATTRIBUTE Lucent-FR-N391 161 integer ATTRIBUTE Lucent-FR-DCE-N392 162 integer ATTRIBUTE Lucent-FR-DTE-N392 163 integer ATTRIBUTE Lucent-FR-DCE-N393 164 integer ATTRIBUTE Lucent-FR-DTE-N393 165 integer ATTRIBUTE Lucent-FR-T391 166 integer ATTRIBUTE Lucent-FR-T392 167 integer ATTRIBUTE Lucent-Bridge-Address 168 string ATTRIBUTE Lucent-TS-Idle-Limit 169 integer ATTRIBUTE Lucent-TS-Idle-Mode 170 integer ATTRIBUTE Lucent-DBA-Monitor 171 integer ATTRIBUTE Lucent-Base-Channel-Count 172 integer ATTRIBUTE Lucent-Minimum-Channels 173 integer ATTRIBUTE Lucent-IPX-Route 174 string ATTRIBUTE Lucent-FT1-Caller 175 integer ATTRIBUTE Lucent-Backup 176 string ATTRIBUTE Lucent-Call-Type 177 integer ATTRIBUTE Lucent-Group 178 string ATTRIBUTE Lucent-FR-DLCI 179 integer ATTRIBUTE Lucent-FR-Profile-Name 180 string ATTRIBUTE Lucent-Ara-PW 181 string ATTRIBUTE Lucent-IPX-Node-Addr 182 string ATTRIBUTE Lucent-Home-Agent-IP-Addr 183 ipaddr ATTRIBUTE Lucent-Home-Agent-Password 184 string ATTRIBUTE Lucent-Home-Network-Name 185 string ATTRIBUTE Lucent-Home-Agent-UDP-Port 186 integer ATTRIBUTE Lucent-Multilink-ID 187 integer ATTRIBUTE Lucent-Num-In-Multilink 188 integer ATTRIBUTE Lucent-First-Dest 189 ipaddr ATTRIBUTE Lucent-Pre-Input-Octets 190 integer ATTRIBUTE Lucent-Pre-Output-Octets 191 integer ATTRIBUTE Lucent-Pre-Input-Packets 192 integer ATTRIBUTE Lucent-Pre-Output-Packets 193 integer ATTRIBUTE Lucent-Maximum-Time 194 integer ATTRIBUTE Lucent-Disconnect-Cause 195 integer ATTRIBUTE Lucent-Connect-Progress 196 integer ATTRIBUTE Lucent-Data-Rate 197 integer ATTRIBUTE Lucent-PreSession-Time 198 integer ATTRIBUTE Lucent-Token-Idle 199 integer ATTRIBUTE Lucent-Token-Immediate 200 integer ATTRIBUTE Lucent-Require-Auth 201 integer ATTRIBUTE Lucent-Number-Sessions 202 string ATTRIBUTE Lucent-Authen-Alias 203 string ATTRIBUTE Lucent-Token-Expiry 204 integer ATTRIBUTE Lucent-Menu-Selector 205 string ATTRIBUTE Lucent-Menu-Item 206 string ATTRIBUTE Lucent-PW-Warntime 207 integer ATTRIBUTE Lucent-PW-Lifetime 208 integer ATTRIBUTE Lucent-IP-Direct 209 ipaddr ATTRIBUTE Lucent-PPP-VJ-Slot-Comp 210 integer ATTRIBUTE Lucent-PPP-VJ-1172 211 integer ATTRIBUTE Lucent-PPP-Async-Map 212 integer ATTRIBUTE Lucent-Third-Prompt 213 string ATTRIBUTE Lucent-Send-Secret 214 string encrypt=3 ATTRIBUTE Lucent-Receive-Secret 215 string encrypt=3 ATTRIBUTE Lucent-IPX-Peer-Mode 216 integer ATTRIBUTE Lucent-IP-Pool-Definition 217 string ATTRIBUTE Lucent-Assign-IP-Pool 218 integer ATTRIBUTE Lucent-FR-Direct 219 integer ATTRIBUTE Lucent-FR-Direct-Profile 220 string ATTRIBUTE Lucent-FR-Direct-DLCI 221 integer ATTRIBUTE Lucent-Handle-IPX 222 integer ATTRIBUTE Lucent-Netware-timeout 223 integer ATTRIBUTE Lucent-IPX-Alias 224 integer ATTRIBUTE Lucent-Metric 225 integer ATTRIBUTE Lucent-PRI-Number-Type 226 integer ATTRIBUTE Lucent-Dial-Number 227 string ATTRIBUTE Lucent-Route-IP 228 integer ATTRIBUTE Lucent-Route-IPX 229 integer ATTRIBUTE Lucent-Bridge 230 integer ATTRIBUTE Lucent-Send-Auth 231 integer ATTRIBUTE Lucent-Send-Passwd 232 string ATTRIBUTE Lucent-Link-Compression 233 integer ATTRIBUTE Lucent-Target-Util 234 integer ATTRIBUTE Lucent-Maximum-Channels 235 integer ATTRIBUTE Lucent-Inc-Channel-Count 236 integer ATTRIBUTE Lucent-Dec-Channel-Count 237 integer ATTRIBUTE Lucent-Seconds-Of-History 238 integer ATTRIBUTE Lucent-History-Weigh-Type 239 integer ATTRIBUTE Lucent-Add-Seconds 240 integer ATTRIBUTE Lucent-Remove-Seconds 241 integer ATTRIBUTE Lucent-Data-Filter 242 abinary ATTRIBUTE Lucent-Call-Filter 243 abinary ATTRIBUTE Lucent-Idle-Limit 244 integer ATTRIBUTE Lucent-Preempt-Limit 245 integer ATTRIBUTE Lucent-Callback 246 integer ATTRIBUTE Lucent-Data-Svc 247 integer ATTRIBUTE Lucent-Force-56 248 integer ATTRIBUTE Lucent-Billing-Number 249 string ATTRIBUTE Lucent-Call-By-Call 250 integer ATTRIBUTE Lucent-Transit-Number 251 string ATTRIBUTE Lucent-Host-Info 252 string ATTRIBUTE Lucent-PPP-Address 253 ipaddr ATTRIBUTE Lucent-MPP-Idle-Percent 254 integer ATTRIBUTE Lucent-Xmit-Rate 255 integer ATTRIBUTE Lucent-Fr05-Traffic-Shaper 256 integer ATTRIBUTE Lucent-Fr05-Vpi 257 integer ATTRIBUTE Lucent-Fr05-Vci 258 integer ATTRIBUTE Lucent-Fr05-Enabled 259 integer ATTRIBUTE Lucent-Tunnel-Auth-Type 260 octets # tag? ATTRIBUTE Lucent-MOH-Timeout 261 integer ATTRIBUTE Lucent-ATM-Circuit-Name 262 string ATTRIBUTE Lucent-Priority-For-PPP 263 integer ATTRIBUTE Lucent-Max-RTP-Delay 264 integer ATTRIBUTE Lucent-RTP-Port-Range 265 string ATTRIBUTE Lucent-TOS-Copying 266 integer ATTRIBUTE Lucent-Packet-Classification 267 integer ATTRIBUTE Lucent-No-High-Prio-Pkt-Duratio 268 integer ATTRIBUTE Lucent-AT-Answer-String 269 string ATTRIBUTE Lucent-IP-OUTGOING-TOS 270 integer ATTRIBUTE Lucent-IP-OUTGOING-TOS-Precedence 271 integer ATTRIBUTE Lucent-IP-OUTGOING-DSCP 272 integer ATTRIBUTE Lucent-TermSrv-Login-Prompt 273 string ATTRIBUTE Lucent-Multicast-Service-Profile-Name 274 string ATTRIBUTE Lucent-Multicast-Max-Groups 275 integer ATTRIBUTE Lucent-Multicast-Service-Name 276 string ATTRIBUTE Lucent-Multicast-Service-Active 277 integer ATTRIBUTE Lucent-Multicast-Service-Snmp-Trap 278 integer ATTRIBUTE Lucent-Multicast-Service-Filter-Type 279 integer ATTRIBUTE Lucent-Multicast-Filter-Active 280 integer ATTRIBUTE Lucent-Multicast-Filter-Address 281 ipaddr ATTRIBUTE Lucent-Tunnel-TOS 282 integer ATTRIBUTE Lucent-Tunnel-TOS-Precedence 283 integer ATTRIBUTE Lucent-Tunnel-DSCP 284 integer ATTRIBUTE Lucent-Tunnel-TOS-Filter 285 string ATTRIBUTE Lucent-Tunnel-TOS-Copy 286 integer ATTRIBUTE Lucent-Http-Redirect-URL 287 string ATTRIBUTE Lucent-Http-Redirect-Port 288 integer ATTRIBUTE Lucent-L2TP-DCI-Disconnect-Code 289 integer ATTRIBUTE Lucent-L2TP-DCI-Protocol-Number 290 integer ATTRIBUTE Lucent-L2TP-DCI-Direction 291 integer ATTRIBUTE Lucent-L2TP-DCI-Message 292 string ATTRIBUTE Lucent-L2TP-Q931-Cause-Code 293 integer ATTRIBUTE Lucent-L2TP-Q931-Cause-Message 294 integer ATTRIBUTE Lucent-L2TP-Q931-Advisory-Message 295 string ATTRIBUTE Lucent-L2TP-RC-Result-Code 296 integer ATTRIBUTE Lucent-L2TP-RC-Error-Code 297 integer ATTRIBUTE Lucent-L2TP-RC-Error-Message 298 string ATTRIBUTE Lucent-L2TP-Disconnect-Scenario 299 integer ATTRIBUTE Lucent-L2TP-Peer-Disconnect-Cause 300 integer ATTRIBUTE Lucent-L2TP-Peer-Connect-Progress 301 integer ATTRIBUTE Lucent-QuickConnect-Attempted 302 integer ATTRIBUTE Lucent-Num-Moh-Sessions 303 integer ATTRIBUTE Lucent-Cumulative-Hold-Time 304 integer ATTRIBUTE Lucent-Modem-Modulation 305 integer ATTRIBUTE Lucent-User-Acct-Expiration 306 date ATTRIBUTE Lucent-User-Login-Level 307 integer ATTRIBUTE Lucent-First-Level-User 308 string ATTRIBUTE Lucent-IP-Source-If 309 string ATTRIBUTE Lucent-Reverse-Path-Check 310 integer ATTRIBUTE Lucent-LCP-Keepalive-Period 321 integer ATTRIBUTE Lucent-LCP-Keepalive-Missed-Limit 322 integer ATTRIBUTE Lucent-Dsl-Atuc-Chan-Uncorrect-Blks 10000 integer ATTRIBUTE Lucent-Dsl-Atuc-Chan-Corrected-Blks 10001 integer ATTRIBUTE Lucent-Dsl-Atuc-Chan-Xmit-Blks 10002 integer ATTRIBUTE Lucent-Dsl-Atuc-Chan-Recd-Blks 10003 integer ATTRIBUTE Lucent-Dsl-Atuc-Perf-Inits 10004 integer ATTRIBUTE Lucent-Dsl-Atuc-Perf-ESs 10005 integer ATTRIBUTE Lucent-Dsl-Atuc-Perf-Lprs 10006 integer ATTRIBUTE Lucent-Dsl-Atuc-Perf-Lols 10007 integer ATTRIBUTE Lucent-Dsl-Atuc-Perf-Loss 10008 integer ATTRIBUTE Lucent-Dsl-Atuc-Perf-Lofs 10009 integer ATTRIBUTE Lucent-Dsl-Atuc-Curr-Attainable-Rate-Dn 10010 integer ATTRIBUTE Lucent-Dsl-Atuc-Curr-Output-Pwr-Dn 10011 integer ATTRIBUTE Lucent-Dsl-Atuc-Curr-Atn-Up 10012 integer ATTRIBUTE Lucent-Dsl-Atuc-Curr-Snr-Mgn-Up 10013 integer #ATTRIBUTE Lucent-Dsl-Atuc-Perf-Stat-Fast-Retrains 10014 integer #ATTRIBUTE Lucent-Dsl-Atuc-Perf-Stat-Failed-Fast-Retrains 10015 integer # FIXME when we can deal with long attribute names. ATTRIBUTE Lucent-Dsl-Atuc-PS-Fast-Retrains 10014 integer ATTRIBUTE Lucent-Dsl-Atuc-PS-Failed-Fast-Retrains 10015 integer ATTRIBUTE Lucent-Dsl-Code-Violations 10016 integer ATTRIBUTE Lucent-Line-Type 10017 integer ATTRIBUTE Lucent-Dsl-Curr-Up-Rate 10018 integer ATTRIBUTE Lucent-Dsl-Curr-Dn-Rate 10019 integer ATTRIBUTE Lucent-Dsl-Physical-Slot 10020 integer ATTRIBUTE Lucent-Dsl-Physical-Line 10021 integer ATTRIBUTE Lucent-Dsl-If-Index 10022 integer ATTRIBUTE Lucent-Dsl-Oper-Status 10023 integer ATTRIBUTE Lucent-Dsl-Related-If-Index 10024 integer ATTRIBUTE Lucent-Dsl-Atuc-Curr-Attainable-Rate-Up 10025 integer ATTRIBUTE Lucent-Dsl-Atuc-Curr-Output-Pwr-Up 10026 integer ATTRIBUTE Lucent-Dsl-Atuc-Curr-Atn-Dn 10027 integer ATTRIBUTE Lucent-Dsl-Atuc-Curr-Snr-Mgn-D 10028 integer ATTRIBUTE Lucent-Dsl-Related-Slot 10029 integer ATTRIBUTE Lucent-Dsl-Related-Port 10030 integer ATTRIBUTE Lucent-Dsl-Sparing-Role 10031 integer ATTRIBUTE Lucent-Absolute-Time 10032 integer ATTRIBUTE Lucent-Configured-Rate-Up-Min 10033 integer ATTRIBUTE Lucent-Configured-Rate-Up-Max 10034 integer ATTRIBUTE Lucent-Configured-Rate-Dn-Min 10035 integer ATTRIBUTE Lucent-Configured-Rate-Dn-Max 10036 integer ATTRIBUTE Lucent-Dsl-Physical-Channel 10037 integer ATTRIBUTE Lucent-Sonet-Section-ESs 10100 integer ATTRIBUTE Lucent-Sonet-Section-SESs 10101 integer ATTRIBUTE Lucent-Sonet-Section-SEFSs 10102 integer ATTRIBUTE Lucent-Sonet-Section-CVs 10103 integer ATTRIBUTE Lucent-Sonet-Line-ESs-Near 10104 integer ATTRIBUTE Lucent-Sonet-Line-SESs-Near 10105 integer ATTRIBUTE Lucent-Sonet-Line-CVs-Near 10106 integer ATTRIBUTE Lucent-Sonet-Line-USs-Near 10107 integer ATTRIBUTE Lucent-Sonet-Line-ESs-Far 10108 integer ATTRIBUTE Lucent-Sonet-Line-SESs-Far 10109 integer ATTRIBUTE Lucent-Sonet-Line-CVs-Far 10110 integer ATTRIBUTE Lucent-Sonet-Line-USs-Far 10111 integer ATTRIBUTE Lucent-Sonet-Path-ESs-Near 10112 integer ATTRIBUTE Lucent-Sonet-Path-SESs-Near 10113 integer ATTRIBUTE Lucent-Sonet-Path-CVs-Near 10114 integer ATTRIBUTE Lucent-Sonet-Path-USs-Near 10115 integer ATTRIBUTE Lucent-Sonet-Path-ESs-Far 10116 integer ATTRIBUTE Lucent-Sonet-Path-SESs-Far 10117 integer ATTRIBUTE Lucent-Sonet-Path-CVs-Far 10118 integer ATTRIBUTE Lucent-Sonet-Path-USs-Far 10119 integer ATTRIBUTE Lucent-Ds3-F-Bit-Err 10200 integer ATTRIBUTE Lucent-Ds3-P-Bit-Err 10201 integer ATTRIBUTE Lucent-Ds3-CCVs 10202 integer ATTRIBUTE Lucent-Ds3-PESs 10203 integer ATTRIBUTE Lucent-Ds3-PSESs 10204 integer ATTRIBUTE Lucent-Ds3-SEFs 10205 integer ATTRIBUTE Lucent-Ds3-UASs 10206 integer ATTRIBUTE Lucent-Ds3-LCVs 10207 integer ATTRIBUTE Lucent-Ds3-PCVs 10208 integer ATTRIBUTE Lucent-Ds3-LESs 10209 integer ATTRIBUTE Lucent-Ds3-CESs 10210 integer ATTRIBUTE Lucent-Ds3-CSESs 10211 integer ATTRIBUTE Lucent-Rtp-Local-Number-Of-Samples 10300 integer ATTRIBUTE Lucent-Rtp-Remote-Number-Of-Samples 10301 integer ATTRIBUTE Lucent-Rtp-Local-Jitter-Minimum 10302 integer ATTRIBUTE Lucent-Rtp-Local-Jitter-Maximum 10303 integer ATTRIBUTE Lucent-Rtp-Local-Jitter-Mean 10304 integer ATTRIBUTE Lucent-Rtp-Local-Jitter-Variance 10305 integer ATTRIBUTE Lucent-Rtp-Local-Delay-Minimum 10306 integer ATTRIBUTE Lucent-Rtp-Local-Delay-Maximum 10307 integer ATTRIBUTE Lucent-Rtp-Local-Delay-Mean 10308 integer ATTRIBUTE Lucent-Rtp-Local-Delay-Variance 10309 integer ATTRIBUTE Lucent-Rtp-Local-Packets-Sent 10310 integer ATTRIBUTE Lucent-Rtp-Local-Packets-Lost 10311 integer ATTRIBUTE Lucent-Rtp-Local-Packets-Late 10312 integer ATTRIBUTE Lucent-Rtp-Local-Bytes-Sent 10313 integer ATTRIBUTE Lucent-Rtp-Local-Silence-Percent 10314 integer ATTRIBUTE Lucent-Rtp-Remote-Jitter-Minimum 10315 integer ATTRIBUTE Lucent-Rtp-Remote-Jitter-Maximum 10316 integer ATTRIBUTE Lucent-Rtp-Remote-Jitter-Mean 10317 integer ATTRIBUTE Lucent-Rtp-Remote-Jitter-Variance 10318 integer ATTRIBUTE Lucent-Rtp-Remote-Delay-Minimum 10319 integer ATTRIBUTE Lucent-Rtp-Remote-Delay-Maximum 10320 integer ATTRIBUTE Lucent-Rtp-Remote-Delay-Mean 10321 integer ATTRIBUTE Lucent-Rtp-Remote-Delay-Variance 10322 integer ATTRIBUTE Lucent-Rtp-Remote-Packets-Sent 10323 integer ATTRIBUTE Lucent-Rtp-Remote-Packets-Lost 10324 integer ATTRIBUTE Lucent-Rtp-Remote-Packets-Late 10325 integer ATTRIBUTE Lucent-Rtp-Remote-Bytes-Sent 10326 integer ATTRIBUTE Lucent-Rtp-Remote-Silence-Percent 10327 integer ATTRIBUTE Lucent-Tunnel-Auth-Type2 19999 integer ATTRIBUTE Lucent-Multi-Packet-Separator 20000 integer ATTRIBUTE Lucent-Min-Xmit-Rate 20100 integer ATTRIBUTE Lucent-Max-Xmit-Rate 20101 integer ATTRIBUTE Lucent-Min-Recv-Rate 20102 integer ATTRIBUTE Lucent-Max-Recv-Rate 20103 integer ATTRIBUTE Lucent-Error-Correction-Protocol 20104 integer ATTRIBUTE Lucent-Compression-Protocol 20105 integer ATTRIBUTE Lucent-Modulation 20106 integer ATTRIBUTE Lucent-Xmit-Symbol-Rate 20107 integer ATTRIBUTE Lucent-Recv-Symbol-Rate 20108 integer ATTRIBUTE Lucent-Current-Xmit-Level 20109 integer ATTRIBUTE Lucent-Current-Recv-Level 20110 integer ATTRIBUTE Lucent-Current-Line-Quality 20111 integer ATTRIBUTE Lucent-Current-SNR 20112 integer ATTRIBUTE Lucent-Min-SNR 20113 integer ATTRIBUTE Lucent-Max-SNR 20114 integer ATTRIBUTE Lucent-Local-Retrain-Requested 20115 integer ATTRIBUTE Lucent-Remote-Retrain-Requested 20116 integer ATTRIBUTE Lucent-Connection-Time 20117 integer ATTRIBUTE Lucent-Modem-Disconnect-Reason 20118 integer ATTRIBUTE Lucent-Retrain-Reason 20119 integer END-VENDOR Lucent freeradius-server/share/dictionary.manzara000066400000000000000000000016521257552170400213510ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2011 The FreeRADIUS Server project and contributors # VENDOR Manzara 19382 BEGIN-VENDOR Manzara ATTRIBUTE Manzara-User-UID 1 integer ATTRIBUTE Manzara-User-GID 2 integer ATTRIBUTE Manzara-User-Home 3 string ATTRIBUTE Manzara-User-Shell 4 string ATTRIBUTE Manzara-PPP-Addr-String 5 string ATTRIBUTE Manzara-Full-Login-String 6 string ATTRIBUTE Manzara-Tariff-Units 7 integer ATTRIBUTE Manzara-Tariff-Type 8 integer ATTRIBUTE Manzara-ECP-Session-Key 9 octets ATTRIBUTE Manzara-Map-Name 10 string ATTRIBUTE Manzara-Map-Key 11 string ATTRIBUTE Manzara-Map-Value 12 string ATTRIBUTE Manzara-Map-Error 13 string ATTRIBUTE Manzara-Service-Type 14 string VALUE Manzara-Tariff-Type MMS-Picture 1 VALUE Manzara-Tariff-Type Unused 2 VALUE Manzara-Tariff-Type Internet 3 # # Poaching on the standard space is wrong. # VALUE Acct-Status-Type One-Time 17 END-VENDOR Manzara freeradius-server/share/dictionary.merit000066400000000000000000000004401257552170400210320ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2011 The FreeRADIUS Server project and contributors # # For Merit. # # $Id$ # VENDOR Merit 61 BEGIN-VENDOR Merit ATTRIBUTE Merit-Proxy-Action 211 string ATTRIBUTE Merit-User-Id 222 string ATTRIBUTE Merit-User-Realm 223 string END-VENDOR Merit freeradius-server/share/dictionary.meru000066400000000000000000000004031257552170400206610ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2013 The FreeRADIUS Server project and contributors # # dictionary.meru # # $Id$ # # VENDOR Meru 15983 BEGIN-VENDOR Meru ATTRIBUTE Access-Point-Id 1 integer ATTRIBUTE Access-Point-Name 2 string END-VENDOR Meru freeradius-server/share/dictionary.microsoft000066400000000000000000000120771257552170400217300ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2011 The FreeRADIUS Server project and contributors # # Microsoft's VSA's, from RFC 2548 # # $Id$ # VENDOR Microsoft 311 BEGIN-VENDOR Microsoft ATTRIBUTE MS-CHAP-Response 1 octets ATTRIBUTE MS-CHAP-Error 2 string ATTRIBUTE MS-CHAP-CPW-1 3 octets ATTRIBUTE MS-CHAP-CPW-2 4 octets ATTRIBUTE MS-CHAP-LM-Enc-PW 5 octets ATTRIBUTE MS-CHAP-NT-Enc-PW 6 octets ATTRIBUTE MS-MPPE-Encryption-Policy 7 octets # This is referred to as both singular and plural in the RFC. # Plural seems to make more sense. ATTRIBUTE MS-MPPE-Encryption-Type 8 octets ATTRIBUTE MS-MPPE-Encryption-Types 8 octets ATTRIBUTE MS-RAS-Vendor 9 integer # content is Vendor-ID ATTRIBUTE MS-CHAP-Domain 10 string ATTRIBUTE MS-CHAP-Challenge 11 octets ATTRIBUTE MS-CHAP-MPPE-Keys 12 octets encrypt=1 ATTRIBUTE MS-BAP-Usage 13 integer ATTRIBUTE MS-Link-Utilization-Threshold 14 integer # values are 1-100 ATTRIBUTE MS-Link-Drop-Time-Limit 15 integer ATTRIBUTE MS-MPPE-Send-Key 16 octets encrypt=2 ATTRIBUTE MS-MPPE-Recv-Key 17 octets encrypt=2 ATTRIBUTE MS-RAS-Version 18 string ATTRIBUTE MS-Old-ARAP-Password 19 octets ATTRIBUTE MS-New-ARAP-Password 20 octets ATTRIBUTE MS-ARAP-PW-Change-Reason 21 integer ATTRIBUTE MS-Filter 22 octets ATTRIBUTE MS-Acct-Auth-Type 23 integer ATTRIBUTE MS-Acct-EAP-Type 24 integer ATTRIBUTE MS-CHAP2-Response 25 octets ATTRIBUTE MS-CHAP2-Success 26 octets ATTRIBUTE MS-CHAP2-CPW 27 octets ATTRIBUTE MS-Primary-DNS-Server 28 ipaddr ATTRIBUTE MS-Secondary-DNS-Server 29 ipaddr ATTRIBUTE MS-Primary-NBNS-Server 30 ipaddr ATTRIBUTE MS-Secondary-NBNS-Server 31 ipaddr #ATTRIBUTE MS-ARAP-Challenge 33 octets ## MS-RNAP # # http://download.microsoft.com/download/9/5/E/95EF66AF-9026-4BB0-A41D-A4F81802D92C/%5BMS-RNAP%5D.pdf ATTRIBUTE MS-RAS-Client-Name 34 string ATTRIBUTE MS-RAS-Client-Version 35 string ATTRIBUTE MS-Quarantine-IPFilter 36 octets ATTRIBUTE MS-Quarantine-Session-Timeout 37 integer ATTRIBUTE MS-User-Security-Identity 40 string ATTRIBUTE MS-Identity-Type 41 integer ATTRIBUTE MS-Service-Class 42 string ATTRIBUTE MS-Quarantine-User-Class 44 string ATTRIBUTE MS-Quarantine-State 45 integer ATTRIBUTE MS-Quarantine-Grace-Time 46 integer ATTRIBUTE MS-Network-Access-Server-Type 47 integer ATTRIBUTE MS-AFW-Zone 48 integer VALUE MS-AFW-Zone MS-AFW-Zone-Boundary-Policy 1 VALUE MS-AFW-Zone MS-AFW-Zone-Unprotected-Policy 2 VALUE MS-AFW-Zone MS-AFW-Zone-Protected-Policy 3 ATTRIBUTE MS-AFW-Protection-Level 49 integer VALUE MS-AFW-Protection-Level HECP-Response-Sign-Only 1 VALUE MS-AFW-Protection-Level HECP-Response-Sign-And-Encrypt 2 ATTRIBUTE MS-Machine-Name 50 string ATTRIBUTE MS-IPv6-Filter 51 octets ATTRIBUTE MS-IPv4-Remediation-Servers 52 octets ATTRIBUTE MS-IPv6-Remediation-Servers 53 octets ATTRIBUTE MS-RNAP-Not-Quarantine-Capable 54 integer VALUE MS-RNAP-Not-Quarantine-Capable SoH-Sent 0 VALUE MS-RNAP-Not-Quarantine-Capable SoH-Not-Sent 1 ATTRIBUTE MS-Quarantine-SOH 55 octets ATTRIBUTE MS-RAS-Correlation 56 octets # Or this might be 56? ATTRIBUTE MS-Extended-Quarantine-State 57 integer ATTRIBUTE MS-HCAP-User-Groups 58 string ATTRIBUTE MS-HCAP-Location-Group-Name 59 string ATTRIBUTE MS-HCAP-User-Name 60 string ATTRIBUTE MS-User-IPv4-Address 61 ipaddr ATTRIBUTE MS-User-IPv6-Address 62 ipv6addr ATTRIBUTE MS-TSG-Device-Redirection 63 integer # # Integer Translations # # MS-BAP-Usage Values VALUE MS-BAP-Usage Not-Allowed 0 VALUE MS-BAP-Usage Allowed 1 VALUE MS-BAP-Usage Required 2 # MS-ARAP-Password-Change-Reason Values VALUE MS-ARAP-PW-Change-Reason Just-Change-Password 1 VALUE MS-ARAP-PW-Change-Reason Expired-Password 2 VALUE MS-ARAP-PW-Change-Reason Admin-Requires-Password-Change 3 VALUE MS-ARAP-PW-Change-Reason Password-Too-Short 4 # MS-Acct-Auth-Type Values VALUE MS-Acct-Auth-Type PAP 1 VALUE MS-Acct-Auth-Type CHAP 2 VALUE MS-Acct-Auth-Type MS-CHAP-1 3 VALUE MS-Acct-Auth-Type MS-CHAP-2 4 VALUE MS-Acct-Auth-Type EAP 5 # MS-Acct-EAP-Type Values VALUE MS-Acct-EAP-Type MD5 4 VALUE MS-Acct-EAP-Type OTP 5 VALUE MS-Acct-EAP-Type Generic-Token-Card 6 VALUE MS-Acct-EAP-Type TLS 13 # MS-Identity-Type Values VALUE MS-Identity-Type Machine-Health-Check 1 VALUE MS-Identity-Type Ignore-User-Lookup-Failure 2 # MS-Quarantine-State Values VALUE MS-Quarantine-State Full-Access 0 VALUE MS-Quarantine-State Quarantine 1 VALUE MS-Quarantine-State Probation 2 # MS-Network-Access-Server-Type Values VALUE MS-Network-Access-Server-Type Unspecified 0 VALUE MS-Network-Access-Server-Type Terminal-Server-Gateway 1 VALUE MS-Network-Access-Server-Type Remote-Access-Server 2 VALUE MS-Network-Access-Server-Type DHCP-Server 3 VALUE MS-Network-Access-Server-Type Wireless-Access-Point 4 VALUE MS-Network-Access-Server-Type HRA 5 VALUE MS-Network-Access-Server-Type HCAP-Server 6 # MS-Extended-Quarantine-State Values VALUE MS-Extended-Quarantine-State Transition 1 VALUE MS-Extended-Quarantine-State Infected 2 VALUE MS-Extended-Quarantine-State Unknown 3 VALUE MS-Extended-Quarantine-State No-Data 4 END-VENDOR Microsoft freeradius-server/share/dictionary.mikrotik000066400000000000000000000032061257552170400215460ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2011 The FreeRADIUS Server project and contributors # http://www.mikrotik.com # # http://www.mikrotik.com/documentation//manual_2.9/dictionary # # Do NOT follow their instructions and replace the dictionary # in /etc/raddb with the one that they supply. It is NOT necessary. # # On top of that, the sample dictionary file they provide # DOES NOT WORK. Do NOT use it. # # $Id$ # VENDOR Mikrotik 14988 BEGIN-VENDOR Mikrotik ATTRIBUTE Mikrotik-Recv-Limit 1 integer ATTRIBUTE Mikrotik-Xmit-Limit 2 integer # this attribute is unused ATTRIBUTE Mikrotik-Group 3 string ATTRIBUTE Mikrotik-Wireless-Forward 4 integer ATTRIBUTE Mikrotik-Wireless-Skip-Dot1x 5 integer ATTRIBUTE Mikrotik-Wireless-Enc-Algo 6 integer ATTRIBUTE Mikrotik-Wireless-Enc-Key 7 string ATTRIBUTE Mikrotik-Rate-Limit 8 string ATTRIBUTE Mikrotik-Realm 9 string ATTRIBUTE Mikrotik-Host-IP 10 ipaddr ATTRIBUTE Mikrotik-Mark-Id 11 string ATTRIBUTE Mikrotik-Advertise-URL 12 string ATTRIBUTE Mikrotik-Advertise-Interval 13 integer ATTRIBUTE Mikrotik-Recv-Limit-Gigawords 14 integer ATTRIBUTE Mikrotik-Xmit-Limit-Gigawords 15 integer ATTRIBUTE Mikrotik-Wireless-PSK 16 string ATTRIBUTE Mikrotik-Total-Limit 17 integer ATTRIBUTE Mikrotik-Total-Limit-Gigawords 18 integer ATTRIBUTE Mikrotik-Address-List 19 string ATTRIBUTE Mikrotik-Wireless-MPKey 20 string ATTRIBUTE Mikrotik-Wireless-Comment 21 string ATTRIBUTE Mikrotik-Delegated-IPv6-Pool 22 string # MikroTik Values VALUE Mikrotik-Wireless-Enc-Algo No-encryption 0 VALUE Mikrotik-Wireless-Enc-Algo 40-bit-WEP 1 VALUE Mikrotik-Wireless-Enc-Algo 104-bit-WEP 2 END-VENDOR Mikrotik freeradius-server/share/dictionary.motorola000066400000000000000000000045661257552170400215630ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2011 The FreeRADIUS Server project and contributors ############################################################################## # # Motorola Canopy attributes. # # NOT included in the main dictionaries because of conflicts # with Ascend attributes. # # $Id$ # ############################################################################## VENDOR Motorola 161 BEGIN-VENDOR Motorola # Low Priority uplink CIR ATTRIBUTE Motorola-Canopy-LPULCIR 1 integer # Low Priority downlink CIR ATTRIBUTE Motorola-Canopy-LPDLCIR 2 integer # High Priority uplink CIR ATTRIBUTE Motorola-Canopy-HPULCIR 3 integer # High Priority downlink CIR ATTRIBUTE Motorola-Canopy-HPDLCIR 4 integer # High Priority Enable ATTRIBUTE Motorola-Canopy-HPENABLE 5 integer # Uplink Bit Rate/Sustained Uplink Rate ATTRIBUTE Motorola-Canopy-ULBR 6 integer # Uplink Bit Limit/Uplink Burst Allocation ATTRIBUTE Motorola-Canopy-ULBL 7 integer # Downlink Bit Rate/Sustained Downlink Rate ATTRIBUTE Motorola-Canopy-DLBR 8 integer # Downlink Bit Limit/Downlink Burst Allocation ATTRIBUTE Motorola-Canopy-DLBL 9 integer # VLAN Learning Enable ATTRIBUTE Motorola-Canopy-VLLEARNEN 14 integer # VLAN Frames Types allowed - all/Tag/Untagged ATTRIBUTE Motorola-Canopy-VLFRAMES 15 integer # VLAN Membership (1-4094) ATTRIBUTE Motorola-Canopy-VLIDSET 16 integer # VLAN Age Timeout ATTRIBUTE Motorola-Canopy-VLAGETO 20 integer # VLAN Ingress VLAN ID ATTRIBUTE Motorola-Canopy-VLIGVID 21 integer # VLAN Management VLAN ID ATTRIBUTE Motorola-Canopy-VLMGVID 22 integer # VLAN SM Management Passthrough Enable ATTRIBUTE Motorola-Canopy-VLSMMGPASS 23 integer # Broadcast Traffic Maximum Information Rate ATTRIBUTE Motorola-Canopy-BCASTMIR 24 integer # Userlevel permission for the User logging in remotely ATTRIBUTE Motorola-Canopy-UserLevel 50 integer VALUE Motorola-Canopy-HPENABLE Disable 0 VALUE Motorola-Canopy-HPENABLE Enable 1 VALUE Motorola-Canopy-VLLEARNEN Disable 0 VALUE Motorola-Canopy-VLLEARNEN Enable 1 VALUE Motorola-Canopy-VLFRAMES All 0 VALUE Motorola-Canopy-VLFRAMES Tagged 1 VALUE Motorola-Canopy-VLFRAMES Untagged 2 VALUE Motorola-Canopy-VLSMMGPASS Enable 1 VALUE Motorola-Canopy-VLSMMGPASS Disable 0 VALUE Motorola-Canopy-UserLevel TECH 1 VALUE Motorola-Canopy-UserLevel INSTALL 2 VALUE Motorola-Canopy-UserLevel ADMIN 3 END-VENDOR Motorola freeradius-server/share/dictionary.motorola.illegal000066400000000000000000000017421257552170400231640ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2011 The FreeRADIUS Server project and contributors ############################################################################## # # Motorola Canopy attributes. # # See also dictionary.motorola.illegal. You can use that one # by listing it in raddb/dictionary. # # $Id$ # ############################################################################## ATTRIBUTE Motorola-Canopy-Shared-Secret 224 string ATTRIBUTE Motorola-Canopy-SULDR 225 string ATTRIBUTE Motorola-Canopy-SDLDR 226 string ATTRIBUTE Motorola-Canopy-ULBA 227 string ATTRIBUTE Motorola-Canopy-DLBA 228 string ATTRIBUTE Motorola-Canopy-Enable 229 string ATTRIBUTE Motorola-Canopy-LPSULDR 230 string ATTRIBUTE Motorola-Canopy-LPSDLDR 231 string ATTRIBUTE Motorola-Canopy-HPCENABLE 232 string ATTRIBUTE Motorola-Canopy-HPSULDR 233 string ATTRIBUTE Motorola-Canopy-HPSDLDR 234 string ATTRIBUTE Motorola-Canopy-HIGHERBW 235 string ATTRIBUTE Motorola-Canopy-CIRENABLE 236 string freeradius-server/share/dictionary.motorola.wimax000066400000000000000000000023131257552170400226730ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2011 The FreeRADIUS Server project and contributors ############################################################################## # # Motorola WiMAX attributes. # # $Id$ # ############################################################################## VENDOR Motorola 161 BEGIN-VENDOR Motorola ATTRIBUTE Motorola-WiMAX-MIP-MN-HOME-ADDRESS 10 ipaddr ATTRIBUTE Motorola-WiMAX-MIP-KEY 11 string encrypt=2 ATTRIBUTE Motorola-WiMAX-MIP-SPI 12 integer ATTRIBUTE Motorola-WiMAX-MN-HA 13 ipaddr ATTRIBUTE Motorola-WiMAX-DNS-Server-IP-Address 20 octets ATTRIBUTE Motorola-WiMAX-User-NAI 22 string ATTRIBUTE Motorola-WiMAX-Network-Domain-Name 30 string ATTRIBUTE Motorola-WiMAX-EMS-Address 31 ipaddr ATTRIBUTE Motorola-WiMAX-Provisioning-Server 32 string ATTRIBUTE Motorola-WiMAX-NTP-Server 34 octets ATTRIBUTE Motorola-WiMAX-HO-SVC-CLASS 35 octets ATTRIBUTE Motorola-WiMAX-Home-BTS 50 octets ATTRIBUTE Motorola-WiMAX-Maximum-Total-Bandwidth 60 octets ATTRIBUTE Motorola-WiMAX-Maximum-Commit-Bandwidth 61 octets ATTRIBUTE Motorola-WiMAX-Convergence-Sublayer 63 octets ATTRIBUTE Motorola-WiMAX-Service-Flows 64 string ATTRIBUTE Motorola-WiMAX-VLAN-ID 65 octets END-VENDOR Motorola freeradius-server/share/dictionary.navini000066400000000000000000000005201257552170400211750ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2011 The FreeRADIUS Server project and contributors # # dictionary.navini # # By # "Paul Shields" # # Version: $Id$ # VENDOR Navini 6504 # # Standard attribute # BEGIN-VENDOR Navini ATTRIBUTE Navini-AVPair 1 string END-VENDOR Navini freeradius-server/share/dictionary.netscreen000066400000000000000000000016671257552170400217140ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2011 The FreeRADIUS Server project and contributors # # From: # http://www.netscreen.com/support/downloads/4.0_configuring_screenOS_for_NTdomain_v11.pdf # VENDOR Netscreen 3224 BEGIN-VENDOR Netscreen ATTRIBUTE NS-Admin-Privilege 1 integer ATTRIBUTE NS-VSYS-Name 2 string ATTRIBUTE NS-User-Group 3 string ATTRIBUTE NS-Primary-DNS 4 ipaddr ATTRIBUTE NS-Secondary-DNS 5 ipaddr ATTRIBUTE NS-Primary-WINS 6 ipaddr ATTRIBUTE NS-Secondary-WINS 7 ipaddr ATTRIBUTE NS-NSM-User-Domain-Name 220 string ATTRIBUTE NS-NSM-User-Role-Mapping 221 string # # Values VSYS-Admin and Read-Only-VSYS-Admin require a NS-VSYS-Name # attribute in the response packet. # VALUE NS-Admin-Privilege Root-Admin 1 VALUE NS-Admin-Privilege All-VSYS-Root-Admin 2 VALUE NS-Admin-Privilege VSYS-Admin 3 VALUE NS-Admin-Privilege Read-Only-Admin 4 VALUE NS-Admin-Privilege Read-Only-VSYS-Admin 5 END-VENDOR Netscreen freeradius-server/share/dictionary.networkphysics000066400000000000000000000007131257552170400230110ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2011 The FreeRADIUS Server project and contributors # # NetworkPhysics dictionary # $Id$ # VENDOR NetworkPhysics 7119 BEGIN-VENDOR NetworkPhysics ATTRIBUTE NetSensory-Privilege 33 string #VALUE NetSensory-Privilege InsightsOnly 'insight' #VALUE NetSensory-Privilege Restricted 'npread' #VALUE NetSensory-Privilege Standard 'npuser' #VALUE NetSensory-Privilege Administrative 'npadmin' END-VENDOR NetworkPhysics freeradius-server/share/dictionary.nexans000066400000000000000000000010611257552170400212060ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2011 The FreeRADIUS Server project and contributors ############################################################################## # Nexans Active Networking Systems dictionary http://www.nexans.de/ans # # Version: $Id$ # # Hubert Theissen # ############################################################################## VENDOR Nexans 266 BEGIN-VENDOR Nexans ATTRIBUTE Nexans-Port-Default-VLAN-ID 1 integer ATTRIBUTE Nexans-Port-Voice-VLAN-ID 2 integer END-VENDOR Nexans freeradius-server/share/dictionary.nokia000066400000000000000000000024421257552170400210170ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2011 The FreeRADIUS Server project and contributors ###################################################################### # # Nokia dictionary # $Id$ # ###################################################################### VENDOR Nokia 94 BEGIN-VENDOR Nokia ATTRIBUTE Nokia-AVPair 1 string ATTRIBUTE Nokia-User-Profile 2 string ATTRIBUTE Nokia-Service-Name 3 octets # magic format ATTRIBUTE Nokia-Service-Id 4 octets # magic format ATTRIBUTE Nokia-Service-Username 5 octets # magic format ATTRIBUTE Nokia-Service-Password 6 octets # magic format ATTRIBUTE Nokia-Service-Primary-Indicator 7 octets ATTRIBUTE Nokia-Service-Charging-Type 8 octets # magic format ATTRIBUTE Nokia-Service-Encrypted-Password 9 octets # magic format ATTRIBUTE Nokia-Session-Access-Method 10 octets ATTRIBUTE Nokia-Session-Charging-Type 11 octets ATTRIBUTE Nokia-OCS-ID1 12 integer ATTRIBUTE Nokia-OCS-ID2 13 integer ATTRIBUTE Nokia-TREC-Index 14 integer ATTRIBUTE Nokia-Requested-APN 15 string END-VENDOR Nokia # # The format of some Nokia attributes is binary coded decimal # (BCD) with the last four bits all set to 1 if there are an odd # number of digits, # # e.g 123 is encoded as hexadecimal bytes 21 F3 # # This is an incredibly stupid way of encoding the data. # freeradius-server/share/dictionary.nokia.conflict000066400000000000000000000017701257552170400226220ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2011 The FreeRADIUS Server project and contributors ############################################################################## # # Nokia dictionary for attributes that conflict with other dictionaries. # # $Id$ # ############################################################################## # # Enable by putting the line "$INCLUDE dictionary.nokia.conflict" into # the main dictionary file. Don't forget to comment out the # $INCLUDE dictionary.ascend, because these over-lap with the # standard RADIUS attributes, which are also illegitimately used # by Ascend. # # It's apparently rocket science for people to define their own # VSA's. # ATTRIBUTE Nokia-Primary-DNS-Server 135 ipaddr ATTRIBUTE Nokia-Secondary-DNS-Server 136 ipaddr ATTRIBUTE Nokia-IMSI 224 octets ATTRIBUTE Nokia-Charging-Id 225 integer ATTRIBUTE Nokia-Prepaid-Ind 226 integer ATTRIBUTE Nokia-GGSN-IP-Address 227 ipaddr ATTRIBUTE Nokia-SGSN-IP-Address 228 ipaddr freeradius-server/share/dictionary.nomadix000066400000000000000000000016321257552170400213550ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2011 The FreeRADIUS Server project and contributors # # Version: $Id$ # VENDOR Nomadix 3309 # BEGIN-VENDOR Nomadix ATTRIBUTE Nomadix-Bw-Up 1 integer ATTRIBUTE Nomadix-Bw-Down 2 integer ATTRIBUTE Nomadix-URL-Redirection 3 string ATTRIBUTE Nomadix-IP-Upsell 4 integer ATTRIBUTE Nomadix-Expiration 5 string ATTRIBUTE Nomadix-Subnet 6 string ATTRIBUTE Nomadix-MaxBytesUp 7 integer ATTRIBUTE Nomadix-MaxBytesDown 8 integer ATTRIBUTE Nomadix-EndofSession 9 integer ATTRIBUTE Nomadix-Logoff-URL 10 string ATTRIBUTE Nomadix-Net-VLAN 11 integer ATTRIBUTE Nomadix-Config-URL 12 string ATTRIBUTE Nomadix-Goodbye-URL 13 string ATTRIBUTE Nomadix-Group-Policy-Id 19 integer ATTRIBUTE Nomadix-Group-Bw-Max-Up 20 integer ATTRIBUTE Nomadix-Group-Bw-Max-Down 21 integer VALUE Nomadix-IP-Upsell PrivatePool 0 VALUE Nomadix-IP-Upsell PublicPool 1 END-VENDOR Nomadix freeradius-server/share/dictionary.nortel000066400000000000000000000044101257552170400212160ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2011 The FreeRADIUS Server project and contributors ############################################################################## # # Nortel Passport 8600 VSA's. # # http://www142.nortelnetworks.com/bvdoc/setips/july04/engineeringtipstricksv12.pdf # # $Id$ # ############################################################################## VENDOR Nortel 562 BEGIN-VENDOR Nortel ATTRIBUTE Nortel-User-Role 110 string ATTRIBUTE Nortel-Privilege-Level 166 integer ATTRIBUTE Passport-Command-Scope 200 integer ATTRIBUTE Passport-Command-Impact 201 integer ATTRIBUTE Passport-Customer-Identifier 202 integer ATTRIBUTE Passport-Allowed-Access 203 integer ATTRIBUTE Passport-AllowedOut-Access 204 integer ATTRIBUTE Passport-Login-Directory 205 string ATTRIBUTE Passport-Timeout-Protocol 206 integer ATTRIBUTE Passport-Role 207 string VALUE Nortel-Privilege-Level VoiceMailAdmin 0 VALUE Nortel-Privilege-Level ContactCenter 1 VALUE Nortel-Privilege-Level SBAInstaller 2 VALUE Nortel-Privilege-Level SBASystemCoord 3 VALUE Nortel-Privilege-Level SBASystemCoordBasic 4 VALUE Nortel-Privilege-Level SBABasic 5 VALUE Nortel-Privilege-Level Security 6 VALUE Nortel-Privilege-Level CTEApp 7 VALUE Nortel-Privilege-Level SBA-IPSetRegistration 8 VALUE Nortel-Privilege-Level Application-BCMMonitor 9 VALUE Nortel-Privilege-Level CDRApp 10 VALUE Nortel-Privilege-Level ModemLogin 11 VALUE Nortel-Privilege-Level GuestLogin 12 VALUE Nortel-Privilege-Level AdminDownload 13 VALUE Nortel-Privilege-Level ExclusiveAccess 14 VALUE Nortel-Privilege-Level Admin 15 VALUE Nortel-Privilege-Level DataAdmin 16 VALUE Nortel-Privilege-Level RemoteAccess 17 VALUE Nortel-Privilege-Level Guest 18 VALUE Nortel-Privilege-Level VoiceAdmin 19 VALUE Nortel-Privilege-Level BackupOperator 20 VALUE Nortel-Privilege-Level RemoteMonitoring 21 VALUE Nortel-Privilege-Level SoftwareUpgrade 22 VALUE Nortel-Privilege-Level AlarmViewer 24 VALUE Nortel-Privilege-Level OperationalLogs 26 VALUE Nortel-Privilege-Level DiagnosticLogs 27 VALUE Nortel-Privilege-Level ApplicationIVR 28 VALUE Nortel-Privilege-Level ISDN-Dial-in 30 VALUE Nortel-Privilege-Level WAN-Dial-in 32 VALUE Nortel-Privilege-Level System-SerialPort 36 END-VENDOR Nortel freeradius-server/share/dictionary.ntua000066400000000000000000000024701257552170400206660ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2011 The FreeRADIUS Server project and contributors VENDOR NTUA 969 BEGIN-VENDOR NTUA # # Authentication Attributes # ATTRIBUTE UserLogon-Uid 10 integer ATTRIBUTE UserLogon-Gid 11 integer ATTRIBUTE UserLogon-HomeDir 12 string ATTRIBUTE UserLogon-Type 13 integer ATTRIBUTE UserLogon-QuotaBytes 14 integer ATTRIBUTE UserLogon-QuotaFiles 15 integer ATTRIBUTE UserLogon-Shell 16 string ATTRIBUTE UserLogon-Restriction 17 integer ATTRIBUTE UserLogon-GroupNames 18 string ATTRIBUTE UserLogon-DriveNames 19 string ATTRIBUTE UserLogon-UserDescription 20 string ATTRIBUTE UserLogon-UserFullName 21 string ATTRIBUTE UserLogon-UserDomain 22 string ATTRIBUTE UserLogon-LogonTask 23 string ATTRIBUTE UserLogon-LogoffTask 24 string ATTRIBUTE UserLogon-Expiration 25 string ATTRIBUTE UserLogon-UserProfile 26 string # # Accounting Attributes # ATTRIBUTE UserLogon-Acct-TerminateCause 50 string VALUE UserLogon-Type FTP 1 VALUE UserLogon-Type WEB 2 VALUE UserLogon-Type POP 3 VALUE UserLogon-Type IMAP 4 VALUE UserLogon-Type Windows-Logon 5 VALUE UserLogon-Type Unix-Logon 6 VALUE UserLogon-Type SMTP-Auth 7 VALUE UserLogon-Type Other 200 VALUE UserLogon-Restriction Anonymous-User 1 VALUE UserLogon-Restriction Admin-User 2 END-VENDOR NTUA freeradius-server/share/dictionary.openser000066400000000000000000000025141257552170400213710ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2011 The FreeRADIUS Server project and contributors ############################################################################## # # OpenSER dictionary. # # This dictionary is NOT included by default, because it conflicts # with attributes defined in the RADIUS standard. Vendors SHOULD # be using a VSA space to assign attributes. # # Be aware that if you DO include this dictionary in the main # dictionary file, other parts of your configuration may break! # # http://www.openser.org/docs/openser-radius-1.0.x.html # # $Id$ # ############################################################################## ATTRIBUTE Sip-Method 101 integer ATTRIBUTE Sip-Response-Code 102 integer ATTRIBUTE Sip-Cseq 103 string ATTRIBUTE Sip-To-Tag 104 string ATTRIBUTE Sip-From-Tag 105 string ATTRIBUTE Sip-Translated-Request-URI 107 string ATTRIBUTE Sip-Src-IP 108 string ATTRIBUTE Sip-Src-Port 109 string ATTRIBUTE Sip-Uri-User 208 string ATTRIBUTE Sip-Group 211 string ATTRIBUTE Sip-Rpid 213 string ATTRIBUTE SIP-AVP 225 string VALUE Service-Type Group-Check 12 VALUE Service-Type Sip-Session 15 VALUE Service-Type SIP-Caller-AVPs 30 VALUE Service-Type SIP-Callee-AVPs 31 VALUE Sip-Method INVITE 1 VALUE Sip-Method CANCEL 2 VALUE Sip-Method ACK 4 VALUE Sip-Method BYE 8 freeradius-server/share/dictionary.packeteer000066400000000000000000000007411257552170400216610ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2011 The FreeRADIUS Server project and contributors ############################################################################## # # Packeteer VSAs, who followed the Cisco way of putting everything # into one text string. # # $Id$ # ############################################################################## VENDOR Packeteer 2334 # # Standard attribute # BEGIN-VENDOR Packeteer ATTRIBUTE Packeteer-AVPair 1 string END-VENDOR Packeteer freeradius-server/share/dictionary.paloalto000066400000000000000000000011101257552170400215200ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2012 The FreeRADIUS Server project and contributors ############################################################################## # # Palo Alto Networks. # # $Id$ # ############################################################################## VENDOR PaloAlto 25461 BEGIN-VENDOR PaloAlto ATTRIBUTE PaloAlto-Admin-Role 1 string ATTRIBUTE PaloAlto-Admin-Access-Domain 2 string ATTRIBUTE PaloAlto-Panorama-Admin-Role 3 string ATTRIBUTE PaloAlto-Panorama-Admin-Access-Domain 4 string ATTRIBUTE PaloAlto-User-Group 5 string END-VENDOR PaloAlto freeradius-server/share/dictionary.patton000066400000000000000000000174251257552170400212320ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2011 The FreeRADIUS Server project and contributors # # dictionary.patton # Dictionary for Patton IADs. # Written by Pawel Pierscionek # based on specifications available from vendor # # Version: @(#)dictionary.patton 5.00 urtho 20-Jan-2010 # Version: @(#)dictionary.patton 1.00 urtho 08-Sep-2006 # $Id$ VENDOR Patton 1768 BEGIN-VENDOR Patton ATTRIBUTE Patton-Setup-Time 32 string ATTRIBUTE Patton-Connect-Time 33 string ATTRIBUTE Patton-Disconnect-Time 34 string ATTRIBUTE Patton-Disconnect-Cause 35 integer ATTRIBUTE Patton-Disconnect-Source 36 string ATTRIBUTE Patton-Called-Unique-Id 48 string ATTRIBUTE Patton-Called-IP-Address 49 ipaddr ATTRIBUTE Patton-Called-Numbering-Plan 50 string ATTRIBUTE Patton-Called-Type-Of-Number 51 string ATTRIBUTE Patton-Called-Name 52 string ATTRIBUTE Patton-Called-Rx-Octets 64 integer ATTRIBUTE Patton-Called-Tx-Octets 65 integer ATTRIBUTE Patton-Called-Rx-Packets 66 integer ATTRIBUTE Patton-Called-Tx-Packets 67 integer ATTRIBUTE Patton-Called-Rx-Lost-Packets 68 integer ATTRIBUTE Patton-Called-Tx-Lost-Packets 69 integer ATTRIBUTE Patton-Called-Rx-Jitter 70 integer ATTRIBUTE Patton-Called-Tx-Jitter 71 integer ATTRIBUTE Patton-Called-Codec 72 string ATTRIBUTE Patton-Called-MOS 77 integer ATTRIBUTE Patton-Called-Round-Trip-Time 78 integer ATTRIBUTE Patton-Calling-Unique-Id 80 string ATTRIBUTE Patton-Calling-IP-Address 81 ipaddr ATTRIBUTE Patton-Calling-Numbering-Plan 82 string ATTRIBUTE Patton-Calling-Type-Of-Number 83 string ATTRIBUTE Patton-Calling-Presentation-Indicator 88 string ATTRIBUTE Patton-Calling-Screening-Indicator 89 string ATTRIBUTE Patton-Calling-Name 84 string ATTRIBUTE Patton-Calling-Rx-Octets 96 integer ATTRIBUTE Patton-Calling-Tx-Octets 97 integer ATTRIBUTE Patton-Calling-Rx-Packets 98 integer ATTRIBUTE Patton-Calling-Tx-Packets 99 integer ATTRIBUTE Patton-Calling-Lost-Tx-Packets 100 integer ATTRIBUTE Patton-Calling-Lost-Rx-Packets 101 integer ATTRIBUTE Patton-Calling-Rx-Jitter 102 integer ATTRIBUTE Patton-Calling-Tx-Jitter 103 integer ATTRIBUTE Patton-Calling-Codec 104 string ATTRIBUTE Patton-Calling-MOS 109 integer ATTRIBUTE Patton-Calling-Round-Trip-Time 110 integer VALUE Patton-Disconnect-Cause Valid-cause-code-not-yet-received 0x00 VALUE Patton-Disconnect-Cause Unallocated-runassigned-number 0x01 VALUE Patton-Disconnect-Cause No-route-to-specified-transit-network-WAN 0x02 VALUE Patton-Disconnect-Cause No-route-to-destination 0x03 VALUE Patton-Disconnect-Cause send-special-information-tone 0x04 VALUE Patton-Disconnect-Cause misdialled-trunk-prefix 0x05 VALUE Patton-Disconnect-Cause Channel-unacceptable 0x06 VALUE Patton-Disconnect-Cause Call-awarded-and-being-delivered-in-an-established-channel 0x07 VALUE Patton-Disconnect-Cause Prefix-0-dialed-but-not-allowed 0x08 VALUE Patton-Disconnect-Cause Prefix-1-dialed-but-not-allowed 0x09 VALUE Patton-Disconnect-Cause Prefix-1-dialed-but-not-required 0x0A VALUE Patton-Disconnect-Cause More-digits-received-than-allowed-call-is-proceeding 0x0B VALUE Patton-Disconnect-Cause Normal-call-clearing 0x10 VALUE Patton-Disconnect-Cause User-busy 0x11 VALUE Patton-Disconnect-Cause No-user-responding 0x12 VALUE Patton-Disconnect-Cause no-answer-from-user 0x13 VALUE Patton-Disconnect-Cause Call-rejected 0x15 VALUE Patton-Disconnect-Cause Number-changed 0x16 VALUE Patton-Disconnect-Cause Reverse-charging-rejected 0x17 VALUE Patton-Disconnect-Cause Call-suspended 0x18 VALUE Patton-Disconnect-Cause Call-resumed 0x19 VALUE Patton-Disconnect-Cause Non-selected-user-clearing 0x1A VALUE Patton-Disconnect-Cause Destination-out-of-order 0x1B VALUE Patton-Disconnect-Cause Invalid-number-format-incomplete-number 0x1C VALUE Patton-Disconnect-Cause Facility-rejected 0x1D VALUE Patton-Disconnect-Cause Response-to-STATUS-ENQUIRY 0x1E VALUE Patton-Disconnect-Cause Normal-unspecified 0x1F VALUE Patton-Disconnect-Cause Circuit-out-of-order 0x21 VALUE Patton-Disconnect-Cause No-circuit/channel-available 0x22 VALUE Patton-Disconnect-Cause Destination-unattainable 0x23 VALUE Patton-Disconnect-Cause Degraded-service 0x25 VALUE Patton-Disconnect-Cause Network-WAN-out-of-order 0x26 VALUE Patton-Disconnect-Cause Transit-delay-range-cannot-be-achieved 0x27 VALUE Patton-Disconnect-Cause Throughput-range-cannot-be-achieved 0x28 VALUE Patton-Disconnect-Cause Temporary-failure 0x29 VALUE Patton-Disconnect-Cause Switching-equipment-congestion 0x2A VALUE Patton-Disconnect-Cause Access-information-discarded 0x2B VALUE Patton-Disconnect-Cause Requested-circuit-channel-not-available 0x2C VALUE Patton-Disconnect-Cause Pre-empted 0x2D VALUE Patton-Disconnect-Cause Precedence-call-blocked 0x2E VALUE Patton-Disconnect-Cause Resource-unavailable-unspecified 0x2F VALUE Patton-Disconnect-Cause Quality-of-service-unavailable 0x31 VALUE Patton-Disconnect-Cause Requested-facility-not-subscribed 0x32 VALUE Patton-Disconnect-Cause Reverse-charging-not-allowed 0x33 VALUE Patton-Disconnect-Cause Outgoing-calls-barred 0x34 VALUE Patton-Disconnect-Cause Outgoing-calls-barred-within-CUG 0x35 VALUE Patton-Disconnect-Cause Incoming-calls-barred 0x36 VALUE Patton-Disconnect-Cause Incoming-calls-barred-within-CUG 0x37 VALUE Patton-Disconnect-Cause Call-waiting-not-subscribed 0x38 VALUE Patton-Disconnect-Cause Bearer-capability-not-authorized 0x39 VALUE Patton-Disconnect-Cause Bearer-capability-not-presently-available 0x3A VALUE Patton-Disconnect-Cause Service-or-option-not-available-unspecified 0x3F VALUE Patton-Disconnect-Cause Bearer-service-not-implemented 0x41 VALUE Patton-Disconnect-Cause Channel-type-not-implemented 0x42 VALUE Patton-Disconnect-Cause Transit-network-selection-not-implemented 0x43 VALUE Patton-Disconnect-Cause Message-not-implemented 0x44 VALUE Patton-Disconnect-Cause Requested-facility-not-implemented 0x45 VALUE Patton-Disconnect-Cause Only-restricted-digital-information-bearer-capability-is-avail 0x46 VALUE Patton-Disconnect-Cause Service-or-option-not-implemented-unspecified 0x4F VALUE Patton-Disconnect-Cause Invalid-call-reference-value 0x51 VALUE Patton-Disconnect-Cause Identified-channel-does-not-exist 0x52 VALUE Patton-Disconnect-Cause A-suspended-call-exists-but-this-call-identity-does-not 0x53 VALUE Patton-Disconnect-Cause Call-identity-in-use 0x54 VALUE Patton-Disconnect-Cause No-call-suspended 0x55 VALUE Patton-Disconnect-Cause Call-having-the-requested-call-identity-has-been-cleared 0x56 VALUE Patton-Disconnect-Cause Called-user-not-member-of-CUG 0x57 VALUE Patton-Disconnect-Cause Incompatible-destination 0x58 VALUE Patton-Disconnect-Cause Non-existent-abbreviated-address-entry 0x59 VALUE Patton-Disconnect-Cause Destination-address-missing-and-direct-call-not-subscribed 0x5A VALUE Patton-Disconnect-Cause Invalid-transit-network-selection-national-use 0x5B VALUE Patton-Disconnect-Cause Invalid-facility-parameter 0x5C VALUE Patton-Disconnect-Cause Mandatory-information-element-is-missing 0x5D VALUE Patton-Disconnect-Cause Invalid-message-unspecified 0x5F VALUE Patton-Disconnect-Cause Mandatory-information-element-is-missing-2 0x60 VALUE Patton-Disconnect-Cause Message-type-non-existent-or-not-implemented 0x61 VALUE Patton-Disconnect-Cause Message-not-compatible-with-call-state 0x62 VALUE Patton-Disconnect-Cause information-element-nonexistant-or-not-implemented 0x63 VALUE Patton-Disconnect-Cause Invalid-information-element-contents 0x64 VALUE Patton-Disconnect-Cause Message-not-compatible-with-call-state-2 0x65 VALUE Patton-Disconnect-Cause Recovery-on-timer-expiry 0x66 VALUE Patton-Disconnect-Cause parameter-non-existent-or-not-implemented-passed-on 0x67 VALUE Patton-Disconnect-Cause Protocol-error-unspecified 0x6F VALUE Patton-Disconnect-Cause Internetworking-unspecified 0x7F END-VENDOR Patton freeradius-server/share/dictionary.propel000066400000000000000000000007001257552170400212120ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2011 The FreeRADIUS Server project and contributors # # Found on the net. # # $Id$ # VENDOR Propel 14895 BEGIN-VENDOR Propel ATTRIBUTE Propel-Accelerate 1 integer ATTRIBUTE Propel-Dialed-Digits 2 string ATTRIBUTE Propel-Client-IP-Address 3 ipaddr ATTRIBUTE Propel-Client-NAS-IP-Address 4 ipaddr ATTRIBUTE Propel-Client-Source-ID 5 integer ATTRIBUTE Propel-Content-Filter-ID 6 integer END-VENDOR Propel freeradius-server/share/dictionary.prosoft000066400000000000000000000024001257552170400214040ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2011 The FreeRADIUS Server project and contributors ############################################################################## # # Prosoft, as posted to the list. # # $Id$ # ############################################################################## VENDOR Prosoft 4735 # # Custom Prosoft attributes. # BEGIN-VENDOR Prosoft ATTRIBUTE Prosoft-Home-Agent-Address 0 ipaddr ATTRIBUTE Prosoft-Default-Gateway 1 ipaddr ATTRIBUTE Prosoft-Primary-DNS 2 ipaddr ATTRIBUTE Prosoft-Secondary-DNS 3 ipaddr ATTRIBUTE Prosoft-Security-Parameter-Index 4 integer ATTRIBUTE Prosoft-Security-Key 5 string ATTRIBUTE Prosoft-MAC-Address 7 string ATTRIBUTE Prosoft-Authentication-Reason 8 integer ATTRIBUTE Prosoft-ATM-Interface 9 integer ATTRIBUTE Prosoft-ATM-VPI 10 integer ATTRIBUTE Prosoft-ATM-VCI 11 integer ATTRIBUTE Prosoft-RSC-Identifier 12 string ATTRIBUTE Prosoft-NPM-Identifier 13 string ATTRIBUTE Prosoft-NPM-IP 14 string ATTRIBUTE Prosoft-Sector-ID 15 string ATTRIBUTE Prosoft-Auth-Role 16 integer VALUE Prosoft-Auth-Role Read-Status 0 VALUE Prosoft-Auth-Role Read-Config 1 VALUE Prosoft-Auth-Role Read-Write 2 VALUE Prosoft-Auth-Role Admin 3 VALUE Prosoft-Auth-Role Super-user 4 END-VENDOR Prosoft freeradius-server/share/dictionary.proxim000066400000000000000000000060561257552170400212410ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2012 The FreeRADIUS Server project and contributors # # Dictionary for Proxim Wireless. # # $Id$ # VENDOR Proxim 841 BEGIN-VENDOR Proxim # SU Management VLAN and Ethernet 1 VLAN parameters ATTRIBUTE Proxim_E1_VLAN_MODE 4 integer ATTRIBUTE Proxim_SU_VLAN_NAME 5 string ATTRIBUTE Proxim_E1_Access_VLAN_ID 6 integer ATTRIBUTE Proxim_E1_Access_VLAN_Pri 7 integer ATTRIBUTE Proxim_Mgmt_VLAN_ID 8 integer ATTRIBUTE Proxim_Mgmt_VLAN_Pri 9 integer ATTRIBUTE Proxim_E1_TrunkID_01 10 integer ATTRIBUTE Proxim_E1_TrunkID_02 11 integer ATTRIBUTE Proxim_E1_TrunkID_03 12 integer ATTRIBUTE Proxim_E1_TrunkID_04 13 integer ATTRIBUTE Proxim_E1_TrunkID_05 14 integer ATTRIBUTE Proxim_E1_TrunkID_06 15 integer ATTRIBUTE Proxim_E1_TrunkID_07 16 integer ATTRIBUTE Proxim_E1_TrunkID_08 17 integer ATTRIBUTE Proxim_E1_TrunkID_09 18 integer ATTRIBUTE Proxim_E1_TrunkID_10 19 integer ATTRIBUTE Proxim_E1_TrunkID_11 20 integer ATTRIBUTE Proxim_E1_TrunkID_12 21 integer ATTRIBUTE Proxim_E1_TrunkID_13 22 integer ATTRIBUTE Proxim_E1_TrunkID_14 23 integer ATTRIBUTE Proxim_E1_TrunkID_15 24 integer ATTRIBUTE Proxim_E1_TrunkID_16 25 integer ATTRIBUTE Proxim_SU_VLAN_Table_Status 26 integer ATTRIBUTE Proxim_Service_VLAN_ID 32 integer ATTRIBUTE Proxim_Service_VLAN_Pri 33 integer # QoS Attributes ATTRIBUTE Proxim_QoS_Class_Index 34 integer ATTRIBUTE Proxim_QoS_Class_SU_Status 35 integer # The attributes listed above are applicable to Tsunami MP/QB 8XXX # series and MP.11/QB.11 series products. While, the attributes listed # below are applicable to Tsunami MP/QB 8XXX series products only. # SU Ethernet 2 VLAN parameters ATTRIBUTE Proxim_E2_VLAN_MODE 40 integer ATTRIBUTE Proxim_E2_Access_VLAN_ID 41 integer ATTRIBUTE Proxim_E2_Access_VLAN_Pri 42 integer ATTRIBUTE Proxim_E2_TrunkID_01 43 integer ATTRIBUTE Proxim_E2_TrunkID_02 44 integer ATTRIBUTE Proxim_E2_TrunkID_03 45 integer ATTRIBUTE Proxim_E2_TrunkID_04 46 integer ATTRIBUTE Proxim_E2_TrunkID_05 47 integer ATTRIBUTE Proxim_E2_TrunkID_06 48 integer ATTRIBUTE Proxim_E2_TrunkID_07 49 integer ATTRIBUTE Proxim_E2_TrunkID_08 50 integer ATTRIBUTE Proxim_E2_TrunkID_09 51 integer ATTRIBUTE Proxim_E2_TrunkID_10 52 integer ATTRIBUTE Proxim_E2_TrunkID_11 53 integer ATTRIBUTE Proxim_E2_TrunkID_12 54 integer ATTRIBUTE Proxim_E2_TrunkID_13 55 integer ATTRIBUTE Proxim_E2_TrunkID_14 56 integer ATTRIBUTE Proxim_E2_TrunkID_15 57 integer ATTRIBUTE Proxim_E2_TrunkID_16 58 integer # QinQ VLAN Attributes ATTRIBUTE Proxim_QinQ_Status 59 integer ATTRIBUTE Proxim_Service_VLAN_TPID 60 integer # Trunk mode Port VLAN ID ATTRIBUTE Proxim_E1_Port_VLAN_ID 61 integer ATTRIBUTE Proxim_E1_Port_VLAN_Pri 62 integer ATTRIBUTE Proxim_E1_Allow_Untag 63 integer ATTRIBUTE Proxim_E2_Port_VLAN_ID 64 integer ATTRIBUTE Proxim_E2_Port_VLAN_Pri 65 integer ATTRIBUTE Proxim_E2_Allow_Untag 66 integer # Access Mode Allow untagged traffic ATTRIBUTE Proxim_E1_SU_Allow_Untag_Mgmt 68 integer ATTRIBUTE Proxim_E2_SU_Allow_Untag_Mgmt 69 integer END-VENDOR Proxim freeradius-server/share/dictionary.purewave000066400000000000000000000027361257552170400215620ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2011 The FreeRADIUS Server project and contributors # # Purewave Networks Base Station # # $Id$ # VENDOR Purewave 21074 BEGIN-VENDOR Purewave ATTRIBUTE Purewave-Client-Profile 1 integer ATTRIBUTE Purewave-CS-Type 2 integer ATTRIBUTE Purewave-Max-Downlink-Rate 3 integer ATTRIBUTE Purewave-Max-Uplink-Rate 4 integer # the following two attributes are needed when cs-Type is IPV4_CS # ATTRIBUTE Purewave-IP-Address 5 ipaddr ATTRIBUTE Purewave-IP-Netmask 6 ipaddr # # Attribute Purewave-Service-Enable (optional parameter) # Purpose Enable or Disable service # Range 0-1 # Default value 1 # ATTRIBUTE Purewave-Service-Enable 7 integer VALUE Purewave-CS-Type ETHERNET_CS 1 VALUE Purewave-CS-Type IPV4_CS 0 VALUE Purewave-Max-Downlink-Rate QPSK_1/2 3 VALUE Purewave-Max-Downlink-Rate QPSK_3/4 4 VALUE Purewave-Max-Downlink-Rate QAM16_1/2 5 VALUE Purewave-Max-Downlink-Rate QAM16_3/4 6 VALUE Purewave-Max-Downlink-Rate QAM64_1/2 7 VALUE Purewave-Max-Downlink-Rate QAM64_2/3 8 VALUE Purewave-Max-Downlink-Rate QAM64_3/4 9 VALUE Purewave-Max-Downlink-Rate QAM64_5/6 10 VALUE Purewave-Max-Uplink-Rate QPSK_1/2 3 VALUE Purewave-Max-Uplink-Rate QPSK_3/4 4 VALUE Purewave-Max-Uplink-Rate QAM16_1/2 5 VALUE Purewave-Max-Uplink-Rate QAM16_3/4 6 VALUE Purewave-Max-Uplink-Rate QAM64_1/2 7 VALUE Purewave-Max-Uplink-Rate QAM64_2/3 8 VALUE Purewave-Max-Uplink-Rate QAM64_3/4 9 VALUE Purewave-Max-Uplink-Rate QAM64_5/6 10 END-VENDOR Purewave freeradius-server/share/dictionary.quiconnect000066400000000000000000000007441257552170400220710ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2011 The FreeRADIUS Server project and contributors ############################################################################## # # Quiconnect VSA's. # # $Id$ # ############################################################################## VENDOR Quiconnect 14436 BEGIN-VENDOR Quiconnect ATTRIBUTE Quiconnect-AVPair 1 string ATTRIBUTE Quiconnect-VNP-Information 2 string ATTRIBUTE Quiconnect-HSP-Information 3 string END-VENDOR Quiconnect freeradius-server/share/dictionary.quintum000066400000000000000000000027411257552170400214220ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2011 The FreeRADIUS Server project and contributors # # dictionary.quintum # # Copied mostly from the Cisco dictionary, by # Jeremy McNamara # # Version: $Id$ # VENDOR Quintum 6618 # # Standard attribute # BEGIN-VENDOR Quintum ATTRIBUTE Quintum-AVPair 1 string ATTRIBUTE Quintum-NAS-Port 2 string # # Voice over IP attributes. # ATTRIBUTE Quintum-h323-remote-address 23 string ATTRIBUTE Quintum-h323-conf-id 24 string ATTRIBUTE Quintum-h323-setup-time 25 string ATTRIBUTE Quintum-h323-call-origin 26 string ATTRIBUTE Quintum-h323-call-type 27 string ATTRIBUTE Quintum-h323-connect-time 28 string ATTRIBUTE Quintum-h323-disconnect-time 29 string ATTRIBUTE Quintum-h323-disconnect-cause 30 string ATTRIBUTE Quintum-h323-voice-quality 31 string ATTRIBUTE Quintum-h323-gw-id 33 string ATTRIBUTE Quintum-h323-incoming-conf-id 35 string ATTRIBUTE Quintum-h323-credit-amount 101 string ATTRIBUTE Quintum-h323-credit-time 102 string ATTRIBUTE Quintum-h323-return-code 103 string ATTRIBUTE Quintum-h323-prompt-id 104 string ATTRIBUTE Quintum-h323-time-and-day 105 string ATTRIBUTE Quintum-h323-redirect-number 106 string ATTRIBUTE Quintum-h323-preferred-lang 107 string ATTRIBUTE Quintum-h323-redirect-ip-address 108 string ATTRIBUTE Quintum-h323-billing-model 109 string ATTRIBUTE Quintum-h323-currency-type 110 string ATTRIBUTE Quintum-Trunkid-In 230 string ATTRIBUTE Quintum-Trunkid-Out 231 string END-VENDOR Quintum freeradius-server/share/dictionary.redback000066400000000000000000000653051257552170400213200ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2011 The FreeRADIUS Server project and contributors # # Redback dictionary. # # Version: 1.00 14-Sep-2000 Chris Adams # $Id$ # VENDOR Redback 2352 # # Redback Vendor Specific Extensions # # The first set here uses '_' as the separator, as Redback has changed # their documentation to use '-' vs. '_'. The older '_' style entries # are listed first so that they will still be accepted, # yet not preferred. # # # Redback Vendor Specific Extensions ( older style syntax ) # # The names use underscores (_) instead of dashes (-), because # that's what Redback used in their older documentation and examples. # BEGIN-VENDOR Redback ATTRIBUTE Client_DNS_Pri 1 ipaddr ATTRIBUTE Client_DNS_Sec 2 ipaddr ATTRIBUTE DHCP_Max_Leases 3 integer ATTRIBUTE Context_Name 4 string ATTRIBUTE Bridge_Group 5 string ATTRIBUTE BG_Aging_Time 6 string ATTRIBUTE BG_Path_Cost 7 string ATTRIBUTE BG_Span_Dis 8 string ATTRIBUTE BG_Trans_BPDU 9 string ATTRIBUTE Rate_Limit_Rate 10 integer ATTRIBUTE Rate_Limit_Burst 11 integer ATTRIBUTE Police_Rate 12 integer ATTRIBUTE Police_Burst 13 integer ATTRIBUTE Source_Validation 14 integer ATTRIBUTE Tunnel_Domain 15 integer ATTRIBUTE Tunnel_Local_Name 16 string ATTRIBUTE Tunnel_Remote_Name 17 string ATTRIBUTE Tunnel_Function 18 integer ATTRIBUTE Tunnel-Flow-Control 19 integer ATTRIBUTE Tunnel-Static 20 integer ATTRIBUTE Tunnel_Max_Sessions 21 integer ATTRIBUTE Tunnel_Max_Tunnels 22 integer ATTRIBUTE Tunnel_Session_Auth 23 integer ATTRIBUTE Tunnel_Window 24 integer ATTRIBUTE Tunnel_Retransmit 25 integer ATTRIBUTE Tunnel_Cmd_Timeout 26 integer ATTRIBUTE PPPOE_URL 27 string ATTRIBUTE PPPOE_MOTM 28 string ATTRIBUTE Tunnel_Group 29 integer ATTRIBUTE Tunnel_Context 30 string ATTRIBUTE Tunnel_Algorithm 31 integer ATTRIBUTE Tunnel_Deadtime 32 integer ATTRIBUTE Mcast_Send 33 integer ATTRIBUTE Mcast_Receive 34 integer ATTRIBUTE Mcast_MaxGroups 35 integer ATTRIBUTE Ip_Address_Pool_Name 36 string ATTRIBUTE Tunnel_DNIS 37 integer ATTRIBUTE Medium_Type 38 integer ATTRIBUTE PVC_Encapsulation_Type 39 integer ATTRIBUTE PVC_Profile_Name 40 string ATTRIBUTE PVC_Circuit_Padding 41 integer ATTRIBUTE Bind_Type 42 integer ATTRIBUTE Bind_Auth_Protocol 43 integer ATTRIBUTE Bind_Auth_Max_Sessions 44 integer ATTRIBUTE Bind_Bypass_Bypass 45 string ATTRIBUTE Bind_Auth_Context 46 string ATTRIBUTE Bind_Auth_Service_Grp 47 string ATTRIBUTE Bind_Bypass_Context 48 string ATTRIBUTE Bind_Int_Context 49 string ATTRIBUTE Bind_Tun_Context 50 string ATTRIBUTE Bind_Ses_Context 51 string ATTRIBUTE Bind_Dot1q_Slot 52 integer ATTRIBUTE Bind_Dot1q_Port 53 integer ATTRIBUTE Bind_Dot1q_Vlan_Tag_Id 54 integer ATTRIBUTE Bind_Int_Interface_Name 55 string ATTRIBUTE Bind_L2TP_Tunnel_Name 56 string ATTRIBUTE Bind_L2TP_Flow_Control 57 integer ATTRIBUTE Bind_Sub_User_At_Context 58 string ATTRIBUTE Bind_Sub_Password 59 string ATTRIBUTE Ip_Host_Addr 60 string ATTRIBUTE IP_TOS_Field 61 integer ATTRIBUTE NAS_Real_Port 62 integer ATTRIBUTE Tunnel_Session_Auth_Ctx 63 string ATTRIBUTE Tunnel_Session_Auth_Service_Grp 64 string ATTRIBUTE Tunnel_Rate_Limit_Rate 65 integer ATTRIBUTE Tunnel_Rate_Limit_Burst 66 integer ATTRIBUTE Tunnel_Police_Rate 67 integer ATTRIBUTE Tunnel_Police_Burst 68 integer ATTRIBUTE Tunnel_L2F_Second_Password 69 string ATTRIBUTE ACL-Definition 70 string ATTRIBUTE PPPoE-IP-Route-Add 71 string ATTRIBUTE TTY_Level_Max 72 integer ATTRIBUTE TTY_Level_Start 73 integer ATTRIBUTE Bind-DHCP-Context 76 string ATTRIBUTE Tunnel-Mobil-Group 77 string ATTRIBUTE Tunnel-Client-VPN 78 string ATTRIBUTE Tunnel-Server-VPN 79 string ATTRIBUTE PPP-Compression 84 integer ATTRIBUTE Tunnel-Hello-Timer 85 integer has_tag ATTRIBUTE Redback-Reason 86 integer ATTRIBUTE Qos-Policy-Policing 87 string ATTRIBUTE Qos-Policy-Metering 88 string ATTRIBUTE Qos-Policy-Queuing 89 string ATTRIBUTE Igmp-Service-Profile 90 string ATTRIBUTE Sub-Profile-Name 91 string ATTRIBUTE Forward-Policy 92 string ATTRIBUTE Remote-Port 93 string ATTRIBUTE Reauth-String 94 string ATTRIBUTE Reauth-More 95 integer # # These next 2 seem to be copies of the DHCP options... # ATTRIBUTE Agent-Remote-Id 96 octets ATTRIBUTE Agent-Circuit-Id 97 octets ATTRIBUTE Platform-Type 98 integer ATTRIBUTE RB-Client-NBNS-Pri 99 ipaddr ATTRIBUTE RB-Client-NBNS-Sec 100 ipaddr ATTRIBUTE Shaping-Profile-Name 101 string ATTRIBUTE Bridge-Profile 103 string ATTRIBUTE IP-Interface 104 string ATTRIBUTE NAT-Policy-Name 105 string ATTRIBUTE RB-NPM-Service-Id 106 string ATTRIBUTE HTTP-Redirect-Profile-Name 107 string ATTRIBUTE Bind-Auto-Sub-User 108 string ATTRIBUTE Bind-Auto-Sub-Context 109 string ATTRIBUTE Bind-Auto-Sub-Password 110 string ATTRIBUTE Circuit-Protocol-Encap 111 integer ATTRIBUTE OS-Version 112 string ATTRIBUTE Session-Traffic-Limit 113 string ATTRIBUTE QOS-Reference 114 string ATTRIBUTE DHCP-Vendor-Class-ID 125 string ATTRIBUTE Qos-Rate 126 string ATTRIBUTE DHCP-Vendor-Encap-Option 127 string ATTRIBUTE Acct_Input_Octets_64 128 octets ATTRIBUTE Acct_Output_Octets_64 129 octets ATTRIBUTE Acct_Input_Packets_64 130 octets ATTRIBUTE Acct_Output_Packets_64 131 octets ATTRIBUTE Assigned_IP_Address 132 ipaddr ATTRIBUTE Acct_Mcast_In_Octets 133 integer ATTRIBUTE Acct_Mcast_Out_Octets 134 integer ATTRIBUTE Acct_Mcast_In_Packets 135 integer ATTRIBUTE Acct_Mcast_Out_Packets 136 integer ATTRIBUTE LAC_Port 137 integer ATTRIBUTE LAC_Real_Port 138 integer ATTRIBUTE LAC_Port_Type 139 integer ATTRIBUTE LAC_Real_Port_Type 140 integer ATTRIBUTE Acct_Dyn_Ac_Ent 141 string ATTRIBUTE Session_Error_Code 142 integer ATTRIBUTE Session_Error_Msg 143 string VALUE PVC_Encapsulation_Type AAA_ENCAPS_ATM_RAW 1 VALUE PVC_Encapsulation_Type AAA_ENCAPS_ATM_ROUTE1483 2 VALUE PVC_Encapsulation_Type AAA_ENCAPS_ATM_AUTO1483 3 VALUE PVC_Encapsulation_Type AAA_ENCAPS_ATM_MULTI 4 VALUE PVC_Encapsulation_Type AAA_ENCAPS_ATM_BRIDGE1483 5 VALUE PVC_Encapsulation_Type AAA_ENCAPS_ATM_PPP 6 VALUE PVC_Encapsulation_Type AAA_ENCAPS_ATM_PPP_SERIAL 7 VALUE PVC_Encapsulation_Type AAA_ENCAPS_ATM_PPP_NLPID 8 VALUE PVC_Encapsulation_Type AAA_ENCAPS_ATM_PPP_AUTO 9 VALUE PVC_Encapsulation_Type AAA_ENCAPS_ATM_PPPOE 10 VALUE PVC_Encapsulation_Type AAA_ENCAPS_ATM_L2TP 11 VALUE PVC_Encapsulation_Type AAA_ENCAPS_ATM_PPP_LLC 12 VALUE PVC_Encapsulation_Type AAA_ENCAPS_FRAME_AUTO1490 13 VALUE PVC_Encapsulation_Type AAA_ENCAPS_FRAME_MULTI 14 VALUE PVC_Encapsulation_Type AAA_ENCAPS_FRAME_BRIDGE1490 15 VALUE PVC_Encapsulation_Type AAA_ENCAPS_FRAME_PPP 16 VALUE PVC_Encapsulation_Type AAA_ENCAPS_FRAME_PPP_AUTO 17 VALUE PVC_Encapsulation_Type AAA_ENCAPS_FRAME_PPPOE 18 VALUE PVC_Encapsulation_Type AAA_ENCAPS_FRAME_ROUTE1490 19 VALUE PVC_Encapsulation_Type AAA_ENCAPS_FRAME_L2TP 20 VALUE PVC_Encapsulation_Type AAA_ENCAPS_L2TP_VC_MUXED 21 VALUE PVC_Encapsulation_Type AAA_ENCAPS_ETH 22 VALUE PVC_Encapsulation_Type AAA_ENCAPS_ETH_PPPOE 23 VALUE PVC_Encapsulation_Type AAA_ENCAPS_ETH_MULTI 24 VALUE PVC_Circuit_Padding AAA_CIRCUIT_PADDING 1 VALUE PVC_Circuit_Padding AAA_CIRCUIT_NO_PADDING 2 VALUE Bind_Type AAA_AUTH_BIND 1 VALUE Bind_Type AAA_BYPASS_BIND 2 VALUE Bind_Type AAA_INTERFACE_BIND 3 VALUE Bind_Type AAA_SUBSCRIBE_BIND 4 VALUE Bind_Type AAA_TUNNEL_BIND 5 VALUE Bind_Type AAA_SESSION_BIND 6 VALUE Bind_Type AAA_Q8021_BIND 7 VALUE Bind_Type AAA_MULTI_BIND 8 VALUE Bind_Auth_Protocol AAA_PPP_PAP 1 VALUE Bind_Auth_Protocol AAA_PPP_CHAP 2 VALUE Bind_Auth_Protocol AAA_PPP_CHAP_WAIT 3 VALUE Bind_Auth_Protocol AAA_PPP_CHAP_PAP 4 VALUE Bind_Auth_Protocol AAA_PPP_CHAP_WAIT_PAP 5 VALUE Tunnel_Function LAC-Only 1 VALUE Tunnel_Function LNS-Only 2 VALUE Tunnel_Function LAC-LNS 3 VALUE Tunnel_Session_Auth CHAP 1 VALUE Tunnel_Session_Auth PAP 2 VALUE Tunnel_Session_Auth CHAP-PAP 3 VALUE Mcast_Send NO-SEND 1 VALUE Mcast_Send SEND 2 VALUE Mcast_Send UNSOLICITED-SEND 3 VALUE Mcast_Receive NO-RECEIVE 1 VALUE Mcast_Receive RECEIVE 2 VALUE Tunnel_DNIS DNIS 1 VALUE Tunnel_DNIS DNIS-Only 2 VALUE LAC_Port_Type NAS_PORT_TYPE_10BT 40 VALUE LAC_Port_Type NAS_PORT_TYPE_100BT 41 VALUE LAC_Port_Type NAS_PORT_TYPE_DS3_FR 42 VALUE LAC_Port_Type NAS_PORT_TYPE_DS3_ATM 43 VALUE LAC_Port_Type NAS_PORT_TYPE_OC3 44 VALUE LAC_Port_Type NAS_PORT_TYPE_HSSI 45 VALUE LAC_Port_Type NAS_PORT_TYPE_EIA530 46 VALUE LAC_Port_Type NAS_PORT_TYPE_T1 47 VALUE LAC_Port_Type NAS_PORT_TYPE_CHAN_T3 48 VALUE LAC_Port_Type NAS_PORT_TYPE_DS1_FR 49 VALUE LAC_Port_Type NAS_PORT_TYPE_E3_ATM 50 VALUE LAC_Port_Type NAS_PORT_TYPE_IMA_ATM 51 VALUE LAC_Port_Type NAS_PORT_TYPE_DS3_ATM_2 52 VALUE LAC_Port_Type NAS_PORT_TYPE_OC3_ATM_2 53 VALUE LAC_Port_Type NAS_PORT_TYPE_1000BSX 54 VALUE LAC_Port_Type NAS_PORT_TYPE_E1_FR 55 VALUE LAC_Port_Type NAS_PORT_TYPE_E1_ATM 56 VALUE LAC_Port_Type NAS_PORT_TYPE_E3_FR 57 VALUE LAC_Port_Type NAS_PORT_TYPE_OC3_POS 58 VALUE LAC_Port_Type NAS_PORT_TYPE_OC12_POS 59 VALUE LAC_Port_Type NAS_PORT_TYPE_PPPOE 60 VALUE LAC_Real_Port_Type NAS_PORT_TYPE_10BT 40 VALUE LAC_Real_Port_Type NAS_PORT_TYPE_100BT 41 VALUE LAC_Real_Port_Type NAS_PORT_TYPE_DS3_FR 42 VALUE LAC_Real_Port_Type NAS_PORT_TYPE_DS3_ATM 43 VALUE LAC_Real_Port_Type NAS_PORT_TYPE_OC3 44 VALUE LAC_Real_Port_Type NAS_PORT_TYPE_HSSI 45 VALUE LAC_Real_Port_Type NAS_PORT_TYPE_EIA530 46 VALUE LAC_Real_Port_Type NAS_PORT_TYPE_T1 47 VALUE LAC_Real_Port_Type NAS_PORT_TYPE_CHAN_T3 48 VALUE LAC_Real_Port_Type NAS_PORT_TYPE_DS1_FR 49 VALUE LAC_Real_Port_Type NAS_PORT_TYPE_E3_ATM 50 VALUE LAC_Real_Port_Type NAS_PORT_TYPE_IMA_ATM 51 VALUE LAC_Real_Port_Type NAS_PORT_TYPE_DS3_ATM_2 52 VALUE LAC_Real_Port_Type NAS_PORT_TYPE_OC3_ATM_2 53 VALUE LAC_Real_Port_Type NAS_PORT_TYPE_1000BSX 54 VALUE LAC_Real_Port_Type NAS_PORT_TYPE_E1_FR 55 VALUE LAC_Real_Port_Type NAS_PORT_TYPE_E1_ATM 56 VALUE LAC_Real_Port_Type NAS_PORT_TYPE_E3_FR 57 VALUE LAC_Real_Port_Type NAS_PORT_TYPE_OC3_POS 58 VALUE LAC_Real_Port_Type NAS_PORT_TYPE_OC12_POS 59 VALUE LAC_Real_Port_Type NAS_PORT_TYPE_PPPOE 60 # # New names. # ATTRIBUTE Client-DNS-Pri 1 ipaddr ATTRIBUTE Client-DNS-Sec 2 ipaddr ATTRIBUTE DHCP-Max-Leases 3 integer ATTRIBUTE Context-Name 4 string ATTRIBUTE Bridge-Group 5 string ATTRIBUTE BG-Aging-Time 6 string ATTRIBUTE BG-Path-Cost 7 string ATTRIBUTE BG-Span-Dis 8 string ATTRIBUTE BG-Trans-BPDU 9 string ATTRIBUTE Rate-Limit-Rate 10 integer ATTRIBUTE Rate-Limit-Burst 11 integer ATTRIBUTE Police-Rate 12 integer ATTRIBUTE Police-Burst 13 integer ATTRIBUTE Source-Validation 14 integer ATTRIBUTE Tunnel-Domain 15 integer ATTRIBUTE Tunnel-Local-Name 16 string ATTRIBUTE Tunnel-Remote-Name 17 string ATTRIBUTE Tunnel-Function 18 integer ATTRIBUTE Tunnel-Flow-Control 19 integer ATTRIBUTE Tunnel-Static 20 integer ATTRIBUTE Tunnel-Max-Sessions 21 integer ATTRIBUTE Tunnel-Max-Tunnels 22 integer ATTRIBUTE Tunnel-Session-Auth 23 integer ATTRIBUTE Tunnel-Window 24 integer ATTRIBUTE Tunnel-Retransmit 25 integer ATTRIBUTE Tunnel-Cmd-Timeout 26 integer ATTRIBUTE PPPOE-URL 27 string ATTRIBUTE PPPOE-MOTM 28 string ATTRIBUTE Tunnel-Group 29 integer ATTRIBUTE Tunnel-Context 30 string ATTRIBUTE Tunnel-Algorithm 31 integer ATTRIBUTE Tunnel-Deadtime 32 integer ATTRIBUTE Mcast-Send 33 integer ATTRIBUTE Mcast-Receive 34 integer ATTRIBUTE Mcast-MaxGroups 35 integer ATTRIBUTE Ip-Address-Pool-Name 36 string ATTRIBUTE Tunnel-DNIS 37 integer ATTRIBUTE Medium-Type 38 integer ATTRIBUTE PVC-Encapsulation-Type 39 integer ATTRIBUTE PVC-Profile-Name 40 string ATTRIBUTE PVC-Circuit-Padding 41 integer ATTRIBUTE Bind-Type 42 integer ATTRIBUTE Bind-Auth-Protocol 43 integer ATTRIBUTE Bind-Auth-Max-Sessions 44 integer ATTRIBUTE Bind-Bypass-Bypass 45 string ATTRIBUTE Bind-Auth-Context 46 string ATTRIBUTE Bind-Auth-Service-Grp 47 string ATTRIBUTE Bind-Bypass-Context 48 string ATTRIBUTE Bind-Int-Context 49 string ATTRIBUTE Bind-Tun-Context 50 string ATTRIBUTE Bind-Ses-Context 51 string ATTRIBUTE Bind-Dot1q-Slot 52 integer ATTRIBUTE Bind-Dot1q-Port 53 integer ATTRIBUTE Bind-Dot1q-Vlan-Tag-Id 54 integer ATTRIBUTE Bind-Int-Interface-Name 55 string ATTRIBUTE Bind-L2TP-Tunnel-Name 56 string ATTRIBUTE Bind-L2TP-Flow-Control 57 integer ATTRIBUTE Bind-Sub-User-At-Context 58 string ATTRIBUTE Bind-Sub-Password 59 string ATTRIBUTE Ip-Host-Addr 60 string ATTRIBUTE IP-TOS-Field 61 integer ATTRIBUTE NAS-Real-Port 62 integer ATTRIBUTE Tunnel-Session-Auth-Ctx 63 string ATTRIBUTE Tunnel-Session-Auth-Service-Grp 64 string ATTRIBUTE Tunnel-Rate-Limit-Rate 65 integer ATTRIBUTE Tunnel-Rate-Limit-Burst 66 integer ATTRIBUTE Tunnel-Police-Rate 67 integer ATTRIBUTE Tunnel-Police-Burst 68 integer ATTRIBUTE Tunnel-L2F-Second-Password 69 string ATTRIBUTE ACL-Definition 70 string ATTRIBUTE PPPoE-IP-Route-Add 71 string ATTRIBUTE TTY-Level-Max 72 integer ATTRIBUTE TTY-Level-Start 73 integer ATTRIBUTE Tunnel-Checksum 74 integer ATTRIBUTE Tunnel-Profile 75 string ATTRIBUTE Tunnel-Client-VPN 78 string ATTRIBUTE Tunnel-Server-VPN 79 string ATTRIBUTE Tunnel-Client-Rhost 80 string ATTRIBUTE Tunnel-Server-Rhost 81 string ATTRIBUTE Tunnel-Client-Int-Addr 82 ipaddr ATTRIBUTE Tunnel-Server-Int-Addr 83 ipaddr ATTRIBUTE PPP-Compression 84 integer ATTRIBUTE Tunnel-Hello-Timer 85 integer has_tag ATTRIBUTE Redback-Reason 86 integer ATTRIBUTE Qos-Policing-Profile-Name 87 string ATTRIBUTE Qos-Metering-Profile-Name 88 string ATTRIBUTE Qos-Policy-Queuing 89 string ATTRIBUTE IGMP-Service-Profile-Name 90 string ATTRIBUTE Subscriber-Profile-Name 91 string ATTRIBUTE Forward-Policy 92 string ATTRIBUTE Remote-Port 93 string ATTRIBUTE Reauth 94 string ATTRIBUTE Reauth-More 95 integer ATTRIBUTE Agent-Remote-Id 96 octets ATTRIBUTE Agent-Circuit-Id 97 octets ATTRIBUTE Platform-Type 98 integer ATTRIBUTE Client-NBNS-Pri 99 ipaddr ATTRIBUTE Client-NBNS-Sec 100 ipaddr ATTRIBUTE Shaping-Profile-Name 101 string ATTRIBUTE BG-Cct-Addr-Max 103 integer ATTRIBUTE IP-Interface-Name 104 string ATTRIBUTE NAT-Policy-Name 105 string ATTRIBUTE RB-NPM-Service-Id 106 string ATTRIBUTE HTTP-Redirect-Profile-Name 107 string ATTRIBUTE Bind-Auto-Sub-User 108 string ATTRIBUTE Bind-Auto-Sub-Context 109 string ATTRIBUTE Bind-Auto-Sub-Password 110 string ATTRIBUTE Circuit-Protocol-Encap 111 integer ATTRIBUTE OS-Version 112 string ATTRIBUTE Session-Traffic-Limit 113 string ATTRIBUTE QOS-Reference 114 string ATTRIBUTE Rate-Limit-Excess-Burst 121 octets ATTRIBUTE Police-Excess-Burst 122 octets ATTRIBUTE Tunnel-Rate-Limit-Excess-Burst 123 octets ATTRIBUTE Tunnel-Police-Excess-Burst 124 octets ATTRIBUTE DHCP-Vendor-Class-ID 125 string ATTRIBUTE Qos-Rate 126 string ATTRIBUTE DHCP-Vendor-Encap-Option 127 string ATTRIBUTE Acct-Input-Octets-64 128 octets ATTRIBUTE Acct-Output-Octets-64 129 octets ATTRIBUTE Acct-Input-Packets-64 130 octets ATTRIBUTE Acct-Output-Packets-64 131 octets ATTRIBUTE Assigned-IP-Address 132 ipaddr ATTRIBUTE Acct-Mcast-In-Octets-64 133 octets ATTRIBUTE Acct-Mcast-Out-Octets-64 134 octets ATTRIBUTE Acct-Mcast-In-Packets-64 135 octets ATTRIBUTE Acct-Mcast-Out-Packets-64 136 octets ATTRIBUTE LAC-Port 137 integer ATTRIBUTE LAC-Real-Port 138 integer ATTRIBUTE LAC-Port-Type 139 integer ATTRIBUTE LAC-Real-Port-Type 140 integer ATTRIBUTE Acct-Dyn-Ac-Ent 141 string ATTRIBUTE Session-Error-Code 142 integer ATTRIBUTE Session-Error-Msg 143 string ATTRIBUTE Acct-Update-Reason 144 integer ATTRIBUTE Mac-Addr 145 string ATTRIBUTE Vlan-Source-Info 146 string ATTRIBUTE Acct-Mcast-In-Octets 147 integer ATTRIBUTE Acct-Mcast-Out-Octets 148 integer ATTRIBUTE Acct-Mcast-In-Packets 149 integer ATTRIBUTE Acct-Mcast-Out-Packets 150 integer ATTRIBUTE Reauth-Session-Id 151 string ATTRIBUTE QOS-Rate-Inbound 156 string ATTRIBUTE QOS-Rate-Outbound 157 string ATTRIBUTE Route-Tag 158 integer ATTRIBUTE LI-Id 159 integer ATTRIBUTE LI-Md-Address 160 ipaddr ATTRIBUTE LI-Md-Port 161 integer ATTRIBUTE LI-Action 162 integer ATTRIBUTE LI-Profile 163 string ATTRIBUTE Dynamic-Policy-Filter 164 string ATTRIBUTE HTTP-Redirect-URL 165 string ATTRIBUTE DSL-Actual-Rate-Up 166 integer ATTRIBUTE DSL-Actual-Rate-Down 167 integer ATTRIBUTE DSL-Min-Rate-Up 168 integer ATTRIBUTE DSL-Min-Rate-Down 169 integer ATTRIBUTE DSL-Attainable-Rate-Up 170 integer ATTRIBUTE DSL-Attainable-Rate-Down 171 integer ATTRIBUTE DSL-Max-Rate-Up 172 integer ATTRIBUTE DSL-Max-Rate-Down 173 integer ATTRIBUTE DSL-Min-Low-Power-Rate-Up 174 integer ATTRIBUTE DSL-Min-Low-Power-Rate-Down 175 integer ATTRIBUTE DSL-Max-Inter-Delay-Up 176 integer ATTRIBUTE DSL-Actual-Inter-Delay-Up 177 integer ATTRIBUTE DSL-Max-Inter-Delay-Down 178 integer ATTRIBUTE DSL-Actual-Inter-Delay-Down 179 integer ATTRIBUTE DSL-Line-State 180 integer ATTRIBUTE DSL-L2-Encapsulation 181 integer ATTRIBUTE DSL-Transmission-System 182 integer ATTRIBUTE DSL-PPPOA-PPPOE-Inter-Work-Flag 183 integer ATTRIBUTE DSL-Actual-Rate-Down-Factor 185 integer ATTRIBUTE DSL-Combined-Line-Info 184 string ATTRIBUTE Class-Volume-limit 186 string ATTRIBUTE Class-Volume-In-Counter 187 string ATTRIBUTE Class-Volume-Out-Counter 188 string ATTRIBUTE Flow-FAC-Profile 189 string ATTRIBUTE Flow-FAC-Profile 189 string ATTRIBUTE Service-Name 190 string has_tag ATTRIBUTE Service-Action 191 integer has_tag ATTRIBUTE Service-Parameter 192 string has_tag ATTRIBUTE Service-Error-Cause 193 integer has_tag ATTRIBUTE Deactivate-Service-Name 194 string has_tag ATTRIBUTE Qos-Profile-Overhead 195 string ATTRIBUTE Dynamic-QoS-Param 196 string ATTRIBUTE Acct-Alt-Session-ID 197 string ATTRIBUTE Idle-Timeout-Threshold 198 integer ATTRIBUTE Double-Authentication 199 integer ATTRIBUTE SBC-Adjacency 200 string #binary in radiator ATTRIBUTE DHCP-Field 201 string #binary in radiator ATTRIBUTE DHCP-Option 202 string ATTRIBUTE Security-Service 203 string ATTRIBUTE Reauth-Service-Name 204 string has_tag ATTRIBUTE Flow-IP-Profile 205 string ATTRIBUTE Radius-Throttle-Watermark 206 integer VALUE PVC-Encapsulation-Type AAA-ENCAPS-ATM-RAW 1 VALUE PVC-Encapsulation-Type AAA-ENCAPS-ATM-ROUTE1483 2 VALUE PVC-Encapsulation-Type AAA-ENCAPS-ATM-AUTO1483 3 VALUE PVC-Encapsulation-Type AAA-ENCAPS-ATM-MULTI 4 VALUE PVC-Encapsulation-Type AAA-ENCAPS-ATM-BRIDGE1483 5 VALUE PVC-Encapsulation-Type AAA-ENCAPS-ATM-PPP 6 VALUE PVC-Encapsulation-Type AAA-ENCAPS-ATM-PPP-SERIAL 7 VALUE PVC-Encapsulation-Type AAA-ENCAPS-ATM-PPP-NLPID 8 VALUE PVC-Encapsulation-Type AAA-ENCAPS-ATM-PPP-AUTO 9 VALUE PVC-Encapsulation-Type AAA-ENCAPS-ATM-PPPOE 10 VALUE PVC-Encapsulation-Type AAA-ENCAPS-ATM-L2TP 11 VALUE PVC-Encapsulation-Type AAA-ENCAPS-ATM-PPP-LLC 12 VALUE PVC-Encapsulation-Type AAA-ENCAPS-FRAME-AUTO1490 13 VALUE PVC-Encapsulation-Type AAA-ENCAPS-FRAME-MULTI 14 VALUE PVC-Encapsulation-Type AAA-ENCAPS-FRAME-BRIDGE1490 15 VALUE PVC-Encapsulation-Type AAA-ENCAPS-FRAME-PPP 16 VALUE PVC-Encapsulation-Type AAA-ENCAPS-FRAME-PPP-AUTO 17 VALUE PVC-Encapsulation-Type AAA-ENCAPS-FRAME-PPPOE 18 VALUE PVC-Encapsulation-Type AAA-ENCAPS-FRAME-ROUTE1490 19 VALUE PVC-Encapsulation-Type AAA-ENCAPS-FRAME-L2TP 20 VALUE PVC-Encapsulation-Type AAA-ENCAPS-L2TP-VC-MUXED 21 VALUE PVC-Encapsulation-Type AAA-ENCAPS-ETH 22 VALUE PVC-Encapsulation-Type AAA-ENCAPS-ETH-PPPOE 23 VALUE PVC-Encapsulation-Type AAA-ENCAPS-ETH-MULTI 24 VALUE PVC-Encapsulation-Type AAA-ENCAPS-ETH-DOT1Q 25 VALUE PVC-Encapsulation-Type AAA-ENCAPS-ETH-DOT1Q-PPPOE 26 VALUE PVC-Encapsulation-Type AAA-ENCAPS-ATM-MULTI-PPPOE 27 VALUE PVC-Encapsulation-Type AAA-ENCAPS-ATM-MULTI-IPV6OE 28 VALUE PVC-Encapsulation-Type AAA-ENCAPS-ATM-MULTI-PPPOE-N-IPV6OE 29 VALUE PVC-Encapsulation-Type AAA-ENCAPS-ETH-DOT1Q-TUNNEL 30 VALUE PVC-Encapsulation-Type AAA-ENCAPS-ETH-DOT1Q-TUNNEL-PPPOE 31 VALUE PVC-Circuit-Padding AAA-CIRCUIT-PADDING 1 VALUE PVC-Circuit-Padding AAA-CIRCUIT-NO-PADDING 2 VALUE Bind-Type AAA-AUTH-BIND 1 VALUE Bind-Type AAA-BYPASS-BIND 2 VALUE Bind-Type AAA-INTERFACE-BIND 3 VALUE Bind-Type AAA-SUBSCRIBE-BIND 4 VALUE Bind-Type AAA-TUNNEL-BIND 5 VALUE Bind-Type AAA-SESSION-BIND 6 VALUE Bind-Type AAA-Q8021-BIND 7 VALUE Bind-Type AAA-MULTI-BIND 8 VALUE Bind-Type AAA-DHCP-BIND 9 VALUE Bind-Type AAA-MULTI-BIND-SUB 10 VALUE Bind-Type AAA-BRIDGE-GROUP-BIND 11 VALUE Bind-Type AAA-VLAN-BIND 12 VALUE Bind-Type AAA-VLAN-GROUP-BIND 13 VALUE Bind-Type AAA-AUTO-SUBSCRIBER-BIND 14 VALUE Bind-Auth-Protocol AAA-PPP-PAP 1 VALUE Bind-Auth-Protocol AAA-PPP-CHAP 2 VALUE Bind-Auth-Protocol AAA-PPP-CHAP-WAIT 3 VALUE Bind-Auth-Protocol AAA-PPP-CHAP-PAP 4 VALUE Bind-Auth-Protocol AAA-PPP-CHAP-WAIT-PAP 5 VALUE Bind-Auth-Protocol AAA-PPP-EAP 6 VALUE Bind-Auth-Protocol AAA-PPP-PAP-CHAP 7 VALUE Bind-Auth-Protocol AAA-PPP-PAP-CHAP-WAIT 8 VALUE Source-Validation Enabled 1 VALUE Source-Validation Disabled 2 VALUE Tunnel-Domain Enabled 1 VALUE Tunnel-Domain Disabled 2 VALUE Tunnel-Function LAC-Only 1 VALUE Tunnel-Function LNS-Only 2 VALUE Tunnel-Function LAC-LNS 3 VALUE Tunnel-Session-Auth CHAP 1 VALUE Tunnel-Session-Auth PAP 2 VALUE Tunnel-Session-Auth CHAP-PAP 3 VALUE Tunnel-Group Enabled 1 VALUE Tunnel-Group Disabled 2 VALUE Tunnel-Algorithm First 1 VALUE Tunnel-Algorithm Load-Balance 2 VALUE Tunnel-Algorithm WRR 3 VALUE Mcast-Send NO-SEND 1 VALUE Mcast-Send SEND 2 VALUE Mcast-Send UNSOLICITED-SEND 3 VALUE Mcast-Receive NO-RECEIVE 1 VALUE Mcast-Receive RECEIVE 2 VALUE Tunnel-DNIS DNIS 1 VALUE Tunnel-DNIS DNIS-Only 2 VALUE Platform-Type SMS 1 VALUE Platform-Type SmartEdge-800 2 VALUE Platform-Type SE-400 3 VALUE Platform-Type SE-100 4 VALUE Circuit-Protocol-Encap ENCAPS-PPPOE 27 VALUE Medium-Type DSL 11 VALUE Medium-Type Cable 12 VALUE Medium-Type Wireless 13 VALUE Medium-Type Satellite 14 VALUE IP-TOS-Field normal 0 VALUE IP-TOS-Field min-cost-only 1 VALUE IP-TOS-Field max-reliability-only 2 VALUE IP-TOS-Field max-reliability-plus-min-cost 3 VALUE IP-TOS-Field max-throughput-only 4 VALUE IP-TOS-Field max-throughput-plus-min-cost 5 VALUE IP-TOS-Field max-throughput-plus-max-reliability 6 VALUE IP-TOS-Field max-throughput-plus-max-reliability-plus-min-cost 7 VALUE IP-TOS-Field min-delay-only 8 VALUE IP-TOS-Field min-delay-plus-min-cost 9 VALUE IP-TOS-Field min-delay-plus-max-reliability 10 VALUE IP-TOS-Field min-delay-plus-max-reliability-plus-min-cost 11 VALUE IP-TOS-Field min-delay-plus-max-throughput 12 VALUE IP-TOS-Field min-delay-plus-max-throughput-plus-min-cost 13 VALUE IP-TOS-Field min-delay-plus-max-throughput-plus-max-reliability 14 VALUE IP-TOS-Field min-delay-plus-max-throughput-plus-max-reliability-plus-min-cost 15 VALUE LAC-Port-Type NAS-PORT-TYPE-10BT 40 VALUE LAC-Port-Type NAS-PORT-TYPE-100BT 41 VALUE LAC-Port-Type NAS-PORT-TYPE-DS3-FR 42 VALUE LAC-Port-Type NAS-PORT-TYPE-DS3-ATM 43 VALUE LAC-Port-Type NAS-PORT-TYPE-OC3 44 VALUE LAC-Port-Type NAS-PORT-TYPE-HSSI 45 VALUE LAC-Port-Type NAS-PORT-TYPE-EIA530 46 VALUE LAC-Port-Type NAS-PORT-TYPE-T1 47 VALUE LAC-Port-Type NAS-PORT-TYPE-CHAN-T3 48 VALUE LAC-Port-Type NAS-PORT-TYPE-DS1-FR 49 VALUE LAC-Port-Type NAS-PORT-TYPE-E3-ATM 50 VALUE LAC-Port-Type NAS-PORT-TYPE-IMA-ATM 51 VALUE LAC-Port-Type NAS-PORT-TYPE-DS3-ATM-2 52 VALUE LAC-Port-Type NAS-PORT-TYPE-OC3-ATM-2 53 VALUE LAC-Port-Type NAS-PORT-TYPE-1000BSX 54 VALUE LAC-Port-Type NAS-PORT-TYPE-E1-FR 55 VALUE LAC-Port-Type NAS-PORT-TYPE-E1-ATM 56 VALUE LAC-Port-Type NAS-PORT-TYPE-E3-FR 57 VALUE LAC-Port-Type NAS-PORT-TYPE-OC3-POS 58 VALUE LAC-Port-Type NAS-PORT-TYPE-OC12-POS 59 VALUE LAC-Port-Type NAS-PORT-TYPE-PPPOE 60 VALUE LAC-Real-Port-Type NAS-PORT-TYPE-10BT 40 VALUE LAC-Real-Port-Type NAS-PORT-TYPE-100BT 41 VALUE LAC-Real-Port-Type NAS-PORT-TYPE-DS3-FR 42 VALUE LAC-Real-Port-Type NAS-PORT-TYPE-DS3-ATM 43 VALUE LAC-Real-Port-Type NAS-PORT-TYPE-OC3 44 VALUE LAC-Real-Port-Type NAS-PORT-TYPE-HSSI 45 VALUE LAC-Real-Port-Type NAS-PORT-TYPE-EIA530 46 VALUE LAC-Real-Port-Type NAS-PORT-TYPE-T1 47 VALUE LAC-Real-Port-Type NAS-PORT-TYPE-CHAN-T3 48 VALUE LAC-Real-Port-Type NAS-PORT-TYPE-DS1-FR 49 VALUE LAC-Real-Port-Type NAS-PORT-TYPE-E3-ATM 50 VALUE LAC-Real-Port-Type NAS-PORT-TYPE-IMA-ATM 51 VALUE LAC-Real-Port-Type NAS-PORT-TYPE-DS3-ATM-2 52 VALUE LAC-Real-Port-Type NAS-PORT-TYPE-OC3-ATM-2 53 VALUE LAC-Real-Port-Type NAS-PORT-TYPE-1000BSX 54 VALUE LAC-Real-Port-Type NAS-PORT-TYPE-E1-FR 55 VALUE LAC-Real-Port-Type NAS-PORT-TYPE-E1-ATM 56 VALUE LAC-Real-Port-Type NAS-PORT-TYPE-E3-FR 57 VALUE LAC-Real-Port-Type NAS-PORT-TYPE-OC3-POS 58 VALUE LAC-Real-Port-Type NAS-PORT-TYPE-OC12-POS 59 VALUE LAC-Real-Port-Type NAS-PORT-TYPE-PPPOE 60 # Although Redback uses - instead of _ in the Attributes, these values are listed # with _ in the latest (6.1.4.4) documentation, so I have entered them as so # graeme VALUE Acct-Update-Reason AAA_LOAD_ACCT_SESSION_UP 1 VALUE Acct-Update-Reason AAA_LOAD_ACCT_SESSION_DOWN 2 VALUE Acct-Update-Reason AAA_LOAD_ACCT_PERIODIC 3 VALUE Acct-Update-Reason AAA_LOAD_ACCT_DYN_AC_ENT_START 4 VALUE Acct-Update-Reason AAA_LOAD_ACCT_DYN_AC_ENT_STOP 5 VALUE Acct-Update-Reason AAA_LOAD_ACCT_DYN_AC_ENT_TIMEOUT 6 VALUE Acct-Update-Reason AAA_LOAD_ACCT_SUBSCRIBER_REAUTHOR 7 VALUE Acct-Update-Reason AAA_LOAD_ACCT_PPP_IPCP_UP 8 VALUE Acct-Update-Reason AAA_LOAD_ACCT_PPP_MP_LINK_UP 9 VALUE Acct-Update-Reason AAA_LOAD_ACCT_DHCP_IP_ADDR_GRANTED 10 VALUE Acct-Update-Reason AAA_LOAD_ACCT_DHCP_IP_ADDR_RELEASED 11 VALUE Acct-Update-Reason AAA_LOAD_ACCT_ACL_TIMERED_ACTION 12 VALUE Acct-Update-Reason AAA_LOAD_ACCT_ACL_ACTION 13 VALUE Acct-Update-Reason AAA_LOAD_ACCT_CMD 14 VALUE Acct-Update-Reason AAA_LOAD_ACCT_TEST 15 VALUE DSL-Line-State Showtime 1 VALUE DSL-Line-State Idle 2 VALUE DSL-Line-State Silent 3 VALUE DSL-Transmission-System ADSL1 1 VALUE DSL-Transmission-System ADSL2 2 VALUE DSL-Transmission-System ADSL2+ 3 VALUE DSL-Transmission-System VDSL1 4 VALUE DSL-Transmission-System VDSL2 5 VALUE DSL-Transmission-System SDSL 6 VALUE DSL-Transmission-System UNKNOWN 7 VALUE Service-Action DE-ACTIVATE 0 VALUE Service-Action ACTIVATE-WITH-ACCT 1 VALUE Service-Action ACTIVATE-WITHOUT-ACCT 2 VALUE Service-Error-Cause Service-success 0 VALUE Service-Error-Cause Unsupported-attribute 401 VALUE Service-Error-Cause Missing-attribute 402 VALUE Service-Error-Cause Invalid-request 404 VALUE Service-Error-Cause Resource-unavailable 506 VALUE Service-Error-Cause Generic-service-error 550 VALUE Service-Error-Cause Service-not-found 551 VALUE Service-Error-Cause Service-already-active 552 VALUE Service-Error-Cause Service-accounting-disabled 553 VALUE Service-Error-Cause Service-duplicate-parameter 554 END-VENDOR Redback freeradius-server/share/dictionary.redcreek000066400000000000000000000011701257552170400214770ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2011 The FreeRADIUS Server project and contributors # # http://www.redcreek.com # $Id$ # VENDOR RedCreek 1958 BEGIN-VENDOR RedCreek ATTRIBUTE RedCreek-Tunneled-IP-Addr 5 ipaddr ATTRIBUTE RedCreek-Tunneled-IP-Netmask 6 ipaddr ATTRIBUTE RedCreek-Tunneled-Gateway 7 ipaddr ATTRIBUTE RedCreek-Tunneled-DNS-Server 8 string ATTRIBUTE RedCreek-Tunneled-WINS-Server1 9 string ATTRIBUTE RedCreek-Tunneled-WINS-Server2 10 string ATTRIBUTE RedCreek-Tunneled-HostName 11 string ATTRIBUTE RedCreek-Tunneled-DomainName 12 string ATTRIBUTE RedCreek-Tunneled-Search-List 13 string END-VENDOR RedCreek freeradius-server/share/dictionary.rfc2865000066400000000000000000000101211257552170400210060ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2011 The FreeRADIUS Server project and contributors # # Attributes and values defined in RFC 2865. # http://www.ietf.org/rfc/rfc2865.txt # # $Id$ # ATTRIBUTE User-Name 1 string ATTRIBUTE User-Password 2 string encrypt=1 ATTRIBUTE CHAP-Password 3 octets ATTRIBUTE NAS-IP-Address 4 ipaddr ATTRIBUTE NAS-Port 5 integer ATTRIBUTE Service-Type 6 integer ATTRIBUTE Framed-Protocol 7 integer ATTRIBUTE Framed-IP-Address 8 ipaddr ATTRIBUTE Framed-IP-Netmask 9 ipaddr ATTRIBUTE Framed-Routing 10 integer ATTRIBUTE Filter-Id 11 string ATTRIBUTE Framed-MTU 12 integer ATTRIBUTE Framed-Compression 13 integer ATTRIBUTE Login-IP-Host 14 ipaddr ATTRIBUTE Login-Service 15 integer ATTRIBUTE Login-TCP-Port 16 integer # Attribute 17 is undefined ATTRIBUTE Reply-Message 18 string ATTRIBUTE Callback-Number 19 string ATTRIBUTE Callback-Id 20 string # Attribute 21 is undefined ATTRIBUTE Framed-Route 22 string ATTRIBUTE Framed-IPX-Network 23 ipaddr ATTRIBUTE State 24 octets ATTRIBUTE Class 25 octets ATTRIBUTE Vendor-Specific 26 octets ATTRIBUTE Session-Timeout 27 integer ATTRIBUTE Idle-Timeout 28 integer ATTRIBUTE Termination-Action 29 integer ATTRIBUTE Called-Station-Id 30 string ATTRIBUTE Calling-Station-Id 31 string ATTRIBUTE NAS-Identifier 32 string ATTRIBUTE Proxy-State 33 octets ATTRIBUTE Login-LAT-Service 34 string ATTRIBUTE Login-LAT-Node 35 string ATTRIBUTE Login-LAT-Group 36 octets ATTRIBUTE Framed-AppleTalk-Link 37 integer ATTRIBUTE Framed-AppleTalk-Network 38 integer ATTRIBUTE Framed-AppleTalk-Zone 39 string ATTRIBUTE CHAP-Challenge 60 octets ATTRIBUTE NAS-Port-Type 61 integer ATTRIBUTE Port-Limit 62 integer ATTRIBUTE Login-LAT-Port 63 string # # Integer Translations # # Service types VALUE Service-Type Login-User 1 VALUE Service-Type Framed-User 2 VALUE Service-Type Callback-Login-User 3 VALUE Service-Type Callback-Framed-User 4 VALUE Service-Type Outbound-User 5 VALUE Service-Type Administrative-User 6 VALUE Service-Type NAS-Prompt-User 7 VALUE Service-Type Authenticate-Only 8 VALUE Service-Type Callback-NAS-Prompt 9 VALUE Service-Type Call-Check 10 VALUE Service-Type Callback-Administrative 11 # Framed Protocols VALUE Framed-Protocol PPP 1 VALUE Framed-Protocol SLIP 2 VALUE Framed-Protocol ARAP 3 VALUE Framed-Protocol Gandalf-SLML 4 VALUE Framed-Protocol Xylogics-IPX-SLIP 5 VALUE Framed-Protocol X.75-Synchronous 6 # Framed Routing Values VALUE Framed-Routing None 0 VALUE Framed-Routing Broadcast 1 VALUE Framed-Routing Listen 2 VALUE Framed-Routing Broadcast-Listen 3 # Framed Compression Types VALUE Framed-Compression None 0 VALUE Framed-Compression Van-Jacobson-TCP-IP 1 VALUE Framed-Compression IPX-Header-Compression 2 VALUE Framed-Compression Stac-LZS 3 # Login Services VALUE Login-Service Telnet 0 VALUE Login-Service Rlogin 1 VALUE Login-Service TCP-Clear 2 VALUE Login-Service PortMaster 3 VALUE Login-Service LAT 4 VALUE Login-Service X25-PAD 5 VALUE Login-Service X25-T3POS 6 VALUE Login-Service TCP-Clear-Quiet 8 # Login-TCP-Port (see /etc/services for more examples) VALUE Login-TCP-Port Telnet 23 VALUE Login-TCP-Port Rlogin 513 VALUE Login-TCP-Port Rsh 514 # Termination Options VALUE Termination-Action Default 0 VALUE Termination-Action RADIUS-Request 1 # NAS Port Types VALUE NAS-Port-Type Async 0 VALUE NAS-Port-Type Sync 1 VALUE NAS-Port-Type ISDN 2 VALUE NAS-Port-Type ISDN-V120 3 VALUE NAS-Port-Type ISDN-V110 4 VALUE NAS-Port-Type Virtual 5 VALUE NAS-Port-Type PIAFS 6 VALUE NAS-Port-Type HDLC-Clear-Channel 7 VALUE NAS-Port-Type X.25 8 VALUE NAS-Port-Type X.75 9 VALUE NAS-Port-Type G.3-Fax 10 VALUE NAS-Port-Type SDSL 11 VALUE NAS-Port-Type ADSL-CAP 12 VALUE NAS-Port-Type ADSL-DMT 13 VALUE NAS-Port-Type IDSL 14 VALUE NAS-Port-Type Ethernet 15 VALUE NAS-Port-Type xDSL 16 VALUE NAS-Port-Type Cable 17 VALUE NAS-Port-Type Wireless-Other 18 VALUE NAS-Port-Type Wireless-802.11 19 freeradius-server/share/dictionary.rfc2866000066400000000000000000000036471257552170400210260ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2011 The FreeRADIUS Server project and contributors # # Attributes and values defined in RFC 2866. # http://www.ietf.org/rfc/rfc2866.txt # # $Id$ # ATTRIBUTE Acct-Status-Type 40 integer ATTRIBUTE Acct-Delay-Time 41 integer ATTRIBUTE Acct-Input-Octets 42 integer ATTRIBUTE Acct-Output-Octets 43 integer ATTRIBUTE Acct-Session-Id 44 string ATTRIBUTE Acct-Authentic 45 integer ATTRIBUTE Acct-Session-Time 46 integer ATTRIBUTE Acct-Input-Packets 47 integer ATTRIBUTE Acct-Output-Packets 48 integer ATTRIBUTE Acct-Terminate-Cause 49 integer ATTRIBUTE Acct-Multi-Session-Id 50 string ATTRIBUTE Acct-Link-Count 51 integer # Accounting Status Types VALUE Acct-Status-Type Start 1 VALUE Acct-Status-Type Stop 2 VALUE Acct-Status-Type Alive 3 # dup VALUE Acct-Status-Type Interim-Update 3 VALUE Acct-Status-Type Accounting-On 7 VALUE Acct-Status-Type Accounting-Off 8 VALUE Acct-Status-Type Failed 15 # Authentication Types VALUE Acct-Authentic RADIUS 1 VALUE Acct-Authentic Local 2 VALUE Acct-Authentic Remote 3 VALUE Acct-Authentic Diameter 4 # Acct Terminate Causes VALUE Acct-Terminate-Cause User-Request 1 VALUE Acct-Terminate-Cause Lost-Carrier 2 VALUE Acct-Terminate-Cause Lost-Service 3 VALUE Acct-Terminate-Cause Idle-Timeout 4 VALUE Acct-Terminate-Cause Session-Timeout 5 VALUE Acct-Terminate-Cause Admin-Reset 6 VALUE Acct-Terminate-Cause Admin-Reboot 7 VALUE Acct-Terminate-Cause Port-Error 8 VALUE Acct-Terminate-Cause NAS-Error 9 VALUE Acct-Terminate-Cause NAS-Request 10 VALUE Acct-Terminate-Cause NAS-Reboot 11 VALUE Acct-Terminate-Cause Port-Unneeded 12 VALUE Acct-Terminate-Cause Port-Preempted 13 VALUE Acct-Terminate-Cause Port-Suspended 14 VALUE Acct-Terminate-Cause Service-Unavailable 15 VALUE Acct-Terminate-Cause Callback 16 VALUE Acct-Terminate-Cause User-Error 17 VALUE Acct-Terminate-Cause Host-Request 18 freeradius-server/share/dictionary.rfc2867000066400000000000000000000010211257552170400210070ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2011 The FreeRADIUS Server project and contributors # # Attributes and values defined in RFC 2867. # http://www.ietf.org/rfc/rfc2867.txt # # $Id$ # ATTRIBUTE Acct-Tunnel-Connection 68 string ATTRIBUTE Acct-Tunnel-Packets-Lost 86 integer VALUE Acct-Status-Type Tunnel-Start 9 VALUE Acct-Status-Type Tunnel-Stop 10 VALUE Acct-Status-Type Tunnel-Reject 11 VALUE Acct-Status-Type Tunnel-Link-Start 12 VALUE Acct-Status-Type Tunnel-Link-Stop 13 VALUE Acct-Status-Type Tunnel-Link-Reject 14 freeradius-server/share/dictionary.rfc2868000066400000000000000000000032131257552170400210150ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2011 The FreeRADIUS Server project and contributors # # Attributes and values defined in RFC 2868. # http://www.ietf.org/rfc/rfc2868.txt # # $Id$ # ATTRIBUTE Tunnel-Type 64 integer has_tag ATTRIBUTE Tunnel-Medium-Type 65 integer has_tag ATTRIBUTE Tunnel-Client-Endpoint 66 string has_tag ATTRIBUTE Tunnel-Server-Endpoint 67 string has_tag ATTRIBUTE Tunnel-Password 69 string has_tag,encrypt=2 ATTRIBUTE Tunnel-Private-Group-Id 81 string has_tag ATTRIBUTE Tunnel-Assignment-Id 82 string has_tag ATTRIBUTE Tunnel-Preference 83 integer has_tag ATTRIBUTE Tunnel-Client-Auth-Id 90 string has_tag ATTRIBUTE Tunnel-Server-Auth-Id 91 string has_tag # Tunnel Type VALUE Tunnel-Type PPTP 1 VALUE Tunnel-Type L2F 2 VALUE Tunnel-Type L2TP 3 VALUE Tunnel-Type ATMP 4 VALUE Tunnel-Type VTP 5 VALUE Tunnel-Type AH 6 VALUE Tunnel-Type IP 7 VALUE Tunnel-Type MIN-IP 8 VALUE Tunnel-Type ESP 9 VALUE Tunnel-Type GRE 10 VALUE Tunnel-Type DVS 11 VALUE Tunnel-Type IP-in-IP 12 # Tunnel Medium Type VALUE Tunnel-Medium-Type IP 1 VALUE Tunnel-Medium-Type IPv4 1 VALUE Tunnel-Medium-Type IPv6 2 VALUE Tunnel-Medium-Type NSAP 3 VALUE Tunnel-Medium-Type HDLC 4 VALUE Tunnel-Medium-Type BBN-1822 5 VALUE Tunnel-Medium-Type IEEE-802 6 VALUE Tunnel-Medium-Type E.163 7 VALUE Tunnel-Medium-Type E.164 8 VALUE Tunnel-Medium-Type F.69 9 VALUE Tunnel-Medium-Type X.121 10 VALUE Tunnel-Medium-Type IPX 11 VALUE Tunnel-Medium-Type Appletalk 12 VALUE Tunnel-Medium-Type DecNet-IV 13 VALUE Tunnel-Medium-Type Banyan-Vines 14 VALUE Tunnel-Medium-Type E.164-NSAP 15 freeradius-server/share/dictionary.rfc2869000066400000000000000000000022411257552170400210160ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2011 The FreeRADIUS Server project and contributors # # Attributes and values defined in RFC 2869. # http://www.ietf.org/rfc/rfc2869.txt # # $Id$ # ATTRIBUTE Acct-Input-Gigawords 52 integer ATTRIBUTE Acct-Output-Gigawords 53 integer ATTRIBUTE Event-Timestamp 55 date ATTRIBUTE ARAP-Password 70 octets # 16 octets of data ATTRIBUTE ARAP-Features 71 octets # 14 octets of data ATTRIBUTE ARAP-Zone-Access 72 integer ATTRIBUTE ARAP-Security 73 integer ATTRIBUTE ARAP-Security-Data 74 string ATTRIBUTE Password-Retry 75 integer ATTRIBUTE Prompt 76 integer ATTRIBUTE Connect-Info 77 string ATTRIBUTE Configuration-Token 78 string ATTRIBUTE EAP-Message 79 octets ATTRIBUTE Message-Authenticator 80 octets ATTRIBUTE ARAP-Challenge-Response 84 octets # 8 octets of data ATTRIBUTE Acct-Interim-Interval 85 integer # 86: RFC 2867 ATTRIBUTE NAS-Port-Id 87 string ATTRIBUTE Framed-Pool 88 string # ARAP Zone Access VALUE ARAP-Zone-Access Default-Zone 1 VALUE ARAP-Zone-Access Zone-Filter-Inclusive 2 VALUE ARAP-Zone-Access Zone-Filter-Exclusive 4 # Prompt VALUE Prompt No-Echo 0 VALUE Prompt Echo 1 freeradius-server/share/dictionary.rfc3162000066400000000000000000000006521257552170400210050ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2011 The FreeRADIUS Server project and contributors # # Attributes and values defined in RFC 3162. # http://www.ietf.org/rfc/rfc3162.txt # # $Id$ # ATTRIBUTE NAS-IPv6-Address 95 ipv6addr ATTRIBUTE Framed-Interface-Id 96 ifid ATTRIBUTE Framed-IPv6-Prefix 97 ipv6prefix ATTRIBUTE Login-IPv6-Host 98 ipv6addr ATTRIBUTE Framed-IPv6-Route 99 string ATTRIBUTE Framed-IPv6-Pool 100 string freeradius-server/share/dictionary.rfc3576000066400000000000000000000017441257552170400210210ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2011 The FreeRADIUS Server project and contributors # # Attributes and values defined in RFC 3576. # http://www.ietf.org/rfc/rfc3576.txt # # $Id$ # ATTRIBUTE Error-Cause 101 integer # Service Types VALUE Service-Type Authorize-Only 17 # Error causes VALUE Error-Cause Residual-Context-Removed 201 VALUE Error-Cause Invalid-EAP-Packet 202 VALUE Error-Cause Unsupported-Attribute 401 VALUE Error-Cause Missing-Attribute 402 VALUE Error-Cause NAS-Identification-Mismatch 403 VALUE Error-Cause Invalid-Request 404 VALUE Error-Cause Unsupported-Service 405 VALUE Error-Cause Unsupported-Extension 406 VALUE Error-Cause Administratively-Prohibited 501 VALUE Error-Cause Proxy-Request-Not-Routable 502 VALUE Error-Cause Session-Context-Not-Found 503 VALUE Error-Cause Session-Context-Not-Removable 504 VALUE Error-Cause Proxy-Processing-Error 505 VALUE Error-Cause Resources-Unavailable 506 VALUE Error-Cause Request-Initiated 507 freeradius-server/share/dictionary.rfc3580000066400000000000000000000007341257552170400210120ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2011 The FreeRADIUS Server project and contributors # # Attributes and values defined in RFC 3580. # http://www.ietf.org/rfc/rfc3580.txt # # $Id$ # VALUE Acct-Terminate-Cause Supplicant-Restart 19 VALUE Acct-Terminate-Cause Reauthentication-Failure 20 VALUE Acct-Terminate-Cause Port-Reinit 21 VALUE Acct-Terminate-Cause Port-Disabled 22 VALUE NAS-Port-Type Token-Ring 20 VALUE NAS-Port-Type FDDI 21 VALUE Tunnel-Type VLAN 13 freeradius-server/share/dictionary.rfc4072000066400000000000000000000003251257552170400210030ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2011 The FreeRADIUS Server project and contributors # # Attributes and values defined in RFC 4072 # http://www.ietf.org/rfc/4072.txt # # $Id$ # ATTRIBUTE EAP-Key-Name 102 octets freeradius-server/share/dictionary.rfc4372000066400000000000000000000003361257552170400210100ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2011 The FreeRADIUS Server project and contributors # # Attributes and values defined in RFC 4372. # http://www.ietf.org/rfc/4372.txt # # $Id$ # ATTRIBUTE Chargeable-User-Identity 89 string freeradius-server/share/dictionary.rfc4603000066400000000000000000000010041257552170400207760ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2011 The FreeRADIUS Server project and contributors ############################################################################## # # Attributes and values defined in RFC 4603. # http://www.ietf.org/rfc/rfc4603.txt # # $Id$ # ############################################################################## VALUE NAS-Port-Type PPPoA 30 VALUE NAS-Port-Type PPPoEoA 31 VALUE NAS-Port-Type PPPoEoE 32 VALUE NAS-Port-Type PPPoEoVLAN 33 VALUE NAS-Port-Type PPPoEoQinQ 34 freeradius-server/share/dictionary.rfc4675000066400000000000000000000013441257552170400210160ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2011 The FreeRADIUS Server project and contributors # # Attributes and values defined in RFC 4675. # http://www.ietf.org/rfc/4675.txt # # $Id$ # # # High byte = '1' (0x31) means the frames are tagged. # High byte = '2' (0x32) means the frames are untagged. # # Next 12 bits MUST be zero. # # Lower 12 bits is the IEEE-802.1Q VLAN VID. # ATTRIBUTE Egress-VLANID 56 integer ATTRIBUTE Ingress-Filters 57 integer # # First byte == '1' (0x31) means that the frames are tagged. # First byte == '2' (0x32) means that the frames are untagged. # ATTRIBUTE Egress-VLAN-Name 58 string ATTRIBUTE User-Priority-Table 59 octets # 8 VALUE Ingress-Filters Enabled 1 VALUE Ingress-Filters Disabled 2 freeradius-server/share/dictionary.rfc4679000066400000000000000000000037061257552170400210260ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2011 The FreeRADIUS Server project and contributors # # Attributes and values defined in RFC 4679. # http://www.ietf.org/rfc/4679.txt # # $Id$ # VENDOR ADSL-Forum 3561 BEGIN-VENDOR ADSL-Forum # # The first two attributes are prefixed with "ADSL-" because of # conflicting names in dictionary.redback. # ATTRIBUTE ADSL-Agent-Circuit-Id 1 string ATTRIBUTE ADSL-Agent-Remote-Id 2 string ATTRIBUTE Actual-Data-Rate-Upstream 129 integer ATTRIBUTE Actual-Data-Rate-Downstream 130 integer ATTRIBUTE Minimum-Data-Rate-Upstream 131 integer ATTRIBUTE Minimum-Data-Rate-Downstream 132 integer ATTRIBUTE Attainable-Data-Rate-Upstream 133 integer ATTRIBUTE Attainable-Data-Rate-Downstream 134 integer ATTRIBUTE Maximum-Data-Rate-Upstream 135 integer ATTRIBUTE Maximum-Data-Rate-Downstream 136 integer ATTRIBUTE Minimum-Data-Rate-Upstream-Low-Power 137 integer ATTRIBUTE Minimum-Data-Rate-Downstream-Low-Power 138 integer ATTRIBUTE Maximum-Interleaving-Delay-Upstream 139 integer ATTRIBUTE Actual-Interleaving-Delay-Upstream 140 integer ATTRIBUTE Maximum-Interleaving-Delay-Downstream 141 integer ATTRIBUTE Actual-Interleaving-Delay-Downstream 142 integer # # This next attribute has a weird encoding. # # Octet[0] - 0x01 AAL5 # Octet[0] - 0x02 Ethernet # Octet[1] - 0x00 Not Available # Octet[1] - 0x01 Untagged Ethernet # Octet[1] - 0x02 Single-Tagged Ethernet # Octet[2] - 0x00 Not available # Octet[2] - 0x01 PPPoA LLC # Octet[2] - 0x02 PPPoA Null # Octet[2] - 0x03 IPoA LLC # Octet[2] - 0x04 IPoA NULL # Octet[2] - 0x05 Ethernet over AAL5 LLC with FCS # Octet[2] - 0x06 Ethernet over AAL5 LLC without FCS # Octet[2] - 0x07 Ethernet over AAL5 Null with FCS # Octet[2] - 0x08 Ethernet over AAL5 Null without FCS # ATTRIBUTE Access-Loop-Encapsulation 144 octets # 3 # # If this attribute exists, it means that IFW has been performed # for the subscribers session. # ATTRIBUTE IWF-Session 254 octets # 0 END-VENDOR ADSL-Forum freeradius-server/share/dictionary.rfc4818000066400000000000000000000006031257552170400210120ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2011 The FreeRADIUS Server project and contributors ############################################################################## # # Attributes and values defined in RFC 4818. # http://www.ietf.org/rfc/rfc4818.txt # # $Id$ # ############################################################################## ATTRIBUTE Delegated-IPv6-Prefix 123 ipv6prefix freeradius-server/share/dictionary.rfc4849000066400000000000000000000003321257552170400210150ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2011 The FreeRADIUS Server project and contributors # # Attributes and values defined in RFC 4849. # http://www.ietf.org/rfc/rfc4849.txt # # $Id$ # ATTRIBUTE NAS-Filter-Rule 92 string freeradius-server/share/dictionary.rfc5090000066400000000000000000000016721257552170400210120ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2011 The FreeRADIUS Server project and contributors # # Attributes and values defined in RFC 5090. # http://www.ietf.org/rfc/rfc5090.txt # # $Id$ # ATTRIBUTE Digest-Response 103 string ATTRIBUTE Digest-Realm 104 string ATTRIBUTE Digest-Nonce 105 string ATTRIBUTE Digest-Response-Auth 106 string ATTRIBUTE Digest-Nextnonce 107 string ATTRIBUTE Digest-Method 108 string ATTRIBUTE Digest-URI 109 string ATTRIBUTE Digest-Qop 110 string ATTRIBUTE Digest-Algorithm 111 string ATTRIBUTE Digest-Entity-Body-Hash 112 string ATTRIBUTE Digest-CNonce 113 string ATTRIBUTE Digest-Nonce-Count 114 string ATTRIBUTE Digest-Username 115 string ATTRIBUTE Digest-Opaque 116 string ATTRIBUTE Digest-Auth-Param 117 string ATTRIBUTE Digest-AKA-Auts 118 string ATTRIBUTE Digest-Domain 119 string ATTRIBUTE Digest-Stale 120 string ATTRIBUTE Digest-HA1 121 string ATTRIBUTE SIP-AOR 122 string freeradius-server/share/dictionary.rfc5176000066400000000000000000000004421257552170400210110ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2011 The FreeRADIUS Server project and contributors # # Attributes and values defined in RFC 5176. # http://www.ietf.org/rfc/rfc5176.txt # # $Id$ # VALUE Error-Cause Invalid-Attribute-Value 407 VALUE Error-Cause Multiple-Session-Selection-Unsupported 508 freeradius-server/share/dictionary.rfc5447000066400000000000000000000004431257552170400210130ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2012 The FreeRADIUS Server project and contributors # # Attributes and values defined in RFC 5447. # http://www.ietf.org/rfc/rfc5447.txt # # $Id$ # # 64-bit bit field ATTRIBUTE MIP6-Feature-Vector 124 octets ATTRIBUTE MIP6-Home-Link-Prefix 125 ipv6prefix freeradius-server/share/dictionary.rfc5580000066400000000000000000000021371257552170400210130ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2011 The FreeRADIUS Server project and contributors # # Attributes and values defined in RFC 5580. # http://www.ietf.org/rfc/rfc5580.txt # # $Id$ # # One ASCII character of Namespace ID # 0 = TADIG (GSM) # 1 = Realm # 2 = E212 # # # Followed by the actual string ATTRIBUTE Operator-Name 126 string # # Large blobs of stuff # ATTRIBUTE Location-Information 127 octets ATTRIBUTE Location-Data 128 octets ATTRIBUTE Basic-Location-Policy-Rules 129 octets ATTRIBUTE Extended-Location-Policy-Rules 130 octets # # Really a bit-packed field # ATTRIBUTE Location-Capable 131 integer VALUE Location-Capable Civix-Location 1 VALUE Location-Capable Geo-Location 2 VALUE Location-Capable Users-Location 4 VALUE Location-Capable NAS-Location 8 ATTRIBUTE Requested-Location-Info 132 integer VALUE Requested-Location-Info Civix-Location 1 VALUE Requested-Location-Info Geo-Location 2 VALUE Requested-Location-Info Users-Location 4 VALUE Requested-Location-Info NAS-Location 8 VALUE Requested-Location-Info Future-Requests 16 VALUE Requested-Location-Info None 32 freeradius-server/share/dictionary.rfc5607000066400000000000000000000015701257552170400210130ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2011 The FreeRADIUS Server project and contributors # # Attributes and values defined in RFC 5607. # http://www.ietf.org/rfc/rfc5607.txt # # $Id$ # VALUE Service-Type Framed-Management 18 ATTRIBUTE Framed-Management 133 integer VALUE Framed-Management SNMP 1 VALUE Framed-Management Web-Based 2 VALUE Framed-Management Netconf 3 VALUE Framed-Management FTP 4 VALUE Framed-Management TFTP 5 VALUE Framed-Management SFTP 6 VALUE Framed-Management RCP 7 VALUE Framed-Management SCP 8 ATTRIBUTE Management-Transport-Protection 134 integer VALUE Management-Transport-Protection No-Protection 1 VALUE Management-Transport-Protection Integrity-Protection 2 VALUE Management-Transport-Protection Integrity-Confidentiality-Protection 3 ATTRIBUTE Management-Policy-Id 135 string ATTRIBUTE Management-Privilege-Level 136 integer freeradius-server/share/dictionary.rfc5904000066400000000000000000000012411257552170400210060ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2011 The FreeRADIUS Server project and contributors # # Attributes and values defined in RFC 5904. # http://www.ietf.org/rfc/rfc5904.txt # # $Id$ # # The next two attributes are continued, like EAP-Message/ ATTRIBUTE PKM-SS-Cert 137 octets ATTRIBUTE PKM-CA-Cert 138 octets # 28 bytes of data, 7 integers ATTRIBUTE PKM-Config-Settings 139 octets ATTRIBUTE PKM-Cryptosuite-List 140 octets ATTRIBUTE PKM-SAID 141 short # 6 bytes of data: SAID, 1 byte of type, 3 of cryptosuite ATTRIBUTE PKM-SA-Descriptor 142 octets # 133 bytes of data: integer lifetime, 1 byte sequence, 128 bytes of key ATTRIBUTE PKM-Auth-Key 143 octets freeradius-server/share/dictionary.rfc6519000066400000000000000000000003371257552170400210160ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2012 The FreeRADIUS Server project and contributors # # Attributes and values defined in RFC 6519. # http://www.ietf.org/rfc/rfc6519.txt # # $Id$ # ATTRIBUTE DS-Lite-Tunnel-Name 144 string freeradius-server/share/dictionary.rfc6572000066400000000000000000000021231257552170400210100ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2012 The FreeRADIUS Server project and contributors # # Attributes and values defined in RFC 6572. # http://www.ietf.org/rfc/rfc6572.txt # # $Id$ # ATTRIBUTE Mobile-Node-Identifier 145 octets ATTRIBUTE Service-Selection 146 string ATTRIBUTE PMIP6-Home-LMA-IPv6-Address 147 ipv6addr ATTRIBUTE PMIP6-Visited-LMA-IPv6-Address 148 ipv6addr ATTRIBUTE PMIP6-Home-LMA-IPv4-Address 149 ipaddr ATTRIBUTE PMIP6-Visited-LMA-IPv4-Address 150 ipaddr ATTRIBUTE PMIP6-Home-HN-Prefix 151 ipv6prefix ATTRIBUTE PMIP6-Visited-HN-Prefix 152 ipv6prefix ATTRIBUTE PMIP6-Home-Interface-ID 153 ifid ATTRIBUTE PMIP6-Visited-Interface-ID 154 ifid # ipv4 prefix? ATTRIBUTE PMIP6-Home-IPv4-HoA 155 octets # ipv4 prefix? ATTRIBUTE PMIP6-Visited-IPv4-HoA 156 octets ATTRIBUTE PMIP6-Home-DHCP4-Server-Address 157 ipaddr ATTRIBUTE PMIP6-Visited-DHCP4-Server-Address 158 ipaddr ATTRIBUTE PMIP6-Home-DHCP6-Server-Address 159 ipv6addr ATTRIBUTE PMIP6-Visited-DHCP6-Server-Address 160 ipv6addr ATTRIBUTE PMIP6-Home-IPv4-Gateway 161 ipaddr ATTRIBUTE PMIP6-Visited-IPv4-Gateway 162 ipaddr freeradius-server/share/dictionary.rfc6677000066400000000000000000000003231257552170400210160ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2013 The FreeRADIUS Server project and contributors # # Attributes and values defined in RFC 6677 # http://www.ietf.org/rfc/rfc6677.txt # ATTRIBUTE EAP-Lower-Layer 163 integer freeradius-server/share/dictionary.rfc6911000066400000000000000000000006341257552170400210120ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2013 The FreeRADIUS Server project and contributors # # Attributes and values defined in RFC 6911 # http://www.ietf.org/rfc/rfc6911.txt # ATTRIBUTE Framed-IPv6-Address 168 ipv6addr ATTRIBUTE DNS-Server-IPv6-Address 169 ipv6addr ATTRIBUTE Route-IPv6-Information 170 ipv6prefix ATTRIBUTE Delegated-IPv6-Prefix-Pool 171 string ATTRIBUTE Stateful-IPv6-Address-Pool 172 string freeradius-server/share/dictionary.rfc6930000066400000000000000000000003471257552170400210140ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2013 The FreeRADIUS Server project and contributors # # Attributes and values defined in RFC 6930 # http://www.ietf.org/rfc/rfc6930.txt # ATTRIBUTE IPv6-6rd-Configuration 173 octets # actually TLV freeradius-server/share/dictionary.rfc7055000066400000000000000000000006201257552170400210050ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2013 The FreeRADIUS Server project and contributors # # Attributes and values defined in RFC 7055 # http://www.ietf.org/rfc/rfc7055.txt # ATTRIBUTE GSS-Acceptor-Service-Name 164 string ATTRIBUTE GSS-Acceptor-Host-Name 165 string ATTRIBUTE GSS-Acceptor-Service-Specifics 166 string ATTRIBUTE GSS-Acceptor-Realm-Name 167 string freeradius-server/share/dictionary.rfc7268000066400000000000000000000043671257552170400210270ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2014 The FreeRADIUS Server project and contributors # # Attributes and values defined in RFC 7268 # http://www.ietf.org/rfc/rfc7268.txt # # $Id$ # ATTRIBUTE Allowed-Called-Station-Id 174 string ATTRIBUTE EAP-Peer-Id 175 octets ATTRIBUTE EAP-Server-Id 176 octets ATTRIBUTE Mobility-Domain-Id 177 integer ATTRIBUTE Preauth-Timeout 178 integer ATTRIBUTE Network-Id-Name 179 octets # TLVs in the format defined in Figure 11-8 of Section 11.12 of # "IEEE Standard for Local and metropolitan area # networks - Port-Based Network Access Control", IEEE Std # 802.1X-2010. # # These are 7 bit TLV-Type, and 9-bit TLV-Length # # If the TLVs are too large for 253 octets, they are fragmented # into multiple attributes. ATTRIBUTE EAPoL-Announcement 180 octets ATTRIBUTE WLAN-HESSID 181 string # The upper two octets MUST be zero. # low two octets are Venue-Group and Venue-Type. # Defined in Section 8.4.1.34 of the above IEEE document. ATTRIBUTE WLAN-Venue-Info 182 integer # A two or 3 character language code selected from ISO-639. # If it's two characters, a trailing zero byte is added ATTRIBUTE WLAN-Venue-Language 183 octets ATTRIBUTE WLAN-Venue-Name 184 string # two least significant octets contain the Reason Code values defined # in Table 8-36 of Section 8.4.1.7 of the above IEEE document. ATTRIBUTE WLAN-Reason-Code 185 integer # The next four attributes are binary packed. The first 3 octets is # the OUI. The last octet is the Suite Type. # in Suite selector format as specified in Figure 8-187 within Section # 8.4.2.27.2 of [IEEE-802.11], with values of OUI and Suite Type drawn # from Table 8-99. ATTRIBUTE WLAN-Pairwise-Cipher 186 integer # same as WLAN-Pairwise-Cipher ATTRIBUTE WLAN-Group-Cipher 187 integer # in Suite selector format as specified in Figure 8-187 # within Section 8.4.2.27.2 of [IEEE-802.11], with values of OUI and # Suite Type drawn from Table 8-101: ATTRIBUTE WLAN-AKM-Suite 188 integer # same as WLAN-Pairwise-Cipher ATTRIBUTE WLAN-Group-Mgmt-Cipher 189 integer # the upper 3 octets are zero # the low octet contains the RF Band field, whose values are defined # by the IEEE 802.11 Band ID field (Table 8-53a of [IEEE-802.11ad]) ATTRIBUTE WLAN-RF-Band 190 integer freeradius-server/share/dictionary.riverbed000066400000000000000000000010521257552170400215140ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2014 The FreeRADIUS Server project and contributors ############################################################################## # # Riverbed VSAs # # https://support.riverbed.com/bin/support/static/doc/steelhead/8.5.2/html/sh_8.5.2_dg/wwhelp/wwhimpl/common/html/wwhelp.htm#href=radius_tacacs.22.04.html&single=true # # $Id$ # ############################################################################## VENDOR Riverbed 17163 BEGIN-VENDOR Riverbed ATTRIBUTE Riverbed-Local-User 1 string END-VENDOR Riverbed freeradius-server/share/dictionary.riverstone000066400000000000000000000021061257552170400221130ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2011 The FreeRADIUS Server project and contributors ############################################################################## # # Riverstone Networks' RADIUS VSAs # *** For RapidOS Versions 9.1 and above ONLY *** # # $Id$ # ############################################################################## VENDOR Riverstone 5567 # # Riverstone-Command # # This attribute is sent in Accounting-Requests, and contains text # from the admin's CLI session. # BEGIN-VENDOR Riverstone ATTRIBUTE Riverstone-Command 1 string # # This attribute is sent in Accounting-Requests, as a duplicate # of syslog for system event messages. # ATTRIBUTE Riverstone-System-Event 2 string # # This attribute is sent in Accounting-Requests, to log changes # made via SNMP. # ATTRIBUTE Riverstone-SNMP-Config-Change 3 string # # This attribute should be sent in Access-Accept packets, to set # the privilege level. It MUST be sent when the device is operating # in Mult-User Access mode. # ATTRIBUTE Riverstone-User-Level 4 integer END-VENDOR Riverstone freeradius-server/share/dictionary.roaringpenguin000066400000000000000000000012741257552170400227470ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2011 The FreeRADIUS Server project and contributors ############################################################################## # # Roaring Penguin attributes # # $Id$ # ############################################################################## VENDOR Roaring-Penguin 10055 BEGIN-VENDOR Roaring-Penguin # Upstream speed limit in kb/s ATTRIBUTE RP-Upstream-Speed-Limit 1 integer # Downstream speed limit in kb/s ATTRIBUTE RP-Downstream-Speed-Limit 2 integer # Send a HURL ATTRIBUTE RP-HURL 3 string # Send a MOTM ATTRIBUTE RP-MOTM 4 string # Maximum sessions per user ATTRIBUTE RP-Max-Sessions-Per-User 5 integer END-VENDOR Roaring-Penguin freeradius-server/share/dictionary.ruckus000066400000000000000000000012661257552170400212350ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2014 The FreeRADIUS Server project and contributors # # Ruckus Wireless, Inc. dictionary # # VENDOR Ruckus 25053 BEGIN-VENDOR Ruckus ATTRIBUTE Ruckus-User-Groups 1 string # Value Format: group_attr1,group_attr2,... ATTRIBUTE Ruckus-Sta-RSSI 2 integer ATTRIBUTE Ruckus-SSID 3 string ATTRIBUTE Ruckus-WlanID 4 integer ATTRIBUTE Ruckus-Location 5 string ATTRIBUTE Ruckus-Grace-Period 6 integer # Sent to the server, range: 1 to 14400 [minutes] ATTRIBUTE Ruckus-SCG-CBlade-IP 7 integer ATTRIBUTE Ruckus-SCG-DBlade-IP 8 integer ATTRIBUTE Ruckus-Session-Type 125 integer ATTRIBUTE Ruckus-Acct-Status 126 integer END-VENDOR Ruckus freeradius-server/share/dictionary.sg000066400000000000000000000135211257552170400203270ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2011 The FreeRADIUS Server project and contributors # # SG-1 System by Runcom Technologies Ltd. # # ftp://ftp.3gpp.org/specs/2002-06/R1999/29_series/29061-3a0.zip # # $Id$ # VENDOR SG 2454 BEGIN-VENDOR SG ATTRIBUTE SG-Filter-Redirect-Gw 1 ipaddr ATTRIBUTE SG-Accounting 10 integer ATTRIBUTE SG-Orig-Name 12 string ATTRIBUTE SG-Auth-Type 13 integer ATTRIBUTE SG-Action 14 integer ATTRIBUTE SG-SSC-Host 15 ipaddr ATTRIBUTE SG-Service-Name 16 string ATTRIBUTE SG-Personal-Site 17 string ATTRIBUTE SG-Mac-Address 18 string ATTRIBUTE SG-User-Group 19 integer ATTRIBUTE SG-Max-Allowed-Sessions 20 integer ATTRIBUTE SG-Class 21 string ATTRIBUTE SG-Eds-Enc-Key 22 string ATTRIBUTE SG-Eds-Cookie 23 string ATTRIBUTE SG-Original-Url-Prefix 24 string ATTRIBUTE SG-Max-Allowed-Nodes 25 integer ATTRIBUTE SG-Parent-User-Name 26 string ATTRIBUTE SG-Node-Group 27 integer ATTRIBUTE SG-Node-Default-Service 28 string ATTRIBUTE SG-Node-Dynamic-Service 29 string ATTRIBUTE SG-Dhcp-Server 30 ipaddr ATTRIBUTE SG-Opt82-Relay-Remote-Id 31 string ATTRIBUTE SG-Discover-Action 32 integer ATTRIBUTE SG-Release-Action 33 integer ATTRIBUTE SG-Fixed-Ip-Address 34 string ATTRIBUTE SG-Node-Fixed-Ip-Address 35 string ATTRIBUTE SG-Lease-Time 36 integer ATTRIBUTE SG-Protocol-Type 40 integer ATTRIBUTE SG-Service-Timeout 50 integer ATTRIBUTE SG-Next-Service-Name 51 string ATTRIBUTE SG-Auto-Service-Name 52 string ATTRIBUTE SG-Auth-Source 53 integer ATTRIBUTE SG-Data-Quota 54 string ATTRIBUTE SG-Acl-Data-Quota 55 string ATTRIBUTE SG-Service-Cache 56 integer ATTRIBUTE SG-Data-Quota-Used 57 string ATTRIBUTE SG-Acl-Data-Quota-Used 58 string ATTRIBUTE SG-Acl-Packet-Quota 59 string ATTRIBUTE SG-Acl-Packet-Quota-Used 60 string ATTRIBUTE SG-Roaming 61 integer ATTRIBUTE SG-Acl-Eds-Action 62 string ATTRIBUTE SG-Acl-Idle-Ignore 63 string ATTRIBUTE SG-Service-Quota-Ignore 65 string ATTRIBUTE SG-Service-Acl-Quota-Ignore 66 string ATTRIBUTE SG-Service-Acl-Quota-Indication 67 string ATTRIBUTE SG-Remote-Filter-Redirect-Gw 70 string ATTRIBUTE SG-Next-Hop 71 ipaddr ATTRIBUTE SG-Nip-Pipe-Next-Hop 72 ipaddr ATTRIBUTE SG-Advertise-Protocol 73 integer ATTRIBUTE SG-Forward-Addr 74 ipaddr ATTRIBUTE SG-Acl-Tcp-Nat-Redirect 75 string ATTRIBUTE SG-Acl-Next-Hop 76 string ATTRIBUTE SG-Tunnel-Id 80 string ATTRIBUTE SG-L2tp-Tunnel-Password 81 string ATTRIBUTE SG-Ip-Address 82 string ATTRIBUTE SG-Tunnel-Assignment-Id 83 integer ATTRIBUTE SG-Tunnel-Client-Ip-Address 84 ipaddr ATTRIBUTE SG-Nativeip 85 integer ATTRIBUTE SG-Ip-Tunnel 86 string ATTRIBUTE SG-Up-Mean-Rate 90 string ATTRIBUTE SG-Down-Mean-Rate 91 string ATTRIBUTE SG-Acl-Up-Mean-Rate 92 string ATTRIBUTE SG-Acl-Down-Mean-Rate 93 string ATTRIBUTE SG-Cos 94 string ATTRIBUTE SG-Acl-Priority 95 string ATTRIBUTE SG-Burst-Size 96 integer ATTRIBUTE SG-Ip-Primary 100 ipaddr ATTRIBUTE SG-Ip-Secondary 101 ipaddr ATTRIBUTE SG-Wimax-Reduced-Resources 110 integer ATTRIBUTE SG-Wimax-Acl-Schedule-Type 111 string ATTRIBUTE SG-Wimax-Acl-Min-Reserved-Traffic-Rate 112 string ATTRIBUTE SG-Wimax-Acl-Maximum-Traffic-Burst 113 string ATTRIBUTE SG-Wimax-Acl-Tolerated-Jitter 114 string ATTRIBUTE SG-Wimax-Acl-Maximum-Latency 115 string ATTRIBUTE SG-Wimax-Acl-Unsolicited-Grant-Int 116 string ATTRIBUTE SG-Wimax-Acl-Sdu-Size 117 string ATTRIBUTE SG-Wimax-Acl-Unsolicited-Polling-Int 118 string ATTRIBUTE SG-Wimax-MSK-Lifetime 119 integer ATTRIBUTE SG-Wimax-DM-Action-Code 120 integer ATTRIBUTE SG-Wimax-Acl-ARQ-Enable 121 string ATTRIBUTE SG-Wimax-Bsid-Next-Hop 122 ipaddr ATTRIBUTE SG-Wimax-Mobility-Features-Supported 123 integer ATTRIBUTE SG-Wimax-Node-Disconnect 124 integer ATTRIBUTE SG-Wimax-Service-Flow-Modification 125 integer ATTRIBUTE SG-Wimax-Service-Flow-Down 126 string ATTRIBUTE SG-Node-Acct-Username 130 string VALUE SG-Accounting Disable 1 VALUE SG-Accounting Enable 2 VALUE SG-Accounting Lastpacket 3 VALUE SG-Accounting Enable-On-IP-Update 4 VALUE SG-Accounting Reset-Acct-Session-ID 5 VALUE SG-Auth-Type Pre-Auth 1 VALUE SG-Auth-Type Service-Selection 2 VALUE SG-Auth-Type Web-Auth 3 VALUE SG-Action Reject 1 VALUE SG-Action Echo 2 VALUE SG-Action L2Echo 6 VALUE SG-Action Macantispoof 3 VALUE SG-Action User-Space-Overwrite 4 VALUE SG-Action User-Space-Overwrite-On-Next-Service 5 VALUE SG-Discover-Action Normal 1 VALUE SG-Discover-Action Update 2 VALUE SG-Discover-Action Pass-Through 3 VALUE SG-Release-Action Disconnect 1 VALUE SG-Release-Action Update 2 VALUE SG-Protocol-Type MLP 1 VALUE SG-Protocol-Type ROAM 2 VALUE SG-Auth-Source Service 1 VALUE SG-Auth-Source User 2 VALUE SG-Auth-Source CLI 3 VALUE SG-Service-Cache Off 1 VALUE SG-Roaming Disable 1 VALUE SG-Advertise-Protocol RIPv2 1 VALUE SG-Advertise-Protocol OSPF 2 VALUE SG-Nativeip PPP 1 VALUE SG-Wimax-Reduced-Resources Enable 1 VALUE SG-Wimax-Reduced-Resources Disable 2 VALUE SG-Wimax-DM-Action-Code Reconnect-Disable 0x000010E0 VALUE SG-Wimax-DM-Action-Code Reconnect-Disable-On-Idle 0x000410E0 VALUE SG-Wimax-DM-Action-Code Idle 0x00000005 VALUE SG-Wimax-DM-Action-Code Idle-On-Session-Idle 0x00040005 VALUE SG-Wimax-Mobility-Features-Supported Mobility 1 VALUE SG-Wimax-Mobility-Features-Supported Sleep 2 VALUE SG-Wimax-Mobility-Features-Supported Idle 4 VALUE SG-Wimax-Mobility-Features-Supported NoMobility 4294967294 VALUE SG-Wimax-Mobility-Features-Supported NoSleep 4294967293 VALUE SG-Wimax-Mobility-Features-Supported NoIdle 4294967291 VALUE SG-Wimax-Node-Disconnect Enable 0 VALUE SG-Wimax-Node-Disconnect Disable 1 VALUE SG-Wimax-Service-Flow-Modification On 2 VALUE SG-Wimax-Service-Flow-Modification Off 1 VALUE Acct-Status-Type SG-Service-Start 0x09960001 VALUE Acct-Status-Type SG-Service-Stop 0x09960002 END-VENDOR SG freeradius-server/share/dictionary.shasta000066400000000000000000000010541257552170400211770ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2011 The FreeRADIUS Server project and contributors # # dictionary.shasta # # Nortel Shasta VSAs # Andre Gustavo de C. Albuquerque # VENDOR Shasta 3199 # # Standard attribute # BEGIN-VENDOR Shasta ATTRIBUTE Shasta-User-Privilege 1 integer ATTRIBUTE Shasta-Service-Profile 2 string ATTRIBUTE Shasta-VPN-Name 3 string VALUE Shasta-User-Privilege User 1 VALUE Shasta-User-Privilege Super-User 2 VALUE Shasta-User-Privilege SSuper-User 3 END-VENDOR Shasta freeradius-server/share/dictionary.shiva000066400000000000000000000101251257552170400210250ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2011 The FreeRADIUS Server project and contributors # # Shiva dictionary. # # Shiva Inc. # http://www.shiva.com/ # # For more information on magic values for Shiva-User-Attributes, # see their web page, at: # # http://www.shiva.com/prod/kbase/mapping.html # # Enable by putting the line "$INCLUDE dictionary.shiva" into # the main dictionary file. # # Version: 1.00 27-Apr-1999 contributed by Alan DeKok # $Id$ # VENDOR Shiva 166 # Shiva Extensions # # This next attribute is Shiva's attempt to create their own # VSA in the main dictionary. Don't use it. It's a bad idea. # #ATTRIBUTE Shiva-User-Attributes 51 string BEGIN-VENDOR Shiva ATTRIBUTE Shiva-User-Attributes 1 string ATTRIBUTE Shiva-Compression 30 integer ATTRIBUTE Shiva-Dialback-Delay 31 integer ATTRIBUTE Shiva-Call-Durn-Trap 32 integer ATTRIBUTE Shiva-Bandwidth-Trap 33 integer ATTRIBUTE Shiva-Minimum-Call 34 integer ATTRIBUTE Shiva-Default-Host 35 string ATTRIBUTE Shiva-Menu-Name 36 string ATTRIBUTE Shiva-User-Flags 37 string ATTRIBUTE Shiva-Termtype 38 string ATTRIBUTE Shiva-Break-Key 39 string ATTRIBUTE Shiva-Fwd-Key 40 string ATTRIBUTE Shiva-Bak-Key 41 string ATTRIBUTE Shiva-Dial-Timeout 42 integer ATTRIBUTE Shiva-LAT-Port 43 string ATTRIBUTE Shiva-Max-VCs 44 integer ATTRIBUTE Shiva-DHCP-Leasetime 45 integer ATTRIBUTE Shiva-LAT-Groups 46 string ATTRIBUTE Shiva-RTC-Timestamp 60 integer ATTRIBUTE Shiva-Circuit-Type 61 integer ATTRIBUTE Shiva-Called-Number 90 string ATTRIBUTE Shiva-Calling-Number 91 string ATTRIBUTE Shiva-Customer-Id 92 string ATTRIBUTE Shiva-Type-Of-Service 93 integer ATTRIBUTE Shiva-Link-Speed 94 integer ATTRIBUTE Shiva-Links-In-Bundle 95 integer ATTRIBUTE Shiva-Compression-Type 96 integer ATTRIBUTE Shiva-Link-Protocol 97 integer ATTRIBUTE Shiva-Network-Protocols 98 integer ATTRIBUTE Shiva-Session-Id 99 integer ATTRIBUTE Shiva-Disconnect-Reason 100 integer ATTRIBUTE Shiva-Acct-Serv-Switch 101 ipaddr ATTRIBUTE Shiva-Event-Flags 102 integer ATTRIBUTE Shiva-Function 103 integer ATTRIBUTE Shiva-Connect-Reason 104 integer VALUE Shiva-Compression None 0 VALUE Shiva-Compression Negotiate 1 VALUE Shiva-Compression Spider 2 VALUE Shiva-Compression Predictor 3 VALUE Shiva-Compression STAC 4 VALUE Shiva-Circuit-Type Primary 1 VALUE Shiva-Circuit-Type Secondary-Backup 2 VALUE Shiva-Circuit-Type Secondary-Augment 3 VALUE Shiva-Circuit-Type Secondary-Switch 4 VALUE Shiva-Circuit-Type Listener 5 VALUE Shiva-Circuit-Type RADIUS 6 # Shiva Type Of Service Values VALUE Shiva-Type-Of-Service Analog 1 VALUE Shiva-Type-Of-Service Digitized-Analog 2 VALUE Shiva-Type-Of-Service Digital 3 VALUE Shiva-Type-Of-Service Digital-V110 4 VALUE Shiva-Type-Of-Service Digital-V120 5 VALUE Shiva-Type-Of-Service Digital-Leased-Line 6 # Shiva Link Protocol Values VALUE Shiva-Link-Protocol HDLC 1 VALUE Shiva-Link-Protocol ARAV1 2 VALUE Shiva-Link-Protocol ARAV2 3 VALUE Shiva-Link-Protocol SHELL 4 VALUE Shiva-Link-Protocol AALAP 5 VALUE Shiva-Link-Protocol SLIP 6 # Shiva Connect Reason Values VALUE Shiva-Connect-Reason Remote 1 VALUE Shiva-Connect-Reason Dialback 2 VALUE Shiva-Connect-Reason Virtual-Connection 3 VALUE Shiva-Connect-Reason Bandwidth-On-Demand 4 # Shiva Disconnect Reason Values VALUE Shiva-Disconnect-Reason Remote 1 VALUE Shiva-Disconnect-Reason Error 2 VALUE Shiva-Disconnect-Reason Idle-Timeout 3 VALUE Shiva-Disconnect-Reason Session-Timeout 4 VALUE Shiva-Disconnect-Reason Admin-Disconnect 5 VALUE Shiva-Disconnect-Reason Dialback 6 VALUE Shiva-Disconnect-Reason Virtual-Connection 7 VALUE Shiva-Disconnect-Reason Bandwidth-On-Demand 8 VALUE Shiva-Disconnect-Reason Failed-Authentication 9 VALUE Shiva-Disconnect-Reason Preempted 10 VALUE Shiva-Disconnect-Reason Blocked 11 VALUE Shiva-Disconnect-Reason Tariff-Management 12 VALUE Shiva-Disconnect-Reason Backup 13 # Shiva Function Values VALUE Shiva-Function Unknown 0 VALUE Shiva-Function Dialin 1 VALUE Shiva-Function Dialout 2 VALUE Shiva-Function Lan-To-Lan 3 END-VENDOR Shiva freeradius-server/share/dictionary.siemens000066400000000000000000000013431257552170400213600ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2011 The FreeRADIUS Server project and contributors ############################################################################## # # Siemens # # $Id$ # ############################################################################## VENDOR Siemens 4329 BEGIN-VENDOR Siemens ATTRIBUTE Siemens-URL-Redirection 1 string ATTRIBUTE Siemens-AP-Name 2 string ATTRIBUTE Siemens-AP-Serial 3 string ATTRIBUTE Siemens-VNS-Name 4 string ATTRIBUTE Siemens-SSID 5 string ATTRIBUTE Siemens-BSS-MAC 6 string ATTRIBUTE Siemens-Policy-Name 7 string ATTRIBUTE Siemens-Topology-Name 8 string ATTRIBUTE Siemens-Ingress-RC-Name 9 string ATTRIBUTE Siemens-Egress-RC-Name 10 string END-VENDOR Siemens freeradius-server/share/dictionary.slipstream000066400000000000000000000007551257552170400221060ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2011 The FreeRADIUS Server project and contributors ############################################################################## # # For Slipstream dialup accelerator servers # Created based on # slipstream_sp_6.0_installation_and_configuration_guide.pdf # # $Id$ # ############################################################################## VENDOR Slipstream 7000 BEGIN-VENDOR Slipstream ATTRIBUTE Slipstream-Auth 1 string END-VENDOR Slipstream freeradius-server/share/dictionary.sofaware000066400000000000000000000021111257552170400215160ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2011 The FreeRADIUS Server project and contributors ############################################################################## # # Sofaware VPN-1 Edge from Sofaware (Check Point appliance). # # Values are strings, rather than real VALUEs. # # SofaWare-Admin : "none" / "readonly" / "readwrite" # Users have no, read-only or read-write access to the # appliance's configuration interface (Web / SSH) # # SofaWare-VPN : `true" / "false" # User can / cannot connect the VPN # # SofaWare-Hotspot : "true" / "false" # The account can be used for authentication on the # Hotspot web page (may be required before accessing # the Internet) # # SofaWare-UFP : "true" / "false" # The user can /cannot overwrite the URL Filtering policy # # $Id$ # ############################################################################## VENDOR SofaWare 6983 BEGIN-VENDOR SofaWare ATTRIBUTE SofaWare-Admin 1 string ATTRIBUTE SofaWare-VPN 2 string ATTRIBUTE SofaWare-Hotspot 3 string ATTRIBUTE SofaWare-UFP 4 string END-VENDOR SofaWare freeradius-server/share/dictionary.sonicwall000066400000000000000000000051661257552170400217170ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2011 The FreeRADIUS Server project and contributors # # Sonicwall Firewall dictionary # # $Id$ # VENDOR SonicWall 8741 # Backwards compatibility. BEGIN-VENDOR SonicWall ATTRIBUTE SS3-Firewall-User-Privilege 1 integer # New names. ATTRIBUTE SonicWall-User-Privilege 1 integer VALUE SonicWall-User-Privilege Remote-Access 1 # deprecated VALUE SonicWall-User-Privilege Bypass-Filters 2 VALUE SonicWall-User-Privilege VPN-Client-Access 3 # standard VALUE SonicWall-User-Privilege Access-To-VPN 4 # standard VALUE SonicWall-User-Privilege Limited-Management 5 VALUE SonicWall-User-Privilege L2TP-Client-Access 6 # standard VALUE SonicWall-User-Privilege Wireless-Guest 7 # standard VALUE SonicWall-User-Privilege Wireless-Add-ACL 8 VALUE SonicWall-User-Privilege Internet-Access 9 # standard # Those values indicated as "standard" are applicable only on a SonicWall # firewall running standard firmware and not on one running enhanced firmware. # # This attribute is to use in place of SonicWall-User-Privilege with RADIUS # servers that allow only one instance of a Vendor-Specific attribute to be # set (such as the ACE Server from RSA). Note that it is commented out in this # file because it is not needed in any servers that support multiple VSA's. # # The value of this attribute is a text string giving a comma-separated list # of one or more privileges, each corresponding to a value of the # SonicWall-User-Privilege attribute above (and note that some are applicable # only on a SonicWall firewall running standard firmware as indicated above): # "BF,VC,VA,LM,LA,WG,WA,IA" # "RA" for "Remote-Access" is now deprecated. # ATTRIBUTE SonicWall-User-Privileges 2 string SonicWall # Multiple of these can be set for a user, each specifying the name of a # user group to which that user has membership. Note that this can # alternatively be achieved by use of the Filter-Id attribute. # This is applicable only on a SonicWall firewall running enhanced firmware. # ATTRIBUTE SonicWall-User-Group 3 string # This attribute is to use in place of SonicWall-User-Group with RADIUS # servers that allow only one instance of a Vendor-Specific attribute to be # set (such as the ACE Server from RSA). Note that it is commented out in this # file because it is not needed in any servers that support multiple VSA's. # # The value of this attribute is a text string giving a comma-separated list # of the names of one or more user groups to which that user has membership. # This is applicable only on a SonicWall firewall running enhanced firmware. # # ATTRIBUTE SonicWall-User-Groups 4 string SonicWall. END-VENDOR SonicWall freeradius-server/share/dictionary.springtide000066400000000000000000000017761257552170400220770ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2011 The FreeRADIUS Server project and contributors ############################################################################## # # SpringTide VSAs # # $Id$ # ############################################################################## VENDOR SpringTide 3551 BEGIN-VENDOR SpringTide ATTRIBUTE ST-Acct-VC-Connection-Id 1 string ATTRIBUTE ST-Service-Name 2 string ATTRIBUTE ST-Service-Domain 3 integer ATTRIBUTE ST-Policy-Name 4 string ATTRIBUTE ST-Primary-DNS-Server 5 ipaddr ATTRIBUTE ST-Secondary-DNS-Server 6 ipaddr ATTRIBUTE ST-Primary-NBNS-Server 7 ipaddr ATTRIBUTE ST-Secondary-NBNS-Server 8 ipaddr ATTRIBUTE ST-Physical-Port 9 integer ATTRIBUTE ST-Physical-Slot 10 integer ATTRIBUTE ST-Virtual-Path-ID 11 integer ATTRIBUTE ST-Virtual-Circuit-ID 12 integer ATTRIBUTE ST-Realm-Name 13 string ATTRIBUTE ST-IPSec-Pfs-Group 14 integer ATTRIBUTE ST-IPSec-Client-Firewall 15 integer ATTRIBUTE ST-IPSec-Client-Subnet 16 string END-VENDOR SpringTide freeradius-server/share/dictionary.starent000066400000000000000000001671241257552170400214070ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2011 The FreeRADIUS Server project and contributors ############################################################################## # # Starent dictionary # http://www.starentnetworks.com/ # # Starent dictionary with 2 bytes tag and 2 byte length. # # The source of this document is a Cisco Manual: # "Cisco ASR 5000 Series AAA and GTP Interface Administration and # Reference Release 12.x (Last Updated May 31, 2011)" # # This document is available at: # http://www.cisco.com/en/US/products/ps11072/products_implementation_design_guides_list.html # ############################################################################## VENDOR Starent 8164 format=2,2 BEGIN-VENDOR Starent ATTRIBUTE SN-VPN-ID 1 integer ATTRIBUTE SN-VPN-Name 2 string ATTRIBUTE SN-Disconnect-Reason 3 integer ATTRIBUTE SN-PPP-Progress-Code 4 integer ATTRIBUTE SN-Primary-DNS-Server 5 ipaddr ATTRIBUTE SN-Secondary-DNS-Server 6 ipaddr ATTRIBUTE SN-Re-CHAP-Interval 7 integer ATTRIBUTE SN-IP-Pool-Name 8 string ATTRIBUTE SN-PPP-Data-Compression 9 integer ATTRIBUTE SN-IP-Filter-In 10 string ATTRIBUTE SN-IP-Filter-Out 11 string ATTRIBUTE SN-Local-IP-Address 13 ipaddr ATTRIBUTE SN-IP-Source-Validation 14 integer ATTRIBUTE SN-PPP-Outbound-Password 15 string ATTRIBUTE SN-PPP-Keepalive 16 integer ATTRIBUTE SN-IP-In-ACL 17 string ATTRIBUTE SN-IP-Out-ACL 18 string ATTRIBUTE SN-PPP-Data-Compression-Mode 19 integer ATTRIBUTE SN-Subscriber-Permission 20 integer ATTRIBUTE SN-Admin-Permission 21 integer ATTRIBUTE SN-Simultaneous-SIP-MIP 22 integer ATTRIBUTE SN-Min-Compress-Size 23 integer ATTRIBUTE SN-Service-Type 24 integer ATTRIBUTE SN-DNS-Proxy-Use-Subscr-Addr 25 integer ATTRIBUTE SN-Tunnel-Password 26 octets ATTRIBUTE SN-Tunnel-Load-Balancing 27 integer ATTRIBUTE SN-MN-HA-Timestamp-Tolerance 30 integer ATTRIBUTE SN-Prepaid-Compressed-Count 31 integer ATTRIBUTE SN-Prepaid-Inbound-Octets 32 integer ATTRIBUTE SN-Prepaid-Outbound-Octets 33 integer ATTRIBUTE SN-Prepaid-Total-Octets 34 integer ATTRIBUTE SN-Prepaid-Timeout 35 integer ATTRIBUTE SN-Prepaid-Watermark 36 integer ATTRIBUTE SN-NAI-Construction-Domain 37 string ATTRIBUTE SN-Tunnel-ISAKMP-Crypto-Map 38 string ATTRIBUTE SN-Tunnel-ISAKMP-Secret 39 string ATTRIBUTE SN-Ext-Inline-Srvr-Context 41 string ATTRIBUTE SN-L3-to-L2-Tun-Addr-Policy 43 integer ATTRIBUTE SN-Long-Duration-Timeout 44 integer ATTRIBUTE SN-Long-Duration-Action 45 integer ATTRIBUTE SN-PDSN-Handoff-Req-IP-Addr 46 integer ATTRIBUTE SN-HA-Send-DNS-ADDRESS 47 integer ATTRIBUTE SN-MIP-Send-Term-Verification 48 integer ATTRIBUTE SN-Data-Tunnel-Ignore-DF-Bit 49 integer ATTRIBUTE SN-MIP-AAA-Assign-Addr 50 integer ATTRIBUTE SN-Proxy-MIP 52 integer ATTRIBUTE SN-MIP-Match-AAA-Assign-Addr 51 integer ATTRIBUTE SN-IP-Alloc-Method 53 integer ATTRIBUTE SN-Gratuitous-ARP-Aggressive 54 integer ATTRIBUTE SN-Ext-Inline-Srvr-Up-Addr 55 ipaddr ATTRIBUTE SN-Ext-Inline-Srvr-Down-Addr 56 ipaddr ATTRIBUTE SN-Ext-Inline-Srvr-Preference 57 integer ATTRIBUTE SN-Ext-Inline-Srvr-Up-VLAN 58 octets ATTRIBUTE SN-Ext-Inline-Srvr-Down-VLAN 59 octets ATTRIBUTE SN-IP-Hide-Service-Address 60 integer ATTRIBUTE SN-PPP-Outbound-Username 61 string ATTRIBUTE SN-GTP-Version 62 integer ATTRIBUTE SN-Access-link-IP-Frag 63 integer ATTRIBUTE SN-Subscriber-Accounting 64 integer ATTRIBUTE SN-Nw-Reachability-Server-Name 65 string ATTRIBUTE SN-Subscriber-IP-Hdr-Neg-Mode 67 integer ATTRIBUTE SN-GGSN-MIP-Required 68 integer ATTRIBUTE SN-Subscriber-Acct-Start 69 integer ATTRIBUTE SN-Subscriber-Acct-Interim 70 integer ATTRIBUTE SN-Subscriber-Acct-Stop 71 integer ATTRIBUTE SN-QoS-Tp-Dnlk 73 integer ATTRIBUTE SN-Tp-Dnlk-Committed-Data-Rate 74 integer ATTRIBUTE SN-Tp-Dnlk-Peak-Data-Rate 75 integer ATTRIBUTE SN-Tp-Dnlk-Burst-Size 76 integer ATTRIBUTE SN-Tp-Dnlk-Exceed-Action 77 integer ATTRIBUTE SN-Tp-Dnlk-Violate-Action 78 integer ATTRIBUTE SN-QoS-Tp-Uplk 79 integer ATTRIBUTE SN-Tp-Uplk-Committed-Data-Rate 80 integer ATTRIBUTE SN-Tp-Uplk-Peak-Data-Rate 81 integer ATTRIBUTE SN-Tp-Uplk-Burst-Size 82 integer ATTRIBUTE SN-Tp-Uplk-Exceed-Action 83 integer ATTRIBUTE SN-Tp-Uplk-Violate-Action 84 integer ATTRIBUTE SN-Subscriber-IP-TOS-Copy 85 integer ATTRIBUTE SN-QoS-Conversation-Class 86 octets ATTRIBUTE SN-QoS-Streaming-Class 87 octets ATTRIBUTE SN-QoS-Interactive1-Class 88 octets ATTRIBUTE SN-QoS-Interactive2-Class 89 octets ATTRIBUTE SN-QoS-Interactive3-Class 90 octets ATTRIBUTE SN-QoS-Background-Class 91 octets ATTRIBUTE SN-PPP-NW-Layer-IPv4 92 integer ATTRIBUTE SN-PPP-NW-Layer-IPv6 93 integer ATTRIBUTE SN-Virtual-APN-Name 94 string ATTRIBUTE SN-PPP-Accept-Peer-v6Ifid 95 integer ATTRIBUTE SN-IPv6-rtr-advt-interval 96 integer ATTRIBUTE SN-IPv6-num-rtr-advt 97 integer ATTRIBUTE SN-NPU-Qos-Priority 98 integer ATTRIBUTE SN-MN-HA-Hash-Algorithm 99 integer ATTRIBUTE SN-Subscriber-Acct-Rsp-Action 100 integer ATTRIBUTE SN-IPv6-Primary-DNS 101 ipv6addr ATTRIBUTE SN-IPv6-Secondary-DNS 102 octets ATTRIBUTE SN-IPv6-Egress-Filtering 103 integer ATTRIBUTE SN-Mediation-VPN-Name 104 string ATTRIBUTE SN-Mediation-Acct-Rsp-Action 105 integer ATTRIBUTE SN-Home-Sub-Use-GGSN 106 integer ATTRIBUTE SN-Visiting-Sub-Use-GGSN 107 integer ATTRIBUTE SN-Roaming-Sub-Use-GGSN 108 integer ATTRIBUTE SN-Home-Profile 109 integer ATTRIBUTE SN-IP-Src-Validation-Drop-Limit 110 integer ATTRIBUTE SN-QoS-Class-Conversational-PHB 111 integer ATTRIBUTE SN-QoS-Class-Streaming-PHB 112 integer ATTRIBUTE SN-QoS-Class-Background-PHB 113 integer ATTRIBUTE SN-QoS-Class-Interactive-1-PHB 114 integer ATTRIBUTE SN-QoS-Class-Interactive-2-PHB 115 integer ATTRIBUTE SN-QoS-Class-Interactive-3-PHB 116 integer ATTRIBUTE SN-Visiting-Profile 117 integer ATTRIBUTE SN-Roaming-Profile 118 integer ATTRIBUTE SN-Home-Behavior 119 integer ATTRIBUTE SN-Visiting-Behavior 120 integer ATTRIBUTE SN-Roaming-Behavior 121 integer ATTRIBUTE SN-Internal-SM-Index 122 integer ATTRIBUTE SN-Mediation-Enabled 123 integer ATTRIBUTE SN-IPv6-Sec-Pool 124 string ATTRIBUTE SN-IPv6-Sec-Prefix 125 octets ATTRIBUTE SN-IPv6-DNS-Proxy 126 integer ATTRIBUTE SN-Subscriber-Nexthop-Address 127 integer ATTRIBUTE SN-Prepaid 128 integer ATTRIBUTE SN-Prepaid-Preference 129 integer ATTRIBUTE SN-PPP-Always-On-Vse 130 integer ATTRIBUTE SN-Voice-Push-List-Name 131 string ATTRIBUTE SN-Unclassify-List-Name 132 string ATTRIBUTE SN-Subscriber-No-Interims 133 integer ATTRIBUTE SN-Permit-User-Mcast-PDUs 134 integer ATTRIBUTE SN-Prepaid-Final-Duration-Alg 135 integer ATTRIBUTE SN-IPv6-Min-Link-MTU 136 integer ATTRIBUTE SN-Charging-VPN-Name 137 string ATTRIBUTE SN-Chrg-Char-Selection-Mode 138 integer ATTRIBUTE SN-Cause-For-Rec-Closing 139 integer ATTRIBUTE SN-Change-Condition 140 integer ATTRIBUTE SN-Dynamic-Addr-Alloc-Ind-Flag 141 octets ATTRIBUTE SN-Ntk-Initiated-Ctx-Ind-Flag 142 octets ATTRIBUTE SN-Ntk-Session-Disconnect-Flag 143 integer ATTRIBUTE SN-Enable-QoS-Renegotiation 144 integer ATTRIBUTE SN-QoS-Renegotiation-Timeout 145 integer ATTRIBUTE SN-QoS-Negotiated 147 string ATTRIBUTE SN-Mediation-No-Interims 146 integer ATTRIBUTE SN-Primary-NBNS-Server 148 ipaddr ATTRIBUTE SN-Secondary-NBNS-Server 149 ipaddr ATTRIBUTE SN-IP-Header-Compression 150 integer ATTRIBUTE SN-Mode 151 integer #ATTRIBUTE SN-ROHC-Mode 151 integer ATTRIBUTE SN-Assigned-VLAN-ID 152 short ATTRIBUTE SN-Direction 153 integer ATTRIBUTE SN-MIP-HA-Assignment-Table 154 string ATTRIBUTE SN-Tun-Addr-Policy 156 integer ATTRIBUTE SN-DHCP-Lease-Expiry-Policy 157 integer ATTRIBUTE SN-Subscriber-Template-Name 158 string ATTRIBUTE SN-Subs-IMSA-Service-Name 159 string ATTRIBUTE SN-Traffic-Group 161 integer ATTRIBUTE SN-Rad-APN-Name 162 octets ATTRIBUTE SN-MIP-Send-Ancid 163 integer ATTRIBUTE SN-MIP-Send-Imsi 164 integer ATTRIBUTE SN-MIP-Dual-Anchor 165 integer ATTRIBUTE SN-MIP-ANCID 166 octets ATTRIBUTE SN-IMS-AM-Address 167 ipaddr ATTRIBUTE SN-IMS-AM-Domain-Name 168 octets ATTRIBUTE SN-Service-Address 169 ipaddr ATTRIBUTE SN-PDIF-MIP-Required 170 integer ATTRIBUTE SN-FMC-Location 171 octets ATTRIBUTE SN-PDIF-MIP-Release-TIA 172 integer ATTRIBUTE SN-PDIF-MIP-Simple-IP-Fallback 173 integer ATTRIBUTE SN-Tunnel-Gn 174 integer ATTRIBUTE SN-MIP-Reg-Lifetime-Realm 175 integer ATTRIBUTE SN-Ecs-Data-Volume 176 octets ATTRIBUTE SN-QoS-Traffic-Policy 177 octets ATTRIBUTE SN-ANID 178 octets ATTRIBUTE SN-PPP-Reneg-Disc 187 integer ATTRIBUTE SN-MIP-Send-Correlation-Info 188 integer ATTRIBUTE SN-PDSN-Correlation-Id 189 octets ATTRIBUTE SN-PDSN-NAS-Id 190 string ATTRIBUTE SN-PDSN-NAS-IP-Address 191 ipaddr ATTRIBUTE SN-Subscriber-Acct-Mode 192 integer ATTRIBUTE SN-IP-In-Plcy-Grp 193 string ATTRIBUTE SN-IP-Out-Plcy-Grp 194 string ATTRIBUTE SN-IP-Source-Violate-No-Acct 196 integer ATTRIBUTE SN-Firewall-Enabled 198 integer ATTRIBUTE SNA-PPP-Unfr-data-In-Oct 200 integer ATTRIBUTE SNA-PPP-Unfr-data-Out-Oct 201 integer ATTRIBUTE SNA-PPP-Unfr-Data-In-Gig 202 integer ATTRIBUTE SNA-PPP-Unfr-Data-Out-Gig 203 integer ATTRIBUTE SN-Admin-Expiry 204 integer ATTRIBUTE SNA-Input-Gigawords 206 integer ATTRIBUTE SNA-Output-Gigawords 207 integer ATTRIBUTE SN-DNS-Proxy-Intercept-List 214 string ATTRIBUTE SN-Subscriber-Class 219 integer ATTRIBUTE SN-CFPolicy-ID 220 integer ATTRIBUTE SN-Subs-VJ-Slotid-Cmp-Neg-Mode 221 integer ATTRIBUTE SN-Primary-DCCA-Peer 223 string ATTRIBUTE SN-Secondary-DCCA-Peer 224 string ATTRIBUTE SN-Subs-Acc-Flow-Traffic-Valid 225 integer ATTRIBUTE SN-Acct-Input-Packets-Dropped 226 integer ATTRIBUTE SN-Acct-Output-Packets-Dropped 227 integer # SN-Acct-Input-Octets-Dropped is octets and not integer as length is 8 ATTRIBUTE SN-Acct-Input-Octets-Dropped 228 octets # SN-Acct-Output-Octets-Dropped is octets and not integer as length is 8 ATTRIBUTE SN-Acct-Output-Octets-Dropped 229 octets ATTRIBUTE SN-Acct-Input-Giga-Dropped 230 integer ATTRIBUTE SN-Acct-Output-Giga-Dropped 231 integer ATTRIBUTE SN-Overload-Disc-Connect-Time 233 integer ATTRIBUTE SN-Overload-Disconnect 235 integer ATTRIBUTE SN-Radius-Returned-Username 236 integer ATTRIBUTE SN-ROHC-Profile-Name 238 string ATTRIBUTE SN-Firewall-Policy 239 octets ATTRIBUTE SN-Transparent-Data 247 octets ATTRIBUTE SN-MS-ISDN 248 octets ATTRIBUTE SN-Routing-Area-Id 249 string #ATTRIBUTE SN-Rulebase 249 string ATTRIBUTE SN-Call-Id 251 integer ATTRIBUTE SN-IMSI 252 octets ATTRIBUTE SN-Long-Duration-Notification 253 integer ATTRIBUTE SN-SIP-Method 254 integer ATTRIBUTE SN-Event 255 string ATTRIBUTE SN-Role-Of-Node 256 integer ATTRIBUTE SN-Session-Id 257 string ATTRIBUTE SN-SIP-Request-Time-Stamp 258 string ATTRIBUTE SN-SIP-Response-Time-Stamp 259 string ATTRIBUTE SN-IMS-Charging-Identifier 260 string ATTRIBUTE SN-Originating-IOI 261 string ATTRIBUTE SN-Terminating-IOI 262 string ATTRIBUTE SN-SDP-Session-Description 263 string ATTRIBUTE SN-GGSN-Address 264 ipaddr ATTRIBUTE SN-Sec-IP-Pool-Name 265 string ATTRIBUTE SN-Authorised-Qos 266 string ATTRIBUTE SN-Cause-Code 267 integer ATTRIBUTE SN-Node-Functionality 268 integer ATTRIBUTE SN-Is-Unregistered-Subscriber 269 string ATTRIBUTE SN-Content-Type 270 string ATTRIBUTE SN-Content-Length 271 string ATTRIBUTE SN-Content-Disposition 272 string ATTRIBUTE SN-CSCF-Rf-SDP-Media-Components 273 octets ATTRIBUTE SN-ROHC-Flow-Marking-Mode 274 integer # Attribute 275 has three clashing values. # ATTRIBUTE SN-Inactivity-Time 275 integer ATTRIBUTE SN-CSCF-App-Server-Info 275 octets ATTRIBUTE SN-ISC-Template-Name 276 string ATTRIBUTE SN-CF-Forward-Unconditional 277 string ATTRIBUTE SN-CF-Forward-No-Answer 278 string ATTRIBUTE SN-CF-Forward-Busy-Line 279 string ATTRIBUTE SN-CF-Forward-Not-Regd 280 string ATTRIBUTE SN-CF-Follow-Me 281 string ATTRIBUTE SN-CF-CId-Display 282 integer ATTRIBUTE SN-CF-CId-Display-Blocked 283 integer ATTRIBUTE SN-CF-Call-Waiting 284 integer ATTRIBUTE SN-CF-Call-Transfer 285 integer ATTRIBUTE SN-Cscf-Subscriber-Ip-Address 287 ipaddr ATTRIBUTE SN-Software-Version 288 string ATTRIBUTE SN-Max-Sec-Contexts-Per-Subs 290 integer ATTRIBUTE SN-CF-Call-Local 291 integer ATTRIBUTE SN-CF-Call-LongDistance 292 integer ATTRIBUTE SN-CF-Call-International 293 integer ATTRIBUTE SN-CF-Call-Premium 294 integer ATTRIBUTE SN-CR-International-Cid 295 integer ATTRIBUTE SN-CR-LongDistance-Cid 296 integer ATTRIBUTE SN-NAT-IP-Address 297 ipaddr ATTRIBUTE SN-CF-Call-RoamingInternatnl 298 integer ATTRIBUTE SN-PDG-TTG-Required 299 integer ATTRIBUTE SN-Bandwidth-Policy 300 string ATTRIBUTE SN-Acs-Credit-Control-Group 301 string ATTRIBUTE SN-CBB-Policy 302 string ATTRIBUTE SN-QOS-HLR-Profile 303 octets ATTRIBUTE SN-Fast-Reauth-Username 304 octets ATTRIBUTE SN-Pseudonym-Username 305 octets ATTRIBUTE SN-WiMAX-Auth-Only 206 integer ATTRIBUTE SN-TrafficSelector-Class 307 integer ATTRIBUTE SN-DHCP-Options 309 octets ATTRIBUTE SN-Handoff-Indicator 310 integer ATTRIBUTE SNA-PPP-Ctrl-Input-Octets 1001 integer ATTRIBUTE SNA-PPP-Ctrl-Output-Octets 1002 integer ATTRIBUTE SNA-PPP-Ctrl-Input-Packets 1003 integer ATTRIBUTE SNA-PPP-Ctrl-Output-Packets 1004 integer ATTRIBUTE SNA-PPP-Framed-Input-Octets 1005 integer ATTRIBUTE SNA-PPP-Framed-Output-Octets 1006 integer ATTRIBUTE SNA-PPP-Discards-Input 1007 integer ATTRIBUTE SNA-PPP-Discards-Output 1008 integer ATTRIBUTE SNA-PPP-Errors-Input 1009 integer ATTRIBUTE SNA-PPP-Errors-Output 1010 integer ATTRIBUTE SNA-PPP-Bad-Addr 1011 integer ATTRIBUTE SNA-PPP-Bad-Ctrl 1012 integer ATTRIBUTE SNA-PPP-Packet-Too-Long 1013 integer ATTRIBUTE SNA-PPP-Bad-FCS 1014 integer ATTRIBUTE SNA-PPP-Echo-Req-Input 1015 integer ATTRIBUTE SNA-PPP-Echo-Req-Output 1016 integer ATTRIBUTE SNA-PPP-Echo-Rsp-Input 1017 integer ATTRIBUTE SNA-PPP-Echo-Rsp-Output 1018 integer ATTRIBUTE SNA-RPRRQ-Rcvd-Total 1019 integer ATTRIBUTE SNA-RPRRQ-Rcvd-Acc-Reg 1020 integer ATTRIBUTE SNA-RPRRQ-Rcvd-Acc-Dereg 1021 integer ATTRIBUTE SNA-RPRRQ-Rcvd-Msg-Auth-Fail 1022 integer ATTRIBUTE SNA-RPRRQ-Rcvd-Mis-ID 1023 integer ATTRIBUTE SNA-RPRRQ-Rcvd-Badly-Formed 1024 integer ATTRIBUTE SNA-RPRRQ-Rcvd-VID-Unsupported 1025 integer ATTRIBUTE SNA-RPRRQ-Rcvd-T-Bit-Not-Set 1026 integer ATTRIBUTE SNA-RPRAK-Rcvd-Total 1027 integer ATTRIBUTE SNA-RPRAK-Rcvd-Acc-Ack 1028 integer ATTRIBUTE SNA-RPRAK-Rcvd-Msg-Auth-Fail 1029 integer ATTRIBUTE SNA-RPRAK-Rcvd-Mis-ID 1030 integer ATTRIBUTE SNA-RP-Reg-Reply-Sent-Total 1031 integer ATTRIBUTE SNA-RP-Reg-Reply-Sent-Acc-Reg 1032 integer ATTRIBUTE SNA-RP-Reg-Reply-Sent-Acc-Dereg 1033 integer ATTRIBUTE SNA-RP-Reg-Reply-Sent-Bad-Req 1034 integer ATTRIBUTE SNA-RP-Reg-Reply-Sent-Denied 1035 integer ATTRIBUTE SNA-RP-Reg-Reply-Sent-Mis-ID 1036 integer ATTRIBUTE SNA-RP-Reg-Reply-Sent-Send-Err 1037 integer ATTRIBUTE SNA-RP-Reg-Upd-Sent 1038 integer ATTRIBUTE SNA-RP-Reg-Upd-Re-Sent 1039 integer ATTRIBUTE SNA-RP-Reg-Upd-Send-Err 1040 integer ATTRIBUTE SN-Proxy-MIPV6 65530 integer VALUE SN-Disconnect-Reason Not-Defined 0 VALUE SN-Disconnect-Reason Admin-Disconnect 1 VALUE SN-Disconnect-Reason Remote-Disconnect 2 VALUE SN-Disconnect-Reason Local-Disconnect 3 VALUE SN-Disconnect-Reason Disc-No-Resource 4 VALUE SN-Disconnect-Reason Disc-Excd-Service-Limit 5 VALUE SN-Disconnect-Reason PPP-LCP-Neg-Failed 6 VALUE SN-Disconnect-Reason PPP-LCP-No-Response 7 VALUE SN-Disconnect-Reason PPP-LCP-Loopback 8 VALUE SN-Disconnect-Reason PPP-LCP-Max-Retry 9 VALUE SN-Disconnect-Reason PPP-Echo-Failed 10 VALUE SN-Disconnect-Reason PPP-Auth-Failed 11 VALUE SN-Disconnect-Reason PPP-Auth-Failed-No-AAA-Resp 12 VALUE SN-Disconnect-Reason PPP-Auth-No-Response 13 VALUE SN-Disconnect-Reason PPP-Auth-Max-Retry 14 VALUE SN-Disconnect-Reason Invalid-AAA-Attr 15 VALUE SN-Disconnect-Reason Failed-User-Filter 16 VALUE SN-Disconnect-Reason Failed-Provide-Service 17 VALUE SN-Disconnect-Reason Invalid-IP-Address-AAA 18 VALUE SN-Disconnect-Reason Invalid-IP-Pool-AAA 19 VALUE SN-Disconnect-Reason PPP-IPCP-Neg-Failed 20 VALUE SN-Disconnect-Reason PPP-IPCP-No-Response 21 VALUE SN-Disconnect-Reason PPP-IPCP-Max-Retry 22 VALUE SN-Disconnect-Reason PPP-No-Rem-IP-Address 23 VALUE SN-Disconnect-Reason Inactivity-Timeout 24 VALUE SN-Disconnect-Reason Session-Timeout 25 VALUE SN-Disconnect-Reason Max-Data-Excd 26 VALUE SN-Disconnect-Reason Invalid-IP-Source-Address 27 VALUE SN-Disconnect-Reason MSID-Auth-Failed 28 VALUE SN-Disconnect-Reason MSID-Auth-Fauiled-No-AAA-Resp 29 VALUE SN-Disconnect-Reason A11-Max-Retry 30 VALUE SN-Disconnect-Reason A11-Lifetime-Expired 31 VALUE SN-Disconnect-Reason A11-Message-Integrity-Failure 32 VALUE SN-Disconnect-Reason PPP-lcp-remote-disc 33 VALUE SN-Disconnect-Reason Session-setup-timeout 34 VALUE SN-Disconnect-Reason PPP-keepalive-failure 35 VALUE SN-Disconnect-Reason Flow-add-failed 36 VALUE SN-Disconnect-Reason Call-type-detection-failed 37 VALUE SN-Disconnect-Reason Wrong-ipcp-params 38 VALUE SN-Disconnect-Reason MIP-remote-dereg 39 VALUE SN-Disconnect-Reason MIP-lifetime-expiry 40 VALUE SN-Disconnect-Reason MIP-proto-error 41 VALUE SN-Disconnect-Reason MIP-auth-failure 42 VALUE SN-Disconnect-Reason MIP-reg-timeout 43 VALUE SN-Disconnect-Reason Invalid-dest-context 44 VALUE SN-Disconnect-Reason Source-context-removed 45 VALUE SN-Disconnect-Reason Destination-context-removed 46 VALUE SN-Disconnect-Reason Req-service-addr-unavailable 47 VALUE SN-Disconnect-Reason Demux-mgr-failed 48 VALUE SN-Disconnect-Reason Internal-error 49 VALUE SN-Disconnect-Reason AAA-context-removed 50 VALUE SN-Disconnect-Reason invalid-service-type 51 VALUE SN-Disconnect-Reason mip-relay-req-failed 52 VALUE SN-Disconnect-Reason mip-rcvd-relay-failure 53 VALUE SN-Disconnect-Reason ppp-restart-inter-pdsn-handoff 54 VALUE SN-Disconnect-Reason gre-key-mismatch 55 VALUE SN-Disconnect-Reason invalid_tunnel_context 56 VALUE SN-Disconnect-Reason no_peer_lns_address 57 VALUE SN-Disconnect-Reason failed_tunnel_connect 58 VALUE SN-Disconnect-Reason l2tp-tunnel-disconnect-remote 59 VALUE SN-Disconnect-Reason l2tp-tunnel-timeout 60 VALUE SN-Disconnect-Reason l2tp-protocol-error-remote 61 VALUE SN-Disconnect-Reason l2tp-protocol-error-local 62 VALUE SN-Disconnect-Reason l2tp-auth-failed-remote 63 VALUE SN-Disconnect-Reason l2tp-auth-failed-local 64 VALUE SN-Disconnect-Reason l2tp-try-another-lns-from-remote 65 VALUE SN-Disconnect-Reason l2tp-no-resource-local 66 VALUE SN-Disconnect-Reason l2tp-no-resource-remote 67 VALUE SN-Disconnect-Reason l2tp-tunnel-disconnect-local 68 VALUE SN-Disconnect-Reason l2tp-admin-disconnect_remote 69 VALUE SN-Disconnect-Reason l2tpmgr-reached-max-capacity 70 VALUE SN-Disconnect-Reason MIP-reg-revocation 71 VALUE SN-Disconnect-Reason path-failure 72 VALUE SN-Disconnect-Reason dhcp-relay-ip-validation-failed 73 VALUE SN-Disconnect-Reason gtp-unknown-pdp-addr-or-pdp-type 74 VALUE SN-Disconnect-Reason gtp-all-dynamic-pdp-addr-occupied 75 VALUE SN-Disconnect-Reason gtp-no-memory-is-available 76 VALUE SN-Disconnect-Reason dhcp-relay-static-ip-addr-not-allowed 77 VALUE SN-Disconnect-Reason dhcp-no-ip-addr-allocated 78 VALUE SN-Disconnect-Reason dhcp-ip-addr-allocation-tmr-exp 79 VALUE SN-Disconnect-Reason dhcp-ip-validation-failed 80 VALUE SN-Disconnect-Reason dhcp-static-addr-not-allowed 81 VALUE SN-Disconnect-Reason dhcp-ip-addr-not-available-at-present 82 VALUE SN-Disconnect-Reason dhcp-lease-expired 83 VALUE SN-Disconnect-Reason lpool-ip-validation-failed 84 VALUE SN-Disconnect-Reason lpool-static-ip-addr-not-allowed 85 VALUE SN-Disconnect-Reason static-ip-validation-failed 86 VALUE SN-Disconnect-Reason static-ip-addr-not-present 87 VALUE SN-Disconnect-Reason static-ip-addr-not-allowed 88 VALUE SN-Disconnect-Reason radius-ip-validation-failed 89 VALUE SN-Disconnect-Reason radius-ip-addr-not-provided 90 VALUE SN-Disconnect-Reason invalid-ip-addr-from-sgsn 91 VALUE SN-Disconnect-Reason no-more-sessions-in-aaa 92 VALUE SN-Disconnect-Reason ggsn-aaa-auth-req-failed 93 VALUE SN-Disconnect-Reason conflict-in-ip-addr-assignment 94 VALUE SN-Disconnect-Reason apn-removed 95 VALUE SN-Disconnect-Reason credits-used-bytes-in 96 VALUE SN-Disconnect-Reason credits-used-bytes-out 97 VALUE SN-Disconnect-Reason credits-used-bytes-total 98 VALUE SN-Disconnect-Reason prepaid-failed 99 VALUE SN-Disconnect-Reason l2tp-ipsec-tunnel-failure 100 VALUE SN-Disconnect-Reason l2tp-ipsec-tunnel-disconnected 101 VALUE SN-Disconnect-Reason mip-ipsec-sa-inactive 102 VALUE SN-Disconnect-Reason Long-Duration-Timeout 103 VALUE SN-Disconnect-Reason proxy-mip-registration-failure 104 VALUE SN-Disconnect-Reason proxy-mip-binding-update 105 VALUE SN-Disconnect-Reason proxy-mip-inter-pdsn-handoff-require-ip-address 106 VALUE SN-Disconnect-Reason proxy-mip-inter-pdsn-handoff-mismatched-address 107 VALUE SN-Disconnect-Reason Local-purge 108 VALUE SN-Disconnect-Reason failed-update-handoff 109 VALUE SN-Disconnect-Reason closed_rp-handoff-complete 110 VALUE SN-Disconnect-Reason closed_rp-duplicate-session 111 VALUE SN-Disconnect-Reason closed_rp-handoff-session-not-found 112 VALUE SN-Disconnect-Reason closed_rp-handoff-failed 113 VALUE SN-Disconnect-Reason pcf-monitor-keep-alive-failed 114 VALUE SN-Disconnect-Reason call-internal-reject 115 VALUE SN-Disconnect-Reason call-restarted 116 VALUE SN-Disconnect-Reason a11-mn-ha-auth-failure 117 VALUE SN-Disconnect-Reason a11-badly-formed 118 VALUE SN-Disconnect-Reason a11-t-bit-not-set 119 VALUE SN-Disconnect-Reason a11-unsupported-vendor-id 120 VALUE SN-Disconnect-Reason a11-mismatched-id 121 VALUE SN-Disconnect-Reason mipha-dup-home-addr-req 122 VALUE SN-Disconnect-Reason mipha-dup-imsi-session 123 VALUE SN-Disconnect-Reason ha-unreachable 124 VALUE SN-Disconnect-Reason IPSP-addr-in-use 125 VALUE SN-Disconnect-Reason mipfa-dup-home-addr-req 126 VALUE SN-Disconnect-Reason mipha-ip-pool-busyout 127 VALUE SN-Disconnect-Reason inter-pdsn-handoff 128 VALUE SN-Disconnect-Reason active-to-dormant 129 VALUE SN-Disconnect-Reason ppp-renegotiation 130 VALUE SN-Disconnect-Reason active-start-param-change 131 VALUE SN-Disconnect-Reason tarrif-boundary 132 VALUE SN-Disconnect-Reason a11-disconnect-no-active-stop 133 VALUE SN-Disconnect-Reason nw-reachability-failed-reject 134 VALUE SN-Disconnect-Reason nw-reachability-failed-redirect 135 VALUE SN-Disconnect-Reason container-max-exceeded 136 VALUE SN-Disconnect-Reason static-addr-not-allowed-in-apn 137 VALUE SN-Disconnect-Reason static-addr-required-by-radius 138 VALUE SN-Disconnect-Reason static-addr-not-allowed-by-radius 139 VALUE SN-Disconnect-Reason mip-registration-dropped 140 VALUE SN-Disconnect-Reason counter-rollover 141 VALUE SN-Disconnect-Reason constructed-nai-auth-fail 142 VALUE SN-Disconnect-Reason inter-pdsn-service-optimize-handoff-disabled 143 VALUE SN-Disconnect-Reason gre-key-collision 144 VALUE SN-Disconnect-Reason inter-pdsn-service-optimize-handoff-triggered 145 VALUE SN-Disconnect-Reason intra-pdsn-handoff-triggered 146 VALUE SN-Disconnect-Reason delayed-abort-timer-expired 147 VALUE SN-Disconnect-Reason Admin-AAA-disconnect 148 VALUE SN-Disconnect-Reason Admin-AAA-disconnect-handoff 149 VALUE SN-Disconnect-Reason PPP-IPV6CP-Neg-Failed 150 VALUE SN-Disconnect-Reason PPP-IPV6CP-No-Response 151 VALUE SN-Disconnect-Reason PPP-IPV6CP-Max-Retry 152 VALUE SN-Disconnect-Reason PPP-Restart-Invalid-source-IPV4-address 153 VALUE SN-Disconnect-Reason a11-disconnect-handoff-no-active-stop 154 VALUE SN-Disconnect-Reason call-restarted-inter-pdsn-handoff 155 VALUE SN-Disconnect-Reason call-restarted-ppp-termination 156 VALUE SN-Disconnect-Reason mipfa-resource-conflict 157 VALUE SN-Disconnect-Reason failed-auth-with-charging-svc 158 VALUE SN-Disconnect-Reason mipha-dup-imsi-session-purge 159 VALUE SN-Disconnect-Reason mipha-rev-pending-newcall 160 VALUE SN-Disconnect-Reason volume-quota-reached 161 VALUE SN-Disconnect-Reason duration-quota-reached 162 VALUE SN-Disconnect-Reason gtp-user-authentication-failed 163 VALUE SN-Disconnect-Reason MIP-reg-revocation-no-lcp-term 164 VALUE SN-Disconnect-Reason MIP-private-ip-no-rev-tunnel 165 VALUE SN-Disconnect-Reason Invalid-Prepaid-AAA-attr-in-auth-response 166 VALUE SN-Disconnect-Reason mipha-prepaid-reset-dynamic-newcall 167 VALUE SN-Disconnect-Reason gre-flow-control-timeout 168 VALUE SN-Disconnect-Reason mip-paaa-bc-query-not-found 169 VALUE SN-Disconnect-Reason mipha-dynamic-ip-addr-not-available 170 VALUE SN-Disconnect-Reason a11-mismatched-id-on-handoff 171 VALUE SN-Disconnect-Reason a11-badly-formed-on-handoff 172 VALUE SN-Disconnect-Reason a11-unsupported-vendor-id-on-handoff 173 VALUE SN-Disconnect-Reason a11-t-bit-not-set-on-handoff 174 VALUE SN-Disconnect-Reason MIP-reg-revocation-i-bit-on 175 VALUE SN-Disconnect-Reason A11-RRQ-Deny-Max-Count 176 VALUE SN-Disconnect-Reason Dormant-Transition-During-Session-Setup 177 VALUE SN-Disconnect-Reason PPP-Rem-Reneg-Disc-Always-Cfg 178 VALUE SN-Disconnect-Reason PPP-Rem-Reneg-Disc-NAI-MSID-Mismatch 179 VALUE SN-Disconnect-Reason mipha-subscriber-ipsec-tunnel-down 180 VALUE SN-Disconnect-Reason mipha-subscriber-ipsec-tunnel-failed 181 VALUE SN-Disconnect-Reason mipha-subscriber-ipsecmgr-death 182 VALUE SN-Disconnect-Reason flow-is-deactivated 183 VALUE SN-Disconnect-Reason ecsv2-license-exceeded 184 VALUE SN-Disconnect-Reason IPSG-Auth-Failed 185 VALUE SN-Disconnect-Reason driver-initiated 186 VALUE SN-Disconnect-Reason ims-authorization-failed 187 VALUE SN-Disconnect-Reason service-instance-released 188 VALUE SN-Disconnect-Reason flow-released 189 VALUE SN-Disconnect-Reason ppp-renego-no-ha-addr 190 VALUE SN-Disconnect-Reason intra-pdsn-handoff 191 VALUE SN-Disconnect-Reason overload-disconnect 192 VALUE SN-Disconnect-Reason css-service-not-found 193 VALUE SN-Disconnect-Reason Auth-Failed 194 VALUE SN-Disconnect-Reason dhcp-client-sent-release 195 VALUE SN-Disconnect-Reason dhcp-client-sent-nak 196 VALUE SN-Disconnect-Reason msid-dhcp-chaddr-mismatch 197 VALUE SN-Disconnect-Reason link-broken 198 VALUE SN-Disconnect-Reason prog-end-timeout 199 VALUE SN-Disconnect-Reason qos-update-wait-timeout 200 VALUE SN-Disconnect-Reason css-synch-cause 201 VALUE SN-Disconnect-Reason Gtp-context-replacement 202 VALUE SN-Disconnect-Reason PDIF-Auth-failed 203 VALUE SN-Disconnect-Reason l2tp-unknown-apn 204 VALUE SN-Disconnect-Reason ms-unexpected-network-reentry 205 VALUE SN-Disconnect-Reason r6-invalid-nai 206 VALUE SN-Disconnect-Reason eap-max-retry-reached 207 VALUE SN-Disconnect-Reason vbm-hoa-session-disconnected 208 VALUE SN-Disconnect-Reason vbm-voa-session-disconnected 209 VALUE SN-Disconnect-Reason in-acl-disconnect-on-violation 210 VALUE SN-Disconnect-Reason eap-msk-lifetime-expiry 211 VALUE SN-Disconnect-Reason eap-msk-lifetime-too-low 212 VALUE SN-Disconnect-Reason mipfa-inter-tech-handoff 213 VALUE SN-Disconnect-Reason r6-max-retry-reached 214 VALUE SN-Disconnect-Reason r6-nwexit-recd 215 VALUE SN-Disconnect-Reason r6-dereg-req-recd 216 VALUE SN-Disconnect-Reason r6-remote-failure 217 VALUE SN-Disconnect-Reason r6r4-protocol-errors 218 VALUE SN-Disconnect-Reason wimax-qos-invalid-aaa-attr 219 VALUE SN-Disconnect-Reason npu-gre-flows-not-available 220 VALUE SN-Disconnect-Reason r4-max-retry-reached 221 VALUE SN-Disconnect-Reason r4-nwexit-recd 222 VALUE SN-Disconnect-Reason r4-dereg-req-recd 223 VALUE SN-Disconnect-Reason r4-remote-failure 224 VALUE SN-Disconnect-Reason ims-authorization-revoked 225 VALUE SN-Disconnect-Reason ims-authorization-released 226 VALUE SN-Disconnect-Reason ims-auth-decision-invalid 227 VALUE SN-Disconnect-Reason mac-addr-validation-failed 228 VALUE SN-Disconnect-Reason excessive-wimax-pd-flows-cfgd 229 VALUE SN-Disconnect-Reason sgsn-canc-loc-sub 230 VALUE SN-Disconnect-Reason sgsn-canc-loc-upd 231 VALUE SN-Disconnect-Reason sgsn-mnr-exp 232 VALUE SN-Disconnect-Reason sgsn-ident-fail 233 VALUE SN-Disconnect-Reason sgsn-sec-fail 234 VALUE SN-Disconnect-Reason sgsn-auth-fail 235 VALUE SN-Disconnect-Reason sgsn-glu-fail 236 VALUE SN-Disconnect-Reason sgsn-imp-det 237 VALUE SN-Disconnect-Reason sgsn-smgr-purge 238 VALUE SN-Disconnect-Reason sgsn-subs-handed-to-peer 239 VALUE SN-Disconnect-Reason sgsn-dns-fail-inter-rau 240 VALUE SN-Disconnect-Reason sgsn-cont-rsp-fail 241 VALUE SN-Disconnect-Reason sgsn-hlr-not-found-for-imsi 242 VALUE SN-Disconnect-Reason sgsn-ms-init-det 243 VALUE SN-Disconnect-Reason sgsn-opr-policy-fail 244 VALUE SN-Disconnect-Reason sgsn-duplicate-context 245 VALUE SN-Disconnect-Reason hss-profile-update-failed 246 VALUE SN-Disconnect-Reason sgsn-no-pdp-activated 247 VALUE SN-Disconnect-Reason asnpc-idle-mode-timeout 248 VALUE SN-Disconnect-Reason asnpc-idle-mode-exit 249 VALUE SN-Disconnect-Reason asnpc-idle-mode-auth-failed 250 VALUE SN-Disconnect-Reason asngw-invalid-qos-configuration 251 VALUE SN-Disconnect-Reason sgsn-dsd-allgprswithdrawn 252 VALUE SN-Disconnect-Reason r6-pmk-key-change-failure 253 VALUE SN-Disconnect-Reason sgsn-illegal-me 254 VALUE SN-Disconnect-Reason sess-termination-timeout 255 VALUE SN-Disconnect-Reason sgsn-sai-fail 256 VALUE SN-Disconnect-Reason sgsn-rnc-removal 257 VALUE SN-Disconnect-Reason sgsn-rai-removal 258 VALUE SN-Disconnect-Reason sgsn-init-deact 259 VALUE SN-Disconnect-Reason ggsn-init-deact 260 VALUE SN-Disconnect-Reason hlr-init-deact 261 VALUE SN-Disconnect-Reason ms-init-deact 262 VALUE SN-Disconnect-Reason sgsn-detach-init-deact 263 VALUE SN-Disconnect-Reason sgsn-rab-rel-init-deact 264 VALUE SN-Disconnect-Reason sgsn-iu-rel-init-deact 265 VALUE SN-Disconnect-Reason sgsn-gtpu-path-failure 266 VALUE SN-Disconnect-Reason sgsn-gtpc-path-failure 267 VALUE SN-Disconnect-Reason sgsn-local-handoff-init-deact 268 VALUE SN-Disconnect-Reason sgsn-remote-handoff-init-deact 269 VALUE SN-Disconnect-Reason sgsn-gtp-no-resource 270 VALUE SN-Disconnect-Reason sgsn-rnc-no-resource 271 VALUE SN-Disconnect-Reason sgsn-odb-init-deact 272 VALUE SN-Disconnect-Reason sgsn-invalid-ti 273 VALUE SN-Disconnect-Reason sgsn-ggsn-ctxt-non-existent 274 VALUE SN-Disconnect-Reason sgsn-apn-restrict-vio 275 VALUE SN-Disconnect-Reason sgsn-regular-deact 276 VALUE SN-Disconnect-Reason sgsn-abnormal-deact 277 VALUE SN-Disconnect-Reason sgsn-actv-rejected-by-peer 278 VALUE SN-Disconnect-Reason sgsn-err-ind 279 VALUE SN-Disconnect-Reason asngw-non-anchor-prohibited 280 VALUE SN-Disconnect-Reason asngw-im-entry-prohibited 281 VALUE SN-Disconnect-Reason session-idle-mode-entry-timeout 282 VALUE SN-Disconnect-Reason session-idle-mode-exit-timeout 283 VALUE SN-Disconnect-Reason asnpc-ms-power-down-nwexit 284 VALUE SN-Disconnect-Reason asnpc-r4-nwexit-recd 285 VALUE SN-Disconnect-Reason sgsn-iu-rel-before-call-est 286 VALUE SN-Disconnect-Reason ikev2-subscriber-ipsecmgr-death 287 VALUE SN-Disconnect-Reason All-dynamic-pool-addr-occupied 288 VALUE SN-Disconnect-Reason mip6ha-ip-addr-not-available 289 VALUE SN-Disconnect-Reason bs-monitor-keep-alive-failed 290 VALUE SN-Disconnect-Reason sgsn-att-in-reg-state 291 VALUE SN-Disconnect-Reason sgsn-inbound-srns-in-reg-state 292 VALUE SN-Disconnect-Reason dt-ggsn-tun-reestablish-failed 293 VALUE SN-Disconnect-Reason sgsn-unknown-pdp 294 VALUE SN-Disconnect-Reason sgsn-pdp-auth-failure 295 VALUE SN-Disconnect-Reason sgsn-duplicate-pdp-context 296 VALUE SN-Disconnect-Reason sgsn-no-rsp-from-ggsn 297 VALUE SN-Disconnect-Reason sgsn-failure-rsp-from-ggsn 298 VALUE SN-Disconnect-Reason sgsn-apn-unknown 299 VALUE SN-Disconnect-Reason sgsn-serv-req-init-deact 300 VALUE SN-Disconnect-Reason sgsn-attach-on-attch-init-abort 301 VALUE SN-Disconnect-Reason sgsn-iu-rel-in-israu-init-abort 302 VALUE SN-Disconnect-Reason sgsn-smgr-init-abort 303 VALUE SN-Disconnect-Reason sgsn-mm-ctx-cleanup-init-abort 304 VALUE SN-Disconnect-Reason sgsn-unknown-abort 305 VALUE SN-Disconnect-Reason sgsn-guard-timeout-abort 306 VALUE SN-Disconnect-Reason vpn-bounce-dhcpip-validate-req 307 VALUE SN-Disconnect-Reason mipv6-id-mismatch 308 VALUE SN-Disconnect-Reason aaa-session-id-not-found 309 VALUE SN-Disconnect-Reason x1-max-retry-reached 310 VALUE SN-Disconnect-Reason x1-nwexit-recd 311 VALUE SN-Disconnect-Reason x1-dereg-req-recd 312 VALUE SN-Disconnect-Reason x1-remote-failure 313 VALUE SN-Disconnect-Reason x1x2-protocol-errors 314 VALUE SN-Disconnect-Reason x2-max-retry-reached 315 VALUE SN-Disconnect-Reason x2-nwexit-recd 316 VALUE SN-Disconnect-Reason x2-dereg-req-recd 317 VALUE SN-Disconnect-Reason x2-remote-failure 318 VALUE SN-Disconnect-Reason x1-pmk-key-change-failure 319 VALUE SN-Disconnect-Reason sa-rekeying-failure 320 VALUE SN-Disconnect-Reason sess-sleep-mode-entry-timeout 321 VALUE SN-Disconnect-Reason phsgw-non-anchor-prohibited 322 VALUE SN-Disconnect-Reason asnpc-pc-relocation-failed 323 VALUE SN-Disconnect-Reason asnpc-pc-relocation 324 VALUE SN-Disconnect-Reason auth_policy_mismatch 325 VALUE SN-Disconnect-Reason sa-lifetime-expiry 326 VALUE SN-Disconnect-Reason asnpc-del-ms-entry-recd 327 VALUE SN-Disconnect-Reason phspc-sleep-mode-timeout 328 VALUE SN-Disconnect-Reason phspc-sleep-mode-exit 329 VALUE SN-Disconnect-Reason phspc-sleep-mode-auth-failed 330 VALUE SN-Disconnect-Reason phspc-ms-power-down-nwexit 331 VALUE SN-Disconnect-Reason phspc-x2-nwexit-recd 332 VALUE SN-Disconnect-Reason invalid-nat-config 333 VALUE SN-Disconnect-Reason asngw-tid-entry-not-found 334 VALUE SN-Disconnect-Reason No-NAT-IP-Address 335 VALUE SN-Disconnect-Reason excessive-phs-pd-flows-cfgd 336 VALUE SN-Disconnect-Reason phsgw-invalid-qos-configuration 337 VALUE SN-Disconnect-Reason Interim-Update 338 VALUE SN-Disconnect-Reason sgsn-attach-abrt-rad-lost 339 VALUE SN-Disconnect-Reason sgsn-inbnd-irau-abrt-rad-lost 340 VALUE SN-Disconnect-Reason ike-keepalive-failed 341 VALUE SN-Disconnect-Reason sgsn-attach-abrt-ms-suspend 342 VALUE SN-Disconnect-Reason sgsn-inbnd-irau-abrt-ms-suspend 343 VALUE SN-Disconnect-Reason duplicate-session-detected 344 VALUE SN-Disconnect-Reason sgsn-xid-response-failure 345 VALUE SN-Disconnect-Reason sgsn-nse-cleanup 346 VALUE SN-Disconnect-Reason sgsn-gtp-req-failure 347 VALUE SN-Disconnect-Reason sgsn-imsi-mismatch 348 VALUE SN-Disconnect-Reason sgsn-bvc-blocked 349 VALUE SN-Disconnect-Reason sgsn-attach-on-inbound-irau 350 VALUE SN-Disconnect-Reason sgsn-attach-on-outbound-irau 351 VALUE SN-Disconnect-Reason sgsn-incorrect-state 352 VALUE SN-Disconnect-Reason sgsn-t3350-expiry 353 VALUE SN-Disconnect-Reason sgsn-page-timer-expiry 354 VALUE SN-Disconnect-Reason phsgw-tid-entry-not-found 355 VALUE SN-Disconnect-Reason phspc-del-ms-entry-recd 356 VALUE SN-Disconnect-Reason sgsn-pdp-local-purge 357 VALUE SN-Disconnect-Reason phs-invalid-nai 358 VALUE SN-Disconnect-Reason session-sleep-mode-exit-timeout 359 VALUE SN-Disconnect-Reason sgsn-offload-phase2 360 VALUE SN-Disconnect-Reason phs-thirdparty-auth-fail 361 VALUE SN-Disconnect-Reason remote-error-notify 362 VALUE SN-Disconnect-Reason no-response 363 VALUE SN-Disconnect-Reason PDG-Auth-failed 364 VALUE SN-Disconnect-Reason mme-s1AP-send-failed 365 VALUE SN-Disconnect-Reason mme-egtpc-connection-failed 366 VALUE SN-Disconnect-Reason mme-egtpc-create-session-failed 367 VALUE SN-Disconnect-Reason mme-authentication-failure 368 VALUE SN-Disconnect-Reason mme-ue-detach 369 VALUE SN-Disconnect-Reason mme-mme-detach 370 VALUE SN-Disconnect-Reason mme-hss-detach 371 VALUE SN-Disconnect-Reason mme-pgw-detach 372 VALUE SN-Disconnect-Reason mme-sub-validation-failure 373 VALUE SN-Disconnect-Reason mme-hss-connection-failure 374 VALUE SN-Disconnect-Reason mme-hss-user-unknown 375 VALUE SN-Disconnect-Reason dhcp-lease-mismatch-detected 376 VALUE SN-Disconnect-Reason nemo-link-layer-down 377 VALUE SN-Disconnect-Reason eapol-max-retry-reached 378 VALUE SN-Disconnect-Reason sgsn-offload-phase3 379 VALUE SN-Disconnect-Reason mbms-bearer-service-disconnect 380 VALUE SN-Disconnect-Reason disconnect-on-violation-odb 381 VALUE SN-Disconnect-Reason disconn-on-violation-focs-odb 382 VALUE SN-Disconnect-Reason CSCF-REG-Admin-disconnect 383 VALUE SN-Disconnect-Reason CSCF-REG-User-disconnect 384 VALUE SN-Disconnect-Reason CSCF-REG-Inactivity-timeout 385 VALUE SN-Disconnect-Reason CSCF-REG-Network-disconnect 386 VALUE SN-Disconnect-Reason CSCF-Call-Admin-disconnect 387 VALUE SN-Disconnect-Reason CSCF-CAll-User-disconnect 388 VALUE SN-Disconnect-Reason CSCF-CALL-Local-disconnect 389 VALUE SN-Disconnect-Reason CSCF-CALL-No-Resource 390 VALUE SN-Disconnect-Reason CSCF-CALL-No-Respone 391 VALUE SN-Disconnect-Reason CSCF-CALL-Inactivity-timeout 392 VALUE SN-Disconnect-Reason CSCF-CALL-Media-Auth-Failure 393 VALUE SN-Disconnect-Reason CSCF-REG-No-Resource 394 VALUE SN-Disconnect-Reason ms-unexpected-idle-mode-entry 395 VALUE SN-Disconnect-Reason re-auth-failed 396 VALUE SN-Disconnect-Reason sgsn-pdp-nse-cleanup 397 VALUE SN-Disconnect-Reason sgsn-mm-ctxt-gtp-no-resource 398 VALUE SN-Disconnect-Reason unknown-apn 399 VALUE SN-Disconnect-Reason gtpc-path-failure 400 VALUE SN-Disconnect-Reason gtpu-path-failure 401 VALUE SN-Disconnect-Reason actv-rejected-by-sgsn 402 VALUE SN-Disconnect-Reason sgsn-pdp-gprs-camel-release 403 VALUE SN-Disconnect-Reason sgsn-check-imei-failure 404 VALUE SN-Disconnect-Reason sgsn-sndcp-init-deact 405 VALUE SN-Disconnect-Reason sgsn-pdp-inactivity-timeout 406 VALUE SN-Disconnect-Reason fw-and-nat-policy-removed 407 VALUE SN-Disconnect-Reason FNG-Auth-failed 408 VALUE SN-Disconnect-Reason ha-stale-key-disconnect 409 VALUE SN-Disconnect-Reason No-IPV6-address-for-subscriber 410 VALUE SN-Disconnect-Reason prefix-registration-failure 411 VALUE SN-Disconnect-Reason disconnect-from-policy-server 412 VALUE SN-Disconnect-Reason s6b-auth-failed 413 VALUE SN-Disconnect-Reason gtpc-err-ind 414 VALUE SN-Disconnect-Reason gtpu-err-ind 415 VALUE SN-Disconnect-Reason invalid-pdn-type 416 VALUE SN-Disconnect-Reason aaa-auth-req-failed 417 VALUE SN-Disconnect-Reason apn-denied-no-subscription 418 VALUE SN-Disconnect-Reason Sgw-context-replacement 419 VALUE SN-Disconnect-Reason dup-static-ip-addr-req 420 VALUE SN-Disconnect-Reason apn-restrict-violation 421 VALUE SN-Disconnect-Reason invalid-wapn 422 VALUE SN-Disconnect-Reason ttg-nsapi-allocation-failed 423 VALUE SN-Disconnect-Reason mandatory-gtp-ie-missing 424 VALUE SN-Disconnect-Reason aaa-unreachable 425 VALUE SN-Disconnect-Reason asngw-service-flow-deletion 426 VALUE SN-Disconnect-Reason CT-PMIP-RRQ-NVSE-Value-Change 427 VALUE SN-Disconnect-Reason tcp-read-failed 428 VALUE SN-Disconnect-Reason tcp-write-failed 429 VALUE SN-Disconnect-Reason ssl-handshake-failed 430 VALUE SN-Disconnect-Reason ssl-renegotiate-failed 431 VALUE SN-Disconnect-Reason ssl-bad-message 432 VALUE SN-Disconnect-Reason ssl-alert-received 433 VALUE SN-Disconnect-Reason ssl-disconnect 434 VALUE SN-Disconnect-Reason ssl-migration 435 VALUE SN-Disconnect-Reason sgsn-ard-failure 436 VALUE SN-Disconnect-Reason sgsn-camel-release 437 VALUE SN-Disconnect-Reason Hotlining-Status-Change 447 VALUE SN-Disconnect-Reason ggsn-no-rsp-from-sgsn 448 VALUE SN-Disconnect-Reason diameter-protocol-error 449 VALUE SN-Disconnect-Reason diameter-request-timeout 450 VALUE SN-Disconnect-Reason operator-policy 451 VALUE SN-Disconnect-Reason spr-connection-timeout 452 VALUE SN-Disconnect-Reason mipha-dup-wimax-session 453 VALUE SN-Disconnect-Reason invalid-version-attr 454 VALUE SN-Disconnect-Reason sgsn-zone-code-failure 455 VALUE SN-PPP-Progress-Code Not-Defined 0 VALUE SN-PPP-Progress-Code Call-Lcp-Down 1 VALUE SN-PPP-Progress-Code Call-Disconnecting 2 VALUE SN-PPP-Progress-Code Call-PPP-Renegotiating 3 VALUE SN-PPP-Progress-Code Call-Lcp-Down_1 10 VALUE SN-PPP-Progress-Code Call-Arrived 11 VALUE SN-PPP-Progress-Code Call-Lcp-Up 12 VALUE SN-PPP-Progress-Code Call-Authenticating 13 VALUE SN-PPP-Progress-Code Call-Authenticated 14 VALUE SN-PPP-Progress-Code Call-Ipcp-Up 15 VALUE SN-PPP-Progress-Code Call-Simple-IP-Connected 16 VALUE SN-PPP-Progress-Code Call-Mobile-IP-Connected 17 #VALUE SN-PPP-Progress-Code Call-Disconnecting 20 #VALUE SN-PPP-Progress-Code Call-PPP-Renegotiating 30 #VALUE SN-PPP-Progress-Code Call-Arrived 40 VALUE SN-PPP-Progress-Code Call-Pdg-Tcp-Connecting 45 VALUE SN-PPP-Progress-Code Call-Pdg-Ssl-Connecting 46 #VALUE SN-PPP-Progress-Code Call-Lcp-Up 50 #VALUE SN-PPP-Progress-Code Call-Authenticating 60 VALUE SN-PPP-Progress-Code Call-Bcmcs-Authenticating 70 #VALUE SN-PPP-Progress-Code Call-Authenticated 80 VALUE SN-PPP-Progress-Code Call-Tunnel-Connecting 85 #VALUE SN-PPP-Progress-Code Call-Ipcp-Up 90 VALUE SN-PPP-Progress-Code Call-Imsa-Authorizing 95 VALUE SN-PPP-Progress-Code Call-Imsa-Authorized 97 VALUE SN-PPP-Progress-Code Call-MBMS-UE-Authorizing 98 VALUE SN-PPP-Progress-Code Call-MBMS-Bearer-Authorizing 99 #VALUE SN-PPP-Progress-Code Call-Simple-IP-Connected 100 #VALUE SN-PPP-Progress-Code Call-Mobile-IP-Connected 110 VALUE SN-PPP-Progress-Code Call-Tunnel-Connected 115 VALUE SN-PPP-Progress-Code Call-Pdp-Type-IP-Connected 120 VALUE SN-PPP-Progress-Code Call-Pdp-Type-IPv6-Connected 125 VALUE SN-PPP-Progress-Code Call-Pdp-Type-PPP-Connected 130 VALUE SN-PPP-Progress-Code Call-Proxy-Mobile-IP-Connected 140 VALUE SN-PPP-Progress-Code Call-Pdg-Connected 142 VALUE SN-PPP-Progress-Code Call-Pdg-Ssl-Connected 141 VALUE SN-PPP-Progress-Code Call-Pdg-Connected 142 VALUE SN-PPP-Progress-Code Call-Pdg-Connected 142 VALUE SN-PPP-Progress-Code Call-Ipsg-Connected 145 VALUE SN-PPP-Progress-Code Call-Bcmcs-Connected 150 VALUE SN-PPP-Progress-Code Call-MBMS-UE-Connected 155 VALUE SN-PPP-Progress-Code Call-MBMS-Bearer-Connected 156 VALUE SN-PPP-Progress-Code Call-Pending-Addr-From-DHCP 160 VALUE SN-PPP-Progress-Code Call-Got-Addr-From-DHCP 170 VALUE SN-PPP-Progress-Code Call-HA-IPSEC-Tunnel-Connecting 180 VALUE SN-PPP-Progress-Code Call-HA-IPSEC-Connected 190 VALUE SN-PPP-Progress-Code Call-ASN-Non-Anchor-Connected 200 VALUE SN-PPP-Progress-Code Call-ASNPC-Connected 210 VALUE SN-PPP-Progress-Code Call-Mobile-IPv6-Connected 220 VALUE SN-PPP-Progress-Code Call-PMIPv6-Connected 221 VALUE SN-PPP-Progress-Code Call-PHSPC-Connected 230 VALUE SN-PPP-Progress-Code Call-GTP-IPv4-Connected 235 VALUE SN-PPP-Progress-Code Call-GTP-IPv6-Connected 236 VALUE SN-PPP-Progress-Code Call-GTP-IPv4-IPv6-Connected 237 VALUE SN-PPP-Progress-Code Call-SGW-Connected 245 VALUE SN-PPP-Progress-Code Call-MME-Attached 246 VALUE SN-PPP-Progress-Code Call-Auth-Only-Connected 247 VALUE SN-PPP-Data-Compression None 0 VALUE SN-PPP-Data-Compression Stac-LZS 1 VALUE SN-PPP-Data-Compression MPPC 2 VALUE SN-PPP-Data-Compression MPCC-Stac-LZS 3 VALUE SN-PPP-Data-Compression Deflate 4 VALUE SN-PPP-Data-Compression Deflate-Stac-LZS 5 VALUE SN-PPP-Data-Compression Deflate-MPCC 6 VALUE SN-PPP-Data-Compression Deflate-MPCC-Stac-LZS 7 VALUE SN-IP-Source-Validation No 0 VALUE SN-IP-Source-Validation Yes 1 VALUE SN-Subscriber-Permission None 0 VALUE SN-Subscriber-Permission Simple-IP 1 VALUE SN-Subscriber-Permission Mobile-IP 2 VALUE SN-Subscriber-Permission Simple-IP-Mobile-IP 3 VALUE SN-Subscriber-Permission HA-Mobile-IP 4 VALUE SN-Subscriber-Permission Simple-IP-HA-Mobile-IP 5 VALUE SN-Subscriber-Permission Mobile-IP-HA-Mobile-IP 6 VALUE SN-Subscriber-Permission All 7 VALUE SN-Subscriber-Permission GGSN-PDP-TYPE-IP 8 VALUE SN-Subscriber-Permission GGSN-PDP-TYPE-PPP 16 VALUE SN-Subscriber-Permission Network-Mobility 32 VALUE SN-Subscriber-Permission FA-HA-NEMO 38 VALUE SN-Subscriber-Permission All_New 63 VALUE SN-Admin-Permission None 0 VALUE SN-Admin-Permission CLI 1 VALUE SN-Admin-Permission FTP 2 VALUE SN-Admin-Permission CLI-FTP 3 VALUE SN-Admin-Permission Intercept 4 VALUE SN-Admin-Permission CLI-Intercept 5 VALUE SN-Admin-Permission CLI-Intercept-FTP 7 VALUE SN-Admin-Permission ECS 8 VALUE SN-Admin-Permission CLI-ECS 9 VALUE SN-Admin-Permission CLI-FTP-ECS 11 VALUE SN-Admin-Permission CLI-Intercept-ECS 13 VALUE SN-Admin-Permission CLI-Intercept-FTP-ECS 15 VALUE SN-Simultaneous-SIP-MIP Disabled 0 VALUE SN-Simultaneous-SIP-MIP Enabled 1 VALUE SN-PPP-Data-Compression-Mode Normal 0 VALUE SN-PPP-Data-Compression-Mode Stateless 1 VALUE SN-Access-link-IP-Frag Normal 0 VALUE SN-Access-link-IP-Frag DF-Ignore 1 VALUE SN-Access-link-IP-Frag DF-Fragment-ICMP-Notify 2 VALUE SN-Cause-Code Normal_End_Of_Session 0 VALUE SN-Cause-Code Successful_Transaction 1 VALUE SN-Cause-Code End_Of_Subscriber_Dialog 2 VALUE SN-Cause-Code 3XX_Redirection 3 VALUE SN-Cause-Code 4XX_Request_Failure 4 VALUE SN-Cause-Code 5XX_Server_Failure 5 VALUE SN-Cause-Code 6XX_Global_Failure 6 VALUE SN-Cause-Code Unspecified_Error 7 VALUE SN-Cause-Code Unsuccessful_Session_Setup 8 VALUE SN-Cause-Code Internal_Error 9 VALUE SN-CF-Call-International Disable 0 VALUE SN-CF-Call-International Enable 1 VALUE SN-CF-Call-Local Disable 0 VALUE SN-CF-Call-Local Enable 1 VALUE SN-CF-Call-LongDistance Disable 0 VALUE SN-CF-Call-LongDistance Enable 1 VALUE SN-CF-Call-Premium Disable 0 VALUE SN-CF-Call-Premium Enable 1 VALUE SN-CF-Call-RoamingInternatnl Disable 0 VALUE SN-CF-Call-RoamingInternatnl Enable 1 VALUE SN-CF-Call-Transfer Disable 0 VALUE SN-CF-Call-Transfer Enable 1 VALUE SN-CF-Call-Waiting Disable 0 VALUE SN-CF-Call-Waiting Enable 1 VALUE SN-CF-CId-Display Disable 0 VALUE SN-CF-CId-Display Enable 1 VALUE SN-CF-CId-Display-Blocked Disable 0 VALUE SN-CF-CId-Display-Blocked Enable 1 VALUE SN-Change-Condition QOSCHANGE 0 VALUE SN-Change-Condition TARIFFTIMECHANGE 1 VALUE SN-Change-Condition SGSNCHANGE 500 VALUE SN-Data-Tunnel-Ignore-DF-Bit Disabled 0 VALUE SN-Data-Tunnel-Ignore-DF-Bit Enabled 1 VALUE SN-DHCP-Lease-Expiry-Policy auto-renew 0 VALUE SN-DHCP-Lease-Expiry-Policy disconnect 1 VALUE SN-Direction Any 0 VALUE SN-Direction Uplink 1 VALUE SN-Direction Downlink 2 VALUE SN-DNS-Proxy-Use-Subscr-Addr Disable 0 VALUE SN-DNS-Proxy-Use-Subscr-Addr Enable 1 VALUE SN-Enable-QoS-Renegotiation No 0 VALUE SN-Enable-QoS-Renegotiation Yes 1 VALUE SN-Firewall-Enabled False 0 VALUE SN-Firewall-Enabled True 1 VALUE SN-GGSN-MIP-Required Disabled 0 VALUE SN-GGSN-MIP-Required Enabled 1 VALUE SN-Gratuitous-ARP-Aggressive Disabled 0 VALUE SN-Gratuitous-ARP-Aggressive Enabled 1 VALUE SN-GTP-Version GTP_VERSION_0 0 VALUE SN-GTP-Version GTP_VERSION_1 1 VALUE SN-GTP-Version GTP_VERSION_2 2 VALUE SN-HA-Send-DNS-ADDRESS Disabled 0 VALUE SN-HA-Send-DNS-ADDRESS Enabled 1 VALUE SN-Handoff-Indicator Active-Handoff 0 VALUE SN-Handoff-Indicator Location-Update 1 VALUE SN-Home-Sub-Use-GGSN Deny 0 VALUE SN-Home-Sub-Use-GGSN Accept 1 VALUE SN-IP-Alloc-Method Alloc_Local_Pool 0 VALUE SN-IP-Alloc-Method Alloc_Dhcp_Client 1 VALUE SN-IP-Alloc-Method Alloc_Radius 2 VALUE SN-IP-Alloc-Method Alloc_No_Alloc 3 VALUE SN-IP-Alloc-Method Alloc_Static_Alloc 4 VALUE SN-IP-Alloc-Method Alloc_Dhcp_Relay 5 VALUE SN-IP-Header-Compression None 0 VALUE SN-IP-Header-Compression VJ 1 VALUE SN-IP-Header-Compression ROHC 2 VALUE SN-IP-Header-Compression VJ_ROHC 3 VALUE SN-IP-Hide-Service-Address Disabled 0 VALUE SN-IP-Hide-Service-Address Enabled 1 VALUE SN-IP-Source-Violate-No-Acct Disabled 0 VALUE SN-IP-Source-Violate-No-Acct Enabled 1 VALUE SN-IPv6-DNS-Proxy Disabled 0 VALUE SN-IPv6-DNS-Proxy Enabled 1 VALUE SN-IPv6-Egress-Filtering Disabled 0 VALUE SN-IPv6-Egress-Filtering Enabled 1 VALUE SN-L3-to-L2-Tun-Addr-Policy no-local-alloc-validate 0 VALUE SN-L3-to-L2-Tun-Addr-Policy local-alloc 1 VALUE SN-L3-to-L2-Tun-Addr-Policy local-alloc-validate 2 VALUE SN-Long-Duration-Action Detection 1 VALUE SN-Long-Duration-Action Disconnection 2 VALUE SN-Long-Duration-Action Dormant-Only-Disconnection 3 VALUE SN-Long-Duration-Action Dormant-Only-Detection 4 VALUE SN-Long-Duration-Notification Suppress 0 VALUE SN-Long-Duration-Notification Send 1 VALUE SN-Mediation-Acct-Rsp-Action None 0 VALUE SN-Mediation-Acct-Rsp-Action No_Early_PDUs 1 VALUE SN-Mediation-Acct-Rsp-Action Delay_GTP_Response 2 VALUE SN-Mediation-Enabled Disabled 0 VALUE SN-Mediation-Enabled Enabled 1 VALUE SN-Mediation-No-Interims Disabled 0 VALUE SN-Mediation-No-Interims Enabled 1 VALUE SN-MIP-AAA-Assign-Addr Disabled 0 VALUE SN-MIP-AAA-Assign-Addr Enabled 1 VALUE SN-MIP-Dual-Anchor Disabled 0 VALUE SN-MIP-Dual-Anchor Enabled 1 VALUE SN-MIP-Match-AAA-Assign-Addr Disabled 0 VALUE SN-MIP-Match-AAA-Assign-Addr Enabled 1 VALUE SN-MIP-Send-Ancid Disabled 0 VALUE SN-MIP-Send-Ancid Enabled 1 VALUE SN-MIP-Send-Correlation-Info Disabled 0 # In StarOS 8.3 and later, supported value 1 is NVSE_Starent, before 8.3 it is Enabled. VALUE SN-MIP-Send-Correlation-Info EnabledOrNVSE_Starent 1 VALUE SN-MIP-Send-Correlation-Info NVSE_CUstom1 2 VALUE SN-MIP-Send-Correlation-Info NVSE_Custom2 3 VALUE SN-MIP-Send-Imsi NoneOrDisabled 0 VALUE SN-MIP-Send-Imsi Starent_NVSE 1 VALUE SN-MIP-Send-Imsi NVSE_Custom1 2 VALUE SN-MIP-Send-Imsi NVSE_Custom2 3 VALUE SN-MIP-Send-Term-Verification Disabled 0 VALUE SN-MIP-Send-Term-Verification EnabledOrNVSE_Custom1 1 VALUE SN-MIP-Send-Term-Verification NVSE_Custom2 2 VALUE SN-MIP-Send-Term-Verification NVSE_Starent 3 VALUE SN-MN-HA-Hash-Algorithm MD5 1 VALUE SN-MN-HA-Hash-Algorithm MD5_RFC2002 2 VALUE SN-MN-HA-Hash-Algorithm HMAC_MD5 3 VALUE SN-Mode Reliable 0 VALUE SN-Mode Optimistic 1 VALUE SN-Mode Unidirectional 2 VALUE SN-Node-Functionality S-CSCF 0 VALUE SN-Node-Functionality P-CSCF 1 VALUE SN-Node-Functionality I-CSCF 2 VALUE SN-NPU-Qos-Priority Best_Effort 0 VALUE SN-NPU-Qos-Priority Bronze 1 VALUE SN-NPU-Qos-Priority Silver 2 VALUE SN-NPU-Qos-Priority Gold 3 VALUE SN-NPU-Qos-Priority From_DSCP 4 VALUE SN-Ntk-Session-Disconnect-Flag Session-Disconnect 1 VALUE SN-PDG-TTG-Required No 0 VALUE SN-PDG-TTG-Required Yes 1 VALUE SN-PDIF-MIP-Release-TIA No 0 VALUE SN-PDIF-MIP-Release-TIA Yes 1 VALUE SN-PDIF-MIP-Required No 0 VALUE SN-PDIF-MIP-Required Yes 1 VALUE SN-PDIF-MIP-Simple-IP-Fallback No 0 VALUE SN-PDIF-MIP-Simple-IP-Fallback Yes 1 VALUE SN-PDSN-Handoff-Req-IP-Addr Disabled 0 VALUE SN-PDSN-Handoff-Req-IP-Addr Enabled 1 VALUE SN-Permit-User-Mcast-PDUs Disabled 0 VALUE SN-Permit-User-Mcast-PDUs Enabled 1 VALUE SN-PPP-Accept-Peer-v6Ifid Disabled 0 VALUE SN-PPP-Accept-Peer-v6Ifid Enabled 1 VALUE SN-PPP-Always-On-Vse Disabled 0 VALUE SN-PPP-Always-On-Vse Enabled 1 VALUE SN-PPP-NW-Layer-IPv4 Disabled 0 VALUE SN-PPP-NW-Layer-IPv4 Enabled 1 VALUE SN-PPP-NW-Layer-IPv4 Passive 2 VALUE SN-PPP-NW-Layer-IPv6 Disabled 0 VALUE SN-PPP-NW-Layer-IPv6 Enabled 1 VALUE SN-PPP-NW-Layer-IPv6 Passive 2 VALUE SN-PPP-Reneg-Disc Never 0 VALUE SN-PPP-Reneg-Disc Always 1 VALUE SN-PPP-Reneg-Disc NAI_Prefix_MSID_Mismatch 2 VALUE SN-Prepaid no_prepaid 0 VALUE SN-Prepaid custom_prepaid 1 VALUE SN-Prepaid standard_prepaid 2 VALUE SN-Prepaid wimax_prepaid 4 VALUE SN-Prepaid-Compressed-Count Uncompressed 0 VALUE SN-Prepaid-Compressed-Count Compressed 1 VALUE SN-Prepaid-Final-Duration-Alg current_time 0 VALUE SN-Prepaid-Final-Duration-Alg last-user-layer3-activity-time 1 VALUE SN-Prepaid-Final-Duration-Alg last-airlink-activity-time 2 VALUE SN-Prepaid-Final-Duration-Alg last-airlink-activity-time-last-reported 3 VALUE SN-Prepaid-Preference prepaid_duration 0 VALUE SN-Prepaid-Preference prepaid_volume 1 VALUE SN-Proxy-MIP Disabled 0 VALUE SN-Proxy-MIP Enabled 1 VALUE SN-Proxy-MIPV6 Disabled 0 VALUE SN-Proxy-MIPV6 Enabled 1 VALUE SN-QoS-Class-Background-PHB Best-Effort 0 VALUE SN-QoS-Class-Background-PHB Pass-Through 1 VALUE SN-QoS-Class-Background-PHB AF11 10 VALUE SN-QoS-Class-Background-PHB AF12 12 VALUE SN-QoS-Class-Background-PHB AF13 14 VALUE SN-QoS-Class-Background-PHB AF21 18 VALUE SN-QoS-Class-Background-PHB AF22 20 VALUE SN-QoS-Class-Background-PHB AF23 22 VALUE SN-QoS-Class-Background-PHB AF31 26 VALUE SN-QoS-Class-Background-PHB AF32 28 VALUE SN-QoS-Class-Background-PHB AF33 30 VALUE SN-QoS-Class-Background-PHB AF41 34 VALUE SN-QoS-Class-Background-PHB AF42 36 VALUE SN-QoS-Class-Background-PHB AF43 38 VALUE SN-QoS-Class-Background-PHB EF 46 VALUE SN-QoS-Class-Conversational-PHB Best-Effort 0 VALUE SN-QoS-Class-Conversational-PHB Pass-Through 1 VALUE SN-QoS-Class-Conversational-PHB AF11 10 VALUE SN-QoS-Class-Conversational-PHB AF12 12 VALUE SN-QoS-Class-Conversational-PHB AF13 14 VALUE SN-QoS-Class-Conversational-PHB AF21 18 VALUE SN-QoS-Class-Conversational-PHB AF22 20 VALUE SN-QoS-Class-Conversational-PHB AF23 22 VALUE SN-QoS-Class-Conversational-PHB AF31 26 VALUE SN-QoS-Class-Conversational-PHB AF32 28 VALUE SN-QoS-Class-Conversational-PHB AF33 30 VALUE SN-QoS-Class-Conversational-PHB AF41 34 VALUE SN-QoS-Class-Conversational-PHB AF42 36 VALUE SN-QoS-Class-Conversational-PHB AF43 38 VALUE SN-QoS-Class-Conversational-PHB EF 46 VALUE SN-QoS-Class-Interactive-1-PHB Best-Effort 0 VALUE SN-QoS-Class-Interactive-1-PHB Pass-Through 1 VALUE SN-QoS-Class-Interactive-1-PHB AF11 10 VALUE SN-QoS-Class-Interactive-1-PHB AF12 12 VALUE SN-QoS-Class-Interactive-1-PHB AF13 14 VALUE SN-QoS-Class-Interactive-1-PHB AF21 18 VALUE SN-QoS-Class-Interactive-1-PHB AF22 20 VALUE SN-QoS-Class-Interactive-1-PHB AF23 22 VALUE SN-QoS-Class-Interactive-1-PHB AF31 26 VALUE SN-QoS-Class-Interactive-1-PHB AF32 28 VALUE SN-QoS-Class-Interactive-1-PHB AF33 30 VALUE SN-QoS-Class-Interactive-1-PHB AF41 34 VALUE SN-QoS-Class-Interactive-1-PHB AF42 36 VALUE SN-QoS-Class-Interactive-1-PHB AF43 38 VALUE SN-QoS-Class-Interactive-1-PHB EF 46 VALUE SN-QoS-Class-Interactive-2-PHB Best-Effort 0 VALUE SN-QoS-Class-Interactive-2-PHB Pass-Through 1 VALUE SN-QoS-Class-Interactive-2-PHB AF11 10 VALUE SN-QoS-Class-Interactive-2-PHB AF12 12 VALUE SN-QoS-Class-Interactive-2-PHB AF13 14 VALUE SN-QoS-Class-Interactive-2-PHB AF21 18 VALUE SN-QoS-Class-Interactive-2-PHB AF22 20 VALUE SN-QoS-Class-Interactive-2-PHB AF23 22 VALUE SN-QoS-Class-Interactive-2-PHB AF31 26 VALUE SN-QoS-Class-Interactive-2-PHB AF32 28 VALUE SN-QoS-Class-Interactive-2-PHB AF33 30 VALUE SN-QoS-Class-Interactive-2-PHB AF41 34 VALUE SN-QoS-Class-Interactive-2-PHB AF42 36 VALUE SN-QoS-Class-Interactive-2-PHB AF43 38 VALUE SN-QoS-Class-Interactive-2-PHB EF 46 VALUE SN-QoS-Class-Interactive-3-PHB Best-Effort 0 VALUE SN-QoS-Class-Interactive-3-PHB Pass-Through 1 VALUE SN-QoS-Class-Interactive-3-PHB AF11 10 VALUE SN-QoS-Class-Interactive-3-PHB AF12 12 VALUE SN-QoS-Class-Interactive-3-PHB AF13 14 VALUE SN-QoS-Class-Interactive-3-PHB AF21 18 VALUE SN-QoS-Class-Interactive-3-PHB AF22 20 VALUE SN-QoS-Class-Interactive-3-PHB AF23 22 VALUE SN-QoS-Class-Interactive-3-PHB AF31 26 VALUE SN-QoS-Class-Interactive-3-PHB AF32 28 VALUE SN-QoS-Class-Interactive-3-PHB AF33 30 VALUE SN-QoS-Class-Interactive-3-PHB AF41 34 VALUE SN-QoS-Class-Interactive-3-PHB AF42 36 VALUE SN-QoS-Class-Interactive-3-PHB AF43 38 VALUE SN-QoS-Class-Interactive-3-PHB EF 46 VALUE SN-QoS-Class-Streaming-PHB Best-Effort 0 VALUE SN-QoS-Class-Streaming-PHB Pass-Through 1 VALUE SN-QoS-Class-Streaming-PHB AF11 10 VALUE SN-QoS-Class-Streaming-PHB AF12 12 VALUE SN-QoS-Class-Streaming-PHB AF13 14 VALUE SN-QoS-Class-Streaming-PHB AF21 18 VALUE SN-QoS-Class-Streaming-PHB AF22 20 VALUE SN-QoS-Class-Streaming-PHB AF23 22 VALUE SN-QoS-Class-Streaming-PHB AF31 26 VALUE SN-QoS-Class-Streaming-PHB AF32 28 VALUE SN-QoS-Class-Streaming-PHB AF33 30 VALUE SN-QoS-Class-Streaming-PHB AF41 34 VALUE SN-QoS-Class-Streaming-PHB AF42 36 VALUE SN-QoS-Class-Streaming-PHB AF43 38 VALUE SN-QoS-Class-Streaming-PHB EF 46 VALUE SN-QoS-Tp-Dnlk Disabled 0 VALUE SN-QoS-Tp-Dnlk Policing 1 VALUE SN-QoS-Tp-Dnlk Shaping 2 VALUE SN-QoS-Tp-Uplk Disabled 0 VALUE SN-QoS-Tp-Uplk Policing 1 VALUE SN-QoS-Tp-Uplk Shaping 2 VALUE SN-Radius-Returned-Username No 0 VALUE SN-Radius-Returned-Username Yes 1 VALUE SN-Roaming-Sub-Use-GGSN Deny 0 VALUE SN-Roaming-Sub-Use-GGSN Accept 1 VALUE SN-ROHC-Flow-Marking-Mode False 0 VALUE SN-ROHC-Flow-Marking-Mode True 1 VALUE SN-Role-Of-Node ORIGINATING_ROLE 0 VALUE SN-Role-Of-Node TERMINATING_ROLE 1 VALUE SN-Service-Type None 0 VALUE SN-Service-Type PDSN 1 VALUE SN-Service-Type Management 2 VALUE SN-Service-Type HA 3 VALUE SN-Service-Type GGSN 4 VALUE SN-Service-Type LNS 5 VALUE SN-Service-Type IPSG 6 VALUE SN-Service-Type CSCF 7 VALUE SN-Service-Type ASNGW 8 VALUE SN-Service-Type PDIF 9 VALUE SN-Service-Type STANDALONE_FA 10 VALUE SN-Service-Type SGSN 11 VALUE SN-Service-Type PHSGW 12 VALUE SN-Service-Type PDG 13 VALUE SN-Service-Type MIPV6HA 14 VALUE SN-Service-Type PGW 15 VALUE SN-Service-Type SGW 16 VALUE SN-Service-Type FNG 17 VALUE SN-Service-Type OGW 18 VALUE SN-Service-Type HNBGW 19 VALUE SN-Service-Type BNG 20 VALUE SN-Subs-Acc-Flow-Traffic-Valid Disabled 0 VALUE SN-Subs-Acc-Flow-Traffic-Valid Enabled 1 VALUE SN-Subscriber-Accounting None 0 VALUE SN-Subscriber-Accounting Radius 1 VALUE SN-Subscriber-Accounting GTPP 2 VALUE SN-Subscriber-Acct-Interim Normal 0 VALUE SN-Subscriber-Acct-Interim Suppress 1 VALUE SN-Subscriber-Acct-Mode flow-based-auxilliary 0 VALUE SN-Subscriber-Acct-Mode flow-based-all 1 VALUE SN-Subscriber-Acct-Mode flow-based-none 2 VALUE SN-Subscriber-Acct-Mode session-based 3 VALUE SN-Subscriber-Acct-Mode main-a10-only 4 VALUE SN-Subscriber-Acct-Rsp-Action None 0 VALUE SN-Subscriber-Acct-Rsp-Action No_Early_PDUs 1 VALUE SN-Subscriber-Acct-Rsp-Action Delay_GTP_Response 2 VALUE SN-Subscriber-Acct-Start Normal 0 VALUE SN-Subscriber-Acct-Start Suppress 1 VALUE SN-Subscriber-Acct-Stop Normal 0 VALUE SN-Subscriber-Acct-Stop Suppress 1 VALUE SN-Subscriber-Class Normal_Subscriber 0 VALUE SN-Subscriber-Class Ting_100 1 VALUE SN-Subscriber-Class Ting_500 2 VALUE SN-Subscriber-Class Ting_Buddy 3 VALUE SN-Subscriber-Class Ting_Star 4 VALUE SN-Subscriber-Class Ting_Nolimit_SMS 5 VALUE SN-Subscriber-Class Kids_Locator 6 VALUE SN-Subscriber-Class Ting_2000 7 VALUE SN-Subscriber-Class Handicapped_Welfare 8 VALUE SN-Subscriber-Class Reserved 9 VALUE SN-Subscriber-IP-Hdr-Neg-Mode Force 0 VALUE SN-Subscriber-IP-Hdr-Neg-Mode Detect 1 VALUE SN-Subscriber-IP-TOS-Copy None 0 VALUE SN-Subscriber-IP-TOS-Copy Access-Tunnel 1 VALUE SN-Subscriber-IP-TOS-Copy Data-Tunnel 2 VALUE SN-Subscriber-IP-TOS-Copy Both 3 VALUE SN-Subscriber-No-Interims Disabled 0 VALUE SN-Subscriber-No-Interims Enabled 1 VALUE SN-Subs-VJ-Slotid-Cmp-Neg-Mode None 0 VALUE SN-Subs-VJ-Slotid-Cmp-Neg-Mode Receive 1 VALUE SN-Subs-VJ-Slotid-Cmp-Neg-Mode Transmit 2 VALUE SN-Subs-VJ-Slotid-Cmp-Neg-Mode Both 3 VALUE SN-Tp-Dnlk-Exceed-Action Transmit 0 VALUE SN-Tp-Dnlk-Exceed-Action Drop 1 VALUE SN-Tp-Dnlk-Exceed-Action Lower-IP-Precedence 2 VALUE SN-Tp-Dnlk-Exceed-Action Buffer 3 VALUE SN-Tp-Dnlk-Exceed-Action Transmit-On-Buffer-Full 4 VALUE SN-Tp-Dnlk-Violate-Action Transmit 0 VALUE SN-Tp-Dnlk-Violate-Action Drop 1 VALUE SN-Tp-Dnlk-Violate-Action Lower-IP-Precedence 2 VALUE SN-Tp-Dnlk-Violate-Action Buffer 3 VALUE SN-Tp-Dnlk-Violate-Action Transmit-On-Buffer-Full 4 VALUE SN-Tp-Uplk-Exceed-Action Transmit 0 VALUE SN-Tp-Uplk-Exceed-Action Drop 1 VALUE SN-Tp-Uplk-Exceed-Action Lower-IP-Precedence 2 VALUE SN-Tp-Uplk-Exceed-Action Buffer 3 VALUE SN-Tp-Uplk-Exceed-Action Transmit-On-Buffer-Full 4 VALUE SN-Tp-Uplk-Violate-Action Transmit 0 VALUE SN-Tp-Uplk-Violate-Action Drop 1 VALUE SN-Tp-Uplk-Violate-Action Lower-IP-Precedence 2 VALUE SN-Tp-Uplk-Violate-Action Buffer 3 VALUE SN-Tp-Uplk-Violate-Action Transmit-On-Buffer-Full 4 VALUE SN-Tun-Addr-Policy no-local-alloc-validate 0 VALUE SN-Tun-Addr-Policy local-alloc 1 VALUE SN-Tun-Addr-Policy local-alloc-validate 2 VALUE SN-Tunnel-Gn Disabled 0 VALUE SN-Tunnel-Gn Enabled 1 VALUE SN-Tunnel-Load-Balancing random 1 VALUE SN-Tunnel-Load-Balancing balanced 2 VALUE SN-Tunnel-Load-Balancing prioritized 3 VALUE SN-Visiting-Sub-Use-GGSN Deny 0 VALUE SN-Visiting-Sub-Use-GGSN Accept 1 VALUE SN-WiMAX-Auth-Only Disabled 0 VALUE SN-WiMAX-Auth-Only Enabled 1 END-VENDOR Starent freeradius-server/share/dictionary.starent.vsa1000066400000000000000000001550571257552170400222620ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2011 The FreeRADIUS Server project and contributors ############################################################################## # # Starent dictionary # http://www.starentnetworks.com/ # # Starent dictionary with 1 byte tag and 1 byte length. # # It conflicts with the standard Starent dictionary, so it is not # included by default. # # The source of this document is a Cisco Manual: # "Cisco ASR 5000 Series AAA and GTP Interface Administration and # Reference Release 12.x (Last Updated May 31, 2011)" # # This document is available at: # http://www.cisco.com/en/US/products/ps11072/products_implementation_design_guides_list.html # ############################################################################## VENDOR Starent 8164 format=1,1 BEGIN-VENDOR Starent ATTRIBUTE SN1-VPN-ID 1 integer ATTRIBUTE SN1-VPN-Name 2 string ATTRIBUTE SN1-Disconnect-Reason 3 integer ATTRIBUTE SN1-PPP-Progress-Code 4 integer ATTRIBUTE SN1-Primary-DNS-Server 5 ipaddr ATTRIBUTE SN1-Secondary-DNS-Server 6 ipaddr ATTRIBUTE SN1-Re-CHAP-Interval 7 integer ATTRIBUTE SN1-IP-Pool-Name 8 string ATTRIBUTE SN1-PPP-Data-Compression 9 integer ATTRIBUTE SN1-IP-Filter-In 10 string ATTRIBUTE SN1-IP-Filter-Out 11 string ATTRIBUTE SN1-Local-IP-Address 13 ipaddr ATTRIBUTE SN1-IP-Source-Validation 14 integer ATTRIBUTE SN1-PPP-Outbound-Password 15 string ATTRIBUTE SN1-PPP-Keepalive 16 integer ATTRIBUTE SN1-IP-In-ACL 17 string ATTRIBUTE SN1-IP-Out-ACL 18 string ATTRIBUTE SN1-PPP-Data-Compression-Mode 19 integer ATTRIBUTE SN1-Subscriber-Permission 20 integer ATTRIBUTE SN1-Admin-Permission 21 integer ATTRIBUTE SN1-Simultaneous-SIP-MIP 22 integer ATTRIBUTE SN1-Min-Compress-Size 23 integer ATTRIBUTE SN1-Service-Type 24 integer ATTRIBUTE SN1-DNS-Proxy-Use-Subscr-Addr 25 integer ATTRIBUTE SN1-Tunnel-Password 26 octets ATTRIBUTE SN1-Tunnel-Load-Balancing 27 integer ATTRIBUTE SN1-MN-HA-Timestamp-Tolerance 30 integer ATTRIBUTE SN1-Prepaid-Compressed-Count 31 integer ATTRIBUTE SN1-Prepaid-Inbound-Octets 32 integer ATTRIBUTE SN1-Prepaid-Outbound-Octets 33 integer ATTRIBUTE SN1-Prepaid-Total-Octets 34 integer ATTRIBUTE SN1-Prepaid-Timeout 35 integer ATTRIBUTE SN1-Prepaid-Watermark 36 integer ATTRIBUTE SN1-NAI-Construction-Domain 37 string ATTRIBUTE SN1-Tunnel-ISAKMP-Crypto-Map 38 string ATTRIBUTE SN1-Tunnel-ISAKMP-Secret 39 string ATTRIBUTE SN1-Ext-Inline-Srvr-Context 41 string ATTRIBUTE SN1-L3-to-L2-Tun-Addr-Policy 43 integer ATTRIBUTE SN1-Long-Duration-Timeout 44 integer ATTRIBUTE SN1-Long-Duration-Action 45 integer ATTRIBUTE SN1-PDSN1-Handoff-Req-IP-Addr 46 integer ATTRIBUTE SN1-HA-Send-DNS-ADDRESS 47 integer ATTRIBUTE SN1-MIP-Send-Term-Verification 48 integer ATTRIBUTE SN1-Data-Tunnel-Ignore-DF-Bit 49 integer ATTRIBUTE SN1-MIP-AAA-Assign-Addr 50 integer ATTRIBUTE SN1-Proxy-MIP 52 integer ATTRIBUTE SN1-MIP-Match-AAA-Assign-Addr 51 integer ATTRIBUTE SN1-IP-Alloc-Method 53 integer ATTRIBUTE SN1-Gratuitous-ARP-Aggressive 54 integer ATTRIBUTE SN1-Ext-Inline-Srvr-Up-Addr 55 ipaddr ATTRIBUTE SN1-Ext-Inline-Srvr-Down-Addr 56 ipaddr ATTRIBUTE SN1-Ext-Inline-Srvr-Preference 57 integer ATTRIBUTE SN1-Ext-Inline-Srvr-Up-VLAN 58 octets ATTRIBUTE SN1-Ext-Inline-Srvr-Down-VLAN 59 octets ATTRIBUTE SN1-IP-Hide-Service-Address 60 integer ATTRIBUTE SN1-PPP-Outbound-Username 61 string ATTRIBUTE SN1-GTP-Version 62 integer ATTRIBUTE SN1-Access-link-IP-Frag 63 integer ATTRIBUTE SN1-Subscriber-Accounting 64 integer ATTRIBUTE SN1-Nw-Reachability-Server-Name 65 string ATTRIBUTE SN1-Subscriber-IP-Hdr-Neg-Mode 67 integer ATTRIBUTE SN1-GGSN1-MIP-Required 68 integer ATTRIBUTE SN1-Subscriber-Acct-Start 69 integer ATTRIBUTE SN1-Subscriber-Acct-Interim 70 integer ATTRIBUTE SN1-Subscriber-Acct-Stop 71 integer ATTRIBUTE SN1-QoS-Tp-Dnlk 73 integer ATTRIBUTE SN1-Tp-Dnlk-Committed-Data-Rate 74 integer ATTRIBUTE SN1-Tp-Dnlk-Peak-Data-Rate 75 integer ATTRIBUTE SN1-Tp-Dnlk-Burst-Size 76 integer ATTRIBUTE SN1-Tp-Dnlk-Exceed-Action 77 integer ATTRIBUTE SN1-Tp-Dnlk-Violate-Action 78 integer ATTRIBUTE SN1-QoS-Tp-Uplk 79 integer ATTRIBUTE SN1-Tp-Uplk-Committed-Data-Rate 80 integer ATTRIBUTE SN1-Tp-Uplk-Peak-Data-Rate 81 integer ATTRIBUTE SN1-Tp-Uplk-Burst-Size 82 integer ATTRIBUTE SN1-Tp-Uplk-Exceed-Action 83 integer ATTRIBUTE SN1-Tp-Uplk-Violate-Action 84 integer ATTRIBUTE SN1-Subscriber-IP-TOS-Copy 85 integer ATTRIBUTE SN1-QoS-Conversation-Class 86 octets ATTRIBUTE SN1-QoS-Streaming-Class 87 octets ATTRIBUTE SN1-QoS-Interactive1-Class 88 octets ATTRIBUTE SN1-QoS-Interactive2-Class 89 octets ATTRIBUTE SN1-QoS-Interactive3-Class 90 octets ATTRIBUTE SN1-QoS-Background-Class 91 octets ATTRIBUTE SN1-PPP-NW-Layer-IPv4 92 integer ATTRIBUTE SN1-PPP-NW-Layer-IPv6 93 integer ATTRIBUTE SN1-Virtual-APN-Name 94 string ATTRIBUTE SN1-PPP-Accept-Peer-v6Ifid 95 integer ATTRIBUTE SN1-IPv6-rtr-advt-interval 96 integer ATTRIBUTE SN1-IPv6-num-rtr-advt 97 integer ATTRIBUTE SN1-NPU-Qos-Priority 98 integer ATTRIBUTE SN1-MN-HA-Hash-Algorithm 99 integer ATTRIBUTE SN1-Subscriber-Acct-Rsp-Action 100 integer ATTRIBUTE SN1-IPv6-Primary-DNS 101 ipv6addr ATTRIBUTE SN1-IPv6-Secondary-DNS 102 octets ATTRIBUTE SN1-IPv6-Egress-Filtering 103 integer ATTRIBUTE SN1-Mediation-VPN-Name 104 string ATTRIBUTE SN1-Mediation-Acct-Rsp-Action 105 integer ATTRIBUTE SN1-Home-Sub-Use-GGSN 106 integer ATTRIBUTE SN1-Visiting-Sub-Use-GGSN 107 integer ATTRIBUTE SN1-Roaming-Sub-Use-GGSN 108 integer ATTRIBUTE SN1-Home-Profile 109 integer ATTRIBUTE SN1-IP-Src-Validation-Drop-Limit 110 integer ATTRIBUTE SN1-QoS-Class-Conversational-PHB 111 integer ATTRIBUTE SN1-QoS-Class-Streaming-PHB 112 integer ATTRIBUTE SN1-QoS-Class-Background-PHB 113 integer ATTRIBUTE SN1-QoS-Class-Interactive-1-PHB 114 integer ATTRIBUTE SN1-QoS-Class-Interactive-2-PHB 115 integer ATTRIBUTE SN1-QoS-Class-Interactive-3-PHB 116 integer ATTRIBUTE SN1-Visiting-Profile 117 integer ATTRIBUTE SN1-Roaming-Profile 118 integer ATTRIBUTE SN1-Home-Behavior 119 integer ATTRIBUTE SN1-Visiting-Behavior 120 integer ATTRIBUTE SN1-Roaming-Behavior 121 integer ATTRIBUTE SN1-Internal-SM-Index 122 integer ATTRIBUTE SN1-Mediation-Enabled 123 integer ATTRIBUTE SN1-IPv6-Sec-Pool 124 string ATTRIBUTE SN1-IPv6-Sec-Prefix 125 octets ATTRIBUTE SN1-IPv6-DNS-Proxy 126 integer ATTRIBUTE SN1-Subscriber-Nexthop-Address 127 integer ATTRIBUTE SN1-Prepaid 128 integer ATTRIBUTE SN1-Prepaid-Preference 129 integer ATTRIBUTE SN1-PPP-Always-On-Vse 130 integer ATTRIBUTE SN1-Voice-Push-List-Name 131 string ATTRIBUTE SN1-Unclassify-List-Name 132 string ATTRIBUTE SN1-Subscriber-No-Interims 133 integer ATTRIBUTE SN1-Permit-User-Mcast-PDUs 134 integer ATTRIBUTE SN1-Prepaid-Final-Duration-Alg 135 integer ATTRIBUTE SN1-IPv6-Min-Link-MTU 136 integer ATTRIBUTE SN1-Charging-VPN-Name 137 string ATTRIBUTE SN1-Chrg-Char-Selection-Mode 138 integer ATTRIBUTE SN1-Cause-For-Rec-Closing 139 integer ATTRIBUTE SN1-Change-Condition 140 integer ATTRIBUTE SN1-Dynamic-Addr-Alloc-Ind-Flag 141 octets ATTRIBUTE SN1-Ntk-Initiated-Ctx-Ind-Flag 142 octets ATTRIBUTE SN1-Ntk-Session-Disconnect-Flag 143 integer ATTRIBUTE SN1-Enable-QoS-Renegotiation 144 integer ATTRIBUTE SN1-QoS-Renegotiation-Timeout 145 integer ATTRIBUTE SN1-QoS-Negotiated 147 string ATTRIBUTE SN1-Mediation-No-Interims 146 integer ATTRIBUTE SN1-Primary-NBNS-Server 148 ipaddr ATTRIBUTE SN1-Secondary-NBNS-Server 149 ipaddr ATTRIBUTE SN1-IP-Header-Compression 150 integer ATTRIBUTE SN1-Mode 151 integer #ATTRIBUTE SN1-ROHC-Mode 151 integer ATTRIBUTE SN1-Assigned-VLAN-ID 152 short ATTRIBUTE SN1-Direction 153 integer ATTRIBUTE SN1-MIP-HA-Assignment-Table 154 string ATTRIBUTE SN1-Tun-Addr-Policy 156 integer ATTRIBUTE SN1-DHCP-Lease-Expiry-Policy 157 integer ATTRIBUTE SN1-Subscriber-Template-Name 158 string ATTRIBUTE SN1-Subs-IMSA-Service-Name 159 string ATTRIBUTE SN1-Traffic-Group 161 integer ATTRIBUTE SN1-Rad-APN-Name 162 octets ATTRIBUTE SN1-MIP-Send-Ancid 163 integer ATTRIBUTE SN1-MIP-Send-Imsi 164 integer ATTRIBUTE SN1-MIP-Dual-Anchor 165 integer ATTRIBUTE SN1-MIP-ANCID 166 octets ATTRIBUTE SN1-IMS-AM-Address 167 ipaddr ATTRIBUTE SN1-IMS-AM-Domain-Name 168 octets ATTRIBUTE SN1-Service-Address 169 ipaddr ATTRIBUTE SN1-PDIF-MIP-Required 170 integer ATTRIBUTE SN1-FMC-Location 171 octets ATTRIBUTE SN1-PDIF-MIP-Release-TIA 172 integer ATTRIBUTE SN1-PDIF-MIP-Simple-IP-Fallback 173 integer ATTRIBUTE SN1-Tunnel-Gn 174 integer ATTRIBUTE SN1-MIP-Reg-Lifetime-Realm 175 integer ATTRIBUTE SN1-Ecs-Data-Volume 176 octets ATTRIBUTE SN1-QoS-Traffic-Policy 177 octets ATTRIBUTE SN1-ANID 178 octets ATTRIBUTE SN1-PPP-Reneg-Disc 187 integer ATTRIBUTE SN1-MIP-Send-Correlation-Info 188 integer ATTRIBUTE SN1-PDSN1-Correlation-Id 189 octets ATTRIBUTE SN1-PDSN1-NAS-Id 190 string ATTRIBUTE SN1-PDSN1-NAS-IP-Address 191 ipaddr ATTRIBUTE SN1-Subscriber-Acct-Mode 192 integer ATTRIBUTE SN1-IP-In-Plcy-Grp 193 string ATTRIBUTE SN1-IP-Out-Plcy-Grp 194 string ATTRIBUTE SN1-IP-Source-Violate-No-Acct 196 integer ATTRIBUTE SN1-Firewall-Enabled 198 integer ATTRIBUTE SNA-PPP-Unfr-data-In-Oct 200 integer ATTRIBUTE SNA-PPP-Unfr-data-Out-Oct 201 integer ATTRIBUTE SNA-PPP-Unfr-Data-In-Gig 202 integer ATTRIBUTE SNA-PPP-Unfr-Data-Out-Gig 203 integer ATTRIBUTE SN1-Admin-Expiry 204 integer ATTRIBUTE SNA-Input-Gigawords 206 integer ATTRIBUTE SNA-Output-Gigawords 207 integer ATTRIBUTE SN1-DNS-Proxy-Intercept-List 214 string ATTRIBUTE SN1-Subscriber-Class 219 integer ATTRIBUTE SN1-CFPolicy-ID 220 integer ATTRIBUTE SN1-Subs-VJ-Slotid-Cmp-Neg-Mode 221 integer ATTRIBUTE SN1-Primary-DCCA-Peer 223 string ATTRIBUTE SN1-Secondary-DCCA-Peer 224 string ATTRIBUTE SN1-Subs-Acc-Flow-Traffic-Valid 225 integer ATTRIBUTE SN1-Acct-Input-Packets-Dropped 226 integer ATTRIBUTE SN1-Acct-Output-Packets-Dropped 227 integer # SN-Acct-Input-Octets-Dropped is octets and not integer as length is 8 ATTRIBUTE SN1-Acct-Input-Octets-Dropped 228 octets # SN-Acct-Output-Octets-Dropped is octets and not integer as length is 8 ATTRIBUTE SN1-Acct-Output-Octets-Dropped 229 octets ATTRIBUTE SN1-Acct-Input-Giga-Dropped 230 integer ATTRIBUTE SN1-Acct-Output-Giga-Dropped 231 integer ATTRIBUTE SN1-Overload-Disc-Connect-Time 233 integer ATTRIBUTE SN1-Overload-Disconnect 235 integer ATTRIBUTE SN1-Radius-Returned-Username 236 integer ATTRIBUTE SN1-ROHC-Profile-Name 238 string ATTRIBUTE SN1-Firewall-Policy 239 octets ATTRIBUTE SN1-Transparent-Data 247 octets ATTRIBUTE SN1-MS-ISDN 248 octets ATTRIBUTE SN1-Routing-Area-Id 249 string #ATTRIBUTE SN1-Rulebase 249 string ATTRIBUTE SN1-Call-Id 251 integer ATTRIBUTE SN1-IMSI 252 octets ATTRIBUTE SN1-Long-Duration-Notification 253 integer ATTRIBUTE SN1-SIP-Method 254 integer ATTRIBUTE SN1-Event 255 string VALUE SN1-Disconnect-Reason Not-Defined 0 VALUE SN1-Disconnect-Reason Admin-Disconnect 1 VALUE SN1-Disconnect-Reason Remote-Disconnect 2 VALUE SN1-Disconnect-Reason Local-Disconnect 3 VALUE SN1-Disconnect-Reason Disc-No-Resource 4 VALUE SN1-Disconnect-Reason Disc-Excd-Service-Limit 5 VALUE SN1-Disconnect-Reason PPP-LCP-Neg-Failed 6 VALUE SN1-Disconnect-Reason PPP-LCP-No-Response 7 VALUE SN1-Disconnect-Reason PPP-LCP-Loopback 8 VALUE SN1-Disconnect-Reason PPP-LCP-Max-Retry 9 VALUE SN1-Disconnect-Reason PPP-Echo-Failed 10 VALUE SN1-Disconnect-Reason PPP-Auth-Failed 11 VALUE SN1-Disconnect-Reason PPP-Auth-Failed-No-AAA-Resp 12 VALUE SN1-Disconnect-Reason PPP-Auth-No-Response 13 VALUE SN1-Disconnect-Reason PPP-Auth-Max-Retry 14 VALUE SN1-Disconnect-Reason Invalid-AAA-Attr 15 VALUE SN1-Disconnect-Reason Failed-User-Filter 16 VALUE SN1-Disconnect-Reason Failed-Provide-Service 17 VALUE SN1-Disconnect-Reason Invalid-IP-Address-AAA 18 VALUE SN1-Disconnect-Reason Invalid-IP-Pool-AAA 19 VALUE SN1-Disconnect-Reason PPP-IPCP-Neg-Failed 20 VALUE SN1-Disconnect-Reason PPP-IPCP-No-Response 21 VALUE SN1-Disconnect-Reason PPP-IPCP-Max-Retry 22 VALUE SN1-Disconnect-Reason PPP-No-Rem-IP-Address 23 VALUE SN1-Disconnect-Reason Inactivity-Timeout 24 VALUE SN1-Disconnect-Reason Session-Timeout 25 VALUE SN1-Disconnect-Reason Max-Data-Excd 26 VALUE SN1-Disconnect-Reason Invalid-IP-Source-Address 27 VALUE SN1-Disconnect-Reason MSID-Auth-Failed 28 VALUE SN1-Disconnect-Reason MSID-Auth-Fauiled-No-AAA-Resp 29 VALUE SN1-Disconnect-Reason A11-Max-Retry 30 VALUE SN1-Disconnect-Reason A11-Lifetime-Expired 31 VALUE SN1-Disconnect-Reason A11-Message-Integrity-Failure 32 VALUE SN1-Disconnect-Reason PPP-lcp-remote-disc 33 VALUE SN1-Disconnect-Reason Session-setup-timeout 34 VALUE SN1-Disconnect-Reason PPP-keepalive-failure 35 VALUE SN1-Disconnect-Reason Flow-add-failed 36 VALUE SN1-Disconnect-Reason Call-type-detection-failed 37 VALUE SN1-Disconnect-Reason Wrong-ipcp-params 38 VALUE SN1-Disconnect-Reason MIP-remote-dereg 39 VALUE SN1-Disconnect-Reason MIP-lifetime-expiry 40 VALUE SN1-Disconnect-Reason MIP-proto-error 41 VALUE SN1-Disconnect-Reason MIP-auth-failure 42 VALUE SN1-Disconnect-Reason MIP-reg-timeout 43 VALUE SN1-Disconnect-Reason Invalid-dest-context 44 VALUE SN1-Disconnect-Reason Source-context-removed 45 VALUE SN1-Disconnect-Reason Destination-context-removed 46 VALUE SN1-Disconnect-Reason Req-service-addr-unavailable 47 VALUE SN1-Disconnect-Reason Demux-mgr-failed 48 VALUE SN1-Disconnect-Reason Internal-error 49 VALUE SN1-Disconnect-Reason AAA-context-removed 50 VALUE SN1-Disconnect-Reason invalid-service-type 51 VALUE SN1-Disconnect-Reason mip-relay-req-failed 52 VALUE SN1-Disconnect-Reason mip-rcvd-relay-failure 53 VALUE SN1-Disconnect-Reason ppp-restart-inter-pdsn-handoff 54 VALUE SN1-Disconnect-Reason gre-key-mismatch 55 VALUE SN1-Disconnect-Reason invalid_tunnel_context 56 VALUE SN1-Disconnect-Reason no_peer_lns_address 57 VALUE SN1-Disconnect-Reason failed_tunnel_connect 58 VALUE SN1-Disconnect-Reason l2tp-tunnel-disconnect-remote 59 VALUE SN1-Disconnect-Reason l2tp-tunnel-timeout 60 VALUE SN1-Disconnect-Reason l2tp-protocol-error-remote 61 VALUE SN1-Disconnect-Reason l2tp-protocol-error-local 62 VALUE SN1-Disconnect-Reason l2tp-auth-failed-remote 63 VALUE SN1-Disconnect-Reason l2tp-auth-failed-local 64 VALUE SN1-Disconnect-Reason l2tp-try-another-lns-from-remote 65 VALUE SN1-Disconnect-Reason l2tp-no-resource-local 66 VALUE SN1-Disconnect-Reason l2tp-no-resource-remote 67 VALUE SN1-Disconnect-Reason l2tp-tunnel-disconnect-local 68 VALUE SN1-Disconnect-Reason l2tp-admin-disconnect_remote 69 VALUE SN1-Disconnect-Reason l2tpmgr-reached-max-capacity 70 VALUE SN1-Disconnect-Reason MIP-reg-revocation 71 VALUE SN1-Disconnect-Reason path-failure 72 VALUE SN1-Disconnect-Reason dhcp-relay-ip-validation-failed 73 VALUE SN1-Disconnect-Reason gtp-unknown-pdp-addr-or-pdp-type 74 VALUE SN1-Disconnect-Reason gtp-all-dynamic-pdp-addr-occupied 75 VALUE SN1-Disconnect-Reason gtp-no-memory-is-available 76 VALUE SN1-Disconnect-Reason dhcp-relay-static-ip-addr-not-allowed 77 VALUE SN1-Disconnect-Reason dhcp-no-ip-addr-allocated 78 VALUE SN1-Disconnect-Reason dhcp-ip-addr-allocation-tmr-exp 79 VALUE SN1-Disconnect-Reason dhcp-ip-validation-failed 80 VALUE SN1-Disconnect-Reason dhcp-static-addr-not-allowed 81 VALUE SN1-Disconnect-Reason dhcp-ip-addr-not-available-at-present 82 VALUE SN1-Disconnect-Reason dhcp-lease-expired 83 VALUE SN1-Disconnect-Reason lpool-ip-validation-failed 84 VALUE SN1-Disconnect-Reason lpool-static-ip-addr-not-allowed 85 VALUE SN1-Disconnect-Reason static-ip-validation-failed 86 VALUE SN1-Disconnect-Reason static-ip-addr-not-present 87 VALUE SN1-Disconnect-Reason static-ip-addr-not-allowed 88 VALUE SN1-Disconnect-Reason radius-ip-validation-failed 89 VALUE SN1-Disconnect-Reason radius-ip-addr-not-provided 90 VALUE SN1-Disconnect-Reason invalid-ip-addr-from-sgsn 91 VALUE SN1-Disconnect-Reason no-more-sessions-in-aaa 92 VALUE SN1-Disconnect-Reason ggsn-aaa-auth-req-failed 93 VALUE SN1-Disconnect-Reason conflict-in-ip-addr-assignment 94 VALUE SN1-Disconnect-Reason apn-removed 95 VALUE SN1-Disconnect-Reason credits-used-bytes-in 96 VALUE SN1-Disconnect-Reason credits-used-bytes-out 97 VALUE SN1-Disconnect-Reason credits-used-bytes-total 98 VALUE SN1-Disconnect-Reason prepaid-failed 99 VALUE SN1-Disconnect-Reason l2tp-ipsec-tunnel-failure 100 VALUE SN1-Disconnect-Reason l2tp-ipsec-tunnel-disconnected 101 VALUE SN1-Disconnect-Reason mip-ipsec-sa-inactive 102 VALUE SN1-Disconnect-Reason Long-Duration-Timeout 103 VALUE SN1-Disconnect-Reason proxy-mip-registration-failure 104 VALUE SN1-Disconnect-Reason proxy-mip-binding-update 105 VALUE SN1-Disconnect-Reason proxy-mip-inter-pdsn-handoff-require-ip-address 106 VALUE SN1-Disconnect-Reason proxy-mip-inter-pdsn-handoff-mismatched-address 107 VALUE SN1-Disconnect-Reason Local-purge 108 VALUE SN1-Disconnect-Reason failed-update-handoff 109 VALUE SN1-Disconnect-Reason closed_rp-handoff-complete 110 VALUE SN1-Disconnect-Reason closed_rp-duplicate-session 111 VALUE SN1-Disconnect-Reason closed_rp-handoff-session-not-found 112 VALUE SN1-Disconnect-Reason closed_rp-handoff-failed 113 VALUE SN1-Disconnect-Reason pcf-monitor-keep-alive-failed 114 VALUE SN1-Disconnect-Reason call-internal-reject 115 VALUE SN1-Disconnect-Reason call-restarted 116 VALUE SN1-Disconnect-Reason a11-mn-ha-auth-failure 117 VALUE SN1-Disconnect-Reason a11-badly-formed 118 VALUE SN1-Disconnect-Reason a11-t-bit-not-set 119 VALUE SN1-Disconnect-Reason a11-unsupported-vendor-id 120 VALUE SN1-Disconnect-Reason a11-mismatched-id 121 VALUE SN1-Disconnect-Reason mipha-dup-home-addr-req 122 VALUE SN1-Disconnect-Reason mipha-dup-imsi-session 123 VALUE SN1-Disconnect-Reason ha-unreachable 124 VALUE SN1-Disconnect-Reason IPSP-addr-in-use 125 VALUE SN1-Disconnect-Reason mipfa-dup-home-addr-req 126 VALUE SN1-Disconnect-Reason mipha-ip-pool-busyout 127 VALUE SN1-Disconnect-Reason inter-pdsn-handoff 128 VALUE SN1-Disconnect-Reason active-to-dormant 129 VALUE SN1-Disconnect-Reason ppp-renegotiation 130 VALUE SN1-Disconnect-Reason active-start-param-change 131 VALUE SN1-Disconnect-Reason tarrif-boundary 132 VALUE SN1-Disconnect-Reason a11-disconnect-no-active-stop 133 VALUE SN1-Disconnect-Reason nw-reachability-failed-reject 134 VALUE SN1-Disconnect-Reason nw-reachability-failed-redirect 135 VALUE SN1-Disconnect-Reason container-max-exceeded 136 VALUE SN1-Disconnect-Reason static-addr-not-allowed-in-apn 137 VALUE SN1-Disconnect-Reason static-addr-required-by-radius 138 VALUE SN1-Disconnect-Reason static-addr-not-allowed-by-radius 139 VALUE SN1-Disconnect-Reason mip-registration-dropped 140 VALUE SN1-Disconnect-Reason counter-rollover 141 VALUE SN1-Disconnect-Reason constructed-nai-auth-fail 142 VALUE SN1-Disconnect-Reason inter-pdsn-service-optimize-handoff-disabled 143 VALUE SN1-Disconnect-Reason gre-key-collision 144 VALUE SN1-Disconnect-Reason inter-pdsn-service-optimize-handoff-triggered 145 VALUE SN1-Disconnect-Reason intra-pdsn-handoff-triggered 146 VALUE SN1-Disconnect-Reason delayed-abort-timer-expired 147 VALUE SN1-Disconnect-Reason Admin-AAA-disconnect 148 VALUE SN1-Disconnect-Reason Admin-AAA-disconnect-handoff 149 VALUE SN1-Disconnect-Reason PPP-IPV6CP-Neg-Failed 150 VALUE SN1-Disconnect-Reason PPP-IPV6CP-No-Response 151 VALUE SN1-Disconnect-Reason PPP-IPV6CP-Max-Retry 152 VALUE SN1-Disconnect-Reason PPP-Restart-Invalid-source-IPV4-address 153 VALUE SN1-Disconnect-Reason a11-disconnect-handoff-no-active-stop 154 VALUE SN1-Disconnect-Reason call-restarted-inter-pdsn-handoff 155 VALUE SN1-Disconnect-Reason call-restarted-ppp-termination 156 VALUE SN1-Disconnect-Reason mipfa-resource-conflict 157 VALUE SN1-Disconnect-Reason failed-auth-with-charging-svc 158 VALUE SN1-Disconnect-Reason mipha-dup-imsi-session-purge 159 VALUE SN1-Disconnect-Reason mipha-rev-pending-newcall 160 VALUE SN1-Disconnect-Reason volume-quota-reached 161 VALUE SN1-Disconnect-Reason duration-quota-reached 162 VALUE SN1-Disconnect-Reason gtp-user-authentication-failed 163 VALUE SN1-Disconnect-Reason MIP-reg-revocation-no-lcp-term 164 VALUE SN1-Disconnect-Reason MIP-private-ip-no-rev-tunnel 165 VALUE SN1-Disconnect-Reason Invalid-Prepaid-AAA-attr-in-auth-response 166 VALUE SN1-Disconnect-Reason mipha-prepaid-reset-dynamic-newcall 167 VALUE SN1-Disconnect-Reason gre-flow-control-timeout 168 VALUE SN1-Disconnect-Reason mip-paaa-bc-query-not-found 169 VALUE SN1-Disconnect-Reason mipha-dynamic-ip-addr-not-available 170 VALUE SN1-Disconnect-Reason a11-mismatched-id-on-handoff 171 VALUE SN1-Disconnect-Reason a11-badly-formed-on-handoff 172 VALUE SN1-Disconnect-Reason a11-unsupported-vendor-id-on-handoff 173 VALUE SN1-Disconnect-Reason a11-t-bit-not-set-on-handoff 174 VALUE SN1-Disconnect-Reason MIP-reg-revocation-i-bit-on 175 VALUE SN1-Disconnect-Reason A11-RRQ-Deny-Max-Count 176 VALUE SN1-Disconnect-Reason Dormant-Transition-During-Session-Setup 177 VALUE SN1-Disconnect-Reason PPP-Rem-Reneg-Disc-Always-Cfg 178 VALUE SN1-Disconnect-Reason PPP-Rem-Reneg-Disc-NAI-MSID-Mismatch 179 VALUE SN1-Disconnect-Reason mipha-subscriber-ipsec-tunnel-down 180 VALUE SN1-Disconnect-Reason mipha-subscriber-ipsec-tunnel-failed 181 VALUE SN1-Disconnect-Reason mipha-subscriber-ipsecmgr-death 182 VALUE SN1-Disconnect-Reason flow-is-deactivated 183 VALUE SN1-Disconnect-Reason ecsv2-license-exceeded 184 VALUE SN1-Disconnect-Reason IPSG-Auth-Failed 185 VALUE SN1-Disconnect-Reason driver-initiated 186 VALUE SN1-Disconnect-Reason ims-authorization-failed 187 VALUE SN1-Disconnect-Reason service-instance-released 188 VALUE SN1-Disconnect-Reason flow-released 189 VALUE SN1-Disconnect-Reason ppp-renego-no-ha-addr 190 VALUE SN1-Disconnect-Reason intra-pdsn-handoff 191 VALUE SN1-Disconnect-Reason overload-disconnect 192 VALUE SN1-Disconnect-Reason css-service-not-found 193 VALUE SN1-Disconnect-Reason Auth-Failed 194 VALUE SN1-Disconnect-Reason dhcp-client-sent-release 195 VALUE SN1-Disconnect-Reason dhcp-client-sent-nak 196 VALUE SN1-Disconnect-Reason msid-dhcp-chaddr-mismatch 197 VALUE SN1-Disconnect-Reason link-broken 198 VALUE SN1-Disconnect-Reason prog-end-timeout 199 VALUE SN1-Disconnect-Reason qos-update-wait-timeout 200 VALUE SN1-Disconnect-Reason css-synch-cause 201 VALUE SN1-Disconnect-Reason Gtp-context-replacement 202 VALUE SN1-Disconnect-Reason PDIF-Auth-failed 203 VALUE SN1-Disconnect-Reason l2tp-unknown-apn 204 VALUE SN1-Disconnect-Reason ms-unexpected-network-reentry 205 VALUE SN1-Disconnect-Reason r6-invalid-nai 206 VALUE SN1-Disconnect-Reason eap-max-retry-reached 207 VALUE SN1-Disconnect-Reason vbm-hoa-session-disconnected 208 VALUE SN1-Disconnect-Reason vbm-voa-session-disconnected 209 VALUE SN1-Disconnect-Reason in-acl-disconnect-on-violation 210 VALUE SN1-Disconnect-Reason eap-msk-lifetime-expiry 211 VALUE SN1-Disconnect-Reason eap-msk-lifetime-too-low 212 VALUE SN1-Disconnect-Reason mipfa-inter-tech-handoff 213 VALUE SN1-Disconnect-Reason r6-max-retry-reached 214 VALUE SN1-Disconnect-Reason r6-nwexit-recd 215 VALUE SN1-Disconnect-Reason r6-dereg-req-recd 216 VALUE SN1-Disconnect-Reason r6-remote-failure 217 VALUE SN1-Disconnect-Reason r6r4-protocol-errors 218 VALUE SN1-Disconnect-Reason wimax-qos-invalid-aaa-attr 219 VALUE SN1-Disconnect-Reason npu-gre-flows-not-available 220 VALUE SN1-Disconnect-Reason r4-max-retry-reached 221 VALUE SN1-Disconnect-Reason r4-nwexit-recd 222 VALUE SN1-Disconnect-Reason r4-dereg-req-recd 223 VALUE SN1-Disconnect-Reason r4-remote-failure 224 VALUE SN1-Disconnect-Reason ims-authorization-revoked 225 VALUE SN1-Disconnect-Reason ims-authorization-released 226 VALUE SN1-Disconnect-Reason ims-auth-decision-invalid 227 VALUE SN1-Disconnect-Reason mac-addr-validation-failed 228 VALUE SN1-Disconnect-Reason excessive-wimax-pd-flows-cfgd 229 VALUE SN1-Disconnect-Reason sgsn-canc-loc-sub 230 VALUE SN1-Disconnect-Reason sgsn-canc-loc-upd 231 VALUE SN1-Disconnect-Reason sgsn-mnr-exp 232 VALUE SN1-Disconnect-Reason sgsn-ident-fail 233 VALUE SN1-Disconnect-Reason sgsn-sec-fail 234 VALUE SN1-Disconnect-Reason sgsn-auth-fail 235 VALUE SN1-Disconnect-Reason sgsn-glu-fail 236 VALUE SN1-Disconnect-Reason sgsn-imp-det 237 VALUE SN1-Disconnect-Reason sgsn-smgr-purge 238 VALUE SN1-Disconnect-Reason sgsn-subs-handed-to-peer 239 VALUE SN1-Disconnect-Reason sgsn-dns-fail-inter-rau 240 VALUE SN1-Disconnect-Reason sgsn-cont-rsp-fail 241 VALUE SN1-Disconnect-Reason sgsn-hlr-not-found-for-imsi 242 VALUE SN1-Disconnect-Reason sgsn-ms-init-det 243 VALUE SN1-Disconnect-Reason sgsn-opr-policy-fail 244 VALUE SN1-Disconnect-Reason sgsn-duplicate-context 245 VALUE SN1-Disconnect-Reason hss-profile-update-failed 246 VALUE SN1-Disconnect-Reason sgsn-no-pdp-activated 247 VALUE SN1-Disconnect-Reason asnpc-idle-mode-timeout 248 VALUE SN1-Disconnect-Reason asnpc-idle-mode-exit 249 VALUE SN1-Disconnect-Reason asnpc-idle-mode-auth-failed 250 VALUE SN1-Disconnect-Reason asngw-invalid-qos-configuration 251 VALUE SN1-Disconnect-Reason sgsn-dsd-allgprswithdrawn 252 VALUE SN1-Disconnect-Reason r6-pmk-key-change-failure 253 VALUE SN1-Disconnect-Reason sgsn-illegal-me 254 VALUE SN1-Disconnect-Reason sess-termination-timeout 255 VALUE SN1-Disconnect-Reason sgsn-sai-fail 256 VALUE SN1-Disconnect-Reason sgsn-rnc-removal 257 VALUE SN1-Disconnect-Reason sgsn-rai-removal 258 VALUE SN1-Disconnect-Reason sgsn-init-deact 259 VALUE SN1-Disconnect-Reason ggsn-init-deact 260 VALUE SN1-Disconnect-Reason hlr-init-deact 261 VALUE SN1-Disconnect-Reason ms-init-deact 262 VALUE SN1-Disconnect-Reason sgsn-detach-init-deact 263 VALUE SN1-Disconnect-Reason sgsn-rab-rel-init-deact 264 VALUE SN1-Disconnect-Reason sgsn-iu-rel-init-deact 265 VALUE SN1-Disconnect-Reason sgsn-gtpu-path-failure 266 VALUE SN1-Disconnect-Reason sgsn-gtpc-path-failure 267 VALUE SN1-Disconnect-Reason sgsn-local-handoff-init-deact 268 VALUE SN1-Disconnect-Reason sgsn-remote-handoff-init-deact 269 VALUE SN1-Disconnect-Reason sgsn-gtp-no-resource 270 VALUE SN1-Disconnect-Reason sgsn-rnc-no-resource 271 VALUE SN1-Disconnect-Reason sgsn-odb-init-deact 272 VALUE SN1-Disconnect-Reason sgsn-invalid-ti 273 VALUE SN1-Disconnect-Reason sgsn-ggsn-ctxt-non-existent 274 VALUE SN1-Disconnect-Reason sgsn-apn-restrict-vio 275 VALUE SN1-Disconnect-Reason sgsn-regular-deact 276 VALUE SN1-Disconnect-Reason sgsn-abnormal-deact 277 VALUE SN1-Disconnect-Reason sgsn-actv-rejected-by-peer 278 VALUE SN1-Disconnect-Reason sgsn-err-ind 279 VALUE SN1-Disconnect-Reason asngw-non-anchor-prohibited 280 VALUE SN1-Disconnect-Reason asngw-im-entry-prohibited 281 VALUE SN1-Disconnect-Reason session-idle-mode-entry-timeout 282 VALUE SN1-Disconnect-Reason session-idle-mode-exit-timeout 283 VALUE SN1-Disconnect-Reason asnpc-ms-power-down-nwexit 284 VALUE SN1-Disconnect-Reason asnpc-r4-nwexit-recd 285 VALUE SN1-Disconnect-Reason sgsn-iu-rel-before-call-est 286 VALUE SN1-Disconnect-Reason ikev2-subscriber-ipsecmgr-death 287 VALUE SN1-Disconnect-Reason All-dynamic-pool-addr-occupied 288 VALUE SN1-Disconnect-Reason mip6ha-ip-addr-not-available 289 VALUE SN1-Disconnect-Reason bs-monitor-keep-alive-failed 290 VALUE SN1-Disconnect-Reason sgsn-att-in-reg-state 291 VALUE SN1-Disconnect-Reason sgsn-inbound-srns-in-reg-state 292 VALUE SN1-Disconnect-Reason dt-ggsn-tun-reestablish-failed 293 VALUE SN1-Disconnect-Reason sgsn-unknown-pdp 294 VALUE SN1-Disconnect-Reason sgsn-pdp-auth-failure 295 VALUE SN1-Disconnect-Reason sgsn-duplicate-pdp-context 296 VALUE SN1-Disconnect-Reason sgsn-no-rsp-from-ggsn 297 VALUE SN1-Disconnect-Reason sgsn-failure-rsp-from-ggsn 298 VALUE SN1-Disconnect-Reason sgsn-apn-unknown 299 VALUE SN1-Disconnect-Reason sgsn-serv-req-init-deact 300 VALUE SN1-Disconnect-Reason sgsn-attach-on-attch-init-abort 301 VALUE SN1-Disconnect-Reason sgsn-iu-rel-in-israu-init-abort 302 VALUE SN1-Disconnect-Reason sgsn-smgr-init-abort 303 VALUE SN1-Disconnect-Reason sgsn-mm-ctx-cleanup-init-abort 304 VALUE SN1-Disconnect-Reason sgsn-unknown-abort 305 VALUE SN1-Disconnect-Reason sgsn-guard-timeout-abort 306 VALUE SN1-Disconnect-Reason vpn-bounce-dhcpip-validate-req 307 VALUE SN1-Disconnect-Reason mipv6-id-mismatch 308 VALUE SN1-Disconnect-Reason aaa-session-id-not-found 309 VALUE SN1-Disconnect-Reason x1-max-retry-reached 310 VALUE SN1-Disconnect-Reason x1-nwexit-recd 311 VALUE SN1-Disconnect-Reason x1-dereg-req-recd 312 VALUE SN1-Disconnect-Reason x1-remote-failure 313 VALUE SN1-Disconnect-Reason x1x2-protocol-errors 314 VALUE SN1-Disconnect-Reason x2-max-retry-reached 315 VALUE SN1-Disconnect-Reason x2-nwexit-recd 316 VALUE SN1-Disconnect-Reason x2-dereg-req-recd 317 VALUE SN1-Disconnect-Reason x2-remote-failure 318 VALUE SN1-Disconnect-Reason x1-pmk-key-change-failure 319 VALUE SN1-Disconnect-Reason sa-rekeying-failure 320 VALUE SN1-Disconnect-Reason sess-sleep-mode-entry-timeout 321 VALUE SN1-Disconnect-Reason phsgw-non-anchor-prohibited 322 VALUE SN1-Disconnect-Reason asnpc-pc-relocation-failed 323 VALUE SN1-Disconnect-Reason asnpc-pc-relocation 324 VALUE SN1-Disconnect-Reason auth_policy_mismatch 325 VALUE SN1-Disconnect-Reason sa-lifetime-expiry 326 VALUE SN1-Disconnect-Reason asnpc-del-ms-entry-recd 327 VALUE SN1-Disconnect-Reason phspc-sleep-mode-timeout 328 VALUE SN1-Disconnect-Reason phspc-sleep-mode-exit 329 VALUE SN1-Disconnect-Reason phspc-sleep-mode-auth-failed 330 VALUE SN1-Disconnect-Reason phspc-ms-power-down-nwexit 331 VALUE SN1-Disconnect-Reason phspc-x2-nwexit-recd 332 VALUE SN1-Disconnect-Reason invalid-nat-config 333 VALUE SN1-Disconnect-Reason asngw-tid-entry-not-found 334 VALUE SN1-Disconnect-Reason No-NAT-IP-Address 335 VALUE SN1-Disconnect-Reason excessive-phs-pd-flows-cfgd 336 VALUE SN1-Disconnect-Reason phsgw-invalid-qos-configuration 337 VALUE SN1-Disconnect-Reason Interim-Update 338 VALUE SN1-Disconnect-Reason sgsn-attach-abrt-rad-lost 339 VALUE SN1-Disconnect-Reason sgsn-inbnd-irau-abrt-rad-lost 340 VALUE SN1-Disconnect-Reason ike-keepalive-failed 341 VALUE SN1-Disconnect-Reason sgsn-attach-abrt-ms-suspend 342 VALUE SN1-Disconnect-Reason sgsn-inbnd-irau-abrt-ms-suspend 343 VALUE SN1-Disconnect-Reason duplicate-session-detected 344 VALUE SN1-Disconnect-Reason sgsn-xid-response-failure 345 VALUE SN1-Disconnect-Reason sgsn-nse-cleanup 346 VALUE SN1-Disconnect-Reason sgsn-gtp-req-failure 347 VALUE SN1-Disconnect-Reason sgsn-imsi-mismatch 348 VALUE SN1-Disconnect-Reason sgsn-bvc-blocked 349 VALUE SN1-Disconnect-Reason sgsn-attach-on-inbound-irau 350 VALUE SN1-Disconnect-Reason sgsn-attach-on-outbound-irau 351 VALUE SN1-Disconnect-Reason sgsn-incorrect-state 352 VALUE SN1-Disconnect-Reason sgsn-t3350-expiry 353 VALUE SN1-Disconnect-Reason sgsn-page-timer-expiry 354 VALUE SN1-Disconnect-Reason phsgw-tid-entry-not-found 355 VALUE SN1-Disconnect-Reason phspc-del-ms-entry-recd 356 VALUE SN1-Disconnect-Reason sgsn-pdp-local-purge 357 VALUE SN1-Disconnect-Reason phs-invalid-nai 358 VALUE SN1-Disconnect-Reason session-sleep-mode-exit-timeout 359 VALUE SN1-Disconnect-Reason sgsn-offload-phase2 360 VALUE SN1-Disconnect-Reason phs-thirdparty-auth-fail 361 VALUE SN1-Disconnect-Reason remote-error-notify 362 VALUE SN1-Disconnect-Reason no-response 363 VALUE SN1-Disconnect-Reason PDG-Auth-failed 364 VALUE SN1-Disconnect-Reason mme-s1AP-send-failed 365 VALUE SN1-Disconnect-Reason mme-egtpc-connection-failed 366 VALUE SN1-Disconnect-Reason mme-egtpc-create-session-failed 367 VALUE SN1-Disconnect-Reason mme-authentication-failure 368 VALUE SN1-Disconnect-Reason mme-ue-detach 369 VALUE SN1-Disconnect-Reason mme-mme-detach 370 VALUE SN1-Disconnect-Reason mme-hss-detach 371 VALUE SN1-Disconnect-Reason mme-pgw-detach 372 VALUE SN1-Disconnect-Reason mme-sub-validation-failure 373 VALUE SN1-Disconnect-Reason mme-hss-connection-failure 374 VALUE SN1-Disconnect-Reason mme-hss-user-unknown 375 VALUE SN1-Disconnect-Reason dhcp-lease-mismatch-detected 376 VALUE SN1-Disconnect-Reason nemo-link-layer-down 377 VALUE SN1-Disconnect-Reason eapol-max-retry-reached 378 VALUE SN1-Disconnect-Reason sgsn-offload-phase3 379 VALUE SN1-Disconnect-Reason mbms-bearer-service-disconnect 380 VALUE SN1-Disconnect-Reason disconnect-on-violation-odb 381 VALUE SN1-Disconnect-Reason disconn-on-violation-focs-odb 382 VALUE SN1-Disconnect-Reason CSCF-REG-Admin-disconnect 383 VALUE SN1-Disconnect-Reason CSCF-REG-User-disconnect 384 VALUE SN1-Disconnect-Reason CSCF-REG-Inactivity-timeout 385 VALUE SN1-Disconnect-Reason CSCF-REG-Network-disconnect 386 VALUE SN1-Disconnect-Reason CSCF-Call-Admin-disconnect 387 VALUE SN1-Disconnect-Reason CSCF-CAll-User-disconnect 388 VALUE SN1-Disconnect-Reason CSCF-CALL-Local-disconnect 389 VALUE SN1-Disconnect-Reason CSCF-CALL-No-Resource 390 VALUE SN1-Disconnect-Reason CSCF-CALL-No-Respone 391 VALUE SN1-Disconnect-Reason CSCF-CALL-Inactivity-timeout 392 VALUE SN1-Disconnect-Reason CSCF-CALL-Media-Auth-Failure 393 VALUE SN1-Disconnect-Reason CSCF-REG-No-Resource 394 VALUE SN1-Disconnect-Reason ms-unexpected-idle-mode-entry 395 VALUE SN1-Disconnect-Reason re-auth-failed 396 VALUE SN1-Disconnect-Reason sgsn-pdp-nse-cleanup 397 VALUE SN1-Disconnect-Reason sgsn-mm-ctxt-gtp-no-resource 398 VALUE SN1-Disconnect-Reason unknown-apn 399 VALUE SN1-Disconnect-Reason gtpc-path-failure 400 VALUE SN1-Disconnect-Reason gtpu-path-failure 401 VALUE SN1-Disconnect-Reason actv-rejected-by-sgsn 402 VALUE SN1-Disconnect-Reason sgsn-pdp-gprs-camel-release 403 VALUE SN1-Disconnect-Reason sgsn-check-imei-failure 404 VALUE SN1-Disconnect-Reason sgsn-sndcp-init-deact 405 VALUE SN1-Disconnect-Reason sgsn-pdp-inactivity-timeout 406 VALUE SN1-Disconnect-Reason fw-and-nat-policy-removed 407 VALUE SN1-Disconnect-Reason FNG-Auth-failed 408 VALUE SN1-Disconnect-Reason ha-stale-key-disconnect 409 VALUE SN1-Disconnect-Reason No-IPV6-address-for-subscriber 410 VALUE SN1-Disconnect-Reason prefix-registration-failure 411 VALUE SN1-Disconnect-Reason disconnect-from-policy-server 412 VALUE SN1-Disconnect-Reason s6b-auth-failed 413 VALUE SN1-Disconnect-Reason gtpc-err-ind 414 VALUE SN1-Disconnect-Reason gtpu-err-ind 415 VALUE SN1-Disconnect-Reason invalid-pdn-type 416 VALUE SN1-Disconnect-Reason aaa-auth-req-failed 417 VALUE SN1-Disconnect-Reason apn-denied-no-subscription 418 VALUE SN1-Disconnect-Reason Sgw-context-replacement 419 VALUE SN1-Disconnect-Reason dup-static-ip-addr-req 420 VALUE SN1-Disconnect-Reason apn-restrict-violation 421 VALUE SN1-Disconnect-Reason invalid-wapn 422 VALUE SN1-Disconnect-Reason ttg-nsapi-allocation-failed 423 VALUE SN1-Disconnect-Reason mandatory-gtp-ie-missing 424 VALUE SN1-Disconnect-Reason aaa-unreachable 425 VALUE SN1-Disconnect-Reason asngw-service-flow-deletion 426 VALUE SN1-Disconnect-Reason CT-PMIP-RRQ-NVSE-Value-Change 427 VALUE SN1-Disconnect-Reason tcp-read-failed 428 VALUE SN1-Disconnect-Reason tcp-write-failed 429 VALUE SN1-Disconnect-Reason ssl-handshake-failed 430 VALUE SN1-Disconnect-Reason ssl-renegotiate-failed 431 VALUE SN1-Disconnect-Reason ssl-bad-message 432 VALUE SN1-Disconnect-Reason ssl-alert-received 433 VALUE SN1-Disconnect-Reason ssl-disconnect 434 VALUE SN1-Disconnect-Reason ssl-migration 435 VALUE SN1-Disconnect-Reason sgsn-ard-failure 436 VALUE SN1-Disconnect-Reason sgsn-camel-release 437 VALUE SN1-Disconnect-Reason Hotlining-Status-Change 447 VALUE SN1-Disconnect-Reason ggsn-no-rsp-from-sgsn 448 VALUE SN1-Disconnect-Reason diameter-protocol-error 449 VALUE SN1-Disconnect-Reason diameter-request-timeout 450 VALUE SN1-Disconnect-Reason operator-policy 451 VALUE SN1-Disconnect-Reason spr-connection-timeout 452 VALUE SN1-Disconnect-Reason mipha-dup-wimax-session 453 VALUE SN1-Disconnect-Reason invalid-version-attr 454 VALUE SN1-Disconnect-Reason sgsn-zone-code-failure 455 VALUE SN1-PPP-Progress-Code Not-Defined 0 VALUE SN1-PPP-Progress-Code Call-Lcp-Down 1 VALUE SN1-PPP-Progress-Code Call-Disconnecting 2 VALUE SN1-PPP-Progress-Code Call-PPP-Renegotiating 3 VALUE SN1-PPP-Progress-Code Call-Lcp-Down_1 10 VALUE SN1-PPP-Progress-Code Call-Arrived 11 VALUE SN1-PPP-Progress-Code Call-Lcp-Up 12 VALUE SN1-PPP-Progress-Code Call-Authenticating 13 VALUE SN1-PPP-Progress-Code Call-Authenticated 14 VALUE SN1-PPP-Progress-Code Call-Ipcp-Up 15 VALUE SN1-PPP-Progress-Code Call-Simple-IP-Connected 16 VALUE SN1-PPP-Progress-Code Call-Mobile-IP-Connected 17 #VALUE SN1-PPP-Progress-Code Call-Disconnecting 20 #VALUE SN1-PPP-Progress-Code Call-PPP-Renegotiating 30 #VALUE SN1-PPP-Progress-Code Call-Arrived 40 VALUE SN1-PPP-Progress-Code Call-Pdg-Tcp-Connecting 45 VALUE SN1-PPP-Progress-Code Call-Pdg-Ssl-Connecting 46 #VALUE SN1-PPP-Progress-Code Call-Lcp-Up 50 #VALUE SN1-PPP-Progress-Code Call-Authenticating 60 VALUE SN1-PPP-Progress-Code Call-Bcmcs-Authenticating 70 #VALUE SN1-PPP-Progress-Code Call-Authenticated 80 VALUE SN1-PPP-Progress-Code Call-Tunnel-Connecting 85 #VALUE SN1-PPP-Progress-Code Call-Ipcp-Up 90 VALUE SN1-PPP-Progress-Code Call-Imsa-Authorizing 95 VALUE SN1-PPP-Progress-Code Call-Imsa-Authorized 97 VALUE SN1-PPP-Progress-Code Call-MBMS-UE-Authorizing 98 VALUE SN1-PPP-Progress-Code Call-MBMS-Bearer-Authorizing 99 #VALUE SN1-PPP-Progress-Code Call-Simple-IP-Connected 100 #VALUE SN1-PPP-Progress-Code Call-Mobile-IP-Connected 110 VALUE SN1-PPP-Progress-Code Call-Tunnel-Connected 115 VALUE SN1-PPP-Progress-Code Call-Pdp-Type-IP-Connected 120 VALUE SN1-PPP-Progress-Code Call-Pdp-Type-IPv6-Connected 125 VALUE SN1-PPP-Progress-Code Call-Pdp-Type-PPP-Connected 130 VALUE SN1-PPP-Progress-Code Call-Proxy-Mobile-IP-Connected 140 VALUE SN1-PPP-Progress-Code Call-Pdg-Connected 142 VALUE SN1-PPP-Progress-Code Call-Pdg-Ssl-Connected 141 VALUE SN1-PPP-Progress-Code Call-Pdg-Connected 142 VALUE SN1-PPP-Progress-Code Call-Pdg-Connected 142 VALUE SN1-PPP-Progress-Code Call-Ipsg-Connected 145 VALUE SN1-PPP-Progress-Code Call-Bcmcs-Connected 150 VALUE SN1-PPP-Progress-Code Call-MBMS-UE-Connected 155 VALUE SN1-PPP-Progress-Code Call-MBMS-Bearer-Connected 156 VALUE SN1-PPP-Progress-Code Call-Pending-Addr-From-DHCP 160 VALUE SN1-PPP-Progress-Code Call-Got-Addr-From-DHCP 170 VALUE SN1-PPP-Progress-Code Call-HA-IPSEC-Tunnel-Connecting 180 VALUE SN1-PPP-Progress-Code Call-HA-IPSEC-Connected 190 VALUE SN1-PPP-Progress-Code Call-ASN-Non-Anchor-Connected 200 VALUE SN1-PPP-Progress-Code Call-ASNPC-Connected 210 VALUE SN1-PPP-Progress-Code Call-Mobile-IPv6-Connected 220 VALUE SN1-PPP-Progress-Code Call-PMIPv6-Connected 221 VALUE SN1-PPP-Progress-Code Call-PHSPC-Connected 230 VALUE SN1-PPP-Progress-Code Call-GTP-IPv4-Connected 235 VALUE SN1-PPP-Progress-Code Call-GTP-IPv6-Connected 236 VALUE SN1-PPP-Progress-Code Call-GTP-IPv4-IPv6-Connected 237 VALUE SN1-PPP-Progress-Code Call-SGW-Connected 245 VALUE SN1-PPP-Progress-Code Call-MME-Attached 246 VALUE SN1-PPP-Progress-Code Call-Auth-Only-Connected 247 VALUE SN1-PPP-Data-Compression None 0 VALUE SN1-PPP-Data-Compression Stac-LZS 1 VALUE SN1-PPP-Data-Compression MPPC 2 VALUE SN1-PPP-Data-Compression MPCC-Stac-LZS 3 VALUE SN1-PPP-Data-Compression Deflate 4 VALUE SN1-PPP-Data-Compression Deflate-Stac-LZS 5 VALUE SN1-PPP-Data-Compression Deflate-MPCC 6 VALUE SN1-PPP-Data-Compression Deflate-MPCC-Stac-LZS 7 VALUE SN1-IP-Source-Validation No 0 VALUE SN1-IP-Source-Validation Yes 1 VALUE SN1-Subscriber-Permission None 0 VALUE SN1-Subscriber-Permission Simple-IP 1 VALUE SN1-Subscriber-Permission Mobile-IP 2 VALUE SN1-Subscriber-Permission Simple-IP-Mobile-IP 3 VALUE SN1-Subscriber-Permission HA-Mobile-IP 4 VALUE SN1-Subscriber-Permission Simple-IP-HA-Mobile-IP 5 VALUE SN1-Subscriber-Permission Mobile-IP-HA-Mobile-IP 6 VALUE SN1-Subscriber-Permission All 7 VALUE SN1-Subscriber-Permission GGSN-PDP-TYPE-IP 8 VALUE SN1-Subscriber-Permission GGSN-PDP-TYPE-PPP 16 VALUE SN1-Subscriber-Permission Network-Mobility 32 VALUE SN1-Subscriber-Permission FA-HA-NEMO 38 VALUE SN1-Subscriber-Permission All_ 63 VALUE SN1-Admin-Permission None 0 VALUE SN1-Admin-Permission CLI 1 VALUE SN1-Admin-Permission FTP 2 VALUE SN1-Admin-Permission CLI-FTP 3 VALUE SN1-Admin-Permission Intercept 4 VALUE SN1-Admin-Permission CLI-Intercept 5 VALUE SN1-Admin-Permission CLI-Intercept-FTP 7 VALUE SN1-Admin-Permission ECS 8 VALUE SN1-Admin-Permission CLI-ECS 9 VALUE SN1-Admin-Permission CLI-FTP-ECS 11 VALUE SN1-Admin-Permission CLI-Intercept-ECS 13 VALUE SN1-Admin-Permission CLI-Intercept-FTP-ECS 15 VALUE SN1-Simultaneous-SIP-MIP Disabled 0 VALUE SN1-Simultaneous-SIP-MIP Enabled 1 VALUE SN1-PPP-Data-Compression-Mode Normal 0 VALUE SN1-PPP-Data-Compression-Mode Stateless 1 VALUE SN1-Access-link-IP-Frag Normal 0 VALUE SN1-Access-link-IP-Frag DF-Ignore 1 VALUE SN1-Access-link-IP-Frag DF-Fragment-ICMP-Notify 2 VALUE SN1-Change-Condition QOSCHANGE 0 VALUE SN1-Change-Condition TARIFFTIMECHANGE 1 VALUE SN1-Change-Condition SGSNCHANGE 500 VALUE SN1-Data-Tunnel-Ignore-DF-Bit Disabled 0 VALUE SN1-Data-Tunnel-Ignore-DF-Bit Enabled 1 VALUE SN1-DHCP-Lease-Expiry-Policy auto-renew 0 VALUE SN1-DHCP-Lease-Expiry-Policy disconnect 1 VALUE SN1-Direction Any 0 VALUE SN1-Direction Uplink 1 VALUE SN1-Direction Downlink 2 VALUE SN1-DNS-Proxy-Use-Subscr-Addr Disable 0 VALUE SN1-DNS-Proxy-Use-Subscr-Addr Enable 1 VALUE SN1-Enable-QoS-Renegotiation No 0 VALUE SN1-Enable-QoS-Renegotiation Yes 1 VALUE SN1-Firewall-Enabled False 0 VALUE SN1-Firewall-Enabled True 1 VALUE SN1-GGSN1-MIP-Required Disabled 0 VALUE SN1-GGSN1-MIP-Required Enabled 1 VALUE SN1-Gratuitous-ARP-Aggressive Disabled 0 VALUE SN1-Gratuitous-ARP-Aggressive Enabled 1 VALUE SN1-GTP-Version GTP_VERSION_0 0 VALUE SN1-GTP-Version GTP_VERSION_1 1 VALUE SN1-GTP-Version GTP_VERSION_2 2 VALUE SN1-HA-Send-DNS-ADDRESS Disabled 0 VALUE SN1-HA-Send-DNS-ADDRESS Enabled 1 VALUE SN1-Home-Sub-Use-GGSN Deny 0 VALUE SN1-Home-Sub-Use-GGSN Accept 1 VALUE SN1-IP-Alloc-Method Alloc_Local_Pool 0 VALUE SN1-IP-Alloc-Method Alloc_Dhcp_Client 1 VALUE SN1-IP-Alloc-Method Alloc_Radius 2 VALUE SN1-IP-Alloc-Method Alloc_No_Alloc 3 VALUE SN1-IP-Alloc-Method Alloc_Static_Alloc 4 VALUE SN1-IP-Alloc-Method Alloc_Dhcp_Relay 5 VALUE SN1-IP-Header-Compression None 0 VALUE SN1-IP-Header-Compression VJ 1 VALUE SN1-IP-Header-Compression ROHC 2 VALUE SN1-IP-Header-Compression VJ_ROHC 3 VALUE SN1-IP-Hide-Service-Address Disabled 0 VALUE SN1-IP-Hide-Service-Address Enabled 1 VALUE SN1-IP-Source-Violate-No-Acct Disabled 0 VALUE SN1-IP-Source-Violate-No-Acct Enabled 1 VALUE SN1-IPv6-DNS-Proxy Disabled 0 VALUE SN1-IPv6-DNS-Proxy Enabled 1 VALUE SN1-IPv6-Egress-Filtering Disabled 0 VALUE SN1-IPv6-Egress-Filtering Enabled 1 VALUE SN1-L3-to-L2-Tun-Addr-Policy no-local-alloc-validate 0 VALUE SN1-L3-to-L2-Tun-Addr-Policy local-alloc 1 VALUE SN1-L3-to-L2-Tun-Addr-Policy local-alloc-validate 2 VALUE SN1-Long-Duration-Action Detection 1 VALUE SN1-Long-Duration-Action Disconnection 2 VALUE SN1-Long-Duration-Action Dormant-Only-Disconnection 3 VALUE SN1-Long-Duration-Action Dormant-Only-Detection 4 VALUE SN1-Long-Duration-Notification Suppress 0 VALUE SN1-Long-Duration-Notification Send 1 VALUE SN1-Mediation-Acct-Rsp-Action None 0 VALUE SN1-Mediation-Acct-Rsp-Action No_Early_PDUs 1 VALUE SN1-Mediation-Acct-Rsp-Action Delay_GTP_Response 2 VALUE SN1-Mediation-Enabled Disabled 0 VALUE SN1-Mediation-Enabled Enabled 1 VALUE SN1-Mediation-No-Interims Disabled 0 VALUE SN1-Mediation-No-Interims Enabled 1 VALUE SN1-MIP-AAA-Assign-Addr Disabled 0 VALUE SN1-MIP-AAA-Assign-Addr Enabled 1 VALUE SN1-MIP-Dual-Anchor Disabled 0 VALUE SN1-MIP-Dual-Anchor Enabled 1 VALUE SN1-MIP-Match-AAA-Assign-Addr Disabled 0 VALUE SN1-MIP-Match-AAA-Assign-Addr Enabled 1 VALUE SN1-MIP-Send-Ancid Disabled 0 VALUE SN1-MIP-Send-Ancid Enabled 1 VALUE SN1-MIP-Send-Correlation-Info Disabled 0 # In StarOS 8.3 and later, supported value 1 is NVSE_Starent, before 8.3 it is Enabled. VALUE SN1-MIP-Send-Correlation-Info EnabledOrNVSE_Starent 1 VALUE SN1-MIP-Send-Correlation-Info NVSE_CUstom1 2 VALUE SN1-MIP-Send-Correlation-Info NVSE_Custom2 3 VALUE SN1-MIP-Send-Imsi NoneOrDisabled 0 VALUE SN1-MIP-Send-Imsi Starent_NVSE 1 VALUE SN1-MIP-Send-Imsi NVSE_Custom1 2 VALUE SN1-MIP-Send-Imsi NVSE_Custom2 3 VALUE SN1-MIP-Send-Term-Verification Disabled 0 VALUE SN1-MIP-Send-Term-Verification EnabledOrNVSE_Custom1 1 VALUE SN1-MIP-Send-Term-Verification NVSE_Custom2 2 VALUE SN1-MIP-Send-Term-Verification NVSE_Starent 3 VALUE SN1-MN-HA-Hash-Algorithm MD5 1 VALUE SN1-MN-HA-Hash-Algorithm MD5_RFC2002 2 VALUE SN1-MN-HA-Hash-Algorithm HMAC_MD5 3 VALUE SN1-Mode Reliable 0 VALUE SN1-Mode Optimistic 1 VALUE SN1-Mode Unidirectional 2 VALUE SN1-NPU-Qos-Priority Best_Effort 0 VALUE SN1-NPU-Qos-Priority Bronze 1 VALUE SN1-NPU-Qos-Priority Silver 2 VALUE SN1-NPU-Qos-Priority Gold 3 VALUE SN1-NPU-Qos-Priority From_DSCP 4 VALUE SN1-Ntk-Session-Disconnect-Flag Session-Disconnect 1 VALUE SN1-PDIF-MIP-Release-TIA No 0 VALUE SN1-PDIF-MIP-Release-TIA Yes 1 VALUE SN1-PDIF-MIP-Required No 0 VALUE SN1-PDIF-MIP-Required Yes 1 VALUE SN1-PDIF-MIP-Simple-IP-Fallback No 0 VALUE SN1-PDIF-MIP-Simple-IP-Fallback Yes 1 VALUE SN1-PDSN1-Handoff-Req-IP-Addr Disabled 0 VALUE SN1-PDSN1-Handoff-Req-IP-Addr Enabled 1 VALUE SN1-Permit-User-Mcast-PDUs Disabled 0 VALUE SN1-Permit-User-Mcast-PDUs Enabled 1 VALUE SN1-PPP-Accept-Peer-v6Ifid Disabled 0 VALUE SN1-PPP-Accept-Peer-v6Ifid Enabled 1 VALUE SN1-PPP-Always-On-Vse Disabled 0 VALUE SN1-PPP-Always-On-Vse Enabled 1 VALUE SN1-PPP-NW-Layer-IPv4 Disabled 0 VALUE SN1-PPP-NW-Layer-IPv4 Enabled 1 VALUE SN1-PPP-NW-Layer-IPv4 Passive 2 VALUE SN1-PPP-NW-Layer-IPv6 Disabled 0 VALUE SN1-PPP-NW-Layer-IPv6 Enabled 1 VALUE SN1-PPP-NW-Layer-IPv6 Passive 2 VALUE SN1-PPP-Reneg-Disc Never 0 VALUE SN1-PPP-Reneg-Disc Always 1 VALUE SN1-PPP-Reneg-Disc NAI_Prefix_MSID_Mismatch 2 VALUE SN1-Prepaid no_prepaid 0 VALUE SN1-Prepaid custom_prepaid 1 VALUE SN1-Prepaid standard_prepaid 2 VALUE SN1-Prepaid wimax_prepaid 4 VALUE SN1-Prepaid-Compressed-Count Uncompressed 0 VALUE SN1-Prepaid-Compressed-Count Compressed 1 VALUE SN1-Prepaid-Final-Duration-Alg current_time 0 VALUE SN1-Prepaid-Final-Duration-Alg last-user-layer3-activity-time 1 VALUE SN1-Prepaid-Final-Duration-Alg last-airlink-activity-time 2 VALUE SN1-Prepaid-Final-Duration-Alg last-airlink-activity-time-last-reported 3 VALUE SN1-Prepaid-Preference prepaid_duration 0 VALUE SN1-Prepaid-Preference prepaid_volume 1 VALUE SN1-Proxy-MIP Disabled 0 VALUE SN1-Proxy-MIP Enabled 1 VALUE SN1-QoS-Class-Background-PHB Best-Effort 0 VALUE SN1-QoS-Class-Background-PHB Pass-Through 1 VALUE SN1-QoS-Class-Background-PHB AF11 10 VALUE SN1-QoS-Class-Background-PHB AF12 12 VALUE SN1-QoS-Class-Background-PHB AF13 14 VALUE SN1-QoS-Class-Background-PHB AF21 18 VALUE SN1-QoS-Class-Background-PHB AF22 20 VALUE SN1-QoS-Class-Background-PHB AF23 22 VALUE SN1-QoS-Class-Background-PHB AF31 26 VALUE SN1-QoS-Class-Background-PHB AF32 28 VALUE SN1-QoS-Class-Background-PHB AF33 30 VALUE SN1-QoS-Class-Background-PHB AF41 34 VALUE SN1-QoS-Class-Background-PHB AF42 36 VALUE SN1-QoS-Class-Background-PHB AF43 38 VALUE SN1-QoS-Class-Background-PHB EF 46 VALUE SN1-QoS-Class-Conversational-PHB Best-Effort 0 VALUE SN1-QoS-Class-Conversational-PHB Pass-Through 1 VALUE SN1-QoS-Class-Conversational-PHB AF11 10 VALUE SN1-QoS-Class-Conversational-PHB AF12 12 VALUE SN1-QoS-Class-Conversational-PHB AF13 14 VALUE SN1-QoS-Class-Conversational-PHB AF21 18 VALUE SN1-QoS-Class-Conversational-PHB AF22 20 VALUE SN1-QoS-Class-Conversational-PHB AF23 22 VALUE SN1-QoS-Class-Conversational-PHB AF31 26 VALUE SN1-QoS-Class-Conversational-PHB AF32 28 VALUE SN1-QoS-Class-Conversational-PHB AF33 30 VALUE SN1-QoS-Class-Conversational-PHB AF41 34 VALUE SN1-QoS-Class-Conversational-PHB AF42 36 VALUE SN1-QoS-Class-Conversational-PHB AF43 38 VALUE SN1-QoS-Class-Conversational-PHB EF 46 VALUE SN1-QoS-Class-Interactive-1-PHB Best-Effort 0 VALUE SN1-QoS-Class-Interactive-1-PHB Pass-Through 1 VALUE SN1-QoS-Class-Interactive-1-PHB AF11 10 VALUE SN1-QoS-Class-Interactive-1-PHB AF12 12 VALUE SN1-QoS-Class-Interactive-1-PHB AF13 14 VALUE SN1-QoS-Class-Interactive-1-PHB AF21 18 VALUE SN1-QoS-Class-Interactive-1-PHB AF22 20 VALUE SN1-QoS-Class-Interactive-1-PHB AF23 22 VALUE SN1-QoS-Class-Interactive-1-PHB AF31 26 VALUE SN1-QoS-Class-Interactive-1-PHB AF32 28 VALUE SN1-QoS-Class-Interactive-1-PHB AF33 30 VALUE SN1-QoS-Class-Interactive-1-PHB AF41 34 VALUE SN1-QoS-Class-Interactive-1-PHB AF42 36 VALUE SN1-QoS-Class-Interactive-1-PHB AF43 38 VALUE SN1-QoS-Class-Interactive-1-PHB EF 46 VALUE SN1-QoS-Class-Interactive-2-PHB Best-Effort 0 VALUE SN1-QoS-Class-Interactive-2-PHB Pass-Through 1 VALUE SN1-QoS-Class-Interactive-2-PHB AF11 10 VALUE SN1-QoS-Class-Interactive-2-PHB AF12 12 VALUE SN1-QoS-Class-Interactive-2-PHB AF13 14 VALUE SN1-QoS-Class-Interactive-2-PHB AF21 18 VALUE SN1-QoS-Class-Interactive-2-PHB AF22 20 VALUE SN1-QoS-Class-Interactive-2-PHB AF23 22 VALUE SN1-QoS-Class-Interactive-2-PHB AF31 26 VALUE SN1-QoS-Class-Interactive-2-PHB AF32 28 VALUE SN1-QoS-Class-Interactive-2-PHB AF33 30 VALUE SN1-QoS-Class-Interactive-2-PHB AF41 34 VALUE SN1-QoS-Class-Interactive-2-PHB AF42 36 VALUE SN1-QoS-Class-Interactive-2-PHB AF43 38 VALUE SN1-QoS-Class-Interactive-2-PHB EF 46 VALUE SN1-QoS-Class-Interactive-3-PHB Best-Effort 0 VALUE SN1-QoS-Class-Interactive-3-PHB Pass-Through 1 VALUE SN1-QoS-Class-Interactive-3-PHB AF11 10 VALUE SN1-QoS-Class-Interactive-3-PHB AF12 12 VALUE SN1-QoS-Class-Interactive-3-PHB AF13 14 VALUE SN1-QoS-Class-Interactive-3-PHB AF21 18 VALUE SN1-QoS-Class-Interactive-3-PHB AF22 20 VALUE SN1-QoS-Class-Interactive-3-PHB AF23 22 VALUE SN1-QoS-Class-Interactive-3-PHB AF31 26 VALUE SN1-QoS-Class-Interactive-3-PHB AF32 28 VALUE SN1-QoS-Class-Interactive-3-PHB AF33 30 VALUE SN1-QoS-Class-Interactive-3-PHB AF41 34 VALUE SN1-QoS-Class-Interactive-3-PHB AF42 36 VALUE SN1-QoS-Class-Interactive-3-PHB AF43 38 VALUE SN1-QoS-Class-Interactive-3-PHB EF 46 VALUE SN1-QoS-Class-Streaming-PHB Best-Effort 0 VALUE SN1-QoS-Class-Streaming-PHB Pass-Through 1 VALUE SN1-QoS-Class-Streaming-PHB AF11 10 VALUE SN1-QoS-Class-Streaming-PHB AF12 12 VALUE SN1-QoS-Class-Streaming-PHB AF13 14 VALUE SN1-QoS-Class-Streaming-PHB AF21 18 VALUE SN1-QoS-Class-Streaming-PHB AF22 20 VALUE SN1-QoS-Class-Streaming-PHB AF23 22 VALUE SN1-QoS-Class-Streaming-PHB AF31 26 VALUE SN1-QoS-Class-Streaming-PHB AF32 28 VALUE SN1-QoS-Class-Streaming-PHB AF33 30 VALUE SN1-QoS-Class-Streaming-PHB AF41 34 VALUE SN1-QoS-Class-Streaming-PHB AF42 36 VALUE SN1-QoS-Class-Streaming-PHB AF43 38 VALUE SN1-QoS-Class-Streaming-PHB EF 46 VALUE SN1-QoS-Tp-Dnlk Disabled 0 VALUE SN1-QoS-Tp-Dnlk Policing 1 VALUE SN1-QoS-Tp-Dnlk Shaping 2 VALUE SN1-QoS-Tp-Uplk Disabled 0 VALUE SN1-QoS-Tp-Uplk Policing 1 VALUE SN1-QoS-Tp-Uplk Shaping 2 VALUE SN1-Radius-Returned-Username No 0 VALUE SN1-Radius-Returned-Username Yes 1 VALUE SN1-Roaming-Sub-Use-GGSN Deny 0 VALUE SN1-Roaming-Sub-Use-GGSN Accept 1 VALUE SN1-Service-Type None 0 VALUE SN1-Service-Type PDSN 1 VALUE SN1-Service-Type Management 2 VALUE SN1-Service-Type HA 3 VALUE SN1-Service-Type GGSN 4 VALUE SN1-Service-Type LNS 5 VALUE SN1-Service-Type IPSG 6 VALUE SN1-Service-Type CSCF 7 VALUE SN1-Service-Type ASNGW 8 VALUE SN1-Service-Type PDIF 9 VALUE SN1-Service-Type STANDALONE_FA 10 VALUE SN1-Service-Type SGSN 11 VALUE SN1-Service-Type PHSGW 12 VALUE SN1-Service-Type PDG 13 VALUE SN1-Service-Type MIPV6HA 14 VALUE SN1-Service-Type PGW 15 VALUE SN1-Service-Type SGW 16 VALUE SN1-Service-Type FNG 17 VALUE SN1-Service-Type OGW 18 VALUE SN1-Service-Type HNBGW 19 VALUE SN1-Service-Type BNG 20 VALUE SN1-Subs-Acc-Flow-Traffic-Valid Disabled 0 VALUE SN1-Subs-Acc-Flow-Traffic-Valid Enabled 1 VALUE SN1-Subscriber-Accounting None 0 VALUE SN1-Subscriber-Accounting Radius 1 VALUE SN1-Subscriber-Accounting GTPP 2 VALUE SN1-Subscriber-Acct-Interim Normal 0 VALUE SN1-Subscriber-Acct-Interim Suppress 1 VALUE SN1-Subscriber-Acct-Mode flow-based-auxilliary 0 VALUE SN1-Subscriber-Acct-Mode flow-based-all 1 VALUE SN1-Subscriber-Acct-Mode flow-based-none 2 VALUE SN1-Subscriber-Acct-Mode session-based 3 VALUE SN1-Subscriber-Acct-Mode main-a10-only 4 VALUE SN1-Subscriber-Acct-Rsp-Action None 0 VALUE SN1-Subscriber-Acct-Rsp-Action No_Early_PDUs 1 VALUE SN1-Subscriber-Acct-Rsp-Action Delay_GTP_Response 2 VALUE SN1-Subscriber-Acct-Start Normal 0 VALUE SN1-Subscriber-Acct-Start Suppress 1 VALUE SN1-Subscriber-Acct-Stop Normal 0 VALUE SN1-Subscriber-Acct-Stop Suppress 1 VALUE SN1-Subscriber-Class Normal_Subscriber 0 VALUE SN1-Subscriber-Class Ting_100 1 VALUE SN1-Subscriber-Class Ting_500 2 VALUE SN1-Subscriber-Class Ting_Buddy 3 VALUE SN1-Subscriber-Class Ting_Star 4 VALUE SN1-Subscriber-Class Ting_Nolimit_SMS 5 VALUE SN1-Subscriber-Class Kids_Locator 6 VALUE SN1-Subscriber-Class Ting_2000 7 VALUE SN1-Subscriber-Class Handicapped_Welfare 8 VALUE SN1-Subscriber-Class Reserved 9 VALUE SN1-Subscriber-IP-Hdr-Neg-Mode Force 0 VALUE SN1-Subscriber-IP-Hdr-Neg-Mode Detect 1 VALUE SN1-Subscriber-IP-TOS-Copy None 0 VALUE SN1-Subscriber-IP-TOS-Copy Access-Tunnel 1 VALUE SN1-Subscriber-IP-TOS-Copy Data-Tunnel 2 VALUE SN1-Subscriber-IP-TOS-Copy Both 3 VALUE SN1-Subscriber-No-Interims Disabled 0 VALUE SN1-Subscriber-No-Interims Enabled 1 VALUE SN1-Subs-VJ-Slotid-Cmp-Neg-Mode None 0 VALUE SN1-Subs-VJ-Slotid-Cmp-Neg-Mode Receive 1 VALUE SN1-Subs-VJ-Slotid-Cmp-Neg-Mode Transmit 2 VALUE SN1-Subs-VJ-Slotid-Cmp-Neg-Mode Both 3 VALUE SN1-Tp-Dnlk-Exceed-Action Transmit 0 VALUE SN1-Tp-Dnlk-Exceed-Action Drop 1 VALUE SN1-Tp-Dnlk-Exceed-Action Lower-IP-Precedence 2 VALUE SN1-Tp-Dnlk-Exceed-Action Buffer 3 VALUE SN1-Tp-Dnlk-Exceed-Action Transmit-On-Buffer-Full 4 VALUE SN1-Tp-Dnlk-Violate-Action Transmit 0 VALUE SN1-Tp-Dnlk-Violate-Action Drop 1 VALUE SN1-Tp-Dnlk-Violate-Action Lower-IP-Precedence 2 VALUE SN1-Tp-Dnlk-Violate-Action Buffer 3 VALUE SN1-Tp-Dnlk-Violate-Action Transmit-On-Buffer-Full 4 VALUE SN1-Tp-Uplk-Exceed-Action Transmit 0 VALUE SN1-Tp-Uplk-Exceed-Action Drop 1 VALUE SN1-Tp-Uplk-Exceed-Action Lower-IP-Precedence 2 VALUE SN1-Tp-Uplk-Exceed-Action Buffer 3 VALUE SN1-Tp-Uplk-Exceed-Action Transmit-On-Buffer-Full 4 VALUE SN1-Tp-Uplk-Violate-Action Transmit 0 VALUE SN1-Tp-Uplk-Violate-Action Drop 1 VALUE SN1-Tp-Uplk-Violate-Action Lower-IP-Precedence 2 VALUE SN1-Tp-Uplk-Violate-Action Buffer 3 VALUE SN1-Tp-Uplk-Violate-Action Transmit-On-Buffer-Full 4 VALUE SN1-Tun-Addr-Policy no-local-alloc-validate 0 VALUE SN1-Tun-Addr-Policy local-alloc 1 VALUE SN1-Tun-Addr-Policy local-alloc-validate 2 VALUE SN1-Tunnel-Gn Disabled 0 VALUE SN1-Tunnel-Gn Enabled 1 VALUE SN1-Tunnel-Load-Balancing random 1 VALUE SN1-Tunnel-Load-Balancing balanced 2 VALUE SN1-Tunnel-Load-Balancing prioritized 3 VALUE SN1-Visiting-Sub-Use-GGSN Deny 0 VALUE SN1-Visiting-Sub-Use-GGSN Accept 1 END-VENDOR Starent freeradius-server/share/dictionary.symbol000066400000000000000000000024301257552170400212200ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2011 The FreeRADIUS Server project and contributors ############################################################################## # # Symbol VSAs # # $Id$ # ############################################################################## VENDOR Symbol 388 BEGIN-VENDOR Symbol ATTRIBUTE Symbol-Admin-Role 1 integer VALUE Symbol-Admin-Role Monitor 1 VALUE Symbol-Admin-Role Helpdesk 2 VALUE Symbol-Admin-Role NetworkAdmin 4 VALUE Symbol-Admin-Role SysAdmin 8 VALUE Symbol-Admin-Role WebAdmin 16 VALUE Symbol-Admin-Role SuperUser 32768 ATTRIBUTE Symbol-Current-ESSID 2 string ATTRIBUTE Symbol-Allowed-ESSID 3 string ATTRIBUTE Symbol-WLAN-Index 4 integer ATTRIBUTE Symbol-QoS-Profile 5 integer ATTRIBUTE Symbol-Allowed-Radio 6 string ATTRIBUTE Symbol-Expiry-Date-Time 7 string ATTRIBUTE Symbol-Start-Date-Time 8 string ATTRIBUTE Symbol-Posture-Status 9 string ATTRIBUTE Symbol-Downlink-Limit 10 string ATTRIBUTE Symbol-Uplink-Limit 11 string ATTRIBUTE Symbol-User-Group 12 string ATTRIBUTE Symbol-Login-Source 100 integer VALUE Symbol-Login-Source HTTP 16 VALUE Symbol-Login-Source SSH 32 VALUE Symbol-Login-Source Telnet 64 VALUE Symbol-Login-Source Console 128 VALUE Symbol-Login-Source All 240 END-VENDOR Symbol freeradius-server/share/dictionary.t_systems_nova000066400000000000000000000023031257552170400227670ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2011 The FreeRADIUS Server project and contributors ############################################################################## # # T-Systems-Nova # # $Id$ # ############################################################################## VENDOR T-Systems-Nova 16787 BEGIN-VENDOR T-Systems-Nova ATTRIBUTE T-Systems-Nova-Location-ID 1 string ATTRIBUTE T-Systems-Nova-Location-Name 2 string ATTRIBUTE T-Systems-Nova-Logoff-URL 3 string ATTRIBUTE T-Systems-Nova-Redirection-URL 4 string ATTRIBUTE T-Systems-Nova-Bandwidth-Min-Up 5 integer ATTRIBUTE T-Systems-Nova-Bandwidth-Min-Down 6 integer ATTRIBUTE T-Systems-Nova-Bandwidth-Max-Up 7 integer ATTRIBUTE T-Systems-Nova-Bandwidth-Max-Down 8 integer ATTRIBUTE T-Systems-Nova-Session-Terminate-Time 9 integer #ATTRIBUTE T-Systems-Nova-Session-Terminate-End-Of-Day 10 integer ATTRIBUTE T-Systems-Nova-Session-Terminate-EoD 10 integer ATTRIBUTE T-Systems-Nova-Billing-Class-Of-Service 11 string ATTRIBUTE T-Systems-Nova-Service-Name 12 string ATTRIBUTE T-Systems-Nova-Price-Of-Service 13 integer ATTRIBUTE T-Systems-Nova-Visiting-Provider-Code 14 string ATTRIBUTE T-Systems-Nova-UnknownAVP 15 string END-VENDOR T-Systems-Nova freeradius-server/share/dictionary.telebit000066400000000000000000000006701257552170400213470ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2011 The FreeRADIUS Server project and contributors # # Telebit dictionary # # Telebit was acquired by Cisco in 1996. # # $Id$ # VENDOR Telebit 117 BEGIN-VENDOR Telebit ATTRIBUTE Telebit-Login-Command 1 string ATTRIBUTE Telebit-Port-Name 2 string ATTRIBUTE Telebit-Activate-Command 3 string ATTRIBUTE Telebit-Accounting-Info 4 string ATTRIBUTE Telebit-Login-Option 5 string END-VENDOR Telebit freeradius-server/share/dictionary.telkom000066400000000000000000000017011257552170400212060ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2011 The FreeRADIUS Server project and contributors ############################################################################## # # Telkom SA - RADIUS dictionary # Used to convey Telkom Specific Information in proxied requests # EDS 20031007 eddie@saix.net # # $Id$ # ############################################################################## VENDOR Telkom 1431 BEGIN-VENDOR Telkom # Access-Type is used to describe the Access Medium used eg # Dial/ADSL/VSAT etc. Used in both Access-Requests and Accounting ATTRIBUTE Telkom-Access-Type 1 string # # Service-Type is used to indicate the Service used main in conjunction # with the SSG. Used in both Access-Requests and Accounting ATTRIBUTE Telkom-Service-Type 2 string # YFi Hotspot Manager trick to implement government regulation (South African) ATTRIBUTE Telkom-Degrade-Token 200 string END-VENDOR Telkom freeradius-server/share/dictionary.terena000066400000000000000000000004731257552170400211760ustar00rootroot00000000000000# -*- text -*- # # For TERENA VSA's # # The reference for these values is: # http://www.terena.org/activities/tf-emc2/oid.html # # $Id$ # VENDOR TERENA 25178 BEGIN-VENDOR TERENA ATTRIBUTE eduroam-SP-Country 10 string ATTRIBUTE eduroam-Monitoring-Inflate 11 string END-VENDOR TERENA freeradius-server/share/dictionary.trapeze000066400000000000000000000017261257552170400213740ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2011 The FreeRADIUS Server project and contributors # # dictionary.trapeze # # For use with FreeRadius and Trapeze/Juniper MSS software # 1.1 or greater. # # Trapeze Networks has been acquired by Juniper in 2010. # # $Id$ # # VENDOR Trapeze 14525 # Attributes for MSS 1.1 and later BEGIN-VENDOR Trapeze ATTRIBUTE Trapeze-VLAN-Name 1 string ATTRIBUTE Trapeze-Mobility-Profile 2 string ATTRIBUTE Trapeze-Encryption-Type 3 string ATTRIBUTE Trapeze-Time-Of-Day 4 string # New attributes for MSS 3.0 and later ATTRIBUTE Trapeze-SSID 5 string ATTRIBUTE Trapeze-End-Date 6 string ATTRIBUTE Trapeze-Start-Date 7 string ATTRIBUTE Trapeze-URL 8 string # Additional attributes, not known when added ATTRIBUTE Trapeze-User-Group-Name 9 string ATTRIBUTE Trapeze-QoS-Profile 10 string ATTRIBUTE Trapeze-Simultaneous-Logins 11 string ATTRIBUTE Trapeze-CoA-Username 12 string ATTRIBUTE Trapeze-Audit 13 string END-VENDOR Trapeze freeradius-server/share/dictionary.tropos000066400000000000000000000041121257552170400212400ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2011 The FreeRADIUS Server project and contributors ############################################################################## # # See support@tropos.com # # $Id$ # ############################################################################## VENDOR Tropos 14529 BEGIN-VENDOR Tropos ATTRIBUTE Tropos-Unicast-Cipher 1 integer ATTRIBUTE Tropos-Layer2-Input-Octets 2 integer ATTRIBUTE Tropos-Layer2-Output-Octets 3 integer ATTRIBUTE Tropos-Layer2-Input-Frames 4 integer ATTRIBUTE Tropos-Layer2-Output-Frames 5 integer ATTRIBUTE Tropos-Layer2-Input-Drops 6 integer ATTRIBUTE Tropos-Noise-Floor 7 ifid ATTRIBUTE Tropos-Noise-Upper-Bound 8 ifid ATTRIBUTE Tropos-Release 9 string ATTRIBUTE Tropos-Secondary-IP 11 octets ATTRIBUTE Tropos-Terminate-Cause 12 integer ATTRIBUTE Tropos-Average-RSSI 13 integer ATTRIBUTE Tropos-Channel 15 ifid ATTRIBUTE Tropos-Retries-Sent 16 integer ATTRIBUTE Tropos-Retry-Bits 17 integer ATTRIBUTE Tropos-Rates-Sent 18 octets ATTRIBUTE Tropos-Rates-Received 19 octets ATTRIBUTE Tropos-Routed-Time 21 integer ATTRIBUTE Tropos-Routless-Since 22 integer ATTRIBUTE Tropos-Capability-Info 23 octets ATTRIBUTE Tropos-Input-Cap 24 integer ATTRIBUTE Tropos-Output-Cap 25 integer ATTRIBUTE Tropos-Class-Mult 26 integer ATTRIBUTE Tropos-Cell-Name 27 string ATTRIBUTE Tropos-Cell-Location 28 string ATTRIBUTE Tropos-Serial-Number 29 string ATTRIBUTE Tropos-Latitude 30 string ATTRIBUTE Tropos-Longitude 31 string # These are commented out because FreeRadius does not have a way of # putting the numerical value into SQL. # #VALUE Tropos-Unicast-Cipher Legacy-Open 0 #VALUE Tropos-Unicast-Cipher Legacy-WEP 1 #VALUE Tropos-Unicast-Cipher WPA-TKIP 5304834 #VALUE Tropos-Unicast-Cipher WPA-AES-CCMP 5304836 #VALUE Tropos-Unicast-Cipher WPA2-TKIP 1027074 #VALUE Tropos-Unicast-Cipher WPA2-AES-CCMP 1027076 END-VENDOR Tropos freeradius-server/share/dictionary.ukerna000066400000000000000000000003331257552170400212000ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2011 The FreeRADIUS Server project and contributors # # GSS-EAP VSAs # # $Id$ # VENDOR UKERNA 25622 BEGIN-VENDOR UKERNA ATTRIBUTE SAML-AAA-Assertion 132 string END-VENDOR UKERNA freeradius-server/share/dictionary.unix000066400000000000000000000006321257552170400207000ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2011 The FreeRADIUS Server project and contributors # # Allegedly for ProFTPd. # # $Id$ # VENDOR Unix 4 BEGIN-VENDOR Unix ATTRIBUTE Unix-FTP-UID 10 integer ATTRIBUTE Unix-FTP-GID 11 integer ATTRIBUTE Unix-FTP-Home 12 string ATTRIBUTE Unix-FTP-Shell 13 string ATTRIBUTE Unix-FTP-Group-Names 14 string ATTRIBUTE Unix-FTP-Group-Ids 15 string END-VENDOR Unix freeradius-server/share/dictionary.usr000066400000000000000000002150301257552170400205260ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2011 The FreeRADIUS Server project and contributors # # dictionary.usr USR Robotics dictionary. # # Taken from the dictionary included with the USR RADIUS server, # and adjusted a bit. # # Version: $Id$ # # # USR Extensions: USR Vendor-Specific stuff. # # For now in NMC format (whatever that stands for), though the # normal vendor-specific format would work just as well. # # VENDOR USR 429 format=4,0 BEGIN-VENDOR USR ATTRIBUTE USR-Last-Number-Dialed-Out 0x0066 string ATTRIBUTE USR-Last-Number-Dialed-In-DNIS 0x00E8 string ATTRIBUTE USR-Last-Callers-Number-ANI 0x00E9 string ATTRIBUTE USR-Channel 0xBF38 integer ATTRIBUTE USR-Event-Id 0xBFBE integer ATTRIBUTE USR-Event-Date-Time 0xBF2F date ATTRIBUTE USR-Call-Start-Date-Time 0xBFF7 date ATTRIBUTE USR-Call-End-Date-Time 0xBFF6 date ATTRIBUTE USR-Default-DTE-Data-Rate 0x005E integer ATTRIBUTE USR-Initial-Rx-Link-Data-Rate 0xBF2D integer ATTRIBUTE USR-Final-Rx-Link-Data-Rate 0xBF2C integer ATTRIBUTE USR-Initial-Tx-Link-Data-Rate 0x006A integer ATTRIBUTE USR-Final-Tx-Link-Data-Rate 0x006B integer ATTRIBUTE USR-Chassis-Temperature 0xBF31 integer ATTRIBUTE USR-Chassis-Temp-Threshold 0xBE84 integer ATTRIBUTE USR-Actual-Voltage 0xBF32 integer ATTRIBUTE USR-Expected-Voltage 0xBF33 integer ATTRIBUTE USR-Power-Supply-Number 0xBF34 integer ATTRIBUTE USR-Card-Type 0xBE85 integer ATTRIBUTE USR-Chassis-Slot 0xBF39 integer ATTRIBUTE USR-Sync-Async-Mode 0x0067 integer ATTRIBUTE USR-Originate-Answer-Mode 0x0068 integer ATTRIBUTE USR-Modulation-Type 0x006C integer ATTRIBUTE USR-Connect-Term-Reason 0x009B integer ATTRIBUTE USR-Failure-to-Connect-Reason 0x0069 integer ATTRIBUTE USR-Equalization-Type 0x006F integer ATTRIBUTE USR-Fallback-Enabled 0x0070 integer ATTRIBUTE USR-Connect-Time-Limit 0xBFE7 integer ATTRIBUTE USR-Number-of-Rings-Limit 0xBFE6 integer ATTRIBUTE USR-DTE-Data-Idle-Timout 0x0048 integer ATTRIBUTE USR-Characters-Sent 0x0071 integer ATTRIBUTE USR-Characters-Received 0x0072 integer ATTRIBUTE USR-Blocks-Sent 0x0075 integer ATTRIBUTE USR-Blocks-Received 0x0076 integer ATTRIBUTE USR-Blocks-Resent 0x0077 integer ATTRIBUTE USR-Retrains-Requested 0x0078 integer ATTRIBUTE USR-Retrains-Granted 0x0079 integer ATTRIBUTE USR-Line-Reversals 0x007A integer ATTRIBUTE USR-Number-Of-Characters-Lost 0x007B integer ATTRIBUTE USR-Number-of-Blers 0x007D integer ATTRIBUTE USR-Number-of-Link-Timeouts 0x007E integer ATTRIBUTE USR-Number-of-Fallbacks 0x007F integer ATTRIBUTE USR-Number-of-Upshifts 0x0080 integer ATTRIBUTE USR-Number-of-Link-NAKs 0x0081 integer ATTRIBUTE USR-DTR-False-Timeout 0x00BE integer ATTRIBUTE USR-Fallback-Limit 0x00BF integer ATTRIBUTE USR-Block-Error-Count-Limit 0x00C0 integer ATTRIBUTE USR-DTR-True-Timeout 0x00DA integer ATTRIBUTE USR-Security-Login-Limit 0xBEDE integer ATTRIBUTE USR-Security-Resp-Limit 0xBEFA integer ATTRIBUTE USR-DTE-Ring-No-Answer-Limit 0xBF17 integer ATTRIBUTE USR-Back-Channel-Data-Rate 0x007C integer ATTRIBUTE USR-Simplified-MNP-Levels 0x0099 integer ATTRIBUTE USR-Simplified-V42bis-Usage 0x00C7 integer ATTRIBUTE USR-Mbi_Ct_PRI_Card_Slot 0x0184 integer ATTRIBUTE USR-Mbi_Ct_TDM_Time_Slot 0x0185 integer ATTRIBUTE USR-Mbi_Ct_PRI_Card_Span_Line 0x0186 integer ATTRIBUTE USR-Mbi_Ct_BChannel_Used 0x0187 integer ATTRIBUTE USR-Physical-State 0xBE77 integer ATTRIBUTE USR-Packet-Bus-Session 0xBF14 integer ATTRIBUTE USR-Server-Time 0xF000 date # 0xBE5D-0xBE63 sent with Event-Id 79 ATTRIBUTE USR-Channel-Connected-To 0xBE5D integer ATTRIBUTE USR-Slot-Connected-To 0xBE5E integer ATTRIBUTE USR-Device-Connected-To 0xBE5F integer ATTRIBUTE USR-NFAS-ID 0xBE60 integer ATTRIBUTE USR-Q931-Call-Reference-Value 0xBE61 integer ATTRIBUTE USR-Call-Event-Code 0xBE62 integer ATTRIBUTE USR-DS0 0xBE63 integer # DS0s sent with Event-Id 77,78 ATTRIBUTE USR-DS0s 0xBE64 string # Gateway-IP-Address sent with Event-Id 71,72 ATTRIBUTE USR-Gateway-IP-Address 0xBE66 ipaddr # # # ATTRIBUTE CW-Version-Id 0x8000 integer ATTRIBUTE CW-Account-Id 0x8001 string ATTRIBUTE CW-Acct-Type 0x8002 integer ATTRIBUTE CW-Acct-Identification-Code 0x8003 integer ATTRIBUTE CW-Service-Type 0x8004 integer ATTRIBUTE CW-Rate-Plan-Id 0x8005 integer ATTRIBUTE CW-Source-Identifier 0x8006 integer ATTRIBUTE CW-Session-Id 0x8007 string ATTRIBUTE CW-Num-Call-Attempt-Session 0x8008 integer ATTRIBUTE CW-Session-Sequence-Num 0x8009 integer ATTRIBUTE CW-Session-Sequence-End 0x800a integer ATTRIBUTE CW-Authentication-Fail-Cnt 0x800b integer ATTRIBUTE CW-Clg-Party-E164-Type 0x800c integer ATTRIBUTE CW-Clg-Party-E164-Number 0x800d string ATTRIBUTE CW-Clg-Party-Trans-Protocol 0x800e integer ATTRIBUTE CW-Clg-Party-Trans-Port 0x800f integer ATTRIBUTE CW-Clg-Party-Trans-IP 0x8010 ipaddr ATTRIBUTE CW-Clg-Party-Trans-DNS 0x8011 string ATTRIBUTE CW-Cld-Party-E164-Type 0x8012 integer ATTRIBUTE CW-Cld-Party-E164-Number 0x8013 string ATTRIBUTE CW-Cld-Party-Trans-Protocol 0x8014 integer ATTRIBUTE CW-Cld-Party-Trans-Port 0x8015 integer ATTRIBUTE CW-Cld-Party-Trans-IP 0x8016 ipaddr ATTRIBUTE CW-Cld-Party-Trans-DNS 0x8017 string ATTRIBUTE CW-Orig-Line-Identifier 0x8018 integer ATTRIBUTE CW-PSTN-Interface-Number 0x8019 integer ATTRIBUTE CW-Ingr-Gway-E164-Type 0x801a integer ATTRIBUTE CW-Ingr-Gway-E164-Number 0x801b string ATTRIBUTE CW-Ingr-Gway-Trans-Protocol 0x801c integer ATTRIBUTE CW-Ingr-Gway-Trans-Port 0x801d integer ATTRIBUTE CW-Ingr-Gway-Trans-IP 0x801e ipaddr ATTRIBUTE CW-Ingr-Gway-Trans-DNS 0x801f string ATTRIBUTE CW-Egr-Gway-Trans-Protocol 0x8020 integer ATTRIBUTE CW-Egr-Gway-Trans-Port 0x8021 integer ATTRIBUTE CW-Egr-Gway-Trans-IP 0x8022 ipaddr ATTRIBUTE CW-Egr-Gway-Trans-DNS 0x8023 string ATTRIBUTE CW-Ingr-Gtkpr-Trans-Protocol 0x8024 integer ATTRIBUTE CW-Ingr-Gtkpr-Trans-Port 0x8025 integer ATTRIBUTE CW-Ingr-Gtkpr-Trans-IP 0x8026 ipaddr ATTRIBUTE CW-Ingr-Gtkpr-Trans-DNS 0x8027 string ATTRIBUTE CW-Egr-Gtkpr-Trans-Protocol 0x8028 integer ATTRIBUTE CW-Egr-Gtkpr-Trans-Port 0x8029 integer ATTRIBUTE CW-Egr-Gtkpr-Trans-IP 0x802a ipaddr ATTRIBUTE CW-Egr-Gtkpr-Trans-DNS 0x802b string ATTRIBUTE CW-Call-Identifier 0x802c string ATTRIBUTE CW-Call-Type 0x802d integer ATTRIBUTE CW-Call-Start-Ingr-GW-Sec 0x802e string ATTRIBUTE CW-Call-Start-Ingr-GW-Msec 0x802f integer ATTRIBUTE CW-Call-Start-Time-Ans-Sec 0x8030 string ATTRIBUTE CW-Call-Start-Time-Ans-Msec 0x8031 integer ATTRIBUTE CW-Call-End-Time-Sec 0x8032 string ATTRIBUTE CW-Call-End-Time-Msec 0x8033 integer ATTRIBUTE CW-Call-Durn-Connect-Disc 0x8034 integer ATTRIBUTE CW-Codec-Type 0x8035 integer ATTRIBUTE CW-Call-Termination-Cause 0x8036 integer ATTRIBUTE CW-Audio-Packets-Sent 0x8037 integer ATTRIBUTE CW-Audio-Packets-Received 0x8038 integer ATTRIBUTE CW-Audio-Packets-Lost 0x8039 integer ATTRIBUTE CW-Audio-Packets-In-Frame 0x803a integer ATTRIBUTE CW-Audio-Bytes-In-Frame 0x803b integer ATTRIBUTE CW-Audio-Signal-In-Packet 0x803c integer ATTRIBUTE CW-Port-Id-For-Call 0x803d integer ATTRIBUTE CW-Slot-Id-For-Call 0x803e integer ATTRIBUTE CW-Acct-Balance-Start-Curr 0x803f integer ATTRIBUTE CW-Acct-Balance-Start-Amt 0x8040 integer ATTRIBUTE CW-Acct-Balance-Start-Dec 0x8041 integer ATTRIBUTE CW-Acct-Balance-Decr-Curr 0x8042 integer ATTRIBUTE CW-LRQ-Token 0x8043 string ATTRIBUTE CW-ARQ-Token 0x8044 string ATTRIBUTE CW-Token-Status 0x8045 integer ATTRIBUTE CW-SS7-Destn-Ptcode-Type 0x8046 integer ATTRIBUTE CW-SS7-Destn-Ptcode-Address 0x8047 integer ATTRIBUTE CW-SS7-Orig-Ptcode-Type 0x8048 integer ATTRIBUTE CW-SS7-Orig-Ptcode-Address 0x8049 integer ATTRIBUTE CW-SS7-CIC 0x804a integer ATTRIBUTE CW-MGC-Id 0x804b integer ATTRIBUTE CW-MG-Id 0x804c integer ATTRIBUTE CW-Signaling-Protocol 0x804d integer ATTRIBUTE CW-Protocol-Transport 0x804e integer ATTRIBUTE CW-Local-Sig-Trans-Protocol 0x804f integer ATTRIBUTE CW-Local-Sig-Trans-Port 0x8050 integer ATTRIBUTE CW-Local-Sig-Trans-IP 0x8051 ipaddr ATTRIBUTE CW-Local-Sig-Trans-DNS 0x8052 string ATTRIBUTE CW-Remote-Sig-Trans-Protocol 0x8053 integer ATTRIBUTE CW-Remote-Sig-Trans-Port 0x8054 integer ATTRIBUTE CW-Remote-Sig-Trans-IP 0x8055 ipaddr ATTRIBUTE CW-Remote-Sig-Trans-DNS 0x8056 string ATTRIBUTE CW-Local-MG-RTP-Protocol 0x8057 integer ATTRIBUTE CW-Local-MG-RTP-Port 0x8058 integer ATTRIBUTE CW-Local-MG-RTP-IP 0x8059 ipaddr ATTRIBUTE CW-Local-MG-RTP-DNS 0x805a string ATTRIBUTE CW-Remote-MG-RTP-Protocol 0x805b integer ATTRIBUTE CW-Remote-MG-RTP-Port 0x805c integer ATTRIBUTE CW-Remote-MG-RTP-IP 0x805d ipaddr ATTRIBUTE CW-Remote-MG-RTP-DNS 0x805e string ATTRIBUTE CW-Call-Model 0x805f integer ATTRIBUTE CW-Call-Plan-Id 0x8060 integer ATTRIBUTE CW-Trans-Cld-Party-E164-Type 0x8061 integer ATTRIBUTE CW-Trans-Cld-Party-E164-Num 0x8062 string ATTRIBUTE CW-OSP-Source-Device 0x8063 string # # These are CCA Radius attributes # ATTRIBUTE USR-PW_USR_IFilter_IP 0x9000 string ATTRIBUTE USR-PW_USR_IFilter_IPX 0x9001 string ATTRIBUTE USR-PW_USR_OFilter_IP 0x9003 string ATTRIBUTE USR-PW_USR_OFilter_IPX 0x9004 string ATTRIBUTE USR-PW_USR_OFilter_SAP 0x9005 string ATTRIBUTE USR-PW_VPN_ID 0x9006 string ATTRIBUTE USR-PW_VPN_Name 0x9007 string ATTRIBUTE USR-PW_VPN_Neighbor 0x9008 ipaddr ATTRIBUTE USR-PW_Framed_Routing_V2 0x9009 string ATTRIBUTE USR-PW_VPN_Gateway 0x900a string ATTRIBUTE USR-PW_Tunnel_Authentication 0x900b string ATTRIBUTE USR-PW_Index 0x900c string ATTRIBUTE USR-PW_Cutoff 0x900d string ATTRIBUTE USR-PW_Packet 0x900e string ATTRIBUTE USR-Primary_DNS_Server 0x900f ipaddr ATTRIBUTE USR-Secondary_DNS_Server 0x9010 ipaddr ATTRIBUTE USR-Primary_NBNS_Server 0x9011 ipaddr ATTRIBUTE USR-Secondary_NBNS_Server 0x9012 ipaddr ATTRIBUTE USR-Syslog-Tap 0x9013 integer ATTRIBUTE USR-Chassis-Call-Slot 0x9019 integer ATTRIBUTE USR-Chassis-Call-Span 0x901A integer ATTRIBUTE USR-Chassis-Call-Channel 0x901B integer ATTRIBUTE USR-Keypress-Timeout 0x901C integer ATTRIBUTE USR-Unauthenticated-Time 0x901D integer ATTRIBUTE USR-Connect-Speed 0x9023 integer ATTRIBUTE USR-Framed_IP_Address_Pool_Name 0x9024 string ATTRIBUTE USR-MP-EDO 0x9025 string # # Pilgrim attributes # ATTRIBUTE USR-Bearer-Capabilities 0x9800 integer ATTRIBUTE USR-Speed-Of-Connection 0x9801 integer ATTRIBUTE USR-Max-Channels 0x9802 integer ATTRIBUTE USR-Channel-Expansion 0x9803 integer ATTRIBUTE USR-Channel-Decrement 0x9804 integer ATTRIBUTE USR-Expansion-Algorithm 0x9805 integer ATTRIBUTE USR-Compression-Algorithm 0x9806 integer ATTRIBUTE USR-Receive-Acc-Map 0x9807 integer ATTRIBUTE USR-Transmit-Acc-Map 0x9808 integer ATTRIBUTE USR-Compression-Reset-Mode 0x980a integer ATTRIBUTE USR-Min-Compression-Size 0x980b integer ATTRIBUTE USR-IP 0x980c integer ATTRIBUTE USR-IPX 0x980d integer ATTRIBUTE USR-Filter-Zones 0x980e integer ATTRIBUTE USR-Appletalk 0x980f integer ATTRIBUTE USR-Bridging 0x9810 integer ATTRIBUTE USR-Spoofing 0x9811 integer ATTRIBUTE USR-Host-Type 0x9812 integer ATTRIBUTE USR-Send-Name 0x9813 string ATTRIBUTE USR-Send-Password 0x9814 string ATTRIBUTE USR-Start-Time 0x9815 integer ATTRIBUTE USR-End-Time 0x9816 integer ATTRIBUTE USR-Send-Script1 0x9817 string ATTRIBUTE USR-Reply-Script1 0x9818 string ATTRIBUTE USR-Send-Script2 0x9819 string ATTRIBUTE USR-Reply-Script2 0x981a string ATTRIBUTE USR-Send-Script3 0x981b string ATTRIBUTE USR-Reply-Script3 0x981c string ATTRIBUTE USR-Send-Script4 0x981d string ATTRIBUTE USR-Reply-Script4 0x981e string ATTRIBUTE USR-Send-Script5 0x981f string ATTRIBUTE USR-Reply-Script5 0x9820 string ATTRIBUTE USR-Send-Script6 0x9821 string ATTRIBUTE USR-Reply-Script6 0x9822 string ATTRIBUTE USR-Terminal-Type 0x9823 string ATTRIBUTE USR-Appletalk-Network-Range 0x9824 integer ATTRIBUTE USR-Local-IP-Address 0x9825 string ATTRIBUTE USR-Routing-Protocol 0x9826 integer ATTRIBUTE USR-Modem-Group 0x9827 integer ATTRIBUTE USR-Modem-Training-Time 0x9842 integer ATTRIBUTE USR-Interface-Index 0x9843 integer ATTRIBUTE USR-MP-MRRU 0x982f integer ATTRIBUTE USR-SAP-Filter-In 0x9002 string ATTRIBUTE USR-MIC 0x9014 string ATTRIBUTE USR-Log-Filter-Packets 0x9017 string ATTRIBUTE USR-VPN-Encrypter 0x901e integer ATTRIBUTE USR-Re-Chap-Timeout 0x9020 integer ATTRIBUTE USR-Tunnel-Switch-Endpoint 0x9868 string ATTRIBUTE USR-IP-SAA-Filter 0x9870 integer ATTRIBUTE Initial-Modulation-Type 0x0923 integer ATTRIBUTE USR-VTS-Session-Key 0x9856 string ATTRIBUTE USR-Orig-NAS-Type 0x9857 string ATTRIBUTE USR-Call-Arrival-Time 0x9858 integer ATTRIBUTE USR-Call-End-Time 0x9859 integer ATTRIBUTE USR-Tunnel-Auth-Hostname 0x986b string ATTRIBUTE USR-Acct-Reason-Code 0x986c integer ATTRIBUTE USR-Supports-Tags 0x9889 integer ATTRIBUTE USR-HARC-Disconnect-Code 0x988b integer ATTRIBUTE USR-RMMIE-Status 0x01cd integer ATTRIBUTE USR-RMMIE-Last-Update-Event 0x0901 integer ATTRIBUTE USR-RMMIE-x2-Status 0x0909 integer ATTRIBUTE USR-RMMIE-Planned-Disconnect 0x090a integer ATTRIBUTE USR-VPN-GW-Location-Id 0x901f string ATTRIBUTE USR-CCP-Algorithm 0x9021 integer ATTRIBUTE USR-ACCM-Type 0x9022 integer ATTRIBUTE USR-Local-Framed-IP-Addr 0x9026 ipaddr ATTRIBUTE USR-IPX-Routing 0x9828 integer ATTRIBUTE USR-IPX-WAN 0x9829 integer ATTRIBUTE USR-IP-RIP-Policies 0x982a integer ATTRIBUTE USR-IP-RIP-Simple-Auth-Password 0x982b string ATTRIBUTE USR-IP-RIP-Input-Filter 0x982c string ATTRIBUTE USR-IP-Call-Input-Filter 0x982d string ATTRIBUTE USR-IPX-RIP-Input-Filter 0x982e string ATTRIBUTE USR-IPX-Call-Input-Filter 0x9830 string ATTRIBUTE USR-AT-Input-Filter 0x9831 string ATTRIBUTE USR-AT-RTMP-Input-Filter 0x9832 string ATTRIBUTE USR-AT-Zip-Input-Filter 0x9833 string ATTRIBUTE USR-AT-Call-Input-Filter 0x9834 string ATTRIBUTE USR-ET-Bridge-Input-Filter 0x9835 string ATTRIBUTE USR-IP-RIP-Output-Filter 0x9836 string ATTRIBUTE USR-IP-Call-Output-Filter 0x9837 string ATTRIBUTE USR-IPX-RIP-Output-Filter 0x9838 string ATTRIBUTE USR-IPX-Call-Output-Filter 0x9839 string ATTRIBUTE USR-AT-Output-Filter 0x983a string ATTRIBUTE USR-AT-RTMP-Output-Filter 0x983b string ATTRIBUTE USR-AT-Zip-Output-Filter 0x983c string ATTRIBUTE USR-AT-Call-Output-Filter 0x983d string ATTRIBUTE USR-ET-Bridge-Output-Filter 0x983e string # This item name is too long for the server to parse; had to chop the r off. FIXME? ATTRIBUTE USR-ET-Bridge-Call-Output-Filte 0x983f string ATTRIBUTE USR-IP-Default-Route-Option 0x9840 integer ATTRIBUTE USR-MP-EDO-HIPER 0x9841 string ATTRIBUTE USR-Tunnel-Security 0x9844 integer ATTRIBUTE USR-Port-Tap 0x9845 integer ATTRIBUTE USR-Port-Tap-Format 0x9846 integer ATTRIBUTE USR-Port-Tap-Output 0x9847 integer ATTRIBUTE USR-Port-Tap-Facility 0x9848 integer ATTRIBUTE USR-Port-Tap-Priority 0x9849 integer ATTRIBUTE USR-Port-Tap-Address 0x984a ipaddr ATTRIBUTE USR-MobileIP-Home-Agent-Address 0x984b ipaddr ATTRIBUTE USR-Tunneled-MLPP 0x984c integer ATTRIBUTE USR-Multicast-Proxy 0x984d integer ATTRIBUTE USR-Multicast-Receive 0x984e integer ATTRIBUTE USR-Multicast-Forwarding 0x9850 integer ATTRIBUTE USR-IGMP-Query-Interval 0x9851 integer ATTRIBUTE USR-IGMP-Maximum-Response-Time 0x9852 integer ATTRIBUTE USR-IGMP-Robustness 0x9853 integer ATTRIBUTE USR-IGMP-Version 0x9854 integer ATTRIBUTE USR-Callback-Type 0x986a integer ATTRIBUTE USR-Request-Type 0xf001 integer ATTRIBUTE USR-RMMIE-Num-Of-Updates 0x01ce integer ATTRIBUTE USR-RMMIE-Manufacturer-ID 0x01df integer ATTRIBUTE USR-RMMIE-Product-Code 0x01e0 string ATTRIBUTE USR-RMMIE-Serial-Number 0x01e1 string ATTRIBUTE USR-RMMIE-Firmware-Version 0x01e2 string ATTRIBUTE USR-RMMIE-Firmware-Build-Date 0x01e3 string ATTRIBUTE USR-Call-Arrival-in-GMT 0xbe52 date ATTRIBUTE USR-Call-Connect-in-GMT 0xbe51 date ATTRIBUTE USR-Call-Terminate-in-GMT 0xbe50 date ATTRIBUTE USR-IDS0-Call-Type 0xbe4f integer ATTRIBUTE USR-Call-Reference-Number 0xbe7d integer ATTRIBUTE USR-CDMA-Call-Reference-Number 0x0183 integer ATTRIBUTE USR-Mobile-IP-Address 0x088e ipaddr ATTRIBUTE USR-QNC1-Service-Destination 0x08f4 ipaddr ATTRIBUTE USR-IWF-IP-Address 0x03f4 ipaddr ATTRIBUTE USR-Called-Party-Number 0x0890 string ATTRIBUTE USR-Calling-Party-Number 0x088f string ATTRIBUTE USR-Call-Type 0x0891 integer ATTRIBUTE USR-ESN 0x0892 string ATTRIBUTE USR-IWF-Call-Identifier 0x0893 integer ATTRIBUTE USR-IMSI 0x0894 string ATTRIBUTE USR-Service-Option 0x0895 integer ATTRIBUTE USR-Disconnect-Cause-Indicator 0x0896 integer ATTRIBUTE USR-Mobile-NumBytes-Txed 0x0897 integer ATTRIBUTE USR-Mobile-NumBytes-Rxed 0x0898 integer ATTRIBUTE USR-Num-Fax-Pages-Processed 0x0899 integer ATTRIBUTE USR-Compression-Type 0x089a integer ATTRIBUTE USR-Call-Error-Code 0x089b integer ATTRIBUTE USR-Modem-Setup-Time 0x089c integer ATTRIBUTE USR-Call-Connecting-Time 0x089d integer ATTRIBUTE USR-Connect-Time 0x089e integer ATTRIBUTE USR-RMMIE-Last-Update-Time 0x0900 integer ATTRIBUTE USR-RMMIE-Rcv-Tot-PwrLvl 0x0902 integer ATTRIBUTE USR-RMMIE-Rcv-PwrLvl-3300Hz 0x0903 integer ATTRIBUTE USR-RMMIE-Rcv-PwrLvl-3750Hz 0x0904 integer ATTRIBUTE USR-RMMIE-PwrLvl-NearEcho-Canc 0x0905 integer ATTRIBUTE USR-RMMIE-PwrLvl-FarEcho-Canc 0x0906 integer ATTRIBUTE USR-RMMIE-PwrLvl-Noise-Lvl 0x0907 integer ATTRIBUTE USR-RMMIE-PwrLvl-Xmit-Lvl 0x0908 integer ATTRIBUTE USR-Framed-IPX-Route 0x9027 ipaddr ATTRIBUTE USR-MPIP-Tunnel-Originator 0x9028 ipaddr ATTRIBUTE USR-IGMP-Routing 0x9855 integer ATTRIBUTE USR-Rad-Multicast-Routing-Ttl 0x9860 integer # again, too long for cistron to parse "rate-limit", "protocol" and "boundary" ATTRIBUTE USR-Rad-Multicast-Routing-RtLim 0x9861 integer ATTRIBUTE USR-Rad-Multicast-Routing-Proto 0x9862 integer ATTRIBUTE USR-Rad-Multicast-Routing-Bound 0x9863 string ATTRIBUTE USR-Rad-Dvmrp-Metric 0x9864 integer ATTRIBUTE USR-Chat-Script-Name 0x9865 string ATTRIBUTE USR-CUSR-hat-Script-Rules 0x9866 string ATTRIBUTE USR-Rad-Location-Type 0x9867 integer ATTRIBUTE USR-OSPF-Addressless-Index 0x9869 integer ATTRIBUTE USR-QoS-Queuing-Mehtod 0x986d integer ATTRIBUTE USR-PQ-Default-Priority 0x986e integer ATTRIBUTE USR-FQ-Default-Priority 0x9871 integer ATTRIBUTE USR-IPP-Enable 0x9872 integer ATTRIBUTE USR-Pre-Shared-MN-Key 0x9873 string ATTRIBUTE USR-MIP-NAI 0x9874 integer ATTRIBUTE USR-DNIS-ReAuthentication 0x9875 integer ATTRIBUTE USR-Agent 0x9876 integer ATTRIBUTE USR-PQ-Parameters 0x9877 integer ATTRIBUTE USR-Dvmrp-Prune-Lifetime 0x9878 integer ATTRIBUTE USR-Special-Xon-Xoff-Flow 0x9879 integer ATTRIBUTE USR-Dvmrp-Advertised-Metric 0x987a integer ATTRIBUTE USR-Dvmrp-Retransmit-Prunes 0x987b integer ATTRIBUTE USR-Dvmrp-Non-Pruners 0x987c integer ATTRIBUTE USR-Dvmrp-Route-Transit 0x987d integer ATTRIBUTE USR-Dvmrp-Input-Filter 0x987e string ATTRIBUTE USR-Dvmrp-Output-Filter 0x9880 string ATTRIBUTE USR-Policy-Access 0x9881 integer ATTRIBUTE USR-Policy-Configuration 0x9882 integer ATTRIBUTE USR-Policy-Filename 0x9883 string ATTRIBUTE USR-Policy-Type 0x9884 integer ATTRIBUTE USR-Mobile-Session-ID 0x9885 integer ATTRIBUTE USR-Mobile-Accounting-Type 0x9886 integer ATTRIBUTE USR-Mobile-Service-Option 0x9887 integer ATTRIBUTE USR-Wallclock-Timestamp 0x9888 integer ATTRIBUTE USR-Dvmrp-Initial-Flooding 0x988a integer ATTRIBUTE USR-Telnet-Options 0x988c integer ATTRIBUTE USR-CDMA-PktData-Network-ID 0x988d integer ATTRIBUTE USR-Auth-Next-Server-Address 0x988e ipaddr ATTRIBUTE USR-User-PPP-AODI-Type 0x988f integer ATTRIBUTE USR-MLPPP-Fragmentation-Threshld 0x9890 integer ATTRIBUTE USR-Unnumbered-Local-IP-Address 0x9891 ipaddr ATTRIBUTE USR-Traffic-Threshold 0x9892 integer ATTRIBUTE USR-Keep-Alive-Interval 0x9893 integer ATTRIBUTE USR-Tunnel-Challenge-Outgoing 0x9894 integer ATTRIBUTE USR-X25-Trunk-Profile 0x9895 string ATTRIBUTE USR-X25-Acct-Input-Segment-Count 0x9896 integer ATTRIBUTE USR-X25-Acct-Output-Segment-Coun 0x9897 integer ATTRIBUTE USR-X25-Acct-Segment-Size 0x9898 integer ATTRIBUTE USR-X25-Acct-Termination-Code 0x9899 integer ATTRIBUTE USR-X25-SVC-Logical-Channel-Numb 0x989a integer ATTRIBUTE USR-Nailed-B-Channel-Indicator 0x989b integer ATTRIBUTE USR-X25-SVC-Call-Attributes 0x989c integer ATTRIBUTE USR-Init-Reg-Server-Addr 0x989d ipaddr ATTRIBUTE USR-Re-Reg-Server-Addr 0x989e ipaddr ATTRIBUTE USR-Bytes-TX-Remain 0x989f integer ATTRIBUTE USR-Bytes-RX-Remain 0x98a0 integer ATTRIBUTE USR-Session-Time-Remain 0x98a1 integer ATTRIBUTE USR-Pre-Paid-Enabled 0x98a2 integer ATTRIBUTE USR-Reg-Server-Prov-Timeout 0x98a3 integer ATTRIBUTE USR-Redirect 0x98a4 integer ATTRIBUTE USR-VLAN-Tag 0x98a5 integer ATTRIBUTE USR-Rad-IP-Pool-Definition 0x98a6 string ATTRIBUTE USR-Rad-NMC-Call-Progress-Status 0x98a7 integer ATTRIBUTE USR-Rad-NMC-Blocks_RX 0x98a8 integer ATTRIBUTE USR-NAS-Type 0xf002 integer ATTRIBUTE USR-Auth-Mode 0xf003 integer # # Integer Translations # #VALUE USR-Character-Echo Echo-On 0 #VALUE USR-Character-Echo Echo-Off 1 #VALUE USR-PW_Framed_Routing_V2 Off 0 #VALUE USR-PW_Framed_Routing_V2 On 1 VALUE USR-Syslog-Tap Off 0 VALUE USR-Syslog-Tap On-Raw 1 VALUE USR-Syslog-Tap On-Framed 2 VALUE USR-Syslog-Tap Unknown 4294967295 # Event Indentifiers VALUE USR-Event-Id Module-Inserted 6 VALUE USR-Event-Id Module-Removed 7 VALUE USR-Event-Id PSU-Voltage-Alarm 8 VALUE USR-Event-Id PSU-Failed 9 VALUE USR-Event-Id HUB-Temp-Out-of-Range 10 VALUE USR-Event-Id Fan-Failed 11 VALUE USR-Event-Id Watchdog-Timeout 12 VALUE USR-Event-Id Mgmt-Bus-Failure 13 VALUE USR-Event-Id In-Connection-Est 14 VALUE USR-Event-Id Out-Connection-Est 15 VALUE USR-Event-Id In-Connection-Term 16 VALUE USR-Event-Id Out-Connection-Term 17 VALUE USR-Event-Id Connection-Failed 18 VALUE USR-Event-Id Connection-Timeout 19 VALUE USR-Event-Id DTE-Transmit-Idle 20 VALUE USR-Event-Id DTR-True 21 VALUE USR-Event-Id DTR-False 22 VALUE USR-Event-Id Block-Error-at-Threshold 23 VALUE USR-Event-Id Fallbacks-at-Threshold 24 VALUE USR-Event-Id No-Dial-Tone-Detected 25 VALUE USR-Event-Id No-Loop-Current-Detected 26 VALUE USR-Event-Id Yellow-Alarm 27 VALUE USR-Event-Id Red-Alarm 28 VALUE USR-Event-Id Loss-Of-Signal 29 VALUE USR-Event-Id Rcv-Alrm-Ind-Signal 30 VALUE USR-Event-Id Timing-Source-Switch 31 VALUE USR-Event-Id Modem-Reset-by-DTE 32 VALUE USR-Event-Id Modem-Ring-No-Answer 33 VALUE USR-Event-Id DTE-Ring-No-Answer 34 VALUE USR-Event-Id Pkt-Bus-Session-Active 35 VALUE USR-Event-Id Pkt-Bus-Session-Congestion 36 VALUE USR-Event-Id Pkt-Bus-Session-Lost 37 VALUE USR-Event-Id Pkt-Bus-Session-Inactive 38 VALUE USR-Event-Id User-Interface-Reset 39 VALUE USR-Event-Id Gateway-Port-Out-of-Service 40 VALUE USR-Event-Id Gateway-Port-Link-Active 41 VALUE USR-Event-Id Dial-Out-Login-Failure 42 VALUE USR-Event-Id Dial-In-Login-Failure 43 VALUE USR-Event-Id Dial-Out-Restricted-Number 44 VALUE USR-Event-Id Dial-Back-Restricted-Number 45 VALUE USR-Event-Id User-Blacklisted 46 VALUE USR-Event-Id Attempted-Login-Blacklisted 47 VALUE USR-Event-Id Response-Attempt-Limit-Exceeded 48 VALUE USR-Event-Id Login-Attempt-Limit-Exceeded 49 VALUE USR-Event-Id Dial-Out-Call-Duration 50 VALUE USR-Event-Id Dial-In-Call-Duration 51 VALUE USR-Event-Id Pkt-Bus-Session-Err-Status 52 VALUE USR-Event-Id NMC-AutoRespnse-Trap 53 VALUE USR-Event-Id Acct-Server-Contact-Loss 54 VALUE USR-Event-Id Yellow-Alarm-Clear 55 VALUE USR-Event-Id Red-Alarm-Clear 56 VALUE USR-Event-Id Loss-Of-Signal-Clear 57 VALUE USR-Event-Id Rcv-Alrm-Ind-Signal-Clear 58 VALUE USR-Event-Id Incoming-Connection-Established 59 VALUE USR-Event-Id Outgoing-Connection-Established 60 VALUE USR-Event-Id Incoming-Connection-Terminated 61 VALUE USR-Event-Id Outgoing-Connection-Terminated 62 VALUE USR-Event-Id Connection-Attempt-Failure 63 VALUE USR-Event-Id Continuous-CRC-Alarm 64 VALUE USR-Event-Id Continuous-CRC-Alarm-Clear 65 VALUE USR-Event-Id Physical-State-Change 66 VALUE USR-Event-Id Gateway-Network-Failed 71 VALUE USR-Event-Id Gateway-Network-Restored 72 VALUE USR-Event-Id Packet-Bus-Clock-Lost 73 VALUE USR-Event-Id Packet-Bus-Clock-Restored 74 VALUE USR-Event-Id D-Channel-In-Service 75 VALUE USR-Event-Id D-Channel-Out-of-Service 76 VALUE USR-Event-Id DS0s-In-Service 77 VALUE USR-Event-Id DS0s-Out-of-Service 78 VALUE USR-Event-Id T1/T1PRI/E1PRI-Call-Event 79 VALUE USR-Event-Id Psu-Incompatible 80 VALUE USR-Event-Id T1,T1-E1/PRI-Call-Arrive-Event 81 VALUE USR-Event-Id T1,T1-E1/PRI-Call-Connect-Event 82 VALUE USR-Event-Id T1,T1-E1/PRI-Call-Termina-Event 83 VALUE USR-Event-Id T1,T1-E1/PRI-Call-Failed-Event 84 VALUE USR-Event-Id DNS-Contact-Lost 85 VALUE USR-Event-Id NTP-Contact-Lost 86 VALUE USR-Event-Id NTP-Contact-Restored 87 VALUE USR-Event-Id IPGW-Link-Up 88 VALUE USR-Event-Id IPGW-Link-Down 89 VALUE USR-Event-Id NTP-Contact-Degraded 90 VALUE USR-Event-Id In-Connection-Failed 91 VALUE USR-Event-Id Out-Connection-Failed 92 VALUE USR-Event-Id Application-ProcessorReset 93 VALUE USR-Event-Id DSP-Reset 94 VALUE USR-Event-Id Changed-to-Maint-Srvs-State 95 VALUE USR-Event-Id Loop-Back-cleared-on-channel 96 VALUE USR-Event-Id Loop-Back-on-channel 97 VALUE USR-Event-Id Telco-Abnormal-Response 98 VALUE USR-Event-Id DNS-Contact-Restored 99 VALUE USR-Event-Id DNS-Contact-Degraded 100 VALUE USR-Event-Id RADIUS-Accounting-Restored 101 VALUE USR-Event-Id RADIUS-Accounting-Group-Restore 102 VALUE USR-Event-Id RADIUS-Accounting-Group-Degrade 103 VALUE USR-Event-Id RADIUS-Accounting-Group-NonOper 104 VALUE USR-Event-Id T1/T1-E1/PRI-InCall-Fail-Event 119 VALUE USR-Event-Id T1/T1-E1/PRI-OutCall-Fail-Event 120 VALUE USR-Event-Id RMMIE-Retrain-Event 121 VALUE USR-Event-Id RMMIE-Speed-Shift-Event 122 VALUE USR-Event-Id CDMA-Call-Start 191 VALUE USR-Event-Id CDMA-Call-End 192 VALUE USR-Card-Type SlotEmpty 1 VALUE USR-Card-Type SlotUnknown 2 VALUE USR-Card-Type NetwMgtCard 3 VALUE USR-Card-Type DualT1NAC 4 VALUE USR-Card-Type DualModemNAC 5 VALUE USR-Card-Type QuadModemNAC 6 VALUE USR-Card-Type TrGatewayNAC 7 VALUE USR-Card-Type X25GatewayNAC 8 VALUE USR-Card-Type DualV34ModemNAC 9 VALUE USR-Card-Type QuadV32DigitalModemNAC 10 VALUE USR-Card-Type QuadV32AnalogModemNAC 11 VALUE USR-Card-Type QuadV32DigAnlModemNAC 12 VALUE USR-Card-Type QuadV34DigModemNAC 13 VALUE USR-Card-Type QuadV34AnlModemNAC 14 VALUE USR-Card-Type QuadV34DigAnlModemNAC 15 VALUE USR-Card-Type SingleT1NAC 16 VALUE USR-Card-Type EthernetGatewayNAC 17 VALUE USR-Card-Type AccessServer 18 VALUE USR-Card-Type 486TrGatewayNAC 19 VALUE USR-Card-Type 486EthernetGatewayNAC 20 VALUE USR-Card-Type DualRS232NAC 22 VALUE USR-Card-Type 486X25GatewayNAC 23 VALUE USR-Card-Type ApplicationServerNAC 25 VALUE USR-Card-Type ISDNGatewayNAC 26 VALUE USR-Card-Type ISDNpriT1NAC 27 VALUE USR-Card-Type ClkedNetMgtCard 28 VALUE USR-Card-Type ModemPoolManagementNAC 29 VALUE USR-Card-Type ModemPoolNetserverNAC 30 VALUE USR-Card-Type ModemPoolV34ModemNAC 31 VALUE USR-Card-Type ModemPoolISDNNAC 32 VALUE USR-Card-Type NTServerNAC 33 VALUE USR-Card-Type QuadV34DigitalG2NAC 34 VALUE USR-Card-Type QuadV34AnalogG2NAC 35 VALUE USR-Card-Type QuadV34DigAnlgG2NAC 36 VALUE USR-Card-Type NETServerFrameRelayNAC 37 VALUE USR-Card-Type NETServerTokenRingNAC 38 VALUE USR-Card-Type X2524ChannelNAC 39 VALUE USR-Card-Type WirelessGatewayNac 42 VALUE USR-Card-Type EnhancedAccessServer 44 VALUE USR-Card-Type EnhancedISDNGatewayNAC 45 VALUE USR-Card-Type DualT1NIC 1001 VALUE USR-Card-Type DualAlogMdmNIC 1002 VALUE USR-Card-Type QuadDgtlMdmNIC 1003 VALUE USR-Card-Type QuadAlogDgtlMdmNIC 1004 VALUE USR-Card-Type TokenRingNIC 1005 VALUE USR-Card-Type SingleT1NIC 1006 VALUE USR-Card-Type EthernetNIC 1007 VALUE USR-Card-Type ShortHaulDualT1NIC 1008 VALUE USR-Card-Type DualAlogMgdIntlMdmNIC 1009 VALUE USR-Card-Type X25NIC 1010 VALUE USR-Card-Type QuadAlogNonMgdMdmNIC 1011 VALUE USR-Card-Type QuadAlogMgdIntlMdmNIC 1012 VALUE USR-Card-Type QuadAlogNonMgdIntlMdmNIC 1013 VALUE USR-Card-Type QuadLsdLiMgdMdmNIC 1014 VALUE USR-Card-Type QuadLsdLiNonMgdMdmNIC 1015 VALUE USR-Card-Type QuadLsdLiMgdIntlMdmNIC 1016 VALUE USR-Card-Type QuadLsdLiNonMgdIntlMdmNIC 1017 VALUE USR-Card-Type HSEthernetWithV35NIC 1018 VALUE USR-Card-Type HSEthernetWithoutV35NIC 1019 VALUE USR-Card-Type DualHighSpeedV35NIC 1020 VALUE USR-Card-Type QuadV35RS232LowSpeedNIC 1021 VALUE USR-Card-Type DualE1NIC 1022 VALUE USR-Card-Type ShortHaulDualE1NIC 1023 VALUE USR-Card-Type BellcoreLongHaulDualT1NIC 1025 VALUE USR-Card-Type BellcoreShrtHaulDualT1NIC 1026 VALUE USR-Card-Type SCSIEdgeServerNIC 1027 VALUE USR-Default-DTE-Data-Rate 110-BPS 1 VALUE USR-Default-DTE-Data-Rate 300-BPS 2 VALUE USR-Default-DTE-Data-Rate 600-BPS 3 VALUE USR-Default-DTE-Data-Rate 1200-BPS 4 VALUE USR-Default-DTE-Data-Rate 2400-BPS 5 VALUE USR-Default-DTE-Data-Rate 4800-BPS 6 VALUE USR-Default-DTE-Data-Rate 7200-BPS 7 VALUE USR-Default-DTE-Data-Rate 9600-BPS 8 VALUE USR-Default-DTE-Data-Rate 12K-BPS 9 VALUE USR-Default-DTE-Data-Rate 14.4K-BPS 10 VALUE USR-Default-DTE-Data-Rate 16.8-BPS 11 VALUE USR-Default-DTE-Data-Rate 19.2K-BPS 12 VALUE USR-Default-DTE-Data-Rate 38.4K-BPS 13 VALUE USR-Default-DTE-Data-Rate 75-BPS 14 VALUE USR-Default-DTE-Data-Rate 450-BPS 15 VALUE USR-Default-DTE-Data-Rate UNKNOWN-BPS 16 VALUE USR-Default-DTE-Data-Rate 57.6K-BPS 17 VALUE USR-Default-DTE-Data-Rate 21.6K-BPS 18 VALUE USR-Default-DTE-Data-Rate 24K-BPS 19 VALUE USR-Default-DTE-Data-Rate 26K-BPS 20 VALUE USR-Default-DTE-Data-Rate 28K-BPS 21 VALUE USR-Default-DTE-Data-Rate 115K-BPS 22 VALUE USR-Initial-Rx-Link-Data-Rate 110-BPS 1 VALUE USR-Initial-Rx-Link-Data-Rate 300-BPS 2 VALUE USR-Initial-Rx-Link-Data-Rate 600-BPS 3 VALUE USR-Initial-Rx-Link-Data-Rate 1200-BPS 4 VALUE USR-Initial-Rx-Link-Data-Rate 2400-BPS 5 VALUE USR-Initial-Rx-Link-Data-Rate 4800-BPS 6 VALUE USR-Initial-Rx-Link-Data-Rate 7200-BPS 7 VALUE USR-Initial-Rx-Link-Data-Rate 9600-BPS 8 VALUE USR-Initial-Rx-Link-Data-Rate 12000-BPS 9 VALUE USR-Initial-Rx-Link-Data-Rate 14400-BPS 10 VALUE USR-Initial-Rx-Link-Data-Rate 16800-BPS 11 VALUE USR-Initial-Rx-Link-Data-Rate 19200-BPS 12 VALUE USR-Initial-Rx-Link-Data-Rate 38400-BPS 13 VALUE USR-Initial-Rx-Link-Data-Rate 75-BPS 14 VALUE USR-Initial-Rx-Link-Data-Rate 450-BPS 15 VALUE USR-Initial-Rx-Link-Data-Rate UNKNOWN-BPS 16 VALUE USR-Initial-Rx-Link-Data-Rate 57600-BPS 17 VALUE USR-Initial-Rx-Link-Data-Rate 21600-BPS 18 VALUE USR-Initial-Rx-Link-Data-Rate 24000-BPS 19 VALUE USR-Initial-Rx-Link-Data-Rate 26400-BPS 20 VALUE USR-Initial-Rx-Link-Data-Rate 28800-BPS 21 VALUE USR-Initial-Rx-Link-Data-Rate 115200-BPS 22 VALUE USR-Initial-Rx-Link-Data-Rate 31200-BPS 23 VALUE USR-Initial-Rx-Link-Data-Rate 33600-BPS 24 VALUE USR-Initial-Rx-Link-Data-Rate 25333-BPS 25 VALUE USR-Initial-Rx-Link-Data-Rate 26666-BPS 26 VALUE USR-Initial-Rx-Link-Data-Rate 28000-BPS 27 VALUE USR-Initial-Rx-Link-Data-Rate 29333-BPS 28 VALUE USR-Initial-Rx-Link-Data-Rate 30666-BPS 29 VALUE USR-Initial-Rx-Link-Data-Rate 32000-BPS 30 VALUE USR-Initial-Rx-Link-Data-Rate 33333-BPS 31 VALUE USR-Initial-Rx-Link-Data-Rate 34666-BPS 32 VALUE USR-Initial-Rx-Link-Data-Rate 36000-BPS 33 VALUE USR-Initial-Rx-Link-Data-Rate 37333-BPS 34 VALUE USR-Initial-Rx-Link-Data-Rate 38666-BPS 35 VALUE USR-Initial-Rx-Link-Data-Rate 40000-BPS 36 VALUE USR-Initial-Rx-Link-Data-Rate 41333-BPS 37 VALUE USR-Initial-Rx-Link-Data-Rate 42666-BPS 38 VALUE USR-Initial-Rx-Link-Data-Rate 44000-BPS 39 VALUE USR-Initial-Rx-Link-Data-Rate 45333-BPS 40 VALUE USR-Initial-Rx-Link-Data-Rate 46666-BPS 41 VALUE USR-Initial-Rx-Link-Data-Rate 48000-BPS 42 VALUE USR-Initial-Rx-Link-Data-Rate 49333-BPS 43 VALUE USR-Initial-Rx-Link-Data-Rate 50666-BPS 44 VALUE USR-Initial-Rx-Link-Data-Rate 52000-BPS 45 VALUE USR-Initial-Rx-Link-Data-Rate 53333-BPS 46 VALUE USR-Initial-Rx-Link-Data-Rate 54666-BPS 47 VALUE USR-Initial-Rx-Link-Data-Rate 56000-BPS 48 VALUE USR-Initial-Rx-Link-Data-Rate 57333-BPS 49 VALUE USR-Initial-Rx-Link-Data-Rate 58666-BPS 50 VALUE USR-Initial-Rx-Link-Data-Rate 60000-BPS 51 VALUE USR-Initial-Rx-Link-Data-Rate 61333-BPS 52 VALUE USR-Initial-Rx-Link-Data-Rate 62666-BPS 53 VALUE USR-Initial-Rx-Link-Data-Rate 64000-BPS 54 VALUE USR-Final-Rx-Link-Data-Rate 110-BPS 1 VALUE USR-Final-Rx-Link-Data-Rate 300-BPS 2 VALUE USR-Final-Rx-Link-Data-Rate 600-BPS 3 VALUE USR-Final-Rx-Link-Data-Rate 1200-BPS 4 VALUE USR-Final-Rx-Link-Data-Rate 2400-BPS 5 VALUE USR-Final-Rx-Link-Data-Rate 4800-BPS 6 VALUE USR-Final-Rx-Link-Data-Rate 7200-BPS 7 VALUE USR-Final-Rx-Link-Data-Rate 9600-BPS 8 VALUE USR-Final-Rx-Link-Data-Rate 12000-BPS 9 VALUE USR-Final-Rx-Link-Data-Rate 14400-BPS 10 VALUE USR-Final-Rx-Link-Data-Rate 16800-BPS 11 VALUE USR-Final-Rx-Link-Data-Rate 19200-BPS 12 VALUE USR-Final-Rx-Link-Data-Rate 38400-BPS 13 VALUE USR-Final-Rx-Link-Data-Rate 75-BPS 14 VALUE USR-Final-Rx-Link-Data-Rate 450-BPS 15 VALUE USR-Final-Rx-Link-Data-Rate UNKNOWN-BPS 16 VALUE USR-Final-Rx-Link-Data-Rate 57600-BPS 17 VALUE USR-Final-Rx-Link-Data-Rate 21600-BPS 18 VALUE USR-Final-Rx-Link-Data-Rate 24000-BPS 19 VALUE USR-Final-Rx-Link-Data-Rate 26400-BPS 20 VALUE USR-Final-Rx-Link-Data-Rate 28800-BPS 21 VALUE USR-Final-Rx-Link-Data-Rate 115200-BPS 22 VALUE USR-Final-Rx-Link-Data-Rate 31200-BPS 23 VALUE USR-Final-Rx-Link-Data-Rate 33600-BPS 24 VALUE USR-Final-Rx-Link-Data-Rate 25333-BPS 25 VALUE USR-Final-Rx-Link-Data-Rate 26666-BPS 26 VALUE USR-Final-Rx-Link-Data-Rate 28000-BPS 27 VALUE USR-Final-Rx-Link-Data-Rate 29333-BPS 28 VALUE USR-Final-Rx-Link-Data-Rate 30666-BPS 29 VALUE USR-Final-Rx-Link-Data-Rate 32000-BPS 30 VALUE USR-Final-Rx-Link-Data-Rate 33333-BPS 31 VALUE USR-Final-Rx-Link-Data-Rate 34666-BPS 32 VALUE USR-Final-Rx-Link-Data-Rate 36000-BPS 33 VALUE USR-Final-Rx-Link-Data-Rate 37333-BPS 34 VALUE USR-Final-Rx-Link-Data-Rate 38666-BPS 35 VALUE USR-Final-Rx-Link-Data-Rate 40000-BPS 36 VALUE USR-Final-Rx-Link-Data-Rate 41333-BPS 37 VALUE USR-Final-Rx-Link-Data-Rate 42666-BPS 38 VALUE USR-Final-Rx-Link-Data-Rate 44000-BPS 39 VALUE USR-Final-Rx-Link-Data-Rate 45333-BPS 40 VALUE USR-Final-Rx-Link-Data-Rate 46666-BPS 41 VALUE USR-Final-Rx-Link-Data-Rate 48000-BPS 42 VALUE USR-Final-Rx-Link-Data-Rate 49333-BPS 43 VALUE USR-Final-Rx-Link-Data-Rate 50666-BPS 44 VALUE USR-Final-Rx-Link-Data-Rate 52000-BPS 45 VALUE USR-Final-Rx-Link-Data-Rate 53333-BPS 46 VALUE USR-Final-Rx-Link-Data-Rate 54666-BPS 47 VALUE USR-Final-Rx-Link-Data-Rate 56000-BPS 48 VALUE USR-Final-Rx-Link-Data-Rate 57333-BPS 49 VALUE USR-Final-Rx-Link-Data-Rate 58666-BPS 50 VALUE USR-Final-Rx-Link-Data-Rate 60000-BPS 51 VALUE USR-Final-Rx-Link-Data-Rate 61333-BPS 52 VALUE USR-Final-Rx-Link-Data-Rate 62666-BPS 53 VALUE USR-Final-Rx-Link-Data-Rate 64000-BPS 54 VALUE USR-Initial-Tx-Link-Data-Rate 110-BPS 1 VALUE USR-Initial-Tx-Link-Data-Rate 300-BPS 2 VALUE USR-Initial-Tx-Link-Data-Rate 600-BPS 3 VALUE USR-Initial-Tx-Link-Data-Rate 1200-BPS 4 VALUE USR-Initial-Tx-Link-Data-Rate 2400-BPS 5 VALUE USR-Initial-Tx-Link-Data-Rate 4800-BPS 6 VALUE USR-Initial-Tx-Link-Data-Rate 7200-BPS 7 VALUE USR-Initial-Tx-Link-Data-Rate 9600-BPS 8 VALUE USR-Initial-Tx-Link-Data-Rate 12000-BPS 9 VALUE USR-Initial-Tx-Link-Data-Rate 14400-BPS 10 VALUE USR-Initial-Tx-Link-Data-Rate 16800-BPS 11 VALUE USR-Initial-Tx-Link-Data-Rate 19200-BPS 12 VALUE USR-Initial-Tx-Link-Data-Rate 38400-BPS 13 VALUE USR-Initial-Tx-Link-Data-Rate 75-BPS 14 VALUE USR-Initial-Tx-Link-Data-Rate 450-BPS 15 VALUE USR-Initial-Tx-Link-Data-Rate UNKNOWN-BPS 16 VALUE USR-Initial-Tx-Link-Data-Rate 57600-BPS 17 VALUE USR-Initial-Tx-Link-Data-Rate 21600-BPS 18 VALUE USR-Initial-Tx-Link-Data-Rate 24000-BPS 19 VALUE USR-Initial-Tx-Link-Data-Rate 26400-BPS 20 VALUE USR-Initial-Tx-Link-Data-Rate 28800-BPS 21 VALUE USR-Initial-Tx-Link-Data-Rate 115200-BPS 22 VALUE USR-Initial-Tx-Link-Data-Rate 31200-BPS 23 VALUE USR-Initial-Tx-Link-Data-Rate 33600-BPS 24 VALUE USR-Initial-Tx-Link-Data-Rate 25333-BPS 25 VALUE USR-Initial-Tx-Link-Data-Rate 26666-BPS 26 VALUE USR-Initial-Tx-Link-Data-Rate 28000-BPS 27 VALUE USR-Initial-Tx-Link-Data-Rate 29333-BPS 28 VALUE USR-Initial-Tx-Link-Data-Rate 30666-BPS 29 VALUE USR-Initial-Tx-Link-Data-Rate 32000-BPS 30 VALUE USR-Initial-Tx-Link-Data-Rate 33333-BPS 31 VALUE USR-Initial-Tx-Link-Data-Rate 34666-BPS 32 VALUE USR-Initial-Tx-Link-Data-Rate 36000-BPS 33 VALUE USR-Initial-Tx-Link-Data-Rate 37333-BPS 34 VALUE USR-Initial-Tx-Link-Data-Rate 38666-BPS 35 VALUE USR-Initial-Tx-Link-Data-Rate 40000-BPS 36 VALUE USR-Initial-Tx-Link-Data-Rate 41333-BPS 37 VALUE USR-Initial-Tx-Link-Data-Rate 42666-BPS 38 VALUE USR-Initial-Tx-Link-Data-Rate 44000-BPS 39 VALUE USR-Initial-Tx-Link-Data-Rate 45333-BPS 40 VALUE USR-Initial-Tx-Link-Data-Rate 46666-BPS 41 VALUE USR-Initial-Tx-Link-Data-Rate 48000-BPS 42 VALUE USR-Initial-Tx-Link-Data-Rate 49333-BPS 43 VALUE USR-Initial-Tx-Link-Data-Rate 50666-BPS 44 VALUE USR-Initial-Tx-Link-Data-Rate 52000-BPS 45 VALUE USR-Initial-Tx-Link-Data-Rate 53333-BPS 46 VALUE USR-Initial-Tx-Link-Data-Rate 54666-BPS 47 VALUE USR-Initial-Tx-Link-Data-Rate 56000-BPS 48 VALUE USR-Initial-Tx-Link-Data-Rate 57333-BPS 49 VALUE USR-Initial-Tx-Link-Data-Rate 58666-BPS 50 VALUE USR-Initial-Tx-Link-Data-Rate 60000-BPS 51 VALUE USR-Initial-Tx-Link-Data-Rate 61333-BPS 52 VALUE USR-Initial-Tx-Link-Data-Rate 62666-BPS 53 VALUE USR-Initial-Tx-Link-Data-Rate 64000-BPS 54 VALUE USR-Final-Tx-Link-Data-Rate 110-BPS 1 VALUE USR-Final-Tx-Link-Data-Rate 300-BPS 2 VALUE USR-Final-Tx-Link-Data-Rate 600-BPS 3 VALUE USR-Final-Tx-Link-Data-Rate 1200-BPS 4 VALUE USR-Final-Tx-Link-Data-Rate 2400-BPS 5 VALUE USR-Final-Tx-Link-Data-Rate 4800-BPS 6 VALUE USR-Final-Tx-Link-Data-Rate 7200-BPS 7 VALUE USR-Final-Tx-Link-Data-Rate 9600-BPS 8 VALUE USR-Final-Tx-Link-Data-Rate 12000-BPS 9 VALUE USR-Final-Tx-Link-Data-Rate 14400-BPS 10 VALUE USR-Final-Tx-Link-Data-Rate 16800-BPS 11 VALUE USR-Final-Tx-Link-Data-Rate 19200-BPS 12 VALUE USR-Final-Tx-Link-Data-Rate 38400-BPS 13 VALUE USR-Final-Tx-Link-Data-Rate 75-BPS 14 VALUE USR-Final-Tx-Link-Data-Rate 450-BPS 15 VALUE USR-Final-Tx-Link-Data-Rate UNKNOWN-BPS 16 VALUE USR-Final-Tx-Link-Data-Rate 57600-BPS 17 VALUE USR-Final-Tx-Link-Data-Rate 21600-BPS 18 VALUE USR-Final-Tx-Link-Data-Rate 24000-BPS 19 VALUE USR-Final-Tx-Link-Data-Rate 26400-BPS 20 VALUE USR-Final-Tx-Link-Data-Rate 28800-BPS 21 VALUE USR-Final-Tx-Link-Data-Rate 115200-BPS 22 VALUE USR-Final-Tx-Link-Data-Rate 31200-BPS 23 VALUE USR-Final-Tx-Link-Data-Rate 33600-BPS 24 VALUE USR-Final-Tx-Link-Data-Rate 25333-BPS 25 VALUE USR-Final-Tx-Link-Data-Rate 26666-BPS 26 VALUE USR-Final-Tx-Link-Data-Rate 28000-BPS 27 VALUE USR-Final-Tx-Link-Data-Rate 29333-BPS 28 VALUE USR-Final-Tx-Link-Data-Rate 30666-BPS 29 VALUE USR-Final-Tx-Link-Data-Rate 32000-BPS 30 VALUE USR-Final-Tx-Link-Data-Rate 33333-BPS 31 VALUE USR-Final-Tx-Link-Data-Rate 34666-BPS 32 VALUE USR-Final-Tx-Link-Data-Rate 36000-BPS 33 VALUE USR-Final-Tx-Link-Data-Rate 37333-BPS 34 VALUE USR-Final-Tx-Link-Data-Rate 38666-BPS 35 VALUE USR-Final-Tx-Link-Data-Rate 40000-BPS 36 VALUE USR-Final-Tx-Link-Data-Rate 41333-BPS 37 VALUE USR-Final-Tx-Link-Data-Rate 42666-BPS 38 VALUE USR-Final-Tx-Link-Data-Rate 44000-BPS 39 VALUE USR-Final-Tx-Link-Data-Rate 45333-BPS 40 VALUE USR-Final-Tx-Link-Data-Rate 46666-BPS 41 VALUE USR-Final-Tx-Link-Data-Rate 48000-BPS 42 VALUE USR-Final-Tx-Link-Data-Rate 49333-BPS 43 VALUE USR-Final-Tx-Link-Data-Rate 50666-BPS 44 VALUE USR-Final-Tx-Link-Data-Rate 52000-BPS 45 VALUE USR-Final-Tx-Link-Data-Rate 53333-BPS 46 VALUE USR-Final-Tx-Link-Data-Rate 54666-BPS 47 VALUE USR-Final-Tx-Link-Data-Rate 56000-BPS 48 VALUE USR-Final-Tx-Link-Data-Rate 57333-BPS 49 VALUE USR-Final-Tx-Link-Data-Rate 58666-BPS 50 VALUE USR-Final-Tx-Link-Data-Rate 60000-BPS 51 VALUE USR-Final-Tx-Link-Data-Rate 61333-BPS 52 VALUE USR-Final-Tx-Link-Data-Rate 62666-BPS 53 VALUE USR-Final-Tx-Link-Data-Rate 64000-BPS 54 VALUE USR-Connect-Speed NONE 1 VALUE USR-Connect-Speed 300-BPS 2 VALUE USR-Connect-Speed 1200-BPS 3 VALUE USR-Connect-Speed 2400-BPS 4 VALUE USR-Connect-Speed 4800-BPS 5 VALUE USR-Connect-Speed 7200-BPS 6 VALUE USR-Connect-Speed 9600-BPS 7 VALUE USR-Connect-Speed 12000-BPS 8 VALUE USR-Connect-Speed 14400-BPS 9 VALUE USR-Connect-Speed 16800-BPS 10 VALUE USR-Connect-Speed 19200-BPS 11 VALUE USR-Connect-Speed 21600-BPS 12 VALUE USR-Connect-Speed 28800-BPS 13 VALUE USR-Connect-Speed 38400-BPS 14 VALUE USR-Connect-Speed 57600-BPS 15 VALUE USR-Connect-Speed 115200-BPS 16 VALUE USR-Connect-Speed 288000-BPS 17 VALUE USR-Connect-Speed 75-1200-BPS 18 VALUE USR-Connect-Speed 1200-75-BPS 19 VALUE USR-Connect-Speed 24000-BPS 20 VALUE USR-Connect-Speed 26400-BPS 21 VALUE USR-Connect-Speed 31200-BPS 22 VALUE USR-Connect-Speed 33600-BPS 23 VALUE USR-Connect-Speed 33333-BPS 24 VALUE USR-Connect-Speed 37333-BPS 25 VALUE USR-Connect-Speed 41333-BPS 26 VALUE USR-Connect-Speed 42666-BPS 27 VALUE USR-Connect-Speed 44000-BPS 28 VALUE USR-Connect-Speed 45333-BPS 29 VALUE USR-Connect-Speed 46666-BPS 30 VALUE USR-Connect-Speed 48000-BPS 31 VALUE USR-Connect-Speed 49333-BPS 32 VALUE USR-Connect-Speed 50666-BPS 33 VALUE USR-Connect-Speed 52000-BPS 34 VALUE USR-Connect-Speed 53333-BPS 35 VALUE USR-Connect-Speed 54666-BPS 36 VALUE USR-Connect-Speed 56000-BPS 37 VALUE USR-Connect-Speed 57333-BPS 38 VALUE USR-Connect-Speed 64000-BPS 39 VALUE USR-Connect-Speed 25333-BPS 40 VALUE USR-Connect-Speed 26666-BPS 41 VALUE USR-Connect-Speed 28000-BPS 42 VALUE USR-Connect-Speed 29333-BPS 43 VALUE USR-Connect-Speed 30666-BPS 44 VALUE USR-Connect-Speed 32000-BPS 45 VALUE USR-Connect-Speed 34666-BPS 46 VALUE USR-Connect-Speed 36000-BPS 47 VALUE USR-Connect-Speed 38666-BPS 48 VALUE USR-Connect-Speed 40000-BPS 49 VALUE USR-Connect-Speed 58666-BPS 50 VALUE USR-Connect-Speed 60000-BPS 51 VALUE USR-Connect-Speed 61333-BPS 52 VALUE USR-Connect-Speed 62666-BPS 53 VALUE USR-Sync-Async-Mode Asynchronous 1 VALUE USR-Sync-Async-Mode Synchronous 2 VALUE USR-Originate-Answer-Mode Originate_in_Originate_Mode 1 VALUE USR-Originate-Answer-Mode Originate_in_Answer_Mode 2 VALUE USR-Originate-Answer-Mode Answer_in_Originate_Mode 3 VALUE USR-Originate-Answer-Mode Answer_in_Answer_Mode 4 VALUE USR-Modulation-Type usRoboticsHST 1 VALUE USR-Modulation-Type ccittV32 2 VALUE USR-Modulation-Type ccittV22bis 3 VALUE USR-Modulation-Type bell103 4 VALUE USR-Modulation-Type ccittV21 5 VALUE USR-Modulation-Type bell212 6 VALUE USR-Modulation-Type ccittV32bis 7 VALUE USR-Modulation-Type ccittV23 8 VALUE USR-Modulation-Type negotiationFailed 9 VALUE USR-Modulation-Type bell208b 10 VALUE USR-Modulation-Type v21FaxClass1 11 VALUE USR-Modulation-Type v27FaxClass1 12 VALUE USR-Modulation-Type v29FaxClass1 13 VALUE USR-Modulation-Type v17FaxClass1 14 VALUE USR-Modulation-Type v21FaxClass2 15 VALUE USR-Modulation-Type v27FaxClass2 16 VALUE USR-Modulation-Type v29FaxClass2 17 VALUE USR-Modulation-Type v17FaxClass2 18 VALUE USR-Modulation-Type v32Terbo 19 VALUE USR-Modulation-Type v34 20 VALUE USR-Modulation-Type vFC 21 VALUE USR-Modulation-Type v34plus 22 VALUE USR-Modulation-Type x2 23 VALUE USR-Modulation-Type v110 24 VALUE USR-Modulation-Type v120 25 VALUE USR-Modulation-Type x75 26 VALUE USR-Modulation-Type asyncSyncPPP 27 VALUE USR-Modulation-Type clearChannel 28 VALUE USR-Modulation-Type x2client 29 VALUE USR-Modulation-Type x2symmetric 30 VALUE USR-Modulation-Type piafs 31 VALUE USR-Modulation-Type x2version2 32 VALUE USR-Modulation-Type v90Analog 33 VALUE USR-Modulation-Type v90Digital 34 VALUE USR-Modulation-Type v90AllDigital 35 VALUE Initial-Modulation-Type usRoboticsHST 1 VALUE Initial-Modulation-Type ccittV32 2 VALUE Initial-Modulation-Type ccittV22bis 3 VALUE Initial-Modulation-Type bell103 4 VALUE Initial-Modulation-Type ccittV21 5 VALUE Initial-Modulation-Type bell212 6 VALUE Initial-Modulation-Type ccittV32bis 7 VALUE Initial-Modulation-Type ccittV23 8 VALUE Initial-Modulation-Type negotiationFailed 9 VALUE Initial-Modulation-Type bell208b 10 VALUE Initial-Modulation-Type v21FaxClass1 11 VALUE Initial-Modulation-Type v27FaxClass1 12 VALUE Initial-Modulation-Type v29FaxClass1 13 VALUE Initial-Modulation-Type v17FaxClass1 14 VALUE Initial-Modulation-Type v21FaxClass2 15 VALUE Initial-Modulation-Type v27FaxClass2 16 VALUE Initial-Modulation-Type v29FaxClass2 17 VALUE Initial-Modulation-Type v17FaxClass2 18 VALUE Initial-Modulation-Type v32Terbo 19 VALUE Initial-Modulation-Type v34 20 VALUE Initial-Modulation-Type vFC 21 VALUE Initial-Modulation-Type v34plus 22 VALUE Initial-Modulation-Type x2 23 VALUE Initial-Modulation-Type v110 24 VALUE Initial-Modulation-Type v120 25 VALUE Initial-Modulation-Type x75 26 VALUE Initial-Modulation-Type asyncSyncPPP 27 VALUE Initial-Modulation-Type clearChannel 28 VALUE Initial-Modulation-Type x2client 29 VALUE Initial-Modulation-Type x2symmetric 30 VALUE Initial-Modulation-Type piafs 31 VALUE Initial-Modulation-Type x2version2 32 VALUE Initial-Modulation-Type v90Analogue 33 VALUE Initial-Modulation-Type v90Digital 34 VALUE Initial-Modulation-Type v90AllDigital 35 VALUE USR-Connect-Term-Reason dtrDrop 1 VALUE USR-Connect-Term-Reason escapeSequence 2 VALUE USR-Connect-Term-Reason athCommand 3 VALUE USR-Connect-Term-Reason carrierLoss 4 VALUE USR-Connect-Term-Reason inactivityTimout 5 VALUE USR-Connect-Term-Reason mnpIncompatible 6 VALUE USR-Connect-Term-Reason undefined 7 VALUE USR-Connect-Term-Reason remotePassword 8 VALUE USR-Connect-Term-Reason linkPassword 9 VALUE USR-Connect-Term-Reason retransmitLimit 10 VALUE USR-Connect-Term-Reason linkDisconnectMsgReceived 11 VALUE USR-Connect-Term-Reason noLoopCurrent 12 VALUE USR-Connect-Term-Reason invalidSpeed 13 VALUE USR-Connect-Term-Reason unableToRetrain 14 VALUE USR-Connect-Term-Reason managementCommand 15 VALUE USR-Connect-Term-Reason noDialTone 16 VALUE USR-Connect-Term-Reason keyAbort 17 VALUE USR-Connect-Term-Reason lineBusy 18 VALUE USR-Connect-Term-Reason noAnswer 19 VALUE USR-Connect-Term-Reason voice 20 VALUE USR-Connect-Term-Reason noAnswerTone 21 VALUE USR-Connect-Term-Reason noCarrier 22 VALUE USR-Connect-Term-Reason undetermined 23 VALUE USR-Connect-Term-Reason v42SabmeTimeout 24 VALUE USR-Connect-Term-Reason v42BreakTimeout 25 VALUE USR-Connect-Term-Reason v42DisconnectCmd 26 VALUE USR-Connect-Term-Reason v42IdExchangeFail 27 VALUE USR-Connect-Term-Reason v42BadSetup 28 VALUE USR-Connect-Term-Reason v42InvalidCodeWord 29 VALUE USR-Connect-Term-Reason v42StringToLong 30 VALUE USR-Connect-Term-Reason v42InvalidCommand 31 VALUE USR-Connect-Term-Reason none 32 VALUE USR-Connect-Term-Reason v32Cleardown 33 VALUE USR-Connect-Term-Reason dialSecurity 34 VALUE USR-Connect-Term-Reason remoteAccessDenied 35 VALUE USR-Connect-Term-Reason loopLoss 36 VALUE USR-Connect-Term-Reason ds0Teardown 37 VALUE USR-Connect-Term-Reason promptNotEnabled 38 VALUE USR-Connect-Term-Reason noPromptingInSync 39 VALUE USR-Connect-Term-Reason nonArqMode 40 VALUE USR-Connect-Term-Reason modeIncompatible 41 VALUE USR-Connect-Term-Reason noPromptInNonARQ 42 VALUE USR-Connect-Term-Reason dialBackLink 43 VALUE USR-Connect-Term-Reason linkAbort 44 VALUE USR-Connect-Term-Reason autopassFailed 45 VALUE USR-Connect-Term-Reason pbGenericError 46 VALUE USR-Connect-Term-Reason pbLinkErrTxPreAck 47 VALUE USR-Connect-Term-Reason pbLinkErrTxTardyACK 48 VALUE USR-Connect-Term-Reason pbTransmitBusTimeout 49 VALUE USR-Connect-Term-Reason pbReceiveBusTimeout 50 VALUE USR-Connect-Term-Reason pbLinkErrTxTAL 51 VALUE USR-Connect-Term-Reason pbLinkErrRxTAL 52 VALUE USR-Connect-Term-Reason pbTransmitMasterTimeout 53 VALUE USR-Connect-Term-Reason pbClockMissing 54 VALUE USR-Connect-Term-Reason pbReceivedLsWhileLinkUp 55 VALUE USR-Connect-Term-Reason pbOutOfSequenceFrame 56 VALUE USR-Connect-Term-Reason pbBadFrame 57 VALUE USR-Connect-Term-Reason pbAckWaitTimeout 58 VALUE USR-Connect-Term-Reason pbReceivedAckSeqErr 59 VALUE USR-Connect-Term-Reason pbReceiveOvrflwRNRFail 60 VALUE USR-Connect-Term-Reason pbReceiveMsgBufOvrflw 61 VALUE USR-Connect-Term-Reason rcvdGatewayDiscCmd 62 VALUE USR-Connect-Term-Reason tokenPassingTimeout 63 VALUE USR-Connect-Term-Reason dspInterruptTimeout 64 VALUE USR-Connect-Term-Reason mnpProtocolViolation 65 VALUE USR-Connect-Term-Reason class2FaxHangupCmd 66 VALUE USR-Connect-Term-Reason hstSpeedSwitchTimeout 67 VALUE USR-Connect-Term-Reason tooManyUnacked 68 VALUE USR-Connect-Term-Reason timerExpired 69 VALUE USR-Connect-Term-Reason t1Glare 70 VALUE USR-Connect-Term-Reason priDialoutRqTimeout 71 VALUE USR-Connect-Term-Reason abortAnlgDstOvrIsdn 72 VALUE USR-Connect-Term-Reason normalUserCallClear 73 VALUE USR-Connect-Term-Reason normalUnspecified 74 VALUE USR-Connect-Term-Reason bearerIncompatibility 75 VALUE USR-Connect-Term-Reason protocolErrorEvent 76 VALUE USR-Connect-Term-Reason abnormalDisconnect 77 VALUE USR-Connect-Term-Reason invalidCauseValue 78 VALUE USR-Connect-Term-Reason resourceUnavailable 79 VALUE USR-Connect-Term-Reason remoteHungUpDuringTraining 80 VALUE USR-Connect-Term-Reason trainingTimeout 81 VALUE USR-Connect-Term-Reason incomingModemNotAvailable 82 VALUE USR-Connect-Term-Reason incomingInvalidBearerCap 83 VALUE USR-Connect-Term-Reason incomingInvalidChannelID 84 VALUE USR-Connect-Term-Reason incomingInvalidProgInd 85 VALUE USR-Connect-Term-Reason incomingInvalidCallingPty 86 VALUE USR-Connect-Term-Reason incomingInvalidCalledPty 87 VALUE USR-Connect-Term-Reason incomingCallBlock 88 VALUE USR-Connect-Term-Reason incomingLoopStNoRingOff 89 VALUE USR-Connect-Term-Reason outgoingTelcoDisconnect 90 VALUE USR-Connect-Term-Reason outgoingEMWinkTimeout 91 VALUE USR-Connect-Term-Reason outgoingEMWinkTooShort 92 VALUE USR-Connect-Term-Reason outgoingNoChannelAvail 93 VALUE USR-Connect-Term-Reason dspReboot 94 VALUE USR-Connect-Term-Reason noDSPRespToKA 95 VALUE USR-Connect-Term-Reason noDSPRespToDisc 96 VALUE USR-Connect-Term-Reason dspTailPtrInvalid 97 VALUE USR-Connect-Term-Reason dspHeadPtrInvalid 98 VALUE USR-Failure-to-Connect-Reason dtrDrop 1 VALUE USR-Failure-to-Connect-Reason escapeSequence 2 VALUE USR-Failure-to-Connect-Reason athCommand 3 VALUE USR-Failure-to-Connect-Reason carrierLoss 4 VALUE USR-Failure-to-Connect-Reason inactivityTimout 5 VALUE USR-Failure-to-Connect-Reason mnpIncompatible 6 VALUE USR-Failure-to-Connect-Reason undefined 7 VALUE USR-Failure-to-Connect-Reason remotePassword 8 VALUE USR-Failure-to-Connect-Reason linkPassword 9 VALUE USR-Failure-to-Connect-Reason retransmitLimit 10 VALUE USR-Failure-to-Connect-Reason linkDisconnectMsgRec 11 VALUE USR-Failure-to-Connect-Reason noLoopCurrent 12 VALUE USR-Failure-to-Connect-Reason invalidSpeed 13 VALUE USR-Failure-to-Connect-Reason unableToRetrain 14 VALUE USR-Failure-to-Connect-Reason managementCommand 15 VALUE USR-Failure-to-Connect-Reason noDialTone 16 VALUE USR-Failure-to-Connect-Reason keyAbort 17 VALUE USR-Failure-to-Connect-Reason lineBusy 18 VALUE USR-Failure-to-Connect-Reason noAnswer 19 VALUE USR-Failure-to-Connect-Reason voice 20 VALUE USR-Failure-to-Connect-Reason noAnswerTone 21 VALUE USR-Failure-to-Connect-Reason noCarrier 22 VALUE USR-Failure-to-Connect-Reason undetermined 23 VALUE USR-Failure-to-Connect-Reason v42SabmeTimeout 24 VALUE USR-Failure-to-Connect-Reason v42BreakTimeout 25 VALUE USR-Failure-to-Connect-Reason v42DisconnectCmd 26 VALUE USR-Failure-to-Connect-Reason v42IdExchangeFail 27 VALUE USR-Failure-to-Connect-Reason v42BadSetup 28 VALUE USR-Failure-to-Connect-Reason v42InvalidCodeWord 29 VALUE USR-Failure-to-Connect-Reason v42StringToLong 30 VALUE USR-Failure-to-Connect-Reason v42InvalidCommand 31 VALUE USR-Failure-to-Connect-Reason none 32 VALUE USR-Failure-to-Connect-Reason v32Cleardown 33 VALUE USR-Failure-to-Connect-Reason dialSecurity 34 VALUE USR-Failure-to-Connect-Reason remoteAccessDenied 35 VALUE USR-Failure-to-Connect-Reason loopLoss 36 VALUE USR-Failure-to-Connect-Reason ds0Teardown 37 VALUE USR-Failure-to-Connect-Reason promptNotEnabled 38 VALUE USR-Failure-to-Connect-Reason noPromptingInSync 39 VALUE USR-Failure-to-Connect-Reason nonArqMode 40 VALUE USR-Failure-to-Connect-Reason modeIncompatible 41 VALUE USR-Failure-to-Connect-Reason noPromptInNonARQ 42 VALUE USR-Failure-to-Connect-Reason dialBackLink 43 VALUE USR-Failure-to-Connect-Reason linkAbort 44 VALUE USR-Failure-to-Connect-Reason autopassFailed 45 VALUE USR-Failure-to-Connect-Reason pbGenericError 46 VALUE USR-Failure-to-Connect-Reason pbLinkErrTxPreAck 47 VALUE USR-Failure-to-Connect-Reason pbLinkErrTxTardyACK 48 VALUE USR-Failure-to-Connect-Reason pbTransmitBusTimeout 49 VALUE USR-Failure-to-Connect-Reason pbReceiveBusTimeout 50 VALUE USR-Failure-to-Connect-Reason pbLinkErrTxTAL 51 VALUE USR-Failure-to-Connect-Reason pbLinkErrRxTAL 52 VALUE USR-Failure-to-Connect-Reason pbTransmitMasterTimeout 53 VALUE USR-Failure-to-Connect-Reason pbClockMissing 54 VALUE USR-Failure-to-Connect-Reason pbReceivedLsWhileLinkUp 55 VALUE USR-Failure-to-Connect-Reason pbOutOfSequenceFrame 56 VALUE USR-Failure-to-Connect-Reason pbBadFrame 57 VALUE USR-Failure-to-Connect-Reason pbAckWaitTimeout 58 VALUE USR-Failure-to-Connect-Reason pbReceivedAckSeqErr 59 VALUE USR-Failure-to-Connect-Reason pbReceiveOvrflwRNRFail 60 VALUE USR-Failure-to-Connect-Reason pbReceiveMsgBufOvrflw 61 VALUE USR-Failure-to-Connect-Reason rcvdGatewayDiscCmd 62 VALUE USR-Failure-to-Connect-Reason tokenPassingTimeout 63 VALUE USR-Failure-to-Connect-Reason dspInterruptTimeout 64 VALUE USR-Failure-to-Connect-Reason mnpProtocolViolation 65 VALUE USR-Failure-to-Connect-Reason class2FaxHangupCmd 66 VALUE USR-Failure-to-Connect-Reason hstSpeedSwitchTimeout 67 VALUE USR-Failure-to-Connect-Reason tooManyUnacked 68 VALUE USR-Failure-to-Connect-Reason timerExpired 69 VALUE USR-Failure-to-Connect-Reason t1Glare 70 VALUE USR-Failure-to-Connect-Reason priDialoutRqTimeout 71 VALUE USR-Failure-to-Connect-Reason abortAnlgDstOvrIsdn 72 VALUE USR-Failure-to-Connect-Reason normalUserCallClear 73 VALUE USR-Failure-to-Connect-Reason normalUnspecified 74 VALUE USR-Failure-to-Connect-Reason bearerIncompatibility 75 VALUE USR-Failure-to-Connect-Reason protocolErrorEvent 76 VALUE USR-Failure-to-Connect-Reason abnormalDisconnect 77 VALUE USR-Failure-to-Connect-Reason invalidCauseValue 78 VALUE USR-Failure-to-Connect-Reason resourceUnavailable 79 VALUE USR-Failure-to-Connect-Reason remoteHungUpDuringTraining 80 VALUE USR-Failure-to-Connect-Reason trainingTimeout 81 VALUE USR-Failure-to-Connect-Reason incomingModemNotAvailable 82 VALUE USR-Failure-to-Connect-Reason incomingInvalidBearerCap 83 VALUE USR-Failure-to-Connect-Reason incomingInvalidChannelID 84 VALUE USR-Failure-to-Connect-Reason incomingInvalidProgInd 85 VALUE USR-Failure-to-Connect-Reason incomingInvalidCallingPty 86 VALUE USR-Failure-to-Connect-Reason incomingInvalidCalledPty 87 VALUE USR-Failure-to-Connect-Reason incomingCallBlock 88 VALUE USR-Failure-to-Connect-Reason incomingLoopStNoRingOff 89 VALUE USR-Failure-to-Connect-Reason outgoingTelcoDisconnect 90 VALUE USR-Failure-to-Connect-Reason outgoingEMWinkTimeout 91 VALUE USR-Failure-to-Connect-Reason outgoingEMWinkTooShort 92 VALUE USR-Failure-to-Connect-Reason outgoingNoChannelAvail 93 VALUE USR-Failure-to-Connect-Reason dspReboot 94 VALUE USR-Failure-to-Connect-Reason noDSPRespToKA 95 VALUE USR-Failure-to-Connect-Reason noDSPRespToDisc 96 VALUE USR-Failure-to-Connect-Reason dspTailPtrInvalid 97 VALUE USR-Failure-to-Connect-Reason dspHeadPtrInvalid 98 VALUE USR-Simplified-MNP-Levels none 1 VALUE USR-Simplified-MNP-Levels mnpLevel3 2 VALUE USR-Simplified-MNP-Levels mnpLevel4 3 VALUE USR-Simplified-MNP-Levels ccittV42 4 VALUE USR-Simplified-MNP-Levels usRoboticsHST 5 VALUE USR-Simplified-MNP-Levels synchronousNone 6 VALUE USR-Simplified-MNP-Levels mnpLevel2 7 VALUE USR-Simplified-MNP-Levels mnp10 8 VALUE USR-Simplified-MNP-Levels v42Etc 9 VALUE USR-Simplified-MNP-Levels mnp10Etc 10 VALUE USR-Simplified-MNP-Levels lapmEtc 11 VALUE USR-Simplified-MNP-Levels v42Etc2 12 VALUE USR-Simplified-MNP-Levels v42SRej 13 VALUE USR-Simplified-MNP-Levels piafs 14 VALUE USR-Simplified-V42bis-Usage none 1 VALUE USR-Simplified-V42bis-Usage ccittV42bis 2 VALUE USR-Simplified-V42bis-Usage mnpLevel5 3 VALUE USR-Equalization-Type Long 1 VALUE USR-Equalization-Type Short 2 VALUE USR-Fallback-Enabled Disabled 1 VALUE USR-Fallback-Enabled Enabled 2 VALUE USR-Back-Channel-Data-Rate 450BPS 1 VALUE USR-Back-Channel-Data-Rate 300BPS 2 VALUE USR-Back-Channel-Data-Rate None 3 VALUE USR-Device-Connected-To None 1 VALUE USR-Device-Connected-To isdnGateway 2 VALUE USR-Device-Connected-To quadModem 3 VALUE USR-Call-Event-Code notSupported 1 VALUE USR-Call-Event-Code setup 2 VALUE USR-Call-Event-Code usrSetup 3 VALUE USR-Call-Event-Code telcoDisconnect 4 VALUE USR-Call-Event-Code usrDisconnect 5 VALUE USR-Call-Event-Code noFreeModem 6 VALUE USR-Call-Event-Code modemsNotAllowed 7 VALUE USR-Call-Event-Code modemsRejectCall 8 VALUE USR-Call-Event-Code modemSetupTimeout 9 VALUE USR-Call-Event-Code noFreeIGW 10 VALUE USR-Call-Event-Code igwRejectCall 11 VALUE USR-Call-Event-Code igwSetupTimeout 12 VALUE USR-Call-Event-Code noFreeTdmts 13 VALUE USR-Call-Event-Code bcReject 14 VALUE USR-Call-Event-Code ieReject 15 VALUE USR-Call-Event-Code chidReject 16 VALUE USR-Call-Event-Code progReject 17 VALUE USR-Call-Event-Code callingPartyReject 18 VALUE USR-Call-Event-Code calledPartyReject 19 VALUE USR-Call-Event-Code blocked 20 VALUE USR-Call-Event-Code analogBlocked 21 VALUE USR-Call-Event-Code digitalBlocked 22 VALUE USR-Call-Event-Code outOfService 23 VALUE USR-Call-Event-Code busy 24 VALUE USR-Call-Event-Code congestion 25 VALUE USR-Call-Event-Code protocolError 26 VALUE USR-Call-Event-Code noFreeBchannel 27 VALUE USR-Call-Event-Code inOutCallCollision 28 VALUE USR-Call-Event-Code inCallArrival 29 VALUE USR-Call-Event-Code outCallArrival 30 VALUE USR-Call-Event-Code inCallConnect 31 VALUE USR-Call-Event-Code outCallConnect 32 VALUE USR-HARC-Disconnect-Code No-Error 0 VALUE USR-HARC-Disconnect-Code No-Carrier 1 VALUE USR-HARC-Disconnect-Code No-DSR 2 VALUE USR-HARC-Disconnect-Code Timeout 3 VALUE USR-HARC-Disconnect-Code Reset 4 VALUE USR-HARC-Disconnect-Code Call-Drop-Req 5 VALUE USR-HARC-Disconnect-Code Idle-Timeout 6 VALUE USR-HARC-Disconnect-Code Session-Timeout 7 VALUE USR-HARC-Disconnect-Code User-Req-Drop 8 VALUE USR-HARC-Disconnect-Code Host-Req-Drop 9 VALUE USR-HARC-Disconnect-Code Service-Interruption 10 VALUE USR-HARC-Disconnect-Code Service-Unavailable 11 VALUE USR-HARC-Disconnect-Code User-Input-Error 12 VALUE USR-HARC-Disconnect-Code NAS-Drop-For-Callback 13 VALUE USR-HARC-Disconnect-Code NAS-Drop-Misc-Non-Error 14 VALUE USR-HARC-Disconnect-Code NAS-Internal-Error 15 VALUE USR-HARC-Disconnect-Code Line-Busy 16 VALUE USR-HARC-Disconnect-Code Tunnel-Term-Unreach 19 VALUE USR-HARC-Disconnect-Code Tunnel-Refused 20 VALUE USR-HARC-Disconnect-Code Tunnel-Auth-Failed 21 VALUE USR-HARC-Disconnect-Code Tunnel-Session-Timeout 22 VALUE USR-HARC-Disconnect-Code Tunnel-Timeout 23 VALUE USR-HARC-Disconnect-Code Radius-Res-Reclaim 25 VALUE USR-HARC-Disconnect-Code DNIS-Auth-Failed 26 VALUE USR-HARC-Disconnect-Code PAP-Auth-Failure 27 VALUE USR-HARC-Disconnect-Code CHAP-Auth-Failure 28 VALUE USR-HARC-Disconnect-Code PPP-LCP-Failed 29 VALUE USR-HARC-Disconnect-Code PPP-NCP-Failed 30 VALUE USR-HARC-Disconnect-Code Radius-Timeout 31 VALUE USR-CCP-Algorithm NONE 1 VALUE USR-CCP-Algorithm Stac 2 VALUE USR-CCP-Algorithm MS 3 VALUE USR-CCP-Algorithm Any 4 VALUE USR-Tunnel-Security None 0 VALUE USR-Tunnel-Security Control-Only 1 VALUE USR-Tunnel-Security Data-Only 2 VALUE USR-Tunnel-Security Both-Data-and-Control 3 VALUE USR-RMMIE-Status notEnabledInLocalModem 1 VALUE USR-RMMIE-Status notDetectedInRemoteModem 2 VALUE USR-RMMIE-Status ok 3 VALUE USR-RMMIE-x2-Status notOperational 1 VALUE USR-RMMIE-x2-Status operational 2 VALUE USR-RMMIE-x2-Status x2Disabled 3 VALUE USR-RMMIE-x2-Status v8Disabled 4 VALUE USR-RMMIE-x2-Status remote3200Disabled 5 VALUE USR-RMMIE-x2-Status invalidSpeedSetting 6 VALUE USR-RMMIE-x2-Status v8NotDetected 7 VALUE USR-RMMIE-x2-Status x2NotDetected 8 VALUE USR-RMMIE-x2-Status incompatibleVersion 9 VALUE USR-RMMIE-x2-Status incompatibleModes 10 VALUE USR-RMMIE-x2-Status local3200Disabled 11 VALUE USR-RMMIE-x2-Status excessHighFrequencyAtten 12 VALUE USR-RMMIE-x2-Status connectNotSupport3200 13 VALUE USR-RMMIE-x2-Status retrainBeforeConnection 14 VALUE USR-RMMIE-Planned-Disconnect none 1 VALUE USR-RMMIE-Planned-Disconnect dteNotReady 2 VALUE USR-RMMIE-Planned-Disconnect dteInterfaceError 3 VALUE USR-RMMIE-Planned-Disconnect dteRequest 4 VALUE USR-RMMIE-Planned-Disconnect escapeToOnlineCommandMode 5 VALUE USR-RMMIE-Planned-Disconnect athCommand 6 VALUE USR-RMMIE-Planned-Disconnect inactivityTimeout 7 VALUE USR-RMMIE-Planned-Disconnect arqProtocolError 8 VALUE USR-RMMIE-Planned-Disconnect arqProtocolRetransmitLim 9 VALUE USR-RMMIE-Planned-Disconnect invalidComprDataCodeword 10 VALUE USR-RMMIE-Planned-Disconnect invalidComprDataStringLen 11 VALUE USR-RMMIE-Planned-Disconnect invalidComprDataCommand 12 VALUE USR-RMMIE-Last-Update-Event none 1 VALUE USR-RMMIE-Last-Update-Event initialConnection 2 VALUE USR-RMMIE-Last-Update-Event retrain 3 VALUE USR-RMMIE-Last-Update-Event speedShift 4 VALUE USR-RMMIE-Last-Update-Event plannedDisconnect 5 VALUE USR-Request-Type Access-Request 1 VALUE USR-Request-Type Access-Accept 2 VALUE USR-Request-Type Access-Reject 3 VALUE USR-Request-Type Accounting-Request 4 VALUE USR-Request-Type Accounting-Response 5 # The next three non standard packet types are used by # US Robotics Security/Accounting Server VALUE USR-Request-Type Access-Password-Change 7 VALUE USR-Request-Type Access-Password-Ack 8 VALUE USR-Request-Type Access-Password-Reject 9 VALUE USR-Request-Type Access-Challenge 11 VALUE USR-Request-Type Status-Server 12 VALUE USR-Request-Type Status-Client 13 # Non standard packet types used by NetServer to implement # resource management and NAS reboot conditions VALUE USR-Request-Type Resource-Free-Request 21 VALUE USR-Request-Type Resource-Free-Response 22 VALUE USR-Request-Type Resource-Query-Request 23 VALUE USR-Request-Type Resource-Query-Response 24 VALUE USR-Request-Type Disconnect-User 25 VALUE USR-Request-Type NAS-Reboot-Request 26 VALUE USR-Request-Type NAS-Reboot-Response 27 # This value is used for Tacacs Plus translation VALUE USR-Request-Type Tacacs-Message 253 VALUE USR-Request-Type Reserved 255 VALUE USR-Speed-Of-Connection Auto 0 VALUE USR-Speed-Of-Connection 56 1 VALUE USR-Speed-Of-Connection 64 2 VALUE USR-Speed-Of-Connection Voice 3 VALUE USR-Expansion-Algorithm Constant 1 VALUE USR-Expansion-Algorithm Linear 2 VALUE USR-Compression-Algorithm None 0 VALUE USR-Compression-Algorithm Stac 1 VALUE USR-Compression-Algorithm Ascend 2 VALUE USR-Compression-Algorithm Microsoft 3 VALUE USR-Compression-Algorithm Auto 4 VALUE USR-Compression-Reset-Mode Auto 0 VALUE USR-Compression-Reset-Mode Reset-Every-Packet 1 VALUE USR-Compression-Reset-Mode Reset-On-Error 2 VALUE USR-Filter-Zones enabled 1 VALUE USR-Filter-Zones disabled 2 VALUE USR-Bridging enabled 1 VALUE USR-Bridging disabled 2 VALUE USR-Appletalk enabled 1 VALUE USR-Appletalk disabled 2 VALUE USR-Spoofing enabled 1 VALUE USR-Spoofing disabled 2 VALUE USR-Routing-Protocol Rip1 1 VALUE USR-Routing-Protocol Rip2 2 VALUE USR-IPX-Routing none 0 VALUE USR-IPX-Routing send 1 VALUE USR-IPX-Routing listen 2 VALUE USR-IPX-Routing respond 3 VALUE USR-IPX-Routing all 4 VALUE USR-IPX-WAN enabled 1 VALUE USR-IPX-WAN disabled 2 VALUE USR-IP-Default-Route-Option enabled 1 VALUE USR-IP-Default-Route-Option disabled 2 VALUE USR-IP-RIP-Policies SendDefault 0x0 VALUE USR-IP-RIP-Policies SendRoutes 0x2 VALUE USR-IP-RIP-Policies SendSubnets 0x4 VALUE USR-IP-RIP-Policies AcceptDefault 0x8 VALUE USR-IP-RIP-Policies SplitHorizon 0x10 VALUE USR-IP-RIP-Policies PoisonReserve 0x20 VALUE USR-IP-RIP-Policies FlashUpdate 0x40 VALUE USR-IP-RIP-Policies SimpleAuth 0x80 VALUE USR-IP-RIP-Policies V1Send 0x100 VALUE USR-IP-RIP-Policies V1Receive 0x200 VALUE USR-IP-RIP-Policies V2Receive 0x400 VALUE USR-IP-RIP-Policies Silent 0x80000000 VALUE USR-Callback-Type Normal 1 VALUE USR-Callback-Type ANI 2 VALUE USR-Callback-Type Static 3 VALUE USR-Callback-Type Dynamic 4 VALUE USR-Agent FA 1 VALUE USR-Agent HA 2 VALUE USR-NAS-Type 3Com-NMC 0 VALUE USR-NAS-Type 3Com-NETServer 1 VALUE USR-NAS-Type 3Com-HiPerArc 2 VALUE USR-NAS-Type TACACS+-Server 3 VALUE USR-NAS-Type 3Com-SA-Server 4 VALUE USR-NAS-Type Ascend 5 VALUE USR-NAS-Type Generic-RADIUS 6 VALUE USR-NAS-Type 3Com-NETBuilder-II 7 VALUE USR-Auth-Mode Auth-3Com 0 VALUE USR-Auth-Mode Auth-Ace 1 VALUE USR-Auth-Mode Auth-Safeword 2 VALUE USR-Auth-Mode Auth-UNIX-PW 3 VALUE USR-Auth-Mode Auth-Defender 4 VALUE USR-Auth-Mode Auth-TACACSP 5 VALUE USR-Auth-Mode Auth-Netware 6 VALUE USR-Auth-Mode Auth-Skey 7 VALUE USR-Auth-Mode Auth-EAP-Proxy 8 VALUE USR-Auth-Mode Auth-UNIX-Crypt 9 VALUE CW-Acct-Type COMS-UNKNOWN-ACCT-TYPE 0 VALUE CW-Acct-Type COMS-PREPAID-ACCT 1 VALUE CW-Acct-Type COMS-NEW-ACCT 2 VALUE CW-Acct-Type COMS-SUSPENDED-ACCT 3 VALUE CW-Acct-Type COMS-ADMINISTRATIVE-ACCT 4 VALUE CW-Source-Identifier COMS-UNKNOWN-SOURCE 0 VALUE CW-Source-Identifier COMS-INGRESS-OPEN 257 VALUE CW-Source-Identifier COMS-EGRESS-OPEN 258 VALUE CW-Source-Identifier COMS-GTKPR-GEN-INGR-OPEN 259 VALUE CW-Source-Identifier COMS-GTKPR-GEN-EGR-OPEN 260 VALUE CW-Source-Identifier COMS-INGRESS-CLOSE 513 VALUE CW-Source-Identifier COMS-EGRESS-CLOSE 514 VALUE CW-Source-Identifier COMS-GTKPR-GEN-INGR-CLOSE 515 VALUE CW-Source-Identifier COMS-GTKPR-GEN-EGR-CLOSE 516 VALUE CW-Session-Sequence-End NOT-THE-LAST-CALL 0 VALUE CW-Session-Sequence-End LAST-CALL 1 VALUE CW-Clg-Party-E164-Type comsUnknown 1 VALUE CW-Clg-Party-E164-Type comsInternationalNumber 2 VALUE CW-Clg-Party-E164-Type comsNationalNumber 3 VALUE CW-Clg-Party-E164-Type comsNetworkSpecificNumber 4 VALUE CW-Clg-Party-E164-Type comsSubscriberNumber 5 VALUE CW-Clg-Party-E164-Type comsAbbreviatedNumber 6 VALUE CW-Clg-Party-E164-Type comsReserved 7 VALUE CW-Clg-Party-Trans-Protocol TCP 1 VALUE CW-Clg-Party-Trans-Protocol UDP 2 VALUE CW-Clg-Party-Trans-Protocol SCTP 3 VALUE CW-Cld-Party-E164-Type comsUnknown 1 VALUE CW-Cld-Party-E164-Type comsInternationalNumber 2 VALUE CW-Cld-Party-E164-Type comsNationalNumber 3 VALUE CW-Cld-Party-E164-Type comsNetworkSpecificNumber 4 VALUE CW-Cld-Party-E164-Type comsSubscriberNumber 5 VALUE CW-Cld-Party-E164-Type comsAbbreviatedNumber 6 VALUE CW-Cld-Party-E164-Type comsReserved 7 VALUE CW-Cld-Party-Trans-Protocol TCP 1 VALUE CW-Cld-Party-Trans-Protocol UDP 2 VALUE CW-Cld-Party-Trans-Protocol SCTP 3 VALUE CW-Ingr-Gway-E164-Type comsUnknown 1 VALUE CW-Ingr-Gway-E164-Type comsInternationalNumber 2 VALUE CW-Ingr-Gway-E164-Type comsNationalNumber 3 VALUE CW-Ingr-Gway-E164-Type comsNetworkSpecificNumber 4 VALUE CW-Ingr-Gway-E164-Type comsSubscriberNumber 5 VALUE CW-Ingr-Gway-E164-Type comsAbbreviatedNumber 6 VALUE CW-Ingr-Gway-E164-Type comsReserved 7 VALUE CW-Ingr-Gway-Trans-Protocol TCP 1 VALUE CW-Ingr-Gway-Trans-Protocol UDP 2 VALUE CW-Ingr-Gway-Trans-Protocol SCTP 3 VALUE CW-Egr-Gway-Trans-Protocol TCP 1 VALUE CW-Egr-Gway-Trans-Protocol UDP 2 VALUE CW-Egr-Gway-Trans-Protocol SCTP 3 VALUE CW-Ingr-Gtkpr-Trans-Protocol TCP 1 VALUE CW-Ingr-Gtkpr-Trans-Protocol UDP 2 VALUE CW-Ingr-Gtkpr-Trans-Protocol SCTP 3 VALUE CW-Egr-Gtkpr-Trans-Protocol TCP 1 VALUE CW-Egr-Gtkpr-Trans-Protocol UDP 2 VALUE CW-Egr-Gtkpr-Trans-Protocol SCTP 3 VALUE CW-Call-Type COMS-UNKNOWN-CALLTYPE 0 VALUE CW-Call-Type COMS-PHONE-TO-PHONE 1 VALUE CW-Call-Type COMS-PHONE-TO-PC 2 VALUE CW-Call-Type COMS-PC-TO-PHONE 3 VALUE CW-Call-Type COMS-PC-TO-PC 4 VALUE CW-Codec-Type COMS-UNDEFINED-CODEC 0 VALUE CW-Codec-Type COMS-G723-1 1 VALUE CW-Codec-Type COMS-G729-A 2 VALUE CW-Codec-Type COMS-G710-ALaw 3 VALUE CW-Codec-Type COMS-G711-MuLaw 4 VALUE CW-Codec-Type COMS-FAX-MODULATION 255 VALUE CW-Call-Termination-Cause CAUSE-UNKNOWN 0 VALUE CW-Call-Termination-Cause CAUSE-CLD-PARTY-TERMINATE 1 VALUE CW-Call-Termination-Cause CAUSE-CLG-PARTY-TERMINATE 2 VALUE CW-Call-Termination-Cause CAUSE-ACCT-BAL-DEPLETED 3 VALUE CW-Call-Termination-Cause CAUSE-NO-EGR-PORTS-AVAIL 4 VALUE CW-Call-Termination-Cause CAUSE-H225-UNABLE-TO-CON 5 VALUE CW-Call-Termination-Cause CAUSE-H245-UNABLE-TO-CON 6 VALUE CW-Call-Termination-Cause CAUSE-INGR-FACILITY-DISC 7 VALUE CW-Call-Termination-Cause CAUSE-EGR-FACILITY-DISC 8 VALUE CW-Call-Termination-Cause CAUSE-DIR-SERVER-DOWN 9 VALUE CW-Call-Termination-Cause CAUSE-RATING-SERVER-DOWN 10 VALUE CW-Call-Termination-Cause CAUSE-GATEWAY-SHUTDOWN 11 VALUE CW-Call-Termination-Cause CAUSE-GTKPR-TERMINATE 12 VALUE CW-Call-Termination-Cause CAUSE-GTKPR-SHUTDOWN-GTWAY 13 VALUE CW-Call-Termination-Cause CAUSE-BUSY 14 VALUE CW-Call-Termination-Cause CAUSE-ABANDON 15 VALUE CW-Call-Termination-Cause CAUSE-INVALID-LOGIN-LIMIT 16 VALUE CW-Call-Termination-Cause CAUSE-NOACCTNUMBER-ENTRY 17 VALUE CW-Call-Termination-Cause CAUSE-SUSPENDED-ACCT-LOGIN 18 VALUE CW-Call-Termination-Cause CAUSE-AUTHENT-SERVER-DOWN 19 VALUE CW-Call-Termination-Cause CAUSE-GATEKEEPER-TIMEOUT 20 VALUE CW-Call-Termination-Cause CAUSE-GATEWAY-NO-RESOURCES 21 VALUE CW-Call-Termination-Cause CAUSE-ACCT-INUSE 22 VALUE CW-Call-Termination-Cause CAUSE-DEBIT-ACCT-BAL-ZERO 23 VALUE CW-Call-Termination-Cause CAUSE-DEBIT-ACCTBAL-INSUFF 24 VALUE CW-Call-Termination-Cause CAUSE-INVALID-DESTNUMBER-THRESH 25 VALUE CW-Call-Termination-Cause CAUSE-NO-DESTNUMBER-ENTRY 26 VALUE CW-Call-Termination-Cause CAUSE-SEQUENCE-DIALING-THRESH 27 VALUE CW-Signaling-Protocol SIG-UNKNOWN 0 VALUE CW-Signaling-Protocol SIG-SIP 1 VALUE CW-Signaling-Protocol SIG-H323 2 VALUE CW-Protocol-Transport TCP 1 VALUE CW-Protocol-Transport UDP 2 VALUE CW-Protocol-Transport SCTP 3 VALUE CW-Local-Sig-Trans-Protocol TCP 1 VALUE CW-Local-Sig-Trans-Protocol UDP 2 VALUE CW-Local-Sig-Trans-Protocol SCTP 3 VALUE CW-Remote-Sig-Trans-Protocol TCP 1 VALUE CW-Remote-Sig-Trans-Protocol UDP 2 VALUE CW-Remote-Sig-Trans-Protocol SCTP 3 VALUE CW-Local-MG-RTP-Protocol TCP 1 VALUE CW-Local-MG-RTP-Protocol UDP 2 VALUE CW-Local-MG-RTP-Protocol SCTP 3 VALUE CW-Remote-MG-RTP-Protocol TCP 1 VALUE CW-Remote-MG-RTP-Protocol UDP 2 VALUE CW-Remote-MG-RTP-Protocol SCTP 3 VALUE CW-Trans-Cld-Party-E164-Type Unknown 1 VALUE CW-Trans-Cld-Party-E164-Type International-Number 2 VALUE CW-Trans-Cld-Party-E164-Type National-Number 3 VALUE CW-Trans-Cld-Party-E164-Type Network-Specific-Number 4 VALUE CW-Trans-Cld-Party-E164-Type Subscriber-Number 5 VALUE CW-Trans-Cld-Party-E164-Type Abbreviated-Number 6 VALUE CW-Trans-Cld-Party-E164-Type Reserved 7 END-VENDOR USR freeradius-server/share/dictionary.usr.illegal000066400000000000000000000023361257552170400221410ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2011 The FreeRADIUS Server project and contributors ############################################################################## # # USE dictionary that illegally uses the RFC space. # # $Id$ # ############################################################################## # # USR specific attributes # # Prompt value should be 1 for echo, 0 for no echo, default 1. #ATTRIBUTE Prompt 64 integer ATTRIBUTE Multi-Link-Flag 126 integer ATTRIBUTE Char-Noecho 250 integer # # USR specific Integer Translations # VALUE Termination-Action Manage-Resources 2 VALUE Acct-Status-Type Modem-Start 4 VALUE Acct-Status-Type Modem-Stop 5 VALUE Acct-Status-Type Cancel 6 VALUE Multi-Link-Flag True 1 VALUE Multi-Link-Flag False 0 # USR specific Authentication Types # # These are commented out because the conflict with the standard # definitions. # #VALUE Acct-Authentic None 0 #VALUE Acct-Authentic Remote 3 #VALUE Acct-Authentic RADIUS 4 #VALUE Acct-Authentic MNET 5 #VALUE Acct-Authentic KCHAP 6 #VALUE Acct-Authentic TACACS 7 #VALUE Acct-Authentic Realm 8 #VALUE Acct-Authentic Local 9 #VALUE Acct-Authentic File 10 #VALUE Acct-Authentic Local-VPN 11 freeradius-server/share/dictionary.utstarcom000066400000000000000000000031271257552170400217400ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2011 The FreeRADIUS Server project and contributors ############################################################################## # # UT Starcom (China) # # $Id$ # ############################################################################## VENDOR UTStarcom 7064 BEGIN-VENDOR UTStarcom ATTRIBUTE UTStarcom-VLAN-ID 140 integer ATTRIBUTE UTStarcom-CommittedBandwidth 142 integer ATTRIBUTE UTStarcom-MaxBandwidth 143 integer ATTRIBUTE UTStarcom-Priority 145 integer ATTRIBUTE UTStarcom-Error-Reason 147 integer ATTRIBUTE UTStarcom-PrimaryDNS 152 integer ATTRIBUTE UTStarcom-SecondaryDNS 153 integer ATTRIBUTE UTStarcom-MaxBurstSize 161 integer ATTRIBUTE UTStarcom-MaxDelay 162 integer ATTRIBUTE UTStarcom-MaxJitter 163 integer ATTRIBUTE UTStarcom-DeviceId 165 string ATTRIBUTE UTStarcom-Module-Id 166 integer ATTRIBUTE UTStarcom-Port-No 167 integer ATTRIBUTE UTStarcom-Logical-Port-No 168 integer ATTRIBUTE UTStarcom-UNI-MAX-MAC 169 integer ATTRIBUTE UTStarcom-Default-Gateway 170 integer ATTRIBUTE UTStarcom-CLI-Access-Level 171 integer ATTRIBUTE UTStarcom-Act-Input-Octets 180 string ATTRIBUTE UTStarcom-Act-Output-Octets 181 string ATTRIBUTE UTStarcom-Act-Input-Frames 182 string ATTRIBUTE UTStarcom-Act-Output-Frames 183 string ATTRIBUTE UTStarcom-Onu-MC-Filter-Enable 184 integer ATTRIBUTE UTStarcom-UNI-Auto-Negotiation 185 integer ATTRIBUTE UTStarcom-UNI-Speed 186 integer ATTRIBUTE UTStarcom-UNI-Duplex 187 integer ATTRIBUTE UTStarcom-ONU-Admin_status 188 integer ATTRIBUTE UTStarcom-ONU-FW-SC-Upgrade 189 integer END-VENDOR UTStarcom freeradius-server/share/dictionary.valemount000066400000000000000000000012621257552170400217270ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2011 The FreeRADIUS Server project and contributors # # Valemount Networks Corporation specific radius attributes # networks@valemount.com # # $Id$ # VENDOR ValemountNetworks 16313 BEGIN-VENDOR ValemountNetworks # Rates to give PPPoE customers, can be used in Authentication replies, # in bits/s ATTRIBUTE VNC-PPPoE-CBQ-RX 1 integer ATTRIBUTE VNC-PPPoE-CBQ-TX 2 integer # Fallback support for each direction. (1 / 0) ATTRIBUTE VNC-PPPoE-CBQ-RX-Fallback 3 integer ATTRIBUTE VNC-PPPoE-CBQ-TX-Fallback 4 integer ATTRIBUTE VNC-Splash 10 integer VALUE VNC-Splash Show 1 VALUE VNC-Splash No-Show 0 END-VENDOR ValemountNetworks freeradius-server/share/dictionary.versanet000066400000000000000000000041401257552170400215420ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2011 The FreeRADIUS Server project and contributors # # dictionary.versanet Vendor specfic attributes for versanet # # # VersaNet Communications, Inc. # Http://www.versa-net.com # # #Versanet add Vendor specific terminal cause in our radius group. #You can follow this to set it in NAS box. # # >> gr radius # >> sh # >> set 34 23 # >> co # #This will let our unit transfer every detail terminal cause #information to Redius server's accounting log file and #save as "Vendor Specific=Terminate Cause". # # Version: @(#)dictionary.versanet 1.00 22-Jul-1999 support@versanetcomm.com # VENDOR Versanet 2180 BEGIN-VENDOR Versanet ATTRIBUTE Versanet-Termination-Cause 1 integer VALUE Versanet-Termination-Cause Normal-Hangup-No-Error-Occurred 0 VALUE Versanet-Termination-Cause Call-Waiting-Caused-Disconnect 3 VALUE Versanet-Termination-Cause Physical-Carrier-Loss 4 VALUE Versanet-Termination-Cause No-err-correction-at-other-end 5 VALUE Versanet-Termination-Cause No-resp-to-feature-negotiation 6 VALUE Versanet-Termination-Cause 1st-modem-async-only-2nd-sync 7 VALUE Versanet-Termination-Cause No-framing-technique-in-common 8 VALUE Versanet-Termination-Cause No-protocol-in-common 9 VALUE Versanet-Termination-Cause Bad-resp-to-feature-negotiation 10 VALUE Versanet-Termination-Cause No-sync-info-from-remote-modem 11 VALUE Versanet-Termination-Cause Normal-Hangup-by-Remote-modem 12 VALUE Versanet-Termination-Cause Retransmission-limit-reached 13 VALUE Versanet-Termination-Cause Protocol-violation-occurred 14 VALUE Versanet-Termination-Cause Lost-DTR 15 VALUE Versanet-Termination-Cause Received-GSTN-cleardown 16 VALUE Versanet-Termination-Cause Inactivity-timeout 17 VALUE Versanet-Termination-Cause Speed-not-supported 18 VALUE Versanet-Termination-Cause Long-space-disconnect 19 VALUE Versanet-Termination-Cause Key-abort-disconnect 20 VALUE Versanet-Termination-Cause Clears-previous-disc-reason 21 VALUE Versanet-Termination-Cause No-connection-established 22 VALUE Versanet-Termination-Cause Disconnect-after-three-retrains 23 END-VENDOR Versanet freeradius-server/share/dictionary.vqp000066400000000000000000000057141257552170400205310ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2011 The FreeRADIUS Server project and contributors ############################################################################## # # Cisco's VLAN Query Protocol # # This dictionary is NOT a RADIUS dictionary, but is used for a # similar purpose. # # The default destination port is 1589. # # $Id$ # ############################################################################## # # We've allocated "fake" attribute 0x2b00 ... 0x2cff for VQP. # # # 0x2b00..0x2bff are for the VQP packet headers. # 0x2c00..0x2cff are for the VQP attributes. # # Note that the VQP protocol specifies 0x0c01..0x0c08 as the # real numbers for the VQP attributes. We've added '0x2000' # to them to separate them from RADIUS attributes... # # # VQP Op codes # ATTRIBUTE VQP-Packet-Type 0x2b00 integer ATTRIBUTE VQP-Error-Code 0x2b01 integer ATTRIBUTE VQP-Sequence-Number 0x2b02 integer # # VQP Attributes # ATTRIBUTE VQP-Client-IP-Address 0x2c01 ipaddr ATTRIBUTE VQP-Port-Name 0x2c02 string ATTRIBUTE VQP-VLAN-Name 0x2c03 string # VTP domain ATTRIBUTE VQP-Domain-Name 0x2c04 string # Encapsulates an Ethernet frame... ATTRIBUTE VQP-Ethernet-Frame 0x2c05 octets ATTRIBUTE VQP-MAC 0x2c06 ether ATTRIBUTE VQP-Unknown 0x2c07 octets ATTRIBUTE VQP-Cookie 0x2c08 ether # # VQP integer mappings # VALUE VQP-Packet-Type VQP-Join-Request 1 VALUE VQP-Packet-Type VQP-Join-Response 2 VALUE VQP-Packet-Type VQP-Reconfirm-Request 3 VALUE VQP-Packet-Type VQP-Reconfirm-Response 4 VALUE VQP-Error-Code VQP-No-Error 0 VALUE VQP-Error-Code VQP-Wrong-Version 1 VALUE VQP-Error-Code VQP-Insufficient-Resources 2 VALUE VQP-Error-Code VQP-Deny 3 VALUE VQP-Error-Code VQP-Shutdown 4 VALUE VQP-Error-Code VQP-Wrong-Mgmt-Domain 5 ###################################################################### # # Duplicate names here, for simplicity # ###################################################################### # # VMPS Op codes # ATTRIBUTE VMPS-Packet-Type 0x2b00 integer ATTRIBUTE VMPS-Error-Code 0x2b01 integer ATTRIBUTE VMPS-Sequence-Number 0x2b02 integer # # VMPS Attributes # ATTRIBUTE VMPS-Client-IP-Address 0x2c01 ipaddr ATTRIBUTE VMPS-Port-Name 0x2c02 string ATTRIBUTE VMPS-VLAN-Name 0x2c03 string # VTP domain ATTRIBUTE VMPS-Domain-Name 0x2c04 string # Encapsulates an Ethernet frame... ATTRIBUTE VMPS-Ethernet-Frame 0x2c05 octets ATTRIBUTE VMPS-MAC 0x2c06 ether ATTRIBUTE VMPS-Unknown 0x2c07 octets ATTRIBUTE VMPS-Cookie 0x2c08 ether # # VMPS integer mappings # VALUE VMPS-Packet-Type VMPS-Join-Request 1 VALUE VMPS-Packet-Type VMPS-Join-Response 2 VALUE VMPS-Packet-Type VMPS-Reconfirm-Request 3 VALUE VMPS-Packet-Type VMPS-Reconfirm-Response 4 VALUE VMPS-Error-Code VMPS-No-Error 0 VALUE VMPS-Error-Code VMPS-Wrong-Version 1 VALUE VMPS-Error-Code VMPS-Insufficient-Resources 2 VALUE VMPS-Error-Code VMPS-Deny 3 VALUE VMPS-Error-Code VMPS-Shutdown 4 VALUE VMPS-Error-Code VMPS-Wrong-Mgmt-Domain 5 freeradius-server/share/dictionary.walabi000066400000000000000000000016311257552170400211540ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2011 The FreeRADIUS Server project and contributors ############################################################################## # # Walabi Store & Forward FAX attributes. # # $Id$ # ############################################################################## VENDOR Walabi 2004 VALUE Acct-Status-Type WB-Login 217 VALUE Acct-Status-Type WB-Logout 218 VALUE Acct-Status-Type WB-WRitelog 219 # Store and Forward Fax Attributes: BEGIN-VENDOR Walabi ATTRIBUTE WB-AUTH-Time-Left 1 integer ATTRIBUTE WB-Auth-Accum-BW 2 integer ATTRIBUTE WB-Auth-BW-Quota 3 integer ATTRIBUTE WB-Auth-BW-Count 4 integer ATTRIBUTE WB-Auth-Upload-Limit 5 integer ATTRIBUTE WB-Auth-Download-Limit 6 integer ATTRIBUTE WB-Auth-Login-Time 7 integer ATTRIBUTE WB-Auth-Logout-Time 8 integer ATTRIBUTE WB-Auth-Time-Diff 9 integer ATTRIBUTE WB-Auth-BW-Usage 10 integer END-VENDOR Walabi freeradius-server/share/dictionary.waverider000066400000000000000000000036011257552170400217040ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2011 The FreeRADIUS Server project and contributors # # http://www.waverider.com/ # $Id$ # VENDOR Waverider 2979 BEGIN-VENDOR Waverider ATTRIBUTE Waverider-Grade-Of-Service 1 integer ATTRIBUTE Waverider-Priority-Enabled 2 integer ATTRIBUTE Waverider-Authentication-Key 3 string ATTRIBUTE Waverider-Current-Password 5 string ATTRIBUTE Waverider-New-Password 6 string ATTRIBUTE Waverider-Radio-Frequency 7 integer ATTRIBUTE Waverider-SNMP-Read-Community 8 string ATTRIBUTE Waverider-SNMP-Write-Community 9 string ATTRIBUTE Waverider-SNMP-Trap-Server 10 string ATTRIBUTE Waverider-SNMP-Contact 11 string ATTRIBUTE Waverider-SNMP-Location 12 string ATTRIBUTE Waverider-SNMP-Name 13 string ATTRIBUTE Waverider-Max-Customers 14 integer ATTRIBUTE Waverider-Rf-Power 15 integer VALUE Waverider-Grade-Of-Service be 1 VALUE Waverider-Grade-Of-Service bronze 2 VALUE Waverider-Grade-Of-Service silver 3 VALUE Waverider-Grade-Of-Service gold 4 VALUE Waverider-Priority-Enabled disabled 0 VALUE Waverider-Priority-Enabled enabled 1 VALUE Waverider-Radio-Frequency auto 1 VALUE Waverider-Radio-Frequency nomadic 2 VALUE Waverider-Radio-Frequency f_9050 3 VALUE Waverider-Radio-Frequency f_9116 4 VALUE Waverider-Radio-Frequency f_9184 5 VALUE Waverider-Radio-Frequency f_9250 6 VALUE Waverider-Radio-Frequency f_9084 7 VALUE Waverider-Radio-Frequency f_9150 8 VALUE Waverider-Radio-Frequency f_9216 9 VALUE Waverider-Rf-Power p_15 1 VALUE Waverider-Rf-Power p_16 2 VALUE Waverider-Rf-Power p_17 3 VALUE Waverider-Rf-Power p_18 4 VALUE Waverider-Rf-Power p_19 5 VALUE Waverider-Rf-Power p_20 6 VALUE Waverider-Rf-Power p_21 7 VALUE Waverider-Rf-Power p_22 8 VALUE Waverider-Rf-Power p_23 9 VALUE Waverider-Rf-Power p_24 10 VALUE Waverider-Rf-Power p_25 11 VALUE Waverider-Rf-Power p_26 12 END-VENDOR Waverider freeradius-server/share/dictionary.wichorus000066400000000000000000000005131257552170400215560ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2011 The FreeRADIUS Server project and contributors # # Dictionary for WiChorus Inc. VSA's. # http://www.wichorus.com/ # # Version: $Id$ # VENDOR Wichorus 27030 BEGIN-VENDOR Wichorus ATTRIBUTE Wichorus-Policy-Name 1 string ATTRIBUTE Wichorus-User-Privilege 2 string END-VENDOR Wichorus freeradius-server/share/dictionary.wimax000066400000000000000000000314031257552170400210420ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2011 The FreeRADIUS Server project and contributors ############################################################################## # # WiMAX Forum # # Updated from NWG_R1_V1.2.1-Stage-3.pdf # # NWG_R1_V1.2-Stage-3.pdf # RADIUS discussion is on pp. 432-498 # WiMAX VSA's are on p. 450 and following. # # DHCP && MIP keys are on p.48 and following. # # WiMAX VSA's have a non-standard format: # # type 1 octet # length 1 octet # continuation 1 octet 0bcrrrrrrr # value 1+ octets # # If the high bit of the "continuation" field is set, then # the next attribute of the same WiMAX type should have it's # value concatenated to this one. # # The C bit MUST be zero for all small types. e.g. integer, # ipaddr, ipv6addr, etc. It MAY be set for "string" and "octet" # types. The maximum attribute length for "string" and "octet" # types is still 253 bytes, even with continuations. The WiMAX # specifications do not specify a maximum length, so we have chosen # to keep the traditional RADIUS maximum length here. # # The C bit MAY be 1 for TLV types. There is no restriction on # TLV length other than maximum packet size (a bit less than 4K). # # The rest of the bits in the "continuation" octet are reserved, # and MUST be zero. # # Each WiMAX VSA is packed into one Vendor-Specific attribute # with Vendor-Id of WiMAX. Multiple WiMAX sub-TLV's ARE packed # into one VSA with an encapsulating TLV. # # The WiMAX forum adds the following (non-standard) data types: # # byte - one-octet unsigned integer # short - two-octet unsigned integer in network byte order # signed - 4-octet signed integer in network byte order. # combo-ip - if length 4, is the same as the "ipaddr" type. # if length 16, is the same as "ipv6addr" type. # tlv - encapsulated sub-attributes # i.e. Vendor-Specific -> WiMAX TLV -> WiMAX sub-tlv. # ############################################################################## # # $Id$ # ############################################################################## VENDOR WiMAX 24757 format=1,1,c BEGIN-VENDOR WiMAX ATTRIBUTE WiMAX-Capability 1 tlv BEGIN-TLV WiMAX-Capability ATTRIBUTE WiMAX-Release 1 string ATTRIBUTE WiMAX-Accounting-Capabilities 2 byte ATTRIBUTE WiMAX-Hotlining-Capabilities 3 byte ATTRIBUTE WiMAX-Idle-Mode-Notification-Cap 4 byte # This is really a bitmap VALUE WiMAX-Accounting-Capabilities No-Accounting 0 VALUE WiMAX-Accounting-Capabilities IP-Session-Based 1 VALUE WiMAX-Accounting-Capabilities Flow-Based 2 # This is really a bitmap VALUE WiMAX-Hotlining-Capabilities Not-Supported 0 VALUE WiMAX-Hotlining-Capabilities Hotline-Profile-Id 1 VALUE WiMAX-Hotlining-Capabilities NAS-Filter-Rule 2 VALUE WiMAX-Hotlining-Capabilities HTTP-Redirection 4 VALUE WiMAX-Hotlining-Capabilities IP-Redirection 8 VALUE WiMAX-Idle-Mode-Notification-Cap Not-Supported 0 VALUE WiMAX-Idle-Mode-Notification-Cap Supported 1 END-TLV WiMAX-Capability ATTRIBUTE WiMAX-Device-Authentication-Indicator 2 byte ATTRIBUTE WiMAX-GMT-Timezone-offset 3 signed ATTRIBUTE WiMAX-AAA-Session-Id 4 octets # 32 octets in length ATTRIBUTE WiMAX-MSK 5 octets encrypt=2 ATTRIBUTE WiMAX-hHA-IP-MIP4 6 ipaddr ATTRIBUTE WiMAX-hHA-IP-MIP6 7 ipv6addr ATTRIBUTE WiMAX-DHCPv4-Server 8 combo-ip ATTRIBUTE WiMAX-DHCPv6-Server 9 combo-ip # MN-HA-CMIP4 = H(MIP-RK, "CMIP4 MN HA" | HA-IPv4 | MN-NAI), or # MN-HA-PMIP4 = H(MIP-RK, "PMIP4 MN HA" | HA-IPv4 | MN-NAI) ATTRIBUTE WiMAX-MN-hHA-MIP4-Key 10 octets encrypt=2 # MN-HA-CMIP4-SPI == MIP-SPI, or # MN-HA-PIMP4-SPI == MIP-SPI + 1 ATTRIBUTE WiMAX-MN-hHA-MIP4-SPI 11 integer # MN-HA-CMIP6 = H(MIP-RK, "CMIP6 MN HA" | HA-IPv6 | MN-NAI) ATTRIBUTE WiMAX-MN-hHA-MIP6-Key 12 octets encrypt=2 # MN-HA-CMIP6-SPI == MIP-SPI + 2 ATTRIBUTE WiMAX-MN-hHA-MIP6-SPI 13 integer # FA-RK = H(MIP-RK, "FA-RK") ATTRIBUTE WiMAX-FA-RK-Key 14 octets encrypt=2 # 160 bit random number ATTRIBUTE WiMAX-HA-RK-Key 15 octets encrypt=2 # SPI-CMIP4 ATTRIBUTE WiMAX-HA-RK-SPI 16 integer ATTRIBUTE WiMAX-HA-RK-Lifetime 17 integer # The same as MN-HA-CMIP4, etc. But in different packets. ATTRIBUTE WiMAX-RRQ-HA-IP 18 combo-ip ATTRIBUTE WiMAX-RRQ-MN-HA-Key 19 octets encrypt=2 ATTRIBUTE WiMAX-RRQ-MN-HA-SPI 20 integer ATTRIBUTE WiMAX-Session-Continue 21 integer ATTRIBUTE WiMAX-Beginning-Of-Session 22 integer ATTRIBUTE WiMAX-IP-Technology 23 integer VALUE WiMAX-IP-Technology Reserved-0 0 VALUE WiMAX-IP-Technology Reserved-1 1 VALUE WiMAX-IP-Technology PMIP4 2 VALUE WiMAX-IP-Technology CMIP4 3 VALUE WiMAX-IP-Technology CMIP6 4 VALUE WiMAX-IP-Technology Ethernet-CS 5 ATTRIBUTE WiMAX-Hotline-Indicator 24 string ATTRIBUTE WiMAX-Prepaid-Indicator 25 byte ATTRIBUTE WiMAX-PDFID 26 short ATTRIBUTE WiMAX-SDFID 27 short ATTRIBUTE WiMAX-Packet-Flow-Descriptor 28 tlv BEGIN-TLV WiMAX-Packet-Flow-Descriptor ATTRIBUTE WiMAX-Packet-Data-Flow-Id 1 short ATTRIBUTE WiMAX-Service-Data-Flow-Id 2 short ATTRIBUTE WiMAX-Service-Profile-Id 3 integer ATTRIBUTE WiMAX-Direction 4 byte VALUE WiMAX-Direction Reserved-0 0 VALUE WiMAX-Direction Uplink 1 VALUE WiMAX-Direction Downlink 2 VALUE WiMAX-Direction Bi-Directional 3 ATTRIBUTE WiMAX-Activation-Trigger 5 byte # bitmap ATTRIBUTE WiMAX-Transport-Type 6 byte VALUE WiMAX-Transport-Type Reserved-0 0 VALUE WiMAX-Transport-Type IPv4-CS 1 VALUE WiMAX-Transport-Type IPv6-CS 2 VALUE WiMAX-Transport-Type Ethernet 3 ATTRIBUTE WiMAX-Uplink-QOS-Id 7 byte ATTRIBUTE WiMAX-Downlink-QOS-Id 8 byte ATTRIBUTE WiMAX-Uplink-Classifier 9 string ATTRIBUTE WiMAX-Downlink-Classifier 10 string END-TLV WiMAX-Packet-Flow-Descriptor ATTRIBUTE WiMAX-QoS-Descriptor 29 tlv BEGIN-TLV WiMAX-QoS-Descriptor ATTRIBUTE WiMAX-QoS-Id 1 byte ATTRIBUTE WiMAX-Global-Service-Class-Name 2 string # 6 octets ATTRIBUTE WiMAX-Service-Class-Name 3 string ATTRIBUTE WiMAX-Schedule-Type 4 byte ATTRIBUTE WiMAX-Traffic-Priority 5 byte ATTRIBUTE WiMAX-Maximum-Sustained-Traffic-Rate 6 integer ATTRIBUTE WiMAX-Minimum-Reserved-Traffic-Rate 7 integer ATTRIBUTE WiMAX-Maximum-Traffic-Burst 8 integer ATTRIBUTE WiMAX-Tolerated-Jitter 9 integer ATTRIBUTE WiMAX-Maximum-Latency 10 integer ATTRIBUTE WiMAX-Reduced-Resources-Code 11 byte ATTRIBUTE WiMAX-Media-Flow-Type 12 byte ATTRIBUTE WiMAX-Unsolicited-Grant-Interval 13 short ATTRIBUTE WiMAX-SDU-Size 14 short ATTRIBUTE WiMAX-Unsolicited-Polling-Interval 15 short ATTRIBUTE WiMAX-Media-Flow-Description-SDP 16 string VALUE WiMAX-Schedule-Type Best-Effort 2 VALUE WiMAX-Schedule-Type nrtPS 3 VALUE WiMAX-Schedule-Type rtPS 4 VALUE WiMAX-Schedule-Type Extended-rtPS 5 VALUE WiMAX-Schedule-Type UGS 6 VALUE WiMAX-Media-Flow-Type VoIP 1 VALUE WiMAX-Media-Flow-Type Robust-Browser 2 VALUE WiMAX-Media-Flow-Type Secure-Browser-VPN 3 VALUE WiMAX-Media-Flow-Type Streaming-Video 4 VALUE WiMAX-Media-Flow-Type Streaming-Live-TV 5 VALUE WiMAX-Media-Flow-Type Music-Photo-Download 6 VALUE WiMAX-Media-Flow-Type Multi-Player-Gaming 7 VALUE WiMAX-Media-Flow-Type Location-Based-Services 8 VALUE WiMAX-Media-Flow-Type Text-Audio-Books 9 VALUE WiMAX-Media-Flow-Type Video-Conversation 10 VALUE WiMAX-Media-Flow-Type Message 11 VALUE WiMAX-Media-Flow-Type Control 12 VALUE WiMAX-Media-Flow-Type Data 13 END-TLV WiMAX-QoS-Descriptor ATTRIBUTE WiMAX-Uplink-Granted-QoS 30 string ATTRIBUTE WiMAX-Control-Packets-In 31 integer ATTRIBUTE WiMAX-Control-Octets-In 32 integer ATTRIBUTE WiMAX-Control-Packets-Out 33 integer ATTRIBUTE WiMAX-Control-Octets-Out 34 integer ATTRIBUTE WiMAX-PPAC 35 tlv BEGIN-TLV WiMAX-PPAC ATTRIBUTE WiMAX-Available-In-Client 1 integer # Really a bitmap VALUE WiMAX-Available-In-Client Volume-Metering 1 VALUE WiMAX-Available-In-Client Duration-Metering 2 VALUE WiMAX-Available-In-Client Resource-Metering 4 VALUE WiMAX-Available-In-Client Pools 8 VALUE WiMAX-Available-In-Client Rating-Groups 0x10 VALUE WiMAX-Available-In-Client Multi-Services 0x20 VALUE WiMAX-Available-In-Client Tariff-Switch 0x40 END-TLV WiMAX-PPAC ATTRIBUTE WiMAX-Session-Termination-Capability 36 integer # Really a bitmap VALUE WiMAX-Session-Termination-Capability Dynamic-Authorization 1 ATTRIBUTE WiMAX-PPAQ 37 tlv BEGIN-TLV WiMAX-PPAQ ATTRIBUTE WiMAX-PPAQ-Quota-Identifier 1 octets ATTRIBUTE WiMAX-Volume-Quota 2 integer #kb ATTRIBUTE WiMAX-Volume-Threshold 3 integer #kb ATTRIBUTE WiMAX-Duration-Quota 4 integer #s ATTRIBUTE WiMAX-Duration-Threshold 5 integer #s ATTRIBUTE WiMAX-Resource-Quota 6 integer ATTRIBUTE WiMAX-Resource-Threshold 7 integer ATTRIBUTE WiMAX-Update-Reason 8 integer ATTRIBUTE WiMAX-Prepaid-Server 9 combo-ip ATTRIBUTE WiMAX-Service-Id 10 string ATTRIBUTE WiMAX-Rating-Group-Id 11 integer ATTRIBUTE WiMAX-Termination-Action 12 byte ATTRIBUTE WiMAX-Pool-Id 13 integer ATTRIBUTE WiMAX-Pool-Multiplier 14 integer ATTRIBUTE WiMAX-Requested-Action 15 byte ATTRIBUTE WiMAX-Check-Balance-Result 16 byte # # 4 octets - integer representing 1/10's of lowest currency (e.g. cents) # 4 octets - currency code as in ISO-4217 # 1+ - UTF8 string containing text like "cost is $1 per minute" # ATTRIBUTE WiMAX-Cost-Information-AVP 17 octets VALUE WiMAX-Update-Reason Pre-Initialization 1 VALUE WiMAX-Update-Reason Initial-Request 2 VALUE WiMAX-Update-Reason Threshold-Reached 3 VALUE WiMAX-Update-Reason Quota-Reached 4 VALUE WiMAX-Update-Reason TITSU-Approaching 5 VALUE WiMAX-Update-Reason Remote-Forced-Disconnect 6 VALUE WiMAX-Update-Reason Client-Service-Termination 7 VALUE WiMAX-Update-Reason Access-Service-Terminated 8 VALUE WiMAX-Update-Reason Service-Not-Established 9 VALUE WiMAX-Update-Reason One-Time-Charging 10 VALUE WiMAX-Termination-Action Terminate 1 VALUE WiMAX-Termination-Action Request-More-Quota 2 VALUE WiMAX-Termination-Action Redirect-Or-Filter 3 VALUE WiMAX-Requested-Action Balance-Check 1 VALUE WiMAX-Requested-Action Price-Enquiry 2 END-TLV WiMAX-PPAQ ATTRIBUTE WiMAX-Prepaid-Tariff-Switching 38 tlv BEGIN-TLV WiMAX-Prepaid-Tariff-Switching ATTRIBUTE WiMAX-Prepaid-Quota-Identifier 1 string ATTRIBUTE WiMAX-Volume-Used-After 2 integer #1k ATTRIBUTE WiMAX-Tariff-Switch-Interval 3 integer #s ATTRIBUTE WiMAX-Time-Interval-After 4 integer #s END-TLV WiMAX-Prepaid-Tariff-Switching ATTRIBUTE WiMAX-Active-Time-Duration 39 integer ATTRIBUTE WiMAX-DHCP-RK 40 octets encrypt=2 ATTRIBUTE WiMAX-DHCP-RK-Key-Id 41 integer ATTRIBUTE WiMAX-DHCP-RK-Lifetime 42 integer ATTRIBUTE WiMAX-DHCP-Msg-Server-IP 43 ipaddr ATTRIBUTE WiMAX-Idle-Mode-Transition 44 byte ATTRIBUTE WiMAX-NAP-Id 45 octets # 3 octets of NAP Id # 3 octets of base-station Id ATTRIBUTE WiMAX-BS-Id 46 octets ATTRIBUTE WiMAX-Location 47 octets # Number of times Acct-Input-Packets rolled over 2^32. ATTRIBUTE WiMAX-Acct-Input-Packets-Gigaword 48 integer ATTRIBUTE WiMAX-Acct-Output-Packets-Gigaword 49 integer # Formatted as per IP Filter rule specification. ATTRIBUTE WiMAX-Uplink-Flow-Description 50 string ATTRIBUTE WiMAX-Blu-Coa-IPv6 51 ipv6addr ATTRIBUTE WiMAX-DNS-Server 52 combo-ip ATTRIBUTE WiMAX-Hotline-Profile-Id 53 string # Formatted as per IP Filter rule specification. ATTRIBUTE WiMAX-HTTP-Redirection-Rule 54 string # Formatted as per IP Filter rule specification. ATTRIBUTE WiMAX-IP-Redirection-Rule 55 string ATTRIBUTE WiMAX-Hotline-Session-Timer 56 integer # 3 octets ATTRIBUTE WiMAX-NSP-Id 57 octets ATTRIBUTE WiMAX-HA-RK-Key-Requested 58 integer VALUE WiMAX-HA-RK-Key-Requested No 0 VALUE WiMAX-HA-RK-Key-Requested Yes 1 ATTRIBUTE WiMAX-Count-Type 59 byte ATTRIBUTE WiMAX-DM-Action-Code 60 integer VALUE WiMAX-DM-Action-Code Deregister-MS 0 VALUE WiMAX-DM-Action-Code Suspend-MS-Traffic 1 VALUE WiMAX-DM-Action-Code Suspend-User-Traffic 2 VALUE WiMAX-DM-Action-Code Resume-Traffic 3 VALUE WiMAX-DM-Action-Code MS-Terminate 4 VALUE WiMAX-DM-Action-Code MS-Idle 5 VALUE WiMAX-DM-Action-Code MS-Completed-IPv6-Handover 6 VALUE WiMAX-DM-Action-Code BS-Sends-RES-Cmd 0xffff # FA-RK-SPI = SPI-CMIP4 = MIP-SPI ATTRIBUTE WiMAX-FA-RK-SPI 61 integer # Formatted as per IP Filter rule specification. ATTRIBUTE WiMAX-Downlink-Flow-Description 62 string # Same as QoS-Descriptor... dang. ATTRIBUTE WiMAX-Downlink-Granted-QoS 63 tlv # More MIP keys, calculated as above... but in different packets. # Why, oh why? ATTRIBUTE WiMAX-vHA-IP-MIP4 64 ipaddr ATTRIBUTE WiMAX-vHA-IP-MIP6 65 ipv6addr ATTRIBUTE WiMAX-vHA-MIP4-Key 66 octets encrypt=2 ATTRIBUTE WiMAX-vHA-RK-Key 67 octets encrypt=2 ATTRIBUTE WiMAX-vHA-RK-SPI 68 integer ATTRIBUTE WiMAX-vHA-RK-Lifetime 69 integer ATTRIBUTE WiMAX-MN-vHA-MIP6-Key 70 octets encrypt=2 ATTRIBUTE WiMAX-MN-vHA-MIP4-SPI 71 integer ATTRIBUTE WiMAX-MN-vHA-MIP6-SPI 72 integer ATTRIBUTE WiMAX-vDHCPv4-Server 73 ipaddr ATTRIBUTE WiMAX-vDHCPv6-Server 74 ipv6addr ATTRIBUTE WiMAX-vDHCP-RK 75 octets encrypt=2 ATTRIBUTE WiMAX-vDHCP-RK-Key-ID 76 integer ATTRIBUTE WiMAX-vDHCP-RK-Lifetime 77 integer END-VENDOR WiMAX freeradius-server/share/dictionary.wimax.wichorus000066400000000000000000000360261257552170400227120ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2011 The FreeRADIUS Server project and contributors ############################################################################## # # This is a WiMAX dictionary for the WiChorus line of products. # It is NOT compatible with the normal WiMAX dictionary. # It CANNOT be used at the same time as the normal WiMAX dictionary. # ############################################################################## # # $Id$ # ############################################################################## VENDOR WiMAX 24757 format=1,1,c BEGIN-VENDOR WiMAX ATTRIBUTE WiMAX-Capability 1 tlv BEGIN-TLV WiMAX-Capability ATTRIBUTE WiMAX-Release 1 string ATTRIBUTE WiMAX-Accounting-Capabilities 2 byte ATTRIBUTE WiMAX-Hotlining-Capabilities 3 byte ATTRIBUTE WiMAX-Idle-Mode-Notification-Cap 4 byte ATTRIBUTE WiMAX-Packet-Flow-Descriptor-Capabilities 5 byte # Role of 6/7 swapped vs definition in WMF R015v01 ATTRIBUTE WiMAX-ASN-Network-Service-Capabilities 6 integer ATTRIBUTE WiMAX-Authorized-IP-Services 7 integer # This is really a bitmap VALUE WiMAX-Accounting-Capabilities No-Accounting 0 VALUE WiMAX-Accounting-Capabilities IP-Session-Based 1 VALUE WiMAX-Accounting-Capabilities Flow-Based 2 # This is really a bitmap VALUE WiMAX-Hotlining-Capabilities Not-Supported 0 VALUE WiMAX-Hotlining-Capabilities Hotline-Profile-Id 1 VALUE WiMAX-Hotlining-Capabilities NAS-Filter-Rule 2 VALUE WiMAX-Hotlining-Capabilities HTTP-Redirection 4 VALUE WiMAX-Hotlining-Capabilities IP-Redirection 8 VALUE WiMAX-Idle-Mode-Notification-Cap Not-Supported 0 VALUE WiMAX-Idle-Mode-Notification-Cap Supported 1 # v2 also implies support for v1 VALUE WiMAX-Packet-Flow-Descriptor-Capabilities v1 1 VALUE WiMAX-Packet-Flow-Descriptor-Capabilities v2 2 # This is really a bitmap. # For Wichorus gateway this is used to # indicate functionality supported by the ASN-GW. In WMF R015V01 # this is sub-tlv 7 with the same functionality. Sub-tlv 6 is a # similar and used to indicate services the ASN is authorized to # support for the subscriber (see sub-tlv 7 for Wichorus' version) # Wichorus' implementation is also shifted left one bit... VALUE WiMAX-ASN-Network-Service-Capabilities DHCPv4-Relay 2 VALUE WiMAX-ASN-Network-Service-Capabilities DHCPv6-Relay 4 VALUE WiMAX-ASN-Network-Service-Capabilities DHCPv4-Proxy 8 VALUE WiMAX-ASN-Network-Service-Capabilities DHCPv6-Proxy 16 VALUE WiMAX-ASN-Network-Service-Capabilities FA 32 VALUE WiMAX-ASN-Network-Service-Capabilities PMIP-Client 64 # ... plus additional, but these are the only relevant ones for now # This is really a bitmap # Proprietary definition of supported services. Used by the AAA to # indicate which services the ASN is allowed to support for the MS VALUE WiMAX-Authorized-IP-Services CMIPv4 1 VALUE WiMAX-Authorized-IP-Services PMIPv4 2 VALUE WiMAX-Authorized-IP-Services SimpleIPv4 4 END-TLV WiMAX-Capability ATTRIBUTE WiMAX-Device-Authentication-Indicator 2 byte ATTRIBUTE WiMAX-GMT-Timezone-offset 3 signed ATTRIBUTE WiMAX-AAA-Session-Id 4 octets # 32 octets in length ATTRIBUTE WiMAX-MSK 5 octets encrypt=2 ATTRIBUTE WiMAX-hHA-IP-MIP4 6 ipaddr ATTRIBUTE WiMAX-hHA-IP-MIP6 7 ipv6addr ATTRIBUTE WiMAX-DHCPv4-Server 8 combo-ip ATTRIBUTE WiMAX-DHCPv6-Server 9 combo-ip # MN-HA-CMIP4 = H(MIP-RK, "CMIP4 MN HA" | HA-IPv4 | MN-NAI), or # MN-HA-PMIP4 = H(MIP-RK, "PMIP4 MN HA" | HA-IPv4 | MN-NAI) ATTRIBUTE WiMAX-MN-hHA-MIP4-Key 10 octets encrypt=2 # MN-HA-CMIP4-SPI == MIP-SPI, or # MN-HA-PIMP4-SPI == MIP-SPI + 1 ATTRIBUTE WiMAX-MN-hHA-MIP4-SPI 11 integer # MN-HA-CMIP6 = H(MIP-RK, "CMIP6 MN HA" | HA-IPv6 | MN-NAI) ATTRIBUTE WiMAX-MN-hHA-MIP6-Key 12 octets encrypt=2 # MN-HA-CMIP6-SPI == MIP-SPI + 2 ATTRIBUTE WiMAX-MN-hHA-MIP6-SPI 13 integer # FA-RK = H(MIP-RK, "FA-RK") ATTRIBUTE WiMAX-FA-RK-Key 14 octets encrypt=2 # 160 bit random number ATTRIBUTE WiMAX-HA-RK-Key 15 octets encrypt=2 # SPI-CMIP4 ATTRIBUTE WiMAX-HA-RK-SPI 16 integer ATTRIBUTE WiMAX-HA-RK-Lifetime 17 integer # Calculation is the same as MN-HA-CMIP4, etc. # With CMIP the MN may not know the appropriate HA IP address when calculating # the MIP RRQ AE (IPv4) or during a BU (IPv6). In this case it must either use an # old known HA IP address or can indicate whether dynamic HA assignment from the # hCSN is preferred to the vCSN, or if there is no preference by providing # ALL-ZERO-ONE-ADDR (255.255.255.255/0.0.0.0 respectively) in the MIP RRQ sent # to the FA. The RRQ-MN-HA key is calculated using this RRQ-HA-IP address and is # required by the HA to validate the MIP RRQ received from the MS as it does # not contain the actual HA IP address. ATTRIBUTE WiMAX-RRQ-HA-IP 18 combo-ip ATTRIBUTE WiMAX-RRQ-MN-HA-Key 19 octets encrypt=2 ATTRIBUTE WiMAX-Time-Of-Day-Time 20 tlv BEGIN-TLV WiMAX-Time-Of-Day-Time ATTRIBUTE WiMAX-Hour 1 byte ATTRIBUTE WiMAX-Minute 2 byte ATTRIBUTE WiMAX-UTC-Offset 3 integer END-TLV WiMAX-Time-Of-Day-Time ATTRIBUTE WiMAX-Session-Continue 21 integer VALUE WiMAX-Session-Continue False 0 VALUE WiMAX-Session-Continue True 1 ATTRIBUTE WiMAX-Beginning-Of-Session 22 integer VALUE WiMAX-Beginning-Of-Session False 0 VALUE WiMAX-Beginning-Of-Session True 1 # This is pulled from WMF R015v01 - because our ASN-GW supports Simple IP and a # simple way to denote this was needed without building in a lot of private # logic that would one day simply be replaced by this logic anyway. # Note: Attribute renamed in Release 1.5 to Network-Technology. Maintain the # old name here to allow for better backwards compatibility. ATTRIBUTE WiMAX-IP-Technology 23 integer VALUE WiMAX-IP-Technology Simple-IPv4 0 VALUE WiMAX-IP-Technology Simple-IPv6 1 VALUE WiMAX-IP-Technology PMIP4 2 VALUE WiMAX-IP-Technology CMIP4 3 VALUE WiMAX-IP-Technology CMIP6 4 VALUE WiMAX-IP-Technology Ethernet-CS 5 VALUE WiMAX-IP-Technology Simple-ETH 6 VALUE WiMAX-IP-Technology MIP-Based-ETH 7 VALUE WiMAX-IP-Technology PMIP6 8 ATTRIBUTE WiMAX-Hotline-Indicator 24 string ATTRIBUTE WiMAX-Prepaid-Indicator 25 byte ATTRIBUTE WiMAX-PDFID 26 short ATTRIBUTE WiMAX-SDFID 27 short ATTRIBUTE WiMAX-Packet-Flow-Descriptor 28 tlv BEGIN-TLV WiMAX-Packet-Flow-Descriptor ATTRIBUTE WiMAX-Packet-Data-Flow-Id 1 short ATTRIBUTE WiMAX-Service-Data-Flow-Id 2 short ATTRIBUTE WiMAX-Service-Profile-Id 3 integer ATTRIBUTE WiMAX-Direction 4 byte VALUE WiMAX-Direction Reserved-0 0 VALUE WiMAX-Direction Uplink 1 VALUE WiMAX-Direction Downlink 2 VALUE WiMAX-Direction Bi-Directional 3 ATTRIBUTE WiMAX-Activation-Trigger 5 byte # This is really a bitmap VALUE WiMAX-Activation-Trigger Reserved-0 0 VALUE WiMAX-Activation-Trigger Provisioned 1 VALUE WiMAX-Activation-Trigger Admit 2 VALUE WiMAX-Activation-Trigger Activate 4 VALUE WiMAX-Activation-Trigger Dynamically-Changeable 8 ATTRIBUTE WiMAX-Transport-Type 6 byte VALUE WiMAX-Transport-Type Reserved-0 0 VALUE WiMAX-Transport-Type IPv4-CS 1 VALUE WiMAX-Transport-Type IPv6-CS 2 VALUE WiMAX-Transport-Type Ethernet 3 ATTRIBUTE WiMAX-Uplink-QOS-Id 7 byte ATTRIBUTE WiMAX-Downlink-QOS-Id 8 byte ATTRIBUTE WiMAX-Uplink-Classifier 9 string ATTRIBUTE WiMAX-Downlink-Classifier 10 string #ATTRIBUTE WiMAX-Paging-Preference 11 byte # Single bit, value => refer to 802.16e section 11.13.30 END-TLV WiMAX-Packet-Flow-Descriptor ATTRIBUTE WiMAX-QoS-Descriptor 29 tlv BEGIN-TLV WiMAX-QoS-Descriptor ATTRIBUTE WiMAX-QoS-Id 1 byte ATTRIBUTE WiMAX-Global-Service-Class-Name 2 string # 6 octets ATTRIBUTE WiMAX-Service-Class-Name 3 string ATTRIBUTE WiMAX-Schedule-Type 4 byte ATTRIBUTE WiMAX-Traffic-Priority 5 byte ATTRIBUTE WiMAX-Maximum-Sustained-Traffic-Rate 6 integer ATTRIBUTE WiMAX-Minimum-Reserved-Traffic-Rate 7 integer ATTRIBUTE WiMAX-Maximum-Traffic-Burst 8 integer ATTRIBUTE WiMAX-Tolerated-Jitter 9 integer ATTRIBUTE WiMAX-Maximum-Latency 10 integer ATTRIBUTE WiMAX-Reduced-Resources-Code 11 byte ATTRIBUTE WiMAX-Media-Flow-Type 12 byte ATTRIBUTE WiMAX-Unsolicited-Grant-Interval 13 short ATTRIBUTE WiMAX-SDU-Size 14 short ATTRIBUTE WiMAX-Unsolicited-Polling-Interval 15 short ATTRIBUTE WiMAX-Media-Flow-Description-SDP 16 string VALUE WiMAX-Schedule-Type Best-Effort 2 VALUE WiMAX-Schedule-Type nrtPS 3 VALUE WiMAX-Schedule-Type rtPS 4 VALUE WiMAX-Schedule-Type Extended-rtPS 5 VALUE WiMAX-Schedule-Type UGS 6 VALUE WiMAX-Media-Flow-Type VoIP 1 VALUE WiMAX-Media-Flow-Type Robust-Browser 2 VALUE WiMAX-Media-Flow-Type Secure-Browser-VPN 3 VALUE WiMAX-Media-Flow-Type Streaming-Video 4 VALUE WiMAX-Media-Flow-Type Streaming-Live-TV 5 VALUE WiMAX-Media-Flow-Type Music-Photo-Download 6 VALUE WiMAX-Media-Flow-Type Multi-Player-Gaming 7 VALUE WiMAX-Media-Flow-Type Location-Based-Services 8 VALUE WiMAX-Media-Flow-Type Text-Audio-Books 9 VALUE WiMAX-Media-Flow-Type Video-Conversation 10 VALUE WiMAX-Media-Flow-Type Message 11 VALUE WiMAX-Media-Flow-Type Control 12 VALUE WiMAX-Media-Flow-Type Data 13 END-TLV WiMAX-QoS-Descriptor # Same as QoS-Descriptor... used only in interim and stop records for # flow based accounting. ATTRIBUTE WiMAX-Uplink-Granted-QoS 30 tlv # UPDATED - WAS STRING... ATTRIBUTE WiMAX-Control-Packets-In 31 integer ATTRIBUTE WiMAX-Control-Octets-In 32 integer ATTRIBUTE WiMAX-Control-Packets-Out 33 integer ATTRIBUTE WiMAX-Control-Octets-Out 34 integer ATTRIBUTE WiMAX-PPAC 35 tlv BEGIN-TLV WiMAX-PPAC ATTRIBUTE WiMAX-Available-In-Client 1 integer # Really a bitmap VALUE WiMAX-Available-In-Client Volume-Metering 1 VALUE WiMAX-Available-In-Client Duration-Metering 2 VALUE WiMAX-Available-In-Client Resource-Metering 4 VALUE WiMAX-Available-In-Client Pools 8 VALUE WiMAX-Available-In-Client Rating-Groups 0x10 VALUE WiMAX-Available-In-Client Multi-Services 0x20 VALUE WiMAX-Available-In-Client Tariff-Switch 0x40 END-TLV WiMAX-PPAC ATTRIBUTE WiMAX-Session-Termination-Capability 36 integer # Really a bitmap VALUE WiMAX-Session-Termination-Capability Dynamic-Authorization 1 ATTRIBUTE WiMAX-PPAQ 37 tlv BEGIN-TLV WiMAX-PPAQ ATTRIBUTE WiMAX-PPAQ-Quota-Identifier 1 octets ATTRIBUTE WiMAX-Volume-Quota 2 integer #kb ATTRIBUTE WiMAX-Volume-Threshold 3 integer #kb ATTRIBUTE WiMAX-Duration-Quota 4 integer #s ATTRIBUTE WiMAX-Duration-Threshold 5 integer #s ATTRIBUTE WiMAX-Resource-Quota 6 integer ATTRIBUTE WiMAX-Resource-Threshold 7 integer ATTRIBUTE WiMAX-Update-Reason 8 integer ATTRIBUTE WiMAX-Prepaid-Server 9 combo-ip ATTRIBUTE WiMAX-Service-Id 10 string ATTRIBUTE WiMAX-Rating-Group-Id 11 integer ATTRIBUTE WiMAX-Termination-Action 12 byte ATTRIBUTE WiMAX-Pool-Id 13 integer ATTRIBUTE WiMAX-Pool-Multiplier 14 integer ATTRIBUTE WiMAX-Requested-Action 15 byte ATTRIBUTE WiMAX-Check-Balance-Result 16 byte # # 4 octets - integer representing 1/10's of lowest currency (e.g. cents) # 4 octets - currency code as in ISO-4217 # 1+ - UTF8 string containing text like "cost is $1 per minute" # ATTRIBUTE WiMAX-Cost-Information-AVP 17 octets VALUE WiMAX-Update-Reason Pre-Initialization 1 VALUE WiMAX-Update-Reason Initial-Request 2 VALUE WiMAX-Update-Reason Threshold-Reached 3 VALUE WiMAX-Update-Reason Quota-Reached 4 VALUE WiMAX-Update-Reason TITSU-Approaching 5 VALUE WiMAX-Update-Reason Remote-Forced-Disconnect 6 VALUE WiMAX-Update-Reason Client-Service-Termination 7 VALUE WiMAX-Update-Reason Access-Service-Terminated 8 VALUE WiMAX-Update-Reason Service-Not-Established 9 VALUE WiMAX-Update-Reason One-Time-Charging 10 VALUE WiMAX-Termination-Action Terminate 1 VALUE WiMAX-Termination-Action Request-More-Quota 2 VALUE WiMAX-Termination-Action Redirect-Or-Filter 3 VALUE WiMAX-Requested-Action Balance-Check 1 VALUE WiMAX-Requested-Action Price-Enquiry 2 END-TLV WiMAX-PPAQ ATTRIBUTE WiMAX-Prepaid-Tariff-Switching 38 tlv BEGIN-TLV WiMAX-Prepaid-Tariff-Switching ATTRIBUTE WiMAX-Prepaid-Quota-Identifier 1 string ATTRIBUTE WiMAX-Volume-Used-After 2 integer #1k ATTRIBUTE WiMAX-Tariff-Switch-Interval 3 integer #s ATTRIBUTE WiMAX-Time-Interval-After 4 integer #s END-TLV WiMAX-Prepaid-Tariff-Switching ATTRIBUTE WiMAX-Active-Time-Duration 39 integer ATTRIBUTE WiMAX-DHCP-RK 40 octets encrypt=2 ATTRIBUTE WiMAX-DHCP-RK-Key-Id 41 integer ATTRIBUTE WiMAX-DHCP-RK-Lifetime 42 integer ATTRIBUTE WiMAX-DHCP-Msg-Server-IP 43 ipaddr ATTRIBUTE WiMAX-Idle-Mode-Transition 44 byte ATTRIBUTE WiMAX-NAP-Id 45 octets # 3 octets of NAP Id # 3 octets of base-station Id ATTRIBUTE WiMAX-BS-Id 46 octets ATTRIBUTE WiMAX-Location 47 octets # Number of times Acct-Input-Packets rolled over 2^32. ATTRIBUTE WiMAX-Acct-Input-Packets-Gigaword 48 integer ATTRIBUTE WiMAX-Acct-Output-Packets-Gigaword 49 integer # Formatted as per IP Filter rule specification. ATTRIBUTE WiMAX-Uplink-Flow-Description 50 string ATTRIBUTE WiMAX-BU-CoA-IPv6 51 ipv6addr # Updated ATTRIBUTE WiMAX-DNS-Server 52 combo-ip ATTRIBUTE WiMAX-Hotline-Profile-Id 53 string # Formatted as per IP Filter rule specification. ATTRIBUTE WiMAX-HTTP-Redirection-Rule 54 string # Formatted as per IP Filter rule specification. ATTRIBUTE WiMAX-IP-Redirection-Rule 55 string ATTRIBUTE WiMAX-Hotline-Session-Timer 56 integer # 3 octets ATTRIBUTE WiMAX-NSP-Id 57 octets # WiMAX-HA-RK-Requested has been removed from WMF Release 1.3 and later. # However the attribute has not been replaced so this is left to preserve # backward compatibility. This attribute is deprecated and will be removed. ATTRIBUTE WiMAX-HA-RK-Key-Requested 58 integer VALUE WiMAX-HA-RK-Key-Requested No 0 VALUE WiMAX-HA-RK-Key-Requested Yes 1 ATTRIBUTE WiMAX-Count-Type 59 byte ATTRIBUTE WiMAX-DM-Action-Code 60 integer VALUE WiMAX-DM-Action-Code Deregister-MS 0 VALUE WiMAX-DM-Action-Code Suspend-MS-Traffic 1 VALUE WiMAX-DM-Action-Code Suspend-User-Traffic 2 VALUE WiMAX-DM-Action-Code Resume-Traffic 3 VALUE WiMAX-DM-Action-Code MS-Terminate 4 VALUE WiMAX-DM-Action-Code MS-Idle 5 VALUE WiMAX-DM-Action-Code MS-Completed-IPv6-Handover 6 VALUE WiMAX-DM-Action-Code BS-Sends-RES-Cmd 0xffff # FA-RK-SPI = SPI-CMIP4 = MIP-SPI ATTRIBUTE WiMAX-FA-RK-SPI 61 integer # Formatted as per IP Filter rule specification. ATTRIBUTE WiMAX-Downlink-Flow-Description 62 string # Same as QoS-Descriptor... used only in flow based accounting. ATTRIBUTE WiMAX-Downlink-Granted-QoS 63 tlv # More MIP keys, calculated as above... but in different packets. # In a roaming scenario both the vAAA and the hAAA can provide a HA # and related key context, as well as DHCP server information to the ASN-GW. # These attributes are used by the vCSN. ATTRIBUTE WiMAX-vHA-IP-MIP4 64 ipaddr ATTRIBUTE WiMAX-vHA-IP-MIP6 65 ipv6addr ATTRIBUTE WiMAX-vHA-MIP4-Key 66 octets encrypt=2 ATTRIBUTE WiMAX-vHA-RK-Key 67 octets encrypt=2 ATTRIBUTE WiMAX-vHA-RK-SPI 68 integer ATTRIBUTE WiMAX-vHA-RK-Lifetime 69 integer ATTRIBUTE WiMAX-MN-vHA-MIP6-Key 70 octets encrypt=2 ATTRIBUTE WiMAX-MN-vHA-MIP4-SPI 71 integer ATTRIBUTE WiMAX-MN-vHA-MIP6-SPI 72 integer ATTRIBUTE WiMAX-vDHCPv4-Server 73 ipaddr ATTRIBUTE WiMAX-vDHCPv6-Server 74 ipv6addr ATTRIBUTE WiMAX-vDHCP-RK 75 octets encrypt=2 ATTRIBUTE WiMAX-vDHCP-RK-Key-ID 76 integer ATTRIBUTE WiMAX-vDHCP-RK-Lifetime 77 integer # About 10 more attributes in 1.3 END-VENDOR WiMAX freeradius-server/share/dictionary.wispr000066400000000000000000000017321257552170400210630ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2011 The FreeRADIUS Server project and contributors # # dictionary.wispr # # VSAs originally by # "James Underwood" # # Version: $Id$ # # For documentation on WISPr RADIUS attributes, see: # # Wi-Fi Alliance - Wireless ISP Roaming - Best Current Practices v1, # Feb 2003, p 14 # # http://www.weca.net/OpenSection/downloads/WISPr_V1.0.pdf VENDOR WISPr 14122 # # Standard attribute # BEGIN-VENDOR WISPr ATTRIBUTE WISPr-Location-ID 1 string ATTRIBUTE WISPr-Location-Name 2 string ATTRIBUTE WISPr-Logoff-URL 3 string ATTRIBUTE WISPr-Redirection-URL 4 string ATTRIBUTE WISPr-Bandwidth-Min-Up 5 integer ATTRIBUTE WISPr-Bandwidth-Min-Down 6 integer ATTRIBUTE WISPr-Bandwidth-Max-Up 7 integer ATTRIBUTE WISPr-Bandwidth-Max-Down 8 integer ATTRIBUTE WISPr-Session-Terminate-Time 9 string ATTRIBUTE WISPr-Session-Terminate-End-Of-Day 10 string ATTRIBUTE WISPr-Billing-Class-Of-Service 11 string END-VENDOR WISPr freeradius-server/share/dictionary.xedia000066400000000000000000000014161257552170400210100ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2011 The FreeRADIUS Server project and contributors ############################################################################## # # XEDIA, AP series routers # From Yard RADIUS, and Piotr Orlewicz, porlewicz@teleton.pl www.real-data.pl # # $Id$ # ############################################################################# VENDOR Xedia 838 BEGIN-VENDOR Xedia ATTRIBUTE Xedia-DNS-Server 1 ipaddr ATTRIBUTE Xedia-NetBios-Server 2 ipaddr ATTRIBUTE Xedia-Address-Pool 3 string ATTRIBUTE Xedia-PPP-Echo-Interval 4 integer ATTRIBUTE Xedia-SSH-Privileges 5 integer ATTRIBUTE Xedia-Client-Access-Network 6 string ATTRIBUTE Xedia-Client-Firewall-Setting 7 integer ATTRIBUTE Xedia-Save-Password 8 integer END-VENDOR Xedia freeradius-server/share/dictionary.xylan000066400000000000000000000024041257552170400210470ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2011 The FreeRADIUS Server project and contributors ############################################################################## # # Xylan dictionary # # $Id$ # ############################################################################## VENDOR Xylan 800 BEGIN-VENDOR Xylan ATTRIBUTE Xylan-Auth-Group 1 integer ATTRIBUTE Xylan-Slot-Port 2 string ATTRIBUTE Xylan-Time-of-Day 3 string ATTRIBUTE Xylan-Client-IP-Addr 4 ipaddr ATTRIBUTE Xylan-Group-Desc 5 string ATTRIBUTE Xylan-Port-Desc 6 string ATTRIBUTE Xylan-Profil-Numb 7 integer ATTRIBUTE Xylan-Auth-Group-Protocol 8 string ATTRIBUTE Xylan-Asa-Access 9 string ATTRIBUTE Xylan-Access-Priv 16 integer ATTRIBUTE Xylan-Acce-Priv-R1 33 octets ATTRIBUTE Xylan-Acce-Priv-R2 34 octets ATTRIBUTE Xylan-Acce-Priv-W1 35 octets ATTRIBUTE Xylan-Acce-Priv-W2 36 octets ATTRIBUTE Xylan-Acce-Priv-G1 37 octets ATTRIBUTE Xylan-Acce-Priv-G2 38 octets ATTRIBUTE Xylan-Acce-Priv-F-R1 39 octets ATTRIBUTE Xylan-Acce-Priv-F-R2 40 octets ATTRIBUTE Xylan-Acce-Priv-F-W1 41 octets ATTRIBUTE Xylan-Acce-Priv-F-W2 42 octets VALUE Xylan-Access-Priv Xylan-Read-Priv 1 VALUE Xylan-Access-Priv Xylan-Write-Priv 2 VALUE Xylan-Access-Priv Xylan-Admin-Priv 3 END-VENDOR Xylan freeradius-server/share/dictionary.zeus000066400000000000000000000003121257552170400206760ustar00rootroot00000000000000# dictionary.zeus # Zeus Packet RADIUS Dictionary # # http://www.zeus.com # # VENDOR Zeus 7146 BEGIN-VENDOR Zeus # # ZXTM Group Attributes # ATTRIBUTE Zeus-ZXTM-Group 1 string END-VENDOR Zeus freeradius-server/share/dictionary.zte000066400000000000000000000047221257552170400205230ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2014 The FreeRADIUS Server project and contributors # # For ZTE. # # $Id$ # # QoS attributes Mostly derived from: # http://wwwen.zte.com.cn/en/products/bearer/201308/P020130828522349526032.pdf # VENDOR ZTE 3902 BEGIN-VENDOR ZTE ATTRIBUTE ZTE-Client-DNS-Pri 1 integer ATTRIBUTE ZTE-Client-DNS-Sec 2 integer ATTRIBUTE ZTE-Context-Name 4 string ATTRIBUTE ZTE-Tunnel-Max-Sessions 21 integer ATTRIBUTE ZTE-Tunnel-Max-Tunnels 22 integer ATTRIBUTE ZTE-Tunnel-Window 24 integer ATTRIBUTE ZTE-Tunnel-Retransmit 25 integer ATTRIBUTE ZTE-Tunnel-Cmd-Timeout 26 integer ATTRIBUTE ZTE-PPPOE-URL 27 string ATTRIBUTE ZTE-PPPOE-MOTM 28 string ATTRIBUTE ZTE-Tunnel-Algorithm 31 integer ATTRIBUTE ZTE-Tunnel-Deadtime 32 integer ATTRIBUTE ZTE-Mcast-Send 33 integer ATTRIBUTE ZTE-Mcast-Receive 34 integer ATTRIBUTE ZTE-Mcast-MaxGroups 35 integer ATTRIBUTE ZTE-Access-Type 74 integer ATTRIBUTE ZTE-QoS-Type 81 integer ATTRIBUTE ZTE-QoS-Profile-Down 82 string ATTRIBUTE ZTE-Rate-Ctrl-SCR-Down 83 integer ATTRIBUTE ZTE-Rate-Ctrl-Burst-Down 84 integer ATTRIBUTE ZTE-Rate-Ctrl-PCR 86 integer ATTRIBUTE ZTE-TCP-Syn-Rate 88 integer ATTRIBUTE ZTE-Rate-Ctrl-SCR-Up 89 integer ATTRIBUTE ZTE-Priority-Level 90 integer ATTRIBUTE ZTE-Rate-Ctrl-Burst-Up 91 integer ATTRIBUTE ZTE-Rate-Ctrl-Burst-Max-Down 92 integer ATTRIBUTE ZTE-Rate-Ctrl-Burst-Max-Up 93 integer ATTRIBUTE ZTE-QOS-Profile-Up 94 string ATTRIBUTE ZTE-TCP-Limit-Num 95 integer ATTRIBUTE ZTE-TCP-Limit-Mode 96 integer ATTRIBUTE ZTE-IGMP-Service-Profile-Num 97 integer ATTRIBUTE ZTE-PPP-Sservice-Type 101 integer ATTRIBUTE ZTE-Access-Domain 151 string ATTRIBUTE ZTE-VPN-ID 190 string # 0 (lowest) - 15 (highest) privilege level #ATTRIBUTE ZTE-SW-Privilege 191 integer ATTRIBUTE ZTE_Rate-Bust-DPIR 191 integer ATTRIBUTE ZTE_Rate-Bust-UPIR 192 integer ATTRIBUTE ZTE-Rate-Ctrl-PBS-Down 202 integer ATTRIBUTE ZTE-Rate-Ctrl-PBS-Up 203 integer ATTRIBUTE ZTE-Rate-Ctrl-SCR-Up-v6 228 integer ATTRIBUTE ZTE-Rate-Ctrl-Burst-Up-v6 229 integer ATTRIBUTE ZTE-Rate-Ctrl-Burst-Max-Up-v6 230 integer ATTRIBUTE ZTE-Rate-Ctrl-PBS-Up-v6 231 integer ATTRIBUTE ZTE-QoS-Profile-Up-v6 232 string ATTRIBUTE ZTE-Rate-Ctrl-SCR-Down-v6 233 integer ATTRIBUTE ZTE-Rate-Ctrl-Burst-Down-v6 234 integer ATTRIBUTE ZTE-Rate-Ctrl-Burst-Max-Down-v6 235 integer ATTRIBUTE ZTE-Rate-Ctrl-PBS-Down-v6 236 integer ATTRIBUTE ZTE-QoS-Profile-Down-v6 237 string END-VENDOR ZTE freeradius-server/share/dictionary.zyxel000066400000000000000000000013221257552170400210650ustar00rootroot00000000000000# -*- text -*- # Copyright (C) 2011 The FreeRADIUS Server project and contributors ############################################################################## # # Zyxel attributes, of course in the RFC space... # # $Id$ # ############################################################################## VENDOR Zyxel 890 BEGIN-VENDOR Zyxel ATTRIBUTE Zyxel-Privilege-AVPair 3 string ATTRIBUTE Zyxel-Callback-Option 192 integer ATTRIBUTE Zyxel-Callback-Phone-Source 193 integer VALUE Zyxel-Callback-Phone-Source Preconfigured 0 VALUE Zyxel-Callback-Phone-Source User 1 VALUE Zyxel-Callback-Option None 0 VALUE Zyxel-Callback-Option Optional 1 VALUE Zyxel-Callback-Option Mandatory 2 END-VENDOR Zyxel freeradius-server/share/format.pl000077500000000000000000000105711257552170400174610ustar00rootroot00000000000000#!/usr/bin/env perl # # Format the dictionaries according to a standard scheme. # # Usage: cat dictionary | ./format.pl > new # # We don't over-write the dictionaries in place, so that the process # can be double-checked by hand. # # This is a bit of a hack. # # FIXME: get lengths from variables, rather than hard-coding. # ###################################################################### # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA # # Copyright (C) 2010 Alan DeKok # ###################################################################### # # $Id$ # $begin_vendor = 0; $blank = 0; while (@ARGV) { $filename = shift; open FILE, "<$filename" or die "Failed to open $filename: $!\n"; @output = (); while () { # # Clear out trailing whitespace # s/[ \t]+$//; # # And CR's # s/\r//g; # # Suppress multiple blank lines # if (/^\s+$/) { next if ($blank == 1); $blank = 1; push @output, "\n"; next; } $blank = 0; s/\s*$/\n/; # # Remember the vendor # if (/^VENDOR\s+([\w-]+)\s+(\w+)(.*)/) { $name=$1; $len = length $name; if ($len < 32) { $lenx = 32 - $len; $lenx += 7; # round up $lenx /= 8; $lenx = int $lenx; $tabs = "\t" x $lenx; } else { $tabs = " "; } push @output, "VENDOR\t\t$name$tabs$2$3\n"; $vendor = $name; next; } # # Remember if we did begin-vendor. # if (/^BEGIN-VENDOR\s+([\w-]+)/) { $begin_vendor = 1; if (!defined $vendor) { $vendor = $1; } elsif ($vendor ne $1) { # do something smart } push @output, "BEGIN-VENDOR\t$vendor\n"; next; } # # Get attribute. # if (/^ATTRIBUTE\s+([\w-]+)\s+(\w+)\s+(\w+)(.*)/) { $name=$1; $len = length $name; if ($len < 40) { $lenx = 40 - $len; $lenx += 7; # round up $lenx /= 8; $lenx = int $lenx; $tabs = "\t" x $lenx; if ($tabs eq "") { $tabs = " "; } } else { $tabs = " "; } $value = $2; $type = $3; $stuff = $4; # # See if it's old format, with the vendor at the end of # the line. If so, make it the new format. # if ($stuff =~ /$vendor/) { if ($begin_vendor == 0) { push @output, "BEGIN-VENDOR\t$vendor\n\n"; $begin_vendor = 1; } $stuff =~ s/$vendor//; $stuff =~ s/\s+$//; } push @output, "ATTRIBUTE\t$name$tabs$value\t$type$stuff\n"; next; } # # Values. # if (/^VALUE\s+([\w-]+)\s+([\w-\/,.]+)\s+(\w+)(.*)/) { $attr=$1; $len = length $attr; if ($len < 32) { $lenx = 32 - $len; $lenx += 7; # round up $lenx /= 8; $lenx = int $lenx; $tabsa = "\t" x $lenx; if ($tabsa eq "") { $tabsa = " "; $len += 1; } else { $len -= $len % 8; $len += 8 * length $tabsa; } } else { $tabsa = " "; $len += 1; } # # For the code below, we assume that the attribute lengths # if ($len < 32) { $lena = 0; } else { $lena = $len - 32; } $name = $2; $len = length $name; if ($len < 24) { $lenx = 24 - $lena - $len; $lenx += 7; # round up $lenx /= 8; $lenx = int $lenx; $tabsn = "\t" x $lenx; if ($tabsn eq "") { $tabsn = " "; } } else { $tabsn = " "; } push @output, "VALUE\t$attr$tabsa$name$tabsn$3$4\n"; next; } # # Remember if we did this. # if (/^END-VENDOR/) { $begin_vendor = 0; } # # Everything else gets dumped out as-is. # push @output, $_; } # # If we changed the format, print the end vendor, too. # if ($begin_vendor) { push @output, "\nEND-VENDOR\t$vendor\n"; } close FILE; open FILE, ">$filename" or die "Failed to open $filename: $!\n"; print FILE @output; close FILE; } freeradius-server/src/000077500000000000000000000000001257552170400153125ustar00rootroot00000000000000freeradius-server/src/.gitignore000066400000000000000000000000211257552170400172730ustar00rootroot00000000000000freeradius-devel freeradius-server/src/LICENSE.openssl000066400000000000000000000013621257552170400200030ustar00rootroot00000000000000This LICENSE file is a modification to the main LICENSE file, which is GPLv2. It applies only to the files in the "src" directory. In addition, as a special exception, the copyright holders give permission to link the code of this program with the OpenSSL library, and distribute linked combinations including the two. You must obey the GNU General Public License in all respects for all of the code used other than OpenSSL. If you modify file(s) with this exception, you may extend this exception to your version of the file(s), but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. If you delete this exception statement from all source files in the program, then also delete it here. freeradius-server/src/Makefile000066400000000000000000000012251257552170400167520ustar00rootroot00000000000000# # Makefile # # Version: $Id$ # include ../Make.inc SUBDIRS = include lib modules main WHAT_TO_MAKE = all .PHONY: all clean install reconfig all: freeradius-devel @$(MAKE) $(MFLAGS) WHAT_TO_MAKE=$@ common clean: @$(MAKE) $(MFLAGS) WHAT_TO_MAKE=$@ common @rm -f include/*~ *~ install: @$(MAKE) $(MFLAGS) WHAT_TO_MAKE=$@ common reconfig: @$(MAKE) $(MFLAGS) WHAT_TO_MAKE=$@ common .PHONY: common $(SUBDIRS) # # Ensure correct build order lib: include modules: lib main: modules common: $(SUBDIRS) $(SUBDIRS): @echo "Making $(WHAT_TO_MAKE) in $@..." $(MAKE) $(MFLAGS) -C $@ $(WHAT_TO_MAKE) freeradius-devel: ln -sf include freeradius-devel freeradius-server/src/billing/000077500000000000000000000000001257552170400167325ustar00rootroot00000000000000freeradius-server/src/billing/README000066400000000000000000000071211257552170400176130ustar00rootroot00000000000000$Id$ VOIP ACCOUNTING WITH CISCO VSA INTRODUCTION Cisco VoIP gateways can use radius accounting to log call records, however FreeRadius in it's default configuration is not very well suited to the job as the default database config is designed with standard dial-up ISP Authentication and Post billing in mind. The typical configuration on FreeRadius with a MySQL backend will not handle the load of accounting for multiple Cisco gateways under full utilisation. The default database config also thows away all non-standard RADIUS attributes which infact contains alot of highly useful information pertinent to VoIP. The good news is that with a few modifications to the configuration files and the use of Postgresql (or another heavy duty SQL server) insead of MySQL FreeRadius can be made into a reliable, flexible and scalable (and free!) billing solution for VoIP providors. MySQL cannot be used as the configuration relies on the connect and disconnect time as reported by the Cisco gatways (Cisco VSA attributes "h323-connect-time" and "h323-disconnect-time") and MySQL limited date handling does not recognise full Cisco date stamps time as a valid "datetime". (While Oracle and possibly some other high end DBs should support Cisco time format they have not been tested at this time). MySQL could possibly be supported in future but it would require extra pre-processing by a FreeRADIUS module to do so and there is no plan currently to impliment this, although working code that impliments this would be happily accepted. This reliance on VSA records REQUIRES that all cisco devices be configured to send VSA attributes. This system is not known to work with any non-cisco equipment, although it is theoretically possible for non-cisco equipment to impliment Cisco VSA attributes... This is required as the default FreeRadius SQL configuration (where RADIUS "Start" records are INSERTed into the database, and then UPDATEd with information from the associated "Stop" record) does not scale as well as this solution which strictly uses INSERTs. As call start and stop times are not contained in "standard" radius attributes (They are added/updated by FreeRadius when the record is logged in the default configuration.) This REQUIRES all equipment be kept is timesync with the use on NTP otherwise similtaneous records from different gateways may have differing timestamps. CONFIGURATION * Install and configure FreeRadius as appropriate for your system. * Test that FreeRadius is recieving accounting records from your gateway. Do not proceed until you are certain this is working. * Configure all the NASes to send VSA attributes. On older Ciscos use one of the following commands (depending if you are using SIP or H323): "gw-accounting h323 vsa" "gw-accounting sip vsa" On Ciscos with newer versions of IOS need both of the following commands: "gw-accounting aaa" "radius-server vsa send" * Create a Database to hold your billing records. ie: "createdb radius" * Import the SQL schema to your database. ie: "psql radius < cisco_h323_db_schema-postgres.sql" * In /etc/raddb/radiusd.conf set "with_cisco_vsa_hack = yes" * In /etc/raddb/radiusd.conf add "$INCLUDE ${confdir}/pgsql-voip.conf" (You can find the correct section by searching for "sql.conf") * In /etc/raddb/radiusd.conf add "pgsql-voip" to the "accounting { }" section. * (re)Start radiusd If you wish to do RADIUS SQL Authentication using the same database, you must use src/modules/rlm_sql/drivers/rlm_sql_postgresql/db_postgresql.sql as well as this schema. This is left as an excercise for the reader. -- Peter Nixon [ codemonkey@peternixon.net ] freeradius-server/src/billing/cisco_h323_db_sample_functions-postgres.sql000066400000000000000000000233001257552170400272520ustar00rootroot00000000000000-- $Id$ -- create plpgsql language CREATE FUNCTION "plpgsql_call_handler" () RETURNS LANGUAGE_HANDLER AS '$libdir/plpgsql' LANGUAGE C; CREATE TRUSTED LANGUAGE "plpgsql" HANDLER "plpgsql_call_handler"; CREATE OR REPLACE FUNCTION chop_number(VARCHAR) RETURNS VARCHAR AS ' DECLARE original_number ALIAS FOR $1; new_number VARCHAR; BEGIN new_number := split_part(original_number,''#'',2); IF new_number = '''' THEN RETURN original_number; ELSE RETURN new_number; END IF; END; ' LANGUAGE 'plpgsql'; CREATE OR REPLACE FUNCTION chop_number_country(VARCHAR) RETURNS VARCHAR AS ' DECLARE original_number ALIAS FOR $1; new_number VARCHAR; clean_number VARCHAR; BEGIN new_number := split_part(original_number,''#'',2); IF new_number = '''' THEN clean_number := original_number; ELSE clean_number := new_number; END IF; IF substring(clean_number from 1 for 2) = ''00'' THEN RETURN substring(clean_number from 3 for 2); ELSIF substring(clean_number from 1 for 1) = ''0'' THEN RETURN ''''; ELSE RETURN substring(clean_number from 1 for 2); END IF; END; ' LANGUAGE 'plpgsql'; CREATE OR REPLACE FUNCTION chop_number_city(VARCHAR) RETURNS VARCHAR AS ' DECLARE original_number ALIAS FOR $1; new_number VARCHAR; clean_number VARCHAR; BEGIN new_number := split_part(original_number,''#'',2); IF new_number = '''' THEN clean_number := original_number; ELSE clean_number := new_number; END IF; IF substring(clean_number from 1 for 2) = ''00'' THEN RETURN substring(clean_number from 5 for 3); ELSIF substring(clean_number from 1 for 1) = ''0'' THEN RETURN substring(clean_number from 2 for 3); ELSE RETURN substring(clean_number from 3 for 3); END IF; END; ' LANGUAGE 'plpgsql'; CREATE OR REPLACE FUNCTION chop_number_number(VARCHAR) RETURNS VARCHAR AS ' DECLARE original_number ALIAS FOR $1; new_number VARCHAR; clean_number VARCHAR; BEGIN new_number := split_part(original_number,''#'',2); IF new_number = '''' THEN clean_number := original_number; ELSE clean_number := new_number; END IF; IF substring(clean_number from 1 for 2) = ''00'' THEN RETURN substring(clean_number from 8 for 11); ELSIF substring(clean_number from 1 for 1) = ''0'' THEN RETURN substring(clean_number from 5 for 11); ELSE RETURN substring(clean_number from 6 for 11); END IF END; ' LANGUAGE 'plpgsql'; -- Some sample database VIEWs to simplify billing queries. CREATE OR REPLACE VIEW StartVoIPd AS SELECT DISTINCT ON(h323SetupTime, CallID) * FROM StartVoIP; CREATE OR REPLACE VIEW StopVoIPd AS SELECT DISTINCT ON(h323SetupTime, CallID) * FROM StopVoIP; CREATE OR REPLACE VIEW call_history_csps2 AS SELECT StartVoIP.h323ConnectTime, StopVoIP.h323DisconnectTime, (EXTRACT(EPOCH FROM(StopVoIP.h323DisconnectTime - StartVoIP.h323ConnectTime)))::BIGINT AS CallLength, StopVoIP.CalledStationId AS Number, StopVoIP.UserName AS UserName, StopVoIP.CallingStationId AS CallerID, StopVoIP.CallID FROM StopVoIPd AS StopVoIP LEFT OUTER JOIN StartVoIPd AS StartVoIP ON (StopVoIP.CallID = StartVoIP.CallID) WHERE StopVoIP.NASIPAddress = '212.50.54.122' ORDER BY StartVoIP.h323ConnectTime; CREATE OR REPLACE VIEW call_history_csps AS SELECT CAST ((h323DisconnectTime::date AT TIME ZONE 'UTC') AS date) AS Date, CAST ((h323DisconnectTime AT TIME ZONE 'UTC') AS time without time zone) AS Time, AcctSessionTime AS Length, CalledStationId AS Number, UserName AS UserName, CallingStationId AS CallerID, CallID FROM StopVoIP WHERE NASIPAddress = '212.50.54.122'; CREATE OR REPLACE VIEW call_history AS SELECT CAST ((h323SetupTime::date AT TIME ZONE 'UTC') AS date) AS Date, CAST ((h323SetupTime AT TIME ZONE 'UTC') AS time without time zone) AS Time, AcctSessionTime AS Length, CalledStationId AS Number, UserName AS UserName, CallingStationId AS CallerID, H323RemoteAddress, NASIPAddress, CallID FROM StopVoIP; CREATE OR REPLACE VIEW call_history AS SELECT CAST ((pots.h323SetupTime::date AT TIME ZONE 'UTC') AS date) AS Date, CAST ((pots.h323SetupTime AT TIME ZONE 'UTC') AS time without time zone) AS Time, pots.AcctSessionTime AS Length, pots.CalledStationId AS Number, ip.H323RemoteAddress AS cust_ip, ip.NASIPAddress AS gw_ip FROM StopTelephony AS pots LEFT OUTER JOIN StopVoIP AS ip ON (pots.CallID = ip.CallID); CREATE OR REPLACE VIEW call_history_customer AS SELECT Date, Time, Length, Number, cust_ip, gw_ip, CustomerIP.Company AS Company FROM call_history LEFT OUTER JOIN customerip ON (call_history.cust_ip = CustomerIP.IpAddr); CREATE OR REPLACE VIEW customerip AS SELECT gw.cust_gw AS IpAddr, cust.company AS Company, cust.customer AS Customer, gw.location AS Location FROM customers AS cust, cust_gw AS gw WHERE cust.cust_id = gw.cust_id; CREATE OR REPLACE VIEW VoIP AS SELECT RadAcctId AS ID, NASIPAddress AS GWIP, AcctSessionTime AS Call_Seconds, chop_number_country(CalledStationId) AS Country, chop_number_city(CalledStationId) AS City,chop_number_number(CalledStationId) AS Number, chop_number(CalledStationId) AS Original_Number, EXTRACT(YEAR FROM (h323setuptime AT TIME ZONE 'UTC')) AS Year, EXTRACT(MONTH FROM (h323setuptime AT TIME ZONE 'UTC')) AS Month, EXTRACT(DAY FROM (h323setuptime AT TIME ZONE 'UTC')) AS Day, CAST ((h323SetupTime AT TIME ZONE 'UTC') AS time without time zone) AS Time, h323DisconnectCause AS error_code, H323RemoteAddress AS Remote_IP, CallID FROM StopVoIP; CREATE OR REPLACE VIEW Telephony AS SELECT RadAcctId AS ID, NASIPAddress AS GWIP, AcctSessionTime AS Call_Seconds, chop_number_country(CalledStationId) AS Country, chop_number_city(CalledStationId) AS City,chop_number_number(CalledStationId) AS Number, chop_number(CalledStationId) AS Original_Number, EXTRACT(YEAR FROM (h323setuptime AT TIME ZONE 'UTC')) AS Year, EXTRACT(MONTH FROM (h323setuptime AT TIME ZONE 'UTC')) AS Month, EXTRACT(DAY FROM (h323setuptime AT TIME ZONE 'UTC')) AS Day, CAST ((h323SetupTime AT TIME ZONE 'UTC') AS time without time zone) AS Time, h323DisconnectCause AS error_code, split_part(split_part(CiscoNASPort,':',1),' ',2) AS PRI, split_part(CiscoNASPort,':',3) AS PRI_channel, CiscoNASPort AS isdn_port, CallID AS ConfID FROM StopTelephony; CREATE OR REPLACE VIEW calls AS SELECT Date, Time, Length, Number, cust_ip, gw_ip FROM call_history WHERE Length > 0 ORDER BY Date, Time, Number, Length, cust_ip ASC; CREATE OR REPLACE VIEW call_history_daily AS SELECT pots.h323ConnectTime, pots.AcctSessionTime, pots.CalledStationId, ip.H323RemoteAddress, pots.NASIPAddress FROM StopTelephony AS pots, StopVoIP AS ip WHERE pots.h323connecttime BETWEEN DATE'YESTERDAY' AND DATE'TODAY' AND pots.h323ConfID = ip.h323ConfID ORDER BY h323ConnectTime, CalledStationId ASC; CREATE OR REPLACE VIEW call_errors AS SELECT pots.h323ConnectTime, pots.AcctSessionTime, pots.CalledStationId, ip.H323RemoteAddress, pots.NASIPAddress FROM StopTelephony AS pots, StopVoIP AS ip WHERE pots.h323ConfID = ip.h323ConfID AND ip.h323disconnectcause <> 0 AND ip.h323disconnectcause <> 10 AND ip.h323disconnectcause <> 11 AND ip.h323disconnectcause <> 13 ORDER BY H323ConnectTime, CalledStationId, H323RemoteAddress ASC; CREATE OR REPLACE FUNCTION VoIPInsertRecord(StopVoIP.UserName%TYPE, StopVoIP.NASIPAddress%TYPE, StopVoIP.AcctSessionTime%TYPE, StopVoIP.AcctInputOctets%TYPE, StopVoIP.AcctOutputOctets%TYPE, StopVoIP.CalledStationId%TYPE, StopVoIP.CallingStationId%TYPE, StopVoIP.AcctDelayTime%TYPE, StopVoIP.h323CallOrigin%TYPE, StopVoIP.h323SetupTime%TYPE, StopVoIP.h323ConnectTime%TYPE, StopVoIP.h323DisconnectTime%TYPE, StopVoIP.h323DisconnectCause%TYPE, StopVoIP.H323RemoteAddress%TYPE, StopVoIP.H323VoiceQuality%TYPE, StopVoIP.h323ConfID%TYPE) RETURNS BOOLEAN AS ' DECLARE key1 ALIAS FOR $10; key2 ALIAS FOR $2; key3 ALIAS FOR $16; BEGIN PERFORM radacctid FROM StopVoIP WHERE h323SetupTime = $10 AND NASIPAddress = $2 AND CallID = $16; IF NOT FOUND THEN INSERT into StopVoIP ( UserName, NASIPAddress, AcctSessionTime, AcctInputOctets, AcctOutputOctets, CalledStationId, CallingStationId, AcctDelayTime, h323callorigin, h323setuptime, h323connecttime, h323disconnecttime, h323disconnectcause, H323RemoteAddress, h323voicequality, CallID) VALUES($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16); RETURN true; END IF; RETURN false; END; ' LANGUAGE 'plpgsql'; CREATE OR REPLACE FUNCTION TelephonyInsertRecord(StopTelephony.UserName%TYPE, StopTelephony.NASIPAddress%TYPE, StopTelephony.AcctSessionTime%TYPE, StopTelephony.AcctInputOctets%TYPE, StopTelephony.AcctOutputOctets%TYPE, StopTelephony.CalledStationId%TYPE, StopTelephony.CallingStationId%TYPE, StopTelephony.AcctDelayTime%TYPE, StopTelephony.CiscoNASPort%TYPE, StopTelephony.h323CallOrigin%TYPE, StopTelephony.h323SetupTime%TYPE, StopTelephony.h323ConnectTime%TYPE, StopTelephony.h323DisconnectTime%TYPE, StopTelephony.h323DisconnectCause%TYPE, StopTelephony.H323VoiceQuality%TYPE, StopTelephony.CallID%TYPE) RETURNS BOOLEAN AS ' DECLARE BEGIN PERFORM radacctid FROM StopTelephony WHERE h323SetupTime = $11 AND NASIPAddress = $2 AND CallID = $16; IF NOT FOUND THEN INSERT into StopTelephony ( UserName, NASIPAddress, AcctSessionTime, AcctInputOctets, AcctOutputOctets, CalledStationId, CallingStationId, AcctDelayTime, CiscoNASPort, h323callorigin, h323setuptime, h323connecttime, h323disconnecttime, h323disconnectcause, h323voicequality, CallID) VALUES($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16); RETURN true; END IF; RETURN false; END; ' LANGUAGE 'plpgsql'; freeradius-server/src/billing/clarent2db.pl000077500000000000000000000275071257552170400213250ustar00rootroot00000000000000#!/usr/bin/perl # # syslog2db - Extract Clarent VoIP CDRs from billing_record files and # insert them into a Postgresql database. # # Author: Peter Nixon # Date: 2003-05-07 # Summary: Clarent, VoIP, CDR, database, postgresql # Copyright: 2002, Peter Nixon # Copy Policy: Free to copy and distribute provided all headers are left # intact and no charge is made for this program. I would # appreciate copies of any modifications to the script. # URL: http://www.peternixon.net/code/ # # $Id$ # Modules we use to make things easier use POSIX; require DBI; require Getopt::Long; use Carp; #use Symbol; #use Time::Local; #use strict; # Errrm. That looks like effort :-) # Program and File locations # gzcat - 'cat for .gz / gzip files' # If you don't have gzcat and do have gzip then use: ln gzip gzcat my $GZCAT = "/usr/bin/zcat"; # zcat - 'cat for .Z / compressed files' my $ZCAT = "/usr/bin/zcat"; # bzcat - 'cat for .bz2 files' my $BZCAT = "/usr/bin/bzcat"; #### You should not have to modify anything below here $| = 1; #Unbuffered output my $progname = "clarent2db.pl"; my $progname_long = "Clarent Billing Record to DB Importer"; my $version = 0.2; # Set up some basic variables my $double_match_no = 0; my $verbose = 0; my $recordno = 0; my $fileno = 0; my $lineno = 0; my $starttime = time(); # Database Information my $database = "clarent"; my $defaulthostname = "localhost"; my $port = "3306"; my $user = "postgres"; my $password = ""; # Defaults my $defaulttimezone = "UTC"; my $defaultyear = 2003; my $dbh; my %working_record = (); my %months_map = ( 'Jan' => '01', 'Feb' => '02', 'Mar' => '03', 'Apr' => '04', 'May' => '05', 'Jun' => '06', 'Jul' => '07', 'Aug' => '08', 'Sep' => '09', 'Oct' => '10', 'Nov' => '11', 'Dec' => '12', 'jan' => '01', 'feb' => '02', 'mar' => '03', 'apr' => '04', 'may' => '05', 'jun' => '06', 'jul' => '07', 'aug' => '08', 'sep' => '09', 'oct' => '10', 'nov' => '11', 'dec' => '12', ); sub db_connect { my $hostname = shift; if ($verbose > 1) { print "DEBUG: Connecting to Database Server: $hostname\n" } if ($hostname eq 'localhost') { if ($verbose > 1) { print "DEBUG: localhost connection so using UNIX socket instead of network socket.\n" } $dbh = DBI->connect("DBI:Pg:dbname=$database", "$user", "$password") or die "Couldn't connect to database: " . DBI->errstr; } else { $dbh = DBI->connect("DBI:Pg:dbname=$database;host=$hostname", "$user", "$password") or die "Couldn't connect to database: " . DBI->errstr; } } sub db_disconnect { ### Now, disconnect from the database if ($verbose > 1) { print "DEBUG: Disconnecting from Database Server\n" } $dbh->disconnect or warn "Disconnection failed: $DBI::errstr\n"; } sub db_read { $passno++; if ($verbose > 0) { print "Record: $passno) Conf ID: $working_record{h323confid} Start Time: $working_record{start_time} IP: $working_record{ip_addr_egress} Call Length: $working_record{duration}\n"; } my $sth = $dbh->prepare("SELECT ID FROM billing_record WHERE start_time = ? AND ip_addr_ingress = ? AND h323confid = ?") or die "Couldn't prepare statement: " . $dbh->errstr; my @data; $sth->execute($working_record{start_time}, $working_record{ip_addr_ingress}, $working_record{h323confid}) # Execute the query or die "Couldn't execute statement: " . $sth->errstr; my $returned_rows = $sth->rows; if ($sth->rows == 0) { &db_insert; } elsif ($sth->rows == 1) { if ($verbose > 0) { print "Exists in DB.\n"; } } else { $double_match_no++; # FIXME: Log this somewhere! print "********* More than One Match! We have a problem!\n"; } $sth->finish; } sub db_insert { $sth2 = $dbh->prepare("INSERT into billing_record (local_SetupTime, start_time, duration, service_code, phone_number, ip_addr_ingress, ip_addr_egress, bill_type, disconnect_reason, extended_reason_code, dialed_number, codec, h323ConfID, port_number) values(?,?,?,?,?,?,?,?,?,?,?,?,?,?)"); $sth2->execute($working_record{local_setuptime}, $working_record{start_time}, $working_record{duration}, $working_record{service_code}, $working_record{phone_number}, $working_record{ip_addr_ingress}, $working_record{ip_addr_egress}, $working_record{bill_type}, $working_record{disconnect_reason}, $working_record{extended_reason_code}, $working_record{dialed_number}, $working_record{codec}, $working_record{h323confid}, $working_record{port_number}); #my $returned_rows = $sth2->rows; if ($verbose > 0) { print "$sth2->rows rows added to DB\n"; } $sth2->finish(); } sub file_read { my $filename = shift; if ($verbose > 1) { print "DEBUG: Reading detail file: $filename\n" } if ( $filename =~ /.gz$/ ) { open (FILE, "$GZCAT $filename |") || warn "read_detailfile(\"$filename\"): $!\n"; } elsif ( $filename =~ /.Z$/ ) { open (FILE, "$ZCAT $filename |") || warn "read_detailfile(\"$filename\"): $!\n"; } elsif ( $filename =~ /.bz2$/ ) { open (FILE, "$BZCAT $filename |") || warn "read_detailfile(\"$filename\"): $!\n"; } else { open (FILE, "<$filename") || warn "read_detailfile(\"$filename\"): $!\n"; } $valid_input = (eof(FILE) ? 0 : 1); if ($verbose > 1) { print "DEBUG: Starting to read records from $filename\n"; } while($valid_input) { $valid_input = 0 if (eof(FILE)); if ($verbose > 2) { print "DEBUG: Reading Record\n"; } $_ = ; $lineno++; if ($verbose > 1) { print "DEBUG Raw Record: $_"; } #&record_mangle($_); &record_match($_); } } sub record_match($) { chomp($_); # Spilt the Call record up into fields my @callrecord = split(/,/, $_); if (scalar(@callrecord) == 70) { # Check that we have the right number of fields for a Clarent record if ($verbose > 1) { print "DEBUG: Clean Record: @callrecord\n"; } $recordno++; %working_record = (); $working_record{local_setuptime} = clarent2normaltime($callrecord[0]); $working_record{start_time} = $callrecord[3]; # This is in Unix timetamp format, relative to the originating gateway. # It is therefore useless unless ALL gateways are set with the same timezone, # so I don't bother to convert it to datetime format. $working_record{duration} = $callrecord[4]; $working_record{service_code} = $callrecord[5]; $working_record{phone_number} = $callrecord[6]; $working_record{ip_addr_ingress} = $callrecord[7]; $working_record{ip_addr_egress} = $callrecord[8]; $working_record{h323confid} = $callrecord[9]; $working_record{bill_type} = $callrecord[12]; $working_record{disconnect_reason} = $callrecord[15]; $working_record{extended_reason_code} = $callrecord[16]; $working_record{port_number} = $callrecord[21]; $working_record{dialed_number} = $callrecord[60]; $working_record{codec} = $callrecord[67]; &db_read; } else { if ($verbose > 1) { print "DEBUG: ERROR: Record is not in Clarent format: $str\n"; } } } sub clarent2normaltime($) { if ( /^ (\S{3})\/(\d+)\/(\d{4}) # Month Day Year \s (\d+):(\d+):(\d+) # Hour Min Sec \s (\d{4}) # msec?? \s \w*?:? # RESEND: (Discarded) \s? \S{1} # U (Discarded) FIXME: does anyone know what this value means?? /x ) { my $month = $months_map{$1}; defined $month or croak "ERROR: Unknown month \"$1\"\n"; my $days = $2; my $years = $3; my $hours = $4; my $minutes = $5; my $seconds = $6; return "$years-$month-$days $hours:$minutes:$seconds"; } else { if ($verbose > 0) { print "ERROR: Not in Clarent time format: $str\n"; } }; } sub print_usage_info { print "\n"; my $leader = "$progname_long Ver: $version Usage Information"; my $underbar = $leader; $underbar =~ s/./-/g; print "$leader\n$underbar\n"; print "\n"; print " Syntax: $progname [ options ] file\n"; print "\n"; print " -h --help Show this usage information\n"; print " -v --verbose Turn on verbose\n"; print " -x --debug Turn on debugging\n"; print " -V --version Show version and copyright\n"; print " -H --host Database host to connect to (Default: localhost)\n"; print "\n"; } sub main { # Parse the command line for options if (!scalar(@ARGV)) { &print_usage_info(); exit(SUCCESS); }; my $quiet = 0; # See the Getopt::Long man page for details on the syntax of this line @valid_opts = ("h|help", "V|version", "f|file=s", "x|debug", "v|verbose+" => \$verbose, "q|quiet+" => \$quiet, "D|date=s", "H|host=s", "p|procedure"); Getopt::Long::Configure("no_getopt_compat", "bundling", "no_ignore_case"); Getopt::Long::GetOptions(@valid_opts); # Post-parse the options stuff select STDOUT; $| = 1; if ($opt_V) { # Do not edit this variable. It is updated automatically by CVS when you commit my $rcs_info = 'CVS Revision $Revision$ created on $Date$ by $Author$ '; $rcs_info =~ s/\$\s*Revision: (\S+) \$/$1/; $rcs_info =~ s/\$\s*Date: (\S+) (\S+) \$/$1 at $2/; $rcs_info =~ s/\$\s*Author: (\S+) \$ /$1/; print "\n"; print "$progname Version $version by Peter Nixon \n"; print "Copyright (c) 2003 Peter Nixon\n"; print " ($rcs_info)\n"; print "\n"; return SUCCESS; } elsif ($opt_h) { &print_usage_info(); exit(SUCCESS); } if ($opt_x) { print "DEBUG: Debug mode is enabled.\n"; $verbose = 2; } elsif ($quiet) { $verbose -= $quiet; } if (@ARGV) { if ($opt_H) { &db_connect($opt_H); } else { &db_connect($defaulthostname); } if (scalar(@ARGV) > 1) { foreach $file (@ARGV) { # Loop through the defined files $fileno++; &file_read($file); } } else { $file = @ARGV[0]; &file_read($file); } if ($verbose >= 0) { my $runtime = (time() - $starttime); if ($runtime < 1) { $runtime = 0.5; } # Prevent divide-by-zero errors my $speed = ($recordno / $runtime); if ($fileno > 1) { print "\n$recordno records from $lineno lines in $fileno files were processed in ~$runtime seconds (~$speed records/sec)\n"; } else { print "\n$recordno records from $lineno lines in $file were processed in ~$runtime seconds (~$speed records/sec)\n"; } } &db_disconnect; } else { print "ERROR: Please specify one or more detail files to import.\n"; exit(FAILURE); } } exit &main(); freeradius-server/src/billing/clarent_db_schema-postgres.sql000066400000000000000000000014771257552170400247450ustar00rootroot00000000000000/* * Id: postgresql.conf,v 1.8.2.11 2003/07/15 11:15:43 pnixon Exp $ * * --- Peter Nixon [ codemonkey@peternixon.net ] * This is a custom SQL schema for doing Clarent VoIP accounting * Clarents don't support RADIUS but I use this along with the other * files in this directory to do billing so it can live here :-) * */ CREATE TABLE billing_record ( Id BIGSERIAL PRIMARY KEY, local_SetupTime timestamp, start_time NUMERIC(11), duration INTEGER, service_code CHAR(1), phone_number VARCHAR(24), ip_addr_ingress INET, ip_addr_egress INET, bill_type CHAR(1), disconnect_reason CHAR(2), extended_reason_code CHAR(2), dialed_number VARCHAR(30), port_number INTEGER, codec VARCHAR(20), h323ConfID VARCHAR(64) ); create UNIQUE index combo on billing_record (start_time, ip_addr_ingress, h323ConfID); freeradius-server/src/billing/h323detail2db.pl000077500000000000000000000437011257552170400215310ustar00rootroot00000000000000#!/usr/bin/perl # # Author: Peter Nixon # Summary: Extract information from Radius detail log and # compare/insert/update a Postgresql database. # Copy Policy: GNU Public Licence Version 2 # URL: http://www.peternixon.net/code/ # Supported: PostgreSQL (tested on version 7.2, 7.3, 7.4 and 8) and FreeRadius # Copyright: 2004 Peter Nixon http://www.petenixon.net # # This program is free software; you can redistribute it and/or modify # it under the terms of Version 2 of the GNU General Public License as # published by the Free Software Foundation. # # 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. # # $Id$ # # Modules that we use to get things done. require DBI; require Getopt::Long; ## Program and File locations # gzcat - 'cat for .gz / gzip files' # If you don't have gzcat and do have gzip then use: ln gzip gzcat $GZCAT = "/usr/bin/zcat"; # zcat - 'cat for .Z / compressed files' $ZCAT = "/usr/bin/zcat"; # bzcat - 'cat for .bz2 files' $BZCAT = "/usr/bin/bzcat"; # Default Variables $database = "radius"; $port = "3306"; $user = "postgres"; $password = ""; #### You should not have to modify anything below here $progname = "H323 Detail2DB"; $version = 2.2; # Set up some basic variables my $passno = 0; my $duplicates = 0; my $verbose = 0; my %duplicate_records = (); my $starttime = time(); sub db_connect { my $hostname = shift; if ($verbose > 1) { print "DEBUG: Connecting to Database Host: $hostname\n" } if ($hostname eq 'localhost') { if ($verbose > 1) { print "DEBUG: localhost connection so using UNIX socket instead of network socket.\n" } $dbh = DBI->connect("DBI:Pg:dbname=$database", "$user", "$password") or die "Couldn't connect to database: " . DBI->errstr; } else { $dbh = DBI->connect("DBI:Pg:dbname=$database;host=$hostname", "$user", "$password") or die "Couldn't connect to database: " . DBI->errstr; } } sub db_disconnect { my $hostname = shift; if ($verbose > 1) { print "DEBUG: Disconnecting from Database Host: $hostname\n" } $dbh->disconnect # Disconnect from the database or warn "Disconnection failed: $DBI::errstr\n"; } sub process_duplicates { if ($verbose > 1) { print "DEBUG: Now processing $duplicates duplicate records\n" } foreach my $a1 ( keys %duplicate_records ) { print "$a1:\n"; for my $a2 ( keys %{ $duplicate_records{$a1} } ) { print "\t$a2 = $duplicate_records{$a1}{$a2}\n"; } print "\n"; } } sub procedure_insert { # FIXME: Does not work with current SQL schema. Use standard method if ($verbose > 0) { print "Record: $passno) Conf ID: $h323_conf_id Setup Time: $h323_setup_time Call Length: $AcctSessionTime "; } if ($h323_call_type eq 'VoIP') { $sth2 = $dbh->prepare("SELECT VoIPInsertRecord('$UserName', '$NasIPAddress', '$AcctSessionTime', '$AcctInputOctets', '$AcctOutputOctets', '$Called_Station_Id', '$Calling_Station_Id', '$AcctDelayTime', '$h323_call_origin', '$h323_setup_time', '$h323_connect_time','$h323_disconnect_time', '$h323_disconnect_cause', (NULLIF('$h323_remote_address', '')::inet), '$h323_voice_quality', '$h323_conf_id')"); } elsif ($h323_call_type eq 'Telephony') { $sth2 = $dbh->prepare("SELECT TelephonyInsertRecord('$UserName', '$NasIPAddress', '$AcctSessionTime', '$AcctInputOctets', '$AcctOutputOctets', '$Called_Station_Id', '$Calling_Station_Id', '$AcctDelayTime', '$Cisco_NAS_Port', '$h323_call_origin', '$h323_setup_time', '$h323_connect_time','$h323_disconnect_time', '$h323_disconnect_cause', '$h323_voice_quality', '$h323_conf_id')"); } else { print "ERROR: Unsupported h323calltype \"$h323_call_type\"\n" } $sth2->execute(); if ($verbose > 0) { print "sent to DB\n"; } $sth2->finish(); } sub db_insert { if ($h323_call_type eq 'VoIP') { $sth2 = $dbh->prepare("INSERT into StopVoIP ( AcctTime, UserName, NASIPAddress, AcctSessionTime, AcctInputOctets, AcctOutputOctets, CalledStationId, CallingStationId, AcctDelayTime, H323RemoteAddress, h323gwid, h323callorigin, callid, h323connecttime, h323disconnectcause, h323disconnecttime, h323setuptime, h323voicequality) values(($Timestamp)::abstime, '$UserName', '$NasIPAddress', '$AcctSessionTime', '$AcctInputOctets', '$AcctOutputOctets', '$Called_Station_Id', '$Calling_Station_Id', '$AcctDelayTime', NULLIF('$h323_remote_address', '')::INET, '$h323_gw_id','$h323_call_origin', '$h323_conf_id', NULLIF('$h323_connect_time', '')::TIMESTAMPTZ, '$h323_disconnect_cause', NULLIF('$h323_disconnect_time', '')::TIMESTAMPTZ, NULLIF('$h323_setup_time', '')::TIMESTAMPTZ, NULLIF('$h323_voice_quality','')::INT4)"); } elsif ($h323_call_type eq 'Telephony') { $sth2 = $dbh->prepare("INSERT into StopTelephony ( AcctTime, UserName, NASIPAddress, AcctSessionTime, AcctInputOctets, AcctOutputOctets, CalledStationId, CallingStationId, AcctDelayTime, CiscoNASPort, h323callorigin, callid, h323connecttime, h323disconnectcause, h323disconnecttime, h323setuptime, h323voicequality) values(($Timestamp)::abstime, '$UserName', '$NasIPAddress', '$AcctSessionTime', '$AcctInputOctets', '$AcctOutputOctets', '$Called_Station_Id', '$Calling_Station_Id', '$AcctDelayTime', '$Cisco_NAS_Port', '$h323_call_origin', '$h323_conf_id', '$h323_connect_time', '$h323_disconnect_cause', '$h323_disconnect_time', '$h323_setup_time', '$h323_voice_quality')"); } else { if ($h323_call_type) { print "ERROR: Unsupported h323calltype: \"$h323_call_type\"\n"; } else { print "ERROR: Missing \"h323calltype\". This doesn't appear to be a VoIP record."; } return; # Not a VoIP record. Bailout } $sth2->execute(); #my $returned_rows = $sth2->rows; if ($verbose > 0) { print "added to DB\n"; } $sth2->finish(); } ## This sub can be used to update data in an existing database if you have some fields not in the Database. sub db_update { my $sth2= $dbh->prepare("UPDATE radacct SET CalledStationId = '$Called_Station_Id', AcctTerminateCause = '$AcctTerminateCause', H323RemoteAddress = '$h323_remote_address', AcctStatusType = '$AcctStatusType', callid = '$h323_conf_id', h323calltype = '$h323_call_type', CiscoNASPort = '$Cisco_NAS_Port', h323disconnectcause = '$h323_disconnect_cause', h323connecttime = '$h323_connect_time', h323disconnecttime = '$h323_disconnect_time', h323setuptime = '$h323_setup_time' WHERE AcctSessionId = 'AcctSessionId' AND UserName = '$UserName' AND NASIPAddress = '$NasIPAddress' AND h323confid = '$h323_conf_id'"); $sth2->execute(); my $returned_rows = $sth2->rows; if ($verbose > 0) { print " $returned_rows record(s) updated\n" } $sth2->finish(); } sub db_read { if ($verbose > 0) { print "Record: $passno) ConfID: $h323_conf_id Timestamp: $radius_record_timestamp Length: $AcctSessionTime "; } my $sth = $dbh->prepare("SELECT RadAcctId FROM Stop$h323_call_type WHERE AcctTime = ($Timestamp)::abstime AND NASIPAddress = '$NasIPAddress' AND callid = '$h323_conf_id'") or die "\nCouldn't prepare statement: " . $dbh->errstr . "\n"; my @data; $sth->execute() # Execute the query or die "\nCouldn't execute statement: " . $sth->errstr . "\n"; my $returned_rows = $sth->rows; if ($sth->rows == 0) { &db_insert; # It's a new record. All systems go. } elsif ($sth->rows == 1) { if ($verbose > 0) { print "already in DB.\n"; } # FIXME: Make updates an option! #while (@data = $sth->fetchrow_array()) { #my $dbAcctSessionId = $data[1]; ##&db_update; #} } else { $duplicates++; # FIXME: Log this somewhere! print "********* More than One Match! We have a problem!\n"; } $sth->finish; } sub process_record { $radius_record_timestamp = @record[0]; chomp $radius_record_timestamp; if ($verbose > 1) { print "DEBUG: Processing new record with time: $radius_record_timestamp \n"; } # Clear the variables we use so that we don't have rubbish from the last loop $UserName=""; $NasPort=""; $NasPortType=""; $NasIPAddress = ""; $AcctStatusType=""; $AcctSessionTime=""; $AcctInputOctets=""; $AcctOutputOctets=""; $AcctTerminateCause=""; $ServiceType=""; $FramedProtocol=""; $FramedIPAddress=""; $Timestamp=""; $AcctDelayTime=0; $ConnectInfo=""; $Called_Station_Id=""; $SQL_User_Name=""; $Cisco_NAS_Port=""; $Client_IP_Address=""; $h323_remote_address=""; $h323_disconnect_cause=""; $h323_gw_id=""; $h323_conf_id=""; $h323_call_type=""; $h323_disconnect_time=""; $h323_connect_time=""; $h323_setup_time=""; $Calling_Station_Id=""; $h323_call_origin=""; $h323_voice_quality=""; $h323_gw_id=""; foreach (@record) { # Parse the lines of data into variables. # Initial cleanup of junk from the line of data s/^\s+//; # Strip leading spaces. s/^Quintum-//; # Strip leading "Quintum-". chomp; # Strip trailing CR $AcctStatusType = $_ if s/Acct-Status-Type = //; if ($AcctStatusType eq "Stop") { # All the data we need is in Stop records. } elsif ($AcctStatusType eq "Start") { if ($verbose > 1) { print "DEBUG: Skipping \"Start\" record\n"; } return; } elsif ($AcctStatusType eq "Alive"){ if ($verbose > 1) { print "DEBUG: Skipping \"Alive\" record\n"; } return; }; $UserName = $_ if s/User-Name = //; $NasIPAddress = $_ if s/NAS-IP-Address = //; $AcctSessionTime = $_ if s/Acct-Session-Time = //; $AcctInputOctets = $_ if s/Acct-Input-Octets = //; $AcctOutputOctets = $_ if s/Acct-Output-Octets = //; $AcctDelayTime = $_ if s/Acct-Delay-Time = //; $Called_Station_Id = $_ if s/Called-Station-Id = //; $Calling_Station_Id = $_ if s/Calling-Station-Id = //; $Cisco_NAS_Port = $_ if s/Cisco-NAS-Port = //; $Timestamp = $_ if s/Timestamp = //; if (s/h323-call-type = \"h323-call-type=//) { $h323_call_type = substr($_, 0, -1); } elsif (s/h323-call-type = //) { $h323_call_type = $_; }; if (s/h323-remote-address = \"h323-remote-address=//) { $h323_remote_address = $_; } elsif (s/h323-remote-address = //) { $h323_remote_address = $_; }; if (s/h323-disconnect-cause = \"h323-disconnect-cause=//) { $h323_disconnect_cause = $_; } elsif (s/h323-disconnect-cause = //) { $h323_disconnect_cause = $_; }; if (s/h323-conf-id = \"h323-conf-id=//) { $h323_conf_id = substr($_, 0, -1); } elsif (s/h323-conf-id = //) { $h323_conf_id = $_; }; if (s/h323-connect-time = \"h323-connect-time=//) { $h323_connect_time = substr($_, 0, -1); } elsif (s/h323-connect-time = //) { $h323_connect_time = $_; }; if (s/h323-disconnect-time = \"h323-disconnect-time=//) { $h323_disconnect_time = substr($_, 0, -1); } elsif (s/h323-disconnect-time = //) { $h323_disconnect_time = $_; }; if (s/h323-setup-time = \"h323-setup-time=//) { $h323_setup_time = substr($_, 0, -1); } elsif (s/h323-setup-time = //) { $h323_setup_time = $_; }; if (s/h323-call-origin = \"h323-call-origin=//) { $h323_call_origin = substr($_, 0, -1); } elsif (s/h323-call-origin = //) { $h323_call_origin = $_; }; if (s/h323-gw-id = \"h323-gw-id=//) { $h323_gw_id = substr($_, 0, -1); } elsif (s/h323-gw-id = //) { $h323_gw_id = $_; }; if (s/h323-voice-quality = \"h323-voice-quality=//) { $h323_voice_quality = substr($_, 0, -1); } elsif (s/h323-voice-quality = //) { $h323_voice_quality = $_; }; # FIXME: ugh, definitely look into using backreference. # something like s/(\S+)\s*=\s*\1/\1 = / or so } # Remove quotation marks from a bunch of different fields (Stupid Cisco) $UserName =~ s/\"//g; $h323_remote_address =~ s/\"//g; $Called_Station_Id =~ s/\"//g; $h323_disconnect_cause =~ s/\"//g; $h323_setup_time =~ s/\"//g; $h323_connect_time =~ s/\"//g; $h323_disconnect_time =~ s/\"//g; $h323_conf_id =~ s/\"//g; $h323_call_type =~ s/\"//g; $h323_call_origin =~ s/\"//g; $h323_voice_quality =~ s/\"//g; $Cisco_NAS_Port =~ s/\"//g; # Remove Remove . from the start of time fields (routers that have lost ntp timesync temporarily) $h323_setup_time =~ s/^\.*//; $h323_connect_time =~ s/^\.*//; $h323_disconnect_time =~ s/^\.*//; # Ignore broken fields from some stupid, non-cisco gateways (They shall remain nameless) if ($h323_connect_time eq "0") { $h323_connect_time = "" }; if ($h323_disconnect_time eq "0") { $h323_disconnect_time = "" }; # If its a valid record continue onto the database functions # FIXME: More checks needed here. if ($h323_call_type) { $passno++; #@duplicate_records{$passno} += @record; if (&procedure_get()) { &procedure_insert; } else { &db_read; } } else { if ($verbose > 1) { print "DEBUG: Skipping non-h323 record\n"; } } } sub read_record { my $keepreading = 1; @record = (); while ($keepreading) { $_ = ; print "$_" if ($verbose > 1); if ( /^$/ ) { $keepreading = 0; # End of record } else { $record[++$#record] = $_; } } &process_record; } sub read_detailfile { my $file_starttime = time(); my $filename = shift; my @record = (); my $record_no = 0; if ($verbose > 1) { print "DEBUG: Reading detail file: $filename\n" } if ((-r $filename) != 1) { # test if the file exists and is readable if ($verbose >= 0) { print "INFO: Skipping file \"$filename\" as it is not readable or does not exist.\n" } return; } if ( $filename =~ /.gz$/ ) { # Deal with compressed files open (DETAIL, "$GZCAT $filename |") || warn "read_detailfile(\"$filename\"): $!\n"; } elsif ( $filename =~ /.Z$/ ) { open (DETAIL, "$ZCAT $filename |") || warn "read_detailfile(\"$filename\"): $!\n"; } elsif ( $filename =~ /.bz2$/ ) { open (DETAIL, "$BZCAT $filename |") || warn "read_detailfile(\"$filename\"): $!\n"; } else { open (DETAIL, "<$filename") || warn "read_detailfile(\"$filename\"): $!\n"; } $valid_input = (eof(DETAIL) ? 0 : 1); if ($verbose > 1) { print "DEBUG: Starting to read records from $filename\n"; } while($valid_input) { $valid_input = 0 if (eof(DETAIL)); if ($verbose > 1) { print "DEBUG: Reading Record\n"; } &read_record; $record_no++; } my $file_runtime = (time() - $file_starttime); if ($file_runtime < 1) { $file_runtime = 1; } my $file_speed = ($record_no / $file_runtime); if ($verbose >= 0) { print "\n $record_no total records read from $filename were processed in $file_runtime seconds ($file_speed records/sec) \n"; } } sub print_usage_info { print "\n"; $leader = "$progname $version Usage Information"; $underbar = $leader; $underbar =~ s/./-/g; print "$leader\n$underbar\n"; print "\n"; print " Syntax: h323detail2db.pl [ options ] detailfile(s)\n"; print "\n"; print " -d --database Database to use\n"; print " -h --help Show this usage information\n"; print " -H --host Database host to connect to (Default: localhost)\n"; print " -p --procedure Use Postgresql stored procedure (BROKEN!)\n"; print " -q --quiet Turn on quiet mode (No Output)\n"; print " -v --verbose Turn on verbose\n"; print " -V --version Show version and copyright\n"; print " -x --debug Turn on debugging\n"; print "\n"; } sub procedure_get() { return $stored_procedure; } sub procedure_set($) { $stored_procedure = $_[0]; } sub main { # Parse the command line for options if (!scalar(@ARGV)) { &print_usage_info(); exit(SUCCESS); }; # See the Getopt::Long man page for details on the syntax of this line @valid_opts = ("h|help", "V|version", "f|file=s", "x|debug", "d|database=s", "v|verbose+" => \$verbose, "q|quiet+" => \$quiet, "D|date=s", "H|host=s", "p|procedure"); Getopt::Long::Configure("no_getopt_compat", "bundling", "no_ignore_case"); Getopt::Long::GetOptions(@valid_opts); # Post-parse the options stuff select STDOUT; $| = 1; if ($opt_V) { # Do not edit this variable. It is updated automatically by CVS when you commit my $rcs_info = 'CVS Revision $Revision$ created on $Date$ by $Author$ '; $rcs_info =~ s/\$\s*Revision: (\S+) \$/$1/; $rcs_info =~ s/\$\s*Date: (\S+) (\S+) \$/$1 at $2/; $rcs_info =~ s/\$\s*Author: (\S+) \$ /$1/; print "\n"; print "$progname Version $version by Peter Nixon - http://www.peternixon.net/\n"; print "Copyright (c) 2002-2004 Peter Nixon\n"; print " ($rcs_info)\n"; print "\n"; return SUCCESS; } elsif ($opt_h) { &print_usage_info(); exit(SUCCESS); } if ($opt_x) { print "DEBUG: Debug mode is enabled.\n"; $verbose = 2; } elsif ($quiet) { $verbose -= $quiet; } &procedure_set($opt_p); if ($opt_d) { if ($verbose > 0) { print "Using database \"$opt_d\" instead of default database \"$database\"\n"; } $database = $opt_d; } if (@ARGV) { my $db_host; if ($opt_H) { $db_host = $opt_H; } else { $db_host = "localhost"; } &db_connect($db_host); # Loop through the defined files foreach $file (@ARGV) { &read_detailfile($file); } &process_duplicates; &db_disconnect($db_host); my $runtime = (time() - $starttime); if ($runtime < 1) { $runtime = 1; } my $speed = ($passno / $runtime); if ($verbose >= 0) { print "\n $passno valid records were processed in $runtime seconds ($speed records/sec) \n"; } } else { print "ERROR: Please specify one or more detail file(s) to import.\n"; exit(FAILURE); } } exit &main(); freeradius-server/src/include/000077500000000000000000000000001257552170400167355ustar00rootroot00000000000000freeradius-server/src/include/Makefile000066400000000000000000000014741257552170400204030ustar00rootroot00000000000000# # Makefile # # Version: $Id$ # HEADERS = autoconf.h conf.h conffile.h detail.h dhcp.h event.h hash.h heap.h \ ident.h libradius.h md4.h md5.h missing.h modcall.h modules.h \ packet.h rad_assert.h radius.h radiusd.h radpaths.h \ radutmp.h realms.h sha1.h stats.h sysutmp.h threads.h token.h \ udpfromto.h vmps.h vqp.h base64.h include ../../Make.inc .PHONY: all clean distclean install .PHONY: all clean distclean install reconfig all: radpaths.h radpaths.h: build-radpaths-h @/bin/sh ./build-radpaths-h distclean: rm -f radpaths.h reconfig clean: install: $(INSTALL) -d -m 755 $(R)$(includedir)/freeradius for i in $(HEADERS); do \ sed 's/^#include .inst.$$$$ ; \ $(INSTALL) -m 644 .inst.$$$$ $(R)$(includedir)/freeradius/$$i; \ rm -f .inst.$$$$ ; \ done freeradius-server/src/include/autoconf.h.in000066400000000000000000000333011257552170400213310ustar00rootroot00000000000000/* src/include/autoconf.h.in. Generated from configure.in by autoheader. */ /* Define if building universal (internal helper macro) */ #undef AC_APPLE_UNIVERSAL_BUILD /* Include support for Ascend binary filter attributes */ #undef ASCEND_BINARY /* BSD-Style get*byaddr_r */ #undef BSDSTYLE /* style of ctime_r function */ #undef CTIMERSTYLE /* Define to 1 to have OpenSSL version check enabled */ #undef ENABLE_OPENSSL_VERSION_CHECK /* style of gethostbyaddr_r functions */ #undef GETHOSTBYADDRRSTYLE /* style of gethostbyname_r functions */ #undef GETHOSTBYNAMERSTYLE /* GNU-Style get*byaddr_r */ #undef GNUSTYLE /* Define to 1 if you have the header file. */ #undef HAVE_ARPA_INET_H /* Define to 1 if you have the `closefrom' function. */ #undef HAVE_CLOSEFROM /* Do we have the crypt function */ #undef HAVE_CRYPT /* Define to 1 if you have the header file. */ #undef HAVE_CRYPT_H /* Define to 1 if you have the `ctime_r' function. */ #undef HAVE_CTIME_R /* Define to 1 if you have the declaration of `gethostbyaddr_r', and to 0 if you don't. */ #undef HAVE_DECL_GETHOSTBYADDR_R /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_DIRENT_H /* Define to 1 if you have the header file. */ #undef HAVE_DLFCN_H /* Define to 1 if you have the header file. */ #undef HAVE_ERRNO_H /* Define to 1 if you have the header file. */ #undef HAVE_EXECINFO_H /* Define to 1 if you have the header file. */ #undef HAVE_FCNTL_H /* Define to 1 if you have the header file. */ #undef HAVE_FNMATCH_H /* Define to 1 if you have the `getaddrinfo' function. */ #undef HAVE_GETADDRINFO /* Define to 1 if you have the `getnameinfo' function. */ #undef HAVE_GETNAMEINFO /* Define to 1 if you have the header file. */ #undef HAVE_GETOPT_H /* Define to 1 if you have the `getopt_long' function. */ #undef HAVE_GETOPT_LONG /* Define to 1 if you have the `getpeereid' function. */ #undef HAVE_GETPEEREID /* Define to 1 if you have the `getresuid' function. */ #undef HAVE_GETRESUID /* Define to 1 if you have the `gettimeofday' function. */ #undef HAVE_GETTIMEOFDAY /* Define to 1 if you have the `getusershell' function. */ #undef HAVE_GETUSERSHELL /* Define to 1 if you have the header file. */ #undef HAVE_GLOB_H /* Define to 1 if you have the `gmtime_r' function. */ #undef HAVE_GMTIME_R /* Define to 1 if you have the header file. */ #undef HAVE_GRP_H /* Define to 1 if you have the header file. */ #undef HAVE_HISTORY_H /* define if you have IN6_PKTINFO (Linux) */ #undef HAVE_IN6_PKTINFO /* Define to 1 if you have the `inet_aton' function. */ #undef HAVE_INET_ATON /* Define to 1 if you have the `inet_ntop' function. */ #undef HAVE_INET_NTOP /* Define to 1 if you have the `inet_pton' function. */ #undef HAVE_INET_PTON /* Define to 1 if you have the `initgroups' function. */ #undef HAVE_INITGROUPS /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* define if you have IP_PKTINFO (Linux) */ #undef HAVE_IP_PKTINFO /* Define to 1 if you have the `crypto' library (-lcrypto). */ #undef HAVE_LIBCRYPTO /* Define to 1 if you have the `nsl' library (-lnsl). */ #undef HAVE_LIBNSL /* Define to 1 if you have the `pcap' library (-lpcap). */ #undef HAVE_LIBPCAP /* Define if you have a readline compatible library */ #undef HAVE_LIBREADLINE /* Define to 1 if you have the `resolv' library (-lresolv). */ #undef HAVE_LIBRESOLV /* Define to 1 if you have the `socket' library (-lsocket). */ #undef HAVE_LIBSOCKET /* Define to 1 if you have the `ssl' library (-lssl). */ #undef HAVE_LIBSSL /* Define to 1 if you have the `ws2_32' library (-lws2_32). */ #undef HAVE_LIBWS2_32 /* Define to 1 if you have the `localtime_r' function. */ #undef HAVE_LOCALTIME_R /* Define to 1 if you have the `lockf' function. */ #undef HAVE_LOCKF /* Do we have the lt_dladvise_init function */ #undef HAVE_LT_DLADVISE_INIT /* Define to 1 if you have the header file. */ #undef HAVE_MALLOC_H /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_NDIR_H /* Define to 1 if you have the header file. */ #undef HAVE_NETDB_H /* Define to 1 if you have the header file. */ #undef HAVE_NETINET_IN_H /* Define to 1 if you have the header file. */ #undef HAVE_NET_IF_H /* Define to 1 if you have the header file. */ #undef HAVE_OPENSSL_CRYPTO_H /* Define to 1 if you have the header file. */ #undef HAVE_OPENSSL_ENGINE_H /* Define to 1 if you have the header file. */ #undef HAVE_OPENSSL_ERR_H /* Define to 1 if you have the header file. */ #undef HAVE_OPENSSL_EVP_H /* Define to 1 if you have the header file. */ #undef HAVE_OPENSSL_MD4_H /* Define to 1 if you have the header file. */ #undef HAVE_OPENSSL_MD5_H /* Define to 1 if you have the header file. */ #undef HAVE_OPENSSL_OCSP_H /* Define to 1 if you have the header file. */ #undef HAVE_OPENSSL_SHA_H /* Define to 1 if you have the header file. */ #undef HAVE_OPENSSL_SSL_H /* Define to 1 if you have the function pcap_dump_fopen. */ #undef HAVE_PCAP_DUMP_FOPEN /* Define to 1 if you have the function pcap_fopen_offline. */ #undef HAVE_PCAP_FOPEN_OFFLINE /* Define to 1 if you have the header file. */ #undef HAVE_PCAP_H /* Define to 1 if you have the header file. */ #undef HAVE_PROT_H /* Define to 1 if you have the header file. */ #undef HAVE_PTHREAD_H /* Define to 1 if you have the `pthread_sigmask' function. */ #undef HAVE_PTHREAD_SIGMASK /* Define to 1 if you have the header file. */ #undef HAVE_PWD_H /* Define to 1 if you have the header file. */ #undef HAVE_READLINE_H /* Define if your readline library has \`add_history' */ #undef HAVE_READLINE_HISTORY /* Define to 1 if you have the header file. */ #undef HAVE_READLINE_HISTORY_H /* Define to 1 if you have the header file. */ #undef HAVE_READLINE_READLINE_H /* define this if we have the header file */ #undef HAVE_REGEX_H /* define this if we have REG_EXTENDED (from ) */ #undef HAVE_REG_EXTENDED /* Define to 1 if you have the header file. */ #undef HAVE_RESOURCE_H /* Define to 1 if you have the header file. */ #undef HAVE_SEMAPHORE_H /* Define to 1 if you have the `setlinebuf' function. */ #undef HAVE_SETLINEBUF /* Define to 1 if you have the `setresuid' function. */ #undef HAVE_SETRESUID /* Define to 1 if you have the `setsid' function. */ #undef HAVE_SETSID /* Define to 1 if you have the `setuid' function. */ #undef HAVE_SETUID /* Define to 1 if you have the `setvbuf' function. */ #undef HAVE_SETVBUF /* Define to 1 if you have the header file. */ #undef HAVE_SIAD_H /* Define to 1 if you have the header file. */ #undef HAVE_SIA_H /* Define to 1 if you have the `sigaction' function. */ #undef HAVE_SIGACTION /* Define to 1 if you have the header file. */ #undef HAVE_SIGNAL_H /* Define to 1 if you have the `sigprocmask' function. */ #undef HAVE_SIGPROCMASK /* signal action callback function */ #undef HAVE_SIG_T /* Define to 1 if you have the `snprintf' function. */ #undef HAVE_SNPRINTF /* Define to 1 if you have the header file. */ #undef HAVE_STDDEF_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_STDIO_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the `strcasecmp' function. */ #undef HAVE_STRCASECMP /* 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 `strncasecmp' function. */ #undef HAVE_STRNCASECMP /* Define to 1 if you have the `strsep' function. */ #undef HAVE_STRSEP /* Define to 1 if you have the `strsignal' function. */ #undef HAVE_STRSIGNAL /* Generic DNS lookups */ #undef HAVE_STRUCT_ADDRINFO /* IPv6 address structure */ #undef HAVE_STRUCT_IN6_ADDR /* IPv6 socket addresses */ #undef HAVE_STRUCT_SOCKADDR_IN6 /* Generic socket addresses */ #undef HAVE_STRUCT_SOCKADDR_STORAGE /* Define to 1 if you have the header file. */ #undef HAVE_SYSLOG_H /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_SYS_DIR_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_FCNTL_H /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_SYS_NDIR_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_PRCTL_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_SECURITY_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_SELECT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_SOCKET_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TIME_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_UN_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_WAIT_H /* Define if the compiler supports __thread */ #undef HAVE_THREAD_TLS /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Define to 1 if you have the header file. */ #undef HAVE_UTMPX_H /* Define to 1 if you have the header file. */ #undef HAVE_UTMP_H /* Define to 1 if you have the `vsnprintf' function. */ #undef HAVE_VSNPRINTF /* Define to 1 if you have the header file. */ #undef HAVE_WINSOCK_H /* define if you have OSFC2 authentication */ #undef OSFC2 /* define if you have OSFSIA authentication */ #undef OSFSIA /* 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 /* Posix-Style ctime_r */ #undef POSIXSTYLE /* Define as the return type of signal handlers (`int' or `void'). */ #undef RETSIGTYPE /* Solaris-Style ctime_r */ #undef SOLARISSTYLE /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* SYSV-Style get*byaddr_r */ #undef SYSVSTYLE /* Define to 1 if you can safely include both and . */ #undef TIME_WITH_SYS_TIME /* Enable extensions on AIX 3, Interix. */ #ifndef _ALL_SOURCE # undef _ALL_SOURCE #endif /* Enable GNU extensions on systems that have them. */ #ifndef _GNU_SOURCE # undef _GNU_SOURCE #endif /* Enable threading extensions on Solaris. */ #ifndef _POSIX_PTHREAD_SEMANTICS # undef _POSIX_PTHREAD_SEMANTICS #endif /* Enable extensions on HP NonStop. */ #ifndef _TANDEM_SOURCE # undef _TANDEM_SOURCE #endif /* Enable general extensions on Solaris. */ #ifndef __EXTENSIONS__ # undef __EXTENSIONS__ #endif /* define if you want DHCP support */ #undef WITH_DHCP /* 1.x compatibility */ #undef WITH_POST_PROXY_AUTHORIZE /* define if you want udpfromto */ #undef WITH_UDPFROMTO /* define if you want VMPS support */ #undef WITH_VMPS /* 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 /* Enable large inode numbers on Mac OS X 10.5. */ #ifndef _DARWIN_USE_64_BIT_INODE # define _DARWIN_USE_64_BIT_INODE 1 #endif /* Number of bits in a file offset, on hosts where this is settable. */ #undef _FILE_OFFSET_BITS /* Define for large files, on AIX-style hosts. */ #undef _LARGE_FILES /* Define to 1 if on MINIX. */ #undef _MINIX /* Define to 2 if the system does not provide POSIX.1 features except with this defined. */ #undef _POSIX_1_SOURCE /* Define to 1 if you need to in order for `stat' and other things to work. */ #undef _POSIX_SOURCE /* Force OSX >= 10.7 Lion to use RFC2292 IPv6 socket options */ #undef __APPLE_USE_RFC_3542 /* Define to empty if `const' does not conform to ANSI C. */ #undef const /* Define to `int' if doesn't define. */ #undef gid_t /* Define to `long int' if does not define. */ #undef off_t /* Define to `int' if does not define. */ #undef pid_t /* Define to `unsigned int' if does not define. */ #undef size_t /* socklen_t is generally 'int' on systems which don't use it */ #undef socklen_t /* Define to `int' if doesn't define. */ #undef uid_t /* uint16_t should be the canonical '2 octets' for network traffic */ #undef uint16_t /* uint32_t should be the canonical 'network integer */ #undef uint32_t /* uint8_t should be the canonical 'octet' for network traffic */ #undef uint8_t /* define to something if you don't have ut_xtime in struct utmpx */ #undef ut_xtime freeradius-server/src/include/base64.h000066400000000000000000000032051257552170400201720ustar00rootroot00000000000000/* base64.h -- Encode binary data using printable characters. Copyright (C) 2004, 2005, 2006 Free Software Foundation, Inc. Written by Simon Josefsson. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _FR_BASE64_H # define _FR_BASE64_H #include RCSIDH(base64_h, "$Id$") # include /* This uses that the expression (n+(k-1))/k means the smallest integer >= n/k, i.e., the ceiling of n/k. */ # define FR_BASE64_ENC_LENGTH(inlen) ((((inlen) + 2) / 3) * 4) # define FR_BASE64_DEC_LENGTH(inlen) ((3 * (inlen / 4)) + 2) extern int fr_isbase64 (char ch); extern void fr_base64_encode (const uint8_t *in, size_t inlen, char *out, size_t outlen); extern size_t fr_base64_encode_alloc (const uint8_t *in, size_t inlen, char **out); extern int fr_base64_decode (const char *in, size_t inlen, char *out, size_t *outlen); extern int fr_base64_decode_alloc (const char *in, size_t inlen, char **out, size_t *outlen); #endif /* BASE64_H */ freeradius-server/src/include/build-radpaths-h.in000066400000000000000000000014111257552170400224120ustar00rootroot00000000000000#! /bin/sh # # build-radpaths-h # Script to generate radpaths.h file. This is needed to # work around the weird way "autoconf" substitutes things # that are generated in anyway from a command line # argument having to do with a path (--prefix etc) # # Version: $Id$ # # Location of files. prefix=@prefix@ exec_prefix=@exec_prefix@ sysconfdir=@sysconfdir@ localstatedir=@localstatedir@ libdir=@libdir@ bindir=@bindir@ sbindir=@sbindir@ mandir=@mandir@ logdir=@logdir@ raddbdir=@raddbdir@ radacctdir=@radacctdir@ datarootdir=@datarootdir@ cat < radpaths.h /* Automatically generated by "build-radpaths-h" */ #define LOGDIR "@logdir@" #define RADDBDIR "@raddbdir@" #define RUNDIR "@localstatedir@/run" #define SBINDIR "@sbindir@" #define RADIR "@radacctdir@" EOF freeradius-server/src/include/conf.h000066400000000000000000000030041257552170400200300ustar00rootroot00000000000000/* Default Database File Names */ #define RADIUS_DIR RADDBDIR #define RADACCT_DIR RADIR #define RADLOG_DIR LOGDIR #define RADIUS_DICTIONARY "dictionary" #define RADIUS_CLIENTS "clients" #define RADIUS_NASLIST "naslist" #define RADIUS_REALMS "realms" #define RADUTMP LOGDIR "/radutmp" #define SRADUTMP LOGDIR "/sradutmp" #define RADWTMP LOGDIR "/radwtmp" #define SRADWTMP LOGDIR "/sradwtmp" /* Hack for funky ascend ports on MAX 4048 (and probably others) The "NAS-Port-Id" value is "xyyzz" where "x" = 1 for digital, 2 for analog; "yy" = line number (1 for first PRI/T1/E1, 2 for second, so on); "zz" = channel number (on the PRI or Channelized T1/E1). This should work with normal terminal servers, unless you have a TS with more than 9999 ports ;^). The "ASCEND_CHANNELS_PER_LINE" is the number of channels for each line into the unit. For my US/PRI that's 23. A US/T1 would be 24, and a European E1 would be 30 (I think ... never had one ;^). This will NOT change the "NAS-Port-Id" reported in the detail log. This is simply to fix the dynamic IP assignments a la Cistron. You can change the default of 23 with an argument to ./configure. WARNING: This hack works for me, but I only have one PRI!!! I've not tested it on 2 or more (or with models other than the Max 4048) Use at your own risk! -- dgreer@austintx.com */ #ifdef ASCEND_PORT_HACK # ifndef ASCEND_CHANNELS_PER_LINE # define ASCEND_CHANNELS_PER_LINE 23 # endif #endif freeradius-server/src/include/conffile.h000066400000000000000000000111111257552170400206660ustar00rootroot00000000000000#ifndef _CONFFILE_H #define _CONFFILE_H /* * conffile.h Defines for the conffile parsing routines. * * Version: $Id$ * */ #include RCSIDH(conffile_h, "$Id$") #include #include #ifdef __cplusplus extern "C" { #endif /* * Export the minimum amount of information about these structs */ typedef struct conf_item CONF_ITEM; typedef struct conf_pair CONF_PAIR; typedef struct conf_part CONF_SECTION; typedef struct conf_data CONF_DATA; /* * Instead of putting the information into a configuration structure, * the configuration file routines MAY just parse it directly into * user-supplied variables. */ #define PW_TYPE_STRING_PTR 100 #define PW_TYPE_BOOLEAN 101 #define PW_TYPE_SUBSECTION 102 #define PW_TYPE_FILENAME 103 typedef struct CONF_PARSER { const char *name; int type; /* PW_TYPE_STRING, etc. */ size_t offset; /* relative pointer within "base" */ void *data; /* absolute pointer if base is NULL */ const char *dflt; /* default as it would appear in radiusd.conf */ } CONF_PARSER; /* This preprocessor trick will be useful in initializing CONF_PARSER struct */ #define XStringify(x) #x #define Stringify(x) XStringify(x) void cf_pair_free(CONF_PAIR **cp); int cf_pair_replace(CONF_SECTION *cs, CONF_PAIR *cp, const char *value); void cf_section_free(CONF_SECTION **cp); int cf_item_parse(CONF_SECTION *cs, const char *name, int type, void *data, const char *dflt); int cf_section_parse(CONF_SECTION *, void *base, const CONF_PARSER *variables); void cf_section_parse_free(CONF_SECTION *cs, void *base); const CONF_PARSER *cf_section_parse_table(CONF_SECTION *cs); int cf_exclude_file(const char *filename); CONF_SECTION *cf_file_read(const char *file); int cf_file_include(const char *file, CONF_SECTION *cs); CONF_PAIR *cf_pair_find(const CONF_SECTION *, const char *name); CONF_PAIR *cf_pair_find_next(const CONF_SECTION *, CONF_PAIR *, const char *name); CONF_SECTION *cf_section_find(const char *name); CONF_SECTION *cf_section_find_name2(const CONF_SECTION *section, const char *name1, const char *name2); CONF_SECTION *cf_section_sub_find(const CONF_SECTION *, const char *name); CONF_SECTION *cf_section_sub_find_name2(const CONF_SECTION *, const char *name1, const char *name2); const char *cf_section_value_find(const CONF_SECTION *, const char *attr); CONF_SECTION *cf_top_section(CONF_SECTION *cs); void *cf_data_find(CONF_SECTION *, const char *); int cf_data_add(CONF_SECTION *, const char *, void *, void (*)(void *)); const char *cf_pair_attr(CONF_PAIR *pair); const char *cf_pair_value(CONF_PAIR *pair); FR_TOKEN cf_pair_operator(CONF_PAIR *pair); VALUE_PAIR *cf_pairtovp(CONF_PAIR *pair); const char *cf_section_name1(const CONF_SECTION *); const char *cf_section_name2(const CONF_SECTION *); int dump_config(CONF_SECTION *cs); CONF_SECTION *cf_subsection_find_next(CONF_SECTION *section, CONF_SECTION *subsection, const char *name1); CONF_SECTION *cf_section_find_next(CONF_SECTION *section, CONF_SECTION *subsection, const char *name1); int cf_section_lineno(CONF_SECTION *section); int cf_pair_lineno(CONF_PAIR *pair); const char *cf_pair_filename(CONF_PAIR *pair); const char *cf_section_filename(CONF_SECTION *section); CONF_ITEM *cf_item_find_next(CONF_SECTION *section, CONF_ITEM *item); CONF_SECTION *cf_item_parent(CONF_ITEM *ci); int cf_item_is_section(CONF_ITEM *item); int cf_item_is_pair(CONF_ITEM *item); CONF_PAIR *cf_itemtopair(CONF_ITEM *item); CONF_SECTION *cf_itemtosection(CONF_ITEM *item); CONF_ITEM *cf_pairtoitem(CONF_PAIR *cp); CONF_ITEM *cf_sectiontoitem(CONF_SECTION *cs); int cf_section_template(CONF_SECTION *cs, CONF_SECTION *template); void cf_log_err(CONF_ITEM *ci, const char *fmt, ...) #ifdef __GNUC__ __attribute__ ((format (printf, 2, 3))) #endif ; void cf_log_info(CONF_SECTION *cs, const char *fmt, ...) #ifdef __GNUC__ __attribute__ ((format (printf, 2, 3))) #endif ; void cf_log_module(CONF_SECTION *cs, const char *fmt, ...) #ifdef __GNUC__ __attribute__ ((format (printf, 2, 3))) #endif ; CONF_ITEM *cf_reference_item(const CONF_SECTION *parentcs, CONF_SECTION *outercs, const char *ptr); extern int cf_log_config; extern int cf_log_modules; extern int cf_pair2xml(FILE *fp, const CONF_PAIR *cp); extern int cf_section2xml(FILE *fp, const CONF_SECTION *cs); extern int cf_pair2file(FILE *fp, const CONF_PAIR *cp); extern int cf_section2file(FILE *fp, const CONF_SECTION *cs); /* * Big magic. */ int cf_section_migrate(CONF_SECTION *dst, CONF_SECTION *src); #ifdef __cplusplus } #endif #endif /* _CONFFILE_H */ freeradius-server/src/include/detail.h000066400000000000000000000026331257552170400203540ustar00rootroot00000000000000#ifndef DETAIL_H #define DETAIL_H /* * detail.h Routines to handle detail files. * * Version: $Id$ * */ #include RCSIDH(detail_h, "$Id$") #ifdef __cplusplus extern "C" { #endif typedef enum detail_state_t { STATE_UNOPENED = 0, STATE_UNLOCKED, STATE_HEADER, STATE_READING, STATE_QUEUED, STATE_RUNNING, STATE_NO_REPLY, STATE_REPLIED } detail_state_t; typedef struct listen_detail_t { fr_event_t *ev; /* has to be first entry (ugh) */ int delay_time; char *filename; char *filename_work; VALUE_PAIR *vps; FILE *fp; off_t offset; detail_state_t state; time_t timestamp; time_t running; fr_ipaddr_t client_ip; int load_factor; /* 1..100 */ int signal; int poll_interval; int retry_interval; int packets; int tries; int one_shot; int has_rtt; int srtt; int rttvar; struct timeval last_packet; RADCLIENT detail_client; } listen_detail_t; int detail_recv(rad_listen_t *listener, RAD_REQUEST_FUNP *pfun, REQUEST **prequest); int detail_send(rad_listen_t *listener, REQUEST *request); void detail_free(rad_listen_t *this); int detail_print(const rad_listen_t *this, char *buffer, size_t bufsize); int detail_encode(UNUSED rad_listen_t *this, UNUSED REQUEST *request); int detail_decode(UNUSED rad_listen_t *this, UNUSED REQUEST *request); int detail_parse(CONF_SECTION *cs, rad_listen_t *this); #ifdef __cplusplus } #endif #endif /* DETAIL_H */ freeradius-server/src/include/dhcp.h000066400000000000000000000042761257552170400200350ustar00rootroot00000000000000#ifndef FR_DHCP_H #define FR_DHCP_H /* * dhcp.h Structures and prototypes for DHCP. * Why DHCP in a RADIUS server? * Why not? * * Version: $Id$ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2008 The FreeRADIUS server project * Copyright 2008 Alan DeKok */ #include RCSIDH(dhcp_h, "$Id$") #ifdef __cplusplus extern "C" { #endif /* * Not for production use. */ RADIUS_PACKET *fr_dhcp_recv(int sockfd); int fr_dhcp_send(RADIUS_PACKET *packet); int fr_dhcp_add_arp_entry(int fd, const char *interface, VALUE_PAIR *hwvp, VALUE_PAIR *clvp); int fr_dhcp_encode(RADIUS_PACKET *packet); ssize_t fr_dhcp_decode_options(uint8_t *data, size_t len, VALUE_PAIR **head); int fr_dhcp_decode(RADIUS_PACKET *packet); /* * This is a horrible hack. */ #define PW_DHCP_OFFSET (1024) #define PW_DHCP_DISCOVER (1024 + 1) #define PW_DHCP_OFFER (1024 + 2) #define PW_DHCP_REQUEST (1024 + 3) #define PW_DHCP_DECLINE (1024 + 4) #define PW_DHCP_ACK (1024 + 5) #define PW_DHCP_NAK (1024 + 6) #define PW_DHCP_RELEASE (1024 + 7) #define PW_DHCP_INFORM (1024 + 8) #define DHCP_MAGIC_VENDOR (54) #define DHCP2ATTR(x) ((DHCP_MAGIC_VENDOR << 16) | (x)) #define ATTR2DHCP(x) ((x) & 0xff) #define IS_DHCP_ATTR(x) (VENDOR((x)->attribute) == DHCP_MAGIC_VENDOR) #define PW_DHCP_OPTION_82 (82) #define DHCP_PACK_OPTION1(x,y) ((x) | ((y) << 8)) #define DHCP_BASE_ATTR(x) (x & 0xff) #define DHCP_UNPACK_OPTION1(x) (((x) & 0xff00) >> 8) #ifdef __cplusplus } #endif #endif /* FR_DHCP_H */ freeradius-server/src/include/event.h000066400000000000000000000041141257552170400202270ustar00rootroot00000000000000#ifndef FR_EVENT_H #define FR_EVENT_H /* * event.h Simple event queue * * Version: $Id$ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2007 The FreeRADIUS server project * Copyright 2007 Alan DeKok */ #include RCSIDH(event_h, "$Id$") #ifdef __cplusplus extern "C" { #endif typedef struct fr_event_list_t fr_event_list_t; typedef struct fr_event_t fr_event_t; typedef void (*fr_event_callback_t)(void *); typedef void (*fr_event_status_t)(struct timeval *); typedef void (*fr_event_fd_handler_t)(fr_event_list_t *el, int sock, void *ctx); fr_event_list_t *fr_event_list_create(fr_event_status_t status); void fr_event_list_free(fr_event_list_t *el); int fr_event_list_num_elements(fr_event_list_t *el); int fr_event_insert(fr_event_list_t *el, fr_event_callback_t callback, void *ctx, struct timeval *when, fr_event_t **ev_p); int fr_event_delete(fr_event_list_t *el, fr_event_t **ev_p); int fr_event_run(fr_event_list_t *el, struct timeval *when); int fr_event_now(fr_event_list_t *el, struct timeval *when); int fr_event_fd_insert(fr_event_list_t *el, int type, int fd, fr_event_fd_handler_t handler, void *ctx); int fr_event_fd_delete(fr_event_list_t *el, int type, int fd); int fr_event_loop(fr_event_list_t *el); void fr_event_loop_exit(fr_event_list_t *el, int code); #ifdef __cplusplus } #endif #endif /* FR_HASH_H */ freeradius-server/src/include/hash.h000066400000000000000000000047151257552170400200400ustar00rootroot00000000000000#ifndef FR_HASH_H #define FR_HASH_H /* * hash.h Structures and prototypes * for fast hashing. * * Version: $Id$ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2005,2006 The FreeRADIUS server project */ #include RCSIDH(hash_h, "$Id$") #ifdef __cplusplus extern "C" { #endif /* * Fast hash, which isn't too bad. Don't use for cryptography, * just for hashing internal data. */ uint32_t fr_hash(const void *, size_t); uint32_t fr_hash_update(const void *data, size_t size, uint32_t hash); uint32_t fr_hash_string(const char *p); /* * If you need fewer than 32-bits of hash, use this macro to get * the number of bits in the hash you need. The upper bits of the * hash will be set to zero. */ uint32_t fr_hash_fold(uint32_t hash, int bits); typedef struct fr_hash_table_t fr_hash_table_t; typedef void (*fr_hash_table_free_t)(void *); typedef uint32_t (*fr_hash_table_hash_t)(const void *); typedef int (*fr_hash_table_cmp_t)(const void *, const void *); typedef int (*fr_hash_table_walk_t)(void * /* ctx */, void * /* data */); fr_hash_table_t *fr_hash_table_create(fr_hash_table_hash_t hashNode, fr_hash_table_cmp_t cmpNode, fr_hash_table_free_t freeNode); void fr_hash_table_free(fr_hash_table_t *ht); int fr_hash_table_insert(fr_hash_table_t *ht, void *data); int fr_hash_table_delete(fr_hash_table_t *ht, const void *data); void *fr_hash_table_yank(fr_hash_table_t *ht, const void *data); int fr_hash_table_replace(fr_hash_table_t *ht, void *data); void *fr_hash_table_finddata(fr_hash_table_t *ht, const void *data); int fr_hash_table_num_elements(fr_hash_table_t *ht); int fr_hash_table_walk(fr_hash_table_t *ht, fr_hash_table_walk_t callback, void *ctx); #ifdef __cplusplus } #endif #endif /* FR_HASH_H */ freeradius-server/src/include/heap.h000066400000000000000000000026011257552170400200220ustar00rootroot00000000000000#ifndef LRAD_HEAP_H #define LRAD_HEAP_H /* * heap.h Structures and prototypes for binary heaps. * Version: $Id$ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2007 Alan DeKok */ #include RCSIDH(heap_h, "$Id$") #ifdef __cplusplus extern "C" { #endif typedef int (*fr_heap_cmp_t)(const void *, const void *); typedef struct fr_heap_t fr_heap_t; fr_heap_t *fr_heap_create(fr_heap_cmp_t cmp, size_t offset); void fr_heap_delete(fr_heap_t *hp); int fr_heap_insert(fr_heap_t *hp, void *data); int fr_heap_extract(fr_heap_t *hp, void *data); void *fr_heap_peek(fr_heap_t *hp); int fr_heap_num_elements(fr_heap_t *hp); #ifdef __cplusplus } #endif #endif /* LRAD_HEAP_H */ freeradius-server/src/include/ident.h000066400000000000000000000026151257552170400202150ustar00rootroot00000000000000/* * $Id$ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2006 TRI-D Systems, Inc. */ #ifndef IDENT_H #define IDENT_H #ifdef __cplusplus extern "C" { #endif #if defined(__GNUC__) /* force inclusion of ident keywords in the face of optimization */ #define RCSID(id) static const char rcsid[] __attribute__ ((used)) = id; #define RCSIDH(h, id) static const char rcsid_ ## h [] __attribute__ ((used)) = id; #elif defined(__SUNPRO_C) /* put ident keyword into comment section (nicer than gcc way) */ #define DO_PRAGMA(x) _Pragma(#x) #define RCSID(id) DO_PRAGMA(sun ident id) #define RCSIDH(h, id) DO_PRAGMA(sun ident id) #else #define RCSID(id) #define RCSIDH(h, id) #endif #ifdef __cplusplus } #endif #endif /* IDENT_H */ freeradius-server/src/include/libradius.h000066400000000000000000000372421257552170400210740ustar00rootroot00000000000000#ifndef LIBRADIUS_H #define LIBRADIUS_H /* * libradius.h Structures and prototypes * for the radius library. * * Version: $Id$ * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 1999,2000,2001,2002,2003,2004,2005,2006,2007,2008 The FreeRADIUS server project */ #include RCSIDH(libradius_h, "$Id$") #include #ifdef HAVE_ERRNO_H #include #endif #include #include #include #include #include #include #include #include #ifdef SIZEOF_UNSIGNED_INT #if SIZEOF_UNSIGNED_INT != 4 #error FATAL: sizeof(unsigned int) != 4 #endif #endif #ifndef FALSE #define FALSE 0 #endif #ifndef TRUE /* * This definition of true as NOT false is definitive. :) Making * it '1' can cause problems on stupid platforms. See articles * on C portability for more information. */ #define TRUE (!FALSE) #endif /* * Include for modules. */ #include #include #ifdef __cplusplus extern "C" { #endif #ifndef HAVE_SIG_T typedef void (*sig_t)(int); #endif #define EAP_START 2 #define AUTH_VECTOR_LEN 16 #define CHAP_VALUE_LENGTH 16 #define MAX_STRING_LEN 254 /* RFC2138: string 0-253 octets */ # define VENDOR(x) ((x >> 16) & 0xffff) #ifdef _LIBRADIUS # define AUTH_HDR_LEN 20 # define VENDORPEC_USR 429 #define VENDORPEC_LUCENT 4846 #define VENDORPEC_STARENT 8164 # define DEBUG if (fr_debug_flag && fr_log_fp) fr_printf_log # define debug_pair(vp) do { if (fr_debug_flag && fr_log_fp) { \ vp_print(fr_log_fp, vp); \ } \ } while(0) # define TAG_VALID(x) ((x) > 0 && (x) < 0x20) # define TAG_VALID_ZERO(x) ((x) < 0x20) # define TAG_ANY -128 /* minimum signed char */ #endif #if defined(__GNUC__) # define PRINTF_LIKE(n) __attribute__ ((format(printf, n, n+1))) # define NEVER_RETURNS __attribute__ ((noreturn)) # define UNUSED __attribute__ ((unused)) # define BLANK_FORMAT " " /* GCC_LINT whines about empty formats */ #else # define PRINTF_LIKE(n) /* ignore */ # define NEVER_RETURNS /* ignore */ # define UNUSED /* ignore */ # define BLANK_FORMAT "" #endif typedef struct attr_flags { unsigned int addport : 1; /* add NAS-Port to IP address */ unsigned int has_tag : 1; /* tagged attribute */ unsigned int do_xlat : 1; /* strvalue is dynamic */ unsigned int unknown_attr : 1; /* not in dictionary */ unsigned int array : 1; /* pack multiples into 1 attr */ unsigned int has_value : 1; /* has a value */ unsigned int has_value_alias : 1; /* has a value alias */ unsigned int has_tlv : 1; /* has sub attributes */ unsigned int is_tlv : 1; /* is a sub attribute */ unsigned int encoded : 1; /* has been put into packet */ int8_t tag; /* tag for tunneled attributes */ uint8_t encrypt; /* encryption method */ } ATTR_FLAGS; /* * Values of the encryption flags. */ #define FLAG_ENCRYPT_NONE (0) #define FLAG_ENCRYPT_USER_PASSWORD (1) #define FLAG_ENCRYPT_TUNNEL_PASSWORD (2) #define FLAG_ENCRYPT_ASCEND_SECRET (3) extern const FR_NAME_NUMBER dict_attr_types[]; typedef struct dict_attr { unsigned int attr; int type; int vendor; ATTR_FLAGS flags; char name[1]; } DICT_ATTR; typedef struct dict_value { unsigned int attr; int value; char name[1]; } DICT_VALUE; typedef struct dict_vendor { int vendorpec; int type; /* length of type data */ int length; /* length of length data */ int flags; char name[1]; } DICT_VENDOR; typedef union value_pair_data { char strvalue[MAX_STRING_LEN]; uint8_t octets[MAX_STRING_LEN]; struct in_addr ipaddr; struct in6_addr ipv6addr; uint32_t date; uint32_t integer; int32_t sinteger; uint8_t filter[32]; uint8_t ifid[8]; /* struct? */ uint8_t ipv6prefix[18]; /* struct? */ uint8_t ether[6]; uint8_t *tlv; } VALUE_PAIR_DATA; typedef struct value_pair { const char *name; int attribute; int vendor; int type; size_t length; /* of data */ #ifdef __cplusplus /* * C++ hackery. The server and modules are all C, so * the defs here don't affect them. But any C++ code * gets excited over "operator", so we change the name. */ FR_TOKEN op_token; #else FR_TOKEN operator; #endif ATTR_FLAGS flags; struct value_pair *next; uint32_t lvalue; VALUE_PAIR_DATA data; } VALUE_PAIR; #define vp_strvalue data.strvalue #define vp_octets data.octets #define vp_ipv6addr data.ipv6addr #define vp_ifid data.ifid #define vp_ipv6prefix data.ipv6prefix #define vp_filter data.filter #define vp_ether data.ether #define vp_signed data.sinteger #define vp_tlv data.tlv #if 0 #define vp_ipaddr data.ipaddr.s_addr #define vp_date data.date #define vp_integer data.integer #else /* * These are left as lvalue until we audit the source for code * that prints to vp_strvalue for integer/ipaddr/date types. */ #define vp_ipaddr lvalue #define vp_date lvalue #define vp_integer lvalue #endif typedef struct fr_ipaddr_t { int af; /* address family */ union { struct in_addr ip4addr; struct in6_addr ip6addr; /* maybe defined in missing.h */ } ipaddr; uint32_t scope; /* for IPv6 */ } fr_ipaddr_t; /* * vector: Request authenticator from access-request packet * Put in there by rad_decode, and must be put in the * response RADIUS_PACKET as well before calling rad_send * * verified: Filled in by rad_decode for accounting-request packets * * data,data_len: Used between rad_recv and rad_decode. */ typedef struct radius_packet { int sockfd; fr_ipaddr_t src_ipaddr; fr_ipaddr_t dst_ipaddr; uint16_t src_port; uint16_t dst_port; int id; unsigned int code; uint32_t hash; uint8_t vector[AUTH_VECTOR_LEN]; time_t timestamp; uint8_t *data; int data_len; VALUE_PAIR *vps; ssize_t offset; } RADIUS_PACKET; /* * Printing functions. */ int fr_utf8_char(const uint8_t *str); size_t fr_print_string(const char *in, size_t inlen, char *out, size_t outlen); int vp_prints_value(char *out, size_t outlen, VALUE_PAIR *vp, int delimitst); const char *vp_print_name(char *buffer, size_t bufsize, int attr); int vp_prints(char *out, size_t outlen, VALUE_PAIR *vp); void vp_print(FILE *, VALUE_PAIR *); void vp_printlist(FILE *, VALUE_PAIR *); #define fprint_attr_val vp_print /* * Dictionary functions. */ int dict_addvendor(const char *name, int value); int dict_addattr(const char *name, int vendor, int type, int value, ATTR_FLAGS flags); int dict_addvalue(const char *namestr, const char *attrstr, int value); int dict_init(const char *dir, const char *fn); void dict_free(void); DICT_ATTR *dict_attrbyvalue(unsigned int attr); DICT_ATTR *dict_attrbyname(const char *attr); DICT_VALUE *dict_valbyattr(unsigned int attr, int val); DICT_VALUE *dict_valbyname(unsigned int attr, const char *val); const char *dict_valnamebyattr(unsigned int attr, int value); int dict_vendorbyname(const char *name); DICT_VENDOR *dict_vendorbyvalue(int vendor); #if 1 /* FIXME: compat */ #define dict_attrget dict_attrbyvalue #define dict_attrfind dict_attrbyname #define dict_valfind dict_valbyname /*#define dict_valget dict_valbyattr almost but not quite*/ #endif /* get around diffrent ctime_r styles */ #if defined(CTIMERSTYLE) && ( CTIMERSTYLE == SOLARISSTYLE) #define CTIME_R(a,b,c) ctime_r(a,b,c) #define ASCTIME_R(a,b,c) asctime_r(a,b,c) #else #define CTIME_R(a,b,c) ctime_r(a,b) #define ASCTIME_R(a,b,c) asctime_r(a,b) #endif /* md5.c */ void fr_md5_calc(uint8_t *, const uint8_t *, unsigned int); /* hmac.c */ void fr_hmac_md5(const uint8_t *text, int text_len, const uint8_t *key, int key_len, unsigned char *digest); /* hmacsha1.c */ void fr_hmac_sha1(const uint8_t *text, int text_len, const uint8_t *key, int key_len, uint8_t *digest); /* radius.c */ int rad_send(RADIUS_PACKET *, const RADIUS_PACKET *, const char *secret); int rad_packet_ok(RADIUS_PACKET *packet, int flags); RADIUS_PACKET *rad_recv(int fd, int flags); ssize_t rad_recv_header(int sockfd, fr_ipaddr_t *src_ipaddr, int *src_port, int *code); void rad_recv_discard(int sockfd); int rad_verify(RADIUS_PACKET *packet, RADIUS_PACKET *original, const char *secret); int rad_decode(RADIUS_PACKET *packet, RADIUS_PACKET *original, const char *secret); int rad_encode(RADIUS_PACKET *packet, const RADIUS_PACKET *original, const char *secret); int rad_sign(RADIUS_PACKET *packet, const RADIUS_PACKET *original, const char *secret); int rad_digest_cmp(const uint8_t *a, const uint8_t *b, size_t length); RADIUS_PACKET *rad_alloc(int newvector); RADIUS_PACKET *rad_alloc_reply(RADIUS_PACKET *); void rad_free(RADIUS_PACKET **); int rad_pwencode(char *encpw, size_t *len, const char *secret, const uint8_t *vector); int rad_pwdecode(char *encpw, size_t len, const char *secret, const uint8_t *vector); int rad_tunnel_pwencode(char *encpw, size_t *len, const char *secret, const uint8_t *vector); int rad_tunnel_pwdecode(uint8_t *encpw, size_t *len, const char *secret, const uint8_t *vector); int rad_chap_encode(RADIUS_PACKET *packet, uint8_t *output, int id, VALUE_PAIR *password); VALUE_PAIR *rad_attr2vp(const RADIUS_PACKET *packet, const RADIUS_PACKET *original, const char *secret, int attribute, int length, const uint8_t *data); ssize_t rad_vp2data(const VALUE_PAIR *vp, uint8_t *out, size_t outlen); int rad_vp2attr(const RADIUS_PACKET *packet, const RADIUS_PACKET *original, const char *secret, const VALUE_PAIR *vp, uint8_t *ptr); /* valuepair.c */ VALUE_PAIR *pairalloc(DICT_ATTR *da); VALUE_PAIR *paircreate_raw(int attr, int type, VALUE_PAIR *vp); VALUE_PAIR *paircreate(int attr, int type); void pairfree(VALUE_PAIR **); void pairbasicfree(VALUE_PAIR *pair); VALUE_PAIR *pairfind(VALUE_PAIR *, int); void pairdelete(VALUE_PAIR **, int); void pairadd(VALUE_PAIR **, VALUE_PAIR *); void pairreplace(VALUE_PAIR **first, VALUE_PAIR *add); int paircmp(VALUE_PAIR *check, VALUE_PAIR *data); VALUE_PAIR *paircopyvp(const VALUE_PAIR *vp); VALUE_PAIR *paircopy(VALUE_PAIR *vp); VALUE_PAIR *paircopy2(VALUE_PAIR *vp, int attr); void pairmove(VALUE_PAIR **to, VALUE_PAIR **from); void pairmove2(VALUE_PAIR **to, VALUE_PAIR **from, int attr); VALUE_PAIR *pairparsevalue(VALUE_PAIR *vp, const char *value); VALUE_PAIR *pairmake(const char *attribute, const char *value, int operator); VALUE_PAIR *pairread(const char **ptr, FR_TOKEN *eol); FR_TOKEN userparse(const char *buffer, VALUE_PAIR **first_pair); VALUE_PAIR *readvp2(FILE *fp, int *pfiledone, const char *errprefix); /* * Error functions. */ #ifdef _LIBRADIUS void fr_strerror_printf(const char *, ...) #ifdef __GNUC__ __attribute__ ((format (printf, 1, 2))) #endif ; #endif void fr_perror(const char *, ...) #ifdef __GNUC__ __attribute__ ((format (printf, 1, 2))) #endif ; extern const char *fr_strerror(void); extern int fr_dns_lookups; /* 0 = no dns lookups */ extern int fr_debug_flag; /* 0 = no debugging information */ extern int fr_max_attributes; /* per incoming packet */ #define FR_MAX_PACKET_CODE (52) extern const char *fr_packet_codes[FR_MAX_PACKET_CODE]; extern FILE *fr_log_fp; extern void rad_print_hex(RADIUS_PACKET *packet); void fr_printf_log(const char *, ...) #ifdef __GNUC__ __attribute__ ((format (printf, 1, 2))) #endif ; /* * Several handy miscellaneous functions. */ int fr_fault_setup(char const *cmd, char const *program); int fr_set_signal(int sig, sig_t func); const char * ip_ntoa(char *, uint32_t); char *ifid_ntoa(char *buffer, size_t size, uint8_t *ifid); uint8_t *ifid_aton(const char *ifid_str, uint8_t *ifid); int rad_lockfd(int fd, int lock_len); int rad_lockfd_nonblock(int fd, int lock_len); int rad_unlockfd(int fd, int lock_len); void fr_bin2hex(const uint8_t *bin, char *hex, size_t len); size_t fr_hex2bin(const char *hex, uint8_t *bin, size_t len); #ifndef HAVE_INET_PTON int inet_pton(int af, const char *src, void *dst); #endif #ifndef HAVE_INET_NTOP const char *inet_ntop(int af, const void *src, char *dst, size_t cnt); #endif #ifndef HAVE_CLOSEFROM int closefrom(int fd); #endif int fr_ipaddr_cmp(const fr_ipaddr_t *a, const fr_ipaddr_t *b); int ip_hton(const char *src, int af, fr_ipaddr_t *dst); const char *ip_ntoh(const fr_ipaddr_t *src, char *dst, size_t cnt); int fr_ipaddr2sockaddr(const fr_ipaddr_t *ipaddr, int port, struct sockaddr_storage *sa, socklen_t *salen); int fr_sockaddr2ipaddr(const struct sockaddr_storage *sa, socklen_t salen, fr_ipaddr_t *ipaddr, int * port); #ifdef ASCEND_BINARY /* filters.c */ int ascend_parse_filter(VALUE_PAIR *pair); void print_abinary(const VALUE_PAIR *vp, char *buffer, size_t len, int delimitst); #endif /*ASCEND_BINARY*/ /* random numbers in isaac.c */ /* context of random number generator */ typedef struct fr_randctx { uint32_t randcnt; uint32_t randrsl[256]; uint32_t randmem[256]; uint32_t randa; uint32_t randb; uint32_t randc; } fr_randctx; void fr_isaac(fr_randctx *ctx); void fr_randinit(fr_randctx *ctx, int flag); uint32_t fr_rand(void); /* like rand(), but better. */ void fr_rand_seed(const void *, size_t ); /* seed the random pool */ /* crypt wrapper from crypt.c */ int fr_crypt_check(const char *key, const char *salt); /* rbtree.c */ typedef struct rbtree_t rbtree_t; typedef struct rbnode_t rbnode_t; rbtree_t *rbtree_create(int (*Compare)(const void *, const void *), void (*freeNode)(void *), int replace_flag); void rbtree_free(rbtree_t *tree); int rbtree_insert(rbtree_t *tree, void *Data); rbnode_t *rbtree_insertnode(rbtree_t *tree, void *Data); void rbtree_delete(rbtree_t *tree, rbnode_t *Z); int rbtree_deletebydata(rbtree_t *tree, const void *data); rbnode_t *rbtree_find(rbtree_t *tree, const void *Data); void *rbtree_finddata(rbtree_t *tree, const void *Data); int rbtree_num_elements(rbtree_t *tree); void *rbtree_min(rbtree_t *tree); void *rbtree_node2data(rbtree_t *tree, rbnode_t *node); /* callback order for walking */ typedef enum { PreOrder, InOrder, PostOrder } RBTREE_ORDER; /* * The callback should be declared as: * int callback(void *context, void *data) * * The "context" is some user-defined context. * The "data" is the pointer to the user data in the node, * NOT the node itself. * * It should return 0 if all is OK, and !0 for any error. * The walking will stop on any error. */ int rbtree_walk(rbtree_t *tree, RBTREE_ORDER order, int (*callback)(void *, void *), void *context); /* * FIFOs */ typedef struct fr_fifo_t fr_fifo_t; typedef void (*fr_fifo_free_t)(void *); fr_fifo_t *fr_fifo_create(int max_entries, fr_fifo_free_t freeNode); void fr_fifo_free(fr_fifo_t *fi); int fr_fifo_push(fr_fifo_t *fi, void *data); void *fr_fifo_pop(fr_fifo_t *fi); void *fr_fifo_peek(fr_fifo_t *fi); int fr_fifo_num_elements(fr_fifo_t *fi); #ifdef __cplusplus } #endif #include #endif /*LIBRADIUS_H*/ freeradius-server/src/include/md4.h000066400000000000000000000051711257552170400175760ustar00rootroot00000000000000/* * md4.h Structures and prototypes for md4. * * Version: $Id$ * License: LGPL, but largely derived from a public domain source. * */ #ifndef _FR_MD4_H #define _FR_MD4_H #include RCSIDH(md4_h, "$Id$") #ifdef HAVE_INTTYPES_H #include #endif #ifdef HAVE_SYS_TYPES_H #include #endif #ifdef HAVE_STDINT_H #include #endif #include #ifdef WITH_OPENSSL_MD4 #include #endif #ifdef __cplusplus extern "C" { #endif void fr_md4_calc (unsigned char *, const unsigned char *, unsigned int); #ifndef WITH_OPENSSL_MD4 /* The below was retrieved from * http://www.openbsd.org/cgi-bin/cvsweb/src/include/md4.h?rev=1.12 * With the following changes: uint64_t => uint32_t[2] * Commented out #include * Commented out the __BEGIN and __END _DECLS, and the __attributes. * Commented out MD4End, MD4File, MD4Data * Commented out header file protection #ifndef,#define,#endif */ /* $OpenBSD: md4.h,v 1.12 2004/04/28 16:54:00 millert Exp $ */ /* * This code implements the MD4 message-digest algorithm. * The algorithm is due to Ron Rivest. This code was * written by Colin Plumb in 1993, no copyright is claimed. * This code is in the public domain; do with it what you wish. * Todd C. Miller modified the MD5 code to do MD4 based on RFC 1186. * * Equivalent code is available from RSA Data Security, Inc. * This code has been tested against that, and is equivalent, * except that you don't need to include two pages of legalese * with every copy. */ /*#ifndef _MD4_H_*/ /*#define _MD4_H_*/ #define MD4_BLOCK_LENGTH 64 #define MD4_DIGEST_LENGTH 16 #define MD4_DIGEST_STRING_LENGTH (MD4_DIGEST_LENGTH * 2 + 1) typedef struct FR_MD4Context { uint32_t state[4]; /* state */ uint32_t count[2]; /* number of bits, mod 2^64 */ uint8_t buffer[MD4_BLOCK_LENGTH]; /* input buffer */ } FR_MD4_CTX; /*__BEGIN_DECLS*/ void fr_MD4Init(FR_MD4_CTX *); void fr_MD4Update(FR_MD4_CTX *, const uint8_t *, size_t) /* __attribute__((__bounded__(__string__,2,3)))*/; void fr_MD4Final(uint8_t [MD4_DIGEST_LENGTH], FR_MD4_CTX *) /* __attribute__((__bounded__(__minbytes__,1,MD4_DIGEST_LENGTH)))*/; void fr_MD4Transform(uint32_t [4], const uint8_t [MD4_BLOCK_LENGTH]) /* __attribute__((__bounded__(__minbytes__,1,4))) __attribute__((__bounded__(__minbytes__,2,MD4_BLOCK_LENGTH)))*/; /*__END_DECLS*/ #else /* WITH_OPENSSL_MD4 */ #define FR_MD4_CTX MD4_CTX #define fr_MD4Init MD4_Init #define fr_MD4Update MD4_Update #define fr_MD4Final MD4_Final #define fr_MD4Transform MD4_Transform #endif #ifdef __cplusplus } #endif #endif /* _FR_MD4_H */ freeradius-server/src/include/md5.h000066400000000000000000000044151257552170400175770ustar00rootroot00000000000000/* * md5.h Structures and prototypes for md5. * * Version: $Id$ * License: LGPL, but largely derived from a public domain source. * */ #ifndef _FR_MD5_H #define _FR_MD5_H #include RCSIDH(md5_h, "$Id$") #ifdef HAVE_INTTYPES_H #include #endif #ifdef HAVE_SYS_TYPES_H #include #endif #ifdef HAVE_STDINT_H #include #endif #include #ifdef WITH_OPENSSL_MD5 #include #endif #ifdef __cplusplus extern "C" { #endif #ifndef WITH_OPENSSL_MD5 /* The below was retrieved from * http://www.openbsd.org/cgi-bin/cvsweb/~checkout~/src/sys/crypto/md5.h?rev=1.1 * With the following changes: uint64_t => uint32_t[2] * Commented out #include * Commented out the __BEGIN and __END _DECLS, and the __attributes. */ /* * This code implements the MD5 message-digest algorithm. * The algorithm is due to Ron Rivest. This code was * written by Colin Plumb in 1993, no copyright is claimed. * This code is in the public domain; do with it what you wish. * * Equivalent code is available from RSA Data Security, Inc. * This code has been tested against that, and is equivalent, * except that you don't need to include two pages of legalese * with every copy. */ #define MD5_BLOCK_LENGTH 64 #define MD5_DIGEST_LENGTH 16 typedef struct FR_MD5Context { uint32_t state[4]; /* state */ uint32_t count[2]; /* number of bits, mod 2^64 */ uint8_t buffer[MD5_BLOCK_LENGTH]; /* input buffer */ } FR_MD5_CTX; /* include */ /* __BEGIN_DECLS */ void fr_MD5Init(FR_MD5_CTX *); void fr_MD5Update(FR_MD5_CTX *, const uint8_t *, size_t) /* __attribute__((__bounded__(__string__,2,3)))*/; void fr_MD5Final(uint8_t [MD5_DIGEST_LENGTH], FR_MD5_CTX *) /* __attribute__((__bounded__(__minbytes__,1,MD5_DIGEST_LENGTH)))*/; void fr_MD5Transform(uint32_t [4], const uint8_t [MD5_BLOCK_LENGTH]) /* __attribute__((__bounded__(__minbytes__,1,4)))*/ /* __attribute__((__bounded__(__minbytes__,2,MD5_BLOCK_LENGTH)))*/; /* __END_DECLS */ #else /* WITH_OPENSSL_HASH */ #define FR_MD5_CTX MD5_CTX #define fr_MD5Init MD5_Init #define fr_MD5Update MD5_Update #define fr_MD5Final MD5_Final #define fr_MD5Transform MD5_Transform #endif #ifdef __cplusplus } #endif #endif /* _FR_MD5_H */ freeradius-server/src/include/missing.h000066400000000000000000000217701257552170400205660ustar00rootroot00000000000000#ifndef _FR_MISSING_H #define _FR_MISSING_H /* * missing.h Replacements for functions that are or can be * missing on some platforms. * * Version: $Id$ * */ #include RCSIDH(missing_h, "$Id$") #include #ifdef HAVE_STDINT_H #include #endif #ifdef HAVE_STDDEF_H #include #endif #ifdef HAVE_SYS_TYPES_H #include #endif #ifdef HAVE_INTTYPES_H #include #endif #ifdef HAVE_STRINGS_H #include #endif #ifdef HAVE_STRING_H #include #endif #ifdef HAVE_NETDB_H #include #endif #ifdef HAVE_NETINET_IN_H #include #endif #ifdef HAVE_ARPA_INET_H #include #endif #ifdef HAVE_SYS_SELECT_H #include #endif #ifdef HAVE_SYS_SOCKET_H #include #endif #ifdef HAVE_UNISTD_H #include #endif #ifndef HAVE_VSNPRINTF #include #endif #ifdef HAVE_SYS_LOCKING_H #include #endif /* * Check for inclusion of , versus * Taken verbatim from the autoconf manual. */ #if TIME_WITH_SYS_TIME # include # include #else # ifdef HAVE_SYS_TIME_H # include # else # include # endif #endif /* * Don't look for winsock.h if we're on cygwin. */ #ifndef __CYGWIN__ #ifdef HAVE_WINSOCK_H #include #endif #endif #ifdef __APPLE__ #undef DARWIN #define DARWIN (1) #endif #ifdef __cplusplus extern "C" { #endif /* * Functions from missing.c */ #ifndef HAVE_STRNCASECMP extern int strncasecmp(char *s1, char *s2, int n); #endif #ifndef HAVE_STRCASECMP extern int strcasecmp(char *s1, char *s2); #endif #ifndef HAVE_STRSEP extern char *strsep(char **stringp, const char *delim); #endif #ifndef HAVE_LOCALTIME_R struct tm; struct tm *localtime_r(const time_t *l_clock, struct tm *result); #endif #ifndef HAVE_CTIME_R char *ctime_r(const time_t *l_clock, char *l_buf); #endif #if defined(NEED_DECLARATION_CRYPT) || !defined(HAVE_CRYPT) char *crypt(char *key, char *salt); #endif #ifdef NEED_DECLARATION_STRNCASECMP int strncasecmp(char *s1, char *s2, int n); #endif #ifdef NEED_DECLARATION_STRCASECMP int strcasecmp(char *s1, char *s2); #endif #if defined(NEED_DECLARATION_INET_ATON) || !defined(HAVE_INET_ATON) struct in_addr; int inet_aton(const char *cp, struct in_addr *inp); #endif #ifndef HAVE_SETLINEBUF #ifdef HAVE_SETVBUF #define setlinebuf(x) setvbuf(x, NULL, _IOLBF, 0) #else #define setlinebuf(x) 0 #endif #endif #ifdef NEED_DECLARATION_SETLINEBUF #define setlinebuf(x) 0 #endif #ifdef NEED_DECLARATION_GETUSERSHELL char *getusershell(void); #endif #ifdef NEED_DECLARATION_ENDUSERSHELL void endusershell(void); #endif #ifndef INADDR_ANY #define INADDR_ANY ((uint32_t) 0x00000000) #endif #ifndef INADDR_LOOPBACK #define INADDR_LOOPBACK ((uint32_t) 0x7f000001) /* Inet 127.0.0.1 */ #endif #ifndef INADDR_NONE #define INADDR_NONE ((uint32_t) 0xffffffff) #endif #ifndef INADDRSZ #define INADDRSZ 4 #endif #ifndef INET_ADDRSTRLEN #define INET_ADDRSTRLEN 16 #endif #ifndef AF_UNSPEC #define AF_UNSPEC 0 #endif #ifndef AF_INET6 #define AF_INET6 10 #endif #ifndef HAVE_STRUCT_IN6_ADDR struct in6_addr { union { uint8_t u6_addr8[16]; uint16_t u6_addr16[8]; uint32_t u6_addr32[4]; } in6_u; #define s6_addr in6_u.u6_addr8 #define s6_addr16 in6_u.u6_addr16 #define s6_addr32 in6_u.u6_addr32 }; #ifndef IN6ADDRSZ #define IN6ADDRSZ 16 #endif #ifndef INET6_ADDRSTRLEN #define INET6_ADDRSTRLEN 46 #endif #ifndef IN6ADDR_ANY_INIT #define IN6ADDR_ANY_INIT {{{ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 }}} #endif #ifndef IN6ADDR_LOOPBACK_INIT #define IN6ADDR_LOOPBACK_INIT {{{ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1 }}} #endif #ifndef IN6_IS_ADDR_UNSPECIFIED #define IN6_IS_ADDR_UNSPECIFIED(a) \ (((__const uint32_t *) (a))[0] == 0 \ && ((__const uint32_t *) (a))[1] == 0 \ && ((__const uint32_t *) (a))[2] == 0 \ && ((__const uint32_t *) (a))[3] == 0) #endif #ifndef IN6_IS_ADDR_LOOPBACK #define IN6_IS_ADDR_LOOPBACK(a) \ (((__const uint32_t *) (a))[0] == 0 \ && ((__const uint32_t *) (a))[1] == 0 \ && ((__const uint32_t *) (a))[2] == 0 \ && ((__const uint32_t *) (a))[3] == htonl (1)) #endif #ifndef IN6_IS_ADDR_MULTICAST #define IN6_IS_ADDR_MULTICAST(a) (((__const uint8_t *) (a))[0] == 0xff) #endif #ifndef IN6_IS_ADDR_LINKLOCAL #define IN6_IS_ADDR_LINKLOCAL(a) \ ((((__const uint32_t *) (a))[0] & htonl (0xffc00000)) \ == htonl (0xfe800000)) #endif #ifndef IN6_IS_ADDR_SITELOCAL #define IN6_IS_ADDR_SITELOCAL(a) \ ((((__const uint32_t *) (a))[0] & htonl (0xffc00000)) \ == htonl (0xfec00000)) #endif #ifndef IN6_IS_ADDR_V4MAPPED #define IN6_IS_ADDR_V4MAPPED(a) \ ((((__const uint32_t *) (a))[0] == 0) \ && (((__const uint32_t *) (a))[1] == 0) \ && (((__const uint32_t *) (a))[2] == htonl (0xffff))) #endif #ifndef IN6_IS_ADDR_V4COMPAT #define IN6_IS_ADDR_V4COMPAT(a) \ ((((__const uint32_t *) (a))[0] == 0) \ && (((__const uint32_t *) (a))[1] == 0) \ && (((__const uint32_t *) (a))[2] == 0) \ && (ntohl (((__const uint32_t *) (a))[3]) > 1)) #endif #ifndef IN6_ARE_ADDR_EQUAL #define IN6_ARE_ADDR_EQUAL(a,b) \ ((((__const uint32_t *) (a))[0] == ((__const uint32_t *) (b))[0]) \ && (((__const uint32_t *) (a))[1] == ((__const uint32_t *) (b))[1]) \ && (((__const uint32_t *) (a))[2] == ((__const uint32_t *) (b))[2]) \ && (((__const uint32_t *) (a))[3] == ((__const uint32_t *) (b))[3])) #endif #endif /* HAVE_STRUCT_IN6_ADDR */ /* * Functions from getaddrinfo.c */ #ifndef HAVE_STRUCT_SOCKADDR_STORAGE struct sockaddr_storage { uint16_t ss_family; /* Address family, etc. */ char ss_padding[128 - (sizeof(uint16_t))]; }; #endif /* HAVE_STRUCT_SOCKADDR_STORAGE */ #ifndef HAVE_STRUCT_ADDRINFO /* for old netdb.h */ #ifndef EAI_SERVICE #define EAI_MEMORY 2 #define EAI_FAMILY 5 /* ai_family not supported */ #define EAI_NONAME 8 /* hostname nor servname provided, or not known */ #define EAI_SERVICE 9 /* servname not supported for ai_socktype */ #endif /* dummy value for old netdb.h */ #ifndef AI_PASSIVE #define AI_PASSIVE 1 #define AI_CANONNAME 2 #define AI_NUMERICHOST 4 #define NI_NUMERICHOST 2 #define NI_NAMEREQD 4 #define NI_NUMERICSERV 8 struct addrinfo { int ai_flags; /* Input flags. */ int ai_family; /* Protocol family for socket. */ int ai_socktype; /* Socket type. */ int ai_protocol; /* Protocol for socket. */ socklen_t ai_addrlen; /* Length of socket address. */ struct sockaddr *ai_addr; /* Socket address for socket. */ char *ai_canonname; /* Canonical name for service location. */ struct addrinfo *ai_next; /* Pointer to next in list. */ }; #endif /* AI_PASSIVE */ #endif /* HAVE_STRUCT_ADDRINFO */ /* Translate name of a service location and/or a service name to set of socket addresses. */ #ifndef HAVE_GETADDRINFO extern int getaddrinfo (const char *__name, const char *__service, const struct addrinfo *__req, struct addrinfo **__pai); /* Free `addrinfo' structure AI including associated storage. */ extern void freeaddrinfo (struct addrinfo *__ai); /* Convert error return from getaddrinfo() to a string. */ extern const char *gai_strerror (int __ecode); #endif /* Translate a socket address to a location and service name. */ #ifndef HAVE_GETNAMEINFO extern int getnameinfo (const struct sockaddr *__sa, socklen_t __salen, char *__host, size_t __hostlen, char *__serv, size_t __servlen, unsigned int __flags); #endif /* * Functions from snprintf.c */ #ifndef HAVE_VSNPRINTF extern int vsnprintf(char *str, size_t count, const char *fmt, va_list arg); #endif #ifndef HAVE_SNPRINTF extern int snprintf(char *str, size_t count, const char *fmt, ...); #endif /* * Functions from strl{cat,cpy}.c */ #ifndef HAVE_STRLCPY extern size_t strlcpy(char *dst, const char *src, size_t siz); #endif #ifndef HAVE_STRLCAT extern size_t strlcat(char *dst, const char *src, size_t siz); #endif #ifndef INT16SZ #define INT16SZ (2) #endif #ifndef HAVE_GMTIME_R struct tm *gmtime_r(const time_t *l_clock, struct tm *result); #endif #ifndef HAVE_GETTIMEOFDAY int gettimeofday (struct timeval *tv, void *tz); #endif #ifdef WIN32 #undef interface #undef mkdir #define mkdir(_d, _p) mkdir(_d) #define FR_DIR_SEP '\\' #define FR_DIR_IS_RELATIVE(p) ((*p && (p[1] != ':')) || ((*p != '\\') && (*p != '\\'))) #else #define FR_DIR_SEP '/' #define FR_DIR_IS_RELATIVE(p) ((*p) != '/') #endif #ifdef HAVE_SYS_LOCKING_H #define lockf _locking #define F_ULOCK _LK_UNLCK /* Unlock locked sections. */ #define F_LOCK _LK_LOCK /* Lock a section for exclusive use. */ #define F_TLOCK _LK_NBLCK /* Test and lock a section for exclusive use */ #define F_TEST _LK_RLCK /* Test section for locks by other processes. */ #endif #ifndef offsetof # define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER) #endif void timeval2ntp(const struct timeval *tv, uint8_t *ntp); void ntp2timeval(struct timeval *tv, const char *ntp); #ifdef __cplusplus } #endif #endif /* _FR_MISSING_H */ freeradius-server/src/include/modcall.h000066400000000000000000000026751257552170400205330ustar00rootroot00000000000000#ifndef FR_MODCALL_H #define FR_MODCALL_H /* modcall.h: the outside interface to the module-calling tree. Includes * functions to build the tree from the config file, and to call it by * feeding it REQUESTs. * * Version: $Id$ */ #include /* Need CONF_* definitions */ #ifdef __cplusplus extern "C" { #endif /* * For each authorize/authtype/etc, we have an ordered * tree of instances to call. This data structure keeps track * of that order. */ typedef struct modcallable modcallable; int modcall(int component, modcallable *c, REQUEST *request); /* Parse a module-method's config section (e.g. authorize{}) into a tree that * may be called with modcall() */ modcallable *compile_modgroup(modcallable *parent, int component, CONF_SECTION *cs); /* Create a single modcallable node that references a module instance. This * may be a CONF_SECTION containing action specifiers like "notfound = return" * or a simple CONF_PAIR, in which case the default actions are used. */ modcallable *compile_modsingle(modcallable *parent, int component, CONF_ITEM *ci, const char **modname); /* Add an entry to the end of a modgroup, creating it first if necessary */ void add_to_modcallable(modcallable **parent, modcallable *this, int component, const char *name); /* Free a tree returned by compile_modgroup or compile_modsingle */ void modcallable_free(modcallable **pc); #ifdef __cplusplus } #endif #endif freeradius-server/src/include/modpriv.h000066400000000000000000000031721257552170400205710ustar00rootroot00000000000000/* modpriv.h: Stuff needed by both modules.c and modcall.c, but should not be * accessed from anywhere else. * * Version: $Id$ */ #ifndef FR_MODPRIV_H #define FR_MODPRIV_H #include #include #ifndef WITHOUT_LIBLTDL #ifdef WITH_SYSTEM_LTDL #include #else #include "libltdl/ltdl.h" #endif #endif #ifdef __cplusplus extern "C" { #endif #ifdef WITHOUT_LIBLTDL typedef void *lt_dlhandle; lt_dlhandle lt_dlopenext(const char *name); void *lt_dlsym(lt_dlhandle handle, const char *symbol); int lt_dlclose(lt_dlhandle handle); const char *lt_dlerror(void); #define LTDL_SET_PRELOADED_SYMBOLS(_x) #define lt_dlinit(_x) (0) #define lt_dlexit(_x) #define lt_dlsetsearchpath(_x) #endif /* * Keep track of which modules we've loaded. */ typedef struct module_entry_t { char name[MAX_STRING_LEN]; const module_t *module; lt_dlhandle handle; } module_entry_t; typedef struct fr_module_hup_t fr_module_hup_t; /* * Per-instance data structure, to correlate the modules * with the instance names (may NOT be the module names!), * and the per-instance data structures. */ typedef struct module_instance_t { char name[MAX_STRING_LEN]; module_entry_t *entry; void *insthandle; #ifdef HAVE_PTHREAD_H pthread_mutex_t *mutex; #endif CONF_SECTION *cs; int force; int code; fr_module_hup_t *mh; } module_instance_t; module_instance_t *find_module_instance(CONF_SECTION *, const char *instname, int do_link); int module_hup_module(CONF_SECTION *cs, module_instance_t *node, time_t when); #ifdef __cplusplus } #endif #endif /* FR_MODPRIV_H */ freeradius-server/src/include/modules.h000066400000000000000000000054441257552170400205650ustar00rootroot00000000000000/* * module.h Interface to the RADIUS module system. * * Version: $Id$ * */ #ifndef RADIUS_MODULES_H #define RADIUS_MODULES_H #include RCSIDH(modules_h, "$Id$") #include #ifdef __cplusplus extern "C" { #endif typedef int (*packetmethod)(void *instance, REQUEST *request); enum { RLM_COMPONENT_AUTH = 0, RLM_COMPONENT_AUTZ, /* 1 */ RLM_COMPONENT_PREACCT, /* 2 */ RLM_COMPONENT_ACCT, /* 3 */ RLM_COMPONENT_SESS, /* 4 */ RLM_COMPONENT_PRE_PROXY, /* 5 */ RLM_COMPONENT_POST_PROXY, /* 6 */ RLM_COMPONENT_POST_AUTH, /* 7 */ #ifdef WITH_COA RLM_COMPONENT_RECV_COA, /* 8 */ RLM_COMPONENT_SEND_COA, /* 9 */ #endif RLM_COMPONENT_COUNT /* 8 / 10: How many components are there */ }; #define RLM_TYPE_THREAD_SAFE (0 << 0) #define RLM_TYPE_THREAD_UNSAFE (1 << 0) #define RLM_TYPE_CHECK_CONFIG_SAFE (1 << 1) #define RLM_TYPE_HUP_SAFE (1 << 2) #define RLM_MODULE_MAGIC_NUMBER ((uint32_t) (0xf4ee4ad2)) #define RLM_MODULE_INIT RLM_MODULE_MAGIC_NUMBER typedef struct module_t { uint32_t magic; /* may later be opaque struct */ const char *name; int type; int (*instantiate)(CONF_SECTION *mod_cs, void **instance); int (*detach)(void *instance); packetmethod methods[RLM_COMPONENT_COUNT]; } module_t; enum { RLM_MODULE_REJECT, /* immediately reject the request */ RLM_MODULE_FAIL, /* module failed, don't reply */ RLM_MODULE_OK, /* the module is OK, continue */ RLM_MODULE_HANDLED, /* the module handled the request, so stop. */ RLM_MODULE_INVALID, /* the module considers the request invalid. */ RLM_MODULE_USERLOCK, /* reject the request (user is locked out) */ RLM_MODULE_NOTFOUND, /* user not found */ RLM_MODULE_NOOP, /* module succeeded without doing anything */ RLM_MODULE_UPDATED, /* OK (pairs modified) */ RLM_MODULE_NUMCODES /* How many return codes there are */ }; int setup_modules(int, CONF_SECTION *); int detach_modules(void); int module_hup(CONF_SECTION *modules); int module_authorize(int type, REQUEST *request); int module_authenticate(int type, REQUEST *request); int module_preacct(REQUEST *request); int module_accounting(int type, REQUEST *request); int module_checksimul(int type, REQUEST *request, int maxsimul); int module_pre_proxy(int type, REQUEST *request); int module_post_proxy(int type, REQUEST *request); int module_post_auth(int type, REQUEST *request); #ifdef WITH_COA int module_recv_coa(int type, REQUEST *request); int module_send_coa(int type, REQUEST *request); #define MODULE_NULL_COA_FUNCS ,NULL,NULL #else #define MODULE_NULL_COA_FUNCS #endif int indexed_modcall(int comp, int idx, REQUEST *request); /* * For now, these are strongly tied together. */ int virtual_servers_load(CONF_SECTION *config); void virtual_servers_free(time_t when); #ifdef __cplusplus } #endif #endif /* RADIUS_MODULES_H */ freeradius-server/src/include/packet.h000066400000000000000000000057651257552170400203720ustar00rootroot00000000000000#ifndef FR_PACKET_H #define FR_PACKET_H /* * packet.h Structures and prototypes * for packet manipulation * * Version: $Id$ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2001,2002,2003,2004,2005,2006 The FreeRADIUS server project */ #include RCSIDH(packet_h, "$Id$") #ifdef __cplusplus extern "C" { #endif uint32_t fr_request_packet_hash(const RADIUS_PACKET *packet); uint32_t fr_reply_packet_hash(const RADIUS_PACKET *packet); int fr_packet_cmp(const RADIUS_PACKET *a, const RADIUS_PACKET *b); int fr_inaddr_any(fr_ipaddr_t *ipaddr); void fr_request_from_reply(RADIUS_PACKET *request, const RADIUS_PACKET *reply); int fr_socket(fr_ipaddr_t *ipaddr, int port); typedef struct fr_packet_list_t fr_packet_list_t; fr_packet_list_t *fr_packet_list_create(int alloc_id); void fr_packet_list_free(fr_packet_list_t *pl); int fr_packet_list_insert(fr_packet_list_t *pl, RADIUS_PACKET **request_p); RADIUS_PACKET **fr_packet_list_find(fr_packet_list_t *pl, RADIUS_PACKET *request); RADIUS_PACKET **fr_packet_list_find_byreply(fr_packet_list_t *pl, RADIUS_PACKET *reply); RADIUS_PACKET **fr_packet_list_yank(fr_packet_list_t *pl, RADIUS_PACKET *request); int fr_packet_list_num_elements(fr_packet_list_t *pl); int fr_packet_list_id_alloc(fr_packet_list_t *pl, RADIUS_PACKET *request); int fr_packet_list_id_free(fr_packet_list_t *pl, RADIUS_PACKET *request); int fr_packet_list_socket_add(fr_packet_list_t *pl, int sockfd); int fr_packet_list_socket_remove(fr_packet_list_t *pl, int sockfd); int fr_packet_list_walk(fr_packet_list_t *pl, void *ctx, fr_hash_table_walk_t callback); int fr_packet_list_fd_set(fr_packet_list_t *pl, fd_set *set); RADIUS_PACKET *fr_packet_list_recv(fr_packet_list_t *pl, fd_set *set); int fr_packet_list_num_incoming(fr_packet_list_t *pl); int fr_packet_list_num_outgoing(fr_packet_list_t *pl); /* * "find" returns a pointer to the RADIUS_PACKET* member in the * caller's structure. In order to get the pointer to the *top* * of the caller's structure, you have to subtract the offset to * the member from the returned pointer, and cast it to the * required type. */ # define fr_packet2myptr(TYPE, MEMBER, PTR) (TYPE *) (((char *)PTR) - offsetof(TYPE, MEMBER)) #ifdef __cplusplus } #endif #endif /* FR_PACKET_H */ freeradius-server/src/include/rad_assert.h000066400000000000000000000026021257552170400212350ustar00rootroot00000000000000#ifndef RAD_ASSERT_H #define RAD_ASSERT_H /* * rad_assert.h Debug assertions, with logging. * * Version: $Id$ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2000,2001,2006 The FreeRADIUS server project */ #include RCSIDH(rad_assert_h, "$Id$") #ifdef __cplusplus extern "C" { #endif extern void rad_assert_fail (const char *file, unsigned int line, const char *expr); #ifdef NDEBUG #define rad_assert(expr) ((void) (0)) #elif !defined(FR_SCAN_BUILD) #define rad_assert(expr) \ ((void) ((expr) ? (void) 0 : \ (void) rad_assert_fail (__FILE__, __LINE__, #expr))) #else #include #define rad_assert assert #endif #ifdef __cplusplus } #endif #endif freeradius-server/src/include/radius.h000066400000000000000000000221021257552170400203720ustar00rootroot00000000000000/* * radius.h Constants of the radius protocol. * * Version: $Id$ * */ #define PW_TYPE_STRING 0 #define PW_TYPE_INTEGER 1 #define PW_TYPE_IPADDR 2 #define PW_TYPE_DATE 3 #define PW_TYPE_ABINARY 4 #define PW_TYPE_OCTETS 5 #define PW_TYPE_IFID 6 #define PW_TYPE_IPV6ADDR 7 #define PW_TYPE_IPV6PREFIX 8 #define PW_TYPE_BYTE 9 #define PW_TYPE_SHORT 10 #define PW_TYPE_ETHERNET 11 #define PW_TYPE_SIGNED 12 #define PW_TYPE_COMBO_IP 13 #define PW_TYPE_TLV 14 #define PW_AUTHENTICATION_REQUEST 1 #define PW_AUTHENTICATION_ACK 2 #define PW_AUTHENTICATION_REJECT 3 #define PW_ACCOUNTING_REQUEST 4 #define PW_ACCOUNTING_RESPONSE 5 #define PW_ACCOUNTING_STATUS 6 #define PW_PASSWORD_REQUEST 7 #define PW_PASSWORD_ACK 8 #define PW_PASSWORD_REJECT 9 #define PW_ACCOUNTING_MESSAGE 10 #define PW_ACCESS_CHALLENGE 11 #define PW_STATUS_SERVER 12 #define PW_STATUS_CLIENT 13 #define PW_DISCONNECT_REQUEST 40 #define PW_DISCONNECT_ACK 41 #define PW_DISCONNECT_NAK 42 #define PW_COA_REQUEST 43 #define PW_COA_ACK 44 #define PW_COA_NAK 45 #define PW_AUTH_UDP_PORT 1812 #define PW_ACCT_UDP_PORT 1813 #define PW_POD_UDP_PORT 1700 #define PW_COA_UDP_PORT 3799 #define PW_USER_NAME 1 #define PW_USER_PASSWORD 2 #define PW_PASSWORD 2 #define PW_CHAP_PASSWORD 3 #define PW_NAS_IP_ADDRESS 4 #define PW_NAS_PORT 5 #define PW_SERVICE_TYPE 6 #define PW_FRAMED_PROTOCOL 7 #define PW_FRAMED_IP_ADDRESS 8 #define PW_FRAMED_IP_NETMASK 9 #define PW_FRAMED_ROUTING 10 #define PW_FILTER_ID 11 #define PW_FRAMED_MTU 12 #define PW_FRAMED_COMPRESSION 13 #define PW_LOGIN_IP_HOST 14 #define PW_LOGIN_SERVICE 15 #define PW_LOGIN_TCP_PORT 16 #define PW_OLD_PASSWORD 17 #define PW_REPLY_MESSAGE 18 #define PW_CALLBACK_NUMBER 19 #define PW_CALLBACK_ID 20 #if 0 /* * Deprecated, and no longer used. */ #define PW_EXPIRATION 21 #endif #define PW_FRAMED_ROUTE 22 #define PW_FRAMED_IPXNET 23 #define PW_STATE 24 #define PW_CLASS 25 #define PW_VENDOR_SPECIFIC 26 #define PW_SESSION_TIMEOUT 27 #define PW_IDLE_TIMEOUT 28 #define PW_CALLED_STATION_ID 30 #define PW_CALLING_STATION_ID 31 #define PW_NAS_IDENTIFIER 32 #define PW_PROXY_STATE 33 #define PW_ACCT_STATUS_TYPE 40 #define PW_ACCT_DELAY_TIME 41 #define PW_ACCT_INPUT_OCTETS 42 #define PW_ACCT_OUTPUT_OCTETS 43 #define PW_ACCT_SESSION_ID 44 #define PW_ACCT_AUTHENTIC 45 #define PW_ACCT_SESSION_TIME 46 #define PW_ACCT_INPUT_PACKETS 47 #define PW_ACCT_OUTPUT_PACKETS 48 #define PW_ACCT_TERMINATE_CAUSE 49 #define PW_EVENT_TIMESTAMP 55 #define PW_CHAP_CHALLENGE 60 #define PW_NAS_PORT_TYPE 61 #define PW_PORT_LIMIT 62 #define PW_ARAP_PASSWORD 70 #define PW_ARAP_FEATURES 71 #define PW_ARAP_ZONE_ACCESS 72 #define PW_ARAP_SECURITY 73 #define PW_ARAP_SECURITY_DATA 74 #define PW_PASSWORD_RETRY 75 #define PW_PROMPT 76 #define PW_CONNECT_INFO 77 #define PW_CONFIGURATION_TOKEN 78 #define PW_EAP_MESSAGE 79 #define PW_MESSAGE_AUTHENTICATOR 80 #define PW_ARAP_CHALLENGE_RESPONSE 84 #define PW_NAS_PORT_ID_STRING 87 #define PW_FRAMED_POOL 88 #define PW_CHARGEABLE_USER_IDENTITY 89 #define PW_NAS_IPV6_ADDRESS 95 #define PW_EXTENDED_ATTRIBUTE 192 #define PW_DIGEST_RESPONSE 206 #define PW_DIGEST_ATTRIBUTES 207 #define PW_FALL_THROUGH 500 #define PW_RELAX_FILTER 501 #define PW_EXEC_PROGRAM 502 #define PW_EXEC_PROGRAM_WAIT 503 #define PW_AUTH_TYPE 1000 #define PW_PREFIX 1003 #define PW_SUFFIX 1004 #define PW_GROUP 1005 #define PW_CRYPT_PASSWORD 1006 #define PW_CONNECT_RATE 1007 #define PW_ADD_PREFIX 1008 #define PW_ADD_SUFFIX 1009 #define PW_EXPIRATION 1010 #define PW_AUTZ_TYPE 1011 #define PW_ACCT_TYPE 1012 #define PW_SESSION_TYPE 1013 #define PW_POST_AUTH_TYPE 1014 #define PW_PRE_PROXY_TYPE 1015 #define PW_POST_PROXY_TYPE 1016 #define PW_PRE_ACCT_TYPE 1017 #define PW_EAP_TYPE 1018 #define PW_EAP_TLS_REQUIRE_CLIENT_CERT 1019 #define PW_CLIENT_SHORTNAME 1024 #define PW_LOAD_BALANCE_KEY 1025 #define PW_RAW_ATTRIBUTE 1026 #define PW_TNC_VLAN_ACCESS 1027 #define PW_TNC_VLAN_ISOLATE 1028 #define PW_USER_CATEGORY 1029 #define PW_GROUP_NAME 1030 #define PW_HUNTGROUP_NAME 1031 #define PW_SIMULTANEOUS_USE 1034 #define PW_STRIP_USER_NAME 1035 #define PW_HINT 1040 #define PAM_AUTH_ATTR 1041 #define PW_LOGIN_TIME 1042 #define PW_STRIPPED_USER_NAME 1043 #define PW_CURRENT_TIME 1044 #define PW_REALM 1045 #define PW_NO_SUCH_ATTRIBUTE 1046 #define PW_PACKET_TYPE 1047 #define PW_PROXY_TO_REALM 1048 #define PW_REPLICATE_TO_REALM 1049 #define PW_ACCT_SESSION_START_TIME 1050 #define PW_ACCT_UNIQUE_SESSION_ID 1051 #define PW_CLIENT_IP_ADDRESS 1052 #define PW_LDAP_USERDN 1053 #define PW_NS_MTA_MD5_PASSWORD 1054 #define PW_SQL_USER_NAME 1055 #define PW_LM_PASSWORD 1057 #define PW_NT_PASSWORD 1058 #define PW_SMB_ACCOUNT_CTRL 1059 #define PW_SMB_ACCOUNT_CTRL_TEXT 1061 #define PW_USER_PROFILE 1062 #define PW_DIGEST_REALM 1063 #define PW_DIGEST_NONCE 1064 #define PW_DIGEST_METHOD 1065 #define PW_DIGEST_URI 1066 #define PW_DIGEST_QOP 1067 #define PW_DIGEST_ALGORITHM 1068 #define PW_DIGEST_BODY_DIGEST 1069 #define PW_DIGEST_CNONCE 1070 #define PW_DIGEST_NONCE_COUNT 1071 #define PW_DIGEST_USER_NAME 1072 #define PW_POOL_NAME 1073 #define PW_LDAP_GROUP 1074 #define PW_MODULE_SUCCESS_MESSAGE 1075 #define PW_MODULE_FAILURE_MESSAGE 1076 #if 0 /* no longer used */ #define PW_X99_FAST 1077 #endif #define PW_REWRITE_RULE 1078 #define PW_SQL_GROUP 1079 #define PW_RESPONSE_PACKET_TYPE 1080 #define PW_DIGEST_HA1 1081 #define PW_MS_CHAP_USE_NTLM_AUTH 1082 #define PW_MS_CHAP_USER_NAME 1083 #define PW_PACKET_SRC_IP_ADDRESS 1084 #define PW_PACKET_DST_IP_ADDRESS 1085 #define PW_PACKET_SRC_PORT 1086 #define PW_PACKET_DST_PORT 1087 #define PW_PACKET_AUTHENTICATION_VECTOR 1088 #define PW_TIME_OF_DAY 1089 #define PW_REQUEST_PROCESSING_STAGE 1090 #define PW_CACHE_NO_CACHING 1091 #define PW_CACHE_DELETE_CACHE 1092 #define PW_SHA_PASSWORD 1093 #define PW_SSHA_PASSWORD 1094 #define PW_MD5_PASSWORD 1095 #define PW_SMD5_PASSWORD 1096 #define PW_PACKET_SRC_IPV6_ADDRESS 1097 #define PW_PACKET_DST_IPV6_ADDRESS 1098 #define PW_VIRTUAL_SERVER 1099 #define PW_CLEARTEXT_PASSWORD 1100 #define PW_PASSWORD_WITH_HEADER 1101 #define PW_SEND_COA_REQUEST 1107 #define PW_MODULE_RETURN_CODE 1108 #define PW_PACKET_ORIGINAL_TIMESTAMP 1109 #define PW_HOME_SERVER_POOL 1111 #define PW_RECV_COA_TYPE 1131 #define PW_SEND_COA_TYPE 1132 #define PW_MSCHAP_PASSWORD 1133 #define PW_PACKET_TRANSMIT_COUNTER 1134 #define PW_CACHED_SESSION_POLICY 1135 #define PW_CACHE_TTL 1140 #define PW_CACHE_STATUS_ONLY 1141 #define PW_CACHE_ENTRY_HITS 1142 #define PW_EAP_SESSION_ID 1146 /* * Integer Translations */ /* User Types */ #define PW_LOGIN_USER 1 #define PW_FRAMED_USER 2 #define PW_CALLBACK_LOGIN_USER 3 #define PW_CALLBACK_FRAMED_USER 4 #define PW_OUTBOUND_USER 5 #define PW_ADMINISTRATIVE_USER 6 #define PW_NAS_PROMPT_USER 7 #define PW_AUTHENTICATE_ONLY 8 #define PW_CALLBACK_NAS_PROMPT 9 /* Framed Protocols */ #define PW_PPP 1 #define PW_SLIP 2 /* Framed Routing Values */ #define PW_NONE 0 #define PW_BROADCAST 1 #define PW_LISTEN 2 #define PW_BROADCAST_LISTEN 3 /* Framed Compression Types */ #define PW_VAN_JACOBSEN_TCP_IP 1 /* Login Services */ #define PW_TELNET 0 #define PW_RLOGIN 1 #define PW_TCP_CLEAR 2 #define PW_PORTMASTER 3 /* Authentication Level */ #define PW_AUTHTYPE_LOCAL 0 #define PW_AUTHTYPE_SYSTEM 1 #define PW_AUTHTYPE_SECURID 2 #define PW_AUTHTYPE_CRYPT 3 #define PW_AUTHTYPE_REJECT 4 #define PW_AUTHTYPE_ACTIVCARD 5 #define PW_AUTHTYPE_EAP 6 #define PW_AUTHTYPE_ACCEPT 254 #define PW_AUTHTYPE_MS_CHAP 1028 /* Port Types */ #define PW_NAS_PORT_ASYNC 0 #define PW_NAS_PORT_SYNC 1 #define PW_NAS_PORT_ISDN 2 #define PW_NAS_PORT_ISDN_V120 3 #define PW_NAS_PORT_ISDN_V110 4 /* Status Types */ #define PW_STATUS_START 1 #define PW_STATUS_STOP 2 #define PW_STATUS_ALIVE 3 #define PW_STATUS_ACCOUNTING_ON 7 #define PW_STATUS_ACCOUNTING_OFF 8 /* * Vendor Private Enterprise Codes */ #define VENDORPEC_FREERADIUS 11344 /* * Vendor specific attributes */ #define PW_FREERADIUS_PROXIED_TO ((VENDORPEC_FREERADIUS<<16)|1) /* * Microsoft has vendor code 311. */ #define PW_MSCHAP_RESPONSE ((311 << 16) | 1) #define PW_MSCHAP_ERROR ((311 << 16) | 2) #define PW_MSCHAP_CHALLENGE ((311 << 16) | 11) #define PW_MSCHAP2_RESPONSE ((311 << 16) | 25) #define PW_MSCHAP2_SUCCESS ((311 << 16) | 26) /* * Old nonsense. Will be deleted ASAP */ #define PW_AUTHTYPE 1000 #define PW_AUTZTYPE 1011 #define PW_ACCTTYPE 1012 #define PW_SESSTYPE 1013 #define PW_POSTAUTHTYPE 1014 /* * Cisco's VLAN Query Protocol. */ #define PW_VQP_PACKET_TYPE 0x2b00 #define PW_VQP_ERROR_CODE 0x2b01 #define PW_VQP_SEQUENCE_NUMBER 0x2b02 #define PW_VQP_CLIENT_IP_ADDRESS 0x2c01 #define PW_VQP_PORT_NAME 0x2c02 #define PW_VQP_VLAN_NAME 0x2c03 #define PW_VQP_DOMAIN_NAME 0x2c04 #define PW_VQP_ETHERNET_FRAME 0x2c05 #define PW_VQP_MAC 0x2c06 #define PW_VQP_UNKNOWN 0x2c07 #define PW_VQP_COOKIE 0x2c08 freeradius-server/src/include/radiusd.h000066400000000000000000000441721257552170400205510ustar00rootroot00000000000000#ifndef RADIUSD_H #define RADIUSD_H /* * radiusd.h Structures, prototypes and global variables * for the FreeRADIUS server. * * Version: $Id$ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 1999,2000,2002,2003,2004,2005,2006,2007,2008 The FreeRADIUS server project * */ #include RCSIDH(radiusd_h, "$Id$") #include #include #include #include #include typedef struct auth_req REQUEST; #ifdef HAVE_PTHREAD_H #include #endif #ifndef NDEBUG #define REQUEST_MAGIC (0xdeadbeef) #endif /* * New defines for minimizing the size of the server, to strip * out functionality. In order to ensure that people don't have * to re-run "configure", after "cvs update", we play some * special games with the defines. i.e. any top-level "configure" * option should set both WITH_FOO and WITHOUT_FOO. After a few * weeks, the WITHOUT_FOO can be deleted from the configure script. */ #ifndef WITHOUT_PROXY #define WITH_PROXY (1) #endif #ifndef WITHOUT_DETAIL #define WITH_DETAIL (1) #endif #ifndef WITHOUT_SESSION_MGMT #define WITH_SESSION_MGMT (1) #endif #ifndef WITHOUT_UNLANG #define WITH_UNLANG (1) #endif #ifndef WITHOUT_ACCOUNTING #define WITH_ACCOUNTING (1) #else #ifdef WITH_SESSION_MGMT #error WITH_SESSION_MGMT is defined, but WITH_ACCOUNTING is not. Session management requires accounting. #endif #ifdef WITH_DETAIL #error WITH_DETAIL is defined, but WITH_ACCOUNTING is not. Detail file reading requires accounting. #endif #endif #ifndef WITHOUT_DYNAMIC_CLIENTS #define WITH_DYNAMIC_CLIENTS (1) #endif #ifndef WITHOUT_STATS #define WITH_STATS #endif #ifndef WITHOUT_COMMAND_SOCKET #ifdef HAVE_SYS_UN_H #define WITH_COMMAND_SOCKET (1) #else #define WITHOUT_COMMAND_SOCKET (1) #endif #endif #ifndef WITHOUT_COA #define WITH_COA (1) #ifndef WITH_PROXY #error WITH_COA requires WITH_PROXY #endif #endif #include #include #ifdef __cplusplus extern "C" { #endif /* * See util.c */ typedef struct request_data_t request_data_t; typedef struct radclient { fr_ipaddr_t ipaddr; int prefix; char *longname; char *secret; char *shortname; int message_authenticator; char *nastype; char *login; char *password; char *server; int number; /* internal use only */ const CONF_SECTION *cs; #ifdef WITH_STATS fr_stats_t *auth; #ifdef WITH_ACCOUNTING fr_stats_t *acct; #endif #endif #ifdef WITH_DYNAMIC_CLIENTS int lifetime; int dynamic; /* was dynamically defined */ time_t created; time_t last_new_client; char *client_server; int rate_limit; #endif #ifdef WITH_COA char *coa_name; home_server *coa_server; home_pool_t *coa_pool; #endif } RADCLIENT; /* * Types of listeners. * * Ordered by priority! */ typedef enum RAD_LISTEN_TYPE { RAD_LISTEN_NONE = 0, #ifdef WITH_PROXY RAD_LISTEN_PROXY, #endif RAD_LISTEN_AUTH, #ifdef WITH_ACCOUNTING RAD_LISTEN_ACCT, #endif #ifdef WITH_DETAIL RAD_LISTEN_DETAIL, #endif #ifdef WITH_VMPS RAD_LISTEN_VQP, #endif #ifdef WITH_DHCP RAD_LISTEN_DHCP, #endif #ifdef WITH_COMMAND_SOCKET RAD_LISTEN_COMMAND, #endif #ifdef WITH_COA RAD_LISTEN_COA, #endif RAD_LISTEN_MAX } RAD_LISTEN_TYPE; /* * For listening on multiple IP's and ports. */ typedef struct rad_listen_t rad_listen_t; typedef void (*radlog_func_t)(int, int, REQUEST *, const char *, ...); #define REQUEST_DATA_REGEX (0xadbeef00) #define REQUEST_MAX_REGEX (8) struct auth_req { #ifndef NDEBUG uint32_t magic; /* for debugging only */ #endif RADIUS_PACKET *packet; #ifdef WITH_PROXY RADIUS_PACKET *proxy; #endif RADIUS_PACKET *reply; #ifdef WITH_PROXY RADIUS_PACKET *proxy_reply; #endif VALUE_PAIR *config_items; VALUE_PAIR *username; VALUE_PAIR *password; struct main_config_t *root; request_data_t *data; RADCLIENT *client; #ifdef HAVE_PTHREAD_H int thread_id; #endif time_t timestamp; unsigned int number; /* internal server number */ rad_listen_t *listener; #ifdef WITH_PROXY rad_listen_t *proxy_listener; #endif int simul_max; /* see modcall.c && xlat.c */ #ifdef WITH_SESSION_MGMT int simul_count; int simul_mpp; /* WEIRD: 1 is false, 2 is true */ #endif int options; /* miscellanous options */ const char *module; /* for debugging unresponsive children */ const char *component; /* ditto */ struct timeval received; struct timeval when; /* to wake up */ int delay; int master_state; int child_state; RAD_LISTEN_TYPE priority; fr_event_t *ev; struct timeval next_when; fr_event_callback_t next_callback; int in_request_hash; #ifdef WITH_PROXY int in_proxy_hash; home_server *home_server; home_pool_t *home_pool; /* for dynamic failover */ struct timeval proxy_when; int num_proxied_requests; int num_proxied_responses; #endif const char *server; REQUEST *parent; radlog_func_t radlog; /* logging function, if set */ #ifdef WITH_COA REQUEST *coa; int num_coa_requests; #endif }; /* REQUEST typedef */ #define RAD_REQUEST_OPTION_NONE (0) #define RAD_REQUEST_OPTION_DEBUG (1) #define RAD_REQUEST_OPTION_DEBUG2 (2) #define RAD_REQUEST_OPTION_DEBUG3 (3) #define RAD_REQUEST_OPTION_DEBUG4 (4) #define REQUEST_ACTIVE (1) #define REQUEST_STOP_PROCESSING (2) #define REQUEST_COUNTED (3) #define REQUEST_QUEUED (1) #define REQUEST_RUNNING (2) #define REQUEST_PROXIED (3) #define REQUEST_REJECT_DELAY (4) #define REQUEST_CLEANUP_DELAY (5) #define REQUEST_DONE (6) /* * Function handler for requests. */ typedef int (*RAD_REQUEST_FUNP)(REQUEST *); typedef struct radclient_list RADCLIENT_LIST; typedef struct pair_list { const char *name; VALUE_PAIR *check; VALUE_PAIR *reply; int lineno; int order; struct pair_list *next; struct pair_list *lastdefault; } PAIR_LIST; typedef int (*rad_listen_recv_t)(rad_listen_t *, RAD_REQUEST_FUNP *, REQUEST **); typedef int (*rad_listen_send_t)(rad_listen_t *, REQUEST *); typedef int (*rad_listen_print_t)(const rad_listen_t *, char *, size_t); typedef int (*rad_listen_encode_t)(rad_listen_t *, REQUEST *); typedef int (*rad_listen_decode_t)(rad_listen_t *, REQUEST *); struct rad_listen_t { struct rad_listen_t *next; /* should be rbtree stuff */ /* * For normal sockets. */ RAD_LISTEN_TYPE type; int fd; const char *server; int status; rad_listen_recv_t recv; rad_listen_send_t send; rad_listen_encode_t encode; rad_listen_decode_t decode; rad_listen_print_t print; const CONF_SECTION *cs; void *data; #ifdef WITH_STATS fr_stats_t stats; #endif }; #define RAD_LISTEN_STATUS_INIT (0) #define RAD_LISTEN_STATUS_KNOWN (1) #define RAD_LISTEN_STATUS_CLOSED (2) #define RAD_LISTEN_STATUS_FINISH (3) typedef enum radlog_dest_t { RADLOG_STDOUT = 0, RADLOG_FILES, RADLOG_SYSLOG, RADLOG_STDERR, RADLOG_NULL, RADLOG_NUM_DEST } radlog_dest_t; typedef struct main_config_t { struct main_config *next; int refcount; fr_ipaddr_t myip; /* from the command-line only */ int port; /* from the command-line only */ int log_auth; int log_auth_badpass; int log_auth_goodpass; int allow_core_dumps; int debug_level; int proxy_requests; int reject_delay; int status_server; #ifdef ENABLE_OPENSSL_VERSION_CHECK int allow_vulnerable_openssl; #endif int max_request_time; int cleanup_delay; int max_requests; #ifdef DELETE_BLOCKED_REQUESTS int kill_unresponsive_children; #endif char *log_file; char *checkrad; const char *pid_file; rad_listen_t *listen; int syslog_facility; int radlog_fd; radlog_dest_t radlog_dest; CONF_SECTION *config; const char *name; const char *auth_badpass_msg; const char *auth_goodpass_msg; #ifdef WITH_POST_PROXY_AUTHORIZE int post_proxy_authorize; #endif int debug_memory; const char *panic_action; } MAIN_CONFIG_T; #define DEBUG if(debug_flag)log_debug #define DEBUG2 if (debug_flag > 1)log_debug #define DEBUG3 if (debug_flag > 2)log_debug #define DEBUG4 if (debug_flag > 3)log_debug #if __GNUC__ >= 3 #define RDEBUG(fmt, ...) if(request && request->radlog) request->radlog(L_DBG, 1, request, fmt, ## __VA_ARGS__) #define RDEBUG2(fmt, ...) if(request && request->radlog) request->radlog(L_DBG, 2, request, fmt, ## __VA_ARGS__) #define RDEBUG3(fmt, ...) if(request && request->radlog) request->radlog(L_DBG, 3, request, fmt, ## __VA_ARGS__) #define RDEBUG4(fmt, ...) if(request && request->radlog) request->radlog(L_DBG, 4, request, fmt, ## __VA_ARGS__) #else #define RDEBUG DEBUG #define RDEBUG2 DEBUG2 #define RDEBUG3 DEBUG3 #define RDEBUG4 DEBUG4 #endif #define SECONDS_PER_DAY 86400 #define MAX_REQUEST_TIME 30 #define CLEANUP_DELAY 5 #define MAX_REQUESTS 256 #define RETRY_DELAY 5 #define RETRY_COUNT 3 #define DEAD_TIME 120 #define EXEC_TIMEOUT 10 #define L_DBG 1 #define L_AUTH 2 #define L_INFO 3 #define L_ERR 4 #define L_PROXY 5 #define L_ACCT 6 #define L_CONS 128 /* for paircompare_register */ typedef int (*RAD_COMPARE_FUNC)(void *instance, REQUEST *,VALUE_PAIR *, VALUE_PAIR *, VALUE_PAIR *, VALUE_PAIR **); typedef enum request_fail_t { REQUEST_FAIL_UNKNOWN = 0, REQUEST_FAIL_NO_THREADS, /* no threads to handle it */ REQUEST_FAIL_DECODE, /* rad_decode didn't like it */ REQUEST_FAIL_PROXY, /* call to proxy modules failed */ REQUEST_FAIL_PROXY_SEND, /* proxy_send didn't like it */ REQUEST_FAIL_NO_RESPONSE, /* we weren't told to respond, so we reject */ REQUEST_FAIL_HOME_SERVER, /* the home server didn't respond */ REQUEST_FAIL_HOME_SERVER2, /* another case of the above */ REQUEST_FAIL_HOME_SERVER3, /* another case of the above */ REQUEST_FAIL_NORMAL_REJECT, /* authentication failure */ REQUEST_FAIL_SERVER_TIMEOUT /* the server took too long to process the request */ } request_fail_t; /* * Global variables. * * We really shouldn't have this many. */ extern const char *progname; extern int debug_flag; extern const char *radacct_dir; extern const char *radlog_dir; extern const char *radlib_dir; extern const char *radius_dir; extern const char *radius_libdir; extern uint32_t expiration_seconds; extern int log_stripped_names; extern int log_auth_detail; extern const char *radiusd_version; void radius_signal_self(int flag); #define RADIUS_SIGNAL_SELF_NONE (0) #define RADIUS_SIGNAL_SELF_HUP (1 << 0) #define RADIUS_SIGNAL_SELF_TERM (1 << 1) #define RADIUS_SIGNAL_SELF_EXIT (1 << 2) #define RADIUS_SIGNAL_SELF_DETAIL (1 << 3) #define RADIUS_SIGNAL_SELF_NEW_FD (1 << 4) #define RADIUS_SIGNAL_SELF_MAX (1 << 5) /* * Function prototypes. */ /* acct.c */ int rad_accounting(REQUEST *); /* session.c */ int rad_check_ts(uint32_t nasaddr, unsigned int port, const char *user, const char *sessionid); int session_zap(REQUEST *request, uint32_t nasaddr, unsigned int port, const char *user, const char *sessionid, uint32_t cliaddr, char proto,int session_time); /* radiusd.c */ #undef debug_pair void debug_pair(VALUE_PAIR *); void debug_pair_list(VALUE_PAIR *); int log_err (char *); /* util.c */ void (*reset_signal(int signo, void (*func)(int)))(int); void request_free(REQUEST **request); int rad_mkdir(char *directory, int mode); size_t rad_filename_escape(char *out, size_t outlen, char const *in); int rad_checkfilename(const char *filename); void *rad_malloc(size_t size); /* calls exit(1) on error! */ REQUEST *request_alloc(void); REQUEST *request_alloc_fake(REQUEST *oldreq); REQUEST *request_alloc_coa(REQUEST *request); int request_data_add(REQUEST *request, void *unique_ptr, int unique_int, void *opaque, void (*free_opaque)(void *)); void *request_data_get(REQUEST *request, void *unique_ptr, int unique_int); void *request_data_reference(REQUEST *request, void *unique_ptr, int unique_int); int rad_copy_string(char *dst, const char *src); int rad_copy_string_bare(char *dst, const char *src); int rad_copy_variable(char *dst, const char *from); int rad_expand_xlat(REQUEST *request, const char *cmd, int max_argc, const char *argv[], int can_fail, size_t argv_buflen, char *argv_buf); /* client.c */ RADCLIENT_LIST *clients_init(void); void clients_free(RADCLIENT_LIST *clients); RADCLIENT_LIST *clients_parse_section(CONF_SECTION *section); void client_free(RADCLIENT *client); int client_add(RADCLIENT_LIST *clients, RADCLIENT *client); #ifdef WITH_DYNAMIC_CLIENTS void client_delete(RADCLIENT_LIST *clients, RADCLIENT *client); RADCLIENT *client_create(RADCLIENT_LIST *clients, REQUEST *request); #endif RADCLIENT *client_find(const RADCLIENT_LIST *clients, const fr_ipaddr_t *ipaddr); RADCLIENT *client_findbynumber(const RADCLIENT_LIST *clients, int number); RADCLIENT *client_find_old(const fr_ipaddr_t *ipaddr); int client_validate(RADCLIENT_LIST *clients, RADCLIENT *master, RADCLIENT *c); RADCLIENT *client_read(const char *filename, int in_server, int flag); /* files.c */ int pairlist_read(const char *file, PAIR_LIST **list, int complain); void pairlist_free(PAIR_LIST **); /* version.c */ int ssl_check_version(int allow_vulnerable); const char *ssl_version(void); void version(void); /* log.c */ int vradlog(int, const char *, va_list ap); int radlog(int, const char *, ...) #ifdef __GNUC__ __attribute__ ((format (printf, 2, 3))) #endif ; int log_debug(const char *, ...) #ifdef __GNUC__ __attribute__ ((format (printf, 1, 2))) #endif ; void vp_listdebug(VALUE_PAIR *vp); void radlog_request(int lvl, int priority, REQUEST *request, const char *msg, ...) #ifdef __GNUC__ __attribute__ ((format (printf, 4, 5))) #endif ; /* auth.c */ char *auth_name(char *buf, size_t buflen, REQUEST *request, int do_cli); int rad_authenticate (REQUEST *); int rad_postauth(REQUEST *); int rad_virtual_server(REQUEST *); /* exec.c */ int radius_exec_program(const char *, REQUEST *, int, char *user_msg, int msg_len, int timeout, VALUE_PAIR *input_pairs, VALUE_PAIR **output_pairs, int shell_escape); /* timestr.c */ int timestr_match(char *, time_t); /* valuepair.c */ int paircompare_register(int attr, int otherattr, RAD_COMPARE_FUNC func, void *instance); void paircompare_unregister(int attr, RAD_COMPARE_FUNC func); int paircompare(REQUEST *req, VALUE_PAIR *request, VALUE_PAIR *check, VALUE_PAIR **reply); void pairxlatmove(REQUEST *, VALUE_PAIR **to, VALUE_PAIR **from); int radius_compare_vps(REQUEST *request, VALUE_PAIR *check, VALUE_PAIR *vp); int radius_callback_compare(REQUEST *req, VALUE_PAIR *request, VALUE_PAIR *check, VALUE_PAIR *check_pairs, VALUE_PAIR **reply_pairs); int radius_find_compare(int attribute); VALUE_PAIR *radius_paircreate(REQUEST *request, VALUE_PAIR **vps, int attribute, int type); VALUE_PAIR *radius_pairmake(REQUEST *request, VALUE_PAIR **vps, const char *attribute, const char *value, int operator); /* xlat.c */ typedef size_t (*RADIUS_ESCAPE_STRING)(char *out, size_t outlen, const char *in); int radius_xlat(char * out, int outlen, const char *fmt, REQUEST * request, RADIUS_ESCAPE_STRING func); typedef size_t (*RAD_XLAT_FUNC)(void *instance, REQUEST *, char *, char *, size_t, RADIUS_ESCAPE_STRING func); int xlat_register(const char *module, RAD_XLAT_FUNC func, void *instance); void xlat_unregister(const char *module, RAD_XLAT_FUNC func, void *instance); void xlat_free(void); /* threads.c */ extern int thread_pool_init(CONF_SECTION *cs, int *spawn_flag); extern void thread_pool_stop(void); extern int thread_pool_addrequest(REQUEST *, RAD_REQUEST_FUNP); extern pid_t rad_fork(void); extern pid_t rad_waitpid(pid_t pid, int *status); extern int total_active_threads(void); extern void thread_pool_lock(void); extern void thread_pool_unlock(void); extern void thread_pool_queue_stats(int *array); #ifndef HAVE_PTHREAD_H #define rad_fork(n) fork() #define rad_waitpid(a,b) waitpid(a,b, 0) #endif /* mainconfig.c */ /* Define a global config structure */ extern struct main_config_t mainconfig; int read_mainconfig(int reload); int free_mainconfig(void); void hup_mainconfig(void); void hup_logfile(void); void fr_suid_down(void); void fr_suid_up(void); void fr_suid_down_permanent(void); /* listen.c */ void listen_free(rad_listen_t **head); int listen_init(CONF_SECTION *cs, rad_listen_t **head); rad_listen_t *proxy_new_listener(fr_ipaddr_t *ipaddr, int exists); RADCLIENT *client_listener_find(const rad_listen_t *listener, const fr_ipaddr_t *ipaddr, int src_port); #ifdef WITH_STATS RADCLIENT_LIST *listener_find_client_list(const fr_ipaddr_t *ipaddr, int port); rad_listen_t *listener_find_byipaddr(const fr_ipaddr_t *ipaddr, int port); #endif /* event.c */ int radius_event_init(CONF_SECTION *cs, int spawn_flag); void radius_event_free(void); int radius_event_process(void); void radius_handle_request(REQUEST *request, RAD_REQUEST_FUNP fun); int received_request(rad_listen_t *listener, RADIUS_PACKET *packet, REQUEST **prequest, RADCLIENT *client); REQUEST *received_proxy_response(RADIUS_PACKET *packet); void event_new_fd(rad_listen_t *listener); /* evaluate.c */ int radius_evaluate_condition(REQUEST *request, int modreturn, int depth, const char **ptr, int evaluate_it, int *presult); int radius_update_attrlist(REQUEST *request, CONF_SECTION *cs, VALUE_PAIR *input_vps, const char *name); void radius_pairmove(REQUEST *request, VALUE_PAIR **to, VALUE_PAIR *from); #ifdef __cplusplus } #endif #endif /*RADIUSD_H*/ freeradius-server/src/include/radsniff.h000066400000000000000000000065361257552170400207140ustar00rootroot00000000000000/* * radsniff.h Structures and defines for the RADIUS sniffer. * * Version: $Id$ * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2006 The FreeRADIUS server project * Copyright 2006 Nicolas Baradakis */ #include RCSIDH(radsniff_h, "$Id$") #include #include /* * The number of bytes in an ethernet (MAC) address. */ #define ETHER_ADDR_LEN 6 /* * Structure of a DEC/Intel/Xerox or 802.3 Ethernet header. */ struct ethernet_header { uint8_t ethernet_dhost[ETHER_ADDR_LEN]; uint8_t ethernet_shost[ETHER_ADDR_LEN]; uint16_t ethernet_type; }; /* * Length of a DEC/Intel/Xerox or 802.3 Ethernet header. * Note that some compilers may pad "struct ether_header" to * a multiple of 4 *bytes, for example, so "sizeof (struct * ether_header)" may not give the right answer. */ #define ETHER_HDRLEN 14 /* * Structure of an internet header, naked of options. */ struct ip_header { uint8_t ip_vhl; /* header length, version */ #define IP_V(ip) (((ip)->ip_vhl & 0xf0) >> 4) #define IP_HL(ip) ((ip)->ip_vhl & 0x0f) uint8_t ip_tos; /* type of service */ uint16_t ip_len; /* total length */ uint16_t ip_id; /* identification */ uint16_t ip_off; /* fragment offset field */ #define I_DF 0x4000 /* dont fragment flag */ #define IP_MF 0x2000 /* more fragments flag */ #define IP_OFFMASK 0x1fff /* mask for fragmenting bits */ uint8_t ip_ttl; /* time to live */ uint8_t ip_p; /* protocol */ uint16_t ip_sum; /* checksum */ struct in_addr ip_src,ip_dst; /* source and dest address */ }; /* * UDP protocol header. * Per RFC 768, September, 1981. */ struct udp_header { uint16_t udp_sport; /* source port */ uint16_t udp_dport; /* destination port */ uint16_t udp_ulen; /* udp length */ uint16_t udp_sum; /* udp checksum */ }; /* * RADIUS packet length. * RFC 2865, Section 3., subsection 'length' says: * " ... and maximum length is 4096." */ #define MAX_RADIUS_LEN 4096 #define MIN_RADIUS_LEN 20 #define SNAPLEN (sizeof(struct ethernet_header) + sizeof(struct ip_header) + sizeof(struct udp_header) + MAX_RADIUS_LEN) typedef struct radius_packet_t { uint8_t code; uint8_t id; uint8_t length[2]; uint8_t vector[AUTH_VECTOR_LEN]; uint8_t data[1]; } radius_packet_t; #define AUTH_HDR_LEN 20 freeradius-server/src/include/radutmp.h000066400000000000000000000032751257552170400205710ustar00rootroot00000000000000/* * radutmp.h Definitions for the Radius UTMP file. * * Version: $Id$ */ #ifndef _RADUTMP_H #define _RADUTMP_H #include RCSIDH(radutmp_h, "$Id$") #ifdef __cplusplus extern "C" { #endif /* * Types of connection. */ #ifndef P_UNKNOWN # define P_UNKNOWN 0 # define P_LOCAL 'L' # define P_RLOGIN 'R' # define P_SLIP 'S' # define P_CSLIP 'C' # define P_PPP 'P' # define P_AUTOPPP 'A' # define P_TELNET 'E' # define P_TCPCLEAR 'T' # define P_TCPLOGIN 'U' # define P_CONSOLE '!' # define P_SHELL 'X' #endif #define P_IDLE 0 #define P_LOGIN 1 struct radutmp { char login[32]; /* Loginname */ /* FIXME: extend to 48 or 64 bytes */ unsigned int nas_port; /* Port on the terminal server (32 bits). */ char session_id[8]; /* Radius session ID (first 8 bytes at least)*/ /* FIXME: extend to 16 or 32 bytes */ unsigned int nas_address; /* IP of portmaster. */ unsigned int framed_address; /* SLIP/PPP address or login-host. */ int proto; /* Protocol. */ time_t time; /* Time entry was last updated. */ time_t delay; /* Delay time of request */ int type; /* Type of entry (login/logout) */ char porttype; /* Porttype (I=ISDN A=Async T=Async-ISDN */ char res1,res2,res3; /* Fills up to one int */ char caller_id[16]; /* Calling-Station-ID */ char reserved[12]; /* 3 ints reserved */ }; /* * Take the size of the structure from the actual structure definition. */ #define RUT_NAMESIZE sizeof(((struct radutmp *) NULL)->login) #define RUT_SESSSIZE sizeof(((struct radutmp *) NULL)->session_id) #ifdef __cplusplus } #endif #endif /* _RADUTMP_H */ freeradius-server/src/include/realms.h000066400000000000000000000056551257552170400204040ustar00rootroot00000000000000#ifndef REALMS_H #define REALMS_H /* * realms.h Structures, prototypes and global variables * for realms * * Version: $Id$ * */ #include RCSIDH(realms_h, "$Id$") #ifdef __cplusplus extern "C" { #endif #define HOME_TYPE_INVALID (0) #define HOME_TYPE_AUTH (1) #define HOME_TYPE_ACCT (2) #ifdef WITH_COA #define HOME_TYPE_COA (3) #endif #define HOME_PING_CHECK_NONE (0) #define HOME_PING_CHECK_STATUS_SERVER (1) #define HOME_PING_CHECK_REQUEST (2) #define HOME_STATE_ALIVE (0) #define HOME_STATE_ZOMBIE (1) #define HOME_STATE_IS_DEAD (2) typedef struct home_server { const char *name; const char *hostname; const char *server; /* for internal proxying */ fr_ipaddr_t ipaddr; int port; int type; /* auth/acct */ /* * Maybe also have list of source IP/ports, && socket? */ const char *secret; fr_event_t *ev; struct timeval when; int response_window; int no_response_fail; int max_outstanding; /* don't overload it */ int currently_outstanding; int message_authenticator; time_t last_packet; struct timeval revive_time; struct timeval zombie_period_start; int zombie_period; /* unresponsive for T, mark it dead */ int state; int ping_check; const char *ping_user_name; const char *ping_user_password; int ping_interval; int num_pings_to_alive; int num_received_pings; int ping_timeout; int revive_interval; /* if it doesn't support pings */ CONF_SECTION *cs; #ifdef WITH_COA int coa_irt; int coa_mrc; int coa_mrt; int coa_mrd; #endif #ifdef WITH_STATS int number; fr_ipaddr_t src_ipaddr; /* preferred source IP address */ fr_stats_t stats; fr_stats_ema_t ema; #endif } home_server; typedef enum home_pool_type_t { HOME_POOL_INVALID = 0, HOME_POOL_LOAD_BALANCE, HOME_POOL_FAIL_OVER, HOME_POOL_CLIENT_BALANCE, HOME_POOL_CLIENT_PORT_BALANCE, HOME_POOL_KEYED_BALANCE } home_pool_type_t; typedef struct home_pool_t { const char *name; home_pool_type_t type; int server_type; CONF_SECTION *cs; const char *virtual_server; /* for pre/post-proxy */ home_server *fallback; int num_home_servers; home_server *servers[1]; } home_pool_t; typedef struct _realm { const char *name; int striprealm; home_pool_t *auth_pool; home_pool_t *acct_pool; } REALM; int realms_init(CONF_SECTION *config); void realms_free(void); REALM *realm_find(const char *name); /* name is from a packet */ REALM *realm_find2(const char *name); /* ... with name taken from realm_find */ home_server *home_server_ldb(const char *realmname, home_pool_t *pool, REQUEST *request); home_server *home_server_find(fr_ipaddr_t *ipaddr, int port); int home_server_create_listeners(void); #ifdef WITH_COA home_server *home_server_byname(const char *name, int type); #endif #ifdef WITH_STATS home_server *home_server_bynumber(int number); #endif home_pool_t *home_pool_byname(const char *name, int type); #ifdef __cplusplus } #endif #endif /* REALMS_H */ freeradius-server/src/include/sha1.h000066400000000000000000000023061257552170400177430ustar00rootroot00000000000000#ifndef _FR_SHA1_H #define _FR_SHA1_H #ifdef WITH_OPENSSL_SHA1 #include #endif #ifdef __cplusplus extern "C" { #endif #ifndef WITH_OPENSSL_SHA1 typedef struct { uint32_t state[5]; uint32_t count[2]; uint8_t buffer[64]; } fr_SHA1_CTX; void fr_SHA1Transform(uint32_t state[5], const uint8_t buffer[64]); void fr_SHA1Init(fr_SHA1_CTX* context); void fr_SHA1Update(fr_SHA1_CTX* context, const uint8_t* data, unsigned int len); void fr_SHA1Final(uint8_t digest[20], fr_SHA1_CTX* context); /* * this version implements a raw SHA1 transform, no length is appended, * nor any 128s out to the block size. * * Hmm... this function doesn't appear to be used anywhere. */ void fr_SHA1FinalNoLen(uint8_t digest[20], fr_SHA1_CTX* context); #else /* WITH_OPENSSL_SHA1 */ #define fr_SHA1_CTX SHA_CTX #define fr_SHA1Init SHA1_Init #define fr_SHA1Update SHA1_Update #define fr_SHA1Final SHA1_Final #define fr_SHA1Transform SHA1_Transform #endif /* * FIPS 186-2 PRF based upon SHA1. * * Hmm... this is only used in src/modules/rlm_eap/libeap/ * why is the prototype here? */ extern void fips186_2prf(uint8_t mk[20], uint8_t finalkey[160]); #ifdef __cplusplus } #endif #endif /* _FR_SHA1_H */ freeradius-server/src/include/soh.h000066400000000000000000000023621257552170400177020ustar00rootroot00000000000000#ifndef FR_SOH_H #define FR_SOH_H /* * soh.h Microsoft SoH support * * Version: $Id$ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2010 Phil Mayers */ #include RCSIDH(soh_h, "$Id$") #ifdef __cplusplus extern "C" { #endif int soh_verify(REQUEST *request, VALUE_PAIR *sohvp, const uint8_t *data, unsigned int data_len); uint16_t soh_pull_be_16(const uint8_t *p); uint32_t soh_pull_be_24(const uint8_t *p); uint32_t soh_pull_be_32(const uint8_t *p); #ifdef __cplusplus } #endif #endif freeradius-server/src/include/stats.h000066400000000000000000000062201257552170400202440ustar00rootroot00000000000000#ifndef FR_STATS_H #define FR_STATS_H /* * stats.h Structures and functions for statistics. * * Version: $Id$ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2005,2006,2007,2008 The FreeRADIUS server project */ #include RCSIDH(stats_h, "$Id$") #ifdef __cplusplus extern "C" { #endif #ifdef WITH_STATS_64BIT typedef uint64_t fr_uint_t; #else typedef uint32_t fr_uint_t; #endif #ifdef WITH_STATS typedef struct fr_stats_t { fr_uint_t total_requests; fr_uint_t total_invalid_requests; fr_uint_t total_dup_requests; fr_uint_t total_responses; fr_uint_t total_access_accepts; fr_uint_t total_access_rejects; fr_uint_t total_access_challenges; fr_uint_t total_malformed_requests; fr_uint_t total_bad_authenticators; fr_uint_t total_packets_dropped; fr_uint_t total_no_records; fr_uint_t total_unknown_types; } fr_stats_t; typedef struct fr_stats_ema_t { int window; int f1, f10; int ema1, ema10; } fr_stats_ema_t; extern fr_stats_t radius_auth_stats; extern fr_stats_t radius_acct_stats; #ifdef WITH_PROXY extern fr_stats_t proxy_auth_stats; extern fr_stats_t proxy_acct_stats; #endif void radius_stats_init(int flag); void request_stats_final(REQUEST *request); void request_stats_reply(REQUEST *request); void radius_stats_ema(fr_stats_ema_t *ema, struct timeval *start, struct timeval *end); #define RAD_STATS_INC(_x) _x++ #ifdef WITH_ACCOUNTING #define RAD_STATS_TYPE_INC(_listener, _x) if (_listener->type == RAD_LISTEN_AUTH) { \ radius_auth_stats._x++; \ } else if (_listener->type == RAD_LISTEN_ACCT) { \ radius_acct_stats._x++; } \ _listener->stats._x++ #define RAD_STATS_CLIENT_INC(_listener, _client, _x) if (_listener->type == RAD_LISTEN_AUTH) \ _client->auth->_x++; \ else if (_listener->type == RAD_LISTEN_ACCT) \ _client->acct->_x++ #else /* WITH_ACCOUNTING */ #define RAD_STATS_TYPE_INC(_listener, _x) { radius_auth_stats._x++; _listener->stats._x++; } #define RAD_STATS_CLIENT_INC(_listener, _client, _x) _client->auth->_x++ #endif /* WITH_ACCOUNTING */ #else /* WITH_STATS */ #define request_stats_init(_x) #define request_stats_final(_x) #define RAD_STATS_INC(_x) #define RAD_STATS_TYPE_INC(_listener, _x) #define RAD_STATS_CLIENT_INC(_listener, _client, _x) #endif #ifdef __cplusplus } #endif #endif /* FR_STATS_H */ freeradius-server/src/include/sysutmp.h000066400000000000000000000042761257552170400206430ustar00rootroot00000000000000/* * sysutmp.h Compatibility stuff for the different UTMP systems. * * Version: $Id$ */ #ifndef SYSUTMP_H_INCLUDED #define SYSUTMP_H_INCLUDED #include RCSIDH(sysutmp_h, "$Id$") /* * If we have BOTH utmp.h and utmpx.h, then * we prefer to use utmp.h, but only on systems other than Solaris. */ #if !defined(_sun) && !defined(sgi) && !defined(hpux) # ifdef HAVE_UTMP_H # undef HAVE_UTMPX_H # endif #endif #if defined(HAVE_UTMP_H) || defined(HAVE_UTMPX_H) /* UTMP stuff. Uses utmpx on svr4 */ #ifdef HAVE_UTMPX_H # include # include # define utmp utmpx # define UT_NAMESIZE 32 # define UT_LINESIZE 32 # define UT_HOSTSIZE 257 #if defined(hpux) || defined(__FreeBSD__) # define ut_name ut_user #endif #else # include #endif #ifdef __cplusplus extern "C" { #endif #ifdef __osf__ # define UT_NAMESIZE 32 # define UT_LINESIZE 32 # define UT_HOSTSIZE 64 #endif #if (defined(__FreeBSD__) && !defined(HAVE_UTMPX_H)) || defined(__NetBSD__) || defined(bsdi) || defined(__OpenBSD__) || defined(__APPLE__) # ifndef UTMP_FILE # define UTMP_FILE "/var/run/utmp" # endif # define ut_user ut_name #endif /* * Generate definitions for systems which are too broken to * do it themselves. * * Hmm... this means that we can probably get rid of a lot of * the static defines above, as the following lines will generate * the proper defines for any system. */ #ifndef UT_LINESIZE #define UT_LINESIZE sizeof(((struct utmp *) NULL)->ut_line) #endif #ifndef UT_NAMESIZE #define UT_NAMESIZE sizeof(((struct utmp *) NULL)->ut_user) #endif #ifndef UT_HOSTSIZE #define UT_HOSTSIZE sizeof(((struct utmp *) NULL)->ut_host) #endif #else /* HAVE_UTMP_H */ /* * No file - define stuff ourselves (minimally). */ #define UT_LINESIZE 16 #define UT_NAMESIZE 16 #define UT_HOSTSIZE 16 #define USER_PROCESS 7 #define DEAD_PROCESS 8 #define UTMP_FILE "/var/run/utmp" #define ut_name ut_user struct utmp { short ut_type; int ut_pid; char ut_line[UT_LINESIZE]; char ut_id[4]; long ut_time; char ut_user[UT_NAMESIZE]; char ut_host[UT_HOSTSIZE]; long ut_addr; }; #endif /* HAVE_UTMP_H */ #ifdef __cplusplus } #endif #endif /* SYSUTMP_H_INCLUDED */ freeradius-server/src/include/threads.h000066400000000000000000000073231257552170400205450ustar00rootroot00000000000000/* * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ /* * $Id$ * * @file threads.h * @brief Macros to abstract Thread Local Storage * * @copyright 2013 The FreeRADIUS server project */ typedef void (*pthread_destructor_t)(void*); /* * First figure whether we have compiler support this is usually the case except on OSX, * where we need to use pthreads. */ #ifdef HAVE_THREAD_TLS /* * GCC on most Linux systems */ # define __THREAD __thread #elif defined(HAVE_DECLSPEC_THREAD) /* * Visual C++, Borland (microsoft) */ # define __THREAD __declspec(thread) #endif /* * Now we define three macros for initialisation, updating, and retrieving */ #ifndef WITH_THREADS # define fr_thread_local_setup(_x, _n) static _x _n /* * @todo we really need to put destructors in a global array and call them on server exit */ # define fr_thread_local_init(_n, _f) _n # define fr_thread_local_set(_n, _v) ((int)!((_n = _v) || 1)) # define fr_thread_local_get(_n) _n #elif !defined(HAVE_PTHREAD_H) #error WITH_THREADS defined, but pthreads not available #elif defined(__THREAD) # include # define fr_thread_local_setup(_t, _n) static __THREAD _t _n;\ static pthread_key_t __fr_thread_local_key_##_n;\ static pthread_once_t __fr_thread_local_once_##_n = PTHREAD_ONCE_INIT;\ static pthread_destructor_t __fr_thread_local_destructor_##_n = NULL;\ static inline void __fr_thread_local_key_init_##_n(void)\ {\ (void) pthread_key_create(&__fr_thread_local_key_##_n, __fr_thread_local_destructor_##_n);\ }\ static inline _t __fr_thread_local_init_##_n(pthread_destructor_t func)\ {\ __fr_thread_local_destructor_##_n = func;\ (void) pthread_once(&__fr_thread_local_once_##_n, __fr_thread_local_key_init_##_n);\ return _n;\ } # define fr_thread_local_init(_n, _f) __fr_thread_local_init_##_n(_f) # define fr_thread_local_set(_n, _v) ((int)!((_n = _v) || 1)) # define fr_thread_local_get(_n) _n #elif defined(HAVE_PTHREAD_H) # include # define fr_thread_local_setup(_t, _n) \ static pthread_key_t __fr_thread_local_key_##_n;\ static pthread_once_t __fr_thread_local_once_##_n = PTHREAD_ONCE_INIT;\ static pthread_destructor_t __fr_thread_local_destructor_##_n = NULL; \ static inline void __fr_thread_local_key_init_##_n(void)\ {\ (void) pthread_key_create(&__fr_thread_local_key_##_n, __fr_thread_local_destructor_##_n);\ }\ static inline _t __fr_thread_local_init_##_n(pthread_destructor_t func)\ {\ __fr_thread_local_destructor_##_n = func;\ (void) pthread_once(&__fr_thread_local_once_##_n, __fr_thread_local_key_init_##_n);\ return pthread_getspecific(__fr_thread_local_key_##_n);\ }\ static inline _t __fr_thread_local_get_##_n(void)\ {\ return pthread_getspecific(__fr_thread_local_key_##_n);\ }\ static inline int __fr_thread_local_set_##_n(_t val)\ {\ return pthread_setspecific(__fr_thread_local_key_##_n, val);\ } # define fr_thread_local_init(_n, _f) __fr_thread_local_init_##_n(_f) # define fr_thread_local_set(_n, _v) __fr_thread_local_set_##_n(_v) # define fr_thread_local_get(_n) __fr_thread_local_get_##_n() #endif freeradius-server/src/include/token.h000066400000000000000000000045641257552170400202370ustar00rootroot00000000000000#ifndef FR_TOKEN_H #define FR_TOKEN_H /* * token.h Special tokens. * * $Id$ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2001,2006 The FreeRADIUS server project */ #include RCSIDH(token_h, "$Id$") #ifdef __cplusplus extern "C" { #endif typedef enum fr_token_t { T_OP_INVALID = 0, /* invalid token */ T_EOL, /* end of line */ T_LCBRACE, /* { */ T_RCBRACE, /* } */ T_LBRACE, /* ( */ T_RBRACE, /* ) 5 */ T_COMMA, /* , */ T_SEMICOLON, /* ; */ T_OP_ADD, /* += */ T_OP_SUB, /* -= */ T_OP_SET, /* := 10 */ T_OP_EQ, /* = */ T_OP_NE, /* != */ T_OP_GE, /* >= */ T_OP_GT, /* > */ T_OP_LE, /* <= 15 */ T_OP_LT, /* < */ T_OP_REG_EQ, /* =~ */ T_OP_REG_NE, /* !~ */ T_OP_CMP_TRUE, /* =* */ T_OP_CMP_FALSE, /* !* 20 */ T_OP_CMP_EQ, /* == */ T_HASH, /* # */ T_BARE_WORD, /* bare word */ T_DOUBLE_QUOTED_STRING, /* "foo" */ T_SINGLE_QUOTED_STRING, /* 'foo' 25 */ T_BACK_QUOTED_STRING, /* `foo` */ T_TOKEN_LAST } FR_TOKEN; #define T_EQSTART T_OP_ADD #define T_EQEND (T_OP_CMP_EQ + 1) typedef struct FR_NAME_NUMBER { const char *name; int number; } FR_NAME_NUMBER; int fr_str2int(const FR_NAME_NUMBER *table, const char *name, int def); const char *fr_int2str(const FR_NAME_NUMBER *table, int number, const char *def); int getword (const char **ptr, char *buf, int buflen); int getbareword (const char **ptr, char *buf, int buflen); FR_TOKEN gettoken(const char **ptr, char *buf, int buflen); FR_TOKEN getstring(const char **ptr, char *buf, int buflen); const char *fr_token_name(int); #ifdef __cplusplus } #endif #endif /* FR_TOKEN_H */ freeradius-server/src/include/udpfromto.h000066400000000000000000000012151257552170400211240ustar00rootroot00000000000000#ifndef UDPFROMTO_H #define UDPFROMTO_H /* * Version: $Id$ * */ #include RCSIDH(udpfromtoh, "$Id$") #include #include #ifdef __cplusplus extern "C" { #endif #ifdef WITH_UDPFROMTO int udpfromto_init(int s); int recvfromto(int s, void *buf, size_t len, int flags, struct sockaddr *from, socklen_t *fromlen, struct sockaddr *to, socklen_t *tolen); int sendfromto(int s, void *buf, size_t len, int flags, struct sockaddr *from, socklen_t fromlen, struct sockaddr *to, socklen_t tolen); #endif #ifdef __cplusplus } #endif #endif freeradius-server/src/include/vmps.h000066400000000000000000000011201257552170400200650ustar00rootroot00000000000000#ifndef VMPS_H #define VMPS_H /* * vmps.h Routines to handle VMPS sockets. * * Version: $Id$ * */ #include RCSIDH(vmps_h, "$Id$") #ifdef __cplusplus extern "C" { #endif int vqp_socket_recv(rad_listen_t *listener, RAD_REQUEST_FUNP *pfun, REQUEST **prequest); int vqp_socket_send(rad_listen_t *listener, REQUEST *request); int vqp_socket_encode(UNUSED rad_listen_t *listener, REQUEST *request); int vqp_socket_decode(UNUSED rad_listen_t *listener, REQUEST *request); int vmps_process(REQUEST *request); #ifdef __cplusplus } #endif #endif /* VMPS_H */ freeradius-server/src/include/vqp.h000066400000000000000000000024321257552170400177150ustar00rootroot00000000000000#ifndef FR_VQP_H #define FR_VQP_H /* * vqp.h Structures and prototypes for Cisco's VLAN Query Protocol * * Version: $Id$ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2007 The FreeRADIUS server project * Copyright 2007 Alan DeKok */ #include RCSIDH(vqp_h, "$Id$") #ifdef __cplusplus extern "C" { #endif RADIUS_PACKET *vqp_recv(int sockfd); int vqp_send(RADIUS_PACKET *packet); int vqp_decode(RADIUS_PACKET *packet); int vqp_encode(RADIUS_PACKET *packet, RADIUS_PACKET *original); #ifdef __cplusplus } #endif #endif /* FR_VQP_H */ freeradius-server/src/lib/000077500000000000000000000000001257552170400160605ustar00rootroot00000000000000freeradius-server/src/lib/LICENSE000066400000000000000000000635001257552170400170710ustar00rootroot00000000000000 GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 Copyright (C) 1991, 1999 Free Software Foundation, Inc. 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below. When we speak of free software, we are referring to freedom of use, 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 and use pieces of it in new free programs; and that you are informed that you can do these things. To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights. We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library. To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs. When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library. We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances. For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License. In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system. Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. GNU LESSER GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, 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 library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete 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 distribute a copy of this License along with the Library. 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 Library or any portion of it, thus forming a work based on the Library, 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) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, 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 Library, 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 Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you 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. If distribution of 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 satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with. c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be 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. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library 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. 9. 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 Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library 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 with this License. 11. 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 Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library 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 Library. 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. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library 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. 13. The Free Software Foundation may publish revised and/or new versions of the Lesser 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 Library 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 Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, 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 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "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 LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. 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 LIBRARY 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 LIBRARY (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 LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), 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 Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. 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) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. , 1 April 1990 Ty Coon, President of Vice That's all there is to it! freeradius-server/src/lib/Makefile000066400000000000000000000027751257552170400175330ustar00rootroot00000000000000# # Makefile # # Version: $Id$ # include ../../Make.inc SRCS = debug.c dict.c filters.c hash.c hmac.c hmacsha1.c isaac.c \ log.c misc.c missing.c md4.c md5.c print.c radius.c \ rbtree.c sha1.c snprintf.c strlcat.c strlcpy.c token.c \ udpfromto.c valuepair.c fifo.c packet.c event.c \ getaddrinfo.c vqp.c heap.c dhcp.c base64.c LT_OBJS = $(SRCS:.c=.lo) INCLUDES = ../include/radius.h ../include/libradius.h \ ../include/missing.h ../include/autoconf.h \ ../include/ident.h CFLAGS += -D_LIBRADIUS -I$(top_builddir)/src # if you have problems with things that need SHA1-HMAC, this will # dump the key and the input to the hash so you can compare to what # the other end is doing. #CFLAGS += -DHMAC_SHA1_DATA_PROBLEMS ifeq ($(USE_SHARED_LIBS),yes) LINK_MODE = -export-dynamic else LINK_MODE = -static endif TARGET = $(LIBPREFIX)freeradius-radius # Define new rule for libtool objects %.lo : %.c $(LIBTOOL) --mode=compile --tag=CC $(CC) $(CFLAGS) -c $< .PHONY: all clean install reconfig all: $(TARGET).la $(TARGET).la: $(LT_OBJS) $(LIBTOOL) --mode=link --tag=CC $(CC) -release $(RADIUSD_VERSION) \ $(LDFLAGS) $(LINK_MODE) -o $@ -rpath $(libdir) $^ $(LT_OBJS): $(INCLUDES) clean: rm -f *.o *.lo $(TARGET).la rm -rf .libs install: all $(INSTALL) -d -m 755 $(R)$(libdir) $(LIBTOOL) --mode=install $(INSTALL) -c $(TARGET).la \ $(R)$(libdir)/$(TARGET).la rm -f $(R)$(libdir)/$(TARGET)-$(RADIUSD_VERSION).la; ln -s $(TARGET).la $(R)$(libdir)/$(TARGET)-$(RADIUSD_VERSION).la reconfig: freeradius-server/src/lib/README000066400000000000000000000001511257552170400167350ustar00rootroot00000000000000 The files in this directory are placed under the LGPL, as given in the LICENSE file in this directory. freeradius-server/src/lib/base64.c000066400000000000000000000310611257552170400173110ustar00rootroot00000000000000/* base64.c -- Encode binary data using printable characters. Copyright (C) 1999, 2000, 2001, 2004, 2005, 2006 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* Written by Simon Josefsson. Partially adapted from GNU MailUtils * (mailbox/filter_trans.c, as of 2004-11-28). Improved by review * from Paul Eggert, Bruno Haible, and Stepan Kasal. * * See also RFC 3548 . * * Be careful with error checking. Here is how you would typically * use these functions: * * bool ok = fr_base64_decode_alloc (in, inlen, &out, &outlen); * if (!ok) * FAIL: input was not valid base64 * if (out == NULL) * FAIL: memory allocation error * OK: data in OUT/OUTLEN * * size_t outlen = fr_base64_encode_alloc (in, inlen, &out); * if (out == NULL && outlen == 0 && inlen != 0) * FAIL: input too long * if (out == NULL) * FAIL: memory allocation error * OK: data in OUT/OUTLEN. * */ #include RCSID("$Id$") #include #include /* Get malloc. */ #include /* Get UCHAR_MAX. */ #include /* C89 compliant way to cast 'char' to 'unsigned char'. */ static inline unsigned char to_uchar (char ch) { return ch; } /* Base64 encode IN array of size INLEN into OUT array of size OUTLEN. If OUTLEN is less than FR_BASE64_ENC_LENGTH(INLEN), write as many bytes as possible. If OUTLEN is larger than FR_BASE64_ENC_LENGTH(INLEN), also zero terminate the output buffer. */ void fr_base64_encode (const uint8_t *in, size_t inlen, char *out, size_t outlen) { static const char b64str[64] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; while (inlen && outlen) { *out++ = b64str[(in[0] >> 2) & 0x3f]; if (!--outlen) break; *out++ = b64str[((in[0] << 4) + (--inlen ? in[1] >> 4 : 0)) & 0x3f]; if (!--outlen) break; *out++ = (inlen ? b64str[((in[1] << 2) + (--inlen ? in[2] >> 6 : 0)) & 0x3f] : '='); if (!--outlen) break; *out++ = inlen ? b64str[in[2] & 0x3f] : '='; if (!--outlen) break; if (inlen) inlen--; if (inlen) in += 3; } if (outlen) *out = '\0'; } /* Allocate a buffer and store zero terminated base64 encoded data from array IN of size INLEN, returning FR_BASE64_ENC_LENGTH(INLEN), i.e., the length of the encoded data, excluding the terminating zero. On return, the OUT variable will hold a pointer to newly allocated memory that must be deallocated by the caller. If output string length would overflow, 0 is returned and OUT is set to NULL. If memory allocation failed, OUT is set to NULL, and the return value indicates length of the requested memory block, i.e., FR_BASE64_ENC_LENGTH(inlen) + 1. */ size_t fr_base64_encode_alloc (const uint8_t *in, size_t inlen, char **out) { size_t outlen = 1 + FR_BASE64_ENC_LENGTH (inlen); /* Check for overflow in outlen computation. * * If there is no overflow, outlen >= inlen. * * If the operation (inlen + 2) overflows then it yields at most +1, so * outlen is 0. * * If the multiplication overflows, we lose at least half of the * correct value, so the result is < ((inlen + 2) / 3) * 2, which is * less than (inlen + 2) * 0.66667, which is less than inlen as soon as * (inlen > 4). */ if (inlen > outlen) { *out = NULL; return 0; } *out = malloc (outlen); if (!*out) return outlen; fr_base64_encode (in, inlen, *out, outlen); return outlen - 1; } /* With this approach this file works independent of the charset used (think EBCDIC). However, it does assume that the characters in the Base64 alphabet (A-Za-z0-9+/) are encoded in 0..255. POSIX 1003.1-2001 require that char and unsigned char are 8-bit quantities, though, taking care of that problem. But this may be a potential problem on non-POSIX C99 platforms. IBM C V6 for AIX mishandles "#define B64(x) ...'x'...", so use "_" as the formal parameter rather than "x". */ #define B64(_) \ ((_) == 'A' ? 0 \ : (_) == 'B' ? 1 \ : (_) == 'C' ? 2 \ : (_) == 'D' ? 3 \ : (_) == 'E' ? 4 \ : (_) == 'F' ? 5 \ : (_) == 'G' ? 6 \ : (_) == 'H' ? 7 \ : (_) == 'I' ? 8 \ : (_) == 'J' ? 9 \ : (_) == 'K' ? 10 \ : (_) == 'L' ? 11 \ : (_) == 'M' ? 12 \ : (_) == 'N' ? 13 \ : (_) == 'O' ? 14 \ : (_) == 'P' ? 15 \ : (_) == 'Q' ? 16 \ : (_) == 'R' ? 17 \ : (_) == 'S' ? 18 \ : (_) == 'T' ? 19 \ : (_) == 'U' ? 20 \ : (_) == 'V' ? 21 \ : (_) == 'W' ? 22 \ : (_) == 'X' ? 23 \ : (_) == 'Y' ? 24 \ : (_) == 'Z' ? 25 \ : (_) == 'a' ? 26 \ : (_) == 'b' ? 27 \ : (_) == 'c' ? 28 \ : (_) == 'd' ? 29 \ : (_) == 'e' ? 30 \ : (_) == 'f' ? 31 \ : (_) == 'g' ? 32 \ : (_) == 'h' ? 33 \ : (_) == 'i' ? 34 \ : (_) == 'j' ? 35 \ : (_) == 'k' ? 36 \ : (_) == 'l' ? 37 \ : (_) == 'm' ? 38 \ : (_) == 'n' ? 39 \ : (_) == 'o' ? 40 \ : (_) == 'p' ? 41 \ : (_) == 'q' ? 42 \ : (_) == 'r' ? 43 \ : (_) == 's' ? 44 \ : (_) == 't' ? 45 \ : (_) == 'u' ? 46 \ : (_) == 'v' ? 47 \ : (_) == 'w' ? 48 \ : (_) == 'x' ? 49 \ : (_) == 'y' ? 50 \ : (_) == 'z' ? 51 \ : (_) == '0' ? 52 \ : (_) == '1' ? 53 \ : (_) == '2' ? 54 \ : (_) == '3' ? 55 \ : (_) == '4' ? 56 \ : (_) == '5' ? 57 \ : (_) == '6' ? 58 \ : (_) == '7' ? 59 \ : (_) == '8' ? 60 \ : (_) == '9' ? 61 \ : (_) == '+' ? 62 \ : (_) == '/' ? 63 \ : -1) static const signed char b64[0x100] = { B64 (0), B64 (1), B64 (2), B64 (3), B64 (4), B64 (5), B64 (6), B64 (7), B64 (8), B64 (9), B64 (10), B64 (11), B64 (12), B64 (13), B64 (14), B64 (15), B64 (16), B64 (17), B64 (18), B64 (19), B64 (20), B64 (21), B64 (22), B64 (23), B64 (24), B64 (25), B64 (26), B64 (27), B64 (28), B64 (29), B64 (30), B64 (31), B64 (32), B64 (33), B64 (34), B64 (35), B64 (36), B64 (37), B64 (38), B64 (39), B64 (40), B64 (41), B64 (42), B64 (43), B64 (44), B64 (45), B64 (46), B64 (47), B64 (48), B64 (49), B64 (50), B64 (51), B64 (52), B64 (53), B64 (54), B64 (55), B64 (56), B64 (57), B64 (58), B64 (59), B64 (60), B64 (61), B64 (62), B64 (63), B64 (64), B64 (65), B64 (66), B64 (67), B64 (68), B64 (69), B64 (70), B64 (71), B64 (72), B64 (73), B64 (74), B64 (75), B64 (76), B64 (77), B64 (78), B64 (79), B64 (80), B64 (81), B64 (82), B64 (83), B64 (84), B64 (85), B64 (86), B64 (87), B64 (88), B64 (89), B64 (90), B64 (91), B64 (92), B64 (93), B64 (94), B64 (95), B64 (96), B64 (97), B64 (98), B64 (99), B64 (100), B64 (101), B64 (102), B64 (103), B64 (104), B64 (105), B64 (106), B64 (107), B64 (108), B64 (109), B64 (110), B64 (111), B64 (112), B64 (113), B64 (114), B64 (115), B64 (116), B64 (117), B64 (118), B64 (119), B64 (120), B64 (121), B64 (122), B64 (123), B64 (124), B64 (125), B64 (126), B64 (127), B64 (128), B64 (129), B64 (130), B64 (131), B64 (132), B64 (133), B64 (134), B64 (135), B64 (136), B64 (137), B64 (138), B64 (139), B64 (140), B64 (141), B64 (142), B64 (143), B64 (144), B64 (145), B64 (146), B64 (147), B64 (148), B64 (149), B64 (150), B64 (151), B64 (152), B64 (153), B64 (154), B64 (155), B64 (156), B64 (157), B64 (158), B64 (159), B64 (160), B64 (161), B64 (162), B64 (163), B64 (164), B64 (165), B64 (166), B64 (167), B64 (168), B64 (169), B64 (170), B64 (171), B64 (172), B64 (173), B64 (174), B64 (175), B64 (176), B64 (177), B64 (178), B64 (179), B64 (180), B64 (181), B64 (182), B64 (183), B64 (184), B64 (185), B64 (186), B64 (187), B64 (188), B64 (189), B64 (190), B64 (191), B64 (192), B64 (193), B64 (194), B64 (195), B64 (196), B64 (197), B64 (198), B64 (199), B64 (200), B64 (201), B64 (202), B64 (203), B64 (204), B64 (205), B64 (206), B64 (207), B64 (208), B64 (209), B64 (210), B64 (211), B64 (212), B64 (213), B64 (214), B64 (215), B64 (216), B64 (217), B64 (218), B64 (219), B64 (220), B64 (221), B64 (222), B64 (223), B64 (224), B64 (225), B64 (226), B64 (227), B64 (228), B64 (229), B64 (230), B64 (231), B64 (232), B64 (233), B64 (234), B64 (235), B64 (236), B64 (237), B64 (238), B64 (239), B64 (240), B64 (241), B64 (242), B64 (243), B64 (244), B64 (245), B64 (246), B64 (247), B64 (248), B64 (249), B64 (250), B64 (251), B64 (252), B64 (253), B64 (254), B64 (255) }; #if UCHAR_MAX == 255 # define uchar_in_range(c) TRUE #else # define uchar_in_range(c) ((c) <= 255) #endif /* Return TRUE if CH is a character from the Base64 alphabet, and FALSE otherwise. Note that '=' is padding and not considered to be part of the alphabet. */ int fr_isbase64 (char ch) { return uchar_in_range (to_uchar (ch)) && 0 <= b64[to_uchar (ch)]; } /* Decode base64 encoded input array IN of length INLEN to output array OUT that can hold *OUTLEN bytes. Return TRUE if decoding was successful, i.e. if the input was valid base64 data, FALSE otherwise. If *OUTLEN is too small, as many bytes as possible will be written to OUT. On return, *OUTLEN holds the length of decoded bytes in OUT. Note that as soon as any non-alphabet characters are encountered, decoding is stopped and FALSE is returned. This means that, when applicable, you must remove any line terminators that is part of the data stream before calling this function. */ int fr_base64_decode (const char *in, size_t inlen, char *out, size_t *outlen) { size_t outleft = *outlen; while (inlen >= 2) { if (!fr_isbase64 (in[0]) || !fr_isbase64 (in[1])) break; if (outleft) { *out++ = ((b64[to_uchar (in[0])] << 2) | (b64[to_uchar (in[1])] >> 4)); outleft--; } if (inlen == 2) break; if (in[2] == '=') { if (inlen != 4) break; if (in[3] != '=') break; } else { if (!fr_isbase64 (in[2])) break; if (outleft) { *out++ = (((b64[to_uchar (in[1])] << 4) & 0xf0) | (b64[to_uchar (in[2])] >> 2)); outleft--; } if (inlen == 3) break; if (in[3] == '=') { if (inlen != 4) break; } else { if (!fr_isbase64 (in[3])) break; if (outleft) { *out++ = (((b64[to_uchar (in[2])] << 6) & 0xc0) | b64[to_uchar (in[3])]); outleft--; } } } in += 4; inlen -= 4; } *outlen -= outleft; if (inlen != 0) return FALSE; return TRUE; } /* Allocate an output buffer in *OUT, and decode the base64 encoded data stored in IN of size INLEN to the *OUT buffer. On return, the size of the decoded data is stored in *OUTLEN. OUTLEN may be NULL, if the caller is not interested in the decoded length. *OUT may be NULL to indicate an out of memory error, in which case *OUTLEN contains the size of the memory block needed. The function returns TRUE on successful decoding and memory allocation errors. (Use the *OUT and *OUTLEN parameters to differentiate between successful decoding and memory error.) The function returns FALSE if the input was invalid, in which case *OUT is NULL and *OUTLEN is undefined. */ int fr_base64_decode_alloc (const char *in, size_t inlen, char **out, size_t *outlen) { /* This may allocate a few bytes too much, depending on input, but it's not worth the extra CPU time to compute the exact amount. The exact amount is 3 * inlen / 4, minus 1 if the input ends with "=" and minus another 1 if the input ends with "==". Dividing before multiplying avoids the possibility of overflow. */ size_t needlen = FR_BASE64_DEC_LENGTH(inlen); *out = malloc (needlen); if (!*out) return TRUE; if (!fr_base64_decode (in, inlen, *out, &needlen)) { free (*out); *out = NULL; return FALSE; } if (outlen) *outlen = needlen; return TRUE; } freeradius-server/src/lib/debug.c000066400000000000000000000102511257552170400173110ustar00rootroot00000000000000/* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ /** * @file debug.c * @brief Various functions to aid in debugging * * @copyright 2013 The FreeRADIUS server project * @copyright 2013 Arran Cudbard-Bell */ #include /* * runtime backtrace functions are not POSIX but are included in * glibc, OSX >= 10.5 and various BSDs */ #ifdef HAVE_EXECINFO_H # include # define MAX_BT_FRAMES 128 #endif static char panic_action[512]; /** Prints a simple backtrace (if execinfo is available) and calls panic_action if set. * * @param sig caught */ static void NEVER_RETURNS _fr_fault(int sig) { char cmd[sizeof(panic_action) + 20]; char *out = cmd; size_t left = sizeof(cmd), ret; char const *p = panic_action; char const *q; int code; fprintf(stderr, "FATAL SIGNAL: %s\n", strsignal(sig)); /* * Produce a simple backtrace - They've very basic but at least give us an * idea of the area of the code we hit the issue in. */ #ifdef HAVE_EXECINFO_H size_t frame_count, i; void *stack[MAX_BT_FRAMES]; char **frames; frame_count = backtrace(stack, MAX_BT_FRAMES); frames = backtrace_symbols(stack, frame_count); fprintf(stderr, "Backtrace of last %zu frames:\n", frame_count); for (i = 0; i < frame_count; i++) { fprintf(stderr, "%s\n", frames[i]); /* Leak the backtrace strings, freeing may lead to undefined behaviour... */ } #endif /* No panic action set... */ if (panic_action[0] == '\0') { fprintf(stderr, "No panic action set\n"); _exit(1); } /* Substitute %p for the current PID (useful for attaching a debugger) */ while ((q = strstr(p, "%p"))) { out += ret = snprintf(out, left, "%.*s%d", (int) (q - p), p, (int) getpid()); if (left <= ret) { oob: fprintf(stderr, "Panic action too long\n"); _exit(1); } left -= ret; p = q + 2; } if (strlen(p) >= left) goto oob; strlcpy(out, p, left); fprintf(stderr, "Calling: %s\n", cmd); code = system(cmd); fprintf(stderr, "Panic action exited with %i\n", code); _exit(1); } /** Registers signal handlers to execute panic_action on fatal signal * * May be called multiple time to change the panic_action/program. * * @param cmd to execute on fault. If present %p will be substituted * for the parent PID before the command is executed, and %e * will be substituted for the currently running program. * @param program Name of program currently executing (argv[0]). * @return 0 on success -1 on failure. */ int fr_fault_setup(char const *cmd, char const *program) { static int setup = FALSE; char *out = panic_action; size_t left = sizeof(panic_action), ret; char const *p = cmd; char const *q; if (cmd) { /* Substitute %e for the current program */ while ((q = strstr(p, "%e"))) { out += ret = snprintf(out, left, "%.*s%s", (int) (q - p), p, program ? program : ""); if (left <= ret) { oob: fr_strerror_printf("Panic action too long"); return -1; } left -= ret; p = q + 2; } if (strlen(p) >= left) goto oob; strlcpy(out, p, left); } else { *panic_action = '\0'; } /* Unsure what the side effects of changing the signal handler mid execution might be */ if (!setup) { #ifdef SIGSEGV if (fr_set_signal(SIGSEGV, _fr_fault) < 0) return -1; #endif #ifdef SIGBUS if (fr_set_signal(SIGBUS, _fr_fault) < 0) return -1; #endif #ifdef SIGABRT if (fr_set_signal(SIGABRT, _fr_fault) < 0) return -1; #endif #ifdef SIGFPE if (fr_set_signal(SIGFPE, _fr_fault) < 0) return -1; #endif } setup = TRUE; return 0; } freeradius-server/src/lib/dhcp.c000066400000000000000000001035271257552170400171520ustar00rootroot00000000000000/* * dhcp.c Functions to send/receive dhcp packets. * * Version: $Id$ * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2008 The FreeRADIUS server project * Copyright 2008 Alan DeKok */ #include RCSID("$Id$") #include #include #include #ifdef WITH_DHCP #include #ifdef HAVE_SYS_SOCKET_H #include #endif #ifdef HAVE_SYS_TYPES_H #include #endif #include #define DHCP_CHADDR_LEN (16) #define DHCP_SNAME_LEN (64) #define DHCP_FILE_LEN (128) #define DHCP_VEND_LEN (308) #define DHCP_OPTION_MAGIC_NUMBER (0x63825363) #ifndef INADDR_BROADCAST #define INADDR_BROADCAST INADDR_NONE #endif typedef struct dhcp_packet_t { uint8_t opcode; uint8_t htype; uint8_t hlen; uint8_t hops; uint32_t xid; /* 4 */ uint16_t secs; /* 8 */ uint16_t flags; uint32_t ciaddr; /* 12 */ uint32_t yiaddr; /* 16 */ uint32_t siaddr; /* 20 */ uint32_t giaddr; /* 24 */ uint8_t chaddr[DHCP_CHADDR_LEN]; /* 28 */ uint8_t sname[DHCP_SNAME_LEN]; /* 44 */ uint8_t file[DHCP_FILE_LEN]; /* 108 */ uint32_t option_format; /* 236 */ uint8_t options[DHCP_VEND_LEN]; } dhcp_packet_t; typedef struct dhcp_option_t { uint8_t code; uint8_t length; } dhcp_option_t; /* * INADDR_ANY : 68 -> INADDR_BROADCAST : 67 DISCOVER * INADDR_BROADCAST : 68 <- SERVER_IP : 67 OFFER * INADDR_ANY : 68 -> INADDR_BROADCAST : 67 REQUEST * INADDR_BROADCAST : 68 <- SERVER_IP : 67 ACK */ static const char *dhcp_header_names[] = { "DHCP-Opcode", "DHCP-Hardware-Type", "DHCP-Hardware-Address-Length", "DHCP-Hop-Count", "DHCP-Transaction-Id", "DHCP-Number-of-Seconds", "DHCP-Flags", "DHCP-Client-IP-Address", "DHCP-Your-IP-Address", "DHCP-Server-IP-Address", "DHCP-Gateway-IP-Address", "DHCP-Client-Hardware-Address", "DHCP-Server-Host-Name", "DHCP-Boot-Filename", NULL }; static const char *dhcp_message_types[] = { "invalid", "DHCP-Discover", "DHCP-Offer", "DHCP-Request", "DHCP-Decline", "DHCP-Ack", "DHCP-NAK", "DHCP-Release", "DHCP-Inform", "DHCP-Force-Renew", }; static int dhcp_header_sizes[] = { 1, 1, 1, 1, 4, 2, 2, 4, 4, 4, 4, DHCP_CHADDR_LEN, DHCP_SNAME_LEN, DHCP_FILE_LEN }; /* * Some clients silently ignore responses less than 300 bytes. */ #define MIN_PACKET_SIZE (244) #define DEFAULT_PACKET_SIZE (300) #define MAX_PACKET_SIZE (1500 - 40) #define DHCP_OPTION_FIELD (0) #define DHCP_FILE_FIELD (1) #define DHCP_SNAME_FIELD (2) static uint8_t *dhcp_get_option(dhcp_packet_t *packet, size_t packet_size, unsigned int option) { int overload = 0; int field = DHCP_OPTION_FIELD; size_t where, size; uint8_t *data; where = 0; size = packet_size - offsetof(dhcp_packet_t, options); data = &packet->options[where]; while (where < size) { if (data[0] == 0) { /* padding */ where++; continue; } if (data[0] == 255) { /* end of options */ if ((field == DHCP_OPTION_FIELD) && (overload & DHCP_FILE_FIELD)) { data = packet->file; where = 0; size = sizeof(packet->file); field = DHCP_FILE_FIELD; continue; } else if ((field == DHCP_FILE_FIELD) && (overload & DHCP_SNAME_FIELD)) { data = packet->sname; where = 0; size = sizeof(packet->sname); field = DHCP_SNAME_FIELD; continue; } return NULL; } /* * We MUST have a real option here. */ if ((where + 2) > size) { fr_strerror_printf("Options overflow field at %u", (unsigned int) (data - (uint8_t *) packet)); return NULL; } if ((where + 2 + data[1]) > size) { fr_strerror_printf("Option length overflows field at %u", (unsigned int) (data - (uint8_t *) packet)); return NULL; } if (data[0] == option) return data; if (data[0] == 52) { /* overload sname and/or file */ overload = data[3]; } where += data[1] + 2; data += data[1] + 2; } return NULL; } /* * DHCPv4 is only for IPv4. Broadcast only works if udpfromto is * defined. */ RADIUS_PACKET *fr_dhcp_recv(int sockfd) { uint32_t magic; struct sockaddr_storage src; struct sockaddr_storage dst; socklen_t sizeof_src; socklen_t sizeof_dst; RADIUS_PACKET *packet; int port; uint8_t *code; ssize_t data_len; packet = rad_alloc(0); if (!packet) { fr_strerror_printf("Failed allocating packet"); return NULL; } memset(packet, 0, sizeof(*packet)); packet->data = malloc(MAX_PACKET_SIZE); if (!packet->data) { fr_strerror_printf("Failed in malloc"); rad_free(&packet); return NULL; } packet->sockfd = sockfd; sizeof_src = sizeof(src); #ifdef WITH_UDPFROMTO sizeof_dst = sizeof(dst); data_len = recvfromto(sockfd, packet->data, MAX_PACKET_SIZE, 0, (struct sockaddr *)&src, &sizeof_src, (struct sockaddr *)&dst, &sizeof_dst); #else data_len = recvfrom(sockfd, packet->data, MAX_PACKET_SIZE, 0, (struct sockaddr *)&src, &sizeof_src); #endif if (data_len <= 0) { fr_strerror_printf("Failed reading DHCP socket: %s", strerror(errno)); rad_free(&packet); return NULL; } packet->data_len = data_len; if (packet->data_len < MIN_PACKET_SIZE) { fr_strerror_printf("DHCP packet is too small (%d < %d)", packet->data_len, MIN_PACKET_SIZE); rad_free(&packet); return NULL; } if (packet->data[1] != 1) { fr_strerror_printf("DHCP can only receive ethernet requests, not type %02x", packet->data[1]); rad_free(&packet); return NULL; } if (packet->data[2] != 6) { fr_strerror_printf("Ethernet HW length is wrong length %d", packet->data[2]); rad_free(&packet); return NULL; } memcpy(&magic, packet->data + 236, 4); magic = ntohl(magic); if (magic != DHCP_OPTION_MAGIC_NUMBER) { fr_strerror_printf("Cannot do BOOTP"); rad_free(&packet); return NULL; } /* * Create unique keys for the packet. */ memcpy(&magic, packet->data + 4, 4); packet->id = ntohl(magic); code = dhcp_get_option((dhcp_packet_t *) packet->data, packet->data_len, 53); if (!code) { fr_strerror_printf("No message-type option was found in the packet"); rad_free(&packet); return NULL; } if ((code[1] < 1) || (code[2] == 0) || (code[2] > 8)) { fr_strerror_printf("Unknown value for message-type option"); rad_free(&packet); return NULL; } packet->code = code[2] | PW_DHCP_OFFSET; /* * Create a unique vector from the MAC address and the * DHCP opcode. This is a hack for the RADIUS * infrastructure in the rest of the server. * * Note: packet->data[2] == 6, which is smaller than * sizeof(packet->vector) * * FIXME: Look for client-identifier in packet, * and use that, too? */ memset(packet->vector, 0, sizeof(packet->vector)); memcpy(packet->vector, packet->data + 28, packet->data[2]); packet->vector[packet->data[2]] = packet->code & 0xff; /* * FIXME: for DISCOVER / REQUEST: src_port == dst_port + 1 * FIXME: for OFFER / ACK : src_port = dst_port - 1 */ /* * Unique keys are xid, client mac, and client ID? */ /* * FIXME: More checks, like DHCP packet type? */ sizeof_dst = sizeof(dst); #ifndef WITH_UDPFROMTO /* * This should never fail... */ if (getsockname(sockfd, (struct sockaddr *) &dst, &sizeof_dst) < 0) { fr_strerror_printf("getsockname failed: %s", strerror(errno)); rad_free(&packet); return NULL; } #endif fr_sockaddr2ipaddr(&dst, sizeof_dst, &packet->dst_ipaddr, &port); packet->dst_port = port; fr_sockaddr2ipaddr(&src, sizeof_src, &packet->src_ipaddr, &port); packet->src_port = port; if (fr_debug_flag > 1) { char type_buf[64]; const char *name = type_buf; char src_ip_buf[256], dst_ip_buf[256]; if ((packet->code >= PW_DHCP_DISCOVER) && (packet->code <= PW_DHCP_INFORM)) { name = dhcp_message_types[packet->code - PW_DHCP_OFFSET]; } else { snprintf(type_buf, sizeof(type_buf), "%d", packet->code - PW_DHCP_OFFSET); } DEBUG("Received %s of id %08x from %s:%d to %s:%d\n", name, (unsigned int) packet->id, inet_ntop(packet->src_ipaddr.af, &packet->src_ipaddr.ipaddr, src_ip_buf, sizeof(src_ip_buf)), packet->src_port, inet_ntop(packet->dst_ipaddr.af, &packet->dst_ipaddr.ipaddr, dst_ip_buf, sizeof(dst_ip_buf)), packet->dst_port); } return packet; } /* * Send a DHCP packet. */ int fr_dhcp_send(RADIUS_PACKET *packet) { struct sockaddr_storage dst; socklen_t sizeof_dst; #ifdef WITH_UDPFROMTO struct sockaddr_storage src; socklen_t sizeof_src; fr_ipaddr2sockaddr(&packet->src_ipaddr, packet->src_port, &src, &sizeof_src); #endif fr_ipaddr2sockaddr(&packet->dst_ipaddr, packet->dst_port, &dst, &sizeof_dst); if (fr_debug_flag > 1) { char type_buf[64]; const char *name = type_buf; #ifdef WITH_UDPFROMTO char src_ip_buf[256]; #endif char dst_ip_buf[256]; if ((packet->code >= PW_DHCP_DISCOVER) && (packet->code <= PW_DHCP_INFORM)) { name = dhcp_message_types[packet->code - PW_DHCP_OFFSET]; } else { snprintf(type_buf, sizeof(type_buf), "%d", packet->code - PW_DHCP_OFFSET); } DEBUG( #ifdef WITH_UDPFROMTO "Sending %s of id %08x from %s:%d to %s:%d\n", #else "Sending %s of id %08x to %s:%d\n", #endif name, (unsigned int) packet->id, #ifdef WITH_UDPFROMTO inet_ntop(packet->src_ipaddr.af, &packet->src_ipaddr.ipaddr, src_ip_buf, sizeof(src_ip_buf)), packet->src_port, #endif inet_ntop(packet->dst_ipaddr.af, &packet->dst_ipaddr.ipaddr, dst_ip_buf, sizeof(dst_ip_buf)), packet->dst_port); } #ifndef WITH_UDPFROMTO /* * Assume that the packet is encoded before sending it. */ return sendto(packet->sockfd, packet->data, packet->data_len, 0, (struct sockaddr *)&dst, sizeof_dst); #else return sendfromto(packet->sockfd, packet->data, packet->data_len, 0, (struct sockaddr *)&src, sizeof_src, (struct sockaddr *)&dst, sizeof_dst); #endif } static int fr_dhcp_attr2vp(VALUE_PAIR *vp, const uint8_t *p, size_t alen); static int decode_tlv(VALUE_PAIR *tlv, const uint8_t *data, size_t data_len) { const uint8_t *p; VALUE_PAIR *head, **tail, *vp; /* * Take a pass at parsing it. */ p = data; while (p < (data + data_len)) { if ((p + 2) > (data + data_len)) goto make_tlv; if ((p + p[1] + 2) > (data + data_len)) goto make_tlv; p += 2 + p[1]; } /* * Got here... must be well formed. */ head = NULL; tail = &head; p = data; while (p < (data + data_len)) { vp = paircreate(tlv->attribute | (p[0] << 8), PW_TYPE_OCTETS); if (!vp) { pairfree(&head); goto make_tlv; } if (fr_dhcp_attr2vp(vp, p + 2, p[1]) < 0) { pairfree(&head); goto make_tlv; } *tail = vp; tail = &(vp->next); p += 2 + p[1]; } /* * The caller allocated TLV, so we need to copy the FIRST * attribute over top of that. */ if (head) { memcpy(tlv, head, sizeof(*tlv)); head->next = NULL; pairfree(&head); } return 0; make_tlv: tlv->vp_tlv = malloc(data_len); if (!tlv->vp_tlv) { fr_strerror_printf("No memory"); return -1; } memcpy(tlv->vp_tlv, data, data_len); tlv->length = data_len; return 0; } /* * Decode ONE value into a VP */ static int fr_dhcp_attr2vp(VALUE_PAIR *vp, const uint8_t *p, size_t alen) { switch (vp->type) { case PW_TYPE_BYTE: if (alen != 1) goto raw; vp->vp_integer = p[0]; break; case PW_TYPE_SHORT: if (alen != 2) goto raw; memcpy(&vp->vp_integer, p, 2); vp->vp_integer = ntohs(vp->vp_integer); break; case PW_TYPE_INTEGER: if (alen != 4) goto raw; memcpy(&vp->vp_integer, p, 4); vp->vp_integer = ntohl(vp->vp_integer); break; case PW_TYPE_IPADDR: if (alen != 4) goto raw; /* * Keep value in Network Order! */ memcpy(&vp->vp_ipaddr, p , 4); vp->length = 4; break; case PW_TYPE_STRING: if (alen > 253) return -1; memcpy(vp->vp_strvalue, p , alen); vp->vp_strvalue[alen] = '\0'; break; raw: vp->type = PW_TYPE_OCTETS; case PW_TYPE_OCTETS: if (alen > 253) return -1; memcpy(vp->vp_octets, p, alen); break; case PW_TYPE_TLV: return decode_tlv(vp, p, alen); default: fr_strerror_printf("Internal sanity check %d %d", vp->type, __LINE__); return -1; } /* switch over type */ vp->length = alen; return 0; } ssize_t fr_dhcp_decode_options(uint8_t *data, size_t len, VALUE_PAIR **head) { int i; VALUE_PAIR *vp, **tail; uint8_t *p, *next; next = data; *head = NULL; tail = head; while (next < (data + len)) { int num_entries, alen; DICT_ATTR *da; p = next; if (*p == 0) { /* 0x00 - Padding option */ next++; continue; } if (*p == 255) break; /* 0xff - End of options signifier */ if ((p + 2) > (data + len)) break; next = p + 2 + p[1]; if (p[1] >= 253) { fr_strerror_printf("Attribute too long %u %u", p[0], p[1]); continue; } da = dict_attrbyvalue(DHCP2ATTR(p[0])); if (!da) { fr_strerror_printf("Attribute not in our dictionary: %u", p[0]); continue; } vp = NULL; num_entries = 1; alen = p[1]; p += 2; /* * Could be an array of bytes, integers, etc. */ if (da->flags.array) { switch (da->type) { case PW_TYPE_BYTE: num_entries = alen; alen = 1; break; case PW_TYPE_SHORT: /* ignore any trailing data */ num_entries = alen >> 1; alen = 2; break; case PW_TYPE_IPADDR: case PW_TYPE_INTEGER: case PW_TYPE_DATE: /* ignore any trailing data */ num_entries = alen >> 2; alen = 4; break; default: break; /* really an internal sanity failure */ } } /* * Loop over all of the entries, building VPs */ for (i = 0; i < num_entries; i++) { vp = pairmake(da->name, NULL, T_OP_ADD); if (!vp) { fr_strerror_printf("Cannot build attribute %s", fr_strerror()); pairfree(head); return -1; } /* * Hack for ease of use. */ if ((da->attr == DHCP2ATTR(0x3d)) && !da->flags.array && (alen == 7) && (*p == 1) && (num_entries == 1)) { vp->type = PW_TYPE_ETHERNET; memcpy(vp->vp_octets, p + 1, 6); vp->length = alen; } else if (fr_dhcp_attr2vp(vp, p, alen) < 0) { pairfree(&vp); pairfree(head); return -1; } *tail = vp; while (*tail) { debug_pair(*tail); tail = &(*tail)->next; } p += alen; } /* loop over array entries */ } /* loop over the entire packet */ return next - data; } int fr_dhcp_decode(RADIUS_PACKET *packet) { ssize_t i; uint8_t *p; uint32_t giaddr; VALUE_PAIR *head, *vp, **tail; VALUE_PAIR *maxms, *mtu; head = NULL; tail = &head; p = packet->data; if ((fr_debug_flag > 2) && fr_log_fp) { for (i = 0; i < packet->data_len; i++) { if ((i & 0x0f) == 0x00) fprintf(fr_log_fp, "%d: ", (int) i); fprintf(fr_log_fp, "%02x ", packet->data[i]); if ((i & 0x0f) == 0x0f) fprintf(fr_log_fp, "\n"); } fprintf(fr_log_fp, "\n"); } if (packet->data[1] != 1) { fr_strerror_printf("Packet is not Ethernet: %u", packet->data[1]); return -1; } /* * Decode the header. */ for (i = 0; i < 14; i++) { vp = pairmake(dhcp_header_names[i], NULL, T_OP_EQ); if (!vp) { char buffer[256]; strlcpy(buffer, fr_strerror(), sizeof(buffer)); fr_strerror_printf("Cannot decode packet due to internal error: %s", buffer); pairfree(&head); return -1; } if ((i == 11) && (packet->data[1] == 1) && (packet->data[2] == 6)) { vp->type = PW_TYPE_ETHERNET; } switch (vp->type) { case PW_TYPE_BYTE: vp->vp_integer = p[0]; vp->length = 1; break; case PW_TYPE_SHORT: vp->vp_integer = (p[0] << 8) | p[1]; vp->length = 2; break; case PW_TYPE_INTEGER: memcpy(&vp->vp_integer, p, 4); vp->vp_integer = ntohl(vp->vp_integer); vp->length = 4; break; case PW_TYPE_IPADDR: memcpy(&vp->vp_ipaddr, p, 4); vp->length = 4; break; case PW_TYPE_STRING: memcpy(vp->vp_strvalue, p, dhcp_header_sizes[i]); vp->vp_strvalue[dhcp_header_sizes[i]] = '\0'; vp->length = strlen(vp->vp_strvalue); if (vp->length == 0) { pairfree(&vp); } break; case PW_TYPE_OCTETS: memcpy(vp->vp_octets, p, packet->data[2]); vp->length = packet->data[2]; break; case PW_TYPE_ETHERNET: memcpy(vp->vp_ether, p, sizeof(vp->vp_ether)); vp->length = sizeof(vp->vp_ether); break; default: fr_strerror_printf("BAD TYPE %d", vp->type); pairfree(&vp); break; } p += dhcp_header_sizes[i]; if (!vp) continue; debug_pair(vp); *tail = vp; tail = &vp->next; } /* * Loop over the options. */ /* * Nothing uses tail after this call, if it does in the future * it'll need to find the new tail... * FIXME: This should also check sname && file fields. * See the dhcp_get_option() function above. */ if (fr_dhcp_decode_options(packet->data + 240, packet->data_len - 240, tail) < 0) { return -1; } /* * If DHCP request, set ciaddr to zero. */ /* * Set broadcast flag for broken vendors, but only if * giaddr isn't set. */ memcpy(&giaddr, packet->data + 24, sizeof(giaddr)); if (giaddr == htonl(INADDR_ANY)) { /* * DHCP Opcode is request */ vp = pairfind(head, DHCP2ATTR(256)); if (vp && vp->lvalue == 3) { /* * Vendor is "MSFT 98" */ vp = pairfind(head, DHCP2ATTR(63)); if (vp && (strcmp(vp->vp_strvalue, "MSFT 98") == 0)) { vp = pairfind(head, DHCP2ATTR(262)); /* * Reply should be broadcast. */ if (vp) vp->lvalue |= 0x8000; packet->data[10] |= 0x80; } } } /* * FIXME: Nuke attributes that aren't used in the normal * header for discover/requests. */ packet->vps = head; /* * Client can request a LARGER size, but not a smaller * one. They also cannot request a size larger than MTU. */ maxms = pairfind(packet->vps, DHCP2ATTR(57)); mtu = pairfind(packet->vps, DHCP2ATTR(26)); if (mtu && (mtu->vp_integer < DEFAULT_PACKET_SIZE)) { fr_strerror_printf("DHCP Fatal: Client says MTU is smaller than minimum permitted by the specification."); return -1; } if (maxms && (maxms->vp_integer < DEFAULT_PACKET_SIZE)) { fr_strerror_printf("DHCP WARNING: Client says maximum message size is smaller than minimum permitted by the specification: fixing it"); maxms->vp_integer = DEFAULT_PACKET_SIZE; } if (maxms && mtu && (maxms->vp_integer > mtu->vp_integer)) { fr_strerror_printf("DHCP WARNING: Client says MTU is smaller than maximum message size: fixing it"); maxms->vp_integer = mtu->vp_integer; } if (fr_debug_flag > 0) { for (vp = packet->vps; vp != NULL; vp = vp->next) { } } if (fr_debug_flag) fflush(stdout); return 0; } static int attr_cmp(const void *one, const void *two) { const VALUE_PAIR * const *a = one; const VALUE_PAIR * const *b = two; /* * DHCP-Message-Type is first, for simplicity. */ if (((*a)->attribute == DHCP2ATTR(53)) && (*b)->attribute != DHCP2ATTR(53)) return -1; /* * Relay-Agent is last */ if (((*a)->attribute == DHCP2ATTR(82)) && (*b)->attribute != DHCP2ATTR(82)) return +1; return ((*a)->attribute - (*b)->attribute); } static size_t fr_dhcp_vp2attr(VALUE_PAIR *vp, uint8_t *p, size_t room) { size_t length; uint32_t lvalue; /* * FIXME: Check room! */ room = room; /* -Wunused */ /* * Search for all attributes of the same * type, and pack them into the same * attribute. */ switch (vp->type) { case PW_TYPE_BYTE: length = 1; *p = vp->vp_integer & 0xff; break; case PW_TYPE_SHORT: length = 2; lvalue = htons(vp->vp_integer); memcpy(p, &lvalue, 2); break; case PW_TYPE_INTEGER: length = 4; lvalue = htonl(vp->vp_integer); memcpy(p, &lvalue, 4); break; case PW_TYPE_IPADDR: length = 4; memcpy(p, &vp->vp_ipaddr, 4); break; case PW_TYPE_ETHERNET: length = 6; memcpy(p, &vp->vp_ether, 6); break; case PW_TYPE_STRING: memcpy(p, vp->vp_strvalue, vp->length); length = vp->length; break; case PW_TYPE_TLV: /* FIXME: split it on 255? */ memcpy(p, vp->vp_tlv, vp->length); length = vp->length; break; case PW_TYPE_OCTETS: memcpy(p, vp->vp_octets, vp->length); length = vp->length; break; default: fr_strerror_printf("BAD TYPE2 %d", vp->type); length = 0; break; } return length; } static VALUE_PAIR *fr_dhcp_vp2suboption(VALUE_PAIR *vps) { int length; unsigned int attribute; uint8_t *ptr; VALUE_PAIR *vp, *tlv; attribute = vps->attribute & 0xffff00ff; tlv = paircreate(attribute, PW_TYPE_TLV); if (!tlv) return NULL; tlv->length = 0; for (vp = vps; vp != NULL; vp = vp->next) { /* * Group the attributes ONLY until we see a * non-TLV attribute. */ if (!vp->flags.is_tlv || vp->flags.encoded || ((vp->attribute & 0xffff00ff) != attribute)) { break; } tlv->length += vp->length + 2; } if (!tlv->length) { pairfree(&tlv); return NULL; } tlv->vp_tlv = malloc(tlv->length); if (!tlv->vp_tlv) { pairfree(&tlv); return NULL; } ptr = tlv->vp_tlv; for (vp = vps; vp != NULL; vp = vp->next) { if (!vp->flags.is_tlv || vp->flags.encoded || ((vp->attribute & 0xffff00ff) != attribute)) { break; } length = fr_dhcp_vp2attr(vp, ptr + 2, tlv->vp_tlv + tlv->length - ptr); if (length > 255) { pairfree(&tlv); return NULL; } /* * Pack the attribute. */ ptr[0] = (vp->attribute & 0xff00) >> 8; ptr[1] = length; ptr += length + 2; vp->flags.encoded = 1; } return tlv; } int fr_dhcp_encode(RADIUS_PACKET *packet) { int i, num_vps; uint8_t *p; VALUE_PAIR *vp; uint32_t lvalue, mms; size_t dhcp_size, length; #ifndef NDEBUG const char *name; #ifdef WITH_UDPFROMTO char src_ip_buf[256]; #endif char dst_ip_buf[256]; #endif if (packet->data) free(packet->data); packet->data = malloc(MAX_PACKET_SIZE); packet->data_len = MAX_PACKET_SIZE; memset(packet->data, 0, packet->data_len); /* XXX Ugly ... should be set by the caller */ if (packet->code == 0) packet->code = PW_DHCP_NAK; #ifndef NDEBUG if ((packet->code >= PW_DHCP_DISCOVER) && (packet->code <= PW_DHCP_INFORM)) { name = dhcp_message_types[packet->code - PW_DHCP_OFFSET]; } else { name = "?Unknown?"; } DEBUG( #ifdef WITH_UDPFROMTO "Encoding %s of id %08x from %s:%d to %s:%d\n", #else "Encoding %s of id %08x to %s:%d\n", #endif name, (unsigned int) packet->id, #ifdef WITH_UDPFROMTO inet_ntop(packet->src_ipaddr.af, &packet->src_ipaddr.ipaddr, src_ip_buf, sizeof(src_ip_buf)), packet->src_port, #endif inet_ntop(packet->dst_ipaddr.af, &packet->dst_ipaddr.ipaddr, dst_ip_buf, sizeof(dst_ip_buf)), packet->dst_port); #endif p = packet->data; mms = DEFAULT_PACKET_SIZE; /* maximum message size */ /* * Clients can request a LARGER size, but not a * smaller one. They also cannot request a size * larger than MTU. */ /* DHCP-DHCP-Maximum-Msg-Size */ vp = pairfind(packet->vps, DHCP2ATTR(57)); if (vp && (vp->vp_integer > mms)) { mms = vp->vp_integer; if (mms > MAX_PACKET_SIZE) mms = MAX_PACKET_SIZE; } /* * RFC 3118: Authentication option. */ vp = pairfind(packet->vps, DHCP2ATTR(90)); if (vp) { if (vp->length < 2) { memset(vp->vp_octets + vp->length, 0, 2 - vp->length); vp->length = 2; } if (vp->length < 3) { struct timeval tv; gettimeofday(&tv, NULL); vp->vp_octets[2] = 0; timeval2ntp(&tv, vp->vp_octets + 3); vp->length = 3 + 8; } /* * Configuration token (clear-text token) */ if (vp->vp_octets[0] == 0) { VALUE_PAIR *pass; vp->vp_octets[1] = 0; pass = pairfind(packet->vps, PW_CLEARTEXT_PASSWORD); if (pass) { length = pass->length; if ((length + 11) > sizeof(vp->vp_octets)) { length -= ((length + 11) - sizeof(vp->vp_octets)); } memcpy(vp->vp_octets + 11, pass->vp_strvalue, length); vp->length = length + 11; } else { vp->length = 11 + 8; memset(vp->vp_octets + 11, 0, 8); vp->length = 11 + 8; } } else { /* we don't support this type! */ fr_strerror_printf("DHCP-Authentication %d unsupported", vp->vp_octets[0]); } } /* DHCP-Opcode */ if ((vp = pairfind(packet->vps, DHCP2ATTR(256)))) { *p++ = vp->vp_integer & 0xff; } else { *p++ = 1; /* client message */ } /* DHCP-Hardware-Type */ if ((vp = pairfind(packet->vps, DHCP2ATTR(257)))) { *p++ = vp->vp_integer & 0xFF; } else { *p++ = 1; /* hardware type = ethernet */ } /* DHCP-Hardware-Address-Length */ if ((vp = pairfind(packet->vps, DHCP2ATTR(258)))) { *p++ = vp->vp_integer & 0xFF; } else { *p++ = 6; /* 6 bytes of ethernet */ } /* DHCP-Hop-Count */ if ((vp = pairfind(packet->vps, DHCP2ATTR(259)))) { *p = vp->vp_integer & 0xff; } p++; /* DHCP-Transaction-Id */ if ((vp = pairfind(packet->vps, DHCP2ATTR(260)))) { lvalue = htonl(vp->vp_integer); } else { lvalue = fr_rand(); } memcpy(p, &lvalue, 4); p += 4; /* DHCP-Number-of-Seconds */ if ((vp = pairfind(packet->vps, DHCP2ATTR(261)))) { lvalue = htonl(vp->vp_integer); memcpy(p, &lvalue, 2); } p += 2; /* DHCP-Flags */ if ((vp = pairfind(packet->vps, DHCP2ATTR(262)))) { lvalue = htons(vp->vp_integer); memcpy(p, &lvalue, 2); } p += 2; /* DHCP-Client-IP-Address */ if ((vp = pairfind(packet->vps, DHCP2ATTR(263)))) { memcpy(p, &vp->vp_ipaddr, 4); } p += 4; /* DHCP-Your-IP-address */ if ((vp = pairfind(packet->vps, DHCP2ATTR(264)))) { lvalue = vp->vp_ipaddr; } else { lvalue = htonl(INADDR_ANY); } memcpy(p, &lvalue, 4); p += 4; /* DHCP-Server-IP-Address */ vp = pairfind(packet->vps, DHCP2ATTR(265)); if (vp) { lvalue = vp->vp_ipaddr; } else { lvalue = htonl(INADDR_ANY); } memcpy(p, &lvalue, 4); p += 4; /* * DHCP-Gateway-IP-Address */ if (vp = pairfind(packet->vps, DHCP2ATTR(266))) { lvalue = vp->vp_ipaddr; } else { lvalue = htonl(INADDR_ANY); } memcpy(p, &lvalue, 4); p += 4; /* DHCP-Client-Hardware-Address */ if ((vp = pairfind(packet->vps, DHCP2ATTR(267)))) { if (vp->length > DHCP_CHADDR_LEN) { memcpy(p, vp->vp_octets, DHCP_CHADDR_LEN); } else { memcpy(p, vp->vp_octets, vp->length); } } p += DHCP_CHADDR_LEN; /* DHCP-Server-Host-Name */ if ((vp = pairfind(packet->vps, DHCP2ATTR(268)))) { if (vp->length > DHCP_SNAME_LEN) { memcpy(p, vp->vp_strvalue, DHCP_SNAME_LEN); } else { memcpy(p, vp->vp_strvalue, vp->length); } } p += DHCP_SNAME_LEN; /* * Copy over DHCP-Boot-Filename. * * FIXME: This copy should be delayed until AFTER the options * have been processed. If there are too many options for * the packet, then they go into the sname && filename fields. * When that happens, the boot filename is passed as an option, * instead of being placed verbatim in the filename field. */ /* DHCP-Boot-Filename */ if ((vp = pairfind(packet->vps, DHCP2ATTR(269)))) { if (vp->length > DHCP_FILE_LEN) { memcpy(p, vp->vp_strvalue, DHCP_FILE_LEN); } else { memcpy(p, vp->vp_strvalue, vp->length); } } p += DHCP_FILE_LEN; /* DHCP magic number */ lvalue = htonl(DHCP_OPTION_MAGIC_NUMBER); memcpy(p, &lvalue, 4); p += 4; /* * Print the header. */ if (fr_debug_flag > 1) { uint8_t *pp = p; p = packet->data; for (i = 0; i < 14; i++) { vp = pairmake(dhcp_header_names[i], NULL, T_OP_EQ); if (!vp) { char buffer[256]; strlcpy(buffer, fr_strerror(), sizeof(buffer)); fr_strerror_printf("Cannot decode packet due to internal error: %s", buffer); return -1; } switch (vp->type) { case PW_TYPE_BYTE: vp->vp_integer = p[0]; vp->length = 1; break; case PW_TYPE_SHORT: memcpy(&vp->vp_integer, p, 2); vp->vp_integer = ntohs(vp->vp_integer); vp->length = 2; break; case PW_TYPE_INTEGER: memcpy(&vp->vp_integer, p, 4); vp->vp_integer = ntohl(vp->vp_integer); vp->length = 4; break; case PW_TYPE_IPADDR: memcpy(&vp->vp_ipaddr, p, 4); vp->length = 4; break; case PW_TYPE_STRING: memcpy(vp->vp_strvalue, p, dhcp_header_sizes[i]); vp->vp_strvalue[dhcp_header_sizes[i]] = '\0'; vp->length = strlen(vp->vp_strvalue); break; case PW_TYPE_OCTETS: /* only for Client HW Address */ memcpy(vp->vp_octets, p, packet->data[2]); vp->length = packet->data[2]; break; case PW_TYPE_ETHERNET: /* only for Client HW Address */ memcpy(vp->vp_ether, p, sizeof(vp->vp_ether)); vp->length = sizeof(vp->vp_ether); break; default: fr_strerror_printf("Internal sanity check failed %d %d", vp->type, __LINE__); pairfree(&vp); break; } p += dhcp_header_sizes[i]; debug_pair(vp); pairfree(&vp); } /* * Jump over DHCP magic number, response, etc. */ p = pp; } /* * Before packing the attributes, re-order them so that * the array ones are all contiguous. This simplifies * the later code. */ num_vps = 0; for (vp = packet->vps; vp != NULL; vp = vp->next) { num_vps++; } if (num_vps > 1) { VALUE_PAIR **array, **last; array = malloc(num_vps * sizeof(VALUE_PAIR *)); i = 0; for (vp = packet->vps; vp != NULL; vp = vp->next) { array[i++] = vp; } /* * Sort the attributes. */ qsort(array, (size_t) num_vps, sizeof(VALUE_PAIR *), attr_cmp); last = &packet->vps; for (i = 0; i < num_vps; i++) { *last = array[i]; array[i]->next = NULL; last = &(array[i]->next); } free(array); } p[0] = 0x35; /* DHCP-Message-Type */ p[1] = 1; p[2] = packet->code - PW_DHCP_OFFSET; p += 3; /* * Pack in the attributes. */ vp = packet->vps; while (vp) { int num_entries = 1; VALUE_PAIR *same; uint8_t *plength, *pattr; if (!IS_DHCP_ATTR(vp)) goto next; /* DHCP-Message-Type (already done) */ if (vp->attribute == DHCP2ATTR(53)) goto next; if (((vp->attribute & 0xffff) > 255) && (DHCP_BASE_ATTR(vp->attribute) != PW_DHCP_OPTION_82)) goto next; debug_pair(vp); if (vp->flags.encoded) goto next; length = vp->length; for (same = vp->next; same != NULL; same = same->next) { if (same->attribute != vp->attribute) break; num_entries++; } /* * For client-identifier */ if ((vp->type == PW_TYPE_ETHERNET) && (vp->length == 6) && (num_entries == 1)) { vp->type = PW_TYPE_OCTETS; memmove(vp->vp_octets + 1, vp->vp_octets, 6); vp->vp_octets[0] = 1; } pattr = p; *(p++) = vp->attribute & 0xff; plength = p; *(p++) = 0; /* header isn't included in attr length */ for (i = 0; i < num_entries; i++) { if (i != 0) debug_pair(vp); if (vp->flags.is_tlv) { VALUE_PAIR *tlv; /* * Should NOT have been encoded yet! */ tlv = fr_dhcp_vp2suboption(vp); /* * Ignore it if there's an issue * encoding it. */ if (!tlv) goto next; tlv->next = vp->next; vp->next = tlv; vp = tlv; } length = fr_dhcp_vp2attr(vp, p, 0); /* * This will never happen due to FreeRADIUS * limitations: sizeof(vp->vp_octets) < 255 */ if (length > 255) { fr_strerror_printf("WARNING Ignoring too long attribute %s!", vp->name); break; } /* * More than one attribute of the same type * in a row: they are packed together * into the same TLV. If we overflow, * go bananas! */ if ((*plength + length) > 255) { fr_strerror_printf("WARNING Ignoring too long attribute %s!", vp->name); break; } *plength += length; p += length; if (vp->next && (vp->next->attribute == vp->attribute)) vp = vp->next; } /* loop over num_entries */ next: vp = vp->next; } p[0] = 0xff; /* end of option option */ p[1] = 0x00; p += 2; dhcp_size = p - packet->data; /* * FIXME: if (dhcp_size > mms), * then we put the extra options into the "sname" and "file" * fields, AND set the "end option option" in the "options" * field. We also set the "overload option", * and put options into the "file" field, followed by * the "sname" field. Where each option is completely * enclosed in the "file" and/or "sname" field, AND * followed by the "end of option", and MUST be followed * by padding option. * * Yuck. That sucks... */ packet->data_len = dhcp_size; if (packet->data_len < DEFAULT_PACKET_SIZE) { memset(packet->data + packet->data_len, 0, DEFAULT_PACKET_SIZE - packet->data_len); packet->data_len = DEFAULT_PACKET_SIZE; } if ((fr_debug_flag > 2) && fr_log_fp) { for (i = 0; i < packet->data_len; i++) { if ((i & 0x0f) == 0x00) fprintf(fr_log_fp, "%d: ", i); fprintf(fr_log_fp, "%02x ", packet->data[i]); if ((i & 0x0f) == 0x0f) fprintf(fr_log_fp, "\n"); } fprintf(fr_log_fp, "\n"); } return 0; } int fr_dhcp_add_arp_entry(int fd, const char *interface, VALUE_PAIR *macaddr, VALUE_PAIR *ip) { #ifdef SIOCSARP struct sockaddr_in *sin; struct arpreq req; if (!interface) { fr_strerror_printf("No interface specified. Cannot update ARP table"); return -1; } if (macaddr->length > sizeof (req.arp_ha.sa_data)) { fr_strerror_printf("ERROR: DHCP only supports up to %zu octets for " "Client Hardware Address (got %zu octets)\n", sizeof(req.arp_ha.sa_data), macaddr->length); return -1; } memset(&req, 0, sizeof(req)); sin = (struct sockaddr_in *) &req.arp_pa; sin->sin_family = AF_INET; sin->sin_addr.s_addr = ip->vp_ipaddr; strlcpy(req.arp_dev, interface, sizeof(req.arp_dev)); memcpy(&req.arp_ha.sa_data, macaddr->vp_octets, macaddr->length); req.arp_flags = ATF_COM; if (ioctl(fd, SIOCSARP, &req) < 0) { fr_strerror_printf("DHCP: Failed to add entry in ARP cache: %s (%d)", strerror(errno), errno); return -1; } return 0; #else fd = fd; interface = interface; macaddr = macaddr; ip = ip; fr_strerror_printf("Adding ARP entry is unsupported on this system"); return -1; #endif } #endif /* WITH_DHCP */ freeradius-server/src/lib/dict.c000066400000000000000000001226721257552170400171610ustar00rootroot00000000000000/* * dict.c Routines to read the dictionary file. * * Version: $Id$ * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2000,2006 The FreeRADIUS server project */ #include RCSID("$Id$") #include #include #ifdef HAVE_MALLOC_H #include #endif #ifdef HAVE_SYS_STAT_H #include #endif #define DICT_VALUE_MAX_NAME_LEN (128) #define DICT_VENDOR_MAX_NAME_LEN (128) #define DICT_ATTR_MAX_NAME_LEN (128) static fr_hash_table_t *vendors_byname = NULL; static fr_hash_table_t *vendors_byvalue = NULL; static fr_hash_table_t *attributes_byname = NULL; static fr_hash_table_t *attributes_byvalue = NULL; static fr_hash_table_t *values_byvalue = NULL; static fr_hash_table_t *values_byname = NULL; static DICT_ATTR *dict_base_attrs[256]; /* * For faster HUP's, we cache the stat information for * files we've $INCLUDEd */ typedef struct dict_stat_t { struct dict_stat_t *next; char *name; time_t mtime; } dict_stat_t; static char *stat_root_dir = NULL; static char *stat_root_file = NULL; static dict_stat_t *stat_head = NULL; static dict_stat_t *stat_tail = NULL; typedef struct value_fixup_t { char attrstr[DICT_ATTR_MAX_NAME_LEN]; DICT_VALUE *dval; struct value_fixup_t *next; } value_fixup_t; /* * So VALUEs in the dictionary can have forward references. */ static value_fixup_t *value_fixup = NULL; const FR_NAME_NUMBER dict_attr_types[] = { { "integer", PW_TYPE_INTEGER }, { "string", PW_TYPE_STRING }, { "ipaddr", PW_TYPE_IPADDR }, { "date", PW_TYPE_DATE }, { "abinary", PW_TYPE_ABINARY }, { "octets", PW_TYPE_OCTETS }, { "ifid", PW_TYPE_IFID }, { "ipv6addr", PW_TYPE_IPV6ADDR }, { "ipv6prefix", PW_TYPE_IPV6PREFIX }, { "byte", PW_TYPE_BYTE }, { "short", PW_TYPE_SHORT }, { "ether", PW_TYPE_ETHERNET }, { "combo-ip", PW_TYPE_COMBO_IP }, { "tlv", PW_TYPE_TLV }, { "signed", PW_TYPE_SIGNED }, { NULL, 0 } }; /* * Create the hash of the name. * * We copy the hash function here because it's substantially faster. */ #define FNV_MAGIC_INIT (0x811c9dc5) #define FNV_MAGIC_PRIME (0x01000193) static uint32_t dict_hashname(const char *name) { uint32_t hash = FNV_MAGIC_INIT; const char *p; for (p = name; *p != '\0'; p++) { int c = *(const unsigned char *) p; if (isalpha(c)) c = tolower(c); hash *= FNV_MAGIC_PRIME; hash ^= (uint32_t ) (c & 0xff); } return hash; } /* * Hash callback functions. */ static uint32_t dict_attr_name_hash(const void *data) { return dict_hashname(((const DICT_ATTR *)data)->name); } static int dict_attr_name_cmp(const void *one, const void *two) { const DICT_ATTR *a = one; const DICT_ATTR *b = two; return strcasecmp(a->name, b->name); } static uint32_t dict_attr_value_hash(const void *data) { uint32_t hash; const DICT_ATTR *attr = data; hash = fr_hash(&attr->vendor, sizeof(attr->vendor)); return fr_hash_update(&attr->attr, sizeof(attr->attr), hash); } static int dict_attr_value_cmp(const void *one, const void *two) { const DICT_ATTR *a = one; const DICT_ATTR *b = two; if (a->vendor < b->vendor) return -1; if (a->vendor > b->vendor) return +1; return a->attr - b->attr; } static uint32_t dict_vendor_name_hash(const void *data) { return dict_hashname(((const DICT_VENDOR *)data)->name); } static int dict_vendor_name_cmp(const void *one, const void *two) { const DICT_VENDOR *a = one; const DICT_VENDOR *b = two; return strcasecmp(a->name, b->name); } static uint32_t dict_vendor_value_hash(const void *data) { return fr_hash(&(((const DICT_VENDOR *)data)->vendorpec), sizeof(((const DICT_VENDOR *)data)->vendorpec)); } static int dict_vendor_value_cmp(const void *one, const void *two) { const DICT_VENDOR *a = one; const DICT_VENDOR *b = two; return a->vendorpec - b->vendorpec; } static uint32_t dict_value_name_hash(const void *data) { uint32_t hash; const DICT_VALUE *dval = data; hash = dict_hashname(dval->name); return fr_hash_update(&dval->attr, sizeof(dval->attr), hash); } static int dict_value_name_cmp(const void *one, const void *two) { int rcode; const DICT_VALUE *a = one; const DICT_VALUE *b = two; rcode = a->attr - b->attr; if (rcode != 0) return rcode; return strcasecmp(a->name, b->name); } static uint32_t dict_value_value_hash(const void *data) { uint32_t hash; const DICT_VALUE *dval = data; hash = fr_hash(&dval->attr, sizeof(dval->attr)); return fr_hash_update(&dval->value, sizeof(dval->value), hash); } static int dict_value_value_cmp(const void *one, const void *two) { int rcode; const DICT_VALUE *a = one; const DICT_VALUE *b = two; rcode = a->attr - b->attr; if (rcode != 0) return rcode; return a->value - b->value; } /* * Free the list of stat buffers */ static void dict_stat_free(void) { dict_stat_t *this, *next; free(stat_root_dir); stat_root_dir = NULL; free(stat_root_file); stat_root_file = NULL; if (!stat_head) { stat_tail = NULL; return; } for (this = stat_head; this != NULL; this = next) { next = this->next; free(this->name); free(this); } stat_head = stat_tail = NULL; } /* * Add an entry to the list of stat buffers. */ static void dict_stat_add(const char *name, const struct stat *stat_buf) { dict_stat_t *this; this = malloc(sizeof(*this)); if (!this) return; memset(this, 0, sizeof(*this)); this->name = strdup(name); this->mtime = stat_buf->st_mtime; if (!stat_head) { stat_head = stat_tail = this; } else { stat_tail->next = this; stat_tail = this; } } /* * See if any dictionaries have changed. If not, don't * do anything. */ static int dict_stat_check(const char *root_dir, const char *root_file) { struct stat buf; dict_stat_t *this; if (!stat_root_dir) return 0; if (!stat_root_file) return 0; if (strcmp(root_dir, stat_root_dir) != 0) return 0; if (strcmp(root_file, stat_root_file) != 0) return 0; if (!stat_head) return 0; /* changed, reload */ for (this = stat_head; this != NULL; this = this->next) { if (stat(this->name, &buf) < 0) return 0; if (buf.st_mtime != this->mtime) return 0; } return 1; } typedef struct fr_pool_t { void *page_end; void *free_ptr; struct fr_pool_t *page_free; struct fr_pool_t *page_next; } fr_pool_t; #define FR_POOL_SIZE (32768) #define FR_ALLOC_ALIGN (8) static fr_pool_t *dict_pool = NULL; static fr_pool_t *fr_pool_create(void) { fr_pool_t *fp = malloc(FR_POOL_SIZE); if (!fp) return NULL; memset(fp, 0, FR_POOL_SIZE); fp->page_end = ((uint8_t *) fp) + FR_POOL_SIZE; fp->free_ptr = ((uint8_t *) fp) + sizeof(*fp); fp->page_free = fp; fp->page_next = NULL; return fp; } static void fr_pool_delete(fr_pool_t **pfp) { fr_pool_t *fp, *next; if (!pfp || !*pfp) return; for (fp = *pfp; fp != NULL; fp = next) { next = fp->page_next; fp->page_next = NULL; free(fp); } *pfp = NULL; } static void *fr_pool_alloc(size_t size) { void *ptr; if (size == 0) return NULL; if (size > 256) return NULL; /* shouldn't happen */ if (!dict_pool) { dict_pool = fr_pool_create(); if (!dict_pool) return NULL; } if ((size & (FR_ALLOC_ALIGN - 1)) != 0) { size += FR_ALLOC_ALIGN - (size & (FR_ALLOC_ALIGN - 1)); } if ((((uint8_t *) dict_pool->page_free->free_ptr) + size) > (uint8_t *) dict_pool->page_free->page_end) { dict_pool->page_free->page_next = fr_pool_create(); if (!dict_pool->page_free->page_next) return NULL; dict_pool->page_free = dict_pool->page_free->page_next; } ptr = dict_pool->page_free->free_ptr; dict_pool->page_free->free_ptr = ((uint8_t *) dict_pool->page_free->free_ptr) + size; return ptr; } static void fr_pool_free(UNUSED void *ptr) { /* * Place-holder for later code. */ } /* * Free the dictionary_attributes and dictionary_values lists. */ void dict_free(void) { /* * Free the tables */ fr_hash_table_free(vendors_byname); fr_hash_table_free(vendors_byvalue); vendors_byname = NULL; vendors_byvalue = NULL; fr_hash_table_free(attributes_byname); fr_hash_table_free(attributes_byvalue); attributes_byname = NULL; attributes_byvalue = NULL; fr_hash_table_free(values_byname); fr_hash_table_free(values_byvalue); values_byname = NULL; values_byvalue = NULL; memset(dict_base_attrs, 0, sizeof(dict_base_attrs)); fr_pool_delete(&dict_pool); dict_stat_free(); } /* * Add vendor to the list. */ int dict_addvendor(const char *name, int value) { size_t length; DICT_VENDOR *dv; if (value > 65535) { fr_strerror_printf("dict_addvendor: Cannot handle vendor ID larger than 65535"); return -1; } if ((length = strlen(name)) >= DICT_VENDOR_MAX_NAME_LEN) { fr_strerror_printf("dict_addvendor: vendor name too long"); return -1; } if ((dv = fr_pool_alloc(sizeof(*dv) + length)) == NULL) { fr_strerror_printf("dict_addvendor: out of memory"); return -1; } strcpy(dv->name, name); dv->vendorpec = value; dv->type = dv->length = 1; /* defaults */ if (!fr_hash_table_insert(vendors_byname, dv)) { DICT_VENDOR *old_dv; old_dv = fr_hash_table_finddata(vendors_byname, dv); if (!old_dv) { fr_strerror_printf("dict_addvendor: Failed inserting vendor name %s", name); return -1; } if (old_dv->vendorpec != dv->vendorpec) { fr_strerror_printf("dict_addvendor: Duplicate vendor name %s", name); return -1; } /* * Already inserted. Discard the duplicate entry. */ fr_pool_free(dv); return 0; } /* * Insert the SAME pointer (not free'd when this table is * deleted), into another table. * * We want this behaviour because we want OLD names for * the attributes to be read from the configuration * files, but when we're printing them, (and looking up * by value) we want to use the NEW name. */ if (!fr_hash_table_replace(vendors_byvalue, dv)) { fr_strerror_printf("dict_addvendor: Failed inserting vendor %s", name); return -1; } return 0; } /* * Add an attribute to the dictionary. */ int dict_addattr(const char *name, int vendor, int type, int value, ATTR_FLAGS flags) { size_t namelen; static int max_attr = 0; const char *p; DICT_ATTR *attr; namelen = strlen(name); if (namelen >= DICT_ATTR_MAX_NAME_LEN) { fr_strerror_printf("dict_addattr: attribute name too long"); return -1; } for (p = name; *p != '\0'; p++) { if (*p < ' ') { fr_strerror_printf("dict_addattr: attribute name cannot contain control characters"); return -1; } if ((*p == '"') || (*p == '\\')) { fr_strerror_printf("dict_addattr: attribute name cannot contain quotation or backslash"); return -1; } if ((*p == '<') || (*p == '>') || (*p == '&')) { fr_strerror_printf("dict_addattr: attribute name cannot contain XML control characters"); return -1; } } /* * If the value is '-1', that means use a pre-existing * one (if it already exists). If one does NOT already exist, * then create a new attribute, with a non-conflicting value, * and use that. */ if (value == -1) { if (dict_attrbyname(name)) { return 0; /* exists, don't add it again */ } value = ++max_attr; } else if (vendor == 0) { /* * Update 'max_attr' */ if (value > max_attr) { max_attr = value; } } if (value < 0) { fr_strerror_printf("dict_addattr: ATTRIBUTE has invalid number (less than zero)"); return -1; } if (value >= 65536) { fr_strerror_printf("dict_addattr: ATTRIBUTE has invalid number (larger than 65535)."); return -1; } if (vendor) { DICT_VENDOR *dv; static DICT_VENDOR *last_vendor = NULL; if (flags.is_tlv && (flags.encrypt != FLAG_ENCRYPT_NONE)) { fr_strerror_printf("Sub-TLV's cannot be encrypted"); return -1; } if (flags.has_tlv && (flags.encrypt != FLAG_ENCRYPT_NONE)) { fr_strerror_printf("TLV's cannot be encrypted"); return -1; } if (flags.is_tlv && flags.has_tag) { fr_strerror_printf("Sub-TLV's cannot have a tag"); return -1; } if (flags.has_tlv && flags.has_tag) { fr_strerror_printf("TLV's cannot have a tag"); return -1; } /* * Most ATTRIBUTEs are bunched together by * VENDOR. We can save a lot of lookups on * dictionary initialization by caching the last * vendor. */ if (last_vendor && (vendor == last_vendor->vendorpec)) { dv = last_vendor; } else { dv = dict_vendorbyvalue(vendor); last_vendor = dv; } /* * If the vendor isn't defined, die. */ if (!dv) { fr_strerror_printf("dict_addattr: Unknown vendor"); return -1; } /* * FIXME: Switch over dv->type, and limit things * properly. */ if ((dv->type == 1) && (value >= 256) && !flags.is_tlv) { fr_strerror_printf("dict_addattr: ATTRIBUTE has invalid number (larger than 255)."); return -1; } /* else 256..65535 are allowed */ } /* * Create a new attribute for the list */ if ((attr = fr_pool_alloc(sizeof(*attr) + namelen)) == NULL) { fr_strerror_printf("dict_addattr: out of memory"); return -1; } memcpy(attr->name, name, namelen); attr->name[namelen] = '\0'; attr->attr = value; attr->attr |= (vendor << 16); /* FIXME: hack */ attr->vendor = vendor; attr->type = type; attr->flags = flags; attr->vendor = vendor; /* * Insert the attribute, only if it's not a duplicate. */ if (!fr_hash_table_insert(attributes_byname, attr)) { DICT_ATTR *a; /* * If the attribute has identical number, then * ignore the duplicate. */ a = fr_hash_table_finddata(attributes_byname, attr); if (a && (strcasecmp(a->name, attr->name) == 0)) { if (a->attr != attr->attr) { fr_strerror_printf("dict_addattr: Duplicate attribute name %s", name); fr_pool_free(attr); return -1; } /* * Same name, same vendor, same attr, * maybe the flags and/or type is * different. Let the new value * over-ride the old one. */ } fr_hash_table_delete(attributes_byvalue, a); if (!fr_hash_table_replace(attributes_byname, attr)) { fr_strerror_printf("dict_addattr: Internal error storing attribute %s", name); fr_pool_free(attr); return -1; } } /* * Insert the SAME pointer (not free'd when this entry is * deleted), into another table. * * We want this behaviour because we want OLD names for * the attributes to be read from the configuration * files, but when we're printing them, (and looking up * by value) we want to use the NEW name. */ if (!fr_hash_table_replace(attributes_byvalue, attr)) { fr_strerror_printf("dict_addattr: Failed inserting attribute name %s", name); return -1; } if (!vendor && (value > 0) && (value < 256)) { dict_base_attrs[value] = attr; } return 0; } /* * Add a value for an attribute to the dictionary. */ int dict_addvalue(const char *namestr, const char *attrstr, int value) { size_t length; DICT_ATTR *dattr; DICT_VALUE *dval; static DICT_ATTR *last_attr = NULL; if (!*namestr) { fr_strerror_printf("dict_addvalue: empty names are not permitted"); return -1; } if ((length = strlen(namestr)) >= DICT_VALUE_MAX_NAME_LEN) { fr_strerror_printf("dict_addvalue: value name too long"); return -1; } if ((dval = fr_pool_alloc(sizeof(*dval) + length)) == NULL) { fr_strerror_printf("dict_addvalue: out of memory"); return -1; } memset(dval, 0, sizeof(*dval)); strcpy(dval->name, namestr); dval->value = value; /* * Most VALUEs are bunched together by ATTRIBUTE. We can * save a lot of lookups on dictionary initialization by * caching the last attribute. */ if (last_attr && (strcasecmp(attrstr, last_attr->name) == 0)) { dattr = last_attr; } else { dattr = dict_attrbyname(attrstr); last_attr = dattr; } /* * Remember which attribute is associated with this * value, if possible. */ if (dattr) { if (dattr->flags.has_value_alias) { fr_strerror_printf("dict_addvalue: Cannot add VALUE for ATTRIBUTE \"%s\": It already has a VALUE-ALIAS", attrstr); return -1; } dval->attr = dattr->attr; /* * Enforce valid values * * Don't worry about fixups... */ switch (dattr->type) { case PW_TYPE_BYTE: if (value > 255) { fr_pool_free(dval); fr_strerror_printf("dict_addvalue: ATTRIBUTEs of type 'byte' cannot have VALUEs larger than 255"); return -1; } break; case PW_TYPE_SHORT: if (value > 65535) { fr_pool_free(dval); fr_strerror_printf("dict_addvalue: ATTRIBUTEs of type 'short' cannot have VALUEs larger than 65535"); return -1; } break; /* * Allow octets for now, because * of dictionary.cablelabs */ case PW_TYPE_OCTETS: case PW_TYPE_INTEGER: break; default: fr_pool_free(dval); fr_strerror_printf("dict_addvalue: VALUEs cannot be defined for attributes of type '%s'", fr_int2str(dict_attr_types, dattr->type, "?Unknown?")); return -1; } dattr->flags.has_value = 1; } else { value_fixup_t *fixup; fixup = (value_fixup_t *) malloc(sizeof(*fixup)); if (!fixup) { fr_pool_free(dval); fr_strerror_printf("dict_addvalue: out of memory"); return -1; } memset(fixup, 0, sizeof(*fixup)); strlcpy(fixup->attrstr, attrstr, sizeof(fixup->attrstr)); fixup->dval = dval; /* * Insert to the head of the list. */ fixup->next = value_fixup; value_fixup = fixup; return 0; } /* * Add the value into the dictionary. */ if (!fr_hash_table_insert(values_byname, dval)) { if (dattr) { DICT_VALUE *old; /* * Suppress duplicates with the same * name and value. There are lots in * dictionary.ascend. */ old = dict_valbyname(dattr->attr, namestr); if (old && (old->value == dval->value)) { fr_pool_free(dval); return 0; } } fr_pool_free(dval); fr_strerror_printf("dict_addvalue: Duplicate value name %s for attribute %s", namestr, attrstr); return -1; } /* * There are multiple VALUE's, keyed by attribute, so we * take care of that here. */ if (!fr_hash_table_replace(values_byvalue, dval)) { fr_strerror_printf("dict_addvalue: Failed inserting value %s", namestr); return -1; } return 0; } static int sscanf_i(const char *str, int *pvalue) { int rcode = 0; int base = 10; const char *tab = "0123456789"; if ((str[0] == '0') && ((str[1] == 'x') || (str[1] == 'X'))) { tab = "0123456789abcdef"; base = 16; str += 2; } while (*str) { const char *c; c = memchr(tab, tolower((int) *str), base); if (!c) return 0; rcode *= base; rcode += (c - tab); str++; } *pvalue = rcode; return 1; } /* * Process the ATTRIBUTE command */ static int process_attribute(const char* fn, const int line, const int block_vendor, DICT_ATTR *block_tlv, char **argv, int argc) { int vendor = 0; int value; int type; ATTR_FLAGS flags; if ((argc < 3) || (argc > 4)) { fr_strerror_printf("dict_init: %s[%d]: invalid ATTRIBUTE line", fn, line); return -1; } /* * Validate all entries */ if (!sscanf_i(argv[1], &value)) { fr_strerror_printf("dict_init: %s[%d]: invalid value", fn, line); return -1; } /* * find the type of the attribute. */ type = fr_str2int(dict_attr_types, argv[2], -1); if (type < 0) { fr_strerror_printf("dict_init: %s[%d]: invalid type \"%s\"", fn, line, argv[2]); return -1; } /* * Only look up the vendor if the string * is non-empty. */ memset(&flags, 0, sizeof(flags)); if (argc == 4) { char *key, *next, *last; key = argv[3]; do { next = strchr(key, ','); if (next) *(next++) = '\0'; if (strcmp(key, "has_tag") == 0 || strcmp(key, "has_tag=1") == 0) { /* Boolean flag, means this is a tagged attribute */ flags.has_tag = 1; } else if (strncmp(key, "encrypt=", 8) == 0) { /* Encryption method, defaults to 0 (none). Currently valid is just type 2, Tunnel-Password style, which can only be applied to strings. */ flags.encrypt = strtol(key + 8, &last, 0); if (*last) { fr_strerror_printf( "dict_init: %s[%d] invalid option %s", fn, line, key); return -1; } if ((flags.encrypt == FLAG_ENCRYPT_ASCEND_SECRET) && (type != PW_TYPE_STRING)) { fr_strerror_printf( "dict_init: %s[%d] Only \"string\" types can have the \"encrypt=3\" flag set.", fn, line); return -1; } } else if (strncmp(key, "array", 8) == 0) { flags.array = 1; switch (type) { case PW_TYPE_IPADDR: case PW_TYPE_BYTE: case PW_TYPE_SHORT: case PW_TYPE_INTEGER: case PW_TYPE_DATE: break; default: fr_strerror_printf( "dict_init: %s[%d] Only IP addresses can have the \"array\" flag set.", fn, line); return -1; } /* * The only thing is the vendor name, * and it's a known name: allow it. */ } else if ((key == argv[3]) && !next && !block_vendor && ((vendor = dict_vendorbyname(key)) !=0)) { break; } else { fr_strerror_printf( "dict_init: %s[%d]: unknown option \"%s\"", fn, line, key); return -1; } key = next; if (key && !*key) break; } while (key); } if (block_vendor) vendor = block_vendor; /* * Special checks for tags, they make our life much more * difficult. */ if (flags.has_tag) { /* * Only string, octets, and integer can be tagged. */ switch (type) { case PW_TYPE_STRING: case PW_TYPE_INTEGER: break; default: fr_strerror_printf("dict_init: %s[%d]: Attributes of type %s cannot be tagged.", fn, line, fr_int2str(dict_attr_types, type, "?Unknown?")); return -1; } } if (type == PW_TYPE_TLV) { flags.has_tlv = 1; } if (block_tlv) { /* * TLV's can be only one octet. */ if ((value <= 0) || (value > 255)) { fr_strerror_printf( "dict_init: %s[%d]: sub-tlv's cannot have value > 255", fn, line); return -1; } if (flags.encrypt != FLAG_ENCRYPT_NONE) { fr_strerror_printf( "dict_init: %s[%d]: sub-tlv's cannot be encrypted", fn, line); return -1; } /* * */ value <<= 8; value |= (block_tlv->attr & 0xffff); flags.is_tlv = 1; } #ifdef WITH_DICTIONARY_WARNINGS /* * Hack to help us discover which vendors have illegal * attributes. */ if (!vendor && (value < 256) && !strstr(fn, "rfc") && !strstr(fn, "illegal")) { fprintf(stderr, "WARNING: Illegal Attribute %s in %s\n", argv[0], fn); } #endif /* * Add it in. */ if (dict_addattr(argv[0], vendor, type, value, flags) < 0) { char buffer[256]; strlcpy(buffer, fr_strerror(), sizeof(buffer)); fr_strerror_printf("dict_init: %s[%d]: %s", fn, line, buffer); return -1; } return 0; } /* * Process the VALUE command */ static int process_value(const char* fn, const int line, char **argv, int argc) { int value; if (argc != 3) { fr_strerror_printf("dict_init: %s[%d]: invalid VALUE line", fn, line); return -1; } /* * For Compatibility, skip "Server-Config" */ if (strcasecmp(argv[0], "Server-Config") == 0) return 0; /* * Validate all entries */ if (!sscanf_i(argv[2], &value)) { fr_strerror_printf("dict_init: %s[%d]: invalid value", fn, line); return -1; } if (dict_addvalue(argv[1], argv[0], value) < 0) { char buffer[256]; strlcpy(buffer, fr_strerror(), sizeof(buffer)); fr_strerror_printf("dict_init: %s[%d]: %s", fn, line, buffer); return -1; } return 0; } /* * Process the VALUE-ALIAS command * * This allows VALUE mappings to be shared among multiple * attributes. */ static int process_value_alias(const char* fn, const int line, char **argv, int argc) { DICT_ATTR *my_da, *da; DICT_VALUE *dval; if (argc != 2) { fr_strerror_printf("dict_init: %s[%d]: invalid VALUE-ALIAS line", fn, line); return -1; } my_da = dict_attrbyname(argv[0]); if (!my_da) { fr_strerror_printf("dict_init: %s[%d]: ATTRIBUTE \"%s\" does not exist", fn, line, argv[1]); return -1; } if (my_da->flags.has_value) { fr_strerror_printf("dict_init: %s[%d]: Cannot add VALUE-ALIAS to ATTRIBUTE \"%s\" with pre-existing VALUE", fn, line, argv[0]); return -1; } if (my_da->flags.has_value_alias) { fr_strerror_printf("dict_init: %s[%d]: Cannot add VALUE-ALIAS to ATTRIBUTE \"%s\" with pre-existing VALUE-ALIAS", fn, line, argv[0]); return -1; } da = dict_attrbyname(argv[1]); if (!da) { fr_strerror_printf("dict_init: %s[%d]: Cannot find ATTRIBUTE \"%s\" for alias", fn, line, argv[1]); return -1; } if (!da->flags.has_value) { fr_strerror_printf("dict_init: %s[%d]: VALUE-ALIAS cannot refer to ATTRIBUTE %s: It has no values", fn, line, argv[1]); return -1; } if (da->flags.has_value_alias) { fr_strerror_printf("dict_init: %s[%d]: Cannot add VALUE-ALIAS to ATTRIBUTE \"%s\" which itself has a VALUE-ALIAS", fn, line, argv[1]); return -1; } if (my_da->type != da->type) { fr_strerror_printf("dict_init: %s[%d]: Cannot add VALUE-ALIAS between attributes of differing type", fn, line); return -1; } if ((dval = fr_pool_alloc(sizeof(*dval))) == NULL) { fr_strerror_printf("dict_addvalue: out of memory"); return -1; } dval->name[0] = '\0'; /* empty name */ dval->attr = my_da->attr; dval->value = da->attr; if (!fr_hash_table_insert(values_byname, dval)) { fr_strerror_printf("dict_init: %s[%d]: Error create alias", fn, line); fr_pool_free(dval); return -1; } return 0; } /* * Process the VENDOR command */ static int process_vendor(const char* fn, const int line, char **argv, int argc) { int value; int continuation = 0; const char *format = NULL; if ((argc < 2) || (argc > 3)) { fr_strerror_printf( "dict_init: %s[%d] invalid VENDOR entry", fn, line); return -1; } /* * Validate all entries */ if (!isdigit((int) argv[1][0])) { fr_strerror_printf("dict_init: %s[%d]: invalid value", fn, line); return -1; } value = atoi(argv[1]); /* Create a new VENDOR entry for the list */ if (dict_addvendor(argv[0], value) < 0) { char buffer[256]; strlcpy(buffer, fr_strerror(), sizeof(buffer)); fr_strerror_printf("dict_init: %s[%d]: %s", fn, line, buffer); return -1; } /* * Look for a format statement */ if (argc == 3) { format = argv[2]; } else if (value == VENDORPEC_USR) { /* catch dictionary screw-ups */ format = "format=4,0"; } else if (value == VENDORPEC_LUCENT) { format = "format=2,1"; } else if (value == VENDORPEC_STARENT) { format = "format=2,2"; } /* else no fixups to do */ if (format) { int type, length; const char *p; DICT_VENDOR *dv; if (strncasecmp(format, "format=", 7) != 0) { fr_strerror_printf("dict_init: %s[%d]: Invalid format for VENDOR. Expected \"format=\", got \"%s\"", fn, line, format); return -1; } p = format + 7; if ((strlen(p) < 3) || !isdigit((int) p[0]) || (p[1] != ',') || !isdigit((int) p[2]) || (p[3] && (p[3] != ','))) { fr_strerror_printf("dict_init: %s[%d]: Invalid format for VENDOR. Expected text like \"1,1\", got \"%s\"", fn, line, p); return -1; } type = (int) (p[0] - '0'); length = (int) (p[2] - '0'); if (p[3] == ',') { if (!p[4]) { fr_strerror_printf("dict_init: %s[%d]: Invalid format for VENDOR. Expected text like \"1,1\", got \"%s\"", fn, line, p); return -1; } if ((p[4] != 'c') || (p[5] != '\0')) { fr_strerror_printf("dict_init: %s[%d]: Invalid format for VENDOR. Expected text like \"1,1\", got \"%s\"", fn, line, p); return -1; } continuation = 1; } dv = dict_vendorbyvalue(value); if (!dv) { fr_strerror_printf("dict_init: %s[%d]: Failed adding format for VENDOR", fn, line); return -1; } if ((type != 1) && (type != 2) && (type != 4)) { fr_strerror_printf("dict_init: %s[%d]: invalid type value %d for VENDOR", fn, line, type); return -1; } if ((length != 0) && (length != 1) && (length != 2)) { fr_strerror_printf("dict_init: %s[%d]: invalid length value %d for VENDOR", fn, line, length); return -1; } dv->type = type; dv->length = length; dv->flags = continuation; } return 0; } /* * String split routine. Splits an input string IN PLACE * into pieces, based on spaces. */ static int str2argv(char *str, char **argv, int max_argc) { int argc = 0; while (*str) { if (argc >= max_argc) return argc; /* * Chop out comments early. */ if (*str == '#') { *str = '\0'; break; } while ((*str == ' ') || (*str == '\t') || (*str == '\r') || (*str == '\n')) *(str++) = '\0'; if (!*str) return argc; argv[argc] = str; argc++; while (*str && (*str != ' ') && (*str != '\t') && (*str != '\r') && (*str != '\n')) str++; } return argc; } #define MAX_ARGV (16) /* * Initialize the dictionary. */ static int my_dict_init(const char *dir, const char *fn, const char *src_file, int src_line) { FILE *fp; char dirtmp[256]; char buf[256]; char *p; int line = 0; int vendor; int block_vendor; struct stat statbuf; char *argv[MAX_ARGV]; int argc; DICT_ATTR *da, *block_tlv = NULL; if (strlen(fn) >= sizeof(dirtmp) / 2 || strlen(dir) >= sizeof(dirtmp) / 2) { fr_strerror_printf("dict_init: filename name too long"); return -1; } /* * First see if fn is relative to dir. If so, create * new filename. If not, remember the absolute dir. */ if ((p = strrchr(fn, FR_DIR_SEP)) != NULL) { strcpy(dirtmp, fn); dirtmp[p - fn] = 0; dir = dirtmp; } else if (dir && dir[0] && strcmp(dir, ".") != 0) { snprintf(dirtmp, sizeof(dirtmp), "%s/%s", dir, fn); fn = dirtmp; } if ((fp = fopen(fn, "r")) == NULL) { if (!src_file) { fr_strerror_printf("dict_init: Couldn't open dictionary \"%s\": %s", fn, strerror(errno)); } else { fr_strerror_printf("dict_init: %s[%d]: Couldn't open dictionary \"%s\": %s", src_file, src_line, fn, strerror(errno)); } return -1; } stat(fn, &statbuf); /* fopen() guarantees this will succeed */ if (!S_ISREG(statbuf.st_mode)) { fclose(fp); fr_strerror_printf("dict_init: Dictionary \"%s\" is not a regular file", fn); return -1; } /* * Globally writable dictionaries means that users can control * the server configuration with little difficulty. */ #ifdef S_IWOTH if ((statbuf.st_mode & S_IWOTH) != 0) { fclose(fp); fr_strerror_printf("dict_init: Dictionary \"%s\" is globally writable. Refusing to start due to insecure configuration.", fn); return -1; } #endif dict_stat_add(fn, &statbuf); /* * Seed the random pool with data. */ fr_rand_seed(&statbuf, sizeof(statbuf)); block_vendor = 0; while (fgets(buf, sizeof(buf), fp) != NULL) { line++; if (buf[0] == '#' || buf[0] == 0 || buf[0] == '\n' || buf[0] == '\r') continue; /* * Comment characters should NOT be appearing anywhere but * as start of a comment; */ p = strchr(buf, '#'); if (p) *p = '\0'; argc = str2argv(buf, argv, MAX_ARGV); if (argc == 0) continue; if (argc == 1) { fr_strerror_printf( "dict_init: %s[%d] invalid entry", fn, line); fclose(fp); return -1; } /* * Process VALUE lines. */ if (strcasecmp(argv[0], "VALUE") == 0) { if (process_value(fn, line, argv + 1, argc - 1) == -1) { fclose(fp); return -1; } continue; } /* * Perhaps this is an attribute. */ if (strcasecmp(argv[0], "ATTRIBUTE") == 0) { if (process_attribute(fn, line, block_vendor, block_tlv, argv + 1, argc - 1) == -1) { fclose(fp); return -1; } continue; } /* * See if we need to import another dictionary. */ if (strcasecmp(argv[0], "$INCLUDE") == 0) { if (my_dict_init(dir, argv[1], fn, line) < 0) { fclose(fp); return -1; } continue; } /* $INCLUDE */ if (strcasecmp(argv[0], "VALUE-ALIAS") == 0) { if (process_value_alias(fn, line, argv + 1, argc - 1) == -1) { fclose(fp); return -1; } continue; } /* * Process VENDOR lines. */ if (strcasecmp(argv[0], "VENDOR") == 0) { if (process_vendor(fn, line, argv + 1, argc - 1) == -1) { fclose(fp); return -1; } continue; } if (strcasecmp(argv[0], "BEGIN-TLV") == 0) { if (argc != 2) { fr_strerror_printf( "dict_init: %s[%d] invalid BEGIN-TLV entry", fn, line); fclose(fp); return -1; } da = dict_attrbyname(argv[1]); if (!da) { fr_strerror_printf( "dict_init: %s[%d]: unknown attribute %s", fn, line, argv[1]); fclose(fp); return -1; } if (da->type != PW_TYPE_TLV) { fr_strerror_printf( "dict_init: %s[%d]: attribute %s is not of type tlv", fn, line, argv[1]); fclose(fp); return -1; } if (block_tlv) { fr_strerror_printf( "dict_init: %s[%d]: Cannot nest TLVs", fn, line); fclose(fp); return -1; } block_tlv = da; continue; } /* BEGIN-TLV */ if (strcasecmp(argv[0], "END-TLV") == 0) { if (argc != 2) { fr_strerror_printf( "dict_init: %s[%d] invalid END-TLV entry", fn, line); fclose(fp); return -1; } da = dict_attrbyname(argv[1]); if (!da) { fr_strerror_printf( "dict_init: %s[%d]: unknown attribute %s", fn, line, argv[1]); fclose(fp); return -1; } if (da != block_tlv) { fr_strerror_printf( "dict_init: %s[%d]: END-TLV %s does not match any previous BEGIN-TLV", fn, line, argv[1]); fclose(fp); return -1; } block_tlv = NULL; continue; } /* END-VENDOR */ if (strcasecmp(argv[0], "BEGIN-VENDOR") == 0) { if (argc != 2) { fr_strerror_printf( "dict_init: %s[%d] invalid BEGIN-VENDOR entry", fn, line); fclose(fp); return -1; } vendor = dict_vendorbyname(argv[1]); if (!vendor) { fr_strerror_printf( "dict_init: %s[%d]: unknown vendor %s", fn, line, argv[1]); fclose(fp); return -1; } block_vendor = vendor; continue; } /* BEGIN-VENDOR */ if (strcasecmp(argv[0], "END-VENDOR") == 0) { if (argc != 2) { fr_strerror_printf( "dict_init: %s[%d] invalid END-VENDOR entry", fn, line); fclose(fp); return -1; } vendor = dict_vendorbyname(argv[1]); if (!vendor) { fr_strerror_printf( "dict_init: %s[%d]: unknown vendor %s", fn, line, argv[1]); fclose(fp); return -1; } if (vendor != block_vendor) { fr_strerror_printf( "dict_init: %s[%d]: END-VENDOR %s does not match any previous BEGIN-VENDOR", fn, line, argv[1]); fclose(fp); return -1; } block_vendor = 0; continue; } /* END-VENDOR */ /* * Any other string: We don't recognize it. */ fr_strerror_printf("dict_init: %s[%d] invalid keyword \"%s\"", fn, line, argv[0]); fclose(fp); return -1; } fclose(fp); return 0; } /* * Empty callback for hash table initialization. */ static int null_callback(void *ctx, void *data) { ctx = ctx; /* -Wunused */ data = data; /* -Wunused */ return 0; } /* * Initialize the directory, then fix the attr member of * all attributes. */ int dict_init(const char *dir, const char *fn) { /* * Check if we need to change anything. If not, don't do * anything. */ if (dict_stat_check(dir, fn)) { return 0; } /* * Free the dictionaries, and the stat cache. */ dict_free(); stat_root_dir = strdup(dir); stat_root_file = strdup(fn); /* * Create the table of vendor by name. There MAY NOT * be multiple vendors of the same name. * * Each vendor is malloc'd, so the free function is free. */ vendors_byname = fr_hash_table_create(dict_vendor_name_hash, dict_vendor_name_cmp, fr_pool_free); if (!vendors_byname) { return -1; } /* * Create the table of vendors by value. There MAY * be vendors of the same value. If there are, we * pick the latest one. */ vendors_byvalue = fr_hash_table_create(dict_vendor_value_hash, dict_vendor_value_cmp, fr_pool_free); if (!vendors_byvalue) { return -1; } /* * Create the table of attributes by name. There MAY NOT * be multiple attributes of the same name. * * Each attribute is malloc'd, so the free function is free. */ attributes_byname = fr_hash_table_create(dict_attr_name_hash, dict_attr_name_cmp, fr_pool_free); if (!attributes_byname) { return -1; } /* * Create the table of attributes by value. There MAY * be attributes of the same value. If there are, we * pick the latest one. */ attributes_byvalue = fr_hash_table_create(dict_attr_value_hash, dict_attr_value_cmp, fr_pool_free); if (!attributes_byvalue) { return -1; } values_byname = fr_hash_table_create(dict_value_name_hash, dict_value_name_cmp, fr_pool_free); if (!values_byname) { return -1; } values_byvalue = fr_hash_table_create(dict_value_value_hash, dict_value_value_cmp, fr_pool_free); if (!values_byvalue) { return -1; } value_fixup = NULL; /* just to be safe. */ if (my_dict_init(dir, fn, NULL, 0) < 0) return -1; if (value_fixup) { DICT_ATTR *a; value_fixup_t *this, *next; for (this = value_fixup; this != NULL; this = next) { next = this->next; a = dict_attrbyname(this->attrstr); if (!a) { fr_strerror_printf( "dict_init: No ATTRIBUTE \"%s\" defined for VALUE \"%s\"", this->attrstr, this->dval->name); return -1; /* leak, but they should die... */ } this->dval->attr = a->attr; /* * Add the value into the dictionary. */ if (!fr_hash_table_replace(values_byname, this->dval)) { fr_strerror_printf("dict_addvalue: Duplicate value name %s for attribute %s", this->dval->name, a->name); return -1; } /* * Allow them to use the old name, but * prefer the new name when printing * values. */ if (!fr_hash_table_finddata(values_byvalue, this->dval)) { fr_hash_table_replace(values_byvalue, this->dval); } free(this); /* * Just so we don't lose track of things. */ value_fixup = next; } } /* * Walk over all of the hash tables to ensure they're * initialized. We do this because the threads may perform * lookups, and we don't want multi-threaded re-ordering * of the table entries. That would be bad. */ fr_hash_table_walk(vendors_byname, null_callback, NULL); fr_hash_table_walk(vendors_byvalue, null_callback, NULL); fr_hash_table_walk(attributes_byname, null_callback, NULL); fr_hash_table_walk(attributes_byvalue, null_callback, NULL); fr_hash_table_walk(values_byvalue, null_callback, NULL); fr_hash_table_walk(values_byname, null_callback, NULL); return 0; } /* * Get an attribute by its numerical value. */ DICT_ATTR *dict_attrbyvalue(unsigned int attr) { DICT_ATTR dattr; if ((attr > 0) && (attr < 256)) return dict_base_attrs[attr]; dattr.attr = attr; dattr.vendor = VENDOR(attr); return fr_hash_table_finddata(attributes_byvalue, &dattr); } /* * Get an attribute by its name. */ DICT_ATTR *dict_attrbyname(const char *name) { DICT_ATTR *da; uint32_t buffer[(sizeof(*da) + DICT_ATTR_MAX_NAME_LEN + 3)/4]; if (!name) return NULL; da = (DICT_ATTR *) buffer; strlcpy(da->name, name, DICT_ATTR_MAX_NAME_LEN + 1); return fr_hash_table_finddata(attributes_byname, da); } /* * Associate a value with an attribute and return it. */ DICT_VALUE *dict_valbyattr(unsigned int attr, int value) { DICT_VALUE dval, *dv; /* * First, look up aliases. */ dval.attr = attr; dval.name[0] = '\0'; /* * Look up the attribute alias target, and use * the correct attribute number if found. */ dv = fr_hash_table_finddata(values_byname, &dval); if (dv) dval.attr = dv->value; dval.value = value; return fr_hash_table_finddata(values_byvalue, &dval); } /* * Associate a value with an attribute and return it. */ const char *dict_valnamebyattr(unsigned int attr, int value) { DICT_VALUE dval, *dv; /* * First, look up aliases. */ dval.attr = attr; dval.name[0] = '\0'; /* * Look up the attribute alias target, and use * the correct attribute number if found. */ dv = fr_hash_table_finddata(values_byname, &dval); if (dv) dval.attr = dv->value; dval.value = value; dv = fr_hash_table_finddata(values_byvalue, &dval); if (!dv) return ""; return dv->name; } /* * Get a value by its name, keyed off of an attribute. */ DICT_VALUE *dict_valbyname(unsigned int attr, const char *name) { DICT_VALUE *my_dv, *dv; uint32_t buffer[(sizeof(*my_dv) + DICT_VALUE_MAX_NAME_LEN + 3)/4]; if (!name) return NULL; my_dv = (DICT_VALUE *) buffer; my_dv->attr = attr; my_dv->name[0] = '\0'; /* * Look up the attribute alias target, and use * the correct attribute number if found. */ dv = fr_hash_table_finddata(values_byname, my_dv); if (dv) my_dv->attr = dv->value; strlcpy(my_dv->name, name, DICT_VALUE_MAX_NAME_LEN + 1); return fr_hash_table_finddata(values_byname, my_dv); } /* * Get the vendor PEC based on the vendor name * * This is efficient only for small numbers of vendors. */ int dict_vendorbyname(const char *name) { DICT_VENDOR *dv; uint32_t buffer[(sizeof(*dv) + DICT_VENDOR_MAX_NAME_LEN + 3)/4]; if (!name) return 0; dv = (DICT_VENDOR *) buffer; strlcpy(dv->name, name, DICT_VENDOR_MAX_NAME_LEN + 1); dv = fr_hash_table_finddata(vendors_byname, dv); if (!dv) return 0; return dv->vendorpec; } /* * Return the vendor struct based on the PEC. */ DICT_VENDOR *dict_vendorbyvalue(int vendorpec) { DICT_VENDOR dv; dv.vendorpec = vendorpec; return fr_hash_table_finddata(vendors_byvalue, &dv); } freeradius-server/src/lib/event.c000066400000000000000000000227701257552170400173550ustar00rootroot00000000000000/* * event.c Non-thread-safe event handling, specific to a RADIUS * server. * * Version: $Id$ * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2007 The FreeRADIUS server project * Copyright 2007 Alan DeKok */ #include RCSID("$Id$") #include #include #include typedef struct fr_event_fd_t { int fd; fr_event_fd_handler_t handler; void *ctx; } fr_event_fd_t; #define FR_EV_MAX_FDS (256) #undef USEC #define USEC (1000000) struct fr_event_list_t { fr_heap_t *times; int changed; int exit; fr_event_status_t status; struct timeval now; int dispatch; int max_readers; fr_event_fd_t readers[FR_EV_MAX_FDS]; }; /* * Internal structure for managing events. */ struct fr_event_t { fr_event_callback_t callback; void *ctx; struct timeval when; fr_event_t **ev_p; int heap; }; static int fr_event_list_time_cmp(const void *one, const void *two) { const fr_event_t *a = one; const fr_event_t *b = two; if (a->when.tv_sec < b->when.tv_sec) return -1; if (a->when.tv_sec > b->when.tv_sec) return +1; if (a->when.tv_usec < b->when.tv_usec) return -1; if (a->when.tv_usec > b->when.tv_usec) return +1; return 0; } void fr_event_list_free(fr_event_list_t *el) { fr_event_t *ev; if (!el) return; while ((ev = fr_heap_peek(el->times)) != NULL) { fr_event_delete(el, &ev); } fr_heap_delete(el->times); free(el); } fr_event_list_t *fr_event_list_create(fr_event_status_t status) { int i; fr_event_list_t *el; el = malloc(sizeof(*el)); if (!el) return NULL; memset(el, 0, sizeof(*el)); el->times = fr_heap_create(fr_event_list_time_cmp, offsetof(fr_event_t, heap)); if (!el->times) { fr_event_list_free(el); return NULL; } for (i = 0; i < FR_EV_MAX_FDS; i++) { el->readers[i].fd = -1; } el->status = status; el->changed = 1; /* force re-set of fds's */ return el; } int fr_event_list_num_elements(fr_event_list_t *el) { if (!el) return 0; return fr_heap_num_elements(el->times); } int fr_event_delete(fr_event_list_t *el, fr_event_t **ev_p) { fr_event_t *ev; if (!el || !ev_p || !*ev_p) return 0; ev = *ev_p; if (ev->ev_p) *(ev->ev_p) = NULL; *ev_p = NULL; fr_heap_extract(el->times, ev); free(ev); return 1; } int fr_event_insert(fr_event_list_t *el, fr_event_callback_t callback, void *ctx, struct timeval *when, fr_event_t **ev_p) { fr_event_t *ev; if (!el || !callback | !when || (when->tv_usec >= USEC)) return 0; if (ev_p && *ev_p) fr_event_delete(el, ev_p); ev = malloc(sizeof(*ev)); if (!ev) return 0; memset(ev, 0, sizeof(*ev)); ev->callback = callback; ev->ctx = ctx; ev->when = *when; ev->ev_p = ev_p; if (!fr_heap_insert(el->times, ev)) { free(ev); return 0; } if (ev_p) *ev_p = ev; return 1; } int fr_event_run(fr_event_list_t *el, struct timeval *when) { fr_event_callback_t callback; void *ctx; fr_event_t *ev; if (!el) return 0; if (fr_heap_num_elements(el->times) == 0) { when->tv_sec = 0; when->tv_usec = 0; return 0; } ev = fr_heap_peek(el->times); if (!ev) { when->tv_sec = 0; when->tv_usec = 0; return 0; } /* * See if it's time to do this one. */ if ((ev->when.tv_sec > when->tv_sec) || ((ev->when.tv_sec == when->tv_sec) && (ev->when.tv_usec > when->tv_usec))) { *when = ev->when; return 0; } callback = ev->callback; ctx = ev->ctx; /* * Delete the event before calling it. */ fr_event_delete(el, &ev); callback(ctx); return 1; } int fr_event_now(fr_event_list_t *el, struct timeval *when) { if (!when) return 0; if (el && el->dispatch) { *when = el->now; } else { gettimeofday(when, NULL); } return 1; } int fr_event_fd_insert(fr_event_list_t *el, int type, int fd, fr_event_fd_handler_t handler, void *ctx) { int i; fr_event_fd_t *ef; if (!el || (fd < 0) || !handler || !ctx) return 0; if (type != 0) return 0; if (el->max_readers >= FR_EV_MAX_FDS) return 0; ef = NULL; for (i = 0; i <= el->max_readers; i++) { /* * Be fail-safe on multiple inserts. */ if (el->readers[i].fd == fd) { if ((el->readers[i].handler != handler) || (el->readers[i].ctx != ctx)) { return 0; } /* * No change. */ return 1; } if (el->readers[i].fd < 0) { ef = &el->readers[i]; if (i == el->max_readers) el->max_readers = i + 1; break; } } if (!ef) return 0; ef->handler = handler; ef->ctx = ctx; ef->fd = fd; el->changed = 1; return 1; } int fr_event_fd_delete(fr_event_list_t *el, int type, int fd) { int i; if (!el || (fd < 0)) return 0; if (type != 0) return 0; for (i = 0; i < el->max_readers; i++) { if (el->readers[i].fd == fd) { el->readers[i].fd = -1; if ((i + 1) == el->max_readers) el->max_readers = i; el->changed = 1; return 1; } } return 0; } void fr_event_loop_exit(fr_event_list_t *el, int code) { if (!el) return; el->exit = code; } int fr_event_loop(fr_event_list_t *el) { int i, rcode, maxfd = 0; struct timeval when, *wake; fd_set read_fds, master_fds; el->exit = 0; el->dispatch = 1; el->changed = 1; while (!el->exit) { /* * Cache the list of FD's to watch. */ if (el->changed) { FD_ZERO(&master_fds); for (i = 0; i < el->max_readers; i++) { if (el->readers[i].fd < 0) continue; if (el->readers[i].fd > maxfd) { maxfd = el->readers[i].fd; } FD_SET(el->readers[i].fd, &master_fds); } el->changed = 0; } /* * Find the first event. If there's none, we wait * on the socket forever. */ when.tv_sec = 0; when.tv_usec = 0; if (fr_heap_num_elements(el->times) > 0) { fr_event_t *ev; ev = fr_heap_peek(el->times); if (!ev) _exit(42); gettimeofday(&el->now, NULL); if (timercmp(&el->now, &ev->when, <)) { when = ev->when; when.tv_sec -= el->now.tv_sec; if (when.tv_sec > 0) { when.tv_sec--; when.tv_usec += USEC; } else { when.tv_sec = 0; } when.tv_usec -= el->now.tv_usec; if (when.tv_usec >= USEC) { when.tv_usec -= USEC; when.tv_sec++; } } else { /* we've passed the event time */ when.tv_sec = 0; when.tv_usec = 0; } wake = &when; } else { wake = NULL; } /* * Tell someone what the status is. */ if (el->status) el->status(wake); read_fds = master_fds; rcode = select(maxfd + 1, &read_fds, NULL, NULL, wake); if ((rcode < 0) && (errno != EINTR)) { fr_strerror_printf("Failed in select: %s", strerror(errno)); el->dispatch = 0; return -1; } if (fr_heap_num_elements(el->times) > 0) { do { gettimeofday(&el->now, NULL); when = el->now; } while (fr_event_run(el, &when) == 1); } if (rcode <= 0) continue; for (i = 0; i < el->max_readers; i++) { fr_event_fd_t *ef = &el->readers[i]; if (ef->fd < 0) continue; if (!FD_ISSET(ef->fd, &read_fds)) continue; ef->handler(el, ef->fd, ef->ctx); if (el->changed) break; } } el->dispatch = 0; return el->exit; } #ifdef TESTING /* * cc -g -I .. -c rbtree.c -o rbtree.o && cc -g -I .. -c isaac.c -o isaac.o && cc -DTESTING -I .. -c event.c -o event_mine.o && cc event_mine.o rbtree.o isaac.o -o event * * ./event * * And hit CTRL-S to stop the output, CTRL-Q to continue. * It normally alternates printing the time and sleeping, * but when you hit CTRL-S/CTRL-Q, you should see a number * of events run right after each other. * * OR * * valgrind --tool=memcheck --leak-check=full --show-reachable=yes ./event */ static void print_time(void *ctx) { struct timeval *when = ctx; printf("%d.%06d\n", when->tv_sec, when->tv_usec); fflush(stdout); } static fr_randctx rand_pool; static uint32_t event_rand(void) { uint32_t num; num = rand_pool.randrsl[rand_pool.randcnt++]; if (rand_pool.randcnt == 256) { fr_isaac(&rand_pool); rand_pool.randcnt = 0; } return num; } #define MAX 100 int main(int argc, char **argv) { int i, rcode; struct timeval array[MAX]; struct timeval now, when; fr_event_list_t *el; el = fr_event_list_create(); if (!el) exit(1); memset(&rand_pool, 0, sizeof(rand_pool)); rand_pool.randrsl[1] = time(NULL); fr_randinit(&rand_pool, 1); rand_pool.randcnt = 0; gettimeofday(&array[0], NULL); for (i = 1; i < MAX; i++) { array[i] = array[i - 1]; array[i].tv_usec += event_rand() & 0xffff; if (array[i].tv_usec > 1000000) { array[i].tv_usec -= 1000000; array[i].tv_sec++; } fr_event_insert(el, print_time, &array[i], &array[i]); } while (fr_event_list_num_elements(el)) { gettimeofday(&now, NULL); when = now; if (!fr_event_run(el, &when)) { int delay = (when.tv_sec - now.tv_sec) * 1000000; delay += when.tv_usec; delay -= now.tv_usec; printf("\tsleep %d\n", delay); fflush(stdout); usleep(delay); } } fr_event_list_free(el); return 0; } #endif freeradius-server/src/lib/fifo.c000066400000000000000000000073431257552170400171560ustar00rootroot00000000000000/* * fifo.c Non-thread-safe fifo (FIFO) implementation, based * on hash tables. * * Version: $Id$ * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2005,2006 The FreeRADIUS server project * Copyright 2005 Alan DeKok */ #include RCSID("$Id$") #include typedef struct fr_fifo_entry_t { struct fr_fifo_entry_t *next; void *data; } fr_fifo_entry_t; struct fr_fifo_t { fr_fifo_entry_t *head, **tail; fr_fifo_entry_t *freelist; int num_elements; int max_entries; fr_fifo_free_t freeNode; }; fr_fifo_t *fr_fifo_create(int max_entries, fr_fifo_free_t freeNode) { fr_fifo_t *fi; if ((max_entries < 2) || (max_entries > (1024 * 1024))) return NULL; fi = malloc(sizeof(*fi)); if (!fi) return NULL; memset(fi, 0, sizeof(*fi)); fi->max_entries = max_entries; fi->freeNode = freeNode; return fi; } static void fr_fifo_free_entries(fr_fifo_t *fi, fr_fifo_entry_t *head) { fr_fifo_entry_t *next; while (head) { next = head->next; if (fi->freeNode && head->data) fi->freeNode(head->data); free(head); head = next; } } void fr_fifo_free(fr_fifo_t *fi) { if (!fi) return; fr_fifo_free_entries(fi, fi->head); fr_fifo_free_entries(fi, fi->freelist); free(fi); } static fr_fifo_entry_t *fr_fifo_alloc_entry(fr_fifo_t *fi) { fr_fifo_entry_t *entry; if (fi->freelist) { entry = fi->freelist; fi->freelist = entry->next; } else { entry = malloc(sizeof(*entry)); if (!entry) return NULL; } memset(entry, 0, sizeof(*entry)); return entry; } int fr_fifo_push(fr_fifo_t *fi, void *data) { fr_fifo_entry_t *entry; if (!fi || !data) return 0; if (fi->num_elements >= fi->max_entries) return 0; entry = fr_fifo_alloc_entry(fi); if (!entry) return 0; entry->data = data; if (!fi->head) { fi->head = entry; } else { *fi->tail = entry; } fi->tail = &(entry->next); fi->num_elements++; return 1; } static void fr_fifo_free_entry(fr_fifo_t *fi, fr_fifo_entry_t *entry) { entry->data = NULL; entry->next = fi->freelist; fi->freelist = entry; } void *fr_fifo_pop(fr_fifo_t *fi) { void *data; fr_fifo_entry_t *entry; if (!fi || !fi->head) return NULL; entry = fi->head; fi->head = entry->next; data = entry->data; fr_fifo_free_entry(fi, entry); fi->num_elements--; if (!fi->head) { fi->tail = NULL; fi->num_elements = 0; } return data; } void *fr_fifo_peek(fr_fifo_t *fi) { if (!fi || !fi->head) return NULL; return fi->head->data; } int fr_fifo_num_elements(fr_fifo_t *fi) { if (!fi) return 0; return fi->num_elements; } #ifdef TESTING /* * cc -DTESTING -I .. fifo.c -o fifo * * ./fifo */ #define MAX 1024 int main(int argc, char **argv) { int i, array[MAX]; fr_fifo_t *fi; fi = fr_fifo_create(MAX, NULL); if (!fi) exit(1); for (i = 0; i < MAX; i++) { array[i] = i; if (!fr_fifo_push(fi, &array[i])) exit(2); } for (i = 0; i < MAX; i++) { int *p; p = fr_fifo_pop(fi); if (!p) { fprintf(stderr, "No pop at %d\n", i); exit(3); } if (*p != i) exit(4); } exit(0); } #endif freeradius-server/src/lib/filters.c000066400000000000000000000714471257552170400177110ustar00rootroot00000000000000/* * filters.c Routines to parse Ascend's filter attributes. * * Version: $Id$ * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2003,2006 The FreeRADIUS server project */ #include RCSID("$Id$") #include #ifdef ASCEND_BINARY #include /* * Two types of filters are supported, GENERIC and IP. The identifiers * are: */ #define RAD_FILTER_GENERIC 0 #define RAD_FILTER_IP 1 #define RAD_FILTER_IPX 2 /* * Generic filters mask and match up to RAD_MAX_FILTER_LEN bytes * starting at some offset. The length is: */ #define RAD_MAX_FILTER_LEN 6 /* * ASCEND extensions for ABINARY filters */ #define IPX_NODE_ADDR_LEN 6 #if ! defined( FALSE ) # define FALSE 0 # define TRUE (! FALSE) #endif /* * ascend_ip_filter_t * * The binary format of an IP filter. ALL fields are stored in * network byte order. * * srcip: The source IP address. * * dstip: The destination IP address. * * srcmask: The number of leading one bits in the source address * mask. Specifies the bits of interest. * * dstmask: The number of leading one bits in the destination * address mask. Specifies the bits of interest. * * proto: The IP protocol number * * established: A boolean value. TRUE when we care about the * established state of a TCP connection. FALSE when * we dont care. * * srcport: TCP or UDP source port number. * * dstport: TCP or UDP destination port number. * * srcPortCmp: One of the values of the RadFilterComparison * enumeration, specifying how to compare the * srcport value. * * dstPortCmp: One of the values of the RadFilterComparison * enumeration, specifying how to compare the * dstport value. * * fill: Round things out to a int16_t boundary. */ typedef struct ascend_ip_filter_t { uint32_t srcip; uint32_t dstip; uint8_t srcmask; uint8_t dstmask; uint8_t proto; uint8_t established; uint16_t srcport; uint16_t dstport; uint8_t srcPortComp; uint8_t dstPortComp; unsigned char fill[4]; /* used to be fill[2] */ } ascend_ip_filter_t; /* * ascend_ipx_net_t * * net: IPX Net address * * node: IPX Node address * * socket: IPX socket address */ typedef struct ascend_ipx_net_t { uint32_t net; uint8_t node[IPX_NODE_ADDR_LEN]; uint16_t socket; } ascend_ipx_net_t; /* * ascend_ipx_filter_t * * The binary format of an IPX filter. ALL fields are stored in * network byte order. * * src: Source net, node, and socket. * * dst: Destination net, node, and socket. * * srcSocComp: Source socket compare value * * dstSocComp: Destination socket compare value */ typedef struct ascend_ipx_filter_t { ascend_ipx_net_t src; ascend_ipx_net_t dst; uint8_t srcSocComp; uint8_t dstSocComp; } ascend_ipx_filter_t; /* * ascend_generic_filter_t * * The binary format of a GENERIC filter. ALL fields are stored in * network byte order. * * offset: Number of bytes into packet to start comparison. * * len: Number of bytes to mask and compare. May not * exceed RAD_MAX_FILTER_LEN. * * more: Boolean. If non-zero the next filter entry is * also to be applied to a packet. * * mask: A bit mask specifying the bits to compare. * * value: A value to compare against the masked bits at * offset in a users packet. * * compNeq: Defines type of comarison (Equal or Notequal) * default is Equal. * * fill: Round things out to a dword boundary */ typedef struct ascend_generic_filter_t { uint16_t offset; uint16_t len; uint16_t more; uint8_t mask[ RAD_MAX_FILTER_LEN ]; uint8_t value[ RAD_MAX_FILTER_LEN ]; uint8_t compNeq; uint8_t fill[3]; /* used to be fill[1] */ } ascend_generic_filter_t; /* * ascend_filter_t * * A binary filter element. Contains one of ascend_ip_filter_t, * ascend_ipx_filter_t, or ascend_generic_filter_t. * * All fields are stored in network byte order. * * type: Either RAD_FILTER_GENERIC or RAD_FILTER_IP. * * forward: TRUE if we should forward packets that match this * filter, FALSE if we should drop packets that match * this filter. * * direction: TRUE if this is an input filter, FALSE if this is * an output filter. * * fill: Round things out to a dword boundary. * * u: A union of * ip: An ip filter entry * generic: A generic filter entry */ typedef struct ascend_filter_t { uint8_t type; uint8_t forward; uint8_t direction; uint8_t fill; union { ascend_ip_filter_t ip; ascend_ipx_filter_t ipx; ascend_generic_filter_t generic; uint8_t data[28]; /* ensure it's 32 bytes */ } u; } ascend_filter_t; /* * This is a wild C hack... */ typedef struct _cpp_hack { char data[(sizeof(ascend_filter_t) == 32) ? 1 : -1 ]; } _cpp_hack; /* * FilterPortType: * * Ascii names of some well known tcp/udp services. * Used for filtering on a port type. * * ??? What the heck is wrong with getservbyname? */ static const FR_NAME_NUMBER filterPortType[] = { { "ftp-data", 20 }, { "ftp", 21 }, { "telnet", 23 }, { "smtp", 25 }, { "nameserver", 42 }, { "domain", 53 }, { "tftp", 69 }, { "gopher", 70 }, { "finger", 79 }, { "www", 80 }, { "kerberos", 88 }, { "hostname", 101 }, { "nntp", 119 }, { "ntp", 123 }, { "exec", 512 }, { "login", 513 }, { "cmd", 514 }, { "talk", 517 }, { NULL , 0}, }; static const FR_NAME_NUMBER filterType[] = { { "generic", RAD_FILTER_GENERIC}, { "ip", RAD_FILTER_IP}, { "ipx", RAD_FILTER_IPX}, { NULL, 0}, }; typedef enum { FILTER_GENERIC_TYPE, FILTER_IP_TYPE, FILTER_IN, FILTER_OUT, FILTER_FORWARD, FILTER_DROP, FILTER_GENERIC_OFFSET, FILTER_GENERIC_MASK, FILTER_GENERIC_VALUE, FILTER_GENERIC_COMPNEQ, FILTER_GENERIC_COMPEQ, FILTER_MORE, FILTER_IP_DST, FILTER_IP_SRC, FILTER_IP_PROTO, FILTER_IP_DST_PORT, FILTER_IP_SRC_PORT, FILTER_EST, FILTER_IPX_TYPE, FILTER_IPX_DST_IPXNET, FILTER_IPX_DST_IPXNODE, FILTER_IPX_DST_IPXSOCK, FILTER_IPX_SRC_IPXNET, FILTER_IPX_SRC_IPXNODE, FILTER_IPX_SRC_IPXSOCK } FilterTokens; static const FR_NAME_NUMBER filterKeywords[] = { { "ip", FILTER_IP_TYPE }, { "generic", FILTER_GENERIC_TYPE }, { "in", FILTER_IN }, { "out", FILTER_OUT }, { "forward", FILTER_FORWARD }, { "drop", FILTER_DROP }, { "dstip", FILTER_IP_DST }, { "srcip", FILTER_IP_SRC }, { "dstport", FILTER_IP_DST_PORT }, { "srcport", FILTER_IP_SRC_PORT }, { "est", FILTER_EST }, { "more", FILTER_MORE }, { "!=", FILTER_GENERIC_COMPNEQ }, { "==", FILTER_GENERIC_COMPEQ }, { "ipx", FILTER_IPX_TYPE }, { "dstipxnet", FILTER_IPX_DST_IPXNET }, { "dstipxnode", FILTER_IPX_DST_IPXNODE }, { "dstipxsock", FILTER_IPX_DST_IPXSOCK }, { "srcipxnet", FILTER_IPX_SRC_IPXNET }, { "srcipxnode", FILTER_IPX_SRC_IPXNODE }, { "srcipxsock", FILTER_IPX_SRC_IPXSOCK }, { NULL , -1}, }; /* * FilterProtoName: * * Ascii name of protocols used for filtering. * * ??? What the heck is wrong with getprotobyname? */ static const FR_NAME_NUMBER filterProtoName[] = { { "tcp", 6 }, { "udp", 17 }, { "ospf", 89 }, { "icmp", 1 }, { "0", 0 }, { NULL , -1 }, }; /* * RadFilterComparison: * * An enumerated values for the IP filter port comparisons. */ typedef enum { RAD_NO_COMPARE = 0, RAD_COMPARE_LESS, RAD_COMPARE_EQUAL, RAD_COMPARE_GREATER, RAD_COMPARE_NOT_EQUAL } RadFilterComparison; static const FR_NAME_NUMBER filterCompare[] = { { "<", RAD_COMPARE_LESS }, { "=", RAD_COMPARE_EQUAL }, { ">", RAD_COMPARE_GREATER }, { "!=", RAD_COMPARE_NOT_EQUAL }, { NULL, 0 }, }; /* * String split routine. Splits an input string IN PLACE * into pieces, based on spaces. */ static int str2argv(char *str, char **argv, int max_argc) { int argc = 0; while (*str) { if (argc >= max_argc) return argc; while (*str == ' ') *(str++) = '\0'; if (!*str) return argc; argv[argc] = str; argc++; while (*str && (*str != ' ')) str++; } return argc; } /* * ascend_parse_ipx_net * * srcipxnet nnnn srcipxnode mmmmm [srcipxsoc cmd value ] */ static int ascend_parse_ipx_net(int argc, char **argv, ascend_ipx_net_t *net, uint8_t *comp) { int token; const char *p; if (argc < 3) return -1; /* * Parse the net, which is a hex number. */ net->net = htonl(strtol(argv[0], NULL, 16)); /* * Parse the node. */ token = fr_str2int(filterKeywords, argv[1], -1); switch (token) { case FILTER_IPX_SRC_IPXNODE: case FILTER_IPX_DST_IPXNODE: break; default: return -1; } /* * Can have a leading "0x" or "0X" */ p = argv[2]; if ((memcmp(p, "0X", 2) == 0) || (memcmp(p, "0x", 2) == 0)) p += 2; /* * Node must be 6 octets long. */ token = fr_hex2bin(p, net->node, IPX_NODE_ADDR_LEN); if (token != IPX_NODE_ADDR_LEN) return -1; /* * Nothing more, die. */ if (argc == 3) return 3; /* * Can't be too little or too much. */ if (argc != 6) return -1; /* * Parse the socket. */ token = fr_str2int(filterKeywords, argv[3], -1); switch (token) { case FILTER_IPX_SRC_IPXSOCK: case FILTER_IPX_DST_IPXSOCK: break; default: return -1; } /* * Parse the command "<", ">", "=" or "!=" */ token = fr_str2int(filterCompare, argv[4], -1); switch (token) { case RAD_COMPARE_LESS: case RAD_COMPARE_EQUAL: case RAD_COMPARE_GREATER: case RAD_COMPARE_NOT_EQUAL: *comp = token; break; default: return -1; } /* * Parse the value. */ token = strtoul(argv[5], NULL, 16); if (token > 65535) return -1; net->socket = token; net->socket = htons(net->socket); /* * Everything's OK, we parsed 6 entries. */ return 6; } /* * ascend_parse_ipx_filter * * This routine parses an IPX filter string from a string. * The format of the string is: * * [ srcipxnet nnnn srcipxnode mmmmm [srcipxsoc cmd value ]] * [ dstipxnet nnnn dstipxnode mmmmm [dstipxsoc cmd value ]] * * Fields in [...] are optional. * where: * * srcipxnet: Keyword for source IPX address. * nnnn = IPX Node address. * * srcipxnode: Keyword for source IPX Node address. * mmmmm = IPX Node Address, could be FFFFFF. * A vlid ipx node number should accompany ipx net number. * * srcipxsoc: Keyword for source IPX socket address. * * cmd: One of ">" or "<" or "=" or "!=". * * value: Socket value to be compared against, in hex. * * dstipxnet: Keyword for destination IPX address. * nnnn = IPX Node address. * * dstipxnode: Keyword for destination IPX Node address. * mmmmm = IPX Node Address, could be FFFFFF. * A valid ipx node number should accompany ipx net number. * * dstipxsoc: Keyword for destination IPX socket address. * * cmd: One of ">" or "<" or "=" or "!=". * * value: Socket value to be compared against, in hex. */ static int ascend_parse_ipx(int argc, char **argv, ascend_ipx_filter_t *filter) { int rcode; int token; int flags = 0; /* * We may have nothing, in which case we simply return. */ if (argc == 0) return 0; /* * Must have "net N node M" */ if (argc < 4) return -1; while ((argc > 0) && (flags != 0x03)) { token = fr_str2int(filterKeywords, argv[0], -1); switch (token) { case FILTER_IPX_SRC_IPXNET: if (flags & 0x01) return -1; rcode = ascend_parse_ipx_net(argc - 1, argv + 1, &(filter->src), &(filter->srcSocComp)); if (rcode < 0) return -1; argc -= (rcode + 1); argv += rcode + 1; flags |= 0x01; break; case FILTER_IPX_DST_IPXNET: if (flags & 0x02) return -1; rcode = ascend_parse_ipx_net(argc - 1, argv + 1, &(filter->dst), &(filter->dstSocComp)); if (rcode < 0) return -1; argc -= (rcode + 1); argv += rcode + 1; flags |= 0x02; break; default: fr_strerror_printf("Unknown string \"%s\" in IPX data filter", argv[0]); return -1; } } /* * Arguments left over: die. */ if (argc != 0) return -1; /* * Everything's OK. */ return 0; } /* * Parse an IP address and optionally a netmask, to a uint32_t. * * ipaddr should already be initialized to zero. * ipaddr is in network byte order. * * Returns -1 on error, or the number of bits in the netmask, otherwise. */ static int ascend_parse_ipaddr(uint32_t *ipaddr, char *str) { int count = 0; int ip[4]; int masklen; uint32_t netmask = 0; /* * Look for IP's. */ count = 0; while (*str && (count < 4) && (netmask == 0)) { next: ip[count] = 0; while (*str) { switch (*str) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': ip[count] *= 10; ip[count] += (*str) - '0'; str++; break; case '.': /* dot between IP numbers. */ str++; if (ip[count] > 255) return -1; /* * 24, 16, 8, 0, done. */ *ipaddr |= (ip[count] << (8 * (3 - count))); count++; goto next; case '/': /* netmask */ str++; masklen = atoi(str); if ((masklen < 0) || (masklen > 32)) return -1; str += strspn(str, "0123456789"); netmask = masklen; goto finalize; break; default: fr_strerror_printf("Invalid character in IP address"); return -1; } } /* loop over one character */ } /* loop until the count hits 4 */ if (count == 3) { finalize: /* * Do the last one, too. */ if (ip[count] > 255) return -1; /* * 24, 16, 8, 0, done. */ *ipaddr |= (ip[count] << (8 * (3 - count))); } /* * We've hit the end of the IP address, and there's something * else left over: die. */ if (*str) return -1; /* * Set the default netmask. */ if (!netmask) { if (!*ipaddr) { netmask = 0; } else if ((*ipaddr & 0x80000000) == 0) { netmask = 8; } else if ((*ipaddr & 0xc0000000) == 0x80000000) { netmask = 16; } else if ((*ipaddr & 0xe0000000) == 0xc0000000) { netmask = 24; } else { netmask = 32; } } *ipaddr = htonl(*ipaddr); return netmask; } /* * ascend_parse_port: Parse a comparator and port. * * Returns -1 on error, or the comparator. */ static int ascend_parse_port(uint16_t *port, char *compare, char *str) { int rcode, token = -1; /* * There MUST be a comparison string. */ rcode = fr_str2int(filterCompare, compare, -1); if (rcode < 0) return rcode; if (strspn(str, "0123456789") == strlen(str)) { token = atoi(str); } else { token = fr_str2int(filterPortType, str, -1); } if ((token < 0) || (token > 65535)) return -1; *port = token; *port = htons(*port); return rcode; } #define IP_SRC_ADDR_FLAG (1 << 0) #define IP_DEST_ADDR_FLAG (1 << 1) #define IP_SRC_PORT_FLAG (1 << 2) #define IP_DEST_PORT_FLAG (1 << 3) #define IP_PROTO_FLAG (1 << 4) #define IP_EST_FLAG (1 << 5) #define DONE_FLAGS (IP_SRC_ADDR_FLAG | IP_DEST_ADDR_FLAG | \ IP_SRC_PORT_FLAG | IP_DEST_PORT_FLAG | \ IP_PROTO_FLAG | IP_EST_FLAG) /* * ascend_parse_ip: * * This routine parses an IP filter string from a RADIUS * reply. The format of the string is: * * ip dir action [ dstip n.n.n.n/nn ] [ srcip n.n.n.n/nn ] * [ proto [ dstport cmp value ] [ srcport cmd value ] [ est ] ] * * Fields in [...] are optional. * * dstip: Keyword for destination IP address. * n.n.n.n = IP address. /nn - netmask. * * srcip: Keyword for source IP address. * n.n.n.n = IP address. /nn - netmask. * * proto: Optional protocol field. Either a name or * number. Known names are in FilterProtoName[]. * * dstport: Keyword for destination port. Only valid with tcp * or udp. 'cmp' are in FilterPortType[]. 'value' can be * a name or number. * * srcport: Keyword for source port. Only valid with tcp * or udp. 'cmp' are in FilterPortType[]. 'value' can be * a name or number. * * est: Keyword for TCP established. Valid only for tcp. * */ static int ascend_parse_ip(int argc, char **argv, ascend_ip_filter_t *filter) { int rcode; int token; int flags; /* * We may have nothing, in which case we simply return. */ if (argc == 0) return 0; /* * There may, or may not, be src & dst IP's in the string. */ flags = 0; while ((argc > 0) && (flags != DONE_FLAGS)) { token = fr_str2int(filterKeywords, argv[0], -1); switch (token) { case FILTER_IP_SRC: if (flags & IP_SRC_ADDR_FLAG) return -1; if (argc < 2) return -1; rcode = ascend_parse_ipaddr(&filter->srcip, argv[1]); if (rcode < 0) return rcode; filter->srcmask = rcode; flags |= IP_SRC_ADDR_FLAG; argv += 2; argc -= 2; break; case FILTER_IP_DST: if (flags & IP_DEST_ADDR_FLAG) return -1; if (argc < 2) return -1; rcode = ascend_parse_ipaddr(&filter->dstip, argv[1]); if (rcode < 0) return rcode; filter->dstmask = rcode; flags |= IP_DEST_ADDR_FLAG; argv += 2; argc -= 2; break; case FILTER_IP_SRC_PORT: if (flags & IP_SRC_PORT_FLAG) return -1; if (argc < 3) return -1; rcode = ascend_parse_port(&filter->srcport, argv[1], argv[2]); if (rcode < 0) return rcode; filter->srcPortComp = rcode; flags |= IP_SRC_PORT_FLAG; argv += 3; argc -= 3; break; case FILTER_IP_DST_PORT: if (flags & IP_DEST_PORT_FLAG) return -1; if (argc < 3) return -1; rcode = ascend_parse_port(&filter->dstport, argv[1], argv[2]); if (rcode < 0) return rcode; filter->dstPortComp = rcode; flags |= IP_DEST_PORT_FLAG; argv += 3; argc -= 3; break; case FILTER_EST: if (flags & IP_EST_FLAG) return -1; filter->established = 1; argv++; argc--; flags |= IP_EST_FLAG; break; default: if (flags & IP_PROTO_FLAG) return -1; if (strspn(argv[0], "0123456789") == strlen(argv[0])) { token = atoi(argv[0]); } else { token = fr_str2int(filterProtoName, argv[0], -1); if (token == -1) { fr_strerror_printf("Unknown IP protocol \"%s\" in IP data filter", argv[0]); return -1; } } filter->proto = token; flags |= IP_PROTO_FLAG; argv++; argc--; break; } } /* * We should have parsed everything by now. */ if (argc != 0) { fr_strerror_printf("Unknown extra string \"%s\" in IP data filter", argv[0]); return -1; } return 0; } /* * ascend_parse_generic * * This routine parses a Generic filter string from a RADIUS * reply. The format of the string is: * * generic dir action offset mask value [== or != ] [more] * * Fields in [...] are optional. * * offset: A Number. Specifies an offset into a frame * to start comparing. * * mask: A hexadecimal mask of bits to compare. * * value: A value to compare with the masked data. * * compNeq: Defines type of comparison. ( "==" or "!=") * Default is "==". * * more: Optional keyword MORE, to represent the attachment * to the next entry. */ static int ascend_parse_generic(int argc, char **argv, ascend_generic_filter_t *filter) { int rcode; int token; int flags; /* * We may have nothing, in which case we simply return. */ if (argc == 0) return 0; /* * We need at least "offset mask value" */ if (argc < 3) return -1; /* * No more than optional comparison and "more" */ if (argc > 5) return -1; /* * Offset is a uint16_t number. */ if (strspn(argv[0], "0123456789") != strlen(argv[0])) return -1; rcode = atoi(argv[0]); if (rcode > 65535) return -1; filter->offset = rcode; filter->offset = htons(filter->offset); rcode = fr_hex2bin(argv[1], filter->mask, sizeof(filter->mask)); if (rcode != sizeof(filter->mask)) return -1; token = fr_hex2bin(argv[2], filter->value, sizeof(filter->value)); if (token != sizeof(filter->value)) return -1; /* * The mask and value MUST be the same length. */ if (rcode != token) return -1; filter->len = rcode; filter->len = htons(filter->len); /* * Nothing more. Exit. */ if (argc == 3) return 0; argc -= 3; argv += 3; flags = 0; while (argc >= 1) { token = fr_str2int(filterKeywords, argv[0], -1); switch (token) { case FILTER_GENERIC_COMPNEQ: if (flags & 0x01) return -1; filter->compNeq = TRUE; flags |= 0x01; break; case FILTER_GENERIC_COMPEQ: if (flags & 0x01) return -1; filter->compNeq = FALSE; flags |= 0x01; break; case FILTER_MORE: if (flags & 0x02) return -1; filter->more = htons( 1 ); flags |= 0x02; break; default: fr_strerror_printf("Invalid string \"%s\" in generic data filter", argv[0]); return -1; } argc--; argv++; } return 0; } /* * filterBinary: * * This routine will call routines to parse entries from an ASCII format * to a binary format recognized by the Ascend boxes. * * pair: Pointer to value_pair to place return. * * valstr: The string to parse * * return: -1 for error or 0. */ int ascend_parse_filter(VALUE_PAIR *pair) { int token, type; int rcode; int argc; char *argv[32]; ascend_filter_t filter; rcode = -1; /* * Rather than printing specific error messages, we create * a general one here, which won't be used if the function * returns OK. */ fr_strerror_printf("Text is not in proper format"); /* * Tokenize the input string in the VP. * * Once the filter is *completelty* parsed, then we will * over-write it with the final binary filter. */ argc = str2argv(pair->vp_strvalue, argv, 32); if (argc < 3) return -1; /* * Decide which filter type it is: ip, ipx, or generic */ type = fr_str2int(filterType, argv[0], -1); memset(&filter, 0, sizeof(filter)); /* * Validate the filter type. */ switch (type) { case RAD_FILTER_GENERIC: case RAD_FILTER_IP: case RAD_FILTER_IPX: filter.type = type; break; default: fr_strerror_printf("Unknown Ascend filter type \"%s\"", argv[0]); return -1; break; } /* * Parse direction */ token = fr_str2int(filterKeywords, argv[1], -1); switch (token) { case FILTER_IN: filter.direction = 1; break; case FILTER_OUT: filter.direction = 0; break; default: fr_strerror_printf("Unknown Ascend filter direction \"%s\"", argv[1]); return -1; break; } /* * Parse action */ token = fr_str2int(filterKeywords, argv[2], -1); switch (token) { case FILTER_FORWARD: filter.forward = 1; break; case FILTER_DROP: filter.forward = 0; break; default: fr_strerror_printf("Unknown Ascend filter action \"%s\"", argv[2]); return -1; break; } switch (type) { case RAD_FILTER_GENERIC: rcode = ascend_parse_generic(argc - 3, &argv[3], &filter.u.generic); break; case RAD_FILTER_IP: rcode = ascend_parse_ip(argc - 3, &argv[3], &filter.u.ip); break; case RAD_FILTER_IPX: rcode = ascend_parse_ipx(argc - 3, &argv[3], &filter.u.ipx); break; default: /* should never reach here. */ break; } /* * Touch the VP only if everything was OK. */ if (rcode == 0) { pair->length = sizeof(filter); memcpy(pair->vp_filter, &filter, sizeof(filter)); } return rcode; #if 0 /* * if 'more' is set then this new entry must exist, be a * FILTER_GENERIC_TYPE, direction and disposition must match for * the previous 'more' to be valid. If any should fail then TURN OFF * previous 'more' */ if( prevRadPair ) { filt = ( RadFilter * )prevRadPair->vp_strvalue; if(( tok != FILTER_GENERIC_TYPE ) || (rc == -1 ) || ( prevRadPair->attribute != pair->attribute ) || ( filt->indirection != radFil.indirection ) || ( filt->forward != radFil.forward ) ) { gen = &filt->u.generic; gen->more = FALSE; fr_strerror_printf("filterBinary: 'more' for previous entry doesn't match: %s.\n", valstr); } } prevRadPair = NULL; if( rc != -1 && tok == FILTER_GENERIC_TYPE ) { if( radFil.u.generic.more ) { prevRadPair = pair; } } if( rc != -1 ) { memcpy( pair->vp_strvalue, &radFil, pair->length ); } return(rc); #endif } /* * Print an Ascend binary filter attribute to a string, * Grrr... Ascend makes the server do this work, instead * of doing it on the NAS. * * Note we don't bother checking 'len' after the snprintf's. * This function should ONLY be called with a large (~1k) buffer. */ void print_abinary(const VALUE_PAIR *vp, char *buffer, size_t len, int delimitst) { size_t i; char *p; ascend_filter_t *filter; static const char *action[] = {"drop", "forward"}; static const char *direction[] = {"out", "in"}; p = buffer; /* * Just for paranoia: wrong size filters get printed as octets */ if (vp->length != sizeof(*filter)) { strcpy(p, "0x"); p += 2; len -= 2; for (i = 0; i < vp->length; i++) { snprintf(p, len, "%02x", vp->vp_octets[i]); p += 2; len -= 2; } return; } if (delimitst) { *(p++) = '"'; len -= 3; /* account for leading & trailing quotes */ } filter = (ascend_filter_t *) &(vp->vp_filter); i = snprintf(p, len, "%s %s %s", fr_int2str(filterType, filter->type, "??"), direction[filter->direction & 0x01], action[filter->forward & 0x01]); p += i; len -= i; /* * Handle IP filters */ if (filter->type == RAD_FILTER_IP) { if (filter->u.ip.srcip) { i = snprintf(p, len, " srcip %d.%d.%d.%d/%d", ((uint8_t *) &filter->u.ip.srcip)[0], ((uint8_t *) &filter->u.ip.srcip)[1], ((uint8_t *) &filter->u.ip.srcip)[2], ((uint8_t *) &filter->u.ip.srcip)[3], filter->u.ip.srcmask); p += i; len -= i; } if (filter->u.ip.dstip) { i = snprintf(p, len, " dstip %d.%d.%d.%d/%d", ((uint8_t *) &filter->u.ip.dstip)[0], ((uint8_t *) &filter->u.ip.dstip)[1], ((uint8_t *) &filter->u.ip.dstip)[2], ((uint8_t *) &filter->u.ip.dstip)[3], filter->u.ip.dstmask); p += i; len -= i; } i = snprintf(p, len, " %s", fr_int2str(filterProtoName, filter->u.ip.proto, "??")); p += i; len -= i; if (filter->u.ip.srcPortComp > RAD_NO_COMPARE) { i = snprintf(p, len, " srcport %s %d", fr_int2str(filterCompare, filter->u.ip.srcPortComp, "??"), ntohs(filter->u.ip.srcport)); p += i; len -= i; } if (filter->u.ip.dstPortComp > RAD_NO_COMPARE) { i = snprintf(p, len, " dstport %s %d", fr_int2str(filterCompare, filter->u.ip.dstPortComp, "??"), ntohs(filter->u.ip.dstport)); p += i; len -= i; } if (filter->u.ip.established) { i = snprintf(p, len, " est"); p += i; len -= i; } /* * Handle IPX filters */ } else if (filter->type == RAD_FILTER_IPX) { /* print for source */ if (filter->u.ipx.src.net) { i = snprintf(p, len, " srcipxnet 0x%04x srcipxnode 0x%02x%02x%02x%02x%02x%02x", (unsigned int)ntohl(filter->u.ipx.src.net), filter->u.ipx.src.node[0], filter->u.ipx.src.node[1], filter->u.ipx.src.node[2], filter->u.ipx.src.node[3], filter->u.ipx.src.node[4], filter->u.ipx.src.node[5]); p += i; len -= i; if (filter->u.ipx.srcSocComp > RAD_NO_COMPARE) { i = snprintf(p, len, " srcipxsock %s 0x%04x", fr_int2str(filterCompare, filter->u.ipx.srcSocComp, "??"), ntohs(filter->u.ipx.src.socket)); p += i; len -= i; } } /* same for destination */ if (filter->u.ipx.dst.net) { i = snprintf(p, len, " dstipxnet 0x%04x dstipxnode 0x%02x%02x%02x%02x%02x%02x", (unsigned int)ntohl(filter->u.ipx.dst.net), filter->u.ipx.dst.node[0], filter->u.ipx.dst.node[1], filter->u.ipx.dst.node[2], filter->u.ipx.dst.node[3], filter->u.ipx.dst.node[4], filter->u.ipx.dst.node[5]); p += i; len -= i; if (filter->u.ipx.dstSocComp > RAD_NO_COMPARE) { i = snprintf(p, len, " dstipxsock %s 0x%04x", fr_int2str(filterCompare, filter->u.ipx.dstSocComp, "??"), ntohs(filter->u.ipx.dst.socket)); p += i; len -= i; } } } else if (filter->type == RAD_FILTER_GENERIC) { int count; i = snprintf(p, len, " %u ", (unsigned int) ntohs(filter->u.generic.offset)); p += i; i -= len; /* show the mask */ for (count = 0; count < ntohs(filter->u.generic.len); count++) { i = snprintf(p, len, "%02x", filter->u.generic.mask[count]); p += i; len -= i; } strcpy(p, " "); p++; len--; /* show the value */ for (count = 0; count < ntohs(filter->u.generic.len); count++) { i = snprintf(p, len, "%02x", filter->u.generic.value[count]); p += i; len -= i; } i = snprintf(p, len, " %s", (filter->u.generic.compNeq) ? "!=" : "=="); p += i; len -= i; if (filter->u.generic.more != 0) { i = snprintf(p, len, " more"); p += i; len -= i; } } if (delimitst) *(p++) = '"'; *p = '\0'; } #endif freeradius-server/src/lib/getaddrinfo.c000066400000000000000000000312201257552170400205100ustar00rootroot00000000000000/* * These functions are defined and used only if the configure * cannot detect the standard getaddrinfo(), freeaddrinfo(), * gai_strerror() and getnameinfo(). This avoids sprinkling of ifdefs. * * FIXME: getaddrinfo() & getnameinfo() should * return all IPv4 addresses provided by DNS lookup. */ #include RCSID("$Id$") #include #include #include #ifndef HAVE_GETNAMEINFO #undef LOCAL_GETHOSTBYNAMERSTYLE #ifndef GETHOSTBYNAMERSTYLE #define LOCAL_GETHOSTBYNAMERSTYLE 1 #elif (GETHOSTBYNAMERSTYLE != SYSVSTYLE) && (GETHOSTBYNAMERSTYLE != GNUSTYLE) #define LOCAL_GETHOSTBYNAMERSTYLE 1 #endif /* GETHOSTBYNAMERSTYLE */ #endif #ifndef HAVE_GETADDRINFO #undef LOCAL_GETHOSTBYADDRR #ifndef GETHOSTBYADDRRSTYLE #define LOCAL_GETHOSTBYADDRR 1 #elif (GETHOSTBYADDRRSTYLE != SYSVSTYLE) && (GETHOSTBYADDRRSTYLE != GNUSTYLE) #define LOCAL_GETHOSTBYADDRR 1 #endif /* GETHOSTBYADDRRSTYLE */ #endif #ifdef HAVE_PTHREAD_H #include /* Thread safe DNS lookups */ /* * FIXME: There are some systems that use the same hostent * structure to return for gethostbyname() & gethostbyaddr(), if * that is the case then use only one mutex instead of separate * mutexes */ #ifdef LOCAL_GETHOSTBYNAMERSTYLE static int fr_hostbyname = 0; static pthread_mutex_t fr_hostbyname_mutex; #endif #ifdef LOCAL_GETHOSTBYNAMERSTYLE static int fr_hostbyaddr = 0; static pthread_mutex_t fr_hostbyaddr_mutex; #endif #endif /* * gethostbyaddr() & gethostbyname() return hostent structure * To make these functions thread safe, we need to * copy the data and not pointers * * struct hostent { * char *h_name; * official name of host * * char **h_aliases; * alias list * * int h_addrtype; * host address type * * int h_length; * length of address * * char **h_addr_list; * list of addresses * * } * This struct contains 3 pointers as members. * The data from these pointers is copied into a buffer. * The buffer is formatted as below to store the data * --------------------------------------------------------------- * | h_name\0alias_array\0h_aliases\0..\0addr_array\0h_addr_list\0 | * --------------------------------------------------------------- */ #if defined(LOCAL_GETHOSTBYNAMER) || defined(LOCAL_GETHOSTBYADDRR) #define BUFFER_OVERFLOW 255 static int copy_hostent(struct hostent *from, struct hostent *to, char *buffer, int buflen, int *error) { int i, len; char *ptr = buffer; *error = 0; to->h_addrtype = from->h_addrtype; to->h_length = from->h_length; to->h_name = (char *)ptr; /* copy hostname to buffer */ len=strlen(from->h_name)+1; strcpy(ptr, from->h_name); ptr += len; /* copy aliases to buffer */ to->h_aliases = (char**)ptr; for(i = 0; from->h_aliases[i]; i++); ptr += (i+1) * sizeof(char *); for(i = 0; from->h_aliases[i]; i++) { len = strlen(from->h_aliases[i])+1; if ((ptr-buffer)+len < buflen) { to->h_aliases[i] = ptr; strcpy(ptr, from->h_aliases[i]); ptr += len; } else { *error = BUFFER_OVERFLOW; return *error; } } to->h_aliases[i] = NULL; /* copy addr_list to buffer */ to->h_addr_list = (char**)ptr; for(i = 0; (int *)from->h_addr_list[i] != 0; i++); ptr += (i+1) * sizeof(int *); for(i = 0; (int *)from->h_addr_list[i] != 0; i++) { len = sizeof(int); if ((ptr-buffer)+len < buflen) { to->h_addr_list[i] = ptr; memcpy(ptr, from->h_addr_list[i], len); ptr += len; } else { *error = BUFFER_OVERFLOW; return *error; } } to->h_addr_list[i] = 0; return *error; } #endif /* (LOCAL_GETHOSTBYNAMER == 1) || (LOCAL_GETHOSTBYADDRR == 1) */ #ifdef LOCAL_GETHOSTBYNAMERSTYLE static struct hostent * gethostbyname_r(const char *hostname, struct hostent *result, char *buffer, int buflen, int *error) { struct hostent *hp; #ifdef HAVE_PTHREAD_H if (fr_hostbyname == 0) { pthread_mutex_init(&fr_hostbyname_mutex, NULL); fr_hostbyname = 1; } pthread_mutex_lock(&fr_hostbyname_mutex); #endif hp = gethostbyname(hostname); if ((!hp) || (hp->h_addrtype != AF_INET) || (hp->h_length != 4)) { *error = h_errno; hp = NULL; } else { copy_hostent(hp, result, buffer, buflen, error); hp = result; } #ifdef HAVE_PTHREAD_H pthread_mutex_unlock(&fr_hostbyname_mutex); #endif return hp; } #endif /* GETHOSTBYNAMERSTYLE */ #ifdef LOCAL_GETHOSTBYADDRR static struct hostent * gethostbyaddr_r(const char *addr, int len, int type, struct hostent *result, char *buffer, int buflen, int *error) { struct hostent *hp; #ifdef HAVE_PTHREAD_H if (fr_hostbyaddr == 0) { pthread_mutex_init(&fr_hostbyaddr_mutex, NULL); fr_hostbyaddr = 1; } pthread_mutex_lock(&fr_hostbyaddr_mutex); #endif hp = gethostbyaddr(addr, len, type); if ((!hp) || (hp->h_addrtype != AF_INET) || (hp->h_length != 4)) { *error = h_errno; hp = NULL; } else { copy_hostent(hp, result, buffer, buflen, error); hp = result; } #ifdef HAVE_PTHREAD_H pthread_mutex_unlock(&fr_hostbyaddr_mutex); #endif return hp; } #endif /* GETHOSTBYADDRRSTYLE */ /* * Mar 8, 2000 by Hajimu UMEMOTO * * Below code is based on ssh-1.2.27-IPv6-1.5 written by * KIKUCHI Takahiro */ #ifndef HAVE_GETADDRINFO static struct addrinfo * malloc_ai(int port, u_long addr, int socktype, int proto) { struct addrinfo *ai; ai = (struct addrinfo *)malloc(sizeof(struct addrinfo) + sizeof(struct sockaddr_in)); if (ai) { memset(ai, 0, sizeof(struct addrinfo) + sizeof(struct sockaddr_in)); ai->ai_addr = (struct sockaddr *)(ai + 1); ai->ai_addrlen = sizeof(struct sockaddr_in); #ifdef HAVE_SOCKADDR_SA_LEN ai->ai_addr->sa_len = sizeof(struct sockaddr_in); #endif ai->ai_addr->sa_family = ai->ai_family = AF_INET; ((struct sockaddr_in *)(ai)->ai_addr)->sin_port = port; ((struct sockaddr_in *)(ai)->ai_addr)->sin_addr.s_addr = addr; ai->ai_socktype = socktype; ai->ai_protocol = proto; return ai; } else { return NULL; } } const char * gai_strerror(int ecode) { switch (ecode) { case EAI_MEMORY: return "memory allocation failure."; case EAI_FAMILY: return "ai_family not supported."; case EAI_NONAME: return "hostname nor servname provided, or not known."; case EAI_SERVICE: return "servname not supported for ai_socktype."; default: return "unknown error."; } } void freeaddrinfo(struct addrinfo *ai) { struct addrinfo *next; if (ai->ai_canonname) free(ai->ai_canonname); do { next = ai->ai_next; free(ai); } while ((ai = next) != NULL); } int getaddrinfo(const char *hostname, const char *servname, const struct addrinfo *hints, struct addrinfo **res) { struct addrinfo *cur, *prev = NULL; struct hostent *hp; struct hostent result; struct in_addr in; int i, port = 0, socktype, proto; int error; char buffer[2048]; if (hints && hints->ai_family != PF_INET && hints->ai_family != PF_UNSPEC) return EAI_FAMILY; socktype = (hints && hints->ai_socktype) ? hints->ai_socktype : SOCK_STREAM; if (hints && hints->ai_protocol) proto = hints->ai_protocol; else { switch (socktype) { case SOCK_DGRAM: proto = IPPROTO_UDP; break; case SOCK_STREAM: proto = IPPROTO_TCP; break; default: proto = 0; break; } } if (servname) { if (isdigit((int)*servname)) port = htons(atoi(servname)); else { struct servent *se; const char *pe_proto; switch (socktype) { case SOCK_DGRAM: pe_proto = "udp"; break; case SOCK_STREAM: pe_proto = "tcp"; break; default: pe_proto = NULL; break; } if ((se = getservbyname(servname, pe_proto)) == NULL) return EAI_SERVICE; port = se->s_port; } } if (!hostname) { if (hints && hints->ai_flags & AI_PASSIVE) *res = malloc_ai(port, htonl(0x00000000), socktype, proto); else *res = malloc_ai(port, htonl(0x7f000001), socktype, proto); if (*res) return 0; else return EAI_MEMORY; } /* Numeric IP Address */ if (inet_aton(hostname, &in)) { *res = malloc_ai(port, in.s_addr, socktype, proto); if (*res) return 0; else return EAI_MEMORY; } if (hints && hints->ai_flags & AI_NUMERICHOST) return EAI_NONAME; /* DNS Lookup */ #ifdef GETHOSTBYNAMERSTYLE #if GETHOSTBYNAMERSTYLE == SYSVSTYLE hp = gethostbyname_r(hostname, &result, buffer, sizeof(buffer), &error); #elif GETHOSTBYNAMERSTYLE == GNUSTYLE if (gethostbyname_r(hostname, &result, buffer, sizeof(buffer), &hp, &error) != 0) { hp = NULL; } #else hp = gethostbyname_r(hostname, &result, buffer, sizeof(buffer), &error); #endif #else hp = gethostbyname_r(hostname, &result, buffer, sizeof(buffer), &error); #endif if (hp && hp->h_name && hp->h_name[0] && hp->h_addr_list[0]) { for (i = 0; hp->h_addr_list[i]; i++) { if ((cur = malloc_ai(port, ((struct in_addr *)hp->h_addr_list[i])->s_addr, socktype, proto)) == NULL) { if (*res) freeaddrinfo(*res); return EAI_MEMORY; } if (prev) prev->ai_next = cur; else *res = cur; prev = cur; } if (hints && hints->ai_flags & AI_CANONNAME && *res) { if (((*res)->ai_canonname = strdup(hp->h_name)) == NULL) { freeaddrinfo(*res); return EAI_MEMORY; } } return 0; } return EAI_NONAME; } #endif /* HAVE_GETADDRINFO */ #ifndef HAVE_GETNAMEINFO int getnameinfo(const struct sockaddr *sa, socklen_t salen, char *host, size_t hostlen, char *serv, size_t servlen, unsigned int flags) { const struct sockaddr_in *sin = (const struct sockaddr_in *)sa; struct hostent *hp; struct hostent result; char tmpserv[16]; char buffer[2048]; int error; if (serv) { snprintf(tmpserv, sizeof(tmpserv), "%d", ntohs(sin->sin_port)); if (strlen(tmpserv) > servlen) return EAI_MEMORY; else strcpy(serv, tmpserv); } if (host) { if (flags & NI_NUMERICHOST) { /* No Reverse DNS lookup */ if (flags & NI_NAMEREQD) return EAI_NONAME; if (strlen(inet_ntoa(sin->sin_addr)) >= hostlen) return EAI_MEMORY; else { strcpy(host, inet_ntoa(sin->sin_addr)); return 0; } } else { /* Reverse DNS lookup required */ #ifdef GETHOSTBYADDRRSTYLE #if GETHOSTBYADDRRSTYLE == SYSVSTYLE hp = gethostbyaddr_r((const char *)&sin->sin_addr, salen, AF_INET, &result, buffer, sizeof(buffer), &error); #elif GETHOSTBYADDRRSTYLE == GNUSTYLE if (gethostbyaddr_r((const char *)&sin->sin_addr, salen, AF_INET, &result, buffer, sizeof(buffer), &hp, &error) != 0) { hp = NULL; } #else hp = gethostbyaddr_r((const char *)&sin->sin_addr, salen, AF_INET, &result, buffer, sizeof(buffer), &error); #endif #else hp = gethostbyaddr_r((const char *)&sin->sin_addr, salen, AF_INET, &result, buffer, sizeof(buffer), &error); #endif if (hp) if (strlen(hp->h_name) >= hostlen) return EAI_MEMORY; else { strcpy(host, hp->h_name); return 0; } else if (flags & NI_NAMEREQD) return EAI_NONAME; else if (strlen(inet_ntoa(sin->sin_addr)) >= hostlen) return EAI_MEMORY; else { strcpy(host, inet_ntoa(sin->sin_addr)); return 0; } } } return 0; } #endif /* HAVE_GETNAMEINFO */ freeradius-server/src/lib/hash.c000066400000000000000000000440731257552170400171570ustar00rootroot00000000000000/* * hash.c Non-thread-safe split-ordered hash table. * * The weird "reverse" function is based on an idea from * "Split-Ordered Lists - Lock-free Resizable Hash Tables", with * modifications so that they're not lock-free. :( * * However, the split-order idea allows a fast & easy splitting of the * hash bucket chain when the hash table is resized. Without it, we'd * have to check & update the pointers for every node in the buck chain, * rather than being able to move 1/2 of the entries in the chain with * one update. * * Version: $Id$ * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2005,2006 The FreeRADIUS server project */ #include RCSID("$Id$") #include #include /* * A reasonable number of buckets to start off with. * Should be a power of two. */ #define FR_HASH_NUM_BUCKETS (64) typedef struct fr_hash_entry_t { struct fr_hash_entry_t *next; uint32_t reversed; uint32_t key; void *data; } fr_hash_entry_t; struct fr_hash_table_t { int num_elements; int num_buckets; /* power of 2 */ int next_grow; int mask; fr_hash_table_free_t free; fr_hash_table_hash_t hash; fr_hash_table_cmp_t cmp; fr_hash_entry_t null; fr_hash_entry_t **buckets; }; #ifdef TESTING #include static int grow = 0; #endif /* * perl -e 'foreach $i (0..255) {$r = 0; foreach $j (0 .. 7 ) { if (($i & ( 1<< $j)) != 0) { $r |= (1 << (7 - $j));}} print $r, ", ";if (($i & 7) == 7) {print "\n";}}' */ static const uint8_t reversed_byte[256] = { 0, 128, 64, 192, 32, 160, 96, 224, 16, 144, 80, 208, 48, 176, 112, 240, 8, 136, 72, 200, 40, 168, 104, 232, 24, 152, 88, 216, 56, 184, 120, 248, 4, 132, 68, 196, 36, 164, 100, 228, 20, 148, 84, 212, 52, 180, 116, 244, 12, 140, 76, 204, 44, 172, 108, 236, 28, 156, 92, 220, 60, 188, 124, 252, 2, 130, 66, 194, 34, 162, 98, 226, 18, 146, 82, 210, 50, 178, 114, 242, 10, 138, 74, 202, 42, 170, 106, 234, 26, 154, 90, 218, 58, 186, 122, 250, 6, 134, 70, 198, 38, 166, 102, 230, 22, 150, 86, 214, 54, 182, 118, 246, 14, 142, 78, 206, 46, 174, 110, 238, 30, 158, 94, 222, 62, 190, 126, 254, 1, 129, 65, 193, 33, 161, 97, 225, 17, 145, 81, 209, 49, 177, 113, 241, 9, 137, 73, 201, 41, 169, 105, 233, 25, 153, 89, 217, 57, 185, 121, 249, 5, 133, 69, 197, 37, 165, 101, 229, 21, 149, 85, 213, 53, 181, 117, 245, 13, 141, 77, 205, 45, 173, 109, 237, 29, 157, 93, 221, 61, 189, 125, 253, 3, 131, 67, 195, 35, 163, 99, 227, 19, 147, 83, 211, 51, 179, 115, 243, 11, 139, 75, 203, 43, 171, 107, 235, 27, 155, 91, 219, 59, 187, 123, 251, 7, 135, 71, 199, 39, 167, 103, 231, 23, 151, 87, 215, 55, 183, 119, 247, 15, 143, 79, 207, 47, 175, 111, 239, 31, 159, 95, 223, 63, 191, 127, 255 }; /* * perl -e 'foreach $i (0..255) {$r = 0;foreach $j (0 .. 7) { $r = $i & (1 << (7 - $j)); last if ($r)} print $i & ~($r), ", ";if (($i & 7) == 7) {print "\n";}}' */ static uint8_t parent_byte[256] = { 0, 0, 0, 1, 0, 1, 2, 3, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 0, 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, 0, 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, 0, 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 }; /* * Reverse a key. */ static uint32_t reverse(uint32_t key) { return ((reversed_byte[key & 0xff] << 24) | (reversed_byte[(key >> 8) & 0xff] << 16) | (reversed_byte[(key >> 16) & 0xff] << 8) | (reversed_byte[(key >> 24) & 0xff])); } /* * Take the parent by discarding the highest bit that is set. */ static uint32_t parent_of(uint32_t key) { if (key > 0x00ffffff) return (key & 0x00ffffff) | (parent_byte[key >> 24] << 24); if (key > 0x0000ffff) return (key & 0x0000ffff) | (parent_byte[key >> 16] << 16); if (key > 0x000000ff) return (key & 0x000000ff) | (parent_byte[key >> 8] << 8); return parent_byte[key]; } static fr_hash_entry_t *list_find(fr_hash_table_t *ht, fr_hash_entry_t *head, uint32_t reversed, const void *data) { fr_hash_entry_t *cur; for (cur = head; cur != &ht->null; cur = cur->next) { if (cur->reversed == reversed) { if (ht->cmp) { int cmp = ht->cmp(data, cur->data); if (cmp > 0) break; if (cmp < 0) continue; } return cur; } if (cur->reversed > reversed) break; } return NULL; } /* * Inserts a new entry into the list, in order. */ static int list_insert(fr_hash_table_t *ht, fr_hash_entry_t **head, fr_hash_entry_t *node) { fr_hash_entry_t **last, *cur; last = head; for (cur = *head; cur != &ht->null; cur = cur->next) { if (cur->reversed > node->reversed) break; last = &(cur->next); if (cur->reversed == node->reversed) { if (ht->cmp) { int cmp = ht->cmp(node->data, cur->data); if (cmp > 0) break; if (cmp < 0) continue; } return 0; } } node->next = *last; *last = node; return 1; } /* * Delete an entry from the list. */ static int list_delete(fr_hash_table_t *ht, fr_hash_entry_t **head, fr_hash_entry_t *node) { fr_hash_entry_t **last, *cur; last = head; for (cur = *head; cur != &ht->null; cur = cur->next) { if (cur == node) break; last = &(cur->next); } *last = node->next; return 1; } /* * Create the table. * * Memory usage in bytes is (20/3) * number of entries. */ fr_hash_table_t *fr_hash_table_create(fr_hash_table_hash_t hashNode, fr_hash_table_cmp_t cmpNode, fr_hash_table_free_t freeNode) { fr_hash_table_t *ht; if (!hashNode) return NULL; ht = malloc(sizeof(*ht)); if (!ht) return NULL; memset(ht, 0, sizeof(*ht)); ht->free = freeNode; ht->hash = hashNode; ht->cmp = cmpNode; ht->num_buckets = FR_HASH_NUM_BUCKETS; ht->mask = ht->num_buckets - 1; /* * Have a default load factor of 2.5. In practice this * means that the average load will hit 3 before the * table grows. */ ht->next_grow = (ht->num_buckets << 1) + (ht->num_buckets >> 1); ht->buckets = malloc(sizeof(*ht->buckets) * ht->num_buckets); if (!ht->buckets) { free(ht); return NULL; } memset(ht->buckets, 0, sizeof(*ht->buckets) * ht->num_buckets); ht->null.reversed = ~0; ht->null.key = ~0; ht->null.next = &ht->null; ht->buckets[0] = &ht->null; return ht; } /* * If the current bucket is uninitialized, initialize it * by recursively copying information from the parent. * * We may have a situation where entry E is a parent to 2 other * entries E' and E". If we split E into E and E', then the * nodes meant for E" end up in E or E', either of which is * wrong. To solve that problem, we walk down the whole chain, * inserting the elements into the correct place. */ static void fr_hash_table_fixup(fr_hash_table_t *ht, uint32_t entry) { uint32_t parent_entry; fr_hash_entry_t **last, *cur; uint32_t this; parent_entry = parent_of(entry); /* parent_entry == entry if and only if entry == 0 */ if (!ht->buckets[parent_entry]) { fr_hash_table_fixup(ht, parent_entry); } /* * Keep walking down cur, trying to find entries that * don't belong here any more. There may be multiple * ones, so we can't have a naive algorithm... */ last = &ht->buckets[parent_entry]; this = parent_entry; for (cur = *last; cur != &ht->null; cur = cur->next) { uint32_t real_entry; real_entry = cur->key & ht->mask; if (real_entry != this) { /* ht->buckets[real_entry] == NULL */ *last = &ht->null; ht->buckets[real_entry] = cur; this = real_entry; } last = &(cur->next); } /* * We may NOT have initialized this bucket, so do it now. */ if (!ht->buckets[entry]) ht->buckets[entry] = &ht->null; } /* * This should be a power of two. Changing it to 4 doesn't seem * to make any difference. */ #define GROW_FACTOR (2) /* * Grow the hash table. */ static void fr_hash_table_grow(fr_hash_table_t *ht) { fr_hash_entry_t **buckets; buckets = malloc(sizeof(*buckets) * GROW_FACTOR * ht->num_buckets); if (!buckets) return; memcpy(buckets, ht->buckets, sizeof(*buckets) * ht->num_buckets); memset(&buckets[ht->num_buckets], 0, sizeof(*buckets) * ht->num_buckets); free(ht->buckets); ht->buckets = buckets; ht->num_buckets *= GROW_FACTOR; ht->next_grow *= GROW_FACTOR; ht->mask = ht->num_buckets - 1; #ifdef TESTING grow = 1; fprintf(stderr, "GROW TO %d\n", ht->num_buckets); #endif } /* * Insert data. */ int fr_hash_table_insert(fr_hash_table_t *ht, void *data) { uint32_t key; uint32_t entry; uint32_t reversed; fr_hash_entry_t *node; if (!ht || !data) return 0; key = ht->hash(data); entry = key & ht->mask; reversed = reverse(key); if (!ht->buckets[entry]) fr_hash_table_fixup(ht, entry); /* * If we try to do our own memory allocation here, the * speedup is only ~15% or so, which isn't worth it. */ node = malloc(sizeof(*node)); if (!node) return 0; memset(node, 0, sizeof(*node)); node->next = &ht->null; node->reversed = reversed; node->key = key; node->data = data; /* already in the table, can't insert it */ if (!list_insert(ht, &ht->buckets[entry], node)) { free(node); return 0; } /* * Check the load factor, and grow the table if * necessary. */ ht->num_elements++; if (ht->num_elements >= ht->next_grow) { fr_hash_table_grow(ht); } return 1; } /* * Internal find a node routine. */ static fr_hash_entry_t *fr_hash_table_find(fr_hash_table_t *ht, const void *data) { uint32_t key; uint32_t entry; uint32_t reversed; if (!ht) return NULL; key = ht->hash(data); entry = key & ht->mask; reversed = reverse(key); if (!ht->buckets[entry]) fr_hash_table_fixup(ht, entry); return list_find(ht, ht->buckets[entry], reversed, data); } /* * Replace old data with new data, OR insert if there is no old. */ int fr_hash_table_replace(fr_hash_table_t *ht, void *data) { fr_hash_entry_t *node; if (!ht || !data) return 0; node = fr_hash_table_find(ht, data); if (!node) return fr_hash_table_insert(ht, data); if (ht->free) ht->free(node->data); node->data = data; return 1; } /* * Find data from a template */ void *fr_hash_table_finddata(fr_hash_table_t *ht, const void *data) { fr_hash_entry_t *node; node = fr_hash_table_find(ht, data); if (!node) return NULL; return node->data; } /* * Yank an entry from the hash table, without freeing the data. */ void *fr_hash_table_yank(fr_hash_table_t *ht, const void *data) { uint32_t key; uint32_t entry; uint32_t reversed; void *old; fr_hash_entry_t *node; if (!ht) return NULL; key = ht->hash(data); entry = key & ht->mask; reversed = reverse(key); if (!ht->buckets[entry]) fr_hash_table_fixup(ht, entry); node = list_find(ht, ht->buckets[entry], reversed, data); if (!node) return NULL; list_delete(ht, &ht->buckets[entry], node); ht->num_elements--; old = node->data; free(node); return old; } /* * Delete a piece of data from the hash table. */ int fr_hash_table_delete(fr_hash_table_t *ht, const void *data) { void *old; old = fr_hash_table_yank(ht, data); if (!old) return 0; if (ht->free) ht->free(old); return 1; } /* * Free a hash table */ void fr_hash_table_free(fr_hash_table_t *ht) { int i; fr_hash_entry_t *node, *next; if (!ht) return; /* * Walk over the buckets, freeing them all. */ for (i = 0; i < ht->num_buckets; i++) { if (ht->buckets[i]) for (node = ht->buckets[i]; node != &ht->null; node = next) { next = node->next; if (!node->data) continue; /* dummy entry */ if (ht->free) ht->free(node->data); free(node); } } free(ht->buckets); free(ht); } /* * Count number of elements */ int fr_hash_table_num_elements(fr_hash_table_t *ht) { if (!ht) return 0; return ht->num_elements; } /* * Walk over the nodes, allowing deletes & inserts to happen. */ int fr_hash_table_walk(fr_hash_table_t *ht, fr_hash_table_walk_t callback, void *context) { int i, rcode;; if (!ht || !callback) return 0; for (i = ht->num_buckets - 1; i >= 0; i--) { fr_hash_entry_t *node, *next; /* * Ensure that the current bucket is filled. */ if (!ht->buckets[i]) fr_hash_table_fixup(ht, i); for (node = ht->buckets[i]; node != &ht->null; node = next) { next = node->next; rcode = callback(context, node->data); if (rcode != 0) return rcode; } } return 0; } #ifdef TESTING /* * Show what the hash table is doing. */ int fr_hash_table_info(fr_hash_table_t *ht) { int i, a, collisions, uninitialized; int array[256]; if (!ht) return 0; uninitialized = collisions = 0; memset(array, 0, sizeof(array)); for (i = 0; i < ht->num_buckets; i++) { uint32_t key; int load; fr_hash_entry_t *node, *next; /* * If we haven't inserted or looked up an entry * in a bucket, it's uninitialized. */ if (!ht->buckets[i]) { uninitialized++; continue; } load = 0; key = ~0; for (node = ht->buckets[i]; node != &ht->null; node = next) { if (node->reversed == key) { collisions++; } else { key = node->reversed; } next = node->next; load++; } if (load > 255) load = 255; array[load]++; } printf("HASH TABLE %p\tbuckets: %d\t(%d uninitialized)\n", ht, ht->num_buckets, uninitialized); printf("\tnum entries %d\thash collisions %d\n", ht->num_elements, collisions); a = 0; for (i = 1; i < 256; i++) { if (!array[i]) continue; printf("%d\t%d\n", i, array[i]); /* * Since the entries are ordered, the lookup cost * for any one element in a chain is (on average) * the cost of walking half of the chain. */ if (i > 1) { a += array[i] * i; } } a /= 2; a += array[1]; printf("\texpected lookup cost = %d/%d or %f\n\n", ht->num_elements, a, (float) ht->num_elements / (float) a); return 0; } #endif #define FNV_MAGIC_INIT (0x811c9dc5) #define FNV_MAGIC_PRIME (0x01000193) /* * A fast hash function. For details, see: * * http://www.isthe.com/chongo/tech/comp/fnv/ * * Which also includes public domain source. We've re-written * it here for our purposes. */ uint32_t fr_hash(const void *data, size_t size) { const uint8_t *p = data; const uint8_t *q = p + size; uint32_t hash = FNV_MAGIC_INIT; /* * FNV-1 hash each octet in the buffer */ while (p != q) { /* * XOR the 8-bit quantity into the bottom of * the hash. */ hash ^= (uint32_t) (*p++); /* * Multiple by 32-bit magic FNV prime, mod 2^32 */ hash *= FNV_MAGIC_PRIME; #if 0 /* * Potential optimization. */ hash += (hash<<1) + (hash<<4) + (hash<<7) + (hash<<8) + (hash<<24); #endif } return hash; } /* * Continue hashing data. */ uint32_t fr_hash_update(const void *data, size_t size, uint32_t hash) { const uint8_t *p = data; const uint8_t *q = p + size; while (p != q) { hash *= FNV_MAGIC_PRIME; hash ^= (uint32_t) (*p++); } return hash; } /* * Return a "folded" hash, where the lower "bits" are the * hash, and the upper bits are zero. * * If you need a non-power-of-two hash, cope. */ uint32_t fr_hash_fold(uint32_t hash, int bits) { int count; uint32_t result; if ((bits <= 0) || (bits >= 32)) return hash; result = hash; /* * Never use the same bits twice in an xor. */ for (count = 0; count < 32; count += bits) { hash >>= bits; result ^= hash; } return result & (((uint32_t) (1 << bits)) - 1); } /* * Hash a C string, so we loop over it once. */ uint32_t fr_hash_string(const char *p) { uint32_t hash = FNV_MAGIC_INIT; while (*p) { hash *= FNV_MAGIC_PRIME; hash ^= (uint32_t) (*p++); } return hash; } #ifdef TESTING /* * cc -g -DTESTING -I ../include hash.c -o hash * * ./hash */ #include #include static uint32_t hash_int(const void *data) { return fr_hash((int *) data, sizeof(int)); } #define MAX 1024*1024 int main(int argc, char **argv) { int i, *p, *q, k; fr_hash_table_t *ht; int *array; ht = fr_hash_table_create(hash_int, NULL, NULL); if (!ht) { fprintf(stderr, "Hash create failed\n"); exit(1); } array = malloc(sizeof(int) * MAX); if (!array) exit(1); for (i = 0; i < MAX; i++) { p = array + i; *p = i; if (!fr_hash_table_insert(ht, p)) { fprintf(stderr, "Failed insert %08x\n", i); exit(1); } #ifdef TEST_INSERT q = fr_hash_table_finddata(ht, p); if (q != p) { fprintf(stderr, "Bad data %d\n", i); exit(1); } #endif } fr_hash_table_info(ht); /* * Build this to see how lookups result in shortening * of the hash chains. */ if (1) { for (i = 0; i < MAX ; i++) { q = fr_hash_table_finddata(ht, &i); if (!q || *q != i) { fprintf(stderr, "Failed finding %d\n", i); exit(1); } #if 0 if (!fr_hash_table_delete(ht, &i)) { fprintf(stderr, "Failed deleting %d\n", i); exit(1); } q = fr_hash_table_finddata(ht, &i); if (q) { fprintf(stderr, "Failed to delete %08x\n", i); exit(1); } #endif } fr_hash_table_info(ht); } fr_hash_table_free(ht); free(array); exit(0); } #endif freeradius-server/src/lib/heap.c000066400000000000000000000123261257552170400171450ustar00rootroot00000000000000#include RCSID("$Id$") #include #include /* * A heap entry is made of a pointer to the object, which * contains the key. The heap itself is an array of pointers. * * Heaps normally support only ordered insert, and extraction * of the minimum element. The heap entry can contain an "int" * field that holds the entries position in the heap. The offset * of the field is held inside of the heap structure. */ struct fr_heap_t { int size; int num_elements; size_t offset; fr_heap_cmp_t cmp; void **p; }; /* * First node in a heap is element 0. Children of i are 2i+1 and * 2i+2. These macros wrap the logic, so the code is more * descriptive. */ #define HEAP_PARENT(x) ( ( (x) - 1 ) / 2 ) #define HEAP_LEFT(x) ( 2*(x) + 1 ) #define HEAP_RIGHT(x) ( 2*(x) + 2 ) #define HEAP_SWAP(a, b) { void *_tmp = a; a = b; b = _tmp; } static int fr_heap_bubble(fr_heap_t *hp, int child); void fr_heap_delete(fr_heap_t *hp) { if (!hp) return; free(hp->p); free(hp); } fr_heap_t *fr_heap_create(fr_heap_cmp_t cmp, size_t offset) { fr_heap_t *fh; if (!cmp) return NULL; fh = malloc(sizeof(*fh)); if (!fh) return NULL; memset(fh, 0, sizeof(*fh)); fh->size = 2048; fh->p = malloc(sizeof(*(fh->p)) * fh->size); if (!fh->p) { free(fh); return NULL; } fh->cmp = cmp; fh->offset = offset; return fh; } /* * Insert element in heap. Normally, p != NULL, we insert p in a * new position and bubble up. If p == NULL, then the element is * already in place, and key is the position where to start the * bubble-up. * * Returns 1 on failure (cannot allocate new heap entry) * * If offset > 0 the position (index, int) of the element in the * heap is also stored in the element itself at the given offset * in bytes. */ #define SET_OFFSET(heap, node) \ if (heap->offset) \ *((int *)(((uint8_t *)heap->p[node]) + heap->offset)) = node /* * RESET_OFFSET is used for sanity checks. It sets offset to an * invalid value. */ #define RESET_OFFSET(heap, node) \ if (heap->offset) \ *((int *)(((uint8_t *)heap->p[node]) + heap->offset)) = -1 int fr_heap_insert(fr_heap_t *hp, void *data) { int child = hp->num_elements; /* * Heap is full. Double it's size. */ if (child == hp->size) { void **p; p = malloc(2 * hp->size * sizeof(*p)); if (!p) return 0; memcpy(p, hp->p, sizeof(*p) * hp->size); free(hp->p); hp->p = p; hp->size *= 2; } hp->p[child] = data; hp->num_elements++; return fr_heap_bubble(hp, child); } static int fr_heap_bubble(fr_heap_t *hp, int child) { /* * Bubble up the element. */ while (child > 0) { int parent = HEAP_PARENT(child); /* * Parent is smaller than the child. We're done. */ if (hp->cmp(hp->p[parent], hp->p[child]) < 0) break; /* * Child is smaller than the parent, repeat. */ HEAP_SWAP(hp->p[child], hp->p[parent]); SET_OFFSET(hp, child); child = parent; } SET_OFFSET(hp, child); return 1; } /* * Remove the top element, or object. */ int fr_heap_extract(fr_heap_t *hp, void *data) { int child, parent; int max; if (!hp || (hp->num_elements == 0)) return 0; max = hp->num_elements - 1; /* * Extract element. Default is the first one. */ if (!data) { parent = 0; } else { /* extract from the middle */ if (!hp->offset) return 0; parent = *((int *)(((uint8_t *)data) + hp->offset)); /* * Out of bounds. */ if (parent < 0 || parent >= hp->num_elements) return 0; } RESET_OFFSET(hp, parent); child = HEAP_LEFT(parent); while (child <= max) { /* * Maybe take the right child. */ if ((child != max) && (hp->cmp(hp->p[child + 1], hp->p[child]) < 0)) { child = child + 1; } hp->p[parent] = hp->p[child]; SET_OFFSET(hp, parent); parent = child; child = HEAP_LEFT(child); } hp->num_elements--; /* * We didn't end up at the last element in the heap. * This element has to be re-inserted. */ if (parent != max) { /* * Fill hole with last entry and bubble up, * reusing the insert code */ hp->p[parent] = hp->p[max]; return fr_heap_bubble(hp, parent); } return 1; } void *fr_heap_peek(fr_heap_t *hp) { if (!hp || (hp->num_elements == 0)) return NULL; /* * If this is NULL, we have a problem. */ return hp->p[0]; } int fr_heap_num_elements(fr_heap_t *hp) { if (!hp) return 0; return hp->num_elements; } #ifdef TESTING /* * cc -g -DTESTING -I .. heap.c -o heap * * ./heap */ #include #include static int heap_cmp(const void *a, const void *b) { return *(int *)a - *(int *) b; } int main(int argc, char **arg) { fr_heap_t *hp; int i, array[1024]; hp = fr_heap_create(heap_cmp, 0); if (!hp) { fprintf(stderr, "Failed creating heap!\n"); exit(1); } for (i = 0; i < 1024; i++) { array[i] = (i * 257) % 65537; if (!fr_heap_insert(hp, &array[i])) { fprintf(stderr, "Failed inserting %d\n", i); exit(1); } } for (i = 0; i < 1024; i++) { int *p = fr_heap_peek(hp); if (!p) { fprintf(stderr, "Failed peeking %d\n", i); exit(1); } printf("%d\t%d\n", i, *p); if (!fr_heap_extract(hp, NULL)) { fprintf(stderr, "Failed extracting %d\n", i); exit(1); } } fr_heap_delete(hp); return 0; } #endif freeradius-server/src/lib/hmac.c000066400000000000000000000121161257552170400171350ustar00rootroot00000000000000/* * hmac.c For the sake of illustration we provide the following * sample code for the implementation of HMAC-MD5 as well * as some corresponding test vectors (the code is based * on MD5 code as described in [MD5]). * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2000,2006 The FreeRADIUS server project */ /* ** Function: fr_hmac_md5 */ #include RCSID("$Id$") #include #include /* unsigned char* text; pointer to data stream int text_len; length of data stream unsigned char* key; pointer to authentication key int key_len; length of authentication key unsigned char* digest; caller digest to be filled in */ void fr_hmac_md5(const uint8_t *text, int text_len, const uint8_t *key, int key_len, uint8_t *digest) { FR_MD5_CTX context; uint8_t k_ipad[65]; /* inner padding - * key XORd with ipad */ uint8_t k_opad[65]; /* outer padding - * key XORd with opad */ uint8_t tk[16]; int i; /* if key is longer than 64 bytes reset it to key=MD5(key) */ if (key_len > 64) { FR_MD5_CTX tctx; fr_MD5Init(&tctx); fr_MD5Update(&tctx, key, key_len); fr_MD5Final(tk, &tctx); key = tk; key_len = 16; } /* * the HMAC_MD5 transform looks like: * * MD5(K XOR opad, MD5(K XOR ipad, text)) * * where K is an n byte key * ipad is the byte 0x36 repeated 64 times * opad is the byte 0x5c repeated 64 times * and text is the data being protected */ /* start out by storing key in pads */ memset( k_ipad, 0, sizeof(k_ipad)); memset( k_opad, 0, sizeof(k_opad)); memcpy( k_ipad, key, key_len); memcpy( k_opad, key, key_len); /* XOR key with ipad and opad values */ for (i = 0; i < 64; i++) { k_ipad[i] ^= 0x36; k_opad[i] ^= 0x5c; } /* * perform inner MD5 */ fr_MD5Init(&context); /* init context for 1st * pass */ fr_MD5Update(&context, k_ipad, 64); /* start with inner pad */ fr_MD5Update(&context, text, text_len); /* then text of datagram */ fr_MD5Final(digest, &context); /* finish up 1st pass */ /* * perform outer MD5 */ fr_MD5Init(&context); /* init context for 2nd * pass */ fr_MD5Update(&context, k_opad, 64); /* start with outer pad */ fr_MD5Update(&context, digest, 16); /* then results of 1st * hash */ fr_MD5Final(digest, &context); /* finish up 2nd pass */ } /* Test Vectors (Trailing '\0' of a character string not included in test): key = 0x0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b key_len = 16 bytes data = "Hi There" data_len = 8 bytes digest = 0x9294727a3638bb1c13f48ef8158bfc9d key = "Jefe" data = "what do ya want for nothing?" data_len = 28 bytes digest = 0x750c783e6ab0b503eaa86e310a5db738 key = 0xAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA key_len 16 bytes data = 0xDDDDDDDDDDDDDDDDDDDD... ..DDDDDDDDDDDDDDDDDDDD... ..DDDDDDDDDDDDDDDDDDDD... ..DDDDDDDDDDDDDDDDDDDD... ..DDDDDDDDDDDDDDDDDDDD data_len = 50 bytes digest = 0x56be34521d144c88dbb8c733f0e8b3f6 */ #ifdef TESTING /* * cc -DTESTING -I ../include/ hmac.c md5.c -o hmac * * ./hmac Jefe "what do ya want for nothing?" */ #include int main(int argc, char **argv) { uint8_t digest[16]; char *key; int key_len; char *text; int text_len; int i; key = argv[1]; key_len = strlen(key); text = argv[2]; text_len = strlen(text); fr_hmac_md5(text, text_len, key, key_len, digest); for (i = 0; i < 16; i++) { printf("%02x", digest[i]); } printf("\n"); exit(0); return 0; } #endif freeradius-server/src/lib/hmacsha1.c000066400000000000000000000115711257552170400177160ustar00rootroot00000000000000/* * Adapted from hmac.c (HMAC-MD5) for use by SHA1. * by . Test cases from RFC2202. * */ /* ** Function: hmac_sha1 */ #include RCSID("$Id$") #include #include /* uint8_t* text; pointer to data stream int text_len; length of data stream uint8_t* key; pointer to authentication key int key_len; length of authentication key uint8_t* digest; caller digest to be filled in */ #ifdef HMAC_SHA1_DATA_PROBLEMS unsigned int sha1_data_problems = 0; #endif void fr_hmac_sha1(const uint8_t *text, int text_len, const uint8_t *key, int key_len, uint8_t *digest) { fr_SHA1_CTX context; uint8_t k_ipad[65]; /* inner padding - * key XORd with ipad */ uint8_t k_opad[65]; /* outer padding - * key XORd with opad */ uint8_t tk[20]; int i; /* if key is longer than 64 bytes reset it to key=SHA1(key) */ if (key_len > 64) { fr_SHA1_CTX tctx; fr_SHA1Init(&tctx); fr_SHA1Update(&tctx, key, key_len); fr_SHA1Final(tk, &tctx); key = tk; key_len = 20; } #ifdef HMAC_SHA1_DATA_PROBLEMS if(sha1_data_problems) { int j,k; printf("\nhmac-sha1 key(%d): ", key_len); j=0; k=0; for (i = 0; i < key_len; i++) { if(j==4) { printf("_"); j=0; } j++; printf("%02x", key[i]); } printf("\nDATA: (%d) ",text_len); j=0; k=0; for (i = 0; i < text_len; i++) { if(k==20) { printf("\n "); k=0; j=0; } if(j==4) { printf("_"); j=0; } k++; j++; printf("%02x", text[i]); } printf("\n"); } #endif /* * the HMAC_SHA1 transform looks like: * * SHA1(K XOR opad, SHA1(K XOR ipad, text)) * * where K is an n byte key * ipad is the byte 0x36 repeated 64 times * opad is the byte 0x5c repeated 64 times * and text is the data being protected */ /* start out by storing key in pads */ memset( k_ipad, 0, sizeof(k_ipad)); memset( k_opad, 0, sizeof(k_opad)); memcpy( k_ipad, key, key_len); memcpy( k_opad, key, key_len); /* XOR key with ipad and opad values */ for (i = 0; i < 64; i++) { k_ipad[i] ^= 0x36; k_opad[i] ^= 0x5c; } /* * perform inner SHA1 */ fr_SHA1Init(&context); /* init context for 1st * pass */ fr_SHA1Update(&context, k_ipad, 64); /* start with inner pad */ fr_SHA1Update(&context, text, text_len); /* then text of datagram */ fr_SHA1Final(digest, &context); /* finish up 1st pass */ /* * perform outer MD5 */ fr_SHA1Init(&context); /* init context for 2nd * pass */ fr_SHA1Update(&context, k_opad, 64); /* start with outer pad */ fr_SHA1Update(&context, digest, 20); /* then results of 1st * hash */ fr_SHA1Final(digest, &context); /* finish up 2nd pass */ #ifdef HMAC_SHA1_DATA_PROBLEMS if(sha1_data_problems) { int j; printf("\nhmac-sha1 mac(20): "); j=0; for (i = 0; i < 20; i++) { if(j==4) { printf("_"); j=0; } j++; printf("%02x", digest[i]); } printf("\n"); } #endif } /* Test Vectors (Trailing '\0' of a character string not included in test): key = "Jefe" data = "what do ya want for nothing?" data_len = 28 bytes digest = effcdf6ae5eb2fa2d27416d5f184df9c259a7c79 key = 0xAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA key_len 16 bytes data = 0xDDDDDDDDDDDDDDDDDDDD... ..DDDDDDDDDDDDDDDDDDDD... ..DDDDDDDDDDDDDDDDDDDD... ..DDDDDDDDDDDDDDDDDDDD... ..DDDDDDDDDDDDDDDDDDDD data_len = 50 bytes digest = 0x56be34521d144c88dbb8c733f0e8b3f6 */ #ifdef TESTING /* * cc -DTESTING -I ../include/ hmac.c sha1.c -o hmac * * ./hmac Jefe "what do ya want for nothing?" */ #include int main(int argc, char **argv) { uint8_t digest[20]; char *key; int key_len; char *text; int text_len; int i; key = argv[1]; key_len = strlen(key); text = argv[2]; text_len = strlen(text); fr_hmac_sha1(text, text_len, key, key_len, digest); for (i = 0; i < 20; i++) { printf("%02x", digest[i]); } printf("\n"); exit(0); return 0; } #endif freeradius-server/src/lib/isaac.c000066400000000000000000000072421257552170400173110ustar00rootroot00000000000000/* ------------------------------------------------------------------------------ http://burtleburtle.net/bob/rand/isaac.html rand.c: By Bob Jenkins. My random number generator, ISAAC. Public Domain MODIFIED: 960327: Creation (addition of randinit, really) 970719: use context, not global variables, for internal state 980324: make a portable version 010626: Note this is public domain ------------------------------------------------------------------------------ */ #include RCSID("$Id$") #include #define RANDSIZL (8) /* I recommend 8 for crypto, 4 for simulations */ #define RANDSIZ (1<>2)&(RANDSIZ-1)]) #define rngstep(mix,a,b,mm,m,m2,r,x) \ { \ x = *m; \ a = ((a^(mix)) + *(m2++)) & 0xffffffff; \ *(m++) = y = (ind(mm,x) + a + b) & 0xffffffff; \ *(r++) = b = (ind(mm,y>>RANDSIZL) + x) & 0xffffffff; \ } void fr_isaac(fr_randctx *ctx) { register uint32_t a,b,x,y,*m,*mm,*m2,*r,*mend; mm=ctx->randmem; r=ctx->randrsl; a = ctx->randa; b = (ctx->randb + (++ctx->randc)) & 0xffffffff; for (m = mm, mend = m2 = m+(RANDSIZ/2); m>6 , a, b, mm, m, m2, r, x); rngstep( a<<2 , a, b, mm, m, m2, r, x); rngstep( a>>16, a, b, mm, m, m2, r, x); } for (m2 = mm; m2>6 , a, b, mm, m, m2, r, x); rngstep( a<<2 , a, b, mm, m, m2, r, x); rngstep( a>>16, a, b, mm, m, m2, r, x); } ctx->randb = b; ctx->randa = a; } #define mix(a,b,c,d,e,f,g,h) \ { \ a^=b<<11; d+=a; b+=c; \ b^=c>>2; e+=b; c+=d; \ c^=d<<8; f+=c; d+=e; \ d^=e>>16; g+=d; e+=f; \ e^=f<<10; h+=e; f+=g; \ f^=g>>4; a+=f; g+=h; \ g^=h<<8; b+=g; h+=a; \ h^=a>>9; c+=h; a+=b; \ } /* if (flag==1), then use the contents of randrsl[] to initialize mm[]. */ void fr_randinit(fr_randctx *ctx, int flag) { int i; uint32_t a,b,c,d,e,f,g,h; uint32_t *m,*r; ctx->randa = ctx->randb = ctx->randc = 0; m=ctx->randmem; r=ctx->randrsl; a=b=c=d=e=f=g=h=0x9e3779b9; /* the golden ratio */ for (i=0; i<4; ++i) { /* scramble it */ mix(a,b,c,d,e,f,g,h); } if (flag) { /* initialize using the contents of r[] as the seed */ for (i=0; irandcnt=RANDSIZ; /* prepare to use the first set of results */ } #ifdef TEST /* * For testing. Output should be the same as * * http://burtleburtle.net/bob/rand/randvect.txt */ int main() { uint32_t i,j; fr_randctx ctx; ctx.randa = ctx.randb = ctx.randc = (uint32_t)0; for (i=0; i<256; ++i) ctx.randrsl[i]=(uint32_t)0; fr_randinit(&ctx, 1); for (i=0; i<2; ++i) { fr_isaac(&ctx); for (j=0; j<256; ++j) { printf("%.8lx",ctx.randrsl[j]); if ((j&7)==7) printf("\n"); } } } #endif freeradius-server/src/lib/log.c000066400000000000000000000057371257552170400170210ustar00rootroot00000000000000/* * log.c Functions in the library call radlib_log() which * does internal logging. * * Version: $Id$ * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2000,2006 The FreeRADIUS server project */ #include RCSID("$Id$") #include #define FR_STRERROR_BUFSIZE (1024) #ifdef HAVE_THREAD_TLS /* * GCC on most Linux systems */ #define THREAD_TLS __thread #elif defined(HAVE_DECLSPEC_THREAD) /* * Visual C++, Borland */ #define THREAD_TLS __declspec(thread) #else /* * We don't have thread-local storage. Ensure we don't * ask for it. */ #define THREAD_TLS /* * Use pthread keys if we have pthreads. For MAC, which should * be very fast. */ #ifdef HAVE_PTHREAD_H #define USE_PTHREAD_FOR_TLS (1) #endif #endif #ifndef USE_PTHREAD_FOR_TLS /* * Try to create a thread-local-storage version of this buffer. */ static THREAD_TLS char fr_strerror_buffer[FR_STRERROR_BUFSIZE]; #else #include static pthread_key_t fr_strerror_key; static pthread_once_t fr_strerror_once = PTHREAD_ONCE_INIT; /* Create Key */ static void fr_strerror_make_key(void) { pthread_key_create(&fr_strerror_key, NULL); } #endif /* * Log to a buffer, trying to be thread-safe. */ void fr_strerror_printf(const char *fmt, ...) { va_list ap; #ifdef USE_PTHREAD_FOR_TLS char *buffer; pthread_once(&fr_strerror_once, fr_strerror_make_key); buffer = pthread_getspecific(fr_strerror_key); if (!buffer) { buffer = malloc(FR_STRERROR_BUFSIZE); if (!buffer) return; /* panic and die! */ pthread_setspecific(fr_strerror_key, buffer); } va_start(ap, fmt); vsnprintf(buffer, FR_STRERROR_BUFSIZE, fmt, ap); #else va_start(ap, fmt); vsnprintf(fr_strerror_buffer, sizeof(fr_strerror_buffer), fmt, ap); #endif va_end(ap); } const char *fr_strerror(void) { #ifndef USE_PTHREAD_FOR_TLS return fr_strerror_buffer; #else const char *msg; pthread_once(&fr_strerror_once, fr_strerror_make_key); msg = pthread_getspecific(fr_strerror_key); if (msg) return msg; return "(unknown error)"; /* DON'T return NULL! */ #endif } void fr_perror(const char *fmt, ...) { va_list ap; va_start(ap, fmt); vfprintf(stderr, fmt, ap); if (strchr(fmt, ':') == NULL) fprintf(stderr, ": "); fprintf(stderr, "%s\n", fr_strerror()); va_end(ap); } freeradius-server/src/lib/md4.c000066400000000000000000000232601257552170400167130ustar00rootroot00000000000000/* * md4c.c MD4 message-digest algorithm * * Version: $Id$ * * This file is licensed under the LGPL, but is largely derived * from public domain source code. */ #include RCSID("$Id$") #include /* * FORCE MD4 TO USE OUR MD4 HEADER FILE! * If we don't do this, it might pick up the systems broken MD4. */ #include "../include/md4.h" void fr_md4_calc(output, input, inlen) unsigned char *output; const unsigned char *input; /* input block */ unsigned int inlen; /* length of input block */ { FR_MD4_CTX context; fr_MD4Init(&context); fr_MD4Update(&context, input, inlen); fr_MD4Final(output, &context); } #ifndef WITH_OPENSSL_MD4 /* The below was retrieved from * http://www.openbsd.org/cgi-bin/cvsweb/~checkout~/src/lib/libc/hash/md4.c?rev=1.2 * with the following changes: * CVS-$OpenBSD stuff deleted * #includes commented out. * Support context->count as uint32_t[2] instead of uint64_t * Add htole32 define from http://www.squid-cache.org/mail-archive/squid-dev/200307/0130.html * (The bswap32 definition in the patch.) * This is only used on BIG_ENDIAN systems, so we can always swap the bits. * change BYTE_ORDER == LITTLE_ENDIAN (OpenBSD-defined) to WORDS_BIGENDIAN (autoconf-defined) */ /* * This code implements the MD4 message-digest algorithm. * The algorithm is due to Ron Rivest. This code was * written by Colin Plumb in 1993, no copyright is claimed. * This code is in the public domain; do with it what you wish. * Todd C. Miller modified the MD5 code to do MD4 based on RFC 1186. * * Equivalent code is available from RSA Data Security, Inc. * This code has been tested against that, and is equivalent, * except that you don't need to include two pages of legalese * with every copy. * * To compute the message digest of a chunk of bytes, declare an * MD4Context structure, pass it to fr_MD4Init, call fr_MD4Update as * needed on buffers full of bytes, and then call fr_MD4Final, which * will fill a supplied 16-byte array with the digest. */ /*#include */ /*#include */ /*#include */ /*#if BYTE_ORDER == LITTLE_ENDIAN*/ #ifndef WORDS_BIGENDIAN #define htole32_4(buf) /* Nothing */ #define htole32_14(buf) /* Nothing */ #define htole32_16(buf) /* Nothing */ #else #define htole32(x) \ (((((uint32_t)x) & 0xff000000) >> 24) | \ ((((uint32_t)x) & 0x00ff0000) >> 8) | \ ((((uint32_t)x) & 0x0000ff00) << 8) | \ ((((uint32_t)x) & 0x000000ff) << 24)) #define htole32_4(buf) do { \ (buf)[ 0] = htole32((buf)[ 0]); \ (buf)[ 1] = htole32((buf)[ 1]); \ (buf)[ 2] = htole32((buf)[ 2]); \ (buf)[ 3] = htole32((buf)[ 3]); \ } while (0) #define htole32_14(buf) do { \ (buf)[ 0] = htole32((buf)[ 0]); \ (buf)[ 1] = htole32((buf)[ 1]); \ (buf)[ 2] = htole32((buf)[ 2]); \ (buf)[ 3] = htole32((buf)[ 3]); \ (buf)[ 4] = htole32((buf)[ 4]); \ (buf)[ 5] = htole32((buf)[ 5]); \ (buf)[ 6] = htole32((buf)[ 6]); \ (buf)[ 7] = htole32((buf)[ 7]); \ (buf)[ 8] = htole32((buf)[ 8]); \ (buf)[ 9] = htole32((buf)[ 9]); \ (buf)[10] = htole32((buf)[10]); \ (buf)[11] = htole32((buf)[11]); \ (buf)[12] = htole32((buf)[12]); \ (buf)[13] = htole32((buf)[13]); \ } while (0) #define htole32_16(buf) do { \ (buf)[ 0] = htole32((buf)[ 0]); \ (buf)[ 1] = htole32((buf)[ 1]); \ (buf)[ 2] = htole32((buf)[ 2]); \ (buf)[ 3] = htole32((buf)[ 3]); \ (buf)[ 4] = htole32((buf)[ 4]); \ (buf)[ 5] = htole32((buf)[ 5]); \ (buf)[ 6] = htole32((buf)[ 6]); \ (buf)[ 7] = htole32((buf)[ 7]); \ (buf)[ 8] = htole32((buf)[ 8]); \ (buf)[ 9] = htole32((buf)[ 9]); \ (buf)[10] = htole32((buf)[10]); \ (buf)[11] = htole32((buf)[11]); \ (buf)[12] = htole32((buf)[12]); \ (buf)[13] = htole32((buf)[13]); \ (buf)[14] = htole32((buf)[14]); \ (buf)[15] = htole32((buf)[15]); \ } while (0) #endif /* * Start MD4 accumulation. * Set bit count to 0 and buffer to mysterious initialization constants. */ void fr_MD4Init(FR_MD4_CTX *ctx) { ctx->count[0] = 0; ctx->count[1] = 0; ctx->state[0] = 0x67452301; ctx->state[1] = 0xefcdab89; ctx->state[2] = 0x98badcfe; ctx->state[3] = 0x10325476; } /* * Update context to reflect the concatenation of another buffer full * of bytes. */ void fr_MD4Update(FR_MD4_CTX *ctx, const unsigned char *buf, size_t len) { uint32_t count; /* Bytes already stored in ctx->buffer */ count = (uint32_t)((ctx->count[0] >> 3) & 0x3f); /* Update bitcount */ /* ctx->count += (uint64_t)len << 3;*/ if ((ctx->count[0] += ((uint32_t)len << 3)) < (uint32_t)len) { /* Overflowed ctx->count[0] */ ctx->count[1]++; } ctx->count[1] += ((uint32_t)len >> 29); /* Handle any leading odd-sized chunks */ if (count) { unsigned char *p = (unsigned char *)ctx->buffer + count; count = MD4_BLOCK_LENGTH - count; if (len < count) { memcpy(p, buf, len); return; } memcpy(p, buf, count); htole32_16((uint32_t *)ctx->buffer); fr_MD4Transform(ctx->state, ctx->buffer); buf += count; len -= count; } /* Process data in MD4_BLOCK_LENGTH-byte chunks */ while (len >= MD4_BLOCK_LENGTH) { memcpy(ctx->buffer, buf, MD4_BLOCK_LENGTH); htole32_16((uint32_t *)ctx->buffer); fr_MD4Transform(ctx->state, ctx->buffer); buf += MD4_BLOCK_LENGTH; len -= MD4_BLOCK_LENGTH; } /* Handle any remaining bytes of data. */ memcpy(ctx->buffer, buf, len); } /* * Final wrapup - pad to 64-byte boundary with the bit pattern * 1 0* (64-bit count of bits processed, MSB-first) */ void fr_MD4Final(unsigned char digest[MD4_DIGEST_LENGTH], FR_MD4_CTX *ctx) { uint32_t count; unsigned char *p; /* number of bytes mod 64 */ count = (uint32_t)(ctx->count[0] >> 3) & 0x3f; /* * Set the first char of padding to 0x80. * This is safe since there is always at least one byte free. */ p = ctx->buffer + count; *p++ = 0x80; /* Bytes of padding needed to make 64 bytes */ count = 64 - 1 - count; /* Pad out to 56 mod 64 */ if (count < 8) { /* Two lots of padding: Pad the first block to 64 bytes */ memset(p, 0, count); htole32_16((uint32_t *)ctx->buffer); fr_MD4Transform(ctx->state, ctx->buffer); /* Now fill the next block with 56 bytes */ memset(ctx->buffer, 0, 56); } else { /* Pad block to 56 bytes */ memset(p, 0, count - 8); } htole32_14((uint32_t *)ctx->buffer); /* Append bit count and transform */ ((uint32_t *)ctx->buffer)[14] = ctx->count[0]; ((uint32_t *)ctx->buffer)[15] = ctx->count[1]; fr_MD4Transform(ctx->state, ctx->buffer); htole32_4(ctx->state); memcpy(digest, ctx->state, MD4_DIGEST_LENGTH); memset(ctx, 0, sizeof(*ctx)); /* in case it's sensitive */ } /* The three core functions - F1 is optimized somewhat */ /* #define F1(x, y, z) (x & y | ~x & z) */ #define F1(x, y, z) (z ^ (x & (y ^ z))) #define F2(x, y, z) ((x & y) | (x & z) | (y & z)) #define F3(x, y, z) (x ^ y ^ z) /* This is the central step in the MD4 algorithm. */ #define MD4STEP(f, w, x, y, z, data, s) \ ( w += f(x, y, z) + data, w = w<>(32-s) ) /* * The core of the MD4 algorithm, this alters an existing MD4 hash to * reflect the addition of 16 longwords of new data. fr_MD4Update blocks * the data and converts bytes into longwords for this routine. */ void fr_MD4Transform(uint32_t buf[4], const unsigned char inc[MD4_BLOCK_LENGTH]) { uint32_t a, b, c, d; const uint32_t *in = (const uint32_t *)inc; a = buf[0]; b = buf[1]; c = buf[2]; d = buf[3]; MD4STEP(F1, a, b, c, d, in[ 0], 3); MD4STEP(F1, d, a, b, c, in[ 1], 7); MD4STEP(F1, c, d, a, b, in[ 2], 11); MD4STEP(F1, b, c, d, a, in[ 3], 19); MD4STEP(F1, a, b, c, d, in[ 4], 3); MD4STEP(F1, d, a, b, c, in[ 5], 7); MD4STEP(F1, c, d, a, b, in[ 6], 11); MD4STEP(F1, b, c, d, a, in[ 7], 19); MD4STEP(F1, a, b, c, d, in[ 8], 3); MD4STEP(F1, d, a, b, c, in[ 9], 7); MD4STEP(F1, c, d, a, b, in[10], 11); MD4STEP(F1, b, c, d, a, in[11], 19); MD4STEP(F1, a, b, c, d, in[12], 3); MD4STEP(F1, d, a, b, c, in[13], 7); MD4STEP(F1, c, d, a, b, in[14], 11); MD4STEP(F1, b, c, d, a, in[15], 19); MD4STEP(F2, a, b, c, d, in[ 0] + 0x5a827999, 3); MD4STEP(F2, d, a, b, c, in[ 4] + 0x5a827999, 5); MD4STEP(F2, c, d, a, b, in[ 8] + 0x5a827999, 9); MD4STEP(F2, b, c, d, a, in[12] + 0x5a827999, 13); MD4STEP(F2, a, b, c, d, in[ 1] + 0x5a827999, 3); MD4STEP(F2, d, a, b, c, in[ 5] + 0x5a827999, 5); MD4STEP(F2, c, d, a, b, in[ 9] + 0x5a827999, 9); MD4STEP(F2, b, c, d, a, in[13] + 0x5a827999, 13); MD4STEP(F2, a, b, c, d, in[ 2] + 0x5a827999, 3); MD4STEP(F2, d, a, b, c, in[ 6] + 0x5a827999, 5); MD4STEP(F2, c, d, a, b, in[10] + 0x5a827999, 9); MD4STEP(F2, b, c, d, a, in[14] + 0x5a827999, 13); MD4STEP(F2, a, b, c, d, in[ 3] + 0x5a827999, 3); MD4STEP(F2, d, a, b, c, in[ 7] + 0x5a827999, 5); MD4STEP(F2, c, d, a, b, in[11] + 0x5a827999, 9); MD4STEP(F2, b, c, d, a, in[15] + 0x5a827999, 13); MD4STEP(F3, a, b, c, d, in[ 0] + 0x6ed9eba1, 3); MD4STEP(F3, d, a, b, c, in[ 8] + 0x6ed9eba1, 9); MD4STEP(F3, c, d, a, b, in[ 4] + 0x6ed9eba1, 11); MD4STEP(F3, b, c, d, a, in[12] + 0x6ed9eba1, 15); MD4STEP(F3, a, b, c, d, in[ 2] + 0x6ed9eba1, 3); MD4STEP(F3, d, a, b, c, in[10] + 0x6ed9eba1, 9); MD4STEP(F3, c, d, a, b, in[ 6] + 0x6ed9eba1, 11); MD4STEP(F3, b, c, d, a, in[14] + 0x6ed9eba1, 15); MD4STEP(F3, a, b, c, d, in[ 1] + 0x6ed9eba1, 3); MD4STEP(F3, d, a, b, c, in[ 9] + 0x6ed9eba1, 9); MD4STEP(F3, c, d, a, b, in[ 5] + 0x6ed9eba1, 11); MD4STEP(F3, b, c, d, a, in[13] + 0x6ed9eba1, 15); MD4STEP(F3, a, b, c, d, in[ 3] + 0x6ed9eba1, 3); MD4STEP(F3, d, a, b, c, in[11] + 0x6ed9eba1, 9); MD4STEP(F3, c, d, a, b, in[ 7] + 0x6ed9eba1, 11); MD4STEP(F3, b, c, d, a, in[15] + 0x6ed9eba1, 15); buf[0] += a; buf[1] += b; buf[2] += c; buf[3] += d; } #endif freeradius-server/src/lib/md5.c000066400000000000000000000213331257552170400167130ustar00rootroot00000000000000/* * md5.c MD5 message-digest algorithm * * Version: $Id$ * * This file is licensed under the LGPL, but is largely derived * from public domain source code. */ #include RCSID("$Id$") #include /* * FORCE MD5 TO USE OUR MD5 HEADER FILE! * If we don't do this, it might pick up the systems broken MD5. */ #include "../include/md5.h" void fr_md5_calc(uint8_t *output, const uint8_t *input, unsigned int inlen) { FR_MD5_CTX context; fr_MD5Init(&context); fr_MD5Update(&context, input, inlen); fr_MD5Final(output, &context); } #ifndef WITH_OPENSSL_MD5 /* The below was retrieved from * http://www.openbsd.org/cgi-bin/cvsweb/~checkout~/src/sys/crypto/md5.c?rev=1.1 * with the following changes: * #includes commented out. * Support context->count as uint32_t[2] instead of uint64_t * u_int* to uint* */ /* * This code implements the MD5 message-digest algorithm. * The algorithm is due to Ron Rivest. This code was * written by Colin Plumb in 1993, no copyright is claimed. * This code is in the public domain; do with it what you wish. * * Equivalent code is available from RSA Data Security, Inc. * This code has been tested against that, and is equivalent, * except that you don't need to include two pages of legalese * with every copy. * * To compute the message digest of a chunk of bytes, declare an * MD5Context structure, pass it to fr_MD5Init, call fr_MD5Update as * needed on buffers full of bytes, and then call fr_MD5Final, which * will fill a supplied 16-byte array with the digest. */ /*#include */ /*#include */ /*#include */ #define PUT_64BIT_LE(cp, value) do { \ (cp)[7] = (value)[1] >> 24; \ (cp)[6] = (value)[1] >> 16; \ (cp)[5] = (value)[1] >> 8; \ (cp)[4] = (value)[1]; \ (cp)[3] = (value)[0] >> 24; \ (cp)[2] = (value)[0] >> 16; \ (cp)[1] = (value)[0] >> 8; \ (cp)[0] = (value)[0]; } while (0) #define PUT_32BIT_LE(cp, value) do { \ (cp)[3] = (value) >> 24; \ (cp)[2] = (value) >> 16; \ (cp)[1] = (value) >> 8; \ (cp)[0] = (value); } while (0) static const uint8_t PADDING[MD5_BLOCK_LENGTH] = { 0x80, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; /* * Start MD5 accumulation. Set bit count to 0 and buffer to mysterious * initialization constants. */ void fr_MD5Init(FR_MD5_CTX *ctx) { ctx->count[0] = 0; ctx->count[1] = 0; ctx->state[0] = 0x67452301; ctx->state[1] = 0xefcdab89; ctx->state[2] = 0x98badcfe; ctx->state[3] = 0x10325476; } /* * Update context to reflect the concatenation of another buffer full * of bytes. */ void fr_MD5Update(FR_MD5_CTX *ctx, const unsigned char *input, size_t len) { size_t have, need; /* Check how many bytes we already have and how many more we need. */ have = (size_t)((ctx->count[0] >> 3) & (MD5_BLOCK_LENGTH - 1)); need = MD5_BLOCK_LENGTH - have; /* Update bitcount */ /* ctx->count += (uint64_t)len << 3;*/ if ((ctx->count[0] += ((uint32_t)len << 3)) < (uint32_t)len) { /* Overflowed ctx->count[0] */ ctx->count[1]++; } ctx->count[1] += ((uint32_t)len >> 29); if (len >= need) { if (have != 0) { memcpy(ctx->buffer + have, input, need); fr_MD5Transform(ctx->state, ctx->buffer); input += need; len -= need; have = 0; } /* Process data in MD5_BLOCK_LENGTH-byte chunks. */ while (len >= MD5_BLOCK_LENGTH) { fr_MD5Transform(ctx->state, input); input += MD5_BLOCK_LENGTH; len -= MD5_BLOCK_LENGTH; } } /* Handle any remaining bytes of data. */ if (len != 0) memcpy(ctx->buffer + have, input, len); } /* * Final wrapup - pad to 64-byte boundary with the bit pattern * 1 0* (64-bit count of bits processed, MSB-first) */ void fr_MD5Final(uint8_t digest[MD5_DIGEST_LENGTH], FR_MD5_CTX *ctx) { uint8_t count[8]; size_t padlen; int i; /* Convert count to 8 bytes in little endian order. */ PUT_64BIT_LE(count, ctx->count); /* Pad out to 56 mod 64. */ padlen = MD5_BLOCK_LENGTH - ((ctx->count[0] >> 3) & (MD5_BLOCK_LENGTH - 1)); if (padlen < 1 + 8) padlen += MD5_BLOCK_LENGTH; fr_MD5Update(ctx, PADDING, padlen - 8); /* padlen - 8 <= 64 */ fr_MD5Update(ctx, count, 8); if (digest != NULL) { for (i = 0; i < 4; i++) PUT_32BIT_LE(digest + i * 4, ctx->state[i]); } memset(ctx, 0, sizeof(*ctx)); /* in case it's sensitive */ } /* The four core functions - F1 is optimized somewhat */ /* #define F1(x, y, z) (x & y | ~x & z) */ #define F1(x, y, z) (z ^ (x & (y ^ z))) #define F2(x, y, z) F1(z, x, y) #define F3(x, y, z) (x ^ y ^ z) #define F4(x, y, z) (y ^ (x | ~z)) /* This is the central step in the MD5 algorithm. */ #define MD5STEP(f, w, x, y, z, data, s) \ ( w += f(x, y, z) + data, w = w<>(32-s), w += x ) /* * The core of the MD5 algorithm, this alters an existing MD5 hash to * reflect the addition of 16 longwords of new data. fr_MD5Update blocks * the data and converts bytes into longwords for this routine. */ void fr_MD5Transform(uint32_t state[4], const uint8_t block[MD5_BLOCK_LENGTH]) { uint32_t a, b, c, d, in[MD5_BLOCK_LENGTH / 4]; for (a = 0; a < MD5_BLOCK_LENGTH / 4; a++) { in[a] = (uint32_t)( (uint32_t)(block[a * 4 + 0]) | (uint32_t)(block[a * 4 + 1]) << 8 | (uint32_t)(block[a * 4 + 2]) << 16 | (uint32_t)(block[a * 4 + 3]) << 24); } a = state[0]; b = state[1]; c = state[2]; d = state[3]; MD5STEP(F1, a, b, c, d, in[ 0] + 0xd76aa478, 7); MD5STEP(F1, d, a, b, c, in[ 1] + 0xe8c7b756, 12); MD5STEP(F1, c, d, a, b, in[ 2] + 0x242070db, 17); MD5STEP(F1, b, c, d, a, in[ 3] + 0xc1bdceee, 22); MD5STEP(F1, a, b, c, d, in[ 4] + 0xf57c0faf, 7); MD5STEP(F1, d, a, b, c, in[ 5] + 0x4787c62a, 12); MD5STEP(F1, c, d, a, b, in[ 6] + 0xa8304613, 17); MD5STEP(F1, b, c, d, a, in[ 7] + 0xfd469501, 22); MD5STEP(F1, a, b, c, d, in[ 8] + 0x698098d8, 7); MD5STEP(F1, d, a, b, c, in[ 9] + 0x8b44f7af, 12); MD5STEP(F1, c, d, a, b, in[10] + 0xffff5bb1, 17); MD5STEP(F1, b, c, d, a, in[11] + 0x895cd7be, 22); MD5STEP(F1, a, b, c, d, in[12] + 0x6b901122, 7); MD5STEP(F1, d, a, b, c, in[13] + 0xfd987193, 12); MD5STEP(F1, c, d, a, b, in[14] + 0xa679438e, 17); MD5STEP(F1, b, c, d, a, in[15] + 0x49b40821, 22); MD5STEP(F2, a, b, c, d, in[ 1] + 0xf61e2562, 5); MD5STEP(F2, d, a, b, c, in[ 6] + 0xc040b340, 9); MD5STEP(F2, c, d, a, b, in[11] + 0x265e5a51, 14); MD5STEP(F2, b, c, d, a, in[ 0] + 0xe9b6c7aa, 20); MD5STEP(F2, a, b, c, d, in[ 5] + 0xd62f105d, 5); MD5STEP(F2, d, a, b, c, in[10] + 0x02441453, 9); MD5STEP(F2, c, d, a, b, in[15] + 0xd8a1e681, 14); MD5STEP(F2, b, c, d, a, in[ 4] + 0xe7d3fbc8, 20); MD5STEP(F2, a, b, c, d, in[ 9] + 0x21e1cde6, 5); MD5STEP(F2, d, a, b, c, in[14] + 0xc33707d6, 9); MD5STEP(F2, c, d, a, b, in[ 3] + 0xf4d50d87, 14); MD5STEP(F2, b, c, d, a, in[ 8] + 0x455a14ed, 20); MD5STEP(F2, a, b, c, d, in[13] + 0xa9e3e905, 5); MD5STEP(F2, d, a, b, c, in[ 2] + 0xfcefa3f8, 9); MD5STEP(F2, c, d, a, b, in[ 7] + 0x676f02d9, 14); MD5STEP(F2, b, c, d, a, in[12] + 0x8d2a4c8a, 20); MD5STEP(F3, a, b, c, d, in[ 5] + 0xfffa3942, 4); MD5STEP(F3, d, a, b, c, in[ 8] + 0x8771f681, 11); MD5STEP(F3, c, d, a, b, in[11] + 0x6d9d6122, 16); MD5STEP(F3, b, c, d, a, in[14] + 0xfde5380c, 23); MD5STEP(F3, a, b, c, d, in[ 1] + 0xa4beea44, 4); MD5STEP(F3, d, a, b, c, in[ 4] + 0x4bdecfa9, 11); MD5STEP(F3, c, d, a, b, in[ 7] + 0xf6bb4b60, 16); MD5STEP(F3, b, c, d, a, in[10] + 0xbebfbc70, 23); MD5STEP(F3, a, b, c, d, in[13] + 0x289b7ec6, 4); MD5STEP(F3, d, a, b, c, in[ 0] + 0xeaa127fa, 11); MD5STEP(F3, c, d, a, b, in[ 3] + 0xd4ef3085, 16); MD5STEP(F3, b, c, d, a, in[ 6] + 0x04881d05, 23); MD5STEP(F3, a, b, c, d, in[ 9] + 0xd9d4d039, 4); MD5STEP(F3, d, a, b, c, in[12] + 0xe6db99e5, 11); MD5STEP(F3, c, d, a, b, in[15] + 0x1fa27cf8, 16); MD5STEP(F3, b, c, d, a, in[2 ] + 0xc4ac5665, 23); MD5STEP(F4, a, b, c, d, in[ 0] + 0xf4292244, 6); MD5STEP(F4, d, a, b, c, in[7 ] + 0x432aff97, 10); MD5STEP(F4, c, d, a, b, in[14] + 0xab9423a7, 15); MD5STEP(F4, b, c, d, a, in[5 ] + 0xfc93a039, 21); MD5STEP(F4, a, b, c, d, in[12] + 0x655b59c3, 6); MD5STEP(F4, d, a, b, c, in[3 ] + 0x8f0ccc92, 10); MD5STEP(F4, c, d, a, b, in[10] + 0xffeff47d, 15); MD5STEP(F4, b, c, d, a, in[1 ] + 0x85845dd1, 21); MD5STEP(F4, a, b, c, d, in[8 ] + 0x6fa87e4f, 6); MD5STEP(F4, d, a, b, c, in[15] + 0xfe2ce6e0, 10); MD5STEP(F4, c, d, a, b, in[6 ] + 0xa3014314, 15); MD5STEP(F4, b, c, d, a, in[13] + 0x4e0811a1, 21); MD5STEP(F4, a, b, c, d, in[4 ] + 0xf7537e82, 6); MD5STEP(F4, d, a, b, c, in[11] + 0xbd3af235, 10); MD5STEP(F4, c, d, a, b, in[2 ] + 0x2ad7d2bb, 15); MD5STEP(F4, b, c, d, a, in[9 ] + 0xeb86d391, 21); state[0] += a; state[1] += b; state[2] += c; state[3] += d; } #endif freeradius-server/src/lib/misc.c000066400000000000000000000336131257552170400171650ustar00rootroot00000000000000/* * misc.c Various miscellaneous functions. * * Version: $Id$ * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2000,2006 The FreeRADIUS server project */ #include RCSID("$Id$") #include #include #include #include int fr_dns_lookups = 0; int fr_debug_flag = 0; /** Sets a signal handler using sigaction if available, else signal * * @param sig to set handler for. * @param func handler to set. */ int fr_set_signal(int sig, sig_t func) { #ifdef HAVE_SIGACTION struct sigaction act; memset(&act, 0, sizeof(act)); act.sa_flags = 0; sigemptyset(&act.sa_mask); act.sa_handler = func; if (sigaction(sig, &act, NULL) < 0) { fr_strerror_printf("Failed setting signal %i handler via sigaction(): %s", sig, strerror(errno)); return -1; } #else if (signal(sig, func) < 0) { fr_strerror_printf("Failed setting signal %i handler via signal(): %s", sig, strerror(errno)); return -1; } #endif return 0; } /* * Return an IP address in standard dot notation * * FIXME: DELETE THIS */ const char *ip_ntoa(char *buffer, uint32_t ipaddr) { ipaddr = ntohl(ipaddr); sprintf(buffer, "%d.%d.%d.%d", (ipaddr >> 24) & 0xff, (ipaddr >> 16) & 0xff, (ipaddr >> 8) & 0xff, (ipaddr ) & 0xff); return buffer; } #undef F_LOCK /* * Internal wrapper for locking, to minimize the number of ifdef's * * Lock an fd, prefer lockf() over flock() */ int rad_lockfd(int fd, int lock_len) { #if defined(F_LOCK) return lockf(fd, F_LOCK, lock_len); #elif defined(LOCK_EX) lock_len = lock_len; /* -Wunused */ return flock(fd, LOCK_EX); #elif defined(F_WRLCK) struct flock fl; fl.l_start = 0; fl.l_len = lock_len; fl.l_pid = getpid(); fl.l_type = F_WRLCK; fl.l_whence = SEEK_CUR; return fcntl(fd, F_SETLKW, (void *)&fl); #else return -1; #endif } /* * Internal wrapper for locking, to minimize the number of ifdef's * * Lock an fd, prefer lockf() over flock() * Nonblocking version. */ int rad_lockfd_nonblock(int fd, int lock_len) { #if defined(F_LOCK) && !defined(BSD) return lockf(fd, F_TLOCK, lock_len); #elif defined(LOCK_EX) lock_len = lock_len; /* -Wunused */ return flock(fd, LOCK_EX | LOCK_NB); #elif defined(F_WRLCK) struct flock fl; fl.l_start = 0; fl.l_len = lock_len; fl.l_pid = getpid(); fl.l_type = F_WRLCK; fl.l_whence = SEEK_CUR; return fcntl(fd, F_SETLK, (void *)&fl); #else return -1; #endif } /* * Internal wrapper for unlocking, to minimize the number of ifdef's * in the source. * * Unlock an fd, prefer lockf() over flock() */ int rad_unlockfd(int fd, int lock_len) { #if defined(F_LOCK) && !defined(BSD) return lockf(fd, F_ULOCK, lock_len); #elif defined(LOCK_EX) lock_len = lock_len; /* -Wunused */ return flock(fd, LOCK_UN); #elif defined(F_WRLCK) struct flock fl; fl.l_start = 0; fl.l_len = lock_len; fl.l_pid = getpid(); fl.l_type = F_WRLCK; fl.l_whence = SEEK_CUR; return fcntl(fd, F_UNLCK, (void *)&fl); #else return -1; #endif } /* * Return an interface-id in standard colon notation */ char *ifid_ntoa(char *buffer, size_t size, uint8_t *ifid) { snprintf(buffer, size, "%x:%x:%x:%x", (ifid[0] << 8) + ifid[1], (ifid[2] << 8) + ifid[3], (ifid[4] << 8) + ifid[5], (ifid[6] << 8) + ifid[7]); return buffer; } /* * Return an interface-id from * one supplied in standard colon notation. */ uint8_t *ifid_aton(const char *ifid_str, uint8_t *ifid) { static const char xdigits[] = "0123456789abcdef"; const char *p, *pch; int num_id = 0, val = 0, idx = 0; for (p = ifid_str; ; ++p) { if (*p == ':' || *p == '\0') { if (num_id <= 0) return NULL; /* * Drop 'val' into the array. */ ifid[idx] = (val >> 8) & 0xff; ifid[idx + 1] = val & 0xff; if (*p == '\0') { /* * Must have all entries before * end of the string. */ if (idx != 6) return NULL; break; } val = 0; num_id = 0; if ((idx += 2) > 6) return NULL; } else if ((pch = strchr(xdigits, tolower(*p))) != NULL) { if (++num_id > 4) return NULL; /* * Dumb version of 'scanf' */ val <<= 4; val |= (pch - xdigits); } else return NULL; } return ifid; } #ifndef HAVE_INET_PTON static int inet_pton4(const char *src, struct in_addr *dst) { int octet; unsigned int num; const char *p, *off; uint8_t tmp[4]; static const char digits[] = "0123456789"; octet = 0; p = src; while (1) { num = 0; while (*p && ((off = strchr(digits, *p)) != NULL)) { num *= 10; num += (off - digits); if (num > 255) return 0; p++; } if (!*p) break; /* * Not a digit, MUST be a dot, else we * die. */ if (*p != '.') { return 0; } tmp[octet++] = num; p++; } /* * End of the string. At the fourth * octet is OK, anything else is an * error. */ if (octet != 3) { return 0; } tmp[3] = num; memcpy(dst, &tmp, sizeof(tmp)); return 1; } #ifdef HAVE_STRUCT_SOCKADDR_IN6 /* int * inet_pton6(src, dst) * convert presentation level address to network order binary form. * return: * 1 if `src' is a valid [RFC1884 2.2] address, else 0. * notice: * (1) does not touch `dst' unless it's returning 1. * (2) :: in a full address is silently ignored. * credit: * inspired by Mark Andrews. * author: * Paul Vixie, 1996. */ static int inet_pton6(const char *src, unsigned char *dst) { static const char xdigits_l[] = "0123456789abcdef", xdigits_u[] = "0123456789ABCDEF"; u_char tmp[IN6ADDRSZ], *tp, *endp, *colonp; const char *xdigits, *curtok; int ch, saw_xdigit; u_int val; memset((tp = tmp), 0, IN6ADDRSZ); endp = tp + IN6ADDRSZ; colonp = NULL; /* Leading :: requires some special handling. */ if (*src == ':') if (*++src != ':') return (0); curtok = src; saw_xdigit = 0; val = 0; while ((ch = *src++) != '\0') { const char *pch; if ((pch = strchr((xdigits = xdigits_l), ch)) == NULL) pch = strchr((xdigits = xdigits_u), ch); if (pch != NULL) { val <<= 4; val |= (pch - xdigits); if (val > 0xffff) return (0); saw_xdigit = 1; continue; } if (ch == ':') { curtok = src; if (!saw_xdigit) { if (colonp) return (0); colonp = tp; continue; } if (tp + INT16SZ > endp) return (0); *tp++ = (u_char) (val >> 8) & 0xff; *tp++ = (u_char) val & 0xff; saw_xdigit = 0; val = 0; continue; } if (ch == '.' && ((tp + INADDRSZ) <= endp) && inet_pton4(curtok, (struct in_addr *) tp) > 0) { tp += INADDRSZ; saw_xdigit = 0; break; /* '\0' was seen by inet_pton4(). */ } return (0); } if (saw_xdigit) { if (tp + INT16SZ > endp) return (0); *tp++ = (u_char) (val >> 8) & 0xff; *tp++ = (u_char) val & 0xff; } if (colonp != NULL) { /* * Since some memmove()'s erroneously fail to handle * overlapping regions, we'll do the shift by hand. */ const int n = tp - colonp; int i; for (i = 1; i <= n; i++) { endp[- i] = colonp[n - i]; colonp[n - i] = 0; } tp = endp; } if (tp != endp) return (0); /* bcopy(tmp, dst, IN6ADDRSZ); */ memcpy(dst, tmp, IN6ADDRSZ); return (1); } #endif /* * Utility function, so that the rest of the server doesn't * have ifdef's around IPv6 support */ int inet_pton(int af, const char *src, void *dst) { if (af == AF_INET) { return inet_pton4(src, dst); } #ifdef HAVE_STRUCT_SOCKADDR_IN6 if (af == AF_INET6) { return inet_pton6(src, dst); } #endif return -1; } #endif #ifndef HAVE_INET_NTOP /* * Utility function, so that the rest of the server doesn't * have ifdef's around IPv6 support */ const char *inet_ntop(int af, const void *src, char *dst, size_t cnt) { if (af == AF_INET) { const uint8_t *ipaddr = src; if (cnt <= INET_ADDRSTRLEN) return NULL; snprintf(dst, cnt, "%d.%d.%d.%d", ipaddr[0], ipaddr[1], ipaddr[2], ipaddr[3]); return dst; } /* * If the system doesn't define this, we define it * in missing.h */ if (af == AF_INET6) { const struct in6_addr *ipaddr = src; if (cnt <= INET6_ADDRSTRLEN) return NULL; snprintf(dst, cnt, "%x:%x:%x:%x:%x:%x:%x:%x", (ipaddr->s6_addr[0] << 8) | ipaddr->s6_addr[1], (ipaddr->s6_addr[2] << 8) | ipaddr->s6_addr[3], (ipaddr->s6_addr[4] << 8) | ipaddr->s6_addr[5], (ipaddr->s6_addr[6] << 8) | ipaddr->s6_addr[7], (ipaddr->s6_addr[8] << 8) | ipaddr->s6_addr[9], (ipaddr->s6_addr[10] << 8) | ipaddr->s6_addr[11], (ipaddr->s6_addr[12] << 8) | ipaddr->s6_addr[13], (ipaddr->s6_addr[14] << 8) | ipaddr->s6_addr[15]); return dst; } return NULL; /* don't support IPv6 */ } #endif /* * Wrappers for IPv4/IPv6 host to IP address lookup. * This API returns only one IP address, of the specified * address family, or the first address (of whatever family), * if AF_UNSPEC is used. */ int ip_hton(const char *src, int af, fr_ipaddr_t *dst) { int rcode; struct addrinfo hints, *ai = NULL, *res = NULL; memset(&hints, 0, sizeof(hints)); hints.ai_family = af; if ((rcode = getaddrinfo(src, NULL, &hints, &res)) != 0) { fr_strerror_printf("ip_hton: %s", gai_strerror(rcode)); return -1; } for (ai = res; ai; ai = ai->ai_next) { if ((af == ai->ai_family) || (af == AF_UNSPEC)) break; } if (!ai) { fr_strerror_printf("ip_hton failed to find requested information for host %.100s", src); freeaddrinfo(res); return -1; } rcode = fr_sockaddr2ipaddr((struct sockaddr_storage *)ai->ai_addr, ai->ai_addrlen, dst, NULL); freeaddrinfo(res); if (!rcode) return -1; return 0; } /* * Look IP addreses up, and print names (depending on DNS config) */ const char *ip_ntoh(const fr_ipaddr_t *src, char *dst, size_t cnt) { struct sockaddr_storage ss; int error; socklen_t salen; /* * No DNS lookups */ if (!fr_dns_lookups) { return inet_ntop(src->af, &(src->ipaddr), dst, cnt); } if (!fr_ipaddr2sockaddr(src, 0, &ss, &salen)) { return NULL; } if ((error = getnameinfo((struct sockaddr *)&ss, salen, dst, cnt, NULL, 0, NI_NUMERICHOST | NI_NUMERICSERV)) != 0) { fr_strerror_printf("ip_ntoh: %s", gai_strerror(error)); return NULL; } return dst; } static const char *hextab = "0123456789abcdef"; /* * hex2bin * * We allow: hex == bin */ size_t fr_hex2bin(const char *hex, uint8_t *bin, size_t len) { size_t i; char *c1, *c2; for (i = 0; i < len; i++) { if(!(c1 = memchr(hextab, tolower((int) hex[i << 1]), 16)) || !(c2 = memchr(hextab, tolower((int) hex[(i << 1) + 1]), 16))) break; bin[i] = ((c1-hextab)<<4) + (c2-hextab); } return i; } /* * bin2hex * * If the output buffer isn't long enough, we have a buffer overflow. */ void fr_bin2hex(const uint8_t *bin, char *hex, size_t len) { size_t i; for (i = 0; i < len; i++) { hex[0] = hextab[((*bin) >> 4) & 0x0f]; hex[1] = hextab[*bin & 0x0f]; hex += 2; bin++; } *hex = '\0'; return; } /* * So we don't have ifdef's in the rest of the code */ #ifndef HAVE_CLOSEFROM int closefrom(int fd) { int i; int maxfd = 256; #ifdef _SC_OPEN_MAX maxfd = sysconf(_SC_OPEN_MAX); if (maxfd < 0) { maxfd = 256; } #endif if (fd > maxfd) return 0; /* * FIXME: return EINTR? * * Use F_CLOSEM? */ for (i = fd; i < maxfd; i++) { close(i); } return 0; } #endif int fr_ipaddr_cmp(const fr_ipaddr_t *a, const fr_ipaddr_t *b) { if (a->af < b->af) return -1; if (a->af > b->af) return +1; switch (a->af) { case AF_INET: return memcmp(&a->ipaddr.ip4addr, &b->ipaddr.ip4addr, sizeof(a->ipaddr.ip4addr)); break; #ifdef HAVE_STRUCT_SOCKADDR_IN6 case AF_INET6: if (a->scope < b->scope) return -1; if (a->scope > b->scope) return +1; return memcmp(&a->ipaddr.ip6addr, &b->ipaddr.ip6addr, sizeof(a->ipaddr.ip6addr)); break; #endif default: break; } return -1; } int fr_ipaddr2sockaddr(const fr_ipaddr_t *ipaddr, int port, struct sockaddr_storage *sa, socklen_t *salen) { if (ipaddr->af == AF_INET) { struct sockaddr_in s4; *salen = sizeof(s4); memset(&s4, 0, sizeof(s4)); s4.sin_family = AF_INET; s4.sin_addr = ipaddr->ipaddr.ip4addr; s4.sin_port = htons(port); memset(sa, 0, sizeof(*sa)); memcpy(sa, &s4, sizeof(s4)); #ifdef HAVE_STRUCT_SOCKADDR_IN6 } else if (ipaddr->af == AF_INET6) { struct sockaddr_in6 s6; *salen = sizeof(s6); memset(&s6, 0, sizeof(s6)); s6.sin6_family = AF_INET6; s6.sin6_addr = ipaddr->ipaddr.ip6addr; s6.sin6_port = htons(port); s6.sin6_scope_id = ipaddr->scope; memset(sa, 0, sizeof(*sa)); memcpy(sa, &s6, sizeof(s6)); #endif } else { return 0; } return 1; } int fr_sockaddr2ipaddr(const struct sockaddr_storage *sa, socklen_t salen, fr_ipaddr_t *ipaddr, int *port) { if (sa->ss_family == AF_INET) { struct sockaddr_in s4; if (salen < sizeof(s4)) { fr_strerror_printf("IPv4 address is too small"); return 0; } memcpy(&s4, sa, sizeof(s4)); ipaddr->af = AF_INET; ipaddr->ipaddr.ip4addr = s4.sin_addr; if (port) *port = ntohs(s4.sin_port); #ifdef HAVE_STRUCT_SOCKADDR_IN6 } else if (sa->ss_family == AF_INET6) { struct sockaddr_in6 s6; if (salen < sizeof(s6)) { fr_strerror_printf("IPv6 address is too small"); return 0; } memcpy(&s6, sa, sizeof(s6)); ipaddr->af = AF_INET6; ipaddr->ipaddr.ip6addr = s6.sin6_addr; if (port) *port = ntohs(s6.sin6_port); ipaddr->scope = s6.sin6_scope_id; #endif } else { fr_strerror_printf("Unsupported address famility %d", sa->ss_family); return 0; } return 1; } freeradius-server/src/lib/missing.c000066400000000000000000000141361257552170400177020ustar00rootroot00000000000000/* * missing.c Replacements for functions that are or can be * missing on some platforms. * * Version: $Id$ * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2000,2006 The FreeRADIUS server project */ #include RCSID("$Id$") #include #include #ifndef HAVE_CRYPT char *crypt(UNUSED char *key, char *salt) { /*log(L_ERR, "crypt() called but not implemented");*/ return salt; } #endif #ifndef HAVE_STRNCASECMP int strncasecmp(char *s1, char *s2, int n) { int dif; unsigned char *p1, *p2; int c1, c2; p1 = (unsigned char *)s1; p2 = (unsigned char *)s2; dif = 0; while (n != 0) { if (*p1 == 0 && *p2 == 0) break; c1 = *p1; c2 = *p2; if (islower(c1)) c1 = toupper(c1); if (islower(c2)) c2 = toupper(c2); if ((dif = c1 - c2) != 0) break; p1++; p2++; n--; } return dif; } #endif #ifndef HAVE_STRCASECMP int strcasecmp(char *s1, char *s2) { int l1, l2; l1 = strlen(s1); l2 = strlen(s2); if (l2 > l1) l1 = l2; return strncasecmp(s1, s2, l1); } #endif #ifndef HAVE_INET_ATON int inet_aton(const char *cp, struct in_addr *inp) { int a1, a2, a3, a4; if (sscanf(cp, "%d.%d.%d.%d", &a1, &a2, &a3, &a4) != 4) return 0; inp->s_addr = htonl((a1 << 24) + (a2 << 16) + (a3 << 8) + a4); return 1; } #endif #ifndef HAVE_STRSEP /* * Get next token from string *stringp, where tokens are * possibly-empty strings separated by characters from delim. * * Writes NULs into the string at *stringp to end tokens. * delim need not remain constant from call to call. On * return, *stringp points past the last NUL written (if there * might be further tokens), or is NULL (if there are * definitely no more tokens). * * If *stringp is NULL, strsep returns NULL. */ char * strsep(char **stringp, const char *delim) { char *s; const char *spanp; int c, sc; char *tok; if ((s = *stringp) == NULL) return (NULL); for (tok = s;;) { c = *s++; spanp = delim; do { if ((sc = *spanp++) == c) { if (c == 0) s = NULL; else s[-1] = 0; *stringp = s; return (tok); } } while (sc != 0); } return NULL; /* NOTREACHED, but the compiler complains */ } #endif #ifndef HAVE_LOCALTIME_R /* * We use localtime_r() by default in the server. * * For systems which do NOT have localtime_r(), we make the * assumption that localtime() is re-entrant, and returns a * per-thread data structure. * * Even if localtime is NOT re-entrant, this function will * lower the possibility of race conditions. */ struct tm *localtime_r(const time_t *l_clock, struct tm *result) { memcpy(result, localtime(l_clock), sizeof(*result)); return result; } #endif #ifndef HAVE_CTIME_R /* * We use ctime_r() by default in the server. * * For systems which do NOT have ctime_r(), we make the * assumption that ctime() is re-entrant, and returns a * per-thread data structure. * * Even if ctime is NOT re-entrant, this function will * lower the possibility of race conditions. */ char *ctime_r(const time_t *l_clock, char *l_buf) { strcpy(l_buf, ctime(l_clock)); return l_buf; } #endif #ifndef HAVE_GMTIME_R /* * We use gmtime_r() by default in the server. * * For systems which do NOT have gmtime_r(), we make the * assumption that gmtime() is re-entrant, and returns a * per-thread data structure. * * Even if gmtime is NOT re-entrant, this function will * lower the possibility of race conditions. */ struct tm *gmtime_r(const time_t *l_clock, struct tm *result) { memcpy(result, gmtime(l_clock), sizeof(*result)); return result; } #endif #ifndef HAVE_GETTIMEOFDAY #ifdef WIN32 /* * Number of micro-seconds between the beginning of the Windows epoch * (Jan. 1, 1601) and the Unix epoch (Jan. 1, 1970). * * This assumes all Win32 compilers have 64-bit support. */ #if defined(_MSC_VER) || defined(_MSC_EXTENSIONS) || defined(__WATCOMC__) #define DELTA_EPOCH_IN_USEC 11644473600000000Ui64 #else #define DELTA_EPOCH_IN_USEC 11644473600000000ULL #endif static uint64_t filetime_to_unix_epoch (const FILETIME *ft) { uint64_t res = (uint64_t) ft->dwHighDateTime << 32; res |= ft->dwLowDateTime; res /= 10; /* from 100 nano-sec periods to usec */ res -= DELTA_EPOCH_IN_USEC; /* from Win epoch to Unix epoch */ return (res); } int gettimeofday (struct timeval *tv, UNUSED void *tz) { FILETIME ft; uint64_t tim; if (!tv) { errno = EINVAL; return (-1); } GetSystemTimeAsFileTime (&ft); tim = filetime_to_unix_epoch (&ft); tv->tv_sec = (long) (tim / 1000000L); tv->tv_usec = (long) (tim % 1000000L); return (0); } #endif #endif #define NTP_EPOCH_OFFSET 2208988800ULL /* * Convert 'struct timeval' into NTP format (32-bit integer * of seconds, 32-bit integer of fractional seconds) */ void timeval2ntp(const struct timeval *tv, uint8_t *ntp) { uint32_t sec, usec; sec = tv->tv_sec + NTP_EPOCH_OFFSET; usec = tv->tv_usec * 4295; /* close enough to 2^32 / USEC */ usec -= ((tv->tv_usec * 2143) >> 16); /* */ sec = htonl(sec); usec = htonl(usec); memcpy(ntp, &sec, sizeof(sec)); memcpy(ntp + sizeof(sec), &usec, sizeof(usec)); } /* * Inverse of timeval2ntp */ void ntp2timeval(struct timeval *tv, const char *ntp) { uint32_t sec, usec; memcpy(&sec, ntp, sizeof(sec)); memcpy(&usec, ntp + sizeof(sec), sizeof(usec)); sec = ntohl(sec); usec = ntohl(usec); tv->tv_sec = sec - NTP_EPOCH_OFFSET; tv->tv_usec = usec / 4295; /* close enough */ } freeradius-server/src/lib/packet.c000066400000000000000000000502371257552170400175020ustar00rootroot00000000000000/* * packet.c Generic packet manipulation functions. * * Version: $Id$ * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2000-2006 The FreeRADIUS server project */ #include RCSID("$Id$") #include #ifdef WITH_UDPFROMTO #include #endif /* * Take the key fields of a request packet, and convert it to a * hash. */ uint32_t fr_request_packet_hash(const RADIUS_PACKET *packet) { uint32_t hash; if (packet->hash) return packet->hash; hash = fr_hash(&packet->sockfd, sizeof(packet->sockfd)); hash = fr_hash_update(&packet->src_port, sizeof(packet->src_port), hash); hash = fr_hash_update(&packet->dst_port, sizeof(packet->dst_port), hash); hash = fr_hash_update(&packet->src_ipaddr.af, sizeof(packet->src_ipaddr.af), hash); /* * The caller ensures that src & dst AF are the same. */ switch (packet->src_ipaddr.af) { case AF_INET: hash = fr_hash_update(&packet->src_ipaddr.ipaddr.ip4addr, sizeof(packet->src_ipaddr.ipaddr.ip4addr), hash); hash = fr_hash_update(&packet->dst_ipaddr.ipaddr.ip4addr, sizeof(packet->dst_ipaddr.ipaddr.ip4addr), hash); break; case AF_INET6: hash = fr_hash_update(&packet->src_ipaddr.ipaddr.ip6addr, sizeof(packet->src_ipaddr.ipaddr.ip6addr), hash); hash = fr_hash_update(&packet->dst_ipaddr.ipaddr.ip6addr, sizeof(packet->dst_ipaddr.ipaddr.ip6addr), hash); break; default: break; } return fr_hash_update(&packet->id, sizeof(packet->id), hash); } /* * Take the key fields of a reply packet, and convert it to a * hash. * * i.e. take a reply packet, and find the hash of the request packet * that asked for the reply. To do this, we hash the reverse fields * of the request. e.g. where the request does (src, dst), we do * (dst, src) */ uint32_t fr_reply_packet_hash(const RADIUS_PACKET *packet) { uint32_t hash; hash = fr_hash(&packet->sockfd, sizeof(packet->sockfd)); hash = fr_hash_update(&packet->id, sizeof(packet->id), hash); hash = fr_hash_update(&packet->src_port, sizeof(packet->src_port), hash); hash = fr_hash_update(&packet->dst_port, sizeof(packet->dst_port), hash); hash = fr_hash_update(&packet->src_ipaddr.af, sizeof(packet->src_ipaddr.af), hash); /* * The caller ensures that src & dst AF are the same. */ switch (packet->src_ipaddr.af) { case AF_INET: hash = fr_hash_update(&packet->dst_ipaddr.ipaddr.ip4addr, sizeof(packet->dst_ipaddr.ipaddr.ip4addr), hash); hash = fr_hash_update(&packet->src_ipaddr.ipaddr.ip4addr, sizeof(packet->src_ipaddr.ipaddr.ip4addr), hash); break; case AF_INET6: hash = fr_hash_update(&packet->dst_ipaddr.ipaddr.ip6addr, sizeof(packet->dst_ipaddr.ipaddr.ip6addr), hash); hash = fr_hash_update(&packet->src_ipaddr.ipaddr.ip6addr, sizeof(packet->src_ipaddr.ipaddr.ip6addr), hash); break; default: break; } return fr_hash_update(&packet->id, sizeof(packet->id), hash); } /* * See if two packets are identical. * * Note that we do NOT compare the authentication vectors. * That's because if the authentication vector is different, * it means that the NAS has given up on the earlier request. */ int fr_packet_cmp(const RADIUS_PACKET *a, const RADIUS_PACKET *b) { int rcode; if (a->sockfd < b->sockfd) return -1; if (a->sockfd > b->sockfd) return +1; if (a->id < b->id) return -1; if (a->id > b->id) return +1; if (a->src_port < b->src_port) return -1; if (a->src_port > b->src_port) return +1; if (a->dst_port < b->dst_port) return -1; if (a->dst_port > b->dst_port) return +1; rcode = fr_ipaddr_cmp(&a->dst_ipaddr, &b->dst_ipaddr); if (rcode != 0) return rcode; return fr_ipaddr_cmp(&a->src_ipaddr, &b->src_ipaddr); } int fr_inaddr_any(fr_ipaddr_t *ipaddr) { if (ipaddr->af == AF_INET) { if (ipaddr->ipaddr.ip4addr.s_addr == INADDR_ANY) { return 1; } #ifdef HAVE_STRUCT_SOCKADDR_IN6 } else if (ipaddr->af == AF_INET6) { if (IN6_IS_ADDR_UNSPECIFIED(&(ipaddr->ipaddr.ip6addr))) { return 1; } #endif } else { fr_strerror_printf("Unknown address family"); return -1; } return 0; } /* * Create a fake "request" from a reply, for later lookup. */ void fr_request_from_reply(RADIUS_PACKET *request, const RADIUS_PACKET *reply) { request->sockfd = reply->sockfd; request->id = reply->id; request->src_port = reply->dst_port; request->dst_port = reply->src_port; request->src_ipaddr = reply->dst_ipaddr; request->dst_ipaddr = reply->src_ipaddr; } /* * Open a socket on the given IP and port. */ int fr_socket(fr_ipaddr_t *ipaddr, int port) { int sockfd; struct sockaddr_storage salocal; socklen_t salen; if ((port < 0) || (port > 65535)) { fr_strerror_printf("Port %d is out of allowed bounds", port); return -1; } sockfd = socket(ipaddr->af, SOCK_DGRAM, 0); if (sockfd < 0) { fr_strerror_printf("cannot open socket: %s", strerror(errno)); return sockfd; } #ifdef WITH_UDPFROMTO /* * Initialize udpfromto for all sockets. */ if (udpfromto_init(sockfd) != 0) { close(sockfd); fr_strerror_printf("cannot initialize udpfromto: %s", strerror(errno)); return -1; } #endif if (!fr_ipaddr2sockaddr(ipaddr, port, &salocal, &salen)) { return sockfd; } #ifdef HAVE_STRUCT_SOCKADDR_IN6 if (ipaddr->af == AF_INET6) { /* * Listening on '::' does NOT get you IPv4 to * IPv6 mapping. You've got to listen on an IPv4 * address, too. This makes the rest of the server * design a little simpler. */ #ifdef IPV6_V6ONLY if (IN6_IS_ADDR_UNSPECIFIED(&ipaddr->ipaddr.ip6addr)) { int on = 1; setsockopt(sockfd, IPPROTO_IPV6, IPV6_V6ONLY, (char *)&on, sizeof(on)); } #endif /* IPV6_V6ONLY */ } #endif /* HAVE_STRUCT_SOCKADDR_IN6 */ if (ipaddr->af == AF_INET) { UNUSED int flag; #if defined(IP_MTU_DISCOVER) && defined(IP_PMTUDISC_DONT) /* * Disable PMTU discovery. On Linux, this * also makes sure that the "don't fragment" * flag is zero. */ flag = IP_PMTUDISC_DONT; setsockopt(sockfd, IPPROTO_IP, IP_MTU_DISCOVER, &flag, sizeof(flag)); #endif #if defined(IP_DONTFRAG) /* * Ensure that the "don't fragment" flag is zero. */ flag = 0; setsockopt(sockfd, IPPROTO_IP, IP_DONTFRAG, &flag, sizeof(flag)); #endif } if (bind(sockfd, (struct sockaddr *) &salocal, salen) < 0) { close(sockfd); fr_strerror_printf("cannot bind socket: %s", strerror(errno)); return -1; } return sockfd; } /* * We need to keep track of the socket & it's IP/port. */ typedef struct fr_packet_socket_t { int sockfd; int num_outgoing; int offset; /* 0..31 */ int inaddr_any; fr_ipaddr_t ipaddr; int port; } fr_packet_socket_t; #define FNV_MAGIC_PRIME (0x01000193) #define MAX_SOCKETS (32) #define SOCKOFFSET_MASK (MAX_SOCKETS - 1) #define SOCK2OFFSET(sockfd) ((sockfd * FNV_MAGIC_PRIME) & SOCKOFFSET_MASK) #define MAX_QUEUES (8) /* * Structure defining a list of packets (incoming or outgoing) * that should be managed. */ struct fr_packet_list_t { rbtree_t *tree; fr_hash_table_t *dst2id_ht; int alloc_id; int num_outgoing; uint32_t mask; int last_recv; fr_packet_socket_t sockets[MAX_SOCKETS]; }; /* * Ugh. Doing this on every sent/received packet is not nice. */ static fr_packet_socket_t *fr_socket_find(fr_packet_list_t *pl, int sockfd) { int i, start; i = start = SOCK2OFFSET(sockfd); do { /* make this hack slightly more efficient */ if (pl->sockets[i].sockfd == sockfd) return &pl->sockets[i]; i = (i + 1) & SOCKOFFSET_MASK; } while (i != start); return NULL; } int fr_packet_list_socket_remove(fr_packet_list_t *pl, int sockfd) { fr_packet_socket_t *ps; if (!pl) return 0; ps = fr_socket_find(pl, sockfd); if (!ps) return 0; /* * FIXME: Allow the caller forcibly discard these? */ if (ps->num_outgoing != 0) return 0; ps->sockfd = -1; pl->mask &= ~(1 << ps->offset); return 1; } int fr_packet_list_socket_add(fr_packet_list_t *pl, int sockfd) { int i, start; struct sockaddr_storage src; socklen_t sizeof_src = sizeof(src); fr_packet_socket_t *ps; if (!pl) return 0; ps = NULL; i = start = SOCK2OFFSET(sockfd); do { if (pl->sockets[i].sockfd == -1) { ps = &pl->sockets[i]; start = i; break; } i = (i + 1) & SOCKOFFSET_MASK; } while (i != start); if (!ps) { return 0; } memset(ps, 0, sizeof(*ps)); ps->sockfd = sockfd; ps->offset = start; /* * Get address family, etc. first, so we know if we * need to do udpfromto. * * FIXME: udpfromto also does this, but it's not * a critical problem. */ memset(&src, 0, sizeof_src); if (getsockname(sockfd, (struct sockaddr *) &src, &sizeof_src) < 0) { return 0; } if (!fr_sockaddr2ipaddr(&src, sizeof_src, &ps->ipaddr, &ps->port)) { return 0; } /* * Grab IP addresses & ports from the sockaddr. */ if (src.ss_family == AF_INET) { if (ps->ipaddr.ipaddr.ip4addr.s_addr == INADDR_ANY) { ps->inaddr_any = 1; } #ifdef HAVE_STRUCT_SOCKADDR_IN6 } else if (src.ss_family == AF_INET6) { if (IN6_IS_ADDR_UNSPECIFIED(&ps->ipaddr.ipaddr.ip6addr)) { ps->inaddr_any = 1; } #endif } else { return 0; } pl->mask |= (1 << ps->offset); return 1; } static int packet_entry_cmp(const void *one, const void *two) { const RADIUS_PACKET * const *a = one; const RADIUS_PACKET * const *b = two; if (!a || !*a || !b || !*b) return -1; /* work-around for bug #35 */ return fr_packet_cmp(*a, *b); } /* * A particular socket can have 256 RADIUS ID's outstanding to * any one destination IP/port. So we have a structure that * manages destination IP & port, and has an array of 256 ID's. * * The only magic here is that we map the socket number (0..256) * into an "internal" socket number 0..31, that we use to set * bits in the ID array. If a bit is 1, then that ID is in use * for that socket, and the request MUST be in the packet hash! * * Note that as a minor memory leak, we don't have an API to free * this structure, except when we discard the whole packet list. * This means that if destinations are added and removed, they * won't be removed from this tree. */ typedef struct fr_packet_dst2id_t { fr_ipaddr_t dst_ipaddr; int dst_port; uint32_t id[1]; /* really id[256] */ } fr_packet_dst2id_t; static uint32_t packet_dst2id_hash(const void *data) { uint32_t hash; const fr_packet_dst2id_t *pd = data; hash = fr_hash(&pd->dst_port, sizeof(pd->dst_port)); switch (pd->dst_ipaddr.af) { case AF_INET: hash = fr_hash_update(&pd->dst_ipaddr.ipaddr.ip4addr, sizeof(pd->dst_ipaddr.ipaddr.ip4addr), hash); break; case AF_INET6: hash = fr_hash_update(&pd->dst_ipaddr.ipaddr.ip6addr, sizeof(pd->dst_ipaddr.ipaddr.ip6addr), hash); break; default: break; } return hash; } static int packet_dst2id_cmp(const void *one, const void *two) { const fr_packet_dst2id_t *a = one; const fr_packet_dst2id_t *b = two; if (a->dst_port < b->dst_port) return -1; if (a->dst_port > b->dst_port) return +1; return fr_ipaddr_cmp(&a->dst_ipaddr, &b->dst_ipaddr); } static void packet_dst2id_free(void *data) { free(data); } void fr_packet_list_free(fr_packet_list_t *pl) { if (!pl) return; rbtree_free(pl->tree); fr_hash_table_free(pl->dst2id_ht); free(pl); } /* * Caller is responsible for managing the packet entries. */ fr_packet_list_t *fr_packet_list_create(int alloc_id) { int i; fr_packet_list_t *pl; pl = malloc(sizeof(*pl)); if (!pl) return NULL; memset(pl, 0, sizeof(*pl)); pl->tree = rbtree_create(packet_entry_cmp, NULL, 0); if (!pl->tree) { fr_packet_list_free(pl); return NULL; } for (i = 0; i < MAX_SOCKETS; i++) { pl->sockets[i].sockfd = -1; } if (alloc_id) { pl->alloc_id = 1; pl->dst2id_ht = fr_hash_table_create(packet_dst2id_hash, packet_dst2id_cmp, packet_dst2id_free); if (!pl->dst2id_ht) { fr_packet_list_free(pl); return NULL; } } return pl; } /* * If pl->alloc_id is set, then fr_packet_list_id_alloc() MUST * be called before inserting the packet into the list! */ int fr_packet_list_insert(fr_packet_list_t *pl, RADIUS_PACKET **request_p) { if (!pl || !request_p || !*request_p) return 0; return rbtree_insert(pl->tree, request_p); } RADIUS_PACKET **fr_packet_list_find(fr_packet_list_t *pl, RADIUS_PACKET *request) { if (!pl || !request) return 0; return rbtree_finddata(pl->tree, &request); } /* * This presumes that the reply has dst_ipaddr && dst_port set up * correctly (i.e. real IP, or "*"). */ RADIUS_PACKET **fr_packet_list_find_byreply(fr_packet_list_t *pl, RADIUS_PACKET *reply) { RADIUS_PACKET my_request, *request; fr_packet_socket_t *ps; if (!pl || !reply) return NULL; ps = fr_socket_find(pl, reply->sockfd); if (!ps) return NULL; /* * Initialize request from reply, AND from the source * IP & port of this socket. The client may have bound * the socket to 0, in which case it's some random port, * that is NOT in the original request->src_port. */ my_request.sockfd = reply->sockfd; my_request.id = reply->id; if (ps->inaddr_any) { my_request.src_ipaddr = ps->ipaddr; } else { my_request.src_ipaddr = reply->dst_ipaddr; } my_request.src_port = ps->port;; my_request.dst_ipaddr = reply->src_ipaddr; my_request.dst_port = reply->src_port; request = &my_request; return rbtree_finddata(pl->tree, &request); } RADIUS_PACKET **fr_packet_list_yank(fr_packet_list_t *pl, RADIUS_PACKET *request) { RADIUS_PACKET **packet_p; if (!pl || !request) return NULL; packet_p = rbtree_finddata(pl->tree, &request); if (!packet_p) return NULL; rbtree_deletebydata(pl->tree, packet_p); return packet_p; } int fr_packet_list_num_elements(fr_packet_list_t *pl) { if (!pl) return 0; return rbtree_num_elements(pl->tree); } /* * 1 == ID was allocated & assigned * 0 == error allocating memory * -1 == all ID's are used, caller should open a new socket. * * Note that this ALSO assigns a socket to use, and updates * packet->request->src_ipaddr && packet->request->src_port * * In multi-threaded systems, the calls to id_alloc && id_free * should be protected by a mutex. This does NOT have to be * the same mutex as the one protecting the insert/find/yank * calls! */ int fr_packet_list_id_alloc(fr_packet_list_t *pl, RADIUS_PACKET *request) { int i, id, start; int src_any = 0; uint32_t free_mask; fr_packet_dst2id_t my_pd, *pd; fr_packet_socket_t *ps; if (!pl || !pl->alloc_id || !request) { fr_strerror_printf("Invalid arguments"); return 0; } /* * Error out if no destination is specified. */ if ((request->dst_ipaddr.af == AF_UNSPEC) || (request->dst_port == 0)) { fr_strerror_printf("No destination address/port specified"); return 0; } /* * Special case: unspec == "don't care" */ if (request->src_ipaddr.af == AF_UNSPEC) { memset(&request->src_ipaddr, 0, sizeof(request->src_ipaddr)); request->src_ipaddr.af = request->dst_ipaddr.af; } src_any = fr_inaddr_any(&request->src_ipaddr); if (src_any < 0) { fr_strerror_printf("Error checking src IP address"); return 0; } /* * MUST specify a destination address. */ if (fr_inaddr_any(&request->dst_ipaddr) != 0) { fr_strerror_printf("Error checking dst IP address"); return 0; } my_pd.dst_ipaddr = request->dst_ipaddr; my_pd.dst_port = request->dst_port; pd = fr_hash_table_finddata(pl->dst2id_ht, &my_pd); if (!pd) { pd = malloc(sizeof(*pd) + 255 * sizeof(pd->id[0])); if (!pd) return 0; memset(pd, 0, sizeof(*pd) + 255 * sizeof(pd->id[0])); pd->dst_ipaddr = request->dst_ipaddr; pd->dst_port = request->dst_port; if (!fr_hash_table_insert(pl->dst2id_ht, pd)) { free(pd); fr_strerror_printf("Failed inserting into hash"); return 0; } } /* * FIXME: Go to an LRU system. This prevents ID re-use * for as long as possible. The main problem with that * approach is that it requires us to populate the * LRU/FIFO when we add a new socket, or a new destination, * which can be expensive. * * The LRU can be avoided if the caller takes care to free * Id's only when all responses have been received, OR after * a timeout. */ id = start = (int) fr_rand() & 0xff; while (pd->id[id] == pl->mask) { /* all sockets are using this ID */ id++; id &= 0xff; if (id == start) { fr_strerror_printf("All IDs are being used"); return 0; } } free_mask = ~((~pd->id[id]) & pl->mask); start = -1; for (i = 0; i < MAX_SOCKETS; i++) { if (pl->sockets[i].sockfd == -1) continue; /* paranoia */ ps = &(pl->sockets[i]); /* * Address families don't match, skip it. */ if (ps->ipaddr.af != request->dst_ipaddr.af) continue; /* * We're sourcing from *, and they asked for a * specific source address: ignore it. */ if (ps->inaddr_any && !src_any) continue; /* * We're sourcing from a specific IP, and they * asked for a source IP that isn't us: ignore * it. */ if (!ps->inaddr_any && !src_any && (fr_ipaddr_cmp(&request->src_ipaddr, &ps->ipaddr) != 0)) continue; if ((free_mask & (1 << i)) == 0) { start = i; break; } } if (start < 0) { fr_strerror_printf("Internal sanity check failed"); return 0; /* bad error */ } pd->id[id] |= (1 << start); ps = &pl->sockets[start]; ps->num_outgoing++; pl->num_outgoing++; /* * Set the ID, source IP, and source port. */ request->id = id; request->sockfd = ps->sockfd; request->src_ipaddr = ps->ipaddr; request->src_port = ps->port; return 1; } /* * Should be called AFTER yanking it from the list, so that * any newly inserted entries don't collide with this one. */ int fr_packet_list_id_free(fr_packet_list_t *pl, RADIUS_PACKET *request) { fr_packet_socket_t *ps; fr_packet_dst2id_t my_pd, *pd; if (!pl || !request) return 0; ps = fr_socket_find(pl, request->sockfd); if (!ps) return 0; my_pd.dst_ipaddr = request->dst_ipaddr; my_pd.dst_port = request->dst_port; pd = fr_hash_table_finddata(pl->dst2id_ht, &my_pd); if (!pd) return 0; pd->id[request->id] &= ~(1 << ps->offset); ps->num_outgoing--; pl->num_outgoing--; return 1; } int fr_packet_list_walk(fr_packet_list_t *pl, void *ctx, fr_hash_table_walk_t callback) { if (!pl || !callback) return 0; return rbtree_walk(pl->tree, InOrder, callback, ctx); } int fr_packet_list_fd_set(fr_packet_list_t *pl, fd_set *set) { int i, maxfd; if (!pl || !set) return 0; maxfd = -1; for (i = 0; i < MAX_SOCKETS; i++) { if (pl->sockets[i].sockfd == -1) continue; FD_SET(pl->sockets[i].sockfd, set); if (pl->sockets[i].sockfd > maxfd) { maxfd = pl->sockets[i].sockfd; } } if (maxfd < 0) return -1; return maxfd + 1; } /* * Round-robins the receivers, without priority. * * FIXME: Add sockfd, if -1, do round-robin, else do sockfd * IF in fdset. */ RADIUS_PACKET *fr_packet_list_recv(fr_packet_list_t *pl, fd_set *set) { int start; RADIUS_PACKET *packet; if (!pl || !set) return NULL; start = pl->last_recv; do { start++; start &= SOCKOFFSET_MASK; if (pl->sockets[start].sockfd == -1) continue; if (!FD_ISSET(pl->sockets[start].sockfd, set)) continue; packet = rad_recv(pl->sockets[start].sockfd, 0); if (!packet) continue; /* * Call fr_packet_list_find_byreply(). If it * doesn't find anything, discard the reply. */ pl->last_recv = start; return packet; } while (start != pl->last_recv); return NULL; } int fr_packet_list_num_incoming(fr_packet_list_t *pl) { int num_elements; if (!pl) return 0; num_elements = rbtree_num_elements(pl->tree); if (num_elements < pl->num_outgoing) return 0; /* panic! */ return num_elements - pl->num_outgoing; } int fr_packet_list_num_outgoing(fr_packet_list_t *pl) { if (!pl) return 0; return pl->num_outgoing; } freeradius-server/src/lib/print.c000066400000000000000000000234721257552170400173700ustar00rootroot00000000000000/* * print.c Routines to print stuff. * * Version: $Id$ * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2000,2006 The FreeRADIUS server project */ #include RCSID("$Id$") #include #include /* * Checks for utf-8, taken from: * * http://www.w3.org/International/questions/qa-forms-utf-8 * * Note that we don't care about the length of the input string, * because '\0' is an invalid UTF-8 character. */ int fr_utf8_char(const uint8_t *str) { if (*str < 0x20) return 0; if (*str <= 0x7e) return 1; /* 1 */ if (*str <= 0xc1) return 0; if ((str[0] >= 0xc2) && /* 2 */ (str[0] <= 0xdf) && (str[1] >= 0x80) && (str[1] <= 0xbf)) { return 2; } if ((str[0] == 0xe0) && /* 3 */ (str[1] >= 0xa0) && (str[1] <= 0xbf) && (str[2] >= 0x80) && (str[2] <= 0xbf)) { return 3; } if ((str[0] >= 0xe1) && /* 4a */ (str[0] <= 0xec) && (str[1] >= 0x80) && (str[1] <= 0xbf) && (str[2] >= 0x80) && (str[2] <= 0xbf)) { return 3; } if ((str[0] >= 0xee) && /* 4b */ (str[0] <= 0xef) && (str[1] >= 0x80) && (str[1] <= 0xbf) && (str[2] >= 0x80) && (str[2] <= 0xbf)) { return 3; } if ((str[0] == 0xed) && /* 5 */ (str[1] >= 0x80) && (str[1] <= 0x9f) && (str[2] >= 0x80) && (str[2] <= 0xbf)) { return 3; } if ((str[0] == 0xf0) && /* 6 */ (str[1] >= 0x90) && (str[1] <= 0xbf) && (str[2] >= 0x80) && (str[2] <= 0xbf) && (str[3] >= 0x80) && (str[3] <= 0xbf)) { return 4; } if ((str[0] >= 0xf1) && /* 6 */ (str[1] <= 0xf3) && (str[1] >= 0x80) && (str[1] <= 0xbf) && (str[2] >= 0x80) && (str[2] <= 0xbf) && (str[3] >= 0x80) && (str[3] <= 0xbf)) { return 4; } if ((str[0] == 0xf4) && /* 7 */ (str[1] >= 0x80) && (str[1] <= 0x8f) && (str[2] >= 0x80) && (str[2] <= 0xbf) && (str[3] >= 0x80) && (str[3] <= 0xbf)) { return 4; } /* * Invalid UTF-8 Character */ return 0; } /* * Convert a string to something printable. The output string * has to be larger than the input string by at least 5 bytes. * If not, the output is silently truncated... */ size_t fr_print_string(const char *in, size_t inlen, char *out, size_t outlen) { const char *start = out; const uint8_t *str = (const uint8_t *) in; int sp = 0; int utf8 = 0; if (inlen == 0) inlen = strlen(in); /* * */ while ((inlen > 0) && (outlen > 4)) { /* * Hack: never print trailing zero. * Some clients send strings with an off-by-one * length (confused with strings in C). */ if ((inlen == 1) && (*str == 0)) break; switch (*str) { case '\\': sp = '\\'; break; case '\r': sp = 'r'; break; case '\n': sp = 'n'; break; case '\t': sp = 't'; break; case '"': sp = '"'; break; default: sp = 0; break; } if (sp) { *out++ = '\\'; *out++ = sp; outlen -= 2; str++; inlen--; continue; } utf8 = fr_utf8_char(str); if (!utf8) { snprintf(out, outlen, "\\%03o", *str); out += 4; outlen -= 4; str++; inlen--; continue; } do { *out++ = *str++; outlen--; inlen--; } while (--utf8 > 0); } *out = 0; return out - start; } /* * Print one value into a string. * delimitst will define if strings and dates will be delimited by '"' */ int vp_prints_value(char * out, size_t outlen, VALUE_PAIR *vp, int delimitst) { DICT_VALUE *v; char buf[1024]; const char *a = NULL; size_t len; time_t t; struct tm s_tm; out[0] = '\0'; if (!vp) return 0; switch (vp->type) { case PW_TYPE_STRING: if ((delimitst == 1) && vp->flags.has_tag) { /* Tagged attribute: print delimter and ignore tag */ buf[0] = '"'; fr_print_string(vp->vp_strvalue, vp->length, buf + 1, sizeof(buf) - 2); strcat(buf, "\""); } else if (delimitst == 1) { /* Non-tagged attribute: print delimter */ buf[0] = '"'; fr_print_string(vp->vp_strvalue, vp->length, buf + 1, sizeof(buf) - 2); strcat(buf, "\""); } else if (delimitst < 0) { /* xlat.c */ strlcpy(out, vp->vp_strvalue, outlen); return strlen(out); } else { /* Non-tagged attribute: no delimiter */ fr_print_string(vp->vp_strvalue, vp->length, buf, sizeof(buf)); } a = buf; break; case PW_TYPE_INTEGER: if ( vp->flags.has_tag ) { /* Attribute value has a tag, need to ignore it */ if ((v = dict_valbyattr(vp->attribute, (vp->vp_integer & 0xffffff))) != NULL) a = v->name; else { snprintf(buf, sizeof(buf), "%u", (vp->vp_integer & 0xffffff)); a = buf; } } else { case PW_TYPE_BYTE: case PW_TYPE_SHORT: /* Normal, non-tagged attribute */ if ((v = dict_valbyattr(vp->attribute, vp->vp_integer)) != NULL) a = v->name; else { snprintf(buf, sizeof(buf), "%u", vp->vp_integer); a = buf; } } break; case PW_TYPE_DATE: t = vp->vp_date; if (delimitst == 1) { len = strftime(buf, sizeof(buf), "\"%b %e %Y %H:%M:%S %Z\"", localtime_r(&t, &s_tm)); } else { len = strftime(buf, sizeof(buf), "%b %e %Y %H:%M:%S %Z", localtime_r(&t, &s_tm)); } if (len > 0) a = buf; break; case PW_TYPE_SIGNED: /* Damned code for 1 WiMAX attribute */ snprintf(buf, sizeof(buf), "%d", vp->vp_signed); a = buf; break; case PW_TYPE_IPADDR: a = inet_ntop(AF_INET, &(vp->vp_ipaddr), buf, sizeof(buf)); break; case PW_TYPE_ABINARY: #ifdef ASCEND_BINARY a = buf; print_abinary(vp, buf, sizeof(buf), delimitst); break; #else /* FALL THROUGH */ #endif case PW_TYPE_OCTETS: if (outlen <= (2 * (vp->length + 1))) return 0; strcpy(buf, "0x"); fr_bin2hex(vp->vp_octets, buf + 2, vp->length); a = buf; break; case PW_TYPE_IFID: a = ifid_ntoa(buf, sizeof(buf), vp->vp_octets); break; case PW_TYPE_IPV6ADDR: a = inet_ntop(AF_INET6, (const struct in6_addr *) vp->vp_strvalue, buf, sizeof(buf)); break; case PW_TYPE_IPV6PREFIX: { struct in6_addr addr; /* * Alignment issues. */ memcpy(&addr, vp->vp_strvalue + 2, sizeof(addr)); a = inet_ntop(AF_INET6, &addr, buf, sizeof(buf)); if (a) { char *p = buf + strlen(buf); snprintf(p, buf + sizeof(buf) - p - 1, "/%u", (unsigned int) vp->vp_octets[1]); } } break; case PW_TYPE_ETHERNET: snprintf(buf, sizeof(buf), "%02x:%02x:%02x:%02x:%02x:%02x", vp->vp_ether[0], vp->vp_ether[1], vp->vp_ether[2], vp->vp_ether[3], vp->vp_ether[4], vp->vp_ether[5]); a = buf; break; case PW_TYPE_TLV: if (outlen <= (2 * (vp->length + 1))) return 0; strcpy(buf, "0x"); fr_bin2hex(vp->vp_tlv, buf + 2, vp->length); a = buf; break; default: a = "UNKNOWN-TYPE"; break; } if (a != NULL) strlcpy(out, a, outlen); return strlen(out); } /* * This is a hack, and has to be kept in sync with tokens.h */ static const char *vp_tokens[] = { "?", /* T_OP_INVALID */ "EOL", /* T_EOL */ "{", "}", "(", ")", ",", ";", "+=", "-=", ":=", "=", "!=", ">=", ">", "<=", "<", "=~", "!~", "=*", "!*", "==", "#", "", "<\"STRING\">", "<'STRING'>", "<`STRING`>" }; const char *vp_print_name(char *buffer, size_t bufsize, int attr) { int vendor; size_t len = 0; if (!buffer) return NULL; vendor = VENDOR(attr); if (vendor) { DICT_VENDOR *v; v = dict_vendorbyvalue(vendor); if (v) { snprintf(buffer, bufsize, "%s-", v->name); } else { snprintf(buffer, bufsize, "Vendor-%u-", vendor); } len = strlen(buffer); if (len == bufsize) { return NULL; } } snprintf(buffer + len, bufsize - len, "Attr-%u", attr & 0xffff); len += strlen(buffer + len); if (len == bufsize) { return NULL; } return buffer; } /* * Print one attribute and value into a string. */ int vp_prints(char *out, size_t outlen, VALUE_PAIR *vp) { size_t len; const char *token = NULL; const char *name; char namebuf[128]; out[0] = 0; if (!vp) return 0; name = vp->name; len = 0; if (!name || !*name) { if (!vp_print_name(namebuf, sizeof(namebuf), vp->attribute)) { return 0; } name = namebuf; } if ((vp->operator > T_OP_INVALID) && (vp->operator < T_TOKEN_LAST)) { token = vp_tokens[vp->operator]; } else { token = ""; } if( vp->flags.has_tag ) { snprintf(out, outlen, "%s:%d %s ", name, vp->flags.tag, token); len = strlen(out); vp_prints_value(out + len, outlen - len, vp, 1); } else { snprintf(out, outlen, "%s %s ", name, token); len = strlen(out); vp_prints_value(out + len, outlen - len, vp, 1); } return len + strlen(out + len); } /* * Print one attribute and value. */ void vp_print(FILE *fp, VALUE_PAIR *vp) { char buf[1024]; vp_prints(buf, sizeof(buf), vp); fputc('\t', fp); fputs(buf, fp); fputc('\n', fp); } /* * Print a whole list of attributes, indented by a TAB * and with a newline at the end. */ void vp_printlist(FILE *fp, VALUE_PAIR *vp) { for (; vp; vp = vp->next) { vp_print(fp, vp); } } freeradius-server/src/lib/radius.c000066400000000000000000002462571257552170400175330ustar00rootroot00000000000000/* * radius.c Functions to send/receive radius packets. * * Version: $Id$ * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2000-2003,2006 The FreeRADIUS server project */ #include RCSID("$Id$") #include #include #include #include #ifdef WITH_UDPFROMTO #include #endif #ifdef HAVE_MALLOC_H #include #endif /* * The RFC says 4096 octets max, and most packets are less than 256. */ #define MAX_PACKET_LEN 4096 /* * The maximum number of attributes which we allow in an incoming * request. If there are more attributes than this, the request * is rejected. * * This helps to minimize the potential for a DoS, when an * attacker spoofs Access-Request packets, which don't have a * Message-Authenticator attribute. This means that the packet * is unsigned, and the attacker can use resources on the server, * even if the end request is rejected. */ int fr_max_attributes = 0; FILE *fr_log_fp = NULL; typedef struct radius_packet_t { uint8_t code; uint8_t id; uint8_t length[2]; uint8_t vector[AUTH_VECTOR_LEN]; uint8_t data[1]; } radius_packet_t; static fr_randctx fr_rand_pool; /* across multiple calls */ static int fr_rand_initialized = 0; static unsigned int salt_offset = 0; static uint8_t nullvector[AUTH_VECTOR_LEN] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; /* for CoA decode */ const char *fr_packet_codes[FR_MAX_PACKET_CODE] = { "", "Access-Request", "Access-Accept", "Access-Reject", "Accounting-Request", "Accounting-Response", "Accounting-Status", "Password-Request", "Password-Accept", "Password-Reject", "Accounting-Message", "Access-Challenge", "Status-Server", "Status-Client", "14", "15", "16", "17", "18", "19", "20", "Resource-Free-Request", "Resource-Free-Response", "Resource-Query-Request", "Resource-Query-Response", "Alternate-Resource-Reclaim-Request", "NAS-Reboot-Request", "NAS-Reboot-Response", "28", "Next-Passcode", "New-Pin", "Terminate-Session", "Password-Expired", "Event-Request", "Event-Response", "35", "36", "37", "38", "39", "Disconnect-Request", "Disconnect-ACK", "Disconnect-NAK", "CoA-Request", "CoA-ACK", "CoA-NAK", "46", "47", "48", "49", "IP-Address-Allocate", "IP-Address-Release" }; void fr_printf_log(const char *fmt, ...) { va_list ap; va_start(ap, fmt); if ((fr_debug_flag == 0) || !fr_log_fp) { va_end(ap); return; } vfprintf(fr_log_fp, fmt, ap); va_end(ap); return; } void rad_print_hex(RADIUS_PACKET *packet) { int i; if (!packet->data) return; printf(" Code:\t\t%u\n", packet->data[0]); printf(" Id:\t\t%u\n", packet->data[1]); printf(" Length:\t%u\n", ((packet->data[2] << 8) | (packet->data[3]))); printf(" Vector:\t"); for (i = 4; i < 20; i++) { printf("%02x", packet->data[i]); } printf("\n"); if (packet->data_len > 20) { int total; const uint8_t *ptr; printf(" Data:"); total = packet->data_len - 20; ptr = packet->data + 20; while (total > 0) { int attrlen; printf("\t\t"); if (total < 2) { /* too short */ printf("%02x\n", *ptr); break; } if (ptr[1] > total) { /* too long */ for (i = 0; i < total; i++) { printf("%02x ", ptr[i]); } break; } printf("%02x %02x ", ptr[0], ptr[1]); attrlen = ptr[1] - 2; ptr += 2; total -= 2; for (i = 0; i < attrlen; i++) { if ((i > 0) && ((i & 0x0f) == 0x00)) printf("\t\t\t"); printf("%02x ", ptr[i]); if ((i & 0x0f) == 0x0f) printf("\n"); } if ((attrlen & 0x0f) != 0x00) printf("\n"); ptr += attrlen; total -= attrlen; } } fflush(stdout); } /* * Wrapper for sendto which handles sendfromto, IPv6, and all * possible combinations. */ static int rad_sendto(int sockfd, void *data, size_t data_len, int flags, fr_ipaddr_t *src_ipaddr, int src_port, fr_ipaddr_t *dst_ipaddr, int dst_port) { int rcode; struct sockaddr_storage dst; socklen_t sizeof_dst; #ifdef WITH_UDPFROMTO struct sockaddr_storage src; socklen_t sizeof_src; fr_ipaddr2sockaddr(src_ipaddr, src_port, &src, &sizeof_src); #else src_port = src_port; /* -Wunused */ #endif if (!fr_ipaddr2sockaddr(dst_ipaddr, dst_port, &dst, &sizeof_dst)) { return -1; } #ifdef WITH_UDPFROMTO /* * And if they don't specify a source IP address, don't * use udpfromto. */ if (((dst_ipaddr->af == AF_INET) || (dst_ipaddr->af == AF_INET6)) && (src_ipaddr->af != AF_UNSPEC) && !fr_inaddr_any(src_ipaddr)) { rcode = sendfromto(sockfd, data, data_len, flags, (struct sockaddr *)&src, sizeof_src, (struct sockaddr *)&dst, sizeof_dst); goto done; } #else src_ipaddr = src_ipaddr; /* -Wunused */ #endif /* * No udpfromto, fail gracefully. */ rcode = sendto(sockfd, data, data_len, flags, (struct sockaddr *) &dst, sizeof_dst); #ifdef WITH_UDPFROMTO done: #endif if (rcode < 0) { DEBUG("rad_send() failed: %s\n", strerror(errno)); } return rcode; } void rad_recv_discard(int sockfd) { uint8_t header[4]; struct sockaddr_storage src; socklen_t sizeof_src = sizeof(src); recvfrom(sockfd, header, sizeof(header), 0, (struct sockaddr *)&src, &sizeof_src); } ssize_t rad_recv_header(int sockfd, fr_ipaddr_t *src_ipaddr, int *src_port, int *code) { ssize_t data_len, packet_len; uint8_t header[4]; struct sockaddr_storage src; socklen_t sizeof_src = sizeof(src); data_len = recvfrom(sockfd, header, sizeof(header), MSG_PEEK, (struct sockaddr *)&src, &sizeof_src); if (data_len < 0) { if ((errno == EAGAIN) || (errno == EINTR)) return 0; return -1; } /* * Too little data is available, discard the packet. */ if (data_len < 4) { recvfrom(sockfd, header, sizeof(header), 0, (struct sockaddr *)&src, &sizeof_src); return 1; } else { /* we got 4 bytes of data. */ /* * See how long the packet says it is. */ packet_len = (header[2] * 256) + header[3]; /* * The length in the packet says it's less than * a RADIUS header length: discard it. */ if (packet_len < AUTH_HDR_LEN) { recvfrom(sockfd, header, sizeof(header), 0, (struct sockaddr *)&src, &sizeof_src); return 1; /* * Enforce RFC requirements, for sanity. * Anything after 4k will be discarded. */ } else if (packet_len > MAX_PACKET_LEN) { recvfrom(sockfd, header, sizeof(header), 0, (struct sockaddr *)&src, &sizeof_src); return 1; } } /* * Convert AF. If unknown, discard packet. */ if (!fr_sockaddr2ipaddr(&src, sizeof_src, src_ipaddr, src_port)) { recvfrom(sockfd, header, sizeof(header), 0, (struct sockaddr *)&src, &sizeof_src); return 1; } *code = header[0]; /* * The packet says it's this long, but the actual UDP * size could still be smaller. */ return packet_len; } /* * wrapper for recvfrom, which handles recvfromto, IPv6, and all * possible combinations. */ static ssize_t rad_recvfrom(int sockfd, uint8_t **pbuf, int flags, fr_ipaddr_t *src_ipaddr, uint16_t *src_port, fr_ipaddr_t *dst_ipaddr, uint16_t *dst_port) { struct sockaddr_storage src; struct sockaddr_storage dst; socklen_t sizeof_src = sizeof(src); socklen_t sizeof_dst = sizeof(dst); ssize_t data_len; uint8_t header[4]; void *buf; size_t len; int port; memset(&src, 0, sizeof_src); memset(&dst, 0, sizeof_dst); /* * Get address family, etc. first, so we know if we * need to do udpfromto. * * FIXME: udpfromto also does this, but it's not * a critical problem. */ if (getsockname(sockfd, (struct sockaddr *)&dst, &sizeof_dst) < 0) return -1; /* * Read the length of the packet, from the packet. * This lets us allocate the buffer to use for * reading the rest of the packet. */ data_len = recvfrom(sockfd, header, sizeof(header), MSG_PEEK, (struct sockaddr *)&src, &sizeof_src); if (data_len < 0) { if ((errno == EAGAIN) || (errno == EINTR)) return 0; return -1; } /* * Too little data is available, discard the packet. */ if (data_len < 4) { recvfrom(sockfd, header, sizeof(header), flags, (struct sockaddr *)&src, &sizeof_src); return 0; } else { /* we got 4 bytes of data. */ /* * See how long the packet says it is. */ len = (header[2] * 256) + header[3]; /* * The length in the packet says it's less than * a RADIUS header length: discard it. */ if (len < AUTH_HDR_LEN) { recvfrom(sockfd, header, sizeof(header), flags, (struct sockaddr *)&src, &sizeof_src); return 0; /* * Enforce RFC requirements, for sanity. * Anything after 4k will be discarded. */ } else if (len > MAX_PACKET_LEN) { recvfrom(sockfd, header, sizeof(header), flags, (struct sockaddr *)&src, &sizeof_src); return len; } } buf = malloc(len); if (!buf) return -1; /* * Receive the packet. The OS will discard any data in the * packet after "len" bytes. */ #ifdef WITH_UDPFROMTO if ((dst.ss_family == AF_INET) || (dst.ss_family == AF_INET6)) { data_len = recvfromto(sockfd, buf, len, flags, (struct sockaddr *)&src, &sizeof_src, (struct sockaddr *)&dst, &sizeof_dst); } else #endif /* * No udpfromto, fail gracefully. */ data_len = recvfrom(sockfd, buf, len, flags, (struct sockaddr *)&src, &sizeof_src); if (data_len < 0) { free(buf); return data_len; } if (!fr_sockaddr2ipaddr(&src, sizeof_src, src_ipaddr, &port)) { free(buf); return -1; /* Unknown address family, Die Die Die! */ } *src_port = port; fr_sockaddr2ipaddr(&dst, sizeof_dst, dst_ipaddr, &port); *dst_port = port; /* * Different address families should never happen. */ if (src.ss_family != dst.ss_family) { free(buf); return -1; } /* * Tell the caller about the data */ *pbuf = buf; return data_len; } #define AUTH_PASS_LEN (AUTH_VECTOR_LEN) /************************************************************************* * * Function: make_secret * * Purpose: Build an encrypted secret value to return in a reply * packet. The secret is hidden by xoring with a MD5 digest * created from the shared secret and the authentication * vector. We put them into MD5 in the reverse order from * that used when encrypting passwords to RADIUS. * *************************************************************************/ static void make_secret(uint8_t *digest, const uint8_t *vector, const char *secret, const uint8_t *value) { FR_MD5_CTX context; int i; fr_MD5Init(&context); fr_MD5Update(&context, vector, AUTH_VECTOR_LEN); fr_MD5Update(&context, (const uint8_t *) secret, strlen(secret)); fr_MD5Final(digest, &context); for ( i = 0; i < AUTH_VECTOR_LEN; i++ ) { digest[i] ^= value[i]; } } #define MAX_PASS_LEN (128) static void make_passwd(uint8_t *output, size_t *outlen, const uint8_t *input, size_t inlen, const char *secret, const uint8_t *vector) { FR_MD5_CTX context, old; uint8_t digest[AUTH_VECTOR_LEN]; uint8_t passwd[MAX_PASS_LEN]; int i, n; int len; /* * If the length is zero, round it up. */ len = inlen; if (len > MAX_PASS_LEN) len = MAX_PASS_LEN; memcpy(passwd, input, len); if (len < sizeof(passwd)) memset(passwd + len, 0, sizeof(passwd) - len); if (len == 0) { len = AUTH_PASS_LEN; } else if ((len & 0x0f) != 0) { len += 0x0f; len &= ~0x0f; } *outlen = len; fr_MD5Init(&context); fr_MD5Update(&context, (const uint8_t *) secret, strlen(secret)); old = context; /* * Do first pass. */ fr_MD5Update(&context, vector, AUTH_PASS_LEN); for (n = 0; n < len; n += AUTH_PASS_LEN) { if (n > 0) { context = old; fr_MD5Update(&context, passwd + n - AUTH_PASS_LEN, AUTH_PASS_LEN); } fr_MD5Final(digest, &context); for (i = 0; i < AUTH_PASS_LEN; i++) { passwd[i + n] ^= digest[i]; } } memcpy(output, passwd, len); } static void make_tunnel_passwd(uint8_t *output, size_t *outlen, const uint8_t *input, size_t inlen, size_t room, const char *secret, const uint8_t *vector) { FR_MD5_CTX context, old; uint8_t digest[AUTH_VECTOR_LEN]; uint8_t passwd[MAX_STRING_LEN + AUTH_VECTOR_LEN]; int i, n; int len; /* * Be paranoid. */ if (room > 253) room = 253; /* * Account for 2 bytes of the salt, and round the room * available down to the nearest multiple of 16. Then, * subtract one from that to account for the length byte, * and the resulting number is the upper bound on the data * to copy. * * We could short-cut this calculation just be forcing * inlen to be no more than 239. It would work for all * VSA's, as we don't pack multiple VSA's into one * attribute. * * However, this calculation is more general, if a little * complex. And it will work in the future for all possible * kinds of weird attribute packing. */ room -= 2; room -= (room & 0x0f); room--; if (inlen > room) inlen = room; /* * Length of the encrypted data is password length plus * one byte for the length of the password. */ len = inlen + 1; if ((len & 0x0f) != 0) { len += 0x0f; len &= ~0x0f; } *outlen = len + 2; /* account for the salt */ /* * Copy the password over. */ memcpy(passwd + 3, input, inlen); memset(passwd + 3 + inlen, 0, sizeof(passwd) - 3 - inlen); /* * Generate salt. The RFC's say: * * The high bit of salt[0] must be set, each salt in a * packet should be unique, and they should be random * * So, we set the high bit, add in a counter, and then * add in some CSPRNG data. should be OK.. */ passwd[0] = (0x80 | ( ((salt_offset++) & 0x0f) << 3) | (fr_rand() & 0x07)); passwd[1] = fr_rand(); passwd[2] = inlen; /* length of the password string */ fr_MD5Init(&context); fr_MD5Update(&context, (const uint8_t *) secret, strlen(secret)); old = context; fr_MD5Update(&context, vector, AUTH_VECTOR_LEN); fr_MD5Update(&context, &passwd[0], 2); for (n = 0; n < len; n += AUTH_PASS_LEN) { if (n > 0) { context = old; fr_MD5Update(&context, passwd + 2 + n - AUTH_PASS_LEN, AUTH_PASS_LEN); } fr_MD5Final(digest, &context); for (i = 0; i < AUTH_PASS_LEN; i++) { passwd[i + 2 + n] ^= digest[i]; } } memcpy(output, passwd, len + 2); } /* * Returns the end of the data. */ static uint8_t *vp2data(const RADIUS_PACKET *packet, const RADIUS_PACKET *original, const char *secret, const VALUE_PAIR *vp, uint8_t *ptr, size_t room) { uint32_t lvalue; size_t len; const uint8_t *data; uint8_t array[4]; /* * Set up the default sources for the data. */ data = vp->vp_octets; len = vp->length; switch(vp->type) { case PW_TYPE_STRING: case PW_TYPE_OCTETS: case PW_TYPE_IFID: case PW_TYPE_IPV6ADDR: case PW_TYPE_IPV6PREFIX: case PW_TYPE_ABINARY: /* nothing more to do */ break; case PW_TYPE_BYTE: len = 1; /* just in case */ array[0] = vp->vp_integer & 0xff; data = array; break; case PW_TYPE_SHORT: len = 2; /* just in case */ array[0] = (vp->vp_integer >> 8) & 0xff; array[1] = vp->vp_integer & 0xff; data = array; break; case PW_TYPE_INTEGER: len = 4; /* just in case */ lvalue = htonl(vp->vp_integer); memcpy(array, &lvalue, sizeof(lvalue)); data = array; break; case PW_TYPE_IPADDR: data = (const uint8_t *) &vp->vp_ipaddr; len = 4; /* just in case */ break; /* * There are no tagged date attributes. */ case PW_TYPE_DATE: lvalue = htonl(vp->vp_date); data = (const uint8_t *) &lvalue; len = 4; /* just in case */ break; case PW_TYPE_SIGNED: { int32_t slvalue; len = 4; /* just in case */ slvalue = htonl(vp->vp_signed); memcpy(array, &slvalue, sizeof(slvalue)); break; } case PW_TYPE_TLV: data = vp->vp_tlv; if (!data) { fr_strerror_printf("ERROR: Cannot encode NULL TLV"); return NULL; } break; default: /* unknown type: ignore it */ fr_strerror_printf("ERROR: Unknown attribute type %d", vp->type); return NULL; } /* * Bound the data to the calling size */ if (len > room) len = room; /* * Encrypt the various password styles * * Attributes with encrypted values MUST be less than * 128 bytes long. */ if (packet) switch (vp->flags.encrypt) { case FLAG_ENCRYPT_USER_PASSWORD: make_passwd(ptr, &len, data, len, secret, packet->vector); break; case FLAG_ENCRYPT_TUNNEL_PASSWORD: /* * Check if there's enough room. If there isn't, * we discard the attribute. * * This is ONLY a problem if we have multiple VSA's * in one Vendor-Specific, though. */ if (room < 18) return ptr; switch (packet->code) { case PW_AUTHENTICATION_ACK: case PW_AUTHENTICATION_REJECT: case PW_ACCESS_CHALLENGE: default: if (!original) { fr_strerror_printf("ERROR: No request packet, cannot encrypt %s attribute in the vp.", vp->name); return NULL; } make_tunnel_passwd(ptr, &len, data, len, room, secret, original->vector); break; case PW_ACCOUNTING_REQUEST: case PW_DISCONNECT_REQUEST: case PW_COA_REQUEST: make_tunnel_passwd(ptr, &len, data, len, room, secret, packet->vector); break; } break; /* * The code above ensures that this attribute * always fits. */ case FLAG_ENCRYPT_ASCEND_SECRET: #ifndef NDEBUG if (data == array) return NULL; #endif if (len != AUTH_VECTOR_LEN) return NULL; make_secret(ptr, packet->vector, secret, data); len = AUTH_VECTOR_LEN; break; default: /* * Just copy the data over */ memcpy(ptr, data, len); break; } else { /* no packet */ memcpy(ptr, data, len); } return ptr + len; } static VALUE_PAIR *rad_vp2tlv(VALUE_PAIR *vps) { int maxattr = 0; int length; unsigned int attribute; uint8_t *ptr, *end; VALUE_PAIR *vp, *tlv; attribute = vps->attribute & 0xffff00ff; maxattr = vps->attribute & 0x0ff; tlv = paircreate(attribute, PW_TYPE_TLV); if (!tlv) return NULL; tlv->length = 0; for (vp = vps; vp != NULL; vp = vp->next) { /* * Group the attributes ONLY until we see a * non-TLV attribute. */ if (!vp->flags.is_tlv || vp->flags.encoded || (vp->flags.encrypt != FLAG_ENCRYPT_NONE) || ((vp->attribute & 0xffff00ff) != attribute) || ((vp->attribute & 0x0000ff00) < maxattr)) { break; } maxattr = vp->attribute & 0xff00; tlv->length += vp->length + 2; } if (!tlv->length) { pairfree(&tlv); return NULL; } tlv->vp_tlv = malloc(tlv->length); if (!tlv->vp_tlv) { pairfree(&tlv); return NULL; } ptr = tlv->vp_tlv; maxattr = vps->attribute & 0x0ff; for (vp = vps; vp != NULL; vp = vp->next) { if (!vp->flags.is_tlv || vp->flags.encoded || (vp->flags.encrypt != FLAG_ENCRYPT_NONE) || ((vp->attribute & 0xffff00ff) != attribute) || ((vp->attribute & 0x0000ff00) < maxattr)) { break; } maxattr = vp->attribute & 0xff00; end = vp2data(NULL, NULL, NULL, vp, ptr + 2, tlv->vp_tlv + tlv->length - ptr); if (!end) { vp->length = ptr - vp->vp_tlv; return tlv; /* should be a more serious error... */ } length = (end - ptr); if (length > 255) { pairfree(&tlv); return NULL; } /* * Pack the attribute. */ ptr[0] = (vp->attribute & 0xff00) >> 8; ptr[1] = length; ptr += ptr[1]; vp->flags.encoded = 1; } return tlv; } /* * Pack data without any encryption. * start == start of RADIUS attribute * ptr == continuation byte (i.e. one after length) */ static int rad_vp2continuation(const VALUE_PAIR *vp, uint8_t *start, uint8_t *ptr) { size_t left, piece; size_t hsize = (ptr - start); uint8_t *this = start; const uint8_t *data; uint8_t header[16]; /* * If it's too long and marked as encrypted, ignore it. */ if (vp->flags.encrypt != FLAG_ENCRYPT_NONE) { return 0; } memcpy(header, start, hsize); left = vp->length; switch (vp->type) { case PW_TYPE_TLV: data = vp->vp_tlv; break; case PW_TYPE_OCTETS: case PW_TYPE_STRING: data = vp->vp_octets; break; /* * This is invalid. */ default: return 0; } while (left > 0) { memcpy(this, header, hsize); ptr = this + hsize; /* * 254 to account for * continuation flag. */ if (left > (254 - hsize)) { piece = 254 - hsize; *(ptr++) = 0x80; } else { piece = left; *(ptr++) = 0x00; } memcpy(ptr, data, piece); this[1] = hsize + piece + 1; /* * */ this[hsize - 1] = hsize - 6 + 1 + piece; data += piece; ptr += piece; left -= piece; this = ptr; } return (ptr - start); } /* * Parse a data structure into a RADIUS attribute. */ int rad_vp2attr(const RADIUS_PACKET *packet, const RADIUS_PACKET *original, const char *secret, const VALUE_PAIR *vp, uint8_t *start) { int vendorcode; int len, total_length; uint32_t lvalue; uint8_t *ptr, *length_ptr, *vsa_length_ptr, *tlv_length_ptr; uint8_t *end; ptr = start; end = ptr + 255; total_length = 0; length_ptr = vsa_length_ptr = tlv_length_ptr = NULL; /* * For interoperability, always put vendor attributes * into their own VSA. */ if ((vendorcode = VENDOR(vp->attribute)) == 0) { *(ptr++) = vp->attribute & 0xFF; length_ptr = ptr; *(ptr++) = 2; total_length += 2; } else { int vsa_tlen = 1; int vsa_llen = 1; int vsa_offset = 0; DICT_VENDOR *dv = dict_vendorbyvalue(vendorcode); /* * This must be an RFC-format attribute. If it * wasn't, then the "decode" function would have * made a Vendor-Specific attribute (i.e. type * 26), and we would have "vendorcode == 0" here. */ if (dv) { vsa_tlen = dv->type; vsa_llen = dv->length; if (dv->flags) vsa_offset = 1; } /* * Build a VSA header. */ *ptr++ = PW_VENDOR_SPECIFIC; vsa_length_ptr = ptr; *ptr++ = 6; lvalue = htonl(vendorcode); memcpy(ptr, &lvalue, 4); ptr += 4; total_length += 6; switch (vsa_tlen) { case 1: ptr[0] = (vp->attribute & 0xFF); break; case 2: ptr[0] = ((vp->attribute >> 8) & 0xFF); ptr[1] = (vp->attribute & 0xFF); break; case 4: ptr[0] = 0; ptr[1] = 0; ptr[2] = ((vp->attribute >> 8) & 0xFF); ptr[3] = (vp->attribute & 0xFF); break; default: return 0; /* silently discard it */ } ptr += vsa_tlen; switch (vsa_llen) { case 0: length_ptr = vsa_length_ptr; vsa_length_ptr = NULL; break; case 1: ptr[0] = 0; length_ptr = ptr; break; case 2: ptr[0] = 0; ptr[1] = 0; length_ptr = ptr + 1; break; default: return 0; /* silently discard it */ } ptr += vsa_llen; /* * Allow for some continuation. */ if (vsa_offset) { /* * Allow TLV's to be encoded, if someone * manages to somehow encode the sub-tlv's. * * FIXME: Keep track of room in the packet! */ if (vp->length > (((size_t) 254) - (ptr - start))) { return rad_vp2continuation(vp, start, ptr); } ptr[0] = 0x00; ptr++; /* * sub-TLV's can only be in one format. */ if (vp->flags.is_tlv) { *(ptr++) = (vp->attribute & 0xff00) >> 8; tlv_length_ptr = ptr; *(ptr++) = 2; vsa_offset += 2; } } total_length += vsa_tlen + vsa_llen + vsa_offset; if (vsa_length_ptr) *vsa_length_ptr += vsa_tlen + vsa_llen + vsa_offset; *length_ptr += vsa_tlen + vsa_llen + vsa_offset; } /* * Insert tags for string attributes. They go BEFORE * the string. */ if (vp->flags.has_tag && (vp->type == PW_TYPE_STRING) && (TAG_VALID(vp->flags.tag) || (vp->flags.encrypt == FLAG_ENCRYPT_TUNNEL_PASSWORD))) { ptr[0] = vp->flags.tag; end = vp2data(packet, original, secret, vp, ptr + 1, (end - ptr) - 1); } else { end = vp2data(packet, original, secret, vp, ptr, (end - ptr)); } if (!end) return -1; /* * Insert tags for integer attributes. They go at the START * of the integer, and over-write the first byte. */ if (vp->flags.has_tag && (vp->type == PW_TYPE_INTEGER)) { ptr[0] = vp->flags.tag; } /* * RFC 2865 section 5 says that zero-length attributes * MUST NOT be sent. * * ... and the WiMAX forum ignores this... because of * one vendor. Don't they have anything better to do * with their time? */ if ((end == ptr) && (vp->attribute != PW_CHARGEABLE_USER_IDENTITY)) return 0; len = (end - ptr); /* * Update the various lengths. */ *length_ptr += len; if (vsa_length_ptr) *vsa_length_ptr += len; if (tlv_length_ptr) *tlv_length_ptr += len; total_length += len; return total_length; /* of attribute */ } /* * Encode a packet. */ int rad_encode(RADIUS_PACKET *packet, const RADIUS_PACKET *original, const char *secret) { radius_packet_t *hdr; uint8_t *ptr; uint16_t total_length; int len; VALUE_PAIR *reply; const char *what; char ip_buffer[128]; /* * For simplicity in the following logic, we allow * the attributes to "overflow" the 4k maximum * RADIUS packet size, by one attribute. * * It's uint32_t, for alignment purposes. */ uint32_t data[(MAX_PACKET_LEN + 256) / 4]; if ((packet->code > 0) && (packet->code < FR_MAX_PACKET_CODE)) { what = fr_packet_codes[packet->code]; } else { what = "Reply"; } DEBUG("Sending %s of id %d to %s port %d\n", what, packet->id, inet_ntop(packet->dst_ipaddr.af, &packet->dst_ipaddr.ipaddr, ip_buffer, sizeof(ip_buffer)), packet->dst_port); /* * Double-check some things based on packet code. */ switch (packet->code) { case PW_AUTHENTICATION_ACK: case PW_AUTHENTICATION_REJECT: case PW_ACCESS_CHALLENGE: if (!original) { fr_strerror_printf("ERROR: Cannot sign response packet without a request packet."); return -1; } break; /* * These packet vectors start off as all zero. */ case PW_ACCOUNTING_REQUEST: case PW_DISCONNECT_REQUEST: case PW_COA_REQUEST: memset(packet->vector, 0, sizeof(packet->vector)); break; default: break; } /* * Use memory on the stack, until we know how * large the packet will be. */ hdr = (radius_packet_t *) data; /* * Build standard header */ hdr->code = packet->code; hdr->id = packet->id; memcpy(hdr->vector, packet->vector, sizeof(hdr->vector)); total_length = AUTH_HDR_LEN; /* * Load up the configuration values for the user */ ptr = hdr->data; packet->offset = 0; /* * FIXME: Loop twice over the reply list. The first time, * calculate the total length of data. The second time, * allocate the memory, and fill in the VP's. * * Hmm... this may be slower than just doing a small * memcpy. */ /* * Loop over the reply attributes for the packet. */ for (reply = packet->vps; reply; reply = reply->next) { /* * Ignore non-wire attributes */ if ((VENDOR(reply->attribute) == 0) && ((reply->attribute & 0xFFFF) > 0xff)) { #ifndef NDEBUG /* * Permit the admin to send BADLY formatted * attributes with a debug build. */ if (reply->attribute == PW_RAW_ATTRIBUTE) { memcpy(ptr, reply->vp_octets, reply->length); len = reply->length; goto next; } #endif continue; } /* * Set the Message-Authenticator to the correct * length and initial value. */ if (reply->attribute == PW_MESSAGE_AUTHENTICATOR) { reply->length = AUTH_VECTOR_LEN; memset(reply->vp_strvalue, 0, AUTH_VECTOR_LEN); /* * Cache the offset to the * Message-Authenticator */ packet->offset = total_length; } /* * Print out ONLY the attributes which * we're sending over the wire, and print * them out BEFORE they're encrypted. */ debug_pair(reply); /* * Print them in order, even if they were encoded * already. */ len = 0; if (reply->flags.encoded) goto next; if (reply->flags.is_tlv) { VALUE_PAIR *tlv = rad_vp2tlv(reply); if (tlv) { tlv->next = reply->next; reply->next = tlv; } /* * The encoded flag MUST be set in reply! */ reply = reply->next; } len = rad_vp2attr(packet, original, secret, reply, ptr); if (len < 0) return -1; /* * Check that the packet is no more than 4k in * size, AFTER writing the attribute past the 4k * boundary, but BEFORE deciding to increase the * size of the packet. Note that the 'data' * buffer, above, is one attribute longer than * necessary, in order to permit this overflow. */ if ((total_length + len) > MAX_PACKET_LEN) { DEBUG("WARNING: Attributes are too long for packet. Discarding data past %d bytes", total_length); break; } next: ptr += len; total_length += len; } /* done looping over all attributes */ /* * Fill in the rest of the fields, and copy the data over * from the local stack to the newly allocated memory. * * Yes, all this 'memcpy' is slow, but it means * that we only allocate the minimum amount of * memory for a request. */ packet->data_len = total_length; packet->data = (uint8_t *) malloc(packet->data_len); if (!packet->data) { fr_strerror_printf("Out of memory"); return -1; } memcpy(packet->data, hdr, packet->data_len); hdr = (radius_packet_t *) packet->data; total_length = htons(total_length); memcpy(hdr->length, &total_length, sizeof(total_length)); return 0; } /* * Sign a previously encoded packet. */ int rad_sign(RADIUS_PACKET *packet, const RADIUS_PACKET *original, const char *secret) { radius_packet_t *hdr = (radius_packet_t *)packet->data; /* * It wasn't assigned an Id, this is bad! */ if (packet->id < 0) { fr_strerror_printf("ERROR: RADIUS packets must be assigned an Id."); return -1; } if (!packet->data || (packet->data_len < AUTH_HDR_LEN) || (packet->offset < 0)) { fr_strerror_printf("ERROR: You must call rad_encode() before rad_sign()"); return -1; } /* * If there's a Message-Authenticator, update it * now, BEFORE updating the authentication vector. */ if (packet->offset > 0) { uint8_t calc_auth_vector[AUTH_VECTOR_LEN]; switch (packet->code) { case PW_ACCOUNTING_RESPONSE: if (original && original->code == PW_STATUS_SERVER) { goto do_ack; } case PW_ACCOUNTING_REQUEST: case PW_DISCONNECT_REQUEST: case PW_DISCONNECT_ACK: case PW_DISCONNECT_NAK: case PW_COA_REQUEST: case PW_COA_ACK: case PW_COA_NAK: memset(hdr->vector, 0, AUTH_VECTOR_LEN); break; do_ack: case PW_AUTHENTICATION_ACK: case PW_AUTHENTICATION_REJECT: case PW_ACCESS_CHALLENGE: if (!original) { fr_strerror_printf("ERROR: Cannot sign response packet without a request packet."); return -1; } memcpy(hdr->vector, original->vector, AUTH_VECTOR_LEN); break; default: /* others have vector already set to zero */ break; } /* * Set the authentication vector to zero, * calculate the HMAC, and put it * into the Message-Authenticator * attribute. */ fr_hmac_md5(packet->data, packet->data_len, (const uint8_t *) secret, strlen(secret), calc_auth_vector); memcpy(packet->data + packet->offset + 2, calc_auth_vector, AUTH_VECTOR_LEN); /* * Copy the original request vector back * to the raw packet. */ memcpy(hdr->vector, packet->vector, AUTH_VECTOR_LEN); } /* * Switch over the packet code, deciding how to * sign the packet. */ switch (packet->code) { /* * Request packets are not signed, bur * have a random authentication vector. */ case PW_AUTHENTICATION_REQUEST: case PW_STATUS_SERVER: break; /* * Reply packets are signed with the * authentication vector of the request. */ default: { uint8_t digest[16]; FR_MD5_CTX context; fr_MD5Init(&context); fr_MD5Update(&context, packet->data, packet->data_len); fr_MD5Update(&context, (const uint8_t *) secret, strlen(secret)); fr_MD5Final(digest, &context); memcpy(hdr->vector, digest, AUTH_VECTOR_LEN); memcpy(packet->vector, digest, AUTH_VECTOR_LEN); break; } }/* switch over packet codes */ return 0; } /* * Reply to the request. Also attach * reply attribute value pairs and any user message provided. */ int rad_send(RADIUS_PACKET *packet, const RADIUS_PACKET *original, const char *secret) { VALUE_PAIR *reply; const char *what; char ip_buffer[128]; /* * Maybe it's a fake packet. Don't send it. */ if (!packet || (packet->sockfd < 0)) { return 0; } if ((packet->code > 0) && (packet->code < FR_MAX_PACKET_CODE)) { what = fr_packet_codes[packet->code]; } else { what = "Reply"; } /* * First time through, allocate room for the packet */ if (!packet->data) { /* * Encode the packet. */ if (rad_encode(packet, original, secret) < 0) { return -1; } /* * Re-sign it, including updating the * Message-Authenticator. */ if (rad_sign(packet, original, secret) < 0) { return -1; } /* * If packet->data points to data, then we print out * the VP list again only for debugging. */ } else if (fr_debug_flag) { DEBUG("Sending %s of id %d to %s port %d\n", what, packet->id, inet_ntop(packet->dst_ipaddr.af, &packet->dst_ipaddr.ipaddr, ip_buffer, sizeof(ip_buffer)), packet->dst_port); for (reply = packet->vps; reply; reply = reply->next) { if ((VENDOR(reply->attribute) == 0) && ((reply->attribute & 0xFFFF) > 0xff)) continue; debug_pair(reply); } } /* * And send it on it's way. */ return rad_sendto(packet->sockfd, packet->data, packet->data_len, 0, &packet->src_ipaddr, packet->src_port, &packet->dst_ipaddr, packet->dst_port); } /* * Do a comparison of two authentication digests by comparing * the FULL digest. Otehrwise, the server can be subject to * timing attacks that allow attackers find a valid message * authenticator. * * http://www.cs.rice.edu/~dwallach/pub/crosby-timing2009.pdf */ int rad_digest_cmp(const uint8_t *a, const uint8_t *b, size_t length) { int result = 0; size_t i; for (i = 0; i < length; i++) { result |= a[i] ^ b[i]; } return result; /* 0 is OK, !0 is !OK, just like memcmp */ } /* * Validates the requesting client NAS. Calculates the * Request Authenticator based on the clients private key. */ static int calc_acctdigest(RADIUS_PACKET *packet, const char *secret) { uint8_t digest[AUTH_VECTOR_LEN]; FR_MD5_CTX context; /* * Zero out the auth_vector in the received packet. * Then append the shared secret to the received packet, * and calculate the MD5 sum. This must be the same * as the original MD5 sum (packet->vector). */ memset(packet->data + 4, 0, AUTH_VECTOR_LEN); /* * MD5(packet + secret); */ fr_MD5Init(&context); fr_MD5Update(&context, packet->data, packet->data_len); fr_MD5Update(&context, (const uint8_t *) secret, strlen(secret)); fr_MD5Final(digest, &context); /* * Return 0 if OK, 2 if not OK. */ if (rad_digest_cmp(digest, packet->vector, AUTH_VECTOR_LEN) != 0) return 2; return 0; } /* * Validates the requesting client NAS. Calculates the * Response Authenticator based on the clients private key. */ static int calc_replydigest(RADIUS_PACKET *packet, RADIUS_PACKET *original, const char *secret) { uint8_t calc_digest[AUTH_VECTOR_LEN]; FR_MD5_CTX context; /* * Very bad! */ if (original == NULL) { return 3; } /* * Copy the original vector in place. */ memcpy(packet->data + 4, original->vector, AUTH_VECTOR_LEN); /* * MD5(packet + secret); */ fr_MD5Init(&context); fr_MD5Update(&context, packet->data, packet->data_len); fr_MD5Update(&context, (const uint8_t *) secret, strlen(secret)); fr_MD5Final(calc_digest, &context); /* * Copy the packet's vector back to the packet. */ memcpy(packet->data + 4, packet->vector, AUTH_VECTOR_LEN); /* * Return 0 if OK, 2 if not OK. */ if (rad_digest_cmp(packet->vector, calc_digest, AUTH_VECTOR_LEN) != 0) return 2; return 0; } /* * See if the data pointed to by PTR is a valid RADIUS packet. * * packet is not 'const * const' because we may update data_len, * if there's more data in the UDP packet than in the RADIUS packet. */ int rad_packet_ok(RADIUS_PACKET *packet, int flags) { uint8_t *attr; int totallen; int count; radius_packet_t *hdr; char host_ipaddr[128]; int require_ma = 0; int seen_ma = 0; int num_attributes; /* * Check for packets smaller than the packet header. * * RFC 2865, Section 3., subsection 'length' says: * * "The minimum length is 20 ..." */ if (packet->data_len < AUTH_HDR_LEN) { fr_strerror_printf("WARNING: Malformed RADIUS packet from host %s: too short (received %d < minimum %d)", inet_ntop(packet->src_ipaddr.af, &packet->src_ipaddr.ipaddr, host_ipaddr, sizeof(host_ipaddr)), packet->data_len, AUTH_HDR_LEN); return 0; } /* * RFC 2865, Section 3., subsection 'length' says: * * " ... and maximum length is 4096." */ if (packet->data_len > MAX_PACKET_LEN) { fr_strerror_printf("WARNING: Malformed RADIUS packet from host %s: too long (received %d > maximum %d)", inet_ntop(packet->src_ipaddr.af, &packet->src_ipaddr.ipaddr, host_ipaddr, sizeof(host_ipaddr)), packet->data_len, MAX_PACKET_LEN); return 0; } /* * Check for packets with mismatched size. * i.e. We've received 128 bytes, and the packet header * says it's 256 bytes long. */ totallen = (packet->data[2] << 8) | packet->data[3]; hdr = (radius_packet_t *)packet->data; /* * Code of 0 is not understood. * Code of 16 or greate is not understood. */ if ((hdr->code == 0) || (hdr->code >= FR_MAX_PACKET_CODE)) { fr_strerror_printf("WARNING: Bad RADIUS packet from host %s: unknown packet code%d ", inet_ntop(packet->src_ipaddr.af, &packet->src_ipaddr.ipaddr, host_ipaddr, sizeof(host_ipaddr)), hdr->code); return 0; } /* * Message-Authenticator is required in Status-Server * packets, otherwise they can be trivially forged. */ if (hdr->code == PW_STATUS_SERVER) require_ma = 1; /* * It's also required if the caller asks for it. */ if (flags) require_ma = 1; /* * Repeat the length checks. This time, instead of * looking at the data we received, look at the value * of the 'length' field inside of the packet. * * Check for packets smaller than the packet header. * * RFC 2865, Section 3., subsection 'length' says: * * "The minimum length is 20 ..." */ if (totallen < AUTH_HDR_LEN) { fr_strerror_printf("WARNING: Malformed RADIUS packet from host %s: too short (length %d < minimum %d)", inet_ntop(packet->src_ipaddr.af, &packet->src_ipaddr.ipaddr, host_ipaddr, sizeof(host_ipaddr)), totallen, AUTH_HDR_LEN); return 0; } /* * And again, for the value of the 'length' field. * * RFC 2865, Section 3., subsection 'length' says: * * " ... and maximum length is 4096." */ if (totallen > MAX_PACKET_LEN) { fr_strerror_printf("WARNING: Malformed RADIUS packet from host %s: too long (length %d > maximum %d)", inet_ntop(packet->src_ipaddr.af, &packet->src_ipaddr.ipaddr, host_ipaddr, sizeof(host_ipaddr)), totallen, MAX_PACKET_LEN); return 0; } /* * RFC 2865, Section 3., subsection 'length' says: * * "If the packet is shorter than the Length field * indicates, it MUST be silently discarded." * * i.e. No response to the NAS. */ if (packet->data_len < totallen) { fr_strerror_printf("WARNING: Malformed RADIUS packet from host %s: received %d octets, packet length says %d", inet_ntop(packet->src_ipaddr.af, &packet->src_ipaddr.ipaddr, host_ipaddr, sizeof(host_ipaddr)), packet->data_len, totallen); return 0; } /* * RFC 2865, Section 3., subsection 'length' says: * * "Octets outside the range of the Length field MUST be * treated as padding and ignored on reception." */ if (packet->data_len > totallen) { /* * We're shortening the packet below, but just * to be paranoid, zero out the extra data. */ memset(packet->data + totallen, 0, packet->data_len - totallen); packet->data_len = totallen; } /* * Walk through the packet's attributes, ensuring that * they add up EXACTLY to the size of the packet. * * If they don't, then the attributes either under-fill * or over-fill the packet. Any parsing of the packet * is impossible, and will result in unknown side effects. * * This would ONLY happen with buggy RADIUS implementations, * or with an intentional attack. Either way, we do NOT want * to be vulnerable to this problem. */ attr = hdr->data; count = totallen - AUTH_HDR_LEN; num_attributes = 0; while (count > 0) { /* * We need at least 2 bytes to check the * attribute header. */ if (count < 2) { fr_strerror_printf("WARNING: Malformed RADIUS packet from host %s: attribute header overflows the packet", inet_ntop(packet->src_ipaddr.af, &packet->src_ipaddr.ipaddr, host_ipaddr, sizeof(host_ipaddr))); return 0; } /* * Attribute number zero is NOT defined. */ if (attr[0] == 0) { fr_strerror_printf("WARNING: Malformed RADIUS packet from host %s: Invalid attribute 0", inet_ntop(packet->src_ipaddr.af, &packet->src_ipaddr.ipaddr, host_ipaddr, sizeof(host_ipaddr))); return 0; } /* * Attributes are at LEAST as long as the ID & length * fields. Anything shorter is an invalid attribute. */ if (attr[1] < 2) { fr_strerror_printf("WARNING: Malformed RADIUS packet from host %s: attribute %u too short", inet_ntop(packet->src_ipaddr.af, &packet->src_ipaddr.ipaddr, host_ipaddr, sizeof(host_ipaddr)), attr[0]); return 0; } /* * If there are fewer bytes in the packet than in the * attribute, it's a bad packet. */ if (count < attr[1]) { fr_strerror_printf("WARNING: Malformed RADIUS packet from host %s: attribute %u data overflows the packet", inet_ntop(packet->src_ipaddr.af, &packet->src_ipaddr.ipaddr, host_ipaddr, sizeof(host_ipaddr)), attr[0]); return 0; } /* * Sanity check the attributes for length. */ switch (attr[0]) { default: /* don't do anything by default */ break; /* * If there's an EAP-Message, we require * a Message-Authenticator. */ case PW_EAP_MESSAGE: require_ma = 1; break; case PW_MESSAGE_AUTHENTICATOR: if (attr[1] != 2 + AUTH_VECTOR_LEN) { fr_strerror_printf("WARNING: Malformed RADIUS packet from host %s: Message-Authenticator has invalid length %d", inet_ntop(packet->src_ipaddr.af, &packet->src_ipaddr.ipaddr, host_ipaddr, sizeof(host_ipaddr)), attr[1] - 2); return 0; } seen_ma = 1; break; } /* * FIXME: Look up the base 255 attributes in the * dictionary, and switch over their type. For * integer/date/ip, the attribute length SHOULD * be 6. */ count -= attr[1]; /* grab the attribute length */ attr += attr[1]; num_attributes++; /* seen one more attribute */ } /* * If the attributes add up to a packet, it's allowed. * * If not, we complain, and throw the packet away. */ if (count != 0) { fr_strerror_printf("WARNING: Malformed RADIUS packet from host %s: packet attributes do NOT exactly fill the packet", inet_ntop(packet->src_ipaddr.af, &packet->src_ipaddr.ipaddr, host_ipaddr, sizeof(host_ipaddr))); return 0; } /* * If we're configured to look for a maximum number of * attributes, and we've seen more than that maximum, * then throw the packet away, as a possible DoS. */ if ((fr_max_attributes > 0) && (num_attributes > fr_max_attributes)) { fr_strerror_printf("WARNING: Possible DoS attack from host %s: Too many attributes in request (received %d, max %d are allowed).", inet_ntop(packet->src_ipaddr.af, &packet->src_ipaddr.ipaddr, host_ipaddr, sizeof(host_ipaddr)), num_attributes, fr_max_attributes); return 0; } /* * http://www.freeradius.org/rfc/rfc2869.html#EAP-Message * * A packet with an EAP-Message attribute MUST also have * a Message-Authenticator attribute. * * A Message-Authenticator all by itself is OK, though. * * Similarly, Status-Server packets MUST contain * Message-Authenticator attributes. */ if (require_ma && ! seen_ma) { fr_strerror_printf("WARNING: Insecure packet from host %s: Packet does not contain required Message-Authenticator attribute", inet_ntop(packet->src_ipaddr.af, &packet->src_ipaddr.ipaddr, host_ipaddr, sizeof(host_ipaddr))); return 0; } /* * Fill RADIUS header fields */ packet->code = hdr->code; packet->id = hdr->id; memcpy(packet->vector, hdr->vector, AUTH_VECTOR_LEN); return 1; } /* * Receive UDP client requests, and fill in * the basics of a RADIUS_PACKET structure. */ RADIUS_PACKET *rad_recv(int fd, int flags) { int sock_flags = 0; RADIUS_PACKET *packet; /* * Allocate the new request data structure */ if ((packet = malloc(sizeof(*packet))) == NULL) { fr_strerror_printf("out of memory"); return NULL; } memset(packet, 0, sizeof(*packet)); if (flags & 0x02) { sock_flags = MSG_PEEK; flags &= ~0x02; } packet->data_len = rad_recvfrom(fd, &packet->data, sock_flags, &packet->src_ipaddr, &packet->src_port, &packet->dst_ipaddr, &packet->dst_port); /* * Check for socket errors. */ if (packet->data_len < 0) { fr_strerror_printf("Error receiving packet: %s", strerror(errno)); /* packet->data is NULL */ free(packet); return NULL; } /* * If the packet is too big, then rad_recvfrom did NOT * allocate memory. Instead, it just discarded the * packet. */ if (packet->data_len > MAX_PACKET_LEN) { fr_strerror_printf("Discarding packet: Larger than RFC limitation of 4096 bytes."); /* packet->data is NULL */ free(packet); return NULL; } /* * Read no data. Continue. * This check is AFTER the MAX_PACKET_LEN check above, because * if the packet is larger than MAX_PACKET_LEN, we also have * packet->data == NULL */ if ((packet->data_len == 0) || !packet->data) { fr_strerror_printf("Empty packet: Socket is not ready."); free(packet); return NULL; } /* * See if it's a well-formed RADIUS packet. */ if (!rad_packet_ok(packet, flags)) { rad_free(&packet); return NULL; } /* * Remember which socket we read the packet from. */ packet->sockfd = fd; /* * FIXME: Do even more filtering by only permitting * certain IP's. The problem is that we don't know * how to do this properly for all possible clients... */ /* * Explicitely set the VP list to empty. */ packet->vps = NULL; if (fr_debug_flag) { char host_ipaddr[128]; if ((packet->code > 0) && (packet->code < FR_MAX_PACKET_CODE)) { DEBUG("rad_recv: %s packet from host %s port %d", fr_packet_codes[packet->code], inet_ntop(packet->src_ipaddr.af, &packet->src_ipaddr.ipaddr, host_ipaddr, sizeof(host_ipaddr)), packet->src_port); } else { DEBUG("rad_recv: Packet from host %s port %d code=%d", inet_ntop(packet->src_ipaddr.af, &packet->src_ipaddr.ipaddr, host_ipaddr, sizeof(host_ipaddr)), packet->src_port, packet->code); } DEBUG(", id=%d, length=%d\n", packet->id, packet->data_len); } return packet; } /* * Verify the Request/Response Authenticator * (and Message-Authenticator if present) of a packet. */ int rad_verify(RADIUS_PACKET *packet, RADIUS_PACKET *original, const char *secret) { uint8_t *ptr; int length; int attrlen; if (!packet || !packet->data) return -1; /* * Before we allocate memory for the attributes, do more * sanity checking. */ ptr = packet->data + AUTH_HDR_LEN; length = packet->data_len - AUTH_HDR_LEN; while (length > 0) { uint8_t msg_auth_vector[AUTH_VECTOR_LEN]; uint8_t calc_auth_vector[AUTH_VECTOR_LEN]; attrlen = ptr[1]; switch (ptr[0]) { default: /* don't do anything. */ break; /* * Note that more than one Message-Authenticator * attribute is invalid. */ case PW_MESSAGE_AUTHENTICATOR: memcpy(msg_auth_vector, &ptr[2], sizeof(msg_auth_vector)); memset(&ptr[2], 0, AUTH_VECTOR_LEN); switch (packet->code) { default: break; case PW_ACCOUNTING_RESPONSE: if (original && (original->code == PW_STATUS_SERVER)) { goto do_ack; } case PW_ACCOUNTING_REQUEST: case PW_DISCONNECT_REQUEST: case PW_COA_REQUEST: memset(packet->data + 4, 0, AUTH_VECTOR_LEN); break; do_ack: case PW_AUTHENTICATION_ACK: case PW_AUTHENTICATION_REJECT: case PW_ACCESS_CHALLENGE: case PW_DISCONNECT_ACK: case PW_DISCONNECT_NAK: case PW_COA_ACK: case PW_COA_NAK: if (!original) { fr_strerror_printf("ERROR: Cannot validate Message-Authenticator in response packet without a request packet."); return -1; } memcpy(packet->data + 4, original->vector, AUTH_VECTOR_LEN); break; } fr_hmac_md5(packet->data, packet->data_len, (const uint8_t *) secret, strlen(secret), calc_auth_vector); if (rad_digest_cmp(calc_auth_vector, msg_auth_vector, sizeof(calc_auth_vector)) != 0) { char buffer[32]; fr_strerror_printf("Received packet from %s with invalid Message-Authenticator! (Shared secret is incorrect.)", inet_ntop(packet->src_ipaddr.af, &packet->src_ipaddr.ipaddr, buffer, sizeof(buffer))); /* Silently drop packet, according to RFC 3579 */ return -1; } /* else the message authenticator was good */ /* * Reinitialize Authenticators. */ memcpy(&ptr[2], msg_auth_vector, AUTH_VECTOR_LEN); memcpy(packet->data + 4, packet->vector, AUTH_VECTOR_LEN); break; } /* switch over the attributes */ ptr += attrlen; length -= attrlen; } /* loop over the packet, sanity checking the attributes */ /* * It looks like a RADIUS packet, but we don't know what it is * so can't validate the authenticators. */ if ((packet->code == 0) || (packet->code >= FR_MAX_PACKET_CODE)) { char buffer[32]; fr_strerror_printf("Received Unknown packet code %d " "from client %s port %d: Cannot validate Request/Response Authenticator.", packet->code, inet_ntop(packet->src_ipaddr.af, &packet->src_ipaddr.ipaddr, buffer, sizeof(buffer)), packet->src_port); return -1; } /* * Calculate and/or verify Request or Response Authenticator. */ switch(packet->code) { int rcode; char buffer[32]; case PW_AUTHENTICATION_REQUEST: case PW_STATUS_SERVER: /* * The authentication vector is random * nonsense, invented by the client. */ break; case PW_COA_REQUEST: case PW_DISCONNECT_REQUEST: case PW_ACCOUNTING_REQUEST: if (calc_acctdigest(packet, secret) > 1) { fr_strerror_printf("Received %s packet " "from client %s with invalid Request Authenticator! (Shared secret is incorrect.)", fr_packet_codes[packet->code], inet_ntop(packet->src_ipaddr.af, &packet->src_ipaddr.ipaddr, buffer, sizeof(buffer))); return -1; } break; /* Verify the reply digest */ case PW_AUTHENTICATION_ACK: case PW_AUTHENTICATION_REJECT: case PW_ACCESS_CHALLENGE: case PW_ACCOUNTING_RESPONSE: case PW_DISCONNECT_ACK: case PW_DISCONNECT_NAK: case PW_COA_ACK: case PW_COA_NAK: rcode = calc_replydigest(packet, original, secret); if (rcode > 1) { fr_strerror_printf("Received %s packet " "from home server %s port %d with invalid Response Authenticator! (Shared secret is incorrect.)", fr_packet_codes[packet->code], inet_ntop(packet->src_ipaddr.af, &packet->src_ipaddr.ipaddr, buffer, sizeof(buffer)), packet->src_port); return -1; } break; default: fr_strerror_printf("Received Unknown packet code %d " "from client %s port %d: Cannot validate Request/Response Authenticator", packet->code, inet_ntop(packet->src_ipaddr.af, &packet->src_ipaddr.ipaddr, buffer, sizeof(buffer)), packet->src_port); return -1; } return 0; } static VALUE_PAIR *data2vp(const RADIUS_PACKET *packet, const RADIUS_PACKET *original, const char *secret, unsigned int attribute, size_t length, const uint8_t *data, VALUE_PAIR *vp) { int offset = 0; /* * If length is greater than 253, something is SERIOUSLY * wrong. */ if (length > 253) length = 253; /* paranoia (pair-anoia?) */ vp->length = length; vp->operator = T_OP_EQ; vp->next = NULL; /* * Handle tags. */ if (vp->flags.has_tag) { if (TAG_VALID(data[0]) || (vp->flags.encrypt == FLAG_ENCRYPT_TUNNEL_PASSWORD)) { /* * Tunnel passwords REQUIRE a tag, even * if don't have a valid tag. */ vp->flags.tag = data[0]; if ((vp->type == PW_TYPE_STRING) || (vp->type == PW_TYPE_OCTETS)) offset = 1; } } /* * Copy the data to be decrypted */ memcpy(&vp->vp_octets[0], data + offset, length - offset); vp->length -= offset; /* * Decrypt the attribute. */ if (secret) switch (vp->flags.encrypt) { /* * User-Password */ case FLAG_ENCRYPT_USER_PASSWORD: if (original) { rad_pwdecode((char *)vp->vp_strvalue, vp->length, secret, original->vector); } else { rad_pwdecode((char *)vp->vp_strvalue, vp->length, secret, packet->vector); } if (vp->attribute == PW_USER_PASSWORD) { vp->length = strlen(vp->vp_strvalue); } break; /* * Tunnel-Password's may go ONLY * in response packets. */ case FLAG_ENCRYPT_TUNNEL_PASSWORD: if (rad_tunnel_pwdecode(vp->vp_octets, &vp->length, secret, original ? original->vector : nullvector) < 0) goto raw; break; /* * Ascend-Send-Secret * Ascend-Receive-Secret */ case FLAG_ENCRYPT_ASCEND_SECRET: if (!original) { goto raw; } else { uint8_t my_digest[AUTH_VECTOR_LEN]; make_secret(my_digest, original->vector, secret, data); memcpy(vp->vp_strvalue, my_digest, AUTH_VECTOR_LEN ); vp->vp_strvalue[AUTH_VECTOR_LEN] = '\0'; vp->length = strlen(vp->vp_strvalue); } break; default: break; } /* switch over encryption flags */ switch (vp->type) { case PW_TYPE_STRING: case PW_TYPE_OCTETS: case PW_TYPE_ABINARY: /* nothing more to do */ break; case PW_TYPE_BYTE: if (vp->length != 1) goto raw; vp->vp_integer = vp->vp_octets[0]; break; case PW_TYPE_SHORT: if (vp->length != 2) goto raw; vp->vp_integer = (vp->vp_octets[0] << 8) | vp->vp_octets[1]; break; case PW_TYPE_INTEGER: if (vp->length != 4) goto raw; memcpy(&vp->vp_integer, vp->vp_octets, 4); vp->vp_integer = ntohl(vp->vp_integer); if (vp->flags.has_tag) vp->vp_integer &= 0x00ffffff; /* * Try to get named VALUEs */ { DICT_VALUE *dval; dval = dict_valbyattr(vp->attribute, vp->vp_integer); if (dval) { strlcpy(vp->vp_strvalue, dval->name, sizeof(vp->vp_strvalue)); } } break; case PW_TYPE_DATE: if (vp->length != 4) goto raw; memcpy(&vp->vp_date, vp->vp_octets, 4); vp->vp_date = ntohl(vp->vp_date); break; case PW_TYPE_IPADDR: if (vp->length != 4) goto raw; memcpy(&vp->vp_ipaddr, vp->vp_octets, 4); break; /* * IPv6 interface ID is 8 octets long. */ case PW_TYPE_IFID: if (vp->length != 8) goto raw; /* vp->vp_ifid == vp->vp_octets */ break; /* * IPv6 addresses are 16 octets long */ case PW_TYPE_IPV6ADDR: if (vp->length != 16) goto raw; /* vp->vp_ipv6addr == vp->vp_octets */ break; /* * IPv6 prefixes are 2 to 18 octets long. * * RFC 3162: The first octet is unused. * The second is the length of the prefix * the rest are the prefix data. * * The prefix length can have value 0 to 128. */ case PW_TYPE_IPV6PREFIX: if (vp->length < 2 || vp->length > 18) goto raw; if (vp->vp_octets[1] > 128) goto raw; /* * FIXME: double-check that * (vp->vp_octets[1] >> 3) matches vp->length + 2 */ if (vp->length < 18) { memset(vp->vp_octets + vp->length, 0, 18 - vp->length); } break; case PW_TYPE_SIGNED: if (vp->length != 4) goto raw; /* * Overload vp_integer for ntohl, which takes * uint32_t, not int32_t */ memcpy(&vp->vp_integer, vp->vp_octets, 4); vp->vp_integer = ntohl(vp->vp_integer); memcpy(&vp->vp_signed, &vp->vp_integer, 4); break; case PW_TYPE_TLV: vp->length = length; vp->vp_tlv = malloc(length); if (!vp->vp_tlv) { pairfree(&vp); fr_strerror_printf("No memory"); return NULL; } memcpy(vp->vp_tlv, data, length); break; case PW_TYPE_COMBO_IP: if (vp->length == 4) { vp->type = PW_TYPE_IPADDR; memcpy(&vp->vp_ipaddr, vp->vp_octets, 4); break; } else if (vp->length == 16) { vp->type = PW_TYPE_IPV6ADDR; /* vp->vp_ipv6addr == vp->vp_octets */ break; } /* FALL-THROUGH */ default: raw: /* * Change the name to show the user that the * attribute is not of the correct format. */ { VALUE_PAIR *vp2; vp2 = pairalloc(NULL); if (!vp2) { pairfree(&vp); return NULL; } pairfree(&vp); vp = vp2; /* * This sets "vp->flags" appropriately, * and vp->type. */ if (!paircreate_raw(attribute, PW_TYPE_OCTETS, vp)) { return NULL; } vp->length = length; memcpy(vp->vp_octets, data, length); } break; } return vp; } static void rad_sortvp(VALUE_PAIR **head) { int swapped; VALUE_PAIR *vp, **tail; /* * Walk over the VP's, sorting them in order. Did I * mention that I hate WiMAX continuations? * * And bubble sort! WTF is up with that? */ do { swapped = 0; tail = head; while (*tail) { vp = *tail; if (!vp->next) break; if (vp->attribute > vp->next->attribute) { *tail = vp->next; vp->next = (*tail)->next; (*tail)->next = vp; swapped = 1; } tail = &(vp->next); } } while (swapped); } /* * Walk the packet, looking for continuations of this attribute. * * This is (worst-case) O(N^2) in the number of RADIUS * attributes. That happens only when perverse clients create * continued attributes, AND separate the fragmented portions * with a lot of other attributes. * * Sane clients should put the fragments next to each other, in * which case this is O(N), in the number of fragments. */ static uint8_t *rad_coalesce(unsigned int attribute, size_t length, uint8_t *data, size_t packet_length, size_t *ptlv_length) { uint32_t lvalue; size_t tlv_length = length; uint8_t *ptr, *tlv, *tlv_data; for (ptr = data + length; ptr != (data + packet_length); ptr += ptr[1]) { if ((ptr[0] != PW_VENDOR_SPECIFIC) || (ptr[1] < (2 + 4 + 3)) || /* WiMAX VSA with continuation */ (ptr[2] != 0) || (ptr[3] != 0)) { /* our requirement */ continue; } memcpy(&lvalue, ptr + 2, 4); /* Vendor Id */ lvalue = ntohl(lvalue); lvalue <<= 16; lvalue |= ptr[2 + 4]; /* add in VSA number */ if (lvalue != attribute) continue; /* * If the vendor-length is too small, it's badly * formed, so we stop. */ if ((ptr[2 + 4 + 1]) < 3) break; tlv_length += ptr[2 + 4 + 1] - 3; if ((ptr[2 + 4 + 1 + 1] & 0x80) == 0) break; } tlv = tlv_data = malloc(tlv_length); if (!tlv_data) return NULL; memcpy(tlv, data, length); tlv += length; /* * Now we walk the list again, copying the data over to * our newly created memory. */ for (ptr = data + length; ptr != (data + packet_length); ptr += ptr[1]) { int this_length; if ((ptr[0] != PW_VENDOR_SPECIFIC) || (ptr[1] < (2 + 4 + 3)) || /* WiMAX VSA with continuation */ (ptr[2] != 0) || (ptr[3] != 0)) { /* our requirement */ continue; } memcpy(&lvalue, ptr + 2, 4); lvalue = ntohl(lvalue); lvalue <<= 16; lvalue |= ptr[2 + 4]; if (lvalue != attribute) continue; /* * If the vendor-length is too small, it's badly * formed, so we stop. */ if ((ptr[2 + 4 + 1]) < 3) break; this_length = ptr[2 + 4 + 1] - 3; memcpy(tlv, ptr + 2 + 4 + 3, this_length); tlv += this_length; ptr[2 + 4] = 0; /* What a hack! */ if ((ptr[2 + 4 + 1 + 1] & 0x80) == 0) break; } *ptlv_length = tlv_length; return tlv_data; } /* * Start at the *data* portion of a continued attribute. search * through the rest of the attributes to find a matching one, and * add it's contents to our contents. */ static VALUE_PAIR *rad_continuation2vp(const RADIUS_PACKET *packet, const RADIUS_PACKET *original, const char *secret, int attribute, int length, /* CANNOT be zero */ uint8_t *data, size_t packet_length, int flag, DICT_ATTR *da) { size_t tlv_length, left; uint8_t *ptr; uint8_t *tlv_data; VALUE_PAIR *vp, *head, **tail; /* * Ensure we have data that hasn't been split across * multiple attributes. */ if (flag) { tlv_data = rad_coalesce(attribute, length, data, packet_length, &tlv_length); if (!tlv_data) return NULL; } else { tlv_data = data; tlv_length = length; } /* * Non-TLV types cannot be continued across multiple * attributes. This is true even of keys that are * encrypted with the tunnel-password method. The spec * says that they can be continued... but also that the * keys are 160 bits, which means that they CANNOT be * continued. * * Note that we don't check "flag" here. The calling * code ensures that */ if (!da || (da->type != PW_TYPE_TLV)) { not_well_formed: if (tlv_data == data) { /* true if we had 'goto' */ tlv_data = malloc(tlv_length); if (!tlv_data) return NULL; memcpy(tlv_data, data, tlv_length); } vp = paircreate(attribute, PW_TYPE_OCTETS); if (!vp) { free(tlv_data); return NULL; } vp->type = PW_TYPE_TLV; vp->flags.encrypt = FLAG_ENCRYPT_NONE; vp->flags.has_tag = 0; vp->flags.is_tlv = 0; vp->vp_tlv = tlv_data; vp->length = tlv_length; return vp; } /* else it WAS a TLV, go decode the sub-tlv's */ /* * Now (sigh) we walk over the TLV, seeing if it is * well-formed. */ left = tlv_length; for (ptr = tlv_data; ptr != (tlv_data + tlv_length); ptr += ptr[1]) { if ((left < 2) || (ptr[1] < 2) || (ptr[1] > left)) { goto not_well_formed; } left -= ptr[1]; } /* * Now we walk over the TLV *again*, creating sub-tlv's. */ head = NULL; tail = &head; for (ptr = tlv_data; ptr != (tlv_data + tlv_length); ptr += ptr[1]) { vp = paircreate(attribute | (ptr[0] << 8), PW_TYPE_OCTETS); if (!vp) { pairfree(&head); goto not_well_formed; } vp = data2vp(packet, original, secret, ptr[0], ptr[1] - 2, ptr + 2, vp); if (!vp) { /* called frees vp */ pairfree(&head); goto not_well_formed; } *tail = vp; tail = &(vp->next); } /* * TLV's MAY be continued, but sometimes they're not. */ if (tlv_data != data) free(tlv_data); if (head && head->next) rad_sortvp(&head); return head; } /* * Parse a RADIUS attribute into a data structure. */ VALUE_PAIR *rad_attr2vp(const RADIUS_PACKET *packet, const RADIUS_PACKET *original, const char *secret, int attribute, int length, const uint8_t *data) { VALUE_PAIR *vp; vp = paircreate(attribute, PW_TYPE_OCTETS); if (!vp) return NULL; return data2vp(packet, original, secret, attribute, length, data, vp); } /** * Converts vp_data to network byte order * Returns: * -1 on error, or the length of the value */ ssize_t rad_vp2data(const VALUE_PAIR *vp, uint8_t *out, size_t outlen) { size_t len = 0; uint32_t lvalue; len = vp->length; if (outlen < len) { fr_strerror_printf("ERROR: rad_vp2data buffer passed too small"); return -1; } switch(vp->type) { case PW_TYPE_STRING: case PW_TYPE_OCTETS: case PW_TYPE_IFID: case PW_TYPE_IPADDR: case PW_TYPE_IPV6ADDR: case PW_TYPE_IPV6PREFIX: case PW_TYPE_ABINARY: case PW_TYPE_TLV: memcpy(out, vp->vp_octets, len); break; case PW_TYPE_BYTE: out[0] = vp->vp_integer & 0xff; break; case PW_TYPE_SHORT: out[0] = (vp->vp_integer >> 8) & 0xff; out[1] = vp->vp_integer & 0xff; break; case PW_TYPE_INTEGER: lvalue = htonl(vp->vp_integer); memcpy(out, &lvalue, sizeof(lvalue)); break; case PW_TYPE_DATE: lvalue = htonl(vp->vp_date); memcpy(out, &lvalue, sizeof(lvalue)); break; case PW_TYPE_SIGNED: { int32_t slvalue; slvalue = htonl(vp->vp_signed); memcpy(out, &slvalue, sizeof(slvalue)); break; } /* unknown type: ignore it */ default: fr_strerror_printf("ERROR: Unknown attribute type %d", vp->type); return -1; } return len; } /* * Calculate/check digest, and decode radius attributes. * Returns: * -1 on decoding error * 0 on success */ int rad_decode(RADIUS_PACKET *packet, RADIUS_PACKET *original, const char *secret) { uint32_t lvalue; uint32_t vendorcode; VALUE_PAIR **tail; VALUE_PAIR *pair; uint8_t *ptr, *vsa_ptr; int packet_length; int attribute; int attrlen; int vendorlen; radius_packet_t *hdr; int vsa_tlen, vsa_llen, vsa_offset; DICT_VENDOR *dv = NULL; int num_attributes = 0; /* * Extract attribute-value pairs */ hdr = (radius_packet_t *)packet->data; ptr = hdr->data; packet_length = packet->data_len - AUTH_HDR_LEN; /* * There may be VP's already in the packet. Don't * destroy them. */ for (tail = &packet->vps; *tail != NULL; tail = &((*tail)->next)) { /* nothing */ } vendorcode = 0; vendorlen = 0; vsa_tlen = vsa_llen = 1; vsa_offset = 0; /* * We have to read at least two bytes. * * rad_recv() above ensures that this is OK. */ while (packet_length > 0) { attribute = -1; attrlen = -1; /* * Normal attribute, handle it like normal. */ if (vendorcode == 0) { /* * No room to read attr/length, * or bad attribute, or attribute is * too short, or attribute is too long, * stop processing the packet. */ if ((packet_length < 2) || (ptr[0] == 0) || (ptr[1] < 2) || (ptr[1] > packet_length)) break; attribute = *ptr++; attrlen = *ptr++; attrlen -= 2; packet_length -= 2; if (attribute != PW_VENDOR_SPECIFIC) goto create_pair; /* * No vendor code, or ONLY vendor code. */ if (attrlen <= 4) goto create_pair; vendorlen = 0; } /* * Handle Vendor-Specific */ if (vendorlen == 0) { uint8_t *subptr; int sublen; int myvendor; /* * attrlen was checked above. */ memcpy(&lvalue, ptr, 4); myvendor = ntohl(lvalue); /* * Zero isn't allowed. */ if (myvendor == 0) goto create_pair; /* * This is an implementation issue. * We currently pack vendor into the upper * 16 bits of a 32-bit attribute number, * so we can't handle vendor numbers larger * than 16 bits. */ if (myvendor > 65535) goto create_pair; vsa_tlen = vsa_llen = 1; vsa_offset = 0; dv = dict_vendorbyvalue(myvendor); if (dv) { vsa_tlen = dv->type; vsa_llen = dv->length; if (dv->flags) vsa_offset = 1; } /* * Sweep through the list of VSA's, * seeing if they exactly fill the * outer Vendor-Specific attribute. * * If not, create a raw Vendor-Specific. */ subptr = ptr + 4; sublen = attrlen - 4; /* * See if we can parse it. */ do { int myattr = 0; /* * Not enough room for one more * attribute. Die! */ if (sublen < (vsa_tlen + vsa_llen + vsa_offset)) goto create_pair; /* * Ensure that the attribute number * is OK. */ switch (vsa_tlen) { case 1: myattr = subptr[0]; break; case 2: myattr = (subptr[0] << 8) | subptr[1]; break; case 4: if ((subptr[0] != 0) || (subptr[1] != 0)) goto create_pair; myattr = (subptr[2] << 8) | subptr[3]; break; /* * Our dictionary is broken. */ default: goto create_pair; } switch (vsa_llen) { case 0: attribute = (myvendor << 16) | myattr; ptr += 4 + vsa_tlen; attrlen -= (4 + vsa_tlen); packet_length -= 4 + vsa_tlen; goto create_pair; case 1: if (subptr[vsa_tlen] < (vsa_tlen + vsa_llen + vsa_offset)) goto create_pair; if (subptr[vsa_tlen] > sublen) goto create_pair; /* * WiMAX: 0bCrrrrrrr * Reserved bits MUST be * zero. */ if (vsa_offset && ((subptr[vsa_tlen + vsa_llen] & 0x7f) != 0)) goto create_pair; sublen -= subptr[vsa_tlen]; subptr += subptr[vsa_tlen]; break; case 2: if (subptr[vsa_tlen] != 0) goto create_pair; if (subptr[vsa_tlen + 1] < (vsa_tlen + vsa_llen)) goto create_pair; if (subptr[vsa_tlen + 1] > sublen) goto create_pair; sublen -= subptr[vsa_tlen + 1]; subptr += subptr[vsa_tlen + 1]; break; /* * Our dictionaries are * broken. */ default: goto create_pair; } } while (sublen > 0); vendorcode = myvendor; vendorlen = attrlen - 4; packet_length -= 4; ptr += 4; } /* * attrlen is the length of this attribute. * total_len is the length of the encompassing * attribute. */ switch (vsa_tlen) { case 1: attribute = ptr[0]; break; case 2: attribute = (ptr[0] << 8) | ptr[1]; break; default: /* can't hit this. */ return -1; } attribute |= (vendorcode << 16); vsa_ptr = ptr; ptr += vsa_tlen; switch (vsa_llen) { case 1: attrlen = ptr[0] - (vsa_tlen + vsa_llen + vsa_offset); break; case 2: attrlen = ptr[1] - (vsa_tlen + vsa_llen); break; default: /* can't hit this. */ return -1; } ptr += vsa_llen + vsa_offset; vendorlen -= vsa_tlen + vsa_llen + vsa_offset + attrlen; if (vendorlen == 0) vendorcode = 0; packet_length -= (vsa_tlen + vsa_llen + vsa_offset); /* * Ignore VSAs that have no data. */ if (attrlen == 0) goto next; /* * WiMAX attributes of type 0 are ignored. They * are a secret flag to us that the attribute has * already been dealt with. */ if (attribute == 0x60b50000) goto next; if (vsa_offset) { DICT_ATTR *da; da = dict_attrbyvalue(attribute); /* * If it's NOT continued, AND we know * about it, AND it's not a TLV, we can * create a normal pair. */ if (((vsa_ptr[2] & 0x80) == 0) && da && (da->type != PW_TYPE_TLV)) goto create_pair; /* * Else it IS continued, or it's a TLV. * Go do a lot of work to find the stuff. */ pair = rad_continuation2vp(packet, original, secret, attribute, attrlen, ptr, packet_length, ((vsa_ptr[2] & 0x80) != 0), da); goto created_pair; } /* * Create the attribute, setting the default type * to 'octets'. If the type in the dictionary * is different, then the dictionary type will * over-ride this one. * * If the attribute has no data, then discard it. * * Unless it's CUI. Damn you, CUI! */ create_pair: if (!attrlen && (attribute != PW_CHARGEABLE_USER_IDENTITY)) goto next; pair = rad_attr2vp(packet, original, secret, attribute, attrlen, ptr); if (!pair) { pairfree(&packet->vps); fr_strerror_printf("out of memory"); return -1; } created_pair: *tail = pair; while (pair) { num_attributes++; debug_pair(pair); tail = &pair->next; pair = pair->next; } /* * VSA's may not have been counted properly in * rad_packet_ok() above, as it is hard to count * then without using the dictionary. We * therefore enforce the limits here, too. */ if ((fr_max_attributes > 0) && (num_attributes > fr_max_attributes)) { char host_ipaddr[128]; pairfree(&packet->vps); fr_strerror_printf("WARNING: Possible DoS attack from host %s: Too many attributes in request (received %d, max %d are allowed).", inet_ntop(packet->src_ipaddr.af, &packet->src_ipaddr.ipaddr, host_ipaddr, sizeof(host_ipaddr)), num_attributes, fr_max_attributes); return -1; } next: ptr += attrlen; packet_length -= attrlen; } /* * Merge information from the outside world into our * random pool. */ fr_rand_seed(packet->data, AUTH_HDR_LEN); return 0; } /* * Encode password. * * We assume that the passwd buffer passed is big enough. * RFC2138 says the password is max 128 chars, so the size * of the passwd buffer must be at least 129 characters. * Preferably it's just MAX_STRING_LEN. * * int *pwlen is updated to the new length of the encrypted * password - a multiple of 16 bytes. */ int rad_pwencode(char *passwd, size_t *pwlen, const char *secret, const uint8_t *vector) { FR_MD5_CTX context, old; uint8_t digest[AUTH_VECTOR_LEN]; int i, n, secretlen; int len; /* * RFC maximum is 128 bytes. * * If length is zero, pad it out with zeros. * * If the length isn't aligned to 16 bytes, * zero out the extra data. */ len = *pwlen; if (len > 128) len = 128; if (len == 0) { memset(passwd, 0, AUTH_PASS_LEN); len = AUTH_PASS_LEN; } else if ((len % AUTH_PASS_LEN) != 0) { memset(&passwd[len], 0, AUTH_PASS_LEN - (len % AUTH_PASS_LEN)); len += AUTH_PASS_LEN - (len % AUTH_PASS_LEN); } *pwlen = len; /* * Use the secret to setup the decryption digest */ secretlen = strlen(secret); fr_MD5Init(&context); fr_MD5Update(&context, (const uint8_t *) secret, secretlen); old = context; /* save intermediate work */ /* * Encrypt it in place. Don't bother checking * len, as we've ensured above that it's OK. */ for (n = 0; n < len; n += AUTH_PASS_LEN) { if (n == 0) { fr_MD5Update(&context, vector, AUTH_PASS_LEN); fr_MD5Final(digest, &context); } else { context = old; fr_MD5Update(&context, (uint8_t *) passwd + n - AUTH_PASS_LEN, AUTH_PASS_LEN); fr_MD5Final(digest, &context); } for (i = 0; i < AUTH_PASS_LEN; i++) { passwd[i + n] ^= digest[i]; } } return 0; } /* * Decode password. */ int rad_pwdecode(char *passwd, size_t pwlen, const char *secret, const uint8_t *vector) { FR_MD5_CTX context, old; uint8_t digest[AUTH_VECTOR_LEN]; int i; size_t n, secretlen; /* * The RFC's say that the maximum is 128. * The buffer we're putting it into above is 254, so * we don't need to do any length checking. */ if (pwlen > 128) pwlen = 128; /* * Catch idiots. */ if (pwlen == 0) goto done; /* * Use the secret to setup the decryption digest */ secretlen = strlen(secret); fr_MD5Init(&context); fr_MD5Update(&context, (const uint8_t *) secret, secretlen); old = context; /* save intermediate work */ /* * The inverse of the code above. */ for (n = 0; n < pwlen; n += AUTH_PASS_LEN) { if (n == 0) { fr_MD5Update(&context, vector, AUTH_VECTOR_LEN); fr_MD5Final(digest, &context); context = old; if (pwlen > AUTH_PASS_LEN) { fr_MD5Update(&context, (uint8_t *) passwd, AUTH_PASS_LEN); } } else { fr_MD5Final(digest, &context); context = old; if (pwlen > (n + AUTH_PASS_LEN)) { fr_MD5Update(&context, (uint8_t *) passwd + n, AUTH_PASS_LEN); } } for (i = 0; i < AUTH_PASS_LEN; i++) { passwd[i + n] ^= digest[i]; } } done: passwd[pwlen] = '\0'; return strlen(passwd); } /* * Encode Tunnel-Password attributes when sending them out on the wire. * * int *pwlen is updated to the new length of the encrypted * password - a multiple of 16 bytes. * * This is per RFC-2868 which adds a two char SALT to the initial intermediate * value MD5 hash. */ int rad_tunnel_pwencode(char *passwd, size_t *pwlen, const char *secret, const uint8_t *vector) { uint8_t buffer[AUTH_VECTOR_LEN + MAX_STRING_LEN + 3]; unsigned char digest[AUTH_VECTOR_LEN]; char* salt; int i, n, secretlen; unsigned len, n2; len = *pwlen; if (len > 127) len = 127; /* * Shift the password 3 positions right to place a salt and original * length, tag will be added automatically on packet send */ for (n=len ; n>=0 ; n--) passwd[n+3] = passwd[n]; salt = passwd; passwd += 2; /* * save original password length as first password character; */ *passwd = len; len += 1; /* * Generate salt. The RFC's say: * * The high bit of salt[0] must be set, each salt in a * packet should be unique, and they should be random * * So, we set the high bit, add in a counter, and then * add in some CSPRNG data. should be OK.. */ salt[0] = (0x80 | ( ((salt_offset++) & 0x0f) << 3) | (fr_rand() & 0x07)); salt[1] = fr_rand(); /* * Padd password to multiple of AUTH_PASS_LEN bytes. */ n = len % AUTH_PASS_LEN; if (n) { n = AUTH_PASS_LEN - n; for (; n > 0; n--, len++) passwd[len] = 0; } /* set new password length */ *pwlen = len + 2; /* * Use the secret to setup the decryption digest */ secretlen = strlen(secret); memcpy(buffer, secret, secretlen); for (n2 = 0; n2 < len; n2+=AUTH_PASS_LEN) { if (!n2) { memcpy(buffer + secretlen, vector, AUTH_VECTOR_LEN); memcpy(buffer + secretlen + AUTH_VECTOR_LEN, salt, 2); fr_md5_calc(digest, buffer, secretlen + AUTH_VECTOR_LEN + 2); } else { memcpy(buffer + secretlen, passwd + n2 - AUTH_PASS_LEN, AUTH_PASS_LEN); fr_md5_calc(digest, buffer, secretlen + AUTH_PASS_LEN); } for (i = 0; i < AUTH_PASS_LEN; i++) { passwd[i + n2] ^= digest[i]; } } passwd[n2] = 0; return 0; } /* * Decode Tunnel-Password encrypted attributes. * * Defined in RFC-2868, this uses a two char SALT along with the * initial intermediate value, to differentiate it from the * above. */ int rad_tunnel_pwdecode(uint8_t *passwd, size_t *pwlen, const char *secret, const uint8_t *vector) { FR_MD5_CTX context, old; uint8_t digest[AUTH_VECTOR_LEN]; int secretlen; unsigned i, n, len, reallen; len = *pwlen; /* * We need at least a salt. */ if (len < 2) { fr_strerror_printf("tunnel password is too short"); return -1; } /* * There's a salt, but no password. Or, there's a salt * and a 'data_len' octet. It's wrong, but at least we * can figure out what it means: the password is empty. * * Note that this means we ignore the 'data_len' field, * if the attribute length tells us that there's no * more data. So the 'data_len' field may be wrong, * but that's ok... */ if (len <= 3) { passwd[0] = 0; *pwlen = 0; return 0; } len -= 2; /* discount the salt */ /* * Use the secret to setup the decryption digest */ secretlen = strlen(secret); fr_MD5Init(&context); fr_MD5Update(&context, (const uint8_t *) secret, secretlen); old = context; /* save intermediate work */ /* * Set up the initial key: * * b(1) = MD5(secret + vector + salt) */ fr_MD5Update(&context, vector, AUTH_VECTOR_LEN); fr_MD5Update(&context, passwd, 2); reallen = 0; for (n = 0; n < len; n += AUTH_PASS_LEN) { int base = 0; if (n == 0) { fr_MD5Final(digest, &context); context = old; /* * A quick check: decrypt the first octet * of the password, which is the * 'data_len' field. Ensure it's sane. */ reallen = passwd[2] ^ digest[0]; if (reallen >= len) { fr_strerror_printf("tunnel password is too long for the attribute"); return -1; } fr_MD5Update(&context, passwd + 2, AUTH_PASS_LEN); base = 1; } else { fr_MD5Final(digest, &context); context = old; fr_MD5Update(&context, passwd + n + 2, AUTH_PASS_LEN); } for (i = base; i < AUTH_PASS_LEN; i++) { passwd[n + i - 1] = passwd[n + i + 2] ^ digest[i]; } } /* * See make_tunnel_password, above. */ if (reallen > 239) reallen = 239; *pwlen = reallen; passwd[reallen] = 0; return reallen; } /* * Encode a CHAP password * * FIXME: might not work with Ascend because * we use vp->length, and Ascend gear likes * to send an extra '\0' in the string! */ int rad_chap_encode(RADIUS_PACKET *packet, uint8_t *output, int id, VALUE_PAIR *password) { int i; uint8_t *ptr; uint8_t string[MAX_STRING_LEN * 2 + 1]; VALUE_PAIR *challenge; /* * Sanity check the input parameters */ if ((packet == NULL) || (password == NULL)) { return -1; } /* * Note that the password VP can be EITHER * a User-Password attribute (from a check-item list), * or a CHAP-Password attribute (the client asking * the library to encode it). */ i = 0; ptr = string; *ptr++ = id; i++; memcpy(ptr, password->vp_strvalue, password->length); ptr += password->length; i += password->length; /* * Use Chap-Challenge pair if present, * Request Authenticator otherwise. */ challenge = pairfind(packet->vps, PW_CHAP_CHALLENGE); if (challenge) { memcpy(ptr, challenge->vp_strvalue, challenge->length); i += challenge->length; } else { memcpy(ptr, packet->vector, AUTH_VECTOR_LEN); i += AUTH_VECTOR_LEN; } *output = id; fr_md5_calc((uint8_t *)output + 1, (uint8_t *)string, i); return 0; } /* * Seed the random number generator. * * May be called any number of times. */ void fr_rand_seed(const void *data, size_t size) { uint32_t hash; /* * Ensure that the pool is initialized. */ if (!fr_rand_initialized) { int fd; memset(&fr_rand_pool, 0, sizeof(fr_rand_pool)); fd = open("/dev/urandom", O_RDONLY); if (fd >= 0) { size_t total; ssize_t this; total = this = 0; while (total < sizeof(fr_rand_pool.randrsl)) { this = read(fd, fr_rand_pool.randrsl, sizeof(fr_rand_pool.randrsl) - total); if ((this < 0) && (errno != EINTR)) break; if (this > 0) total += this; } close(fd); } else { fr_rand_pool.randrsl[0] = fd; fr_rand_pool.randrsl[1] = time(NULL); fr_rand_pool.randrsl[2] = errno; } fr_randinit(&fr_rand_pool, 1); fr_rand_pool.randcnt = 0; fr_rand_initialized = 1; } if (!data) return; /* * Hash the user data */ hash = fr_rand(); if (!hash) hash = fr_rand(); hash = fr_hash_update(data, size, hash); fr_rand_pool.randmem[fr_rand_pool.randcnt] ^= hash; } /* * Return a 32-bit random number. */ uint32_t fr_rand(void) { uint32_t num; /* * Ensure that the pool is initialized. */ if (!fr_rand_initialized) { fr_rand_seed(NULL, 0); } num = fr_rand_pool.randrsl[fr_rand_pool.randcnt++]; if (fr_rand_pool.randcnt >= 256) { fr_rand_pool.randcnt = 0; fr_isaac(&fr_rand_pool); } return num; } /* * Allocate a new RADIUS_PACKET */ RADIUS_PACKET *rad_alloc(int newvector) { RADIUS_PACKET *rp; if ((rp = malloc(sizeof(RADIUS_PACKET))) == NULL) { fr_strerror_printf("out of memory"); return NULL; } memset(rp, 0, sizeof(*rp)); rp->id = -1; rp->offset = -1; if (newvector) { int i; uint32_t hash, base; /* * Don't expose the actual contents of the random * pool. */ base = fr_rand(); for (i = 0; i < AUTH_VECTOR_LEN; i += sizeof(uint32_t)) { hash = fr_rand() ^ base; memcpy(rp->vector + i, &hash, sizeof(hash)); } } fr_rand(); /* stir the pool again */ return rp; } RADIUS_PACKET *rad_alloc_reply(RADIUS_PACKET *packet) { RADIUS_PACKET *reply; if (!packet) return NULL; reply = rad_alloc(0); if (!reply) return NULL; /* * Initialize the fields from the request. */ reply->sockfd = packet->sockfd; reply->dst_ipaddr = packet->src_ipaddr; reply->src_ipaddr = packet->dst_ipaddr; reply->dst_port = packet->src_port; reply->src_port = packet->dst_port; reply->id = packet->id; reply->code = 0; /* UNKNOWN code */ memcpy(reply->vector, packet->vector, sizeof(reply->vector)); reply->vps = NULL; reply->data = NULL; reply->data_len = 0; return reply; } /* * Free a RADIUS_PACKET */ void rad_free(RADIUS_PACKET **radius_packet_ptr) { RADIUS_PACKET *radius_packet; if (!radius_packet_ptr || !*radius_packet_ptr) return; radius_packet = *radius_packet_ptr; free(radius_packet->data); pairfree(&radius_packet->vps); free(radius_packet); *radius_packet_ptr = NULL; } freeradius-server/src/lib/rbtree.c000066400000000000000000000325321257552170400175140ustar00rootroot00000000000000/* * rbtree.c Red-black balanced binary trees. * * Version: $Id$ * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2004,2006 The FreeRADIUS server project */ #include RCSID("$Id$") #include /* red-black tree description */ typedef enum { Black, Red } NodeColor; struct rbnode_t { rbnode_t *Left; /* left child */ rbnode_t *Right; /* right child */ rbnode_t *Parent; /* parent */ NodeColor Color; /* node color (black, red) */ void *Data; /* data stored in node */ }; #define NIL &Sentinel /* all leafs are sentinels */ static rbnode_t Sentinel = { NIL, NIL, NULL, Black, NULL}; struct rbtree_t { #ifndef NDEBUG uint32_t magic; #endif rbnode_t *Root; int num_elements; int (*Compare)(const void *, const void *); int replace_flag; void (*freeNode)(void *); }; #define RBTREE_MAGIC (0x5ad09c42) /* * Walks the tree to delete all nodes. * Does NOT re-balance it! */ static void FreeWalker(rbtree_t *tree, rbnode_t *X) { if (X->Left != NIL) FreeWalker(tree, X->Left); if (X->Right != NIL) FreeWalker(tree, X->Right); if (tree->freeNode) tree->freeNode(X->Data); free(X); } void rbtree_free(rbtree_t *tree) { if (!tree) return; /* * Walk the tree, deleting the nodes... */ if (tree->Root != NIL) FreeWalker(tree, tree->Root); #ifndef NDEBUG tree->magic = 0; #endif tree->Root = NULL; free(tree); } /* * Create a new red-black tree. */ rbtree_t *rbtree_create(int (*Compare)(const void *, const void *), void (*freeNode)(void *), int replace_flag) { rbtree_t *tree; if (!Compare) return NULL; tree = malloc(sizeof(*tree)); if (!tree) return NULL; memset(tree, 0, sizeof(*tree)); #ifndef NDEBUG tree->magic = RBTREE_MAGIC; #endif tree->Root = NIL; tree->Compare = Compare; tree->replace_flag = replace_flag; tree->freeNode = freeNode; return tree; } static void RotateLeft(rbtree_t *tree, rbnode_t *X) { /************************** * rotate Node X to left * **************************/ rbnode_t *Y = X->Right; /* establish X->Right link */ X->Right = Y->Left; if (Y->Left != NIL) Y->Left->Parent = X; /* establish Y->Parent link */ if (Y != NIL) Y->Parent = X->Parent; if (X->Parent) { if (X == X->Parent->Left) X->Parent->Left = Y; else X->Parent->Right = Y; } else { tree->Root = Y; } /* link X and Y */ Y->Left = X; if (X != NIL) X->Parent = Y; } static void RotateRight(rbtree_t *tree, rbnode_t *X) { /**************************** * rotate Node X to right * ****************************/ rbnode_t *Y = X->Left; /* establish X->Left link */ X->Left = Y->Right; if (Y->Right != NIL) Y->Right->Parent = X; /* establish Y->Parent link */ if (Y != NIL) Y->Parent = X->Parent; if (X->Parent) { if (X == X->Parent->Right) X->Parent->Right = Y; else X->Parent->Left = Y; } else { tree->Root = Y; } /* link X and Y */ Y->Right = X; if (X != NIL) X->Parent = Y; } static void InsertFixup(rbtree_t *tree, rbnode_t *X) { /************************************* * maintain red-black tree balance * * after inserting node X * *************************************/ /* check red-black properties */ while (X != tree->Root && X->Parent->Color == Red) { /* we have a violation */ if (X->Parent == X->Parent->Parent->Left) { rbnode_t *Y = X->Parent->Parent->Right; if (Y->Color == Red) { /* uncle is red */ X->Parent->Color = Black; Y->Color = Black; X->Parent->Parent->Color = Red; X = X->Parent->Parent; } else { /* uncle is black */ if (X == X->Parent->Right) { /* make X a left child */ X = X->Parent; RotateLeft(tree, X); } /* recolor and rotate */ X->Parent->Color = Black; X->Parent->Parent->Color = Red; RotateRight(tree, X->Parent->Parent); } } else { /* mirror image of above code */ rbnode_t *Y = X->Parent->Parent->Left; if (Y->Color == Red) { /* uncle is red */ X->Parent->Color = Black; Y->Color = Black; X->Parent->Parent->Color = Red; X = X->Parent->Parent; } else { /* uncle is black */ if (X == X->Parent->Left) { X = X->Parent; RotateRight(tree, X); } X->Parent->Color = Black; X->Parent->Parent->Color = Red; RotateLeft(tree, X->Parent->Parent); } } } tree->Root->Color = Black; } /* * Insert an element into the tree. */ rbnode_t *rbtree_insertnode(rbtree_t *tree, void *Data) { rbnode_t *Current, *Parent, *X; /*********************************************** * allocate node for Data and insert in tree * ***********************************************/ /* find where node belongs */ Current = tree->Root; Parent = NULL; while (Current != NIL) { int result; /* * See if two entries are identical. */ result = tree->Compare(Data, Current->Data); if (result == 0) { /* * Don't replace the entry. */ if (tree->replace_flag == 0) { return NULL; } /* * Do replace the entry. */ if (tree->freeNode) tree->freeNode(Current->Data); Current->Data = Data; return Current; } Parent = Current; Current = (result < 0) ? Current->Left : Current->Right; } /* setup new node */ if ((X = malloc (sizeof(*X))) == NULL) { exit(1); /* FIXME! */ } X->Data = Data; X->Parent = Parent; X->Left = NIL; X->Right = NIL; X->Color = Red; /* insert node in tree */ if (Parent) { if (tree->Compare(Data, Parent->Data) <= 0) Parent->Left = X; else Parent->Right = X; } else { tree->Root = X; } InsertFixup(tree, X); tree->num_elements++; return X; } int rbtree_insert(rbtree_t *tree, void *Data) { if (rbtree_insertnode(tree, Data)) return 1; return 0; } static void DeleteFixup(rbtree_t *tree, rbnode_t *X, rbnode_t *Parent) { /************************************* * maintain red-black tree balance * * after deleting node X * *************************************/ while (X != tree->Root && X->Color == Black) { if (X == Parent->Left) { rbnode_t *W = Parent->Right; if (W->Color == Red) { W->Color = Black; Parent->Color = Red; /* Parent != NIL? */ RotateLeft(tree, Parent); W = Parent->Right; } if (W->Left->Color == Black && W->Right->Color == Black) { if (W != NIL) W->Color = Red; X = Parent; Parent = X->Parent; } else { if (W->Right->Color == Black) { if (W->Left != NIL) W->Left->Color = Black; W->Color = Red; RotateRight(tree, W); W = Parent->Right; } W->Color = Parent->Color; if (Parent != NIL) Parent->Color = Black; if (W->Right->Color != Black) { W->Right->Color = Black; } RotateLeft(tree, Parent); X = tree->Root; } } else { rbnode_t *W = Parent->Left; if (W->Color == Red) { W->Color = Black; Parent->Color = Red; /* Parent != NIL? */ RotateRight(tree, Parent); W = Parent->Left; } if (W->Right->Color == Black && W->Left->Color == Black) { if (W != NIL) W->Color = Red; X = Parent; Parent = X->Parent; } else { if (W->Left->Color == Black) { if (W->Right != NIL) W->Right->Color = Black; W->Color = Red; RotateLeft(tree, W); W = Parent->Left; } W->Color = Parent->Color; if (Parent != NIL) Parent->Color = Black; if (W->Left->Color != Black) { W->Left->Color = Black; } RotateRight(tree, Parent); X = tree->Root; } } } if (X != NIL) X->Color = Black; /* Avoid cache-dirty on NIL */ } /* * Delete an element from the tree. */ void rbtree_delete(rbtree_t *tree, rbnode_t *Z) { rbnode_t *X, *Y; rbnode_t *Parent; /***************************** * delete node Z from tree * *****************************/ if (!Z || Z == NIL) return; if (Z->Left == NIL || Z->Right == NIL) { /* Y has a NIL node as a child */ Y = Z; } else { /* find tree successor with a NIL node as a child */ Y = Z->Right; while (Y->Left != NIL) Y = Y->Left; } /* X is Y's only child */ if (Y->Left != NIL) X = Y->Left; else X = Y->Right; /* may be NIL! */ /* remove Y from the parent chain */ Parent = Y->Parent; if (X != NIL) X->Parent = Parent; if (Parent) if (Y == Parent->Left) Parent->Left = X; else Parent->Right = X; else tree->Root = X; if (Y != Z) { if (tree->freeNode) tree->freeNode(Z->Data); Z->Data = Y->Data; Y->Data = NULL; if (Y->Color == Black) DeleteFixup(tree, X, Parent); /* * The user structure in Y->Data MAY include a * pointer to Y. In that case, we CANNOT delete * Y. Instead, we copy Z (which is now in the * tree) to Y, and fix up the parent/child * pointers. */ memcpy(Y, Z, sizeof(*Y)); if (!Y->Parent) { tree->Root = Y; } else { if (Y->Parent->Left == Z) Y->Parent->Left = Y; if (Y->Parent->Right == Z) Y->Parent->Right = Y; } if (Y->Left->Parent == Z) Y->Left->Parent = Y; if (Y->Right->Parent == Z) Y->Right->Parent = Y; free(Z); } else { if (tree->freeNode) tree->freeNode(Y->Data); if (Y->Color == Black) DeleteFixup(tree, X, Parent); free(Y); } tree->num_elements--; } /* * Delete a node from the tree, based on given data, which MUST * have come from rbtree_finddata(). */ int rbtree_deletebydata(rbtree_t *tree, const void *data) { rbnode_t *node = rbtree_find(tree, data); if (!node) return 0; /* false */ rbtree_delete(tree, node); return 1; } /* * Find an element in the tree, returning the data, not the node. */ rbnode_t *rbtree_find(rbtree_t *tree, const void *Data) { /******************************* * find node containing Data * *******************************/ rbnode_t *Current = tree->Root; while (Current != NIL) { int result = tree->Compare(Data, Current->Data); if (result == 0) { return Current; } else { Current = (result < 0) ? Current->Left : Current->Right; } } return NULL; } /* * Find the user data. */ void *rbtree_finddata(rbtree_t *tree, const void *Data) { rbnode_t *X; X = rbtree_find(tree, Data); if (!X) return NULL; return X->Data; } /* * Walk the tree, Pre-order * * We call ourselves recursively for each function, but that's OK, * as the stack is only log(N) deep, which is ~12 entries deep. */ static int WalkNodePreOrder(rbnode_t *X, int (*callback)(void *, void *), void *context) { int rcode; rbnode_t *Left, *Right; Left = X->Left; Right = X->Right; rcode = callback(context, X->Data); if (rcode != 0) return rcode; if (Left != NIL) { rcode = WalkNodePreOrder(Left, callback, context); if (rcode != 0) return rcode; } if (Right != NIL) { rcode = WalkNodePreOrder(Right, callback, context); if (rcode != 0) return rcode; } return 0; /* we know everything returned zero */ } /* * Inorder */ static int WalkNodeInOrder(rbnode_t *X, int (*callback)(void *, void *), void *context) { int rcode; rbnode_t *Right; if (X->Left != NIL) { rcode = WalkNodeInOrder(X->Left, callback, context); if (rcode != 0) return rcode; } Right = X->Right; rcode = callback(context, X->Data); if (rcode != 0) return rcode; if (Right != NIL) { rcode = WalkNodeInOrder(Right, callback, context); if (rcode != 0) return rcode; } return 0; /* we know everything returned zero */ } /* * PostOrder */ static int WalkNodePostOrder(rbnode_t *X, int (*callback)(void *, void*), void *context) { int rcode; if (X->Left != NIL) { rcode = WalkNodePostOrder(X->Left, callback, context); if (rcode != 0) return rcode; } if (X->Right != NIL) { rcode = WalkNodePostOrder(X->Right, callback, context); if (rcode != 0) return rcode; } rcode = callback(context, X->Data); if (rcode != 0) return rcode; return 0; /* we know everything returned zero */ } /* * Walk the entire tree. The callback function CANNOT modify * the tree. * * The callback function should return 0 to continue walking. * Any other value stops the walk, and is returned. */ int rbtree_walk(rbtree_t *tree, RBTREE_ORDER order, int (*callback)(void *, void *), void *context) { if (tree->Root == NIL) return 0; switch (order) { case PreOrder: return WalkNodePreOrder(tree->Root, callback, context); case InOrder: return WalkNodeInOrder(tree->Root, callback, context); case PostOrder: return WalkNodePostOrder(tree->Root, callback, context); default: break; } return -1; } int rbtree_num_elements(rbtree_t *tree) { if (!tree) return 0; return tree->num_elements; } /* * Given a Node, return the data. */ void *rbtree_node2data(rbtree_t *tree, rbnode_t *node) { tree = tree; /* -Wunused */ if (!node) return NULL; return node->Data; } /* * Return left-most child. */ void *rbtree_min(rbtree_t *tree) { rbnode_t *Current; if (!tree || !tree->Root) return NULL; Current = tree->Root; while (Current->Left != NIL) Current = Current->Left; return Current->Data; } freeradius-server/src/lib/sha1.c000066400000000000000000000135631257552170400170700ustar00rootroot00000000000000/* * SHA-1 in C * By Steve Reid * 100% Public Domain * * Version: $Id$ */ #include RCSID("$Id$") #include #include #include "../include/sha1.h" #ifndef WITH_OPENSSL_SHA1 #define blk0(i) (block->l[i] = htonl(block->l[i])) #define rol(value, bits) (((value) << (bits)) | ((value) >> (32 - (bits)))) /* blk0() and blk() perform the initial expand. */ /* I got the idea of expanding during the round function from SSLeay */ #define blk0(i) (block->l[i] = htonl(block->l[i])) #define blk(i) (block->l[i&15] = rol(block->l[(i+13)&15]^block->l[(i+8)&15] \ ^block->l[(i+2)&15]^block->l[i&15],1)) /* (R0+R1), R2, R3, R4 are the different operations used in SHA1 */ #define R0(v,w,x,y,z,i) z+=((w&(x^y))^y)+blk0(i)+0x5A827999+rol(v,5);w=rol(w,30); #define R1(v,w,x,y,z,i) z+=((w&(x^y))^y)+blk(i)+0x5A827999+rol(v,5);w=rol(w,30); #define R2(v,w,x,y,z,i) z+=(w^x^y)+blk(i)+0x6ED9EBA1+rol(v,5);w=rol(w,30); #define R3(v,w,x,y,z,i) z+=(((w|x)&y)|(w&x))+blk(i)+0x8F1BBCDC+rol(v,5);w=rol(w,30); #define R4(v,w,x,y,z,i) z+=(w^x^y)+blk(i)+0xCA62C1D6+rol(v,5);w=rol(w,30); /* Hash a single 512-bit block. This is the core of the algorithm. */ void fr_SHA1Transform(uint32_t state[5], const uint8_t buffer[64]) { uint32_t a, b, c, d, e; typedef union { uint8_t c[64]; uint32_t l[16]; } CHAR64LONG16; CHAR64LONG16 *block; uint8_t workspace[64]; block = (CHAR64LONG16*)workspace; memcpy(block, buffer, 64); /* Copy context->state[] to working vars */ a = state[0]; b = state[1]; c = state[2]; d = state[3]; e = state[4]; /* 4 rounds of 20 operations each. Loop unrolled. */ R0(a,b,c,d,e, 0); R0(e,a,b,c,d, 1); R0(d,e,a,b,c, 2); R0(c,d,e,a,b, 3); R0(b,c,d,e,a, 4); R0(a,b,c,d,e, 5); R0(e,a,b,c,d, 6); R0(d,e,a,b,c, 7); R0(c,d,e,a,b, 8); R0(b,c,d,e,a, 9); R0(a,b,c,d,e,10); R0(e,a,b,c,d,11); R0(d,e,a,b,c,12); R0(c,d,e,a,b,13); R0(b,c,d,e,a,14); R0(a,b,c,d,e,15); R1(e,a,b,c,d,16); R1(d,e,a,b,c,17); R1(c,d,e,a,b,18); R1(b,c,d,e,a,19); R2(a,b,c,d,e,20); R2(e,a,b,c,d,21); R2(d,e,a,b,c,22); R2(c,d,e,a,b,23); R2(b,c,d,e,a,24); R2(a,b,c,d,e,25); R2(e,a,b,c,d,26); R2(d,e,a,b,c,27); R2(c,d,e,a,b,28); R2(b,c,d,e,a,29); R2(a,b,c,d,e,30); R2(e,a,b,c,d,31); R2(d,e,a,b,c,32); R2(c,d,e,a,b,33); R2(b,c,d,e,a,34); R2(a,b,c,d,e,35); R2(e,a,b,c,d,36); R2(d,e,a,b,c,37); R2(c,d,e,a,b,38); R2(b,c,d,e,a,39); R3(a,b,c,d,e,40); R3(e,a,b,c,d,41); R3(d,e,a,b,c,42); R3(c,d,e,a,b,43); R3(b,c,d,e,a,44); R3(a,b,c,d,e,45); R3(e,a,b,c,d,46); R3(d,e,a,b,c,47); R3(c,d,e,a,b,48); R3(b,c,d,e,a,49); R3(a,b,c,d,e,50); R3(e,a,b,c,d,51); R3(d,e,a,b,c,52); R3(c,d,e,a,b,53); R3(b,c,d,e,a,54); R3(a,b,c,d,e,55); R3(e,a,b,c,d,56); R3(d,e,a,b,c,57); R3(c,d,e,a,b,58); R3(b,c,d,e,a,59); R4(a,b,c,d,e,60); R4(e,a,b,c,d,61); R4(d,e,a,b,c,62); R4(c,d,e,a,b,63); R4(b,c,d,e,a,64); R4(a,b,c,d,e,65); R4(e,a,b,c,d,66); R4(d,e,a,b,c,67); R4(c,d,e,a,b,68); R4(b,c,d,e,a,69); R4(a,b,c,d,e,70); R4(e,a,b,c,d,71); R4(d,e,a,b,c,72); R4(c,d,e,a,b,73); R4(b,c,d,e,a,74); R4(a,b,c,d,e,75); R4(e,a,b,c,d,76); R4(d,e,a,b,c,77); R4(c,d,e,a,b,78); R4(b,c,d,e,a,79); /* Add the working vars back into context.state[] */ state[0] += a; state[1] += b; state[2] += c; state[3] += d; state[4] += e; /* Wipe variables */ a = b = c = d = e = 0; } /* fr_SHA1Init - Initialize new context */ void fr_SHA1Init(fr_SHA1_CTX* context) { /* SHA1 initialization constants */ context->state[0] = 0x67452301; context->state[1] = 0xEFCDAB89; context->state[2] = 0x98BADCFE; context->state[3] = 0x10325476; context->state[4] = 0xC3D2E1F0; context->count[0] = context->count[1] = 0; } /* Run your data through this. */ void fr_SHA1Update(fr_SHA1_CTX* context, const uint8_t* data, unsigned int len) { unsigned int i, j; j = (context->count[0] >> 3) & 63; if ((context->count[0] += len << 3) < (len << 3)) context->count[1]++; context->count[1] += (len >> 29); if ((j + len) > 63) { memcpy(&context->buffer[j], data, (i = 64-j)); fr_SHA1Transform(context->state, context->buffer); for ( ; i + 63 < len; i += 64) { fr_SHA1Transform(context->state, &data[i]); } j = 0; } else i = 0; memcpy(&context->buffer[j], &data[i], len - i); } /* Add padding and return the message digest. */ void fr_SHA1Final(uint8_t digest[20], fr_SHA1_CTX* context) { uint32_t i, j; uint8_t finalcount[8]; for (i = 0; i < 8; i++) { finalcount[i] = (uint8_t)((context->count[(i >= 4 ? 0 : 1)] >> ((3-(i & 3)) * 8) ) & 255); /* Endian independent */ } fr_SHA1Update(context, (const unsigned char *) "\200", 1); while ((context->count[0] & 504) != 448) { fr_SHA1Update(context, (const unsigned char *) "\0", 1); } fr_SHA1Update(context, finalcount, 8); /* Should cause a fr_SHA1Transform() */ for (i = 0; i < 20; i++) { digest[i] = (uint8_t) ((context->state[i>>2] >> ((3-(i & 3)) * 8) ) & 255); } /* Wipe variables */ i = j = 0; memset(context->buffer, 0, 64); memset(context->state, 0, 20); memset(context->count, 0, 8); memset(&finalcount, 0, 8); #ifdef SHA1HANDSOFF /* make fr_SHA1Transform overwrite it's own static vars */ fr_SHA1Transform(context->state, context->buffer); #endif } void fr_SHA1FinalNoLen(uint8_t digest[20], fr_SHA1_CTX* context) { uint32_t i, j; for (i = 0; i < 20; i++) { digest[i] = (uint8_t) ((context->state[i>>2] >> ((3-(i & 3)) * 8) ) & 255); } /* Wipe variables */ i = j = 0; memset(context->buffer, 0, 64); memset(context->state, 0, 20); memset(context->count, 0, 8); #ifdef SHA1HANDSOFF /* make fr_SHA1Transform overwrite it's own static vars */ fr_SHA1Transform(context->state, context->buffer); #endif } #endif freeradius-server/src/lib/snprintf.c000066400000000000000000000520521257552170400200730ustar00rootroot00000000000000 /* Unix snprintf implementation. Version 1.4 This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. Revision History: 1.4: * integrate in FreeRADIUS's libradius: * Fetched from: http://savannah.gnu.org/cgi-bin/viewcvs/mailutils/mailutils/lib/snprintf.c?rev=1.4 * Fetched from: http://savannah.gnu.org/cgi-bin/viewcvs/mailutils/mailutils/lib/snprintf.h?rev=1.4 * Replace config.h with autoconf.h * Protect with HAVE_SNPRINTF and HAVE_VSNPRINTF 1.3: * add #include ifdef HAVE_CONFIG_H * cosmetic change, when exponent is 0 print xxxE+00 instead of xxxE-00 1.2: * put the program under LGPL. 1.1: * added changes from Miles Bader * corrected a bug with %f * added support for %#g * added more comments :-) 1.0: * supporting must ANSI syntaxic_sugars 0.0: * suppot %s %c %d THANKS(for the patches and ideas): Miles Bader Cyrille Rustom Jacek Slabocewiz Mike Parker(mouse) */ #include RCSID("$Id$") #include #include "snprintf.h" #ifndef HAVE_VSNPRINTF /* * Find the nth power of 10 */ PRIVATE double #ifdef __STDC__ pow_10(int n) #else pow_10(n) int n; #endif { int i; double P; if (n < 0) for (i = 1, P = 1., n = -n ; i <= n ; i++) {P *= .1;} else for (i = 1, P = 1. ; i <= n ; i++) {P *= 10.0;} return P; } /* * Find the integral part of the log in base 10 * Note: this not a real log10() I just need and approximation(integerpart) of x in: 10^x ~= r * log_10(200) = 2; * log_10(250) = 2; */ PRIVATE int #ifdef __STDC__ log_10(double r) #else log_10(r) double r; #endif { int i = 0; double result = 1.; if (r < 0.) r = -r; if (r < 1.) { while (result >= r) {result *= .1; i++;} return (-i); } else { while (result <= r) {result *= 10.; i++;} return (i - 1); } } /* * This function return the fraction part of a double * and set in ip the integral part. * In many ways it resemble the modf() found on most Un*x */ PRIVATE double #ifdef __STDC__ integral(double real, double * ip) #else integral(real, ip) double real; double * ip; #endif { int j; double i, s, p; double real_integral = 0.; /* take care of the obvious */ /* equal to zero ? */ if (real == 0.) { *ip = 0.; return (0.); } /* negative number ? */ if (real < 0.) real = -real; /* a fraction ? */ if ( real < 1.) { *ip = 0.; return real; } /* the real work :-) */ for (j = log_10(real); j >= 0; j--) { p = pow_10(j); s = (real - real_integral)/p; i = 0.; while (i + 1. <= s) {i++;} real_integral += i*p; } *ip = real_integral; return (real - real_integral); } #define PRECISION 1.e-6 /* * return an ascii representation of the integral part of the number * and set fract to be an ascii representation of the fraction part * the container for the fraction and the integral part or staticly * declare with fix size */ PRIVATE char * #ifdef __STDC__ numtoa(double number, int base, int precision, char ** fract) #else numtoa(number, base, precision, fract) double number; int base; int precision; char ** fract; #endif { register int i, j; double ip, fp; /* integer and fraction part */ double fraction; int digits = MAX_INT - 1; static char integral_part[MAX_INT]; static char fraction_part[MAX_FRACT]; double sign; int ch; /* taking care of the obvious case: 0.0 */ if (number == 0.) { integral_part[0] = '0'; integral_part[1] = '\0'; fraction_part[0] = '0'; fraction_part[1] = '\0'; return integral_part; } /* for negative numbers */ if ((sign = number) < 0.) { number = -number; digits--; /* sign consume one digit */ } fraction = integral(number, &ip); number = ip; /* do the integral part */ if ( ip == 0.) { integral_part[0] = '0'; i = 1; } else { for ( i = 0; i < digits && number != 0.; ++i) { number /= base; fp = integral(number, &ip); ch = (int)((fp + PRECISION)*base); /* force to round */ integral_part[i] = (ch <= 9) ? ch + '0' : ch + 'a' - 10; if (! isxdigit(integral_part[i])) /* bail out overflow !! */ break; number = ip; } } /* Oh No !! out of bound, ho well fill it up ! */ if (number != 0.) for (i = 0; i < digits; ++i) integral_part[i] = '9'; /* put the sign ? */ if (sign < 0.) integral_part[i++] = '-'; integral_part[i] = '\0'; /* reverse every thing */ for ( i--, j = 0; j < i; j++, i--) SWAP_INT(integral_part[i], integral_part[j]); /* the fractionnal part */ for (i=0, fp=fraction; precision > 0 && i < MAX_FRACT ; i++, precision-- ) { fraction_part[i] = (int)((fp + PRECISION)*10. + '0'); if (! isdigit(fraction_part[i])) /* underflow ? */ break; fp = (fp*10.0) - (double)(long)((fp + PRECISION)*10.); } fraction_part[i] = '\0'; if (fract != (char **)0) *fract = fraction_part; return integral_part; } /* for %d and friends, it puts in holder * the representation with the right padding */ PRIVATE void #ifdef __STDC__ decimal(struct DATA *p, double d) #else decimal(p, d) struct DATA *p; double d; #endif { char *tmp; tmp = itoa(d); p->width -= strlen(tmp); PAD_RIGHT(p); PUT_PLUS(d, p); PUT_SPACE(d, p); while (*tmp) { /* the integral */ PUT_CHAR(*tmp, p); tmp++; } PAD_LEFT(p); } /* for %o octal representation */ PRIVATE void #ifdef __STDC__ octal(struct DATA *p, double d) #else octal(p, d) struct DATA *p; double d; #endif { char *tmp; tmp = otoa(d); p->width -= strlen(tmp); PAD_RIGHT(p); if (p->square == FOUND) /* had prefix '0' for octal */ PUT_CHAR('0', p); while (*tmp) { /* octal */ PUT_CHAR(*tmp, p); tmp++; } PAD_LEFT(p); } /* for %x %X hexadecimal representation */ PRIVATE void #ifdef __STDC__ hexa(struct DATA *p, double d) #else hexa(p, d) struct DATA *p; double d; #endif { char *tmp; tmp = htoa(d); p->width -= strlen(tmp); PAD_RIGHT(p); if (p->square == FOUND) { /* prefix '0x' for hexa */ PUT_CHAR('0', p); PUT_CHAR(*p->pf, p); } while (*tmp) { /* hexa */ PUT_CHAR((*p->pf == 'X' ? toupper(*tmp) : *tmp), p); tmp++; } PAD_LEFT(p); } /* %s strings */ PRIVATE void #ifdef __STDC__ strings(struct DATA *p, char *tmp) #else strings(p, tmp) struct DATA *p; char *tmp; #endif { int i; i = strlen(tmp); if (p->precision != NOT_FOUND) /* the smallest number */ i = (i < p->precision ? i : p->precision); p->width -= i; PAD_RIGHT(p); while (i-- > 0) { /* put the sting */ PUT_CHAR(*tmp, p); tmp++; } PAD_LEFT(p); } /* %f or %g floating point representation */ PRIVATE void #ifdef __STDC__ floating(struct DATA *p, double d) #else floating(p, d) struct DATA *p; double d; #endif { char *tmp, *tmp2; int i; DEF_PREC(p); d = ROUND(d, p); tmp = dtoa(d, p->precision, &tmp2); /* calculate the padding. 1 for the dot */ p->width = p->width - ((d > 0. && p->justify == RIGHT) ? 1:0) - ((p->space == FOUND) ? 1:0) - strlen(tmp) - p->precision - 1; PAD_RIGHT(p); PUT_PLUS(d, p); PUT_SPACE(d, p); while (*tmp) { /* the integral */ PUT_CHAR(*tmp, p); tmp++; } if (p->precision != 0 || p->square == FOUND) PUT_CHAR('.', p); /* put the '.' */ if (*p->pf == 'g' || *p->pf == 'G') /* smash the trailing zeros */ for (i = strlen(tmp2) - 1; i >= 0 && tmp2[i] == '0'; i--) tmp2[i] = '\0'; for (; *tmp2; tmp2++) PUT_CHAR(*tmp2, p); /* the fraction */ PAD_LEFT(p); } /* %e %E %g exponent representation */ PRIVATE void #ifdef __STDC__ exponent(struct DATA *p, double d) #else exponent(p, d) struct DATA *p; double d; #endif { char *tmp, *tmp2; int j, i; DEF_PREC(p); j = log_10(d); d = d / pow_10(j); /* get the Mantissa */ d = ROUND(d, p); tmp = dtoa(d, p->precision, &tmp2); /* 1 for unit, 1 for the '.', 1 for 'e|E', * 1 for '+|-', 3 for 'exp' */ /* calculate how much padding need */ p->width = p->width - ((d > 0. && p->justify == RIGHT) ? 1:0) - ((p->space == FOUND) ? 1:0) - p->precision - 7; PAD_RIGHT(p); PUT_PLUS(d, p); PUT_SPACE(d, p); while (*tmp) {/* the integral */ PUT_CHAR(*tmp, p); tmp++; } if (p->precision != 0 || p->square == FOUND) PUT_CHAR('.', p); /* the '.' */ if (*p->pf == 'g' || *p->pf == 'G') /* smash the trailing zeros */ for (i = strlen(tmp2) - 1; i >= 0 && tmp2[i] == '0'; i--) tmp2[i] = '\0'; for (; *tmp2; tmp2++) PUT_CHAR(*tmp2, p); /* the fraction */ if (*p->pf == 'g' || *p->pf == 'e') { /* the exponent put the 'e|E' */ PUT_CHAR('e', p); } else PUT_CHAR('E', p); if (j >= 0) { /* the sign of the exp */ PUT_CHAR('+', p); } else { PUT_CHAR('-', p); j = -j; } tmp = itoa((double)j); if (j < 9) { /* need to pad the exponent with 0 '000' */ PUT_CHAR('0', p); PUT_CHAR('0', p); } else if (j < 99) PUT_CHAR('0', p); while (*tmp) { /* the exponent */ PUT_CHAR(*tmp, p); tmp++; } PAD_LEFT(p); } /* initialize the conversion specifiers */ PRIVATE void #ifdef __STDC__ conv_flag(char * s, struct DATA * p) #else conv_flag(s, p) char * s; struct DATA * p; #endif { char number[MAX_FIELD/2]; int i; /* reset the flags. */ p->precision = p->width = NOT_FOUND; p->star_w = p->star_p = NOT_FOUND; p->square = p->space = NOT_FOUND; p->a_long = p->justify = NOT_FOUND; p->a_longlong = NOT_FOUND; p->pad = ' '; for(;s && *s ;s++) { switch(*s) { case ' ': p->space = FOUND; break; case '#': p->square = FOUND; break; case '*': if (p->width == NOT_FOUND) p->width = p->star_w = FOUND; else p->precision = p->star_p = FOUND; break; case '+': p->justify = RIGHT; break; case '-': p->justify = LEFT; break; case '.': if (p->width == NOT_FOUND) p->width = 0; break; case '0': p->pad = '0'; break; case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': /* gob all the digits */ for (i = 0; isdigit(*s); i++, s++) if (i < MAX_FIELD/2 - 1) number[i] = *s; number[i] = '\0'; if (p->width == NOT_FOUND) p->width = atoi(number); else p->precision = atoi(number); s--; /* went to far go back */ break; } } } PUBLIC int #ifdef __STDC__ vsnprintf(char *string, size_t length, const char * format, va_list args) #else vsnprintf(string, length, format, args) char *string; size_t length; char * format; va_list args; #endif { struct DATA data; char conv_field[MAX_FIELD]; double d; /* temporary holder */ int state; int i; data.length = length - 1; /* leave room for '\0' */ data.holder = string; data.pf = format; data.counter = 0; /* sanity check, the string must be > 1 */ if (length < 1) return -1; for (; *data.pf && (data.counter < data.length); data.pf++) { if ( *data.pf == '%' ) { /* we got a magic % cookie */ conv_flag((char *)0, &data); /* initialise format flags */ for (state = 1; *data.pf && state;) { switch (*(++data.pf)) { case '\0': /* a NULL here ? ? bail out */ *data.holder = '\0'; return data.counter; break; case 'f': /* float, double */ STAR_ARGS(&data); if (data.a_long == FOUND) d = va_arg(args, LONG_DOUBLE); else d = va_arg(args, double); floating(&data, d); state = 0; break; case 'g': case 'G': STAR_ARGS(&data); DEF_PREC(&data); if (data.a_long == FOUND) d = va_arg(args, LONG_DOUBLE); else d = va_arg(args, double); i = log_10(d); /* * for '%g|%G' ANSI: use f if exponent * is in the range or [-4,p] exclusively * else use %e|%E */ if (-4 < i && i < data.precision) floating(&data, d); else exponent(&data, d); state = 0; break; case 'e': case 'E': /* Exponent double */ STAR_ARGS(&data); if (data.a_long == FOUND) d = va_arg(args, LONG_DOUBLE); else d = va_arg(args, double); exponent(&data, d); state = 0; break; case 'u': /* unsigned decimal */ STAR_ARGS(&data); if (data.a_longlong == FOUND) d = va_arg(args, unsigned LONG_LONG); else if (data.a_long == FOUND) d = va_arg(args, unsigned long); else d = va_arg(args, unsigned int); decimal(&data, d); state = 0; break; case 'd': /* decimal */ STAR_ARGS(&data); if (data.a_longlong == FOUND) d = va_arg(args, LONG_LONG); else if (data.a_long == FOUND) d = va_arg(args, long); else d = va_arg(args, int); decimal(&data, d); state = 0; break; case 'o': /* octal */ STAR_ARGS(&data); if (data.a_longlong == FOUND) d = va_arg(args, LONG_LONG); else if (data.a_long == FOUND) d = va_arg(args, long); else d = va_arg(args, int); octal(&data, d); state = 0; break; case 'x': case 'X': /* hexadecimal */ STAR_ARGS(&data); if (data.a_longlong == FOUND) d = va_arg(args, LONG_LONG); else if (data.a_long == FOUND) d = va_arg(args, long); else d = va_arg(args, int); hexa(&data, d); state = 0; break; case 'c': /* character */ d = va_arg(args, int); PUT_CHAR(d, &data); state = 0; break; case 's': /* string */ STAR_ARGS(&data); strings(&data, va_arg(args, char *)); state = 0; break; case 'n': *(va_arg(args, int *)) = data.counter; /* what's the count ? */ state = 0; break; case 'q': data.a_longlong = FOUND; break; case 'L': case 'l': if (data.a_long == FOUND) data.a_longlong = FOUND; else data.a_long = FOUND; break; case 'h': break; case '%': /* nothing just % */ PUT_CHAR('%', &data); state = 0; break; case '#': case ' ': case '+': case '*': case '-': case '.': case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': /* initialize width and precision */ for (i = 0; isflag(*data.pf); i++, data.pf++) if (i < MAX_FIELD - 1) conv_field[i] = *data.pf; conv_field[i] = '\0'; conv_flag(conv_field, &data); data.pf--; /* went to far go back */ break; default: /* is this an error ? maybe bail out */ state = 0; break; } /* end switch */ } /* end of for state */ } else { /* not % */ PUT_CHAR(*data.pf, &data); /* add the char the string */ } } *data.holder = '\0'; /* the end ye ! */ return data.counter; } #endif /* HAVE_VSNPRINTF */ #ifndef HAVE_SNPRINTF PUBLIC int #if __STDC__ snprintf(char *string, size_t length, const char * format, ...) #else snprintf(string, length, format, va_alist) char *string; size_t length; char * format; va_dcl #endif { int rval; va_list args; #if __STDC__ va_start(args, format); #else va_start(args); #endif rval = vsnprintf (string, length, format, args); va_end(args); return rval; } #endif /* HAVE_SNPRINTF */ #ifdef DRIVER #include /* set of small tests for snprintf() */ int main() { char holder[100]; int i; /* printf("Suite of test for snprintf:\n"); printf("a_format\n"); printf("printf() format\n"); printf("snprintf() format\n\n"); */ /* Checking the field widths */ printf("/%%d/, 336\n"); snprintf(holder, sizeof holder, "/%d/\n", 336); printf("/%d/\n", 336); printf("%s\n", holder); printf("/%%2d/, 336\n"); snprintf(holder, sizeof holder, "/%2d/\n", 336); printf("/%2d/\n", 336); printf("%s\n", holder); printf("/%%10d/, 336\n"); snprintf(holder, sizeof holder, "/%10d/\n", 336); printf("/%10d/\n", 336); printf("%s\n", holder); printf("/%%-10d/, 336\n"); snprintf(holder, sizeof holder, "/%-10d/\n", 336); printf("/%-10d/\n", 336); printf("%s\n", holder); /* long long */ printf("/%%lld/, 336\n"); snprintf(holder, sizeof holder, "/%lld/\n", (LONG_LONG)336); printf("/%lld/\n", (LONG_LONG)336); printf("%s\n", holder); printf("/%%2qd/, 336\n"); snprintf(holder, sizeof holder, "/%2qd/\n", (LONG_LONG)336); printf("/%2qd/\n", (LONG_LONG)336); printf("%s\n", holder); /* floating points */ printf("/%%f/, 1234.56\n"); snprintf(holder, sizeof holder, "/%f/\n", 1234.56); printf("/%f/\n", 1234.56); printf("%s\n", holder); printf("/%%e/, 1234.56\n"); snprintf(holder, sizeof holder, "/%e/\n", 1234.56); printf("/%e/\n", 1234.56); printf("%s\n", holder); printf("/%%4.2f/, 1234.56\n"); snprintf(holder, sizeof holder, "/%4.2f/\n", 1234.56); printf("/%4.2f/\n", 1234.56); printf("%s\n", holder); printf("/%%3.1f/, 1234.56\n"); snprintf(holder, sizeof holder, "/%3.1f/\n", 1234.56); printf("/%3.1f/\n", 1234.56); printf("%s\n", holder); printf("/%%10.3f/, 1234.56\n"); snprintf(holder, sizeof holder, "/%10.3f/\n", 1234.56); printf("/%10.3f/\n", 1234.56); printf("%s\n", holder); printf("/%%10.3e/, 1234.56\n"); snprintf(holder, sizeof holder, "/%10.3e/\n", 1234.56); printf("/%10.3e/\n", 1234.56); printf("%s\n", holder); printf("/%%+4.2f/, 1234.56\n"); snprintf(holder, sizeof holder, "/%+4.2f/\n", 1234.56); printf("/%+4.2f/\n", 1234.56); printf("%s\n", holder); printf("/%%010.2f/, 1234.56\n"); snprintf(holder, sizeof holder, "/%010.2f/\n", 1234.56); printf("/%010.2f/\n", 1234.56); printf("%s\n", holder); #define BLURB "Outstanding acting !" /* strings precisions */ printf("/%%2s/, \"%s\"\n", BLURB); snprintf(holder, sizeof holder, "/%2s/\n", BLURB); printf("/%2s/\n", BLURB); printf("%s\n", holder); printf("/%%22s/ %s\n", BLURB); snprintf(holder, sizeof holder, "/%22s/\n", BLURB); printf("/%22s/\n", BLURB); printf("%s\n", holder); printf("/%%22.5s/ %s\n", BLURB); snprintf(holder, sizeof holder, "/%22.5s/\n", BLURB); printf("/%22.5s/\n", BLURB); printf("%s\n", holder); printf("/%%-22.5s/ %s\n", BLURB); snprintf(holder, sizeof holder, "/%-22.5s/\n", BLURB); printf("/%-22.5s/\n", BLURB); printf("%s\n", holder); /* see some flags */ printf("%%x %%X %%#x, 31, 31, 31\n"); snprintf(holder, sizeof holder, "%x %X %#x\n", 31, 31, 31); printf("%x %X %#x\n", 31, 31, 31); printf("%s\n", holder); printf("**%%d**%% d**%% d**, 42, 42, -42\n"); snprintf(holder, sizeof holder, "**%d**% d**% d**\n", 42, 42, -42); printf("**%d**% d**% d**\n", 42, 42, -42); printf("%s\n", holder); /* other flags */ printf("/%%g/, 31.4\n"); snprintf(holder, sizeof holder, "/%g/\n", 31.4); printf("/%g/\n", 31.4); printf("%s\n", holder); printf("/%%.6g/, 31.4\n"); snprintf(holder, sizeof holder, "/%.6g/\n", 31.4); printf("/%.6g/\n", 31.4); printf("%s\n", holder); printf("/%%.1G/, 31.4\n"); snprintf(holder, sizeof holder, "/%.1G/\n", 31.4); printf("/%.1G/\n", 31.4); printf("%s\n", holder); printf("abc%%n\n"); printf("abc%n", &i); printf("%d\n", i); snprintf(holder, sizeof holder, "abc%n", &i); printf("%s", holder); printf("%d\n\n", i); printf("%%*.*s --> 10.10\n"); snprintf(holder, sizeof holder, "%*.*s\n", 10, 10, BLURB); printf("%*.*s\n", 10, 10, BLURB); printf("%s\n", holder); printf("%%%%%%%%\n"); snprintf(holder, sizeof holder, "%%%%\n"); printf("%%%%\n"); printf("%s\n", holder); #define BIG "Hello this is a too big string for the buffer" /* printf("A buffer to small of 10, trying to put this:\n");*/ printf("<%%>, %s\n", BIG); i = snprintf(holder, 10, "%s\n", BIG); printf("<%s>\n", BIG); printf("<%s>\n", holder); return 0; } #endif /* !DRIVER */ freeradius-server/src/lib/snprintf.h000066400000000000000000000127331257552170400201020ustar00rootroot00000000000000/* Unix snprintf implementation. Version 1.4 This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. Revision History: see header of snprintf.c. format: int snprintf(holder, sizeof_holder, format, ...) Return values: (sizeof_holder - 1) THANKS(for the patches and ideas): Miles Bader Cyrille Rustom Jacek Slabocewiz Mike Parker(mouse) Alain Magloire: alainm@rcsm.ee.mcgill.ca */ #ifndef HAVE_VSNPRINTF #include RCSIDH(snprintf_h, "$Id$") #if __STDC__ #include #else #include #endif #include /* for atoi() */ #include #define PRIVATE static #define PUBLIC /* * For the FLOATING POINT FORMAT : * the challenge was finding a way to * manipulate the Real numbers without having * to resort to mathematical function(it * would require to link with -lm) and not * going down to the bit pattern(not portable) * * so a number, a real is: real = integral + fraction integral = ... + a(2)*10^2 + a(1)*10^1 + a(0)*10^0 fraction = b(1)*10^-1 + b(2)*10^-2 + ... where: 0 <= a(i) => 9 0 <= b(i) => 9 from then it was simple math */ /* * size of the buffer for the integral part * and the fraction part */ #define MAX_INT 99 + 1 /* 1 for the null */ #define MAX_FRACT 29 + 1 /* * If the compiler supports (long long) */ #ifndef LONG_LONG # define LONG_LONG long long /*# define LONG_LONG int64_t*/ #endif /* * If the compiler supports (long double) */ #ifndef LONG_DOUBLE # define LONG_DOUBLE long double /*# define LONG_DOUBLE double*/ #endif /* * numtoa() uses PRIVATE buffers to store the results, * So this function is not reentrant */ #define itoa(n) numtoa(n, 10, 0, (char **)0) #define otoa(n) numtoa(n, 8, 0, (char **)0) #define htoa(n) numtoa(n, 16, 0, (char **)0) #define dtoa(n, p, f) numtoa(n, 10, p, f) #define SWAP_INT(a,b) {int t; t = (a); (a) = (b); (b) = t;} /* this struct holds everything we need */ struct DATA { int length; char *holder; int counter; #ifdef __STDC__ const char *pf; #else char *pf; #endif /* FLAGS */ int width, precision; int justify; char pad; int square, space, star_w, star_p, a_long, a_longlong; }; /* signature of the functions */ #ifdef __STDC__ /* the floating point stuff */ PRIVATE double pow_10(int); PRIVATE int log_10(double); PRIVATE double integral(double, double *); PRIVATE char * numtoa(double, int, int, char **); /* for the format */ PRIVATE void conv_flag(char *, struct DATA *); PRIVATE void floating(struct DATA *, double); PRIVATE void exponent(struct DATA *, double); PRIVATE void decimal(struct DATA *, double); PRIVATE void octal(struct DATA *, double); PRIVATE void hexa(struct DATA *, double); PRIVATE void strings(struct DATA *, char *); #else /* the floating point stuff */ PRIVATE double pow_10(); PRIVATE int log_10(); PRIVATE double integral(); PRIVATE char * numtoa(); /* for the format */ PRIVATE void conv_flag(); PRIVATE void floating(); PRIVATE void exponent(); PRIVATE void decimal(); PRIVATE void octal(); PRIVATE void hexa(); PRIVATE void strings(); #endif /* those are defines specific to snprintf to hopefully * make the code clearer :-) */ #define RIGHT 1 #define LEFT 0 #define NOT_FOUND -1 #define FOUND 1 #define MAX_FIELD 15 /* the conversion flags */ #define isflag(c) ((c) == '#' || (c) == ' ' || \ (c) == '*' || (c) == '+' || \ (c) == '-' || (c) == '.' || \ isdigit(c)) /* round off to the precision */ #define ROUND(d, p) \ (d < 0.) ? \ d - pow_10(-(p)->precision) * 0.5 : \ d + pow_10(-(p)->precision) * 0.5 /* set default precision */ #define DEF_PREC(p) \ if ((p)->precision == NOT_FOUND) \ (p)->precision = 6 /* put a char */ #define PUT_CHAR(c, p) \ if ((p)->counter < (p)->length) { \ *(p)->holder++ = (c); \ (p)->counter++; \ } #define PUT_PLUS(d, p) \ if ((d) > 0. && (p)->justify == RIGHT) \ PUT_CHAR('+', p) #define PUT_SPACE(d, p) \ if ((p)->space == FOUND && (d) > 0.) \ PUT_CHAR(' ', p) /* pad right */ #define PAD_RIGHT(p) \ if ((p)->width > 0 && (p)->justify != LEFT) \ for (; (p)->width > 0; (p)->width--) \ PUT_CHAR((p)->pad, p) /* pad left */ #define PAD_LEFT(p) \ if ((p)->width > 0 && (p)->justify == LEFT) \ for (; (p)->width > 0; (p)->width--) \ PUT_CHAR((p)->pad, p) /* if width and prec. in the args */ #define STAR_ARGS(p) \ if ((p)->star_w == FOUND) \ (p)->width = va_arg(args, int); \ if ((p)->star_p == FOUND) \ (p)->precision = va_arg(args, int) #endif /* HAVE_VSNPRINTF */ freeradius-server/src/lib/strlcat.c000066400000000000000000000034741257552170400177100ustar00rootroot00000000000000/* * strlcat.c Concatenate strings. * * Version: $Id$ * */ /* * Copyright (c) 1998 Todd C. Miller * * 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 THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR 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. * * Copyright 2006 The FreeRADIUS server project */ #include RCSID("$Id$") #include #ifndef HAVE_STRLCAT #include /* * Appends src to string dst of size siz (unlike strncat, siz is the * full size of dst, not space left). At most siz-1 characters * will be copied. Always NUL terminates (unless siz <= strlen(dst)). * Returns strlen(src) + MIN(siz, strlen(initial dst)). * If retval >= siz, truncation occurred. */ size_t strlcat(char *dst, const char *src, size_t siz) { char *d = dst; const char *s = src; size_t n = siz; size_t dlen; /* Find the end of dst and adjust bytes left but don't go past end */ 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 freeradius-server/src/lib/strlcpy.c000066400000000000000000000033061257552170400177260ustar00rootroot00000000000000/* * strlcpy.c Copy strings. * * Version: $Id$ * */ /* * Copyright (c) 1998 Todd C. Miller * * 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 THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR 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. * * Copyright 2006 The FreeRADIUS server project */ #include RCSID("$Id$") #include #ifndef HAVE_STRLCPY #include /* * Copy src to string dst of size siz. At most siz-1 characters * will be copied. Always NUL terminates (unless siz == 0). * Returns strlen(src); if retval >= siz, truncation occurred. */ 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 freeradius-server/src/lib/token.c000066400000000000000000000130551257552170400173500ustar00rootroot00000000000000/* * token.c Read the next token from a string. * Yes it's pretty primitive but effective. * * Version: $Id$ * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2000,2006 The FreeRADIUS server project */ #include RCSID("$Id$") #include #include #include static const FR_NAME_NUMBER tokens[] = { { "=~", T_OP_REG_EQ, }, /* order is important! */ { "!~", T_OP_REG_NE, }, { "{", T_LCBRACE, }, { "}", T_RCBRACE, }, { "(", T_LBRACE, }, { ")", T_RBRACE, }, { ",", T_COMMA, }, { "+=", T_OP_ADD, }, { "-=", T_OP_SUB, }, { ":=", T_OP_SET, }, { "=*", T_OP_CMP_TRUE, }, { "!*", T_OP_CMP_FALSE, }, { "==", T_OP_CMP_EQ, }, { "=", T_OP_EQ, }, { "!=", T_OP_NE, }, { ">=", T_OP_GE, }, { ">", T_OP_GT, }, { "<=", T_OP_LE, }, { "<", T_OP_LT, }, { "#", T_HASH, }, { ";", T_SEMICOLON, }, { NULL, 0, }, }; /* * This works only as long as special tokens * are max. 2 characters, but it's fast. */ #define TOKEN_MATCH(bptr, tptr) \ ( (tptr)[0] == (bptr)[0] && \ ((tptr)[1] == (bptr)[1] || (tptr)[1] == 0)) /* * Read a word from a buffer and advance pointer. * This function knows about escapes and quotes. * * At end-of-line, buf[0] is set to '\0'. * Returns 0 or special token value. */ static FR_TOKEN getthing(const char **ptr, char *buf, int buflen, int tok, const FR_NAME_NUMBER *tokenlist) { char *s; const char *p; int quote, end = 0; int escape; unsigned int x; const FR_NAME_NUMBER*t; FR_TOKEN rcode; buf[0] = 0; /* Skip whitespace */ p = *ptr; while (*p && isspace((int) *p)) p++; if (*p == 0) { *ptr = p; return T_EOL; } /* * Might be a 1 or 2 character token. */ if (tok) for (t = tokenlist; t->name; t++) { if (TOKEN_MATCH(p, t->name)) { strcpy(buf, t->name); p += strlen(t->name); while (isspace((int) *p)) p++; *ptr = p; return (FR_TOKEN) t->number; } } /* Read word. */ quote = 0; if ((*p == '"') || (*p == '\'') || (*p == '`')) { quote = *p; end = 0; p++; } s = buf; escape = 0; while (*p && buflen-- > 1) { if (quote && (*p == '\\')) { p++; switch(*p) { case 'r': *s++ = '\r'; break; case 'n': *s++ = '\n'; break; case 't': *s++ = '\t'; break; case '\0': *s++ = '\\'; p--; /* force EOS */ break; default: if (*p >= '0' && *p <= '9' && sscanf(p, "%3o", &x) == 1) { *s++ = x; p += 2; } else *s++ = *p; break; } p++; continue; } if (quote && (*p == quote)) { end = 1; p++; break; } if (!quote) { if (isspace((int) *p)) break; if (tok) { for (t = tokenlist; t->name; t++) if (TOKEN_MATCH(p, t->name)) break; if (t->name != NULL) break; } } *s++ = *p++; } *s++ = 0; if (quote && !end) { fr_strerror_printf("Unterminated string"); return T_OP_INVALID; } /* Skip whitespace again. */ while (*p && isspace((int) *p)) p++; *ptr = p; /* we got SOME form of output string, even if it is empty */ switch (quote) { default: rcode = T_BARE_WORD; break; case '\'': rcode = T_SINGLE_QUOTED_STRING; break; case '"': rcode = T_DOUBLE_QUOTED_STRING; break; case '`': rcode = T_BACK_QUOTED_STRING; break; } return rcode; } /* * Read a "word" - this means we don't honor * tokens as delimiters. */ int getword(const char **ptr, char *buf, int buflen) { return getthing(ptr, buf, buflen, 0, tokens) == T_EOL ? 0 : 1; } /* * Read a bare "word" - this means we don't honor * tokens as delimiters. */ int getbareword(const char **ptr, char *buf, int buflen) { FR_TOKEN token; token = getthing(ptr, buf, buflen, 0, NULL); if (token != T_BARE_WORD) { return 0; } return 1; } /* * Read the next word, use tokens as delimiters. */ FR_TOKEN gettoken(const char **ptr, char *buf, int buflen) { return getthing(ptr, buf, buflen, 1, tokens); } /* * Expect a string. */ FR_TOKEN getstring(const char **ptr, char *buf, int buflen) { const char *p = *ptr; while (*p && (isspace((int)*p))) p++; *ptr = p; if ((*p == '"') || (*p == '\'') || (*p == '`')) { return gettoken(ptr, buf, buflen); } return getthing(ptr, buf, buflen, 0, tokens); } /* * Convert a string to an integer */ int fr_str2int(const FR_NAME_NUMBER *table, const char *name, int def) { const FR_NAME_NUMBER *this; for (this = table; this->name != NULL; this++) { if (strcasecmp(this->name, name) == 0) { return this->number; } } return def; } /* * Convert an integer to a string. */ const char *fr_int2str(const FR_NAME_NUMBER *table, int number, const char *def) { const FR_NAME_NUMBER *this; for (this = table; this->name != NULL; this++) { if (this->number == number) { return this->name; } } return def; } const char *fr_token_name(int token) { return fr_int2str(tokens, token, "???"); } freeradius-server/src/lib/udpfromto.c000066400000000000000000000334631257552170400202540ustar00rootroot00000000000000/* * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ /** * $Id$ * @file udpfromto.c * @brief Like recvfrom, but also stores the destination IP address. Useful on multihomed hosts. * * @copyright 2007 Alan DeKok * @copyright 2002 Miquel van Smoorenburg */ #include RCSID("$Id$") #include #ifdef WITH_UDPFROMTO #ifdef HAVE_SYS_UIO_H # include #endif #include /* * More portability idiocy * Mac OSX Lion doesn't define SOL_IP. But IPPROTO_IP works. */ #ifndef SOL_IP # define SOL_IP IPPROTO_IP #endif /* * glibc 2.4 and uClibc 0.9.29 introduce IPV6_RECVPKTINFO etc. and * change IPV6_PKTINFO This is only supported in Linux kernel >= * 2.6.14 * * This is only an approximation because the kernel version that libc * was compiled against could be older or newer than the one being * run. But this should not be a problem -- we just keep using the * old kernel interface. */ #ifdef __linux__ # ifdef IPV6_RECVPKTINFO # include # if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,14) # ifdef IPV6_2292PKTINFO # undef IPV6_RECVPKTINFO # undef IPV6_PKTINFO # define IPV6_RECVPKTINFO IPV6_2292PKTINFO # define IPV6_PKTINFO IPV6_2292PKTINFO # endif # endif /* Fall back to the legacy socket option if IPV6_RECVPKTINFO isn't defined */ # elif defined(IPV6_2292PKTINFO) # define IPV6_RECVPKTINFO IPV6_2292PKTINFO # endif #else /* * For everything that's not Linux we assume RFC 3542 compliance * - setsockopt() takes IPV6_RECVPKTINFO * - cmsg_type is IPV6_PKTINFO (in sendmsg, recvmsg) * * If we don't have IPV6_RECVPKTINFO defined but do have IPV6_PKTINFO * defined, chances are the API is RFC2292 compliant and we need to use * IPV6_PKTINFO for both. */ # if !defined(IPV6_RECVPKTINFO) && defined(IPV6_PKTINFO) # define IPV6_RECVPKTINFO IPV6_PKTINFO /* * Ensure IPV6_RECVPKTINFO is not defined somehow if we have we * don't have IPV6_PKTINFO. */ # elif !defined(IPV6_PKTINFO) # undef IPV6_RECVPKTINFO # endif #endif int udpfromto_init(int s) { int proto, flag = 0, opt = 1; struct sockaddr_storage si; socklen_t si_len = sizeof(si); errno = ENOSYS; /* * Clang analyzer doesn't see that getsockname initialises * the memory passed to it. */ #ifdef __clang_analyzer__ memset(&si, 0, sizeof(si)); #endif if (getsockname(s, (struct sockaddr *) &si, &si_len) < 0) { return -1; } if (si.ss_family == AF_INET) { #ifdef HAVE_IP_PKTINFO /* * Linux */ proto = SOL_IP; flag = IP_PKTINFO; #else # ifdef IP_RECVDSTADDR /* * Set the IP_RECVDSTADDR option (BSD). Note: * IP_RECVDSTADDR == IP_SENDSRCADDR */ proto = IPPROTO_IP; flag = IP_RECVDSTADDR; # else return -1; # endif #endif #ifdef AF_INET6 } else if (si.ss_family == AF_INET6) { # ifdef IPV6_PKTINFO /* * This should actually be standard IPv6 */ proto = IPPROTO_IPV6; /* * Work around Linux-specific hackery. */ flag = IPV6_RECVPKTINFO; #else # ifdef EPROTONOSUPPORT errno = EPROTONOSUPPORT; # endif return -1; # endif #endif } else { /* * Unknown AF. */ return -1; } return setsockopt(s, proto, flag, &opt, sizeof(opt)); } int recvfromto(int s, void *buf, size_t len, int flags, struct sockaddr *from, socklen_t *fromlen, struct sockaddr *to, socklen_t *tolen) { struct msghdr msgh; struct cmsghdr *cmsg; struct iovec iov; char cbuf[256]; int err; struct sockaddr_storage si; socklen_t si_len = sizeof(si); #if !defined(IP_PKTINFO) && !defined(IP_RECVDSTADDR) && !defined(IPV6_PKTINFO) /* * If the recvmsg() flags aren't defined, fall back to * using recvfrom(). */ to = NULL: #endif /* * Catch the case where the caller passes invalid arguments. */ if (!to || !tolen) return recvfrom(s, buf, len, flags, from, fromlen); /* * Clang analyzer doesn't see that getsockname initialises * the memory passed to it. */ #ifdef __clang_analyzer__ memset(&si, 0, sizeof(si)); #endif /* * recvmsg doesn't provide sin_port so we have to * retrieve it using getsockname(). */ if (getsockname(s, (struct sockaddr *)&si, &si_len) < 0) { return -1; } /* * Initialize the 'to' address. It may be INADDR_ANY here, * with a more specific address given by recvmsg(), below. */ if (si.ss_family == AF_INET) { #if !defined(IP_PKTINFO) && !defined(IP_RECVDSTADDR) return recvfrom(s, buf, len, flags, from, fromlen); #else struct sockaddr_in *dst = (struct sockaddr_in *) to; struct sockaddr_in *src = (struct sockaddr_in *) &si; if (*tolen < sizeof(*dst)) { errno = EINVAL; return -1; } *tolen = sizeof(*dst); *dst = *src; #endif } #ifdef AF_INET6 else if (si.ss_family == AF_INET6) { #if !defined(IPV6_PKTINFO) return recvfrom(s, buf, len, flags, from, fromlen); #else struct sockaddr_in6 *dst = (struct sockaddr_in6 *) to; struct sockaddr_in6 *src = (struct sockaddr_in6 *) &si; if (*tolen < sizeof(*dst)) { errno = EINVAL; return -1; } *tolen = sizeof(*dst); *dst = *src; #endif } #endif /* * Unknown address family. */ else { errno = EINVAL; return -1; } /* Set up iov and msgh structures. */ memset(&cbuf, 0, sizeof(cbuf)); memset(&msgh, 0, sizeof(struct msghdr)); iov.iov_base = buf; iov.iov_len = len; msgh.msg_control = cbuf; msgh.msg_controllen = sizeof(cbuf); msgh.msg_name = from; msgh.msg_namelen = fromlen ? *fromlen : 0; msgh.msg_iov = &iov; msgh.msg_iovlen = 1; msgh.msg_flags = 0; /* Receive one packet. */ if ((err = recvmsg(s, &msgh, flags)) < 0) { return err; } if (fromlen) *fromlen = msgh.msg_namelen; /* Process auxiliary received data in msgh */ for (cmsg = CMSG_FIRSTHDR(&msgh); cmsg != NULL; cmsg = CMSG_NXTHDR(&msgh,cmsg)) { #ifdef IP_PKTINFO if ((cmsg->cmsg_level == SOL_IP) && (cmsg->cmsg_type == IP_PKTINFO)) { struct in_pktinfo *i = (struct in_pktinfo *) CMSG_DATA(cmsg); ((struct sockaddr_in *)to)->sin_addr = i->ipi_addr; *tolen = sizeof(struct sockaddr_in); break; } #endif #ifdef IP_RECVDSTADDR if ((cmsg->cmsg_level == IPPROTO_IP) && (cmsg->cmsg_type == IP_RECVDSTADDR)) { struct in_addr *i = (struct in_addr *) CMSG_DATA(cmsg); ((struct sockaddr_in *)to)->sin_addr = *i; *tolen = sizeof(struct sockaddr_in); break; } #endif #ifdef IPV6_PKTINFO if ((cmsg->cmsg_level == IPPROTO_IPV6) && (cmsg->cmsg_type == IPV6_PKTINFO)) { struct in6_pktinfo *i = (struct in6_pktinfo *) CMSG_DATA(cmsg); ((struct sockaddr_in6 *)to)->sin6_addr = i->ipi6_addr; *tolen = sizeof(struct sockaddr_in6); break; } #endif } return err; } int sendfromto(int s, void *buf, size_t len, int flags, struct sockaddr *from, socklen_t fromlen, struct sockaddr *to, socklen_t tolen) { struct msghdr msgh; struct cmsghdr *cmsg; struct iovec iov; char cbuf[256]; #ifdef __FreeBSD__ /* * FreeBSD is extra pedantic about the use of IP_SENDSRCADDR, * and sendmsg will fail with EINVAL if IP_SENDSRCADDR is used * with a socket which is bound to something other than * INADDR_ANY */ struct sockaddr bound; socklen_t bound_len = sizeof(bound); if (getsockname(s, &bound, &bound_len) < 0) { return -1; } switch (bound.sa_family) { case AF_INET: if (((struct sockaddr_in *) &bound)->sin_addr.s_addr != INADDR_ANY) { from = NULL; } break; case AF_INET6: if (!IN6_IS_ADDR_UNSPECIFIED(&((struct sockaddr_in6 *) &bound)->sin6_addr)) { from = NULL; } break; } #else # if !defined(IP_PKTINFO) && !defined(IP_SENDSRCADDR) && !defined(IPV6_PKTINFO) /* * If the sendmsg() flags aren't defined, fall back to * using sendto(). */ from = NULL; # endif #endif /* * Catch the case where the caller passes invalid arguments. */ if (!from || (fromlen == 0) || (from->sa_family == AF_UNSPEC)) { return sendto(s, buf, len, flags, to, tolen); } /* Set up control buffer iov and msgh structures. */ memset(&cbuf, 0, sizeof(cbuf)); memset(&msgh, 0, sizeof(msgh)); memset(&iov, 0, sizeof(iov)); iov.iov_base = buf; iov.iov_len = len; msgh.msg_iov = &iov; msgh.msg_iovlen = 1; msgh.msg_name = to; msgh.msg_namelen = tolen; if (from->sa_family == AF_INET) { #if !defined(IP_PKTINFO) && !defined(IP_SENDSRCADDR) return sendto(s, buf, len, flags, to, tolen); #else struct sockaddr_in *s4 = (struct sockaddr_in *) from; # ifdef IP_PKTINFO struct in_pktinfo *pkt; msgh.msg_control = cbuf; msgh.msg_controllen = CMSG_SPACE(sizeof(*pkt)); cmsg = CMSG_FIRSTHDR(&msgh); cmsg->cmsg_level = SOL_IP; cmsg->cmsg_type = IP_PKTINFO; cmsg->cmsg_len = CMSG_LEN(sizeof(*pkt)); pkt = (struct in_pktinfo *) CMSG_DATA(cmsg); memset(pkt, 0, sizeof(*pkt)); pkt->ipi_spec_dst = s4->sin_addr; # endif # ifdef IP_SENDSRCADDR struct in_addr *in; msgh.msg_control = cbuf; msgh.msg_controllen = CMSG_SPACE(sizeof(*in)); cmsg = CMSG_FIRSTHDR(&msgh); cmsg->cmsg_level = IPPROTO_IP; cmsg->cmsg_type = IP_SENDSRCADDR; cmsg->cmsg_len = CMSG_LEN(sizeof(*in)); in = (struct in_addr *) CMSG_DATA(cmsg); *in = s4->sin_addr; # endif #endif /* IP_PKTINFO or IP_SENDSRCADDR */ } #ifdef AF_INET6 else if (from->sa_family == AF_INET6) { # if !defined(IPV6_PKTINFO) return sendto(s, buf, len, flags, to, tolen); # else struct sockaddr_in6 *s6 = (struct sockaddr_in6 *) from; struct in6_pktinfo *pkt; msgh.msg_control = cbuf; msgh.msg_controllen = CMSG_SPACE(sizeof(*pkt)); cmsg = CMSG_FIRSTHDR(&msgh); cmsg->cmsg_level = IPPROTO_IPV6; cmsg->cmsg_type = IPV6_PKTINFO; cmsg->cmsg_len = CMSG_LEN(sizeof(*pkt)); pkt = (struct in6_pktinfo *) CMSG_DATA(cmsg); memset(pkt, 0, sizeof(*pkt)); pkt->ipi6_addr = s6->sin6_addr; # endif /* IPV6_PKTINFO */ } #endif /* * Unknown address family. */ else { errno = EINVAL; return -1; } return sendmsg(s, &msgh, flags); } #ifdef TESTING /* * Small test program to test recvfromto/sendfromto * * use a virtual IP address as first argument to test * * reply packet should originate from virtual IP and not * from the default interface the alias is bound to */ # include # include # include # include # include # define DEF_PORT 20000 /* default port to listen on */ # define DESTIP "127.0.0.1" /* send packet to localhost per default */ # define TESTSTRING "foo" /* what to send */ # define TESTLEN 4 /* 4 bytes */ int main(int argc, char **argv) { struct sockaddr_in from, to, in; char buf[TESTLEN]; char *destip = DESTIP; uint16_t port = DEF_PORT; int n, server_socket, client_socket, fl, tl, pid; if (argc > 1) destip = argv[1]; if (argc > 2) port = atoi(argv[2]); in.sin_family = AF_INET; in.sin_addr.s_addr = INADDR_ANY; in.sin_port = htons(port); fl = tl = sizeof(struct sockaddr_in); memset(&from, 0, sizeof(from)); memset(&to, 0, sizeof(to)); switch (pid = fork()) { case -1: perror("fork"); return 0; case 0: /* child */ usleep(100000); goto client; } /* parent: server */ server_socket = socket(PF_INET, SOCK_DGRAM, 0); if (udpfromto_init(server_socket) != 0) { perror("udpfromto_init\n"); waitpid(pid, NULL, WNOHANG); return 0; } if (bind(server_socket, (struct sockaddr *)&in, sizeof(in)) < 0) { perror("server: bind"); waitpid(pid, NULL, WNOHANG); return 0; } printf("server: waiting for packets on INADDR_ANY:%d\n", port); if ((n = recvfromto(server_socket, buf, sizeof(buf), 0, (struct sockaddr *)&from, &fl, (struct sockaddr *)&to, &tl)) < 0) { perror("server: recvfromto"); waitpid(pid, NULL, WNOHANG); return 0; } printf("server: received a packet of %d bytes [%s] ", n, buf); printf("(src ip:port %s:%d ", inet_ntoa(from.sin_addr), ntohs(from.sin_port)); printf(" dst ip:port %s:%d)\n", inet_ntoa(to.sin_addr), ntohs(to.sin_port)); printf("server: replying from address packet was received on to source address\n"); if ((n = sendfromto(server_socket, buf, n, 0, (struct sockaddr *)&to, tl, (struct sockaddr *)&from, fl)) < 0) { perror("server: sendfromto"); } waitpid(pid, NULL, 0); return 0; client: close(server_socket); client_socket = socket(PF_INET, SOCK_DGRAM, 0); if (udpfromto_init(client_socket) != 0) { perror("udpfromto_init"); _exit(0); } /* bind client on different port */ in.sin_port = htons(port+1); if (bind(client_socket, (struct sockaddr *)&in, sizeof(in)) < 0) { perror("client: bind"); _exit(0); } in.sin_port = htons(port); in.sin_addr.s_addr = inet_addr(destip); printf("client: sending packet to %s:%d\n", destip, port); if (sendto(client_socket, TESTSTRING, TESTLEN, 0, (struct sockaddr *)&in, sizeof(in)) < 0) { perror("client: sendto"); _exit(0); } printf("client: waiting for reply from server on INADDR_ANY:%d\n", port+1); if ((n = recvfromto(client_socket, buf, sizeof(buf), 0, (struct sockaddr *)&from, &fl, (struct sockaddr *)&to, &tl)) < 0) { perror("client: recvfromto"); _exit(0); } printf("client: received a packet of %d bytes [%s] ", n, buf); printf("(src ip:port %s:%d", inet_ntoa(from.sin_addr), ntohs(from.sin_port)); printf(" dst ip:port %s:%d)\n", inet_ntoa(to.sin_addr), ntohs(to.sin_port)); _exit(0); } #endif /* TESTING */ #endif /* WITH_UDPFROMTO */ freeradius-server/src/lib/valuepair.c000066400000000000000000001241741257552170400202250ustar00rootroot00000000000000/* * valuepair.c Functions to handle VALUE_PAIRs * * Version: $Id$ * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2000,2006 The FreeRADIUS server project */ #include RCSID("$Id$") #include #include #ifdef HAVE_MALLOC_H # include #endif #ifdef HAVE_REGEX_H # include #endif static const char *months[] = { "jan", "feb", "mar", "apr", "may", "jun", "jul", "aug", "sep", "oct", "nov", "dec" }; /* * This padding is necessary only for attributes that are NOT * in the dictionary, and then only because the rest of the * code accesses vp->name directly, rather than through an * accessor function. * * The name padding only has to large enough for: * * Vendor-65535-Attr-65535 * * i.e. 23 characters, plus a zero. We add another 8 bytes for * padding, because the VALUE_PAIR structure may be un-aligned. * * The result is that for the normal case, the server uses a less * memory (36 bytes * number of VALUE_PAIRs). */ #define FR_VP_NAME_PAD (32) #define FR_VP_NAME_LEN (24) VALUE_PAIR *pairalloc(DICT_ATTR *da) { size_t name_len = 0; VALUE_PAIR *vp; /* * Not in the dictionary: the name is allocated AFTER * the VALUE_PAIR struct. */ if (!da) name_len = FR_VP_NAME_PAD; vp = malloc(sizeof(*vp) + name_len); if (!vp) return NULL; memset(vp, 0, sizeof(*vp)); if (da) { vp->attribute = da->attr; vp->vendor = da->vendor; vp->type = da->type; vp->name = da->name; vp->flags = da->flags; } else { vp->attribute = 0; vp->vendor = 0; vp->type = PW_TYPE_OCTETS; vp->name = NULL; memset(&vp->flags, 0, sizeof(vp->flags)); vp->flags.unknown_attr = 1; } switch (vp->type) { case PW_TYPE_BYTE: vp->length = 1; break; case PW_TYPE_SHORT: vp->length = 2; break; case PW_TYPE_INTEGER: case PW_TYPE_IPADDR: case PW_TYPE_DATE: case PW_TYPE_SIGNED: vp->length = 4; break; case PW_TYPE_IFID: vp->length = sizeof(vp->vp_ifid); break; case PW_TYPE_IPV6ADDR: vp->length = sizeof(vp->vp_ipv6addr); break; case PW_TYPE_IPV6PREFIX: vp->length = sizeof(vp->vp_ipv6prefix); break; case PW_TYPE_ETHERNET: vp->length = sizeof(vp->vp_ether); break; case PW_TYPE_TLV: vp->vp_tlv = NULL; vp->length = 0; break; case PW_TYPE_COMBO_IP: default: vp->length = 0; break; } return vp; } VALUE_PAIR *paircreate_raw(int attr, int type, VALUE_PAIR *vp) { char *p = (char *) (vp + 1); if (!vp->flags.unknown_attr) { pairfree(&vp); return NULL; } vp->vendor = VENDOR(attr); vp->attribute = attr; vp->operator = T_OP_EQ; vp->name = p; vp->type = type; vp->length = 0; memset(&vp->flags, 0, sizeof(vp->flags)); vp->flags.unknown_attr = 1; if (!vp_print_name(p, FR_VP_NAME_LEN, vp->attribute)) { free(vp); return NULL; } return vp; } /* * Create a new valuepair. */ VALUE_PAIR *paircreate(int attr, int type) { VALUE_PAIR *vp; DICT_ATTR *da; da = dict_attrbyvalue(attr); if ((vp = pairalloc(da)) == NULL) { fr_strerror_printf("out of memory"); return NULL; } vp->operator = T_OP_EQ; /* * It isn't in the dictionary: update the name. */ if (!da) return paircreate_raw(attr, type, vp); return vp; } /* * release the memory used by a single attribute-value pair * just a wrapper around free() for now. */ void pairbasicfree(VALUE_PAIR *pair) { if (pair->type == PW_TYPE_TLV) free(pair->vp_tlv); /* clear the memory here */ memset(pair, 0, sizeof(*pair)); free(pair); } /* * Release the memory used by a list of attribute-value * pairs, and sets the pair pointer to NULL. */ void pairfree(VALUE_PAIR **pair_ptr) { VALUE_PAIR *next, *pair; if (!pair_ptr) return; pair = *pair_ptr; while (pair != NULL) { next = pair->next; pairbasicfree(pair); pair = next; } *pair_ptr = NULL; } /* * Find the pair with the matching attribute */ VALUE_PAIR * pairfind(VALUE_PAIR *first, int attr) { while(first && first->attribute != attr) first = first->next; return first; } /* * Delete the pair(s) with the matching attribute */ void pairdelete(VALUE_PAIR **first, int attr) { VALUE_PAIR *i, *next; VALUE_PAIR **last = first; for(i = *first; i; i = next) { next = i->next; if (i->attribute == attr) { *last = next; pairbasicfree(i); } else { last = &i->next; } } } /* * Add a pair at the end of a VALUE_PAIR list. */ void pairadd(VALUE_PAIR **first, VALUE_PAIR *add) { VALUE_PAIR *i; if (!add) return; if (*first == NULL) { *first = add; return; } for(i = *first; i->next; i = i->next) ; i->next = add; } /* * Add or replace a pair at the end of a VALUE_PAIR list. */ void pairreplace(VALUE_PAIR **first, VALUE_PAIR *replace) { VALUE_PAIR *i, *next; VALUE_PAIR **prev = first; if (*first == NULL) { *first = replace; return; } /* * Not an empty list, so find item if it is there, and * replace it. Note, we always replace the first one, and * we ignore any others that might exist. */ for(i = *first; i; i = next) { next = i->next; /* * Found the first attribute, replace it, * and return. */ if (i->attribute == replace->attribute) { *prev = replace; /* * Should really assert that replace->next == NULL */ replace->next = next; pairbasicfree(i); return; } /* * Point to where the attribute should go. */ prev = &i->next; } /* * If we got here, we didn't find anything to replace, so * stopped at the last item, which we just append to. */ *prev = replace; } /* * Copy just one VP. */ VALUE_PAIR *paircopyvp(const VALUE_PAIR *vp) { size_t name_len; VALUE_PAIR *n; if (!vp) return NULL; if (!vp->flags.unknown_attr) { name_len = 0; } else { name_len = FR_VP_NAME_PAD; } if ((n = malloc(sizeof(*n) + name_len)) == NULL) { fr_strerror_printf("out of memory"); return NULL; } memcpy(n, vp, sizeof(*n) + name_len); /* * Reset the name field to point to the NEW attribute, * rather than to the OLD one. */ if (vp->flags.unknown_attr) n->name = (char *) (n + 1); n->next = NULL; if ((n->type == PW_TYPE_TLV) && (n->vp_tlv != NULL)) { n->vp_tlv = malloc(n->length); memcpy(n->vp_tlv, vp->vp_tlv, n->length); } return n; } /* * Copy just a certain type of pairs. */ VALUE_PAIR *paircopy2(VALUE_PAIR *vp, int attr) { VALUE_PAIR *first, *n, **last; first = NULL; last = &first; while (vp) { if ((vp->attribute != attr) && (attr != -1)) { vp = vp->next; continue; } n = paircopyvp(vp); if (!n) return first; *last = n; last = &n->next; vp = vp->next; } return first; } /* * Copy a pairlist. */ VALUE_PAIR *paircopy(VALUE_PAIR *vp) { return paircopy2(vp, -1); } /* * Move attributes from one list to the other * if not already present. */ void pairmove(VALUE_PAIR **to, VALUE_PAIR **from) { VALUE_PAIR **tailto, *i, *j, *next; VALUE_PAIR *tailfrom = NULL; VALUE_PAIR *found; int has_password = 0; /* * First, see if there are any passwords here, and * point "tailto" to the end of the "to" list. */ tailto = to; for(i = *to; i; i = i->next) { if (i->attribute == PW_USER_PASSWORD || i->attribute == PW_CRYPT_PASSWORD) has_password = 1; tailto = &i->next; } /* * Loop over the "from" list. */ for(i = *from; i; i = next) { next = i->next; /* * If there was a password in the "to" list, * do not move any other password from the * "from" to the "to" list. */ if (has_password && (i->attribute == PW_USER_PASSWORD || i->attribute == PW_CRYPT_PASSWORD)) { tailfrom = i; continue; } switch (i->operator) { /* * These are COMPARISON attributes * from a check list, and are not * supposed to be copied! */ case T_OP_NE: case T_OP_GE: case T_OP_GT: case T_OP_LE: case T_OP_LT: case T_OP_CMP_TRUE: case T_OP_CMP_FALSE: case T_OP_CMP_EQ: case T_OP_REG_EQ: case T_OP_REG_NE: tailfrom = i; continue; default: break; } /* * If the attribute is already present in "to", * do not move it from "from" to "to". We make * an exception for "Hint" which can appear multiple * times, and we never move "Fall-Through". */ if (i->attribute == PW_FALL_THROUGH || (i->attribute != PW_HINT && i->attribute != PW_FRAMED_ROUTE)) { found = pairfind(*to, i->attribute); switch (i->operator) { /* * If matching attributes are found, * delete them. */ case T_OP_SUB: /* -= */ if (found) { if (!i->vp_strvalue[0] || (strcmp((char *)found->vp_strvalue, (char *)i->vp_strvalue) == 0)){ pairdelete(to, found->attribute); /* * 'tailto' may have been * deleted... */ tailto = to; for(j = *to; j; j = j->next) { tailto = &j->next; } } } tailfrom = i; continue; break; /* really HAVE_REGEX_H */ #if 0 /* * Attr-Name =~ "s/find/replace/" * * Very bad code. Barely working, * if at all. */ case T_OP_REG_EQ: if (found && (i->vp_strvalue[0] == 's')) { regex_t reg; regmatch_t match[1]; char *str; char *p, *q; p = i->vp_strvalue + 1; q = strchr(p + 1, *p); if (!q || (q[strlen(q) - 1] != *p)) { tailfrom = i; continue; } str = strdup(i->vp_strvalue + 2); q = strchr(str, *p); *(q++) = '\0'; q[strlen(q) - 1] = '\0'; regcomp(®, str, 0); if (regexec(®, found->vp_strvalue, 1, match, 0) == 0) { fprintf(stderr, "\"%s\" will have %d to %d replaced with %s\n", found->vp_strvalue, match[0].rm_so, match[0].rm_eo, q); } regfree(®); free(str); } tailfrom = i; /* don't copy it over */ continue; break; #endif case T_OP_EQ: /* = */ /* * FIXME: Tunnel attributes with * different tags are different * attributes. */ if (found) { tailfrom = i; continue; /* with the loop */ } break; /* * If a similar attribute is found, * replace it with the new one. Otherwise, * add the new one to the list. */ case T_OP_SET: /* := */ if (found) { VALUE_PAIR *mynext = found->next; /* * Do NOT call pairdelete() * here, due to issues with * re-writing "request->username". * * Everybody calls pairmove, * and expects it to work. * We can't update request->username * here, so instead we over-write * the vp that it's pointing to. */ memcpy(found, i, sizeof(*found)); found->next = mynext; pairdelete(&found->next, found->attribute); /* * 'tailto' may have been * deleted... */ for(j = found; j; j = j->next) { tailto = &j->next; } continue; } break; /* * Add the new element to the list, even * if similar ones already exist. */ default: case T_OP_ADD: /* += */ break; } } if (tailfrom) tailfrom->next = next; else *from = next; /* * If ALL of the 'to' attributes have been deleted, * then ensure that the 'tail' is updated to point * to the head. */ if (!*to) { tailto = to; } *tailto = i; if (i) { i->next = NULL; tailto = &i->next; } } } /* * Move one kind of attributes from one list to the other */ void pairmove2(VALUE_PAIR **to, VALUE_PAIR **from, int attr) { VALUE_PAIR *to_tail, *i, *next; VALUE_PAIR *iprev = NULL; /* * Find the last pair in the "to" list and put it in "to_tail". */ if (*to != NULL) { to_tail = *to; for(i = *to; i; i = i->next) to_tail = i; } else to_tail = NULL; for(i = *from; i; i = next) { next = i->next; /* * If the attribute to move is NOT a VSA, then it * ignores any attributes which do not match exactly. */ if ((attr != PW_VENDOR_SPECIFIC) && (i->attribute != attr)) { iprev = i; continue; } /* * If the attribute to move IS a VSA, then it ignores * any non-VSA attribute. */ if ((attr == PW_VENDOR_SPECIFIC) && (VENDOR(i->attribute) == 0)) { iprev = i; continue; } /* * Remove the attribute from the "from" list. */ if (iprev) iprev->next = next; else *from = next; /* * Add the attribute to the "to" list. */ if (to_tail) to_tail->next = i; else *to = i; to_tail = i; i->next = NULL; } } /* * Sort of strtok/strsep function. */ static char *mystrtok(char **ptr, const char *sep) { char *res; if (**ptr == 0) return NULL; while (**ptr && strchr(sep, **ptr)) (*ptr)++; if (**ptr == 0) return NULL; res = *ptr; while (**ptr && strchr(sep, **ptr) == NULL) (*ptr)++; if (**ptr != 0) *(*ptr)++ = 0; return res; } /* * Turn printable string into time_t * Returns -1 on error, 0 on OK. */ static int gettime(const char *valstr, time_t *date) { int i; time_t t; struct tm *tm, s_tm; char buf[64]; char *p; char *f[4]; char *tail = '\0'; /* * Test for unix timestamp date */ *date = strtoul(valstr, &tail, 10); if (*tail == '\0') { return 0; } tm = &s_tm; memset(tm, 0, sizeof(*tm)); tm->tm_isdst = -1; /* don't know, and don't care about DST */ strlcpy(buf, valstr, sizeof(buf)); p = buf; f[0] = mystrtok(&p, " \t"); f[1] = mystrtok(&p, " \t"); f[2] = mystrtok(&p, " \t"); f[3] = mystrtok(&p, " \t"); /* may, or may not, be present */ if (!f[0] || !f[1] || !f[2]) return -1; /* * The time has a colon, where nothing else does. * So if we find it, bubble it to the back of the list. */ if (f[3]) { for (i = 0; i < 3; i++) { if (strchr(f[i], ':')) { p = f[3]; f[3] = f[i]; f[i] = p; break; } } } /* * The month is text, which allows us to find it easily. */ tm->tm_mon = 12; for (i = 0; i < 3; i++) { if (isalpha( (int) *f[i])) { /* * Bubble the month to the front of the list */ p = f[0]; f[0] = f[i]; f[i] = p; for (i = 0; i < 12; i++) { if (strncasecmp(months[i], f[0], 3) == 0) { tm->tm_mon = i; break; } } } } /* month not found? */ if (tm->tm_mon == 12) return -1; /* * The year may be in f[1], or in f[2] */ tm->tm_year = atoi(f[1]); tm->tm_mday = atoi(f[2]); if (tm->tm_year >= 1900) { tm->tm_year -= 1900; } else { /* * We can't use 2-digit years any more, they make it * impossible to tell what's the day, and what's the year. */ if (tm->tm_mday < 1900) return -1; /* * Swap the year and the day. */ i = tm->tm_year; tm->tm_year = tm->tm_mday - 1900; tm->tm_mday = i; } /* * If the day is out of range, die. */ if ((tm->tm_mday < 1) || (tm->tm_mday > 31)) { return -1; } /* * There may be %H:%M:%S. Parse it in a hacky way. */ if (f[3]) { f[0] = f[3]; /* HH */ f[1] = strchr(f[0], ':'); /* find : separator */ if (!f[1]) return -1; *(f[1]++) = '\0'; /* nuke it, and point to MM:SS */ f[2] = strchr(f[1], ':'); /* find : separator */ if (f[2]) { *(f[2]++) = '\0'; /* nuke it, and point to SS */ tm->tm_sec = atoi(f[2]); } /* else leave it as zero */ tm->tm_hour = atoi(f[0]); tm->tm_min = atoi(f[1]); } /* * Returns -1 on error. */ t = mktime(tm); if (t == (time_t) -1) return -1; *date = t; return 0; } static const char *hextab = "0123456789abcdef"; /* * Parse a string value into a given VALUE_PAIR * * FIXME: we probably want to fix this function to accept * octets as values for any type of attribute. We should then * double-check the parsed value, to be sure it's legal for that * type (length, etc.) */ static uint32_t getint(const char *value, char **end) { if ((value[0] == '0') && (value[1] == 'x')) { return strtoul(value, end, 16); } return strtoul(value, end, 10); } static int check_for_whitespace(const char *value) { while (*value) { if (!isspace((int) *value)) return 0; value++; } return 1; } VALUE_PAIR *pairparsevalue(VALUE_PAIR *vp, const char *value) { char *p, *s=0; const char *cp, *cs; int x; size_t length; DICT_VALUE *dval; if (!value) return NULL; /* * Even for integers, dates and ip addresses we * keep the original string in vp->vp_strvalue. */ if (vp->type != PW_TYPE_TLV) { strlcpy(vp->vp_strvalue, value, sizeof(vp->vp_strvalue)); vp->length = strlen(vp->vp_strvalue); } switch(vp->type) { case PW_TYPE_STRING: /* * Do escaping here */ p = vp->vp_strvalue; cp = value; length = 0; while (*cp && (length < (sizeof(vp->vp_strvalue) - 1))) { char c = *cp++; if (c == '\\') { switch (*cp) { case 'r': c = '\r'; cp++; break; case 'n': c = '\n'; cp++; break; case 't': c = '\t'; cp++; break; case '"': c = '"'; cp++; break; case '\'': c = '\''; cp++; break; case '\\': c = '\\'; cp++; break; case '`': c = '`'; cp++; break; case '\0': c = '\\'; /* no cp++ */ break; default: if ((cp[0] >= '0') && (cp[0] <= '9') && (cp[1] >= '0') && (cp[1] <= '9') && (cp[2] >= '0') && (cp[2] <= '9') && (sscanf(cp, "%3o", &x) == 1)) { c = x; cp += 3; } /* else just do '\\' */ } } *p++ = c; length++; } vp->vp_strvalue[length] = '\0'; vp->length = length; break; case PW_TYPE_IPADDR: /* * It's a comparison, not a real IP. */ if ((vp->operator == T_OP_REG_EQ) || (vp->operator == T_OP_REG_NE)) { break; } /* * FIXME: complain if hostname * cannot be resolved, or resolve later! */ s = NULL; if ((p = strrchr(value, '+')) != NULL && !p[1]) { cs = s = strdup(value); if (!s) return NULL; p = strrchr(s, '+'); if (p) *p = 0; vp->flags.addport = 1; } else { p = NULL; cs = value; } { fr_ipaddr_t ipaddr; if (ip_hton(cs, AF_INET, &ipaddr) < 0) { fr_strerror_printf("Failed to find IP address for %s", cs); free(s); return NULL; } vp->vp_ipaddr = ipaddr.ipaddr.ip4addr.s_addr; } free(s); vp->length = 4; break; case PW_TYPE_BYTE: vp->length = 1; /* * Note that ALL integers are unsigned! */ vp->vp_integer = getint(value, &p); if (!*p) { if (vp->vp_integer > 255) { fr_strerror_printf("Byte value \"%s\" is larger than 255", value); return NULL; } break; } if (check_for_whitespace(p)) break; goto check_for_value; case PW_TYPE_SHORT: /* * Note that ALL integers are unsigned! */ vp->vp_integer = getint(value, &p); vp->length = 2; if (!*p) { if (vp->vp_integer > 65535) { fr_strerror_printf("Byte value \"%s\" is larger than 65535", value); return NULL; } break; } if (check_for_whitespace(p)) break; goto check_for_value; case PW_TYPE_INTEGER: /* * Note that ALL integers are unsigned! */ vp->vp_integer = getint(value, &p); vp->length = 4; if (!*p) break; if (check_for_whitespace(p)) break; check_for_value: /* * Look for the named value for the given * attribute. */ if ((dval = dict_valbyname(vp->attribute, value)) == NULL) { fr_strerror_printf("Unknown value %s for attribute %s", value, vp->name); return NULL; } vp->vp_integer = dval->value; break; case PW_TYPE_DATE: { /* * time_t may be 64 bits, whule vp_date * MUST be 32-bits. We need an * intermediary variable to handle * the conversions. */ time_t date; if (gettime(value, &date) < 0) { fr_strerror_printf("failed to parse time string " "\"%s\"", value); return NULL; } vp->vp_date = date; } vp->length = 4; break; case PW_TYPE_ABINARY: #ifdef ASCEND_BINARY if (strncasecmp(value, "0x", 2) == 0) { vp->type = PW_TYPE_OCTETS; goto do_octets; } if (ascend_parse_filter(vp) < 0 ) { char buffer[256]; snprintf(buffer, sizeof(buffer), "failed to parse Ascend binary attribute: %s", fr_strerror()); fr_strerror_printf("%s", buffer); return NULL; } break; /* * If Ascend binary is NOT defined, * then fall through to raw octets, so that * the user can at least make them by hand... */ do_octets: #endif /* raw octets: 0x01020304... */ case PW_TYPE_OCTETS: if (strncasecmp(value, "0x", 2) == 0) { uint8_t *us; cp = value + 2; us = vp->vp_octets; vp->length = 0; /* * There is only one character, * die. */ if ((strlen(cp) & 0x01) != 0) { fr_strerror_printf("Hex string is not an even length string."); return NULL; } while (*cp && (vp->length < MAX_STRING_LEN)) { unsigned int tmp; if (sscanf(cp, "%02x", &tmp) != 1) { fr_strerror_printf("Non-hex characters at %c%c", cp[0], cp[1]); return NULL; } cp += 2; *(us++) = tmp; vp->length++; } } break; case PW_TYPE_IFID: if (ifid_aton(value, (void *) &vp->vp_ifid) == NULL) { fr_strerror_printf("failed to parse interface-id " "string \"%s\"", value); return NULL; } vp->length = 8; break; case PW_TYPE_IPV6ADDR: { fr_ipaddr_t ipaddr; if (ip_hton(value, AF_INET6, &ipaddr) < 0) { char buffer[1024]; strlcpy(buffer, fr_strerror(), sizeof(buffer)); fr_strerror_printf("failed to parse IPv6 address " "string \"%s\": %s", value, buffer); return NULL; } vp->vp_ipv6addr = ipaddr.ipaddr.ip6addr; vp->length = 16; /* length of IPv6 address */ } break; case PW_TYPE_IPV6PREFIX: p = strchr(value, '/'); if (!p || ((p - value) >= 256)) { fr_strerror_printf("invalid IPv6 prefix " "string \"%s\"", value); return NULL; } else { unsigned int prefix; char buffer[256], *eptr; memcpy(buffer, value, p - value); buffer[p - value] = '\0'; if (inet_pton(AF_INET6, buffer, vp->vp_octets + 2) <= 0) { fr_strerror_printf("failed to parse IPv6 address " "string \"%s\"", value); return NULL; } prefix = strtoul(p + 1, &eptr, 10); if ((prefix > 128) || *eptr) { fr_strerror_printf("failed to parse IPv6 address " "string \"%s\"", value); return NULL; } vp->vp_octets[1] = prefix; } vp->vp_octets[0] = '\0'; vp->length = 16 + 2; break; case PW_TYPE_ETHERNET: { const char *c1, *c2; length = 0; cp = value; while (*cp) { if (cp[1] == ':') { c1 = hextab; c2 = memchr(hextab, tolower((int) cp[0]), 16); cp += 2; } else if ((cp[1] != '\0') && ((cp[2] == ':') || (cp[2] == '\0'))) { c1 = memchr(hextab, tolower((int) cp[0]), 16); c2 = memchr(hextab, tolower((int) cp[1]), 16); cp += 2; if (*cp == ':') cp++; } else { c1 = c2 = NULL; } if (!c1 || !c2 || (length >= sizeof(vp->vp_ether))) { fr_strerror_printf("failed to parse Ethernet address \"%s\"", value); return NULL; } vp->vp_ether[length] = ((c1-hextab)<<4) + (c2-hextab); length++; } } vp->length = 6; break; case PW_TYPE_COMBO_IP: if (inet_pton(AF_INET6, value, vp->vp_strvalue) > 0) { vp->type = PW_TYPE_IPV6ADDR; vp->length = 16; /* length of IPv6 address */ vp->vp_strvalue[vp->length] = '\0'; } else { fr_ipaddr_t ipaddr; if (ip_hton(value, AF_INET, &ipaddr) < 0) { fr_strerror_printf("Failed to find IPv4 address for %s", value); return NULL; } vp->type = PW_TYPE_IPADDR; vp->vp_ipaddr = ipaddr.ipaddr.ip4addr.s_addr; vp->length = 4; } break; case PW_TYPE_SIGNED: /* Damned code for 1 WiMAX attribute */ vp->vp_signed = (int32_t) strtol(value, &p, 10); vp->length = 4; break; case PW_TYPE_TLV: /* don't use this! */ if (strncasecmp(value, "0x", 2) != 0) { fr_strerror_printf("Invalid TLV specification"); return NULL; } length = strlen(value + 2) / 2; if (vp->length < length) { free(vp->vp_tlv); vp->vp_tlv = NULL; } vp->vp_tlv = malloc(length); if (!vp->vp_tlv) { fr_strerror_printf("No memory"); return NULL; } if (fr_hex2bin(value + 2, vp->vp_tlv, length) != length) { fr_strerror_printf("Invalid hex data in TLV"); return NULL; } vp->length = length; break; /* * Anything else. */ default: fr_strerror_printf("unknown attribute type %d", vp->type); return NULL; } return vp; } /* * Create a VALUE_PAIR from an ASCII attribute and value, * where the attribute name is in the form: * * Attr-%d * Vendor-%d-Attr-%d * VendorName-Attr-%d */ static VALUE_PAIR *pairmake_any(const char *attribute, const char *value, int operator) { int attr, vendor; size_t size; const char *p = attribute; char *q; VALUE_PAIR *vp; /* * Unknown attributes MUST be of type 'octets' */ if (value && (strncasecmp(value, "0x", 2) != 0)) { fr_strerror_printf("Unknown attribute \"%s\" requires a hex string, not \"%s\"", attribute, value); return NULL; } vendor = 0; /* * Pull off vendor prefix first. */ if (strncasecmp(p, "Attr-", 5) != 0) { if (strncasecmp(p, "Vendor-", 7) == 0) { vendor = (int) strtol(p + 7, &q, 10); if ((vendor == 0) || (vendor > 65535)) { fr_strerror_printf("Invalid vendor value in attribute name \"%s\"", attribute); return NULL; } p = q; } else { /* must be vendor name */ char buffer[256]; q = strchr(p, '-'); if (!q) { fr_strerror_printf("Invalid vendor name in attribute name \"%s\"", attribute); return NULL; } if ((size_t) (q - p) >= sizeof(buffer)) { fr_strerror_printf("Vendor name too long in attribute name \"%s\"", attribute); return NULL; } memcpy(buffer, p, (q - p)); buffer[q - p] = '\0'; vendor = dict_vendorbyname(buffer); if (!vendor) { fr_strerror_printf("Unknown vendor name in attribute name \"%s\"", attribute); return NULL; } p = q; } if (*p != '-') { fr_strerror_printf("Invalid text following vendor definition in attribute name \"%s\"", attribute); return NULL; } p++; } /* * Attr-%d */ if (strncasecmp(p, "Attr-", 5) != 0) { fr_strerror_printf("Invalid format in attribute name \"%s\"", attribute); return NULL; } attr = strtol(p + 5, &q, 10); /* * Invalid, or trailing text after number. */ if ((attr == 0) || *q) { fr_strerror_printf("Invalid value in attribute name \"%s\"", attribute); return NULL; } /* * Double-check the size of attr. */ if (vendor) { DICT_VENDOR *dv = dict_vendorbyvalue(vendor); if (!dv) { if (attr > 255) { attr_error: fr_strerror_printf("Invalid attribute number in attribute name \"%s\"", attribute); return NULL; } } else switch (dv->type) { case 1: if (attr > 255) goto attr_error; break; case 2: if (attr > 65535) goto attr_error; break; case 4: /* Internal limitations! */ if (attr > 65535) goto attr_error; break; default: fr_strerror_printf("Internal sanity check failed"); return NULL; } } attr |= vendor << 16; /* * We've now parsed the attribute properly, Let's create * it. This next stop also looks the attribute up in the * dictionary, and creates the appropriate type for it. */ if ((vp = paircreate(attr, PW_TYPE_OCTETS)) == NULL) { fr_strerror_printf("out of memory"); return NULL; } vp->operator = (operator == 0) ? T_OP_EQ : operator; if (!value) return vp; size = strlen(value + 2); /* * We may be reading something like Attr-5. i.e. * who-ever wrote the text didn't understand it, but we * do. */ switch (vp->type) { default: if (size == (vp->length * 2)) break; vp->type = PW_TYPE_OCTETS; /* FALL-THROUGH */ case PW_TYPE_OCTETS: case PW_TYPE_ABINARY: vp->length = size >> 1; if (vp->length > sizeof(vp->vp_octets)) { vp->length = sizeof(vp->vp_octets); } break; case PW_TYPE_STRING: vp->length = size >> 1; memset(&vp->vp_strvalue, 0, sizeof(vp->vp_strvalue)); if (vp->length >= sizeof(vp->vp_strvalue)) { vp->length = sizeof(vp->vp_strvalue) - 1; } break; } if (fr_hex2bin(value + 2, vp->vp_octets, size) != vp->length) { fr_strerror_printf("Invalid hex string"); free(vp); return NULL; } /* * Move contents around based on type. This is * to work around the historical use of "lvalue". */ switch (vp->type) { case PW_TYPE_DATE: case PW_TYPE_IPADDR: case PW_TYPE_INTEGER: memcpy(&vp->lvalue, vp->vp_octets, sizeof(vp->lvalue)); vp->vp_strvalue[0] = '\0'; break; default: break; } return vp; } /* * Create a VALUE_PAIR from an ASCII attribute and value. */ VALUE_PAIR *pairmake(const char *attribute, const char *value, int operator) { DICT_ATTR *da; VALUE_PAIR *vp; char *tc, *ts; signed char tag; int found_tag; char buffer[64]; const char *attrname = attribute; /* * Check for tags in 'Attribute:Tag' format. */ found_tag = 0; tag = 0; ts = strrchr(attribute, ':'); if (ts && !ts[1]) { fr_strerror_printf("Invalid tag for attribute %s", attribute); return NULL; } if (ts && ts[1]) { strlcpy(buffer, attribute, sizeof(buffer)); attrname = buffer; ts = strrchr(attrname, ':'); /* Colon found with something behind it */ if (ts[1] == '*' && ts[2] == 0) { /* Wildcard tag for check items */ tag = TAG_ANY; *ts = 0; } else if ((ts[1] >= '0') && (ts[1] <= '9')) { /* It's not a wild card tag */ tag = strtol(ts + 1, &tc, 0); if (tc && !*tc && TAG_VALID_ZERO(tag)) *ts = 0; else tag = 0; } else { fr_strerror_printf("Invalid tag for attribute %s", attribute); return NULL; } found_tag = 1; } /* * It's not found in the dictionary, so we use * another method to create the attribute. */ if ((da = dict_attrbyname(attrname)) == NULL) { return pairmake_any(attrname, value, operator); } if ((vp = pairalloc(da)) == NULL) { fr_strerror_printf("out of memory"); return NULL; } vp->operator = (operator == 0) ? T_OP_EQ : operator; /* Check for a tag in the 'Merit' format of: * :Tag:Value. Print an error if we already found * a tag in the Attribute. */ if (value && (*value == ':' && da->flags.has_tag)) { /* If we already found a tag, this is invalid */ if(found_tag) { fr_strerror_printf("Duplicate tag %s for attribute %s", value, vp->name); DEBUG("Duplicate tag %s for attribute %s\n", value, vp->name); pairbasicfree(vp); return NULL; } /* Colon found and attribute allows a tag */ if (value[1] == '*' && value[2] == ':') { /* Wildcard tag for check items */ tag = TAG_ANY; value += 3; } else { /* Real tag */ tag = strtol(value + 1, &tc, 0); if (tc && *tc==':' && TAG_VALID_ZERO(tag)) value = tc + 1; else tag = 0; } found_tag = 1; } if (found_tag) { vp->flags.tag = tag; } switch (vp->operator) { default: break; /* * For =* and !* operators, the value is irrelevant * so we return now. */ case T_OP_CMP_TRUE: case T_OP_CMP_FALSE: vp->vp_strvalue[0] = '\0'; vp->length = 0; return vp; break; /* * Regular expression comparison of integer attributes * does a STRING comparison of the names of their * integer attributes. */ case T_OP_REG_EQ: /* =~ */ case T_OP_REG_NE: /* !~ */ if (!value) { fr_strerror_printf("No regular expression found in %s", vp->name); pairbasicfree(vp); return NULL; } strlcpy(vp->vp_strvalue, value, sizeof(vp->vp_strvalue)); vp->length = strlen(vp->vp_strvalue); /* * If anything goes wrong, this is a run-time error, * not a compile-time error. */ return vp; } /* * FIXME: if (strcasecmp(attribute, vp->name) != 0) * then the user MAY have typed in the attribute name * as Vendor-%d-Attr-%d, and the value MAY be octets. * * We probably want to fix pairparsevalue to accept * octets as values for any attribute. */ if (value && (pairparsevalue(vp, value) == NULL)) { pairbasicfree(vp); return NULL; } return vp; } /* * [a-zA-Z0-9_-:]+ */ static const int valid_attr_name[256] = { 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, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 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, 0, 0, 0, 0, 1, 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, 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, 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, 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 }; /* * Read a valuepair from a buffer, and advance pointer. * Sets *eol to T_EOL if end of line was encountered. */ VALUE_PAIR *pairread(const char **ptr, FR_TOKEN *eol) { char buf[64]; char attr[64]; char value[1024], *q; const char *p; FR_TOKEN token, t, xlat; VALUE_PAIR *vp; size_t len; *eol = T_OP_INVALID; p = *ptr; while ((*p == ' ') || (*p == '\t')) p++; if (!*p) { *eol = T_OP_INVALID; fr_strerror_printf("No token read where we expected an attribute name"); return NULL; } if (*p == '#') { *eol = T_HASH; fr_strerror_printf("Read a comment instead of a token"); return NULL; } q = attr; for (len = 0; len < sizeof(attr); len++) { if (valid_attr_name[(int)*((const uint8_t *)p)]) { *q++ = *p++; continue; } break; } if (len == sizeof(attr)) { *eol = T_OP_INVALID; fr_strerror_printf("Attribute name is too long"); return NULL; } /* * We may have Foo-Bar:= stuff, so back up. */ if ((len > 0) && (attr[len - 1] == ':')) { p--; len--; } attr[len] = '\0'; *ptr = p; if (!*attr) { *eol = T_OP_INVALID; fr_strerror_printf("Invalid attribute name"); return NULL; } /* Now we should have an operator here. */ token = gettoken(ptr, buf, sizeof(buf)); if (token < T_EQSTART || token > T_EQEND) { fr_strerror_printf("expecting operator"); return NULL; } /* Read value. Note that empty string values are allowed */ xlat = gettoken(ptr, value, sizeof(value)); if (xlat == T_EOL) { fr_strerror_printf("failed to get value"); return NULL; } /* * Peek at the next token. Must be T_EOL, T_COMMA, or T_HASH */ p = *ptr; t = gettoken(&p, buf, sizeof(buf)); if (t != T_EOL && t != T_COMMA && t != T_HASH) { fr_strerror_printf("Expected end of line or comma"); return NULL; } *eol = t; if (t == T_COMMA) { *ptr = p; } vp = NULL; switch (xlat) { /* * Make the full pair now. */ default: vp = pairmake(attr, value, token); break; /* * Perhaps do xlat's */ case T_DOUBLE_QUOTED_STRING: p = strchr(value, '%'); if (p && (p[1] == '{')) { if (strlen(value) >= sizeof(vp->vp_strvalue)) { fr_strerror_printf("Value too long"); return NULL; } vp = pairmake(attr, NULL, token); if (!vp) { *eol = T_OP_INVALID; return NULL; } strlcpy(vp->vp_strvalue, value, sizeof(vp->vp_strvalue)); vp->flags.do_xlat = 1; vp->length = 0; } else { /* * Parse && escape it, as defined by the * data type. */ vp = pairmake(attr, value, token); if (!vp) { *eol = T_OP_INVALID; return NULL; } } break; case T_SINGLE_QUOTED_STRING: vp = pairmake(attr, NULL, token); if (!vp) { *eol = T_OP_INVALID; return NULL; } /* * String and octet types get copied verbatim. */ if ((vp->type == PW_TYPE_STRING) || (vp->type == PW_TYPE_OCTETS)) { strlcpy(vp->vp_strvalue, value, sizeof(vp->vp_strvalue)); vp->length = strlen(vp->vp_strvalue); /* * Everything else gets parsed: it's * DATA, not a string! */ } else if (!pairparsevalue(vp, value)) { pairfree(&vp); *eol = T_OP_INVALID; return NULL; } break; /* * Mark the pair to be allocated later. */ case T_BACK_QUOTED_STRING: if (strlen(value) >= sizeof(vp->vp_strvalue)) { fr_strerror_printf("Value too long"); return NULL; } vp = pairmake(attr, NULL, token); if (!vp) { *eol = T_OP_INVALID; return NULL; } vp->flags.do_xlat = 1; strlcpy(vp->vp_strvalue, value, sizeof(vp->vp_strvalue)); vp->length = 0; break; } /* * If we didn't make a pair, return an error. */ if (!vp) { *eol = T_OP_INVALID; return NULL; } return vp; } /* * Read one line of attribute/value pairs. This might contain * multiple pairs seperated by comma's. */ FR_TOKEN userparse(const char *buffer, VALUE_PAIR **first_pair) { VALUE_PAIR *vp, *head, **tail; const char *p; FR_TOKEN last_token = T_OP_INVALID; FR_TOKEN previous_token; /* * We allow an empty line. */ if (buffer[0] == 0) return T_EOL; head = NULL; tail = &head; p = buffer; do { previous_token = last_token; if ((vp = pairread(&p, &last_token)) == NULL) { break; } *tail = vp; tail = &((*tail)->next); } while (*p && (last_token == T_COMMA)); /* * Don't tell the caller that there was a comment. */ if (last_token == T_HASH) { last_token = previous_token; } if (last_token == T_OP_INVALID) { pairfree(&head); } else { pairadd(first_pair, head); } /* * And return the last token which we read. */ return last_token; } /* * Read valuepairs from the fp up to End-Of-File. * * Hmm... this function is only used by radclient.. */ VALUE_PAIR *readvp2(FILE *fp, int *pfiledone, const char *errprefix) { char buf[8192]; FR_TOKEN last_token = T_EOL; VALUE_PAIR *vp; VALUE_PAIR *list; int error = 0; list = NULL; while (!error && fgets(buf, sizeof(buf), fp) != NULL) { /* * If we get a '\n' by itself, we assume that's * the end of that VP */ if ((buf[0] == '\n') && (list)) { return list; } if ((buf[0] == '\n') && (!list)) { continue; } /* * Comments get ignored */ if (buf[0] == '#') continue; /* * Read all of the attributes on the current line. */ vp = NULL; last_token = userparse(buf, &vp); if (!vp) { if (last_token != T_EOL) { fr_perror("%s", errprefix); error = 1; break; } break; } pairadd(&list, vp); buf[0] = '\0'; } if (error) pairfree(&list); *pfiledone = 1; return error ? NULL: list; } /* * Compare two pairs, using the operator from "one". * * i.e. given two attributes, it does: * * (two->data) (one->operator) (one->data) * * e.g. "foo" != "bar" * * Returns true (comparison is true), or false (comparison is not true); * * FIXME: Ignores tags! */ int paircmp(VALUE_PAIR *one, VALUE_PAIR *two) { int compare; switch (one->operator) { case T_OP_CMP_TRUE: return (two != NULL); case T_OP_CMP_FALSE: return (two == NULL); /* * One is a regex, compile it, print two to a string, * and then do string comparisons. */ case T_OP_REG_EQ: case T_OP_REG_NE: #ifndef HAVE_REGEX_H return -1; #else { regex_t reg; char buffer[MAX_STRING_LEN * 4 + 1]; compare = regcomp(®, one->vp_strvalue, REG_EXTENDED); if (compare != 0) { regerror(compare, ®, buffer, sizeof(buffer)); fr_strerror_printf("Illegal regular expression in attribute: %s: %s", one->name, buffer); return -1; } vp_prints_value(buffer, sizeof(buffer), two, 0); /* * Don't care about substring matches, * oh well... */ compare = regexec(®, buffer, 0, NULL, 0); regfree(®); if (one->operator == T_OP_REG_EQ) return (compare == 0); return (compare != 0); } #endif default: /* we're OK */ break; } /* * After doing the previous check for special comparisons, * do the per-type comparison here. */ switch (one->type) { case PW_TYPE_ABINARY: case PW_TYPE_OCTETS: { size_t length; if (one->length < two->length) { length = one->length; } else { length = two->length; } if (length) { compare = memcmp(two->vp_octets, one->vp_octets, length); if (compare != 0) break; } /* * Contents are the same. The return code * is therefore the difference in lengths. * * i.e. "0x00" is smaller than "0x0000" */ compare = two->length - one->length; } break; case PW_TYPE_STRING: compare = strcmp(two->vp_strvalue, one->vp_strvalue); break; case PW_TYPE_BYTE: case PW_TYPE_SHORT: case PW_TYPE_INTEGER: case PW_TYPE_DATE: if (two->vp_integer < one->vp_integer) { compare = -1; } else if (two->vp_integer == one ->vp_integer) { compare = 0; } else { compare = +1; } break; case PW_TYPE_IPADDR: if (ntohl(two->vp_ipaddr) < ntohl(one->vp_ipaddr) ) { compare = -1; } else if (ntohl(two->vp_ipaddr) == ntohl(one->vp_ipaddr) ) { compare = 0; } else { compare = +1; } break; case PW_TYPE_IPV6ADDR: compare = memcmp(&two->vp_ipv6addr, &one->vp_ipv6addr, sizeof(two->vp_ipv6addr)); break; case PW_TYPE_IPV6PREFIX: compare = memcmp(&two->vp_ipv6prefix, &one->vp_ipv6prefix, sizeof(two->vp_ipv6prefix)); break; case PW_TYPE_IFID: compare = memcmp(&two->vp_ifid, &one->vp_ifid, sizeof(two->vp_ifid)); break; default: return 0; /* unknown type */ } /* * Now do the operator comparison. */ switch (one->operator) { case T_OP_CMP_EQ: return (compare == 0); case T_OP_NE: return (compare != 0); case T_OP_LT: return (compare < 0); case T_OP_GT: return (compare > 0); case T_OP_LE: return (compare <= 0); case T_OP_GE: return (compare >= 0); default: return 0; } return 0; } freeradius-server/src/lib/vqp.c000066400000000000000000000377401257552170400170450ustar00rootroot00000000000000/* * vqp.c Functions to send/receive VQP packets. * * Version: $Id$ * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2007 Alan DeKok */ #include RCSID("$Id$"); #include #include #include #ifdef WITH_VMPS #define MAX_VMPS_LEN (MAX_STRING_LEN - 1) /* * http://www.openbsd.org/cgi-bin/cvsweb/src/usr.sbin/tcpdump/print-vqp.c * * Some of how it works: * * http://www.hackingciscoexposed.com/pdf/chapter12.pdf * * VLAN Query Protocol (VQP) * * 0 1 2 3 * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | Version | Opcode | Response Code | Data Count | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | Transaction ID | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | Type (1) | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | Length | Data / * / / * / / * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | Type (n) | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | Length | Data / * / / * / / * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * * VQP is layered over UDP. The default destination port is 1589. * */ #define VQP_HDR_LEN (8) #define VQP_VERSION (1) #define VQP_MAX_ATTRIBUTES (12) /* * Wrapper for sendto which handles sendfromto, IPv6, and all * possible combinations. * * FIXME: This is just a copy of rad_sendto(). * Duplicate code is bad. */ static int vqp_sendto(int sockfd, void *data, size_t data_len, int flags, fr_ipaddr_t *src_ipaddr, fr_ipaddr_t *dst_ipaddr, int dst_port) { struct sockaddr_storage dst; socklen_t sizeof_dst; #ifdef WITH_UDPFROMTO struct sockaddr_storage src; socklen_t sizeof_src; fr_ipaddr2sockaddr(src_ipaddr, 0, &src, &sizeof_src); #else src_ipaddr = src_ipaddr; /* -Wunused */ #endif if (!fr_ipaddr2sockaddr(dst_ipaddr, dst_port, &dst, &sizeof_dst)) { return -1; /* Unknown address family, Die Die Die! */ } #ifdef WITH_UDPFROMTO /* * Only IPv4 is supported for udpfromto. * * And if they don't specify a source IP address, don't * use udpfromto. */ if ((dst_ipaddr->af == AF_INET) && (src_ipaddr->af != AF_UNSPEC)) { return sendfromto(sockfd, data, data_len, flags, (struct sockaddr *)&src, sizeof_src, (struct sockaddr *)&dst, sizeof_dst); } #else src_ipaddr = src_ipaddr; /* -Wunused */ #endif /* * No udpfromto, OR an IPv6 socket, fail gracefully. */ return sendto(sockfd, data, data_len, flags, (struct sockaddr *)&dst, sizeof_dst); } /* * Wrapper for recvfrom, which handles recvfromto, IPv6, and all * possible combinations. * * FIXME: This is copied from rad_recvfrom, with minor edits. */ static ssize_t vqp_recvfrom(int sockfd, uint8_t **pbuf, int flags, fr_ipaddr_t *src_ipaddr, uint16_t *src_port, fr_ipaddr_t *dst_ipaddr, uint16_t *dst_port) { struct sockaddr_storage src; struct sockaddr_storage dst; socklen_t sizeof_src = sizeof(src); socklen_t sizeof_dst = sizeof(dst); ssize_t data_len; uint8_t header[4]; void *buf; size_t len; int port; memset(&src, 0, sizeof_src); memset(&dst, 0, sizeof_dst); /* * Get address family, etc. first, so we know if we * need to do udpfromto. * * FIXME: udpfromto also does this, but it's not * a critical problem. */ if (getsockname(sockfd, (struct sockaddr *)&dst, &sizeof_dst) < 0) return -1; /* * Read the length of the packet, from the packet. * This lets us allocate the buffer to use for * reading the rest of the packet. */ data_len = recvfrom(sockfd, header, sizeof(header), MSG_PEEK, (struct sockaddr *)&src, &sizeof_src); if (data_len < 0) return -1; /* * Too little data is available, discard the packet. */ if (data_len < 4) { recvfrom(sockfd, header, sizeof(header), flags, (struct sockaddr *)&src, &sizeof_src); return 0; /* * Invalid version, packet type, or too many * attributes. Die. */ } else if ((header[0] != VQP_VERSION) || (header[1] < 1) || (header[1] > 4) || (header[3] > VQP_MAX_ATTRIBUTES)) { recvfrom(sockfd, header, sizeof(header), flags, (struct sockaddr *)&src, &sizeof_src); return 0; } else { /* we got 4 bytes of data. */ /* * We don't care about the contents for now... */ #if 0 /* * How many attributes are in the packet. */ len = header[3]; if ((header[1] == 1) || (header[1] == 3)) { if (len != VQP_MAX_ATTRIBUTES) { recvfrom(sockfd, header, sizeof(header), 0, (struct sockaddr *)&src, &sizeof_src); return 0; } /* * Maximum length we support. */ len = (12 * (4 + 4 + MAX_VMPS_LEN)); } else { if (len != 2) { recvfrom(sockfd, header, sizeof(header), 0, (struct sockaddr *)&src, &sizeof_src); return 0; } /* * Maximum length we support. */ len = (12 * (4 + 4 + MAX_VMPS_LEN)); } #endif } /* * For now, be generous. */ len = (12 * (4 + 4 + MAX_VMPS_LEN)); buf = malloc(len); if (!buf) return -1; /* * Receive the packet. The OS will discard any data in the * packet after "len" bytes. */ #ifdef WITH_UDPFROMTO if (dst.ss_family == AF_INET) { data_len = recvfromto(sockfd, buf, len, flags, (struct sockaddr *)&src, &sizeof_src, (struct sockaddr *)&dst, &sizeof_dst); } else #endif /* * No udpfromto, OR an IPv6 socket. Fail gracefully. */ data_len = recvfrom(sockfd, buf, len, flags, (struct sockaddr *)&src, &sizeof_src); if (data_len < 0) { free(buf); return data_len; } if (!fr_sockaddr2ipaddr(&src, sizeof_src, src_ipaddr, &port)) { free(buf); return -1; /* Unknown address family, Die Die Die! */ } *src_port = port; fr_sockaddr2ipaddr(&dst, sizeof_dst, dst_ipaddr, &port); *dst_port = port; /* * Different address families should never happen. */ if (src.ss_family != dst.ss_family) { free(buf); return -1; } /* * Tell the caller about the data */ *pbuf = buf; return data_len; } RADIUS_PACKET *vqp_recv(int sockfd) { uint8_t *ptr; ssize_t length; uint32_t id; RADIUS_PACKET *packet; /* * Allocate the new request data structure */ if ((packet = malloc(sizeof(*packet))) == NULL) { fr_strerror_printf("out of memory"); return NULL; } memset(packet, 0, sizeof(*packet)); packet->data_len = vqp_recvfrom(sockfd, &packet->data, 0, &packet->src_ipaddr, &packet->src_port, &packet->dst_ipaddr, &packet->dst_port); /* * Check for socket errors. */ if (packet->data_len < 0) { fr_strerror_printf("Error receiving packet: %s", strerror(errno)); /* packet->data is NULL */ free(packet); return NULL; } /* * We can only receive packets formatted in a way we * expect. However, we accept MORE attributes in a * packet than normal implementations may send. */ if (packet->data_len < VQP_HDR_LEN) { fr_strerror_printf("VQP packet is too short"); rad_free(&packet); return NULL; } ptr = packet->data; if (0) { int i; for (i = 0; i < packet->data_len; i++) { if ((i & 0x0f) == 0) fprintf(stderr, "%02x: ", i); fprintf(stderr, "%02x ", ptr[i]); if ((i & 0x0f) == 0x0f) fprintf(stderr, "\n"); } } if (ptr[3] > VQP_MAX_ATTRIBUTES) { fr_strerror_printf("Too many VQP attributes"); rad_free(&packet); return NULL; } if (packet->data_len > VQP_HDR_LEN) { int attrlen; /* * Skip the header. */ ptr += VQP_HDR_LEN; length = packet->data_len - VQP_HDR_LEN; while (length > 0) { if (length < 7) { fr_strerror_printf("Packet contains malformed attribute"); rad_free(&packet); return NULL; } /* * Attributes are 4 bytes * 0x00000c01 ... 0x00000c08 */ if ((ptr[0] != 0) || (ptr[1] != 0) || (ptr[2] != 0x0c) || (ptr[3] < 1) || (ptr[3] > 8)) { fr_strerror_printf("Packet contains invalid attribute"); rad_free(&packet); return NULL; } /* * Length is 2 bytes * * We support lengths 1..253, for internal * server reasons. Also, there's no reason * for bigger lengths to exist... admins * won't be typing in a 32K vlan name. * * Except for received ethernet frames... * they get chopped to 253 internally. */ if ((ptr[3] != 5) && ((ptr[4] != 0) || (ptr[5] > MAX_VMPS_LEN))) { fr_strerror_printf("Packet contains attribute with invalid length %02x %02x", ptr[4], ptr[5]); rad_free(&packet); return NULL; } attrlen = (ptr[4] << 8) | ptr[5]; ptr += 6 + attrlen; length -= (6 + attrlen); } } packet->sockfd = sockfd; packet->vps = NULL; /* * This is more than a bit of a hack. */ packet->code = PW_AUTHENTICATION_REQUEST; memcpy(&id, packet->data + 4, 4); packet->id = ntohl(id); /* * FIXME: Create a fake "request authenticator", to * avoid duplicates? Or is the VQP sequence number * adequate for this purpose? */ return packet; } /* * We do NOT mirror the old-style RADIUS code that does encode, * sign && send in one function. For VQP, the caller MUST perform * each task manually, and separately. */ int vqp_send(RADIUS_PACKET *packet) { if (!packet || !packet->data || (packet->data_len < 8)) return -1; /* * Don't print out the attributes, they were printed out * when it was encoded. */ /* * And send it on it's way. */ return vqp_sendto(packet->sockfd, packet->data, packet->data_len, 0, &packet->src_ipaddr, &packet->dst_ipaddr, packet->dst_port); } int vqp_decode(RADIUS_PACKET *packet) { uint8_t *ptr, *end; int attribute, length; VALUE_PAIR *vp, **tail; if (!packet || !packet->data) return -1; if (packet->data_len < VQP_HDR_LEN) return -1; tail = &packet->vps; vp = paircreate(PW_VQP_PACKET_TYPE, PW_TYPE_OCTETS); if (!vp) { fr_strerror_printf("No memory"); return -1; } vp->lvalue = packet->data[1]; debug_pair(vp); *tail = vp; tail = &(vp->next); vp = paircreate(PW_VQP_ERROR_CODE, PW_TYPE_OCTETS); if (!vp) { fr_strerror_printf("No memory"); return -1; } vp->lvalue = packet->data[2]; debug_pair(vp); *tail = vp; tail = &(vp->next); vp = paircreate(PW_VQP_SEQUENCE_NUMBER, PW_TYPE_OCTETS); if (!vp) { fr_strerror_printf("No memory"); return -1; } vp->lvalue = packet->id; /* already set by vqp_recv */ debug_pair(vp); *tail = vp; tail = &(vp->next); ptr = packet->data + VQP_HDR_LEN; end = packet->data + packet->data_len; /* * Note that vqp_recv() MUST ensure that the packet is * formatted in a way we expect, and that vqp_recv() MUST * be called before vqp_decode(). */ while (ptr < end) { attribute = (ptr[2] << 8) | ptr[3]; length = (ptr[4] << 8) | ptr[5]; ptr += 6; /* * Hack to get the dictionaries to work correctly. */ attribute |= 0x2000; vp = paircreate(attribute, PW_TYPE_OCTETS); if (!vp) { pairfree(&packet->vps); fr_strerror_printf("No memory"); return -1; } switch (vp->type) { case PW_TYPE_IPADDR: if (length == 4) { memcpy(&vp->vp_ipaddr, ptr, 4); vp->length = 4; break; } vp->type = PW_TYPE_OCTETS; /* FALL-THROUGH */ default: case PW_TYPE_OCTETS: case PW_TYPE_STRING: vp->length = (length > MAX_VMPS_LEN) ? MAX_VMPS_LEN : length; memcpy(vp->vp_octets, ptr, vp->length); vp->vp_octets[vp->length] = '\0'; break; } ptr += length; debug_pair(vp); *tail = vp; tail = &(vp->next); } /* * FIXME: Map attributes to Calling-Station-Id, etc... */ return 0; } /* * These are the MUST HAVE contents for a VQP packet. * * We don't allow the caller to give less than these, because * it won't work. We don't encode more than these, because the * clients will ignore it. * * FIXME: Be more generous? Look for CISCO + VQP attributes? */ static int contents[5][VQP_MAX_ATTRIBUTES] = { { 0, 0, 0, 0, 0, 0 }, { 0x0c01, 0x0c02, 0x0c03, 0x0c04, 0x0c07, 0x0c05 }, /* Join request */ { 0x0c03, 0x0c08, 0, 0, 0, 0 }, /* Join Response */ { 0x0c01, 0x0c02, 0x0c03, 0x0c04, 0x0c07, 0x0c08 }, /* Reconfirm */ { 0x0c03, 0x0c08, 0, 0, 0, 0 } }; int vqp_encode(RADIUS_PACKET *packet, RADIUS_PACKET *original) { int i, code, length; VALUE_PAIR *vp; uint8_t *ptr; VALUE_PAIR *vps[VQP_MAX_ATTRIBUTES]; if (!packet) { fr_strerror_printf("Failed encoding VQP"); return -1; } if (packet->data) return 0; vp = pairfind(packet->vps, PW_VQP_PACKET_TYPE); if (!vp) { fr_strerror_printf("Failed to find VQP-Packet-Type in response packet"); return -1; } code = vp->lvalue; if ((code < 1) || (code > 4)) { fr_strerror_printf("Invalid value %d for VQP-Packet-Type", code); return -1; } length = VQP_HDR_LEN; memset(vps, 0, sizeof(vps)); vp = pairfind(packet->vps, PW_VQP_ERROR_CODE); /* * FIXME: Map attributes from calling-station-Id, etc. * * Maybe do this via rlm_vqp? That's probably the * best place to add the code... */ /* * No error: encode attributes. */ if (!vp) for (i = 0; i < VQP_MAX_ATTRIBUTES; i++) { if (!contents[code][i]) break; vps[i] = pairfind(packet->vps, contents[code][i] | 0x2000); /* * FIXME: Print the name... */ if (!vps[i]) { fr_strerror_printf("Failed to find VQP attribute %02x", contents[code][i]); return -1; } length += 6; length += vps[i]->length; } packet->data = malloc(length); if (!packet->data) { fr_strerror_printf("No memory"); return -1; } packet->data_len = length; ptr = packet->data; ptr[0] = VQP_VERSION; ptr[1] = code; if (!vp) { ptr[2] = 0; } else { ptr[2] = vp->lvalue & 0xff; return 0; } /* * The number of attributes is hard-coded. */ if ((code == 1) || (code == 3)) { uint32_t sequence; ptr[3] = VQP_MAX_ATTRIBUTES; sequence = htonl(packet->id); memcpy(ptr + 4, &sequence, 4); } else { if (!original) { fr_strerror_printf("Cannot send VQP response without request"); return -1; } /* * Packet Sequence Number */ memcpy(ptr + 4, original->data + 4, 4); ptr[3] = 2; } ptr += 8; /* * Encode the VP's. */ for (i = 0; i < VQP_MAX_ATTRIBUTES; i++) { if (!vps[i]) break; if ((ptr - packet->data) >= packet->data_len) break; vp = vps[i]; debug_pair(vp); /* * Type. Note that we look at only the lower 8 * bits, as the upper 8 bits have been hacked. * See also dictionary.vqp */ ptr[0] = 0; ptr[1] = 0; ptr[2] = 0x0c; ptr[3] = vp->attribute & 0xff; /* Length */ ptr[4] = 0; ptr[5] = vp->length & 0xff; ptr += 6; /* Data */ switch (vp->type) { case PW_TYPE_IPADDR: memcpy(ptr, &vp->vp_ipaddr, 4); break; default: case PW_TYPE_OCTETS: case PW_TYPE_STRING: memcpy(ptr, vp->vp_octets, vp->length); break; } ptr += vp->length; } return 0; } #endif freeradius-server/src/main/000077500000000000000000000000001257552170400162365ustar00rootroot00000000000000freeradius-server/src/main/.gitignore000066400000000000000000000001431257552170400202240ustar00rootroot00000000000000Makefile checkrad.pl radclient radiusd radlast radsniff radtest radwho radmin radconf2xml dhclient freeradius-server/src/main/Makefile.in000066400000000000000000000157561257552170400203210ustar00rootroot00000000000000# # $Id$ # include ../../Make.inc SERVER_SRCS = acct.c auth.c client.c conffile.c crypt.c exec.c files.c \ listen.c log.c mainconfig.c modules.c modcall.c \ radiusd.c stats.c soh.c \ session.c threads.c util.c valuepair.c version.c \ xlat.c event.c realms.c evaluate.c vmps.c detail.c SERVER_OBJS += $(SERVER_SRCS:.c=.lo) INCLUDES = ../include/autoconf.h ../include/conf.h \ ../include/libradius.h ../include/radius.h \ ../include/radiusd.h ../include/ident.h ../include/stats.h CFLAGS += -I$(top_builddir)/src CFLAGS += -DHOSTINFO=\"${HOSTINFO}\" CFLAGS += -DRADIUSD_VERSION=\"${RADIUSD_VERSION}\" CFLAGS += -DRADIUSD_VERSION_STRING=\"${RADIUSD_VERSION_STRING}\" ifdef RADIUSD_VERSION_COMMIT CFLAGS += -DRADIUSD_VERSION_COMMIT=\"${RADIUSD_VERSION_COMMIT}\" endif CFLAGS += $(SNMP_INCLUDE) VFLAGS = -DRADIUSD_MAJOR_VERSION=$(RADIUSD_MAJOR_VERSION) VFLAGS += -DRADIUSD_MINOR_VERSION=$(RADIUSD_MINOR_VERSION) VFLAGS += -DRADIUSD_INCRM_VERSION=$(RADIUSD_INCRM_VERSION) MODULE_LIBS = $(STATIC_MODULES) BINARIES = radiusd$(EXEEXT) radwho$(EXEEXT) radclient$(EXEEXT) radmin$(EXEEXT) radconf2xml$(EXEEXT) # # The RADIUS sniffer # PCAP_LIBS = @PCAP_LIBS@ ifneq ($(PCAP_LIBS),) BINARIES += radsniff$(EXEEXT) endif # # Not using shared libraries, add in ALL known static modules # at build time. # ifneq ($(USE_SHARED_LIBS),yes) # # For static linking... # LINK_MODE = -static -all-static SUB_MODULES += rlm_eap_md5 rlm_eap_leap rlm_eap_tls rlm_eap_ttls rlm_eap_sim SUB_MODULES += rlm_eap_peap rlm_eap_mschapv2 rlm_eap_gtc rlm_eap_ikev2 SUB_MODULES += rlm_sql_db2 rlm_sql_iodbc rlm_sql_mysql SUB_MODULES += rlm_sql_oracle rlm_sql_postgresql rlm_sql_sybase rlm_sql_unixodbc LIBS += $(shell test -f ../modules/rlm_eap/libeap/$(LIBPREFIX)freeradius-eap.la && echo ../modules/rlm_eap/libeap/$(LIBPREFIX)freeradius-eap.la) MODULE_LIBS += $(shell for x in $(MODULES);do test -f ../modules/$$x/$$x.la && echo -dlpreopen ../modules/$$x/$$x.la;done) MODULE_LIBS += $(shell for x in $(SUB_MODULES);do test -f ../modules/*/types/$$x/$$x.la && echo -dlpreopen ../modules/*/types/$$x/$$x.la;done) MODULE_LIBS += $(shell for x in $(SUB_MODULES);do test -f ../modules/*/drivers/$$x/$$x.la && echo -dlpreopen ../modules/*/drivers/$$x/$$x.la;done) MODULE_OBJS += $(shell for x in $(MODULES);do test -f ../modules/$$x/$$x.la && echo ../modules/$$x/$$x.la;done) MODULE_OBJS += $(shell for x in $(SUB_MODULES);do test -f ../modules/*/types/$$x/$$x.la && echo ../modules/*/types/$$x/$$x.la;done) MODULE_OBJS += $(shell for x in $(SUB_MODULES);do test -f ../modules/*/drivers/$$x/$$x.la && echo ../modules/*/drivers/$$x/$$x.la;done) endif .PHONY: all clean install reconfig all: $(BINARIES) $(SERVER_OBJS): $(INCLUDES) radiusd$(EXEEXT): $(SERVER_OBJS) $(MODULE_OBJS) $(LIBRADIUS) $(LIBTOOL) --mode=link --tag=CC $(CC) -export-dynamic -dlopen self \ $(LDFLAGS) $(LINK_MODE) -o $@ $(SERVER_OBJS) \ $(MODULE_LIBS) $(LIBRADIUS) $(LIBS) $(SNMP_LIBS) \ $(LCRYPT) $(PTHREADLIB) $(LIBLTDL) radiusd.lo: radiusd.c ../include/modules.h ../include/modcall.h ../include/modpriv.h $(LIBTOOL) --mode=compile --tag=CC $(CC) $(CFLAGS) -c radiusd.c %.lo: %.c $(LIBTOOL) --mode=compile --tag=CC $(CC) $(CFLAGS) -c $< acct.lo: acct.c ../include/modules.h $(LIBTOOL) --mode=compile --tag=CC $(CC) $(CFLAGS) -c acct.c auth.lo: auth.c ../include/modules.h $(LIBTOOL) --mode=compile --tag=CC $(CC) $(CFLAGS) -c auth.c client.lo: client.c ../include/conffile.h $(LIBTOOL) --mode=compile --tag=CC $(CC) $(CFLAGS) -c client.c conffile.lo: conffile.c ../include/conffile.h ../include/modules.h $(LIBTOOL) --mode=compile --tag=CC $(CC) $(CFLAGS) -c conffile.c mainconfig.lo: mainconfig.c ../include/modules.h $(LIBTOOL) --mode=compile --tag=CC $(CC) $(CFLAGS) -c mainconfig.c modcall.lo: modcall.c $(LIBTOOL) --mode=compile --tag=CC $(CC) $(CFLAGS) -c modcall.c modules.lo: modules.c ../include/modules.h $(LIBTOOL) --mode=compile --tag=CC $(CC) $(CFLAGS) $(VFLAGS) -c modules.c session.lo: session.c ../include/modules.h $(LIBTOOL) --mode=compile --tag=CC $(CC) $(CFLAGS) -c session.c # It's #include'd for simplicity. This should be fixed... listen.lo: listen.c dhcpd.c command.c $(LIBTOOL) --mode=compile --tag=CC $(CC) $(CFLAGS) -c listen.c # # Helper programs # radclient.lo: radclient.c $(INCLUDES) $(LIBTOOL) --mode=compile --tag=CC $(CC) $(CFLAGS) -I ../modules/rlm_mschap -c radclient.c MSCHAP_OBJS := ../modules/rlm_mschap/smbdes.lo ../modules/rlm_mschap/mschap.lo radclient$(EXEEXT): radclient.lo $(MSCHAP_OBJS) $(LIBRADIUS) $(LIBTOOL) --mode=link --tag=CC $(CC) $(LDFLAGS) $(LINK_MODE) -o radclient radclient.lo $(MSCHAP_OBJS) $(LIBRADIUS) $(LIBS) # These two rules need to be specific in order to supercede the generic # "compile C file" rules. ../modules/rlm_mschap/smbdes.lo: ../modules/rlm_mschap/smbdes.c ${MAKE} -C ../modules/rlm_mschap/ ../modules/rlm_mschap/mschap.lo: ../modules/rlm_mschap/mschap.c ${MAKE} -C ../modules/rlm_mschap/ radsniff.lo: radsniff.c $(INCLUDES) ../include/radsniff.h $(LIBTOOL) --mode=compile --tag=CC $(CC) $(CFLAGS) -c radsniff.c radsniff$(EXEEXT): radsniff.lo $(LIBRADIUS) $(LIBTOOL) --mode=link --tag=CC $(CC) $(LDFLAGS) $(LINK_MODE) -o radsniff radsniff.lo $(LIBRADIUS) $(LIBS) $(PCAP_LIBS) radwho.lo: radwho.c $(INCLUDES) $(LIBTOOL) --mode=compile --tag=CC $(CC) $(CFLAGS) -c radwho.c radwho$(EXEEXT): radwho.lo util.lo log.lo conffile.lo $(LIBRADIUS) $(LIBTOOL) --mode=link --tag=CC $(CC) $(LDFLAGS) $(LINK_MODE) -o radwho radwho.lo util.lo log.lo conffile.lo $(LIBRADIUS) $(LIBS) radmin$(EXEEXT): radmin.lo $(LIBRADIUS) util.lo log.lo conffile.lo $(LIBTOOL) --mode=link --tag=CC $(CC) $(LDFLAGS) $(LINK_MODE) -o $@ $^ $(LIBREADLINE) $(LIBS) radconf2xml$(EXEEXT): radconf2xml.lo $(LIBRADIUS) util.lo log.lo conffile.lo $(LIBTOOL) --mode=link --tag=CC $(CC) $(LDFLAGS) $(LINK_MODE) -o $@ $^ $(LIBS) dhcpclient.lo: dhcpclient.c $(INCLUDES) $(LIBTOOL) --mode=compile --tag=CC $(CC) $(CFLAGS) -c dhcpclient.c # Don't install this for now. dhcpclient$(EXEEXT): dhcpclient.lo $(LIBRADIUS) $(LIBTOOL) --mode=link --tag=CC $(CC) $(LDFLAGS) $(LINK_MODE) -o dhcpclient dhcpclient.lo $(LIBRADIUS) $(LIBS) clean: rm -rf *.o *.so *.lo *~ $(BINARIES) .libs install: $(INSTALL) -d -m 755 $(R)$(sbindir) $(INSTALL) -d -m 755 $(R)$(bindir) $(LIBTOOL) --mode=install $(INSTALL) -m 755 $(INSTALLSTRIP) radiusd$(EXEEXT) $(R)$(sbindir) $(LIBTOOL) --mode=install $(INSTALL) -m 755 $(INSTALLSTRIP) radmin$(EXEEXT) $(R)$(sbindir) $(LIBTOOL) --mode=install $(INSTALL) -m 755 $(INSTALLSTRIP) radclient$(EXEEXT) $(R)$(bindir) $(LIBTOOL) --mode=install $(INSTALL) -m 755 $(INSTALLSTRIP) radwho$(EXEEXT) $(R)$(bindir) $(LIBTOOL) --mode=install $(INSTALL) -m 755 $(INSTALLSTRIP) radconf2xml$(EXEEXT) $(R)$(bindir) ifneq ($(PCAP_LIBS),) $(LIBTOOL) --mode=install $(INSTALL) -m 755 $(INSTALLSTRIP) radsniff$(EXEEXT) $(R)$(bindir) endif $(INSTALL) -m 755 checkrad.pl $(R)$(sbindir)/checkrad $(INSTALL) -m 755 radlast $(R)$(bindir) $(INSTALL) -m 755 radtest $(R)$(bindir) $(INSTALL) -m 755 radzap $(R)$(bindir) reconfig: freeradius-server/src/main/acct.c000066400000000000000000000111331257552170400173130ustar00rootroot00000000000000/* * acct.c Accounting routines. * * Version: $Id$ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2000,2006 The FreeRADIUS server project * Copyright 2000 Miquel van Smoorenburg * Copyright 2000 Alan DeKok * Copyright 2000 Alan Curry */ #include RCSID("$Id$") #include #include #ifdef WITH_ACCOUNTING /* * rad_accounting: call modules. * * The return value of this function isn't actually used right now, so * it's not entirely clear if it is returning the right things. --Pac. */ int rad_accounting(REQUEST *request) { int result = RLM_MODULE_OK; #ifdef WITH_PROXY #define WAS_PROXIED (request->proxy) #else #define WAS_PROXIED (0) #endif /* * Run the modules only once, before proxying. */ if (!WAS_PROXIED) { VALUE_PAIR *vp; int acct_type = 0; result = module_preacct(request); switch (result) { /* * The module has a number of OK return codes. */ case RLM_MODULE_NOOP: case RLM_MODULE_OK: case RLM_MODULE_UPDATED: break; /* * The module handled the request, stop here. */ case RLM_MODULE_HANDLED: return result; /* * The module failed, or said the request is * invalid, therefore we stop here. */ case RLM_MODULE_FAIL: case RLM_MODULE_INVALID: case RLM_MODULE_NOTFOUND: case RLM_MODULE_REJECT: case RLM_MODULE_USERLOCK: default: return result; } /* * Do the data storage before proxying. This is to ensure * that we log the packet, even if the proxy never does. */ vp = pairfind(request->config_items, PW_ACCT_TYPE); if (vp) { acct_type = vp->vp_integer; DEBUG2(" Found Acct-Type %s", dict_valnamebyattr(PW_ACCT_TYPE, acct_type)); } result = module_accounting(acct_type, request); switch (result) { /* * In case the accounting module returns FAIL, * it's still useful to send the data to the * proxy. */ case RLM_MODULE_FAIL: case RLM_MODULE_NOOP: case RLM_MODULE_OK: case RLM_MODULE_UPDATED: break; /* * The module handled the request, don't reply. */ case RLM_MODULE_HANDLED: return result; /* * Neither proxy, nor reply to invalid requests. */ case RLM_MODULE_INVALID: case RLM_MODULE_NOTFOUND: case RLM_MODULE_REJECT: case RLM_MODULE_USERLOCK: default: return result; } /* * Maybe one of the preacct modules has decided * that a proxy should be used. */ if ((vp = pairfind(request->config_items, PW_PROXY_TO_REALM))) { REALM *realm; /* * Check whether Proxy-To-Realm is * a LOCAL realm. */ realm = realm_find2(vp->vp_strvalue); if (realm && !realm->acct_pool) { DEBUG("rad_accounting: Cancelling proxy to realm %s, as it is a LOCAL realm.", realm->name); pairdelete(&request->config_items, PW_PROXY_TO_REALM); } else { /* * Don't reply to the NAS now because * we have to send the proxied packet * before that. */ return result; } } } /* * We get here IF we're not proxying, OR if we've * received the accounting reply from the end server, * THEN we can reply to the NAS. * If the accounting module returns NOOP, the data * storage did not succeed, so radiusd should not send * Accounting-Response. */ switch (result) { /* * Send back an ACK to the NAS. */ case RLM_MODULE_OK: case RLM_MODULE_UPDATED: request->reply->code = PW_ACCOUNTING_RESPONSE; break; /* * The module handled the request, don't reply. */ case RLM_MODULE_HANDLED: break; /* * Failed to log or to proxy the accounting data, * therefore don't reply to the NAS. */ case RLM_MODULE_FAIL: case RLM_MODULE_INVALID: case RLM_MODULE_NOOP: case RLM_MODULE_NOTFOUND: case RLM_MODULE_REJECT: case RLM_MODULE_USERLOCK: default: break; } return result; } #endif freeradius-server/src/main/auth.c000066400000000000000000000543141257552170400173520ustar00rootroot00000000000000/* * auth.c User authentication. * * Version: $Id$ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2000,2006 The FreeRADIUS server project * Copyright 2000 Miquel van Smoorenburg * Copyright 2000 Jeff Carneal */ #include RCSID("$Id$") #include #include #include #include /* * Return a short string showing the terminal server, port * and calling station ID. */ char *auth_name(char *buf, size_t buflen, REQUEST *request, int do_cli) { VALUE_PAIR *cli; VALUE_PAIR *pair; int port = 0; const char *tls = ""; if ((cli = pairfind(request->packet->vps, PW_CALLING_STATION_ID)) == NULL) do_cli = 0; if ((pair = pairfind(request->packet->vps, PW_NAS_PORT)) != NULL) port = pair->vp_integer; if (request->packet->dst_port == 0) { if (pairfind(request->packet->vps, PW_FREERADIUS_PROXIED_TO)) { tls = " via TLS tunnel"; } else { tls = " via proxy to virtual server"; } } snprintf(buf, buflen, "from client %.128s port %u%s%.128s%s", request->client->shortname, port, (do_cli ? " cli " : ""), (do_cli ? (char *)cli->vp_strvalue : ""), tls); return buf; } /* * Make sure user/pass are clean * and then log them */ static int rad_authlog(const char *msg, REQUEST *request, int goodpass) { int logit; const char *extra_msg = NULL; char clean_password[1024]; char clean_username[1024]; char buf[1024]; char extra[1024]; VALUE_PAIR *username = NULL; if (!request->root->log_auth) { return 0; } /* * Get the correct username based on the configured value */ if (log_stripped_names == 0) { username = pairfind(request->packet->vps, PW_USER_NAME); } else { username = request->username; } /* * Clean up the username */ if (username == NULL) { strcpy(clean_username, ""); } else { fr_print_string((char *)username->vp_strvalue, username->length, clean_username, sizeof(clean_username)); } /* * Clean up the password */ if (request->root->log_auth_badpass || request->root->log_auth_goodpass) { if (!request->password) { VALUE_PAIR *auth_type; auth_type = pairfind(request->config_items, PW_AUTH_TYPE); if (auth_type) { snprintf(clean_password, sizeof(clean_password), "", dict_valnamebyattr(PW_AUTH_TYPE, auth_type->vp_integer)); } else { strcpy(clean_password, ""); } } else if (pairfind(request->packet->vps, PW_CHAP_PASSWORD)) { strcpy(clean_password, ""); } else { fr_print_string((char *)request->password->vp_strvalue, request->password->length, clean_password, sizeof(clean_password)); } } if (goodpass) { logit = request->root->log_auth_goodpass; extra_msg = request->root->auth_goodpass_msg; } else { logit = request->root->log_auth_badpass; extra_msg = request->root->auth_badpass_msg; } if (extra_msg) { extra[0] = ' '; radius_xlat(extra + 1, sizeof(extra) - 1, extra_msg, request, NULL); } else { *extra = '\0'; } radlog_request(L_AUTH, 0, request, "%s: [%s%s%s] (%s)%s", msg, clean_username, logit ? "/" : "", logit ? clean_password : "", auth_name(buf, sizeof(buf), request, 1), extra); return 0; } /* * Check password. * * Returns: 0 OK * -1 Password fail * -2 Rejected (Auth-Type = Reject, send Port-Message back) * 1 End check & return, don't reply * * NOTE: NOT the same as the RLM_ values ! */ static int rad_check_password(REQUEST *request) { VALUE_PAIR *auth_type_pair; VALUE_PAIR *cur_config_item; VALUE_PAIR *password_pair; VALUE_PAIR *auth_item; uint8_t my_chap[MAX_STRING_LEN]; int auth_type = -1; int result; int auth_type_count = 0; result = 0; /* * Look for matching check items. We skip the whole lot * if the authentication type is PW_AUTHTYPE_ACCEPT or * PW_AUTHTYPE_REJECT. */ cur_config_item = request->config_items; while(((auth_type_pair = pairfind(cur_config_item, PW_AUTH_TYPE))) != NULL) { auth_type = auth_type_pair->vp_integer; auth_type_count++; RDEBUG2("Found Auth-Type = %s", dict_valnamebyattr(PW_AUTH_TYPE, auth_type_pair->vp_integer)); cur_config_item = auth_type_pair->next; if (auth_type == PW_AUTHTYPE_REJECT) { RDEBUG2("Auth-Type = Reject, rejecting user"); return -2; } } if (( auth_type_count > 1) && (debug_flag)) { radlog_request(L_ERR, 0, request, "Warning: Found %d auth-types on request for user '%s'", auth_type_count, request->username->vp_strvalue); } /* * This means we have a proxy reply or an accept * and it wasn't rejected in the above loop. So * that means it is accepted and we do no further * authentication */ if ((auth_type == PW_AUTHTYPE_ACCEPT) #ifdef WITH_PROXY || (request->proxy) #endif ) { RDEBUG2("Auth-Type = Accept, accepting the user"); return 0; } password_pair = pairfind(request->config_items, PW_USER_PASSWORD); if (password_pair && pairfind(request->config_items, PW_CLEARTEXT_PASSWORD)) { pairdelete(&request->config_items, PW_USER_PASSWORD); password_pair = NULL; } if (password_pair) { DICT_ATTR *da; RDEBUG("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"); RDEBUG("!!! Replacing User-Password in config items with Cleartext-Password. !!!"); RDEBUG("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"); RDEBUG("!!! Please update your configuration so that the \"known good\" !!!"); RDEBUG("!!! clear text password is in Cleartext-Password, and not in User-Password. !!!"); RDEBUG("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"); password_pair->attribute = PW_CLEARTEXT_PASSWORD; da = dict_attrbyvalue(PW_CLEARTEXT_PASSWORD); if (!da) { radlog_request(L_ERR, 0, request, "FATAL: You broke the dictionaries. Please use the default dictionaries!"); _exit(1); } password_pair->name = da->name; } /* * Find the "known good" password. * * FIXME: We should get rid of these hacks, and replace * them with a module. */ if ((password_pair = pairfind(request->config_items, PW_CRYPT_PASSWORD)) != NULL) { /* * Re-write Auth-Type, but ONLY if it isn't already * set. */ if (auth_type == -1) auth_type = PW_AUTHTYPE_CRYPT; } else { password_pair = pairfind(request->config_items, PW_CLEARTEXT_PASSWORD); } if (auth_type < 0) { if (password_pair) { auth_type = PW_AUTHTYPE_LOCAL; } else { /* * The admin hasn't told us how to * authenticate the user, so we reject them! * * This is fail-safe. */ RDEBUG2("ERROR: No authenticate method (Auth-Type) found for the request: Rejecting the user"); return -2; } } switch(auth_type) { case PW_AUTHTYPE_CRYPT: RDEBUG2("WARNING: Please update your configuration, and remove 'Auth-Type = Crypt'"); RDEBUG2("WARNING: Use the PAP module instead."); /* * Find the password sent by the user. It * SHOULD be there, if it's not * authentication fails. */ auth_item = request->password; if (auth_item == NULL) { RDEBUG2("No User-Password or CHAP-Password attribute in the request"); return -1; } if (password_pair == NULL) { RDEBUG2("No Crypt-Password configured for the user"); rad_authlog("Login incorrect " "(No Crypt-Password configured for the user)", request, 0); return -1; } switch (fr_crypt_check((char *)auth_item->vp_strvalue, (char *)password_pair->vp_strvalue)) { case -1: rad_authlog("Login incorrect " "(system failed to supply an encrypted password for comparison)", request, 0); /* FALL-THROUGH */ case 1: return -1; } break; case PW_AUTHTYPE_LOCAL: RDEBUG2("WARNING: Please update your configuration, and remove 'Auth-Type = Local'"); RDEBUG2("WARNING: Use the PAP or CHAP modules instead."); /* * Find the password sent by the user. It * SHOULD be there, if it's not * authentication fails. */ auth_item = request->password; if (!auth_item) auth_item = pairfind(request->packet->vps, PW_CHAP_PASSWORD); if (!auth_item) { RDEBUG2("No User-Password or CHAP-Password attribute in the request."); RDEBUG2("Cannot perform authentication."); return -1; } /* * Plain text password. */ if (password_pair == NULL) { RDEBUG2("No \"known good\" password was configured for the user."); RDEBUG2("As a result, we cannot authenticate the user."); rad_authlog("Login incorrect " "(No password configured for the user)", request, 0); return -1; } /* * Local password is just plain text. */ if (auth_item->attribute == PW_USER_PASSWORD) { if (strcmp((char *)password_pair->vp_strvalue, (char *)auth_item->vp_strvalue) != 0) { RDEBUG2("User-Password in the request does NOT match \"known good\" password."); return -1; } RDEBUG2("User-Password in the request is correct."); break; } else if (auth_item->attribute != PW_CHAP_PASSWORD) { RDEBUG2("The user did not supply a User-Password or a CHAP-Password attribute"); rad_authlog("Login incorrect " "(no User-Password or CHAP-Password attribute)", request, 0); return -1; } rad_chap_encode(request->packet, my_chap, auth_item->vp_octets[0], password_pair); /* * Compare them */ if (memcmp(my_chap + 1, auth_item->vp_strvalue + 1, CHAP_VALUE_LENGTH) != 0) { RDEBUG2("CHAP-Password is incorrect."); return -1; } RDEBUG2("CHAP-Password is correct."); break; default: /* * See if there is a module that handles * this type, and turn the RLM_ return * status into the values as defined at * the top of this function. */ result = module_authenticate(auth_type, request); switch (result) { /* * An authentication module FAIL * return code, or any return code that * is not expected from authentication, * is the same as an explicit REJECT! */ case RLM_MODULE_FAIL: case RLM_MODULE_INVALID: case RLM_MODULE_NOOP: case RLM_MODULE_NOTFOUND: case RLM_MODULE_REJECT: case RLM_MODULE_UPDATED: case RLM_MODULE_USERLOCK: default: result = -1; break; case RLM_MODULE_OK: result = 0; break; case RLM_MODULE_HANDLED: result = 1; break; } break; } return result; } /* * Post-authentication step processes the response before it is * sent to the NAS. It can receive both Access-Accept and Access-Reject * replies. */ int rad_postauth(REQUEST *request) { int result; int postauth_type = 0; VALUE_PAIR *vp; /* * Do post-authentication calls. ignoring the return code. */ vp = pairfind(request->config_items, PW_POST_AUTH_TYPE); if (vp) { RDEBUG2("Using Post-Auth-Type %s", dict_valnamebyattr(PW_POST_AUTH_TYPE, vp->vp_integer)); postauth_type = vp->vp_integer; } result = module_post_auth(postauth_type, request); switch (result) { /* * The module failed, or said to reject the user: Do so. */ case RLM_MODULE_FAIL: case RLM_MODULE_INVALID: case RLM_MODULE_REJECT: case RLM_MODULE_USERLOCK: default: request->reply->code = PW_AUTHENTICATION_REJECT; result = RLM_MODULE_REJECT; break; /* * The module handled the request, cancel the reply. */ case RLM_MODULE_HANDLED: /* FIXME */ break; /* * The module had a number of OK return codes. */ case RLM_MODULE_NOOP: case RLM_MODULE_NOTFOUND: case RLM_MODULE_OK: case RLM_MODULE_UPDATED: result = RLM_MODULE_OK; break; } return result; } /* * Process and reply to an authentication request * * The return value of this function isn't actually used right now, so * it's not entirely clear if it is returning the right things. --Pac. */ int rad_authenticate(REQUEST *request) { VALUE_PAIR *namepair; #ifdef WITH_SESSION_MGMT VALUE_PAIR *check_item; #endif VALUE_PAIR *auth_item = NULL; VALUE_PAIR *module_msg; VALUE_PAIR *tmp = NULL; int result; const char *password; char autz_retry = 0; int autz_type = 0; password = ""; #ifdef WITH_PROXY /* * If this request got proxied to another server, we need * to check whether it authenticated the request or not. */ if (request->proxy_reply) { switch (request->proxy_reply->code) { /* * Reply of ACCEPT means accept, thus set Auth-Type * accordingly. */ case PW_AUTHENTICATION_ACK: tmp = radius_paircreate(request, &request->config_items, PW_AUTH_TYPE, PW_TYPE_INTEGER); if (tmp) tmp->vp_integer = PW_AUTHTYPE_ACCEPT; #ifdef WITH_POST_PROXY_AUTHORIZE if (mainconfig.post_proxy_authorize) break; #endif goto authenticate; /* * Challenges are punted back to the NAS without any * further processing. */ case PW_ACCESS_CHALLENGE: request->reply->code = PW_ACCESS_CHALLENGE; return RLM_MODULE_OK; /* * ALL other replies mean reject. (this is fail-safe) * * Do NOT do any authorization or authentication. They * are being rejected, so we minimize the amount of work * done by the server, by rejecting them here. */ case PW_AUTHENTICATION_REJECT: rad_authlog("Login incorrect (Home Server says so)", request, 0); request->reply->code = PW_AUTHENTICATION_REJECT; return RLM_MODULE_REJECT; default: rad_authlog("Login incorrect (Home Server failed to respond)", request, 0); return RLM_MODULE_REJECT; } } #endif /* * Get the username from the request. * * Note that namepair MAY be NULL, in which case there * is no User-Name attribute in the request. */ namepair = request->username; /* * Look for, and cache, passwords. */ if (!request->password) { request->password = pairfind(request->packet->vps, PW_USER_PASSWORD); } /* * Discover which password we want to use. */ auth_item = request->password; if (auth_item) { password = (const char *)auth_item->vp_strvalue; } else { /* * Maybe there's a CHAP-Password? */ if ((auth_item = pairfind(request->packet->vps, PW_CHAP_PASSWORD)) != NULL) { password = ""; } else { /* * No password we recognize. */ password = ""; } } request->password = auth_item; /* * Get the user's authorization information from the database */ autz_redo: result = module_authorize(autz_type, request); switch (result) { case RLM_MODULE_NOOP: case RLM_MODULE_NOTFOUND: case RLM_MODULE_OK: case RLM_MODULE_UPDATED: break; case RLM_MODULE_HANDLED: return result; case RLM_MODULE_FAIL: case RLM_MODULE_INVALID: case RLM_MODULE_REJECT: case RLM_MODULE_USERLOCK: default: if ((module_msg = pairfind(request->packet->vps, PW_MODULE_FAILURE_MESSAGE)) != NULL) { char msg[MAX_STRING_LEN + 16]; snprintf(msg, sizeof(msg), "Invalid user (%s)", module_msg->vp_strvalue); rad_authlog(msg,request,0); } else { rad_authlog("Invalid user", request, 0); } request->reply->code = PW_AUTHENTICATION_REJECT; return result; } if (!autz_retry) { tmp = pairfind(request->config_items, PW_AUTZ_TYPE); if (tmp) { autz_type = tmp->vp_integer; RDEBUG2("Using Autz-Type %s", dict_valnamebyattr(PW_AUTZ_TYPE, autz_type)); autz_retry = 1; goto autz_redo; } } /* * If we haven't already proxied the packet, then check * to see if we should. Maybe one of the authorize * modules has decided that a proxy should be used. If * so, get out of here and send the packet. */ if ( #ifdef WITH_PROXY (request->proxy == NULL) && #endif ((tmp = pairfind(request->config_items, PW_PROXY_TO_REALM)) != NULL)) { REALM *realm; realm = realm_find2(tmp->vp_strvalue); /* * Don't authenticate, as the request is going to * be proxied. */ if (realm && realm->auth_pool) { return RLM_MODULE_OK; } /* * Catch users who set Proxy-To-Realm to a LOCAL * realm (sigh). But don't complain if it is * *the* LOCAL realm. */ if (realm &&(strcmp(realm->name, "LOCAL") != 0)) { RDEBUG2("WARNING: You set Proxy-To-Realm = %s, but it is a LOCAL realm! Cancelling proxy request.", realm->name); } if (!realm) { RDEBUG2("WARNING: You set Proxy-To-Realm = %s, but the realm does not exist! Cancelling invalid proxy request.", tmp->vp_strvalue); } } #ifdef WITH_PROXY authenticate: #endif /* * Perhaps there is a Stripped-User-Name now. */ namepair = request->username; /* * Validate the user */ do { result = rad_check_password(request); if (result > 0) { /* don't reply! */ return RLM_MODULE_HANDLED; } } while(0); /* * Failed to validate the user. * * We PRESUME that the code which failed will clean up * request->reply->vps, to be ONLY the reply items it * wants to send back. */ if (result < 0) { RDEBUG2("Failed to authenticate the user."); request->reply->code = PW_AUTHENTICATION_REJECT; if ((module_msg = pairfind(request->packet->vps,PW_MODULE_FAILURE_MESSAGE)) != NULL){ char msg[MAX_STRING_LEN+19]; snprintf(msg, sizeof(msg), "Login incorrect (%s)", module_msg->vp_strvalue); rad_authlog(msg, request, 0); } else { rad_authlog("Login incorrect", request, 0); } /* double check: maybe the secret is wrong? */ if ((debug_flag > 1) && (auth_item != NULL) && (auth_item->attribute == PW_USER_PASSWORD)) { uint8_t *p; p = (uint8_t *) auth_item->vp_strvalue; while (*p) { int size; size = fr_utf8_char(p); if (!size) { log_debug(" WARNING: Unprintable characters in the password. Double-check the shared secret on the server and the NAS!"); break; } p += size; } } } #ifdef WITH_SESSION_MGMT if (result >= 0 && (check_item = pairfind(request->config_items, PW_SIMULTANEOUS_USE)) != NULL) { int r, session_type = 0; char logstr[1024]; char umsg[MAX_STRING_LEN + 1]; const char *user_msg = NULL; tmp = pairfind(request->config_items, PW_SESSION_TYPE); if (tmp) { session_type = tmp->vp_integer; RDEBUG2("Using Session-Type %s", dict_valnamebyattr(PW_SESSION_TYPE, session_type)); } /* * User authenticated O.K. Now we have to check * for the Simultaneous-Use parameter. */ if (namepair && (r = module_checksimul(session_type, request, check_item->vp_integer)) != 0) { char mpp_ok = 0; if (r == 2){ /* Multilink attempt. Check if port-limit > simultaneous-use */ VALUE_PAIR *port_limit; if ((port_limit = pairfind(request->reply->vps, PW_PORT_LIMIT)) != NULL && port_limit->vp_integer > check_item->vp_integer){ RDEBUG2("MPP is OK"); mpp_ok = 1; } } if (!mpp_ok){ if (check_item->vp_integer > 1) { snprintf(umsg, sizeof(umsg), "\r\nYou are already logged in %d times - access denied\r\n\n", (int)check_item->vp_integer); user_msg = umsg; } else { user_msg = "\r\nYou are already logged in - access denied\r\n\n"; } request->reply->code = PW_AUTHENTICATION_REJECT; /* * They're trying to log in too many times. * Remove ALL reply attributes. */ pairfree(&request->reply->vps); radius_pairmake(request, &request->reply->vps, "Reply-Message", user_msg, T_OP_SET); snprintf(logstr, sizeof(logstr), "Multiple logins (max %d) %s", check_item->vp_integer, r == 2 ? "[MPP attempt]" : ""); rad_authlog(logstr, request, 1); result = -1; } } } #endif /* * Result should be >= 0 here - if not, it means the user * is rejected, so we just process post-auth and return. */ if (result < 0) { return RLM_MODULE_REJECT; } /* * Add the port number to the Framed-IP-Address if * vp->addport is set. */ if (((tmp = pairfind(request->reply->vps, PW_FRAMED_IP_ADDRESS)) != NULL) && (tmp->flags.addport != 0)) { VALUE_PAIR *vpPortId; /* * Find the NAS port ID. */ if ((vpPortId = pairfind(request->packet->vps, PW_NAS_PORT)) != NULL) { unsigned long tvalue = ntohl(tmp->vp_integer); tmp->vp_integer = htonl(tvalue + vpPortId->vp_integer); tmp->flags.addport = 0; ip_ntoa(tmp->vp_strvalue, tmp->vp_integer); } else { RDEBUG2("WARNING: No NAS-Port attribute in request. CANNOT return a Framed-IP-Address + NAS-Port.\n"); pairdelete(&request->reply->vps, PW_FRAMED_IP_ADDRESS); } } /* * Set the reply to Access-Accept, if it hasn't already * been set to something. (i.e. Access-Challenge) */ if (request->reply->code == 0) { request->reply->code = PW_AUTHENTICATION_ACK; } if ((module_msg = pairfind(request->packet->vps, PW_MODULE_SUCCESS_MESSAGE)) != NULL){ char msg[MAX_STRING_LEN+12]; snprintf(msg, sizeof(msg), "Login OK (%s)", module_msg->vp_strvalue); rad_authlog(msg, request, 1); } else { rad_authlog("Login OK", request, 1); } return result; } /* * Run a virtual server auth and postauth * */ int rad_virtual_server(REQUEST *request) { VALUE_PAIR *vp; int result; /* * We currently only handle AUTH packets here. * This could be expanded to handle other packets as well if required. */ rad_assert(request->packet->code == PW_AUTHENTICATION_REQUEST); result = rad_authenticate(request); if (request->reply->code == PW_AUTHENTICATION_REJECT) { pairdelete(&request->config_items, PW_POST_AUTH_TYPE); vp = radius_pairmake(request, &request->config_items, "Post-Auth-Type", "Reject", T_OP_SET); if (vp) rad_postauth(request); } if (request->reply->code == PW_AUTHENTICATION_ACK) { rad_postauth(request); } return result; } freeradius-server/src/main/checkrad.pl.in000066400000000000000000001133141257552170400207470ustar00rootroot00000000000000#!@PERL@ # # checkrad.pl See if a user is (still) logged in on a certain port. # # This is used by the FreeRADIUS server to check # if its idea of a user logged in on a certain port/nas # is correct if a double login is detected. # # Called as: nas_type nas_ip nas_port login session_id # # Returns: 0 = no duplicate, 1 = duplicate, >1 = error. # # Version: $Id$ # # livingston_snmp 1.2 Author: miquels@cistron.nl # cvx_snmp 1.0 Author: miquels@cistron.nl # portslave_finger 1.0 Author: miquels@cistron.nl # max40xx_finger 1.0 Author: costa@mdi.ca # ascend_snmp 1.1 Author: blaz@amis.net # computone_finger 1.2 Author: pacman@world.std.com # sub tc_tccheck 1.1 Author: alexisv@compass.com.ph # cyclades_telnet 1.2 Author: accdias@sst.com.br # patton_snmp 1.0 Author: accdias@sst.com.br # digitro_rusers 1.1 Author: accdias@sst.com.br # cyclades_snmp 1.0 Author: accdias@sst.com.br # usrhiper_snmp 1.0 Author: igor@ipass.net # juniper_e_snmp 1.1 Author: guilhermefranco@gmail.com # multitech_snmp 1.0 Author: ehonzay@willmar.com # netserver_telnet 1.0 Author: mts@interplanet.es # versanet_snmp 1.0 Author: support@versanetcomm.com # bay_finger 1.0 Author: chris@shenton.org # cisco_l2tp 1.14 Author: paul@distributel.net # mikrotik_telnet 1.1 Author: Evren Yurtesen # mikrotik_snmp 1.0 Author: Evren Yurtesen # redback_telnet Author: Eduardo Roldan # # Config: $debug is the file you want to put debug messages in # $snmpget is the location of your ``snmpget'' program # $snmpwalk is the location of your ``snmpwalk'' program # $snmp_timeout is the timeout for snmp queries # $snmp_retries is the number of retries for timed out snmp queries # $snmp_version is the version of to use for snmp queries [1,2c,3] # $rusers is the location of your ``rusers'' program # $naspass is the location of your NAS admin password file # $prefix = "@prefix@"; $localstatedir = "@localstatedir@"; $logdir = "@logdir@"; $sysconfdir = "@sysconfdir@"; $raddbdir = "@raddbdir@"; $debug = ""; #$debug = "$logdir/checkrad.log"; $snmpget = "@SNMPGET@"; $snmpwalk = "@SNMPWALK@"; $snmp_timeout = 5; $snmp_retries = 1; $snmp_version = "2c"; $rusers = "@RUSERS@"; $naspass = "$raddbdir/naspasswd"; # Community string. Change this if yours isn't "public". $cmmty_string = "public"; # path to finger command $finger = "/usr/bin/finger"; # Extremely slow way of converting port descriptions to actual indexes $portisdescr = 0; # Realm used by Cisco sub $realm = ''; # # USR-Hiper: $hiper_density is the reported port density (default 256 # but 24 makes more sense) # $hiper_density = 256; # # Try to load Net::Telnet, SNMP_Session etc. # Do not complain if we cannot find it. # Prefer a locally installed copy. # BEGIN { unshift @INC, "/usr/local/lib/site_perl"; eval "use Net::Telnet 3.00;"; $::HAVE_NET_TELNET = ($@ eq ""); eval "use SNMP_Session;"; if ($@ eq "") { eval "use BER;"; $::HAVE_SNMP_SESSION = ($@ eq ""); eval "use Socket;"; } }; # # Get password from /etc/raddb/naspasswd file. # Returns (login, password). # sub naspasswd { my ($terminalserver, $emptyok) = @_; my ($login, $password); my ($ts, $log, $pass); unless (open(NFD, $naspass)) { if (!$emptyok) { print LOG "checkrad: naspasswd file not found; " . "possible match for $ARGV[3]\n" if ($debug); print STDERR "checkrad: naspasswd file not found; " . "possible match for $ARGV[3]\n"; } return (); } while () { chop; next if (m/^(#|$|[\t ]+$)/); ($ts, $log, $pass) = split(/\s+/, $_, 3); if ($ts eq $terminalserver) { $login = $log; $password = $pass; last; } } close NFD; if ($password eq "" && !$emptyok) { print LOG "checkrad: password for $ARGV[1] is null; " . "possible match for $ARGV[3] on " . "port $ARGV[2]\n" if ($debug); print STDERR "checkrad: password for $ARGV[1] is null; " . "possible match for $ARGV[3] on port $ARGV[2]\n"; } ($login, $password); } # # See if Net::Telnet is there. # sub check_net_telnet { if (!$::HAVE_NET_TELNET) { print LOG " checkrad: Net::Telnet 3.00+ CPAN module not installed\n" if ($debug); print STDERR "checkrad: Net::Telnet 3.00+ CPAN module not installed\n"; return 0; } 1; } # # Do snmpwalk by calling snmpwalk. # sub snmpwalk_prog { my ($host, $community, $oid) = @_; local $_; print LOG "snpwalk: $snmpwalk -r $snmp_retries -t $snmp_timeout -v$snmp_version -c '$community' $host $oid\n"; $_ = `$snmpwalk -r $snmp_retries -t $snmp_timeout -v$snmp_version -c '$community' $host $oid`; return $_; } # # Do snmpwalk. # sub snmpwalk { my $ret; if (-x $snmpwalk) { $ret = snmpwalk_prog(@_); } else { $e = "$snmpwalk not found!"; print LOG "$e\n" if ($debug); print STDERR "checkrad: $e\n"; $ret = ""; } $ret; } # # Do snmpget by calling snmpget. # sub snmpget_prog { my ($host, $community, $oid) = @_; my ($ret); local $_; print LOG "snmpget: $snmpget -r $snmp_retries -t $snmp_timeout -v$snmp_version -c '$community' $host $oid\n"; $_ = `$snmpget -r $snmp_retries -t $snmp_timeout -v$snmp_version -c '$community' $host $oid`; if (/^.*(\s|\")([0-9A-Za-z]{8})(\s|\"|$).*$/) { # Session ID format. $ret = $2; } elsif (/^.*=.*"(.*)"/) { # oid = "...." junk format. $ret = $1; } elsif (/^.*=\s*(?:.*:\s*)?(\S+)/) { # oid = string format $ret = $1; } # Strip trailing junk if any. $ret =~ s/\s*Hex:.*$//; $ret; } # # Do snmpget by using SNMP_Session. # Coded by Jerry Workman # sub snmpget_session { my ($host, $community, $OID) = @_; my ($ret); local $_; my (@enoid, $var,$response, $bindings, $binding, $value); my ($inoid, $outoid, $upoid, $oid, @retvals); $OID =~ s/^.iso.org.dod.internet.private.enterprises/.1.3.6.1.4.1/; push @enoid, encode_oid((split /\./, $OID)); srand(); my $session = SNMP_Session->open($host, $community, 161); if (!$session->get_request_response(@enoid)) { $e = "No SNMP answer from $ARGV[0]."; print LOG "$e\n" if ($debug); print STDERR "checkrad: $e\n"; return ""; } $response = $session->pdu_buffer; ($bindings) = $session->decode_get_response ($response); $session->close (); while ($bindings) { ($binding,$bindings) = decode_sequence ($bindings); ($oid,$value) = decode_by_template ($binding, "%O%@"); my $tempo = pretty_print($value); $tempo=~s/\t/ /g; $tempo=~s/\n/ /g; $tempo=~s/^\s+//; $tempo=~s/\s+$//; push @retvals, $tempo; } $retvals[0]; } # # Do snmpget # sub snmpget { my $ret; if ($::HAVE_SNMP_SESSION) { $ret = snmpget_session(@_); } elsif (-x $snmpget) { $ret = snmpget_prog(@_); } else { $e = "Neither SNMP_Session module or $snmpget found!"; print LOG "$e\n" if ($debug); print STDERR "checkrad: $e\n"; $ret = ""; } $ret; } # # Get ifindex from description # sub ifindex { my $port = shift; # If its not an integer, portisdescr lies! return $port unless $portisdescr || $port !~ /^[0-9]*$/; $_ = snmpwalk($ARGV[1], "$cmmty_string", ".1.3.6.1.2.1.2.2.1.2"); foreach (split /\n/){ if(/\.([0-9]+)\s*=.*$port"?$/){ print LOG " port descr $port is at SNMP ifIndex $1\n" if ($debug); return $1; } } return $port; } # # Strip domains, prefixes and suffixes from username # # Known prefixes: (P)PP, (S)LIP e (C)SLIP # Known suffixes: .ppp, .slip e .cslip # # Author: Antonio Dias of SST Internet # sub strip_username { my ($user) = @_; # # Trim white spaces. # $user =~ s/^\s*(.*?)\s*$/$1/; # # Strip out domains, prefix and suffixes # $user =~ s/\@(.)*$//; $user =~ s/^[PSC]//; $user =~ s/\.(ppp|slip|cslip)$//; $user; } # # Check whether a session is current on any device which implements the standard IEEE 802.1X MIB # # Note: Vendors use different formats for the session ID, and it often doesn't map # between Acct-Session-ID so can't be used to identify and 802.1X session (we ignore it). # # If a session matching the username is found on the port specified, and the # session is still active then thats good enough... # # Author: Arran Cudbard-Bell # $ieeedot1m = '.iso.0.8802.1.1'; sub dot1x_snmp { $ifIndex = ifindex($ARGV[2]); # User matches and not terminated yet? if( snmpget($ARGV[1], "$cmmty_string", "$ieeedot1m.1.1.2.4.1.9.$ifIndex") eq $ARGV[3] && snmpget($ARGV[1], "$cmmty_string", "$ieeedot1m.1.1.2.4.1.8.$ifIndex") eq '999' ){ print LOG " found user $ARGV[3] at port $ARGV[2] ($ifIndex)" if $debug; return 1; } 0; } # # See if the user is logged in using the Livingston MIB. # We don't check the username but the session ID. # $lvm = '.iso.org.dod.internet.private.enterprises.307'; sub livingston_snmp { # # We don't know at which ifIndex S0 is, and # there might be a hole at S23, or at S30+S31. # So we figure out dynamically which offset to use. # # If the port < S23, probe ifIndex 5. # If the port < S30, probe IfIndex 23. # Otherwise probe ifIndex 32. # my $ifIndex; my $test_index; if ($ARGV[2] < 23) { $test_index = 5; } elsif ($ARGV[2] < 30) { $test_index = 23; } else { $test_index = 32; } $_ = snmpget($ARGV[1], "$cmmty_string", "$lvm.3.2.1.1.1.2.$test_index"); /S([0-9]+)/; $xport = $1 + 0; $ifIndex = $ARGV[2] + ($test_index - $xport); print LOG " port S$ARGV[2] at SNMP ifIndex $ifIndex\n" if ($debug); # # Now get the session id from the terminal server. # $sessid = snmpget($ARGV[1], "$cmmty_string", "$lvm.3.2.1.1.1.5.$ifIndex"); print LOG " session id at port S$ARGV[2]: $sessid\n" if ($debug); ($sessid eq $ARGV[4]) ? 1 : 0; } # # See if the user is logged in using the Aptis MIB. # We don't check the username but the session ID. # # sessionStatusActiveName $apm1 = '.iso.org.dod.internet.private.enterprises.2637.2.2.102.1.12'; # sessionStatusActiveStopTime $apm2 = '.iso.org.dod.internet.private.enterprises.2637.2.2.102.1.20'; sub cvx_snmp { # Remove unique identifier, then take remainder of the # session-id as a hex number, convert that to decimal. my $sessid = $ARGV[4]; $sessid =~ s/^.*://; $sessid =~ s/^0*//; $sessid = "0" if ($sessid eq ''); # # Now get the login from the terminal server. # Blech - the SNMP table is called 'sessionStatusActiveTable, # but it sometimes lists inactive sessions too. # However an active session doesn't have a Stop time, # so we can differentiate that way. # my $login = snmpget($ARGV[1], "$cmmty_string", "$apm1." . hex($sessid)); my $stopt = snmpget($ARGV[1], "$cmmty_string", "$apm2." . hex($sessid)); $login = "--" if ($stopt > 0); print LOG " login with session-id $ARGV[4]: $login\n" if ($debug); (strip_username($login) eq strip_username($ARGV[3])) ? 1 : 0; } # # See if the user is logged in using the Cisco MIB # $csm = '.iso.org.dod.internet.private.enterprises.9'; sub cisco_snmp { # Look up community string in naspasswd file. my ($login, $pass) = naspasswd($ARGV[1], 1); if ($login eq '') { $pass = $cmmty_string; } elsif ($login ne 'SNMP') { if ($debug) { print LOG " Error: Need SNMP community string for $ARGV[1]\n"; } return 2; } my $port = $ARGV[2]; my $sess_id = hex($ARGV[4]); if ($port < 20000) { # # The AS5350 doesn't support polling the session ID, # so we do it based on nas-port-id. This only works # for analog sessions where port < 20000. # Yes, this means that simultaneous-use on the as5350 # doesn't work for ISDN users. # $login = snmpget($ARGV[1], $pass, "$csm.2.9.2.1.18.$port"); print LOG " user at port S$port: $login\n" if ($debug); } else { $login = snmpget($ARGV[1], $pass, "$csm.9.150.1.1.3.1.2.$sess_id"); print LOG " user with session id $ARGV[4] ($sess_id): " . "$login\n" if ($debug); } # ($login eq $ARGV[3]) ? 1 : 0; if($login eq $ARGV[3]) { return 1; }else{ $out=snmpwalk($ARGV[1],$pass,".iso.org.dod.internet.private.enterprises.9.10.19.1.3.1.1.3"); if($out=~/\"$ARGV[3]\"/){ return 1; }else{ return 0; } } } # # Check the subscriber name on a Juniper JunosE E-Series BRAS (ERX, E120, E320). Requires "radius acct-session-id-format decimal" configuration in the BRAS. # # Author: Guilherme Franco # sub juniper_e_snmp { #receives acct_session my $temp = $ARGV[4]; #removes the leading 0s my $clean_temp = int $temp; $out=snmpget($ARGV[1], $cmmty_string, ".1.3.6.1.4.1.4874.2.2.20.1.8.4.1.2.$clean_temp"); if($out=~/\"$ARGV[3]\"/){ return 1; }else{ return 0; } } # # Check a MultiTech CommPlete Server ( CC9600 & CC2400 ) # # Author: Eric Honzay of Bennett Office Products # $msm = '.iso.org.dod.internet.private.enterprises.995'; sub multitech_snmp { my $temp = $ARGV[2] + 1; $login = snmpget($ARGV[1], "$cmmty_string", "$msm.2.31.1.1.1.$temp"); print LOG " user at port S$ARGV[2]: $login\n" if ($debug); ($login eq $ARGV[3]) ? 1 : 0; } # # Check a Computone Powerrack via finger # # Old Author: Shiloh Costa of MDI Internet Inc. # New Author: Alan Curry # # The finger response format is version-dependent. To do this *right*, you # need to know exactly where the port number and username are. I know that # for 1.7.2, and 3.0.4 but for others I just guess. # Oh yeah and on top of it all, the thing truncates usernames. --Pac. # # 1.7.2 and 3.0.4 both look like this: # # 0 0 000 00:56 luser pppfsm Incoming PPP, ppp00, 10.0.0.1 # # and the truncated ones look like this: # # 25 0 000 00:15 longnameluse..pppfsm Incoming PPP, ppp25, 10.0.0.26 # # Yes, the fields run together. Long Usernames Considered Harmful. # sub computone_finger { my $trunc, $ver; open(FD, "$finger \@$ARGV[1]|") or return 2; ; # the [hostname] line is definitely uninteresting $trunc = substr($ARGV[3], 0, 12); $ver = ""; while() { if(/cnx kernel release ([^ ,]+)[, ]/) { $ver = $1; next; } # Check for known versions if ($ver eq '1.7.2' || $ver eq '3.0.4') { if (/^\Q$ARGV[2]\E\s+\S+\s+\S+\s+\S+\s+\Q$trunc\E(\s+|\.\.)/) { close FD; return 1; } next; } # All others. if (/^\s*\Q$ARGV[2]\E\s+.*\s+\Q$trunc\E\s+/) { close FD; return 1; } } close FD; return 0; } # # Check an Ascend Max4000 or similar model via finger # # Note: Not all software revisions support finger # You may also need to enable the finger option. # # Author: Shiloh Costa of MDI Internet Inc. # sub max40xx_finger { open(FD, "$finger $ARGV[3]\@$ARGV[1]|"); while() { $line = $_; if( $line =~ /Session/ ){ next; } if( $line =~ /$ARGV[4]/ ){ return 1; # user is online } } close FD; return 0; # user is offline } # # Check an Ascend Max4000 or similar model via SNMP # # Author: Blaz Zupan of Medinet # $asm = '.iso.org.dod.internet.private.enterprises.529'; sub ascend_snmp { my $sess_id; my $l1, $l2; $l1 = ''; $l2 = ''; # # If it looks like hex, only try it as hex, # otherwise try it as both decimal and hex. # $sess_id = $ARGV[4]; if ($sess_id !~ /^0/ && $sess_id !~ /[a-f]/i) { $l1 = snmpget($ARGV[1], "$cmmty_string", "$asm.12.3.1.4.$sess_id"); } if (!$l1){ $sess_id = hex $ARGV[4]; $l2 = snmpget($ARGV[1], "$cmmty_string", "$asm.12.3.1.4.$sess_id"); } print LOG " user at port S$ARGV[2]: $l1 (dec)\n" if ($debug && $l1); print LOG " user at port S$ARGV[2]: $l2 (hex)\n" if ($debug && $l2); (($l1 && $l1 eq $ARGV[3]) || ($l2 && $l2 eq $ARGV[3])) ? 1 : 0; } # # See if the user is logged in using the portslave finger. # sub portslave_finger { my ($Port_seen); $Port_seen = 0; open(FD, "$finger \@$ARGV[1]|"); while() { # # Check for ^Port. If we don't see it we # wont get confused by non-portslave-finger # output too. # if (/^Port/) { $Port_seen++; next; } next if (!$Port_seen); next if (/^---/); ($port, $user) = /^.(...) (...............)/; $port =~ s/ .*//; $user =~ s/ .*//; $ulen = length($user); # # HACK: strip [PSC] from the front of the username, # and things like .ppp from the end. # $user =~ s/^[PSC]//; $user =~ s/\.(ppp|slip|cslip)$//; # # HACK: because ut_user usually has max. 8 characters # we only compare up the the length of $user if the # unstripped name had 8 chars. # $argv_user = $ARGV[3]; if ($ulen == 8) { $ulen = length($user); $argv_user = substr($ARGV[3], 0, $ulen); } if ($port == $ARGV[2]) { if ($user eq $argv_user) { print LOG " $user matches $argv_user " . "on port $port" if ($debug); close FD; return 1; } else { print LOG " $user doesn't match $argv_user " . "on port $port" if ($debug); close FD; return 0; } } } close FD; 0; } # # See if the user is already logged-in at the 3Com/USR Total Control. # (this routine by Alexis C. Villalon ). # You must have the Net::Telnet module from CPAN for this to work. # You must also have your /etc/raddb/naspasswd made up. # sub tc_tccheck { # # Localize all variables first. # my ($Port_seen, $ts, $terminalserver, $log, $login, $pass, $password); my ($telnet, $curprompt, $curline, $ok, $totlines, $ccntr); my (@curlines, @cltok, $user, $port, $ulen); return 2 unless (check_net_telnet()); $terminalserver = $ARGV[1]; $Port_seen = 0; # # Get login name and password for a certain NAS from $naspass. # ($login, $password) = naspasswd($terminalserver, 1); return 2 if ($password eq ""); # # Communicate with NAS using Net::Telnet, then issue # the command "show sessions" to see who are logged in. # Thanks to Chris Jackson for the # for the "-- Press Return for More --" workaround. # $telnet = new Net::Telnet (Timeout => 5, Prompt => '/\>/'); $telnet->open($terminalserver); $telnet->login($login, $password); $telnet->print("show sessions"); while ($curprompt ne "\>") { ($curline, $curprompt) = $telnet->waitfor (String => "-- Press Return for More --", String => "\>", Timeout => 5); $ok = $telnet->print(""); push @curlines, split(/^/m, $curline); } $telnet->close; # # Telnet closed. We got the info. Let's examine it. # $totlines = @curlines; $ccntr = 0; while($ccntr < $totlines) { # # Check for ^Port. # if ($curlines[$ccntr] =~ /^Port/) { $Port_seen++; $ccntr++; next; } # # Ignore all unnecessary lines. # if (!$Port_seen || $curlines[$ccntr] =~ /^---/ || $curlines[$ccntr] =~ /^ .*$/) { $ccntr++; next; } # # Parse the current line for the port# and username. # @cltok = split(/\s+/, $curlines[$ccntr]); $ccntr++; $port = $cltok[0]; $user = $cltok[1]; $ulen = length($user); # # HACK: strip [PSC] from the front of the username, # and things like .ppp from the end. Strip S from # the front of the port number. # $user =~ s/^[PSC]//; $user =~ s/\.(ppp|slip|cslip)$//; $port =~ s/^S//; # # HACK: because "show sessions" shows max. 15 characters # we only compare up to the length of $user if the # unstripped name had 15 chars. # $argv_user = $ARGV[3]; if ($ulen == 15) { $ulen = length($user); $argv_user = substr($ARGV[3], 0, $ulen); } if ($port == $ARGV[2]) { if ($user eq $argv_user) { print LOG " $user matches $argv_user " . "on port $port" if ($debug); return 1; } else { print LOG " $user doesn't match $argv_user " . "on port $port" if ($debug); return 0; } } } 0; } # # Check a Cyclades PathRAS via telnet # # Version: 1.2 # # Author: Antonio Dias of SST Internet # sub cyclades_telnet { # # Localize all variables first. # my ($pr, $pr_login, $pr_passwd, $pr_prompt, $endlist, @list, $port, $user); # # This variable must match PathRAS' command prompt # string as entered in menu option 6.2. # The value below matches the default command prompt. # $pr_prompt = '/Select option ==\>$/i'; # # This variable match the end of userslist. # $endlist = '/Type \/i'; # # Do we have Net::Telnet installed? # return 2 unless (check_net_telnet()); # # Get login name and password for NAS # from $naspass file. # ($pr_login, $pr_passwd) = naspasswd($ARGV[1], 1); # # Communicate with PathRAS using Net::Telnet, then access # menu option 6.8 to see who are logged in. # Based on PathRAS firmware version 1.2.3 # $pr = new Net::Telnet ( Timeout => 5, Host => $ARGV[1], ErrMode => 'return' ) || return 2; # # Force PathRAS shows its banner. # $pr->break(); # # Log on PathRAS # if ($pr->waitfor(Match => '/login : $/i') == 1) { $pr->print($pr_login); } else { print LOG " Error: sending login name to PathRAS\n" if ($debug); $pr->close; return 2; } if ($pr->waitfor(Match => '/password : $/i') == 1) { $pr->print($pr_passwd); } else { print LOG " Error: sending password to PathRAS.\n" if ($debug); $pr->close; return 2; } $pr->print(); # # Access menu option 6 "PathRAS Management" # if ($pr->waitfor(Match => $pr_prompt) == 1) { $pr->print('6'); } else { print LOG " Error: acessing menu option '6'.\n" if ($debug); $pr->close; return 2; } # # Access menu option 8 "Show Active Ports" # if ($pr->waitfor(Match => $pr_prompt) == 1) { @list = $pr->cmd(String => '8', Prompt => $endlist); } else { print LOG " Error: acessing menu option '8'.\n" if ($debug); $pr->close; return 2; } # # Since we got the info we want, let's close # the telnet session # $pr->close; # # Lets examine the userlist stored in @list # foreach(@list) { # # We are interested in active sessions only # if (/Active/i) { ($port, $user) = split; # # Strip out any prefix, suffix and # realm from $user check to see if # $ARGV[3] matches. # if(strip_username($ARGV[3]) eq strip_username($user)) { print LOG " User '$ARGV[3]' found on '$ARGV[1]:$port'.\n" if ($debug); return 1; } } } print LOG " User '$ARGV[3]' not found on '$ARGV[1]'.\n" if ($debug); 0; } # # Check a Patton 2800 via SNMP # # Version: 1.0 # # Author: Antonio Dias of SST Internet # sub patton_snmp { my($oid); #$oid = '.1.3.6.1.4.1.1768.5.100.1.40.' . hex $ARGV[4]; # Reported by "Andria Legon" # The OID below should be the correct one instead of the one above. $oid = '.1.3.6.1.4.1.1768.5.100.1.56.' . hex $ARGV[4]; # # Check if the session still active # if (snmpget($ARGV[1], "monitor", "$oid") == 0) { print LOG " Session $ARGV[4] still active on NAS " . "$ARGV[1], port $ARGV[2], for user $ARGV[3].\n" if ($debug); return 1; } 0; } # # Check a Digitro BXS via rusers # # Version: 1.1 # # Author: Antonio Dias of SST Internet # sub digitro_rusers { my ($ret); local $_; if (-e $rusers && -x $rusers) { # # Get a list of users logged in via rusers # $_ = `$rusers $ARGV[1]`; $ret = ((/$ARGV[3]/) ? 1 : 0); } else { print LOG " Error: can't execute $rusers\n" if $debug; $ret = 2; } $ret; } # # Check Cyclades PR3000 and PR4000 via SNMP # # Version: 1.0 # # Author: Antonio Dias of SST Internet # sub cyclades_snmp { my ($oid, $ret); local $_; $oid = ".1.3.6.1.4.1.2925.3.3.6.1.1.2"; $_ = snmpwalk($ARGV[1],"$cmmty_string",$oid); $ret = ((/$ARGV[3]/) ? 1 : 0); $ret; } # # 3Com/USR HiPer Arc Total Control. # This works with HiPer Arc 4.0.30 # (this routine by Igor Brezac ) # # This routine modified by Dan Halverson # to suport additional versions of Hiper Arc # $usrm = '.iso.org.dod.internet.private.enterprises.429'; sub usrhiper_snmp { my ($login,$password,$oidext); # Look up community string in naspasswd file. ($login, $password) = naspasswd($ARGV[1], 1); if ($login && $login ne 'SNMP') { if($debug) { print LOG " Error: Need SNMP community string for $ARGV[1]\n"; } return 2; } else { # If password is defined in naspasswd file, use it as community, otherwise use $cmmty_string if ($password eq '') { $password = "$cmmty_string"; } } my ($ver) = get_hiper_ver(usrm=>$usrm, target=>$ARGV[1], community=>$password); $oidext = get_oidext(ver=>$ver, tty=>$ARGV[2]); my ($login); $login = snmpget($ARGV[1], $password, "$usrm.4.10.1.1.18.$oidext"); if ($login =~ /\"/) { $login =~ /^.*\"([^"]+)\"/; $login = $1; } print LOG " user at port S$ARGV[2]: $login\n" if ($debug); ($login eq $ARGV[3]) ? 1 : 0; } # # get_hiper_ver and get_oidext by Dan Halverson # sub get_hiper_ver { my (%args) = @_; my ($ver ); $ver = snmpget ($args{'target'}, $args{'community'}, $args{'usrm'}.".4.1.14.0"); return($ver); } # # Add additional OID checks below before the else. # Else is for 4.0.30 # sub get_oidext { my (%args) = @_; my ($oid ); if ($args{'ver'} =~ /V5.1.99/) { $oid = $args{'tty'}+1257-1; } else { $oid = 1257 + 256*int(($args{'tty'}-1) / $hiper_density) + (($args{'tty'}-1) % $hiper_density); } return($oid); } # # Check USR Netserver with Telnet - based on tc_tccheck. # By "Marti" # sub usrnet_telnet { # # Localize all variables first. # my ($ts, $terminalserver, $login, $password); my ($telnet, $curprompt, $curline, $ok); my (@curlines, $user, $port); return 2 unless (check_net_telnet()); $terminalserver = $ARGV[1]; $Port_seen = 0; # # Get login name and password for a certain NAS from $naspass. # ($login, $password) = naspasswd($terminalserver, 1); return 2 if ($password eq ""); # # Communicate with Netserver using Net::Telnet, then access # list connectionsto see who are logged in. # $telnet = new Net::Telnet (Timeout => 5, Prompt => '/\>/'); $telnet->open($terminalserver); # # Log on Netserver # $telnet->login($login, $password); # # Launch list connections command $telnet->print("list connections"); while ($curprompt ne "\>") { ($curline, $curprompt) = $telnet->waitfor ( String => "\>", Timeout => 5); $ok = $telnet->print(""); push @curlines, split(/^/m, $curline); } $telnet->close; # # Telnet closed. We got the info. Let's examine it. # foreach(@curlines) { if ( /mod\:/ ) { ($port, $user, $dummy) = split; # # Strip out any prefixes and suffixes # from the username # # uncomment this if you use the standard # prefixes #$user =~ s/^[PSC]//; #$user =~ s/\.(ppp|slip|cslip)$//; # # Check to see if $user is already connected # if ($user eq $ARGV[3]) { print LOG " $user matches $ARGV[3] " . "on port $port" if ($debug); return 1; }; }; }; print LOG " $ARGV[3] not found on Netserver logged users list " if ($debug); 0; } # # Versanet's Perl Script Support: # # ___ versanet_snmp 1.0 by support@versanetcomm.com ___ July 1999 # Versanet Enterprise MIB Base: 1.3.6.1.4.1.2180 # # VN2001/2002 use slot/port number to locate modems. To use snmp get we # have to translate the original port number into a slot/port pair. # $vsm = '.iso.org.dod.internet.private.enterprises.2180'; sub versanet_snmp { print LOG "argv[2] = $ARGV[2] " if ($debug); $port = $ARGV[2]%8; $port = 8 if ($port eq 0); print LOG "port = $port " if ($debug); $slot = (($ARGV[2]-$port)/8)+1; print LOG "slot = $slot" if ($debug); $loginname = snmpget($ARGV[1], "$cmmty_string", "$vsm.27.1.1.3.$slot.$port"); # # Note: the "$cmmty_string" string above could be replaced by the public # community string defined in Versanet VN2001/VN2002. # print LOG " user at slot $slot port $port: $loginname\n" if ($debug); ($loginname eq $ARGV[3]) ? 1 : 0; } # 1999/08/24 Chris Shenton # Check Bay8000 NAS (aka: Annex) using finger. # Returns from "finger @bay" like: # Port What User Location When Idle Address # asy2 PPP bill --- 9:33am :08 192.168.1.194 # asy4 PPP hillary --- 9:36am :04 192.168.1.195 # [...] # But also returns partial-match users if you say like "finger g@bay": # Port What User Location When Idle Address # asy2 PPP gore --- 9:33am :09 192.168.1.194 # asy22 PPP gwbush --- Mon 9:19am :07 192.168.1.80 # So check exact match of username! sub bay_finger { # ARGV: 1=nas_ip, 2=nas_port, 3=login, 4=sessid open(FINGER, "$finger $ARGV[3]\@$ARGV[1]|") || return 2; # error while() { my ($Asy, $PPP, $User) = split; if( $User =~ /^$ARGV[3]$/ ){ close FINGER; print LOG "checkrad:bay_finger: ONLINE $ARGV[3]\@$ARGV[1]" if ($debug); return 1; # online } } close FINGER; print LOG "checkrad:bay_finger: offline $ARGV[3]\@$ARGV[1]" if ($debug); return 0; # offline } # # Cisco L2TP support # This is for PPP sessions coming from an L2TP tunnel from a Dial # or DSL wholesale provider # Paul Khavkine # July 19 2001 # # find_l2tp_login() walks a part of cisco vpdn tree to find out what session # and tunnel ID's are for a given Virtual-Access interface to construct # the following OID: .1.3.6.1.4.1.9.10.24.1.3.2.1.2.2.$tunID.$sessID # Then gets the username from that OID. # Make sure you set the $realm variable at the begining of the file if # needed. The new type for naslist is cisco_l2tp sub find_l2tp_login { my($host, $community, $port_num) = @_; my $l2tp_oid = '.1.3.6.1.4.1.9.10.24.1.3.2.1.2.2'; my $port_oid = '.iso.org.dod.internet.private.enterprises.9.10.51.1.2.1.1.2.2'; my $port = 'Vi' . $port_num; my $sess = new SNMP::Session(DestHost => $host, Community => $community); my $snmp_var = new SNMP::Varbind(["$port_oid"]); my $val = $sess->getnext($snmp_var); do { $sess->getnext($snmp_var); } until ($snmp_var->[$SNMP::Varbind::val_f] =~ /$port/) || (!($snmp_var->[$SNMP::Varbind::ref_f] =~ /^$port_oid\.(\d+)\.(\d+)$/)) || ($sess->{ErrorNum}); my $val1 = $snmp_var->[$SNMP::Varbind::ref_f]; if ($val1 =~ /^$port_oid/) { $result = substr($val1, length($port_oid)); $result =~ /^\.(\d+)\.(\d+)$/; $tunID = $1; $sessID = $2; } my $snmp_var1 = new SNMP::Varbind(["$l2tp_oid\.$tunID\.$sessID"]); $val = $sess->get($snmp_var1); my $login = $snmp_var1->[$SNMP::Varbind::val_f]; return $login; } sub cisco_l2tp_snmp { my $login = find_l2tp_login("$ARGV[1]", $cmmty_string, "$ARGV[2]"); print LOG " user at port S$ARGV[2]: $login\n" if ($debug); ($login eq "$ARGV[3]\@$realm") ? 1 : 0; } sub mikrotik_snmp { # Set SNMP version # MikroTik only supports version 1 $snmp_version = "1"; # Look up community string in naspasswd file. ($login, $password) = naspasswd($ARGV[1], 1); if ($login && $login ne 'SNMP') { if($debug) { print LOG "Error: Need SNMP community string for $ARGV[1]\n"; } return 2; } else { # If password is defined in naspasswd file, use it as community, # otherwise use $cmmty_string if ($password eq '') { $password = "$cmmty_string"; } } # We want interface descriptions $oid = "ifDescr"; # Mikrotik doesnt give port IDs correctly to RADIUS :( # practically this would limit us to a simple only-one user limit for # this script to work properly. @output = snmpwalk_prog($ARGV[1], $password, "$oid"); foreach $line ( @output ) { #remove newline chomp $line; #remove trailing whitespace ($line = $line) =~ s/\s+$//; if( $line =~ /<.*-$ARGV[3]>/ ) { $username_seen++; } } #lets return something if ($username_seen > 0) { return 1; } else { return 0; } } sub mikrotik_telnet { # Localize all variables first. my ($t, $login, $password); my (@fields, @output, $output, $username_seen, $user); return 2 unless (check_net_telnet()); $terminalserver = $ARGV[1]; $user = $ARGV[3]; # Get login name and password for a certain NAS from $naspass. ($login, $password) = naspasswd($terminalserver, 1); return 2 if ($password eq ""); # MikroTik routeros doesnt tell us to which port the user is connected # practically this would limit us to a simple only-one user limit for # this script to work properly. $t = new Net::Telnet (Timeout => 5, Prompt => '//\[.*@.*\] > /'); # Dont just exit when there is error $t->errmode('return'); # Telnet to terminal server $t->open($terminalserver) or return 2; #Send login and password etc. $t->login(Name => $login, Password => $password, # We must detect if we are logged in from the login banner. # Because if routeros is with a free license the command # prompt dont come. Instead it waits us to press "Enter". Prompt => '/MikroTik/'); # Just be sure that routeros isn't waiting for us to press "Enter" $t->print(""); # Wait for the real prompt $t->waitfor('/\[.*@.*\] > /'); # It is not possible to get the line numbers etc. # Thus we cant support if simultaneus-use is over 1 # At least I was using pppoe so it wasnt possible. $t->print('ppp active print column name detail'); # Somehow routeros echo'es our commands 2 times. We dont want to mix # this with the real command prompt. $t->waitfor('/\[.*@.*\] > ppp active print column name detail/'); # Now lets get the list of online ppp users. ( $output ) = $t->waitfor('/\[.*@.*\] > /'); # For debugging we can print the list to stdout # print $output; #Lets logout to make everybody happy. #If we close the connection without logging out then routeros #starts to complain after a while. Saying; #telnetd: All network ports in use. $t->print("quit"); $t->close; #check for # of $user in output #the output includes only one = between name and username so we can #safely use it as a seperator. #disabled until mikrotik starts to send newline after each line... # @output = $output; # foreach $line ( @output ) { # #remove newline # chomp $line; # #remove trailing whitespace # ($line = $line) =~ s/\s+$//; # if( $line =~ /name=/ ) { # print($line); # @fields = split( /=/, $line ); # if( $fields[1] == "\"$user\"") { # $username_seen++; # } # } # } if( $output =~ /name="$user"/ ) { $username_seen++; } #lets return something if ($username_seen > 0) { return 1; } else { return 0; } } sub redback_telnet { #Localize all variables first. my ($terminalserver, $login, $password); my ($user, $context, $operprompt, $adminprompt, $t); return 2 unless (check_net_telnet()); $terminalserver = $ARGV[1]; ($user, $context) = split /@/, $ARGV[3]; if (not $user) { print LOG " Error: No user defined\n" if ($debug); return 2; } if (not $context) { print LOG " Error: No context defined\n" if ($debug); return 2; } # Get loggin information ($root, $password) = naspasswd($terminalserver, 1); return 2 if ($password eq ""); $operprompt = '/\[.*\].*>$/'; $adminprompt = '/\[.*\].*#$/'; # Logging to the RedBack NAS $t = new Net::Telnet (Timeout => 5, Prompt => $operprompt); $t->input_log("./debug"); $t->open($terminalserver); $t->login($root, $password); #Enable us $t->print('ena'); $t->waitfor('/Password/'); $t->print($password); $t->waitfor($adminprompt); $t->prompt($adminprompt); #Switch context $t->cmd(String => "context $context"); #Ask the question @lines = $t->cmd(String => "show subscribers active $user\@$context"); if ($lines[0] =~ /subscriber $user\@$context/ ) { return 1; } return 0; } ############################################################################### # Poor man's getopt (for -d) if ($ARGV[0] eq '-d') { shift @ARGV; $debug = "stdout"; } if ($debug) { if ($debug eq 'stdout') { open(LOG, ">&STDOUT"); } elsif ($debug eq 'stderr') { open(LOG, ">&STDERR"); } else { open(LOG, ">>$debug"); $now = localtime; print LOG "$now checkrad @ARGV\n"; } } if ($#ARGV != 4) { print LOG "Usage: checkrad nas_type nas_ip " . "nas_port login session_id\n" if ($debug); print STDERR "Usage: checkrad nas_type nas_ip " . "nas_port login session_id\n" unless ($debug =~ m/^(stdout|stderr)$/); close LOG if ($debug); exit(2); } if ($ARGV[0] eq 'livingston') { $ret = &livingston_snmp; } elsif ($ARGV[0] eq 'cisco') { $ret = &cisco_snmp; } elsif ($ARGV[0] eq 'cvx') { $ret = &cvx_snmp; } elsif ($ARGV[0] eq 'juniper') { $ret = &juniper_e_snmp; } elsif ($ARGV[0] eq 'multitech') { $ret = &multitech_snmp; } elsif ($ARGV[0] eq 'computone') { $ret = &computone_finger; } elsif ($ARGV[0] eq 'max40xx') { $ret = &max40xx_finger; } elsif ($ARGV[0] eq 'ascend' || $ARGV[0] eq 'max40xx_snmp') { $ret = &ascend_snmp; } elsif ($ARGV[0] eq 'portslave') { $ret = &portslave_finger; } elsif ($ARGV[0] eq 'tc') { $ret = &tc_tccheck; } elsif ($ARGV[0] eq 'pathras') { $ret = &cyclades_telnet; } elsif ($ARGV[0] eq 'pr3000') { $ret = &cyclades_snmp; } elsif ($ARGV[0] eq 'pr4000') { $ret = &cyclades_snmp; } elsif ($ARGV[0] eq 'patton') { $ret = &patton_snmp; } elsif ($ARGV[0] eq 'digitro') { $ret = &digitro_rusers; } elsif ($ARGV[0] eq 'usrhiper') { $ret = &usrhiper_snmp; } elsif ($ARGV[0] eq 'netserver') { $ret = &usrnet_telnet; } elsif ($ARGV[0] eq 'versanet') { $ret = &versanet_snmp; } elsif ($ARGV[0] eq 'bay') { $ret = &bay_finger; } elsif ($ARGV[0] eq 'cisco_l2tp'){ $ret = &cisco_l2tp_snmp; } elsif ($ARGV[0] eq 'mikrotik'){ $ret = &mikrotik_telnet; } elsif ($ARGV[0] eq 'mikrotik_snmp'){ $ret = &mikrotik_snmp; } elsif ($ARGV[0] eq 'redback'){ $ret = &redback_telnet; } elsif ($ARGV[0] eq 'dot1x'){ $ret = &dot1x_snmp; } elsif ($ARGV[0] eq 'other') { $ret = 1; } else { print LOG " checkrad: unknown NAS type $ARGV[0]\n" if ($debug); print STDERR "checkrad: unknown NAS type $ARGV[0]\n"; $ret = 2; } if ($debug) { $mn = "login ok"; $mn = "double detected" if ($ret == 1); $mn = "error detected" if ($ret == 2); print LOG " Returning $ret ($mn)\n"; close LOG; } exit($ret); freeradius-server/src/main/client.c000066400000000000000000000635121257552170400176670ustar00rootroot00000000000000/* * client.c Read clients into memory. * * Version: $Id$ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2000,2006 The FreeRADIUS server project * Copyright 2000 Miquel van Smoorenburg * Copyright 2000 Alan DeKok */ #include RCSID("$Id$") #include #include #include #include #include #ifdef WITH_DYNAMIC_CLIENTS #ifdef HAVE_DIRENT_H #include #endif #endif struct radclient_list { /* * FIXME: One set of trees for IPv4, and another for IPv6? */ rbtree_t *trees[129]; /* for 0..128, inclusive. */ int min_prefix; }; #ifdef WITH_STATS static rbtree_t *tree_num = NULL; /* client numbers 0..N */ static int tree_num_max = 0; #endif static RADCLIENT_LIST *root_clients = NULL; #ifdef WITH_DYNAMIC_CLIENTS static fr_fifo_t *deleted_clients = NULL; #endif /* * Callback for freeing a client. */ void client_free(RADCLIENT *client) { if (!client) return; #ifdef WITH_DYNAMIC_CLIENTS if (client->dynamic == 2) { time_t now; if (!deleted_clients) { deleted_clients = fr_fifo_create(1024, (void *) client_free); if (!deleted_clients) return; /* MEMLEAK */ } /* * Mark it as in the fifo, and remember when we * pushed it. */ client->dynamic = 3; client->created = now = time(NULL); /* re-set it */ fr_fifo_push(deleted_clients, client); /* * Peek at the head of the fifo. If it might * still be in use, return. Otherwise, pop it * from the queue and delete it. */ client = fr_fifo_peek(deleted_clients); if ((client->created + 120) >= now) return; client = fr_fifo_pop(deleted_clients); rad_assert(client != NULL); } #endif free(client->longname); free(client->secret); free(client->shortname); free(client->nastype); free(client->login); free(client->password); free(client->server); #ifdef WITH_STATS free(client->auth); #ifdef WITH_ACCOUNTING free(client->acct); #endif #endif #ifdef WITH_DYNAMIC_CLIENTS free(client->client_server); #endif free(client); } /* * Callback for comparing two clients. */ static int client_ipaddr_cmp(const void *one, const void *two) { const RADCLIENT *a = one; const RADCLIENT *b = two; return fr_ipaddr_cmp(&a->ipaddr, &b->ipaddr); } #ifdef WITH_STATS static int client_num_cmp(const void *one, const void *two) { const RADCLIENT *a = one; const RADCLIENT *b = two; return (a->number - b->number); } #endif /* * Free a RADCLIENT list. */ void clients_free(RADCLIENT_LIST *clients) { int i; if (!clients) return; for (i = 0; i <= 128; i++) { if (clients->trees[i]) rbtree_free(clients->trees[i]); clients->trees[i] = NULL; } if (clients == root_clients) { #ifdef WITH_STATS if (tree_num) rbtree_free(tree_num); tree_num = NULL; tree_num_max = 0; #endif root_clients = NULL; } #ifdef WITH_DYNAMIC_CLIENTS /* * FIXME: No fr_fifo_delete() */ #endif free(clients); } /* * Return a new, initialized, set of clients. */ RADCLIENT_LIST *clients_init(void) { RADCLIENT_LIST *clients = calloc(1, sizeof(RADCLIENT_LIST)); if (!clients) return NULL; clients->min_prefix = 128; return clients; } /* * Sanity check a client. */ static int client_sane(RADCLIENT *client) { switch (client->ipaddr.af) { case AF_INET: if (client->prefix > 32) { return 0; } /* * Zero out the subnet bits. */ if (client->prefix == 0) { memset(&client->ipaddr.ipaddr.ip4addr, 0, sizeof(client->ipaddr.ipaddr.ip4addr)); } else if (client->prefix < 32) { uint32_t mask = ~0; mask <<= (32 - client->prefix); client->ipaddr.ipaddr.ip4addr.s_addr &= htonl(mask); } break; case AF_INET6: if (client->prefix > 128) return 0; if (client->prefix == 0) { memset(&client->ipaddr.ipaddr.ip6addr, 0, sizeof(client->ipaddr.ipaddr.ip6addr)); } else if (client->prefix < 128) { uint32_t mask, *addr; addr = (uint32_t *) &client->ipaddr.ipaddr.ip6addr; if ((client->prefix & 0x1f) == 0) { mask = 0; } else { mask = ~ ((uint32_t) 0); mask <<= (32 - (client->prefix & 0x1f)); mask = htonl(mask); } switch (client->prefix >> 5) { case 0: addr[0] &= mask; mask = 0; /* FALL-THROUGH */ case 1: addr[1] &= mask; mask = 0; /* FALL-THROUGH */ case 2: addr[2] &= mask; mask = 0; /* FALL-THROUGH */ case 3: addr[3] &= mask; break; } } break; default: return 0; } return 1; } /* * Add a client to the tree. */ int client_add(RADCLIENT_LIST *clients, RADCLIENT *client) { RADCLIENT *old; if (!client) { return 0; } /* * If "clients" is NULL, it means add to the global list, * unless we're trying to add it to a virtual server... */ if (!clients) { if (client->server != NULL) { CONF_SECTION *cs; CONF_SECTION *subcs; cs = cf_section_sub_find_name2(mainconfig.config, "server", client->server); if (!cs) { radlog(L_ERR, "Failed to find virtual server %s", client->server); return 0; } /* * If this server has no "listen" section, add the clients * to the global client list. */ subcs = cf_section_sub_find(cs, "listen"); if (!subcs) goto global_clients; /* * If the client list already exists, use that. * Otherwise, create a new client list. */ clients = cf_data_find(cs, "clients"); if (!clients) { clients = clients_init(); if (!clients) { radlog(L_ERR, "Out of memory"); return 0; } if (cf_data_add(cs, "clients", clients, (void *) clients_free) < 0) { radlog(L_ERR, "Failed to associate clients with virtual server %s", client->server); clients_free(clients); return 0; } } } else { global_clients: /* * Initialize the global list, if not done already. */ if (!root_clients) { root_clients = clients_init(); if (!root_clients) return 0; } clients = root_clients; } } if ((client->prefix < 0) || (client->prefix > 128)) { return 0; } if (!client_sane(client)) return 0; /* * Create a tree for it. */ if (!clients->trees[client->prefix]) { clients->trees[client->prefix] = rbtree_create(client_ipaddr_cmp, (void *) client_free, 0); if (!clients->trees[client->prefix]) { return 0; } } #define namecmp(a) ((!old->a && !client->a) || (old->a && client->a && (strcmp(old->a, client->a) == 0))) /* * Cannot insert the same client twice. */ old = rbtree_finddata(clients->trees[client->prefix], client); if (old) { /* * If it's a complete duplicate, then free the new * one, and return "OK". */ if ((fr_ipaddr_cmp(&old->ipaddr, &client->ipaddr) == 0) && (old->prefix == client->prefix) && namecmp(longname) && namecmp(secret) && namecmp(shortname) && namecmp(nastype) && namecmp(login) && namecmp(password) && namecmp(server) && #ifdef WITH_DYNAMIC_CLIENTS (old->lifetime == client->lifetime) && namecmp(client_server) && #endif #ifdef WITH_COA namecmp(coa_name) && (old->coa_server == client->coa_server) && (old->coa_pool == client->coa_pool) && #endif (old->message_authenticator == client->message_authenticator)) { DEBUG("WARNING: Ignoring duplicate client %s", client->longname); client_free(client); return 1; } radlog(L_ERR, "Failed to add duplicate client %s", client->shortname); return 0; } #undef namecmp /* * Other error adding client: likely is fatal. */ if (!rbtree_insert(clients->trees[client->prefix], client)) { return 0; } #ifdef WITH_STATS if (!tree_num) { tree_num = rbtree_create(client_num_cmp, NULL, 0); } /* * Catch clients added by rlm_sql. */ if (!client->auth) { client->auth = rad_malloc(sizeof(*client->auth)); memset(client->auth, 0, sizeof(*client->auth)); } #ifdef WITH_ACCOUNTING if (!client->acct) { client->acct = rad_malloc(sizeof(*client->acct)); memset(client->acct, 0, sizeof(*client->acct)); } #endif #ifdef WITH_DYNAMIC_CLIENTS /* * More catching of clients added by rlm_sql. * * The sql modules sets the dynamic flag BEFORE calling * us. The client_create() function sets it AFTER * calling us. */ if (client->dynamic && (client->lifetime == 0)) { RADCLIENT *network; /* * If there IS an enclosing network, * inherit the lifetime from it. */ network = client_find(clients, &client->ipaddr); if (network) { client->lifetime = network->lifetime; } } #endif client->number = tree_num_max; tree_num_max++; if (tree_num) rbtree_insert(tree_num, client); #endif if (client->prefix < clients->min_prefix) { clients->min_prefix = client->prefix; } return 1; } #ifdef WITH_DYNAMIC_CLIENTS void client_delete(RADCLIENT_LIST *clients, RADCLIENT *client) { if (!client) return; if (!clients) clients = root_clients; if (!client->dynamic) return; rad_assert((client->prefix >= 0) && (client->prefix <= 128)); client->dynamic = 2; /* signal to client_free */ rbtree_deletebydata(tree_num, client); rbtree_deletebydata(clients->trees[client->prefix], client); } #endif /* * Find a client in the RADCLIENTS list by number. * This is a support function for the statistics code. */ RADCLIENT *client_findbynumber(const RADCLIENT_LIST *clients, int number) { #ifdef WITH_STATS if (!clients) clients = root_clients; if (!clients) return NULL; if (number >= tree_num_max) return NULL; if (tree_num) { RADCLIENT myclient; myclient.number = number; return rbtree_finddata(tree_num, &myclient); } #else clients = clients; /* -Wunused */ number = number; /* -Wunused */ #endif return NULL; } /* * Find a client in the RADCLIENTS list. */ RADCLIENT *client_find(const RADCLIENT_LIST *clients, const fr_ipaddr_t *ipaddr) { int i, max_prefix; RADCLIENT myclient; if (!clients) clients = root_clients; if (!clients || !ipaddr) return NULL; switch (ipaddr->af) { case AF_INET: max_prefix = 32; break; case AF_INET6: max_prefix = 128; break; default : return NULL; } for (i = max_prefix; i >= clients->min_prefix; i--) { void *data; myclient.prefix = i; myclient.ipaddr = *ipaddr; client_sane(&myclient); /* clean up the ipaddress */ if (!clients->trees[i]) continue; data = rbtree_finddata(clients->trees[i], &myclient); if (data) { return data; } } return NULL; } /* * Old wrapper for client_find */ RADCLIENT *client_find_old(const fr_ipaddr_t *ipaddr) { return client_find(root_clients, ipaddr); } static struct in_addr cl_ip4addr; static struct in6_addr cl_ip6addr; static const CONF_PARSER client_config[] = { { "ipaddr", PW_TYPE_IPADDR, 0, &cl_ip4addr, NULL }, { "ipv6addr", PW_TYPE_IPV6ADDR, 0, &cl_ip6addr, NULL }, { "netmask", PW_TYPE_INTEGER, offsetof(RADCLIENT, prefix), 0, NULL }, { "require_message_authenticator", PW_TYPE_BOOLEAN, offsetof(RADCLIENT, message_authenticator), 0, "no" }, { "secret", PW_TYPE_STRING_PTR, offsetof(RADCLIENT, secret), 0, NULL }, { "shortname", PW_TYPE_STRING_PTR, offsetof(RADCLIENT, shortname), 0, NULL }, { "nastype", PW_TYPE_STRING_PTR, offsetof(RADCLIENT, nastype), 0, NULL }, { "login", PW_TYPE_STRING_PTR, offsetof(RADCLIENT, login), 0, NULL }, { "password", PW_TYPE_STRING_PTR, offsetof(RADCLIENT, password), 0, NULL }, { "virtual_server", PW_TYPE_STRING_PTR, offsetof(RADCLIENT, server), 0, NULL }, { "server", PW_TYPE_STRING_PTR, /* compatability with 2.0-pre */ offsetof(RADCLIENT, server), 0, NULL }, #ifdef WITH_DYNAMIC_CLIENTS { "dynamic_clients", PW_TYPE_STRING_PTR, offsetof(RADCLIENT, client_server), 0, NULL }, { "lifetime", PW_TYPE_INTEGER, offsetof(RADCLIENT, lifetime), 0, NULL }, { "rate_limit", PW_TYPE_BOOLEAN, offsetof(RADCLIENT, rate_limit), 0, NULL }, #endif #ifdef WITH_COA { "coa_server", PW_TYPE_STRING_PTR, offsetof(RADCLIENT, coa_name), 0, NULL }, #endif { NULL, -1, 0, NULL, NULL } }; static RADCLIENT *client_parse(CONF_SECTION *cs, int in_server) { RADCLIENT *c; const char *name2; name2 = cf_section_name2(cs); if (!name2) { cf_log_err(cf_sectiontoitem(cs), "Missing client name"); return NULL; } /* * The size is fine.. Let's create the buffer */ c = rad_malloc(sizeof(*c)); memset(c, 0, sizeof(*c)); c->cs = cs; #ifdef WITH_STATS c->auth = rad_malloc(sizeof(*c->auth)); memset(c->auth, 0, sizeof(*c->auth)); #ifdef WITH_ACCOUNTING c->acct = rad_malloc(sizeof(*c->acct)); memset(c->acct, 0, sizeof(*c->acct)); #endif #endif memset(&cl_ip4addr, 0, sizeof(cl_ip4addr)); memset(&cl_ip6addr, 0, sizeof(cl_ip6addr)); c->prefix = -1; if (cf_section_parse(cs, c, client_config) < 0) { client_free(c); cf_log_err(cf_sectiontoitem(cs), "Error parsing client section."); return NULL; } /* * Global clients can set servers to use, * per-server clients cannot. */ if (in_server && c->server) { client_free(c); cf_log_err(cf_sectiontoitem(cs), "Clients inside of an server section cannot point to a server."); return NULL; } /* * No "ipaddr" or "ipv6addr", use old-style * "client {" syntax. */ if (!cf_pair_find(cs, "ipaddr") && !cf_pair_find(cs, "ipv6addr")) { char *prefix_ptr; prefix_ptr = strchr(name2, '/'); /* * Look for prefixes. */ if (prefix_ptr) { c->prefix = atoi(prefix_ptr + 1); if ((c->prefix < 0) || (c->prefix > 128)) { client_free(c); cf_log_err(cf_sectiontoitem(cs), "Invalid Prefix value '%s' for IP.", prefix_ptr + 1); return NULL; } /* Replace '/' with '\0' */ *prefix_ptr = '\0'; } /* * Always get the numeric representation of IP */ if (ip_hton(name2, AF_UNSPEC, &c->ipaddr) < 0) { client_free(c); cf_log_err(cf_sectiontoitem(cs), "Failed to look up hostname %s: %s", name2, fr_strerror()); return NULL; } if (prefix_ptr) *prefix_ptr = '/'; c->longname = strdup(name2); if (!c->shortname) c->shortname = strdup(c->longname); } else { char buffer[1024]; /* * Figure out which one to use. */ if (cf_pair_find(cs, "ipaddr")) { c->ipaddr.af = AF_INET; c->ipaddr.ipaddr.ip4addr = cl_ip4addr; if ((c->prefix < -1) || (c->prefix > 32)) { client_free(c); cf_log_err(cf_sectiontoitem(cs), "Netmask must be between 0 and 32"); return NULL; } } else if (cf_pair_find(cs, "ipv6addr")) { c->ipaddr.af = AF_INET6; c->ipaddr.ipaddr.ip6addr = cl_ip6addr; if ((c->prefix < -1) || (c->prefix > 128)) { client_free(c); cf_log_err(cf_sectiontoitem(cs), "Netmask must be between 0 and 128"); return NULL; } } else { cf_log_err(cf_sectiontoitem(cs), "No IP address defined for the client"); client_free(c); return NULL; } ip_ntoh(&c->ipaddr, buffer, sizeof(buffer)); c->longname = strdup(buffer); /* * Set the short name to the name2 */ if (!c->shortname) c->shortname = strdup(name2); } if (c->prefix < 0) switch (c->ipaddr.af) { case AF_INET: c->prefix = 32; break; case AF_INET6: c->prefix = 128; break; default: break; } #ifdef WITH_DYNAMIC_CLIENTS if (c->client_server) { free(c->secret); c->secret = strdup("testing123"); if (((c->ipaddr.af == AF_INET) && (c->prefix == 32)) || ((c->ipaddr.af == AF_INET6) && (c->prefix == 128))) { cf_log_err(cf_sectiontoitem(cs), "Dynamic clients MUST be a network, not a single IP address."); client_free(c); return NULL; } return c; } #endif if (!c->secret || !*c->secret) { #ifdef WITH_DHCP const char *value = NULL; CONF_PAIR *cp = cf_pair_find(cs, "dhcp"); if (cp) value = cf_pair_value(cp); /* * Secrets aren't needed for DHCP. */ if (value && (strcmp(value, "yes") == 0)) return c; #endif client_free(c); cf_log_err(cf_sectiontoitem(cs), "secret must be at least 1 character long"); return NULL; } #ifdef WITH_COA /* * Point the client to the home server pool, OR to the * home server. This gets around the problem of figuring * out which port to use. */ if (c->coa_name) { c->coa_pool = home_pool_byname(c->coa_name, HOME_TYPE_COA); if (!c->coa_pool) { c->coa_server = home_server_byname(c->coa_name, HOME_TYPE_COA); } if (!c->coa_pool && !c->coa_server) { cf_log_err(cf_sectiontoitem(cs), "No such home_server or home_server_pool \"%s\"", c->coa_name); client_free(c); return NULL; } } #endif return c; } /* * Create the linked list of clients from the new configuration * type. This way we don't have to change too much in the other * source-files. */ RADCLIENT_LIST *clients_parse_section(CONF_SECTION *section) { int global = FALSE, in_server = FALSE; CONF_SECTION *cs; RADCLIENT *c; RADCLIENT_LIST *clients; /* * Be forgiving. If there's already a clients, return * it. Otherwise create a new one. */ clients = cf_data_find(section, "clients"); if (clients) return clients; clients = clients_init(); if (!clients) return NULL; if (cf_top_section(section) == section) global = TRUE; if (strcmp("server", cf_section_name1(section)) == 0) in_server = TRUE; /* * Associate the clients structure with the section, where * it will be freed once the section is freed. */ if (cf_data_add(section, "clients", clients, (void *) clients_free) < 0) { cf_log_err(cf_sectiontoitem(section), "Failed to associate clients with section %s", cf_section_name1(section)); clients_free(clients); return NULL; } for (cs = cf_subsection_find_next(section, NULL, "client"); cs != NULL; cs = cf_subsection_find_next(section, cs, "client")) { c = client_parse(cs, in_server); if (!c) { return NULL; } /* * FIXME: Add the client as data via cf_data_add, * for migration issues. */ #ifdef WITH_DYNAMIC_CLIENTS #ifdef HAVE_DIRENT_H if (c->client_server) { const char *value; CONF_PAIR *cp; DIR *dir; struct dirent *dp; struct stat stat_buf; char buf2[2048]; /* * Find the directory where individual * client definitions are stored. */ cp = cf_pair_find(cs, "directory"); if (!cp) goto add_client; value = cf_pair_value(cp); if (!value) { cf_log_err(cf_sectiontoitem(cs), "The \"directory\" entry must not be empty"); client_free(c); return NULL; } DEBUG("including dynamic clients in %s", value); dir = opendir(value); if (!dir) { cf_log_err(cf_sectiontoitem(cs), "Error reading directory %s: %s", value, strerror(errno)); client_free(c); return NULL; } /* * Read the directory, ignoring "." files. */ while ((dp = readdir(dir)) != NULL) { const char *p; RADCLIENT *dc; if (dp->d_name[0] == '.') continue; /* * Check for valid characters */ for (p = dp->d_name; *p != '\0'; p++) { if (isalpha((int)*p) || isdigit((int)*p) || (*p == ':') || (*p == '.')) continue; break; } if (*p != '\0') continue; snprintf(buf2, sizeof(buf2), "%s/%s", value, dp->d_name); if ((stat(buf2, &stat_buf) != 0) || S_ISDIR(stat_buf.st_mode)) continue; dc = client_read(buf2, in_server, TRUE); if (!dc) { cf_log_err(cf_sectiontoitem(cs), "Failed reading client file \"%s\"", buf2); client_free(c); closedir(dir); return NULL; } /* * Validate, and add to the list. */ if (!client_validate(clients, c, dc)) { client_free(c); closedir(dir); return NULL; } } /* loop over the directory */ closedir(dir); } #endif /* HAVE_DIRENT_H */ #endif /* WITH_DYNAMIC_CLIENTS */ add_client: if (!client_add(clients, c)) { cf_log_err(cf_sectiontoitem(cs), "Failed to add client %s", cf_section_name2(cs)); client_free(c); return NULL; } } /* * Replace the global list of clients with the new one. * The old one is still referenced from the original * configuration, and will be freed when that is freed. */ if (global) { root_clients = clients; } return clients; } #ifdef WITH_DYNAMIC_CLIENTS /* * We overload this structure a lot. */ static const CONF_PARSER dynamic_config[] = { { "FreeRADIUS-Client-IP-Address", PW_TYPE_IPADDR, offsetof(RADCLIENT, ipaddr), 0, NULL }, { "FreeRADIUS-Client-IPv6-Address", PW_TYPE_IPV6ADDR, offsetof(RADCLIENT, ipaddr), 0, NULL }, { "FreeRADIUS-Client-Require-MA", PW_TYPE_BOOLEAN, offsetof(RADCLIENT, message_authenticator), NULL, NULL }, { "FreeRADIUS-Client-Secret", PW_TYPE_STRING_PTR, offsetof(RADCLIENT, secret), 0, "" }, { "FreeRADIUS-Client-Shortname", PW_TYPE_STRING_PTR, offsetof(RADCLIENT, shortname), 0, "" }, { "FreeRADIUS-Client-NAS-Type", PW_TYPE_STRING_PTR, offsetof(RADCLIENT, nastype), 0, NULL }, { "FreeRADIUS-Client-Virtual-Server", PW_TYPE_STRING_PTR, offsetof(RADCLIENT, server), 0, NULL }, { NULL, -1, 0, NULL, NULL } }; int client_validate(RADCLIENT_LIST *clients, RADCLIENT *master, RADCLIENT *c) { char buffer[128]; /* * No virtual server defined. Inherit the parent's * definition. */ if (master->server && !c->server) { c->server = strdup(master->server); } /* * If the client network isn't global (not tied to a * virtual server), then ensure that this clients server * is the same as the enclosing networks virtual server. */ if (master->server && (strcmp(master->server, c->server) != 0)) { DEBUG("- Cannot add client %s: Virtual server %s is not the same as the virtual server for the network.", ip_ntoh(&c->ipaddr, buffer, sizeof(buffer)), c->server); goto error; } if (!client_add(clients, c)) { DEBUG("- Cannot add client %s: Internal error", ip_ntoh(&c->ipaddr, buffer, sizeof(buffer))); goto error; } /* * Initialize the remaining fields. */ c->dynamic = TRUE; c->lifetime = master->lifetime; c->created = time(NULL); c->longname = strdup(c->shortname); DEBUG("- Added client %s with shared secret %s", ip_ntoh(&c->ipaddr, buffer, sizeof(buffer)), c->secret); return 1; error: client_free(c); return 0; } RADCLIENT *client_create(RADCLIENT_LIST *clients, REQUEST *request) { int i, *pi; char **p; RADCLIENT *c; char buffer[128]; if (!clients || !request) return NULL; c = rad_malloc(sizeof(*c)); memset(c, 0, sizeof(*c)); c->cs = request->client->cs; c->ipaddr.af = AF_UNSPEC; for (i = 0; dynamic_config[i].name != NULL; i++) { DICT_ATTR *da; VALUE_PAIR *vp; da = dict_attrbyname(dynamic_config[i].name); if (!da) { DEBUG("- Cannot add client %s: attribute \"%s\"is not in the dictionary", ip_ntoh(&request->packet->src_ipaddr, buffer, sizeof(buffer)), dynamic_config[i].name); error: client_free(c); return NULL; } vp = pairfind(request->config_items, da->attr); if (!vp) { /* * Not required. Skip it. */ if (!dynamic_config[i].dflt) continue; DEBUG("- Cannot add client %s: Required attribute \"%s\" is missing.", ip_ntoh(&request->packet->src_ipaddr, buffer, sizeof(buffer)), dynamic_config[i].name); goto error; } switch (dynamic_config[i].type) { case PW_TYPE_IPADDR: c->ipaddr.af = AF_INET; c->ipaddr.ipaddr.ip4addr.s_addr = vp->vp_ipaddr; c->prefix = 32; break; case PW_TYPE_IPV6ADDR: c->ipaddr.af = AF_INET6; c->ipaddr.ipaddr.ip6addr = vp->vp_ipv6addr; c->prefix = 128; break; case PW_TYPE_STRING_PTR: p = (char **) ((char *) c + dynamic_config[i].offset); if (*p) free(*p); if (vp->vp_strvalue[0]) { *p = strdup(vp->vp_strvalue); } else { *p = NULL; } break; case PW_TYPE_BOOLEAN: pi = (int *) ((char *) c + dynamic_config[i].offset); *pi = vp->vp_integer; break; default: goto error; } } if (c->ipaddr.af == AF_UNSPEC) { DEBUG("- Cannot add client %s: No IP address was specified.", ip_ntoh(&request->packet->src_ipaddr, buffer, sizeof(buffer))); goto error; } if (fr_ipaddr_cmp(&request->packet->src_ipaddr, &c->ipaddr) != 0) { char buf2[128]; DEBUG("- Cannot add client %s: IP address %s do not match", ip_ntoh(&request->packet->src_ipaddr, buffer, sizeof(buffer)), ip_ntoh(&c->ipaddr, buf2, sizeof(buf2))); goto error; } if (!c->secret || !*c->secret) { DEBUG("- Cannot add client %s: No secret was specified.", ip_ntoh(&request->packet->src_ipaddr, buffer, sizeof(buffer))); goto error; } if (!client_validate(clients, request->client, c)) { return NULL; } return c; } /* * Read a client definition from the given filename. */ RADCLIENT *client_read(const char *filename, int in_server, int flag) { const char *p; RADCLIENT *c; CONF_SECTION *cs; char buffer[256]; if (!filename) return NULL; cs = cf_file_read(filename); if (!cs) return NULL; cs = cf_section_sub_find(cs, "client"); if (!cs) { radlog(L_ERR, "No \"client\" section found in client file"); return NULL; } c = client_parse(cs, in_server); if (!c) return NULL; p = strrchr(filename, FR_DIR_SEP); if (p) { p++; } else { p = filename; } if (!flag) return c; /* * Additional validations */ ip_ntoh(&c->ipaddr, buffer, sizeof(buffer)); if (strcmp(p, buffer) != 0) { DEBUG("Invalid client definition in %s: IP address %s does not match name %s", filename, buffer, p); client_free(c); return NULL; } return c; } #endif freeradius-server/src/main/command.c000066400000000000000000001546561257552170400200410ustar00rootroot00000000000000/* * command.c Command socket processing. * * Version: $Id$ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2008 The FreeRADIUS server project * Copyright 2008 Alan DeKok */ #ifdef WITH_COMMAND_SOCKET #include #include #include #include #ifdef HAVE_SYS_UN_H #include #ifndef SUN_LEN #define SUN_LEN(su) (sizeof(*(su)) - sizeof((su)->sun_path) + strlen((su)->sun_path)) #endif #endif #ifdef HAVE_SYS_STAT_H #include #endif #ifdef HAVE_PWD_H #include #endif #ifdef HAVE_GRP_H #include #endif typedef struct fr_command_table_t fr_command_table_t; typedef int (*fr_command_func_t)(rad_listen_t *, int, char *argv[]); #define FR_READ (1) #define FR_WRITE (2) struct fr_command_table_t { const char *command; int mode; /* read/write */ const char *help; fr_command_func_t func; fr_command_table_t *table; }; #define COMMAND_BUFFER_SIZE (1024) typedef struct fr_command_socket_t { char *path; char *copy; /* */ uid_t uid; gid_t gid; int mode; char *uid_name; char *gid_name; char *mode_name; char user[256]; /* * The next few entries handle fake packets injected by * the control socket. */ fr_ipaddr_t src_ipaddr; /* src_port is always 0 */ fr_ipaddr_t dst_ipaddr; int dst_port; rad_listen_t *inject_listener; RADCLIENT *inject_client; /* * The next few entries do buffer management. */ ssize_t offset; ssize_t next; char buffer[COMMAND_BUFFER_SIZE]; } fr_command_socket_t; static const CONF_PARSER command_config[] = { { "socket", PW_TYPE_STRING_PTR, offsetof(fr_command_socket_t, path), NULL, "${run_dir}/radiusd.sock"}, { "uid", PW_TYPE_STRING_PTR, offsetof(fr_command_socket_t, uid_name), NULL, NULL}, { "gid", PW_TYPE_STRING_PTR, offsetof(fr_command_socket_t, gid_name), NULL, NULL}, { "mode", PW_TYPE_STRING_PTR, offsetof(fr_command_socket_t, mode_name), NULL, NULL}, { NULL, -1, 0, NULL, NULL } /* end the list */ }; static FR_NAME_NUMBER mode_names[] = { { "ro", FR_READ }, { "read-only", FR_READ }, { "read-write", FR_READ | FR_WRITE }, { "rw", FR_READ | FR_WRITE }, { NULL, 0 } }; static ssize_t cprintf(rad_listen_t *listener, const char *fmt, ...) #ifdef __GNUC__ __attribute__ ((format (printf, 2, 3))) #endif ; #ifndef HAVE_GETPEEREID static int getpeereid(int s, uid_t *euid, gid_t *egid) { #ifndef SO_PEERCRED return -1; #else struct ucred cr; socklen_t cl = sizeof(cr); if (getsockopt(s, SOL_SOCKET, SO_PEERCRED, &cr, &cl) < 0) { return -1; } *euid = cr.uid; *egid = cr.gid; return 0; #endif /* SO_PEERCRED */ } #endif /* HAVE_GETPEEREID */ static int fr_server_domain_socket(const char *path) { int sockfd; size_t len; socklen_t socklen; struct sockaddr_un salocal; struct stat buf; len = strlen(path); if (len >= sizeof(salocal.sun_path)) { radlog(L_ERR, "Path too long in socket filename."); return -1; } if ((sockfd = socket(AF_UNIX, SOCK_STREAM, 0)) < 0) { radlog(L_ERR, "Failed creating socket: %s", strerror(errno)); return -1; } memset(&salocal, 0, sizeof(salocal)); salocal.sun_family = AF_UNIX; memcpy(salocal.sun_path, path, len + 1); /* SUN_LEN does strlen */ socklen = SUN_LEN(&salocal); /* * Check the path. */ if (stat(path, &buf) < 0) { if (errno != ENOENT) { radlog(L_ERR, "Failed to stat %s: %s", path, strerror(errno)); close(sockfd); return -1; } /* * FIXME: Check the enclosing directory? */ } else { /* it exists */ if (!S_ISREG(buf.st_mode) #ifdef S_ISSOCK && !S_ISSOCK(buf.st_mode) #endif ) { radlog(L_ERR, "Cannot turn %s into socket", path); close(sockfd); return -1; } /* * Refuse to open sockets not owned by us. */ if (buf.st_uid != geteuid()) { radlog(L_ERR, "We do not own %s", path); close(sockfd); return -1; } if (unlink(path) < 0) { radlog(L_ERR, "Failed to delete %s: %s", path, strerror(errno)); close(sockfd); return -1; } } if (bind(sockfd, (struct sockaddr *)&salocal, socklen) < 0) { radlog(L_ERR, "Failed binding to %s: %s", path, strerror(errno)); close(sockfd); return -1; } /* * FIXME: There's a race condition here. But Linux * doesn't seem to permit fchmod on domain sockets. */ if (chmod(path, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP) < 0) { radlog(L_ERR, "Failed setting permissions on %s: %s", path, strerror(errno)); close(sockfd); return -1; } if (listen(sockfd, 8) < 0) { radlog(L_ERR, "Failed listening to %s: %s", path, strerror(errno)); close(sockfd); return -1; } #ifdef O_NONBLOCK { int flags; if ((flags = fcntl(sockfd, F_GETFL, NULL)) < 0) { radlog(L_ERR, "Failure getting socket flags: %s", strerror(errno)); close(sockfd); return -1; } flags |= O_NONBLOCK; if( fcntl(sockfd, F_SETFL, flags) < 0) { radlog(L_ERR, "Failure setting socket flags: %s", strerror(errno)); close(sockfd); return -1; } } #endif return sockfd; } static void command_close_socket(rad_listen_t *this) { this->status = RAD_LISTEN_STATUS_CLOSED; /* * This removes the socket from the event fd, so no one * will be calling us any more. */ event_new_fd(this); listen_free(&this); } static ssize_t cprintf(rad_listen_t *listener, const char *fmt, ...) { ssize_t len; va_list ap; char buffer[256]; va_start(ap, fmt); len = vsnprintf(buffer, sizeof(buffer), fmt, ap); va_end(ap); if (listener->status == RAD_LISTEN_STATUS_CLOSED) return 0; len = write(listener->fd, buffer, len); if (len <= 0) command_close_socket(listener); /* * FIXME: Keep writing until done? */ return len; } static int command_hup(rad_listen_t *listener, int argc, char *argv[]) { CONF_SECTION *cs; module_instance_t *mi; if (argc == 0) { radius_signal_self(RADIUS_SIGNAL_SELF_HUP); return 1; } /* * Hack a "main" HUP thingy */ if (strcmp(argv[0], "main.log") == 0) { hup_logfile(); return 1; } cs = cf_section_find("modules"); if (!cs) return 0; mi = find_module_instance(cs, argv[0], 0); if (!mi) { cprintf(listener, "ERROR: No such module \"%s\"\n", argv[0]); return 0; } if ((mi->entry->module->type & RLM_TYPE_HUP_SAFE) == 0) { cprintf(listener, "ERROR: Module %s cannot be hup'd\n", argv[0]); return 0; } if (!module_hup_module(mi->cs, mi, time(NULL))) { cprintf(listener, "ERROR: Failed to reload module\n"); return 0; } return 1; /* success */ } static int command_terminate(UNUSED rad_listen_t *listener, UNUSED int argc, UNUSED char *argv[]) { radius_signal_self(RADIUS_SIGNAL_SELF_TERM); return 1; /* success */ } extern time_t fr_start_time; static int command_uptime(rad_listen_t *listener, UNUSED int argc, UNUSED char *argv[]) { char buffer[128]; CTIME_R(&fr_start_time, buffer, sizeof(buffer)); cprintf(listener, "Up since %s", buffer); /* no \r\n */ return 1; /* success */ } static int command_show_config(rad_listen_t *listener, int argc, char *argv[]) { CONF_ITEM *ci; CONF_PAIR *cp; const char *value; if (argc != 1) { cprintf(listener, "ERROR: No path was given\n"); return 0; } ci = cf_reference_item(mainconfig.config, mainconfig.config, argv[0]); if (!ci) return 0; if (!cf_item_is_pair(ci)) return 0; cp = cf_itemtopair(ci); value = cf_pair_value(cp); if (!value) return 0; cprintf(listener, "%s\n", value); return 1; /* success */ } static const char *tabs = "\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t"; /* * FIXME: Recurse && indent? */ static void cprint_conf_parser(rad_listen_t *listener, int indent, CONF_SECTION *cs, const void *base) { int i; const void *data; const char *name1 = cf_section_name1(cs); const char *name2 = cf_section_name2(cs); const CONF_PARSER *variables = cf_section_parse_table(cs); char buffer[256]; if (name2) { cprintf(listener, "%.*s%s %s {\n", indent, tabs, name1, name2); } else { cprintf(listener, "%.*s%s {\n", indent, tabs, name1); } indent++; /* * Print */ if (variables) for (i = 0; variables[i].name != NULL; i++) { /* * No base struct offset, data must be the pointer. * If data doesn't exist, ignore the entry, there * must be something wrong. */ if (!base) { if (!variables[i].data) { continue; } data = variables[i].data;; } else if (variables[i].data) { data = variables[i].data;; } else { data = (((const char *)base) + variables[i].offset); } switch (variables[i].type) { default: cprintf(listener, "%.*s%s = ?\n", indent, tabs, variables[i].name); break; case PW_TYPE_INTEGER: cprintf(listener, "%.*s%s = %u\n", indent, tabs, variables[i].name, *(const int *) data); break; case PW_TYPE_IPADDR: inet_ntop(AF_INET, data, buffer, sizeof(buffer)); break; case PW_TYPE_IPV6ADDR: inet_ntop(AF_INET6, data, buffer, sizeof(buffer)); break; case PW_TYPE_BOOLEAN: cprintf(listener, "%.*s%s = %s\n", indent, tabs, variables[i].name, ((*(const int *) data) == 0) ? "no" : "yes"); break; case PW_TYPE_STRING_PTR: case PW_TYPE_FILENAME: /* * FIXME: Escape things in the string! */ if (*(const char * const *) data) { cprintf(listener, "%.*s%s = \"%s\"\n", indent, tabs, variables[i].name, *(const char * const *) data); } else { cprintf(listener, "%.*s%s = \n", indent, tabs, variables[i].name); } break; } } indent--; cprintf(listener, "%.*s}\n", indent, tabs); } static int command_show_module_config(rad_listen_t *listener, int argc, char *argv[]) { CONF_SECTION *cs; module_instance_t *mi; if (argc != 1) { cprintf(listener, "ERROR: No module name was given\n"); return 0; } cs = cf_section_find("modules"); if (!cs) return 0; mi = find_module_instance(cs, argv[0], 0); if (!mi) { cprintf(listener, "ERROR: No such module \"%s\"\n", argv[0]); return 0; } cprint_conf_parser(listener, 0, mi->cs, mi->insthandle); return 1; /* success */ } static const char *method_names[RLM_COMPONENT_COUNT] = { "authenticate", "authorize", "preacct", "accounting", "session", "pre-proxy", "post-proxy", "post-auth" }; static int command_show_module_methods(rad_listen_t *listener, int argc, char *argv[]) { int i; CONF_SECTION *cs; const module_instance_t *mi; const module_t *mod; if (argc != 1) { cprintf(listener, "ERROR: No module name was given\n"); return 0; } cs = cf_section_find("modules"); if (!cs) return 0; mi = find_module_instance(cs, argv[0], 0); if (!mi) { cprintf(listener, "ERROR: No such module \"%s\"\n", argv[0]); return 0; } mod = mi->entry->module; for (i = 0; i < RLM_COMPONENT_COUNT; i++) { if (mod->methods[i]) cprintf(listener, "\t%s\n", method_names[i]); } return 1; /* success */ } static int command_show_module_flags(rad_listen_t *listener, int argc, char *argv[]) { CONF_SECTION *cs; const module_instance_t *mi; const module_t *mod; if (argc != 1) { cprintf(listener, "ERROR: No module name was given\n"); return 0; } cs = cf_section_find("modules"); if (!cs) return 0; mi = find_module_instance(cs, argv[0], 0); if (!mi) { cprintf(listener, "ERROR: No such module \"%s\"\n", argv[0]); return 0; } mod = mi->entry->module; if ((mod->type & RLM_TYPE_THREAD_SAFE) != 0) cprintf(listener, "\tthread-safe\n"); if ((mod->type & RLM_TYPE_CHECK_CONFIG_SAFE) != 0) cprintf(listener, "\twill-check-config\n"); if ((mod->type & RLM_TYPE_HUP_SAFE) != 0) cprintf(listener, "\treload-on-hup\n"); return 1; /* success */ } extern const FR_NAME_NUMBER mod_rcode_table[]; static int command_show_module_status(rad_listen_t *listener, int argc, char *argv[]) { CONF_SECTION *cs; const module_instance_t *mi; if (argc != 1) { cprintf(listener, "ERROR: No module name was given\n"); return 0; } cs = cf_section_find("modules"); if (!cs) return 0; mi = find_module_instance(cs, argv[0], 0); if (!mi) { cprintf(listener, "ERROR: No such module \"%s\"\n", argv[0]); return 0; } if (mi->force == FALSE) { cprintf(listener, "alive\n"); } else { cprintf(listener, "%s\n", fr_int2str(mod_rcode_table, mi->code, "")); } return 1; /* success */ } /* * Show all loaded modules */ static int command_show_modules(rad_listen_t *listener, UNUSED int argc, UNUSED char *argv[]) { CONF_SECTION *cs, *subcs; cs = cf_section_find("modules"); if (!cs) return 0; subcs = NULL; while ((subcs = cf_subsection_find_next(cs, subcs, NULL)) != NULL) { const char *name1 = cf_section_name1(subcs); const char *name2 = cf_section_name2(subcs); module_instance_t *mi; if (name2) { mi = find_module_instance(cs, name2, 0); if (!mi) continue; cprintf(listener, "\t%s (%s)\n", name2, name1); } else { mi = find_module_instance(cs, name1, 0); if (!mi) continue; cprintf(listener, "\t%s\n", name1); } } return 1; /* success */ } #ifdef WITH_PROXY static int command_show_home_servers(rad_listen_t *listener, UNUSED int argc, UNUSED char *argv[]) { int i; home_server *home; const char *type, *state; char buffer[256]; for (i = 0; i < 256; i++) { home = home_server_bynumber(i); if (!home) break; /* * Internal "virtual" home server. */ if (home->ipaddr.af == AF_UNSPEC) continue; if (home->type == HOME_TYPE_AUTH) { type = "auth"; } else if (home->type == HOME_TYPE_ACCT) { type = "acct"; } else continue; if (home->state == HOME_STATE_ALIVE) { state = "alive"; } else if (home->state == HOME_STATE_ZOMBIE) { state = "zombie"; } else if (home->state == HOME_STATE_IS_DEAD) { state = "dead"; } else continue; cprintf(listener, "%s\t%d\t%s\t%s\t%d\n", ip_ntoh(&home->ipaddr, buffer, sizeof(buffer)), home->port, type, state, home->currently_outstanding); } return 0; } #endif static int command_show_clients(rad_listen_t *listener, UNUSED int argc, UNUSED char *argv[]) { int i; RADCLIENT *client; char buffer[256]; for (i = 0; i < 256; i++) { client = client_findbynumber(NULL, i); if (!client) break; ip_ntoh(&client->ipaddr, buffer, sizeof(buffer)); if (((client->ipaddr.af == AF_INET) && (client->prefix != 32)) || ((client->ipaddr.af == AF_INET6) && (client->prefix != 128))) { cprintf(listener, "\t%s/%d\n", buffer, client->prefix); } else { cprintf(listener, "\t%s\n", buffer); } } return 0; } static int command_show_xml(rad_listen_t *listener, UNUSED int argc, UNUSED char *argv[]) { CONF_ITEM *ci; FILE *fp = fdopen(dup(listener->fd), "a"); if (!fp) { cprintf(listener, "ERROR: Can't dup %s\n", strerror(errno)); return 0; } if (argc == 0) { cprintf(listener, "ERROR: is required\n"); fclose(fp); return 0; } ci = cf_reference_item(mainconfig.config, mainconfig.config, argv[0]); if (!ci) { cprintf(listener, "ERROR: No such item \n"); fclose(fp); return 0; } if (cf_item_is_section(ci)) { cf_section2xml(fp, cf_itemtosection(ci)); } else if (cf_item_is_pair(ci)) { cf_pair2xml(fp, cf_itemtopair(ci)); } else { cprintf(listener, "ERROR: No such item \n"); fclose(fp); return 0; } fclose(fp); return 1; /* success */ } static int command_show_version(rad_listen_t *listener, UNUSED int argc, UNUSED char *argv[]) { cprintf(listener, "%s\n", radiusd_version); return 1; } static int command_debug_level(rad_listen_t *listener, int argc, char *argv[]) { int number; if (argc == 0) { cprintf(listener, "ERROR: Must specify \n"); return -1; } number = atoi(argv[0]); if ((number < 0) || (number > 4)) { cprintf(listener, "ERROR: must be between 0 and 4\n"); return -1; } fr_debug_flag = debug_flag = number; return 0; } char *debug_log_file = NULL; static char debug_log_file_buffer[1024]; static int command_debug_file(rad_listen_t *listener, int argc, char *argv[]) { if (debug_flag && mainconfig.radlog_dest == RADLOG_STDOUT) { cprintf(listener, "ERROR: Cannot redirect debug logs to a file when already in debugging mode.\n"); return -1; } if ((argc > 0) && (strchr(argv[0], FR_DIR_SEP) != NULL)) { cprintf(listener, "ERROR: Cannot direct debug logs to absolute path.\n"); } debug_log_file = NULL; if (argc == 0) return 0; /* * This looks weird, but it's here to avoid locking * a mutex for every log message. */ memset(debug_log_file_buffer, 0, sizeof(debug_log_file_buffer)); /* * Debug files always go to the logging directory. */ snprintf(debug_log_file_buffer, sizeof(debug_log_file_buffer), "%s/%s", radlog_dir, argv[0]); debug_log_file = &debug_log_file_buffer[0]; return 0; } extern char *debug_condition; static int command_debug_condition(UNUSED rad_listen_t *listener, int argc, char *argv[]) { /* * Delete old condition. * * This is thread-safe because the condition is evaluated * in the main server thread, as is this code. */ free(debug_condition); debug_condition = NULL; /* * Disable it. */ if (argc == 0) { return 0; } debug_condition = strdup(argv[0]); return 0; } static int command_show_debug_condition(rad_listen_t *listener, UNUSED int argc, UNUSED char *argv[]) { if (!debug_condition) return 0; cprintf(listener, "%s\n", debug_condition); return 0; } static int command_show_debug_file(rad_listen_t *listener, UNUSED int argc, UNUSED char *argv[]) { if (!debug_log_file) return 0; cprintf(listener, "%s\n", debug_log_file); return 0; } static int command_show_debug_level(rad_listen_t *listener, UNUSED int argc, UNUSED char *argv[]) { cprintf(listener, "%d\n", debug_flag); return 0; } static RADCLIENT *get_client(rad_listen_t *listener, int argc, char *argv[]) { RADCLIENT *client; fr_ipaddr_t ipaddr; if (argc < 1) { cprintf(listener, "ERROR: Must specify \n"); return NULL; } if (ip_hton(argv[0], AF_UNSPEC, &ipaddr) < 0) { cprintf(listener, "ERROR: Failed parsing IP address; %s\n", fr_strerror()); return NULL; } client = client_find(NULL, &ipaddr); if (!client) { cprintf(listener, "ERROR: No such client\n"); return NULL; } return client; } static int command_show_client_config(rad_listen_t *listener, int argc, char *argv[]) { RADCLIENT *client; FILE *fp; client = get_client(listener, argc, argv); if (!client) { return 0; } if (!client->cs) return 1; fp = fdopen(dup(listener->fd), "a"); if (!fp) { cprintf(listener, "ERROR: Can't dup %s\n", strerror(errno)); return 0; } cf_section2file(fp, client->cs); fclose(fp); return 1; } #ifdef WITH_PROXY static home_server *get_home_server(rad_listen_t *listener, int argc, char *argv[]) { home_server *home; int port; fr_ipaddr_t ipaddr; if (argc < 2) { cprintf(listener, "ERROR: Must specify \n"); return NULL; } if (ip_hton(argv[0], AF_UNSPEC, &ipaddr) < 0) { cprintf(listener, "ERROR: Failed parsing IP address; %s\n", fr_strerror()); return NULL; } port = atoi(argv[1]); home = home_server_find(&ipaddr, port); if (!home) { cprintf(listener, "ERROR: No such home server\n"); return NULL; } return home; } static int command_show_home_server_config(rad_listen_t *listener, int argc, char *argv[]) { home_server *home; FILE *fp; home = get_home_server(listener, argc, argv); if (!home) { return 0; } if (!home->cs) return 1; fp = fdopen(dup(listener->fd), "a"); if (!fp) { cprintf(listener, "ERROR: Can't dup %s\n", strerror(errno)); return 0; } cf_section2file(fp, home->cs); fclose(fp); return 1; } extern void revive_home_server(void *ctx); extern void mark_home_server_dead(home_server *home, struct timeval *when); static int command_set_home_server_state(rad_listen_t *listener, int argc, char *argv[]) { home_server *home; if (argc < 3) { cprintf(listener, "ERROR: Must specify \n"); return 0; } home = get_home_server(listener, argc, argv); if (!home) { return 0; } if (strcmp(argv[2], "alive") == 0) { revive_home_server(home); } else if (strcmp(argv[2], "dead") == 0) { struct timeval now; gettimeofday(&now, NULL); /* we do this WAY too ofetn */ mark_home_server_dead(home, &now); } else { cprintf(listener, "ERROR: Unknown state \"%s\"\n", argv[2]); return 0; } return 1; } static int command_show_home_server_state(rad_listen_t *listener, int argc, char *argv[]) { home_server *home; home = get_home_server(listener, argc, argv); if (!home) { return 0; } switch (home->state) { case HOME_STATE_ALIVE: cprintf(listener, "alive\n"); break; case HOME_STATE_IS_DEAD: cprintf(listener, "dead\n"); break; case HOME_STATE_ZOMBIE: cprintf(listener, "zombie\n"); break; default: cprintf(listener, "unknown\n"); break; } return 1; } #endif /* * For encode/decode stuff */ static int null_socket_dencode(UNUSED rad_listen_t *listener, UNUSED REQUEST *request) { return 0; } static int null_socket_send(UNUSED rad_listen_t *listener, REQUEST *request) { char *output_file; FILE *fp; VALUE_PAIR *vp; output_file = request_data_reference(request, null_socket_send, 0); if (!output_file) { radlog(L_ERR, "WARNING: No output file for injected packet %d", request->number); return 0; } fp = fopen(output_file, "w"); if (!fp) { radlog(L_ERR, "Failed to send injected file to %s: %s", output_file, strerror(errno)); return 0; } if (request->reply->code != 0) { const char *what = "reply"; char buffer[1024]; if (request->reply->code < FR_MAX_PACKET_CODE) { what = fr_packet_codes[request->reply->code]; } fprintf(fp, "%s\n", what); if (debug_flag) { request->radlog(L_DBG, 0, request, "Injected %s packet to host %s port 0 code=%d, id=%d", what, inet_ntop(request->reply->src_ipaddr.af, &request->reply->src_ipaddr.ipaddr, buffer, sizeof(buffer)), request->reply->code, request->reply->id); } for (vp = request->reply->vps; vp != NULL; vp = vp->next) { vp_prints(buffer, sizeof(buffer), vp); fprintf(fp, "%s\n", buffer); if (debug_flag) { request->radlog(L_DBG, 0, request, "\t%s", buffer); } } } fclose(fp); return 0; } static int command_inject_to(rad_listen_t *listener, int argc, char *argv[]) { int port; RAD_LISTEN_TYPE type; fr_command_socket_t *sock = listener->data; fr_ipaddr_t ipaddr; rad_listen_t *found = NULL; if (argc < 1) { cprintf(listener, "ERROR: Must specify [auth/acct]\n"); return 0; } if (strcmp(argv[0], "auth") == 0) { type = RAD_LISTEN_AUTH; } else if (strcmp(argv[0], "acct") == 0) { #ifdef WITH_ACCOUNTING type = RAD_LISTEN_ACCT; #else cprintf(listener, "ERROR: This server was built without accounting support.\n"); return 0; #endif } else { cprintf(listener, "ERROR: Unknown socket type\n"); return 0; } if (argc < 3) { cprintf(listener, "ERROR: No was given\n"); return 0; } /* * FIXME: Look for optional arg 4, and bind interface. */ if (ip_hton(argv[1], AF_UNSPEC, &ipaddr) < 0) { cprintf(listener, "ERROR: Failed parsing IP address; %s\n", fr_strerror()); return 0; } port = atoi(argv[2]); found = listener_find_byipaddr(&ipaddr, port); if (!found) { cprintf(listener, "ERROR: Could not find matching listener\n"); return 0; } sock->inject_listener = found; sock->dst_ipaddr = ipaddr; sock->dst_port = port; return 1; } static int command_inject_from(rad_listen_t *listener, int argc, char *argv[]) { RADCLIENT *client; fr_command_socket_t *sock = listener->data; if (argc < 1) { cprintf(listener, "ERROR: No was given\n"); return 0; } if (!sock->inject_listener) { cprintf(listener, "ERROR: You must specify \"inject to\" before using \"inject from\"\n"); return 0; } sock->src_ipaddr.af = AF_UNSPEC; if (ip_hton(argv[0], AF_UNSPEC, &sock->src_ipaddr) < 0) { cprintf(listener, "ERROR: Failed parsing IP address; %s\n", fr_strerror()); return 0; } client = client_listener_find(sock->inject_listener, &sock->src_ipaddr, 0); if (!client) { cprintf(listener, "ERROR: No such client %s\n", argv[0]); return 0; } sock->inject_client = client; return 1; } static int command_inject_file(rad_listen_t *listener, int argc, char *argv[]) { static int inject_id = 0; int filedone; fr_command_socket_t *sock = listener->data; rad_listen_t *fake; REQUEST *request = NULL; RADIUS_PACKET *packet; VALUE_PAIR *vp; FILE *fp; RAD_REQUEST_FUNP fun = NULL; char buffer[2048]; if (argc < 2) { cprintf(listener, "ERROR: You must specify \n"); return 0; } if (!sock->inject_listener) { cprintf(listener, "ERROR: You must specify \"inject to\" before using \"inject file\"\n"); return 0; } if (!sock->inject_client) { cprintf(listener, "ERROR: You must specify \"inject from\" before using \"inject file\"\n"); return 0; } /* * Output files always go to the logging directory. */ snprintf(buffer, sizeof(buffer), "%s/%s", radlog_dir, argv[1]); fp = fopen(argv[0], "r"); if (!fp ) { cprintf(listener, "ERROR: Failed opening %s: %s\n", argv[0], strerror(errno)); return 0; } vp = readvp2(fp, &filedone, ""); fclose(fp); if (!vp) { cprintf(listener, "ERROR: Failed reading attributes from %s: %s\n", argv[0], fr_strerror()); return 0; } fake = rad_malloc(sizeof(*fake)); memcpy(fake, sock->inject_listener, sizeof(*fake)); /* * Re-write the IO for the listener. */ fake->encode = null_socket_dencode; fake->decode = null_socket_dencode; fake->send = null_socket_send; packet = rad_alloc(0); packet->src_ipaddr = sock->src_ipaddr; packet->src_port = 0; packet->dst_ipaddr = sock->dst_ipaddr; packet->dst_port = sock->dst_port; packet->vps = vp; packet->id = inject_id++; if (fake->type == RAD_LISTEN_AUTH) { packet->code = PW_AUTHENTICATION_REQUEST; fun = rad_authenticate; } else { #ifdef WITH_ACCOUNTING packet->code = PW_ACCOUNTING_REQUEST; fun = rad_accounting; #else cprintf(listener, "ERROR: This server was built without accounting support.\n"); rad_free(&packet); free(fake); return 0; #endif } if (!received_request(fake, packet, &request, sock->inject_client)) { cprintf(listener, "ERROR: Failed to inject request. See log file for details\n"); rad_free(&packet); free(fake); return 0; } /* * Remember what the output file is, and remember to * delete the fake listener when done. */ request_data_add(request, null_socket_send, 0, strdup(buffer), free); request_data_add(request, null_socket_send, 1, fake, free); if (debug_flag) { request->radlog(L_DBG, 0, request, "Injected %s packet from host %s port 0 code=%d, id=%d", fr_packet_codes[packet->code], inet_ntop(packet->src_ipaddr.af, &packet->src_ipaddr.ipaddr, buffer, sizeof(buffer)), packet->code, packet->id); for (vp = packet->vps; vp != NULL; vp = vp->next) { vp_prints(buffer, sizeof(buffer), vp); request->radlog(L_DBG, 0, request, "\t%s", buffer); } } /* * And go process it. */ thread_pool_addrequest(request, fun); return 1; } static fr_command_table_t command_table_inject[] = { { "to", FR_WRITE, "inject to - Inject packets to the destination IP and port.", command_inject_to, NULL }, { "from", FR_WRITE, "inject from - Inject packets as if they came from ", command_inject_from, NULL }, { "file", FR_WRITE, "inject file - Inject packet from input-file>, with results sent to ", command_inject_file, NULL }, { NULL, 0, NULL, NULL, NULL } }; static fr_command_table_t command_table_debug[] = { { "condition", FR_WRITE, "debug condition [condition] - Enable debugging for requests matching [condition]", command_debug_condition, NULL }, { "level", FR_WRITE, "debug level - Set debug level to . Higher is more debugging.", command_debug_level, NULL }, { "file", FR_WRITE, "debug file [filename] - Send all debugging output to [filename]", command_debug_file, NULL }, { NULL, 0, NULL, NULL, NULL } }; static fr_command_table_t command_table_show_debug[] = { { "condition", FR_READ, "show debug condition - Shows current debugging condition.", command_show_debug_condition, NULL }, { "level", FR_READ, "show debug level - Shows current debugging level.", command_show_debug_level, NULL }, { "file", FR_READ, "show debug file - Shows current debugging file.", command_show_debug_file, NULL }, { NULL, 0, NULL, NULL, NULL } }; static fr_command_table_t command_table_show_module[] = { { "config", FR_READ, "show module config - show configuration for given module", command_show_module_config, NULL }, { "flags", FR_READ, "show module flags - show other module properties", command_show_module_flags, NULL }, { "list", FR_READ, "show module list - shows list of loaded modules", command_show_modules, NULL }, { "methods", FR_READ, "show module methods - show sections where may be used", command_show_module_methods, NULL }, { "status", FR_READ, "show module status - show the module status", command_show_module_status, NULL }, { NULL, 0, NULL, NULL, NULL } }; static fr_command_table_t command_table_show_client[] = { { "config", FR_READ, "show client config - show configuration for given client", command_show_client_config, NULL }, { "list", FR_READ, "show client list - shows list of global clients", command_show_clients, NULL }, { NULL, 0, NULL, NULL, NULL } }; #ifdef WITH_PROXY static fr_command_table_t command_table_show_home[] = { { "config", FR_READ, "show home_server config - show configuration for given home server", command_show_home_server_config, NULL }, { "list", FR_READ, "show home_server list - shows list of home servers", command_show_home_servers, NULL }, { "state", FR_READ, "show home_server state - shows state of given home server", command_show_home_server_state, NULL }, { NULL, 0, NULL, NULL, NULL } }; #endif static fr_command_table_t command_table_show[] = { { "client", FR_READ, "show client - do sub-command of client", NULL, command_table_show_client }, { "config", FR_READ, "show config - shows the value of configuration option ", command_show_config, NULL }, { "debug", FR_READ, "show debug - show debug properties", NULL, command_table_show_debug }, #ifdef WITH_PROXY { "home_server", FR_READ, "show home_server - do sub-command of home_server", NULL, command_table_show_home }, #endif { "module", FR_READ, "show module - do sub-command of module", NULL, command_table_show_module }, { "uptime", FR_READ, "show uptime - shows time at which server started", command_uptime, NULL }, { "version", FR_READ, "show version - Prints version of the running server", command_show_version, NULL }, { "xml", FR_READ, "show xml - Prints out configuration as XML", command_show_xml, NULL }, { NULL, 0, NULL, NULL, NULL } }; static int command_set_module_config(rad_listen_t *listener, int argc, char *argv[]) { int i, rcode; CONF_PAIR *cp; CONF_SECTION *cs; module_instance_t *mi; const CONF_PARSER *variables; void *data; if (argc < 3) { cprintf(listener, "ERROR: No module name or variable was given\n"); return 0; } cs = cf_section_find("modules"); if (!cs) return 0; mi = find_module_instance(cs, argv[0], 0); if (!mi) { cprintf(listener, "ERROR: No such module \"%s\"\n", argv[0]); return 0; } if ((mi->entry->module->type & RLM_TYPE_HUP_SAFE) == 0) { cprintf(listener, "ERROR: Cannot change configuration of module as it is cannot be HUP'd.\n"); return 0; } variables = cf_section_parse_table(mi->cs); if (!variables) { cprintf(listener, "ERROR: Cannot find configuration for module\n"); return 0; } rcode = -1; for (i = 0; variables[i].name != NULL; i++) { /* * FIXME: Recurse into sub-types somehow... */ if (variables[i].type == PW_TYPE_SUBSECTION) continue; if (strcmp(variables[i].name, argv[1]) == 0) { rcode = i; break; } } if (rcode < 0) { cprintf(listener, "ERROR: No such variable \"%s\"\n", argv[1]); return 0; } i = rcode; /* just to be safe */ /* * It's not part of the dynamic configuration. The module * needs to re-parse && validate things. */ if (variables[i].data) { cprintf(listener, "ERROR: Variable cannot be dynamically updated\n"); return 0; } data = ((char *) mi->insthandle) + variables[i].offset; cp = cf_pair_find(mi->cs, argv[1]); if (!cp) return 0; /* * Replace the OLD value in the configuration file with * the NEW value. * * FIXME: Parse argv[2] depending on it's data type! * If it's a string, look for leading single/double quotes, * end then call tokenize functions??? */ cf_pair_replace(mi->cs, cp, argv[2]); rcode = cf_item_parse(mi->cs, argv[1], variables[i].type, data, argv[2]); if (rcode < 0) { cprintf(listener, "ERROR: Failed to parse value\n"); return 0; } return 1; /* success */ } extern const FR_NAME_NUMBER mod_rcode_table[]; static int command_set_module_status(rad_listen_t *listener, int argc, char *argv[]) { CONF_SECTION *cs; module_instance_t *mi; if (argc < 2) { cprintf(listener, "ERROR: No module name or status was given\n"); return 0; } cs = cf_section_find("modules"); if (!cs) return 0; mi = find_module_instance(cs, argv[0], 0); if (!mi) { cprintf(listener, "ERROR: No such module \"%s\"\n", argv[0]); return 0; } if (strcmp(argv[1], "alive") == 0) { mi->force = FALSE; } else if (strcmp(argv[1], "dead") == 0) { mi->code = RLM_MODULE_FAIL; mi->force = TRUE; } else { int rcode; rcode = fr_str2int(mod_rcode_table, argv[1], -1); if (rcode < 0) { cprintf(listener, "ERROR: Unknown status \"%s\"\n", argv[1]); return 0; } mi->code = rcode; mi->force = TRUE; } return 1; /* success */ } static int command_print_stats(rad_listen_t *listener, fr_stats_t *stats, int auth) { cprintf(listener, "\trequests\t%u\n", stats->total_requests); cprintf(listener, "\tresponses\t%u\n", stats->total_responses); if (auth) { cprintf(listener, "\taccepts\t\t%u\n", stats->total_access_accepts); cprintf(listener, "\trejects\t\t%u\n", stats->total_access_rejects); cprintf(listener, "\tchallenges\t%u\n", stats->total_access_challenges); } cprintf(listener, "\tdup\t\t%u\n", stats->total_dup_requests); cprintf(listener, "\tinvalid\t\t%u\n", stats->total_invalid_requests); cprintf(listener, "\tmalformed\t%u\n", stats->total_malformed_requests); cprintf(listener, "\tbad_authenticator\t%u\n", stats->total_bad_authenticators); cprintf(listener, "\tdropped\t\t%u\n", stats->total_packets_dropped); cprintf(listener, "\tunknown_types\t%u\n", stats->total_unknown_types); return 1; } #ifdef WITH_DETAIL static FR_NAME_NUMBER state_names[] = { { "unopened", STATE_UNOPENED }, { "unlocked", STATE_UNLOCKED }, { "header", STATE_HEADER }, { "reading", STATE_READING }, { "queued", STATE_QUEUED }, { "running", STATE_RUNNING }, { "no-reply", STATE_NO_REPLY }, { "replied", STATE_REPLIED }, { NULL, 0 } }; static int command_stats_detail(rad_listen_t *listener, int argc, char *argv[]) { rad_listen_t *this; listen_detail_t *data; struct stat buf; if (argc == 0) { cprintf(listener, "ERROR: Must specify \n"); return 0; } data = NULL; for (this = mainconfig.listen; this != NULL; this = this->next) { if (this->type != RAD_LISTEN_DETAIL) continue; data = this->data; if (strcmp(argv[1], data->filename) != 0) continue; break; } if (!data) { cprintf(listener, "ERROR: No detail file listener\n"); return 0; } cprintf(listener, "\tstate\t%s\n", fr_int2str(state_names, data->state, "?")); if ((data->state == STATE_UNOPENED) || (data->state == STATE_UNLOCKED)) { return 1; } /* * Race conditions: file might not exist. */ if (stat(data->filename_work, &buf) < 0) { cprintf(listener, "packets\t0\n"); cprintf(listener, "tries\t0\n"); cprintf(listener, "offset\t0\n"); cprintf(listener, "size\t0\n"); return 1; } cprintf(listener, "packets\t%d\n", data->packets); cprintf(listener, "tries\t%d\n", data->tries); cprintf(listener, "offset\t%u\n", (unsigned int) data->offset); cprintf(listener, "size\t%u\n", (unsigned int) buf.st_size); return 1; } #endif #ifdef WITH_PROXY static int command_stats_home_server(rad_listen_t *listener, int argc, char *argv[]) { home_server *home; if (argc == 0) { cprintf(listener, "ERROR: Must specify [auth/acct] OR \n"); return 0; } if (argc == 1) { #ifdef WITH_ACCOUNTING if (strcmp(argv[0], "acct") == 0) { return command_print_stats(listener, &proxy_acct_stats, 0); } #endif if (strcmp(argv[0], "auth") == 0) { return command_print_stats(listener, &proxy_auth_stats, 1); } cprintf(listener, "ERROR: Should specify [auth/acct]\n"); return 0; } home = get_home_server(listener, argc, argv); if (!home) { return 0; } command_print_stats(listener, &home->stats, (home->type == HOME_TYPE_AUTH)); cprintf(listener, "\toutstanding\t%d\n", home->currently_outstanding); return 1; } #endif static int command_stats_client(rad_listen_t *listener, int argc, char *argv[]) { int auth = TRUE; RADCLIENT *client; if (argc < 1) { cprintf(listener, "ERROR: Must specify [auth/acct]\n"); return 0; } if (strcmp(argv[0], "auth") == 0) { auth = TRUE; } else if (strcmp(argv[0], "acct") == 0) { #ifdef WITH_ACCOUNTING auth = FALSE; #else cprintf(listener, "ERROR: This server was built without accounting support.\n"); return 0; #endif } else { cprintf(listener, "ERROR: Unknown statistics type\n"); return 0; } /* * Global results for all client. */ if (argc == 1) { #ifdef WITH_ACCOUNTING if (!auth) { return command_print_stats(listener, &radius_acct_stats, auth); } #endif return command_print_stats(listener, &radius_auth_stats, auth); } client = get_client(listener, argc - 1, argv + 1); if (!client) { return 0; } #ifdef WITH_ACCOUNTING if (!auth) { return command_print_stats(listener, client->acct, auth); } #endif return command_print_stats(listener, client->auth, auth); } static int command_add_client_file(rad_listen_t *listener, int argc, char *argv[]) { RADCLIENT *c; if (argc < 1) { cprintf(listener, "ERROR: is required\n"); return 0; } /* * Read the file and generate the client. */ c = client_read(argv[0], FALSE, FALSE); if (!c) { cprintf(listener, "ERROR: Unknown error reading client file.\n"); return 0; } if (!client_add(NULL, c)) { cprintf(listener, "ERROR: Unknown error inserting new client.\n"); client_free(c); return 0; } return 1; } static int command_del_client(rad_listen_t *listener, int argc, char *argv[]) { #ifdef WITH_DYNAMIC_CLIENTS RADCLIENT *client; client = get_client(listener, argc, argv); if (!client) return 0; if (!client->dynamic) { cprintf(listener, "ERROR: Client %s was not dynamically defined.\n", argv[0]); return 0; } /* * DON'T delete it. Instead, mark it as "dead now". The * next time we receive a packet for the client, it will * be deleted. * * If we don't receive a packet from it, the client * structure will stick around for a while. Oh well... */ client->lifetime = 1; #else cprintf(listener, "ERROR: Dynamic clients are not supported.\n"); #endif return 1; } static fr_command_table_t command_table_del_client[] = { { "ipaddr", FR_WRITE, "del client ipaddr - Delete a dynamically created client", command_del_client, NULL }, { NULL, 0, NULL, NULL, NULL } }; static fr_command_table_t command_table_del[] = { { "client", FR_WRITE, "del client - Delete client configuration commands", NULL, command_table_del_client }, { NULL, 0, NULL, NULL, NULL } }; static fr_command_table_t command_table_add_client[] = { { "file", FR_WRITE, "add client file - Add new client definition from ", command_add_client_file, NULL }, { NULL, 0, NULL, NULL, NULL } }; static fr_command_table_t command_table_add[] = { { "client", FR_WRITE, "add client - Add client configuration commands", NULL, command_table_add_client }, { NULL, 0, NULL, NULL, NULL } }; #ifdef WITH_PROXY static fr_command_table_t command_table_set_home[] = { { "state", FR_WRITE, "set home_server state [alive|dead] - set state for given home server", command_set_home_server_state, NULL }, { NULL, 0, NULL, NULL, NULL } }; #endif static fr_command_table_t command_table_set_module[] = { { "config", FR_WRITE, "set module config variable value - set configuration for ", command_set_module_config, NULL }, { "status", FR_WRITE, "set module status [alive|...] - set the module status to be alive (operating normally), or force a particular code (ok,fail, etc.)", command_set_module_status, NULL }, { NULL, 0, NULL, NULL, NULL } }; static fr_command_table_t command_table_set[] = { { "module", FR_WRITE, "set module - set module commands", NULL, command_table_set_module }, #ifdef WITH_PROXY { "home_server", FR_WRITE, "set home_server - set home server commands", NULL, command_table_set_home }, #endif { NULL, 0, NULL, NULL, NULL } }; static fr_command_table_t command_table_stats[] = { { "client", FR_READ, "stats client [auth/acct] - show statistics for given client, or for all clients (auth or acct)", command_stats_client, NULL }, #ifdef WITH_PROXY { "home_server", FR_READ, "stats home_server [/auth/acct] - show statistics for given home server (ipaddr and port), or for all home servers (auth or acct)", command_stats_home_server, NULL }, #endif #ifdef WITH_DETAIL { "detail", FR_READ, "stats detail - show statistics for the given detail file", command_stats_detail, NULL }, #endif { NULL, 0, NULL, NULL, NULL } }; static fr_command_table_t command_table[] = { { "add", FR_WRITE, NULL, NULL, command_table_add }, { "debug", FR_WRITE, "debug - debugging commands", NULL, command_table_debug }, { "del", FR_WRITE, NULL, NULL, command_table_del }, { "hup", FR_WRITE, "hup [module] - sends a HUP signal to the server, or optionally to one module", command_hup, NULL }, { "inject", FR_WRITE, "inject - commands to inject packets into a running server", NULL, command_table_inject }, { "reconnect", FR_READ, "reconnect - reconnect to a running server", NULL, NULL }, /* just here for "help" */ { "terminate", FR_WRITE, "terminate - terminates the server, and cause it to exit", command_terminate, NULL }, { "set", FR_WRITE, NULL, NULL, command_table_set }, { "show", FR_READ, NULL, NULL, command_table_show }, { "stats", FR_READ, NULL, NULL, command_table_stats }, { NULL, 0, NULL, NULL, NULL } }; static void command_socket_free(rad_listen_t *this) { fr_command_socket_t *sock = this->data; if (!sock->copy) return; unlink(sock->copy); free(sock->copy); sock->copy = NULL; } /* * Parse the unix domain sockets. * * FIXME: TCP + SSL, after RadSec is in. */ static int command_socket_parse(CONF_SECTION *cs, rad_listen_t *this) { fr_command_socket_t *sock; if (check_config) return 0; sock = this->data; if (cf_section_parse(cs, sock, command_config) < 0) { return -1; } if (!sock->path) { radlog(L_ERR, "Socket name is requird"); return -1; } sock->copy = strdup(sock->path); #if defined(HAVE_GETPEEREID) || defined (SO_PEERCRED) if (sock->uid_name) { struct passwd *pw; pw = getpwnam(sock->uid_name); if (!pw) { radlog(L_ERR, "Failed getting uid for %s: %s", sock->uid_name, strerror(errno)); return -1; } sock->uid = pw->pw_uid; } else { sock->uid = -1; } if (sock->gid_name) { struct group *gr; gr = getgrnam(sock->gid_name); if (!gr) { radlog(L_ERR, "Failed getting gid for %s: %s", sock->gid_name, strerror(errno)); return -1; } sock->gid = gr->gr_gid; } else { sock->gid = -1; } #else /* can't get uid or gid of connecting user */ if (sock->uid_name || sock->gid_name) { radlog(L_ERR, "System does not support uid or gid authentication for sockets"); return -1; } #endif if (!sock->mode_name) { sock->mode = FR_READ; } else { sock->mode = fr_str2int(mode_names, sock->mode_name, 0); if (!sock->mode) { radlog(L_ERR, "Invalid mode name \"%s\"", sock->mode_name); return -1; } } /* * FIXME: check for absolute pathnames? * check for uid/gid on the other end... */ this->fd = fr_server_domain_socket(sock->path); if (this->fd < 0) { return -1; } #if defined(HAVE_GETPEEREID) || defined (SO_PEERCRED) /* * Don't chown it from (possibly) non-root to root. * Do chown it from (possibly) root to non-root. */ if ((sock->uid != -1) || (sock->gid != -1)) { fr_suid_up(); if (fchown(this->fd, sock->uid, sock->gid) < 0) { radlog(L_ERR, "Failed setting ownership of %s: %s", sock->path, strerror(errno)); fr_suid_down(); return -1; } fr_suid_down(); } #endif return 0; } static int command_socket_print(const rad_listen_t *this, char *buffer, size_t bufsize) { fr_command_socket_t *sock = this->data; snprintf(buffer, bufsize, "command file %s", sock->path); return 1; } /* * String split routine. Splits an input string IN PLACE * into pieces, based on spaces. */ static int str2argv(char *str, char **argv, int max_argc) { int argc = 0; size_t len; char buffer[1024]; while (*str) { if (argc >= max_argc) return argc; /* * Chop out comments early. */ if (*str == '#') { *str = '\0'; break; } while ((*str == ' ') || (*str == '\t') || (*str == '\r') || (*str == '\n')) *(str++) = '\0'; if (!*str) return argc; if ((*str == '\'') || (*str == '"')) { char *p = str; FR_TOKEN token; token = gettoken((const char **) &p, buffer, sizeof(buffer)); if ((token != T_SINGLE_QUOTED_STRING) && (token != T_DOUBLE_QUOTED_STRING)) { return -1; } len = strlen(buffer); if (len >= (size_t) (p - str)) { return -1; } memcpy(str, buffer, len + 1); argv[argc] = str; str = p; } else { argv[argc] = str; } argc++; while (*str && (*str != ' ') && (*str != '\t') && (*str != '\r') && (*str != '\n')) str++; } return argc; } static void print_help(rad_listen_t *listener, fr_command_table_t *table, int recursive) { int i; for (i = 0; table[i].command != NULL; i++) { if (table[i].help) { cprintf(listener, "%s\n", table[i].help); } else { cprintf(listener, "%s - do sub-command of %s\n", table[i].command, table[i].command); } if (recursive && table[i].table) { print_help(listener, table[i].table, recursive); } } } #define MAX_ARGV (16) /* * Check if an incoming request is "ok" * * It takes packets, not requests. It sees if the packet looks * OK. If so, it does a number of sanity checks on it. */ static int command_domain_recv(rad_listen_t *listener, UNUSED RAD_REQUEST_FUNP *pfun, UNUSED REQUEST **prequest) { int i, rcode; ssize_t len; int argc; char *my_argv[MAX_ARGV], **argv; fr_command_table_t *table; fr_command_socket_t *co = listener->data; *pfun = NULL; *prequest = NULL; do { ssize_t c; char *p; len = recv(listener->fd, co->buffer + co->offset, sizeof(co->buffer) - co->offset - 1, 0); if (len == 0) goto close_socket; /* clean close */ if (len < 0) { if ((errno == EAGAIN) || (errno == EINTR)) { return 0; } goto close_socket; } /* * CTRL-D */ if ((co->offset == 0) && (co->buffer[0] == 0x04)) { close_socket: command_close_socket(listener); return 0; } /* * See if there are multiple lines in the buffer. */ p = co->buffer + co->offset; rcode = 0; p[len] = '\0'; for (c = 0; c < len; c++) { if ((*p == '\r') || (*p == '\n')) { rcode = 1; *p = '\0'; /* * FIXME: do real buffering... * handling of CTRL-C, etc. */ } else if (rcode) { /* * \r \n followed by ASCII... */ break; } p++; } co->offset += len; /* * Saw CR/LF. Set next element, and exit. */ if (rcode) { co->next = p - co->buffer; break; } if (co->offset >= (ssize_t) (sizeof(co->buffer) - 1)) { radlog(L_ERR, "Line too long!"); goto close_socket; } co->offset++; } while (1); DEBUG("radmin> %s", co->buffer); argc = str2argv(co->buffer, my_argv, MAX_ARGV); if (argc == 0) goto do_next; /* empty strings are OK */ if (argc < 0) { cprintf(listener, "ERROR: Failed parsing command.\n"); goto do_next; } argv = my_argv; for (len = 0; len <= co->offset; len++) { if (co->buffer[len] < 0x20) { co->buffer[len] = '\0'; break; } } /* * Hard-code exit && quit. */ if ((strcmp(argv[0], "exit") == 0) || (strcmp(argv[0], "quit") == 0)) goto close_socket; #if 0 if (!co->user[0]) { if (strcmp(argv[0], "login") != 0) { cprintf(listener, "ERROR: Login required\n"); goto do_next; } if (argc < 3) { cprintf(listener, "ERROR: login \n"); goto do_next; } /* * FIXME: Generate && process fake RADIUS request. */ if ((strcmp(argv[1], "root") == 0) && (strcmp(argv[2], "password") == 0)) { strlcpy(co->user, argv[1], sizeof(co->user)); goto do_next; } cprintf(listener, "ERROR: Login incorrect\n"); goto do_next; } #endif table = command_table; retry: len = 0; for (i = 0; table[i].command != NULL; i++) { if (strcmp(table[i].command, argv[0]) == 0) { /* * Check permissions. */ if (((co->mode & FR_WRITE) == 0) && ((table[i].mode & FR_WRITE) != 0)) { cprintf(listener, "ERROR: You do not have write permission. See \"mode = rw\" in the \"listen\" section for this socket.\n"); goto do_next; } if (table[i].table) { /* * This is the last argument, but * there's a sub-table. Print help. * */ if (argc == 1) { table = table[i].table; goto do_help; } argc--; argv++; table = table[i].table; goto retry; } if ((argc == 2) && (strcmp(argv[1], "?") == 0)) goto do_help; if (!table[i].func) { cprintf(listener, "ERROR: Invalid command\n"); goto do_next; } len = 1; rcode = table[i].func(listener, argc - 1, argv + 1); break; } } /* * No such command */ if (!len) { if ((strcmp(argv[0], "help") == 0) || (strcmp(argv[0], "?") == 0)) { int recursive; do_help: if ((argc > 1) && (strcmp(argv[1], "-r") == 0)) { recursive = TRUE; } else { recursive = FALSE; } print_help(listener, table, recursive); goto do_next; } cprintf(listener, "ERROR: Unknown command \"%s\"\n", argv[0]); } do_next: cprintf(listener, "radmin> "); if (co->next <= co->offset) { co->offset = 0; } else { memmove(co->buffer, co->buffer + co->next, co->offset - co->next); co->offset -= co->next; } return 0; } static int command_domain_accept(rad_listen_t *listener, UNUSED RAD_REQUEST_FUNP *pfun, UNUSED REQUEST **prequest) { int newfd; uint32_t magic; rad_listen_t *this; socklen_t salen; struct sockaddr_storage src; fr_command_socket_t *sock = listener->data; salen = sizeof(src); DEBUG2(" ... new connection request on command socket."); *pfun = NULL; *prequest = NULL; newfd = accept(listener->fd, (struct sockaddr *) &src, &salen); if (newfd < 0) { /* * Non-blocking sockets must handle this. */ if (errno == EWOULDBLOCK) { return 0; } DEBUG2(" ... failed to accept connection."); return 0; } #if defined(HAVE_GETPEEREID) || defined (SO_PEERCRED) /* * Perform user authentication. */ if (sock->uid_name || sock->gid_name) { uid_t uid; gid_t gid; if (getpeereid(newfd, &uid, &gid) < 0) { radlog(L_ERR, "Failed getting peer credentials for %s: %s", sock->path, strerror(errno)); close(newfd); return 0; } /* * Only do UID checking if the caller is * non-root. The superuser can do anything, so * we might as well let them. */ if (uid != 0) do { /* * Allow entry if UID or GID matches. */ if (sock->uid_name && (sock->uid == uid)) break; if (sock->gid_name && (sock->gid == gid)) break; if (sock->uid_name && (sock->uid != uid)) { radlog(L_ERR, "Unauthorized connection to %s from uid %ld", sock->path, (long int) uid); close(newfd); return 0; } if (sock->gid_name && (sock->gid != gid)) { radlog(L_ERR, "Unauthorized connection to %s from gid %ld", sock->path, (long int) gid); close(newfd); return 0; } } while (0); } #endif /* * Write 32-bit magic number && version information. */ magic = htonl(0xf7eead15); if (write(newfd, &magic, 4) < 0) { radlog(L_ERR, "Failed writing initial data to socket: %s", strerror(errno)); close(newfd); return 0; } magic = htonl(1); /* protocol version */ if (write(newfd, &magic, 4) < 0) { radlog(L_ERR, "Failed writing initial data to socket: %s", strerror(errno)); close(newfd); return 0; } /* * Add the new listener. */ this = listen_alloc(listener->type); if (!this) return 0; /* * Copy everything, including the pointer to the socket * information. */ sock = this->data; memcpy(this, listener, sizeof(*this)); this->status = RAD_LISTEN_STATUS_INIT; this->next = NULL; this->data = sock; /* fix it back */ sock->offset = 0; sock->user[0] = '\0'; sock->path = ((fr_command_socket_t *) listener->data)->path; sock->mode = ((fr_command_socket_t *) listener->data)->mode; this->fd = newfd; this->recv = command_domain_recv; /* * Tell the event loop that we have a new FD */ event_new_fd(this); return 0; } /* * Send an authentication response packet */ static int command_domain_send(UNUSED rad_listen_t *listener, UNUSED REQUEST *request) { return 0; } static int command_socket_encode(UNUSED rad_listen_t *listener, UNUSED REQUEST *request) { return 0; } static int command_socket_decode(UNUSED rad_listen_t *listener, UNUSED REQUEST *request) { return 0; } #endif /* WITH_COMMAND_SOCKET */ freeradius-server/src/main/conffile.c000066400000000000000000001664431257552170400202050ustar00rootroot00000000000000/* * conffile.c Read the radiusd.conf file. * * Yep I should learn to use lex & yacc, or at least * write a decent parser. I know how to do that, really :) * miquels@cistron.nl * * Version: $Id$ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2000,2006 The FreeRADIUS server project * Copyright 2000 Miquel van Smoorenburg * Copyright 2000 Alan DeKok */ #include RCSID("$Id$") #include #include #ifdef HAVE_DIRENT_H #include #endif #ifdef HAVE_SYS_STAT_H #include #endif #include typedef enum conf_type { CONF_ITEM_INVALID = 0, CONF_ITEM_PAIR, CONF_ITEM_SECTION, CONF_ITEM_DATA } CONF_ITEM_TYPE; struct conf_item { struct conf_item *next; struct conf_part *parent; int lineno; const char *filename; CONF_ITEM_TYPE type; }; struct conf_pair { CONF_ITEM item; const char *attr; const char *value; FR_TOKEN operator; FR_TOKEN value_type; }; struct conf_part { CONF_ITEM item; const char *name1; const char *name2; struct conf_item *children; struct conf_item *tail; /* for speed */ CONF_SECTION *template; rbtree_t *pair_tree; /* and a partridge.. */ rbtree_t *section_tree; /* no jokes here */ rbtree_t *name2_tree; /* for sections of the same name2 */ rbtree_t *data_tree; void *base; int depth; const CONF_PARSER *variables; }; /* * Internal data that is associated with a configuration section, * so that we don't have to track it separately. */ struct conf_data { CONF_ITEM item; const char *name; int flag; void *data; /* user data */ void (*free)(void *); /* free user data function */ }; static int cf_data_add_internal(CONF_SECTION *cs, const char *name, void *data, void (*data_free)(void *), int flag); static void *cf_data_find_internal(CONF_SECTION *cs, const char *name, int flag); int cf_log_config = 1; int cf_log_modules = 1; /* * Isolate the scary casts in these tiny provably-safe functions */ CONF_PAIR *cf_itemtopair(CONF_ITEM *ci) { if (ci == NULL) return NULL; rad_assert(ci->type == CONF_ITEM_PAIR); return (CONF_PAIR *)ci; } CONF_SECTION *cf_itemtosection(CONF_ITEM *ci) { if (ci == NULL) return NULL; rad_assert(ci->type == CONF_ITEM_SECTION); return (CONF_SECTION *)ci; } CONF_ITEM *cf_pairtoitem(CONF_PAIR *cp) { if (cp == NULL) return NULL; return (CONF_ITEM *)cp; } CONF_ITEM *cf_sectiontoitem(CONF_SECTION *cs) { if (cs == NULL) return NULL; return (CONF_ITEM *)cs; } static CONF_DATA *cf_itemtodata(CONF_ITEM *ci) { if (ci == NULL) return NULL; rad_assert(ci->type == CONF_ITEM_DATA); return (CONF_DATA *)ci; } static CONF_ITEM *cf_datatoitem(CONF_DATA *cd) { if (cd == NULL) return NULL; return (CONF_ITEM *)cd; } /* * Create a new CONF_PAIR */ static CONF_PAIR *cf_pair_alloc(const char *attr, const char *value, FR_TOKEN operator, FR_TOKEN value_type, CONF_SECTION *parent) { char *p; size_t attr_len, value_len = 0; CONF_PAIR *cp; if (!attr) return NULL; attr_len = strlen(attr) + 1; if (value) value_len = strlen(value) + 1; p = rad_malloc(sizeof(*cp) + attr_len + value_len); cp = (CONF_PAIR *) p; memset(cp, 0, sizeof(*cp)); cp->item.type = CONF_ITEM_PAIR; cp->item.parent = parent; p += sizeof(*cp); memcpy(p, attr, attr_len); cp->attr = p; if (value) { p += attr_len; memcpy(p, value, value_len); cp->value = p; } cp->value_type = value_type; cp->operator = operator; return cp; } /* * Free a CONF_PAIR */ void cf_pair_free(CONF_PAIR **cp) { if (!cp || !*cp) return; /* * attr && value are allocated contiguous with cp. */ free((*cp)->item.filename); #ifndef NDEBUG memset(*cp, 0, sizeof(cp)); #endif free(*cp); *cp = NULL; } static void cf_data_free(CONF_DATA **cd) { if (!cd || !*cd) return; /* name is allocated contiguous with cd */ if (!(*cd)->free) { free((*cd)->data); } else { ((*cd)->free)((*cd)->data); } #ifndef NDEBUG memset(*cd, 0, sizeof(cd)); #endif free(*cd); *cd = NULL; } /* * rbtree callback function */ static int pair_cmp(const void *a, const void *b) { const CONF_PAIR *one = a; const CONF_PAIR *two = b; return strcmp(one->attr, two->attr); } /* * rbtree callback function */ static int section_cmp(const void *a, const void *b) { const CONF_SECTION *one = a; const CONF_SECTION *two = b; return strcmp(one->name1, two->name1); } /* * rbtree callback function */ static int name2_cmp(const void *a, const void *b) { const CONF_SECTION *one = a; const CONF_SECTION *two = b; rad_assert(strcmp(one->name1, two->name1) == 0); if (!one->name2 && !two->name2) return 0; if (one->name2 && !two->name2) return -1; if (!one->name2 && two->name2) return +1; return strcmp(one->name2, two->name2); } /* * rbtree callback function */ static int data_cmp(const void *a, const void *b) { int rcode; const CONF_DATA *one = a; const CONF_DATA *two = b; rcode = one->flag - two->flag; if (rcode != 0) return rcode; return strcmp(one->name, two->name); } /* * Free strings we've parsed into data structures. */ void cf_section_parse_free(CONF_SECTION *cs, void *base) { int i; const CONF_PARSER *variables = cs->variables; /* * Don't automatically free the strings if we're being * called from a module. This is also for clients.c, * where client_free() expects to be able to free the * client structure. If we moved everything to key off * of the config files, we might solve some problems... */ if (!variables) return; /* * Free up dynamically allocated string pointers. */ for (i = 0; variables[i].name != NULL; i++) { int type; char **p; type = variables[i].type; if (type == PW_TYPE_SUBSECTION) { CONF_SECTION *subcs; subcs = cf_section_sub_find(cs, variables[i].name); if (!subcs) continue; if (!variables[i].dflt) continue; cf_section_parse_free(subcs, base); continue; } if ((type != PW_TYPE_STRING_PTR) && (type != PW_TYPE_FILENAME)) { continue; } /* * No base struct offset, data must be the pointer. * If data doesn't exist, ignore the entry, there * must be something wrong. */ if (!base) { if (!variables[i].data) { continue; } p = (char **) variables[i].data;; } else if (variables[i].data) { p = (char **) variables[i].data;; } else { p = (char **) (((char *)base) + variables[i].offset); } free(*p); *p = NULL; } cs->variables = NULL; } /* * Free a CONF_SECTION */ void cf_section_free(CONF_SECTION **cs) { CONF_ITEM *ci, *next; if (!cs || !*cs) return; cf_section_parse_free(*cs, (*cs)->base); for (ci = (*cs)->children; ci; ci = next) { next = ci->next; switch (ci->type) { case CONF_ITEM_PAIR: { CONF_PAIR *pair = cf_itemtopair(ci); cf_pair_free(&pair); } break; case CONF_ITEM_SECTION: { CONF_SECTION *section = cf_itemtosection(ci); cf_section_free(§ion); } break; case CONF_ITEM_DATA: { CONF_DATA *data = cf_itemtodata(ci); cf_data_free(&data); } break; default: /* should really be an error. */ break; } } /* * Name1 and name2 are allocated contiguous with * cs. */ if ((*cs)->pair_tree) rbtree_free((*cs)->pair_tree); if ((*cs)->section_tree) rbtree_free((*cs)->section_tree); if ((*cs)->name2_tree) rbtree_free((*cs)->name2_tree); if ((*cs)->data_tree) rbtree_free((*cs)->data_tree); /* * And free the section */ free((*cs)->item.filename); #ifndef NDEBUG memset(*cs, 0, sizeof(cs)); #endif free(*cs); *cs = NULL; } /* * Allocate a CONF_SECTION */ static CONF_SECTION *cf_section_alloc(const char *name1, const char *name2, CONF_SECTION *parent) { size_t name1_len, name2_len = 0; char *p; CONF_SECTION *cs; if (!name1) return NULL; name1_len = strlen(name1) + 1; if (name2) name2_len = strlen(name2) + 1; p = rad_malloc(sizeof(*cs) + name1_len + name2_len); cs = (CONF_SECTION *) p; memset(cs, 0, sizeof(*cs)); cs->item.type = CONF_ITEM_SECTION; cs->item.parent = parent; p += sizeof(*cs); memcpy(p, name1, name1_len); cs->name1 = p; if (name2 && *name2) { p += name1_len; memcpy(p, name2, name2_len); cs->name2 = p; } cs->pair_tree = rbtree_create(pair_cmp, NULL, 0); if (!cs->pair_tree) { cf_section_free(&cs); return NULL; } /* * Don't create a data tree, it may not be needed. */ /* * Don't create the section tree here, it may not * be needed. */ if (parent) cs->depth = parent->depth + 1; return cs; } /* * Replace pair in a given section with a new pair, * of the given value. */ int cf_pair_replace(CONF_SECTION *cs, CONF_PAIR *cp, const char *value) { CONF_PAIR *newp; CONF_ITEM *ci, *cn, **last; newp = cf_pair_alloc(cp->attr, value, cp->operator, cp->value_type, cs); if (!newp) return -1; ci = cf_pairtoitem(cp); cn = cf_pairtoitem(newp); /* * Find the old one from the linked list, and replace it * with the new one. */ for (last = &cs->children; (*last) != NULL; last = &(*last)->next) { if (*last == ci) { cn->next = (*last)->next; *last = cn; ci->next = NULL; break; } } rbtree_deletebydata(cs->pair_tree, ci); rbtree_insert(cs->pair_tree, cn); return 0; } /* * Add an item to a configuration section. */ static void cf_item_add(CONF_SECTION *cs, CONF_ITEM *ci) { if (!cs || !ci) return; if (!cs->children) { rad_assert(cs->tail == NULL); cs->children = ci; } else { rad_assert(cs->tail != NULL); cs->tail->next = ci; } /* * Update the trees (and tail) for each item added. */ for (/* nothing */; ci != NULL; ci = ci->next) { cs->tail = ci; /* * For fast lookups, pair's and sections get * added to rbtree's. */ switch (ci->type) { case CONF_ITEM_PAIR: rbtree_insert(cs->pair_tree, ci); break; case CONF_ITEM_SECTION: { CONF_SECTION *cs_new = cf_itemtosection(ci); if (!cs->section_tree) { cs->section_tree = rbtree_create(section_cmp, NULL, 0); if (!cs->section_tree) { radlog(L_ERR, "Out of memory"); _exit(1); } } rbtree_insert(cs->section_tree, cs_new); /* * Two names: find the named instance. */ { CONF_SECTION *old_cs; /* * Find the FIRST * CONF_SECTION having * the given name1, and * create a new tree * under it. */ old_cs = rbtree_finddata(cs->section_tree, cs_new); if (!old_cs) return; /* this is a bad error! */ if (!old_cs->name2_tree) { old_cs->name2_tree = rbtree_create(name2_cmp, NULL, 0); } if (old_cs->name2_tree) { rbtree_insert(old_cs->name2_tree, cs_new); } } /* had a name2 */ break; } /* was a section */ case CONF_ITEM_DATA: if (!cs->data_tree) { cs->data_tree = rbtree_create(data_cmp, NULL, 0); } if (cs->data_tree) { rbtree_insert(cs->data_tree, ci); } break; default: /* FIXME: assert & error! */ break; } /* switch over conf types */ } /* loop over ci */ } CONF_ITEM *cf_reference_item(const CONF_SECTION *parentcs, CONF_SECTION *outercs, const char *ptr) { CONF_PAIR *cp; CONF_SECTION *next; const CONF_SECTION *cs = outercs; char name[8192]; char *p; if (cs == NULL) goto no_such_item; strlcpy(name, ptr, sizeof(name)); p = name; /* * ".foo" means "foo from the current section" */ if (*p == '.') { p++; /* * ..foo means "foo from the section * enclosing this section" (etc.) */ while (*p == '.') { if (cs->item.parent) cs = cs->item.parent; p++; } /* * "foo.bar.baz" means "from the root" */ } else if (strchr(p, '.') != NULL) { if (!parentcs) goto no_such_item; cs = parentcs; } while (*p) { char *q, *r; r = strchr(p, '['); q = strchr(p, '.'); if (!r && !q) break; if (r && q > r) q = NULL; if (q && q < r) r = NULL; /* * Split off name2. */ if (r) { q = strchr(r + 1, ']'); if (!q) return NULL; /* parse error */ /* * Points to foo[bar]xx: parse error, * it should be foo[bar] or foo[bar].baz */ if (q[1] && q[1] != '.') goto no_such_item; *r = '\0'; *q = '\0'; next = cf_section_sub_find_name2(cs, p, r + 1); *r = '['; *q = ']'; /* * Points to a named instance of a section. */ if (!q[1]) { if (!next) goto no_such_item; return cf_sectiontoitem(next); } q++; /* ensure we skip the ']' and '.' */ } else { *q = '\0'; next = cf_section_sub_find(cs, p); *q = '.'; } if (!next) break; /* it MAY be a pair in this section! */ cs = next; p = q + 1; } if (!*p) goto no_such_item; retry: /* * Find it in the current referenced * section. */ cp = cf_pair_find(cs, p); if (cp) return cf_pairtoitem(cp); next = cf_section_sub_find(cs, p); if (next) return cf_sectiontoitem(next); /* * "foo" is "in the current section, OR in main". */ if ((p == name) && (parentcs != NULL) && (cs != parentcs)) { cs = parentcs; goto retry; } no_such_item: DEBUG2("WARNING: No such configuration item %s", ptr); return NULL; } CONF_SECTION *cf_top_section(CONF_SECTION *cs) { if (!cs) return NULL; while (cs->item.parent != NULL) { cs = cs->item.parent; } return cs; } /* * Expand the variables in an input string. */ static const char *cf_expand_variables(const char *cf, int *lineno, CONF_SECTION *outercs, char *output, size_t outsize, const char *input) { char *p; const char *end, *ptr; const CONF_SECTION *parentcs; char name[8192]; /* * Find the master parent conf section. * We can't use mainconfig.config, because we're in the * process of re-building it, and it isn't set up yet... */ parentcs = cf_top_section(outercs); p = output; ptr = input; while (*ptr) { /* * Ignore anything other than "${" */ if ((*ptr == '$') && (ptr[1] == '{')) { CONF_ITEM *ci; CONF_PAIR *cp; /* * FIXME: Add support for ${foo:-bar}, * like in xlat.c */ /* * Look for trailing '}', and log a * warning for anything that doesn't match, * and exit with a fatal error. */ end = strchr(ptr, '}'); if (end == NULL) { *p = '\0'; radlog(L_INFO, "%s[%d]: Variable expansion missing }", cf, *lineno); return NULL; } ptr += 2; /* * Can't really happen because input lines are * capped at 8k, which is sizeof(name) */ if ((size_t) (end - ptr) >= sizeof(name)) { radlog(L_ERR, "%s[%d]: Reference string is too large", cf, *lineno); return NULL; } memcpy(name, ptr, end - ptr); name[end - ptr] = '\0'; ci = cf_reference_item(parentcs, outercs, name); if (!ci || (ci->type != CONF_ITEM_PAIR)) { radlog(L_ERR, "%s[%d]: Reference \"%s\" not found", cf, *lineno, input); return NULL; } /* * Substitute the value of the variable. */ cp = cf_itemtopair(ci); if (!cp->value) { radlog(L_ERR, "%s[%d]: Reference \"%s\" has no value", cf, *lineno, input); return NULL; } if (p + strlen(cp->value) >= output + outsize) { radlog(L_ERR, "%s[%d]: Reference \"%s\" is too long", cf, *lineno, input); return NULL; } strcpy(p, cp->value); p += strlen(p); ptr = end + 1; } else if (memcmp(ptr, "$ENV{", 5) == 0) { char *env; ptr += 5; /* * Look for trailing '}', and log a * warning for anything that doesn't match, * and exit with a fatal error. */ end = strchr(ptr, '}'); if (end == NULL) { *p = '\0'; radlog(L_INFO, "%s[%d]: Environment variable expansion missing }", cf, *lineno); return NULL; } /* * Can't really happen because input lines are * capped at 8k, which is sizeof(name) */ if ((size_t) (end - ptr) >= sizeof(name)) { radlog(L_ERR, "%s[%d]: Environment variable name is too large", cf, *lineno); return NULL; } memcpy(name, ptr, end - ptr); name[end - ptr] = '\0'; /* * Get the environment variable. * If none exists, then make it an empty string. */ env = getenv(name); if (env == NULL) { *name = '\0'; env = name; } if (p + strlen(env) >= output + outsize) { radlog(L_ERR, "%s[%d]: Reference \"%s\" is too long", cf, *lineno, input); return NULL; } strcpy(p, env); p += strlen(p); ptr = end + 1; } else { /* * Copy it over verbatim. */ *(p++) = *(ptr++); } if (p >= (output + outsize)) { radlog(L_ERR, "%s[%d]: Reference \"%s\" is too long", cf, *lineno, input); return NULL; } } /* loop over all of the input string. */ *p = '\0'; return output; } static const char *parse_spaces = " "; /* * Parses an item (not a CONF_ITEM) into the specified format, * with a default value. * * Returns -1 on error, 0 for correctly parsed, and 1 if the * default value was used. Note that the default value will be * used ONLY if the CONF_PAIR is NULL. */ int cf_item_parse(CONF_SECTION *cs, const char *name, int type, void *data, const char *dflt) { int rcode = 0; char **q; const char *value; fr_ipaddr_t ipaddr; const CONF_PAIR *cp = NULL; int depth; char ipbuf[128]; if (cs) { depth = cs->depth; cp = cf_pair_find(cs, name); } else { depth = 0; } if (cp) { value = cp->value; } else if (!dflt) { return 1; /* nothing to parse, return default value */ } else { rcode = 1; value = dflt; } if (!value) { return 0; } switch (type) { case PW_TYPE_BOOLEAN: /* * Allow yes/no and on/off */ if ((strcasecmp(value, "yes") == 0) || (strcasecmp(value, "on") == 0)) { *(int *)data = 1; } else if ((strcasecmp(value, "no") == 0) || (strcasecmp(value, "off") == 0)) { *(int *)data = 0; } else { *(int *)data = 0; radlog(L_ERR, "Bad value \"%s\" for boolean variable %s", value, name); return -1; } cf_log_info(cs, "%.*s\t%s = %s", depth, parse_spaces, name, value); break; case PW_TYPE_INTEGER: *(int *)data = strtol(value, 0, 0); cf_log_info(cs, "%.*s\t%s = %d", depth, parse_spaces, name, *(int *)data); break; case PW_TYPE_STRING_PTR: q = (char **) data; if (*q != NULL) { free(*q); } /* * Expand variables which haven't already been * expanded automagically when the configuration * file was read. */ if (value == dflt) { char buffer[8192]; int lineno = 0; if (cs) lineno = cs->item.lineno; /* * FIXME: sizeof(buffer)? */ value = cf_expand_variables("", &lineno, cs, buffer, sizeof(buffer), value); if (!value) { cf_log_err(cf_sectiontoitem(cs),"Failed expanding variable %s", name); return -1; } } cf_log_info(cs, "%.*s\t%s = \"%s\"", depth, parse_spaces, name, value ? value : "(null)"); *q = value ? strdup(value) : NULL; break; /* * This is the same as PW_TYPE_STRING_PTR, * except that we also "stat" the file, and * cache the result. */ case PW_TYPE_FILENAME: q = (char **) data; if (*q != NULL) { free(*q); } /* * Expand variables which haven't already been * expanded automagically when the configuration * file was read. */ if ((value == dflt) && cs) { char buffer[8192]; int lineno = 0; /* * FIXME: sizeof(buffer)? */ value = cf_expand_variables("?", &lineno, cs, buffer, sizeof(buffer), value); if (!value) return -1; } cf_log_info(cs, "%.*s\t%s = \"%s\"", depth, parse_spaces, name, value ? value : "(null)"); *q = value ? strdup(value) : NULL; /* * And now we "stat" the file. * * FIXME: This appears to leak memory on exit, * and we don't use this information. So it's * commented out for now. */ if (0 && *q) { struct stat buf; if (stat(*q, &buf) == 0) { time_t *mtime; mtime = rad_malloc(sizeof(*mtime)); *mtime = buf.st_mtime; /* FIXME: error? */ cf_data_add_internal(cs, *q, mtime, free, PW_TYPE_FILENAME); } } break; case PW_TYPE_IPADDR: /* * Allow '*' as any address */ if (strcmp(value, "*") == 0) { *(uint32_t *) data = htonl(INADDR_ANY); cf_log_info(cs, "%.*s\t%s = *", depth, parse_spaces, name); break; } if (ip_hton(value, AF_INET, &ipaddr) < 0) { radlog(L_ERR, "Can't find IP address for host %s", value); return -1; } if (strspn(value, "0123456789.") == strlen(value)) { cf_log_info(cs, "%.*s\t%s = %s", depth, parse_spaces, name, value); } else { cf_log_info(cs, "%.*s\t%s = %s IP address [%s]", depth, parse_spaces, name, value, ip_ntoh(&ipaddr, ipbuf, sizeof(ipbuf))); } *(uint32_t *) data = ipaddr.ipaddr.ip4addr.s_addr; break; case PW_TYPE_IPV6ADDR: if (ip_hton(value, AF_INET6, &ipaddr) < 0) { radlog(L_ERR, "Can't find IPv6 address for host %s", value); return -1; } cf_log_info(cs, "%.*s\t%s = %s IPv6 address [%s]", depth, parse_spaces, name, value, ip_ntoh(&ipaddr, ipbuf, sizeof(ipbuf))); memcpy(data, &ipaddr.ipaddr.ip6addr, sizeof(ipaddr.ipaddr.ip6addr)); break; default: radlog(L_ERR, "type %d not supported yet", type); return -1; } /* switch over variable type */ if (!cp) { CONF_PAIR *cpn; cpn = cf_pair_alloc(name, value, T_OP_SET, T_BARE_WORD, cs); if (!cpn) return -1; cpn->item.filename = strdup(""); cpn->item.lineno = 0; cf_item_add(cs, cf_pairtoitem(cpn)); } return rcode; } /* * A copy of cf_section_parse that initializes pointers before * parsing them. */ static void cf_section_parse_init(CONF_SECTION *cs, void *base, const CONF_PARSER *variables) { int i; void *data; for (i = 0; variables[i].name != NULL; i++) { if (variables[i].type == PW_TYPE_SUBSECTION) { CONF_SECTION *subcs; subcs = cf_section_sub_find(cs, variables[i].name); if (!subcs) continue; if (!variables[i].dflt) continue; cf_section_parse_init(subcs, base, (const CONF_PARSER *) variables[i].dflt); continue; } if ((variables[i].type != PW_TYPE_STRING_PTR) && (variables[i].type != PW_TYPE_FILENAME)) { continue; } if (variables[i].data) { data = variables[i].data; /* prefer this. */ } else if (base) { data = ((char *)base) + variables[i].offset; } else { continue; } *(char **) data = NULL; } /* for all variables in the configuration section */ } /* * Parse a configuration section into user-supplied variables. */ int cf_section_parse(CONF_SECTION *cs, void *base, const CONF_PARSER *variables) { int i; void *data; cs->variables = variables; /* this doesn't hurt anything */ if (!cs->name2) { cf_log_info(cs, "%.*s%s {", cs->depth, parse_spaces, cs->name1); } else { cf_log_info(cs, "%.*s%s %s {", cs->depth, parse_spaces, cs->name1, cs->name2); } cf_section_parse_init(cs, base, variables); /* * Handle the known configuration parameters. */ for (i = 0; variables[i].name != NULL; i++) { /* * Handle subsections specially */ if (variables[i].type == PW_TYPE_SUBSECTION) { CONF_SECTION *subcs; subcs = cf_section_sub_find(cs, variables[i].name); /* * If the configuration section is NOT there, * then ignore it. * * FIXME! This is probably wrong... we should * probably set the items to their default values. */ if (!subcs) continue; if (!variables[i].dflt) { DEBUG2("Internal sanity check 1 failed in cf_section_parse"); goto error; } if (cf_section_parse(subcs, base, (const CONF_PARSER *) variables[i].dflt) < 0) { goto error; } continue; } /* else it's a CONF_PAIR */ if (variables[i].data) { data = variables[i].data; /* prefer this. */ } else if (base) { data = ((char *)base) + variables[i].offset; } else { DEBUG2("Internal sanity check 2 failed in cf_section_parse"); goto error; } /* * Parse the pair we found, or a default value. */ if (cf_item_parse(cs, variables[i].name, variables[i].type, data, variables[i].dflt) < 0) { goto error; } } /* for all variables in the configuration section */ cf_log_info(cs, "%.*s}", cs->depth, parse_spaces); cs->base = base; return 0; error: cf_log_info(cs, "%.*s}", cs->depth, parse_spaces); cf_section_parse_free(cs, base); return -1; } /* * Sanity check the "if" or "elsif", presuming that the first '(' * has already been eaten. * * We're not really parsing it here, just checking if it's mostly * well-formed. */ static int condition_looks_ok(const char **ptr) { int num_braces = 1; int quote = 0; const char *p = *ptr; while (*p) { if (quote) { if (*p == quote) { p++; quote = 0; continue; } if (*p == '\\') { if (!p[1]) { return 0; /* no trailing slash */ } p += 2; continue; } p++; continue; } switch (*p) { case '\\': if (!p[1]) { return 0; /* no trailing slash */ } p += 2; continue; case '(': num_braces++; p++; continue; case ')': if (num_braces == 1) { const char *q = p + 1; /* * Validate that there isn't much * else after the closing brace. */ while ((*q == ' ') || (*q == '\t')) q++; /* * Parse error. */ if (*q != '{') { DEBUG2("Expected open brace '{' after condition at %s", p); return 0; } *ptr = p + 1; /* include the trailing ')' */ return 1; } num_braces--; p++; continue; case '"': case '\'': case '/': case '`': quote = *p; /* FALL-THROUGH */ default: p++; break; } } DEBUG3("Unexpected error"); return 0; } int cf_exclude_file(const char *filename) { int i; size_t len; const char *p = filename; /* * FIXME: Maybe later make this a globally set configuration * variable. But that's low priority. */ static const char *excluded[] = { "rpmsave", "rpmnew", "dpkg-new", "dpkg-dist", "dpkg-old", "bak", NULL }; if (!p || !*p) return TRUE; /* coding error */ if (*p == '.') return TRUE; /* ".", "..", ".foo", ... */ if (*p == '#') return TRUE; /* #foo# */ len = strlen(p); if (p[len - 1] == '~') return TRUE; /* foo~ */ p = strrchr(p, '.'); if (!p) return FALSE; /* just "foo", it's OK */ p++; for (i = 0; excluded[i] != NULL; i++) { if (strcmp(p, excluded[i]) == 0) return TRUE; } return FALSE; } static const char *cf_local_file(CONF_SECTION *cs, const char *local, char *buffer, size_t bufsize) { size_t dirsize; const char *p; CONF_SECTION *parentcs = cf_top_section(cs); p = strrchr(parentcs->item.filename, FR_DIR_SEP); if (!p) return local; dirsize = (p - parentcs->item.filename) + 1; if ((dirsize + strlen(local)) >= bufsize) { return NULL; } memcpy(buffer, parentcs->item.filename, dirsize); strlcpy(buffer + dirsize, local, bufsize - dirsize); return buffer; } static int seen_too_much(const char *filename, int lineno, const char *ptr) { while (*ptr) { if (isspace(*ptr)) { ptr++; continue; } if (*ptr == '#') return FALSE; break; } if (*ptr) { radlog(L_ERR, "%s[%d] Unexpected text %s. See \"man unlang\"", filename, lineno, ptr); return TRUE; } return FALSE; } /* * Read a part of the config file. */ static int cf_section_read(const char *filename, int *lineno, FILE *fp, CONF_SECTION *current) { CONF_SECTION *this, *css; CONF_PAIR *cpn; const char *ptr; const char *value; char buf[8192]; char buf1[8192]; char buf2[8192]; char buf3[8192]; int t1, t2, t3; char *cbuf = buf; size_t len; this = current; /* add items here */ /* * Read, checking for line continuations ('\\' at EOL) */ for (;;) { int at_eof; /* * Get data, and remember if we are at EOF. */ at_eof = (fgets(cbuf, sizeof(buf) - (cbuf - buf), fp) == NULL); (*lineno)++; /* * We read the entire 8k worth of data: complain. * Note that we don't care if the last character * is \n: it's still forbidden. This means that * the maximum allowed length of text is 8k-1, which * should be plenty. */ len = strlen(cbuf); if ((cbuf + len + 1) >= (buf + sizeof(buf))) { radlog(L_ERR, "%s[%d]: Line too long", filename, *lineno); return -1; } /* * Not doing continuations: check for edge * conditions. */ if (cbuf == buf) { if (at_eof) break; ptr = buf; while (*ptr && isspace((int) *ptr)) ptr++; if (!*ptr || (*ptr == '#')) continue; } else if (at_eof || (len == 0)) { radlog(L_ERR, "%s[%d]: Continuation at EOF is illegal", filename, *lineno); return -1; } /* * See if there's a continuation. */ while ((len > 0) && ((cbuf[len - 1] == '\n') || (cbuf[len - 1] == '\r'))) { len--; cbuf[len] = '\0'; } if ((len > 0) && (cbuf[len - 1] == '\\')) { cbuf[len - 1] = '\0'; cbuf += len - 1; continue; } ptr = cbuf = buf; /* * The parser is getting to be evil. */ while ((*ptr == ' ') || (*ptr == '\t')) ptr++; if (((ptr[0] == '%') && (ptr[1] == '{')) || (ptr[0] == '`')) { int hack; if (ptr[0] == '%') { hack = rad_copy_variable(buf1, ptr); } else { hack = rad_copy_string(buf1, ptr); } if (hack < 0) { radlog(L_ERR, "%s[%d]: Invalid expansion: %s", filename, *lineno, ptr); return -1; } t1 = T_BARE_WORD; ptr += hack; t2 = gettoken(&ptr, buf2, sizeof(buf2)); switch (t2) { case T_EOL: case T_HASH: goto do_bare_word; default: radlog(L_ERR, "%s[%d]: Invalid expansion: %s", filename, *lineno, ptr); return -1; } } else { t1 = gettoken(&ptr, buf1, sizeof(buf1)); } /* * The caller eats "name1 name2 {", and calls us * for the data inside of the section. So if we * receive a closing brace, then it must mean the * end of the section. */ if (t1 == T_RCBRACE) { if (this == current) { radlog(L_ERR, "%s[%d]: Too many closing braces", filename, *lineno); return -1; } this = this->item.parent; if (seen_too_much(filename, *lineno, ptr)) return -1; continue; } /* * Allow for $INCLUDE files * * This *SHOULD* work for any level include. * I really really really hate this file. -cparker */ if ((strcasecmp(buf1, "$INCLUDE") == 0) || (strcasecmp(buf1, "$-INCLUDE") == 0)) { int relative = 1; t2 = getword(&ptr, buf2, sizeof(buf2)); if (buf2[0] == '$') relative = 0; value = cf_expand_variables(filename, lineno, this, buf, sizeof(buf), buf2); if (!value) return -1; if (!FR_DIR_IS_RELATIVE(value)) relative = 0; if (relative) { value = cf_local_file(current, value, buf3, sizeof(buf3)); if (!value) { radlog(L_ERR, "%s[%d]: Directories too deep.", filename, *lineno); return -1; } } #ifdef HAVE_DIRENT_H /* * $INCLUDE foo/ * * Include ALL non-"dot" files in the directory. * careful! */ if (value[strlen(value) - 1] == '/') { DIR *dir; struct dirent *dp; struct stat stat_buf; DEBUG2("including files in directory %s", value ); #ifdef S_IWOTH /* * Security checks. */ if (stat(value, &stat_buf) < 0) { radlog(L_ERR, "%s[%d]: Failed reading directory %s: %s", filename, *lineno, value, strerror(errno)); return -1; } if ((stat_buf.st_mode & S_IWOTH) != 0) { radlog(L_ERR|L_CONS, "%s[%d]: Directory %s is globally writable. Refusing to start due to insecure configuration.", filename, *lineno, value); return -1; } #endif dir = opendir(value); if (!dir) { radlog(L_ERR, "%s[%d]: Error reading directory %s: %s", filename, *lineno, value, strerror(errno)); return -1; } /* * Read the directory, ignoring some files. */ while ((dp = readdir(dir)) != NULL) { if (cf_exclude_file(dp->d_name)) continue; snprintf(buf2, sizeof(buf2), "%s%s", value, dp->d_name); if ((stat(buf2, &stat_buf) != 0) || S_ISDIR(stat_buf.st_mode)) continue; /* * Read the file into the current * configuration sectoin. */ if (cf_file_include(buf2, this) < 0) { closedir(dir); return -1; } } closedir(dir); } else #endif { /* it was a normal file */ if (buf1[1] == '-') { struct stat statbuf; if (stat(value, &statbuf) < 0) { DEBUG("WARNING: Not including file %s: %s", value, strerror(errno)); continue; } } if (cf_file_include(value, this) < 0) { return -1; } } continue; } /* we were in an include */ if (strcasecmp(buf1, "$template") == 0) { CONF_ITEM *ci; CONF_SECTION *parentcs, *templatecs; t2 = getword(&ptr, buf2, sizeof(buf2)); parentcs = cf_top_section(current); templatecs = cf_section_sub_find(parentcs, "templates"); if (!templatecs) { radlog(L_ERR, "%s[%d]: No \"templates\" section for reference \"%s\"", filename, *lineno, buf2); return -1; } ci = cf_reference_item(parentcs, templatecs, buf2); if (!ci || (ci->type != CONF_ITEM_SECTION)) { radlog(L_ERR, "%s[%d]: Reference \"%s\" not found", filename, *lineno, buf2); return -1; } if (this->template) { radlog(L_ERR, "%s[%d]: Section already has a template", filename, *lineno); return -1; } this->template = cf_itemtosection(ci); continue; } /* * Ensure that the user can't add CONF_PAIRs * with 'internal' names; */ if (buf1[0] == '_') { radlog(L_ERR, "%s[%d]: Illegal configuration pair name \"%s\"", filename, *lineno, buf1); return -1; } /* * Grab the next token. */ t2 = gettoken(&ptr, buf2, sizeof(buf2)); switch (t2) { case T_EOL: case T_HASH: do_bare_word: t3 = t2; t2 = T_OP_EQ; value = NULL; goto do_set; case T_OP_ADD: case T_OP_CMP_EQ: case T_OP_SUB: case T_OP_LE: case T_OP_GE: case T_OP_CMP_FALSE: if (!this || (strcmp(this->name1, "update") != 0)) { radlog(L_ERR, "%s[%d]: Invalid operator in assignment", filename, *lineno); return -1; } /* FALL-THROUGH */ case T_OP_EQ: case T_OP_SET: t3 = getstring(&ptr, buf3, sizeof(buf3)); if (t3 == T_OP_INVALID) { radlog(L_ERR, "%s[%d]: Parse error: %s", filename, *lineno, fr_strerror()); return -1; } /* * These are not allowed. Print a * helpful error message. */ if ((t3 == T_BACK_QUOTED_STRING) && (!this || (strcmp(this->name1, "update") != 0))) { radlog(L_ERR, "%s[%d]: Syntax error: Invalid string `...` in assignment", filename, *lineno); return -1; } /* * Handle variable substitution via ${foo} */ if ((t3 == T_BARE_WORD) || (t3 == T_DOUBLE_QUOTED_STRING)) { value = cf_expand_variables(filename, lineno, this, buf, sizeof(buf), buf3); if (!value) return -1; } else if ((t3 == T_EOL) || (t3 == T_HASH)) { value = NULL; } else { value = buf3; } /* * Add this CONF_PAIR to our CONF_SECTION */ do_set: cpn = cf_pair_alloc(buf1, value, t2, t3, this); cpn->item.filename = strdup(filename); cpn->item.lineno = *lineno; cf_item_add(this, cf_pairtoitem(cpn)); continue; /* * This horrible code is here to support * if/then/else failover in the * authorize, etc. sections. It makes no * sense anywhere else. */ case T_LBRACE: if ((strcmp(buf1, "if") == 0) || (strcmp(buf1, "elsif") == 0)) { const char *end = ptr; CONF_SECTION *server; if (!condition_looks_ok(&end)) { radlog(L_ERR, "%s[%d]: Parse error in condition at: %s", filename, *lineno, ptr); return -1; } if ((size_t) (end - ptr) >= (sizeof(buf2) - 1)) { radlog(L_ERR, "%s[%d]: Statement too complicated after \"%s\"", filename, *lineno, buf1); return -1; } /* * More sanity checking. This is * getting to be a horrible hack. */ server = this; while (server) { if (strcmp(server->name1, "server") == 0) break; server = server->item.parent; } if (0 && !server) { radlog(L_ERR, "%s[%d]: Processing directives such as \"%s\" cannot be used here.", filename, *lineno, buf1); return -1; } buf2[0] = '('; memcpy(buf2 + 1, ptr, end - ptr); buf2[end - ptr + 1] = '\0'; ptr = end; t2 = T_BARE_WORD; if (gettoken(&ptr, buf3, sizeof(buf3)) != T_LCBRACE) { radlog(L_ERR, "%s[%d]: Expected '{'", filename, *lineno); return -1; } goto section_alloc; } else { radlog(L_ERR, "%s[%d]: Parse error after \"%s\"", filename, *lineno, buf1); return -1; } /* FALL-THROUGH */ /* * No '=', must be a section or sub-section. */ case T_BARE_WORD: case T_DOUBLE_QUOTED_STRING: case T_SINGLE_QUOTED_STRING: t3 = gettoken(&ptr, buf3, sizeof(buf3)); if (t3 != T_LCBRACE) { radlog(L_ERR, "%s[%d]: Expecting section start brace '{' after \"%s %s\"", filename, *lineno, buf1, buf2); return -1; } /* FALL-THROUGH */ case T_LCBRACE: section_alloc: if (seen_too_much(filename, *lineno, ptr)) return -1; css = cf_section_alloc(buf1, t2 == T_LCBRACE ? NULL : buf2, this); if (!css) { radlog(L_ERR, "%s[%d]: Failed allocating memory for section", filename, *lineno); return -1; } cf_item_add(this, cf_sectiontoitem(css)); css->item.filename = strdup(filename); css->item.lineno = *lineno; /* * The current section is now the child section. */ this = css; continue; default: radlog(L_ERR, "%s[%d]: Parse error after \"%s\"", filename, *lineno, buf1); return -1; } } /* * See if EOF was unexpected .. */ if (feof(fp) && (this != current)) { radlog(L_ERR, "%s[%d]: EOF reached without closing brace for section %s starting at line %d", filename, *lineno, cf_section_name1(this), cf_section_lineno(this)); return -1; } return 0; } /* * Include one config file in another. */ int cf_file_include(const char *filename, CONF_SECTION *cs) { FILE *fp; int lineno = 0; struct stat statbuf; time_t *mtime; CONF_DATA *cd; DEBUG2( "including configuration file %s", filename); fp = fopen(filename, "r"); if (!fp) { radlog(L_ERR|L_CONS, "Unable to open file \"%s\": %s", filename, strerror(errno)); return -1; } if (stat(filename, &statbuf) == 0) { #ifdef S_IWOTH if ((statbuf.st_mode & S_IWOTH) != 0) { fclose(fp); radlog(L_ERR|L_CONS, "Configuration file %s is globally writable. Refusing to start due to insecure configuration.", filename); return -1; } #endif #ifdef S_IROTH if (0 && (statbuf.st_mode & S_IROTH) != 0) { fclose(fp); radlog(L_ERR|L_CONS, "Configuration file %s is globally readable. Refusing to start due to insecure configuration.", filename); return -1; } #endif } if (cf_data_find_internal(cs, filename, PW_TYPE_FILENAME)) { fclose(fp); radlog(L_ERR, "Cannot include the same file twice: \"%s\"", filename); return -1; } /* * Add the filename to the section */ mtime = rad_malloc(sizeof(*mtime)); *mtime = statbuf.st_mtime; if (cf_data_add_internal(cs, filename, mtime, free, PW_TYPE_FILENAME) < 0) { fclose(fp); radlog(L_ERR|L_CONS, "Internal error opening file \"%s\"", filename); return -1; } cd = cf_data_find_internal(cs, filename, PW_TYPE_FILENAME); if (!cd) { fclose(fp); radlog(L_ERR|L_CONS, "Internal error opening file \"%s\"", filename); return -1; } if (!cs->item.filename) cs->item.filename = strdup(filename); /* * Read the section. It's OK to have EOF without a * matching close brace. */ if (cf_section_read(cd->name, &lineno, fp, cs) < 0) { fclose(fp); return -1; } fclose(fp); return 0; } /* * Bootstrap a config file. */ CONF_SECTION *cf_file_read(const char *filename) { char *p; CONF_PAIR *cp; CONF_SECTION *cs; cs = cf_section_alloc("main", NULL, NULL); if (!cs) return NULL; cp = cf_pair_alloc("confdir", filename, T_OP_SET, T_BARE_WORD, cs); if (!cp) return NULL; p = strrchr(cp->value, FR_DIR_SEP); if (p) *p = '\0'; cp->item.filename = strdup(""); cp->item.lineno = 0; cf_item_add(cs, cf_pairtoitem(cp)); if (cf_file_include(filename, cs) < 0) { cf_section_free(&cs); return NULL; } return cs; } /* * Return a CONF_PAIR within a CONF_SECTION. */ CONF_PAIR *cf_pair_find(const CONF_SECTION *cs, const char *name) { CONF_ITEM *ci; CONF_PAIR *cp = NULL; if (!cs) return NULL; /* * Find the name in the tree, for speed. */ if (name) { CONF_PAIR mycp; mycp.attr = name; cp = rbtree_finddata(cs->pair_tree, &mycp); } else { /* * Else find the first one that matches */ for (ci = cs->children; ci; ci = ci->next) { if (ci->type == CONF_ITEM_PAIR) { return cf_itemtopair(ci); } } } if (cp || !cs->template) return cp; return cf_pair_find(cs->template, name); } /* * Return the attr of a CONF_PAIR */ const char *cf_pair_attr(CONF_PAIR *pair) { return (pair ? pair->attr : NULL); } /* * Return the value of a CONF_PAIR */ const char *cf_pair_value(CONF_PAIR *pair) { return (pair ? pair->value : NULL); } FR_TOKEN cf_pair_operator(CONF_PAIR *pair) { return (pair ? pair->operator : T_OP_INVALID); } /* * Copied here for error reporting. */ extern void fr_strerror_printf(const char *, ...); /* * Turn a CONF_PAIR into a VALUE_PAIR * For now, ignore the "value_type" field... */ VALUE_PAIR *cf_pairtovp(CONF_PAIR *pair) { VALUE_PAIR *vp; if (!pair) { fr_strerror_printf("Internal error"); return NULL; } if (!pair->value) { fr_strerror_printf("No value given for attribute %s", pair->attr); return NULL; } /* * pairmake handles tags. pairalloc() doesn't. */ vp = pairmake(pair->attr, NULL, pair->operator); if (!vp) { return NULL; } /* * Ignore the value if it's a false comparison. */ if (pair->operator == T_OP_CMP_FALSE) return vp; if (pair->value_type == T_BARE_WORD) { if ((vp->type == PW_TYPE_STRING) && (pair->value[0] == '0') && (pair->value[1] == 'x')) { vp->type = PW_TYPE_OCTETS; } if (!pairparsevalue(vp, pair->value)) { pairfree(&vp); return NULL; } vp->flags.do_xlat = 0; } else if (pair->value_type == T_SINGLE_QUOTED_STRING) { if (!pairparsevalue(vp, pair->value)) { pairfree(&vp); return NULL; } vp->flags.do_xlat = 0; } else { vp->flags.do_xlat = 1; } return vp; } /* * Return the first label of a CONF_SECTION */ const char *cf_section_name1(const CONF_SECTION *cs) { return (cs ? cs->name1 : NULL); } /* * Return the second label of a CONF_SECTION */ const char *cf_section_name2(const CONF_SECTION *cs) { return (cs ? cs->name2 : NULL); } /* * Find a value in a CONF_SECTION */ const char *cf_section_value_find(const CONF_SECTION *cs, const char *attr) { CONF_PAIR *cp; cp = cf_pair_find(cs, attr); return (cp ? cp->value : NULL); } CONF_SECTION *cf_section_find_name2(const CONF_SECTION *section, const char *name1, const char *name2) { const char *their2; CONF_ITEM *ci; if (!section || !name1) return NULL; for (ci = cf_sectiontoitem(section); ci; ci = ci->next) { if (ci->type != CONF_ITEM_SECTION) continue; if (strcmp(cf_itemtosection(ci)->name1, name1) != 0) continue; their2 = cf_itemtosection(ci)->name2; if ((!name2 && !their2) || (name2 && their2 && (strcmp(name2, their2) == 0))) { return cf_itemtosection(ci); } } return NULL; } /* * Return the next pair after a CONF_PAIR * with a certain name (char *attr) If the requested * attr is NULL, any attr matches. */ CONF_PAIR *cf_pair_find_next(const CONF_SECTION *cs, CONF_PAIR *pair, const char *attr) { CONF_ITEM *ci; if (!cs) return NULL; /* * If pair is NULL this must be a first time run * Find the pair with correct name */ if (pair == NULL){ return cf_pair_find(cs, attr); } ci = cf_pairtoitem(pair)->next; for (; ci; ci = ci->next) { if (ci->type != CONF_ITEM_PAIR) continue; if (attr == NULL || strcmp(cf_itemtopair(ci)->attr, attr) == 0) break; } return cf_itemtopair(ci); } /* * Find a CONF_SECTION, or return the root if name is NULL */ CONF_SECTION *cf_section_find(const char *name) { if (name) return cf_section_sub_find(mainconfig.config, name); else return mainconfig.config; } /* * Find a sub-section in a section */ CONF_SECTION *cf_section_sub_find(const CONF_SECTION *cs, const char *name) { CONF_ITEM *ci; if (!name) return NULL; /* can't find an un-named section */ /* * Do the fast lookup if possible. */ if (cs->section_tree) { CONF_SECTION mycs; mycs.name1 = name; mycs.name2 = NULL; return rbtree_finddata(cs->section_tree, &mycs); } for (ci = cs->children; ci; ci = ci->next) { if (ci->type != CONF_ITEM_SECTION) continue; if (strcmp(cf_itemtosection(ci)->name1, name) == 0) break; } return cf_itemtosection(ci); } /* * Find a CONF_SECTION with both names. */ CONF_SECTION *cf_section_sub_find_name2(const CONF_SECTION *cs, const char *name1, const char *name2) { CONF_ITEM *ci; if (!cs) cs = mainconfig.config; if (!cs) return NULL; if (name1) { CONF_SECTION mycs, *master_cs; if (!cs->section_tree) return NULL; mycs.name1 = name1; mycs.name2 = name2; master_cs = rbtree_finddata(cs->section_tree, &mycs); if (!master_cs) return NULL; /* * Look it up in the name2 tree. If it's there, * return it. */ if (master_cs->name2_tree) { CONF_SECTION *subcs; subcs = rbtree_finddata(master_cs->name2_tree, &mycs); if (subcs) return subcs; } /* * We don't insert ourselves into the name2 tree. * So if there's nothing in the name2 tree, maybe * *we* are the answer. */ if (!master_cs->name2 && name2) return NULL; if (master_cs->name2 && !name2) return NULL; if (!master_cs->name2 && !name2) return master_cs; if (strcmp(master_cs->name2, name2) == 0) { return master_cs; } return NULL; } /* * Else do it the old-fashioned way. */ for (ci = cs->children; ci; ci = ci->next) { CONF_SECTION *subcs; if (ci->type != CONF_ITEM_SECTION) continue; subcs = cf_itemtosection(ci); if (!name1) { if (!subcs->name2) { if (strcmp(subcs->name1, name2) == 0) break; } else { if (strcmp(subcs->name2, name2) == 0) break; } continue; /* don't do the string comparisons below */ } if (strcmp(subcs->name1, name1) != 0) continue; if (!subcs->name2 && name2) continue; if (subcs->name2 && !name2) continue; if (!subcs->name2 && !name2) break; if (strcmp(subcs->name2, name2) == 0) break; } return cf_itemtosection(ci); } /* * Return the next subsection after a CONF_SECTION * with a certain name1 (char *name1). If the requested * name1 is NULL, any name1 matches. */ CONF_SECTION *cf_subsection_find_next(CONF_SECTION *section, CONF_SECTION *subsection, const char *name1) { CONF_ITEM *ci; if (!section) return NULL; /* * If subsection is NULL this must be a first time run * Find the subsection with correct name */ if (subsection == NULL){ ci = section->children; } else { ci = cf_sectiontoitem(subsection)->next; } for (; ci; ci = ci->next) { if (ci->type != CONF_ITEM_SECTION) continue; if ((name1 == NULL) || (strcmp(cf_itemtosection(ci)->name1, name1) == 0)) break; } return cf_itemtosection(ci); } /* * Return the next section after a CONF_SECTION * with a certain name1 (char *name1). If the requested * name1 is NULL, any name1 matches. */ CONF_SECTION *cf_section_find_next(CONF_SECTION *section, CONF_SECTION *subsection, const char *name1) { if (!section) return NULL; if (!section->item.parent) return NULL; return cf_subsection_find_next(section->item.parent, subsection, name1); } /* * Return the next item after a CONF_ITEM. */ CONF_ITEM *cf_item_find_next(CONF_SECTION *section, CONF_ITEM *item) { if (!section) return NULL; /* * If item is NULL this must be a first time run * Return the first item */ if (item == NULL) { return section->children; } else { return item->next; } } CONF_SECTION *cf_item_parent(CONF_ITEM *ci) { if (!ci) return NULL; return ci->parent; } int cf_section_lineno(CONF_SECTION *section) { return cf_sectiontoitem(section)->lineno; } const char *cf_pair_filename(CONF_PAIR *pair) { return cf_pairtoitem(pair)->filename; } const char *cf_section_filename(CONF_SECTION *section) { return cf_sectiontoitem(section)->filename; } int cf_pair_lineno(CONF_PAIR *pair) { return cf_pairtoitem(pair)->lineno; } int cf_item_is_section(CONF_ITEM *item) { return item->type == CONF_ITEM_SECTION; } int cf_item_is_pair(CONF_ITEM *item) { return item->type == CONF_ITEM_PAIR; } static CONF_DATA *cf_data_alloc(CONF_SECTION *parent, const char *name, void *data, void (*data_free)(void *)) { char *p; size_t name_len; CONF_DATA *cd; name_len = strlen(name) + 1; p = rad_malloc(sizeof(*cd) + name_len); cd = (CONF_DATA *) p; memset(cd, 0, sizeof(*cd)); cd->item.type = CONF_ITEM_DATA; cd->item.parent = parent; cd->data = data; cd->free = data_free; p += sizeof(*cd); memcpy(p, name, name_len); cd->name = p; return cd; } static void *cf_data_find_internal(CONF_SECTION *cs, const char *name, int flag) { if (!cs || !name) return NULL; /* * Find the name in the tree, for speed. */ if (cs->data_tree) { CONF_DATA mycd; mycd.name = name; mycd.flag = flag; return rbtree_finddata(cs->data_tree, &mycd); } return NULL; } /* * Find data from a particular section. */ void *cf_data_find(CONF_SECTION *cs, const char *name) { CONF_DATA *cd = cf_data_find_internal(cs, name, 0); if (cd) return cd->data; return NULL; } /* * Add named data to a configuration section. */ static int cf_data_add_internal(CONF_SECTION *cs, const char *name, void *data, void (*data_free)(void *), int flag) { CONF_DATA *cd; if (!cs || !name) return -1; /* * Already exists. Can't add it. */ if (cf_data_find_internal(cs, name, flag) != NULL) return -1; cd = cf_data_alloc(cs, name, data, data_free); if (!cd) return -1; cd->flag = flag; cf_item_add(cs, cf_datatoitem(cd)); return 0; } /* * Add named data to a configuration section. */ int cf_data_add(CONF_SECTION *cs, const char *name, void *data, void (*data_free)(void *)) { return cf_data_add_internal(cs, name, data, data_free, 0); } #if 0 /* * Copy CONF_DATA from src to dst */ static void cf_section_copy_data(CONF_SECTION *s, CONF_SECTION *d) { CONF_ITEM *cd, *next, **last; /* * Don't check if s->data_tree is NULL. It's child * sections may have data, even if this section doesn't. */ rad_assert(d->data_tree == NULL); d->data_tree = s->data_tree; s->data_tree = NULL; /* * Walk through src, moving CONF_ITEM_DATA * to dst, by hand. */ last = &(s->children); for (cd = s->children; cd != NULL; cd = next) { next = cd->next; /* * Recursively copy data from child sections. */ if (cd->type == CONF_ITEM_SECTION) { CONF_SECTION *s1, *d1; s1 = cf_itemtosection(cd); d1 = cf_section_sub_find_name2(d, s1->name1, s1->name2); if (d1) { cf_section_copy_data(s1, d1); } last = &(cd->next); continue; } /* * Not conf data, remember last ptr. */ if (cd->type != CONF_ITEM_DATA) { last = &(cd->next); continue; } /* * Remove it from the src list */ *last = cd->next; cd->next = NULL; /* * Add it to the dst list */ if (!d->children) { rad_assert(d->tail == NULL); d->children = cd; } else { rad_assert(d->tail != NULL); d->tail->next = cd; } d->tail = cd; } } /* * For a CONF_DATA element, stat the filename, if necessary. */ static int filename_stat(void *context, void *data) { struct stat buf; CONF_DATA *cd = data; context = context; /* -Wunused */ if (cd->flag != PW_TYPE_FILENAME) return 0; if (stat(cd->name, &buf) < 0) return -1; if (buf.st_mtime != *(time_t *) cd->data) return -1; return 0; } /* * Compare two CONF_SECTIONS. The items MUST be in the same * order. */ static int cf_section_cmp(CONF_SECTION *a, CONF_SECTION *b) { CONF_ITEM *ca = a->children; CONF_ITEM *cb = b->children; while (1) { CONF_PAIR *pa, *pb; /* * Done. Stop. */ if (!ca && !cb) break; /* * Skip CONF_DATA. */ if (ca && ca->type == CONF_ITEM_DATA) { ca = ca->next; continue; } if (cb && cb->type == CONF_ITEM_DATA) { cb = cb->next; continue; } /* * One is smaller than the other. Exit. */ if (!ca || !cb) return 0; if (ca->type != cb->type) return 0; /* * Deal with subsections. */ if (ca->type == CONF_ITEM_SECTION) { CONF_SECTION *sa = cf_itemtosection(ca); CONF_SECTION *sb = cf_itemtosection(cb); if (!cf_section_cmp(sa, sb)) return 0; goto next; } rad_assert(ca->type == CONF_ITEM_PAIR); pa = cf_itemtopair(ca); pb = cf_itemtopair(cb); /* * Different attr and/or value, Exit. */ if ((strcmp(pa->attr, pb->attr) != 0) || (strcmp(pa->value, pb->value) != 0)) return 0; /* * And go to the next element. */ next: ca = ca->next; cb = cb->next; } /* * Walk over the CONF_DATA, stat'ing PW_TYPE_FILENAME. */ if (a->data_tree && (rbtree_walk(a->data_tree, InOrder, filename_stat, NULL) != 0)) { return 0; } /* * They must be the same, say so. */ return 1; } /* * Migrate CONF_DATA from one section to another. */ int cf_section_migrate(CONF_SECTION *dst, CONF_SECTION *src) { CONF_ITEM *ci; CONF_SECTION *s, *d; for (ci = src->children; ci != NULL; ci = ci->next) { if (ci->type != CONF_ITEM_SECTION) continue; s = cf_itemtosection(ci); d = cf_section_sub_find_name2(dst, s->name1, s->name2); if (!d) continue; /* not in new one, don't migrate it */ /* * A section of the same name is in BOTH src & dst, * compare the CONF_PAIR's. If they're all the same, * then copy the CONF_DATA from one to the other. */ if (cf_section_cmp(s, d)) { cf_section_copy_data(s, d); } } return 1; /* rcode means anything? */ } #endif int cf_section_template(CONF_SECTION *cs, CONF_SECTION *template) { if (!cs || !template || cs->template || template->template) return -1; cs->template = template; return 0; } /* * This is here to make the rest of the code easier to read. It * ties conffile.c to log.c, but it means we don't have to * pollute every other function with the knowledge of the * configuration internals. */ void cf_log_err(CONF_ITEM *ci, const char *fmt, ...) { va_list ap; char buffer[256]; va_start(ap, fmt); vsnprintf(buffer, sizeof(buffer), fmt, ap); va_end(ap); radlog(L_ERR, "%s[%d]: %s", ci->filename, ci->lineno, buffer); } void cf_log_info(CONF_SECTION *cs, const char *fmt, ...) { va_list ap; va_start(ap, fmt); if (debug_flag > 1 && cf_log_config && cs) vradlog(L_DBG, fmt, ap); va_end(ap); } /* * Wrapper to simplify the code. */ void cf_log_module(CONF_SECTION *cs, const char *fmt, ...) { va_list ap; char buffer[256]; va_start(ap, fmt); if (debug_flag > 1 && cf_log_modules && cs) { vsnprintf(buffer, sizeof(buffer), fmt, ap); radlog(L_DBG, " Module: %s", buffer); } va_end(ap); } const CONF_PARSER *cf_section_parse_table(CONF_SECTION *cs) { if (!cs) return NULL; return cs->variables; } #if 0 /* * JMG dump_config tries to dump the config structure in a readable format * */ static int dump_config_section(CONF_SECTION *cs, int indent) { CONF_SECTION *scs; CONF_PAIR *cp; CONF_ITEM *ci; /* The DEBUG macro doesn't let me * for(i=0;ichildren; ci; ci = ci->next) { switch (ci->type) { case CONF_ITEM_PAIR: cp=cf_itemtopair(ci); DEBUG("%.*s%s = %s", indent, "\t\t\t\t\t\t\t\t\t\t\t", cp->attr, cp->value); break; case CONF_ITEM_SECTION: scs=cf_itemtosection(ci); DEBUG("%.*s%s %s%s{", indent, "\t\t\t\t\t\t\t\t\t\t\t", scs->name1, scs->name2 ? scs->name2 : "", scs->name2 ? " " : ""); dump_config_section(scs, indent+1); DEBUG("%.*s}", indent, "\t\t\t\t\t\t\t\t\t\t\t"); break; default: /* FIXME: Do more! */ break; } } return 0; } int dump_config(CONF_SECTION *cs) { return dump_config_section(cs, 0); } #endif static const char *cf_pair_print_value(const CONF_PAIR *cp, char *buffer, size_t buflen) { char *p; if (!cp->value) return ""; switch (cp->value_type) { default: case T_BARE_WORD: snprintf(buffer, buflen, "%s", cp->value); break; case T_SINGLE_QUOTED_STRING: snprintf(buffer, buflen, "'%s'", cp->value); break; case T_DOUBLE_QUOTED_STRING: buffer[0] = '"'; fr_print_string(cp->value, strlen(cp->value), buffer + 1, buflen - 3); p = buffer + strlen(buffer); /* yuck... */ p[0] = '"'; p[1] = '\0'; break; } return buffer; } int cf_pair2xml(FILE *fp, const CONF_PAIR *cp) { fprintf(fp, "<%s>", cp->attr); if (cp->value) { char buffer[2048]; char *p = buffer; const char *q = cp->value; while (*q && (p < (buffer + sizeof(buffer) - 1))) { if (q[0] == '&') { memcpy(p, "&", 4); p += 5; } else if (q[0] == '<') { memcpy(p, "<", 4); p += 4; } else if (q[0] == '>') { memcpy(p, ">", 4); p += 4; } else { *(p++) = *q; } q++; } *p = '\0'; fprintf(fp, "%s", buffer); } fprintf(fp, "\n", cp->attr); return 1; } int cf_section2xml(FILE *fp, const CONF_SECTION *cs) { CONF_ITEM *ci, *next; /* * Section header */ fprintf(fp, "<%s>\n", cs->name1); if (cs->name2) { fprintf(fp, "<_name2>%s\n", cs->name2); } /* * Loop over contents. */ for (ci = cs->children; ci; ci = next) { next = ci->next; switch (ci->type) { case CONF_ITEM_PAIR: if (!cf_pair2xml(fp, (CONF_PAIR *) ci)) return 0; break; case CONF_ITEM_SECTION: if (!cf_section2xml(fp, (CONF_SECTION *) ci)) return 0; break; default: /* should really be an error. */ break; } } fprintf(fp, "\n", cs->name1); return 1; /* success */ } int cf_pair2file(FILE *fp, const CONF_PAIR *cp) { char buffer[2048]; fprintf(fp, "\t%s = %s\n", cp->attr, cf_pair_print_value(cp, buffer, sizeof(buffer))); return 1; } int cf_section2file(FILE *fp, const CONF_SECTION *cs) { const CONF_ITEM *ci, *next; /* * Section header */ if (!cs->name2) { fprintf(fp, "%s {\n", cs->name1); } else { fprintf(fp, "%s %s {\n", cs->name1, cs->name2); } /* * Loop over contents. */ for (ci = cs->children; ci; ci = next) { next = ci->next; switch (ci->type) { case CONF_ITEM_PAIR: if (!cf_pair2file(fp, (const CONF_PAIR *) ci)) return 0; break; case CONF_ITEM_SECTION: if (!cf_section2file(fp, (const CONF_SECTION *) ci)) return 0; break; default: /* should really be an error. */ break; } } fprintf(fp, "}\n"); return 1; /* success */ } freeradius-server/src/main/crypt.c000066400000000000000000000040511257552170400175430ustar00rootroot00000000000000/* * crypt.c A thread-safe crypt wrapper * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2000-2006 The FreeRADIUS server project */ #include RCSID("$Id$") #include #ifdef HAVE_CRYPT_H #include #endif #ifdef HAVE_PTHREAD_H #include /* * No pthreads, no mutex. */ static int fr_crypt_init = 0; static pthread_mutex_t fr_crypt_mutex; #endif /* * performs a crypt password check in an thread-safe way. * * returns: 0 -- check succeeded * -1 -- failed to crypt * 1 -- check failed */ int fr_crypt_check(const char *key, const char *crypted) { char *passwd; int cmp = 0; #ifdef HAVE_PTHREAD_H /* * Ensure we're thread-safe, as crypt() isn't. */ if (fr_crypt_init == 0) { pthread_mutex_init(&fr_crypt_mutex, NULL); fr_crypt_init = 1; } pthread_mutex_lock(&fr_crypt_mutex); #endif passwd = crypt(key, crypted); /* * Got something, check it within the lock. This is * faster than copying it to a local buffer, and the * time spent within the lock is critical. */ if (passwd) { cmp = strcmp(crypted, passwd); } #ifdef HAVE_PTHREAD_H pthread_mutex_unlock(&fr_crypt_mutex); #endif /* * Error. */ if (!passwd) { return -1; } /* * OK, return OK. */ if (cmp == 0) { return 0; } /* * Comparison failed. */ return 1; } freeradius-server/src/main/detail.c000066400000000000000000000537371257552170400176630ustar00rootroot00000000000000/* * detail.c Process the detail file * * Version: $Id$ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2007 The FreeRADIUS server project * Copyright 2007 Alan DeKok */ #include RCSID("$Id$") #include #include #include #include #ifdef HAVE_SYS_STAT_H #include #endif #ifdef HAVE_GLOB_H #include #endif #include #ifdef WITH_DETAIL #define USEC (1000000) static FR_NAME_NUMBER state_names[] = { { "unopened", STATE_UNOPENED }, { "unlocked", STATE_UNLOCKED }, { "header", STATE_HEADER }, { "reading", STATE_READING }, { "queued", STATE_QUEUED }, { "running", STATE_RUNNING }, { "no-reply", STATE_NO_REPLY }, { "replied", STATE_REPLIED }, { NULL, 0 } }; /* * If we're limiting outstanding packets, then mark the response * as being sent. */ int detail_send(rad_listen_t *listener, REQUEST *request) { int rtt; struct timeval now; listen_detail_t *data = listener->data; rad_assert(request->listener == listener); rad_assert(listener->send == detail_send); /* * This request timed out. Remember that, and tell the * caller it's OK to read more "detail" file stuff. */ if (request->reply->code == 0) { data->delay_time = data->retry_interval * USEC; data->signal = 1; data->state = STATE_NO_REPLY; RDEBUG("Detail - No response configured for request %d. Will retry in %d seconds", request->number, data->retry_interval); radius_signal_self(RADIUS_SIGNAL_SELF_DETAIL); return 0; } /* * We call gettimeofday a lot. But it should be OK, * because there's nothing else to do. */ gettimeofday(&now, NULL); /* * If we haven't sent a packet in the last second, reset * the RTT. */ now.tv_sec -= 1; if (timercmp(&data->last_packet, &now, <)) { data->has_rtt = FALSE; } now.tv_sec += 1; /* * Only one detail packet may be outstanding at a time, * so it's safe to update some entries in the detail * structure. * * We keep smoothed round trip time (SRTT), but not round * trip timeout (RTO). We use SRTT to calculate a rough * load factor. */ rtt = now.tv_sec - request->received.tv_sec; rtt *= USEC; rtt += now.tv_usec; rtt -= request->received.tv_usec; /* * If we're proxying, the RTT is our processing time, * plus the network delay there and back, plus the time * on the other end to process the packet. Ideally, we * should remove the network delays from the RTT, but we * don't know what they are. * * So, to be safe, we over-estimate the total cost of * processing the packet. */ if (!data->has_rtt) { data->has_rtt = TRUE; data->srtt = rtt; data->rttvar = rtt / 2; } else { data->rttvar -= data->rttvar >> 2; data->rttvar += (data->srtt - rtt); data->srtt -= data->srtt >> 3; data->srtt += rtt >> 3; } /* * Calculate the time we wait before sending the next * packet. * * rtt / (rtt + delay) = load_factor / 100 */ data->delay_time = (data->srtt * (100 - data->load_factor)) / (data->load_factor); /* * Cap delay at 4 packets/s. If the end system can't * handle this, then it's very broken. */ if (data->delay_time > (USEC / 4)) data->delay_time= USEC / 4; RDEBUG3("Received response for request %d. Will read the next packet in %d seconds", request->number, data->delay_time / USEC); data->last_packet = now; data->signal = 1; data->state = STATE_REPLIED; radius_signal_self(RADIUS_SIGNAL_SELF_DETAIL); return 0; } /* * Open the detail file, if we can. * * FIXME: create it, if it's not already there, so that the main * server select() will wake us up if there's anything to read. */ static int detail_open(rad_listen_t *this) { struct stat st; listen_detail_t *data = this->data; char *filename = data->filename; rad_assert(data->state == STATE_UNOPENED); data->delay_time = USEC; /* * Open detail.work first, so we don't lose * accounting packets. It's probably better to * duplicate them than to lose them. * * Note that we're not writing to the file, but * we've got to open it for writing in order to * establish the lock, to prevent rlm_detail from * writing to it. * * This also means that if we're doing globbing, * this file will be read && processed before the * file globbing is done. */ this->fd = open(data->filename_work, O_RDWR); if (this->fd < 0) { DEBUG2("Polling for detail file %s", filename); /* * Try reading the detail file. If it * doesn't exist, we can't do anything. * * Doing the stat will tell us if the file * exists, even if we don't have permissions * to read it. */ if (stat(filename, &st) < 0) { #ifdef HAVE_GLOB_H unsigned int i; int found; time_t chtime; glob_t files; memset(&files, 0, sizeof(files)); if (glob(filename, 0, NULL, &files) != 0) { globfree(&files); return 0; } chtime = 0; found = -1; for (i = 0; i < files.gl_pathc; i++) { if (stat(files.gl_pathv[i], &st) < 0) continue; if ((i == 0) || (st.st_ctime < chtime)) { chtime = st.st_ctime; found = i; } } if (found < 0) { globfree(&files); return 0; } filename = strdup(files.gl_pathv[found]); globfree(&files); #else return 0; #endif } /* * Open it BEFORE we rename it, just to * be safe... */ this->fd = open(filename, O_RDWR); if (this->fd < 0) { radlog(L_ERR, "Detail - Failed to open %s: %s", filename, strerror(errno)); if (filename != data->filename) free(filename); return 0; } /* * Rename detail to detail.work */ DEBUG("Detail - Renaming %s -> %s", filename, data->filename_work); if (rename(filename, data->filename_work) < 0) { if (filename != data->filename) free(filename); close(this->fd); this->fd = -1; return 0; } if (filename != data->filename) free(filename); } /* else detail.work existed, and we opened it */ rad_assert(data->vps == NULL); rad_assert(data->fp == NULL); data->state = STATE_UNLOCKED; data->client_ip.af = AF_UNSPEC; data->timestamp = 0; data->offset = 0; data->packets = 0; data->tries = 0; return 1; } /* * FIXME: add a configuration "exit when done" so that the detail * file reader can be used as a one-off tool to update stuff. * * The time sequence for reading from the detail file is: * * t_0 signalled that the server is idle, and we * can read from the detail file. * * t_rtt the packet has been processed successfully, * wait for t_delay to enforce load factor. * * t_rtt + t_delay wait for signal that the server is idle. * */ int detail_recv(rad_listen_t *listener, RAD_REQUEST_FUNP *pfun, REQUEST **prequest) { char key[256], op[8], value[1024]; VALUE_PAIR *vp, **tail; RADIUS_PACKET *packet; char buffer[2048]; listen_detail_t *data = listener->data; /* * We may be in the main thread. It needs to update the * timers before we try to read from the file again. */ if (data->signal) return 0; switch (data->state) { case STATE_UNOPENED: open_file: rad_assert(listener->fd < 0); if (!detail_open(listener)) return 0; rad_assert(data->state == STATE_UNLOCKED); rad_assert(listener->fd >= 0); /* FALL-THROUGH */ /* * Try to lock fd. If we can't, return. * If we can, continue. This means that * the server doesn't block while waiting * for the lock to open... */ case STATE_UNLOCKED: /* * Note that we do NOT block waiting for * the lock. We've re-named the file * above, so we've already guaranteed * that any *new* detail writer will not * be opening this file. The only * purpose of the lock is to catch a race * condition where the execution * "ping-pongs" between radiusd & * radrelay. */ if (rad_lockfd_nonblock(listener->fd, 0) < 0) { /* * Close the FD. The main loop * will wake up in a second and * try again. */ close(listener->fd); listener->fd = -1; data->state = STATE_UNOPENED; return 0; } data->fp = fdopen(listener->fd, "r"); if (!data->fp) { radlog(L_ERR, "FATAL: Failed to re-open detail file %s: %s", data->filename, strerror(errno)); exit(1); } /* * Look for the header */ data->state = STATE_HEADER; data->delay_time = USEC; data->vps = NULL; /* FALL-THROUGH */ case STATE_HEADER: do_header: data->tries = 0; if (!data->fp) { data->state = STATE_UNOPENED; goto open_file; } { struct stat buf; fstat(listener->fd, &buf); if (((off_t) ftell(data->fp)) == buf.st_size) { goto cleanup; } } /* * End of file. Delete it, and re-set * everything. */ if (feof(data->fp)) { cleanup: DEBUG("Detail - unlinking %s", data->filename_work); unlink(data->filename_work); if (data->fp) fclose(data->fp); data->fp = NULL; listener->fd = -1; data->state = STATE_UNOPENED; rad_assert(data->vps == NULL); if (data->one_shot) { radlog(L_INFO, "Finished reading \"one shot\" detail file - Exiting"); radius_signal_self(RADIUS_SIGNAL_SELF_EXIT); } return 0; } /* * Else go read something. */ break; /* * Read more value-pair's, unless we're * at EOF. In that case, queue whatever * we have. */ case STATE_READING: if (data->fp && !feof(data->fp)) break; data->state = STATE_QUEUED; /* FALL-THROUGH */ case STATE_QUEUED: goto alloc_packet; /* * Periodically check what's going on. * If the request is taking too long, * retry it. */ case STATE_RUNNING: if (time(NULL) < (data->running + data->retry_interval)) { return 0; } DEBUG("No response to detail request. Retrying"); data->state = STATE_NO_REPLY; /* FALL-THROUGH */ /* * If there's no reply, keep * retransmitting the current packet * forever. */ case STATE_NO_REPLY: data->state = STATE_QUEUED; goto alloc_packet; /* * We have a reply. Clean up the old * request, and go read another one. */ case STATE_REPLIED: pairfree(&data->vps); data->state = STATE_HEADER; goto do_header; } tail = &data->vps; while (*tail) tail = &(*tail)->next; /* * Read a header, OR a value-pair. */ while (fgets(buffer, sizeof(buffer), data->fp)) { data->offset = ftell(data->fp); /* for statistics */ /* * Badly formatted file: delete it. * * FIXME: Maybe flag an error? */ if (!strchr(buffer, '\n')) { pairfree(&data->vps); goto cleanup; } /* * We're reading VP's, and got a blank line. * Queue the packet. */ if ((data->state == STATE_READING) && (buffer[0] == '\n')) { data->state = STATE_QUEUED; break; } /* * Look for date/time header, and read VP's if * found. If not, keep reading lines until we * find one. */ if (data->state == STATE_HEADER) { int y; if (sscanf(buffer, "%*s %*s %*d %*d:%*d:%*d %d", &y)) { data->state = STATE_READING; } continue; } /* * We have a full "attribute = value" line. * If it doesn't look reasonable, skip it. * * FIXME: print an error for badly formatted attributes? */ if (sscanf(buffer, "%255s %8s %1023s", key, op, value) != 3) { DEBUG2("WARNING: Skipping badly formatted line %s", buffer); continue; } /* * Should be =, :=, +=, ... */ if (!strchr(op, '=')) continue; /* * Skip non-protocol attributes. */ if (!strcasecmp(key, "Request-Authenticator")) continue; /* * Set the original client IP address, based on * what's in the detail file. * * Hmm... we don't set the server IP address. * or port. Oh well. */ if (!strcasecmp(key, "Client-IP-Address")) { data->client_ip.af = AF_INET; ip_hton(value, AF_INET, &data->client_ip); continue; } /* * The original time at which we received the * packet. We need this to properly calculate * Acct-Delay-Time. */ if (!strcasecmp(key, "Timestamp")) { data->timestamp = atoi(value); vp = paircreate(PW_PACKET_ORIGINAL_TIMESTAMP, PW_TYPE_DATE); if (vp) { vp->vp_date = (uint32_t) data->timestamp; *tail = vp; tail = &(vp->next); } continue; } /* * Read one VP. * * FIXME: do we want to check for non-protocol * attributes like radsqlrelay does? */ vp = NULL; if ((userparse(buffer, &vp) > 0) && (vp != NULL)) { *tail = vp; tail = &(vp->next); } } /* * Some kind of error. * * FIXME: Leave the file in-place, and warn the * administrator? */ if (ferror(data->fp)) goto cleanup; data->tries = 0; data->packets++; /* * Process the packet. */ alloc_packet: data->tries++; /* * The writer doesn't check that the record was * completely written. If the disk is full, this can * result in a truncated record. When that happens, * treat it as EOF. */ if (data->state != STATE_QUEUED) { radlog(L_ERR, "Truncated record: treating it as EOF for detail file %s", data->filename_work); goto cleanup; } /* * We're done reading the file, but we didn't read * anything. Clean up, and don't return anything. */ if (!data->vps) { data->state = STATE_HEADER; if (!data->fp || feof(data->fp)) goto cleanup; return 0; } /* * Allocate the packet. If we fail, it's a serious * problem. */ packet = rad_alloc(1); if (!packet) { radlog(L_ERR, "FATAL: Failed allocating memory for detail"); exit(1); } memset(packet, 0, sizeof(*packet)); packet->sockfd = -1; packet->src_ipaddr.af = AF_INET; packet->src_ipaddr.ipaddr.ip4addr.s_addr = htonl(INADDR_NONE); packet->code = PW_ACCOUNTING_REQUEST; packet->timestamp = time(NULL); /* * Remember where it came from, so that we don't * proxy it to the place it came from... */ if (data->client_ip.af != AF_UNSPEC) { packet->src_ipaddr = data->client_ip; } vp = pairfind(packet->vps, PW_PACKET_SRC_IP_ADDRESS); if (vp) { packet->src_ipaddr.af = AF_INET; packet->src_ipaddr.ipaddr.ip4addr.s_addr = vp->vp_ipaddr; } else { vp = pairfind(packet->vps, PW_PACKET_SRC_IPV6_ADDRESS); if (vp) { packet->src_ipaddr.af = AF_INET6; memcpy(&packet->src_ipaddr.ipaddr.ip6addr, &vp->vp_ipv6addr, sizeof(vp->vp_ipv6addr)); } } vp = pairfind(packet->vps, PW_PACKET_DST_IP_ADDRESS); if (vp) { packet->dst_ipaddr.af = AF_INET; packet->dst_ipaddr.ipaddr.ip4addr.s_addr = vp->vp_ipaddr; } else { vp = pairfind(packet->vps, PW_PACKET_DST_IPV6_ADDRESS); if (vp) { packet->dst_ipaddr.af = AF_INET6; memcpy(&packet->dst_ipaddr.ipaddr.ip6addr, &vp->vp_ipv6addr, sizeof(vp->vp_ipv6addr)); } } /* * We've got to give SOME value for Id & ports, so that * the packets can be added to the request queue. * However, we don't want to keep track of used/unused * id's and ports, as that's a lot of work. This hack * ensures that (if we have real random numbers), that * there will be a collision on every 2^(16+15+15+24 - 1) * packets, on average. That means we can read 2^37 * packets before having a collision, which means it's * effectively impossible. */ packet->id = fr_rand() & 0xffff; packet->src_port = 1024 + (fr_rand() & 0x7fff); packet->dst_port = 1024 + (fr_rand() & 0x7fff); packet->dst_ipaddr.af = AF_INET; packet->dst_ipaddr.ipaddr.ip4addr.s_addr = htonl((INADDR_LOOPBACK & ~0xffffff) | (fr_rand() & 0xffffff)); /* * If everything's OK, this is a waste of memory. * Otherwise, it lets us re-send the original packet * contents, unmolested. */ packet->vps = paircopy(data->vps); /* * Prefer the Event-Timestamp in the packet, if it * exists. That is when the event occurred, whereas the * "Timestamp" field is when we wrote the packet to the * detail file, which could have been much later. */ vp = pairfind(packet->vps, PW_EVENT_TIMESTAMP); if (vp) { data->timestamp = vp->vp_integer; } /* * Look for Acct-Delay-Time, and update * based on Acct-Delay-Time += (time(NULL) - timestamp) */ vp = pairfind(packet->vps, PW_ACCT_DELAY_TIME); if (!vp) { vp = paircreate(PW_ACCT_DELAY_TIME, PW_TYPE_INTEGER); rad_assert(vp != NULL); pairadd(&packet->vps, vp); } if (data->timestamp != 0) { vp->vp_integer += time(NULL) - data->timestamp; } /* * Set the transmission count. */ vp = pairfind(packet->vps, PW_PACKET_TRANSMIT_COUNTER); if (!vp) { vp = paircreate(PW_PACKET_TRANSMIT_COUNTER, PW_TYPE_INTEGER); rad_assert(vp != NULL); pairadd(&packet->vps, vp); } vp->vp_integer = data->tries; *pfun = rad_accounting; if (debug_flag) { fr_printf_log("detail_recv: Read packet from %s\n", data->filename_work); for (vp = packet->vps; vp; vp = vp->next) { debug_pair(vp); } } /* * FIXME: many of these checks may not be necessary when * reading from the detail file. * * Try again later... */ if (!received_request(listener, packet, prequest, &data->detail_client)) { rad_free(&packet); data->state = STATE_NO_REPLY; /* try again later */ return 0; } data->state = STATE_RUNNING; data->running = packet->timestamp; return 1; } /* * Free detail-specific stuff. */ void detail_free(rad_listen_t *this) { listen_detail_t *data = this->data; free(data->filename); data->filename = NULL; pairfree(&data->vps); if (data->fp != NULL) { fclose(data->fp); data->fp = NULL; } } int detail_print(const rad_listen_t *this, char *buffer, size_t bufsize) { if (!this->server) { return snprintf(buffer, bufsize, "%s", ((listen_detail_t *)(this->data))->filename); } return snprintf(buffer, bufsize, "detail file %s as server %s", ((listen_detail_t *)(this->data))->filename, this->server); } /* * Overloaded to return delay times. */ int detail_encode(rad_listen_t *this, UNUSED REQUEST *request) { listen_detail_t *data = this->data; /* * We haven't sent a packet... delay things a bit. */ if (!data->signal) { int delay = (data->poll_interval - 1) * USEC; /* * Add +/- 0.25s of jitter */ delay += (USEC * 3) / 4; delay += fr_rand() % (USEC / 2); DEBUG2("Detail listener %s state %s signalled %d waiting %d.%06d sec", data->filename, fr_int2str(state_names, data->state, "?"), data->signal, (delay / USEC), delay % USEC); return delay; } data->signal = 0; DEBUG2("Detail listener %s state %s signalled %d waiting %d.%06d sec", data->filename, fr_int2str(state_names, data->state, "?"), data->signal, data->delay_time / USEC, data->delay_time % USEC); return data->delay_time; } /* * Overloaded to return "should we fix delay times" */ int detail_decode(rad_listen_t *this, UNUSED REQUEST *request) { listen_detail_t *data = this->data; return data->signal; } static const CONF_PARSER detail_config[] = { { "filename", PW_TYPE_STRING_PTR, offsetof(listen_detail_t, filename), NULL, NULL }, { "load_factor", PW_TYPE_INTEGER, offsetof(listen_detail_t, load_factor), NULL, Stringify(10)}, { "poll_interval", PW_TYPE_INTEGER, offsetof(listen_detail_t, poll_interval), NULL, Stringify(1)}, { "retry_interval", PW_TYPE_INTEGER, offsetof(listen_detail_t, retry_interval), NULL, Stringify(30)}, { "one_shot", PW_TYPE_BOOLEAN, offsetof(listen_detail_t, one_shot), NULL, NULL}, { NULL, -1, 0, NULL, NULL } /* end the list */ }; extern int check_config; /* * Parse a detail section. */ int detail_parse(CONF_SECTION *cs, rad_listen_t *this) { int rcode; listen_detail_t *data; RADCLIENT *client; char buffer[2048]; if (check_config) return 0; if (!this->data) { this->data = rad_malloc(sizeof(*data)); memset(this->data, 0, sizeof(*data)); } data = this->data; rcode = cf_section_parse(cs, data, detail_config); if (rcode < 0) { cf_log_err(cf_sectiontoitem(cs), "Failed parsing listen section"); return -1; } if (!data->filename) { cf_log_err(cf_sectiontoitem(cs), "No detail file specified in listen section"); return -1; } if ((data->load_factor < 1) || (data->load_factor > 100)) { cf_log_err(cf_sectiontoitem(cs), "Load factor must be between 1 and 100"); return -1; } if ((data->poll_interval < 1) || (data->poll_interval > 20)) { cf_log_err(cf_sectiontoitem(cs), "poll_interval must be between 1 and 20"); return -1; } /* * If the filename is a glob, use "detail.work" as the * work file name. */ if ((strchr(data->filename, '*') != NULL) || (strchr(data->filename, '[') != NULL)) { char *p; #ifndef HAVE_GLOB_H radlog(L_INFO, "WARNING: Detail file \"%s\" appears to use file globbing, but it is not supported on this system.", data->filename); #endif strlcpy(buffer, data->filename, sizeof(buffer)); p = strrchr(buffer, FR_DIR_SEP); if (p) { p[1] = '\0'; } else { buffer[0] = '\0'; } strlcat(buffer, "detail.work", sizeof(buffer) - strlen(buffer)); } else { snprintf(buffer, sizeof(buffer), "%s.work", data->filename); } free(data->filename_work); data->filename_work = strdup(buffer); /* FIXME: leaked */ data->vps = NULL; data->fp = NULL; data->state = STATE_UNOPENED; data->delay_time = data->poll_interval * USEC; data->signal = 1; /* * Initialize the fake client. */ client = &data->detail_client; memset(client, 0, sizeof(*client)); client->ipaddr.af = AF_INET; client->ipaddr.ipaddr.ip4addr.s_addr = INADDR_NONE; client->prefix = 0; client->longname = client->shortname = data->filename; client->secret = client->shortname; client->nastype = strdup("none"); return 0; } #endif freeradius-server/src/main/dhcpclient.c000066400000000000000000000233261257552170400205250ustar00rootroot00000000000000/* * dhclient.c General radius packet debug tool. * * Version: $Id$ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2000,2006 The FreeRADIUS server project * Copyright 2000 Miquel van Smoorenburg * Copyright 2010 Alan DeKok */ #include RCSID("$Id$") #include #include #include #include #ifdef WITH_DHCP #include #ifdef HAVE_GETOPT_H # include #endif #include static int success = 0; static int retries = 3; static float timeout = 5; static int server_port = 0; static int packet_code = 0; static fr_ipaddr_t server_ipaddr; static int resend_count = 1; static fr_ipaddr_t client_ipaddr; static int client_port = 0; static int sockfd; static int sleep_time = -1; static RADIUS_PACKET *request = NULL; static RADIUS_PACKET *reply = NULL; #define DHCP_CHADDR_LEN (16) #define DHCP_SNAME_LEN (64) #define DHCP_FILE_LEN (128) #define DHCP_VEND_LEN (308) #define DHCP_OPTION_MAGIC_NUMBER (0x63825363) static void NEVER_RETURNS usage(void) { fprintf(stderr, "Usage: dhclient [options] server[:port] \n"); fprintf(stderr, " One of discover, request, offer\n"); fprintf(stderr, " -c count Send each packet 'count' times.\n"); fprintf(stderr, " -d raddb Set dictionary directory.\n"); fprintf(stderr, " -f file Read packets from file, not stdin.\n"); fprintf(stderr, " -r retries If timeout, retry sending the packet 'retries' times.\n"); fprintf(stderr, " -v Show program version information.\n"); fprintf(stderr, " -x Debugging mode.\n"); exit(1); } /* * Initialize the request. */ static int request_init(const char *filename) { FILE *fp; VALUE_PAIR *vp; int filedone = 0; /* * Determine where to read the VP's from. */ if (filename) { fp = fopen(filename, "r"); if (!fp) { fprintf(stderr, "dhclient: Error opening %s: %s\n", filename, strerror(errno)); return 0; } } else { fp = stdin; } request = rad_alloc(0); /* * Read the VP's. */ request->vps = readvp2(fp, &filedone, "dhclient:"); if (!request->vps) { rad_free(&request); if (fp != stdin) fclose(fp); return 1; } /* * Fix / set various options */ for (vp = request->vps; vp != NULL; vp = vp->next) { switch (vp->attribute) { default: break; /* * Allow it to set the packet type in * the attributes read from the file. */ case PW_PACKET_TYPE: request->code = vp->vp_integer; break; case PW_PACKET_DST_PORT: request->dst_port = (vp->vp_integer & 0xffff); break; case PW_PACKET_DST_IP_ADDRESS: request->dst_ipaddr.af = AF_INET; request->dst_ipaddr.ipaddr.ip4addr.s_addr = vp->vp_ipaddr; break; case PW_PACKET_DST_IPV6_ADDRESS: request->dst_ipaddr.af = AF_INET6; request->dst_ipaddr.ipaddr.ip6addr = vp->vp_ipv6addr; break; case PW_PACKET_SRC_PORT: request->src_port = (vp->vp_integer & 0xffff); break; case PW_PACKET_SRC_IP_ADDRESS: request->src_ipaddr.af = AF_INET; request->src_ipaddr.ipaddr.ip4addr.s_addr = vp->vp_ipaddr; break; case PW_PACKET_SRC_IPV6_ADDRESS: request->src_ipaddr.af = AF_INET6; request->src_ipaddr.ipaddr.ip6addr = vp->vp_ipv6addr; break; } /* switch over the attribute */ } /* loop over the VP's we read in */ if (fp != stdin) fclose(fp); /* * And we're done. */ return 1; } static const char *dhcp_header_names[] = { "DHCP-Opcode", "DHCP-Hardware-Type", "DHCP-Hardware-Address-Length", "DHCP-Hop-Count", "DHCP-Transaction-Id", "DHCP-Number-of-Seconds", "DHCP-Flags", "DHCP-Client-IP-Address", "DHCP-Your-IP-Address", "DHCP-Server-IP-Address", "DHCP-Gateway-IP-Address", "DHCP-Client-Hardware-Address", "DHCP-Server-Host-Name", "DHCP-Boot-Filename", NULL }; static int dhcp_header_sizes[] = { 1, 1, 1, 1, 4, 2, 2, 4, 4, 4, 4, DHCP_CHADDR_LEN, DHCP_SNAME_LEN, DHCP_FILE_LEN }; static void print_hex(RADIUS_PACKET *packet) { int i, j; const uint8_t *p, *a; if (!packet->data) return; if (packet->data_len < 244) { printf("Huh?\n"); return; } printf("----------------------------------------------------------------------\n"); fflush(stdout); p = packet->data; for (i = 0; i < 14; i++) { printf("%s = 0x", dhcp_header_names[i]); for (j = 0; j < dhcp_header_sizes[i]; j++) { printf("%02x", p[j]); } printf("\n"); p += dhcp_header_sizes[i]; } /* * Magic number */ printf("%02x %02x %02x %02x\n", p[0], p[1], p[2], p[3]); p += 4; while (p < (packet->data + packet->data_len)) { if (*p == 0) break; if (*p == 255) break; /* end of options signifier */ if ((p + 2) > (packet->data + packet->data_len)) break; printf("%02x %02x ", p[0], p[1]); a = p + 2; for (i = 0; i < p[1]; i++) { if ((i > 0) && ((i & 0x0f) == 0x00)) printf("\t\t"); printf("%02x ", a[i]); if ((i & 0x0f) == 0x0f) printf("\n"); } if ((p[1] & 0x0f) != 0x00) printf("\n"); p += p[1] + 2; } printf("\n----------------------------------------------------------------------\n"); fflush(stdout); } int main(int argc, char **argv) { char *p; int c; const char *radius_dir = RADDBDIR; const char *filename = NULL; fr_debug_flag = 0; while ((c = getopt(argc, argv, "d:f:hr:t:vx")) != EOF) switch(c) { case 'd': radius_dir = optarg; break; case 'f': filename = optarg; break; case 'r': if (!isdigit((int) *optarg)) usage(); retries = atoi(optarg); if ((retries == 0) || (retries > 1000)) usage(); break; case 't': if (!isdigit((int) *optarg)) usage(); timeout = atof(optarg); break; case 'v': printf("dhclient: $Id$ built on " __DATE__ " at " __TIME__ "\n"); exit(0); break; case 'x': fr_debug_flag++; fr_log_fp = stdout; break; case 'h': default: usage(); break; } argc -= (optind - 1); argv += (optind - 1); if (argc < 2) usage(); if (dict_init(radius_dir, RADIUS_DICTIONARY) < 0) { fr_perror("dhclient"); return 1; } /* * Resolve hostname. */ server_ipaddr.af = AF_INET; if (strcmp(argv[1], "-") != 0) { const char *hostname = argv[1]; const char *portname = argv[1]; char buffer[256]; if (*argv[1] == '[') { /* IPv6 URL encoded */ p = strchr(argv[1], ']'); if ((size_t) (p - argv[1]) >= sizeof(buffer)) { usage(); } memcpy(buffer, argv[1] + 1, p - argv[1] - 1); buffer[p - argv[1] - 1] = '\0'; hostname = buffer; portname = p + 1; } p = strchr(portname, ':'); if (p && (strchr(p + 1, ':') == NULL)) { *p = '\0'; portname = p + 1; } else { portname = NULL; } if (ip_hton(hostname, AF_INET, &server_ipaddr) < 0) { fprintf(stderr, "dhclient: Failed to find IP address for host %s: %s\n", hostname, strerror(errno)); exit(1); } /* * Strip port from hostname if needed. */ if (portname) server_port = atoi(portname); } /* * See what kind of request we want to send. */ if (strcmp(argv[2], "discover") == 0) { if (server_port == 0) server_port = 67; packet_code = PW_DHCP_DISCOVER; } else if (strcmp(argv[2], "request") == 0) { if (server_port == 0) server_port = 67; packet_code = PW_DHCP_REQUEST; } else if (strcmp(argv[2], "offer") == 0) { if (server_port == 0) server_port = 67; packet_code = PW_DHCP_OFFER; } else if (isdigit((int) argv[2][0])) { if (server_port == 0) server_port = 67; packet_code = atoi(argv[2]); } else { fprintf(stderr, "Unknown packet type %s\n", argv[2]); usage(); } request_init(filename); /* * No data read. Die. */ if (!request || !request->vps) { fprintf(stderr, "dhclient: Nothing to send.\n"); exit(1); } request->code = packet_code; /* * Bind to the first specified IP address and port. * This means we ignore later ones. */ if (request->src_ipaddr.af == AF_UNSPEC) { memset(&client_ipaddr, 0, sizeof(client_ipaddr)); client_ipaddr.af = server_ipaddr.af; client_port = 0; } else { client_ipaddr = request->src_ipaddr; client_port = request->src_port; } sockfd = fr_socket(&client_ipaddr, client_port); if (sockfd < 0) { fprintf(stderr, "dhclient: socket: %s\n", fr_strerror()); exit(1); } request->sockfd = sockfd; if (request->src_ipaddr.af == AF_UNSPEC) { request->src_ipaddr = client_ipaddr; request->src_port = client_port; } if (request->dst_ipaddr.af == AF_UNSPEC) { request->dst_ipaddr = server_ipaddr; request->dst_port = server_port; } /* * Encode the packet */ if (fr_dhcp_encode(request) < 0) { fprintf(stderr, "dhclient: failed encoding: %s\n", fr_strerror()); exit(1); } if (fr_debug_flag) print_hex(request); if (fr_dhcp_send(request) < 0) { fprintf(stderr, "dhclient: failed sending: %s\n", strerror(errno)); exit(1); } reply = fr_dhcp_recv(sockfd); if (!reply) { fprintf(stderr, "dhclient: no reply\n"); exit(1); } if (fr_debug_flag) print_hex(reply); if (fr_dhcp_decode(reply) < 0) { fprintf(stderr, "dhclient: failed decoding\n"); return 1; } dict_free(); if (success) return 0; return 1; } #endif /* WITH_DHCP */ freeradius-server/src/main/dhcpd.c000066400000000000000000000512341257552170400174710ustar00rootroot00000000000000/* * dhcp.c DHCP processing. * * Version: $Id$ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2008 The FreeRADIUS server project * Copyright 2008,2011 Alan DeKok */ #ifdef WITH_DHCP /* * Standard sequence: * INADDR_ANY : 68 -> INADDR_BROADCAST : 67 DISCOVER * CLIENT_IP : 68 <- DHCP_SERVER_IP : 67 OFFER * INADDR_ANY : 68 -> INADDR_BROADCAST : 67 REQUEST * CLIENT_IP : 68 <- DHCP_SERVER_IP : 67 ACK * * Relay sequence: * INADDR_ANY : 68 -> INADDR_BROADCAST : 67 DISCOVER * RELAY_IP : 67 -> NEXT_SERVER_IP : 67 DISCOVER * (NEXT_SERVER_IP can be a relay itself) * FIRST_RELAY_IP : 67 <- DHCP_SERVER_IP : 67 OFFER * CLIENT_IP : 68 <- FIRST_RELAY_IP : 67 OFFER * INADDR_ANY : 68 -> INADDR_BROADCAST : 67 REQUEST * RELAY_IP : 67 -> NEXT_SERVER_IP : 67 REQUEST * (NEXT_SERVER_IP can be a relay itself) * FIRST_RELAY_IP : 67 <- DHCP_SERVER_IP : 67 ACK * CLIENT_IP : 68 <- FIRST_RELAY_IP : 67 ACK * * Note: NACK are broadcasted, rest is unicast, unless client asked * for a broadcast */ #ifndef __MINGW32__ #include #endif /* * Same contents as listen_socket_t. */ typedef struct dhcp_socket_t { listen_socket_t lsock; /* * DHCP-specific additions. */ int broadcast; int suppress_responses; RADCLIENT dhcp_client; const char *src_interface; fr_ipaddr_t src_ipaddr; } dhcp_socket_t; #ifdef WITH_UDPFROMTO static int dhcprelay_process_client_request(REQUEST *request) { uint8_t maxhops = 16; VALUE_PAIR *vp, *giaddr; dhcp_socket_t *sock; rad_assert(request->packet->data[0] == 1); /* * Do the forward by ourselves, do not rely on dhcp_socket_send() */ request->reply->code = 0; /* * It's invalid to have giaddr=0 AND a relay option */ giaddr = pairfind(request->packet->vps, DHCP2ATTR(266)); /* DHCP-Gateway-IP-Address */ if ((giaddr && (giaddr->vp_ipaddr == htonl(INADDR_ANY))) && pairfind(request->packet->vps, DHCP2ATTR(82))) { /* DHCP-Relay-Agent-Information */ DEBUG("DHCP: Received packet with giaddr = 0 and containing relay option: Discarding packet\n"); return 1; } /* * RFC 1542 (BOOTP), page 15 * * Drop requests if hop-count > 16 or admin specified another value */ if ((vp = pairfind(request->config_items, DHCP2ATTR(271)))) { /* DHCP-Relay-Max-Hop-Count */ maxhops = vp->vp_integer; } vp = pairfind(request->packet->vps, DHCP2ATTR(259)); /* DHCP-Hop-Count */ rad_assert(vp != NULL); if (vp->vp_integer > maxhops) { DEBUG("DHCP: Number of hops is greater than %d: not relaying\n", maxhops); return 1; } else { /* Increment hop count */ vp->vp_integer++; } sock = request->listener->data; /* * Forward the request to the next server using the * incoming request as a template. */ /* set SRC ipaddr/port to the listener ipaddr/port */ request->packet->src_ipaddr.af = AF_INET; request->packet->src_ipaddr.ipaddr.ip4addr.s_addr = sock->lsock.ipaddr.ipaddr.ip4addr.s_addr; request->packet->src_port = sock->lsock.port; vp = pairfind(request->config_items, DHCP2ATTR(270)); /* DHCP-Relay-To-IP-Address */ rad_assert(vp != NULL); /* set DEST ipaddr/port to the next server ipaddr/port */ request->packet->dst_ipaddr.af = AF_INET; request->packet->dst_ipaddr.ipaddr.ip4addr.s_addr = vp->vp_ipaddr; request->packet->dst_port = sock->lsock.port; if (fr_dhcp_encode(request->packet) < 0) { DEBUG("dhcprelay_process_client_request: ERROR in fr_dhcp_encode\n"); return -1; } return fr_dhcp_send(request->packet); } /* * We've seen a reply from a server. * i.e. we're a relay. */ static int dhcprelay_process_server_reply(REQUEST *request) { VALUE_PAIR *vp, *giaddr; dhcp_socket_t *sock; rad_assert(request->packet->data[0] == 2); /* * Do the forward by ourselves, do not rely on dhcp_socket_send() */ request->reply->code = 0; sock = request->listener->data; /* * Check that packet is for us. */ giaddr = pairfind(request->packet->vps, DHCP2ATTR(266)); /* DHCP-Gateway-IP-Address */ /* --with-udpfromto is needed just for the following test */ if (!giaddr || giaddr->vp_ipaddr != request->packet->dst_ipaddr.ipaddr.ip4addr.s_addr) { DEBUG("DHCP: Packet received from server was not for us (was for 0x%x). Discarding packet", ntohl(request->packet->dst_ipaddr.ipaddr.ip4addr.s_addr)); return 1; } /* set SRC ipaddr/port to the listener ipaddr/port */ request->packet->src_ipaddr.af = AF_INET; request->packet->src_port = sock->lsock.port; /* set DEST ipaddr/port to clientip/68 or broadcast in specific cases */ request->packet->dst_ipaddr.af = AF_INET; /* * We're a relay, and send the reply to giaddr. */ request->reply->dst_ipaddr.ipaddr.ip4addr.s_addr = giaddr->vp_ipaddr; request->reply->dst_port = request->packet->dst_port; /* server port */ if ((request->packet->code == PW_DHCP_NAK) || !sock->src_interface || ((vp = pairfind(request->packet->vps, DHCP2ATTR(262))) /* DHCP-Flags */ && (vp->vp_integer & 0x8000) && ((vp = pairfind(request->packet->vps, DHCP2ATTR(263))) /* DHCP-Client-IP-Address */ && (vp->vp_ipaddr == htonl(INADDR_ANY))))) { /* * RFC 2131, page 23 * * Broadcast on * - DHCPNAK * or * - Broadcast flag is set up and ciaddr == NULL */ RDEBUG("DHCP: response will be broadcast"); request->packet->dst_ipaddr.ipaddr.ip4addr.s_addr = htonl(INADDR_BROADCAST); } else { /* * RFC 2131, page 23 * * Unicast to * - ciaddr if present * otherwise to yiaddr */ if ((vp = pairfind(request->packet->vps, DHCP2ATTR(263))) /* DHCP-Client-IP-Address */ && (vp->vp_ipaddr != htonl(INADDR_ANY))) { request->packet->dst_ipaddr.ipaddr.ip4addr.s_addr = vp->vp_ipaddr; } else { vp = pairfind(request->packet->vps, DHCP2ATTR(264)); /* DHCP-Your-IP-Address */ if (!vp) { DEBUG("DHCP: Failed to find IP Address for request."); return -1; } RDEBUG("DHCP: response will be unicast to your-ip-address"); request->packet->dst_ipaddr.ipaddr.ip4addr.s_addr = vp->vp_ipaddr; /* * When sending a DHCP_OFFER, make sure our ARP table * contains an entry for the client IP address, or else * packet may not be forwarded if it was the first time * the client was requesting an IP address. */ if (request->packet->code == PW_DHCP_OFFER) { VALUE_PAIR *hwvp = pairfind(request->packet->vps, DHCP2ATTR(267)); /* DHCP-Client-Hardware-Address */ if (hwvp == NULL) { DEBUG("DHCP: DHCP_OFFER packet received with " "no Client Hardware Address. Discarding packet"); return 1; } if (fr_dhcp_add_arp_entry(request->packet->sockfd, sock->src_interface, hwvp, vp) < 0) { DEBUG("%s", fr_strerror()); return -1; } } } } if (fr_dhcp_encode(request->packet) < 0) { DEBUG("dhcprelay_process_server_reply: ERROR in fr_dhcp_encode\n"); return -1; } return fr_dhcp_send(request->packet); } #else /* WITH_UDPFROMTO */ static int dhcprelay_process_server_reply(UNUSED REQUEST *request) { DEBUG("WARNING: DHCP Relaying requires the server to be configured with UDPFROMTO"); return -1; } static int dhcprelay_process_client_request(UNUSED REQUEST *request) { DEBUG("WARNING: DHCP Relaying requires the server to be configured with UDPFROMTO"); return -1; } #endif /* WITH_UDPFROMTO */ static const uint32_t attrnums[] = { 57, /* DHCP-DHCP-Maximum-Msg-Size */ 256, /* DHCP-Opcode */ 257, /* DHCP-Hardware-Type */ 258, /* DHCP-Hardware-Address-Length */ 259, /* DHCP-Hop-Count */ 260, /* DHCP-Transaction-Id */ 262, /* DHCP-Flags */ 263, /* DHCP-Client-IP-Address */ 266, /* DHCP-Gateway-IP-Address */ 267 /* DHCP-Client-Hardware-Address */ }; static int dhcp_process(REQUEST *request) { int rcode; unsigned int i; VALUE_PAIR *vp; dhcp_socket_t *sock; /* * If there's a giaddr, save it as the Relay-IP-Address * in the response. That way the later code knows where * to send the reply. */ vp = pairfind(request->packet->vps, DHCP2ATTR(266)); /* DHCP-Gateway-IP-Address */ if (vp && (vp->vp_ipaddr != htonl(INADDR_ANY))) { VALUE_PAIR *relay; /* DHCP-Relay-IP-Address */ relay = radius_paircreate(request, &request->reply->vps, DHCP2ATTR(272), PW_TYPE_IPADDR); if (relay) relay->vp_ipaddr = vp->vp_ipaddr; } vp = pairfind(request->packet->vps, DHCP2ATTR(53)); /* DHCP-Message-Type */ if (vp) { DICT_VALUE *dv = dict_valbyattr(DHCP2ATTR(53), vp->vp_integer); DEBUG("Trying sub-section dhcp %s {...}", dv ? dv->name : ""); rcode = module_post_auth(vp->vp_integer, request); } else { DEBUG("DHCP: Failed to find DHCP-Message-Type in packet!"); rcode = RLM_MODULE_FAIL; } vp = pairfind(request->reply->vps, DHCP2ATTR(53)); /* DHCP-Message-Type */ if (vp) { request->reply->code = vp->vp_integer; if ((request->reply->code != 0) && (request->reply->code < PW_DHCP_OFFSET)) { request->reply->code += PW_DHCP_OFFSET; } } else switch (rcode) { case RLM_MODULE_OK: case RLM_MODULE_UPDATED: if (request->packet->code == PW_DHCP_DISCOVER) { request->reply->code = PW_DHCP_OFFER; break; } else if (request->packet->code == PW_DHCP_REQUEST) { request->reply->code = PW_DHCP_ACK; break; } request->reply->code = PW_DHCP_NAK; break; default: case RLM_MODULE_REJECT: case RLM_MODULE_FAIL: case RLM_MODULE_INVALID: case RLM_MODULE_NOOP: case RLM_MODULE_NOTFOUND: if (request->packet->code == PW_DHCP_DISCOVER) { request->reply->code = 0; /* ignore the packet */ } else { request->reply->code = PW_DHCP_NAK; } break; case RLM_MODULE_HANDLED: request->reply->code = 0; /* ignore the packet */ break; } /* * TODO: Handle 'output' of RLM_MODULE when acting as a * DHCP relay We may want to not forward packets in * certain circumstances. */ /* * Handle requests when acting as a DHCP relay */ vp = pairfind(request->packet->vps, DHCP2ATTR(256)); /* DHCP-Opcode */ if (!vp) { RDEBUG("FAILURE: Someone deleted the DHCP-Opcode!"); return 1; } /* BOOTREPLY received on port 67 (i.e. from a server) */ if (vp->vp_integer == 2) { return dhcprelay_process_server_reply(request); } /* Packet from client, and we have DHCP-Relay-To-IP-Address */ if (pairfind(request->config_items, DHCP2ATTR(270))) { return dhcprelay_process_client_request(request); } /* else it's a packet from a client, without relaying */ rad_assert(vp->vp_integer == 1); /* BOOTREQUEST */ sock = request->listener->data; /* * Handle requests when acting as a DHCP server */ /* * Releases don't get replies. */ if (request->packet->code == PW_DHCP_RELEASE) { request->reply->code = 0; } if (request->reply->code == 0) { return 1; } request->reply->sockfd = request->packet->sockfd; /* * Copy specific fields from packet to reply, if they * don't already exist */ for (i = 0; i < sizeof(attrnums) / sizeof(attrnums[0]); i++) { uint32_t attr = attrnums[i]; if (pairfind(request->reply->vps, DHCP2ATTR(attr))) continue; if ((vp = pairfind(request->packet->vps, DHCP2ATTR(attr)))) { pairadd(&request->reply->vps, paircopyvp(vp)); } } vp = pairfind(request->reply->vps, DHCP2ATTR(256)); /* DHCP-Opcode */ rad_assert(vp != NULL); vp->vp_integer = 2; /* BOOTREPLY */ /* * Prepare the reply packet for sending through dhcp_socket_send() */ request->reply->dst_ipaddr.af = AF_INET; request->reply->src_ipaddr.af = AF_INET; request->reply->src_ipaddr.ipaddr.ip4addr.s_addr = sock->src_ipaddr.ipaddr.ip4addr.s_addr; /* * They didn't set a proper src_ipaddr, but we want to * send the packet with a source IP. If there's a server * identifier, use it. */ if (request->reply->src_ipaddr.ipaddr.ip4addr.s_addr == INADDR_ANY) { vp = pairfind(request->reply->vps, PW_PACKET_SRC_IP_ADDRESS); if (!vp) vp = pairfind(request->reply->vps, DHCP2ATTR(54)); /* DHCP-DHCP-Server-Identifier */ if (vp) { request->reply->src_ipaddr.ipaddr.ip4addr.s_addr = vp->vp_ipaddr; } } request->reply->dst_port = request->packet->src_port; request->reply->src_port = request->packet->dst_port; /* * Answer to client's nearest DHCP relay. * * Which may be different than the giaddr given in the * packet to the client. i.e. the relay may have a * public IP, but the gateway a private one. */ vp = pairfind(request->reply->vps, DHCP2ATTR(272)); /* DHCP-Relay-IP-Address */ if (vp) { RDEBUG("DHCP: Reply will be unicast to giaddr from original packet"); request->reply->dst_ipaddr.ipaddr.ip4addr.s_addr = vp->vp_ipaddr; request->reply->dst_port = request->packet->dst_port; vp = pairfind(request->reply->vps, PW_PACKET_DST_PORT); if (vp) request->reply->dst_port = vp->vp_integer; return 1; } /* * Answer to client's nearest DHCP gateway. In this * case, the client can reach the gateway, as can the * server. * * We also use *our* source port as the destination port. * Gateways are servers, and listen on the server port, * not the client port. */ vp = pairfind(request->reply->vps, DHCP2ATTR(266)); /* DHCP-Gateway-IP-Address */ if (vp && (vp->vp_ipaddr != htonl(INADDR_ANY))) { RDEBUG("DHCP: Reply will be unicast to giaddr"); request->reply->dst_ipaddr.ipaddr.ip4addr.s_addr = vp->vp_ipaddr; request->reply->dst_port = request->packet->dst_port; return 1; } /* * If it's a NAK, or the broadcast flag was set, ond * there's no client-ip-address, send a broadcast. */ if ((request->reply->code == PW_DHCP_NAK) || ((vp = pairfind(request->reply->vps, DHCP2ATTR(262))) && /* DHCP-Flags */ (vp->vp_integer & 0x8000) && ((vp = pairfind(request->reply->vps, DHCP2ATTR(263))) && /* DHCP-Client-IP-Address */ (vp->vp_ipaddr == htonl(INADDR_ANY))))) { /* * RFC 2131, page 23 * * Broadcast on * - DHCPNAK * or * - Broadcast flag is set up and ciaddr == NULL */ RDEBUG("DHCP: Reply will be broadcast"); request->reply->dst_ipaddr.ipaddr.ip4addr.s_addr = htonl(INADDR_BROADCAST); return 1; } /* * RFC 2131, page 23 * * Unicast to ciaddr if present, otherwise to yiaddr. */ if ((vp = pairfind(request->reply->vps, DHCP2ATTR(263))) && /* DHCP-Client-IP-Address */ (vp->vp_ipaddr != htonl(INADDR_ANY))) { RDEBUG("DHCP: Reply will be sent unicast to client-ip-address"); request->reply->dst_ipaddr.ipaddr.ip4addr.s_addr = vp->vp_ipaddr; return 1; } vp = pairfind(request->reply->vps, DHCP2ATTR(264)); /* DHCP-Your-IP-Address */ if (!vp) { DEBUG("DHCP: Failed to find DHCP-Client-IP-Address or DHCP-Your-IP-Address"); DEBUG(" for request; not responding."); /* * There is nowhere to send the response to, so don't bother. */ request->reply->code = 0; return -1; } #ifdef SIOCSARP /* * The system is configured to listen for broadcast * packets, which means we'll need to send unicast * replies, to IPs which haven't yet been assigned. * Therefore, we need to update the ARP table. * * However, they haven't specified a interface. So we * can't update the ARP table. And we must send a * broadcast response. */ if (sock->broadcast && !sock->src_interface) { radlog(L_INFO, "WARNING: You MUST set \"interface\" if you have \"broadcast = yes\""); RDEBUG("DHCP: Reply will be broadcast as no interface was defined"); request->reply->dst_ipaddr.ipaddr.ip4addr.s_addr = htonl(INADDR_BROADCAST); return 1; } RDEBUG("DHCP: Reply will be sent unicast to your-ip-address"); request->reply->dst_ipaddr.ipaddr.ip4addr.s_addr = vp->vp_ipaddr; /* * When sending a DHCP_OFFER, make sure our ARP table * contains an entry for the client IP address. * Otherwise the packet may not be sent to the client, as * the OS has no ARP entry for it. * * This is a cute hack to avoid us having to create a raw * socket to send DHCP packets. */ if (request->reply->code == PW_DHCP_OFFER) { VALUE_PAIR *hwvp = pairfind(request->reply->vps, DHCP2ATTR(267)); /* DHCP-Client-Hardware-Address */ if (!hwvp) return -1; if (fr_dhcp_add_arp_entry(request->reply->sockfd, sock->src_interface, hwvp, vp) < 0) { return -1; } } #else if (request->packet->src_ipaddr.ipaddr.ip4addr.s_addr != ntohl(INADDR_NONE)) { RDEBUG("DHCP: Request will be unicast to the unicast source IP address"); request->reply->dst_ipaddr.ipaddr.ip4addr.s_addr = request->packet->src_ipaddr.ipaddr.ip4addr.s_addr; } else { RDEBUG("DHCP: Reply will be broadcast as this system does not support ARP updates"); request->reply->dst_ipaddr.ipaddr.ip4addr.s_addr = htonl(INADDR_BROADCAST); } #endif return 1; } static int dhcp_socket_parse(CONF_SECTION *cs, rad_listen_t *this) { int rcode; int on = 1; dhcp_socket_t *sock; RADCLIENT *client; CONF_PAIR *cp; rcode = common_socket_parse(cs, this); if (rcode != 0) return rcode; if (check_config) return 0; sock = this->data; if (!sock->lsock.interface) { DEBUG("WARNING: No \"interface\" setting is defined. Only unicast DHCP will work."); } /* * See whether or not we enable broadcast packets. */ cp = cf_pair_find(cs, "broadcast"); if (cp) { const char *value = cf_pair_value(cp); if (value && (strcmp(value, "no") == 0)) { sock->broadcast = 0; } } if (sock->broadcast) { if (setsockopt(this->fd, SOL_SOCKET, SO_BROADCAST, &on, sizeof(on)) < 0) { radlog(L_ERR, "Can't set broadcast option: %s\n", strerror(errno)); return -1; } } if (setsockopt(this->fd, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on)) < 0) { radlog(L_ERR, "Can't set re-use addres option: %s\n", strerror(errno)); return -1; } /* * Undocumented extension for testing without * destroying your network! */ sock->suppress_responses = FALSE; cp = cf_pair_find(cs, "suppress_responses"); if (cp) { rcode = cf_item_parse(cs, "suppress_responses", PW_TYPE_BOOLEAN, &sock->suppress_responses, NULL); if (rcode < 0) return -1; } cp = cf_pair_find(cs, "src_interface"); if (cp) { rcode = cf_item_parse(cs, "src_interface", PW_TYPE_STRING_PTR, &sock->src_interface, NULL); if (rcode < 0) return -1; } else { sock->src_interface = sock->lsock.interface; } if (!sock->src_interface && sock->lsock.interface) { sock->src_interface = strdup(sock->lsock.interface); } cp = cf_pair_find(cs, "src_ipaddr"); if (cp) { memset(&sock->src_ipaddr, 0, sizeof(sock->src_ipaddr)); sock->src_ipaddr.ipaddr.ip4addr.s_addr = htonl(INADDR_NONE); rcode = cf_item_parse(cs, "src_ipaddr", PW_TYPE_IPADDR, &sock->src_ipaddr.ipaddr.ip4addr, NULL); if (rcode < 0) return -1; sock->src_ipaddr.af = AF_INET; } else { memcpy(&sock->src_ipaddr, &sock->lsock.ipaddr, sizeof(sock->src_ipaddr)); } /* * Initialize the fake client. */ client = &sock->dhcp_client; memset(client, 0, sizeof(*client)); client->ipaddr.af = AF_INET; client->ipaddr.ipaddr.ip4addr.s_addr = INADDR_NONE; client->prefix = 0; client->longname = client->shortname = "dhcp"; client->secret = client->shortname; client->nastype = strdup("none"); return 0; } /* * Check if an incoming request is "ok" * * It takes packets, not requests. It sees if the packet looks * OK. If so, it does a number of sanity checks on it. */ static int dhcp_socket_recv(rad_listen_t *listener, RAD_REQUEST_FUNP *pfun, REQUEST **prequest) { RADIUS_PACKET *packet; dhcp_socket_t *sock; packet = fr_dhcp_recv(listener->fd); if (!packet) { radlog(L_ERR, "%s", fr_strerror()); return 0; } sock = listener->data; if (!received_request(listener, packet, prequest, &sock->dhcp_client)) { rad_free(&packet); return 0; } *pfun = dhcp_process; return 1; } /* * Send an authentication response packet */ static int dhcp_socket_send(rad_listen_t *listener, REQUEST *request) { dhcp_socket_t *sock; rad_assert(request->listener == listener); rad_assert(listener->send == dhcp_socket_send); if (request->reply->code == 0) return 0; /* don't reply */ if (fr_dhcp_encode(request->reply) < 0) { DEBUG("dhcp_socket_send: ERROR\n"); return -1; } sock = listener->data; if (sock->suppress_responses) return 0; return fr_dhcp_send(request->reply); } static int dhcp_socket_encode(UNUSED rad_listen_t *listener, UNUSED REQUEST *request) { DEBUG2("NO ENCODE!"); return 0; } static int dhcp_socket_decode(UNUSED rad_listen_t *listener, REQUEST *request) { return fr_dhcp_decode(request->packet); } #endif /* WITH_DCHP */ freeradius-server/src/main/evaluate.c000066400000000000000000000724441257552170400202230ustar00rootroot00000000000000/* * evaluate.c Evaluate complex conditions * * Version: $Id$ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2007 The FreeRADIUS server project * Copyright 2007 Alan DeKok */ #include RCSID("$Id$") #include #include #include #include #ifdef HAVE_REGEX_H #include /* * For POSIX Regular expressions. * (0) Means no extended regular expressions. * REG_EXTENDED means use extended regular expressions. */ #ifndef REG_EXTENDED #define REG_EXTENDED (0) #endif #ifndef REG_NOSUB #define REG_NOSUB (0) #endif #endif #ifdef WITH_UNLANG static int all_digits(const char *string) { const char *p = string; if (*p == '-') p++; while (isdigit((int) *p)) p++; return (*p == '\0'); } static const char *filler = "????????????????????????????????????????????????????????????????"; static const char *expand_string(char *buffer, size_t sizeof_buffer, REQUEST *request, FR_TOKEN value_type, const char *value) { int result; char *p; switch (value_type) { default: case T_BARE_WORD: case T_SINGLE_QUOTED_STRING: return value; case T_BACK_QUOTED_STRING: result = radius_exec_program(value, request, 1, buffer, sizeof_buffer, EXEC_TIMEOUT, NULL, NULL, 0); if (result != 0) { radlog(L_ERR, "Failed to execute program in string expansion: %s", value); return NULL; } /* * The result should be ASCII. */ for (p = buffer; *p != '\0'; p++) { if (*p < ' ' ) { *p = '\0'; return buffer; } } return buffer; case T_DOUBLE_QUOTED_STRING: if (!strchr(value, '%')) return value; radius_xlat(buffer, sizeof_buffer, value, request, NULL); return buffer; } return NULL; } #ifdef HAVE_REGEX_H static FR_TOKEN getregex(const char **ptr, char *buffer, size_t buflen, int *pcflags) { const char *p = *ptr; char *q = buffer; if (*p != '/') return T_OP_INVALID; *pcflags = REG_EXTENDED; p++; while (*p) { if (buflen <= 1) break; if (*p == '/') { p++; /* * Check for case insensitivity */ if (*p == 'i') { p++; *pcflags |= REG_ICASE; } break; } if (*p == '\\') { int x; switch (p[1]) { case 'r': *q++ = '\r'; break; case 'n': *q++ = '\n'; break; case 't': *q++ = '\t'; break; case '"': *q++ = '"'; break; case '\'': *q++ = '\''; break; case '`': *q++ = '`'; break; /* * FIXME: add 'x' and 'u' */ default: if ((p[1] >= '0') && (p[1] <= '9') && (sscanf(p + 1, "%3o", &x) == 1)) { *q++ = x; p += 2; } else { *q++ = p[1]; } break; } p += 2; buflen--; continue; } *(q++) = *(p++); buflen--; } *q = '\0'; *ptr = p; return T_DOUBLE_QUOTED_STRING; } #endif static const FR_NAME_NUMBER modreturn_table[] = { { "reject", RLM_MODULE_REJECT }, { "fail", RLM_MODULE_FAIL }, { "ok", RLM_MODULE_OK }, { "handled", RLM_MODULE_HANDLED }, { "invalid", RLM_MODULE_INVALID }, { "userlock", RLM_MODULE_USERLOCK }, { "notfound", RLM_MODULE_NOTFOUND }, { "noop", RLM_MODULE_NOOP }, { "updated", RLM_MODULE_UPDATED }, { NULL, 0 } }; int radius_get_vp(REQUEST *request, const char *name, VALUE_PAIR **vp_p) { const char *vp_name = name; REQUEST *myrequest = request; DICT_ATTR *da; VALUE_PAIR *vps = NULL; *vp_p = NULL; /* * Allow for tunneled sessions. */ if (strncmp(vp_name, "outer.", 6) == 0) { if (!myrequest->parent) return TRUE; vp_name += 6; myrequest = myrequest->parent; } if (strncmp(vp_name, "request:", 8) == 0) { vp_name += 8; vps = myrequest->packet->vps; } else if (strncmp(vp_name, "reply:", 6) == 0) { vp_name += 6; vps = myrequest->reply->vps; #ifdef WITH_PROXY } else if (strncmp(vp_name, "proxy-request:", 14) == 0) { vp_name += 14; if (request->proxy) vps = myrequest->proxy->vps; } else if (strncmp(vp_name, "proxy-reply:", 12) == 0) { vp_name += 12; if (request->proxy_reply) vps = myrequest->proxy_reply->vps; #endif } else if (strncmp(vp_name, "config:", 7) == 0) { vp_name += 7; vps = myrequest->config_items; } else if (strncmp(vp_name, "control:", 8) == 0) { vp_name += 8; vps = myrequest->config_items; #ifdef WITH_COA } else if (strncmp(vp_name, "coa:", 4) == 0) { vp_name += 4; if (myrequest->coa && (myrequest->coa->proxy->code == PW_COA_REQUEST)) { vps = myrequest->coa->proxy->vps; } } else if (strncmp(vp_name, "coa-reply:", 10) == 0) { vp_name += 10; if (myrequest->coa && /* match reply with request */ (myrequest->coa->proxy->code == PW_COA_REQUEST) && (myrequest->coa->proxy_reply)) { vps = myrequest->coa->proxy_reply->vps; } } else if (strncmp(vp_name, "disconnect:", 11) == 0) { vp_name += 11; if (myrequest->coa && (myrequest->coa->proxy->code == PW_DISCONNECT_REQUEST)) { vps = myrequest->coa->proxy->vps; } } else if (strncmp(vp_name, "disconnect-reply:", 17) == 0) { vp_name += 17; if (myrequest->coa && /* match reply with request */ (myrequest->coa->proxy->code == PW_DISCONNECT_REQUEST) && (myrequest->coa->proxy_reply)) { vps = myrequest->coa->proxy_reply->vps; } #endif } else { vps = myrequest->packet->vps; } da = dict_attrbyname(vp_name); if (!da) return FALSE; /* not a dictionary name */ /* * May not may not be found, but it *is* a known name. */ *vp_p = pairfind(vps, da->attr); return TRUE; } /* * *presult is "did comparison match or not" */ static int radius_do_cmp(REQUEST *request, int *presult, FR_TOKEN lt, const char *pleft, FR_TOKEN token, FR_TOKEN rt, const char *pright, int cflags, int modreturn) { int result; uint32_t lint, rint; VALUE_PAIR *vp = NULL; #ifdef HAVE_REGEX_H char buffer[8192]; #else cflags = cflags; /* -Wunused */ #endif rt = rt; /* -Wunused */ if (lt == T_BARE_WORD) { /* * Maybe check the last return code. */ if (token == T_OP_CMP_TRUE) { int isreturn; /* * Looks like a return code, treat is as such. */ isreturn = fr_str2int(modreturn_table, pleft, -1); if (isreturn != -1) { *presult = (modreturn == isreturn); return TRUE; } } /* * Bare words on the left can be attribute names. */ if (radius_get_vp(request, pleft, &vp)) { VALUE_PAIR myvp; /* * VP exists, and that's all we're looking for. */ if (token == T_OP_CMP_TRUE) { *presult = (vp != NULL); return TRUE; } if (!vp) { DICT_ATTR *da; /* * The attribute on the LHS may * have been a dynamically * registered callback. i.e. it * doesn't exist as a VALUE_PAIR. * If so, try looking for it. */ da = dict_attrbyname(pleft); if (da && radius_find_compare(da->attr)) { VALUE_PAIR *check = pairmake(pleft, pright, token); *presult = (radius_callback_compare(request, NULL, check, NULL, NULL) == 0); RDEBUG3(" Callback returns %d", *presult); pairfree(&check); return TRUE; } RDEBUG2(" (Attribute %s was not found)", pleft); *presult = 0; return TRUE; } #ifdef HAVE_REGEX_H /* * Regex comparisons treat everything as * strings. */ if ((token == T_OP_REG_EQ) || (token == T_OP_REG_NE)) { vp_prints_value(buffer, sizeof(buffer), vp, 0); pleft = buffer; goto do_checks; } #endif memcpy(&myvp, vp, sizeof(myvp)); if (!pairparsevalue(&myvp, pright)) { RDEBUG2("Failed parsing \"%s\": %s", pright, fr_strerror()); return FALSE; } myvp.operator = token; *presult = paircmp(&myvp, vp); RDEBUG3(" paircmp -> %d", *presult); return TRUE; } /* else it's not a VP in a list */ } #ifdef HAVE_REGEX_H do_checks: #endif switch (token) { case T_OP_GE: case T_OP_GT: case T_OP_LE: case T_OP_LT: if (!all_digits(pright)) { RDEBUG2(" (Right field is not a number at: %s)", pright); return FALSE; } rint = strtoul(pright, NULL, 0); if (!all_digits(pleft)) { RDEBUG2(" (Left field is not a number at: %s)", pleft); return FALSE; } lint = strtoul(pleft, NULL, 0); break; default: lint = rint = 0; /* quiet the compiler */ break; } switch (token) { case T_OP_CMP_TRUE: /* * Check for truth or falsehood. */ if (all_digits(pleft)) { lint = strtoul(pleft, NULL, 0); result = (lint != 0); } else { result = (*pleft != '\0'); } break; case T_OP_CMP_EQ: result = (strcmp(pleft, pright) == 0); break; case T_OP_NE: result = (strcmp(pleft, pright) != 0); break; case T_OP_GE: result = (lint >= rint); break; case T_OP_GT: result = (lint > rint); break; case T_OP_LE: result = (lint <= rint); break; case T_OP_LT: result = (lint < rint); break; #ifdef HAVE_REGEX_H case T_OP_REG_EQ: { int i, compare; regex_t reg; regmatch_t rxmatch[REQUEST_MAX_REGEX + 1]; /* * Include substring matches. */ compare = regcomp(®, pright, cflags); if (compare != 0) { if (debug_flag) { char errbuf[128]; regerror(compare, ®, errbuf, sizeof(errbuf)); DEBUG("ERROR: Failed compiling regular expression: %s", errbuf); } return FALSE; } compare = regexec(®, pleft, REQUEST_MAX_REGEX + 1, rxmatch, 0); regfree(®); /* * Add new %{0}, %{1}, etc. */ if (compare == 0) for (i = 0; i <= REQUEST_MAX_REGEX; i++) { char *r; free(request_data_get(request, request, REQUEST_DATA_REGEX | i)); /* * No %{i}, skip it. * We MAY have %{2} without %{1}. */ if (rxmatch[i].rm_so == -1) continue; /* * Copy substring into allocated buffer */ r = rad_malloc(rxmatch[i].rm_eo -rxmatch[i].rm_so + 1); memcpy(r, pleft + rxmatch[i].rm_so, rxmatch[i].rm_eo - rxmatch[i].rm_so); r[rxmatch[i].rm_eo - rxmatch[i].rm_so] = '\0'; request_data_add(request, request, REQUEST_DATA_REGEX | i, r, free); } result = (compare == 0); } break; case T_OP_REG_NE: { int compare; regex_t reg; regmatch_t rxmatch[REQUEST_MAX_REGEX + 1]; /* * Include substring matches. */ compare = regcomp(®, pright, cflags); if (compare != 0) { if (debug_flag) { char errbuf[128]; regerror(compare, ®, errbuf, sizeof(errbuf)); DEBUG("ERROR: Failed compiling regular expression: %s", errbuf); } return FALSE; } compare = regexec(®, pleft, REQUEST_MAX_REGEX + 1, rxmatch, 0); regfree(®); result = (compare != 0); } break; #endif default: DEBUG("ERROR: Comparison operator %s is not supported", fr_token_name(token)); result = FALSE; break; } *presult = result; return TRUE; } int radius_evaluate_condition(REQUEST *request, int modreturn, int depth, const char **ptr, int evaluate_it, int *presult) { int found_condition = FALSE; int result = TRUE; int invert = FALSE; int evaluate_next_condition = evaluate_it; const char *p; const char *q, *start; FR_TOKEN token, lt, rt; char left[1024], right[1024], comp[4]; const char *pleft, *pright; char xleft[1024], xright[1024]; int cflags = 0; if (!ptr || !*ptr || (depth >= 64)) { radlog(L_ERR, "Internal sanity check failed in evaluate condition"); return FALSE; } /* * Horrible parser. */ p = *ptr; while (*p) { while ((*p == ' ') || (*p == '\t')) p++; /* * ! EXPR */ if (!found_condition && (*p == '!')) { /* * Don't change the results if we're not * evaluating the condition. */ if (evaluate_next_condition) { RDEBUG4(">>> INVERT"); invert = TRUE; } p++; while ((*p == ' ') || (*p == '\t')) p++; } /* * ( EXPR ) */ if (!found_condition && (*p == '(')) { const char *end = p + 1; /* * Evaluate the condition, bailing out on * parse error. */ RDEBUG4(">>> RECURSING WITH ... %s", end); if (!radius_evaluate_condition(request, modreturn, depth + 1, &end, evaluate_next_condition, &result)) { return FALSE; } if (invert) { if (evaluate_next_condition) { RDEBUG2("%.*s Converting !%s -> %s", depth, filler, (result != FALSE) ? "TRUE" : "FALSE", (result == FALSE) ? "TRUE" : "FALSE"); result = (result == FALSE); } invert = FALSE; } /* * Start from the end of the previous * condition */ p = end; RDEBUG4(">>> AFTER RECURSION ... %s", end); while ((*p == ' ') || (*p == '\t')) p++; if (!*p) { radlog(L_ERR, "No closing brace"); return FALSE; } if (*p == ')') p++; /* eat closing brace */ found_condition = TRUE; while ((*p == ' ') || (*p == '\t')) p++; } /* * At EOL or closing brace, update && return. */ if (found_condition && (!*p || (*p == ')'))) break; /* * Now it's either: * * WORD * WORD1 op WORD2 * && EXPR * || EXPR */ if (found_condition) { /* * (A && B) means "evaluate B * only if A was true" */ if ((p[0] == '&') && (p[1] == '&')) { if (!result) evaluate_next_condition = FALSE; p += 2; found_condition = FALSE; continue; /* go back to the start */ } /* * (A || B) means "evaluate B * only if A was false" */ if ((p[0] == '|') && (p[1] == '|')) { if (result) evaluate_next_condition = FALSE; p += 2; found_condition = FALSE; continue; } /* * It must be: * * WORD * WORD1 op WORD2 */ } if (found_condition) { radlog(L_ERR, "Consecutive conditions at %s", p); return FALSE; } RDEBUG4(">>> LOOKING AT %s", p); start = p; /* * Look for common errors. */ if ((p[0] == '%') && (p[1] == '{')) { radlog(L_ERR, "Bare %%{...} is invalid in condition at: %s", p); return FALSE; } /* * Look for WORD1 op WORD2 */ lt = gettoken(&p, left, sizeof(left)); if ((lt != T_BARE_WORD) && (lt != T_DOUBLE_QUOTED_STRING) && (lt != T_SINGLE_QUOTED_STRING) && (lt != T_BACK_QUOTED_STRING)) { radlog(L_ERR, "Expected string or numbers at: %s", p); return FALSE; } pleft = left; if (evaluate_next_condition) { pleft = expand_string(xleft, sizeof(xleft), request, lt, left); if (!pleft) { return FALSE; } } /* * Peek ahead, to see if it's: * * WORD * * or something else, such as * * WORD1 op WORD2 * WORD ) * WORD && EXPR * WORD || EXPR */ q = p; while ((*q == ' ') || (*q == '\t')) q++; /* * If the next thing is: * * EOL * end of condition * && * || * * Then WORD is just a test for existence. * Remember that and skip ahead. */ if (!*q || (*q == ')') || ((q[0] == '&') && (q[1] == '&')) || ((q[0] == '|') && (q[1] == '|'))) { token = T_OP_CMP_TRUE; rt = T_OP_INVALID; pright = NULL; goto do_cmp; } /* * Otherwise, it's: * * WORD1 op WORD2 */ token = gettoken(&p, comp, sizeof(comp)); if ((token < T_OP_NE) || (token > T_OP_CMP_EQ) || (token == T_OP_CMP_TRUE)) { radlog(L_ERR, "Expected comparison at: %s", comp); return FALSE; } /* * Look for common errors. */ if ((p[0] == '%') && (p[1] == '{')) { radlog(L_ERR, "Bare %%{...} is invalid in condition at: %s", p); return FALSE; } /* * Validate strings. */ #ifdef HAVE_REGEX_H if ((token == T_OP_REG_EQ) || (token == T_OP_REG_NE)) { rt = getregex(&p, right, sizeof(right), &cflags); if (rt != T_DOUBLE_QUOTED_STRING) { radlog(L_ERR, "Expected regular expression at: %s", p); return FALSE; } } else #endif rt = gettoken(&p, right, sizeof(right)); if ((rt != T_BARE_WORD) && (rt != T_DOUBLE_QUOTED_STRING) && (rt != T_SINGLE_QUOTED_STRING) && (rt != T_BACK_QUOTED_STRING)) { radlog(L_ERR, "Expected string or numbers at: %s", p); return FALSE; } pright = right; if (evaluate_next_condition) { pright = expand_string(xright, sizeof(xright), request, rt, right); if (!pright) { return FALSE; } } RDEBUG4(">>> %d:%s %d %d:%s", lt, pleft, token, rt, pright); do_cmp: if (evaluate_next_condition) { /* * More parse errors. */ if (!radius_do_cmp(request, &result, lt, pleft, token, rt, pright, cflags, modreturn)) { return FALSE; } RDEBUG4(">>> Comparison returned %d", result); if (invert) { RDEBUG4(">>> INVERTING result"); result = (result == FALSE); } RDEBUG2("%.*s Evaluating %s(%.*s) -> %s", depth, filler, invert ? "!" : "", p - start, start, (result != FALSE) ? "TRUE" : "FALSE"); invert = FALSE; RDEBUG4(">>> GOT result %d", result); /* * Not evaluating it. We may be just * parsing it. */ } else if (request) { RDEBUG2("%.*s Skipping %s(%.*s)", depth, filler, invert ? "!" : "", p - start, start); } found_condition = TRUE; } /* loop over the input condition */ if (!found_condition) { radlog(L_ERR, "Syntax error. Expected condition at %s", p); return FALSE; } RDEBUG4(">>> AT EOL -> %d", result); *ptr = p; if (evaluate_it) *presult = result; return TRUE; } #endif static void fix_up(REQUEST *request) { VALUE_PAIR *vp; request->username = NULL; request->password = NULL; for (vp = request->packet->vps; vp != NULL; vp = vp->next) { if ((vp->attribute == PW_USER_NAME) && !request->username) { request->username = vp; } else if (vp->attribute == PW_STRIPPED_USER_NAME) { request->username = vp; } else if (vp->attribute == PW_USER_PASSWORD) { request->password = vp; } } } /* * The pairmove() function in src/lib/valuepair.c does all sorts of * extra magic that we don't want here. * * FIXME: integrate this with the code calling it, so that we * only paircopy() those attributes that we're really going to * use. */ void radius_pairmove(REQUEST *request, VALUE_PAIR **to, VALUE_PAIR *from) { int i, j, count, from_count, to_count, tailto; VALUE_PAIR *vp, *next, **last; VALUE_PAIR **from_list, **to_list; VALUE_PAIR *append, **append_tail; int *edited = NULL; /* * Set up arrays for editing, to remove some of the * O(N^2) dependencies. This also makes it easier to * insert and remove attributes. * * It also means that the operators apply ONLY to the * attributes in the original list. With the previous * implementation of pairmove(), adding two attributes * via "+=" and then "=" would mean that the second one * wasn't added, because of the existence of the first * one in the "to" list. This implementation doesn't * have that bug. * * Also, the previous implementation did NOT implement * "-=" correctly. If two of the same attributes existed * in the "to" list, and you tried to subtract something * matching the *second* value, then the pairdelete() * function was called, and the *all* attributes of that * number were deleted. With this implementation, only * the matching attributes are deleted. */ count = 0; for (vp = from; vp != NULL; vp = vp->next) count++; from_list = rad_malloc(sizeof(*from_list) * count); for (vp = *to; vp != NULL; vp = vp->next) count++; to_list = rad_malloc(sizeof(*to_list) * count); append = NULL; append_tail = &append; /* * Move the lists to the arrays, and break the list * chains. */ from_count = 0; for (vp = from; vp != NULL; vp = next) { next = vp->next; from_list[from_count++] = vp; vp->next = NULL; } to_count = 0; for (vp = *to; vp != NULL; vp = next) { next = vp->next; to_list[to_count++] = vp; vp->next = NULL; } tailto = to_count; edited = rad_malloc(sizeof(*edited) * to_count); memset(edited, 0, sizeof(*edited) * to_count); RDEBUG4("::: FROM %d TO %d MAX %d", from_count, to_count, count); /* * Now that we have the lists initialized, start working * over them. */ for (i = 0; i < from_count; i++) { int found; RDEBUG4("::: Examining %s", from_list[i]->name); /* * Attribute should be appended, OR the "to" list * is empty, and we're supposed to replace or * "add if not existing". */ if (from_list[i]->operator == T_OP_ADD) goto do_append; found = FALSE; for (j = 0; j < to_count; j++) { if (edited[j] || !to_list[j] || !from_list[i]) continue; /* * Attributes aren't the same, skip them. */ if (from_list[i]->attribute != to_list[j]->attribute) { continue; } /* * We don't use a "switch" statement here * because we want to break out of the * "for" loop over 'j' in most cases. */ /* * Over-write the FIRST instance of the * matching attribute name. We free the * one in the "to" list, and move over * the one in the "from" list. */ if (from_list[i]->operator == T_OP_SET) { RDEBUG4("::: OVERWRITING %s FROM %d TO %d", to_list[j]->name, i, j); pairfree(&to_list[j]); to_list[j] = from_list[i]; from_list[i] = NULL; edited[j] = TRUE; break; } /* * Add the attribute only if it does not * exist... but it exists, so we stop * looking. */ if (from_list[i]->operator == T_OP_EQ) { found = TRUE; break; } /* * Delete every attribute, independent * of its value. */ if (from_list[i]->operator == T_OP_CMP_FALSE) { goto delete; } /* * Delete all matching attributes from * "to" */ if ((from_list[i]->operator == T_OP_SUB) || (from_list[i]->operator == T_OP_CMP_EQ) || (from_list[i]->operator == T_OP_LE) || (from_list[i]->operator == T_OP_GE)) { int rcode; int old_op = from_list[i]->operator; /* * Check for equality. */ from_list[i]->operator = T_OP_CMP_EQ; /* * If equal, delete the one in * the "to" list. */ rcode = radius_compare_vps(NULL, from_list[i], to_list[j]); /* * We may want to do more * subtractions, so we re-set the * operator back to it's original * value. */ from_list[i]->operator = old_op; switch (old_op) { case T_OP_CMP_EQ: if (rcode != 0) goto delete; break; case T_OP_SUB: if (rcode == 0) { delete: RDEBUG4("::: DELETING %s FROM %d TO %d", from_list[i]->name, i, j); pairfree(&to_list[j]); to_list[j] = NULL; } break; /* * Enforce <=. If it's * >, replace it. */ case T_OP_LE: if (rcode > 0) { RDEBUG4("::: REPLACING %s FROM %d TO %d", from_list[i]->name, i, j); pairfree(&to_list[j]); to_list[j] = from_list[i]; from_list[i] = NULL; edited[j] = TRUE; } break; case T_OP_GE: if (rcode < 0) { RDEBUG4("::: REPLACING %s FROM %d TO %d", from_list[i]->name, i, j); pairfree(&to_list[j]); to_list[j] = from_list[i]; from_list[i] = NULL; edited[j] = TRUE; } break; } continue; } rad_assert(0 == 1); /* panic! */ } /* * We were asked to add it if it didn't exist, * and it doesn't exist. Move it over to the * tail of the "to" list, UNLESS it was already * moved by another operator. */ if (!found && from_list[i]) { if ((from_list[i]->operator == T_OP_EQ) || (from_list[i]->operator == T_OP_LE) || (from_list[i]->operator == T_OP_GE) || (from_list[i]->operator == T_OP_SET)) { do_append: RDEBUG4("::: APPENDING %s FROM %d TO %d", from_list[i]->name, i, tailto); *append_tail = from_list[i]; from_list[i]->operator = T_OP_EQ; from_list[i] = NULL; append_tail = &(*append_tail)->next; } } } /* * Delete attributes in the "from" list. */ for (i = 0; i < from_count; i++) { if (!from_list[i]) continue; pairfree(&from_list[i]); } free(from_list); RDEBUG4("::: TO in %d out %d", to_count, tailto); /* * Re-chain the "to" list. */ *to = NULL; last = to; for (i = 0; i < tailto; i++) { if (!to_list[i]) continue; RDEBUG4("::: to[%d] = %s", i, to_list[i]->name); /* * Mash the operator to a simple '='. The * operators in the "to" list aren't used for * anything. BUT they're used in the "detail" * file and debug output, where we don't want to * see the operators. */ to_list[i]->operator = T_OP_EQ; *last = to_list[i]; last = &(*last)->next; } /* * And finally add in the attributes we're appending to * the tail of the "to" list. */ *last = append; rad_assert(request != NULL); rad_assert(request->packet != NULL); /* * Fix dumb cache issues */ if (to == &request->packet->vps) { fix_up(request); } else if (request->parent && (to == &request->parent->packet->vps)) { fix_up(request->parent); } free(to_list); free(edited); } #ifdef WITH_UNLANG /* * Copied shamelessly from conffile.c, to simplify the API for * now... */ typedef enum conf_type { CONF_ITEM_INVALID = 0, CONF_ITEM_PAIR, CONF_ITEM_SECTION, CONF_ITEM_DATA } CONF_ITEM_TYPE; struct conf_item { struct conf_item *next; struct conf_part *parent; int lineno; const char *filename; CONF_ITEM_TYPE type; }; struct conf_pair { CONF_ITEM item; char *attr; char *value; FR_TOKEN operator; FR_TOKEN value_type; }; /* * Add attributes to a list. */ int radius_update_attrlist(REQUEST *request, CONF_SECTION *cs, VALUE_PAIR *input_vps, const char *name) { CONF_ITEM *ci; VALUE_PAIR *newlist, *vp; VALUE_PAIR **output_vps = NULL; REQUEST *myrequest = request; if (!request || !cs) return RLM_MODULE_INVALID; /* * If we are an inner tunnel session, permit the * policy to update the outer lists directly. */ if (strncmp(name, "outer.", 6) == 0) { if (!request->parent) return RLM_MODULE_NOOP; myrequest = request->parent; name += 6; } if (strcmp(name, "request") == 0) { output_vps = &myrequest->packet->vps; } else if (strcmp(name, "reply") == 0) { output_vps = &myrequest->reply->vps; #ifdef WITH_PROXY } else if (strcmp(name, "proxy-request") == 0) { if (request->proxy) output_vps = &myrequest->proxy->vps; } else if (strcmp(name, "proxy-reply") == 0) { if (request->proxy_reply) output_vps = &request->proxy_reply->vps; #endif } else if (strcmp(name, "config") == 0) { output_vps = &myrequest->config_items; } else if (strcmp(name, "control") == 0) { output_vps = &myrequest->config_items; #ifdef WITH_COA } else if (strcmp(name, "coa") == 0) { if (!myrequest->coa) { request_alloc_coa(myrequest); myrequest->coa->proxy->code = PW_COA_REQUEST; } if (myrequest->coa && (myrequest->coa->proxy->code == PW_COA_REQUEST)) { output_vps = &myrequest->coa->proxy->vps; } } else if (strcmp(name, "coa-reply") == 0) { if (myrequest->coa && /* match reply with request */ (myrequest->coa->proxy->code == PW_COA_REQUEST) && (myrequest->coa->proxy_reply)) { output_vps = &myrequest->coa->proxy_reply->vps; } } else if (strcmp(name, "disconnect") == 0) { if (!myrequest->coa) { request_alloc_coa(myrequest); if (myrequest->coa) myrequest->coa->proxy->code = PW_DISCONNECT_REQUEST; } if (myrequest->coa && (myrequest->coa->proxy->code == PW_DISCONNECT_REQUEST)) { output_vps = &myrequest->coa->proxy->vps; } } else if (strcmp(name, "disconnect-reply") == 0) { if (myrequest->coa && /* match reply with request */ (myrequest->coa->proxy->code == PW_DISCONNECT_REQUEST) && (myrequest->coa->proxy_reply)) { output_vps = &myrequest->coa->proxy_reply->vps; } #endif } else { return RLM_MODULE_INVALID; } if (!output_vps) return RLM_MODULE_NOOP; /* didn't update the list */ newlist = paircopy(input_vps); if (!newlist) { RDEBUG2("Out of memory"); return RLM_MODULE_FAIL; } vp = newlist; for (ci=cf_item_find_next(cs, NULL); ci != NULL; ci=cf_item_find_next(cs, ci)) { CONF_PAIR *cp; /* * This should never happen. */ if (cf_item_is_section(ci)) { pairfree(&newlist); return RLM_MODULE_INVALID; } cp = cf_itemtopair(ci); #ifndef NDEBUG if (debug_flag && radius_find_compare(vp->attribute)) { DEBUG("WARNING: You are modifying the value of virtual attribute %s. This is not supported.", vp->name); } #endif /* * The VP && CF lists should be in sync. If they're * not, panic. */ if (vp->flags.do_xlat) { const char *value; char buffer[2048]; value = expand_string(buffer, sizeof(buffer), request, cp->value_type, cp->value); if (!value) { pairfree(&newlist); return RLM_MODULE_INVALID; } if (!pairparsevalue(vp, value)) { RDEBUG2("ERROR: Failed parsing value \"%s\" for attribute %s: %s", value, vp->name, fr_strerror()); pairfree(&newlist); return RLM_MODULE_FAIL; } vp->flags.do_xlat = 0; } vp = vp->next; } radius_pairmove(request, output_vps, newlist); return RLM_MODULE_UPDATED; } #endif freeradius-server/src/main/event.c000066400000000000000000002711741257552170400175370ustar00rootroot00000000000000/* * event.c Server event handling * * Version: $Id$ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2007 The FreeRADIUS server project * Copyright 2007 Alan DeKok */ #include RCSID("$Id$") #include #include #include #include #include #include #include #ifdef HAVE_SYS_WAIT_H # include #endif #define USEC (1000000) extern pid_t radius_pid; extern int dont_fork; extern int check_config; extern char *debug_condition; /* * Ridiculous amounts of local state. */ static fr_event_list_t *el = NULL; static fr_packet_list_t *pl = NULL; static int request_num_counter = 0; static struct timeval now; time_t fr_start_time; static int have_children; static int just_started = TRUE; #ifndef __MINGW32__ #ifdef HAVE_PTHREAD_H #define WITH_SELF_PIPE (1) #endif #endif #ifdef WITH_SELF_PIPE static int self_pipe[2]; #endif #ifdef HAVE_PTHREAD_H #ifdef WITH_PROXY static pthread_mutex_t proxy_mutex; #endif #define PTHREAD_MUTEX_LOCK if (have_children) pthread_mutex_lock #define PTHREAD_MUTEX_UNLOCK if (have_children) pthread_mutex_unlock #define NO_CHILD_THREAD (0) #else /* * This is easier than ifdef's throughout the code. */ #define PTHREAD_MUTEX_LOCK(_x) #define PTHREAD_MUTEX_UNLOCK(_x) int thread_pool_addrequest(REQUEST *request, RAD_REQUEST_FUNP fun) { radius_handle_request(request, fun); return 1; } #endif #define INSERT_EVENT(_function, _ctx) if (!fr_event_insert(el, _function, _ctx, &((_ctx)->when), &((_ctx)->ev))) { _rad_panic(__FILE__, __LINE__, "Failed to insert event"); } #ifdef WITH_PROXY static fr_packet_list_t *proxy_list = NULL; /* * We keep the proxy FD's here. The RADIUS Id's are marked * "allocated" per Id, via a bit per proxy FD. */ static int proxy_all_used = FALSE; static int proxy_fds[32]; static rad_listen_t *proxy_listeners[32]; static void check_for_zombie_home_server(REQUEST *request); static void remove_from_proxy_hash(REQUEST *request); #else #define remove_from_proxy_hash(foo) #endif static void request_post_handler(REQUEST *request); static void wait_a_bit(void *ctx); static void event_socket_handler(fr_event_list_t *xel, UNUSED int fd, void *ctx); #ifdef WITH_DETAIL static void event_poll_detail(void *ctx); #endif static void NEVER_RETURNS _rad_panic(const char *file, unsigned int line, const char *msg) { radlog(L_ERR, "[%s:%d] %s", file, line, msg); _exit(1); } #define rad_panic(x) _rad_panic(__FILE__, __LINE__, x) static void tv_add(struct timeval *tv, int usec_delay) { if (usec_delay >= USEC) { tv->tv_sec += usec_delay / USEC; usec_delay %= USEC; } tv->tv_usec += usec_delay; if (tv->tv_usec >= USEC) { tv->tv_sec += tv->tv_usec / USEC; tv->tv_usec %= USEC; } } static void remove_from_request_hash(REQUEST *request) { if (!request->in_request_hash) return; fr_packet_list_yank(pl, request->packet); request->in_request_hash = FALSE; request_stats_final(request); } static void ev_request_free(REQUEST **prequest) { REQUEST *request; if (!prequest || !*prequest) return; request = *prequest; #ifdef HAVE_PTHREAD_H /* * We can only free a request if there's no child thread * using it. */ rad_assert(request->thread_id == NO_CHILD_THREAD); #endif #ifdef WITH_COA if (request->coa) { /* * Divorce the child from the parent first, * then clean up the child. */ request->coa->parent = NULL; ev_request_free(&request->coa); } /* * Divorce the parent from the child, and leave the * parent still alive. */ if (request->parent && (request->parent->coa == request)) { request->parent->coa = NULL; } #endif if (request->ev) fr_event_delete(el, &request->ev); #ifdef WITH_PROXY if (request->in_proxy_hash) remove_from_proxy_hash(request); #endif if (request->in_request_hash) remove_from_request_hash(request); rad_assert(request->child_state != REQUEST_QUEUED); request_free(prequest); } #ifdef WITH_PROXY static REQUEST *lookup_in_proxy_hash(RADIUS_PACKET *reply) { RADIUS_PACKET **proxy_p; REQUEST *request; PTHREAD_MUTEX_LOCK(&proxy_mutex); proxy_p = fr_packet_list_find_byreply(proxy_list, reply); if (!proxy_p) { PTHREAD_MUTEX_UNLOCK(&proxy_mutex); return NULL; } request = fr_packet2myptr(REQUEST, proxy, proxy_p); if (!request) { PTHREAD_MUTEX_UNLOCK(&proxy_mutex); return NULL; } request->num_proxied_responses++; /* * Catch the most common case of everything working * correctly. */ if (request->num_proxied_requests == request->num_proxied_responses) { fr_packet_list_yank(proxy_list, request->proxy); fr_packet_list_id_free(proxy_list, request->proxy); request->in_proxy_hash = FALSE; } /* * On the FIRST reply, decrement the count of outstanding * requests. Note that this is NOT the count of sent * packets, but whether or not the home server has * responded at all. */ if (!request->proxy_reply && request->home_server && request->home_server->currently_outstanding) { request->home_server->currently_outstanding--; } PTHREAD_MUTEX_UNLOCK(&proxy_mutex); return request; } static void remove_from_proxy_hash(REQUEST *request) { /* * Check this without grabbing the mutex because it's a * lot faster that way. */ if (!request->in_proxy_hash) return; /* * The "not in hash" flag is definitive. However, if the * flag says that it IS in the hash, there might still be * a race condition where it isn't. */ PTHREAD_MUTEX_LOCK(&proxy_mutex); if (!request->in_proxy_hash) { PTHREAD_MUTEX_UNLOCK(&proxy_mutex); return; } fr_packet_list_yank(proxy_list, request->proxy); fr_packet_list_id_free(proxy_list, request->proxy); /* * The home server hasn't replied, but we've given up on * this request. Don't count this request against the * home server. */ if (!request->proxy_reply && request->home_server && request->home_server->currently_outstanding) { request->home_server->currently_outstanding--; } /* * Got from YES in hash, to NO, not in hash while we hold * the mutex. This guarantees that when another thread * grans the mutex, the "not in hash" flag is correct. */ request->in_proxy_hash = FALSE; PTHREAD_MUTEX_UNLOCK(&proxy_mutex); } static int proxy_add_fds(rad_listen_t *proxy_listener) { int i, proxy, found = -1; proxy = proxy_listener->fd; for (i = 0; i < 32; i++) { /* * Found a free entry. Save the socket, * and remember where we saved it. */ if (proxy_fds[(proxy + i) & 0x1f] == -1) { found = (proxy + i) & 0x1f; proxy_fds[found] = proxy; proxy_listeners[found] = proxy_listener; break; } } return found; } static int proxy_id_alloc(REQUEST *request, RADIUS_PACKET *packet) { rad_listen_t *proxy_listener; if (fr_packet_list_id_alloc(proxy_list, packet)) return 1; if (proxy_all_used) return 0; /* * Allocate a new proxy fd. This function adds * it to the tail of the list of listeners. With * some care, this can be thread-safe. */ proxy_listener = proxy_new_listener(&packet->src_ipaddr, FALSE); if (!proxy_listener) { radlog(L_PROXY, "Failed to create a new socket for proxying requests."); return 0; } /* * Cache it locally. */ if (proxy_add_fds(proxy_listener) < 0) { proxy_all_used = TRUE; listen_free(&proxy_listener); radlog(L_ERR, "Failed creating new proxy socket: server is too busy and home servers appear to be down"); return 0; } if (!fr_packet_list_socket_add(proxy_list, proxy_listener->fd)) { RDEBUG2("ERROR: Failed to create a new socket for proxying requests."); return 0; } if (!fr_packet_list_id_alloc(proxy_list, packet)) { RDEBUG2("ERROR: Failed to create a new socket for proxying requests."); return 0; } /* * Signal the main thread to add the new FD to the list * of listening FD's. */ radius_signal_self(RADIUS_SIGNAL_SELF_NEW_FD); return 1; } static int insert_into_proxy_hash(REQUEST *request, int retransmit) { int i, proxy; char buf[128]; rad_assert(request->proxy != NULL); rad_assert(proxy_list != NULL); PTHREAD_MUTEX_LOCK(&proxy_mutex); /* * Keep track of maximum outstanding requests to a * particular home server. 'max_outstanding' is * enforced in home_server_ldb(), in realms.c. */ if (request->home_server) { request->home_server->currently_outstanding++; } if (retransmit) { RADIUS_PACKET packet; packet = *request->proxy; if (!proxy_id_alloc(request, &packet)) { PTHREAD_MUTEX_UNLOCK(&proxy_mutex); return 0; } /* * Yank the request, free the old Id, and * remember the new Id. */ fr_packet_list_yank(proxy_list, request->proxy); fr_packet_list_id_free(proxy_list, request->proxy); *request->proxy = packet; } else if (!proxy_id_alloc(request, request->proxy)) { PTHREAD_MUTEX_UNLOCK(&proxy_mutex); return 0; } rad_assert(request->proxy->sockfd >= 0); /* * FIXME: Hack until we get rid of rad_listen_t, and put * the information into the packet_list. */ proxy = -1; for (i = 0; i < 32; i++) { if (proxy_fds[i] == request->proxy->sockfd) { proxy = i; break; } } if (proxy < 0) { PTHREAD_MUTEX_UNLOCK(&proxy_mutex); RDEBUG2("ERROR: All sockets are full."); return 0; } rad_assert(proxy_fds[proxy] != -1); rad_assert(proxy_listeners[proxy] != NULL); request->proxy_listener = proxy_listeners[proxy]; if (!fr_packet_list_insert(proxy_list, &request->proxy)) { fr_packet_list_yank(proxy_list, request->proxy); fr_packet_list_id_free(proxy_list, request->proxy); request->proxy_listener = NULL; request->in_proxy_hash = FALSE; PTHREAD_MUTEX_UNLOCK(&proxy_mutex); RDEBUG2("ERROR: Failed to insert entry into proxy list."); return 0; } request->in_proxy_hash = TRUE; PTHREAD_MUTEX_UNLOCK(&proxy_mutex); RDEBUG3(" proxy: allocating destination %s port %d - Id %d", inet_ntop(request->proxy->dst_ipaddr.af, &request->proxy->dst_ipaddr.ipaddr, buf, sizeof(buf)), request->proxy->dst_port, request->proxy->id); return 1; } /* * Called as BOTH an event, and in-line from other functions. */ static void wait_for_proxy_id_to_expire(void *ctx) { REQUEST *request = ctx; rad_assert(request->magic == REQUEST_MAGIC); rad_assert(request->proxy != NULL); if (!fr_event_now(el, &now)) gettimeofday(&now, NULL); request->when = request->proxy_when; #ifdef WITH_COA if (((request->proxy->code == PW_COA_REQUEST) || (request->proxy->code == PW_DISCONNECT_REQUEST)) && (request->packet->code != request->proxy->code)) { request->when.tv_sec += request->home_server->coa_mrd; } else #endif request->when.tv_sec += request->home_server->response_window; if ((request->num_proxied_requests == request->num_proxied_responses) || timercmp(&now, &request->when, >)) { if (request->packet) { RDEBUG2("Cleaning up request %u ID %d with timestamp +%d", request->number, request->packet->id, (unsigned int) (request->timestamp - fr_start_time)); } else { RDEBUG2("Cleaning up request %u with timestamp +%d", request->number, (unsigned int) (request->timestamp - fr_start_time)); } ev_request_free(&request); return; } INSERT_EVENT(wait_for_proxy_id_to_expire, request); } #endif #ifdef HAVE_PTHREAD_H static void wait_for_child_to_die(void *ctx) { REQUEST *request = ctx; rad_assert(request->magic == REQUEST_MAGIC); if (request->in_request_hash) { remove_from_request_hash(request); } /* * If it's still queued (waiting for a thread to pick it * up) OR there's still a child thread handling it, THEN * delay some more. */ if ((request->child_state == REQUEST_QUEUED) || (request->thread_id != NO_CHILD_THREAD)) { /* * Cap delay at max_request_time */ if (request->delay < (USEC * request->root->max_request_time)) { request->delay += (request->delay >> 1); radlog(L_INFO, "WARNING: Child is hung for request %u in component %s module %s.", request->number, request->component, request->module); } else { request->delay = USEC * request->root->max_request_time; RDEBUG2("WARNING: Child is hung after \"max_request_time\" for request %u", request->number); } tv_add(&request->when, request->delay); INSERT_EVENT(wait_for_child_to_die, request); return; } rad_assert(request->thread_id == NO_CHILD_THREAD); RDEBUG2("Child is finally responsive for request %u", request->number); #ifdef WITH_PROXY if (request->proxy) { wait_for_proxy_id_to_expire(request); return; } #endif request->child_state = REQUEST_DONE; ev_request_free(&request); } #endif static void cleanup_delay(void *ctx) { REQUEST *request = ctx; rad_assert(request->magic == REQUEST_MAGIC); rad_assert((request->child_state == REQUEST_CLEANUP_DELAY) || (request->child_state == REQUEST_DONE)); remove_from_request_hash(request); #ifdef WITH_PROXY if (request->proxy && request->in_proxy_hash) { wait_for_proxy_id_to_expire(request); return; } #endif RDEBUG2("Cleaning up request %u ID %d with timestamp +%d", request->number, request->packet->id, (unsigned int) (request->timestamp - fr_start_time)); ev_request_free(&request); } /* * In daemon mode, AND this request has debug flags set. */ #define DEBUG_PACKET if (!debug_flag && request->options && request->radlog) debug_packet static void debug_packet(REQUEST *request, RADIUS_PACKET *packet, int direction) { VALUE_PAIR *vp; char buffer[1024]; const char *received, *from; const fr_ipaddr_t *ip; int port; if (!packet) return; rad_assert(request->radlog != NULL); if (direction == 0) { received = "Received"; from = "from"; /* what else? */ ip = &packet->src_ipaddr; port = packet->src_port; } else { received = "Sending"; from = "to"; /* hah! */ ip = &packet->dst_ipaddr; port = packet->dst_port; } /* * Client-specific debugging re-prints the input * packet into the client log. * * This really belongs in a utility library */ if ((packet->code > 0) && (packet->code < FR_MAX_PACKET_CODE)) { RDEBUG("%s %s packet %s host %s port %d, id=%d, length=%d", received, fr_packet_codes[packet->code], from, inet_ntop(ip->af, &ip->ipaddr, buffer, sizeof(buffer)), port, packet->id, packet->data_len); } else { RDEBUG("%s packet %s host %s port %d code=%d, id=%d, length=%d", received, from, inet_ntop(ip->af, &ip->ipaddr, buffer, sizeof(buffer)), port, packet->code, packet->id, packet->data_len); } for (vp = packet->vps; vp != NULL; vp = vp->next) { vp_prints(buffer, sizeof(buffer), vp); request->radlog(L_DBG, 0, request, "\t%s", buffer); } } static void reject_delay(void *ctx) { REQUEST *request = ctx; rad_assert(request->magic == REQUEST_MAGIC); rad_assert(request->child_state == REQUEST_REJECT_DELAY); RDEBUG2("Sending delayed reject for request %u", request->number); DEBUG_PACKET(request, request->reply, 1); request->listener->send(request->listener, request); request->when.tv_sec += request->root->cleanup_delay; request->child_state = REQUEST_CLEANUP_DELAY; INSERT_EVENT(cleanup_delay, request); } #ifdef WITH_PROXY void revive_home_server(void *ctx) { home_server *home = ctx; char buffer[128]; home->state = HOME_STATE_ALIVE; home->currently_outstanding = 0; home->revive_time = now; /* * Delete any outstanding events. */ if (home->ev) fr_event_delete(el, &home->ev); radlog(L_PROXY, "Marking home server %s port %d alive again... we have no idea if it really is alive or not.", inet_ntop(home->ipaddr.af, &home->ipaddr.ipaddr, buffer, sizeof(buffer)), home->port); } static void no_response_to_ping(void *ctx) { REQUEST *request = ctx; home_server *home; char buffer[128]; rad_assert(request->home_server != NULL); home = request->home_server; home->num_received_pings = 0; radlog(L_ERR, "No response to status check %d for home server %s port %d", request->number, inet_ntop(request->proxy->dst_ipaddr.af, &request->proxy->dst_ipaddr.ipaddr, buffer, sizeof(buffer)), request->proxy->dst_port); check_for_zombie_home_server(request); wait_for_proxy_id_to_expire(request); } static void received_response_to_ping(REQUEST *request) { home_server *home; char buffer[128]; rad_assert(request->home_server != NULL); home = request->home_server; home->num_received_pings++; radlog(L_PROXY, "Received response to status check %d (%d in current sequence)", request->number, home->num_received_pings); /* * Remove the request from any hashes */ fr_event_delete(el, &request->ev); remove_from_proxy_hash(request); rad_assert(request->in_request_hash == FALSE); /* * The control socket may have marked the home server as * alive. OR, it may have suddenly started responding to * requests again. If so, don't re-do the "make alive" * work. */ if (home->state == HOME_STATE_ALIVE) return; /* * It's dead, and we haven't received enough ping * responses to mark it "alive". Wait a bit. * * If it's zombie, we mark it alive immediately. */ if ((home->state == HOME_STATE_IS_DEAD) && (home->num_received_pings < home->num_pings_to_alive)) { return; } home->state = HOME_STATE_ALIVE; home->currently_outstanding = 0; home->revive_time = now; if (!fr_event_delete(el, &home->ev)) { RDEBUG2("Hmm... no event for home server. Oh well."); } radlog(L_PROXY, "Marking home server %s port %d alive", inet_ntop(request->proxy->dst_ipaddr.af, &request->proxy->dst_ipaddr.ipaddr, buffer, sizeof(buffer)), request->proxy->dst_port); } /* * Called from start of zombie period, OR after control socket * marks the home server dead. */ static void ping_home_server(void *ctx) { uint32_t jitter; home_server *home = ctx; REQUEST *request; VALUE_PAIR *vp; if ((home->state == HOME_STATE_ALIVE) || (home->ping_check == HOME_PING_CHECK_NONE) || (home->ev != NULL)) { return; } request = request_alloc(); request->number = request_num_counter++; request->proxy = rad_alloc(1); rad_assert(request->proxy != NULL); fr_event_now(el, &request->when); home->when = request->when; if (home->ping_check == HOME_PING_CHECK_STATUS_SERVER) { request->proxy->code = PW_STATUS_SERVER; radius_pairmake(request, &request->proxy->vps, "Message-Authenticator", "0x00", T_OP_SET); } else if (home->type == HOME_TYPE_AUTH) { request->proxy->code = PW_AUTHENTICATION_REQUEST; radius_pairmake(request, &request->proxy->vps, "User-Name", home->ping_user_name, T_OP_SET); radius_pairmake(request, &request->proxy->vps, "User-Password", home->ping_user_password, T_OP_SET); radius_pairmake(request, &request->proxy->vps, "Service-Type", "Authenticate-Only", T_OP_SET); radius_pairmake(request, &request->proxy->vps, "Message-Authenticator", "0x00", T_OP_SET); } else { #ifdef WITH_ACCOUNTING request->proxy->code = PW_ACCOUNTING_REQUEST; radius_pairmake(request, &request->proxy->vps, "User-Name", home->ping_user_name, T_OP_SET); radius_pairmake(request, &request->proxy->vps, "Acct-Status-Type", "Stop", T_OP_SET); radius_pairmake(request, &request->proxy->vps, "Acct-Session-Id", "00000000", T_OP_SET); vp = radius_pairmake(request, &request->proxy->vps, "Event-Timestamp", "0", T_OP_SET); vp->vp_date = now.tv_sec; #else rad_assert("Internal sanity check failed"); #endif } radius_pairmake(request, &request->proxy->vps, "NAS-Identifier", "Status Check. Are you alive?", T_OP_SET); request->proxy->src_ipaddr = home->src_ipaddr; request->proxy->dst_ipaddr = home->ipaddr; request->proxy->dst_port = home->port; request->home_server = home; rad_assert(request->proxy_listener == NULL); if (!insert_into_proxy_hash(request, FALSE)) { RDEBUG2("ERROR: Failed to insert status check %d into proxy list. Discarding it.", request->number); ev_request_free(&request); return; } rad_assert(request->proxy_listener != NULL); request->proxy_listener->send(request->proxy_listener, request); request->next_callback = NULL; request->child_state = REQUEST_PROXIED; gettimeofday(&request->when, NULL); home->when = request->when; request->when.tv_sec += home->ping_timeout;; INSERT_EVENT(no_response_to_ping, request); /* * Add +/- 2s of jitter, as suggested in RFC 3539 * and in the Issues and Fixes draft. */ home->when.tv_sec += home->ping_interval - 2; jitter = fr_rand(); jitter ^= (jitter >> 10); jitter &= ((1 << 23) - 1); /* 22 bits of 1 */ tv_add(&home->when, jitter); INSERT_EVENT(ping_home_server, home); } void mark_home_server_dead(home_server *home, struct timeval *when) { int previous_state = home->state; char buffer[128]; radlog(L_PROXY, "Marking home server %s port %d as dead.", inet_ntop(home->ipaddr.af, &home->ipaddr.ipaddr, buffer, sizeof(buffer)), home->port); home->state = HOME_STATE_IS_DEAD; home->num_received_pings = 0; if (home->ping_check != HOME_PING_CHECK_NONE) { /* * If the control socket marks us dead, start * pinging. Otherwise, we already started * pinging when it was marked "zombie". */ if (previous_state == HOME_STATE_ALIVE) { ping_home_server(home); } } else { /* * Revive it after a fixed period of time. This * is very, very, bad. */ home->when = *when; home->when.tv_sec += home->revive_interval; INSERT_EVENT(revive_home_server, home); } } static void check_for_zombie_home_server(REQUEST *request) { home_server *home; struct timeval when; home = request->home_server; if (home->state != HOME_STATE_ZOMBIE) return; when = home->zombie_period_start; when.tv_sec += home->zombie_period; fr_event_now(el, &now); if (timercmp(&now, &when, <)) { return; } mark_home_server_dead(home, &when); } static int proxy_to_virtual_server(REQUEST *request); static int virtual_server_handler(UNUSED REQUEST *request) { proxy_to_virtual_server(request); return 0; } static void proxy_fallback_handler(REQUEST *request) { /* * A proper time is required for wait_a_bit. */ request->delay = USEC / 10; gettimeofday(&now, NULL); request->next_when = now; tv_add(&request->next_when, request->delay); request->next_callback = wait_a_bit; /* * Re-queue the request. */ request->child_state = REQUEST_QUEUED; rad_assert(request->proxy != NULL); if (!thread_pool_addrequest(request, virtual_server_handler)) { request->child_state = REQUEST_DONE; } #ifdef HAVE_PTHREAD_H /* * MAY free the request if we're over max_request_time, * AND we're not in threaded mode! * * Note that we call this ONLY if we're threaded, as * if we're NOT threaded, request_post_handler() calls * wait_a_bit(), which means that "request" may not * exist any more... */ if (have_children) wait_a_bit(request); #endif } static int setup_post_proxy_fail(REQUEST *request) { DICT_VALUE *dval = NULL; VALUE_PAIR *vp; request->child_state = REQUEST_RUNNING; if (request->packet->code == PW_AUTHENTICATION_REQUEST) { dval = dict_valbyname(PW_POST_PROXY_TYPE, "Fail-Authentication"); } else if (request->packet->code == PW_ACCOUNTING_REQUEST) { dval = dict_valbyname(PW_POST_PROXY_TYPE, "Fail-Accounting"); #ifdef WITH_COA /* * See no_response_to_coa_request */ } else if (((request->packet->code >> 8) & 0xff) == PW_COA_REQUEST) { request->packet->code &= 0xff; /* restore it */ if (request->proxy->code == PW_COA_REQUEST) { dval = dict_valbyname(PW_POST_PROXY_TYPE, "Fail-CoA"); } else if (request->proxy->code == PW_DISCONNECT_REQUEST) { dval = dict_valbyname(PW_POST_PROXY_TYPE, "Fail-Disconnect"); } else { return 0; } #endif } else { return 0; } if (!dval) dval = dict_valbyname(PW_POST_PROXY_TYPE, "Fail"); if (!dval) { pairdelete(&request->config_items, PW_POST_PROXY_TYPE); return 0; } vp = pairfind(request->config_items, PW_POST_PROXY_TYPE); if (!vp) vp = radius_paircreate(request, &request->config_items, PW_POST_PROXY_TYPE, PW_TYPE_INTEGER); vp->vp_integer = dval->value; rad_assert(request->proxy_reply == NULL); return 1; } static int null_handler(UNUSED REQUEST *request) { return 0; } static void post_proxy_fail_handler(REQUEST *request) { /* * A proper time is required for wait_a_bit. */ request->delay = USEC / 10; gettimeofday(&now, NULL); /* * Not set up to run Post-Proxy-Type = Fail. * * Mark the request as still running, and figure out what * to do next. */ if (!setup_post_proxy_fail(request)) { request_post_handler(request); } else { /* * Re-queue the request. */ request->child_state = REQUEST_QUEUED; /* * There is a post-proxy-type of fail. We run * the request through the pre/post proxy * handlers, just like it was a real proxied * request. However, we set the per-request * handler to NULL, as we don't want to do * anything else. * * Note that when we're not threaded, this will * process the request even if it's greater than * max_request_time. That's not fatal. */ request->priority = 0; rad_assert(request->proxy != NULL); thread_pool_addrequest(request, null_handler); } /* * MAY free the request if we're over max_request_time, * AND we're not in threaded mode! * * Note that we call this ONLY if we're threaded, as * if we're NOT threaded, request_post_handler() calls * wait_a_bit(), which means that "request" may not * exist any more... */ if (have_children) wait_a_bit(request); } /* maybe check this against wait_for_proxy_id_to_expire? */ static void no_response_to_proxied_request(void *ctx) { REQUEST *request = ctx; time_t start; home_server *home; char buffer[128]; rad_assert(request->magic == REQUEST_MAGIC); rad_assert(request->child_state == REQUEST_PROXIED); /* * If we've failed over to an internal home server, * replace the callback with the correct one. This * is due to locking issues with child threads... */ if (request->home_server->server) { wait_a_bit(request); return; } check_for_zombie_home_server(request); home = request->home_server; /* * The default as of 2.1.7 is to allow requests to * fail-over to a backup home server when this one does * not respond. The old behavior can be configured as * well. */ if (home->no_response_fail) { radlog(L_ERR, "Rejecting request %u (proxy Id %d) due to lack of any response from home server %s port %d", request->number, request->proxy->id, inet_ntop(request->proxy->dst_ipaddr.af, &request->proxy->dst_ipaddr.ipaddr, buffer, sizeof(buffer)), request->proxy->dst_port); post_proxy_fail_handler(request); } else { struct timeval when; /* * Do nothing, and let the request time out. */ rad_assert(request->ev == NULL); when = request->received; when.tv_sec += request->root->max_request_time; request->child_state = REQUEST_DONE; request->next_when = when; request->next_callback = cleanup_delay; if (request->in_proxy_hash) remove_from_proxy_hash(request); wait_a_bit(request); } /* * Don't touch request due to race conditions */ /* * If it's not alive, don't try to make it a zombie. */ if (home->state != HOME_STATE_ALIVE) { /* * Don't check home->ev due to race conditions. */ return; } /* * We've received a real packet recently. Don't mark the * server as zombie until we've received NO packets for a * while. The "1/4" of zombie period was chosen rather * arbitrarily. It's a balance between too short, which * gives quick fail-over and fail-back, or too long, * where the proxy still sends packets to an unresponsive * home server. */ start = now.tv_sec - ((home->zombie_period + 3) / 4); if (home->last_packet >= start) { return; } /* * Set the home server to "zombie", as of the time * calculated above. */ home->state = HOME_STATE_ZOMBIE; home->zombie_period_start.tv_sec = start; home->zombie_period_start.tv_usec = USEC / 2; fr_event_delete(el, &home->ev); home->currently_outstanding = 0; home->num_received_pings = 0; radlog(L_PROXY, "Marking home server %s port %d as zombie (it looks like it is dead).", inet_ntop(home->ipaddr.af, &home->ipaddr.ipaddr, buffer, sizeof(buffer)), home->port); /* * Start pinging the home server. */ ping_home_server(home); } #endif static void wait_a_bit(void *ctx) { struct timeval when; REQUEST *request = ctx; fr_event_callback_t callback = NULL; rad_assert(request->magic == REQUEST_MAGIC); #ifdef WITH_COA /* * The CoA request is a new (internally generated) * request, created in a child thread. We therefore need * some way to tie its events back into the main event * handler. */ if (request->coa && !request->coa->proxy_reply && request->coa->next_callback) { request->coa->when = request->coa->next_when; INSERT_EVENT(request->coa->next_callback, request->coa); request->coa->next_callback = NULL; request->coa->parent = NULL; request->coa = NULL; } #endif switch (request->child_state) { case REQUEST_QUEUED: case REQUEST_RUNNING: /* * If we're not thread-capable, OR we're capable, * but have been told to run without threads, and * the request is still running. This is usually * because the request was proxied, and the home * server didn't respond. */ #ifdef HAVE_PTHREAD_H if (!have_children) #endif { request->child_state = REQUEST_DONE; goto done; } #ifdef HAVE_PTHREAD_H /* * If we have threads, wait for the child thread * to stop. */ when = request->received; when.tv_sec += request->root->max_request_time; /* * Normally called from the event loop with the * proper event loop time. Otherwise, called from * post proxy fail handler, which sets "now", and * this call won't re-set it, because we're not * in the event loop. */ fr_event_now(el, &now); /* * Request still has more time. Continue * waiting. */ if (timercmp(&now, &when, <)) { if (request->delay < (USEC / 10)) { request->delay = USEC / 10; } request->delay += request->delay >> 1; /* * Cap delays at something reasonable. */ if (request->delay > (request->root->max_request_time * USEC)) { request->delay = request->root->max_request_time * USEC; } request->when = now; tv_add(&request->when, request->delay); callback = wait_a_bit; break; } request->master_state = REQUEST_STOP_PROCESSING; /* * A child thread MAY still be running on the * request. Ask the thread to stop working on * the request. */ if (have_children && (request->thread_id == NO_CHILD_THREAD)) { radlog(L_ERR, "WARNING: Unresponsive thread %d for request %u, in component %s module %s", request->number, request->thread_id, request->component ? request->component : "", request->module ? request->module : ""); } request->delay = USEC; tv_add(&request->when, request->delay); callback = wait_for_child_to_die; break; #endif /* * Mark the request as no longer running, * and clean it up. */ case REQUEST_DONE: done: #ifdef HAVE_PTHREAD_H request->thread_id = NO_CHILD_THREAD; #endif #ifdef WITH_COA /* * This is a CoA request. It's been divorced * from everything else, so we clean it up now. */ if (!request->in_request_hash && request->proxy && (request->packet->code != request->proxy->code) && ((request->proxy->code == PW_COA_REQUEST) || (request->proxy->code == PW_DISCONNECT_REQUEST))) { /* * FIXME: Do CoA MIBs */ ev_request_free(&request); return; } #endif request_stats_final(request); cleanup_delay(request); return; case REQUEST_REJECT_DELAY: case REQUEST_CLEANUP_DELAY: #ifdef HAVE_PTHREAD_H request->thread_id = NO_CHILD_THREAD; #endif request_stats_final(request); /* FALL-THROUGH */ case REQUEST_PROXIED: rad_assert(request->next_callback != NULL); rad_assert(request->next_callback != wait_a_bit); request->when = request->next_when; callback = request->next_callback; request->next_callback = NULL; break; default: rad_panic("Internal sanity check failure"); return; } /* * Something major went wrong. Discard the request, and * keep running. * * FIXME: No idea why this happens or how to fix it... * It seems to happen *only* when requests are proxied, * and where the home server doesn't respond. So it looks * like a race condition above, but it happens in debug * mode, with no threads... */ if (!callback) { RDEBUG("WARNING: Internal sanity check failed in event handler for request %u: Discarding the request!", request->number); ev_request_free(&request); return; } INSERT_EVENT(callback, request); } #ifdef WITH_COA static void no_response_to_coa_request(void *ctx) { REQUEST *request = ctx; char buffer[128]; rad_assert(request->magic == REQUEST_MAGIC); rad_assert(request->child_state == REQUEST_PROXIED); rad_assert(request->home_server != NULL); rad_assert(!request->in_request_hash); radlog(L_ERR, "No response to CoA request sent to %s", inet_ntop(request->proxy->dst_ipaddr.af, &request->proxy->dst_ipaddr.ipaddr, buffer, sizeof(buffer))); /* * Hack. */ request->packet->code |= (PW_COA_REQUEST << 8); post_proxy_fail_handler(request); } static int update_event_timestamp(RADIUS_PACKET *packet, time_t when) { VALUE_PAIR *vp; vp = pairfind(packet->vps, PW_EVENT_TIMESTAMP); if (!vp) return 0; vp->vp_date = when; if (packet->data) { free(packet->data); packet->data = NULL; packet->data_len = 0; } return 1; /* time stamp updated */ } /* * Called when we haven't received a response to a CoA request. */ static void retransmit_coa_request(void *ctx) { int delay, frac; struct timeval mrd; REQUEST *request = ctx; rad_assert(request->magic == REQUEST_MAGIC); rad_assert(request->child_state == REQUEST_PROXIED); rad_assert(request->home_server != NULL); rad_assert(!request->in_request_hash); rad_assert(request->parent == NULL); fr_event_now(el, &now); /* * Cap count at MRC, if it is non-zero. */ if (request->home_server->coa_mrc && (request->num_coa_requests >= request->home_server->coa_mrc)) { no_response_to_coa_request(request); return; } /* * RFC 5080 Section 2.2.1 * * RT = 2*RTprev + RAND*RTprev * = 1.9 * RTprev + rand(0,.2) * RTprev * = 1.9 * RTprev + rand(0,1) * (RTprev / 5) */ delay = fr_rand(); delay ^= (delay >> 16); delay &= 0xffff; frac = request->delay / 5; delay = ((frac >> 16) * delay) + (((frac & 0xffff) * delay) >> 16); delay += (2 * request->delay) - (request->delay / 10); /* * Cap delay at MRT, if MRT is non-zero. */ if (request->home_server->coa_mrt && (delay > (request->home_server->coa_mrt * USEC))) { int mrt_usec = request->home_server->coa_mrt * USEC; /* * delay = MRT + RAND * MRT * = 0.9 MRT + rand(0,.2) * MRT */ delay = fr_rand(); delay ^= (delay >> 15); delay &= 0x1ffff; delay = ((mrt_usec >> 16) * delay) + (((mrt_usec & 0xffff) * delay) >> 16); delay += mrt_usec - (mrt_usec / 10); } request->delay = delay; request->when = now; tv_add(&request->when, request->delay); mrd = request->proxy_when; mrd.tv_sec += request->home_server->coa_mrd; /* * Cap duration at MRD. */ if (timercmp(&mrd, &request->when, <)) { request->when = mrd; INSERT_EVENT(no_response_to_coa_request, request); } else { INSERT_EVENT(retransmit_coa_request, request); } if (update_event_timestamp(request->proxy, now.tv_sec)) { if (!insert_into_proxy_hash(request, TRUE)) { DEBUG("ERROR: Failed to insert retransmission of CoA request into proxy list."); return; } request->num_proxied_requests = 0; request->num_proxied_responses = 0; } request->num_proxied_requests++; request->num_coa_requests++; /* is NOT reset by code 3 lines above! */ request->proxy_listener->send(request->proxy_listener, request); } /* * The original request is either DONE, or in CLEANUP_DELAY. */ static int originated_coa_request(REQUEST *request) { int delay, rcode, pre_proxy_type = 0; VALUE_PAIR *vp; REQUEST *coa; fr_ipaddr_t ipaddr; char buffer[256]; rad_assert(request->proxy == NULL); rad_assert(!request->in_proxy_hash); rad_assert(request->proxy_reply == NULL); /* * Check whether we want to originate one, or cancel one. */ vp = pairfind(request->config_items, PW_SEND_COA_REQUEST); if (!vp && request->coa) { vp = pairfind(request->coa->proxy->vps, PW_SEND_COA_REQUEST); } if (vp) { if (vp->vp_integer == 0) { ev_request_free(&request->coa); return 1; /* success */ } } if (!request->coa) request_alloc_coa(request); if (!request->coa) return 0; coa = request->coa; /* * src_ipaddr will be set up in proxy_encode. */ memset(&ipaddr, 0, sizeof(ipaddr)); vp = pairfind(coa->proxy->vps, PW_PACKET_DST_IP_ADDRESS); if (vp) { ipaddr.af = AF_INET; ipaddr.ipaddr.ip4addr.s_addr = vp->vp_ipaddr; } else if ((vp = pairfind(coa->proxy->vps, PW_PACKET_DST_IPV6_ADDRESS)) != NULL) { ipaddr.af = AF_INET6; ipaddr.ipaddr.ip6addr = vp->vp_ipv6addr; } else if ((vp = pairfind(coa->proxy->vps, PW_HOME_SERVER_POOL)) != NULL) { coa->home_pool = home_pool_byname(vp->vp_strvalue, HOME_TYPE_COA); if (!coa->home_pool) { RDEBUG2("WARNING: No such home_server_pool %s", vp->vp_strvalue); fail: ev_request_free(&request->coa); return 0; } /* * Prefer */ } else if (request->client->coa_pool) { coa->home_pool = request->client->coa_pool; } else if (request->client->coa_server) { coa->home_server = request->client->coa_server; } else { /* * If all else fails, send it to the client that * originated this request. */ memcpy(&ipaddr, &request->packet->src_ipaddr, sizeof(ipaddr)); } /* * Use the pool, if it exists. */ if (coa->home_pool) { coa->home_server = home_server_ldb(NULL, coa->home_pool, coa); if (!coa->home_server) { RDEBUG("WARNING: No live home server for home_server_pool %s", vp->vp_strvalue); goto fail; } } else if (!coa->home_server) { int port = PW_COA_UDP_PORT; vp = pairfind(coa->proxy->vps, PW_PACKET_DST_PORT); if (vp) port = vp->vp_integer; coa->home_server = home_server_find(&ipaddr, port); if (!coa->home_server) { RDEBUG2("WARNING: Unknown destination %s:%d for CoA request.", inet_ntop(ipaddr.af, &ipaddr.ipaddr, buffer, sizeof(buffer)), port); goto fail; } } vp = pairfind(coa->proxy->vps, PW_PACKET_TYPE); if (vp) { switch (vp->vp_integer) { case PW_COA_REQUEST: case PW_DISCONNECT_REQUEST: coa->proxy->code = vp->vp_integer; break; default: DEBUG("Cannot set CoA Packet-Type to code %d", vp->vp_integer); goto fail; } } if (!coa->proxy->code) coa->proxy->code = PW_COA_REQUEST; /* * The rest of the server code assumes that * request->packet && request->reply exist. Copy them * from the original request. */ rad_assert(coa->packet != NULL); rad_assert(coa->packet->vps == NULL); memcpy(coa->packet, request->packet, sizeof(*request->packet)); coa->packet->vps = paircopy(request->packet->vps); coa->packet->data = NULL; rad_assert(coa->reply != NULL); rad_assert(coa->reply->vps == NULL); memcpy(coa->reply, request->reply, sizeof(*request->reply)); coa->reply->vps = paircopy(request->reply->vps); coa->reply->data = NULL; coa->config_items = paircopy(request->config_items); /* * Call the pre-proxy routines. */ vp = pairfind(request->config_items, PW_PRE_PROXY_TYPE); if (vp) { RDEBUG2(" Found Pre-Proxy-Type %s", vp->vp_strvalue); pre_proxy_type = vp->vp_integer; } if (coa->home_pool && coa->home_pool->virtual_server) { const char *old_server = coa->server; coa->server = coa->home_pool->virtual_server; RDEBUG2(" server %s {", coa->server); rcode = module_pre_proxy(pre_proxy_type, coa); RDEBUG2(" }"); coa->server = old_server; } else { rcode = module_pre_proxy(pre_proxy_type, coa); } switch (rcode) { default: goto fail; /* * Only send the CoA packet if the pre-proxy code succeeded. */ case RLM_MODULE_NOOP: case RLM_MODULE_OK: case RLM_MODULE_UPDATED: break; } /* * Source IP / port is set when the proxy socket * is chosen. */ coa->proxy->dst_ipaddr = coa->home_server->ipaddr; coa->proxy->dst_port = coa->home_server->port; if (!insert_into_proxy_hash(coa, FALSE)) { DEBUG("ERROR: Failed to insert CoA request into proxy list."); goto fail; } /* * We CANNOT divorce the CoA request from the parent * request. This function is running in a child thread, * and we need access to the main event loop in order to * to add the timers for the CoA packet. See * wait_a_bit(). */ /* * Forget about the original request completely at this * point. */ request = coa; gettimeofday(&request->proxy_when, NULL); request->received = request->next_when = request->proxy_when; rad_assert(request->proxy_reply == NULL); /* * Implement re-transmit algorithm as per RFC 5080 * Section 2.2.1. * * We want IRT + RAND*IRT * or 0.9 IRT + rand(0,.2) IRT * * 2^20 ~ USEC, and we want 2. * rand(0,0.2) USEC ~ (rand(0,2^21) / 10) */ delay = (fr_rand() & ((1 << 22) - 1)) / 10; request->delay = delay * request->home_server->coa_irt; delay = request->home_server->coa_irt * USEC; delay -= delay / 10; delay += request->delay; request->delay = delay; tv_add(&request->next_when, delay); request->next_callback = retransmit_coa_request; /* * Note that we set proxied BEFORE sending the packet. * * Once we send it, the request is tainted, as * another thread may have picked it up. Don't * touch it! */ request->num_proxied_requests = 1; request->num_proxied_responses = 0; update_event_timestamp(request->proxy, request->proxy_when.tv_sec); request->child_state = REQUEST_PROXIED; DEBUG_PACKET(request, request->proxy, 1); #ifdef HAVE_PTHREAD_H request->thread_id = NO_CHILD_THREAD; #endif request->proxy_listener->send(request->proxy_listener, request); return 1; } #endif /* WITH_COA */ #ifdef WITH_PROXY static int process_proxy_reply(REQUEST *request) { int rcode; int post_proxy_type = 0; VALUE_PAIR *vp; /* * Delete any reply we had accumulated until now. */ pairfree(&request->reply->vps); /* * Run the packet through the post-proxy stage, * BEFORE playing games with the attributes. */ vp = pairfind(request->config_items, PW_POST_PROXY_TYPE); /* * If we have a proxy_reply, and it was a reject, setup * post-proxy-type Reject */ if (!vp && request->proxy_reply && request->proxy_reply->code == PW_AUTHENTICATION_REJECT) { DICT_VALUE *dval; dval = dict_valbyname(PW_POST_PROXY_TYPE, "Reject"); if (dval) { vp = radius_paircreate(request, &request->config_items, PW_POST_PROXY_TYPE, PW_TYPE_INTEGER); vp->vp_integer = dval->value; } } if (vp) { RDEBUG2(" Found Post-Proxy-Type %s", vp->vp_strvalue); post_proxy_type = vp->vp_integer; } if (request->home_pool && request->home_pool->virtual_server) { const char *old_server = request->server; request->server = request->home_pool->virtual_server; RDEBUG2(" server %s {", request->server); rcode = module_post_proxy(post_proxy_type, request); RDEBUG2(" }"); request->server = old_server; } else { rcode = module_post_proxy(post_proxy_type, request); } #ifdef WITH_COA if (request->packet->code == request->proxy->code) /* * Don't run the next bit if we originated a CoA * packet, after receiving an Access-Request or * Accounting-Request. */ #endif /* * There may NOT be a proxy reply, as we may be * running Post-Proxy-Type = Fail. */ if (request->proxy_reply) { /* * Delete the Proxy-State Attributes from * the reply. These include Proxy-State * attributes from us and remote server. */ pairdelete(&request->proxy_reply->vps, PW_PROXY_STATE); /* * Add the attributes left in the proxy * reply to the reply list. */ pairadd(&request->reply->vps, request->proxy_reply->vps); request->proxy_reply->vps = NULL; /* * Free proxy request pairs. */ pairfree(&request->proxy->vps); } switch (rcode) { default: /* Don't do anything */ break; case RLM_MODULE_FAIL: case RLM_MODULE_HANDLED: /* FIXME: debug print stuff */ #ifdef HAVE_PTHREAD_H request->thread_id = NO_CHILD_THREAD; #endif request->child_state = REQUEST_DONE; return 0; } return 1; } #endif static int request_pre_handler(REQUEST *request) { int rcode; rad_assert(request->magic == REQUEST_MAGIC); rad_assert(request->packet != NULL); request->child_state = REQUEST_RUNNING; /* * Don't decode the packet if it's an internal "fake" * request. Instead, just return so that the caller can * process it. */ if (request->packet->dst_port == 0) { request->username = pairfind(request->packet->vps, PW_USER_NAME); request->password = pairfind(request->packet->vps, PW_USER_PASSWORD); return 1; } #ifdef WITH_PROXY /* * Put the decoded packet into it's proper place. */ if (request->proxy_reply != NULL) { rcode = request->proxy_listener->decode(request->proxy_listener, request); DEBUG_PACKET(request, request->proxy_reply, 0); } else #endif if (request->packet->vps == NULL) { rcode = request->listener->decode(request->listener, request); if (debug_condition) { int result = FALSE; const char *my_debug = debug_condition; /* * Ignore parse errors. */ radius_evaluate_condition(request, RLM_MODULE_OK, 0, &my_debug, 1, &result); if (result) { request->options = 2; request->radlog = radlog_request; } } DEBUG_PACKET(request, request->packet, 0); } else { rcode = 0; } if (rcode < 0) { RDEBUG("%s Dropping packet without response.", fr_strerror()); request->reply->offset = -2; /* bad authenticator */ #ifdef HAVE_PTHREAD_H request->thread_id = NO_CHILD_THREAD; #endif request->child_state = REQUEST_DONE; return 0; } if (!request->username) { request->username = pairfind(request->packet->vps, PW_USER_NAME); } #ifdef WITH_PROXY if (request->proxy) { return process_proxy_reply(request); } #endif return 1; } #ifdef WITH_PROXY /* * Do state handling when we proxy a request. */ static int proxy_request(REQUEST *request) { struct timeval when; char buffer[128]; #ifdef WITH_COA if (request->coa) { RDEBUG("WARNING: Cannot proxy and originate CoA packets at the same time. Cancelling CoA request"); ev_request_free(&request->coa); } #endif if (request->home_server->server) { RDEBUG("ERROR: Cannot proxy to a virtual server."); return 0; } if (!insert_into_proxy_hash(request, FALSE)) { RDEBUG("ERROR: Failed to insert entry into proxy list."); return 0; } request->proxy_listener->encode(request->proxy_listener, request); when = request->received; when.tv_sec += request->root->max_request_time; gettimeofday(&request->proxy_when, NULL); request->next_when = request->proxy_when; request->next_when.tv_sec += request->home_server->response_window; rad_assert(request->home_server->response_window > 0); if (timercmp(&when, &request->next_when, <)) { request->next_when = when; } request->next_callback = no_response_to_proxied_request; RDEBUG2("Proxying request %u to home server %s port %d", request->number, inet_ntop(request->proxy->dst_ipaddr.af, &request->proxy->dst_ipaddr.ipaddr, buffer, sizeof(buffer)), request->proxy->dst_port); /* * Note that we set proxied BEFORE sending the packet. * * Once we send it, the request is tainted, as * another thread may have picked it up. Don't * touch it! */ request->num_proxied_requests = 1; request->num_proxied_responses = 0; #ifdef HAVE_PTHREAD_H request->thread_id = NO_CHILD_THREAD; #endif request->child_state = REQUEST_PROXIED; DEBUG_PACKET(request, request->proxy, 1); request->proxy_listener->send(request->proxy_listener, request); return 1; } /* * "Proxy" the request by sending it to a new virtual server. */ static int proxy_to_virtual_server(REQUEST *request) { REQUEST *fake; RAD_REQUEST_FUNP fun; if (!request->home_server || !request->home_server->server) return 0; if (request->parent) { RDEBUG2("WARNING: Cancelling proxy request to virtual server %s as this request was itself proxied.", request->home_server->server); return 0; } fake = request_alloc_fake(request); if (!fake) { RDEBUG2("WARNING: Out of memory"); return 0; } fake->packet->vps = paircopy(request->proxy->vps); fake->server = request->home_server->server; if (request->proxy->code == PW_AUTHENTICATION_REQUEST) { fun = rad_virtual_server; #ifdef WITH_ACCOUNTING } else if (request->proxy->code == PW_ACCOUNTING_REQUEST) { fun = rad_accounting; #endif } else { RDEBUG2("Unknown packet type %d", request->proxy->code); ev_request_free(&fake); return 0; } RDEBUG2(">>> Sending proxied request internally to virtual server."); radius_handle_request(fake, fun); RDEBUG2("<<< Received proxied response code %d from internal virtual server.", fake->reply->code); if (fake->reply->code != 0) { request->proxy_reply = fake->reply; fake->reply = NULL; } else { /* * There was no response */ setup_post_proxy_fail(request); } ev_request_free(&fake); if (!process_proxy_reply(request)) { return 0; } /* * Process it through the normal section again, but ONLY * if we received a proxy reply.. */ if (request->proxy_reply) { if (request->server) RDEBUG("server %s {", request->server != NULL ? request->server : ""); fun(request); if (request->server) RDEBUG("} # server %s", request->server != NULL ? request->server : ""); } return 2; /* success, but NOT '1' !*/ } /* * Return 1 if we did proxy it, or the proxy attempt failed * completely. Either way, the caller doesn't touch the request * any more if we return 1. */ static int successfully_proxied_request(REQUEST *request) { int rcode; int pre_proxy_type = 0; VALUE_PAIR *realmpair; VALUE_PAIR *strippedname; VALUE_PAIR *vp; char *realmname = NULL; home_server *home; REALM *realm = NULL; home_pool_t *pool; /* * If it was already proxied, do nothing. * * FIXME: This should really be a serious error. */ if (request->in_proxy_hash || (request->proxy_reply && (request->proxy_reply->code != 0))) { return 0; } realmpair = pairfind(request->config_items, PW_PROXY_TO_REALM); if (!realmpair || (realmpair->length == 0)) { int pool_type; vp = pairfind(request->config_items, PW_HOME_SERVER_POOL); if (!vp) return 0; switch (request->packet->code) { case PW_AUTHENTICATION_REQUEST: pool_type = HOME_TYPE_AUTH; break; #ifdef WITH_ACCOUNTING case PW_ACCOUNTING_REQUEST: pool_type = HOME_TYPE_ACCT; break; #endif #ifdef WITH_COA case PW_COA_REQUEST: case PW_DISCONNECT_REQUEST: pool_type = HOME_TYPE_COA; break; #endif default: return 0; } pool = home_pool_byname(vp->vp_strvalue, pool_type); if (!pool) { RDEBUG2("ERROR: Cannot proxy to unknown pool %s", vp->vp_strvalue); return 0; } realmname = NULL; /* no realms */ realm = NULL; goto found_pool; } realmname = (char *) realmpair->vp_strvalue; realm = realm_find2(realmname); if (!realm) { RDEBUG2("ERROR: Cannot proxy to unknown realm %s", realmname); return 0; } /* * Figure out which pool to use. */ if (request->packet->code == PW_AUTHENTICATION_REQUEST) { pool = realm->auth_pool; #ifdef WITH_ACCOUNTING } else if (request->packet->code == PW_ACCOUNTING_REQUEST) { pool = realm->acct_pool; #endif #ifdef WITH_COA } else if ((request->packet->code == PW_COA_REQUEST) || (request->packet->code == PW_DISCONNECT_REQUEST)) { pool = realm->acct_pool; #endif } else { rad_panic("Internal sanity check failed"); } if (!pool) { RDEBUG2(" WARNING: Cancelling proxy to Realm %s, as the realm is local.", realmname); return 0; } found_pool: home = home_server_ldb(realmname, pool, request); if (!home) { RDEBUG2("ERROR: Failed to find live home server for realm %s", realmname); return -1; } request->home_pool = pool; #ifdef WITH_COA /* * Once we've decided to proxy a request, we cannot send * a CoA packet. So we free up any CoA packet here. */ ev_request_free(&request->coa); #endif /* * Remember that we sent the request to a Realm. */ if (realmname) pairadd(&request->packet->vps, pairmake("Realm", realmname, T_OP_EQ)); /* * Strip the name, if told to. * * Doing it here catches the case of proxied tunneled * requests. */ if (realm && (realm->striprealm == TRUE) && (strippedname = pairfind(request->proxy->vps, PW_STRIPPED_USER_NAME)) != NULL) { /* * If there's a Stripped-User-Name attribute in * the request, then use THAT as the User-Name * for the proxied request, instead of the * original name. * * This is done by making a copy of the * Stripped-User-Name attribute, turning it into * a User-Name attribute, deleting the * Stripped-User-Name and User-Name attributes * from the vps list, and making the new * User-Name the head of the vps list. */ vp = pairfind(request->proxy->vps, PW_USER_NAME); if (!vp) { vp = radius_paircreate(request, NULL, PW_USER_NAME, PW_TYPE_STRING); rad_assert(vp != NULL); /* handled by above function */ /* Insert at the START of the list */ vp->next = request->proxy->vps; request->proxy->vps = vp; } memcpy(vp->vp_strvalue, strippedname->vp_strvalue, sizeof(vp->vp_strvalue)); vp->length = strippedname->length; /* * Do NOT delete Stripped-User-Name. */ } /* * If there is no PW_CHAP_CHALLENGE attribute but * there is a PW_CHAP_PASSWORD we need to add it * since we can't use the request authenticator * anymore - we changed it. */ if ((request->packet->code == PW_AUTHENTICATION_REQUEST) && pairfind(request->proxy->vps, PW_CHAP_PASSWORD) && pairfind(request->proxy->vps, PW_CHAP_CHALLENGE) == NULL) { vp = radius_paircreate(request, &request->proxy->vps, PW_CHAP_CHALLENGE, PW_TYPE_OCTETS); vp->length = AUTH_VECTOR_LEN; memcpy(vp->vp_strvalue, request->packet->vector, AUTH_VECTOR_LEN); } /* * The RFC's say we have to do this, but FreeRADIUS * doesn't need it. */ vp = radius_paircreate(request, &request->proxy->vps, PW_PROXY_STATE, PW_TYPE_OCTETS); snprintf(vp->vp_strvalue, sizeof(vp->vp_strvalue), "%d", request->packet->id); vp->length = strlen(vp->vp_strvalue); /* * Should be done BEFORE inserting into proxy hash, as * pre-proxy may use this information, or change it. */ request->proxy->code = request->packet->code; /* * Call the pre-proxy routines. */ vp = pairfind(request->config_items, PW_PRE_PROXY_TYPE); if (vp) { RDEBUG2(" Found Pre-Proxy-Type %s", vp->vp_strvalue); pre_proxy_type = vp->vp_integer; } rad_assert(request->home_pool != NULL); if (request->home_pool->virtual_server) { const char *old_server = request->server; request->server = request->home_pool->virtual_server; RDEBUG2(" server %s {", request->server); rcode = module_pre_proxy(pre_proxy_type, request); RDEBUG2(" }"); request->server = old_server; } else { rcode = module_pre_proxy(pre_proxy_type, request); } switch (rcode) { case RLM_MODULE_FAIL: case RLM_MODULE_INVALID: case RLM_MODULE_NOTFOUND: case RLM_MODULE_USERLOCK: default: /* FIXME: debug print failed stuff */ return -1; case RLM_MODULE_REJECT: case RLM_MODULE_HANDLED: return 0; /* * Only proxy the packet if the pre-proxy code succeeded. */ case RLM_MODULE_NOOP: case RLM_MODULE_OK: case RLM_MODULE_UPDATED: break; } /* * If it's a fake request, don't send the proxy * packet. The outer tunnel session will take * care of doing that. */ if (request->packet->dst_port == 0) { request->home_server = NULL; return 1; } if (request->home_server->server) { return proxy_to_virtual_server(request); } if (!proxy_request(request)) { RDEBUG("ERROR: Failed to proxy request %u", request->number); return -1; } return 1; } #endif static void request_post_handler(REQUEST *request) { int child_state = -1; struct timeval when; VALUE_PAIR *vp; if ((request->master_state == REQUEST_STOP_PROCESSING) || (request->parent && (request->parent->master_state == REQUEST_STOP_PROCESSING))) { RDEBUG2("request %u was cancelled.", request->number); child_state = REQUEST_DONE; goto cleanup; } if (request->child_state != REQUEST_RUNNING) { radlog(L_ERR, "Request %d is unexpectedly in state %d. Stopping it.", request->number, request->child_state); return; } #ifdef WITH_COA /* * If it's not in the request hash, it's a CoA request. * We hope. */ if (!request->in_request_hash && request->proxy && ((request->proxy->code == PW_COA_REQUEST) || (request->proxy->code == PW_DISCONNECT_REQUEST))) { request->next_callback = NULL; child_state = REQUEST_DONE; goto cleanup; } #endif /* * Catch Auth-Type := Reject BEFORE proxying the packet. */ if ((request->packet->code == PW_AUTHENTICATION_REQUEST) && (request->reply->code == 0) && ((vp = pairfind(request->config_items, PW_AUTH_TYPE)) != NULL) && (vp->vp_integer == PW_AUTHTYPE_REJECT)) { request->reply->code = PW_AUTHENTICATION_REJECT; } #ifdef WITH_PROXY if (request->root->proxy_requests && !request->in_proxy_hash && (request->reply->code == 0) && (request->packet->dst_port != 0) && (request->packet->code != PW_STATUS_SERVER)) { int rcode = successfully_proxied_request(request); if (rcode == 1) return; /* "request" is now untouchable */ /* * Failed proxying it (dead home servers, etc.) * Run it through Post-Proxy-Type = Fail, and * respond to the request. * * Note that we're in a child thread here, so we * do NOT re-schedule the request. Instead, we * do what we would have done, which is run the * pre-handler, a NULL request handler, and then * the post handler. */ if ((rcode < 0) && setup_post_proxy_fail(request)) { if (!request_pre_handler(request)) { return; } } /* * Else we weren't supposed to proxy it, * OR we proxied it internally to a virutal server. */ } #ifdef WITH_COA else if (request->proxy && request->coa) { RDEBUG("WARNING: Cannot proxy and originate CoA packets at the same time. Cancelling CoA request"); ev_request_free(&request->coa); } #endif #endif /* * Fake requests don't get encoded or signed. The caller * also requires the reply VP's, so we don't free them * here! */ if (request->packet->dst_port == 0) { /* FIXME: RDEBUG going to the next request */ #ifdef HAVE_PTHREAD_H request->thread_id = NO_CHILD_THREAD; #endif request->child_state = REQUEST_DONE; return; } #ifdef WITH_PROXY /* * Copy Proxy-State from the request to the reply. */ vp = paircopy2(request->packet->vps, PW_PROXY_STATE); if (vp) pairadd(&request->reply->vps, vp); #endif /* * Access-Requests get delayed or cached. */ switch (request->packet->code) { case PW_AUTHENTICATION_REQUEST: gettimeofday(&request->next_when, NULL); /* * Override the response code if a * control:Response-Packet-Type attribute is present. */ vp = pairfind(request->config_items, PW_RESPONSE_PACKET_TYPE); if (vp) { if (vp->vp_integer == 256) { RDEBUG2("Not responding to request %u", request->number); /* * Force cleanup after a long * time, so that we don't * re-process the packet. */ request->reply->code = 0; request->next_when.tv_sec += request->root->max_request_time; request->next_callback = cleanup_delay; child_state = REQUEST_CLEANUP_DELAY; break; } request->reply->code = vp->vp_integer; } else if (request->reply->code == 0) { RDEBUG2("There was no response configured: rejecting " "request %u", request->number); request->reply->code = PW_AUTHENTICATION_REJECT; } /* * Do post-auth. If it returns reject, then * run Post-Auth-Type Reject. */ if (request->reply->code == PW_AUTHENTICATION_ACK) { if (rad_postauth(request) == RLM_MODULE_REJECT) { request->reply->code = PW_AUTHENTICATION_REJECT; } } /* * Run rejected packets through * * Post-Auth-Type = Reject */ if (request->reply->code == PW_AUTHENTICATION_REJECT) { pairdelete(&request->config_items, PW_POST_AUTH_TYPE); vp = radius_pairmake(request, &request->config_items, "Post-Auth-Type", "Reject", T_OP_SET); if (vp) rad_postauth(request); /* * If configured, delay Access-Reject packets. * * If request->root->reject_delay = 0, we discover * that we have to send the packet now. */ when = request->received; when.tv_sec += request->root->reject_delay; if (timercmp(&when, &request->next_when, >)) { RDEBUG2("Delaying reject of request %u for %d seconds", request->number, request->root->reject_delay); request->next_when = when; request->next_callback = reject_delay; #ifdef HAVE_PTHREAD_H request->thread_id = NO_CHILD_THREAD; #endif request->child_state = REQUEST_REJECT_DELAY; return; } } /* FALL-THROUGH */ #ifdef WITH_COA case PW_COA_REQUEST: case PW_DISCONNECT_REQUEST: #endif request->next_when.tv_sec += request->root->cleanup_delay; request->next_callback = cleanup_delay; child_state = REQUEST_CLEANUP_DELAY; break; case PW_ACCOUNTING_REQUEST: request->next_callback = NULL; /* just to be safe */ child_state = REQUEST_DONE; break; /* * FIXME: Status-Server should probably not be * handled here... */ case PW_STATUS_SERVER: request->next_callback = NULL; child_state = REQUEST_DONE; break; default: /* * DHCP, VMPS, etc. */ request->next_callback = NULL; child_state = REQUEST_DONE; break; } /* * Suppress "no reply" packets here, unless we're reading * from the "detail" file. In that case, we've got to * tell the detail file handler that the request is dead, * and it should re-send it. * If configured, encode, sign, and send. */ if ((request->reply->code != 0) || (request->listener->type == RAD_LISTEN_DETAIL)) { DEBUG_PACKET(request, request->reply, 1); request->listener->send(request->listener, request); } #ifdef WITH_COA /* * Now that we've completely processed the request, * see if we need to originate a CoA request. But ONLY * if it wasn't proxied. */ if (!request->proxy && (request->packet->code != PW_COA_REQUEST) && (request->packet->code != PW_DISCONNECT_REQUEST) && (request->coa || (pairfind(request->config_items, PW_SEND_COA_REQUEST) != NULL))) { if (!originated_coa_request(request)) { RDEBUG2("Do CoA Fail handler here"); } /* request->coa is stil set, so we can update events */ } #endif cleanup: /* * Clean up. These are no longer needed. */ pairfree(&request->config_items); pairfree(&request->packet->vps); request->username = NULL; request->password = NULL; pairfree(&request->reply->vps); #ifdef WITH_PROXY if (request->proxy) { pairfree(&request->proxy->vps); if (request->proxy_reply) { pairfree(&request->proxy_reply->vps); } #if 0 /* * We're not tracking responses from the home * server, we can therefore free this memory in * the child thread. */ if (!request->in_proxy_hash) { rad_free(&request->proxy); rad_free(&request->proxy_reply); request->home_server = NULL; } #endif } #endif RDEBUG2("Finished request %u.", request->number); rad_assert(child_state >= 0); if (have_children) { #ifdef HAVE_PTHREAD_H request->thread_id = NO_CHILD_THREAD; #endif request->child_state = child_state; } else { request->child_state = child_state; /* * Single threaded mode: update timers now. */ wait_a_bit(request); } } static void received_retransmit(REQUEST *request, const RADCLIENT *client) { #ifdef WITH_PROXY char buffer[128]; #endif RAD_STATS_TYPE_INC(request->listener, total_dup_requests); RAD_STATS_CLIENT_INC(request->listener, client, total_dup_requests); switch (request->child_state) { case REQUEST_QUEUED: case REQUEST_RUNNING: radlog(L_ERR, "Discarding duplicate request from " "client %s port %d - ID: %u due to unfinished request %u in component %s module %s.", client->shortname, request->packet->src_port,request->packet->id, request->number, request->component, request->module); break; #ifdef WITH_PROXY case REQUEST_PROXIED: /* * We're not supposed to have duplicate * accounting packets. The other states handle * duplicates fine (discard, or send duplicate * reply). But we do NOT want to retransmit an * accounting request here, because that would * involve updating the Acct-Delay-Time, and * therefore changing the packet Id, etc. * * Instead, we just discard the packet. We may * eventually respond, or the client will send a * new accounting packet. * * The same comments go for Status-Server, and * other packet types. * * FIXME: coa: when we proxy CoA && Disconnect * packets, this logic has to be fixed. */ if (request->packet->code != PW_AUTHENTICATION_REQUEST) { radlog(L_ERR, "Discarding duplicate request from " "client %s port %d - ID: %u due to unfinished proxied request %u", client->shortname, request->packet->src_port,request->packet->id, request->number); break; } check_for_zombie_home_server(request); /* * If we've just discovered that the home server is * dead, send the packet to another one. */ if ((request->packet->dst_port != 0) && (request->home_server->state == HOME_STATE_IS_DEAD)) { home_server *home; remove_from_proxy_hash(request); home = home_server_ldb(NULL, request->home_pool, request); if (!home) { RDEBUG2("ERROR: Failed to find live home server for request %u", request->number); no_home_servers: /* * Do post-request processing, * and any insertion of necessary * events. */ post_proxy_fail_handler(request); return; } request->proxy->code = request->packet->code; /* * Free the old packet, to force re-encoding */ free(request->proxy->data); request->proxy->data = NULL; request->proxy->data_len = 0; /* * This request failed over to a virtual * server. Push it back onto the queue * to be processed. */ if (request->home_server->server) { proxy_fallback_handler(request); return; } /* * Try to proxy the request. */ if (!proxy_request(request)) { RDEBUG("ERROR: Failed to re-proxy request %u", request->number); goto no_home_servers; } /* * This code executes in the main server * thread, so there's no need for locking. */ rad_assert(request->next_callback != NULL); INSERT_EVENT(request->next_callback, request); request->next_callback = NULL; return; } /* else the home server is still alive */ RDEBUG2("Sending duplicate proxied request to home server %s port %d - ID: %d", inet_ntop(request->proxy->dst_ipaddr.af, &request->proxy->dst_ipaddr.ipaddr, buffer, sizeof(buffer)), request->proxy->dst_port, request->proxy->id); request->num_proxied_requests++; DEBUG_PACKET(request, request->proxy, 1); request->proxy_listener->send(request->proxy_listener, request); break; #endif case REQUEST_REJECT_DELAY: RDEBUG2("Waiting to send Access-Reject " "to client %s port %d - ID: %d", client->shortname, request->packet->src_port, request->packet->id); break; case REQUEST_CLEANUP_DELAY: case REQUEST_DONE: if (request->reply->code == 0) { RDEBUG2("Ignoring retransmit from client %s port %d " "- ID: %d, no reply was configured", client->shortname, request->packet->src_port, request->packet->id); return; } /* * FIXME: This sends duplicate replies to * accounting requests, even if Acct-Delay-Time * or Event-Timestamp is in the packet. In those * cases, the Id should be changed, and the packet * re-calculated. */ RDEBUG2("Sending duplicate reply " "to client %s port %d - ID: %d", client->shortname, request->packet->src_port, request->packet->id); DEBUG_PACKET(request, request->reply, 1); request->listener->send(request->listener, request); break; } } static void received_conflicting_request(REQUEST *request, const RADCLIENT *client) { radlog(L_ERR, "Received conflicting packet from " "client %s port %d - ID: %d due to unfinished request %u. Giving up on old request.", client->shortname, request->packet->src_port, request->packet->id, request->number); /* * Nuke it from the request hash, so we can receive new * packets. */ remove_from_request_hash(request); switch (request->child_state) { #ifdef HAVE_PTHREAD_H /* * It's queued or running. Tell it to stop, and * wait for it to do so. */ case REQUEST_QUEUED: case REQUEST_RUNNING: request->master_state = REQUEST_STOP_PROCESSING; request->delay += request->delay >> 1; tv_add(&request->when, request->delay); INSERT_EVENT(wait_for_child_to_die, request); return; #endif /* * Catch race conditions. It may have switched * from running to done while this code is being * executed. */ case REQUEST_REJECT_DELAY: case REQUEST_CLEANUP_DELAY: case REQUEST_DONE: break; /* * It's in some other state, and therefore also * in the event queue. At some point, the * child will notice, and we can then delete it. */ case REQUEST_PROXIED: default: break; } } static int can_handle_new_request(RADIUS_PACKET *packet, RADCLIENT *client, struct main_config_t *root) { /* * Count the total number of requests, to see if * there are too many. If so, return with an * error. */ if (root->max_requests) { int request_count = fr_packet_list_num_elements(pl); /* * This is a new request. Let's see if * it makes us go over our configured * bounds. */ if (request_count > root->max_requests) { radlog(L_ERR, "Dropping request (%d is too many): " "from client %s port %d - ID: %d", request_count, client->shortname, packet->src_port, packet->id); radlog(L_INFO, "WARNING: Please check the configuration file.\n" "\tThe value for 'max_requests' is probably set too low.\n"); return 0; } /* else there were a small number of requests */ } /* else there was no configured limit for requests */ /* * FIXME: Add per-client checks. If one client is sending * too many packets, start discarding them. * * We increment the counters here, and decrement them * when the response is sent... somewhere in this file. */ /* * FUTURE: Add checks for system load. If the system is * busy, start dropping requests... * * We can probably keep some statistics ourselves... if * there are more requests coming in than we can handle, * start dropping some. */ return 1; } int received_request(rad_listen_t *listener, RADIUS_PACKET *packet, REQUEST **prequest, RADCLIENT *client) { RADIUS_PACKET **packet_p; REQUEST *request = NULL; struct main_config_t *root = &mainconfig; packet_p = fr_packet_list_find(pl, packet); if (packet_p) { request = fr_packet2myptr(REQUEST, packet, packet_p); rad_assert(request->in_request_hash); if ((request->packet->data_len == packet->data_len) && (memcmp(request->packet->vector, packet->vector, sizeof(packet->vector)) == 0)) { received_retransmit(request, client); return 0; } /* * The new request is different from the old one, * but maybe the old is finished. If so, delete * the old one. */ switch (request->child_state) { struct timeval when; default: /* * Special hacks for race conditions. * The reply is encoded, and therefore * likely sent. We received a *new* * packet from the client, likely before * the next line or two of code which * updated the child state. In this * case, just accept the new request. */ if ((request->reply->code != 0) && request->reply->data) { radlog(L_INFO, "WARNING: Allowing fast client %s port %d - ID: %d for recent request %u.", client->shortname, packet->src_port, packet->id, request->number); remove_from_request_hash(request); request = NULL; break; } gettimeofday(&when, NULL); when.tv_sec -= 1; /* * If the cached request was received * within the last second, then we * discard the NEW request instead of the * old one. This will happen ONLY when * the client is severely broken, and is * sending conflicting packets very * quickly. */ if (timercmp(&when, &request->received, <)) { radlog(L_ERR, "Discarding conflicting packet from " "client %s port %d - ID: %d due to recent request %u.", client->shortname, packet->src_port, packet->id, request->number); return 0; } received_conflicting_request(request, client); request = NULL; break; case REQUEST_REJECT_DELAY: case REQUEST_CLEANUP_DELAY: request->child_state = REQUEST_DONE; /* FALL-THROUGH */ case REQUEST_DONE: cleanup_delay(request); request = NULL; break; } } /* * We may want to quench the new request. */ if ((listener->type != RAD_LISTEN_DETAIL) && !can_handle_new_request(packet, client, root)) { return 0; } /* * Create and initialize the new request. */ request = request_alloc(); /* never fails */ if ((request->reply = rad_alloc(0)) == NULL) { radlog(L_ERR, "No memory"); exit(1); } request->listener = listener; request->client = client; request->packet = packet; request->packet->timestamp = request->timestamp; request->number = request_num_counter++; request->priority = listener->type; #ifdef HAVE_PTHREAD_H request->thread_id = NO_CHILD_THREAD; #endif /* * Status-Server packets go to the head of the queue. */ if (request->packet->code == PW_STATUS_SERVER) request->priority = 0; /* * Set virtual server identity */ if (client->server) { request->server = client->server; } else if (listener->server) { request->server = listener->server; } else { request->server = NULL; } /* * Remember the request in the list. */ if (!fr_packet_list_insert(pl, &request->packet)) { radlog(L_ERR, "Failed to insert request %u in the list of live requests: discarding", request->number); ev_request_free(&request); return 0; } request->in_request_hash = TRUE; request->root = root; root->refcount++; /* * The request passes many of our sanity checks. * From here on in, if anything goes wrong, we * send a reject message, instead of dropping the * packet. */ /* * Build the reply template from the request. */ request->reply->sockfd = request->packet->sockfd; request->reply->dst_ipaddr = request->packet->src_ipaddr; request->reply->src_ipaddr = request->packet->dst_ipaddr; request->reply->dst_port = request->packet->src_port; request->reply->src_port = request->packet->dst_port; request->reply->id = request->packet->id; request->reply->code = 0; /* UNKNOWN code */ memcpy(request->reply->vector, request->packet->vector, sizeof(request->reply->vector)); request->reply->vps = NULL; request->reply->data = NULL; request->reply->data_len = 0; request->master_state = REQUEST_ACTIVE; request->child_state = REQUEST_QUEUED; request->next_callback = NULL; gettimeofday(&request->received, NULL); request->timestamp = request->received.tv_sec; request->when = request->received; request->delay = USEC; tv_add(&request->when, request->delay); INSERT_EVENT(wait_a_bit, request); *prequest = request; return 1; } #ifdef WITH_PROXY REQUEST *received_proxy_response(RADIUS_PACKET *packet) { char buffer[128]; REQUEST *request; /* * Also removes from the proxy hash if responses == requests */ request = lookup_in_proxy_hash(packet); if (!request) { radlog(L_PROXY, "No outstanding request was found for reply from host %s port %d - ID %d", inet_ntop(packet->src_ipaddr.af, &packet->src_ipaddr.ipaddr, buffer, sizeof(buffer)), packet->src_port, packet->id); return NULL; } /* * We haven't replied to the NAS, but we have seen an * earlier reply from the home server. Ignore this packet, * as we're likely still processing the previous reply. */ if (request->proxy_reply) { if (memcmp(request->proxy_reply->vector, packet->vector, sizeof(request->proxy_reply->vector)) == 0) { RDEBUG2("Discarding duplicate reply from host %s port %d - ID: %d for request %u", inet_ntop(packet->src_ipaddr.af, &packet->src_ipaddr.ipaddr, buffer, sizeof(buffer)), packet->src_port, packet->id, request->number); } else { /* * ? The home server gave us a new proxy * reply which doesn't match the old * one. Delete it. */ RDEBUG2("Ignoring conflicting proxy reply"); } /* assert that there's an event queued for request? */ return NULL; } /* * Verify the packet before doing ANYTHING with it. This * means we're doing more MD5 checks in the server core. * However, we can fix that by moving to multiple threads * listening on sockets. * * We do this AFTER looking the request up in the hash, * and AFTER vhecking if we saw a previous request. This * helps minimize the DoS effect of people attacking us * with spoofed packets. */ if (rad_verify(packet, request->proxy, request->home_server->secret) != 0) { DEBUG("Ignoring spoofed proxy reply. Signature is invalid"); return NULL; } gettimeofday(&now, NULL); /* * "ping" packets have a different algorithm for marking * a home server alive. They also skip all of the CoA, * etc. checks. */ if (!request->packet) { request->proxy_reply = packet; received_response_to_ping(request); request->proxy_reply = NULL; /* caller will free it */ ev_request_free(&request); return NULL; } /* * Maybe move this earlier in the decision process? * Having it here means that late or duplicate proxy * replies no longer get the home server marked as * "alive". This might be good for stability, though. * * FIXME: Do we really want to do this whenever we * receive a packet? Setting this here means that we * mark it alive on *any* packet, even if it's lost all * of the *other* packets in the last 10s. * * This behavior could be configurable. */ request->home_server->state = HOME_STATE_ALIVE; request->home_server->last_packet = now.tv_sec; #ifdef WITH_COA /* * When originating CoA, the "proxy" reply is the reply * to the CoA request that we originated. At this point, * the original request is finished, and it has a reply. * * However, if we haven't separated the two requests, do * so now. This is done so that cleaning up the original * request won't cause the CoA request to be free'd. See * util.c, request_free() */ if (request->parent && (request->parent->coa == request)) { request->parent->coa = NULL; request->parent = NULL; /* * The proxied packet was different from the * original packet, AND the proxied packet was * a CoA: allow it. */ } else if ((request->packet->code != request->proxy->code) && ((request->proxy->code == PW_COA_REQUEST) || (request->proxy->code == PW_DISCONNECT_REQUEST))) { /* * It's already divorced: do nothing. */ } else /* * Skip the next set of checks, as the original * reply is cached. We want to be able to still * process the CoA reply, AND to reference the * original request/reply. * * This is getting to be really quite a bit of a * hack. */ #endif /* * If there's a reply to the NAS, ignore everything * related to proxy responses */ if (request->reply && request->reply->code != 0) { RDEBUG2("Ignoring proxy reply that arrived after we sent a reply to the NAS"); return NULL; } #ifdef WITH_STATS /* * The average includes our time to receive packets and * look them up in the hashes, which should be the same * for all packets. * * We update the response time only for the FIRST packet * we receive. */ if (request->home_server->ema.window > 0) { radius_stats_ema(&request->home_server->ema, &now, &request->proxy_when); } #endif switch (request->child_state) { case REQUEST_QUEUED: case REQUEST_RUNNING: case REQUEST_REJECT_DELAY: case REQUEST_CLEANUP_DELAY: case REQUEST_DONE: radlog(L_ERR, "Reply from home server %s port %d - ID: %d arrived too late for request %u. Try increasing 'retry_delay' or 'max_request_time'", inet_ntop(packet->src_ipaddr.af, &packet->src_ipaddr.ipaddr, buffer, sizeof(buffer)), packet->src_port, packet->id, request->number); /* assert that there's an event queued for request? */ return NULL; case REQUEST_PROXIED: break; } request->proxy_reply = packet; #if 0 /* * Perform RTT calculations, as per RFC 2988 (for TCP). * Note that we only do so on the first response. */ if ((request->num_proxied_responses == 1) int rtt; home_server *home = request->home_server; rtt = now.tv_sec - request->proxy_when.tv_sec; rtt *= USEC; rtt += now.tv_usec; rtt -= request->proxy_when.tv_usec; if (!home->has_rtt) { home->has_rtt = TRUE; home->srtt = rtt; home->rttvar = rtt / 2; } else { home->rttvar -= home->rttvar >> 2; home->rttvar += (home->srtt - rtt); home->srtt -= home->srtt >> 3; home->srtt += rtt >> 3; } home->rto = home->srtt; if (home->rttvar > (USEC / 4)) { home->rto += home->rttvar * 4; } else { home->rto += USEC; } } #endif request->child_state = REQUEST_QUEUED; request->when = now; request->delay = USEC; request->priority = RAD_LISTEN_PROXY; tv_add(&request->when, request->delay); /* * Wait a bit will take care of max_request_time */ INSERT_EVENT(wait_a_bit, request); return request; } #endif void event_new_fd(rad_listen_t *this) { char buffer[1024]; if (this->status == RAD_LISTEN_STATUS_KNOWN) return; this->print(this, buffer, sizeof(buffer)); if (this->status == RAD_LISTEN_STATUS_INIT) { if (just_started) { DEBUG("Listening on %s", buffer); } else { radlog(L_INFO, " ... adding new socket %s", buffer); } if (!fr_event_fd_insert(el, 0, this->fd, event_socket_handler, this)) { radlog(L_ERR, "Failed remembering handle for proxy socket!"); exit(1); } this->status = RAD_LISTEN_STATUS_KNOWN; return; } if (this->status == RAD_LISTEN_STATUS_CLOSED) { DEBUG(" ... closing socket %s", buffer); fr_event_fd_delete(el, 0, this->fd); this->status = RAD_LISTEN_STATUS_FINISH; /* * Close the fd AFTER fixing up the requests and * listeners, so that they don't send/recv on the * wrong socket (if someone manages to open * another one). */ close(this->fd); this->fd = -1; } } static void handle_signal_self(int flag) { if ((flag & (RADIUS_SIGNAL_SELF_EXIT | RADIUS_SIGNAL_SELF_TERM)) != 0) { if ((flag & RADIUS_SIGNAL_SELF_EXIT) != 0) { radlog(L_INFO, "Signalled to exit"); fr_event_loop_exit(el, 1); } else { radlog(L_INFO, "Signalled to terminate"); fr_event_loop_exit(el, 2); } return; } /* else exit/term flags weren't set */ /* * Tell the even loop to stop processing. */ if ((flag & RADIUS_SIGNAL_SELF_HUP) != 0) { time_t when; static time_t last_hup = 0; when = time(NULL); if ((int) (when - last_hup) < 5) { radlog(L_INFO, "Ignoring HUP (less than 5s since last one)"); return; } radlog(L_INFO, "Received HUP signal."); last_hup = when; fr_event_loop_exit(el, 0x80); } #ifdef WITH_DETAIL if ((flag & RADIUS_SIGNAL_SELF_DETAIL) != 0) { rad_listen_t *this; /* * FIXME: O(N) loops suck. */ for (this = mainconfig.listen; this != NULL; this = this->next) { if (this->type != RAD_LISTEN_DETAIL) continue; /* * This one didn't send the signal, skip * it. */ if (!this->decode(this, NULL)) continue; /* * Go service the interrupt. */ event_poll_detail(this); } } #endif if ((flag & RADIUS_SIGNAL_SELF_NEW_FD) != 0) { rad_listen_t *this; for (this = mainconfig.listen; this != NULL; this = this->next) { event_new_fd(this); } } } #ifndef WITH_SELF_PIPE void radius_signal_self(int flag) { handle_signal_self(flag); } #else /* * Inform ourselves that we received a signal. */ void radius_signal_self(int flag) { ssize_t rcode; uint8_t buffer[16]; /* * The read MUST be non-blocking for this to work. */ rcode = read(self_pipe[0], buffer, sizeof(buffer)); if (rcode > 0) { ssize_t i; for (i = 0; i < rcode; i++) { buffer[0] |= buffer[i]; } } else { buffer[0] = 0; } buffer[0] |= flag; write(self_pipe[1], buffer, 1); } static void event_signal_handler(UNUSED fr_event_list_t *xel, UNUSED int fd, UNUSED void *ctx) { ssize_t i, rcode; uint8_t buffer[32]; rcode = read(self_pipe[0], buffer, sizeof(buffer)); if (rcode <= 0) return; /* * Merge pending signals. */ for (i = 0; i < rcode; i++) { buffer[0] |= buffer[i]; } handle_signal_self(buffer[0]); } #endif static void event_socket_handler(fr_event_list_t *xel, UNUSED int fd, void *ctx) { rad_listen_t *listener = ctx; RAD_REQUEST_FUNP fun; REQUEST *request; rad_assert(xel == el); xel = xel; if (listener->fd < 0) rad_panic("Socket was closed on us!"); if (!listener->recv(listener, &fun, &request)) return; if (!thread_pool_addrequest(request, fun)) { request->child_state = REQUEST_DONE; } } /* * This function is called periodically to see if this detail * file is available for reading. */ static void event_poll_detail(void *ctx) { int rcode, delay; RAD_REQUEST_FUNP fun; REQUEST *request; rad_listen_t *this = ctx; struct timeval when; listen_detail_t *detail = this->data; rad_assert(this->type == RAD_LISTEN_DETAIL); /* * Try to read something. * * FIXME: This does poll AND receive. */ rcode = this->recv(this, &fun, &request); if (rcode != 0) { rad_assert(fun != NULL); rad_assert(request != NULL); if (!thread_pool_addrequest(request, fun)) { request->child_state = REQUEST_DONE; } } if (!fr_event_now(el, &now)) gettimeofday(&now, NULL); when = now; /* * Backdoor API to get the delay until the next poll * time. */ delay = this->encode(this, NULL); tv_add(&when, delay); if (!fr_event_insert(el, event_poll_detail, this, &when, &detail->ev)) { radlog(L_ERR, "Failed creating handler"); exit(1); } } static void event_status(struct timeval *wake) { #if !defined(HAVE_PTHREAD_H) && defined(WNOHANG) int argval; #endif if (debug_flag == 0) { if (just_started) { radlog(L_INFO, "Ready to process requests."); just_started = FALSE; } return; } if (!wake) { radlog(L_INFO, "Ready to process requests."); } else if ((wake->tv_sec != 0) || (wake->tv_usec >= 100000)) { DEBUG("Waking up in %d.%01u seconds.", (int) wake->tv_sec, (unsigned int) wake->tv_usec / 100000); } /* * FIXME: Put this somewhere else, where it isn't called * all of the time... */ #if !defined(HAVE_PTHREAD_H) && defined(WNOHANG) /* * If there are no child threads, then there may * be child processes. In that case, wait for * their exit status, and throw that exit status * away. This helps get rid of zxombie children. */ while (waitpid(-1, &argval, WNOHANG) > 0) { /* do nothing */ } #endif } /* * Externally-visibly functions. */ int radius_event_init(CONF_SECTION *cs, int spawn_flag) { rad_listen_t *this, *head = NULL; if (el) return 0; time(&fr_start_time); el = fr_event_list_create(event_status); if (!el) return 0; pl = fr_packet_list_create(0); if (!pl) return 0; /* leak el */ request_num_counter = 0; #ifdef WITH_PROXY if (mainconfig.proxy_requests) { /* * Create the tree for managing proxied requests and * responses. */ proxy_list = fr_packet_list_create(1); if (!proxy_list) return 0; #ifdef HAVE_PTHREAD_H if (pthread_mutex_init(&proxy_mutex, NULL) != 0) { radlog(L_ERR, "FATAL: Failed to initialize proxy mutex: %s", strerror(errno)); exit(1); } #endif } #endif #ifdef HAVE_PTHREAD_H /* * Initialize the threads ONLY if we're spawning, AND * we're running normally. */ if (spawn_flag && !check_config && (thread_pool_init(cs, &spawn_flag) < 0)) { exit(1); } #endif /* * Move all of the thread calls to this file? * * It may be best for the mutexes to be in this file... */ have_children = spawn_flag; if (check_config) { DEBUG("%s: #### Skipping IP addresses and Ports ####", mainconfig.name); if (listen_init(cs, &head) < 0) { fflush(NULL); exit(1); } return 1; } #ifdef WITH_SELF_PIPE /* * Child threads need a pipe to signal us, as do the * signal handlers. */ if (pipe(self_pipe) < 0) { radlog(L_ERR, "radiusd: Error opening internal pipe: %s", strerror(errno)); exit(1); } if ((fcntl(self_pipe[0], F_SETFL, O_NONBLOCK) < 0) || (fcntl(self_pipe[0], F_SETFD, FD_CLOEXEC) < 0)) { radlog(L_ERR, "radiusd: Error setting internal flags: %s", strerror(errno)); exit(1); } if ((fcntl(self_pipe[1], F_SETFL, O_NONBLOCK) < 0) || (fcntl(self_pipe[1], F_SETFD, FD_CLOEXEC) < 0)) { radlog(L_ERR, "radiusd: Error setting internal flags: %s", strerror(errno)); exit(1); } if (!fr_event_fd_insert(el, 0, self_pipe[0], event_signal_handler, el)) { radlog(L_ERR, "Failed creating handler for signals"); exit(1); } #endif /* WITH_SELF_PIPE */ #ifdef WITH_PROXY /* * Mark the proxy Fd's as unused. */ { int i; for (i = 0; i < 32; i++) proxy_fds[i] = -1; } #endif DEBUG("%s: #### Opening IP addresses and Ports ####", mainconfig.name); /* * The server temporarily switches to an unprivileged * user very early in the bootstrapping process. * However, some sockets MAY require privileged access * (bind to device, or to port < 1024, or to raw * sockets). Those sockets need to call suid up/down * themselves around the functions that need a privileged * uid. */ if (listen_init(cs, &head) < 0) { _exit(1); } /* * At this point, no one has any business *ever* going * back to root uid. */ fr_suid_down_permanent(); /* * Add all of the sockets to the event loop. */ for (this = head; this != NULL; this = this->next) { char buffer[256]; this->print(this, buffer, sizeof(buffer)); switch (this->type) { #ifdef WITH_DETAIL case RAD_LISTEN_DETAIL: DEBUG("Listening on %s", buffer); /* * Detail files are always known, and aren't * put into the socket event loop. */ this->status = RAD_LISTEN_STATUS_KNOWN; /* * Set up the first poll interval. */ event_poll_detail(this); break; #endif #ifdef WITH_PROXY case RAD_LISTEN_PROXY: if (proxy_add_fds(this) < 0) { radlog(L_ERR, "Failed creating new proxy socket"); return 0; } if (!fr_packet_list_socket_add(proxy_list, this->fd)) { rad_assert(0 == 1); } /* FALL-THROUGH */ #endif default: break; } event_new_fd(this); } mainconfig.listen = head; return 1; } static int request_hash_cb(UNUSED void *ctx, void *data) { REQUEST *request = fr_packet2myptr(REQUEST, packet, data); #ifdef WITH_PROXY rad_assert(request->in_proxy_hash == FALSE); #endif ev_request_free(&request); return 0; } #ifdef WITH_PROXY static int proxy_hash_cb(UNUSED void *ctx, void *data) { REQUEST *request = fr_packet2myptr(REQUEST, proxy, data); ev_request_free(&request); return 0; } #endif void radius_event_free(void) { /* * Stop and join all threads. */ #ifdef HAVE_PTHREAD_H thread_pool_stop(); #endif #ifdef WITH_PROXY /* * There are requests in the proxy hash that aren't * referenced from anywhere else. Remove them first. */ if (proxy_list) { fr_packet_list_walk(proxy_list, NULL, proxy_hash_cb); fr_packet_list_free(proxy_list); proxy_list = NULL; } #endif fr_packet_list_walk(pl, NULL, request_hash_cb); fr_packet_list_free(pl); pl = NULL; fr_event_list_free(el); } int radius_event_process(void) { if (!el) return 0; return fr_event_loop(el); } void radius_handle_request(REQUEST *request, RAD_REQUEST_FUNP fun) { request->options = RAD_REQUEST_OPTION_DEBUG2; if (request_pre_handler(request)) { rad_assert(fun != NULL); rad_assert(request != NULL); if (request->server) RDEBUG("server %s {", request->server != NULL ? request->server : ""); fun(request); if (request->server) RDEBUG("} # server %s", request->server != NULL ? request->server : ""); request_post_handler(request); } DEBUG2("Going to the next request"); return; } freeradius-server/src/main/exec.c000066400000000000000000000263541257552170400173400ustar00rootroot00000000000000/* * exec.c Execute external programs. * * Version: $Id$ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2000-2004,2006 The FreeRADIUS server project */ #include RCSID("$Id$") #include #include #include #include #include #include #ifdef HAVE_SYS_WAIT_H # include #endif #ifndef WEXITSTATUS # define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8) #endif #ifndef WIFEXITED # define WIFEXITED(stat_val) (((stat_val) & 255) == 0) #endif #define MAX_ARGV (256) #define USEC 1000000 static void tv_sub(struct timeval *end, struct timeval *start, struct timeval *elapsed) { elapsed->tv_sec = end->tv_sec - start->tv_sec; if (elapsed->tv_sec > 0) { elapsed->tv_sec--; elapsed->tv_usec = USEC; } else { elapsed->tv_usec = 0; } elapsed->tv_usec += end->tv_usec; elapsed->tv_usec -= start->tv_usec; if (elapsed->tv_usec >= USEC) { elapsed->tv_usec -= USEC; elapsed->tv_sec++; } } /* * Execute a program on successful authentication. * Return 0 if exec_wait == 0. * Return the exit code of the called program if exec_wait != 0. * Return -1 on fork/other errors in the parent process. */ int radius_exec_program(const char *cmd, REQUEST *request, int exec_wait, char *user_msg, int msg_len, int timeout, VALUE_PAIR *input_pairs, VALUE_PAIR **output_pairs, int shell_escape) { VALUE_PAIR *vp; char *p; int pd[2]; pid_t pid, child_pid; int argc; int comma = 0; int status; int i; int n, left, done; char * const argv[MAX_ARGV]; char answer[4096]; char argv_buf[4096]; #define MAX_ENVP 1024 char *envp[MAX_ENVP]; struct timeval start; #ifdef O_NONBLOCK int nonblock = TRUE; #endif if (user_msg) *user_msg = '\0'; if (output_pairs) *output_pairs = NULL; argc = rad_expand_xlat(request, cmd, MAX_ARGV, argv, 1, sizeof(argv_buf), argv_buf); if (argc <= 0) { RDEBUG("Exec: invalid command line '%s'.", cmd); return -1; } #ifndef __MINGW32__ /* * Open a pipe for child/parent communication, if necessary. */ if (exec_wait) { if (pipe(pd) != 0) { RDEBUG("Exec: Couldn't open pipe: %s", strerror(errno)); return -1; } } else { /* * We're not waiting, so we don't look for a * message, or VP's. */ user_msg = NULL; output_pairs = NULL; } envp[0] = NULL; if (input_pairs) { int envlen; char buffer[1024]; /* * Set up the environment variables in the * parent, so we don't call libc functions that * hold mutexes. They might be locked when we fork, * and will remain locked in the child. */ envlen = 0; for (vp = input_pairs; vp != NULL; vp = vp->next) { /* * Hmm... maybe we shouldn't pass the * user's password in an environment * variable... */ snprintf(buffer, sizeof(buffer), "%s=", vp->name); if (shell_escape) { for (p = buffer; *p != '='; p++) { if (*p == '-') { *p = '_'; } else if (isalpha((int) *p)) { *p = toupper(*p); } } } n = strlen(buffer); vp_prints_value(buffer+n, sizeof(buffer) - n, vp, shell_escape); envp[envlen++] = strdup(buffer); /* * Don't add too many attributes. */ if (envlen == (MAX_ENVP - 1)) break; } envp[envlen] = NULL; } if (exec_wait) { pid = rad_fork(); /* remember PID */ } else { pid = fork(); /* don't wait */ } if (pid == 0) { int devnull; /* * Child process. * * We try to be fail-safe here. So if ANYTHING * goes wrong, we exit with status 1. */ /* * Open STDIN to /dev/null */ devnull = open("/dev/null", O_RDWR); if (devnull < 0) { RDEBUG("Exec: Failed opening /dev/null: %s\n", strerror(errno)); exit(1); } dup2(devnull, STDIN_FILENO); /* * Only massage the pipe handles if the parent * has created them. */ if (exec_wait) { /* * pd[0] is the FD the child will read from, * which we don't want. */ if (close(pd[0]) != 0) { RDEBUG("Exec: Can't close pipe: %s", strerror(errno)); exit(1); } /* * pd[1] is the FD that the child will write to, * so we make it STDOUT. */ if (dup2(pd[1], STDOUT_FILENO) != 1) { RDEBUG("Exec: Can't dup stdout: %s", strerror(errno)); exit(1); } } else { /* no pipe, STDOUT should be /dev/null */ dup2(devnull, STDOUT_FILENO); } /* * If we're not debugging, then we can't do * anything with the error messages, so we throw * them away. * * If we are debugging, then we want the error * messages to go to the STDERR of the server. */ if (debug_flag == 0) { dup2(devnull, STDERR_FILENO); } close(devnull); /* * The server may have MANY FD's open. We don't * want to leave dangling FD's for the child process * to play funky games with, so we close them. */ closefrom(3); execve(argv[0], argv, envp); RDEBUG("Exec: FAILED to execute %s: %s", argv[0], strerror(errno)); exit(1); } /* * Free child environment variables */ for (i = 0; envp[i] != NULL; i++) { free(envp[i]); } /* * Parent process. */ if (pid < 0) { RDEBUG("Exec: Couldn't fork %s: %s", argv[0], strerror(errno)); if (exec_wait) { close(pd[0]); close(pd[1]); } return -1; } /* * We're not waiting, exit, and ignore any child's status. */ if (!exec_wait) { return 0; } /* * Close the FD to which the child writes it's data. * * If we can't close it, then we close pd[0], and return an * error. */ if (close(pd[1]) != 0) { RDEBUG("Exec: Can't close pipe: %s", strerror(errno)); close(pd[0]); return -1; } #ifdef O_NONBLOCK /* * Try to set it non-blocking. */ do { int flags; if ((flags = fcntl(pd[0], F_GETFL, NULL)) < 0) { nonblock = FALSE; break; } flags |= O_NONBLOCK; if( fcntl(pd[0], F_SETFL, flags) < 0) { nonblock = FALSE; break; } } while (0); #endif /* * Read from the pipe until we doesn't get any more or * until the message is full. */ done = 0; left = sizeof(answer) - 1; gettimeofday(&start, NULL); while (1) { int rcode; fd_set fds; struct timeval when, elapsed, wake; FD_ZERO(&fds); FD_SET(pd[0], &fds); gettimeofday(&when, NULL); tv_sub(&when, &start, &elapsed); if (elapsed.tv_sec >= timeout) goto too_long; when.tv_sec = timeout; when.tv_usec = 0; tv_sub(&when, &elapsed, &wake); rcode = select(pd[0] + 1, &fds, NULL, NULL, &wake); if (rcode == 0) { too_long: radlog(L_INFO, "Child PID %u (%s) is taking too much time: forcing failure and killing child.", pid, argv[0]); kill(pid, SIGTERM); close(pd[0]); /* should give SIGPIPE to child, too */ /* * Clean up the child entry. */ rad_waitpid(pid, &status); return 1; } if (rcode < 0) { if (errno == EINTR) continue; break; } #ifdef O_NONBLOCK /* * Read as many bytes as possible. The kernel * will return the number of bytes available. */ if (nonblock) { status = read(pd[0], answer + done, left); } else #endif /* * There's at least 1 byte ready: read it. */ status = read(pd[0], answer + done, 1); /* * Nothing more to read: stop. */ if (status == 0) { break; } /* * Error: See if we have to continue. */ if (status < 0) { /* * We were interrupted: continue reading. */ if (errno == EINTR) { continue; } /* * There was another error. Most likely * The child process has finished, and * exited. */ break; } done += status; left -= status; if (left <= 0) break; } answer[done] = 0; /* * Make sure that the writer can't block while writing to * a pipe that no one is reading from anymore. */ close(pd[0]); DEBUG2("Exec output: %s", answer); /* * Parse the output, if any. */ if (done) { n = T_OP_INVALID; if (output_pairs) { /* * For backwards compatibility, first check * for plain text (user_msg). */ vp = NULL; n = userparse(answer, &vp); if (vp) pairfree(&vp); } if (n == T_OP_INVALID) { DEBUG("Exec plaintext: %s", answer); if (user_msg) { strlcpy(user_msg, answer, msg_len); } } else { /* * HACK: Replace '\n' with ',' so that * userparse() can parse the buffer in * one go (the proper way would be to * fix userparse(), but oh well). */ for (p = answer; *p; p++) { if (*p == '\n') { *p = comma ? ' ' : ','; p++; comma = 0; } if (*p == ',') comma++; } /* * Replace any trailing comma by a NUL. */ if (answer[strlen(answer) - 1] == ',') { answer[strlen(answer) - 1] = '\0'; } RDEBUG("Exec output: %s", answer); vp = NULL; if (userparse(answer, &vp) == T_OP_INVALID) { rad_assert(vp == NULL); RDEBUG("Exec: %s: unparsable reply", cmd); } else { /* * Tell the caller about the value * pairs. */ *output_pairs = vp; } } /* else the answer was a set of VP's, not a text message */ } /* else we didn't read anything from the child */ /* * Call rad_waitpid (should map to waitpid on non-threaded * or single-server systems). */ child_pid = rad_waitpid(pid, &status); if (child_pid == 0) { RDEBUG("Exec: Timeout waiting for program"); return 2; } if (child_pid == pid) { if (WIFEXITED(status)) { status = WEXITSTATUS(status); RDEBUG("Exec: program returned: %d", status); return status; } } RDEBUG("Exec: Abnormal child exit: %s", strerror(errno)); return 1; #else msg_len = msg_len; /* -Wunused */ if (exec_wait) { RDEBUG("Exec: Wait is not supported"); return -1; } /* * We're not waiting, so we don't look for a * message, or VP's. */ user_msg = NULL; output_pairs = NULL; { /* * The _spawn and _exec families of functions are * found in Windows compiler libraries for * portability from UNIX. There is a variety of * functions, including the ability to pass * either a list or array of parameters, to * search in the PATH or otherwise, and whether * or not to pass an environment (a set of * environment variables). Using _spawn, you can * also specify whether you want the new process * to close your program (_P_OVERLAY), to wait * until the new process is finished (_P_WAIT) or * for the two to run concurrently (_P_NOWAIT). * _spawn and _exec are useful for instances in * which you have simple requirements for running * the program, don't want the overhead of the * Windows header file, or are interested * primarily in portability. */ /* * FIXME: check return code... what is it? */ _spawnve(_P_NOWAIT, argv[0], argv, envp); } return 0; #endif } freeradius-server/src/main/files.c000066400000000000000000000152501257552170400175070ustar00rootroot00000000000000/* * files.c Read config files into memory. * * Version: $Id$ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2000,2006 The FreeRADIUS server project * Copyright 2000 Miquel van Smoorenburg * Copyright 2000 Alan DeKok */ #include RCSID("$Id$") #include #include #include #include #include /* * Free a PAIR_LIST */ void pairlist_free(PAIR_LIST **pl) { PAIR_LIST *p, *next; for (p = *pl; p; p = next) { /* name is allocated contiguous with p */ if (p->check) pairfree(&p->check); if (p->reply) pairfree(&p->reply); next = p->next; free(p); } *pl = NULL; } #define FIND_MODE_NAME 0 #define FIND_MODE_REPLY 1 /* * Read the users, huntgroups or hints file. * Return a PAIR_LIST. */ int pairlist_read(const char *file, PAIR_LIST **list, int complain) { FILE *fp; int mode = FIND_MODE_NAME; char entry[256]; char buffer[8192]; const char *ptr; VALUE_PAIR *check_tmp; VALUE_PAIR *reply_tmp; PAIR_LIST *pl = NULL, *t; PAIR_LIST **last = &pl; int lineno = 0; int old_lineno = 0; FR_TOKEN parsecode; char newfile[8192]; DEBUG2("reading pairlist file %s", file); /* * Open the file. The error message should be a little * more useful... */ if ((fp = fopen(file, "r")) == NULL) { if (!complain) return -1; radlog(L_CONS|L_ERR, "Couldn't open %s for reading: %s", file, strerror(errno)); return -1; } parsecode = T_EOL; /* * Read the entire file into memory for speed. */ while(fgets(buffer, sizeof(buffer), fp) != NULL) { lineno++; if (!feof(fp) && (strchr(buffer, '\n') == NULL)) { fclose(fp); radlog(L_ERR, "%s[%d]: line too long", file, lineno); pairlist_free(&pl); return -1; } if (buffer[0] == '#' || buffer[0] == '\n') continue; /* * If the line contains nothing but whitespace, * ignore it. */ ptr = buffer; while (isspace((int) *ptr)) ptr++; if (*ptr == '\0') continue; parse_again: if(mode == FIND_MODE_NAME) { /* * Find the entry starting with the users name */ if (isspace((int) buffer[0])) { if (parsecode != T_EOL) { radlog(L_ERR|L_CONS, "%s[%d]: Unexpected trailing comma for entry %s", file, lineno, entry); fclose(fp); return -1; } continue; } ptr = buffer; getword(&ptr, entry, sizeof(entry)); /* * Include another file if we see * $INCLUDE filename */ if (strcasecmp(entry, "$INCLUDE") == 0) { while(isspace((int) *ptr)) ptr++; /* * If it's an absolute pathname, * then use it verbatim. * * If not, then make the $include * files *relative* to the current * file. */ if (FR_DIR_IS_RELATIVE(ptr)) { char *p; strlcpy(newfile, file, sizeof(newfile)); p = strrchr(newfile, FR_DIR_SEP); if (!p) { p = newfile + strlen(newfile); *p = FR_DIR_SEP; } getword(&ptr, p + 1, sizeof(newfile) - 1 - (p - newfile)); } else { getword(&ptr, newfile, sizeof(newfile)); } t = NULL; if (pairlist_read(newfile, &t, 0) != 0) { pairlist_free(&pl); radlog(L_ERR|L_CONS, "%s[%d]: Could not open included file %s: %s", file, lineno, newfile, strerror(errno)); fclose(fp); return -1; } *last = t; /* * t may be NULL, it may have one * entry, or it may be a linked list * of entries. Go to the end of the * list. */ while (*last) last = &((*last)->next); continue; } /* * Parse the check values */ check_tmp = NULL; reply_tmp = NULL; old_lineno = lineno; parsecode = userparse(ptr, &check_tmp); if (parsecode == T_OP_INVALID) { pairlist_free(&pl); radlog(L_ERR|L_CONS, "%s[%d]: Parse error (check) for entry %s: %s", file, lineno, entry, fr_strerror()); fclose(fp); return -1; } else if (parsecode == T_COMMA) { radlog(L_ERR|L_CONS, "%s[%d]: Unexpected trailing comma in check item list for entry %s", file, lineno, entry); fclose(fp); return -1; } mode = FIND_MODE_REPLY; parsecode = T_COMMA; } else { if(*buffer == ' ' || *buffer == '\t') { if (parsecode != T_COMMA) { radlog(L_ERR|L_CONS, "%s[%d]: Syntax error: Previous line is missing a trailing comma for entry %s", file, lineno, entry); fclose(fp); return -1; } /* * Parse the reply values */ parsecode = userparse(buffer, &reply_tmp); /* valid tokens are 1 or greater */ if (parsecode < 1) { pairlist_free(&pl); radlog(L_ERR|L_CONS, "%s[%d]: Parse error (reply) for entry %s: %s", file, lineno, entry, fr_strerror()); fclose(fp); return -1; } } else { size_t entry_len; char *q; entry_len = strlen(entry) + 1; /* * Done with this entry... */ q = rad_malloc(sizeof(*t) + entry_len); t = (PAIR_LIST *) q; memset(t, 0, sizeof(*t)); t->check = check_tmp; t->reply = reply_tmp; t->lineno = old_lineno; check_tmp = NULL; reply_tmp = NULL; q += sizeof(*t); memcpy(q, entry, entry_len); t->name = q; *last = t; last = &(t->next); mode = FIND_MODE_NAME; if (buffer[0] != 0) goto parse_again; } } } /* * Make sure that we also read the last line of the file! */ if (mode == FIND_MODE_REPLY) { buffer[0] = 0; goto parse_again; } fclose(fp); *list = pl; return 0; } /* * Debug code. */ #if 0 static void debug_pair_list(PAIR_LIST *pl) { VALUE_PAIR *vp; while(pl) { printf("Pair list: %s\n", pl->name); printf("** Check:\n"); for(vp = pl->check; vp; vp = vp->next) { printf(" "); fprint_attr_val(stdout, vp); printf("\n"); } printf("** Reply:\n"); for(vp = pl->reply; vp; vp = vp->next) { printf(" "); fprint_attr_val(stdout, vp); printf("\n"); } pl = pl->next; } } #endif freeradius-server/src/main/listen.c000066400000000000000000001513211257552170400177030ustar00rootroot00000000000000/* * listen.c Handle socket stuff * * Version: $Id$ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2005,2006 The FreeRADIUS server project * Copyright 2005 Alan DeKok */ #include RCSID("$Id$") #include #include #include #include #include #include #include #ifdef WITH_UDPFROMTO #include #endif #ifdef HAVE_SYS_RESOURCE_H #include #endif #ifdef HAVE_NET_IF_H #include #endif #ifdef HAVE_FCNTL_H #include #endif /* * We'll use this below. */ typedef int (*rad_listen_parse_t)(CONF_SECTION *, rad_listen_t *); typedef void (*rad_listen_free_t)(rad_listen_t *); typedef struct rad_listen_master_t { rad_listen_parse_t parse; rad_listen_free_t free; rad_listen_recv_t recv; rad_listen_send_t send; rad_listen_print_t print; rad_listen_encode_t encode; rad_listen_decode_t decode; } rad_listen_master_t; typedef struct listen_socket_t { /* * For normal sockets. */ fr_ipaddr_t ipaddr; int port; const char *interface; RADCLIENT_LIST *clients; } listen_socket_t; static rad_listen_t *listen_alloc(RAD_LISTEN_TYPE type); /* * Xlat for %{listen:foo} */ static size_t xlat_listen(UNUSED void *instance, REQUEST *request, char *fmt, char *out, size_t outlen, UNUSED RADIUS_ESCAPE_STRING func) { const char *value = NULL; CONF_PAIR *cp; if (!fmt || !out || (outlen < 1)) return 0; if (!request || !request->listener) { *out = '\0'; return 0; } cp = cf_pair_find(request->listener->cs, fmt); if (!cp || !(value = cf_pair_value(cp))) { *out = '\0'; return 0; } strlcpy(out, value, outlen); return strlen(out); } /* * Find a per-socket client. */ RADCLIENT *client_listener_find(const rad_listen_t *listener, const fr_ipaddr_t *ipaddr, int src_port) { #ifdef WITH_DYNAMIC_CLIENTS int rcode; REQUEST *request; RADCLIENT *created; #endif time_t now; RADCLIENT *client; RADCLIENT_LIST *clients; rad_assert(listener != NULL); rad_assert(ipaddr != NULL); clients = ((listen_socket_t *)listener->data)->clients; /* * This HAS to have been initialized previously. */ rad_assert(clients != NULL); client = client_find(clients, ipaddr); if (!client) { static time_t last_printed = 0; char name[256], buffer[128]; #ifdef WITH_DYNAMIC_CLIENTS unknown: /* used only for dynamic clients */ #endif /* * DoS attack quenching, but only in debug mode. * If they're running in debug mode, show them * every packet. */ if (debug_flag == 0) { now = time(NULL); if (last_printed == now) return NULL; last_printed = now; } listener->print(listener, name, sizeof(name)); radlog(L_ERR, "Ignoring request to %s from unknown client %s port %d", name, inet_ntop(ipaddr->af, &ipaddr->ipaddr, buffer, sizeof(buffer)), src_port); return NULL; } #ifndef WITH_DYNAMIC_CLIENTS return client; /* return the found client. */ #else /* * No server defined, and it's not dynamic. Return it. */ if (!client->client_server && !client->dynamic) return client; now = time(NULL); /* * It's a dynamically generated client, check it. */ if (client->dynamic && (src_port != 0)) { /* * Lives forever. Return it. */ if (client->lifetime == 0) return client; /* * Rate-limit the deletion of known clients. * This makes them last a little longer, but * prevents the server from melting down if (say) * 10k clients all expire at once. */ if (now == client->last_new_client) return client; /* * It's not dead yet. Return it. */ if ((client->created + client->lifetime) > now) return client; /* * This really puts them onto a queue for later * deletion. */ client_delete(clients, client); /* * Go find the enclosing network again. */ client = client_find(clients, ipaddr); /* * WTF? */ if (!client) goto unknown; if (!client->client_server) goto unknown; /* * At this point, 'client' is the enclosing * network that configures where dynamic clients * can be defined. */ rad_assert(client->dynamic == 0); } else if (!client->dynamic && client->rate_limit) { /* * The IP is unknown, so we've found an enclosing * network. Enable DoS protection. We only * allow one new client per second. Known * clients aren't subject to this restriction. */ if (now == client->last_new_client) goto unknown; } client->last_new_client = now; request = request_alloc(); if (!request) goto unknown; request->listener = listener; request->client = client; request->packet = rad_recv(listener->fd, 0x02); /* MSG_PEEK */ if (!request->packet) { /* badly formed, etc */ request_free(&request); goto unknown; } request->reply = rad_alloc_reply(request->packet); if (!request->reply) { request_free(&request); goto unknown; } request->packet->timestamp = request->timestamp; request->number = 0; request->priority = listener->type; request->server = client->client_server; request->root = &mainconfig; /* * Run a fake request through the given virtual server. * Look for FreeRADIUS-Client-IP-Address * FreeRADIUS-Client-Secret * ... * * and create the RADCLIENT structure from that. */ DEBUG("server %s {", request->server); rcode = module_authorize(0, request); DEBUG("} # server %s", request->server); if (rcode != RLM_MODULE_OK) { request_free(&request); goto unknown; } /* * If the client was updated by rlm_dynamic_clients, * don't create the client from attribute-value pairs. */ if (request->client == client) { created = client_create(clients, request); } else { created = request->client; /* * This frees the client if it isn't valid. */ if (!client_validate(clients, client, created)) goto unknown; } request_free(&request); if (!created) goto unknown; return created; #endif } static int listen_bind(rad_listen_t *this); /* * Process and reply to a server-status request. * Like rad_authenticate and rad_accounting this should * live in it's own file but it's so small we don't bother. */ static int rad_status_server(REQUEST *request) { int rcode = RLM_MODULE_OK; DICT_VALUE *dval; switch (request->listener->type) { #ifdef WITH_STATS case RAD_LISTEN_NONE: #endif case RAD_LISTEN_AUTH: dval = dict_valbyname(PW_AUTZ_TYPE, "Status-Server"); if (dval) { rcode = module_authorize(dval->value, request); } else { rcode = RLM_MODULE_OK; } switch (rcode) { case RLM_MODULE_OK: case RLM_MODULE_UPDATED: request->reply->code = PW_AUTHENTICATION_ACK; break; case RLM_MODULE_FAIL: case RLM_MODULE_HANDLED: request->reply->code = 0; /* don't reply */ break; default: case RLM_MODULE_REJECT: request->reply->code = PW_AUTHENTICATION_REJECT; break; } break; #ifdef WITH_ACCOUNTING case RAD_LISTEN_ACCT: dval = dict_valbyname(PW_ACCT_TYPE, "Status-Server"); if (dval) { rcode = module_accounting(dval->value, request); } else { rcode = RLM_MODULE_OK; } switch (rcode) { case RLM_MODULE_OK: case RLM_MODULE_UPDATED: request->reply->code = PW_ACCOUNTING_RESPONSE; break; default: request->reply->code = 0; /* don't reply */ break; } break; #endif #ifdef WITH_COA /* * This is a vendor extension. Suggested by Glen * Zorn in IETF 72, and rejected by the rest of * the WG. We like it, so it goes in here. */ case RAD_LISTEN_COA: dval = dict_valbyname(PW_RECV_COA_TYPE, "Status-Server"); if (dval) { rcode = module_recv_coa(dval->value, request); } else { rcode = RLM_MODULE_OK; } switch (rcode) { case RLM_MODULE_OK: case RLM_MODULE_UPDATED: request->reply->code = PW_COA_ACK; break; default: request->reply->code = 0; /* don't reply */ break; } break; #endif default: return 0; } #ifdef WITH_STATS /* * Full statistics are available only on a statistics * socket. */ if (request->listener->type == RAD_LISTEN_NONE) { request_stats_reply(request); } #endif return 0; } static int socket_print(const rad_listen_t *this, char *buffer, size_t bufsize) { size_t len; listen_socket_t *sock = this->data; const char *name; switch (this->type) { #ifdef WITH_STATS case RAD_LISTEN_NONE: /* what a hack... */ name = "status"; break; #endif case RAD_LISTEN_AUTH: name = "authentication"; break; #ifdef WITH_ACCOUNTING case RAD_LISTEN_ACCT: name = "accounting"; break; #endif #ifdef WITH_PROXY case RAD_LISTEN_PROXY: name = "proxy"; break; #endif #ifdef WITH_VMPS case RAD_LISTEN_VQP: name = "vmps"; break; #endif #ifdef WITH_DHCP case RAD_LISTEN_DHCP: name = "dhcp"; break; #endif #ifdef WITH_COA case RAD_LISTEN_COA: name = "coa"; break; #endif default: name = "??"; break; } #define FORWARD len = strlen(buffer); if (len >= (bufsize + 1)) return 0;buffer += len;bufsize -= len #define ADDSTRING(_x) strlcpy(buffer, _x, bufsize);FORWARD ADDSTRING(name); if (sock->interface) { ADDSTRING(" interface "); ADDSTRING(sock->interface); } ADDSTRING(" address "); if ((sock->ipaddr.af == AF_INET) && (sock->ipaddr.ipaddr.ip4addr.s_addr == htonl(INADDR_ANY))) { strlcpy(buffer, "*", bufsize); } else { ip_ntoh(&sock->ipaddr, buffer, bufsize); } FORWARD; ADDSTRING(" port "); snprintf(buffer, bufsize, "%d", sock->port); FORWARD; if (this->server) { ADDSTRING(" as server "); ADDSTRING(this->server); } #undef ADDSTRING #undef FORWARD return 1; } extern int check_config; /* radiusd.c */ /* * Parse an authentication or accounting socket. */ static int common_socket_parse(CONF_SECTION *cs, rad_listen_t *this) { int rcode; int listen_port; fr_ipaddr_t ipaddr; listen_socket_t *sock = this->data; char *section_name = NULL; CONF_SECTION *client_cs, *parentcs; this->cs = cs; /* * Try IPv4 first */ memset(&ipaddr, 0, sizeof(ipaddr)); ipaddr.ipaddr.ip4addr.s_addr = htonl(INADDR_NONE); rcode = cf_item_parse(cs, "ipaddr", PW_TYPE_IPADDR, &ipaddr.ipaddr.ip4addr, NULL); if (rcode < 0) return -1; if (rcode == 0) { /* successfully parsed IPv4 */ ipaddr.af = AF_INET; } else { /* maybe IPv6? */ rcode = cf_item_parse(cs, "ipv6addr", PW_TYPE_IPV6ADDR, &ipaddr.ipaddr.ip6addr, NULL); if (rcode < 0) return -1; if (rcode == 1) { cf_log_err(cf_sectiontoitem(cs), "No address specified in listen section"); return -1; } ipaddr.af = AF_INET6; ipaddr.scope = 0; } rcode = cf_item_parse(cs, "port", PW_TYPE_INTEGER, &listen_port, "0"); if (rcode < 0) return -1; if ((listen_port < 0) || (listen_port > 65535)) { cf_log_err(cf_sectiontoitem(cs), "Invalid value for \"port\""); return -1; } sock->ipaddr = ipaddr; sock->port = listen_port; if (check_config) { return 0; /* don't do anything */ } /* * If we can bind to interfaces, do so, * else don't. */ if (cf_pair_find(cs, "interface")) { const char *value; CONF_PAIR *cp = cf_pair_find(cs, "interface"); rad_assert(cp != NULL); value = cf_pair_value(cp); if (!value) { cf_log_err(cf_sectiontoitem(cs), "No interface name given"); return -1; } sock->interface = value; } /* * And bind it to the port. */ if (listen_bind(this) < 0) { char buffer[128]; cf_log_err(cf_sectiontoitem(cs), "Error binding to port for %s port %d", ip_ntoh(&sock->ipaddr, buffer, sizeof(buffer)), sock->port); return -1; } #ifdef WITH_PROXY /* * Proxy sockets don't have clients. */ if (this->type == RAD_LISTEN_PROXY) return 0; #endif /* * The more specific configurations are preferred to more * generic ones. */ client_cs = NULL; parentcs = cf_top_section(cs); rcode = cf_item_parse(cs, "clients", PW_TYPE_STRING_PTR, §ion_name, NULL); if (rcode < 0) return -1; /* bad string */ if (rcode == 0) { /* * Explicit list given: use it. */ client_cs = cf_section_sub_find_name2(parentcs, "clients", section_name); if (!client_cs) { client_cs = cf_section_find(section_name); } if (!client_cs) { cf_log_err(cf_sectiontoitem(cs), "Failed to find clients %s {...}", section_name); free(section_name); return -1; } free(section_name); } /* else there was no "clients = " entry. */ if (!client_cs) { CONF_SECTION *server_cs; server_cs = cf_section_sub_find_name2(parentcs, "server", this->server); /* * Found a "server foo" section. If there are clients * in it, use them. */ if (server_cs && (cf_section_sub_find(server_cs, "client") != NULL)) { client_cs = server_cs; } } /* * Still nothing. Look for global clients. */ if (!client_cs) client_cs = parentcs; sock->clients = clients_parse_section(client_cs); if (!sock->clients) { cf_log_err(cf_sectiontoitem(cs), "Failed to load clients for this listen section"); return -1; } return 0; } /* * Send an authentication response packet */ static int auth_socket_send(rad_listen_t *listener, REQUEST *request) { rad_assert(request->listener == listener); rad_assert(listener->send == auth_socket_send); return rad_send(request->reply, request->packet, request->client->secret); } #ifdef WITH_ACCOUNTING /* * Send an accounting response packet (or not) */ static int acct_socket_send(rad_listen_t *listener, REQUEST *request) { rad_assert(request->listener == listener); rad_assert(listener->send == acct_socket_send); /* * Accounting reject's are silently dropped. * * We do it here to avoid polluting the rest of the * code with this knowledge */ if (request->reply->code == 0) return 0; return rad_send(request->reply, request->packet, request->client->secret); } #endif #ifdef WITH_PROXY /* * Send a packet to a home server. * * FIXME: have different code for proxy auth & acct! */ static int proxy_socket_send(rad_listen_t *listener, REQUEST *request) { listen_socket_t *sock = listener->data; rad_assert(request->proxy_listener == listener); rad_assert(listener->send == proxy_socket_send); request->proxy->src_ipaddr = sock->ipaddr; request->proxy->src_port = sock->port; return rad_send(request->proxy, NULL, request->home_server->secret); } #endif #ifdef WITH_STATS /* * Check if an incoming request is "ok" * * It takes packets, not requests. It sees if the packet looks * OK. If so, it does a number of sanity checks on it. */ static int stats_socket_recv(rad_listen_t *listener, RAD_REQUEST_FUNP *pfun, REQUEST **prequest) { ssize_t rcode; int code, src_port; RADIUS_PACKET *packet; RADCLIENT *client; fr_ipaddr_t src_ipaddr; rcode = rad_recv_header(listener->fd, &src_ipaddr, &src_port, &code); if (rcode < 0) return 0; RAD_STATS_TYPE_INC(listener, total_requests); if (rcode < 20) { /* AUTH_HDR_LEN */ RAD_STATS_TYPE_INC(listener, total_malformed_requests); return 0; } if ((client = client_listener_find(listener, &src_ipaddr, src_port)) == NULL) { rad_recv_discard(listener->fd); RAD_STATS_TYPE_INC(listener, total_invalid_requests); return 0; } /* * We only understand Status-Server on this socket. */ if (code != PW_STATUS_SERVER) { DEBUG("Ignoring packet code %d sent to Status-Server port", code); rad_recv_discard(listener->fd); RAD_STATS_TYPE_INC(listener, total_unknown_types); RAD_STATS_CLIENT_INC(listener, client, total_unknown_types); return 0; } /* * Now that we've sanity checked everything, receive the * packet. */ packet = rad_recv(listener->fd, 1); /* require message authenticator */ if (!packet) { RAD_STATS_TYPE_INC(listener, total_malformed_requests); DEBUG("%s", fr_strerror()); return 0; } if (!received_request(listener, packet, prequest, client)) { RAD_STATS_TYPE_INC(listener, total_packets_dropped); RAD_STATS_CLIENT_INC(listener, client, total_packets_dropped); rad_free(&packet); return 0; } *pfun = rad_status_server; return 1; } #endif /* * Check if an incoming request is "ok" * * It takes packets, not requests. It sees if the packet looks * OK. If so, it does a number of sanity checks on it. */ static int auth_socket_recv(rad_listen_t *listener, RAD_REQUEST_FUNP *pfun, REQUEST **prequest) { ssize_t rcode; int code, src_port; RADIUS_PACKET *packet; RAD_REQUEST_FUNP fun = NULL; RADCLIENT *client; fr_ipaddr_t src_ipaddr; rcode = rad_recv_header(listener->fd, &src_ipaddr, &src_port, &code); if (rcode < 0) return 0; RAD_STATS_TYPE_INC(listener, total_requests); if (rcode < 20) { /* AUTH_HDR_LEN */ RAD_STATS_TYPE_INC(listener, total_malformed_requests); return 0; } if ((client = client_listener_find(listener, &src_ipaddr, src_port)) == NULL) { rad_recv_discard(listener->fd); RAD_STATS_TYPE_INC(listener, total_invalid_requests); return 0; } /* * Some sanity checks, based on the packet code. */ switch(code) { case PW_AUTHENTICATION_REQUEST: RAD_STATS_CLIENT_INC(listener, client, total_requests); fun = rad_authenticate; break; case PW_STATUS_SERVER: if (!mainconfig.status_server) { rad_recv_discard(listener->fd); RAD_STATS_TYPE_INC(listener, total_packets_dropped); RAD_STATS_CLIENT_INC(listener, client, total_packets_dropped); DEBUG("WARNING: Ignoring Status-Server request due to security configuration"); return 0; } fun = rad_status_server; break; default: rad_recv_discard(listener->fd); RAD_STATS_INC(radius_auth_stats.total_unknown_types); RAD_STATS_CLIENT_INC(listener, client, total_unknown_types); DEBUG("Invalid packet code %d sent to authentication port from client %s port %d : IGNORED", code, client->shortname, src_port); return 0; break; } /* switch over packet types */ /* * Now that we've sanity checked everything, receive the * packet. */ packet = rad_recv(listener->fd, client->message_authenticator); if (!packet) { RAD_STATS_TYPE_INC(listener, total_malformed_requests); DEBUG("%s", fr_strerror()); return 0; } if (!received_request(listener, packet, prequest, client)) { RAD_STATS_TYPE_INC(listener, total_packets_dropped); RAD_STATS_CLIENT_INC(listener, client, total_packets_dropped); rad_free(&packet); return 0; } *pfun = fun; return 1; } #ifdef WITH_ACCOUNTING /* * Receive packets from an accounting socket */ static int acct_socket_recv(rad_listen_t *listener, RAD_REQUEST_FUNP *pfun, REQUEST **prequest) { ssize_t rcode; int code, src_port; RADIUS_PACKET *packet; RAD_REQUEST_FUNP fun = NULL; RADCLIENT *client; fr_ipaddr_t src_ipaddr; rcode = rad_recv_header(listener->fd, &src_ipaddr, &src_port, &code); if (rcode < 0) return 0; RAD_STATS_TYPE_INC(listener, total_requests); if (rcode < 20) { /* AUTH_HDR_LEN */ RAD_STATS_TYPE_INC(listener, total_malformed_requests); return 0; } if ((client = client_listener_find(listener, &src_ipaddr, src_port)) == NULL) { rad_recv_discard(listener->fd); RAD_STATS_TYPE_INC(listener, total_invalid_requests); return 0; } /* * Some sanity checks, based on the packet code. */ switch(code) { case PW_ACCOUNTING_REQUEST: RAD_STATS_CLIENT_INC(listener, client, total_requests); fun = rad_accounting; break; case PW_STATUS_SERVER: if (!mainconfig.status_server) { rad_recv_discard(listener->fd); RAD_STATS_TYPE_INC(listener, total_packets_dropped); RAD_STATS_CLIENT_INC(listener, client, total_unknown_types); DEBUG("WARNING: Ignoring Status-Server request due to security configuration"); return 0; } fun = rad_status_server; break; default: rad_recv_discard(listener->fd); RAD_STATS_TYPE_INC(listener, total_unknown_types); RAD_STATS_CLIENT_INC(listener, client, total_unknown_types); DEBUG("Invalid packet code %d sent to a accounting port from client %s port %d : IGNORED", code, client->shortname, src_port); return 0; } /* switch over packet types */ /* * Now that we've sanity checked everything, receive the * packet. */ packet = rad_recv(listener->fd, 0); if (!packet) { RAD_STATS_TYPE_INC(listener, total_malformed_requests); radlog(L_ERR, "%s", fr_strerror()); return 0; } /* * There can be no duplicate accounting packets. */ if (!received_request(listener, packet, prequest, client)) { RAD_STATS_TYPE_INC(listener, total_packets_dropped); RAD_STATS_CLIENT_INC(listener, client, total_packets_dropped); rad_free(&packet); return 0; } *pfun = fun; return 1; } #endif #ifdef WITH_COA /* * For now, all CoA requests are *only* originated, and not * proxied. So all of the necessary work is done in the * post-proxy section, which is automatically handled by event.c. * As a result, we don't have to do anything here. */ static int rad_coa_reply(REQUEST *request) { VALUE_PAIR *s1, *s2; /* * Inform the user about RFC requirements. */ s1 = pairfind(request->proxy->vps, PW_STATE); if (s1) { s2 = pairfind(request->proxy_reply->vps, PW_STATE); if (!s2) { DEBUG("WARNING: Client was sent State in CoA, and did not respond with State."); } else if ((s1->length != s2->length) || (memcmp(s1->vp_octets, s2->vp_octets, s1->length) != 0)) { DEBUG("WARNING: Client was sent State in CoA, and did not respond with the same State."); } } return RLM_MODULE_OK; } static int do_proxy(REQUEST *request) { VALUE_PAIR *vp; if (request->in_proxy_hash || (request->proxy_reply && (request->proxy_reply->code != 0))) { return 0; } vp = pairfind(request->config_items, PW_HOME_SERVER_POOL); if (!vp) return 0; if (!home_pool_byname(vp->vp_strvalue, HOME_TYPE_COA)) { RDEBUG2("ERROR: Cannot proxy to unknown pool %s", vp->vp_strvalue); return 0; } return 1; } /* * Receive a CoA packet. */ static int rad_coa_recv(REQUEST *request) { int rcode = RLM_MODULE_OK; int ack, nak; VALUE_PAIR *vp; /* * Get the correct response */ switch (request->packet->code) { case PW_COA_REQUEST: ack = PW_COA_ACK; nak = PW_COA_NAK; break; case PW_DISCONNECT_REQUEST: ack = PW_DISCONNECT_ACK; nak = PW_DISCONNECT_NAK; break; default: /* shouldn't happen */ return RLM_MODULE_FAIL; } #ifdef WITH_PROXY #define WAS_PROXIED (request->proxy) #else #define WAS_PROXIED (0) #endif if (!WAS_PROXIED) { /* * RFC 5176 Section 3.3. If we have a CoA-Request * with Service-Type = Authorize-Only, it MUST * have a State attribute in it. */ vp = pairfind(request->packet->vps, PW_SERVICE_TYPE); if (request->packet->code == PW_COA_REQUEST) { if (vp && (vp->vp_integer == 17)) { vp = pairfind(request->packet->vps, PW_STATE); if (!vp || (vp->length == 0)) { RDEBUG("ERROR: CoA-Request with Service-Type = Authorize-Only MUST contain a State attribute"); request->reply->code = PW_COA_NAK; return RLM_MODULE_FAIL; } } } else if (vp) { /* * RFC 5176, Section 3.2. */ RDEBUG("ERROR: Disconnect-Request MUST NOT contain a Service-Type attribute"); request->reply->code = PW_DISCONNECT_NAK; return RLM_MODULE_FAIL; } rcode = module_recv_coa(0, request); switch (rcode) { case RLM_MODULE_FAIL: case RLM_MODULE_INVALID: case RLM_MODULE_REJECT: case RLM_MODULE_USERLOCK: default: request->reply->code = nak; break; case RLM_MODULE_HANDLED: return rcode; case RLM_MODULE_NOOP: case RLM_MODULE_NOTFOUND: case RLM_MODULE_OK: case RLM_MODULE_UPDATED: if (do_proxy(request)) return RLM_MODULE_OK; request->reply->code = ack; break; } } else { /* * Start the reply code with the proxy reply * code. */ request->reply->code = request->proxy_reply->code; } /* * Copy State from the request to the reply. * See RFC 5176 Section 3.3. */ vp = paircopy2(request->packet->vps, PW_STATE); if (vp) pairadd(&request->reply->vps, vp); /* * We may want to over-ride the reply. */ rcode = module_send_coa(0, request); switch (rcode) { /* * We need to send CoA-NAK back if Service-Type * is Authorize-Only. Rely on the user's policy * to do that. We're not a real NAS, so this * restriction doesn't (ahem) apply to us. */ case RLM_MODULE_FAIL: case RLM_MODULE_INVALID: case RLM_MODULE_REJECT: case RLM_MODULE_USERLOCK: default: /* * Over-ride an ACK with a NAK */ request->reply->code = nak; break; case RLM_MODULE_HANDLED: return rcode; case RLM_MODULE_NOOP: case RLM_MODULE_NOTFOUND: case RLM_MODULE_OK: case RLM_MODULE_UPDATED: /* * Do NOT over-ride a previously set value. * Otherwise an "ok" here will re-write a * NAK to an ACK. */ if (request->reply->code == 0) { request->reply->code = ack; } break; } return RLM_MODULE_OK; } /* * Check if an incoming request is "ok" * * It takes packets, not requests. It sees if the packet looks * OK. If so, it does a number of sanity checks on it. */ static int coa_socket_recv(rad_listen_t *listener, RAD_REQUEST_FUNP *pfun, REQUEST **prequest) { ssize_t rcode; int code, src_port; RADIUS_PACKET *packet; RAD_REQUEST_FUNP fun = NULL; char buffer[128]; RADCLIENT *client; fr_ipaddr_t src_ipaddr; rcode = rad_recv_header(listener->fd, &src_ipaddr, &src_port, &code); if (rcode < 0) return 0; RAD_STATS_TYPE_INC(listener, total_requests); if (rcode < 20) { /* AUTH_HDR_LEN */ RAD_STATS_TYPE_INC(listener, total_malformed_requests); return 0; } if ((client = client_listener_find(listener, &src_ipaddr, src_port)) == NULL) { rad_recv_discard(listener->fd); RAD_STATS_TYPE_INC(listener, total_invalid_requests); if (debug_flag > 0) { char name[1024]; listener->print(listener, name, sizeof(name)); /* * This is debugging rather than logging, so that * DoS attacks don't affect us. */ DEBUG("Ignoring request to %s from unknown client %s port %d", name, inet_ntop(src_ipaddr.af, &src_ipaddr.ipaddr, buffer, sizeof(buffer)), src_port); } return 0; } /* * Some sanity checks, based on the packet code. */ switch(code) { case PW_COA_REQUEST: case PW_DISCONNECT_REQUEST: fun = rad_coa_recv; break; default: rad_recv_discard(listener->fd); DEBUG("Invalid packet code %d sent to coa port from client %s port %d : IGNORED", code, client->shortname, src_port); return 0; break; } /* switch over packet types */ /* * Now that we've sanity checked everything, receive the * packet. */ packet = rad_recv(listener->fd, client->message_authenticator); if (!packet) { RAD_STATS_TYPE_INC(listener, total_malformed_requests); DEBUG("%s", fr_strerror()); return 0; } if (!received_request(listener, packet, prequest, client)) { rad_free(&packet); return 0; } *pfun = fun; return 1; } #endif #ifdef WITH_PROXY /* * Recieve packets from a proxy socket. */ static int proxy_socket_recv(rad_listen_t *listener, RAD_REQUEST_FUNP *pfun, REQUEST **prequest) { REQUEST *request; RADIUS_PACKET *packet; RAD_REQUEST_FUNP fun = NULL; char buffer[128]; packet = rad_recv(listener->fd, 0); if (!packet) { radlog(L_ERR, "%s", fr_strerror()); return 0; } /* * FIXME: Client MIB updates? */ switch(packet->code) { case PW_AUTHENTICATION_ACK: case PW_ACCESS_CHALLENGE: case PW_AUTHENTICATION_REJECT: fun = rad_authenticate; break; #ifdef WITH_ACCOUNTING case PW_ACCOUNTING_RESPONSE: fun = rad_accounting; break; #endif #ifdef WITH_COA case PW_DISCONNECT_ACK: case PW_DISCONNECT_NAK: case PW_COA_ACK: case PW_COA_NAK: fun = rad_coa_reply; break; #endif default: /* * FIXME: Update MIB for packet types? */ radlog(L_ERR, "Invalid packet code %d sent to a proxy port " "from home server %s port %d - ID %d : IGNORED", packet->code, ip_ntoh(&packet->src_ipaddr, buffer, sizeof(buffer)), packet->src_port, packet->id); rad_free(&packet); return 0; } request = received_proxy_response(packet); if (!request) { rad_free(&packet); return 0; } #ifdef WITH_COA /* * Distinguish proxied CoA requests from ones we * originate. */ if ((fun == rad_coa_reply) && (request->packet->code == request->proxy->code)) { fun = rad_coa_recv; } #endif rad_assert(fun != NULL); *pfun = fun; *prequest = request; return 1; } #endif static int client_socket_encode(UNUSED rad_listen_t *listener, REQUEST *request) { if (!request->reply->code) return 0; rad_encode(request->reply, request->packet, request->client->secret); rad_sign(request->reply, request->packet, request->client->secret); return 0; } static int client_socket_decode(UNUSED rad_listen_t *listener, REQUEST *request) { if (rad_verify(request->packet, NULL, request->client->secret) < 0) { return -1; } return rad_decode(request->packet, NULL, request->client->secret); } #ifdef WITH_PROXY static int proxy_socket_encode(UNUSED rad_listen_t *listener, REQUEST *request) { rad_encode(request->proxy, NULL, request->home_server->secret); rad_sign(request->proxy, NULL, request->home_server->secret); return 0; } static int proxy_socket_decode(UNUSED rad_listen_t *listener, REQUEST *request) { /* * rad_verify is run in event.c, received_proxy_response() */ return rad_decode(request->proxy_reply, request->proxy, request->home_server->secret); } #endif #include "dhcpd.c" #include "command.c" static const rad_listen_master_t master_listen[RAD_LISTEN_MAX] = { #ifdef WITH_STATS { common_socket_parse, NULL, stats_socket_recv, auth_socket_send, socket_print, client_socket_encode, client_socket_decode }, #else /* * This always gets defined. */ { NULL, NULL, NULL, NULL, NULL, NULL, NULL}, /* RAD_LISTEN_NONE */ #endif #ifdef WITH_PROXY /* proxying */ { common_socket_parse, NULL, proxy_socket_recv, proxy_socket_send, socket_print, proxy_socket_encode, proxy_socket_decode }, #endif /* authentication */ { common_socket_parse, NULL, auth_socket_recv, auth_socket_send, socket_print, client_socket_encode, client_socket_decode }, #ifdef WITH_ACCOUNTING /* accounting */ { common_socket_parse, NULL, acct_socket_recv, acct_socket_send, socket_print, client_socket_encode, client_socket_decode}, #endif #ifdef WITH_DETAIL /* detail */ { detail_parse, detail_free, detail_recv, detail_send, detail_print, detail_encode, detail_decode }, #endif #ifdef WITH_VMPS /* vlan query protocol */ { common_socket_parse, NULL, vqp_socket_recv, vqp_socket_send, socket_print, vqp_socket_encode, vqp_socket_decode }, #endif #ifdef WITH_DHCP /* dhcp query protocol */ { dhcp_socket_parse, NULL, dhcp_socket_recv, dhcp_socket_send, socket_print, dhcp_socket_encode, dhcp_socket_decode }, #endif #ifdef WITH_COMMAND_SOCKET /* TCP command socket */ { command_socket_parse, command_socket_free, command_domain_accept, command_domain_send, command_socket_print, command_socket_encode, command_socket_decode }, #endif #ifdef WITH_COA /* Change of Authorization */ { common_socket_parse, NULL, coa_socket_recv, auth_socket_send, /* CoA packets are same as auth */ socket_print, client_socket_encode, client_socket_decode }, #endif }; /* * Binds a listener to a socket. */ static int listen_bind(rad_listen_t *this) { int rcode; struct sockaddr_storage salocal; socklen_t salen; listen_socket_t *sock = this->data; /* * If the port is zero, then it means the appropriate * thing from /etc/services. */ if (sock->port == 0) { struct servent *svp; switch (this->type) { case RAD_LISTEN_AUTH: svp = getservbyname ("radius", "udp"); if (svp != NULL) { sock->port = ntohs(svp->s_port); } else { sock->port = PW_AUTH_UDP_PORT; } break; #ifdef WITH_ACCOUNTING case RAD_LISTEN_ACCT: svp = getservbyname ("radacct", "udp"); if (svp != NULL) { sock->port = ntohs(svp->s_port); } else { sock->port = PW_ACCT_UDP_PORT; } break; #endif #ifdef WITH_PROXY case RAD_LISTEN_PROXY: sock->port = 0; break; #endif #ifdef WITH_VMPS case RAD_LISTEN_VQP: sock->port = 1589; break; #endif #ifdef WITH_COA case RAD_LISTEN_COA: svp = getservbyname ("radius-dynauth", "udp"); if (svp != NULL) { sock->port = ntohs(svp->s_port); } else { sock->port = PW_COA_UDP_PORT; } break; #endif default: DEBUG("WARNING: Internal sanity check failed in binding to socket. Ignoring problem."); return -1; } } /* * Don't open sockets if we're checking the config. */ if (check_config) { this->fd = -1; return 0; } /* * Copy fr_socket() here, as we may need to bind to a device. */ this->fd = socket(sock->ipaddr.af, SOCK_DGRAM, 0); if (this->fd < 0) { char buffer[256]; this->print(this, buffer, sizeof(buffer)); radlog(L_ERR, "Failed opening %s: %s", buffer, strerror(errno)); return -1; } #ifdef FD_CLOEXEC /* * We don't want child processes inheriting these * file descriptors. */ rcode = fcntl(this->fd, F_GETFD); if (rcode >= 0) { if (fcntl(this->fd, F_SETFD, rcode | FD_CLOEXEC) < 0) { close(this->fd); radlog(L_ERR, "Failed setting close on exec: %s", strerror(errno)); return -1; } } #endif /* * Bind to a device BEFORE touching IP addresses. */ if (sock->interface) { #ifdef SO_BINDTODEVICE struct ifreq ifreq; memset(&ifreq, 0, sizeof (ifreq)); strlcpy(ifreq.ifr_name, sock->interface, sizeof(ifreq.ifr_name)); fr_suid_up(); rcode = setsockopt(this->fd, SOL_SOCKET, SO_BINDTODEVICE, (char *)&ifreq, sizeof(ifreq)); fr_suid_down(); if (rcode < 0) { close(this->fd); radlog(L_ERR, "Failed binding to interface %s: %s", sock->interface, strerror(errno)); return -1; } /* else it worked. */ #else #ifdef HAVE_STRUCT_SOCKADDR_IN6 #ifdef HAVE_NET_IF_H /* * Odds are that any system supporting "bind to * device" also supports IPv6, so this next bit * isn't necessary. But it's here for * completeness. * * If we're doing IPv6, and the scope hasn't yet * been defined, set the scope to the scope of * the interface. */ if (sock->ipaddr.af == AF_INET6) { if (sock->ipaddr.scope == 0) { sock->ipaddr.scope = if_nametoindex(sock->interface); if (sock->ipaddr.scope == 0) { close(this->fd); radlog(L_ERR, "Failed finding interface %s: %s", sock->interface, strerror(errno)); return -1; } } /* else scope was defined: we're OK. */ } else #endif #endif /* * IPv4: no link local addresses, * and no bind to device. */ { close(this->fd); radlog(L_ERR, "Failed binding to interface %s: \"bind to device\" is unsupported", sock->interface); return -1; } #endif } #ifdef WITH_UDPFROMTO /* * Initialize udpfromto for all sockets. */ if (udpfromto_init(this->fd) != 0) { radlog(L_ERR, "Failed initializing udpfromto: %s", strerror(errno)); close(this->fd); return -1; } #endif /* * Set up sockaddr stuff. */ if (!fr_ipaddr2sockaddr(&sock->ipaddr, sock->port, &salocal, &salen)) { close(this->fd); return -1; } #ifdef HAVE_STRUCT_SOCKADDR_IN6 if (sock->ipaddr.af == AF_INET6) { /* * Listening on '::' does NOT get you IPv4 to * IPv6 mapping. You've got to listen on an IPv4 * address, too. This makes the rest of the server * design a little simpler. */ #ifdef IPV6_V6ONLY if (IN6_IS_ADDR_UNSPECIFIED(&sock->ipaddr.ipaddr.ip6addr)) { int on = 1; setsockopt(this->fd, IPPROTO_IPV6, IPV6_V6ONLY, (char *)&on, sizeof(on)); } #endif /* IPV6_V6ONLY */ } #endif /* HAVE_STRUCT_SOCKADDR_IN6 */ if (sock->ipaddr.af == AF_INET) { UNUSED int flag; #if defined(IP_MTU_DISCOVER) && defined(IP_PMTUDISC_DONT) /* * Disable PMTU discovery. On Linux, this * also makes sure that the "don't fragment" * flag is zero. */ flag = IP_PMTUDISC_DONT; setsockopt(this->fd, IPPROTO_IP, IP_MTU_DISCOVER, &flag, sizeof(flag)); #endif #if defined(IP_DONTFRAG) /* * Ensure that the "don't fragment" flag is zero. */ flag = 0; setsockopt(this->fd, IPPROTO_IP, IP_DONTFRAG, &flag, sizeof(flag)); #endif } /* * May be binding to priviledged ports. */ fr_suid_up(); rcode = bind(this->fd, (struct sockaddr *) &salocal, salen); fr_suid_down(); if (rcode < 0) { char buffer[256]; close(this->fd); this->print(this, buffer, sizeof(buffer)); radlog(L_ERR, "Failed binding to %s: %s\n", buffer, strerror(errno)); return -1; } /* * FreeBSD jail issues. We bind to 0.0.0.0, but the * kernel instead binds us to a 1.2.3.4. If this * happens, notice, and remember our real IP. */ { struct sockaddr_storage src; socklen_t sizeof_src = sizeof(src); memset(&src, 0, sizeof_src); if (getsockname(this->fd, (struct sockaddr *) &src, &sizeof_src) < 0) { radlog(L_ERR, "Failed getting socket name: %s", strerror(errno)); return -1; } if (!fr_sockaddr2ipaddr(&src, sizeof_src, &sock->ipaddr, &sock->port)) { radlog(L_ERR, "Socket has unsupported address family"); return -1; } } #ifdef O_NONBLOCK { int flags; if ((flags = fcntl(this->fd, F_GETFL, NULL)) < 0) { radlog(L_ERR, "Failure getting socket flags: %s)\n", strerror(errno)); return -1; } flags |= O_NONBLOCK; if( fcntl(this->fd, F_SETFL, flags) < 0) { radlog(L_ERR, "Failure setting socket flags: %s)\n", strerror(errno)); return -1; } } #endif return 0; } /* * Allocate & initialize a new listener. */ static rad_listen_t *listen_alloc(RAD_LISTEN_TYPE type) { rad_listen_t *this; this = rad_malloc(sizeof(*this)); memset(this, 0, sizeof(*this)); this->type = type; this->recv = master_listen[this->type].recv; this->send = master_listen[this->type].send; this->print = master_listen[this->type].print; this->encode = master_listen[this->type].encode; this->decode = master_listen[this->type].decode; switch (type) { #ifdef WITH_STATS case RAD_LISTEN_NONE: #endif case RAD_LISTEN_AUTH: #ifdef WITH_ACCOUNTING case RAD_LISTEN_ACCT: #endif #ifdef WITH_PROXY case RAD_LISTEN_PROXY: #endif #ifdef WITH_VMPS case RAD_LISTEN_VQP: #endif #ifdef WITH_COA case RAD_LISTEN_COA: #endif this->data = rad_malloc(sizeof(listen_socket_t)); memset(this->data, 0, sizeof(listen_socket_t)); break; #ifdef WITH_DHCP case RAD_LISTEN_DHCP: this->data = rad_malloc(sizeof(dhcp_socket_t)); memset(this->data, 0, sizeof(dhcp_socket_t)); break; #endif #ifdef WITH_DETAIL case RAD_LISTEN_DETAIL: this->data = NULL; break; #endif #ifdef WITH_COMMAND_SOCKET case RAD_LISTEN_COMMAND: this->data = rad_malloc(sizeof(fr_command_socket_t)); memset(this->data, 0, sizeof(fr_command_socket_t)); break; #endif default: rad_assert("Unsupported option!" == NULL); break; } return this; } #ifdef WITH_PROXY /* * Externally visible function for creating a new proxy LISTENER. * * Not thread-safe, but all calls to it are protected by the * proxy mutex in event.c */ rad_listen_t *proxy_new_listener(fr_ipaddr_t *ipaddr, int exists) { rad_listen_t *this, *tmp, **last; listen_socket_t *sock, *old; /* * Find an existing proxy socket to copy. */ old = NULL; last = &mainconfig.listen; for (tmp = mainconfig.listen; tmp != NULL; tmp = tmp->next) { /* * Not proxy, ignore it. */ if (tmp->type != RAD_LISTEN_PROXY) goto next; sock = tmp->data; /* * If we were asked to copy a specific one, do * so. If we're just finding one that already * exists, return a pointer to it. Otherwise, * create ANOTHER one with the same IP address. */ if ((ipaddr->af != AF_UNSPEC) && (fr_ipaddr_cmp(&sock->ipaddr, ipaddr) != 0)) { if (exists) return tmp; goto next; } if (!old) old = sock; next: last = &(tmp->next); } this = listen_alloc(RAD_LISTEN_PROXY); sock = this->data; if (!old) { /* * The socket MUST already exist if we're binding * to an address while proxying. * * If we're initializing the server, it's OK for the * socket to NOT exist. */ if (!exists) { DEBUG("WARNING: No previous template for proxy socket. Source IP address may be chosen by the OS"); } if (ipaddr->af != AF_UNSPEC) { sock->ipaddr = *ipaddr; } else { memset(&sock->ipaddr, 0, sizeof(sock->ipaddr)); sock->ipaddr.af = AF_INET; /* Oh well */ } } else { sock->ipaddr = old->ipaddr; } sock->port = 0; if (listen_bind(this) >= 0) { char buffer[256]; this->print(this, buffer, sizeof(buffer)); DEBUG(" ... adding new socket %s", buffer); /* * Add the new listener to the list of * listeners. */ *last = this; return this; } DEBUG("Failed binding to new proxy socket"); listen_free(&this); return NULL; } #endif static const FR_NAME_NUMBER listen_compare[] = { #ifdef WITH_STATS { "status", RAD_LISTEN_NONE }, #endif { "auth", RAD_LISTEN_AUTH }, #ifdef WITH_ACCOUNTING { "acct", RAD_LISTEN_ACCT }, #endif #ifdef WITH_DETAIL { "detail", RAD_LISTEN_DETAIL }, #endif #ifdef WITH_PROXY { "proxy", RAD_LISTEN_PROXY }, #endif #ifdef WITH_VMPS { "vmps", RAD_LISTEN_VQP }, #endif #ifdef WITH_DHCP { "dhcp", RAD_LISTEN_DHCP }, #endif #ifdef WITH_COMMAND_SOCKET { "control", RAD_LISTEN_COMMAND }, #endif #ifdef WITH_COA { "coa", RAD_LISTEN_COA }, #endif { NULL, 0 }, }; static rad_listen_t *listen_parse(CONF_SECTION *cs, const char *server) { int type, rcode; char *listen_type; rad_listen_t *this; listen_type = NULL; cf_log_info(cs, "listen {"); rcode = cf_item_parse(cs, "type", PW_TYPE_STRING_PTR, &listen_type, ""); if (rcode < 0) return NULL; if (rcode == 1) { free(listen_type); cf_log_err(cf_sectiontoitem(cs), "No type specified in listen section"); return NULL; } type = fr_str2int(listen_compare, listen_type, -1); if (type < 0) { cf_log_err(cf_sectiontoitem(cs), "Invalid type \"%s\" in listen section.", listen_type); free(listen_type); return NULL; } free(listen_type); /* * Allow listen sections in the default config to * refer to a server. */ if (!server) { rcode = cf_item_parse(cs, "virtual_server", PW_TYPE_STRING_PTR, &server, NULL); if (rcode == 1) { /* compatiblity with 2.0-pre */ rcode = cf_item_parse(cs, "server", PW_TYPE_STRING_PTR, &server, NULL); } if (rcode < 0) return NULL; } /* * Set up cross-type data. */ this = listen_alloc(type); this->server = server; this->fd = -1; /* * Call per-type parser. */ if (master_listen[type].parse(cs, this) < 0) { listen_free(&this); return NULL; } cf_log_info(cs, "}"); return this; } /* * Generate a list of listeners. Takes an input list of * listeners, too, so we don't close sockets with waiting packets. */ int listen_init(CONF_SECTION *config, rad_listen_t **head) { int override = FALSE; int rcode; CONF_SECTION *cs = NULL; rad_listen_t **last; rad_listen_t *this; fr_ipaddr_t server_ipaddr; int auth_port = 0; #ifdef WITH_PROXY int defined_proxy = 0; #endif /* * We shouldn't be called with a pre-existing list. */ rad_assert(head && (*head == NULL)); last = head; server_ipaddr.af = AF_UNSPEC; /* * If the port is specified on the command-line, * it over-rides the configuration file. * * FIXME: If argv[0] == "vmpsd", then don't listen on auth/acct! */ if (mainconfig.port >= 0) auth_port = mainconfig.port; /* * If the IP address was configured on the command-line, * use that as the "bind_address" */ if (mainconfig.myip.af != AF_UNSPEC) { memcpy(&server_ipaddr, &mainconfig.myip, sizeof(server_ipaddr)); override = TRUE; goto bind_it; } /* * Else look for bind_address and/or listen sections. */ server_ipaddr.ipaddr.ip4addr.s_addr = htonl(INADDR_NONE); rcode = cf_item_parse(config, "bind_address", PW_TYPE_IPADDR, &server_ipaddr.ipaddr.ip4addr, NULL); if (rcode < 0) return -1; /* error parsing it */ if (rcode == 0) { /* successfully parsed IPv4 */ listen_socket_t *sock; memset(&server_ipaddr, 0, sizeof(server_ipaddr)); server_ipaddr.af = AF_INET; radlog(L_INFO, "WARNING: The directive 'bind_address' is deprecated, and will be removed in future versions of FreeRADIUS. Please edit the configuration files to use the directive 'listen'."); bind_it: #ifdef WITH_VMPS if (strcmp(progname, "vmpsd") == 0) { this = listen_alloc(RAD_LISTEN_VQP); if (!auth_port) auth_port = 1589; } else #endif this = listen_alloc(RAD_LISTEN_AUTH); sock = this->data; sock->ipaddr = server_ipaddr; sock->port = auth_port; sock->clients = clients_parse_section(config); if (!sock->clients) { cf_log_err(cf_sectiontoitem(config), "Failed to find any clients for this listen section"); listen_free(&this); return -1; } if (listen_bind(this) < 0) { listen_free(head); radlog(L_ERR, "There appears to be another RADIUS server running on the authentication port %d", sock->port); listen_free(&this); return -1; } auth_port = sock->port; /* may have been updated in listen_bind */ if (override) { cs = cf_section_sub_find_name2(config, "server", mainconfig.name); if (cs) this->server = mainconfig.name; } *last = this; last = &(this->next); #ifdef WITH_VMPS /* * No acct for vmpsd */ if (strcmp(progname, "vmpsd") == 0) goto do_proxy; #endif #ifdef WITH_ACCOUNTING /* * Open Accounting Socket. * * If we haven't already gotten acct_port from * /etc/services, then make it auth_port + 1. */ this = listen_alloc(RAD_LISTEN_ACCT); sock = this->data; /* * Create the accounting socket. * * The accounting port is always the * authentication port + 1 */ sock->ipaddr = server_ipaddr; sock->port = auth_port + 1; sock->clients = clients_parse_section(config); if (!sock->clients) { cf_log_err(cf_sectiontoitem(config), "Failed to find any clients for this listen section"); return -1; } if (listen_bind(this) < 0) { listen_free(&this); listen_free(head); radlog(L_ERR, "There appears to be another RADIUS server running on the accounting port %d", sock->port); return -1; } if (override) { cs = cf_section_sub_find_name2(config, "server", mainconfig.name); if (cs) this->server = mainconfig.name; } *last = this; last = &(this->next); #endif } else if (mainconfig.port > 0) { /* no bind address, but a port */ radlog(L_ERR, "The command-line says \"-p %d\", but there is no associated IP address to use", mainconfig.port); return -1; } /* * They specified an IP on the command-line, ignore * all listen sections except the one in '-n'. */ if (mainconfig.myip.af != AF_UNSPEC) { CONF_SECTION *subcs; const char *name2 = cf_section_name2(cs); cs = cf_section_sub_find_name2(config, "server", mainconfig.name); if (!cs) goto do_proxy; /* * Should really abstract this code... */ for (subcs = cf_subsection_find_next(cs, NULL, "listen"); subcs != NULL; subcs = cf_subsection_find_next(cs, subcs, "listen")) { this = listen_parse(subcs, name2); if (!this) { listen_free(head); return -1; } #ifdef WITH_PROXY if (this->type == RAD_LISTEN_PROXY) defined_proxy = 1; #endif *last = this; last = &(this->next); } /* loop over "listen" directives in server */ goto do_proxy; } /* * Walk through the "listen" sections, if they exist. */ for (cs = cf_subsection_find_next(config, NULL, "listen"); cs != NULL; cs = cf_subsection_find_next(config, cs, "listen")) { this = listen_parse(cs, NULL); if (!this) { listen_free(head); return -1; } #ifdef WITH_PROXY if (this->type == RAD_LISTEN_PROXY) defined_proxy = 1; #endif *last = this; last = &(this->next); } /* * Check virtual servers for "listen" sections, too. * * FIXME: Move to virtual server init? */ for (cs = cf_subsection_find_next(config, NULL, "server"); cs != NULL; cs = cf_subsection_find_next(config, cs, "server")) { CONF_SECTION *subcs; const char *name2 = cf_section_name2(cs); for (subcs = cf_subsection_find_next(cs, NULL, "listen"); subcs != NULL; subcs = cf_subsection_find_next(cs, subcs, "listen")) { this = listen_parse(subcs, name2); if (!this) { listen_free(head); return -1; } #ifdef WITH_PROXY if (this->type == RAD_LISTEN_PROXY) { radlog(L_ERR, "Error: listen type \"proxy\" Cannot appear in a virtual server section"); listen_free(head); return -1; } #endif *last = this; last = &(this->next); } /* loop over "listen" directives in virtual servers */ } /* loop over virtual servers */ /* * If we're proxying requests, open the proxy FD. * Otherwise, don't do anything. */ do_proxy: /* * No sockets to receive packets, this is an error. * proxying is pointless. */ if (!*head) { radlog(L_ERR, "The server is not configured to listen on any ports. Cannot start."); return -1; } #ifdef WITH_PROXY if (mainconfig.proxy_requests == TRUE) { int port = -1; listen_socket_t *sock = NULL; if (defined_proxy) goto check_home_servers; /* * Find the first authentication port, * and use it */ for (this = *head; this != NULL; this = this->next) { if (this->type == RAD_LISTEN_AUTH) { sock = this->data; /* * We shouldn't proxy on loopback. */ if ((sock->ipaddr.af == AF_INET) && (sock->ipaddr.ipaddr.ip4addr.s_addr == htonl(INADDR_LOOPBACK))) continue; #ifdef HAVE_STRUCT_SOCKADDR_IN6 if ((sock->ipaddr.af == AF_INET6) && (IN6_IS_ADDR_LINKLOCAL(&sock->ipaddr.ipaddr.ip6addr))) continue; #endif if (server_ipaddr.af == AF_UNSPEC) { server_ipaddr = sock->ipaddr; } port = sock->port + 2; /* skip acct port */ break; } #ifdef WITH_VMPS if (this->type == RAD_LISTEN_VQP) { sock = this->data; if (server_ipaddr.af == AF_UNSPEC) { server_ipaddr = sock->ipaddr; } port = sock->port + 1; break; } #endif } if (port < 0) port = 1024 + (fr_rand() & 0x1ff); /* * Address is still unspecified, use IPv4. */ if (server_ipaddr.af == AF_UNSPEC) { server_ipaddr.af = AF_INET; server_ipaddr.ipaddr.ip4addr.s_addr = htonl(INADDR_ANY); } this = listen_alloc(RAD_LISTEN_PROXY); sock = this->data; /* * Create the first proxy socket. */ sock->ipaddr = server_ipaddr; /* * Try to find a proxy port (value doesn't matter) */ for (sock->port = port; sock->port < 64000; sock->port++) { if (listen_bind(this) == 0) { *last = this; last = &(this->next); /* just in case */ break; } } if (sock->port >= 64000) { listen_free(head); listen_free(&this); radlog(L_ERR, "Failed to open socket for proxying"); return -1; } /* * Create *additional* proxy listeners, based * on their src_ipaddr. */ check_home_servers: if (home_server_create_listeners() != 0) return -1; } #endif xlat_register("listen", xlat_listen, NULL); return 0; } /* * Free a linked list of listeners; */ void listen_free(rad_listen_t **head) { rad_listen_t *this; if (!head || !*head) return; this = *head; while (this) { rad_listen_t *next = this->next; /* * Other code may have eaten the FD. */ if (this->fd >= 0) close(this->fd); if (master_listen[this->type].free) { master_listen[this->type].free(this); } free(this->data); free(this); this = next; } *head = NULL; } #ifdef WITH_STATS RADCLIENT_LIST *listener_find_client_list(const fr_ipaddr_t *ipaddr, int port) { rad_listen_t *this; for (this = mainconfig.listen; this != NULL; this = this->next) { listen_socket_t *sock; if ((this->type != RAD_LISTEN_AUTH) && (this->type != RAD_LISTEN_ACCT)) continue; sock = this->data; if ((sock->port == port) && (fr_ipaddr_cmp(ipaddr, &sock->ipaddr) == 0)) { return sock->clients; } } return NULL; } #endif rad_listen_t *listener_find_byipaddr(const fr_ipaddr_t *ipaddr, int port) { rad_listen_t *this; for (this = mainconfig.listen; this != NULL; this = this->next) { listen_socket_t *sock; /* * FIXME: For TCP, ignore the *secondary* * listeners associated with the main socket. */ if ((this->type != RAD_LISTEN_AUTH) && (this->type != RAD_LISTEN_ACCT)) continue; sock = this->data; if ((sock->port == port) && (fr_ipaddr_cmp(ipaddr, &sock->ipaddr) == 0)) { return this; } if ((sock->port == port) && ((sock->ipaddr.af == AF_INET) && (sock->ipaddr.ipaddr.ip4addr.s_addr == INADDR_ANY))) { return this; } #ifdef HAVE_STRUCT_SOCKADDR_IN6 if ((sock->port == port) && (sock->ipaddr.af == AF_INET6) && (IN6_IS_ADDR_UNSPECIFIED(&sock->ipaddr.ipaddr.ip6addr))) { return this; } #endif } return NULL; } freeradius-server/src/main/log.c000066400000000000000000000154731257552170400171750ustar00rootroot00000000000000/* * log.c Logging module. * * Version: $Id$ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2001,2006 The FreeRADIUS server project * Copyright 2000 Miquel van Smoorenburg * Copyright 2000 Alan DeKok * Copyright 2001 Chad Miller */ #include RCSID("$Id$") #include #ifdef HAVE_SYS_STAT_H #include #endif #ifdef HAVE_SYSLOG_H # include #endif /* * Logging facility names */ static const FR_NAME_NUMBER levels[] = { { ": Debug: ", L_DBG }, { ": Auth: ", L_AUTH }, { ": Proxy: ", L_PROXY }, { ": Info: ", L_INFO }, { ": Acct: ", L_ACCT }, { ": Error: ", L_ERR }, { NULL, 0 } }; int log_dates_utc = 0; /* * Log the message to the logfile. Include the severity and * a time stamp. */ int vradlog(int lvl, const char *fmt, va_list ap) { struct main_config_t *myconfig = &mainconfig; unsigned char *p; char buffer[8192]; int len; /* * NOT debugging, and trying to log debug messages. * * Throw the message away. */ if (!debug_flag && (lvl == L_DBG)) { return 0; } /* * If we don't want any messages, then * throw them away. */ if (myconfig->radlog_dest == RADLOG_NULL) { return 0; } *buffer = '\0'; len = 0; /* * Don't print timestamps to syslog, it does that for us. * Don't print timestamps for low levels of debugging. * * Print timestamps for non-debugging, and for high levels * of debugging. */ if ((myconfig->radlog_dest != RADLOG_SYSLOG) && (debug_flag != 1) && (debug_flag != 2)) { const char *s; time_t timeval; timeval = time(NULL); #ifdef HAVE_GMTIME_R if (log_dates_utc) { struct tm utc; gmtime_r(&timeval, &utc); asctime_r(&utc, buffer + len); } else #endif CTIME_R(&timeval, buffer + len, sizeof(buffer) - len - 1); s = fr_int2str(levels, (lvl & ~L_CONS), ": "); strcat(buffer, s); len = strlen(buffer); } vsnprintf(buffer + len, sizeof(buffer) - len - 1, fmt, ap); /* * Filter out characters not in Latin-1. */ for (p = (unsigned char *)buffer; *p != '\0'; p++) { if (*p == '\r' || *p == '\n') *p = ' '; else if (*p == '\t') continue; else if (*p < 32 || (*p >= 128 && *p <= 160)) *p = '?'; } strcat(buffer, "\n"); switch (myconfig->radlog_dest) { #ifdef HAVE_SYSLOG_H case RADLOG_SYSLOG: switch(lvl & ~L_CONS) { case L_DBG: lvl = LOG_DEBUG; break; case L_AUTH: lvl = LOG_NOTICE; break; case L_PROXY: lvl = LOG_NOTICE; break; case L_ACCT: lvl = LOG_NOTICE; break; case L_INFO: lvl = LOG_INFO; break; case L_ERR: lvl = LOG_ERR; break; } syslog(lvl, "%s", buffer); break; #endif case RADLOG_FILES: case RADLOG_STDOUT: case RADLOG_STDERR: write(myconfig->radlog_fd, buffer, strlen(buffer)); break; default: case RADLOG_NULL: /* should have been caught above */ break; } return 0; } int log_debug(const char *msg, ...) { va_list ap; int r; va_start(ap, msg); r = vradlog(L_DBG, msg, ap); va_end(ap); return r; } int radlog(int lvl, const char *msg, ...) { va_list ap; int r; va_start(ap, msg); r = vradlog(lvl, msg, ap); va_end(ap); return r; } /* * Dump a whole list of attributes to DEBUG2 */ void vp_listdebug(VALUE_PAIR *vp) { char tmpPair[70]; for (; vp; vp = vp->next) { vp_prints(tmpPair, sizeof(tmpPair), vp); DEBUG2(" %s", tmpPair); } } extern char *request_log_file; #ifdef HAVE_SYS_UN_H extern char *debug_log_file; #endif void radlog_request(int lvl, int priority, REQUEST *request, const char *msg, ...) { size_t len = 0; const char *filename = request_log_file; FILE *fp = NULL; va_list ap; char buffer[1024]; va_start(ap, msg); /* * Debug messages get treated specially. */ if (lvl == L_DBG) { /* * There is log function, but the debug level * isn't high enough. OR, we're in debug mode, * and the debug level isn't high enough. Return. */ if ((request && request->radlog && (priority > request->options)) || ((debug_flag != 0) && (priority > debug_flag))) { va_end(ap); return; } /* * Use the debug output file, if specified, * otherwise leave it as "request_log_file". */ #ifdef HAVE_SYS_UN_H filename = debug_log_file; if (!filename) #endif filename = request_log_file; /* * Debug messages get mashed to L_INFO for * radius.log. */ if (!filename) lvl = L_INFO; } if (request && filename) { char *p; radlog_func_t rl = request->radlog; request->radlog = NULL; /* * This is SLOW! Doing it for every log message * in every request is NOT recommended! */ radius_xlat(buffer, sizeof(buffer), filename, request, NULL); /* FIXME: escape chars! */ request->radlog = rl; p = strrchr(buffer, FR_DIR_SEP); if (p) { *p = '\0'; if (rad_mkdir(buffer, S_IRWXU) < 0) { radlog(L_ERR, "Failed creating %s: %s", buffer,strerror(errno)); va_end(ap); return; } *p = FR_DIR_SEP; } fp = fopen(buffer, "a"); } /* * Print timestamps to the file. */ if (fp) { char *s; time_t timeval; timeval = time(NULL); #ifdef HAVE_GMTIME_R if (log_dates_utc) { struct tm utc; gmtime_r(&timeval, &utc); ASCTIME_R(&utc, buffer + len, sizeof(buffer) - len - 1); } else #endif { CTIME_R(&timeval, buffer + len, sizeof(buffer) - len - 1); } s = strrchr(buffer, '\n'); if (s) { s[0] = ' '; s[1] = '\0'; } len = strlen(buffer); if (len < sizeof(buffer)) { len += strlcpy(buffer + len, fr_int2str(levels, (lvl & ~L_CONS), ": "), sizeof(buffer) - len); if (len >= sizeof(buffer)) len = sizeof(buffer) - 1; } } if (request && request->module[0]) { snprintf(buffer + len, sizeof(buffer) - len, "[%s] ", request->module); len = strlen(buffer); } vsnprintf(buffer + len, sizeof(buffer) - len, msg, ap); if (!fp) { radlog(lvl, "%s", buffer); } else { if (strlcat(buffer, "\n", sizeof(buffer)) >= sizeof(buffer)) { buffer[sizeof(buffer) - 1] = '\n'; } fputs(buffer, fp); fclose(fp); } va_end(ap); } freeradius-server/src/main/mainconfig.c000066400000000000000000000627021257552170400205230ustar00rootroot00000000000000/* * mainconf.c Handle the server's configuration. * * Version: $Id$ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2002,2006-2007 The FreeRADIUS server project * Copyright 2002 Alan DeKok */ #include RCSID("$Id$") #include #include #include #include #ifdef HAVE_SYS_RESOURCE_H #include #endif #ifdef HAVE_PWD_H #include #endif #ifdef HAVE_GRP_H #include #endif #ifdef HAVE_SYS_PRCTL_H #include #endif #ifdef HAVE_SYSLOG_H # include #endif #ifdef HAVE_SYS_STAT_H #include #endif #ifdef HAVE_FCNTL_H #include #endif struct main_config_t mainconfig; char *request_log_file = NULL; char *debug_condition = NULL; #ifdef HAVE_GMTIME_R extern int log_dates_utc; #endif typedef struct cached_config_t { struct cached_config_t *next; time_t created; CONF_SECTION *cs; } cached_config_t; static cached_config_t *cs_cache = NULL; /* * Temporary local variables for parsing the configuration * file. */ #ifdef HAVE_SETUID /* * Systems that have set/getresuid also have setuid. */ static uid_t server_uid = 0; static gid_t server_gid = 0; static const char *uid_name = NULL; static const char *gid_name = NULL; #endif static const char *chroot_dir = NULL; static int allow_core_dumps = 0; static const char *radlog_dest = NULL; /* * These are not used anywhere else.. */ static const char *localstatedir = NULL; static const char *prefix = NULL; static const char *my_name = NULL; static const char *sbindir = NULL; static const char *run_dir = NULL; static char *syslog_facility = NULL; /* * Syslog facility table. */ const FR_NAME_NUMBER syslog_str2fac[] = { #ifdef LOG_KERN { "kern", LOG_KERN }, #endif #ifdef LOG_USER { "user", LOG_USER }, #endif #ifdef LOG_MAIL { "mail", LOG_MAIL }, #endif #ifdef LOG_DAEMON { "daemon", LOG_DAEMON }, #endif #ifdef LOG_AUTH { "auth", LOG_AUTH }, #endif #ifdef LOG_LPR { "lpr", LOG_LPR }, #endif #ifdef LOG_NEWS { "news", LOG_NEWS }, #endif #ifdef LOG_UUCP { "uucp", LOG_UUCP }, #endif #ifdef LOG_CRON { "cron", LOG_CRON }, #endif #ifdef LOG_AUTHPRIV { "authpriv", LOG_AUTHPRIV }, #endif #ifdef LOG_FTP { "ftp", LOG_FTP }, #endif #ifdef LOG_LOCAL0 { "local0", LOG_LOCAL0 }, #endif #ifdef LOG_LOCAL1 { "local1", LOG_LOCAL1 }, #endif #ifdef LOG_LOCAL2 { "local2", LOG_LOCAL2 }, #endif #ifdef LOG_LOCAL3 { "local3", LOG_LOCAL3 }, #endif #ifdef LOG_LOCAL4 { "local4", LOG_LOCAL4 }, #endif #ifdef LOG_LOCAL5 { "local5", LOG_LOCAL5 }, #endif #ifdef LOG_LOCAL6 { "local6", LOG_LOCAL6 }, #endif #ifdef LOG_LOCAL7 { "local7", LOG_LOCAL7 }, #endif { NULL, -1 } }; /* * Security configuration for the server. */ static const CONF_PARSER security_config[] = { { "max_attributes", PW_TYPE_INTEGER, 0, &fr_max_attributes, Stringify(0) }, { "reject_delay", PW_TYPE_INTEGER, 0, &mainconfig.reject_delay, Stringify(0) }, { "status_server", PW_TYPE_BOOLEAN, 0, &mainconfig.status_server, "no"}, #ifdef ENABLE_OPENSSL_VERSION_CHECK { "allow_vulnerable_openssl", PW_TYPE_BOOLEAN, 0, &mainconfig.allow_vulnerable_openssl, "no"}, #endif { NULL, -1, 0, NULL, NULL } }; /* * Logging configuration for the server. */ static const CONF_PARSER logdest_config[] = { { "destination", PW_TYPE_STRING_PTR, 0, &radlog_dest, "files" }, { "syslog_facility", PW_TYPE_STRING_PTR, 0, &syslog_facility, Stringify(0) }, { "file", PW_TYPE_STRING_PTR, 0, &mainconfig.log_file, "${logdir}/radius.log" }, { "requests", PW_TYPE_STRING_PTR, 0, &request_log_file, NULL }, { NULL, -1, 0, NULL, NULL } }; static const CONF_PARSER serverdest_config[] = { { "log", PW_TYPE_SUBSECTION, 0, NULL, (const void *) logdest_config }, { "log_file", PW_TYPE_STRING_PTR, 0, &mainconfig.log_file, NULL }, { "log_destination", PW_TYPE_STRING_PTR, 0, &radlog_dest, NULL }, #ifdef HAVE_GMTIME_R { "use_utc", PW_TYPE_BOOLEAN, 0, &log_dates_utc, NULL }, #endif { NULL, -1, 0, NULL, NULL } }; static const CONF_PARSER log_config_nodest[] = { { "stripped_names", PW_TYPE_BOOLEAN, 0, &log_stripped_names,"no" }, { "auth", PW_TYPE_BOOLEAN, 0, &mainconfig.log_auth, "no" }, { "auth_badpass", PW_TYPE_BOOLEAN, 0, &mainconfig.log_auth_badpass, "no" }, { "auth_goodpass", PW_TYPE_BOOLEAN, 0, &mainconfig.log_auth_goodpass, "no" }, { "msg_badpass", PW_TYPE_STRING_PTR, 0, &mainconfig.auth_badpass_msg, NULL}, { "msg_goodpass", PW_TYPE_STRING_PTR, 0, &mainconfig.auth_goodpass_msg, NULL}, #ifdef HAVE_GMTIME_R { "use_utc", PW_TYPE_BOOLEAN, 0, &log_dates_utc, NULL }, #endif { NULL, -1, 0, NULL, NULL } }; /* * A mapping of configuration file names to internal variables */ static const CONF_PARSER server_config[] = { /* * FIXME: 'prefix' is the ONLY one which should be * configured at compile time. Hard-coding it here is * bad. It will be cleaned up once we clean up the * hard-coded defines for the locations of the various * files. */ { "name", PW_TYPE_STRING_PTR, 0, &my_name, "radiusd"}, { "prefix", PW_TYPE_STRING_PTR, 0, &prefix, "/usr/local"}, { "localstatedir", PW_TYPE_STRING_PTR, 0, &localstatedir, "${prefix}/var"}, { "sbindir", PW_TYPE_STRING_PTR, 0, &sbindir, "${prefix}/sbin"}, { "logdir", PW_TYPE_STRING_PTR, 0, &radlog_dir, "${localstatedir}/log"}, { "run_dir", PW_TYPE_STRING_PTR, 0, &run_dir, "${localstatedir}/run/${name}"}, { "libdir", PW_TYPE_STRING_PTR, 0, &radlib_dir, "${prefix}/lib"}, { "radacctdir", PW_TYPE_STRING_PTR, 0, &radacct_dir, "${logdir}/radacct" }, { "panic_action", PW_TYPE_STRING_PTR, 0, &mainconfig.panic_action, NULL}, { "hostname_lookups", PW_TYPE_BOOLEAN, 0, &fr_dns_lookups, "no" }, { "max_request_time", PW_TYPE_INTEGER, 0, &mainconfig.max_request_time, Stringify(MAX_REQUEST_TIME) }, { "cleanup_delay", PW_TYPE_INTEGER, 0, &mainconfig.cleanup_delay, Stringify(CLEANUP_DELAY) }, { "max_requests", PW_TYPE_INTEGER, 0, &mainconfig.max_requests, Stringify(MAX_REQUESTS) }, #ifdef DELETE_BLOCKED_REQUESTS { "delete_blocked_requests", PW_TYPE_INTEGER, 0, &mainconfig.kill_unresponsive_children, Stringify(FALSE) }, #endif { "pidfile", PW_TYPE_STRING_PTR, 0, &mainconfig.pid_file, "${run_dir}/radiusd.pid"}, { "checkrad", PW_TYPE_STRING_PTR, 0, &mainconfig.checkrad, "${sbindir}/checkrad" }, { "debug_level", PW_TYPE_INTEGER, 0, &mainconfig.debug_level, "0"}, #ifdef WITH_PROXY { "proxy_requests", PW_TYPE_BOOLEAN, 0, &mainconfig.proxy_requests, "yes" }, #endif { "log", PW_TYPE_SUBSECTION, 0, NULL, (const void *) log_config_nodest }, /* * People with old configs will have these. They are listed * AFTER the "log" section, so if they exist in radiusd.conf, * it will prefer "log_foo = bar" to "log { foo = bar }". * They're listed with default values of NULL, so that if they * DON'T exist in radiusd.conf, then the previously parsed * values for "log { foo = bar}" will be used. */ { "log_auth", PW_TYPE_BOOLEAN, 0, &mainconfig.log_auth, NULL }, { "log_auth_badpass", PW_TYPE_BOOLEAN, 0, &mainconfig.log_auth_badpass, NULL }, { "log_auth_goodpass", PW_TYPE_BOOLEAN, 0, &mainconfig.log_auth_goodpass, NULL }, { "log_stripped_names", PW_TYPE_BOOLEAN, 0, &log_stripped_names, NULL }, { "security", PW_TYPE_SUBSECTION, 0, NULL, (const void *) security_config }, { NULL, -1, 0, NULL, NULL } }; static const CONF_PARSER bootstrap_config[] = { #ifdef HAVE_SETUID { "user", PW_TYPE_STRING_PTR, 0, &uid_name, NULL }, { "group", PW_TYPE_STRING_PTR, 0, &gid_name, NULL }, #endif { "chroot", PW_TYPE_STRING_PTR, 0, &chroot_dir, NULL }, { "allow_core_dumps", PW_TYPE_BOOLEAN, 0, &allow_core_dumps, "no" }, { NULL, -1, 0, NULL, NULL } }; #define MAX_ARGV (256) static size_t config_escape_func(char *out, size_t outlen, const char *in) { size_t len = 0; static const char *disallowed = "%{}\\'\"`"; while (in[0]) { /* * Non-printable characters get replaced with their * mime-encoded equivalents. */ if ((in[0] < 32)) { if (outlen <= 3) break; snprintf(out, outlen, "=%02X", (unsigned char) in[0]); in++; out += 3; outlen -= 3; len += 3; continue; } else if (strchr(disallowed, *in) != NULL) { if (outlen <= 2) break; out[0] = '\\'; out[1] = *in; in++; out += 2; outlen -= 2; len += 2; continue; } /* * Only one byte left. */ if (outlen <= 1) { break; } /* * Allowed character. */ *out = *in; out++; in++; outlen--; len++; } *out = '\0'; return len; } /* * Xlat for %{config:section.subsection.attribute} */ static size_t xlat_config(void *instance, REQUEST *request, char *fmt, char *out, size_t outlen, RADIUS_ESCAPE_STRING func) { const char *value; CONF_PAIR *cp; CONF_ITEM *ci; char buffer[1024]; request = request; /* -Wunused */ instance = instance; /* -Wunused */ /* * Expand it safely. */ if (!radius_xlat(buffer, sizeof(buffer), fmt, request, config_escape_func)) { return 0; } ci = cf_reference_item(request->root->config, request->root->config, buffer); if (!ci || !cf_item_is_pair(ci)) { *out = '\0'; return 0; } cp = cf_itemtopair(ci); /* * Ensure that we only copy what's necessary. * * If 'outlen' is too small, then the output is chopped to fit. */ value = cf_pair_value(cp); if (!value) { out[0] = '\0'; return 0; } if (outlen > strlen(value)) { outlen = strlen(value) + 1; } return func(out, outlen, value); } /* * Xlat for %{client:foo} */ static size_t xlat_client(UNUSED void *instance, REQUEST *request, char *fmt, char *out, size_t outlen, UNUSED RADIUS_ESCAPE_STRING func) { const char *value = NULL; CONF_PAIR *cp; if (!fmt || !out || (outlen < 1)) return 0; if (!request || !request->client) { *out = '\0'; return 0; } cp = cf_pair_find(request->client->cs, fmt); if (!cp || !(value = cf_pair_value(cp))) { *out = '\0'; return 0; } strlcpy(out, value, outlen); return strlen(out); } /* * Recursively make directories. */ static int r_mkdir(const char *part) { char *ptr, parentdir[500]; struct stat st; if (stat(part, &st) == 0) return(0); ptr = strrchr(part, FR_DIR_SEP); if (ptr == part) return(0); snprintf(parentdir, (ptr - part)+1, "%s", part); if (r_mkdir(parentdir) != 0) return(1); if (mkdir(part, 0770) != 0) { radlog(L_ERR, "mkdir(%s) error: %s\n", part, strerror(errno)); return(1); } return(0); } #ifdef HAVE_SYS_RESOURCE_H static struct rlimit core_limits; #endif static void fr_set_dumpable(void) { /* * If configured, turn core dumps off. */ if (!allow_core_dumps) { #ifdef HAVE_SYS_RESOURCE_H struct rlimit no_core; no_core.rlim_cur = 0; no_core.rlim_max = 0; if (setrlimit(RLIMIT_CORE, &no_core) < 0) { radlog(L_ERR, "Failed disabling core dumps: %s", strerror(errno)); } #endif return; } /* * Set or re-set the dumpable flag. */ #ifdef HAVE_SYS_PRCTL_H #ifdef PR_SET_DUMPABLE if (prctl(PR_SET_DUMPABLE, 1) < 0) { radlog(L_ERR,"Cannot re-enable core dumps: prctl(PR_SET_DUMPABLE) failed: '%s'", strerror(errno)); } #endif #endif /* * Reset the core dump limits to their original value. */ #ifdef HAVE_SYS_RESOURCE_H if (setrlimit(RLIMIT_CORE, &core_limits) < 0) { radlog(L_ERR, "Cannot update core dump limit: %s", strerror(errno)); } #endif } #ifdef HAVE_SETUID static int doing_setuid = FALSE; #if defined(HAVE_SETRESUID) && defined (HAVE_GETRESUID) void fr_suid_up(void) { uid_t ruid, euid, suid; if (getresuid(&ruid, &euid, &suid) < 0) { radlog(L_ERR, "Failed getting saved UID's"); _exit(1); } if (setresuid(-1, suid, -1) < 0) { radlog(L_ERR, "Failed switching to privileged user"); _exit(1); } if (geteuid() != suid) { radlog(L_ERR, "Switched to unknown UID"); _exit(1); } } void fr_suid_down(void) { if (!doing_setuid) return; if (setresuid(-1, server_uid, geteuid()) < 0) { fprintf(stderr, "%s: Failed switching to uid %s: %s\n", progname, uid_name, strerror(errno)); _exit(1); } if (geteuid() != server_uid) { fprintf(stderr, "%s: Failed switching uid: UID is incorrect\n", progname); _exit(1); } fr_set_dumpable(); } void fr_suid_down_permanent(void) { if (!doing_setuid) return; if (setresuid(server_uid, server_uid, server_uid) < 0) { radlog(L_ERR, "Failed in permanent switch to uid %s: %s", uid_name, strerror(errno)); _exit(1); } if (geteuid() != server_uid) { radlog(L_ERR, "Switched to unknown uid"); _exit(1); } fr_set_dumpable(); } #else /* * Much less secure... */ void fr_suid_up(void) { } void fr_suid_down(void) { if (!uid_name) return; if (setuid(server_uid) < 0) { fprintf(stderr, "%s: Failed switching to uid %s: %s\n", progname, uid_name, strerror(errno)); _exit(1); } fr_set_dumpable(); } void fr_suid_down_permanent(void) { fr_set_dumpable(); } #endif /* HAVE_SETRESUID && HAVE_GETRESUID */ #else /* HAVE_SETUID */ void fr_suid_up(void) { } void fr_suid_down(void) { fr_set_dumpable(); } void fr_suid_down_permanent(void) { fr_set_dumpable(); } #endif /* HAVE_SETUID */ #ifdef HAVE_SETUID /* * Do chroot, if requested. * * Switch UID and GID to what is specified in the config file */ static int switch_users(CONF_SECTION *cs) { #ifdef HAVE_SYS_RESOURCE_H /* * Get the current maximum for core files. Do this * before anything else so as to ensure it's properly * initialized. */ if (getrlimit(RLIMIT_CORE, &core_limits) < 0) { radlog(L_ERR, "Failed to get current core limit: %s", strerror(errno)); return 0; } #endif /* * Don't do chroot/setuid/setgid if we're in debugging * as non-root. */ if (debug_flag && (getuid() != 0)) return 1; if (cf_section_parse(cs, NULL, bootstrap_config) < 0) { fprintf(stderr, "radiusd: Error: Failed to parse user/group information.\n"); return 0; } #ifdef HAVE_GRP_H /* Set GID. */ if (gid_name) { struct group *gr; gr = getgrnam(gid_name); if (gr == NULL) { fprintf(stderr, "%s: Cannot get ID for group %s: %s\n", progname, gid_name, strerror(errno)); return 0; } server_gid = gr->gr_gid; } else { server_gid = getgid(); } #endif #ifdef HAVE_PWD_H /* Set UID. */ if (uid_name) { struct passwd *pw; pw = getpwnam(uid_name); if (pw == NULL) { fprintf(stderr, "%s: Cannot get passwd entry for user %s: %s\n", progname, uid_name, strerror(errno)); return 0; } if (getuid() == pw->pw_uid) { uid_name = NULL; } else { server_uid = pw->pw_uid; #ifdef HAVE_INITGROUPS if (initgroups(uid_name, server_gid) < 0) { fprintf(stderr, "%s: Cannot initialize supplementary group list for user %s: %s\n", progname, uid_name, strerror(errno)); return 0; } #endif } } else { server_uid = getuid(); } #endif if (chroot_dir) { if (chroot(chroot_dir) < 0) { fprintf(stderr, "%s: Failed to perform chroot %s: %s", progname, chroot_dir, strerror(errno)); return 0; } /* * Note that we leave chdir alone. It may be * OUTSIDE of the root. This allows us to read * the configuration from "-d ./etc/raddb", with * the chroot as "./chroot/" for example. After * the server has been loaded, it does a "cd * ${logdir}" below, so that core files (if any) * go to a logging directory. * * This also allows the configuration of the * server to be outside of the chroot. If the * server is statically linked, then the only * things needed inside of the chroot are the * logging directories. */ } #ifdef HAVE_GRP_H /* Set GID. */ if (gid_name && (setgid(server_gid) < 0)) { fprintf(stderr, "%s: Failed setting group to %s: %s", progname, gid_name, strerror(errno)); return 0; } #endif #ifdef HAVE_SETUID /* * Just before losing root permissions, ensure that the * log files have the correct owner && group. * * We have to do this because the log file MAY have been * specified on the command-line. */ if (uid_name || gid_name) { if ((mainconfig.radlog_dest == RADLOG_FILES) && (mainconfig.radlog_fd < 0)) { mainconfig.radlog_fd = open(mainconfig.log_file, O_WRONLY | O_APPEND | O_CREAT, 0640); if (mainconfig.radlog_fd < 0) { fprintf(stderr, "radiusd: Failed to open log file %s: %s\n", mainconfig.log_file, strerror(errno)); return 0; } if (chown(mainconfig.log_file, server_uid, server_gid) < 0) { fprintf(stderr, "%s: Cannot change ownership of log file %s: %s\n", progname, mainconfig.log_file, strerror(errno)); return 0; } } } if (uid_name) { doing_setuid = TRUE; fr_suid_down(); } #endif /* * This also clears the dumpable flag if core dumps * aren't allowed. */ fr_set_dumpable(); if (allow_core_dumps) { radlog(L_INFO, "Core dumps are enabled."); } return 1; } #endif /* HAVE_SETUID */ static const FR_NAME_NUMBER str2dest[] = { { "null", RADLOG_NULL }, { "files", RADLOG_FILES }, { "syslog", RADLOG_SYSLOG }, { "stdout", RADLOG_STDOUT }, { "stderr", RADLOG_STDERR }, { NULL, RADLOG_NUM_DEST } }; /* * Read config files. * * This function can ONLY be called from the main server process. */ int read_mainconfig(int reload) { const char *p = NULL; CONF_PAIR *cp; CONF_SECTION *cs; struct stat statbuf; cached_config_t *cc; char buffer[1024]; if (reload != 0) { radlog(L_ERR, "Reload is not implemented"); return -1; } if (stat(radius_dir, &statbuf) < 0) { radlog(L_ERR, "Errors reading %s: %s", radius_dir, strerror(errno)); return -1; } #ifdef S_IWOTH if ((statbuf.st_mode & S_IWOTH) != 0) { radlog(L_ERR, "Configuration directory %s is globally writable. Refusing to start due to insecure configuration.", radius_dir); return -1; } #endif #ifdef S_IROTH if (0 && (statbuf.st_mode & S_IROTH) != 0) { radlog(L_ERR, "Configuration directory %s is globally readable. Refusing to start due to insecure configuration.", radius_dir); return -1; } #endif radlog(L_INFO, "Starting - reading configuration files ..."); /* Read the configuration file */ snprintf(buffer, sizeof(buffer), "%.200s/%.50s.conf", radius_dir, mainconfig.name); if ((cs = cf_file_read(buffer)) == NULL) { radlog(L_ERR, "Errors reading or parsing %s", buffer); return -1; } /* * If there was no log destination set on the command line, * set it now. */ if (mainconfig.radlog_dest == RADLOG_NULL) { if (cf_section_parse(cs, NULL, serverdest_config) < 0) { fprintf(stderr, "radiusd: Error: Failed to parse log{} section.\n"); cf_section_free(&cs); return -1; } if (!radlog_dest) { fprintf(stderr, "radiusd: Error: No log destination specified.\n"); cf_section_free(&cs); return -1; } mainconfig.radlog_dest = fr_str2int(str2dest, radlog_dest, RADLOG_NUM_DEST); if (mainconfig.radlog_dest == RADLOG_NUM_DEST) { fprintf(stderr, "radiusd: Error: Unknown log_destination %s\n", radlog_dest); cf_section_free(&cs); return -1; } if (mainconfig.radlog_dest == RADLOG_SYSLOG) { /* * Make sure syslog_facility isn't NULL * before using it */ if (!syslog_facility) { fprintf(stderr, "radiusd: Error: Syslog chosen but no facility was specified\n"); cf_section_free(&cs); return -1; } mainconfig.syslog_facility = fr_str2int(syslog_str2fac, syslog_facility, -1); if (mainconfig.syslog_facility < 0) { fprintf(stderr, "radiusd: Error: Unknown syslog_facility %s\n", syslog_facility); cf_section_free(&cs); return -1; } #ifdef HAVE_SYSLOG_H /* * Call openlog only once, when the * program starts. */ openlog(progname, LOG_PID, mainconfig.syslog_facility); #endif } else if (mainconfig.radlog_dest == RADLOG_FILES) { if (!mainconfig.log_file) { fprintf(stderr, "radiusd: Error: Specified \"files\" as a log destination, but no log filename was given!\n"); cf_section_free(&cs); return -1; } } } #ifdef HAVE_SETUID /* * Switch users as early as possible. */ if (!switch_users(cs)) exit(1); #endif /* * Open the log file AFTER switching uid / gid. If we * did switch uid/gid, then the code in switch_users() * took care of setting the file permissions correctly. */ if ((mainconfig.radlog_dest == RADLOG_FILES) && (mainconfig.radlog_fd < 0)) { mainconfig.radlog_fd = open(mainconfig.log_file, O_WRONLY | O_APPEND | O_CREAT, 0640); if (mainconfig.radlog_fd < 0) { fprintf(stderr, "radiusd: Failed to open log file %s: %s\n", mainconfig.log_file, strerror(errno)); cf_section_free(&cs); return -1; } } /* Initialize the dictionary */ cp = cf_pair_find(cs, "dictionary"); if (cp) p = cf_pair_value(cp); if (!p) p = radius_dir; DEBUG2("including dictionary file %s/%s", p, RADIUS_DICTIONARY); if (dict_init(p, RADIUS_DICTIONARY) != 0) { radlog(L_ERR, "Errors reading dictionary: %s", fr_strerror()); return -1; } /* * This allows us to figure out where, relative to * radiusd.conf, the other configuration files exist. */ cf_section_parse(cs, NULL, server_config); /* * Free the old configuration items, and replace them * with the new ones. * * Note that where possible, we do atomic switch-overs, * to ensure that the pointers are always valid. */ cf_section_free(&mainconfig.config); mainconfig.config = cs; DEBUG2("%s: #### Loading Realms and Home Servers ####", mainconfig.name); if (!realms_init(cs)) { DEBUG2("Failed to load realms and home servers\n"); return -1; } DEBUG2("%s: #### Loading Clients ####", mainconfig.name); if (!clients_parse_section(cs)) { DEBUG2("Failed to load clients\n"); return -1; } /* * Register the %{config:section.subsection} xlat function. */ xlat_register("config", xlat_config, NULL); xlat_register("client", xlat_client, NULL); /* * Starting the server, WITHOUT "-x" on the * command-line: use whatever is in the config * file. */ if (debug_flag == 0) { debug_flag = mainconfig.debug_level; } fr_debug_flag = debug_flag; /* * Go update our behaviour, based on the configuration * changes. */ /* * Sanity check the configuration for internal * consistency. */ if (mainconfig.reject_delay > mainconfig.cleanup_delay) { mainconfig.reject_delay = mainconfig.cleanup_delay; } if (mainconfig.reject_delay < 0) mainconfig.reject_delay = 0; if (chroot_dir) { if (chdir(radlog_dir) < 0) { radlog(L_ERR, "Failed to 'chdir %s' after chroot: %s", radlog_dir, strerror(errno)); return -1; } } cc = rad_malloc(sizeof(*cc)); memset(cc, 0, sizeof(*cc)); cc->cs = cs; rad_assert(cs_cache == NULL); cs_cache = cc; return 0; } /* * Free the configuration. Called only when the server is exiting. */ int free_mainconfig(void) { cached_config_t *cc, *next; virtual_servers_free(0); /* * Free all of the cached configurations. */ for (cc = cs_cache; cc != NULL; cc = next) { next = cc->next; cf_section_free(&cc->cs); free(cc); } /* * Clean up the configuration data * structures. */ realms_free(); listen_free(&mainconfig.listen); dict_free(); return 0; } void hup_logfile(void) { int fd, old_fd; if (mainconfig.radlog_dest != RADLOG_FILES) return; fd = open(mainconfig.log_file, O_WRONLY | O_APPEND | O_CREAT, 0640); if (fd >= 0) { /* * Atomic swap. We'd like to keep the old * FD around so that callers don't * suddenly find the FD closed, and the * writes go nowhere. But that's hard to * do. So... we have the case where a * log message *might* be lost on HUP. */ old_fd = mainconfig.radlog_fd; mainconfig.radlog_fd = fd; close(old_fd); } } void hup_mainconfig(void) { cached_config_t *cc; CONF_SECTION *cs; char buffer[1024]; radlog(L_INFO, "HUP - Re-reading configuration files"); /* Read the configuration file */ snprintf(buffer, sizeof(buffer), "%.200s/%.50s.conf", radius_dir, mainconfig.name); if ((cs = cf_file_read(buffer)) == NULL) { radlog(L_ERR, "Failed to re-read or parse %s", buffer); return; } cc = rad_malloc(sizeof(*cc)); memset(cc, 0, sizeof(*cc)); /* * Save the current configuration. Note that we do NOT * free older ones. We should probably do so at some * point. Doing so will require us to mark which modules * are still in use, and which aren't. Modules that * can't be HUPed always use the original configuration. * Modules that can be HUPed use one of the newer * configurations. */ cc->created = time(NULL); cc->cs = cs; cc->next = cs_cache; cs_cache = cc; /* * Re-open the log file. If we can't, then keep logging * to the old log file. * * The "open log file" code is here rather than in log.c, * because it makes that function MUCH simpler. */ hup_logfile(); radlog(L_INFO, "HUP - loading modules"); /* * Prefer the new module configuration. */ module_hup(cf_section_sub_find(cs, "modules")); /* * Load new servers BEFORE freeing old ones. */ virtual_servers_load(cs); virtual_servers_free(cc->created - mainconfig.max_request_time * 4); } freeradius-server/src/main/modcall.c000066400000000000000000001520321257552170400200200ustar00rootroot00000000000000/* * modcall.c * * Version: $Id$ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2000,2006 The FreeRADIUS server project */ #include RCSID("$Id$") #include #include #include #include extern int radius_get_vp(REQUEST *request, const char *name, VALUE_PAIR **vp_p); /* mutually-recursive static functions need a prototype up front */ static modcallable *do_compile_modgroup(modcallable *, int, CONF_SECTION *, int, int); /* Actions may be a positive integer (the highest one returned in the group * will be returned), or the keyword "return", represented here by * MOD_ACTION_RETURN, to cause an immediate return. * There's also the keyword "reject", represented here by MOD_ACTION_REJECT * to cause an immediate reject. */ #define MOD_ACTION_RETURN (-1) #define MOD_ACTION_REJECT (-2) /* Here are our basic types: modcallable, modgroup, and modsingle. For an * explanation of what they are all about, see ../../doc/README.failover */ struct modcallable { modcallable *parent; struct modcallable *next; const char *name; enum { MOD_SINGLE = 1, MOD_GROUP, MOD_LOAD_BALANCE, MOD_REDUNDANT_LOAD_BALANCE, #ifdef WITH_UNLANG MOD_IF, MOD_ELSE, MOD_ELSIF, MOD_UPDATE, MOD_SWITCH, MOD_CASE, #endif MOD_POLICY, MOD_REFERENCE, MOD_XLAT } type; int method; int actions[RLM_MODULE_NUMCODES]; }; #define GROUPTYPE_SIMPLE 0 #define GROUPTYPE_REDUNDANT 1 #define GROUPTYPE_APPEND 2 #define GROUPTYPE_COUNT 3 typedef struct { modcallable mc; /* self */ int grouptype; /* after mc */ modcallable *children; CONF_SECTION *cs; VALUE_PAIR *vps; } modgroup; typedef struct { modcallable mc; module_instance_t *modinst; } modsingle; typedef struct { modcallable mc; const char *ref_name; CONF_SECTION *ref_cs; } modref; typedef struct { modcallable mc; int exec; char *xlat_name; } modxlat; static const FR_NAME_NUMBER grouptype_table[] = { { "", GROUPTYPE_SIMPLE }, { "redundant ", GROUPTYPE_REDUNDANT }, { "append ", GROUPTYPE_APPEND }, { NULL, -1 } }; /* Simple conversions: modsingle and modgroup are subclasses of modcallable, * so we often want to go back and forth between them. */ static modsingle *mod_callabletosingle(modcallable *p) { rad_assert(p->type==MOD_SINGLE); return (modsingle *)p; } static modgroup *mod_callabletogroup(modcallable *p) { rad_assert((p->type > MOD_SINGLE) && (p->type <= MOD_POLICY)); return (modgroup *)p; } static modcallable *mod_singletocallable(modsingle *p) { return (modcallable *)p; } static modcallable *mod_grouptocallable(modgroup *p) { return (modcallable *)p; } static modref *mod_callabletoref(modcallable *p) { rad_assert(p->type==MOD_REFERENCE); return (modref *)p; } static modcallable *mod_reftocallable(modref *p) { return (modcallable *)p; } static modxlat *mod_callabletoxlat(modcallable *p) { rad_assert(p->type==MOD_XLAT); return (modxlat *)p; } static modcallable *mod_xlattocallable(modxlat *p) { return (modcallable *)p; } /* modgroups are grown by adding a modcallable to the end */ /* FIXME: This is O(N^2) */ static void add_child(modgroup *g, modcallable *c) { modcallable **head = &g->children; modcallable *node = *head; modcallable **last = head; if (!c) return; while (node) { last = &node->next; node = node->next; } rad_assert(c->next == NULL); *last = c; c->parent = mod_grouptocallable(g); } /* Here's where we recognize all of our keywords: first the rcodes, then the * actions */ static const FR_NAME_NUMBER rcode_table[] = { { "reject", RLM_MODULE_REJECT }, { "fail", RLM_MODULE_FAIL }, { "ok", RLM_MODULE_OK }, { "handled", RLM_MODULE_HANDLED }, { "invalid", RLM_MODULE_INVALID }, { "userlock", RLM_MODULE_USERLOCK }, { "notfound", RLM_MODULE_NOTFOUND }, { "noop", RLM_MODULE_NOOP }, { "updated", RLM_MODULE_UPDATED }, { NULL, 0 } }; /* * Compile action && rcode for later use. */ static int compile_action(modcallable *c, CONF_PAIR *cp) { int action; const char *attr, *value; attr = cf_pair_attr(cp); value = cf_pair_value(cp); if (!value) return 0; if (!strcasecmp(value, "return")) action = MOD_ACTION_RETURN; else if (!strcasecmp(value, "break")) action = MOD_ACTION_RETURN; else if (!strcasecmp(value, "reject")) action = MOD_ACTION_REJECT; else if (strspn(value, "0123456789")==strlen(value)) { action = atoi(value); /* * Don't allow priority zero, for future use. */ if (action == 0) return 0; } else { cf_log_err(cf_pairtoitem(cp), "Unknown action '%s'.\n", value); return 0; } if (strcasecmp(attr, "default") != 0) { int rcode; rcode = fr_str2int(rcode_table, attr, -1); if (rcode < 0) { cf_log_err(cf_pairtoitem(cp), "Unknown module rcode '%s'.\n", attr); return 0; } c->actions[rcode] = action; } else { /* set all unset values to the default */ int i; for (i = 0; i < RLM_MODULE_NUMCODES; i++) { if (!c->actions[i]) c->actions[i] = action; } } return 1; } /* Some short names for debugging output */ static const char * const comp2str[] = { "authenticate", "authorize", "preacct", "accounting", "session", "pre-proxy", "post-proxy", "post-auth" #ifdef WITH_COA , "recv-coa", "send-coa" #endif }; #ifdef HAVE_PTHREAD_H /* * Lock the mutex for the module */ static void safe_lock(module_instance_t *instance) { if (instance->mutex) pthread_mutex_lock(instance->mutex); } /* * Unlock the mutex for the module */ static void safe_unlock(module_instance_t *instance) { if (instance->mutex) pthread_mutex_unlock(instance->mutex); } #else /* * No threads: these functions become NULL's. */ #define safe_lock(foo) #define safe_unlock(foo) #endif static int call_modsingle(int component, modsingle *sp, REQUEST *request) { int myresult; int blocked; rad_assert(request != NULL); /* * If the request should stop, refuse to do anything. */ blocked = (request->master_state == REQUEST_STOP_PROCESSING); if (blocked) return RLM_MODULE_NOOP; RDEBUG3(" modsingle[%s]: calling %s (%s) for request %d", comp2str[component], sp->modinst->name, sp->modinst->entry->name, request->number); if (sp->modinst->force) { myresult = sp->modinst->code; goto fail; } safe_lock(sp->modinst); /* * For logging unresponsive children. */ request->module = sp->modinst->name; myresult = sp->modinst->entry->module->methods[component]( sp->modinst->insthandle, request); request->module = ""; safe_unlock(sp->modinst); /* * Wasn't blocked, and now is. Complain! */ blocked = (request->master_state == REQUEST_STOP_PROCESSING); if (blocked) { radlog(L_INFO, "WARNING: Module %s became unblocked for request %u", sp->modinst->entry->name, request->number); } fail: RDEBUG3(" modsingle[%s]: returned from %s (%s) for request %d", comp2str[component], sp->modinst->name, sp->modinst->entry->name, request->number); return myresult; } static int default_component_results[RLM_COMPONENT_COUNT] = { RLM_MODULE_REJECT, /* AUTH */ RLM_MODULE_NOTFOUND, /* AUTZ */ RLM_MODULE_NOOP, /* PREACCT */ RLM_MODULE_NOOP, /* ACCT */ RLM_MODULE_FAIL, /* SESS */ RLM_MODULE_NOOP, /* PRE_PROXY */ RLM_MODULE_NOOP, /* POST_PROXY */ RLM_MODULE_NOOP /* POST_AUTH */ #ifdef WITH_COA , RLM_MODULE_NOOP, /* RECV_COA_TYPE */ RLM_MODULE_NOOP /* SEND_COA_TYPE */ #endif }; static const char *group_name[] = { "", "single", "group", "load-balance group", "redundant-load-balance group", #ifdef WITH_UNLANG "if", "else", "elsif", "update", "switch", "case", #endif "policy" }; /* Here's where we recognize all of our keywords: first the rcodes, then the * actions */ const FR_NAME_NUMBER mod_rcode_table[] = { { "reject", RLM_MODULE_REJECT }, { "fail", RLM_MODULE_FAIL }, { "ok", RLM_MODULE_OK }, { "handled", RLM_MODULE_HANDLED }, { "invalid", RLM_MODULE_INVALID }, { "userlock", RLM_MODULE_USERLOCK }, { "notfound", RLM_MODULE_NOTFOUND }, { "noop", RLM_MODULE_NOOP }, { "updated", RLM_MODULE_UPDATED }, { NULL, 0 } }; static const char *modcall_spaces = "++++++++++++++++++++++++++++++++"; #define MODCALL_STACK_MAX (32) #define MOD_LOG_OPEN_BRACE(_name) RDEBUG2("%.*s%s %s {", depth + 1, modcall_spaces, _name, c->name) #define MOD_LOG_CLOSE_BRACE() RDEBUG2("%.*s} # %s %s = %s", depth + 1, modcall_spaces, \ group_name[c->type], c->name ? c->name : "", \ fr_int2str(mod_rcode_table, result, "")) /* * Don't call the modules recursively. Instead, do them * iteratively, and manage the call stack ourselves. */ typedef struct modcall_stack_entry_t { int result; int priority; modcallable *c; } modcall_stack_entry_t; static int modcall_recurse(REQUEST *request, int component, int depth, modcall_stack_entry_t *entry, int do_next_sibling); /* * Call a child of a block. */ static void modcall_child(REQUEST *request, int component, int depth, modcall_stack_entry_t *entry, modcallable *c, int *result, int do_next_sibling) { modcall_stack_entry_t *next; if (depth >= MODCALL_STACK_MAX) { radlog(L_ERR, "Internal sanity check failed: module stack is too deep"); exit(1); } /* * Initialize the childs stack frame. */ next = entry + 1; next->c = c; next->result = entry->result; next->priority = 0; if (!modcall_recurse(request, component, depth, next, do_next_sibling)) { *result = RLM_MODULE_FAIL; return; } *result = next->result; return; } /* * Interpret the various types of blocks. */ static int modcall_recurse(REQUEST *request, int component, int depth, modcall_stack_entry_t *entry, int do_next_sibling) { int if_taken, was_if; modcallable *c; int result, priority; was_if = if_taken = FALSE; result = RLM_MODULE_FAIL; redo: priority = -1; c = entry->c; /* * Nothing more to do. Return the code and priority * which was set by the caller. */ if (!c) return TRUE; /* * We've been asked to stop. Do so. */ if ((request->master_state == REQUEST_STOP_PROCESSING) || (request->parent && (request->parent->master_state == REQUEST_STOP_PROCESSING))) { entry->result = RLM_MODULE_FAIL; entry->priority = 9999; return TRUE; } /* * Handle "if" conditions. */ if (c->type == MOD_IF) { int condition; modgroup *g; const char *p; mod_if: g = mod_callabletogroup(c); p = c->name; RDEBUG2("%.*s? %s %s", depth + 1, modcall_spaces, group_name[c->type], c->name); if (radius_evaluate_condition(request, result, 0, &p, TRUE, &condition)) { RDEBUG2("%.*s? %s %s -> %s", depth + 1, modcall_spaces, group_name[c->type], c->name, condition ? "TRUE" : "FALSE"); } else { condition = FALSE; } /* * Didn't pass. Remember that. */ if (!condition) { was_if = TRUE; if_taken = FALSE; goto next_sibling; } /* * We took the "if". Go recurse into its' children. */ was_if = TRUE; if_taken = TRUE; goto do_children; } /* MOD_IF */ /* * "else" if the previous "if" was taken. * "if" if the previous if wasn't taken. */ if (c->type == MOD_ELSIF) { if (!was_if) goto elsif_error; /* * Like MOD_ELSE, but allow for a later "else" */ if (if_taken) { RDEBUG2("%.*s ... skipping %s for request %d: Preceding \"if\" was taken", depth + 1, modcall_spaces, group_name[c->type], request->number); was_if = TRUE; if_taken = TRUE; goto next_sibling; } /* * Check the "if" condition. */ goto mod_if; } /* MOD_ELSIF */ /* * "else" for a preceding "if". */ if (c->type == MOD_ELSE) { if (!was_if) { /* error */ elsif_error: RDEBUG2("%.*s ... skipping %s for request %d: No preceding \"if\"", depth + 1, modcall_spaces, group_name[c->type], request->number); goto next_sibling; } if (if_taken) { RDEBUG2("%.*s ... skipping %s for request %d: Preceding \"if\" was taken", depth + 1, modcall_spaces, group_name[c->type], request->number); was_if = FALSE; if_taken = FALSE; goto next_sibling; } /* * We need to process it. Go do that. */ was_if = FALSE; if_taken = FALSE; goto do_children; } /* MOD_ELSE */ /* * We're no longer processing if/else/elsif. Reset the * trackers for those conditions. */ was_if = FALSE; if_taken = FALSE; if (c->type == MOD_SINGLE) { modsingle *sp; /* * Process a stand-alone child, and fall through * to dealing with it's parent. */ sp = mod_callabletosingle(c); result = call_modsingle(c->method, sp, request); RDEBUG2("%.*s[%s] = %s", depth + 1, modcall_spaces, c->name ? c->name : "", fr_int2str(mod_rcode_table, result, "")); goto calculate_result; } /* MOD_SINGLE */ /* * Update attribute(s) */ if (c->type == MOD_UPDATE) { int rcode; modgroup *g = mod_callabletogroup(c); MOD_LOG_OPEN_BRACE("update"); rcode = radius_update_attrlist(request, g->cs, g->vps, c->name); if (rcode != RLM_MODULE_UPDATED) { result = rcode; } else { result = RLM_MODULE_NOOP; } MOD_LOG_CLOSE_BRACE(); goto calculate_result; } /* MOD_IF */ /* * Child is a group that has children of it's own. */ if ((c->type == MOD_GROUP) || (c->type == MOD_POLICY) || (c->type == MOD_CASE)) { modgroup *g; do_children: g = mod_callabletogroup(c); /* * This should really have been caught in the * compiler, and the node never generated. But * doing that requires changing it's API so that * it returns a flag instead of the compiled * MOD_GROUP. */ if (!g->children) { RDEBUG2("%.*s%s %s { ... } # empty sub-section is ignored", depth + 1, modcall_spaces, group_name[c->type], c->name); goto next_sibling; } MOD_LOG_OPEN_BRACE(group_name[c->type]); modcall_child(request, component, depth + 1, entry, g->children, &result, TRUE); MOD_LOG_CLOSE_BRACE(); goto calculate_result; } /* MOD_GROUP */ if (c->type == MOD_SWITCH) { modcallable *this, *found, *null_case; modgroup *g; char buffer[1024]; MOD_LOG_OPEN_BRACE("switch"); /* * If there's no %, it refers to an attribute. * Otherwise, expand it. */ if (!strchr(c->name, '%')) { VALUE_PAIR *vp = NULL; if (radius_get_vp(request, c->name, &vp) && vp) { vp_prints_value(buffer, sizeof(buffer), vp, 0); } else { *buffer = '\0'; } } else { radius_xlat(buffer, sizeof(buffer), c->name, request, NULL); } /* * Find either the exact matching name, or the * "case {...}" statement. */ g = mod_callabletogroup(c); null_case = found = NULL; for (this = g->children; this; this = this->next) { if (!this->name) { if (!null_case) null_case = this; continue; } if (strcmp(buffer, this->name) == 0) { found = this; break; } } if (!found) found = null_case; MOD_LOG_OPEN_BRACE(group_name[c->type]); modcall_child(request, component, depth + 1, entry, found, &result, TRUE); MOD_LOG_CLOSE_BRACE(); goto calculate_result; } /* MOD_SWITCH */ if ((c->type == MOD_LOAD_BALANCE) || (c->type == MOD_REDUNDANT_LOAD_BALANCE)) { int count = 0; modcallable *this, *found; modgroup *g; MOD_LOG_OPEN_BRACE("load-balance"); g = mod_callabletogroup(c); found = NULL; for (this = g->children; this; this = this->next) { if (!found) { found = this; count = 1; continue; } count++; if ((count * (fr_rand() & 0xffff)) < (uint32_t) 0x10000) { found = this; } } MOD_LOG_OPEN_BRACE(group_name[c->type]); if (c->type == MOD_LOAD_BALANCE) { modcall_child(request, component, depth + 1, entry, found, &result, FALSE); } else { this = found; do { modcall_child(request, component, depth + 1, entry, found, &result, FALSE); if (found->actions[result] == MOD_ACTION_RETURN) { priority = -1; break; } this = this->next; if (!this) this = g->children; } while (this != found); } MOD_LOG_CLOSE_BRACE(); goto calculate_result; } /* MOD_LOAD_BALANCE */ /* * Reference another virtual server. * * This should really be deleted, and replaced with a * more abstracted / functional version. */ if (c->type == MOD_REFERENCE) { modref *mr = mod_callabletoref(c); char const *server = request->server; if (server == mr->ref_name) { radlog(L_INFO, "WARNING: Suppressing recursive call to server %s", server); goto next_sibling; } request->server = mr->ref_name; RDEBUG("server %s { # nested call", mr->ref_name); result = indexed_modcall(component, 0, request); RDEBUG("} # server %s with nested call", mr->ref_name); request->server = server; goto calculate_result; } /* MOD_REFERENCE */ /* * xlat a string without doing anything else * * This should really be deleted, and replaced with a * more abstracted / functional version. */ if (c->type == MOD_XLAT) { modxlat *mx = mod_callabletoxlat(c); char buffer[128]; if (!mx->exec) { radius_xlat(buffer, sizeof(buffer), mx->xlat_name, request, NULL); } else { RDEBUG("`%s`", mx->xlat_name); radius_exec_program(mx->xlat_name, request, 0, NULL, 0, EXEC_TIMEOUT, request->packet->vps, NULL, 1); } goto next_sibling; } /* MOD_XLAT */ /* * Add new module types here. */ calculate_result: #if 0 RDEBUG("(%s, %d) ? (%s, %d)", fr_int2str(mod_rcode_table, result, ""), priority, fr_int2str(mod_rcode_table, entry->result, ""), entry->priority); #endif /* * The child's action says return. Do so. */ if ((c->actions[result] == MOD_ACTION_RETURN) && (priority <= 0)) { entry->result = result; return TRUE; } /* * If "reject", break out of the loop and return * reject. */ if (c->actions[result] == MOD_ACTION_REJECT) { entry->result = RLM_MODULE_REJECT; return TRUE; } /* * The array holds a default priority for this return * code. Grab it in preference to any unset priority. */ if (priority < 0) { priority = c->actions[result]; } /* * We're higher than any previous priority, remember this * return code and priority. */ if (priority > entry->priority) { entry->result = result; entry->priority = priority; } /* * If we're processing a "case" statement, we return once * it's done, rather than going to the next "case" statement. */ if (c->type == MOD_CASE) return TRUE; next_sibling: if (do_next_sibling) { entry->c = entry->c->next; if (entry->c) goto redo; } /* * And we're done! */ return TRUE; } /** * @brief Call a module, iteratively, with a local stack, rather than * recursively. What did Paul Graham say about Lisp...? */ int modcall(int component, modcallable *c, REQUEST *request) { modcall_stack_entry_t stack[MODCALL_STACK_MAX]; if ((component < 0) || (component >= RLM_COMPONENT_COUNT)) { return RLM_MODULE_FAIL; } /* * Set up the initial stack frame. */ stack[0].c = c; stack[0].result = default_component_results[component]; stack[0].priority = 0; /* * Call the main handler. */ if (!modcall_recurse(request, component, 0, &stack[0], TRUE)) { return RLM_MODULE_FAIL; } /* * Return the result. */ return stack[0].result; } #if 0 static const char *action2str(int action) { static char buf[32]; if(action==MOD_ACTION_RETURN) return "return"; if(action==MOD_ACTION_REJECT) return "reject"; snprintf(buf, sizeof buf, "%d", action); return buf; } /* If you suspect a bug in the parser, you'll want to use these dump * functions. dump_tree should reproduce a whole tree exactly as it was found * in radiusd.conf, but in long form (all actions explicitly defined) */ static void dump_mc(modcallable *c, int indent) { int i; if(c->type==MOD_SINGLE) { modsingle *single = mod_callabletosingle(c); DEBUG("%.*s%s {", indent, "\t\t\t\t\t\t\t\t\t\t\t", single->modinst->name); } else if ((c->type > MOD_SINGLE) && (c->type <= MOD_POLICY)) { modgroup *g = mod_callabletogroup(c); modcallable *p; DEBUG("%.*s%s {", indent, "\t\t\t\t\t\t\t\t\t\t\t", group_name[c->type]); for(p = g->children;p;p = p->next) dump_mc(p, indent+1); } /* else ignore it for now */ for(i = 0; iactions[i])); } DEBUG("%.*s}", indent, "\t\t\t\t\t\t\t\t\t\t\t"); } static void dump_tree(int comp, modcallable *c) { RDEBUG("[%s]", comp2str[comp]); dump_mc(c, 0); } #else #define dump_tree(a, b) #endif /* These are the default actions. For each component, the group{} block * behaves like the code from the old module_*() function. redundant{} and * append{} are based on my guesses of what they will be used for. --Pac. */ static const int defaultactions[RLM_COMPONENT_COUNT][GROUPTYPE_COUNT][RLM_MODULE_NUMCODES] = { /* authenticate */ { /* group */ { MOD_ACTION_RETURN, /* reject */ 1, /* fail */ MOD_ACTION_RETURN, /* ok */ MOD_ACTION_RETURN, /* handled */ 1, /* invalid */ MOD_ACTION_RETURN, /* userlock */ MOD_ACTION_RETURN, /* notfound */ 1, /* noop */ 1 /* updated */ }, /* redundant */ { MOD_ACTION_RETURN, /* reject */ 1, /* fail */ MOD_ACTION_RETURN, /* ok */ MOD_ACTION_RETURN, /* handled */ MOD_ACTION_RETURN, /* invalid */ MOD_ACTION_RETURN, /* userlock */ MOD_ACTION_RETURN, /* notfound */ MOD_ACTION_RETURN, /* noop */ MOD_ACTION_RETURN /* updated */ }, /* append */ { MOD_ACTION_RETURN, /* reject */ 1, /* fail */ MOD_ACTION_RETURN, /* ok */ MOD_ACTION_RETURN, /* handled */ MOD_ACTION_RETURN, /* invalid */ MOD_ACTION_RETURN, /* userlock */ 2, /* notfound */ MOD_ACTION_RETURN, /* noop */ MOD_ACTION_RETURN /* updated */ } }, /* authorize */ { /* group */ { MOD_ACTION_RETURN, /* reject */ MOD_ACTION_RETURN, /* fail */ 3, /* ok */ MOD_ACTION_RETURN, /* handled */ MOD_ACTION_RETURN, /* invalid */ MOD_ACTION_RETURN, /* userlock */ 1, /* notfound */ 2, /* noop */ 4 /* updated */ }, /* redundant */ { MOD_ACTION_RETURN, /* reject */ 1, /* fail */ MOD_ACTION_RETURN, /* ok */ MOD_ACTION_RETURN, /* handled */ MOD_ACTION_RETURN, /* invalid */ MOD_ACTION_RETURN, /* userlock */ MOD_ACTION_RETURN, /* notfound */ MOD_ACTION_RETURN, /* noop */ MOD_ACTION_RETURN /* updated */ }, /* append */ { MOD_ACTION_RETURN, /* reject */ 1, /* fail */ MOD_ACTION_RETURN, /* ok */ MOD_ACTION_RETURN, /* handled */ MOD_ACTION_RETURN, /* invalid */ MOD_ACTION_RETURN, /* userlock */ 2, /* notfound */ MOD_ACTION_RETURN, /* noop */ MOD_ACTION_RETURN /* updated */ } }, /* preacct */ { /* group */ { MOD_ACTION_RETURN, /* reject */ MOD_ACTION_RETURN, /* fail */ 2, /* ok */ MOD_ACTION_RETURN, /* handled */ MOD_ACTION_RETURN, /* invalid */ MOD_ACTION_RETURN, /* userlock */ MOD_ACTION_RETURN, /* notfound */ 1, /* noop */ 3 /* updated */ }, /* redundant */ { MOD_ACTION_RETURN, /* reject */ 1, /* fail */ MOD_ACTION_RETURN, /* ok */ MOD_ACTION_RETURN, /* handled */ MOD_ACTION_RETURN, /* invalid */ MOD_ACTION_RETURN, /* userlock */ MOD_ACTION_RETURN, /* notfound */ MOD_ACTION_RETURN, /* noop */ MOD_ACTION_RETURN /* updated */ }, /* append */ { MOD_ACTION_RETURN, /* reject */ 1, /* fail */ MOD_ACTION_RETURN, /* ok */ MOD_ACTION_RETURN, /* handled */ MOD_ACTION_RETURN, /* invalid */ MOD_ACTION_RETURN, /* userlock */ 2, /* notfound */ MOD_ACTION_RETURN, /* noop */ MOD_ACTION_RETURN /* updated */ } }, /* accounting */ { /* group */ { MOD_ACTION_RETURN, /* reject */ MOD_ACTION_RETURN, /* fail */ 2, /* ok */ MOD_ACTION_RETURN, /* handled */ MOD_ACTION_RETURN, /* invalid */ MOD_ACTION_RETURN, /* userlock */ MOD_ACTION_RETURN, /* notfound */ 1, /* noop */ 3 /* updated */ }, /* redundant */ { 1, /* reject */ 1, /* fail */ MOD_ACTION_RETURN, /* ok */ MOD_ACTION_RETURN, /* handled */ 1, /* invalid */ 1, /* userlock */ 1, /* notfound */ 2, /* noop */ 4 /* updated */ }, /* append */ { MOD_ACTION_RETURN, /* reject */ 1, /* fail */ MOD_ACTION_RETURN, /* ok */ MOD_ACTION_RETURN, /* handled */ MOD_ACTION_RETURN, /* invalid */ MOD_ACTION_RETURN, /* userlock */ 2, /* notfound */ MOD_ACTION_RETURN, /* noop */ MOD_ACTION_RETURN /* updated */ } }, /* checksimul */ { /* group */ { MOD_ACTION_RETURN, /* reject */ 1, /* fail */ MOD_ACTION_RETURN, /* ok */ MOD_ACTION_RETURN, /* handled */ MOD_ACTION_RETURN, /* invalid */ MOD_ACTION_RETURN, /* userlock */ MOD_ACTION_RETURN, /* notfound */ MOD_ACTION_RETURN, /* noop */ MOD_ACTION_RETURN /* updated */ }, /* redundant */ { MOD_ACTION_RETURN, /* reject */ 1, /* fail */ MOD_ACTION_RETURN, /* ok */ MOD_ACTION_RETURN, /* handled */ MOD_ACTION_RETURN, /* invalid */ MOD_ACTION_RETURN, /* userlock */ MOD_ACTION_RETURN, /* notfound */ MOD_ACTION_RETURN, /* noop */ MOD_ACTION_RETURN /* updated */ }, /* append */ { MOD_ACTION_RETURN, /* reject */ 1, /* fail */ MOD_ACTION_RETURN, /* ok */ MOD_ACTION_RETURN, /* handled */ MOD_ACTION_RETURN, /* invalid */ MOD_ACTION_RETURN, /* userlock */ MOD_ACTION_RETURN, /* notfound */ MOD_ACTION_RETURN, /* noop */ MOD_ACTION_RETURN /* updated */ } }, /* pre-proxy */ { /* group */ { MOD_ACTION_RETURN, /* reject */ MOD_ACTION_RETURN, /* fail */ 3, /* ok */ MOD_ACTION_RETURN, /* handled */ MOD_ACTION_RETURN, /* invalid */ MOD_ACTION_RETURN, /* userlock */ 1, /* notfound */ 2, /* noop */ 4 /* updated */ }, /* redundant */ { MOD_ACTION_RETURN, /* reject */ 1, /* fail */ MOD_ACTION_RETURN, /* ok */ MOD_ACTION_RETURN, /* handled */ MOD_ACTION_RETURN, /* invalid */ MOD_ACTION_RETURN, /* userlock */ MOD_ACTION_RETURN, /* notfound */ MOD_ACTION_RETURN, /* noop */ MOD_ACTION_RETURN /* updated */ }, /* append */ { MOD_ACTION_RETURN, /* reject */ 1, /* fail */ MOD_ACTION_RETURN, /* ok */ MOD_ACTION_RETURN, /* handled */ MOD_ACTION_RETURN, /* invalid */ MOD_ACTION_RETURN, /* userlock */ 2, /* notfound */ MOD_ACTION_RETURN, /* noop */ MOD_ACTION_RETURN /* updated */ } }, /* post-proxy */ { /* group */ { MOD_ACTION_RETURN, /* reject */ MOD_ACTION_RETURN, /* fail */ 3, /* ok */ MOD_ACTION_RETURN, /* handled */ MOD_ACTION_RETURN, /* invalid */ MOD_ACTION_RETURN, /* userlock */ 1, /* notfound */ 2, /* noop */ 4 /* updated */ }, /* redundant */ { MOD_ACTION_RETURN, /* reject */ 1, /* fail */ MOD_ACTION_RETURN, /* ok */ MOD_ACTION_RETURN, /* handled */ MOD_ACTION_RETURN, /* invalid */ MOD_ACTION_RETURN, /* userlock */ MOD_ACTION_RETURN, /* notfound */ MOD_ACTION_RETURN, /* noop */ MOD_ACTION_RETURN /* updated */ }, /* append */ { MOD_ACTION_RETURN, /* reject */ 1, /* fail */ MOD_ACTION_RETURN, /* ok */ MOD_ACTION_RETURN, /* handled */ MOD_ACTION_RETURN, /* invalid */ MOD_ACTION_RETURN, /* userlock */ 2, /* notfound */ MOD_ACTION_RETURN, /* noop */ MOD_ACTION_RETURN /* updated */ } }, /* post-auth */ { /* group */ { MOD_ACTION_RETURN, /* reject */ MOD_ACTION_RETURN, /* fail */ 3, /* ok */ MOD_ACTION_RETURN, /* handled */ MOD_ACTION_RETURN, /* invalid */ MOD_ACTION_RETURN, /* userlock */ 1, /* notfound */ 2, /* noop */ 4 /* updated */ }, /* redundant */ { MOD_ACTION_RETURN, /* reject */ 1, /* fail */ MOD_ACTION_RETURN, /* ok */ MOD_ACTION_RETURN, /* handled */ MOD_ACTION_RETURN, /* invalid */ MOD_ACTION_RETURN, /* userlock */ MOD_ACTION_RETURN, /* notfound */ MOD_ACTION_RETURN, /* noop */ MOD_ACTION_RETURN /* updated */ }, /* append */ { MOD_ACTION_RETURN, /* reject */ 1, /* fail */ MOD_ACTION_RETURN, /* ok */ MOD_ACTION_RETURN, /* handled */ MOD_ACTION_RETURN, /* invalid */ MOD_ACTION_RETURN, /* userlock */ 2, /* notfound */ MOD_ACTION_RETURN, /* noop */ MOD_ACTION_RETURN /* updated */ } } #ifdef WITH_COA , /* recv-coa */ { /* group */ { MOD_ACTION_RETURN, /* reject */ MOD_ACTION_RETURN, /* fail */ 3, /* ok */ MOD_ACTION_RETURN, /* handled */ MOD_ACTION_RETURN, /* invalid */ MOD_ACTION_RETURN, /* userlock */ 1, /* notfound */ 2, /* noop */ 4 /* updated */ }, /* redundant */ { MOD_ACTION_RETURN, /* reject */ 1, /* fail */ MOD_ACTION_RETURN, /* ok */ MOD_ACTION_RETURN, /* handled */ MOD_ACTION_RETURN, /* invalid */ MOD_ACTION_RETURN, /* userlock */ MOD_ACTION_RETURN, /* notfound */ MOD_ACTION_RETURN, /* noop */ MOD_ACTION_RETURN /* updated */ }, /* append */ { MOD_ACTION_RETURN, /* reject */ 1, /* fail */ MOD_ACTION_RETURN, /* ok */ MOD_ACTION_RETURN, /* handled */ MOD_ACTION_RETURN, /* invalid */ MOD_ACTION_RETURN, /* userlock */ 2, /* notfound */ MOD_ACTION_RETURN, /* noop */ MOD_ACTION_RETURN /* updated */ } }, /* send-coa */ { /* group */ { MOD_ACTION_RETURN, /* reject */ MOD_ACTION_RETURN, /* fail */ 3, /* ok */ MOD_ACTION_RETURN, /* handled */ MOD_ACTION_RETURN, /* invalid */ MOD_ACTION_RETURN, /* userlock */ 1, /* notfound */ 2, /* noop */ 4 /* updated */ }, /* redundant */ { MOD_ACTION_RETURN, /* reject */ 1, /* fail */ MOD_ACTION_RETURN, /* ok */ MOD_ACTION_RETURN, /* handled */ MOD_ACTION_RETURN, /* invalid */ MOD_ACTION_RETURN, /* userlock */ MOD_ACTION_RETURN, /* notfound */ MOD_ACTION_RETURN, /* noop */ MOD_ACTION_RETURN /* updated */ }, /* append */ { MOD_ACTION_RETURN, /* reject */ 1, /* fail */ MOD_ACTION_RETURN, /* ok */ MOD_ACTION_RETURN, /* handled */ MOD_ACTION_RETURN, /* invalid */ MOD_ACTION_RETURN, /* userlock */ 2, /* notfound */ MOD_ACTION_RETURN, /* noop */ MOD_ACTION_RETURN /* updated */ } } #endif }; #ifdef WITH_UNLANG static modcallable *do_compile_modupdate(modcallable *parent, int component, CONF_SECTION *cs, const char *name2) { int i, ok = FALSE; const char *vp_name; modgroup *g; modcallable *csingle; CONF_ITEM *ci; VALUE_PAIR *head, **tail; static const char *attrlist_names[] = { "request", "reply", "proxy-request", "proxy-reply", "config", "control", "coa", "coa-reply", "disconnect", "disconnect-reply", NULL }; component = component; /* -Wunused */ if (!cf_section_name2(cs)) { cf_log_err(cf_sectiontoitem(cs), "Require list name for 'update'.\n"); return NULL; } vp_name = name2; if (strncmp(vp_name, "outer.", 6) == 0) { vp_name += 6; } for (i = 0; attrlist_names[i] != NULL; i++) { if (strcmp(vp_name, attrlist_names[i]) == 0) { ok = TRUE; break; } } if (!ok) { cf_log_err(cf_sectiontoitem(cs), "Unknown attribute list \"%s\"", name2); return NULL; } head = NULL; tail = &head; /* * Walk through the children of the update section, * ensuring that they're all known attributes. */ for (ci=cf_item_find_next(cs, NULL); ci != NULL; ci=cf_item_find_next(cs, ci)) { CONF_PAIR *cp; VALUE_PAIR *vp; if (cf_item_is_section(ci)) { cf_log_err(ci, "\"update\" sections cannot have subsections"); return NULL; } if (!cf_item_is_pair(ci)) continue; cp = cf_itemtopair(ci); /* can't return NULL */ vp = cf_pairtovp(cp); if (!vp) { pairfree(&head); cf_log_err(ci, "ERROR: %s", fr_strerror()); return NULL; } if ((vp->operator != T_OP_EQ) && (vp->operator != T_OP_CMP_EQ) && (vp->operator != T_OP_ADD) && (vp->operator != T_OP_SUB) && (vp->operator != T_OP_LE) && (vp->operator != T_OP_GE) && (vp->operator != T_OP_CMP_FALSE) && (vp->operator != T_OP_SET)) { pairfree(&head); pairfree(&vp); cf_log_err(ci, "Invalid operator for attribute"); return NULL; } /* * A few more sanity checks. The enforcement of * <= or >= can only happen for integer * attributes. */ if ((vp->operator == T_OP_LE) || (vp->operator == T_OP_GE)) { if ((vp->type != PW_TYPE_BYTE) && (vp->type != PW_TYPE_SHORT) && (vp->type != PW_TYPE_INTEGER)) { pairfree(&head); pairfree(&vp); cf_log_err(ci, "Enforcment of <= or >= is possible only for integer attributes"); return NULL; } } *tail = vp; tail = &(vp->next); } if (!head) { cf_log_err(cf_sectiontoitem(cs), "ERROR: update %s section cannot be empty", name2); return NULL; } g = rad_malloc(sizeof(*g)); /* never fails */ memset(g, 0, sizeof(*g)); csingle = mod_grouptocallable(g); csingle->parent = parent; csingle->next = NULL; csingle->name = name2; csingle->type = MOD_UPDATE; csingle->method = component; memcpy(csingle->actions, defaultactions[component][GROUPTYPE_SIMPLE], sizeof(csingle->actions)); g->grouptype = GROUPTYPE_SIMPLE; g->children = NULL; g->cs = cs; g->vps = head; return csingle; } static modcallable *do_compile_modswitch(modcallable *parent, int component, CONF_SECTION *cs) { modcallable *csingle; CONF_ITEM *ci; int had_seen_default = FALSE; component = component; /* -Wunused */ if (!cf_section_name2(cs)) { cf_log_err(cf_sectiontoitem(cs), "You must specify a variable to switch over for 'switch'."); return NULL; } if (!cf_item_find_next(cs, NULL)) { cf_log_err(cf_sectiontoitem(cs), "'switch' statments cannot be empty."); return NULL; } /* * Walk through the children of the switch section, * ensuring that they're all 'case' statements */ for (ci=cf_item_find_next(cs, NULL); ci != NULL; ci=cf_item_find_next(cs, ci)) { CONF_SECTION *subcs; const char *name1, *name2; if (!cf_item_is_section(ci)) { if (!cf_item_is_pair(ci)) continue; cf_log_err(ci, "\"switch\" sections can only have \"case\" subsections"); return NULL; } subcs = cf_itemtosection(ci); /* can't return NULL */ name1 = cf_section_name1(subcs); if (strcmp(name1, "case") != 0) { cf_log_err(ci, "\"switch\" sections can only have \"case\" subsections"); return NULL; } name2 = cf_section_name2(subcs); if (!name2 && !had_seen_default) { had_seen_default = TRUE; continue; } if (!name2 || (name2[0] == '\0')) { cf_log_err(ci, "\"case\" sections must have a name"); return NULL; } } csingle= do_compile_modgroup(parent, component, cs, GROUPTYPE_SIMPLE, GROUPTYPE_SIMPLE); if (!csingle) return NULL; csingle->type = MOD_SWITCH; return csingle; } #endif static modcallable *do_compile_modserver(modcallable *parent, int component, CONF_ITEM *ci, const char *name, CONF_SECTION *cs, const char *server) { modcallable *csingle; CONF_SECTION *subcs; modref *mr; subcs = cf_section_sub_find_name2(cs, comp2str[component], NULL); if (!subcs) { cf_log_err(ci, "Server %s has no %s section", server, comp2str[component]); return NULL; } mr = rad_malloc(sizeof(*mr)); memset(mr, 0, sizeof(*mr)); csingle = mod_reftocallable(mr); csingle->parent = parent; csingle->next = NULL; csingle->name = name; csingle->type = MOD_REFERENCE; csingle->method = component; memcpy(csingle->actions, defaultactions[component][GROUPTYPE_SIMPLE], sizeof(csingle->actions)); mr->ref_name = strdup(server); mr->ref_cs = cs; return csingle; } static modcallable *do_compile_modxlat(modcallable *parent, int component, const char *fmt) { modcallable *csingle; modxlat *mx; mx = rad_malloc(sizeof(*mx)); memset(mx, 0, sizeof(*mx)); csingle = mod_xlattocallable(mx); csingle->parent = parent; csingle->next = NULL; csingle->name = "expand"; csingle->type = MOD_XLAT; csingle->method = component; memcpy(csingle->actions, defaultactions[component][GROUPTYPE_SIMPLE], sizeof(csingle->actions)); mx->xlat_name = strdup(fmt); if (fmt[0] != '%') { char *p; mx->exec = TRUE; strcpy(mx->xlat_name, fmt + 1); p = strrchr(mx->xlat_name, '`'); if (p) *p = '\0'; } return csingle; } /* * redundant, etc. can refer to modules or groups, but not much else. */ static int all_children_are_modules(CONF_SECTION *cs, const char *name) { CONF_ITEM *ci; for (ci=cf_item_find_next(cs, NULL); ci != NULL; ci=cf_item_find_next(cs, ci)) { /* * If we're a redundant, etc. group, then the * intention is to call modules, rather than * processing logic. These checks aren't * *strictly* necessary, but they keep the users * from doing crazy things. */ if (cf_item_is_section(ci)) { CONF_SECTION *subcs = cf_itemtosection(ci); const char *name1 = cf_section_name1(subcs); if ((strcmp(name1, "if") == 0) || (strcmp(name1, "else") == 0) || (strcmp(name1, "elsif") == 0) || (strcmp(name1, "update") == 0) || (strcmp(name1, "switch") == 0) || (strcmp(name1, "case") == 0)) { cf_log_err(ci, "%s sections cannot contain a \"%s\" statement", name, name1); return 0; } continue; } if (cf_item_is_pair(ci)) { CONF_PAIR *cp = cf_itemtopair(ci); if (cf_pair_value(cp) != NULL) { cf_log_err(ci, "Entry with no value is invalid"); return 0; } } } return 1; } /* * Compile one entry of a module call. */ static modcallable *do_compile_modsingle(modcallable *parent, int component, CONF_ITEM *ci, int grouptype, const char **modname) { #ifdef WITH_UNLANG int result; #endif const char *modrefname; modsingle *single; modcallable *csingle; module_instance_t *this; CONF_SECTION *cs, *subcs, *modules; if (cf_item_is_section(ci)) { const char *name2; cs = cf_itemtosection(ci); modrefname = cf_section_name1(cs); name2 = cf_section_name2(cs); if (!name2) name2 = "_UnNamedGroup"; /* * group{}, redundant{}, or append{} may appear * where a single module instance was expected. * In that case, we hand it off to * compile_modgroup */ if (strcmp(modrefname, "group") == 0) { *modname = name2; return do_compile_modgroup(parent, component, cs, GROUPTYPE_SIMPLE, grouptype); } else if (strcmp(modrefname, "redundant") == 0) { *modname = name2; if (!all_children_are_modules(cs, modrefname)) { return NULL; } return do_compile_modgroup(parent, component, cs, GROUPTYPE_REDUNDANT, grouptype); } else if (strcmp(modrefname, "append") == 0) { *modname = name2; return do_compile_modgroup(parent, component, cs, GROUPTYPE_APPEND, grouptype); } else if (strcmp(modrefname, "load-balance") == 0) { *modname = name2; if (!all_children_are_modules(cs, modrefname)) { return NULL; } csingle= do_compile_modgroup(parent, component, cs, GROUPTYPE_SIMPLE, grouptype); if (!csingle) return NULL; csingle->type = MOD_LOAD_BALANCE; return csingle; } else if (strcmp(modrefname, "redundant-load-balance") == 0) { *modname = name2; if (!all_children_are_modules(cs, modrefname)) { return NULL; } csingle= do_compile_modgroup(parent, component, cs, GROUPTYPE_REDUNDANT, grouptype); if (!csingle) return NULL; csingle->type = MOD_REDUNDANT_LOAD_BALANCE; return csingle; #ifdef WITH_UNLANG } else if (strcmp(modrefname, "if") == 0) { if (!cf_section_name2(cs)) { cf_log_err(ci, "'if' without condition."); return NULL; } *modname = name2; csingle= do_compile_modgroup(parent, component, cs, GROUPTYPE_SIMPLE, grouptype); if (!csingle) return NULL; csingle->type = MOD_IF; if (!radius_evaluate_condition(NULL, 0, 0, modname, FALSE, &result)) { modcallable_free(&csingle); return NULL; } *modname = name2; return csingle; } else if (strcmp(modrefname, "elsif") == 0) { if (parent && ((parent->type == MOD_LOAD_BALANCE) || (parent->type == MOD_REDUNDANT_LOAD_BALANCE))) { cf_log_err(ci, "'elsif' cannot be used in this section."); return NULL; } if (!cf_section_name2(cs)) { cf_log_err(ci, "'elsif' without condition."); return NULL; } *modname = name2; csingle= do_compile_modgroup(parent, component, cs, GROUPTYPE_SIMPLE, grouptype); if (!csingle) return NULL; csingle->type = MOD_ELSIF; if (!radius_evaluate_condition(NULL, 0, 0, modname, FALSE, &result)) { modcallable_free(&csingle); return NULL; } *modname = name2; return csingle; } else if (strcmp(modrefname, "else") == 0) { if (parent && ((parent->type == MOD_LOAD_BALANCE) || (parent->type == MOD_REDUNDANT_LOAD_BALANCE))) { cf_log_err(ci, "'else' cannot be used in this section section."); return NULL; } if (cf_section_name2(cs)) { cf_log_err(ci, "Cannot have conditions on 'else'."); return NULL; } *modname = name2; csingle= do_compile_modgroup(parent, component, cs, GROUPTYPE_SIMPLE, grouptype); if (!csingle) return NULL; csingle->type = MOD_ELSE; return csingle; } else if (strcmp(modrefname, "update") == 0) { *modname = name2; csingle = do_compile_modupdate(parent, component, cs, name2); if (!csingle) return NULL; return csingle; } else if (strcmp(modrefname, "switch") == 0) { *modname = name2; csingle = do_compile_modswitch(parent, component, cs); if (!csingle) return NULL; return csingle; } else if (strcmp(modrefname, "case") == 0) { int i; *modname = name2; /* * FIXME: How to tell that the parent can only * be a "switch" statement? */ if (!parent) { cf_log_err(ci, "\"case\" statements may only appear within a \"switch\" section"); return NULL; } csingle= do_compile_modgroup(parent, component, cs, GROUPTYPE_SIMPLE, grouptype); if (!csingle) return NULL; csingle->type = MOD_CASE; csingle->name = cf_section_name2(cs); /* may be NULL */ /* * Set all of it's codes to return, so that * when we pick a 'case' statement, we don't * fall through to processing the next one. */ for (i = 0; i < RLM_MODULE_NUMCODES; i++) { csingle->actions[i] = MOD_ACTION_RETURN; } return csingle; #endif } /* else it's something like sql { fail = 1 ...} */ } else if (!cf_item_is_pair(ci)) { /* CONF_DATA or some such */ return NULL; /* * Else it's a module reference, with updated return * codes. */ } else { CONF_SECTION *loop; CONF_PAIR *cp = cf_itemtopair(ci); modrefname = cf_pair_attr(cp); /* * Actions (ok = 1), etc. are orthoganal to just * about everything else. */ if (cf_pair_value(cp) != NULL) { cf_log_err(ci, "Entry is not a reference to a module"); return NULL; } if (((modrefname[0] == '%') && (modrefname[1] == '{')) || (modrefname[0] == '`')) { return do_compile_modxlat(parent, component, modrefname); } /* * See if the module is a virtual one. If so, * return that, rather than doing anything here. */ subcs = NULL; cs = cf_section_find("instantiate"); if (cs) subcs = cf_section_sub_find_name2(cs, NULL, modrefname); if (!subcs && (cs = cf_section_find("policy")) != NULL) { char buffer[256]; snprintf(buffer, sizeof(buffer), "%s.%s", modrefname, comp2str[component]); /* * Prefer name.section, then name. */ subcs = cf_section_sub_find_name2(cs, NULL, buffer); if (!subcs) { subcs = cf_section_sub_find_name2(cs, NULL, modrefname); } } /* * Allow policies to over-ride module names. * i.e. the "sql" policy can do some extra things, * and then call the "sql" module. */ for (loop = cf_item_parent(ci); loop && subcs; loop = cf_item_parent(cf_sectiontoitem(loop))) { if (loop == subcs) { subcs = NULL; } } if (subcs) { DEBUG2(" Module: Loading virtual module %s", modrefname); /* * redundant foo {} is a single. */ if (cf_section_name2(subcs)) { return do_compile_modsingle(parent, component, cf_sectiontoitem(subcs), grouptype, modname); } else { /* * foo {} is a group. */ return do_compile_modgroup(parent, component, subcs, GROUPTYPE_SIMPLE, grouptype); } } } /* * Not a virtual module. It must be a real module. */ modules = cf_section_find("modules"); this = NULL; if (modules && cf_section_sub_find_name2(modules, NULL, modrefname)) { this = find_module_instance(modules, modrefname, 1); } if (!this) do { int i; char *p; /* * Maybe it's module.method */ p = strrchr(modrefname, '.'); if (p) for (i = RLM_COMPONENT_AUTH; i < RLM_COMPONENT_COUNT; i++) { if (strcmp(p + 1, comp2str[i]) == 0) { char buffer[256]; strlcpy(buffer, modrefname, sizeof(buffer)); buffer[p - modrefname] = '\0'; component = i; this = find_module_instance(cf_section_find("modules"), buffer, 1); if (this && !this->entry->module->methods[i]) { *modname = NULL; cf_log_err(ci, "Module %s has no such method %s", buffer, comp2str[i]); return NULL; } break; } } if (this) break; if (strncmp(modrefname, "server[", 7) == 0) { char buffer[256]; strlcpy(buffer, modrefname + 7, sizeof(buffer)); p = strrchr(buffer, ']'); if (!p || p[1] != '\0' || (p == buffer)) { cf_log_err(ci, "Invalid server reference in \"%s\".", modrefname); return NULL; } *p = '\0'; cs = cf_section_sub_find_name2(NULL, "server", buffer); if (!cs) { cf_log_err(ci, "No such server \"%s\".", buffer); return NULL; } return do_compile_modserver(parent, component, ci, modrefname, cs, buffer); } *modname = NULL; cf_log_err(ci, "Failed to find \"%s\" in the \"modules\" section.", modrefname); return NULL; } while (0); /* * We know it's all OK, allocate the structures, and fill * them in. */ single = rad_malloc(sizeof(*single)); memset(single, 0, sizeof(*single)); csingle = mod_singletocallable(single); csingle->parent = parent; csingle->next = NULL; if (!parent || (component != RLM_COMPONENT_AUTH)) { memcpy(csingle->actions, defaultactions[component][grouptype], sizeof csingle->actions); } else { /* inside Auth-Type has different rules */ memcpy(csingle->actions, defaultactions[RLM_COMPONENT_AUTZ][grouptype], sizeof csingle->actions); } rad_assert(modrefname != NULL); csingle->name = modrefname; csingle->type = MOD_SINGLE; csingle->method = component; /* * Singles can override the actions, virtual modules cannot. * * FIXME: We may want to re-visit how to do this... * maybe a csingle as a ref? */ if (cf_item_is_section(ci)) { CONF_ITEM *csi; cs = cf_itemtosection(ci); for (csi=cf_item_find_next(cs, NULL); csi != NULL; csi=cf_item_find_next(cs, csi)) { if (cf_item_is_section(csi)) { cf_log_err(csi, "Subsection of module instance call not allowed"); modcallable_free(&csingle); return NULL; } if (!cf_item_is_pair(csi)) continue; if (!compile_action(csingle, cf_itemtopair(csi))) { modcallable_free(&csingle); return NULL; } } } /* * Bail out if the module in question does not supply the * wanted component */ if (!this->entry->module->methods[component]) { cf_log_err(ci, "\"%s\" modules aren't allowed in '%s' sections -- they have no such method.", this->entry->module->name, comp2str[component]); modcallable_free(&csingle); return NULL; } single->modinst = this; *modname = this->entry->module->name; return csingle; } modcallable *compile_modsingle(modcallable *parent, int component, CONF_ITEM *ci, const char **modname) { modcallable *ret = do_compile_modsingle(parent, component, ci, GROUPTYPE_SIMPLE, modname); dump_tree(component, ret); return ret; } /* * Internal compile group code. */ static modcallable *do_compile_modgroup(modcallable *parent, int component, CONF_SECTION *cs, int grouptype, int parentgrouptype) { int i; modgroup *g; modcallable *c; CONF_ITEM *ci; g = rad_malloc(sizeof(*g)); memset(g, 0, sizeof(*g)); g->grouptype = grouptype; c = mod_grouptocallable(g); c->parent = parent; c->type = MOD_GROUP; c->next = NULL; memset(c->actions, 0, sizeof(c->actions)); /* * Remember the name for printing, etc. * * FIXME: We may also want to put the names into a * rbtree, so that groups can reference each other... */ c->name = cf_section_name2(cs); if (!c->name) { c->name = cf_section_name1(cs); if (strcmp(c->name, "group") == 0) { c->name = ""; } else { c->type = MOD_POLICY; } } g->children = NULL; /* * Loop over the children of this group. */ for (ci=cf_item_find_next(cs, NULL); ci != NULL; ci=cf_item_find_next(cs, ci)) { /* * Sections are references to other groups, or * to modules with updated return codes. */ if (cf_item_is_section(ci)) { const char *junk = NULL; modcallable *single; CONF_SECTION *subcs = cf_itemtosection(ci); single = do_compile_modsingle(c, component, ci, grouptype, &junk); if (!single) { cf_log_err(ci, "Failed to parse \"%s\" subsection.", cf_section_name1(subcs)); modcallable_free(&c); return NULL; } add_child(g, single); } else if (!cf_item_is_pair(ci)) { /* CONF_DATA */ continue; } else { const char *attr, *value; CONF_PAIR *cp = cf_itemtopair(ci); attr = cf_pair_attr(cp); value = cf_pair_value(cp); /* * A CONF_PAIR is either a module * instance with no actions * specified ... */ if (!value) { modcallable *single; const char *junk = NULL; single = do_compile_modsingle(c, component, ci, grouptype, &junk); if (!single) { cf_log_err(ci, "Failed to parse \"%s\" entry.", attr); modcallable_free(&c); return NULL; } add_child(g, single); /* * Or a module instance with action. */ } else if (!compile_action(c, cp)) { modcallable_free(&c); return NULL; } /* else it worked */ } } /* * Set the default actions, if they haven't already been * set. */ for (i = 0; i < RLM_MODULE_NUMCODES; i++) { if (!c->actions[i]) { if (!parent || (component != RLM_COMPONENT_AUTH)) { c->actions[i] = defaultactions[component][parentgrouptype][i]; } else { /* inside Auth-Type has different rules */ c->actions[i] = defaultactions[RLM_COMPONENT_AUTZ][parentgrouptype][i]; } } } /* * FIXME: If there are no children, return NULL? */ return mod_grouptocallable(g); } modcallable *compile_modgroup(modcallable *parent, int component, CONF_SECTION *cs) { modcallable *ret = do_compile_modgroup(parent, component, cs, GROUPTYPE_SIMPLE, GROUPTYPE_SIMPLE); dump_tree(component, ret); return ret; } void add_to_modcallable(modcallable **parent, modcallable *this, int component, const char *name) { modgroup *g; rad_assert(this != NULL); if (*parent == NULL) { modcallable *c; g = rad_malloc(sizeof *g); memset(g, 0, sizeof(*g)); g->grouptype = GROUPTYPE_SIMPLE; c = mod_grouptocallable(g); c->next = NULL; memcpy(c->actions, defaultactions[component][GROUPTYPE_SIMPLE], sizeof(c->actions)); rad_assert(name != NULL); c->name = name; c->type = MOD_GROUP; c->method = component; g->children = NULL; *parent = mod_grouptocallable(g); } else { g = mod_callabletogroup(*parent); } add_child(g, this); } void modcallable_free(modcallable **pc) { modcallable *c, *loop, *next; if (!pc || !*pc) return; c = *pc; if ((c->type > MOD_SINGLE) && (c->type <= MOD_POLICY)) { modgroup *g = mod_callabletogroup(c); if (g->children) for (loop = g->children; loop ; loop = next) { next = loop->next; modcallable_free(&loop); } pairfree(&g->vps); } free(c); *pc = NULL; } freeradius-server/src/main/modules.c000066400000000000000000001123131257552170400200530ustar00rootroot00000000000000/* * modules.c Radius module support. * * Version: $Id$ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2003,2006 The FreeRADIUS server project * Copyright 2000 Alan DeKok * Copyright 2000 Alan Curry */ #include RCSID("$Id$") #include #include #include #include extern int check_config; typedef struct indexed_modcallable { int comp; int idx; modcallable *modulelist; } indexed_modcallable; typedef struct virtual_server_t { const char *name; time_t created; int can_free; CONF_SECTION *cs; rbtree_t *components; modcallable *mc[RLM_COMPONENT_COUNT]; CONF_SECTION *subcs[RLM_COMPONENT_COUNT]; struct virtual_server_t *next; } virtual_server_t; /* * Keep a hash of virtual servers, so that we can reload them. */ #define VIRTUAL_SERVER_HASH_SIZE (256) static virtual_server_t *virtual_servers[VIRTUAL_SERVER_HASH_SIZE]; static rbtree_t *module_tree = NULL; static rbtree_t *instance_tree = NULL; struct fr_module_hup_t { module_instance_t *mi; time_t when; void *insthandle; fr_module_hup_t *next; }; typedef struct section_type_value_t { const char *section; const char *typename; int attr; } section_type_value_t; /* * Ordered by component */ static const section_type_value_t section_type_value[RLM_COMPONENT_COUNT] = { { "authenticate", "Auth-Type", PW_AUTH_TYPE }, { "authorize", "Autz-Type", PW_AUTZ_TYPE }, { "preacct", "Pre-Acct-Type", PW_PRE_ACCT_TYPE }, { "accounting", "Acct-Type", PW_ACCT_TYPE }, { "session", "Session-Type", PW_SESSION_TYPE }, { "pre-proxy", "Pre-Proxy-Type", PW_PRE_PROXY_TYPE }, { "post-proxy", "Post-Proxy-Type", PW_POST_PROXY_TYPE }, { "post-auth", "Post-Auth-Type", PW_POST_AUTH_TYPE } #ifdef WITH_COA , { "recv-coa", "Recv-CoA-Type", PW_RECV_COA_TYPE }, { "send-coa", "Send-CoA-Type", PW_SEND_COA_TYPE } #endif }; #ifdef WITHOUT_LIBLTDL #ifdef WITH_DLOPEN #include #ifndef RTLD_NOW #define RTLD_NOW (0) #endif #ifndef RTLD_LOCAL #define RTLD_LOCAL (0) #endif lt_dlhandle lt_dlopenext(const char *name) { char buffer[256]; strlcpy(buffer, name, sizeof(buffer)); /* * FIXME: Make this configurable... */ strlcat(buffer, ".so", sizeof(buffer)); return dlopen(buffer, RTLD_NOW | RTLD_LOCAL); } void *lt_dlsym(lt_dlhandle handle, UNUSED const char *symbol) { return dlsym(handle, symbol); } int lt_dlclose(lt_dlhandle handle) { return dlclose(handle); } const char *lt_dlerror(void) { return dlerror(); } #else /* without dlopen */ typedef struct lt_dlmodule_t { const char *name; void *ref; } lt_dlmodule_t; typedef struct eap_type_t EAP_TYPE; typedef struct rlm_sql_module_t rlm_sql_module_t; /* * FIXME: Write hackery to auto-generate this data. * We only need to do this on systems that don't have dlopen. */ extern module_t rlm_pap; extern module_t rlm_chap; extern module_t rlm_eap; extern module_t rlm_sql; /* and so on ... */ extern EAP_TYPE rlm_eap_md5; extern rlm_sql_module_t rlm_sql_mysql; /* and so on ... */ static const lt_dlmodule_t lt_dlmodules[] = { { "rlm_pap", &rlm_pap }, { "rlm_chap", &rlm_chap }, { "rlm_eap", &rlm_eap }, /* and so on ... */ { "rlm_eap_md5", &rlm_eap_md5 }, /* and so on ... */ { "rlm_sql_mysql", &rlm_sql_mysql }, /* and so on ... */ { NULL, NULL } }; lt_dlhandle lt_dlopenext(const char *name) { int i; for (i = 0; lt_dlmodules[i].name != NULL; i++) { if (strcmp(name, lt_dlmodules[i].name) == 0) { return lt_dlmodules[i].ref; } } return NULL; } void *lt_dlsym(lt_dlhandle handle, UNUSED const char *symbol) { return handle; } int lt_dlclose(lt_dlhandle handle) { return 0; } const char *lt_dlerror(void) { return "Unspecified error"; } #endif /* WITH_DLOPEN */ #else /* WITHOUT_LIBLTDL */ /* * Solve the issues of libraries linking to other libraries * by using a newer libltdl API. */ #ifndef HAVE_LT_DLADVISE_INIT #define fr_dlopenext lt_dlopenext #else static lt_dlhandle fr_dlopenext(const char *filename) { lt_dlhandle handle = 0; lt_dladvise advise; if (!lt_dladvise_init (&advise) && !lt_dladvise_ext (&advise) && !lt_dladvise_global (&advise)) { handle = lt_dlopenadvise (filename, advise); } lt_dladvise_destroy (&advise); return handle; } #endif /* HAVE_LT_DLADVISE_INIT */ #endif /* WITHOUT_LIBLTDL */ static int virtual_server_idx(const char *name) { uint32_t hash; if (!name) return 0; hash = fr_hash_string(name); return hash & (VIRTUAL_SERVER_HASH_SIZE - 1); } static virtual_server_t *virtual_server_find(const char *name) { int rcode; virtual_server_t *server; rcode = virtual_server_idx(name); for (server = virtual_servers[rcode]; server != NULL; server = server->next) { if (!name && !server->name) break; if ((name && server->name) && (strcmp(name, server->name) == 0)) break; } return server; } static void virtual_server_free(virtual_server_t *server) { if (!server) return; if (server->components) rbtree_free(server->components); server->components = NULL; free(server); } void virtual_servers_free(time_t when) { int i; virtual_server_t **last; for (i = 0; i < VIRTUAL_SERVER_HASH_SIZE; i++) { virtual_server_t *server, *next; last = &virtual_servers[i]; for (server = virtual_servers[i]; server != NULL; server = next) { next = server->next; /* * If we delete it, fix the links so that * we don't orphan anything. Also, * delete it if it's old, AND a newer one * was defined. * * Otherwise, the last pointer gets set to * the one we didn't delete. */ if ((when == 0) || ((server->created < when) && server->can_free)) { *last = server->next; virtual_server_free(server); } else { last = &(server->next); } } } } static void indexed_modcallable_free(void *data) { indexed_modcallable *c = data; modcallable_free(&c->modulelist); free(c); } static int indexed_modcallable_cmp(const void *one, const void *two) { const indexed_modcallable *a = one; const indexed_modcallable *b = two; if (a->comp < b->comp) return -1; if (a->comp > b->comp) return +1; return a->idx - b->idx; } /* * Compare two module entries */ static int module_instance_cmp(const void *one, const void *two) { const module_instance_t *a = one; const module_instance_t *b = two; return strcmp(a->name, b->name); } static void module_instance_free_old(CONF_SECTION *cs, module_instance_t *node, time_t when) { fr_module_hup_t *mh, **last; /* * Walk the list, freeing up old instances. */ last = &(node->mh); while (*last) { mh = *last; /* * Free only every 60 seconds. */ if ((when - mh->when) < 60) { last = &(mh->next); continue; } cf_section_parse_free(cs, mh->insthandle); if (node->entry->module->detach) { if ((node->entry->module->detach)(mh->insthandle) < 0) { DEBUG("WARNING: Failed detaching module %s cleanly. Doing forcible shutdown", node->name); } } else { free(mh->insthandle); } *last = mh->next; free(mh); } } /* * Free a module instance. */ static void module_instance_free(void *data) { module_instance_t *this = data; module_instance_free_old(this->cs, this, time(NULL) + 100); cf_section_parse_free(this->cs, this->insthandle); if (this->entry->module->detach) { (this->entry->module->detach)(this->insthandle); } #ifdef HAVE_PTHREAD_H if (this->mutex) { /* * FIXME * The mutex MIGHT be locked... * we'll check for that later, I guess. */ pthread_mutex_destroy(this->mutex); free(this->mutex); } #endif memset(this, 0, sizeof(*this)); free(this); } /* * Compare two module entries */ static int module_entry_cmp(const void *one, const void *two) { const module_entry_t *a = one; const module_entry_t *b = two; return strcmp(a->name, b->name); } /* * Free a module entry. */ static void module_entry_free(void *data) { module_entry_t *this = data; #ifndef NDEBUG /* * Don't dlclose() modules if we're doing memory * debugging. This removes the symbols needed by * valgrind. */ if (!mainconfig.debug_memory) #endif lt_dlclose(this->handle); /* ignore any errors */ memset(this, 0, sizeof(*this)); free(this); } /* * Remove the module lists. */ int detach_modules(void) { rbtree_free(instance_tree); rbtree_free(module_tree); lt_dlexit(); return 0; } /* * Find a module on disk or in memory, and link to it. */ static module_entry_t *linkto_module(const char *module_name, CONF_SECTION *cs) { module_entry_t myentry; module_entry_t *node; lt_dlhandle handle; char module_struct[256]; char *p; const module_t *module; strlcpy(myentry.name, module_name, sizeof(myentry.name)); node = rbtree_finddata(module_tree, &myentry); if (node) return node; /* * Keep the handle around so we can dlclose() it. */ handle = fr_dlopenext(module_name); if (handle == NULL) { cf_log_err(cf_sectiontoitem(cs), "Failed to link to module '%s': %s\n", module_name, lt_dlerror()); return NULL; } /* * Link to the module's rlm_FOO{} module structure. * * The module_name variable has the version number * embedded in it, and we don't want that here. */ strcpy(module_struct, module_name); p = strrchr(module_struct, '-'); if (p) *p = '\0'; DEBUG3(" (Loaded %s, checking if it's valid)", module_name); /* * libltld MAY core here, if the handle it gives us contains * garbage data. */ module = lt_dlsym(handle, module_struct); if (!module) { cf_log_err(cf_sectiontoitem(cs), "Failed linking to %s structure: %s\n", module_name, lt_dlerror()); lt_dlclose(handle); return NULL; } /* * Before doing anything else, check if it's sane. */ if (module->magic != RLM_MODULE_MAGIC_NUMBER) { lt_dlclose(handle); cf_log_err(cf_sectiontoitem(cs), "Invalid version in module '%s'", module_name); return NULL; } /* make room for the module type */ node = rad_malloc(sizeof(*node)); memset(node, 0, sizeof(*node)); strlcpy(node->name, module_name, sizeof(node->name)); node->module = module; node->handle = handle; cf_log_module(cs, "Linked to module %s", module_name); /* * Add the module as "rlm_foo-version" to the configuration * section. */ if (!rbtree_insert(module_tree, node)) { radlog(L_ERR, "Failed to cache module %s", module_name); lt_dlclose(handle); free(node); return NULL; } return node; } /* * Find a module instance. */ module_instance_t *find_module_instance(CONF_SECTION *modules, const char *instname, int do_link) { int check_config_safe = FALSE; CONF_SECTION *cs; const char *name1; module_instance_t *node, myNode; char module_name[256]; if (!modules) return NULL; /* * Module instances are declared in the modules{} block * and referenced later by their name, which is the * name2 from the config section, or name1 if there was * no name2. */ cs = cf_section_sub_find_name2(modules, NULL, instname); if (cs == NULL) { radlog(L_ERR, "ERROR: Cannot find a configuration entry for module \"%s\".\n", instname); return NULL; } /* * If there's already a module instance, return it. */ strlcpy(myNode.name, instname, sizeof(myNode.name)); node = rbtree_finddata(instance_tree, &myNode); if (node) return node; if (!do_link) return NULL; name1 = cf_section_name1(cs); /* * Found the configuration entry. */ node = rad_malloc(sizeof(*node)); memset(node, 0, sizeof(*node)); node->insthandle = NULL; node->cs = cs; /* * Names in the "modules" section aren't prefixed * with "rlm_", so we add it here. */ snprintf(module_name, sizeof(module_name), "rlm_%s", name1); node->entry = linkto_module(module_name, cs); if (!node->entry) { free(node); /* linkto_module logs any errors */ return NULL; } if (check_config && (node->entry->module->instantiate) && (node->entry->module->type & RLM_TYPE_CHECK_CONFIG_SAFE) == 0) { const char *value = NULL; CONF_PAIR *cp; cp = cf_pair_find(cs, "force_check_config"); if (cp) value = cf_pair_value(cp); if (value && (strcmp(value, "yes") == 0)) goto print_inst; cf_log_module(cs, "Skipping instantiation of %s", instname); } else { print_inst: check_config_safe = TRUE; cf_log_module(cs, "Instantiating module \"%s\" from file %s", instname, cf_section_filename(cs)); } /* * Call the module's instantiation routine. */ if ((node->entry->module->instantiate) && (!check_config || check_config_safe) && ((node->entry->module->instantiate)(cs, &node->insthandle) < 0)) { cf_log_err(cf_sectiontoitem(cs), "Instantiation failed for module \"%s\"", instname); free(node); return NULL; } /* * We're done. Fill in the rest of the data structure, * and link it to the module instance list. */ strlcpy(node->name, instname, sizeof(node->name)); #ifdef HAVE_PTHREAD_H /* * If we're threaded, check if the module is thread-safe. * * If it isn't, we create a mutex. */ if ((node->entry->module->type & RLM_TYPE_THREAD_UNSAFE) != 0) { node->mutex = (pthread_mutex_t *) rad_malloc(sizeof(pthread_mutex_t)); /* * Initialize the mutex. */ pthread_mutex_init(node->mutex, NULL); } else { /* * The module is thread-safe. Don't give it a mutex. */ node->mutex = NULL; } #endif rbtree_insert(instance_tree, node); return node; } static indexed_modcallable *lookup_by_index(rbtree_t *components, int comp, int idx) { indexed_modcallable myc; myc.comp = comp; myc.idx = idx; return rbtree_finddata(components, &myc); } /* * Create a new sublist. */ static indexed_modcallable *new_sublist(rbtree_t *components, int comp, int idx) { indexed_modcallable *c; c = lookup_by_index(components, comp, idx); /* It is an error to try to create a sublist that already * exists. It would almost certainly be caused by accidental * duplication in the config file. * * index 0 is the exception, because it is used when we want * to collect _all_ listed modules under a single index by * default, which is currently the case in all components * except authenticate. */ if (c) { if (idx == 0) { return c; } return NULL; } c = rad_malloc(sizeof(*c)); c->modulelist = NULL; c->comp = comp; c->idx = idx; if (!rbtree_insert(components, c)) { free(c); return NULL; } return c; } int indexed_modcall(int comp, int idx, REQUEST *request) { int rcode; modcallable *list = NULL; virtual_server_t *server; /* * Hack to find the correct virtual server. */ server = virtual_server_find(request->server); if (!server) { RDEBUG("No such virtual server \"%s\"", request->server); return RLM_MODULE_FAIL; } if (idx == 0) { list = server->mc[comp]; if (!list) RDEBUG2(" WARNING: Empty %s section. Using default return values.", section_type_value[comp].section); } else { indexed_modcallable *this; this = lookup_by_index(server->components, comp, idx); if (this) { list = this->modulelist; } else { RDEBUG2(" WARNING: Unknown value specified for %s. Cannot perform requested action.", section_type_value[comp].typename); } } if (server->subcs[comp]) { if (idx == 0) { RDEBUG("# Executing section %s from file %s", section_type_value[comp].section, cf_section_filename(server->subcs[comp])); } else { RDEBUG("# Executing group from file %s", cf_section_filename(server->subcs[comp])); } } request->component = section_type_value[comp].section; rcode = modcall(comp, list, request); request->module = ""; request->component = ""; return rcode; } /* * Load a sub-module list, as found inside an Auth-Type foo {} * block */ static int load_subcomponent_section(modcallable *parent, CONF_SECTION *cs, rbtree_t *components, int attr, int comp) { indexed_modcallable *subcomp; modcallable *ml; DICT_VALUE *dval; const char *name2 = cf_section_name2(cs); rad_assert(comp >= RLM_COMPONENT_AUTH); rad_assert(comp < RLM_COMPONENT_COUNT); /* * Sanity check. */ if (!name2) { cf_log_err(cf_sectiontoitem(cs), "No name specified for %s block", section_type_value[comp].typename); return 1; } /* * Compile the group. */ ml = compile_modgroup(parent, comp, cs); if (!ml) { return 0; } /* * We must assign a numeric index to this subcomponent. * It is generated and placed in the dictionary * automatically. If it isn't found, it's a serious * error. */ dval = dict_valbyname(attr, name2); if (!dval) { cf_log_err(cf_sectiontoitem(cs), "%s %s Not previously configured", section_type_value[comp].typename, name2); modcallable_free(&ml); return 0; } subcomp = new_sublist(components, comp, dval->value); if (!subcomp) { modcallable_free(&ml); return 1; } subcomp->modulelist = ml; return 1; /* OK */ } static int define_type(const DICT_ATTR *dattr, const char *name) { uint32_t value; DICT_VALUE *dval; /* * If the value already exists, don't * create it again. */ dval = dict_valbyname(dattr->attr, name); if (dval) return 1; /* * Create a new unique value with a * meaningless number. You can't look at * it from outside of this code, so it * doesn't matter. The only requirement * is that it's unique. */ do { value = fr_rand() & 0x00ffffff; } while (dict_valbyattr(dattr->attr, value)); DEBUG2(" Module: Creating %s = %s", dattr->name, name); if (dict_addvalue(name, dattr->name, value) < 0) { radlog(L_ERR, "%s", fr_strerror()); return 0; } return 1; } static int load_component_section(CONF_SECTION *cs, rbtree_t *components, int comp) { modcallable *this; CONF_ITEM *modref; int idx; indexed_modcallable *subcomp; const char *modname; const char *visiblename; const DICT_ATTR *dattr; /* * Find the attribute used to store VALUEs for this section. */ dattr = dict_attrbyvalue(section_type_value[comp].attr); if (!dattr) { cf_log_err(cf_sectiontoitem(cs), "No such attribute %s", section_type_value[comp].typename); return -1; } /* * Loop over the entries in the named section, loading * the sections this time. */ for (modref = cf_item_find_next(cs, NULL); modref != NULL; modref = cf_item_find_next(cs, modref)) { const char *name1; CONF_PAIR *cp = NULL; CONF_SECTION *scs = NULL; if (cf_item_is_section(modref)) { scs = cf_itemtosection(modref); name1 = cf_section_name1(scs); if (strcmp(name1, section_type_value[comp].typename) == 0) { if (!load_subcomponent_section(NULL, scs, components, dattr->attr, comp)) { return -1; /* FIXME: memleak? */ } continue; } cp = NULL; } else if (cf_item_is_pair(modref)) { cp = cf_itemtopair(modref); } else { continue; /* ignore it */ } /* * Try to compile one entry. */ this = compile_modsingle(NULL, comp, modref, &modname); if (!this) { cf_log_err(cf_sectiontoitem(cs), "Errors parsing %s section.\n", cf_section_name1(cs)); return -1; } /* * Look for Auth-Type foo {}, which are special * cases of named sections, and allowable ONLY * at the top-level. * * i.e. They're not allowed in a "group" or "redundant" * subsection. */ if (comp == RLM_COMPONENT_AUTH) { DICT_VALUE *dval; const char *modrefname = NULL; if (cp) { modrefname = cf_pair_attr(cp); } else { modrefname = cf_section_name2(scs); if (!modrefname) { modcallable_free(&this); cf_log_err(cf_sectiontoitem(cs), "Errors parsing %s sub-section.\n", cf_section_name1(scs)); return -1; } } dval = dict_valbyname(PW_AUTH_TYPE, modrefname); if (!dval) { /* * It's a section, but nothing we * recognize. Die! */ modcallable_free(&this); cf_log_err(cf_sectiontoitem(cs), "Unknown Auth-Type \"%s\" in %s sub-section.", modrefname, section_type_value[comp].section); return -1; } idx = dval->value; } else { /* See the comment in new_sublist() for explanation * of the special index 0 */ idx = 0; } subcomp = new_sublist(components, comp, idx); if (subcomp == NULL) { modcallable_free(&this); continue; } /* If subcomp->modulelist is NULL, add_to_modcallable will * create it */ visiblename = cf_section_name2(cs); if (visiblename == NULL) visiblename = cf_section_name1(cs); add_to_modcallable(&subcomp->modulelist, this, comp, visiblename); } return 0; } static int load_byserver(CONF_SECTION *cs) { int comp, flag; const char *name = cf_section_name2(cs); rbtree_t *components; virtual_server_t *server = NULL; indexed_modcallable *c; if (name) { cf_log_info(cs, "server %s { # from file %s", name, cf_section_filename(cs)); } else { cf_log_info(cs, "server { # from file %s", cf_section_filename(cs)); } cf_log_info(cs, " modules {"); components = rbtree_create(indexed_modcallable_cmp, indexed_modcallable_free, 0); if (!components) { radlog(L_ERR, "Failed to initialize components\n"); goto error; } server = rad_malloc(sizeof(*server)); memset(server, 0, sizeof(*server)); server->name = name; server->created = time(NULL); server->cs = cs; server->components = components; /* * Define types first. */ for (comp = 0; comp < RLM_COMPONENT_COUNT; ++comp) { CONF_SECTION *subcs; CONF_ITEM *modref; DICT_ATTR *dattr; subcs = cf_section_sub_find(cs, section_type_value[comp].section); if (!subcs) continue; if (cf_item_find_next(subcs, NULL) == NULL) continue; /* * Find the attribute used to store VALUEs for this section. */ dattr = dict_attrbyvalue(section_type_value[comp].attr); if (!dattr) { cf_log_err(cf_sectiontoitem(subcs), "No such attribute %s", section_type_value[comp].typename); error: if (debug_flag == 0) { radlog(L_ERR, "Failed to load virtual server %s", (name != NULL) ? name : ""); } virtual_server_free(server); return -1; } /* * Define dynamic types, so that others can reference * them. */ for (modref = cf_item_find_next(subcs, NULL); modref != NULL; modref = cf_item_find_next(subcs, modref)) { const char *name1; CONF_SECTION *subsubcs; /* * Create types for simple references * only when parsing the authenticate * section. */ if ((section_type_value[comp].attr == PW_AUTH_TYPE) && cf_item_is_pair(modref)) { CONF_PAIR *cp = cf_itemtopair(modref); if (!define_type(dattr, cf_pair_attr(cp))) { goto error; } continue; } if (!cf_item_is_section(modref)) continue; subsubcs = cf_itemtosection(modref); name1 = cf_section_name1(subsubcs); if (strcmp(name1, section_type_value[comp].typename) == 0) { if (!define_type(dattr, cf_section_name2(subsubcs))) { goto error; } } } } /* loop over components */ /* * Loop over all of the known components, finding their * configuration section, and loading it. */ flag = 0; for (comp = 0; comp < RLM_COMPONENT_COUNT; ++comp) { CONF_SECTION *subcs; subcs = cf_section_sub_find(cs, section_type_value[comp].section); if (!subcs) continue; if (cf_item_find_next(subcs, NULL) == NULL) continue; cf_log_module(cs, "Checking %s {...} for more modules to load", section_type_value[comp].section); #ifdef WITH_PROXY /* * Skip pre/post-proxy sections if we're not * proxying. */ if (!mainconfig.proxy_requests && ((comp == RLM_COMPONENT_PRE_PROXY) || (comp == RLM_COMPONENT_POST_PROXY))) { continue; } #endif if (load_component_section(subcs, components, comp) < 0) { goto error; } /* * Cache a default, if it exists. Some people * put empty sections for some reason... */ c = lookup_by_index(components, comp, 0); if (c) server->mc[comp] = c->modulelist; server->subcs[comp] = subcs; flag = 1; } /* loop over components */ /* * We haven't loaded any of the normal sections. Maybe we're * supposed to load the vmps section. * * This is a bit of a hack... */ if (!flag) { CONF_SECTION *subcs; subcs = cf_section_sub_find(cs, "vmps"); if (subcs) { cf_log_module(cs, "Checking vmps {...} for more modules to load"); if (load_component_section(subcs, components, RLM_COMPONENT_POST_AUTH) < 0) { goto error; } c = lookup_by_index(components, RLM_COMPONENT_POST_AUTH, 0); if (c) server->mc[RLM_COMPONENT_POST_AUTH] = c->modulelist; flag = 1; } #ifdef WITH_DHCP if (!flag) { const DICT_ATTR *dattr; dattr = dict_attrbyname("DHCP-Message-Type"); /* * Handle each DHCP Message type separately. */ if (dattr) for (subcs = cf_subsection_find_next(cs, NULL, "dhcp"); subcs != NULL; subcs = cf_subsection_find_next(cs, subcs, "dhcp")) { const char *name2 = cf_section_name2(subcs); DEBUG2(" Module: Checking dhcp %s {...} for more modules to load", name2); if (!load_subcomponent_section(NULL, subcs, components, dattr->attr, RLM_COMPONENT_POST_AUTH)) { goto error; /* FIXME: memleak? */ } c = lookup_by_index(components, RLM_COMPONENT_POST_AUTH, 0); if (c) server->mc[RLM_COMPONENT_POST_AUTH] = c->modulelist; flag = 1; } } #endif } cf_log_info(cs, " } # modules"); cf_log_info(cs, "} # server"); if (!flag && name) { DEBUG("WARNING: Server %s is empty, and will do nothing!", name); } if (debug_flag == 0) { radlog(L_INFO, "Loaded virtual server %s", (name != NULL) ? name : ""); } /* * Now that it is OK, insert it into the list. * * This is thread-safe... */ comp = virtual_server_idx(name); server->next = virtual_servers[comp]; virtual_servers[comp] = server; /* * Mark OLDER ones of the same name as being unused. */ server = server->next; while (server) { if ((!name && !server->name) || (name && server->name && (strcmp(server->name, name) == 0))) { server->can_free = TRUE; break; } server = server->next; } return 0; } /* * Load all of the virtual servers. */ int virtual_servers_load(CONF_SECTION *config) { CONF_SECTION *cs; static int first_time = TRUE; DEBUG2("%s: #### Loading Virtual Servers ####", mainconfig.name); /* * If we have "server { ...}", then there SHOULD NOT be * bare "authorize", etc. sections. if there is no such * server, then try to load the old-style sections first. * * In either case, load the "default" virtual server first. * this matches better iwth users expectations. */ cs = cf_section_find_name2(cf_subsection_find_next(config, NULL, "server"), "server", NULL); if (cs) { if (load_byserver(cs) < 0) { return -1; } } else { if (load_byserver(config) < 0) { return -1; } } /* * Load all of the virtual servers. */ for (cs = cf_subsection_find_next(config, NULL, "server"); cs != NULL; cs = cf_subsection_find_next(config, cs, "server")) { const char *name2; virtual_server_t *server; name2 = cf_section_name2(cs); if (!name2) continue; /* handled above */ server = virtual_server_find(name2); if (server && (cf_top_section(server->cs) == config)) { radlog(L_ERR, "Duplicate virtual server \"%s\" in file %s:%d and file %s:%d", server->name, cf_section_filename(server->cs), cf_section_lineno(server->cs), cf_section_filename(cs), cf_section_lineno(cs)); return -1; } if (load_byserver(cs) < 0) { /* * Once we successfully started once, * continue loading the OTHER servers, * even if one fails. */ if (!first_time) continue; return -1; } } /* * If we succeed the first time around, remember that. */ first_time = FALSE; return 0; } int module_hup_module(CONF_SECTION *cs, module_instance_t *node, time_t when) { void *insthandle = NULL; fr_module_hup_t *mh; if (!node || !node->entry->module->instantiate || ((node->entry->module->type & RLM_TYPE_HUP_SAFE) == 0)) { return 1; } cf_log_module(cs, "Trying to reload module \"%s\"", node->name); if ((node->entry->module->instantiate)(cs, &insthandle) < 0) { cf_log_err(cf_sectiontoitem(cs), "HUP failed for module \"%s\". Using old configuration.", node->name); return 0; } radlog(L_INFO, " Module: Reloaded module \"%s\"", node->name); module_instance_free_old(cs, node, when); /* * Save the old instance handle for later deletion. */ mh = rad_malloc(sizeof(*mh)); mh->mi = node; mh->when = when; mh->insthandle = node->insthandle; mh->next = node->mh; node->mh = mh; node->insthandle = insthandle; /* * FIXME: Set a timeout to come back in 60s, so that * we can pro-actively clean up the old instances. */ return 1; } int module_hup(CONF_SECTION *modules) { time_t when; CONF_ITEM *ci; CONF_SECTION *cs; module_instance_t *node; if (!modules) return 0; when = time(NULL); /* * Loop over the modules */ for (ci=cf_item_find_next(modules, NULL); ci != NULL; ci=cf_item_find_next(modules, ci)) { const char *instname; module_instance_t myNode; /* * If it's not a section, ignore it. */ if (!cf_item_is_section(ci)) continue; cs = cf_itemtosection(ci); instname = cf_section_name2(cs); if (!instname) instname = cf_section_name1(cs); strlcpy(myNode.name, instname, sizeof(myNode.name)); node = rbtree_finddata(instance_tree, &myNode); module_hup_module(cs, node, when); } return 1; } /* * Parse the module config sections, and load * and call each module's init() function. * * Libtool makes your life a LOT easier, especially with libltdl. * see: http://www.gnu.org/software/libtool/ */ int setup_modules(int reload, CONF_SECTION *config) { CONF_ITEM *ci, *next; CONF_SECTION *cs, *modules; rad_listen_t *listener; if (reload) return 0; /* * If necessary, initialize libltdl. */ if (!reload) { /* * This line works around a completely * * RIDICULOUS INSANE IDIOTIC * * bug in libltdl on certain systems. The "set * preloaded symbols" macro below ends up * referencing this name, but it isn't defined * anywhere in the libltdl source. As a result, * any program STUPID enough to rely on libltdl * fails to link, because the symbol isn't * defined anywhere. * * It's like libtool and libltdl are some kind * of sick joke. */ #ifdef IE_LIBTOOL_DIE #define lt__PROGRAM__LTX_preloaded_symbols lt_libltdl_LTX_preloaded_symbols #endif /* * Set the default list of preloaded symbols. * This is used to initialize libltdl's list of * preloaded modules. * * i.e. Static modules. */ LTDL_SET_PRELOADED_SYMBOLS(); if (lt_dlinit() != 0) { radlog(L_ERR, "Failed to initialize libraries: %s\n", lt_dlerror()); return -1; } /* * Set the search path to ONLY our library directory. * This prevents the modules from being found from * any location on the disk. */ lt_dlsetsearchpath(radlib_dir); /* * Set up the internal module struct. */ module_tree = rbtree_create(module_entry_cmp, module_entry_free, 0); if (!module_tree) { radlog(L_ERR, "Failed to initialize modules\n"); return -1; } instance_tree = rbtree_create(module_instance_cmp, module_instance_free, 0); if (!instance_tree) { radlog(L_ERR, "Failed to initialize modules\n"); return -1; } } memset(virtual_servers, 0, sizeof(virtual_servers)); /* * Remember where the modules were stored. */ modules = cf_section_sub_find(config, "modules"); if (!modules) { radlog(L_INFO, "WARNING: Cannot find a \"modules\" section in the configuration file!"); } DEBUG2("%s: #### Instantiating modules ####", mainconfig.name); /* * Loop over module definitions, looking for duplicates. * * This is O(N^2) in the number of modules, but most * systems should have less than 100 modules. */ for (ci=cf_item_find_next(modules, NULL); ci != NULL; ci=next) { const char *name1, *name2; CONF_SECTION *subcs, *duplicate; next = cf_item_find_next(modules, ci); if (!cf_item_is_section(ci)) continue; if (!next || !cf_item_is_section(next)) continue; subcs = cf_itemtosection(ci); name1 = cf_section_name1(subcs); name2 = cf_section_name2(subcs); duplicate = cf_section_find_name2(cf_itemtosection(next), name1, name2); if (!duplicate) continue; if (!name2) name2 = ""; radlog(L_ERR, "Duplicate module \"%s %s\", in file %s:%d and file %s:%d", name1, name2, cf_section_filename(subcs), cf_section_lineno(subcs), cf_section_filename(duplicate), cf_section_lineno(duplicate)); return -1; } /* * Look for the 'instantiate' section, which tells us * the instantiation order of the modules, and also allows * us to load modules with no authorize/authenticate/etc. * sections. */ cs = cf_section_sub_find(config, "instantiate"); if (cs != NULL) { CONF_PAIR *cp; module_instance_t *module; const char *name; cf_log_info(cs, " instantiate {"); /* * Loop over the items in the 'instantiate' section. */ for (ci=cf_item_find_next(cs, NULL); ci != NULL; ci=cf_item_find_next(cs, ci)) { /* * Skip sections and "other" stuff. * Sections will be handled later, if * they're referenced at all... */ if (!cf_item_is_pair(ci)) { continue; } cp = cf_itemtopair(ci); name = cf_pair_attr(cp); module = find_module_instance(modules, name, 1); if (!module) { return -1; } } /* loop over items in the subsection */ cf_log_info(cs, " }"); } /* if there's an 'instantiate' section. */ /* * Loop over the listeners, figuring out which sections * to load. */ for (listener = mainconfig.listen; listener != NULL; listener = listener->next) { char buffer[256]; #ifdef WITH_PROXY if (listener->type == RAD_LISTEN_PROXY) continue; #endif cs = cf_section_sub_find_name2(config, "server", listener->server); if (!cs && (listener->server != NULL)) { listener->print(listener, buffer, sizeof(buffer)); radlog(L_ERR, "No server has been defined for %s", buffer); return -1; } } if (virtual_servers_load(config) < 0) return -1; return 0; } /* * Call all authorization modules until one returns * somethings else than RLM_MODULE_OK */ int module_authorize(int autz_type, REQUEST *request) { #ifdef WITH_POST_PROXY_AUTHORIZE /* * We have a proxied packet, and we've been told * to NOT pass proxied packets through 'authorize' * a second time. So stop. */ if ((request->proxy != NULL && mainconfig.post_proxy_authorize == FALSE)) { DEBUG2(" authorize: Skipping authorize in post-proxy stage"); return RLM_MODULE_NOOP; } #endif return indexed_modcall(RLM_COMPONENT_AUTZ, autz_type, request); } /* * Authenticate a user/password with various methods. */ int module_authenticate(int auth_type, REQUEST *request) { return indexed_modcall(RLM_COMPONENT_AUTH, auth_type, request); } #ifdef WITH_ACCOUNTING /* * Do pre-accounting for ALL configured sessions */ int module_preacct(REQUEST *request) { return indexed_modcall(RLM_COMPONENT_PREACCT, 0, request); } /* * Do accounting for ALL configured sessions */ int module_accounting(int acct_type, REQUEST *request) { return indexed_modcall(RLM_COMPONENT_ACCT, acct_type, request); } #endif #ifdef WITH_SESSION_MGMT /* * See if a user is already logged in. * * Returns: 0 == OK, 1 == double logins, 2 == multilink attempt */ int module_checksimul(int sess_type, REQUEST *request, int maxsimul) { int rcode; if(!request->username) return 0; request->simul_count = 0; request->simul_max = maxsimul; request->simul_mpp = 1; rcode = indexed_modcall(RLM_COMPONENT_SESS, sess_type, request); if (rcode != RLM_MODULE_OK) { /* FIXME: Good spot for a *rate-limited* warning to the log */ return 0; } return (request->simul_count < maxsimul) ? 0 : request->simul_mpp; } #endif #ifdef WITH_PROXY /* * Do pre-proxying for ALL configured sessions */ int module_pre_proxy(int type, REQUEST *request) { return indexed_modcall(RLM_COMPONENT_PRE_PROXY, type, request); } /* * Do post-proxying for ALL configured sessions */ int module_post_proxy(int type, REQUEST *request) { return indexed_modcall(RLM_COMPONENT_POST_PROXY, type, request); } #endif /* * Do post-authentication for ALL configured sessions */ int module_post_auth(int postauth_type, REQUEST *request) { return indexed_modcall(RLM_COMPONENT_POST_AUTH, postauth_type, request); } #ifdef WITH_COA int module_recv_coa(int recv_coa_type, REQUEST *request) { return indexed_modcall(RLM_COMPONENT_RECV_COA, recv_coa_type, request); } int module_send_coa(int send_coa_type, REQUEST *request) { return indexed_modcall(RLM_COMPONENT_SEND_COA, send_coa_type, request); } #endif freeradius-server/src/main/radclient.c000066400000000000000000000725631257552170400203640ustar00rootroot00000000000000/* * radclient.c General radius packet debug tool. * * Version: $Id$ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2000,2006 The FreeRADIUS server project * Copyright 2000 Miquel van Smoorenburg * Copyright 2000 Alan DeKok */ #include RCSID("$Id$") #include #include #include #include #ifdef HAVE_GETOPT_H # include #endif #include #include "smbdes.h" #include "mschap.h" static int success = 0; static int retries = 3; static float timeout = 5; static const char *secret = NULL; static int do_output = 1; static int totalapp = 0; static int totaldeny = 0; static int totallost = 0; static int server_port = 0; static int packet_code = 0; static fr_ipaddr_t server_ipaddr; static int resend_count = 1; static int done = 1; static int print_filename = 0; static fr_ipaddr_t client_ipaddr; static int client_port = 0; static int sockfd; static int last_used_id = -1; static rbtree_t *filename_tree = NULL; static fr_packet_list_t *pl = NULL; static int sleep_time = -1; typedef struct radclient_t { struct radclient_t *prev; struct radclient_t *next; const char *filename; int packet_number; /* in the file */ char password[256]; time_t timestamp; RADIUS_PACKET *request; RADIUS_PACKET *reply; int resend; int tries; int done; } radclient_t; static radclient_t *radclient_head = NULL; static radclient_t *radclient_tail = NULL; const char *radclient_version = "radclient version " RADIUSD_VERSION_STRING #ifdef RADIUSD_VERSION_COMMIT " (git #" RADIUSD_VERSION_COMMIT ")" #endif ", built on " __DATE__ " at " __TIME__; static void NEVER_RETURNS usage(void) { fprintf(stderr, "Usage: radclient [options] server[:port] []\n"); fprintf(stderr, " One of auth, acct, status, coa, or disconnect.\n"); fprintf(stderr, " -c count Send each packet 'count' times.\n"); fprintf(stderr, " -d raddb Set dictionary directory.\n"); fprintf(stderr, " -f file Read packets from file, not stdin.\n"); fprintf(stderr, " -F Print the file name, packet number and reply code.\n"); fprintf(stderr, " -h Print usage help information.\n"); fprintf(stderr, " -i id Set request id to 'id'. Values may be 0..255\n"); fprintf(stderr, " -n num Send N requests/s\n"); fprintf(stderr, " -p num Send 'num' packets from a file in parallel.\n"); fprintf(stderr, " -q Do not print anything out.\n"); fprintf(stderr, " -r retries If timeout, retry sending the packet 'retries' times.\n"); fprintf(stderr, " -s Print out summary information of auth results.\n"); fprintf(stderr, " -S file read secret from file, not command line.\n"); fprintf(stderr, " -t timeout Wait 'timeout' seconds before retrying (may be a floating point number).\n"); fprintf(stderr, " -v Show program version information.\n"); fprintf(stderr, " -x Debugging mode.\n"); fprintf(stderr, " -4 Use IPv4 address of server\n"); fprintf(stderr, " -6 Use IPv6 address of server.\n"); exit(1); } /* * Free a radclient struct, which may (or may not) * already be in the list. */ static void radclient_free(radclient_t *radclient) { radclient_t *prev, *next; if (radclient->request) rad_free(&radclient->request); if (radclient->reply) rad_free(&radclient->reply); prev = radclient->prev; next = radclient->next; if (prev) { assert(radclient_head != radclient); prev->next = next; } else if (radclient_head) { assert(radclient_head == radclient); radclient_head = next; } if (next) { assert(radclient_tail != radclient); next->prev = prev; } else if (radclient_tail) { assert(radclient_tail == radclient); radclient_tail = prev; } free(radclient); } static int mschapv1_encode(VALUE_PAIR **request, const char *password) { unsigned int i; VALUE_PAIR *challenge, *response; uint8_t nthash[16]; challenge = paircreate(PW_MSCHAP_CHALLENGE, PW_TYPE_OCTETS); if (!challenge) { fprintf(stderr, "GOT IT %d!\n", __LINE__); return 0; } pairadd(request, challenge); challenge->length = 8; for (i = 0; i < challenge->length; i++) { challenge->vp_octets[i] = fr_rand(); } response = paircreate(PW_MSCHAP_RESPONSE, PW_TYPE_OCTETS); if (!response) { fprintf(stderr, "GOT IT %d!\n", __LINE__); return 0; } pairadd(request, response); response->length = 50; memset(response->vp_octets, 0, response->length); response->vp_octets[1] = 0x01; /* NT hash */ mschap_ntpwdhash(nthash, password); smbdes_mschap(nthash, challenge->vp_octets, response->vp_octets + 26); return 1; } /* * Initialize a radclient data structure and add it to * the global linked list. */ static int radclient_init(const char *filename) { FILE *fp; VALUE_PAIR *vp; radclient_t *radclient; int filedone = 0; int packet_number = 1; assert(filename != NULL); /* * Determine where to read the VP's from. */ if (strcmp(filename, "-") != 0) { fp = fopen(filename, "r"); if (!fp) { fprintf(stderr, "radclient: Error opening %s: %s\n", filename, strerror(errno)); return 0; } } else { fp = stdin; } /* * Loop until the file is done. */ do { /* * Allocate it. */ radclient = malloc(sizeof(*radclient)); if (!radclient) { perror("radclient: X"); if (fp != stdin) fclose(fp); return 0; } memset(radclient, 0, sizeof(*radclient)); radclient->request = rad_alloc(1); if (!radclient->request) { fr_perror("radclient: Y"); free(radclient); if (fp != stdin) fclose(fp); return 0; } radclient->filename = filename; radclient->request->id = -1; /* allocate when sending */ radclient->packet_number = packet_number++; /* * Read the VP's. */ radclient->request->vps = readvp2(fp, &filedone, "radclient:"); if (!radclient->request->vps) { rad_free(&radclient->request); free(radclient); if (fp != stdin) fclose(fp); return 1; } /* * Keep a copy of the the User-Password attribute. */ if ((vp = pairfind(radclient->request->vps, PW_USER_PASSWORD)) != NULL) { strlcpy(radclient->password, vp->vp_strvalue, sizeof(radclient->password)); /* * Otherwise keep a copy of the CHAP-Password attribute. */ } else if ((vp = pairfind(radclient->request->vps, PW_CHAP_PASSWORD)) != NULL) { strlcpy(radclient->password, vp->vp_strvalue, sizeof(radclient->password)); } else if ((vp = pairfind(radclient->request->vps, PW_MSCHAP_PASSWORD)) != NULL) { strlcpy(radclient->password, vp->vp_strvalue, sizeof(radclient->password)); } else { radclient->password[0] = '\0'; } /* * Fix up Digest-Attributes issues */ for (vp = radclient->request->vps; vp != NULL; vp = vp->next) { switch (vp->attribute) { default: break; /* * Allow it to set the packet type in * the attributes read from the file. */ case PW_PACKET_TYPE: radclient->request->code = vp->vp_integer; break; case PW_PACKET_DST_PORT: radclient->request->dst_port = (vp->vp_integer & 0xffff); break; case PW_PACKET_DST_IP_ADDRESS: radclient->request->dst_ipaddr.af = AF_INET; radclient->request->dst_ipaddr.ipaddr.ip4addr.s_addr = vp->vp_ipaddr; break; case PW_PACKET_DST_IPV6_ADDRESS: radclient->request->dst_ipaddr.af = AF_INET6; radclient->request->dst_ipaddr.ipaddr.ip6addr = vp->vp_ipv6addr; break; case PW_PACKET_SRC_PORT: radclient->request->src_port = (vp->vp_integer & 0xffff); break; case PW_PACKET_SRC_IP_ADDRESS: radclient->request->src_ipaddr.af = AF_INET; radclient->request->src_ipaddr.ipaddr.ip4addr.s_addr = vp->vp_ipaddr; break; case PW_PACKET_SRC_IPV6_ADDRESS: radclient->request->src_ipaddr.af = AF_INET6; radclient->request->src_ipaddr.ipaddr.ip6addr = vp->vp_ipv6addr; break; case PW_DIGEST_REALM: case PW_DIGEST_NONCE: case PW_DIGEST_METHOD: case PW_DIGEST_URI: case PW_DIGEST_QOP: case PW_DIGEST_ALGORITHM: case PW_DIGEST_BODY_DIGEST: case PW_DIGEST_CNONCE: case PW_DIGEST_NONCE_COUNT: case PW_DIGEST_USER_NAME: /* overlapping! */ memmove(&vp->vp_octets[2], &vp->vp_octets[0], vp->length); vp->vp_octets[0] = vp->attribute - PW_DIGEST_REALM + 1; vp->length += 2; vp->vp_octets[1] = vp->length; vp->attribute = PW_DIGEST_ATTRIBUTES; break; } } /* loop over the VP's we read in */ /* * Add it to the tail of the list. */ if (!radclient_head) { assert(radclient_tail == NULL); radclient_head = radclient; radclient->prev = NULL; } else { assert(radclient_tail->next == NULL); radclient_tail->next = radclient; radclient->prev = radclient_tail; } radclient_tail = radclient; radclient->next = NULL; } while (!filedone); /* loop until the file is done. */ if (fp != stdin) fclose(fp); /* * And we're done. */ return 1; } /* * Sanity check each argument. */ static int radclient_sane(radclient_t *radclient) { if (radclient->request->dst_port == 0) { radclient->request->dst_port = server_port; } if (radclient->request->dst_ipaddr.af == AF_UNSPEC) { if (server_ipaddr.af == AF_UNSPEC) { fprintf(stderr, "radclient: No server was given, but request %d in file %s did not contain Packet-Dst-IP-Address\n", radclient->packet_number, radclient->filename); return -1; } radclient->request->dst_ipaddr = server_ipaddr; } if (radclient->request->code == 0) { if (packet_code == -1) { fprintf(stderr, "radclient: Request was \"auto\", but request %d in file %s did not contain Packet-Type\n", radclient->packet_number, radclient->filename); return -1; } radclient->request->code = packet_code; } radclient->request->sockfd = -1; return 0; } /* * For request handline. */ static int filename_cmp(const void *one, const void *two) { return strcmp((const char *) one, (const char *) two); } static int filename_walk(void *context, void *data) { const char *filename = data; context = context; /* -Wunused */ /* * Read request(s) from the file. */ if (!radclient_init(filename)) { return -1; /* stop walking */ } return 0; } /* * Deallocate packet ID, etc. */ static void deallocate_id(radclient_t *radclient) { if (!radclient || !radclient->request || (radclient->request->id < 0)) { return; } /* * One more unused RADIUS ID. */ fr_packet_list_id_free(pl, radclient->request); radclient->request->id = -1; /* * If we've already sent a packet, free up the old one, * and ensure that the next packet has a unique * authentication vector. */ if (radclient->request->data) { free(radclient->request->data); radclient->request->data = NULL; } if (radclient->reply) rad_free(&radclient->reply); } static void print_hex(RADIUS_PACKET *packet) { int i; if (!packet->data) return; printf(" Code:\t\t%u\n", packet->data[0]); printf(" Id:\t\t%u\n", packet->data[1]); printf(" Length:\t%u\n", ((packet->data[2] << 8) | (packet->data[3]))); printf(" Vector:\t"); for (i = 4; i < 20; i++) { printf("%02x", packet->data[i]); } printf("\n"); if (packet->data_len > 20) { int total; const uint8_t *ptr; printf(" Data:"); total = packet->data_len - 20; ptr = packet->data + 20; while (total > 0) { int attrlen; printf("\t\t"); if (total < 2) { /* too short */ printf("%02x\n", *ptr); break; } if (ptr[1] > total) { /* too long */ for (i = 0; i < total; i++) { printf("%02x ", ptr[i]); } break; } printf("%02x %02x ", ptr[0], ptr[1]); attrlen = ptr[1] - 2; ptr += 2; total -= 2; for (i = 0; i < attrlen; i++) { if ((i > 0) && ((i & 0x0f) == 0x00)) printf("\t\t\t"); printf("%02x ", ptr[i]); if ((i & 0x0f) == 0x0f) printf("\n"); } if ((attrlen & 0x0f) != 0x00) printf("\n"); ptr += attrlen; total -= attrlen; } } fflush(stdout); } /* * Send one packet. */ static int send_one_packet(radclient_t *radclient) { assert(radclient->done == 0); /* * Remember when we have to wake up, to re-send the * request, of we didn't receive a response. */ if ((sleep_time == -1) || (sleep_time > (int) timeout)) { sleep_time = (int) timeout; } /* * Haven't sent the packet yet. Initialize it. */ if (radclient->request->id == -1) { int i, rcode; assert(radclient->reply == NULL); /* * Didn't find a free packet ID, we're not done, * we don't sleep, and we stop trying to process * this packet. */ retry: radclient->request->src_ipaddr.af = AF_UNSPEC; rcode = fr_packet_list_id_alloc(pl, radclient->request); if (rcode < 0) { int mysockfd; mysockfd = fr_socket(&client_ipaddr, 0); if (!mysockfd) { fprintf(stderr, "radclient: Can't open new socket\n"); exit(1); } if (!fr_packet_list_socket_add(pl, mysockfd)) { fprintf(stderr, "radclient: Can't add new socket\n"); exit(1); } goto retry; } if (rcode == 0) { done = 0; sleep_time = 0; return 0; } assert(radclient->request->id != -1); assert(radclient->request->data == NULL); for (i = 0; i < 4; i++) { ((uint32_t *) radclient->request->vector)[i] = fr_rand(); } /* * Update the password, so it can be encrypted with the * new authentication vector. */ if (radclient->password[0] != '\0') { VALUE_PAIR *vp; if ((vp = pairfind(radclient->request->vps, PW_USER_PASSWORD)) != NULL) { strlcpy(vp->vp_strvalue, radclient->password, sizeof(vp->vp_strvalue)); vp->length = strlen(vp->vp_strvalue); } else if ((vp = pairfind(radclient->request->vps, PW_CHAP_PASSWORD)) != NULL) { /* * FIXME: AND there's no CHAP-Challenge, * AND vp->length != 17 * AND rad_chap_encode() != vp->vp_octets */ strlcpy(vp->vp_strvalue, radclient->password, sizeof(vp->vp_strvalue)); vp->length = strlen(vp->vp_strvalue); rad_chap_encode(radclient->request, vp->vp_octets, radclient->request->id, vp); vp->length = 17; } else if ((vp = pairfind(radclient->request->vps, PW_MSCHAP_PASSWORD)) != NULL) { mschapv1_encode(&radclient->request->vps, radclient->password); } else if (fr_debug_flag) { printf("WARNING: No password in the request\n"); } } radclient->timestamp = time(NULL); radclient->tries = 1; radclient->resend++; /* * Duplicate found. Serious error! */ if (!fr_packet_list_insert(pl, &radclient->request)) { assert(0 == 1); } } else { /* radclient->request->id >= 0 */ time_t now = time(NULL); /* * FIXME: Accounting packets are never retried! * The Acct-Delay-Time attribute is updated to * reflect the delay, and the packet is re-sent * from scratch! */ /* * Not time for a retry, do so. */ if ((now - radclient->timestamp) < timeout) { /* * When we walk over the tree sending * packets, we update the minimum time * required to sleep. */ if ((sleep_time == -1) || (sleep_time > (now - radclient->timestamp))) { sleep_time = now - radclient->timestamp; } return 0; } /* * We're not trying later, maybe the packet is done. */ if (radclient->tries == retries) { assert(radclient->request->id >= 0); /* * Delete the request from the tree of * outstanding requests. */ fr_packet_list_yank(pl, radclient->request); fprintf(stderr, "radclient: no response from server for ID %d socket %d\n", radclient->request->id, radclient->request->sockfd); deallocate_id(radclient); /* * Normally we mark it "done" when we've received * the response, but this is a special case. */ if (radclient->resend == resend_count) { radclient->done = 1; } totallost++; return -1; } /* * We are trying later. */ radclient->timestamp = now; radclient->tries++; } /* * Send the packet. */ if (rad_send(radclient->request, NULL, secret) < 0) { fprintf(stderr, "radclient: Failed to send packet for ID %d: %s\n", radclient->request->id, fr_strerror()); } if (fr_debug_flag > 2) print_hex(radclient->request); return 0; } /* * Receive one packet, maybe. */ static int recv_one_packet(int wait_time) { fd_set set; struct timeval tv; radclient_t *radclient; RADIUS_PACKET *reply, **request_p; volatile int max_fd; /* And wait for reply, timing out as necessary */ FD_ZERO(&set); max_fd = fr_packet_list_fd_set(pl, &set); if (max_fd < 0) exit(1); /* no sockets to listen on! */ if (wait_time <= 0) { tv.tv_sec = 0; } else { tv.tv_sec = wait_time; } tv.tv_usec = 0; /* * No packet was received. */ if (select(max_fd, &set, NULL, NULL, &tv) <= 0) { return 0; } /* * Look for the packet. */ reply = fr_packet_list_recv(pl, &set); if (!reply) { fprintf(stderr, "radclient: received bad packet: %s\n", fr_strerror()); return -1; /* bad packet */ } /* * udpfromto issues. We may have bound to "*", * and we want to find the replies that are sent to * (say) 127.0.0.1. */ reply->dst_ipaddr = client_ipaddr; if (fr_debug_flag > 2) print_hex(reply); request_p = fr_packet_list_find_byreply(pl, reply); if (!request_p) { fprintf(stderr, "radclient: received response to request we did not send. (id=%d socket %d)\n", reply->id, reply->sockfd); rad_free(&reply); return -1; /* got reply to packet we didn't send */ } radclient = fr_packet2myptr(radclient_t, request, request_p); /* * Fails the signature validation: not a real reply. * FIXME: Silently drop it and listen for another packet. */ if (rad_verify(reply, radclient->request, secret) < 0) { fr_perror("rad_verify"); totallost++; goto packet_done; /* shared secret is incorrect */ } fr_packet_list_yank(pl, radclient->request); if (print_filename) printf("%s:%d %d\n", radclient->filename, radclient->packet_number, reply->code); deallocate_id(radclient); radclient->reply = reply; reply = NULL; /* * If this fails, we're out of memory. */ if (rad_decode(radclient->reply, radclient->request, secret) != 0) { fr_perror("rad_decode"); totallost++; goto packet_done; } /* libradius debug already prints out the value pairs for us */ if (!fr_debug_flag && do_output) { printf("Received response ID %d, code %d, length = %d\n", radclient->reply->id, radclient->reply->code, radclient->reply->data_len); vp_printlist(stdout, radclient->reply->vps); } if ((radclient->reply->code == PW_AUTHENTICATION_ACK) || (radclient->reply->code == PW_ACCOUNTING_RESPONSE) || (radclient->reply->code == PW_COA_ACK) || (radclient->reply->code == PW_DISCONNECT_ACK)) { success = 1; /* have a good response */ totalapp++; } else { totaldeny++; } if (radclient->resend == resend_count) { radclient->done = 1; } packet_done: rad_free(&radclient->reply); rad_free(&reply); /* may be NULL */ return 0; } static int getport(const char *name) { struct servent *svp; svp = getservbyname (name, "udp"); if (!svp) { return 0; } return ntohs(svp->s_port); } int main(int argc, char **argv) { char *p; int c; const char *radius_dir = RADDBDIR; char filesecret[256]; FILE *fp; int do_summary = 0; int persec = 0; int parallel = 1; radclient_t *this; int force_af = AF_UNSPEC; fr_debug_flag = 0; filename_tree = rbtree_create(filename_cmp, NULL, 0); if (!filename_tree) { fprintf(stderr, "radclient: Out of memory\n"); exit(1); } while ((c = getopt(argc, argv, "46c:d:f:Fhi:n:p:qr:sS:t:vx")) != EOF) switch(c) { case '4': force_af = AF_INET; break; case '6': force_af = AF_INET6; break; case 'c': if (!isdigit((int) *optarg)) usage(); resend_count = atoi(optarg); break; case 'd': radius_dir = optarg; break; case 'f': rbtree_insert(filename_tree, optarg); break; case 'F': print_filename = 1; break; case 'i': /* currently broken */ if (!isdigit((int) *optarg)) usage(); last_used_id = atoi(optarg); if ((last_used_id < 0) || (last_used_id > 255)) { usage(); } break; case 'n': persec = atoi(optarg); if (persec <= 0) usage(); break; /* * Note that sending MANY requests in * parallel can over-run the kernel * queues, and Linux will happily discard * packets. So even if the server responds, * the client may not see the response. */ case 'p': parallel = atoi(optarg); if (parallel <= 0) usage(); break; case 'q': do_output = 0; fr_log_fp = NULL; /* no output from you, either! */ break; case 'r': if (!isdigit((int) *optarg)) usage(); retries = atoi(optarg); if ((retries == 0) || (retries > 1000)) usage(); break; case 's': do_summary = 1; break; case 'S': fp = fopen(optarg, "r"); if (!fp) { fprintf(stderr, "radclient: Error opening %s: %s\n", optarg, strerror(errno)); exit(1); } if (fgets(filesecret, sizeof(filesecret), fp) == NULL) { fprintf(stderr, "radclient: Error reading %s: %s\n", optarg, strerror(errno)); exit(1); } fclose(fp); /* truncate newline */ p = filesecret + strlen(filesecret) - 1; while ((p >= filesecret) && (*p < ' ')) { *p = '\0'; --p; } if (strlen(filesecret) < 2) { fprintf(stderr, "radclient: Secret in %s is too short\n", optarg); exit(1); } secret = filesecret; break; case 't': if (!isdigit((int) *optarg)) usage(); timeout = atof(optarg); break; case 'v': printf("%s", radclient_version); exit(0); break; case 'x': fr_debug_flag++; fr_log_fp = stdout; break; case 'h': default: usage(); break; } argc -= (optind - 1); argv += (optind - 1); if ((argc < 3) || ((secret == NULL) && (argc < 4))) { usage(); } if (dict_init(radius_dir, RADIUS_DICTIONARY) < 0) { fr_perror("radclient"); return 1; } /* * Resolve hostname. */ if (force_af == AF_UNSPEC) force_af = AF_INET; server_ipaddr.af = force_af; if (strcmp(argv[1], "-") != 0) { const char *hostname = argv[1]; const char *portname = argv[1]; char buffer[256]; if (*argv[1] == '[') { /* IPv6 URL encoded */ p = strchr(argv[1], ']'); if ((size_t) (p - argv[1]) >= sizeof(buffer)) { usage(); } memcpy(buffer, argv[1] + 1, p - argv[1] - 1); buffer[p - argv[1] - 1] = '\0'; hostname = buffer; portname = p + 1; } p = strchr(portname, ':'); if (p && (strchr(p + 1, ':') == NULL)) { *p = '\0'; portname = p + 1; } else { portname = NULL; } if (ip_hton(hostname, force_af, &server_ipaddr) < 0) { fprintf(stderr, "radclient: Failed to find IP address for host %s: %s\n", hostname, strerror(errno)); exit(1); } /* * Strip port from hostname if needed. */ if (portname) server_port = atoi(portname); } /* * See what kind of request we want to send. */ if (strcmp(argv[2], "auth") == 0) { if (server_port == 0) server_port = getport("radius"); if (server_port == 0) server_port = PW_AUTH_UDP_PORT; packet_code = PW_AUTHENTICATION_REQUEST; } else if (strcmp(argv[2], "challenge") == 0) { if (server_port == 0) server_port = getport("radius"); if (server_port == 0) server_port = PW_AUTH_UDP_PORT; packet_code = PW_ACCESS_CHALLENGE; } else if (strcmp(argv[2], "acct") == 0) { if (server_port == 0) server_port = getport("radacct"); if (server_port == 0) server_port = PW_ACCT_UDP_PORT; packet_code = PW_ACCOUNTING_REQUEST; do_summary = 0; } else if (strcmp(argv[2], "status") == 0) { if (server_port == 0) server_port = getport("radius"); if (server_port == 0) server_port = PW_AUTH_UDP_PORT; packet_code = PW_STATUS_SERVER; } else if (strcmp(argv[2], "disconnect") == 0) { if (server_port == 0) server_port = PW_COA_UDP_PORT; packet_code = PW_DISCONNECT_REQUEST; } else if (strcmp(argv[2], "coa") == 0) { if (server_port == 0) server_port = PW_COA_UDP_PORT; packet_code = PW_COA_REQUEST; } else if (strcmp(argv[2], "auto") == 0) { packet_code = -1; } else if (isdigit((int) argv[2][0])) { if (server_port == 0) server_port = getport("radius"); if (server_port == 0) server_port = PW_AUTH_UDP_PORT; packet_code = atoi(argv[2]); } else { usage(); } /* * Add the secret. */ if (argv[3]) secret = argv[3]; /* * If no '-f' is specified, we're reading from stdin. */ if (rbtree_num_elements(filename_tree) == 0) { rbtree_insert(filename_tree, "-"); } /* * Walk over the list of filenames, creating the requests. */ if (rbtree_walk(filename_tree, InOrder, filename_walk, NULL) != 0) { exit(1); } /* * No packets read. Die. */ if (!radclient_head) { fprintf(stderr, "radclient: Nothing to send.\n"); exit(1); } /* * Bind to the first specified IP address and port. * This means we ignore later ones. */ if (radclient_head->request->src_ipaddr.af == AF_UNSPEC) { memset(&client_ipaddr, 0, sizeof(client_ipaddr)); client_ipaddr.af = server_ipaddr.af; client_port = 0; } else { client_ipaddr = radclient_head->request->src_ipaddr; client_port = radclient_head->request->src_port; } sockfd = fr_socket(&client_ipaddr, client_port); if (sockfd < 0) { fprintf(stderr, "radclient: socket: %s\n", fr_strerror()); exit(1); } pl = fr_packet_list_create(1); if (!pl) { fprintf(stderr, "radclient: Out of memory\n"); exit(1); } if (!fr_packet_list_socket_add(pl, sockfd)) { fprintf(stderr, "radclient: Out of memory\n"); exit(1); } /* * Walk over the list of packets, sanity checking * everything. */ for (this = radclient_head; this != NULL; this = this->next) { this->request->src_ipaddr = client_ipaddr; this->request->src_port = client_port; if (radclient_sane(this) != 0) { exit(1); } } /* * Walk over the packets to send, until * we're all done. * * FIXME: This currently busy-loops until it receives * all of the packets. It should really have some sort of * send packet, get time to wait, select for time, etc. * loop. */ do { int n = parallel; radclient_t *next; const char *filename = NULL; done = 1; sleep_time = -1; /* * Walk over the packets, sending them. */ for (this = radclient_head; this != NULL; this = next) { next = this->next; /* * If there's a packet to receive, * receive it, but don't wait for a * packet. */ recv_one_packet(0); /* * This packet is done. Delete it. */ if (this->done) { radclient_free(this); continue; } /* * Packets from multiple '-f' are sent * in parallel. * * Packets from one file are sent in * series, unless '-p' is specified, in * which case N packets from each file * are sent in parallel. */ if (this->filename != filename) { filename = this->filename; n = parallel; } if (n > 0) { n--; /* * Send the current packet. */ send_one_packet(this); /* * Wait a little before sending * the next packet, if told to. */ if (persec) { struct timeval tv; /* * Don't sleep elsewhere. */ sleep_time = 0; if (persec == 1) { tv.tv_sec = 1; tv.tv_usec = 0; } else { tv.tv_sec = 0; tv.tv_usec = 1000000/persec; } /* * Sleep for milliseconds, * portably. * * If we get an error or * a signal, treat it like * a normal timeout. */ select(0, NULL, NULL, NULL, &tv); } /* * If we haven't sent this packet * often enough, we're not done, * and we shouldn't sleep. */ if (this->resend < resend_count) { done = 0; sleep_time = 0; } } else { /* haven't sent this packet, we're not done */ assert(this->done == 0); assert(this->reply == NULL); done = 0; } } /* * Still have outstanding requests. */ if (fr_packet_list_num_elements(pl) > 0) { done = 0; } else { sleep_time = 0; } /* * Nothing to do until we receive a request, so * sleep until then. Once we receive one packet, * we go back, and walk through the whole list again, * sending more packets (if necessary), and updating * the sleep time. */ if (!done && (sleep_time > 0)) { recv_one_packet(sleep_time); } } while (!done); rbtree_free(filename_tree); fr_packet_list_free(pl); while (radclient_head) radclient_free(radclient_head); dict_free(); if (do_summary) { printf("\n\t Total approved auths: %d\n", totalapp); printf("\t Total denied auths: %d\n", totaldeny); printf("\t Total lost auths: %d\n", totallost); } if (success) return 0; return 1; } freeradius-server/src/main/radconf2xml.c000066400000000000000000000061241257552170400206240ustar00rootroot00000000000000/* * radconf2xml.c Converts radiusd.conf to XML. * * Version: $Id$ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2008 The FreeRADIUS server project * Copyright 2008 Alan DeKok */ #include RCSID("$Id$") #include #include #ifdef HAVE_GETOPT_H #include #endif /* * For configuration file stuff. */ const char *radius_dir = RADDBDIR; const char *progname = "radconf2xml"; /* * The rest of this is because the conffile.c, etc. assume * they're running inside of the server. And we don't (yet) * have a "libfreeradius-server", or "libfreeradius-util". */ int debug_flag = 0; struct main_config_t mainconfig; char *request_log_file = NULL; char *debug_log_file = NULL; int radius_xlat(UNUSED char *out, UNUSED int outlen, UNUSED const char *fmt, UNUSED REQUEST *request, UNUSED RADIUS_ESCAPE_STRING func) { return 0; } static int usage(void) { printf("Usage: %s [ -d raddb_dir ] [ -o output_file ] [ -n name ]\n", progname); printf(" -d raddb_dir Configuration files are in \"raddbdir/*\".\n"); printf(" -n name Read raddb/name.conf instead of raddb/radiusd.conf\n"); printf(" -o output_file File where XML output will be written.\n"); exit(1); } int main(int argc, char **argv) { int argval; CONF_SECTION *cs; const char *file = NULL; const char *name = "radiusd"; FILE *fp; char buffer[2048]; if ((progname = strrchr(argv[0], FR_DIR_SEP)) == NULL) progname = argv[0]; else progname++; while ((argval = getopt(argc, argv, "d:ho:n:")) != EOF) { switch(argval) { case 'd': if (file) { fprintf(stderr, "%s: -d and -f cannot be used together.\n", progname); exit(1); } radius_dir = optarg; break; default: case 'h': usage(); break; case 'n': name = optarg; break; case 'o': file = optarg; break; } } snprintf(buffer, sizeof(buffer), "%s/%s.conf", radius_dir, name); cs = cf_file_read(buffer); if (!cs) { fprintf(stderr, "%s: Errors reading or parsing %s\n", progname, buffer); exit(1); } if (!file || (strcmp(file, "-") == 0)) { fp = stdout; file = NULL; } else { fp = fopen(file, "w"); if (!fp) { fprintf(stderr, "%s: Failed openng %s: %s\n", progname, file, strerror(errno)); exit(1); } } if (!cf_section2xml(fp, cs)) { if (file) unlink(file); return 1; } return 0; } freeradius-server/src/main/radiusd.c000066400000000000000000000356651257552170400200540ustar00rootroot00000000000000/* * radiusd.c Main loop of the radius server. * * Version: $Id$ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2000-2004,2006 The FreeRADIUS server project * Copyright 1999,2000 Miquel van Smoorenburg * Copyright 2000 Alan DeKok * Copyright 2000 Alan Curry * Copyright 2000 Jeff Carneal * Copyright 2000 Chad Miller */ #include RCSID("$Id$") #include #include #include #include #include #include #include #ifdef HAVE_GETOPT_H # include #endif #ifdef HAVE_SYS_WAIT_H # include #endif #ifndef WEXITSTATUS # define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8) #endif #ifndef WIFEXITED # define WIFEXITED(stat_val) (((stat_val) & 255) == 0) #endif #ifdef HAVE_OPENSSL_CRYPTO_H #include #endif /* * Global variables. */ const char *progname = NULL; const char *radius_dir = NULL; const char *radacct_dir = NULL; const char *radlog_dir = NULL; const char *radlib_dir = NULL; int log_stripped_names; int debug_flag = 0; int check_config = FALSE; const char *radiusd_version = "FreeRADIUS Version " RADIUSD_VERSION_STRING #ifdef RADIUSD_VERSION_COMMIT " (git #" RADIUSD_VERSION_COMMIT ")" #endif ", for host " HOSTINFO ", built on " __DATE__ " at " __TIME__; pid_t radius_pid; /* * Configuration items. */ /* * Static functions. */ static void usage(int); static void sig_fatal (int); #ifdef SIGHUP static void sig_hup (int); #endif /* * The main guy. */ int main(int argc, char *argv[]) { int rcode; int argval; int spawn_flag = TRUE; int dont_fork = FALSE; int flag = 0; int from_child[2] = {-1, -1}; int devnull; /* * If the server was built with debugging enabled always install * the basic fatal signal handlers. */ #ifndef NDEBUG fr_fault_setup(getenv("PANIC_ACTION"), argv[0]); #endif #ifdef HAVE_SIGACTION struct sigaction act; #endif #ifdef OSFC2 set_auth_parameters(argc,argv); #endif if ((progname = strrchr(argv[0], FR_DIR_SEP)) == NULL) progname = argv[0]; else progname++; #ifdef WIN32 { WSADATA wsaData; if (WSAStartup(MAKEWORD(2, 0), &wsaData)) { fprintf(stderr, "%s: Unable to initialize socket library.\n"); return 1; } } #endif debug_flag = 0; spawn_flag = TRUE; radius_dir = strdup(RADIUS_DIR); /* * Ensure that the configuration is initialized. */ memset(&mainconfig, 0, sizeof(mainconfig)); mainconfig.myip.af = AF_UNSPEC; mainconfig.port = -1; mainconfig.name = "radiusd"; #ifdef HAVE_SIGACTION memset(&act, 0, sizeof(act)); act.sa_flags = 0 ; sigemptyset( &act.sa_mask ) ; #endif /* * Don't put output anywhere until we get told a little * more. */ mainconfig.radlog_dest = RADLOG_NULL; mainconfig.radlog_fd = -1; mainconfig.log_file = NULL; /* Process the options. */ while ((argval = getopt(argc, argv, "Cd:fhi:l:mn:p:stvxX")) != EOF) { switch(argval) { case 'C': check_config = TRUE; spawn_flag = FALSE; dont_fork = TRUE; break; case 'd': if (radius_dir) free(radius_dir); radius_dir = strdup(optarg); break; case 'f': dont_fork = TRUE; break; case 'h': usage(0); break; case 'l': if (strcmp(optarg, "stdout") == 0) { goto do_stdout; } mainconfig.log_file = strdup(optarg); mainconfig.radlog_dest = RADLOG_FILES; mainconfig.radlog_fd = open(mainconfig.log_file, O_WRONLY | O_APPEND | O_CREAT, 0640); if (mainconfig.radlog_fd < 0) { fprintf(stderr, "radiusd: Failed to open log file %s: %s\n", mainconfig.log_file, strerror(errno)); exit(1); } fr_log_fp = fdopen(mainconfig.radlog_fd, "a"); break; case 'i': if (ip_hton(optarg, AF_UNSPEC, &mainconfig.myip) < 0) { fprintf(stderr, "radiusd: Invalid IP Address or hostname \"%s\"\n", optarg); exit(1); } flag |= 1; break; case 'n': mainconfig.name = optarg; break; case 'm': mainconfig.debug_memory = 1; break; case 'p': mainconfig.port = atoi(optarg); if ((mainconfig.port <= 0) || (mainconfig.port >= 65536)) { fprintf(stderr, "radiusd: Invalid port number %s\n", optarg); exit(1); } flag |= 2; break; case 's': /* Single process mode */ spawn_flag = FALSE; dont_fork = TRUE; break; case 't': /* no child threads */ spawn_flag = FALSE; break; case 'v': /* Don't print timestamps */ debug_flag += 2; fr_log_fp = stdout; mainconfig.radlog_dest = RADLOG_STDOUT; mainconfig.radlog_fd = STDOUT_FILENO; version(); exit(0); case 'X': spawn_flag = FALSE; dont_fork = TRUE; debug_flag += 2; mainconfig.log_auth = TRUE; mainconfig.log_auth_badpass = TRUE; mainconfig.log_auth_goodpass = TRUE; do_stdout: fr_log_fp = stdout; mainconfig.radlog_dest = RADLOG_STDOUT; mainconfig.radlog_fd = STDOUT_FILENO; break; case 'x': debug_flag++; break; default: usage(1); break; } } if (flag && (flag != 0x03)) { fprintf(stderr, "radiusd: The options -i and -p cannot be used individually.\n"); exit(1); } if (debug_flag) version(); /* Read the configuration files, BEFORE doing anything else. */ if (read_mainconfig(0) < 0) { exit(1); } #ifdef HAVE_OPENSSL_CRYPTO_H /* * Initialize the OpenSSL library before calling any of its * functions. */ SSL_library_init(); SSL_load_error_strings(); /* * Mismatch between build time OpenSSL and linked SSL, * better to die here than segfault later. */ #ifdef ENABLE_OPENSSL_VERSION_CHECK if (ssl_check_version(mainconfig.allow_vulnerable_openssl) < 0) { exit(1); } #endif #endif /* Load the modules AFTER doing SSL checks */ if (setup_modules(FALSE, mainconfig.config) < 0) { return -1; } /* Set the panic action (if required) */ if (mainconfig.panic_action && #ifndef NDEBUG !getenv("PANIC_ACTION") && #endif (fr_fault_setup(mainconfig.panic_action, argv[0]) < 0)) { exit(EXIT_FAILURE); } #ifndef __MINGW32__ devnull = open("/dev/null", O_RDWR); if (devnull < 0) { radlog(L_ERR|L_CONS, "Failed opening /dev/null: %s\n", strerror(errno)); exit(1); } /* * Disconnect from session */ if (dont_fork == FALSE) { pid_t pid; /* * Really weird things happen if we leave stdin open and call * things like system() later. */ if (dont_fork == 0) { dup2(devnull, STDIN_FILENO); } if (pipe(from_child) != 0) { radlog(L_ERR, "Couldn't open pipe for child status: %s", strerror(errno)); exit(1); } pid = fork(); if (pid < 0) { radlog(L_ERR, "Couldn't fork: %s", strerror(errno)); exit(1); } /* * The parent exits, so the child can run in the background. * * As the child can still encounter an error during initialisation * we do a blocking read on a pipe between it and the parent. * * Just before entering the event loop the child will */ if (pid > 0) { uint8_t ret = 0; int stat_loc; /* So the pipe is correctly widowed if the child exits */ close(from_child[1]); if ((read(from_child[0], &ret, 1) < 0)) { ret = 0; } /* For cleanliness... */ close(from_child[0]); /* Don't turn children into zombies */ if (!ret) { waitpid(pid, &stat_loc, WNOHANG); exit(1); } exit(0); } /* so the pipe is correctly widowed if the parent exits?! */ close(from_child[0]); #ifdef HAVE_SETSID setsid(); #endif } #endif /* * Ensure that we're using the CORRECT pid after forking, * NOT the one we started with. */ radius_pid = getpid(); /* * STDOUT & STDERR go to /dev/null, unless we have "-x", * then STDOUT & STDERR go to the "-l log" destination. * * The complexity here is because "-l log" can go to * STDOUT or STDERR, too. */ if (mainconfig.radlog_dest == RADLOG_STDOUT) { setlinebuf(stdout); mainconfig.radlog_fd = STDOUT_FILENO; /* * If we're debugging, allow STDERR to go to * STDOUT too, for executed programs, */ if (debug_flag) { dup2(STDOUT_FILENO, STDERR_FILENO); } else { dup2(devnull, STDERR_FILENO); } } else if (mainconfig.radlog_dest == RADLOG_STDERR) { setlinebuf(stderr); mainconfig.radlog_fd = STDERR_FILENO; /* * If we're debugging, allow STDOUT to go to * STDERR too, for executed programs, */ if (debug_flag) { dup2(STDERR_FILENO, STDOUT_FILENO); } else { dup2(devnull, STDOUT_FILENO); } } else if (mainconfig.radlog_dest == RADLOG_SYSLOG) { /* * Discard STDOUT and STDERR no matter what the * status of debugging. Syslog isn't a file * descriptor, so we can't use it. */ dup2(devnull, STDOUT_FILENO); dup2(devnull, STDERR_FILENO); } else if (debug_flag) { /* * If we're debugging, allow STDOUT and STDERR to * go to the log file. */ dup2(mainconfig.radlog_fd, STDOUT_FILENO); dup2(mainconfig.radlog_fd, STDERR_FILENO); } else { /* * Not debugging, and the log isn't STDOUT or * STDERR. Ensure that we move both of them to * /dev/null, so that the calling terminal can * exit, and the output from executed programs * doesn't pollute STDOUT / STDERR. */ dup2(devnull, STDOUT_FILENO); dup2(devnull, STDERR_FILENO); } close(devnull); /* * Now we have logging check that the OpenSSL */ /* * Initialize the event pool, including threads. */ radius_event_init(mainconfig.config, spawn_flag); /* * Now that we've set everything up, we can install the signal * handlers. Before this, if we get any signal, we don't know * what to do, so we might as well do the default, and die. */ #ifdef SIGPIPE signal(SIGPIPE, SIG_IGN); #endif #ifdef HAVE_SIGACTION act.sa_handler = sig_hup; sigaction(SIGHUP, &act, NULL); act.sa_handler = sig_fatal; sigaction(SIGTERM, &act, NULL); #else #ifdef SIGHUP signal(SIGHUP, sig_hup); #endif signal(SIGTERM, sig_fatal); #endif /* * If we're debugging, then a CTRL-C will cause the * server to die immediately. Use SIGTERM to shut down * the server cleanly in that case. */ if ((mainconfig.debug_memory == 1) || (debug_flag == 0)) { #ifdef HAVE_SIGACTION act.sa_handler = sig_fatal; sigaction(SIGINT, &act, NULL); sigaction(SIGQUIT, &act, NULL); #else signal(SIGINT, sig_fatal); #ifdef SIGQUIT signal(SIGQUIT, sig_fatal); #endif #endif } /* * Everything seems to have loaded OK, exit gracefully. */ if (check_config) { DEBUG("Configuration appears to be OK."); exit(0); } radius_stats_init(0); /* * Only write the PID file if we're running as a daemon. * * And write it AFTER we've forked, so that we write the * correct PID. */ if (dont_fork == FALSE) { FILE *fp; fp = fopen(mainconfig.pid_file, "w"); if (fp != NULL) { /* * FIXME: What about following symlinks, * and having it over-write a normal file? */ fprintf(fp, "%d\n", (int) radius_pid); fclose(fp); } else { radlog(L_ERR|L_CONS, "Failed creating PID file %s: %s\n", mainconfig.pid_file, strerror(errno)); exit(1); } /* * Inform parent (who should still be waiting) that * the rest of initialisation went OK, and that it * should exit with a 0 status. */ write(from_child[1], "\001", 1); close(from_child[1]); } /* * Process requests until HUP or exit. */ while ((rcode = radius_event_process()) == 0x80) { radius_stats_init(1); hup_mainconfig(); } if (rcode < 0) { radlog(L_ERR, "Exiting due to internal error: %s", fr_strerror()); rcode = 2; } else { radlog(L_INFO, "Exiting normally."); rcode = 1; } /* * Ignore the TERM signal: we're * about to die. */ signal(SIGTERM, SIG_IGN); /* * Send a TERM signal to all * associated processes * (including us, which gets * ignored.) */ #ifndef __MINGW32__ if (spawn_flag) kill(-radius_pid, SIGTERM); #endif /* * We're exiting, so we can delete the PID * file. (If it doesn't exist, we can ignore * the error returned by unlink) */ if (dont_fork == FALSE) { unlink(mainconfig.pid_file); } radius_event_free(); /* * Detach any modules. */ detach_modules(); xlat_free(); /* modules may have xlat's */ /* * Free the configuration items. */ free_mainconfig(); free(radius_dir); #ifdef WIN32 WSACleanup(); #endif return (rcode - 1); } /* * Display the syntax for starting this program. */ static void NEVER_RETURNS usage(int status) { FILE *output = status?stderr:stdout; fprintf(output, "Usage: %s [-d db_dir] [-l log_dir] [-i address] [-n name] [-fsvXx]\n", progname); fprintf(output, "Options:\n\n"); fprintf(output, " -C Check configuration and exit.\n"); fprintf(output, " -d raddb_dir Configuration files are in \"raddbdir/*\".\n"); fprintf(output, " -f Run as a foreground process, not a daemon.\n"); fprintf(output, " -h Print this help message.\n"); fprintf(output, " -i ipaddr Listen on ipaddr ONLY.\n"); fprintf(output, " -l log_file Logging output will be written to this file.\n"); fprintf(output, " -m On SIGINT or SIGQUIT exit cleanly instead of immediately.\n"); fprintf(output, " -n name Read raddb/name.conf instead of raddb/radiusd.conf\n"); fprintf(output, " -p port Listen on port ONLY.\n"); fprintf(output, " -s Do not spawn child processes to handle requests.\n"); fprintf(output, " -t Disable threads.\n"); fprintf(output, " -v Print server version information.\n"); fprintf(output, " -X Turn on full debugging.\n"); fprintf(output, " -x Turn on additional debugging. (-xx gives more debugging).\n"); exit(status); } /* * We got a fatal signal. */ static void sig_fatal(int sig) { if (getpid() != radius_pid) _exit(sig); switch(sig) { case SIGTERM: radius_signal_self(RADIUS_SIGNAL_SELF_TERM); break; case SIGINT: #ifdef SIGQUIT case SIGQUIT: #endif if (mainconfig.debug_memory) { radius_signal_self(RADIUS_SIGNAL_SELF_TERM); break; } /* FALL-THROUGH */ default: _exit(sig); } } #ifdef SIGHUP /* * We got the hangup signal. * Re-read the configuration files. */ static void sig_hup(int sig) { sig = sig; /* -Wunused */ reset_signal(SIGHUP, sig_hup); radius_signal_self(RADIUS_SIGNAL_SELF_HUP); } #endif freeradius-server/src/main/radlast.in000077500000000000000000000001551257552170400202240ustar00rootroot00000000000000#! /bin/sh prefix=@prefix@ localstatedir=@localstatedir@ logdir=@logdir@ exec last -f $logdir/radwtmp "$@" freeradius-server/src/main/radmin.c000066400000000000000000000315331257552170400176610ustar00rootroot00000000000000/* * radmin.c RADIUS Administration tool. * * Version: $Id$ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2008 The FreeRADIUS server project * Copyright 2008 Alan DeKok */ #include RCSID("$Id$") #include #include #ifdef HAVE_SYS_SOCKET_H #include #endif #ifdef HAVE_SYS_UN_H #include #ifndef SUN_LEN #define SUN_LEN(su) (sizeof(*(su)) - sizeof((su)->sun_path) + strlen((su)->sun_path)) #endif #endif #ifdef HAVE_GETOPT_H #include #endif #ifdef HAVE_SYS_STAT_H #include #endif #ifdef HAVE_LIBREADLINE #if defined(HAVE_READLINE_READLINE_H) #include #define USE_READLINE (1) #elif defined(HAVE_READLINE_H) #include #define USE_READLINE (1) #endif /* !defined(HAVE_READLINE_H) */ #endif /* HAVE_LIBREADLINE */ #ifdef HAVE_READLINE_HISTORY #if defined(HAVE_READLINE_HISTORY_H) #include #define USE_READLINE_HISTORY (1) #elif defined(HAVE_HISTORY_H) #include #define USE_READLINE_HISTORY (1) #endif /* defined(HAVE_READLINE_HISTORY_H) */ #endif /* HAVE_READLINE_HISTORY */ /* * For configuration file stuff. */ const char *radius_dir = RADDBDIR; const char *progname = "radmin"; const char *radmin_version = "radmin version " RADIUSD_VERSION_STRING #ifdef RADIUSD_VERSION_COMMIT " (git #" RADIUSD_VERSION_COMMIT ")" #endif ; /* * The rest of this is because the conffile.c, etc. assume * they're running inside of the server. And we don't (yet) * have a "libfreeradius-server", or "libfreeradius-util". */ int debug_flag = 0; struct main_config_t mainconfig; char *request_log_file = NULL; char *debug_log_file = NULL; int radius_xlat(UNUSED char *out, UNUSED int outlen, UNUSED const char *fmt, UNUSED REQUEST *request, UNUSED RADIUS_ESCAPE_STRING func) { return 0; } static FILE *outputfp = NULL; static int echo = FALSE; static int fr_domain_socket(const char *path) { int sockfd = -1; #ifdef HAVE_SYS_UN_H size_t len; socklen_t socklen; struct sockaddr_un saremote; if (!path) return -1; len = strlen(path); if (len >= sizeof(saremote.sun_path)) { fprintf(stderr, "%s: Path too long in filename\n", progname); return -1; } if ((sockfd = socket(AF_UNIX, SOCK_STREAM, 0)) < 0) { fprintf(stderr, "%s: Failed creating socket: %s\n", progname, strerror(errno)); return -1; } saremote.sun_family = AF_UNIX; memcpy(saremote.sun_path, path, len + 1); /* SUN_LEN does strlen */ socklen = SUN_LEN(&saremote); if (connect(sockfd, (struct sockaddr *)&saremote, socklen) < 0) { struct stat buf; close(sockfd); fprintf(stderr, "%s: Failed connecting to %s: %s\n", progname, path, strerror(errno)); /* * The file doesn't exist. Tell the user how to * fix it. */ if ((stat(path, &buf) < 0) && (errno == ENOENT)) { fprintf(stderr, " Perhaps you need to run the commands:\n\tcd /etc/raddb\n\tln -s sites-available/control-socket sites-enabled/control-socket\n and then re-start the server?\n"); } return -1; } #ifdef O_NONBLOCK { int flags; if ((flags = fcntl(sockfd, F_GETFL, NULL)) < 0) { fprintf(stderr, "%s: Failure getting socket flags: %s", progname, strerror(errno)); close(sockfd); return -1; } flags |= O_NONBLOCK; if( fcntl(sockfd, F_SETFL, flags) < 0) { fprintf(stderr, "%s: Failure setting socket flags: %s", progname, strerror(errno)); close(sockfd); return -1; } } #endif #endif return sockfd; } static int usage(void) { printf("Usage: %s [ args ]\n", progname); printf(" -d raddb_dir Configuration files are in \"raddbdir/*\".\n"); printf(" -e command Execute 'command' and then exit.\n"); printf(" -E Echo commands as they are being executed.\n"); printf(" -f socket_file Open socket_file directly, without reading radius.conf\n"); printf(" -h Print usage help information.\n"); printf(" -i input_file Read commands from 'input_file'.\n"); printf(" -n name Read raddb/name.conf instead of raddb/radiusd.conf\n"); printf(" -o output_file Write commands to 'output_file'.\n"); printf(" -q Quiet mode.\n"); exit(1); } static ssize_t run_command(int sockfd, const char *command, char *buffer, size_t bufsize) { char *p; ssize_t size, len; if (echo) { fprintf(outputfp, "%s\n", command); } /* * Write the text to the socket. */ if (write(sockfd, command, strlen(command)) < 0) return -1; if (write(sockfd, "\r\n", 2) < 0) return -1; /* * Read the response */ size = 0; buffer[0] = '\0'; memset(buffer, 0, bufsize); while (1) { int rcode; fd_set readfds; FD_ZERO(&readfds); FD_SET(sockfd, &readfds); rcode = select(sockfd + 1, &readfds, NULL, NULL, NULL); if (rcode < 0) { if (errno == EINTR) continue; fprintf(stderr, "%s: Failed selecting: %s\n", progname, strerror(errno)); exit(1); } if (rcode == 0) { fprintf(stderr, "%s: Server closed the connection.\n", progname); exit(1); } #ifdef MSG_DONTWAIT len = recv(sockfd, buffer + size, bufsize - size - 1, MSG_DONTWAIT); #else /* * Read one byte at a time (ugh) */ len = recv(sockfd, buffer + size, 1, 0); #endif if (len < 0) { /* * No data: keep looping */ if ((errno == EAGAIN) || (errno == EINTR)) { continue; } fprintf(stderr, "%s: Error reading socket: %s\n", progname, strerror(errno)); exit(1); } if (len == 0) return 0; /* clean exit */ size += len; buffer[size] = '\0'; /* * There really is a better way of doing this. */ p = strstr(buffer, "radmin> "); if (p && ((p == buffer) || (p[-1] == '\n') || (p[-1] == '\r'))) { *p = '\0'; if (p[-1] == '\n') p[-1] = '\0'; break; } } /* * Blank prompt. Go get another command. */ if (!buffer[0]) return 1; buffer[size] = '\0'; /* this is at least right */ return 2; } #define MAX_COMMANDS (4) int main(int argc, char **argv) { int argval, quiet = 0; int done_license = 0; int sockfd; uint32_t magic; char *line = NULL; ssize_t len, size; const char *file = NULL; const char *name = "radiusd"; char *p, buffer[65536]; const char *input_file = NULL; FILE *inputfp = stdin; const char *output_file = NULL; char *commands[MAX_COMMANDS]; int num_commands = -1; outputfp = stdout; /* stdout is not a constant value... */ if ((progname = strrchr(argv[0], FR_DIR_SEP)) == NULL) progname = argv[0]; else progname++; while ((argval = getopt(argc, argv, "d:hi:e:Ef:n:o:q")) != EOF) { switch(argval) { case 'd': if (file) { fprintf(stderr, "%s: -d and -f cannot be used together.\n", progname); exit(1); } radius_dir = optarg; break; case 'e': num_commands++; /* starts at -1 */ if (num_commands >= MAX_COMMANDS) { fprintf(stderr, "%s: Too many '-e'\n", progname); exit(1); } commands[num_commands] = optarg; break; case 'E': echo = TRUE; break; case 'f': radius_dir = NULL; file = optarg; break; default: case 'h': usage(); break; case 'i': if (strcmp(optarg, "-") != 0) { input_file = optarg; } quiet = 1; break; case 'n': name = optarg; break; case 'o': if (strcmp(optarg, "-") != 0) { output_file = optarg; } quiet = 1; break; case 'q': quiet = 1; break; } } if (radius_dir) { int rcode; CONF_SECTION *cs, *subcs; file = NULL; /* MUST read it from the conffile now */ snprintf(buffer, sizeof(buffer), "%s/%s.conf", radius_dir, name); cs = cf_file_read(buffer); if (!cs) { fprintf(stderr, "%s: Errors reading or parsing %s\n", progname, buffer); exit(1); } subcs = NULL; while ((subcs = cf_subsection_find_next(cs, subcs, "listen")) != NULL) { const char *value; CONF_PAIR *cp = cf_pair_find(subcs, "type"); if (!cp) continue; value = cf_pair_value(cp); if (!value) continue; if (strcmp(value, "control") != 0) continue; /* * Now find the socket name (sigh) */ rcode = cf_item_parse(subcs, "socket", PW_TYPE_STRING_PTR, &file, NULL); if (rcode < 0) { fprintf(stderr, "%s: Failed parsing listen section\n", progname); exit(1); } if (!file) { fprintf(stderr, "%s: No path given for socket\n", progname); exit(1); } break; } if (!file) { fprintf(stderr, "%s: Could not find control socket in %s\n", progname, buffer); exit(1); } } if (input_file) { inputfp = fopen(input_file, "r"); if (!inputfp) { fprintf(stderr, "%s: Failed opening %s: %s\n", progname, input_file, strerror(errno)); exit(1); } } if (output_file) { outputfp = fopen(output_file, "w"); if (!outputfp) { fprintf(stderr, "%s: Failed creating %s: %s\n", progname, output_file, strerror(errno)); exit(1); } } /* * Check if stdin is a TTY only if input is from stdin */ if (input_file && !quiet && !isatty(STDIN_FILENO)) quiet = 1; #ifdef USE_READLINE if (!quiet) { #ifdef USE_READLINE_HISTORY using_history(); #endif rl_bind_key('\t', rl_insert); } #endif reconnect: /* * FIXME: Get destination from command line, if possible? */ sockfd = fr_domain_socket(file); if (sockfd < 0) { exit(1); } /* * Read initial magic && version information. */ for (size = 0; size < 8; size += len) { len = read(sockfd, buffer + size, 8 - size); if (len < 0) { fprintf(stderr, "%s: Error reading initial data from socket: %s\n", progname, strerror(errno)); exit(1); } } memcpy(&magic, buffer, 4); magic = ntohl(magic); if (magic != 0xf7eead15) { fprintf(stderr, "%s: Socket %s is not FreeRADIUS administration socket\n", progname, file); exit(1); } memcpy(&magic, buffer + 4, 4); magic = ntohl(magic); if (magic != 1) { fprintf(stderr, "%s: Socket version mismatch: Need 1, got %d\n", progname, magic); exit(1); } /* * Run one command. */ if (num_commands >= 0) { int i; for (i = 0; i <= num_commands; i++) { size = run_command(sockfd, commands[i], buffer, sizeof(buffer)); if (size < 0) exit(1); if (buffer[0]) { fputs(buffer, outputfp); fprintf(outputfp, "\n"); fflush(outputfp); } } exit(0); } if (!done_license && !quiet) { printf("%s - FreeRADIUS Server administration tool.\n", radmin_version); printf("Copyright (C) 2008-2015 The FreeRADIUS server project and contributors.\n"); printf("There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A\n"); printf("PARTICULAR PURPOSE.\n"); printf("You may redistribute copies of FreeRADIUS under the terms of the\n"); printf("GNU General Public License v2.\n"); done_license = 1; } /* * FIXME: Do login? */ while (1) { #ifndef USE_READLINE if (!quiet) { printf("radmin> "); fflush(stdout); } #else if (!quiet) { line = readline("radmin> "); if (!line) break; if (!*line) { free(line); continue; } #ifdef USE_READLINE_HISTORY add_history(line); #endif } else /* quiet, or no readline */ #endif { line = fgets(buffer, sizeof(buffer), inputfp); if (!line) break; p = strchr(buffer, '\n'); if (!p) { fprintf(stderr, "%s: Input line too long\n", progname); exit(1); } *p = '\0'; /* * Strip off leading spaces. */ for (p = line; *p != '\0'; p++) { if ((p[0] == ' ') || (p[0] == '\t')) { line = p + 1; continue; } if (p[0] == '#') { line = NULL; break; } break; } /* * Comments: keep going. */ if (!line) continue; /* * Strip off CR / LF */ for (p = line; *p != '\0'; p++) { if ((p[0] == '\r') || (p[0] == '\n')) { p[0] = '\0'; break; } } } if (strcmp(line, "reconnect") == 0) { close(sockfd); line = NULL; goto reconnect; } /* * Exit, done, etc. */ if ((strcmp(line, "exit") == 0) || (strcmp(line, "quit") == 0)) { break; } size = run_command(sockfd, line, buffer, sizeof(buffer)); if (size <= 0) break; /* error, or clean exit */ if (size == 1) continue; /* no output. */ fputs(buffer, outputfp); fflush(outputfp); fprintf(outputfp, "\n"); } fprintf(outputfp, "\n"); return 0; } freeradius-server/src/main/radsniff.c000066400000000000000000000351071257552170400202040ustar00rootroot00000000000000/* * radsniff.c Display the RADIUS traffic on the network. * * Version: $Id$ * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2006 The FreeRADIUS server project * Copyright 2006 Nicolas Baradakis */ #include RCSID("$Id$") #define _LIBRADIUS 1 #include #include #include #include #include static const char *radius_secret = "testing123"; static VALUE_PAIR *filter_vps = NULL; #undef DEBUG #define DEBUG if (fr_debug_flag) printf static int minimal = 0; static int do_sort = 0; struct timeval start_pcap = {0, 0}; static rbtree_t *filter_tree = NULL; static rbtree_t *request_tree = NULL; static pcap_dumper_t *pcap_dumper = NULL; static RADIUS_PACKET *nullpacket = NULL; typedef int (*rbcmp)(const void *, const void *); static int filter_packet(RADIUS_PACKET *packet) { VALUE_PAIR *check_item; VALUE_PAIR *vp; unsigned int pass, fail; int compare; pass = fail = 0; for (vp = packet->vps; vp != NULL; vp = vp->next) { for (check_item = filter_vps; check_item != NULL; check_item = check_item->next) if ((check_item->attribute == vp->attribute) && (check_item->operator != T_OP_SET)) { compare = paircmp(check_item, vp); if (compare == 1) pass++; else fail++; } } if (fail == 0 && pass != 0) { /* * Cache authentication requests, as the replies * may not match the RADIUS filter. */ if ((packet->code == PW_AUTHENTICATION_REQUEST) || (packet->code == PW_ACCOUNTING_REQUEST)) { rbtree_deletebydata(filter_tree, packet); if (!rbtree_insert(filter_tree, packet)) { oom: fprintf(stderr, "radsniff: Out of memory\n"); exit(1); } } return 0; /* matched */ } /* * Don't create erroneous matches. */ if ((packet->code == PW_AUTHENTICATION_REQUEST) || (packet->code == PW_ACCOUNTING_REQUEST)) { rbtree_deletebydata(filter_tree, packet); return 1; } /* * Else see if a previous Access-Request * matched. If so, also print out the * matching accept, reject, or challenge. */ if ((packet->code == PW_AUTHENTICATION_ACK) || (packet->code == PW_AUTHENTICATION_REJECT) || (packet->code == PW_ACCESS_CHALLENGE) || (packet->code == PW_ACCOUNTING_RESPONSE)) { RADIUS_PACKET *reply; /* * This swaps the various fields. */ reply = rad_alloc_reply(packet); if (!reply) goto oom; compare = 1; if (rbtree_finddata(filter_tree, reply)) { compare = 0; } rad_free(&reply); return compare; } return 1; } /* * Bubble goodness */ static void sort(RADIUS_PACKET *packet) { int i, j, size; VALUE_PAIR *vp, *tmp; VALUE_PAIR *array[1024]; /* way more than necessary */ size = 0; for (vp = packet->vps; vp != NULL; vp = vp->next) { array[size++] = vp; } if (size == 0) return; for (i = 0; i < size - 1; i++) { for (j = 0; j < size - 1 - i; j++) { if (array[j + 1]->attribute < array[j]->attribute) { tmp = array[j]; array[j] = array[j + 1]; array[j + 1] = tmp; } } } /* * And put them back again. */ vp = packet->vps = array[0]; for (i = 1; i < size; i++) { vp->next = array[i]; vp = array[i]; } vp->next = NULL; } #define USEC 1000000 static void tv_sub(const struct timeval *end, const struct timeval *start, struct timeval *elapsed) { elapsed->tv_sec = end->tv_sec - start->tv_sec; if (elapsed->tv_sec > 0) { elapsed->tv_sec--; elapsed->tv_usec = USEC; } else { elapsed->tv_usec = 0; } elapsed->tv_usec += end->tv_usec; elapsed->tv_usec -= start->tv_usec; if (elapsed->tv_usec >= USEC) { elapsed->tv_usec -= USEC; elapsed->tv_sec++; } } static void got_packet(uint8_t *args, const struct pcap_pkthdr *header, const uint8_t *data) { /* Just a counter of how many packets we've had */ static int count = 1; /* Define pointers for packet's attributes */ const struct ethernet_header *ethernet; /* The ethernet header */ const struct ip_header *ip; /* The IP header */ const struct udp_header *udp; /* The UDP header */ const uint8_t *payload; /* Packet payload */ /* And define the size of the structures we're using */ int size_ethernet = sizeof(struct ethernet_header); int size_ip = sizeof(struct ip_header); int size_udp = sizeof(struct udp_header); /* For FreeRADIUS */ RADIUS_PACKET *packet, *original; struct timeval elapsed; args = args; /* -Wunused */ /* Define our packet's attributes */ if ((data[0] == 2) && (data[1] == 0) && (data[2] == 0) && (data[3] == 0)) { ip = (const struct ip_header*) (data + 4); } else { ethernet = (const struct ethernet_header*)(data); ip = (const struct ip_header*)(data + size_ethernet); } udp = (const struct udp_header*)(((const uint8_t *) ip) + size_ip); payload = (const uint8_t *)(((const uint8_t *) udp) + size_udp); packet = malloc(sizeof(*packet)); if (!packet) { fprintf(stderr, "Out of memory\n"); return; } memset(packet, 0, sizeof(*packet)); packet->src_ipaddr.af = AF_INET; packet->src_ipaddr.ipaddr.ip4addr.s_addr = ip->ip_src.s_addr; packet->src_port = ntohs(udp->udp_sport); packet->dst_ipaddr.af = AF_INET; packet->dst_ipaddr.ipaddr.ip4addr.s_addr = ip->ip_dst.s_addr; packet->dst_port = ntohs(udp->udp_dport); packet->data = payload; packet->data_len = header->len - (payload - data); if (!rad_packet_ok(packet, 0)) { printf("Packet: %s\n", fr_strerror()); printf("\tFrom: %s:%d\n", inet_ntoa(ip->ip_src), ntohs(udp->udp_sport)); printf("\tTo: %s:%d\n", inet_ntoa(ip->ip_dst), ntohs(udp->udp_dport)); printf("\tType: %s\n", fr_packet_codes[packet->code]); free(packet); return; } switch (packet->code) { case PW_COA_REQUEST: /* we need a 16 x 0 byte vector for decrypting encrypted VSAs */ original = nullpacket; break; case PW_AUTHENTICATION_ACK: /* look for a matching request and use it for decoding */ original = rbtree_finddata(request_tree, packet); break; case PW_AUTHENTICATION_REQUEST: /* save the request for later matching */ original = rad_alloc_reply(packet); if (original) { /* just ignore allocation failures */ rbtree_deletebydata(request_tree, original); rbtree_insert(request_tree, original); } /* fallthrough */ default: /* don't attempt to decode any encrypted attributes */ original = NULL; } /* * Decode the data without bothering to check the signatures. */ if (rad_decode(packet, original, radius_secret) != 0) { free(packet); fr_perror("decode"); return; } /* we've seen a successfull reply to this, so delete it now */ if (original) rbtree_deletebydata(request_tree, original); if (filter_vps && filter_packet(packet)) { free(packet); DEBUG("Packet number %d doesn't match\n", count++); return; } if (pcap_dumper) { pcap_dump((void *) pcap_dumper, header, data); goto check_filter; } printf("%s Id %d\t", fr_packet_codes[packet->code], packet->id); /* Print the RADIUS packet */ printf("%s:%d -> ", inet_ntoa(ip->ip_src), ntohs(udp->udp_sport)); printf("%s:%d", inet_ntoa(ip->ip_dst), ntohs(udp->udp_dport)); if (fr_debug_flag) printf("\t(%d packets)", count++); if (!start_pcap.tv_sec) { start_pcap = header->ts; } tv_sub(&header->ts, &start_pcap, &elapsed); printf("\t+%u.%03u", (unsigned int) elapsed.tv_sec, (unsigned int) elapsed.tv_usec / 1000); if (!minimal) printf("\n"); if (!minimal && packet->vps) { if (do_sort) sort(packet); vp_printlist(stdout, packet->vps); pairfree(&packet->vps); } printf("\n"); if (fr_debug_flag > 2) rad_print_hex(packet); fflush(stdout); check_filter: /* * If we're doing filtering, Access-Requests are cached * in the filter tree. */ if (!filter_vps || ((packet->code != PW_AUTHENTICATION_REQUEST) && (packet->code != PW_ACCOUNTING_REQUEST))) { free(packet); } } static void NEVER_RETURNS usage(int status) { FILE *output = status ? stderr : stdout; fprintf(output, "usage: radsniff [options]\n"); fprintf(output, "options:\n"); fprintf(output, "\t-c count\tNumber of packets to capture.\n"); fprintf(output, "\t-d directory\tDirectory where the dictionaries are found\n"); fprintf(output, "\t-F\t\tFilter PCAP file from stdin to stdout.\n"); fprintf(output, "\t\t\tOutput file will contain RADIUS packets.\n"); fprintf(output, "\t-f filter\tPCAP filter. (default is udp port 1812 or 1813)\n"); fprintf(output, "\t-h\t\tPrint this help message.\n"); fprintf(output, "\t-i interface\tInterface to capture.\n"); fprintf(output, "\t-I filename\tRead packets from filename.\n"); fprintf(output, "\t-m\t\tPrint packet headers only, not contents.\n"); fprintf(output, "\t-p port\t\tListen for packets on port.\n"); fprintf(output, "\t-r filter\tRADIUS attribute filter.\n"); fprintf(output, "\t-s secret\tRADIUS secret.\n"); fprintf(output, "\t-S\t\tSort attributes in the packet.\n"); fprintf(output, "\t\t\tUsed to compare server results.\n"); fprintf(output, "\t-w file\tWrite output packets to file.\n"); fprintf(output, "\t-x\t\tPrint out debugging information.\n"); exit(status); } int main(int argc, char *argv[]) { char *dev; /* sniffing device */ char errbuf[PCAP_ERRBUF_SIZE]; /* error buffer */ pcap_t *descr; /* sniff handler */ struct bpf_program fp; /* hold compiled program */ bpf_u_int32 maskp; /* subnet mask */ bpf_u_int32 netp; /* ip */ char buffer[1024]; char *pcap_filter = NULL; char *radius_filter = NULL; char *filename = NULL; int printable_output = 1; char *dump_file = NULL; int packet_count = -1; /* how many packets to sniff */ int opt; FR_TOKEN parsecode; const char *radius_dir = RADIUS_DIR; int port = 1812; int filter_stdin = 0; /* Default device */ dev = pcap_lookupdev(errbuf); /* Get options */ while ((opt = getopt(argc, argv, "c:d:Ff:hi:I:mp:r:s:Sw:xX")) != EOF) { switch (opt) { case 'c': packet_count = atoi(optarg); if (packet_count <= 0) { fprintf(stderr, "radsniff: Invalid number of packets \"%s\"\n", optarg); exit(1); } break; case 'd': radius_dir = optarg; break; case 'F': filter_stdin = 1; printable_output = 0; break; case 'f': pcap_filter = optarg; break; case 'h': usage(0); break; case 'i': dev = optarg; break; case 'I': filename = optarg; break; case 'm': minimal = 1; break; case 'p': port = atoi(optarg); break; case 'r': radius_filter = optarg; break; case 's': radius_secret = optarg; break; case 'S': do_sort = 1; break; case 'w': dump_file = optarg; printable_output = 0; break; case 'x': case 'X': /* for backwards compatibility */ fr_debug_flag++; break; default: usage(1); } } /* * Cross-check command-line arguments. */ if (filter_stdin && (filename || dump_file)) usage(1); #ifndef HAVE_PCAP_FOPEN_OFFLINE if (filter_stdin) { fr_perror("-F is unsupported on this platform."); return 1; } #endif if (!pcap_filter) { pcap_filter = buffer; snprintf(buffer, sizeof(buffer), "udp port %d or %d", port, port + 1); } /* * There are times when we don't need the dictionaries. */ if (printable_output) { if (dict_init(radius_dir, RADIUS_DICTIONARY) < 0) { fr_perror("radsniff"); return 1; } } if (radius_filter) { parsecode = userparse(radius_filter, &filter_vps); if (parsecode == T_OP_INVALID) { fprintf(stderr, "radsniff: Invalid RADIUS filter \"%s\": %s\n", radius_filter, fr_strerror()); exit(1); } if (!filter_vps) { fprintf(stderr, "radsniff: Empty RADIUS filter \"%s\"\n", radius_filter); exit(1); } filter_tree = rbtree_create((rbcmp) fr_packet_cmp, free, 0); if (!filter_tree) { fprintf(stderr, "radsniff: Failed creating filter tree\n"); exit(1); } } /* setup the request tree */ request_tree = rbtree_create((rbcmp) fr_packet_cmp, free, 0); if (!request_tree) { fprintf(stderr, "radsniff: Failed creating request tree\n"); exit(1); } /* allocate a null packet for decrypting attributes in CoA requests */ nullpacket = rad_alloc(0); if (!nullpacket) { fprintf(stderr, "radsniff: Out of memory\n"); exit(1); } /* Set our device */ pcap_lookupnet(dev, &netp, &maskp, errbuf); /* Print device to the user */ if (fr_debug_flag) { if (dev) printf("Device: [%s]\n", dev); if (packet_count > 0) { printf("Num of packets: [%d]\n", packet_count); } printf("PCAP filter: [%s]\n", pcap_filter); if (filter_vps) { printf("RADIUS filter:\n"); vp_printlist(stdout, filter_vps); } printf("RADIUS secret: [%s]\n", radius_secret); } /* Open the device so we can spy */ if (filename) { descr = pcap_open_offline(filename, errbuf); #ifdef HAVE_PCAP_FOPEN_OFFLINE } else if (filter_stdin) { descr = pcap_fopen_offline(stdin, errbuf); #endif } else if (!dev) { fprintf(stderr, "radsniff: No filename or device was specified.\n"); exit(1); } else { descr = pcap_open_live(dev, 65536, 1, 1, errbuf); } if (descr == NULL) { fprintf(stderr, "radsniff: pcap_open_live failed (%s)\n", errbuf); exit(1); } if (dump_file) { pcap_dumper = pcap_dump_open(descr, dump_file); if (!pcap_dumper) { fprintf(stderr, "radsniff: Failed opening output file (%s)\n", pcap_geterr(descr)); exit(1); } #ifdef HAVE_PCAP_DUMP_FOPEN } else if (filter_stdin) { pcap_dumper = pcap_dump_fopen(descr, stdout); if (!pcap_dumper) { fprintf(stderr, "radsniff: Failed opening stdout: %s\n", pcap_geterr(descr)); exit(1); } #endif } /* Apply the rules */ if( pcap_compile(descr, &fp, pcap_filter, 0, netp) == -1) { fprintf(stderr, "radsniff: pcap_compile failed\n"); exit(1); } if (pcap_setfilter(descr, &fp) == -1) { fprintf(stderr, "radsniff: pcap_setfilter failed\n"); exit(1); } /* Now we can set our callback function */ pcap_loop(descr, packet_count, got_packet, NULL); pcap_close(descr); if (filter_tree) rbtree_free(filter_tree); DEBUG("Done sniffing\n"); return 0; } freeradius-server/src/main/radtest.in000066400000000000000000000045641257552170400202450ustar00rootroot00000000000000#! /bin/sh # # radtest Emulate the user interface of the old # radtest that used to be part of FreeRADIUS. # # Version: $Id$ # prefix="@prefix@" exec_prefix="@exec_prefix@" bindir="@bindir@" usage() { echo "Usage: radtest [OPTIONS] user passwd radius-server[:port] nas-port-number secret [ppphint] [nasname]" >&2 echo " -d RADIUS_DIR Set radius directory" >&2 echo " -t Set authentication method" >&2 echo " type can be pap, chap, mschap, or eap-md5" >&2 echo " -x Enable debug output" >&2 echo " -4 Use IPv4 for the NAS address (default)" >&2 echo " -6 Use IPv6 for the NAS address" >&2 exit 1 } radclient=$bindir/radclient if [ ! -x "$radclient" ] && [ -x ./radclient ] then radclient=./radclient fi # radeapclient is used for EAP-MD5. radeapclient=$bindir/radeapclient OPTIONS= PASSWORD="User-Password" NAS_ADDR_ATTR="NAS-IP-Address" # We need at LEAST these many options if [ $# -lt 5 ] then usage fi # Parse new command-line options while [ `echo "$1" | cut -c 1` = "-" ] do case "$1" in -4) OPTIONS="$OPTIONS -4" NAS_ADDR_ATTR="NAS-IP-Address" shift ;; -6) OPTIONS="$OPTIONS -6" NAS_ADDR_ATTR="NAS-IPv6-Address" shift ;; -d) OPTIONS="$OPTIONS -d $2" shift;shift ;; -x) OPTIONS="$OPTIONS -x" shift ;; -t) shift; case "$1" in pap) PASSWORD="User-Password" ;; chap) PASSWORD="CHAP-Password" ;; mschap) PASSWORD="MS-CHAP-Password" ;; eap-md5) PASSWORD="User-Password" if [ ! -x "$radeapclient" ] then echo "radtest: No 'radeapclient' program was found. Cannot perform EAP-MD5." >&1 exit 1 fi radclient="$radeapclient" ;; *) usage ;; esac shift ;; *) usage ;; esac done # Check that there are enough options left over. if [ $# -lt 5 ] || [ $# -gt 7 ] then usage fi if [ "$7" ] then nas=$7 else nas=`hostname` fi ( echo "User-Name = \"$1\"" echo "$PASSWORD = \"$2\"" echo "$NAS_ADDR_ATTR = $nas" echo "NAS-Port = $4" echo "Message-Authenticator = 0x00" if [ "$radclient" = "$radeapclient" ] then echo "EAP-Code = Response" echo "EAP-Type-Identity = \"$1\"" fi if [ "$6" != "" -a "$6" != "0" ] then echo "Framed-Protocol = PPP" fi ) | $radclient $OPTIONS -x $3 auth "$5" exit $? freeradius-server/src/main/radwho.c000066400000000000000000000341771257552170400177020ustar00rootroot00000000000000/*@-skipposixheaders@*/ /* * radwho.c Show who is logged in on the terminal servers. * Can also be installed as fingerd on the UNIX * machine RADIUS runs on. * * Version: $Id$ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2000,2006 The FreeRADIUS server project * Copyright 2000 Alan DeKok */ #include RCSID("$Id$") #include #include #include #ifdef HAVE_PWD_H #include #endif #include #include /* * FIXME: put in header file. */ #define SYS_FINGER "/usr/bin/finger" #define FINGER_DIR "/usr/local/lib/finger" /* * Header above output and format. */ static const char *hdr1 = "Login Name What TTY When From Location"; static const char *rfmt1 = "%-10.10s %-17.17s %-5.5s %s%-3u %-9.9s %-15.15s %-.19s%s"; static const char *rfmt1r = "%s,%s,%s,%s%u,%s,%s,%s%s"; static const char *hdr2 = "Login Port What When From Location"; static const char *rfmt2 = "%-10.10s %s%-5u %-6.6s %-13.13s %-15.15s %-.28s%s"; static const char *rfmt2r = "%s,%s%u,%s,%s,%s,%s%s"; static const char *eol = "\n"; static int showname = -1; static int showptype = 0; static int showcid = 0; int debug_flag = 0; const char *progname = "radwho"; const char *radlog_dir = NULL; const char *radutmp_file = NULL; const char *radius_dir = NULL; const char *radacct_dir = NULL; const char *radlib_dir = NULL; uint32_t myip = INADDR_ANY; int log_stripped_names; /* * Global, for log.c to use. */ struct main_config_t mainconfig; char *request_log_file = NULL; char *debug_log_file = NULL; int radius_xlat(char *out, UNUSED int outlen, UNUSED const char *fmt, UNUSED REQUEST *request, UNUSED RADIUS_ESCAPE_STRING func) { *out = 0; return 0; } struct radutmp_config_t { char *radutmp_fn; } radutmpconfig; static const CONF_PARSER module_config[] = { { "filename", PW_TYPE_STRING_PTR, 0, &radutmpconfig.radutmp_fn, RADUTMP }, { NULL, -1, 0, NULL, NULL } }; /* * Safe popen. Ugh. */ static FILE *safe_popen(const char *cmd, const char *mode) { char *p; char buf[1024]; /* * Change all suspect characters into a space. */ strlcpy(buf, cmd, sizeof(buf)); buf[sizeof(buf) - 1] = 0; for (p = buf; *p; p++) { if (isalnum((int) *p)) continue; if (strchr("@%-_ \t+:,./", *p) == NULL) *p = ' '; } return popen(buf, mode); } /* * Print a file from FINGER_DIR. If the file is executable, * execute it instead. Return 0 if successful. */ static int ffile(const char *arg) { FILE *fp; char fn[1024]; int p = 0; char *s; snprintf(fn, sizeof(fn), "%s/%.32s", FINGER_DIR, arg); if (access(fn, X_OK) == 0) { p = 1; snprintf(fn, sizeof(fn), "exec %s/%.32s 2>&1", FINGER_DIR, arg); fp = safe_popen(fn, "r"); } else fp = fopen(fn, "r"); if (fp == NULL) return -1; while(fgets(fn, 1024, fp)) { if ((s = strchr(fn, '\n')) != NULL) *s = 0; fprintf(stdout, "%s\r\n", fn); } if (p) pclose(fp); else fclose(fp); fflush(stdout); return 0; } /* * Execute the system finger and translate LF to CRLF. */ static void sys_finger(const char *l) { FILE *fp; char fn[1024]; char *p; if (ffile(l) == 0) exit(0); snprintf(fn, sizeof(fn), "exec %s %s", SYS_FINGER, l); if ((fp = safe_popen(fn, "r")) == NULL) { printf("popen: %s\r\n", strerror(errno)); exit(1); } while(fgets(fn, 1024, fp)) { if ((p = strchr(fn, '\n')) != NULL) *p = 0; fprintf(stdout, "%s\r\n", fn); } pclose(fp); exit(0); } /* * Get fullname of a user. */ static char *fullname(char *username) { #ifdef HAVE_PWD_Hx struct passwd *pwd; char *s; if ((pwd = getpwnam(username)) != NULL) { if ((s = strchr(pwd->pw_gecos, ',')) != NULL) *s = 0; return pwd->pw_gecos; } #endif return username; } /* * Return protocol type. */ static const char *proto(int id, int porttype) { static char buf[8]; if (showptype) { if (!strchr("ASITX", porttype)) porttype = ' '; if (id == 'S') snprintf(buf, sizeof(buf), "SLP %c", porttype); else if (id == 'P') snprintf(buf, sizeof(buf), "PPP %c", porttype); else snprintf(buf, sizeof(buf), "shl %c", porttype); return buf; } if (id == 'S') return "SLIP"; if (id == 'P') return "PPP"; return "shell"; } /* * Return a time in the form day hh:mm */ static char *dotime(time_t t) { char *s = ctime(&t); if (showname) { strlcpy(s + 4, s + 11, 6); s[9] = 0; } else { strlcpy(s + 4, s + 8, 9); s[12] = 0; } return s; } /* * Print address of NAS. */ static const char *hostname(char *buf, size_t buflen, uint32_t ipaddr) { /* * WTF is this code for? */ if (ipaddr == 0 || ipaddr == (uint32_t)-1 || ipaddr == (uint32_t)-2) return ""; return inet_ntop(AF_INET, &ipaddr, buf, buflen); } /* * Print usage message and exit. */ static void NEVER_RETURNS usage(int status) { FILE *output = status?stderr:stdout; fprintf(output, "Usage: radwho [-d raddb] [-cfihnprRsSZ] [-N nas] [-P nas_port] [-u user] [-U user]\n"); fprintf(output, " -c: show caller ID, if available\n"); fprintf(output, " -d: set the raddb directory (default is %s)\n", RADIUS_DIR); fprintf(output, " -f: give fingerd output\n"); fprintf(output, " -F : Use radutmp \n"); fprintf(output, " -i: show session ID\n"); fprintf(output, " -n: no full name\n"); fprintf(output, " -N : Show entries matching the given NAS IP address\n"); fprintf(output, " -p: show port type\n"); fprintf(output, " -P : Show entries matching the given nas port\n"); fprintf(output, " -r: Print output as raw comma-delimited data\n"); fprintf(output, " -R: Print output as RADIUS attributes and values\n"); fprintf(output, " Includes ALL information from the radutmp record.\n"); fprintf(output, " -s: show full name\n"); fprintf(output, " -S: hide shell users from radius\n"); fprintf(output, " -u : Show entries matching the given user\n"); fprintf(output, " -U : like -u, but case-sensitive\n"); fprintf(output, " -Z: Include accounting stop information in radius output. Requires -R.\n"); exit(status); } /* * Main program, either pmwho or fingerd. */ int main(int argc, char **argv) { CONF_SECTION *maincs, *cs; FILE *fp; struct radutmp rt; char inbuf[128]; char othername[256]; char nasname[1024]; char session_id[sizeof(rt.session_id)+1]; int fingerd = 0; int hideshell = 0; int showsid = 0; int rawoutput = 0; int radiusoutput = 0; /* Radius attributes */ char *p, *q; const char *portind; int c; unsigned int portno; char buffer[2048]; const char *user = NULL; int user_cmp = 0; time_t now = 0; uint32_t nas_port = ~0; uint32_t nas_ip_address = INADDR_NONE; int zap = 0; radius_dir = RADIUS_DIR; while((c = getopt(argc, argv, "d:fF:nN:sSipP:crRu:U:Z")) != EOF) switch(c) { case 'd': radius_dir = optarg; break; case 'f': fingerd++; showname = 0; break; case 'F': radutmp_file = optarg; break; case 'h': usage(0); break; case 'S': hideshell = 1; break; case 'n': showname = 0; break; case 'N': if (inet_pton(AF_INET, optarg, &nas_ip_address) < 0) { usage(1); } break; case 's': showname = 1; break; case 'i': showsid = 1; break; case 'p': showptype = 1; break; case 'P': nas_port = atoi(optarg); break; case 'c': showcid = 1; showname = 1; break; case 'r': rawoutput = 1; break; case 'R': radiusoutput = 1; now = time(NULL); break; case 'u': user = optarg; user_cmp = 0; break; case 'U': user = optarg; user_cmp = 1; break; case 'Z': zap = 1; break; default: usage(1); break; } /* * Be safe. */ if (zap && !radiusoutput) zap = 0; /* * zap EVERYONE, but only on this nas */ if (zap && !user && (~nas_port == 0)) { /* * We need to know which NAS to zap users in. */ if (nas_ip_address == INADDR_NONE) usage(1); printf("Acct-Status-Type = Accounting-Off\n"); printf("NAS-IP-Address = %s\n", hostname(buffer, sizeof(buffer), nas_ip_address)); printf("Acct-Delay-Time = 0\n"); exit(0); /* don't bother printing anything else */ } if (radutmp_file) goto have_radutmp; /* * Initialize mainconfig */ memset(&mainconfig, 0, sizeof(mainconfig)); mainconfig.radlog_dest = RADLOG_STDOUT; /* Read radiusd.conf */ snprintf(buffer, sizeof(buffer), "%.200s/radiusd.conf", radius_dir); maincs = cf_file_read(buffer); if (!maincs) { fprintf(stderr, "%s: Error reading or parsing radiusd.conf.\n", argv[0]); exit(1); } /* Read the radutmp section of radiusd.conf */ cs = cf_section_find_name2(cf_section_sub_find(maincs, "modules"), "radutmp", NULL); if(!cs) { fprintf(stderr, "%s: No configuration information in radutmp section of radiusd.conf!\n", argv[0]); exit(1); } cf_section_parse(cs, NULL, module_config); /* Assign the correct path for the radutmp file */ radutmp_file = radutmpconfig.radutmp_fn; have_radutmp: /* * See if we are "fingerd". */ if (strstr(argv[0], "fingerd")) { fingerd++; eol = "\r\n"; if (showname < 0) showname = 0; } if (showname < 0) showname = 1; if (fingerd) { /* * Read first line of the input. */ fgets(inbuf, 128, stdin); p = inbuf; while(*p == ' ' || *p == '\t') p++; if (*p == '/' && *(p + 1)) p += 2; while(*p == ' ' || *p == '\t') p++; for(q = p; *q && *q != '\r' && *q != '\n'; q++) ; *q = 0; /* * See if we fingered a specific user. */ ffile("header"); if (*p) sys_finger(p); } /* * Show the users logged in on the terminal server(s). */ if ((fp = fopen(radutmp_file, "r")) == NULL) { fprintf(stderr, "%s: Error reading %s: %s\n", progname, radutmp_file, strerror(errno)); return 0; } /* * Don't print the headers if raw or RADIUS */ if (!rawoutput && !radiusoutput) { fputs(showname ? hdr1 : hdr2, stdout); fputs(eol, stdout); } /* * Read the file, printing out active entries. */ while (fread(&rt, sizeof(rt), 1, fp) == 1) { if (rt.type != P_LOGIN) continue; /* hide logout sessions */ /* * We don't show shell users if we are * fingerd, as we have done that above. */ if (hideshell && !strchr("PCS", rt.proto)) continue; /* * Print out sessions only for the given user. */ if (user) { /* only for a particular user */ if (((user_cmp == 0) && (strncasecmp(rt.login, user, strlen(user)) != 0)) || ((user_cmp == 1) && (strncmp(rt.login, user, strlen(user)) != 0))) { continue; } } /* * Print out only for the given NAS port. */ if (~nas_port != 0) { if (rt.nas_port != nas_port) continue; } /* * Print out only for the given NAS IP address */ if (nas_ip_address != INADDR_NONE) { if (rt.nas_address != nas_ip_address) continue; } memcpy(session_id, rt.session_id, sizeof(rt.session_id)); session_id[sizeof(rt.session_id)] = 0; if (!rawoutput && rt.nas_port > (showname ? 999 : 99999)) { portind = ">"; portno = (showname ? 999 : 99999); } else { portind = "S"; portno = rt.nas_port; } /* * Print output as RADIUS attributes */ if (radiusoutput) { memcpy(nasname, rt.login, sizeof(rt.login)); nasname[sizeof(rt.login)] = '\0'; fr_print_string(nasname, 0, buffer, sizeof(buffer)); printf("User-Name = \"%s\"\n", buffer); fr_print_string(session_id, 0, buffer, sizeof(buffer)); printf("Acct-Session-Id = \"%s\"\n", buffer); if (zap) printf("Acct-Status-Type = Stop\n"); printf("NAS-IP-Address = %s\n", hostname(buffer, sizeof(buffer), rt.nas_address)); printf("NAS-Port = %u\n", rt.nas_port); switch (rt.proto) { case 'S': printf("Service-Type = Framed-User\n"); printf("Framed-Protocol = SLIP\n"); break; case 'P': printf("Service-Type = Framed-User\n"); printf("Framed-Protocol = PPP\n"); break; default: printf("Service-type = Login-User\n"); break; } if (rt.framed_address != INADDR_NONE) { printf("Framed-IP-Address = %s\n", hostname(buffer, sizeof(buffer), rt.framed_address)); } /* * Some sanity checks on the time */ if ((rt.time <= now) && (now - rt.time) <= (86400 * 365)) { printf("Acct-Session-Time = %ld\n", now - rt.time); } if (rt.caller_id[0] != '\0') { memcpy(nasname, rt.caller_id, sizeof(rt.caller_id)); nasname[sizeof(rt.caller_id)] = '\0'; fr_print_string(nasname, 0, buffer, sizeof(buffer)); printf("Calling-Station-Id = \"%s\"\n", buffer); } printf("\n"); /* separate entries with a blank line */ continue; } /* * Show the fill name, or not. */ if (showname) { printf((rawoutput == 0? rfmt1: rfmt1r), rt.login, showcid ? rt.caller_id : (showsid? session_id : fullname(rt.login)), proto(rt.proto, rt.porttype), portind, portno, dotime(rt.time), hostname(nasname, sizeof(nasname), rt.nas_address), hostname(othername, sizeof(othername), rt.framed_address), eol); } else { printf((rawoutput == 0? rfmt2: rfmt2r), rt.login, portind, portno, proto(rt.proto, rt.porttype), dotime(rt.time), hostname(nasname, sizeof(nasname), rt.nas_address), hostname(othername, sizeof(othername), rt.framed_address), eol); } } fclose(fp); return 0; } freeradius-server/src/main/radzap000077500000000000000000000021271257552170400174470ustar00rootroot00000000000000#!/bin/sh # # $Id$ # usage() { echo "Usage: radzap [options] server[:port] secret" >&2 echo " -h Print usage help information." echo " -d raddb_directory: directory where radiusd.conf is located." echo " -N nas_ip_address: IP address of the NAS to zap." echo " -P nas_port: NAS port that the user is logged into." echo " -u username: Name of user to zap (case insensitive)." echo " -U username: like -u, but case-sensitive." echo " -x Enable debugging output." exit ${1:-0} } while test "$#" != "0" do case $1 in -h) usage;; -d) RADDB="-d $2";shift;shift;; -N) NAS_IP_ADDR="-N $2";shift;shift;; -P) NAS_PORT="-P $2";shift;shift;; -u) USER_NAME="-u $2";shift;shift;; -U) USER_NAME="-U $2";shift;shift;; -x) DEBUG="-x";shift;; *) break;; esac done if test "$#" != "2"; then usage 1 >&2 fi SERVER=$1 SECRET=$2 # # Radzap is now a wrapper around radwho & radclient. # radwho -ZR $RADDB $NAS_IP_ADDR $NAS_PORT $USER_NAME | radclient $DEBUG $RADDB -f - $SERVER acct $SECRET freeradius-server/src/main/realms.c000066400000000000000000001521751257552170400177000ustar00rootroot00000000000000/* * realms.c Realm handling code * * Version: $Id$ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2007 The FreeRADIUS server project * Copyright 2007 Alan DeKok */ #include RCSID("$Id$") #include #include #include #include #include #ifdef HAVE_REGEX_H #include /* * For POSIX Regular expressions. * (0) Means no extended regular expressions. * REG_EXTENDED means use extended regular expressions. */ #ifndef REG_EXTENDED #define REG_EXTENDED (0) #endif #ifndef REG_NOSUB #define REG_NOSUB (0) #endif #ifndef REG_ICASE #define REG_ICASE (0) #endif #endif static rbtree_t *realms_byname = NULL; #ifdef HAVE_REGEX_H typedef struct realm_regex_t { REALM *realm; struct realm_regex_t *next; } realm_regex_t; static realm_regex_t *realms_regex = NULL; #endif /* HAVE_REGEX_H */ typedef struct realm_config_t { CONF_SECTION *cs; int dead_time; int retry_count; int retry_delay; int fallback; int wake_all_if_all_dead; } realm_config_t; static realm_config_t *realm_config = NULL; #ifdef WITH_PROXY static rbtree_t *home_servers_byaddr = NULL; static rbtree_t *home_servers_byname = NULL; #ifdef WITH_STATS static int home_server_max_number = 0; static rbtree_t *home_servers_bynumber = NULL; #endif static rbtree_t *home_pools_byname = NULL; /* * Map the proxy server configuration parameters to variables. */ static const CONF_PARSER proxy_config[] = { { "retry_delay", PW_TYPE_INTEGER, offsetof(realm_config_t, retry_delay), NULL, Stringify(RETRY_DELAY) }, { "retry_count", PW_TYPE_INTEGER, offsetof(realm_config_t, retry_count), NULL, Stringify(RETRY_COUNT) }, { "default_fallback", PW_TYPE_BOOLEAN, offsetof(realm_config_t, fallback), NULL, "no" }, { "dead_time", PW_TYPE_INTEGER, offsetof(realm_config_t, dead_time), NULL, Stringify(DEAD_TIME) }, { "wake_all_if_all_dead", PW_TYPE_BOOLEAN, offsetof(realm_config_t, wake_all_if_all_dead), NULL, "no" }, #ifdef WITH_POST_PROXY_AUTHORIZE { "post_proxy_authorize", PW_TYPE_BOOLEAN, 0, &mainconfig.post_proxy_authorize, "yes" }, #endif { NULL, -1, 0, NULL, NULL } }; #endif static int realm_name_cmp(const void *one, const void *two) { const REALM *a = one; const REALM *b = two; return strcasecmp(a->name, b->name); } #ifdef WITH_PROXY static int home_server_name_cmp(const void *one, const void *two) { const home_server *a = one; const home_server *b = two; if (a->type < b->type) return -1; if (a->type > b->type) return +1; return strcasecmp(a->name, b->name); } static int home_server_addr_cmp(const void *one, const void *two) { const home_server *a = one; const home_server *b = two; if (a->server && !b->server) return -1; if (!a->server && b->server) return +1; if (a->server && b->server) { int rcode = a->type - b->type; if (rcode != 0) return rcode; return strcmp(a->server, b->server); } if (a->port < b->port) return -1; if (a->port > b->port) return +1; return fr_ipaddr_cmp(&a->ipaddr, &b->ipaddr); } #ifdef WITH_STATS static int home_server_number_cmp(const void *one, const void *two) { const home_server *a = one; const home_server *b = two; return (a->number - b->number); } #endif static int home_pool_name_cmp(const void *one, const void *two) { const home_pool_t *a = one; const home_pool_t *b = two; if (a->server_type < b->server_type) return -1; if (a->server_type > b->server_type) return +1; return strcasecmp(a->name, b->name); } /* * Xlat for %{home_server:foo} */ static size_t xlat_home_server(UNUSED void *instance, REQUEST *request, char *fmt, char *out, size_t outlen, UNUSED RADIUS_ESCAPE_STRING func) { const char *value = NULL; CONF_PAIR *cp; if (!fmt || !out || (outlen < 1)) return 0; if (!request || !request->home_server) { *out = '\0'; return 0; } cp = cf_pair_find(request->home_server->cs, fmt); if (!cp || !(value = cf_pair_value(cp))) { *out = '\0'; return 0; } strlcpy(out, value, outlen); return strlen(out); } /* * Xlat for %{home_server_pool:foo} */ static size_t xlat_server_pool(UNUSED void *instance, REQUEST *request, char *fmt, char *out, size_t outlen, UNUSED RADIUS_ESCAPE_STRING func) { const char *value = NULL; CONF_PAIR *cp; if (!fmt || !out || (outlen < 1)) return 0; if (!request || !request->home_pool) { *out = '\0'; return 0; } cp = cf_pair_find(request->home_pool->cs, fmt); if (!cp || !(value = cf_pair_value(cp))) { *out = '\0'; return 0; } strlcpy(out, value, outlen); return strlen(out); } #endif void realms_free(void) { #ifdef WITH_PROXY #ifdef WITH_STATS rbtree_free(home_servers_bynumber); home_servers_bynumber = NULL; #endif rbtree_free(home_servers_byname); home_servers_byname = NULL; rbtree_free(home_servers_byaddr); home_servers_byaddr = NULL; rbtree_free(home_pools_byname); home_pools_byname = NULL; #endif rbtree_free(realms_byname); realms_byname = NULL; #ifdef HAVE_REGEX_H if (realms_regex) { realm_regex_t *this, *next; for (this = realms_regex; this != NULL; this = next) { next = this->next; free(this->realm); free(this); } realms_regex = NULL; } #endif free(realm_config); realm_config = NULL; } #ifdef WITH_PROXY static struct in_addr hs_ip4addr; static struct in6_addr hs_ip6addr; static char *hs_srcipaddr = NULL; static char *hs_type = NULL; static char *hs_check = NULL; static char *hs_virtual_server = NULL; #ifdef WITH_COA static CONF_PARSER home_server_coa[] = { { "irt", PW_TYPE_INTEGER, offsetof(home_server, coa_irt), 0, Stringify(2) }, { "mrt", PW_TYPE_INTEGER, offsetof(home_server, coa_mrt), 0, Stringify(16) }, { "mrc", PW_TYPE_INTEGER, offsetof(home_server, coa_mrc), 0, Stringify(5) }, { "mrd", PW_TYPE_INTEGER, offsetof(home_server, coa_mrd), 0, Stringify(30) }, { NULL, -1, 0, NULL, NULL } /* end the list */ }; #endif static CONF_PARSER home_server_config[] = { { "ipaddr", PW_TYPE_IPADDR, 0, &hs_ip4addr, NULL }, { "ipv6addr", PW_TYPE_IPV6ADDR, 0, &hs_ip6addr, NULL }, { "virtual_server", PW_TYPE_STRING_PTR, 0, &hs_virtual_server, NULL }, { "port", PW_TYPE_INTEGER, offsetof(home_server,port), NULL, "0" }, { "type", PW_TYPE_STRING_PTR, 0, &hs_type, NULL }, { "secret", PW_TYPE_STRING_PTR, offsetof(home_server,secret), NULL, NULL}, { "src_ipaddr", PW_TYPE_STRING_PTR, 0, &hs_srcipaddr, NULL }, { "response_window", PW_TYPE_INTEGER, offsetof(home_server,response_window), NULL, "30" }, { "no_response_fail", PW_TYPE_BOOLEAN, offsetof(home_server,no_response_fail), NULL, NULL }, { "max_outstanding", PW_TYPE_INTEGER, offsetof(home_server,max_outstanding), NULL, "65536" }, { "require_message_authenticator", PW_TYPE_BOOLEAN, offsetof(home_server, message_authenticator), 0, "yes" }, { "zombie_period", PW_TYPE_INTEGER, offsetof(home_server,zombie_period), NULL, "40" }, { "status_check", PW_TYPE_STRING_PTR, 0, &hs_check, "none" }, { "ping_check", PW_TYPE_STRING_PTR, 0, &hs_check, NULL }, { "ping_interval", PW_TYPE_INTEGER, offsetof(home_server,ping_interval), NULL, "30" }, { "check_interval", PW_TYPE_INTEGER, offsetof(home_server,ping_interval), NULL, "30" }, { "num_answers_to_alive", PW_TYPE_INTEGER, offsetof(home_server,num_pings_to_alive), NULL, "3" }, { "num_pings_to_alive", PW_TYPE_INTEGER, offsetof(home_server,num_pings_to_alive), NULL, "3" }, { "revive_interval", PW_TYPE_INTEGER, offsetof(home_server,revive_interval), NULL, "300" }, { "status_check_timeout", PW_TYPE_INTEGER, offsetof(home_server,ping_timeout), NULL, "4" }, { "username", PW_TYPE_STRING_PTR, offsetof(home_server,ping_user_name), NULL, NULL}, { "password", PW_TYPE_STRING_PTR, offsetof(home_server,ping_user_password), NULL, NULL}, #ifdef WITH_STATS { "historic_average_window", PW_TYPE_INTEGER, offsetof(home_server,ema.window), NULL, NULL }, #endif #ifdef WITH_COA { "coa", PW_TYPE_SUBSECTION, 0, NULL, (const void *) home_server_coa }, #endif { NULL, -1, 0, NULL, NULL } /* end the list */ }; static void null_free(UNUSED void *data) { } static int home_server_add(realm_config_t *rc, CONF_SECTION *cs) { const char *name2; home_server *home; int dual = FALSE; CONF_PAIR *cp; free(hs_virtual_server); /* used only for printing during parsing */ hs_virtual_server = NULL; name2 = cf_section_name2(cs); if (!name2) { cf_log_err(cf_sectiontoitem(cs), "Home server section is missing a name."); return 0; } home = rad_malloc(sizeof(*home)); memset(home, 0, sizeof(*home)); home->name = name2; home->cs = cs; /* * For zombie period calculations. We want to count * zombies from the time when the server starts, instead * of from 1970. */ home->last_packet = time(NULL); /* * Authentication servers have a default "no_response_fail = 0". * Accounting servers have a default "no_response_fail = 1". * * This is because authentication packets are retried, so * they can fail over to another home server. Accounting * packets are not retried, so they cannot fail over, and * instead should be rejected immediately. */ home->no_response_fail = 2; memset(&hs_ip4addr, 0, sizeof(hs_ip4addr)); memset(&hs_ip6addr, 0, sizeof(hs_ip6addr)); if (cf_section_parse(cs, home, home_server_config) < 0) { free(home); return 0; } /* * Figure out which one to use. */ if (cf_pair_find(cs, "ipaddr")) { home->ipaddr.af = AF_INET; home->ipaddr.ipaddr.ip4addr = hs_ip4addr; } else if (cf_pair_find(cs, "ipv6addr")) { home->ipaddr.af = AF_INET6; home->ipaddr.ipaddr.ip6addr = hs_ip6addr; } else if ((cp = cf_pair_find(cs, "virtual_server")) != NULL) { home->ipaddr.af = AF_UNSPEC; home->server = cf_pair_value(cp); if (!home->server) { cf_log_err(cf_sectiontoitem(cs), "Invalid value for virtual_server"); goto error; } if (!cf_section_sub_find_name2(rc->cs, "server", home->server)) { cf_log_err(cf_sectiontoitem(cs), "No such server %s", home->server); goto error; } /* * When CoA is used, the user has to specify the type * of the home server, even when they point to * virtual servers. */ home->secret = strdup(""); goto skip_port; } else { cf_log_err(cf_sectiontoitem(cs), "No ipaddr, ipv6addr, or virtual_server defined for home server \"%s\".", name2); error: free(home); free(hs_type); hs_type = NULL; free(hs_check); hs_check = NULL; free(hs_srcipaddr); hs_srcipaddr = NULL; return 0; } if (!home->port || (home->port > 65535)) { cf_log_err(cf_sectiontoitem(cs), "No port, or invalid port defined for home server %s.", name2); goto error; } if (0) { cf_log_err(cf_sectiontoitem(cs), "Fatal error! Home server %s is ourselves!", name2); goto error; } if (!home->secret) { cf_log_err(cf_sectiontoitem(cs), "No shared secret defined for home server %s.", name2); goto error; } /* * Use a reasonable default. */ skip_port: if (!hs_type) hs_type = strdup("auth+acct"); if (strcasecmp(hs_type, "auth") == 0) { home->type = HOME_TYPE_AUTH; if (home->no_response_fail == 2) home->no_response_fail = 0; } else if (strcasecmp(hs_type, "acct") == 0) { home->type = HOME_TYPE_ACCT; if (home->no_response_fail == 2) home->no_response_fail = 1; } else if (strcasecmp(hs_type, "auth+acct") == 0) { home->type = HOME_TYPE_AUTH; dual = TRUE; #ifdef WITH_COA } else if (strcasecmp(hs_type, "coa") == 0) { home->type = HOME_TYPE_COA; dual = FALSE; if (home->server != NULL) { cf_log_err(cf_sectiontoitem(cs), "Home servers of type \"coa\" cannot point to a virtual server"); goto error; } #endif } else { cf_log_err(cf_sectiontoitem(cs), "Invalid type \"%s\" for home server %s.", hs_type, name2); goto error; } free(hs_type); hs_type = NULL; if (!hs_check || (strcasecmp(hs_check, "none") == 0)) { home->ping_check = HOME_PING_CHECK_NONE; } else if (strcasecmp(hs_check, "status-server") == 0) { home->ping_check = HOME_PING_CHECK_STATUS_SERVER; } else if (strcasecmp(hs_check, "request") == 0) { home->ping_check = HOME_PING_CHECK_REQUEST; if (!home->ping_user_name || !*home->ping_user_name) { cf_log_err(cf_sectiontoitem(cs), "You must supply a 'username' to enable status_check=request"); goto error; } if ((home->type == HOME_TYPE_AUTH) && (!home->ping_user_password || !*home->ping_user_password)) { cf_log_err(cf_sectiontoitem(cs), "You must supply a password to enable status_check=request"); goto error; } } else { cf_log_err(cf_sectiontoitem(cs), "Invalid status__check \"%s\" for home server %s.", hs_check, name2); goto error; } free(hs_check); hs_check = NULL; if ((home->ping_check != HOME_PING_CHECK_NONE) && (home->ping_check != HOME_PING_CHECK_STATUS_SERVER)) { if (!home->ping_user_name) { cf_log_err(cf_sectiontoitem(cs), "You must supply a user name to enable status_check=request"); goto error; } if ((home->type == HOME_TYPE_AUTH) && !home->ping_user_password) { cf_log_err(cf_sectiontoitem(cs), "You must supply a password to enable status_check=request"); goto error; } } if ((home->ipaddr.af != AF_UNSPEC) && /* could be virtual server */ rbtree_finddata(home_servers_byaddr, home)) { cf_log_err(cf_sectiontoitem(cs), "Duplicate home server"); goto error; } /* * Look up the name using the *same* address family as * for the home server. */ if (hs_srcipaddr && (home->ipaddr.af != AF_UNSPEC)) { if (ip_hton(hs_srcipaddr, home->ipaddr.af, &home->src_ipaddr) < 0) { cf_log_err(cf_sectiontoitem(cs), "Failed parsing src_ipaddr"); goto error; } } /* * Make sure that this is set. */ if (home->src_ipaddr.af == AF_UNSPEC) { home->src_ipaddr.af = home->ipaddr.af; } free(hs_srcipaddr); hs_srcipaddr = NULL; if (!rbtree_insert(home_servers_byname, home)) { cf_log_err(cf_sectiontoitem(cs), "Internal error %d adding home server %s.", __LINE__, name2); goto error; } if ((home->ipaddr.af != AF_UNSPEC) && /* could be virtual server */ !rbtree_insert(home_servers_byaddr, home)) { rbtree_deletebydata(home_servers_byname, home); cf_log_err(cf_sectiontoitem(cs), "Internal error %d adding home server %s.", __LINE__, name2); goto error; } #ifdef WITH_STATS home->number = home_server_max_number++; if (!rbtree_insert(home_servers_bynumber, home)) { rbtree_deletebydata(home_servers_byname, home); if (home->ipaddr.af != AF_UNSPEC) { rbtree_deletebydata(home_servers_byname, home); } cf_log_err(cf_sectiontoitem(cs), "Internal error %d adding home server %s.", __LINE__, name2); goto error; } #endif if (home->max_outstanding < 8) home->max_outstanding = 8; if (home->max_outstanding > 65536*16) home->max_outstanding = 65536*16; if (home->ping_interval < 6) home->ping_interval = 6; if (home->ping_interval > 120) home->ping_interval = 120; if (home->response_window < 1) home->response_window = 1; if (home->response_window > 60) home->response_window = 60; if (home->zombie_period < 1) home->zombie_period = 1; if (home->zombie_period > 120) home->zombie_period = 120; if (home->zombie_period < home->response_window) { home->zombie_period = home->response_window; } if (home->num_pings_to_alive < 3) home->num_pings_to_alive = 3; if (home->num_pings_to_alive > 10) home->num_pings_to_alive = 10; if (home->ping_timeout < 3) home->ping_timeout = 3; if (home->ping_timeout > 10) home->ping_timeout = 10; if (home->revive_interval < 60) home->revive_interval = 60; if (home->revive_interval > 3600) home->revive_interval = 3600; #ifdef WITH_COA if (home->coa_irt < 1) home->coa_irt = 1; if (home->coa_irt > 5) home->coa_irt = 5; if (home->coa_mrc < 0) home->coa_mrc = 0; if (home->coa_mrc > 20 ) home->coa_mrc = 20; if (home->coa_mrt < 0) home->coa_mrt = 0; if (home->coa_mrt > 30 ) home->coa_mrt = 30; if (home->coa_mrd < 5) home->coa_mrd = 5; if (home->coa_mrd > 60 ) home->coa_mrd = 60; #endif if (dual) { home_server *home2 = rad_malloc(sizeof(*home2)); memcpy(home2, home, sizeof(*home2)); home2->type = HOME_TYPE_ACCT; home2->port++; home2->ping_user_password = NULL; home2->cs = cs; if (home->no_response_fail == 2) home->no_response_fail = 0; if (home2->no_response_fail == 2) home2->no_response_fail = 1; if (!rbtree_insert(home_servers_byname, home2)) { cf_log_err(cf_sectiontoitem(cs), "Internal error %d adding home server %s.", __LINE__, name2); free(home2); return 0; } if ((home->ipaddr.af != AF_UNSPEC) && !rbtree_insert(home_servers_byaddr, home2)) { rbtree_deletebydata(home_servers_byname, home2); cf_log_err(cf_sectiontoitem(cs), "Internal error %d adding home server %s.", __LINE__, name2); free(home2); return 0; } #ifdef WITH_STATS home2->number = home_server_max_number++; if (!rbtree_insert(home_servers_bynumber, home2)) { rbtree_deletebydata(home_servers_byname, home2); if (home2->ipaddr.af != AF_UNSPEC) { rbtree_deletebydata(home_servers_byname, home2); } cf_log_err(cf_sectiontoitem(cs), "Internal error %d adding home server %s.", __LINE__, name2); free(home2); return 0; } #endif } /* * Mark it as already processed */ cf_data_add(cs, "home_server", null_free, null_free); return 1; } static home_pool_t *server_pool_alloc(const char *name, home_pool_type_t type, int server_type, int num_home_servers) { home_pool_t *pool; pool = rad_malloc(sizeof(*pool) + (sizeof(pool->servers[0]) * num_home_servers)); if (!pool) return NULL; /* just for pairanoia */ memset(pool, 0, sizeof(*pool) + (sizeof(pool->servers[0]) * num_home_servers)); pool->name = name; pool->type = type; pool->server_type = server_type; pool->num_home_servers = num_home_servers; return pool; } static int pool_check_home_server(realm_config_t *rc, CONF_PAIR *cp, const char *name, int server_type, home_server **phome) { home_server myhome, *home; CONF_SECTION *server_cs; if (!name) { cf_log_err(cf_pairtoitem(cp), "No value given for home_server."); return 0; } myhome.name = name; myhome.type = server_type; home = rbtree_finddata(home_servers_byname, &myhome); if (home) { *phome = home; return 1; } server_cs = cf_section_sub_find_name2(rc->cs, "home_server", name); if (!server_cs) { cf_log_err(cf_pairtoitem(cp), "Unknown home_server \"%s\".", name); return 0; } home = rbtree_finddata(home_servers_byname, &myhome); if (!home) { return 0; } *phome = home; return 1; } static int server_pool_add(realm_config_t *rc, CONF_SECTION *cs, int server_type, int do_print) { const char *name2; home_pool_t *pool = NULL; const char *value; CONF_PAIR *cp; int num_home_servers; home_server *home; name2 = cf_section_name1(cs); if (!name2 || ((strcasecmp(name2, "server_pool") != 0) && (strcasecmp(name2, "home_server_pool") != 0))) { cf_log_err(cf_sectiontoitem(cs), "Section is not a home_server_pool."); return 0; } name2 = cf_section_name2(cs); if (!name2) { cf_log_err(cf_sectiontoitem(cs), "Server pool section is missing a name."); return 0; } /* * Count the home servers and initalize them. */ num_home_servers = 0; for (cp = cf_pair_find(cs, "home_server"); cp != NULL; cp = cf_pair_find_next(cs, cp, "home_server")) { num_home_servers++; if (!pool_check_home_server(rc, cp, cf_pair_value(cp), server_type, &home)) { return 0; } } if (num_home_servers == 0) { cf_log_err(cf_sectiontoitem(cs), "No home servers defined in pool %s", name2); goto error; } pool = server_pool_alloc(name2, HOME_POOL_FAIL_OVER, server_type, num_home_servers); pool->cs = cs; /* * Fallback servers must be defined, and must be * virtual servers. */ cp = cf_pair_find(cs, "fallback"); if (cp) { #ifdef WITH_COA if (server_type == HOME_TYPE_COA) { cf_log_err(cf_sectiontoitem(cs), "Home server pools of type \"coa\" cannot have a fallback virtual server."); goto error; } #endif if (!pool_check_home_server(rc, cp, cf_pair_value(cp), server_type, &pool->fallback)) { goto error; } if (!pool->fallback->server) { cf_log_err(cf_sectiontoitem(cs), "Fallback home_server %s does NOT contain a virtual_server directive.", pool->fallback->name); goto error; } } if (do_print) cf_log_info(cs, " home_server_pool %s {", name2); cp = cf_pair_find(cs, "type"); if (cp) { static FR_NAME_NUMBER pool_types[] = { { "load-balance", HOME_POOL_LOAD_BALANCE }, { "fail-over", HOME_POOL_FAIL_OVER }, { "round_robin", HOME_POOL_LOAD_BALANCE }, { "fail_over", HOME_POOL_FAIL_OVER }, { "client-balance", HOME_POOL_CLIENT_BALANCE }, { "client-port-balance", HOME_POOL_CLIENT_PORT_BALANCE }, { "keyed-balance", HOME_POOL_KEYED_BALANCE }, { NULL, 0 } }; value = cf_pair_value(cp); if (!value) { cf_log_err(cf_pairtoitem(cp), "No value given for type."); goto error; } pool->type = fr_str2int(pool_types, value, 0); if (!pool->type) { cf_log_err(cf_pairtoitem(cp), "Unknown type \"%s\".", value); goto error; } if (do_print) cf_log_info(cs, "\ttype = %s", value); } cp = cf_pair_find(cs, "virtual_server"); if (cp) { pool->virtual_server = cf_pair_value(cp); if (!pool->virtual_server) { cf_log_err(cf_pairtoitem(cp), "No value given for virtual_server"); goto error; } if (do_print) { cf_log_info(cs, "\tvirtual_server = %s", pool->virtual_server); } if (!cf_section_sub_find_name2(rc->cs, "server", pool->virtual_server)) { cf_log_err(cf_pairtoitem(cp), "No such server %s", pool->virtual_server); goto error; } } num_home_servers = 0; for (cp = cf_pair_find(cs, "home_server"); cp != NULL; cp = cf_pair_find_next(cs, cp, "home_server")) { home_server myhome; value = cf_pair_value(cp); memset(&myhome, 0, sizeof(myhome)); myhome.name = value; myhome.type = server_type; home = rbtree_finddata(home_servers_byname, &myhome); if (!home) { DEBUG2("Internal sanity check failed"); goto error; } if (0) { DEBUG2("Warning: Duplicate home server %s in server pool %s", home->name, pool->name); continue; } if (do_print) cf_log_info(cs, "\thome_server = %s", home->name); pool->servers[num_home_servers++] = home; } /* loop over home_server's */ if (pool->fallback && do_print) { cf_log_info(cs, "\tfallback = %s", pool->fallback->name); } if (!rbtree_insert(home_pools_byname, pool)) { rad_assert("Internal sanity check failed"); goto error; } if (do_print) cf_log_info(cs, " }"); cf_data_add(cs, "home_server_pool", pool, free); rad_assert(pool->server_type != 0); return 1; error: if (do_print) cf_log_info(cs, " }"); free(pool); return 0; } #endif static int old_server_add(realm_config_t *rc, CONF_SECTION *cs, const char *realm, const char *name, const char *secret, home_pool_type_t ldflag, home_pool_t **pool_p, int type, const char *server) { #ifdef WITH_PROXY int i, insert_point, num_home_servers; home_server myhome, *home; home_pool_t mypool, *pool; CONF_SECTION *subcs; #else rc = rc; /* -Wunused */ realm = realm; secret = secret; ldflag = ldflag; type = type; server = server; #endif /* * LOCAL realms get sanity checked, and nothing else happens. */ if (strcmp(name, "LOCAL") == 0) { if (*pool_p) { cf_log_err(cf_sectiontoitem(cs), "Realm \"%s\" cannot be both LOCAL and remote", name); return 0; } return 1; } #ifndef WITH_PROXY return 0; /* Not proxying. Can't do non-LOCAL realms */ #else mypool.name = realm; mypool.server_type = type; pool = rbtree_finddata(home_pools_byname, &mypool); if (pool) { if (pool->type != ldflag) { cf_log_err(cf_sectiontoitem(cs), "Inconsistent ldflag for server pool \"%s\"", name); return 0; } if (pool->server_type != type) { cf_log_err(cf_sectiontoitem(cs), "Inconsistent home server type for server pool \"%s\"", name); return 0; } } myhome.name = name; myhome.type = type; home = rbtree_finddata(home_servers_byname, &myhome); if (home) { if (secret && (strcmp(home->secret, secret) != 0)) { cf_log_err(cf_sectiontoitem(cs), "Inconsistent shared secret for home server \"%s\"", name); return 0; } if (home->type != type) { cf_log_err(cf_sectiontoitem(cs), "Inconsistent type for home server \"%s\"", name); return 0; } /* * See if the home server is already listed * in the pool. If so, do nothing else. */ if (pool) for (i = 0; i < pool->num_home_servers; i++) { if (pool->servers[i] == home) { return 1; } } } /* * If we do have a pool, check that there is room to * insert the home server we've found, or the one that we * create here. * * Note that we insert it into the LAST available * position, in order to maintain the same order as in * the configuration files. */ insert_point = -1; if (pool) { for (i = pool->num_home_servers - 1; i >= 0; i--) { if (pool->servers[i]) break; if (!pool->servers[i]) { insert_point = i; } } if (insert_point < 0) { cf_log_err(cf_sectiontoitem(cs), "No room in pool to add home server \"%s\". Please update the realm configuration to use the new-style home servers and server pools.", name); return 0; } } /* * No home server, allocate one. */ if (!home) { const char *p; char *q; home = rad_malloc(sizeof(*home)); memset(home, 0, sizeof(*home)); home->name = name; home->hostname = name; home->type = type; home->secret = secret; home->cs = cs; p = strchr(name, ':'); if (!p) { if (type == HOME_TYPE_AUTH) { home->port = PW_AUTH_UDP_PORT; } else { home->port = PW_ACCT_UDP_PORT; } p = name; q = NULL; } else if (p == name) { cf_log_err(cf_sectiontoitem(cs), "Invalid hostname %s.", name); free(home); return 0; } else { home->port = atoi(p + 1); if ((home->port == 0) || (home->port > 65535)) { cf_log_err(cf_sectiontoitem(cs), "Invalid port %s.", p + 1); free(home); return 0; } q = rad_malloc((p - name) + 1); memcpy(q, name, (p - name)); q[p - name] = '\0'; p = q; } if (!server) { if (ip_hton(p, AF_UNSPEC, &home->ipaddr) < 0) { cf_log_err(cf_sectiontoitem(cs), "Failed looking up hostname %s.", p); free(home); free(q); return 0; } } else { home->ipaddr.af = AF_UNSPEC; home->server = server; } free(q); /* * Use the old-style configuration. */ home->max_outstanding = 65535*16; home->zombie_period = rc->retry_delay * rc->retry_count; if (home->zombie_period == 0) home->zombie_period =30; home->response_window = home->zombie_period - 1; home->ping_check = HOME_PING_CHECK_NONE; home->revive_interval = rc->dead_time; if (rbtree_finddata(home_servers_byaddr, home)) { cf_log_err(cf_sectiontoitem(cs), "Home server %s has the same IP address and/or port as another home server.", name); free(home); return 0; } if (!rbtree_insert(home_servers_byname, home)) { cf_log_err(cf_sectiontoitem(cs), "Internal error %d adding home server %s.", __LINE__, name); free(home); return 0; } if (!rbtree_insert(home_servers_byaddr, home)) { rbtree_deletebydata(home_servers_byname, home); cf_log_err(cf_sectiontoitem(cs), "Internal error %d adding home server %s.", __LINE__, name); free(home); return 0; } #ifdef WITH_STATS home->number = home_server_max_number++; if (!rbtree_insert(home_servers_bynumber, home)) { rbtree_deletebydata(home_servers_byname, home); if (home->ipaddr.af != AF_UNSPEC) { rbtree_deletebydata(home_servers_byname, home); } cf_log_err(cf_sectiontoitem(cs), "Internal error %d adding home server %s.", __LINE__, name); free(home); return 0; } #endif } /* * We now have a home server, see if we can insert it * into pre-existing pool. */ if (insert_point >= 0) { rad_assert(pool != NULL); pool->servers[insert_point] = home; return 1; } rad_assert(pool == NULL); rad_assert(home != NULL); /* * Count the old-style realms of this name. */ num_home_servers = 0; for (subcs = cf_section_find_next(cs, NULL, "realm"); subcs != NULL; subcs = cf_section_find_next(cs, subcs, "realm")) { const char *this = cf_section_name2(subcs); if (!this || (strcmp(this, realm) != 0)) continue; num_home_servers++; } if (num_home_servers == 0) { cf_log_err(cf_sectiontoitem(cs), "Internal error counting pools for home server %s.", name); free(home); return 0; } pool = server_pool_alloc(realm, ldflag, type, num_home_servers); pool->cs = cs; pool->servers[0] = home; if (!rbtree_insert(home_pools_byname, pool)) { rad_assert("Internal sanity check failed"); return 0; } *pool_p = pool; return 1; #endif } static int old_realm_config(realm_config_t *rc, CONF_SECTION *cs, REALM *r) { const char *host; const char *secret = NULL; home_pool_type_t ldflag; CONF_PAIR *cp; cp = cf_pair_find(cs, "ldflag"); ldflag = HOME_POOL_FAIL_OVER; if (cp) { host = cf_pair_value(cp); if (!host) { cf_log_err(cf_pairtoitem(cp), "No value specified for ldflag"); return 0; } if (strcasecmp(host, "fail_over") == 0) { cf_log_info(cs, "\tldflag = fail_over"); } else if (strcasecmp(host, "round_robin") == 0) { ldflag = HOME_POOL_LOAD_BALANCE; cf_log_info(cs, "\tldflag = round_robin"); } else { cf_log_err(cf_sectiontoitem(cs), "Unknown value \"%s\" for ldflag", host); return 0; } } /* else don't print it. */ /* * Allow old-style if it doesn't exist, or if it exists and * it's LOCAL. */ cp = cf_pair_find(cs, "authhost"); if (cp) { host = cf_pair_value(cp); if (!host) { cf_log_err(cf_pairtoitem(cp), "No value specified for authhost"); return 0; } if (strcmp(host, "LOCAL") != 0) { cp = cf_pair_find(cs, "secret"); if (!cp) { cf_log_err(cf_sectiontoitem(cs), "No shared secret supplied for realm: %s", r->name); return 0; } secret = cf_pair_value(cp); if (!secret) { cf_log_err(cf_pairtoitem(cp), "No value specified for secret"); return 0; } } cf_log_info(cs, "\tauthhost = %s", host); if (!old_server_add(rc, cs, r->name, host, secret, ldflag, &r->auth_pool, HOME_TYPE_AUTH, NULL)) { return 0; } } cp = cf_pair_find(cs, "accthost"); if (cp) { host = cf_pair_value(cp); if (!host) { cf_log_err(cf_pairtoitem(cp), "No value specified for accthost"); return 0; } /* * Don't look for a secret again if it was found * above. */ if ((strcmp(host, "LOCAL") != 0) && !secret) { cp = cf_pair_find(cs, "secret"); if (!cp) { cf_log_err(cf_sectiontoitem(cs), "No shared secret supplied for realm: %s", r->name); return 0; } secret = cf_pair_value(cp); if (!secret) { cf_log_err(cf_pairtoitem(cp), "No value specified for secret"); return 0; } } cf_log_info(cs, "\taccthost = %s", host); if (!old_server_add(rc, cs, r->name, host, secret, ldflag, &r->acct_pool, HOME_TYPE_ACCT, NULL)) { return 0; } } cp = cf_pair_find(cs, "virtual_server"); if (cp) { host = cf_pair_value(cp); if (!host) { cf_log_err(cf_pairtoitem(cp), "No value specified for virtual_server"); return 0; } cf_log_info(cs, "\tvirtual_server = %s", host); if (!old_server_add(rc, cs, r->name, host, "", ldflag, &r->auth_pool, HOME_TYPE_AUTH, host)) { return 0; } if (!old_server_add(rc, cs, r->name, host, "", ldflag, &r->acct_pool, HOME_TYPE_ACCT, host)) { return 0; } } if (secret) cf_log_info(cs, "\tsecret = %s", secret); return 1; } #ifdef WITH_PROXY static int add_pool_to_realm(realm_config_t *rc, CONF_SECTION *cs, const char *name, home_pool_t **dest, int server_type, int do_print) { home_pool_t mypool, *pool; mypool.name = name; mypool.server_type = server_type; pool = rbtree_finddata(home_pools_byname, &mypool); if (!pool) { CONF_SECTION *pool_cs; pool_cs = cf_section_sub_find_name2(rc->cs, "home_server_pool", name); if (!pool_cs) { pool_cs = cf_section_sub_find_name2(rc->cs, "server_pool", name); } if (!pool_cs) { cf_log_err(cf_sectiontoitem(cs), "Failed to find home_server_pool \"%s\"", name); return 0; } if (!server_pool_add(rc, pool_cs, server_type, do_print)) { return 0; } pool = rbtree_finddata(home_pools_byname, &mypool); if (!pool) { radlog(L_ERR, "Internal sanity check failed in add_pool_to_realm"); return 0; } } if (pool->server_type != server_type) { cf_log_err(cf_sectiontoitem(cs), "Incompatible home_server_pool \"%s\" (mixed auth_pool / acct_pool)", name); return 0; } *dest = pool; return 1; } #endif static int realm_add(realm_config_t *rc, CONF_SECTION *cs) { const char *name2; REALM *r = NULL; CONF_PAIR *cp; #ifdef WITH_PROXY home_pool_t *auth_pool, *acct_pool; const char *auth_pool_name, *acct_pool_name; #endif name2 = cf_section_name1(cs); if (!name2 || (strcasecmp(name2, "realm") != 0)) { cf_log_err(cf_sectiontoitem(cs), "Section is not a realm."); return 0; } name2 = cf_section_name2(cs); if (!name2) { cf_log_err(cf_sectiontoitem(cs), "Realm section is missing the realm name."); return 0; } #ifdef WITH_PROXY auth_pool = acct_pool = NULL; auth_pool_name = acct_pool_name = NULL; /* * Prefer new configuration to old one. */ cp = cf_pair_find(cs, "pool"); if (!cp) cp = cf_pair_find(cs, "home_server_pool"); if (cp) auth_pool_name = cf_pair_value(cp); if (cp && auth_pool_name) { acct_pool_name = auth_pool_name; if (!add_pool_to_realm(rc, cs, auth_pool_name, &auth_pool, HOME_TYPE_AUTH, 1)) { return 0; } if (!add_pool_to_realm(rc, cs, auth_pool_name, &acct_pool, HOME_TYPE_ACCT, 0)) { return 0; } } cp = cf_pair_find(cs, "auth_pool"); if (cp) auth_pool_name = cf_pair_value(cp); if (cp && auth_pool_name) { if (auth_pool) { cf_log_err(cf_sectiontoitem(cs), "Cannot use \"pool\" and \"auth_pool\" at the same time."); return 0; } if (!add_pool_to_realm(rc, cs, auth_pool_name, &auth_pool, HOME_TYPE_AUTH, 1)) { return 0; } } cp = cf_pair_find(cs, "acct_pool"); if (cp) acct_pool_name = cf_pair_value(cp); if (cp && acct_pool_name) { int do_print = TRUE; if (acct_pool) { cf_log_err(cf_sectiontoitem(cs), "Cannot use \"pool\" and \"acct_pool\" at the same time."); return 0; } if (!auth_pool || auth_pool_name && (strcmp(auth_pool_name, acct_pool_name) != 0)) { do_print = TRUE; } if (!add_pool_to_realm(rc, cs, acct_pool_name, &acct_pool, HOME_TYPE_ACCT, do_print)) { return 0; } } #endif cf_log_info(cs, " realm %s {", name2); #ifdef WITH_PROXY /* * The realm MAY already exist if it's an old-style realm. * In that case, merge the old-style realm with this one. */ r = realm_find2(name2); if (r && (strcmp(r->name, name2) == 0)) { if (cf_pair_find(cs, "auth_pool") || cf_pair_find(cs, "acct_pool")) { cf_log_err(cf_sectiontoitem(cs), "Duplicate realm \"%s\"", name2); goto error; } if (!old_realm_config(rc, cs, r)) { goto error; } cf_log_info(cs, " } # realm %s", name2); return 1; } #endif #ifdef HAVE_REGEX_H if (name2[0] == '~') { int rcode; regex_t reg; /* * Include substring matches. */ rcode = regcomp(®, name2 + 1, REG_EXTENDED | REG_NOSUB | REG_ICASE); if (rcode != 0) { char buffer[256]; regerror(rcode, ®, buffer, sizeof(buffer)); cf_log_err(cf_sectiontoitem(cs), "Invalid regex \"%s\": %s", name2 + 1, buffer); goto error; } regfree(®); } #endif r = rad_malloc(sizeof(*r)); memset(r, 0, sizeof(*r)); r->name = name2; r->striprealm = 1; #ifdef WITH_PROXY r->auth_pool = auth_pool; r->acct_pool = acct_pool; if (auth_pool_name && (auth_pool_name == acct_pool_name)) { /* yes, ptr comparison */ cf_log_info(cs, "\tpool = %s", auth_pool_name); } else { if (auth_pool_name) cf_log_info(cs, "\tauth_pool = %s", auth_pool_name); if (acct_pool_name) cf_log_info(cs, "\tacct_pool = %s", acct_pool_name); } #endif cp = cf_pair_find(cs, "nostrip"); if (cp && (cf_pair_value(cp) == NULL)) { r->striprealm = 0; cf_log_info(cs, "\tnostrip"); } /* * We're a new-style realm. Complain if we see the old * directives. */ if (r->auth_pool || r->acct_pool) { if (((cp = cf_pair_find(cs, "authhost")) != NULL) || ((cp = cf_pair_find(cs, "accthost")) != NULL) || ((cp = cf_pair_find(cs, "secret")) != NULL) || ((cp = cf_pair_find(cs, "ldflag")) != NULL)) { DEBUG2("WARNING: Ignoring old-style configuration entry \"%s\" in realm \"%s\"", cf_pair_attr(cp), r->name); } /* * The realm MAY be an old-style realm, as there * was no auth_pool or acct_pool. Double-check * it, just to be safe. */ } else if (!old_realm_config(rc, cs, r)) { goto error; } #ifdef HAVE_REGEX_H /* * It's a regex. Add it to a separate list. */ if (name2[0] == '~') { realm_regex_t *rr, **last; rr = rad_malloc(sizeof(*rr)); last = &realms_regex; while (*last) last = &((*last)->next); /* O(N^2)... sue me. */ r->name = name2; rr->realm = r; rr->next = NULL; *last = rr; cf_log_info(cs, " }"); return 1; } #endif if (!rbtree_insert(realms_byname, r)) { rad_assert("Internal sanity check failed"); goto error; } cf_log_info(cs, " }"); return 1; error: cf_log_info(cs, " } # realm %s", name2); free(r); return 0; } #ifdef WITH_COA static const FR_NAME_NUMBER home_server_types[] = { { "auth", HOME_TYPE_AUTH }, { "auth+acct", HOME_TYPE_AUTH }, { "acct", HOME_TYPE_ACCT }, { "coa", HOME_TYPE_COA }, { NULL, 0 } }; static int pool_peek_type(CONF_SECTION *config, CONF_SECTION *cs) { int home; const char *name, *type; CONF_PAIR *cp; CONF_SECTION *server_cs; cp = cf_pair_find(cs, "home_server"); if (!cp) { cf_log_err(cf_sectiontoitem(cs), "Pool does not contain a \"home_server\" entry"); return HOME_TYPE_INVALID; } name = cf_pair_value(cp); if (!name) { cf_log_err(cf_pairtoitem(cp), "home_server entry does not reference a home server"); return HOME_TYPE_INVALID; } server_cs = cf_section_sub_find_name2(config, "home_server", name); if (!server_cs) { cf_log_err(cf_pairtoitem(cp), "home_server \"%s\" does not exist", name); return HOME_TYPE_INVALID; } cp = cf_pair_find(server_cs, "type"); if (!cp) { cf_log_err(cf_sectiontoitem(server_cs), "home_server %s does not contain a \"type\" entry", name); return HOME_TYPE_INVALID; } type = cf_pair_value(cp); if (!type) { cf_log_err(cf_sectiontoitem(server_cs), "home_server %s contains an empty \"type\" entry", name); return HOME_TYPE_INVALID; } home = fr_str2int(home_server_types, type, HOME_TYPE_INVALID); if (home == HOME_TYPE_INVALID) { cf_log_err(cf_sectiontoitem(server_cs), "home_server %s contains an invalid \"type\" entry of value \"%s\"", name, type); return HOME_TYPE_INVALID; } return home; /* 'cause we miss it so much */ } #endif int realms_init(CONF_SECTION *config) { CONF_SECTION *cs; realm_config_t *rc, *old_rc; if (realms_byname) return 1; realms_byname = rbtree_create(realm_name_cmp, free, 0); if (!realms_byname) { realms_free(); return 0; } #ifdef WITH_PROXY home_servers_byaddr = rbtree_create(home_server_addr_cmp, free, 0); if (!home_servers_byaddr) { realms_free(); return 0; } home_servers_byname = rbtree_create(home_server_name_cmp, NULL, 0); if (!home_servers_byname) { realms_free(); return 0; } #ifdef WITH_STATS home_servers_bynumber = rbtree_create(home_server_number_cmp, NULL, 0); if (!home_servers_bynumber) { realms_free(); return 0; } #endif home_pools_byname = rbtree_create(home_pool_name_cmp, NULL, 0); if (!home_pools_byname) { realms_free(); return 0; } #endif rc = rad_malloc(sizeof(*rc)); memset(rc, 0, sizeof(*rc)); rc->cs = config; #ifdef WITH_PROXY cs = cf_subsection_find_next(config, NULL, "proxy"); if (cs) { cf_section_parse(cs, rc, proxy_config); } else { rc->dead_time = DEAD_TIME; rc->retry_count = RETRY_COUNT; rc->retry_delay = RETRY_DELAY; rc->fallback = 0; rc->wake_all_if_all_dead= 0; } #endif for (cs = cf_subsection_find_next(config, NULL, "home_server"); cs != NULL; cs = cf_subsection_find_next(config, cs, "home_server")) { if (!home_server_add(rc, cs)) { cf_log_err(cf_sectiontoitem(cs), "unable to add home_server"); free(rc); realms_free(); return 0; } } for (cs = cf_subsection_find_next(config, NULL, "realm"); cs != NULL; cs = cf_subsection_find_next(config, cs, "realm")) { if (!realm_add(rc, cs)) { cf_log_err(cf_sectiontoitem(cs), "unable to add realm (check for mismatched \"type\" entry with home servers)"); free(rc); realms_free(); return 0; } } #ifdef WITH_COA /* * CoA pools aren't tied to realms. */ for (cs = cf_subsection_find_next(config, NULL, "home_server_pool"); cs != NULL; cs = cf_subsection_find_next(config, cs, "home_server_pool")) { int type; /* * Pool was already loaded. */ if (cf_data_find(cs, "home_server_pool")) continue; type = pool_peek_type(config, cs); if (type == HOME_TYPE_INVALID) { free(rc); realms_free(); return 0; } if (!server_pool_add(rc, cs, type, TRUE)) { free(rc); realms_free(); return 0; } } #endif #ifdef WITH_PROXY xlat_register("home_server", xlat_home_server, NULL); xlat_register("home_server_pool", xlat_server_pool, NULL); #endif /* * Swap pointers atomically. */ old_rc = realm_config; realm_config = rc; free(old_rc); return 1; } /* * Find a realm where "name" might be the regex. */ REALM *realm_find2(const char *name) { REALM myrealm; REALM *realm; if (!name) name = "NULL"; myrealm.name = name; realm = rbtree_finddata(realms_byname, &myrealm); if (realm) return realm; #ifdef HAVE_REGEX_H if (realms_regex) { realm_regex_t *this; for (this = realms_regex; this != NULL; this = this->next) { if (strcmp(this->realm->name, name) == 0) { return this->realm; } } } #endif /* * Couldn't find a realm. Look for DEFAULT. */ myrealm.name = "DEFAULT"; return rbtree_finddata(realms_byname, &myrealm); } /* * Find a realm in the REALM list. */ REALM *realm_find(const char *name) { REALM myrealm; REALM *realm; if (!name) name = "NULL"; myrealm.name = name; realm = rbtree_finddata(realms_byname, &myrealm); if (realm) return realm; #ifdef HAVE_REGEX_H if (realms_regex) { realm_regex_t *this; for (this = realms_regex; this != NULL; this = this->next) { int compare; regex_t reg; /* * Include substring matches. */ if (regcomp(®, this->realm->name + 1, REG_EXTENDED | REG_NOSUB | REG_ICASE) != 0) { continue; } compare = regexec(®, name, 0, NULL, 0); regfree(®); if (compare == 0) return this->realm; } } #endif /* * Couldn't find a realm. Look for DEFAULT. */ myrealm.name = "DEFAULT"; return rbtree_finddata(realms_byname, &myrealm); } #ifdef WITH_PROXY home_server *home_server_ldb(const char *realmname, home_pool_t *pool, REQUEST *request) { int start; int count; home_server *found = NULL; home_server *zombie = NULL; VALUE_PAIR *vp; /* * Determine how to pick choose the home server. */ switch (pool->type) { uint32_t hash; /* * For load-balancing by client IP address, we * pick a home server by hashing the client IP. * * This isn't as even a load distribution as * tracking the State attribute, but it's better * than nothing. */ case HOME_POOL_CLIENT_BALANCE: switch (request->packet->src_ipaddr.af) { case AF_INET: hash = fr_hash(&request->packet->src_ipaddr.ipaddr.ip4addr, sizeof(request->packet->src_ipaddr.ipaddr.ip4addr)); break; case AF_INET6: hash = fr_hash(&request->packet->src_ipaddr.ipaddr.ip6addr, sizeof(request->packet->src_ipaddr.ipaddr.ip6addr)); break; default: hash = 0; break; } start = hash % pool->num_home_servers; break; case HOME_POOL_CLIENT_PORT_BALANCE: switch (request->packet->src_ipaddr.af) { case AF_INET: hash = fr_hash(&request->packet->src_ipaddr.ipaddr.ip4addr, sizeof(request->packet->src_ipaddr.ipaddr.ip4addr)); break; case AF_INET6: hash = fr_hash(&request->packet->src_ipaddr.ipaddr.ip6addr, sizeof(request->packet->src_ipaddr.ipaddr.ip6addr)); break; default: hash = 0; break; } fr_hash_update(&request->packet->src_port, sizeof(request->packet->src_port), hash); start = hash % pool->num_home_servers; break; case HOME_POOL_KEYED_BALANCE: if ((vp = pairfind(request->config_items, PW_LOAD_BALANCE_KEY)) != NULL) { hash = fr_hash(vp->vp_strvalue, vp->length); start = hash % pool->num_home_servers; break; } /* FALL-THROUGH */ case HOME_POOL_LOAD_BALANCE: case HOME_POOL_FAIL_OVER: start = 0; break; default: /* this shouldn't happen... */ start = 0; break; } /* * Starting with the home server we chose, loop through * all home servers. If the current one is dead, skip * it. If it is too busy, skip it. * * Otherwise, use it. */ for (count = 0; count < pool->num_home_servers; count++) { home_server *home = pool->servers[(start + count) % pool->num_home_servers]; if (!home) continue; /* * Skip dead home servers. */ if (home->state == HOME_STATE_IS_DEAD) { continue; } /* * This home server is too busy. Choose another one. */ if (home->currently_outstanding >= home->max_outstanding) { continue; } #ifdef WITH_DETAIL /* * We read the packet from a detail file, AND it * came from this server. Don't re-proxy it * there. */ if ((request->listener->type == RAD_LISTEN_DETAIL) && (request->packet->code == PW_ACCOUNTING_REQUEST) && (fr_ipaddr_cmp(&home->ipaddr, &request->packet->src_ipaddr) == 0)) { continue; } #endif /* * It's zombie, so we remember the first zombie * we find, but we don't mark it as a "live" * server. */ if (home->state == HOME_STATE_ZOMBIE) { if (!zombie) zombie = home; continue; } /* * We've found the first "live" one. Use that. */ if (pool->type != HOME_POOL_LOAD_BALANCE) { found = home; break; } /* * Otherwise we're doing some kind of load balancing. * If we haven't found one yet, pick this one. */ if (!found) { found = home; continue; } RDEBUG3("PROXY %s %d\t%s %d", found->name, found->currently_outstanding, home->name, home->currently_outstanding); /* * Prefer this server if it's less busy than the * one we had previously found. */ if (home->currently_outstanding < found->currently_outstanding) { RDEBUG3("PROXY Choosing %s: It's less busy than %s", home->name, found->name); found = home; continue; } /* * Ignore servers which are busier than the one * we found. */ if (home->currently_outstanding > found->currently_outstanding) { RDEBUG3("PROXY Skipping %s: It's busier than %s", home->name, found->name); continue; } /* * From the list of servers which have the same * load, choose one at random. */ if (((count + 1) * (fr_rand() & 0xffff)) < (uint32_t) 0x10000) { found = home; } } /* loop over the home servers */ /* * We have no live servers, BUT we have a zombie. Use * the zombie as a last resort. */ if (!found && zombie) { found = zombie; zombie = NULL; } /* * There's a fallback if they're all dead. */ if (!found && pool->fallback) { found = pool->fallback; } if (found) { update_and_return: /* * Allocate the proxy packet, only if it wasn't * already allocated by a module. This check is * mainly to support the proxying of EAP-TTLS and * EAP-PEAP tunneled requests. * * In those cases, the EAP module creates a * "fake" request, and recursively passes it * through the authentication stage of the * server. The module then checks if the request * was supposed to be proxied, and if so, creates * a proxy packet from the TUNNELED request, and * not from the EAP request outside of the * tunnel. * * The proxy then works like normal, except that * the response packet is "eaten" by the EAP * module, and encapsulated into an EAP packet. */ if (!request->proxy) { if ((request->proxy = rad_alloc(TRUE)) == NULL) { radlog(L_ERR|L_CONS, "no memory"); exit(1); } /* * Copy the request, then look up name * and plain-text password in the copy. * * Note that the User-Name attribute is * the *original* as sent over by the * client. The Stripped-User-Name * attribute is the one hacked through * the 'hints' file. */ request->proxy->vps = paircopy(request->packet->vps); } /* * Update the various fields as appropriate. */ request->proxy->src_ipaddr = found->src_ipaddr; request->proxy->dst_ipaddr = found->ipaddr; request->proxy->dst_port = found->port; request->home_server = found; /* * We're supposed to add a Message-Authenticator * if it doesn't exist, and it doesn't exist. */ if (found->message_authenticator && (request->packet->code == PW_AUTHENTICATION_REQUEST) && !pairfind(request->proxy->vps, PW_MESSAGE_AUTHENTICATOR)) { radius_pairmake(request, &request->proxy->vps, "Message-Authenticator", "0x00", T_OP_SET); } return found; } /* * No live match found, and no fallback to the "DEFAULT" * realm. We fix this by blindly marking all servers as * "live". But only do it for ones that don't support * "pings", as they will be marked live when they * actually are live. */ if (!realm_config->fallback && realm_config->wake_all_if_all_dead) { for (count = 0; count < pool->num_home_servers; count++) { home_server *home = pool->servers[count]; if (!home) continue; if ((home->state == HOME_STATE_IS_DEAD) && (home->ping_check == HOME_PING_CHECK_NONE)) { home->state = HOME_STATE_ALIVE; if (!found) found = home; } } if (found) goto update_and_return; } /* * Still nothing. Look up the DEFAULT realm, but only * if we weren't looking up the NULL or DEFAULT realms. */ if (realm_config->fallback && realmname && (strcmp(realmname, "NULL") != 0) && (strcmp(realmname, "DEFAULT") != 0)) { REALM *rd = realm_find("DEFAULT"); if (!rd) return NULL; pool = NULL; if (request->packet->code == PW_AUTHENTICATION_REQUEST) { pool = rd->auth_pool; } else if (request->packet->code == PW_ACCOUNTING_REQUEST) { pool = rd->acct_pool; } if (!pool) return NULL; RDEBUG2("PROXY - realm %s has no live home servers. Falling back to the DEFAULT realm.", realmname); return home_server_ldb(rd->name, pool, request); } /* * Still haven't found anything. Oh well. */ return NULL; } home_server *home_server_find(fr_ipaddr_t *ipaddr, int port) { home_server myhome; memset(&myhome, 0, sizeof(myhome)); myhome.ipaddr = *ipaddr; myhome.port = port; myhome.server = NULL; /* we're not called for internal proxying */ return rbtree_finddata(home_servers_byaddr, &myhome); } #ifdef WITH_COA home_server *home_server_byname(const char *name, int type) { home_server myhome; memset(&myhome, 0, sizeof(myhome)); myhome.type = type; myhome.name = name; return rbtree_finddata(home_servers_byname, &myhome); } #endif #ifdef WITH_STATS home_server *home_server_bynumber(int number) { home_server myhome; memset(&myhome, 0, sizeof(myhome)); myhome.number = number; myhome.server = NULL; /* we're not called for internal proxying */ return rbtree_finddata(home_servers_bynumber, &myhome); } #endif home_pool_t *home_pool_byname(const char *name, int type) { home_pool_t mypool; memset(&mypool, 0, sizeof(mypool)); mypool.name = name; mypool.server_type = type; return rbtree_finddata(home_pools_byname, &mypool); } #endif #ifdef WITH_PROXY static int home_server_create_callback(UNUSED void *ctx, void *data) { home_server *home = data; rad_listen_t *this; /* * If there WAS a src address defined, ensure that a * proxy listener has been defined. */ if (home->src_ipaddr.af != AF_UNSPEC) { this = proxy_new_listener(&home->src_ipaddr, TRUE); /* * Failed to create it: Die */ if (!this) return 1; /* * Don't do anything else. The function above * takes care of adding the listener to the list. */ } return 0; } /* * Taking a void* here solves some header issues. */ int home_server_create_listeners(void) { if (!home_servers_byaddr) return 0; /* * Add the listeners to the TAIL of the list. */ if (rbtree_walk(home_servers_byaddr, InOrder, home_server_create_callback, NULL) != 0) { return -1; } return 0; } #endif freeradius-server/src/main/session.c000066400000000000000000000144231257552170400200710ustar00rootroot00000000000000/* * session.c session management * * Version: $Id$ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2000,2006 The FreeRADIUS server project */ #include RCSID("$Id$") #include #include #include #ifdef HAVE_SYS_WAIT_H #include #endif #ifdef WITH_SESSION_MGMT /* * End a session by faking a Stop packet to all accounting modules. */ int session_zap(REQUEST *request, uint32_t nasaddr, unsigned int port, const char *user, const char *sessionid, uint32_t cliaddr, char proto, int session_time) { REQUEST *stopreq; VALUE_PAIR *vp, *userpair; int ret; stopreq = request_alloc_fake(request); stopreq->packet->code = PW_ACCOUNTING_REQUEST; /* just to be safe */ stopreq->listener = request->listener; rad_assert(stopreq != NULL); /* Hold your breath */ #define PAIR(n,v,t,e) do { \ if(!(vp = paircreate(n, t))) { \ request_free(&stopreq); \ radlog(L_ERR|L_CONS, "no memory"); \ pairfree(&(stopreq->packet->vps)); \ return 0; \ } \ vp->e = v; \ pairadd(&(stopreq->packet->vps), vp); \ } while(0) #define INTPAIR(n,v) PAIR(n,v,PW_TYPE_INTEGER,vp_integer) #define IPPAIR(n,v) PAIR(n,v,PW_TYPE_IPADDR,vp_ipaddr) #define STRINGPAIR(n,v) do { \ if(!(vp = paircreate(n, PW_TYPE_STRING))) { \ request_free(&stopreq); \ radlog(L_ERR|L_CONS, "no memory"); \ pairfree(&(stopreq->packet->vps)); \ return 0; \ } \ strlcpy((char *)vp->vp_strvalue, v, sizeof vp->vp_strvalue); \ vp->length = strlen(v); \ pairadd(&(stopreq->packet->vps), vp); \ } while(0) INTPAIR(PW_ACCT_STATUS_TYPE, PW_STATUS_STOP); IPPAIR(PW_NAS_IP_ADDRESS, nasaddr); INTPAIR(PW_ACCT_DELAY_TIME, 0); STRINGPAIR(PW_USER_NAME, user); userpair = vp; INTPAIR(PW_NAS_PORT, port); STRINGPAIR(PW_ACCT_SESSION_ID, sessionid); if(proto == 'P') { INTPAIR(PW_SERVICE_TYPE, PW_FRAMED_USER); INTPAIR(PW_FRAMED_PROTOCOL, PW_PPP); } else if(proto == 'S') { INTPAIR(PW_SERVICE_TYPE, PW_FRAMED_USER); INTPAIR(PW_FRAMED_PROTOCOL, PW_SLIP); } else { INTPAIR(PW_SERVICE_TYPE, PW_LOGIN_USER); /* A guess, really */ } if(cliaddr != 0) IPPAIR(PW_FRAMED_IP_ADDRESS, cliaddr); INTPAIR(PW_ACCT_SESSION_TIME, session_time); INTPAIR(PW_ACCT_INPUT_OCTETS, 0); INTPAIR(PW_ACCT_OUTPUT_OCTETS, 0); INTPAIR(PW_ACCT_INPUT_PACKETS, 0); INTPAIR(PW_ACCT_OUTPUT_PACKETS, 0); stopreq->username = userpair; stopreq->password = NULL; ret = rad_accounting(stopreq); /* * We've got to clean it up by hand, because no one else will. */ request_free(&stopreq); return ret; } #ifndef __MINGW32__ /* * Check one terminal server to see if a user is logged in. * * Return values: * 0 The user is off-line. * 1 The user is logged in. * 2 Some error occured. */ int rad_check_ts(uint32_t nasaddr, unsigned int portnum, const char *user, const char *session_id) { pid_t pid, child_pid; int status; char address[16]; char port[11]; RADCLIENT *cl; fr_ipaddr_t ipaddr; ipaddr.af = AF_INET; ipaddr.ipaddr.ip4addr.s_addr = nasaddr; /* * Find NAS type. */ cl = client_find_old(&ipaddr); if (!cl) { /* * Unknown NAS, so trusting radutmp. */ DEBUG2("checkrad: Unknown NAS %s, not checking", ip_ntoa(address, nasaddr)); return 1; } /* * No nastype, or nas type 'other', trust radutmp. */ if (!cl->nastype || (cl->nastype[0] == '\0') || (strcmp(cl->nastype, "other") == 0)) { DEBUG2("checkrad: No NAS type, or type \"other\" not checking"); return 1; } /* * Fork. */ if ((pid = rad_fork()) < 0) { /* do wait for the fork'd result */ radlog(L_ERR, "Accounting: Failed in fork(): Cannot run checkrad\n"); return 2; } if (pid > 0) { child_pid = rad_waitpid(pid, &status); /* * It's taking too long. Stop waiting for it. * * Don't bother to kill it, as we don't care what * happens to it now. */ if (child_pid == 0) { radlog(L_ERR, "Check-TS: timeout waiting for checkrad"); return 2; } if (child_pid < 0) { radlog(L_ERR, "Check-TS: unknown error in waitpid()"); return 2; } return WEXITSTATUS(status); } /* * We don't close fd's 0, 1, and 2. If we're in debugging mode, * then they should go to stdout (etc), along with the other * server log messages. * * If we're not in debugging mode, then the code in radiusd.c * takes care of connecting fd's 0, 1, and 2 to /dev/null. */ closefrom(3); ip_ntoa(address, nasaddr); snprintf(port, 11, "%u", portnum); #ifdef __EMX__ /* OS/2 can't directly execute scripts then we call the command processor to execute checkrad */ execl(getenv("COMSPEC"), "", "/C","checkrad", cl->nastype, address, port, user, session_id, NULL); #else execl(mainconfig.checkrad, "checkrad", cl->nastype, address, port, user, session_id, NULL); #endif radlog(L_ERR, "Check-TS: exec %s: %s", mainconfig.checkrad, strerror(errno)); /* * Exit - 2 means "some error occured". */ exit(2); return 2; } #else int rad_check_ts(UNUSED uint32_t nasaddr, UNUSED unsigned int portnum, UNUSED const char *user, UNUSED const char *session_id) { radlog(L_ERR, "Simultaneous-Use is not supported"); return 2; } #endif #else /* WITH_SESSION_MGMT */ int session_zap(UNUSED REQUEST *request, UNUSED uint32_t nasaddr, UNUSED unsigned int port, UNUSED const char *user, UNUSED const char *sessionid, UNUSED uint32_t cliaddr, UNUSED char proto, UNUSED int session_time) { return RLM_MODULE_FAIL; } int rad_check_ts(UNUSED uint32_t nasaddr, UNUSED unsigned int portnum, UNUSED const char *user, UNUSED const char *session_id) { radlog(L_ERR, "Simultaneous-Use is not supported"); return 2; } #endif freeradius-server/src/main/soh.c000066400000000000000000000363651257552170400172100ustar00rootroot00000000000000/* * soh.c contains the interfaces that are called from eap * * Version: $Id$ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2010 Phil Mayers */ #include RCSID("$Id$") #include #include /* * This code implements parsing of MS-SOH data into FreeRadius AVPs * allowing for FreeRadius MS-NAP policies */ typedef struct { uint16_t tlv_type; /* ==7 */ uint16_t tlv_len; uint32_t tlv_vendor; /* then it's either an soh request or response */ uint16_t soh_type; /* ==2 for request, 1 for response */ uint16_t soh_len; /* an soh-response may now follow... */ } eap_soh; typedef struct { uint16_t outer_type; uint16_t outer_len; uint32_t vendor; uint16_t inner_type; uint16_t inner_len; } soh_response; typedef struct { uint16_t outer_type; uint16_t outer_len; uint32_t vendor; uint8_t corrid[24]; uint8_t intent; uint8_t content_type; } soh_mode_subheader; typedef struct { uint16_t tlv_type; uint16_t tlv_len; } soh_tlv; /* utils for pulling big-endian 2/3/4 byte integers * caller must ensure enough data exists at "p" */ uint16_t soh_pull_be_16(const uint8_t *p) { uint16_t r; r = *p++ << 8; r += *p++; return r; } uint32_t soh_pull_be_24(const uint8_t *p) { uint32_t r; r = *p++ << 16; r += *p++ << 8; r += *p++; return r; } uint32_t soh_pull_be_32(const uint8_t *p) { uint32_t r; r = *p++ << 24; r += *p++ << 16; r += *p++ << 8; r += *p++; return r; } /* * This parses the microsoft type/value (note: NOT type/length/value) data; see * section 2.2.4 of MS-SOH. Because there's no "length" field we CANNOT just skip * unknown types; we need to know their length ahead of time. Therefore, we abort * if we find an unknown type. */ static int eapsoh_mstlv(REQUEST *request, VALUE_PAIR *sohvp, const uint8_t *p, unsigned int data_len) { VALUE_PAIR *vp; uint8_t c; int t; while (data_len > 0) { c = *p++; data_len--; switch (c) { case 1: /* MS-Machine-Inventory-Packet * MS-SOH section 2.2.4.1 */ if (data_len < 18) { RDEBUG("insufficient data for MS-Machine-Inventory-Packet"); return 0; } data_len -= 18; vp = pairmake("SoH-MS-Machine-OS-vendor", "Microsoft", T_OP_EQ); if (!vp) return 0; pairadd(&sohvp, vp); vp = pairmake("SoH-MS-Machine-OS-version", NULL, T_OP_EQ); if (!vp) return 0; vp->vp_integer = soh_pull_be_32(p); p+=4; pairadd(&sohvp, vp); vp = pairmake("SoH-MS-Machine-OS-release", NULL, T_OP_EQ); if (!vp) return 0; vp->vp_integer = soh_pull_be_32(p); p+=4; pairadd(&sohvp, vp); vp = pairmake("SoH-MS-Machine-OS-build", NULL, T_OP_EQ); if (!vp) return 0; vp->vp_integer = soh_pull_be_32(p); p+=4; pairadd(&sohvp, vp); vp = pairmake("SoH-MS-Machine-SP-version", NULL, T_OP_EQ); if (!vp) return 0; vp->vp_integer = soh_pull_be_16(p); p+=2; pairadd(&sohvp, vp); vp = pairmake("SoH-MS-Machine-SP-release", NULL, T_OP_EQ); if (!vp) return 0; vp->vp_integer = soh_pull_be_16(p); p+=2; pairadd(&sohvp, vp); vp = pairmake("SoH-MS-Machine-Processor", NULL, T_OP_EQ); if (!vp) return 0; vp->vp_integer = soh_pull_be_16(p); p+=2; pairadd(&sohvp, vp); break; case 2: /* MS-Quarantine-State - FIXME: currently unhandled * MS-SOH 2.2.4.1 * * 1 byte reserved * 1 byte flags * 8 bytes NT Time field (100-nanosec since 1 Jan 1601) * 2 byte urilen * N bytes uri */ p += 10; t = soh_pull_be_16(p); /* t == uri len */ p += 2; p += t; data_len -= 12 + t; break; case 3: /* MS-Packet-Info * MS-SOH 2.2.4.3 */ RDEBUG3("SoH MS-Packet-Info %s vers=%i", *p & 0x10 ? "request" : "response", *p & 0xf); p++; data_len--; break; case 4: /* MS-SystemGenerated-Ids - FIXME: currently unhandled * MS-SOH 2.2.4.4 * * 2 byte length * N bytes (3 bytes IANA enterprise# + 1 byte component id#) */ t = soh_pull_be_16(p); p += 2; p += t; data_len -= 2 + t; break; case 5: /* MS-MachineName * MS-SOH 2.2.4.5 * * 1 byte namelen * N bytes name */ t = soh_pull_be_16(p); p += 2; vp = pairmake("SoH-MS-Machine-Name", NULL, T_OP_EQ); if (!vp) return 0; memcpy(vp->vp_strvalue, p, t); vp->vp_strvalue[t] = 0; pairadd(&sohvp, vp); p += t; data_len -= 2 + t; break; case 6: /* MS-CorrelationId * MS-SOH 2.2.4.6 * * 24 bytes opaque binary which we might, in future, have * to echo back to the client in a final SoHR */ vp = pairmake("SoH-MS-Correlation-Id", NULL, T_OP_EQ); if (!vp) return 0; memcpy(vp->vp_octets, p, 24); vp->length = 24; pairadd(&sohvp, vp); p += 24; data_len -= 24; break; case 7: /* MS-Installed-Shvs - FIXME: currently unhandled * MS-SOH 2.2.4.7 * * 2 bytes length * N bytes (3 bytes IANA enterprise# + 1 byte component id#) */ t = soh_pull_be_16(p); p += 2; p += t; data_len -= 2 + t; break; case 8: /* MS-Machine-Inventory-Ex * MS-SOH 2.2.4.8 * * 4 bytes reserved * 1 byte product type (client=1 domain_controller=2 server=3) */ p += 4; vp = pairmake("SoH-MS-Machine-Role", NULL, T_OP_EQ); if (!vp) return 0; vp->vp_integer = *p; pairadd(&sohvp, vp); p++; data_len -= 5; break; default: RDEBUG("SoH Unknown MS TV %i stopping", c); return 0; } } return 1; } static const char* clientstatus2str(uint32_t hcstatus) { switch (hcstatus) { /* this lot should all just be for windows updates */ case 0xff0005: return "wua-ok"; case 0xff0006: return "wua-missing"; case 0xff0008: return "wua-not-started"; case 0xc0ff000c: return "wua-no-wsus-server"; case 0xc0ff000d: return "wua-no-wsus-clientid"; case 0xc0ff000e: return "wua-disabled"; case 0xc0ff000f: return "wua-comm-failure"; /* these next 3 are for all health-classes */ case 0xc0ff0002: return "not-installed"; case 0xc0ff0003: return "down"; case 0xc0ff0018: return "not-started"; } return NULL; } static const char* healthclass2str(uint8_t hc) { switch (hc) { case 0: return "firewall"; case 1: return "antivirus"; case 2: return "antispyware"; case 3: return "updates"; case 4: return "security-updates"; } return NULL; } int soh_verify(REQUEST *request, VALUE_PAIR *sohvp, const uint8_t *data, unsigned int data_len) { VALUE_PAIR *vp; eap_soh hdr; soh_response resp; soh_mode_subheader mode; soh_tlv tlv; int curr_shid=-1, curr_shid_c=-1, curr_hc=-1; hdr.tlv_type = soh_pull_be_16(data); data += 2; hdr.tlv_len = soh_pull_be_16(data); data += 2; hdr.tlv_vendor = soh_pull_be_32(data); data += 4; if (hdr.tlv_type != 7 || hdr.tlv_vendor != 0x137) { RDEBUG("SoH payload is %i %08x not a ms-vendor packet", hdr.tlv_type, hdr.tlv_vendor); return -1; } hdr.soh_type = soh_pull_be_16(data); data += 2; hdr.soh_len = soh_pull_be_16(data); data += 2; if (hdr.soh_type != 1) { RDEBUG("SoH tlv %04x is not a response", hdr.soh_type); return -1; } /* FIXME: check for sufficient data */ resp.outer_type = soh_pull_be_16(data); data += 2; resp.outer_len = soh_pull_be_16(data); data += 2; resp.vendor = soh_pull_be_32(data); data += 4; resp.inner_type = soh_pull_be_16(data); data += 2; resp.inner_len = soh_pull_be_16(data); data += 2; if (resp.outer_type!=7 || resp.vendor != 0x137) { RDEBUG("SoH response outer type %i/vendor %08x not recognised", resp.outer_type, resp.vendor); return -1; } switch (resp.inner_type) { case 1: /* no mode sub-header */ RDEBUG("SoH without mode subheader"); break; case 2: mode.outer_type = soh_pull_be_16(data); data += 2; mode.outer_len = soh_pull_be_16(data); data += 2; mode.vendor = soh_pull_be_32(data); data += 4; memcpy(mode.corrid, data, 24); data += 24; mode.intent = data[0]; mode.content_type = data[1]; data += 2; if (mode.outer_type != 7 || mode.vendor != 0x137 || mode.content_type != 0) { RDEBUG3("SoH mode subheader outer type %i/vendor %08x/content type %i invalid", mode.outer_type, mode.vendor, mode.content_type); return -1; } RDEBUG3("SoH with mode subheader"); break; default: RDEBUG("SoH invalid inner type %i", resp.inner_type); return -1; } /* subtract off the relevant amount of data */ if (resp.inner_type==2) { data_len = resp.inner_len - 34; } else { data_len = resp.inner_len; } /* TLV * MS-SOH 2.2.1 * See also 2.2.3 * * 1 bit mandatory * 1 bit reserved * 14 bits tlv type * 2 bytes tlv length * N bytes payload * */ while (data_len >= 4) { tlv.tlv_type = soh_pull_be_16(data); data += 2; tlv.tlv_len = soh_pull_be_16(data); data += 2; data_len -= 4; switch (tlv.tlv_type) { case 2: /* System-Health-Id TLV * MS-SOH 2.2.3.1 * * 3 bytes IANA/SMI vendor code * 1 byte component (i.e. within vendor, which SoH component */ curr_shid = soh_pull_be_24(data); curr_shid_c = data[3]; RDEBUG2("SoH System-Health-ID vendor %08x component=%i", curr_shid, curr_shid_c); break; case 7: /* Vendor-Specific packet * MS-SOH 2.2.3.3 * * 4 bytes vendor, supposedly ignored by NAP * N bytes payload; for Microsoft component#0 this is the MS TV stuff */ if (curr_shid==0x137 && curr_shid_c==0) { RDEBUG2("SoH MS type-value payload"); eapsoh_mstlv(request, sohvp, data + 4, tlv.tlv_len - 4); } else { RDEBUG2("SoH unhandled vendor-specific TLV %08x/component=%i %i bytes payload", curr_shid, curr_shid_c, tlv.tlv_len); } break; case 8: /* Health-Class * MS-SOH 2.2.3.5.6 * * 1 byte integer */ RDEBUG2("SoH Health-Class %i", data[0]); curr_hc = data[0]; break; case 9: /* Software-Version * MS-SOH 2.2.3.5.7 * * 1 byte integer */ RDEBUG2("SoH Software-Version %i", data[0]); break; case 11: /* Health-Class status * MS-SOH 2.2.3.5.9 * * variable data; for the MS System Health vendor, these are 4-byte * integers which are a really, really dumb format: * * 28 bits ignore * 1 bit - 1==product snoozed * 1 bit - 1==microsoft product * 1 bit - 1==product up-to-date * 1 bit - 1==product enabled */ RDEBUG2("SoH Health-Class-Status - current shid=%08x component=%i", curr_shid, curr_shid_c); if (curr_shid==0x137 && curr_shid_c==128) { const char *s, *t; uint32_t hcstatus = soh_pull_be_32(data); RDEBUG2("SoH Health-Class-Status microsoft DWORD=%08x", hcstatus); vp = pairmake("SoH-MS-Windows-Health-Status", NULL, T_OP_EQ); if (!vp) return 0; switch (curr_hc) { case 4: /* security updates */ s = "security-updates"; switch (hcstatus) { case 0xff0005: snprintf(vp->vp_strvalue, sizeof(vp->vp_strvalue), "%s ok all-installed", s); break; case 0xff0006: snprintf(vp->vp_strvalue, sizeof(vp->vp_strvalue), "%s warn some-missing", s); break; case 0xff0008: snprintf(vp->vp_strvalue, sizeof(vp->vp_strvalue), "%s warn never-started", s); break; case 0xc0ff000c: snprintf(vp->vp_strvalue, sizeof(vp->vp_strvalue), "%s error no-wsus-srv", s); break; case 0xc0ff000d: snprintf(vp->vp_strvalue, sizeof(vp->vp_strvalue), "%s error no-wsus-clid", s); break; case 0xc0ff000e: snprintf(vp->vp_strvalue, sizeof(vp->vp_strvalue), "%s warn wsus-disabled", s); break; case 0xc0ff000f: snprintf(vp->vp_strvalue, sizeof(vp->vp_strvalue), "%s error comm-failure", s); break; case 0xc0ff0010: snprintf(vp->vp_strvalue, sizeof(vp->vp_strvalue), "%s warn needs-reboot", s); break; default: snprintf(vp->vp_strvalue, sizeof(vp->vp_strvalue), "%s error %08x", s, hcstatus); break; } break; case 3: /* auto updates */ s = "auto-updates"; switch (hcstatus) { case 1: snprintf(vp->vp_strvalue, sizeof(vp->vp_strvalue), "%s warn disabled", s); break; case 2: snprintf(vp->vp_strvalue, sizeof(vp->vp_strvalue), "%s ok action=check-only", s); break; case 3: snprintf(vp->vp_strvalue, sizeof(vp->vp_strvalue), "%s ok action=download", s); break; case 4: snprintf(vp->vp_strvalue, sizeof(vp->vp_strvalue), "%s ok action=install", s); break; case 5: snprintf(vp->vp_strvalue, sizeof(vp->vp_strvalue), "%s warn unconfigured", s); break; case 0xc0ff0003: snprintf(vp->vp_strvalue, sizeof(vp->vp_strvalue), "%s warn service-down", s); break; case 0xc0ff0018: snprintf(vp->vp_strvalue, sizeof(vp->vp_strvalue), "%s warn never-started", s); break; default: snprintf(vp->vp_strvalue, sizeof(vp->vp_strvalue), "%s error %08x", s, hcstatus); break; } break; default: /* other - firewall, antivirus, antispyware */ s = healthclass2str(curr_hc); if (s) { /* bah. this is vile. stupid microsoft */ if (hcstatus & 0xff000000) { /* top octet non-zero means an error * FIXME: is this always correct? MS-WSH 2.2.8 is unclear */ t = clientstatus2str(hcstatus); if (t) { snprintf(vp->vp_strvalue, sizeof(vp->vp_strvalue), "%s error %s", s, t); } else { snprintf(vp->vp_strvalue, sizeof(vp->vp_strvalue), "%s error %08x", s, hcstatus); } } else { snprintf(vp->vp_strvalue, sizeof(vp->vp_strvalue), "%s ok snoozed=%i microsoft=%i up2date=%i enabled=%i", s, hcstatus & 0x8 ? 1 : 0, hcstatus & 0x4 ? 1 : 0, hcstatus & 0x2 ? 1 : 0, hcstatus & 0x1 ? 1 : 0 ); } } else { snprintf(vp->vp_strvalue, sizeof(vp->vp_strvalue), "%i unknown %08x", curr_hc, hcstatus); } break; } } else { vp = pairmake("SoH-MS-Health-Other", NULL, T_OP_EQ); if (!vp) return 0; /* FIXME: what to do with the payload? */ snprintf(vp->vp_strvalue, sizeof(vp->vp_strvalue), "%08x/%i ?", curr_shid, curr_shid_c); } vp->length = strlen(vp->vp_strvalue); pairadd(&sohvp, vp); break; default: RDEBUG("SoH Unknown TLV %i len=%i", tlv.tlv_type, tlv.tlv_len); break; } data += tlv.tlv_len; data_len -= tlv.tlv_len; } return 0; } freeradius-server/src/main/stats.c000066400000000000000000000442551257552170400175520ustar00rootroot00000000000000/* * stats.c Internal statistics handling. * * Version: $Id$ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2008 The FreeRADIUS server project * Copyright 2008 Alan DeKok */ #include RCSID("$Id$") #include #include #ifdef WITH_STATS #define USEC (1000000) #define EMA_SCALE (100) #define PREC (USEC * EMA_SCALE) #define F_EMA_SCALE (1000000) static struct timeval start_time; static struct timeval hup_time; fr_stats_t radius_auth_stats = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; #ifdef WITH_ACCOUNTING fr_stats_t radius_acct_stats = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; #endif #ifdef WITH_PROXY fr_stats_t proxy_auth_stats = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; #ifdef WITH_ACCOUNTING fr_stats_t proxy_acct_stats = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; #endif #endif void request_stats_final(REQUEST *request) { if (request->master_state == REQUEST_COUNTED) return; if ((request->listener->type != RAD_LISTEN_NONE) && (request->listener->type != RAD_LISTEN_AUTH) && (request->listener->type != RAD_LISTEN_ACCT)) return; /* don't count statistic requests */ if (request->packet->code == PW_STATUS_SERVER) return; #undef INC_AUTH #define INC_AUTH(_x) radius_auth_stats._x++;request->listener->stats._x++;if (request->client && request->client->auth) request->client->auth->_x++; #undef INC_ACCT #define INC_ACCT(_x) radius_acct_stats._x++;request->listener->stats._x++;if (request->client && request->client->acct) request->client->acct->_x++ /* * Update the statistics. * * Note that we do NOT do this in a child thread. * Instead, we update the stats when a request is * deleted, because only the main server thread calls * this function, which makes it thread-safe. */ if (request->reply && (request->packet->code != PW_STATUS_SERVER)) switch (request->reply->code) { case PW_AUTHENTICATION_ACK: INC_AUTH(total_responses); INC_AUTH(total_access_accepts); break; case PW_AUTHENTICATION_REJECT: INC_AUTH(total_responses); INC_AUTH(total_access_rejects); break; case PW_ACCESS_CHALLENGE: INC_AUTH(total_responses); INC_AUTH(total_access_challenges); break; #ifdef WITH_ACCOUNTING case PW_ACCOUNTING_RESPONSE: INC_ACCT(total_responses); break; #endif /* * No response, it must have been a bad * authenticator. */ case 0: if (request->packet->code == PW_AUTHENTICATION_REQUEST) { if (request->reply->offset == -2) { INC_AUTH(total_bad_authenticators); } else { INC_AUTH(total_packets_dropped); } } else if (request->packet->code == PW_ACCOUNTING_REQUEST) { if (request->reply->offset == -2) { INC_ACCT(total_bad_authenticators); } else { INC_ACCT(total_packets_dropped); } } break; default: break; } #ifdef WITH_PROXY if (!request->proxy || !request->proxy_listener) goto done; /* simplifies formatting */ switch (request->proxy->code) { case PW_AUTHENTICATION_REQUEST: proxy_auth_stats.total_requests += request->num_proxied_requests; request->proxy_listener->stats.total_requests += request->num_proxied_requests; request->home_server->stats.total_requests += request->num_proxied_requests; break; #ifdef WITH_ACCOUNTING case PW_ACCOUNTING_REQUEST: proxy_acct_stats.total_requests++; request->proxy_listener->stats.total_requests += request->num_proxied_requests; request->home_server->stats.total_requests += request->num_proxied_requests; break; #endif default: break; } if (!request->proxy_reply) goto done; /* simplifies formatting */ #undef INC #define INC(_x) proxy_auth_stats._x += request->num_proxied_responses; request->proxy_listener->stats._x += request->num_proxied_responses; request->home_server->stats._x += request->num_proxied_responses; switch (request->proxy_reply->code) { case PW_AUTHENTICATION_ACK: INC(total_responses); INC(total_access_accepts); break; case PW_AUTHENTICATION_REJECT: INC(total_responses); INC(total_access_rejects); break; case PW_ACCESS_CHALLENGE: INC(total_responses); INC(total_access_challenges); break; #ifdef WITH_ACCOUNTING case PW_ACCOUNTING_RESPONSE: proxy_acct_stats.total_responses++; request->proxy_listener->stats.total_responses++; request->home_server->stats.total_responses++; break; #endif default: proxy_auth_stats.total_unknown_types++; request->proxy_listener->stats.total_unknown_types++; request->home_server->stats.total_unknown_types++; break; } done: #endif /* WITH_PROXY */ request->master_state = REQUEST_COUNTED; } typedef struct fr_stats2vp { int attribute; size_t offset; } fr_stats2vp; /* * Authentication */ static fr_stats2vp authvp[] = { { 128, offsetof(fr_stats_t, total_requests) }, { 129, offsetof(fr_stats_t, total_access_accepts) }, { 130, offsetof(fr_stats_t, total_access_rejects) }, { 131, offsetof(fr_stats_t, total_access_challenges) }, { 132, offsetof(fr_stats_t, total_responses) }, { 133, offsetof(fr_stats_t, total_dup_requests) }, { 134, offsetof(fr_stats_t, total_malformed_requests) }, { 135, offsetof(fr_stats_t, total_bad_authenticators) }, { 136, offsetof(fr_stats_t, total_packets_dropped) }, { 137, offsetof(fr_stats_t, total_unknown_types) }, { 0, 0 } }; #ifdef WITH_PROXY /* * Proxied authentication requests. */ static fr_stats2vp proxy_authvp[] = { { 138, offsetof(fr_stats_t, total_requests) }, { 139, offsetof(fr_stats_t, total_access_accepts) }, { 140, offsetof(fr_stats_t, total_access_rejects) }, { 141, offsetof(fr_stats_t, total_access_challenges) }, { 142, offsetof(fr_stats_t, total_responses) }, { 143, offsetof(fr_stats_t, total_dup_requests) }, { 144, offsetof(fr_stats_t, total_malformed_requests) }, { 145, offsetof(fr_stats_t, total_bad_authenticators) }, { 146, offsetof(fr_stats_t, total_packets_dropped) }, { 147, offsetof(fr_stats_t, total_unknown_types) }, { 0, 0 } }; #endif #ifdef WITH_ACCOUNTING /* * Accounting */ static fr_stats2vp acctvp[] = { { 148, offsetof(fr_stats_t, total_requests) }, { 149, offsetof(fr_stats_t, total_responses) }, { 150, offsetof(fr_stats_t, total_dup_requests) }, { 151, offsetof(fr_stats_t, total_malformed_requests) }, { 152, offsetof(fr_stats_t, total_bad_authenticators) }, { 153, offsetof(fr_stats_t, total_packets_dropped) }, { 154, offsetof(fr_stats_t, total_unknown_types) }, { 0, 0 } }; #ifdef WITH_PROXY static fr_stats2vp proxy_acctvp[] = { { 155, offsetof(fr_stats_t, total_requests) }, { 156, offsetof(fr_stats_t, total_responses) }, { 157, offsetof(fr_stats_t, total_dup_requests) }, { 158, offsetof(fr_stats_t, total_malformed_requests) }, { 159, offsetof(fr_stats_t, total_bad_authenticators) }, { 160, offsetof(fr_stats_t, total_packets_dropped) }, { 161, offsetof(fr_stats_t, total_unknown_types) }, { 0, 0 } }; #endif #endif static fr_stats2vp client_authvp[] = { { 128, offsetof(fr_stats_t, total_requests) }, { 129, offsetof(fr_stats_t, total_access_accepts) }, { 130, offsetof(fr_stats_t, total_access_rejects) }, { 131, offsetof(fr_stats_t, total_access_challenges) }, { 132, offsetof(fr_stats_t, total_responses) }, { 133, offsetof(fr_stats_t, total_dup_requests) }, { 134, offsetof(fr_stats_t, total_malformed_requests) }, { 135, offsetof(fr_stats_t, total_bad_authenticators) }, { 136, offsetof(fr_stats_t, total_packets_dropped) }, { 137, offsetof(fr_stats_t, total_unknown_types) }, { 0, 0 } }; #ifdef WITH_ACCOUNTING static fr_stats2vp client_acctvp[] = { { 148, offsetof(fr_stats_t, total_requests) }, { 149, offsetof(fr_stats_t, total_responses) }, { 150, offsetof(fr_stats_t, total_dup_requests) }, { 151, offsetof(fr_stats_t, total_malformed_requests) }, { 152, offsetof(fr_stats_t, total_bad_authenticators) }, { 153, offsetof(fr_stats_t, total_packets_dropped) }, { 154, offsetof(fr_stats_t, total_unknown_types) }, { 0, 0 } }; #endif #define FR2ATTR(x) ((11344 << 16) | (x)) static void request_stats_addvp(REQUEST *request, fr_stats2vp *table, fr_stats_t *stats) { int i; VALUE_PAIR *vp; for (i = 0; table[i].attribute != 0; i++) { vp = radius_paircreate(request, &request->reply->vps, FR2ATTR(table[i].attribute), PW_TYPE_INTEGER); if (!vp) continue; vp->vp_integer = *(int *)(((char *) stats) + table[i].offset); } } void request_stats_reply(REQUEST *request) { VALUE_PAIR *flag, *vp; /* * Statistics are available ONLY on a "status" port. */ rad_assert(request->packet->code == PW_STATUS_SERVER); rad_assert(request->listener->type == RAD_LISTEN_NONE); flag = pairfind(request->packet->vps, FR2ATTR(127)); if (!flag || (flag->vp_integer == 0)) return; /* * Authentication. */ if (((flag->vp_integer & 0x01) != 0) && ((flag->vp_integer & 0xc0) == 0)) { request_stats_addvp(request, authvp, &radius_auth_stats); } #ifdef WITH_ACCOUNTING /* * Accounting */ if (((flag->vp_integer & 0x02) != 0) && ((flag->vp_integer & 0xc0) == 0)) { request_stats_addvp(request, acctvp, &radius_acct_stats); } #endif #ifdef WITH_PROXY /* * Proxied authentication requests. */ if (((flag->vp_integer & 0x04) != 0) && ((flag->vp_integer & 0x20) == 0)) { request_stats_addvp(request, proxy_authvp, &proxy_auth_stats); } #ifdef WITH_ACCOUNTING /* * Proxied accounting requests. */ if (((flag->vp_integer & 0x08) != 0) && ((flag->vp_integer & 0x20) == 0)) { request_stats_addvp(request, proxy_acctvp, &proxy_acct_stats); } #endif #endif /* * Internal server statistics */ if ((flag->vp_integer & 0x10) != 0) { vp = radius_paircreate(request, &request->reply->vps, FR2ATTR(176), PW_TYPE_DATE); if (vp) vp->vp_date = start_time.tv_sec; vp = radius_paircreate(request, &request->reply->vps, FR2ATTR(177), PW_TYPE_DATE); if (vp) vp->vp_date = hup_time.tv_sec; #ifdef HAVE_PTHREAD_H int i, array[RAD_LISTEN_MAX]; thread_pool_queue_stats(array); for (i = 0; i <= RAD_LISTEN_DETAIL; i++) { vp = radius_paircreate(request, &request->reply->vps, FR2ATTR(162 + i), PW_TYPE_INTEGER); if (!vp) continue; vp->vp_integer = array[i]; } #endif } /* * For a particular client. */ if ((flag->vp_integer & 0x20) != 0) { fr_ipaddr_t ipaddr; VALUE_PAIR *server_ip, *server_port = NULL; RADCLIENT *client = NULL; RADCLIENT_LIST *cl = NULL; /* * See if we need to look up the client by server * socket. */ server_ip = pairfind(request->packet->vps, FR2ATTR(170)); if (server_ip) { server_port = pairfind(request->packet->vps, FR2ATTR(171)); if (server_port) { ipaddr.af = AF_INET; ipaddr.ipaddr.ip4addr.s_addr = server_ip->vp_ipaddr; cl = listener_find_client_list(&ipaddr, server_port->vp_integer); /* * Not found: don't do anything */ if (!cl) return; } } vp = pairfind(request->packet->vps, FR2ATTR(167)); if (vp) { ipaddr.af = AF_INET; ipaddr.ipaddr.ip4addr.s_addr = vp->vp_ipaddr; client = client_find(cl, &ipaddr); /* * Else look it up by number. */ } else if ((vp = pairfind(request->packet->vps, FR2ATTR(168))) != NULL) { client = client_findbynumber(cl, vp->vp_integer); } if (client) { /* * If found, echo it back, along with * the requested statistics. */ pairadd(&request->reply->vps, paircopyvp(vp)); /* * When retrieving client by number, also * echo back it's IP address. */ if ((vp->type == PW_TYPE_INTEGER) && (client->ipaddr.af == AF_INET)) { vp = radius_paircreate(request, &request->reply->vps, FR2ATTR(167), PW_TYPE_IPADDR); if (vp) { vp->vp_ipaddr = client->ipaddr.ipaddr.ip4addr.s_addr; } if (client->prefix != 32) { vp = radius_paircreate(request, &request->reply->vps, FR2ATTR(169), PW_TYPE_INTEGER); if (vp) { vp->vp_integer = client->prefix; } } } if (server_ip) { pairadd(&request->reply->vps, paircopyvp(server_ip)); } if (server_port) { pairadd(&request->reply->vps, paircopyvp(server_port)); } if (client->auth && ((flag->vp_integer & 0x01) != 0)) { request_stats_addvp(request, client_authvp, client->auth); } #ifdef WITH_ACCOUNTING if (client->acct && ((flag->vp_integer & 0x01) != 0)) { request_stats_addvp(request, client_acctvp, client->acct); } #endif } /* else client wasn't found, don't echo it back */ } /* * For a particular "listen" socket. */ if (((flag->vp_integer & 0x40) != 0) && ((flag->vp_integer & 0x03) != 0)) { rad_listen_t *this; VALUE_PAIR *server_ip, *server_port; fr_ipaddr_t ipaddr; /* * See if we need to look up the server by socket * socket. */ server_ip = pairfind(request->packet->vps, FR2ATTR(170)); if (!server_ip) return; server_port = pairfind(request->packet->vps, FR2ATTR(171)); if (!server_port) return; ipaddr.af = AF_INET; ipaddr.ipaddr.ip4addr.s_addr = server_ip->vp_ipaddr; this = listener_find_byipaddr(&ipaddr, server_port->vp_integer); /* * Not found: don't do anything */ if (!this) return; pairadd(&request->reply->vps, paircopyvp(server_ip)); pairadd(&request->reply->vps, paircopyvp(server_port)); if (((flag->vp_integer & 0x01) != 0) && ((request->listener->type == RAD_LISTEN_AUTH) || (request->listener->type == RAD_LISTEN_NONE))) { request_stats_addvp(request, authvp, &this->stats); } #ifdef WITH_ACCOUNTING if (((flag->vp_integer & 0x02) != 0) && ((request->listener->type == RAD_LISTEN_ACCT) || (request->listener->type == RAD_LISTEN_NONE))) { request_stats_addvp(request, acctvp, &this->stats); } #endif } #ifdef WITH_PROXY /* * Home servers. */ if (((flag->vp_integer & 0x80) != 0) && ((flag->vp_integer & 0x03) != 0)) { home_server *home; VALUE_PAIR *server_ip, *server_port; fr_ipaddr_t ipaddr; /* * See if we need to look up the server by socket * socket. */ server_ip = pairfind(request->packet->vps, FR2ATTR(170)); if (!server_ip) return; server_port = pairfind(request->packet->vps, FR2ATTR(171)); if (!server_port) return; ipaddr.af = AF_INET; ipaddr.ipaddr.ip4addr.s_addr = server_ip->vp_ipaddr; home = home_server_find(&ipaddr, server_port->vp_integer); /* * Not found: don't do anything */ if (!home) return; pairadd(&request->reply->vps, paircopyvp(server_ip)); pairadd(&request->reply->vps, paircopyvp(server_port)); vp = radius_paircreate(request, &request->reply->vps, FR2ATTR(172), PW_TYPE_INTEGER); if (vp) vp->vp_integer = home->currently_outstanding; vp = radius_paircreate(request, &request->reply->vps, FR2ATTR(173), PW_TYPE_INTEGER); if (vp) vp->vp_integer = home->state; if ((home->state == HOME_STATE_ALIVE) && (home->revive_time.tv_sec != 0)) { vp = radius_paircreate(request, &request->reply->vps, FR2ATTR(175), PW_TYPE_DATE); if (vp) vp->vp_date = home->revive_time.tv_sec; } if ((home->state == HOME_STATE_ALIVE) && (home->ema.window > 0)) { vp = radius_paircreate(request, &request->reply->vps, FR2ATTR(178), PW_TYPE_INTEGER); if (vp) vp->vp_integer = home->ema.window; vp = radius_paircreate(request, &request->reply->vps, FR2ATTR(179), PW_TYPE_INTEGER); if (vp) vp->vp_integer = home->ema.ema1 / EMA_SCALE; vp = radius_paircreate(request, &request->reply->vps, FR2ATTR(180), PW_TYPE_INTEGER); if (vp) vp->vp_integer = home->ema.ema10 / EMA_SCALE; } if (home->state == HOME_STATE_IS_DEAD) { vp = radius_paircreate(request, &request->reply->vps, FR2ATTR(174), PW_TYPE_DATE); if (vp) vp->vp_date = home->zombie_period_start.tv_sec + home->zombie_period; } if (((flag->vp_integer & 0x01) != 0) && (home->type == HOME_TYPE_AUTH)) { request_stats_addvp(request, proxy_authvp, &home->stats); } #ifdef WITH_ACCOUNTING if (((flag->vp_integer & 0x02) != 0) && (home->type == HOME_TYPE_ACCT)) { request_stats_addvp(request, proxy_acctvp, &home->stats); } #endif } #endif /* WITH_PROXY */ } void radius_stats_init(int flag) { if (!flag) { gettimeofday(&start_time, NULL); hup_time = start_time; /* it's just nicer this way */ } else { gettimeofday(&hup_time, NULL); } } void radius_stats_ema(fr_stats_ema_t *ema, struct timeval *start, struct timeval *end) { int micro; time_t tdiff; #ifdef WITH_STATS_DEBUG static int n = 0; #endif if (ema->window == 0) return; rad_assert(start->tv_sec >= end->tv_sec); /* * Initialize it. */ if (ema->f1 == 0) { if (ema->window > 10000) ema->window = 10000; ema->f1 = (2 * F_EMA_SCALE) / (ema->window + 1); ema->f10 = (2 * F_EMA_SCALE) / ((10 * ema->window) + 1); } tdiff = start->tv_sec; tdiff -= end->tv_sec; micro = (int) tdiff; if (micro > 40) micro = 40; /* don't overflow 32-bit ints */ micro *= USEC; micro += start->tv_usec; micro -= end->tv_usec; micro *= EMA_SCALE; if (ema->ema1 == 0) { ema->ema1 = micro; ema->ema10 = micro; } else { int diff; diff = ema->f1 * (micro - ema->ema1); ema->ema1 += (diff / 1000000); diff = ema->f10 * (micro - ema->ema10); ema->ema10 += (diff / 1000000); } #ifdef WITH_STATS_DEBUG DEBUG("time %d %d.%06d\t%d.%06d\t%d.%06d\n", n, micro / PREC, (micro / EMA_SCALE) % USEC, ema->ema1 / PREC, (ema->ema1 / EMA_SCALE) % USEC, ema->ema10 / PREC, (ema->ema10 / EMA_SCALE) % USEC); n++; #endif } #endif /* WITH_STATS */ freeradius-server/src/main/threads.c000066400000000000000000000715261257552170400200470ustar00rootroot00000000000000/* * threads.c request threading support * * Version: $Id$ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2000,2006 The FreeRADIUS server project * Copyright 2000 Alan DeKok */ #include RCSID("$Id$") #include #include /* * Other OS's have sem_init, OS X doesn't. */ #ifdef HAVE_SEMAPHORE_H #include #endif #ifdef DARWIN #include #include #undef sem_t #define sem_t semaphore_t #undef sem_init #define sem_init(s,p,c) semaphore_create(mach_task_self(),s,SYNC_POLICY_FIFO,c) #undef sem_wait #define sem_wait(s) semaphore_wait(*s) #undef sem_post #define sem_post(s) semaphore_signal(*s) #endif #ifdef HAVE_SYS_WAIT_H #include #endif #ifdef HAVE_PTHREAD_H #ifdef HAVE_OPENSSL_CRYPTO_H #include #endif #ifdef HAVE_OPENSSL_ERR_H #include #endif #ifdef HAVE_OPENSSL_EVP_H #include #endif #define SEMAPHORE_LOCKED (0) #define SEMAPHORE_UNLOCKED (1) #define THREAD_RUNNING (1) #define THREAD_CANCELLED (2) #define THREAD_EXITED (3) #define NUM_FIFOS RAD_LISTEN_MAX /* * A data structure which contains the information about * the current thread. * * pthread_id pthread id * thread_id server thread number, 1...number of threads * semaphore used to block the thread until a request comes in * status is the thread running or exited? * request_count the number of requests that this thread has handled * timestamp when the thread started executing. */ typedef struct THREAD_HANDLE { struct THREAD_HANDLE *prev; struct THREAD_HANDLE *next; pthread_t pthread_id; int thread_id; int status; unsigned int request_count; time_t timestamp; REQUEST *request; } THREAD_HANDLE; /* * For the request queue. */ typedef struct request_queue_t { REQUEST *request; RAD_REQUEST_FUNP fun; } request_queue_t; typedef struct thread_fork_t { pid_t pid; int status; int exited; } thread_fork_t; /* * A data structure to manage the thread pool. There's no real * need for a data structure, but it makes things conceptually * easier. */ typedef struct THREAD_POOL { THREAD_HANDLE *head; THREAD_HANDLE *tail; int active_threads; /* protected by queue_mutex */ int exited_threads; int total_threads; int max_thread_id; int start_threads; int max_threads; int min_spare_threads; int max_spare_threads; unsigned int max_requests_per_thread; unsigned long request_count; time_t time_last_spawned; int cleanup_delay; int stop_flag; int spawn_flag; #ifdef WNOHANG pthread_mutex_t wait_mutex; fr_hash_table_t *waiters; #endif /* * All threads wait on this semaphore, for requests * to enter the queue. */ sem_t semaphore; /* * To ensure only one thread at a time touches the queue. */ pthread_mutex_t queue_mutex; int max_queue_size; int num_queued; fr_fifo_t *fifo[NUM_FIFOS]; } THREAD_POOL; static THREAD_POOL thread_pool; static int pool_initialized = FALSE; static time_t last_cleaned = 0; static time_t almost_now = 0; static void thread_pool_manage(time_t now); /* * A mapping of configuration file names to internal integers */ static const CONF_PARSER thread_config[] = { { "start_servers", PW_TYPE_INTEGER, 0, &thread_pool.start_threads, "5" }, { "max_servers", PW_TYPE_INTEGER, 0, &thread_pool.max_threads, "32" }, { "min_spare_servers", PW_TYPE_INTEGER, 0, &thread_pool.min_spare_threads, "3" }, { "max_spare_servers", PW_TYPE_INTEGER, 0, &thread_pool.max_spare_threads, "10" }, { "max_requests_per_server", PW_TYPE_INTEGER, 0, &thread_pool.max_requests_per_thread, "0" }, { "cleanup_delay", PW_TYPE_INTEGER, 0, &thread_pool.cleanup_delay, "5" }, { "max_queue_size", PW_TYPE_INTEGER, 0, &thread_pool.max_queue_size, "65536" }, { NULL, -1, 0, NULL, NULL } }; #ifdef HAVE_OPENSSL_CRYPTO_H /* * If we're linking against OpenSSL, then it is the * duty of the application, if it is multithreaded, * to provide OpenSSL with appropriate thread id * and mutex locking functions * * Note: this only implements static callbacks. * OpenSSL does not use dynamic locking callbacks * right now, but may in the futiure, so we will have * to add them at some point. */ static pthread_mutex_t *ssl_mutexes = NULL; static unsigned long ssl_id_function(void) { return (unsigned long) pthread_self(); } static void ssl_locking_function(int mode, int n, const char *file, int line) { file = file; /* -Wunused */ line = line; /* -Wunused */ if (mode & CRYPTO_LOCK) { pthread_mutex_lock(&(ssl_mutexes[n])); } else { pthread_mutex_unlock(&(ssl_mutexes[n])); } } static int setup_ssl_mutexes(void) { int i; #ifdef HAVE_OPENSSL_EVP_H /* * Enable all ciphers and digests. */ OpenSSL_add_all_algorithms(); #endif ssl_mutexes = rad_malloc(CRYPTO_num_locks() * sizeof(pthread_mutex_t)); if (!ssl_mutexes) { radlog(L_ERR, "Error allocating memory for SSL mutexes!"); return 0; } for (i = 0; i < CRYPTO_num_locks(); i++) { pthread_mutex_init(&(ssl_mutexes[i]), NULL); } CRYPTO_set_id_callback(ssl_id_function); CRYPTO_set_locking_callback(ssl_locking_function); return 1; } #endif #ifdef WNOHANG /* * We don't want to catch SIGCHLD for a host of reasons. * * - exec_wait means that someone, somewhere, somewhen, will * call waitpid(), and catch the child. * * - SIGCHLD is delivered to a random thread, not the one that * forked. * * - if another thread catches the child, we have to coordinate * with the thread doing the waiting. * * - if we don't waitpid() for non-wait children, they'll be zombies, * and will hang around forever. * */ static void reap_children(void) { pid_t pid; int status; thread_fork_t mytf, *tf; pthread_mutex_lock(&thread_pool.wait_mutex); do { retry: pid = waitpid(0, &status, WNOHANG); if (pid <= 0) break; mytf.pid = pid; tf = fr_hash_table_finddata(thread_pool.waiters, &mytf); if (!tf) goto retry; tf->status = status; tf->exited = 1; } while (fr_hash_table_num_elements(thread_pool.waiters) > 0); pthread_mutex_unlock(&thread_pool.wait_mutex); } #else #define reap_children() #endif /* WNOHANG */ /* * Add a request to the list of waiting requests. * This function gets called ONLY from the main handler thread... * * This function should never fail. */ static int request_enqueue(REQUEST *request, RAD_REQUEST_FUNP fun) { request_queue_t *entry; /* * If we haven't checked the number of child threads * in a while, OR if the thread pool appears to be full, * go manage it. */ if ((last_cleaned < request->timestamp) || (thread_pool.active_threads == thread_pool.total_threads) || (thread_pool.exited_threads > 0)) { thread_pool_manage(request->timestamp); } pthread_mutex_lock(&thread_pool.queue_mutex); thread_pool.request_count++; if (thread_pool.num_queued >= thread_pool.max_queue_size) { int complain = FALSE; time_t now; static time_t last_complained = 0; now = time(NULL); if (last_complained != now) { last_complained = now; complain = TRUE; } pthread_mutex_unlock(&thread_pool.queue_mutex); /* * Mark the request as done. */ if (complain) { radlog(L_ERR, "Something is blocking the server. There are %d packets in the queue, waiting to be processed. Ignoring the new request.", thread_pool.max_queue_size); } request->child_state = REQUEST_DONE; return 0; } request->child_state = REQUEST_QUEUED; request->component = ""; request->module = ""; entry = rad_malloc(sizeof(*entry)); entry->request = request; entry->fun = fun; /* * Push the request onto the appropriate fifo for that */ if (!fr_fifo_push(thread_pool.fifo[request->priority], entry)) { pthread_mutex_unlock(&thread_pool.queue_mutex); radlog(L_ERR, "!!! ERROR !!! Failed inserting request %d into the queue", request->number); request->child_state = REQUEST_DONE; return 0; } thread_pool.num_queued++; pthread_mutex_unlock(&thread_pool.queue_mutex); /* * There's one more request in the queue. * * Note that we're not touching the queue any more, so * the semaphore post is outside of the mutex. This also * means that when the thread wakes up and tries to lock * the mutex, it will be unlocked, and there won't be * contention. */ sem_post(&thread_pool.semaphore); return 1; } /* * Remove a request from the queue. */ static int request_dequeue(REQUEST **request, RAD_REQUEST_FUNP *fun) { int blocked; RAD_LISTEN_TYPE i, start; request_queue_t *entry; reap_children(); pthread_mutex_lock(&thread_pool.queue_mutex); /* * Clear old requests from all queues. * * We only do one pass over the queue, in order to * amortize the work across the child threads. Since we * do N checks for one request de-queued, the old * requests will be quickly cleared. */ for (i = 0; i < RAD_LISTEN_MAX; i++) { entry = fr_fifo_peek(thread_pool.fifo[i]); if (!entry || (entry->request->master_state != REQUEST_STOP_PROCESSING)) { continue; } /* * This entry was marked to be stopped. Acknowledge it. */ entry = fr_fifo_pop(thread_pool.fifo[i]); rad_assert(entry != NULL); entry->request->child_state = REQUEST_DONE; thread_pool.num_queued--; free(entry); entry = NULL; } start = 0; retry: /* * Pop results from the top of the queue */ for (i = start; i < RAD_LISTEN_MAX; i++) { entry = fr_fifo_pop(thread_pool.fifo[i]); if (entry) { start = i; break; } } if (!entry) { pthread_mutex_unlock(&thread_pool.queue_mutex); *request = NULL; *fun = NULL; return 0; } rad_assert(thread_pool.num_queued > 0); thread_pool.num_queued--; *request = entry->request; *fun = entry->fun; free(entry); entry = NULL; rad_assert(*request != NULL); rad_assert((*request)->magic == REQUEST_MAGIC); rad_assert(*fun != NULL); (*request)->component = ""; (*request)->module = ""; /* * If the request has sat in the queue for too long, * kill it. * * The main clean-up code can't delete the request from * the queue, and therefore won't clean it up until we * have acknowledged it as "done". */ if ((*request)->master_state == REQUEST_STOP_PROCESSING) { (*request)->module = ""; (*request)->child_state = REQUEST_DONE; goto retry; } /* * Produce messages for people who have 10 million rows * in a database, without indexes. */ rad_assert(almost_now != 0); blocked = almost_now - (*request)->timestamp; if (blocked < 5) { blocked = 0; } else { static time_t last_complained = 0; if (last_complained != almost_now) { last_complained = almost_now; } else { blocked = 0; } } /* * The thread is currently processing a request. */ thread_pool.active_threads++; pthread_mutex_unlock(&thread_pool.queue_mutex); if (blocked) { radlog(L_ERR, "Request %u has been waiting in the processing queue for %d seconds. Check that all databases are running properly!", (*request)->number, blocked); } return 1; } /* * The main thread handler for requests. * * Wait on the semaphore until we have it, and process the request. */ static void *request_handler_thread(void *arg) { RAD_REQUEST_FUNP fun; THREAD_HANDLE *self = (THREAD_HANDLE *) arg; /* * Loop forever, until told to exit. */ do { /* * Wait to be signalled. */ DEBUG2("Thread %d waiting to be assigned a request", self->thread_id); re_wait: if (sem_wait(&thread_pool.semaphore) != 0) { /* * Interrupted system call. Go back to * waiting, but DON'T print out any more * text. */ if (errno == EINTR) { DEBUG2("Re-wait %d", self->thread_id); goto re_wait; } radlog(L_ERR, "Thread %d failed waiting for semaphore: %s: Exiting\n", self->thread_id, strerror(errno)); break; } DEBUG2("Thread %d got semaphore", self->thread_id); #ifdef HAVE_OPENSSL_ERR_H /* * Clear the error queue for the current thread. */ ERR_clear_error (); #endif /* * The server is exiting. Don't dequeue any * requests. */ if (thread_pool.stop_flag) break; /* * Try to grab a request from the queue. * * It may be empty, in which case we fail * gracefully. */ if (!request_dequeue(&self->request, &fun)) continue; self->request->thread_id = self->thread_id; self->request_count++; DEBUG2("Thread %d handling request %d, (%d handled so far)", self->thread_id, self->request->number, self->request_count); self->request->module = ""; radius_handle_request(self->request, fun); self->request = NULL; /* * Update the active threads. */ pthread_mutex_lock(&thread_pool.queue_mutex); rad_assert(thread_pool.active_threads > 0); thread_pool.active_threads--; pthread_mutex_unlock(&thread_pool.queue_mutex); /* * If the thread has handled too many requests, then make it * exit. */ if ((thread_pool.max_requests_per_thread > 0) && (self->request_count >= thread_pool.max_requests_per_thread)) { DEBUG2("Thread %d handled too many requests", self->thread_id); break; } } while (self->status != THREAD_CANCELLED); DEBUG2("Thread %d exiting...", self->thread_id); #ifdef HAVE_OPENSSL_ERR_H /* * If we linked with OpenSSL, the application * must remove the thread's error queue before * exiting to prevent memory leaks. */ ERR_remove_state(0); #endif pthread_mutex_lock(&thread_pool.queue_mutex); thread_pool.exited_threads++; pthread_mutex_unlock(&thread_pool.queue_mutex); /* * Do this as the LAST thing before exiting. */ self->request = NULL; self->status = THREAD_EXITED; return NULL; } /* * Take a THREAD_HANDLE, delete it from the thread pool and * free its resources. * * This function is called ONLY from the main server thread, * ONLY after the thread has exited. */ static void delete_thread(THREAD_HANDLE *handle) { THREAD_HANDLE *prev; THREAD_HANDLE *next; rad_assert(handle->request == NULL); DEBUG2("Deleting thread %d", handle->thread_id); prev = handle->prev; next = handle->next; rad_assert(thread_pool.total_threads > 0); thread_pool.total_threads--; /* * Remove the handle from the list. */ if (prev == NULL) { rad_assert(thread_pool.head == handle); thread_pool.head = next; } else { prev->next = next; } if (next == NULL) { rad_assert(thread_pool.tail == handle); thread_pool.tail = prev; } else { next->prev = prev; } /* * Free the handle, now that it's no longer referencable. */ free(handle); } /* * Spawn a new thread, and place it in the thread pool. * * The thread is started initially in the blocked state, waiting * for the semaphore. */ static THREAD_HANDLE *spawn_thread(time_t now) { int rcode; THREAD_HANDLE *handle; /* * Ensure that we don't spawn too many threads. */ if (thread_pool.total_threads >= thread_pool.max_threads) { DEBUG2("Thread spawn failed. Maximum number of threads (%d) already running.", thread_pool.max_threads); return NULL; } /* * Allocate a new thread handle. */ handle = (THREAD_HANDLE *) rad_malloc(sizeof(THREAD_HANDLE)); memset(handle, 0, sizeof(THREAD_HANDLE)); handle->prev = NULL; handle->next = NULL; handle->thread_id = thread_pool.max_thread_id++; handle->request_count = 0; handle->status = THREAD_RUNNING; handle->timestamp = time(NULL); /* * Create the thread joinable, so that it can be cleaned up * using pthread_join(). * * Note that the function returns non-zero on error, NOT * -1. The return code is the error, and errno isn't set. */ rcode = pthread_create(&handle->pthread_id, 0, request_handler_thread, handle); if (rcode != 0) { radlog(L_ERR, "Thread create failed: %s", strerror(rcode)); return NULL; } /* * One more thread to go into the list. */ thread_pool.total_threads++; DEBUG2("Thread spawned new child %d. Total threads in pool: %d", handle->thread_id, thread_pool.total_threads); /* * Add the thread handle to the tail of the thread pool list. */ if (thread_pool.tail) { thread_pool.tail->next = handle; handle->prev = thread_pool.tail; thread_pool.tail = handle; } else { rad_assert(thread_pool.head == NULL); thread_pool.head = thread_pool.tail = handle; } /* * Update the time we last spawned a thread. */ thread_pool.time_last_spawned = now; /* * And return the new handle to the caller. */ return handle; } /* * Temporary function to prevent server from executing a SIGHUP * until all threads are finished handling requests. This returns * the number of active threads to 'radiusd.c'. */ int total_active_threads(void) { /* * We don't acquire the mutex, so this is just an estimate. * We can't return with the lock held, so there's no point * in getting the guaranteed correct value; by the time * the caller sees it, it can be wrong again. */ return thread_pool.active_threads; } #ifdef WNOHANG static uint32_t pid_hash(const void *data) { const thread_fork_t *tf = data; return fr_hash(&tf->pid, sizeof(tf->pid)); } static int pid_cmp(const void *one, const void *two) { const thread_fork_t *a = one; const thread_fork_t *b = two; return (a->pid - b->pid); } #endif /* * Allocate the thread pool, and seed it with an initial number * of threads. * * FIXME: What to do on a SIGHUP??? */ int thread_pool_init(CONF_SECTION *cs, int *spawn_flag) { int i, rcode; CONF_SECTION *pool_cf; time_t now; now = time(NULL); rad_assert(spawn_flag != NULL); rad_assert(*spawn_flag == TRUE); rad_assert(pool_initialized == FALSE); /* not called on HUP */ pool_cf = cf_subsection_find_next(cs, NULL, "thread"); if (!pool_cf) *spawn_flag = FALSE; /* * Initialize the thread pool to some reasonable values. */ memset(&thread_pool, 0, sizeof(THREAD_POOL)); thread_pool.head = NULL; thread_pool.tail = NULL; thread_pool.total_threads = 0; thread_pool.max_thread_id = 1; thread_pool.cleanup_delay = 5; thread_pool.stop_flag = 0; thread_pool.spawn_flag = *spawn_flag; /* * Don't bother initializing the mutexes or * creating the hash tables. They won't be used. */ if (!*spawn_flag) return 0; #ifdef WNOHANG if ((pthread_mutex_init(&thread_pool.wait_mutex,NULL) != 0)) { radlog(L_ERR, "FATAL: Failed to initialize wait mutex: %s", strerror(errno)); return -1; } /* * Create the hash table of child PID's */ thread_pool.waiters = fr_hash_table_create(pid_hash, pid_cmp, free); if (!thread_pool.waiters) { radlog(L_ERR, "FATAL: Failed to set up wait hash"); return -1; } #endif if (cf_section_parse(pool_cf, NULL, thread_config) < 0) { return -1; } /* * Catch corner cases. */ if (thread_pool.min_spare_threads < 1) thread_pool.min_spare_threads = 1; if (thread_pool.max_spare_threads < 1) thread_pool.max_spare_threads = 1; if (thread_pool.max_spare_threads < thread_pool.min_spare_threads) thread_pool.max_spare_threads = thread_pool.min_spare_threads; if ((thread_pool.max_queue_size < 2) || (thread_pool.max_queue_size > 1048576)) { radlog(L_ERR, "FATAL: max_queue_size value must be in range 2-1048576"); return -1; } if (thread_pool.start_threads > thread_pool.max_threads) { radlog(L_ERR, "FATAL: start_servers (%i) must be <= max_servers (%i)", thread_pool.start_threads, thread_pool.max_threads); return -1; } /* * The pool has already been initialized. Don't spawn * new threads, and don't forget about forked children, */ if (pool_initialized) { return 0; } /* * Initialize the queue of requests. */ memset(&thread_pool.semaphore, 0, sizeof(thread_pool.semaphore)); rcode = sem_init(&thread_pool.semaphore, 0, SEMAPHORE_LOCKED); if (rcode != 0) { radlog(L_ERR, "FATAL: Failed to initialize semaphore: %s", strerror(errno)); return -1; } rcode = pthread_mutex_init(&thread_pool.queue_mutex,NULL); if (rcode != 0) { radlog(L_ERR, "FATAL: Failed to initialize queue mutex: %s", strerror(errno)); return -1; } /* * Allocate multiple fifos. */ for (i = 0; i < RAD_LISTEN_MAX; i++) { thread_pool.fifo[i] = fr_fifo_create(thread_pool.max_queue_size, NULL); if (!thread_pool.fifo[i]) { radlog(L_ERR, "FATAL: Failed to set up request fifo"); return -1; } } #ifdef HAVE_OPENSSL_CRYPTO_H /* * If we're linking with OpenSSL too, then we need * to set up the mutexes and enable the thread callbacks. */ if (!setup_ssl_mutexes()) { radlog(L_ERR, "FATAL: Failed to set up SSL mutexes"); return -1; } #endif /* * Create a number of waiting threads. * * If we fail while creating them, do something intelligent. */ for (i = 0; i < thread_pool.start_threads; i++) { if (spawn_thread(now) == NULL) { return -1; } } DEBUG2("Thread pool initialized"); pool_initialized = TRUE; return 0; } /* * Stop all threads in the pool. */ void thread_pool_stop(void) { int i; int total_threads; THREAD_HANDLE *handle; THREAD_HANDLE *next; /* * Set pool stop flag. */ thread_pool.stop_flag = 1; /* * Wakeup all threads to make them see stop flag. */ total_threads = thread_pool.total_threads; for (i = 0; i != total_threads; i++) { sem_post(&thread_pool.semaphore); } /* * Join and free all threads. */ for (handle = thread_pool.head; handle; handle = next) { next = handle->next; pthread_join(handle->pthread_id, NULL); delete_thread(handle); } } /* * Assign a new request to a free thread. * * If there isn't a free thread, then try to create a new one, * up to the configured limits. */ int thread_pool_addrequest(REQUEST *request, RAD_REQUEST_FUNP fun) { almost_now = request->timestamp; /* * We've been told not to spawn threads, so don't. */ if (!thread_pool.spawn_flag) { radius_handle_request(request, fun); #ifdef WNOHANG /* * Requests that care about child process exit * codes have already either called * rad_waitpid(), or they've given up. */ wait(NULL); #endif return 1; } /* * Add the new request to the queue. */ if (!request_enqueue(request, fun)) return 0; /* * If we haven't checked the number of child threads * in a while, OR if the thread pool appears to be full, * go manage it. */ if ((last_cleaned < almost_now) || (thread_pool.active_threads == thread_pool.total_threads)) { thread_pool_manage(almost_now); } return 1; } /* * Check the min_spare_threads and max_spare_threads. * * If there are too many or too few threads waiting, then we * either create some more, or delete some. */ static void thread_pool_manage(time_t now) { int spare; int i, total; THREAD_HANDLE *handle, *next; int active_threads; /* * Loop over the thread pool, deleting exited threads. */ for (handle = thread_pool.head; handle; handle = next) { next = handle->next; /* * Maybe we've asked the thread to exit, and it * has agreed. */ if (handle->status == THREAD_EXITED) { pthread_join(handle->pthread_id, NULL); delete_thread(handle); pthread_mutex_lock(&thread_pool.queue_mutex); thread_pool.exited_threads--; pthread_mutex_unlock(&thread_pool.queue_mutex); } } /* * We don't need a mutex lock here, as we're reading * active_threads, and not modifying it. We want a close * approximation of the number of active threads, and this * is good enough. */ active_threads = thread_pool.active_threads; spare = thread_pool.total_threads - active_threads; if (debug_flag) { static int old_total = -1; static int old_active = -1; if ((old_total != thread_pool.total_threads) || (old_active != active_threads)) { DEBUG2("Threads: total/active/spare threads = %d/%d/%d", thread_pool.total_threads, active_threads, spare); old_total = thread_pool.total_threads; old_active = active_threads; } } /* * If there are too few spare threads. Go create some more. */ if ((thread_pool.total_threads < thread_pool.max_threads) && (spare < thread_pool.min_spare_threads)) { total = thread_pool.min_spare_threads - spare; if ((total + thread_pool.total_threads) > thread_pool.max_threads) { total = thread_pool.max_threads - thread_pool.total_threads; } DEBUG2("Threads: Spawning %d spares", total); /* * Create a number of spare threads. */ for (i = 0; i < total; i++) { handle = spawn_thread(now); if (handle == NULL) { return; } } return; /* there aren't too many spare threads */ } /* * Only delete spare threads if we haven't already done * so this second. */ if (now == last_cleaned) { return; } last_cleaned = now; /* * Only delete the spare threads if sufficient time has * passed since we last created one. This helps to minimize * the amount of create/delete cycles. */ if ((now - thread_pool.time_last_spawned) < thread_pool.cleanup_delay) { return; } /* * If there are too many spare threads, delete one. * * Note that we only delete ONE at a time, instead of * wiping out many. This allows the excess servers to * be slowly reaped, just in case the load spike comes again. */ if (spare > thread_pool.max_spare_threads) { spare -= thread_pool.max_spare_threads; DEBUG2("Threads: deleting 1 spare out of %d spares", spare); /* * Walk through the thread pool, deleting the * first idle thread we come across. */ for (handle = thread_pool.head; (handle != NULL) && (spare > 0) ; handle = next) { next = handle->next; /* * If the thread is not handling a * request, but still live, then tell it * to exit. * * It will eventually wake up, and realize * it's been told to commit suicide. */ if ((handle->request == NULL) && (handle->status == THREAD_RUNNING)) { handle->status = THREAD_CANCELLED; /* * Post an extra semaphore, as a * signal to wake up, and exit. */ sem_post(&thread_pool.semaphore); spare--; break; } } } /* * Otherwise everything's kosher. There are not too few, * or too many spare threads. Exit happily. */ return; } #ifdef WNOHANG /* * Thread wrapper for fork(). */ pid_t rad_fork(void) { pid_t child_pid; if (!pool_initialized) return fork(); reap_children(); /* be nice to non-wait thingies */ if (fr_hash_table_num_elements(thread_pool.waiters) >= 1024) { return -1; } /* * Fork & save the PID for later reaping. */ pthread_mutex_lock(&thread_pool.wait_mutex); child_pid = fork(); if (child_pid > 0) { int rcode; thread_fork_t *tf; tf = rad_malloc(sizeof(*tf)); memset(tf, 0, sizeof(*tf)); tf->pid = child_pid; rcode = fr_hash_table_insert(thread_pool.waiters, tf); if (!rcode) { radlog(L_ERR, "Failed to store PID, creating what will be a zombie process %d", (int) child_pid); free(tf); } } /* * Do not unlock in child process */ if(child_pid != 0 ) { pthread_mutex_unlock(&thread_pool.wait_mutex); } /* * Return whatever we were told. */ return child_pid; } /* * Wait 10 seconds at most for a child to exit, then give up. */ pid_t rad_waitpid(pid_t pid, int *status) { int i; thread_fork_t mytf, *tf; if (!pool_initialized) return waitpid(pid, status, 0); if (pid <= 0) return -1; mytf.pid = pid; pthread_mutex_lock(&thread_pool.wait_mutex); tf = fr_hash_table_finddata(thread_pool.waiters, &mytf); pthread_mutex_unlock(&thread_pool.wait_mutex); if (!tf) return -1; for (i = 0; i < 100; i++) { reap_children(); if (tf->exited) { *status = tf->status; pthread_mutex_lock(&thread_pool.wait_mutex); fr_hash_table_delete(thread_pool.waiters, &mytf); pthread_mutex_unlock(&thread_pool.wait_mutex); return pid; } usleep(100000); /* sleep for 1/10 of a second */ } /* * 10 seconds have passed, give up on the child. */ pthread_mutex_lock(&thread_pool.wait_mutex); fr_hash_table_delete(thread_pool.waiters, &mytf); pthread_mutex_unlock(&thread_pool.wait_mutex); return 0; } #else /* * No rad_fork or rad_waitpid */ #endif void thread_pool_lock(void) { pthread_mutex_lock(&thread_pool.queue_mutex); } void thread_pool_unlock(void) { pthread_mutex_unlock(&thread_pool.queue_mutex); } void thread_pool_queue_stats(int *array) { int i; if (pool_initialized) { for (i = 0; i < RAD_LISTEN_MAX; i++) { array[i] = fr_fifo_num_elements(thread_pool.fifo[i]); } } else { for (i = 0; i < RAD_LISTEN_MAX; i++) { array[i] = 0; } } } #endif /* HAVE_PTHREAD_H */ freeradius-server/src/main/util.c000066400000000000000000000442701257552170400173660ustar00rootroot00000000000000/* * util.c Various utility functions. * * Version: $Id$ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2000,2006 The FreeRADIUS server project */ #include RCSID("$Id$") #include #include #include #include #include #include /* * The signal() function in Solaris 2.5.1 sets SA_NODEFER in * sa_flags, which causes grief if signal() is called in the * handler before the cause of the signal has been cleared. * (Infinite recursion). * * The same problem appears on HPUX, so we avoid it, if we can. * * Using sigaction() to reset the signal handler fixes the problem, * so where available, we prefer that solution. */ void (*reset_signal(int signo, void (*func)(int)))(int) { #ifdef HAVE_SIGACTION struct sigaction act, oact; memset(&act, 0, sizeof(act)); act.sa_handler = func; sigemptyset(&act.sa_mask); act.sa_flags = 0; #ifdef SA_INTERRUPT /* SunOS */ act.sa_flags |= SA_INTERRUPT; #endif if (sigaction(signo, &act, &oact) < 0) return SIG_ERR; return oact.sa_handler; #else /* * re-set by calling the 'signal' function, which * may cause infinite recursion and core dumps due to * stack growth. * * However, the system is too dumb to implement sigaction(), * so we don't have a choice. */ signal(signo, func); return NULL; #endif } /* * Per-request data, added by modules... */ struct request_data_t { request_data_t *next; void *unique_ptr; int unique_int; void *opaque; void (*free_opaque)(void *); }; /* * Add opaque data (with a "free" function) to a REQUEST. * * The unique ptr is meant to be a malloc'd module configuration, * and the unique integer allows the caller to have multiple * opaque data associated with a REQUEST. */ int request_data_add(REQUEST *request, void *unique_ptr, int unique_int, void *opaque, void (*free_opaque)(void *)) { request_data_t *this, **last, *next; /* * Some simple sanity checks. */ if (!request || !opaque) return -1; this = next = NULL; for (last = &(request->data); *last != NULL; last = &((*last)->next)) { if (((*last)->unique_ptr == unique_ptr) && ((*last)->unique_int == unique_int)) { this = *last; next = this->next; if (this->opaque && /* free it, if necessary */ this->free_opaque) this->free_opaque(this->opaque); break; /* replace the existing entry */ } } if (!this) this = rad_malloc(sizeof(*this)); memset(this, 0, sizeof(*this)); this->next = next; this->unique_ptr = unique_ptr; this->unique_int = unique_int; this->opaque = opaque; this->free_opaque = free_opaque; *last = this; return 0; } /* * Get opaque data from a request. */ void *request_data_get(REQUEST *request, void *unique_ptr, int unique_int) { request_data_t **last; if (!request) return NULL; for (last = &(request->data); *last != NULL; last = &((*last)->next)) { if (((*last)->unique_ptr == unique_ptr) && ((*last)->unique_int == unique_int)) { request_data_t *this = *last; void *ptr = this->opaque; /* * Remove the entry from the list, and free it. */ *last = this->next; free(this); return ptr; /* don't free it, the caller does that */ } } return NULL; /* wasn't found, too bad... */ } /* * Get opaque data from a request without removing it. */ void *request_data_reference(REQUEST *request, void *unique_ptr, int unique_int) { request_data_t **last; for (last = &(request->data); *last != NULL; last = &((*last)->next)) { if (((*last)->unique_ptr == unique_ptr) && ((*last)->unique_int == unique_int)) { request_data_t *this = *last; void *ptr = this->opaque; return ptr; } } return NULL; /* wasn't found, too bad... */ } /* * Free a REQUEST struct. */ void request_free(REQUEST **request_ptr) { REQUEST *request; if ((request_ptr == NULL) || !*request_ptr) return; request = *request_ptr; rad_assert(!request->in_request_hash); #ifdef WITH_PROXY rad_assert(!request->in_proxy_hash); #endif rad_assert(!request->ev); if (request->packet) rad_free(&request->packet); #ifdef WITH_PROXY if (request->proxy) rad_free(&request->proxy); #endif if (request->reply) rad_free(&request->reply); #ifdef WITH_PROXY if (request->proxy_reply) rad_free(&request->proxy_reply); #endif if (request->config_items) pairfree(&request->config_items); request->username = NULL; request->password = NULL; if (request->data) { request_data_t *this, *next; for (this = request->data; this != NULL; this = next) { next = this->next; if (this->opaque && /* free it, if necessary */ this->free_opaque) this->free_opaque(this->opaque); free(this); } request->data = NULL; } if (request->root && (request->root->refcount > 0)) { request->root->refcount--; request->root = NULL; } #ifdef WITH_COA if (request->coa) { request->coa->parent = NULL; rad_assert(request->coa->ev == NULL); request_free(&request->coa); } if (request->parent && (request->parent->coa == request)) { request->parent->coa = NULL; } #endif #ifndef NDEBUG request->magic = 0x01020304; /* set the request to be nonsense */ #endif request->client = NULL; #ifdef WITH_PROXY request->home_server = NULL; #endif free(request); *request_ptr = NULL; } /* * Check a filename for sanity. * * Allow only uppercase/lowercase letters, numbers, and '-_/.' */ int rad_checkfilename(const char *filename) { if (strspn(filename, "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_/.") == strlen(filename)) { return 0; } return -1; } /* * Create possibly many directories. * * Note that the input directory name is NOT a constant! * This is so that IF an error is returned, the 'directory' ptr * points to the name of the file which caused the error. */ int rad_mkdir(char *directory, int mode) { int rcode; char *p; struct stat st; /* * If the directory exists, don't do anything. */ if (stat(directory, &st) == 0) { return 0; } /* * Look for the LAST directory name. Try to create that, * failing on any error. */ p = strrchr(directory, FR_DIR_SEP); if (p != NULL) { *p = '\0'; rcode = rad_mkdir(directory, mode); /* * On error, we leave the directory name as the * one which caused the error. */ if (rcode < 0) { return rcode; } /* * Reset the directory delimiter, and go ask * the system to make the directory. */ *p = FR_DIR_SEP; } else { return 0; } /* * Having done everything successfully, we do the * system call to actually go create the directory. */ return mkdir(directory, mode); } /** Escapes the raw string such that it should be safe to use as part of a file path * * This function is designed to produce a string that's still readable but portable * across the majority of file systems. * * For security reasons it cannot remove characters from the name, and must not allow * collisions to occur between different strings. * * With that in mind '-' has been chosen as the escape character, and will be double * escaped '-' -> '--' to avoid collisions. * * Escaping should be reversible if the original string needs to be extracted. * * @note function takes additional arguments so that it may be used as an xlat escape * function but it's fine to call it directly. * * @note OSX/Unix/NTFS/VFAT/vfat have a max filename size of 255 bytes. * * @param request Current request (may be NULL). * @param out Output buffer. * @param outlen Size of the output buffer. * @param in string to escape. * @param arg Context arguments (unused, should be NULL). */ size_t rad_filename_escape(char *out, size_t outlen, char const *in) { size_t freespace = outlen; while (in[0]) { size_t utf8_len; /* * Encode multibyte UTF8 chars */ utf8_len = fr_utf8_char((uint8_t const *) in); if (utf8_len > 1) { if (freespace <= (utf8_len * 3)) break; switch (utf8_len) { case 2: snprintf(out, freespace, "-%x-%x", in[0], in[1]); break; case 3: snprintf(out, freespace, "-%x-%x-%x", in[0], in[1], in[2]); break; case 4: snprintf(out, freespace, "-%x-%x-%x-%x", in[0], in[1], in[2], in[3]); break; } freespace -= (utf8_len * 3); out += (utf8_len * 3); in += utf8_len; continue; } /* * Safe chars */ if (((in[0] >= 'A') && (in[0] <= 'Z')) || ((in[0] >= 'a') && (in[0] <= 'z')) || ((in[0] >= '0') && (in[0] <= '9')) || (in[0] == '_') || (in[0] == '.')) { if (freespace <= 1) break; *out++ = *in; in++; freespace--; continue; } if (freespace <= 2) break; /* * Double escape '-' (like \\) */ if (in[0] == '-') { *out++ = '-'; *out++ = '-'; freespace -= 2; in++; continue; } /* * Unsafe chars */ *out++ = '-'; fr_bin2hex((uint8_t *)in++, out, 1); out += 2; freespace -= 3; } *out = '\0'; return outlen - freespace; } /* * Module malloc() call, which does stuff if the malloc fails. * * This call ALWAYS succeeds! */ void *rad_malloc(size_t size) { void *ptr = malloc(size); if (ptr == NULL) { radlog(L_ERR|L_CONS, "no memory"); exit(1); } return ptr; } /* * Logs an error message and aborts the program * */ void NEVER_RETURNS rad_assert_fail (const char *file, unsigned int line, const char *expr) { radlog(L_ERR, "ASSERT FAILED %s[%u]: %s", file, line, expr); abort(); } /* * Create a new REQUEST data structure. */ REQUEST *request_alloc(void) { REQUEST *request; request = rad_malloc(sizeof(REQUEST)); memset(request, 0, sizeof(REQUEST)); #ifndef NDEBUG request->magic = REQUEST_MAGIC; #endif #ifdef WITH_PROXY request->proxy = NULL; #endif request->reply = NULL; #ifdef WITH_PROXY request->proxy_reply = NULL; #endif request->config_items = NULL; request->username = NULL; request->password = NULL; request->timestamp = time(NULL); request->options = RAD_REQUEST_OPTION_NONE; request->module = ""; request->component = ""; if (debug_flag) request->radlog = radlog_request; return request; } /* * Create a new REQUEST, based on an old one. * * This function allows modules to inject fake requests * into the server, for tunneled protocols like TTLS & PEAP. */ REQUEST *request_alloc_fake(REQUEST *request) { REQUEST *fake; fake = request_alloc(); fake->number = request->number; #ifdef HAVE_PTHREAD_H fake->thread_id = request->thread_id; #endif fake->parent = request; fake->root = request->root; fake->client = request->client; /* * For new server support. * * FIXME: Key instead off of a "virtual server" data structure. * * FIXME: Permit different servers for inner && outer sessions? */ fake->server = request->server; fake->packet = rad_alloc(1); if (!fake->packet) { request_free(&fake); return NULL; } fake->reply = rad_alloc(0); if (!fake->reply) { request_free(&fake); return NULL; } fake->master_state = REQUEST_ACTIVE; fake->child_state = REQUEST_RUNNING; /* * Fill in the fake request. */ fake->packet->sockfd = -1; fake->packet->src_ipaddr = request->packet->src_ipaddr; fake->packet->src_port = request->packet->src_port; fake->packet->dst_ipaddr = request->packet->dst_ipaddr; fake->packet->dst_port = 0; /* * This isn't STRICTLY required, as the fake request MUST NEVER * be put into the request list. However, it's still reasonable * practice. */ fake->packet->id = fake->number & 0xff; fake->packet->code = request->packet->code; fake->timestamp = request->timestamp; /* * Required for new identity support */ fake->listener = request->listener; /* * Fill in the fake reply, based on the fake request. */ fake->reply->sockfd = fake->packet->sockfd; fake->reply->src_ipaddr = fake->packet->dst_ipaddr; fake->reply->src_port = fake->packet->dst_port; fake->reply->dst_ipaddr = fake->packet->src_ipaddr; fake->reply->dst_port = fake->packet->src_port; fake->reply->id = fake->packet->id; fake->reply->code = 0; /* UNKNOWN code */ /* * Copy debug information. */ fake->options = request->options; fake->radlog = request->radlog; return fake; } #ifdef WITH_COA REQUEST *request_alloc_coa(REQUEST *request) { if (!request || request->coa) return NULL; /* * Originate CoA requests only when necessary. */ if ((request->packet->code != PW_AUTHENTICATION_REQUEST) && (request->packet->code != PW_ACCOUNTING_REQUEST)) return NULL; request->coa = request_alloc_fake(request); request->coa->packet->code = 0; /* unknown, as of yet */ request->coa->child_state = REQUEST_RUNNING; request->coa->proxy = rad_alloc(0); return request->coa; } #endif /* * Copy a quoted string. */ int rad_copy_string(char *to, const char *from) { int length = 0; char quote = *from; do { if (*from == '\\') { *(to++) = *(from++); length++; } *(to++) = *(from++); length++; } while (*from && (*from != quote)); if (*from != quote) return -1; /* not properly quoted */ *(to++) = quote; length++; *to = '\0'; return length; } /* * Copy a quoted string but without the quotes. The length * returned is the number of chars written; the number of * characters consumed is 2 more than this. */ int rad_copy_string_bare(char *to, const char *from) { int length = 0; char quote = *from; from++; while (*from && (*from != quote)) { if (*from == '\\') { *(to++) = *(from++); length++; } *(to++) = *(from++); length++; } if (*from != quote) return -1; /* not properly quoted */ *to = '\0'; return length; } /* * Copy a %{} string. */ int rad_copy_variable(char *to, const char *from) { int length = 0; int sublen; *(to++) = *(from++); length++; while (*from) { switch (*from) { case '"': case '\'': sublen = rad_copy_string(to, from); if (sublen < 0) return sublen; from += sublen; to += sublen; length += sublen; break; case '}': /* end of variable expansion */ *(to++) = *(from++); *to = '\0'; length++; return length; /* proper end of variable */ case '\\': *(to++) = *(from++); *(to++) = *(from++); length += 2; break; case '%': /* start of variable expansion */ if (from[1] == '{') { *(to++) = *(from++); length++; sublen = rad_copy_variable(to, from); if (sublen < 0) return sublen; from += sublen; to += sublen; length += sublen; break; } /* else FIXME: catch %%{ ?*/ /* FALL-THROUGH */ default: *(to++) = *(from++); length++; break; } } /* loop over the input string */ /* * We ended the string before a trailing '}' */ return -1; } /* * Split a string into words, xlat each one and write into argv array. * Return argc or -1 on failure. */ int rad_expand_xlat(REQUEST *request, const char *cmd, int max_argc, const char *argv[], int can_fail, size_t argv_buflen, char *argv_buf) { const char *from; char *to; int argc = -1; int i; int left; if (strlen(cmd) > (argv_buflen - 1)) { radlog(L_ERR|L_CONS, "rad_expand_xlat: Command line is too long"); return -1; } /* * Check for bad escapes. */ if (cmd[strlen(cmd) - 1] == '\\') { radlog(L_ERR|L_CONS, "rad_expand_xlat: Command line has final backslash, without a following character"); return -1; } strlcpy(argv_buf, cmd, argv_buflen); /* * Split the string into argv's BEFORE doing radius_xlat... */ from = cmd; to = argv_buf; argc = 0; while (*from) { int length; /* * Skip spaces. */ if ((*from == ' ') || (*from == '\t')) { from++; continue; } argv[argc] = to; argc++; if (argc >= (max_argc - 1)) break; /* * Copy the argv over to our buffer. */ while (*from && (*from != ' ') && (*from != '\t')) { if (to >= argv_buf + argv_buflen - 1) { radlog(L_ERR|L_CONS, "rad_expand_xlat: Ran out of space in command line"); return -1; } switch (*from) { case '"': case '\'': length = rad_copy_string_bare(to, from); if (length < 0) { radlog(L_ERR|L_CONS, "rad_expand_xlat: Invalid string passed as argument"); return -1; } from += length+2; to += length; break; case '%': if (from[1] == '{') { *(to++) = *(from++); length = rad_copy_variable(to, from); if (length < 0) { radlog(L_ERR|L_CONS, "rad_expand_xlat: Invalid variable expansion passed as argument"); return -1; } from += length; to += length; } else { /* FIXME: catch %%{ ? */ *(to++) = *(from++); } break; case '\\': if (from[1] == ' ') from++; /* FALL-THROUGH */ default: *(to++) = *(from++); } } /* end of string, or found a space */ *(to++) = '\0'; /* terminate the string */ } /* * We have to have SOMETHING, at least. */ if (argc <= 0) { radlog(L_ERR, "rad_expand_xlat: Empty command line."); return -1; } /* * Expand each string, as appropriate. */ left = argv_buf + argv_buflen - to; for (i = 0; i < argc; i++) { int sublen; /* * Don't touch argv's which won't be translated. */ if (strchr(argv[i], '%') == NULL) continue; if (!request) continue; sublen = radius_xlat(to, left - 1, argv[i], request, NULL); if (sublen <= 0) { if (can_fail) { /* * Fail to be backwards compatible. * * It's yucky, but it won't break anything, * and it won't cause security problems. */ sublen = 0; } else { radlog(L_ERR, "rad_expand_xlat: xlat failed"); return -1; } } argv[i] = to; to += sublen; *(to++) = '\0'; left -= sublen; left--; if (left <= 0) { radlog(L_ERR, "rad_expand_xlat: Ran out of space while expanding arguments."); return -1; } } argv[argc] = NULL; return argc; } freeradius-server/src/main/valuepair.c000066400000000000000000000373241257552170400204030ustar00rootroot00000000000000/* * valuepair.c Valuepair functions that are radiusd-specific * and as such do not belong in the library. * * Version: $Id$ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2000,2006 The FreeRADIUS server project * Copyright 2000 Alan DeKok */ #include RCSID("$Id$") #include #include #ifdef HAVE_REGEX_H # include /* * For POSIX Regular expressions. * (0) Means no extended regular expressions. * REG_EXTENDED means use extended regular expressions. */ #ifndef REG_EXTENDED #define REG_EXTENDED (0) #endif #ifndef REG_NOSUB #define REG_NOSUB (0) #endif #endif struct cmp { int attribute; int otherattr; void *instance; /* module instance */ RAD_COMPARE_FUNC compare; struct cmp *next; }; static struct cmp *cmp; int radius_compare_vps(REQUEST *request, VALUE_PAIR *check, VALUE_PAIR *vp) { int ret = -2; /* * Check for =* and !* and return appropriately */ if( check->operator == T_OP_CMP_TRUE ) return 0; if( check->operator == T_OP_CMP_FALSE ) return 1; #ifdef HAVE_REGEX_H if (check->operator == T_OP_REG_EQ) { int i, compare; regex_t reg; char name[1024]; char value[1024]; regmatch_t rxmatch[REQUEST_MAX_REGEX + 1]; snprintf(name, sizeof(name), "%%{%s}", check->name); radius_xlat(value, sizeof(value), name, request, NULL); /* * Include substring matches. */ compare = regcomp(®, check->vp_strvalue, REG_EXTENDED); if (compare != 0) { char buffer[256]; regerror(compare, ®, buffer, sizeof(buffer)); RDEBUG("Invalid regular expression %s: %s", check->vp_strvalue, buffer); return -1; } compare = regexec(®, value, REQUEST_MAX_REGEX + 1, rxmatch, 0); regfree(®); /* * Add %{0}, %{1}, etc. */ for (i = 0; i <= REQUEST_MAX_REGEX; i++) { char *p; char buffer[sizeof(check->vp_strvalue)]; /* * Didn't match: delete old * match, if it existed. */ if ((compare != 0) || (rxmatch[i].rm_so == -1)) { p = request_data_get(request, request, REQUEST_DATA_REGEX | i); if (p) { free(p); continue; } /* * No previous match * to delete, stop. */ break; } /* * Copy substring into buffer. */ memcpy(buffer, value + rxmatch[i].rm_so, rxmatch[i].rm_eo - rxmatch[i].rm_so); buffer[rxmatch[i].rm_eo - rxmatch[i].rm_so] = '\0'; /* * Copy substring, and add it to * the request. * * Note that we don't check * for out of memory, which is * the only error we can get... */ p = strdup(buffer); request_data_add(request, request, REQUEST_DATA_REGEX | i, p, free); } if (compare == 0) return 0; return -1; } if (check->operator == T_OP_REG_NE) { int compare; regex_t reg; char name[1024]; char value[1024]; regmatch_t rxmatch[REQUEST_MAX_REGEX + 1]; snprintf(name, sizeof(name), "%%{%s}", check->name); radius_xlat(value, sizeof(value), name, request, NULL); /* * Include substring matches. */ compare = regcomp(®, (char *)check->vp_strvalue, REG_EXTENDED); if (compare != 0) { char buffer[256]; regerror(compare, ®, buffer, sizeof(buffer)); RDEBUG("Invalid regular expression %s: %s", check->vp_strvalue, buffer); return -1; } compare = regexec(®, value, REQUEST_MAX_REGEX + 1, rxmatch, 0); regfree(®); if (compare != 0) return 0; return -1; } #endif /* * Tagged attributes are equal if and only if both the * tag AND value match. */ if (check->flags.has_tag) { ret = ((int) vp->flags.tag) - ((int) check->flags.tag); if (ret != 0) return ret; } /* * Not a regular expression, compare the types. */ switch(check->type) { #ifdef ASCEND_BINARY /* * Ascend binary attributes can be treated * as opaque objects, I guess... */ case PW_TYPE_ABINARY: #endif case PW_TYPE_OCTETS: if (vp->length != check->length) { ret = 1; /* NOT equal */ break; } ret = memcmp(vp->vp_strvalue, check->vp_strvalue, vp->length); break; case PW_TYPE_STRING: ret = strcmp((char *)vp->vp_strvalue, (char *)check->vp_strvalue); break; case PW_TYPE_BYTE: case PW_TYPE_SHORT: case PW_TYPE_INTEGER: ret = vp->vp_integer - check->vp_integer; break; case PW_TYPE_DATE: ret = vp->vp_date - check->vp_date; break; case PW_TYPE_IPADDR: ret = ntohl(vp->vp_ipaddr) - ntohl(check->vp_ipaddr); break; case PW_TYPE_IPV6ADDR: ret = memcmp(&vp->vp_ipv6addr, &check->vp_ipv6addr, sizeof(vp->vp_ipv6addr)); break; case PW_TYPE_IPV6PREFIX: ret = memcmp(&vp->vp_ipv6prefix, &check->vp_ipv6prefix, sizeof(vp->vp_ipv6prefix)); break; case PW_TYPE_IFID: ret = memcmp(&vp->vp_ifid, &check->vp_ifid, sizeof(vp->vp_ifid)); break; default: break; } return ret; } /* * Compare 2 attributes. May call the attribute compare function. */ int radius_callback_compare(REQUEST *req, VALUE_PAIR *request, VALUE_PAIR *check, VALUE_PAIR *check_pairs, VALUE_PAIR **reply_pairs) { struct cmp *c; /* * Check for =* and !* and return appropriately */ if( check->operator == T_OP_CMP_TRUE ) return 0; /* always return 0/EQUAL */ if( check->operator == T_OP_CMP_FALSE ) return 1; /* always return 1/NOT EQUAL */ /* * See if there is a special compare function. * * FIXME: use new RB-Tree code. */ for (c = cmp; c; c = c->next) if (c->attribute == check->attribute) { return (c->compare)(c->instance, req, request, check, check_pairs, reply_pairs); } if (!request) return -1; /* doesn't exist, don't compare it */ return radius_compare_vps(req, check, request); } /* * Find a comparison function for two attributes. */ int radius_find_compare(int attribute) { struct cmp *c; for (c = cmp; c; c = c->next) { if (c->attribute == attribute) { return TRUE; } } return FALSE; } /* * See what attribute we want to compare with. */ static int otherattr(int attr) { struct cmp *c; for (c = cmp; c; c = c->next) { if (c->attribute == attr) return c->otherattr; } return attr; } /* * Register a function as compare function. * compare_attr is the attribute in the request we want to * compare with. Normally this is the same as "attr". * You can set this to: * * -1 the same as "attr" * 0 always call compare function, not tied to request attribute * >0 Attribute to compare with. * * For example, PW_GROUP in a check item needs to be compared * with PW_USER_NAME in the incoming request. */ int paircompare_register(int attr, int compare_attr, RAD_COMPARE_FUNC fun, void *instance) { struct cmp *c; paircompare_unregister(attr, fun); c = rad_malloc(sizeof(struct cmp)); c->compare = fun; c->attribute = attr; c->otherattr = compare_attr; c->instance = instance; c->next = cmp; cmp = c; return 0; } /* * Unregister a function. */ void paircompare_unregister(int attr, RAD_COMPARE_FUNC fun) { struct cmp *c, *last; last = NULL; for (c = cmp; c; c = c->next) { if (c->attribute == attr && c->compare == fun) break; last = c; } if (c == NULL) return; if (last != NULL) last->next = c->next; else cmp = c->next; free(c); } /* * Compare two pair lists except for the password information. * For every element in "check" at least one matching copy must * be present in "reply". * * Return 0 on match. */ int paircompare(REQUEST *req, VALUE_PAIR *request, VALUE_PAIR *check, VALUE_PAIR **reply) { VALUE_PAIR *check_item; VALUE_PAIR *auth_item; int result = 0; int compare; int other; for (check_item = check; check_item != NULL; check_item = check_item->next) { /* * If the user is setting a configuration value, * then don't bother comparing it to any attributes * sent to us by the user. It ALWAYS matches. */ if ((check_item->operator == T_OP_SET) || (check_item->operator == T_OP_ADD)) { continue; } switch (check_item->attribute) { /* * Attributes we skip during comparison. * These are "server" check items. */ case PW_CRYPT_PASSWORD: case PW_AUTH_TYPE: case PW_AUTZ_TYPE: case PW_ACCT_TYPE: case PW_SESSION_TYPE: case PW_STRIP_USER_NAME: continue; break; /* * IF the password attribute exists, THEN * we can do comparisons against it. If not, * then the request did NOT contain a * User-Password attribute, so we CANNOT do * comparisons against it. * * This hack makes CHAP-Password work.. */ case PW_USER_PASSWORD: if (check_item->operator == T_OP_CMP_EQ) { DEBUG("WARNING: Found User-Password == \"...\"."); DEBUG("WARNING: Are you sure you don't mean Cleartext-Password?"); DEBUG("WARNING: See \"man rlm_pap\" for more information."); } if (pairfind(request, PW_USER_PASSWORD) == NULL) { continue; } break; } /* * See if this item is present in the request. */ other = otherattr(check_item->attribute); auth_item = request; try_again: if (other >= 0) { for (; auth_item != NULL; auth_item = auth_item->next) { if (auth_item->attribute == other || other == 0) break; } } /* * Not found, it's not a match. */ if (auth_item == NULL) { /* * Didn't find it. If we were *trying* * to not find it, then we succeeded. */ if (check_item->operator == T_OP_CMP_FALSE) continue; else return -1; } /* * Else we found it, but we were trying to not * find it, so we failed. */ if (check_item->operator == T_OP_CMP_FALSE) return -1; /* * We've got to xlat the string before doing * the comparison. */ if (check_item->flags.do_xlat) { int rcode; char buffer[sizeof(check_item->vp_strvalue)]; check_item->flags.do_xlat = 0; rcode = radius_xlat(buffer, sizeof(buffer), check_item->vp_strvalue, req, NULL); /* * Parse the string into a new value. */ pairparsevalue(check_item, buffer); } /* * OK it is present now compare them. */ compare = radius_callback_compare(req, auth_item, check_item, check, reply); switch (check_item->operator) { case T_OP_EQ: default: radlog(L_INFO, "Invalid operator for item %s: " "reverting to '=='", check_item->name); /*FALLTHRU*/ case T_OP_CMP_TRUE: /* compare always == 0 */ case T_OP_CMP_FALSE: /* compare always == 1 */ case T_OP_CMP_EQ: if (compare != 0) result = -1; break; case T_OP_NE: if (compare == 0) result = -1; break; case T_OP_LT: if (compare >= 0) result = -1; break; case T_OP_GT: if (compare <= 0) result = -1; break; case T_OP_LE: if (compare > 0) result = -1; break; case T_OP_GE: if (compare < 0) result = -1; break; #ifdef HAVE_REGEX_H case T_OP_REG_EQ: case T_OP_REG_NE: if (compare != 0) result = -1; break; #endif } /* switch over the operator of the check item */ /* * This attribute didn't match, but maybe there's * another of the same attribute, which DOES match. */ if ((result != 0) && (other >= 0)) { auth_item = auth_item->next; result = 0; goto try_again; } } /* for every entry in the check item list */ return result; } /* * Move pairs, replacing/over-writing them, and doing xlat. */ /* * Move attributes from one list to the other * if not already present. */ void pairxlatmove(REQUEST *req, VALUE_PAIR **to, VALUE_PAIR **from) { VALUE_PAIR **tailto, *i, *j, *next; VALUE_PAIR *tailfrom = NULL; VALUE_PAIR *found; /* * Point "tailto" to the end of the "to" list. */ tailto = to; for(i = *to; i; i = i->next) { tailto = &i->next; } /* * Loop over the "from" list. */ for(i = *from; i; i = next) { next = i->next; /* * Don't move 'fallthrough' over. */ if (i->attribute == PW_FALL_THROUGH) { tailfrom = i; continue; } /* * We've got to xlat the string before moving * it over. */ if (i->flags.do_xlat) { int rcode; char buffer[sizeof(i->vp_strvalue)]; i->flags.do_xlat = 0; rcode = radius_xlat(buffer, sizeof(buffer), i->vp_strvalue, req, NULL); /* * Parse the string into a new value. */ pairparsevalue(i, buffer); } found = pairfind(*to, i->attribute); switch (i->operator) { /* * If a similar attribute is found, * delete it. */ case T_OP_SUB: /* -= */ if (found) { if (!i->vp_strvalue[0] || (strcmp((char *)found->vp_strvalue, (char *)i->vp_strvalue) == 0)){ pairdelete(to, found->attribute); /* * 'tailto' may have been * deleted... */ tailto = to; for(j = *to; j; j = j->next) { tailto = &j->next; } } } tailfrom = i; continue; break; /* * Add it, if it's not already there. */ case T_OP_EQ: /* = */ if (found) { tailfrom = i; continue; /* with the loop */ } break; /* * If a similar attribute is found, * replace it with the new one. Otherwise, * add the new one to the list. */ case T_OP_SET: /* := */ if (found) { VALUE_PAIR *vp; vp = found->next; memcpy(found, i, sizeof(*found)); found->next = vp; tailfrom = i; continue; } break; /* * FIXME: Add support for <=, >=, <, > * * which will mean (for integers) * 'make the attribute the smaller, etc' */ /* * Add the new element to the list, even * if similar ones already exist. */ default: case T_OP_ADD: /* += */ break; } if (tailfrom) tailfrom->next = next; else *from = next; /* * If ALL of the 'to' attributes have been deleted, * then ensure that the 'tail' is updated to point * to the head. */ if (!*to) { tailto = to; } *tailto = i; if (i) { i->next = NULL; tailto = &i->next; } } /* loop over the 'from' list */ } /* * Create a pair, and add it to a particular list of VPs * * Note that this function ALWAYS returns. If we're OOM, then * it causes the server to exit! */ VALUE_PAIR *radius_paircreate(REQUEST *request, VALUE_PAIR **vps, int attribute, int type) { VALUE_PAIR *vp; request = request; /* -Wunused */ vp = paircreate(attribute, type); if (!vp) { radlog(L_ERR, "No memory!"); rad_assert("No memory" == NULL); _exit(1); } if (vps) pairadd(vps, vp); return vp; } /* * Create a pair, and add it to a particular list of VPs * * Note that this function ALWAYS returns. If we're OOM, then * it causes the server to exit! */ VALUE_PAIR *radius_pairmake(REQUEST *request, VALUE_PAIR **vps, const char *attribute, const char *value, int operator) { VALUE_PAIR *vp; request = request; /* -Wunused */ vp = pairmake(attribute, value, operator); if (!vp) return NULL; if (vps) pairadd(vps, vp); return vp; } void debug_pair(VALUE_PAIR *vp) { if (!vp || !debug_flag || !fr_log_fp) return; vp_print(fr_log_fp, vp); } void debug_pair_list(VALUE_PAIR *vp) { if (!vp || !debug_flag || !fr_log_fp) return; while (vp) { vp_print(fr_log_fp, vp); vp = vp->next; } fflush(fr_log_fp); } freeradius-server/src/main/version.c000066400000000000000000000113151257552170400200700ustar00rootroot00000000000000/* * version.c Print version number and exit. * * Version: $Id$ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 1999-2008 The FreeRADIUS server project * Copyright 2000 Alan DeKok * Copyright 2000 Chris Parker */ #include RCSID("$Id$") #include #ifdef HAVE_OPENSSL_CRYPTO_H #include #include static long ssl_built = OPENSSL_VERSION_NUMBER; /** Print the current linked version of Openssl * * Print the currently linked version of the OpenSSL library. */ const char *ssl_version(void) { return SSLeay_version(SSLEAY_VERSION); } #else const char *ssl_version() { return "not linked"; } #endif /** Check built and linked versions of OpenSSL match * * OpenSSL version number consists of: * MMNNFFPPS: major minor fix patch status * * Where status >= 0 && < 10 means beta, and status 10 means release. * * Startup check for whether the linked version of OpenSSL matches the * version the server was built against. * * @return 0 if ok, else -1 */ #if defined(HAVE_OPENSSL_CRYPTO_H) && defined(ENABLE_OPENSSL_VERSION_CHECK) int ssl_check_version(int allow_vulnerable) { long ssl_linked; ssl_linked = SSLeay(); /* * Status mismatch always triggers error. */ if ((ssl_linked & 0x00000000f) != (ssl_built & 0x00000000f)) { mismatch: radlog(L_ERR, "libssl version mismatch. built: %lx linked: %lx", (unsigned long) ssl_built, (unsigned long) ssl_linked); return -1; } /* * Use the OpenSSH approach and relax fix checks after version * 1.0.0 and only allow moving backwards within a patch * series. */ if (ssl_built & 0xff) { if ((ssl_built & 0xffff) != (ssl_linked & 0xffff) || (ssl_built & 0x0000ff) > (ssl_linked & 0x0000ff)) goto mismatch; /* * Before 1.0.0 we require the same major minor and fix version * and ignore the patch number. */ } else if ((ssl_built & 0xffffff) != (ssl_linked & 0xffffff)) goto mismatch; if (!allow_vulnerable) { /* Check for bad versions */ /* 1.0.1 - 1.0.1f CVE-2014-0160 http://heartbleed.com */ if ((ssl_linked >= 0x010001000) && (ssl_linked < 0x010001070)) { radlog(L_ERR, "Refusing to start with libssl version %s (in range 1.0.1 - 1.0.1f). " "Security advisory CVE-2014-0160 (Heartbleed)", ssl_version()); radlog(L_ERR, "For more information see http://heartbleed.com"); return -1; } } return 0; } #endif /* * Display the revision number for this program */ void version(void) { radlog(L_INFO, "%s: %s", progname, radiusd_version); DEBUG3("Server was built with: "); #ifdef WITH_ACCOUNTING DEBUG3(" accounting"); #endif DEBUG3(" authentication"); /* always enabled */ /* here are all the conditional feature flags */ #if defined(WITH_DHCP) DEBUG3(" WITH_DHCP"); #endif #if defined(WITH_VMPS) DEBUG3(" WITH_VMPS"); #endif #if defined(OSFC2) DEBUG3(" OSFC2"); #endif #if defined(WITHOUT_PROXY) DEBUG3(" WITHOUT_PROXY"); #endif #if defined(WITHOUT_DETAIL) DEBUG3(" WITHOUT_DETAIL"); #endif #if defined(WITHOUT_SESSION_MGMT) DEBUG3(" WITHOUT_SESSION_MGMT"); #endif #if defined(WITHOUT_UNLANG) DEBUG3(" WITHOUT_UNLANG"); #endif #if defined(WITHOUT_ACCOUNTING) DEBUG3(" WITHOUT_ACCOUNTING"); #endif #if defined(WITHOUT_DYNAMIC_CLIENTS) DEBUG3(" WITHOUT_DYNAMIC_CLIENTS"); #endif #if defined(WITHOUT_STATS) DEBUG3(" WITHOUT_STATS"); #endif #if defined(WITHOUT_COMMAND_SOCKET) DEBUG3(" WITHOUT_COMMAND_SOCKET"); #endif #if defined(WITHOUT_COA) DEBUG3(" WITHOUT_COA"); #endif DEBUG3("Server core libs:"); DEBUG3(" ssl: %s", ssl_version()); radlog(L_INFO, "Copyright (C) 1999-2015 The FreeRADIUS server project and contributors."); radlog(L_INFO, "There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A"); radlog(L_INFO, "PARTICULAR PURPOSE."); radlog(L_INFO, "You may redistribute copies of FreeRADIUS under the terms of the"); radlog(L_INFO, "GNU General Public License."); radlog(L_INFO, "For more information about these matters, see the file named COPYRIGHT."); fflush(NULL); } freeradius-server/src/main/vmps.c000066400000000000000000000052571257552170400174000ustar00rootroot00000000000000/* * vmps.c Handle VMPS traffic. * * Version: $Id$ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2007 The FreeRADIUS server project * Copyright 2007 Alan DeKok */ #include RCSID("$Id$") #include #include #include #include #include #ifdef WITH_VMPS /* * Check if an incoming request is "ok" * * It takes packets, not requests. It sees if the packet looks * OK. If so, it does a number of sanity checks on it. */ int vqp_socket_recv(rad_listen_t *listener, RAD_REQUEST_FUNP *pfun, REQUEST **prequest) { RADIUS_PACKET *packet; RAD_REQUEST_FUNP fun = NULL; RADCLIENT *client; packet = vqp_recv(listener->fd); if (!packet) { radlog(L_ERR, "%s", fr_strerror()); return 0; } if ((client = client_listener_find(listener, &packet->src_ipaddr, packet->src_port)) == NULL) { rad_free(&packet); return 0; } /* * Do new stuff. */ fun = vmps_process; if (!received_request(listener, packet, prequest, client)) { rad_free(&packet); return 0; } *pfun = fun; return 1; } /* * Send an authentication response packet */ int vqp_socket_send(rad_listen_t *listener, REQUEST *request) { rad_assert(request->listener == listener); rad_assert(listener->send == vqp_socket_send); if (vqp_encode(request->reply, request->packet) < 0) { DEBUG2("Failed encoding packet: %s\n", fr_strerror()); return -1; } return vqp_send(request->reply); } int vqp_socket_encode(UNUSED rad_listen_t *listener, REQUEST *request) { return vqp_encode(request->reply, request->packet); } int vqp_socket_decode(UNUSED rad_listen_t *listener, REQUEST *request) { return vqp_decode(request->packet); } int vmps_process(REQUEST *request) { DEBUG2("Doing VMPS"); module_post_auth(0, request); DEBUG2("Done VMPS"); request->reply->code = PW_AUTHENTICATION_ACK; return 0; } #endif freeradius-server/src/main/xlat.c000066400000000000000000000757751257552170400173770ustar00rootroot00000000000000/* * xlat.c Translate strings. This is the first version of xlat * incorporated to RADIUS * * Version: $Id$ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2000,2006 The FreeRADIUS server project * Copyright 2000 Alan DeKok */ #include RCSID("$Id$") #include #include #include #include #include extern int log_dates_utc; /* log.c */ typedef struct xlat_t { char module[MAX_STRING_LEN]; int length; void *instance; RAD_XLAT_FUNC do_xlat; int internal; /* not allowed to re-define these */ } xlat_t; static rbtree_t *xlat_root = NULL; /* * Define all xlat's in the structure. */ static const char * const internal_xlat[] = {"check", "request", "reply", "proxy-request", "proxy-reply", "outer.request", "outer.reply", "outer.control", NULL}; #if REQUEST_MAX_REGEX > 8 #error Please fix the following line #endif static const int xlat_inst[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8 }; /* up to 8 for regex */ char const *radiusd_short_version = RADIUSD_VERSION_STRING; /** * @brief Convert the value on a VALUE_PAIR to string */ static int valuepair2str(char * out,int outlen,VALUE_PAIR * pair, int type, RADIUS_ESCAPE_STRING func) { char buffer[MAX_STRING_LEN * 4]; if (pair != NULL) { vp_prints_value(buffer, sizeof(buffer), pair, 0); return func(out, outlen, buffer); } switch (type) { case PW_TYPE_STRING : strlcpy(out,"_",outlen); break; case PW_TYPE_INTEGER : strlcpy(out,"0",outlen); break; case PW_TYPE_IPADDR : strlcpy(out,"?.?.?.?",outlen); break; case PW_TYPE_IPV6ADDR : strlcpy(out,":?:",outlen); break; case PW_TYPE_DATE : strlcpy(out,"0",outlen); break; default : strlcpy(out,"unknown_type",outlen); } return strlen(out); } static VALUE_PAIR *pairfind_tag(VALUE_PAIR *vps, int attr, int tag) { VALUE_PAIR *vp = vps; redo: vp = pairfind(vp, attr); if (!tag) return vp; if (!vp) return NULL; if (!vp->flags.has_tag) return NULL; if (vp->flags.tag == tag) return vp; vp = vp->next; goto redo; } /* * Dynamically translate for check:, request:, reply:, etc. */ static size_t xlat_packet(void *instance, REQUEST *request, char *fmt, char *out, size_t outlen, RADIUS_ESCAPE_STRING func) { DICT_ATTR *da; VALUE_PAIR *vp; VALUE_PAIR *vps = NULL; RADIUS_PACKET *packet = NULL; switch (*(int*) instance) { case 0: vps = request->config_items; break; case 1: vps = request->packet->vps; packet = request->packet; break; case 2: vps = request->reply->vps; packet = request->reply; break; case 3: #ifdef WITH_PROXY if (request->proxy) vps = request->proxy->vps; packet = request->proxy; #endif break; case 4: #ifdef WITH_PROXY if (request->proxy_reply) vps = request->proxy_reply->vps; packet = request->proxy_reply; #endif break; case 5: if (request->parent) { vps = request->parent->packet->vps; packet = request->parent->packet; } break; case 6: if (request->parent && request->parent->reply) { vps = request->parent->reply->vps; packet = request->parent->reply; } break; case 7: if (request->parent) { vps = request->parent->config_items; } break; default: /* WTF? */ return 0; } /* * The "format" string is the attribute name. */ da = dict_attrbyname(fmt); if (!da) { int do_number = FALSE; int do_array = FALSE; int do_count = FALSE; int do_all = FALSE; int tag = 0; size_t count = 0, total; char *p; char buffer[256]; if (strlen(fmt) > sizeof(buffer)) return 0; strlcpy(buffer, fmt, sizeof(buffer)); /* * %{Attribute-name#} - print integer version of it. */ p = buffer + strlen(buffer) - 1; if (*p == '#') { *p = '\0'; do_number = TRUE; } /* * %{Attribute-Name:tag} - get the name with the specified * value of the tag. */ p = strchr(buffer, ':'); if (p && (p[1] != '-')) { tag = atoi(p + 1); *p = '\0'; p++; } else { /* * Allow %{Attribute-Name:tag[...]} */ p = buffer; } /* * %{Attribute-Name[...] does more stuff */ p = strchr(p, '['); if (p) { *p = '\0'; do_array = TRUE; if (p[1] == '#') { do_count = TRUE; } else if (p[1] == '*') { do_all = TRUE; } else { count = atoi(p + 1); p += 1 + strspn(p + 1, "0123456789"); if (*p != ']') { RDEBUG2("xlat: Invalid array reference in string at %s %s", fmt, p); return 0; } } } /* * We COULD argue about %{Attribute-Name[#]#} etc. * But that looks like more work than it's worth. */ da = dict_attrbyname(buffer); if (!da) return 0; /* * No array, print the tagged attribute. */ if (!do_array) { vp = pairfind_tag(vps, da->attr, tag); goto just_print; } total = 0; /* * Array[#] - return the total */ if (do_count) { for (vp = pairfind_tag(vps, da->attr, tag); vp != NULL; vp = pairfind_tag(vp->next, da->attr, tag)) { total++; } snprintf(out, outlen, "%d", (int) total); return strlen(out); } /* * %{Attribute-Name[*]} returns ALL of the * the attributes, separated by a newline. */ if (do_all) { for (vp = pairfind_tag(vps, da->attr, tag); vp != NULL; vp = pairfind_tag(vp->next, da->attr, tag)) { count = valuepair2str(out, outlen - 1, vp, da->type, func); rad_assert(count <= outlen); total += count + 1; outlen -= (count + 1); out += count; *(out++) = '\n'; if (outlen <= 1) break; } *out = '\0'; return total; } /* * Find the N'th value. */ for (vp = pairfind_tag(vps, da->attr, tag); vp != NULL; vp = pairfind_tag(vp->next, da->attr, tag)) { if (total == count) break; total++; if (total > count) { vp = NULL; break; } } /* * Non-existent array reference. */ just_print: if (!vp) return 0; if (do_number) { if ((vp->type != PW_TYPE_IPADDR) && (vp->type != PW_TYPE_INTEGER) && (vp->type != PW_TYPE_SHORT) && (vp->type != PW_TYPE_BYTE) && (vp->type != PW_TYPE_DATE)) { *out = '\0'; return 0; } return snprintf(out, outlen, "%u", vp->vp_integer); } return valuepair2str(out, outlen, vp, da->type, func); } vp = pairfind(vps, da->attr); if (!vp) { /* * Some "magic" handlers, which are never in VP's, but * which are in the packet. * * FIXME: We should really do this in a more * intelligent way... */ if (packet) { VALUE_PAIR localvp; memset(&localvp, 0, sizeof(localvp)); switch (da->attr) { case PW_PACKET_TYPE: { DICT_VALUE *dval; dval = dict_valbyattr(da->attr, packet->code); if (dval) { snprintf(out, outlen, "%s", dval->name); } else { snprintf(out, outlen, "%d", packet->code); } return strlen(out); } break; case PW_CLIENT_SHORTNAME: if (request->client && request->client->shortname) { strlcpy(out, request->client->shortname, outlen); } else { strlcpy(out, "", outlen); } return strlen(out); case PW_CLIENT_IP_ADDRESS: /* the same as below */ case PW_PACKET_SRC_IP_ADDRESS: if (packet->src_ipaddr.af != AF_INET) { return 0; } localvp.attribute = da->attr; localvp.vp_ipaddr = packet->src_ipaddr.ipaddr.ip4addr.s_addr; break; case PW_PACKET_DST_IP_ADDRESS: if (packet->dst_ipaddr.af != AF_INET) { return 0; } localvp.attribute = da->attr; localvp.vp_ipaddr = packet->dst_ipaddr.ipaddr.ip4addr.s_addr; break; case PW_PACKET_SRC_PORT: localvp.attribute = da->attr; localvp.vp_integer = packet->src_port; break; case PW_PACKET_DST_PORT: localvp.attribute = da->attr; localvp.vp_integer = packet->dst_port; break; case PW_PACKET_AUTHENTICATION_VECTOR: localvp.attribute = da->attr; memcpy(localvp.vp_strvalue, packet->vector, sizeof(packet->vector)); localvp.length = sizeof(packet->vector); break; /* * Authorization, accounting, etc. */ case PW_REQUEST_PROCESSING_STAGE: if (request->component) { strlcpy(out, request->component, outlen); } else { strlcpy(out, "server_core", outlen); } return strlen(out); case PW_PACKET_SRC_IPV6_ADDRESS: if (packet->src_ipaddr.af != AF_INET6) { return 0; } localvp.attribute = da->attr; memcpy(localvp.vp_strvalue, &packet->src_ipaddr.ipaddr.ip6addr, sizeof(packet->src_ipaddr.ipaddr.ip6addr)); break; case PW_PACKET_DST_IPV6_ADDRESS: if (packet->dst_ipaddr.af != AF_INET6) { return 0; } localvp.attribute = da->attr; memcpy(localvp.vp_strvalue, &packet->dst_ipaddr.ipaddr.ip6addr, sizeof(packet->dst_ipaddr.ipaddr.ip6addr)); break; case PW_VIRTUAL_SERVER: if (!request->server) return 0; snprintf(out, outlen, "%s", request->server); return strlen(out); break; case PW_MODULE_RETURN_CODE: localvp.attribute = da->attr; /* * See modcall.c for a bit of a hack. */ localvp.vp_integer = request->simul_max; break; default: return 0; /* not found */ break; } localvp.type = da->type; return valuepair2str(out, outlen, &localvp, da->type, func); } /* * Not found, die. */ return 0; } if (!vps) return 0; /* silently fail */ /* * Convert the VP to a string, and return it. */ return valuepair2str(out, outlen, vp, da->type, func); } /* * Print data as integer, not as VALUE. */ static size_t xlat_integer(UNUSED void *instance, REQUEST *request, char *fmt, char *out, size_t outlen, UNUSED RADIUS_ESCAPE_STRING func) { VALUE_PAIR *vp; while (isspace((int) *fmt)) fmt++; if (!radius_get_vp(request, fmt, &vp) || !vp) { *out = '\0'; return 0; } if ((vp->type != PW_TYPE_IPADDR) && (vp->type != PW_TYPE_INTEGER) && (vp->type != PW_TYPE_SHORT) && (vp->type != PW_TYPE_BYTE) && (vp->type != PW_TYPE_DATE)) { *out = '\0'; return 0; } return snprintf(out, outlen, "%u", vp->vp_integer); } /* * Print data as string, if possible. */ static size_t xlat_string(UNUSED void *instance, REQUEST *request, char *fmt, char *out, size_t outlen, UNUSED RADIUS_ESCAPE_STRING func) { int len; VALUE_PAIR *vp; while (isspace((int) *fmt)) fmt++; if (outlen < 3) { nothing: *out = '\0'; return 0; } if (!radius_get_vp(request, fmt, &vp)) goto nothing; if (!vp) goto nothing; if (vp->type != PW_TYPE_OCTETS) goto nothing; len = fr_print_string(vp->vp_strvalue, vp->length, out, outlen); out[len] = '\0'; return len; } /** * @brief Print data as hex, not as VALUE. */ static size_t xlat_hex(UNUSED void *instance, REQUEST *request, char *fmt, char *out, size_t outlen, UNUSED RADIUS_ESCAPE_STRING func) { size_t i; VALUE_PAIR *vp; uint8_t buffer[MAX_STRING_LEN]; ssize_t ret; size_t len; while (isspace((int) *fmt)) fmt++; if (!radius_get_vp(request, fmt, &vp) || !vp) { *out = '\0'; return 0; } ret = rad_vp2data(vp, buffer, sizeof(buffer)); len = (size_t) ret; /* * Don't truncate the data. */ if ((ret < 0 ) || (outlen < (len * 2))) { *out = 0; return 0; } for (i = 0; i < len; i++) { snprintf(out + 2*i, 3, "%02x", buffer[i]); } return len * 2; } /** * @brief Print data as base64, not as VALUE */ static size_t xlat_base64(UNUSED void *instance, REQUEST *request, char *fmt, char *out, size_t outlen, UNUSED RADIUS_ESCAPE_STRING func) { VALUE_PAIR *vp; uint8_t buffer[MAX_STRING_LEN]; ssize_t ret; size_t len; size_t enc; while (isspace((int) *fmt)) fmt++; if (!radius_get_vp(request, fmt, &vp) || !vp) { *out = '\0'; return 0; } ret = rad_vp2data(vp, buffer, sizeof(buffer)); if (ret < 0) { *out = 0; return 0; } len = (size_t) ret; enc = FR_BASE64_ENC_LENGTH(len); /* * Don't truncate the data. */ if (outlen < (enc + 1)) { *out = 0; return 0; } fr_base64_encode(buffer, len, out, outlen); return enc; } #ifdef WITH_DHCP static size_t xlat_dhcp_options(UNUSED void *instance, REQUEST *request, char *fmt, char *out, size_t outlen, UNUSED RADIUS_ESCAPE_STRING func) { VALUE_PAIR *vp, *head = NULL, *next; int decoded = 0; while (isspace((int) *fmt)) fmt++; if (!radius_get_vp(request, fmt, &vp) || !vp) { *out = '\0'; return 0; } if ((fr_dhcp_decode_options(vp->vp_octets, vp->length, &head) < 0) || (head == NULL)) { RDEBUG("WARNING: DHCP option decoding failed"); goto fail; } next = head; do { next = next->next; decoded++; } while (next); pairmove(&(request->packet->vps), &head); fail: /* Free any unmoved pairs */ pairfree(&head); snprintf(out, outlen, "%i", decoded); return strlen(out); } #endif #ifdef HAVE_REGEX_H /* * Pull %{0} to %{8} out of the packet. */ static size_t xlat_regex(void *instance, REQUEST *request, char *fmt, char *out, size_t outlen, RADIUS_ESCAPE_STRING func) { char *regex; /* * We cheat: fmt is "0" to "8", but those numbers * are already in the "instance". */ fmt = fmt; /* -Wunused */ func = func; /* -Wunused FIXME: do escaping? */ regex = request_data_reference(request, request, REQUEST_DATA_REGEX | *(int *)instance); if (!regex) return 0; /* * Copy UP TO "freespace" bytes, including * a zero byte. */ strlcpy(out, regex, outlen); return strlen(out); } #endif /* HAVE_REGEX_H */ /** * @brief Dynamically change the debugging level for the current request * * Example %{debug:3} */ static size_t xlat_debug(UNUSED void *instance, REQUEST *request, char *fmt, char *out, size_t outlen, UNUSED RADIUS_ESCAPE_STRING func) { int level = 0; /* * Expand to previous (or current) level */ snprintf(out, outlen, "%d", request->options & RAD_REQUEST_OPTION_DEBUG4); /* * Assume we just want to get the current value and NOT set it to 0 */ if (!*fmt) goto done; level = atoi(fmt); if (level == 0) { request->options = RAD_REQUEST_OPTION_NONE; request->radlog = NULL; } else { if (level > 4) level = 4; request->options = level; request->radlog = radlog_request; } done: return strlen(out); } /* * Compare two xlat_t structs, based ONLY on the module name. */ static int xlat_cmp(const void *a, const void *b) { if (((const xlat_t *)a)->length != ((const xlat_t *)b)->length) { return ((const xlat_t *)a)->length - ((const xlat_t *)b)->length; } return memcmp(((const xlat_t *)a)->module, ((const xlat_t *)b)->module, ((const xlat_t *)a)->length); } /* * find the appropriate registered xlat function. */ static xlat_t *xlat_find(const char *module) { xlat_t my_xlat; strlcpy(my_xlat.module, module, sizeof(my_xlat.module)); my_xlat.length = strlen(my_xlat.module); return rbtree_finddata(xlat_root, &my_xlat); } /* * Register an xlat function. */ int xlat_register(const char *module, RAD_XLAT_FUNC func, void *instance) { xlat_t *c; xlat_t my_xlat; if (!module || !*module) { DEBUG("xlat_register: Invalid module name"); return -1; } /* * First time around, build up the tree... * * FIXME: This code should be hoisted out of this function, * and into a global "initialization". But it isn't critical... */ if (!xlat_root) { int i; #ifdef HAVE_REGEX_H char buffer[2]; #endif xlat_root = rbtree_create(xlat_cmp, free, 0); if (!xlat_root) { DEBUG("xlat_register: Failed to create tree."); return -1; } /* * Register the internal packet xlat's. */ for (i = 0; internal_xlat[i] != NULL; i++) { xlat_register(internal_xlat[i], xlat_packet, &xlat_inst[i]); c = xlat_find(internal_xlat[i]); rad_assert(c != NULL); c->internal = TRUE; } /* * New name: "control" */ xlat_register("control", xlat_packet, &xlat_inst[0]); c = xlat_find("control"); rad_assert(c != NULL); c->internal = TRUE; xlat_register("hex", xlat_hex, ""); c = xlat_find("hex"); rad_assert(c != NULL); c->internal = TRUE; xlat_register("integer", xlat_integer, ""); c = xlat_find("integer"); rad_assert(c != NULL); c->internal = TRUE; xlat_register("base64", xlat_base64, ""); c = xlat_find("base64"); rad_assert(c != NULL); c->internal = TRUE; xlat_register("string", xlat_string, ""); c = xlat_find("string"); rad_assert(c != NULL); c->internal = TRUE; #ifdef WITH_DHCP xlat_register("dhcp_options", xlat_dhcp_options, ""); c = xlat_find("dhcp_options"); rad_assert(c != NULL); c->internal = TRUE; #endif #ifdef HAVE_REGEX_H /* * Register xlat's for regexes. */ buffer[1] = '\0'; for (i = 0; i <= REQUEST_MAX_REGEX; i++) { buffer[0] = '0' + i; xlat_register(buffer, xlat_regex, &xlat_inst[i]); c = xlat_find(buffer); rad_assert(c != NULL); c->internal = TRUE; } #endif /* HAVE_REGEX_H */ xlat_register("debug", xlat_debug, &xlat_inst[0]); c = xlat_find("debug"); rad_assert(c != NULL); c->internal = TRUE; } /* * If it already exists, replace the instance. */ strlcpy(my_xlat.module, module, sizeof(my_xlat.module)); my_xlat.length = strlen(my_xlat.module); c = rbtree_finddata(xlat_root, &my_xlat); if (c) { if (c->internal) { DEBUG("xlat_register: Cannot re-define internal xlat"); return -1; } c->do_xlat = func; c->instance = instance; return 0; } /* * Doesn't exist. Create it. */ c = rad_malloc(sizeof(*c)); memset(c, 0, sizeof(*c)); c->do_xlat = func; strlcpy(c->module, module, sizeof(c->module)); c->length = strlen(c->module); c->instance = instance; rbtree_insert(xlat_root, c); return 0; } /* * Unregister an xlat function. * * We can only have one function to call per name, so the * passing of "func" here is extraneous. */ void xlat_unregister(const char *module, RAD_XLAT_FUNC func, void *instance) { xlat_t *c; xlat_t my_xlat; func = func; /* -Wunused */ if (!module) return; strlcpy(my_xlat.module, module, sizeof(my_xlat.module)); my_xlat.length = strlen(my_xlat.module); c = rbtree_finddata(xlat_root, &my_xlat); if (!c) return; if (c->instance != instance) return; rbtree_deletebydata(xlat_root, c); } /* * De-register all xlat functions, * used mainly for debugging. */ void xlat_free(void) { rbtree_free(xlat_root); } /* * Decode an attribute name into a string. */ static int decode_attribute(const char **from, char **to, int freespace, REQUEST *request, RADIUS_ESCAPE_STRING func) { int do_length = 0; char *module_name, *xlat_str; char *p, *q, *l, *next = NULL; int retlen=0; const xlat_t *c; int varlen; char buffer[8192]; q = *to; *q = '\0'; /* * Copy the input string to an intermediate buffer where * we can mangle it. */ varlen = rad_copy_variable(buffer, *from); if (varlen < 0) { RDEBUG2("ERROR: Badly formatted variable: %s", *from); return -1; } *from += varlen; /* * Kill the %{} around the data we are looking for. */ p = buffer; p[varlen - 1] = '\0'; /* */ p += 2; if (*p == '#') { p++; do_length = 1; } /* * Handle %{%{foo}:-%{bar}}, which is useful, too. * * Did I mention that this parser is garbage? */ if ((p[0] == '%') && (p[1] == '{')) { int len1, len2; int expand2 = FALSE; /* * 'p' is after the start of 'buffer', so we can * safely do this. */ len1 = rad_copy_variable(buffer, p); if (len1 < 0) { RDEBUG2("ERROR: Badly formatted variable: %s", p); return -1; } /* * They did %{%{foo}}, which is stupid, but allowed. */ if (!p[len1]) { RDEBUG2("Improperly nested variable; %%{%s}", p); return -1; } /* * It SHOULD be %{%{foo}:-%{bar}}. If not, it's * an error. */ if ((p[len1] != ':') || (p[len1 + 1] != '-')) { RDEBUG2("No trailing :- after variable at %s", p); return -1; } /* * Parse the second bit. The second bit can be * either %{foo}, or a string "foo", or a string * 'foo', or just a bare word: foo */ p += len1 + 2; l = buffer + len1 + 1; if ((p[0] == '%') && (p[1] == '{')) { len2 = rad_copy_variable(l, p); if (len2 < 0) { RDEBUG2("ERROR: Invalid text after :- at %s", p); return -1; } p += len2; expand2 = TRUE; } else if ((p[0] == '"') || p[0] == '\'') { getstring(&p, l, strlen(l)); } else { l = p; } /* * Expand the first one. If we did, exit the * conditional. */ retlen = radius_xlat(q, freespace, buffer, request, func); if (retlen) { q += retlen; goto done; } RDEBUG2("\t... expanding second conditional"); /* * Expand / copy the second string if required. */ if (expand2) { retlen = radius_xlat(q, freespace, l, request, func); if (retlen) { q += retlen; } } else { strlcpy(q, l, freespace); q += strlen(q); } /* * Else the output is an empty string. */ goto done; } /* * See if we're supposed to expand a module name. */ module_name = NULL; for (l = p; *l != '\0'; l++) { if (*l == '\\') { l++; continue; } if (*l == ':') { if (l[1] == '-') { RDEBUG2("WARNING: Deprecated conditional expansion \":-\". See \"man unlang\" for details"); module_name = internal_xlat[1]; xlat_str = p; *l = '\0'; next = l + 2; goto do_xlat; } module_name = p; /* start of name */ *l = '\0'; /* * %{Tunnel-Password:0} * * OR * * %{expr:0 + 1} */ if (isdigit(l[1]) && (dict_attrbyname(module_name) != NULL)) { module_name = NULL; *l = ':'; break; } p = l + 1; break; } /* * Module names can't have spaces. */ if ((*l == ' ') || (*l == '\t')) break; } /* * %{name} is a simple attribute reference, * or regex reference. */ if (!module_name) { if (isdigit(*p) && !p[1]) { /* regex 0..8 */ module_name = xlat_str = p; } else { module_name = internal_xlat[1]; xlat_str = p; } goto do_xlat; } /* * FIXME: For backwards "WTF" compatibility, check for * {...}, (after the :), and copy that, too. */ /* module name, followed by (possibly) per-module string */ xlat_str = p; do_xlat: c = xlat_find(module_name); if (!c) { if (module_name == internal_xlat[1]) { RDEBUG2("WARNING: Unknown Attribute \"%s\" in string expansion \"%%%s\"", module_name, *from); } else { RDEBUG2("WARNING: Unknown module \"%s\" in string expansion \"%%%s\"", module_name, *from); } return -1; } if (!c->internal) RDEBUG3("radius_xlat: Running registered xlat function of module %s for string \'%s\'", c->module, xlat_str); retlen = c->do_xlat(c->instance, request, xlat_str, q, freespace, func); if (retlen > 0) { if (do_length) { snprintf(q, freespace, "%d", retlen); retlen = strlen(q); } } else if (next) { /* * Expand the second bit. */ RDEBUG2("\t... expanding second conditional"); retlen = radius_xlat(q, freespace, next, request, func); } q += retlen; done: *to = q; return 0; } /* * If the caller doesn't pass xlat an escape function, then * we use this one. It simplifies the coding, as the check for * func == NULL only happens once. */ static size_t xlat_copy(char *out, size_t outlen, const char *in) { int freespace = outlen; if (outlen < 1) return 0; while ((*in) && (freespace > 1)) { /* * Copy data. * * FIXME: Do escaping of bad stuff! */ *(out++) = *(in++); freespace--; } *out = '\0'; return (outlen - freespace); /* count does not include NUL */ } /* * Replace % in a string. * * See 'doc/variables.txt' for more information. */ int radius_xlat(char *out, int outlen, const char *fmt, REQUEST *request, RADIUS_ESCAPE_STRING func) { int c, len, freespace; const char *p; char *q; char *nl; VALUE_PAIR *tmp; struct tm *TM, s_TM; char tmpdt[40]; /* For temporary storing of dates */ int openbraces=0; /* * Catch bad modules. */ if (!fmt || !out || !request) return 0; /* * Ensure that we always have an escaping function. */ if (func == NULL) { func = xlat_copy; } q = out; p = fmt; while (*p) { /* Calculate freespace in output */ freespace = outlen - (q - out); if (freespace <= 1) break; c = *p; if ((c != '%') && (c != '$') && (c != '\\')) { /* * We check if we're inside an open brace. If we are * then we assume this brace is NOT literal, but is * a closing brace and apply it */ if ((c == '}') && openbraces) { openbraces--; p++; /* skip it */ continue; } *q++ = *p++; continue; } /* * There's nothing after this character, copy * the last '%' or "$' or '\\' over to the output * buffer, and exit. */ if (*++p == '\0') { *q++ = c; break; } if (c == '\\') { switch(*p) { case '\\': *q++ = *p; break; case 't': *q++ = '\t'; break; case 'n': *q++ = '\n'; break; default: *q++ = c; *q++ = *p; break; } p++; } else if (c == '%') switch(*p) { case '{': p--; if (decode_attribute(&p, &q, freespace, request, func) < 0) return 0; break; case '%': *q++ = *p++; break; case 'a': /* Protocol: */ q += valuepair2str(q,freespace,pairfind(request->reply->vps,PW_FRAMED_PROTOCOL),PW_TYPE_INTEGER, func); p++; break; case 'c': /* Callback-Number */ q += valuepair2str(q,freespace,pairfind(request->reply->vps,PW_CALLBACK_NUMBER),PW_TYPE_STRING, func); p++; break; case 'd': /* request day */ TM = localtime_r(&request->timestamp, &s_TM); len = strftime(tmpdt, sizeof(tmpdt), "%d", TM); if (len > 0) { strlcpy(q, tmpdt, freespace); q += strlen(q); } p++; break; case 'f': /* Framed IP address */ q += valuepair2str(q,freespace,pairfind(request->reply->vps,PW_FRAMED_IP_ADDRESS),PW_TYPE_IPADDR, func); p++; break; case 'i': /* Calling station ID */ q += valuepair2str(q,freespace,pairfind(request->packet->vps,PW_CALLING_STATION_ID),PW_TYPE_STRING, func); p++; break; case 'l': /* request timestamp */ snprintf(tmpdt, sizeof(tmpdt), "%lu", (unsigned long) request->timestamp); strlcpy(q,tmpdt,freespace); q += strlen(q); p++; break; case 'm': /* request month */ TM = localtime_r(&request->timestamp, &s_TM); len = strftime(tmpdt, sizeof(tmpdt), "%m", TM); if (len > 0) { strlcpy(q, tmpdt, freespace); q += strlen(q); } p++; break; case 'n': /* NAS IP address */ q += valuepair2str(q,freespace,pairfind(request->packet->vps,PW_NAS_IP_ADDRESS),PW_TYPE_IPADDR, func); p++; break; case 'p': /* Port number */ q += valuepair2str(q,freespace,pairfind(request->packet->vps,PW_NAS_PORT),PW_TYPE_INTEGER, func); p++; break; case 's': /* Speed */ q += valuepair2str(q,freespace,pairfind(request->packet->vps,PW_CONNECT_INFO),PW_TYPE_STRING, func); p++; break; case 't': /* request timestamp */ #ifdef HAVE_GMTIME_R if (log_dates_utc) { struct tm utc; gmtime_r(&request->timestamp, &utc); asctime_r(&utc, tmpdt); } else #endif CTIME_R(&request->timestamp, tmpdt, sizeof(tmpdt)); nl = strchr(tmpdt, '\n'); if (nl) *nl = '\0'; strlcpy(q, tmpdt, freespace); q += strlen(q); p++; break; case 'u': /* User name */ q += valuepair2str(q,freespace,pairfind(request->packet->vps,PW_USER_NAME),PW_TYPE_STRING, func); p++; break; case 'v': /* server version */ strlcpy(q,radiusd_short_version,freespace); q += strlen(q); p++; break; case 'A': /* radacct_dir */ strlcpy(q,radacct_dir,freespace); q += strlen(q); p++; break; case 'C': /* ClientName */ strlcpy(q,request->client->shortname,freespace); q += strlen(q); p++; break; case 'D': /* request date */ TM = localtime_r(&request->timestamp, &s_TM); len = strftime(tmpdt, sizeof(tmpdt), "%Y%m%d", TM); if (len > 0) { strlcpy(q, tmpdt, freespace); q += strlen(q); } p++; break; case 'H': /* request hour */ TM = localtime_r(&request->timestamp, &s_TM); len = strftime(tmpdt, sizeof(tmpdt), "%H", TM); if (len > 0) { strlcpy(q, tmpdt, freespace); q += strlen(q); } p++; break; case 'I': /* Request ID */ snprintf(tmpdt, sizeof(tmpdt), "%i", request->packet->id); strlcpy(q, tmpdt, freespace); q += strlen(q); p++; break; case 'L': /* radlog_dir */ strlcpy(q,radlog_dir,freespace); q += strlen(q); p++; break; case 'G': /* request minute */ TM = localtime_r(&request->timestamp, &s_TM); len = strftime(tmpdt, sizeof(tmpdt), "%M", TM); if (len > 0) { strlcpy(q, tmpdt, freespace); q += strlen(q); } p++; break; case 'M': /* MTU */ q += valuepair2str(q,freespace,pairfind(request->reply->vps,PW_FRAMED_MTU),PW_TYPE_INTEGER, func); p++; break; case 'R': /* radius_dir */ strlcpy(q,radius_dir,freespace); q += strlen(q); p++; break; case 'S': /* request timestamp in SQL format*/ TM = localtime_r(&request->timestamp, &s_TM); len = strftime(tmpdt, sizeof(tmpdt), "%Y-%m-%d %H:%M:%S", TM); if (len > 0) { strlcpy(q, tmpdt, freespace); q += strlen(q); } p++; break; case 'T': /* request timestamp */ TM = localtime_r(&request->timestamp, &s_TM); len = strftime(tmpdt, sizeof(tmpdt), "%Y-%m-%d-%H.%M.%S.000000", TM); if (len > 0) { strlcpy(q, tmpdt, freespace); q += strlen(q); } p++; break; case 'U': /* Stripped User name */ q += valuepair2str(q,freespace,pairfind(request->packet->vps,PW_STRIPPED_USER_NAME),PW_TYPE_STRING, func); p++; break; case 'V': /* Request-Authenticator */ strlcpy(q,"Verified",freespace); q += strlen(q); p++; break; case 'Y': /* request year */ TM = localtime_r(&request->timestamp, &s_TM); len = strftime(tmpdt, sizeof(tmpdt), "%Y", TM); if (len > 0) { strlcpy(q, tmpdt, freespace); q += strlen(q); } p++; break; case 'Z': /* Full request pairs except password */ tmp = request->packet->vps; while (tmp && (freespace > 3)) { if (tmp->attribute != PW_USER_PASSWORD) { *q++ = '\t'; len = vp_prints(q, freespace - 2, tmp); q += len; freespace -= (len + 2); *q++ = '\n'; } tmp = tmp->next; } p++; break; default: RDEBUG2("WARNING: Unknown variable '%%%c': See 'doc/variables.txt'", *p); if (freespace > 2) { *q++ = '%'; *q++ = *p++; } break; } } *q = '\0'; RDEBUG2("\texpand: %s -> %s", fmt, out); return strlen(out); } freeradius-server/src/mkinstalldirs000077500000000000000000000012371257552170400201230ustar00rootroot00000000000000#! /bin/sh # mkinstalldirs --- make directory hierarchy # Author: Noah Friedman # Created: 1993-05-16 # Public domain # $Id$ errstatus=0 for file do set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` shift pathcomp= for d do pathcomp="$pathcomp$d" case "$pathcomp" in -* ) pathcomp=./$pathcomp ;; esac if test ! -d "$pathcomp"; then echo "mkdir $pathcomp" mkdir "$pathcomp" || lasterr=$? if test ! -d "$pathcomp"; then errstatus=$lasterr fi fi pathcomp="$pathcomp/" done done exit $errstatus # mkinstalldirs ends here freeradius-server/src/modules/000077500000000000000000000000001257552170400167625ustar00rootroot00000000000000freeradius-server/src/modules/.gitignore000066400000000000000000000000051257552170400207450ustar00rootroot00000000000000lib/ freeradius-server/src/modules/Makefile000066400000000000000000000027351257552170400204310ustar00rootroot00000000000000# # Makefile # # Version: $Id$ # include ../../Make.inc WHAT_TO_MAKE = all all: @$(MAKE) $(MFLAGS) WHAT_TO_MAKE=$@ common install: $(INSTALL) -d -m 755 $(R)$(libdir) @$(MAKE) $(MFLAGS) WHAT_TO_MAKE=$@ common clean: @$(MAKE) $(MFLAGS) WHAT_TO_MAKE=$@ common @rm -f *~ lib/rlm_* lib/*.o lib/smbencrypt lib/radeapclient distclean: @$(MAKE) $(MFLAGS) WHAT_TO_MAKE=$@ common # Requires GNU Make, but even older ones will do. SUBDIRS := $(patsubst %/,%,$(dir $(wildcard $(addsuffix /Makefile,$(MODULES))))) .PHONY: common libs $(SUBDIRS) libs: @[ -d lib/ ] || mkdir lib @[ -d lib/.libs ] || mkdir lib/.libs common: libs $(SUBDIRS) $(SUBDIRS): @echo "Making $(WHAT_TO_MAKE) in $@..." $(MAKE) $(MFLAGS) -C $@ $(WHAT_TO_MAKE) # The rlm_*/*/* stuff is to catch the configure CONFIG_FILES := $(wildcard rlm_*/configure.in rlm_*/*/*/configure.in) .PHONY: reconfig $(CONFIG_FILES) # # Do NOT use "common", because some modules may not be built, # and therefore their makefiles may be empty or non-existent. # ifeq "$(AUTOCONF)" "" reconfig: @echo autoconf is needed for this target else ifeq "$(AUTOHEADER)" "" reconfig: @echo autoheader is needed for this target else reconfig: $(CONFIG_FILES) endif endif # Don't use: $(MAKE) -C $(dir $@) reconfig # The modules may not have a Makefile $(CONFIG_FILES): @echo "Making reconfig in $(dir $@)..." @cd $(dir $@) && $(AUTOCONF) -I $(top_builddir) @if grep AC_CONFIG_HEADERS $@ >/dev/null; then\ cd $(dir $@) && $(AUTOHEADER); \ fi freeradius-server/src/modules/rlm_acct_unique/000077500000000000000000000000001257552170400221345ustar00rootroot00000000000000freeradius-server/src/modules/rlm_acct_unique/Makefile000066400000000000000000000002111257552170400235660ustar00rootroot00000000000000# # Make a unique Acct-Unique-Session-Id # # Version: $Id$ # TARGET = rlm_acct_unique SRCS = rlm_acct_unique.c include ../rules.mak freeradius-server/src/modules/rlm_acct_unique/rlm_acct_unique.c000066400000000000000000000142611257552170400254560ustar00rootroot00000000000000/* * rlm_acct_unique.c * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2000,2006 The FreeRADIUS server project */ #include RCSID("$Id$") #include #include #include /* * Room for at least 16 attributes. */ #define BUFFERLEN 4096 typedef struct rlm_acct_unique_list_t { DICT_ATTR *dattr; struct rlm_acct_unique_list_t *next; } rlm_acct_unique_list_t; typedef struct rlm_acct_unique_t { char *key; rlm_acct_unique_list_t *head; } rlm_acct_unique_t; static const CONF_PARSER module_config[] = { { "key", PW_TYPE_STRING_PTR, offsetof(rlm_acct_unique_t,key), NULL, NULL }, { NULL, -1, 0, NULL, NULL } /* end the list */ }; /* * Add an attribute to the list. */ static void unique_add_attr(rlm_acct_unique_t *inst, DICT_ATTR *dattr) { rlm_acct_unique_list_t *new; new = rad_malloc(sizeof(*new)); memset(new, 0, sizeof(*new)); /* Assign the attr to our new structure */ new->dattr = dattr; new->next = inst->head; inst->head = new; } /* * Parse a key. */ static int unique_parse_key(rlm_acct_unique_t *inst, char *key) { char *ptr, *prev, *keyptr; DICT_ATTR *a; prev = key; keyptr = ptr = key; /* Let's remove spaces in the string */ while (*keyptr) { if (isspace((int) *keyptr)) { keyptr++; } else { *(ptr++) = *(keyptr++); } } *ptr = '\0'; ptr = key; while(ptr) { switch(*ptr) { case ',': *ptr = '\0'; if((a = dict_attrbyname(prev)) == NULL) { radlog(L_ERR, "rlm_acct_unique: Cannot find attribute '%s' in dictionary", prev); return -1; } *ptr = ','; prev = ptr+1; unique_add_attr(inst, a); break; case '\0': if((a = dict_attrbyname(prev)) == NULL) { radlog(L_ERR, "rlm_acct_unique: Cannot find attribute '%s' in dictionary", prev); return -1; } unique_add_attr(inst, a); return 0; break; case ' ': continue; break; } ptr++; } return 0; } /* * Needed before instantiate for cleanup. */ static int unique_detach(void *instance) { rlm_acct_unique_t *inst = instance; rlm_acct_unique_list_t *this, *next; for (this = inst->head; this != NULL; this = next) { next = this->next; free(this); } free(inst); return 0; } static int unique_instantiate(CONF_SECTION *conf, void **instance) { rlm_acct_unique_t *inst; /* * Set up a storage area for instance data */ inst = rad_malloc(sizeof(*inst)); memset(inst, 0, sizeof(*inst)); if (cf_section_parse(conf, inst, module_config) < 0) { free(inst); return -1; } /* * Check to see if 'key' has something in it */ if (!inst->key) { radlog(L_ERR,"rlm_acct_unique: Cannot find value for 'key' in configuration."); free(inst); return -1; } /* * Go thru the list of keys and build attr_list; */ if (unique_parse_key(inst, inst->key) < 0) { unique_detach(inst); /* clean up memory */ return -1; }; *instance = inst; return 0; } /* * Create a (hopefully) unique Acct-Unique-Session-Id from * attributes listed in 'key' from radiusd.conf */ static int add_unique_id(void *instance, REQUEST *request) { char buffer[BUFFERLEN]; u_char md5_buf[16]; VALUE_PAIR *vp; char *p; int length, left; rlm_acct_unique_t *inst = instance; rlm_acct_unique_list_t *cur; /* initialize variables */ p = buffer; left = BUFFERLEN; cur = inst->head; /* * A unique ID already exists: don't do anything. */ vp = pairfind(request->packet->vps, PW_ACCT_UNIQUE_SESSION_ID); if (vp) { return RLM_MODULE_NOOP; } /* loop over items to create unique identifiers */ while (cur) { VALUE_PAIR hack; vp = pairfind(request->packet->vps, cur->dattr->attr); if (!vp) { /* * This was changed in 2.x, but it's still * useful. */ if ((cur->dattr->attr == PW_CLIENT_IP_ADDRESS) && (request->packet->src_ipaddr.af == AF_INET)) { memset(&hack, 0, sizeof(hack)); hack.name = cur->dattr->name; hack.attribute = cur->dattr->attr; hack.type = cur->dattr->type; hack.operator = T_OP_EQ; hack.length = 4; hack.lvalue = request->packet->src_ipaddr.ipaddr.ip4addr.s_addr; vp = &hack; } else { RDEBUG2("WARNING: Attribute %s was not found in request, unique ID MAY be inconsistent", cur->dattr->name); } } length = vp_prints(p, left, vp); left -= length + 1; /* account for ',' in between elements */ p += length; *(p++) = ','; /* ensure seperation of elements */ cur = cur->next; } buffer[BUFFERLEN-left-1] = '\0'; RDEBUG2("Hashing '%s'", buffer); /* calculate a 'unique' string based on the above information */ fr_md5_calc(md5_buf, (u_char *)buffer, (p - buffer)); sprintf(buffer, "%02x%02x%02x%02x%02x%02x%02x%02x", md5_buf[0], md5_buf[1], md5_buf[2], md5_buf[3], md5_buf[4], md5_buf[5], md5_buf[6], md5_buf[7]); RDEBUG2("Acct-Unique-Session-ID = \"%s\".", buffer); vp = pairmake("Acct-Unique-Session-Id", buffer, 0); if (!vp) { radlog(L_ERR, "%s", fr_strerror()); return RLM_MODULE_FAIL; } /* add the (hopefully) unique session ID to the packet */ pairadd(&request->packet->vps, vp); return RLM_MODULE_OK; } /* globally exported name */ module_t rlm_acct_unique = { RLM_MODULE_INIT, "Acct-Unique-Session-Id", RLM_TYPE_CHECK_CONFIG_SAFE, /* type */ unique_instantiate, /* instantiation */ unique_detach, /* detach */ { NULL, /* authentication */ add_unique_id, /* authorization */ add_unique_id, /* preaccounting */ add_unique_id, /* accounting */ NULL, /* checksimul */ NULL, /* pre-proxy */ NULL, /* post-proxy */ NULL /* post-auth */ }, }; freeradius-server/src/modules/rlm_acctlog/000077500000000000000000000000001257552170400212505ustar00rootroot00000000000000freeradius-server/src/modules/rlm_acctlog/.gitignore000066400000000000000000000000111257552170400232300ustar00rootroot00000000000000Makefile freeradius-server/src/modules/rlm_acctlog/Makefile.in000066400000000000000000000002771257552170400233230ustar00rootroot00000000000000TARGET = @targetname@ SRCS = rlm_acctlog.c RLM_CFLAGS = @acctlog_cflags@ RLM_LIBS = @acctlog_ldflags@ include ../rules.mak $(LT_OBJS): $(HEADERS) install-example: touch . freeradius-server/src/modules/rlm_acctlog/configure000077500000000000000000003566431257552170400232000ustar00rootroot00000000000000#! /bin/sh # From configure.in 0.1. # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.61. # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, # 2002, 2003, 2004, 2005, 2006 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=: # 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 # PATH needs CR # 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 # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false 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.) as_nl=' ' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. 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 # Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # CDPATH. $as_unset CDPATH if test "x$CONFIG_SHELL" = x; then if (eval ":") 2>/dev/null; then as_have_required=yes else as_have_required=no fi if test $as_have_required = yes && (eval ": (as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=\$LINENO as_lineno_2=\$LINENO test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } ") 2> /dev/null; then : else as_candidate_shells= as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. case $as_dir in /*) for as_base in sh bash ksh sh5; do as_candidate_shells="$as_candidate_shells $as_dir/$as_base" done;; esac done IFS=$as_save_IFS for as_shell in $as_candidate_shells $SHELL; do # Try only shells that exist, to save several forks. if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { ("$as_shell") 2> /dev/null <<\_ASEOF 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 : _ASEOF }; then CONFIG_SHELL=$as_shell as_have_required=yes if { "$as_shell" 2> /dev/null <<\_ASEOF 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 : (as_func_return () { (exit $1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = "$1" ); then : else exitcode=1 echo positional parameters were not saved. fi test $exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } _ASEOF }; then break fi fi done if test "x$CONFIG_SHELL" != x; then for as_var in BASH_ENV ENV do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done export CONFIG_SHELL exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} fi if test $as_have_required = no; then echo This script requires a shell more modern than all the echo shells that I found on your system. Please install a echo modern shell, or manually run the script under such a echo shell if you do have one. { (exit 1); exit 1; } fi fi fi (eval "as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0") || { echo No shell found that supports shell functions. echo Please tell autoconf@gnu.org about your system, echo including any error possibly output before this echo message } as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, and appends # trailing '-' during substitution so that $LINENO is not a special # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # scripts with optimization help from Paolo Bonzini. 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" || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi 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 fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi 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=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, 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= SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME= PACKAGE_TARNAME= PACKAGE_VERSION= PACKAGE_STRING= PACKAGE_BUGREPORT= ac_unique_file="rlm_acctlog.c" # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef STDC_HEADERS # include # include #else # ifdef HAVE_STDLIB_H # include # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datarootdir datadir sysconfdir sharedstatedir localstatedir includedir oldincludedir docdir infodir htmldir dvidir pdfdir psdir libdir localedir mandir DEFS ECHO_C ECHO_N ECHO_T LIBS build_alias host_alias target_alias CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP GREP EGREP acctlog_cflags acctlog_ldflags targetname LIBOBJS LTLIBOBJS' ac_subst_files='' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CPP' # Initialize some variables set by options. ac_init_help= ac_init_version=false # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *) ac_optarg=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_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` eval enable_$ac_feature=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_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` eval enable_$ac_feature=\$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_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/[-.]/_/g'` eval with_$ac_package=\$ac_optarg ;; -without-* | --without-*) ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/[-.]/_/g'` eval with_$ac_package=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 ;; -*) { echo "$as_me: error: unrecognized option: $ac_option Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && 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'` { echo "$as_me: error: missing argument to $ac_option" >&2 { (exit 1); exit 1; }; } fi # Be sure to have absolute directory names. 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 case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; } 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 echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || { echo "$as_me: error: Working directory cannot be determined" >&2 { (exit 1); exit 1; }; } test "X$ac_ls_di" = "X$ac_pwd_ls_di" || { echo "$as_me: error: pwd does not report name of working directory" >&2 { (exit 1); exit 1; }; } # 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 -- "$0" || $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$0" : 'X\(//\)[^/]' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X"$0" | 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 .." { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2 { (exit 1); exit 1; }; } pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures this package to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF _ACEOF fi if test -n "$ac_init_help"; then cat <<\_ACEOF 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 C/C++/Objective C preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. _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" || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`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 echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF configure generated by GNU Autoconf 2.61 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 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 cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by $as_me, which was generated by GNU Autoconf 2.61. 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=. 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=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; 2) ac_configure_args1="$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 ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac done done $as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } $as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export 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 cat <<\_ASBOX ## ---------------- ## ## Cache variables. ## ## ---------------- ## _ASBOX 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_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( *) $as_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 cat <<\_ASBOX ## ----------------- ## ## Output variables. ## ## ----------------- ## _ASBOX echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then cat <<\_ASBOX ## ------------------- ## ## File substitutions. ## ## ------------------- ## _ASBOX echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then cat <<\_ASBOX ## ----------- ## ## confdefs.h. ## ## ----------- ## _ASBOX echo cat confdefs.h echo fi test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" 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'; { (exit 1); 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 # 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 # Let the site file select an alternate cache file if it wants to. # Prefer explicitly selected file to automatically selected ones. if test -n "$CONFIG_SITE"; then set x "$CONFIG_SITE" elif test "x$prefix" != xNONE; then set x "$prefix/share/config.site" "$prefix/etc/config.site" else set x "$ac_default_prefix/share/config.site" \ "$ac_default_prefix/etc/config.site" fi shift for ac_site_file do if test -r "$ac_site_file"; then { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" 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. if test -f "$cache_file"; then { echo "$as_me:$LINENO: loading cache $cache_file" >&5 echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { echo "$as_me:$LINENO: creating cache $cache_file" >&5 echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 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 { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 echo "$as_me: former value: $ac_old_val" >&2;} { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 echo "$as_me: current value: $ac_new_val" >&2;} ac_cache_corrupted=: fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`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. *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 echo "$as_me: error: changes in the environment can compromise the build" >&2;} { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} { (exit 1); exit 1; }; } 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 x$with_rlm_acctlog != xno; then 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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}gcc" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="gcc" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}cc" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="$ac_prog" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&5 echo "$as_me: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } # Provide some information about the compiler. echo "$as_me:$LINENO: checking for C compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (ac_try="$ac_compiler --version >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -v >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -V >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out 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. { echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6; } ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # # List of possible output files, starting from the most likely. # The algorithm is not robust to junk in `.', hence go to wildcards (a.*) # only as a last resort. b.out is created by i960 compilers. ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out' # # The IRIX 6 linker writes into existing files which may not be # executable, retaining their permissions. Remove them first so a # subsequent execution test works. ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link_default") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; 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 | *.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 { echo "$as_me:$LINENO: result: $ac_file" >&5 echo "${ECHO_T}$ac_file" >&6; } if test -z "$ac_file"; then echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: C compiler cannot create executables See \`config.log' for more details." >&5 echo "$as_me: error: C compiler cannot create executables See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } fi ac_exeext=$ac_cv_exeext # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { echo "$as_me:$LINENO: checking whether the C compiler works" >&5 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6; } # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then if { ac_try='./$ac_file' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { echo "$as_me:$LINENO: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&5 echo "$as_me: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi fi fi { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } rm -f a.out a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; } { echo "$as_me:$LINENO: result: $cross_compiling" >&5 echo "${ECHO_T}$cross_compiling" >&6; } { echo "$as_me:$LINENO: checking for suffix of executables" >&5 echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; } if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; 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 | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest$ac_cv_exeext { echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 echo "${ECHO_T}$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT { echo "$as_me:$LINENO: checking for suffix of object files" >&5 echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; } if test "${ac_cv_objext+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; 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 ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 echo "${ECHO_T}$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; } if test "${ac_cv_c_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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 { echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; } GCC=`test $ac_compiler_gnu = yes && echo yes` ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CFLAGS="" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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 { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 echo "${ECHO_T}$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 { echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_c89+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_c89=$ac_arg else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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) { echo "$as_me:$LINENO: result: none needed" >&5 echo "${ECHO_T}none needed" >&6; } ;; xno) { echo "$as_me:$LINENO: result: unsupported" >&5 echo "${ECHO_T}unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;; 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 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 { echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if test "${ac_cv_prog_CPP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f 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 { echo "$as_me:$LINENO: result: $CPP" >&5 echo "${ECHO_T}$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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&5 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } 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 { echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5 echo $ECHO_N "checking for grep that handles long lines and -e... $ECHO_C" >&6; } if test "${ac_cv_path_GREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Extract the first word of "grep ggrep" to use in msg output if test -z "$GREP"; then set dummy grep ggrep; ac_prog_name=$2 if test "${ac_cv_path_GREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" 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 ac_count=`expr $ac_count + 1` 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 fi GREP="$ac_cv_path_GREP" if test -z "$GREP"; then { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} { (exit 1); exit 1; }; } fi else ac_cv_path_GREP=$GREP fi fi { echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5 echo "${ECHO_T}$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { echo "$as_me:$LINENO: checking for egrep" >&5 echo $ECHO_N "checking for egrep... $ECHO_C" >&6; } if test "${ac_cv_path_EGREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else # Extract the first word of "egrep" to use in msg output if test -z "$EGREP"; then set dummy egrep; ac_prog_name=$2 if test "${ac_cv_path_EGREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" 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 ac_count=`expr $ac_count + 1` 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 fi EGREP="$ac_cv_path_EGREP" if test -z "$EGREP"; then { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} { (exit 1); exit 1; }; } fi else ac_cv_path_EGREP=$EGREP fi fi fi { echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 echo "${ECHO_T}$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" { echo "$as_me:$LINENO: checking for ANSI C header files" >&5 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; } if test "${ac_cv_header_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_header_stdc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* 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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* 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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* 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 rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi { echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 echo "${ECHO_T}$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then cat >>confdefs.h <<\_ACEOF #define STDC_HEADERS 1 _ACEOF 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=`echo "ac_cv_header_$ac_header" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Header=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done if test "${ac_cv_header_stdio_h+set}" = set; then { echo "$as_me:$LINENO: checking for stdio.h" >&5 echo $ECHO_N "checking for stdio.h... $ECHO_C" >&6; } if test "${ac_cv_header_stdio_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi { echo "$as_me:$LINENO: result: $ac_cv_header_stdio_h" >&5 echo "${ECHO_T}$ac_cv_header_stdio_h" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking stdio.h usability" >&5 echo $ECHO_N "checking stdio.h usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? { echo "$as_me:$LINENO: checking stdio.h presence" >&5 echo $ECHO_N "checking stdio.h presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: stdio.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: stdio.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: stdio.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: stdio.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: stdio.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: stdio.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: stdio.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: stdio.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: stdio.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: stdio.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: stdio.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: stdio.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: stdio.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: stdio.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: stdio.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: stdio.h: in the future, the compiler will take precedence" >&2;} ;; esac { echo "$as_me:$LINENO: checking for stdio.h" >&5 echo $ECHO_N "checking for stdio.h... $ECHO_C" >&6; } if test "${ac_cv_header_stdio_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_stdio_h=$ac_header_preproc fi { echo "$as_me:$LINENO: result: $ac_cv_header_stdio_h" >&5 echo "${ECHO_T}$ac_cv_header_stdio_h" >&6; } fi if test $ac_cv_header_stdio_h = yes; then slog_cflags="$acctlog_cflags -I/usr/include" else fail=$fail" stdio.h" fi targetname=rlm_acctlog else targetname= echo \*\*\* module rlm_acctlog is disabled. fi if test x"$fail" != x""; then if test x"${enable_strict_dependencies}" = x"yes"; then { { echo "$as_me:$LINENO: error: set --without-rlm_acctlog to disable it explicitly." >&5 echo "$as_me: error: set --without-rlm_acctlog to disable it explicitly." >&2;} { (exit 1); exit 1; }; } else { echo "$as_me:$LINENO: WARNING: silently not building rlm_acctlog." >&5 echo "$as_me: WARNING: silently not building rlm_acctlog." >&2;} { echo "$as_me:$LINENO: WARNING: FAILURE: rlm_acctlog requires: $fail." >&5 echo "$as_me: WARNING: FAILURE: rlm_acctlog requires: $fail." >&2;}; targetname="" fi fi unset ac_cv_env_LIBS_set unset ac_cv_env_LIBS_value ac_config_files="$ac_config_files 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_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( *) $as_unset $ac_var ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then test "x$cache_file" != "x/dev/null" && { echo "$as_me:$LINENO: updating cache $cache_file" >&5 echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 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}' # Transform confdefs.h into DEFS. # Protect against shell expansion while executing Makefile rules. # Protect against Makefile macro expansion. # # If the first sed substitution is executed (which looks for macros that # take arguments), then branch to the quote section. Otherwise, # look for a macro that doesn't take arguments. ac_script=' t clear :clear s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g t quote s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g t quote b any :quote s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g s/\[/\\&/g s/\]/\\&/g s/\$/$$/g H :any ${ g s/^\n// s/\n/ /g p } ' DEFS=`sed -n "$ac_script" confdefs.h` ac_libobjs= ac_ltlibobjs= 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=`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. ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs : ${CONFIG_STATUS=./config.status} ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >$CONFIG_STATUS <<_ACEOF #! $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} _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ## --------------------- ## ## 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=: # 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 # PATH needs CR # 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 # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false 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.) as_nl=' ' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. 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 # Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # CDPATH. $as_unset CDPATH as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, and appends # trailing '-' during substitution so that $LINENO is not a special # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # scripts with optimization help from Paolo Bonzini. 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" || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi 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 fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi 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=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 # Save the log message, to keep $[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by $as_me, which was generated by GNU Autoconf 2.61. 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 cat >>$CONFIG_STATUS <<_ACEOF # Files that config.status was made for. config_files="$ac_config_files" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit -q, --quiet 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 Configuration files: $config_files Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ config.status configured by $0, generated by GNU Autoconf 2.61, with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" Copyright (C) 2006 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' _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # If no file are specified by the user, then we need to provide default # value. By we need to know if files were specified by the user. 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=$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 ) echo "$ac_cs_version"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift CONFIG_FILES="$CONFIG_FILES $ac_optarg" ac_need_defaults=false;; --he | --h | --help | --hel | -h ) 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. -*) { echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *) ac_config_targets="$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 if \$ac_cs_recheck; then echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 CONFIG_SHELL=$SHELL export CONFIG_SHELL exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; 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 fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= trap 'exit_status=$? { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status ' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || { echo "$me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } # # Set up the sed scripts for CONFIG_FILES section. # # No need to generate the scripts if there are no CONFIG_FILES. # This happens for instance when ./config.status config.h if test -n "$CONFIG_FILES"; then _ACEOF ac_delim='%!_!# ' for ac_last_try in false false false false false :; do cat >conf$$subs.sed <<_ACEOF SHELL!$SHELL$ac_delim PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim PACKAGE_NAME!$PACKAGE_NAME$ac_delim PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim PACKAGE_STRING!$PACKAGE_STRING$ac_delim PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim exec_prefix!$exec_prefix$ac_delim prefix!$prefix$ac_delim program_transform_name!$program_transform_name$ac_delim bindir!$bindir$ac_delim sbindir!$sbindir$ac_delim libexecdir!$libexecdir$ac_delim datarootdir!$datarootdir$ac_delim datadir!$datadir$ac_delim sysconfdir!$sysconfdir$ac_delim sharedstatedir!$sharedstatedir$ac_delim localstatedir!$localstatedir$ac_delim includedir!$includedir$ac_delim oldincludedir!$oldincludedir$ac_delim docdir!$docdir$ac_delim infodir!$infodir$ac_delim htmldir!$htmldir$ac_delim dvidir!$dvidir$ac_delim pdfdir!$pdfdir$ac_delim psdir!$psdir$ac_delim libdir!$libdir$ac_delim localedir!$localedir$ac_delim mandir!$mandir$ac_delim DEFS!$DEFS$ac_delim ECHO_C!$ECHO_C$ac_delim ECHO_N!$ECHO_N$ac_delim ECHO_T!$ECHO_T$ac_delim LIBS!$LIBS$ac_delim build_alias!$build_alias$ac_delim host_alias!$host_alias$ac_delim target_alias!$target_alias$ac_delim CC!$CC$ac_delim CFLAGS!$CFLAGS$ac_delim LDFLAGS!$LDFLAGS$ac_delim CPPFLAGS!$CPPFLAGS$ac_delim ac_ct_CC!$ac_ct_CC$ac_delim EXEEXT!$EXEEXT$ac_delim OBJEXT!$OBJEXT$ac_delim CPP!$CPP$ac_delim GREP!$GREP$ac_delim EGREP!$EGREP$ac_delim acctlog_cflags!$acctlog_cflags$ac_delim acctlog_ldflags!$acctlog_ldflags$ac_delim targetname!$targetname$ac_delim LIBOBJS!$LIBOBJS$ac_delim LTLIBOBJS!$LTLIBOBJS$ac_delim _ACEOF if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 52; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` if test -n "$ac_eof"; then ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` ac_eof=`expr $ac_eof + 1` fi cat >>$CONFIG_STATUS <<_ACEOF cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof /@[a-zA-Z_][a-zA-Z_0-9]*@/!b end _ACEOF sed ' s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g s/^/s,@/; s/!/@,|#_!!_#|/ :n t n s/'"$ac_delim"'$/,g/; t s/$/\\/; p N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n ' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF :end s/|#_!!_#|//g CEOF$ac_eof _ACEOF # VPATH may cause trouble with some makes, so we remove $(srcdir), # ${srcdir} and @srcdir@ 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[ ]*=/{ s/:*\$(srcdir):*/:/ s/:*\${srcdir}:*/:/ s/:*@srcdir@:*/:/ s/^\([^=]*=[ ]*\):*/\1/ s/:*$// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF fi # test -n "$CONFIG_FILES" for ac_tag in :F $CONFIG_FILES do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5 echo "$as_me: error: Invalid tag $ac_tag." >&2;} { (exit 1); exit 1; }; };; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 echo "$as_me: error: cannot find input file: $ac_f" >&2;} { (exit 1); exit 1; }; };; esac ac_file_inputs="$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 "`IFS=: echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure." if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { echo "$as_me:$LINENO: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} fi case $ac_tag in *:-:* | *:-) cat >"$tmp/stdin";; 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 || 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" case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`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 || 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" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 echo "$as_me: error: cannot create directory $as_dir" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`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 # _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # 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= case `sed -n '/datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p ' $ac_file_inputs` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF 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 sed "$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s&@configure_input@&$configure_input&;t t s&@top_builddir@&$ac_top_builddir_sub&;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 $ac_datarootdir_hack " $ac_file_inputs | sed -f "$tmp/subs-1.sed" >$tmp/out test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&5 echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&2;} rm -f "$tmp/stdin" case $ac_file in -) cat "$tmp/out"; rm -f "$tmp/out";; *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;; esac ;; esac done # for ac_tag { (exit 0); exit 0; } _ACEOF chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save # 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 || { (exit 1); exit 1; } fi freeradius-server/src/modules/rlm_acctlog/configure.in000066400000000000000000000013741257552170400235660ustar00rootroot00000000000000AC_PREREQ([2.53]) AC_INIT(rlm_acctlog.c) AC_REVISION(0.1) AC_DEFUN(modname,[rlm_acctlog]) if test x$with_[]modname != xno; then AC_PROG_CC AC_PROG_CPP AC_CHECK_HEADER(stdio.h, [ slog_cflags="$acctlog_cflags -I/usr/include" ], [ fail=$fail" stdio.h" ] ) targetname=modname else targetname= echo \*\*\* module modname is disabled. fi dnl Don't change this section. if test x"$fail" != x""; then if test x"${enable_strict_dependencies}" = x"yes"; then AC_MSG_ERROR([set --without-]modname[ to disable it explicitly.]) else AC_MSG_WARN([silently not building ]modname[.]) AC_MSG_WARN([FAILURE: ]modname[ requires: $fail.]); targetname="" fi fi AC_SUBST(acctlog_cflags) AC_SUBST(acctlog_ldflags) AC_SUBST(targetname) AC_OUTPUT(Makefile) freeradius-server/src/modules/rlm_acctlog/rlm_acctlog.c000066400000000000000000000075751257552170400237200ustar00rootroot00000000000000/* * rlm_acctlog.c * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2006 Suntel Communications - www.suntel.com.tr * Copyright 2006 The FreeRADIUS server project * * Tuyan Ozipek * Peter Nixon */ #include RCSID("$Id$") #include #include typedef struct rlm_acctlog_t { char *acctstart; char *acctstop; char *acctupdate; char *accton; char *acctoff; } rlm_acctlog_t; static const CONF_PARSER module_config[] = { { "acctlog_update", PW_TYPE_STRING_PTR, offsetof(rlm_acctlog_t, acctupdate), NULL, ""}, { "acctlog_start", PW_TYPE_STRING_PTR, offsetof(rlm_acctlog_t, acctstart), NULL, ""}, { "acctlog_stop", PW_TYPE_STRING_PTR, offsetof(rlm_acctlog_t, acctstop), NULL, ""}, { "acctlog_on", PW_TYPE_STRING_PTR, offsetof(rlm_acctlog_t, accton), NULL, ""}, { "acctlog_off", PW_TYPE_STRING_PTR, offsetof(rlm_acctlog_t, acctoff), NULL, ""}, { NULL, -1, 0, NULL, NULL } /* end the list */ }; static int acctlog_detach(void *instance) { rlm_acctlog_t *inst = instance; free(inst); return 0; } static int acctlog_instantiate(CONF_SECTION *conf, void **instance) { rlm_acctlog_t *inst; inst = rad_malloc(sizeof(*inst)); memset(inst, 0, sizeof(*inst)); if (cf_section_parse(conf, inst, module_config) < 0) { acctlog_detach(inst); return -1; } *instance = inst; return 0; } static int do_acctlog_acct(void *instance, REQUEST *request) { rlm_acctlog_t *inst; VALUE_PAIR *pair; char logstr[1024]; int acctstatustype = 0; inst = (rlm_acctlog_t*) instance; if ((pair = pairfind(request->packet->vps, PW_ACCT_STATUS_TYPE)) != NULL) { acctstatustype = pair->vp_integer; } else { radius_xlat(logstr, sizeof(logstr), "packet has no accounting status type. [user '%{User-Name}', nas '%{NAS-IP-Address}']", request, NULL); radlog(L_ERR, "rlm_acctlog (%s)", logstr); return RLM_MODULE_INVALID; } switch (acctstatustype) { case PW_STATUS_START: radius_xlat(logstr, sizeof(logstr), inst->acctstart, request, NULL); break; case PW_STATUS_STOP: radius_xlat(logstr, sizeof(logstr), inst->acctstop, request, NULL); break; case PW_STATUS_ALIVE: radius_xlat(logstr, sizeof(logstr), inst->acctupdate, request, NULL); break; case PW_STATUS_ACCOUNTING_ON: radius_xlat(logstr, sizeof(logstr), inst->accton, request, NULL); break; case PW_STATUS_ACCOUNTING_OFF: radius_xlat(logstr, sizeof(logstr), inst->acctoff, request, NULL); break; default: *logstr = 0; } if (*logstr) radlog(L_ACCT,"%s", logstr); return RLM_MODULE_OK; } /* * Externally visible module definition. */ module_t rlm_acctlog = { RLM_MODULE_INIT, "acctlog", RLM_TYPE_CHECK_CONFIG_SAFE, /* type */ acctlog_instantiate, /* instantiation */ acctlog_detach, /* detach */ { NULL, /* authentication */ NULL, /* authorization */ NULL, /* preaccounting */ do_acctlog_acct, /* accounting */ NULL, /* checksimul */ NULL, /* pre-proxy */ NULL, /* post-proxy */ NULL /* post-auth */ }, }; freeradius-server/src/modules/rlm_always/000077500000000000000000000000001257552170400211345ustar00rootroot00000000000000freeradius-server/src/modules/rlm_always/Makefile000066400000000000000000000001421257552170400225710ustar00rootroot00000000000000# # Makefile # # Version: $Id$ # TARGET = rlm_always SRCS = rlm_always.c include ../rules.mak freeradius-server/src/modules/rlm_always/rlm_always.c000066400000000000000000000104071257552170400234540ustar00rootroot00000000000000/* * rlm_always.c * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2000,2006 The FreeRADIUS server project */ #include RCSID("$Id$") #include #include /* * The instance data for rlm_always is the list of fake values we are * going to return. */ typedef struct rlm_always_t { char *rcode_str; int rcode; int simulcount; int mpp; } rlm_always_t; /* * A mapping of configuration file names to internal variables. * * Note that the string is dynamically allocated, so it MUST * be freed. When the configuration file parse re-reads the string, * it free's the old one, and strdup's the new one, placing the pointer * to the strdup'd string into 'config.string'. This gets around * buffer over-flows. */ static const CONF_PARSER module_config[] = { { "rcode", PW_TYPE_STRING_PTR, offsetof(rlm_always_t,rcode_str), NULL, "fail" }, { "simulcount", PW_TYPE_INTEGER, offsetof(rlm_always_t,simulcount), NULL, "0" }, { "mpp", PW_TYPE_BOOLEAN, offsetof(rlm_always_t,mpp), NULL, "no" }, { NULL, -1, 0, NULL, NULL } /* end the list */ }; static int str2rcode(const char *s) { if(!strcasecmp(s, "reject")) return RLM_MODULE_REJECT; else if(!strcasecmp(s, "fail")) return RLM_MODULE_FAIL; else if(!strcasecmp(s, "ok")) return RLM_MODULE_OK; else if(!strcasecmp(s, "handled")) return RLM_MODULE_HANDLED; else if(!strcasecmp(s, "invalid")) return RLM_MODULE_INVALID; else if(!strcasecmp(s, "userlock")) return RLM_MODULE_USERLOCK; else if(!strcasecmp(s, "notfound")) return RLM_MODULE_NOTFOUND; else if(!strcasecmp(s, "noop")) return RLM_MODULE_NOOP; else if(!strcasecmp(s, "updated")) return RLM_MODULE_UPDATED; else { radlog(L_ERR|L_CONS, "rlm_always: Unknown module rcode '%s'.\n", s); return -1; } } static int always_instantiate(CONF_SECTION *conf, void **instance) { rlm_always_t *data; /* * Set up a storage area for instance data */ data = rad_malloc(sizeof(*data)); if (!data) { return -1; } memset(data, 0, sizeof(*data)); /* * If the configuration parameters can't be parsed, then * fail. */ if (cf_section_parse(conf, data, module_config) < 0) { free(data); return -1; } /* * Convert the rcode string to an int, and get rid of it */ data->rcode = str2rcode(data->rcode_str); if (data->rcode == -1) { free(data); return -1; } *instance = data; return 0; } /* * Just return the rcode ... this function is autz, auth, acct, and * preacct! */ static int always_return(void *instance, REQUEST *request) { /* quiet the compiler */ request = request; return ((struct rlm_always_t *)instance)->rcode; } /* * checksimul fakes some other variables besides the rcode... */ static int always_checksimul(void *instance, REQUEST *request) { struct rlm_always_t *inst = instance; request->simul_count = inst->simulcount; if (inst->mpp) request->simul_mpp = 2; return inst->rcode; } static int always_detach(void *instance) { free(instance); return 0; } module_t rlm_always = { RLM_MODULE_INIT, "always", RLM_TYPE_CHECK_CONFIG_SAFE, /* type */ always_instantiate, /* instantiation */ always_detach, /* detach */ { always_return, /* authentication */ always_return, /* authorization */ always_return, /* preaccounting */ always_return, /* accounting */ always_checksimul, /* checksimul */ always_return, /* pre-proxy */ always_return, /* post-proxy */ always_return /* post-auth */ #ifdef WITH_COA , always_return, /* recv-coa */ always_return /* send-coa */ #endif }, }; freeradius-server/src/modules/rlm_attr_filter/000077500000000000000000000000001257552170400221535ustar00rootroot00000000000000freeradius-server/src/modules/rlm_attr_filter/Makefile000066400000000000000000000001541257552170400236130ustar00rootroot00000000000000# # Makefile # # Version: $Id$ # TARGET = rlm_attr_filter SRCS = rlm_attr_filter.c include ../rules.mak freeradius-server/src/modules/rlm_attr_filter/rlm_attr_filter.c000066400000000000000000000223441257552170400255150ustar00rootroot00000000000000/* * rlm_attr_filter.c - Filter A/V Pairs received back from proxy reqs * before sending reply to the NAS/Server that sent * it to us. * * Version: $Id$ * * This program is is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License, version 2 if the * License as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright (C) 2001,2006 The FreeRADIUS server project * Copyright (C) 2001 Chris Parker */ #include RCSID("$Id$") #include #include #include #include #include #include #include /* * Define a structure with the module configuration, so it can * be used as the instance handle. */ struct attr_filter_instance { char *attrsfile; char *key; int relaxed; PAIR_LIST *attrs; }; static const CONF_PARSER module_config[] = { { "attrsfile", PW_TYPE_FILENAME, offsetof(struct attr_filter_instance,attrsfile), NULL, "${raddbdir}/attrs" }, { "key", PW_TYPE_STRING_PTR, offsetof(struct attr_filter_instance,key), NULL, "%{Realm}" }, { "relaxed", PW_TYPE_BOOLEAN, offsetof(struct attr_filter_instance,relaxed), NULL, "no" }, { NULL, -1, 0, NULL, NULL } }; static void check_pair(VALUE_PAIR *check_item, VALUE_PAIR *reply_item, int *pass, int *fail) { int compare; if (check_item->operator == T_OP_SET) return; compare = paircmp(check_item, reply_item); if (compare == 1) { ++*(pass); } else { ++*(fail); } return; } static int getattrsfile(const char *filename, PAIR_LIST **pair_list) { int rcode; PAIR_LIST *attrs = NULL; PAIR_LIST *entry; VALUE_PAIR *vp; rcode = pairlist_read(filename, &attrs, 1); if (rcode < 0) { return -1; } /* * Walk through the 'attrs' file list. */ entry = attrs; while (entry) { entry->check = entry->reply; entry->reply = NULL; for (vp = entry->check; vp != NULL; vp = vp->next) { /* * If it's NOT a vendor attribute, * and it's NOT a wire protocol * and we ignore Fall-Through, * then bitch about it, giving a good warning message. */ if (!(vp->attribute & ~0xffff) && (vp->attribute > 0xff) && (vp->attribute > 1000)) { log_debug("[%s]:%d WARNING! Check item \"%s\"\n" "\tfound in filter list for realm \"%s\".\n", filename, entry->lineno, vp->name, entry->name); } } entry = entry->next; } *pair_list = attrs; return 0; } /* * Clean up. */ static int attr_filter_detach(void *instance) { struct attr_filter_instance *inst = instance; pairlist_free(&inst->attrs); free(inst); return 0; } /* * (Re-)read the "attrs" file into memory. */ static int attr_filter_instantiate(CONF_SECTION *conf, void **instance) { struct attr_filter_instance *inst; int rcode; inst = rad_malloc(sizeof *inst); if (!inst) { return -1; } memset(inst, 0, sizeof(*inst)); if (cf_section_parse(conf, inst, module_config) < 0) { attr_filter_detach(inst); return -1; } rcode = getattrsfile(inst->attrsfile, &inst->attrs); if (rcode != 0) { radlog(L_ERR|L_CONS, "Errors reading %s", inst->attrsfile); attr_filter_detach(inst); return -1; } *instance = inst; return 0; } /* * Common attr_filter checks */ static int attr_filter_common(void *instance, REQUEST *request, RADIUS_PACKET *packet) { struct attr_filter_instance *inst = instance; VALUE_PAIR *vp; VALUE_PAIR *output; VALUE_PAIR **output_tail; VALUE_PAIR *check_item; PAIR_LIST *pl; int found = 0; int pass, fail = 0; char *keyname = NULL; VALUE_PAIR **input; char buffer[256]; if (!packet) return RLM_MODULE_NOOP; input = &(packet->vps); if (!inst->key) { VALUE_PAIR *namepair; namepair = pairfind(request->packet->vps, PW_REALM); if (!namepair) { return (RLM_MODULE_NOOP); } keyname = namepair->vp_strvalue; } else { int len; len = radius_xlat(buffer, sizeof(buffer), inst->key, request, NULL); if (!len) { return RLM_MODULE_NOOP; } keyname = buffer; } output = NULL; output_tail = &output; /* * Find the attr_filter profile entry for the entry. */ for (pl = inst->attrs; pl; pl = pl->next) { int fall_through = 0; int relax_filter = inst->relaxed; /* * If the current entry is NOT a default, * AND the realm does NOT match the current entry, * then skip to the next entry. */ if ((strcmp(pl->name, "DEFAULT") != 0) && (strcmp(keyname, pl->name) != 0)) { continue; } DEBUG2("attr_filter: Matched entry %s at line %d", pl->name, pl->lineno); found = 1; for (check_item = pl->check; check_item != NULL; check_item = check_item->next) { if ((check_item->attribute == PW_FALL_THROUGH) && (check_item->vp_integer == 1)) { fall_through = 1; continue; } else if (check_item->attribute == PW_RELAX_FILTER) { relax_filter = check_item->vp_integer; continue; } /* * If it is a SET operator, add the attribute to * the output list without checking it. */ if (check_item->operator == T_OP_SET ) { vp = paircopyvp(check_item); if (!vp) { pairfree(&output); return RLM_MODULE_FAIL; } pairxlatmove(request, output_tail, &vp); output_tail = &((*output_tail)->next); } } /* * Iterate through the input items, comparing * each item to every rule, then moving it to the * output list only if it matches all rules * for that attribute. IE, Idle-Timeout is moved * only if it matches all rules that describe an * Idle-Timeout. */ for (vp = *input; vp != NULL; vp = vp->next ) { /* reset the pass,fail vars for each reply item */ pass = fail = 0; /* * reset the check_item pointer to * beginning of the list */ for (check_item = pl->check; check_item != NULL; check_item = check_item->next) { /* * Vendor-Specific is special, and * matches any VSA if the comparison * is always true. */ if ((check_item->attribute == PW_VENDOR_SPECIFIC) && (VENDOR(vp->attribute) != 0) && (check_item->operator == T_OP_CMP_TRUE)) { pass++; continue; } if (vp->attribute == check_item->attribute) { check_pair(check_item, vp, &pass, &fail); } } /* * Only move attribute if it passed all rules, * or if the config says we should copy unmatched * attributes ('relaxed' mode). */ if (fail == 0 && (pass > 0 || relax_filter)) { if (!pass) { DEBUG3("attr_filter: Attribute (%s) allowed by relaxed mode", vp->name); } *output_tail = paircopyvp(vp); if (!*output_tail) { pairfree(&output); return RLM_MODULE_FAIL; } output_tail = &((*output_tail)->next); } } /* If we shouldn't fall through, break */ if (!fall_through) break; } /* * No entry matched. We didn't do anything. */ if (!found) { rad_assert(output == NULL); return RLM_MODULE_NOOP; } pairfree(input); *input = output; if (request->packet->code == PW_AUTHENTICATION_REQUEST) { request->username = pairfind(request->packet->vps, PW_STRIPPED_USER_NAME); if (!request->username) request->username = pairfind(request->packet->vps, PW_USER_NAME); request->password = pairfind(request->packet->vps, PW_USER_PASSWORD); } return RLM_MODULE_UPDATED; } static int attr_filter_preacct(void *instance, REQUEST *request) { return attr_filter_common(instance, request, request->packet); } static int attr_filter_accounting(void *instance, REQUEST *request) { return attr_filter_common(instance, request, request->reply); } static int attr_filter_preproxy(void *instance, REQUEST *request) { return attr_filter_common(instance, request, request->proxy); } static int attr_filter_postproxy(void *instance, REQUEST *request) { return attr_filter_common(instance, request, request->proxy_reply); } static int attr_filter_postauth(void *instance, REQUEST *request) { return attr_filter_common(instance, request, request->reply); } static int attr_filter_authorize(void *instance, REQUEST *request) { return attr_filter_common(instance, request, request->packet); } /* globally exported name */ module_t rlm_attr_filter = { RLM_MODULE_INIT, "attr_filter", RLM_TYPE_CHECK_CONFIG_SAFE | RLM_TYPE_HUP_SAFE, /* type */ attr_filter_instantiate, /* instantiation */ attr_filter_detach, /* detach */ { NULL, /* authentication */ attr_filter_authorize, /* authorization */ attr_filter_preacct, /* pre-acct */ attr_filter_accounting, /* accounting */ NULL, /* checksimul */ attr_filter_preproxy, /* pre-proxy */ attr_filter_postproxy, /* post-proxy */ attr_filter_postauth /* post-auth */ }, }; freeradius-server/src/modules/rlm_attr_rewrite/000077500000000000000000000000001257552170400223475ustar00rootroot00000000000000freeradius-server/src/modules/rlm_attr_rewrite/.gitignore000066400000000000000000000000111257552170400243270ustar00rootroot00000000000000Makefile freeradius-server/src/modules/rlm_attr_rewrite/Makefile.in000066400000000000000000000003331257552170400244130ustar00rootroot00000000000000# # $Id$ # TARGET = @targetname@ SRCS = rlm_attr_rewrite.c HEADERS = RLM_CFLAGS = @attr_rewrite_cflags@ RLM_LIBS = @attr_rewrite_ldflags@ RLM_INSTALL = include ../rules.mak $(LT_OBJS): $(HEADERS) freeradius-server/src/modules/rlm_attr_rewrite/configure000077500000000000000000003577041257552170400242760ustar00rootroot00000000000000#! /bin/sh # From configure.in Revision. # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.61. # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, # 2002, 2003, 2004, 2005, 2006 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=: # 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 # PATH needs CR # 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 # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false 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.) as_nl=' ' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. 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 # Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # CDPATH. $as_unset CDPATH if test "x$CONFIG_SHELL" = x; then if (eval ":") 2>/dev/null; then as_have_required=yes else as_have_required=no fi if test $as_have_required = yes && (eval ": (as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=\$LINENO as_lineno_2=\$LINENO test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } ") 2> /dev/null; then : else as_candidate_shells= as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. case $as_dir in /*) for as_base in sh bash ksh sh5; do as_candidate_shells="$as_candidate_shells $as_dir/$as_base" done;; esac done IFS=$as_save_IFS for as_shell in $as_candidate_shells $SHELL; do # Try only shells that exist, to save several forks. if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { ("$as_shell") 2> /dev/null <<\_ASEOF 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 : _ASEOF }; then CONFIG_SHELL=$as_shell as_have_required=yes if { "$as_shell" 2> /dev/null <<\_ASEOF 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 : (as_func_return () { (exit $1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = "$1" ); then : else exitcode=1 echo positional parameters were not saved. fi test $exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } _ASEOF }; then break fi fi done if test "x$CONFIG_SHELL" != x; then for as_var in BASH_ENV ENV do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done export CONFIG_SHELL exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} fi if test $as_have_required = no; then echo This script requires a shell more modern than all the echo shells that I found on your system. Please install a echo modern shell, or manually run the script under such a echo shell if you do have one. { (exit 1); exit 1; } fi fi fi (eval "as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0") || { echo No shell found that supports shell functions. echo Please tell autoconf@gnu.org about your system, echo including any error possibly output before this echo message } as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, and appends # trailing '-' during substitution so that $LINENO is not a special # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # scripts with optimization help from Paolo Bonzini. 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" || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi 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 fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi 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=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, 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= SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME= PACKAGE_TARNAME= PACKAGE_VERSION= PACKAGE_STRING= PACKAGE_BUGREPORT= ac_unique_file="rlm_attr_rewrite.c" # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef STDC_HEADERS # include # include #else # ifdef HAVE_STDLIB_H # include # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datarootdir datadir sysconfdir sharedstatedir localstatedir includedir oldincludedir docdir infodir htmldir dvidir pdfdir psdir libdir localedir mandir DEFS ECHO_C ECHO_N ECHO_T LIBS build_alias host_alias target_alias CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP GREP EGREP attr_rewrite_cflags attr_rewrite_ldflags targetname LIBOBJS LTLIBOBJS' ac_subst_files='' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CPP' # Initialize some variables set by options. ac_init_help= ac_init_version=false # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *) ac_optarg=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_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` eval enable_$ac_feature=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_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` eval enable_$ac_feature=\$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_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/[-.]/_/g'` eval with_$ac_package=\$ac_optarg ;; -without-* | --without-*) ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/[-.]/_/g'` eval with_$ac_package=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 ;; -*) { echo "$as_me: error: unrecognized option: $ac_option Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && 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'` { echo "$as_me: error: missing argument to $ac_option" >&2 { (exit 1); exit 1; }; } fi # Be sure to have absolute directory names. 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 case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; } 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 echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || { echo "$as_me: error: Working directory cannot be determined" >&2 { (exit 1); exit 1; }; } test "X$ac_ls_di" = "X$ac_pwd_ls_di" || { echo "$as_me: error: pwd does not report name of working directory" >&2 { (exit 1); exit 1; }; } # 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 -- "$0" || $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$0" : 'X\(//\)[^/]' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X"$0" | 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 .." { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2 { (exit 1); exit 1; }; } pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures this package to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF _ACEOF fi if test -n "$ac_init_help"; then cat <<\_ACEOF 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 C/C++/Objective C preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. _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" || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`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 echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF configure generated by GNU Autoconf 2.61 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 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 cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by $as_me, which was generated by GNU Autoconf 2.61. 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=. 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=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; 2) ac_configure_args1="$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 ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac done done $as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } $as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export 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 cat <<\_ASBOX ## ---------------- ## ## Cache variables. ## ## ---------------- ## _ASBOX 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_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( *) $as_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 cat <<\_ASBOX ## ----------------- ## ## Output variables. ## ## ----------------- ## _ASBOX echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then cat <<\_ASBOX ## ------------------- ## ## File substitutions. ## ## ------------------- ## _ASBOX echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then cat <<\_ASBOX ## ----------- ## ## confdefs.h. ## ## ----------- ## _ASBOX echo cat confdefs.h echo fi test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" 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'; { (exit 1); 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 # 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 # Let the site file select an alternate cache file if it wants to. # Prefer explicitly selected file to automatically selected ones. if test -n "$CONFIG_SITE"; then set x "$CONFIG_SITE" elif test "x$prefix" != xNONE; then set x "$prefix/share/config.site" "$prefix/etc/config.site" else set x "$ac_default_prefix/share/config.site" \ "$ac_default_prefix/etc/config.site" fi shift for ac_site_file do if test -r "$ac_site_file"; then { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" 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. if test -f "$cache_file"; then { echo "$as_me:$LINENO: loading cache $cache_file" >&5 echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { echo "$as_me:$LINENO: creating cache $cache_file" >&5 echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 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 { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 echo "$as_me: former value: $ac_old_val" >&2;} { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 echo "$as_me: current value: $ac_new_val" >&2;} ac_cache_corrupted=: fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`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. *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 echo "$as_me: error: changes in the environment can compromise the build" >&2;} { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} { (exit 1); exit 1; }; } 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 x$with_rlm_attr_rewrite != xno; then 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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}gcc" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="gcc" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}cc" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="$ac_prog" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&5 echo "$as_me: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } # Provide some information about the compiler. echo "$as_me:$LINENO: checking for C compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (ac_try="$ac_compiler --version >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -v >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -V >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out 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. { echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6; } ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # # List of possible output files, starting from the most likely. # The algorithm is not robust to junk in `.', hence go to wildcards (a.*) # only as a last resort. b.out is created by i960 compilers. ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out' # # The IRIX 6 linker writes into existing files which may not be # executable, retaining their permissions. Remove them first so a # subsequent execution test works. ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link_default") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; 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 | *.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 { echo "$as_me:$LINENO: result: $ac_file" >&5 echo "${ECHO_T}$ac_file" >&6; } if test -z "$ac_file"; then echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: C compiler cannot create executables See \`config.log' for more details." >&5 echo "$as_me: error: C compiler cannot create executables See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } fi ac_exeext=$ac_cv_exeext # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { echo "$as_me:$LINENO: checking whether the C compiler works" >&5 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6; } # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then if { ac_try='./$ac_file' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { echo "$as_me:$LINENO: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&5 echo "$as_me: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi fi fi { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } rm -f a.out a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; } { echo "$as_me:$LINENO: result: $cross_compiling" >&5 echo "${ECHO_T}$cross_compiling" >&6; } { echo "$as_me:$LINENO: checking for suffix of executables" >&5 echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; } if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; 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 | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest$ac_cv_exeext { echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 echo "${ECHO_T}$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT { echo "$as_me:$LINENO: checking for suffix of object files" >&5 echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; } if test "${ac_cv_objext+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; 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 ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 echo "${ECHO_T}$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; } if test "${ac_cv_c_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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 { echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; } GCC=`test $ac_compiler_gnu = yes && echo yes` ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CFLAGS="" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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 { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 echo "${ECHO_T}$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 { echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_c89+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_c89=$ac_arg else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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) { echo "$as_me:$LINENO: result: none needed" >&5 echo "${ECHO_T}none needed" >&6; } ;; xno) { echo "$as_me:$LINENO: result: unsupported" >&5 echo "${ECHO_T}unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;; 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 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 { echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if test "${ac_cv_prog_CPP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f 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 { echo "$as_me:$LINENO: result: $CPP" >&5 echo "${ECHO_T}$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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&5 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } 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 { echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5 echo $ECHO_N "checking for grep that handles long lines and -e... $ECHO_C" >&6; } if test "${ac_cv_path_GREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Extract the first word of "grep ggrep" to use in msg output if test -z "$GREP"; then set dummy grep ggrep; ac_prog_name=$2 if test "${ac_cv_path_GREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" 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 ac_count=`expr $ac_count + 1` 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 fi GREP="$ac_cv_path_GREP" if test -z "$GREP"; then { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} { (exit 1); exit 1; }; } fi else ac_cv_path_GREP=$GREP fi fi { echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5 echo "${ECHO_T}$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { echo "$as_me:$LINENO: checking for egrep" >&5 echo $ECHO_N "checking for egrep... $ECHO_C" >&6; } if test "${ac_cv_path_EGREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else # Extract the first word of "egrep" to use in msg output if test -z "$EGREP"; then set dummy egrep; ac_prog_name=$2 if test "${ac_cv_path_EGREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" 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 ac_count=`expr $ac_count + 1` 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 fi EGREP="$ac_cv_path_EGREP" if test -z "$EGREP"; then { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} { (exit 1); exit 1; }; } fi else ac_cv_path_EGREP=$EGREP fi fi fi { echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 echo "${ECHO_T}$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" { echo "$as_me:$LINENO: checking for ANSI C header files" >&5 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; } if test "${ac_cv_header_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_header_stdc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* 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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* 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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* 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 rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi { echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 echo "${ECHO_T}$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then cat >>confdefs.h <<\_ACEOF #define STDC_HEADERS 1 _ACEOF 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=`echo "ac_cv_header_$ac_header" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Header=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in regex.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? { echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ;; esac { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done if test "$ac_cv_header_regex_h" != "yes"; then { echo "$as_me:$LINENO: result: no regex.h" >&5 echo "${ECHO_T}no regex.h" >&6; } fail=$fail" regex.h" fi targetname=rlm_attr_rewrite else targetname= echo \*\*\* module rlm_attr_rewrite is disabled. fi if test x"$fail" != x""; then if test x"${enable_strict_dependencies}" = x"yes"; then { { echo "$as_me:$LINENO: error: set --without-rlm_attr_rewrite to disable it explicitly." >&5 echo "$as_me: error: set --without-rlm_attr_rewrite to disable it explicitly." >&2;} { (exit 1); exit 1; }; } else { echo "$as_me:$LINENO: WARNING: silently not building rlm_attr_rewrite." >&5 echo "$as_me: WARNING: silently not building rlm_attr_rewrite." >&2;} { echo "$as_me:$LINENO: WARNING: FAILURE: rlm_attr_rewrite requires: $fail." >&5 echo "$as_me: WARNING: FAILURE: rlm_attr_rewrite requires: $fail." >&2;}; targetname="" fi fi unset ac_cv_env_LIBS_set unset ac_cv_env_LIBS_value ac_config_files="$ac_config_files 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_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( *) $as_unset $ac_var ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then test "x$cache_file" != "x/dev/null" && { echo "$as_me:$LINENO: updating cache $cache_file" >&5 echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 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}' # Transform confdefs.h into DEFS. # Protect against shell expansion while executing Makefile rules. # Protect against Makefile macro expansion. # # If the first sed substitution is executed (which looks for macros that # take arguments), then branch to the quote section. Otherwise, # look for a macro that doesn't take arguments. ac_script=' t clear :clear s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g t quote s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g t quote b any :quote s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g s/\[/\\&/g s/\]/\\&/g s/\$/$$/g H :any ${ g s/^\n// s/\n/ /g p } ' DEFS=`sed -n "$ac_script" confdefs.h` ac_libobjs= ac_ltlibobjs= 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=`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. ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs : ${CONFIG_STATUS=./config.status} ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >$CONFIG_STATUS <<_ACEOF #! $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} _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ## --------------------- ## ## 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=: # 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 # PATH needs CR # 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 # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false 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.) as_nl=' ' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. 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 # Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # CDPATH. $as_unset CDPATH as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, and appends # trailing '-' during substitution so that $LINENO is not a special # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # scripts with optimization help from Paolo Bonzini. 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" || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi 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 fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi 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=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 # Save the log message, to keep $[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by $as_me, which was generated by GNU Autoconf 2.61. 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 cat >>$CONFIG_STATUS <<_ACEOF # Files that config.status was made for. config_files="$ac_config_files" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit -q, --quiet 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 Configuration files: $config_files Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ config.status configured by $0, generated by GNU Autoconf 2.61, with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" Copyright (C) 2006 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' _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # If no file are specified by the user, then we need to provide default # value. By we need to know if files were specified by the user. 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=$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 ) echo "$ac_cs_version"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift CONFIG_FILES="$CONFIG_FILES $ac_optarg" ac_need_defaults=false;; --he | --h | --help | --hel | -h ) 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. -*) { echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *) ac_config_targets="$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 if \$ac_cs_recheck; then echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 CONFIG_SHELL=$SHELL export CONFIG_SHELL exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; 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 fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= trap 'exit_status=$? { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status ' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || { echo "$me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } # # Set up the sed scripts for CONFIG_FILES section. # # No need to generate the scripts if there are no CONFIG_FILES. # This happens for instance when ./config.status config.h if test -n "$CONFIG_FILES"; then _ACEOF ac_delim='%!_!# ' for ac_last_try in false false false false false :; do cat >conf$$subs.sed <<_ACEOF SHELL!$SHELL$ac_delim PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim PACKAGE_NAME!$PACKAGE_NAME$ac_delim PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim PACKAGE_STRING!$PACKAGE_STRING$ac_delim PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim exec_prefix!$exec_prefix$ac_delim prefix!$prefix$ac_delim program_transform_name!$program_transform_name$ac_delim bindir!$bindir$ac_delim sbindir!$sbindir$ac_delim libexecdir!$libexecdir$ac_delim datarootdir!$datarootdir$ac_delim datadir!$datadir$ac_delim sysconfdir!$sysconfdir$ac_delim sharedstatedir!$sharedstatedir$ac_delim localstatedir!$localstatedir$ac_delim includedir!$includedir$ac_delim oldincludedir!$oldincludedir$ac_delim docdir!$docdir$ac_delim infodir!$infodir$ac_delim htmldir!$htmldir$ac_delim dvidir!$dvidir$ac_delim pdfdir!$pdfdir$ac_delim psdir!$psdir$ac_delim libdir!$libdir$ac_delim localedir!$localedir$ac_delim mandir!$mandir$ac_delim DEFS!$DEFS$ac_delim ECHO_C!$ECHO_C$ac_delim ECHO_N!$ECHO_N$ac_delim ECHO_T!$ECHO_T$ac_delim LIBS!$LIBS$ac_delim build_alias!$build_alias$ac_delim host_alias!$host_alias$ac_delim target_alias!$target_alias$ac_delim CC!$CC$ac_delim CFLAGS!$CFLAGS$ac_delim LDFLAGS!$LDFLAGS$ac_delim CPPFLAGS!$CPPFLAGS$ac_delim ac_ct_CC!$ac_ct_CC$ac_delim EXEEXT!$EXEEXT$ac_delim OBJEXT!$OBJEXT$ac_delim CPP!$CPP$ac_delim GREP!$GREP$ac_delim EGREP!$EGREP$ac_delim attr_rewrite_cflags!$attr_rewrite_cflags$ac_delim attr_rewrite_ldflags!$attr_rewrite_ldflags$ac_delim targetname!$targetname$ac_delim LIBOBJS!$LIBOBJS$ac_delim LTLIBOBJS!$LTLIBOBJS$ac_delim _ACEOF if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 52; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` if test -n "$ac_eof"; then ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` ac_eof=`expr $ac_eof + 1` fi cat >>$CONFIG_STATUS <<_ACEOF cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof /@[a-zA-Z_][a-zA-Z_0-9]*@/!b end _ACEOF sed ' s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g s/^/s,@/; s/!/@,|#_!!_#|/ :n t n s/'"$ac_delim"'$/,g/; t s/$/\\/; p N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n ' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF :end s/|#_!!_#|//g CEOF$ac_eof _ACEOF # VPATH may cause trouble with some makes, so we remove $(srcdir), # ${srcdir} and @srcdir@ 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[ ]*=/{ s/:*\$(srcdir):*/:/ s/:*\${srcdir}:*/:/ s/:*@srcdir@:*/:/ s/^\([^=]*=[ ]*\):*/\1/ s/:*$// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF fi # test -n "$CONFIG_FILES" for ac_tag in :F $CONFIG_FILES do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5 echo "$as_me: error: Invalid tag $ac_tag." >&2;} { (exit 1); exit 1; }; };; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 echo "$as_me: error: cannot find input file: $ac_f" >&2;} { (exit 1); exit 1; }; };; esac ac_file_inputs="$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 "`IFS=: echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure." if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { echo "$as_me:$LINENO: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} fi case $ac_tag in *:-:* | *:-) cat >"$tmp/stdin";; 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 || 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" case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`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 || 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" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 echo "$as_me: error: cannot create directory $as_dir" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`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 # _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # 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= case `sed -n '/datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p ' $ac_file_inputs` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF 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 sed "$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s&@configure_input@&$configure_input&;t t s&@top_builddir@&$ac_top_builddir_sub&;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 $ac_datarootdir_hack " $ac_file_inputs | sed -f "$tmp/subs-1.sed" >$tmp/out test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&5 echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&2;} rm -f "$tmp/stdin" case $ac_file in -) cat "$tmp/out"; rm -f "$tmp/out";; *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;; esac ;; esac done # for ac_tag { (exit 0); exit 0; } _ACEOF chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save # 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 || { (exit 1); exit 1; } fi freeradius-server/src/modules/rlm_attr_rewrite/configure.in000066400000000000000000000014611257552170400246620ustar00rootroot00000000000000AC_PREREQ([2.53]) AC_INIT(rlm_attr_rewrite.c) AC_REVISION($Revision$) AC_DEFUN(modname,[rlm_attr_rewrite]) if test x$with_[]modname != xno; then AC_PROG_CC AC_PROG_CPP AC_CHECK_HEADERS(regex.h) if test "$ac_cv_header_regex_h" != "yes"; then AC_MSG_RESULT(no regex.h) [ fail=$fail" regex.h" ] fi targetname=modname else targetname= echo \*\*\* module modname is disabled. fi dnl Don't change this section. if test x"$fail" != x""; then if test x"${enable_strict_dependencies}" = x"yes"; then AC_MSG_ERROR([set --without-]modname[ to disable it explicitly.]) else AC_MSG_WARN([silently not building ]modname[.]) AC_MSG_WARN([FAILURE: ]modname[ requires: $fail.]); targetname="" fi fi AC_SUBST(attr_rewrite_cflags) AC_SUBST(attr_rewrite_ldflags) AC_SUBST(targetname) AC_OUTPUT(Makefile) freeradius-server/src/modules/rlm_attr_rewrite/rlm_attr_rewrite.c000066400000000000000000000343221257552170400261040ustar00rootroot00000000000000/* * rlm_attr_rewrite.c * * Version: $Id$ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2002,2006 The FreeRADIUS server project * Copyright 2002 Kostas Kalevras */ #include RCSID("$Id$") #include #include #ifdef HAVE_REGEX_H # include #endif #define RLM_REGEX_INPACKET 0 #define RLM_REGEX_INCONFIG 1 #define RLM_REGEX_INREPLY 2 #define RLM_REGEX_INPROXY 3 #define RLM_REGEX_INPROXYREPLY 4 typedef struct rlm_attr_rewrite_t { char *attribute; /* The attribute to search for */ int attr_num; /* The attribute number */ char *search; /* The pattern to search for */ int search_len; /* The length of the search pattern */ char *searchin_str; /* The VALUE_PAIR list to search in. Can be either packet,reply,proxy,proxy_reply or control (plus it's alias 'config') */ char searchin; /* The same as above just coded as a number for speed */ char *replace; /* The replacement */ int replace_len; /* The length of the replacement string */ int append; /* Switch to control append mode (1,0) */ int nocase; /* Ignore case */ int new_attr; /* Boolean. Do we create a new attribute or not? */ int num_matches; /* Maximum number of matches */ const char *name; /* The module name */ } rlm_attr_rewrite_t; static const CONF_PARSER module_config[] = { { "attribute", PW_TYPE_STRING_PTR, offsetof(rlm_attr_rewrite_t,attribute), NULL, NULL }, { "searchfor", PW_TYPE_STRING_PTR, offsetof(rlm_attr_rewrite_t,search), NULL, NULL }, { "searchin", PW_TYPE_STRING_PTR, offsetof(rlm_attr_rewrite_t,searchin_str), NULL, "packet" }, { "replacewith", PW_TYPE_STRING_PTR, offsetof(rlm_attr_rewrite_t,replace), NULL, NULL }, { "append", PW_TYPE_BOOLEAN, offsetof(rlm_attr_rewrite_t,append),NULL, "no" }, { "ignore_case", PW_TYPE_BOOLEAN, offsetof(rlm_attr_rewrite_t,nocase), NULL, "yes" }, { "new_attribute", PW_TYPE_BOOLEAN, offsetof(rlm_attr_rewrite_t,new_attr), NULL, "no" }, { "max_matches", PW_TYPE_INTEGER, offsetof(rlm_attr_rewrite_t,num_matches), NULL, "10" }, { NULL, -1, 0, NULL, NULL } }; static int attr_rewrite_instantiate(CONF_SECTION *conf, void **instance) { rlm_attr_rewrite_t *data; DICT_ATTR *dattr; /* * Set up a storage area for instance data */ data = rad_malloc(sizeof(*data)); if (!data) { return -1; } memset(data, 0, sizeof(*data)); /* * If the configuration parameters can't be parsed, then * fail. */ if (cf_section_parse(conf, data, module_config) < 0) { free(data); return -1; } /* * Discover the attribute number of the key. */ if (data->attribute == NULL) { radlog(L_ERR, "rlm_attr_rewrite: 'attribute' must be set."); return -1; } if (data->search == NULL || data->replace == NULL) { radlog(L_ERR, "rlm_attr_rewrite: search/replace strings must be set."); return -1; } data->search_len = strlen(data->search); data->replace_len = strlen(data->replace); if (data->replace_len == 0 && data->new_attr){ radlog(L_ERR, "rlm_attr_rewrite: replace string must not be zero length in order to create new attribute."); return -1; } if (data->num_matches < 1 || data->num_matches > MAX_STRING_LEN) { radlog(L_ERR, "rlm_attr_rewrite: Illegal range for match number."); return -1; } if (data->searchin_str == NULL) { radlog(L_ERR, "rlm_attr_rewrite: Illegal searchin directive given. Assuming packet."); data->searchin = RLM_REGEX_INPACKET; } else{ if (strcmp(data->searchin_str, "packet") == 0) data->searchin = RLM_REGEX_INPACKET; else if (strcmp(data->searchin_str, "config") == 0) data->searchin = RLM_REGEX_INCONFIG; else if (strcmp(data->searchin_str, "control") == 0) data->searchin = RLM_REGEX_INCONFIG; else if (strcmp(data->searchin_str, "reply") == 0) data->searchin = RLM_REGEX_INREPLY; else if (strcmp(data->searchin_str, "proxy") == 0) data->searchin = RLM_REGEX_INPROXY; else if (strcmp(data->searchin_str, "proxy_reply") == 0) data->searchin = RLM_REGEX_INPROXYREPLY; else { radlog(L_ERR, "rlm_attr_rewrite: Illegal searchin directive given. Assuming packet."); data->searchin = RLM_REGEX_INPACKET; } } dattr = dict_attrbyname(data->attribute); if (dattr == NULL) { radlog(L_ERR, "rlm_attr_rewrite: No such attribute %s", data->attribute); return -1; } data->attr_num = dattr->attr; /* Add the module instance name */ data->name = cf_section_name2(conf); /* may be NULL */ *instance = data; return 0; } static int do_attr_rewrite(void *instance, REQUEST *request) { rlm_attr_rewrite_t *data = (rlm_attr_rewrite_t *) instance; int ret = RLM_MODULE_NOOP; VALUE_PAIR *attr_vp = NULL; VALUE_PAIR *tmp = NULL; regex_t preg; regmatch_t pmatch[9]; int cflags = 0; int err = 0; char done_xlat = 0; unsigned int len = 0; char err_msg[MAX_STRING_LEN]; unsigned int i = 0; unsigned int j = 0; unsigned int counter = 0; char new_str[MAX_STRING_LEN]; char *ptr, *ptr2; char search_STR[MAX_STRING_LEN]; char replace_STR[MAX_STRING_LEN]; if ((attr_vp = pairfind(request->config_items, PW_REWRITE_RULE)) != NULL){ if (data->name == NULL || strcmp(data->name,attr_vp->vp_strvalue)) return RLM_MODULE_NOOP; } if (data->new_attr){ /* new_attribute = yes */ if (!radius_xlat(replace_STR, sizeof(replace_STR), data->replace, request, NULL)) { DEBUG2("%s: xlat on replace string failed.", data->name); return ret; } attr_vp = pairmake(data->attribute,replace_STR,0); if (attr_vp == NULL){ DEBUG2("%s: Could not add new attribute %s with value '%s'", data->name, data->attribute,replace_STR); return ret; } switch(data->searchin){ case RLM_REGEX_INPACKET: pairadd(&request->packet->vps,attr_vp); break; case RLM_REGEX_INCONFIG: pairadd(&request->config_items,attr_vp); break; case RLM_REGEX_INREPLY: pairadd(&request->reply->vps,attr_vp); break; case RLM_REGEX_INPROXY: if (!request->proxy) { pairbasicfree(attr_vp); return RLM_MODULE_NOOP; } pairadd(&request->proxy->vps, attr_vp); break; case RLM_REGEX_INPROXYREPLY: if (!request->proxy_reply) { pairbasicfree(attr_vp); return RLM_MODULE_NOOP; } pairadd(&request->proxy_reply->vps, attr_vp); break; default: radlog(L_ERR, "%s: Illegal value for searchin. Changing to packet.", data->name); data->searchin = RLM_REGEX_INPACKET; pairadd(&request->packet->vps,attr_vp); break; } DEBUG2("%s: Added attribute %s with value '%s'", data->name,data->attribute,replace_STR); ret = RLM_MODULE_OK; } else { int replace_len = 0; /* new_attribute = no */ switch (data->searchin) { case RLM_REGEX_INPACKET: if (data->attr_num == PW_USER_NAME) attr_vp = request->username; else if (data->attr_num == PW_USER_PASSWORD) attr_vp = request->password; else tmp = request->packet->vps; break; case RLM_REGEX_INCONFIG: tmp = request->config_items; break; case RLM_REGEX_INREPLY: tmp = request->reply->vps; break; case RLM_REGEX_INPROXYREPLY: if (!request->proxy_reply) return RLM_MODULE_NOOP; tmp = request->proxy_reply->vps; break; case RLM_REGEX_INPROXY: if (!request->proxy) return RLM_MODULE_NOOP; tmp = request->proxy->vps; break; default: radlog(L_ERR, "%s: Illegal value for searchin. Changing to packet.", data->name); data->searchin = RLM_REGEX_INPACKET; attr_vp = pairfind(request->packet->vps, data->attr_num); break; } do_again: if (tmp != NULL) attr_vp = pairfind(tmp, data->attr_num); if (attr_vp == NULL) { DEBUG2("%s: Could not find value pair for attribute %s", data->name,data->attribute); return ret; } if (attr_vp->vp_strvalue == NULL || attr_vp->length == 0){ DEBUG2("%s: Attribute %s string value NULL or of zero length", data->name,data->attribute); return ret; } cflags |= REG_EXTENDED; if (data->nocase) cflags |= REG_ICASE; if (!radius_xlat(search_STR, sizeof(search_STR), data->search, request, NULL) && data->search_len != 0) { DEBUG2("%s: xlat on search string failed.", data->name); return ret; } if ((err = regcomp(&preg,search_STR,cflags))) { regerror(err, &preg, err_msg, MAX_STRING_LEN); DEBUG2("%s: regcomp() returned error: %s", data->name,err_msg); return ret; } if ((attr_vp->type == PW_TYPE_IPADDR) && (attr_vp->vp_strvalue[0] == '\0')) { inet_ntop(AF_INET, &(attr_vp->vp_ipaddr), attr_vp->vp_strvalue, sizeof(attr_vp->vp_strvalue)); } ptr = new_str; ptr2 = attr_vp->vp_strvalue; counter = 0; for ( i = 0 ;i < (unsigned)data->num_matches; i++) { err = regexec(&preg, ptr2, REQUEST_MAX_REGEX, pmatch, 0); if (err == REG_NOMATCH) { if (i == 0) { DEBUG2("%s: Does not match: %s = %s", data->name, data->attribute, attr_vp->vp_strvalue); regfree(&preg); goto to_do_again; } else break; } if (err != 0) { regfree(&preg); radlog(L_ERR, "%s: match failure for attribute %s with value '%s'", data->name, data->attribute, attr_vp->vp_strvalue); return ret; } if (pmatch[0].rm_so == -1) break; len = pmatch[0].rm_so; if (data->append) { len = len + (pmatch[0].rm_eo - pmatch[0].rm_so); } counter += len; if (counter >= MAX_STRING_LEN) { regfree(&preg); DEBUG2("%s: Replacement out of limits for attribute %s with value '%s'", data->name, data->attribute, attr_vp->vp_strvalue); return ret; } memcpy(ptr, ptr2,len); ptr += len; *ptr = '\0'; ptr2 += pmatch[0].rm_eo; if (i == 0){ /* * We only run on the first match, sorry */ for(j = 0; j <= REQUEST_MAX_REGEX; j++){ char *p; char buffer[sizeof(attr_vp->vp_strvalue)]; /* * Stolen from src/main/valuepair.c, paircompare() */ /* * Delete old matches if the corresponding match does not * exist in the current regex */ if (pmatch[j].rm_so == -1){ p = request_data_get(request,request,REQUEST_DATA_REGEX | j); if (p){ free(p); continue; } break; } memcpy(buffer, attr_vp->vp_strvalue + pmatch[j].rm_so, pmatch[j].rm_eo - pmatch[j].rm_so); buffer[pmatch[j].rm_eo - pmatch[j].rm_so] = '\0'; p = strdup(buffer); request_data_add(request,request,REQUEST_DATA_REGEX | j,p,free); } } if (!done_xlat){ if (data->replace_len != 0 && radius_xlat(replace_STR, sizeof(replace_STR), data->replace, request, NULL) == 0) { DEBUG2("%s: xlat on replace string failed.", data->name); return ret; } replace_len = (data->replace_len != 0) ? strlen(replace_STR) : 0; done_xlat = 1; } counter += replace_len; if (counter >= MAX_STRING_LEN) { regfree(&preg); DEBUG2("%s: Replacement out of limits for attribute %s with value '%s'", data->name, data->attribute, attr_vp->vp_strvalue); return ret; } if (replace_len){ memcpy(ptr, replace_STR, replace_len); ptr += replace_len; *ptr = '\0'; } } regfree(&preg); len = strlen(ptr2) + 1; /* We add the ending NULL */ counter += len; if (counter >= MAX_STRING_LEN){ DEBUG2("%s: Replacement out of limits for attribute %s with value '%s'", data->name, data->attribute, attr_vp->vp_strvalue); return ret; } memcpy(ptr, ptr2, len); ptr[len] = '\0'; DEBUG2("%s: Changed value for attribute %s from '%s' to '%s'", data->name, data->attribute, attr_vp->vp_strvalue, new_str); if (pairparsevalue(attr_vp, new_str) == NULL) { DEBUG2("%s: Could not write value '%s' into attribute %s: %s", data->name, new_str, data->attribute, fr_strerror()); return ret; } to_do_again: ret = RLM_MODULE_OK; if (tmp != NULL){ tmp = attr_vp->next; if (tmp != NULL) goto do_again; } } return ret; } static int attr_rewrite_accounting(void *instance, REQUEST *request) { return do_attr_rewrite(instance, request); } static int attr_rewrite_authorize(void *instance, REQUEST *request) { return do_attr_rewrite(instance, request); } static int attr_rewrite_authenticate(void *instance, REQUEST *request) { return do_attr_rewrite(instance, request); } static int attr_rewrite_preacct(void *instance, REQUEST *request) { return do_attr_rewrite(instance, request); } static int attr_rewrite_checksimul(void *instance, REQUEST *request) { return do_attr_rewrite(instance, request); } static int attr_rewrite_preproxy(void *instance, REQUEST *request) { return do_attr_rewrite(instance, request); } static int attr_rewrite_postproxy(void *instance, REQUEST *request) { return do_attr_rewrite(instance, request); } static int attr_rewrite_postauth(void *instance, REQUEST *request) { return do_attr_rewrite(instance, request); } static int attr_rewrite_detach(void *instance) { free(instance); return 0; } /* * The module name should be the only globally exported symbol. * That is, everything else should be 'static'. * * If the module needs to temporarily modify it's instantiation * data, the type should be changed to RLM_TYPE_THREAD_UNSAFE. * The server will then take care of ensuring that the module * is single-threaded. */ module_t rlm_attr_rewrite = { RLM_MODULE_INIT, "attr_rewrite", RLM_TYPE_THREAD_UNSAFE, /* type */ attr_rewrite_instantiate, /* instantiation */ attr_rewrite_detach, /* detach */ { attr_rewrite_authenticate, /* authentication */ attr_rewrite_authorize, /* authorization */ attr_rewrite_preacct, /* preaccounting */ attr_rewrite_accounting, /* accounting */ attr_rewrite_checksimul, /* checksimul */ attr_rewrite_preproxy, /* pre-proxy */ attr_rewrite_postproxy, /* post-proxy */ attr_rewrite_postauth /* post-auth */ }, }; freeradius-server/src/modules/rlm_cache/000077500000000000000000000000001257552170400206775ustar00rootroot00000000000000freeradius-server/src/modules/rlm_cache/Makefile000066400000000000000000000002341257552170400223360ustar00rootroot00000000000000TARGET = rlm_cache SRCS = rlm_cache.c HEADERS = RLM_CFLAGS = RLM_LIBS = include ../rules.mak $(STATIC_OBJS): $(HEADERS) $(DYNAMIC_OBJS): $(HEADERS) freeradius-server/src/modules/rlm_cache/rlm_cache.c000066400000000000000000000340121257552170400227600ustar00rootroot00000000000000/* * rlm_cache.c * * Version: $Id$ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2012 The FreeRADIUS server project */ #include RCSID("$Id$") #include #include #include #include /* * Define a structure for our module configuration. * * These variables do not need to be in a structure, but it's * a lot cleaner to do so, and a pointer to the structure can * be used as the instance handle. */ typedef struct rlm_cache_t { const char *xlat_name; char *key; int ttl; int epoch; int stats; int max_entries; CONF_SECTION *cs; rbtree_t *cache; fr_heap_t *heap; #ifdef HAVE_PTHREAD_H pthread_mutex_t cache_mutex; #endif } rlm_cache_t; typedef struct rlm_cache_entry_t { const char *key; int offset; long long int hits; time_t created; time_t expires; VALUE_PAIR *control; VALUE_PAIR *request; VALUE_PAIR *reply; } rlm_cache_entry_t; #ifdef HAVE_PTHREAD_H #define PTHREAD_MUTEX_LOCK pthread_mutex_lock #define PTHREAD_MUTEX_UNLOCK pthread_mutex_unlock #else #define PTHREAD_MUTEX_LOCK(_x) #define PTHREAD_MUTEX_UNLOCK(_x) #endif /* * Compare two entries by key. There may only be one entry with * the same key. */ static int cache_entry_cmp(const void *one, const void *two) { const rlm_cache_entry_t *a = one; const rlm_cache_entry_t *b = two; return strcmp(a->key, b->key); } static void cache_entry_free(void *data) { rlm_cache_entry_t *c = data; free(c->key); pairfree(&c->control); pairfree(&c->request); pairfree(&c->reply); free(c); } /* * Compare two entries by expiry time. There may be multiple * entries with the same expiry time. */ static int cache_heap_cmp(const void *one, const void *two) { const rlm_cache_entry_t *a = one; const rlm_cache_entry_t *b = two; if (a->expires < b->expires) return -1; if (a->expires > b->expires) return +1; return 0; } /* * Merge a cached entry into a REQUEST. */ static void cache_merge(rlm_cache_t *inst, REQUEST *request, rlm_cache_entry_t *c) { VALUE_PAIR *vp; rad_assert(request != NULL); rad_assert(c != NULL); if (c->control) { vp = paircopy(c->control); pairmove(&request->config_items, &vp); pairfree(&vp); } if (c->request && request->packet) { vp = paircopy(c->request); pairmove(&request->packet->vps, &vp); pairfree(&vp); } if (c->reply && request->reply) { vp = paircopy(c->reply); pairmove(&request->reply->vps, &vp); pairfree(&vp); } if (inst->stats && request->packet) { vp = paircreate(PW_CACHE_ENTRY_HITS, PW_TYPE_INTEGER); rad_assert(vp != NULL); vp->vp_integer = c->hits; pairadd(&request->packet->vps, vp); } } /* * Find a cached entry. */ static rlm_cache_entry_t *cache_find(rlm_cache_t *inst, REQUEST *request, const char *key) { int ttl; rlm_cache_entry_t *c, my_c; VALUE_PAIR *vp; /* * Look at the expiry heap. */ c = fr_heap_peek(inst->heap); if (!c) { rad_assert(rbtree_num_elements(inst->cache) == 0); return NULL; } /* * If it's time to expire an old entry, do so now. */ if (c->expires < request->timestamp) { fr_heap_extract(inst->heap, c); rbtree_deletebydata(inst->cache, c); } /* * Is there an entry for this key? */ my_c.key = key; c = rbtree_finddata(inst->cache, &my_c); if (!c) return NULL; /* * Yes, but it expired, OR the "forget all" epoch has * passed. Delete it, and pretend it doesn't exist. */ if ((c->expires < request->timestamp) || (c->created < inst->epoch)) { delete: DEBUG("rlm_cache: Entry has expired, removing"); fr_heap_extract(inst->heap, c); rbtree_deletebydata(inst->cache, c); return NULL; } DEBUG("rlm_cache: Found entry for \"%s\"", key); /* * Update the expiry time based on the TTL. * A TTL of 0 means "delete from the cache". */ vp = pairfind(request->config_items, PW_CACHE_TTL); if (vp) { if (vp->vp_integer == 0) goto delete; ttl = vp->vp_integer; c->expires = request->timestamp + ttl; DEBUG("rlm_cache: Adding %d to the TTL", ttl); } c->hits++; return c; } /* * Add an entry to the cache. */ static rlm_cache_entry_t *cache_add(rlm_cache_t *inst, REQUEST *request, const char *key) { int ttl; const char *attr, *p; VALUE_PAIR *vp, **vps; CONF_ITEM *ci; CONF_PAIR *cp; rlm_cache_entry_t *c; char buffer[1024]; if (rbtree_num_elements(inst->cache) >= inst->max_entries) { RDEBUG("Cache is full: %d entries", inst->max_entries); return NULL; } /* * TTL of 0 means "don't cache this entry" */ vp = pairfind(request->config_items, PW_CACHE_TTL); if (vp && (vp->vp_integer == 0)) return NULL; c = rad_malloc(sizeof(*c)); memset(c, 0, sizeof(*c)); c->key = strdup(key); c->created = c->expires = request->timestamp; /* * Use per-entry TTL, or globally defined one. */ if (vp) { ttl = vp->vp_integer; } else { ttl = inst->ttl; } c->expires += ttl; /* * Walk over the attributes to cache, dynamically * expanding them, and adding them to the correct list. */ for (ci = cf_item_find_next(inst->cs, NULL); ci != NULL; ci = cf_item_find_next(inst->cs, ci)) { rad_assert(cf_item_is_pair(ci)); cp = cf_itemtopair(ci); attr = cf_pair_attr(cp); if (strncmp(attr, "control:", 8) == 0) { p = attr + 8; vps = &c->control; } else if (strncmp(attr, "request:", 8) == 0) { p = attr + 8; vps = &c->request; } else if (strncmp(attr, "reply:", 6) == 0) { p = attr + 6; vps = &c->reply; } else { p = attr; vps = &c->request; } /* * Repeat much of cf_pairtovp here... * but we take list prefixes, and it doesn't. * I don't want to make that change for 2.0. */ radius_xlat(buffer, sizeof(buffer), cf_pair_value(cp), request, NULL); vp = pairmake(p, buffer, cf_pair_operator(cp)); pairadd(vps, vp); } if (!rbtree_insert(inst->cache, c)) { DEBUG("rlm_cache: FAILED adding entry for key %s", key); cache_entry_free(c); return NULL; } if (!fr_heap_insert(inst->heap, c)) { DEBUG("rlm_cache: FAILED adding entry for key %s", key); rbtree_deletebydata(inst->cache, c); return NULL; } DEBUG("rlm_cache: Adding entry for \"%s\", with TTL of %d", key, ttl); return c; } /* * Verify that the cache section makes sense. */ static int cache_verify(rlm_cache_t *inst) { const char *attr, *p; CONF_ITEM *ci; CONF_PAIR *cp; for (ci = cf_item_find_next(inst->cs, NULL); ci != NULL; ci = cf_item_find_next(inst->cs, ci)) { if (!cf_item_is_pair(ci)) { cf_log_err(ci, "rlm_cache: Entry is not in \"attribute = value\" format"); return 0; } cp = cf_itemtopair(ci); attr = cf_pair_attr(cp); if (strncmp(attr, "control:", 8) == 0) { p = attr + 8; } else if (strncmp(attr, "request:", 8) == 0) { p = attr + 8; } else if (strncmp(attr, "reply:", 6) == 0) { p = attr + 6; } else { p = attr; } /* * FIXME: Can't do tags for now... */ if (!dict_attrbyname(p)) { cf_log_err(ci, "rlm_cache: Unknown attribute \"%s\"", p); return 0; } if (!cf_pair_value(cp)) { cf_log_err(ci, "rlm_cache: Attribute has no value"); return 0; } } return 1; } /* * Allow single attribute values to be retrieved from the cache. */ static int cache_xlat(void *instance, REQUEST *request, char *fmt, char *out, size_t freespace, UNUSED RADIUS_ESCAPE_STRING func) { rlm_cache_entry_t *c; rlm_cache_t *inst = instance; VALUE_PAIR *vp, *vps; DICT_ATTR *target; const char *p = fmt; char buffer[1024]; int ret = 0; radius_xlat(buffer, sizeof(buffer), inst->key, request, NULL); PTHREAD_MUTEX_LOCK(&inst->cache_mutex); c = cache_find(inst, request, buffer); if (!c) { RDEBUG("No cache entry for key \"%s\"", buffer); goto done; } if (strncmp(fmt, "control:", 8) == 0) { p = fmt + 8; vps = c->control; } else if (strncmp(fmt, "request:", 8) == 0) { p = fmt + 8; vps = c->request; } else if (strncmp(fmt, "reply:", 6) == 0) { p = fmt + 6; vps = c->reply; } else { p = fmt; vps = c->request; } target = dict_attrbyname(p); if (!target) { radlog(L_ERR, "rlm_cache: Unknown attribute \"%s\"", p); goto done; } vp = pairfind(vps, target->attr); if (!vp) { RDEBUG("No instance of this attribute has been cached"); goto done; } ret = vp_prints_value(out, freespace, vp, 0); done: PTHREAD_MUTEX_UNLOCK(&inst->cache_mutex); return ret; } /* * A mapping of configuration file names to internal variables. * * Note that the string is dynamically allocated, so it MUST * be freed. When the configuration file parse re-reads the string, * it free's the old one, and strdup's the new one, placing the pointer * to the strdup'd string into 'config.string'. This gets around * buffer over-flows. */ static const CONF_PARSER module_config[] = { { "key", PW_TYPE_STRING_PTR, offsetof(rlm_cache_t, key), NULL, NULL}, { "ttl", PW_TYPE_INTEGER, offsetof(rlm_cache_t, ttl), NULL, "500" }, { "max_entries", PW_TYPE_INTEGER, offsetof(rlm_cache_t, max_entries), NULL, "16384" }, { "epoch", PW_TYPE_INTEGER, offsetof(rlm_cache_t, epoch), NULL, "0" }, { "add-stats", PW_TYPE_BOOLEAN, offsetof(rlm_cache_t, stats), NULL, "no" }, { NULL, -1, 0, NULL, NULL } /* end the list */ }; /* * Only free memory we allocated. The strings allocated via * cf_section_parse() do not need to be freed. */ static int cache_detach(void *instance) { rlm_cache_t *inst = instance; free(inst->key); free(inst->xlat_name); fr_heap_delete(inst->heap); rbtree_free(inst->cache); #ifdef HAVE_PTHREAD_H pthread_mutex_destroy(&inst->cache_mutex); #endif free(instance); return 0; } /* * Instantiate the module. */ static int cache_instantiate(CONF_SECTION *conf, void **instance) { const char *xlat_name; rlm_cache_t *inst; inst = rad_malloc(sizeof(*inst)); if (!inst) { return -1; } memset(inst, 0, sizeof(*inst)); /* * If the configuration parameters can't be parsed, then * fail. */ if (cf_section_parse(conf, inst, module_config) < 0) { free(inst); return -1; } xlat_name = cf_section_name2(conf); if (xlat_name == NULL) { xlat_name = cf_section_name1(conf); } rad_assert(xlat_name); /* * Register the cache xlat function */ inst->xlat_name = strdup(xlat_name); xlat_register(xlat_name, (RAD_XLAT_FUNC)cache_xlat, inst); if (!inst->key || !*inst->key) { radlog(L_ERR, "rlm_cache: You must specify a key"); cache_detach(inst); return -1; } if (inst->ttl == 0) { radlog(L_ERR, "rlm_cache: TTL must be greater than zero"); cache_detach(inst); return -1; } if (inst->epoch != 0){ radlog(L_ERR, "rlm_cache: Epoch should only be set dynamically"); cache_detach(inst); return -1; } #ifdef HAVE_PTHREAD_H if (pthread_mutex_init(&inst->cache_mutex, NULL) < 0) { radlog(L_ERR, "rlm_cache: Failed initializing mutex: %s", strerror(errno)); cache_detach(inst); return -1; } #endif /* * The cache. */ inst->cache = rbtree_create(cache_entry_cmp, cache_entry_free, 0); if (!inst->cache) { radlog(L_ERR, "rlm_cache: Failed to create cache"); cache_detach(inst); return -1; } /* * The heap of entries to expire. */ inst->heap = fr_heap_create(cache_heap_cmp, offsetof(rlm_cache_entry_t, offset)); if (!inst->heap) { radlog(L_ERR, "rlm_cache: Failed to create cache"); cache_detach(inst); return -1; } inst->cs = cf_section_sub_find(conf, "update"); if (!inst->cs) { radlog(L_ERR, "rlm_cache: Failed to find \"update\" subsection"); cache_detach(inst); return -1; } /* * Make sure the users don't screw up too badly. */ if (!cache_verify(inst)) { cache_detach(inst); return -1; } *instance = inst; return 0; } /* * Do caching checks. Since we can update ANY VP list, we do * exactly the same thing for all sections (autz / auth / etc.) * * If you want to cache something different in different sections, * configure another cache module. */ static int cache_it(void *instance, REQUEST *request) { rlm_cache_entry_t *c; rlm_cache_t *inst = instance; VALUE_PAIR *vp; char buffer[1024]; int rcode; radius_xlat(buffer, sizeof(buffer), inst->key, request, NULL); PTHREAD_MUTEX_LOCK(&inst->cache_mutex); c = cache_find(inst, request, buffer); /* * If yes, only return whether we found a valid cache entry */ vp = pairfind(request->config_items, PW_CACHE_STATUS_ONLY); if (vp && vp->vp_integer) { rcode = c ? RLM_MODULE_OK: RLM_MODULE_NOTFOUND; goto done; } if (c) { cache_merge(inst, request, c); rcode = RLM_MODULE_OK; goto done; } c = cache_add(inst, request, buffer); if (!c) { rcode = RLM_MODULE_NOOP; goto done; } cache_merge(inst, request, c); rcode = RLM_MODULE_UPDATED; done: PTHREAD_MUTEX_UNLOCK(&inst->cache_mutex); return rcode; } /* * The module name should be the only globally exported symbol. * That is, everything else should be 'static'. * * If the module needs to temporarily modify it's instantiation * data, the type should be changed to RLM_TYPE_THREAD_UNSAFE. * The server will then take care of ensuring that the module * is single-threaded. */ module_t rlm_cache = { RLM_MODULE_INIT, "cache", 0, /* type */ cache_instantiate, /* instantiation */ cache_detach, /* detach */ { NULL, /* authentication */ cache_it, /* authorization */ cache_it, /* preaccounting */ cache_it, /* accounting */ NULL, /* checksimul */ cache_it, /* pre-proxy */ cache_it, /* post-proxy */ cache_it, /* post-auth */ }, }; freeradius-server/src/modules/rlm_caching/000077500000000000000000000000001257552170400212305ustar00rootroot00000000000000freeradius-server/src/modules/rlm_caching/Makefile.in000066400000000000000000000003141257552170400232730ustar00rootroot00000000000000# # $Id$ # TARGET = @targetname@ SRCS = rlm_caching.c HEADERS = RLM_CFLAGS = @caching_cflags@ RLM_LIBS = @caching_ldflags@ RLM_INSTALL = include ../rules.mak $(LT_OBJS): $(HEADERS) freeradius-server/src/modules/rlm_caching/config.h.in000066400000000000000000000010751257552170400232560ustar00rootroot00000000000000/* config.h.in. Generated from configure.in by autoheader. */ /* do we have gdbm_fdesc */ #undef HAVE_GDBM_FDESC /* do we need GDBM_SYNC */ #undef NEED_GDBM_SYNC /* 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 version of this package. */ #undef PACKAGE_VERSION freeradius-server/src/modules/rlm_caching/configure000077500000000000000000003713531257552170400231530ustar00rootroot00000000000000#! /bin/sh # From configure.in Revision. # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.61. # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, # 2002, 2003, 2004, 2005, 2006 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=: # 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 # PATH needs CR # 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 # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false 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.) as_nl=' ' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. 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 # Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # CDPATH. $as_unset CDPATH if test "x$CONFIG_SHELL" = x; then if (eval ":") 2>/dev/null; then as_have_required=yes else as_have_required=no fi if test $as_have_required = yes && (eval ": (as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=\$LINENO as_lineno_2=\$LINENO test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } ") 2> /dev/null; then : else as_candidate_shells= as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. case $as_dir in /*) for as_base in sh bash ksh sh5; do as_candidate_shells="$as_candidate_shells $as_dir/$as_base" done;; esac done IFS=$as_save_IFS for as_shell in $as_candidate_shells $SHELL; do # Try only shells that exist, to save several forks. if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { ("$as_shell") 2> /dev/null <<\_ASEOF 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 : _ASEOF }; then CONFIG_SHELL=$as_shell as_have_required=yes if { "$as_shell" 2> /dev/null <<\_ASEOF 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 : (as_func_return () { (exit $1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = "$1" ); then : else exitcode=1 echo positional parameters were not saved. fi test $exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } _ASEOF }; then break fi fi done if test "x$CONFIG_SHELL" != x; then for as_var in BASH_ENV ENV do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done export CONFIG_SHELL exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} fi if test $as_have_required = no; then echo This script requires a shell more modern than all the echo shells that I found on your system. Please install a echo modern shell, or manually run the script under such a echo shell if you do have one. { (exit 1); exit 1; } fi fi fi (eval "as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0") || { echo No shell found that supports shell functions. echo Please tell autoconf@gnu.org about your system, echo including any error possibly output before this echo message } as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, and appends # trailing '-' during substitution so that $LINENO is not a special # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # scripts with optimization help from Paolo Bonzini. 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" || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi 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 fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi 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=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, 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= SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME= PACKAGE_TARNAME= PACKAGE_VERSION= PACKAGE_STRING= PACKAGE_BUGREPORT= ac_unique_file="rlm_caching.c" ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datarootdir datadir sysconfdir sharedstatedir localstatedir includedir oldincludedir docdir infodir htmldir dvidir pdfdir psdir libdir localedir mandir DEFS ECHO_C ECHO_N ECHO_T LIBS build_alias host_alias target_alias CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP GREP EGREP caching_ldflags caching_cflags targetname LIBOBJS LTLIBOBJS' ac_subst_files='' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CPP' # Initialize some variables set by options. ac_init_help= ac_init_version=false # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *) ac_optarg=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_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` eval enable_$ac_feature=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_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` eval enable_$ac_feature=\$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_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/[-.]/_/g'` eval with_$ac_package=\$ac_optarg ;; -without-* | --without-*) ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/[-.]/_/g'` eval with_$ac_package=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 ;; -*) { echo "$as_me: error: unrecognized option: $ac_option Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && 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'` { echo "$as_me: error: missing argument to $ac_option" >&2 { (exit 1); exit 1; }; } fi # Be sure to have absolute directory names. 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 case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; } 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 echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || { echo "$as_me: error: Working directory cannot be determined" >&2 { (exit 1); exit 1; }; } test "X$ac_ls_di" = "X$ac_pwd_ls_di" || { echo "$as_me: error: pwd does not report name of working directory" >&2 { (exit 1); exit 1; }; } # 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 -- "$0" || $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$0" : 'X\(//\)[^/]' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X"$0" | 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 .." { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2 { (exit 1); exit 1; }; } pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures this package to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF _ACEOF fi if test -n "$ac_init_help"; then cat <<\_ACEOF 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 C/C++/Objective C preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. _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" || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`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 echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF configure generated by GNU Autoconf 2.61 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 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 cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by $as_me, which was generated by GNU Autoconf 2.61. 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=. 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=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; 2) ac_configure_args1="$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 ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac done done $as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } $as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export 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 cat <<\_ASBOX ## ---------------- ## ## Cache variables. ## ## ---------------- ## _ASBOX 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_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( *) $as_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 cat <<\_ASBOX ## ----------------- ## ## Output variables. ## ## ----------------- ## _ASBOX echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then cat <<\_ASBOX ## ------------------- ## ## File substitutions. ## ## ------------------- ## _ASBOX echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then cat <<\_ASBOX ## ----------- ## ## confdefs.h. ## ## ----------- ## _ASBOX echo cat confdefs.h echo fi test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" 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'; { (exit 1); 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 # 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 # Let the site file select an alternate cache file if it wants to. # Prefer explicitly selected file to automatically selected ones. if test -n "$CONFIG_SITE"; then set x "$CONFIG_SITE" elif test "x$prefix" != xNONE; then set x "$prefix/share/config.site" "$prefix/etc/config.site" else set x "$ac_default_prefix/share/config.site" \ "$ac_default_prefix/etc/config.site" fi shift for ac_site_file do if test -r "$ac_site_file"; then { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" 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. if test -f "$cache_file"; then { echo "$as_me:$LINENO: loading cache $cache_file" >&5 echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { echo "$as_me:$LINENO: creating cache $cache_file" >&5 echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 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 { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 echo "$as_me: former value: $ac_old_val" >&2;} { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 echo "$as_me: current value: $ac_new_val" >&2;} ac_cache_corrupted=: fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`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. *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 echo "$as_me: error: changes in the environment can compromise the build" >&2;} { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} { (exit 1); exit 1; }; } 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 x$with_rlm_caching != xno; then 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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}gcc" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="gcc" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}cc" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="$ac_prog" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&5 echo "$as_me: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } # Provide some information about the compiler. echo "$as_me:$LINENO: checking for C compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (ac_try="$ac_compiler --version >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -v >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -V >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out 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. { echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6; } ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # # List of possible output files, starting from the most likely. # The algorithm is not robust to junk in `.', hence go to wildcards (a.*) # only as a last resort. b.out is created by i960 compilers. ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out' # # The IRIX 6 linker writes into existing files which may not be # executable, retaining their permissions. Remove them first so a # subsequent execution test works. ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link_default") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; 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 | *.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 { echo "$as_me:$LINENO: result: $ac_file" >&5 echo "${ECHO_T}$ac_file" >&6; } if test -z "$ac_file"; then echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: C compiler cannot create executables See \`config.log' for more details." >&5 echo "$as_me: error: C compiler cannot create executables See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } fi ac_exeext=$ac_cv_exeext # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { echo "$as_me:$LINENO: checking whether the C compiler works" >&5 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6; } # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then if { ac_try='./$ac_file' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { echo "$as_me:$LINENO: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&5 echo "$as_me: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi fi fi { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } rm -f a.out a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; } { echo "$as_me:$LINENO: result: $cross_compiling" >&5 echo "${ECHO_T}$cross_compiling" >&6; } { echo "$as_me:$LINENO: checking for suffix of executables" >&5 echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; } if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; 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 | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest$ac_cv_exeext { echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 echo "${ECHO_T}$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT { echo "$as_me:$LINENO: checking for suffix of object files" >&5 echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; } if test "${ac_cv_objext+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; 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 ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 echo "${ECHO_T}$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; } if test "${ac_cv_c_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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 { echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; } GCC=`test $ac_compiler_gnu = yes && echo yes` ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CFLAGS="" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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 { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 echo "${ECHO_T}$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 { echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_c89+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_c89=$ac_arg else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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) { echo "$as_me:$LINENO: result: none needed" >&5 echo "${ECHO_T}none needed" >&6; } ;; xno) { echo "$as_me:$LINENO: result: unsupported" >&5 echo "${ECHO_T}unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;; 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 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 { echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if test "${ac_cv_prog_CPP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f 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 { echo "$as_me:$LINENO: result: $CPP" >&5 echo "${ECHO_T}$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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&5 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } 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_safe=`echo "gdbm.h" | sed 'y%./+-%__pm%'` { echo "$as_me:$LINENO: checking for gdbm.h" >&5 echo $ECHO_N "checking for gdbm.h... $ECHO_C" >&6; } old_CFLAGS="$CFLAGS" smart_include= smart_include_dir= if test "x$smart_try_dir" != "x"; then for try in $smart_try_dir; do CFLAGS="$old_CFLAGS -I$try" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { int a = 1; ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then smart_include="-I$try" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 smart_include= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test "x$smart_include" != "x"; then break; fi done CFLAGS="$old_CFLAGS" fi if test "x$smart_include" = "x"; then cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { int a = 1; ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then smart_include=" " else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 smart_include= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test "x$smart_include" = "x"; then if test "x$LOCATE" != "x"; then DIRS= file=gdbm.h for x in `${LOCATE} $file 2>/dev/null`; do base=`echo $x | sed "s%/${file}%%"` if test "x$x" = "x$base"; then continue; fi dir=`${DIRNAME} $x 2>/dev/null` exclude=`echo ${dir} | ${GREP} /home` if test "x$exclude" != "x"; then continue fi already=`echo \$smart_include_dir ${DIRS} | ${GREP} ${dir}` if test "x$already" = "x"; then DIRS="$DIRS $dir" fi done fi eval "smart_include_dir=\"\$smart_include_dir $DIRS\"" for try in $smart_include_dir /usr/local/include /opt/include; do CFLAGS="$old_CFLAGS -I$try" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { int a = 1; ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then smart_include="-I$try" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 smart_include= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test "x$smart_include" != "x"; then break; fi done CFLAGS="$old_CFLAGS" fi if test "x$smart_include" != "x"; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } eval "ac_cv_header_$ac_safe=yes" CFLAGS="$old_CFLAGS $smart_include" SMART_CFLAGS="$SMART_CFLAGS $smart_include" else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi sm_lib_safe=`echo "gdbm" | sed 'y%./+-%__p_%'` sm_func_safe=`echo "gdbm_open" | sed 'y%./+-%__p_%'` { echo "$as_me:$LINENO: checking for gdbm_open in -lgdbm" >&5 echo $ECHO_N "checking for gdbm_open in -lgdbm... $ECHO_C" >&6; } old_LIBS="$LIBS" smart_lib= smart_lib_dir= if test "x$smart_try_dir" != "x"; then for try in $smart_try_dir; do LIBS="-L$try -lgdbm $old_LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ extern char gdbm_open(); int main () { gdbm_open() ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then smart_lib="-L$try -lgdbm" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test "x$smart_lib" != "x"; then break; fi done LIBS="$old_LIBS" fi if test "x$smart_lib" = "x"; then LIBS="-lgdbm $old_LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ extern char gdbm_open(); int main () { gdbm_open() ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then smart_lib="-lgdbm" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS="$old_LIBS" fi if test "x$smart_lib" = "x"; then if test "x$LOCATE" != "x"; then DIRS= file=libgdbm${libltdl_cv_shlibext} for x in `${LOCATE} $file 2>/dev/null`; do base=`echo $x | sed "s%/${file}%%"` if test "x$x" = "x$base"; then continue; fi dir=`${DIRNAME} $x 2>/dev/null` exclude=`echo ${dir} | ${GREP} /home` if test "x$exclude" != "x"; then continue fi already=`echo \$smart_lib_dir ${DIRS} | ${GREP} ${dir}` if test "x$already" = "x"; then DIRS="$DIRS $dir" fi done fi eval "smart_lib_dir=\"\$smart_lib_dir $DIRS\"" if test "x$LOCATE" != "x"; then DIRS= file=libgdbm.a for x in `${LOCATE} $file 2>/dev/null`; do base=`echo $x | sed "s%/${file}%%"` if test "x$x" = "x$base"; then continue; fi dir=`${DIRNAME} $x 2>/dev/null` exclude=`echo ${dir} | ${GREP} /home` if test "x$exclude" != "x"; then continue fi already=`echo \$smart_lib_dir ${DIRS} | ${GREP} ${dir}` if test "x$already" = "x"; then DIRS="$DIRS $dir" fi done fi eval "smart_lib_dir=\"\$smart_lib_dir $DIRS\"" for try in $smart_lib_dir /usr/local/lib /opt/lib; do LIBS="-L$try -lgdbm $old_LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ extern char gdbm_open(); int main () { gdbm_open() ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then smart_lib="-L$try -lgdbm" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test "x$smart_lib" != "x"; then break; fi done LIBS="$old_LIBS" fi if test "x$smart_lib" != "x"; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } eval "ac_cv_lib_${sm_lib_safe}_${sm_func_safe}=yes" LIBS="$smart_lib $old_LIBS" SMART_LIBS="$smart_lib $SMART_LIBS" else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_cv_lib_gdbm_gdbm_open" != "xyes"; then fail="$fail libgdbm" fi if test "x$fail" = "x"; then { echo "$as_me:$LINENO: checking to see GDBM_SYNC status" >&5 echo $ECHO_N "checking to see GDBM_SYNC status... $ECHO_C" >&6; } { echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5 echo $ECHO_N "checking for grep that handles long lines and -e... $ECHO_C" >&6; } if test "${ac_cv_path_GREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Extract the first word of "grep ggrep" to use in msg output if test -z "$GREP"; then set dummy grep ggrep; ac_prog_name=$2 if test "${ac_cv_path_GREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" 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 ac_count=`expr $ac_count + 1` 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 fi GREP="$ac_cv_path_GREP" if test -z "$GREP"; then { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} { (exit 1); exit 1; }; } fi else ac_cv_path_GREP=$GREP fi fi { echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5 echo "${ECHO_T}$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { echo "$as_me:$LINENO: checking for egrep" >&5 echo $ECHO_N "checking for egrep... $ECHO_C" >&6; } if test "${ac_cv_path_EGREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else # Extract the first word of "egrep" to use in msg output if test -z "$EGREP"; then set dummy egrep; ac_prog_name=$2 if test "${ac_cv_path_EGREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" 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 ac_count=`expr $ac_count + 1` 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 fi EGREP="$ac_cv_path_EGREP" if test -z "$EGREP"; then { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} { (exit 1); exit 1; }; } fi else ac_cv_path_EGREP=$EGREP fi fi fi { echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 echo "${ECHO_T}$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifdef GDBM_SYNC found-gdbm-sync! #else not found. this version must use sync by default. #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "found-gdbm-sync" >/dev/null 2>&1; then cat >>confdefs.h <<\_ACEOF #define NEED_GDBM_SYNC yes _ACEOF { echo "$as_me:$LINENO: result: needs it." >&5 echo "${ECHO_T}needs it." >&6; } else { echo "$as_me:$LINENO: result: SYNCs by default." >&5 echo "${ECHO_T}SYNCs by default." >&6; } fi rm -f conftest* fi old_LIBS=$LIBS LIBS="$LIBS $SMART_LIBS" { echo "$as_me:$LINENO: checking for gdbm_fdesc" >&5 echo $ECHO_N "checking for gdbm_fdesc... $ECHO_C" >&6; } if test "${ac_cv_func_gdbm_fdesc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define gdbm_fdesc to an innocuous variant, in case declares gdbm_fdesc. For example, HP-UX 11i declares gettimeofday. */ #define gdbm_fdesc innocuous_gdbm_fdesc /* System header to define __stub macros and hopefully few prototypes, which can conflict with char gdbm_fdesc (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef gdbm_fdesc /* 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 gdbm_fdesc (); /* 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_gdbm_fdesc || defined __stub___gdbm_fdesc choke me #endif int main () { return gdbm_fdesc (); ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_func_gdbm_fdesc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_gdbm_fdesc=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_func_gdbm_fdesc" >&5 echo "${ECHO_T}$ac_cv_func_gdbm_fdesc" >&6; } if test "x$ac_cv_func_gdbm_fdesc" = "xyes"; then cat >>confdefs.h <<\_ACEOF #define HAVE_GDBM_FDESC _ACEOF fi LIBS=$old_LIBS targetname=rlm_caching else targetname= echo \*\*\* module rlm_caching is disabled. fi if test x"$fail" != x""; then if test x"${enable_strict_dependencies}" = x"yes"; then { { echo "$as_me:$LINENO: error: set --without-rlm_caching to disable it." >&5 echo "$as_me: error: set --without-rlm_caching to disable it." >&2;} { (exit 1); exit 1; }; } else { echo "$as_me:$LINENO: WARNING: silently not building rlm_caching." >&5 echo "$as_me: WARNING: silently not building rlm_caching." >&2;} { echo "$as_me:$LINENO: WARNING: FAILURE: rlm_caching requires: $fail." >&5 echo "$as_me: WARNING: FAILURE: rlm_caching requires: $fail." >&2;}; targetname="" fi fi caching_ldflags=$SMART_LIBS caching_cflags=$SMART_CFLAGS ac_config_headers="$ac_config_headers config.h" unset ac_cv_env_LIBS_set unset ac_cv_env_LIBS_value ac_config_files="$ac_config_files 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_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( *) $as_unset $ac_var ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then test "x$cache_file" != "x/dev/null" && { echo "$as_me:$LINENO: updating cache $cache_file" >&5 echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 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= 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=`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. ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs : ${CONFIG_STATUS=./config.status} ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >$CONFIG_STATUS <<_ACEOF #! $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} _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ## --------------------- ## ## 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=: # 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 # PATH needs CR # 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 # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false 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.) as_nl=' ' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. 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 # Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # CDPATH. $as_unset CDPATH as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, and appends # trailing '-' during substitution so that $LINENO is not a special # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # scripts with optimization help from Paolo Bonzini. 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" || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi 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 fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi 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=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 # Save the log message, to keep $[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by $as_me, which was generated by GNU Autoconf 2.61. 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 cat >>$CONFIG_STATUS <<_ACEOF # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ config.status configured by $0, generated by GNU Autoconf 2.61, with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" Copyright (C) 2006 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' _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # If no file are specified by the user, then we need to provide default # value. By we need to know if files were specified by the user. 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=$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 ) echo "$ac_cs_version"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift CONFIG_FILES="$CONFIG_FILES $ac_optarg" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header { echo "$as_me: error: ambiguous option: $1 Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; };; --help | --hel | -h ) 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. -*) { echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *) ac_config_targets="$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 if \$ac_cs_recheck; then echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 CONFIG_SHELL=$SHELL export CONFIG_SHELL exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # 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" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= trap 'exit_status=$? { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status ' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || { echo "$me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } # # Set up the sed scripts for CONFIG_FILES section. # # No need to generate the scripts if there are no CONFIG_FILES. # This happens for instance when ./config.status config.h if test -n "$CONFIG_FILES"; then _ACEOF ac_delim='%!_!# ' for ac_last_try in false false false false false :; do cat >conf$$subs.sed <<_ACEOF SHELL!$SHELL$ac_delim PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim PACKAGE_NAME!$PACKAGE_NAME$ac_delim PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim PACKAGE_STRING!$PACKAGE_STRING$ac_delim PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim exec_prefix!$exec_prefix$ac_delim prefix!$prefix$ac_delim program_transform_name!$program_transform_name$ac_delim bindir!$bindir$ac_delim sbindir!$sbindir$ac_delim libexecdir!$libexecdir$ac_delim datarootdir!$datarootdir$ac_delim datadir!$datadir$ac_delim sysconfdir!$sysconfdir$ac_delim sharedstatedir!$sharedstatedir$ac_delim localstatedir!$localstatedir$ac_delim includedir!$includedir$ac_delim oldincludedir!$oldincludedir$ac_delim docdir!$docdir$ac_delim infodir!$infodir$ac_delim htmldir!$htmldir$ac_delim dvidir!$dvidir$ac_delim pdfdir!$pdfdir$ac_delim psdir!$psdir$ac_delim libdir!$libdir$ac_delim localedir!$localedir$ac_delim mandir!$mandir$ac_delim DEFS!$DEFS$ac_delim ECHO_C!$ECHO_C$ac_delim ECHO_N!$ECHO_N$ac_delim ECHO_T!$ECHO_T$ac_delim LIBS!$LIBS$ac_delim build_alias!$build_alias$ac_delim host_alias!$host_alias$ac_delim target_alias!$target_alias$ac_delim CC!$CC$ac_delim CFLAGS!$CFLAGS$ac_delim LDFLAGS!$LDFLAGS$ac_delim CPPFLAGS!$CPPFLAGS$ac_delim ac_ct_CC!$ac_ct_CC$ac_delim EXEEXT!$EXEEXT$ac_delim OBJEXT!$OBJEXT$ac_delim CPP!$CPP$ac_delim GREP!$GREP$ac_delim EGREP!$EGREP$ac_delim caching_ldflags!$caching_ldflags$ac_delim caching_cflags!$caching_cflags$ac_delim targetname!$targetname$ac_delim LIBOBJS!$LIBOBJS$ac_delim LTLIBOBJS!$LTLIBOBJS$ac_delim _ACEOF if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 52; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` if test -n "$ac_eof"; then ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` ac_eof=`expr $ac_eof + 1` fi cat >>$CONFIG_STATUS <<_ACEOF cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof /@[a-zA-Z_][a-zA-Z_0-9]*@/!b end _ACEOF sed ' s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g s/^/s,@/; s/!/@,|#_!!_#|/ :n t n s/'"$ac_delim"'$/,g/; t s/$/\\/; p N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n ' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF :end s/|#_!!_#|//g CEOF$ac_eof _ACEOF # VPATH may cause trouble with some makes, so we remove $(srcdir), # ${srcdir} and @srcdir@ 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[ ]*=/{ s/:*\$(srcdir):*/:/ s/:*\${srcdir}:*/:/ s/:*@srcdir@:*/:/ s/^\([^=]*=[ ]*\):*/\1/ s/:*$// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF fi # test -n "$CONFIG_FILES" for ac_tag in :F $CONFIG_FILES :H $CONFIG_HEADERS do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5 echo "$as_me: error: Invalid tag $ac_tag." >&2;} { (exit 1); exit 1; }; };; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 echo "$as_me: error: cannot find input file: $ac_f" >&2;} { (exit 1); exit 1; }; };; esac ac_file_inputs="$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 "`IFS=: echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure." if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { echo "$as_me:$LINENO: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} fi case $ac_tag in *:-:* | *:-) cat >"$tmp/stdin";; 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 || 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" case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`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 || 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" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 echo "$as_me: error: cannot create directory $as_dir" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`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 # _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # 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= case `sed -n '/datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p ' $ac_file_inputs` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF 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 sed "$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s&@configure_input@&$configure_input&;t t s&@top_builddir@&$ac_top_builddir_sub&;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 $ac_datarootdir_hack " $ac_file_inputs | sed -f "$tmp/subs-1.sed" >$tmp/out test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&5 echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&2;} rm -f "$tmp/stdin" case $ac_file in -) cat "$tmp/out"; rm -f "$tmp/out";; *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;; esac ;; :H) # # CONFIG_HEADER # _ACEOF # Transform confdefs.h into a sed script `conftest.defines', that # substitutes the proper values into config.h.in to produce config.h. rm -f conftest.defines conftest.tail # First, append a space to every undef/define line, to ease matching. echo 's/$/ /' >conftest.defines # Then, protect against being on the right side of a sed subst, or in # an unquoted here document, in config.status. If some macros were # called several times there might be several #defines for the same # symbol, which is useless. But do not sort them, since the last # AC_DEFINE must be honored. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* # These sed commands are passed to sed as "A NAME B PARAMS C VALUE D", where # NAME is the cpp macro being defined, VALUE is the value it is being given. # PARAMS is the parameter list in the macro definition--in most cases, it's # just an empty string. ac_dA='s,^\\([ #]*\\)[^ ]*\\([ ]*' ac_dB='\\)[ (].*,\\1define\\2' ac_dC=' ' ac_dD=' ,' uniq confdefs.h | sed -n ' t rset :rset s/^[ ]*#[ ]*define[ ][ ]*// t ok d :ok s/[\\&,]/\\&/g s/^\('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/ '"$ac_dA"'\1'"$ac_dB"'\2'"${ac_dC}"'\3'"$ac_dD"'/p s/^\('"$ac_word_re"'\)[ ]*\(.*\)/'"$ac_dA"'\1'"$ac_dB$ac_dC"'\2'"$ac_dD"'/p ' >>conftest.defines # Remove the space that was appended to ease matching. # Then 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. # (The regexp can be short, since the line contains either #define or #undef.) echo 's/ $// s,^[ #]*u.*,/* & */,' >>conftest.defines # Break up conftest.defines: ac_max_sed_lines=50 # First sed command is: sed -f defines.sed $ac_file_inputs >"$tmp/out1" # Second one is: sed -f defines.sed "$tmp/out1" >"$tmp/out2" # Third one will be: sed -f defines.sed "$tmp/out2" >"$tmp/out1" # et cetera. ac_in='$ac_file_inputs' ac_out='"$tmp/out1"' ac_nxt='"$tmp/out2"' while : do # Write a here document: cat >>$CONFIG_STATUS <<_ACEOF # First, check the format of the line: cat >"\$tmp/defines.sed" <<\\CEOF /^[ ]*#[ ]*undef[ ][ ]*$ac_word_re[ ]*\$/b def /^[ ]*#[ ]*define[ ][ ]*$ac_word_re[( ]/b def b :def _ACEOF sed ${ac_max_sed_lines}q conftest.defines >>$CONFIG_STATUS echo 'CEOF sed -f "$tmp/defines.sed"' "$ac_in >$ac_out" >>$CONFIG_STATUS ac_in=$ac_out; ac_out=$ac_nxt; ac_nxt=$ac_in sed 1,${ac_max_sed_lines}d conftest.defines >conftest.tail grep . conftest.tail >/dev/null || break rm -f conftest.defines mv conftest.tail conftest.defines done rm -f conftest.defines conftest.tail echo "ac_result=$ac_in" >>$CONFIG_STATUS cat >>$CONFIG_STATUS <<\_ACEOF if test x"$ac_file" != x-; then echo "/* $configure_input */" >"$tmp/config.h" cat "$ac_result" >>"$tmp/config.h" if diff $ac_file "$tmp/config.h" >/dev/null 2>&1; then { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 echo "$as_me: $ac_file is unchanged" >&6;} else rm -f $ac_file mv "$tmp/config.h" $ac_file fi else echo "/* $configure_input */" cat "$ac_result" fi rm -f "$tmp/out12" ;; esac done # for ac_tag { (exit 0); exit 0; } _ACEOF chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save # 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 || { (exit 1); exit 1; } fi freeradius-server/src/modules/rlm_caching/configure.in000066400000000000000000000026221257552170400235430ustar00rootroot00000000000000AC_PREREQ([2.53]) AC_INIT(rlm_caching.c) AC_REVISION($Revision$) AC_DEFUN(modname,[rlm_caching]) if test x$with_[]modname != xno; then AC_PROG_CC AC_PROG_CPP FR_SMART_CHECK_INCLUDE(gdbm.h) FR_SMART_CHECK_LIB(gdbm, gdbm_open) if test "x$ac_cv_lib_gdbm_gdbm_open" != "xyes"; then fail="$fail libgdbm" fi if test "x$fail" = "x"; then AC_MSG_CHECKING(to see GDBM_SYNC status) AC_EGREP_CPP(found-gdbm-sync, [ #include #ifdef GDBM_SYNC found-gdbm-sync! #else not found. this version must use sync by default. #endif ], [ AC_DEFINE(NEED_GDBM_SYNC, yes, [do we need GDBM_SYNC]) AC_MSG_RESULT(needs it.) ], [ AC_MSG_RESULT(SYNCs by default.) ] ) fi old_LIBS=$LIBS LIBS="$LIBS $SMART_LIBS" AC_CHECK_FUNC(gdbm_fdesc) if test "x$ac_cv_func_gdbm_fdesc" = "xyes"; then AC_DEFINE(HAVE_GDBM_FDESC, [], [do we have gdbm_fdesc]) fi LIBS=$old_LIBS targetname=modname else targetname= echo \*\*\* module modname is disabled. fi if test x"$fail" != x""; then if test x"${enable_strict_dependencies}" = x"yes"; then AC_MSG_ERROR([set --without-]modname[ to disable it.]) else AC_MSG_WARN([silently not building ]modname[.]) AC_MSG_WARN([FAILURE: ]modname[ requires: $fail.]); targetname="" fi fi caching_ldflags=$SMART_LIBS caching_cflags=$SMART_CFLAGS AC_SUBST(caching_ldflags) AC_SUBST(caching_cflags) AC_SUBST(targetname) AC_CONFIG_HEADER(config.h) AC_OUTPUT(Makefile) freeradius-server/src/modules/rlm_caching/rlm_caching.c000066400000000000000000000345241257552170400236520ustar00rootroot00000000000000/* * rlm_caching.c * * Version: $Id$ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2001,2006 The FreeRADIUS server project * Copyright 2001 Alan DeKok * Copyright 2001-3 Kostas Kalevras */ #include RCSID("$Id$") #include #include #include #include "config.h" #include #include #ifdef NEEDS_GDBM_SYNC # define GDBM_SYNCOPT GDBM_SYNC #else # define GDBM_SYNCOPT 0 #endif #ifdef GDBM_NOLOCK #define GDBM_COUNTER_OPTS (GDBM_SYNCOPT | GDBM_NOLOCK) #else #define GDBM_COUNTER_OPTS (GDBM_SYNCOPT) #endif #ifndef HAVE_GDBM_FDESC #define gdbm_fdesc(foo) (-1) #endif #define UNIQUEID_MAX_LEN 32 /* * Define a structure for our module configuration. * * These variables do not need to be in a structure, but it's * a lot cleaner to do so, and a pointer to the structure can * be used as the instance handle. */ typedef struct rlm_caching_t { char *filename; /* name of the database file */ char *key; /* An xlated string to use as key for the records */ char *post_auth; /* If set and we find a cached entry, set Post-Auth to this value */ char *cache_ttl_str; /* The string represantation of the TTL */ int cache_ttl; /* The cache TTL */ int hit_ratio; /* Show cache hit ratio every so many queries */ int cache_rejects; /* Do we also cache rejects? */ int cache_size; /* The cache size to pass to GDBM */ uint32_t cache_queries; /* The number of cache requests */ uint32_t cache_hits; /* The number of cache hits */ GDBM_FILE gdbm; /* The gdbm file handle */ #ifdef HAVE_PTHREAD_H pthread_mutex_t mutex; /* A mutex to lock the gdbm file for only one reader/writer */ #endif } rlm_caching_t; #define MAX_RECORD_LEN 750 #define MAX_AUTH_TYPE 32 #define show_hit_ratio \ if (data->hit_ratio && (data->cache_queries % data->hit_ratio) == 0) \ radlog(L_INFO, "rlm_caching: Cache Queries: %7d, Cache Hits: %7d, Hit Ratio: %.2f%%", \ data->cache_queries,data->cache_hits,hit_ratio) typedef struct rlm_caching_data { time_t creation; char data[MAX_RECORD_LEN]; char auth_type[MAX_AUTH_TYPE]; int len; } rlm_caching_data; #ifndef HAVE_PTHREAD_H /* * This is a lot simpler than putting ifdef's around * every use of the pthread functions. */ #define pthread_mutex_lock(a) #define pthread_mutex_unlock(a) #define pthread_mutex_init(a,b) #define pthread_mutex_destroy(a) #endif /* * A mapping of configuration file names to internal variables. * * Note that the string is dynamically allocated, so it MUST * be freed. When the configuration file parse re-reads the string, * it free's the old one, and strdup's the new one, placing the pointer * to the strdup'd string into 'config.string'. This gets around * buffer over-flows. */ static const CONF_PARSER module_config[] = { { "filename", PW_TYPE_STRING_PTR, offsetof(rlm_caching_t,filename), NULL, NULL }, { "key", PW_TYPE_STRING_PTR, offsetof(rlm_caching_t,key), NULL, "%{Acct-Unique-Session-Id}" }, { "post-auth", PW_TYPE_STRING_PTR, offsetof(rlm_caching_t,post_auth), NULL, NULL }, { "cache-ttl", PW_TYPE_STRING_PTR, offsetof(rlm_caching_t,cache_ttl_str), NULL, "1d" }, { "cache-size", PW_TYPE_INTEGER, offsetof(rlm_caching_t,cache_size), NULL, "1000" }, { "hit-ratio", PW_TYPE_INTEGER, offsetof(rlm_caching_t,hit_ratio), NULL, "0" }, { "cache-rejects", PW_TYPE_BOOLEAN, offsetof(rlm_caching_t,cache_rejects), NULL, "yes" }, { NULL, -1, 0, NULL, NULL } }; static int caching_detach(void *instance); static int find_ttl(char *ttl) { unsigned len = 0; char last = 's'; if (isdigit((int) ttl[0])){ len = strlen(ttl); if (len == 0) return -1; last = ttl[len - 1]; if (!isalpha((int) last)) last = 's'; len = atoi(ttl); DEBUG("rlm_caching::find_ttl: num=%d, last=%c",len,last); } switch (last){ case 's': default: break; case 'm': len *= 60; break; case 'h': len *= 3600; break; case 'd': len *= 86400; break; case 'w': len *= 604800; break; } DEBUG("rlm_caching::find_ttl: Returning '%d'",len); return len; } /* * Do any per-module initialization that is separate to each * configured instance of the module. e.g. set up connections * to external databases, read configuration files, set up * dictionary entries, etc. * * If configuration information is given in the config section * that must be referenced in later calls, store a handle to it * in *instance otherwise put a null pointer there. */ static int caching_instantiate(CONF_SECTION *conf, void **instance) { rlm_caching_t *data; int cache_size; /* * Set up a storage area for instance data */ data = rad_malloc(sizeof(*data)); if (!data) { radlog(L_ERR, "rlm_caching: rad_malloc() failed."); return -1; } memset(data, 0, sizeof(*data)); /* * If the configuration parameters can't be parsed, then * fail. */ if (cf_section_parse(conf, data, module_config) < 0) { free(data); return -1; } cache_size = data->cache_size; /* * Discover the attribute number of the key. */ if (data->key == NULL) { radlog(L_ERR, "rlm_caching: 'key' must be set."); caching_detach(data); return -1; } if (data->cache_ttl_str == NULL) { radlog(L_ERR, "rlm_caching: 'cache-ttl' must be set."); caching_detach(data); return -1; } else { data->cache_ttl = find_ttl(data->cache_ttl_str); if (data->cache_ttl == 0) { radlog(L_ERR, "rlm_caching: 'cache-ttl' is invalid."); caching_detach(data); return -1; } } if (data->filename == NULL) { radlog(L_ERR, "rlm_caching: 'filename' must be set."); caching_detach(data); return -1; } data->gdbm = gdbm_open(data->filename, sizeof(int), GDBM_WRCREAT | GDBM_COUNTER_OPTS, 0600, NULL); if (data->gdbm == NULL) { radlog(L_ERR, "rlm_caching: Failed to open file %s: %s", data->filename, strerror(errno)); caching_detach(data); return -1; } if (gdbm_setopt(data->gdbm, GDBM_CACHESIZE, &cache_size, sizeof(int)) == -1) radlog(L_ERR, "rlm_caching: Failed to set cache size"); /* * Init the mutex */ pthread_mutex_init(&data->mutex, NULL); *instance = data; return 0; } /* * Cache the reply items and the Auth-Type */ static int caching_postauth(void *instance, REQUEST *request) { rlm_caching_t *data = (rlm_caching_t *)instance; char key[MAX_STRING_LEN]; datum key_datum; datum data_datum; VALUE_PAIR *reply_vp; VALUE_PAIR *auth_type; rlm_caching_data cache_data; int count = 0; int ret = 0; int size = 0; int rcode = 0; if (pairfind(request->packet->vps, PW_CACHE_NO_CACHING) != NULL){ DEBUG("rlm_caching: Cache-No-Caching is set. Returning NOOP"); return RLM_MODULE_NOOP; } if ((auth_type = pairfind(request->config_items, PW_AUTH_TYPE)) != NULL){ DEBUG("rlm_caching: Found Auth-Type, value: '%s'",auth_type->vp_strvalue); if (strcmp(auth_type->vp_strvalue,"Reject") == 0 && data->cache_rejects == 0){ DEBUG("rlm_caching: No caching of Rejects. Returning NOOP"); return RLM_MODULE_NOOP; } if (strlen(auth_type->vp_strvalue) > MAX_AUTH_TYPE - 1){ DEBUG("rlm_caching: Auth-Type value too large"); return RLM_MODULE_NOOP; } } else{ DEBUG("rlm_caching: No Auth-Type found. Returning NOOP"); return RLM_MODULE_NOOP; } reply_vp = request->reply->vps; if (reply_vp == NULL) { DEBUG("rlm_caching: The Request does not contain any reply attributes"); return RLM_MODULE_NOOP; } if (!radius_xlat(key,sizeof(key), data->key, request, NULL)){ radlog(L_ERR, "rlm_caching: xlat on key '%s' failed.",data->key); return RLM_MODULE_FAIL; } memset(&cache_data,0,sizeof(rlm_caching_data)); cache_data.creation = time(NULL); strcpy(cache_data.auth_type,auth_type->vp_strvalue); size = MAX_RECORD_LEN; while(reply_vp) { if (size <= 1){ DEBUG("rlm_caching: Not enough space."); return RLM_MODULE_NOOP; } ret = vp_prints(cache_data.data + count,size,reply_vp); if (ret == 0) { DEBUG("rlm_caching: Record is too large, will not store it."); return RLM_MODULE_NOOP; } count += (ret + 1); size -= (ret + 1); DEBUG("rlm_caching: VP=%s,VALUE=%s,length=%d,cache record length=%d, space left=%d", reply_vp->name,reply_vp->vp_strvalue,ret,count,size); reply_vp = reply_vp->next; } cache_data.len = count; DEBUG("rlm_caching: Storing cache for Key='%s'",key); data_datum.dptr = (rlm_caching_data *) &cache_data; data_datum.dsize = sizeof(rlm_caching_data); key_datum.dptr = (char *) key; key_datum.dsize = strlen(key); pthread_mutex_lock(&data->mutex); rcode = gdbm_store(data->gdbm, key_datum, data_datum, GDBM_REPLACE); pthread_mutex_unlock(&data->mutex); if (rcode < 0) { radlog(L_ERR, "rlm_caching: Failed storing data to %s: %s", data->filename, gdbm_strerror(gdbm_errno)); return RLM_MODULE_FAIL; } DEBUG("rlm_caching: New value stored successfully."); return RLM_MODULE_OK; } /* * Find the named user in this modules database. Create the set * of attribute-value pairs to check and reply with for this user * from the database. The authentication code only needs to check * the password, the rest is done here. */ static int caching_authorize(void *instance, REQUEST *request) { rlm_caching_t *data = (rlm_caching_t *) instance; char key[MAX_STRING_LEN]; datum key_datum; datum data_datum; rlm_caching_data cache_data; VALUE_PAIR *reply_item; VALUE_PAIR *item; char *tmp; int len = 0; int delete_cache = 0; float hit_ratio = 0.0; /* quiet the compiler */ instance = instance; request = request; if (pairfind(request->packet->vps, PW_CACHE_NO_CACHING) != NULL){ DEBUG("rlm_caching: Cache-No-Caching is set. Returning NOOP"); return RLM_MODULE_NOOP; } if (pairfind(request->packet->vps, PW_CACHE_DELETE_CACHE) != NULL){ DEBUG("rlm_caching: Found Cache-Delete-Cache. Will delete record if found"); delete_cache = 1; } if (!radius_xlat(key,sizeof(key), data->key, request, NULL)){ radlog(L_ERR, "rlm_caching: xlat on key '%s' failed.",data->key); return RLM_MODULE_FAIL; } key_datum.dptr = key; key_datum.dsize = strlen(key); DEBUG("rlm_caching: Searching the database for key '%s'",key); pthread_mutex_lock(&data->mutex); data_datum = gdbm_fetch(data->gdbm, key_datum); pthread_mutex_unlock(&data->mutex); data->cache_queries++; if (data_datum.dptr != NULL){ DEBUG("rlm_caching: Key Found."); data->cache_hits++; hit_ratio = (float)data->cache_hits / data->cache_queries; hit_ratio *= 100.0; memcpy(&cache_data, data_datum.dptr, sizeof(rlm_caching_data)); free(data_datum.dptr); if (delete_cache == 0 && cache_data.creation + data->cache_ttl <= time(NULL)){ DEBUG("rlm_caching: Cache entry has expired"); DEBUG("rlm_caching: Cache Queries: %7d, Cache Hits: %7d, Hit Ratio: %.2f%%", data->cache_queries,data->cache_hits,hit_ratio); show_hit_ratio; delete_cache = 1; } if (delete_cache){ DEBUG("rlm_caching: Deleting record"); pthread_mutex_lock(&data->mutex); gdbm_delete(data->gdbm, key_datum); pthread_mutex_unlock(&data->mutex); return RLM_MODULE_NOOP; } tmp = cache_data.data; if (tmp){ pairfree(&request->reply->vps); while(tmp && len < cache_data.len){ reply_item = NULL; if (userparse(tmp, &reply_item) > 0 && reply_item != NULL) pairadd(&request->reply->vps, reply_item); len += (strlen(tmp) + 1); DEBUG("rlm_caching: VP='%s',VALUE='%s',lenth='%d',cache record length='%d'", reply_item->name,reply_item->vp_strvalue,reply_item->length,len); tmp = cache_data.data + len; } } else{ DEBUG("rlm_caching: No reply items found. Returning NOOP"); return RLM_MODULE_NOOP; } if (cache_data.auth_type){ DEBUG("rlm_caching: Adding Auth-Type '%s'",cache_data.auth_type); if ((item = pairfind(request->config_items, PW_AUTH_TYPE)) == NULL){ item = pairmake("Auth-Type", cache_data.auth_type, T_OP_SET); pairadd(&request->config_items, item); } else{ strcpy(item->vp_strvalue, cache_data.auth_type); item->length = strlen(cache_data.auth_type); } } if (data->post_auth){ DEBUG("rlm_caching: Adding Post-Auth-Type '%s'",data->post_auth); if ((item = pairfind(request->config_items, PW_POST_AUTH_TYPE)) == NULL){ item = pairmake("Post-Auth-Type", data->post_auth, T_OP_SET); pairadd(&request->config_items, item); } else{ strcpy(item->vp_strvalue, data->post_auth); item->length = strlen(data->post_auth); } } item = pairmake("Cache-No-Caching", "YES", T_OP_EQ); pairadd(&request->packet->vps, item); DEBUG("rlm_caching: Cache Queries: %7d, Cache Hits: %7d, Hit Ratio: %.2f%%", data->cache_queries,data->cache_hits,hit_ratio); show_hit_ratio; return RLM_MODULE_OK; } else{ DEBUG("rlm_caching: Could not find the requested key in the database."); DEBUG("rlm_caching: Cache Queries: %7d, Cache Hits: %7d, Hit Ratio: %.2f%%", data->cache_queries,data->cache_hits,hit_ratio); show_hit_ratio; } return RLM_MODULE_NOOP; } static int caching_detach(void *instance) { rlm_caching_t *data = (rlm_caching_t *) instance; if (data->gdbm) gdbm_close(data->gdbm); pthread_mutex_destroy(&data->mutex); free(instance); return 0; } /* * The module name should be the only globally exported symbol. * That is, everything else should be 'static'. * * If the module needs to temporarily modify it's instantiation * data, the type should be changed to RLM_TYPE_THREAD_UNSAFE. * The server will then take care of ensuring that the module * is single-threaded. */ module_t rlm_caching = { RLM_MODULE_INIT, "Caching", RLM_TYPE_THREAD_SAFE, /* type */ caching_instantiate, /* instantiation */ caching_detach, /* detach */ { NULL, /* authentication */ caching_authorize, /* authorization */ NULL, /* preaccounting */ NULL, /* accounting */ NULL, /* checksimul */ NULL, /* pre-proxy */ NULL, /* post-proxy */ caching_postauth /* post-auth */ }, }; freeradius-server/src/modules/rlm_chap/000077500000000000000000000000001257552170400205475ustar00rootroot00000000000000freeradius-server/src/modules/rlm_chap/Makefile000066400000000000000000000001361257552170400222070ustar00rootroot00000000000000# # Makefile # # Version: $Id$ # TARGET = rlm_chap SRCS = rlm_chap.c include ../rules.mak freeradius-server/src/modules/rlm_chap/rlm_chap.c000066400000000000000000000114021257552170400224760ustar00rootroot00000000000000/* * rlm_chap.c * * Version: $Id$ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2001,2006 The FreeRADIUS server project * Copyright 2001 Kostas Kalevras * * Nov 03 2001, Kostas Kalevras * - Added authorize() function to set Auth-Type if Chap-Password exists * - Added module messages when rejecting user */ #include RCSID("$Id$") #include #include static int chap_authorize(void *instance, REQUEST *request) { /* quiet the compiler */ instance = instance; request = request; if (!pairfind(request->packet->vps, PW_CHAP_PASSWORD)) { return RLM_MODULE_NOOP; } if (pairfind(request->config_items, PW_AUTHTYPE) != NULL) { RDEBUG2("WARNING: Auth-Type already set. Not setting to CHAP"); return RLM_MODULE_NOOP; } RDEBUG("Setting 'Auth-Type := CHAP'"); pairadd(&request->config_items, pairmake("Auth-Type", "CHAP", T_OP_EQ)); return RLM_MODULE_OK; } /* * Find the named user in this modules database. Create the set * of attribute-value pairs to check and reply with for this user * from the database. The authentication code only needs to check * the password, the rest is done here. */ static int chap_authenticate(void *instance, REQUEST *request) { VALUE_PAIR *passwd_item, *chap; uint8_t pass_str[MAX_STRING_LEN]; VALUE_PAIR *module_fmsg_vp; char module_fmsg[MAX_STRING_LEN]; /* quiet the compiler */ instance = instance; request = request; if (!request->username) { radlog_request(L_AUTH, 0, request, "rlm_chap: Attribute \"User-Name\" is required for authentication.\n"); return RLM_MODULE_INVALID; } chap = pairfind(request->packet->vps, PW_CHAP_PASSWORD); if (!chap) { RDEBUG("ERROR: You set 'Auth-Type = CHAP' for a request that does not contain a CHAP-Password attribute!"); return RLM_MODULE_INVALID; } if (chap->length == 0) { RDEBUG("ERROR: CHAP-Password is empty"); return RLM_MODULE_INVALID; } if (chap->length != CHAP_VALUE_LENGTH + 1) { RDEBUG("ERROR: CHAP-Password has invalid length"); return RLM_MODULE_INVALID; } /* * Don't print out the CHAP password here. It's binary crap. */ RDEBUG("login attempt by \"%s\" with CHAP password", request->username->vp_strvalue); if ((passwd_item = pairfind(request->config_items, PW_CLEARTEXT_PASSWORD)) == NULL){ RDEBUG("Cleartext-Password is required for authentication"); snprintf(module_fmsg, sizeof(module_fmsg), "rlm_chap: Clear text password not available"); module_fmsg_vp = pairmake("Module-Failure-Message", module_fmsg, T_OP_EQ); pairadd(&request->packet->vps, module_fmsg_vp); return RLM_MODULE_INVALID; } RDEBUG("Using clear text password \"%s\" for user %s authentication.", passwd_item->vp_strvalue, request->username->vp_strvalue); rad_chap_encode(request->packet,pass_str, chap->vp_octets[0],passwd_item); if (rad_digest_cmp(pass_str + 1, chap->vp_octets + 1, CHAP_VALUE_LENGTH) != 0) { RDEBUG("Password check failed"); snprintf(module_fmsg, sizeof(module_fmsg), "rlm_chap: Wrong user password"); module_fmsg_vp = pairmake("Module-Failure-Message", module_fmsg, T_OP_EQ); pairadd(&request->packet->vps, module_fmsg_vp); return RLM_MODULE_REJECT; } RDEBUG("chap user %s authenticated succesfully", request->username->vp_strvalue); return RLM_MODULE_OK; } /* * The module name should be the only globally exported symbol. * That is, everything else should be 'static'. * * If the module needs to temporarily modify it's instantiation * data, the type should be changed to RLM_TYPE_THREAD_UNSAFE. * The server will then take care of ensuring that the module * is single-threaded. */ module_t rlm_chap = { RLM_MODULE_INIT, "CHAP", RLM_TYPE_CHECK_CONFIG_SAFE, /* type */ NULL, /* instantiation */ NULL, /* detach */ { chap_authenticate, /* authentication */ chap_authorize, /* authorization */ NULL, /* preaccounting */ NULL, /* accounting */ NULL, /* checksimul */ NULL, /* pre-proxy */ NULL, /* post-proxy */ NULL /* post-auth */ }, }; freeradius-server/src/modules/rlm_checkval/000077500000000000000000000000001257552170400214145ustar00rootroot00000000000000freeradius-server/src/modules/rlm_checkval/.gitignore000066400000000000000000000000111257552170400233740ustar00rootroot00000000000000Makefile freeradius-server/src/modules/rlm_checkval/Makefile.in000066400000000000000000000003171257552170400234620ustar00rootroot00000000000000# # $Id$ # TARGET = @targetname@ SRCS = rlm_checkval.c HEADERS = RLM_CFLAGS = @checkval_cflags@ RLM_LIBS = @checkval_ldflags@ RLM_INSTALL = include ../rules.mak $(LT_OBJS): $(HEADERS) freeradius-server/src/modules/rlm_checkval/configure000077500000000000000000003174621257552170400233400ustar00rootroot00000000000000#! /bin/sh # From configure.in Revision. # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.61. # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, # 2002, 2003, 2004, 2005, 2006 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=: # 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 # PATH needs CR # 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 # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false 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.) as_nl=' ' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. 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 # Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # CDPATH. $as_unset CDPATH if test "x$CONFIG_SHELL" = x; then if (eval ":") 2>/dev/null; then as_have_required=yes else as_have_required=no fi if test $as_have_required = yes && (eval ": (as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=\$LINENO as_lineno_2=\$LINENO test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } ") 2> /dev/null; then : else as_candidate_shells= as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. case $as_dir in /*) for as_base in sh bash ksh sh5; do as_candidate_shells="$as_candidate_shells $as_dir/$as_base" done;; esac done IFS=$as_save_IFS for as_shell in $as_candidate_shells $SHELL; do # Try only shells that exist, to save several forks. if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { ("$as_shell") 2> /dev/null <<\_ASEOF 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 : _ASEOF }; then CONFIG_SHELL=$as_shell as_have_required=yes if { "$as_shell" 2> /dev/null <<\_ASEOF 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 : (as_func_return () { (exit $1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = "$1" ); then : else exitcode=1 echo positional parameters were not saved. fi test $exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } _ASEOF }; then break fi fi done if test "x$CONFIG_SHELL" != x; then for as_var in BASH_ENV ENV do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done export CONFIG_SHELL exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} fi if test $as_have_required = no; then echo This script requires a shell more modern than all the echo shells that I found on your system. Please install a echo modern shell, or manually run the script under such a echo shell if you do have one. { (exit 1); exit 1; } fi fi fi (eval "as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0") || { echo No shell found that supports shell functions. echo Please tell autoconf@gnu.org about your system, echo including any error possibly output before this echo message } as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, and appends # trailing '-' during substitution so that $LINENO is not a special # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # scripts with optimization help from Paolo Bonzini. 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" || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi 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 fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi 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=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, 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= SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME= PACKAGE_TARNAME= PACKAGE_VERSION= PACKAGE_STRING= PACKAGE_BUGREPORT= ac_unique_file="rlm_checkval.c" ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datarootdir datadir sysconfdir sharedstatedir localstatedir includedir oldincludedir docdir infodir htmldir dvidir pdfdir psdir libdir localedir mandir DEFS ECHO_C ECHO_N ECHO_T LIBS build_alias host_alias target_alias CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP checkval_cflags checkval_ldflags targetname LIBOBJS LTLIBOBJS' ac_subst_files='' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CPP' # Initialize some variables set by options. ac_init_help= ac_init_version=false # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *) ac_optarg=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_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` eval enable_$ac_feature=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_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` eval enable_$ac_feature=\$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_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/[-.]/_/g'` eval with_$ac_package=\$ac_optarg ;; -without-* | --without-*) ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/[-.]/_/g'` eval with_$ac_package=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 ;; -*) { echo "$as_me: error: unrecognized option: $ac_option Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && 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'` { echo "$as_me: error: missing argument to $ac_option" >&2 { (exit 1); exit 1; }; } fi # Be sure to have absolute directory names. 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 case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; } 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 echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || { echo "$as_me: error: Working directory cannot be determined" >&2 { (exit 1); exit 1; }; } test "X$ac_ls_di" = "X$ac_pwd_ls_di" || { echo "$as_me: error: pwd does not report name of working directory" >&2 { (exit 1); exit 1; }; } # 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 -- "$0" || $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$0" : 'X\(//\)[^/]' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X"$0" | 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 .." { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2 { (exit 1); exit 1; }; } pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures this package to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF _ACEOF fi if test -n "$ac_init_help"; then cat <<\_ACEOF 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 C/C++/Objective C preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. _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" || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`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 echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF configure generated by GNU Autoconf 2.61 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 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 cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by $as_me, which was generated by GNU Autoconf 2.61. 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=. 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=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; 2) ac_configure_args1="$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 ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac done done $as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } $as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export 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 cat <<\_ASBOX ## ---------------- ## ## Cache variables. ## ## ---------------- ## _ASBOX 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_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( *) $as_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 cat <<\_ASBOX ## ----------------- ## ## Output variables. ## ## ----------------- ## _ASBOX echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then cat <<\_ASBOX ## ------------------- ## ## File substitutions. ## ## ------------------- ## _ASBOX echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then cat <<\_ASBOX ## ----------- ## ## confdefs.h. ## ## ----------- ## _ASBOX echo cat confdefs.h echo fi test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" 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'; { (exit 1); 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 # 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 # Let the site file select an alternate cache file if it wants to. # Prefer explicitly selected file to automatically selected ones. if test -n "$CONFIG_SITE"; then set x "$CONFIG_SITE" elif test "x$prefix" != xNONE; then set x "$prefix/share/config.site" "$prefix/etc/config.site" else set x "$ac_default_prefix/share/config.site" \ "$ac_default_prefix/etc/config.site" fi shift for ac_site_file do if test -r "$ac_site_file"; then { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" 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. if test -f "$cache_file"; then { echo "$as_me:$LINENO: loading cache $cache_file" >&5 echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { echo "$as_me:$LINENO: creating cache $cache_file" >&5 echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 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 { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 echo "$as_me: former value: $ac_old_val" >&2;} { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 echo "$as_me: current value: $ac_new_val" >&2;} ac_cache_corrupted=: fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`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. *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 echo "$as_me: error: changes in the environment can compromise the build" >&2;} { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} { (exit 1); exit 1; }; } 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 x$with_rlm_checkval != xno; then 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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}gcc" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="gcc" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}cc" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="$ac_prog" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&5 echo "$as_me: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } # Provide some information about the compiler. echo "$as_me:$LINENO: checking for C compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (ac_try="$ac_compiler --version >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -v >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -V >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out 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. { echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6; } ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # # List of possible output files, starting from the most likely. # The algorithm is not robust to junk in `.', hence go to wildcards (a.*) # only as a last resort. b.out is created by i960 compilers. ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out' # # The IRIX 6 linker writes into existing files which may not be # executable, retaining their permissions. Remove them first so a # subsequent execution test works. ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link_default") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; 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 | *.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 { echo "$as_me:$LINENO: result: $ac_file" >&5 echo "${ECHO_T}$ac_file" >&6; } if test -z "$ac_file"; then echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: C compiler cannot create executables See \`config.log' for more details." >&5 echo "$as_me: error: C compiler cannot create executables See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } fi ac_exeext=$ac_cv_exeext # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { echo "$as_me:$LINENO: checking whether the C compiler works" >&5 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6; } # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then if { ac_try='./$ac_file' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { echo "$as_me:$LINENO: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&5 echo "$as_me: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi fi fi { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } rm -f a.out a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; } { echo "$as_me:$LINENO: result: $cross_compiling" >&5 echo "${ECHO_T}$cross_compiling" >&6; } { echo "$as_me:$LINENO: checking for suffix of executables" >&5 echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; } if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; 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 | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest$ac_cv_exeext { echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 echo "${ECHO_T}$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT { echo "$as_me:$LINENO: checking for suffix of object files" >&5 echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; } if test "${ac_cv_objext+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; 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 ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 echo "${ECHO_T}$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; } if test "${ac_cv_c_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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 { echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; } GCC=`test $ac_compiler_gnu = yes && echo yes` ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CFLAGS="" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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 { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 echo "${ECHO_T}$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 { echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_c89+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_c89=$ac_arg else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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) { echo "$as_me:$LINENO: result: none needed" >&5 echo "${ECHO_T}none needed" >&6; } ;; xno) { echo "$as_me:$LINENO: result: unsupported" >&5 echo "${ECHO_T}unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;; 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 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 { echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if test "${ac_cv_prog_CPP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f 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 { echo "$as_me:$LINENO: result: $CPP" >&5 echo "${ECHO_T}$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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&5 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } 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 targetname=rlm_checkval else targetname= echo \*\*\* module rlm_checkval is disabled. fi if test x"$fail" != x""; then if test x"${enable_strict_dependencies}" = x"yes"; then { { echo "$as_me:$LINENO: error: set --without-rlm_checkval to disable it explicitly." >&5 echo "$as_me: error: set --without-rlm_checkval to disable it explicitly." >&2;} { (exit 1); exit 1; }; } else { echo "$as_me:$LINENO: WARNING: silently not building rlm_checkval." >&5 echo "$as_me: WARNING: silently not building rlm_checkval." >&2;} { echo "$as_me:$LINENO: WARNING: FAILURE: rlm_checkval requires: $fail." >&5 echo "$as_me: WARNING: FAILURE: rlm_checkval requires: $fail." >&2;}; targetname="" fi fi unset ac_cv_env_LIBS_set unset ac_cv_env_LIBS_value ac_config_files="$ac_config_files 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_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( *) $as_unset $ac_var ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then test "x$cache_file" != "x/dev/null" && { echo "$as_me:$LINENO: updating cache $cache_file" >&5 echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 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}' # Transform confdefs.h into DEFS. # Protect against shell expansion while executing Makefile rules. # Protect against Makefile macro expansion. # # If the first sed substitution is executed (which looks for macros that # take arguments), then branch to the quote section. Otherwise, # look for a macro that doesn't take arguments. ac_script=' t clear :clear s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g t quote s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g t quote b any :quote s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g s/\[/\\&/g s/\]/\\&/g s/\$/$$/g H :any ${ g s/^\n// s/\n/ /g p } ' DEFS=`sed -n "$ac_script" confdefs.h` ac_libobjs= ac_ltlibobjs= 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=`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. ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs : ${CONFIG_STATUS=./config.status} ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >$CONFIG_STATUS <<_ACEOF #! $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} _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ## --------------------- ## ## 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=: # 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 # PATH needs CR # 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 # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false 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.) as_nl=' ' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. 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 # Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # CDPATH. $as_unset CDPATH as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, and appends # trailing '-' during substitution so that $LINENO is not a special # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # scripts with optimization help from Paolo Bonzini. 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" || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi 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 fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi 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=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 # Save the log message, to keep $[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by $as_me, which was generated by GNU Autoconf 2.61. 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 cat >>$CONFIG_STATUS <<_ACEOF # Files that config.status was made for. config_files="$ac_config_files" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit -q, --quiet 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 Configuration files: $config_files Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ config.status configured by $0, generated by GNU Autoconf 2.61, with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" Copyright (C) 2006 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' _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # If no file are specified by the user, then we need to provide default # value. By we need to know if files were specified by the user. 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=$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 ) echo "$ac_cs_version"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift CONFIG_FILES="$CONFIG_FILES $ac_optarg" ac_need_defaults=false;; --he | --h | --help | --hel | -h ) 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. -*) { echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *) ac_config_targets="$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 if \$ac_cs_recheck; then echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 CONFIG_SHELL=$SHELL export CONFIG_SHELL exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; 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 fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= trap 'exit_status=$? { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status ' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || { echo "$me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } # # Set up the sed scripts for CONFIG_FILES section. # # No need to generate the scripts if there are no CONFIG_FILES. # This happens for instance when ./config.status config.h if test -n "$CONFIG_FILES"; then _ACEOF ac_delim='%!_!# ' for ac_last_try in false false false false false :; do cat >conf$$subs.sed <<_ACEOF SHELL!$SHELL$ac_delim PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim PACKAGE_NAME!$PACKAGE_NAME$ac_delim PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim PACKAGE_STRING!$PACKAGE_STRING$ac_delim PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim exec_prefix!$exec_prefix$ac_delim prefix!$prefix$ac_delim program_transform_name!$program_transform_name$ac_delim bindir!$bindir$ac_delim sbindir!$sbindir$ac_delim libexecdir!$libexecdir$ac_delim datarootdir!$datarootdir$ac_delim datadir!$datadir$ac_delim sysconfdir!$sysconfdir$ac_delim sharedstatedir!$sharedstatedir$ac_delim localstatedir!$localstatedir$ac_delim includedir!$includedir$ac_delim oldincludedir!$oldincludedir$ac_delim docdir!$docdir$ac_delim infodir!$infodir$ac_delim htmldir!$htmldir$ac_delim dvidir!$dvidir$ac_delim pdfdir!$pdfdir$ac_delim psdir!$psdir$ac_delim libdir!$libdir$ac_delim localedir!$localedir$ac_delim mandir!$mandir$ac_delim DEFS!$DEFS$ac_delim ECHO_C!$ECHO_C$ac_delim ECHO_N!$ECHO_N$ac_delim ECHO_T!$ECHO_T$ac_delim LIBS!$LIBS$ac_delim build_alias!$build_alias$ac_delim host_alias!$host_alias$ac_delim target_alias!$target_alias$ac_delim CC!$CC$ac_delim CFLAGS!$CFLAGS$ac_delim LDFLAGS!$LDFLAGS$ac_delim CPPFLAGS!$CPPFLAGS$ac_delim ac_ct_CC!$ac_ct_CC$ac_delim EXEEXT!$EXEEXT$ac_delim OBJEXT!$OBJEXT$ac_delim CPP!$CPP$ac_delim checkval_cflags!$checkval_cflags$ac_delim checkval_ldflags!$checkval_ldflags$ac_delim targetname!$targetname$ac_delim LIBOBJS!$LIBOBJS$ac_delim LTLIBOBJS!$LTLIBOBJS$ac_delim _ACEOF if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 50; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` if test -n "$ac_eof"; then ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` ac_eof=`expr $ac_eof + 1` fi cat >>$CONFIG_STATUS <<_ACEOF cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof /@[a-zA-Z_][a-zA-Z_0-9]*@/!b end _ACEOF sed ' s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g s/^/s,@/; s/!/@,|#_!!_#|/ :n t n s/'"$ac_delim"'$/,g/; t s/$/\\/; p N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n ' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF :end s/|#_!!_#|//g CEOF$ac_eof _ACEOF # VPATH may cause trouble with some makes, so we remove $(srcdir), # ${srcdir} and @srcdir@ 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[ ]*=/{ s/:*\$(srcdir):*/:/ s/:*\${srcdir}:*/:/ s/:*@srcdir@:*/:/ s/^\([^=]*=[ ]*\):*/\1/ s/:*$// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF fi # test -n "$CONFIG_FILES" for ac_tag in :F $CONFIG_FILES do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5 echo "$as_me: error: Invalid tag $ac_tag." >&2;} { (exit 1); exit 1; }; };; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 echo "$as_me: error: cannot find input file: $ac_f" >&2;} { (exit 1); exit 1; }; };; esac ac_file_inputs="$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 "`IFS=: echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure." if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { echo "$as_me:$LINENO: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} fi case $ac_tag in *:-:* | *:-) cat >"$tmp/stdin";; 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 || 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" case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`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 || 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" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 echo "$as_me: error: cannot create directory $as_dir" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`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 # _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # 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= case `sed -n '/datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p ' $ac_file_inputs` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF 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 sed "$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s&@configure_input@&$configure_input&;t t s&@top_builddir@&$ac_top_builddir_sub&;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 $ac_datarootdir_hack " $ac_file_inputs | sed -f "$tmp/subs-1.sed" >$tmp/out test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&5 echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&2;} rm -f "$tmp/stdin" case $ac_file in -) cat "$tmp/out"; rm -f "$tmp/out";; *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;; esac ;; esac done # for ac_tag { (exit 0); exit 0; } _ACEOF chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save # 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 || { (exit 1); exit 1; } fi freeradius-server/src/modules/rlm_checkval/configure.in000066400000000000000000000012311257552170400237220ustar00rootroot00000000000000AC_PREREQ([2.53]) AC_INIT(rlm_checkval.c) AC_REVISION($Revision$) AC_DEFUN(modname,[rlm_checkval]) if test x$with_[]modname != xno; then AC_PROG_CC AC_PROG_CPP targetname=modname else targetname= echo \*\*\* module modname is disabled. fi dnl Don't change this section. if test x"$fail" != x""; then if test x"${enable_strict_dependencies}" = x"yes"; then AC_MSG_ERROR([set --without-]modname[ to disable it explicitly.]) else AC_MSG_WARN([silently not building ]modname[.]) AC_MSG_WARN([FAILURE: ]modname[ requires: $fail.]); targetname="" fi fi AC_SUBST(checkval_cflags) AC_SUBST(checkval_ldflags) AC_SUBST(targetname) AC_OUTPUT(Makefile) freeradius-server/src/modules/rlm_checkval/rlm_checkval.c000066400000000000000000000227401257552170400242170ustar00rootroot00000000000000/* * rlm_checkval.c * * Version: $Id$ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2003,2006 The FreeRADIUS server project * Copyright 2003 Kostas Kalevras */ #include RCSID("$Id$") #include #include #ifdef HAVE_REGEX_H # include #endif #ifndef REG_EXTENDED #define REG_EXTENDED (0) #endif #ifndef REG_NOSUB #define REG_NOSUB (0) #endif /* * Define a structure for our module configuration. * * These variables do not need to be in a structure, but it's * a lot cleaner to do so, and a pointer to the structure can * be used as the instance handle. */ typedef struct rlm_checkval_t { char *item_name; /* The attribute inside Access-Request ie Calling-Station-Id */ char *check_name; /* The attribute to check it with ie Allowed-Calling-Station-Id */ char *data_type; /* string,integer,ipaddr,date,abinary,octets */ int dat_type; int item_attr; int chk_attr; int notfound_reject; /* If we don't find the item_name in the request send back a reject */ } rlm_checkval_t; /* * A mapping of configuration file names to internal variables. * * Note that the string is dynamically allocated, so it MUST * be freed. When the configuration file parse re-reads the string, * it free's the old one, and strdup's the new one, placing the pointer * to the strdup'd string into 'config.string'. This gets around * buffer over-flows. */ static const CONF_PARSER module_config[] = { { "item-name", PW_TYPE_STRING_PTR, offsetof(rlm_checkval_t,item_name), NULL, NULL}, { "check-name", PW_TYPE_STRING_PTR, offsetof(rlm_checkval_t,check_name), NULL, NULL}, { "data-type", PW_TYPE_STRING_PTR, offsetof(rlm_checkval_t,data_type),NULL, "integer"}, { "notfound-reject", PW_TYPE_BOOLEAN, offsetof(rlm_checkval_t,notfound_reject),NULL, "no"}, { NULL, -1, 0, NULL, NULL } /* end the list */ }; static int checkval_detach(void *instance) { free(instance); return 0; } /* * Do any per-module initialization that is separate to each * configured instance of the module. e.g. set up connections * to external databases, read configuration files, set up * dictionary entries, etc. * * If configuration information is given in the config section * that must be referenced in later calls, store a handle to it * in *instance otherwise put a null pointer there. */ static int checkval_instantiate(CONF_SECTION *conf, void **instance) { rlm_checkval_t *data; DICT_ATTR *dattr; ATTR_FLAGS flags; static const FR_NAME_NUMBER names[] = { { "string", PW_TYPE_STRING }, { "integer", PW_TYPE_INTEGER }, { "ipaddr", PW_TYPE_IPADDR }, { "date", PW_TYPE_DATE }, { "abinary", PW_TYPE_OCTETS }, { "octets", PW_TYPE_OCTETS }, { "binary", PW_TYPE_OCTETS }, { NULL, 0 } }; /* * Set up a storage area for instance data */ data = rad_malloc(sizeof(*data)); if (!data) { return -1; } memset(data, 0, sizeof(*data)); /* * If the configuration parameters can't be parsed, then * fail. */ if (cf_section_parse(conf, data, module_config) < 0) { checkval_detach(data); return -1; } /* * Check if data_type exists */ if (!data->data_type || !*data->data_type){ radlog(L_ERR, "rlm_checkval: Data type not defined"); checkval_detach(data); return -1; } if (!data->item_name || !*data->item_name){ radlog(L_ERR, "rlm_checkval: Item name not defined"); checkval_detach(data); return -1; } if (!data->check_name || !*data->check_name){ radlog(L_ERR, "rlm_checkval: Check item name not defined"); checkval_detach(data); return -1; } /* * Discover the attribute number of the item name */ dattr = dict_attrbyname(data->item_name); if (!dattr) { radlog(L_ERR, "rlm_checkval: No such attribute %s", data->item_name); checkval_detach(data); return -1; } data->item_attr = dattr->attr; /* * Add the check attribute name to the dictionary * if it does not already exists. dict_addattr() handles that */ memset(&flags, 0, sizeof(flags)); dict_addattr(data->check_name, 0, PW_TYPE_STRING, -1,flags); dattr = dict_attrbyname(data->check_name); if (!dattr){ radlog(L_ERR, "rlm_checkval: No such attribute %s", data->check_name); checkval_detach(data); return -1; } data->chk_attr = dattr->attr; DEBUG2("rlm_checkval: Registered name %s for attribute %d", dattr->name,dattr->attr); /* * Convert the string type to an integer type, * so we don't have to do string comparisons on each * packet. */ data->dat_type = fr_str2int(names, data->data_type, -1); if (data->dat_type < 0) { radlog(L_ERR, "rlm_checkval: Data type %s in not known",data->data_type); checkval_detach(data); return -1; } *instance = data; return 0; } static int do_checkval(void *instance, REQUEST *request) { rlm_checkval_t *data = (rlm_checkval_t *) instance; int ret=RLM_MODULE_NOOP; VALUE_PAIR *chk_vp, *item_vp; VALUE_PAIR *tmp; char found = 0; /* quiet the compiler */ instance = instance; request = request; /* * Look for the check item */ if (!(item_vp = pairfind(request->packet->vps, data->item_attr))){ DEBUG2("rlm_checkval: Could not find item named %s in request", data->item_name); if (data->notfound_reject) ret = RLM_MODULE_REJECT; else ret = RLM_MODULE_NOTFOUND; } if (item_vp) DEBUG2("rlm_checkval: Item Name: %s, Value: %s",data->item_name, item_vp->vp_strvalue); tmp = request->config_items; do{ if (!(chk_vp = pairfind(tmp, data->chk_attr))){ if (!found){ DEBUG2("rlm_checkval: Could not find attribute named %s in check pairs",data->check_name); ret = RLM_MODULE_NOTFOUND; } break; } if (!item_vp) break; DEBUG2("rlm_checkval: Value Name: %s, Value: %s",data->check_name, chk_vp->vp_strvalue); /* * Check if item != check * * FIXME: !!! Call normal API functions! */ found = 1; if (data->dat_type == PW_TYPE_STRING || data->dat_type == PW_TYPE_OCTETS) { if (item_vp->length != chk_vp->length) ret = RLM_MODULE_REJECT; else{ if (!memcmp(item_vp->vp_strvalue, chk_vp->vp_strvalue, (size_t) chk_vp->length)) ret = RLM_MODULE_OK; else ret = RLM_MODULE_REJECT; } } else if (data->dat_type == PW_TYPE_DATE) { if (item_vp->vp_date == chk_vp->vp_date) ret = RLM_MODULE_OK; else ret = RLM_MODULE_REJECT; } else if (data->dat_type == PW_TYPE_INTEGER) { if (item_vp->vp_integer == chk_vp->vp_integer) ret = RLM_MODULE_OK; else ret = RLM_MODULE_REJECT; } #ifdef HAVE_REGEX_H if (ret == RLM_MODULE_REJECT && chk_vp->operator == T_OP_REG_EQ) { regex_t reg; int err; char err_msg[MAX_STRING_LEN]; DEBUG("rlm_checkval: Doing regex"); err = regcomp(®, (char *)chk_vp->vp_strvalue, REG_EXTENDED|REG_NOSUB); if (err){ regerror(err, ®,err_msg, MAX_STRING_LEN); DEBUG("rlm_checkval: regcomp() returned error: %s", err_msg); return RLM_MODULE_FAIL; } if (regexec(®, (char *)item_vp->vp_strvalue,0, NULL, 0) == 0) ret = RLM_MODULE_OK; else ret = RLM_MODULE_REJECT; regfree(®); } #endif tmp = chk_vp->next; } while (ret == RLM_MODULE_REJECT && tmp != NULL); if (ret == RLM_MODULE_REJECT) { if (!item_vp && data->notfound_reject){ char module_fmsg[MAX_STRING_LEN]; VALUE_PAIR *module_fmsg_vp; snprintf(module_fmsg,sizeof(module_fmsg), "rlm_checkval: Could not find item named %s in request", data->item_name); module_fmsg_vp = pairmake("Module-Failure-Message", module_fmsg, T_OP_EQ); pairadd(&request->packet->vps, module_fmsg_vp); } else{ char module_fmsg[MAX_STRING_LEN]; VALUE_PAIR *module_fmsg_vp; snprintf(module_fmsg,sizeof(module_fmsg), "rlm_checkval: This %s is not allowed for the user", data->item_name); module_fmsg_vp = pairmake("Module-Failure-Message", module_fmsg, T_OP_EQ); pairadd(&request->packet->vps, module_fmsg_vp); } } return ret; } /* */ static int checkval_authorize(void *instance, REQUEST *request) { return do_checkval(instance,request); } static int checkval_accounting(void *instance, REQUEST *request) { return do_checkval(instance,request); } /* * The module name should be the only globally exported symbol. * That is, everything else should be 'static'. * * If the module needs to temporarily modify it's instantiation * data, the type should be changed to RLM_TYPE_THREAD_UNSAFE. * The server will then take care of ensuring that the module * is single-threaded. */ module_t rlm_checkval = { RLM_MODULE_INIT, "checkval", 0, /* type */ checkval_instantiate, /* instantiation */ checkval_detach, /* detach */ { NULL, /* authentication */ checkval_authorize, /* authorization */ NULL, /* preaccounting */ checkval_accounting, /* accounting */ NULL, /* checksimul */ NULL, /* pre-proxy */ NULL, /* post-proxy */ NULL /* post-auth */ }, }; freeradius-server/src/modules/rlm_copy_packet/000077500000000000000000000000001257552170400221355ustar00rootroot00000000000000freeradius-server/src/modules/rlm_copy_packet/Makefile000066400000000000000000000001541257552170400235750ustar00rootroot00000000000000# # Makefile # # Version: $Id$ # TARGET = rlm_copy_packet SRCS = rlm_copy_packet.c include ../rules.mak freeradius-server/src/modules/rlm_copy_packet/README000066400000000000000000000007061257552170400230200ustar00rootroot00000000000000 This module initializes the Access-Accept packet by copying all of the attributes from the Access-Request to the Access-Accept. It should be listed in the "authorize" section of "radiusd.conf", probably after "preprocess", but before any other module. authorize { ... copy_packet ... } It currently takes no configuration, so the sub-section of the "modules" section should look like: modules { ... copy_packet { } ... } freeradius-server/src/modules/rlm_copy_packet/rlm_copy_packet.c000066400000000000000000000071611257552170400254610ustar00rootroot00000000000000/* * rlm_copy_packet.c * * Version: $Id$ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2004,2006 The FreeRADIUS server project * Copyright 2004 Alan DeKok */ #include RCSID("$Id$") #include #include /* * Define a structure for our module configuration. * * It doesn't take any configuration right now... */ typedef struct rlm_packet_t { char *string; } rlm_packet_t; /* * A mapping of configuration file names to internal variables. * * Note that the string is dynamically allocated, so it MUST * be freed. When the configuration file parse re-reads the string, * it free's the old one, and strdup's the new one, placing the pointer * to the strdup'd string into 'config.string'. This gets around * buffer over-flows. */ static const CONF_PARSER module_config[] = { { "string", PW_TYPE_STRING_PTR, offsetof(rlm_packet_t,string), NULL, NULL}, { NULL, -1, 0, NULL, NULL } /* end the list */ }; static int packet_detach(void *instance) { free(instance); return 0; } /* * Do any per-module initialization that is separate to each * configured instance of the module. e.g. set up connections * to external databases, read configuration files, set up * dictionary entries, etc. * * If configuration information is given in the config section * that must be referenced in later calls, store a handle to it * in *instance otherwise put a null pointer there. */ static int packet_instantiate(CONF_SECTION *conf, void **instance) { rlm_packet_t *inst; /* * Set up a storage area for instance data */ inst = rad_malloc(sizeof(*inst)); if (!inst) { return -1; } memset(inst, 0, sizeof(*inst)); /* * If the configuration parameters can't be parsed, then * fail. */ if (cf_section_parse(conf, inst, module_config) < 0) { packet_detach(inst); return -1; } *instance = inst; return 0; } /* * Initialize the reply with the request. */ static int packet_authorize(void *instance, REQUEST *request) { VALUE_PAIR *vps; instance = instance; /* -Wunused */ vps = paircopy(request->packet->vps); pairadd(&(request->reply->vps), vps); return RLM_MODULE_UPDATED; } /* * The module name should be the only globally exported symbol. * That is, everything else should be 'static'. * * If the module needs to temporarily modify it's instantiation * data, the type should be changed to RLM_TYPE_THREAD_UNSAFE. * The server will then take care of ensuring that the module * is single-threaded. */ module_t rlm_copy_packet = { RLM_MODULE_INIT, "copy_packet", RLM_TYPE_THREAD_SAFE, /* type */ packet_instantiate, /* instantiation */ packet_detach, /* detach */ { NULL, /* authentication */ packet_authorize, /* authorization */ NULL, /* preaccounting */ NULL, /* accounting */ NULL, /* checksimul */ NULL, /* pre-proxy */ NULL, /* post-proxy */ NULL /* post-auth */ }, }; freeradius-server/src/modules/rlm_counter/000077500000000000000000000000001257552170400213135ustar00rootroot00000000000000freeradius-server/src/modules/rlm_counter/.gitignore000066400000000000000000000000221257552170400232750ustar00rootroot00000000000000Makefile config.h freeradius-server/src/modules/rlm_counter/Makefile.in000066400000000000000000000006061257552170400233620ustar00rootroot00000000000000# # $Id$ # TARGET = @targetname@ SRCS = rlm_counter.c HEADERS = RLM_CFLAGS = @counter_cflags@ RLM_LIBS = @counter_ldflags@ ifneq ($TARGET,) RLM_INSTALL = rad_counter-install endif include ../rules.mak $(LT_OBJS): $(HEADERS) rad_counter-install: $(INSTALL) -d -m 755 $(R)$(bindir) $(LIBTOOL) --mode=install $(INSTALL) -m 755 \ rad_counter$(EXEEXT) $(R)$(bindir) freeradius-server/src/modules/rlm_counter/config.h.in000066400000000000000000000010751257552170400233410ustar00rootroot00000000000000/* config.h.in. Generated from configure.in by autoheader. */ /* do we have gdbm_fdesc */ #undef HAVE_GDBM_FDESC /* do we need GDBM_SYNC */ #undef NEED_GDBM_SYNC /* 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 version of this package. */ #undef PACKAGE_VERSION freeradius-server/src/modules/rlm_counter/configure000077500000000000000000003714021257552170400232310ustar00rootroot00000000000000#! /bin/sh # From configure.in Revision. # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.61. # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, # 2002, 2003, 2004, 2005, 2006 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=: # 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 # PATH needs CR # 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 # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false 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.) as_nl=' ' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. 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 # Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # CDPATH. $as_unset CDPATH if test "x$CONFIG_SHELL" = x; then if (eval ":") 2>/dev/null; then as_have_required=yes else as_have_required=no fi if test $as_have_required = yes && (eval ": (as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=\$LINENO as_lineno_2=\$LINENO test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } ") 2> /dev/null; then : else as_candidate_shells= as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. case $as_dir in /*) for as_base in sh bash ksh sh5; do as_candidate_shells="$as_candidate_shells $as_dir/$as_base" done;; esac done IFS=$as_save_IFS for as_shell in $as_candidate_shells $SHELL; do # Try only shells that exist, to save several forks. if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { ("$as_shell") 2> /dev/null <<\_ASEOF 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 : _ASEOF }; then CONFIG_SHELL=$as_shell as_have_required=yes if { "$as_shell" 2> /dev/null <<\_ASEOF 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 : (as_func_return () { (exit $1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = "$1" ); then : else exitcode=1 echo positional parameters were not saved. fi test $exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } _ASEOF }; then break fi fi done if test "x$CONFIG_SHELL" != x; then for as_var in BASH_ENV ENV do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done export CONFIG_SHELL exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} fi if test $as_have_required = no; then echo This script requires a shell more modern than all the echo shells that I found on your system. Please install a echo modern shell, or manually run the script under such a echo shell if you do have one. { (exit 1); exit 1; } fi fi fi (eval "as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0") || { echo No shell found that supports shell functions. echo Please tell autoconf@gnu.org about your system, echo including any error possibly output before this echo message } as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, and appends # trailing '-' during substitution so that $LINENO is not a special # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # scripts with optimization help from Paolo Bonzini. 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" || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi 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 fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi 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=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, 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= SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME= PACKAGE_TARNAME= PACKAGE_VERSION= PACKAGE_STRING= PACKAGE_BUGREPORT= ac_unique_file="rlm_counter.c" ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datarootdir datadir sysconfdir sharedstatedir localstatedir includedir oldincludedir docdir infodir htmldir dvidir pdfdir psdir libdir localedir mandir DEFS ECHO_C ECHO_N ECHO_T LIBS build_alias host_alias target_alias CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP GREP EGREP counter_ldflags counter_cflags targetname LIBOBJS LTLIBOBJS' ac_subst_files='' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CPP' # Initialize some variables set by options. ac_init_help= ac_init_version=false # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *) ac_optarg=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_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` eval enable_$ac_feature=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_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` eval enable_$ac_feature=\$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_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/[-.]/_/g'` eval with_$ac_package=\$ac_optarg ;; -without-* | --without-*) ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/[-.]/_/g'` eval with_$ac_package=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 ;; -*) { echo "$as_me: error: unrecognized option: $ac_option Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && 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'` { echo "$as_me: error: missing argument to $ac_option" >&2 { (exit 1); exit 1; }; } fi # Be sure to have absolute directory names. 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 case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; } 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 echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || { echo "$as_me: error: Working directory cannot be determined" >&2 { (exit 1); exit 1; }; } test "X$ac_ls_di" = "X$ac_pwd_ls_di" || { echo "$as_me: error: pwd does not report name of working directory" >&2 { (exit 1); exit 1; }; } # 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 -- "$0" || $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$0" : 'X\(//\)[^/]' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X"$0" | 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 .." { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2 { (exit 1); exit 1; }; } pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures this package to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF _ACEOF fi if test -n "$ac_init_help"; then cat <<\_ACEOF 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 C/C++/Objective C preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. _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" || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`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 echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF configure generated by GNU Autoconf 2.61 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 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 cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by $as_me, which was generated by GNU Autoconf 2.61. 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=. 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=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; 2) ac_configure_args1="$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 ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac done done $as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } $as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export 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 cat <<\_ASBOX ## ---------------- ## ## Cache variables. ## ## ---------------- ## _ASBOX 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_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( *) $as_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 cat <<\_ASBOX ## ----------------- ## ## Output variables. ## ## ----------------- ## _ASBOX echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then cat <<\_ASBOX ## ------------------- ## ## File substitutions. ## ## ------------------- ## _ASBOX echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then cat <<\_ASBOX ## ----------- ## ## confdefs.h. ## ## ----------- ## _ASBOX echo cat confdefs.h echo fi test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" 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'; { (exit 1); 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 # 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 # Let the site file select an alternate cache file if it wants to. # Prefer explicitly selected file to automatically selected ones. if test -n "$CONFIG_SITE"; then set x "$CONFIG_SITE" elif test "x$prefix" != xNONE; then set x "$prefix/share/config.site" "$prefix/etc/config.site" else set x "$ac_default_prefix/share/config.site" \ "$ac_default_prefix/etc/config.site" fi shift for ac_site_file do if test -r "$ac_site_file"; then { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" 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. if test -f "$cache_file"; then { echo "$as_me:$LINENO: loading cache $cache_file" >&5 echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { echo "$as_me:$LINENO: creating cache $cache_file" >&5 echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 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 { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 echo "$as_me: former value: $ac_old_val" >&2;} { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 echo "$as_me: current value: $ac_new_val" >&2;} ac_cache_corrupted=: fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`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. *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 echo "$as_me: error: changes in the environment can compromise the build" >&2;} { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} { (exit 1); exit 1; }; } 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 x$with_rlm_counter != xno; then 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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}gcc" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="gcc" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}cc" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="$ac_prog" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&5 echo "$as_me: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } # Provide some information about the compiler. echo "$as_me:$LINENO: checking for C compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (ac_try="$ac_compiler --version >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -v >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -V >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out 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. { echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6; } ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # # List of possible output files, starting from the most likely. # The algorithm is not robust to junk in `.', hence go to wildcards (a.*) # only as a last resort. b.out is created by i960 compilers. ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out' # # The IRIX 6 linker writes into existing files which may not be # executable, retaining their permissions. Remove them first so a # subsequent execution test works. ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link_default") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; 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 | *.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 { echo "$as_me:$LINENO: result: $ac_file" >&5 echo "${ECHO_T}$ac_file" >&6; } if test -z "$ac_file"; then echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: C compiler cannot create executables See \`config.log' for more details." >&5 echo "$as_me: error: C compiler cannot create executables See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } fi ac_exeext=$ac_cv_exeext # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { echo "$as_me:$LINENO: checking whether the C compiler works" >&5 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6; } # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then if { ac_try='./$ac_file' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { echo "$as_me:$LINENO: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&5 echo "$as_me: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi fi fi { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } rm -f a.out a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; } { echo "$as_me:$LINENO: result: $cross_compiling" >&5 echo "${ECHO_T}$cross_compiling" >&6; } { echo "$as_me:$LINENO: checking for suffix of executables" >&5 echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; } if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; 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 | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest$ac_cv_exeext { echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 echo "${ECHO_T}$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT { echo "$as_me:$LINENO: checking for suffix of object files" >&5 echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; } if test "${ac_cv_objext+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; 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 ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 echo "${ECHO_T}$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; } if test "${ac_cv_c_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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 { echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; } GCC=`test $ac_compiler_gnu = yes && echo yes` ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CFLAGS="" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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 { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 echo "${ECHO_T}$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 { echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_c89+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_c89=$ac_arg else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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) { echo "$as_me:$LINENO: result: none needed" >&5 echo "${ECHO_T}none needed" >&6; } ;; xno) { echo "$as_me:$LINENO: result: unsupported" >&5 echo "${ECHO_T}unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;; 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 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 { echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if test "${ac_cv_prog_CPP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f 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 { echo "$as_me:$LINENO: result: $CPP" >&5 echo "${ECHO_T}$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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&5 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } 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_safe=`echo "gdbm.h" | sed 'y%./+-%__pm%'` { echo "$as_me:$LINENO: checking for gdbm.h" >&5 echo $ECHO_N "checking for gdbm.h... $ECHO_C" >&6; } old_CFLAGS="$CFLAGS" smart_include= smart_include_dir= if test "x$smart_try_dir" != "x"; then for try in $smart_try_dir; do CFLAGS="$old_CFLAGS -I$try" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { int a = 1; ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then smart_include="-I$try" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 smart_include= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test "x$smart_include" != "x"; then break; fi done CFLAGS="$old_CFLAGS" fi if test "x$smart_include" = "x"; then cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { int a = 1; ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then smart_include=" " else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 smart_include= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test "x$smart_include" = "x"; then if test "x$LOCATE" != "x"; then DIRS= file=gdbm.h for x in `${LOCATE} $file 2>/dev/null`; do base=`echo $x | sed "s%/${file}%%"` if test "x$x" = "x$base"; then continue; fi dir=`${DIRNAME} $x 2>/dev/null` exclude=`echo ${dir} | ${GREP} /home` if test "x$exclude" != "x"; then continue fi already=`echo \$smart_include_dir ${DIRS} | ${GREP} ${dir}` if test "x$already" = "x"; then DIRS="$DIRS $dir" fi done fi eval "smart_include_dir=\"\$smart_include_dir $DIRS\"" for try in $smart_include_dir /usr/local/include /opt/include; do CFLAGS="$old_CFLAGS -I$try" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { int a = 1; ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then smart_include="-I$try" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 smart_include= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test "x$smart_include" != "x"; then break; fi done CFLAGS="$old_CFLAGS" fi if test "x$smart_include" != "x"; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } eval "ac_cv_header_$ac_safe=yes" CFLAGS="$old_CFLAGS $smart_include" SMART_CFLAGS="$SMART_CFLAGS $smart_include" else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi sm_lib_safe=`echo "gdbm" | sed 'y%./+-%__p_%'` sm_func_safe=`echo "gdbm_open" | sed 'y%./+-%__p_%'` { echo "$as_me:$LINENO: checking for gdbm_open in -lgdbm" >&5 echo $ECHO_N "checking for gdbm_open in -lgdbm... $ECHO_C" >&6; } old_LIBS="$LIBS" smart_lib= smart_lib_dir= if test "x$smart_try_dir" != "x"; then for try in $smart_try_dir; do LIBS="-L$try -lgdbm $old_LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ extern char gdbm_open(); int main () { gdbm_open() ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then smart_lib="-L$try -lgdbm" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test "x$smart_lib" != "x"; then break; fi done LIBS="$old_LIBS" fi if test "x$smart_lib" = "x"; then LIBS="-lgdbm $old_LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ extern char gdbm_open(); int main () { gdbm_open() ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then smart_lib="-lgdbm" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS="$old_LIBS" fi if test "x$smart_lib" = "x"; then if test "x$LOCATE" != "x"; then DIRS= file=libgdbm${libltdl_cv_shlibext} for x in `${LOCATE} $file 2>/dev/null`; do base=`echo $x | sed "s%/${file}%%"` if test "x$x" = "x$base"; then continue; fi dir=`${DIRNAME} $x 2>/dev/null` exclude=`echo ${dir} | ${GREP} /home` if test "x$exclude" != "x"; then continue fi already=`echo \$smart_lib_dir ${DIRS} | ${GREP} ${dir}` if test "x$already" = "x"; then DIRS="$DIRS $dir" fi done fi eval "smart_lib_dir=\"\$smart_lib_dir $DIRS\"" if test "x$LOCATE" != "x"; then DIRS= file=libgdbm.a for x in `${LOCATE} $file 2>/dev/null`; do base=`echo $x | sed "s%/${file}%%"` if test "x$x" = "x$base"; then continue; fi dir=`${DIRNAME} $x 2>/dev/null` exclude=`echo ${dir} | ${GREP} /home` if test "x$exclude" != "x"; then continue fi already=`echo \$smart_lib_dir ${DIRS} | ${GREP} ${dir}` if test "x$already" = "x"; then DIRS="$DIRS $dir" fi done fi eval "smart_lib_dir=\"\$smart_lib_dir $DIRS\"" for try in $smart_lib_dir /usr/local/lib /opt/lib; do LIBS="-L$try -lgdbm $old_LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ extern char gdbm_open(); int main () { gdbm_open() ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then smart_lib="-L$try -lgdbm" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test "x$smart_lib" != "x"; then break; fi done LIBS="$old_LIBS" fi if test "x$smart_lib" != "x"; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } eval "ac_cv_lib_${sm_lib_safe}_${sm_func_safe}=yes" LIBS="$smart_lib $old_LIBS" SMART_LIBS="$smart_lib $SMART_LIBS" else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_cv_lib_gdbm_gdbm_open" != "xyes"; then fail="$fail libgdbm" fi if test "x$fail" = "x"; then { echo "$as_me:$LINENO: checking to see GDBM_SYNC status" >&5 echo $ECHO_N "checking to see GDBM_SYNC status... $ECHO_C" >&6; } { echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5 echo $ECHO_N "checking for grep that handles long lines and -e... $ECHO_C" >&6; } if test "${ac_cv_path_GREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Extract the first word of "grep ggrep" to use in msg output if test -z "$GREP"; then set dummy grep ggrep; ac_prog_name=$2 if test "${ac_cv_path_GREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" 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 ac_count=`expr $ac_count + 1` 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 fi GREP="$ac_cv_path_GREP" if test -z "$GREP"; then { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} { (exit 1); exit 1; }; } fi else ac_cv_path_GREP=$GREP fi fi { echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5 echo "${ECHO_T}$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { echo "$as_me:$LINENO: checking for egrep" >&5 echo $ECHO_N "checking for egrep... $ECHO_C" >&6; } if test "${ac_cv_path_EGREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else # Extract the first word of "egrep" to use in msg output if test -z "$EGREP"; then set dummy egrep; ac_prog_name=$2 if test "${ac_cv_path_EGREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" 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 ac_count=`expr $ac_count + 1` 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 fi EGREP="$ac_cv_path_EGREP" if test -z "$EGREP"; then { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} { (exit 1); exit 1; }; } fi else ac_cv_path_EGREP=$EGREP fi fi fi { echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 echo "${ECHO_T}$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifdef GDBM_SYNC found-gdbm-sync! #else not found. this version must use sync by default. #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "found-gdbm-sync" >/dev/null 2>&1; then cat >>confdefs.h <<\_ACEOF #define NEED_GDBM_SYNC yes _ACEOF { echo "$as_me:$LINENO: result: needs it." >&5 echo "${ECHO_T}needs it." >&6; } else { echo "$as_me:$LINENO: result: SYNCs by default." >&5 echo "${ECHO_T}SYNCs by default." >&6; } fi rm -f conftest* fi old_LIBS=$LIBS LIBS="$LIBS $SMART_LIBS" { echo "$as_me:$LINENO: checking for gdbm_fdesc" >&5 echo $ECHO_N "checking for gdbm_fdesc... $ECHO_C" >&6; } if test "${ac_cv_func_gdbm_fdesc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define gdbm_fdesc to an innocuous variant, in case declares gdbm_fdesc. For example, HP-UX 11i declares gettimeofday. */ #define gdbm_fdesc innocuous_gdbm_fdesc /* System header to define __stub macros and hopefully few prototypes, which can conflict with char gdbm_fdesc (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef gdbm_fdesc /* 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 gdbm_fdesc (); /* 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_gdbm_fdesc || defined __stub___gdbm_fdesc choke me #endif int main () { return gdbm_fdesc (); ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_func_gdbm_fdesc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_gdbm_fdesc=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_func_gdbm_fdesc" >&5 echo "${ECHO_T}$ac_cv_func_gdbm_fdesc" >&6; } if test "x$ac_cv_func_gdbm_fdesc" = "xyes"; then cat >>confdefs.h <<\_ACEOF #define HAVE_GDBM_FDESC _ACEOF fi LIBS=$old_LIBS targetname=rlm_counter else targetname= echo \*\*\* module rlm_counter is disabled. fi if test x"$fail" != x""; then if test x"${enable_strict_dependencies}" = x"yes"; then { { echo "$as_me:$LINENO: error: set --without-rlm_counter to disable it explicitly." >&5 echo "$as_me: error: set --without-rlm_counter to disable it explicitly." >&2;} { (exit 1); exit 1; }; } else { echo "$as_me:$LINENO: WARNING: silently not building rlm_counter." >&5 echo "$as_me: WARNING: silently not building rlm_counter." >&2;} { echo "$as_me:$LINENO: WARNING: FAILURE: rlm_counter requires: $fail." >&5 echo "$as_me: WARNING: FAILURE: rlm_counter requires: $fail." >&2;}; targetname="" fi fi counter_ldflags=$SMART_LIBS counter_cflags=$SMART_CFLAGS ac_config_headers="$ac_config_headers config.h" unset ac_cv_env_LIBS_set unset ac_cv_env_LIBS_value ac_config_files="$ac_config_files 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_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( *) $as_unset $ac_var ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then test "x$cache_file" != "x/dev/null" && { echo "$as_me:$LINENO: updating cache $cache_file" >&5 echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 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= 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=`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. ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs : ${CONFIG_STATUS=./config.status} ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >$CONFIG_STATUS <<_ACEOF #! $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} _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ## --------------------- ## ## 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=: # 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 # PATH needs CR # 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 # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false 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.) as_nl=' ' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. 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 # Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # CDPATH. $as_unset CDPATH as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, and appends # trailing '-' during substitution so that $LINENO is not a special # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # scripts with optimization help from Paolo Bonzini. 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" || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi 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 fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi 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=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 # Save the log message, to keep $[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by $as_me, which was generated by GNU Autoconf 2.61. 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 cat >>$CONFIG_STATUS <<_ACEOF # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ config.status configured by $0, generated by GNU Autoconf 2.61, with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" Copyright (C) 2006 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' _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # If no file are specified by the user, then we need to provide default # value. By we need to know if files were specified by the user. 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=$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 ) echo "$ac_cs_version"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift CONFIG_FILES="$CONFIG_FILES $ac_optarg" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header { echo "$as_me: error: ambiguous option: $1 Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; };; --help | --hel | -h ) 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. -*) { echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *) ac_config_targets="$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 if \$ac_cs_recheck; then echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 CONFIG_SHELL=$SHELL export CONFIG_SHELL exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # 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" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= trap 'exit_status=$? { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status ' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || { echo "$me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } # # Set up the sed scripts for CONFIG_FILES section. # # No need to generate the scripts if there are no CONFIG_FILES. # This happens for instance when ./config.status config.h if test -n "$CONFIG_FILES"; then _ACEOF ac_delim='%!_!# ' for ac_last_try in false false false false false :; do cat >conf$$subs.sed <<_ACEOF SHELL!$SHELL$ac_delim PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim PACKAGE_NAME!$PACKAGE_NAME$ac_delim PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim PACKAGE_STRING!$PACKAGE_STRING$ac_delim PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim exec_prefix!$exec_prefix$ac_delim prefix!$prefix$ac_delim program_transform_name!$program_transform_name$ac_delim bindir!$bindir$ac_delim sbindir!$sbindir$ac_delim libexecdir!$libexecdir$ac_delim datarootdir!$datarootdir$ac_delim datadir!$datadir$ac_delim sysconfdir!$sysconfdir$ac_delim sharedstatedir!$sharedstatedir$ac_delim localstatedir!$localstatedir$ac_delim includedir!$includedir$ac_delim oldincludedir!$oldincludedir$ac_delim docdir!$docdir$ac_delim infodir!$infodir$ac_delim htmldir!$htmldir$ac_delim dvidir!$dvidir$ac_delim pdfdir!$pdfdir$ac_delim psdir!$psdir$ac_delim libdir!$libdir$ac_delim localedir!$localedir$ac_delim mandir!$mandir$ac_delim DEFS!$DEFS$ac_delim ECHO_C!$ECHO_C$ac_delim ECHO_N!$ECHO_N$ac_delim ECHO_T!$ECHO_T$ac_delim LIBS!$LIBS$ac_delim build_alias!$build_alias$ac_delim host_alias!$host_alias$ac_delim target_alias!$target_alias$ac_delim CC!$CC$ac_delim CFLAGS!$CFLAGS$ac_delim LDFLAGS!$LDFLAGS$ac_delim CPPFLAGS!$CPPFLAGS$ac_delim ac_ct_CC!$ac_ct_CC$ac_delim EXEEXT!$EXEEXT$ac_delim OBJEXT!$OBJEXT$ac_delim CPP!$CPP$ac_delim GREP!$GREP$ac_delim EGREP!$EGREP$ac_delim counter_ldflags!$counter_ldflags$ac_delim counter_cflags!$counter_cflags$ac_delim targetname!$targetname$ac_delim LIBOBJS!$LIBOBJS$ac_delim LTLIBOBJS!$LTLIBOBJS$ac_delim _ACEOF if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 52; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` if test -n "$ac_eof"; then ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` ac_eof=`expr $ac_eof + 1` fi cat >>$CONFIG_STATUS <<_ACEOF cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof /@[a-zA-Z_][a-zA-Z_0-9]*@/!b end _ACEOF sed ' s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g s/^/s,@/; s/!/@,|#_!!_#|/ :n t n s/'"$ac_delim"'$/,g/; t s/$/\\/; p N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n ' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF :end s/|#_!!_#|//g CEOF$ac_eof _ACEOF # VPATH may cause trouble with some makes, so we remove $(srcdir), # ${srcdir} and @srcdir@ 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[ ]*=/{ s/:*\$(srcdir):*/:/ s/:*\${srcdir}:*/:/ s/:*@srcdir@:*/:/ s/^\([^=]*=[ ]*\):*/\1/ s/:*$// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF fi # test -n "$CONFIG_FILES" for ac_tag in :F $CONFIG_FILES :H $CONFIG_HEADERS do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5 echo "$as_me: error: Invalid tag $ac_tag." >&2;} { (exit 1); exit 1; }; };; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 echo "$as_me: error: cannot find input file: $ac_f" >&2;} { (exit 1); exit 1; }; };; esac ac_file_inputs="$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 "`IFS=: echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure." if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { echo "$as_me:$LINENO: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} fi case $ac_tag in *:-:* | *:-) cat >"$tmp/stdin";; 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 || 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" case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`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 || 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" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 echo "$as_me: error: cannot create directory $as_dir" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`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 # _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # 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= case `sed -n '/datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p ' $ac_file_inputs` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF 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 sed "$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s&@configure_input@&$configure_input&;t t s&@top_builddir@&$ac_top_builddir_sub&;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 $ac_datarootdir_hack " $ac_file_inputs | sed -f "$tmp/subs-1.sed" >$tmp/out test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&5 echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&2;} rm -f "$tmp/stdin" case $ac_file in -) cat "$tmp/out"; rm -f "$tmp/out";; *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;; esac ;; :H) # # CONFIG_HEADER # _ACEOF # Transform confdefs.h into a sed script `conftest.defines', that # substitutes the proper values into config.h.in to produce config.h. rm -f conftest.defines conftest.tail # First, append a space to every undef/define line, to ease matching. echo 's/$/ /' >conftest.defines # Then, protect against being on the right side of a sed subst, or in # an unquoted here document, in config.status. If some macros were # called several times there might be several #defines for the same # symbol, which is useless. But do not sort them, since the last # AC_DEFINE must be honored. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* # These sed commands are passed to sed as "A NAME B PARAMS C VALUE D", where # NAME is the cpp macro being defined, VALUE is the value it is being given. # PARAMS is the parameter list in the macro definition--in most cases, it's # just an empty string. ac_dA='s,^\\([ #]*\\)[^ ]*\\([ ]*' ac_dB='\\)[ (].*,\\1define\\2' ac_dC=' ' ac_dD=' ,' uniq confdefs.h | sed -n ' t rset :rset s/^[ ]*#[ ]*define[ ][ ]*// t ok d :ok s/[\\&,]/\\&/g s/^\('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/ '"$ac_dA"'\1'"$ac_dB"'\2'"${ac_dC}"'\3'"$ac_dD"'/p s/^\('"$ac_word_re"'\)[ ]*\(.*\)/'"$ac_dA"'\1'"$ac_dB$ac_dC"'\2'"$ac_dD"'/p ' >>conftest.defines # Remove the space that was appended to ease matching. # Then 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. # (The regexp can be short, since the line contains either #define or #undef.) echo 's/ $// s,^[ #]*u.*,/* & */,' >>conftest.defines # Break up conftest.defines: ac_max_sed_lines=50 # First sed command is: sed -f defines.sed $ac_file_inputs >"$tmp/out1" # Second one is: sed -f defines.sed "$tmp/out1" >"$tmp/out2" # Third one will be: sed -f defines.sed "$tmp/out2" >"$tmp/out1" # et cetera. ac_in='$ac_file_inputs' ac_out='"$tmp/out1"' ac_nxt='"$tmp/out2"' while : do # Write a here document: cat >>$CONFIG_STATUS <<_ACEOF # First, check the format of the line: cat >"\$tmp/defines.sed" <<\\CEOF /^[ ]*#[ ]*undef[ ][ ]*$ac_word_re[ ]*\$/b def /^[ ]*#[ ]*define[ ][ ]*$ac_word_re[( ]/b def b :def _ACEOF sed ${ac_max_sed_lines}q conftest.defines >>$CONFIG_STATUS echo 'CEOF sed -f "$tmp/defines.sed"' "$ac_in >$ac_out" >>$CONFIG_STATUS ac_in=$ac_out; ac_out=$ac_nxt; ac_nxt=$ac_in sed 1,${ac_max_sed_lines}d conftest.defines >conftest.tail grep . conftest.tail >/dev/null || break rm -f conftest.defines mv conftest.tail conftest.defines done rm -f conftest.defines conftest.tail echo "ac_result=$ac_in" >>$CONFIG_STATUS cat >>$CONFIG_STATUS <<\_ACEOF if test x"$ac_file" != x-; then echo "/* $configure_input */" >"$tmp/config.h" cat "$ac_result" >>"$tmp/config.h" if diff $ac_file "$tmp/config.h" >/dev/null 2>&1; then { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 echo "$as_me: $ac_file is unchanged" >&6;} else rm -f $ac_file mv "$tmp/config.h" $ac_file fi else echo "/* $configure_input */" cat "$ac_result" fi rm -f "$tmp/out12" ;; esac done # for ac_tag { (exit 0); exit 0; } _ACEOF chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save # 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 || { (exit 1); exit 1; } fi freeradius-server/src/modules/rlm_counter/configure.in000066400000000000000000000026361257552170400236330ustar00rootroot00000000000000AC_PREREQ([2.53]) AC_INIT(rlm_counter.c) AC_REVISION($Revision$) AC_DEFUN(modname,[rlm_counter]) if test x$with_[]modname != xno; then AC_PROG_CC AC_PROG_CPP FR_SMART_CHECK_INCLUDE(gdbm.h) FR_SMART_CHECK_LIB(gdbm, gdbm_open) if test "x$ac_cv_lib_gdbm_gdbm_open" != "xyes"; then fail="$fail libgdbm" fi if test "x$fail" = "x"; then AC_MSG_CHECKING(to see GDBM_SYNC status) AC_EGREP_CPP(found-gdbm-sync, [ #include #ifdef GDBM_SYNC found-gdbm-sync! #else not found. this version must use sync by default. #endif ], [ AC_DEFINE(NEED_GDBM_SYNC, yes, [do we need GDBM_SYNC]) AC_MSG_RESULT(needs it.) ], [ AC_MSG_RESULT(SYNCs by default.) ] ) fi old_LIBS=$LIBS LIBS="$LIBS $SMART_LIBS" AC_CHECK_FUNC(gdbm_fdesc) if test "x$ac_cv_func_gdbm_fdesc" = "xyes"; then AC_DEFINE(HAVE_GDBM_FDESC, [], [do we have gdbm_fdesc]) fi LIBS=$old_LIBS targetname=modname else targetname= echo \*\*\* module modname is disabled. fi if test x"$fail" != x""; then if test x"${enable_strict_dependencies}" = x"yes"; then AC_MSG_ERROR([set --without-]modname[ to disable it explicitly.]) else AC_MSG_WARN([silently not building ]modname[.]) AC_MSG_WARN([FAILURE: ]modname[ requires: $fail.]); targetname="" fi fi counter_ldflags=$SMART_LIBS counter_cflags=$SMART_CFLAGS AC_SUBST(counter_ldflags) AC_SUBST(counter_cflags) AC_SUBST(targetname) AC_CONFIG_HEADER(config.h) AC_OUTPUT(Makefile) freeradius-server/src/modules/rlm_counter/rad_counter000077500000000000000000000053031257552170400235470ustar00rootroot00000000000000#!/usr/bin/perl # # $Id$ # use warnings ; use GDBM_File ; use Fcntl ; use Getopt::Long; my $user = ''; my $divisor = 1; my $reset = 0; my $match = '.*'; my $help = 0; # # This should be fixed... # $filename = ''; sub show_help { print "Usage: $0 --file= [--reset=] [--match=]\n"; print "[--user=] [--help] [--hours|--minutes|--seconds]\n\n"; print "--user=", "\t\t", "Information for specific user\n"; print "--file=", "\t\t", "Counter db filename\n"; print "--match=", "\t\t", "Information for matching users\n"; print "--reset=", "\t\t", "Reset counter to .\n"; print "\t\t\t\t", "If divisor is set use it, else means seconds\n"; print "--help", "\t\t\t\t", "Show this help screen\n"; print "--(hours|minutes|seconds)", "\t", "Specify information divisor\n"; exit 0; } # # Print out only one user, # # Or specifiy printing in hours, minutes, or seconds (default) # GetOptions ('user=s' => \$user, 'match=s' => \$match, 'file=s' => \$filename, 'reset=i' => \$reset, 'help' => \$help, 'hours' => sub { $divisor = 3600 }, 'minutes' => sub { $divisor = 60 }, 'seconds' => sub { $divisor = 1 } ); show_help if ($help || $filename eq ''); # # Open the file. # if ($reset){ my $db = tie(%hash, 'GDBM_File', $filename, O_RDWR, 0666) or die "Cannot open $filename: $!\n"; }else{ my $db = tie(%hash, 'GDBM_File', $filename, O_RDONLY, 0666) or die "Cannot open $filename: $!\n"; } # # If given one name, give the seconds # if ($user ne '') { if (defined($hash{$user})){ print $user, "\t\t", int ( unpack('L',$hash{$user}) / $divisor), "\n"; if ($reset){ my $uniqueid = (unpack('L A32',$hash{$user}))[1]; $hash{$user} = pack('L A32',$reset * $divisor,$uniqueid); print $user, "\t\t", "Counter reset to ", $reset * $divisor, "\n"; } }else{ print $user, "\t\t", "Not found\n"; } undef $db; untie %hash; exit 0; } # # This may be faster, but unordered. #while (($key,$val) = each %hash) { # foreach $key (sort keys %hash) { # # These are special. next if ($key eq "DEFAULT1"); next if ($key eq "DEFAULT2"); # # Allow user names matching a regex. # next if ($key !~ /$match/); # # Print out the names... print $key, "\t\t", int ( unpack('L',$hash{$key}) / $divisor), "\n"; if ($reset){ my $uniqueid = (unpack('L A32',$hash{$key}))[1]; $hash{$key} = pack('L A32',$reset * $divisor,$uniqueid); print $key, "\t\t", "Counter reset to ", $reset * $divisor, "\n"; } } undef $db; untie %hash; freeradius-server/src/modules/rlm_counter/rlm_counter.c000066400000000000000000000645541257552170400240260ustar00rootroot00000000000000/* * rlm_counter.c * * Version: $Id$ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2001,2006 The FreeRADIUS server project * Copyright 2001 Alan DeKok * Copyright 2001-3 Kostas Kalevras */ #include RCSID("$Id$") #include #include #include #include "config.h" #include #ifdef NEEDS_GDBM_SYNC # define GDBM_SYNCOPT GDBM_SYNC #else # define GDBM_SYNCOPT 0 #endif #ifdef GDBM_NOLOCK #define GDBM_COUNTER_OPTS (GDBM_SYNCOPT | GDBM_NOLOCK) #else #define GDBM_COUNTER_OPTS (GDBM_SYNCOPT) #endif #ifndef HAVE_GDBM_FDESC #define gdbm_fdesc(foo) (-1) #endif #define UNIQUEID_MAX_LEN 32 /* * Define a structure for our module configuration. * * These variables do not need to be in a structure, but it's * a lot cleaner to do so, and a pointer to the structure can * be used as the instance handle. */ typedef struct rlm_counter_t { char *filename; /* name of the database file */ char *reset; /* daily, weekly, monthly, never or user defined */ char *key_name; /* User-Name */ char *count_attribute; /* Acct-Session-Time */ char *counter_name; /* Daily-Session-Time */ char *check_name; /* Daily-Max-Session */ char *reply_name; /* Session-Timeout */ char *service_type; /* Service-Type to search for */ int cache_size; int service_val; int key_attr; int count_attr; int check_attr; int reply_attr; time_t reset_time; /* The time of the next reset. */ time_t last_reset; /* The time of the last reset. */ int dict_attr; /* attribute number for the counter. */ GDBM_FILE gdbm; /* The gdbm file handle */ #ifdef HAVE_PTHREAD_H pthread_mutex_t mutex; /* A mutex to lock the gdbm file for only one reader/writer */ #endif } rlm_counter_t; #ifndef HAVE_PTHREAD_H /* * This is a lot simpler than putting ifdef's around * every use of the pthread functions. */ #define pthread_mutex_lock(a) #define pthread_mutex_unlock(a) #define pthread_mutex_init(a,b) #define pthread_mutex_destroy(a) #endif typedef struct rad_counter { unsigned int user_counter; char uniqueid[UNIQUEID_MAX_LEN]; } rad_counter; /* * A mapping of configuration file names to internal variables. * * Note that the string is dynamically allocated, so it MUST * be freed. When the configuration file parse re-reads the string, * it free's the old one, and strdup's the new one, placing the pointer * to the strdup'd string into 'config.string'. This gets around * buffer over-flows. */ static const CONF_PARSER module_config[] = { { "filename", PW_TYPE_STRING_PTR, offsetof(rlm_counter_t,filename), NULL, NULL }, { "key", PW_TYPE_STRING_PTR, offsetof(rlm_counter_t,key_name), NULL, NULL }, { "reset", PW_TYPE_STRING_PTR, offsetof(rlm_counter_t,reset), NULL, NULL }, { "count-attribute", PW_TYPE_STRING_PTR, offsetof(rlm_counter_t,count_attribute), NULL, NULL }, { "counter-name", PW_TYPE_STRING_PTR, offsetof(rlm_counter_t,counter_name), NULL, NULL }, { "check-name", PW_TYPE_STRING_PTR, offsetof(rlm_counter_t,check_name), NULL, NULL }, { "reply-name", PW_TYPE_STRING_PTR, offsetof(rlm_counter_t,reply_name), NULL, NULL }, { "allowed-servicetype", PW_TYPE_STRING_PTR, offsetof(rlm_counter_t,service_type),NULL, NULL }, { "cache-size", PW_TYPE_INTEGER, offsetof(rlm_counter_t,cache_size), NULL, "1000" }, { NULL, -1, 0, NULL, NULL } }; static int counter_detach(void *instance); /* * See if the counter matches. */ static int counter_cmp(void *instance, REQUEST *req UNUSED, VALUE_PAIR *request, VALUE_PAIR *check, VALUE_PAIR *check_pairs, VALUE_PAIR **reply_pairs) { rlm_counter_t *data = (rlm_counter_t *) instance; datum key_datum; datum count_datum; VALUE_PAIR *key_vp; rad_counter counter; check_pairs = check_pairs; /* shut the compiler up */ reply_pairs = reply_pairs; req = req; /* * Find the key attribute. */ key_vp = pairfind(request, data->key_attr); if (key_vp == NULL) { return RLM_MODULE_NOOP; } key_datum.dptr = key_vp->vp_strvalue; key_datum.dsize = key_vp->length; count_datum = gdbm_fetch(data->gdbm, key_datum); if (count_datum.dptr == NULL) { return -1; } memcpy(&counter, count_datum.dptr, sizeof(rad_counter)); free(count_datum.dptr); return counter.user_counter - check->vp_integer; } static int add_defaults(rlm_counter_t *data) { datum key_datum; datum time_datum; const char *default1 = "DEFAULT1"; const char *default2 = "DEFAULT2"; DEBUG2("rlm_counter: add_defaults: Start"); key_datum.dptr = (char *) default1; key_datum.dsize = strlen(default1); time_datum.dptr = (char *) &data->reset_time; time_datum.dsize = sizeof(time_t); if (gdbm_store(data->gdbm, key_datum, time_datum, GDBM_REPLACE) < 0){ radlog(L_ERR, "rlm_counter: Failed storing data to %s: %s", data->filename, gdbm_strerror(gdbm_errno)); return RLM_MODULE_FAIL; } DEBUG2("rlm_counter: DEFAULT1 set to %d",(int)data->reset_time); key_datum.dptr = (char *) default2; key_datum.dsize = strlen(default2); time_datum.dptr = (char *) &data->last_reset; time_datum.dsize = sizeof(time_t); if (gdbm_store(data->gdbm, key_datum, time_datum, GDBM_REPLACE) < 0){ radlog(L_ERR, "rlm_counter: Failed storing data to %s: %s", data->filename, gdbm_strerror(gdbm_errno)); return RLM_MODULE_FAIL; } DEBUG2("rlm_counter: DEFAULT2 set to %d",(int)data->last_reset); DEBUG2("rlm_counter: add_defaults: End"); return RLM_MODULE_OK; } static int reset_db(rlm_counter_t *data) { int cache_size = data->cache_size; int ret; DEBUG2("rlm_counter: reset_db: Closing database"); gdbm_close(data->gdbm); /* * Open a completely new database. */ data->gdbm = gdbm_open(data->filename, sizeof(int), GDBM_NEWDB | GDBM_COUNTER_OPTS, 0600, NULL); if (data->gdbm == NULL) { radlog(L_ERR, "rlm_counter: Failed to open file %s: %s", data->filename, strerror(errno)); return RLM_MODULE_FAIL; } if (gdbm_setopt(data->gdbm, GDBM_CACHESIZE, &cache_size, sizeof(int)) == -1) radlog(L_ERR, "rlm_counter: Failed to set cache size"); DEBUG2("rlm_counter: reset_db: Opened new database"); /* * Add defaults */ ret = add_defaults(data); if (ret != RLM_MODULE_OK) return ret; DEBUG2("rlm_counter: reset_db ended"); return RLM_MODULE_OK; } static int find_next_reset(rlm_counter_t *data, time_t timeval) { int ret = 0; size_t len; unsigned int num = 1; char last = '\0'; struct tm *tm, s_tm; char sCurrentTime[40], sNextTime[40]; tm = localtime_r(&timeval, &s_tm); len = strftime(sCurrentTime, sizeof(sCurrentTime), "%Y-%m-%d %H:%M:%S", tm); if (len == 0) *sCurrentTime = '\0'; tm->tm_sec = tm->tm_min = 0; if (data->reset == NULL) return -1; if (isdigit((int) data->reset[0])){ len = strlen(data->reset); if (len == 0) return -1; last = data->reset[len - 1]; if (!isalpha((int) last)) last = 'd'; num = atoi(data->reset); DEBUG("rlm_counter: num=%d, last=%c",num,last); } if (strcmp(data->reset, "hourly") == 0 || last == 'h') { /* * Round up to the next nearest hour. */ tm->tm_hour += num; data->reset_time = mktime(tm); } else if (strcmp(data->reset, "daily") == 0 || last == 'd') { /* * Round up to the next nearest day. */ tm->tm_hour = 0; tm->tm_mday += num; data->reset_time = mktime(tm); } else if (strcmp(data->reset, "weekly") == 0 || last == 'w') { /* * Round up to the next nearest week. */ tm->tm_hour = 0; tm->tm_mday += (7 - tm->tm_wday) +(7*(num-1)); data->reset_time = mktime(tm); } else if (strcmp(data->reset, "monthly") == 0 || last == 'm') { tm->tm_hour = 0; tm->tm_mday = 1; tm->tm_mon += num; data->reset_time = mktime(tm); } else if (strcmp(data->reset, "never") == 0) { data->reset_time = 0; } else { radlog(L_ERR, "rlm_counter: Unknown reset timer \"%s\"", data->reset); return -1; } len = strftime(sNextTime, sizeof(sNextTime), "%Y-%m-%d %H:%M:%S", tm); if (len == 0) *sNextTime = '\0'; DEBUG2("rlm_counter: Current Time: %li [%s], Next reset %li [%s]", timeval, sCurrentTime, data->reset_time, sNextTime); return ret; } /* * Do any per-module initialization that is separate to each * configured instance of the module. e.g. set up connections * to external databases, read configuration files, set up * dictionary entries, etc. * * If configuration information is given in the config section * that must be referenced in later calls, store a handle to it * in *instance otherwise put a null pointer there. */ static int counter_instantiate(CONF_SECTION *conf, void **instance) { rlm_counter_t *data; DICT_ATTR *dattr; DICT_VALUE *dval; ATTR_FLAGS flags; time_t now; int cache_size; int ret; datum key_datum; datum time_datum; const char *default1 = "DEFAULT1"; const char *default2 = "DEFAULT2"; /* * Set up a storage area for instance data */ data = rad_malloc(sizeof(*data)); if (!data) { radlog(L_ERR, "rlm_counter: rad_malloc() failed."); return -1; } memset(data, 0, sizeof(*data)); /* * If the configuration parameters can't be parsed, then * fail. */ if (cf_section_parse(conf, data, module_config) < 0) { free(data); return -1; } cache_size = data->cache_size; /* * Discover the attribute number of the key. */ if (data->key_name == NULL) { radlog(L_ERR, "rlm_counter: 'key' must be set."); counter_detach(data); return -1; } dattr = dict_attrbyname(data->key_name); if (dattr == NULL) { radlog(L_ERR, "rlm_counter: No such attribute %s", data->key_name); counter_detach(data); return -1; } data->key_attr = dattr->attr; /* * Discover the attribute number of the counter. */ if (data->count_attribute == NULL) { radlog(L_ERR, "rlm_counter: 'count-attribute' must be set."); counter_detach(data); return -1; } dattr = dict_attrbyname(data->count_attribute); if (dattr == NULL) { radlog(L_ERR, "rlm_counter: No such attribute %s", data->count_attribute); counter_detach(data); return -1; } data->count_attr = dattr->attr; /* * Discover the attribute number of the reply attribute. */ if (data->reply_name != NULL) { dattr = dict_attrbyname(data->reply_name); if (dattr == NULL) { radlog(L_ERR, "rlm_counter: No such attribute %s", data->reply_name); counter_detach(data); return -1; } if (dattr->type != PW_TYPE_INTEGER) { radlog(L_ERR, "rlm_counter: Reply attribute %s is not of type integer", data->reply_name); counter_detach(data); return -1; } data->reply_attr = dattr->attr; } /* * Create a new attribute for the counter. */ if (data->counter_name == NULL) { radlog(L_ERR, "rlm_counter: 'counter-name' must be set."); counter_detach(data); return -1; } memset(&flags, 0, sizeof(flags)); dict_addattr(data->counter_name, 0, PW_TYPE_INTEGER, -1, flags); dattr = dict_attrbyname(data->counter_name); if (dattr == NULL) { radlog(L_ERR, "rlm_counter: Failed to create counter attribute %s", data->counter_name); counter_detach(data); return -1; } data->dict_attr = dattr->attr; DEBUG2("rlm_counter: Counter attribute %s is number %d", data->counter_name, data->dict_attr); /* * Create a new attribute for the check item. */ if (data->check_name == NULL) { radlog(L_ERR, "rlm_counter: 'check-name' must be set."); counter_detach(data); return -1; } dict_addattr(data->check_name, 0, PW_TYPE_INTEGER, -1, flags); dattr = dict_attrbyname(data->check_name); if (dattr == NULL) { radlog(L_ERR, "rlm_counter: Failed to create check attribute %s", data->counter_name); counter_detach(data); return -1; } data->check_attr = dattr->attr; /* * Find the attribute for the allowed protocol */ if (data->service_type != NULL) { if ((dval = dict_valbyname(PW_SERVICE_TYPE, data->service_type)) == NULL) { radlog(L_ERR, "rlm_counter: Failed to find attribute number for %s", data->service_type); counter_detach(data); return -1; } data->service_val = dval->value; } /* * Find when to reset the database. */ if (data->reset == NULL) { radlog(L_ERR, "rlm_counter: 'reset' must be set."); counter_detach(data); return -1; } now = time(NULL); data->reset_time = 0; data->last_reset = now; if (find_next_reset(data,now) == -1){ radlog(L_ERR, "rlm_counter: find_next_reset() returned -1. Exiting."); counter_detach(data); return -1; } if (data->filename == NULL) { radlog(L_ERR, "rlm_counter: 'filename' must be set."); counter_detach(data); return -1; } data->gdbm = gdbm_open(data->filename, sizeof(int), GDBM_WRCREAT | GDBM_COUNTER_OPTS, 0600, NULL); if (data->gdbm == NULL) { radlog(L_ERR, "rlm_counter: Failed to open file %s: %s", data->filename, strerror(errno)); counter_detach(data); return -1; } if (gdbm_setopt(data->gdbm, GDBM_CACHESIZE, &cache_size, sizeof(int)) == -1) radlog(L_ERR, "rlm_counter: Failed to set cache size"); /* * Look for the DEFAULT1 entry. This entry if it exists contains the * time of the next database reset. This time is set each time we reset * the database. If next_reset < now then we reset the database. * That way we can overcome the problem where radiusd is down during a database * reset time. If we did not keep state information in the database then the reset * would be extended and that would create problems. * * We also store the time of the last reset in the DEFAULT2 entry. * * If DEFAULT1 and DEFAULT2 do not exist (new database) we add them to the database */ key_datum.dptr = (char *)default1; key_datum.dsize = strlen(default1); time_datum = gdbm_fetch(data->gdbm, key_datum); if (time_datum.dptr != NULL){ time_t next_reset = 0; memcpy(&next_reset, time_datum.dptr, sizeof(time_t)); free(time_datum.dptr); time_datum.dptr = NULL; if (next_reset && next_reset <= now){ data->last_reset = now; ret = reset_db(data); if (ret != RLM_MODULE_OK){ radlog(L_ERR, "rlm_counter: reset_db() failed"); counter_detach(data); return -1; } } else data->reset_time = next_reset; key_datum.dptr = (char *)default2; key_datum.dsize = strlen(default2); time_datum = gdbm_fetch(data->gdbm, key_datum); if (time_datum.dptr != NULL){ memcpy(&data->last_reset, time_datum.dptr, sizeof(time_t)); free(time_datum.dptr); } } else{ ret = add_defaults(data); if (ret != RLM_MODULE_OK){ radlog(L_ERR, "rlm_counter: add_defaults() failed"); counter_detach(data); return -1; } } /* * Register the counter comparison operation. */ paircompare_register(data->dict_attr, 0, counter_cmp, data); /* * Init the mutex */ pthread_mutex_init(&data->mutex, NULL); *instance = data; return 0; } /* * Write accounting information to this modules database. */ static int counter_accounting(void *instance, REQUEST *request) { rlm_counter_t *data = (rlm_counter_t *)instance; datum key_datum; datum count_datum; VALUE_PAIR *key_vp, *count_vp, *proto_vp, *uniqueid_vp; rad_counter counter; int rcode; int acctstatustype = 0; time_t diff; if ((key_vp = pairfind(request->packet->vps, PW_ACCT_STATUS_TYPE)) != NULL) acctstatustype = key_vp->vp_integer; else { DEBUG("rlm_counter: Could not find account status type in packet."); return RLM_MODULE_NOOP; } if (acctstatustype != PW_STATUS_STOP){ DEBUG("rlm_counter: We only run on Accounting-Stop packets."); return RLM_MODULE_NOOP; } uniqueid_vp = pairfind(request->packet->vps, PW_ACCT_UNIQUE_SESSION_ID); if (uniqueid_vp != NULL) DEBUG("rlm_counter: Packet Unique ID = '%s'",uniqueid_vp->vp_strvalue); /* * Before doing anything else, see if we have to reset * the counters. */ if (data->reset_time && (data->reset_time <= request->timestamp)) { int ret; DEBUG("rlm_counter: Time to reset the database."); data->last_reset = data->reset_time; find_next_reset(data,request->timestamp); pthread_mutex_lock(&data->mutex); ret = reset_db(data); pthread_mutex_unlock(&data->mutex); if (ret != RLM_MODULE_OK) return ret; } /* * Check if we need to watch out for a specific service-type. If yes then check it */ if (data->service_type != NULL) { if ((proto_vp = pairfind(request->packet->vps, PW_SERVICE_TYPE)) == NULL){ DEBUG("rlm_counter: Could not find Service-Type attribute in the request. Returning NOOP."); return RLM_MODULE_NOOP; } if ((unsigned)proto_vp->vp_integer != data->service_val){ DEBUG("rlm_counter: This Service-Type is not allowed. Returning NOOP."); return RLM_MODULE_NOOP; } } /* * Check if request->timestamp - {Acct-Delay-Time} < last_reset * If yes reject the packet since it is very old */ key_vp = pairfind(request->packet->vps, PW_ACCT_DELAY_TIME); if (key_vp != NULL){ if (key_vp->vp_integer != 0 && (request->timestamp - key_vp->vp_integer) < data->last_reset){ DEBUG("rlm_counter: This packet is too old. Returning NOOP."); return RLM_MODULE_NOOP; } } /* * Look for the key. User-Name is special. It means * The REAL username, after stripping. */ key_vp = (data->key_attr == PW_USER_NAME) ? request->username : pairfind(request->packet->vps, data->key_attr); if (key_vp == NULL){ DEBUG("rlm_counter: Could not find the key-attribute in the request. Returning NOOP."); return RLM_MODULE_NOOP; } /* * Look for the attribute to use as a counter. */ count_vp = pairfind(request->packet->vps, data->count_attr); if (count_vp == NULL){ DEBUG("rlm_counter: Could not find the count-attribute in the request."); return RLM_MODULE_NOOP; } key_datum.dptr = key_vp->vp_strvalue; key_datum.dsize = key_vp->length; DEBUG("rlm_counter: Searching the database for key '%s'",key_vp->vp_strvalue); pthread_mutex_lock(&data->mutex); count_datum = gdbm_fetch(data->gdbm, key_datum); pthread_mutex_unlock(&data->mutex); if (count_datum.dptr == NULL){ DEBUG("rlm_counter: Could not find the requested key in the database."); counter.user_counter = 0; if (uniqueid_vp != NULL) strlcpy(counter.uniqueid,uniqueid_vp->vp_strvalue, sizeof(counter.uniqueid)); else memset((char *)counter.uniqueid,0,UNIQUEID_MAX_LEN); } else{ DEBUG("rlm_counter: Key found."); memcpy(&counter, count_datum.dptr, sizeof(rad_counter)); free(count_datum.dptr); if (counter.uniqueid) DEBUG("rlm_counter: Counter Unique ID = '%s'",counter.uniqueid); if (uniqueid_vp != NULL){ if (counter.uniqueid != NULL && strncmp(uniqueid_vp->vp_strvalue,counter.uniqueid, UNIQUEID_MAX_LEN - 1) == 0){ DEBUG("rlm_counter: Unique IDs for user match. Droping the request."); return RLM_MODULE_NOOP; } strlcpy(counter.uniqueid,uniqueid_vp->vp_strvalue, sizeof(counter.uniqueid)); } DEBUG("rlm_counter: User=%s, Counter=%d.",request->username->vp_strvalue,counter.user_counter); } if (data->count_attr == PW_ACCT_SESSION_TIME) { /* * If session time < diff then the user got in after the * last reset. So add his session time, otherwise add the * diff. * * That way if he logged in at 23:00 and we reset the * daily counter at 24:00 and he logged out at 01:00 * then we will only count one hour (the one in the new * day). That is the right thing */ diff = request->timestamp - data->last_reset; counter.user_counter += (count_vp->vp_integer < diff) ? count_vp->vp_integer : diff; } else if (count_vp->type == PW_TYPE_INTEGER) { /* * Integers get counted, without worrying about * reset dates. */ counter.user_counter += count_vp->vp_integer; } else { /* * The attribute is NOT an integer, just count once * more that we've seen it. */ counter.user_counter++; } DEBUG("rlm_counter: User=%s, New Counter=%d.",request->username->vp_strvalue,counter.user_counter); count_datum.dptr = (char *) &counter; count_datum.dsize = sizeof(rad_counter); DEBUG("rlm_counter: Storing new value in database."); pthread_mutex_lock(&data->mutex); rcode = gdbm_store(data->gdbm, key_datum, count_datum, GDBM_REPLACE); pthread_mutex_unlock(&data->mutex); if (rcode < 0) { radlog(L_ERR, "rlm_counter: Failed storing data to %s: %s", data->filename, gdbm_strerror(gdbm_errno)); return RLM_MODULE_FAIL; } DEBUG("rlm_counter: New value stored successfully."); return RLM_MODULE_OK; } /* * Find the named user in this modules database. Create the set * of attribute-value pairs to check and reply with for this user * from the database. The authentication code only needs to check * the password, the rest is done here. */ static int counter_authorize(void *instance, REQUEST *request) { rlm_counter_t *data = (rlm_counter_t *) instance; int ret=RLM_MODULE_NOOP; datum key_datum; datum count_datum; rad_counter counter; int res=0; VALUE_PAIR *key_vp, *check_vp; VALUE_PAIR *reply_item; char msg[128]; /* quiet the compiler */ instance = instance; request = request; /* * Before doing anything else, see if we have to reset * the counters. */ if (data->reset_time && (data->reset_time <= request->timestamp)) { int ret2; data->last_reset = data->reset_time; find_next_reset(data,request->timestamp); pthread_mutex_lock(&data->mutex); ret2 = reset_db(data); pthread_mutex_unlock(&data->mutex); if (ret2 != RLM_MODULE_OK) return ret2; } /* * Look for the key. User-Name is special. It means * The REAL username, after stripping. */ DEBUG2("rlm_counter: Entering module authorize code"); key_vp = (data->key_attr == PW_USER_NAME) ? request->username : pairfind(request->packet->vps, data->key_attr); if (key_vp == NULL) { DEBUG2("rlm_counter: Could not find Key value pair"); return ret; } /* * Look for the check item */ if ((check_vp= pairfind(request->config_items, data->check_attr)) == NULL) { DEBUG2("rlm_counter: Could not find Check item value pair"); return ret; } key_datum.dptr = key_vp->vp_strvalue; key_datum.dsize = key_vp->length; /* * Init to be sure */ counter.user_counter = 0; DEBUG("rlm_counter: Searching the database for key '%s'",key_vp->vp_strvalue); pthread_mutex_lock(&data->mutex); count_datum = gdbm_fetch(data->gdbm, key_datum); pthread_mutex_unlock(&data->mutex); if (count_datum.dptr != NULL){ DEBUG("rlm_counter: Key Found."); memcpy(&counter, count_datum.dptr, sizeof(rad_counter)); free(count_datum.dptr); } else DEBUG("rlm_counter: Could not find the requested key in the database."); /* * Check if check item > counter */ DEBUG("rlm_counter: Check item = %d, Count = %d",check_vp->vp_integer,counter.user_counter); res=check_vp->vp_integer - counter.user_counter; if (res > 0) { DEBUG("rlm_counter: res is greater than zero"); if (data->count_attr == PW_ACCT_SESSION_TIME) { /* * Do the following only if the count attribute is * AcctSessionTime */ /* * We are assuming that simultaneous-use=1. But * even if that does not happen then our user * could login at max for 2*max-usage-time Is * that acceptable? */ /* * User is allowed, but set Session-Timeout. * Stolen from main/auth.c */ /* * If we are near a reset then add the next * limit, so that the user will not need to * login again * Before that set the return value to the time * remaining to next reset */ if (data->reset_time && ( res >= (data->reset_time - request->timestamp))) { res = data->reset_time - request->timestamp; res += check_vp->vp_integer; } if ((reply_item = pairfind(request->reply->vps, PW_SESSION_TIMEOUT)) != NULL) { if (reply_item->vp_integer > res) reply_item->vp_integer = res; } else { reply_item = radius_paircreate(request, &request->reply->vps, PW_SESSION_TIMEOUT, PW_TYPE_INTEGER); reply_item->vp_integer = res; } } else if (data->reply_attr) { if ((reply_item = pairfind(request->reply->vps, data->reply_attr)) != NULL) { if (reply_item->vp_integer > res) reply_item->vp_integer = res; } else { reply_item = radius_paircreate(request, &request->reply->vps, data->reply_attr, PW_TYPE_INTEGER); reply_item->vp_integer = res; } } ret=RLM_MODULE_OK; DEBUG2("rlm_counter: (Check item - counter) is greater than zero"); DEBUG2("rlm_counter: Authorized user %s, check_item=%d, counter=%d", key_vp->vp_strvalue,check_vp->vp_integer,counter.user_counter); DEBUG2("rlm_counter: Sent Reply-Item for user %s, Type=Session-Timeout, value=%d", key_vp->vp_strvalue,res); } else{ char module_fmsg[MAX_STRING_LEN]; VALUE_PAIR *module_fmsg_vp; /* * User is denied access, send back a reply message */ sprintf(msg, "Your maximum %s usage time has been reached", data->reset); reply_item=pairmake("Reply-Message", msg, T_OP_EQ); pairadd(&request->reply->vps, reply_item); snprintf(module_fmsg,sizeof(module_fmsg), "rlm_counter: Maximum %s usage time reached", data->reset); module_fmsg_vp = pairmake("Module-Failure-Message", module_fmsg, T_OP_EQ); pairadd(&request->packet->vps, module_fmsg_vp); ret=RLM_MODULE_REJECT; DEBUG2("rlm_counter: Rejected user %s, check_item=%d, counter=%d", key_vp->vp_strvalue,check_vp->vp_integer,counter.user_counter); } return ret; } static int counter_detach(void *instance) { rlm_counter_t *data = (rlm_counter_t *) instance; paircompare_unregister(data->dict_attr, counter_cmp); if (data->gdbm) gdbm_close(data->gdbm); pthread_mutex_destroy(&data->mutex); free(instance); return 0; } /* * The module name should be the only globally exported symbol. * That is, everything else should be 'static'. * * If the module needs to temporarily modify it's instantiation * data, the type should be changed to RLM_TYPE_THREAD_UNSAFE. * The server will then take care of ensuring that the module * is single-threaded. */ module_t rlm_counter = { RLM_MODULE_INIT, "counter", RLM_TYPE_THREAD_SAFE, /* type */ counter_instantiate, /* instantiation */ counter_detach, /* detach */ { NULL, /* authentication */ counter_authorize, /* authorization */ NULL, /* preaccounting */ counter_accounting, /* accounting */ NULL, /* checksimul */ NULL, /* pre-proxy */ NULL, /* post-proxy */ NULL /* post-auth */ }, }; freeradius-server/src/modules/rlm_cram/000077500000000000000000000000001257552170400205565ustar00rootroot00000000000000freeradius-server/src/modules/rlm_cram/Makefile000066400000000000000000000001361257552170400222160ustar00rootroot00000000000000# # Makefile # # Version: $Id$ # TARGET = rlm_cram SRCS = rlm_cram.c include ../rules.mak freeradius-server/src/modules/rlm_cram/Readme000066400000000000000000000011651257552170400217010ustar00rootroot00000000000000Status for this module is experemental. There is no publically available software to support CRAM authentication via RADIUS yet. CRAM mail authentication (APOP, CRAM-MD5) Attributes used (Vendor Code/PEN: 11406, you may change it to your own) 101 (Sandy-Mail-Authtype), selects CRAM protocol, possible values: 2: CRAM-MD5 3: APOP 8: CRAM-MD4 9: CRAM-SHA1 102 (Sandy-Mail-Challenge), contains server's challenge (usually text banner) 103 (Sandy-Mail-Response), contains client's response, 16 octets for APOP/CRAM-MD5/CRAM-MD4, 20 octets for CRAM-SHA1 See dictionary.sandy and Standard.draft for attribute descriptions. freeradius-server/src/modules/rlm_cram/Standard.draft000066400000000000000000000165261257552170400233520ustar00rootroot00000000000000 Vladimir Dubrovin vlad@sandy.ru SANDY RADIUS Attributes for Mail Authorization and Authentication. Status of this document: This document is a draft for corporate standard for SANDY http://www.sandy.ru Permissions to use: You can use this document as is. Any attributes are subject to change in future untill document status is draft. If you have any comments or suggestions feel free to contact vlad@sandy.ru Vendor Code (PEN): 11406 (SANDY) Attributes Sandy-Mail-Service, Sandy-Mail-Authtype, Sandy-Mail-Challenge, Sandy-Mail-Response MAY present in Access-Request RADIUS packet. The rest of packets MAY present in SUCCESS response. Note: Microsoft implemented NTLM authentication for many mail protocols. SANDY doesn't any special attributes for NTLM because NTLM authentication can be done by implementing MS-CHAP authentication via RADIUS. MS-CHAP authentication in RADIUS is covered by RFC 2433 and RFC 2458. 1. Attribute: Sandy-Mail-Service Vendor-Type: 100 Vendor-Length: 4 Type: integer. This attributes enumerates possible mail services. This attribute MUST present in all requests to RADIUS server from RADIUS client regarding mail authentication. Possible values: Transfer 1 Delivery 2 POP 3 IMAP 4 WEBMAIL 5 Control 6 Transfer - for mail transfer (SMTP for example). MAY require authentication (either clear text/PAP or CRAM-MD5 or NTLM). Delivery - for mail delivery, for example mail.local. SHOULD NOT require authentication, only authorization required for user. POP - POP2/POP3 access. MUST require authentication (cleartext/PAP, APOP, CRAM-MD5 or NTLM). IMAP - IMAP2/IMAP4 access. MUST require authentication (cleartext/PAP, CRAM-MD5 or NTLM). WEBMAIL - access via webmail. MUST require authentication (cleartext or NTLM). Control - account control access (for example Eudora-compatible password change or setting of user-defined filters). 2. Attribute: Sandy-Mail-Authtype Vendor-Type: 101 Vendor-Length: 4 Type: Integer This attribute shows a type of authentication requested by client. It SHOULD be used in all Authentication Request packets from NAS. Possible values: NONE 0 PLAIN 1 CRAM-MD5 2 APOP 3 KRB4 4 KRB5 5 NTLM 6 NTLM2 7 CRAM-MD4 8 CRAM-SHA1 9 NONE - client doesn't do authentication. This is valid in conjunction with Transfer and Delivery Sandy-Mail-Service attributes. PLAIN - authentication via cleartext (PAP). CRAM-MD5 - RFC2104/RFC2195/RFC2554 CRAM-MD5 authentication APOP - RFC 1939 APOP authentication KRB4 - (reserved) Kerberos V4 authentication KRB5 - (reserved) Kerberos V5 authentication NTLM - Microsoft NTLM v1 authentication. SHOULD be implemented as MS-CHAP v1 (RFC2433/RFC2458) NTLM2 - (reserved) Microsoft NTLM v2 authentication. SHOULD be implemented as MS-CHAP v2 (RFC2759/RFC2458) CRAM-MD4 - MD4 digest authentication CRAM-SHA1 - SHA1 digest authentication 3. Attribute: Sandy-Mail-Challenge Vendor-Type: 102 Vendor-Length: >2 Type: String Challenge for challenge-response (APOP, CRAM-MD5) authentication 4. Attribute: Sandy-Mail-Response Vendor-Type: 103 Vendor-Length: >2 Type: Octets Response to challenge-response (APOP, CRAM-MD5) authentication 5. Sandy-Mail-Address Vendor-Type: 104 Vendor-Length: >2 Type: Octets E-mail address. It MAY be used to show destination e-mail address on Transfer and source e-mail address on Delivery request and in reply to WEBMAIL request. 6. Sandy-Mail-Spamcontrol Vendor-Type: 105 Vendor-Length: 4 Type: Integer bit-masked value to show which spam-control mechanism SHOULD be used for user account. It MAY be used in reply to Transfer or Delivery request. Special values: NONE 0 ALL 0xFFFFFFFF All other values are are obtained by XORing this values: Relaying 1 IPResolve 2 Helo 4 BlackList 6 WhiteList 16 RBL 32 MailFrom 64 SrcDomain 128 DstDomain 256 Content 512 First 16 bits (values > 0x0000FFFF) can be used for implementation - specific mechanisms. NONE - no check. Any kind of relaying allowed Ralaying - (for Transfer) - check unauthorized relaying attempts IPResolv - (for Transfer) - check source IP address to resolve in DNS Helo - (for Transfer) check resolution of name in SMTP HELO command BlackList - check in the BlackList WhiteList - check in WhiteList RBL - (for Transfer) turn on RBL-like checks MailFrom - (for Transfer) check existence of Mail From: address SrcDomain - check existence of source domain DstDinain - check existence of destination domain Content - turn on content filtering ALL - do all possible checks 7. Attribute: Sandy-Mail-Notification Vendor-Type: 106 Vendor-Length: >2 Type: Octets This attribute can be used to notify user on new mail received (for example via SMS). It MAY be used in response to Delivery Sandy-Mail-Service. Value of this attribute is fully implementation specific and may be divided into subfields. 8. Attribute: Sandy-Mail-Box Vendor-Type: 107 Vendor-Length: >2 Type: String This attribute shows location of user's mailbox. It can also be used for redirection of all messages to another address, program, etc. Value of this attribute is implementation specific, but sendmail syntax is recommended though (that is first symbol defines a type of destination - '|' - program, '>' - file, etc). This attribute MAY be used in replies First 16 bits (values > 0x0000FFFF) can be used for implementation - specific mechanisms. to Delivery request. 9. Attribute: Sandy-Mail-Quota Vendor-Type: 108 Vendor-Length: 4 Type: Integer Contains a quota for user's mailbox size in octets. It MAY be used in reply to Delivery request. 10. Attribute: Sandy-Mail-Filter Vendor-Type: 109 Vendor-Length: >5 Type: Octets This complex attribute contains of 3 parts - Filter-Name, Parameter-Name and Parameter-Value. Each part consists of 1 octet which shows a length of the part followed by content of the part. It's used to configure user-defined filters (for automatic forwarding, replies or user-controlled content filtering). A single RADIUS packet MAY contain multiple Sandy-Mail-Filter attributes. Example: This Sandy-Mail-Filter sets DESTINATION parameter for 'forward' filter. 106* 33* 7* forward 11* DESTINATION 13* vlad@sandy.ru 106* - Vendor-Type 33* - Vendor-Length ( 1 + 7 + 1 + 11 + 1 + 13) 7* - strlen("forward") 11* - strlen("DESTINATION") 13* - strlen("vlad@sandy.ru") 11. Attribute: Sandy-Mail-Box-Control Vendor-Type: 110 Vendor-Length: 4 Type: Integer bit-masked value to show which control mechanism SHOULD be used for user account. It MAY be used in reply to POP, IMAP, WEBMAIL or Control request. First 16 bits (values > 0x0000FFFF) can be used for implementation - specific mechanisms. Values: Delete-Messages 1 Keep-Sent 2 Read-Only 4 Delete-Messages - delete messages immediately after user retrieval (do not allow user to store his mail on server). Keep-Sent - save all sent messages in Sent folder (for Webmail) Read-Only - allow read only access to user's account (for example to chare account among multiple users). freeradius-server/src/modules/rlm_cram/dictionary.sandy000066400000000000000000000027671257552170400237770ustar00rootroot00000000000000# # The SANDY Vendor-Specific dictionary. # # Version: $Id$ # # For a complete list of Private Enterprise Codes, see: # # http://www.isi.edu/in-notes/iana/assignments/enterprise-numbers # VENDOR Sandy 11406 BEGIN-VENDOR Sandy ATTRIBUTE Sandy-User-Id 1 integer ATTRIBUTE Sandy-Group-Id 2 integer ATTRIBUTE Sandy-GECOS 3 string ATTRIBUTE Sandy-Shell 4 string ATTRIBUTE Sandy-Home 5 string ATTRIBUTE Sandy-Mail-Service 100 integer ATTRIBUTE Sandy-Mail-Authtype 101 integer ATTRIBUTE Sandy-Mail-Challenge 102 string ATTRIBUTE Sandy-Mail-Response 103 octets ATTRIBUTE Sandy-Mail-Address 104 string ATTRIBUTE Sandy-Mail-Spamcontrol 105 integer ATTRIBUTE Sandy-Mail-Notification 106 octets ATTRIBUTE Sandy-Mail-Box 107 string ATTRIBUTE Sandy-Mail-Quota 108 integer ATTRIBUTE Sandy-Mail-Filter 109 octets ATTRIBUTE Sandy-Mail-Box-Control 110 integer ATTRIBUTE Sandy-Mail-Client-IP 111 ipaddr ATTRIBUTE Sandy-Mail-Client-Helo 110 string VALUE Sandy-Mail-Service Transfer 1 VALUE Sandy-Mail-Service Delivery 2 VALUE Sandy-Mail-Service POP 3 VALUE Sandy-Mail-Service IMAP 4 VALUE Sandy-Mail-Service WEBMAIL 5 VALUE Sandy-Mail-Service Control 6 VALUE Sandy-Mail-Authtype NONE 0 VALUE Sandy-Mail-Authtype PLAIN 1 VALUE Sandy-Mail-Authtype CRAM-MD5 2 VALUE Sandy-Mail-Authtype APOP 3 VALUE Sandy-Mail-Authtype KRB4 4 VALUE Sandy-Mail-Authtype KRB5 5 VALUE Sandy-Mail-Authtype NTLM 6 VALUE Sandy-Mail-Authtype NTLM2 7 VALUE Sandy-Mail-Authtype CRAM-MD4 8 VALUE Sandy-Mail-Authtype CRAM-SHA1 9 END-VENDOR Sandyfreeradius-server/src/modules/rlm_cram/rlm_cram.c000066400000000000000000000150761257552170400225270ustar00rootroot00000000000000/* * rlm_cram.c * * Version: $Id$ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2002,2006 The FreeRADIUS server project */ /* * CRAM mail authentication (APOP, CRAM-MD5) * by 3APA3A * * rlm_cram module is a part of Mail authorization/authentication * support. * * Attributes used (Vendor Code/PEN: 11406, you may change it to your own) * 101 (Sandy-Mail-Authtype), selects CRAM protocol, possible values: * 2: CRAM-MD5 * 3: APOP * 8: CRAM-MD4 * 9: CRAM-SHA1 * 102 (Sandy-Mail-Challenge), contains server's challenge (usually * text banner) * 103 (Sandy-Mail-Response), contains client's response, 16 octets * for APOP/CRAM-MD5/CRAM-MD4, 20 octets for CRAM-SHA1 * * (c) 2002 by SANDY (http://www.sandy.ru/) under GPL */ #include RCSID("$Id$") #include #include #include #include #define SM_AUTHTYPE ((11406<<16)|101) #define SM_CHALLENGE ((11406<<16)|102) #define SM_RESPONSE ((11406<<16)|103) static void calc_apop_digest(char * buffer, const char * challenge, int challen, const char * password){ FR_MD5_CTX Context; fr_MD5Init(&Context); fr_MD5Update(&Context,challenge,challen); fr_MD5Update(&Context,password,strlen(password)); fr_MD5Final(buffer,&Context); } static void calc_md5_digest(char * buffer, const char * challenge, int challen, const char * password){ char buf[1024]; int i; FR_MD5_CTX Context; memset(buf, 0, 1024); memset(buf, 0x36, 64); for(i=0; i<64 && password[i]; i++) buf[i]^=password[i]; memcpy(buf+64, challenge, challen); fr_MD5Init(&Context); fr_MD5Update(&Context,buf,64+challen); memset(buf, 0x5c, 64); for(i=0; i<64 && password[i]; i++) buf[i]^=password[i]; fr_MD5Final(buf+64,&Context); fr_MD5Init(&Context); fr_MD5Update(&Context,buf,64+16); fr_MD5Final(buffer,&Context); } static void calc_md4_digest(char * buffer, const char * challenge, int challen, const char * password){ char buf[1024]; int i; FR_MD4_CTX Context; memset(buf, 0, 1024); memset(buf, 0x36, 64); for(i=0; i<64 && password[i]; i++) buf[i]^=password[i]; memcpy(buf+64, challenge, challen); fr_MD4Init(&Context); fr_MD4Update(&Context,buf,64+challen); memset(buf, 0x5c, 64); for(i=0; i<64 && password[i]; i++) buf[i]^=password[i]; fr_MD4Final(buf+64,&Context); fr_MD4Init(&Context); fr_MD4Update(&Context,buf,64+16); fr_MD4Final(buffer,&Context); } static void calc_sha1_digest(char * buffer, const char * challenge, int challen, const char * password){ char buf[1024]; int i; fr_SHA1_CTX Context; memset(buf, 0, 1024); memset(buf, 0x36, 64); for(i=0; i<64 && password[i]; i++) buf[i]^=password[i]; memcpy(buf+64, challenge, challen); fr_SHA1Init(&Context); fr_SHA1Update(&Context,buf,64+challen); memset(buf, 0x5c, 64); for(i=0; i<64 && password[i]; i++) buf[i]^=password[i]; fr_SHA1Final(buf+64,&Context); fr_SHA1Init(&Context); fr_SHA1Update(&Context,buf,64+20); fr_SHA1Final(buffer,&Context); } static int cram_authenticate(UNUSED void * instance, REQUEST *request) { VALUE_PAIR *authtype, *challenge, *response, *password; char buffer[64]; password = pairfind(request->config_items, PW_CLEARTEXT_PASSWORD); if(!password) { radlog(L_AUTH, "rlm_cram: Cleartext-Password is required for authentication."); return RLM_MODULE_INVALID; } authtype = pairfind(request->packet->vps, SM_AUTHTYPE); if(!authtype) { radlog(L_AUTH, "rlm_cram: Required attribute Sandy-Mail-Authtype missed"); return RLM_MODULE_INVALID; } challenge = pairfind(request->packet->vps, SM_CHALLENGE); if(!challenge) { radlog(L_AUTH, "rlm_cram: Required attribute Sandy-Mail-Challenge missed"); return RLM_MODULE_INVALID; } response = pairfind(request->packet->vps, SM_RESPONSE); if(!response) { radlog(L_AUTH, "rlm_cram: Required attribute Sandy-Mail-Response missed"); return RLM_MODULE_INVALID; } switch(authtype->vp_integer){ case 2: /* CRAM-MD5 */ if(challenge->length < 5 || response->length != 16) { radlog(L_AUTH, "rlm_cram: invalid MD5 challenge/response length"); return RLM_MODULE_INVALID; } calc_md5_digest(buffer, challenge->vp_strvalue, challenge->length, password->vp_strvalue); if(!memcmp(buffer, response->vp_strvalue, 16)) return RLM_MODULE_OK; break; case 3: /* APOP */ if(challenge->length < 5 || response->length != 16) { radlog(L_AUTH, "rlm_cram: invalid APOP challenge/response length"); return RLM_MODULE_INVALID; } calc_apop_digest(buffer, challenge->vp_strvalue, challenge->length, password->vp_strvalue); if(!memcmp(buffer, response->vp_strvalue, 16)) return RLM_MODULE_OK; break; case 8: /* CRAM-MD4 */ if(challenge->length < 5 || response->length != 16) { radlog(L_AUTH, "rlm_cram: invalid MD4 challenge/response length"); return RLM_MODULE_INVALID; } calc_md4_digest(buffer, challenge->vp_strvalue, challenge->length, password->vp_strvalue); if(!memcmp(buffer, response->vp_strvalue, 16)) return RLM_MODULE_OK; break; case 9: /* CRAM-SHA1 */ if(challenge->length < 5 || response->length != 20) { radlog(L_AUTH, "rlm_cram: invalid MD4 challenge/response length"); return RLM_MODULE_INVALID; } calc_sha1_digest(buffer, challenge->vp_strvalue, challenge->length, password->vp_strvalue); if(!memcmp(buffer, response->vp_strvalue, 20)) return RLM_MODULE_OK; break; default: radlog(L_AUTH, "rlm_cram: unsupported Sandy-Mail-Authtype"); return RLM_MODULE_INVALID; } return RLM_MODULE_NOTFOUND; } module_t rlm_cram = { RLM_MODULE_INIT, "CRAM", RLM_TYPE_THREAD_SAFE, /* type */ NULL, /* instantiation */ NULL, /* detach */ { cram_authenticate, /* authenticate */ NULL, /* authorize */ NULL, /* pre-accounting */ NULL, /* accounting */ NULL, /* checksimul */ NULL, /* pre-proxy */ NULL, /* post-proxy */ NULL /* post-auth */ }, }; freeradius-server/src/modules/rlm_dbm/000077500000000000000000000000001257552170400203765ustar00rootroot00000000000000freeradius-server/src/modules/rlm_dbm/.gitignore000066400000000000000000000000441257552170400223640ustar00rootroot00000000000000Makefile rlm_dbm_cat rlm_dbm_parser freeradius-server/src/modules/rlm_dbm/Makefile.in000066400000000000000000000016421257552170400224460ustar00rootroot00000000000000# # $Id$ # TARGET = @targetname@ SRCS = rlm_dbm.c HEADERS = RLM_UTILS = $(addsuffix $(EXEEXT),@dbm_utils@) RLM_CFLAGS = @dbm_cflags@ RLM_LIBS = @dbm_ldflags@ RLM_INSTALL = @dbm_install@ include ../rules.mak rlm_dbm_parser: rlm_dbm_parser.lo $(LIBRADIUS) $(LIBTOOL) --mode=link --tag=CC $(CC) $(LDFLAGS) $(RLM_LDFLAGS) \ -o $@ $^ $(RLM_LIBS) $(LIBS) rlm_dbm_cat: rlm_dbm_cat.lo $(LIBRADIUS) $(LIBTOOL) --mode=link --tag=CC $(CC) $(LDFLAGS) $(RLM_LDFLAGS) \ -o $@ $^ $(RLM_LIBS) $(LIBS) # # Install the utility programs in the bin directory. # rlm_dbm_install: rlm_dbm_cat rlm_dbm_parser $(LIBTOOL) --mode=install $(INSTALL) -m 755 $(INSTALLSTRIP) \ rlm_dbm_cat$(EXEEXT) $(R)$(bindir) $(LIBTOOL) --mode=install $(INSTALL) -m 755 $(INSTALLSTRIP) \ rlm_dbm_parser$(EXEEXT) $(R)$(bindir) $(INSTALL) -m 644 rlm_dbm_cat.8 $(R)$(mandir)/man8 $(INSTALL) -m 644 rlm_dbm_parser.8 $(R)$(mandir)/man8 freeradius-server/src/modules/rlm_dbm/configure000077500000000000000000004174571257552170400223270ustar00rootroot00000000000000#! /bin/sh # From configure.in Revision. # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.61. # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, # 2002, 2003, 2004, 2005, 2006 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=: # 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 # PATH needs CR # 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 # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false 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.) as_nl=' ' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. 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 # Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # CDPATH. $as_unset CDPATH if test "x$CONFIG_SHELL" = x; then if (eval ":") 2>/dev/null; then as_have_required=yes else as_have_required=no fi if test $as_have_required = yes && (eval ": (as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=\$LINENO as_lineno_2=\$LINENO test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } ") 2> /dev/null; then : else as_candidate_shells= as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. case $as_dir in /*) for as_base in sh bash ksh sh5; do as_candidate_shells="$as_candidate_shells $as_dir/$as_base" done;; esac done IFS=$as_save_IFS for as_shell in $as_candidate_shells $SHELL; do # Try only shells that exist, to save several forks. if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { ("$as_shell") 2> /dev/null <<\_ASEOF 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 : _ASEOF }; then CONFIG_SHELL=$as_shell as_have_required=yes if { "$as_shell" 2> /dev/null <<\_ASEOF 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 : (as_func_return () { (exit $1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = "$1" ); then : else exitcode=1 echo positional parameters were not saved. fi test $exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } _ASEOF }; then break fi fi done if test "x$CONFIG_SHELL" != x; then for as_var in BASH_ENV ENV do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done export CONFIG_SHELL exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} fi if test $as_have_required = no; then echo This script requires a shell more modern than all the echo shells that I found on your system. Please install a echo modern shell, or manually run the script under such a echo shell if you do have one. { (exit 1); exit 1; } fi fi fi (eval "as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0") || { echo No shell found that supports shell functions. echo Please tell autoconf@gnu.org about your system, echo including any error possibly output before this echo message } as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, and appends # trailing '-' during substitution so that $LINENO is not a special # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # scripts with optimization help from Paolo Bonzini. 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" || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi 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 fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi 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=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, 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= SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME= PACKAGE_TARNAME= PACKAGE_VERSION= PACKAGE_STRING= PACKAGE_BUGREPORT= ac_unique_file="rlm_dbm.c" ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datarootdir datadir sysconfdir sharedstatedir localstatedir includedir oldincludedir docdir infodir htmldir dvidir pdfdir psdir libdir localedir mandir DEFS ECHO_C ECHO_N ECHO_T LIBS build_alias host_alias target_alias CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP dbm_ldflags dbm_cflags targetname dbm_utils dbm_install LIBOBJS LTLIBOBJS' ac_subst_files='' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CPP' # Initialize some variables set by options. ac_init_help= ac_init_version=false # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *) ac_optarg=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_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` eval enable_$ac_feature=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_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` eval enable_$ac_feature=\$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_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/[-.]/_/g'` eval with_$ac_package=\$ac_optarg ;; -without-* | --without-*) ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/[-.]/_/g'` eval with_$ac_package=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 ;; -*) { echo "$as_me: error: unrecognized option: $ac_option Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && 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'` { echo "$as_me: error: missing argument to $ac_option" >&2 { (exit 1); exit 1; }; } fi # Be sure to have absolute directory names. 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 case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; } 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 echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || { echo "$as_me: error: Working directory cannot be determined" >&2 { (exit 1); exit 1; }; } test "X$ac_ls_di" = "X$ac_pwd_ls_di" || { echo "$as_me: error: pwd does not report name of working directory" >&2 { (exit 1); exit 1; }; } # 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 -- "$0" || $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$0" : 'X\(//\)[^/]' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X"$0" | 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 .." { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2 { (exit 1); exit 1; }; } pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures this package to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF _ACEOF fi if test -n "$ac_init_help"; then cat <<\_ACEOF Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-rlm-dbm-lib-dir=DIR Directory for DBM library files --with-rlm-dbm-include-dir=DIR Directory for DBM include files 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 C/C++/Objective C preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. _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" || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`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 echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF configure generated by GNU Autoconf 2.61 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 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 cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by $as_me, which was generated by GNU Autoconf 2.61. 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=. 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=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; 2) ac_configure_args1="$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 ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac done done $as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } $as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export 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 cat <<\_ASBOX ## ---------------- ## ## Cache variables. ## ## ---------------- ## _ASBOX 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_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( *) $as_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 cat <<\_ASBOX ## ----------------- ## ## Output variables. ## ## ----------------- ## _ASBOX echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then cat <<\_ASBOX ## ------------------- ## ## File substitutions. ## ## ------------------- ## _ASBOX echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then cat <<\_ASBOX ## ----------- ## ## confdefs.h. ## ## ----------- ## _ASBOX echo cat confdefs.h echo fi test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" 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'; { (exit 1); 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 # 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 # Let the site file select an alternate cache file if it wants to. # Prefer explicitly selected file to automatically selected ones. if test -n "$CONFIG_SITE"; then set x "$CONFIG_SITE" elif test "x$prefix" != xNONE; then set x "$prefix/share/config.site" "$prefix/etc/config.site" else set x "$ac_default_prefix/share/config.site" \ "$ac_default_prefix/etc/config.site" fi shift for ac_site_file do if test -r "$ac_site_file"; then { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" 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. if test -f "$cache_file"; then { echo "$as_me:$LINENO: loading cache $cache_file" >&5 echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { echo "$as_me:$LINENO: creating cache $cache_file" >&5 echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 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 { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 echo "$as_me: former value: $ac_old_val" >&2;} { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 echo "$as_me: current value: $ac_new_val" >&2;} ac_cache_corrupted=: fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`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. *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 echo "$as_me: error: changes in the environment can compromise the build" >&2;} { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} { (exit 1); exit 1; }; } 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 x$with_rlm_dbm != xno; then 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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}gcc" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="gcc" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}cc" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="$ac_prog" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&5 echo "$as_me: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } # Provide some information about the compiler. echo "$as_me:$LINENO: checking for C compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (ac_try="$ac_compiler --version >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -v >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -V >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out 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. { echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6; } ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # # List of possible output files, starting from the most likely. # The algorithm is not robust to junk in `.', hence go to wildcards (a.*) # only as a last resort. b.out is created by i960 compilers. ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out' # # The IRIX 6 linker writes into existing files which may not be # executable, retaining their permissions. Remove them first so a # subsequent execution test works. ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link_default") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; 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 | *.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 { echo "$as_me:$LINENO: result: $ac_file" >&5 echo "${ECHO_T}$ac_file" >&6; } if test -z "$ac_file"; then echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: C compiler cannot create executables See \`config.log' for more details." >&5 echo "$as_me: error: C compiler cannot create executables See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } fi ac_exeext=$ac_cv_exeext # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { echo "$as_me:$LINENO: checking whether the C compiler works" >&5 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6; } # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then if { ac_try='./$ac_file' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { echo "$as_me:$LINENO: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&5 echo "$as_me: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi fi fi { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } rm -f a.out a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; } { echo "$as_me:$LINENO: result: $cross_compiling" >&5 echo "${ECHO_T}$cross_compiling" >&6; } { echo "$as_me:$LINENO: checking for suffix of executables" >&5 echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; } if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; 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 | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest$ac_cv_exeext { echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 echo "${ECHO_T}$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT { echo "$as_me:$LINENO: checking for suffix of object files" >&5 echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; } if test "${ac_cv_objext+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; 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 ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 echo "${ECHO_T}$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; } if test "${ac_cv_c_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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 { echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; } GCC=`test $ac_compiler_gnu = yes && echo yes` ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CFLAGS="" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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 { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 echo "${ECHO_T}$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 { echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_c89+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_c89=$ac_arg else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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) { echo "$as_me:$LINENO: result: none needed" >&5 echo "${ECHO_T}none needed" >&6; } ;; xno) { echo "$as_me:$LINENO: result: unsupported" >&5 echo "${ECHO_T}unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;; 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 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 { echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if test "${ac_cv_prog_CPP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f 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 { echo "$as_me:$LINENO: result: $CPP" >&5 echo "${ECHO_T}$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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&5 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } 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 rlm_dbm_lib_dir= # Check whether --with-rlm-dbm-lib-dir was given. if test "${with_rlm_dbm_lib_dir+set}" = set; then withval=$with_rlm_dbm_lib_dir; case "$withval" in no) { { echo "$as_me:$LINENO: error: Need rlm-dbm-lib-dir" >&5 echo "$as_me: error: Need rlm-dbm-lib-dir" >&2;} { (exit 1); exit 1; }; } ;; yes) ;; *) rlm_dbm_lib_dir="$withval" ;; esac fi rlm_dbm_inc_dir= # Check whether --with-rlm-dbm-include-dir was given. if test "${with_rlm_dbm_include_dir+set}" = set; then withval=$with_rlm_dbm_include_dir; case "$withval" in no) { { echo "$as_me:$LINENO: error: Need rlm-dbm-include-dir" >&5 echo "$as_me: error: Need rlm-dbm-include-dir" >&2;} { (exit 1); exit 1; }; } ;; yes) ;; *) rlm_dbm_include_dir="$withval" ;; esac fi smart_try_dir=$rlm_dbm_include_dir ac_safe=`echo "ndbm.h" | sed 'y%./+-%__pm%'` { echo "$as_me:$LINENO: checking for ndbm.h" >&5 echo $ECHO_N "checking for ndbm.h... $ECHO_C" >&6; } old_CFLAGS="$CFLAGS" smart_include= smart_include_dir= if test "x$smart_try_dir" != "x"; then for try in $smart_try_dir; do CFLAGS="$old_CFLAGS -I$try" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { int a = 1; ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then smart_include="-I$try" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 smart_include= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test "x$smart_include" != "x"; then break; fi done CFLAGS="$old_CFLAGS" fi if test "x$smart_include" = "x"; then cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { int a = 1; ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then smart_include=" " else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 smart_include= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test "x$smart_include" = "x"; then if test "x$LOCATE" != "x"; then DIRS= file=ndbm.h for x in `${LOCATE} $file 2>/dev/null`; do base=`echo $x | sed "s%/${file}%%"` if test "x$x" = "x$base"; then continue; fi dir=`${DIRNAME} $x 2>/dev/null` exclude=`echo ${dir} | ${GREP} /home` if test "x$exclude" != "x"; then continue fi already=`echo \$smart_include_dir ${DIRS} | ${GREP} ${dir}` if test "x$already" = "x"; then DIRS="$DIRS $dir" fi done fi eval "smart_include_dir=\"\$smart_include_dir $DIRS\"" for try in $smart_include_dir /usr/local/include /opt/include; do CFLAGS="$old_CFLAGS -I$try" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { int a = 1; ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then smart_include="-I$try" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 smart_include= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test "x$smart_include" != "x"; then break; fi done CFLAGS="$old_CFLAGS" fi if test "x$smart_include" != "x"; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } eval "ac_cv_header_$ac_safe=yes" CFLAGS="$old_CFLAGS $smart_include" SMART_CFLAGS="$SMART_CFLAGS $smart_include" else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_cv_header_ndbm_h" = "xyes"; then SMART_CFLAGS="${SMART_CFLAGS} -DHAVE_NDBM_H" else ac_safe=`echo "gdbm/ndbm.h" | sed 'y%./+-%__pm%'` { echo "$as_me:$LINENO: checking for gdbm/ndbm.h" >&5 echo $ECHO_N "checking for gdbm/ndbm.h... $ECHO_C" >&6; } old_CFLAGS="$CFLAGS" smart_include= smart_include_dir= if test "x$smart_try_dir" != "x"; then for try in $smart_try_dir; do CFLAGS="$old_CFLAGS -I$try" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { int a = 1; ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then smart_include="-I$try" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 smart_include= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test "x$smart_include" != "x"; then break; fi done CFLAGS="$old_CFLAGS" fi if test "x$smart_include" = "x"; then cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { int a = 1; ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then smart_include=" " else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 smart_include= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test "x$smart_include" = "x"; then if test "x$LOCATE" != "x"; then DIRS= file=gdbm/ndbm.h for x in `${LOCATE} $file 2>/dev/null`; do base=`echo $x | sed "s%/${file}%%"` if test "x$x" = "x$base"; then continue; fi dir=`${DIRNAME} $x 2>/dev/null` exclude=`echo ${dir} | ${GREP} /home` if test "x$exclude" != "x"; then continue fi already=`echo \$smart_include_dir ${DIRS} | ${GREP} ${dir}` if test "x$already" = "x"; then DIRS="$DIRS $dir" fi done fi eval "smart_include_dir=\"\$smart_include_dir $DIRS\"" for try in $smart_include_dir /usr/local/include /opt/include; do CFLAGS="$old_CFLAGS -I$try" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { int a = 1; ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then smart_include="-I$try" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 smart_include= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test "x$smart_include" != "x"; then break; fi done CFLAGS="$old_CFLAGS" fi if test "x$smart_include" != "x"; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } eval "ac_cv_header_$ac_safe=yes" CFLAGS="$old_CFLAGS $smart_include" SMART_CFLAGS="$SMART_CFLAGS $smart_include" else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_cv_header_gdbm_ndbm_h" = "xyes"; then SMART_CFLAGS="${SMART_CFLAGS} -DHAVE_GDBM_NDBM_H" else ac_cv_header_gdbm_ndbm_h="bad autoconf assumption" ac_safe=`echo "gdbm-ndbm.h" | sed 'y%./+-%__pm%'` { echo "$as_me:$LINENO: checking for gdbm-ndbm.h" >&5 echo $ECHO_N "checking for gdbm-ndbm.h... $ECHO_C" >&6; } old_CFLAGS="$CFLAGS" smart_include= smart_include_dir= if test "x$smart_try_dir" != "x"; then for try in $smart_try_dir; do CFLAGS="$old_CFLAGS -I$try" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { int a = 1; ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then smart_include="-I$try" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 smart_include= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test "x$smart_include" != "x"; then break; fi done CFLAGS="$old_CFLAGS" fi if test "x$smart_include" = "x"; then cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { int a = 1; ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then smart_include=" " else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 smart_include= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test "x$smart_include" = "x"; then if test "x$LOCATE" != "x"; then DIRS= file=gdbm-ndbm.h for x in `${LOCATE} $file 2>/dev/null`; do base=`echo $x | sed "s%/${file}%%"` if test "x$x" = "x$base"; then continue; fi dir=`${DIRNAME} $x 2>/dev/null` exclude=`echo ${dir} | ${GREP} /home` if test "x$exclude" != "x"; then continue fi already=`echo \$smart_include_dir ${DIRS} | ${GREP} ${dir}` if test "x$already" = "x"; then DIRS="$DIRS $dir" fi done fi eval "smart_include_dir=\"\$smart_include_dir $DIRS\"" for try in $smart_include_dir /usr/local/include /opt/include; do CFLAGS="$old_CFLAGS -I$try" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { int a = 1; ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then smart_include="-I$try" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 smart_include= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test "x$smart_include" != "x"; then break; fi done CFLAGS="$old_CFLAGS" fi if test "x$smart_include" != "x"; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } eval "ac_cv_header_$ac_safe=yes" CFLAGS="$old_CFLAGS $smart_include" SMART_CFLAGS="$SMART_CFLAGS $smart_include" else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_cv_header_gdbmmndbm_h" = "xyes"; then SMART_CFLAGS="${SMART_CFLAGS} -DHAVE_GDBMNDBM_H" else fail="$fail (ndbm.h or gdbm/ndbm.h or gdbm-ndbm.h)" fi fi fi { echo "$as_me:$LINENO: checking for dbm in default lib" >&5 echo $ECHO_N "checking for dbm in default lib... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ extern void* dbm_open(); int main () { dbm_open() ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_default_dbm_open=yes { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test "x$ac_cv_lib_default_dbm_open" != "xyes"; then smart_try_dir=$rlm_dbm_lib_dir sm_lib_safe=`echo "ndbm" | sed 'y%./+-%__p_%'` sm_func_safe=`echo "dbm_open" | sed 'y%./+-%__p_%'` { echo "$as_me:$LINENO: checking for dbm_open in -lndbm" >&5 echo $ECHO_N "checking for dbm_open in -lndbm... $ECHO_C" >&6; } old_LIBS="$LIBS" smart_lib= smart_lib_dir= if test "x$smart_try_dir" != "x"; then for try in $smart_try_dir; do LIBS="-L$try -lndbm $old_LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ extern char dbm_open(); int main () { dbm_open() ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then smart_lib="-L$try -lndbm" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test "x$smart_lib" != "x"; then break; fi done LIBS="$old_LIBS" fi if test "x$smart_lib" = "x"; then LIBS="-lndbm $old_LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ extern char dbm_open(); int main () { dbm_open() ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then smart_lib="-lndbm" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS="$old_LIBS" fi if test "x$smart_lib" = "x"; then if test "x$LOCATE" != "x"; then DIRS= file=libndbm${libltdl_cv_shlibext} for x in `${LOCATE} $file 2>/dev/null`; do base=`echo $x | sed "s%/${file}%%"` if test "x$x" = "x$base"; then continue; fi dir=`${DIRNAME} $x 2>/dev/null` exclude=`echo ${dir} | ${GREP} /home` if test "x$exclude" != "x"; then continue fi already=`echo \$smart_lib_dir ${DIRS} | ${GREP} ${dir}` if test "x$already" = "x"; then DIRS="$DIRS $dir" fi done fi eval "smart_lib_dir=\"\$smart_lib_dir $DIRS\"" if test "x$LOCATE" != "x"; then DIRS= file=libndbm.a for x in `${LOCATE} $file 2>/dev/null`; do base=`echo $x | sed "s%/${file}%%"` if test "x$x" = "x$base"; then continue; fi dir=`${DIRNAME} $x 2>/dev/null` exclude=`echo ${dir} | ${GREP} /home` if test "x$exclude" != "x"; then continue fi already=`echo \$smart_lib_dir ${DIRS} | ${GREP} ${dir}` if test "x$already" = "x"; then DIRS="$DIRS $dir" fi done fi eval "smart_lib_dir=\"\$smart_lib_dir $DIRS\"" for try in $smart_lib_dir /usr/local/lib /opt/lib; do LIBS="-L$try -lndbm $old_LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ extern char dbm_open(); int main () { dbm_open() ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then smart_lib="-L$try -lndbm" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test "x$smart_lib" != "x"; then break; fi done LIBS="$old_LIBS" fi if test "x$smart_lib" != "x"; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } eval "ac_cv_lib_${sm_lib_safe}_${sm_func_safe}=yes" LIBS="$smart_lib $old_LIBS" SMART_LIBS="$smart_lib $SMART_LIBS" else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_cv_lib_ndbm_dbm_open" != "xyes"; then sm_lib_safe=`echo "gdbm" | sed 'y%./+-%__p_%'` sm_func_safe=`echo "dbm_open" | sed 'y%./+-%__p_%'` { echo "$as_me:$LINENO: checking for dbm_open in -lgdbm" >&5 echo $ECHO_N "checking for dbm_open in -lgdbm... $ECHO_C" >&6; } old_LIBS="$LIBS" smart_lib= smart_lib_dir= if test "x$smart_try_dir" != "x"; then for try in $smart_try_dir; do LIBS="-L$try -lgdbm $old_LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ extern char dbm_open(); int main () { dbm_open() ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then smart_lib="-L$try -lgdbm" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test "x$smart_lib" != "x"; then break; fi done LIBS="$old_LIBS" fi if test "x$smart_lib" = "x"; then LIBS="-lgdbm $old_LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ extern char dbm_open(); int main () { dbm_open() ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then smart_lib="-lgdbm" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS="$old_LIBS" fi if test "x$smart_lib" = "x"; then if test "x$LOCATE" != "x"; then DIRS= file=libgdbm${libltdl_cv_shlibext} for x in `${LOCATE} $file 2>/dev/null`; do base=`echo $x | sed "s%/${file}%%"` if test "x$x" = "x$base"; then continue; fi dir=`${DIRNAME} $x 2>/dev/null` exclude=`echo ${dir} | ${GREP} /home` if test "x$exclude" != "x"; then continue fi already=`echo \$smart_lib_dir ${DIRS} | ${GREP} ${dir}` if test "x$already" = "x"; then DIRS="$DIRS $dir" fi done fi eval "smart_lib_dir=\"\$smart_lib_dir $DIRS\"" if test "x$LOCATE" != "x"; then DIRS= file=libgdbm.a for x in `${LOCATE} $file 2>/dev/null`; do base=`echo $x | sed "s%/${file}%%"` if test "x$x" = "x$base"; then continue; fi dir=`${DIRNAME} $x 2>/dev/null` exclude=`echo ${dir} | ${GREP} /home` if test "x$exclude" != "x"; then continue fi already=`echo \$smart_lib_dir ${DIRS} | ${GREP} ${dir}` if test "x$already" = "x"; then DIRS="$DIRS $dir" fi done fi eval "smart_lib_dir=\"\$smart_lib_dir $DIRS\"" for try in $smart_lib_dir /usr/local/lib /opt/lib; do LIBS="-L$try -lgdbm $old_LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ extern char dbm_open(); int main () { dbm_open() ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then smart_lib="-L$try -lgdbm" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test "x$smart_lib" != "x"; then break; fi done LIBS="$old_LIBS" fi if test "x$smart_lib" != "x"; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } eval "ac_cv_lib_${sm_lib_safe}_${sm_func_safe}=yes" LIBS="$smart_lib $old_LIBS" SMART_LIBS="$smart_lib $SMART_LIBS" else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_cv_lib_gdbm_dbm_open" != "xyes"; then sm_lib_safe=`echo "gdbm_compat" | sed 'y%./+-%__p_%'` sm_func_safe=`echo "dbm_open" | sed 'y%./+-%__p_%'` { echo "$as_me:$LINENO: checking for dbm_open in -lgdbm_compat" >&5 echo $ECHO_N "checking for dbm_open in -lgdbm_compat... $ECHO_C" >&6; } old_LIBS="$LIBS" smart_lib= smart_lib_dir= if test "x$smart_try_dir" != "x"; then for try in $smart_try_dir; do LIBS="-L$try -lgdbm_compat $old_LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ extern char dbm_open(); int main () { dbm_open() ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then smart_lib="-L$try -lgdbm_compat" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test "x$smart_lib" != "x"; then break; fi done LIBS="$old_LIBS" fi if test "x$smart_lib" = "x"; then LIBS="-lgdbm_compat $old_LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ extern char dbm_open(); int main () { dbm_open() ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then smart_lib="-lgdbm_compat" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS="$old_LIBS" fi if test "x$smart_lib" = "x"; then if test "x$LOCATE" != "x"; then DIRS= file=libgdbm_compat${libltdl_cv_shlibext} for x in `${LOCATE} $file 2>/dev/null`; do base=`echo $x | sed "s%/${file}%%"` if test "x$x" = "x$base"; then continue; fi dir=`${DIRNAME} $x 2>/dev/null` exclude=`echo ${dir} | ${GREP} /home` if test "x$exclude" != "x"; then continue fi already=`echo \$smart_lib_dir ${DIRS} | ${GREP} ${dir}` if test "x$already" = "x"; then DIRS="$DIRS $dir" fi done fi eval "smart_lib_dir=\"\$smart_lib_dir $DIRS\"" if test "x$LOCATE" != "x"; then DIRS= file=libgdbm_compat.a for x in `${LOCATE} $file 2>/dev/null`; do base=`echo $x | sed "s%/${file}%%"` if test "x$x" = "x$base"; then continue; fi dir=`${DIRNAME} $x 2>/dev/null` exclude=`echo ${dir} | ${GREP} /home` if test "x$exclude" != "x"; then continue fi already=`echo \$smart_lib_dir ${DIRS} | ${GREP} ${dir}` if test "x$already" = "x"; then DIRS="$DIRS $dir" fi done fi eval "smart_lib_dir=\"\$smart_lib_dir $DIRS\"" for try in $smart_lib_dir /usr/local/lib /opt/lib; do LIBS="-L$try -lgdbm_compat $old_LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ extern char dbm_open(); int main () { dbm_open() ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then smart_lib="-L$try -lgdbm_compat" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test "x$smart_lib" != "x"; then break; fi done LIBS="$old_LIBS" fi if test "x$smart_lib" != "x"; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } eval "ac_cv_lib_${sm_lib_safe}_${sm_func_safe}=yes" LIBS="$smart_lib $old_LIBS" SMART_LIBS="$smart_lib $SMART_LIBS" else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_cv_lib_gdbm_compat_dbm_open" != "xyes"; then fail="$fail (libndbm or libgdbm or libgdbm_compat)" fi fi fi fi targetname=rlm_dbm else targetname= echo \*\*\* module rlm_dbm is disabled. fi if test x"$fail" != x""; then { echo "$as_me:$LINENO: WARNING: FAILURE: rlm_dbm requires: $fail." >&5 echo "$as_me: WARNING: FAILURE: rlm_dbm requires: $fail." >&2;}; if test x"${enable_strict_dependencies}" = x"yes"; then { { echo "$as_me:$LINENO: error: set --without-rlm_dbm to disable it explicitly." >&5 echo "$as_me: error: set --without-rlm_dbm to disable it explicitly." >&2;} { (exit 1); exit 1; }; } else { echo "$as_me:$LINENO: WARNING: silently not building rlm_dbm." >&5 echo "$as_me: WARNING: silently not building rlm_dbm." >&2;} targetname="" fi fi if test "x$targetname" != "x"; then dbm_utils="rlm_dbm_parser rlm_dbm_cat" dbm_install="rlm_dbm_install" fi dbm_ldflags=$SMART_LIBS dbm_cflags=$SMART_CFLAGS unset ac_cv_env_LIBS_set unset ac_cv_env_LIBS_value ac_config_files="$ac_config_files 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_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( *) $as_unset $ac_var ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then test "x$cache_file" != "x/dev/null" && { echo "$as_me:$LINENO: updating cache $cache_file" >&5 echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 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}' # Transform confdefs.h into DEFS. # Protect against shell expansion while executing Makefile rules. # Protect against Makefile macro expansion. # # If the first sed substitution is executed (which looks for macros that # take arguments), then branch to the quote section. Otherwise, # look for a macro that doesn't take arguments. ac_script=' t clear :clear s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g t quote s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g t quote b any :quote s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g s/\[/\\&/g s/\]/\\&/g s/\$/$$/g H :any ${ g s/^\n// s/\n/ /g p } ' DEFS=`sed -n "$ac_script" confdefs.h` ac_libobjs= ac_ltlibobjs= 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=`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. ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs : ${CONFIG_STATUS=./config.status} ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >$CONFIG_STATUS <<_ACEOF #! $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} _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ## --------------------- ## ## 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=: # 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 # PATH needs CR # 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 # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false 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.) as_nl=' ' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. 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 # Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # CDPATH. $as_unset CDPATH as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, and appends # trailing '-' during substitution so that $LINENO is not a special # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # scripts with optimization help from Paolo Bonzini. 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" || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi 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 fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi 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=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 # Save the log message, to keep $[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by $as_me, which was generated by GNU Autoconf 2.61. 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 cat >>$CONFIG_STATUS <<_ACEOF # Files that config.status was made for. config_files="$ac_config_files" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit -q, --quiet 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 Configuration files: $config_files Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ config.status configured by $0, generated by GNU Autoconf 2.61, with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" Copyright (C) 2006 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' _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # If no file are specified by the user, then we need to provide default # value. By we need to know if files were specified by the user. 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=$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 ) echo "$ac_cs_version"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift CONFIG_FILES="$CONFIG_FILES $ac_optarg" ac_need_defaults=false;; --he | --h | --help | --hel | -h ) 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. -*) { echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *) ac_config_targets="$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 if \$ac_cs_recheck; then echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 CONFIG_SHELL=$SHELL export CONFIG_SHELL exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; 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 fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= trap 'exit_status=$? { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status ' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || { echo "$me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } # # Set up the sed scripts for CONFIG_FILES section. # # No need to generate the scripts if there are no CONFIG_FILES. # This happens for instance when ./config.status config.h if test -n "$CONFIG_FILES"; then _ACEOF ac_delim='%!_!# ' for ac_last_try in false false false false false :; do cat >conf$$subs.sed <<_ACEOF SHELL!$SHELL$ac_delim PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim PACKAGE_NAME!$PACKAGE_NAME$ac_delim PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim PACKAGE_STRING!$PACKAGE_STRING$ac_delim PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim exec_prefix!$exec_prefix$ac_delim prefix!$prefix$ac_delim program_transform_name!$program_transform_name$ac_delim bindir!$bindir$ac_delim sbindir!$sbindir$ac_delim libexecdir!$libexecdir$ac_delim datarootdir!$datarootdir$ac_delim datadir!$datadir$ac_delim sysconfdir!$sysconfdir$ac_delim sharedstatedir!$sharedstatedir$ac_delim localstatedir!$localstatedir$ac_delim includedir!$includedir$ac_delim oldincludedir!$oldincludedir$ac_delim docdir!$docdir$ac_delim infodir!$infodir$ac_delim htmldir!$htmldir$ac_delim dvidir!$dvidir$ac_delim pdfdir!$pdfdir$ac_delim psdir!$psdir$ac_delim libdir!$libdir$ac_delim localedir!$localedir$ac_delim mandir!$mandir$ac_delim DEFS!$DEFS$ac_delim ECHO_C!$ECHO_C$ac_delim ECHO_N!$ECHO_N$ac_delim ECHO_T!$ECHO_T$ac_delim LIBS!$LIBS$ac_delim build_alias!$build_alias$ac_delim host_alias!$host_alias$ac_delim target_alias!$target_alias$ac_delim CC!$CC$ac_delim CFLAGS!$CFLAGS$ac_delim LDFLAGS!$LDFLAGS$ac_delim CPPFLAGS!$CPPFLAGS$ac_delim ac_ct_CC!$ac_ct_CC$ac_delim EXEEXT!$EXEEXT$ac_delim OBJEXT!$OBJEXT$ac_delim CPP!$CPP$ac_delim dbm_ldflags!$dbm_ldflags$ac_delim dbm_cflags!$dbm_cflags$ac_delim targetname!$targetname$ac_delim dbm_utils!$dbm_utils$ac_delim dbm_install!$dbm_install$ac_delim LIBOBJS!$LIBOBJS$ac_delim LTLIBOBJS!$LTLIBOBJS$ac_delim _ACEOF if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 52; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` if test -n "$ac_eof"; then ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` ac_eof=`expr $ac_eof + 1` fi cat >>$CONFIG_STATUS <<_ACEOF cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof /@[a-zA-Z_][a-zA-Z_0-9]*@/!b end _ACEOF sed ' s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g s/^/s,@/; s/!/@,|#_!!_#|/ :n t n s/'"$ac_delim"'$/,g/; t s/$/\\/; p N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n ' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF :end s/|#_!!_#|//g CEOF$ac_eof _ACEOF # VPATH may cause trouble with some makes, so we remove $(srcdir), # ${srcdir} and @srcdir@ 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[ ]*=/{ s/:*\$(srcdir):*/:/ s/:*\${srcdir}:*/:/ s/:*@srcdir@:*/:/ s/^\([^=]*=[ ]*\):*/\1/ s/:*$// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF fi # test -n "$CONFIG_FILES" for ac_tag in :F $CONFIG_FILES do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5 echo "$as_me: error: Invalid tag $ac_tag." >&2;} { (exit 1); exit 1; }; };; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 echo "$as_me: error: cannot find input file: $ac_f" >&2;} { (exit 1); exit 1; }; };; esac ac_file_inputs="$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 "`IFS=: echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure." if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { echo "$as_me:$LINENO: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} fi case $ac_tag in *:-:* | *:-) cat >"$tmp/stdin";; 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 || 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" case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`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 || 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" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 echo "$as_me: error: cannot create directory $as_dir" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`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 # _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # 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= case `sed -n '/datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p ' $ac_file_inputs` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF 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 sed "$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s&@configure_input@&$configure_input&;t t s&@top_builddir@&$ac_top_builddir_sub&;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 $ac_datarootdir_hack " $ac_file_inputs | sed -f "$tmp/subs-1.sed" >$tmp/out test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&5 echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&2;} rm -f "$tmp/stdin" case $ac_file in -) cat "$tmp/out"; rm -f "$tmp/out";; *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;; esac ;; esac done # for ac_tag { (exit 0); exit 0; } _ACEOF chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save # 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 || { (exit 1); exit 1; } fi freeradius-server/src/modules/rlm_dbm/configure.in000066400000000000000000000052601257552170400227120ustar00rootroot00000000000000AC_PREREQ([2.53]) AC_INIT(rlm_dbm.c) AC_REVISION($Revision$) AC_DEFUN(modname,[rlm_dbm]) if test x$with_[]modname != xno; then AC_PROG_CC AC_PROG_CPP dnl extra argument: --with-rlm-dbm-lib-dir rlm_dbm_lib_dir= AC_ARG_WITH(rlm-dbm-lib-dir, [ --with-rlm-dbm-lib-dir=DIR Directory for DBM library files []], [ case "$withval" in no) AC_MSG_ERROR(Need rlm-dbm-lib-dir) ;; yes) ;; *) rlm_dbm_lib_dir="$withval" ;; esac ] ) dnl extra argument: --with-rlm-dbm-include-dir rlm_dbm_inc_dir= AC_ARG_WITH(rlm-dbm-include-dir, [ --with-rlm-dbm-include-dir=DIR Directory for DBM include files []], [ case "$withval" in no) AC_MSG_ERROR(Need rlm-dbm-include-dir) ;; yes) ;; *) rlm_dbm_include_dir="$withval" ;; esac ] ) smart_try_dir=$rlm_dbm_include_dir FR_SMART_CHECK_INCLUDE(ndbm.h) if test "x$ac_cv_header_ndbm_h" = "xyes"; then SMART_CFLAGS="${SMART_CFLAGS} -DHAVE_NDBM_H" else FR_SMART_CHECK_INCLUDE(gdbm/ndbm.h) if test "x$ac_cv_header_gdbm_ndbm_h" = "xyes"; then SMART_CFLAGS="${SMART_CFLAGS} -DHAVE_GDBM_NDBM_H" else ac_cv_header_gdbm_ndbm_h="bad autoconf assumption" FR_SMART_CHECK_INCLUDE(gdbm-ndbm.h) if test "x$ac_cv_header_gdbmmndbm_h" = "xyes"; then SMART_CFLAGS="${SMART_CFLAGS} -DHAVE_GDBMNDBM_H" else fail="$fail (ndbm.h or gdbm/ndbm.h or gdbm-ndbm.h)" fi fi fi AC_MSG_CHECKING([for dbm in default lib]) AC_TRY_LINK([extern void* dbm_open();],dbm_open(),[ac_cv_lib_default_dbm_open=yes AC_MSG_RESULT(yes)],[AC_MSG_RESULT(no)]) if test "x$ac_cv_lib_default_dbm_open" != "xyes"; then smart_try_dir=$rlm_dbm_lib_dir FR_SMART_CHECK_LIB(ndbm, dbm_open) if test "x$ac_cv_lib_ndbm_dbm_open" != "xyes"; then dnl GNU DBM < 1.8.1 FR_SMART_CHECK_LIB(gdbm, dbm_open) if test "x$ac_cv_lib_gdbm_dbm_open" != "xyes"; then dnl GNU DBM >= 1.8.1 FR_SMART_CHECK_LIB(gdbm_compat, dbm_open) if test "x$ac_cv_lib_gdbm_compat_dbm_open" != "xyes"; then fail="$fail (libndbm or libgdbm or libgdbm_compat)" fi fi fi fi targetname=modname else targetname= echo \*\*\* module modname is disabled. fi if test x"$fail" != x""; then AC_MSG_WARN([FAILURE: ]modname[ requires: $fail.]); if test x"${enable_strict_dependencies}" = x"yes"; then AC_MSG_ERROR([set --without-]modname[ to disable it explicitly.]) else AC_MSG_WARN([silently not building ]modname[.]) targetname="" fi fi if test "x$targetname" != "x"; then dbm_utils="rlm_dbm_parser rlm_dbm_cat" dbm_install="rlm_dbm_install" fi dbm_ldflags=$SMART_LIBS dbm_cflags=$SMART_CFLAGS AC_SUBST(dbm_ldflags) AC_SUBST(dbm_cflags) AC_SUBST(targetname) AC_SUBST(dbm_utils) AC_SUBST(dbm_install) AC_OUTPUT(Makefile) freeradius-server/src/modules/rlm_dbm/rlm_dbm.c000066400000000000000000000242321257552170400221610ustar00rootroot00000000000000/* * rlm_dbm.c authorize: authorize using ndbm database * * Version: $Id$ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2001 Koulik Andrei, Sandy Service * Copyright 2006 The FreeRADIUS server project */ #include RCSID("$Id$") #include #include #ifdef HAVE_NDBM_H #include #endif #ifdef HAVE_GDBM_NDBM_H #include #endif #ifdef HAVE_GDBMNDBM_H #include #endif #include #ifdef SANDY_MOD # include "sandymod.h" #endif #define MYDBM DBM #define get_user_content dbm_fetch #define SM_JOIN_ATTR 1029 #ifdef SANDY_MOD # define SM_POOL_ATTR 510 #endif typedef struct rlm_dbm_t { #ifdef SANDY_MOD char *dms_servers; char *ducpd_servers; #endif char *userfile; int findmod; } rlm_dbm_t; typedef struct user_entry { char * username; struct user_entry * next; } SM_USER_ENTRY; static const CONF_PARSER module_config[] = { { "usersfile", PW_TYPE_STRING_PTR,offsetof(struct rlm_dbm_t,userfile), NULL, "/etc/uf" }, { NULL, -1, 0, NULL, NULL } }; static void sm_user_list_wipe (SM_USER_ENTRY **ue) { SM_USER_ENTRY * pue, *nue; if ( ! *ue ) return ; pue = *ue; while ( pue != NULL ) { nue = pue -> next; DEBUG2("Remove %s from user list", pue -> username); free(pue -> username); free(pue); pue = nue; } *ue = NULL; } /* * add username un to user list ue; * return 0 if user succefuly added * 1 - if username already exists * -1 - error: no memmory */ static int sm_user_list_add(SM_USER_ENTRY **ue, const char *un) { while( *ue ) { if ( strcmp( (*ue) -> username, un) == 0 ) return 1; ue = & ((*ue) -> next); } *ue = malloc(sizeof(SM_USER_ENTRY)); if ( !*ue ) return -1; (*ue) -> username = strdup(un); DEBUG2("Add %s to user list", (*ue) -> username); (*ue) -> next = NULL ; if ( ! (*ue) -> username ) { free(*ue); *ue = NULL; return -1; } else return 0; } enum { SMP_PATTERN, SMP_REPLY, SMP_ERROR }; /******/ static int isfallthrough(VALUE_PAIR *vp) { VALUE_PAIR * tmp; tmp = pairfind(vp, PW_FALL_THROUGH); return tmp ? tmp -> vp_integer : 1; /* if no FALL_THROUGH - keep looking */ } /* sm_parse_user * find user, parse and return result * in-parameters: * pdb - ndbm handler * username - user name from request * request - pair originated from the nas * mode - search mode SM_SM_ACCUM - accumulative search mode * out-parameters: * in-out: * parsed_users - list of parsed user names for loop removal */ static int sm_parse_user(DBM *pdb, const char * username, REQUEST *req, VALUE_PAIR const* request, VALUE_PAIR **config, VALUE_PAIR **reply, SM_USER_ENTRY **ulist) { datum k,d; int retcod, found = RLM_MODULE_NOTFOUND, res ; VALUE_PAIR *vp = NULL,* tmp_config = NULL, *tmp_reply = NULL, *nu_reply = NULL; VALUE_PAIR *join_attr; char *ch,*beg; int parse_state = SMP_PATTERN; int continue_search = 1; /* check for loop */ DEBUG2("sm_parse_user.c: check for loops"); if ( (retcod = sm_user_list_add(ulist,username) ) ) { if ( retcod < 0 ) radlog(L_ERR,"rlm_dbm: Couldn't allocate memory"); else radlog(L_ERR,"rlm_dbm: Invalid configuration: loop detected"); return RLM_MODULE_FAIL; } /* retrieve user content */ k.dptr = username; k.dsize = strlen(username) + 1 ; /* username stored with '\0' */ d = dbm_fetch(pdb, k); if ( d.dptr == NULL ) { DEBUG2("rlm_dbm: User <%s> not found in database\n",username); return RLM_MODULE_NOTFOUND; } ch = d.dptr; ch [ d.dsize - 1 ] = '\0'; /* should be closed by 0 */ DEBUG2("sm_parse_user: start parsing: user: %s", username); /* start parse content */ while ( parse_state != SMP_ERROR && *ch && continue_search ) { beg = ch; while( *ch && *ch != '\n') ch++ ; if ( *ch == '\n' ) { *ch = 0; ch++; } DEBUG2("parse buffer: <<%s>>\n",beg); retcod = userparse(beg,&vp); if ( retcod == T_OP_INVALID ) fr_perror("parse error "); switch ( retcod ) { case T_COMMA: break; /* continue parse the current list */ case T_EOL: DEBUG2("rlm_dbm: recod parsed\n"); /* vp contains full pair list */ if ( parse_state == SMP_PATTERN ) { /* pattern line found */ DEBUG2("process pattern"); /* check pattern against request */ if ( paircompare(req, request, vp, reply ) == 0 ) { DEBUG2("rlm_dbm: Pattern matched, look for request"); pairmove(&tmp_config, &vp); pairfree(&vp); parse_state = SMP_REPLY; /* look for reply */ } else { /* skip reply */ DEBUG2("rlm_dbm: patern not matched, reply skiped"); pairfree(&vp); while ( *ch && *ch !='\n' ) ch++; if ( *ch == '\n' ) ch++; } } else { /* reply line found */ /* look for join-attribute */ DEBUG2("rlm_dbm: Reply found"); join_attr = vp; while( (join_attr = pairfind(join_attr,SM_JOIN_ATTR) ) != NULL ) { DEBUG2("rlm_dbm: Proccess nested record: username %s", (char *)join_attr->vp_strvalue); /* res = RLM_MODULE_NOTFOUND; */ res = sm_parse_user(pdb, (char *)join_attr->vp_strvalue, req, request, &tmp_config, &nu_reply, ulist); DEBUG("rlm_dbm: recived: %d\n",res); switch ( res ) { case RLM_MODULE_NOTFOUND: case RLM_MODULE_OK: break; default: /* seems error code */ parse_state = SMP_ERROR; DEBUG2("rlm_dbm: Nested record error\n"); break; } join_attr = join_attr -> next; } pairdelete(&vp,SM_JOIN_ATTR); if ( parse_state != SMP_ERROR ) { if ( ! isfallthrough(vp) ) { continue_search = 0; DEBUG2("rlm_dbm: Break search due Fall-Through = no"); } pairmove(&vp,&nu_reply); pairfree(&nu_reply); pairmove(&tmp_reply,&vp); pairfree(&vp); parse_state = SMP_PATTERN; found = RLM_MODULE_OK; } pairfree(&vp); pairfree(&nu_reply); } break; default: /* we do not wait that !!!! */ parse_state = SMP_ERROR; DEBUG2("rlm_dbm: Unknown token: %d\n",retcod); break; } } if ( parse_state == SMP_PATTERN ) { pairmove(config,&tmp_config); pairfree(&tmp_config); pairmove(reply,&tmp_reply); pairfree(&tmp_reply); } else { pairfree(&tmp_config); pairfree(&tmp_reply); pairfree(&vp); DEBUG2("rlm_dbm: Bad final parse state: %d\n",parse_state); found = RLM_MODULE_FAIL ; } pairfree(&vp); return found; } static int sm_postprocessor(VALUE_PAIR **reply UNUSED) { return 0; } static int rlm_dbm_instantiate(CONF_SECTION *conf, void **instance) { struct rlm_dbm_t *inst; inst = rad_malloc(sizeof(rlm_dbm_t)); if (!inst) { return -1; } memset(inst, 0, sizeof(*inst)); if (cf_section_parse(conf, inst, module_config) < 0) { free(inst); return -1; } *instance = inst; return 0; } static int rlm_dbm_authorize(void *instance, REQUEST *request) { VALUE_PAIR *namepair; VALUE_PAIR *request_pairs; VALUE_PAIR *check_tmp = NULL; VALUE_PAIR *reply_tmp = NULL; int found = 0; const char *name; SM_USER_ENTRY *ulist = NULL; DBM *pdb; struct rlm_dbm_t *inst = instance; VALUE_PAIR **check_pairs, **reply_pairs; request_pairs = request->packet->vps; check_pairs = &request->config_items; reply_pairs = &request->reply->vps; /* * Grab the canonical user name. */ namepair = request->username; name = namepair ? (char *) namepair->vp_strvalue : "NONE"; DEBUG2("rlm_dbm: try open database file: %s\n",inst -> userfile); /* open database */ if ( ( pdb = dbm_open(inst->userfile, O_RDONLY, 0600) ) != NULL ) { DEBUG("rlm_dbm: Call parse_user:\n"); found = sm_parse_user(pdb, name, request, request_pairs, &check_tmp, &reply_tmp, &ulist); if ( found == RLM_MODULE_NOTFOUND ) { sm_user_list_wipe(&ulist); found = sm_parse_user(pdb, "DEFAULT", request, request_pairs, &check_tmp, &reply_tmp, &ulist); } dbm_close(pdb); } else { found = RLM_MODULE_FAIL; DEBUG2("rlm_dbm: Cannot open database file: %s\n", strerror(errno)); } if ( found == RLM_MODULE_OK ) { /* do preprocessor for final reply-pair tranformation */ if ( !sm_postprocessor(&reply_tmp) ) { pairmove(reply_pairs, &reply_tmp); pairmove(check_pairs, &check_tmp); } else found = RLM_MODULE_FAIL; } sm_user_list_wipe(&ulist); pairfree(&reply_tmp); pairfree(&check_tmp); return found; } static int rlm_dbm_detach(void *instance) { struct rlm_dbm_t *inst = instance; free(inst); return 0; } /* globally exported name */ module_t rlm_dbm = { RLM_MODULE_INIT, "dbm", 0, /* type: reserved */ rlm_dbm_instantiate, /* instantiation */ rlm_dbm_detach, /* detach */ { NULL, /* authentication */ rlm_dbm_authorize, /* authorization */ NULL, /* preaccounting */ NULL, /* accounting */ NULL, /* checksimul */ NULL, /* pre-proxy */ NULL, /* post-proxy */ NULL /* post-auth */ }, }; freeradius-server/src/modules/rlm_dbm/rlm_dbm_cat.8000066400000000000000000000014031257552170400227300ustar00rootroot00000000000000.TH RLM_DBM_CAT 8 .SH NAME rlm_dbm_cat - list contents of radius database .SH SYNOPSIS .B rlm_dbm_cat .RB [ \-f .IR file ] .RB [ \-w ] .RB [ \-i .IR number ] .RB [ \-l .IR number ] .RB [ \-v ] [\fIusername ...\fP] .SH DESCRIPTION \fBrlm_dbm_cat\fP simply lists the definition(s) of the username(s) or group name(s), or the entire database. .PP .SH OPTIONS .IP \-f\ \fIfilename\fP The file name of the database to list. .IP \-w Long lines should be wrapped .IP \-i\ \fInumber\fP Set the left margin then wrapped. .IP \-l\ \fInumber\fP How long line should be to be wrapped (wrap threshold) .IP \-v Print the version number and exit. .SH SEE ALSO radiusd(8) .SH AUTHORS .TP Author: Andrei Koulik .TP Documentation: Bjørn Nordbø freeradius-server/src/modules/rlm_dbm/rlm_dbm_cat.c000066400000000000000000000062111257552170400230050ustar00rootroot00000000000000/* * rlm_dbm_cat.c : List rlm_dbm DBM file * * Version: $Id$ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2001 Koulik Andrei, Sandy Service */ #include #include #ifdef HAVE_NDBM_H #include #endif #ifdef HAVE_GDBM_NDBM_H #include #endif #ifdef HAVE_GDBMNDBM_H #include #endif #include #define LOTSTUP 20 #define WRAPLEN 40 int wraplen = WRAPLEN, needwrap = 0, lotstup = LOTSTUP; char const * progname; static void dump_record(datum key,datum data) { int i,j; char *p; for(i = 0, p = key.dptr; i < key.dsize; i++, p++) putchar(*p); if ( i < lotstup ) while( i++ <= lotstup) putchar(' '); else putchar(' '); for(j = 0, p = data.dptr ; j < data.dsize && *p ; i++, p++ ) { putchar(*p); if ( needwrap && *p == ',' && i > wraplen ) putchar('\n'); if ( *p == '\n' || ( needwrap && *p == ',' && i > wraplen ) ) { for(i = 0; i < lotstup; i++) putchar(' '); i = 0; } } putchar('\n'); } #ifdef __GNUC__ static void __attribute__((noreturn)) usage(void) #else static void usage(void) #endif { fprintf(stderr, "Usage: %s: [-f file] [-w] [-i number] [-l number] [-v]\n\n",progname); exit(1); } int main(int n, char **argv) { const char *fname = NULL; DBM *pdb; datum k,d; int ch; int i; progname = argv[0]; while ((ch = getopt(n, argv, "i:l:wf:v")) != -1) switch (ch) { case 'i': if (!isdigit((int) *optarg)) usage(); lotstup = atoi(optarg); break; case 'l': if (!isdigit((int) *optarg)) usage(); wraplen = atoi(optarg); break; case 'w': needwrap = 1; break; case 'f': fname = optarg; break; case 'v': printf("%s: $Id$\n",progname); exit(0); break; default : usage(); exit(1); break; } n -= (optind - 1); argv += (optind -1); if ( fname == NULL) fname = "sandy_db"; if ( ( pdb = dbm_open(fname, O_RDONLY, 0777) ) == NULL ) { perror("Couldn't open database"); exit(1); } if ( n > 1 ) { for ( i = 1 ; i < n ; i++ ) { printf(" Check: %s\n",argv[i]); k.dptr = argv[i]; k.dsize = strlen(argv[i]) + 1; if ( (d = dbm_fetch(pdb,k)).dptr == NULL ) { printf("Not found\n"); } else dump_record(k, d); } } else { for ( k = dbm_firstkey(pdb) ; k.dptr != NULL ; k = dbm_nextkey(pdb) ) if ( (d = dbm_fetch(pdb,k)).dptr == NULL ) { perror("Couldn't fetch user record"); exit(1); } else dump_record(k, d); } dbm_close(pdb); fflush(stdout); return 0; } freeradius-server/src/modules/rlm_dbm/rlm_dbm_parser.8000066400000000000000000000062001257552170400234550ustar00rootroot00000000000000.TH RLM_DBM_PARSER 8 .SH NAME rlm_dbm_parser - transforms simple syntax into rlm_dbm format .SH SYNOPSIS .B rlm_dbm_parser .RB [ \-c ] .RB [ \-d .IR raddb ] .RB [ \-i .IR inputfile ] .RB [ \-o .IR outputfile ] .RB [ \-x ] .RB [ \-v ] .RB [ \-q ] [\fIusername ...\fP] .SH DESCRIPTION \fBrlm_dbm_parser\fP reads a file of the syntax defined below, and writes a database file usable by rlm_dbm or edits current database. .PP .SH INPUT FORMAT \fIrlm_dbm_parser\fP reads a format similar to the one used by the files module. In incomplete RFC2234 ABNF, it looks like this: .nf entries = *entry entry = identifier TAB definition identifier = username / group-name username = +PCHAR groupname = +PCHAR definition = (check-item ",")* LF ( *( reply-item ",") / ";" ) LF check-item = AS IN FILES reply-item = AS IN FILES * need definition of username and groupname .fi As an example, these are the standard files definitions (files module). .nf DEFAULT Service-Type == Framed-User Framed-IP-Address = 255.255.255.254, Framed-MTU = 576, Service-Type = Framed-User, Fall-Through = Yes #except who call from number 555-666 DEFAULT Auth-Type := Reject,Service-Type ==Framed-User, Calling-Station-ID == "555-666" #or call number 555-667 DEFAULT Auth-Type := Reject,Service-Type ==Framed-User, Calling-Station-ID == "555-667" .fi To be a valid rlm_dbm input file, it should look like this: .nf DEFAULT Service-Type == Framed-User # (1) Framed-IP-Address = 255.255.255.254, # comma, list cont'd Framed-MTU = 576, Service-Type = Framed-User, Fall-Through = Yes # \\n, end of list Auth-Type := Reject,Service-Type ==Framed-User, # (2) Calling-Station-ID == "555-666" ; # ;, no reply items Auth-Type := Reject,Service-Type ==Framed-User, # (3) Calling-Station-ID == "555-667" ; # ditto .fi This user (the DEFAULT user) contains three entries, 1, 2 and 3. The first entry has a list of reply items, terminated by a reply item without a trailing comma. Entries 2 and 3 has empty reply lists, as indicated by the semicolon. This is necessary to separate an empty line (which is ignored) from the empty list. Definition Fall-Through = Yes used in order to say module to check next record. By default Fall-Through = Yes. .SH OPTIONS .IP \-d\ \fIraddb\fP Use \fIraddb\fP as the radiusd configuration directory. .IP \-i\ \fIinputfile\fP Use \fIfile\fP as the input file. If not defined then use standard input. .IP \-o\ \fIoutputfile\fP Use \fIfile\fP as the output file. .IP \-c Create a new database (empty output file before writing) .IP \-x Enable debug mode. Multiple x flags increase debug level. .IP \-q Do not print statistics (quiet). .IP \-v Print the version and exit. .IP \-r Remove a username or group name from the database. .SH SEE ALSO radiusd(8) .SH AUTHORS .TP Author: Andrei Koulik .TP Documentation: Bjørn Nordbø freeradius-server/src/modules/rlm_dbm/rlm_dbm_parser.c000066400000000000000000000204621257552170400235360ustar00rootroot00000000000000/* * rlm_dbm_parser.c : Create dbm file from plain text * * Version: $Id$ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2001 Koulik Andrei, Sandy Service */ char sccsid[] = "$Id$ sandy module project\n Copyright 2001 Sandy Service\nCopyright 2001 Koulik Andrei"; #include #include #ifdef HAVE_NDBM_H #include #endif #ifdef HAVE_GDBM_NDBM_H #include #endif #ifdef HAVE_GDBMNDBM_H #include #endif #include #include #include #define MAX_BUFF_SIZE 1024 #define DOUT1 if( fr_debug_flag > 0 ) printf #define DOUT2 if( fr_debug_flag > 5 ) printf typedef enum sm_parse_state_t { SMP_INVALID = 0, SMP_USER, SMP_PATTERN, SMP_ACTION, SMP_PATTERN_OR_USER } sm_parse_state_t; const char * progname; unsigned long st_errors = 0, st_warns = 0, st_lines = 0, st_users = 0, st_skiped = 0, st_loaded = 0; /* test int dumplist(VALUE_PAIR *vp) { char buffer[1024]; while (vp != NULL) { vp_prints(buffer, sizeof(buffer), vp); printf("\t%s\n", buffer); vp = vp -> next; } return 0; } */ char content[4096]; int concntr = 0; int oflags = O_RDWR | O_CREAT; DBM * pdb = NULL; static int open_storage(const char * fname) { if ( (pdb = dbm_open(fname, oflags, 0600 )) == NULL ) { perror("Couldn't open database"); return 1; } return 0; } static void close_storage(void){ dbm_close(pdb); } static int addlinetocontent(VALUE_PAIR *vp) { int outlen = sizeof(content) - concntr - 1; int lendiv; if ( outlen < 4 ) return -1; if ( vp == NULL ) { /* add empty line */ content[concntr++] = '\n'; content[concntr] = '\0'; } else { while ( vp != NULL ){ lendiv = vp_prints(&content[concntr],outlen,vp); if ( lendiv > 0 ) { outlen -= lendiv; if (outlen > 3) { strcat(content,", "); concntr += lendiv + 2; outlen -= 2; } else { concntr = 0; return -1; } } vp = vp -> next; } if ( concntr > 2 ) { /* remove trailing ',' */ content[--concntr] = '\0'; content[concntr - 1] = '\n'; } } return 0; } static int storecontent (const char * username) { datum d,k; int res; if ( pdb == NULL || concntr < 2 ) return 1; DOUT2("store:\n%s\ncontent:\n%s",username,content); d.dptr = content; d.dsize = concntr + 1; k.dptr = username; k.dsize = strlen(username) + 1; res = dbm_store(pdb, k, d, DBM_INSERT); if ( res == 1 ) dbm_store(pdb, k, d, DBM_REPLACE); if ( res < 0 ) { perror("Couldn't insert record"); st_errors++; st_skiped++; } else st_loaded++; concntr = 0; *content = '\0'; return 0; } static int getuname(char **p,char *u,int n) { int i; for(i=0 ; ( i < n-1 ) && ( **p ) && (! isspace((int) **p) ) ; (*p)++ ) u[i++] = **p; u[i] = '\0'; return ( i == 0) ? 1:0; } static int sm_parse_file(FILE*fp,const char* fname) { FR_TOKEN tok; VALUE_PAIR *vp = NULL; sm_parse_state_t parse_state = SMP_USER; unsigned long lino = 0; char *p; char buff[MAX_BUFF_SIZE]; char username[256]; while( parse_state != SMP_INVALID && fgets(buff, sizeof(buff), fp) != NULL ) { lino ++; st_lines++; if ( strchr(buff, '\n') == NULL) { fprintf(stderr,"%s: %s[%lu]:Warning: line too long or not closed by \\n character. Skiped\n",progname,fname,lino); st_warns++; st_skiped++; /* _LINE_ skiped */ continue; } DOUT2("Parseline: %s",buff); for ( p = buff; isspace((int) *p); p++); if ( *p == '#' || *p == 0 ) continue; /* userparse hack */ if ( *p == ';' ) *p = '\n'; p = buff; /* try to decide is this line new user or new pattern */ if ( parse_state == SMP_PATTERN_OR_USER ) { if ( isspace((int) buff[0]) ) parse_state = SMP_PATTERN; else { parse_state = SMP_USER; storecontent(username); st_users++; } } if ( parse_state == SMP_USER ) { tok = getuname(&p,username,sizeof(username)); /* check: is it include. not implemented */ if ( tok ) { fprintf(stderr ,"%s: %s[%lu]: error while expecting user name\n",progname,fname,lino); parse_state = SMP_INVALID; st_errors++; } else { parse_state = SMP_PATTERN; DOUT1("Found user: %s\n",username); } } if ( parse_state == SMP_PATTERN || parse_state == SMP_ACTION ) { /* check for empty line */ while( *p && isspace((int) *p) ) p++; if ( *p && ( *p != ';' ) ) tok = userparse(p,&vp); else tok = T_EOL; /* ';' - signs empty line */ switch(tok) { case T_EOL: /* add to content */ addlinetocontent(vp); pairfree(&vp); if ( parse_state == SMP_PATTERN ) parse_state = SMP_ACTION; else parse_state = SMP_PATTERN_OR_USER; case T_COMMA: break; /* parse next line */ default: /* error: we do not expect anything else */ fprintf(stderr ,"%s: %s[%lu]: syntax error\n",progname,fname,lino); fr_perror("Error"); parse_state = SMP_INVALID; st_errors++; } } } if ( feof(fp) ) switch (parse_state ) { case SMP_USER: /* file is empty, last line is comment */ break; case SMP_PATTERN: /* only username ?*/ fprintf(stderr ,"%s: %s[%lu]: EOF while pattern line are expecting\n",progname,fname,lino); st_errors++; parse_state = SMP_INVALID; break; case SMP_ACTION: /* looking for reply line */ fprintf(stderr ,"%s: %s[%lu]: EOF while reply line are expecting\n",progname,fname,lino); st_errors++; parse_state = SMP_INVALID; break; case SMP_PATTERN_OR_USER: storecontent(username); st_users++; break; default:break; } else if ( parse_state != SMP_INVALID ) { /* file read error */ fprintf(stderr ,"%s: error file reading from file\n",progname); } pairfree(&vp); return (parse_state == SMP_INVALID)?-1:0; } static void sm_usage(void) { fprintf(stderr, "Usage: %s [-c] [-d raddb] [-i inputfile] [-o outputfile] [-x] [-v] [-q] [username1 [username2] ...]\n\n",progname); fprintf(stderr, "-c create new database.\n"); fprintf(stderr, "-x debug mode.\n"); fprintf(stderr, "-q do not print statistic\n"); fprintf(stderr, "-v print version\n"); fprintf(stderr, "-r remove user(s) from database\n"); } int main(int n,char **argv) { const char *fname = NULL; const char *ofile = NULL; FILE *fp; int print_stat = 1; int ch; const char *sm_radius_dir = NULL; progname = argv[0]; fr_debug_flag = 0; while ((ch = getopt(n, argv, "d:i:xo:qvc")) != -1) switch (ch) { case 'd': sm_radius_dir = optarg; break; case 'i': fname = optarg; break; case 'x': fr_debug_flag++; break; case 'o': ofile = optarg; break; case 'q': print_stat = 0; break; case 'v': printf("%s: $Id$ \n",progname); exit(0); case 'c': oflags = O_CREAT | O_TRUNC | O_RDWR; break; default: sm_usage();exit(1); } if ( sm_radius_dir == NULL ) sm_radius_dir = RADDBDIR; DOUT1("Use dictionary in: %s\n",sm_radius_dir); if (dict_init(sm_radius_dir, RADIUS_DICTIONARY) < 0 ) { fr_perror("parser: init dictionary:"); exit(1); } if ( fname == NULL || fname[0] == '-') { fp = stdin; fname = "STDIN"; } else if ( ( fp = fopen(fname, "r") ) == NULL ) { fprintf( stderr,"%s: Couldn't open source file\n", progname); exit(1); } if ( ofile == NULL ) ofile = "sandy_db" ; if ( open_storage(ofile) ) { exit (1); } sm_parse_file(fp,fname); close_storage(); if ( print_stat ) fprintf(stderr,"\nRecord loaded: %lu\nLines parsed: %lu\nRecord skiped: %lu\nWarnings: %lu\nErrors: %lu\n" ,st_loaded,st_lines,st_skiped,st_warns,st_errors); return 0; } freeradius-server/src/modules/rlm_detail/000077500000000000000000000000001257552170400210765ustar00rootroot00000000000000freeradius-server/src/modules/rlm_detail/Makefile000066400000000000000000000000761257552170400225410ustar00rootroot00000000000000TARGET = rlm_detail SRCS = rlm_detail.c include ../rules.mak freeradius-server/src/modules/rlm_detail/rlm_detail.c000066400000000000000000000406561257552170400233710ustar00rootroot00000000000000/* * rlm_detail.c accounting: Write the "detail" files. * * Version: $Id$ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2000,2006 The FreeRADIUS server project */ #include RCSID("$Id$") #include #include #include #include #include #include #include #ifdef HAVE_FNMATCH_H #include #endif #ifdef HAVE_UNISTD_H #include #endif #ifdef HAVE_GRP_H #include #endif #define DIRLEN 8192 struct detail_instance { /* detail file */ char *detailfile; /* detail file permissions */ int detailperm; /* detail file group */ char *group; /* directory permissions */ int dirperm; /* timestamp & stuff */ char *header; /* if we want file locking */ int locking; int escape; //!< do filename escaping, yes / no RADIUS_ESCAPE_STRING escape_func; //!< escape function /* log src/dst information */ int log_srcdst; fr_hash_table_t *ht; }; static const CONF_PARSER module_config[] = { { "detailfile", PW_TYPE_STRING_PTR, offsetof(struct detail_instance,detailfile), NULL, "%A/%{Client-IP-Address}/detail" }, { "header", PW_TYPE_STRING_PTR, offsetof(struct detail_instance,header), NULL, "%t" }, { "detailperm", PW_TYPE_INTEGER, offsetof(struct detail_instance,detailperm), NULL, "0600" }, { "group", PW_TYPE_STRING_PTR, offsetof(struct detail_instance,group), NULL, NULL}, { "dirperm", PW_TYPE_INTEGER, offsetof(struct detail_instance,dirperm), NULL, "0755" }, { "locking", PW_TYPE_BOOLEAN, offsetof(struct detail_instance,locking), NULL, "no" }, { "log_packet_header", PW_TYPE_BOOLEAN, offsetof(struct detail_instance,log_srcdst), NULL, "no" }, { "escape_filenames", PW_TYPE_BOOLEAN, offsetof(struct detail_instance,escape), NULL, "no" }, { NULL, -1, 0, NULL, NULL } }; /* * Clean up. */ static int detail_detach(void *instance) { struct detail_instance *inst = instance; if (inst->ht) fr_hash_table_free(inst->ht); free(inst); return 0; } static uint32_t detail_hash(const void *data) { const DICT_ATTR *da = data; return fr_hash(&(da->attr), sizeof(da->attr)); } static int detail_cmp(const void *a, const void *b) { return ((const DICT_ATTR *)a)->attr - ((const DICT_ATTR *)b)->attr; } /* * Ensure that the filename doesn't walk back up the tree. */ static size_t fix_directories(char *out, size_t outlen, char const *in) { char const *q = in; char *p = out; size_t left = outlen; while (*q) { if (*q != '/') { if (left < 2) break; /* * Smash control characters and spaces to * something simpler. */ if (*q < ' ') { *(p++) = '_'; continue; } *(p++) = *(q++); left--; continue; } /* * For now, allow slashes in the expanded * filename. This allows the admin to set * attributes which create sub-directories. * Unfortunately, it also allows users to send * attributes which *may* end up creating * sub-directories. */ if (left < 2) break; *(p++) = *(q++); /* * Get rid of ////../.././///.///..// */ redo: /* * Get rid of //// */ if (*q == '/') { q++; goto redo; } /* * Get rid of /./././ */ if ((q[0] == '.') && (q[1] == '/')) { q += 2; goto redo; } /* * Get rid of /../../../ */ if ((q[0] == '.') && (q[1] == '.') && (q[2] == '/')) { q += 3; goto redo; } } *p = '\0'; return (p - out); } /* * (Re-)read radiusd.conf into memory. */ static int detail_instantiate(CONF_SECTION *conf, void **instance) { struct detail_instance *inst; CONF_SECTION *cs; inst = rad_malloc(sizeof(*inst)); if (!inst) { return -1; } memset(inst, 0, sizeof(*inst)); if (cf_section_parse(conf, inst, module_config) < 0) { detail_detach(inst); return -1; } /* * Escape filenames only if asked. */ if (inst->escape) { inst->escape_func = rad_filename_escape; } else { inst->escape_func = fix_directories; } /* * Suppress certain attributes. */ cs = cf_section_sub_find(conf, "suppress"); if (cs) { CONF_ITEM *ci; inst->ht = fr_hash_table_create(detail_hash, detail_cmp, NULL); for (ci = cf_item_find_next(cs, NULL); ci != NULL; ci = cf_item_find_next(cs, ci)) { const char *attr; DICT_ATTR *da; if (!cf_item_is_pair(ci)) continue; attr = cf_pair_attr(cf_itemtopair(ci)); if (!attr) continue; /* pair-anoia */ da = dict_attrbyname(attr); if (!da) { radlog(L_INFO, "rlm_detail: WARNING: No such attribute %s: Cannot suppress printing it.", attr); continue; } /* * For better distribution we should really * hash the attribute number or name. But * since the suppression list will usually * be small, it doesn't matter. */ if (!fr_hash_table_insert(inst->ht, da)) { radlog(L_ERR, "rlm_detail: Failed trying to remember %s", attr); detail_detach(inst); return -1; } } } *instance = inst; return 0; } /* * Do detail, compatible with old accounting */ static int do_detail(void *instance, REQUEST *request, RADIUS_PACKET *packet, int compat) { int outfd; char timestamp[256]; char buffer[DIRLEN]; char *p; struct stat st; int locked; int lock_count; struct timeval tv; VALUE_PAIR *pair; off_t fsize; FILE *fp; #ifdef HAVE_GRP_H gid_t gid; struct group *grp; char *endptr; #endif struct detail_instance *inst = instance; rad_assert(request != NULL); /* * Nothing to log: don't do anything. */ if (!packet) { return RLM_MODULE_NOOP; } /* * Create a directory for this nas. * * Generate the path for the detail file. Use the * same format, but truncate at the last /. Then * feed it through radius_xlat() to expand the * variables. */ if (radius_xlat(buffer, sizeof(buffer), inst->detailfile, request, inst->escape_func) == 0) { radlog_request(L_ERR, 0, request, "rlm_detail: Failed to expand detail file %s", inst->detailfile); return RLM_MODULE_FAIL; } RDEBUG2("%s expands to %s", inst->detailfile, buffer); #ifdef HAVE_FNMATCH_H #ifdef FNM_FILE_NAME /* * If we read it from a detail file, and we're about to * write it back to the SAME detail file directory, then * suppress the write. This check prevents an infinite * loop. */ if ((request->listener->type == RAD_LISTEN_DETAIL) && (fnmatch(((listen_detail_t *)request->listener->data)->filename, buffer, FNM_FILE_NAME | FNM_PERIOD ) == 0)) { RDEBUG2("WARNING: Suppressing infinite loop."); return RLM_MODULE_NOOP; } #endif #endif /* * Grab the last directory delimiter. */ p = strrchr(buffer,'/'); /* * There WAS a directory delimiter there, and the file * doesn't exist, so we must create it the directories.. */ if (p) { *p = '\0'; /* * Always try to create the directory. If it * exists, rad_mkdir() will check via stat(), and * return immediately. * * This catches the case where some idiot deleted * a directory that the server was using. */ if (rad_mkdir(buffer, inst->dirperm) < 0) { radlog_request(L_ERR, 0, request, "rlm_detail: Failed to create directory %s: %s", buffer, strerror(errno)); return RLM_MODULE_FAIL; } *p = '/'; } /* else there was no directory delimiter. */ locked = 0; lock_count = 0; do { /* * Open & create the file, with the given * permissions. */ if ((outfd = open(buffer, O_WRONLY | O_APPEND | O_CREAT, inst->detailperm)) < 0) { radlog_request(L_ERR, 0, request, "rlm_detail: Couldn't open file %s: %s", buffer, strerror(errno)); return RLM_MODULE_FAIL; } /* * If we fail to aquire the filelock in 80 tries * (approximately two seconds) we bail out. */ if (inst->locking) { lseek(outfd, 0L, SEEK_SET); if (rad_lockfd_nonblock(outfd, 0) < 0) { close(outfd); tv.tv_sec = 0; tv.tv_usec = 25000; select(0, NULL, NULL, NULL, &tv); lock_count++; continue; } /* * The file might have been deleted by * radrelay while we tried to acquire * the lock (race condition) */ if (fstat(outfd, &st) != 0) { radlog_request(L_ERR, 0, request, "rlm_detail: Couldn't stat file %s: %s", buffer, strerror(errno)); close(outfd); return RLM_MODULE_FAIL; } if (st.st_nlink == 0) { RDEBUG2("File %s removed by another program, retrying", buffer); close(outfd); lock_count = 0; continue; } RDEBUG2("Acquired filelock, tried %d time(s)", lock_count + 1); locked = 1; } } while (inst->locking && !locked && lock_count < 80); if (inst->locking && !locked) { close(outfd); radlog_request(L_ERR, 0, request, "rlm_detail: Failed to acquire filelock for %s, giving up", buffer); return RLM_MODULE_FAIL; } #ifdef HAVE_GRP_H if (inst->group != NULL) { gid = strtol(inst->group, &endptr, 10); if (*endptr != '\0') { grp = getgrnam(inst->group); if (grp == NULL) { RDEBUG2("rlm_detail: Unable to find system group \"%s\"", inst->group); goto skip_group; } gid = grp->gr_gid; } if (chown(buffer, -1, gid) == -1) { RDEBUG2("rlm_detail: Unable to change system group of \"%s\"", buffer); } } skip_group: #endif /* * Post a timestamp */ fsize = lseek(outfd, 0L, SEEK_END); if (fsize < 0) { radlog_request(L_ERR, 0, request, "rlm_detail: Failed to seek to the end of detail file %s", buffer); close(outfd); return RLM_MODULE_FAIL; } if (radius_xlat(timestamp, sizeof(timestamp), inst->header, request, NULL) == 0) { radlog_request(L_ERR, 0, request, "rlm_detail: Unable to expand detail header format %s", inst->header); close(outfd); return RLM_MODULE_FAIL; } /* * Open the FP for buffering. */ if ((fp = fdopen(outfd, "a")) == NULL) { radlog_request(L_ERR, 0, request, "rlm_detail: Couldn't open file %s: %s", buffer, strerror(errno)); close(outfd); return RLM_MODULE_FAIL; } fprintf(fp, "%s\n", timestamp); /* * Write the information to the file. */ if (!compat) { /* * Print out names, if they're OK. * Numbers, if not. */ if ((packet->code > 0) && (packet->code < FR_MAX_PACKET_CODE)) { fprintf(fp, "\tPacket-Type = %s\n", fr_packet_codes[packet->code]); } else { fprintf(fp, "\tPacket-Type = %d\n", packet->code); } } if (inst->log_srcdst) { VALUE_PAIR src_vp, dst_vp; memset(&src_vp, 0, sizeof(src_vp)); memset(&dst_vp, 0, sizeof(dst_vp)); src_vp.operator = dst_vp.operator = T_OP_EQ; switch (packet->src_ipaddr.af) { case AF_INET: src_vp.name = "Packet-Src-IP-Address"; src_vp.type = PW_TYPE_IPADDR; src_vp.attribute = PW_PACKET_SRC_IP_ADDRESS; src_vp.vp_ipaddr = packet->src_ipaddr.ipaddr.ip4addr.s_addr; dst_vp.name = "Packet-Dst-IP-Address"; dst_vp.type = PW_TYPE_IPADDR; dst_vp.attribute = PW_PACKET_DST_IP_ADDRESS; dst_vp.vp_ipaddr = packet->dst_ipaddr.ipaddr.ip4addr.s_addr; break; case AF_INET6: src_vp.name = "Packet-Src-IPv6-Address"; src_vp.type = PW_TYPE_IPV6ADDR; src_vp.attribute = PW_PACKET_SRC_IPV6_ADDRESS; memcpy(src_vp.vp_strvalue, &packet->src_ipaddr.ipaddr.ip6addr, sizeof(packet->src_ipaddr.ipaddr.ip6addr)); dst_vp.name = "Packet-Dst-IPv6-Address"; dst_vp.type = PW_TYPE_IPV6ADDR; dst_vp.attribute = PW_PACKET_DST_IPV6_ADDRESS; memcpy(dst_vp.vp_strvalue, &packet->dst_ipaddr.ipaddr.ip6addr, sizeof(packet->dst_ipaddr.ipaddr.ip6addr)); break; default: break; } vp_print(fp, &src_vp); vp_print(fp, &dst_vp); src_vp.name = "Packet-Src-IP-Port"; src_vp.attribute = PW_PACKET_SRC_PORT; src_vp.type = PW_TYPE_INTEGER; src_vp.vp_integer = packet->src_port; dst_vp.name = "Packet-Dst-IP-Port"; dst_vp.attribute = PW_PACKET_DST_PORT; dst_vp.type = PW_TYPE_INTEGER; dst_vp.vp_integer = packet->dst_port; vp_print(fp, &src_vp); vp_print(fp, &dst_vp); } /* Write each attribute/value to the log file */ for (pair = packet->vps; pair != NULL; pair = pair->next) { DICT_ATTR da; da.attr = pair->attribute; if (inst->ht && fr_hash_table_finddata(inst->ht, &da)) continue; /* * Don't print passwords in old format... */ if (compat && (pair->attribute == PW_USER_PASSWORD)) continue; /* * Print all of the attributes. */ vp_print(fp, pair); } /* * Add non-protocol attibutes. */ if (compat) { if (request->proxy) { char proxy_buffer[128]; inet_ntop(request->proxy->dst_ipaddr.af, &request->proxy->dst_ipaddr.ipaddr, proxy_buffer, sizeof(proxy_buffer)); fprintf(fp, "\tFreeradius-Proxied-To = %s\n", proxy_buffer); RDEBUG("Freeradius-Proxied-To = %s", proxy_buffer); } fprintf(fp, "\tTimestamp = %ld\n", (unsigned long) request->timestamp); } fprintf(fp, "\n"); /* * If we can't flush it to disk, truncate the file and * return an error. */ if (fflush(fp) != 0) { ftruncate(outfd, fsize); /* ignore errors! */ fclose(fp); return RLM_MODULE_FAIL; } fclose(fp); /* * And everything is fine. */ return RLM_MODULE_OK; } /* * Accounting - write the detail files. */ static int detail_accounting(void *instance, REQUEST *request) { if (request->listener->type == RAD_LISTEN_DETAIL && strcmp(((struct detail_instance *)instance)->detailfile, ((listen_detail_t *)request->listener->data)->filename) == 0) { RDEBUG("Suppressing writes to detail file as the request was just read from a detail file."); return RLM_MODULE_NOOP; } return do_detail(instance,request,request->packet, TRUE); } /* * Incoming Access Request - write the detail files. */ static int detail_authorize(void *instance, REQUEST *request) { return do_detail(instance,request,request->packet, FALSE); } /* * Outgoing Access-Request Reply - write the detail files. */ static int detail_postauth(void *instance, REQUEST *request) { return do_detail(instance,request,request->reply, FALSE); } #ifdef WITH_COA /* * Incoming CoA - write the detail files. */ static int detail_recv_coa(void *instance, REQUEST *request) { return do_detail(instance,request,request->packet, FALSE); } /* * Outgoing CoA - write the detail files. */ static int detail_send_coa(void *instance, REQUEST *request) { return do_detail(instance,request,request->reply, FALSE); } #endif /* * Outgoing Access-Request to home server - write the detail files. */ static int detail_pre_proxy(void *instance, REQUEST *request) { if (request->proxy && request->proxy->vps) { return do_detail(instance,request,request->proxy, FALSE); } return RLM_MODULE_NOOP; } /* * Outgoing Access-Request Reply - write the detail files. */ static int detail_post_proxy(void *instance, REQUEST *request) { if (request->proxy_reply && request->proxy_reply->vps) { return do_detail(instance,request,request->proxy_reply, FALSE); } /* * No reply: we must be doing Post-Proxy-Type = Fail. * * Note that we just call the normal accounting function, * to minimize the amount of code, and to highlight that * it's doing normal accounting. */ if (!request->proxy_reply) { int rcode; rcode = detail_accounting(instance, request); if (rcode == RLM_MODULE_OK) { request->reply->code = PW_ACCOUNTING_RESPONSE; } return rcode; } return RLM_MODULE_NOOP; } /* globally exported name */ module_t rlm_detail = { RLM_MODULE_INIT, "detail", RLM_TYPE_THREAD_UNSAFE | RLM_TYPE_CHECK_CONFIG_SAFE | RLM_TYPE_HUP_SAFE, detail_instantiate, /* instantiation */ detail_detach, /* detach */ { NULL, /* authentication */ detail_authorize, /* authorization */ NULL, /* preaccounting */ detail_accounting, /* accounting */ NULL, /* checksimul */ detail_pre_proxy, /* pre-proxy */ detail_post_proxy, /* post-proxy */ detail_postauth /* post-auth */ #ifdef WITH_COA , detail_recv_coa, detail_send_coa #endif }, }; freeradius-server/src/modules/rlm_digest/000077500000000000000000000000001257552170400211135ustar00rootroot00000000000000freeradius-server/src/modules/rlm_digest/Makefile000066400000000000000000000001421257552170400225500ustar00rootroot00000000000000# # Makefile # # Version: $Id$ # TARGET = rlm_digest SRCS = rlm_digest.c include ../rules.mak freeradius-server/src/modules/rlm_digest/rlm_digest.c000066400000000000000000000360651257552170400234220ustar00rootroot00000000000000/* * rlm_chap.c * * Version: $Id$ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2002,2006 The FreeRADIUS server project * Copyright 2002 Alan DeKok */ #include RCSID("$Id$") #include #include static int digest_fix(REQUEST *request) { VALUE_PAIR *vp; /* * We need both of these attributes to do the authentication. */ vp = pairfind(request->packet->vps, PW_DIGEST_RESPONSE); if (vp == NULL) { return RLM_MODULE_NOOP; } /* * Check the sanity of the attribute. */ if (vp->length != 32) { return RLM_MODULE_NOOP; } /* * We need these, too. */ vp = pairfind(request->packet->vps, PW_DIGEST_ATTRIBUTES); if (vp == NULL) { return RLM_MODULE_NOOP; } /* * Check for proper format of the Digest-Attributes */ RDEBUG("Checking for correctly formatted Digest-Attributes"); while (vp) { int length = vp->length; int attrlen; uint8_t *p = &vp->vp_octets[0]; /* * Until this stupidly encoded attribute is exhausted. */ while (length > 0) { /* * The attribute type must be valid */ if ((p[0] == 0) || (p[0] > 10)) { RDEBUG("Not formatted as Digest-Attributes"); return RLM_MODULE_NOOP; } attrlen = p[1]; /* stupid VSA format */ /* * Too short. */ if (attrlen < 3) { RDEBUG("Not formatted as Digest-Attributes"); return RLM_MODULE_NOOP; } /* * Too long. */ if (attrlen > length) { RDEBUG("Not formatted as Digest-Attributes"); return RLM_MODULE_NOOP; } length -= attrlen; p += attrlen; } /* loop over this one attribute */ /* * Find the next one, if it exists. */ vp = pairfind(vp->next, PW_DIGEST_ATTRIBUTES); } /* * Convert them to something sane. */ RDEBUG("Digest-Attributes look OK. Converting them to something more usful."); vp = pairfind(request->packet->vps, PW_DIGEST_ATTRIBUTES); while (vp) { int length = vp->length; int attrlen; uint8_t *p = &vp->vp_octets[0]; VALUE_PAIR *sub; /* * Until this stupidly encoded attribute is exhausted. */ while (length > 0) { /* * The attribute type must be valid */ if ((p[0] == 0) || (p[0] > 10)) { RDEBUG("ERROR: Received Digest-Attributes with invalid sub-attribute %d", p[0]); return RLM_MODULE_INVALID; } attrlen = p[1]; /* stupid VSA format */ /* * Too short. */ if (attrlen < 3) { RDEBUG("ERROR: Received Digest-Attributes with short sub-attribute %d, of length %d", p[0], attrlen); return RLM_MODULE_INVALID; } /* * Too long. */ if (attrlen > length) { RDEBUG("ERROR: Received Digest-Attributes with long sub-attribute %d, of length %d", p[0], attrlen); return RLM_MODULE_INVALID; } /* * Create a new attribute, broken out of * the stupid sub-attribute crap. * * Didn't they know that VSA's exist? */ sub = radius_paircreate(request, &request->packet->vps, PW_DIGEST_REALM - 1 + p[0], PW_TYPE_STRING); memcpy(&sub->vp_octets[0], &p[2], attrlen - 2); sub->vp_octets[attrlen - 2] = '\0'; sub->length = attrlen - 2; if ((debug_flag > 1) && fr_log_fp) { vp_print(fr_log_fp, sub); } /* * FIXME: Check for the existence * of the necessary attributes! */ length -= attrlen; p += attrlen; } /* loop over this one attribute */ /* * Find the next one, if it exists. */ vp = pairfind(vp->next, PW_DIGEST_ATTRIBUTES); } return RLM_MODULE_OK; } static int digest_authorize(void *instance, REQUEST *request) { int rcode; /* quiet the compiler */ instance = instance; /* * Double-check and fix the attributes. */ rcode = digest_fix(request); if (rcode != RLM_MODULE_OK) return rcode; if (pairfind(request->config_items, PW_AUTHTYPE)) { RDEBUG2("WARNING: Auth-Type already set. Not setting to DIGEST"); return RLM_MODULE_NOOP; } /* * Everything's OK, add a digest authentication type. */ RDEBUG("Adding Auth-Type = DIGEST"); pairadd(&request->config_items, pairmake("Auth-Type", "DIGEST", T_OP_EQ)); return RLM_MODULE_OK; } /* * Perform all of the wondrous variants of digest authentication. */ static int digest_authenticate(void *instance, REQUEST *request) { int i; size_t a1_len, a2_len, kd_len; uint8_t a1[(MAX_STRING_LEN + 1) * 5]; /* can be 5 attributes */ uint8_t a2[(MAX_STRING_LEN + 1) * 3]; /* can be 3 attributes */ uint8_t kd[(MAX_STRING_LEN + 1) * 5]; uint8_t hash[16]; /* MD5 output */ VALUE_PAIR *vp, *passwd, *algo; VALUE_PAIR *qop, *nonce; instance = instance; /* -Wunused */ /* * We require access to the plain-text password, or to the * Digest-HA1 parameter. */ passwd = pairfind(request->config_items, PW_DIGEST_HA1); if (passwd) { if (passwd->length != 32) { radlog_request(L_AUTH, 0, request, "Digest-HA1 has invalid length, authentication failed."); return RLM_MODULE_INVALID; } } else { passwd = pairfind(request->config_items, PW_CLEARTEXT_PASSWORD); } if (!passwd) { radlog_request(L_AUTH, 0, request, "Cleartext-Password or Digest-HA1 is required for authentication."); return RLM_MODULE_INVALID; } /* * We need these, too. */ vp = pairfind(request->packet->vps, PW_DIGEST_ATTRIBUTES); if (vp == NULL) { error: RDEBUG("ERROR: You set 'Auth-Type = Digest' for a request that does not contain any digest attributes!"); return RLM_MODULE_INVALID; } /* * Look for the "internal" FreeRADIUS Digest attributes. * If they don't exist, it means that someone forced * Auth-Type = digest, without putting "digest" into the * "authorize" section. In that case, try to decode the * attributes here. */ if (!pairfind(request->packet->vps, PW_DIGEST_NONCE)) { int rcode; rcode = digest_fix(request); /* * NOOP means "couldn't find the attributes". * That's bad. */ if (rcode == RLM_MODULE_NOOP) goto error; if (rcode != RLM_MODULE_OK) return rcode; } /* * We require access to the Digest-Nonce-Value */ nonce = pairfind(request->packet->vps, PW_DIGEST_NONCE); if (!nonce) { RDEBUG("ERROR: No Digest-Nonce: Cannot perform Digest authentication"); return RLM_MODULE_INVALID; } /* * A1 = Digest-User-Name ":" Realm ":" Password */ vp = pairfind(request->packet->vps, PW_DIGEST_USER_NAME); if (!vp) { RDEBUG("ERROR: No Digest-User-Name: Cannot perform Digest authentication"); return RLM_MODULE_INVALID; } memcpy(&a1[0], &vp->vp_octets[0], vp->length); a1_len = vp->length; a1[a1_len] = ':'; a1_len++; vp = pairfind(request->packet->vps, PW_DIGEST_REALM); if (!vp) { RDEBUG("ERROR: No Digest-Realm: Cannot perform Digest authentication"); return RLM_MODULE_INVALID; } memcpy(&a1[a1_len], &vp->vp_octets[0], vp->length); a1_len += vp->length; a1[a1_len] = ':'; a1_len++; if (passwd->attribute == PW_CLEARTEXT_PASSWORD) { memcpy(&a1[a1_len], &passwd->vp_octets[0], passwd->length); a1_len += passwd->length; a1[a1_len] = '\0'; RDEBUG2("A1 = %s", a1); } else { a1[a1_len] = '\0'; RDEBUG2("A1 = %s (using Digest-HA1)", a1); a1_len = 16; } /* * See which variant we calculate. * Assume MD5 if no Digest-Algorithm attribute received */ algo = pairfind(request->packet->vps, PW_DIGEST_ALGORITHM); if ((algo == NULL) || (strcasecmp(algo->vp_strvalue, "MD5") == 0)) { /* * Set A1 to Digest-HA1 if no User-Password found */ if (passwd->attribute == PW_DIGEST_HA1) { if (fr_hex2bin(passwd->vp_strvalue, &a1[0], 16) != 16) { RDEBUG2("Invalid text in Digest-HA1"); return RLM_MODULE_INVALID; } } } else if (strcasecmp(algo->vp_strvalue, "MD5-sess") == 0) { /* * K1 = H(A1) : Digest-Nonce ... : H(A2) * * If we find Digest-HA1, we assume it contains * H(A1). */ if (passwd->attribute == PW_CLEARTEXT_PASSWORD) { fr_md5_calc(hash, &a1[0], a1_len); fr_bin2hex(hash, (char *) &a1[0], 16); } else { /* MUST be Digest-HA1 */ memcpy(&a1[0], passwd->vp_strvalue, 32); } a1_len = 32; a1[a1_len] = ':'; a1_len++; /* * Tack on the Digest-Nonce. Length must be even */ if ((nonce->length & 1) != 0) { RDEBUG("ERROR: Received Digest-Nonce hex string with invalid length: Cannot perform Digest authentication"); return RLM_MODULE_INVALID; } memcpy(&a1[a1_len], &nonce->vp_octets[0], nonce->length); a1_len += nonce->length; a1[a1_len] = ':'; a1_len++; vp = pairfind(request->packet->vps, PW_DIGEST_CNONCE); if (!vp) { RDEBUG("ERROR: No Digest-CNonce: Cannot perform Digest authentication"); return RLM_MODULE_INVALID; } /* * Digest-CNonce length must be even */ if ((vp->length & 1) != 0) { RDEBUG("ERROR: Received Digest-CNonce hex string with invalid length: Cannot perform Digest authentication"); return RLM_MODULE_INVALID; } memcpy(&a1[a1_len], &vp->vp_octets[0], vp->length); a1_len += vp->length; } else if ((algo != NULL) && (strcasecmp(algo->vp_strvalue, "MD5") != 0)) { /* * We check for "MD5-sess" and "MD5". * Anything else is an error. */ RDEBUG("ERROR: Unknown Digest-Algorithm \"%s\": Cannot perform Digest authentication", vp->vp_strvalue); return RLM_MODULE_INVALID; } /* * A2 = Digest-Method ":" Digest-URI */ vp = pairfind(request->packet->vps, PW_DIGEST_METHOD); if (!vp) { RDEBUG("ERROR: No Digest-Method: Cannot perform Digest authentication"); return RLM_MODULE_INVALID; } memcpy(&a2[0], &vp->vp_octets[0], vp->length); a2_len = vp->length; a2[a2_len] = ':'; a2_len++; vp = pairfind(request->packet->vps, PW_DIGEST_URI); if (!vp) { RDEBUG("ERROR: No Digest-URI: Cannot perform Digest authentication"); return RLM_MODULE_INVALID; } memcpy(&a2[a2_len], &vp->vp_octets[0], vp->length); a2_len += vp->length; /* * QOP is "auth-int", tack on ": Digest-Body-Digest" */ qop = pairfind(request->packet->vps, PW_DIGEST_QOP); if ((qop != NULL) && (strcasecmp(qop->vp_strvalue, "auth-int") == 0)) { VALUE_PAIR *body; /* * Add in Digest-Body-Digest */ a2[a2_len] = ':'; a2_len++; /* * Must be a hex representation of an MD5 digest. */ body = pairfind(request->packet->vps, PW_DIGEST_BODY_DIGEST); if (!body) { RDEBUG("ERROR: No Digest-Body-Digest: Cannot perform Digest authentication"); return RLM_MODULE_INVALID; } if ((a2_len + body->length) > sizeof(a2)) { RDEBUG("ERROR: Digest-Body-Digest is too long"); return RLM_MODULE_INVALID; } memcpy(a2 + a2_len, body->vp_octets, body->length); a2_len += body->length; } else if ((qop != NULL) && (strcasecmp(qop->vp_strvalue, "auth") != 0)) { RDEBUG("ERROR: Unknown Digest-QOP \"%s\": Cannot perform Digest authentication", qop->vp_strvalue); return RLM_MODULE_INVALID; } a2[a2_len] = '\0'; RDEBUG2("A2 = %s", a2); /* * KD = H(A1) : Digest-Nonce ... : H(A2). * Compute MD5 if Digest-Algorithm == "MD5-Sess", * or if we found a User-Password. */ if (((algo != NULL) && (strcasecmp(algo->vp_strvalue, "MD5-Sess") == 0)) || (passwd->attribute == PW_CLEARTEXT_PASSWORD)) { a1[a1_len] = '\0'; fr_md5_calc(&hash[0], &a1[0], a1_len); } else { memcpy(&hash[0], &a1[0], a1_len); } fr_bin2hex(hash, (char *) kd, sizeof(hash)); #ifndef NRDEBUG if (debug_flag > 1) { fr_printf_log("H(A1) = "); for (i = 0; i < 16; i++) { fr_printf_log("%02x", hash[i]); } fr_printf_log("\n"); } #endif kd_len = 32; kd[kd_len] = ':'; kd_len++; memcpy(&kd[kd_len], nonce->vp_octets, nonce->length); kd_len += nonce->length; /* * No QOP defined. Do RFC 2069 compatibility. */ if (!qop) { /* * Do nothing here. */ } else { /* Digest-QOP MUST be "auth" or "auth-int" */ /* * Tack on ":" Digest-Nonce-Count ":" Digest-CNonce * ":" Digest-QOP */ kd[kd_len] = ':'; kd_len++; vp = pairfind(request->packet->vps, PW_DIGEST_NONCE_COUNT); if (!vp) { RDEBUG("ERROR: No Digest-Nonce-Count: Cannot perform Digest authentication"); return RLM_MODULE_INVALID; } memcpy(&kd[kd_len], &vp->vp_octets[0], vp->length); kd_len += vp->length; kd[kd_len] = ':'; kd_len++; vp = pairfind(request->packet->vps, PW_DIGEST_CNONCE); if (!vp) { RDEBUG("ERROR: No Digest-CNonce: Cannot perform Digest authentication"); return RLM_MODULE_INVALID; } memcpy(&kd[kd_len], &vp->vp_octets[0], vp->length); kd_len += vp->length; kd[kd_len] = ':'; kd_len++; memcpy(&kd[kd_len], &qop->vp_octets[0], qop->length); kd_len += qop->length; } /* * Tack on ":" H(A2) */ kd[kd_len] = ':'; kd_len++; fr_md5_calc(&hash[0], &a2[0], a2_len); fr_bin2hex(hash, (char *) kd + kd_len, sizeof(hash)); #ifndef NRDEBUG if (debug_flag > 1) { fr_printf_log("H(A2) = "); for (i = 0; i < 16; i++) { fr_printf_log("%02x", hash[i]); } fr_printf_log("\n"); } #endif kd_len += 32; kd[kd_len] = 0; RDEBUG2("KD = %s\n", &kd[0]); /* * Take the hash of KD. */ fr_md5_calc(&hash[0], &kd[0], kd_len); memcpy(&kd[0], &hash[0], 16); /* * Get the binary value of Digest-Response */ vp = pairfind(request->packet->vps, PW_DIGEST_RESPONSE); if (!vp) { RDEBUG("ERROR: No Digest-Response attribute in the request. Cannot perform digest authentication"); return RLM_MODULE_INVALID; } if (fr_hex2bin(&vp->vp_strvalue[0], &hash[0], vp->length >> 1) != (vp->length >> 1)) { RDEBUG2("Invalid text in Digest-Response"); return RLM_MODULE_INVALID; } #ifndef NRDEBUG if (debug_flag > 1) { fr_printf_log("EXPECTED "); for (i = 0; i < 16; i++) { fr_printf_log("%02x", kd[i]); } fr_printf_log("\n"); fr_printf_log("RECEIVED "); for (i = 0; i < 16; i++) { fr_printf_log("%02x", hash[i]); } fr_printf_log("\n"); } #endif /* * And finally, compare the digest in the packet with KD. */ if (memcmp(&kd[0], &hash[0], 16) == 0) { return RLM_MODULE_OK; } RDEBUG("FAILED authentication"); return RLM_MODULE_REJECT; } /* * The module name should be the only globally exported symbol. * That is, everything else should be 'static'. * * If the module needs to temporarily modify it's instantiation * data, the type should be changed to RLM_TYPE_THREAD_UNSAFE. * The server will then take care of ensuring that the module * is single-threaded. */ module_t rlm_digest = { RLM_MODULE_INIT, "digest", RLM_TYPE_CHECK_CONFIG_SAFE, /* type */ NULL, /* instantiation */ NULL, /* detach */ { digest_authenticate, /* authentication */ digest_authorize, /* authorization */ NULL, /* preaccounting */ NULL, /* accounting */ NULL, /* checksimul */ NULL, /* pre-proxy */ NULL, /* post-proxy */ NULL /* post-auth */ }, }; freeradius-server/src/modules/rlm_dynamic_clients/000077500000000000000000000000001257552170400230015ustar00rootroot00000000000000freeradius-server/src/modules/rlm_dynamic_clients/Makefile000066400000000000000000000002601257552170400244370ustar00rootroot00000000000000TARGET = rlm_dynamic_clients SRCS = rlm_dynamic_clients.c HEADERS = RLM_CFLAGS = RLM_LIBS = include ../rules.mak $(STATIC_OBJS): $(HEADERS) $(DYNAMIC_OBJS): $(HEADERS) freeradius-server/src/modules/rlm_dynamic_clients/rlm_dynamic_clients.c000066400000000000000000000061601257552170400271670ustar00rootroot00000000000000/* * rlm_dynamic_clients.c * * Version: $Id$ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2008 The FreeRADIUS server project * Copyright 2008 Alan DeKok */ #include RCSID("$Id$") #include #include /* * Find the client definition. */ static int dynamic_client_authorize(UNUSED void *instance, REQUEST *request) { size_t length; const char *value; CONF_PAIR *cp; RADCLIENT *c; char buffer[2048]; /* * Ensure we're only being called from the main thread, * with fake packets. */ if ((request->packet->src_port != 0) || (request->packet->vps != NULL) || (request->parent != NULL)) { RDEBUG("Improper configuration"); return RLM_MODULE_NOOP; } if (!request->client || !request->client->cs) { RDEBUG("Unknown client definition"); return RLM_MODULE_NOOP; } cp = cf_pair_find(request->client->cs, "directory"); if (!cp) { RDEBUG("No directory configuration in the client"); return RLM_MODULE_NOOP; } value = cf_pair_value(cp); if (!value) { RDEBUG("No value given for the directory entry in the client."); return RLM_MODULE_NOOP; } length = strlen(value); if (length > (sizeof(buffer) - 256)) { RDEBUG("Directory name too long"); return RLM_MODULE_NOOP; } memcpy(buffer, value, length + 1); ip_ntoh(&request->packet->src_ipaddr, buffer + length, sizeof(buffer) - length - 1); /* * Read the buffer and generate the client. */ c = client_read(buffer, (request->client->server != NULL), TRUE); if (!c) return RLM_MODULE_FAIL; /* * Replace the client. This is more than a bit of a * hack. */ request->client = c; return RLM_MODULE_OK; } /* * The module name should be the only globally exported symbol. * That is, everything else should be 'static'. * * If the module needs to temporarily modify it's instantiation * data, the type should be changed to RLM_TYPE_THREAD_UNSAFE. * The server will then take care of ensuring that the module * is single-threaded. */ module_t rlm_dynamic_clients = { RLM_MODULE_INIT, "dynamic_clients", RLM_TYPE_THREAD_SAFE, /* type */ NULL, /* instantiation */ NULL, /* detach */ { NULL, /* authentication */ dynamic_client_authorize, /* authorization */ NULL, /* preaccounting */ NULL, /* accounting */ NULL, /* checksimul */ NULL, /* pre-proxy */ NULL, /* post-proxy */ NULL /* post-auth */ }, }; freeradius-server/src/modules/rlm_eap/000077500000000000000000000000001257552170400204015ustar00rootroot00000000000000freeradius-server/src/modules/rlm_eap/.gitignore000066400000000000000000000000261257552170400223670ustar00rootroot00000000000000Makefile radeapclient freeradius-server/src/modules/rlm_eap/Makefile.in000066400000000000000000000031401257552170400224440ustar00rootroot00000000000000# # $Id$ # TARGET = @targetname@ SRCS = rlm_eap.c eap.c mem.c HEADERS = eap.h rlm_eap.h RLM_CFLAGS = -Ilibeap CLIENTLIBS = libeap/$(LIBPREFIX)freeradius-eap.la $(LIBRADIUS) RLM_LIBS = libeap/$(LIBPREFIX)freeradius-eap.la $(LIBLTDL) RLM_INSTALL = install-subdirs RLM_SUBDIRS = libeap @eaptypes@ RLM_UTILS = radeapclient$(EXEEXT) # # Not using shared libraries, add in ALL known static modules # at build time. # #ifneq ($(USE_SHARED_LIBS),yes) #RLM_LIBS += $(shell for x in types/rlm_eap*/rlm_eap*.la;do echo -dlpreopen $$x;done) #endif .PHONY: all install-subdirs common # # We need $(LIBPREFIX)freeradius-eap.la before we can build anything else # all: common $(LT_OBJS): $(HEADERS) ## this uses the RLM_CFLAGS and RLM_LIBS and SRCS defs to make TARGET. # This needs to be before the radeapclient rule, as the lhs $(EXEECT) # expansion is done as soon as the Makefile is loaded include ../rules.mak radeapclient$(EXEEXT): radeapclient.lo $(CLIENTLIBS) $(LIBTOOL) --mode=link --tag=CC $(CC) $(LDFLAGS) $(RLM_LDFLAGS) -o radeapclient$(EXEEXT) radeapclient.lo $(LIBRADIUS) $(CLIENTLIBS) $(LIBS) radeapclient.lo: radeapclient.c $(HEADERS) $(LIBTOOL) --mode=compile --tag=CC $(CC) $(CFLAGS) $(RLM_CFLAGS) -c radeapclient.c install-subdirs: @$(MAKE) $(MFLAGS) WHAT_TO_MAKE=install common $(LIBTOOL) --mode=install $(INSTALL) -m 755 $(INSTALLSTRIP) radeapclient$(EXEEXT) $(R)$(bindir) .PHONY: common $(RLM_SUBDIRS) common: $(RLM_SUBDIRS) types: libeap $(RLM_SUBDIRS): @echo "Making $(WHAT_TO_MAKE) in $@..." @$(MAKE) $(MFLAGS) -C $@ $(WHAT_TO_MAKE) libeap/$(LIBPREFIX)freeradius-eap.la: libeap freeradius-server/src/modules/rlm_eap/configure000077500000000000000000003217031257552170400223160ustar00rootroot00000000000000#! /bin/sh # From configure.in Revision. # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.61. # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, # 2002, 2003, 2004, 2005, 2006 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=: # 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 # PATH needs CR # 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 # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false 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.) as_nl=' ' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. 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 # Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # CDPATH. $as_unset CDPATH if test "x$CONFIG_SHELL" = x; then if (eval ":") 2>/dev/null; then as_have_required=yes else as_have_required=no fi if test $as_have_required = yes && (eval ": (as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=\$LINENO as_lineno_2=\$LINENO test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } ") 2> /dev/null; then : else as_candidate_shells= as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. case $as_dir in /*) for as_base in sh bash ksh sh5; do as_candidate_shells="$as_candidate_shells $as_dir/$as_base" done;; esac done IFS=$as_save_IFS for as_shell in $as_candidate_shells $SHELL; do # Try only shells that exist, to save several forks. if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { ("$as_shell") 2> /dev/null <<\_ASEOF 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 : _ASEOF }; then CONFIG_SHELL=$as_shell as_have_required=yes if { "$as_shell" 2> /dev/null <<\_ASEOF 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 : (as_func_return () { (exit $1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = "$1" ); then : else exitcode=1 echo positional parameters were not saved. fi test $exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } _ASEOF }; then break fi fi done if test "x$CONFIG_SHELL" != x; then for as_var in BASH_ENV ENV do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done export CONFIG_SHELL exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} fi if test $as_have_required = no; then echo This script requires a shell more modern than all the echo shells that I found on your system. Please install a echo modern shell, or manually run the script under such a echo shell if you do have one. { (exit 1); exit 1; } fi fi fi (eval "as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0") || { echo No shell found that supports shell functions. echo Please tell autoconf@gnu.org about your system, echo including any error possibly output before this echo message } as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, and appends # trailing '-' during substitution so that $LINENO is not a special # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # scripts with optimization help from Paolo Bonzini. 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" || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi 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 fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi 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=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, 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= SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME= PACKAGE_TARNAME= PACKAGE_VERSION= PACKAGE_STRING= PACKAGE_BUGREPORT= ac_unique_file="rlm_eap.c" ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datarootdir datadir sysconfdir sharedstatedir localstatedir includedir oldincludedir docdir infodir htmldir dvidir pdfdir psdir libdir localedir mandir DEFS ECHO_C ECHO_N ECHO_T LIBS build_alias host_alias target_alias CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT subdirs eaptypes eap_ldflags eap_cflags targetname LIBOBJS LTLIBOBJS' ac_subst_files='' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS' ac_subdirs_all='$eapsubdirs' # Initialize some variables set by options. ac_init_help= ac_init_version=false # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *) ac_optarg=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_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` eval enable_$ac_feature=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_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` eval enable_$ac_feature=\$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_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/[-.]/_/g'` eval with_$ac_package=\$ac_optarg ;; -without-* | --without-*) ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/[-.]/_/g'` eval with_$ac_package=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 ;; -*) { echo "$as_me: error: unrecognized option: $ac_option Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && 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'` { echo "$as_me: error: missing argument to $ac_option" >&2 { (exit 1); exit 1; }; } fi # Be sure to have absolute directory names. 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 case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; } 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 echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || { echo "$as_me: error: Working directory cannot be determined" >&2 { (exit 1); exit 1; }; } test "X$ac_ls_di" = "X$ac_pwd_ls_di" || { echo "$as_me: error: pwd does not report name of working directory" >&2 { (exit 1); exit 1; }; } # 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 -- "$0" || $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$0" : 'X\(//\)[^/]' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X"$0" | 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 .." { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2 { (exit 1); exit 1; }; } pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures this package to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF _ACEOF fi if test -n "$ac_init_help"; then cat <<\_ACEOF 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 C/C++/Objective C preprocessor flags, e.g. -I if you have headers in a nonstandard directory Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. _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" || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`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 echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF configure generated by GNU Autoconf 2.61 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 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 cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by $as_me, which was generated by GNU Autoconf 2.61. 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=. 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=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; 2) ac_configure_args1="$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 ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac done done $as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } $as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export 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 cat <<\_ASBOX ## ---------------- ## ## Cache variables. ## ## ---------------- ## _ASBOX 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_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( *) $as_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 cat <<\_ASBOX ## ----------------- ## ## Output variables. ## ## ----------------- ## _ASBOX echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then cat <<\_ASBOX ## ------------------- ## ## File substitutions. ## ## ------------------- ## _ASBOX echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then cat <<\_ASBOX ## ----------- ## ## confdefs.h. ## ## ----------- ## _ASBOX echo cat confdefs.h echo fi test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" 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'; { (exit 1); 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 # 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 # Let the site file select an alternate cache file if it wants to. # Prefer explicitly selected file to automatically selected ones. if test -n "$CONFIG_SITE"; then set x "$CONFIG_SITE" elif test "x$prefix" != xNONE; then set x "$prefix/share/config.site" "$prefix/etc/config.site" else set x "$ac_default_prefix/share/config.site" \ "$ac_default_prefix/etc/config.site" fi shift for ac_site_file do if test -r "$ac_site_file"; then { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" 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. if test -f "$cache_file"; then { echo "$as_me:$LINENO: loading cache $cache_file" >&5 echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { echo "$as_me:$LINENO: creating cache $cache_file" >&5 echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 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 { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 echo "$as_me: former value: $ac_old_val" >&2;} { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 echo "$as_me: current value: $ac_new_val" >&2;} ac_cache_corrupted=: fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`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. *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 echo "$as_me: error: changes in the environment can compromise the build" >&2;} { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} { (exit 1); exit 1; }; } 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 fail= SMART_LIBS= SMART_CLFAGS= if test x$with_rlm_eap != xno; then 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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}gcc" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="gcc" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}cc" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="$ac_prog" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&5 echo "$as_me: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } # Provide some information about the compiler. echo "$as_me:$LINENO: checking for C compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (ac_try="$ac_compiler --version >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -v >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -V >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out 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. { echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6; } ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # # List of possible output files, starting from the most likely. # The algorithm is not robust to junk in `.', hence go to wildcards (a.*) # only as a last resort. b.out is created by i960 compilers. ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out' # # The IRIX 6 linker writes into existing files which may not be # executable, retaining their permissions. Remove them first so a # subsequent execution test works. ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link_default") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; 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 | *.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 { echo "$as_me:$LINENO: result: $ac_file" >&5 echo "${ECHO_T}$ac_file" >&6; } if test -z "$ac_file"; then echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: C compiler cannot create executables See \`config.log' for more details." >&5 echo "$as_me: error: C compiler cannot create executables See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } fi ac_exeext=$ac_cv_exeext # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { echo "$as_me:$LINENO: checking whether the C compiler works" >&5 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6; } # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then if { ac_try='./$ac_file' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { echo "$as_me:$LINENO: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&5 echo "$as_me: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi fi fi { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } rm -f a.out a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; } { echo "$as_me:$LINENO: result: $cross_compiling" >&5 echo "${ECHO_T}$cross_compiling" >&6; } { echo "$as_me:$LINENO: checking for suffix of executables" >&5 echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; } if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; 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 | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest$ac_cv_exeext { echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 echo "${ECHO_T}$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT { echo "$as_me:$LINENO: checking for suffix of object files" >&5 echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; } if test "${ac_cv_objext+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; 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 ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 echo "${ECHO_T}$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; } if test "${ac_cv_c_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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 { echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; } GCC=`test $ac_compiler_gnu = yes && echo yes` ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CFLAGS="" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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 { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 echo "${ECHO_T}$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 { echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_c89+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_c89=$ac_arg else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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) { echo "$as_me:$LINENO: result: none needed" >&5 echo "${ECHO_T}none needed" >&6; } ;; xno) { echo "$as_me:$LINENO: result: unsupported" >&5 echo "${ECHO_T}unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;; 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 eapsubdirs= for foo in `find ./types -name configure -print`; do bar=`echo $foo | sed 's%/configure$%%g'` eapsubdirs="$eapsubdirs $bar" done ln -s ../../../install-sh install-sh 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 { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5 echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;} { (exit 1); exit 1; }; } 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. subdirs="$subdirs $eapsubdirs" rm install-sh targetname=rlm_eap else targetname= echo \*\*\* module rlm_eap is disabled. fi if test x"$fail" != x""; then if test x"${enable_strict_dependencies}" = x"yes"; then { { echo "$as_me:$LINENO: error: set --without-rlm_eap to disable it explicitly." >&5 echo "$as_me: error: set --without-rlm_eap to disable it explicitly." >&2;} { (exit 1); exit 1; }; } else { echo "$as_me:$LINENO: WARNING: silently not building rlm_eap." >&5 echo "$as_me: WARNING: silently not building rlm_eap." >&2;} { echo "$as_me:$LINENO: WARNING: FAILURE: rlm_eap requires: $fail." >&5 echo "$as_me: WARNING: FAILURE: rlm_eap requires: $fail." >&2;} if test x"$headersuggestion" != x; then { echo "$as_me:$LINENO: WARNING: $headersuggestion" >&5 echo "$as_me: WARNING: $headersuggestion" >&2;} fi if test x"$libsuggestion" != x; then { echo "$as_me:$LINENO: WARNING: $libsuggestion" >&5 echo "$as_me: WARNING: $libsuggestion" >&2;} fi targetname="" eapsubdirs="" fi fi eaptypes=types if test x"$eapsubdirs" = x""; then eaptypes="" fi eap_ldflags=$SMART_LIBS eap_cflags=$SMART_CFLAGS unset ac_cv_env_LIBS_set unset ac_cv_env_LIBS_value ac_config_files="$ac_config_files 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_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( *) $as_unset $ac_var ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then test "x$cache_file" != "x/dev/null" && { echo "$as_me:$LINENO: updating cache $cache_file" >&5 echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 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}' # Transform confdefs.h into DEFS. # Protect against shell expansion while executing Makefile rules. # Protect against Makefile macro expansion. # # If the first sed substitution is executed (which looks for macros that # take arguments), then branch to the quote section. Otherwise, # look for a macro that doesn't take arguments. ac_script=' t clear :clear s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g t quote s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g t quote b any :quote s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g s/\[/\\&/g s/\]/\\&/g s/\$/$$/g H :any ${ g s/^\n// s/\n/ /g p } ' DEFS=`sed -n "$ac_script" confdefs.h` ac_libobjs= ac_ltlibobjs= 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=`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. ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs : ${CONFIG_STATUS=./config.status} ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >$CONFIG_STATUS <<_ACEOF #! $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} _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ## --------------------- ## ## 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=: # 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 # PATH needs CR # 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 # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false 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.) as_nl=' ' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. 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 # Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # CDPATH. $as_unset CDPATH as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, and appends # trailing '-' during substitution so that $LINENO is not a special # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # scripts with optimization help from Paolo Bonzini. 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" || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi 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 fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi 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=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 # Save the log message, to keep $[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by $as_me, which was generated by GNU Autoconf 2.61. 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 cat >>$CONFIG_STATUS <<_ACEOF # Files that config.status was made for. config_files="$ac_config_files" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit -q, --quiet 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 Configuration files: $config_files Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ config.status configured by $0, generated by GNU Autoconf 2.61, with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" Copyright (C) 2006 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' _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # If no file are specified by the user, then we need to provide default # value. By we need to know if files were specified by the user. 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=$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 ) echo "$ac_cs_version"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift CONFIG_FILES="$CONFIG_FILES $ac_optarg" ac_need_defaults=false;; --he | --h | --help | --hel | -h ) 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. -*) { echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *) ac_config_targets="$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 if \$ac_cs_recheck; then echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 CONFIG_SHELL=$SHELL export CONFIG_SHELL exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; 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 fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= trap 'exit_status=$? { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status ' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || { echo "$me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } # # Set up the sed scripts for CONFIG_FILES section. # # No need to generate the scripts if there are no CONFIG_FILES. # This happens for instance when ./config.status config.h if test -n "$CONFIG_FILES"; then _ACEOF ac_delim='%!_!# ' for ac_last_try in false false false false false :; do cat >conf$$subs.sed <<_ACEOF SHELL!$SHELL$ac_delim PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim PACKAGE_NAME!$PACKAGE_NAME$ac_delim PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim PACKAGE_STRING!$PACKAGE_STRING$ac_delim PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim exec_prefix!$exec_prefix$ac_delim prefix!$prefix$ac_delim program_transform_name!$program_transform_name$ac_delim bindir!$bindir$ac_delim sbindir!$sbindir$ac_delim libexecdir!$libexecdir$ac_delim datarootdir!$datarootdir$ac_delim datadir!$datadir$ac_delim sysconfdir!$sysconfdir$ac_delim sharedstatedir!$sharedstatedir$ac_delim localstatedir!$localstatedir$ac_delim includedir!$includedir$ac_delim oldincludedir!$oldincludedir$ac_delim docdir!$docdir$ac_delim infodir!$infodir$ac_delim htmldir!$htmldir$ac_delim dvidir!$dvidir$ac_delim pdfdir!$pdfdir$ac_delim psdir!$psdir$ac_delim libdir!$libdir$ac_delim localedir!$localedir$ac_delim mandir!$mandir$ac_delim DEFS!$DEFS$ac_delim ECHO_C!$ECHO_C$ac_delim ECHO_N!$ECHO_N$ac_delim ECHO_T!$ECHO_T$ac_delim LIBS!$LIBS$ac_delim build_alias!$build_alias$ac_delim host_alias!$host_alias$ac_delim target_alias!$target_alias$ac_delim CC!$CC$ac_delim CFLAGS!$CFLAGS$ac_delim LDFLAGS!$LDFLAGS$ac_delim CPPFLAGS!$CPPFLAGS$ac_delim ac_ct_CC!$ac_ct_CC$ac_delim EXEEXT!$EXEEXT$ac_delim OBJEXT!$OBJEXT$ac_delim subdirs!$subdirs$ac_delim eaptypes!$eaptypes$ac_delim eap_ldflags!$eap_ldflags$ac_delim eap_cflags!$eap_cflags$ac_delim targetname!$targetname$ac_delim LIBOBJS!$LIBOBJS$ac_delim LTLIBOBJS!$LTLIBOBJS$ac_delim _ACEOF if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 51; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` if test -n "$ac_eof"; then ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` ac_eof=`expr $ac_eof + 1` fi cat >>$CONFIG_STATUS <<_ACEOF cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof /@[a-zA-Z_][a-zA-Z_0-9]*@/!b end _ACEOF sed ' s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g s/^/s,@/; s/!/@,|#_!!_#|/ :n t n s/'"$ac_delim"'$/,g/; t s/$/\\/; p N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n ' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF :end s/|#_!!_#|//g CEOF$ac_eof _ACEOF # VPATH may cause trouble with some makes, so we remove $(srcdir), # ${srcdir} and @srcdir@ 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[ ]*=/{ s/:*\$(srcdir):*/:/ s/:*\${srcdir}:*/:/ s/:*@srcdir@:*/:/ s/^\([^=]*=[ ]*\):*/\1/ s/:*$// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF fi # test -n "$CONFIG_FILES" for ac_tag in :F $CONFIG_FILES do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5 echo "$as_me: error: Invalid tag $ac_tag." >&2;} { (exit 1); exit 1; }; };; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 echo "$as_me: error: cannot find input file: $ac_f" >&2;} { (exit 1); exit 1; }; };; esac ac_file_inputs="$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 "`IFS=: echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure." if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { echo "$as_me:$LINENO: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} fi case $ac_tag in *:-:* | *:-) cat >"$tmp/stdin";; 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 || 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" case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`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 || 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" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 echo "$as_me: error: cannot create directory $as_dir" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`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 # _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # 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= case `sed -n '/datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p ' $ac_file_inputs` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF 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 sed "$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s&@configure_input@&$configure_input&;t t s&@top_builddir@&$ac_top_builddir_sub&;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 $ac_datarootdir_hack " $ac_file_inputs | sed -f "$tmp/subs-1.sed" >$tmp/out test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&5 echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&2;} rm -f "$tmp/stdin" case $ac_file in -) cat "$tmp/out"; rm -f "$tmp/out";; *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;; esac ;; esac done # for ac_tag { (exit 0); exit 0; } _ACEOF chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save # 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 || { (exit 1); exit 1; } fi # # CONFIG_SUBDIRS section. # if test "$no_recursion" != yes; then # Remove --cache-file and --srcdir arguments so they do not pile up. ac_sub_configure_args= ac_prev= eval "set x $ac_configure_args" shift for ac_arg do if test -n "$ac_prev"; then ac_prev= continue fi case $ac_arg in -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=*) ;; --config-cache | -C) ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) ;; *) case $ac_arg in *\'*) ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac ac_sub_configure_args="$ac_sub_configure_args '$ac_arg'" ;; esac done # Always prepend --prefix to ensure using the same prefix # in subdir configurations. ac_arg="--prefix=$prefix" case $ac_arg in *\'*) ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac ac_sub_configure_args="'$ac_arg' $ac_sub_configure_args" # Pass --silent if test "$silent" = yes; then ac_sub_configure_args="--silent $ac_sub_configure_args" fi ac_popdir=`pwd` for ac_dir in : $subdirs; do test "x$ac_dir" = x: && continue # Do not complain, so a configure script can configure whichever # parts of a large source tree are present. test -d "$srcdir/$ac_dir" || continue ac_msg="=== configuring in $ac_dir (`pwd`/$ac_dir)" echo "$as_me:$LINENO: $ac_msg" >&5 echo "$ac_msg" >&6 { as_dir="$ac_dir" case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`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 || 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" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 echo "$as_me: error: cannot create directory $as_dir" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`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" # Check for guested configure; otherwise get Cygnus style configure. if test -f "$ac_srcdir/configure.gnu"; then ac_sub_configure=$ac_srcdir/configure.gnu elif test -f "$ac_srcdir/configure"; then ac_sub_configure=$ac_srcdir/configure elif test -f "$ac_srcdir/configure.in"; then # This should be Cygnus configure. ac_sub_configure=$ac_aux_dir/configure else { echo "$as_me:$LINENO: WARNING: no configuration information is in $ac_dir" >&5 echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2;} ac_sub_configure= fi # The recursion is here. if test -n "$ac_sub_configure"; then # Make the cache file name correct relative to the subdirectory. case $cache_file in [\\/]* | ?:[\\/]* ) ac_sub_cache_file=$cache_file ;; *) # Relative name. ac_sub_cache_file=$ac_top_build_prefix$cache_file ;; esac { echo "$as_me:$LINENO: running $SHELL $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_srcdir" >&5 echo "$as_me: running $SHELL $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_srcdir" >&6;} # The eval makes quoting arguments work. eval "\$SHELL \"\$ac_sub_configure\" $ac_sub_configure_args \ --cache-file=\"\$ac_sub_cache_file\" --srcdir=\"\$ac_srcdir\"" || { { echo "$as_me:$LINENO: error: $ac_sub_configure failed for $ac_dir" >&5 echo "$as_me: error: $ac_sub_configure failed for $ac_dir" >&2;} { (exit 1); exit 1; }; } fi cd "$ac_popdir" done fi freeradius-server/src/modules/rlm_eap/configure.in000066400000000000000000000026211257552170400227130ustar00rootroot00000000000000AC_PREREQ([2.53]) AC_INIT(rlm_eap.c) AC_REVISION($Revision$) AC_DEFUN(modname,[rlm_eap]) fail= SMART_LIBS= SMART_CLFAGS= if test x$with_[]modname != xno; then AC_PROG_CC eapsubdirs= for foo in `find ./types -name configure -print`; do bar=`echo $foo | sed 's%/configure$%%g'` eapsubdirs="$eapsubdirs $bar" done dnl # don't ask... this is done to avoid autoconf stupidities. ln -s ../../../install-sh install-sh dnl # dnl # Don't change the variable name here. Autoconf goes bonkers dnl # if you do. dnl # AC_CONFIG_SUBDIRS($eapsubdirs) rm install-sh dnl # dnl # Don't bother looking for errors in the child directories dnl # targetname=modname else targetname= echo \*\*\* module modname is disabled. fi if test x"$fail" != x""; then if test x"${enable_strict_dependencies}" = x"yes"; then AC_MSG_ERROR([set --without-]modname[ to disable it explicitly.]) else AC_MSG_WARN([silently not building ]modname[.]) AC_MSG_WARN([FAILURE: ]modname[ requires: $fail.]) if test x"$headersuggestion" != x; then AC_MSG_WARN([$headersuggestion]) fi if test x"$libsuggestion" != x; then AC_MSG_WARN([$libsuggestion]) fi targetname="" eapsubdirs="" fi fi eaptypes=types if test x"$eapsubdirs" = x""; then eaptypes="" fi eap_ldflags=$SMART_LIBS eap_cflags=$SMART_CFLAGS AC_SUBST(eaptypes) AC_SUBST(eap_ldflags) AC_SUBST(eap_cflags) AC_SUBST(targetname) AC_OUTPUT(Makefile) freeradius-server/src/modules/rlm_eap/eap.c000066400000000000000000000741401257552170400213200ustar00rootroot00000000000000/* * eap.c rfc2284 & rfc2869 implementation * * Version: $Id$ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2000-2003,2006 The FreeRADIUS server project * Copyright 2001 hereUare Communications, Inc. * Copyright 2003 Alan DeKok */ /* * EAP PACKET FORMAT * --- ------ ------ * 0 1 2 3 * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | Code | Identifier | Length | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | Data ... * +-+-+-+-+ * * * EAP Request and Response Packet Format * --- ------- --- -------- ------ ------ * 0 1 2 3 * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | Code | Identifier | Length | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | Type | Type-Data ... * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+- * * * EAP Success and Failure Packet Format * --- ------- --- ------- ------ ------ * 0 1 2 3 * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | Code | Identifier | Length | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * */ #include RCSID("$Id$") #include "rlm_eap.h" static const char *eap_codes[] = { "", /* 0 is invalid */ "request", "response", "success", "failure" }; /* * Load all the required eap authentication types. * Get all the supported EAP-types from config file. */ int eaptype_load(EAP_TYPES **type, int eap_type, CONF_SECTION *cs) { char buffer[64]; char namebuf[64]; const char *eaptype_name; lt_dlhandle handle; EAP_TYPES *node; eaptype_name = eaptype_type2name(eap_type, namebuf, sizeof(namebuf)); snprintf(buffer, sizeof(buffer), "rlm_eap_%s", eaptype_name); /* Link the loaded EAP-Type */ handle = lt_dlopenext(buffer); if (handle == NULL) { radlog(L_ERR, "rlm_eap: Failed to link EAP-Type/%s: %s", eaptype_name, lt_dlerror()); return -1; } /* Make room for the EAP-Type */ node = (EAP_TYPES *)malloc(sizeof(EAP_TYPES)); if (node == NULL) { radlog(L_ERR, "rlm_eap: out of memory"); return -1; } memset(node, 0, sizeof(*node)); /* fill in the structure */ node->handle = handle; node->cs = cs; /* * In general, this is a terrible idea. It works here * solely because the eap_type2name function returns a * 'static const char *' pointer sometimes, and we can * ONLY link to module which are named in that static * array. */ node->typename = eaptype_name; node->type_data = NULL; node->type = (EAP_TYPE *)lt_dlsym(node->handle, buffer); if (!node->type) { radlog(L_ERR, "rlm_eap: Failed linking to %s structure in %s: %s", buffer, eaptype_name, lt_dlerror()); lt_dlclose(node->handle); /* ignore any errors */ free(node); return -1; } cf_log_module(cs, "Linked to sub-module %s", buffer); cf_log_module(cs, "Instantiating eap-%s", eaptype_name); if ((node->type->attach) && ((node->type->attach)(node->cs, &(node->type_data)) < 0)) { radlog(L_ERR, "rlm_eap: Failed to initialize type %s", eaptype_name); lt_dlclose(node->handle); free(node); return -1; } *type = node; return 0; } /* * Call the appropriate handle with the right eap_type. */ static int eaptype_call(EAP_TYPES *atype, EAP_HANDLER *handler) { int rcode = 1; REQUEST *request = handler->request; const char *module = request->module; RDEBUG2("processing type %s", atype->typename); request->module = atype->typename; rad_assert(atype != NULL); switch (handler->stage) { case INITIATE: if (!atype->type->initiate(atype->type_data, handler)) rcode = 0; break; case AUTHORIZE: /* * The called function updates the EAP reply packet. */ if (!atype->type->authorize || !atype->type->authorize(atype->type_data, handler)) rcode = 0; break; case AUTHENTICATE: /* * The called function updates the EAP reply packet. */ if (!atype->type->authenticate || !atype->type->authenticate(atype->type_data, handler)) rcode = 0; break; default: /* Should never enter here */ RDEBUG("Internal sanity check failed on eap_type"); rcode = 0; break; } request->module = module; return rcode; } /* * Based on TYPE, call the appropriate EAP-type handler * Default to the configured EAP-Type * for all Unsupported EAP-Types */ int eaptype_select(rlm_eap_t *inst, EAP_HANDLER *handler) { size_t i; unsigned int default_eap_type = inst->default_eap_type; eaptype_t *eaptype; VALUE_PAIR *vp; char namebuf[64]; const char *eaptype_name; REQUEST *request = handler->request; eaptype = &handler->eap_ds->response->type; /* * Don't trust anyone. */ if ((eaptype->type == 0) || (eaptype->type > PW_EAP_MAX_TYPES)) { RDEBUG2("Asked to select bad type"); return EAP_INVALID; } /* * Multiple levels of nesting are invalid. */ if (handler->request->parent && handler->request->parent->parent) { RDEBUG2("Multiple levels of TLS nesting is invalid."); return EAP_INVALID; } /* * Figure out what to do. */ switch(eaptype->type) { case PW_EAP_IDENTITY: RDEBUG2("EAP Identity"); /* * Allow per-user configuration of EAP types. */ vp = pairfind(handler->request->config_items, PW_EAP_TYPE); if (vp) default_eap_type = vp->vp_integer; do_initiate: /* * Ensure it's valid. */ if ((default_eap_type < PW_EAP_MD5) || (default_eap_type > PW_EAP_MAX_TYPES) || (inst->types[default_eap_type] == NULL)) { RDEBUG2("No such EAP type %s", eaptype_type2name(default_eap_type, namebuf, sizeof(namebuf))); return EAP_INVALID; } handler->stage = INITIATE; handler->eap_type = default_eap_type; /* * Wild & crazy stuff! For TTLS & PEAP, we * initiate a TLS session, and then pass that * session data to TTLS or PEAP for the * authenticate stage. * * Handler->eap_type holds the TRUE type. */ if ((default_eap_type == PW_EAP_TTLS) || (default_eap_type == PW_EAP_PEAP)) { default_eap_type = PW_EAP_TLS; } if ((default_eap_type == PW_EAP_TNC) && !handler->request->parent) { RDEBUG2("ERROR: EAP-TNC must be run inside of a TLS method."); return EAP_INVALID; } if (eaptype_call(inst->types[default_eap_type], handler) == 0) { RDEBUG2("Default EAP type %s failed in initiate", eaptype_type2name(default_eap_type, namebuf, sizeof(namebuf))); return EAP_INVALID; } break; case PW_EAP_NAK: /* * The NAK data is the preferred EAP type(s) of * the client. * * RFC 3748 says to list one or more proposed * alternative types, one per octet, or to use * 0 for no alternative. */ RDEBUG2("EAP NAK"); /* * Delete old data, if necessary. */ if (handler->opaque && handler->free_opaque) { handler->free_opaque(handler->opaque); handler->free_opaque = NULL; handler->opaque = NULL; } if (eaptype->data == NULL) { RDEBUG2("Empty NAK packet, cannot decide what EAP type the client wants."); return EAP_INVALID; } /* * Pick one type out of the one they asked for, * as they may have asked for many. */ default_eap_type = 0; vp = pairfind(handler->request->config_items, PW_EAP_TYPE); for (i = 0; i < eaptype->length; i++) { /* * It is invalid to request identity, * notification & nak in nak. * * Type 0 is valid, and means there are no * common choices. */ if (eaptype->data[i] < PW_EAP_MD5) { RDEBUG2("NAK asked for bad type %d", eaptype->data[i]); return EAP_INVALID; } if ((eaptype->data[i] > PW_EAP_MAX_TYPES) || !inst->types[eaptype->data[i]]) { DICT_VALUE *dv; dv = dict_valbyattr(PW_EAP_TYPE, eaptype->data[i]); if (dv) { RDEBUG2("NAK asked for unsupported type %s", dv->name); } else { RDEBUG2("NAK asked for unsupported type %d", eaptype->data[i]); } continue; } eaptype_name = eaptype_type2name(eaptype->data[i], namebuf, sizeof(namebuf)); /* * Prevent a firestorm if the client is confused. */ if (handler->eap_type == eaptype->data[i]) { RDEBUG2("ERROR! Our request for %s was NAK'd with a request for %s. Skipping the requested type.", eaptype_name, eaptype_name); continue; } /* * Enforce per-user configuration of EAP * types. */ if (vp && (vp->vp_integer != eaptype->data[i])) { char mynamebuf[64]; RDEBUG2("Client wants %s, while we require %s. Skipping the requested type.", eaptype_name, eaptype_type2name(vp->vp_integer, mynamebuf, sizeof(mynamebuf))); continue; } default_eap_type = eaptype->data[i]; break; } /* * We probably want to return 'fail' here... */ if (!default_eap_type) { RDEBUG2("No common EAP types found."); return EAP_INVALID; } eaptype_name = eaptype_type2name(default_eap_type, namebuf, sizeof(namebuf)); RDEBUG2("EAP-NAK asked for EAP-Type/%s", eaptype_name); goto do_initiate; break; /* * Key off of the configured sub-modules. */ default: eaptype_name = eaptype_type2name(eaptype->type, namebuf, sizeof(namebuf)); RDEBUG2("EAP/%s", eaptype_name); /* * We haven't configured it, it doesn't exit. */ if (!inst->types[eaptype->type]) { RDEBUG2("EAP type %d is unsupported", eaptype->type); return EAP_INVALID; } rad_assert(handler->stage == AUTHENTICATE); handler->eap_type = eaptype->type; if (eaptype_call(inst->types[eaptype->type], handler) == 0) { RDEBUG2("Handler failed in EAP/%s", eaptype_name); return EAP_INVALID; } break; } return EAP_OK; } /* * compose EAP reply packet in EAP-Message attr of RADIUS. If * EAP exceeds 253, frame it in multiple EAP-Message attrs. * * Set the RADIUS reply codes based on EAP request codes. Append * any additonal VPs to RADIUS reply */ int eap_compose(EAP_HANDLER *handler) { VALUE_PAIR *vp; eap_packet_t *eap_packet; REQUEST *request = handler->request; EAP_DS *eap_ds = handler->eap_ds; EAP_PACKET *reply = eap_ds->request; int rcode; /* * The Id for the EAP packet to the NAS wasn't set. * Do so now. * * LEAP requires the Id to be incremented on EAP-Success * in Stage 4, so that we can carry on the conversation * where the client asks us to authenticate ourselves * in stage 5. */ if (!eap_ds->set_request_id) { /* * Id serves to suppport request/response * retransmission in the EAP layer and as such * must be different for 'adjacent' packets * except in case of success/failure-replies. * * RFC2716 (EAP-TLS) requires this to be * incremented, RFC2284 only makes the above- * mentioned restriction. */ reply->id = handler->eap_ds->response->id; switch (reply->code) { /* * The Id is a simple "ack" for success * and failure. * * RFC 3748 section 4.2 says * * ... The Identifier field MUST match * the Identifier field of the Response * packet that it is sent in response * to. */ case PW_EAP_SUCCESS: case PW_EAP_FAILURE: break; /* * We've sent a response to their * request, the Id is incremented. */ default: ++reply->id; } } else { RDEBUG2("Underlying EAP-Type set EAP ID to %d", reply->id); } /* * For Request & Response packets, set the EAP sub-type, * if the EAP sub-module didn't already set it. * * This allows the TLS module to be "morphic", and means * that the TTLS and PEAP modules can call it to do most * of their dirty work. */ if (((eap_ds->request->code == PW_EAP_REQUEST) || (eap_ds->request->code == PW_EAP_RESPONSE)) && (eap_ds->request->type.type == 0)) { rad_assert(handler->eap_type >= PW_EAP_MD5); rad_assert(handler->eap_type <= PW_EAP_MAX_TYPES); eap_ds->request->type.type = handler->eap_type; } /* * FIXME: We malloc memory for the eap packet, and then * immediately copy that data into VALUE_PAIRs. This * could be done more efficiently... */ if (eap_wireformat(reply) == EAP_INVALID) { return RLM_MODULE_INVALID; } eap_packet = (eap_packet_t *)reply->packet; vp = eap_packet2vp(eap_packet); if (!vp) return RLM_MODULE_INVALID; pairadd(&(request->reply->vps), vp); /* * EAP-Message is always associated with * Message-Authenticator but not vice-versa. * * Don't add a Message-Authenticator if it's already * there. */ vp = pairfind(request->reply->vps, PW_MESSAGE_AUTHENTICATOR); if (!vp) { vp = paircreate(PW_MESSAGE_AUTHENTICATOR, PW_TYPE_OCTETS); memset(vp->vp_octets, 0, AUTH_VECTOR_LEN); vp->length = AUTH_VECTOR_LEN; pairadd(&(request->reply->vps), vp); } /* Set request reply code, but only if it's not already set. */ rcode = RLM_MODULE_OK; if (!request->reply->code) switch(reply->code) { case PW_EAP_RESPONSE: request->reply->code = PW_AUTHENTICATION_ACK; rcode = RLM_MODULE_HANDLED; /* leap weirdness */ break; case PW_EAP_SUCCESS: request->reply->code = PW_AUTHENTICATION_ACK; rcode = RLM_MODULE_OK; break; case PW_EAP_FAILURE: request->reply->code = PW_AUTHENTICATION_REJECT; rcode = RLM_MODULE_REJECT; break; case PW_EAP_REQUEST: request->reply->code = PW_ACCESS_CHALLENGE; rcode = RLM_MODULE_HANDLED; break; default: /* * When we're pulling MS-CHAPv2 out of EAP-MS-CHAPv2, * we do so WITHOUT setting a reply code, as the * request is being proxied. */ if (request->options & RAD_REQUEST_OPTION_PROXY_EAP) { return RLM_MODULE_HANDLED; } /* Should never enter here */ radlog(L_ERR, "rlm_eap: reply code %d is unknown, Rejecting the request.", reply->code); request->reply->code = PW_AUTHENTICATION_REJECT; reply->code = PW_EAP_FAILURE; rcode = RLM_MODULE_REJECT; break; } return rcode; } /* * Radius criteria, EAP-Message is invalid without Message-Authenticator * For EAP_START, send Access-Challenge with EAP Identity request. */ int eap_start(rlm_eap_t *inst, REQUEST *request) { VALUE_PAIR *vp, *proxy; VALUE_PAIR *eap_msg; eap_msg = pairfind(request->packet->vps, PW_EAP_MESSAGE); if (eap_msg == NULL) { RDEBUG2("No EAP-Message, not doing EAP"); return EAP_NOOP; } /* * Look for EAP-Type = None (FreeRADIUS specific attribute) * this allows you to NOT do EAP for some users. */ vp = pairfind(request->packet->vps, PW_EAP_TYPE); if (vp && vp->vp_integer == 0) { RDEBUG2("Found EAP-Message, but EAP-Type = None, so we're not doing EAP."); return EAP_NOOP; } /* * http://www.freeradius.org/rfc/rfc2869.html#EAP-Message * * Checks for Message-Authenticator are handled by rad_recv(). */ /* * Check for a Proxy-To-Realm. Don't get excited over LOCAL * realms (sigh). */ proxy = pairfind(request->config_items, PW_PROXY_TO_REALM); if (proxy) { REALM *realm; /* * If it's a LOCAL realm, then we're not proxying * to it. */ realm = realm_find(proxy->vp_strvalue); if (!realm || (realm && (realm->auth_pool == NULL))) { proxy = NULL; } } /* * Check the length before de-referencing the contents. * * Lengths of zero are required by the RFC for EAP-Start, * but we've never seen them in practice. * * Lengths of two are what we see in practice as * EAP-Starts. */ if ((eap_msg->length == 0) || (eap_msg->length == 2)) { EAP_DS *eap_ds; EAP_HANDLER handler; /* * It's a valid EAP-Start, but the request * was marked as being proxied. So we don't * do EAP, as the home server will do it. */ if (proxy) { do_proxy: RDEBUG2("Request is supposed to be proxied to Realm %s. Not doing EAP.", proxy->vp_strvalue); return EAP_NOOP; } RDEBUG2("Got EAP_START message"); if ((eap_ds = eap_ds_alloc()) == NULL) { RDEBUG2("EAP Start failed in allocation"); return EAP_FAIL; } /* * It's an EAP-Start packet. Tell them to stop wasting * our time, and give us an EAP-Identity packet. * * Hmm... we should probably check the contents of the * EAP-Start packet for something... */ eap_ds->request->code = PW_EAP_REQUEST; eap_ds->request->type.type = PW_EAP_IDENTITY; /* * We don't have a handler, but eap_compose needs one, * (for various reasons), so we fake it out here. */ memset(&handler, 0, sizeof(handler)); handler.request = request; handler.eap_ds = eap_ds; eap_compose(&handler); eap_ds_free(&eap_ds); return EAP_FOUND; } /* end of handling EAP-Start */ /* * The EAP packet header is 4 bytes, plus one byte of * EAP sub-type. Short packets are discarded, unless * we're proxying. */ if (eap_msg->length < (EAP_HEADER_LEN + 1)) { if (proxy) goto do_proxy; RDEBUG2("Ignoring EAP-Message which is too short to be meaningful."); return EAP_FAIL; } /* * Create an EAP-Type containing the EAP-type * from the packet. */ vp = paircreate(PW_EAP_TYPE, PW_TYPE_INTEGER); if (vp) { vp->vp_integer = eap_msg->vp_octets[4]; pairadd(&(request->packet->vps), vp); } /* * If the request was marked to be proxied, do it now. * This is done after checking for a valid length * (which may not be good), and after adding the EAP-Type * attribute. This lets other modules selectively cancel * proxying based on EAP-Type. */ if (proxy) goto do_proxy; /* * From now on, we're supposed to be handling the * EAP packet. We better understand it... */ /* * We're allowed only a few codes. Request, Response, * Success, or Failure. */ if ((eap_msg->vp_octets[0] == 0) || (eap_msg->vp_octets[0] > PW_EAP_MAX_CODES)) { RDEBUG2("Unknown EAP packet"); } else { RDEBUG2("EAP packet type %s id %d length %d", eap_codes[eap_msg->vp_octets[0]], eap_msg->vp_octets[1], eap_msg->length); } /* * We handle request and responses. The only other defined * codes are success and fail. The client SHOULD NOT be * sending success/fail packets to us, as it doesn't make * sense. */ if ((eap_msg->vp_octets[0] != PW_EAP_REQUEST) && (eap_msg->vp_octets[0] != PW_EAP_RESPONSE)) { RDEBUG2("Ignoring EAP packet which we don't know how to handle."); return EAP_FAIL; } /* * We've been told to ignore unknown EAP types, AND it's * an unknown type. Return "NOOP", which will cause the * eap_authorize() to return NOOP. * * EAP-Identity, Notification, and NAK are all handled * internally, so they never have handlers. */ if ((eap_msg->vp_octets[4] >= PW_EAP_MD5) && inst->ignore_unknown_eap_types && ((eap_msg->vp_octets[4] == 0) || (eap_msg->vp_octets[4] > PW_EAP_MAX_TYPES) || (inst->types[eap_msg->vp_octets[4]] == NULL))) { RDEBUG2(" Ignoring Unknown EAP type"); return EAP_NOOP; } /* * They're NAKing the EAP type we wanted to use, and * asking for one which we don't support. * * NAK is code + id + length1 + length + NAK * + requested EAP type(s). * * We know at this point that we can't handle the * request. We could either return an EAP-Fail here, but * it's not too critical. * * By returning "noop", we can ensure that authorize() * returns NOOP, and another module may choose to proxy * the request. */ if ((eap_msg->vp_octets[4] == PW_EAP_NAK) && (eap_msg->length >= (EAP_HEADER_LEN + 2)) && inst->ignore_unknown_eap_types && ((eap_msg->vp_octets[5] == 0) || (eap_msg->vp_octets[5] > PW_EAP_MAX_TYPES) || (inst->types[eap_msg->vp_octets[5]] == NULL))) { RDEBUG2("Ignoring NAK with request for unknown EAP type"); return EAP_NOOP; } if ((eap_msg->vp_octets[4] == PW_EAP_TTLS) || (eap_msg->vp_octets[4] == PW_EAP_PEAP)) { RDEBUG2("Continuing tunnel setup."); return EAP_OK; } /* * Later EAP messages are longer than the 'start' * message, so if everything is OK, this function returns * 'no start found', so that the rest of the EAP code can * use the State attribute to match this EAP-Message to * an ongoing conversation. */ RDEBUG2("No EAP Start, assuming it's an on-going EAP conversation"); return EAP_NOTFOUND; } /* * compose EAP FAILURE packet in EAP-Message */ void eap_fail(EAP_HANDLER *handler) { /* * Delete any previous replies. */ pairdelete(&handler->request->reply->vps, PW_EAP_MESSAGE); pairdelete(&handler->request->reply->vps, PW_STATE); eap_packet_free(&handler->eap_ds->request); handler->eap_ds->request = eap_packet_alloc(); handler->eap_ds->request->code = PW_EAP_FAILURE; eap_compose(handler); } /* * compose EAP SUCCESS packet in EAP-Message */ void eap_success(EAP_HANDLER *handler) { handler->eap_ds->request->code = PW_EAP_SUCCESS; eap_compose(handler); } /* * Basic EAP packet verfications & validations */ static int eap_validation(REQUEST *request, eap_packet_t *eap_packet) { uint16_t len; memcpy(&len, eap_packet->length, sizeof(uint16_t)); len = ntohs(len); /* * High level EAP packet checks */ if ((len <= EAP_HEADER_LEN) || ((eap_packet->code != PW_EAP_RESPONSE) && (eap_packet->code != PW_EAP_REQUEST)) || (eap_packet->data[0] <= 0) || (eap_packet->data[0] > PW_EAP_MAX_TYPES)) { radlog_request(L_AUTH, 0, request, "Badly formatted EAP Message: Ignoring the packet"); return EAP_INVALID; } /* we don't expect notification, but we send it */ if (eap_packet->data[0] == PW_EAP_NOTIFICATION) { radlog_request(L_AUTH, 0, request, "Got NOTIFICATION, " "Ignoring the packet"); return EAP_INVALID; } return EAP_VALID; } /* * Get the user Identity only from EAP-Identity packets */ static char *eap_identity(REQUEST *request, eap_packet_t *eap_packet) { int size; uint16_t len; char *identity; if ((eap_packet == NULL) || (eap_packet->code != PW_EAP_RESPONSE) || (eap_packet->data[0] != PW_EAP_IDENTITY)) { return NULL; } memcpy(&len, eap_packet->length, sizeof(uint16_t)); len = ntohs(len); if ((len <= 5) || (eap_packet->data[1] == 0x00)) { RDEBUG("UserIdentity Unknown "); return NULL; } size = len - 5; identity = rad_malloc(size + 1); memcpy(identity, &eap_packet->data[1], size); identity[size] = '\0'; return identity; } /* * Create our Request-Response data structure with the eap packet */ static EAP_DS *eap_buildds(eap_packet_t **eap_packet_p) { EAP_DS *eap_ds = NULL; eap_packet_t *eap_packet = *eap_packet_p; int typelen; uint16_t len; if ((eap_ds = eap_ds_alloc()) == NULL) { return NULL; } eap_ds->response->packet = (unsigned char *)eap_packet; eap_ds->response->code = eap_packet->code; eap_ds->response->id = eap_packet->id; eap_ds->response->type.type = eap_packet->data[0]; memcpy(&len, eap_packet->length, sizeof(uint16_t)); len = ntohs(len); eap_ds->response->length = len; /* * We've eaten the eap packet into the eap_ds. */ *eap_packet_p = NULL; /* * First 5 bytes in eap, are code + id + length(2) + type. * * The rest is type-specific data. We skip type while * getting typedata from data. */ typelen = len - 5/*code + id + length + type */; if (typelen > 0) { /* * Since the packet contains the complete * eap_packet, typedata will be a ptr in packet * to its typedata */ eap_ds->response->type.data = eap_ds->response->packet + 5/*code+id+length+type*/; eap_ds->response->type.length = typelen; } else { eap_ds->response->type.length = 0; eap_ds->response->type.data = NULL; } return eap_ds; } /* * If identity response then create a fresh handler & fill the identity * else handler MUST be in our list, get that. * This handler creation cannot fail * * username contains REQUEST->username which might have been stripped. * identity contains the one sent in EAP-Identity response */ EAP_HANDLER *eap_handler(rlm_eap_t *inst, eap_packet_t **eap_packet_p, REQUEST *request) { EAP_HANDLER *handler = NULL; eap_packet_t *eap_packet = *eap_packet_p; VALUE_PAIR *vp; /* * Ensure it's a valid EAP-Request, or EAP-Response. */ if (eap_validation(request, eap_packet) == EAP_INVALID) { free(*eap_packet_p); *eap_packet_p = NULL; return NULL; } /* * EAP_HANDLER MUST be found in the list if it is not * EAP-Identity response */ if (eap_packet->data[0] != PW_EAP_IDENTITY) { handler = eaplist_find(inst, request, eap_packet); if (handler == NULL) { /* Either send EAP_Identity or EAP-Fail */ RDEBUG("Either EAP-request timed out OR" " EAP-response to an unknown EAP-request"); free(*eap_packet_p); *eap_packet_p = NULL; return NULL; } /* * Even more paranoia. Without this, some weird * clients could do crazy things. * * It's ok to send EAP sub-type NAK in response * to a request for a particular type, but it's NOT * OK to blindly return data for another type. */ if ((eap_packet->data[0] != PW_EAP_NAK) && (eap_packet->data[0] != handler->eap_type)) { RDEBUG("Response appears to match, but EAP type is wrong."); free(*eap_packet_p); *eap_packet_p = NULL; return NULL; } vp = pairfind(request->packet->vps, PW_USER_NAME); if (!vp) { /* * NAS did not set the User-Name * attribute, so we set it here and * prepend it to the beginning of the * request vps so that autz's work * correctly */ RDEBUG2("Broken NAS did not set User-Name, setting from EAP Identity"); vp = pairmake("User-Name", handler->identity, T_OP_EQ); if (vp == NULL) { RDEBUG("Out of memory"); free(*eap_packet_p); *eap_packet_p = NULL; return NULL; } vp->next = request->packet->vps; request->packet->vps = vp; } else { /* * A little more paranoia. If the NAS * *did* set the User-Name, and it doesn't * match the identity, (i.e. If they * change their User-Name part way through * the EAP transaction), then reject the * request as the NAS is doing something * funny. */ if (strncmp(handler->identity, vp->vp_strvalue, MAX_STRING_LEN) != 0) { RDEBUG("Identity (%s) does not match User-Name (%s). Authentication failed.", handler->identity, vp->vp_strvalue); free(*eap_packet_p); *eap_packet_p = NULL; return NULL; } } } else { /* packet was EAP identity */ handler = eap_handler_alloc(inst); if (handler == NULL) { RDEBUG("Out of memory."); free(*eap_packet_p); *eap_packet_p = NULL; return NULL; } /* * All fields in the handler are set to zero. */ handler->identity = eap_identity(request, eap_packet); if (handler->identity == NULL) { RDEBUG("Identity Unknown, authentication failed"); free(*eap_packet_p); *eap_packet_p = NULL; eap_handler_free(inst, handler); return NULL; } vp = pairfind(request->packet->vps, PW_USER_NAME); if (!vp) { /* * NAS did not set the User-Name * attribute, so we set it here and * prepend it to the beginning of the * request vps so that autz's work * correctly */ RDEBUG2("WARNING NAS did not set User-Name. Setting it locally from EAP Identity"); vp = pairmake("User-Name", handler->identity, T_OP_EQ); if (vp == NULL) { RDEBUG("Out of memory"); free(*eap_packet_p); *eap_packet_p = NULL; eap_handler_free(inst, handler); return NULL; } vp->next = request->packet->vps; request->packet->vps = vp; } else { /* * Paranoia. If the NAS *did* set the * User-Name, and it doesn't match the * identity, the NAS is doing something * funny, so reject the request. */ if (strncmp(handler->identity, vp->vp_strvalue, MAX_STRING_LEN) != 0) { RDEBUG("Identity (%s) does not match User-Name (%s). Authentication failed.", handler->identity, vp->vp_strvalue); free(*eap_packet_p); *eap_packet_p = NULL; eap_handler_free(inst, handler); return NULL; } } } handler->eap_ds = eap_buildds(eap_packet_p); if (handler->eap_ds == NULL) { free(*eap_packet_p); *eap_packet_p = NULL; eap_handler_free(inst, handler); return NULL; } handler->timestamp = request->timestamp; handler->request = request; /* LEAP needs this */ return handler; } freeradius-server/src/modules/rlm_eap/eap.h000066400000000000000000000105761257552170400213300ustar00rootroot00000000000000/* * eap.h Header file containing the interfaces for all EAP types. * * Version: $Id$ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2001 hereUare Communications, Inc. * Copyright 2003 Alan DeKok * Copyright 2006 The FreeRADIUS server project */ #ifndef _EAP_H #define _EAP_H #include RCSIDH(eap_h, "$Id$") #include #include #include #include "eap_types.h" /* * EAP_DS contains all the received/sending information * response = Received EAP packet * request = Sending EAP packet * * Note: We are authentication server, * we get ONLY EAP-Responses and * we send EAP-Request/EAP-success/EAP-failure */ typedef struct eap_ds { EAP_PACKET *response; EAP_PACKET *request; int set_request_id; } EAP_DS; /* * Currently there are only 2 types * of operations defined, * apart from attach & detach for each EAP-Type. */ typedef enum operation_t { INITIATE = 0, AUTHORIZE, AUTHENTICATE } operation_t; /* * EAP_HANDLER is the interface for any EAP-Type. * Each handler contains information for one specific EAP-Type. * This way we don't need to change any interfaces in future. * It is also a list of EAP-request handlers waiting for EAP-response * eap_id = copy of the eap packet we sent to the * * next = pointer to next * state = state attribute from the reply we sent * state_len = length of data in the state attribute. * src_ipaddr = client which sent us the RADIUS request containing * this EAP conversation. * eap_id = copy of EAP id we sent to the client. * timestamp = timestamp when this handler was last used. * identity = Identity, as obtained, from EAP-Identity response. * request = RADIUS request data structure * prev_eapds = Previous EAP request, for which eap_ds contains the response. * eap_ds = Current EAP response. * opaque = EAP-Type holds some data that corresponds to the current * EAP-request/response * free_opaque = To release memory held by opaque, * when this handler is timedout & needs to be deleted. * It is the responsibility of the specific EAP-TYPE * to avoid any memory leaks in opaque * Hence this pointer should be provided by the EAP-Type * if opaque is not NULL * status = finished/onhold/.. */ #define EAP_STATE_LEN (AUTH_VECTOR_LEN) typedef struct _eap_handler { struct _eap_handler *prev, *next; uint8_t state[EAP_STATE_LEN]; fr_ipaddr_t src_ipaddr; unsigned int eap_id; unsigned int eap_type; time_t timestamp; REQUEST *request; char *identity; /* User name from EAP-Identity */ EAP_DS *prev_eapds; EAP_DS *eap_ds; void *opaque; void (*free_opaque)(void *opaque); void *inst_holder; int status; int stage; int trips; int tls; int finished; VALUE_PAIR *certs; } EAP_HANDLER; /* * Interface to call EAP sub mdoules */ typedef struct eap_type_t { const char *name; int (*attach)(CONF_SECTION *conf, void **type_data); int (*initiate)(void *type_data, EAP_HANDLER *handler); int (*authorize)(void *type_data, EAP_HANDLER *handler); int (*authenticate)(void *type_data, EAP_HANDLER *handler); int (*detach)(void *type_data); } EAP_TYPE; #define REQUEST_DATA_EAP_HANDLER (1) #define REQUEST_DATA_EAP_TUNNEL_CALLBACK PW_EAP_MESSAGE #define REQUEST_DATA_EAP_MSCHAP_TUNNEL_CALLBACK ((PW_EAP_MESSAGE << 16) | PW_EAP_MSCHAPV2) #define RAD_REQUEST_OPTION_PROXY_EAP (1 << 16) /* * This is for tunneled callbacks */ typedef int (*eap_tunnel_callback_t)(EAP_HANDLER *handler, void *tls_session); typedef struct eap_tunnel_data_t { void *tls_session; eap_tunnel_callback_t callback; } eap_tunnel_data_t; #endif /*_EAP_H*/ freeradius-server/src/modules/rlm_eap/libeap/000077500000000000000000000000001257552170400216355ustar00rootroot00000000000000freeradius-server/src/modules/rlm_eap/libeap/Makefile000066400000000000000000000023241257552170400232760ustar00rootroot00000000000000# # Makefile # # Version: $Id$ # include ../../../../Make.inc SRCS = eapcommon.c eapcrypto.c eapsimlib.c fips186prf.c ifneq ($(OPENSSL_LIBS),) SRCS += cb.c eap_tls.c mppe_keys.c tls.c endif LT_OBJS = $(SRCS:.c=.lo) INCLUDES = eap_types.h eap_tls.h CFLAGS += -DEAPLIB -I. -I.. -I$(top_builddir)/src $(OPENSSL_INCLUDE) ifeq ($(USE_SHARED_LIBS),yes) LINK_MODE = -export-dynamic else LINK_MODE = -static endif TARGET = $(LIBPREFIX)freeradius-eap # Define new rule for libtool objects %.lo: %.c $(LIBTOOL) --mode=compile --tag=CC $(CC) $(CFLAGS) -c $< all: $(TARGET).la $(TARGET).la: $(LT_OBJS) $(LIBTOOL) --mode=link --tag=CC $(CC) -release $(RADIUSD_VERSION_STRING) \ $(LDFLAGS) $(LINK_MODE) -o $@ -rpath $(libdir) $^ \ $(LIBRADIUS) $(LIBS) @for x in .libs/* $^; do \ rm -f $(top_builddir)/src/modules/lib/$$x; \ ln -s $(top_builddir)/src/modules/rlm_eap/libeap/$$x $(top_builddir)/src/modules/lib/$$x; \ done $(LT_OBJS): $(INCLUDES) clean: rm -f *.o *.lo $(TARGET).la rm -rf .libs install: all $(LIBTOOL) --mode=install $(INSTALL) -c $(TARGET).la \ $(R)$(libdir)/$(TARGET).la rm -f $(R)$(libdir)/$(TARGET)-$(RADIUSD_VERSION_STRING).la; ln -s $(TARGET).la $(R)$(libdir)/$(TARGET)-$(RADIUSD_VERSION_STRING).la freeradius-server/src/modules/rlm_eap/libeap/cb.c000066400000000000000000000101311257552170400223610ustar00rootroot00000000000000/* * cb.c * * Version: $Id$ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2001 hereUare Communications, Inc. * Copyright 2006 The FreeRADIUS server project */ #include RCSID("$Id$") #include "eap_tls.h" #ifndef NO_OPENSSL void cbtls_info(const SSL *s, int where, int ret) { const char *str, *state; int w; EAP_HANDLER *handler = (EAP_HANDLER *)SSL_get_ex_data(s, 0); REQUEST *request = NULL; char buffer[1024]; if (handler) request = handler->request; w = where & ~SSL_ST_MASK; if (w & SSL_ST_CONNECT) str=" TLS_connect"; else if (w & SSL_ST_ACCEPT) str=" TLS_accept"; else str=" (other)"; state = SSL_state_string_long(s); state = state ? state : "NULL"; buffer[0] = '\0'; if (where & SSL_CB_LOOP) { RDEBUG2("%s: %s", str, state); } else if (where & SSL_CB_HANDSHAKE_START) { RDEBUG2("%s: %s", str, state); } else if (where & SSL_CB_HANDSHAKE_DONE) { RDEBUG2("%s: %s", str, state); } else if (where & SSL_CB_ALERT) { str=(where & SSL_CB_READ)?"read":"write"; snprintf(buffer, sizeof(buffer), "TLS Alert %s:%s:%s", str, SSL_alert_type_string_long(ret), SSL_alert_desc_string_long(ret)); } else if (where & SSL_CB_EXIT) { if (ret == 0) { snprintf(buffer, sizeof(buffer), "%s: failed in %s", str, state); } else if (ret < 0) { if (SSL_want_read(s)) { RDEBUG2("%s: Need to read more data: %s", str, state); } else { snprintf(buffer, sizeof(buffer), "%s: error in %s", str, state); } } } if (buffer[0]) { radlog(L_ERR, "%s", buffer); if (request) { VALUE_PAIR *vp; vp = pairmake("Module-Failure-Message", buffer, T_OP_ADD); if (vp) pairadd(&request->packet->vps, vp); } } } /* * Fill in our 'info' with TLS data. */ void cbtls_msg(int write_p, int msg_version, int content_type, const void *buf, size_t len, SSL *ssl UNUSED, void *arg) { tls_session_t *state = (tls_session_t *)arg; /* * Work around bug #298, where we may be called with a NULL * argument. We should really log a serious error */ if (!arg) return; state->info.origin = (unsigned char)write_p; state->info.content_type = (unsigned char)content_type; state->info.record_len = len; state->info.version = msg_version; state->info.initialized = 1; if (content_type == SSL3_RT_ALERT) { state->info.alert_level = ((const unsigned char*)buf)[0]; state->info.alert_description = ((const unsigned char*)buf)[1]; state->info.handshake_type = 0x00; } else if (content_type == SSL3_RT_HANDSHAKE) { state->info.handshake_type = ((const unsigned char*)buf)[0]; state->info.alert_level = 0x00; state->info.alert_description = 0x00; #ifdef SSL3_RT_HEARTBEAT } else if (content_type == TLS1_RT_HEARTBEAT) { uint8_t *p = buf; if ((len >= 3) && (p[0] == 1)) { size_t payload_len; payload_len = (p[1] << 8) | p[2]; if ((payload_len + 3) > len) { state->invalid_hb_used = TRUE; ERROR("OpenSSL Heartbeat attack detected. Closing connection"); return; } } #endif } tls_session_information(state); } int cbtls_password(char *buf, int num UNUSED, int rwflag UNUSED, void *userdata) { strcpy(buf, (char *)userdata); return(strlen((char *)userdata)); } /* * For callbacks */ int eaptls_handle_idx = -1; int eaptls_conf_idx = -1; int eaptls_store_idx = -1; /* OCSP Store */ int eaptls_session_idx = -1; #endif /* !defined(NO_OPENSSL) */ freeradius-server/src/modules/rlm_eap/libeap/eap_sim.h000066400000000000000000000112371257552170400234270ustar00rootroot00000000000000/* * eap_sim.h Header file containing the EAP-SIM types * * Version: $Id$ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2003 Michael Richardson * Copyright 2006 The FreeRADIUS server project * */ #ifndef _EAP_SIM_H #define _EAP_SIM_H #include RCSIDH(eap_sim_h, "$Id$") #include "eap_types.h" #define EAP_SIM_VERSION 0x0001 /* base for dictionary values */ #define ATTRIBUTE_EAP_SIM_BASE (6*256) #define ATTRIBUTE_EAP_SIM_SUBTYPE 1200 #define ATTRIBUTE_EAP_SIM_RAND1 1201 #define ATTRIBUTE_EAP_SIM_RAND2 1202 #define ATTRIBUTE_EAP_SIM_RAND3 1203 #define ATTRIBUTE_EAP_SIM_SRES1 1204 #define ATTRIBUTE_EAP_SIM_SRES2 1205 #define ATTRIBUTE_EAP_SIM_SRES3 1206 #define ATTRIBUTE_EAP_SIM_STATE 1207 #define ATTRIBUTE_EAP_SIM_IMSI 1208 #define ATTRIBUTE_EAP_SIM_HMAC 1209 #define ATTRIBUTE_EAP_SIM_KEY 1210 #define ATTRIBUTE_EAP_SIM_EXTRA 1211 #define ATTRIBUTE_EAP_SIM_KC1 1212 #define ATTRIBUTE_EAP_SIM_KC2 1213 #define ATTRIBUTE_EAP_SIM_KC3 1214 enum eapsim_subtype { eapsim_start = 10, eapsim_challenge = 11, eapsim_notification= 12, eapsim_reauth = 13, eapsim_client_error = 14, eapsim_max_subtype = 15 }; enum eapsim_clientstates { eapsim_client_init = 0, eapsim_client_start = 1, eapsim_client_maxstates }; /* server states * * in server_start, we send a EAP-SIM Start message. * */ enum eapsim_serverstates { eapsim_server_start = 0, eapsim_server_challenge=1, eapsim_server_success=10, eapsim_server_maxstates }; #define PW_EAP_SIM_RAND 1 #define PW_EAP_SIM_PADDING 6 #define PW_EAP_SIM_NONCE_MT 7 #define PW_EAP_SIM_PERMANENT_ID_REQ 10 #define PW_EAP_SIM_MAC 11 #define PW_EAP_SIM_NOTIFICATION 12 #define PW_EAP_SIM_ANY_ID_REQ 13 #define PW_EAP_SIM_IDENTITY 14 #define PW_EAP_SIM_VERSION_LIST 15 #define PW_EAP_SIM_SELECTED_VERSION 16 #define PW_EAP_SIM_FULLAUTH_ID_REQ 17 #define PW_EAP_SIM_COUNTER 19 #define PW_EAP_SIM_COUNTER_TOO_SMALL 20 #define PW_EAP_SIM_NONCE_S 21 #define PW_EAP_SIM_IV 129 #define PW_EAP_SIM_ENCR_DATA 130 #define PW_EAP_SIM_NEXT_PSEUDONUM 132 #define PW_EAP_SIM_NEXT_REAUTH_ID 133 #define PW_EAP_SIM_CHECKCODE 134 /* * interfaces in eapsimlib.c */ extern int map_eapsim_basictypes(RADIUS_PACKET *r, EAP_PACKET *ep); extern const char *sim_state2name(enum eapsim_clientstates state, char *buf, int buflen); extern const char *sim_subtype2name(enum eapsim_subtype subtype, char *buf, int buflen); extern int unmap_eapsim_basictypes(RADIUS_PACKET *r, uint8_t *attr, unsigned int attrlen); /************************/ /* CRYPTO FUNCTIONS */ /************************/ /* * key derivation functions/structures * */ #define EAPSIM_SRES_SIZE 4 #define EAPSIM_RAND_SIZE 16 #define EAPSIM_Kc_SIZE 8 #define EAPSIM_CALCMAC_SIZE 20 #define EAPSIM_NONCEMT_SIZE 16 #define EAPSIM_AUTH_SIZE 16 struct eapsim_keys { /* inputs */ unsigned char identity[MAX_STRING_LEN]; unsigned int identitylen; unsigned char nonce_mt[EAPSIM_NONCEMT_SIZE]; unsigned char rand[3][EAPSIM_RAND_SIZE]; unsigned char sres[3][EAPSIM_SRES_SIZE]; unsigned char Kc[3][EAPSIM_Kc_SIZE]; unsigned char versionlist[MAX_STRING_LEN]; unsigned char versionlistlen; unsigned char versionselect[2]; /* outputs */ unsigned char master_key[20]; unsigned char K_aut[EAPSIM_AUTH_SIZE]; unsigned char K_encr[16]; unsigned char msk[64]; unsigned char emsk[64]; }; /* * interfaces in eapsimlib.c */ extern int eapsim_checkmac(VALUE_PAIR *rvps, uint8_t key[8], uint8_t *extra, int extralen, uint8_t calcmac[20]); /* * in eapcrypto.c */ extern void eapsim_calculate_keys(struct eapsim_keys *ek); extern void eapsim_dump_mk(struct eapsim_keys *ek); #endif /* _EAP_SIM_H */ freeradius-server/src/modules/rlm_eap/libeap/eap_tls.c000066400000000000000000000726601257552170400234430ustar00rootroot00000000000000/* * eap_tls.c * * Version: $Id$ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2001 hereUare Communications, Inc. * Copyright 2003 Alan DeKok * Copyright 2006 The FreeRADIUS server project */ /* * * TLS Packet Format in EAP * --- ------ ------ -- --- * 0 1 2 3 * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | Code | Identifier | Length | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | Type | Flags | TLS Message Length * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | TLS Message Length | TLS Data... * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * */ #include RCSID("$Id$") #include #include #include "eap_tls.h" /* * Allocate a new TLS_PACKET */ EAPTLS_PACKET *eaptls_alloc(void) { EAPTLS_PACKET *rp; if ((rp = malloc(sizeof(EAPTLS_PACKET))) == NULL) { radlog(L_ERR, "rlm_eap_tls: out of memory"); return NULL; } memset(rp, 0, sizeof(EAPTLS_PACKET)); return rp; } /* * Free EAPTLS_PACKET */ void eaptls_free(EAPTLS_PACKET **eaptls_packet_ptr) { EAPTLS_PACKET *eaptls_packet; if (!eaptls_packet_ptr) return; eaptls_packet = *eaptls_packet_ptr; if (eaptls_packet == NULL) return; if (eaptls_packet->data) { free(eaptls_packet->data); eaptls_packet->data = NULL; } free(eaptls_packet); *eaptls_packet_ptr = NULL; } /* The S flag is set only within the EAP-TLS start message sent from the EAP server to the peer. */ int eaptls_start(EAP_DS *eap_ds, int peap_flag) { EAPTLS_PACKET reply; reply.code = EAPTLS_START; reply.length = TLS_HEADER_LEN + 1/*flags*/; reply.flags = peap_flag; reply.flags = SET_START(reply.flags); reply.data = NULL; reply.dlen = 0; eaptls_compose(eap_ds, &reply); return 1; } int eaptls_success(EAP_HANDLER *handler, int peap_flag) { EAPTLS_PACKET reply; VALUE_PAIR *vp, *vps = NULL; REQUEST *request = handler->request; tls_session_t *tls_session = handler->opaque; handler->finished = TRUE; reply.code = EAPTLS_SUCCESS; reply.length = TLS_HEADER_LEN; reply.flags = peap_flag; reply.data = NULL; reply.dlen = 0; /* * If there's no session resumption, delete the entry * from the cache. This means either it's disabled * globally for this SSL context, OR we were told to * disable it for this user. * * This also means you can't turn it on just for one * user. */ if ((!tls_session->allow_session_resumption) || (((vp = pairfind(request->config_items, 1127)) != NULL) && (vp->vp_integer == 0))) { SSL_CTX_remove_session(tls_session->ctx, tls_session->ssl->session); tls_session->allow_session_resumption = 0; /* * If we're in a resumed session and it's * not allowed, */ if (SSL_session_reused(tls_session->ssl)) { RDEBUG("FAIL: Forcibly stopping session resumption as it is not allowed."); return eaptls_fail(handler, peap_flag); } /* * Else resumption IS allowed, so we store the * user data in the cache. */ } else if (!SSL_session_reused(tls_session->ssl)) { RDEBUG2("Saving response in the cache"); vp = paircopy2(request->reply->vps, PW_USER_NAME); if (vp) pairadd(&vps, vp); vp = paircopy2(request->packet->vps, PW_STRIPPED_USER_NAME); if (vp) pairadd(&vps, vp); vp = paircopy2(request->reply->vps, PW_CHARGEABLE_USER_IDENTITY); if (vp) pairadd(&vps, vp); vp = paircopy2(request->reply->vps, PW_CACHED_SESSION_POLICY); if (vp) pairadd(&vps, vp); if (handler->certs) { pairadd(&vps, paircopy(handler->certs)); pairadd(&request->packet->vps, paircopy(handler->certs)); } if (vps) { SSL_SESSION_set_ex_data(tls_session->ssl->session, eaptls_session_idx, vps); } else { RDEBUG2("WARNING: No information to cache: session caching will be disabled for this session."); SSL_CTX_remove_session(tls_session->ctx, tls_session->ssl->session); } /* * Else the session WAS allowed. Copy the cached * reply. */ } else { vps = SSL_SESSION_get_ex_data(tls_session->ssl->session, eaptls_session_idx); if (!vps) { RDEBUG("WARNING: No information in cached session!"); return eaptls_fail(handler, peap_flag); } else { RDEBUG("Adding cached attributes:"); debug_pair_list(vps); for (vp = vps; vp != NULL; vp = vp->next) { /* * TLS-* attrs get added back to * the request list. */ if ((vp->attribute >= 1910) && (vp->attribute < 1929)) { pairadd(&request->packet->vps, paircopyvp(vp)); } else { pairadd(&request->reply->vps, paircopyvp(vp)); } } /* * Mark the request as resumed. */ vp = pairmake("EAP-Session-Resumed", "1", T_OP_SET); if (vp) pairadd(&request->packet->vps, vp); } } /* * Call compose AFTER checking for cached data. */ eaptls_compose(handler->eap_ds, &reply); /* * Automatically generate MPPE keying material. */ if (tls_session->prf_label) { eaptls_gen_mppe_keys(&handler->request->reply->vps, tls_session->ssl, tls_session->prf_label); } else { RDEBUG("WARNING: Not adding MPPE keys because there is no PRF label"); } eaptls_gen_eap_key(tls_session->ssl, handler->eap_type, &handler->request->reply->vps); return 1; } int eaptls_fail(EAP_HANDLER *handler, int peap_flag) { EAPTLS_PACKET reply; tls_session_t *tls_session = handler->opaque; handler->finished = TRUE; reply.code = EAPTLS_FAIL; reply.length = TLS_HEADER_LEN; reply.flags = peap_flag; reply.data = NULL; reply.dlen = 0; /* * Force the session to NOT be cached. */ SSL_CTX_remove_session(tls_session->ctx, tls_session->ssl->session); eaptls_compose(handler->eap_ds, &reply); return 1; } /* A single TLS record may be up to 16384 octets in length, but a TLS message may span multiple TLS records, and a TLS certificate message may in principle be as long as 16MB. */ /* * Frame the Dirty data that needs to be send to the client in an * EAP-Request. We always embed the TLS-length in all EAP-TLS * packets that we send, for easy reference purpose. Handle * fragmentation and sending the next fragment etc. */ int eaptls_request(EAP_DS *eap_ds, tls_session_t *ssn) { EAPTLS_PACKET reply; unsigned int size; unsigned int nlen; unsigned int lbit = 0; /* This value determines whether we set (L)ength flag for EVERY packet we send and add corresponding "TLS Message Length" field. length_flag = TRUE; This means we include L flag and "TLS Msg Len" in EVERY packet we send out. length_flag = FALSE; This means we include L flag and "TLS Msg Len" **ONLY** in First packet of a fragment series. We do not use it anywhere else. Having L flag in every packet is prefered. */ if (ssn->length_flag) { lbit = 4; } if (ssn->fragment == 0) { ssn->tls_msg_len = ssn->dirty_out.used; } reply.code = EAPTLS_REQUEST; reply.flags = ssn->peap_flag; /* Send data, NOT more than the FRAGMENT size */ if (ssn->dirty_out.used > ssn->offset) { size = ssn->offset; reply.flags = SET_MORE_FRAGMENTS(reply.flags); /* Length MUST be included if it is the First Fragment */ if (ssn->fragment == 0) { lbit = 4; } ssn->fragment = 1; } else { size = ssn->dirty_out.used; ssn->fragment = 0; } reply.dlen = lbit + size; reply.length = TLS_HEADER_LEN + 1/*flags*/ + reply.dlen; reply.data = malloc(reply.dlen); if (lbit) { nlen = htonl(ssn->tls_msg_len); memcpy(reply.data, &nlen, lbit); reply.flags = SET_LENGTH_INCLUDED(reply.flags); } (ssn->record_minus)(&ssn->dirty_out, reply.data + lbit, size); eaptls_compose(eap_ds, &reply); free(reply.data); reply.data = NULL; return 1; } /* * Acknowledge received is for one of the following messages sent earlier * 1. Handshake completed Message, so now send, EAP-Success * 2. Alert Message, now send, EAP-Failure * 3. Fragment Message, now send, next Fragment */ static eaptls_status_t eaptls_ack_handler(EAP_HANDLER *handler) { tls_session_t *tls_session; REQUEST *request = handler->request; tls_session = (tls_session_t *)handler->opaque; if (tls_session == NULL){ radlog_request(L_ERR, 0, request, "FAIL: Unexpected ACK received. Could not obtain session information."); return EAPTLS_FAIL; } if (tls_session->info.initialized == 0) { RDEBUG("No SSL info available. Waiting for more SSL data."); return EAPTLS_REQUEST; } if ((tls_session->info.content_type == handshake) && (tls_session->info.origin == 0)) { radlog_request(L_ERR, 0, request, "FAIL: ACK without earlier message."); return EAPTLS_FAIL; } switch (tls_session->info.content_type) { case alert: RDEBUG2("ACK alert"); eaptls_fail(handler, tls_session->peap_flag); return EAPTLS_FAIL; case handshake: if ((tls_session->info.handshake_type == finished) && (tls_session->dirty_out.used == 0)) { RDEBUG2("ACK handshake is finished"); /* * From now on all the content is * application data set it here as nobody else * sets it. */ tls_session->info.content_type = application_data; return EAPTLS_SUCCESS; } /* else more data to send */ RDEBUG2("ACK handshake fragment handler"); /* Fragmentation handler, send next fragment */ return EAPTLS_REQUEST; case application_data: RDEBUG2("ACK handshake fragment handler in application data"); return EAPTLS_REQUEST; /* * For the rest of the conditions, switch over * to the default section below. */ default: RDEBUG2("ACK default"); radlog_request(L_ERR, 0, request, "Invalid ACK received: %d", tls_session->info.content_type); return EAPTLS_FAIL; } } /* * Similarly, when the EAP server receives an EAP-Response with * the M bit set, it MUST respond with an EAP-Request with * EAP-Type=EAP-TLS and no data. This serves as a fragment ACK. * * In order to prevent errors in the processing of fragments, the * EAP server MUST use increment the Identifier value for each * fragment ACK contained within an EAP-Request, and the peer * MUST include this Identifier value in the subsequent fragment * contained within an EAP- Reponse. * * EAP server sends an ACK when it determines there are More * fragments to receive to make the complete * TLS-record/TLS-Message */ static int eaptls_send_ack(EAP_DS *eap_ds, int peap_flag) { EAPTLS_PACKET reply; reply.code = EAPTLS_ACK; reply.length = TLS_HEADER_LEN + 1/*flags*/; reply.flags = peap_flag; reply.data = NULL; reply.dlen = 0; eaptls_compose(eap_ds, &reply); return 1; } /* * The S flag is set only within the EAP-TLS start message sent * from the EAP server to the peer. * * Similarly, when the EAP server receives an EAP-Response with * the M bit set, it MUST respond with an EAP-Request with * EAP-Type=EAP-TLS and no data. This serves as a fragment * ACK. The EAP peer MUST wait. */ static eaptls_status_t eaptls_verify(EAP_HANDLER *handler) { EAP_DS *eap_ds = handler->eap_ds; EAP_DS *prev_eap_ds = handler->prev_eapds; eaptls_packet_t *eaptls_packet, *eaptls_prev = NULL; REQUEST *request = handler->request; /* * We don't check ANY of the input parameters. It's all * code which works together, so if something is wrong, * we SHOULD core dump. * * e.g. if eap_ds is NULL, of if eap_ds->response is * NULL, of if it's NOT an EAP-Response, or if the packet * is too short. See eap_validation()., in ../../eap.c * * Also, eaptype_select() takes care of selecting the * appropriate type, so we don't need to check * eap_ds->response->type.type == PW_EAP_TLS, or anything * else. */ eaptls_packet = (eaptls_packet_t *)eap_ds->response->type.data; if (prev_eap_ds && prev_eap_ds->response) eaptls_prev = (eaptls_packet_t *)prev_eap_ds->response->type.data; /* * check for ACK * * If there's no TLS data, or there's 1 byte of TLS data, * with the flags set to zero, then it's an ACK. * * Find if this is a reply to the previous request sent */ if ((eaptls_packet == NULL) || ((eap_ds->response->length == EAP_HEADER_LEN + 2) && ((eaptls_packet->flags & 0xc0) == 0x00))) { #if 0 /* * Un-comment this for TLS inside of TTLS/PEAP */ RDEBUG2("Received EAP-TLS ACK message"); return eaptls_ack_handler(handler); #else if (prev_eap_ds && (prev_eap_ds->request->id == eap_ds->response->id)) { /* * Run the ACK handler directly from here. */ RDEBUG2("Received TLS ACK"); return eaptls_ack_handler(handler); } else { radlog_request(L_ERR, 0, request, "Received Invalid TLS ACK"); return EAPTLS_INVALID; } #endif } /* * We send TLS_START, but do not receive it. */ if (TLS_START(eaptls_packet->flags)) { RDEBUG("Received unexpected EAP-TLS Start message"); return EAPTLS_INVALID; } /* * The L bit (length included) is set to indicate the * presence of the four octet TLS Message Length field, * and MUST be set for the first fragment of a fragmented * TLS message or set of messages. * * The M bit (more fragments) is set on all but the last * fragment. * * The S bit (EAP-TLS start) is set in an EAP-TLS Start * message. This differentiates the EAP-TLS Start message * from a fragment acknowledgement. */ if (TLS_LENGTH_INCLUDED(eaptls_packet->flags)) { DEBUG2(" TLS Length %d", eaptls_packet->data[2] * 256 | eaptls_packet->data[3]); if (TLS_MORE_FRAGMENTS(eaptls_packet->flags)) { /* * FIRST_FRAGMENT is identified * 1. If there is no previous EAP-response received. * 2. If EAP-response received, then its M bit not set. * (It is because Last fragment will not have M bit set) */ if (!prev_eap_ds || (prev_eap_ds->response == NULL) || (eaptls_prev == NULL) || !TLS_MORE_FRAGMENTS(eaptls_prev->flags)) { RDEBUG2("Received EAP-TLS First Fragment of the message"); return EAPTLS_FIRST_FRAGMENT; } else { RDEBUG2("More Fragments with length included"); return EAPTLS_MORE_FRAGMENTS_WITH_LENGTH; } } else { RDEBUG2("Length Included"); return EAPTLS_LENGTH_INCLUDED; } } if (TLS_MORE_FRAGMENTS(eaptls_packet->flags)) { RDEBUG2("More fragments to follow"); return EAPTLS_MORE_FRAGMENTS; } /* * None of the flags are set, but it's still a valid * EAPTLS packet. */ return EAPTLS_OK; } /* * EAPTLS_PACKET * code = EAP-code * id = EAP-id * length = code + id + length + flags + tlsdata * = 1 + 1 + 2 + 1 + X * length = EAP-length - 1(EAP-Type = 1 octet) * flags = EAP-typedata[0] (1 octet) * dlen = EAP-typedata[1-4] (4 octets), if L flag set * = length - 5(code+id+length+flags), otherwise * data = EAP-typedata[5-n], if L flag set * = EAP-typedata[1-n], otherwise * packet = EAP-typedata (complete typedata) * * Points to consider during EAP-TLS data extraction * 1. In the received packet, No data will be present incase of ACK-NAK * 2. Incase if more fragments need to be received then ACK after retreiving this fragment. * * RFC 2716 Section 4.2. PPP EAP TLS Request Packet * * 0 1 2 3 * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | Code | Identifier | Length | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | Type | Flags | TLS Message Length * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | TLS Message Length | TLS Data... * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * * The Length field is two octets and indicates the length of the EAP * packet including the Code, Identifir, Length, Type, and TLS data * fields. */ static EAPTLS_PACKET *eaptls_extract(REQUEST *request, EAP_DS *eap_ds, eaptls_status_t status) { EAPTLS_PACKET *tlspacket; uint32_t data_len = 0; uint32_t len = 0; uint8_t *data = NULL; if (status == EAPTLS_INVALID) return NULL; /* * The main EAP code & eaptls_verify() take care of * ensuring that the packet is OK, and that we can * extract the various fields we want. * * e.g. a TLS packet with zero data is allowed as an ACK, * but we will never see it here, as we will simply * send another fragment, instead of trying to extract * the data. * * MUST have TLS type octet, followed by flags, followed * by data. */ assert(eap_ds->response->length > 2); tlspacket = eaptls_alloc(); if (tlspacket == NULL) return NULL; /* * Code & id for EAPTLS & EAP are same * but eaptls_length = eap_length - 1(EAP-Type = 1 octet) * * length = code + id + length + type + tlsdata * = 1 + 1 + 2 + 1 + X */ tlspacket->code = eap_ds->response->code; tlspacket->id = eap_ds->response->id; tlspacket->length = eap_ds->response->length - 1; /* EAP type */ tlspacket->flags = eap_ds->response->type.data[0]; /* * A quick sanity check of the flags. If we've been told * that there's a length, and there isn't one, then stop. */ if (TLS_LENGTH_INCLUDED(tlspacket->flags) && (tlspacket->length < 5)) { /* flags + TLS message length */ RDEBUG("Invalid EAP-TLS packet received. (Length bit is set, but no length was found.)"); eaptls_free(&tlspacket); return NULL; } /* * If the final TLS packet is larger than we can handle, die * now. * * Likewise, if the EAP packet says N bytes, and the TLS * packet says there's fewer bytes, it's a problem. * * FIXME: Try to ensure that the claimed length is * consistent across multiple TLS fragments. */ if (TLS_LENGTH_INCLUDED(tlspacket->flags)) { memcpy(&data_len, &eap_ds->response->type.data[1], 4); data_len = ntohl(data_len); if (data_len > MAX_RECORD_SIZE) { RDEBUG("The EAP-TLS packet will contain more data than we can process."); eaptls_free(&tlspacket); return NULL; } #if 0 DEBUG2(" TLS: %d %d\n", data_len, tlspacket->length); if (data_len < tlspacket->length) { RDEBUG("EAP-TLS packet claims to be smaller than the encapsulating EAP packet."); eaptls_free(&tlspacket); return NULL; } #endif } switch (status) { /* * The TLS Message Length field is four octets, and * provides the total length of the TLS message or set of * messages that is being fragmented; this simplifies * buffer allocation. * * Dynamic allocation of buffers as & when we know the * length should solve the problem. */ case EAPTLS_FIRST_FRAGMENT: case EAPTLS_LENGTH_INCLUDED: case EAPTLS_MORE_FRAGMENTS_WITH_LENGTH: if (tlspacket->length < 5) { /* flags + TLS message length */ RDEBUG("Invalid EAP-TLS packet received. (Expected length, got none.)"); eaptls_free(&tlspacket); return NULL; } /* * Extract all the TLS fragments from the * previous eap_ds Start appending this * fragment to the above ds */ memcpy(&data_len, &eap_ds->response->type.data[1], sizeof(uint32_t)); data_len = ntohl(data_len); data = (eap_ds->response->type.data + 5/*flags+TLS-Length*/); len = eap_ds->response->type.length - 5/*flags+TLS-Length*/; /* * Hmm... this should be an error, too. */ if (data_len > len) { data_len = len; } break; /* * Data length is implicit, from the EAP header. */ case EAPTLS_MORE_FRAGMENTS: case EAPTLS_OK: data_len = eap_ds->response->type.length - 1/*flags*/; data = eap_ds->response->type.data + 1/*flags*/; break; default: RDEBUG("Invalid EAP-TLS packet received"); eaptls_free(&tlspacket); return NULL; } tlspacket->dlen = data_len; if (data_len) { tlspacket->data = (unsigned char *)malloc(data_len); if (tlspacket->data == NULL) { RDEBUG("out of memory"); eaptls_free(&tlspacket); return NULL; } memcpy(tlspacket->data, data, data_len); } return tlspacket; } /* * To process the TLS, * INCOMING DATA: * 1. EAP-TLS should get the compelete TLS data from the peer. * 2. Store that data in a data structure with any other required info * 3. Handle that data structure to the TLS module. * 4. TLS module will perform its operations on the data and * handle back to EAP-TLS * * OUTGOING DATA: * 1. EAP-TLS if necessary will fragment it and send it to the * destination. * * During EAP-TLS initialization, TLS Context object will be * initialized and stored. For every new authentication * requests, TLS will open a new session object and that session * object should be maintained even after the session is * completed for session resumption. (Probably later as a feature * as we donot know who maintains these session objects ie, * SSL_CTX (internally) or TLS module(explicitly). If TLS module, * then how to let SSL API know about these sessions.) */ static eaptls_status_t eaptls_operation(eaptls_status_t status, EAP_HANDLER *handler) { tls_session_t *tls_session; tls_session = (tls_session_t *)handler->opaque; if ((status == EAPTLS_MORE_FRAGMENTS) || (status == EAPTLS_MORE_FRAGMENTS_WITH_LENGTH) || (status == EAPTLS_FIRST_FRAGMENT)) { /* * Send the ACK. */ eaptls_send_ack(handler->eap_ds, tls_session->peap_flag); return EAPTLS_HANDLED; } /* * We have the complete TLS-data or TLS-message. * * Clean the dirty message. * * Authenticate the user and send * Success/Failure. * * If more info * is required then send another request. */ if (!tls_handshake_recv(handler->request, tls_session)) { DEBUG2("TLS receive handshake failed during operation"); SSL_CTX_remove_session(tls_session->ctx, tls_session->ssl->session); return EAPTLS_FAIL; } /* * FIXME: return success/fail. * * TLS proper can decide what to do, then. */ if (tls_session->dirty_out.used > 0) { eaptls_request(handler->eap_ds, tls_session); return EAPTLS_HANDLED; } /* * If there is no data to send i.e * dirty_out.used <=0 and if the SSL * handshake is finished, then return a * EPTLS_SUCCESS */ if (SSL_is_init_finished(tls_session->ssl)) { /* * Init is finished. The rest is * application data. */ tls_session->info.content_type = application_data; return EAPTLS_SUCCESS; } /* * Who knows what happened... */ DEBUG2("TLS failed during operation"); return EAPTLS_FAIL; } /* * In the actual authentication first verify the packet and then create the data structure */ /* * To process the TLS, * INCOMING DATA: * 1. EAP-TLS should get the compelete TLS data from the peer. * 2. Store that data in a data structure with any other required info * 3. Hand this data structure to the TLS module. * 4. TLS module will perform its operations on the data and hands back to EAP-TLS * OUTGOING DATA: * 1. EAP-TLS if necessary will fragment it and send it to the destination. * * During EAP-TLS initialization, TLS Context object will be * initialized and stored. For every new authentication * requests, TLS will open a new session object and that * session object SHOULD be maintained even after the session * is completed, for session resumption. (Probably later as a * feature, as we do not know who maintains these session * objects ie, SSL_CTX (internally) or TLS module (explicitly). If * TLS module, then how to let SSL API know about these * sessions.) */ /* * Process an EAP request */ eaptls_status_t eaptls_process(EAP_HANDLER *handler) { tls_session_t *tls_session = (tls_session_t *) handler->opaque; EAPTLS_PACKET *tlspacket; eaptls_status_t status; REQUEST *request = handler->request; RDEBUG2("processing EAP-TLS"); if (handler->certs) pairadd(&request->packet->vps, paircopy(handler->certs)); /* This case is when SSL generates Alert then we * send that alert to the client and then send the EAP-Failure */ status = eaptls_verify(handler); RDEBUG2("eaptls_verify returned %d\n", status); switch (status) { default: case EAPTLS_INVALID: case EAPTLS_FAIL: /* * Success means that we're done the initial * handshake. For TTLS, this means send stuff * back to the client, and the client sends us * more tunneled data. */ case EAPTLS_SUCCESS: return status; break; /* * Normal TLS request, continue with the "get rest * of fragments" phase. */ case EAPTLS_REQUEST: eaptls_request(handler->eap_ds, tls_session); return EAPTLS_HANDLED; break; /* * The handshake is done, and we're in the "tunnel * data" phase. */ case EAPTLS_OK: RDEBUG2("Done initial handshake"); /* * Get the rest of the fragments. */ case EAPTLS_FIRST_FRAGMENT: case EAPTLS_MORE_FRAGMENTS: case EAPTLS_LENGTH_INCLUDED: case EAPTLS_MORE_FRAGMENTS_WITH_LENGTH: break; } /* * Extract the TLS packet from the buffer. */ if ((tlspacket = eaptls_extract(request, handler->eap_ds, status)) == NULL) return EAPTLS_FAIL; /* * Get the session struct from the handler * * update the dirty_in buffer * * NOTE: This buffer will contain partial data when M bit is set. * * CAUTION while reinitializing this buffer, it should be * reinitialized only when this M bit is NOT set. */ if (tlspacket->dlen != (tls_session->record_plus)(&tls_session->dirty_in, tlspacket->data, tlspacket->dlen)) { eaptls_free(&tlspacket); RDEBUG("Exceeded maximum record size"); return EAPTLS_FAIL; } /* * No longer needed. */ eaptls_free(&tlspacket); /* * SSL initalization is done. Return. * * The TLS data will be in the tls_session structure. */ if (SSL_is_init_finished(tls_session->ssl)) { int err; /* * The initialization may be finished, but if * there more fragments coming, then send ACK, * and get the caller to continue the * conversation. */ if ((status == EAPTLS_MORE_FRAGMENTS) || (status == EAPTLS_MORE_FRAGMENTS_WITH_LENGTH) || (status == EAPTLS_FIRST_FRAGMENT)) { /* * Send the ACK. */ eaptls_send_ack(handler->eap_ds, tls_session->peap_flag); RDEBUG2("Init is done, but tunneled data is fragmented"); return EAPTLS_HANDLED; } /* * Decrypt the complete record. */ BIO_write(tls_session->into_ssl, tls_session->dirty_in.data, tls_session->dirty_in.used); /* * Clear the dirty buffer now that we are done with it * and init the clean_out buffer to store decrypted data */ (tls_session->record_init)(&tls_session->dirty_in); (tls_session->record_init)(&tls_session->clean_out); /* * Read (and decrypt) the tunneled data from the * SSL session, and put it into the decrypted * data buffer. */ err = SSL_read(tls_session->ssl, tls_session->clean_out.data, sizeof(tls_session->clean_out.data)); if (err < 0) { RDEBUG("SSL_read Error"); switch (SSL_get_error(tls_session->ssl, err)) { case SSL_ERROR_WANT_READ: case SSL_ERROR_WANT_WRITE: RDEBUG("Error in fragmentation logic"); break; default: /* * FIXME: Call int_ssl_check? */ break; } return EAPTLS_FAIL; } if (err == 0) { RDEBUG("WARNING: No data inside of the tunnel."); } /* * Passed all checks, successfully decrypted data */ tls_session->clean_out.used = err; return EAPTLS_OK; } /* * Continue the handshake. */ return eaptls_operation(status, handler); } /* * compose the TLS reply packet in the EAP reply typedata */ int eaptls_compose(EAP_DS *eap_ds, EAPTLS_PACKET *reply) { uint8_t *ptr; /* * Don't set eap_ds->request->type.type, as the main EAP * handler will do that for us. This allows the TLS * module to be called from TTLS & PEAP. */ /* * When the EAP server receives an EAP-Response with the * M bit set, it MUST respond with an EAP-Request with * EAP-Type=EAP-TLS and no data. This serves as a * fragment ACK. The EAP peer MUST wait until it receives * the EAP-Request before sending another fragment. * * In order to prevent errors in the processing of * fragments, the EAP server MUST use increment the * Identifier value for each fragment ACK contained * within an EAP-Request, and the peer MUST include this * Identifier value in the subsequent fragment contained * within an EAP- Reponse. */ eap_ds->request->type.data = malloc(reply->length - TLS_HEADER_LEN + 1); if (eap_ds->request->type.data == NULL) { radlog(L_ERR, "out of memory"); return 0; } /* EAPTLS Header length is excluded while computing EAP typelen */ eap_ds->request->type.length = reply->length - TLS_HEADER_LEN; ptr = eap_ds->request->type.data; *ptr++ = (uint8_t)(reply->flags & 0xFF); if (reply->dlen) memcpy(ptr, reply->data, reply->dlen); switch (reply->code) { case EAPTLS_ACK: case EAPTLS_START: case EAPTLS_REQUEST: eap_ds->request->code = PW_EAP_REQUEST; break; case EAPTLS_SUCCESS: eap_ds->request->code = PW_EAP_SUCCESS; break; case EAPTLS_FAIL: eap_ds->request->code = PW_EAP_FAILURE; break; default: /* Should never enter here */ eap_ds->request->code = PW_EAP_FAILURE; break; } return 1; } freeradius-server/src/modules/rlm_eap/libeap/eap_tls.h000066400000000000000000000243551257552170400234460ustar00rootroot00000000000000/* * eap_tls.h * * Version: $Id$ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2001 hereUare Communications, Inc. * Copyright 2003 Alan DeKok * Copyright 2006 The FreeRADIUS server project */ #ifndef _EAP_TLS_H #define _EAP_TLS_H #include RCSIDH(eap_tls_h, "$Id$") #include #include #include #include #include #include #include #include #include #include #include #include #include #include #ifdef HAVE_LIMITS_H #include #endif #ifdef HAVE_UNISTD_H #include #endif #ifndef NO_OPENSSL /* * For RH 9, which apparently needs this. */ #ifndef OPENSSL_NO_KRB5 #define OPENSSL_NO_KRB5 #endif #include #ifdef HAVE_OPENSSL_ENGINE_H #include #endif #include #endif /* !defined(NO_OPENSSL) */ #include "eap.h" typedef enum { EAPTLS_INVALID = 0, /* invalid, don't reply */ EAPTLS_REQUEST, /* request, ok to send, invalid to receive */ EAPTLS_RESPONSE, /* response, ok to receive, invalid to send */ EAPTLS_SUCCESS, /* success, send success */ EAPTLS_FAIL, /* fail, send fail */ EAPTLS_NOOP, /* noop, continue */ EAPTLS_START, /* start, ok to send, invalid to receive */ EAPTLS_OK, /* ok, continue */ EAPTLS_ACK, /* acknowledge, continue */ EAPTLS_FIRST_FRAGMENT, /* first fragment */ EAPTLS_MORE_FRAGMENTS, /* more fragments, to send/receive */ EAPTLS_LENGTH_INCLUDED, /* length included */ EAPTLS_MORE_FRAGMENTS_WITH_LENGTH, /* more fragments with length */ EAPTLS_HANDLED /* tls code has handled it */ } eaptls_status_t; #define MAX_RECORD_SIZE 16384 /* * A single TLS record may be up to 16384 octets in length, but a * TLS message may span multiple TLS records, and a TLS * certificate message may in principle be as long as 16MB. * * However, note that in order to protect against reassembly * lockup and denial of service attacks, it may be desirable for * an implementation to set a maximum size for one such group of * TLS messages. * * The TLS Message Length field is four octets, and provides the * total length of the TLS message or set of messages that is * being fragmented; this simplifies buffer allocation. */ /* * FIXME: Dynamic allocation of buffer to overcome MAX_RECORD_SIZE overflows. * or configure TLS not to exceed MAX_RECORD_SIZE. */ typedef struct _record_t { unsigned char data[MAX_RECORD_SIZE]; unsigned int used; } record_t; typedef struct _tls_info_t { unsigned char origin; unsigned char content_type; unsigned char handshake_type; unsigned char alert_level; unsigned char alert_description; char info_description[256]; size_t record_len; int version; char initialized; } tls_info_t; /* * tls_session_t Structure gets stored as opaque in EAP_HANDLER * This contains EAP-REQUEST specific data * (ie EAPTLS_DATA(fragment), EAPTLS-ALERT, EAPTLS-REQUEST ...) * * clean_in - data that needs to be sent but only after it is soiled. * dirty_in - data EAP server receives. * clean_out - data that is cleaned after receiving. * dirty_out - data EAP server sends. * offset - current fragment size transmitted * fragment - Flag, In fragment mode or not. * tls_msg_len - Actual/Total TLS message length. * length_flag - A flag to include length in every TLS Data/Alert packet * if set to no then only the first fragment contains length */ typedef struct _tls_session_t { SSL_CTX *ctx; SSL *ssl; tls_info_t info; BIO *into_ssl; BIO *from_ssl; record_t clean_in; record_t clean_out; record_t dirty_in; record_t dirty_out; void (*record_init)(record_t *buf); void (*record_close)(record_t *buf); unsigned int (*record_plus)(record_t *buf, const void *ptr, unsigned int size); unsigned int (*record_minus)(record_t *buf, void *ptr, unsigned int size); int invalid_hb_used; /* * Framed-MTU attribute in RADIUS, * if present, can also be used to set this */ unsigned int offset; unsigned int tls_msg_len; int fragment; int length_flag; int peap_flag; /* * Used by TTLS & PEAP to keep track of other per-session * data. */ void *opaque; void (*free_opaque)(void *opaque); const char *prf_label; int allow_session_resumption; } tls_session_t; /* * Externally exported TLS functions. */ eaptls_status_t eaptls_process(EAP_HANDLER *handler); int eaptls_success(EAP_HANDLER *handler, int peap_flag); int eaptls_fail(EAP_HANDLER *handler, int peap_flag); int eaptls_request(EAP_DS *eap_ds, tls_session_t *ssn); /* MPPE key generation */ void eaptls_gen_mppe_keys(VALUE_PAIR **reply_vps, SSL *s, const char *prf_label); void eapttls_gen_challenge(SSL *s, uint8_t *buffer, size_t size); void eaptls_gen_eap_key(SSL *s, uint32_t header, VALUE_PAIR **vps); #define BUFFER_SIZE 1024 #define EAP_TLS_START 1 #define EAP_TLS_ACK 2 #define EAP_TLS_SUCCESS 3 #define EAP_TLS_FAIL 4 #define EAP_TLS_ALERT 9 #define TLS_HEADER_LEN 4 /* * RFC 2716, Section 4.2: * * Flags * * 0 1 2 3 4 5 6 7 8 * +-+-+-+-+-+-+-+-+ * |L M S R R R R R| * +-+-+-+-+-+-+-+-+ * * L = Length included * M = More fragments * S = EAP-TLS start * R = Reserved */ #define TLS_START(x) (((x) & 0x20) != 0) #define TLS_MORE_FRAGMENTS(x) (((x) & 0x40) != 0) #define TLS_LENGTH_INCLUDED(x) (((x) & 0x80) != 0) #define TLS_CHANGE_CIPHER_SPEC(x) (((x) & 0x0014) == 0x0014) #define TLS_ALERT(x) (((x) & 0x0015) == 0x0015) #define TLS_HANDSHAKE(x) (((x) & 0x0016) == 0x0016) #define SET_START(x) ((x) | (0x20)) #define SET_MORE_FRAGMENTS(x) ((x) | (0x40)) #define SET_LENGTH_INCLUDED(x) ((x) | (0x80)) /* * Following enums from rfc2246 * * Hmm... since we dpeend on OpenSSL, it would be smarter to * use the OpenSSL names for these. */ enum ContentType { change_cipher_spec = 20, alert = 21, handshake = 22, application_data = 23 }; enum AlertLevel { warning = 1, fatal = 2 }; enum AlertDescription { close_notify = 0, unexpected_message = 10, bad_record_mac = 20, decryption_failed = 21, record_overflow = 22, decompression_failure = 30, handshake_failure = 40, bad_certificate = 42, unsupported_certificate = 43, certificate_revoked = 44, certificate_expired = 45, certificate_unknown = 46, illegal_parameter = 47, unknown_ca = 48, access_denied = 49, decode_error = 50, decrypt_error = 51, export_restriction = 60, protocol_version = 70, insufficient_security = 71, internal_error = 80, user_canceled = 90, no_renegotiation = 100 }; enum HandshakeType { hello_request = 0, client_hello = 1, server_hello = 2, certificate = 11, server_key_exchange = 12, certificate_request = 13, server_hello_done = 14, certificate_verify = 15, client_key_exchange = 16, finished = 20 }; /* * From rfc Flags 0 1 2 3 4 5 6 7 8 +-+-+-+-+-+-+-+-+ |L M S R R R R R| +-+-+-+-+-+-+-+-+ L = Length included M = More fragments S = EAP-TLS start R = Reserved The L bit (length included) is set to indicate the presence of the four octet TLS Message Length field, and MUST be set for the first fragment of a fragmented TLS message or set of messages. The M bit (more fragments) is set on all but the last fragment. The S bit (EAP-TLS start) is set in an EAP-TLS Start message. This differentiates the EAP-TLS Start message from a fragment acknowledgement. TLS Message Length The TLS Message Length field is four octets, and is present only if the L bit is set. This field provides the total length of the TLS message or set of messages that is being fragmented. TLS data The TLS data consists of the encapsulated TLS packet in TLS record format. * * The data structures present here * maps only to the typedata in the EAP packet * * Based on the L bit flag, first 4 bytes of data indicate the length */ typedef struct tls_packet_t { uint8_t flags; uint8_t data[1]; } eaptls_packet_t; typedef struct tls_packet { uint8_t code; uint8_t id; uint32_t length; uint8_t flags; uint8_t *data; uint32_t dlen; //uint8_t *packet; /* Wired EAP-TLS packet as found in typdedata of EAP_PACKET */ } EAPTLS_PACKET; /* EAP-TLS framework */ EAPTLS_PACKET *eaptls_alloc(void); void eaptls_free(EAPTLS_PACKET **eaptls_packet_ptr); int eaptls_start(EAP_DS *eap_ds, int peap); int eaptls_compose(EAP_DS *eap_ds, EAPTLS_PACKET *reply); /* Callbacks */ int cbtls_password(char *buf, int num, int rwflag, void *userdata); void cbtls_info(const SSL *s, int where, int ret); void cbtls_msg(int write_p, int msg_version, int content_type, const void *buf, size_t len, SSL *ssl, void *arg); /* TLS */ tls_session_t *eaptls_new_session(SSL_CTX *ssl_ctx, int client_cert); int tls_handshake_recv(REQUEST *, tls_session_t *ssn); int tls_handshake_send(REQUEST *,tls_session_t *ssn); void tls_session_information(tls_session_t *tls_session); /* Session */ void session_free(void *ssn); void session_close(tls_session_t *ssn); void session_init(tls_session_t *ssn); /* SSL Indicies for ex data */ extern int eaptls_handle_idx; extern int eaptls_conf_idx; extern int eaptls_store_idx; /* OCSP Store */ extern int eaptls_session_idx; #endif /*_EAP_TLS_H*/ freeradius-server/src/modules/rlm_eap/libeap/eap_types.h000066400000000000000000000064531257552170400240070ustar00rootroot00000000000000/* * eap_types.h Header file containing the interfaces for all EAP types. * * most contents moved from modules/rlm_eap/eap.h * * Version: $Id$ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2001 hereUare Communications, Inc. * Copyright 2003 Alan DeKok * Copyright 2006 The FreeRADIUS server project */ #ifndef _EAP_TYPES_H #define _EAP_TYPES_H #include RCSIDH(eap_types_h, "$Id$") #include #include #define PW_EAP_REQUEST 1 #define PW_EAP_RESPONSE 2 #define PW_EAP_SUCCESS 3 #define PW_EAP_FAILURE 4 #define PW_EAP_MAX_CODES 4 /* base for dictionary values */ #define ATTRIBUTE_EAP_ID 1020 #define ATTRIBUTE_EAP_CODE 1021 #define ATTRIBUTE_EAP_BASE 1280 #define PW_EAP_IDENTITY 1 #define PW_EAP_NOTIFICATION 2 #define PW_EAP_NAK 3 #define PW_EAP_MD5 4 #define PW_EAP_OTP 5 #define PW_EAP_GTC 6 #define PW_EAP_TLS 13 #define PW_EAP_LEAP 17 #define PW_EAP_SIM 18 #define PW_EAP_TTLS 21 #define PW_EAP_PEAP 25 #define PW_EAP_MSCHAPV2 26 #define PW_EAP_CISCO_MSCHAPV2 29 #define PW_EAP_TNC 38 #define PW_EAP_IKEV2 49 /* same number as last type */ #define PW_EAP_MAX_TYPES 49 #define EAP_HEADER_LEN 4 #define EAP_START 2 #define NAME_LEN 32 enum { EAP_NOTFOUND, /* not found */ EAP_FOUND, /* found, continue */ EAP_OK, /* ok, continue */ EAP_FAIL, /* failed, don't reply */ EAP_NOOP, /* succeeded without doing anything */ EAP_INVALID, /* invalid, don't reply */ EAP_VALID /* valid, continue */ }; /* * EAP-Type specific data. */ typedef struct eaptype_t { uint8_t type; size_t length; uint8_t *data; } eaptype_t; /* * Structure to hold EAP data. * * length = code + id + length + type + type.data * = 1 + 1 + 2 + 1 + X */ typedef struct eap_packet { unsigned char code; unsigned char id; unsigned int length; eaptype_t type; unsigned char *packet; } EAP_PACKET; /* * Structure to represent packet format of eap *on wire* */ typedef struct eap_packet_t { uint8_t code; uint8_t id; uint8_t length[2]; uint8_t data[1]; } eap_packet_t; /* * interfaces in eapcommon.c */ extern int eaptype_name2type(const char *name); extern const char *eaptype_type2name(unsigned int type, char *buffer, size_t buflen); extern int eap_wireformat(EAP_PACKET *reply); extern int eap_basic_compose(RADIUS_PACKET *packet, EAP_PACKET *reply); extern VALUE_PAIR *eap_packet2vp(const eap_packet_t *reply); extern eap_packet_t *eap_vp2packet(VALUE_PAIR *vps); #endif /* _EAP_TYPES_H */ freeradius-server/src/modules/rlm_eap/libeap/eapclient.h000066400000000000000000000003421257552170400237510ustar00rootroot00000000000000/* * some of this seems like a repeat of rlm_eap, and needs to be better * integrated, but as a client library, it deals with Request/Replies * rather than with Replies -> new requests. * * Bare with me for a bit. * */ freeradius-server/src/modules/rlm_eap/libeap/eapcommon.c000066400000000000000000000243541257552170400237670ustar00rootroot00000000000000/* * eapcommon.c rfc2284 & rfc2869 implementation * * code common to clients and to servers. * * Version: $Id$ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2000-2003,2006 The FreeRADIUS server project * Copyright 2001 hereUare Communications, Inc. * Copyright 2003 Alan DeKok * Copyright 2003 Michael Richardson */ /* * EAP PACKET FORMAT * --- ------ ------ * 0 1 2 3 * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | Code | Identifier | Length | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | Data ... * +-+-+-+-+ * * * EAP Request and Response Packet Format * --- ------- --- -------- ------ ------ * 0 1 2 3 * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | Code | Identifier | Length | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | Type | Type-Data ... * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+- * * * EAP Success and Failure Packet Format * --- ------- --- ------- ------ ------ * 0 1 2 3 * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | Code | Identifier | Length | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * */ #include RCSID("$Id$") #include #include #include #include "eap_types.h" static const char *eap_types[] = { "", "identity", "notification", "nak", /* NAK */ "md5", "otp", "gtc", "7", "8", "9", "10", "11", "12", "tls", /* 13 */ "14", "15", "16", "leap", /* 17 */ "sim", /* 18 GSM-SIM authentication */ "19", "20", "ttls", /* 21 */ "22", "23", "24", "peap", /* 25 */ "mschapv2", /* 26 */ "27", "28", "cisco_mschapv2", /* 29 */ "30", "31", "32", "33", "34", "35", "36", "37", "tnc", /* 38 */ "39", "40", "41", "42", "fast", "44", "45", "pax", "psk", "sake", "ikev2" }; /* MUST have PW_EAP_MAX_TYPES */ /* * Return an EAP-Type for a particular name. */ int eaptype_name2type(const char *name) { int i; for (i = 0; i <= PW_EAP_MAX_TYPES; i++) { if (strcmp(name, eap_types[i]) == 0) { return i; } } return -1; } /* * Returns a text string containing the name of the EAP type. */ const char *eaptype_type2name(unsigned int type, char *buffer, size_t buflen) { DICT_VALUE *dval; if (type > PW_EAP_MAX_TYPES) { /* * Prefer the dictionary name over a number, * if it exists. */ dval = dict_valbyattr(PW_EAP_TYPE, type); if (dval) { snprintf(buffer, buflen, "%s", dval->name); } snprintf(buffer, buflen, "%d", type); return buffer; } else if ((*eap_types[type] >= '0') && (*eap_types[type] <= '9')) { /* * Prefer the dictionary name, if it exists. */ dval = dict_valbyattr(PW_EAP_TYPE, type); if (dval) { snprintf(buffer, buflen, "%s", dval->name); return buffer; } /* else it wasn't in the dictionary */ } /* else the name in the array was non-numeric */ /* * Return the name, whatever it is. */ return eap_types[type]; } /* * EAP packet format to be sent over the wire * * i.e. code+id+length+data where data = null/type+typedata * based on code. * * INPUT to function is reply->code * reply->id * reply->type - setup with data * * OUTPUT reply->packet is setup with wire format, and will * be malloc()'ed to the right size. * */ int eap_wireformat(EAP_PACKET *reply) { eap_packet_t *hdr; uint16_t total_length = 0; if (reply == NULL) return EAP_INVALID; /* * If reply->packet is set, then the wire format * has already been calculated, just succeed. */ if(reply->packet != NULL) return EAP_VALID; total_length = EAP_HEADER_LEN; if (reply->code < 3) { total_length += 1/*EAPtype*/; if (reply->type.data && reply->type.length > 0) { total_length += reply->type.length; } } reply->packet = (unsigned char *)malloc(total_length); hdr = (eap_packet_t *)reply->packet; if (!hdr) { radlog(L_ERR, "rlm_eap: out of memory"); return EAP_INVALID; } hdr->code = (reply->code & 0xFF); hdr->id = (reply->id & 0xFF); total_length = htons(total_length); memcpy(hdr->length, &total_length, sizeof(total_length)); /* * Request and Response packets are special. */ if ((reply->code == PW_EAP_REQUEST) || (reply->code == PW_EAP_RESPONSE)) { hdr->data[0] = (reply->type.type & 0xFF); /* * Here since we cannot know the typedata format and length * * Type_data is expected to be wired by each EAP-Type * * Zero length/No typedata is supported as long as * type is defined */ if (reply->type.data && reply->type.length > 0) { memcpy(&hdr->data[1], reply->type.data, reply->type.length); free(reply->type.data); reply->type.data = reply->packet + EAP_HEADER_LEN + 1/*EAPtype*/; } } return EAP_VALID; } /* * compose EAP reply packet in EAP-Message attr of RADIUS. If * EAP exceeds 253, frame it in multiple EAP-Message attrs. */ int eap_basic_compose(RADIUS_PACKET *packet, EAP_PACKET *reply) { VALUE_PAIR *vp; eap_packet_t *eap_packet; int rcode; if (eap_wireformat(reply) == EAP_INVALID) { return RLM_MODULE_INVALID; } eap_packet = (eap_packet_t *)reply->packet; pairdelete(&(packet->vps), PW_EAP_MESSAGE); vp = eap_packet2vp(eap_packet); if (!vp) return RLM_MODULE_INVALID; pairadd(&(packet->vps), vp); /* * EAP-Message is always associated with * Message-Authenticator but not vice-versa. * * Don't add a Message-Authenticator if it's already * there. */ vp = pairfind(packet->vps, PW_MESSAGE_AUTHENTICATOR); if (!vp) { vp = paircreate(PW_MESSAGE_AUTHENTICATOR, PW_TYPE_OCTETS); memset(vp->vp_strvalue, 0, AUTH_VECTOR_LEN); vp->length = AUTH_VECTOR_LEN; pairadd(&(packet->vps), vp); } /* Set request reply code, but only if it's not already set. */ rcode = RLM_MODULE_OK; if (!packet->code) switch(reply->code) { case PW_EAP_RESPONSE: case PW_EAP_SUCCESS: packet->code = PW_AUTHENTICATION_ACK; rcode = RLM_MODULE_HANDLED; break; case PW_EAP_FAILURE: packet->code = PW_AUTHENTICATION_REJECT; rcode = RLM_MODULE_REJECT; break; case PW_EAP_REQUEST: packet->code = PW_ACCESS_CHALLENGE; rcode = RLM_MODULE_HANDLED; break; default: /* Should never enter here */ radlog(L_ERR, "rlm_eap: reply code %d is unknown, Rejecting the request.", reply->code); packet->code = PW_AUTHENTICATION_REJECT; break; } return rcode; } VALUE_PAIR *eap_packet2vp(const eap_packet_t *packet) { int total, size; const uint8_t *ptr; VALUE_PAIR *head = NULL; VALUE_PAIR **tail = &head; VALUE_PAIR *vp; total = packet->length[0] * 256 + packet->length[1]; ptr = (const uint8_t *) packet; do { size = total; if (size > 253) size = 253; vp = paircreate(PW_EAP_MESSAGE, PW_TYPE_OCTETS); if (!vp) { pairfree(&head); return NULL; } memcpy(vp->vp_octets, ptr, size); vp->length = size; *tail = vp; tail = &(vp->next); ptr += size; total -= size; } while (total > 0); return head; } /* * Handles multiple EAP-Message attrs * ie concatenates all to get the complete EAP packet. * * NOTE: Sometimes Framed-MTU might contain the length of EAP-Message, * refer fragmentation in rfc2869. */ eap_packet_t *eap_vp2packet(VALUE_PAIR *vps) { VALUE_PAIR *first, *vp; eap_packet_t *eap_packet; unsigned char *ptr; uint16_t len; int total_len; /* * Get only EAP-Message attribute list */ first = pairfind(vps, PW_EAP_MESSAGE); if (first == NULL) { DEBUG("rlm_eap: EAP-Message not found"); return NULL; } /* * Sanity check the length before doing anything. */ if (first->length < 4) { DEBUG("rlm_eap: EAP packet is too short."); return NULL; } /* * Get the Actual length from the EAP packet * First EAP-Message contains the EAP packet header */ memcpy(&len, first->vp_strvalue + 2, sizeof(len)); len = ntohs(len); /* * Take out even more weird things. */ if (len < 4) { DEBUG("rlm_eap: EAP packet has invalid length."); return NULL; } /* * Sanity check the length, BEFORE malloc'ing memory. */ total_len = 0; for (vp = first; vp; vp = pairfind(vp->next, PW_EAP_MESSAGE)) { total_len += vp->length; if (total_len > len) { DEBUG("rlm_eap: Malformed EAP packet. Length in packet header does not match actual length"); return NULL; } } /* * If the length is SMALLER, die, too. */ if (total_len < len) { DEBUG("rlm_eap: Malformed EAP packet. Length in packet header does not match actual length"); return NULL; } /* * Now that we know the lengths are OK, allocate memory. */ eap_packet = (eap_packet_t *) malloc(len); if (eap_packet == NULL) { radlog(L_ERR, "rlm_eap: out of memory"); return NULL; } /* * Copy the data from EAP-Message's over to our EAP packet. */ ptr = (unsigned char *)eap_packet; /* RADIUS ensures order of attrs, so just concatenate all */ for (vp = first; vp; vp = pairfind(vp->next, PW_EAP_MESSAGE)) { memcpy(ptr, vp->vp_strvalue, vp->length); ptr += vp->length; } return eap_packet; } freeradius-server/src/modules/rlm_eap/libeap/eapcrypto.c000066400000000000000000000156341257552170400240200ustar00rootroot00000000000000/* * eapcrypto.c Common key derivation routines for EAP/SIM. * * The development of the EAP/SIM support was funded by Internet Foundation * Austria (http://www.nic.at/ipa). * * Version: $Id$ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2003 Michael Richardson * Copyright 2003,2006 The FreeRADIUS server project * */ #include RCSID("$Id$") #include #include #include #include "eap_types.h" #include "eap_sim.h" #include void eapsim_calculate_keys(struct eapsim_keys *ek) { fr_SHA1_CTX context; uint8_t fk[160]; unsigned char buf[256]; unsigned char *p; unsigned int blen; p = buf; memcpy(p, ek->identity, ek->identitylen); p = p+ek->identitylen; memcpy(p, ek->Kc[0], EAPSIM_Kc_SIZE); p = p+EAPSIM_Kc_SIZE; memcpy(p, ek->Kc[1], EAPSIM_Kc_SIZE); p = p+EAPSIM_Kc_SIZE; memcpy(p, ek->Kc[2], EAPSIM_Kc_SIZE); p = p+EAPSIM_Kc_SIZE; memcpy(p, ek->nonce_mt, sizeof(ek->nonce_mt)); p=p+sizeof(ek->nonce_mt); memcpy(p, ek->versionlist, ek->versionlistlen);p=p+ek->versionlistlen; memcpy(p, ek->versionselect, sizeof(ek->versionselect)); p=p+sizeof(ek->versionselect); /* *p++ = ek->versionselect[1]; */ blen = p - buf; #if defined(TEST_CASE) || defined(DUMP_EAPSIM_KEYS) { unsigned int i, j, k; j=0; k=0; printf("SHA1buffer was: "); for (i = 0; i < blen; i++) { if(j==4) { printf("_"); j=0; } if(k==20) { printf("\n "); k=0; j=0; } j++; k++; printf("%02x", buf[i]); } printf("\n"); } #endif /* do the master key first */ fr_SHA1Init(&context); fr_SHA1Update(&context, buf, blen); fr_SHA1Final(ek->master_key, &context); /* * now use the PRF to expand it, generated K_aut, K_encr, * MSK and EMSK. */ fips186_2prf(ek->master_key, fk); /* split up the result */ memcpy(ek->K_encr, fk + 0, 16); /* 128 bits for encryption */ memcpy(ek->K_aut, fk + 16, EAPSIM_AUTH_SIZE); /*128 bits for auth */ memcpy(ek->msk, fk + 32, 64); /* 64 bytes for Master Session Key */ memcpy(ek->emsk, fk + 96, 64); /* 64- extended Master Session Key */ } void eapsim_dump_mk(struct eapsim_keys *ek) { unsigned int i, j, k; j=0; k=0; printf("Input was: \n"); printf(" identity: (len=%d)", ek->identitylen); for (i = 0; i < ek->identitylen; i++) { printf("%02x", ek->identity[i]); } printf("\n nonce_mt: "); for (i = 0; i < EAPSIM_NONCEMT_SIZE; i++) { printf("%02x", ek->nonce_mt[i]); } for (k = 0; k<3; k++) { printf("\n rand%d: ", k); for (i = 0; i < EAPSIM_RAND_SIZE; i++) { printf("%02x", ek->rand[k][i]); } } for (k = 0; k<3; k++) { printf("\n sres%d: ", k); for (i = 0; i < EAPSIM_SRES_SIZE; i++) { printf("%02x", ek->sres[k][i]); } } for (k = 0; k<3; k++) { printf("\n Kc%d: ", k); for (i = 0; i < EAPSIM_Kc_SIZE; i++) { printf("%02x", ek->Kc[k][i]); } } printf("\n versionlist[%d]: ",ek->versionlistlen); for (i = 0; i < ek->versionlistlen; i++) { printf("%02x", ek->versionlist[i]); } printf("\n select %02x %02x\n", ek->versionselect[0], ek->versionselect[1]); printf("\n\nOutput\n"); printf("mk: "); j=0; k=0; for (i = 0; i < sizeof(ek->master_key); i++) { if(j==4) { printf("_"); j=0; } j++; printf("%02x", ek->master_key[i]); } printf("\nK_aut: "); j=0; k=0; for (i = 0; i < sizeof(ek->K_aut); i++) { if(j==4) { printf("_"); j=0; } j++; printf("%02x", ek->K_aut[i]); } printf("\nK_encr: "); j=0; k=0; for (i = 0; i < sizeof(ek->K_encr); i++) { if(j==4) { printf("_"); j=0; } j++; printf("%02x", ek->K_encr[i]); } printf("\nmsk: "); j=0; k=0; for (i = 0; i < sizeof(ek->msk); i++) { if(k==20) { printf("\n "); k=0; j=0; } if(j==4) { printf("_"); j=0; } k++; j++; printf("%02x", ek->msk[i]); } printf("\nemsk: "); j=0; k=0; for (i = 0; i < sizeof(ek->emsk); i++) { if(k==20) { printf("\n "); k=0; j=0; } if(j==4) { printf("_"); j=0; } k++; j++; printf("%02x", ek->emsk[i]); } printf("\n"); } #ifdef TEST_CASE #include struct eapsim_keys inputkey1 = { {'e', 'a', 'p', 's','i','m' }, 6, 0x4d, 0x6c, 0x40, 0xde, 0x48, 0x3a, 0xdd, 0x99, /* nonce_mt */ 0x50, 0x90, 0x2c, 0x40, 0x24, 0xce, 0x76, 0x5e, 0x89, 0xab, 0xcd, 0xef, 0x89, 0xab, 0xcd, 0xef, /* chalX */ 0x89, 0xab, 0xcd, 0xef, 0x89, 0xab, 0xcd, 0xef, 0x9a, 0xbc, 0xde, 0xf8, 0x9a, 0xbc, 0xde, 0xf8, 0x9a, 0xbc, 0xde, 0xf8, 0x9a, 0xbc, 0xde, 0xf8, 0xab, 0xcd, 0xef, 0x89, 0xab, 0xcd, 0xef, 0x89, 0xab, 0xcd, 0xef, 0x89, 0xab, 0xcd, 0xef, 0x89, 0x12, 0x34, 0xab, 0xcd, /* sresX */ 0x12, 0x34, 0xab, 0xcd, 0x23, 0x4a, 0xbc, 0xd1, 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, /* Kc */ 0x10, 0x21, 0x32, 0x43, 0x54, 0x65, 0x76, 0x87, 0x30, 0x41, 0x52, 0x63, 0x74, 0x85, 0x96, 0xa7, {0x00, 0x02, 0x00, 0x01}, 4, 0x00, 0x01 , }; struct eapsim_keys inputkey2 = { {'1','2','4','4','0','7','0','1','0','0','0','0','0','0','0','1','@','e','a','p','s','i','m','.','f','o','o'}, 27, 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef, /* nonce_mt */ 0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54, 0x32, 0x10, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* chalX */ 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, 0xd1, 0xd2, 0xd3, 0xd4, /* SRES 1 */ 0xe1, 0xe2, 0xe3, 0xe4, 0xf1, 0xf2, 0xf3, 0xf4, 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, /* Kc */ 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, /* {0x00, 0x02, 0x00, 0x01}, */ {0x00, 0x01}, 2, 0x00, 0x01 , }; main(int argc, char *argv[]) { struct eapsim_keys *ek; ek = &inputkey1; eapsim_calculate_keys(ek); eapsim_dump_mk(ek); ek = &inputkey2; eapsim_calculate_keys(ek); eapsim_dump_mk(ek); } #endif /* * Local Variables: * c-style: bsd * End: */ freeradius-server/src/modules/rlm_eap/libeap/eapsimlib.c000066400000000000000000000316471257552170400237610ustar00rootroot00000000000000/* * eapsimlib.c based upon draft-haverinen-pppext-eap-sim-11.txt. * * The development of the EAP/SIM support was funded by Internet Foundation * Austria (http://www.nic.at/ipa). * * code common to EAP-SIM clients and to servers. * * Version: $Id$ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2000-2003,2006 The FreeRADIUS server project * Copyright 2003 Michael Richardson */ /* * EAP-SIM PACKET FORMAT * ------- ------ ------ * * EAP Request and Response Packet Format * --- ------- --- -------- ------ ------ * 0 1 2 3 * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | Code | Identifier | Length | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | Type | SIM-Type | SIM-Length | value ... | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * * with SIM-Type/SIM-Length/Value... repeating. SIM-Length is in units * of 32 bits, and includes the Sim-Type/Sim-Length fields. * * The SIM-Type's are mapped to ATTRIBUTE_EAP_SIM_BASE+Sim-type and * unmapped by these functions. * */ #include RCSID("$Id$") #include #include #include #include "eap_types.h" #include "eap_sim.h" #include /* * given a radius request with many attribues in the EAP-SIM range, build * them all into a single EAP-SIM body. * */ int map_eapsim_basictypes(RADIUS_PACKET *r, EAP_PACKET *ep) { VALUE_PAIR *vp; int encoded_size; uint8_t *encodedmsg, *attr; unsigned int id, eapcode; unsigned char *macspace, *append; int appendlen; unsigned char subtype; macspace = NULL; append = NULL; appendlen = 0; /* * encodedmsg is now an EAP-SIM message. * it might be too big for putting into an EAP-Type-SIM * */ vp = pairfind(r->vps, ATTRIBUTE_EAP_SIM_SUBTYPE); if(vp == NULL) { subtype = eapsim_start; } else { subtype = vp->vp_integer; } vp = pairfind(r->vps, ATTRIBUTE_EAP_ID); if(vp == NULL) { id = ((int)getpid() & 0xff); } else { id = vp->vp_integer; } vp = pairfind(r->vps, ATTRIBUTE_EAP_CODE); if(vp == NULL) { eapcode = PW_EAP_REQUEST; } else { eapcode = vp->vp_integer; } /* * take a walk through the attribute list to see how much space * that we need to encode all of this. */ encoded_size = 0; for(vp = r->vps; vp != NULL; vp = vp->next) { int roundedlen; int vplen; if(vp->attribute < ATTRIBUTE_EAP_SIM_BASE || vp->attribute >= ATTRIBUTE_EAP_SIM_BASE+256) { continue; } vplen = vp->length; /* * the AT_MAC attribute is a bit different, when we get to this * attribute, we pull the contents out, save it for later * processing, set the size to 16 bytes (plus 2 bytes padding). * * At this point, we only care about the size. */ if(vp->attribute == ATTRIBUTE_EAP_SIM_BASE+PW_EAP_SIM_MAC) { vplen = 18; } /* round up to next multiple of 4, after taking in * account the type and length bytes */ roundedlen = (vplen + 2 + 3) & ~3; encoded_size += roundedlen; } if (ep->code != PW_EAP_SUCCESS) ep->code = eapcode; ep->id = (id & 0xff); ep->type.type = PW_EAP_SIM; /* * if no attributes were found, do very little. * */ if(encoded_size == 0) { encodedmsg = malloc(3); /* FIX: could be NULL */ encodedmsg[0]=subtype; encodedmsg[1]=0; encodedmsg[2]=0; ep->type.length = 3; ep->type.data = encodedmsg; return 0; } /* * figured out the length, so malloc some space for the results. * * Note that we do not bother going through an "EAP" stage, which * is a bit strange compared to the unmap, which expects to see * an EAP-SIM virtual attributes. * * EAP is 1-code, 1-identifier, 2-length, 1-type = 5 overhead. * * SIM code adds a subtype, and 2 bytes of reserved = 3. * */ /* malloc space for it */ encoded_size += 3; encodedmsg = malloc(encoded_size); if (encodedmsg == NULL) { radlog(L_ERR, "eapsim: out of memory allocating %d bytes", encoded_size+5); return 0; } memset(encodedmsg, 0, encoded_size); /* * now walk the attributes again, sticking them in. * * we go three bytes into the encoded message, because there are two * bytes of reserved, and we will fill the "subtype" in later. * */ attr = encodedmsg+3; for(vp = r->vps; vp != NULL; vp = vp->next) { int roundedlen; if(vp->attribute < ATTRIBUTE_EAP_SIM_BASE || vp->attribute >= ATTRIBUTE_EAP_SIM_BASE+256) { continue; } /* * the AT_MAC attribute is a bit different, when we get to this * attribute, we pull the contents out, save it for later * processing, set the size to 16 bytes (plus 2 bytes padding). * * At this point, we put in zeros, and remember where the * sixteen bytes go. */ if(vp->attribute == ATTRIBUTE_EAP_SIM_BASE+PW_EAP_SIM_MAC) { roundedlen = 20; memset(&attr[2], 0, 18); macspace = &attr[4]; append = vp->vp_octets; appendlen = vp->length; } else { roundedlen = (vp->length + 2 + 3) & ~3; memset(attr, 0, roundedlen); memcpy(&attr[2], vp->vp_strvalue, vp->length); } attr[0] = vp->attribute - ATTRIBUTE_EAP_SIM_BASE; attr[1] = roundedlen >> 2; attr += roundedlen; } encodedmsg[0] = subtype; ep->type.length = encoded_size; ep->type.data = encodedmsg; /* * if macspace was set and we have a key, * then we should calculate the HMAC-SHA1 of the resulting EAP-SIM * packet, appended with the value of append. */ vp = pairfind(r->vps, ATTRIBUTE_EAP_SIM_KEY); if(macspace != NULL && vp != NULL) { unsigned char *buffer; eap_packet_t *hdr; uint16_t hmaclen, total_length = 0; unsigned char sha1digest[20]; total_length = EAP_HEADER_LEN + 1 + encoded_size; hmaclen = total_length + appendlen; buffer = (unsigned char *)malloc(hmaclen); hdr = (eap_packet_t *)buffer; if (!hdr) { radlog(L_ERR, "rlm_eap: out of memory"); free(encodedmsg); return 0; } hdr->code = eapcode & 0xFF; hdr->id = (id & 0xFF); total_length = htons(total_length); memcpy(hdr->length, &total_length, sizeof(total_length)); hdr->data[0] = PW_EAP_SIM; /* copy the data */ memcpy(&hdr->data[1], encodedmsg, encoded_size); /* copy the nonce */ memcpy(&hdr->data[encoded_size+1], append, appendlen); /* HMAC it! */ fr_hmac_sha1(buffer, hmaclen, vp->vp_octets, vp->length, sha1digest); /* done with the buffer, free it */ free(buffer); /* now copy the digest to where it belongs in the AT_MAC */ /* note that it is truncated to 128-bits */ memcpy(macspace, sha1digest, 16); } /* if we had an AT_MAC and no key, then fail */ if(macspace != NULL && vp == NULL) { if(encodedmsg != NULL) free(encodedmsg); return 0; } return 1; } /* * given a radius request with an EAP-SIM body, decode it into TLV pairs * * return value is TRUE if it succeeded, false if there was something * wrong and the packet should be discarded. * */ int unmap_eapsim_basictypes(RADIUS_PACKET *r, uint8_t *attr, unsigned int attrlen) { VALUE_PAIR *newvp; int eapsim_attribute; unsigned int eapsim_len; int es_attribute_count; unsigned int id_len; es_attribute_count=0; /* big enough to have even a single attribute */ if(attrlen < 5) { radlog(L_ERR, "eap: EAP-Sim attribute too short: %d < 2", attrlen); return 0; } newvp = paircreate(ATTRIBUTE_EAP_SIM_SUBTYPE, PW_TYPE_INTEGER); if (!newvp) return 0; newvp->vp_integer = attr[0]; newvp->length = 1; pairadd(&(r->vps), newvp); attr += 3; attrlen -= 3; /* now, loop processing each attribute that we find */ while(attrlen > 0) { if(attrlen < 2) { radlog(L_ERR, "eap: EAP-Sim attribute %d too short: %d < 2", es_attribute_count, attrlen); return 0; } eapsim_attribute = attr[0]; eapsim_len = attr[1] * 4; if(eapsim_len > attrlen) { radlog(L_ERR, "eap: EAP-Sim attribute %d (no.%d) has length longer than data (%d > %d)" , eapsim_attribute , es_attribute_count, eapsim_len, attrlen); return 0; } if(eapsim_len > MAX_STRING_LEN) { eapsim_len = MAX_STRING_LEN; } if (eapsim_len < 2) { radlog(L_ERR, "eap: EAP-Sim attribute %d (no.%d) has length too small", eapsim_attribute, es_attribute_count); return 0; } /* AT_IDENTITY has special format */ if (eapsim_attribute == PW_EAP_SIM_IDENTITY) { if (eapsim_len < 4) { radlog(L_ERR, "eap: EAP-Sim AT_IDENTITY (no.%d) has length too small", es_attribute_count); goto loop_end; } id_len = (attr[2] << 8) + attr[3]; if (4 + id_len > eapsim_len) { radlog(L_ERR, "eap: EAP-Sim AT_IDENTITY (no.%d) invalid length", es_attribute_count); goto loop_end; } } newvp = paircreate(eapsim_attribute+ATTRIBUTE_EAP_SIM_BASE, PW_TYPE_OCTETS); switch (eapsim_attribute) { case PW_EAP_SIM_IDENTITY: memcpy(newvp->vp_strvalue, &attr[4], id_len); newvp->length = id_len; break; default: memcpy(newvp->vp_strvalue, &attr[2], eapsim_len-2); newvp->length = eapsim_len-2; } pairadd(&(r->vps), newvp); newvp = NULL; loop_end: /* advance pointers, decrement length */ attr += eapsim_len; attrlen -= eapsim_len; es_attribute_count++; } return 1; } /* * calculate the MAC for the EAP message, given the key. * The "extra" will be appended to the EAP message and included in the * HMAC. * */ int eapsim_checkmac(VALUE_PAIR *rvps, uint8_t key[EAPSIM_AUTH_SIZE], uint8_t *extra, int extralen, uint8_t calcmac[20]) { int ret; eap_packet_t *e; uint8_t *buffer; int elen,len; VALUE_PAIR *mac; mac = pairfind(rvps, ATTRIBUTE_EAP_SIM_BASE+PW_EAP_SIM_MAC); if(mac == NULL || mac->length != 18) { /* can't check a packet with no AT_MAC attribute */ return 0; } /* get original copy of EAP message, note that it was sanitized * to have a valid length, which we depend upon. */ e = eap_vp2packet(rvps); if(e == NULL) { return 0; } /* make copy big enough for everything */ elen = e->length[0] * 256 + e->length[1]; len = elen + extralen; buffer = malloc(len); if(buffer == NULL) { free(e); return 0; } memcpy(buffer, e, elen); memcpy(buffer+elen, extra, extralen); /* * now look for the AT_MAC attribute in the copy of the buffer * and make sure that the checksum is zero. * */ { uint8_t *attr; /* first attribute is 8 bytes into the EAP packet. * 4 bytes for EAP, 1 for type, 1 for subtype, 2 reserved. */ attr = buffer+8; while(attr < (buffer+elen)) { if(attr[0] == PW_EAP_SIM_MAC) { /* zero the data portion, after making sure * the size is >=5. Maybe future versions. * will use more bytes, so be liberal. */ if(attr[1] < 5) { ret = 0; goto done; } memset(&attr[4], 0, (attr[1]-1)*4); } /* advance the pointer */ attr += attr[1]*4; } } /* now, HMAC-SHA1 it with the key. */ fr_hmac_sha1(buffer, len, key, 16, calcmac); if(memcmp(&mac->vp_strvalue[2], calcmac, 16) == 0) { ret = 1; } else { ret = 0; } done: free(e); free(buffer); return(ret); } /* * definitions changed to take a buffer for unknowns * as this is more thread safe. */ const char *simstates[]={ "init", "start", NULL }; const char *sim_state2name(enum eapsim_clientstates state, char *statenamebuf, int statenamebuflen) { if(state >= eapsim_client_maxstates) { snprintf(statenamebuf, statenamebuflen, "eapstate:%d", state); return statenamebuf; } else { return simstates[state]; } } const char *subtypes[]={ "subtype0", "subtype1", "subtype2", "subtype3", "subtype4", "subtype5", "subtype6", "subtype7", "subtype8", "subtype9", "start", "challenge", "notification", "reauth", "client-error", NULL }; const char *sim_subtype2name(enum eapsim_subtype subtype, char *subtypenamebuf, int subtypenamebuflen) { if(subtype >= eapsim_max_subtype) { snprintf(subtypenamebuf, subtypenamebuflen, "illegal-subtype:%d", subtype); return subtypenamebuf; } else { return subtypes[subtype]; } } freeradius-server/src/modules/rlm_eap/libeap/fips186prf.c000066400000000000000000000150261257552170400237150ustar00rootroot00000000000000/* * fips186prf.c An implementation of the FIPS-186-2 SHA1-based PRF. * * The development of the EAP/SIM support was funded by Internet Foundation * Austria (http://www.nic.at/ipa). * * This code was written from scratch by Michael Richardson, and it is * dual licensed under both GPL and BSD. * * Version: $Id$ * * GPL notice: * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * BSD notice: * * 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. Neither the name of The NetBSD Foundation nor the names of its * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * Copyright 2003 Michael Richardson * Copyright 2006 The FreeRADIUS server project * */ #include RCSID("$Id$") #include #include #include #include #ifdef HAVE_SYS_TYPES_H #include #endif #ifdef HAVE_STDINT_H #include #endif #ifdef HAVE_INTTYPES_H #include #endif #include /* * we do it in 8-bit chunks, because we have to keep the numbers * in network byte order (i.e. MSB) * * make it a structure so that we can do structure assignments. */ typedef struct onesixty { uint8_t p[20]; } onesixty; static void onesixty_add_mod(onesixty *sum, onesixty *a, onesixty *b) { uint32_t s; int i, carry; carry = 0; for(i=19; i>=0; i--) { /* for(i=0; i<20; i++) { */ s = a->p[i] + b->p[i] + carry; sum->p[i] = s & 0xff; carry = s >> 8; } } /* * run the FIPS-186-2 PRF on the given Master Key (160 bits) * in order to derive 1280 bits (160 bytes) of keying data from * it. * * Given that in EAP-SIM, this is coming from a 64-bit Kc it seems * like an awful lot of "randomness" to pull out.. (MCR) * */ void fips186_2prf(uint8_t mk[20], uint8_t finalkey[160]) { fr_SHA1_CTX context; int j; onesixty xval, xkey, w_0, w_1, sum, one; uint8_t *f; uint8_t zeros[64]; /* * let XKEY := MK, * * Step 3: For j = 0 to 3 do * a. XVAL = XKEY * b. w_0 = SHA1(XVAL) * c. XKEY = (1 + XKEY + w_0) mod 2^160 * d. XVAL = XKEY * e. w_1 = SHA1(XVAL) * f. XKEY = (1 + XKEY + w_1) mod 2^160 * 3.3 x_j = w_0|w_1 * */ memcpy(&xkey, mk, sizeof(xkey)); /* make the value 1 */ memset(&one, 0, sizeof(one)); one.p[19]=1; f=finalkey; for(j=0; j<4; j++) { /* a. XVAL = XKEY */ xval = xkey; /* b. w_0 = SHA1(XVAL) */ fr_SHA1Init(&context); memset(zeros, 0, sizeof(zeros)); memcpy(zeros, xval.p, 20); #ifndef WITH_OPENSSL_SHA1 fr_SHA1Transform(context.state, zeros); #else fr_SHA1Transform(&context, zeros); #endif fr_SHA1FinalNoLen(w_0.p, &context); /* c. XKEY = (1 + XKEY + w_0) mod 2^160 */ onesixty_add_mod(&sum, &xkey, &w_0); onesixty_add_mod(&xkey, &sum, &one); /* d. XVAL = XKEY */ xval = xkey; /* e. w_1 = SHA1(XVAL) */ fr_SHA1Init(&context); memset(zeros, 0, sizeof(zeros)); memcpy(zeros, xval.p, 20); #ifndef WITH_OPENSSL_SHA1 fr_SHA1Transform(context.state, zeros); #else fr_SHA1Transform(&context, zeros); #endif fr_SHA1FinalNoLen(w_1.p, &context); /* f. XKEY = (1 + XKEY + w_1) mod 2^160 */ onesixty_add_mod(&sum, &xkey, &w_1); onesixty_add_mod(&xkey, &sum, &one); /* now store it away */ memcpy(f, &w_0, 20); f += 20; memcpy(f, &w_1, 20); f += 20; } } /* * test vectors * from http://csrc.nist.gov/CryptoToolkit/dss/Examples-1024bit.pdf * * page 5 * * XKEY= bd029bbe 7f51960b cf9edb2b 61f06f0f eb5a38b6 * XSEED= 00000000 00000000 00000000 00000000 00000000 * * * The first loop through step 3.2 provides: * * XVAL= bd029bbe 7f51960b cf9edb2b 61f06f0f eb5a38b6 * * Using the routine in Appendix 3.3, Constructing The Function G From SHA-1, * in step 3.2.b of the Change Notice algorithm for computing values of x * provides: * * w[0]= 2070b322 3dba372f de1c0ffc 7b2e3b49 8b260614 * * * The following value is the updated XKEY value from step 3.2.c: * * XKEY= dd734ee0 bd0bcd3b adbaeb27 dd1eaa59 76803ecb * * The second loop through step 3.2 provides: * * XVAL= dd734ee0 bd0bcd3b adbaeb27 dd1eaa59 76803ecb * * Using the routine in Appendix 3.3, Constructing The Function G From SHA-1, * in step 3.2.b of the Change Notice algorithm for computing values of x * provides: * * w[1]= 3c6c18ba cb0f6c55 babb1378 8e20d737 a3275116 * * The following value is the updated XKEY value from step 3.2.c: * * * XKEY= 19df679b 881b3991 6875fea0 6b3f8191 19a78fe2 * * Step 3.3 provides the following values: * * w[0] || w[1]= 2070b322 3dba372f de1c0ffc 7b2e3b49 8b260614 * 3c6c18ba cb0f6c55 babb1378 8e20d737 a3275116 * */ #ifdef TEST_CASE #include uint8_t mk[20]={ 0xbd, 0x02, 0x9b, 0xbe, 0x7f, 0x51, 0x96, 0x0b, 0xcf, 0x9e, 0xdb, 0x2b, 0x61, 0xf0, 0x6f, 0x0f, 0xeb, 0x5a, 0x38, 0xb6 }; main(int argc, char *argv[]) { uint8_t finalkey[160]; int i, j, k; fips186_2prf(mk, finalkey); printf("Input was: |"); j=0; for (i = 0; i < 20; i++) { if(j==4) { printf("_"); j=0; } j++; printf("%02x", mk[i]); } printf("|\nOutput was: "); j=0; k=0; for (i = 0; i < 160; i++) { if(k==20) { printf("\n "); k=0; j=0; } if(j==4) { printf("_"); j=0; } k++; j++; printf("%02x", finalkey[i]); } printf("\n"); } #endif freeradius-server/src/modules/rlm_eap/libeap/mppe_keys.c000066400000000000000000000137351257552170400240060ustar00rootroot00000000000000/* * mppe_keys.c * * Version: $Id$ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2002 Axis Communications AB * Copyright 2006 The FreeRADIUS server project * Authors: Henrik Eriksson & Lars Viklund */ #include RCSID("$Id$") #include #include "eap_tls.h" /* * Add value pair to reply */ static void add_reply(VALUE_PAIR** vp, const char* name, const uint8_t * value, int len) { VALUE_PAIR *reply_attr; reply_attr = pairmake(name, "", T_OP_EQ); if (!reply_attr) { DEBUG("rlm_eap_tls: " "add_reply failed to create attribute %s: %s\n", name, fr_strerror()); return; } memcpy(reply_attr->vp_octets, value, len); reply_attr->length = len; pairadd(vp, reply_attr); } /* * TLS PRF from RFC 2246 */ static void P_hash(const EVP_MD *evp_md, const unsigned char *secret, unsigned int secret_len, const unsigned char *seed, unsigned int seed_len, unsigned char *out, unsigned int out_len) { HMAC_CTX ctx_a, ctx_out; unsigned char a[HMAC_MAX_MD_CBLOCK]; unsigned int size; HMAC_CTX_init(&ctx_a); HMAC_CTX_init(&ctx_out); HMAC_Init_ex(&ctx_a, secret, secret_len, evp_md, NULL); HMAC_Init_ex(&ctx_out, secret, secret_len, evp_md, NULL); size = HMAC_size(&ctx_out); /* Calculate A(1) */ HMAC_Update(&ctx_a, seed, seed_len); HMAC_Final(&ctx_a, a, NULL); while (1) { /* Calculate next part of output */ HMAC_Update(&ctx_out, a, size); HMAC_Update(&ctx_out, seed, seed_len); /* Check if last part */ if (out_len < size) { HMAC_Final(&ctx_out, a, NULL); memcpy(out, a, out_len); break; } /* Place digest in output buffer */ HMAC_Final(&ctx_out, out, NULL); HMAC_Init_ex(&ctx_out, NULL, 0, NULL, NULL); out += size; out_len -= size; /* Calculate next A(i) */ HMAC_Init_ex(&ctx_a, NULL, 0, NULL, NULL); HMAC_Update(&ctx_a, a, size); HMAC_Final(&ctx_a, a, NULL); } HMAC_CTX_cleanup(&ctx_a); HMAC_CTX_cleanup(&ctx_out); memset(a, 0, sizeof(a)); } static void PRF(const unsigned char *secret, unsigned int secret_len, const unsigned char *seed, unsigned int seed_len, unsigned char *out, unsigned char *buf, unsigned int out_len) { unsigned int i; unsigned int len = (secret_len + 1) / 2; const unsigned char *s1 = secret; const unsigned char *s2 = secret + (secret_len - len); P_hash(EVP_md5(), s1, len, seed, seed_len, out, out_len); P_hash(EVP_sha1(), s2, len, seed, seed_len, buf, out_len); for (i=0; i < out_len; i++) { out[i] ^= buf[i]; } } #define EAPTLS_MPPE_KEY_LEN 32 #define EAPTLS_PRF_LABEL "ttls keying material" /* * Generate keys according to RFC 2716 and add to reply */ void eaptls_gen_mppe_keys(VALUE_PAIR **reply_vps, SSL *s, const char *prf_label) { unsigned char out[4*EAPTLS_MPPE_KEY_LEN]; unsigned char *p; size_t prf_size; if (!s->s3) { DEBUG("ERROR: No SSLv3 information"); return; } prf_size = strlen(prf_label); #if OPENSSL_VERSION_NUMBER >= 0x10001000L if (SSL_export_keying_material(s, out, sizeof(out), prf_label, prf_size, NULL, 0, 0) != 1) { DEBUG("Failed generating keying material"); return; } #else { unsigned char buf[4*EAPTLS_MPPE_KEY_LEN]; unsigned char seed[64 + 2*SSL3_RANDOM_SIZE]; p = seed; memcpy(p, prf_label, prf_size); p += prf_size; memcpy(p, s->s3->client_random, SSL3_RANDOM_SIZE); p += SSL3_RANDOM_SIZE; prf_size += SSL3_RANDOM_SIZE; memcpy(p, s->s3->server_random, SSL3_RANDOM_SIZE); prf_size += SSL3_RANDOM_SIZE; PRF(s->session->master_key, s->session->master_key_length, seed, prf_size, out, buf, sizeof(out)); } #endif p = out; add_reply(reply_vps, "MS-MPPE-Recv-Key", p, EAPTLS_MPPE_KEY_LEN); p += EAPTLS_MPPE_KEY_LEN; add_reply(reply_vps, "MS-MPPE-Send-Key", p, EAPTLS_MPPE_KEY_LEN); add_reply(reply_vps, "EAP-MSK", out, 64); add_reply(reply_vps, "EAP-EMSK", out + 64, 64); } #define EAPTLS_PRF_CHALLENGE "ttls challenge" /* * Generate the TTLS challenge * * It's in the TLS module simply because it's only a few lines * of code, and it needs access to the TLS PRF functions. */ void eapttls_gen_challenge(SSL *s, uint8_t *buffer, size_t size) { uint8_t out[32], buf[32]; uint8_t seed[sizeof(EAPTLS_PRF_CHALLENGE)-1 + 2*SSL3_RANDOM_SIZE]; uint8_t *p = seed; if (!s->s3) { DEBUG("ERROR: No SSLv3 information"); return; } memcpy(p, EAPTLS_PRF_CHALLENGE, sizeof(EAPTLS_PRF_CHALLENGE)-1); p += sizeof(EAPTLS_PRF_CHALLENGE)-1; memcpy(p, s->s3->client_random, SSL3_RANDOM_SIZE); p += SSL3_RANDOM_SIZE; memcpy(p, s->s3->server_random, SSL3_RANDOM_SIZE); PRF(s->session->master_key, s->session->master_key_length, seed, sizeof(seed), out, buf, sizeof(out)); memcpy(buffer, out, size); } /* * Actually generates EAP-Session-Id, which is an internal server * attribute. Not all systems want to send EAP-Key-Nam */ void eaptls_gen_eap_key(SSL *s, uint32_t header, VALUE_PAIR **vps) { VALUE_PAIR *vp; if (!s->s3) { DEBUG("ERROR: No SSLv3 information"); return; } vp = paircreate(PW_EAP_SESSION_ID, PW_TYPE_OCTETS); if (!vp) return; vp->vp_octets[0] = header & 0xff; memcpy(vp->vp_octets + 1, s->s3->client_random, SSL3_RANDOM_SIZE); memcpy(vp->vp_octets + 1 + SSL3_RANDOM_SIZE, s->s3->server_random, SSL3_RANDOM_SIZE); vp->length = 1 + 2 * SSL3_RANDOM_SIZE; pairadd(vps, vp); } freeradius-server/src/modules/rlm_eap/libeap/tls.c000066400000000000000000000353051257552170400226110ustar00rootroot00000000000000/* * tls.c * * Version: $Id$ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2001 hereUare Communications, Inc. * Copyright 2003 Alan DeKok * Copyright 2006 The FreeRADIUS server project */ #include RCSID("$Id$") #include "eap_tls.h" /* record */ static void record_init(record_t *buf); static void record_close(record_t *buf); static unsigned int record_plus(record_t *buf, const void *ptr, unsigned int size); static unsigned int record_minus(record_t *buf, void *ptr, unsigned int size); tls_session_t *eaptls_new_session(SSL_CTX *ssl_ctx, int client_cert) { tls_session_t *state = NULL; SSL *new_tls = NULL; client_cert = client_cert; /* -Wunused. See bug #350 */ if ((new_tls = SSL_new(ssl_ctx)) == NULL) { radlog(L_ERR, "SSL: Error creating new SSL: %s", ERR_error_string(ERR_get_error(), NULL)); return NULL; } /* We use the SSL's "app_data" to indicate a call-back */ SSL_set_app_data(new_tls, NULL); state = (tls_session_t *)malloc(sizeof(*state)); memset(state, 0, sizeof(*state)); session_init(state); state->ctx = ssl_ctx; state->ssl = new_tls; /* * Initialize callbacks */ state->record_init = record_init; state->record_close = record_close; state->record_plus = record_plus; state->record_minus = record_minus; /* * Create & hook the BIOs to handle the dirty side of the * SSL. This is *very important* as we want to handle * the transmission part. Now the only IO interface * that SSL is aware of, is our defined BIO buffers. * * This means that all SSL IO is done to/from memory, * and we can update those BIOs from the EAP packets we've * received. */ state->into_ssl = BIO_new(BIO_s_mem()); state->from_ssl = BIO_new(BIO_s_mem()); SSL_set_bio(state->ssl, state->into_ssl, state->from_ssl); /* * Add the message callback to identify what type of * message/handshake is passed */ SSL_set_msg_callback(new_tls, cbtls_msg); SSL_set_msg_callback_arg(new_tls, state); SSL_set_info_callback(new_tls, cbtls_info); /* * In Server mode we only accept. */ SSL_set_accept_state(state->ssl); return state; } /* * Print out some text describing the error. */ static int int_ssl_check(REQUEST *request, SSL *s, int ret, const char *text) { int e; unsigned long l; if ((l = ERR_get_error()) != 0) { const char *p = ERR_error_string(l, NULL); VALUE_PAIR *vp; radlog(L_ERR, "rlm_eap: SSL error %s", p); if (request) { vp = pairmake("Module-Failure-Message", p, T_OP_ADD); if (vp) pairadd(&request->packet->vps, vp); } } e = SSL_get_error(s, ret); switch(e) { /* * These seem to be harmless and already "dealt * with" by our non-blocking environment. NB: * "ZERO_RETURN" is the clean "error" * indicating a successfully closed SSL * tunnel. We let this happen because our IO * loop should not appear to have broken on * this condition - and outside the IO loop, the * "shutdown" state is checked. * * Don't print anything if we ignore the error. */ case SSL_ERROR_NONE: case SSL_ERROR_WANT_READ: case SSL_ERROR_WANT_WRITE: case SSL_ERROR_WANT_X509_LOOKUP: case SSL_ERROR_ZERO_RETURN: break; /* * These seem to be indications of a genuine * error that should result in the SSL tunnel * being regarded as "dead". */ case SSL_ERROR_SYSCALL: radlog(L_ERR, "SSL: %s failed in a system call (%d), TLS session fails.", text, ret); return 0; case SSL_ERROR_SSL: radlog(L_ERR, "SSL: %s failed inside of TLS (%d), TLS session fails.", text, ret); return 0; default: /* * For any other errors that (a) exist, and (b) * crop up - we need to interpret what to do with * them - so "politely inform" the caller that * the code needs updating here. */ radlog(L_ERR, "SSL: FATAL SSL error ..... %d\n", e); return 0; } return 1; } /* * We are the server, we always get the dirty data * (Handshake data is also considered as dirty data) * During handshake, since SSL API handles itself, * After clean-up, dirty_out will be filled with * the data required for handshaking. So we check * if dirty_out is empty then we simply send it back. * As of now, if handshake is successful, then it is EAP-Success * or else EAP-failure should be sent * * Fill the Bio with the dirty data to clean it * Get the cleaned data from SSL, if it is not Handshake data */ int tls_handshake_recv(REQUEST *request, tls_session_t *ssn) { int err; if (ssn->invalid_hb_used) return 0; BIO_write(ssn->into_ssl, ssn->dirty_in.data, ssn->dirty_in.used); err = SSL_read(ssn->ssl, ssn->clean_out.data + ssn->clean_out.used, sizeof(ssn->clean_out.data) - ssn->clean_out.used); if (err > 0) { ssn->clean_out.used += err; record_init(&ssn->dirty_in); return 1; } if (!int_ssl_check(request, ssn->ssl, err, "SSL_read")) { return 0; } /* Some Extra STATE information for easy debugging */ if (SSL_is_init_finished(ssn->ssl)) { DEBUG2("SSL Connection Established\n"); } if (SSL_in_init(ssn->ssl)) { DEBUG2("In SSL Handshake Phase\n"); } if (SSL_in_before(ssn->ssl)) { DEBUG2("Before SSL Handshake Phase\n"); } if (SSL_in_accept_init(ssn->ssl)) { DEBUG2("In SSL Accept mode \n"); } if (SSL_in_connect_init(ssn->ssl)) { DEBUG2("In SSL Connect mode \n"); } err = BIO_ctrl_pending(ssn->from_ssl); if (err > 0) { err = BIO_read(ssn->from_ssl, ssn->dirty_out.data, sizeof(ssn->dirty_out.data)); if (err > 0) { ssn->dirty_out.used = err; } else if (BIO_should_retry(ssn->from_ssl)) { record_init(&ssn->dirty_in); DEBUG2(" tls: Asking for more data in tunnel"); return 1; } else { int_ssl_check(request, ssn->ssl, err, "BIO_read"); record_init(&ssn->dirty_in); return 0; } } else { DEBUG2("SSL Application Data"); /* Its clean application data, do whatever we want */ record_init(&ssn->clean_out); } /* We are done with dirty_in, reinitialize it */ record_init(&ssn->dirty_in); return 1; } /* * Take clear-text user data, and encrypt it into the output buffer, * to send to the client at the other end of the SSL connection. */ int tls_handshake_send(REQUEST *request, tls_session_t *ssn) { int err; /* * If there's un-encrypted data in 'clean_in', then write * that data to the SSL session, and then call the BIO function * to get that encrypted data from the SSL session, into * a buffer which we can then package into an EAP packet. * * Based on Server's logic this clean_in is expected to * contain the data to send to the client. */ if (ssn->clean_in.used > 0) { int written; written = SSL_write(ssn->ssl, ssn->clean_in.data, ssn->clean_in.used); record_minus(&ssn->clean_in, NULL, written); /* Get the dirty data from Bio to send it */ err = BIO_read(ssn->from_ssl, ssn->dirty_out.data, sizeof(ssn->dirty_out.data)); if (err > 0) { ssn->dirty_out.used = err; } else { int_ssl_check(request, ssn->ssl, err, "handshake_send"); } } return 1; } void session_init(tls_session_t *ssn) { ssn->ssl = NULL; ssn->into_ssl = ssn->from_ssl = NULL; record_init(&ssn->clean_in); record_init(&ssn->clean_out); record_init(&ssn->dirty_in); record_init(&ssn->dirty_out); memset(&ssn->info, 0, sizeof(ssn->info)); ssn->offset = 0; ssn->fragment = 0; ssn->tls_msg_len = 0; ssn->length_flag = 0; ssn->opaque = NULL; ssn->free_opaque = NULL; } void session_close(tls_session_t *ssn) { SSL_set_quiet_shutdown(ssn->ssl, 1); SSL_shutdown(ssn->ssl); if(ssn->ssl) SSL_free(ssn->ssl); #if 0 /* * WARNING: SSL_free seems to decrement the reference counts already, * so doing this might crash the application. */ if(ssn->into_ssl) BIO_free(ssn->into_ssl); if(ssn->from_ssl) BIO_free(ssn->from_ssl); #endif record_close(&ssn->clean_in); record_close(&ssn->clean_out); record_close(&ssn->dirty_in); record_close(&ssn->dirty_out); session_init(ssn); } void session_free(void *ssn) { tls_session_t *sess = (tls_session_t *)ssn; if (!ssn) return; /* * Free any opaque TTLS or PEAP data. */ if ((sess->opaque) && (sess->free_opaque)) { sess->free_opaque(sess->opaque); sess->opaque = NULL; } session_close(sess); free(sess); } static void record_init(record_t *rec) { rec->used = 0; } static void record_close(record_t *rec) { rec->used = 0; } /* * Copy data to the intermediate buffer, before we send * it somewhere. */ static unsigned int record_plus(record_t *rec, const void *ptr, unsigned int size) { unsigned int added = MAX_RECORD_SIZE - rec->used; if(added > size) added = size; if(added == 0) return 0; memcpy(rec->data + rec->used, ptr, added); rec->used += added; return added; } /* * Take data from the buffer, and give it to the caller. */ static unsigned int record_minus(record_t *rec, void *ptr, unsigned int size) { unsigned int taken = rec->used; if(taken > size) taken = size; if(taken == 0) return 0; if(ptr) memcpy(ptr, rec->data, taken); rec->used -= taken; /* * This is pretty bad... */ if(rec->used > 0) memmove(rec->data, rec->data + taken, rec->used); return taken; } void tls_session_information(tls_session_t *tls_session) { const char *str_write_p, *str_version, *str_content_type = ""; const char *str_details1 = "", *str_details2= ""; EAP_HANDLER *handler; REQUEST *request; /* * Don't print this out in the normal course of * operations. */ if (debug_flag == 0) { return; } str_write_p = tls_session->info.origin ? ">>>" : "<<<"; switch (tls_session->info.version) { case SSL2_VERSION: str_version = "SSL 2.0"; break; case SSL3_VERSION: str_version = "SSL 3.0 "; break; case TLS1_VERSION: str_version = "TLS 1.0 "; break; default: str_version = "Unknown TLS version"; break; } if (tls_session->info.version == SSL3_VERSION || tls_session->info.version == TLS1_VERSION) { switch (tls_session->info.content_type) { case SSL3_RT_CHANGE_CIPHER_SPEC: str_content_type = "ChangeCipherSpec"; break; case SSL3_RT_ALERT: str_content_type = "Alert"; break; case SSL3_RT_HANDSHAKE: str_content_type = "Handshake"; break; case SSL3_RT_APPLICATION_DATA: str_content_type = "ApplicationData"; break; default: str_content_type = "UnknownContentType"; break; } if (tls_session->info.content_type == SSL3_RT_ALERT) { str_details1 = ", ???"; if (tls_session->info.record_len == 2) { switch (tls_session->info.alert_level) { case SSL3_AL_WARNING: str_details1 = ", warning"; break; case SSL3_AL_FATAL: str_details1 = ", fatal"; break; } str_details2 = " ???"; switch (tls_session->info.alert_description) { case SSL3_AD_CLOSE_NOTIFY: str_details2 = " close_notify"; break; case SSL3_AD_UNEXPECTED_MESSAGE: str_details2 = " unexpected_message"; break; case SSL3_AD_BAD_RECORD_MAC: str_details2 = " bad_record_mac"; break; case TLS1_AD_DECRYPTION_FAILED: str_details2 = " decryption_failed"; break; case TLS1_AD_RECORD_OVERFLOW: str_details2 = " record_overflow"; break; case SSL3_AD_DECOMPRESSION_FAILURE: str_details2 = " decompression_failure"; break; case SSL3_AD_HANDSHAKE_FAILURE: str_details2 = " handshake_failure"; break; case SSL3_AD_BAD_CERTIFICATE: str_details2 = " bad_certificate"; break; case SSL3_AD_UNSUPPORTED_CERTIFICATE: str_details2 = " unsupported_certificate"; break; case SSL3_AD_CERTIFICATE_REVOKED: str_details2 = " certificate_revoked"; break; case SSL3_AD_CERTIFICATE_EXPIRED: str_details2 = " certificate_expired"; break; case SSL3_AD_CERTIFICATE_UNKNOWN: str_details2 = " certificate_unknown"; break; case SSL3_AD_ILLEGAL_PARAMETER: str_details2 = " illegal_parameter"; break; case TLS1_AD_UNKNOWN_CA: str_details2 = " unknown_ca"; break; case TLS1_AD_ACCESS_DENIED: str_details2 = " access_denied"; break; case TLS1_AD_DECODE_ERROR: str_details2 = " decode_error"; break; case TLS1_AD_DECRYPT_ERROR: str_details2 = " decrypt_error"; break; case TLS1_AD_EXPORT_RESTRICTION: str_details2 = " export_restriction"; break; case TLS1_AD_PROTOCOL_VERSION: str_details2 = " protocol_version"; break; case TLS1_AD_INSUFFICIENT_SECURITY: str_details2 = " insufficient_security"; break; case TLS1_AD_INTERNAL_ERROR: str_details2 = " internal_error"; break; case TLS1_AD_USER_CANCELLED: str_details2 = " user_canceled"; break; case TLS1_AD_NO_RENEGOTIATION: str_details2 = " no_renegotiation"; break; } } } if (tls_session->info.content_type == SSL3_RT_HANDSHAKE) { str_details1 = "???"; if (tls_session->info.record_len > 0) switch (tls_session->info.handshake_type) { case SSL3_MT_HELLO_REQUEST: str_details1 = ", HelloRequest"; break; case SSL3_MT_CLIENT_HELLO: str_details1 = ", ClientHello"; break; case SSL3_MT_SERVER_HELLO: str_details1 = ", ServerHello"; break; case SSL3_MT_CERTIFICATE: str_details1 = ", Certificate"; break; case SSL3_MT_SERVER_KEY_EXCHANGE: str_details1 = ", ServerKeyExchange"; break; case SSL3_MT_CERTIFICATE_REQUEST: str_details1 = ", CertificateRequest"; break; case SSL3_MT_SERVER_DONE: str_details1 = ", ServerHelloDone"; break; case SSL3_MT_CERTIFICATE_VERIFY: str_details1 = ", CertificateVerify"; break; case SSL3_MT_CLIENT_KEY_EXCHANGE: str_details1 = ", ClientKeyExchange"; break; case SSL3_MT_FINISHED: str_details1 = ", Finished"; break; } } } snprintf(tls_session->info.info_description, sizeof(tls_session->info.info_description), "%s %s%s [length %04lx]%s%s\n", str_write_p, str_version, str_content_type, (unsigned long)tls_session->info.record_len, str_details1, str_details2); handler = (EAP_HANDLER *)SSL_get_ex_data(tls_session->ssl, 0); if (handler) { request = handler->request; } else { request = NULL; } RDEBUG2("%s\n", tls_session->info.info_description); } freeradius-server/src/modules/rlm_eap/mem.c000066400000000000000000000317151257552170400213320ustar00rootroot00000000000000/* * mem.c Memory allocation, deallocation stuff. * * Version: $Id$ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2000,2001,2006 The FreeRADIUS server project * Copyright 2001 hereUare Communications, Inc. */ #include RCSID("$Id$") #include #include "rlm_eap.h" #ifdef HAVE_PTHREAD_H #define PTHREAD_MUTEX_LOCK pthread_mutex_lock #define PTHREAD_MUTEX_UNLOCK pthread_mutex_unlock #else #define PTHREAD_MUTEX_LOCK(_x) #define PTHREAD_MUTEX_UNLOCK(_x) #endif /* * Allocate a new EAP_PACKET */ EAP_PACKET *eap_packet_alloc(void) { EAP_PACKET *rp; rp = rad_malloc(sizeof(EAP_PACKET)); memset(rp, 0, sizeof(EAP_PACKET)); return rp; } /* * Free EAP_PACKET */ void eap_packet_free(EAP_PACKET **eap_packet_ptr) { EAP_PACKET *eap_packet; if (!eap_packet_ptr) return; eap_packet = *eap_packet_ptr; if (!eap_packet) return; if (eap_packet->type.data) { /* * There's no packet, OR the type data isn't * pointing inside of the packet: free it. */ if ((eap_packet->packet == NULL) || (eap_packet->type.data != (eap_packet->packet + 5))) { free(eap_packet->type.data); } eap_packet->type.data = NULL; } if (eap_packet->packet) { free(eap_packet->packet); eap_packet->packet = NULL; } free(eap_packet); *eap_packet_ptr = NULL; } /* * Allocate a new EAP_PACKET */ EAP_DS *eap_ds_alloc(void) { EAP_DS *eap_ds; eap_ds = rad_malloc(sizeof(EAP_DS)); memset(eap_ds, 0, sizeof(EAP_DS)); if ((eap_ds->response = eap_packet_alloc()) == NULL) { eap_ds_free(&eap_ds); return NULL; } if ((eap_ds->request = eap_packet_alloc()) == NULL) { eap_ds_free(&eap_ds); return NULL; } return eap_ds; } void eap_ds_free(EAP_DS **eap_ds_p) { EAP_DS *eap_ds; if (!eap_ds_p) return; eap_ds = *eap_ds_p; if (!eap_ds) return; if (eap_ds->response) eap_packet_free(&(eap_ds->response)); if (eap_ds->request) eap_packet_free(&(eap_ds->request)); free(eap_ds); *eap_ds_p = NULL; } /* * Allocate a new EAP_HANDLER */ EAP_HANDLER *eap_handler_alloc(rlm_eap_t *inst) { EAP_HANDLER *handler; handler = rad_malloc(sizeof(EAP_HANDLER)); memset(handler, 0, sizeof(EAP_HANDLER)); if (inst->handler_tree) { PTHREAD_MUTEX_LOCK(&(inst->handler_mutex)); rbtree_insert(inst->handler_tree, handler); PTHREAD_MUTEX_UNLOCK(&(inst->handler_mutex)); } return handler; } void eap_opaque_free(EAP_HANDLER *handler) { if (!handler) return; eap_handler_free(handler->inst_holder, handler); } void eap_handler_free(rlm_eap_t *inst, EAP_HANDLER *handler) { if (!handler) return; if (inst->handler_tree) { PTHREAD_MUTEX_LOCK(&(inst->handler_mutex)); rbtree_deletebydata(inst->handler_tree, handler); PTHREAD_MUTEX_UNLOCK(&(inst->handler_mutex)); } if (handler->identity) { free(handler->identity); handler->identity = NULL; } if (handler->prev_eapds) eap_ds_free(&(handler->prev_eapds)); if (handler->eap_ds) eap_ds_free(&(handler->eap_ds)); if ((handler->opaque) && (handler->free_opaque)) { handler->free_opaque(handler->opaque); handler->opaque = NULL; } else if ((handler->opaque) && (handler->free_opaque == NULL)) radlog(L_ERR, "Possible memory leak ..."); handler->opaque = NULL; handler->free_opaque = NULL; if (handler->certs) pairfree(&handler->certs); free(handler); } typedef struct check_handler_t { rlm_eap_t *inst; EAP_HANDLER *handler; int trips; } check_handler_t; static void check_handler(void *data) { int do_warning = FALSE; uint8_t state[8]; check_handler_t *check = data; if (!check) return; if (!check->inst || !check->handler) { free(check); return; } if (!check->inst->handler_tree) goto done; PTHREAD_MUTEX_LOCK(&(check->inst->handler_mutex)); if (!rbtree_finddata(check->inst->handler_tree, check->handler)) { goto done; } /* * The session has continued *after* this packet. * Don't do a warning. */ if (check->handler->trips > check->trips) { goto done; } /* * No TLS means no warnings. */ if (!check->handler->tls) goto done; /* * If we're being deleted early, it's likely because we * received a transmit from the client that re-uses the * same RADIUS Id, which forces the current packet to be * deleted. In that case, ignore the error. */ if (time(NULL) < (check->handler->timestamp + 3)) goto done; if (!check->handler->finished) { do_warning = TRUE; memcpy(state, check->handler->state, sizeof(state)); } done: PTHREAD_MUTEX_UNLOCK(&(check->inst->handler_mutex)); free(check); if (do_warning) { DEBUG("WARNING: !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"); DEBUG("WARNING: !! EAP session for state 0x%02x%02x%02x%02x%02x%02x%02x%02x did not finish!", state[0], state[1], state[2], state[3], state[4], state[5], state[6], state[7]); DEBUG("WARNING: !! Please read http://wiki.freeradius.org/guide/Certificate_Compatibility"); DEBUG("WARNING: !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"); } } void eaptype_free(EAP_TYPES *i) { cf_section_parse_free(i->cs, i->type_data); if (i->type->detach) (i->type->detach)(i->type_data); i->type_data = NULL; #ifndef NDEBUG /* * Don't dlclose() modules if we're doing memory * debugging. This removes the symbols needed by * valgrind. */ if (!mainconfig.debug_memory) #endif if (i->handle) lt_dlclose(i->handle); free(i); } void eaplist_free(rlm_eap_t *inst) { EAP_HANDLER *node, *next; for (node = inst->session_head; node != NULL; node = next) { next = node->next; eap_handler_free(inst, node); } inst->session_head = inst->session_tail = NULL; } /* * Return a 32-bit random number. */ static uint32_t eap_rand(fr_randctx *ctx) { uint32_t num; num = ctx->randrsl[ctx->randcnt++]; if (ctx->randcnt >= 256) { ctx->randcnt = 0; fr_isaac(ctx); } return num; } static EAP_HANDLER *eaplist_delete(rlm_eap_t *inst, EAP_HANDLER *handler) { rbnode_t *node; node = rbtree_find(inst->session_tree, handler); if (!node) return NULL; handler = rbtree_node2data(inst->session_tree, node); /* * Delete old handler from the tree. */ rbtree_delete(inst->session_tree, node); /* * And unsplice it from the linked list. */ if (handler->prev) { handler->prev->next = handler->next; } else { inst->session_head = handler->next; } if (handler->next) { handler->next->prev = handler->prev; } else { inst->session_tail = handler->prev; } handler->prev = handler->next = NULL; return handler; } static void eaplist_expire(rlm_eap_t *inst, time_t timestamp) { int i; EAP_HANDLER *handler; /* * Check the first few handlers in the list, and delete * them if they're too old. We don't need to check them * all, as incoming requests will quickly cause older * handlers to be deleted. * */ for (i = 0; i < 3; i++) { handler = inst->session_head; if (!handler) break; /* * Expire entries from the start of the list. * They should be the oldest ones. */ if ((timestamp - handler->timestamp) > inst->timer_limit) { rbnode_t *node; node = rbtree_find(inst->session_tree, handler); rad_assert(node != NULL); rbtree_delete(inst->session_tree, node); /* * handler == inst->session_head */ inst->session_head = handler->next; if (handler->next) { handler->next->prev = NULL; } else { inst->session_head = NULL; inst->session_tail = NULL; } eap_handler_free(inst, handler); } } } /* * Add a handler to the set of active sessions. * * Since we're adding it to the list, we guess that this means * the packet needs a State attribute. So add one. */ int eaplist_add(rlm_eap_t *inst, EAP_HANDLER *handler) { int status = 0; VALUE_PAIR *state; REQUEST *request = handler->request; rad_assert(handler != NULL); rad_assert(request != NULL); /* * Generate State, since we've been asked to add it to * the list. */ state = pairmake("State", "0x00", T_OP_EQ); if (!state) return 0; /* * The time at which this request was made was the time * at which it was received by the RADIUS server. */ handler->timestamp = request->timestamp; handler->status = 1; handler->src_ipaddr = request->packet->src_ipaddr; handler->eap_id = handler->eap_ds->request->id; /* * Playing with a data structure shared among threads * means that we need a lock, to avoid conflict. */ PTHREAD_MUTEX_LOCK(&(inst->session_mutex)); /* * If we have a DoS attack, discard new sessions. */ if (rbtree_num_elements(inst->session_tree) >= inst->max_sessions) { status = -1; eaplist_expire(inst, handler->timestamp); goto done; } /* * Create a unique content for the State variable. * It will be modified slightly per round trip, but less so * than in 1.x. */ if (handler->trips == 0) { int i; for (i = 0; i < 4; i++) { uint32_t lvalue; lvalue = eap_rand(&inst->rand_pool); memcpy(handler->state + i * 4, &lvalue, sizeof(lvalue)); } } memcpy(state->vp_octets, handler->state, sizeof(handler->state)); state->length = EAP_STATE_LEN; /* * Add some more data to distinguish the sessions. */ state->vp_octets[4] = handler->trips ^ handler->state[0]; state->vp_octets[5] = handler->eap_id ^ handler->state[1]; state->vp_octets[6] = handler->eap_type ^ handler->state[2]; /* * and copy the state back again. */ memcpy(handler->state, state->vp_octets, sizeof(handler->state)); /* * Big-time failure. */ status = rbtree_insert(inst->session_tree, handler); /* * Catch Access-Challenge without response. */ if (inst->handler_tree) { check_handler_t *check = rad_malloc(sizeof(*check)); check->inst = inst; check->handler = handler; check->trips = handler->trips; request_data_add(request, inst, 0, check, check_handler); } if (status) { EAP_HANDLER *prev; prev = inst->session_tail; if (prev) { prev->next = handler; handler->prev = prev; handler->next = NULL; inst->session_tail = handler; } else { inst->session_head = inst->session_tail = handler; handler->next = handler->prev = NULL; } } /* * Now that we've finished mucking with the list, * unlock it. */ done: /* * We don't need this any more. */ if (status > 0) handler->request = NULL; PTHREAD_MUTEX_UNLOCK(&(inst->session_mutex)); if (status <= 0) { pairfree(&state); if (status < 0) { static time_t last_logged = 0; if (last_logged < handler->timestamp) { last_logged = handler->timestamp; radlog(L_ERR, "rlm_eap: Too many open sessions. Try increasing \"max_sessions\" in the EAP module configuration"); } } else { radlog(L_ERR, "rlm_eap: Internal error: failed to store handler"); } return 0; } pairadd(&(request->reply->vps), state); return 1; } /* * Find a a previous EAP-Request sent by us, which matches * the current EAP-Response. * * Then, release the handle from the list, and return it to * the caller. * * Also since we fill the eap_ds with the present EAP-Response we * got to free the prev_eapds & move the eap_ds to prev_eapds */ EAP_HANDLER *eaplist_find(rlm_eap_t *inst, REQUEST *request, eap_packet_t *eap_packet) { VALUE_PAIR *state; EAP_HANDLER *handler, myHandler; /* * We key the sessions off of the 'state' attribute, so it * must exist. */ state = pairfind(request->packet->vps, PW_STATE); if (!state || (state->length != EAP_STATE_LEN)) { return NULL; } myHandler.src_ipaddr = request->packet->src_ipaddr; myHandler.eap_id = eap_packet->id; memcpy(myHandler.state, state->vp_strvalue, sizeof(myHandler.state)); /* * Playing with a data structure shared among threads * means that we need a lock, to avoid conflict. */ PTHREAD_MUTEX_LOCK(&(inst->session_mutex)); eaplist_expire(inst, request->timestamp); handler = eaplist_delete(inst, &myHandler); PTHREAD_MUTEX_UNLOCK(&(inst->session_mutex)); /* * Might not have been there. */ if (!handler) { radlog(L_ERR, "rlm_eap: No EAP session matching the State variable."); return NULL; } if (handler->trips >= 50) { RDEBUG2("More than 50 authentication packets for this EAP session. Aborted."); eap_handler_free(inst, handler); return NULL; } handler->trips++; RDEBUG2("Request found, released from the list"); /* * Remember what the previous request was. */ eap_ds_free(&(handler->prev_eapds)); handler->prev_eapds = handler->eap_ds; handler->eap_ds = NULL; return handler; } freeradius-server/src/modules/rlm_eap/radeapclient.c000066400000000000000000001105511257552170400232030ustar00rootroot00000000000000/* * radeapclient.c EAP specific radius packet debug tool. * * Version: $Id$ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2000,2006 The FreeRADIUS server project * Copyright 2000 Miquel van Smoorenburg * Copyright 2000 Alan DeKok */ #include RCSID("$Id$") #include #include #if HAVE_GETOPT_H # include #endif #include #include #include #include "eap_types.h" #include "eap_sim.h" extern int sha1_data_problems; static int retries = 10; static float timeout = 3; static const char *secret = NULL; static int do_output = 1; static int do_summary = 0; static int filedone = 0; static int totalapp = 0; static int totaldeny = 0; static char filesecret[256]; const char *radius_dir = RADDBDIR; const char *progname = "radeapclient"; /* fr_randctx randctx; */ radlog_dest_t radlog_dest = RADLOG_STDERR; const char *radlog_dir = NULL; int debug_flag = 0; char password[256]; struct eapsim_keys eapsim_mk; static void map_eap_types(RADIUS_PACKET *req); static void unmap_eap_types(RADIUS_PACKET *rep); static int map_eapsim_types(RADIUS_PACKET *r); static int unmap_eapsim_types(RADIUS_PACKET *r); void debug_pair_list(UNUSED VALUE_PAIR *vp) { return; } static void NEVER_RETURNS usage(void) { fprintf(stderr, "Usage: radeapclient [options] server[:port] []\n"); fprintf(stderr, " One of auth, acct, status, or disconnect.\n"); fprintf(stderr, " -c count Send each packet 'count' times.\n"); fprintf(stderr, " -d raddb Set dictionary directory.\n"); fprintf(stderr, " -f file Read packets from file, not stdin.\n"); fprintf(stderr, " -r retries If timeout, retry sending the packet 'retries' times.\n"); fprintf(stderr, " -t timeout Wait 'timeout' seconds before retrying (may be a floating point number).\n"); fprintf(stderr, " -h Print usage help information.\n"); fprintf(stderr, " -i id Set request id to 'id'. Values may be 0..255\n"); fprintf(stderr, " -S file read secret from file, not command line.\n"); fprintf(stderr, " -q Do not print anything out.\n"); fprintf(stderr, " -s Print out summary information of auth results.\n"); fprintf(stderr, " -v Show program version information.\n"); fprintf(stderr, " -x Debugging mode.\n"); fprintf(stderr, " -4 Use IPv4 address of server\n"); fprintf(stderr, " -6 Use IPv6 address of server.\n"); exit(1); } int radlog(int lvl, const char *msg, ...) { va_list ap; int r; r = lvl; /* shut up compiler */ va_start(ap, msg); r = vfprintf(stderr, msg, ap); va_end(ap); fputc('\n', stderr); return r; } int log_debug(const char *msg, ...) { va_list ap; int r; va_start(ap, msg); r = vfprintf(stderr, msg, ap); va_end(ap); fputc('\n', stderr); return r; } void radlog_request(UNUSED int lvl, UNUSED int priority, UNUSED REQUEST *request, const char *msg, ...) { va_list ap; va_start(ap, msg); vfprintf(stderr, msg, ap); va_end(ap); fputc('\n', stderr); } static int getport(const char *name) { struct servent *svp; svp = getservbyname (name, "udp"); if (!svp) { return 0; } return ntohs(svp->s_port); } #define R_RECV (0) #define R_SENT (1) static void debug_packet(RADIUS_PACKET *packet, int direction) { VALUE_PAIR *vp; char buffer[1024]; const char *received, *from; const fr_ipaddr_t *ip; int port; if (!packet) return; if (direction == 0) { received = "Received"; from = "from"; /* what else? */ ip = &packet->src_ipaddr; port = packet->src_port; } else { received = "Sending"; from = "to"; /* hah! */ ip = &packet->dst_ipaddr; port = packet->dst_port; } /* * Client-specific debugging re-prints the input * packet into the client log. * * This really belongs in a utility library */ if ((packet->code > 0) && (packet->code < FR_MAX_PACKET_CODE)) { printf("%s %s packet %s host %s port %d, id=%d, length=%d\n", received, fr_packet_codes[packet->code], from, inet_ntop(ip->af, &ip->ipaddr, buffer, sizeof(buffer)), port, packet->id, packet->data_len); } else { printf("%s packet %s host %s port %d code=%d, id=%d, length=%d\n", received, from, inet_ntop(ip->af, &ip->ipaddr, buffer, sizeof(buffer)), port, packet->code, packet->id, packet->data_len); } for (vp = packet->vps; vp != NULL; vp = vp->next) { vp_prints(buffer, sizeof(buffer), vp); printf("\t%s\n", buffer); } fflush(stdout); } static int send_packet(RADIUS_PACKET *req, RADIUS_PACKET **rep) { int i; struct timeval tv; for (i = 0; i < retries; i++) { fd_set rdfdesc; debug_packet(req, R_SENT); rad_send(req, NULL, secret); /* And wait for reply, timing out as necessary */ FD_ZERO(&rdfdesc); FD_SET(req->sockfd, &rdfdesc); tv.tv_sec = (int)timeout; tv.tv_usec = 1000000 * (timeout - (int) timeout); /* Something's wrong if we don't get exactly one fd. */ if (select(req->sockfd + 1, &rdfdesc, NULL, NULL, &tv) != 1) { continue; } *rep = rad_recv(req->sockfd, 0); if (*rep != NULL) { /* * If we get a response from a machine * which we did NOT send a request to, * then complain. */ if (((*rep)->src_ipaddr.af != req->dst_ipaddr.af) || (memcmp(&(*rep)->src_ipaddr.ipaddr, &req->dst_ipaddr.ipaddr, ((req->dst_ipaddr.af == AF_INET ? /* AF_INET6? */ sizeof(req->dst_ipaddr.ipaddr.ip4addr) : /* FIXME: AF_INET6 */ sizeof(req->dst_ipaddr.ipaddr.ip6addr)))) != 0) || ((*rep)->src_port != req->dst_port)) { char src[128], dst[128]; ip_ntoh(&(*rep)->src_ipaddr, src, sizeof(src)); ip_ntoh(&req->dst_ipaddr, dst, sizeof(dst)); fprintf(stderr, "radclient: ERROR: Sent request to host %s port %d, got response from host %s port %d\n!", dst, req->dst_port, src, (*rep)->src_port); exit(1); } break; } else { /* NULL: couldn't receive the packet */ fr_perror("radclient:"); exit(1); } } /* No response or no data read (?) */ if (i == retries) { fprintf(stderr, "radclient: no response from server\n"); exit(1); } /* * FIXME: Discard the packet & listen for another. * * Hmm... we should really be using eapol_test, which does * a lot more than radeapclient. */ if (rad_verify(*rep, req, secret) != 0) { fr_perror("rad_verify"); exit(1); } if (rad_decode(*rep, req, secret) != 0) { fr_perror("rad_decode"); exit(1); } /* libradius debug already prints out the value pairs for us */ if (!fr_debug_flag && do_output) { debug_packet(*rep, R_RECV); } if((*rep)->code == PW_AUTHENTICATION_ACK) { totalapp++; } else if ((*rep)->code == PW_AUTHENTICATION_REJECT) { totaldeny++; } return 0; } static void cleanresp(RADIUS_PACKET *resp) { VALUE_PAIR *vpnext, *vp, **last; /* * maybe should just copy things we care about, or keep * a copy of the original input and start from there again? */ pairdelete(&resp->vps, PW_EAP_MESSAGE); pairdelete(&resp->vps, ATTRIBUTE_EAP_BASE+PW_EAP_IDENTITY); last = &resp->vps; for(vp = *last; vp != NULL; vp = vpnext) { vpnext = vp->next; if((vp->attribute > ATTRIBUTE_EAP_BASE && vp->attribute <= ATTRIBUTE_EAP_BASE+256) || (vp->attribute > ATTRIBUTE_EAP_SIM_BASE && vp->attribute <= ATTRIBUTE_EAP_SIM_BASE+256)) { *last = vpnext; pairbasicfree(vp); } else { last = &vp->next; } } } /* * we got an EAP-Request/Sim/Start message in a legal state. * * pick a supported version, put it into the reply, and insert a nonce. */ static int process_eap_start(RADIUS_PACKET *req, RADIUS_PACKET *rep) { VALUE_PAIR *vp, *newvp; VALUE_PAIR *anyidreq_vp, *fullauthidreq_vp, *permanentidreq_vp; uint16_t *versions, selectedversion; unsigned int i,versioncount; /* form new response clear of any EAP stuff */ cleanresp(rep); if((vp = pairfind(req->vps, ATTRIBUTE_EAP_SIM_BASE+PW_EAP_SIM_VERSION_LIST)) == NULL) { fprintf(stderr, "illegal start message has no VERSION_LIST\n"); return 0; } versions = (uint16_t *)vp->vp_strvalue; /* verify that the attribute length is big enough for a length field */ if(vp->length < 4) { fprintf(stderr, "start message has illegal VERSION_LIST. Too short: %u\n", (unsigned int) vp->length); return 0; } versioncount = ntohs(versions[0])/2; /* verify that the attribute length is big enough for the given number * of versions present. */ if((unsigned)vp->length <= (versioncount*2 + 2)) { fprintf(stderr, "start message is too short. Claimed %d versions does not fit in %u bytes\n", versioncount, (unsigned int) vp->length); return 0; } /* * record the versionlist for the MK calculation. */ eapsim_mk.versionlistlen = versioncount*2; memcpy(eapsim_mk.versionlist, (unsigned char *)(versions+1), eapsim_mk.versionlistlen); /* walk the version list, and pick the one we support, which * at present, is 1, EAP_SIM_VERSION. */ selectedversion=0; for(i=0; i < versioncount; i++) { if(ntohs(versions[i+1]) == EAP_SIM_VERSION) { selectedversion=EAP_SIM_VERSION; break; } } if(selectedversion == 0) { fprintf(stderr, "eap-sim start message. No compatible version found. We need %d\n", EAP_SIM_VERSION); for(i=0; i < versioncount; i++) { fprintf(stderr, "\tfound version %d\n", ntohs(versions[i+1])); } } /* * now make sure that we have only FULLAUTH_ID_REQ. * I think that it actually might not matter - we can answer in * anyway we like, but it is illegal to have more than one * present. */ anyidreq_vp = pairfind(req->vps, ATTRIBUTE_EAP_SIM_BASE+PW_EAP_SIM_ANY_ID_REQ); fullauthidreq_vp = pairfind(req->vps, ATTRIBUTE_EAP_SIM_BASE+PW_EAP_SIM_FULLAUTH_ID_REQ); permanentidreq_vp = pairfind(req->vps, ATTRIBUTE_EAP_SIM_BASE+PW_EAP_SIM_PERMANENT_ID_REQ); if(fullauthidreq_vp == NULL || anyidreq_vp != NULL || permanentidreq_vp != NULL) { fprintf(stderr, "start message has %sanyidreq, %sfullauthid and %spermanentid. Illegal combination.\n", (anyidreq_vp != NULL ? "a " : "no "), (fullauthidreq_vp != NULL ? "a " : "no "), (permanentidreq_vp != NULL ? "a " : "no ")); return 0; } /* okay, we have just any_id_req there, so fill in response */ /* mark the subtype as being EAP-SIM/Response/Start */ newvp = paircreate(ATTRIBUTE_EAP_SIM_SUBTYPE, PW_TYPE_INTEGER); newvp->vp_integer = eapsim_start; pairreplace(&(rep->vps), newvp); /* insert selected version into response. */ newvp = paircreate(ATTRIBUTE_EAP_SIM_BASE+PW_EAP_SIM_SELECTED_VERSION, PW_TYPE_OCTETS); versions = (uint16_t *)newvp->vp_strvalue; versions[0] = htons(selectedversion); newvp->length = 2; pairreplace(&(rep->vps), newvp); /* record the selected version */ memcpy(eapsim_mk.versionselect, (unsigned char *)versions, 2); vp = newvp = NULL; { uint32_t nonce[4]; /* * insert a nonce_mt that we make up. */ newvp = paircreate(ATTRIBUTE_EAP_SIM_BASE+PW_EAP_SIM_NONCE_MT, PW_TYPE_OCTETS); newvp->vp_octets[0]=0; newvp->vp_octets[1]=0; newvp->length = 18; /* 16 bytes of nonce + padding */ nonce[0]=fr_rand(); nonce[1]=fr_rand(); nonce[2]=fr_rand(); nonce[3]=fr_rand(); memcpy(&newvp->vp_octets[2], nonce, 16); pairreplace(&(rep->vps), newvp); /* also keep a copy of the nonce! */ memcpy(eapsim_mk.nonce_mt, nonce, 16); } { uint16_t *pidlen, idlen; /* * insert the identity here. */ vp = pairfind(rep->vps, PW_USER_NAME); if(vp == NULL) { fprintf(stderr, "eap-sim: We need to have a User-Name attribute!\n"); return 0; } newvp = paircreate(ATTRIBUTE_EAP_SIM_BASE+PW_EAP_SIM_IDENTITY, PW_TYPE_OCTETS); idlen = strlen(vp->vp_strvalue); pidlen = (uint16_t *)newvp->vp_strvalue; *pidlen = htons(idlen); newvp->length = idlen + 2; memcpy(&newvp->vp_strvalue[2], vp->vp_strvalue, idlen); pairreplace(&(rep->vps), newvp); /* record it */ memcpy(eapsim_mk.identity, vp->vp_strvalue, idlen); eapsim_mk.identitylen = idlen; } return 1; } /* * we got an EAP-Request/Sim/Challenge message in a legal state. * * use the RAND challenge to produce the SRES result, and then * use that to generate a new MAC. * * for the moment, we ignore the RANDs, then just plug in the SRES * values. * */ static int process_eap_challenge(RADIUS_PACKET *req, RADIUS_PACKET *rep) { VALUE_PAIR *newvp; VALUE_PAIR *mac, *randvp; VALUE_PAIR *sres1,*sres2,*sres3; VALUE_PAIR *Kc1, *Kc2, *Kc3; uint8_t calcmac[20]; /* look for the AT_MAC and the challenge data */ mac = pairfind(req->vps, ATTRIBUTE_EAP_SIM_BASE+PW_EAP_SIM_MAC); randvp= pairfind(req->vps, ATTRIBUTE_EAP_SIM_BASE+PW_EAP_SIM_RAND); if(mac == NULL || randvp == NULL) { fprintf(stderr, "radeapclient: challenge message needs to contain RAND and MAC\n"); return 0; } /* * compare RAND with randX, to verify this is the right response * to this challenge. */ { VALUE_PAIR *randcfgvp[3]; uint8_t *randcfg[3]; randcfg[0] = &randvp->vp_octets[2]; randcfg[1] = &randvp->vp_octets[2+EAPSIM_RAND_SIZE]; randcfg[2] = &randvp->vp_octets[2+EAPSIM_RAND_SIZE*2]; randcfgvp[0] = pairfind(rep->vps, ATTRIBUTE_EAP_SIM_RAND1); randcfgvp[1] = pairfind(rep->vps, ATTRIBUTE_EAP_SIM_RAND2); randcfgvp[2] = pairfind(rep->vps, ATTRIBUTE_EAP_SIM_RAND3); if(randcfgvp[0] == NULL || randcfgvp[1] == NULL || randcfgvp[2] == NULL) { fprintf(stderr, "radeapclient: needs to have rand1, 2 and 3 set.\n"); return 0; } if(memcmp(randcfg[0], randcfgvp[0]->vp_octets, EAPSIM_RAND_SIZE)!=0 || memcmp(randcfg[1], randcfgvp[1]->vp_octets, EAPSIM_RAND_SIZE)!=0 || memcmp(randcfg[2], randcfgvp[2]->vp_octets, EAPSIM_RAND_SIZE)!=0) { int rnum,i,j; fprintf(stderr, "radeapclient: one of rand 1,2,3 didn't match\n"); for(rnum = 0; rnum < 3; rnum++) { fprintf(stderr, "received rand %d: ", rnum); j=0; for (i = 0; i < EAPSIM_RAND_SIZE; i++) { if(j==4) { printf("_"); j=0; } j++; fprintf(stderr, "%02x", randcfg[rnum][i]); } fprintf(stderr, "\nconfigured rand %d: ", rnum); j=0; for (i = 0; i < EAPSIM_RAND_SIZE; i++) { if(j==4) { printf("_"); j=0; } j++; fprintf(stderr, "%02x", randcfgvp[rnum]->vp_octets[i]); } fprintf(stderr, "\n"); } return 0; } } /* * now dig up the sres values from the response packet, * which were put there when we read things in. * * Really, they should be calculated from the RAND! * */ sres1 = pairfind(rep->vps, ATTRIBUTE_EAP_SIM_SRES1); sres2 = pairfind(rep->vps, ATTRIBUTE_EAP_SIM_SRES2); sres3 = pairfind(rep->vps, ATTRIBUTE_EAP_SIM_SRES3); if(sres1 == NULL || sres2 == NULL || sres3 == NULL) { fprintf(stderr, "radeapclient: needs to have sres1, 2 and 3 set.\n"); return 0; } memcpy(eapsim_mk.sres[0], sres1->vp_strvalue, sizeof(eapsim_mk.sres[0])); memcpy(eapsim_mk.sres[1], sres2->vp_strvalue, sizeof(eapsim_mk.sres[1])); memcpy(eapsim_mk.sres[2], sres3->vp_strvalue, sizeof(eapsim_mk.sres[2])); Kc1 = pairfind(rep->vps, ATTRIBUTE_EAP_SIM_KC1); Kc2 = pairfind(rep->vps, ATTRIBUTE_EAP_SIM_KC2); Kc3 = pairfind(rep->vps, ATTRIBUTE_EAP_SIM_KC3); if(Kc1 == NULL || Kc2 == NULL || Kc3 == NULL) { fprintf(stderr, "radeapclient: needs to have Kc1, 2 and 3 set.\n"); return 0; } memcpy(eapsim_mk.Kc[0], Kc1->vp_strvalue, sizeof(eapsim_mk.Kc[0])); memcpy(eapsim_mk.Kc[1], Kc2->vp_strvalue, sizeof(eapsim_mk.Kc[1])); memcpy(eapsim_mk.Kc[2], Kc3->vp_strvalue, sizeof(eapsim_mk.Kc[2])); /* all set, calculate keys */ eapsim_calculate_keys(&eapsim_mk); if(debug_flag) { eapsim_dump_mk(&eapsim_mk); } /* verify the MAC, now that we have all the keys. */ if(eapsim_checkmac(req->vps, eapsim_mk.K_aut, eapsim_mk.nonce_mt, sizeof(eapsim_mk.nonce_mt), calcmac)) { printf("MAC check succeed\n"); } else { int i, j; j=0; printf("calculated MAC ("); for (i = 0; i < 20; i++) { if(j==4) { printf("_"); j=0; } j++; printf("%02x", calcmac[i]); } printf(" did not match\n"); return 0; } /* form new response clear of any EAP stuff */ cleanresp(rep); /* mark the subtype as being EAP-SIM/Response/Start */ newvp = paircreate(ATTRIBUTE_EAP_SIM_SUBTYPE, PW_TYPE_INTEGER); newvp->vp_integer = eapsim_challenge; pairreplace(&(rep->vps), newvp); /* * fill the SIM_MAC with a field that will in fact get appended * to the packet before the MAC is calculated */ newvp = paircreate(ATTRIBUTE_EAP_SIM_BASE+PW_EAP_SIM_MAC, PW_TYPE_OCTETS); memcpy(newvp->vp_strvalue+EAPSIM_SRES_SIZE*0, sres1->vp_strvalue, EAPSIM_SRES_SIZE); memcpy(newvp->vp_strvalue+EAPSIM_SRES_SIZE*1, sres2->vp_strvalue, EAPSIM_SRES_SIZE); memcpy(newvp->vp_strvalue+EAPSIM_SRES_SIZE*2, sres3->vp_strvalue, EAPSIM_SRES_SIZE); newvp->length = EAPSIM_SRES_SIZE*3; pairreplace(&(rep->vps), newvp); newvp = paircreate(ATTRIBUTE_EAP_SIM_KEY, PW_TYPE_OCTETS); memcpy(newvp->vp_strvalue, eapsim_mk.K_aut, EAPSIM_AUTH_SIZE); newvp->length = EAPSIM_AUTH_SIZE; pairreplace(&(rep->vps), newvp); return 1; } /* * this code runs the EAP-SIM client state machine. * the *request* is from the server. * the *reponse* is to the server. * */ static int respond_eap_sim(RADIUS_PACKET *req, RADIUS_PACKET *resp) { enum eapsim_clientstates state, newstate; enum eapsim_subtype subtype; VALUE_PAIR *vp, *statevp, *radstate, *eapid; char statenamebuf[32], subtypenamebuf[32]; if ((radstate = paircopy2(req->vps, PW_STATE)) == NULL) { return 0; } if ((eapid = paircopy2(req->vps, ATTRIBUTE_EAP_ID)) == NULL) { return 0; } /* first, dig up the state from the request packet, setting * outselves to be in EAP-SIM-Start state if there is none. */ if((statevp = pairfind(resp->vps, ATTRIBUTE_EAP_SIM_STATE)) == NULL) { /* must be initial request */ statevp = paircreate(ATTRIBUTE_EAP_SIM_STATE, PW_TYPE_INTEGER); statevp->vp_integer = eapsim_client_init; pairreplace(&(resp->vps), statevp); } state = statevp->vp_integer; /* * map the attributes, and authenticate them. */ unmap_eapsim_types(req); if((vp = pairfind(req->vps, ATTRIBUTE_EAP_SIM_SUBTYPE)) == NULL) { return 0; } subtype = vp->vp_integer; /* * look for the appropriate state, and process incoming message */ switch(state) { case eapsim_client_init: switch(subtype) { case eapsim_start: newstate = process_eap_start(req, resp); break; case eapsim_challenge: case eapsim_notification: case eapsim_reauth: default: fprintf(stderr, "radeapclient: sim in state %s message %s is illegal. Reply dropped.\n", sim_state2name(state, statenamebuf, sizeof(statenamebuf)), sim_subtype2name(subtype, subtypenamebuf, sizeof(subtypenamebuf))); /* invalid state, drop message */ return 0; } break; case eapsim_client_start: switch(subtype) { case eapsim_start: /* NOT SURE ABOUT THIS ONE, retransmit, I guess */ newstate = process_eap_start(req, resp); break; case eapsim_challenge: newstate = process_eap_challenge(req, resp); break; default: fprintf(stderr, "radeapclient: sim in state %s message %s is illegal. Reply dropped.\n", sim_state2name(state, statenamebuf, sizeof(statenamebuf)), sim_subtype2name(subtype, subtypenamebuf, sizeof(subtypenamebuf))); /* invalid state, drop message */ return 0; } break; default: fprintf(stderr, "radeapclient: sim in illegal state %s\n", sim_state2name(state, statenamebuf, sizeof(statenamebuf))); return 0; } /* copy the eap state object in */ pairreplace(&(resp->vps), eapid); /* update stete info, and send new packet */ map_eapsim_types(resp); /* copy the radius state object in */ pairreplace(&(resp->vps), radstate); statevp->vp_integer = newstate; return 1; } static int respond_eap_md5(RADIUS_PACKET *req, RADIUS_PACKET *rep) { VALUE_PAIR *vp, *id, *state; size_t valuesize, namesize; uint8_t identifier; uint8_t *value; uint8_t *name; FR_MD5_CTX context; uint8_t response[16]; cleanresp(rep); if ((state = paircopy2(req->vps, PW_STATE)) == NULL) { fprintf(stderr, "radeapclient: no state attribute found\n"); return 0; } if ((id = paircopy2(req->vps, ATTRIBUTE_EAP_ID)) == NULL) { fprintf(stderr, "radeapclient: no EAP-ID attribute found\n"); return 0; } identifier = id->vp_integer; if ((vp = pairfind(req->vps, ATTRIBUTE_EAP_BASE+PW_EAP_MD5)) == NULL) { fprintf(stderr, "radeapclient: no EAP-MD5 attribute found\n"); return 0; } /* got the details of the MD5 challenge */ valuesize = vp->vp_octets[0]; value = &vp->vp_octets[1]; name = &vp->vp_octets[valuesize+1]; namesize = vp->length - (valuesize + 1); /* sanitize items */ if(valuesize > vp->length) { fprintf(stderr, "radeapclient: md5 valuesize if too big (%u > %u)\n", (unsigned int) valuesize, (unsigned int) vp->length); return 0; } /* now do the CHAP operation ourself, rather than build the * buffer. We could also call rad_chap_encode, but it wants * a CHAP-Challenge, which we don't want to bother with. */ fr_MD5Init(&context); fr_MD5Update(&context, &identifier, 1); fr_MD5Update(&context, (uint8_t *) password, strlen(password)); fr_MD5Update(&context, value, valuesize); fr_MD5Final(response, &context); vp = paircreate(ATTRIBUTE_EAP_BASE+PW_EAP_MD5, PW_TYPE_OCTETS); vp->vp_octets[0]=16; memcpy(&vp->vp_strvalue[1], response, 16); vp->length = 17; pairreplace(&(rep->vps), vp); pairreplace(&(rep->vps), id); /* copy the state object in */ pairreplace(&(rep->vps), state); return 1; } static int sendrecv_eap(RADIUS_PACKET *rep) { RADIUS_PACKET *req = NULL; VALUE_PAIR *vp, *vpnext; int tried_eap_md5 = 0; /* * Keep a copy of the the User-Password attribute. */ if ((vp = pairfind(rep->vps, PW_CLEARTEXT_PASSWORD)) != NULL) { strlcpy(password, (char *)vp->vp_strvalue, sizeof(vp->vp_strvalue)); } else if ((vp = pairfind(rep->vps, PW_USER_PASSWORD)) != NULL) { strlcpy(password, (char *)vp->vp_strvalue, sizeof(vp->vp_strvalue)); /* * Otherwise keep a copy of the CHAP-Password attribute. */ } else if ((vp = pairfind(rep->vps, PW_CHAP_PASSWORD)) != NULL) { strlcpy(password, (char *)vp->vp_strvalue, sizeof(vp->vp_strvalue)); } else { *password = '\0'; } again: rep->id++; /* * if there are EAP types, encode them into an EAP-Message * */ map_eap_types(rep); /* * Fix up Digest-Attributes issues */ for (vp = rep->vps; vp != NULL; vp = vp->next) { switch (vp->attribute) { default: break; case PW_DIGEST_REALM: case PW_DIGEST_NONCE: case PW_DIGEST_METHOD: case PW_DIGEST_URI: case PW_DIGEST_QOP: case PW_DIGEST_ALGORITHM: case PW_DIGEST_BODY_DIGEST: case PW_DIGEST_CNONCE: case PW_DIGEST_NONCE_COUNT: case PW_DIGEST_USER_NAME: /* overlapping! */ memmove(&vp->vp_strvalue[2], &vp->vp_octets[0], vp->length); vp->vp_octets[0] = vp->attribute - PW_DIGEST_REALM + 1; vp->length += 2; vp->vp_octets[1] = vp->length; vp->attribute = PW_DIGEST_ATTRIBUTES; break; } } /* * If we've already sent a packet, free up the old * one, and ensure that the next packet has a unique * ID and authentication vector. */ if (rep->data) { free(rep->data); rep->data = NULL; } fr_md5_calc(rep->vector, rep->vector, sizeof(rep->vector)); if (*password != '\0') { if ((vp = pairfind(rep->vps, PW_CLEARTEXT_PASSWORD)) != NULL) { strlcpy((char *)vp->vp_strvalue, password, sizeof(vp->vp_strvalue)); vp->length = strlen(password); } else if ((vp = pairfind(rep->vps, PW_USER_PASSWORD)) != NULL) { strlcpy((char *)vp->vp_strvalue, password, sizeof(vp->vp_strvalue)); vp->length = strlen(password); } else if ((vp = pairfind(rep->vps, PW_CHAP_PASSWORD)) != NULL) { strlcpy((char *)vp->vp_strvalue, password, sizeof(vp->vp_strvalue)); vp->length = strlen(password); rad_chap_encode(rep, vp->vp_octets, rep->id, vp); vp->length = 17; } } /* there WAS a password */ /* send the response, wait for the next request */ send_packet(rep, &req); /* okay got back the packet, go and decode the EAP-Message. */ unmap_eap_types(req); debug_packet(req, R_RECV); /* now look for the code type. */ for (vp = req->vps; vp != NULL; vp = vpnext) { vpnext = vp->next; switch (vp->attribute) { default: break; case ATTRIBUTE_EAP_BASE+PW_EAP_MD5: if(respond_eap_md5(req, rep) && tried_eap_md5 < 3) { tried_eap_md5++; goto again; } break; case ATTRIBUTE_EAP_BASE+PW_EAP_SIM: if(respond_eap_sim(req, rep)) { goto again; } break; } } return 1; } int main(int argc, char **argv) { RADIUS_PACKET *req; char *p; int c; int port = 0; char *filename = NULL; FILE *fp; int count = 1; int id; int force_af = AF_UNSPEC; id = ((int)getpid() & 0xff); fr_debug_flag = 0; radlog_dest = RADLOG_STDERR; while ((c = getopt(argc, argv, "46c:d:f:hi:qst:r:S:xXv")) != EOF) { switch(c) { case '4': force_af = AF_INET; break; case '6': force_af = AF_INET6; break; case 'c': if (!isdigit((int) *optarg)) usage(); count = atoi(optarg); break; case 'd': radius_dir = optarg; break; case 'f': filename = optarg; break; case 'q': do_output = 0; break; case 'x': debug_flag++; fr_debug_flag++; break; case 'X': #if 0 sha1_data_problems = 1; /* for debugging only */ #endif break; case 'r': if (!isdigit((int) *optarg)) usage(); retries = atoi(optarg); break; case 'i': if (!isdigit((int) *optarg)) usage(); id = atoi(optarg); if ((id < 0) || (id > 255)) { usage(); } break; case 's': do_summary = 1; break; case 't': if (!isdigit((int) *optarg)) usage(); timeout = atof(optarg); break; case 'v': printf("radclient: $Id$ built on " __DATE__ " at " __TIME__ "\n"); exit(0); break; case 'S': fp = fopen(optarg, "r"); if (!fp) { fprintf(stderr, "radclient: Error opening %s: %s\n", optarg, strerror(errno)); exit(1); } if (fgets(filesecret, sizeof(filesecret), fp) == NULL) { fprintf(stderr, "radclient: Error reading %s: %s\n", optarg, strerror(errno)); exit(1); } fclose(fp); /* truncate newline */ p = filesecret + strlen(filesecret) - 1; while ((p >= filesecret) && (*p < ' ')) { *p = '\0'; --p; } if (strlen(filesecret) < 2) { fprintf(stderr, "radclient: Secret in %s is too short\n", optarg); exit(1); } secret = filesecret; break; case 'h': default: usage(); break; } } argc -= (optind - 1); argv += (optind - 1); if ((argc < 3) || ((secret == NULL) && (argc < 4))) { usage(); } if (dict_init(radius_dir, RADIUS_DICTIONARY) < 0) { fr_perror("radclient"); return 1; } if ((req = rad_alloc(1)) == NULL) { fr_perror("radclient"); exit(1); } #if 0 { FILE *randinit; if((randinit = fopen("/dev/urandom", "r")) == NULL) { perror("/dev/urandom"); } else { fread(randctx.randrsl, 256, 1, randinit); fclose(randinit); } } fr_randinit(&randctx, 1); #endif req->id = id; /* * Resolve hostname. */ if (force_af == AF_UNSPEC) force_af = AF_INET; req->dst_ipaddr.af = force_af; if (strcmp(argv[1], "-") != 0) { const char *hostname = argv[1]; const char *portname = argv[1]; char buffer[256]; if (*argv[1] == '[') { /* IPv6 URL encoded */ p = strchr(argv[1], ']'); if ((size_t) (p - argv[1]) >= sizeof(buffer)) { usage(); } memcpy(buffer, argv[1] + 1, p - argv[1] - 1); buffer[p - argv[1] - 1] = '\0'; hostname = buffer; portname = p + 1; } p = strchr(portname, ':'); if (p && (strchr(p + 1, ':') == NULL)) { *p = '\0'; portname = p + 1; } else { portname = NULL; } if (ip_hton(hostname, force_af, &req->dst_ipaddr) < 0) { fprintf(stderr, "radclient: Failed to find IP address for host %s: %s\n", hostname, strerror(errno)); exit(1); } /* * Strip port from hostname if needed. */ if (portname) port = atoi(portname); } /* * See what kind of request we want to send. */ if (strcmp(argv[2], "auth") == 0) { if (port == 0) port = getport("radius"); if (port == 0) port = PW_AUTH_UDP_PORT; req->code = PW_AUTHENTICATION_REQUEST; } else if (strcmp(argv[2], "acct") == 0) { if (port == 0) port = getport("radacct"); if (port == 0) port = PW_ACCT_UDP_PORT; req->code = PW_ACCOUNTING_REQUEST; do_summary = 0; } else if (strcmp(argv[2], "status") == 0) { if (port == 0) port = getport("radius"); if (port == 0) port = PW_AUTH_UDP_PORT; req->code = PW_STATUS_SERVER; } else if (strcmp(argv[2], "disconnect") == 0) { if (port == 0) port = PW_POD_UDP_PORT; req->code = PW_DISCONNECT_REQUEST; } else if (isdigit((int) argv[2][0])) { if (port == 0) port = getport("radius"); if (port == 0) port = PW_AUTH_UDP_PORT; req->code = atoi(argv[2]); } else { usage(); } req->dst_port = port; /* * Add the secret. */ if (argv[3]) secret = argv[3]; /* * Read valuepairs. * Maybe read them, from stdin, if there's no * filename, or if the filename is '-'. */ if (filename && (strcmp(filename, "-") != 0)) { fp = fopen(filename, "r"); if (!fp) { fprintf(stderr, "radclient: Error opening %s: %s\n", filename, strerror(errno)); exit(1); } } else { fp = stdin; } /* * Send request. */ if ((req->sockfd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) { perror("radclient: socket: "); exit(1); } while(!filedone) { if(req->vps) pairfree(&req->vps); if ((req->vps = readvp2(fp, &filedone, "radeapclient:")) == NULL) { break; } sendrecv_eap(req); } if(do_summary) { printf("\n\t Total approved auths: %d\n", totalapp); printf("\t Total denied auths: %d\n", totaldeny); } return 0; } /* * given a radius request with some attributes in the EAP range, build * them all into a single EAP-Message body. * * Note that this function will build multiple EAP-Message bodies * if there are multiple eligible EAP-types. This is incorrect, as the * recipient will in fact concatenate them. * * XXX - we could break the loop once we process one type. Maybe this * just deserves an assert? * */ static void map_eap_types(RADIUS_PACKET *req) { VALUE_PAIR *vp, *vpnext; int id, eapcode; EAP_PACKET ep; int eap_type; vp = pairfind(req->vps, ATTRIBUTE_EAP_ID); if(vp == NULL) { id = ((int)getpid() & 0xff); } else { id = vp->vp_integer; } vp = pairfind(req->vps, ATTRIBUTE_EAP_CODE); if(vp == NULL) { eapcode = PW_EAP_REQUEST; } else { eapcode = vp->vp_integer; } for(vp = req->vps; vp != NULL; vp = vpnext) { /* save it in case it changes! */ vpnext = vp->next; if(vp->attribute >= ATTRIBUTE_EAP_BASE && vp->attribute < ATTRIBUTE_EAP_BASE+256) { break; } } if(vp == NULL) { return; } eap_type = vp->attribute - ATTRIBUTE_EAP_BASE; switch(eap_type) { case PW_EAP_IDENTITY: case PW_EAP_NOTIFICATION: case PW_EAP_NAK: case PW_EAP_MD5: case PW_EAP_OTP: case PW_EAP_GTC: case PW_EAP_TLS: case PW_EAP_LEAP: case PW_EAP_TTLS: case PW_EAP_PEAP: default: /* * no known special handling, it is just encoded as an * EAP-message with the given type. */ /* nuke any existing EAP-Messages */ pairdelete(&req->vps, PW_EAP_MESSAGE); memset(&ep, 0, sizeof(ep)); ep.code = eapcode; ep.id = id; ep.type.type = eap_type; ep.type.length = vp->length; ep.type.data = malloc(vp->length); memcpy(ep.type.data,vp->vp_octets, vp->length); eap_basic_compose(req, &ep); } } /* * given a radius request with an EAP-Message body, decode it specific * attributes. */ static void unmap_eap_types(RADIUS_PACKET *rep) { VALUE_PAIR *eap1; eap_packet_t *e; int len; int type; /* find eap message */ e = eap_vp2packet(rep->vps); /* nothing to do! */ if(e == NULL) return; /* create EAP-ID and EAP-CODE attributes to start */ eap1 = paircreate(ATTRIBUTE_EAP_ID, PW_TYPE_INTEGER); eap1->vp_integer = e->id; pairadd(&(rep->vps), eap1); eap1 = paircreate(ATTRIBUTE_EAP_CODE, PW_TYPE_INTEGER); eap1->vp_integer = e->code; pairadd(&(rep->vps), eap1); switch(e->code) { default: case PW_EAP_SUCCESS: case PW_EAP_FAILURE: /* no data */ break; case PW_EAP_REQUEST: case PW_EAP_RESPONSE: /* there is a type field, which we use to create * a new attribute */ /* the length was decode already into the attribute * length, and was checked already. Network byte * order, just pull it out using math. */ len = e->length[0]*256 + e->length[1]; /* verify the length is big enough to hold type */ if(len < 5) { free(e); return; } type = e->data[0]; type += ATTRIBUTE_EAP_BASE; len -= 5; if(len > MAX_STRING_LEN) { len = MAX_STRING_LEN; } eap1 = paircreate(type, PW_TYPE_OCTETS); memcpy(eap1->vp_strvalue, &e->data[1], len); eap1->length = len; pairadd(&(rep->vps), eap1); break; } free(e); return; } static int map_eapsim_types(RADIUS_PACKET *r) { EAP_PACKET ep; int ret; memset(&ep, 0, sizeof(ep)); ret = map_eapsim_basictypes(r, &ep); if(ret != 1) { return ret; } eap_basic_compose(r, &ep); return 1; } static int unmap_eapsim_types(RADIUS_PACKET *r) { VALUE_PAIR *esvp; esvp = pairfind(r->vps, ATTRIBUTE_EAP_BASE+PW_EAP_SIM); if (esvp == NULL) { radlog(L_ERR, "eap: EAP-Sim attribute not found"); return 0; } return unmap_eapsim_basictypes(r, esvp->vp_octets, esvp->length); } #ifdef TEST_CASE #include const char *radius_dir = RADDBDIR; int radlog(int lvl, const char *msg, ...) { va_list ap; int r; va_start(ap, msg); r = vfprintf(stderr, msg, ap); va_end(ap); fputc('\n', stderr); return r; } main(int argc, char *argv[]) { int filedone; RADIUS_PACKET *req,*req2; VALUE_PAIR *vp, *vpkey, *vpextra; extern unsigned int sha1_data_problems; req = NULL; req2 = NULL; filedone = 0; if(argc>1) { sha1_data_problems = 1; } if (dict_init(radius_dir, RADIUS_DICTIONARY) < 0) { fr_perror("radclient"); return 1; } if ((req = rad_alloc(1)) == NULL) { fr_perror("radclient"); exit(1); } if ((req2 = rad_alloc(1)) == NULL) { fr_perror("radclient"); exit(1); } while(!filedone) { if(req->vps) pairfree(&req->vps); if(req2->vps) pairfree(&req2->vps); if ((req->vps = readvp2(stdin, &filedone, "eapsimlib:")) == NULL) { break; } if (fr_debug_flag > 1) { printf("\nRead:\n"); vp_printlist(stdout, req->vps); } map_eapsim_types(req); map_eap_types(req); if (fr_debug_flag > 1) { printf("Mapped to:\n"); vp_printlist(stdout, req->vps); } /* find the EAP-Message, copy it to req2 */ vp = paircopy2(req->vps, PW_EAP_MESSAGE); if(vp == NULL) continue; pairadd(&req2->vps, vp); /* only call unmap for sim types here */ unmap_eap_types(req2); unmap_eapsim_types(req2); if (fr_debug_flag > 1) { printf("Unmapped to:\n"); vp_printlist(stdout, req2->vps); } vp = pairfind(req2->vps, ATTRIBUTE_EAP_SIM_BASE+PW_EAP_SIM_MAC); vpkey = pairfind(req->vps, ATTRIBUTE_EAP_SIM_KEY); vpextra = pairfind(req->vps, ATTRIBUTE_EAP_SIM_EXTRA); if(vp != NULL && vpkey != NULL && vpextra!=NULL) { uint8_t calcmac[16]; /* find the EAP-Message, copy it to req2 */ memset(calcmac, 0, sizeof(calcmac)); printf("Confirming MAC..."); if(eapsim_checkmac(req2->vps, vpkey->vp_strvalue, vpextra->vp_strvalue, vpextra->length, calcmac)) { printf("succeed\n"); } else { int i, j; printf("calculated MAC ("); for (i = 0; i < 20; i++) { if(j==4) { printf("_"); j=0; } j++; printf("%02x", calcmac[i]); } printf(" did not match\n"); } } fflush(stdout); } } #endif freeradius-server/src/modules/rlm_eap/rlm_eap.c000066400000000000000000000503561257552170400221750ustar00rootroot00000000000000/* * rlm_eap.c contains handles that are called from modules. * * Version: $Id$ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2000-2003,2006 The FreeRADIUS server project * Copyright 2001 hereUare Communications, Inc. * Copyright 2003 Alan DeKok */ #include RCSID("$Id$") #include #include #include "rlm_eap.h" static const CONF_PARSER module_config[] = { { "default_eap_type", PW_TYPE_STRING_PTR, offsetof(rlm_eap_t, default_eap_type_name), NULL, "md5" }, { "timer_expire", PW_TYPE_INTEGER, offsetof(rlm_eap_t, timer_limit), NULL, "60"}, { "ignore_unknown_eap_types", PW_TYPE_BOOLEAN, offsetof(rlm_eap_t, ignore_unknown_eap_types), NULL, "no" }, { "cisco_accounting_username_bug", PW_TYPE_BOOLEAN, offsetof(rlm_eap_t, cisco_accounting_username_bug), NULL, "no" }, { "max_sessions", PW_TYPE_INTEGER, offsetof(rlm_eap_t, max_sessions), NULL, "2048"}, { NULL, -1, 0, NULL, NULL } /* end the list */ }; /* * delete all the allocated space by eap module */ static int eap_detach(void *instance) { rlm_eap_t *inst; int i; inst = (rlm_eap_t *)instance; #ifdef HAVE_PTHREAD_H pthread_mutex_destroy(&(inst->session_mutex)); if (inst->handler_tree) pthread_mutex_destroy(&(inst->handler_mutex)); #endif rbtree_free(inst->session_tree); if (inst->handler_tree) rbtree_free(inst->handler_tree); inst->session_tree = NULL; eaplist_free(inst); for (i = 0; i < PW_EAP_MAX_TYPES; i++) { if (inst->types[i]) eaptype_free(inst->types[i]); inst->types[i] = NULL; } free(inst); return 0; } /* * Compare two handlers. */ static int eap_handler_cmp(const void *a, const void *b) { int rcode; const EAP_HANDLER *one = a; const EAP_HANDLER *two = b; if (one->eap_id < two->eap_id) return -1; if (one->eap_id > two->eap_id) return +1; rcode = memcmp(one->state, two->state, sizeof(one->state)); if (rcode != 0) return rcode; /* * As of 2.1.8, we don't key off of source IP. This * a NAS to send packets load-balanced (or fail-over) * across multiple intermediate proxies, and still have * EAP work. */ if (fr_ipaddr_cmp(&one->src_ipaddr, &two->src_ipaddr) != 0) { DEBUG("WARNING: EAP packets are arriving from two different upstream servers. Has there been a proxy fail-over?"); } return 0; } /* * Compare two handler pointers */ static int eap_handler_ptr_cmp(const void *a, const void *b) { if (a < b) return -1; if (a > b) return +1; return 0; } /* * read the config section and load all the eap authentication types present. */ static int eap_instantiate(CONF_SECTION *cs, void **instance) { int i, eap_type; int num_types; CONF_SECTION *scs; rlm_eap_t *inst; inst = (rlm_eap_t *) malloc(sizeof(*inst)); if (!inst) { return -1; } memset(inst, 0, sizeof(*inst)); if (cf_section_parse(cs, inst, module_config) < 0) { eap_detach(inst); return -1; } /* * Create our own random pool. */ for (i = 0; i < 256; i++) { inst->rand_pool.randrsl[i] = fr_rand(); } fr_randinit(&inst->rand_pool, 1); inst->rand_pool.randcnt = 0; inst->xlat_name = cf_section_name2(cs); if (!inst->xlat_name) inst->xlat_name = "EAP"; /* Load all the configured EAP-Types */ num_types = 0; for(scs=cf_subsection_find_next(cs, NULL, NULL); scs != NULL; scs=cf_subsection_find_next(cs, scs, NULL)) { const char *auth_type; auth_type = cf_section_name1(scs); if (!auth_type) continue; eap_type = eaptype_name2type(auth_type); if (eap_type < 0) { radlog(L_ERR, "rlm_eap: Unknown EAP type %s", auth_type); eap_detach(inst); return -1; } #ifndef HAVE_OPENSSL_SSL_H /* * This allows the default configuration to be * shipped with EAP-TLS, etc. enabled. If the * system doesn't have OpenSSL, they will be * ignored. * * If the system does have OpenSSL, then this * code will not be used. The administrator will * then have to delete the tls, * etc. configurations from eap.conf in order to * have EAP without the TLS types. */ if ((eap_type == PW_EAP_TLS) || (eap_type == PW_EAP_TTLS) || (eap_type == PW_EAP_PEAP)) { DEBUG2("Ignoring EAP-Type/%s because we do not have OpenSSL support.", auth_type); continue; } #endif /* * If we're asked to load TTLS or PEAP, ensure * that we've first loaded TLS. */ if (((eap_type == PW_EAP_TTLS) || (eap_type == PW_EAP_PEAP)) && (inst->types[PW_EAP_TLS] == NULL)) { radlog(L_ERR, "rlm_eap: Unable to load EAP-Type/%s, as EAP-Type/TLS is required first.", auth_type); return -1; } /* * Load the type. */ if (eaptype_load(&inst->types[eap_type], eap_type, scs) < 0) { eap_detach(inst); return -1; } num_types++; /* successfully loaded one more types */ } if (num_types == 0) { radlog(L_ERR|L_CONS, "rlm_eap: No EAP type configured, module cannot do anything."); eap_detach(inst); return -1; } /* * Ensure that the default EAP type is loaded. */ eap_type = eaptype_name2type(inst->default_eap_type_name); if (eap_type < 0) { radlog(L_ERR|L_CONS, "rlm_eap: Unknown default EAP type %s", inst->default_eap_type_name); eap_detach(inst); return -1; } if (inst->types[eap_type] == NULL) { radlog(L_ERR|L_CONS, "rlm_eap: No such sub-type for default EAP type %s", inst->default_eap_type_name); eap_detach(inst); return -1; } inst->default_eap_type = eap_type; /* save the numerical type */ /* * List of sessions are set to NULL by the memset * of 'inst', above. */ /* * Lookup sessions in the tree. We don't free them in * the tree, as that's taken care of elsewhere... */ inst->session_tree = rbtree_create(eap_handler_cmp, NULL, 0); if (!inst->session_tree) { radlog(L_ERR|L_CONS, "rlm_eap: Cannot initialize tree"); eap_detach(inst); return -1; } if (fr_debug_flag) { inst->handler_tree = rbtree_create(eap_handler_ptr_cmp, NULL, 0); if (!inst->handler_tree) { radlog(L_ERR|L_CONS, "rlm_eap: Cannot initialize tree"); eap_detach(inst); return -1; } #ifdef HAVE_PTHREAD_H if (pthread_mutex_init(&(inst->handler_mutex), NULL) < 0) { radlog(L_ERR|L_CONS, "rlm_eap: Failed initializing mutex: %s", strerror(errno)); eap_detach(inst); return -1; } #endif } #ifdef HAVE_PTHREAD_H if (pthread_mutex_init(&(inst->session_mutex), NULL) < 0) { radlog(L_ERR|L_CONS, "rlm_eap: Failed initializing mutex: %s", strerror(errno)); eap_detach(inst); return -1; } #endif *instance = inst; return 0; } /* * For backwards compatibility. */ static int eap_authenticate(void *instance, REQUEST *request) { rlm_eap_t *inst; EAP_HANDLER *handler; eap_packet_t *eap_packet; int rcode; inst = (rlm_eap_t *) instance; if (!pairfind(request->packet->vps, PW_EAP_MESSAGE)) { RDEBUG("ERROR: You set 'Auth-Type = EAP' for a request that does not contain an EAP-Message attribute!"); return RLM_MODULE_INVALID; } /* * Get the eap packet to start with */ eap_packet = eap_vp2packet(request->packet->vps); if (eap_packet == NULL) { radlog_request(L_ERR, 0, request, "Malformed EAP Message"); return RLM_MODULE_FAIL; } /* * Create the eap handler. The eap_packet will end up being * "swallowed" into the handler, so we can't access it after * this call. */ handler = eap_handler(inst, &eap_packet, request); if (handler == NULL) { RDEBUG2("Failed in handler"); return RLM_MODULE_INVALID; } /* * Select the appropriate eap_type or default to the * configured one */ rcode = eaptype_select(inst, handler); /* * If it failed, die. */ if (rcode == EAP_INVALID) { eap_fail(handler); eap_handler_free(inst, handler); RDEBUG2("Failed in EAP select"); return RLM_MODULE_INVALID; } #ifdef WITH_PROXY /* * If we're doing horrible tunneling work, remember it. */ if ((request->options & RAD_REQUEST_OPTION_PROXY_EAP) != 0) { RDEBUG2(" Not-EAP proxy set. Not composing EAP"); /* * Add the handle to the proxied list, so that we * can retrieve it in the post-proxy stage, and * send a response. */ handler->inst_holder = inst; rcode = request_data_add(request, inst, REQUEST_DATA_EAP_HANDLER, handler, (void *) eap_opaque_free); rad_assert(rcode == 0); return RLM_MODULE_HANDLED; } #endif #ifdef WITH_PROXY /* * Maybe the request was marked to be proxied. If so, * proxy it. */ if (request->proxy != NULL) { VALUE_PAIR *vp = NULL; rad_assert(request->proxy_reply == NULL); /* * Add the handle to the proxied list, so that we * can retrieve it in the post-proxy stage, and * send a response. */ handler->inst_holder = inst; rcode = request_data_add(request, inst, REQUEST_DATA_EAP_HANDLER, handler, (void *) eap_opaque_free); rad_assert(rcode == 0); /* * Some simple sanity checks. These should really * be handled by the radius library... */ vp = pairfind(request->proxy->vps, PW_EAP_MESSAGE); if (vp) { vp = pairfind(request->proxy->vps, PW_MESSAGE_AUTHENTICATOR); if (!vp) { vp = pairmake("Message-Authenticator", "0x00", T_OP_EQ); rad_assert(vp != NULL); pairadd(&(request->proxy->vps), vp); } } /* * Delete the "proxied to" attribute, as it's * set to 127.0.0.1 for tunneled requests, and * we don't want to tell the world that... */ pairdelete(&request->proxy->vps, PW_FREERADIUS_PROXIED_TO); RDEBUG2(" Tunneled session will be proxied. Not doing EAP."); return RLM_MODULE_HANDLED; } #endif /* * We are done, wrap the EAP-request in RADIUS to send * with all other required radius attributes */ rcode = eap_compose(handler); /* * Add to the list only if it is EAP-Request, OR if * it's LEAP, and a response. */ if (((handler->eap_ds->request->code == PW_EAP_REQUEST) && (handler->eap_ds->request->type.type >= PW_EAP_MD5)) || /* * LEAP is a little different. At Stage 4, * it sends an EAP-Success message, but we still * need to keep the State attribute & session * data structure around for the AP Challenge. * * At stage 6, LEAP sends an EAP-Response, which * isn't put into the list. */ ((handler->eap_ds->response->code == PW_EAP_RESPONSE) && (handler->eap_ds->response->type.type == PW_EAP_LEAP) && (handler->eap_ds->request->code == PW_EAP_SUCCESS) && (handler->eap_ds->request->type.type == 0))) { /* * Return FAIL if we can't remember the handler. * This is actually disallowed by the * specification, as unexpected FAILs could have * been forged. However, we want to signal to * everyone else involved that we are * intentionally failing the session, as opposed * to accidentally failing it. */ if (!eaplist_add(inst, handler)) { RDEBUG("Failed adding handler to the list"); eap_fail(handler); eap_handler_free(inst, handler); return RLM_MODULE_FAIL; } } else { RDEBUG2("Freeing handler"); /* handler is not required any more, free it now */ eap_handler_free(inst, handler); } /* * If it's an Access-Accept, RFC 2869, Section 2.3.1 * says that we MUST include a User-Name attribute in the * Access-Accept. */ if ((request->reply->code == PW_AUTHENTICATION_ACK) && request->username) { VALUE_PAIR *vp; /* * Doesn't exist, add it in. */ vp = pairfind(request->reply->vps, PW_USER_NAME); if (!vp) { vp = pairmake("User-Name", "", T_OP_EQ); strlcpy(vp->vp_strvalue, request->username->vp_strvalue, sizeof(vp->vp_strvalue)); vp->length = request->username->length; rad_assert(vp != NULL); pairadd(&(request->reply->vps), vp); } /* * Cisco AP1230 has a bug and needs a zero * terminated string in Access-Accept. */ if ((inst->cisco_accounting_username_bug) && (vp->length < (int) sizeof(vp->vp_strvalue))) { vp->vp_strvalue[vp->length] = '\0'; vp->length++; } } return rcode; } /* * EAP authorization DEPENDS on other rlm authorizations, * to check for user existance & get their configured values. * It Handles EAP-START Messages, User-Name initilization. */ static int eap_authorize(void *instance, REQUEST *request) { rlm_eap_t *inst; int status; VALUE_PAIR *vp; inst = (rlm_eap_t *)instance; #ifdef WITH_PROXY /* * We don't do authorization again, once we've seen the * proxy reply (or the proxied packet) */ if (request->proxy != NULL) return RLM_MODULE_NOOP; #endif /* * For EAP_START, send Access-Challenge with EAP Identity * request. even when we have to proxy this request * * RFC 2869, Section 2.3.1 notes that the "domain" of the * user, (i.e. where to proxy him) comes from the EAP-Identity, * so we CANNOT proxy the user, until we know his identity. * * We therefore send an EAP Identity request. */ status = eap_start(inst, request); switch(status) { case EAP_NOOP: return RLM_MODULE_NOOP; case EAP_FAIL: return RLM_MODULE_FAIL; case EAP_FOUND: return RLM_MODULE_HANDLED; case EAP_OK: case EAP_NOTFOUND: default: break; } /* * RFC 2869, Section 2.3.1. If a NAS sends an EAP-Identity, * it MUST copy the identity into the User-Name attribute. * * But we don't worry about that too much. We depend on * each EAP sub-module to look for handler->request->username, * and to get excited if it doesn't appear. */ vp = pairfind(request->config_items, PW_AUTH_TYPE); if ((!vp) || (vp->vp_integer != PW_AUTHTYPE_REJECT)) { vp = pairmake("Auth-Type", inst->xlat_name, T_OP_EQ); if (!vp) { RDEBUG2("Failed to create Auth-Type %s: %s\n", inst->xlat_name, fr_strerror()); return RLM_MODULE_FAIL; } pairadd(&request->config_items, vp); } else { RDEBUG2("WARNING: Auth-Type already set. Not setting to EAP"); } if (status == EAP_OK) return RLM_MODULE_OK; return RLM_MODULE_UPDATED; } #ifdef WITH_PROXY /* * If we're proxying EAP, then there may be magic we need * to do. */ static int eap_post_proxy(void *inst, REQUEST *request) { size_t i; size_t len; VALUE_PAIR *vp; EAP_HANDLER *handler; /* * If there was a handler associated with this request, * then it's a tunneled request which was proxied... */ handler = request_data_get(request, inst, REQUEST_DATA_EAP_HANDLER); if (handler != NULL) { int rcode; eap_tunnel_data_t *data; /* * Grab the tunnel callbacks from the request. */ data = (eap_tunnel_data_t *) request_data_get(request, request->proxy, REQUEST_DATA_EAP_TUNNEL_CALLBACK); if (!data) { radlog_request(L_ERR, 0, request, "Failed to retrieve callback for tunneled session!"); eap_handler_free(inst, handler); return RLM_MODULE_FAIL; } /* * Do the callback... */ RDEBUG2("Doing post-proxy callback"); rcode = data->callback(handler, data->tls_session); free(data); if (rcode == 0) { RDEBUG2("Failed in post-proxy callback"); eap_fail(handler); eap_handler_free(inst, handler); return RLM_MODULE_REJECT; } /* * We are done, wrap the EAP-request in RADIUS to send * with all other required radius attributes */ eap_compose(handler); /* * Add to the list only if it is EAP-Request, OR if * it's LEAP, and a response. */ if ((handler->eap_ds->request->code == PW_EAP_REQUEST) && (handler->eap_ds->request->type.type >= PW_EAP_MD5)) { if (!eaplist_add(inst, handler)) { eap_fail(handler); eap_handler_free(inst, handler); return RLM_MODULE_FAIL; } } else { /* couldn't have been LEAP, there's no tunnel */ RDEBUG2("Freeing handler"); /* handler is not required any more, free it now */ eap_handler_free(inst, handler); } /* * If it's an Access-Accept, RFC 2869, Section 2.3.1 * says that we MUST include a User-Name attribute in the * Access-Accept. */ if ((request->reply->code == PW_AUTHENTICATION_ACK) && request->username) { /* * Doesn't exist, add it in. */ vp = pairfind(request->reply->vps, PW_USER_NAME); if (!vp) { vp = pairmake("User-Name", request->username->vp_strvalue, T_OP_EQ); rad_assert(vp != NULL); pairadd(&(request->reply->vps), vp); } } return RLM_MODULE_OK; } else { RDEBUG2("No pre-existing handler found"); } /* * This is allowed. */ if (!request->proxy_reply) return RLM_MODULE_NOOP; /* * There may be more than one Cisco-AVPair. * Ensure we find the one with the LEAP attribute. */ vp = request->proxy_reply->vps; for (;;) { /* * Hmm... there's got to be a better way to * discover codes for vendor attributes. * * This is vendor Cisco (9), Cisco-AVPair * attribute (1) */ vp = pairfind(vp, (9 << 16) | 1); if (!vp) { return RLM_MODULE_NOOP; } /* * If it's "leap:session-key", then stop. * * The format is VERY specific! */ if (strncasecmp(vp->vp_strvalue, "leap:session-key=", 17) == 0) { break; } /* * Not this AV-pair. Go to the next one. */ vp = vp->next; } /* * The format is very specific. */ if (vp->length != 17 + 34) { RDEBUG2("Cisco-AVPair with leap:session-key has incorrect length %d: Expected %d", vp->length, 17 + 34); return RLM_MODULE_NOOP; } /* * Decrypt the session key, using the proxy data. */ i = 34; /* starts off with 34 octets */ len = rad_tunnel_pwdecode(vp->vp_octets + 17, &i, request->home_server->secret, request->proxy->vector); /* * FIXME: Assert that i == 16. */ /* * Encrypt the session key again, using the request data. */ rad_tunnel_pwencode(vp->vp_strvalue + 17, &len, request->client->secret, request->packet->vector); return RLM_MODULE_UPDATED; } #endif static int eap_post_auth(void *instance, REQUEST *request) { rlm_eap_t *inst = instance; VALUE_PAIR *vp; EAP_HANDLER *handler; eap_packet_t *eap_packet; /* * Only build a failure message if something previously rejected the request */ vp = pairfind(request->config_items, PW_POSTAUTHTYPE); /* * Post-Auth-Type REJECT in dictionary.freeradius.internal */ if (!vp || (vp->vp_integer != 2)) return RLM_MODULE_NOOP; if (!pairfind(request->packet->vps, PW_EAP_MESSAGE)) { RDEBUG2("Request didn't contain an EAP-Message, not inserting EAP-Failure"); return RLM_MODULE_NOOP; } if (pairfind(request->reply->vps, PW_EAP_MESSAGE)) { RDEBUG2("Reply already contained an EAP-Message, not inserting EAP-Failure"); return RLM_MODULE_NOOP; } eap_packet = eap_vp2packet(request->packet->vps); if (!eap_packet) { RDEBUG("Malformed EAP Message"); return RLM_MODULE_FAIL; } handler = eap_handler(inst, &eap_packet, request); if (!handler) { RDEBUG2("Failed to get handler, probably already removed, not inserting EAP-Failure"); return RLM_MODULE_NOOP; } RDEBUG2("Request was previously rejected, inserting EAP-Failure"); eap_fail(handler); eap_handler_free(inst, handler); /* * Make sure there's a message authenticator attribute in the response * RADIUS protocol code will calculate the correct value later... */ vp = pairfind(request->reply->vps, PW_MESSAGE_AUTHENTICATOR); if (!vp) { vp = pairmake("Message-Authenticator", "0x00", T_OP_EQ); pairadd(&request->reply->vps, vp); } return RLM_MODULE_UPDATED; } /* * The module name should be the only globally exported symbol. * That is, everything else should be 'static'. */ module_t rlm_eap = { RLM_MODULE_INIT, "eap", RLM_TYPE_CHECK_CONFIG_SAFE, /* type */ eap_instantiate, /* instantiation */ eap_detach, /* detach */ { eap_authenticate, /* authentication */ eap_authorize, /* authorization */ NULL, /* preaccounting */ NULL, /* accounting */ NULL, /* checksimul */ NULL, /* pre-proxy */ #ifdef WITH_PROXY eap_post_proxy, /* post-proxy */ #else NULL, #endif eap_post_auth /* post-auth */ }, }; freeradius-server/src/modules/rlm_eap/rlm_eap.h000066400000000000000000000070561257552170400222010ustar00rootroot00000000000000/* * rlm_eap.h Local Header file. * * Version: $Id$ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2001 hereUare Communications, Inc. * Copyright 2003 Alan DeKok * Copyright 2006 The FreeRADIUS server project */ #ifndef _RLM_EAP_H #define _RLM_EAP_H #include RCSIDH(rlm_eap_h, "$Id$") #include #include "eap.h" #include "eap_types.h" /* * Keep track of which sub modules we've loaded. */ typedef struct eap_types_t { const char *typename; EAP_TYPE *type; lt_dlhandle handle; CONF_SECTION *cs; void *type_data; } EAP_TYPES; /* * This structure contains eap's persistent data. * sessions = remembered sessions, in a tree for speed. * types = All supported EAP-Types * mutex = ensure only one thread is updating the sessions[] struct */ typedef struct rlm_eap_t { rbtree_t *session_tree; EAP_HANDLER *session_head, *session_tail; rbtree_t *handler_tree; /* for debugging only */ EAP_TYPES *types[PW_EAP_MAX_TYPES + 1]; /* * Configuration items. */ int timer_limit; char *default_eap_type_name; int default_eap_type; int ignore_unknown_eap_types; int cisco_accounting_username_bug; int max_sessions; #ifdef HAVE_PTHREAD_H pthread_mutex_t session_mutex; pthread_mutex_t handler_mutex; #endif const char *xlat_name; /* no xlat's yet */ fr_randctx rand_pool; } rlm_eap_t; /* * For simplicity in the rest of the code. */ #ifndef HAVE_PTHREAD_H /* * This is easier than ifdef's throughout the code. */ #define pthread_mutex_init(_x, _y) #define pthread_mutex_destroy(_x) #define pthread_mutex_lock(_x) #define pthread_mutex_unlock(_x) #endif /* function definitions */ /* EAP-Type */ int eaptype_load(EAP_TYPES **type, int eap_type, CONF_SECTION *cs); int eaptype_select(rlm_eap_t *inst, EAP_HANDLER *h); void eaptype_free(EAP_TYPES *tl); /* EAP */ int eap_start(rlm_eap_t *inst, REQUEST *request); void eap_fail(EAP_HANDLER *handler); void eap_success(EAP_HANDLER *handler); int eap_compose(EAP_HANDLER *handler); EAP_HANDLER *eap_handler(rlm_eap_t *inst, eap_packet_t **eap_msg, REQUEST *request); /* Memory Management */ EAP_PACKET *eap_packet_alloc(void); EAP_DS *eap_ds_alloc(void); EAP_HANDLER *eap_handler_alloc(rlm_eap_t *inst); void eap_packet_free(EAP_PACKET **eap_packet); void eap_ds_free(EAP_DS **eap_ds); void eap_opaque_free(EAP_HANDLER *handler); void eap_handler_free(rlm_eap_t *inst, EAP_HANDLER *handler); int eaplist_add(rlm_eap_t *inst, EAP_HANDLER *handler); EAP_HANDLER *eaplist_find(rlm_eap_t *inst, REQUEST *request, eap_packet_t *eap_packet); void eaplist_free(rlm_eap_t *inst); /* State */ void generate_key(void); VALUE_PAIR *generate_state(time_t timestamp); int verify_state(VALUE_PAIR *state, time_t timestamp); #endif /*_RLM_EAP_H*/ freeradius-server/src/modules/rlm_eap/types/000077500000000000000000000000001257552170400215455ustar00rootroot00000000000000freeradius-server/src/modules/rlm_eap/types/Makefile000066400000000000000000000011601257552170400232030ustar00rootroot00000000000000# # Makefile # # Version: $Id$ # all: $(MAKE) $(MFLAGS) WHAT_TO_MAKE=$@ common clean: $(MAKE) $(MFLAGS) WHAT_TO_MAKE=$@ common install: $(MAKE) $(MFLAGS) WHAT_TO_MAKE=$@ common reconfig: $(MAKE) $(MFLAGS) WHAT_TO_MAKE=$@ common SUBDIRS := $(patsubst %/,%,$(dir $(wildcard rlm_eap*/Makefile))) .PHONY: common $(SUBDIRS) common: $(SUBDIRS) # The PEAP and TTLS sub-modules require eap_tls. # # If they're not being built, this rule is ignored because they're # phony targets. # rlm_eap_peap rlm_eap_ttls: rlm_eap_tls $(SUBDIRS): @echo "Making $(WHAT_TO_MAKE) in $@..." @$(MAKE) $(MFLAGS) -C $@ $(WHAT_TO_MAKE) freeradius-server/src/modules/rlm_eap/types/rlm_eap_gtc/000077500000000000000000000000001257552170400240215ustar00rootroot00000000000000freeradius-server/src/modules/rlm_eap/types/rlm_eap_gtc/Makefile000066400000000000000000000003751257552170400254660ustar00rootroot00000000000000# # Makefile # # Version: $Id$ # TARGET = rlm_eap_gtc SRCS = rlm_eap_gtc.c RLM_CFLAGS = -I../.. -I../../libeap HEADERS = ../../rlm_eap.h ../../eap.h RLM_INSTALL = RLM_DIR=../../ include ${RLM_DIR}../rules.mak $(LT_OBJS): $(HEADERS) freeradius-server/src/modules/rlm_eap/types/rlm_eap_gtc/rlm_eap_gtc.c000066400000000000000000000152521257552170400264460ustar00rootroot00000000000000/* * rlm_eap_gtc.c Handles that are called from eap * * Version: $Id$ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2003,2006 The FreeRADIUS server project */ #include RCSID("$Id$") #include #include #include #include "eap.h" #include /* * EAP-GTC is just ASCII data carried inside of the EAP session. * The length of the data is indicated by the encapsulating EAP * protocol. */ typedef struct rlm_eap_gtc_t { const char *challenge; const char *auth_type_name; int auth_type; } rlm_eap_gtc_t; static CONF_PARSER module_config[] = { { "challenge", PW_TYPE_STRING_PTR, offsetof(rlm_eap_gtc_t, challenge), NULL, "Password: " }, { "auth_type", PW_TYPE_STRING_PTR, offsetof(rlm_eap_gtc_t, auth_type_name), NULL, "PAP" }, { NULL, -1, 0, NULL, NULL } /* end the list */ }; /* * Detach the module. */ static int gtc_detach(void *arg) { rlm_eap_gtc_t *inst = (rlm_eap_gtc_t *) arg; free(inst); return 0; } /* * Attach the module. */ static int gtc_attach(CONF_SECTION *cs, void **instance) { rlm_eap_gtc_t *inst; DICT_VALUE *dval; inst = malloc(sizeof(*inst)); if (!inst) { radlog(L_ERR, "rlm_eap_gtc: out of memory"); return -1; } memset(inst, 0, sizeof(*inst)); /* * Parse the configuration attributes. */ if (cf_section_parse(cs, inst, module_config) < 0) { gtc_detach(inst); return -1; } dval = dict_valbyname(PW_AUTH_TYPE, inst->auth_type_name); if (!dval) { radlog(L_ERR, "rlm_eap_gtc: Unknown Auth-Type %s", inst->auth_type_name); gtc_detach(inst); return -1; } inst->auth_type = dval->value; *instance = inst; return 0; } /* * Initiate the EAP-GTC session by sending a challenge to the peer. */ static int gtc_initiate(void *type_data, EAP_HANDLER *handler) { char challenge_str[1024]; int length; EAP_DS *eap_ds = handler->eap_ds; rlm_eap_gtc_t *inst = (rlm_eap_gtc_t *) type_data; if (!radius_xlat(challenge_str, sizeof(challenge_str), inst->challenge, handler->request, NULL)) { radlog(L_ERR, "rlm_eap_gtc: xlat of \"%s\" failed", inst->challenge); return 0; } length = strlen(challenge_str); /* * We're sending a request... */ eap_ds->request->code = PW_EAP_REQUEST; eap_ds->request->type.data = malloc(length); if (eap_ds->request->type.data == NULL) { radlog(L_ERR, "rlm_eap_gtc: out of memory"); return 0; } memcpy(eap_ds->request->type.data, challenge_str, length); eap_ds->request->type.length = length; /* * We don't need to authorize the user at this point. * * We also don't need to keep the challenge, as it's * stored in 'handler->eap_ds', which will be given back * to us... */ handler->stage = AUTHENTICATE; return 1; } /* * Authenticate a previously sent challenge. */ static int gtc_authenticate(void *type_data, EAP_HANDLER *handler) { VALUE_PAIR *vp; EAP_DS *eap_ds = handler->eap_ds; rlm_eap_gtc_t *inst = (rlm_eap_gtc_t *) type_data; /* * Get the Cleartext-Password for this user. */ rad_assert(handler->request != NULL); rad_assert(handler->stage == AUTHENTICATE); /* * Sanity check the response. We need at least one byte * of data. */ if (eap_ds->response->length <= 4) { radlog(L_ERR, "rlm_eap_gtc: corrupted data"); eap_ds->request->code = PW_EAP_FAILURE; return 0; } #if 0 if ((debug_flag > 2) && fr_log_fp) { int i; for (i = 0; i < eap_ds->response->length - 4; i++) { if ((i & 0x0f) == 0) fprintf(fr_log_fp, "%d: ", i); fprintf(fr_log_fp, "%02x ", eap_ds->response->type.data[i]); if ((i & 0x0f) == 0x0f) fprintf(fr_log_fp, "\n"); } } #endif /* * Handle passwords here. */ if (inst->auth_type == PW_AUTHTYPE_LOCAL) { /* * For now, do clear-text password authentication. */ vp = pairfind(handler->request->config_items, PW_CLEARTEXT_PASSWORD); if (!vp) { DEBUG2(" rlm_eap_gtc: ERROR: Cleartext-Password is required for authentication."); eap_ds->request->code = PW_EAP_FAILURE; return 0; } if (eap_ds->response->type.length != vp->length) { DEBUG2(" rlm_eap_gtc: ERROR: Passwords are of different length. %u %u", (unsigned) eap_ds->response->type.length, (unsigned) vp->length); eap_ds->request->code = PW_EAP_FAILURE; return 0; } if (memcmp(eap_ds->response->type.data, vp->vp_strvalue, vp->length) != 0) { DEBUG2(" rlm_eap_gtc: ERROR: Passwords are different"); eap_ds->request->code = PW_EAP_FAILURE; return 0; } /* * EAP packets can be ~64k long maximum, and * we don't like that. */ } else if (eap_ds->response->type.length <= 128) { int rcode; /* * If there was a User-Password in the request, * why the heck are they using EAP-GTC? */ pairdelete(&handler->request->packet->vps, PW_USER_PASSWORD); vp = pairmake("User-Password", "", T_OP_EQ); if (!vp) { radlog(L_ERR, "rlm_eap_gtc: out of memory"); return 0; } vp->length = eap_ds->response->type.length; memcpy(vp->vp_strvalue, eap_ds->response->type.data, vp->length); vp->vp_strvalue[vp->length] = 0; /* * Add the password to the request, and allow * another module to do the work of authenticating it. */ pairadd(&handler->request->packet->vps, vp); handler->request->password = vp; /* * This is a wild & crazy hack. */ rcode = module_authenticate(inst->auth_type, handler->request); if (rcode != RLM_MODULE_OK) { eap_ds->request->code = PW_EAP_FAILURE; return 0; } } else { radlog(L_ERR, "rlm_eap_gtc: Response is too large to understand"); eap_ds->request->code = PW_EAP_FAILURE; return 0; } DEBUG2(" rlm_eap_gtc: Everything is OK."); eap_ds->request->code = PW_EAP_SUCCESS; return 1; } /* * The module name should be the only globally exported symbol. * That is, everything else should be 'static'. */ EAP_TYPE rlm_eap_gtc = { "eap_gtc", gtc_attach, /* attach */ gtc_initiate, /* Start the initial request */ NULL, /* authorization */ gtc_authenticate, /* authentication */ gtc_detach /* detach */ }; freeradius-server/src/modules/rlm_eap/types/rlm_eap_ikev2/000077500000000000000000000000001257552170400242645ustar00rootroot00000000000000freeradius-server/src/modules/rlm_eap/types/rlm_eap_ikev2/.gitignore000066400000000000000000000000111257552170400262440ustar00rootroot00000000000000Makefile freeradius-server/src/modules/rlm_eap/types/rlm_eap_ikev2/Makefile.in000066400000000000000000000005501257552170400263310ustar00rootroot00000000000000TARGET = @targetname@ SRCS = logging_impl.c \ rlm_eap_ikev2.c \ ike_conf.c RLM_CFLAGS = -I../.. -I../../libeap @eap_ikev2_cflags@ RLM_LDFLAGS = @LDFLAGS@ @LIBS@ HEADERS = eap_ikev2.h logging_impl.h ike_conf.h RLM_INSTALL = $(STATIC_OBJS): $(HEADERS) $(DYNAMIC_OBJS): $(HEADERS) RLM_DIR=../../ include ${RLM_DIR}../rules.mak freeradius-server/src/modules/rlm_eap/types/rlm_eap_ikev2/configure000077500000000000000000003777371257552170400262230ustar00rootroot00000000000000#! /bin/sh # From configure.in Revision. # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.61. # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, # 2002, 2003, 2004, 2005, 2006 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=: # 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 # PATH needs CR # 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 # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false 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.) as_nl=' ' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. 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 # Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # CDPATH. $as_unset CDPATH if test "x$CONFIG_SHELL" = x; then if (eval ":") 2>/dev/null; then as_have_required=yes else as_have_required=no fi if test $as_have_required = yes && (eval ": (as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=\$LINENO as_lineno_2=\$LINENO test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } ") 2> /dev/null; then : else as_candidate_shells= as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. case $as_dir in /*) for as_base in sh bash ksh sh5; do as_candidate_shells="$as_candidate_shells $as_dir/$as_base" done;; esac done IFS=$as_save_IFS for as_shell in $as_candidate_shells $SHELL; do # Try only shells that exist, to save several forks. if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { ("$as_shell") 2> /dev/null <<\_ASEOF 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 : _ASEOF }; then CONFIG_SHELL=$as_shell as_have_required=yes if { "$as_shell" 2> /dev/null <<\_ASEOF 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 : (as_func_return () { (exit $1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = "$1" ); then : else exitcode=1 echo positional parameters were not saved. fi test $exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } _ASEOF }; then break fi fi done if test "x$CONFIG_SHELL" != x; then for as_var in BASH_ENV ENV do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done export CONFIG_SHELL exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} fi if test $as_have_required = no; then echo This script requires a shell more modern than all the echo shells that I found on your system. Please install a echo modern shell, or manually run the script under such a echo shell if you do have one. { (exit 1); exit 1; } fi fi fi (eval "as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0") || { echo No shell found that supports shell functions. echo Please tell autoconf@gnu.org about your system, echo including any error possibly output before this echo message } as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, and appends # trailing '-' during substitution so that $LINENO is not a special # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # scripts with optimization help from Paolo Bonzini. 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" || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi 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 fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi 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=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, 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= SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME= PACKAGE_TARNAME= PACKAGE_VERSION= PACKAGE_STRING= PACKAGE_BUGREPORT= ac_unique_file="rlm_eap_ikev2.c" # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef STDC_HEADERS # include # include #else # ifdef HAVE_STDLIB_H # include # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datarootdir datadir sysconfdir sharedstatedir localstatedir includedir oldincludedir docdir infodir htmldir dvidir pdfdir psdir libdir localedir mandir DEFS ECHO_C ECHO_N ECHO_T LIBS build_alias host_alias target_alias CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP GREP EGREP eap_ikev2_cflags eap_ikev2_ldflags targetname LIBOBJS LTLIBOBJS' ac_subst_files='' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CPP' # Initialize some variables set by options. ac_init_help= ac_init_version=false # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *) ac_optarg=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_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` eval enable_$ac_feature=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_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` eval enable_$ac_feature=\$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_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/[-.]/_/g'` eval with_$ac_package=\$ac_optarg ;; -without-* | --without-*) ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/[-.]/_/g'` eval with_$ac_package=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 ;; -*) { echo "$as_me: error: unrecognized option: $ac_option Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && 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'` { echo "$as_me: error: missing argument to $ac_option" >&2 { (exit 1); exit 1; }; } fi # Be sure to have absolute directory names. 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 case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; } 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 echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || { echo "$as_me: error: Working directory cannot be determined" >&2 { (exit 1); exit 1; }; } test "X$ac_ls_di" = "X$ac_pwd_ls_di" || { echo "$as_me: error: pwd does not report name of working directory" >&2 { (exit 1); exit 1; }; } # 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 -- "$0" || $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$0" : 'X\(//\)[^/]' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X"$0" | 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 .." { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2 { (exit 1); exit 1; }; } pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures this package to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF _ACEOF fi if test -n "$ac_init_help"; then cat <<\_ACEOF Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-eap-ikev2-includes Diectory to look for EAPIKEv2 include files --with-eap-ikev2-libraries Diectory to look for EAPIKEv2 library file 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 C/C++/Objective C preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. _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" || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`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 echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF configure generated by GNU Autoconf 2.61 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 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 cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by $as_me, which was generated by GNU Autoconf 2.61. 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=. 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=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; 2) ac_configure_args1="$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 ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac done done $as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } $as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export 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 cat <<\_ASBOX ## ---------------- ## ## Cache variables. ## ## ---------------- ## _ASBOX 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_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( *) $as_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 cat <<\_ASBOX ## ----------------- ## ## Output variables. ## ## ----------------- ## _ASBOX echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then cat <<\_ASBOX ## ------------------- ## ## File substitutions. ## ## ------------------- ## _ASBOX echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then cat <<\_ASBOX ## ----------- ## ## confdefs.h. ## ## ----------- ## _ASBOX echo cat confdefs.h echo fi test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" 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'; { (exit 1); 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 # 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 # Let the site file select an alternate cache file if it wants to. # Prefer explicitly selected file to automatically selected ones. if test -n "$CONFIG_SITE"; then set x "$CONFIG_SITE" elif test "x$prefix" != xNONE; then set x "$prefix/share/config.site" "$prefix/etc/config.site" else set x "$ac_default_prefix/share/config.site" \ "$ac_default_prefix/etc/config.site" fi shift for ac_site_file do if test -r "$ac_site_file"; then { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" 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. if test -f "$cache_file"; then { echo "$as_me:$LINENO: loading cache $cache_file" >&5 echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { echo "$as_me:$LINENO: creating cache $cache_file" >&5 echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 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 { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 echo "$as_me: former value: $ac_old_val" >&2;} { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 echo "$as_me: current value: $ac_new_val" >&2;} ac_cache_corrupted=: fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`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. *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 echo "$as_me: error: changes in the environment can compromise the build" >&2;} { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} { (exit 1); exit 1; }; } 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 x$with_rlm_eap_ikev2 != xno; then ## We may need more complex checking here. Assume for now that ## everyone has it. 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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}gcc" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="gcc" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}cc" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="$ac_prog" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&5 echo "$as_me: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } # Provide some information about the compiler. echo "$as_me:$LINENO: checking for C compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (ac_try="$ac_compiler --version >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -v >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -V >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out 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. { echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6; } ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # # List of possible output files, starting from the most likely. # The algorithm is not robust to junk in `.', hence go to wildcards (a.*) # only as a last resort. b.out is created by i960 compilers. ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out' # # The IRIX 6 linker writes into existing files which may not be # executable, retaining their permissions. Remove them first so a # subsequent execution test works. ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link_default") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; 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 | *.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 { echo "$as_me:$LINENO: result: $ac_file" >&5 echo "${ECHO_T}$ac_file" >&6; } if test -z "$ac_file"; then echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: C compiler cannot create executables See \`config.log' for more details." >&5 echo "$as_me: error: C compiler cannot create executables See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } fi ac_exeext=$ac_cv_exeext # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { echo "$as_me:$LINENO: checking whether the C compiler works" >&5 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6; } # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then if { ac_try='./$ac_file' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { echo "$as_me:$LINENO: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&5 echo "$as_me: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi fi fi { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } rm -f a.out a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; } { echo "$as_me:$LINENO: result: $cross_compiling" >&5 echo "${ECHO_T}$cross_compiling" >&6; } { echo "$as_me:$LINENO: checking for suffix of executables" >&5 echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; } if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; 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 | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest$ac_cv_exeext { echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 echo "${ECHO_T}$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT { echo "$as_me:$LINENO: checking for suffix of object files" >&5 echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; } if test "${ac_cv_objext+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; 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 ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 echo "${ECHO_T}$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; } if test "${ac_cv_c_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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 { echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; } GCC=`test $ac_compiler_gnu = yes && echo yes` ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CFLAGS="" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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 { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 echo "${ECHO_T}$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 { echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_c89+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_c89=$ac_arg else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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) { echo "$as_me:$LINENO: result: none needed" >&5 echo "${ECHO_T}none needed" >&6; } ;; xno) { echo "$as_me:$LINENO: result: unsupported" >&5 echo "${ECHO_T}unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;; 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 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 { echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if test "${ac_cv_prog_CPP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f 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 { echo "$as_me:$LINENO: result: $CPP" >&5 echo "${ECHO_T}$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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&5 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } 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 { echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5 echo $ECHO_N "checking for grep that handles long lines and -e... $ECHO_C" >&6; } if test "${ac_cv_path_GREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Extract the first word of "grep ggrep" to use in msg output if test -z "$GREP"; then set dummy grep ggrep; ac_prog_name=$2 if test "${ac_cv_path_GREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" 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 ac_count=`expr $ac_count + 1` 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 fi GREP="$ac_cv_path_GREP" if test -z "$GREP"; then { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} { (exit 1); exit 1; }; } fi else ac_cv_path_GREP=$GREP fi fi { echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5 echo "${ECHO_T}$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { echo "$as_me:$LINENO: checking for egrep" >&5 echo $ECHO_N "checking for egrep... $ECHO_C" >&6; } if test "${ac_cv_path_EGREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else # Extract the first word of "egrep" to use in msg output if test -z "$EGREP"; then set dummy egrep; ac_prog_name=$2 if test "${ac_cv_path_EGREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" 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 ac_count=`expr $ac_count + 1` 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 fi EGREP="$ac_cv_path_EGREP" if test -z "$EGREP"; then { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} { (exit 1); exit 1; }; } fi else ac_cv_path_EGREP=$EGREP fi fi fi { echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 echo "${ECHO_T}$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" { echo "$as_me:$LINENO: checking for ANSI C header files" >&5 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; } if test "${ac_cv_header_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_header_stdc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* 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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* 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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* 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 rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi { echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 echo "${ECHO_T}$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then cat >>confdefs.h <<\_ACEOF #define STDC_HEADERS 1 _ACEOF 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=`echo "ac_cv_header_$ac_header" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Header=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in malloc.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? { echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ;; esac { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done # Check whether --with-eap-ikev2-includes was given. if test "${with_eap_ikev2_includes+set}" = set; then withval=$with_eap_ikev2_includes; eap_ikev2_includes=-I$with_eap_ikev2_includes fi # Check whether --with-eap-ikev2-libraries was given. if test "${with_eap_ikev2_libraries+set}" = set; then withval=$with_eap_ikev2_libraries; eap_ikev2_libraries=-L$with_eap_ikev2_libraries fi LDFLAGS="$eap_ikev2_libraries $OPENSSL_LIBS" { echo "$as_me:$LINENO: checking for ikev2_set_log_callback in -leap-ikev2" >&5 echo $ECHO_N "checking for ikev2_set_log_callback in -leap-ikev2... $ECHO_C" >&6; } if test "${ac_cv_lib_eap_ikev2_ikev2_set_log_callback+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-leap-ikev2 $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any 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 ikev2_set_log_callback (); int main () { return ikev2_set_log_callback (); ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_eap_ikev2_ikev2_set_log_callback=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_eap_ikev2_ikev2_set_log_callback=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_eap_ikev2_ikev2_set_log_callback" >&5 echo "${ECHO_T}$ac_cv_lib_eap_ikev2_ikev2_set_log_callback" >&6; } if test $ac_cv_lib_eap_ikev2_ikev2_set_log_callback = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBEAP_IKEV2 1 _ACEOF LIBS="-leap-ikev2 $LIBS" fi if test "x$ac_cv_lib_eap_ikev2_ikev2_set_log_callback" != "xyes"; then fail="$fail libeap-ikev2" fi LDFLAGS=$old_LDFLAG old_CPPFLAGS=$CPPFLAGS CPPFLAGS=$eap_ikev2_includes if test "${ac_cv_header_EAPIKEv2_connector_h+set}" = set; then { echo "$as_me:$LINENO: checking for EAPIKEv2/connector.h" >&5 echo $ECHO_N "checking for EAPIKEv2/connector.h... $ECHO_C" >&6; } if test "${ac_cv_header_EAPIKEv2_connector_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi { echo "$as_me:$LINENO: result: $ac_cv_header_EAPIKEv2_connector_h" >&5 echo "${ECHO_T}$ac_cv_header_EAPIKEv2_connector_h" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking EAPIKEv2/connector.h usability" >&5 echo $ECHO_N "checking EAPIKEv2/connector.h usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? { echo "$as_me:$LINENO: checking EAPIKEv2/connector.h presence" >&5 echo $ECHO_N "checking EAPIKEv2/connector.h presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: EAPIKEv2/connector.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: EAPIKEv2/connector.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: EAPIKEv2/connector.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: EAPIKEv2/connector.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: EAPIKEv2/connector.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: EAPIKEv2/connector.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: EAPIKEv2/connector.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: EAPIKEv2/connector.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: EAPIKEv2/connector.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: EAPIKEv2/connector.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: EAPIKEv2/connector.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: EAPIKEv2/connector.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: EAPIKEv2/connector.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: EAPIKEv2/connector.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: EAPIKEv2/connector.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: EAPIKEv2/connector.h: in the future, the compiler will take precedence" >&2;} ;; esac { echo "$as_me:$LINENO: checking for EAPIKEv2/connector.h" >&5 echo $ECHO_N "checking for EAPIKEv2/connector.h... $ECHO_C" >&6; } if test "${ac_cv_header_EAPIKEv2_connector_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_EAPIKEv2_connector_h=$ac_header_preproc fi { echo "$as_me:$LINENO: result: $ac_cv_header_EAPIKEv2_connector_h" >&5 echo "${ECHO_T}$ac_cv_header_EAPIKEv2_connector_h" >&6; } fi if test "x$ac_cv_header_EAPIKEv2_connector_h" != "xyes"; then fail="$fail EAPIKEv2/connector.h" fi CPPFLAGS=$old_CPPFLAGS eap_ikev2_cflags="$eap_ikev2_includes" LDFLAGS="$LDFLAGS $openssl_libraries $eap_ikev2_libraries" targetname=rlm_eap_ikev2 # keep this! Don't change! else targetname= # keep this! Don't change! echo \*\*\* module rlm_eap_ikev2 is disabled. # keep this! Don't change! fi if test x"$fail" != x""; then if test x"${enable_strict_dependencies}" = x"yes"; then { { echo "$as_me:$LINENO: error: set --without-rlm_eap_ikev2 to disable it explicitly." >&5 echo "$as_me: error: set --without-rlm_eap_ikev2 to disable it explicitly." >&2;} { (exit 1); exit 1; }; } else { echo "$as_me:$LINENO: WARNING: silently not building rlm_eap_ikev2." >&5 echo "$as_me: WARNING: silently not building rlm_eap_ikev2." >&2;} { echo "$as_me:$LINENO: WARNING: FAILURE: rlm_eap_ikev2 requires: $fail." >&5 echo "$as_me: WARNING: FAILURE: rlm_eap_ikev2 requires: $fail." >&2;}; targetname="" fi fi # keep this! Don't change! unset ac_cv_env_LIBS_set unset ac_cv_env_LIBS_value ac_config_files="$ac_config_files 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_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( *) $as_unset $ac_var ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then test "x$cache_file" != "x/dev/null" && { echo "$as_me:$LINENO: updating cache $cache_file" >&5 echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 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}' # Transform confdefs.h into DEFS. # Protect against shell expansion while executing Makefile rules. # Protect against Makefile macro expansion. # # If the first sed substitution is executed (which looks for macros that # take arguments), then branch to the quote section. Otherwise, # look for a macro that doesn't take arguments. ac_script=' t clear :clear s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g t quote s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g t quote b any :quote s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g s/\[/\\&/g s/\]/\\&/g s/\$/$$/g H :any ${ g s/^\n// s/\n/ /g p } ' DEFS=`sed -n "$ac_script" confdefs.h` ac_libobjs= ac_ltlibobjs= 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=`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. ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs : ${CONFIG_STATUS=./config.status} ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >$CONFIG_STATUS <<_ACEOF #! $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} _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ## --------------------- ## ## 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=: # 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 # PATH needs CR # 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 # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false 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.) as_nl=' ' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. 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 # Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # CDPATH. $as_unset CDPATH as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, and appends # trailing '-' during substitution so that $LINENO is not a special # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # scripts with optimization help from Paolo Bonzini. 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" || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi 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 fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi 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=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 # Save the log message, to keep $[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by $as_me, which was generated by GNU Autoconf 2.61. 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 cat >>$CONFIG_STATUS <<_ACEOF # Files that config.status was made for. config_files="$ac_config_files" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit -q, --quiet 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 Configuration files: $config_files Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ config.status configured by $0, generated by GNU Autoconf 2.61, with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" Copyright (C) 2006 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' _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # If no file are specified by the user, then we need to provide default # value. By we need to know if files were specified by the user. 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=$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 ) echo "$ac_cs_version"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift CONFIG_FILES="$CONFIG_FILES $ac_optarg" ac_need_defaults=false;; --he | --h | --help | --hel | -h ) 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. -*) { echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *) ac_config_targets="$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 if \$ac_cs_recheck; then echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 CONFIG_SHELL=$SHELL export CONFIG_SHELL exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; 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 fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= trap 'exit_status=$? { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status ' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || { echo "$me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } # # Set up the sed scripts for CONFIG_FILES section. # # No need to generate the scripts if there are no CONFIG_FILES. # This happens for instance when ./config.status config.h if test -n "$CONFIG_FILES"; then _ACEOF ac_delim='%!_!# ' for ac_last_try in false false false false false :; do cat >conf$$subs.sed <<_ACEOF SHELL!$SHELL$ac_delim PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim PACKAGE_NAME!$PACKAGE_NAME$ac_delim PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim PACKAGE_STRING!$PACKAGE_STRING$ac_delim PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim exec_prefix!$exec_prefix$ac_delim prefix!$prefix$ac_delim program_transform_name!$program_transform_name$ac_delim bindir!$bindir$ac_delim sbindir!$sbindir$ac_delim libexecdir!$libexecdir$ac_delim datarootdir!$datarootdir$ac_delim datadir!$datadir$ac_delim sysconfdir!$sysconfdir$ac_delim sharedstatedir!$sharedstatedir$ac_delim localstatedir!$localstatedir$ac_delim includedir!$includedir$ac_delim oldincludedir!$oldincludedir$ac_delim docdir!$docdir$ac_delim infodir!$infodir$ac_delim htmldir!$htmldir$ac_delim dvidir!$dvidir$ac_delim pdfdir!$pdfdir$ac_delim psdir!$psdir$ac_delim libdir!$libdir$ac_delim localedir!$localedir$ac_delim mandir!$mandir$ac_delim DEFS!$DEFS$ac_delim ECHO_C!$ECHO_C$ac_delim ECHO_N!$ECHO_N$ac_delim ECHO_T!$ECHO_T$ac_delim LIBS!$LIBS$ac_delim build_alias!$build_alias$ac_delim host_alias!$host_alias$ac_delim target_alias!$target_alias$ac_delim CC!$CC$ac_delim CFLAGS!$CFLAGS$ac_delim LDFLAGS!$LDFLAGS$ac_delim CPPFLAGS!$CPPFLAGS$ac_delim ac_ct_CC!$ac_ct_CC$ac_delim EXEEXT!$EXEEXT$ac_delim OBJEXT!$OBJEXT$ac_delim CPP!$CPP$ac_delim GREP!$GREP$ac_delim EGREP!$EGREP$ac_delim eap_ikev2_cflags!$eap_ikev2_cflags$ac_delim eap_ikev2_ldflags!$eap_ikev2_ldflags$ac_delim targetname!$targetname$ac_delim LIBOBJS!$LIBOBJS$ac_delim LTLIBOBJS!$LTLIBOBJS$ac_delim _ACEOF if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 52; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` if test -n "$ac_eof"; then ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` ac_eof=`expr $ac_eof + 1` fi cat >>$CONFIG_STATUS <<_ACEOF cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof /@[a-zA-Z_][a-zA-Z_0-9]*@/!b end _ACEOF sed ' s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g s/^/s,@/; s/!/@,|#_!!_#|/ :n t n s/'"$ac_delim"'$/,g/; t s/$/\\/; p N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n ' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF :end s/|#_!!_#|//g CEOF$ac_eof _ACEOF # VPATH may cause trouble with some makes, so we remove $(srcdir), # ${srcdir} and @srcdir@ 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[ ]*=/{ s/:*\$(srcdir):*/:/ s/:*\${srcdir}:*/:/ s/:*@srcdir@:*/:/ s/^\([^=]*=[ ]*\):*/\1/ s/:*$// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF fi # test -n "$CONFIG_FILES" for ac_tag in :F $CONFIG_FILES do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5 echo "$as_me: error: Invalid tag $ac_tag." >&2;} { (exit 1); exit 1; }; };; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 echo "$as_me: error: cannot find input file: $ac_f" >&2;} { (exit 1); exit 1; }; };; esac ac_file_inputs="$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 "`IFS=: echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure." if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { echo "$as_me:$LINENO: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} fi case $ac_tag in *:-:* | *:-) cat >"$tmp/stdin";; 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 || 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" case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`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 || 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" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 echo "$as_me: error: cannot create directory $as_dir" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`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 # _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # 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= case `sed -n '/datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p ' $ac_file_inputs` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF 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 sed "$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s&@configure_input@&$configure_input&;t t s&@top_builddir@&$ac_top_builddir_sub&;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 $ac_datarootdir_hack " $ac_file_inputs | sed -f "$tmp/subs-1.sed" >$tmp/out test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&5 echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&2;} rm -f "$tmp/stdin" case $ac_file in -) cat "$tmp/out"; rm -f "$tmp/out";; *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;; esac ;; esac done # for ac_tag { (exit 0); exit 0; } _ACEOF chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save # 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 || { (exit 1); exit 1; } fi # keep this! Don't change! freeradius-server/src/modules/rlm_eap/types/rlm_eap_ikev2/configure.in000066400000000000000000000035131257552170400265770ustar00rootroot00000000000000AC_INIT(rlm_eap_ikev2.c) AC_REVISION($Revision$) AC_DEFUN(modname,[rlm_eap_ikev2]) if test x$with_[]modname != xno; then ## We may need more complex checking here. Assume for now that ## everyone has it. AC_CHECK_HEADERS(malloc.h) AC_ARG_WITH(eap-ikev2-includes, AS_HELP_STRING([--with-eap-ikev2-includes], [Diectory to look for EAPIKEv2 include files]), eap_ikev2_includes=-I$with_eap_ikev2_includes) AC_ARG_WITH(eap-ikev2-libraries, AS_HELP_STRING([--with-eap-ikev2-libraries], [Diectory to look for EAPIKEv2 library file]), eap_ikev2_libraries=-L$with_eap_ikev2_libraries) LDFLAGS="$eap_ikev2_libraries $OPENSSL_LIBS" AC_CHECK_LIB([eap-ikev2],[ikev2_set_log_callback]) if test "x$ac_cv_lib_eap_ikev2_ikev2_set_log_callback" != "xyes"; then fail="$fail libeap-ikev2" fi LDFLAGS=$old_LDFLAG old_CPPFLAGS=$CPPFLAGS CPPFLAGS=$eap_ikev2_includes AC_CHECK_HEADER(EAPIKEv2/connector.h) if test "x$ac_cv_header_EAPIKEv2_connector_h" != "xyes"; then fail="$fail EAPIKEv2/connector.h" fi CPPFLAGS=$old_CPPFLAGS eap_ikev2_cflags="$eap_ikev2_includes" LDFLAGS="$LDFLAGS $openssl_libraries $eap_ikev2_libraries" targetname=modname # keep this! Don't change! else targetname= # keep this! Don't change! echo \*\*\* module modname is disabled. # keep this! Don't change! fi dnl Don't change this section. if test x"$fail" != x""; then if test x"${enable_strict_dependencies}" = x"yes"; then AC_MSG_ERROR([set --without-]modname[ to disable it explicitly.]) else AC_MSG_WARN([silently not building ]modname[.]) AC_MSG_WARN([FAILURE: ]modname[ requires: $fail.]); targetname="" fi fi AC_SUBST(eap_ikev2_cflags) AC_SUBST(eap_ikev2_ldflags) dnl AC_CONFIG_HEADER(config.h) AC_SUBST(targetname) # keep this! Don't change! AC_OUTPUT(Makefile) # keep this! Don't change! freeradius-server/src/modules/rlm_eap/types/rlm_eap_ikev2/ike_conf.c000066400000000000000000000250771257552170400262200ustar00rootroot00000000000000/* * ike_conf.c - module config loading functions * * This file is part of rlm_eap_ikev2 freeRADIUS module which implements * EAP-IKEv2 protocol functionality. * * 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 * * Copyright (C) 2005-2006 Krzysztof Rzecki * Copyright (C) 2005-2006 Rafal Mijal * Copyright (C) 2005-2006 Piotr Marnik * Copyright (C) 2005-2006 Pawel Matejski * Copyright 1999-2007 The FreeRADIUS server project * */ #include #include #include "ike_conf.h" #include "eap.h" #include "logging_impl.h" static int rad_load_transforms(struct Protocol *prot,CONF_SECTION *cf); struct config_transform { const char *name; u_int8_t type; int exist_flag; }; enum { OPT_INTEGRITY = 0x01, OPT_PRF = 0x02, OPT_ENCRYPTION = 0x04, OPT_DHGROUP = 0x08, OPT_NEEDED = OPT_INTEGRITY | OPT_PRF | OPT_ENCRYPTION | OPT_DHGROUP }; static struct config_transform config_transforms[] = { {"integrity", IKEv2_TRT_INTEGRITY_ALGORITHM, OPT_INTEGRITY}, {"prf", IKEv2_TRT_PSEUDO_RANDOM_FUNCTION, OPT_PRF}, {"encryption", IKEv2_TRT_ENCRYPTION_ALGORITHM, OPT_ENCRYPTION}, {"dhgroup", IKEv2_TRT_DIFFIE_HELLMAN_GROUP, OPT_DHGROUP }, {NULL,0,0} /* end of list */ }; /* * Copied from rlm_files, and NOT under the same copyright * as the rest of the module! * * Also, it is UNNECESSARY to read the "users" file here! * Doing this shows a misunderstanding of how the server works. */ int getusersfile(const char *filename, PAIR_LIST **pair_list, const char *compat_mode_str) { int rcode; PAIR_LIST *users = NULL; rcode = pairlist_read(filename, &users, 1); if (rcode < 0) { return -1; } /* * Walk through the 'users' file list, if we're debugging, * or if we're in compat_mode. */ if ((debug_flag) || (strcmp(compat_mode_str, "cistron") == 0)) { PAIR_LIST *entry; VALUE_PAIR *vp; int compat_mode = FALSE; if (strcmp(compat_mode_str, "cistron") == 0) { compat_mode = TRUE; } entry = users; while (entry) { if (compat_mode) { DEBUG("[%s]:%d Cistron compatibility checks for entry %s ...", filename, entry->lineno, entry->name); } /* * Look for improper use of '=' in the * check items. They should be using * '==' for on-the-wire RADIUS attributes, * and probably ':=' for server * configuration items. */ for (vp = entry->check; vp != NULL; vp = vp->next) { /* * Ignore attributes which are set * properly. */ if (vp->operator != T_OP_EQ) { continue; } /* * If it's a vendor attribute, * or it's a wire protocol, * ensure it has '=='. */ if (((vp->attribute & ~0xffff) != 0) || (vp->attribute < 0x100)) { if (!compat_mode) { DEBUG("[%s]:%d WARNING! Changing '%s =' to '%s =='\n\tfor comparing RADIUS attribute in check item list for user %s", filename, entry->lineno, vp->name, vp->name, entry->name); } else { DEBUG("\tChanging '%s =' to '%s =='", vp->name, vp->name); } vp->operator = T_OP_CMP_EQ; continue; } /* * Cistron Compatibility mode. * * Re-write selected attributes * to be '+=', instead of '='. * * All others get set to '==' */ if (compat_mode) { /* * Non-wire attributes become += * * On the write attributes * become == */ if ((vp->attribute >= 0x100) && (vp->attribute <= 0xffff) && (vp->attribute != PW_HINT) && (vp->attribute != PW_HUNTGROUP_NAME)) { DEBUG("\tChanging '%s =' to '%s +='", vp->name, vp->name); vp->operator = T_OP_ADD; } else { DEBUG("\tChanging '%s =' to '%s =='", vp->name, vp->name); vp->operator = T_OP_CMP_EQ; } } } /* end of loop over check items */ /* * Look for server configuration items * in the reply list. * * It's a common enough mistake, that it's * worth doing. */ for (vp = entry->reply; vp != NULL; vp = vp->next) { /* * If it's NOT a vendor attribute, * and it's NOT a wire protocol * and we ignore Fall-Through, * then bitch about it, giving a * good warning message. */ if (!(vp->attribute & ~0xffff) && (vp->attribute > 0xff) && (vp->attribute > 1000)) { log_debug("[%s]:%d WARNING! Check item \"%s\"\n" "\tfound in reply item list for user \"%s\".\n" "\tThis attribute MUST go on the first line" " with the other check items", filename, entry->lineno, vp->name, entry->name); } } entry = entry->next; } } *pair_list = users; return 0; } /** * Load all proposals from 'propsals' subsection */ int rad_load_proposals(ikev2_ctx *i2,CONF_SECTION *cf) { rad_assert(i2!=NULL && cf!=NULL); CONF_SECTION *cf_prop=NULL; cf=cf_subsection_find_next(cf,NULL,"proposals"); if(!cf) { radlog(L_ERR,IKEv2_LOG_PREFIX "Can't find proposals section"); return -1; } int nprop=0; for( cf_prop=cf_subsection_find_next(cf,NULL,"proposal"); cf_prop; cf_prop=cf_subsection_find_next(cf,cf_prop,"proposal") ) { nprop++; struct Proposal *prop; struct Protocol *prot; prop=AddProposal(&i2->suppProp); prot=AddProtocol(prop,IKEv2_PID_IKE_SA,0,0); if(rad_load_transforms(prot,cf_prop)) { radlog(L_ERR,IKEv2_LOG_PREFIX "Failed to load proposal (%d)", nprop); return -1; } } if(!nprop) { radlog(L_ERR,IKEv2_LOG_PREFIX "Can't find any proposal"); return -1; } return 0; } /** * Load transforms from protocol subsection */ static int rad_load_transforms(struct Protocol *prot,CONF_SECTION *cf) { rad_assert(prot!=NULL && cf!=NULL); radlog(L_DBG,IKEv2_LOG_PREFIX "Begin load transforms"); CONF_PAIR *cp; int option_exists=0; int i=0; while(config_transforms[i].name) { uint8_t id; uint16_t keylen; for( cp=cf_pair_find(cf,config_transforms[i].name); cp; cp=cf_pair_find_next(cf,cp,config_transforms[i].name) ) { if(TransformFromName(cf_pair_value(cp),config_transforms[i].type,&id,&keylen)) { radlog(L_ERR,IKEv2_LOG_PREFIX "Unsupported %s transform: %s ", config_transforms[i].name,cf_pair_value(cp)); return -1; } if(!AddTransform(prot,config_transforms[i].type,id,keylen)) { radlog(L_ERR,IKEv2_LOG_PREFIX "Problem with transform %s:%s", config_transforms[i].name,cf_pair_value(cp)); return -1; } option_exists|=config_transforms[i].exist_flag; } i++; } if((option_exists & OPT_NEEDED) != OPT_NEEDED ) { radlog(L_ERR,IKEv2_LOG_PREFIX "Not all mandatory transforms are set properly"); radlog(L_DBG,IKEv2_LOG_PREFIX "Option flags: 0x%02X",option_exists); return -1; } return 0; } void rad_update_shared_seclist(struct sharedSecList **list,char *id,VALUE_PAIR *items,int default_client_authtype) { rad_assert(list && id); char *secret=NULL; int id_type=0; int authtype=default_client_authtype; if(items) { VALUE_PAIR *vp; //idtype vp=pairfind(items,RAD_EAP_IKEV2_IDTYPE); if(!vp) { radlog(L_DBG,IKEv2_LOG_PREFIX "[%s] -- Id type not set",id); } else { if(!(id_type=vp->lvalue)) { radlog(L_DBG,IKEv2_LOG_PREFIX "[%s] -- Not valid id type",id); } } //secret vp=pairfind(items,RAD_EAP_IKEV2_SECRET); if(!vp || !vp->length) { radlog(L_DBG,IKEv2_LOG_PREFIX "[%s] -- Secret not set",id); } else { secret=vp->vp_strvalue; } //authtype vp=pairfind(items,RAD_EAP_IKEV2_AUTHTYPE); if(vp && vp->length) { authtype=AuthtypeFromName(vp->vp_strvalue); if(authtype==-1) { radlog(L_ERR,IKEv2_LOG_PREFIX "Unsupported 'EAP-IKEv2-AuthType' value (%s),using 'both'",vp->vp_strvalue); authtype=IKEv2_AUTH_BOTH; } } AddSharedSec(list,id_type,id,secret,authtype); } else { AddSharedSec(list,0,id,NULL,default_client_authtype); } } /** * load user credentials from raddb/users (read directly from users file) */ int rad_load_credentials(ikev2_ctx *i2,char *filename,char *authtype_name) { rad_assert(i2 && filename && authtype_name); int authtype; authtype=AuthtypeFromName(authtype_name); if(authtype==-1) { radlog(L_ERR,IKEv2_LOG_PREFIX "Unsupported 'default_auth_type' value (%s), using both",authtype_name); authtype=IKEv2_AUTH_BOTH; } PAIR_LIST *users=NULL; if(getusersfile(filename,&users,"no")!=0) { radlog(L_ERR,IKEv2_LOG_PREFIX "Error while loading %s userfile",filename); return -1; } PAIR_LIST *tusers=users; while(tusers) { if(strcmp(tusers->name,"DEFAULT")) { rad_update_shared_seclist(&i2->sslist,tusers->name,tusers->check,authtype); } tusers=tusers->next; } pairlist_free(&users); //print sslist // struct sharedSecList *sslist=i2->sslist; // while(sslist) { // radlog(L_ERR,"sslist:id=%s",sslist->id); // radlog(L_ERR,"sslist:idlen=%d",sslist->idlen); // radlog(L_ERR,"sslist:pwd=%s",sslist->pwd); // radlog(L_ERR,"sslist:pwdlen=%d",sslist->pwdlen); // radlog(L_ERR,"sslist:idtype= %d",sslist->idtype); // radlog(L_ERR,"sslist:authtype=%d",sslist->authtype); // sslist=sslist->next; // } return 0; } int rad_get_authtype(char* authtype_name) { rad_assert(authtype_name); if(!strcmp(authtype_name,"cert")) { radlog(L_DBG,IKEv2_LOG_PREFIX "Using server auth type: cert"); return IKEv2_AUTH_CERT; } if(!strcmp(authtype_name,"secret")) { radlog(L_DBG,IKEv2_LOG_PREFIX "Using server auth type: secret"); return IKEv2_AUTH_SK; } radlog(L_AUTH,IKEv2_LOG_PREFIX "Unsupported server auth type: %s",authtype_name); radlog(L_AUTH,IKEv2_LOG_PREFIX "Using server auth type: secret (default)"); return IKEv2_AUTH_SK; } int file_exists(char *filename) { int result=0; FILE *fp=fopen(filename,"r"); if(fp) { result=1; fclose(fp); } return result; } freeradius-server/src/modules/rlm_eap/types/rlm_eap_ikev2/ike_conf.h000066400000000000000000000036161257552170400262200ustar00rootroot00000000000000/* * ike_conf.h - module config loading functions * * This file is part of rlm_eap_ikev2 freeRADIUS module which implements * EAP-IKEv2 protocol functionality. * * 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 * * Copyright (C) 2005-2006 Krzysztof Rzecki * Copyright (C) 2005-2006 Rafal Mijal * Copyright (C) 2005-2006 Piotr Marnik * Copyright (C) 2005-2006 Pawel Matejski * */ #ifndef IKE_CONF_H #define IKE_CONF_H #include #include "eap.h" #define RAD_EAP_IKEV2_IDTYPE 1103 #define RAD_EAP_IKEV2_ID 1104 #define RAD_EAP_IKEV2_SECRET 1105 #define RAD_EAP_IKEV2_AUTHTYPE 1106 int rad_load_proposals(ikev2_ctx *i2,CONF_SECTION *cf); int rad_load_credentials(ikev2_ctx *i2,char *filename,char *authtype_name); int getusersfile(const char *filename, PAIR_LIST **pair_list,const char *compat_mode_str); void rad_update_shared_seclist(struct sharedSecList **list,char *id,VALUE_PAIR *items,int default_client_authtype); int rad_get_authtype(char *authtype_name); int rad_get_client_authtype(const char *authtype); int file_exists(char *filename); #endif //IKE_CONF_H freeradius-server/src/modules/rlm_eap/types/rlm_eap_ikev2/logging_impl.c000066400000000000000000000031771257552170400271070ustar00rootroot00000000000000/* * logging_impl.c - logging callback for lib-eapikev2 * * This file is part of rlm_eap_ikev2 freeRADIUS module which implements * EAP-IKEv2 protocol functionality. * * 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 * * Copyright (C) 2005-2006 Krzysztof Rzecki * Copyright (C) 2005-2006 Rafal Mijal * Copyright (C) 2005-2006 Piotr Marnik * Copyright (C) 2005-2006 Pawel Matejski * */ #include #include "logging_impl.h" #include #include #include void vxlogf(int iklevel, const char * fmt,va_list ap) { int level; switch(iklevel) { case I2L_DBG: level=L_DBG; break; case I2L_INFO: level=L_INFO; break; case I2L_ERR: level=L_ERR; break; default: level=L_DBG; } vradlog(level, fmt, ap); } freeradius-server/src/modules/rlm_eap/types/rlm_eap_ikev2/logging_impl.h000066400000000000000000000026131257552170400271060ustar00rootroot00000000000000/* * logging_impl.c - logging callback for lib-eapikev2 * * This file is part of rlm_eap_ikev2 freeRADIUS module which implements * EAP-IKEv2 protocol functionality. * * 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 * * Copyright (C) 2005-2006 Krzysztof Rzecki * Copyright (C) 2005-2006 Rafal Mijal * Copyright (C) 2005-2006 Piotr Marnik * Copyright (C) 2005-2006 Pawel Matejski * */ #ifndef LOGGING_IMPL_H #define LOGGING_IMPL_H #include #define IKEv2_LOG_PREFIX " rlm_eap_ikev2: " void vxlogf(int iklevel, const char * fmt,va_list ap); #endif //LOGGING_IMPL_H freeradius-server/src/modules/rlm_eap/types/rlm_eap_ikev2/rlm_eap_ikev2.c000066400000000000000000000372431257552170400271600ustar00rootroot00000000000000/* * rlm_eap_ikev2.c - Handles that are called from eap * * This file is part of rlm_eap_ikev2 freeRADIUS module which implements * EAP-IKEv2 protocol functionality. * * 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 * * Copyright (C) 2005-2006 Krzysztof Rzecki * Copyright (C) 2005-2006 Rafal Mijal * Copyright (C) 2005-2006 Piotr Marnik * Copyright (C) 2005-2006 Pawel Matejski * Copyright 1999-2007 The FreeRADIUS server project * */ #include #include "eap.h" #include #include #include #include #include "logging_impl.h" #include #include "ike_conf.h" #define PW_IKEV2_CHALLENGE 1 #define PW_IKEV2_RESPONSE 2 #define PW_IKEV2_SUCCESS 3 #define PW_IKEV2_FAILURE 4 #define PW_IKEV2_MAX_CODES 4 #define IKEV2_HEADER_LEN 4 #define IKEV2_MPPE_KEY_LEN 32 /* * Add value pair to reply: copied from FreeRADIUS */ static void add_reply(VALUE_PAIR** vp, const char* name, const char* value, int len) { VALUE_PAIR *reply_attr; reply_attr = pairmake(name, "", T_OP_EQ); if (!reply_attr) { radlog(L_INFO, IKEv2_LOG_PREFIX "add_reply failed to create attribute %s: %s", name, fr_strerror()); return; } memcpy(reply_attr->vp_octets, value, len); reply_attr->length = len; pairadd(vp, reply_attr); } static int set_mppe_keys(EAP_HANDLER *handler) { unsigned char *p; struct IKEv2Session *session; VALUE_PAIR **outvps; session = ((struct IKEv2Data*)handler->opaque)->session; if (session->eapKeyData==NULL){ radlog( L_INFO,IKEv2_LOG_PREFIX "Key session not available!!!"); return 1; } /* outvps is the session to the client. */ outvps= &handler->request->reply->vps; p = session->eapKeyData; add_reply(outvps, "MS-MPPE-Recv-Key",(const char*) p, IKEV2_MPPE_KEY_LEN); p += IKEV2_MPPE_KEY_LEN; add_reply(outvps, "MS-MPPE-Send-Key",(const char*) p, IKEV2_MPPE_KEY_LEN); return 0; } // Compose Radius like message from table of output bytes static int ComposeRadMsg(uint8_t *out,u_int32_t olen, EAP_DS *eap_ds){ eap_ds->request->type.type = PW_EAP_IKEV2; eap_ds->request->code = ((struct EAPHeader *)out)->Code; if(eap_ds->request->code<=PW_EAP_REQUEST && olen>4) { int lenn=(int)ntohs(((struct EAPHeader *)out)->Length); eap_ds->request->type.data = malloc(lenn); if (eap_ds->request->type.data == NULL) { radlog(L_ERR, IKEv2_LOG_PREFIX "out of memory"); return 1; } memcpy(eap_ds->request->type.data,out+5,lenn-5); eap_ds->request->type.length = lenn-5; } else { eap_ds->request->type.data=NULL; eap_ds->request->type.length=0; } return 0; } /** * Free memory after EAP-IKEv2 module usage */ static int ikev2_detach(void *type_data) { radlog(L_DBG,IKEv2_LOG_PREFIX "dettach"); struct ikev2_ctx *data=(struct ikev2_ctx*)type_data; if(data) { Free_ikev2_ctx(data); data=NULL; } return 0; } /** * Free memory after finished IKEv2 session */ static void ikev2_free_opaque(void *opaque) { radlog(L_DBG,IKEv2_LOG_PREFIX "Free session data"); struct IKEv2Data *ikev2_data=(struct IKEv2Data*)opaque; if(ikev2_data->session) { if(ikev2_data->session->Status!=IKEv2_SST_ESTABLISHED) { radlog(L_DBG, IKEv2_LOG_PREFIX "Unfinished IKEv2 session - cleanup!!!"); IKEv2EndSession(ikev2_data->i2,ikev2_data->session); ikev2_data->session=NULL; } else { radlog(L_DBG, IKEv2_LOG_PREFIX "Unfinished IKEv2 session - keep it!!!"); ikev2_data->session=NULL; } } int fastDeleted=FreeSessionIfExpired(ikev2_data->i2,time(NULL)); if(fastDeleted) { radlog(L_DBG,IKEv2_LOG_PREFIX "Deleted %d expired IKEv2 sessions",fastDeleted); } free(ikev2_data); } /** * Configure EAP-ikev2 handler */ static int ikev2_attach(CONF_SECTION *conf, void **type_data) { radlog(L_DBG,IKEv2_LOG_PREFIX "attach"); char *default_authtype=NULL; char *usersfilename=NULL; char *server_authtype=NULL; char *server_idtype=NULL; CONF_PARSER module_config[] = { { "CA_file", PW_TYPE_STRING_PTR, offsetof(ikev2_ctx,trusted),NULL,NULL }, { "private_key_file",PW_TYPE_STRING_PTR, offsetof(ikev2_ctx,pkfile),NULL,NULL }, { "private_key_password",PW_TYPE_STRING_PTR, offsetof(ikev2_ctx,pkfile_pwd),NULL,NULL }, { "certificate_file", PW_TYPE_STRING_PTR, offsetof(ikev2_ctx,certfile),NULL,NULL }, { "crl_file", PW_TYPE_STRING_PTR, offsetof(ikev2_ctx,crl_file),NULL,NULL }, { "id", PW_TYPE_STRING_PTR, offsetof(ikev2_ctx,id),NULL,NULL }, { "fragment_size",PW_TYPE_INTEGER, offsetof(ikev2_ctx,max_fragment_size),NULL,IKEv2_DEFAULT_MAX_FRAGMENT_SIZE_STR}, { "DH_counter_max", PW_TYPE_INTEGER, offsetof(ikev2_ctx,DHCounterMax),NULL,IKEv2_DEFAULT_DH_COUNTER_MAX_STR}, { "default_authtype",PW_TYPE_STRING_PTR, 0,&default_authtype,"both" }, { "usersfile",PW_TYPE_STRING_PTR, 0,&usersfilename,"${confdir}/users" }, { "server_authtype",PW_TYPE_STRING_PTR, 0,&server_authtype,"secret" }, { "idtype",PW_TYPE_STRING_PTR, 0,&server_idtype,IKEv2_DEFAULT_IDTYPE_STR}, { "certreq",PW_TYPE_BOOLEAN, offsetof(ikev2_ctx,sendCertReq),NULL,"no"}, { "fast_DH_exchange",PW_TYPE_BOOLEAN, offsetof(ikev2_ctx,enableFastDHEx),NULL,"no"}, { "fast_timer_expire",PW_TYPE_INTEGER, offsetof(ikev2_ctx,fastExpire),NULL,"900"}, { "enable_fast_reauth",PW_TYPE_BOOLEAN, offsetof(ikev2_ctx,enableFastReconnect),NULL,"yes"}, { NULL, -1, 0, NULL, NULL } /* end the list */ }; ikev2_set_log_callback(vxlogf); struct ikev2_ctx *i2; i2 = Create_ikev2_ctx(); if (i2 == NULL) { radlog(L_ERR,IKEv2_LOG_PREFIX "Error: Can't allocate mem for i2."); return -1; } *type_data=i2; if (cf_section_parse(conf,i2, module_config) < 0) { ikev2_detach(i2); return -1; } hexalize(&i2->id,&i2->idlen); //hexalize(&i2->pwd,&i2->pwdlen); i2->authtype=rad_get_authtype(server_authtype); if(!i2->id) { ikev2_detach(i2); radlog(L_ERR,IKEv2_LOG_PREFIX "'id' configuration option is required!!!"); return -1; } switch(i2->authtype) { case IKEv2_AUTH_SK: break; case IKEv2_AUTH_CERT: if(!i2->certfile || !i2->pkfile) { ikev2_detach(i2); radlog(L_ERR,IKEv2_LOG_PREFIX "'certificate_file' and 'private_key_file' items are required for 'cert' auth type"); return -1; } if(!file_exists(i2->certfile)) { radlog(L_ERR,IKEv2_LOG_PREFIX "Can not open 'certificate_file' %s",i2->certfile); ikev2_detach(i2); return -1; } if(!file_exists(i2->pkfile)) { radlog(L_ERR,IKEv2_LOG_PREFIX "Can not open 'private_key_file' %s",i2->pkfile); ikev2_detach(i2); return -1; } break; } if(!i2->trusted) { radlog(L_AUTH,IKEv2_LOG_PREFIX "'CA_file' item not set, client cert based authentication will fail"); } else { if(!file_exists(i2->trusted)) { radlog(L_ERR,IKEv2_LOG_PREFIX "Can not open 'CA_file' %s",i2->trusted); ikev2_detach(i2); return -1; } } if(i2->crl_file) { if(!file_exists(i2->crl_file)) { radlog(L_ERR,IKEv2_LOG_PREFIX "Can not open 'crl_file' %s",i2->crl_file); ikev2_detach(i2); return -1; } radlog(L_DBG,IKEv2_LOG_PREFIX "Using CRL file: %s",i2->crl_file); } i2->idtype=IdTypeFromName(server_idtype); if(i2->idtype<=0) { radlog(L_ERR,IKEv2_LOG_PREFIX "Unsupported 'idtype': %s",server_idtype); free(server_idtype); server_idtype=NULL; ikev2_detach(i2); return -1; } free(server_idtype); server_idtype=NULL; radlog(L_DBG,IKEv2_LOG_PREFIX "Reading proposals ..."); if(rad_load_proposals(i2,conf)) { ikev2_detach(i2); radlog(L_ERR,IKEv2_LOG_PREFIX "Failed to load proposals"); return -1; } int res=rad_load_credentials(i2,usersfilename,default_authtype); free(default_authtype); default_authtype=NULL; free(usersfilename); usersfilename=NULL; free(server_authtype); server_authtype=NULL; if(res==-1) { ikev2_detach(i2); radlog(L_ERR,IKEv2_LOG_PREFIX "Error while loading users credentials"); return -1; } i2->x509_store = NULL; if(CertInit(i2)){ ikev2_detach(i2); radlog(L_ERR,IKEv2_LOG_PREFIX "Error while loading certs/crl"); return -1; } return 0; } /* * Initiate the EAP-ikev2 session by sending a challenge to the peer. */ static int ikev2_initiate(void *type_data, EAP_HANDLER *handler) { radlog( L_INFO,IKEv2_LOG_PREFIX "Initiate connection!"); // This is the way for silent discarding behavior // handler->request->options|=RAD_REQUEST_OPTION_FAKE_REQUEST; // handler->request->options|=RAD_REQUEST_OPTION_DONT_CACHE; // handler->request->reply->code=0; // return 0; struct ikev2_ctx *i2=(struct ikev2_ctx*)type_data; struct IKEv2Session *session; handler->free_opaque=ikev2_free_opaque; // try get respondent FASTID uint8_t *eap_username=handler->request->username->vp_strvalue; session=FindSessionByFastid(i2,(const char*)eap_username); if(!session) { if( IKEv2BeginSession( i2, &session, IKEv2_STY_INITIATOR ) != IKEv2_RET_OK ) { radlog(L_ERR,IKEv2_LOG_PREFIX "Error: Can't initialize IKEv2 session."); return 1; } } else { radlog(L_DBG, IKEv2_LOG_PREFIX "Fast reconnect procedure start"); } session->timestamp=time(NULL); struct IKEv2Data *ikev2_data=IKEv2Data_new(i2,session); handler->opaque=ikev2_data; #if 0 // print session counter if(i2->SessionList) { int session_count=0; struct IKEv2Session *ss; ss=i2->SessionList; while(ss) { session_count++; //radlog(L_ERR,"XXX scounter -> fastid=[%s]",ss->fastID); ss=ss->pNext; } radlog(L_ERR,"XXX: session list contains:%d",session_count); } #endif uint8_t *sikemsg=NULL; u_int32_t slen=0; if( IKEv2ProcessMsg( i2, NULL , &sikemsg, &slen, session) != IKEv2_RET_OK ) { radlog(L_ERR,IKEv2_LOG_PREFIX "Error while processing IKEv2 message"); return 1; } uint8_t *out=NULL; u_int32_t olen=0; if( slen != 0 ) { session->eapMsgID++; olen = CreateIKEv2Message(i2, sikemsg, slen, false, 0, session, &out ); if( session->fragdata ) session->sendfrag = true; } if (olen>0&&out!=NULL){ if(ComposeRadMsg(out,olen,handler->eap_ds)){ free(out); return 0; } free(out); } /* * We don't need to authorize the user at this point. * * We also don't need to keep the challenge, as it's * stored in 'handler->eap_ds', which will be given back * to us... */ handler->stage = AUTHENTICATE; return 1; } /* * Authenticate a previously sent challenge. */ static int ikev2_authenticate(void *type_data, EAP_HANDLER *handler) { struct ikev2_ctx *i2=(struct ikev2_ctx*)type_data; radlog( L_INFO, IKEv2_LOG_PREFIX "authenticate" ); rad_assert(handler->request != NULL); rad_assert(handler->stage == AUTHENTICATE); //!!!!!if( hdr->Code == EAP_CODE_RESPONSE && hdr->Id == session->MsgID ) //!!!!! dorobic sprawdzanie czy to nie potwierdzenie odebrania fragmentu!!! EAP_DS *eap_ds=handler->eap_ds; if (!eap_ds || !eap_ds->response || (eap_ds->response->code != PW_IKEV2_RESPONSE) || eap_ds->response->type.type != PW_EAP_IKEV2 || !eap_ds->response->type.data){ radlog(L_ERR, IKEv2_LOG_PREFIX "corrupted data"); return -1; } //skladanie pakietu uint8_t *in=NULL; if(!(in=malloc(eap_ds->response->length))){ radlog(L_ERR, IKEv2_LOG_PREFIX "malloc error"); return -1; } rad_assert(in!=NULL); struct EAPHeader *hdr = (struct EAPHeader *)in; hdr->Code=eap_ds->response->code; hdr->Id=eap_ds->response->id; hdr->Length=htons(eap_ds->response->length); hdr->Type=eap_ds->response->type.type; memcpy(in+5,eap_ds->response->type.data,eap_ds->response->length-5); //koniec: skladanie pakietu uint8_t *out=NULL; u_int32_t olen=0; struct IKEv2Data *ikev2_data=(struct IKEv2Data*)handler->opaque; struct IKEv2Session *session=ikev2_data->session; session->timestamp=time(NULL); if( !session->fragdata ) session->sendfrag = false; if( session->sendfrag && !ParseFragmentAck( in, session ) ){ session->eapMsgID=eap_ds->response->id+1; olen = CreateIKEv2Message( i2, NULL, 0, false, hdr->Id, session, (uint8_t **)&out ); free(in); if(ComposeRadMsg(out,olen,handler->eap_ds)){ free(out); return 0; } free(out); return 1; } uint8_t *ikemsg; u_int32_t len; session->eapMsgID=eap_ds->response->id+1; if( ParseIKEv2Message( in, &ikemsg, &len, session ) ) { if(ikemsg!=NULL) free (ikemsg); handler->eap_ds->request->code=PW_EAP_FAILURE; radlog(L_INFO,IKEv2_LOG_PREFIX "Discarded packet"); return 1; } if( !ikemsg || !len ) // send fragment ack { if(session->SK_ready) session->include_integ=1; olen = CreateFragmentAck( in, &out, session ); // confirm fragment free(in); in=NULL; if(ComposeRadMsg(out,olen,handler->eap_ds)){ free(out); return 0; } free(out); return 1; } free(in); in=NULL; uint8_t *sikemsg=NULL; //out message u_int32_t slen=0; if( IKEv2ProcessMsg( i2, ikemsg, &sikemsg, &slen, session) != IKEv2_RET_OK ) { radlog(L_INFO, IKEv2_LOG_PREFIX "EAP_STATE_DISCARD"); //session->State = EAP_STATE_DISCARD; free(out); return 1; } free( ikemsg ); if( slen != 0 ) //if there is there is something to send { olen = CreateIKEv2Message(i2, sikemsg, slen, false, 0, session, &out ); //bobo: a to co ? if( session->fragdata ) session->sendfrag = true; } else { if( session->Status == IKEv2_SST_FAILED ) { radlog(L_INFO,IKEv2_LOG_PREFIX "FAILED"); olen = CreateResultMessage( false, session, &out ); } if( session->Status == IKEv2_SST_ESTABLISHED ) { radlog(L_INFO,IKEv2_LOG_PREFIX "SUCCESS"); olen = CreateResultMessage( true, session, &out ); session->fFastReconnect=i2->enableFastReconnect; //bobo:session->eapKeyData jest zle zainicjalizowane tutaj !!!!!!!!!!!!!! nie jest NULL!!!!!!!!!!1!!!!!!!!!!!!!!!!!!!!!!!11 GenEapKeys(session,EAP_IKEv2_KEY_LEN); set_mppe_keys(handler); } // keep sessions in memory, only reference cleared ikev2_data->session=NULL; } if (olen>0&&out!=NULL){ if(ComposeRadMsg(out,olen,handler->eap_ds)){ free(out); return 0; } } //eap_ds->request->code = PW_EAP_REQUEST; free(out); return 1; } /* * The module name should be the only globally exported symbol. * That is, everything else should be 'static'. */ EAP_TYPE rlm_eap_ikev2 = { "eap_ikev2", ikev2_attach, /* attach */ ikev2_initiate, /* Start the initial request */ NULL, /* authorization */ ikev2_authenticate, /* authentication */ ikev2_detach /* detach */ }; freeradius-server/src/modules/rlm_eap/types/rlm_eap_leap/000077500000000000000000000000001257552170400241655ustar00rootroot00000000000000freeradius-server/src/modules/rlm_eap/types/rlm_eap_leap/Makefile000066400000000000000000000004361257552170400256300ustar00rootroot00000000000000# # Makefile # # Version: $Id$ # TARGET = rlm_eap_leap SRCS = rlm_eap_leap.c eap_leap.c smbdes.c RLM_CFLAGS = -I../.. -I../../libeap HEADERS = eap_leap.h ../../eap.h ../../rlm_eap.h RLM_INSTALL = RLM_DIR=../../ include ${RLM_DIR}../rules.mak $(LT_OBJS): $(HEADERS) freeradius-server/src/modules/rlm_eap/types/rlm_eap_leap/eap_leap.c000066400000000000000000000276131257552170400261100ustar00rootroot00000000000000/* * eap_leap.c EAP LEAP functionality. * * Version: $Id$ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2003 Alan DeKok * Copyright 2006 The FreeRADIUS server project */ /* * * LEAP Packet Format in EAP Type-Data * --- ------ ------ -- --- --------- * 0 1 2 3 * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | Type 0x11 | Version 0x01 | Unused 0x00 | Count 0x08 | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | Peer Challenge | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | Peer Challenge | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | User Name ..... * +-+-+-+-+-+-+-+-+-+-+-+-+-+- * * Count is 8 octets since the Peer challenge is 8 bytes. * Count is 24 for EAP response, with MSCHAP response. * Length is the total number of octets in the EAP-Message. * * The LEAP type (0x11) is *not* included in the type data... */ #include RCSID("$Id$") #include #include #include "eap.h" #include "eap_leap.h" /* * Allocate a new LEAP_PACKET */ LEAP_PACKET *eapleap_alloc(void) { LEAP_PACKET *rp; if ((rp = malloc(sizeof(LEAP_PACKET))) == NULL) { radlog(L_ERR, "rlm_eap_leap: out of memory"); return NULL; } memset(rp, 0, sizeof(LEAP_PACKET)); return rp; } /* * Free LEAP_PACKET */ void eapleap_free(LEAP_PACKET **leap_packet_ptr) { LEAP_PACKET *leap_packet; if (!leap_packet_ptr) return; leap_packet = *leap_packet_ptr; if (leap_packet == NULL) return; if (leap_packet->challenge) free(leap_packet->challenge); if (leap_packet->name) free(leap_packet->name); free(leap_packet); *leap_packet_ptr = NULL; } /* * Extract the data from the LEAP packet. */ LEAP_PACKET *eapleap_extract(EAP_DS *eap_ds) { leap_packet_t *data; LEAP_PACKET *packet; int name_len; /* * LEAP can have EAP-Response or EAP-Request (step 5) * messages sent to it. */ if (!eap_ds || !eap_ds->response || ((eap_ds->response->code != PW_EAP_RESPONSE) && (eap_ds->response->code != PW_EAP_REQUEST)) || eap_ds->response->type.type != PW_EAP_LEAP || !eap_ds->response->type.data || (eap_ds->response->length < LEAP_HEADER_LEN) || (eap_ds->response->type.data[0] != 0x01)) { /* version 1 */ radlog(L_ERR, "rlm_eap_leap: corrupted data"); return NULL; } /* * Hmm... this cast isn't the best thing to do. */ data = (leap_packet_t *)eap_ds->response->type.data; /* * Some simple sanity checks on the incoming packet. * * See 'leap.txt' in this directory for a description * of the stages. */ switch (eap_ds->response->code) { case PW_EAP_RESPONSE: if (data->count != 24) { radlog(L_ERR, "rlm_eap_leap: Bad NTChallengeResponse in LEAP stage 3"); return NULL; } break; case PW_EAP_REQUEST: if (data->count != 8) { radlog(L_ERR, "rlm_eap_leap: Bad AP Challenge in LEAP stage 5"); return NULL; } break; default: radlog(L_ERR, "rlm_eap_leap: Invalid EAP code %d", eap_ds->response->code); return NULL; break; } packet = eapleap_alloc(); if (!packet) return NULL; /* * Remember code, length, and id. */ packet->code = eap_ds->response->code; packet->id = eap_ds->response->id; /* * The size of the LEAP portion of the packet, not * counting the EAP header and the type. */ packet->length = eap_ds->response->length - EAP_HEADER_LEN - 1; /* * Remember the length of the challenge. */ packet->count = data->count; packet->challenge = malloc(packet->count); if (packet->challenge == NULL) { radlog(L_ERR, "rlm_eap_leap: out of memory"); eapleap_free(&packet); return NULL; } memcpy(packet->challenge, data->challenge, packet->count); /* * The User-Name comes after the challenge. * * Length of the EAP-LEAP portion of the packet, minus * 3 octets for data, minus the challenge size, is the * length of the user name. */ name_len = packet->length - 3 - packet->count; if (name_len > 0) { packet->name = malloc(name_len + 1); if (!packet->name) { radlog(L_ERR, "rlm_eap_leap: out of memory"); eapleap_free(&packet); return NULL; } memcpy(packet->name, &data->challenge[packet->count], name_len); packet->name[name_len] = '\0'; packet->name_len = name_len; } return packet; } /* * Get the NT-Password hash. */ static int eapleap_ntpwdhash(unsigned char *ntpwdhash, VALUE_PAIR *password) { if ((password->attribute == PW_USER_PASSWORD) || (password->attribute == PW_CLEARTEXT_PASSWORD)) { size_t i; unsigned char unicode[512]; /* * Convert the password to NT's weird Unicode format. */ memset(unicode, 0, sizeof(unicode)); for (i = 0; i < password->length; i++) { /* * Yes, the *even* bytes have the values, * and the *odd* bytes are zero. */ unicode[(i << 1)] = password->vp_strvalue[i]; } /* * Get the NT Password hash. */ fr_md4_calc(ntpwdhash, unicode, password->length * 2); } else { /* MUST be NT-Password */ if (password->length == 32) { password->length = fr_hex2bin(password->vp_strvalue, password->vp_octets, 16); } if (password->length != 16) { radlog(L_ERR, "rlm_eap_leap: Bad NT-Password"); return 0; } memcpy(ntpwdhash, password->vp_strvalue, 16); } return 1; } /* * Verify the MS-CHAP response from the user. */ int eapleap_stage4(LEAP_PACKET *packet, VALUE_PAIR* password, leap_session_t *session) { unsigned char ntpwdhash[16]; unsigned char response[24]; /* * No password or previous packet. Die. */ if ((password == NULL) || (session == NULL)) { return 0; } if (!eapleap_ntpwdhash(ntpwdhash, password)) { return 0; } /* * Calculate and verify the CHAP challenge. */ eapleap_mschap(ntpwdhash, session->peer_challenge, response); if (memcmp(response, packet->challenge, 24) == 0) { DEBUG2(" rlm_eap_leap: NtChallengeResponse from AP is valid"); memcpy(session->peer_response, response, sizeof(response)); return 1; } DEBUG2(" rlm_eap_leap: FAILED incorrect NtChallengeResponse from AP"); return 0; } /* * Verify ourselves to the AP */ LEAP_PACKET *eapleap_stage6(LEAP_PACKET *packet, REQUEST *request, VALUE_PAIR *user_name, VALUE_PAIR* password, leap_session_t *session, VALUE_PAIR **reply_vps) { size_t i; unsigned char ntpwdhash[16], ntpwdhashhash[16]; unsigned char buffer[256]; LEAP_PACKET *reply; unsigned char *p; VALUE_PAIR *vp; /* * No password or previous packet. Die. */ if ((password == NULL) || (session == NULL)) { return NULL; } reply = eapleap_alloc(); if (!reply) return NULL; reply->code = PW_EAP_RESPONSE; reply->length = LEAP_HEADER_LEN + 24 + user_name->length; reply->count = 24; reply->challenge = malloc(reply->count); if (reply->challenge == NULL) { radlog(L_ERR, "rlm_eap_leap: out of memory"); eapleap_free(&reply); return NULL; } /* * The LEAP packet also contains the user name. */ reply->name = malloc(user_name->length + 1); if (reply->name == NULL) { radlog(L_ERR, "rlm_eap_leap: out of memory"); eapleap_free(&reply); return NULL; } /* * Copy the name over, and ensure it's NUL terminated. */ memcpy(reply->name, user_name->vp_strvalue, user_name->length); reply->name[user_name->length] = '\0'; reply->name_len = user_name->length; /* * MPPE hash = ntpwdhash(ntpwdhash(unicode(pw))) */ if (!eapleap_ntpwdhash(ntpwdhash, password)) { eapleap_free(&reply); return NULL; } fr_md4_calc(ntpwdhashhash, ntpwdhash, 16); /* * Calculate our response, to authenticate ourselves * to the AP. */ eapleap_mschap(ntpwdhashhash, packet->challenge, reply->challenge); /* * Calculate the leap:session-key attribute */ vp = pairmake("Cisco-AVPair", "leap:session-key=", T_OP_ADD); if (!vp) { radlog(L_ERR, "rlm_eap_leap: Failed to create Cisco-AVPair attribute. LEAP cancelled."); eapleap_free(&reply); return NULL; } /* * And calculate the MPPE session key. */ p = buffer; memcpy(p, ntpwdhashhash, 16); /* MPPEHASH */ p += 16; memcpy(p, packet->challenge, 8); /* APC */ p += 8; memcpy(p, reply->challenge, 24); /* APR */ p += 24; memcpy(p, session->peer_challenge, 8); /* PC */ p += 8; memcpy(p, session->peer_response, 24); /* PR */ p += 24; /* * These 16 bytes are the session key to use. */ fr_md5_calc(ntpwdhash, buffer, 16 + 8 + 24 + 8 + 24); memcpy(vp->vp_strvalue + vp->length, ntpwdhash, 16); memset(vp->vp_strvalue + vp->length + 16, 0, sizeof(vp->vp_strvalue) - (vp->length + 16)); i = 16; rad_tunnel_pwencode(vp->vp_strvalue + vp->length, &i, request->client->secret, request->packet->vector); vp->length += i; pairadd(reply_vps, vp); return reply; } /* * If an EAP LEAP request needs to be initiated then * create such a packet. */ LEAP_PACKET *eapleap_initiate(UNUSED EAP_DS *eap_ds, VALUE_PAIR *user_name) { int i; LEAP_PACKET *reply; reply = eapleap_alloc(); if (reply == NULL) { radlog(L_ERR, "rlm_eap_leap: out of memory"); return NULL; } reply->code = PW_EAP_REQUEST; reply->length = LEAP_HEADER_LEN + 8 + user_name->length; reply->count = 8; /* random challenge */ reply->challenge = malloc(reply->count); if (reply->challenge == NULL) { radlog(L_ERR, "rlm_eap_leap: out of memory"); eapleap_free(&reply); return NULL; } /* * Fill the challenge with random bytes. */ for (i = 0; i < reply->count; i++) { reply->challenge[i] = fr_rand(); } DEBUG2(" rlm_eap_leap: Issuing AP Challenge"); /* * The LEAP packet also contains the user name. */ reply->name = malloc(user_name->length + 1); if (reply->name == NULL) { radlog(L_ERR, "rlm_eap_leap: out of memory"); eapleap_free(&reply); return NULL; } /* * Copy the name over, and ensure it's NUL terminated. */ memcpy(reply->name, user_name->vp_strvalue, user_name->length); reply->name[user_name->length] = '\0'; reply->name_len = user_name->length; return reply; } /* * compose the LEAP reply packet in the EAP reply typedata */ int eapleap_compose(EAP_DS *eap_ds, LEAP_PACKET *reply) { leap_packet_t *data; /* * We need the name and the challenge. */ switch (reply->code) { case PW_EAP_REQUEST: case PW_EAP_RESPONSE: eap_ds->request->type.type = PW_EAP_LEAP; eap_ds->request->type.length = reply->length; eap_ds->request->type.data = malloc(reply->length); if (eap_ds->request->type.data == NULL) { radlog(L_ERR, "rlm_eap_leap: out of memory"); return 0; } data = (leap_packet_t *) eap_ds->request->type.data; data->version = 0x01; data->unused = 0; data->count = reply->count; /* * N bytes of the challenge, followed by the user name. */ memcpy(&data->challenge[0], reply->challenge, reply->count); memcpy(&data->challenge[reply->count], reply->name, reply->name_len); break; /* * EAP-Success packets don't contain any data * other than the header. */ case PW_EAP_SUCCESS: eap_ds->request->type.length = 0; break; default: radlog(L_ERR, "rlm_eap_leap: Internal sanity check failed"); return 0; break; } /* * Set the EAP code. */ eap_ds->request->code = reply->code; return 1; } freeradius-server/src/modules/rlm_eap/types/rlm_eap_leap/eap_leap.h000066400000000000000000000037041257552170400261100ustar00rootroot00000000000000#ifndef _EAP_LEAP_H #define _EAP_LEAP_H #include RCSIDH(eap_leap_h, "$Id$") #include "eap.h" #define PW_LEAP_CHALLENGE 1 #define PW_LEAP_RESPONSE 2 #define PW_LEAP_SUCCESS 3 #define PW_LEAP_FAILURE 4 #define PW_LEAP_MAX_CODES 4 /* * Version + unused + count */ #define LEAP_HEADER_LEN 3 /* **** * EAP - LEAP doesnot specify code, id & length but chap specifies them, * for generalization purpose, complete header should be sent * and not just value_size, value and name. * future implementation. */ /* eap packet structure */ typedef struct leap_packet_t { /* * EAP header, followed by type comes before this. */ uint8_t version; uint8_t unused; uint8_t count; uint8_t challenge[1]; /* 8 or 24, followed by user name */ } leap_packet_t; /* * Which is decoded into this. */ typedef struct leap_packet { unsigned char code; unsigned char id; int length; int count; unsigned char *challenge; int name_len; char *name; } LEAP_PACKET; /* * The information which must be kept around * during the LEAP session. */ typedef struct leap_session_t { int stage; uint8_t peer_challenge[8]; uint8_t peer_response[24]; } leap_session_t; /* function declarations here */ LEAP_PACKET *eapleap_alloc(void); void eapleap_free(LEAP_PACKET **leap_packet_ptr); int eapleap_compose(EAP_DS *auth, LEAP_PACKET *reply); LEAP_PACKET *eapleap_extract(EAP_DS *auth); LEAP_PACKET *eapleap_initiate(EAP_DS *eap_ds, VALUE_PAIR *user_name); int eapleap_stage4(LEAP_PACKET *packet, VALUE_PAIR* password, leap_session_t *session); LEAP_PACKET *eapleap_stage6(LEAP_PACKET *packet, REQUEST *request, VALUE_PAIR *user_name, VALUE_PAIR* password, leap_session_t *session, VALUE_PAIR **reply_vps); void eapleap_lmpwdhash(const unsigned char *password,unsigned char *lmhash); void eapleap_mschap(const unsigned char *win_password, const unsigned char *challenge, unsigned char *response); #endif /*_EAP_LEAP_H*/ freeradius-server/src/modules/rlm_eap/types/rlm_eap_leap/rlm_eap_leap.c000066400000000000000000000124561257552170400267610ustar00rootroot00000000000000/* * rlm_eap_leap.c Handles that are called from eap * * Version: $Id$ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2003 Alan DeKok * Copyright 2006 The FreeRADIUS server project */ #include RCSID("$Id$") #include #include #include #include "eap_leap.h" /* * send an initial eap-leap request * ie access challenge to the user/peer. * Frame eap reply packet. * len = header + type + leap_typedata * leap_typedata = value_size + value */ static int leap_initiate(UNUSED void *instance, EAP_HANDLER *handler) { leap_session_t *session; LEAP_PACKET *reply; DEBUG2(" rlm_eap_leap: Stage 2"); /* * LEAP requires a User-Name attribute */ if (!handler->request->username) { DEBUG2(" rlm_eap_leap: User-Name is required for EAP-LEAP authentication."); return 0; } reply = eapleap_initiate(handler->eap_ds, handler->request->username); if (reply == NULL) return 0; eapleap_compose(handler->eap_ds, reply); handler->opaque = malloc(sizeof(leap_session_t)); if (!handler->opaque) { radlog(L_ERR, "rlm_eap_leap: Out of memory"); eapleap_free(&reply); return 0; } /* * Remember which stage we're in, and which challenge * we sent to the AP. The later stages will take care * of filling in the peer response. */ session = (leap_session_t *) handler->opaque; handler->free_opaque = free; /* just malloc'd memory */ session->stage = 4; /* the next stage we're in */ memcpy(session->peer_challenge, reply->challenge, reply->count); DEBUG2(" rlm_eap_leap: Successfully initiated"); /* * The next stage to process the packet. */ handler->stage = AUTHENTICATE; eapleap_free(&reply); return 1; } static int leap_authenticate(UNUSED void *instance, EAP_HANDLER *handler) { int rcode; leap_session_t *session; LEAP_PACKET *packet; LEAP_PACKET *reply; char* username; VALUE_PAIR *password; if (!handler->opaque) { radlog(L_ERR, "rlm_eap_leap: Cannot authenticate without LEAP history"); return 0; } session = (leap_session_t *) handler->opaque; reply = NULL; /* * Extract the LEAP packet. */ if (!(packet = eapleap_extract(handler->eap_ds))) return 0; username = (char *)handler->request->username->vp_strvalue; /* * The password is never sent over the wire. * Always get the configured password, for each user. */ password = pairfind(handler->request->config_items, PW_CLEARTEXT_PASSWORD); if (!password) password = pairfind(handler->request->config_items, PW_NT_PASSWORD); if (!password) { DEBUG2("rlm_eap_leap: No Cleartext-Password or NT-Password configured for this user"); eapleap_free(&packet); return 0; } /* * We've already sent the AP challenge. This packet * should contain the NtChallengeResponse */ switch (session->stage) { case 4: /* Verify NtChallengeResponse */ DEBUG2(" rlm_eap_leap: Stage 4"); rcode = eapleap_stage4(packet, password, session); session->stage = 6; /* * We send EAP-Success or EAP-Fail, and not * any LEAP packet. So we return here. */ if (!rcode) { handler->eap_ds->request->code = PW_EAP_FAILURE; eapleap_free(&packet); return 0; } handler->eap_ds->request->code = PW_EAP_SUCCESS; /* * Do this only for Success. */ handler->eap_ds->request->id = handler->eap_ds->response->id + 1; handler->eap_ds->set_request_id = 1; /* * LEAP requires a challenge in stage 4, not * an Access-Accept, which is normally returned * by eap_compose() in eap.c, when the EAP reply code * is EAP_SUCCESS. */ handler->request->reply->code = PW_ACCESS_CHALLENGE; eapleap_free(&packet); return 1; break; case 6: /* Issue session key */ DEBUG2(" rlm_eap_leap: Stage 6"); reply = eapleap_stage6(packet, handler->request, handler->request->username, password, session, &handler->request->reply->vps); break; /* * Stages 1, 3, and 5 are requests from the AP. * Stage 2 is handled by initiate() */ default: radlog(L_ERR, " rlm_eap_leap: Internal sanity check failed on stage"); break; } eapleap_free(&packet); /* * Process the packet. We don't care about any previous * EAP packets, as */ if (!reply) { return 0; } eapleap_compose(handler->eap_ds, reply); eapleap_free(&reply); return 1; } /* * The module name should be the only globally exported symbol. * That is, everything else should be 'static'. */ EAP_TYPE rlm_eap_leap = { "eap_leap", NULL, /* attach */ leap_initiate, /* Start the initial request, after Identity */ NULL, /* authorization */ leap_authenticate, /* authentication */ NULL, /* detach */ }; freeradius-server/src/modules/rlm_eap/types/rlm_eap_leap/smbdes.c000066400000000000000000000235341257552170400256150ustar00rootroot00000000000000/* Unix SMB/CIFS implementation. a partial implementation of DES designed for use in the SMB authentication protocol Copyright (C) Andrew Tridgell 1998 Copyright 2006 The FreeRADIUS server project This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* NOTES: This code makes no attempt to be fast! In fact, it is a very slow implementation This code is NOT a complete DES implementation. It implements only the minimum necessary for SMB authentication, as used by all SMB products (including every copy of Microsoft Windows95 ever sold) In particular, it can only do a unchained forward DES pass. This means it is not possible to use this code for encryption/decryption of data, instead it is only useful as a "hash" algorithm. There is no entry point into this code that allows normal DES operation. I believe this means that this code does not come under ITAR regulations but this is NOT a legal opinion. If you are concerned about the applicability of ITAR regulations to this code then you should confirm it for yourself (and maybe let me know if you come up with a different answer to the one above) */ #include RCSID("$Id$") #include #include #include "eap_leap.h" #define uchar unsigned char static const uchar perm1[56] = {57, 49, 41, 33, 25, 17, 9, 1, 58, 50, 42, 34, 26, 18, 10, 2, 59, 51, 43, 35, 27, 19, 11, 3, 60, 52, 44, 36, 63, 55, 47, 39, 31, 23, 15, 7, 62, 54, 46, 38, 30, 22, 14, 6, 61, 53, 45, 37, 29, 21, 13, 5, 28, 20, 12, 4}; static const uchar perm2[48] = {14, 17, 11, 24, 1, 5, 3, 28, 15, 6, 21, 10, 23, 19, 12, 4, 26, 8, 16, 7, 27, 20, 13, 2, 41, 52, 31, 37, 47, 55, 30, 40, 51, 45, 33, 48, 44, 49, 39, 56, 34, 53, 46, 42, 50, 36, 29, 32}; static const uchar perm3[64] = {58, 50, 42, 34, 26, 18, 10, 2, 60, 52, 44, 36, 28, 20, 12, 4, 62, 54, 46, 38, 30, 22, 14, 6, 64, 56, 48, 40, 32, 24, 16, 8, 57, 49, 41, 33, 25, 17, 9, 1, 59, 51, 43, 35, 27, 19, 11, 3, 61, 53, 45, 37, 29, 21, 13, 5, 63, 55, 47, 39, 31, 23, 15, 7}; static const uchar perm4[48] = { 32, 1, 2, 3, 4, 5, 4, 5, 6, 7, 8, 9, 8, 9, 10, 11, 12, 13, 12, 13, 14, 15, 16, 17, 16, 17, 18, 19, 20, 21, 20, 21, 22, 23, 24, 25, 24, 25, 26, 27, 28, 29, 28, 29, 30, 31, 32, 1}; static const uchar perm5[32] = { 16, 7, 20, 21, 29, 12, 28, 17, 1, 15, 23, 26, 5, 18, 31, 10, 2, 8, 24, 14, 32, 27, 3, 9, 19, 13, 30, 6, 22, 11, 4, 25}; static const uchar perm6[64] ={ 40, 8, 48, 16, 56, 24, 64, 32, 39, 7, 47, 15, 55, 23, 63, 31, 38, 6, 46, 14, 54, 22, 62, 30, 37, 5, 45, 13, 53, 21, 61, 29, 36, 4, 44, 12, 52, 20, 60, 28, 35, 3, 43, 11, 51, 19, 59, 27, 34, 2, 42, 10, 50, 18, 58, 26, 33, 1, 41, 9, 49, 17, 57, 25}; static const uchar sc[16] = {1, 1, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 1}; static const uchar sbox[8][4][16] = { {{14, 4, 13, 1, 2, 15, 11, 8, 3, 10, 6, 12, 5, 9, 0, 7}, {0, 15, 7, 4, 14, 2, 13, 1, 10, 6, 12, 11, 9, 5, 3, 8}, {4, 1, 14, 8, 13, 6, 2, 11, 15, 12, 9, 7, 3, 10, 5, 0}, {15, 12, 8, 2, 4, 9, 1, 7, 5, 11, 3, 14, 10, 0, 6, 13}}, {{15, 1, 8, 14, 6, 11, 3, 4, 9, 7, 2, 13, 12, 0, 5, 10}, {3, 13, 4, 7, 15, 2, 8, 14, 12, 0, 1, 10, 6, 9, 11, 5}, {0, 14, 7, 11, 10, 4, 13, 1, 5, 8, 12, 6, 9, 3, 2, 15}, {13, 8, 10, 1, 3, 15, 4, 2, 11, 6, 7, 12, 0, 5, 14, 9}}, {{10, 0, 9, 14, 6, 3, 15, 5, 1, 13, 12, 7, 11, 4, 2, 8}, {13, 7, 0, 9, 3, 4, 6, 10, 2, 8, 5, 14, 12, 11, 15, 1}, {13, 6, 4, 9, 8, 15, 3, 0, 11, 1, 2, 12, 5, 10, 14, 7}, {1, 10, 13, 0, 6, 9, 8, 7, 4, 15, 14, 3, 11, 5, 2, 12}}, {{7, 13, 14, 3, 0, 6, 9, 10, 1, 2, 8, 5, 11, 12, 4, 15}, {13, 8, 11, 5, 6, 15, 0, 3, 4, 7, 2, 12, 1, 10, 14, 9}, {10, 6, 9, 0, 12, 11, 7, 13, 15, 1, 3, 14, 5, 2, 8, 4}, {3, 15, 0, 6, 10, 1, 13, 8, 9, 4, 5, 11, 12, 7, 2, 14}}, {{2, 12, 4, 1, 7, 10, 11, 6, 8, 5, 3, 15, 13, 0, 14, 9}, {14, 11, 2, 12, 4, 7, 13, 1, 5, 0, 15, 10, 3, 9, 8, 6}, {4, 2, 1, 11, 10, 13, 7, 8, 15, 9, 12, 5, 6, 3, 0, 14}, {11, 8, 12, 7, 1, 14, 2, 13, 6, 15, 0, 9, 10, 4, 5, 3}}, {{12, 1, 10, 15, 9, 2, 6, 8, 0, 13, 3, 4, 14, 7, 5, 11}, {10, 15, 4, 2, 7, 12, 9, 5, 6, 1, 13, 14, 0, 11, 3, 8}, {9, 14, 15, 5, 2, 8, 12, 3, 7, 0, 4, 10, 1, 13, 11, 6}, {4, 3, 2, 12, 9, 5, 15, 10, 11, 14, 1, 7, 6, 0, 8, 13}}, {{4, 11, 2, 14, 15, 0, 8, 13, 3, 12, 9, 7, 5, 10, 6, 1}, {13, 0, 11, 7, 4, 9, 1, 10, 14, 3, 5, 12, 2, 15, 8, 6}, {1, 4, 11, 13, 12, 3, 7, 14, 10, 15, 6, 8, 0, 5, 9, 2}, {6, 11, 13, 8, 1, 4, 10, 7, 9, 5, 0, 15, 14, 2, 3, 12}}, {{13, 2, 8, 4, 6, 15, 11, 1, 10, 9, 3, 14, 5, 0, 12, 7}, {1, 15, 13, 8, 10, 3, 7, 4, 12, 5, 6, 11, 0, 14, 9, 2}, {7, 11, 4, 1, 9, 12, 14, 2, 0, 6, 10, 13, 15, 3, 5, 8}, {2, 1, 14, 7, 4, 10, 8, 13, 15, 12, 9, 0, 3, 5, 6, 11}}}; static void permute(char *out, const char *in, const uchar *p, int n) { int i; for (i=0;i>1; key[1] = ((str[0]&0x01)<<6) | (str[1]>>2); key[2] = ((str[1]&0x03)<<5) | (str[2]>>3); key[3] = ((str[2]&0x07)<<4) | (str[3]>>4); key[4] = ((str[3]&0x0F)<<3) | (str[4]>>5); key[5] = ((str[4]&0x1F)<<2) | (str[5]>>6); key[6] = ((str[5]&0x3F)<<1) | (str[6]>>7); key[7] = str[6]&0x7F; for (i=0;i<8;i++) { key[i] = (key[i]<<1); } } static void smbhash(unsigned char *out, const unsigned char *in, unsigned char *key) { int i; char outb[64]; char inb[64]; char keyb[64]; unsigned char key2[8]; str_to_key(key, key2); for (i=0;i<64;i++) { inb[i] = (in[i/8] & (1<<(7-(i%8)))) ? 1 : 0; keyb[i] = (key2[i/8] & (1<<(7-(i%8)))) ? 1 : 0; outb[i] = 0; } dohash(outb, inb, keyb); for (i=0;i<8;i++) { out[i] = 0; } for (i=0;i<64;i++) { if (outb[i]) out[i/8] |= (1<<(7-(i%8))); } } /* * Converts the password to uppercase, and creates the LM * password hash. */ void eapleap_lmpwdhash(const unsigned char *password,unsigned char *lmhash) { int i; unsigned char p14[14]; static unsigned char sp8[8] = {0x4b, 0x47, 0x53, 0x21, 0x40, 0x23, 0x24, 0x25}; memset(p14, 0, sizeof(p14)); for (i = 0; i < 14 && password[i]; i++) { p14[i] = toupper((int) password[i]); } smbhash(lmhash, sp8, p14); smbhash(lmhash+8, sp8, p14+7); } /* * Take the NT or LM password, and return the MSCHAP response * * The win_password MUST be exactly 16 bytes long. */ void eapleap_mschap(const unsigned char *win_password, const unsigned char *challenge, unsigned char *response) { unsigned char p21[21]; memset(p21, 0, sizeof(p21)); memcpy(p21, win_password, 16); smbhash(response, challenge, p21); smbhash(response+8, challenge, p21+7); smbhash(response+16, challenge, p21+14); } freeradius-server/src/modules/rlm_eap/types/rlm_eap_md5/000077500000000000000000000000001257552170400237315ustar00rootroot00000000000000freeradius-server/src/modules/rlm_eap/types/rlm_eap_md5/Makefile000066400000000000000000000003641257552170400253740ustar00rootroot00000000000000# # Makefile # # Version: $Id$ # TARGET = rlm_eap_md5 SRCS = rlm_eap_md5.c eap_md5.c HEADERS = eap_md5.h RLM_CFLAGS = -I../.. -I../../libeap RLM_INSTALL = RLM_DIR=../../ include ${RLM_DIR}../rules.mak $(LT_OBJS): $(HEADERS) freeradius-server/src/modules/rlm_eap/types/rlm_eap_md5/eap_md5.c000066400000000000000000000145221257552170400254130ustar00rootroot00000000000000/* * eap_md5.c EAP MD5 functionality. * * Version: $Id$ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2000,2001,2006 The FreeRADIUS server project * Copyright 2001 hereUare Communications, Inc. */ /* * * MD5 Packet Format in EAP Type-Data * --- ------ ------ -- --- --------- * 0 1 2 3 * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | Value-Size | Value ... * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | Name ... * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * */ #include RCSID("$Id$") #include #include #include "eap.h" #include "eap_md5.h" /* * Allocate a new MD5_PACKET */ MD5_PACKET *eapmd5_alloc(void) { MD5_PACKET *rp; if ((rp = malloc(sizeof(MD5_PACKET))) == NULL) { radlog(L_ERR, "rlm_eap_md5: out of memory"); return NULL; } memset(rp, 0, sizeof(MD5_PACKET)); return rp; } /* * Free MD5_PACKET */ void eapmd5_free(MD5_PACKET **md5_packet_ptr) { MD5_PACKET *md5_packet; if (!md5_packet_ptr) return; md5_packet = *md5_packet_ptr; if (md5_packet == NULL) return; if (md5_packet->value) free(md5_packet->value); if (md5_packet->name) free(md5_packet->name); free(md5_packet); *md5_packet_ptr = NULL; } /* * We expect only RESPONSE for which SUCCESS or FAILURE is sent back */ MD5_PACKET *eapmd5_extract(EAP_DS *eap_ds) { md5_packet_t *data; MD5_PACKET *packet; unsigned short name_len; /* * We need a response, of type EAP-MD5, with at least * one byte of type data (EAP-MD5) following the 4-byte * EAP-Packet header. */ if (!eap_ds || !eap_ds->response || (eap_ds->response->code != PW_MD5_RESPONSE) || eap_ds->response->type.type != PW_EAP_MD5 || !eap_ds->response->type.data || (eap_ds->response->length <= MD5_HEADER_LEN) || (eap_ds->response->type.data[0] <= 0)) { radlog(L_ERR, "rlm_eap_md5: corrupted data"); return NULL; } packet = eapmd5_alloc(); if (!packet) return NULL; /* * Code & id for MD5 & EAP are same * * but md5_length = length of the EAP-MD5 data, which * doesn't include the EAP header, or the octet saying * EAP-MD5. */ packet->code = eap_ds->response->code; packet->id = eap_ds->response->id; packet->length = eap_ds->response->length - (MD5_HEADER_LEN + 1); /* * Sanity check the EAP-MD5 packet sent to us * by the client. */ data = (md5_packet_t *)eap_ds->response->type.data; /* * Already checked the size above. */ packet->value_size = data->value_size; /* * Allocate room for the data, and copy over the data. */ packet->value = malloc(packet->value_size); if (packet->value == NULL) { radlog(L_ERR, "rlm_eap_md5: out of memory"); eapmd5_free(&packet); return NULL; } memcpy(packet->value, data->value_name, packet->value_size); /* * Name is optional and is present after Value, but we * need to check for it, as eapmd5_compose() */ name_len = packet->length - (packet->value_size + 1); if (name_len) { packet->name = malloc(name_len + 1); if (!packet->name) { radlog(L_ERR, "rlm_eap_md5: out of memory"); eapmd5_free(&packet); return NULL; } memcpy(packet->name, data->value_name + packet->value_size, name_len); packet->name[name_len] = 0; } return packet; } /* * verify = MD5(id+password+challenge_sent) */ int eapmd5_verify(MD5_PACKET *packet, VALUE_PAIR* password, uint8_t *challenge) { char *ptr; char string[1 + MAX_STRING_LEN*2]; unsigned char output[MAX_STRING_LEN]; unsigned short len; /* * Sanity check it. */ if (packet->value_size != 16) { radlog(L_ERR, "rlm_eap_md5: Expected 16 bytes of response to challenge, got %d", packet->value_size); return 0; } len = 0; ptr = string; /* * This is really rad_chap_pwencode()... */ *ptr++ = packet->id; len++; memcpy(ptr, password->vp_strvalue, password->length); ptr += password->length; len += password->length; /* * The challenge size is hard-coded. */ memcpy(ptr, challenge, MD5_CHALLENGE_LEN); len += MD5_CHALLENGE_LEN; fr_md5_calc((u_char *)output, (u_char *)string, len); /* * The length of the response is always 16 for MD5. */ if (memcmp(output, packet->value, 16) != 0) { return 0; } return 1; } /* * Compose the portions of the reply packet specific to the * EAP-MD5 protocol, in the EAP reply typedata */ int eapmd5_compose(EAP_DS *eap_ds, MD5_PACKET *reply) { uint8_t *ptr; unsigned short name_len; /* * We really only send Challenge (EAP-Identity), * and EAP-Success, and EAP-Failure. */ if (reply->code < 3) { eap_ds->request->type.type = PW_EAP_MD5; rad_assert(reply->length > 0); eap_ds->request->type.data = malloc(reply->length); if (eap_ds->request->type.data == NULL) { eapmd5_free(&reply); radlog(L_ERR, "rlm_eap_md5: out of memory"); return 0; } ptr = eap_ds->request->type.data; *ptr++ = (uint8_t)(reply->value_size & 0xFF); memcpy(ptr, reply->value, reply->value_size); /* Just the Challenge length */ eap_ds->request->type.length = reply->value_size + 1; /* * Return the name, if necessary. * * Don't see why this is *ever* necessary... */ name_len = reply->length - (reply->value_size + 1); if (name_len && reply->name) { ptr += reply->value_size; memcpy(ptr, reply->name, name_len); /* Challenge length + Name length */ eap_ds->request->type.length += name_len; } } else { eap_ds->request->type.length = 0; /* TODO: In future we might add message here wrt rfc1994 */ } eap_ds->request->code = reply->code; eapmd5_free(&reply); return 1; } freeradius-server/src/modules/rlm_eap/types/rlm_eap_md5/eap_md5.h000066400000000000000000000022711257552170400254160ustar00rootroot00000000000000#ifndef _EAP_MD5_H #define _EAP_MD5_H #include RCSIDH(eap_md5_h, "$Id$") #include "eap.h" #define PW_MD5_CHALLENGE 1 #define PW_MD5_RESPONSE 2 #define PW_MD5_SUCCESS 3 #define PW_MD5_FAILURE 4 #define PW_MD5_MAX_CODES 4 #define MD5_HEADER_LEN 4 #define MD5_CHALLENGE_LEN 16 /* **** * EAP - MD5 doesnot specify code, id & length but chap specifies them, * for generalization purpose, complete header should be sent * and not just value_size, value and name. * future implementation. * * Huh? What does that mean? */ /* eap packet structure */ typedef struct md5_packet_t { /* uint8_t code; uint8_t id; uint16_t length; */ uint8_t value_size; uint8_t value_name[1]; } md5_packet_t; typedef struct md5_packet { unsigned char code; unsigned char id; unsigned short length; unsigned char value_size; unsigned char *value; char *name; } MD5_PACKET; /* function declarations here */ MD5_PACKET *eapmd5_alloc(void); void eapmd5_free(MD5_PACKET **md5_packet_ptr); int eapmd5_compose(EAP_DS *auth, MD5_PACKET *reply); MD5_PACKET *eapmd5_extract(EAP_DS *auth); int eapmd5_verify(MD5_PACKET *pkt, VALUE_PAIR* pwd, uint8_t *ch); #endif /*_EAP_MD5_H*/ freeradius-server/src/modules/rlm_eap/types/rlm_eap_md5/rlm_eap_md5.c000066400000000000000000000101161257552170400262600ustar00rootroot00000000000000/* * rlm_eap_md5.c Handles that are called from eap * * Version: $Id$ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2000,2001,2006 The FreeRADIUS server project * Copyright 2001 hereUare Communications, Inc. */ #include RCSID("$Id$") #include #include #include #include "eap_md5.h" #include /* * Initiate the EAP-MD5 session by sending a challenge to the peer. */ static int md5_initiate(void *type_data, EAP_HANDLER *handler) { int i; MD5_PACKET *reply; type_data = type_data; /* -Wunused */ /* * Allocate an EAP-MD5 packet. */ reply = eapmd5_alloc(); if (reply == NULL) { radlog(L_ERR, "rlm_eap_md5: out of memory"); return 0; } /* * Fill it with data. */ reply->code = PW_MD5_CHALLENGE; reply->length = 1 + MD5_CHALLENGE_LEN; /* one byte of value size */ reply->value_size = MD5_CHALLENGE_LEN; /* * Allocate user data. */ reply->value = malloc(reply->value_size); if (reply->value == NULL) { radlog(L_ERR, "rlm_eap_md5: out of memory"); eapmd5_free(&reply); return 0; } /* * Get a random challenge. */ for (i = 0; i < reply->value_size; i++) { reply->value[i] = fr_rand(); } DEBUG2("rlm_eap_md5: Issuing Challenge"); /* * Keep track of the challenge. */ handler->opaque = malloc(reply->value_size); rad_assert(handler->opaque != NULL); memcpy(handler->opaque, reply->value, reply->value_size); handler->free_opaque = free; /* * Compose the EAP-MD5 packet out of the data structure, * and free it. */ eapmd5_compose(handler->eap_ds, reply); /* * We don't need to authorize the user at this point. * * We also don't need to keep the challenge, as it's * stored in 'handler->eap_ds', which will be given back * to us... */ handler->stage = AUTHENTICATE; return 1; } /* * Authenticate a previously sent challenge. */ static int md5_authenticate(UNUSED void *arg, EAP_HANDLER *handler) { MD5_PACKET *packet; MD5_PACKET *reply; VALUE_PAIR *password; /* * Get the Cleartext-Password for this user. */ rad_assert(handler->request != NULL); rad_assert(handler->stage == AUTHENTICATE); password = pairfind(handler->request->config_items, PW_CLEARTEXT_PASSWORD); if (password == NULL) { DEBUG2("rlm_eap_md5: Cleartext-Password is required for EAP-MD5 authentication"); return 0; } /* * Extract the EAP-MD5 packet. */ if (!(packet = eapmd5_extract(handler->eap_ds))) return 0; /* * Create a reply, and initialize it. */ reply = eapmd5_alloc(); if (!reply) { eapmd5_free(&packet); return 0; } reply->id = handler->eap_ds->request->id; reply->length = 0; /* * Verify the received packet against the previous packet * (i.e. challenge) which we sent out. */ if (eapmd5_verify(packet, password, handler->opaque)) { reply->code = PW_MD5_SUCCESS; } else { reply->code = PW_MD5_FAILURE; } /* * Compose the EAP-MD5 packet out of the data structure, * and free it. */ eapmd5_compose(handler->eap_ds, reply); eapmd5_free(&packet); return 1; } /* * The module name should be the only globally exported symbol. * That is, everything else should be 'static'. */ EAP_TYPE rlm_eap_md5 = { "eap_md5", NULL, /* attach */ md5_initiate, /* Start the initial request */ NULL, /* authorization */ md5_authenticate, /* authentication */ NULL /* detach */ }; freeradius-server/src/modules/rlm_eap/types/rlm_eap_mschapv2/000077500000000000000000000000001257552170400247675ustar00rootroot00000000000000freeradius-server/src/modules/rlm_eap/types/rlm_eap_mschapv2/Makefile000066400000000000000000000003711257552170400264300ustar00rootroot00000000000000# # Makefile # # Version: $Id$ # TARGET = rlm_eap_mschapv2 SRCS = rlm_eap_mschapv2.c HEADERS = eap_mschapv2.h RLM_CFLAGS = -I../.. -I../../libeap RLM_INSTALL = RLM_DIR=../../ include ${RLM_DIR}../rules.mak $(LT_OBJS): $(HEADERS) freeradius-server/src/modules/rlm_eap/types/rlm_eap_mschapv2/eap_mschapv2.h000066400000000000000000000020301257552170400275030ustar00rootroot00000000000000#ifndef _EAP_MSCHAPV2_H #define _EAP_MSCHAPV2_H #include RCSIDH(eap_mschapv2_h, "$Id$") #include "eap.h" /* * draft-kamath-pppext-eap-mschapv2-00.txt says: * * Supplicant FreeRADIUS * <-- challenge * response --> * <-- success * success --> * * But what we often see is: * * Supplicant FreeRADIUS * <-- challenge * response --> * <-- success * ack --> */ #define PW_EAP_MSCHAPV2_ACK 0 #define PW_EAP_MSCHAPV2_CHALLENGE 1 #define PW_EAP_MSCHAPV2_RESPONSE 2 #define PW_EAP_MSCHAPV2_SUCCESS 3 #define PW_EAP_MSCHAPV2_FAILURE 4 #define PW_EAP_MSCHAPV2_MAX_CODES 4 #define MSCHAPV2_HEADER_LEN 5 #define MSCHAPV2_CHALLENGE_LEN 16 #define MSCHAPV2_RESPONSE_LEN 50 typedef struct mschapv2_header_t { uint8_t opcode; uint8_t mschapv2_id; uint8_t ms_length[2]; uint8_t value_size; } mschapv2_header_t; typedef struct mschapv2_opaque_t { int code; uint8_t challenge[MSCHAPV2_CHALLENGE_LEN]; VALUE_PAIR *mppe_keys; VALUE_PAIR *reply; } mschapv2_opaque_t; #endif /*_EAP_MSCHAPV2_H*/ freeradius-server/src/modules/rlm_eap/types/rlm_eap_mschapv2/rlm_eap_mschapv2.c000066400000000000000000000462341257552170400303660ustar00rootroot00000000000000/* * rlm_eap_mschapv2.c Handles that are called from eap * * Version: $Id$ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2003,2006 The FreeRADIUS server project */ #include RCSID("$Id$") #include #include #include #include "eap_mschapv2.h" #include typedef struct rlm_eap_mschapv2_t { int with_ntdomain_hack; int send_error; } rlm_eap_mschapv2_t; static CONF_PARSER module_config[] = { { "with_ntdomain_hack", PW_TYPE_BOOLEAN, offsetof(rlm_eap_mschapv2_t,with_ntdomain_hack), NULL, "no" }, { "send_error", PW_TYPE_BOOLEAN, offsetof(rlm_eap_mschapv2_t,send_error), NULL, "no" }, { NULL, -1, 0, NULL, NULL } /* end the list */ }; static void fix_mppe_keys(EAP_HANDLER *handler, mschapv2_opaque_t *data) { pairmove2(&data->mppe_keys, &handler->request->reply->vps, ((311 << 16) | 7)); pairmove2(&data->mppe_keys, &handler->request->reply->vps, ((311 << 16) | 8)); pairmove2(&data->mppe_keys, &handler->request->reply->vps, ((311 << 16) | 16)); pairmove2(&data->mppe_keys, &handler->request->reply->vps, ((311 << 16) | 17)); } static void free_data(void *ptr) { mschapv2_opaque_t *data = ptr; pairfree(&data->mppe_keys); pairfree(&data->reply); free(data); } /* * Detach the module. */ static int mschapv2_detach(void *arg) { rlm_eap_mschapv2_t *inst = (rlm_eap_mschapv2_t *) arg; free(inst); return 0; } /* * Attach the module. */ static int mschapv2_attach(CONF_SECTION *cs, void **instance) { rlm_eap_mschapv2_t *inst; inst = malloc(sizeof(*inst)); if (!inst) { radlog(L_ERR, "rlm_eap_mschapv2: out of memory"); return -1; } memset(inst, 0, sizeof(*inst)); /* * Parse the configuration attributes. */ if (cf_section_parse(cs, inst, module_config) < 0) { mschapv2_detach(inst); return -1; } *instance = inst; return 0; } /* * Compose the response. */ static int eapmschapv2_compose(EAP_HANDLER *handler, VALUE_PAIR *reply) { uint8_t *ptr; int16_t length; mschapv2_header_t *hdr; EAP_DS *eap_ds = handler->eap_ds; eap_ds->request->code = PW_EAP_REQUEST; eap_ds->request->type.type = PW_EAP_MSCHAPV2; switch (reply->attribute) { case PW_MSCHAP_CHALLENGE: /* * 0 1 2 3 * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | Code | Identifier | Length | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | Type | OpCode | MS-CHAPv2-ID | MS-Length... * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | MS-Length | Value-Size | Challenge... * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | Challenge... * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | Name... * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ */ length = MSCHAPV2_HEADER_LEN + MSCHAPV2_CHALLENGE_LEN + strlen(handler->identity); eap_ds->request->type.data = malloc(length); /* * Allocate room for the EAP-MS-CHAPv2 data. */ if (eap_ds->request->type.data == NULL) { radlog(L_ERR, "rlm_eap_mschapv2: out of memory"); return 0; } eap_ds->request->type.length = length; ptr = eap_ds->request->type.data; hdr = (mschapv2_header_t *) ptr; hdr->opcode = PW_EAP_MSCHAPV2_CHALLENGE; hdr->mschapv2_id = eap_ds->response->id + 1; length = htons(length); memcpy(hdr->ms_length, &length, sizeof(uint16_t)); hdr->value_size = MSCHAPV2_CHALLENGE_LEN; ptr += MSCHAPV2_HEADER_LEN; /* * Copy the Challenge, success, or error over. */ memcpy(ptr, reply->vp_strvalue, reply->length); memcpy((ptr + reply->length), handler->identity, strlen(handler->identity)); break; case PW_MSCHAP2_SUCCESS: /* * 0 1 2 3 * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | Code | Identifier | Length | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | Type | OpCode | MS-CHAPv2-ID | MS-Length... * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | MS-Length | Message... * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ */ DEBUG2("MSCHAP Success\n"); length = 46; eap_ds->request->type.data = malloc(length); /* * Allocate room for the EAP-MS-CHAPv2 data. */ if (eap_ds->request->type.data == NULL) { radlog(L_ERR, "rlm_eap_mschapv2: out of memory"); return 0; } memset(eap_ds->request->type.data, 0, length); eap_ds->request->type.length = length; eap_ds->request->type.data[0] = PW_EAP_MSCHAPV2_SUCCESS; eap_ds->request->type.data[1] = eap_ds->response->id; length = htons(length); memcpy((eap_ds->request->type.data + 2), &length, sizeof(uint16_t)); memcpy((eap_ds->request->type.data + 4), reply->vp_strvalue + 1, 42); break; case PW_MSCHAP_ERROR: DEBUG2("MSCHAP Failure\n"); length = 4 + reply->length - 1; eap_ds->request->type.data = malloc(length); /* * Allocate room for the EAP-MS-CHAPv2 data. */ if (eap_ds->request->type.data == NULL) { radlog(L_ERR, "rlm_eap_mschapv2: out of memory"); return 0; } memset(eap_ds->request->type.data, 0, length); eap_ds->request->type.length = length; eap_ds->request->type.data[0] = PW_EAP_MSCHAPV2_FAILURE; eap_ds->request->type.data[1] = eap_ds->response->id; length = htons(length); memcpy((eap_ds->request->type.data + 2), &length, sizeof(uint16_t)); /* * Copy the entire failure message. */ memcpy((eap_ds->request->type.data + 4), reply->vp_strvalue + 1, reply->length - 1); break; default: radlog(L_ERR, "rlm_eap_mschapv2: Internal sanity check failed"); return 0; break; } return 1; } /* * Initiate the EAP-MSCHAPV2 session by sending a challenge to the peer. */ static int mschapv2_initiate(void *type_data, EAP_HANDLER *handler) { int i; VALUE_PAIR *challenge; mschapv2_opaque_t *data; type_data = type_data; /* -Wunused */ challenge = pairmake("MS-CHAP-Challenge", "0x00", T_OP_EQ); if (!challenge) { radlog(L_ERR, "rlm_eap_mschapv2: out of memory"); return 0; } /* * Get a random challenge. */ challenge->length = MSCHAPV2_CHALLENGE_LEN; for (i = 0; i < MSCHAPV2_CHALLENGE_LEN; i++) { challenge->vp_strvalue[i] = fr_rand(); } DEBUG2("rlm_eap_mschapv2: Issuing Challenge"); /* * Keep track of the challenge. */ data = malloc(sizeof(mschapv2_opaque_t)); rad_assert(data != NULL); /* * We're at the stage where we're challenging the user. */ data->code = PW_EAP_MSCHAPV2_CHALLENGE; memcpy(data->challenge, challenge->vp_strvalue, MSCHAPV2_CHALLENGE_LEN); data->mppe_keys = NULL; data->reply = NULL; handler->opaque = data; handler->free_opaque = free_data; /* * Compose the EAP-MSCHAPV2 packet out of the data structure, * and free it. */ eapmschapv2_compose(handler, challenge); pairfree(&challenge); #ifdef WITH_PROXY /* * The EAP session doesn't have enough information to * proxy the "inside EAP" protocol. Disable EAP proxying. */ handler->request->options &= ~RAD_REQUEST_OPTION_PROXY_EAP; #endif /* * We don't need to authorize the user at this point. * * We also don't need to keep the challenge, as it's * stored in 'handler->eap_ds', which will be given back * to us... */ handler->stage = AUTHENTICATE; return 1; } #ifdef WITH_PROXY /* * Do post-proxy processing, * 0 = fail * 1 = OK. * * Called from rlm_eap.c, eap_postproxy(). */ static int mschap_postproxy(EAP_HANDLER *handler, void *tunnel_data) { VALUE_PAIR *response = NULL; mschapv2_opaque_t *data; data = (mschapv2_opaque_t *) handler->opaque; rad_assert(data != NULL); tunnel_data = tunnel_data; /* -Wunused */ DEBUG2(" rlm_eap_mschapv2: Passing reply from proxy back into the tunnel %p %d.", handler->request, handler->request->reply->code); /* * There is only a limited number of possibilities. */ switch (handler->request->reply->code) { case PW_AUTHENTICATION_ACK: DEBUG(" rlm_eap_mschapv2: Authentication succeeded."); /* * Move the attribute, so it doesn't go into * the reply. */ pairmove2(&response, &handler->request->reply->vps, PW_MSCHAP2_SUCCESS); break; default: case PW_AUTHENTICATION_REJECT: DEBUG(" rlm_eap_mschapv2: Authentication did not succeed."); return 0; } /* * No response, die. */ if (!response) { radlog(L_ERR, "rlm_eap_mschapv2: No MS-CHAPv2-Success or MS-CHAP-Error was found."); return 0; } /* * Done doing EAP proxy stuff. */ handler->request->options &= ~RAD_REQUEST_OPTION_PROXY_EAP; eapmschapv2_compose(handler, response); data->code = PW_EAP_MSCHAPV2_SUCCESS; /* * Delete MPPE keys & encryption policy * * FIXME: Use intelligent names... */ fix_mppe_keys(handler, data); /* * save any other attributes for re-use in the final * access-accept e.g. vlan, etc. This lets the PEAP * use_tunneled_reply code work */ data->reply = paircopy(handler->request->reply->vps); /* * And we need to challenge the user, not ack/reject them, * so we re-write the ACK to a challenge. Yuck. */ handler->request->reply->code = PW_ACCESS_CHALLENGE; pairfree(&response); return 1; } #endif /* * Authenticate a previously sent challenge. */ static int mschapv2_authenticate(void *arg, EAP_HANDLER *handler) { int rcode; mschapv2_opaque_t *data; EAP_DS *eap_ds = handler->eap_ds; VALUE_PAIR *challenge, *response, *name; rlm_eap_mschapv2_t *inst = (rlm_eap_mschapv2_t *) arg; rad_assert(handler->request != NULL); rad_assert(handler->stage == AUTHENTICATE); data = (mschapv2_opaque_t *) handler->opaque; /* * Sanity check the response. */ if (eap_ds->response->length <= 5) { radlog(L_ERR, "rlm_eap_mschapv2: corrupted data"); return 0; } /* * Switch over the MS-CHAP type. */ switch (eap_ds->response->type.data[0]) { /* * We should get an ACK from the client ONLY if we've * sent them a SUCCESS packet. */ case PW_EAP_MSCHAPV2_ACK: if (data->code != PW_EAP_MSCHAPV2_SUCCESS) { radlog(L_ERR, "rlm_eap_mschapv2: Unexpected ACK received"); return 0; } /* * It's a success. Don't proxy it. */ handler->request->options &= ~RAD_REQUEST_OPTION_PROXY_EAP; /* * And upon receiving the clients ACK, we do nothing * other than return EAP-Success, with no EAP-MS-CHAPv2 * data. */ return 1; break; /* * We should get a response ONLY after we've sent * a challenge. */ case PW_EAP_MSCHAPV2_RESPONSE: if (data->code == PW_EAP_MSCHAPV2_FAILURE) goto failure; if (data->code != PW_EAP_MSCHAPV2_CHALLENGE) { radlog(L_ERR, "rlm_eap_mschapv2: Unexpected response received"); return 0; } /* * Ensure that we have at least enough data * to do the following checks. * * EAP header (4), EAP type, MS-CHAP opcode, * MS-CHAP ident, MS-CHAP data length (2), * MS-CHAP value length. */ if (eap_ds->response->length < (4 + 1 + 1 + 1 + 2 + 1)) { radlog(L_ERR, "rlm_eap_mschapv2: Response is too short"); return 0; } /* * The 'value_size' is the size of the response, * which is supposed to be the response (48 * bytes) plus 1 byte of flags at the end. */ if (eap_ds->response->type.data[4] != 49) { radlog(L_ERR, "rlm_eap_mschapv2: Response is of incorrect length %d", eap_ds->response->type.data[4]); return 0; } /* * The MS-Length field is 5 + value_size + length * of name, which is put after the response. */ if (((eap_ds->response->type.data[2] << 8) | eap_ds->response->type.data[3]) < (5 + 49)) { radlog(L_ERR, "rlm_eap_mschapv2: Response contains contradictory length %d %d", (eap_ds->response->type.data[2] << 8) | eap_ds->response->type.data[3], 5 + 49); return 0; } break; case PW_EAP_MSCHAPV2_SUCCESS: if (data->code != PW_EAP_MSCHAPV2_SUCCESS) { radlog(L_ERR, "rlm_eap_mschapv2: Unexpected success received"); return 0; } #ifdef WITH_PROXY /* * It's a success. Don't proxy it. */ handler->request->options &= ~RAD_REQUEST_OPTION_PROXY_EAP; #endif pairadd(&handler->request->reply->vps, data->reply); data->reply = NULL; eap_ds->request->code = PW_EAP_SUCCESS; pairadd(&handler->request->reply->vps, data->mppe_keys); data->mppe_keys = NULL; return 1; break; /* * Ack of a failure message */ case PW_EAP_MSCHAPV2_FAILURE: if (data->code != PW_EAP_MSCHAPV2_FAILURE) { radlog(L_ERR, "rlm_eap_mschapv2: Unexpected FAILURE received"); return 0; } failure: handler->request->options &= ~RAD_REQUEST_OPTION_PROXY_EAP; eap_ds->request->code = PW_EAP_FAILURE; return 1; /* * Something else, we don't know what it is. */ default: radlog(L_ERR, "rlm_eap_mschapv2: Invalid response type %d", eap_ds->response->type.data[0]); return 0; } /* * We now know that the user has sent us a response * to the challenge. Let's try to authenticate it. * * We do this by taking the challenge from 'data', * the response from the EAP packet, and creating VALUE_PAIR's * to pass to the 'mschap' module. This is a little wonky, * but it works. */ challenge = pairmake("MS-CHAP-Challenge", "0x00", T_OP_EQ); if (!challenge) { radlog(L_ERR, "rlm_eap_mschapv2: out of memory"); return 0; } challenge->length = MSCHAPV2_CHALLENGE_LEN; memcpy(challenge->vp_strvalue, data->challenge, MSCHAPV2_CHALLENGE_LEN); response = pairmake("MS-CHAP2-Response", "0x00", T_OP_EQ); if (!response) { pairfree(&challenge); radlog(L_ERR, "rlm_eap_mschapv2: out of memory"); return 0; } response->length = MSCHAPV2_RESPONSE_LEN; memcpy(response->vp_strvalue + 2, &eap_ds->response->type.data[5], MSCHAPV2_RESPONSE_LEN - 2); response->vp_strvalue[0] = eap_ds->response->type.data[1]; response->vp_strvalue[1] = eap_ds->response->type.data[5 + MSCHAPV2_RESPONSE_LEN]; name = pairmake("MS-CHAP-User-Name", "", T_OP_EQ); if (!name) { pairfree(&challenge); pairfree(&response); radlog(L_ERR, "rlm_eap_mschapv2: Failed creating MS-CHAP-User-Name: %s", fr_strerror()); return 0; } /* * MS-Length - MS-Value - 5. */ name->length = (((eap_ds->response->type.data[2] << 8) | eap_ds->response->type.data[3]) - eap_ds->response->type.data[4] - 5); if (name->length >= sizeof(name->vp_strvalue)) { name->length = sizeof(name->vp_strvalue) - 1; } memcpy(name->vp_strvalue, &eap_ds->response->type.data[4 + MSCHAPV2_RESPONSE_LEN], name->length); name->vp_strvalue[name->length] = '\0'; /* * Add the pairs to the request, and call the 'mschap' * module. */ pairadd(&handler->request->packet->vps, challenge); pairadd(&handler->request->packet->vps, response); pairadd(&handler->request->packet->vps, name); #ifdef WITH_PROXY /* * If this options is set, then we do NOT authenticate the * user here. Instead, now that we've added the MS-CHAP * attributes to the request, we STOP, and let the outer * tunnel code handle it. * * This means that the outer tunnel code will DELETE the * EAP attributes, and proxy the MS-CHAP attributes to a * home server. */ if (handler->request->options & RAD_REQUEST_OPTION_PROXY_EAP) { char *username = NULL; eap_tunnel_data_t *tunnel; /* * Set up the callbacks for the tunnel */ tunnel = rad_malloc(sizeof(*tunnel)); memset(tunnel, 0, sizeof(*tunnel)); tunnel->tls_session = arg; tunnel->callback = mschap_postproxy; /* * Associate the callback with the request. */ rcode = request_data_add(handler->request, handler->request->proxy, REQUEST_DATA_EAP_TUNNEL_CALLBACK, tunnel, free); rad_assert(rcode == 0); /* * The State attribute is NOT supposed to * go into the proxied packet, it will confuse * other RADIUS servers, and they will discard * the request. * * The PEAP module will take care of adding * the State attribute back, before passing * the handler & request back into the tunnel. */ pairdelete(&handler->request->packet->vps, PW_STATE); /* * Fix the User-Name when proxying, to strip off * the NT Domain, if we're told to, and a User-Name * exists, and there's a \\, meaning an NT-Domain * in the user name, THEN discard the user name. */ if (inst->with_ntdomain_hack && ((challenge = pairfind(handler->request->packet->vps, PW_USER_NAME)) != NULL) && ((username = strchr(challenge->vp_strvalue, '\\')) != NULL)) { /* * Wipe out the NT domain. * * FIXME: Put it into MS-CHAP-Domain? */ username++; /* skip the \\ */ memmove(challenge->vp_strvalue, username, strlen(username) + 1); /* include \0 */ challenge->length = strlen(challenge->vp_strvalue); } /* * Remember that in the post-proxy stage, we've got * to do the work below, AFTER the call to MS-CHAP * authentication... */ return 1; } #endif /* * This is a wild & crazy hack. */ rcode = module_authenticate(PW_AUTHTYPE_MS_CHAP, handler->request); /* * Delete MPPE keys & encryption policy. We don't * want these here. */ fix_mppe_keys(handler, data); /* * Take the response from the mschap module, and * return success or failure, depending on the result. */ response = NULL; if (rcode == RLM_MODULE_OK) { pairmove2(&response, &handler->request->reply->vps, PW_MSCHAP2_SUCCESS); data->code = PW_EAP_MSCHAPV2_SUCCESS; } else if (inst->send_error) { pairmove2(&response, &handler->request->reply->vps, PW_MSCHAP_ERROR); data->code = PW_EAP_MSCHAPV2_FAILURE; } else { eap_ds->request->code = PW_EAP_FAILURE; return 1; } /* * No response, die. */ if (!response) { radlog(L_ERR, "rlm_eap_mschapv2: No MS-CHAPv2-Success or MS-CHAP-Error was found."); return 0; } /* * Compose the response (whatever it is), * and return it to the over-lying EAP module. */ eapmschapv2_compose(handler, response); pairfree(&response); return 1; } /* * The module name should be the only globally exported symbol. * That is, everything else should be 'static'. */ EAP_TYPE rlm_eap_mschapv2 = { "eap_mschapv2", mschapv2_attach, /* attach */ mschapv2_initiate, /* Start the initial request */ NULL, /* authorization */ mschapv2_authenticate, /* authentication */ mschapv2_detach /* detach */ }; freeradius-server/src/modules/rlm_eap/types/rlm_eap_peap/000077500000000000000000000000001257552170400241715ustar00rootroot00000000000000freeradius-server/src/modules/rlm_eap/types/rlm_eap_peap/.gitignore000066400000000000000000000000221257552170400261530ustar00rootroot00000000000000Makefile config.h freeradius-server/src/modules/rlm_eap/types/rlm_eap_peap/Makefile.in000066400000000000000000000005301257552170400262340ustar00rootroot00000000000000# # $Id$ # TARGET = @targetname@ SRCS = rlm_eap_peap.c peap.c HEADERS = eap_peap.h ../../eap.h ../../rlm_eap.h RLM_CFLAGS = -I../.. -I../../libeap @eap_peap_cflags@ RLM_LIBS = @eap_peap_ldflags@ ../../libeap/$(LIBPREFIX)freeradius-eap.la RLM_INSTALL = RLM_DIR=../../ include ${RLM_DIR}../rules.mak $(LT_OBJS): $(HEADERS) freeradius-server/src/modules/rlm_eap/types/rlm_eap_peap/config.h.in000066400000000000000000000007271257552170400262220ustar00rootroot00000000000000/* config.h.in. Generated from configure.in by autoheader. */ /* 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 version of this package. */ #undef PACKAGE_VERSION freeradius-server/src/modules/rlm_eap/types/rlm_eap_peap/configure000077500000000000000000002273271257552170400261150ustar00rootroot00000000000000#! /bin/sh # From configure.in Revision. # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.61. # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, # 2002, 2003, 2004, 2005, 2006 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=: # 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 # PATH needs CR # 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 # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false 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.) as_nl=' ' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. 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 # Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # CDPATH. $as_unset CDPATH if test "x$CONFIG_SHELL" = x; then if (eval ":") 2>/dev/null; then as_have_required=yes else as_have_required=no fi if test $as_have_required = yes && (eval ": (as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=\$LINENO as_lineno_2=\$LINENO test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } ") 2> /dev/null; then : else as_candidate_shells= as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. case $as_dir in /*) for as_base in sh bash ksh sh5; do as_candidate_shells="$as_candidate_shells $as_dir/$as_base" done;; esac done IFS=$as_save_IFS for as_shell in $as_candidate_shells $SHELL; do # Try only shells that exist, to save several forks. if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { ("$as_shell") 2> /dev/null <<\_ASEOF 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 : _ASEOF }; then CONFIG_SHELL=$as_shell as_have_required=yes if { "$as_shell" 2> /dev/null <<\_ASEOF 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 : (as_func_return () { (exit $1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = "$1" ); then : else exitcode=1 echo positional parameters were not saved. fi test $exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } _ASEOF }; then break fi fi done if test "x$CONFIG_SHELL" != x; then for as_var in BASH_ENV ENV do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done export CONFIG_SHELL exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} fi if test $as_have_required = no; then echo This script requires a shell more modern than all the echo shells that I found on your system. Please install a echo modern shell, or manually run the script under such a echo shell if you do have one. { (exit 1); exit 1; } fi fi fi (eval "as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0") || { echo No shell found that supports shell functions. echo Please tell autoconf@gnu.org about your system, echo including any error possibly output before this echo message } as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, and appends # trailing '-' during substitution so that $LINENO is not a special # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # scripts with optimization help from Paolo Bonzini. 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" || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi 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 fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi 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=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, 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= SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME= PACKAGE_TARNAME= PACKAGE_VERSION= PACKAGE_STRING= PACKAGE_BUGREPORT= ac_unique_file="rlm_eap_peap.c" ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datarootdir datadir sysconfdir sharedstatedir localstatedir includedir oldincludedir docdir infodir htmldir dvidir pdfdir psdir libdir localedir mandir DEFS ECHO_C ECHO_N ECHO_T LIBS build_alias host_alias target_alias eap_peap_ldflags eap_peap_cflags targetname LIBOBJS LTLIBOBJS' ac_subst_files='' ac_precious_vars='build_alias host_alias target_alias' # Initialize some variables set by options. ac_init_help= ac_init_version=false # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *) ac_optarg=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_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` eval enable_$ac_feature=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_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` eval enable_$ac_feature=\$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_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/[-.]/_/g'` eval with_$ac_package=\$ac_optarg ;; -without-* | --without-*) ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/[-.]/_/g'` eval with_$ac_package=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 ;; -*) { echo "$as_me: error: unrecognized option: $ac_option Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && 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'` { echo "$as_me: error: missing argument to $ac_option" >&2 { (exit 1); exit 1; }; } fi # Be sure to have absolute directory names. 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 case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; } 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 echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || { echo "$as_me: error: Working directory cannot be determined" >&2 { (exit 1); exit 1; }; } test "X$ac_ls_di" = "X$ac_pwd_ls_di" || { echo "$as_me: error: pwd does not report name of working directory" >&2 { (exit 1); exit 1; }; } # 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 -- "$0" || $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$0" : 'X\(//\)[^/]' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X"$0" | 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 .." { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2 { (exit 1); exit 1; }; } pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures this package to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF _ACEOF fi if test -n "$ac_init_help"; then cat <<\_ACEOF Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-rlm-eap-peap-lib-dir directory for eap-peap libs --with-rlm-eap-peap-include-dir directory for eap-peap includes _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" || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`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 echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF configure generated by GNU Autoconf 2.61 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 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 cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by $as_me, which was generated by GNU Autoconf 2.61. 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=. 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=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; 2) ac_configure_args1="$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 ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac done done $as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } $as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export 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 cat <<\_ASBOX ## ---------------- ## ## Cache variables. ## ## ---------------- ## _ASBOX 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_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( *) $as_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 cat <<\_ASBOX ## ----------------- ## ## Output variables. ## ## ----------------- ## _ASBOX echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then cat <<\_ASBOX ## ------------------- ## ## File substitutions. ## ## ------------------- ## _ASBOX echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then cat <<\_ASBOX ## ----------- ## ## confdefs.h. ## ## ----------- ## _ASBOX echo cat confdefs.h echo fi test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" 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'; { (exit 1); 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 # 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 # Let the site file select an alternate cache file if it wants to. # Prefer explicitly selected file to automatically selected ones. if test -n "$CONFIG_SITE"; then set x "$CONFIG_SITE" elif test "x$prefix" != xNONE; then set x "$prefix/share/config.site" "$prefix/etc/config.site" else set x "$ac_default_prefix/share/config.site" \ "$ac_default_prefix/etc/config.site" fi shift for ac_site_file do if test -r "$ac_site_file"; then { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" 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. if test -f "$cache_file"; then { echo "$as_me:$LINENO: loading cache $cache_file" >&5 echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { echo "$as_me:$LINENO: creating cache $cache_file" >&5 echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 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 { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 echo "$as_me: former value: $ac_old_val" >&2;} { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 echo "$as_me: current value: $ac_new_val" >&2;} ac_cache_corrupted=: fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`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. *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 echo "$as_me: error: changes in the environment can compromise the build" >&2;} { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} { (exit 1); exit 1; }; } 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 fail= eap_peap_ldflags= eap_peap_cflags= if test x$with_rlm_eap_peap != xno; then # Check whether --with-rlm-eap-peap-lib-dir was given. if test "${with_rlm_eap_peap_lib_dir+set}" = set; then withval=$with_rlm_eap_peap_lib_dir; eap_peap_ldflags="-L$withval" fi # Check whether --with-rlm-eap-peap-include-dir was given. if test "${with_rlm_eap_peap_include_dir+set}" = set; then withval=$with_rlm_eap_peap_include_dir; eap_peap_cflags="-I$withval" fi { echo "$as_me:$LINENO: checking for OpenSSL support" >&5 echo $ECHO_N "checking for OpenSSL support... $ECHO_C" >&6; } if test "x$OPENSSL_LIBS" != "x"; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fail="OpenSSL" fi targetname=rlm_eap_peap else targetname= echo \*\*\* module rlm_eap_peap is disabled. fi if test x"$fail" != x""; then if test x"${enable_strict_dependencies}" = x"yes"; then { { echo "$as_me:$LINENO: error: set --without-rlm_eap_peap to disable it explicitly." >&5 echo "$as_me: error: set --without-rlm_eap_peap to disable it explicitly." >&2;} { (exit 1); exit 1; }; } else { echo "$as_me:$LINENO: WARNING: silently not building rlm_eap_peap." >&5 echo "$as_me: WARNING: silently not building rlm_eap_peap." >&2;} { echo "$as_me:$LINENO: WARNING: FAILURE: rlm_eap_peap requires: $fail." >&5 echo "$as_me: WARNING: FAILURE: rlm_eap_peap requires: $fail." >&2;} if test x"$headersuggestion" != x; then { echo "$as_me:$LINENO: WARNING: $headersuggestion" >&5 echo "$as_me: WARNING: $headersuggestion" >&2;} fi if test x"$libsuggestion" != x; then { echo "$as_me:$LINENO: WARNING: $libsuggestion" >&5 echo "$as_me: WARNING: $libsuggestion" >&2;} fi targetname="" fi fi ac_config_headers="$ac_config_headers config.h" unset ac_cv_env_LIBS_set unset ac_cv_env_LIBS_value ac_config_files="$ac_config_files 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_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( *) $as_unset $ac_var ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then test "x$cache_file" != "x/dev/null" && { echo "$as_me:$LINENO: updating cache $cache_file" >&5 echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 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= 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=`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. ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs : ${CONFIG_STATUS=./config.status} ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >$CONFIG_STATUS <<_ACEOF #! $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} _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ## --------------------- ## ## 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=: # 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 # PATH needs CR # 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 # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false 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.) as_nl=' ' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. 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 # Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # CDPATH. $as_unset CDPATH as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, and appends # trailing '-' during substitution so that $LINENO is not a special # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # scripts with optimization help from Paolo Bonzini. 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" || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi 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 fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi 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=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 # Save the log message, to keep $[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by $as_me, which was generated by GNU Autoconf 2.61. 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 cat >>$CONFIG_STATUS <<_ACEOF # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ config.status configured by $0, generated by GNU Autoconf 2.61, with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" Copyright (C) 2006 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' _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # If no file are specified by the user, then we need to provide default # value. By we need to know if files were specified by the user. 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=$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 ) echo "$ac_cs_version"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift CONFIG_FILES="$CONFIG_FILES $ac_optarg" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header { echo "$as_me: error: ambiguous option: $1 Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; };; --help | --hel | -h ) 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. -*) { echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *) ac_config_targets="$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 if \$ac_cs_recheck; then echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 CONFIG_SHELL=$SHELL export CONFIG_SHELL exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # 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" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= trap 'exit_status=$? { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status ' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || { echo "$me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } # # Set up the sed scripts for CONFIG_FILES section. # # No need to generate the scripts if there are no CONFIG_FILES. # This happens for instance when ./config.status config.h if test -n "$CONFIG_FILES"; then _ACEOF ac_delim='%!_!# ' for ac_last_try in false false false false false :; do cat >conf$$subs.sed <<_ACEOF SHELL!$SHELL$ac_delim PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim PACKAGE_NAME!$PACKAGE_NAME$ac_delim PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim PACKAGE_STRING!$PACKAGE_STRING$ac_delim PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim exec_prefix!$exec_prefix$ac_delim prefix!$prefix$ac_delim program_transform_name!$program_transform_name$ac_delim bindir!$bindir$ac_delim sbindir!$sbindir$ac_delim libexecdir!$libexecdir$ac_delim datarootdir!$datarootdir$ac_delim datadir!$datadir$ac_delim sysconfdir!$sysconfdir$ac_delim sharedstatedir!$sharedstatedir$ac_delim localstatedir!$localstatedir$ac_delim includedir!$includedir$ac_delim oldincludedir!$oldincludedir$ac_delim docdir!$docdir$ac_delim infodir!$infodir$ac_delim htmldir!$htmldir$ac_delim dvidir!$dvidir$ac_delim pdfdir!$pdfdir$ac_delim psdir!$psdir$ac_delim libdir!$libdir$ac_delim localedir!$localedir$ac_delim mandir!$mandir$ac_delim DEFS!$DEFS$ac_delim ECHO_C!$ECHO_C$ac_delim ECHO_N!$ECHO_N$ac_delim ECHO_T!$ECHO_T$ac_delim LIBS!$LIBS$ac_delim build_alias!$build_alias$ac_delim host_alias!$host_alias$ac_delim target_alias!$target_alias$ac_delim eap_peap_ldflags!$eap_peap_ldflags$ac_delim eap_peap_cflags!$eap_peap_cflags$ac_delim targetname!$targetname$ac_delim LIBOBJS!$LIBOBJS$ac_delim LTLIBOBJS!$LTLIBOBJS$ac_delim _ACEOF if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 42; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` if test -n "$ac_eof"; then ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` ac_eof=`expr $ac_eof + 1` fi cat >>$CONFIG_STATUS <<_ACEOF cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof /@[a-zA-Z_][a-zA-Z_0-9]*@/!b end _ACEOF sed ' s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g s/^/s,@/; s/!/@,|#_!!_#|/ :n t n s/'"$ac_delim"'$/,g/; t s/$/\\/; p N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n ' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF :end s/|#_!!_#|//g CEOF$ac_eof _ACEOF # VPATH may cause trouble with some makes, so we remove $(srcdir), # ${srcdir} and @srcdir@ 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[ ]*=/{ s/:*\$(srcdir):*/:/ s/:*\${srcdir}:*/:/ s/:*@srcdir@:*/:/ s/^\([^=]*=[ ]*\):*/\1/ s/:*$// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF fi # test -n "$CONFIG_FILES" for ac_tag in :F $CONFIG_FILES :H $CONFIG_HEADERS do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5 echo "$as_me: error: Invalid tag $ac_tag." >&2;} { (exit 1); exit 1; }; };; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 echo "$as_me: error: cannot find input file: $ac_f" >&2;} { (exit 1); exit 1; }; };; esac ac_file_inputs="$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 "`IFS=: echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure." if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { echo "$as_me:$LINENO: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} fi case $ac_tag in *:-:* | *:-) cat >"$tmp/stdin";; 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 || 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" case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`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 || 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" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 echo "$as_me: error: cannot create directory $as_dir" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`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 # _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # 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= case `sed -n '/datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p ' $ac_file_inputs` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF 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 sed "$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s&@configure_input@&$configure_input&;t t s&@top_builddir@&$ac_top_builddir_sub&;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 $ac_datarootdir_hack " $ac_file_inputs | sed -f "$tmp/subs-1.sed" >$tmp/out test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&5 echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&2;} rm -f "$tmp/stdin" case $ac_file in -) cat "$tmp/out"; rm -f "$tmp/out";; *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;; esac ;; :H) # # CONFIG_HEADER # _ACEOF # Transform confdefs.h into a sed script `conftest.defines', that # substitutes the proper values into config.h.in to produce config.h. rm -f conftest.defines conftest.tail # First, append a space to every undef/define line, to ease matching. echo 's/$/ /' >conftest.defines # Then, protect against being on the right side of a sed subst, or in # an unquoted here document, in config.status. If some macros were # called several times there might be several #defines for the same # symbol, which is useless. But do not sort them, since the last # AC_DEFINE must be honored. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* # These sed commands are passed to sed as "A NAME B PARAMS C VALUE D", where # NAME is the cpp macro being defined, VALUE is the value it is being given. # PARAMS is the parameter list in the macro definition--in most cases, it's # just an empty string. ac_dA='s,^\\([ #]*\\)[^ ]*\\([ ]*' ac_dB='\\)[ (].*,\\1define\\2' ac_dC=' ' ac_dD=' ,' uniq confdefs.h | sed -n ' t rset :rset s/^[ ]*#[ ]*define[ ][ ]*// t ok d :ok s/[\\&,]/\\&/g s/^\('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/ '"$ac_dA"'\1'"$ac_dB"'\2'"${ac_dC}"'\3'"$ac_dD"'/p s/^\('"$ac_word_re"'\)[ ]*\(.*\)/'"$ac_dA"'\1'"$ac_dB$ac_dC"'\2'"$ac_dD"'/p ' >>conftest.defines # Remove the space that was appended to ease matching. # Then 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. # (The regexp can be short, since the line contains either #define or #undef.) echo 's/ $// s,^[ #]*u.*,/* & */,' >>conftest.defines # Break up conftest.defines: ac_max_sed_lines=50 # First sed command is: sed -f defines.sed $ac_file_inputs >"$tmp/out1" # Second one is: sed -f defines.sed "$tmp/out1" >"$tmp/out2" # Third one will be: sed -f defines.sed "$tmp/out2" >"$tmp/out1" # et cetera. ac_in='$ac_file_inputs' ac_out='"$tmp/out1"' ac_nxt='"$tmp/out2"' while : do # Write a here document: cat >>$CONFIG_STATUS <<_ACEOF # First, check the format of the line: cat >"\$tmp/defines.sed" <<\\CEOF /^[ ]*#[ ]*undef[ ][ ]*$ac_word_re[ ]*\$/b def /^[ ]*#[ ]*define[ ][ ]*$ac_word_re[( ]/b def b :def _ACEOF sed ${ac_max_sed_lines}q conftest.defines >>$CONFIG_STATUS echo 'CEOF sed -f "$tmp/defines.sed"' "$ac_in >$ac_out" >>$CONFIG_STATUS ac_in=$ac_out; ac_out=$ac_nxt; ac_nxt=$ac_in sed 1,${ac_max_sed_lines}d conftest.defines >conftest.tail grep . conftest.tail >/dev/null || break rm -f conftest.defines mv conftest.tail conftest.defines done rm -f conftest.defines conftest.tail echo "ac_result=$ac_in" >>$CONFIG_STATUS cat >>$CONFIG_STATUS <<\_ACEOF if test x"$ac_file" != x-; then echo "/* $configure_input */" >"$tmp/config.h" cat "$ac_result" >>"$tmp/config.h" if diff $ac_file "$tmp/config.h" >/dev/null 2>&1; then { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 echo "$as_me: $ac_file is unchanged" >&6;} else rm -f $ac_file mv "$tmp/config.h" $ac_file fi else echo "/* $configure_input */" cat "$ac_result" fi rm -f "$tmp/out12" ;; esac done # for ac_tag { (exit 0); exit 0; } _ACEOF chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save # 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 || { (exit 1); exit 1; } fi freeradius-server/src/modules/rlm_eap/types/rlm_eap_peap/configure.in000066400000000000000000000031511257552170400265020ustar00rootroot00000000000000# # Autoconf input file. # # Version: $Id$ # AC_PREREQ([2.53]) AC_INIT(rlm_eap_peap.c) AC_REVISION($Revision$) AC_DEFUN(modname,[rlm_eap_peap]) fail= eap_peap_ldflags= eap_peap_cflags= if test x$with_[]modname != xno; then dnl ############################################################ dnl # Check for command line options dnl ############################################################ AC_ARG_WITH(rlm-eap-peap-lib-dir, [ --with-rlm-eap-peap-lib-dir directory for eap-peap libs], eap_peap_ldflags="-L$withval") AC_ARG_WITH(rlm-eap-peap-include-dir, [ --with-rlm-eap-peap-include-dir directory for eap-peap includes], eap_peap_cflags="-I$withval") dnl ############################################################ dnl # Check for OpenSSL support dnl ############################################################ AC_MSG_CHECKING(for OpenSSL support) if test "x$OPENSSL_LIBS" != "x"; then AC_MSG_RESULT(yes) else AC_MSG_RESULT(no) fail="OpenSSL" fi targetname=modname else targetname= echo \*\*\* module modname is disabled. fi if test x"$fail" != x""; then if test x"${enable_strict_dependencies}" = x"yes"; then AC_MSG_ERROR([set --without-]modname[ to disable it explicitly.]) else AC_MSG_WARN([silently not building ]modname[.]) AC_MSG_WARN([FAILURE: ]modname[ requires: $fail.]) if test x"$headersuggestion" != x; then AC_MSG_WARN([$headersuggestion]) fi if test x"$libsuggestion" != x; then AC_MSG_WARN([$libsuggestion]) fi targetname="" fi fi AC_SUBST(eap_peap_ldflags) AC_SUBST(eap_peap_cflags) AC_SUBST(targetname) AC_CONFIG_HEADER([config.h]) AC_OUTPUT(Makefile) freeradius-server/src/modules/rlm_eap/types/rlm_eap_peap/eap_peap.h000066400000000000000000000041111257552170400261110ustar00rootroot00000000000000/* * eap_peap.h * * Version: $Id$ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2003 Alan DeKok * Copyright 2006 The FreeRADIUS server project */ #ifndef _EAP_PEAP_H #define _EAP_PEAP_H #include RCSIDH(eap_peap_h, "$Id$") #include "eap_tls.h" #include typedef struct peap_tunnel_t { VALUE_PAIR *username; VALUE_PAIR *state; VALUE_PAIR *accept_vps; int status; int home_access_accept; int default_eap_type; int copy_request_to_tunnel; int use_tunneled_reply; int proxy_tunneled_request_as_eap; const char *virtual_server; int soh; const char *soh_virtual_server; VALUE_PAIR *soh_reply_vps; int session_resumption_state; } peap_tunnel_t; #define PEAP_STATUS_INVALID 0 #define PEAP_STATUS_SENT_TLV_SUCCESS 1 #define PEAP_STATUS_SENT_TLV_FAILURE 2 #define PEAP_STATUS_TUNNEL_ESTABLISHED 3 #define PEAP_STATUS_INNER_IDENTITY_REQ_SENT 4 #define PEAP_STATUS_PHASE2_INIT 5 #define PEAP_STATUS_PHASE2 6 #define PEAP_STATUS_WAIT_FOR_SOH_RESPONSE 7 #define PEAP_RESUMPTION_NO (0) #define PEAP_RESUMPTION_YES (1) #define PEAP_RESUMPTION_MAYBE (2) #define EAP_TLV_SUCCESS (1) #define EAP_TLV_FAILURE (2) #define EAP_TLV_ACK_RESULT (3) #define PW_EAP_TLV 33 /* * Process the PEAP portion of an EAP-PEAP request. */ int eappeap_process(EAP_HANDLER *handler, tls_session_t *tls_session); #endif /* _EAP_PEAP_H */ freeradius-server/src/modules/rlm_eap/types/rlm_eap_peap/peap.c000066400000000000000000000770511257552170400252740ustar00rootroot00000000000000/* * peap.c contains the interfaces that are called from eap * * Version: $Id$ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2003 Alan DeKok * Copyright 2006 The FreeRADIUS server project */ #include RCSID("$Id$") #include "eap_peap.h" static int setup_fake_request(REQUEST *request, REQUEST *fake, peap_tunnel_t *t); /* * Send protected EAP-Failure * * Result-TLV = Failure */ static int eappeap_failure(EAP_HANDLER *handler, tls_session_t *tls_session) { uint8_t tlv_packet[11]; REQUEST *request = handler->request; RDEBUG2("FAILURE"); tlv_packet[0] = PW_EAP_REQUEST; tlv_packet[1] = handler->eap_ds->response->id +1; tlv_packet[2] = 0; tlv_packet[3] = 11; /* length of this packet */ tlv_packet[4] = PW_EAP_TLV; tlv_packet[5] = 0x80; tlv_packet[6] = EAP_TLV_ACK_RESULT; tlv_packet[7] = 0; tlv_packet[8] = 2; /* length of the data portion */ tlv_packet[9] = 0; tlv_packet[10] = EAP_TLV_FAILURE; (tls_session->record_plus)(&tls_session->clean_in, tlv_packet, 11); /* * FIXME: Check the return code. */ tls_handshake_send(request, tls_session); return 1; } /* * Send protected EAP-Success * * Result-TLV = Success */ static int eappeap_success(EAP_HANDLER *handler, tls_session_t *tls_session) { uint8_t tlv_packet[11]; REQUEST *request = handler->request; RDEBUG2("SUCCESS"); tlv_packet[0] = PW_EAP_REQUEST; tlv_packet[1] = handler->eap_ds->response->id +1; tlv_packet[2] = 0; tlv_packet[3] = 11; /* length of this packet */ tlv_packet[4] = PW_EAP_TLV; tlv_packet[5] = 0x80; /* mandatory AVP */ tlv_packet[6] = EAP_TLV_ACK_RESULT; tlv_packet[7] = 0; tlv_packet[8] = 2; /* length of the data portion */ tlv_packet[9] = 0; tlv_packet[10] = EAP_TLV_SUCCESS; (tls_session->record_plus)(&tls_session->clean_in, tlv_packet, 11); /* * FIXME: Check the return code. */ tls_handshake_send(request, tls_session); return 1; } static int eappeap_identity(EAP_HANDLER *handler, tls_session_t *tls_session) { eap_packet_t eap_packet; eap_packet.code = PW_EAP_REQUEST; eap_packet.id = handler->eap_ds->response->id + 1; eap_packet.length[0] = 0; eap_packet.length[1] = EAP_HEADER_LEN + 1; eap_packet.data[0] = PW_EAP_IDENTITY; (tls_session->record_plus)(&tls_session->clean_in, &eap_packet, sizeof(eap_packet)); tls_handshake_send(handler->request, tls_session); (tls_session->record_init)(&tls_session->clean_in); return 1; } /* * Send an MS SoH request */ static int eappeap_soh(EAP_HANDLER *handler, tls_session_t *tls_session) { uint8_t tlv_packet[20]; tlv_packet[0] = 254; /* extended type */ tlv_packet[1] = 0; tlv_packet[2] = 0x01; /* ms vendor */ tlv_packet[3] = 0x37; tlv_packet[4] = 0; /* ms soh eap */ tlv_packet[5] = 0; tlv_packet[6] = 0; tlv_packet[7] = 0x21; tlv_packet[8] = 0; /* vendor-spec tlv */ tlv_packet[9] = 7; tlv_packet[10] = 0; tlv_packet[11] = 8; /* payload len */ tlv_packet[12] = 0; /* ms vendor */ tlv_packet[13] = 0; tlv_packet[14] = 0x01; tlv_packet[15] = 0x37; tlv_packet[16] = 0; tlv_packet[17] = 2; tlv_packet[18] = 0; tlv_packet[19] = 0; (tls_session->record_plus)(&tls_session->clean_in, tlv_packet, 20); tls_handshake_send(handler->request, tls_session); return 1; } static VALUE_PAIR* eapsoh_verify(REQUEST *request, const uint8_t *data, unsigned int data_len) { VALUE_PAIR *vp; uint8_t eap_type_base; uint32_t eap_vendor; uint32_t eap_type; int rv; vp = pairmake("SoH-Supported", "no", T_OP_EQ); if (data && data[0] == PW_EAP_NAK) { RDEBUG("SoH - client NAKed"); goto done; } if (!data || data_len < 8) { RDEBUG("SoH - eap payload too short"); goto done; } eap_type_base = *data++; if (eap_type_base != 254) { RDEBUG("SoH - response is not extended EAP: %i", eap_type_base); goto done; } eap_vendor = soh_pull_be_24(data); data += 3; if (eap_vendor != 0x137) { RDEBUG("SoH - extended eap vendor %08x is not Microsoft", eap_vendor); goto done; } eap_type = soh_pull_be_32(data); data += 4; if (eap_type != 0x21) { RDEBUG("SoH - response eap type %08x is not EAP-SoH", eap_type); goto done; } rv = soh_verify(request, vp, data, data_len - 8); if (rv<0) { RDEBUG("SoH - error decoding payload: %s", fr_strerror()); } else { vp->vp_integer = 1; } done: return vp; } /* * Verify the tunneled EAP message. */ static int eapmessage_verify(REQUEST *request, const uint8_t *data, unsigned int data_len) { const eap_packet_t *eap_packet = (const eap_packet_t *) data; uint8_t eap_type; char buffer[256]; /* * No data, OR only 1 byte of EAP type. */ if (!data || (data_len == 0) || ((data_len <= 1) && (data[0] != PW_EAP_IDENTITY))) { return 0; } eap_type = *data; switch (eap_type) { case PW_EAP_IDENTITY: if (data_len == 1) { RDEBUG2("Identity - "); return 1; } RDEBUG2("Identity - %*s", data_len - 1, data + 1); return 1; break; /* * If the first byte of the packet is * EAP-Response, and the EAP data is a TLV, * then it looks OK... */ case PW_EAP_RESPONSE: if (eap_packet->data[0] == PW_EAP_TLV) { RDEBUG2("Received EAP-TLV response."); return 1; } RDEBUG2("Got something weird."); break; /* * We normally do Microsoft MS-CHAPv2 (26), versus * Cisco MS-CHAPv2 (29). */ case PW_EAP_MSCHAPV2: default: RDEBUG2("EAP type %s", eaptype_type2name(eap_type, buffer, sizeof(buffer))); return 1; break; } return 0; } /* * Convert a pseudo-EAP packet to a list of VALUE_PAIR's. */ static VALUE_PAIR *eap2vp(REQUEST *request, EAP_DS *eap_ds, const uint8_t *data, size_t data_len) { size_t total; VALUE_PAIR *vp = NULL, *head, **tail; if (data_len > 65535) return NULL; /* paranoia */ vp = paircreate(PW_EAP_MESSAGE, PW_TYPE_OCTETS); if (!vp) { RDEBUG2("Failure in creating VP"); return NULL; } total = data_len; if (total > 249) total = 249; /* * Hand-build an EAP packet from the crap in PEAP version 0. */ vp->vp_octets[0] = PW_EAP_RESPONSE; vp->vp_octets[1] = eap_ds->response->id; vp->vp_octets[2] = (data_len + EAP_HEADER_LEN) >> 8; vp->vp_octets[3] = (data_len + EAP_HEADER_LEN) & 0xff; memcpy(vp->vp_octets + EAP_HEADER_LEN, data, total); vp->length = EAP_HEADER_LEN + total; head = vp; tail = &(vp->next); while (total < data_len) { int vp_len; vp = paircreate(PW_EAP_MESSAGE, PW_TYPE_OCTETS); if (!vp) { RDEBUG2("Failure in creating VP"); pairfree(&head); return NULL; } vp_len = (data_len - total); if (vp_len > 253) vp_len = 253; memcpy(vp->vp_octets, data + total, vp_len); vp->length = vp_len; total += vp_len; *tail = vp; tail = &(vp->next); } return head; } /* * Convert a list of VALUE_PAIR's to an EAP packet, through the * simple expedient of dumping the EAP message */ static int vp2eap(REQUEST *request, tls_session_t *tls_session, VALUE_PAIR *vp) { /* * Skip the id, code, and length. Just write the EAP * type & data to the client. */ #ifndef NDEBUG if ((debug_flag > 2) && fr_log_fp) { size_t i, total; VALUE_PAIR *this; total = 0; for (this = vp; this != NULL; this = this->next) { int start = 0; if (this == vp) start = EAP_HEADER_LEN; for (i = start; i < vp->length; i++) { if ((total & 0x0f) == 0) fprintf(fr_log_fp, " PEAP tunnel data out %04x: ", total); fprintf(fr_log_fp, "%02x ", vp->vp_octets[i]); if ((total & 0x0f) == 0x0f) fprintf(fr_log_fp, "\n"); total++; } } if ((total & 0x0f) != 0) fprintf(fr_log_fp, "\n"); } #endif /* * Send the EAP data, WITHOUT the header. */ (tls_session->record_plus)(&tls_session->clean_in, vp->vp_octets + EAP_HEADER_LEN, vp->length - EAP_HEADER_LEN); /* * Send the rest of the EAP data. */ for (vp = vp->next; vp != NULL; vp = vp->next) { (tls_session->record_plus)(&tls_session->clean_in, vp->vp_octets, vp->length); } tls_handshake_send(request, tls_session); return 1; } /* * See if there's a TLV in the response. */ static int eappeap_check_tlv(REQUEST *request, const uint8_t *data, size_t data_len) { const eap_packet_t *eap_packet = (const eap_packet_t *) data; if (data_len < 11) return 0; /* * Look for success or failure. */ if ((eap_packet->code == PW_EAP_RESPONSE) && (eap_packet->data[0] == PW_EAP_TLV)) { if (data[10] == EAP_TLV_SUCCESS) { return 1; } if (data[10] == EAP_TLV_FAILURE) { RDEBUG2("Client rejected our response. The password is probably incorrect."); return 0; } } RDEBUG("Unknown TLV %02x", data[10]); return 0; } /* * Use a reply packet to determine what to do. */ static int process_reply(EAP_HANDLER *handler, tls_session_t *tls_session, REQUEST *request, RADIUS_PACKET *reply) { int rcode = RLM_MODULE_REJECT; VALUE_PAIR *vp; peap_tunnel_t *t = tls_session->opaque; if ((debug_flag > 0) && fr_log_fp) { RDEBUG("Got tunneled reply RADIUS code %s", fr_packet_codes[reply->code]); debug_pair_list(reply->vps); } switch (reply->code) { case PW_AUTHENTICATION_ACK: RDEBUG2("Tunneled authentication was successful."); t->status = PEAP_STATUS_SENT_TLV_SUCCESS; eappeap_success(handler, tls_session); rcode = RLM_MODULE_HANDLED; /* * If we've been told to use the attributes from * the reply, then do so. * * WARNING: This may leak information about the * tunneled user! */ if (t->use_tunneled_reply) { RDEBUG2("Saving tunneled attributes for later"); /* * Clean up the tunneled reply. */ pairdelete(&reply->vps, PW_PROXY_STATE); pairdelete(&reply->vps, PW_EAP_MESSAGE); pairdelete(&reply->vps, PW_MESSAGE_AUTHENTICATOR); /* * Delete MPPE keys & encryption policy. We don't * want these here. */ pairdelete(&reply->vps, ((311 << 16) | 7)); pairdelete(&reply->vps, ((311 << 16) | 8)); pairdelete(&reply->vps, ((311 << 16) | 16)); pairdelete(&reply->vps, ((311 << 16) | 17)); t->accept_vps = reply->vps; reply->vps = NULL; } break; case PW_AUTHENTICATION_REJECT: RDEBUG2("Tunneled authentication was rejected."); t->status = PEAP_STATUS_SENT_TLV_FAILURE; eappeap_failure(handler, tls_session); rcode = RLM_MODULE_HANDLED; break; case PW_ACCESS_CHALLENGE: RDEBUG2("Got tunneled Access-Challenge"); /* * Keep the State attribute, if necessary. * * Get rid of the old State, too. */ pairfree(&t->state); pairmove2(&t->state, &(reply->vps), PW_STATE); /* * PEAP takes only EAP-Message attributes inside * of the tunnel. Any Reply-Message in the * Access-Challenge is ignored. */ vp = NULL; pairmove2(&vp, &(reply->vps), PW_EAP_MESSAGE); /* * Handle EAP-MSCHAP-V2, where Access-Accept's * from the home server may contain MS-CHAP-Success, * which the module turns into challenges, so that * the client may respond to the challenge with * an "ack" packet. */ if (t->home_access_accept && t->use_tunneled_reply) { RDEBUG2("Saving tunneled attributes for later"); /* * Clean up the tunneled reply. */ pairdelete(&reply->vps, PW_PROXY_STATE); pairdelete(&reply->vps, PW_MESSAGE_AUTHENTICATOR); t->accept_vps = reply->vps; reply->vps = NULL; } /* * Handle the ACK, by tunneling any necessary reply * VP's back to the client. */ if (vp) { vp2eap(request, tls_session, vp); pairfree(&vp); } rcode = RLM_MODULE_HANDLED; break; default: RDEBUG2("Unknown RADIUS packet type %d: rejecting tunneled user", reply->code); rcode = RLM_MODULE_REJECT; break; } return rcode; } #ifdef WITH_PROXY /* * Do post-proxy processing, */ static int eappeap_postproxy(EAP_HANDLER *handler, void *data) { int rcode; tls_session_t *tls_session = (tls_session_t *) data; REQUEST *fake, *request = handler->request; RDEBUG2("Passing reply from proxy back into the tunnel."); /* * If there was a fake request associated with the proxied * request, do more processing of it. */ fake = (REQUEST *) request_data_get(handler->request, handler->request->proxy, REQUEST_DATA_EAP_MSCHAP_TUNNEL_CALLBACK); /* * Do the callback, if it exists, and if it was a success. */ if (fake && (handler->request->proxy_reply->code == PW_AUTHENTICATION_ACK)) { peap_tunnel_t *t = tls_session->opaque; t->home_access_accept = TRUE; /* * Terrible hacks. */ rad_assert(fake->packet == NULL); fake->packet = request->proxy; fake->packet->src_ipaddr = request->packet->src_ipaddr; request->proxy = NULL; rad_assert(fake->reply == NULL); fake->reply = request->proxy_reply; request->proxy_reply = NULL; if ((debug_flag > 0) && fr_log_fp) { fprintf(fr_log_fp, "server %s {\n", fake->server); } /* * Perform a post-auth stage, which will get the EAP * handler, too... */ fake->options &= ~RAD_REQUEST_OPTION_PROXY_EAP; RDEBUG2("Passing reply back for EAP-MS-CHAP-V2"); rcode = module_post_proxy(0, fake); /* * FIXME: If rcode returns fail, do something * intelligent... */ rcode = rad_postauth(fake); if ((debug_flag > 0) && fr_log_fp) { fprintf(fr_log_fp, "} # server %s\n", fake->server); RDEBUG("Final reply from tunneled session code %s", fr_packet_codes[fake->reply->code]); debug_pair_list(fake->reply->vps); } /* * Terrible hacks. */ request->proxy = fake->packet; fake->packet = NULL; request->proxy_reply = fake->reply; fake->reply = NULL; /* * And we're done with this request. */ switch (rcode) { case RLM_MODULE_FAIL: request_free(&fake); eaptls_fail(handler, 0); return 0; break; default: /* Don't Do Anything */ RDEBUG2("Got reply %d", request->proxy_reply->code); break; } } request_free(&fake); /* robust if fake == NULL */ /* * If there was no EAP-Message in the reply packet, then * we know that we're supposed to re-run the "authenticate" * stage, in order to get the right kind of handling... */ /* * Process the reply from the home server. */ rcode = process_reply(handler, tls_session, handler->request, handler->request->proxy_reply); /* * The proxy code uses the reply from the home server as * the basis for the reply to the NAS. We don't want that, * so we toss it, after we've had our way with it. */ pairfree(&handler->request->proxy_reply->vps); switch (rcode) { case RLM_MODULE_REJECT: RDEBUG2("Reply was rejected"); eaptls_fail(handler, 0); return 0; case RLM_MODULE_HANDLED: RDEBUG2("Reply was handled"); eaptls_request(handler->eap_ds, tls_session); return 1; case RLM_MODULE_OK: RDEBUG2("Reply was OK"); /* * Success: Automatically return MPPE keys. */ return eaptls_success(handler, 0); default: RDEBUG2("Reply was unknown."); break; } eaptls_fail(handler, 0); return 0; } /* * Free a request. */ static void my_request_free(void *data) { REQUEST *request = (REQUEST *)data; request_free(&request); } #endif static const char *peap_state(peap_tunnel_t *t) { switch (t->status) { case PEAP_STATUS_TUNNEL_ESTABLISHED: return "TUNNEL ESTABLISHED"; case PEAP_STATUS_WAIT_FOR_SOH_RESPONSE: return "WAITING FOR SOH RESPONSE"; case PEAP_STATUS_INNER_IDENTITY_REQ_SENT: return "WAITING FOR INNER IDENTITY"; case PEAP_STATUS_SENT_TLV_SUCCESS: return "send tlv success"; case PEAP_STATUS_SENT_TLV_FAILURE: return "send tlv failure"; case PEAP_STATUS_PHASE2_INIT: return "phase2_init"; case PEAP_STATUS_PHASE2: return "phase2"; default: break; } return "?"; } static void print_tunneled_data(const uint8_t *data, size_t data_len) { size_t i; if ((debug_flag > 2) && fr_log_fp) { for (i = 0; i < data_len; i++) { if ((i & 0x0f) == 0) fprintf(fr_log_fp, " PEAP tunnel data in %04x: ", i); fprintf(fr_log_fp, "%02x ", data[i]); if ((i & 0x0f) == 0x0f) fprintf(fr_log_fp, "\n"); } if ((data_len & 0x0f) != 0) fprintf(fr_log_fp, "\n"); } } /* * Process the pseudo-EAP contents of the tunneled data. */ int eappeap_process(EAP_HANDLER *handler, tls_session_t *tls_session) { peap_tunnel_t *t = tls_session->opaque; REQUEST *fake; VALUE_PAIR *vp; int rcode = RLM_MODULE_REJECT; const uint8_t *data; unsigned int data_len; REQUEST *request = handler->request; EAP_DS *eap_ds = handler->eap_ds; /* * Just look at the buffer directly, without doing * record_minus. This lets us avoid another data copy. */ data_len = tls_session->clean_out.used; tls_session->clean_out.used = 0; data = tls_session->clean_out.data; RDEBUG2("Peap state %s", peap_state(t)); if ((t->status != PEAP_STATUS_TUNNEL_ESTABLISHED) && !eapmessage_verify(request, data, data_len)) { RDEBUG2("FAILED processing PEAP: Tunneled data is invalid."); if (debug_flag > 2) print_tunneled_data(data, data_len); return RLM_MODULE_REJECT; } switch (t->status) { case PEAP_STATUS_TUNNEL_ESTABLISHED: /* FIXME: should be no data in the buffer here, check & assert? */ if (SSL_session_reused(tls_session->ssl)) { RDEBUG2("Skipping Phase2 because of session resumption"); t->session_resumption_state = PEAP_RESUMPTION_YES; if (t->soh) { t->status = PEAP_STATUS_WAIT_FOR_SOH_RESPONSE; RDEBUG2("Requesting SoH from client"); eappeap_soh(handler, tls_session); return RLM_MODULE_HANDLED; } /* we're good, send success TLV */ t->status = PEAP_STATUS_SENT_TLV_SUCCESS; eappeap_success(handler, tls_session); } else { /* send an identity request */ t->session_resumption_state = PEAP_RESUMPTION_NO; t->status = PEAP_STATUS_INNER_IDENTITY_REQ_SENT; eappeap_identity(handler, tls_session); } return RLM_MODULE_HANDLED; case PEAP_STATUS_INNER_IDENTITY_REQ_SENT: /* we're expecting an identity response */ if (data[0] != PW_EAP_IDENTITY) { RDEBUG("Expected EAP-Identity, got something else."); return RLM_MODULE_REJECT; } if (data_len >= sizeof(t->username->vp_strvalue)) { RDEBUG("EAP-Identity is too long"); return RLM_MODULE_REJECT; } /* * Save it for later. */ t->username = pairmake("User-Name", "", T_OP_EQ); rad_assert(t->username != NULL); memcpy(t->username->vp_strvalue, data + 1, data_len - 1); t->username->length = data_len - 1; t->username->vp_strvalue[t->username->length] = 0; RDEBUG("Got inner identity '%s'", t->username->vp_strvalue); if (t->soh) { t->status = PEAP_STATUS_WAIT_FOR_SOH_RESPONSE; RDEBUG2("Requesting SoH from client"); eappeap_soh(handler, tls_session); return RLM_MODULE_HANDLED; } t->status = PEAP_STATUS_PHASE2_INIT; break; case PEAP_STATUS_WAIT_FOR_SOH_RESPONSE: fake = request_alloc_fake(request); rad_assert(fake->packet->vps == NULL); fake->packet->vps = eapsoh_verify(request, data, data_len); setup_fake_request(request, fake, t); rad_assert(t->soh_virtual_server != NULL); fake->server = t->soh_virtual_server; RDEBUG("Processing SoH request"); debug_pair_list(fake->packet->vps); RDEBUG("server %s {", fake->server); rad_virtual_server(fake); RDEBUG("} # server %s", fake->server); RDEBUG("Got SoH reply"); debug_pair_list(fake->reply->vps); if (fake->reply->code != PW_AUTHENTICATION_ACK) { RDEBUG2("SoH was rejected"); request_free(&fake); t->status = PEAP_STATUS_SENT_TLV_FAILURE; eappeap_failure(handler, tls_session); return RLM_MODULE_HANDLED; } /* save the SoH VPs */ t->soh_reply_vps = fake->reply->vps; fake->reply->vps = NULL; request_free(&fake); if (t->session_resumption_state == PEAP_RESUMPTION_YES) { /* we're good, send success TLV */ t->status = PEAP_STATUS_SENT_TLV_SUCCESS; eappeap_success(handler, tls_session); return RLM_MODULE_HANDLED; } t->status = PEAP_STATUS_PHASE2_INIT; break; /* * If we authenticated the user, then it's OK. */ case PEAP_STATUS_SENT_TLV_SUCCESS: if (eappeap_check_tlv(request, data, data_len)) { RDEBUG2("Success"); return RLM_MODULE_OK; } /* * Otherwise, the client rejected the session * resumption. If the session is being re-used, * we need to do a full authentication. * * We do this by sending an EAP-Identity request * inside of the PEAP tunnel. */ if (t->session_resumption_state == PEAP_RESUMPTION_YES) { RDEBUG2("Client rejected session resumption. Re-starting full authentication"); /* * Mark session resumption status. */ t->status = PEAP_STATUS_INNER_IDENTITY_REQ_SENT; t->session_resumption_state = PEAP_RESUMPTION_NO; eappeap_identity(handler, tls_session); return RLM_MODULE_HANDLED; } RDEBUG2("We sent a success, but received something weird in return."); return RLM_MODULE_REJECT; /* * Damned if I know why the clients continue sending EAP * packets after we told them to f*ck off. */ case PEAP_STATUS_SENT_TLV_FAILURE: RDEBUG(" The users session was previously rejected: returning reject (again.)"); RDEBUG(" *** This means you need to read the PREVIOUS messages in the debug output"); RDEBUG(" *** to find out the reason why the user was rejected."); RDEBUG(" *** Look for \"reject\" or \"fail\". Those earlier messages will tell you."); RDEBUG(" *** what went wrong, and how to fix the problem."); return RLM_MODULE_REJECT; case PEAP_STATUS_PHASE2_INIT: RDEBUG("In state machine in phase2 init?"); case PEAP_STATUS_PHASE2: break; default: RDEBUG2("Unhandled state in peap"); return RLM_MODULE_REJECT; } fake = request_alloc_fake(request); rad_assert(fake->packet->vps == NULL); switch (t->status) { /* * If we're in PHASE2_INIT, the phase2 method hasn't been * sent an Identity packet yet; do so from the stored * username and this will kick off the phase2 eap method */ case PEAP_STATUS_PHASE2_INIT: { int len = t->username->length + EAP_HEADER_LEN + 1; t->status = PEAP_STATUS_PHASE2; vp = paircreate(PW_EAP_MESSAGE, PW_TYPE_OCTETS); vp->vp_octets[0] = PW_EAP_RESPONSE; vp->vp_octets[1] = eap_ds->response->id; vp->vp_octets[2] = (len >> 8) & 0xff; vp->vp_octets[3] = len & 0xff; vp->vp_octets[4] = PW_EAP_IDENTITY; if (len > sizeof(vp->vp_octets)) len = sizeof(vp->vp_octets); memcpy(vp->vp_octets + EAP_HEADER_LEN + 1, t->username->vp_strvalue, len - EAP_HEADER_LEN - 1); vp->length = len; pairadd(&fake->packet->vps, vp); if (t->default_eap_type != 0) { RDEBUG2("Setting default EAP type for tunneled EAP session."); vp = pairmake("EAP-Type", "0", T_OP_EQ); vp->vp_integer = t->default_eap_type; pairadd(&fake->config_items, vp); } break; } case PEAP_STATUS_PHASE2: fake->packet->vps = eap2vp(request, eap_ds, data, data_len); if (!fake->packet->vps) { request_free(&fake); RDEBUG2("Unable to convert tunneled EAP packet to internal server data structures"); return PW_AUTHENTICATION_REJECT; } break; default: RDEBUG("Invalid state change in PEAP."); return PW_AUTHENTICATION_REJECT; } if ((debug_flag > 0) && fr_log_fp) { RDEBUG("Got tunneled request"); debug_pair_list(fake->packet->vps); fprintf(fr_log_fp, "server %s {\n", (fake->server == NULL) ? "" : fake->server); } /* * Update other items in the REQUEST data structure. */ if (!t->username) { /* * There's no User-Name in the tunneled session, * so we add one here, by pulling it out of the * EAP-Identity packet. */ if ((data[0] == PW_EAP_IDENTITY) && (data_len > 1)) { t->username = pairmake("User-Name", "", T_OP_EQ); rad_assert(t->username != NULL); memcpy(t->username->vp_strvalue, data + 1, data_len - 1); t->username->length = data_len - 1; t->username->vp_strvalue[t->username->length] = 0; DEBUG2(" PEAP: Got tunneled identity of %s", t->username->vp_strvalue); /* * If there's a default EAP type, * set it here. */ if (t->default_eap_type != 0) { DEBUG2(" PEAP: Setting default EAP type for tunneled EAP session."); vp = pairmake("EAP-Type", "0", T_OP_EQ); vp->vp_integer = t->default_eap_type; pairadd(&fake->config_items, vp); } } } /* else there WAS a t->username */ setup_fake_request(request, fake, t); if ((vp = pairfind(request->config_items, PW_VIRTUAL_SERVER)) != NULL) { fake->server = vp->vp_strvalue; } else if (t->virtual_server) { fake->server = t->virtual_server; } /* else fake->server == request->server */ if ((debug_flag > 0) && fr_log_fp) { fprintf(fr_log_fp, "Sending tunneled request\n"); debug_pair_list(fake->packet->vps); fprintf(fr_log_fp, "server %s {\n", (fake->server == NULL) ? "" : fake->server); } /* * Call authentication recursively, which will * do PAP, CHAP, MS-CHAP, etc. */ rad_virtual_server(fake); /* * Note that we don't do *anything* with the reply * attributes. */ if ((debug_flag > 0) && fr_log_fp) { fprintf(fr_log_fp, "} # server %s\n", (fake->server == NULL) ? "" : fake->server); RDEBUG("Got tunneled reply code %d", fake->reply->code); debug_pair_list(fake->reply->vps); } /* * Decide what to do with the reply. */ switch (fake->reply->code) { case 0: /* No reply code, must be proxied... */ #ifdef WITH_PROXY vp = pairfind(fake->config_items, PW_PROXY_TO_REALM); if (vp) { eap_tunnel_data_t *tunnel; /* * The tunneled request was NOT handled, * it has to be proxied. This means that * the "authenticate" stage was never * performed. * * If we are told to NOT proxy the * tunneled request as EAP, then this * means that we've got to decode it, * which means that we MUST run the * "authenticate" portion by hand, here. * * Once the tunneled EAP session is ALMOST * done, THEN we proxy it... */ if (!t->proxy_tunneled_request_as_eap) { fake->options |= RAD_REQUEST_OPTION_PROXY_EAP; /* * Hmm... should we check for * Auth-Type & EAP-Message here? */ /* * Run the EAP authentication. */ DEBUG2(" PEAP: Calling authenticate in order to initiate tunneled EAP session."); rcode = module_authenticate(PW_AUTHTYPE_EAP, fake); if (rcode == RLM_MODULE_OK) { /* * Authentication succeeded! Rah! */ fake->reply->code = PW_AUTHENTICATION_ACK; goto do_process; } if (rcode != RLM_MODULE_HANDLED) { DEBUG2(" PEAP: Can't handle the return code %d", rcode); rcode = RLM_MODULE_REJECT; goto done; } /* * The module decided it wasn't * done. Handle it like normal. */ if ((fake->options & RAD_REQUEST_OPTION_PROXY_EAP) == 0) { DEBUG2(" PEAP: Cancelling proxy to realm %s until the tunneled EAP session has been established", vp->vp_strvalue); goto do_process; } /* * The module has decoded the * EAP-Message into another set * of attributes. */ pairdelete(&fake->packet->vps, PW_EAP_MESSAGE); } DEBUG2(" PEAP: Tunneled authentication will be proxied to %s", vp->vp_strvalue); /* * Tell the original request that it's going * to be proxied. */ pairmove2(&(request->config_items), &(fake->config_items), PW_PROXY_TO_REALM); /* * Seed the proxy packet with the * tunneled request. */ rad_assert(request->proxy == NULL); request->proxy = fake->packet; memset(&request->proxy->src_ipaddr, 0, sizeof(request->proxy->src_ipaddr)); memset(&request->proxy->dst_ipaddr, 0, sizeof(request->proxy->dst_ipaddr)); request->proxy->src_port = 0; request->proxy->dst_port = 0; fake->packet = NULL; rad_free(&fake->reply); fake->reply = NULL; /* * Set up the callbacks for the tunnel */ tunnel = rad_malloc(sizeof(*tunnel)); memset(tunnel, 0, sizeof(*tunnel)); tunnel->tls_session = tls_session; tunnel->callback = eappeap_postproxy; /* * Associate the callback with the request. */ rcode = request_data_add(request, request->proxy, REQUEST_DATA_EAP_TUNNEL_CALLBACK, tunnel, free); rad_assert(rcode == 0); /* * We're not proxying it as EAP, so we've got * to do the callback later. */ if ((fake->options & RAD_REQUEST_OPTION_PROXY_EAP) != 0) { DEBUG2(" PEAP: Remembering to do EAP-MS-CHAP-V2 post-proxy."); /* * rlm_eap.c has taken care of associating * the handler with the fake request. * * So we associate the fake request with * this request. */ rcode = request_data_add(request, request->proxy, REQUEST_DATA_EAP_MSCHAP_TUNNEL_CALLBACK, fake, my_request_free); rad_assert(rcode == 0); /* * Do NOT free the fake request! */ return RLM_MODULE_UPDATED; } /* * Didn't authenticate the packet, but * we're proxying it. */ rcode = RLM_MODULE_UPDATED; } else #endif /* WITH_PROXY */ { DEBUG2(" PEAP: Unknown RADIUS packet type %d: rejecting tunneled user", fake->reply->code); rcode = RLM_MODULE_REJECT; } break; default: do_process: rcode = process_reply(handler, tls_session, request, fake->reply); break; } done: request_free(&fake); return rcode; } static int setup_fake_request(REQUEST *request, REQUEST *fake, peap_tunnel_t *t) { VALUE_PAIR *vp; /* * Tell the request that it's a fake one. */ vp = pairmake("Freeradius-Proxied-To", "127.0.0.1", T_OP_EQ); if (vp) { pairadd(&fake->packet->vps, vp); } if (t->username) { vp = paircopy(t->username); pairadd(&fake->packet->vps, vp); fake->username = pairfind(fake->packet->vps, PW_USER_NAME); RDEBUG2("Setting User-Name to %s", fake->username->vp_strvalue); } else { RDEBUG2("No tunnel username (SSL resumption?)"); } /* * Add the State attribute, too, if it exists. */ if (t->state) { vp = paircopy(t->state); if (vp) pairadd(&fake->packet->vps, vp); } /* * If this is set, we copy SOME of the request attributes * from outside of the tunnel to inside of the tunnel. * * We copy ONLY those attributes which do NOT already * exist in the tunneled request. * * This code is copied from ../rlm_eap_ttls/ttls.c */ if (t->copy_request_to_tunnel) { VALUE_PAIR *copy; for (vp = request->packet->vps; vp != NULL; vp = vp->next) { /* * The attribute is a server-side thingy, * don't copy it. */ if ((vp->attribute > 255) && (((vp->attribute >> 16) & 0xffff) == 0)) { continue; } /* * The outside attribute is already in the * tunnel, don't copy it. * * This works for BOTH attributes which * are originally in the tunneled request, * AND attributes which are copied there * from below. */ if (pairfind(fake->packet->vps, vp->attribute)) { continue; } /* * Some attributes are handled specially. */ switch (vp->attribute) { /* * NEVER copy Message-Authenticator, * EAP-Message, or State. They're * only for outside of the tunnel. */ case PW_USER_NAME: case PW_USER_PASSWORD: case PW_CHAP_PASSWORD: case PW_CHAP_CHALLENGE: case PW_PROXY_STATE: case PW_MESSAGE_AUTHENTICATOR: case PW_EAP_MESSAGE: case PW_STATE: continue; break; /* * By default, copy it over. */ default: break; } /* * Don't copy from the head, we've already * checked it. */ copy = paircopy2(vp, vp->attribute); pairadd(&fake->packet->vps, copy); } } return 0; } freeradius-server/src/modules/rlm_eap/types/rlm_eap_peap/rlm_eap_peap.c000066400000000000000000000204621257552170400267650ustar00rootroot00000000000000/* * rlm_eap_peap.c contains the interfaces that are called from eap * * Version: $Id$ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2003 Alan DeKok * Copyright 2006 The FreeRADIUS server project */ #include RCSID("$Id$") #include #include "eap_peap.h" typedef struct rlm_eap_peap_t { /* * Default tunneled EAP type */ char *default_eap_type_name; int default_eap_type; /* * Use the reply attributes from the tunneled session in * the non-tunneled reply to the client. */ int use_tunneled_reply; /* * Use SOME of the request attributes from outside of the * tunneled session in the tunneled request */ int copy_request_to_tunnel; #ifdef WITH_PROXY /* * Proxy tunneled session as EAP, or as de-capsulated * protocol. */ int proxy_tunneled_request_as_eap; #endif /* * Virtual server for inner tunnel session. */ char *virtual_server; /* * Do we do SoH request? */ int soh; char *soh_virtual_server; } rlm_eap_peap_t; static CONF_PARSER module_config[] = { { "default_eap_type", PW_TYPE_STRING_PTR, offsetof(rlm_eap_peap_t, default_eap_type_name), NULL, "mschapv2" }, { "copy_request_to_tunnel", PW_TYPE_BOOLEAN, offsetof(rlm_eap_peap_t, copy_request_to_tunnel), NULL, "no" }, { "use_tunneled_reply", PW_TYPE_BOOLEAN, offsetof(rlm_eap_peap_t, use_tunneled_reply), NULL, "no" }, #ifdef WITH_PROXY { "proxy_tunneled_request_as_eap", PW_TYPE_BOOLEAN, offsetof(rlm_eap_peap_t, proxy_tunneled_request_as_eap), NULL, "yes" }, #endif { "virtual_server", PW_TYPE_STRING_PTR, offsetof(rlm_eap_peap_t, virtual_server), NULL, NULL }, { "soh", PW_TYPE_BOOLEAN, offsetof(rlm_eap_peap_t, soh), NULL, "no" }, { "soh_virtual_server", PW_TYPE_STRING_PTR, offsetof(rlm_eap_peap_t, soh_virtual_server), NULL, NULL }, { NULL, -1, 0, NULL, NULL } /* end the list */ }; /* * Detach the module. */ static int eappeap_detach(void *arg) { rlm_eap_peap_t *inst = (rlm_eap_peap_t *) arg; free(inst); return 0; } /* * Attach the module. */ static int eappeap_attach(CONF_SECTION *cs, void **instance) { rlm_eap_peap_t *inst; inst = malloc(sizeof(*inst)); if (!inst) { radlog(L_ERR, "rlm_eap_peap: out of memory"); return -1; } memset(inst, 0, sizeof(*inst)); /* * Parse the configuration attributes. */ if (cf_section_parse(cs, inst, module_config) < 0) { eappeap_detach(inst); return -1; } if (inst->soh && !inst->soh_virtual_server) { radlog(L_ERR, "rlm_eap_peap: You MUST specify a value for \"soh_virtual_server\""); eappeap_detach(inst); return -1; } /* * Convert the name to an integer, to make it easier to * handle. */ inst->default_eap_type = eaptype_name2type(inst->default_eap_type_name); if (inst->default_eap_type < 0) { radlog(L_ERR, "rlm_eap_peap: Unknown EAP type %s", inst->default_eap_type_name); eappeap_detach(inst); return -1; } *instance = inst; return 0; } /* * Free the PEAP per-session data */ static void peap_free(void *p) { peap_tunnel_t *t = (peap_tunnel_t *) p; if (!t) return; pairfree(&t->username); pairfree(&t->state); pairfree(&t->accept_vps); pairfree(&t->soh_reply_vps); free(t); } /* * Free the PEAP per-session data */ static peap_tunnel_t *peap_alloc(rlm_eap_peap_t *inst) { peap_tunnel_t *t; t = rad_malloc(sizeof(*t)); memset(t, 0, sizeof(*t)); t->default_eap_type = inst->default_eap_type; t->copy_request_to_tunnel = inst->copy_request_to_tunnel; t->use_tunneled_reply = inst->use_tunneled_reply; #ifdef WITH_PROXY t->proxy_tunneled_request_as_eap = inst->proxy_tunneled_request_as_eap; #endif t->virtual_server = inst->virtual_server; t->soh = inst->soh; t->soh_virtual_server = inst->soh_virtual_server; t->session_resumption_state = PEAP_RESUMPTION_MAYBE; return t; } /* * Do authentication, by letting EAP-TLS do most of the work. */ static int eappeap_authenticate(void *arg, EAP_HANDLER *handler) { int rcode; eaptls_status_t status; rlm_eap_peap_t *inst = (rlm_eap_peap_t *) arg; tls_session_t *tls_session = (tls_session_t *) handler->opaque; peap_tunnel_t *peap = tls_session->opaque; REQUEST *request = handler->request; /* * Session resumption requires the storage of data, so * allocate it if it doesn't already exist. */ if (!tls_session->opaque) { peap = tls_session->opaque = peap_alloc(inst); tls_session->free_opaque = peap_free; } status = eaptls_process(handler); RDEBUG2("eaptls_process returned %d\n", status); switch (status) { /* * EAP-TLS handshake was successful, tell the * client to keep talking. * * If this was EAP-TLS, we would just return * an EAP-TLS-Success packet here. */ case EAPTLS_SUCCESS: RDEBUG2("EAPTLS_SUCCESS"); peap->status = PEAP_STATUS_TUNNEL_ESTABLISHED; break; /* * The TLS code is still working on the TLS * exchange, and it's a valid TLS request. * do nothing. */ case EAPTLS_HANDLED: /* * FIXME: If the SSL session is established, grab the state * and EAP id from the inner tunnel, and update it with * the expected EAP id! */ RDEBUG2("EAPTLS_HANDLED"); return 1; /* * Handshake is done, proceed with decoding tunneled * data. */ case EAPTLS_OK: RDEBUG2("EAPTLS_OK"); break; /* * Anything else: fail. */ default: RDEBUG2("EAPTLS_OTHERS"); return 0; } /* * Session is established, proceed with decoding * tunneled data. */ RDEBUG2("Session established. Decoding tunneled attributes."); /* * We may need PEAP data associated with the session, so * allocate it here, if it wasn't already alloacted. */ if (!tls_session->opaque) { tls_session->opaque = peap_alloc(inst); tls_session->free_opaque = peap_free; } /* * Process the PEAP portion of the request. */ rcode = eappeap_process(handler, tls_session); switch (rcode) { case RLM_MODULE_REJECT: eaptls_fail(handler, 0); return 0; case RLM_MODULE_HANDLED: eaptls_request(handler->eap_ds, tls_session); return 1; case RLM_MODULE_OK: /* * Move the saved VP's from the Access-Accept to * our Access-Accept. */ peap = tls_session->opaque; if (peap->soh_reply_vps) { RDEBUG2("Using saved attributes from the SoH reply"); debug_pair_list(peap->soh_reply_vps); pairadd(&handler->request->reply->vps, peap->soh_reply_vps); peap->soh_reply_vps = NULL; } if (peap->accept_vps) { RDEBUG2("Using saved attributes from the original Access-Accept"); debug_pair_list(peap->accept_vps); pairadd(&handler->request->reply->vps, peap->accept_vps); peap->accept_vps = NULL; } /* * Success: Automatically return MPPE keys. */ return eaptls_success(handler, 0); /* * No response packet, MUST be proxying it. * The main EAP module will take care of discovering * that the request now has a "proxy" packet, and * will proxy it, rather than returning an EAP packet. */ case RLM_MODULE_UPDATED: #ifdef WITH_PROXY rad_assert(handler->request->proxy != NULL); #endif return 1; break; default: break; } eaptls_fail(handler, 0); return 0; } /* * The module name should be the only globally exported symbol. * That is, everything else should be 'static'. */ EAP_TYPE rlm_eap_peap = { "eap_peap", eappeap_attach, /* attach */ /* * Note! There is NO eappeap_initate() function, as the * main EAP module takes care of calling * eaptls_initiate(). * * This is because PEAP is a protocol on top of TLS, so * before we need to do PEAP, we've got to initiate a TLS * session. */ NULL, /* Start the initial request */ NULL, /* authorization */ eappeap_authenticate, /* authentication */ eappeap_detach /* detach */ }; freeradius-server/src/modules/rlm_eap/types/rlm_eap_sim/000077500000000000000000000000001257552170400240345ustar00rootroot00000000000000freeradius-server/src/modules/rlm_eap/types/rlm_eap_sim/Makefile000066400000000000000000000004321257552170400254730ustar00rootroot00000000000000# # Makefile # # Version: $Id$ # TARGET = rlm_eap_sim SRCS = rlm_eap_sim.c HEADERS = RLM_CFLAGS = -I../.. -I../../libeap RLM_LIBS = ../../libeap/$(LIBPREFIX)freeradius-eap.la RLM_INSTALL = RLM_DIR=../../ include ${RLM_DIR}../rules.mak $(LT_OBJS): $(HEADERS) freeradius-server/src/modules/rlm_eap/types/rlm_eap_sim/rlm_eap_sim.c000066400000000000000000000402421257552170400264710ustar00rootroot00000000000000/* * rlm_eap_sim.c Handles that are called from eap for SIM * * The development of the EAP/SIM support was funded by Internet Foundation * Austria (http://www.nic.at/ipa). * * Version: $Id$ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2003 Michael Richardson * Copyright 2003,2006 The FreeRADIUS server project * */ #include RCSID("$Id$") #include #include #include #include "../../eap.h" #include "eap_types.h" #include "eap_sim.h" #include struct eap_sim_server_state { enum eapsim_serverstates state; struct eapsim_keys keys; int sim_id; }; /* * Add value pair to reply */ static void add_reply(VALUE_PAIR** vp, const char* name, const uint8_t *value, size_t len) { VALUE_PAIR *reply_attr; reply_attr = pairmake(name, "", T_OP_EQ); if (!reply_attr) { DEBUG("rlm_eap_sim: " "add_reply failed to create attribute %s: %s\n", name, fr_strerror()); return; } memcpy(reply_attr->vp_strvalue, value, len); reply_attr->length = len; pairadd(vp, reply_attr); } static void eap_sim_state_free(void *opaque) { struct eap_sim_server_state *ess = (struct eap_sim_server_state *)opaque; if (!ess) return; free(ess); } /* * build a reply to be sent. */ static int eap_sim_compose(EAP_HANDLER *handler) { /* we will set the ID on requests, since we have to HMAC it */ handler->eap_ds->set_request_id = 1; return map_eapsim_basictypes(handler->request->reply, handler->eap_ds->request); } static int eap_sim_sendstart(EAP_HANDLER *handler) { VALUE_PAIR **vps, *newvp; uint16_t *words; struct eap_sim_server_state *ess; rad_assert(handler->request != NULL); rad_assert(handler->request->reply); ess = (struct eap_sim_server_state *)handler->opaque; /* these are the outgoing attributes */ vps = &handler->request->reply->vps; rad_assert(vps != NULL); /* * add appropriate TLVs for the EAP things we wish to send. */ /* the version list. We support only version 1. */ newvp = paircreate(ATTRIBUTE_EAP_SIM_BASE+PW_EAP_SIM_VERSION_LIST, PW_TYPE_OCTETS); words = (uint16_t *)newvp->vp_strvalue; newvp->length = 3*sizeof(uint16_t); words[0] = htons(1*sizeof(uint16_t)); words[1] = htons(EAP_SIM_VERSION); words[2] = 0; pairadd(vps, newvp); /* set the EAP_ID - new value */ newvp = paircreate(ATTRIBUTE_EAP_ID, PW_TYPE_INTEGER); newvp->vp_integer = ess->sim_id++; pairreplace(vps, newvp); /* record it in the ess */ ess->keys.versionlistlen = 2; memcpy(ess->keys.versionlist, words+1, ess->keys.versionlistlen); /* the ANY_ID attribute. We do not support re-auth or pseudonym */ newvp = paircreate(ATTRIBUTE_EAP_SIM_BASE+PW_EAP_SIM_FULLAUTH_ID_REQ, PW_TYPE_OCTETS); newvp->length = 2; newvp->vp_strvalue[0]=0; newvp->vp_strvalue[0]=1; pairadd(vps, newvp); /* the SUBTYPE, set to start. */ newvp = paircreate(ATTRIBUTE_EAP_SIM_SUBTYPE, PW_TYPE_INTEGER); newvp->vp_integer = eapsim_start; pairreplace(vps, newvp); return 1; } static int eap_sim_getchalans(VALUE_PAIR *vps, int chalno, struct eap_sim_server_state *ess) { VALUE_PAIR *vp; rad_assert(chalno >= 0 && chalno < 3); vp = pairfind(vps, ATTRIBUTE_EAP_SIM_RAND1+chalno); if(vp == NULL) { /* bad, we can't find stuff! */ DEBUG2(" eap-sim can not find sim-challenge%d",chalno+1); return 0; } if(vp->length != EAPSIM_RAND_SIZE) { DEBUG2(" eap-sim chal%d is not 8-bytes: %d", chalno+1, vp->length); return 0; } memcpy(ess->keys.rand[chalno], vp->vp_strvalue, EAPSIM_RAND_SIZE); vp = pairfind(vps, ATTRIBUTE_EAP_SIM_SRES1+chalno); if(vp == NULL) { /* bad, we can't find stuff! */ DEBUG2(" eap-sim can not find sim-sres%d",chalno+1); return 0; } if(vp->length != EAPSIM_SRES_SIZE) { DEBUG2(" eap-sim sres%d is not 16-bytes: %d", chalno+1, vp->length); return 0; } memcpy(ess->keys.sres[chalno], vp->vp_strvalue, EAPSIM_SRES_SIZE); vp = pairfind(vps, ATTRIBUTE_EAP_SIM_KC1+chalno); if(vp == NULL) { /* bad, we can't find stuff! */ DEBUG2(" eap-sim can not find sim-kc%d",chalno+1); return 0; } if(vp->length != EAPSIM_Kc_SIZE) { DEBUG2(" eap-sim kc%d is not 8-bytes: %d", chalno+1, vp->length); return 0; } memcpy(ess->keys.Kc[chalno], vp->vp_strvalue, EAPSIM_Kc_SIZE); return 1; } /* * this code sends the challenge itself. * * Challenges will come from one of three places eventually: * * 1 from attributes like ATTRIBUTE_EAP_SIM_RANDx * (these might be retrived from a database) * * 2 from internally implemented SIM authenticators * (a simple one based upon XOR will be provided) * * 3 from some kind of SS7 interface. * * For now, they only come from attributes. * It might be that the best way to do 2/3 will be with a different * module to generate/calculate things. * */ static int eap_sim_sendchallenge(EAP_HANDLER *handler) { struct eap_sim_server_state *ess; VALUE_PAIR **invps, **outvps, *newvp; ess = (struct eap_sim_server_state *)handler->opaque; rad_assert(handler->request != NULL); rad_assert(handler->request->reply); /* invps is the data from the client. * but, this is for non-protocol data here. We should * already have consumed any client originated data. */ invps = &handler->request->packet->vps; /* outvps is the data to the client. */ outvps= &handler->request->reply->vps; if ((debug_flag > 0) && fr_log_fp) { fprintf(fr_log_fp, "+++> EAP-sim decoded packet:\n"); debug_pair_list(*invps); } /* okay, we got the challenges! Put them into an attribute */ newvp = paircreate(ATTRIBUTE_EAP_SIM_BASE+PW_EAP_SIM_RAND, PW_TYPE_OCTETS); memset(newvp->vp_strvalue, 0, 2); /* clear reserved bytes */ memcpy(newvp->vp_strvalue+2+EAPSIM_RAND_SIZE*0, ess->keys.rand[0], EAPSIM_RAND_SIZE); memcpy(newvp->vp_strvalue+2+EAPSIM_RAND_SIZE*1, ess->keys.rand[1], EAPSIM_RAND_SIZE); memcpy(newvp->vp_strvalue+2+EAPSIM_RAND_SIZE*2, ess->keys.rand[2], EAPSIM_RAND_SIZE); newvp->length = 2+EAPSIM_RAND_SIZE*3; pairadd(outvps, newvp); /* set the EAP_ID - new value */ newvp = paircreate(ATTRIBUTE_EAP_ID, PW_TYPE_INTEGER); newvp->vp_integer = ess->sim_id++; pairreplace(outvps, newvp); /* make a copy of the identity */ newvp = pairfind(*invps, ATTRIBUTE_EAP_SIM_BASE + PW_EAP_SIM_IDENTITY); if (newvp) { ess->keys.identitylen = newvp->length; memcpy(ess->keys.identity, newvp->vp_octets, newvp->length); } else { ess->keys.identitylen = strlen(handler->identity); memcpy(ess->keys.identity, handler->identity, ess->keys.identitylen); } /* all set, calculate keys! */ eapsim_calculate_keys(&ess->keys); #ifdef EAP_SIM_DEBUG_PRF eapsim_dump_mk(&ess->keys); #endif /* * need to include an AT_MAC attribute so that it will get * calculated. The NONCE_MT and the MAC are both 16 bytes, so * we store the NONCE_MT in the MAC for the encoder, which * will pull it out before it does the operation. */ newvp = paircreate(ATTRIBUTE_EAP_SIM_BASE+PW_EAP_SIM_MAC, PW_TYPE_OCTETS); memcpy(newvp->vp_strvalue, ess->keys.nonce_mt, 16); newvp->length = 16; pairreplace(outvps, newvp); newvp = paircreate(ATTRIBUTE_EAP_SIM_KEY, PW_TYPE_OCTETS); memcpy(newvp->vp_strvalue, ess->keys.K_aut, 16); newvp->length = 16; pairreplace(outvps, newvp); /* the SUBTYPE, set to challenge. */ newvp = paircreate(ATTRIBUTE_EAP_SIM_SUBTYPE, PW_TYPE_INTEGER); newvp->vp_integer = eapsim_challenge; pairreplace(outvps, newvp); return 1; } #ifndef EAPTLS_MPPE_KEY_LEN #define EAPTLS_MPPE_KEY_LEN 32 #endif /* * this code sends the success message. * * the only work to be done is the add the appropriate SEND/RECV * radius attributes derived from the MSK. * */ static int eap_sim_sendsuccess(EAP_HANDLER *handler) { unsigned char *p; struct eap_sim_server_state *ess; VALUE_PAIR **outvps; VALUE_PAIR *newvp; /* outvps is the data to the client. */ outvps= &handler->request->reply->vps; ess = (struct eap_sim_server_state *)handler->opaque; /* set the EAP_ID - new value */ newvp = paircreate(ATTRIBUTE_EAP_ID, PW_TYPE_INTEGER); newvp->vp_integer = ess->sim_id++; pairreplace(outvps, newvp); p = ess->keys.msk; add_reply(outvps, "MS-MPPE-Recv-Key", p, EAPTLS_MPPE_KEY_LEN); p += EAPTLS_MPPE_KEY_LEN; add_reply(outvps, "MS-MPPE-Send-Key", p, EAPTLS_MPPE_KEY_LEN); return 1; } /* * run the server state machine. */ static void eap_sim_stateenter(EAP_HANDLER *handler, struct eap_sim_server_state *ess, enum eapsim_serverstates newstate) { switch(newstate) { case eapsim_server_start: /* * send the EAP-SIM Start message, listing the * versions that we support. */ eap_sim_sendstart(handler); break; case eapsim_server_challenge: /* * send the EAP-SIM Challenge message. */ eap_sim_sendchallenge(handler); break; case eapsim_server_success: /* * send the EAP Success message */ eap_sim_sendsuccess(handler); handler->eap_ds->request->code = PW_EAP_SUCCESS; break; default: /* * nothing to do for this transition. */ break; } ess->state = newstate; /* build the target packet */ eap_sim_compose(handler); } /* * Initiate the EAP-SIM session by starting the state machine * and initiating the state. */ static int eap_sim_initiate(void *type_data, EAP_HANDLER *handler) { struct eap_sim_server_state *ess; VALUE_PAIR *vp; VALUE_PAIR *outvps; time_t n; outvps = handler->request->reply->vps; type_data = type_data; /* shut up compiler */ vp = pairfind(outvps, ATTRIBUTE_EAP_SIM_RAND1); if(vp == NULL) { DEBUG2(" can not initiate sim, no RAND1 attribute"); return 0; } ess = malloc(sizeof(struct eap_sim_server_state)); if(ess == NULL) { DEBUG2(" no space for eap sim state"); return 0; } handler->opaque = ((void *)ess); handler->free_opaque = eap_sim_state_free; handler->stage = AUTHENTICATE; /* * save the keying material, because it could change on a subsequent * retrival. * */ if((eap_sim_getchalans(outvps, 0, ess) + eap_sim_getchalans(outvps, 1, ess) + eap_sim_getchalans(outvps, 2, ess)) != 3) { DEBUG2(" can not initiate sim, missing attributes"); return 0; } /* * this value doesn't have be strong, but it is good if it * is different now and then */ time(&n); ess->sim_id = (n & 0xff); eap_sim_stateenter(handler, ess, eapsim_server_start); return 1; } /* * process an EAP-Sim/Response/Start. * * verify that client chose a version, and provided a NONCE_MT, * and if so, then change states to challenge, and send the new * challenge, else, resend the Request/Start. * */ static int process_eap_sim_start(EAP_HANDLER *handler, VALUE_PAIR *vps) { VALUE_PAIR *nonce_vp, *selectedversion_vp; struct eap_sim_server_state *ess; uint16_t simversion; ess = (struct eap_sim_server_state *)handler->opaque; nonce_vp = pairfind(vps, ATTRIBUTE_EAP_SIM_BASE+PW_EAP_SIM_NONCE_MT); selectedversion_vp = pairfind(vps, ATTRIBUTE_EAP_SIM_BASE+PW_EAP_SIM_SELECTED_VERSION); if(nonce_vp == NULL || selectedversion_vp == NULL) { DEBUG2(" client did not select a version and send a NONCE"); eap_sim_stateenter(handler, ess, eapsim_server_start); return 1; } /* * okay, good got stuff that we need. Check the version we found. */ if(selectedversion_vp->length < 2) { DEBUG2(" EAP-Sim version field is too short."); return 0; } memcpy(&simversion, selectedversion_vp->vp_strvalue, sizeof(simversion)); simversion = ntohs(simversion); if(simversion != EAP_SIM_VERSION) { DEBUG2(" EAP-Sim version %d is unknown.", simversion); return 0; } /* record it for later keying */ memcpy(ess->keys.versionselect, selectedversion_vp->vp_strvalue, sizeof(ess->keys.versionselect)); /* * double check the nonce size. */ if(nonce_vp->length != 18) { DEBUG2(" EAP-Sim nonce_mt must be 16 bytes (+2 bytes padding), not %d", nonce_vp->length); return 0; } memcpy(ess->keys.nonce_mt, nonce_vp->vp_strvalue+2, 16); /* everything looks good, change states */ eap_sim_stateenter(handler, ess, eapsim_server_challenge); return 1; } /* * process an EAP-Sim/Response/Challenge * * verify that MAC that we received matches what we would have * calculated from the packet with the SRESx appended. * */ static int process_eap_sim_challenge(EAP_HANDLER *handler, VALUE_PAIR *vps) { struct eap_sim_server_state *ess; uint8_t srescat[EAPSIM_SRES_SIZE*3]; uint8_t calcmac[EAPSIM_CALCMAC_SIZE]; ess = (struct eap_sim_server_state *)handler->opaque; memcpy(srescat +(0*EAPSIM_SRES_SIZE), ess->keys.sres[0], EAPSIM_SRES_SIZE); memcpy(srescat +(1*EAPSIM_SRES_SIZE), ess->keys.sres[1], EAPSIM_SRES_SIZE); memcpy(srescat +(2*EAPSIM_SRES_SIZE), ess->keys.sres[2], EAPSIM_SRES_SIZE); /* verify the MAC, now that we have all the keys. */ if(eapsim_checkmac(vps, ess->keys.K_aut, srescat, sizeof(srescat), calcmac)) { DEBUG2("MAC check succeed\n"); } else { int i, j; char macline[20*3]; char *m = macline; j=0; for (i = 0; i < EAPSIM_CALCMAC_SIZE; i++) { if(j==4) { *m++ = '_'; j=0; } j++; sprintf(m, "%02x", calcmac[i]); m = m + strlen(m); } DEBUG2("calculated MAC (%s) did not match", macline); return 0; } /* everything looks good, change states */ eap_sim_stateenter(handler, ess, eapsim_server_success); return 1; } /* * Authenticate a previously sent challenge. */ static int eap_sim_authenticate(void *arg, EAP_HANDLER *handler) { struct eap_sim_server_state *ess; VALUE_PAIR *vp, *vps; enum eapsim_subtype subtype; int success; arg = arg; /* shut up compiler */ ess = (struct eap_sim_server_state *)handler->opaque; /* vps is the data from the client */ vps = handler->request->packet->vps; success= unmap_eapsim_basictypes(handler->request->packet, handler->eap_ds->response->type.data, handler->eap_ds->response->type.length); if(!success) { DEBUG("Failed to decode EAP-SIM"); return 0; } /* see what kind of message we have gotten */ if((vp = pairfind(vps, ATTRIBUTE_EAP_SIM_SUBTYPE)) == NULL) { DEBUG2(" no subtype attribute was created, message dropped"); return 0; } subtype = vp->vp_integer; /* * Client error supersedes anything else. */ if (subtype == eapsim_client_error) { DEBUG2("Client says error. Stopping!"); return 0; } switch(ess->state) { case eapsim_server_start: switch(subtype) { default: /* * pretty much anything else here is illegal, * so we will retransmit the request. */ eap_sim_stateenter(handler, ess, eapsim_server_start); return 1; case eapsim_start: /* * a response to our EAP-Sim/Request/Start! * */ return process_eap_sim_start(handler, vps); } break; case eapsim_server_challenge: switch(subtype) { default: /* * pretty much anything else here is illegal, * so we will retransmit the request. */ eap_sim_stateenter(handler, ess, eapsim_server_challenge); return 1; case eapsim_challenge: /* * a response to our EAP-Sim/Request/Challenge! * */ return process_eap_sim_challenge(handler, vps); } break; default: /* if we get into some other state, die, as this * is a coding error! */ DEBUG2(" illegal-unknown state reached in eap_sim_authenticate\n"); rad_assert(0 == 1); } return 0; } /* * The module name should be the only globally exported symbol. * That is, everything else should be 'static'. */ EAP_TYPE rlm_eap_sim = { "eap_sim", NULL, /* XXX attach */ eap_sim_initiate, /* Start the initial request */ NULL, /* XXX authorization */ eap_sim_authenticate, /* authentication */ NULL /* XXX detach */ }; freeradius-server/src/modules/rlm_eap/types/rlm_eap_tls/000077500000000000000000000000001257552170400240465ustar00rootroot00000000000000freeradius-server/src/modules/rlm_eap/types/rlm_eap_tls/.gitignore000066400000000000000000000000221257552170400260300ustar00rootroot00000000000000Makefile config.h freeradius-server/src/modules/rlm_eap/types/rlm_eap_tls/Makefile.in000066400000000000000000000005211257552170400261110ustar00rootroot00000000000000# # $Id$ # TARGET = @targetname@ SRCS = rlm_eap_tls.c HEADERS = rlm_eap_tls.h ../../eap.h ../../rlm_eap.h RLM_CFLAGS = -I../.. -I../../libeap @eap_tls_cflags@ RLM_LIBS = @eap_tls_ldflags@ ../../libeap/$(LIBPREFIX)freeradius-eap.la RLM_INSTALL = RLM_DIR=../../ include ${RLM_DIR}../rules.mak $(LT_OBJS): $(HEADERS) freeradius-server/src/modules/rlm_eap/types/rlm_eap_tls/config.h.in000066400000000000000000000010611257552170400260670ustar00rootroot00000000000000/* config.h.in. Generated from configure.in by autoheader. */ /* Define to 1 if you have the `EVP_sha256' function . */ #undef HAVE_OPENSSL_EVP_SHA256 /* 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 version of this package. */ #undef PACKAGE_VERSION freeradius-server/src/modules/rlm_eap/types/rlm_eap_tls/configure000077500000000000000000003200041257552170400257540ustar00rootroot00000000000000#! /bin/sh # From configure.in Revision. # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.61. # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, # 2002, 2003, 2004, 2005, 2006 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=: # 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 # PATH needs CR # 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 # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false 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.) as_nl=' ' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. 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 # Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # CDPATH. $as_unset CDPATH if test "x$CONFIG_SHELL" = x; then if (eval ":") 2>/dev/null; then as_have_required=yes else as_have_required=no fi if test $as_have_required = yes && (eval ": (as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=\$LINENO as_lineno_2=\$LINENO test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } ") 2> /dev/null; then : else as_candidate_shells= as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. case $as_dir in /*) for as_base in sh bash ksh sh5; do as_candidate_shells="$as_candidate_shells $as_dir/$as_base" done;; esac done IFS=$as_save_IFS for as_shell in $as_candidate_shells $SHELL; do # Try only shells that exist, to save several forks. if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { ("$as_shell") 2> /dev/null <<\_ASEOF 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 : _ASEOF }; then CONFIG_SHELL=$as_shell as_have_required=yes if { "$as_shell" 2> /dev/null <<\_ASEOF 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 : (as_func_return () { (exit $1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = "$1" ); then : else exitcode=1 echo positional parameters were not saved. fi test $exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } _ASEOF }; then break fi fi done if test "x$CONFIG_SHELL" != x; then for as_var in BASH_ENV ENV do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done export CONFIG_SHELL exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} fi if test $as_have_required = no; then echo This script requires a shell more modern than all the echo shells that I found on your system. Please install a echo modern shell, or manually run the script under such a echo shell if you do have one. { (exit 1); exit 1; } fi fi fi (eval "as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0") || { echo No shell found that supports shell functions. echo Please tell autoconf@gnu.org about your system, echo including any error possibly output before this echo message } as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, and appends # trailing '-' during substitution so that $LINENO is not a special # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # scripts with optimization help from Paolo Bonzini. 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" || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi 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 fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi 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=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, 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= SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME= PACKAGE_TARNAME= PACKAGE_VERSION= PACKAGE_STRING= PACKAGE_BUGREPORT= ac_unique_file="rlm_eap_tls.c" ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datarootdir datadir sysconfdir sharedstatedir localstatedir includedir oldincludedir docdir infodir htmldir dvidir pdfdir psdir libdir localedir mandir DEFS ECHO_C ECHO_N ECHO_T LIBS build_alias host_alias target_alias CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT eap_tls_ldflags eap_tls_cflags targetname LIBOBJS LTLIBOBJS' ac_subst_files='' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS' # Initialize some variables set by options. ac_init_help= ac_init_version=false # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *) ac_optarg=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_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` eval enable_$ac_feature=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_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` eval enable_$ac_feature=\$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_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/[-.]/_/g'` eval with_$ac_package=\$ac_optarg ;; -without-* | --without-*) ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/[-.]/_/g'` eval with_$ac_package=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 ;; -*) { echo "$as_me: error: unrecognized option: $ac_option Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && 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'` { echo "$as_me: error: missing argument to $ac_option" >&2 { (exit 1); exit 1; }; } fi # Be sure to have absolute directory names. 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 case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; } 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 echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || { echo "$as_me: error: Working directory cannot be determined" >&2 { (exit 1); exit 1; }; } test "X$ac_ls_di" = "X$ac_pwd_ls_di" || { echo "$as_me: error: pwd does not report name of working directory" >&2 { (exit 1); exit 1; }; } # 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 -- "$0" || $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$0" : 'X\(//\)[^/]' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X"$0" | 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 .." { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2 { (exit 1); exit 1; }; } pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures this package to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF _ACEOF fi if test -n "$ac_init_help"; then cat <<\_ACEOF Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-rlm-eap-tls-lib-dir directory for eap-tls libs --with-rlm-eap-tls-include-dir directory for eap-tls includes 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 C/C++/Objective C preprocessor flags, e.g. -I if you have headers in a nonstandard directory Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. _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" || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`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 echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF configure generated by GNU Autoconf 2.61 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 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 cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by $as_me, which was generated by GNU Autoconf 2.61. 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=. 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=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; 2) ac_configure_args1="$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 ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac done done $as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } $as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export 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 cat <<\_ASBOX ## ---------------- ## ## Cache variables. ## ## ---------------- ## _ASBOX 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_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( *) $as_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 cat <<\_ASBOX ## ----------------- ## ## Output variables. ## ## ----------------- ## _ASBOX echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then cat <<\_ASBOX ## ------------------- ## ## File substitutions. ## ## ------------------- ## _ASBOX echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then cat <<\_ASBOX ## ----------- ## ## confdefs.h. ## ## ----------- ## _ASBOX echo cat confdefs.h echo fi test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" 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'; { (exit 1); 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 # 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 # Let the site file select an alternate cache file if it wants to. # Prefer explicitly selected file to automatically selected ones. if test -n "$CONFIG_SITE"; then set x "$CONFIG_SITE" elif test "x$prefix" != xNONE; then set x "$prefix/share/config.site" "$prefix/etc/config.site" else set x "$ac_default_prefix/share/config.site" \ "$ac_default_prefix/etc/config.site" fi shift for ac_site_file do if test -r "$ac_site_file"; then { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" 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. if test -f "$cache_file"; then { echo "$as_me:$LINENO: loading cache $cache_file" >&5 echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { echo "$as_me:$LINENO: creating cache $cache_file" >&5 echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 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 { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 echo "$as_me: former value: $ac_old_val" >&2;} { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 echo "$as_me: current value: $ac_new_val" >&2;} ac_cache_corrupted=: fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`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. *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 echo "$as_me: error: changes in the environment can compromise the build" >&2;} { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} { (exit 1); exit 1; }; } 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 fail= eap_tls_ldflags= eap_tls_cflags= if test x$with_rlm_eap_tls != xno; then # Check whether --with-rlm-eap-tls-lib-dir was given. if test "${with_rlm_eap_tls_lib_dir+set}" = set; then withval=$with_rlm_eap_tls_lib_dir; eap_tls_ldflags="-L$withval" fi # Check whether --with-rlm-eap-tls-include-dir was given. if test "${with_rlm_eap_tls_include_dir+set}" = set; then withval=$with_rlm_eap_tls_include_dir; eap_tls_cflags="-I$withval" fi { echo "$as_me:$LINENO: checking for OpenSSL support" >&5 echo $ECHO_N "checking for OpenSSL support... $ECHO_C" >&6; } if test "x$OPENSSL_LIBS" != "x"; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } 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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}gcc" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="gcc" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}cc" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="$ac_prog" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&5 echo "$as_me: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } # Provide some information about the compiler. echo "$as_me:$LINENO: checking for C compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (ac_try="$ac_compiler --version >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -v >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -V >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out 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. { echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6; } ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # # List of possible output files, starting from the most likely. # The algorithm is not robust to junk in `.', hence go to wildcards (a.*) # only as a last resort. b.out is created by i960 compilers. ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out' # # The IRIX 6 linker writes into existing files which may not be # executable, retaining their permissions. Remove them first so a # subsequent execution test works. ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link_default") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; 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 | *.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 { echo "$as_me:$LINENO: result: $ac_file" >&5 echo "${ECHO_T}$ac_file" >&6; } if test -z "$ac_file"; then echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: C compiler cannot create executables See \`config.log' for more details." >&5 echo "$as_me: error: C compiler cannot create executables See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } fi ac_exeext=$ac_cv_exeext # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { echo "$as_me:$LINENO: checking whether the C compiler works" >&5 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6; } # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then if { ac_try='./$ac_file' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { echo "$as_me:$LINENO: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&5 echo "$as_me: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi fi fi { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } rm -f a.out a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; } { echo "$as_me:$LINENO: result: $cross_compiling" >&5 echo "${ECHO_T}$cross_compiling" >&6; } { echo "$as_me:$LINENO: checking for suffix of executables" >&5 echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; } if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; 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 | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest$ac_cv_exeext { echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 echo "${ECHO_T}$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT { echo "$as_me:$LINENO: checking for suffix of object files" >&5 echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; } if test "${ac_cv_objext+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; 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 ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 echo "${ECHO_T}$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; } if test "${ac_cv_c_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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 { echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; } GCC=`test $ac_compiler_gnu = yes && echo yes` ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CFLAGS="" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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 { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 echo "${ECHO_T}$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 { echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_c89+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_c89=$ac_arg else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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) { echo "$as_me:$LINENO: result: none needed" >&5 echo "${ECHO_T}none needed" >&6; } ;; xno) { echo "$as_me:$LINENO: result: unsupported" >&5 echo "${ECHO_T}unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;; 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_ac_Lib=`echo "ac_cv_lib_c $OPENSSL_LIBS''_EVP_sha256" | $as_tr_sh` { echo "$as_me:$LINENO: checking for EVP_sha256 in -lc $OPENSSL_LIBS" >&5 echo $ECHO_N "checking for EVP_sha256 in -lc $OPENSSL_LIBS... $ECHO_C" >&6; } if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lc $OPENSSL_LIBS $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any 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 EVP_sha256 (); int main () { return EVP_sha256 (); ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then eval "$as_ac_Lib=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Lib=no" fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi ac_res=`eval echo '${'$as_ac_Lib'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_Lib'}'` = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_OPENSSL_EVP_SHA256 1 _ACEOF else { echo "$as_me:$LINENO: WARNING: EVP_sha256 not found, may have issues wirh WiMAX certificates" >&5 echo "$as_me: WARNING: EVP_sha256 not found, may have issues wirh WiMAX certificates" >&2;} fi else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fail="OpenSSL" fi targetname=rlm_eap_tls else targetname= echo \*\*\* module rlm_eap_tls is disabled. fi if test x"$fail" != x""; then if test x"${enable_strict_dependencies}" = x"yes"; then { { echo "$as_me:$LINENO: error: set --without-rlm_eap_tls to disable it explicitly." >&5 echo "$as_me: error: set --without-rlm_eap_tls to disable it explicitly." >&2;} { (exit 1); exit 1; }; } else { echo "$as_me:$LINENO: WARNING: silently not building rlm_eap_tls." >&5 echo "$as_me: WARNING: silently not building rlm_eap_tls." >&2;} { echo "$as_me:$LINENO: WARNING: FAILURE: rlm_eap_tls requires: $fail." >&5 echo "$as_me: WARNING: FAILURE: rlm_eap_tls requires: $fail." >&2;} if test x"$headersuggestion" != x; then { echo "$as_me:$LINENO: WARNING: $headersuggestion" >&5 echo "$as_me: WARNING: $headersuggestion" >&2;} fi if test x"$libsuggestion" != x; then { echo "$as_me:$LINENO: WARNING: $libsuggestion" >&5 echo "$as_me: WARNING: $libsuggestion" >&2;} fi targetname="" fi fi ac_config_headers="$ac_config_headers config.h" unset ac_cv_env_LIBS_set unset ac_cv_env_LIBS_value ac_config_files="$ac_config_files 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_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( *) $as_unset $ac_var ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then test "x$cache_file" != "x/dev/null" && { echo "$as_me:$LINENO: updating cache $cache_file" >&5 echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 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= 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=`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. ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs : ${CONFIG_STATUS=./config.status} ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >$CONFIG_STATUS <<_ACEOF #! $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} _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ## --------------------- ## ## 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=: # 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 # PATH needs CR # 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 # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false 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.) as_nl=' ' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. 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 # Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # CDPATH. $as_unset CDPATH as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, and appends # trailing '-' during substitution so that $LINENO is not a special # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # scripts with optimization help from Paolo Bonzini. 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" || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi 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 fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi 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=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 # Save the log message, to keep $[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by $as_me, which was generated by GNU Autoconf 2.61. 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 cat >>$CONFIG_STATUS <<_ACEOF # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ config.status configured by $0, generated by GNU Autoconf 2.61, with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" Copyright (C) 2006 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' _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # If no file are specified by the user, then we need to provide default # value. By we need to know if files were specified by the user. 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=$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 ) echo "$ac_cs_version"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift CONFIG_FILES="$CONFIG_FILES $ac_optarg" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header { echo "$as_me: error: ambiguous option: $1 Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; };; --help | --hel | -h ) 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. -*) { echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *) ac_config_targets="$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 if \$ac_cs_recheck; then echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 CONFIG_SHELL=$SHELL export CONFIG_SHELL exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # 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" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= trap 'exit_status=$? { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status ' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || { echo "$me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } # # Set up the sed scripts for CONFIG_FILES section. # # No need to generate the scripts if there are no CONFIG_FILES. # This happens for instance when ./config.status config.h if test -n "$CONFIG_FILES"; then _ACEOF ac_delim='%!_!# ' for ac_last_try in false false false false false :; do cat >conf$$subs.sed <<_ACEOF SHELL!$SHELL$ac_delim PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim PACKAGE_NAME!$PACKAGE_NAME$ac_delim PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim PACKAGE_STRING!$PACKAGE_STRING$ac_delim PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim exec_prefix!$exec_prefix$ac_delim prefix!$prefix$ac_delim program_transform_name!$program_transform_name$ac_delim bindir!$bindir$ac_delim sbindir!$sbindir$ac_delim libexecdir!$libexecdir$ac_delim datarootdir!$datarootdir$ac_delim datadir!$datadir$ac_delim sysconfdir!$sysconfdir$ac_delim sharedstatedir!$sharedstatedir$ac_delim localstatedir!$localstatedir$ac_delim includedir!$includedir$ac_delim oldincludedir!$oldincludedir$ac_delim docdir!$docdir$ac_delim infodir!$infodir$ac_delim htmldir!$htmldir$ac_delim dvidir!$dvidir$ac_delim pdfdir!$pdfdir$ac_delim psdir!$psdir$ac_delim libdir!$libdir$ac_delim localedir!$localedir$ac_delim mandir!$mandir$ac_delim DEFS!$DEFS$ac_delim ECHO_C!$ECHO_C$ac_delim ECHO_N!$ECHO_N$ac_delim ECHO_T!$ECHO_T$ac_delim LIBS!$LIBS$ac_delim build_alias!$build_alias$ac_delim host_alias!$host_alias$ac_delim target_alias!$target_alias$ac_delim CC!$CC$ac_delim CFLAGS!$CFLAGS$ac_delim LDFLAGS!$LDFLAGS$ac_delim CPPFLAGS!$CPPFLAGS$ac_delim ac_ct_CC!$ac_ct_CC$ac_delim EXEEXT!$EXEEXT$ac_delim OBJEXT!$OBJEXT$ac_delim eap_tls_ldflags!$eap_tls_ldflags$ac_delim eap_tls_cflags!$eap_tls_cflags$ac_delim targetname!$targetname$ac_delim LIBOBJS!$LIBOBJS$ac_delim LTLIBOBJS!$LTLIBOBJS$ac_delim _ACEOF if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 49; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` if test -n "$ac_eof"; then ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` ac_eof=`expr $ac_eof + 1` fi cat >>$CONFIG_STATUS <<_ACEOF cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof /@[a-zA-Z_][a-zA-Z_0-9]*@/!b end _ACEOF sed ' s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g s/^/s,@/; s/!/@,|#_!!_#|/ :n t n s/'"$ac_delim"'$/,g/; t s/$/\\/; p N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n ' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF :end s/|#_!!_#|//g CEOF$ac_eof _ACEOF # VPATH may cause trouble with some makes, so we remove $(srcdir), # ${srcdir} and @srcdir@ 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[ ]*=/{ s/:*\$(srcdir):*/:/ s/:*\${srcdir}:*/:/ s/:*@srcdir@:*/:/ s/^\([^=]*=[ ]*\):*/\1/ s/:*$// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF fi # test -n "$CONFIG_FILES" for ac_tag in :F $CONFIG_FILES :H $CONFIG_HEADERS do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5 echo "$as_me: error: Invalid tag $ac_tag." >&2;} { (exit 1); exit 1; }; };; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 echo "$as_me: error: cannot find input file: $ac_f" >&2;} { (exit 1); exit 1; }; };; esac ac_file_inputs="$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 "`IFS=: echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure." if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { echo "$as_me:$LINENO: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} fi case $ac_tag in *:-:* | *:-) cat >"$tmp/stdin";; 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 || 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" case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`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 || 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" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 echo "$as_me: error: cannot create directory $as_dir" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`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 # _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # 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= case `sed -n '/datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p ' $ac_file_inputs` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF 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 sed "$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s&@configure_input@&$configure_input&;t t s&@top_builddir@&$ac_top_builddir_sub&;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 $ac_datarootdir_hack " $ac_file_inputs | sed -f "$tmp/subs-1.sed" >$tmp/out test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&5 echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&2;} rm -f "$tmp/stdin" case $ac_file in -) cat "$tmp/out"; rm -f "$tmp/out";; *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;; esac ;; :H) # # CONFIG_HEADER # _ACEOF # Transform confdefs.h into a sed script `conftest.defines', that # substitutes the proper values into config.h.in to produce config.h. rm -f conftest.defines conftest.tail # First, append a space to every undef/define line, to ease matching. echo 's/$/ /' >conftest.defines # Then, protect against being on the right side of a sed subst, or in # an unquoted here document, in config.status. If some macros were # called several times there might be several #defines for the same # symbol, which is useless. But do not sort them, since the last # AC_DEFINE must be honored. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* # These sed commands are passed to sed as "A NAME B PARAMS C VALUE D", where # NAME is the cpp macro being defined, VALUE is the value it is being given. # PARAMS is the parameter list in the macro definition--in most cases, it's # just an empty string. ac_dA='s,^\\([ #]*\\)[^ ]*\\([ ]*' ac_dB='\\)[ (].*,\\1define\\2' ac_dC=' ' ac_dD=' ,' uniq confdefs.h | sed -n ' t rset :rset s/^[ ]*#[ ]*define[ ][ ]*// t ok d :ok s/[\\&,]/\\&/g s/^\('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/ '"$ac_dA"'\1'"$ac_dB"'\2'"${ac_dC}"'\3'"$ac_dD"'/p s/^\('"$ac_word_re"'\)[ ]*\(.*\)/'"$ac_dA"'\1'"$ac_dB$ac_dC"'\2'"$ac_dD"'/p ' >>conftest.defines # Remove the space that was appended to ease matching. # Then 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. # (The regexp can be short, since the line contains either #define or #undef.) echo 's/ $// s,^[ #]*u.*,/* & */,' >>conftest.defines # Break up conftest.defines: ac_max_sed_lines=50 # First sed command is: sed -f defines.sed $ac_file_inputs >"$tmp/out1" # Second one is: sed -f defines.sed "$tmp/out1" >"$tmp/out2" # Third one will be: sed -f defines.sed "$tmp/out2" >"$tmp/out1" # et cetera. ac_in='$ac_file_inputs' ac_out='"$tmp/out1"' ac_nxt='"$tmp/out2"' while : do # Write a here document: cat >>$CONFIG_STATUS <<_ACEOF # First, check the format of the line: cat >"\$tmp/defines.sed" <<\\CEOF /^[ ]*#[ ]*undef[ ][ ]*$ac_word_re[ ]*\$/b def /^[ ]*#[ ]*define[ ][ ]*$ac_word_re[( ]/b def b :def _ACEOF sed ${ac_max_sed_lines}q conftest.defines >>$CONFIG_STATUS echo 'CEOF sed -f "$tmp/defines.sed"' "$ac_in >$ac_out" >>$CONFIG_STATUS ac_in=$ac_out; ac_out=$ac_nxt; ac_nxt=$ac_in sed 1,${ac_max_sed_lines}d conftest.defines >conftest.tail grep . conftest.tail >/dev/null || break rm -f conftest.defines mv conftest.tail conftest.defines done rm -f conftest.defines conftest.tail echo "ac_result=$ac_in" >>$CONFIG_STATUS cat >>$CONFIG_STATUS <<\_ACEOF if test x"$ac_file" != x-; then echo "/* $configure_input */" >"$tmp/config.h" cat "$ac_result" >>"$tmp/config.h" if diff $ac_file "$tmp/config.h" >/dev/null 2>&1; then { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 echo "$as_me: $ac_file is unchanged" >&6;} else rm -f $ac_file mv "$tmp/config.h" $ac_file fi else echo "/* $configure_input */" cat "$ac_result" fi rm -f "$tmp/out12" ;; esac done # for ac_tag { (exit 0); exit 0; } _ACEOF chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save # 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 || { (exit 1); exit 1; } fi freeradius-server/src/modules/rlm_eap/types/rlm_eap_tls/configure.in000066400000000000000000000035121257552170400263600ustar00rootroot00000000000000# # Autoconf input file. # # Version: $Id$ # AC_PREREQ([2.53]) AC_INIT(rlm_eap_tls.c) AC_REVISION($Revision$) AC_DEFUN(modname,[rlm_eap_tls]) fail= eap_tls_ldflags= eap_tls_cflags= if test x$with_[]modname != xno; then dnl ############################################################ dnl # Check for command line options dnl ############################################################ AC_ARG_WITH(rlm-eap-tls-lib-dir, [ --with-rlm-eap-tls-lib-dir directory for eap-tls libs], eap_tls_ldflags="-L$withval") AC_ARG_WITH(rlm-eap-tls-include-dir, [ --with-rlm-eap-tls-include-dir directory for eap-tls includes], eap_tls_cflags="-I$withval") dnl ############################################################ dnl # Check for OpenSSL support dnl ############################################################ AC_MSG_CHECKING(for OpenSSL support) if test "x$OPENSSL_LIBS" != "x"; then AC_MSG_RESULT(yes) AC_CHECK_LIB(c $OPENSSL_LIBS, EVP_sha256, [ AC_DEFINE(HAVE_OPENSSL_EVP_SHA256, 1, [Define to 1 if you have the `EVP_sha256' function .]) ], [ AC_MSG_WARN([EVP_sha256 not found, may have issues wirh WiMAX certificates]) ]) else AC_MSG_RESULT(no) fail="OpenSSL" fi targetname=modname else targetname= echo \*\*\* module modname is disabled. fi if test x"$fail" != x""; then if test x"${enable_strict_dependencies}" = x"yes"; then AC_MSG_ERROR([set --without-]modname[ to disable it explicitly.]) else AC_MSG_WARN([silently not building ]modname[.]) AC_MSG_WARN([FAILURE: ]modname[ requires: $fail.]) if test x"$headersuggestion" != x; then AC_MSG_WARN([$headersuggestion]) fi if test x"$libsuggestion" != x; then AC_MSG_WARN([$libsuggestion]) fi targetname="" fi fi AC_SUBST(eap_tls_ldflags) AC_SUBST(eap_tls_cflags) AC_SUBST(targetname) AC_CONFIG_HEADER([config.h]) AC_OUTPUT(Makefile) freeradius-server/src/modules/rlm_eap/types/rlm_eap_tls/rlm_eap_tls.c000066400000000000000000001412511257552170400265170ustar00rootroot00000000000000/* * rlm_eap_tls.c contains the interfaces that are called from eap * * Version: $Id$ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2001 hereUare Communications, Inc. * Copyright 2003 Alan DeKok * Copyright 2006 The FreeRADIUS server project * */ #include RCSID("$Id$") #include #ifdef HAVE_OPENSSL_RAND_H #include #endif #ifdef HAVE_OPENSSL_EVP_H #include #endif #include #include "rlm_eap_tls.h" #include "config.h" #ifdef HAVE_SYS_STAT_H #include #endif #ifdef HAVE_OPENSSL_OCSP_H #include #endif static CONF_PARSER cache_config[] = { { "enable", PW_TYPE_BOOLEAN, offsetof(EAP_TLS_CONF, session_cache_enable), NULL, "no" }, { "lifetime", PW_TYPE_INTEGER, offsetof(EAP_TLS_CONF, session_timeout), NULL, "24" }, { "max_entries", PW_TYPE_INTEGER, offsetof(EAP_TLS_CONF, session_cache_size), NULL, "255" }, { "name", PW_TYPE_STRING_PTR, offsetof(EAP_TLS_CONF, session_id_name), NULL, NULL}, { NULL, -1, 0, NULL, NULL } /* end the list */ }; static CONF_PARSER verify_config[] = { { "tmpdir", PW_TYPE_STRING_PTR, offsetof(EAP_TLS_CONF, verify_tmp_dir), NULL, NULL}, { "client", PW_TYPE_STRING_PTR, offsetof(EAP_TLS_CONF, verify_client_cert_cmd), NULL, NULL}, { NULL, -1, 0, NULL, NULL } /* end the list */ }; #ifdef HAVE_OPENSSL_OCSP_H static CONF_PARSER ocsp_config[] = { { "enable", PW_TYPE_BOOLEAN, offsetof(EAP_TLS_CONF, ocsp_enable), NULL, "no"}, { "override_cert_url", PW_TYPE_BOOLEAN, offsetof(EAP_TLS_CONF, ocsp_override_url), NULL, "no"}, { "url", PW_TYPE_STRING_PTR, offsetof(EAP_TLS_CONF, ocsp_url), NULL, NULL }, { "use_nonce", PW_TYPE_BOOLEAN, offsetof(EAP_TLS_CONF, ocsp_use_nonce), NULL, "yes"}, { "timeout", PW_TYPE_INTEGER, offsetof(EAP_TLS_CONF, ocsp_timeout), NULL, "0" }, { "softfail", PW_TYPE_BOOLEAN, offsetof(EAP_TLS_CONF, ocsp_softfail), NULL, "no"}, { NULL, -1, 0, NULL, NULL } /* end the list */ }; #endif static CONF_PARSER module_config[] = { { "rsa_key_exchange", PW_TYPE_BOOLEAN, offsetof(EAP_TLS_CONF, rsa_key), NULL, "no" }, { "dh_key_exchange", PW_TYPE_BOOLEAN, offsetof(EAP_TLS_CONF, dh_key), NULL, "yes" }, { "rsa_key_length", PW_TYPE_INTEGER, offsetof(EAP_TLS_CONF, rsa_key_length), NULL, "512" }, { "dh_key_length", PW_TYPE_INTEGER, offsetof(EAP_TLS_CONF, dh_key_length), NULL, "512" }, { "verify_depth", PW_TYPE_INTEGER, offsetof(EAP_TLS_CONF, verify_depth), NULL, "0" }, { "CA_path", PW_TYPE_FILENAME, offsetof(EAP_TLS_CONF, ca_path), NULL, NULL }, { "pem_file_type", PW_TYPE_BOOLEAN, offsetof(EAP_TLS_CONF, file_type), NULL, "yes" }, { "private_key_file", PW_TYPE_FILENAME, offsetof(EAP_TLS_CONF, private_key_file), NULL, NULL }, { "certificate_file", PW_TYPE_FILENAME, offsetof(EAP_TLS_CONF, certificate_file), NULL, NULL }, { "CA_file", PW_TYPE_FILENAME, offsetof(EAP_TLS_CONF, ca_file), NULL, NULL }, { "private_key_password", PW_TYPE_STRING_PTR, offsetof(EAP_TLS_CONF, private_key_password), NULL, NULL }, { "dh_file", PW_TYPE_STRING_PTR, offsetof(EAP_TLS_CONF, dh_file), NULL, NULL }, { "random_file", PW_TYPE_STRING_PTR, offsetof(EAP_TLS_CONF, random_file), NULL, NULL }, { "fragment_size", PW_TYPE_INTEGER, offsetof(EAP_TLS_CONF, fragment_size), NULL, "1024" }, { "include_length", PW_TYPE_BOOLEAN, offsetof(EAP_TLS_CONF, include_length), NULL, "yes" }, { "check_crl", PW_TYPE_BOOLEAN, offsetof(EAP_TLS_CONF, check_crl), NULL, "no"}, { "check_all_crl", PW_TYPE_BOOLEAN, offsetof(EAP_TLS_CONF, check_all_crl), NULL, "no"}, { "allow_expired_crl", PW_TYPE_BOOLEAN, offsetof(EAP_TLS_CONF, allow_expired_crl), NULL, NULL}, { "check_cert_cn", PW_TYPE_STRING_PTR, offsetof(EAP_TLS_CONF, check_cert_cn), NULL, NULL}, { "cipher_list", PW_TYPE_STRING_PTR, offsetof(EAP_TLS_CONF, cipher_list), NULL, NULL}, { "check_cert_issuer", PW_TYPE_STRING_PTR, offsetof(EAP_TLS_CONF, check_cert_issuer), NULL, NULL}, { "make_cert_command", PW_TYPE_STRING_PTR, offsetof(EAP_TLS_CONF, make_cert_command), NULL, NULL}, { "virtual_server", PW_TYPE_STRING_PTR, offsetof(EAP_TLS_CONF, virtual_server), NULL, NULL }, #if OPENSSL_VERSION_NUMBER >= 0x0090800fL #ifndef OPENSSL_NO_ECDH { "ecdh_curve", PW_TYPE_STRING_PTR, offsetof(EAP_TLS_CONF, ecdh_curve), NULL, "prime256v1"}, #endif #endif #ifdef SSL_OP_NO_TLSv1_1 { "disable_tlsv1_1", PW_TYPE_BOOLEAN, offsetof(EAP_TLS_CONF, disable_tlsv1_1), NULL, NULL }, #endif #ifdef SSL_OP_NO_TLSv1_2 { "disable_tlsv1_2", PW_TYPE_BOOLEAN, offsetof(EAP_TLS_CONF, disable_tlsv1_2), NULL, NULL }, #endif { "cache", PW_TYPE_SUBSECTION, 0, NULL, (const void *) cache_config }, { "verify", PW_TYPE_SUBSECTION, 0, NULL, (const void *) verify_config }, #ifdef HAVE_OPENSSL_OCSP_H { "ocsp", PW_TYPE_SUBSECTION, 0, NULL, (const void *) ocsp_config }, #endif { NULL, -1, 0, NULL, NULL } /* end the list */ }; /* * TODO: Check for the type of key exchange * like conf->dh_key */ static int load_dh_params(SSL_CTX *ctx, char *file) { DH *dh = NULL; BIO *bio; if (!ctx || !file) return 0; if ((bio = BIO_new_file(file, "r")) == NULL) { radlog(L_ERR, "rlm_eap_tls: Unable to open DH file - %s", file); return -1; } dh = PEM_read_bio_DHparams(bio, NULL, NULL, NULL); BIO_free(bio); if (!dh) { DEBUG2("WARNING: rlm_eap_tls: Unable to set DH parameters. DH cipher suites may not work!"); DEBUG2("WARNING: Fix this by running the OpenSSL command listed in eap.conf"); return 0; } if (SSL_CTX_set_tmp_dh(ctx, dh) < 0) { radlog(L_ERR, "rlm_eap_tls: Unable to set DH parameters"); DH_free(dh); return -1; } DH_free(dh); return 0; } /* * Generate ephemeral RSA keys. */ static int generate_eph_rsa_key(SSL_CTX *ctx) { RSA *rsa; if (!SSL_CTX_need_tmp_RSA(ctx)) return 0; rsa = RSA_generate_key(512, RSA_F4, NULL, NULL); if (!SSL_CTX_set_tmp_rsa(ctx, rsa)) { radlog(L_ERR, "rlm_eap_tls: Couldn't set ephemeral RSA key"); return -1; } RSA_free(rsa); return 0; } /* * FIXME: Write sessions to some long-term storage, so that * session resumption can still occur after the server * restarts. */ #define MAX_SESSION_SIZE (256) static void cbtls_remove_session(UNUSED SSL_CTX *ctx, SSL_SESSION *sess) { size_t size; char buffer[2 * MAX_SESSION_SIZE + 1]; size = sess->session_id_length; if (size > MAX_SESSION_SIZE) size = MAX_SESSION_SIZE; fr_bin2hex(sess->session_id, buffer, size); DEBUG2(" SSL: Removing session %s from the cache", buffer); SSL_SESSION_free(sess); return; } static int cbtls_new_session(UNUSED SSL *s, SSL_SESSION *sess) { size_t size; char buffer[2 * MAX_SESSION_SIZE + 1]; size = sess->session_id_length; if (size > MAX_SESSION_SIZE) size = MAX_SESSION_SIZE; fr_bin2hex(sess->session_id, buffer, size); DEBUG2(" SSL: adding session %s to cache", buffer); return 1; } static SSL_SESSION *cbtls_get_session(UNUSED SSL *s, unsigned char *data, int len, UNUSED int *copy) { size_t size; char buffer[2 * MAX_SESSION_SIZE + 1]; size = len; if (size > MAX_SESSION_SIZE) size = MAX_SESSION_SIZE; fr_bin2hex(data, buffer, size); DEBUG2(" SSL: Client requested nonexistent cached session %s", buffer); return NULL; } #ifdef HAVE_OPENSSL_OCSP_H /* * This function extracts the OCSP Responder URL * from an existing x509 certificate. */ static int ocsp_parse_cert_url(X509 *cert, char **phost, char **pport, char **ppath, int *pssl) { int i; AUTHORITY_INFO_ACCESS *aia; ACCESS_DESCRIPTION *ad; aia = X509_get_ext_d2i(cert, NID_info_access, NULL, NULL); for (i = 0; i < sk_ACCESS_DESCRIPTION_num(aia); i++) { ad = sk_ACCESS_DESCRIPTION_value(aia, 0); if (OBJ_obj2nid(ad->method) == NID_ad_OCSP) { if (ad->location->type == GEN_URI) { if(OCSP_parse_url(ad->location->d.ia5->data, phost, pport, ppath, pssl)) return 1; } } } return 0; } /* * This function sends a OCSP request to a defined OCSP responder * and checks the OCSP response for correctness. */ /* Maximum leeway in validity period: default 5 minutes */ #define MAX_VALIDITY_PERIOD (5 * 60) static int ocsp_check(X509_STORE *store, X509 *issuer_cert, X509 *client_cert, EAP_TLS_CONF *conf) { OCSP_CERTID *certid; OCSP_REQUEST *req; OCSP_RESPONSE *resp = NULL; OCSP_BASICRESP *bresp = NULL; char *host = NULL; char *port = NULL; char *path = NULL; int use_ssl = -1; long nsec = MAX_VALIDITY_PERIOD, maxage = -1; BIO *cbio, *bio_out; int ocsp_ok = 0; int status ; ASN1_GENERALIZEDTIME *rev, *thisupd, *nextupd; int reason; #if OPENSSL_VERSION_NUMBER >= 0x1000003f OCSP_REQ_CTX *ctx; int rc; struct timeval now; struct timeval when; #endif /* * Create OCSP Request */ certid = OCSP_cert_to_id(NULL, client_cert, issuer_cert); req = OCSP_REQUEST_new(); OCSP_request_add0_id(req, certid); if(conf->ocsp_use_nonce){ OCSP_request_add1_nonce(req, NULL, 8); } /* * Send OCSP Request and get OCSP Response */ /* Get OCSP responder URL */ if(conf->ocsp_override_url) { OCSP_parse_url(conf->ocsp_url, &host, &port, &path, &use_ssl); } else { ocsp_parse_cert_url(client_cert, &host, &port, &path, &use_ssl); } if (!host || !port || !path) { DEBUG2("[ocsp] - Host / port / path missing. Not doing OCSP."); ocsp_ok = 2; goto ocsp_skip; } DEBUG2("[ocsp] --> Responder URL = http://%s:%s%s", host, port, path); /* Setup BIO socket to OCSP responder */ cbio = BIO_new_connect(host); /* * Only print debugging information if we're in debugging * mode. */ if (debug_flag) { bio_out = BIO_new_fp(stdout, BIO_NOCLOSE); } else { bio_out = NULL; } BIO_set_conn_port(cbio, port); #if OPENSSL_VERSION_NUMBER < 0x1000003f BIO_do_connect(cbio); /* Send OCSP request and wait for response */ resp = OCSP_sendreq_bio(cbio, path, req); if (!resp) { radlog(L_ERR, "Error: Couldn't get OCSP response"); ocsp_ok = 2; goto ocsp_end; } #else if (conf->ocsp_timeout) BIO_set_nbio(cbio, 1); rc = BIO_do_connect(cbio); if ((rc <= 0) && ((!conf->ocsp_timeout) || !BIO_should_retry(cbio))) { radlog(L_ERR, "Error: Couldn't connect to OCSP responder"); ocsp_ok = 2; goto ocsp_end; } ctx = OCSP_sendreq_new(cbio, path, req, -1); if (!ctx) { radlog(L_ERR, "Error: Couldn't send OCSP request"); ocsp_ok = 2; goto ocsp_end; } gettimeofday(&when, NULL); when.tv_sec += conf->ocsp_timeout; do { rc = OCSP_sendreq_nbio(&resp, ctx); if (conf->ocsp_timeout) { gettimeofday(&now, NULL); if (!timercmp(&now, &when, <)) break; } } while ((rc == -1) && BIO_should_retry(cbio)); if (conf->ocsp_timeout && (rc == -1) && BIO_should_retry(cbio)) { radlog(L_ERR, "Error: OCSP response timed out"); ocsp_ok = 2; goto ocsp_end; } OCSP_REQ_CTX_free(ctx); if (rc == 0) { radlog(L_ERR, "Error: Couldn't get OCSP response"); ocsp_ok = 2; goto ocsp_end; } #endif /* Verify OCSP response status */ status = OCSP_response_status(resp); DEBUG2("[ocsp] --> Response status: %s",OCSP_response_status_str(status)); if(status != OCSP_RESPONSE_STATUS_SUCCESSFUL) { radlog(L_ERR, "Error: OCSP response status: %s", OCSP_response_status_str(status)); goto ocsp_end; } bresp = OCSP_response_get1_basic(resp); if(conf->ocsp_use_nonce && OCSP_check_nonce(req, bresp)!=1) { radlog(L_ERR, "Error: OCSP response has wrong nonce value"); goto ocsp_end; } if(OCSP_basic_verify(bresp, NULL, store, 0)!=1){ radlog(L_ERR, "Error: Couldn't verify OCSP basic response"); goto ocsp_end; } /* Verify OCSP cert status */ if(!OCSP_resp_find_status(bresp, certid, &status, &reason, &rev, &thisupd, &nextupd)) { radlog(L_ERR, "ERROR: No Status found.\n"); goto ocsp_end; } if (!OCSP_check_validity(thisupd, nextupd, nsec, maxage)) { if (bio_out) { BIO_puts(bio_out, "WARNING: Status times invalid.\n"); ERR_print_errors(bio_out); } goto ocsp_end; } if (bio_out) { BIO_puts(bio_out, "\tThis Update: "); ASN1_GENERALIZEDTIME_print(bio_out, thisupd); BIO_puts(bio_out, "\n"); if (nextupd) { BIO_puts(bio_out, "\tNext Update: "); ASN1_GENERALIZEDTIME_print(bio_out, nextupd); BIO_puts(bio_out, "\n"); } } switch (status) { case V_OCSP_CERTSTATUS_GOOD: DEBUG2("[oscp] --> Cert status: good"); ocsp_ok = 1; break; default: /* REVOKED / UNKNOWN */ DEBUG2("[ocsp] --> Cert status: %s",OCSP_cert_status_str(status)); if (reason != -1) DEBUG2("[ocsp] --> Reason: %s", OCSP_crl_reason_str(reason)); if (bio_out) { BIO_puts(bio_out, "\tRevocation Time: "); ASN1_GENERALIZEDTIME_print(bio_out, rev); BIO_puts(bio_out, "\n"); } break; } ocsp_end: /* Free OCSP Stuff */ OCSP_REQUEST_free(req); OCSP_RESPONSE_free(resp); free(host); free(port); free(path); BIO_free_all(cbio); if (bio_out) BIO_free(bio_out); OCSP_BASICRESP_free(bresp); ocsp_skip: switch (ocsp_ok) { case 1: DEBUG2("[ocsp] --> Certificate is valid!"); break; case 2: if (conf->ocsp_softfail) { DEBUG2("[ocsp] --> Unable to check certificate; assuming valid."); DEBUG2("[ocsp] --> Warning! This may be insecure."); ocsp_ok = 1; } else { DEBUG2("[ocsp] --> Unable to check certificate; failing!"); ocsp_ok = 0; } break; default: DEBUG2("[ocsp] --> Certificate has been expired/revoked!"); break; } return ocsp_ok; } #endif /* HAVE_OPENSSL_OCSP_H */ /* * For creating certificate attributes. */ static const char *cert_attr_names[6][2] = { { "TLS-Client-Cert-Serial", "TLS-Cert-Serial" }, { "TLS-Client-Cert-Expiration", "TLS-Cert-Expiration" }, { "TLS-Client-Cert-Subject", "TLS-Cert-Subject" }, { "TLS-Client-Cert-Issuer", "TLS-Cert-Issuer" }, { "TLS-Client-Cert-Common-Name", "TLS-Cert-Common-Name" }, { "TLS-Client-Cert-Subject-Alt-Name-Email", "TLS-Cert-Subject-Alt-Name-Email" } }; #define EAPTLS_SERIAL (0) #define EAPTLS_EXPIRATION (1) #define EAPTLS_SUBJECT (2) #define EAPTLS_ISSUER (3) #define EAPTLS_CN (4) #define EAPTLS_SAN_EMAIL (5) /* * Before trusting a certificate, you must make sure that the * certificate is 'valid'. There are several steps that your * application can take in determining if a certificate is * valid. Commonly used steps are: * * 1.Verifying the certificate's signature, and verifying that * the certificate has been issued by a trusted Certificate * Authority. * * 2.Verifying that the certificate is valid for the present date * (i.e. it is being presented within its validity dates). * * 3.Verifying that the certificate has not been revoked by its * issuing Certificate Authority, by checking with respect to a * Certificate Revocation List (CRL). * * 4.Verifying that the credentials presented by the certificate * fulfill additional requirements specific to the application, * such as with respect to access control lists or with respect * to OCSP (Online Certificate Status Processing). * * NOTE: This callback will be called multiple times based on the * depth of the root certificate chain */ static int cbtls_verify(int ok, X509_STORE_CTX *ctx) { char subject[1024]; /* Used for the subject name */ char issuer[1024]; /* Used for the issuer name */ char attribute[1024]; char value[1024]; char common_name[1024]; char cn_str[1024]; char buf[64]; EAP_HANDLER *handler = NULL; X509 *client_cert; X509_CINF *client_inf; STACK_OF(X509_EXTENSION) *ext_list; X509 *issuer_cert; SSL *ssl; int err, depth, lookup, loc; EAP_TLS_CONF *conf; int my_ok = ok; REQUEST *request; ASN1_INTEGER *sn = NULL; ASN1_TIME *asn_time = NULL; #ifdef HAVE_OPENSSL_OCSP_H X509_STORE *ocsp_store = NULL; #endif client_cert = X509_STORE_CTX_get_current_cert(ctx); err = X509_STORE_CTX_get_error(ctx); depth = X509_STORE_CTX_get_error_depth(ctx); lookup = depth; /* * Log client/issuing cert. If there's an error, log * issuing cert. */ if ((lookup > 1) && !my_ok) lookup = 1; /* * Retrieve the pointer to the SSL of the connection currently treated * and the application specific data stored into the SSL object. */ ssl = X509_STORE_CTX_get_ex_data(ctx, SSL_get_ex_data_X509_STORE_CTX_idx()); handler = (EAP_HANDLER *)SSL_get_ex_data(ssl, 0); request = handler->request; conf = (EAP_TLS_CONF *)SSL_get_ex_data(ssl, 1); #ifdef HAVE_OPENSSL_OCSP_H ocsp_store = (X509_STORE *)SSL_get_ex_data(ssl, 2); #endif /* * Get the Serial Number */ buf[0] = '\0'; sn = X509_get_serialNumber(client_cert); /* * For this next bit, we create the attributes *only* if * we're at the client or issuing certificate. */ if ((lookup <= 1) && sn && (sn->length < (sizeof(buf) / 2))) { char *p = buf; int i; for (i = 0; i < sn->length; i++) { sprintf(p, "%02x", (unsigned int)sn->data[i]); p += 2; } pairadd(&handler->certs, pairmake(cert_attr_names[EAPTLS_SERIAL][lookup], buf, T_OP_SET)); } /* * Get the Expiration Date */ buf[0] = '\0'; asn_time = X509_get_notAfter(client_cert); if ((lookup <= 1) && asn_time && (asn_time->length < sizeof(buf))) { memcpy(buf, (char*) asn_time->data, asn_time->length); buf[asn_time->length] = '\0'; pairadd(&handler->certs, pairmake(cert_attr_names[EAPTLS_EXPIRATION][lookup], buf, T_OP_SET)); } /* * Get the Subject & Issuer */ subject[0] = issuer[0] = '\0'; X509_NAME_oneline(X509_get_subject_name(client_cert), subject, sizeof(subject)); subject[sizeof(subject) - 1] = '\0'; if ((lookup <= 1) && subject[0] && (strlen(subject) < MAX_STRING_LEN)) { pairadd(&handler->certs, pairmake(cert_attr_names[EAPTLS_SUBJECT][lookup], subject, T_OP_SET)); } X509_NAME_oneline(X509_get_issuer_name(ctx->current_cert), issuer, sizeof(issuer)); issuer[sizeof(issuer) - 1] = '\0'; if ((lookup <= 1) && issuer[0] && (strlen(issuer) < MAX_STRING_LEN)) { pairadd(&handler->certs, pairmake(cert_attr_names[EAPTLS_ISSUER][lookup], issuer, T_OP_SET)); } /* * Get the Common Name, if there is a subject. */ X509_NAME_get_text_by_NID(X509_get_subject_name(client_cert), NID_commonName, common_name, sizeof(common_name)); common_name[sizeof(common_name) - 1] = '\0'; if ((lookup <= 1) && common_name[0] && subject[0] && (strlen(common_name) < MAX_STRING_LEN)) { pairadd(&handler->certs, pairmake(cert_attr_names[EAPTLS_CN][lookup], common_name, T_OP_SET)); } #ifdef GEN_EMAIL /* * Get the RFC822 Subject Alternative Name */ loc = X509_get_ext_by_NID(client_cert, NID_subject_alt_name, 0); if (lookup <= 1 && loc >= 0) { X509_EXTENSION *ext = NULL; GENERAL_NAMES *names = NULL; int i; if ((ext = X509_get_ext(client_cert, loc)) && (names = X509V3_EXT_d2i(ext))) { for (i = 0; i < sk_GENERAL_NAME_num(names); i++) { GENERAL_NAME *name = sk_GENERAL_NAME_value(names, i); switch (name->type) { case GEN_EMAIL: if (ASN1_STRING_length(name->d.rfc822Name) >= MAX_STRING_LEN) break; pairadd(&handler->certs, pairmake(cert_attr_names[EAPTLS_SAN_EMAIL][lookup], (char *)ASN1_STRING_data(name->d.rfc822Name), T_OP_SET)); break; default: /* XXX TODO handle other SAN types */ break; } } } if (names != NULL) sk_GENERAL_NAME_free(names); } #endif /* GEN_EMAIL */ /* * If the CRL has expired, that might still be OK. */ if (!my_ok && (conf->allow_expired_crl) && (err == X509_V_ERR_CRL_HAS_EXPIRED)) { my_ok = 1; X509_STORE_CTX_set_error( ctx, 0 ); } if (!my_ok) { const char *p = X509_verify_cert_error_string(err); radlog(L_ERR,"--> verify error:num=%d:%s\n",err, p); radius_pairmake(request, &request->packet->vps, "Module-Failure-Message", p, T_OP_SET); return my_ok; } if (lookup == 0) { client_inf = client_cert->cert_info; ext_list = client_inf->extensions; } else { ext_list = NULL; } /* * Grab the X509 extensions, and create attributes out of them. * For laziness, we re-use the OpenSSL names */ if (sk_X509_EXTENSION_num(ext_list) > 0) { int i, len; char *p; BIO *out; out = BIO_new(BIO_s_mem()); strlcpy(attribute, "TLS-Client-Cert-", sizeof(attribute)); for (i = 0; i < sk_X509_EXTENSION_num(ext_list); i++) { ASN1_OBJECT *obj; X509_EXTENSION *ext; VALUE_PAIR *vp; ext = sk_X509_EXTENSION_value(ext_list, i); obj = X509_EXTENSION_get_object(ext); i2a_ASN1_OBJECT(out, obj); len = BIO_read(out, attribute + 16 , sizeof(attribute) - 16 - 1); if (len <= 0) continue; attribute[16 + len] = '\0'; X509V3_EXT_print(out, ext, 0, 0); len = BIO_read(out, value, sizeof(value) - 1); if (len <= 0) continue; value[len] = '\0'; /* * Mash the OpenSSL name to our name, and * create the attribute. */ for (p = attribute + 16; *p != '\0'; p++) { if (*p == ' ') *p = '-'; } vp = pairmake(attribute, value, T_OP_ADD); if (vp) { pairadd(&handler->certs, vp); debug_pair_list(vp); } } BIO_free_all(out); } switch (ctx->error) { case X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT: radlog(L_ERR, "issuer= %s\n", issuer); break; case X509_V_ERR_CERT_NOT_YET_VALID: case X509_V_ERR_ERROR_IN_CERT_NOT_BEFORE_FIELD: radlog(L_ERR, "notBefore="); #if 0 ASN1_TIME_print(bio_err, X509_get_notBefore(ctx->current_cert)); #endif break; case X509_V_ERR_CERT_HAS_EXPIRED: case X509_V_ERR_ERROR_IN_CERT_NOT_AFTER_FIELD: radlog(L_ERR, "notAfter="); #if 0 ASN1_TIME_print(bio_err, X509_get_notAfter(ctx->current_cert)); #endif break; } /* * If we're at the actual client cert, apply additional * checks. */ if (depth == 0) { /* * If the conf tells us to, check cert issuer * against the specified value and fail * verification if they don't match. */ if (conf->check_cert_issuer && (strcmp(issuer, conf->check_cert_issuer) != 0)) { radlog(L_AUTH, "rlm_eap_tls: Certificate issuer (%s) does not match specified value (%s)!", issuer, conf->check_cert_issuer); my_ok = 0; } /* * If the conf tells us to, check the CN in the * cert against xlat'ed value, but only if the * previous checks passed. */ if (my_ok && conf->check_cert_cn) { if (!radius_xlat(cn_str, sizeof(cn_str), conf->check_cert_cn, handler->request, NULL)) { radlog(L_ERR, "rlm_eap_tls (%s): xlat failed.", conf->check_cert_cn); /* if this fails, fail the verification */ my_ok = 0; } else { RDEBUG2("checking certificate CN (%s) with xlat'ed value (%s)", common_name, cn_str); if (strcmp(cn_str, common_name) != 0) { radlog(L_AUTH, "rlm_eap_tls: Certificate CN (%s) does not match specified value (%s)!", common_name, cn_str); my_ok = 0; } } } /* check_cert_cn */ #ifdef HAVE_OPENSSL_OCSP_H if (my_ok && conf->ocsp_enable){ RDEBUG2("--> Starting OCSP Request"); if (X509_STORE_CTX_get1_issuer(&issuer_cert, ctx, client_cert) != 1) { radlog(L_ERR, "Error: Couldn't get issuer_cert for %s", common_name); } else { my_ok = ocsp_check(ocsp_store, issuer_cert, client_cert, conf); } } #endif while (conf->verify_client_cert_cmd) { char filename[256]; int fd; FILE *fp; snprintf(filename, sizeof(filename), "%s/%s.client.XXXXXXXX", conf->verify_tmp_dir, progname); fd = mkstemp(filename); if (fd < 0) { RDEBUG("Failed creating file in %s: %s", conf->verify_tmp_dir, strerror(errno)); break; } fp = fdopen(fd, "w"); if (!fp) { RDEBUG("Failed opening file %s: %s", filename, strerror(errno)); break; } if (!PEM_write_X509(fp, client_cert)) { fclose(fp); RDEBUG("Failed writing certificate to file"); goto do_unlink; } fclose(fp); if (!radius_pairmake(request, &request->packet->vps, "TLS-Client-Cert-Filename", filename, T_OP_SET)) { RDEBUG("Failed creating TLS-Client-Cert-Filename"); goto do_unlink; } RDEBUG("Verifying client certificate: %s", conf->verify_client_cert_cmd); if (radius_exec_program(conf->verify_client_cert_cmd, request, 1, NULL, 0, EXEC_TIMEOUT, request->packet->vps, NULL, 1) != 0) { radlog(L_AUTH, "rlm_eap_tls: Certificate CN (%s) fails external verification!", common_name); my_ok = 0; } else { RDEBUG("Client certificate CN %s passed external validation", common_name); } do_unlink: unlink(filename); break; } } /* depth == 0 */ if (debug_flag > 0) { RDEBUG2("chain-depth=%d, ", depth); RDEBUG2("error=%d", err); RDEBUG2("--> User-Name = %s", handler->identity); RDEBUG2("--> BUF-Name = %s", common_name); RDEBUG2("--> subject = %s", subject); RDEBUG2("--> issuer = %s", issuer); RDEBUG2("--> verify return:%d", my_ok); } return my_ok; } /* * Free cached session data, which is always a list of VALUE_PAIRs */ static void eaptls_session_free(UNUSED void *parent, void *data_ptr, UNUSED CRYPTO_EX_DATA *ad, UNUSED int idx, UNUSED long argl, UNUSED void *argp) { VALUE_PAIR *vp = data_ptr; if (!data_ptr) return; pairfree(&vp); } #ifdef HAVE_OPENSSL_OCSP_H /* * Create Global X509 revocation store and use it to verify * OCSP responses * * - Load the trusted CAs * - Load the trusted issuer certificates */ static X509_STORE *init_revocation_store(EAP_TLS_CONF *conf) { X509_STORE *store = NULL; store = X509_STORE_new(); /* Load the CAs we trust */ if (conf->ca_file || conf->ca_path) if(!X509_STORE_load_locations(store, conf->ca_file, conf->ca_path)) { radlog(L_ERR, "rlm_eap: X509_STORE error %s", ERR_error_string(ERR_get_error(), NULL)); radlog(L_ERR, "rlm_eap_tls: Error reading Trusted root CA list %s",conf->ca_file ); return NULL; } #ifdef X509_V_FLAG_CRL_CHECK if (conf->check_crl) X509_STORE_set_flags(store, X509_V_FLAG_CRL_CHECK); #endif #ifdef X509_V_FLAG_CRL_CHECK_ALL if (conf->check_all_crl) X509_STORE_set_flags(store, X509_V_FLAG_CRL_CHECK_ALL); #endif return store; } #endif /* HAVE_OPENSSL_OCSP_H */ #if OPENSSL_VERSION_NUMBER >= 0x0090800fL #ifndef OPENSSL_NO_ECDH static int set_ecdh_curve(SSL_CTX *ctx, const char *ecdh_curve) { int nid; EC_KEY *ecdh; if (!ecdh_curve || !*ecdh_curve) return 0; nid = OBJ_sn2nid(ecdh_curve); if (!nid) { radlog(L_ERR, "Unknown ecdh_curve \"%s\"", ecdh_curve); return -1; } ecdh = EC_KEY_new_by_curve_name(nid); if (!ecdh) { radlog(L_ERR, "Unable to create new curve \"%s\"", ecdh_curve); return -1; } SSL_CTX_set_tmp_ecdh(ctx, ecdh); SSL_CTX_set_options(ctx, SSL_OP_SINGLE_ECDH_USE); EC_KEY_free(ecdh); return 0; } #endif #endif /* * Create Global context SSL and use it in every new session * * - Load the trusted CAs * - Load the Private key & the certificate * - Set the Context options & Verify options */ static SSL_CTX *init_tls_ctx(EAP_TLS_CONF *conf) { SSL_METHOD *meth; SSL_CTX *ctx; X509_STORE *certstore; int verify_mode = SSL_VERIFY_NONE; int ctx_options = 0; int type; /* * Bug fix * http://old.nabble.com/Backward-compatibility-of-private-key-files--td27937046.html */ OpenSSL_add_all_algorithms(); /* * SHA256 is in all versions of OpenSSL, but isn't * initialized by default. It's needed for WiMAX * certificates. */ #ifdef HAVE_OPENSSL_EVP_SHA256 EVP_add_digest(EVP_sha256()); #endif meth = SSLv23_method(); /* which is really "all known SSL / TLS methods". Idiots. */ ctx = SSL_CTX_new(meth); /* * Identify the type of certificates that needs to be loaded */ if (conf->file_type) { type = SSL_FILETYPE_PEM; } else { type = SSL_FILETYPE_ASN1; } /* * Set the password to load private key */ if (conf->private_key_password) { #ifdef __APPLE__ /* * We don't want to put the private key password in eap.conf, so check * for our special string which indicates we should get the password * programmatically. */ const char* special_string = "Apple:UseCertAdmin"; if (strncmp(conf->private_key_password, special_string, strlen(special_string)) == 0) { char cmd[256]; const long max_password_len = 128; snprintf(cmd, sizeof(cmd) - 1, "/usr/sbin/certadmin --get-private-key-passphrase \"%s\"", conf->private_key_file); DEBUG2("rlm_eap: Getting private key passphrase using command \"%s\"", cmd); FILE* cmd_pipe = popen(cmd, "r"); if (!cmd_pipe) { radlog(L_ERR, "rlm_eap: %s command failed. Unable to get private_key_password", cmd); radlog(L_ERR, "rlm_eap: Error reading private_key_file %s", conf->private_key_file); return NULL; } free(conf->private_key_password); conf->private_key_password = malloc(max_password_len * sizeof(char)); if (!conf->private_key_password) { radlog(L_ERR, "rlm_eap: Can't malloc space for private_key_password"); radlog(L_ERR, "rlm_eap: Error reading private_key_file %s", conf->private_key_file); pclose(cmd_pipe); return NULL; } fgets(conf->private_key_password, max_password_len, cmd_pipe); pclose(cmd_pipe); /* Get rid of newline at end of password. */ conf->private_key_password[strlen(conf->private_key_password) - 1] = '\0'; DEBUG2("rlm_eap: Password from command = \"%s\"", conf->private_key_password); } #endif SSL_CTX_set_default_passwd_cb_userdata(ctx, conf->private_key_password); SSL_CTX_set_default_passwd_cb(ctx, cbtls_password); } /* * Load our keys and certificates * * If certificates are of type PEM then we can make use * of cert chain authentication using openssl api call * SSL_CTX_use_certificate_chain_file. Please see how * the cert chain needs to be given in PEM from * openSSL.org */ if (type == SSL_FILETYPE_PEM) { if (!(SSL_CTX_use_certificate_chain_file(ctx, conf->certificate_file))) { radlog(L_ERR, "rlm_eap: SSL error %s", ERR_error_string(ERR_get_error(), NULL)); radlog(L_ERR, "rlm_eap_tls: Error reading certificate file %s", conf->certificate_file); return NULL; } } else if (!(SSL_CTX_use_certificate_file(ctx, conf->certificate_file, type))) { radlog(L_ERR, "rlm_eap: SSL error %s", ERR_error_string(ERR_get_error(), NULL)); radlog(L_ERR, "rlm_eap_tls: Error reading certificate file %s", conf->certificate_file); return NULL; } /* Load the CAs we trust */ if (conf->ca_file || conf->ca_path) { if (!SSL_CTX_load_verify_locations(ctx, conf->ca_file, conf->ca_path)) { radlog(L_ERR, "rlm_eap: SSL error %s", ERR_error_string(ERR_get_error(), NULL)); radlog(L_ERR, "rlm_eap_tls: Error reading Trusted root CA list %s",conf->ca_file ); return NULL; } } if (conf->ca_file && *conf->ca_file) SSL_CTX_set_client_CA_list(ctx, SSL_load_client_CA_file(conf->ca_file)); if (!(SSL_CTX_use_PrivateKey_file(ctx, conf->private_key_file, type))) { radlog(L_ERR, "rlm_eap: SSL error %s", ERR_error_string(ERR_get_error(), NULL)); radlog(L_ERR, "rlm_eap_tls: Error reading private key file %s", conf->private_key_file); return NULL; } /* * Check if the loaded private key is the right one */ if (!SSL_CTX_check_private_key(ctx)) { radlog(L_ERR, "rlm_eap_tls: Private key does not match the certificate public key"); return NULL; } /* * Set ctx_options */ ctx_options |= SSL_OP_NO_SSLv2; ctx_options |= SSL_OP_NO_SSLv3; #ifdef SSL_OP_NO_TLSv1_1 if (conf->disable_tlsv1_1) ctx_options |= SSL_OP_NO_TLSv1_1; #endif #ifdef SSL_OP_NO_TLSv1_2 if (conf->disable_tlsv1_2) ctx_options |= SSL_OP_NO_TLSv1_2; #endif #ifdef SSL_OP_NO_TICKET ctx_options |= SSL_OP_NO_TICKET ; #endif /* * SSL_OP_SINGLE_DH_USE must be used in order to prevent * small subgroup attacks and forward secrecy. Always * using * * SSL_OP_SINGLE_DH_USE has an impact on the computer * time needed during negotiation, but it is not very * large. */ ctx_options |= SSL_OP_SINGLE_DH_USE; /* * SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS to work around issues * in Windows Vista client. * http://www.openssl.org/~bodo/tls-cbc.txt * http://www.nabble.com/(RADIATOR)-Radiator-Version-3.16-released-t2600070.html */ ctx_options |= SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS; SSL_CTX_set_options(ctx, ctx_options); /* * TODO: Set the RSA & DH * SSL_CTX_set_tmp_rsa_callback(ctx, cbtls_rsa); * SSL_CTX_set_tmp_dh_callback(ctx, cbtls_dh); */ /* * Set eliptical curve crypto configuration. */ #if OPENSSL_VERSION_NUMBER >= 0x0090800fL #ifndef OPENSSL_NO_ECDH if (set_ecdh_curve(ctx, conf->ecdh_curve) < 0) { return NULL; } #endif #endif /* * set the message callback to identify the type of * message. For every new session, there can be a * different callback argument. * * SSL_CTX_set_msg_callback(ctx, cbtls_msg); */ /* Set Info callback */ SSL_CTX_set_info_callback(ctx, cbtls_info); /* * Callbacks, etc. for session resumption. */ if (conf->session_cache_enable) { SSL_CTX_sess_set_new_cb(ctx, cbtls_new_session); SSL_CTX_sess_set_get_cb(ctx, cbtls_get_session); SSL_CTX_sess_set_remove_cb(ctx, cbtls_remove_session); SSL_CTX_set_quiet_shutdown(ctx, 1); } /* * Check the certificates for revocation. */ #ifdef X509_V_FLAG_CRL_CHECK if (conf->check_crl) { certstore = SSL_CTX_get_cert_store(ctx); if (certstore == NULL) { radlog(L_ERR, "rlm_eap: SSL error %s", ERR_error_string(ERR_get_error(), NULL)); radlog(L_ERR, "rlm_eap_tls: Error reading Certificate Store"); return NULL; } X509_STORE_set_flags(certstore, X509_V_FLAG_CRL_CHECK); if (conf->check_all_crl) { X509_STORE_set_flags(certstore, X509_V_FLAG_CRL_CHECK_ALL); } } #endif /* * Set verify modes * Always verify the peer certificate */ verify_mode |= SSL_VERIFY_PEER; verify_mode |= SSL_VERIFY_FAIL_IF_NO_PEER_CERT; verify_mode |= SSL_VERIFY_CLIENT_ONCE; SSL_CTX_set_verify(ctx, verify_mode, cbtls_verify); if (conf->verify_depth) { SSL_CTX_set_verify_depth(ctx, conf->verify_depth); } /* Load randomness */ if (conf->random_file) { if (!(RAND_load_file(conf->random_file, 1024*1024))) { radlog(L_ERR, "rlm_eap: SSL error %s", ERR_error_string(ERR_get_error(), NULL)); radlog(L_ERR, "rlm_eap_tls: Error loading randomness"); return NULL; } } /* * Set the cipher list if we were told to */ if (conf->cipher_list) { if (!SSL_CTX_set_cipher_list(ctx, conf->cipher_list)) { radlog(L_ERR, "rlm_eap_tls: Error setting cipher list"); return NULL; } } /* * Setup session caching */ if (conf->session_cache_enable) { /* * Create a unique context Id per EAP-TLS configuration. */ if (conf->session_id_name) { snprintf(conf->session_context_id, sizeof(conf->session_context_id), "FR eap %s", conf->session_id_name); } else { snprintf(conf->session_context_id, sizeof(conf->session_context_id), "FR eap %p", conf); } /* * Cache it, and DON'T auto-clear it. */ SSL_CTX_set_session_cache_mode(ctx, SSL_SESS_CACHE_SERVER | SSL_SESS_CACHE_NO_AUTO_CLEAR); SSL_CTX_set_session_id_context(ctx, (unsigned char *) conf->session_context_id, (unsigned int) strlen(conf->session_context_id)); /* * Our timeout is in hours, this is in seconds. */ SSL_CTX_set_timeout(ctx, conf->session_timeout * 3600); /* * Set the maximum number of entries in the * session cache. */ SSL_CTX_sess_set_cache_size(ctx, conf->session_cache_size); } else { SSL_CTX_set_session_cache_mode(ctx, SSL_SESS_CACHE_OFF); } /* * Register the application indices. We can't use * hard-coded "0" and "1" as before, because we need to * set up a "free" handler for the cached session * information. */ if (eaptls_handle_idx < 0) { eaptls_handle_idx = SSL_get_ex_new_index(0, "eaptls_handle_idx", NULL, NULL, NULL); } if (eaptls_conf_idx < 0) { eaptls_conf_idx = SSL_get_ex_new_index(0, "eaptls_conf_idx", NULL, NULL, NULL); } if (eaptls_store_idx < 0) { eaptls_store_idx = SSL_get_ex_new_index(0, "eaptls_store_idx", NULL, NULL, NULL); } if (eaptls_session_idx < 0) { eaptls_session_idx = SSL_SESSION_get_ex_new_index(0, "eaptls_session_idx", NULL, NULL, eaptls_session_free); } return ctx; } /* * Detach the EAP-TLS module. */ static int eaptls_detach(void *arg) { EAP_TLS_CONF *conf; eap_tls_t *inst; inst = (eap_tls_t *) arg; conf = &(inst->conf); if (inst->ctx) SSL_CTX_free(inst->ctx); inst->ctx = NULL; #ifdef HAVE_OPENSSL_OCSP_H if (inst->store) X509_STORE_free(inst->store); inst->store = NULL; #endif free(inst); return 0; } /* * Attach the EAP-TLS module. */ static int eaptls_attach(CONF_SECTION *cs, void **instance) { EAP_TLS_CONF *conf; eap_tls_t *inst; /* Store all these values in the data structure for later references */ inst = (eap_tls_t *)malloc(sizeof(*inst)); if (!inst) { radlog(L_ERR, "rlm_eap_tls: out of memory"); return -1; } memset(inst, 0, sizeof(*inst)); conf = &(inst->conf); /* * Hack: conf is the first structure inside of inst. The * CONF_PARSER stuff above uses offsetof() and * EAP_TLS_CONF, which is technically wrong. */ if (cf_section_parse(cs, inst, module_config) < 0) { eaptls_detach(inst); return -1; } /* * The EAP RFC's say 1020, but we're less picky. */ if (conf->fragment_size < 100) { radlog(L_ERR, "rlm_eap_tls: Fragment size is too small."); eaptls_detach(inst); return -1; } /* * The maximum size for a RADIUS packet is 4096, * minus the header (20), Message-Authenticator (18), * and State (18), etc. results in about 4000 bytes of data * that can be devoted *solely* to EAP. */ if (conf->fragment_size > 4000) { radlog(L_ERR, "rlm_eap_tls: Fragment size is too large."); eaptls_detach(inst); return -1; } /* * Account for the EAP header (4), and the EAP-TLS header * (6), as per Section 4.2 of RFC 2716. What's left is * the maximum amount of data we read from a TLS buffer. */ conf->fragment_size -= 10; /* * This magic makes the administrators life HUGELY easier * on initial deployments. * * If the server starts up in debugging mode, AND the * bootstrap command is configured, AND it exists, AND * there is no server certificate */ if (conf->make_cert_command && (debug_flag >= 2)) { struct stat buf; if ((stat(conf->make_cert_command, &buf) == 0) && (stat(conf->certificate_file, &buf) < 0) && (errno == ENOENT) && (radius_exec_program(conf->make_cert_command, NULL, 1, NULL, 0, EXEC_TIMEOUT, NULL, NULL, 0) != 0)) { eaptls_detach(inst); return -1; } } /* * Initialize TLS */ inst->ctx = init_tls_ctx(conf); if (inst->ctx == NULL) { eaptls_detach(inst); return -1; } #ifdef HAVE_OPENSSL_OCSP_H /* * Initialize OCSP Revocation Store */ if (conf->ocsp_enable) { inst->store = init_revocation_store(conf); if (inst->store == NULL) { eaptls_detach(inst); return -1; } } #endif /*HAVE_OPENSSL_OCSP_H*/ if (load_dh_params(inst->ctx, conf->dh_file) < 0) { eaptls_detach(inst); return -1; } if (generate_eph_rsa_key(inst->ctx) < 0) { eaptls_detach(inst); return -1; } if (conf->verify_tmp_dir) { if (chmod(conf->verify_tmp_dir, S_IRWXU) < 0) { radlog(L_ERR, "rlm_eap_tls: Failed changing permissions on %s: %s", conf->verify_tmp_dir, strerror(errno)); eaptls_detach(inst); return -1; } } if (conf->verify_client_cert_cmd && !conf->verify_tmp_dir) { radlog(L_ERR, "rlm_eap_tls: You MUST set the verify directory in order to use verify_client_cmd"); eaptls_detach(inst); return -1; } *instance = inst; return 0; } /* * Send an initial eap-tls request to the peer. * * Frame eap reply packet. * len = header + type + tls_typedata * tls_typedata = flags(Start (S) bit set, and no data) * * Once having received the peer's Identity, the EAP server MUST * respond with an EAP-TLS/Start packet, which is an * EAP-Request packet with EAP-Type=EAP-TLS, the Start (S) bit * set, and no data. The EAP-TLS conversation will then begin, * with the peer sending an EAP-Response packet with * EAP-Type = EAP-TLS. The data field of that packet will * be the TLS data. * * Fragment length is Framed-MTU - 4. * * http://mail.frascone.com/pipermail/public/eap/2003-July/001426.html */ static int eaptls_initiate(void *type_arg, EAP_HANDLER *handler) { int status; tls_session_t *ssn; eap_tls_t *inst; VALUE_PAIR *vp; int client_cert = TRUE; int verify_mode = 0; REQUEST *request = handler->request; inst = (eap_tls_t *)type_arg; handler->tls = TRUE; handler->finished = FALSE; /* * Manually flush the sessions every so often. If HALF * of the session lifetime has passed since we last * flushed, then flush it again. * * FIXME: Also do it every N sessions? */ if (inst->conf.session_cache_enable && ((inst->conf.session_last_flushed + (inst->conf.session_timeout * 1800)) <= request->timestamp)) { RDEBUG2("Flushing SSL sessions (of #%ld)", SSL_CTX_sess_number(inst->ctx)); SSL_CTX_flush_sessions(inst->ctx, request->timestamp); inst->conf.session_last_flushed = request->timestamp; } /* * If we're TTLS or PEAP, then do NOT require a client * certificate. * * FIXME: This should be more configurable. */ if (handler->eap_type != PW_EAP_TLS) { vp = pairfind(handler->request->config_items, PW_EAP_TLS_REQUIRE_CLIENT_CERT); if (!vp) { client_cert = FALSE; } else { client_cert = vp->vp_integer; } } /* * Every new session is started only from EAP-TLS-START. * Before Sending EAP-TLS-START, open a new SSL session. * Create all the required data structures & store them * in Opaque. So that we can use these data structures * when we get the response */ ssn = eaptls_new_session(inst->ctx, client_cert); if (!ssn) { return 0; } /* * Verify the peer certificate, if asked. */ if (client_cert) { RDEBUG2("Requiring client certificate"); verify_mode = SSL_VERIFY_PEER; verify_mode |= SSL_VERIFY_FAIL_IF_NO_PEER_CERT; verify_mode |= SSL_VERIFY_CLIENT_ONCE; } SSL_set_verify(ssn->ssl, verify_mode, cbtls_verify); /* * Create a structure for all the items required to be * verified for each client and set that as opaque data * structure. * * NOTE: If we want to set each item sepearately then * this index should be global. */ SSL_set_ex_data(ssn->ssl, 0, (void *)handler); SSL_set_ex_data(ssn->ssl, 1, (void *)&(inst->conf)); #ifdef HAVE_OPENSSL_OCSP_H SSL_set_ex_data(ssn->ssl, 2, (void *)inst->store); #endif ssn->length_flag = inst->conf.include_length; /* * We use default fragment size, unless the Framed-MTU * tells us it's too big. Note that we do NOT account * for the EAP-TLS headers if conf->fragment_size is * large, because that config item looks to be confusing. * * i.e. it should REALLY be called MTU, and the code here * should figure out what that means for TLS fragment size. * asking the administrator to know the internal details * of EAP-TLS in order to calculate fragment sizes is * just too much. */ ssn->offset = inst->conf.fragment_size; vp = pairfind(handler->request->packet->vps, PW_FRAMED_MTU); if (vp && ((vp->vp_integer - 14) < ssn->offset)) { /* * Discount the Framed-MTU by: * 4 : EAPOL header * 4 : EAP header (code + id + length) * 1 : EAP type == EAP-TLS * 1 : EAP-TLS Flags * 4 : EAP-TLS Message length * (even if conf->include_length == 0, * just to be lazy). * --- * 14 */ ssn->offset = vp->vp_integer - 14; } handler->opaque = ((void *)ssn); handler->free_opaque = session_free; RDEBUG2("Initiate"); /* * Set up type-specific information. */ switch (handler->eap_type) { case PW_EAP_TLS: default: ssn->prf_label = "client EAP encryption"; break; case PW_EAP_TTLS: ssn->prf_label = "ttls keying material"; break; /* * PEAP-specific breakage. */ case PW_EAP_PEAP: /* * As it is a poorly designed protocol, PEAP uses * bits in the TLS header to indicate PEAP * version numbers. For now, we only support * PEAP version 0, so it doesn't matter too much. * However, if we support later versions of PEAP, * we will need this flag to indicate which * version we're currently dealing with. */ ssn->peap_flag = 0x00; /* * PEAP version 0 requires 'include_length = no', * so rather than hoping the user figures it out, * we force it here. */ ssn->length_flag = 0; ssn->prf_label = "client EAP encryption"; break; } if (inst->conf.session_cache_enable) { ssn->allow_session_resumption = 1; /* otherwise it's zero */ } /* * TLS session initialization is over. Now handle TLS * related handshaking or application data. */ status = eaptls_start(handler->eap_ds, ssn->peap_flag); RDEBUG2("Start returned %d", status); if (status == 0) return 0; /* * The next stage to process the packet. */ handler->stage = AUTHENTICATE; return 1; } /* * Do authentication, by letting EAP-TLS do most of the work. */ static int eaptls_authenticate(void *arg, EAP_HANDLER *handler) { eaptls_status_t status; tls_session_t *tls_session = (tls_session_t *) handler->opaque; REQUEST *request = handler->request; eap_tls_t *inst = (eap_tls_t *) arg; RDEBUG2("Authenticate"); status = eaptls_process(handler); RDEBUG2("eaptls_process returned %d\n", status); switch (status) { /* * EAP-TLS handshake was successful, return an * EAP-TLS-Success packet here. */ case EAPTLS_SUCCESS: if (inst->conf.virtual_server) { VALUE_PAIR *vp; REQUEST *fake; /* create a fake request */ fake = request_alloc_fake(request); rad_assert(fake->packet->vps == NULL); fake->packet->vps = paircopy(request->packet->vps); /* set the virtual server to use */ if ((vp = pairfind(request->config_items, PW_VIRTUAL_SERVER)) != NULL) { fake->server = vp->vp_strvalue; } else { fake->server = inst->conf.virtual_server; } RDEBUG("Processing EAP-TLS Certificate check:"); debug_pair_list(fake->packet->vps); RDEBUG("server %s {", fake->server); rad_virtual_server(fake); RDEBUG("} # server %s", fake->server); /* copy the reply vps back to our reply */ pairadd(&request->reply->vps, fake->reply->vps); fake->reply->vps = NULL; /* reject if virtual server didn't return accept */ if (fake->reply->code != PW_AUTHENTICATION_ACK) { RDEBUG2("Certifictes were rejected by the virtual server"); request_free(&fake); eaptls_fail(handler, 0); return 0; } request_free(&fake); /* success */ } break; /* * The TLS code is still working on the TLS * exchange, and it's a valid TLS request. * do nothing. */ case EAPTLS_HANDLED: return 1; /* * Handshake is done, proceed with decoding tunneled * data. */ case EAPTLS_OK: RDEBUG2("Received unexpected tunneled data after successful handshake."); #ifndef NDEBUG if ((debug_flag > 2) && fr_log_fp) { unsigned int i; unsigned int data_len; unsigned char buffer[1024]; data_len = (tls_session->record_minus)(&tls_session->dirty_in, buffer, sizeof(buffer)); log_debug(" Tunneled data (%u bytes)\n", data_len); for (i = 0; i < data_len; i++) { if ((i & 0x0f) == 0x00) fprintf(fr_log_fp, " %x: ", i); if ((i & 0x0f) == 0x0f) fprintf(fr_log_fp, "\n"); fprintf(fr_log_fp, "%02x ", buffer[i]); } fprintf(fr_log_fp, "\n"); } #endif eaptls_fail(handler, 0); return 0; break; /* * Anything else: fail. * * Also, remove the session from the cache so that * the client can't re-use it. */ default: if (inst->conf.session_cache_enable) { SSL_CTX_remove_session(inst->ctx, tls_session->ssl->session); } return 0; } /* * New sessions cause some additional information to be * cached. */ if (!SSL_session_reused(tls_session->ssl)) { /* * FIXME: Store miscellaneous data. */ RDEBUG2("Adding user data to cached session"); #if 0 SSL_SESSION_set_ex_data(tls_session->ssl->session, ssl_session_idx_user_session, session_data); #endif } else { /* * FIXME: Retrieve miscellaneous data. */ #if 0 data = SSL_SESSION_get_ex_data(tls_session->ssl->session, ssl_session_idx_user_session); if (!session_data) { radlog_request(L_ERR, 0, request, "No user session data in cached session - " " REJECTING"); return 0; } #endif RDEBUG2("Retrieved session data from cached session"); } /* * Success: Automatically return MPPE keys. */ return eaptls_success(handler, 0); } /* * The module name should be the only globally exported symbol. * That is, everything else should be 'static'. */ EAP_TYPE rlm_eap_tls = { "eap_tls", eaptls_attach, /* attach */ eaptls_initiate, /* Start the initial request */ NULL, /* authorization */ eaptls_authenticate, /* authentication */ eaptls_detach /* detach */ }; freeradius-server/src/modules/rlm_eap/types/rlm_eap_tls/rlm_eap_tls.h000066400000000000000000000052051257552170400265220ustar00rootroot00000000000000/* * rlm_eap_tls.h * * Version: $Id$ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2001 hereUare Communications, Inc. * Copyright 2003 Alan DeKok * Copyright 2006 The FreeRADIUS server project */ #ifndef _RLM_EAP_TLS_H #define _RLM_EAP_TLS_H #include RCSIDH(rlm_eap_tls_h, "$Id$") #include "eap_tls.h" #include #include /* configured values goes right here */ typedef struct eap_tls_conf { char *private_key_password; char *private_key_file; char *certificate_file; char *random_file; char *ca_path; char *ca_file; char *dh_file; char *rsa_file; char *make_cert_command; char *virtual_server; int rsa_key; int dh_key; int rsa_key_length; int dh_key_length; int verify_depth; int file_type; int include_length; int disable_tlsv1_1; int disable_tlsv1_2; /* * Always < 4096 (due to radius limit), 0 by default = 2048 */ int fragment_size; int check_crl; int check_all_crl; int allow_expired_crl; char *check_cert_cn; char *cipher_list; char *check_cert_issuer; int session_cache_enable; int session_timeout; int session_cache_size; char *session_id_name; char session_context_id[SSL_MAX_SSL_SESSION_ID_LENGTH]; time_t session_last_flushed; char *verify_tmp_dir; char *verify_client_cert_cmd; #ifdef HAVE_OPENSSL_OCSP_H /* * OCSP Configuration */ int ocsp_enable; int ocsp_override_url; char *ocsp_url; int ocsp_use_nonce; int ocsp_timeout; int ocsp_softfail; #endif #if OPENSSL_VERSION_NUMBER >= 0x0090800fL #ifndef OPENSSL_NO_ECDH char *ecdh_curve; #endif #endif } EAP_TLS_CONF; /* This structure gets stored in arg */ typedef struct _eap_tls_t { EAP_TLS_CONF conf; SSL_CTX *ctx; #ifdef HAVE_OPENSSL_OCSP_H X509_STORE *store; /* OCSP Revocation Store */ #endif } eap_tls_t; #endif /* _RLM_EAP_TLS_H */ freeradius-server/src/modules/rlm_eap/types/rlm_eap_tnc/000077500000000000000000000000001257552170400240305ustar00rootroot00000000000000freeradius-server/src/modules/rlm_eap/types/rlm_eap_tnc/.gitignore000066400000000000000000000000111257552170400260100ustar00rootroot00000000000000Makefile freeradius-server/src/modules/rlm_eap/types/rlm_eap_tnc/Makefile.in000066400000000000000000000005751257552170400261040ustar00rootroot00000000000000# # $Id$ # TARGET = @targetname@ SRCS = rlm_eap_tnc.c eap_tnc.c tncs_connect.c HEADERS = eap_tnc.h tncs.h tncs_connect.h ../../eap.h ../../rlm_eap.h RLM_CFLAGS = -I../.. -I../../libeap @eap_tnc_cflags@ RLM_LIBS = @eap_tnc_ldflags@ ../../libeap/$(LIBPREFIX)freeradius-eap.la RLM_INSTALL = RLM_DIR=../../ include ${RLM_DIR}../rules.mak $(LT_OBJS): $(HEADERS) freeradius-server/src/modules/rlm_eap/types/rlm_eap_tnc/configure000077500000000000000000003071721257552170400257510ustar00rootroot00000000000000#! /bin/sh # From configure.in Revision. # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.61. # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, # 2002, 2003, 2004, 2005, 2006 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=: # 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 # PATH needs CR # 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 # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false 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.) as_nl=' ' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. 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 # Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # CDPATH. $as_unset CDPATH if test "x$CONFIG_SHELL" = x; then if (eval ":") 2>/dev/null; then as_have_required=yes else as_have_required=no fi if test $as_have_required = yes && (eval ": (as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=\$LINENO as_lineno_2=\$LINENO test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } ") 2> /dev/null; then : else as_candidate_shells= as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. case $as_dir in /*) for as_base in sh bash ksh sh5; do as_candidate_shells="$as_candidate_shells $as_dir/$as_base" done;; esac done IFS=$as_save_IFS for as_shell in $as_candidate_shells $SHELL; do # Try only shells that exist, to save several forks. if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { ("$as_shell") 2> /dev/null <<\_ASEOF 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 : _ASEOF }; then CONFIG_SHELL=$as_shell as_have_required=yes if { "$as_shell" 2> /dev/null <<\_ASEOF 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 : (as_func_return () { (exit $1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = "$1" ); then : else exitcode=1 echo positional parameters were not saved. fi test $exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } _ASEOF }; then break fi fi done if test "x$CONFIG_SHELL" != x; then for as_var in BASH_ENV ENV do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done export CONFIG_SHELL exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} fi if test $as_have_required = no; then echo This script requires a shell more modern than all the echo shells that I found on your system. Please install a echo modern shell, or manually run the script under such a echo shell if you do have one. { (exit 1); exit 1; } fi fi fi (eval "as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0") || { echo No shell found that supports shell functions. echo Please tell autoconf@gnu.org about your system, echo including any error possibly output before this echo message } as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, and appends # trailing '-' during substitution so that $LINENO is not a special # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # scripts with optimization help from Paolo Bonzini. 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" || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi 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 fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi 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=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, 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= SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME= PACKAGE_TARNAME= PACKAGE_VERSION= PACKAGE_STRING= PACKAGE_BUGREPORT= ac_unique_file="rlm_eap_tnc.c" ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datarootdir datadir sysconfdir sharedstatedir localstatedir includedir oldincludedir docdir infodir htmldir dvidir pdfdir psdir libdir localedir mandir DEFS ECHO_C ECHO_N ECHO_T LIBS build_alias host_alias target_alias CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT eap_tnc_cflags eap_tnc_ldflags targetname LIBOBJS LTLIBOBJS' ac_subst_files='' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS' # Initialize some variables set by options. ac_init_help= ac_init_version=false # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *) ac_optarg=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_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` eval enable_$ac_feature=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_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` eval enable_$ac_feature=\$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_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/[-.]/_/g'` eval with_$ac_package=\$ac_optarg ;; -without-* | --without-*) ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/[-.]/_/g'` eval with_$ac_package=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 ;; -*) { echo "$as_me: error: unrecognized option: $ac_option Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && 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'` { echo "$as_me: error: missing argument to $ac_option" >&2 { (exit 1); exit 1; }; } fi # Be sure to have absolute directory names. 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 case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; } 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 echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || { echo "$as_me: error: Working directory cannot be determined" >&2 { (exit 1); exit 1; }; } test "X$ac_ls_di" = "X$ac_pwd_ls_di" || { echo "$as_me: error: pwd does not report name of working directory" >&2 { (exit 1); exit 1; }; } # 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 -- "$0" || $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$0" : 'X\(//\)[^/]' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X"$0" | 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 .." { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2 { (exit 1); exit 1; }; } pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures this package to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF _ACEOF fi if test -n "$ac_init_help"; then cat <<\_ACEOF 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 C/C++/Objective C preprocessor flags, e.g. -I if you have headers in a nonstandard directory Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. _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" || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`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 echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF configure generated by GNU Autoconf 2.61 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 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 cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by $as_me, which was generated by GNU Autoconf 2.61. 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=. 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=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; 2) ac_configure_args1="$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 ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac done done $as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } $as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export 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 cat <<\_ASBOX ## ---------------- ## ## Cache variables. ## ## ---------------- ## _ASBOX 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_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( *) $as_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 cat <<\_ASBOX ## ----------------- ## ## Output variables. ## ## ----------------- ## _ASBOX echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then cat <<\_ASBOX ## ------------------- ## ## File substitutions. ## ## ------------------- ## _ASBOX echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then cat <<\_ASBOX ## ----------- ## ## confdefs.h. ## ## ----------- ## _ASBOX echo cat confdefs.h echo fi test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" 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'; { (exit 1); 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 # 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 # Let the site file select an alternate cache file if it wants to. # Prefer explicitly selected file to automatically selected ones. if test -n "$CONFIG_SITE"; then set x "$CONFIG_SITE" elif test "x$prefix" != xNONE; then set x "$prefix/share/config.site" "$prefix/etc/config.site" else set x "$ac_default_prefix/share/config.site" \ "$ac_default_prefix/etc/config.site" fi shift for ac_site_file do if test -r "$ac_site_file"; then { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" 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. if test -f "$cache_file"; then { echo "$as_me:$LINENO: loading cache $cache_file" >&5 echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { echo "$as_me:$LINENO: creating cache $cache_file" >&5 echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 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 { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 echo "$as_me: former value: $ac_old_val" >&2;} { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 echo "$as_me: current value: $ac_new_val" >&2;} ac_cache_corrupted=: fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`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. *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 echo "$as_me: error: changes in the environment can compromise the build" >&2;} { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} { (exit 1); exit 1; }; } 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 x$with_rlm_eap_tnc != xno; then 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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}gcc" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="gcc" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}cc" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="$ac_prog" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&5 echo "$as_me: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } # Provide some information about the compiler. echo "$as_me:$LINENO: checking for C compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (ac_try="$ac_compiler --version >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -v >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -V >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out 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. { echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6; } ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # # List of possible output files, starting from the most likely. # The algorithm is not robust to junk in `.', hence go to wildcards (a.*) # only as a last resort. b.out is created by i960 compilers. ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out' # # The IRIX 6 linker writes into existing files which may not be # executable, retaining their permissions. Remove them first so a # subsequent execution test works. ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link_default") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; 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 | *.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 { echo "$as_me:$LINENO: result: $ac_file" >&5 echo "${ECHO_T}$ac_file" >&6; } if test -z "$ac_file"; then echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: C compiler cannot create executables See \`config.log' for more details." >&5 echo "$as_me: error: C compiler cannot create executables See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } fi ac_exeext=$ac_cv_exeext # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { echo "$as_me:$LINENO: checking whether the C compiler works" >&5 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6; } # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then if { ac_try='./$ac_file' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { echo "$as_me:$LINENO: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&5 echo "$as_me: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi fi fi { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } rm -f a.out a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; } { echo "$as_me:$LINENO: result: $cross_compiling" >&5 echo "${ECHO_T}$cross_compiling" >&6; } { echo "$as_me:$LINENO: checking for suffix of executables" >&5 echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; } if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; 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 | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest$ac_cv_exeext { echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 echo "${ECHO_T}$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT { echo "$as_me:$LINENO: checking for suffix of object files" >&5 echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; } if test "${ac_cv_objext+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; 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 ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 echo "${ECHO_T}$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; } if test "${ac_cv_c_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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 { echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; } GCC=`test $ac_compiler_gnu = yes && echo yes` ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CFLAGS="" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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 { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 echo "${ECHO_T}$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 { echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_c89+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_c89=$ac_arg else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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) { echo "$as_me:$LINENO: result: none needed" >&5 echo "${ECHO_T}none needed" >&6; } ;; xno) { echo "$as_me:$LINENO: result: unsupported" >&5 echo "${ECHO_T}unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;; 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 { echo "$as_me:$LINENO: checking for exchangeTNCCSMessages in -lTNCS" >&5 echo $ECHO_N "checking for exchangeTNCCSMessages in -lTNCS... $ECHO_C" >&6; } if test "${ac_cv_lib_TNCS_exchangeTNCCSMessages+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lTNCS $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any 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 exchangeTNCCSMessages (); int main () { return exchangeTNCCSMessages (); ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_TNCS_exchangeTNCCSMessages=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_TNCS_exchangeTNCCSMessages=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_TNCS_exchangeTNCCSMessages" >&5 echo "${ECHO_T}$ac_cv_lib_TNCS_exchangeTNCCSMessages" >&6; } if test $ac_cv_lib_TNCS_exchangeTNCCSMessages = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBTNCS 1 _ACEOF LIBS="-lTNCS $LIBS" fi if test "x$ac_cv_lib_tncs_exchangetnccsmessages" != xyes; then { echo "$as_me:$LINENO: WARNING: the TNCS library isn't found!" >&5 echo "$as_me: WARNING: the TNCS library isn't found!" >&2;} fail="$fail -lTNCS" fi targetname=rlm_eap_tnc else targetname= echo \*\*\* module rlm_eap_tnc is disabled. fi if test x"$fail" != x""; then if test x"${enable_strict_dependencies}" = x"yes"; then { { echo "$as_me:$LINENO: error: set --without-rlm_eap_tnc to disable it explicitly." >&5 echo "$as_me: error: set --without-rlm_eap_tnc to disable it explicitly." >&2;} { (exit 1); exit 1; }; } else { echo "$as_me:$LINENO: WARNING: silently not building rlm_eap_tnc." >&5 echo "$as_me: WARNING: silently not building rlm_eap_tnc." >&2;} { echo "$as_me:$LINENO: WARNING: FAILURE: rlm_eap_tnc requires: $fail." >&5 echo "$as_me: WARNING: FAILURE: rlm_eap_tnc requires: $fail." >&2;}; targetname="" fi fi unset ac_cv_env_LIBS_set unset ac_cv_env_LIBS_value ac_config_files="$ac_config_files 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_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( *) $as_unset $ac_var ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then test "x$cache_file" != "x/dev/null" && { echo "$as_me:$LINENO: updating cache $cache_file" >&5 echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 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}' # Transform confdefs.h into DEFS. # Protect against shell expansion while executing Makefile rules. # Protect against Makefile macro expansion. # # If the first sed substitution is executed (which looks for macros that # take arguments), then branch to the quote section. Otherwise, # look for a macro that doesn't take arguments. ac_script=' t clear :clear s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g t quote s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g t quote b any :quote s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g s/\[/\\&/g s/\]/\\&/g s/\$/$$/g H :any ${ g s/^\n// s/\n/ /g p } ' DEFS=`sed -n "$ac_script" confdefs.h` ac_libobjs= ac_ltlibobjs= 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=`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. ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs : ${CONFIG_STATUS=./config.status} ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >$CONFIG_STATUS <<_ACEOF #! $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} _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ## --------------------- ## ## 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=: # 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 # PATH needs CR # 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 # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false 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.) as_nl=' ' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. 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 # Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # CDPATH. $as_unset CDPATH as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, and appends # trailing '-' during substitution so that $LINENO is not a special # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # scripts with optimization help from Paolo Bonzini. 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" || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi 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 fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi 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=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 # Save the log message, to keep $[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by $as_me, which was generated by GNU Autoconf 2.61. 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 cat >>$CONFIG_STATUS <<_ACEOF # Files that config.status was made for. config_files="$ac_config_files" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit -q, --quiet 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 Configuration files: $config_files Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ config.status configured by $0, generated by GNU Autoconf 2.61, with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" Copyright (C) 2006 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' _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # If no file are specified by the user, then we need to provide default # value. By we need to know if files were specified by the user. 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=$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 ) echo "$ac_cs_version"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift CONFIG_FILES="$CONFIG_FILES $ac_optarg" ac_need_defaults=false;; --he | --h | --help | --hel | -h ) 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. -*) { echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *) ac_config_targets="$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 if \$ac_cs_recheck; then echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 CONFIG_SHELL=$SHELL export CONFIG_SHELL exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; 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 fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= trap 'exit_status=$? { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status ' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || { echo "$me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } # # Set up the sed scripts for CONFIG_FILES section. # # No need to generate the scripts if there are no CONFIG_FILES. # This happens for instance when ./config.status config.h if test -n "$CONFIG_FILES"; then _ACEOF ac_delim='%!_!# ' for ac_last_try in false false false false false :; do cat >conf$$subs.sed <<_ACEOF SHELL!$SHELL$ac_delim PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim PACKAGE_NAME!$PACKAGE_NAME$ac_delim PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim PACKAGE_STRING!$PACKAGE_STRING$ac_delim PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim exec_prefix!$exec_prefix$ac_delim prefix!$prefix$ac_delim program_transform_name!$program_transform_name$ac_delim bindir!$bindir$ac_delim sbindir!$sbindir$ac_delim libexecdir!$libexecdir$ac_delim datarootdir!$datarootdir$ac_delim datadir!$datadir$ac_delim sysconfdir!$sysconfdir$ac_delim sharedstatedir!$sharedstatedir$ac_delim localstatedir!$localstatedir$ac_delim includedir!$includedir$ac_delim oldincludedir!$oldincludedir$ac_delim docdir!$docdir$ac_delim infodir!$infodir$ac_delim htmldir!$htmldir$ac_delim dvidir!$dvidir$ac_delim pdfdir!$pdfdir$ac_delim psdir!$psdir$ac_delim libdir!$libdir$ac_delim localedir!$localedir$ac_delim mandir!$mandir$ac_delim DEFS!$DEFS$ac_delim ECHO_C!$ECHO_C$ac_delim ECHO_N!$ECHO_N$ac_delim ECHO_T!$ECHO_T$ac_delim LIBS!$LIBS$ac_delim build_alias!$build_alias$ac_delim host_alias!$host_alias$ac_delim target_alias!$target_alias$ac_delim CC!$CC$ac_delim CFLAGS!$CFLAGS$ac_delim LDFLAGS!$LDFLAGS$ac_delim CPPFLAGS!$CPPFLAGS$ac_delim ac_ct_CC!$ac_ct_CC$ac_delim EXEEXT!$EXEEXT$ac_delim OBJEXT!$OBJEXT$ac_delim eap_tnc_cflags!$eap_tnc_cflags$ac_delim eap_tnc_ldflags!$eap_tnc_ldflags$ac_delim targetname!$targetname$ac_delim LIBOBJS!$LIBOBJS$ac_delim LTLIBOBJS!$LTLIBOBJS$ac_delim _ACEOF if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 49; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` if test -n "$ac_eof"; then ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` ac_eof=`expr $ac_eof + 1` fi cat >>$CONFIG_STATUS <<_ACEOF cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof /@[a-zA-Z_][a-zA-Z_0-9]*@/!b end _ACEOF sed ' s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g s/^/s,@/; s/!/@,|#_!!_#|/ :n t n s/'"$ac_delim"'$/,g/; t s/$/\\/; p N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n ' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF :end s/|#_!!_#|//g CEOF$ac_eof _ACEOF # VPATH may cause trouble with some makes, so we remove $(srcdir), # ${srcdir} and @srcdir@ 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[ ]*=/{ s/:*\$(srcdir):*/:/ s/:*\${srcdir}:*/:/ s/:*@srcdir@:*/:/ s/^\([^=]*=[ ]*\):*/\1/ s/:*$// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF fi # test -n "$CONFIG_FILES" for ac_tag in :F $CONFIG_FILES do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5 echo "$as_me: error: Invalid tag $ac_tag." >&2;} { (exit 1); exit 1; }; };; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 echo "$as_me: error: cannot find input file: $ac_f" >&2;} { (exit 1); exit 1; }; };; esac ac_file_inputs="$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 "`IFS=: echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure." if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { echo "$as_me:$LINENO: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} fi case $ac_tag in *:-:* | *:-) cat >"$tmp/stdin";; 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 || 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" case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`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 || 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" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 echo "$as_me: error: cannot create directory $as_dir" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`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 # _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # 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= case `sed -n '/datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p ' $ac_file_inputs` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF 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 sed "$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s&@configure_input@&$configure_input&;t t s&@top_builddir@&$ac_top_builddir_sub&;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 $ac_datarootdir_hack " $ac_file_inputs | sed -f "$tmp/subs-1.sed" >$tmp/out test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&5 echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&2;} rm -f "$tmp/stdin" case $ac_file in -) cat "$tmp/out"; rm -f "$tmp/out";; *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;; esac ;; esac done # for ac_tag { (exit 0); exit 0; } _ACEOF chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save # 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 || { (exit 1); exit 1; } fi freeradius-server/src/modules/rlm_eap/types/rlm_eap_tnc/configure.in000066400000000000000000000014361257552170400263450ustar00rootroot00000000000000AC_INIT(rlm_eap_tnc.c) AC_REVISION($Revision$) AC_DEFUN(modname,[rlm_eap_tnc]) if test x$with_[]modname != xno; then AC_CHECK_LIB(TNCS, exchangeTNCCSMessages) if test "x$ac_cv_lib_tncs_exchangetnccsmessages" != xyes; then AC_MSG_WARN([the TNCS library isn't found!]) fail="$fail -lTNCS" fi targetname=modname else targetname= echo \*\*\* module modname is disabled. fi dnl Don't change this section. if test x"$fail" != x""; then if test x"${enable_strict_dependencies}" = x"yes"; then AC_MSG_ERROR([set --without-]modname[ to disable it explicitly.]) else AC_MSG_WARN([silently not building ]modname[.]) AC_MSG_WARN([FAILURE: ]modname[ requires: $fail.]); targetname="" fi fi AC_SUBST(eap_tnc_cflags) AC_SUBST(eap_tnc_ldflags) AC_SUBST(targetname) AC_OUTPUT(Makefile) freeradius-server/src/modules/rlm_eap/types/rlm_eap_tnc/eap_tnc.c000066400000000000000000000174731257552170400256210ustar00rootroot00000000000000/* * eap_tnc.c EAP TNC functionality. * * This software is Copyright (C) 2006,2007 FH Hannover * * Portions of this code unrelated to FreeRADIUS are available * separately under a commercial license. If you require an * implementation of EAP-TNC that is not under the GPLv2, please * contact tnc@inform.fh-hannover.de for 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * */ #include RCSID("$Id$") /* * * MD5 Packet Format in EAP Type-Data * --- ------ ------ -- --- --------- * 0 1 2 3 * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | Value-Size | Value ... * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | Name ... * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * * EAP-TNC Packet Format in EAP Type-Data * * 0 1 2 3 * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | Flags |Ver | Data Length ... * |L M S R R|=1 | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * |... | Data ... * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * */ #include #include #include "eap.h" #include "eap_tnc.h" /* * WTF is wrong with htonl ? */ static uint32_t ByteSwap2 (uint32_t nLongNumber) { return (((nLongNumber&0x000000FF)<<24)+((nLongNumber&0x0000FF00)<<8)+ ((nLongNumber&0x00FF0000)>>8)+((nLongNumber&0xFF000000)>>24)); } /* * Allocate a new TNC_PACKET */ TNC_PACKET *eaptnc_alloc(void) { TNC_PACKET *rp; if ((rp = malloc(sizeof(TNC_PACKET))) == NULL) { radlog(L_ERR, "rlm_eap_tnc: out of memory"); return NULL; } memset(rp, 0, sizeof(TNC_PACKET)); return rp; } /* * Free TNC_PACKET */ void eaptnc_free(TNC_PACKET **tnc_packet_ptr) { TNC_PACKET *tnc_packet; if (!tnc_packet_ptr) return; tnc_packet = *tnc_packet_ptr; if (tnc_packet == NULL) return; if (tnc_packet->data) free(tnc_packet->data); free(tnc_packet); *tnc_packet_ptr = NULL; } /* * We expect only RESPONSE for which REQUEST, SUCCESS or FAILURE is sent back */ TNC_PACKET *eaptnc_extract(EAP_DS *eap_ds) { tnc_packet_t *data; TNC_PACKET *packet; /* * We need a response, of type EAP-TNC */ if (!eap_ds || !eap_ds->response || (eap_ds->response->code != PW_TNC_RESPONSE) || eap_ds->response->type.type != PW_EAP_TNC || !eap_ds->response->type.data || (eap_ds->response->length <= TNC_HEADER_LEN) || (eap_ds->response->type.data[0] <= 0)) { radlog(L_ERR, "rlm_eap_tnc: corrupted data"); return NULL; } packet = eaptnc_alloc(); if (!packet) return NULL; packet->code = eap_ds->response->code; packet->id = eap_ds->response->id; packet->length = eap_ds->response->length; data = (tnc_packet_t *)eap_ds->response->type.data; /* * Already checked the size above. */ packet->flags_ver = data->flags_ver; unsigned char *ptr = (unsigned char*)data; DEBUG2("Flags/Ver: %x\n", packet->flags_ver); int thisDataLength; int dataStart; if(TNC_LENGTH_INCLUDED(packet->flags_ver)){ DEBUG2("data_length included\n"); // memcpy(&packet->flags_ver[1], &data->flags_ver[1], 4); //packet->data_length = data->data_length; memcpy(&packet->data_length, &ptr[1], TNC_DATA_LENGTH_LENGTH); DEBUG2("data_length: %x\n", packet->data_length); DEBUG2("data_length: %d\n", packet->data_length); DEBUG2("data_length: %x\n", ByteSwap2(packet->data_length)); DEBUG2("data_length: %d\n", ByteSwap2(packet->data_length)); packet->data_length = ByteSwap2(packet->data_length); thisDataLength = packet->length-TNC_PACKET_LENGTH; //1: we need space for flags_ver dataStart = TNC_DATA_LENGTH_LENGTH+TNC_FLAGS_VERSION_LENGTH; }else{ DEBUG2("no data_length included\n"); thisDataLength = packet->length-TNC_PACKET_LENGTH_WITHOUT_DATA_LENGTH; packet->data_length = 0; dataStart = TNC_FLAGS_VERSION_LENGTH; } /* * Allocate room for the data, and copy over the data. */ packet->data = malloc(thisDataLength); if (packet->data == NULL) { radlog(L_ERR, "rlm_eap_tnc: out of memory"); eaptnc_free(&packet); return NULL; } memcpy(packet->data, &(eap_ds->response->type.data[dataStart]), thisDataLength); return packet; } /* * Compose the portions of the reply packet specific to the * EAP-TNC protocol, in the EAP reply typedata */ int eaptnc_compose(EAP_DS *eap_ds, TNC_PACKET *reply) { uint8_t *ptr; if (reply->code < 3) { //fill: EAP-Type (0x888e) eap_ds->request->type.type = PW_EAP_TNC; DEBUG2("TYPE: EAP-TNC set\n"); rad_assert(reply->length > 0); //alloc enough space for whole TNC-Packet (from Code on) eap_ds->request->type.data = calloc(reply->length, sizeof(unsigned char*)); DEBUG2("Malloc %d bytes for packet\n", reply->length); if (eap_ds->request->type.data == NULL) { radlog(L_ERR, "rlm_eap_tnc: out of memory"); return 0; } //put pointer at position where data starts (behind Type) ptr = eap_ds->request->type.data; //*ptr = (uint8_t)(reply->data_length & 0xFF); //ptr++; *ptr = reply->flags_ver; DEBUG2("Set Flags/Version: %d\n", *ptr); if(reply->data_length!=0){ DEBUG2("Set data-length: %d\n", reply->data_length); ptr++; //move to start-position of "data_length" DEBUG2("Set data-length: %x\n", reply->data_length); DEBUG2("Set data-length (swapped): %x\n", ByteSwap2(reply->data_length)); unsigned long swappedDataLength = ByteSwap2(reply->data_length); //DEBUG2("DATA-length: %d", reply->data_ memcpy(ptr, &swappedDataLength, 4); //*ptr = swappedDataLength; } uint16_t thisDataLength=0; if(reply->data!=NULL){ DEBUG2("Adding TNCCS-Data "); int offset; //if data_length-Field present if(reply->data_length !=0){ DEBUG2("with Fragmentation\n"); offset = TNC_DATA_LENGTH_LENGTH; //length of data_length-field: 4 thisDataLength = reply->length-TNC_PACKET_LENGTH; }else{ //data_length-Field not present DEBUG2("without Fragmentation\n"); offset = 1; thisDataLength = reply->length-TNC_PACKET_LENGTH_WITHOUT_DATA_LENGTH; } DEBUG2("TNCCS-Datalength: %d\n", thisDataLength); ptr=ptr+offset; //move to start-position of "data" memcpy(ptr,reply->data, thisDataLength); }else{ DEBUG2("No TNCCS-Data present"); } //the length of the TNC-packet (behind Type) if(reply->data_length!=0){ eap_ds->request->type.length = TNC_DATA_LENGTH_LENGTH+TNC_FLAGS_VERSION_LENGTH+thisDataLength; //4:data_length, 1: flags_ver }else{ eap_ds->request->type.length = TNC_FLAGS_VERSION_LENGTH+thisDataLength; //1: flags_ver } DEBUG2("Packet built\n"); } else { eap_ds->request->type.length = 0; } eap_ds->request->code = reply->code; return 1; } freeradius-server/src/modules/rlm_eap/types/rlm_eap_tnc/eap_tnc.h000066400000000000000000000073731257552170400256240ustar00rootroot00000000000000/* * This software is Copyright (C) 2006,2007 FH Hannover * * Portions of this code unrelated to FreeRADIUS are available * separately under a commercial license. If you require an * implementation of EAP-TNC that is not under the GPLv2, please * contact tnc@inform.fh-hannover.de for 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * */ #ifndef _EAP_TNC_H #define _EAP_TNC_H #include "eap.h" #define PW_TNC_REQUEST 1 #define PW_TNC_RESPONSE 2 #define PW_TNC_SUCCESS 3 #define PW_TNC_FAILURE 4 #define PW_TNC_MAX_CODES 4 #define TNC_HEADER_LEN 4 #define TNC_CHALLENGE_LEN 16 #define TNC_START_LEN 8 #define TNC_PACKET_LENGTH_WITHOUT_DATA_LENGTH 6 #define TNC_PACKET_LENGTH 10 #define TNC_DATA_LENGTH_LENGTH 4 #define TNC_FLAGS_VERSION_LENGTH 1 typedef unsigned int VlanAccessMode; #define VLAN_ISOLATE 97 #define VLAN_ACCESS 2 /* **** * EAP - MD5 doesnot specify code, id & length but chap specifies them, * for generalization purpose, complete header should be sent * and not just value_size, value and name. * future implementation. * * Huh? What does that mean? */ /* * * MD5 Packet Format in EAP Type-Data * --- ------ ------ -- --- --------- * 0 1 2 3 * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | Value-Size | Value ... * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | Name ... * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * * EAP-TNC Packet Format in EAP Type-Data * * 0 1 2 3 * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | Flags |Ver | Data Length ... * |L M S R R|=1 | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * |... | Data ... * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * */ /* eap packet structure */ typedef struct tnc_packet_t { /* uint8_t code; uint8_t id; uint16_t length; */ uint8_t flags_ver; uint32_t data_length; uint8_t *data; } tnc_packet_t; typedef struct tnc_packet { uint8_t code; uint8_t id; uint16_t length; uint8_t flags_ver; uint32_t data_length; uint8_t *data; } TNC_PACKET; #define TNC_START(x) (((x) & 0x20) != 0) #define TNC_MORE_FRAGMENTS(x) (((x) & 0x40) != 0) #define TNC_LENGTH_INCLUDED(x) (((x) & 0x80) != 0) #define TNC_RESERVED_EQ_NULL(x) (((x) & 0x10) == 0 && ((x) & 0x8) == 0) #define TNC_VERSION_EQ_ONE(x) (((x) & 0x07) == 1) #define SET_START(x) ((x) | (0x20)) #define SET_MORE_FRAGMENTS(x) ((x) | (0x40)) #define SET_LENGTH_INCLUDED(x) ((x) | (0x80)) /* function declarations here */ TNC_PACKET *eaptnc_alloc(void); void eaptnc_free(TNC_PACKET **tnc_packet_ptr); int eaptnc_compose(EAP_DS *auth, TNC_PACKET *reply); TNC_PACKET *eaptnc_extract(EAP_DS *auth); int eaptnc_verify(TNC_PACKET *pkt, VALUE_PAIR* pwd, uint8_t *ch); #endif /*_EAP_TNC_H*/ freeradius-server/src/modules/rlm_eap/types/rlm_eap_tnc/rlm_eap_tnc.c000066400000000000000000000261061257552170400264640ustar00rootroot00000000000000/* * rlm_eap_tnc.c Handles that are called from eap * * This software is Copyright (C) 2006,2007 FH Hannover * * Portions of this code unrelated to FreeRADIUS are available * separately under a commercial license. If you require an * implementation of EAP-TNC that is not under the GPLv2, please * contact tnc@inform.fh-hannover.de for 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Modifications to integrate with FreeRADIUS configuration * Copyright (C) 2007 Alan DeKok */ #include RCSID("$Id$") #include #include #include #include "tncs_connect.h" #include "eap_tnc.h" #include "tncs.h" #include typedef struct rlm_eap_tnc_t { char *vlan_access; char *vlan_isolate; char *tnc_path; } rlm_eap_tnc_t; static int sessionCounter=0; /* * Initiate the EAP-MD5 session by sending a challenge to the peer. * Initiate the EAP-TNC session by sending a EAP Request witch Start Bit set * and with no data */ static int tnc_initiate(void *type_data, EAP_HANDLER *handler) { uint8_t flags_ver = 1; //set version to 1 rlm_eap_tnc_t *inst = type_data; TNC_PACKET *reply; if (!handler->request || !handler->request->parent) { DEBUG("rlm_eap_tnc: EAP-TNC can only be run inside of a TLS-based method."); return 0; } /* * FIXME: Update this when the TTLS and PEAP methods can * run EAP-TLC *after* the user has been authenticated. * This likely means moving the phase2 handlers to a * common code base. */ if (1) { DEBUG("rlm-eap_tnc: EAP-TNC can only be run after the user has been authenticated."); return 0; } DEBUG("tnc_initiate: %ld", handler->timestamp); if(connectToTncs(inst->tnc_path)==-1){ DEBUG("Could not connect to TNCS"); } /* * Allocate an EAP-MD5 packet. */ reply = eaptnc_alloc(); if (reply == NULL) { radlog(L_ERR, "rlm_eap_tnc: out of memory"); return 0; } /* * Fill it with data. */ reply->code = PW_TNC_REQUEST; flags_ver = SET_START(flags_ver); //set start-flag DEBUG("$$$$$$$$$$$$$$$$Flags: %d", flags_ver); reply->flags_ver = flags_ver; reply->length = 1+1; /* one byte of flags_ver */ /* * Compose the EAP-TNC packet out of the data structure, * and free it. */ eaptnc_compose(handler->eap_ds, reply); eaptnc_free(&reply); //put sessionAttribute to Handler and increase sessionCounter handler->opaque = calloc(sizeof(TNC_ConnectionID), 1); if (handler->opaque == NULL) { radlog(L_ERR, "rlm_eap_tnc: out of memory"); return 0; } handler->free_opaque = free; memcpy(handler->opaque, &sessionCounter, sizeof(int)); sessionCounter++; /* * We don't need to authorize the user at this point. * * We also don't need to keep the challenge, as it's * stored in 'handler->eap_ds', which will be given back * to us... */ handler->stage = AUTHENTICATE; return 1; } static void setVlanAttribute(rlm_eap_tnc_t *inst, EAP_HANDLER *handler, VlanAccessMode mode){ VALUE_PAIR *vp; char *vlanNumber = NULL; switch(mode){ case VLAN_ISOLATE: vlanNumber = inst->vlan_isolate; vp = pairfind(handler->request->config_items, PW_TNC_VLAN_ISOLATE); if (vp) vlanNumber = vp->vp_strvalue; break; case VLAN_ACCESS: vlanNumber = inst->vlan_access; vp = pairfind(handler->request->config_items, PW_TNC_VLAN_ACCESS); if (vp) vlanNumber = vp->vp_strvalue; break; default: DEBUG2(" rlm_eap_tnc: Internal error. Not setting vlan number"); return; } pairadd(&handler->request->reply->vps, pairmake("Tunnel-Type", "VLAN", T_OP_SET)); pairadd(&handler->request->reply->vps, pairmake("Tunnel-Medium-Type", "IEEE-802", T_OP_SET)); pairadd(&handler->request->reply->vps, pairmake("Tunnel-Private-Group-ID", vlanNumber, T_OP_SET)); } /* * Authenticate a previously sent challenge. */ static int tnc_authenticate(void *type_arg, EAP_HANDLER *handler) { TNC_PACKET *packet; TNC_PACKET *reply; TNC_ConnectionID connId = *((TNC_ConnectionID *) (handler->opaque)); TNC_ConnectionState state; rlm_eap_tnc_t *inst = type_arg; int isAcknowledgement = 0; TNC_UInt32 tnccsMsgLength = 0; int isLengthIncluded; int moreFragments; TNC_UInt32 overallLength; TNC_BufferReference outMessage; TNC_UInt32 outMessageLength = 2; int outIsLengthIncluded=0; int outMoreFragments=0; TNC_UInt32 outOverallLength=0; DEBUG2("HANDLER_OPAQUE: %d", (int) *((TNC_ConnectionID *) (handler->opaque))); DEBUG2("TNC-AUTHENTICATE is starting now for %d..........", (int) connId); /* * Get the User-Password for this user. */ rad_assert(handler->request != NULL); rad_assert(handler->stage == AUTHENTICATE); /* * Extract the EAP-TNC packet. */ if (!(packet = eaptnc_extract(handler->eap_ds))) return 0; /* * Create a reply, and initialize it. */ reply = eaptnc_alloc(); if (!reply) { eaptnc_free(&packet); return 0; } reply->id = handler->eap_ds->request->id; reply->length = 0; if(packet->data_length==0){ tnccsMsgLength = packet->length-TNC_PACKET_LENGTH_WITHOUT_DATA_LENGTH; }else{ tnccsMsgLength = packet->length-TNC_PACKET_LENGTH; } isLengthIncluded = TNC_LENGTH_INCLUDED(packet->flags_ver); moreFragments = TNC_MORE_FRAGMENTS(packet->flags_ver); overallLength = packet->data_length; if(isLengthIncluded == 0 && moreFragments == 0 && overallLength == 0 && tnccsMsgLength == 0 && TNC_START(packet->flags_ver)==0){ isAcknowledgement = 1; } DEBUG("Data received: (%d)", (int) tnccsMsgLength); /* int i; for(i=0;idata)[i]); } DEBUG2("\n"); */ state = exchangeTNCCSMessages(inst->tnc_path, connId, isAcknowledgement, packet->data, tnccsMsgLength, isLengthIncluded, moreFragments, overallLength, &outMessage, &outMessageLength, &outIsLengthIncluded, &outMoreFragments, &outOverallLength); DEBUG("GOT State %08x from TNCS", (unsigned int) state); if(state == TNC_CONNECTION_EAP_ACKNOWLEDGEMENT){ //send back acknoledgement reply->code = PW_TNC_REQUEST; reply->data = NULL; reply->data_length = 0; reply->flags_ver = 1; reply->length =TNC_PACKET_LENGTH_WITHOUT_DATA_LENGTH; }else{ //send back normal message DEBUG("GOT Message from TNCS (length: %d)", (int) outMessageLength); /* for(i=0;icode = PW_TNC_REQUEST; DEBUG2("Set Reply->Code to EAP-REQUEST\n"); break; case TNC_CONNECTION_STATE_ACCESS_ALLOWED: reply->code = PW_TNC_SUCCESS; setVlanAttribute(inst, handler,VLAN_ACCESS); break; case TNC_CONNECTION_STATE_ACCESS_NONE: reply->code = PW_TNC_FAILURE; //setVlanAttribute(inst, handler, VLAN_ISOLATE); break; case TNC_CONNECTION_STATE_ACCESS_ISOLATED: reply->code = PW_TNC_SUCCESS; setVlanAttribute(inst, handler, VLAN_ISOLATE); break; default: reply->code= PW_TNC_FAILURE; } if(outMessage!=NULL && outMessageLength!=0){ reply->data = outMessage; } reply->flags_ver = 1; if(outIsLengthIncluded){ reply->flags_ver = SET_LENGTH_INCLUDED(reply->flags_ver); reply->data_length = outOverallLength; reply->length = TNC_PACKET_LENGTH + outMessageLength; DEBUG("SET LENGTH: %d", reply->length); DEBUG("SET DATALENGTH: %d", (int) outOverallLength); }else{ reply->data_length = 0; reply->length = TNC_PACKET_LENGTH_WITHOUT_DATA_LENGTH + outMessageLength; DEBUG("SET LENGTH: %d", reply->length); } if(outMoreFragments){ reply->flags_ver = SET_MORE_FRAGMENTS(reply->flags_ver); } } /* * Compose the EAP-MD5 packet out of the data structure, * and free it. */ eaptnc_compose(handler->eap_ds, reply); eaptnc_free(&reply); handler->stage = AUTHENTICATE; eaptnc_free(&packet); return 1; } /* * Detach the EAP-TNC module. */ static int tnc_detach(void *arg) { free(arg); return 0; } static CONF_PARSER module_config[] = { { "vlan_access", PW_TYPE_STRING_PTR, offsetof(rlm_eap_tnc_t, vlan_access), NULL, NULL }, { "vlan_isolate", PW_TYPE_STRING_PTR, offsetof(rlm_eap_tnc_t, vlan_isolate), NULL, NULL }, { "tnc_path", PW_TYPE_STRING_PTR, offsetof(rlm_eap_tnc_t, tnc_path), NULL, "/usr/local/lib/libTNCS.so"}, { NULL, -1, 0, NULL, NULL } /* end the list */ }; /* * Attach the EAP-TNC module. */ static int tnc_attach(CONF_SECTION *cs, void **instance) { rlm_eap_tnc_t *inst; inst = malloc(sizeof(*inst)); if (!inst) return -1; memset(inst, 0, sizeof(*inst)); if (cf_section_parse(cs, inst, module_config) < 0) { tnc_detach(inst); return -1; } if (!inst->vlan_access || !inst->vlan_isolate) { radlog(L_ERR, "rlm_eap_tnc: Must set both vlan_access and vlan_isolate"); tnc_detach(inst); return -1; } *instance = inst; return 0; } /* * The module name should be the only globally exported symbol. * That is, everything else should be 'static'. */ EAP_TYPE rlm_eap_tnc = { "eap_tnc", tnc_attach, /* attach */ tnc_initiate, /* Start the initial request */ NULL, /* authorization */ tnc_authenticate, /* authentication */ tnc_detach /* detach */ }; freeradius-server/src/modules/rlm_eap/types/rlm_eap_tnc/tncs.h000066400000000000000000000067231257552170400251600ustar00rootroot00000000000000/* * This software is Copyright (C) 2006,2007 FH Hannover * * Portions of this code unrelated to FreeRADIUS are available * separately under a commercial license. If you require an * implementation of EAP-TNC that is not under the GPLv2, please * contact tnc@inform.fh-hannover.de for 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * */ #ifndef _TNCS_H_ #define _TNCS_H_ #ifdef __cplusplus extern "C" { #endif /* * copied from tncimv.h: */ typedef unsigned long TNC_UInt32; typedef TNC_UInt32 TNC_ConnectionState; typedef unsigned char *TNC_BufferReference; typedef TNC_UInt32 TNC_ConnectionID; #define TNC_CONNECTION_STATE_CREATE 0 #define TNC_CONNECTION_STATE_HANDSHAKE 1 #define TNC_CONNECTION_STATE_ACCESS_ALLOWED 2 #define TNC_CONNECTION_STATE_ACCESS_ISOLATED 3 #define TNC_CONNECTION_STATE_ACCESS_NONE 4 #define TNC_CONNECTION_STATE_DELETE 5 #define TNC_CONNECTION_EAP_ACKNOWLEDGEMENT 6 /* * Accesspoint (as function-pointer) to the TNCS for sending and receiving * TNCCS-Messages. * * -connId: identifies the client which the passed message belongs to. * -isAcknoledgement: 1 if acknoledgement received (then all following in-parameters unimportant * -input: input-TNCCS-message received from the client with connId * -inputLength: length of input-TNCCS-message * -isFirst: 1 if first message in fragmentation else 0 * -moreFragments: are there more Fragments to come (yes: 1, no: 0)? * -overallLength: length of all fragments together (only set if fragmentation) * -output: answer-TNCCS-message from the TNCS to the client * -outputLength: length of answer-TNCCS-message * -answerIsFirst: returned answer is first in row * -moreFragmentsFollow: more fragments after this answer * -overallLengthOut: length of all fragments together (only set if fragmentation) as answer * * return: state of connection as result of the exchange */ typedef TNC_ConnectionState (*ExchangeTNCCSMessagePointer)(/*in*/ TNC_ConnectionID connId, /*in*/ int isAcknoledgement, /*in*/ TNC_BufferReference input, /*in*/ TNC_UInt32 inputLength, /*in*/ int isFirst, /*in*/ int moreFragments, /*in*/ TNC_UInt32 overallLength, /*out*/ TNC_BufferReference *output, /*out*/ TNC_UInt32 *outputLength, /*out*/ int *answerIsFirst, /*out*/ int *moreFragmentsFollow, /*out*/ TNC_UInt32 *overallLengthOut ); #ifdef __cplusplus } #endif #endif //_TNCS_H_ freeradius-server/src/modules/rlm_eap/types/rlm_eap_tnc/tncs_connect.c000066400000000000000000000125101257552170400266530ustar00rootroot00000000000000/* * This software is Copyright (C) 2006,2007 FH Hannover * * Portions of this code unrelated to FreeRADIUS are available * separately under a commercial license. If you require an * implementation of EAP-TNC that is not under the GPLv2, please * contact tnc@inform.fh-hannover.de for 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * */ #include RCSID("$Id$") #include "tncs_connect.h" #include #include #include #include /* * FIXME: This linking should really be done at compile time. */ static lt_dlhandle handle = NULL; static ExchangeTNCCSMessagePointer callTNCS = NULL; /* * returns the function-pointer to a function of a shared-object * * soHandle: handle to a shared-object * name: name of the requested function * * return: the procAddress if found, else NULL */ static void *getProcAddress(lt_dlhandle soHandle, const char *name){ void *proc = lt_dlsym(soHandle, name); DEBUG("Searching for function %s", name); if(proc == NULL){ DEBUG("rlm_eap_tnc: Failed to resolve symbol %s: %s", name, lt_dlerror()); } return proc; } /* * establishs the connection to the TNCCS without calling functionality. * That means that the TNCS-shared-object is loaded and the function-pointer * to "exchangeTNCCSMessages" is explored. * * return: -1 if connect failed, 0 if connect was successful */ int connectToTncs(char *pathToSO){ int state = -1; if(handle==NULL){ handle = lt_dlopen(pathToSO); DEBUG("OPENED HANDLE!"); } if(handle==NULL){ DEBUG("HANDLE IS NULL"); DEBUG("rlm_eap_tnc: Failed to link to library %s: %s", pathToSO, lt_dlerror()); }else{ DEBUG("SO %s found!", pathToSO); if(callTNCS==NULL){ callTNCS = (ExchangeTNCCSMessagePointer) getProcAddress(handle, "exchangeTNCCSMessages"); } if(callTNCS!=NULL){ DEBUG("TNCS is connected"); state = 0; // int ret = callTNCS2(2, "Bla", NULL); // DEBUG("GOT %d from exchangeTNCCSMessages", ret); }else{ DEBUG("Could not find exchangeTNCCSMessages"); } } return state; } /* * Accesspoint to the TNCS for sending and receiving TNCCS-Messages. * -pathToSO: Path to TNCCS-Shared Object * -connId: identifies the client which the passed message belongs to. * -isAcknoledgement: 1 if acknoledgement received (then all following in-parameters unimportant * -input: input-TNCCS-message received from the client with connId * -inputLength: length of input-TNCCS-message * -isFirst: 1 if first message in fragmentation else 0 * -moreFragments: are there more Fragments to come (yes: 1, no: 0)? * -overallLength: length of all fragments together (only set if fragmentation) * -output: answer-TNCCS-message from the TNCS to the client * -outputLength: length of answer-TNCCS-message * -answerIsFirst: returned answer is first in row * -moreFragmentsFollow: more fragments after this answer * -overallLengthOut: length of all fragments together (only set if fragmentation) as answer * * return: state of connection as result of the exchange */ TNC_ConnectionState exchangeTNCCSMessages(/*in*/ char *pathToSO, /*in*/ TNC_ConnectionID connId, /*in*/ int isAcknoledgement, /*in*/ TNC_BufferReference input, /*in*/ TNC_UInt32 inputLength, /*in*/ int isFirst, /*in*/ int moreFragments, /*in*/ TNC_UInt32 overallLength, /*out*/ TNC_BufferReference *output, /*out*/ TNC_UInt32 *outputLength, /*out*/ int *answerIsFirst, /*out*/ int *moreFragmentsFollow, /*out*/ TNC_UInt32 *overallLengthOut){ TNC_ConnectionState state = TNC_CONNECTION_STATE_ACCESS_NONE; int connectStatus = connectToTncs(pathToSO); if(connectStatus!=-1){ state = callTNCS(connId, isAcknoledgement, input, inputLength, isFirst, moreFragments, overallLength, output, outputLength, answerIsFirst, moreFragmentsFollow, overallLengthOut); DEBUG("GOT TNC_ConnectionState (juhuuu): %u", (unsigned int) state); }else{ DEBUG("CAN NOT CONNECT TO TNCS"); } return state; } freeradius-server/src/modules/rlm_eap/types/rlm_eap_tnc/tncs_connect.h000066400000000000000000000064671257552170400266760ustar00rootroot00000000000000/* * This software is Copyright (C) 2006,2007 FH Hannover * * Portions of this code unrelated to FreeRADIUS are available * separately under a commercial license. If you require an * implementation of EAP-TNC that is not under the GPLv2, please * contact tnc@inform.fh-hannover.de for 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * */ #ifndef _TNCS_CONNECT_H_ #define _TNCS_CONNECT_H_ #include "tncs.h" /* * establishs the connection to the TNCCS without calling functionality. * That means that the TNCS-shared-object is loaded and the function-pointer * to "exchangeTNCCSMessages" is explored. * * return: -1 if connect failed, 0 if connect was successful */ int connectToTncs(char *pathToSO); /* * Accesspoint to the TNCS for sending and receiving TNCCS-Messages. * -pathToSO: Path to TNCCS-Shared Object * -connId: identifies the client which the passed message belongs to. * -isAcknoledgement: 1 if acknoledgement received (then all following in-parameters unimportant * -input: input-TNCCS-message received from the client with connId * -inputLength: length of input-TNCCS-message * -isFirst: 1 if first message in fragmentation else 0 * -moreFragments: are there more Fragments to come (yes: 1, no: 0)? * -overallLength: length of all fragments together (only set if fragmentation) * -output: answer-TNCCS-message from the TNCS to the client * -outputLength: length of answer-TNCCS-message * -answerIsFirst: returned answer is first in row * -moreFragmentsFollow: more fragments after this answer * -overallLengthOut: length of all fragments together (only set if fragmentation) as answer * * return: state of connection as result of the exchange */ TNC_ConnectionState exchangeTNCCSMessages(/*in*/ char *pathToSO, /*in*/ TNC_ConnectionID connId, /*in*/ int isAcknoledgement, /*in*/ TNC_BufferReference input, /*in*/ TNC_UInt32 inputLength, /*in*/ int isFirst, /*in*/ int moreFragments, /*in*/ TNC_UInt32 overallLength, /*out*/ TNC_BufferReference *output, /*out*/ TNC_UInt32 *outputLength, /*out*/ int *answerIsFirst, /*out*/ int *moreFragmentsFollow, /*out*/ TNC_UInt32 *overallLengthOut); #endif //_TNCS_CONNECT_H_ freeradius-server/src/modules/rlm_eap/types/rlm_eap_ttls/000077500000000000000000000000001257552170400242325ustar00rootroot00000000000000freeradius-server/src/modules/rlm_eap/types/rlm_eap_ttls/.gitignore000066400000000000000000000000221257552170400262140ustar00rootroot00000000000000Makefile config.h freeradius-server/src/modules/rlm_eap/types/rlm_eap_ttls/Makefile.in000066400000000000000000000005301257552170400262750ustar00rootroot00000000000000# # $Id$ # TARGET = @targetname@ SRCS = rlm_eap_ttls.c ttls.c HEADERS = eap_ttls.h ../../eap.h ../../rlm_eap.h RLM_CFLAGS = -I../.. -I../../libeap @eap_ttls_cflags@ RLM_LIBS = @eap_ttls_ldflags@ ../../libeap/$(LIBPREFIX)freeradius-eap.la RLM_INSTALL = RLM_DIR=../../ include ${RLM_DIR}../rules.mak $(LT_OBJS): $(HEADERS) freeradius-server/src/modules/rlm_eap/types/rlm_eap_ttls/config.h.in000066400000000000000000000007271257552170400262630ustar00rootroot00000000000000/* config.h.in. Generated from configure.in by autoheader. */ /* 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 version of this package. */ #undef PACKAGE_VERSION freeradius-server/src/modules/rlm_eap/types/rlm_eap_ttls/configure000077500000000000000000002273271257552170400261560ustar00rootroot00000000000000#! /bin/sh # From configure.in Revision. # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.61. # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, # 2002, 2003, 2004, 2005, 2006 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=: # 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 # PATH needs CR # 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 # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false 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.) as_nl=' ' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. 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 # Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # CDPATH. $as_unset CDPATH if test "x$CONFIG_SHELL" = x; then if (eval ":") 2>/dev/null; then as_have_required=yes else as_have_required=no fi if test $as_have_required = yes && (eval ": (as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=\$LINENO as_lineno_2=\$LINENO test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } ") 2> /dev/null; then : else as_candidate_shells= as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. case $as_dir in /*) for as_base in sh bash ksh sh5; do as_candidate_shells="$as_candidate_shells $as_dir/$as_base" done;; esac done IFS=$as_save_IFS for as_shell in $as_candidate_shells $SHELL; do # Try only shells that exist, to save several forks. if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { ("$as_shell") 2> /dev/null <<\_ASEOF 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 : _ASEOF }; then CONFIG_SHELL=$as_shell as_have_required=yes if { "$as_shell" 2> /dev/null <<\_ASEOF 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 : (as_func_return () { (exit $1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = "$1" ); then : else exitcode=1 echo positional parameters were not saved. fi test $exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } _ASEOF }; then break fi fi done if test "x$CONFIG_SHELL" != x; then for as_var in BASH_ENV ENV do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done export CONFIG_SHELL exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} fi if test $as_have_required = no; then echo This script requires a shell more modern than all the echo shells that I found on your system. Please install a echo modern shell, or manually run the script under such a echo shell if you do have one. { (exit 1); exit 1; } fi fi fi (eval "as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0") || { echo No shell found that supports shell functions. echo Please tell autoconf@gnu.org about your system, echo including any error possibly output before this echo message } as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, and appends # trailing '-' during substitution so that $LINENO is not a special # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # scripts with optimization help from Paolo Bonzini. 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" || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi 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 fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi 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=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, 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= SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME= PACKAGE_TARNAME= PACKAGE_VERSION= PACKAGE_STRING= PACKAGE_BUGREPORT= ac_unique_file="rlm_eap_ttls.c" ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datarootdir datadir sysconfdir sharedstatedir localstatedir includedir oldincludedir docdir infodir htmldir dvidir pdfdir psdir libdir localedir mandir DEFS ECHO_C ECHO_N ECHO_T LIBS build_alias host_alias target_alias eap_ttls_ldflags eap_ttls_cflags targetname LIBOBJS LTLIBOBJS' ac_subst_files='' ac_precious_vars='build_alias host_alias target_alias' # Initialize some variables set by options. ac_init_help= ac_init_version=false # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *) ac_optarg=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_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` eval enable_$ac_feature=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_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` eval enable_$ac_feature=\$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_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/[-.]/_/g'` eval with_$ac_package=\$ac_optarg ;; -without-* | --without-*) ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/[-.]/_/g'` eval with_$ac_package=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 ;; -*) { echo "$as_me: error: unrecognized option: $ac_option Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && 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'` { echo "$as_me: error: missing argument to $ac_option" >&2 { (exit 1); exit 1; }; } fi # Be sure to have absolute directory names. 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 case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; } 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 echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || { echo "$as_me: error: Working directory cannot be determined" >&2 { (exit 1); exit 1; }; } test "X$ac_ls_di" = "X$ac_pwd_ls_di" || { echo "$as_me: error: pwd does not report name of working directory" >&2 { (exit 1); exit 1; }; } # 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 -- "$0" || $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$0" : 'X\(//\)[^/]' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X"$0" | 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 .." { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2 { (exit 1); exit 1; }; } pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures this package to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF _ACEOF fi if test -n "$ac_init_help"; then cat <<\_ACEOF Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-rlm-eap-ttls-lib-dir directory for eap-ttls libs --with-rlm-eap-ttls-include-dir directory for eap-ttls includes _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" || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`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 echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF configure generated by GNU Autoconf 2.61 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 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 cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by $as_me, which was generated by GNU Autoconf 2.61. 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=. 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=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; 2) ac_configure_args1="$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 ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac done done $as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } $as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export 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 cat <<\_ASBOX ## ---------------- ## ## Cache variables. ## ## ---------------- ## _ASBOX 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_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( *) $as_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 cat <<\_ASBOX ## ----------------- ## ## Output variables. ## ## ----------------- ## _ASBOX echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then cat <<\_ASBOX ## ------------------- ## ## File substitutions. ## ## ------------------- ## _ASBOX echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then cat <<\_ASBOX ## ----------- ## ## confdefs.h. ## ## ----------- ## _ASBOX echo cat confdefs.h echo fi test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" 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'; { (exit 1); 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 # 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 # Let the site file select an alternate cache file if it wants to. # Prefer explicitly selected file to automatically selected ones. if test -n "$CONFIG_SITE"; then set x "$CONFIG_SITE" elif test "x$prefix" != xNONE; then set x "$prefix/share/config.site" "$prefix/etc/config.site" else set x "$ac_default_prefix/share/config.site" \ "$ac_default_prefix/etc/config.site" fi shift for ac_site_file do if test -r "$ac_site_file"; then { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" 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. if test -f "$cache_file"; then { echo "$as_me:$LINENO: loading cache $cache_file" >&5 echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { echo "$as_me:$LINENO: creating cache $cache_file" >&5 echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 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 { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 echo "$as_me: former value: $ac_old_val" >&2;} { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 echo "$as_me: current value: $ac_new_val" >&2;} ac_cache_corrupted=: fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`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. *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 echo "$as_me: error: changes in the environment can compromise the build" >&2;} { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} { (exit 1); exit 1; }; } 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 fail= eap_ttls_ldflags= eap_ttls_cflags= if test x$with_rlm_eap_ttls != xno; then # Check whether --with-rlm-eap-ttls-lib-dir was given. if test "${with_rlm_eap_ttls_lib_dir+set}" = set; then withval=$with_rlm_eap_ttls_lib_dir; eap_ttls_ldflags="-L$withval" fi # Check whether --with-rlm-eap-ttls-include-dir was given. if test "${with_rlm_eap_ttls_include_dir+set}" = set; then withval=$with_rlm_eap_ttls_include_dir; eap_ttls_cflags="-I$withval" fi { echo "$as_me:$LINENO: checking for OpenSSL support" >&5 echo $ECHO_N "checking for OpenSSL support... $ECHO_C" >&6; } if test "x$OPENSSL_LIBS" != "x"; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fail="OpenSSL" fi targetname=rlm_eap_ttls else targetname= echo \*\*\* module rlm_eap_ttls is disabled. fi if test x"$fail" != x""; then if test x"${enable_strict_dependencies}" = x"yes"; then { { echo "$as_me:$LINENO: error: set --without-rlm_eap_ttls to disable it explicitly." >&5 echo "$as_me: error: set --without-rlm_eap_ttls to disable it explicitly." >&2;} { (exit 1); exit 1; }; } else { echo "$as_me:$LINENO: WARNING: silently not building rlm_eap_ttls." >&5 echo "$as_me: WARNING: silently not building rlm_eap_ttls." >&2;} { echo "$as_me:$LINENO: WARNING: FAILURE: rlm_eap_ttls requires: $fail." >&5 echo "$as_me: WARNING: FAILURE: rlm_eap_ttls requires: $fail." >&2;} if test x"$headersuggestion" != x; then { echo "$as_me:$LINENO: WARNING: $headersuggestion" >&5 echo "$as_me: WARNING: $headersuggestion" >&2;} fi if test x"$libsuggestion" != x; then { echo "$as_me:$LINENO: WARNING: $libsuggestion" >&5 echo "$as_me: WARNING: $libsuggestion" >&2;} fi targetname="" fi fi ac_config_headers="$ac_config_headers config.h" unset ac_cv_env_LIBS_set unset ac_cv_env_LIBS_value ac_config_files="$ac_config_files 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_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( *) $as_unset $ac_var ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then test "x$cache_file" != "x/dev/null" && { echo "$as_me:$LINENO: updating cache $cache_file" >&5 echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 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= 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=`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. ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs : ${CONFIG_STATUS=./config.status} ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >$CONFIG_STATUS <<_ACEOF #! $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} _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ## --------------------- ## ## 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=: # 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 # PATH needs CR # 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 # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false 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.) as_nl=' ' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. 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 # Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # CDPATH. $as_unset CDPATH as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, and appends # trailing '-' during substitution so that $LINENO is not a special # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # scripts with optimization help from Paolo Bonzini. 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" || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi 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 fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi 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=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 # Save the log message, to keep $[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by $as_me, which was generated by GNU Autoconf 2.61. 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 cat >>$CONFIG_STATUS <<_ACEOF # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ config.status configured by $0, generated by GNU Autoconf 2.61, with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" Copyright (C) 2006 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' _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # If no file are specified by the user, then we need to provide default # value. By we need to know if files were specified by the user. 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=$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 ) echo "$ac_cs_version"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift CONFIG_FILES="$CONFIG_FILES $ac_optarg" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header { echo "$as_me: error: ambiguous option: $1 Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; };; --help | --hel | -h ) 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. -*) { echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *) ac_config_targets="$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 if \$ac_cs_recheck; then echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 CONFIG_SHELL=$SHELL export CONFIG_SHELL exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # 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" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= trap 'exit_status=$? { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status ' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || { echo "$me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } # # Set up the sed scripts for CONFIG_FILES section. # # No need to generate the scripts if there are no CONFIG_FILES. # This happens for instance when ./config.status config.h if test -n "$CONFIG_FILES"; then _ACEOF ac_delim='%!_!# ' for ac_last_try in false false false false false :; do cat >conf$$subs.sed <<_ACEOF SHELL!$SHELL$ac_delim PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim PACKAGE_NAME!$PACKAGE_NAME$ac_delim PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim PACKAGE_STRING!$PACKAGE_STRING$ac_delim PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim exec_prefix!$exec_prefix$ac_delim prefix!$prefix$ac_delim program_transform_name!$program_transform_name$ac_delim bindir!$bindir$ac_delim sbindir!$sbindir$ac_delim libexecdir!$libexecdir$ac_delim datarootdir!$datarootdir$ac_delim datadir!$datadir$ac_delim sysconfdir!$sysconfdir$ac_delim sharedstatedir!$sharedstatedir$ac_delim localstatedir!$localstatedir$ac_delim includedir!$includedir$ac_delim oldincludedir!$oldincludedir$ac_delim docdir!$docdir$ac_delim infodir!$infodir$ac_delim htmldir!$htmldir$ac_delim dvidir!$dvidir$ac_delim pdfdir!$pdfdir$ac_delim psdir!$psdir$ac_delim libdir!$libdir$ac_delim localedir!$localedir$ac_delim mandir!$mandir$ac_delim DEFS!$DEFS$ac_delim ECHO_C!$ECHO_C$ac_delim ECHO_N!$ECHO_N$ac_delim ECHO_T!$ECHO_T$ac_delim LIBS!$LIBS$ac_delim build_alias!$build_alias$ac_delim host_alias!$host_alias$ac_delim target_alias!$target_alias$ac_delim eap_ttls_ldflags!$eap_ttls_ldflags$ac_delim eap_ttls_cflags!$eap_ttls_cflags$ac_delim targetname!$targetname$ac_delim LIBOBJS!$LIBOBJS$ac_delim LTLIBOBJS!$LTLIBOBJS$ac_delim _ACEOF if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 42; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` if test -n "$ac_eof"; then ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` ac_eof=`expr $ac_eof + 1` fi cat >>$CONFIG_STATUS <<_ACEOF cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof /@[a-zA-Z_][a-zA-Z_0-9]*@/!b end _ACEOF sed ' s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g s/^/s,@/; s/!/@,|#_!!_#|/ :n t n s/'"$ac_delim"'$/,g/; t s/$/\\/; p N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n ' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF :end s/|#_!!_#|//g CEOF$ac_eof _ACEOF # VPATH may cause trouble with some makes, so we remove $(srcdir), # ${srcdir} and @srcdir@ 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[ ]*=/{ s/:*\$(srcdir):*/:/ s/:*\${srcdir}:*/:/ s/:*@srcdir@:*/:/ s/^\([^=]*=[ ]*\):*/\1/ s/:*$// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF fi # test -n "$CONFIG_FILES" for ac_tag in :F $CONFIG_FILES :H $CONFIG_HEADERS do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5 echo "$as_me: error: Invalid tag $ac_tag." >&2;} { (exit 1); exit 1; }; };; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 echo "$as_me: error: cannot find input file: $ac_f" >&2;} { (exit 1); exit 1; }; };; esac ac_file_inputs="$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 "`IFS=: echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure." if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { echo "$as_me:$LINENO: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} fi case $ac_tag in *:-:* | *:-) cat >"$tmp/stdin";; 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 || 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" case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`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 || 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" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 echo "$as_me: error: cannot create directory $as_dir" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`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 # _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # 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= case `sed -n '/datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p ' $ac_file_inputs` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF 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 sed "$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s&@configure_input@&$configure_input&;t t s&@top_builddir@&$ac_top_builddir_sub&;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 $ac_datarootdir_hack " $ac_file_inputs | sed -f "$tmp/subs-1.sed" >$tmp/out test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&5 echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&2;} rm -f "$tmp/stdin" case $ac_file in -) cat "$tmp/out"; rm -f "$tmp/out";; *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;; esac ;; :H) # # CONFIG_HEADER # _ACEOF # Transform confdefs.h into a sed script `conftest.defines', that # substitutes the proper values into config.h.in to produce config.h. rm -f conftest.defines conftest.tail # First, append a space to every undef/define line, to ease matching. echo 's/$/ /' >conftest.defines # Then, protect against being on the right side of a sed subst, or in # an unquoted here document, in config.status. If some macros were # called several times there might be several #defines for the same # symbol, which is useless. But do not sort them, since the last # AC_DEFINE must be honored. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* # These sed commands are passed to sed as "A NAME B PARAMS C VALUE D", where # NAME is the cpp macro being defined, VALUE is the value it is being given. # PARAMS is the parameter list in the macro definition--in most cases, it's # just an empty string. ac_dA='s,^\\([ #]*\\)[^ ]*\\([ ]*' ac_dB='\\)[ (].*,\\1define\\2' ac_dC=' ' ac_dD=' ,' uniq confdefs.h | sed -n ' t rset :rset s/^[ ]*#[ ]*define[ ][ ]*// t ok d :ok s/[\\&,]/\\&/g s/^\('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/ '"$ac_dA"'\1'"$ac_dB"'\2'"${ac_dC}"'\3'"$ac_dD"'/p s/^\('"$ac_word_re"'\)[ ]*\(.*\)/'"$ac_dA"'\1'"$ac_dB$ac_dC"'\2'"$ac_dD"'/p ' >>conftest.defines # Remove the space that was appended to ease matching. # Then 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. # (The regexp can be short, since the line contains either #define or #undef.) echo 's/ $// s,^[ #]*u.*,/* & */,' >>conftest.defines # Break up conftest.defines: ac_max_sed_lines=50 # First sed command is: sed -f defines.sed $ac_file_inputs >"$tmp/out1" # Second one is: sed -f defines.sed "$tmp/out1" >"$tmp/out2" # Third one will be: sed -f defines.sed "$tmp/out2" >"$tmp/out1" # et cetera. ac_in='$ac_file_inputs' ac_out='"$tmp/out1"' ac_nxt='"$tmp/out2"' while : do # Write a here document: cat >>$CONFIG_STATUS <<_ACEOF # First, check the format of the line: cat >"\$tmp/defines.sed" <<\\CEOF /^[ ]*#[ ]*undef[ ][ ]*$ac_word_re[ ]*\$/b def /^[ ]*#[ ]*define[ ][ ]*$ac_word_re[( ]/b def b :def _ACEOF sed ${ac_max_sed_lines}q conftest.defines >>$CONFIG_STATUS echo 'CEOF sed -f "$tmp/defines.sed"' "$ac_in >$ac_out" >>$CONFIG_STATUS ac_in=$ac_out; ac_out=$ac_nxt; ac_nxt=$ac_in sed 1,${ac_max_sed_lines}d conftest.defines >conftest.tail grep . conftest.tail >/dev/null || break rm -f conftest.defines mv conftest.tail conftest.defines done rm -f conftest.defines conftest.tail echo "ac_result=$ac_in" >>$CONFIG_STATUS cat >>$CONFIG_STATUS <<\_ACEOF if test x"$ac_file" != x-; then echo "/* $configure_input */" >"$tmp/config.h" cat "$ac_result" >>"$tmp/config.h" if diff $ac_file "$tmp/config.h" >/dev/null 2>&1; then { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 echo "$as_me: $ac_file is unchanged" >&6;} else rm -f $ac_file mv "$tmp/config.h" $ac_file fi else echo "/* $configure_input */" cat "$ac_result" fi rm -f "$tmp/out12" ;; esac done # for ac_tag { (exit 0); exit 0; } _ACEOF chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save # 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 || { (exit 1); exit 1; } fi freeradius-server/src/modules/rlm_eap/types/rlm_eap_ttls/configure.in000066400000000000000000000031511257552170400265430ustar00rootroot00000000000000# # Autoconf input file. # # Version: $Id$ # AC_PREREQ([2.53]) AC_INIT(rlm_eap_ttls.c) AC_REVISION($Revision$) AC_DEFUN(modname,[rlm_eap_ttls]) fail= eap_ttls_ldflags= eap_ttls_cflags= if test x$with_[]modname != xno; then dnl ############################################################ dnl # Check for command line options dnl ############################################################ AC_ARG_WITH(rlm-eap-ttls-lib-dir, [ --with-rlm-eap-ttls-lib-dir directory for eap-ttls libs], eap_ttls_ldflags="-L$withval") AC_ARG_WITH(rlm-eap-ttls-include-dir, [ --with-rlm-eap-ttls-include-dir directory for eap-ttls includes], eap_ttls_cflags="-I$withval") dnl ############################################################ dnl # Check for OpenSSL support dnl ############################################################ AC_MSG_CHECKING(for OpenSSL support) if test "x$OPENSSL_LIBS" != "x"; then AC_MSG_RESULT(yes) else AC_MSG_RESULT(no) fail="OpenSSL" fi targetname=modname else targetname= echo \*\*\* module modname is disabled. fi if test x"$fail" != x""; then if test x"${enable_strict_dependencies}" = x"yes"; then AC_MSG_ERROR([set --without-]modname[ to disable it explicitly.]) else AC_MSG_WARN([silently not building ]modname[.]) AC_MSG_WARN([FAILURE: ]modname[ requires: $fail.]) if test x"$headersuggestion" != x; then AC_MSG_WARN([$headersuggestion]) fi if test x"$libsuggestion" != x; then AC_MSG_WARN([$libsuggestion]) fi targetname="" fi fi AC_SUBST(eap_ttls_ldflags) AC_SUBST(eap_ttls_cflags) AC_SUBST(targetname) AC_CONFIG_HEADER([config.h]) AC_OUTPUT(Makefile) freeradius-server/src/modules/rlm_eap/types/rlm_eap_ttls/eap_ttls.h000066400000000000000000000026101257552170400262150ustar00rootroot00000000000000/* * eap_ttls.h * * Version: $Id$ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2003 Alan DeKok * Copyright 2006 The FreeRADIUS server project */ #ifndef _EAP_TTLS_H #define _EAP_TTLS_H #include RCSIDH(eap_ttls_h, "$Id$") #include "eap_tls.h" typedef struct ttls_tunnel_t { VALUE_PAIR *username; VALUE_PAIR *state; VALUE_PAIR *accept_vps; int authenticated; int default_eap_type; int copy_request_to_tunnel; int use_tunneled_reply; const char *virtual_server; } ttls_tunnel_t; /* * Process the TTLS portion of an EAP-TTLS request. */ int eapttls_process(EAP_HANDLER *handler, tls_session_t *tls_session); #endif /* _EAP_TTLS_H */ freeradius-server/src/modules/rlm_eap/types/rlm_eap_ttls/rlm_eap_ttls.c000066400000000000000000000171441257552170400270720ustar00rootroot00000000000000/* * rlm_eap_ttls.c contains the interfaces that are called from eap * * Version: $Id$ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2003 Alan DeKok * Copyright 2006 The FreeRADIUS server project */ #include RCSID("$Id$") #include #include "eap_ttls.h" typedef struct rlm_eap_ttls_t { /* * Default tunneled EAP type */ char *default_eap_type_name; int default_eap_type; /* * Use the reply attributes from the tunneled session in * the non-tunneled reply to the client. */ int use_tunneled_reply; /* * Use SOME of the request attributes from outside of the * tunneled session in the tunneled request */ int copy_request_to_tunnel; /* * RFC 5281 (TTLS) says that the length field MUST NOT be * in fragments after the first one. However, we've done * it that way for years, and no one has complained. * * In the interests of allowing the server to follow the * RFC, we add the option here. If set to "no", it sends * the length field in ONLY the first fragment. */ int include_length; /* * Virtual server for inner tunnel session. */ char *virtual_server; } rlm_eap_ttls_t; static CONF_PARSER module_config[] = { { "default_eap_type", PW_TYPE_STRING_PTR, offsetof(rlm_eap_ttls_t, default_eap_type_name), NULL, "md5" }, { "copy_request_to_tunnel", PW_TYPE_BOOLEAN, offsetof(rlm_eap_ttls_t, copy_request_to_tunnel), NULL, "no" }, { "use_tunneled_reply", PW_TYPE_BOOLEAN, offsetof(rlm_eap_ttls_t, use_tunneled_reply), NULL, "no" }, { "virtual_server", PW_TYPE_STRING_PTR, offsetof(rlm_eap_ttls_t, virtual_server), NULL, NULL }, { "include_length", PW_TYPE_BOOLEAN, offsetof(rlm_eap_ttls_t, include_length), NULL, "yes" }, { NULL, -1, 0, NULL, NULL } /* end the list */ }; /* * Detach the module. */ static int eapttls_detach(void *arg) { rlm_eap_ttls_t *inst = (rlm_eap_ttls_t *) arg; free(inst); return 0; } /* * Attach the module. */ static int eapttls_attach(CONF_SECTION *cs, void **instance) { rlm_eap_ttls_t *inst; inst = malloc(sizeof(*inst)); if (!inst) { radlog(L_ERR, "rlm_eap_ttls: out of memory"); return -1; } memset(inst, 0, sizeof(*inst)); /* * Parse the configuration attributes. */ if (cf_section_parse(cs, inst, module_config) < 0) { eapttls_detach(inst); return -1; } /* * Convert the name to an integer, to make it easier to * handle. */ inst->default_eap_type = eaptype_name2type(inst->default_eap_type_name); if (inst->default_eap_type < 0) { radlog(L_ERR, "rlm_eap_ttls: Unknown EAP type %s", inst->default_eap_type_name); eapttls_detach(inst); return -1; } *instance = inst; return 0; } /* * Free the TTLS per-session data */ static void ttls_free(void *p) { ttls_tunnel_t *t = (ttls_tunnel_t *) p; if (!t) return; if (t->username) { DEBUG2("rlm_eap_ttls: Freeing handler for user %s", t->username->vp_strvalue); } pairfree(&t->username); pairfree(&t->state); pairfree(&t->accept_vps); free(t); } /* * Allocate the TTLS per-session data */ static ttls_tunnel_t *ttls_alloc(rlm_eap_ttls_t *inst) { ttls_tunnel_t *t; t = rad_malloc(sizeof(*t)); memset(t, 0, sizeof(*t)); t->default_eap_type = inst->default_eap_type; t->copy_request_to_tunnel = inst->copy_request_to_tunnel; t->use_tunneled_reply = inst->use_tunneled_reply; t->virtual_server = inst->virtual_server; return t; } /* * Do authentication, by letting EAP-TLS do most of the work. */ static int eapttls_authenticate(void *arg, EAP_HANDLER *handler) { int rcode; eaptls_status_t status; rlm_eap_ttls_t *inst = (rlm_eap_ttls_t *) arg; tls_session_t *tls_session = (tls_session_t *) handler->opaque; ttls_tunnel_t *t = (ttls_tunnel_t *) tls_session->opaque; REQUEST *request = handler->request; RDEBUG2("Authenticate"); tls_session->length_flag = inst->include_length; /* * Process TLS layer until done. */ status = eaptls_process(handler); RDEBUG2("eaptls_process returned %d\n", status); switch (status) { /* * EAP-TLS handshake was successful, tell the * client to keep talking. * * If this was EAP-TLS, we would just return * an EAP-TLS-Success packet here. */ case EAPTLS_SUCCESS: if (SSL_session_reused(tls_session->ssl)) { RDEBUG("Skipping Phase2 due to session resumption"); goto do_keys; } if (t && t->authenticated) { RDEBUG2("Using saved attributes from the original Access-Accept"); debug_pair_list(t->accept_vps); pairadd(&handler->request->reply->vps, t->accept_vps); t->accept_vps = NULL; do_keys: /* * Success: Automatically return MPPE keys. */ return eaptls_success(handler, 0); } else { eaptls_request(handler->eap_ds, tls_session); } return 1; /* * The TLS code is still working on the TLS * exchange, and it's a valid TLS request. * do nothing. */ case EAPTLS_HANDLED: return 1; /* * Handshake is done, proceed with decoding tunneled * data. */ case EAPTLS_OK: break; /* * Anything else: fail. */ default: return 0; } /* * Session is established, proceed with decoding * tunneled data. */ RDEBUG2("Session established. Proceeding to decode tunneled attributes."); /* * We may need TTLS data associated with the session, so * allocate it here, if it wasn't already alloacted. */ if (!tls_session->opaque) { tls_session->opaque = ttls_alloc(inst); tls_session->free_opaque = ttls_free; } /* * Process the TTLS portion of the request. */ rcode = eapttls_process(handler, tls_session); switch (rcode) { case PW_AUTHENTICATION_REJECT: eaptls_fail(handler, 0); return 0; /* * Access-Challenge, continue tunneled conversation. */ case PW_ACCESS_CHALLENGE: eaptls_request(handler->eap_ds, tls_session); return 1; /* * Success: Automatically return MPPE keys. */ case PW_AUTHENTICATION_ACK: return eaptls_success(handler, 0); /* * No response packet, MUST be proxying it. * The main EAP module will take care of discovering * that the request now has a "proxy" packet, and * will proxy it, rather than returning an EAP packet. */ case PW_STATUS_CLIENT: #ifdef WITH_PROXY rad_assert(handler->request->proxy != NULL); #endif return 1; break; default: break; } /* * Something we don't understand: Reject it. */ eaptls_fail(handler, 0); return 0; } /* * The module name should be the only globally exported symbol. * That is, everything else should be 'static'. */ EAP_TYPE rlm_eap_ttls = { "eap_ttls", eapttls_attach, /* attach */ /* * Note! There is NO eapttls_initate() function, as the * main EAP module takes care of calling * eaptls_initiate(). * * This is because TTLS is a protocol on top of TLS, so * before we need to do TTLS, we've got to initiate a TLS * session. */ NULL, /* Start the initial request */ NULL, /* authorization */ eapttls_authenticate, /* authentication */ eapttls_detach /* detach */ }; freeradius-server/src/modules/rlm_eap/types/rlm_eap_ttls/ttls.c000066400000000000000000000726451257552170400254020ustar00rootroot00000000000000/* * rlm_eap_ttls.c contains the interfaces that are called from eap * * Version: $Id$ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2003 Alan DeKok * Copyright 2006 The FreeRADIUS server project */ #include RCSID("$Id$") #include "eap_ttls.h" /* * 0 1 2 3 * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | AVP Code | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * |V M r r r r r r| AVP Length | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | Vendor-ID (opt) | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | Data ... * +-+-+-+-+-+-+-+-+ */ /* * Verify that the diameter packet is valid. */ static int diameter_verify(REQUEST *request, const uint8_t *data, unsigned int data_len) { uint32_t attr; uint32_t length; unsigned int hdr_len; unsigned int remaining = data_len; while (remaining > 0) { hdr_len = 12; if (remaining < hdr_len) { RDEBUG2(" Diameter attribute is too small (%u) to contain a Diameter header", remaining); return 0; } memcpy(&attr, data, 4); attr = htonl(attr); memcpy(&length, data + 4, 4); length = ntohl(length); if ((data[4] & 0x80) != 0) { if (remaining < 16) { RDEBUG2(" Diameter attribute is too small to contain a Diameter header with Vendor-Id"); return 0; } hdr_len = 16; } length &= 0x00ffffff; /* * Too short or too long is bad. */ if (length <= (hdr_len - 4)) { RDEBUG2("Tunneled attribute %u is too short (%u < %u) to contain anything useful.", attr, length, hdr_len); return 0; } if (length > remaining) { RDEBUG2("Tunneled attribute %u is longer than room remaining in the packet (%u > %u).", attr, length, remaining); return 0; } /* * Check for broken implementations, which don't * pad the AVP to a 4-octet boundary. */ if (remaining == length) break; /* * The length does NOT include the padding, so * we've got to account for it here by rounding up * to the nearest 4-byte boundary. */ length += 0x03; length &= ~0x03; /* * If the rest of the diameter packet is larger than * this attribute, continue. * * Otherwise, if the attribute over-flows the end * of the packet, die. */ if (remaining < length) { RDEBUG2("ERROR! Diameter attribute overflows packet!"); return 0; } /* * remaining > length, continue. */ remaining -= length; data += length; } /* * We got this far. It looks OK. */ return 1; } /* * Convert diameter attributes to our VALUE_PAIR's */ static VALUE_PAIR *diameter2vp(REQUEST *request, SSL *ssl, const uint8_t *data, size_t data_len) { uint32_t attr; uint32_t length; size_t offset; size_t size; size_t data_left = data_len; VALUE_PAIR *first = NULL; VALUE_PAIR **last = &first; VALUE_PAIR *vp; while (data_left > 0) { rad_assert(data_left <= data_len); memcpy(&attr, data, sizeof(attr)); data += 4; attr = ntohl(attr); memcpy(&length, data, sizeof(length)); data += 4; length = ntohl(length); /* * A "vendor" flag, with a vendor ID of zero, * is equivalent to no vendor. This is stupid. */ offset = 8; if ((length & (1 << 31)) != 0) { uint32_t vendor; memcpy(&vendor, data, sizeof(vendor)); vendor = ntohl(vendor); data += 4; /* skip the vendor field, it's zero */ offset += 4; /* offset to value field */ length &= 0x00ffffff; if (attr > 65535) goto next_attr; if (vendor > 65535) goto next_attr; attr |= (vendor << 16); } /* * Get the length. */ length &= 0x00ffffff; /* * FIXME: Handle the M bit. For now, we assume that * some other module takes care of any attribute * with the M bit set. */ /* * Get the size of the value portion of the * attribute. */ size = length - offset; /* * Vendor attributes can be larger than 255. * Normal attributes cannot be. */ if ((attr > 255) && (VENDOR(attr) == 0)) { RDEBUG2("WARNING: Skipping Diameter attribute %u", attr); goto next_attr; } /* * EAP-Message AVPs can be larger than 253 octets. */ if ((size > 253) && !((VENDOR(attr) == 0) && (attr == PW_EAP_MESSAGE))) { RDEBUG2("WARNING: diameter2vp skipping long attribute %u", attr); goto next_attr; } /* * Create it. If this fails, it's because we're OOM. */ vp = paircreate(attr, PW_TYPE_OCTETS); if (!vp) { RDEBUG2("diameter2vp: Failed creating attribute %u", attr); pairfree(&first); return NULL; } /* * If it's a type from our dictionary, then * we need to put the data in a relevant place. */ switch (vp->type) { case PW_TYPE_INTEGER: case PW_TYPE_DATE: if (size != vp->length) { /* * Bad format. Create a "raw" * attribute. */ raw: vp = paircreate_raw(vp->attribute, PW_TYPE_OCTETS, vp); if (size >= 253) size = 253; vp->length = size; memcpy(vp->vp_octets, data, vp->length); break; } memcpy(&vp->vp_integer, data, vp->length); /* * Stored in host byte order: change it. */ vp->vp_integer = ntohl(vp->vp_integer); break; case PW_TYPE_IPADDR: if (size != vp->length) goto raw; memcpy(&vp->vp_ipaddr, data, vp->length); /* * Stored in network byte order: don't change it. */ break; case PW_TYPE_BYTE: if (size != vp->length) goto raw; vp->vp_integer = data[0]; break; case PW_TYPE_SHORT: if (size != vp->length) goto raw; vp->vp_integer = (data[0] * 256) + data[1]; break; case PW_TYPE_SIGNED: if (size != vp->length) goto raw; memcpy(&vp->vp_signed, data, vp->length); vp->vp_signed = ntohl(vp->vp_signed); break; case PW_TYPE_IPV6ADDR: if (size != vp->length) goto raw; memcpy(&vp->vp_ipv6addr, data, vp->length); break; case PW_TYPE_IPV6PREFIX: if (size != vp->length) goto raw; memcpy(&vp->vp_ipv6prefix, data, vp->length); break; /* * String, octet, etc. Copy the data from the * value field over verbatim. * * FIXME: Ipv6 attributes ? * */ case PW_TYPE_OCTETS: if (attr == PW_EAP_MESSAGE) { const uint8_t *eap_message = data; /* * vp exists the first time around. */ while (1) { vp->length = size; if (vp->length > 253) vp->length = 253; memcpy(vp->vp_octets, eap_message, vp->length); size -= vp->length; eap_message += vp->length; *last = vp; last = &(vp->next); if (size == 0) break; vp = paircreate(attr, PW_TYPE_OCTETS); if (!vp) { RDEBUG2("Failed creating EAP-Message"); pairfree(&first); return NULL; } } goto next_attr; } /* else it's another kind of attribute */ /* FALL-THROUGH */ default: if (size >= 253) size = 253; vp->length = size; memcpy(vp->vp_octets, data, vp->length); break; } /* * User-Password is NUL padded to a multiple * of 16 bytes. Let's chop it to something * more reasonable. * * NOTE: This means that the User-Password * attribute CANNOT EVER have embedded zeros in it! */ switch (vp->attribute) { case PW_USER_PASSWORD: /* * If the password is exactly 16 octets, * it won't be zero-terminated. */ vp->vp_strvalue[vp->length] = '\0'; vp->length = strlen(vp->vp_strvalue); break; /* * Ensure that the client is using the * correct challenge. This weirdness is * to protect against against replay * attacks, where anyone observing the * CHAP exchange could pose as that user, * by simply choosing to use the same * challenge. * * By using a challenge based on * information from the current session, * we can guarantee that the client is * not *choosing* a challenge. * * We're a little forgiving in that we * have loose checks on the length, and * we do NOT check the Id (first octet of * the response to the challenge) * * But if the client gets the challenge correct, * we're not too worried about the Id. */ case PW_CHAP_CHALLENGE: case PW_MSCHAP_CHALLENGE: if ((vp->length < 8) || (vp->length > 16)) { RDEBUG("Tunneled challenge has invalid length"); pairfree(&first); pairfree(&vp); return NULL; } else { uint8_t challenge[16]; eapttls_gen_challenge(ssl, challenge, sizeof(challenge)); if (memcmp(challenge, vp->vp_octets, vp->length) != 0) { RDEBUG("Tunneled challenge is incorrect"); pairfree(&first); pairfree(&vp); return NULL; } } break; default: break; } /* switch over checking/re-writing of attributes. */ /* * Update the list. */ *last = vp; last = &(vp->next); next_attr: /* * Catch non-aligned attributes. */ if (data_left == length) break; /* * The length does NOT include the padding, so * we've got to account for it here by rounding up * to the nearest 4-byte boundary. */ length += 0x03; length &= ~0x03; rad_assert(data_left >= length); data_left -= length; data += length - offset; /* already updated */ } /* * We got this far. It looks OK. */ return first; } /* * Convert VALUE_PAIR's to diameter attributes, and write them * to an SSL session. * * The ONLY VALUE_PAIR's which may be passed to this function * are ones which can go inside of a RADIUS (i.e. diameter) * packet. So no server-configuration attributes, or the like. */ static int vp2diameter(REQUEST *request, tls_session_t *tls_session, VALUE_PAIR *first) { /* * RADIUS packets are no more than 4k in size, so if * we've got more than 4k of data to write, it's very * bad. */ uint8_t buffer[4096]; uint8_t *p; uint32_t attr; uint32_t length; uint32_t vendor; size_t total; VALUE_PAIR *vp; p = buffer; total = 0; for (vp = first; vp != NULL; vp = vp->next) { /* * Too much data: die. */ if ((total + vp->length + 12) >= sizeof(buffer)) { RDEBUG2("output buffer is full!"); return 0; } /* * Hmm... we don't group multiple EAP-Messages * together. Maybe we should... */ /* * Length is no more than 253, due to RADIUS * issues. */ length = vp->length; vendor = (vp->attribute >> 16) & 0xffff; if (vendor != 0) { attr = vp->attribute & 0xffff; length |= (1 << 31); } else { attr = vp->attribute; } /* * Hmm... set the M bit for all attributes? */ length |= (1 << 30); attr = ntohl(attr); memcpy(p, &attr, sizeof(attr)); p += 4; total += 4; length += 8; /* includes 8 bytes of attr & length */ if (vendor != 0) { length += 4; /* include 4 bytes of vendor */ length = ntohl(length); memcpy(p, &length, sizeof(length)); p += 4; total += 4; vendor = ntohl(vendor); memcpy(p, &vendor, sizeof(vendor)); p += 4; total += 4; } else { length = ntohl(length); memcpy(p, &length, sizeof(length)); p += 4; total += 4; } switch (vp->type) { case PW_TYPE_INTEGER: case PW_TYPE_DATE: attr = ntohl(vp->vp_integer); /* stored in host order */ memcpy(p, &attr, sizeof(attr)); length = 4; break; case PW_TYPE_IPADDR: memcpy(p, &vp->vp_ipaddr, 4); /* network order */ length = 4; break; case PW_TYPE_STRING: case PW_TYPE_OCTETS: default: memcpy(p, vp->vp_strvalue, vp->length); length = vp->length; break; } /* * Skip to the end of the data. */ p += length; total += length; /* * Align the data to a multiple of 4 bytes. */ if ((total & 0x03) != 0) { size_t i; length = 4 - (total & 0x03); for (i = 0; i < length; i++) { *p = '\0'; p++; total++; } } } /* loop over the VP's to write. */ /* * Write the data in the buffer to the SSL session. */ if (total > 0) { #ifndef NDEBUG size_t i; if ((debug_flag > 2) && fr_log_fp) { for (i = 0; i < total; i++) { if ((i & 0x0f) == 0) fprintf(fr_log_fp, " TTLS tunnel data out %04x: ", (int) i); fprintf(fr_log_fp, "%02x ", buffer[i]); if ((i & 0x0f) == 0x0f) fprintf(fr_log_fp, "\n"); } if ((total & 0x0f) != 0) fprintf(fr_log_fp, "\n"); } #endif (tls_session->record_plus)(&tls_session->clean_in, buffer, total); /* * FIXME: Check the return code. */ tls_handshake_send(request, tls_session); } /* * Everything's OK. */ return 1; } /* * Use a reply packet to determine what to do. */ static int process_reply(EAP_HANDLER *handler, tls_session_t *tls_session, REQUEST *request, RADIUS_PACKET *reply) { int rcode = RLM_MODULE_REJECT; VALUE_PAIR *vp; ttls_tunnel_t *t = tls_session->opaque; handler = handler; /* -Wunused */ /* * If the response packet was Access-Accept, then * we're OK. If not, die horribly. * * FIXME: Take MS-CHAP2-Success attribute, and * tunnel it back to the client, to authenticate * ourselves to the client. * * FIXME: If we have an Access-Challenge, then * the Reply-Message is tunneled back to the client. * * FIXME: If we have an EAP-Message, then that message * must be tunneled back to the client. * * FIXME: If we have an Access-Challenge with a State * attribute, then do we tunnel that to the client, or * keep track of it ourselves? * * FIXME: EAP-Messages can only start with 'identity', * NOT 'eap start', so we should check for that.... */ switch (reply->code) { case PW_AUTHENTICATION_ACK: RDEBUG("Got tunneled Access-Accept"); rcode = RLM_MODULE_OK; /* * MS-CHAP2-Success means that we do NOT return * an Access-Accept, but instead tunnel that * attribute to the client, and keep going with * the TTLS session. Once the client accepts * our identity, it will respond with an empty * packet, and we will send EAP-Success. */ vp = NULL; pairmove2(&vp, &reply->vps, PW_MSCHAP2_SUCCESS); if (vp) { RDEBUG("Got MS-CHAP2-Success, tunneling it to the client in a challenge."); rcode = RLM_MODULE_HANDLED; t->authenticated = TRUE; /* * Delete MPPE keys & encryption policy. We don't * want these here. */ pairdelete(&reply->vps, ((311 << 16) | 7)); pairdelete(&reply->vps, ((311 << 16) | 8)); pairdelete(&reply->vps, ((311 << 16) | 16)); pairdelete(&reply->vps, ((311 << 16) | 17)); /* * Use the tunneled reply, but not now. */ if (t->use_tunneled_reply) { t->accept_vps = reply->vps; reply->vps = NULL; } } else { /* no MS-CHAP2-Success */ /* * Can only have EAP-Message if there's * no MS-CHAP2-Success. (FIXME: EAP-MSCHAP?) * * We also do NOT tunnel the EAP-Success * attribute back to the client, as the client * can figure it out, from the non-tunneled * EAP-Success packet. */ pairmove2(&vp, &reply->vps, PW_EAP_MESSAGE); pairfree(&vp); } /* * Handle the ACK, by tunneling any necessary reply * VP's back to the client. */ if (vp) { vp2diameter(request, tls_session, vp); pairfree(&vp); } /* * If we've been told to use the attributes from * the reply, then do so. * * WARNING: This may leak information about the * tunneled user! */ if (t->use_tunneled_reply) { pairdelete(&reply->vps, PW_PROXY_STATE); pairadd(&request->reply->vps, reply->vps); reply->vps = NULL; } break; case PW_AUTHENTICATION_REJECT: RDEBUG("Got tunneled Access-Reject"); rcode = RLM_MODULE_REJECT; break; /* * Handle Access-Challenge, but only if we * send tunneled reply data. This is because * an Access-Challenge means that we MUST tunnel * a Reply-Message to the client. */ case PW_ACCESS_CHALLENGE: RDEBUG("Got tunneled Access-Challenge"); /* * Keep the State attribute, if necessary. * * Get rid of the old State, too. */ pairfree(&t->state); pairmove2(&t->state, &reply->vps, PW_STATE); /* * We should really be a bit smarter about this, * and move over only those attributes which * are relevant to the authentication request, * but that's a lot more work, and this "dumb" * method works in 99.9% of the situations. */ vp = NULL; pairmove2(&vp, &reply->vps, PW_EAP_MESSAGE); /* * There MUST be a Reply-Message in the challenge, * which we tunnel back to the client. * * If there isn't one in the reply VP's, then * we MUST create one, with an empty string as * it's value. */ pairmove2(&vp, &reply->vps, PW_REPLY_MESSAGE); /* * Handle the ACK, by tunneling any necessary reply * VP's back to the client. */ if (vp) { vp2diameter(request, tls_session, vp); pairfree(&vp); } rcode = RLM_MODULE_HANDLED; break; default: RDEBUG("Unknown RADIUS packet type %d: rejecting tunneled user", reply->code); rcode = RLM_MODULE_INVALID; break; } return rcode; } #ifdef WITH_PROXY /* * Do post-proxy processing, */ static int eapttls_postproxy(EAP_HANDLER *handler, void *data) { int rcode; tls_session_t *tls_session = (tls_session_t *) data; REQUEST *fake, *request = handler->request; RDEBUG("Passing reply from proxy back into the tunnel."); /* * If there was a fake request associated with the proxied * request, do more processing of it. */ fake = (REQUEST *) request_data_get(handler->request, handler->request->proxy, REQUEST_DATA_EAP_MSCHAP_TUNNEL_CALLBACK); /* * Do the callback, if it exists, and if it was a success. */ if (fake && handler->request->proxy_reply && (handler->request->proxy_reply->code == PW_AUTHENTICATION_ACK)) { /* * Terrible hacks. */ rad_assert(fake->packet == NULL); fake->packet = request->proxy; fake->packet->src_ipaddr = request->packet->src_ipaddr; request->proxy = NULL; rad_assert(fake->reply == NULL); fake->reply = request->proxy_reply; request->proxy_reply = NULL; if ((debug_flag > 0) && fr_log_fp) { fprintf(fr_log_fp, "server %s {\n", (fake->server == NULL) ? "" : fake->server); } /* * Perform a post-auth stage for the tunneled * session. */ fake->options &= ~RAD_REQUEST_OPTION_PROXY_EAP; rcode = rad_postauth(fake); RDEBUG2("post-auth returns %d", rcode); if ((debug_flag > 0) && fr_log_fp) { fprintf(fr_log_fp, "} # server %s\n", (fake->server == NULL) ? "" : fake->server); RDEBUG("Final reply from tunneled session code %s", fr_packet_codes[fake->reply->code]); debug_pair_list(fake->reply->vps); } /* * Terrible hacks. */ request->proxy = fake->packet; fake->packet = NULL; request->proxy_reply = fake->reply; fake->reply = NULL; /* * And we're done with this request. */ switch (rcode) { case RLM_MODULE_FAIL: request_free(&fake); eaptls_fail(handler, 0); return 0; break; default: /* Don't Do Anything */ RDEBUG2("Got reply %d", request->proxy_reply->code); break; } } request_free(&fake); /* robust if fake == NULL */ /* * Process the reply from the home server. */ rcode = process_reply(handler, tls_session, handler->request, handler->request->proxy_reply); /* * The proxy code uses the reply from the home server as * the basis for the reply to the NAS. We don't want that, * so we toss it, after we've had our way with it. */ pairfree(&handler->request->proxy_reply->vps); switch (rcode) { case RLM_MODULE_REJECT: RDEBUG("Reply was rejected"); break; case RLM_MODULE_HANDLED: RDEBUG("Reply was handled"); eaptls_request(handler->eap_ds, tls_session); return 1; case RLM_MODULE_OK: RDEBUG("Reply was OK"); /* * Success: Automatically return MPPE keys. */ return eaptls_success(handler, 0); default: RDEBUG("Reply was unknown."); break; } eaptls_fail(handler, 0); return 0; } /* * Free a request. */ static void my_request_free(void *data) { REQUEST *request = (REQUEST *)data; request_free(&request); } #endif /* WITH_PROXY */ /* * Process the "diameter" contents of the tunneled data. */ int eapttls_process(EAP_HANDLER *handler, tls_session_t *tls_session) { int rcode = PW_AUTHENTICATION_REJECT; REQUEST *fake; VALUE_PAIR *vp; ttls_tunnel_t *t; const uint8_t *data; size_t data_len; REQUEST *request = handler->request; /* * Just look at the buffer directly, without doing * record_minus. */ data_len = tls_session->clean_out.used; tls_session->clean_out.used = 0; data = tls_session->clean_out.data; t = (ttls_tunnel_t *) tls_session->opaque; /* * If there's no data, maybe this is an ACK to an * MS-CHAP2-Success. */ if (data_len == 0) { if (t->authenticated) { RDEBUG("Got ACK, and the user was already authenticated."); return PW_AUTHENTICATION_ACK; } /* else no session, no data, die. */ /* * FIXME: Call SSL_get_error() to see what went * wrong. */ RDEBUG2("SSL_read Error"); return PW_AUTHENTICATION_REJECT; } #ifndef NDEBUG if ((debug_flag > 2) && fr_log_fp) { size_t i; for (i = 0; i < data_len; i++) { if ((i & 0x0f) == 0) fprintf(fr_log_fp, " TTLS tunnel data in %04x: ", (int) i); fprintf(fr_log_fp, "%02x ", data[i]); if ((i & 0x0f) == 0x0f) fprintf(fr_log_fp, "\n"); } if ((data_len & 0x0f) != 0) fprintf(fr_log_fp, "\n"); } #endif if (!diameter_verify(request, data, data_len)) { return PW_AUTHENTICATION_REJECT; } /* * Allocate a fake REQUEST structe. */ fake = request_alloc_fake(request); rad_assert(fake->packet->vps == NULL); /* * Add the tunneled attributes to the fake request. */ fake->packet->vps = diameter2vp(request, tls_session->ssl, data, data_len); if (!fake->packet->vps) { request_free(&fake); return PW_AUTHENTICATION_REJECT; } /* * Tell the request that it's a fake one. */ vp = pairmake("Freeradius-Proxied-To", "127.0.0.1", T_OP_EQ); if (vp) { pairadd(&fake->packet->vps, vp); } if ((debug_flag > 0) && fr_log_fp) { RDEBUG("Got tunneled request"); debug_pair_list(fake->packet->vps); } /* * Update other items in the REQUEST data structure. */ fake->username = pairfind(fake->packet->vps, PW_USER_NAME); fake->password = pairfind(fake->packet->vps, PW_USER_PASSWORD); /* * No User-Name, try to create one from stored data. */ if (!fake->username) { /* * No User-Name in the stored data, look for * an EAP-Identity, and pull it out of there. */ if (!t->username) { vp = pairfind(fake->packet->vps, PW_EAP_MESSAGE); if (vp && (vp->length >= EAP_HEADER_LEN + 2) && (vp->vp_strvalue[0] == PW_EAP_RESPONSE) && (vp->vp_strvalue[EAP_HEADER_LEN] == PW_EAP_IDENTITY) && (vp->vp_strvalue[EAP_HEADER_LEN + 1] != 0)) { /* * Create & remember a User-Name */ t->username = pairmake("User-Name", "", T_OP_EQ); rad_assert(t->username != NULL); memcpy(t->username->vp_strvalue, vp->vp_strvalue + 5, vp->length - 5); t->username->length = vp->length - 5; t->username->vp_strvalue[t->username->length] = 0; RDEBUG("Got tunneled identity of %s", t->username->vp_strvalue); /* * If there's a default EAP type, * set it here. */ if (t->default_eap_type != 0) { RDEBUG("Setting default EAP type for tunneled EAP session."); vp = paircreate(PW_EAP_TYPE, PW_TYPE_INTEGER); rad_assert(vp != NULL); vp->vp_integer = t->default_eap_type; pairadd(&fake->config_items, vp); } } else { /* * Don't reject the request outright, * as it's permitted to do EAP without * user-name. */ RDEBUG2("WARNING! No EAP-Identity found to start EAP conversation."); } } /* else there WAS a t->username */ if (t->username) { vp = paircopy(t->username); pairadd(&fake->packet->vps, vp); fake->username = pairfind(fake->packet->vps, PW_USER_NAME); } } /* else the request ALREADY had a User-Name */ /* * Add the State attribute, too, if it exists. */ if (t->state) { vp = paircopy(t->state); if (vp) pairadd(&fake->packet->vps, vp); } /* * If this is set, we copy SOME of the request attributes * from outside of the tunnel to inside of the tunnel. * * We copy ONLY those attributes which do NOT already * exist in the tunneled request. */ if (t->copy_request_to_tunnel) { VALUE_PAIR *copy; for (vp = request->packet->vps; vp != NULL; vp = vp->next) { /* * The attribute is a server-side thingy, * don't copy it. */ if ((vp->attribute > 255) && (((vp->attribute >> 16) & 0xffff) == 0)) { continue; } /* * The outside attribute is already in the * tunnel, don't copy it. * * This works for BOTH attributes which * are originally in the tunneled request, * AND attributes which are copied there * from below. */ if (pairfind(fake->packet->vps, vp->attribute)) { continue; } /* * Some attributes are handled specially. */ switch (vp->attribute) { /* * NEVER copy Message-Authenticator, * EAP-Message, or State. They're * only for outside of the tunnel. */ case PW_USER_NAME: case PW_USER_PASSWORD: case PW_CHAP_PASSWORD: case PW_CHAP_CHALLENGE: case PW_PROXY_STATE: case PW_MESSAGE_AUTHENTICATOR: case PW_EAP_MESSAGE: case PW_STATE: continue; break; /* * By default, copy it over. */ default: break; } /* * Don't copy from the head, we've already * checked it. */ copy = paircopy2(vp, vp->attribute); pairadd(&fake->packet->vps, copy); } } if ((vp = pairfind(request->config_items, PW_VIRTUAL_SERVER)) != NULL) { fake->server = vp->vp_strvalue; } else if (t->virtual_server) { fake->server = t->virtual_server; } /* else fake->server == request->server */ if ((debug_flag > 0) && fr_log_fp) { RDEBUG("Sending tunneled request"); debug_pair_list(fake->packet->vps); fprintf(fr_log_fp, "server %s {\n", (fake->server == NULL) ? "" : fake->server); } /* * Call authentication recursively, which will * do PAP, CHAP, MS-CHAP, etc. */ rad_virtual_server(fake); /* * Note that we don't do *anything* with the reply * attributes. */ if ((debug_flag > 0) && fr_log_fp) { fprintf(fr_log_fp, "} # server %s\n", (fake->server == NULL) ? "" : fake->server); RDEBUG("Got tunneled reply code %s", fr_packet_codes[fake->reply->code]); debug_pair_list(fake->reply->vps); } /* * Decide what to do with the reply. */ switch (fake->reply->code) { case 0: /* No reply code, must be proxied... */ #ifdef WITH_PROXY vp = pairfind(fake->config_items, PW_PROXY_TO_REALM); if (vp) { eap_tunnel_data_t *tunnel; RDEBUG("Tunneled authentication will be proxied to %s", vp->vp_strvalue); /* * Tell the original request that it's going * to be proxied. */ pairmove2(&(request->config_items), &(fake->config_items), PW_PROXY_TO_REALM); /* * Seed the proxy packet with the * tunneled request. */ rad_assert(request->proxy == NULL); request->proxy = fake->packet; memset(&request->proxy->src_ipaddr, 0, sizeof(request->proxy->src_ipaddr)); memset(&request->proxy->src_ipaddr, 0, sizeof(request->proxy->src_ipaddr)); request->proxy->src_port = 0; request->proxy->dst_port = 0; fake->packet = NULL; rad_free(&fake->reply); fake->reply = NULL; /* * Set up the callbacks for the tunnel */ tunnel = rad_malloc(sizeof(*tunnel)); memset(tunnel, 0, sizeof(*tunnel)); tunnel->tls_session = tls_session; tunnel->callback = eapttls_postproxy; /* * Associate the callback with the request. */ rcode = request_data_add(request, request->proxy, REQUEST_DATA_EAP_TUNNEL_CALLBACK, tunnel, free); rad_assert(rcode == 0); /* * rlm_eap.c has taken care of associating * the handler with the fake request. * * So we associate the fake request with * this request. */ rcode = request_data_add(request, request->proxy, REQUEST_DATA_EAP_MSCHAP_TUNNEL_CALLBACK, fake, my_request_free); rad_assert(rcode == 0); fake = NULL; /* * Didn't authenticate the packet, but * we're proxying it. */ rcode = PW_STATUS_CLIENT; } else #endif /* WITH_PROXY */ { RDEBUG("No tunneled reply was found for request %d , and the request was not proxied: rejecting the user.", request->number); rcode = PW_AUTHENTICATION_REJECT; } break; default: /* * Returns RLM_MODULE_FOO, and we want to return * PW_FOO */ rcode = process_reply(handler, tls_session, request, fake->reply); switch (rcode) { case RLM_MODULE_REJECT: rcode = PW_AUTHENTICATION_REJECT; break; case RLM_MODULE_HANDLED: rcode = PW_ACCESS_CHALLENGE; break; case RLM_MODULE_OK: rcode = PW_AUTHENTICATION_ACK; break; default: rcode = PW_AUTHENTICATION_REJECT; break; } break; } request_free(&fake); return rcode; } freeradius-server/src/modules/rlm_eap2/000077500000000000000000000000001257552170400204635ustar00rootroot00000000000000freeradius-server/src/modules/rlm_eap2/Makefile000066400000000000000000000012141257552170400221210ustar00rootroot00000000000000# # $Id$ # # # This module is EXPERIMENTAL! # # # You will have to edit this Makefile to define where the # hostap distribution is located. # # You will also have to edit: hostap/eap_example/Makefile # to enable it to create a shared library, rather than a static one. # HOSTAP = /path/to/hostap TARGET = SRCS = rlm_eap2.c HEADERS = RLM_CFLAGS = -I$(HOSTAP)/src/eap_common \ -I$(HOSTAP)/src/eap_server -I$(HOSTAP)/src \ -I$(HOSTAP)/src/common -I$(HOSTAP)/src/utils RLM_LIBS = $(HOSTAP)/eap_example/libeap.so ## this uses the RLM_CFLAGS and RLM_LIBS and SRCS defs to make TARGET. include ../rules.mak freeradius-server/src/modules/rlm_eap2/rlm_eap2.c000066400000000000000000000566321257552170400223440ustar00rootroot00000000000000/* * rlm_eap.c contains handles that are called from modules. * * Version: $Id$ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2007 Alan DeKok */ #include RCSID("$Id$") #include #include #include /* * Hostap includes. */ #include #include #include #include struct eap_server_ctx { struct eap_eapol_interface *eap_if; struct eap_sm *eap; void *tls_ctx; }; #define EAP_STATE_LEN (AUTH_VECTOR_LEN) typedef struct EAP_HANDLER { struct EAP_HANDLER *prev, *next; uint8_t state[EAP_STATE_LEN]; fr_ipaddr_t src_ipaddr; time_t timestamp; REQUEST *request; struct rlm_eap_t *inst; struct eapol_callbacks eap_cb; struct eap_config eap_conf; struct eap_server_ctx server_ctx; } EAP_HANDLER; typedef struct rlm_eap_t { rbtree_t *session_tree; EAP_HANDLER *session_head, *session_tail; /* * Configuration items. */ int timer_limit; int cisco_accounting_username_bug; struct tls_connection_params tparams; /* * For EAP-FAST */ char *pac_opaque_encr_key; char *eap_fast_a_id; char *eap_fast_a_id_info; int eap_fast_prov; int pac_key_lifetime; int pac_key_refresh_time; int backend_auth; int num_types; EapType methods[EAP_MAX_METHODS]; int vendors[EAP_MAX_METHODS]; #ifdef HAVE_PTHREAD_H pthread_mutex_t session_mutex; #endif fr_randctx rand_pool; void *tls_ctx; } rlm_eap_t; static void eap_handler_free(EAP_HANDLER *handler) { eap_server_sm_deinit(handler->server_ctx.eap); free(handler); } static void eaplist_free(rlm_eap_t *inst) { EAP_HANDLER *node, *next; for (node = inst->session_head; node != NULL; node = next) { next = node->next; eap_handler_free(node); } inst->session_head = inst->session_tail = NULL; } /* * Return a 32-bit random number. */ static uint32_t eap_rand(fr_randctx *ctx) { uint32_t num; num = ctx->randrsl[ctx->randcnt++]; if (ctx->randcnt == 256) { ctx->randcnt = 0; fr_isaac(ctx); } return num; } /* * Add a handler to the set of active sessions. * * Since we're adding it to the list, we guess that this means * the packet needs a State attribute. So add one. */ static int eaplist_add(rlm_eap_t *inst, EAP_HANDLER *handler) { int i, status; uint32_t lvalue; VALUE_PAIR *state; rad_assert(handler != NULL); rad_assert(handler->request != NULL); /* * Generate State, since we've been asked to add it to * the list. */ state = pairmake("State", "0x00", T_OP_EQ); if (!state) return 0; pairadd(&(handler->request->reply->vps), state); state->length = EAP_STATE_LEN; /* * The time at which this request was made was the time * at which it was received by the RADIUS server. */ handler->timestamp = handler->request->timestamp; handler->src_ipaddr = handler->request->packet->src_ipaddr; /* * We don't need this any more. */ handler->request = NULL; /* * Playing with a data structure shared among threads * means that we need a lock, to avoid conflict. */ pthread_mutex_lock(&(inst->session_mutex)); /* * Create a completely random state. */ for (i = 0; i < 4; i++) { lvalue = eap_rand(&inst->rand_pool); memcpy(state->vp_octets + i * 4, &lvalue, sizeof(lvalue)); } memcpy(handler->state, state->vp_strvalue, sizeof(handler->state)); /* * Big-time failure. */ status = rbtree_insert(inst->session_tree, handler); if (status) { EAP_HANDLER *prev; prev = inst->session_tail; if (prev) { prev->next = handler; handler->prev = prev; handler->next = NULL; inst->session_tail = handler; } else { inst->session_head = inst->session_tail = handler; handler->next = handler->prev = NULL; } } /* * Now that we've finished mucking with the list, * unlock it. */ pthread_mutex_unlock(&(inst->session_mutex)); if (!status) { radlog(L_ERR, "rlm_eap2: Failed to remember handler!"); eap_handler_free(handler); return 0; } return 1; } /* * Find a a previous EAP-Request sent by us, which matches * the current EAP-Response. * * Then, release the handle from the list, and return it to * the caller. * * Also since we fill the eap_ds with the present EAP-Response we * got to free the prev_eapds & move the eap_ds to prev_eapds */ static EAP_HANDLER *eaplist_find(rlm_eap_t *inst, REQUEST *request) { int i; VALUE_PAIR *state; rbnode_t *node; EAP_HANDLER *handler, myHandler; /* * We key the sessions off of the 'state' attribute, so it * must exist. */ state = pairfind(request->packet->vps, PW_STATE); if (!state || (state->length != EAP_STATE_LEN)) { return NULL; } myHandler.src_ipaddr = request->packet->src_ipaddr; memcpy(myHandler.state, state->vp_strvalue, sizeof(myHandler.state)); /* * Playing with a data structure shared among threads * means that we need a lock, to avoid conflict. */ pthread_mutex_lock(&(inst->session_mutex)); /* * Check the first few handlers in the list, and delete * them if they're too old. We don't need to check them * all, as incoming requests will quickly cause older * handlers to be deleted. * */ for (i = 0; i < 2; i++) { handler = inst->session_head; if (handler && ((request->timestamp - handler->timestamp) > inst->timer_limit)) { node = rbtree_find(inst->session_tree, handler); rad_assert(node != NULL); rbtree_delete(inst->session_tree, node); /* * handler == inst->session_head */ inst->session_head = handler->next; if (handler->next) { handler->next->prev = NULL; } else { inst->session_head = NULL; } eap_handler_free(handler); } } handler = NULL; node = rbtree_find(inst->session_tree, &myHandler); if (node) { handler = rbtree_node2data(inst->session_tree, node); /* * Delete old handler from the tree. */ rbtree_delete(inst->session_tree, node); /* * And unsplice it from the linked list. */ if (handler->prev) { handler->prev->next = handler->next; } else { inst->session_head = handler->next; } if (handler->next) { handler->next->prev = handler->prev; } else { inst->session_tail = handler->prev; } handler->prev = handler->next = NULL; } pthread_mutex_unlock(&(inst->session_mutex)); /* * Not found. */ if (!node) { RDEBUG2("Request not found in the list"); return NULL; } /* * Found, but state verification failed. */ if (!handler) { radlog(L_ERR, "rlm_eap2: State verification failed."); return NULL; } RDEBUG2("Request found, released from the list"); return handler; } /* * delete all the allocated space by eap module */ static int eap_detach(void *instance) { rlm_eap_t *inst; inst = (rlm_eap_t *)instance; rbtree_free(inst->session_tree); inst->session_tree = NULL; eaplist_free(inst); eap_server_unregister_methods(); tls_deinit(inst->tls_ctx); pthread_mutex_destroy(&(inst->session_mutex)); free(inst); return 0; } /* * Compare two handlers. */ static int eap_handler_cmp(const void *a, const void *b) { int rcode; const EAP_HANDLER *one = a; const EAP_HANDLER *two = b; rcode = fr_ipaddr_cmp(&one->src_ipaddr, &two->src_ipaddr); if (rcode != 0) return rcode; return memcmp(one->state, two->state, sizeof(one->state)); } static int server_get_eap_user(void *ctx, const u8 *identity, size_t identity_len, int phase2, struct eap_user *user) { int i; VALUE_PAIR *vp; EAP_HANDLER *handler = ctx; REQUEST *request = handler->request; os_memset(user, 0, sizeof(*user)); /* * FIXME: Run through "authorise" again to look up * password for the given identity */ identity = identity; /* -Wunused */ identity_len = identity_len; /* -Wunused */ /* * Do this always, just in case. */ vp = pairfind(request->config_items, PW_CLEARTEXT_PASSWORD); if (vp) { user->password = (u8 *) os_strdup(vp->vp_strvalue); user->password_len = vp->length; } if (!vp) vp = pairfind(request->config_items, PW_NT_PASSWORD); if (vp) { user->password = (u8 *) malloc(vp->length); memcpy(user->password, vp->vp_octets, vp->length); user->password_len = vp->length; } if (!phase2) { for (i = 0; i < handler->inst->num_types; i++) { user->methods[i].vendor = handler->inst->vendors[i]; user->methods[i].method = handler->inst->methods[i]; } return 0; } /* * FIXME: run tunneled sessions through the tunneled portion... */ /* * FIXME: Selectively control tunneled EAP types. */ user->methods[0].vendor = EAP_VENDOR_IETF; user->methods[0].method = EAP_TYPE_MD5; user->methods[1].vendor = EAP_VENDOR_IETF; user->methods[1].method = EAP_TYPE_MSCHAPV2; /* * No password configured... */ return 0; } static const char * server_get_eap_req_id_text(void *ctx, size_t *len) { ctx = ctx; /* -Wunused */ *len = 0; return NULL; } static CONF_PARSER tls_config[] = { /* * TLS parameters. */ { "ca_cert", PW_TYPE_STRING_PTR, offsetof(rlm_eap_t, tparams.ca_cert), NULL, "${confdir}/certs/ca.pem" }, { "server_cert", PW_TYPE_STRING_PTR, offsetof(rlm_eap_t, tparams.client_cert), NULL, "${confdir}/certs/server.pem" }, { "private_key_file", PW_TYPE_STRING_PTR, offsetof(rlm_eap_t, tparams.private_key), NULL, "${confdir}/certs/server.pem" }, { "private_key_password", PW_TYPE_STRING_PTR, offsetof(rlm_eap_t, tparams.private_key_passwd), NULL, "whatever" }, { "dh_file", PW_TYPE_STRING_PTR, offsetof(rlm_eap_t, tparams.dh_file), NULL, "whatever" }, { NULL, -1, 0, NULL, NULL } /* end the list */ }; static CONF_PARSER fast_config[] = { { "pac_opaque_encr_key", PW_TYPE_STRING_PTR, offsetof(rlm_eap_t, pac_opaque_encr_key), NULL, NULL }, { "eap_fast_a_id", PW_TYPE_STRING_PTR, offsetof(rlm_eap_t, eap_fast_a_id), NULL, NULL }, { "eap_fast_a_id_info", PW_TYPE_STRING_PTR, offsetof(rlm_eap_t, eap_fast_a_id_info), NULL, NULL }, { "eap_fast_prov", PW_TYPE_INTEGER, offsetof(rlm_eap_t, eap_fast_prov), NULL, "3"}, { "pac_key_lifetime", PW_TYPE_INTEGER, offsetof(rlm_eap_t, pac_key_lifetime), NULL, "604800"}, { "pac_key_refresh_time", PW_TYPE_INTEGER, offsetof(rlm_eap_t, pac_key_refresh_time), NULL, "86400"}, { NULL, -1, 0, NULL, NULL } /* end the list */ }; static const CONF_PARSER module_config[] = { { "timer_expire", PW_TYPE_INTEGER, offsetof(rlm_eap_t, timer_limit), NULL, "60"}, { "cisco_accounting_username_bug", PW_TYPE_BOOLEAN, offsetof(rlm_eap_t, cisco_accounting_username_bug), NULL, "no" }, { "backend_auth", PW_TYPE_BOOLEAN, offsetof(rlm_eap_t, backend_auth), NULL, "yes" }, { "tls", PW_TYPE_SUBSECTION, 0, NULL, (const void *) tls_config }, { "fast", PW_TYPE_SUBSECTION, 0, NULL, (const void *) fast_config }, { NULL, -1, 0, NULL, NULL } /* end the list */ }; static int eap_example_server_init_tls(rlm_eap_t *inst) { struct tls_config tconf; os_memset(&tconf, 0, sizeof(tconf)); inst->tls_ctx = tls_init(&tconf); if (inst->tls_ctx == NULL) return -1; if (tls_global_set_params(inst->tls_ctx, &inst->tparams)) { radlog(L_ERR, "rlm_eap2: Failed to set TLS parameters"); return -1; } if (tls_global_set_verify(inst->tls_ctx, 0)) { radlog(L_ERR, "rlm_eap2: Failed to set check_crl"); return -1; } return 0; } /* * read the config section and load all the eap authentication types present. */ static int eap_instantiate(CONF_SECTION *cs, void **instance) { int i, num_types; int has_tls, do_tls; rlm_eap_t *inst; CONF_SECTION *scs; inst = (rlm_eap_t *) malloc(sizeof(*inst)); if (!inst) { return -1; } memset(inst, 0, sizeof(*inst)); if (cf_section_parse(cs, inst, module_config) < 0) { eap_detach(inst); return -1; } /* * Create our own random pool. */ for (i = 0; i < 256; i++) { inst->rand_pool.randrsl[i] = fr_rand(); } fr_randinit(&inst->rand_pool, 1); /* * List of sessions are set to NULL by the memset * of 'inst', above. */ /* * Lookup sessions in the tree. We don't free them in * the tree, as that's taken care of elsewhere... */ inst->session_tree = rbtree_create(eap_handler_cmp, NULL, 0); if (!inst->session_tree) { radlog(L_ERR|L_CONS, "rlm_eap2: Cannot initialize tree"); eap_detach(inst); return -1; } /* * This registers ALL available methods. * * FIXME: we probably want to selectively register * some methods. */ if (eap_server_register_methods() < 0) { eap_detach(inst); return -1; } /* Load all the configured EAP-Types */ num_types = 0; has_tls = do_tls = 0; for (scs=cf_subsection_find_next(cs, NULL, NULL); scs != NULL; scs=cf_subsection_find_next(cs, scs, NULL)) { const char *auth_type; char buffer[64], *p; auth_type = cf_section_name1(scs); if (!auth_type) continue; if (num_types >= EAP_MAX_METHODS) { radlog(L_INFO, "WARNING: Ignoring EAP type %s: too many types defined", auth_type); continue; } /* * Hostapd doesn't do case-insensitive comparisons. * So we mash everything to uppercase for it. */ strlcpy(buffer, auth_type, sizeof(buffer)); for (p = buffer; *p; p++) { if (!islower((int)*p)) continue; *p = toupper((int)*p); } inst->methods[num_types] = eap_server_get_type(buffer, &inst->vendors[num_types]); if (inst->methods[num_types] == EAP_TYPE_NONE) { radlog(L_ERR|L_CONS, "rlm_eap2: Unknown EAP type %s", auth_type); eap_detach(inst); return -1; } switch (inst->methods[num_types]) { case EAP_TYPE_TLS: has_tls = TRUE; /* FALL-THROUGH */ case EAP_TYPE_TTLS: case EAP_TYPE_PEAP: case EAP_TYPE_FAST: do_tls = TRUE; break; default: break; } num_types++; /* successfully loaded one more types */ } inst->num_types = num_types; if (do_tls && !has_tls) { radlog(L_ERR|L_CONS, "rlm_eap2: TLS has not been configured. Cannot do methods that need TLS."); eap_detach(inst); return -1; } if (do_tls) { /* * Initialize TLS. */ if (eap_example_server_init_tls(inst) < 0) { radlog(L_ERR|L_CONS, "rlm_eap2: Cannot initialize TLS"); eap_detach(inst); return -1; } } pthread_mutex_init(&(inst->session_mutex), NULL); *instance = inst; return 0; } static int eap_req2vp(EAP_HANDLER *handler) { int encoded, total, size; const uint8_t *ptr; VALUE_PAIR *head = NULL; VALUE_PAIR **tail = &head; VALUE_PAIR *vp; ptr = wpabuf_head(handler->server_ctx.eap_if->eapReqData); encoded = total = wpabuf_len(handler->server_ctx.eap_if->eapReqData); do { size = total; if (size > 253) size = 253; vp = paircreate(PW_EAP_MESSAGE, PW_TYPE_OCTETS); if (!vp) { pairfree(&head); return -1; } memcpy(vp->vp_octets, ptr, size); vp->length = size; *tail = vp; tail = &(vp->next); ptr += size; total -= size; } while (total > 0); pairdelete(&handler->request->reply->vps, PW_EAP_MESSAGE); pairadd(&handler->request->reply->vps, head); return encoded; } static int eap_example_server_step(EAP_HANDLER *handler) { int res, process = 0; REQUEST *request = handler->request; res = eap_server_sm_step(handler->server_ctx.eap); if (handler->server_ctx.eap_if->eapReq) { DEBUG("==> Request"); process = 1; handler->server_ctx.eap_if->eapReq = 0; } if (handler->server_ctx.eap_if->eapSuccess) { DEBUG("==> Success"); process = 1; res = 0; if (handler->server_ctx.eap_if->eapKeyAvailable) { int length = handler->server_ctx.eap_if->eapKeyDataLen; VALUE_PAIR *vp; if (length > 64) { length = 32; } else { length /= 2; /* * FIXME: Length is zero? */ } vp = radius_pairmake(request, &request->reply->vps, "MS-MPPE-Recv-Key", "", T_OP_EQ); if (vp) { memcpy(vp->vp_octets, handler->server_ctx.eap_if->eapKeyData, length); vp->length = length; } vp = radius_pairmake(request, &request->reply->vps, "MS-MPPE-Send-Key", "", T_OP_EQ); if (vp) { memcpy(vp->vp_octets, handler->server_ctx.eap_if->eapKeyData + length, length); vp->length = length; } } } if (handler->server_ctx.eap_if->eapFail) { DEBUG("==> Fail"); process = 1; } if (process) { if (wpabuf_head(handler->server_ctx.eap_if->eapReqData)) { if (!eap_req2vp(handler)) return -1; } else { return -1; } } return res; } /* * Handles multiple EAP-Message attrs * ie concatenates all to get the complete EAP packet. * * NOTE: Sometimes Framed-MTU might contain the length of EAP-Message, * refer fragmentation in rfc2869. */ static int eap_vp2data(VALUE_PAIR *vps, void **data, int *data_len) { VALUE_PAIR *first, *vp; unsigned char *ptr; uint16_t len; int total_len; /* * Get only EAP-Message attribute list */ first = pairfind(vps, PW_EAP_MESSAGE); if (first == NULL) { radlog(L_ERR, "rlm_eap2: EAP-Message not found"); return -1; } /* * Sanity check the length before doing anything. */ if (first->length < 4) { radlog(L_ERR, "rlm_eap2: EAP packet is too short."); return -1; } /* * Get the Actual length from the EAP packet * First EAP-Message contains the EAP packet header */ memcpy(&len, first->vp_strvalue + 2, sizeof(len)); len = ntohs(len); /* * Take out even more weird things. */ if (len < 4) { radlog(L_ERR, "rlm_eap2: EAP packet has invalid length."); return -1; } /* * Sanity check the length, BEFORE malloc'ing memory. */ total_len = 0; for (vp = first; vp; vp = pairfind(vp->next, PW_EAP_MESSAGE)) { total_len += vp->length; if (total_len > len) { radlog(L_ERR, "rlm_eap2: Malformed EAP packet. Length in packet header does not match actual length"); return -1; } } /* * If the length is SMALLER, die, too. */ if (total_len < len) { radlog(L_ERR, "rlm_eap2: Malformed EAP packet. Length in packet header does not match actual length"); return -1; } /* * Now that we know the lengths are OK, allocate memory. */ *data = malloc(len); if (!*data) { radlog(L_ERR, "rlm_eap2: out of memory"); return -1; } *data_len = len; /* * Copy the data from EAP-Message's over to our EAP packet. */ ptr = *data; /* RADIUS ensures order of attrs, so just concatenate all */ for (vp = first; vp; vp = pairfind(vp->next, PW_EAP_MESSAGE)) { memcpy(ptr, vp->vp_strvalue, vp->length); ptr += vp->length; } return 0; } /* * FIXME: Add an "authorize" section which sets Auth-Type = EAP2 * FIXME: Also in "authorize", set User-Name if not already set. */ /* * Do EAP. */ static int eap_authenticate(void *instance, REQUEST *request) { rlm_eap_t *inst; EAP_HANDLER *handler; void *data; int data_len; int rcode; VALUE_PAIR *vp; inst = (rlm_eap_t *) instance; vp = pairfind(request->packet->vps, PW_EAP_MESSAGE); if (!vp) { RDEBUG("No EAP-Message. Not doing EAP."); return RLM_MODULE_FAIL; } /* * Get the eap packet to start with */ data = NULL; data_len = 0; if (eap_vp2data(request->packet->vps, &data, &data_len) < 0) { radlog(L_ERR, "rlm_eap2: Malformed EAP Message"); return RLM_MODULE_FAIL; } vp = pairfind(request->packet->vps, PW_STATE); if (vp) { handler = eaplist_find(inst, request); if (!handler) { RDEBUG("No handler found"); return RLM_MODULE_FAIL; } } else { handler = malloc(sizeof(*handler)); if (!handler) return RLM_MODULE_FAIL; memset(handler, 0, sizeof(*handler)); handler->inst = inst; handler->eap_cb.get_eap_user = server_get_eap_user; handler->eap_cb.get_eap_req_id_text = server_get_eap_req_id_text; handler->eap_conf.eap_server = 1; handler->eap_conf.ssl_ctx = inst->tls_ctx; /* * Copy EAP-FAST parameters. */ handler->eap_conf.pac_opaque_encr_key = inst->pac_opaque_encr_key; handler->eap_conf.eap_fast_a_id = inst->eap_fast_a_id; handler->eap_conf.eap_fast_a_id_len = strlen(inst->eap_fast_a_id); handler->eap_conf.eap_fast_a_id_info = inst->eap_fast_a_id_info; handler->eap_conf.eap_fast_prov = inst->eap_fast_prov; handler->eap_conf.pac_key_lifetime = inst->pac_key_lifetime; handler->eap_conf.pac_key_refresh_time = inst->pac_key_refresh_time; handler->eap_conf.backend_auth = inst->backend_auth; handler->server_ctx.eap = eap_server_sm_init(handler, &handler->eap_cb, &handler->eap_conf); if (handler->server_ctx.eap == NULL) { free(handler); return RLM_MODULE_FAIL; } handler->server_ctx.eap_if = eap_get_interface(handler->server_ctx.eap); /* Enable "port" and request EAP to start authentication. */ handler->server_ctx.eap_if->portEnabled = TRUE; handler->server_ctx.eap_if->eapRestart = TRUE; } handler->request = request; wpabuf_free(handler->server_ctx.eap_if->eapRespData); handler->server_ctx.eap_if->eapRespData = wpabuf_alloc_copy(data, data_len); if (handler->server_ctx.eap_if->eapRespData) { handler->server_ctx.eap_if->eapResp = TRUE; } if (eap_example_server_step(handler) < 0) { RDEBUG("Failed in EAP library"); goto fail; } if (handler->server_ctx.eap_if->eapSuccess) { request->reply->code = PW_AUTHENTICATION_ACK; rcode = RLM_MODULE_OK; } else if (handler->server_ctx.eap_if->eapFail) { fail: request->reply->code = PW_AUTHENTICATION_REJECT; rcode = RLM_MODULE_REJECT; } else { request->reply->code = PW_ACCESS_CHALLENGE; rcode = RLM_MODULE_HANDLED; } if (handler->server_ctx.eap_if->eapFail || handler->server_ctx.eap_if->eapSuccess) { RDEBUG2("Freeing handler"); /* handler is not required any more, free it now */ eap_handler_free(handler); handler = NULL; } else { eaplist_add(inst, handler); } /* * If it's an Access-Accept, RFC 2869, Section 2.3.1 * says that we MUST include a User-Name attribute in the * Access-Accept. */ if ((request->reply->code == PW_AUTHENTICATION_ACK) && request->username) { /* * Doesn't exist, add it in. */ vp = pairfind(request->reply->vps, PW_USER_NAME); if (!vp) { vp = pairmake("User-Name", request->username->vp_strvalue, T_OP_EQ); rad_assert(vp != NULL); pairadd(&(request->reply->vps), vp); } /* * Cisco AP1230 has a bug and needs a zero * terminated string in Access-Accept. */ if ((inst->cisco_accounting_username_bug) && (vp->length < (int) sizeof(vp->vp_strvalue))) { vp->vp_strvalue[vp->length] = '\0'; vp->length++; } } vp = pairfind(request->reply->vps, PW_MESSAGE_AUTHENTICATOR); if (!vp) { vp = paircreate(PW_MESSAGE_AUTHENTICATOR, PW_TYPE_OCTETS); memset(vp->vp_strvalue, 0, AUTH_VECTOR_LEN); vp->length = AUTH_VECTOR_LEN; pairadd(&(request->reply->vps), vp); } return rcode; } /* * The module name should be the only globally exported symbol. * That is, everything else should be 'static'. */ module_t rlm_eap2 = { RLM_MODULE_INIT, "eap2", RLM_TYPE_CHECK_CONFIG_SAFE, /* type */ eap_instantiate, /* instantiation */ eap_detach, /* detach */ { eap_authenticate, /* authentication */ NULL, /* authorization */ NULL, /* preaccounting */ NULL, /* accounting */ NULL, /* checksimul */ NULL, /* pre-proxy */ NULL, /* post-proxy */ NULL /* post-auth */ }, }; freeradius-server/src/modules/rlm_example/000077500000000000000000000000001257552170400212675ustar00rootroot00000000000000freeradius-server/src/modules/rlm_example/Makefile.clean000066400000000000000000000002701257552170400240070ustar00rootroot00000000000000TARGET = rlm_example SRCS = rlm_example.c other.c HEADERS = config.h other.h RLM_CFLAGS = RLM_LIBS = include ../rules.mak $(STATIC_OBJS): $(HEADERS) $(DYNAMIC_OBJS): $(HEADERS) freeradius-server/src/modules/rlm_example/Makefile.in000066400000000000000000000024641257552170400233420ustar00rootroot00000000000000####################################################################### # # TARGET should be set by autoconf only. Don't touch it. # # The SRCS definition should list ALL source files. # # The HEADERS definition should list ALL header files # # RLM_CFLAGS defines addition C compiler flags. You usually don't # want to modify this, though. Get it from autoconf. # # The RLM_LIBS definition should list ALL required libraries. # These libraries really should be pulled from the 'config.mak' # definitions, if at all possible. These definitions are also # echoed into another file in ../lib, where they're picked up by # ../main/Makefile for building the version of the server with # statically linked modules. Get it from autoconf. # # RLM_INSTALL is the names of additional rules you need to install # some particular portion of the module. Usually, leave it blank. # ####################################################################### TARGET = @targetname@ SRCS = rlm_example.c other.c HEADERS = other.h RLM_CFLAGS = @example_cflags@ RLM_LIBS = @example_ldflags@ RLM_INSTALL = install-example ## this uses the RLM_CFLAGS and RLM_LIBS and SRCS defs to make TARGET. include ../rules.mak $(LT_OBJS): $(HEADERS) ## the rule that RLM_INSTALL tells the parent rules.mak to use. install-example: touch . freeradius-server/src/modules/rlm_example/config.h.in000066400000000000000000000026321257552170400233150ustar00rootroot00000000000000/* config.h.in. Generated from configure.in by autoheader. */ /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Define to 1 if you have the `printf' function. */ #undef HAVE_PRINTF /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDIO_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the 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 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_UNISTD_H /* 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 version of this package. */ #undef PACKAGE_VERSION /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS freeradius-server/src/modules/rlm_example/configure000077500000000000000000004100211257552170400231740ustar00rootroot00000000000000#! /bin/sh # From configure.in Revision. # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.61. # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, # 2002, 2003, 2004, 2005, 2006 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=: # 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 # PATH needs CR # 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 # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false 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.) as_nl=' ' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. 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 # Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # CDPATH. $as_unset CDPATH if test "x$CONFIG_SHELL" = x; then if (eval ":") 2>/dev/null; then as_have_required=yes else as_have_required=no fi if test $as_have_required = yes && (eval ": (as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=\$LINENO as_lineno_2=\$LINENO test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } ") 2> /dev/null; then : else as_candidate_shells= as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. case $as_dir in /*) for as_base in sh bash ksh sh5; do as_candidate_shells="$as_candidate_shells $as_dir/$as_base" done;; esac done IFS=$as_save_IFS for as_shell in $as_candidate_shells $SHELL; do # Try only shells that exist, to save several forks. if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { ("$as_shell") 2> /dev/null <<\_ASEOF 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 : _ASEOF }; then CONFIG_SHELL=$as_shell as_have_required=yes if { "$as_shell" 2> /dev/null <<\_ASEOF 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 : (as_func_return () { (exit $1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = "$1" ); then : else exitcode=1 echo positional parameters were not saved. fi test $exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } _ASEOF }; then break fi fi done if test "x$CONFIG_SHELL" != x; then for as_var in BASH_ENV ENV do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done export CONFIG_SHELL exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} fi if test $as_have_required = no; then echo This script requires a shell more modern than all the echo shells that I found on your system. Please install a echo modern shell, or manually run the script under such a echo shell if you do have one. { (exit 1); exit 1; } fi fi fi (eval "as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0") || { echo No shell found that supports shell functions. echo Please tell autoconf@gnu.org about your system, echo including any error possibly output before this echo message } as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, and appends # trailing '-' during substitution so that $LINENO is not a special # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # scripts with optimization help from Paolo Bonzini. 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" || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi 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 fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi 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=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, 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= SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME= PACKAGE_TARNAME= PACKAGE_VERSION= PACKAGE_STRING= PACKAGE_BUGREPORT= ac_unique_file="rlm_example.c" # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef STDC_HEADERS # include # include #else # ifdef HAVE_STDLIB_H # include # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datarootdir datadir sysconfdir sharedstatedir localstatedir includedir oldincludedir docdir infodir htmldir dvidir pdfdir psdir libdir localedir mandir DEFS ECHO_C ECHO_N ECHO_T LIBS build_alias host_alias target_alias CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP GREP EGREP example_cflags example_ldflags targetname LIBOBJS LTLIBOBJS' ac_subst_files='' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CPP' # Initialize some variables set by options. ac_init_help= ac_init_version=false # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *) ac_optarg=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_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` eval enable_$ac_feature=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_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` eval enable_$ac_feature=\$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_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/[-.]/_/g'` eval with_$ac_package=\$ac_optarg ;; -without-* | --without-*) ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/[-.]/_/g'` eval with_$ac_package=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 ;; -*) { echo "$as_me: error: unrecognized option: $ac_option Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && 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'` { echo "$as_me: error: missing argument to $ac_option" >&2 { (exit 1); exit 1; }; } fi # Be sure to have absolute directory names. 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 case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; } 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 echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || { echo "$as_me: error: Working directory cannot be determined" >&2 { (exit 1); exit 1; }; } test "X$ac_ls_di" = "X$ac_pwd_ls_di" || { echo "$as_me: error: pwd does not report name of working directory" >&2 { (exit 1); exit 1; }; } # 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 -- "$0" || $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$0" : 'X\(//\)[^/]' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X"$0" | 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 .." { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2 { (exit 1); exit 1; }; } pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures this package to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF _ACEOF fi if test -n "$ac_init_help"; then cat <<\_ACEOF 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 C/C++/Objective C preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. _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" || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`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 echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF configure generated by GNU Autoconf 2.61 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 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 cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by $as_me, which was generated by GNU Autoconf 2.61. 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=. 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=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; 2) ac_configure_args1="$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 ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac done done $as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } $as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export 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 cat <<\_ASBOX ## ---------------- ## ## Cache variables. ## ## ---------------- ## _ASBOX 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_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( *) $as_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 cat <<\_ASBOX ## ----------------- ## ## Output variables. ## ## ----------------- ## _ASBOX echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then cat <<\_ASBOX ## ------------------- ## ## File substitutions. ## ## ------------------- ## _ASBOX echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then cat <<\_ASBOX ## ----------- ## ## confdefs.h. ## ## ----------- ## _ASBOX echo cat confdefs.h echo fi test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" 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'; { (exit 1); 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 # 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 # Let the site file select an alternate cache file if it wants to. # Prefer explicitly selected file to automatically selected ones. if test -n "$CONFIG_SITE"; then set x "$CONFIG_SITE" elif test "x$prefix" != xNONE; then set x "$prefix/share/config.site" "$prefix/etc/config.site" else set x "$ac_default_prefix/share/config.site" \ "$ac_default_prefix/etc/config.site" fi shift for ac_site_file do if test -r "$ac_site_file"; then { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" 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. if test -f "$cache_file"; then { echo "$as_me:$LINENO: loading cache $cache_file" >&5 echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { echo "$as_me:$LINENO: creating cache $cache_file" >&5 echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 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 { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 echo "$as_me: former value: $ac_old_val" >&2;} { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 echo "$as_me: current value: $ac_new_val" >&2;} ac_cache_corrupted=: fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`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. *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 echo "$as_me: error: changes in the environment can compromise the build" >&2;} { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} { (exit 1); exit 1; }; } 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 # change 'example' # change 'example' if test x$with_rlm_example != xno; then 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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}gcc" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="gcc" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}cc" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="$ac_prog" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&5 echo "$as_me: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } # Provide some information about the compiler. echo "$as_me:$LINENO: checking for C compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (ac_try="$ac_compiler --version >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -v >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -V >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out 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. { echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6; } ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # # List of possible output files, starting from the most likely. # The algorithm is not robust to junk in `.', hence go to wildcards (a.*) # only as a last resort. b.out is created by i960 compilers. ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out' # # The IRIX 6 linker writes into existing files which may not be # executable, retaining their permissions. Remove them first so a # subsequent execution test works. ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link_default") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; 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 | *.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 { echo "$as_me:$LINENO: result: $ac_file" >&5 echo "${ECHO_T}$ac_file" >&6; } if test -z "$ac_file"; then echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: C compiler cannot create executables See \`config.log' for more details." >&5 echo "$as_me: error: C compiler cannot create executables See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } fi ac_exeext=$ac_cv_exeext # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { echo "$as_me:$LINENO: checking whether the C compiler works" >&5 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6; } # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then if { ac_try='./$ac_file' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { echo "$as_me:$LINENO: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&5 echo "$as_me: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi fi fi { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } rm -f a.out a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; } { echo "$as_me:$LINENO: result: $cross_compiling" >&5 echo "${ECHO_T}$cross_compiling" >&6; } { echo "$as_me:$LINENO: checking for suffix of executables" >&5 echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; } if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; 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 | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest$ac_cv_exeext { echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 echo "${ECHO_T}$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT { echo "$as_me:$LINENO: checking for suffix of object files" >&5 echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; } if test "${ac_cv_objext+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; 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 ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 echo "${ECHO_T}$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; } if test "${ac_cv_c_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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 { echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; } GCC=`test $ac_compiler_gnu = yes && echo yes` ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CFLAGS="" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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 { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 echo "${ECHO_T}$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 { echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_c89+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_c89=$ac_arg else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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) { echo "$as_me:$LINENO: result: none needed" >&5 echo "${ECHO_T}none needed" >&6; } ;; xno) { echo "$as_me:$LINENO: result: unsupported" >&5 echo "${ECHO_T}unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;; 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 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 { echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if test "${ac_cv_prog_CPP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f 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 { echo "$as_me:$LINENO: result: $CPP" >&5 echo "${ECHO_T}$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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&5 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } 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 { echo "$as_me:$LINENO: checking for printf in -lc" >&5 echo $ECHO_N "checking for printf in -lc... $ECHO_C" >&6; } if test "${ac_cv_lib_c_printf+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lc $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any 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 printf (); int main () { return printf (); ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_c_printf=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_c_printf=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_c_printf" >&5 echo "${ECHO_T}$ac_cv_lib_c_printf" >&6; } if test $ac_cv_lib_c_printf = yes; then example_ldflags="$example_ldflags -lc" else fail=$fail" printf" fi { echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5 echo $ECHO_N "checking for grep that handles long lines and -e... $ECHO_C" >&6; } if test "${ac_cv_path_GREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Extract the first word of "grep ggrep" to use in msg output if test -z "$GREP"; then set dummy grep ggrep; ac_prog_name=$2 if test "${ac_cv_path_GREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" 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 ac_count=`expr $ac_count + 1` 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 fi GREP="$ac_cv_path_GREP" if test -z "$GREP"; then { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} { (exit 1); exit 1; }; } fi else ac_cv_path_GREP=$GREP fi fi { echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5 echo "${ECHO_T}$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { echo "$as_me:$LINENO: checking for egrep" >&5 echo $ECHO_N "checking for egrep... $ECHO_C" >&6; } if test "${ac_cv_path_EGREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else # Extract the first word of "egrep" to use in msg output if test -z "$EGREP"; then set dummy egrep; ac_prog_name=$2 if test "${ac_cv_path_EGREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" 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 ac_count=`expr $ac_count + 1` 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 fi EGREP="$ac_cv_path_EGREP" if test -z "$EGREP"; then { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} { (exit 1); exit 1; }; } fi else ac_cv_path_EGREP=$EGREP fi fi fi { echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 echo "${ECHO_T}$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" { echo "$as_me:$LINENO: checking for ANSI C header files" >&5 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; } if test "${ac_cv_header_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_header_stdc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* 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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* 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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* 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 rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi { echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 echo "${ECHO_T}$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then cat >>confdefs.h <<\_ACEOF #define STDC_HEADERS 1 _ACEOF 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=`echo "ac_cv_header_$ac_header" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Header=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done if test "${ac_cv_header_stdio_h+set}" = set; then { echo "$as_me:$LINENO: checking for stdio.h" >&5 echo $ECHO_N "checking for stdio.h... $ECHO_C" >&6; } if test "${ac_cv_header_stdio_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi { echo "$as_me:$LINENO: result: $ac_cv_header_stdio_h" >&5 echo "${ECHO_T}$ac_cv_header_stdio_h" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking stdio.h usability" >&5 echo $ECHO_N "checking stdio.h usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? { echo "$as_me:$LINENO: checking stdio.h presence" >&5 echo $ECHO_N "checking stdio.h presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: stdio.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: stdio.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: stdio.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: stdio.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: stdio.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: stdio.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: stdio.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: stdio.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: stdio.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: stdio.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: stdio.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: stdio.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: stdio.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: stdio.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: stdio.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: stdio.h: in the future, the compiler will take precedence" >&2;} ;; esac { echo "$as_me:$LINENO: checking for stdio.h" >&5 echo $ECHO_N "checking for stdio.h... $ECHO_C" >&6; } if test "${ac_cv_header_stdio_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_stdio_h=$ac_header_preproc fi { echo "$as_me:$LINENO: result: $ac_cv_header_stdio_h" >&5 echo "${ECHO_T}$ac_cv_header_stdio_h" >&6; } fi if test $ac_cv_header_stdio_h = yes; then example_cflags="$example_cflags -I/usr/include" else fail=$fail" stdio.h" fi for ac_header in stdio.h stdlib.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? { echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ;; esac { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done # for the config.h defs for ac_func in printf do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* 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 $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$ac_func || defined __stub___$ac_func choke me #endif int main () { return $ac_func (); ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_var'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done # for the config.h defs targetname=rlm_example # keep this! Don't change! else targetname= # keep this! Don't change! echo \*\*\* module rlm_example is disabled. # keep this! Don't change! fi if test x"$fail" != x""; then if test x"${enable_strict_dependencies}" = x"yes"; then { { echo "$as_me:$LINENO: error: set --without-rlm_example to disable it explicitly." >&5 echo "$as_me: error: set --without-rlm_example to disable it explicitly." >&2;} { (exit 1); exit 1; }; } else { echo "$as_me:$LINENO: WARNING: silently not building rlm_example." >&5 echo "$as_me: WARNING: silently not building rlm_example." >&2;} { echo "$as_me:$LINENO: WARNING: FAILURE: rlm_example requires: $fail." >&5 echo "$as_me: WARNING: FAILURE: rlm_example requires: $fail." >&2;}; targetname="" fi fi # change 'example' # change 'example' ac_config_headers="$ac_config_headers config.h" # delete if you don't want a config.h file. # keep this! Don't change! unset ac_cv_env_LIBS_set unset ac_cv_env_LIBS_value ac_config_files="$ac_config_files 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_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( *) $as_unset $ac_var ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then test "x$cache_file" != "x/dev/null" && { echo "$as_me:$LINENO: updating cache $cache_file" >&5 echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 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= 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=`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. ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs : ${CONFIG_STATUS=./config.status} ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >$CONFIG_STATUS <<_ACEOF #! $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} _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ## --------------------- ## ## 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=: # 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 # PATH needs CR # 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 # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false 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.) as_nl=' ' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. 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 # Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # CDPATH. $as_unset CDPATH as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, and appends # trailing '-' during substitution so that $LINENO is not a special # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # scripts with optimization help from Paolo Bonzini. 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" || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi 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 fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi 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=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 # Save the log message, to keep $[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by $as_me, which was generated by GNU Autoconf 2.61. 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 cat >>$CONFIG_STATUS <<_ACEOF # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ config.status configured by $0, generated by GNU Autoconf 2.61, with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" Copyright (C) 2006 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' _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # If no file are specified by the user, then we need to provide default # value. By we need to know if files were specified by the user. 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=$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 ) echo "$ac_cs_version"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift CONFIG_FILES="$CONFIG_FILES $ac_optarg" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header { echo "$as_me: error: ambiguous option: $1 Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; };; --help | --hel | -h ) 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. -*) { echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *) ac_config_targets="$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 if \$ac_cs_recheck; then echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 CONFIG_SHELL=$SHELL export CONFIG_SHELL exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # 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" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= trap 'exit_status=$? { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status ' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || { echo "$me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } # # Set up the sed scripts for CONFIG_FILES section. # # No need to generate the scripts if there are no CONFIG_FILES. # This happens for instance when ./config.status config.h if test -n "$CONFIG_FILES"; then _ACEOF ac_delim='%!_!# ' for ac_last_try in false false false false false :; do cat >conf$$subs.sed <<_ACEOF SHELL!$SHELL$ac_delim PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim PACKAGE_NAME!$PACKAGE_NAME$ac_delim PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim PACKAGE_STRING!$PACKAGE_STRING$ac_delim PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim exec_prefix!$exec_prefix$ac_delim prefix!$prefix$ac_delim program_transform_name!$program_transform_name$ac_delim bindir!$bindir$ac_delim sbindir!$sbindir$ac_delim libexecdir!$libexecdir$ac_delim datarootdir!$datarootdir$ac_delim datadir!$datadir$ac_delim sysconfdir!$sysconfdir$ac_delim sharedstatedir!$sharedstatedir$ac_delim localstatedir!$localstatedir$ac_delim includedir!$includedir$ac_delim oldincludedir!$oldincludedir$ac_delim docdir!$docdir$ac_delim infodir!$infodir$ac_delim htmldir!$htmldir$ac_delim dvidir!$dvidir$ac_delim pdfdir!$pdfdir$ac_delim psdir!$psdir$ac_delim libdir!$libdir$ac_delim localedir!$localedir$ac_delim mandir!$mandir$ac_delim DEFS!$DEFS$ac_delim ECHO_C!$ECHO_C$ac_delim ECHO_N!$ECHO_N$ac_delim ECHO_T!$ECHO_T$ac_delim LIBS!$LIBS$ac_delim build_alias!$build_alias$ac_delim host_alias!$host_alias$ac_delim target_alias!$target_alias$ac_delim CC!$CC$ac_delim CFLAGS!$CFLAGS$ac_delim LDFLAGS!$LDFLAGS$ac_delim CPPFLAGS!$CPPFLAGS$ac_delim ac_ct_CC!$ac_ct_CC$ac_delim EXEEXT!$EXEEXT$ac_delim OBJEXT!$OBJEXT$ac_delim CPP!$CPP$ac_delim GREP!$GREP$ac_delim EGREP!$EGREP$ac_delim example_cflags!$example_cflags$ac_delim example_ldflags!$example_ldflags$ac_delim targetname!$targetname$ac_delim LIBOBJS!$LIBOBJS$ac_delim LTLIBOBJS!$LTLIBOBJS$ac_delim _ACEOF if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 52; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` if test -n "$ac_eof"; then ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` ac_eof=`expr $ac_eof + 1` fi cat >>$CONFIG_STATUS <<_ACEOF cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof /@[a-zA-Z_][a-zA-Z_0-9]*@/!b end _ACEOF sed ' s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g s/^/s,@/; s/!/@,|#_!!_#|/ :n t n s/'"$ac_delim"'$/,g/; t s/$/\\/; p N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n ' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF :end s/|#_!!_#|//g CEOF$ac_eof _ACEOF # VPATH may cause trouble with some makes, so we remove $(srcdir), # ${srcdir} and @srcdir@ 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[ ]*=/{ s/:*\$(srcdir):*/:/ s/:*\${srcdir}:*/:/ s/:*@srcdir@:*/:/ s/^\([^=]*=[ ]*\):*/\1/ s/:*$// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF fi # test -n "$CONFIG_FILES" for ac_tag in :F $CONFIG_FILES :H $CONFIG_HEADERS do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5 echo "$as_me: error: Invalid tag $ac_tag." >&2;} { (exit 1); exit 1; }; };; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 echo "$as_me: error: cannot find input file: $ac_f" >&2;} { (exit 1); exit 1; }; };; esac ac_file_inputs="$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 "`IFS=: echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure." if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { echo "$as_me:$LINENO: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} fi case $ac_tag in *:-:* | *:-) cat >"$tmp/stdin";; 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 || 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" case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`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 || 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" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 echo "$as_me: error: cannot create directory $as_dir" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`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 # _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # 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= case `sed -n '/datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p ' $ac_file_inputs` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF 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 sed "$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s&@configure_input@&$configure_input&;t t s&@top_builddir@&$ac_top_builddir_sub&;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 $ac_datarootdir_hack " $ac_file_inputs | sed -f "$tmp/subs-1.sed" >$tmp/out test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&5 echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&2;} rm -f "$tmp/stdin" case $ac_file in -) cat "$tmp/out"; rm -f "$tmp/out";; *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;; esac ;; :H) # # CONFIG_HEADER # _ACEOF # Transform confdefs.h into a sed script `conftest.defines', that # substitutes the proper values into config.h.in to produce config.h. rm -f conftest.defines conftest.tail # First, append a space to every undef/define line, to ease matching. echo 's/$/ /' >conftest.defines # Then, protect against being on the right side of a sed subst, or in # an unquoted here document, in config.status. If some macros were # called several times there might be several #defines for the same # symbol, which is useless. But do not sort them, since the last # AC_DEFINE must be honored. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* # These sed commands are passed to sed as "A NAME B PARAMS C VALUE D", where # NAME is the cpp macro being defined, VALUE is the value it is being given. # PARAMS is the parameter list in the macro definition--in most cases, it's # just an empty string. ac_dA='s,^\\([ #]*\\)[^ ]*\\([ ]*' ac_dB='\\)[ (].*,\\1define\\2' ac_dC=' ' ac_dD=' ,' uniq confdefs.h | sed -n ' t rset :rset s/^[ ]*#[ ]*define[ ][ ]*// t ok d :ok s/[\\&,]/\\&/g s/^\('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/ '"$ac_dA"'\1'"$ac_dB"'\2'"${ac_dC}"'\3'"$ac_dD"'/p s/^\('"$ac_word_re"'\)[ ]*\(.*\)/'"$ac_dA"'\1'"$ac_dB$ac_dC"'\2'"$ac_dD"'/p ' >>conftest.defines # Remove the space that was appended to ease matching. # Then 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. # (The regexp can be short, since the line contains either #define or #undef.) echo 's/ $// s,^[ #]*u.*,/* & */,' >>conftest.defines # Break up conftest.defines: ac_max_sed_lines=50 # First sed command is: sed -f defines.sed $ac_file_inputs >"$tmp/out1" # Second one is: sed -f defines.sed "$tmp/out1" >"$tmp/out2" # Third one will be: sed -f defines.sed "$tmp/out2" >"$tmp/out1" # et cetera. ac_in='$ac_file_inputs' ac_out='"$tmp/out1"' ac_nxt='"$tmp/out2"' while : do # Write a here document: cat >>$CONFIG_STATUS <<_ACEOF # First, check the format of the line: cat >"\$tmp/defines.sed" <<\\CEOF /^[ ]*#[ ]*undef[ ][ ]*$ac_word_re[ ]*\$/b def /^[ ]*#[ ]*define[ ][ ]*$ac_word_re[( ]/b def b :def _ACEOF sed ${ac_max_sed_lines}q conftest.defines >>$CONFIG_STATUS echo 'CEOF sed -f "$tmp/defines.sed"' "$ac_in >$ac_out" >>$CONFIG_STATUS ac_in=$ac_out; ac_out=$ac_nxt; ac_nxt=$ac_in sed 1,${ac_max_sed_lines}d conftest.defines >conftest.tail grep . conftest.tail >/dev/null || break rm -f conftest.defines mv conftest.tail conftest.defines done rm -f conftest.defines conftest.tail echo "ac_result=$ac_in" >>$CONFIG_STATUS cat >>$CONFIG_STATUS <<\_ACEOF if test x"$ac_file" != x-; then echo "/* $configure_input */" >"$tmp/config.h" cat "$ac_result" >>"$tmp/config.h" if diff $ac_file "$tmp/config.h" >/dev/null 2>&1; then { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 echo "$as_me: $ac_file is unchanged" >&6;} else rm -f $ac_file mv "$tmp/config.h" $ac_file fi else echo "/* $configure_input */" cat "$ac_result" fi rm -f "$tmp/out12" ;; esac done # for ac_tag { (exit 0); exit 0; } _ACEOF chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save # 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 || { (exit 1); exit 1; } fi # keep this! Don't change! freeradius-server/src/modules/rlm_example/configure.in000066400000000000000000000026231257552170400236030ustar00rootroot00000000000000AC_PREREQ([2.53]) AC_INIT(rlm_example.c) # change 'example' AC_REVISION($Revision$) AC_DEFUN(modname,[rlm_example]) # change 'example' if test x$with_[]modname != xno; then AC_PROG_CC AC_PROG_CPP dnl put configuration checks here. dnl set $fail to what's missing, on fatal errors. dnl use AC_MSG_WARN() on important messages. AC_CHECK_LIB(c, printf, [ example_ldflags="$example_ldflags -lc" ], [ fail=$fail" printf" ] ) AC_CHECK_HEADER(stdio.h, [ example_cflags="$example_cflags -I/usr/include" ], [ fail=$fail" stdio.h" ] ) AC_CHECK_HEADERS(stdio.h stdlib.h) # for the config.h defs AC_CHECK_FUNCS(printf) # for the config.h defs targetname=modname # keep this! Don't change! else targetname= # keep this! Don't change! echo \*\*\* module modname is disabled. # keep this! Don't change! fi dnl Don't change this section. if test x"$fail" != x""; then if test x"${enable_strict_dependencies}" = x"yes"; then AC_MSG_ERROR([set --without-]modname[ to disable it explicitly.]) else AC_MSG_WARN([silently not building ]modname[.]) AC_MSG_WARN([FAILURE: ]modname[ requires: $fail.]); targetname="" fi fi AC_SUBST(example_cflags) # change 'example' AC_SUBST(example_ldflags) # change 'example' AC_CONFIG_HEADER(config.h) # delete if you don't want a config.h file. AC_SUBST(targetname) # keep this! Don't change! AC_OUTPUT(Makefile) # keep this! Don't change! freeradius-server/src/modules/rlm_example/other.c000066400000000000000000000022771257552170400225640ustar00rootroot00000000000000/* * other.c * * Version: $Id$ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2000,2006 The FreeRADIUS server project * Copyright 2000 your name */ #include RCSID("$Id$") #include #include "other.h" /* * This is a sample C file which does nothing. * * It's only purpose is to show how to set up the 'Makefile' * for modules which have more than one C source file. */ void other_function(void) { int i = 1; /* do nothing */ i++; } freeradius-server/src/modules/rlm_example/other.h000066400000000000000000000003371257552170400225640ustar00rootroot00000000000000/* Copyright 2006 The FreeRADIUS server project */ #ifndef _OTHER_H #define _OTHER_H #include RCSIDH(other_h, "$Id$") /* define the function */ void other_function(void); #endif /*_OTHER_H*/ freeradius-server/src/modules/rlm_example/rlm_example.c000066400000000000000000000142721257552170400237460ustar00rootroot00000000000000/* * rlm_example.c * * Version: $Id$ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2000,2006 The FreeRADIUS server project * Copyright 2000 your name */ #include RCSID("$Id$") #include #include /* * Define a structure for our module configuration. * * These variables do not need to be in a structure, but it's * a lot cleaner to do so, and a pointer to the structure can * be used as the instance handle. */ typedef struct rlm_example_t { int boolean; int value; char *string; uint32_t ipaddr; } rlm_example_t; /* * A mapping of configuration file names to internal variables. * * Note that the string is dynamically allocated, so it MUST * be freed. When the configuration file parse re-reads the string, * it free's the old one, and strdup's the new one, placing the pointer * to the strdup'd string into 'config.string'. This gets around * buffer over-flows. */ static const CONF_PARSER module_config[] = { { "integer", PW_TYPE_INTEGER, offsetof(rlm_example_t,value), NULL, "1" }, { "boolean", PW_TYPE_BOOLEAN, offsetof(rlm_example_t,boolean), NULL, "no"}, { "string", PW_TYPE_STRING_PTR, offsetof(rlm_example_t,string), NULL, NULL}, { "ipaddr", PW_TYPE_IPADDR, offsetof(rlm_example_t,ipaddr), NULL, "*" }, { NULL, -1, 0, NULL, NULL } /* end the list */ }; /* * Do any per-module initialization that is separate to each * configured instance of the module. e.g. set up connections * to external databases, read configuration files, set up * dictionary entries, etc. * * If configuration information is given in the config section * that must be referenced in later calls, store a handle to it * in *instance otherwise put a null pointer there. */ static int example_instantiate(CONF_SECTION *conf, void **instance) { rlm_example_t *data; /* * Set up a storage area for instance data */ data = rad_malloc(sizeof(*data)); if (!data) { return -1; } memset(data, 0, sizeof(*data)); /* * If the configuration parameters can't be parsed, then * fail. */ if (cf_section_parse(conf, data, module_config) < 0) { free(data); return -1; } *instance = data; return 0; } /* * Find the named user in this modules database. Create the set * of attribute-value pairs to check and reply with for this user * from the database. The authentication code only needs to check * the password, the rest is done here. */ static int example_authorize(void *instance, REQUEST *request) { VALUE_PAIR *state; VALUE_PAIR *reply; /* quiet the compiler */ instance = instance; request = request; /* * Look for the 'state' attribute. */ state = pairfind(request->packet->vps, PW_STATE); if (state != NULL) { RDEBUG("Found reply to access challenge"); return RLM_MODULE_OK; } /* * Create the challenge, and add it to the reply. */ reply = pairmake("Reply-Message", "This is a challenge", T_OP_EQ); pairadd(&request->reply->vps, reply); state = pairmake("State", "0", T_OP_EQ); pairadd(&request->reply->vps, state); /* * Mark the packet as an Access-Challenge packet. * * The server will take care of sending it to the user. */ request->reply->code = PW_ACCESS_CHALLENGE; RDEBUG("Sending Access-Challenge."); return RLM_MODULE_HANDLED; } /* * Authenticate the user with the given password. */ static int example_authenticate(void *instance, REQUEST *request) { /* quiet the compiler */ instance = instance; request = request; return RLM_MODULE_OK; } /* * Massage the request before recording it or proxying it */ static int example_preacct(void *instance, REQUEST *request) { /* quiet the compiler */ instance = instance; request = request; return RLM_MODULE_OK; } /* * Write accounting information to this modules database. */ static int example_accounting(void *instance, REQUEST *request) { /* quiet the compiler */ instance = instance; request = request; return RLM_MODULE_OK; } /* * See if a user is already logged in. Sets request->simul_count to the * current session count for this user and sets request->simul_mpp to 2 * if it looks like a multilink attempt based on the requested IP * address, otherwise leaves request->simul_mpp alone. * * Check twice. If on the first pass the user exceeds his * max. number of logins, do a second pass and validate all * logins by querying the terminal server (using eg. SNMP). */ static int example_checksimul(void *instance, REQUEST *request) { instance = instance; request->simul_count=0; return RLM_MODULE_OK; } /* * Only free memory we allocated. The strings allocated via * cf_section_parse() do not need to be freed. */ static int example_detach(void *instance) { free(instance); return 0; } /* * The module name should be the only globally exported symbol. * That is, everything else should be 'static'. * * If the module needs to temporarily modify it's instantiation * data, the type should be changed to RLM_TYPE_THREAD_UNSAFE. * The server will then take care of ensuring that the module * is single-threaded. */ module_t rlm_example = { RLM_MODULE_INIT, "example", RLM_TYPE_THREAD_SAFE, /* type */ example_instantiate, /* instantiation */ example_detach, /* detach */ { example_authenticate, /* authentication */ example_authorize, /* authorization */ example_preacct, /* preaccounting */ example_accounting, /* accounting */ example_checksimul, /* checksimul */ NULL, /* pre-proxy */ NULL, /* post-proxy */ NULL /* post-auth */ }, }; freeradius-server/src/modules/rlm_exec/000077500000000000000000000000001257552170400205605ustar00rootroot00000000000000freeradius-server/src/modules/rlm_exec/Makefile000066400000000000000000000001361257552170400222200ustar00rootroot00000000000000# # Makefile # # Version: $Id$ # TARGET = rlm_exec SRCS = rlm_exec.c include ../rules.mak freeradius-server/src/modules/rlm_exec/rlm_exec.c000066400000000000000000000304221257552170400225230ustar00rootroot00000000000000/* * rlm_exec.c * * Version: $Id$ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2002,2006 The FreeRADIUS server project * Copyright 2002 Alan DeKok */ #include RCSID("$Id$") #include #include /* * Define a structure for our module configuration. */ typedef struct rlm_exec_t { char *xlat_name; int bare; int wait; char *program; char *input; char *output; char *packet_type; unsigned int packet_code; int shell_escape; int timeout; } rlm_exec_t; /* * A mapping of configuration file names to internal variables. * * Note that the string is dynamically allocated, so it MUST * be freed. When the configuration file parse re-reads the string, * it free's the old one, and strdup's the new one, placing the pointer * to the strdup'd string into 'config.string'. This gets around * buffer over-flows. */ static const CONF_PARSER module_config[] = { { "wait", PW_TYPE_BOOLEAN, offsetof(rlm_exec_t,wait), NULL, "yes" }, { "program", PW_TYPE_STRING_PTR, offsetof(rlm_exec_t,program), NULL, NULL }, { "input_pairs", PW_TYPE_STRING_PTR, offsetof(rlm_exec_t,input), NULL, "request" }, { "output_pairs", PW_TYPE_STRING_PTR, offsetof(rlm_exec_t,output), NULL, NULL }, { "packet_type", PW_TYPE_STRING_PTR, offsetof(rlm_exec_t,packet_type), NULL, NULL }, { "shell_escape", PW_TYPE_BOOLEAN, offsetof(rlm_exec_t,shell_escape), NULL, "yes" }, { "timeout", PW_TYPE_INTEGER, offsetof(rlm_exec_t,timeout), NULL, NULL }, { NULL, -1, 0, NULL, NULL } /* end the list */ }; /* * Decode the configuration file string to a pointer to * a value-pair list in the REQUEST data structure. */ static VALUE_PAIR **decode_string(REQUEST *request, const char *string) { if (!string) return NULL; /* * Yuck. We need a 'switch' over character strings * in C. */ if (strcmp(string, "request") == 0) { return &request->packet->vps; } if (strcmp(string, "reply") == 0) { if (!request->reply) return NULL; return &request->reply->vps; } if (strcmp(string, "proxy-request") == 0) { if (!request->proxy) return NULL; return &request->proxy->vps; } if (strcmp(string, "proxy-reply") == 0) { if (!request->proxy_reply) return NULL; return &request->proxy_reply->vps; } if (strcmp(string, "config") == 0) { return &request->config_items; } if (strcmp(string, "none") == 0) { return NULL; } return NULL; } /* * Do xlat of strings. */ static size_t exec_xlat(void *instance, REQUEST *request, char *fmt, char *out, size_t outlen, UNUSED RADIUS_ESCAPE_STRING func) { int result; rlm_exec_t *inst = instance; VALUE_PAIR **input_pairs; char *p; if (!inst->wait) { radlog(L_ERR, "rlm_exec (%s): 'wait' must be enabled to use exec xlat", inst->xlat_name); out[0] = '\0'; return 0; } input_pairs = decode_string(request, inst->input); if (!input_pairs) { radlog(L_ERR, "rlm_exec (%s): Failed to find input pairs for xlat", inst->xlat_name); out[0] = '\0'; return 0; } /* * FIXME: Do xlat of program name? */ RDEBUG2("Executing %s", fmt); result = radius_exec_program(fmt, request, inst->wait, out, outlen, inst->timeout, *input_pairs, NULL, inst->shell_escape); RDEBUG2("result %d", result); if (result != 0) { out[0] = '\0'; return 0; } for (p = out; *p != '\0'; p++) { if (*p < ' ') *p = ' '; } return strlen(out); } /* * Detach an instance and free it's data. */ static int exec_detach(void *instance) { rlm_exec_t *inst = instance; if (inst->xlat_name) { xlat_unregister(inst->xlat_name, exec_xlat, instance); free(inst->xlat_name); } free(inst); return 0; } /* * Do any per-module initialization that is separate to each * configured instance of the module. e.g. set up connections * to external databases, read configuration files, set up * dictionary entries, etc. * * If configuration information is given in the config section * that must be referenced in later calls, store a handle to it * in *instance otherwise put a null pointer there. */ static int exec_instantiate(CONF_SECTION *conf, void **instance) { rlm_exec_t *inst; const char *xlat_name; /* * Set up a storage area for instance data */ inst = rad_malloc(sizeof(rlm_exec_t)); if (!inst) return -1; memset(inst, 0, sizeof(rlm_exec_t)); /* * If the configuration parameters can't be parsed, then * fail. */ if (cf_section_parse(conf, inst, module_config) < 0) { radlog(L_ERR, "rlm_exec: Failed parsing the configuration"); exec_detach(inst); return -1; } /* * No input pairs defined. Why are we executing a program? */ if (!inst->input) { radlog(L_ERR, "rlm_exec: Must define input pairs for external program."); exec_detach(inst); return -1; } /* * Sanity check the config. If we're told to NOT wait, * then the output pairs must not be defined. */ if (!inst->wait && (inst->output != NULL)) { radlog(L_ERR, "rlm_exec: Cannot read output pairs if wait=no"); exec_detach(inst); return -1; } /* * Get the packet type on which to execute */ if (!inst->packet_type) { inst->packet_code = 0; } else { DICT_VALUE *dval; dval = dict_valbyname(PW_PACKET_TYPE, inst->packet_type); if (!dval) { radlog(L_ERR, "rlm_exec: Unknown packet type %s: See list of VALUEs for Packet-Type in share/dictionary", inst->packet_type); exec_detach(inst); return -1; } inst->packet_code = dval->value; } xlat_name = cf_section_name2(conf); if (xlat_name == NULL) { xlat_name = cf_section_name1(conf); inst->bare = 1; } if (xlat_name){ inst->xlat_name = strdup(xlat_name); xlat_register(xlat_name, exec_xlat, inst); } /* * Get the time to wait before killing the child */ if (!inst->timeout) { inst->timeout = EXEC_TIMEOUT; } if (inst->timeout < 1) { radlog(L_ERR, "rlm_exec: Timeout '%d' is too small (minimum: 1)", inst->timeout); return -1; } /* * Blocking a request longer than 30 seconds isn't going to help anyone. */ if (inst->timeout > 30) { radlog(L_ERR, "rlm_exec: Timeout '%d' is too large (maximum: 30)", inst->timeout); return -1; } *instance = inst; return 0; } /* * Dispatch an exec method */ static int exec_dispatch(void *instance, REQUEST *request) { int result; VALUE_PAIR **input_pairs, **output_pairs; VALUE_PAIR *answer = NULL; rlm_exec_t *inst = (rlm_exec_t *) instance; /* * We need a program to execute. */ if (!inst->program) { radlog(L_ERR, "rlm_exec (%s): We require a program to execute", inst->xlat_name); return RLM_MODULE_FAIL; } /* * See if we're supposed to execute it now. */ if (!((inst->packet_code == 0) || (request->packet->code == inst->packet_code) || (request->reply->code == inst->packet_code) || (request->proxy && (request->proxy->code == inst->packet_code)) || (request->proxy_reply && (request->proxy_reply->code == inst->packet_code)))) { RDEBUG2("Packet type is not %s. Not executing.", inst->packet_type); return RLM_MODULE_NOOP; } /* * Decide what input/output the program takes. */ input_pairs = decode_string(request, inst->input); output_pairs = decode_string(request, inst->output); if (!input_pairs) { RDEBUG2("WARNING: Possible parse error in %s", inst->input); return RLM_MODULE_NOOP; } /* * It points to the attribute list, but the attribute * list is empty. */ if (!*input_pairs) { RDEBUG2("WARNING! Input pairs are empty. No attributes will be passed to the script"); } /* * This function does it's own xlat of the input program * to execute. * * FIXME: if inst->program starts with %{, then * do an xlat ourselves. This will allow us to do * program = %{Exec-Program}, which this module * xlat's into it's string value, and then the * exec program function xlat's it's string value * into something else. */ result = radius_exec_program(inst->program, request, inst->wait, NULL, 0, inst->timeout, *input_pairs, &answer, inst->shell_escape); if (result < 0) { radlog(L_ERR, "rlm_exec (%s): External script failed", inst->xlat_name); return RLM_MODULE_FAIL; } /* * Move the answer over to the output pairs. * * If we're not waiting, then there are no output pairs. */ if (output_pairs) pairmove(output_pairs, &answer); pairfree(&answer); if (result == 0) { return RLM_MODULE_OK; } if (result > RLM_MODULE_NUMCODES) { return RLM_MODULE_FAIL; } return result-1; } /* * First, look for Exec-Program && Exec-Program-Wait. * * Then, call exec_dispatch. */ static int exec_postauth(void *instance, REQUEST *request) { int result; int exec_wait = 0; VALUE_PAIR *vp, *tmp; rlm_exec_t *inst = (rlm_exec_t *) instance; vp = pairfind(request->reply->vps, PW_EXEC_PROGRAM); if (vp) { exec_wait = 0; } else if ((vp = pairfind(request->reply->vps, PW_EXEC_PROGRAM_WAIT)) != NULL) { exec_wait = 1; } if (!vp) { if (!inst->program) return RLM_MODULE_NOOP; return exec_dispatch(instance, request); } tmp = NULL; result = radius_exec_program(vp->vp_strvalue, request, exec_wait, NULL, 0, inst->timeout, request->packet->vps, &tmp, inst->shell_escape); /* * Always add the value-pairs to the reply. */ pairmove(&request->reply->vps, &tmp); pairfree(&tmp); if (result < 0) { /* * Error. radius_exec_program() returns -1 on * fork/exec errors. */ tmp = pairmake("Reply-Message", "Access denied (external check failed)", T_OP_SET); pairadd(&request->reply->vps, tmp); RDEBUG2("Login incorrect (external check failed)"); request->reply->code = PW_AUTHENTICATION_REJECT; return RLM_MODULE_REJECT; } if (result > 0) { /* * Reject. radius_exec_program() returns >0 * if the exec'ed program had a non-zero * exit status. */ request->reply->code = PW_AUTHENTICATION_REJECT; RDEBUG2("Login incorrect (external check said so)"); return RLM_MODULE_REJECT; } return RLM_MODULE_OK; } /* * First, look for Exec-Program && Exec-Program-Wait. * * Then, call exec_dispatch. */ static int exec_accounting(void *instance, REQUEST *request) { int result; int exec_wait = 0; VALUE_PAIR *vp; rlm_exec_t *inst = (rlm_exec_t *) instance; /* * The "bare" exec module takes care of handling * Exec-Program and Exec-Program-Wait. */ if (!inst->bare) return exec_dispatch(instance, request); vp = pairfind(request->reply->vps, PW_EXEC_PROGRAM); if (vp) { exec_wait = 0; } else if ((vp = pairfind(request->reply->vps, PW_EXEC_PROGRAM_WAIT)) != NULL) { exec_wait = 1; } if (!vp) return RLM_MODULE_NOOP; result = radius_exec_program(vp->vp_strvalue, request, exec_wait, NULL, 0, inst->timeout, request->packet->vps, NULL, inst->shell_escape); if (result != 0) { return RLM_MODULE_REJECT; } return RLM_MODULE_OK; } /* * The module name should be the only globally exported symbol. * That is, everything else should be 'static'. * * If the module needs to temporarily modify it's instantiation * data, the type should be changed to RLM_TYPE_THREAD_UNSAFE. * The server will then take care of ensuring that the module * is single-threaded. */ module_t rlm_exec = { RLM_MODULE_INIT, "exec", /* Name */ RLM_TYPE_CHECK_CONFIG_SAFE, /* type */ exec_instantiate, /* instantiation */ exec_detach, /* detach */ { exec_dispatch, /* authentication */ exec_dispatch, /* authorization */ exec_dispatch, /* pre-accounting */ exec_accounting, /* accounting */ NULL, /* check simul */ exec_dispatch, /* pre-proxy */ exec_dispatch, /* post-proxy */ exec_postauth /* post-auth */ #ifdef WITH_COA , exec_dispatch, exec_dispatch #endif }, }; freeradius-server/src/modules/rlm_expiration/000077500000000000000000000000001257552170400220165ustar00rootroot00000000000000freeradius-server/src/modules/rlm_expiration/Makefile000066400000000000000000000001121257552170400234500ustar00rootroot00000000000000TARGET = rlm_expiration SRCS = rlm_expiration.c include ../rules.mak freeradius-server/src/modules/rlm_expiration/rlm_expiration.c000066400000000000000000000144351257552170400252250ustar00rootroot00000000000000/* * rlm_expiration.c * * Version: $Id$ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2001,2006 The FreeRADIUS server project * Copyright 2004 Kostas Kalevras */ #include RCSID("$Id$") #include #include #include /* * Define a structure for our module configuration. * * These variables do not need to be in a structure, but it's * a lot cleaner to do so, and a pointer to the structure can * be used as the instance handle. */ typedef struct rlm_expiration_t { char *msg; /* The Reply-Message passed back to the user if the account is expired */ } rlm_expiration_t; /* * A mapping of configuration file names to internal variables. * * Note that the string is dynamically allocated, so it MUST * be freed. When the configuration file parse re-reads the string, * it free's the old one, and strdup's the new one, placing the pointer * to the strdup'd string into 'config.string'. This gets around * buffer over-flows. */ static const CONF_PARSER module_config[] = { { "reply-message", PW_TYPE_STRING_PTR, offsetof(rlm_expiration_t,msg), NULL, "Password Has Expired\r\n"}, { NULL, -1, 0, NULL, NULL } }; /* * Check if account has expired, and if user may login now. */ static int expiration_authorize(void *instance, REQUEST *request) { rlm_expiration_t *data = (rlm_expiration_t *)instance; VALUE_PAIR *vp, *check_item = NULL; char msg[MAX_STRING_LEN]; if ((check_item = pairfind(request->config_items, PW_EXPIRATION)) != NULL){ /* * Has this user's password expired? * * If so, remove ALL reply attributes, * and add our own Reply-Message, saying * why they're being rejected. */ RDEBUG("Checking Expiration time: '%s'",check_item->vp_strvalue); if (((time_t) check_item->vp_date) <= request->timestamp) { char logstr[MAX_STRING_LEN]; VALUE_PAIR *module_fmsg_vp; RDEBUG("Account has expired"); if (data->msg && data->msg[0]){ if (!radius_xlat(msg, sizeof(msg), data->msg, request, NULL)) { radlog(L_ERR, "rlm_expiration: xlat failed."); return RLM_MODULE_FAIL; } vp = pairmake("Reply-Message", msg, T_OP_ADD); pairfree(&request->reply->vps); request->reply->vps = vp; } snprintf(logstr, sizeof(logstr), "Account has expired [Expiration %s]",check_item->vp_strvalue); module_fmsg_vp = pairmake("Module-Failure-Message", logstr, T_OP_EQ); pairadd(&request->packet->vps, module_fmsg_vp); return RLM_MODULE_USERLOCK; } /* * Else the account hasn't expired, but it may do so * in the future. Set Session-Timeout. */ vp = pairfind(request->reply->vps, PW_SESSION_TIMEOUT); if (!vp) { vp = radius_paircreate(request, &request->reply->vps, PW_SESSION_TIMEOUT, PW_TYPE_INTEGER); vp->vp_date = (uint32_t) (((time_t) check_item->vp_date) - request->timestamp); } else if (vp->vp_date > ((uint32_t) (((time_t) check_item->vp_date) - request->timestamp))) { vp->vp_date = (uint32_t) (((time_t) check_item->vp_date) - request->timestamp); } } else return RLM_MODULE_NOOP; return RLM_MODULE_OK; } /* * Compare the expiration date. */ static int expirecmp(void *instance, REQUEST *req, VALUE_PAIR *request, VALUE_PAIR *check, VALUE_PAIR *check_pairs, VALUE_PAIR **reply_pairs) { time_t now = 0; instance = instance; request = request; /* shut the compiler up */ check_pairs = check_pairs; reply_pairs = reply_pairs; now = (req) ? req->timestamp : time(NULL); if (now <= ((time_t) check->vp_date)) return 0; return +1; } static int expiration_detach(void *instance) { paircompare_unregister(PW_EXPIRATION, expirecmp); free(instance); return 0; } /* * Do any per-module initialization that is separate to each * configured instance of the module. e.g. set up connections * to external databases, read configuration files, set up * dictionary entries, etc. * * If configuration information is given in the config section * that must be referenced in later calls, store a handle to it * in *instance otherwise put a null pointer there. */ static int expiration_instantiate(CONF_SECTION *conf, void **instance) { rlm_expiration_t *data; /* * Set up a storage area for instance data */ data = rad_malloc(sizeof(*data)); if (!data) { radlog(L_ERR, "rlm_expiration: rad_malloc() failed."); return -1; } memset(data, 0, sizeof(*data)); /* * If the configuration parameters can't be parsed, then * fail. */ if (cf_section_parse(conf, data, module_config) < 0) { free(data); radlog(L_ERR, "rlm_expiration: Configuration parsing failed."); return -1; } /* * Register the expiration comparison operation. */ paircompare_register(PW_EXPIRATION, 0, expirecmp, data); *instance = data; return 0; } /* * The module name should be the only globally exported symbol. * That is, everything else should be 'static'. * * If the module needs to temporarily modify it's instantiation * data, the type should be changed to RLM_TYPE_THREAD_UNSAFE. * The server will then take care of ensuring that the module * is single-threaded. */ module_t rlm_expiration = { RLM_MODULE_INIT, "expiration", RLM_TYPE_THREAD_SAFE, /* type */ expiration_instantiate, /* instantiation */ expiration_detach, /* detach */ { NULL, /* authentication */ expiration_authorize, /* authorization */ NULL, /* preaccounting */ NULL, /* accounting */ NULL, /* checksimul */ NULL, /* pre-proxy */ NULL, /* post-proxy */ expiration_authorize /* post-auth */ }, }; freeradius-server/src/modules/rlm_expr/000077500000000000000000000000001257552170400206125ustar00rootroot00000000000000freeradius-server/src/modules/rlm_expr/Makefile000066400000000000000000000001501257552170400222460ustar00rootroot00000000000000# # Makefile # # Version: $Id$ # TARGET = rlm_expr SRCS = rlm_expr.c paircmp.c include ../rules.mak freeradius-server/src/modules/rlm_expr/paircmp.c000066400000000000000000000167711257552170400224250ustar00rootroot00000000000000/* * paircmp.c Valuepair functions for various attributes * * Version: $Id$ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2000,2006 The FreeRADIUS server project * Copyright 2000 Alan DeKok */ #include RCSID("$Id$") #include #include "rlm_expr.h" /* * Compare a Connect-Info and a Connect-Rate */ static int connectcmp(void *instance, REQUEST *req UNUSED, VALUE_PAIR *request, VALUE_PAIR *check, VALUE_PAIR *check_pairs, VALUE_PAIR **reply_pairs) { int rate; instance = instance; check_pairs = check_pairs; /* shut the compiler up */ reply_pairs = reply_pairs; rate = atoi((char *)request->vp_strvalue); return rate - check->vp_integer; } /* * Compare a portno with a range. */ static int portcmp(void *instance, REQUEST *req UNUSED, VALUE_PAIR *request, VALUE_PAIR *check, VALUE_PAIR *check_pairs, VALUE_PAIR **reply_pairs) { char buf[MAX_STRING_LEN]; char *s, *p, *next; uint32_t lo, hi; uint32_t port; instance = instance; check_pairs = check_pairs; /* shut the compiler up */ reply_pairs = reply_pairs; if (!request) return -1; port = request->vp_integer; if ((strchr((char *)check->vp_strvalue, ',') == NULL) && (strchr((char *)check->vp_strvalue, '-') == NULL)) { return (request->vp_integer - check->vp_integer); } /* Same size */ strcpy(buf, check->vp_strvalue); s = buf; while (1) { next = strchr(s, ','); if (next) *next = '\0'; if ((p = strchr(s, '-')) != NULL) p++; else p = s; lo = strtoul(s, NULL, 10); hi = strtoul(p, NULL, 10); if (lo <= port && port <= hi) { return 0; } if (!next) break; s = next + 1; } return -1; } /* * Compare prefix/suffix. * * If they compare: * - if PW_STRIP_USER_NAME is present in check_pairs, * strip the username of prefix/suffix. * - if PW_STRIP_USER_NAME is not present in check_pairs, * add a PW_STRIPPED_USER_NAME to the request. */ static int presufcmp(UNUSED void *instance, REQUEST *req, VALUE_PAIR *request, VALUE_PAIR *check, VALUE_PAIR *check_pairs, UNUSED VALUE_PAIR **reply_pairs) { VALUE_PAIR *vp; char *name; char rest[MAX_STRING_LEN]; int len, namelen; int ret = -1; if (!request) return -1; name = request->vp_strvalue; #if 0 /* DEBUG */ printf("Comparing %s and %s, check->attr is %d\n", name, check->vp_strvalue, check->attribute); #endif len = strlen((char *)check->vp_strvalue); switch (check->attribute) { case PW_PREFIX: ret = strncmp(name, check->vp_strvalue, len); if (ret == 0) strlcpy(rest, name + len, sizeof(rest)); break; case PW_SUFFIX: namelen = strlen(name); if (namelen < len) break; ret = strcmp(name + namelen - len, (char *)check->vp_strvalue); if (ret == 0) { strlcpy(rest, name, namelen - len + 1); } break; } if (ret != 0) return ret; /* * If Strip-User-Name == No, then don't do any more. */ vp = pairfind(check_pairs, PW_STRIP_USER_NAME); if (vp && !vp->vp_integer) return ret; /* * See where to put the stripped user name. */ vp = pairfind(check_pairs, PW_STRIPPED_USER_NAME); if (!vp) { /* * If "request" is NULL, then the memory will be * lost! */ vp = radius_paircreate(req, &request, PW_STRIPPED_USER_NAME, PW_TYPE_STRING); if (!vp) return ret; req->username = vp; } strlcpy((char *)vp->vp_strvalue, rest, sizeof(vp->vp_strvalue)); vp->length = strlen(vp->vp_strvalue); return ret; } /* * Compare the request packet type. */ static int packetcmp(void *instance UNUSED, REQUEST *req, VALUE_PAIR *request UNUSED, VALUE_PAIR *check, VALUE_PAIR *check_pairs UNUSED, VALUE_PAIR **reply_pairs UNUSED) { if (req->packet->code == check->vp_integer) { return 0; } return 1; } /* * Compare the response packet type. */ static int responsecmp(void *instance UNUSED, REQUEST *req, VALUE_PAIR *request UNUSED, VALUE_PAIR *check, VALUE_PAIR *check_pairs UNUSED, VALUE_PAIR **reply_pairs UNUSED) { if (req->reply->code == check->vp_integer) { return 0; } return 1; } /* * Generic comparisons, via xlat. */ static int genericcmp(void *instance UNUSED, REQUEST *req, VALUE_PAIR *request UNUSED, VALUE_PAIR *check, VALUE_PAIR *check_pairs UNUSED, VALUE_PAIR **reply_pairs UNUSED) { if ((check->operator != T_OP_REG_EQ) && (check->operator != T_OP_REG_NE)) { int rcode; char name[1024]; char value[1024]; VALUE_PAIR *vp; snprintf(name, sizeof(name), "%%{%s}", check->name); radius_xlat(value, sizeof(value), name, req, NULL); vp = pairmake(check->name, value, check->operator); /* * Paircmp returns 0 for failed comparison, * 1 for succeeded. */ rcode = paircmp(check, vp); /* * We're being called from radius_callback_compare, * which wants 0 for success, and 1 for fail (sigh) * * We should really fix the API so that it is * consistent. i.e. the comparison callbacks should * return ONLY the resut of comparing A to B. * The radius_callback_cmp function should then * take care of using the operator to see if the * condition (A OP B) is true or not. * * This would also allow "<", etc. to work in the * callback functions... * * See rlm_ldap, ...groupcmp() for something that * returns 0 for matched, and 1 for didn't match. */ rcode = !rcode; pairfree(&vp); return rcode; } /* * Will do the xlat for us */ return radius_compare_vps(req, check, NULL); } static int generic_attrs[] = { PW_CLIENT_IP_ADDRESS, PW_PACKET_SRC_IP_ADDRESS, PW_PACKET_DST_IP_ADDRESS, PW_PACKET_SRC_PORT, PW_PACKET_DST_PORT, PW_REQUEST_PROCESSING_STAGE, PW_PACKET_SRC_IPV6_ADDRESS, PW_PACKET_DST_IPV6_ADDRESS, PW_VIRTUAL_SERVER, 0 }; /* * Register server-builtin special attributes. */ void pair_builtincompare_init(void) { int i; paircompare_register(PW_NAS_PORT, PW_NAS_PORT, portcmp, NULL); paircompare_register(PW_PREFIX, PW_USER_NAME, presufcmp, NULL); paircompare_register(PW_SUFFIX, PW_USER_NAME, presufcmp, NULL); paircompare_register(PW_CONNECT_RATE, PW_CONNECT_INFO, connectcmp, NULL); paircompare_register(PW_PACKET_TYPE, 0, packetcmp, NULL); paircompare_register(PW_RESPONSE_PACKET_TYPE, 0, responsecmp, NULL); for (i = 0; generic_attrs[i] != 0; i++) { paircompare_register(generic_attrs[i], -1, genericcmp, NULL); } } void pair_builtincompare_detach(void) { int i; paircompare_unregister(PW_NAS_PORT, portcmp); paircompare_unregister(PW_PREFIX, presufcmp); paircompare_unregister(PW_SUFFIX, presufcmp); paircompare_unregister(PW_CONNECT_RATE, connectcmp); paircompare_unregister(PW_PACKET_TYPE, packetcmp); paircompare_unregister(PW_RESPONSE_PACKET_TYPE, responsecmp); for (i = 0; generic_attrs[i] != 0; i++) { paircompare_unregister(generic_attrs[i], genericcmp); } } freeradius-server/src/modules/rlm_expr/rlm_expr.c000066400000000000000000000363731257552170400226220ustar00rootroot00000000000000/* * rlm_expr.c * * Version: $Id$ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2002,2006 The FreeRADIUS server project * Copyright 2002 Alan DeKok */ #include RCSID("$Id$") #include #include #include #include #include #include #include "rlm_expr.h" /* * Define a structure for our module configuration. */ typedef struct rlm_expr_t { char *xlat_name; } rlm_expr_t; typedef enum expr_token_t { TOKEN_NONE = 0, TOKEN_INTEGER, TOKEN_ADD, TOKEN_SUBTRACT, TOKEN_DIVIDE, TOKEN_REMAINDER, TOKEN_MULTIPLY, TOKEN_AND, TOKEN_OR, TOKEN_LAST } expr_token_t; typedef struct expr_map_t { char op; expr_token_t token; } expr_map_t; static expr_map_t map[] = { {'+', TOKEN_ADD }, {'-', TOKEN_SUBTRACT }, {'/', TOKEN_DIVIDE }, {'*', TOKEN_MULTIPLY }, {'%', TOKEN_REMAINDER }, {'&', TOKEN_AND }, {'|', TOKEN_OR }, {0, TOKEN_LAST} }; /* * Lookup tables for randstr char classes */ static char randstr_punc[] = "!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~"; static char randstr_salt[] = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmopqrstuvwxyz/."; static int get_number(REQUEST *request, const char **string, int64_t *answer) { int i, found; int64_t result; int64_t x; const char *p; expr_token_t this; /* * Loop over the input. */ result = 0; this = TOKEN_NONE; for (p = *string; *p != '\0'; /* nothing */) { if ((*p == ' ') || (*p == '\t')) { p++; continue; } /* * Discover which token it is. */ found = FALSE; for (i = 0; map[i].token != TOKEN_LAST; i++) { if (*p == map[i].op) { if (this != TOKEN_NONE) { RDEBUG2("Invalid operator at \"%s\"", p); return -1; } this = map[i].token; p++; found = TRUE; break; } } /* * Found the algebraic operator. Get the next number. */ if (found) { continue; } /* * End of a group. Stop. */ if (*p == ')') { if (this != TOKEN_NONE) { RDEBUG2("Trailing operator before end sub-expression at \"%s\"", p); return -1; } p++; break; } /* * Start of a group. Call ourselves recursively. */ if (*p == '(') { p++; found = get_number(request, &p, &x); if (found < 0) { return -1; } } else { /* * No algrebraic operator found, the next thing * MUST be a number. * * If it isn't, then we die. */ if ((*p == '0') && (p[1] == 'x')) { char *end; x = strtoul(p, &end, 16); p = end; goto calc; } if ((*p < '0') || (*p > '9')) { RDEBUG2("Not a number at \"%s\"", p); return -1; } /* * This is doing it the hard way, but it also allows * us to increment 'p'. */ x = 0; while ((*p >= '0') && (*p <= '9')) { x *= 10; x += (*p - '0'); p++; } } calc: switch (this) { default: case TOKEN_NONE: result = x; break; case TOKEN_ADD: result += x; break; case TOKEN_SUBTRACT: result -= x; break; case TOKEN_DIVIDE: if (x == 0) { result = 0; /* we don't have NaN for integers */ break; } result /= x; break; case TOKEN_REMAINDER: if (x == 0) { result = 0; /* we don't have NaN for integers */ break; } result %= x; break; case TOKEN_MULTIPLY: result *= x; break; case TOKEN_AND: result &= x; break; case TOKEN_OR: result |= x; break; } /* * We've used this token. */ this = TOKEN_NONE; } /* * And return the answer to the caller. */ *string = p; *answer = result; return 0; } /* * Do xlat of strings! */ static size_t expr_xlat(void *instance, REQUEST *request, char *fmt, char *out, size_t outlen, RADIUS_ESCAPE_STRING func) { int rcode; int64_t result; rlm_expr_t *inst = instance; const char *p; char buffer[256]; inst = inst; /* -Wunused */ /* * Do an xlat on the provided string (nice recursive operation). */ if (!radius_xlat(buffer, sizeof(buffer), fmt, request, func)) { radlog(L_ERR, "rlm_expr: xlat failed."); return 0; } p = buffer; rcode = get_number(request, &p, &result); if (rcode < 0) { return 0; } /* * We MUST have eaten the entire input string. */ if (*p != '\0') { RDEBUG2("Failed at %s", p); return 0; } snprintf(out, outlen, "%ld", (long int) result); return strlen(out); } static size_t rand_xlat(void *instance, REQUEST *request, char *fmt, char *out, size_t outlen, RADIUS_ESCAPE_STRING func) { int64_t result; rlm_expr_t *inst = instance; char buffer[256]; inst = inst; /* -Wunused */ /* * Do an xlat on the provided string (nice recursive operation). */ if (!radius_xlat(buffer, sizeof(buffer), fmt, request, func)) { radlog(L_ERR, "rlm_expr: xlat failed."); return 0; } result = atoi(buffer); /* * Too small or too big. */ if (result <= 0) return 0; if (result >= (1 << 30)) result = (1 << 30); result *= fr_rand(); /* 0..2^32-1 */ result >>= 32; snprintf(out, outlen, "%ld", (long int) result); return strlen(out); } /** * @brief Generate a string of random chars * * Build strings of random chars, useful for generating tokens and passcodes * Format similar to String::Random. */ static size_t randstr_xlat(UNUSED void *instance, REQUEST *request, char *fmt, char *out, size_t outlen, RADIUS_ESCAPE_STRING func) { char *p; char buffer[1024]; unsigned int result; size_t freespace = outlen; size_t len; if (outlen <= 1) return 0; /* * Do an xlat on the provided string (nice recursive operation). */ len = radius_xlat(buffer, sizeof(buffer), fmt, request, func); if (!len) { radlog(L_ERR, "rlm_expr: xlat failed."); *out = '\0'; return 0; } p = buffer; while ((len-- > 0) && (--freespace > 0)) { result = fr_rand(); switch (*p) { /* * Lowercase letters */ case 'c': *out++ = 'a' + (result % 26); break; /* * Uppercase letters */ case 'C': *out++ = 'A' + (result % 26); break; /* * Numbers */ case 'n': *out++ = '0' + (result % 10); break; /* * Alpha numeric */ case 'a': *out++ = randstr_salt[result % (sizeof(randstr_salt) - 3)]; break; /* * Punctuation */ case '!': *out++ = randstr_punc[result % (sizeof(randstr_punc) - 1)]; break; /* * Alpa numeric + punctuation */ case '.': *out++ = '!' + (result % 95); break; /* * Alpha numeric + salt chars './' */ case 's': *out++ = randstr_salt[result % (sizeof(randstr_salt) - 1)]; break; /* * Binary data as hexits (we don't really support * non printable chars). */ case 'h': if (freespace < 2) break; snprintf(out, 3, "%02x", result % 256); /* Already decremented */ freespace -= 1; out += 2; break; default: radlog(L_ERR, "rlm_expr: invalid character class '%c'", *p); return 0; break; } p++; } *out++ = '\0'; return outlen - freespace; } /** * @brief URLencode special characters * * Example: "%{urlquote:http://example.org/}" == "http%3A%47%47example.org%47" */ static size_t urlquote_xlat(UNUSED void *instance, REQUEST *request, char *fmt, char *out, size_t outlen, UNUSED RADIUS_ESCAPE_STRING func) { char *p; char buffer[1024]; size_t freespace = outlen; size_t len; if (outlen <= 1) return 0; len = radius_xlat(buffer, sizeof(buffer), fmt, request, func); if (!len) { radlog(L_ERR, "rlm_expr: xlat failed."); *out = '\0'; return 0; } p = buffer; while ((len-- > 0) && (--freespace > 0)) { if (isalnum(*p)) { *out++ = *p++; continue; } switch (*p) { case '-': case '_': case '.': case '~': *out++ = *p++; break; default: if (freespace < 3) break; snprintf(out, 4, "%%%02x", *p++); /* %xx */ /* Already decremented */ freespace -= 2; out += 3; } } *out = '\0'; return outlen - freespace; } /** * @brief Convert a string to lowercase * * Example "%{lc:Bar}" == "bar" * * Probably only works for ASCII */ static size_t lc_xlat(UNUSED void *instance, REQUEST *request, char *fmt, char *out, size_t outlen, UNUSED RADIUS_ESCAPE_STRING func) { char *p, *q; char buffer[1024]; if (outlen <= 1) return 0; if (!radius_xlat(buffer, sizeof(buffer), fmt, request, func)) { *out = '\0'; return 0; } for (p = buffer, q = out; *p != '\0'; p++, outlen--) { if (outlen <= 1) break; *(q++) = tolower((int) *p); } *q = '\0'; return strlen(out); } /** * @brief Convert a string to uppercase * * Example: "%{uc:Foo}" == "FOO" * * Probably only works for ASCII */ static size_t uc_xlat(UNUSED void *instance, REQUEST *request, char *fmt, char *out, size_t outlen, UNUSED RADIUS_ESCAPE_STRING func) { char *p, *q; char buffer[1024]; if (outlen <= 1) return 0; if (!radius_xlat(buffer, sizeof(buffer), fmt, request, func)) { *out = '\0'; return 0; } for (p = buffer, q = out; *p != '\0'; p++, outlen--) { if (outlen <= 1) break; *(q++) = toupper((int) *p); } *q = '\0'; return strlen(out); } /** * @brief Calculate the MD5 hash of a string. * * Example: "%{md5:foo}" == "acbd18db4cc2f85cedef654fccc4a4d8" */ static size_t md5_xlat(UNUSED void *instance, REQUEST *request, char *fmt, char *out, size_t outlen, UNUSED RADIUS_ESCAPE_STRING func) { char buffer[1024]; uint8_t digest[16]; int i; FR_MD5_CTX ctx; if (!radius_xlat(buffer, sizeof(buffer), fmt, request, func)) { *out = '\0'; return 0; } fr_MD5Init(&ctx); fr_MD5Update(&ctx, (void *) buffer, strlen(buffer)); fr_MD5Final(digest, &ctx); if (outlen < 33) { snprintf(out, outlen, "md5_overflow"); return strlen(out); } for (i = 0; i < 16; i++) { snprintf(out + i * 2, 3, "%02x", digest[i]); } return strlen(out); } /** * @brief Calculate the SHA1 hash of a string. * * Example: "%{sha1:foo}" == "0beec7b5ea3f0fdbc95d0dd47f3c5bc275da8a33" */ static size_t sha1_xlat(UNUSED void *instance, REQUEST *request, char *fmt, char *out, size_t outlen, UNUSED RADIUS_ESCAPE_STRING func) { char buffer[1024]; uint8_t digest[20]; int i; fr_SHA1_CTX ctx; if (!radius_xlat(buffer, sizeof(buffer), fmt, request, func)) { *out = '\0'; return 0; } fr_SHA1Init(&ctx); fr_SHA1Update(&ctx, (void *) buffer, strlen(buffer)); fr_SHA1Final(digest, &ctx); if (outlen < 41) { snprintf(out, outlen, "sha1_overflow"); return strlen(out); } for (i = 0; i < 20; i++) { snprintf(out + i * 2, 3, "%02x", digest[i]); } return strlen(out); } /** * @brief Encode string as base64 * * Example: "%{tobase64:foo}" == "Zm9v" */ static size_t base64_xlat(UNUSED void *instance, REQUEST *request, char *fmt, char *out, size_t outlen, UNUSED RADIUS_ESCAPE_STRING func) { size_t len; char buffer[1024]; len = radius_xlat(buffer, sizeof(buffer), fmt, request, func); /* * We can accurately calculate the length of the output string * if it's larger than outlen, the output would be useless so abort. */ if (!len || ((FR_BASE64_ENC_LENGTH(len) + 1) > outlen)) { radlog(L_ERR, "rlm_expr: xlat failed."); *out = '\0'; return 0; } fr_base64_encode((uint8_t *) buffer, len, out, outlen); return strlen(out); } /** * @brief Convert base64 to hex * * Example: "%{base64tohex:Zm9v}" == "666f6f" */ static size_t base64_to_hex_xlat(UNUSED void *instance, REQUEST *request, char *fmt, char *out, size_t outlen, UNUSED RADIUS_ESCAPE_STRING func) { char buffer[1024]; char decbuf[1024]; size_t declen = sizeof(decbuf); size_t len; while (isspace((int) *fmt)) fmt++; len = radius_xlat(buffer, sizeof(buffer), fmt, request, func); if (!len) { radlog(L_ERR, "rlm_expr: xlat failed."); *out = '\0'; return 0; } if (!fr_base64_decode(buffer, len, decbuf, &declen)) { radlog(L_ERR, "rlm_expr: base64 string invalid"); *out = '\0'; return 0; } if ((size_t)((declen * 2) + 1) > outlen) { radlog(L_ERR, "rlm_expr: Base64 conversion failed, " "output buffer exhausted, needed %zd bytes, " "have %zd bytes", (declen * 2) + 1, outlen); } fr_bin2hex((uint8_t *)decbuf, out, declen); return declen * 2; } /* * Do any per-module initialization that is separate to each * configured instance of the module. e.g. set up connections * to external databases, read configuration files, set up * dictionary entries, etc. * * If configuration information is given in the config section * that must be referenced in later calls, store a handle to it * in *instance otherwise put a null pointer there. */ static int expr_instantiate(CONF_SECTION *conf, void **instance) { rlm_expr_t *inst; const char *xlat_name; /* * Set up a storage area for instance data */ inst = rad_malloc(sizeof(rlm_expr_t)); if (!inst) return -1; memset(inst, 0, sizeof(rlm_expr_t)); xlat_name = cf_section_name2(conf); if (xlat_name == NULL) xlat_name = cf_section_name1(conf); if (xlat_name){ inst->xlat_name = strdup(xlat_name); xlat_register(xlat_name, expr_xlat, inst); } xlat_register("rand", rand_xlat, inst); xlat_register("randstr", randstr_xlat, inst); xlat_register("urlquote", urlquote_xlat, inst); xlat_register("tolower", lc_xlat, inst); xlat_register("toupper", uc_xlat, inst); xlat_register("md5", md5_xlat, inst); xlat_register("sha1", sha1_xlat, inst); xlat_register("tobase64", base64_xlat, inst); xlat_register("base64tohex", base64_to_hex_xlat, inst); /* * Initialize various paircompare functions */ pair_builtincompare_init(); *instance = inst; return 0; } /* * Detach a instance free all .. */ static int expr_detach(void *instance) { rlm_expr_t *inst = instance; xlat_unregister(inst->xlat_name, expr_xlat, instance); pair_builtincompare_detach(); free(inst->xlat_name); free(inst); return 0; } /* * The module name should be the only globally exported symbol. * That is, everything else should be 'static'. * * If the module needs to temporarily modify it's instantiation * data, the type should be changed to RLM_TYPE_THREAD_UNSAFE. * The server will then take care of ensuring that the module * is single-threaded. */ module_t rlm_expr = { RLM_MODULE_INIT, "expr", /* Name */ RLM_TYPE_CHECK_CONFIG_SAFE, /* type */ expr_instantiate, /* instantiation */ expr_detach, /* detach */ { NULL, /* authentication */ NULL, /* authorization */ NULL, /* pre-accounting */ NULL /* accounting */ }, }; freeradius-server/src/modules/rlm_expr/rlm_expr.h000066400000000000000000000020031257552170400226060ustar00rootroot00000000000000#ifndef _RLM_EXPR_H #define _RLM_EXPR_H /* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2007 The FreeRADIUS server project * Copyright 2007 Alan DeKok */ #include RCSIDH(rlm_expr_h, "$Id$") void pair_builtincompare_init(void); void pair_builtincompare_detach(void); #endif freeradius-server/src/modules/rlm_fastusers/000077500000000000000000000000001257552170400216535ustar00rootroot00000000000000freeradius-server/src/modules/rlm_fastusers/Makefile000066400000000000000000000001041257552170400233060ustar00rootroot00000000000000TARGET = rlm_fastusers SRCS = rlm_fastusers.c include ../rules.mak freeradius-server/src/modules/rlm_fastusers/rlm_fastusers.c000066400000000000000000000504261257552170400247170ustar00rootroot00000000000000/* * rlm_fastusers.c authorization: Find a user in the hashed "users" file. * accounting: Do nothing. Auth module only. * * Version: $Id$ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2000,2006 The FreeRADIUS server project * Copyright 2000 Jeff Carneal */ #include RCSID("$Id$") #include #include #include #include #include #include struct fastuser_instance { char *compat_mode; int hash_reload; char *key; /* hash table */ int hashsize; PAIR_LIST **hashtable; PAIR_LIST *defaults; PAIR_LIST *acctusers; int stats; char *usersfile; char *acctusersfile; time_t next_reload; time_t lastusersload; time_t lastacctusersload; }; /* Function declarations */ static int fallthrough(VALUE_PAIR *vp); static int fastuser_buildhash(struct fastuser_instance *inst); static int fastuser_getfile(struct fastuser_instance *inst, const char *filename, PAIR_LIST **default_list, PAIR_LIST **pair_list, int isacctfile); static int fastuser_hash(const char *s, int hashtablesize); static int fastuser_store(PAIR_LIST **hashtable, PAIR_LIST *entry, int idx); static PAIR_LIST *fastuser_find(REQUEST *request, PAIR_LIST *user, const char *username); static void fastuser_tablestats(PAIR_LIST **hashtable, int size); static const CONF_PARSER module_config[] = { { "usersfile", PW_TYPE_FILENAME, offsetof(struct fastuser_instance,usersfile), NULL, "${raddbdir}/users_fast" }, { "acctusersfile", PW_TYPE_FILENAME, offsetof(struct fastuser_instance,acctusersfile), NULL, "${raddbdir}/acct_users" }, { "hashsize", PW_TYPE_INTEGER, offsetof(struct fastuser_instance,hashsize), NULL, "100000" }, { "stats", PW_TYPE_BOOLEAN, offsetof(struct fastuser_instance,stats), NULL, "no" }, { "compat", PW_TYPE_STRING_PTR, offsetof(struct fastuser_instance,compat_mode), NULL, "cistron" }, { "hash_reload", PW_TYPE_INTEGER, offsetof(struct fastuser_instance,hash_reload), NULL, "600" }, { "key", PW_TYPE_STRING_PTR, offsetof(struct fastuser_instance,key), NULL, NULL }, { NULL, -1, 0, NULL, NULL } }; /* * See if a VALUE_PAIR list contains Fall-Through = Yes */ static int fallthrough(VALUE_PAIR *vp) { VALUE_PAIR *tmp; tmp = pairfind(vp, PW_FALL_THROUGH); return tmp ? tmp->vp_integer : 0; } /* * returncheck - Check for Auth-Type = Reject and return appropriate * module return code if it is found. */ static int rad_check_return(VALUE_PAIR *list) { VALUE_PAIR *authtype; /* * We check for Auth-Type = Reject here */ authtype = pairfind(list, PW_AUTHTYPE); if((authtype) && authtype->vp_integer == PW_AUTHTYPE_REJECT) { DEBUG2("rad_check_return: Auth-Type is Reject"); return RLM_MODULE_REJECT; } return RLM_MODULE_UPDATED; } static int fastuser_buildhash(struct fastuser_instance *inst) { int memsize=0; int rcode, hashindex; PAIR_LIST **newhash=NULL, **oldhash=NULL; PAIR_LIST *newdefaults=NULL, *newacctusers, *cur=NULL; PAIR_LIST *olddefaults=NULL, *oldacctusers=NULL; struct stat statbuf; int reloadusers = 1; int reloadacctusers = 1; /* * Allocate space for hash table here */ memsize = sizeof(PAIR_LIST *) * inst->hashsize; newhash = (PAIR_LIST **) rad_malloc(memsize); memset((PAIR_LIST *)newhash, 0, memsize); /* Check acct_users last modification time */ if ((stat(inst->acctusersfile, &statbuf) != -1) && (statbuf.st_mtime <= inst->lastacctusersload)) { DEBUG2("rlm_fastusers: File %s was unchanged. Not reloading.", inst->acctusersfile); reloadacctusers = 0; rcode = 0; } else /* Read acct_users */ rcode = fastuser_getfile(inst, inst->acctusersfile, NULL, &newacctusers, 1); if (rcode != 0) { free(newhash); radlog(L_ERR|L_CONS, "rlm_fastusers: Errors reading %s", inst->usersfile); return -1; } /* Check users last modification time */ if ((stat(inst->usersfile, &statbuf) != -1) && (statbuf.st_mtime <= inst->lastusersload)) { DEBUG2("rlm_fastusers: File %s was unchanged. Not reloading.", inst->usersfile); reloadusers = 0; rcode = 0; /* This was allocated earlier but will remain unused */ free(newhash); newhash = NULL; } else /* Read users */ rcode = fastuser_getfile(inst, inst->usersfile, &newdefaults, newhash, 0); if (rcode != 0) { free(newhash); radlog(L_ERR|L_CONS, "rlm_fastusers: Errors reading %s", inst->usersfile); return -1; } if (reloadusers) { /* * We need to do this now so that users auths * aren't blocked while we free the old table * below */ inst->lastusersload = time(NULL); oldhash = inst->hashtable; inst->hashtable = newhash; olddefaults = inst->defaults; inst->defaults = newdefaults; /* * When we get here, we assume the hash built properly. * So we begin to tear down the old one */ if (oldhash) { for(hashindex=0; hashindexhashsize; hashindex++) { if(oldhash[hashindex]) { cur = oldhash[hashindex]; pairlist_free(&cur); } } free(oldhash); } pairlist_free(&olddefaults); } if (reloadacctusers) { inst->lastacctusersload = time(NULL); oldacctusers = inst->acctusers; inst->acctusers = newacctusers; pairlist_free(&oldacctusers); } if(inst->stats) fastuser_tablestats(inst->hashtable, inst->hashsize); return 0; } static int fastuser_getfile(struct fastuser_instance *inst, const char *filename, PAIR_LIST **default_list, PAIR_LIST **pair_list, int isacctfile) { int rcode; PAIR_LIST *users = NULL; PAIR_LIST *entry=NULL, *next=NULL, *cur=NULL, *defaults=NULL, *lastdefault=NULL; int compat_mode = FALSE; VALUE_PAIR *vp=NULL; int hashindex = 0; int numdefaults = 0, numusers=0; radlog(L_INFO, " fastusers: Reading %s", filename); rcode = pairlist_read(filename, &users, 1); if (rcode < 0) { return -1; } if (strcmp(inst->compat_mode, "cistron") == 0) { compat_mode = TRUE; } entry = users; while (entry) { if (compat_mode) { DEBUG("[%s]:%d Cistron compatibility checks for entry %s ...", filename, entry->lineno, entry->name); } /* * Look for improper use of '=' in the * check items. They should be using * '==' for on-the-wire RADIUS attributes, * and probably ':=' for server * configuration items. */ for (vp = entry->check; vp != NULL; vp = vp->next) { /* * Ignore attributes which are set * properly. */ if (vp->operator != T_OP_EQ) continue; /* * If it's a vendor attribute, * or it's a wire protocol, * ensure it has '=='. */ if (((vp->attribute & ~0xffff) != 0) || (vp->attribute < 0x100)) { if (!compat_mode) { DEBUG("[%s]:%d WARNING! Changing '%s =' to '%s =='\n\tfor comparing RADIUS attribute in check item list for user %s", filename, entry->lineno, vp->name, vp->name, entry->name); } else { DEBUG("\tChanging '%s =' to '%s =='", vp->name, vp->name); } vp->operator = T_OP_CMP_EQ; continue; } /* * Cistron Compatibility mode. * * Re-write selected attributes * to be '+=', instead of '='. * * All others get set to '==' */ if (compat_mode) { /* * Non-wire attributes become += * * On the write attributes * become == */ if ((vp->attribute >= 0x100) && (vp->attribute <= 0xffff) && (vp->attribute != PW_HINT) && (vp->attribute != PW_HUNTGROUP_NAME)) { DEBUG("\tChanging '%s =' to '%s +='", vp->name, vp->name); vp->operator = T_OP_ADD; } else { DEBUG("\tChanging '%s =' to '%s =='", vp->name, vp->name); vp->operator = T_OP_CMP_EQ; } } } /* end of loop over check items */ /* * Look for server configuration items * in the reply list. * * It's a common enough mistake, that it's * worth doing. */ for (vp = entry->reply; vp != NULL; vp = vp->next) { /* * If it's NOT a vendor attribute, * and it's NOT a wire protocol * and we ignore Fall-Through, * then bitch about it, giving a * good warning message. */ if (!(vp->attribute & ~0xffff) && (vp->attribute > 0xff) && (vp->attribute > 1000)) { log_debug("[%s]:%d WARNING! Check item \"%s\"\n" "\tfound in reply item list for user \"%s\".\n" "\tThis attribute MUST go on the first line" " with the other check items", filename, entry->lineno, vp->name, entry->name); } } /* * Ok, we've done all the same BS as * rlm_users, so here we tear apart the * linked list, and store our users in * the hashtable we've built instead */ /* Save what was next */ next = entry->next; if(!isacctfile) { /* Save the DEFAULT entry specially */ if(strcmp(entry->name, "DEFAULT")==0) { /* Save this as the last default we've seen */ lastdefault = entry; numdefaults++; /* put it at the end of the list */ if(defaults) { for(cur=defaults; cur->next; cur=cur->next); cur->next = entry; entry->next = NULL; } else { defaults = entry; defaults->next = NULL; } } else { numusers++; /* Hash the username */ hashindex = fastuser_hash(entry->name, inst->hashsize); /* Store the last default before this entry */ entry->lastdefault = lastdefault; /* Store user in the hash */ fastuser_store(pair_list, entry, hashindex); } } /* Restore entry to next pair_list */ entry = next; } /* while(entry) loop */ if(!isacctfile && (default_list)) { *default_list = defaults; radlog(L_INFO, "rlm_fastusers: Loaded %d users and %d defaults", numusers, numdefaults); } else { *pair_list = users; } return 0; } /* Hashes the username sent to it and returns index into hashtable */ int fastuser_hash(const char *s, int hashtablesize) { unsigned int hash = 0; while (*s != '\0') { hash = hash * 7907 + (unsigned char)*s++; } return (hash % hashtablesize); } /* Stores the username sent into the hashtable */ static int fastuser_store(PAIR_LIST **hashtable, PAIR_LIST *new, int idx) { PAIR_LIST *cur; cur = hashtable[idx]; /* store new record at end of list */ if(cur) { while (cur->next != NULL) cur=cur->next; cur->next = new; new->next = NULL; } else { new->next = hashtable[idx]; hashtable[idx] = new; } return 1; } /* * Looks up user in hashtable. If user can't be found, returns 0. * Otherwise returns a pointer to the structure for the user */ static PAIR_LIST *fastuser_find(REQUEST *request, PAIR_LIST *user, const char *username) { PAIR_LIST *cur=user; int userfound = 0; /* * Now we have to make sure it's the right user by * comparing the check pairs */ while((cur) && (!userfound)) { if((strcmp(cur->name, username)==0) && paircompare(request, request->packet->vps, cur->check, &request->reply->vps) == 0) { userfound = 1; DEBUG2(" fastusers: Matched %s at %d", cur->name, cur->lineno); } else { cur = cur->next; } } if(cur) { return cur; } return (PAIR_LIST *)0; } /* * Generate and log statistics about our hash table */ static void fastuser_tablestats(PAIR_LIST **hashtable, int size) { int i, count; int countarray[256]; int toomany=0; PAIR_LIST *cur; memset(countarray, 0, sizeof(countarray)); for(i=0; inext) { count++; } if(count<256) { countarray[count]++; } else { toomany++; } } for(i=0; i<256; i++) if(countarray[i]) { radlog(L_INFO, "rlm_fastusers: Hash buckets with %d users: %d", i, countarray[i]); } if(toomany) { radlog(L_INFO, "rlm_fastusers: Hash buckets with more than 256: %d", toomany); } } /* * (Re-)read the "users" file into memory. */ static int fastuser_instantiate(CONF_SECTION *conf, void **instance) { struct fastuser_instance *inst=0; inst = rad_malloc(sizeof *inst); if (!inst) return -1; memset(inst, 0, sizeof(*inst)); if (cf_section_parse(conf, inst, module_config) < 0) { free(inst); return -1; } inst->next_reload = time(NULL) + inst->hash_reload; inst->hashtable = NULL; inst->lastusersload = 0; inst->lastacctusersload = 0; if(fastuser_buildhash(inst) < 0) { radlog(L_ERR, "rlm_fastusers: error building user hash. aborting"); return -1; } /* * Need code here to read acct_users file */ *instance = inst; return 0; } /* * Find the named user in the database. Create the * set of attribute-value pairs to check and reply with * for this user from the database. The main code only * needs to check the password, the rest is done here. */ static int fastuser_authorize(void *instance, REQUEST *request) { VALUE_PAIR *namepair; VALUE_PAIR *check_tmp; VALUE_PAIR *reply_tmp; PAIR_LIST *user; PAIR_LIST *curdefault; const char *name; int userfound=0; int defaultfound=0; int hashidx=0; struct fastuser_instance *inst = instance; char buffer[256]; /* * Do we need to reload the cache? * Really we should spawn a thread to do this */ if((inst->hash_reload) && (request->timestamp > inst->next_reload)) { inst->next_reload = request->timestamp + inst->hash_reload; radlog(L_INFO, "rlm_fastusers: Reloading fastusers hash"); if(fastuser_buildhash(inst) < 0) { radlog(L_ERR, "rlm_fastusers: error building user hash. aborting"); return RLM_MODULE_FAIL; } } /* * Grab the canonical user name. */ if (!inst->key) { namepair = request->username; name = namepair ? (char *) namepair->vp_strvalue : "NONE"; } else { int len; len = radius_xlat(buffer, sizeof(buffer), inst->key, request, NULL); if (len) name = buffer; else name = "NONE"; } /* * Find the entry for the user. */ hashidx = fastuser_hash(name, inst->hashsize); user = inst->hashtable[hashidx]; if((user=fastuser_find(request, user, name))!=NULL) { userfound = 1; } /* * If there's no lastdefault and we * don't fallthrough, just copy the * pairs for this user and return */ if((user) && (userfound) && (user->lastdefault == NULL)) { DEBUG2("rlm_fastusers: user found before DEFAULT"); check_tmp = paircopy(user->check); pairmove(&request->config_items, &check_tmp); pairfree(&check_tmp); reply_tmp = paircopy(user->reply); pairmove(&request->reply->vps, &reply_tmp); pairfree(&reply_tmp); if(!fallthrough(user->reply)) { pairdelete(&request->reply->vps, PW_FALL_THROUGH); return(rad_check_return(user->check)); } else { user=user->next; user=fastuser_find(request, user, name); } } /* * When we get here, we've either found * the user or not, but to preserve order * we start at the top of the default * list and work our way thru * When we get to the user's 'lastdefault' * we check to see if we should stop * and return */ DEBUG2("rlm_fastusers: checking defaults"); curdefault = inst->defaults; while(curdefault) { if(paircompare(request, request->packet->vps, curdefault->check, &request->reply->vps) == 0) { DEBUG2(" fastusers: Matched %s at %d", curdefault->name, curdefault->lineno); defaultfound = 1; check_tmp = paircopy(curdefault->check); pairmove(&request->config_items, &check_tmp); pairfree(&check_tmp); reply_tmp = paircopy(curdefault->reply); pairmove(&request->reply->vps, &reply_tmp); pairfree(&reply_tmp); /* * There's no fallthru on this default which * is *before* we find the user in the file, * so we know it's safe to quit here */ if (!fallthrough(curdefault->reply)) break; } /* * If we found the user, we want to stop * processing once we get to 'lastdefault' * This way we can process this user's entry * in the order it was found in the file */ while((userfound && (user) && (curdefault == user->lastdefault))) { DEBUG2(" fastusers: found lastdefault at line %d", curdefault->lineno); check_tmp = paircopy(user->check); pairmove(&request->config_items, &check_tmp); pairfree(&check_tmp); reply_tmp = paircopy(user->reply); pairmove(&request->reply->vps, &reply_tmp); pairfree(&reply_tmp); if(!fallthrough(user->reply)) { pairdelete(&request->reply->vps, PW_FALL_THROUGH); return(rad_check_return(user->check)); } /* * Find next occurence of THIS user in * the users file */ user=user->next; user=fastuser_find(request, user, name); } curdefault = curdefault->next; } if(userfound || defaultfound) { pairdelete(&request->reply->vps, PW_FALL_THROUGH); return(rad_check_return(request->config_items)); } else { DEBUG2("rlm_fastusers: user not found"); return RLM_MODULE_NOTFOUND; } } /* * Authentication - unused. */ static int fastuser_authenticate(void *instance, REQUEST *request) { instance = instance; request = request; return RLM_MODULE_OK; } /* * Pre-Accounting - read the acct_users file for check_items and * config_items. Reply items are Not Recommended(TM) in acct_users, * except for Fallthrough, which should work * * This function is mostly a copy of file_authorize */ static int fastuser_preacct(void *instance, REQUEST *request) { VALUE_PAIR *namepair; const char *name; VALUE_PAIR *request_pairs; VALUE_PAIR **config_pairs; VALUE_PAIR *reply_pairs = NULL; VALUE_PAIR *check_tmp; VALUE_PAIR *reply_tmp; PAIR_LIST *pl = NULL; int found = 0; struct fastuser_instance *inst = instance; char buffer[256]; if (!inst->key) { namepair = request->username; name = namepair ? (char *) namepair->vp_strvalue : "NONE"; } else { int len; len = radius_xlat(buffer, sizeof(buffer), inst->key, request, NULL); if (len) name = buffer; else name = "NONE"; } request_pairs = request->packet->vps; config_pairs = &request->config_items; /* * Find the entry for the user. */ for (pl = inst->acctusers; pl; pl = pl->next) { if (strcmp(name, pl->name) && strcmp(pl->name, "DEFAULT")) continue; if (paircompare(request, request_pairs, pl->check, &reply_pairs) == 0) { DEBUG2(" acct_users: Matched %s at %d", pl->name, pl->lineno); found = 1; check_tmp = paircopy(pl->check); reply_tmp = paircopy(pl->reply); pairmove(&reply_pairs, &reply_tmp); pairmove(config_pairs, &check_tmp); pairfree(&reply_tmp); pairfree(&check_tmp); /* should be NULL */ /* * Fallthrough? */ if (!fallthrough(pl->reply)) break; } } /* * See if we succeeded. */ if (!found) return RLM_MODULE_NOOP; /* on to the next module */ /* * FIXME: log a warning if there are any reply items other than * Fallthrough */ pairfree(&reply_pairs); /* Don't need these */ return RLM_MODULE_OK; } /* * Clean up. */ static int fastuser_detach(void *instance) { struct fastuser_instance *inst = instance; int hashindex; PAIR_LIST *cur; /* Free hash table */ for(hashindex=0; hashindexhashsize; hashindex++) { if(inst->hashtable[hashindex]) { cur = inst->hashtable[hashindex]; pairlist_free(&cur); } } free(inst->hashtable); pairlist_free(&inst->defaults); pairlist_free(&inst->acctusers); return 0; } /* * This function is unused */ static int fastuser_accounting(void *instance UNUSED, REQUEST *request UNUSED) { /* * FIXME: should re rather return RLM_MODULE_NOOP here? */ return RLM_MODULE_FAIL; } /* globally exported name */ module_t rlm_fastusers = { RLM_MODULE_INIT, "fastusers", 0, /* type: reserved */ fastuser_instantiate, /* instantiation */ fastuser_detach, /* detach */ { fastuser_authenticate, /* authentication */ fastuser_authorize, /* authorization */ fastuser_preacct, /* preaccounting */ fastuser_accounting, /* accounting */ NULL, /* checksimul */ NULL, /* pre-proxy */ NULL, /* post-proxy */ NULL /* post-auth */ }, }; freeradius-server/src/modules/rlm_files/000077500000000000000000000000001257552170400207365ustar00rootroot00000000000000freeradius-server/src/modules/rlm_files/Makefile000066400000000000000000000000741257552170400223770ustar00rootroot00000000000000TARGET = rlm_files SRCS = rlm_files.c include ../rules.mak freeradius-server/src/modules/rlm_files/rlm_files.c000066400000000000000000000333521257552170400230640ustar00rootroot00000000000000/* * rlm_files.c authorization: Find a user in the "users" file. * * Version: $Id$ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2002,2006 The FreeRADIUS server project * Copyright 2000 Jeff Carneal */ #include RCSID("$Id$") #include #include #include #include #include struct file_instance { char *compat_mode; char *key; /* autz */ char *usersfile; fr_hash_table_t *users; /* preacct */ char *acctusersfile; fr_hash_table_t *acctusers; /* pre-proxy */ char *preproxy_usersfile; fr_hash_table_t *preproxy_users; /* authenticate */ char *auth_usersfile; fr_hash_table_t *auth_users; /* post-proxy */ char *postproxy_usersfile; fr_hash_table_t *postproxy_users; /* post-authenticate */ char *postauth_usersfile; fr_hash_table_t *postauth_users; }; /* * See if a VALUE_PAIR list contains Fall-Through = Yes */ static int fallthrough(VALUE_PAIR *vp) { VALUE_PAIR *tmp; tmp = pairfind(vp, PW_FALL_THROUGH); return tmp ? tmp->vp_integer : 0; } static const CONF_PARSER module_config[] = { { "usersfile", PW_TYPE_FILENAME, offsetof(struct file_instance,usersfile), NULL, NULL }, { "acctusersfile", PW_TYPE_FILENAME, offsetof(struct file_instance,acctusersfile), NULL, NULL }, { "preproxy_usersfile", PW_TYPE_FILENAME, offsetof(struct file_instance,preproxy_usersfile), NULL, NULL }, { "auth_usersfile", PW_TYPE_FILENAME, offsetof(struct file_instance,auth_usersfile), NULL, NULL }, { "postproxy_usersfile", PW_TYPE_FILENAME, offsetof(struct file_instance,postproxy_usersfile), NULL, NULL }, { "postauth_usersfile", PW_TYPE_FILENAME, offsetof(struct file_instance,postauth_usersfile), NULL, NULL }, { "compat", PW_TYPE_STRING_PTR, offsetof(struct file_instance,compat_mode), NULL, "cistron" }, { "key", PW_TYPE_STRING_PTR, offsetof(struct file_instance,key), NULL, NULL }, { NULL, -1, 0, NULL, NULL } }; static uint32_t pairlist_hash(const void *data) { return fr_hash_string(((const PAIR_LIST *)data)->name); } static int pairlist_cmp(const void *a, const void *b) { return strcmp(((const PAIR_LIST *)a)->name, ((const PAIR_LIST *)b)->name); } static void my_pairlist_free(void *data) { PAIR_LIST *pl = data; pairlist_free(&pl); } static int getusersfile(const char *filename, fr_hash_table_t **pht, char *compat_mode_str) { int rcode; PAIR_LIST *users = NULL; PAIR_LIST *entry, *next; fr_hash_table_t *ht, *tailht; int order = 0; if (!filename) { *pht = NULL; return 0; } rcode = pairlist_read(filename, &users, 1); if (rcode < 0) { return -1; } /* * Walk through the 'users' file list, if we're debugging, * or if we're in compat_mode. */ if ((debug_flag) || (strcmp(compat_mode_str, "cistron") == 0)) { VALUE_PAIR *vp; int compat_mode = FALSE; if (strcmp(compat_mode_str, "cistron") == 0) { compat_mode = TRUE; } entry = users; while (entry) { if (compat_mode) { DEBUG("[%s]:%d Cistron compatibility checks for entry %s ...", filename, entry->lineno, entry->name); } /* * Look for improper use of '=' in the * check items. They should be using * '==' for on-the-wire RADIUS attributes, * and probably ':=' for server * configuration items. */ for (vp = entry->check; vp != NULL; vp = vp->next) { /* * Ignore attributes which are set * properly. */ if (vp->operator != T_OP_EQ) { continue; } /* * If it's a vendor attribute, * or it's a wire protocol, * ensure it has '=='. */ if (((vp->attribute & ~0xffff) != 0) || (vp->attribute < 0x100)) { if (!compat_mode) { DEBUG("[%s]:%d WARNING! Changing '%s =' to '%s =='\n\tfor comparing RADIUS attribute in check item list for user %s", filename, entry->lineno, vp->name, vp->name, entry->name); } else { DEBUG("\tChanging '%s =' to '%s =='", vp->name, vp->name); } vp->operator = T_OP_CMP_EQ; continue; } /* * Cistron Compatibility mode. * * Re-write selected attributes * to be '+=', instead of '='. * * All others get set to '==' */ if (compat_mode) { /* * Non-wire attributes become += * * On the write attributes * become == */ if ((vp->attribute >= 0x100) && (vp->attribute <= 0xffff) && (vp->attribute != PW_HINT) && (vp->attribute != PW_HUNTGROUP_NAME)) { DEBUG("\tChanging '%s =' to '%s +='", vp->name, vp->name); vp->operator = T_OP_ADD; } else { DEBUG("\tChanging '%s =' to '%s =='", vp->name, vp->name); vp->operator = T_OP_CMP_EQ; } } } /* end of loop over check items */ /* * Look for server configuration items * in the reply list. * * It's a common enough mistake, that it's * worth doing. */ for (vp = entry->reply; vp != NULL; vp = vp->next) { /* * If it's NOT a vendor attribute, * and it's NOT a wire protocol * and we ignore Fall-Through, * then bitch about it, giving a * good warning message. */ if (!(vp->attribute & ~0xffff) && (vp->attribute > 0xff) && (vp->attribute > 1000)) { log_debug("[%s]:%d WARNING! Check item \"%s\"\n" "\tfound in reply item list for user \"%s\".\n" "\tThis attribute MUST go on the first line" " with the other check items", filename, entry->lineno, vp->name, entry->name); } } entry = entry->next; } } ht = fr_hash_table_create(pairlist_hash, pairlist_cmp, my_pairlist_free); if (!ht) { pairlist_free(&users); return -1; } tailht = fr_hash_table_create(pairlist_hash, pairlist_cmp, NULL); if (!tailht) { fr_hash_table_free(ht); pairlist_free(&users); return -1; } /* * Now that we've read it in, put the entries into a hash * for faster access. */ for (entry = users; entry != NULL; entry = next) { PAIR_LIST *tail; next = entry->next; entry->next = NULL; entry->order = order++; /* * Insert it into the hash table, and remember * the tail of the linked list. */ tail = fr_hash_table_finddata(tailht, entry); if (!tail) { /* * Insert it into the head & tail. */ if (!fr_hash_table_insert(ht, entry) || !fr_hash_table_insert(tailht, entry)) { pairlist_free(&next); fr_hash_table_free(ht); fr_hash_table_free(tailht); return -1; } } else { tail->next = entry; if (!fr_hash_table_replace(tailht, entry)) { pairlist_free(&next); fr_hash_table_free(ht); fr_hash_table_free(tailht); return -1; } } } fr_hash_table_free(tailht); *pht = ht; return 0; } /* * Clean up. */ static int file_detach(void *instance) { struct file_instance *inst = instance; fr_hash_table_free(inst->users); fr_hash_table_free(inst->acctusers); fr_hash_table_free(inst->preproxy_users); fr_hash_table_free(inst->auth_users); fr_hash_table_free(inst->postproxy_users); fr_hash_table_free(inst->postauth_users); free(inst); return 0; } /* * (Re-)read the "users" file into memory. */ static int file_instantiate(CONF_SECTION *conf, void **instance) { struct file_instance *inst; int rcode; inst = rad_malloc(sizeof *inst); if (!inst) { return -1; } memset(inst, 0, sizeof(*inst)); if (cf_section_parse(conf, inst, module_config) < 0) { free(inst); return -1; } rcode = getusersfile(inst->usersfile, &inst->users, inst->compat_mode); if (rcode != 0) { radlog(L_ERR|L_CONS, "Errors reading %s", inst->usersfile); file_detach(inst); return -1; } rcode = getusersfile(inst->acctusersfile, &inst->acctusers, inst->compat_mode); if (rcode != 0) { radlog(L_ERR|L_CONS, "Errors reading %s", inst->acctusersfile); file_detach(inst); return -1; } /* * Get the pre-proxy stuff */ rcode = getusersfile(inst->preproxy_usersfile, &inst->preproxy_users, inst->compat_mode); if (rcode != 0) { radlog(L_ERR|L_CONS, "Errors reading %s", inst->preproxy_usersfile); file_detach(inst); return -1; } rcode = getusersfile(inst->auth_usersfile, &inst->auth_users, inst->compat_mode); if (rcode != 0) { radlog(L_ERR|L_CONS, "Errors reading %s", inst->auth_usersfile); file_detach(inst); return -1; } rcode = getusersfile(inst->postproxy_usersfile, &inst->postproxy_users, inst->compat_mode); if (rcode != 0) { radlog(L_ERR|L_CONS, "Errors reading %s", inst->postproxy_usersfile); file_detach(inst); return -1; } rcode = getusersfile(inst->postauth_usersfile, &inst->postauth_users, inst->compat_mode); if (rcode != 0) { radlog(L_ERR|L_CONS, "Errors reading %s", inst->postauth_usersfile); file_detach(inst); return -1; } *instance = inst; return 0; } /* * Common code called by everything below. */ static int file_common(struct file_instance *inst, REQUEST *request, const char *filename, fr_hash_table_t *ht, VALUE_PAIR *request_pairs, VALUE_PAIR **reply_pairs) { const char *name, *match; VALUE_PAIR **config_pairs; VALUE_PAIR *check_tmp; VALUE_PAIR *reply_tmp; const PAIR_LIST *user_pl, *default_pl; int found = 0; PAIR_LIST my_pl; char buffer[256]; if (!inst->key) { VALUE_PAIR *namepair; namepair = request->username; name = namepair ? (char *) namepair->vp_strvalue : "NONE"; } else { int len; len = radius_xlat(buffer, sizeof(buffer), inst->key, request, NULL); if (len) name = buffer; else name = "NONE"; } config_pairs = &request->config_items; if (!ht) return RLM_MODULE_NOOP; my_pl.name = name; user_pl = fr_hash_table_finddata(ht, &my_pl); my_pl.name = "DEFAULT"; default_pl = fr_hash_table_finddata(ht, &my_pl); /* * Find the entry for the user. */ while (user_pl || default_pl) { const PAIR_LIST *pl; if (!default_pl && user_pl) { pl = user_pl; match = name; user_pl = user_pl->next; } else if (!user_pl && default_pl) { pl = default_pl; match = "DEFAULT"; default_pl = default_pl->next; } else if (user_pl->order < default_pl->order) { pl = user_pl; match = name; user_pl = user_pl->next; } else { pl = default_pl; match = "DEFAULT"; default_pl = default_pl->next; } if (paircompare(request, request_pairs, pl->check, reply_pairs) == 0) { RDEBUG2("%s: Matched entry %s at line %d", filename, match, pl->lineno); found = 1; check_tmp = paircopy(pl->check); reply_tmp = paircopy(pl->reply); pairxlatmove(request, reply_pairs, &reply_tmp); pairmove(config_pairs, &check_tmp); pairfree(&reply_tmp); pairfree(&check_tmp); /* * Fallthrough? */ if (!fallthrough(pl->reply)) break; } } /* * Remove server internal parameters. */ pairdelete(reply_pairs, PW_FALL_THROUGH); /* * See if we succeeded. */ if (!found) return RLM_MODULE_NOOP; /* on to the next module */ return RLM_MODULE_OK; } /* * Find the named user in the database. Create the * set of attribute-value pairs to check and reply with * for this user from the database. The main code only * needs to check the password, the rest is done here. */ static int file_authorize(void *instance, REQUEST *request) { struct file_instance *inst = instance; return file_common(inst, request, "users", inst->users, request->packet->vps, &request->reply->vps); } /* * Pre-Accounting - read the acct_users file for check_items and * config_items. Reply items are Not Recommended(TM) in acct_users, * except for Fallthrough, which should work */ static int file_preacct(void *instance, REQUEST *request) { struct file_instance *inst = instance; return file_common(inst, request, "acct_users", inst->acctusers, request->packet->vps, &request->reply->vps); } static int file_preproxy(void *instance, REQUEST *request) { struct file_instance *inst = instance; return file_common(inst, request, "preproxy_users", inst->preproxy_users, request->packet->vps, &request->proxy->vps); } static int file_postproxy(void *instance, REQUEST *request) { struct file_instance *inst = instance; return file_common(inst, request, "postproxy_users", inst->postproxy_users, request->proxy_reply->vps, &request->reply->vps); } static int file_authenticate(void *instance, REQUEST *request) { struct file_instance *inst = instance; return file_common(inst, request, "auth_users", inst->auth_users, request->packet->vps, &request->reply->vps); } static int file_postauth(void *instance, REQUEST *request) { struct file_instance *inst = instance; return file_common(inst, request, "postauth_users", inst->postauth_users, request->packet->vps, &request->reply->vps); } /* globally exported name */ module_t rlm_files = { RLM_MODULE_INIT, "files", RLM_TYPE_CHECK_CONFIG_SAFE | RLM_TYPE_HUP_SAFE, file_instantiate, /* instantiation */ file_detach, /* detach */ { file_authenticate, /* authentication */ file_authorize, /* authorization */ file_preacct, /* preaccounting */ NULL, /* accounting */ NULL, /* checksimul */ file_preproxy, /* pre-proxy */ file_postproxy, /* post-proxy */ file_postauth /* post-auth */ }, }; freeradius-server/src/modules/rlm_ippool/000077500000000000000000000000001257552170400211365ustar00rootroot00000000000000freeradius-server/src/modules/rlm_ippool/.gitignore000066400000000000000000000000421257552170400231220ustar00rootroot00000000000000Makefile config.h rlm_ippool_tool freeradius-server/src/modules/rlm_ippool/Makefile.in000066400000000000000000000012601257552170400232020ustar00rootroot00000000000000# # $Id$ # TARGET = @targetname@ SRCS = rlm_ippool.c HEADERS = RLM_UTILS = $(addsuffix $(EXEEXT),@ippool_utils@) RLM_CFLAGS = @ippool_cflags@ RLM_LIBS = @ippool_ldflags@ RLM_INSTALL = @ippool_install@ include ../rules.mak $(LT_OBJS): $(HEADERS) rlm_ippool_tool$(EXEEXT): rlm_ippool_tool.lo $(LIBRADIUS) $(LIBTOOL) --mode=link --tag=CC $(CC) $(LDFLAGS) $(RLM_LDFLAGS) \ -o $@ $^ $(RLM_LIBS) $(LIBS) # Install binary files into the bin directory rlm_ippool_install: rlm_ippool_tool rlm_ippool_tool.8 $(INSTALL) -m 644 rlm_ippool_tool.8 $(R)$(mandir)/man8 $(LIBTOOL) --mode=install $(INSTALL) -m 755 $(INSTALLSTRIP) \ rlm_ippool_tool$(EXEEXT) $(R)$(bindir) freeradius-server/src/modules/rlm_ippool/config.h.in000066400000000000000000000010751257552170400231640ustar00rootroot00000000000000/* config.h.in. Generated from configure.in by autoheader. */ /* do we have gdbm_fdesc */ #undef HAVE_GDBM_FDESC /* do we need GDBM_SYNC */ #undef NEED_GDBM_SYNC /* 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 version of this package. */ #undef PACKAGE_VERSION freeradius-server/src/modules/rlm_ippool/configure000077500000000000000000003717071257552170400230640ustar00rootroot00000000000000#! /bin/sh # From configure.in Revision. # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.61. # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, # 2002, 2003, 2004, 2005, 2006 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=: # 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 # PATH needs CR # 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 # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false 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.) as_nl=' ' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. 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 # Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # CDPATH. $as_unset CDPATH if test "x$CONFIG_SHELL" = x; then if (eval ":") 2>/dev/null; then as_have_required=yes else as_have_required=no fi if test $as_have_required = yes && (eval ": (as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=\$LINENO as_lineno_2=\$LINENO test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } ") 2> /dev/null; then : else as_candidate_shells= as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. case $as_dir in /*) for as_base in sh bash ksh sh5; do as_candidate_shells="$as_candidate_shells $as_dir/$as_base" done;; esac done IFS=$as_save_IFS for as_shell in $as_candidate_shells $SHELL; do # Try only shells that exist, to save several forks. if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { ("$as_shell") 2> /dev/null <<\_ASEOF 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 : _ASEOF }; then CONFIG_SHELL=$as_shell as_have_required=yes if { "$as_shell" 2> /dev/null <<\_ASEOF 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 : (as_func_return () { (exit $1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = "$1" ); then : else exitcode=1 echo positional parameters were not saved. fi test $exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } _ASEOF }; then break fi fi done if test "x$CONFIG_SHELL" != x; then for as_var in BASH_ENV ENV do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done export CONFIG_SHELL exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} fi if test $as_have_required = no; then echo This script requires a shell more modern than all the echo shells that I found on your system. Please install a echo modern shell, or manually run the script under such a echo shell if you do have one. { (exit 1); exit 1; } fi fi fi (eval "as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0") || { echo No shell found that supports shell functions. echo Please tell autoconf@gnu.org about your system, echo including any error possibly output before this echo message } as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, and appends # trailing '-' during substitution so that $LINENO is not a special # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # scripts with optimization help from Paolo Bonzini. 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" || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi 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 fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi 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=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, 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= SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME= PACKAGE_TARNAME= PACKAGE_VERSION= PACKAGE_STRING= PACKAGE_BUGREPORT= ac_unique_file="rlm_ippool.c" ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datarootdir datadir sysconfdir sharedstatedir localstatedir includedir oldincludedir docdir infodir htmldir dvidir pdfdir psdir libdir localedir mandir DEFS ECHO_C ECHO_N ECHO_T LIBS build_alias host_alias target_alias CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP GREP EGREP ippool_ldflags ippool_cflags targetname ippool_utils ippool_install LIBOBJS LTLIBOBJS' ac_subst_files='' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CPP' # Initialize some variables set by options. ac_init_help= ac_init_version=false # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *) ac_optarg=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_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` eval enable_$ac_feature=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_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` eval enable_$ac_feature=\$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_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/[-.]/_/g'` eval with_$ac_package=\$ac_optarg ;; -without-* | --without-*) ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/[-.]/_/g'` eval with_$ac_package=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 ;; -*) { echo "$as_me: error: unrecognized option: $ac_option Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && 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'` { echo "$as_me: error: missing argument to $ac_option" >&2 { (exit 1); exit 1; }; } fi # Be sure to have absolute directory names. 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 case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; } 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 echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || { echo "$as_me: error: Working directory cannot be determined" >&2 { (exit 1); exit 1; }; } test "X$ac_ls_di" = "X$ac_pwd_ls_di" || { echo "$as_me: error: pwd does not report name of working directory" >&2 { (exit 1); exit 1; }; } # 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 -- "$0" || $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$0" : 'X\(//\)[^/]' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X"$0" | 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 .." { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2 { (exit 1); exit 1; }; } pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures this package to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF _ACEOF fi if test -n "$ac_init_help"; then cat <<\_ACEOF 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 C/C++/Objective C preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. _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" || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`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 echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF configure generated by GNU Autoconf 2.61 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 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 cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by $as_me, which was generated by GNU Autoconf 2.61. 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=. 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=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; 2) ac_configure_args1="$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 ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac done done $as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } $as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export 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 cat <<\_ASBOX ## ---------------- ## ## Cache variables. ## ## ---------------- ## _ASBOX 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_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( *) $as_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 cat <<\_ASBOX ## ----------------- ## ## Output variables. ## ## ----------------- ## _ASBOX echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then cat <<\_ASBOX ## ------------------- ## ## File substitutions. ## ## ------------------- ## _ASBOX echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then cat <<\_ASBOX ## ----------- ## ## confdefs.h. ## ## ----------- ## _ASBOX echo cat confdefs.h echo fi test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" 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'; { (exit 1); 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 # 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 # Let the site file select an alternate cache file if it wants to. # Prefer explicitly selected file to automatically selected ones. if test -n "$CONFIG_SITE"; then set x "$CONFIG_SITE" elif test "x$prefix" != xNONE; then set x "$prefix/share/config.site" "$prefix/etc/config.site" else set x "$ac_default_prefix/share/config.site" \ "$ac_default_prefix/etc/config.site" fi shift for ac_site_file do if test -r "$ac_site_file"; then { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" 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. if test -f "$cache_file"; then { echo "$as_me:$LINENO: loading cache $cache_file" >&5 echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { echo "$as_me:$LINENO: creating cache $cache_file" >&5 echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 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 { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 echo "$as_me: former value: $ac_old_val" >&2;} { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 echo "$as_me: current value: $ac_new_val" >&2;} ac_cache_corrupted=: fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`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. *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 echo "$as_me: error: changes in the environment can compromise the build" >&2;} { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} { (exit 1); exit 1; }; } 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 x$with_rlm_ippool != xno; then 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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}gcc" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="gcc" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}cc" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="$ac_prog" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&5 echo "$as_me: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } # Provide some information about the compiler. echo "$as_me:$LINENO: checking for C compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (ac_try="$ac_compiler --version >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -v >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -V >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out 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. { echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6; } ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # # List of possible output files, starting from the most likely. # The algorithm is not robust to junk in `.', hence go to wildcards (a.*) # only as a last resort. b.out is created by i960 compilers. ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out' # # The IRIX 6 linker writes into existing files which may not be # executable, retaining their permissions. Remove them first so a # subsequent execution test works. ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link_default") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; 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 | *.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 { echo "$as_me:$LINENO: result: $ac_file" >&5 echo "${ECHO_T}$ac_file" >&6; } if test -z "$ac_file"; then echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: C compiler cannot create executables See \`config.log' for more details." >&5 echo "$as_me: error: C compiler cannot create executables See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } fi ac_exeext=$ac_cv_exeext # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { echo "$as_me:$LINENO: checking whether the C compiler works" >&5 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6; } # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then if { ac_try='./$ac_file' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { echo "$as_me:$LINENO: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&5 echo "$as_me: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi fi fi { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } rm -f a.out a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; } { echo "$as_me:$LINENO: result: $cross_compiling" >&5 echo "${ECHO_T}$cross_compiling" >&6; } { echo "$as_me:$LINENO: checking for suffix of executables" >&5 echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; } if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; 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 | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest$ac_cv_exeext { echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 echo "${ECHO_T}$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT { echo "$as_me:$LINENO: checking for suffix of object files" >&5 echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; } if test "${ac_cv_objext+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; 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 ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 echo "${ECHO_T}$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; } if test "${ac_cv_c_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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 { echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; } GCC=`test $ac_compiler_gnu = yes && echo yes` ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CFLAGS="" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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 { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 echo "${ECHO_T}$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 { echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_c89+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_c89=$ac_arg else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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) { echo "$as_me:$LINENO: result: none needed" >&5 echo "${ECHO_T}none needed" >&6; } ;; xno) { echo "$as_me:$LINENO: result: unsupported" >&5 echo "${ECHO_T}unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;; 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 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 { echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if test "${ac_cv_prog_CPP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f 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 { echo "$as_me:$LINENO: result: $CPP" >&5 echo "${ECHO_T}$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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&5 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } 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_safe=`echo "gdbm.h" | sed 'y%./+-%__pm%'` { echo "$as_me:$LINENO: checking for gdbm.h" >&5 echo $ECHO_N "checking for gdbm.h... $ECHO_C" >&6; } old_CFLAGS="$CFLAGS" smart_include= smart_include_dir= if test "x$smart_try_dir" != "x"; then for try in $smart_try_dir; do CFLAGS="$old_CFLAGS -I$try" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { int a = 1; ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then smart_include="-I$try" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 smart_include= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test "x$smart_include" != "x"; then break; fi done CFLAGS="$old_CFLAGS" fi if test "x$smart_include" = "x"; then cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { int a = 1; ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then smart_include=" " else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 smart_include= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test "x$smart_include" = "x"; then if test "x$LOCATE" != "x"; then DIRS= file=gdbm.h for x in `${LOCATE} $file 2>/dev/null`; do base=`echo $x | sed "s%/${file}%%"` if test "x$x" = "x$base"; then continue; fi dir=`${DIRNAME} $x 2>/dev/null` exclude=`echo ${dir} | ${GREP} /home` if test "x$exclude" != "x"; then continue fi already=`echo \$smart_include_dir ${DIRS} | ${GREP} ${dir}` if test "x$already" = "x"; then DIRS="$DIRS $dir" fi done fi eval "smart_include_dir=\"\$smart_include_dir $DIRS\"" for try in $smart_include_dir /usr/local/include /opt/include; do CFLAGS="$old_CFLAGS -I$try" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { int a = 1; ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then smart_include="-I$try" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 smart_include= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test "x$smart_include" != "x"; then break; fi done CFLAGS="$old_CFLAGS" fi if test "x$smart_include" != "x"; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } eval "ac_cv_header_$ac_safe=yes" CFLAGS="$old_CFLAGS $smart_include" SMART_CFLAGS="$SMART_CFLAGS $smart_include" else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi sm_lib_safe=`echo "gdbm" | sed 'y%./+-%__p_%'` sm_func_safe=`echo "gdbm_open" | sed 'y%./+-%__p_%'` { echo "$as_me:$LINENO: checking for gdbm_open in -lgdbm" >&5 echo $ECHO_N "checking for gdbm_open in -lgdbm... $ECHO_C" >&6; } old_LIBS="$LIBS" smart_lib= smart_lib_dir= if test "x$smart_try_dir" != "x"; then for try in $smart_try_dir; do LIBS="-L$try -lgdbm $old_LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ extern char gdbm_open(); int main () { gdbm_open() ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then smart_lib="-L$try -lgdbm" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test "x$smart_lib" != "x"; then break; fi done LIBS="$old_LIBS" fi if test "x$smart_lib" = "x"; then LIBS="-lgdbm $old_LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ extern char gdbm_open(); int main () { gdbm_open() ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then smart_lib="-lgdbm" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS="$old_LIBS" fi if test "x$smart_lib" = "x"; then if test "x$LOCATE" != "x"; then DIRS= file=libgdbm${libltdl_cv_shlibext} for x in `${LOCATE} $file 2>/dev/null`; do base=`echo $x | sed "s%/${file}%%"` if test "x$x" = "x$base"; then continue; fi dir=`${DIRNAME} $x 2>/dev/null` exclude=`echo ${dir} | ${GREP} /home` if test "x$exclude" != "x"; then continue fi already=`echo \$smart_lib_dir ${DIRS} | ${GREP} ${dir}` if test "x$already" = "x"; then DIRS="$DIRS $dir" fi done fi eval "smart_lib_dir=\"\$smart_lib_dir $DIRS\"" if test "x$LOCATE" != "x"; then DIRS= file=libgdbm.a for x in `${LOCATE} $file 2>/dev/null`; do base=`echo $x | sed "s%/${file}%%"` if test "x$x" = "x$base"; then continue; fi dir=`${DIRNAME} $x 2>/dev/null` exclude=`echo ${dir} | ${GREP} /home` if test "x$exclude" != "x"; then continue fi already=`echo \$smart_lib_dir ${DIRS} | ${GREP} ${dir}` if test "x$already" = "x"; then DIRS="$DIRS $dir" fi done fi eval "smart_lib_dir=\"\$smart_lib_dir $DIRS\"" for try in $smart_lib_dir /usr/local/lib /opt/lib; do LIBS="-L$try -lgdbm $old_LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ extern char gdbm_open(); int main () { gdbm_open() ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then smart_lib="-L$try -lgdbm" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test "x$smart_lib" != "x"; then break; fi done LIBS="$old_LIBS" fi if test "x$smart_lib" != "x"; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } eval "ac_cv_lib_${sm_lib_safe}_${sm_func_safe}=yes" LIBS="$smart_lib $old_LIBS" SMART_LIBS="$smart_lib $SMART_LIBS" else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_cv_lib_gdbm_gdbm_open" != "xyes"; then fail="$fail libgdbm" fi if test "x$fail" = "x"; then { echo "$as_me:$LINENO: checking to see GDBM_SYNC status" >&5 echo $ECHO_N "checking to see GDBM_SYNC status... $ECHO_C" >&6; } { echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5 echo $ECHO_N "checking for grep that handles long lines and -e... $ECHO_C" >&6; } if test "${ac_cv_path_GREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Extract the first word of "grep ggrep" to use in msg output if test -z "$GREP"; then set dummy grep ggrep; ac_prog_name=$2 if test "${ac_cv_path_GREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" 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 ac_count=`expr $ac_count + 1` 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 fi GREP="$ac_cv_path_GREP" if test -z "$GREP"; then { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} { (exit 1); exit 1; }; } fi else ac_cv_path_GREP=$GREP fi fi { echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5 echo "${ECHO_T}$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { echo "$as_me:$LINENO: checking for egrep" >&5 echo $ECHO_N "checking for egrep... $ECHO_C" >&6; } if test "${ac_cv_path_EGREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else # Extract the first word of "egrep" to use in msg output if test -z "$EGREP"; then set dummy egrep; ac_prog_name=$2 if test "${ac_cv_path_EGREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" 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 ac_count=`expr $ac_count + 1` 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 fi EGREP="$ac_cv_path_EGREP" if test -z "$EGREP"; then { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} { (exit 1); exit 1; }; } fi else ac_cv_path_EGREP=$EGREP fi fi fi { echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 echo "${ECHO_T}$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifdef GDBM_SYNC found-gdbm-sync! #else not found. this version must use sync by default. #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "found-gdbm-sync" >/dev/null 2>&1; then cat >>confdefs.h <<\_ACEOF #define NEED_GDBM_SYNC yes _ACEOF { echo "$as_me:$LINENO: result: needs it." >&5 echo "${ECHO_T}needs it." >&6; } else { echo "$as_me:$LINENO: result: SYNCs by default." >&5 echo "${ECHO_T}SYNCs by default." >&6; } fi rm -f conftest* fi old_LIBS=$LIBS LIBS="$LIBS $SMART_LIBS" { echo "$as_me:$LINENO: checking for gdbm_fdesc" >&5 echo $ECHO_N "checking for gdbm_fdesc... $ECHO_C" >&6; } if test "${ac_cv_func_gdbm_fdesc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define gdbm_fdesc to an innocuous variant, in case declares gdbm_fdesc. For example, HP-UX 11i declares gettimeofday. */ #define gdbm_fdesc innocuous_gdbm_fdesc /* System header to define __stub macros and hopefully few prototypes, which can conflict with char gdbm_fdesc (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef gdbm_fdesc /* 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 gdbm_fdesc (); /* 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_gdbm_fdesc || defined __stub___gdbm_fdesc choke me #endif int main () { return gdbm_fdesc (); ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_func_gdbm_fdesc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_gdbm_fdesc=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_func_gdbm_fdesc" >&5 echo "${ECHO_T}$ac_cv_func_gdbm_fdesc" >&6; } if test "x$ac_cv_func_gdbm_fdesc" = "xyes"; then cat >>confdefs.h <<\_ACEOF #define HAVE_GDBM_FDESC _ACEOF fi LIBS=$old_LIBS targetname=rlm_ippool else targetname= echo \*\*\* module rlm_ippool is disabled. fi if test x"$fail" != x""; then if test x"${enable_strict_dependencies}" = x"yes"; then { { echo "$as_me:$LINENO: error: set --without-rlm_ippool to disable it explicitly." >&5 echo "$as_me: error: set --without-rlm_ippool to disable it explicitly." >&2;} { (exit 1); exit 1; }; } else { echo "$as_me:$LINENO: WARNING: silently not building rlm_ippool." >&5 echo "$as_me: WARNING: silently not building rlm_ippool." >&2;} { echo "$as_me:$LINENO: WARNING: FAILURE: rlm_ippool requires: $fail." >&5 echo "$as_me: WARNING: FAILURE: rlm_ippool requires: $fail." >&2;}; targetname="" fi fi if test x"$targetname" != x""; then ippool_utils="rlm_ippool_tool" ippool_install="rlm_ippool_install" fi ippool_ldflags=$SMART_LIBS ippool_cflags=$SMART_CFLAGS ac_config_headers="$ac_config_headers config.h" unset ac_cv_env_LIBS_set unset ac_cv_env_LIBS_value ac_config_files="$ac_config_files 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_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( *) $as_unset $ac_var ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then test "x$cache_file" != "x/dev/null" && { echo "$as_me:$LINENO: updating cache $cache_file" >&5 echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 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= 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=`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. ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs : ${CONFIG_STATUS=./config.status} ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >$CONFIG_STATUS <<_ACEOF #! $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} _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ## --------------------- ## ## 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=: # 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 # PATH needs CR # 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 # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false 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.) as_nl=' ' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. 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 # Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # CDPATH. $as_unset CDPATH as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, and appends # trailing '-' during substitution so that $LINENO is not a special # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # scripts with optimization help from Paolo Bonzini. 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" || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi 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 fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi 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=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 # Save the log message, to keep $[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by $as_me, which was generated by GNU Autoconf 2.61. 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 cat >>$CONFIG_STATUS <<_ACEOF # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ config.status configured by $0, generated by GNU Autoconf 2.61, with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" Copyright (C) 2006 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' _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # If no file are specified by the user, then we need to provide default # value. By we need to know if files were specified by the user. 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=$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 ) echo "$ac_cs_version"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift CONFIG_FILES="$CONFIG_FILES $ac_optarg" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header { echo "$as_me: error: ambiguous option: $1 Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; };; --help | --hel | -h ) 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. -*) { echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *) ac_config_targets="$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 if \$ac_cs_recheck; then echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 CONFIG_SHELL=$SHELL export CONFIG_SHELL exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # 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" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= trap 'exit_status=$? { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status ' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || { echo "$me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } # # Set up the sed scripts for CONFIG_FILES section. # # No need to generate the scripts if there are no CONFIG_FILES. # This happens for instance when ./config.status config.h if test -n "$CONFIG_FILES"; then _ACEOF ac_delim='%!_!# ' for ac_last_try in false false false false false :; do cat >conf$$subs.sed <<_ACEOF SHELL!$SHELL$ac_delim PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim PACKAGE_NAME!$PACKAGE_NAME$ac_delim PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim PACKAGE_STRING!$PACKAGE_STRING$ac_delim PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim exec_prefix!$exec_prefix$ac_delim prefix!$prefix$ac_delim program_transform_name!$program_transform_name$ac_delim bindir!$bindir$ac_delim sbindir!$sbindir$ac_delim libexecdir!$libexecdir$ac_delim datarootdir!$datarootdir$ac_delim datadir!$datadir$ac_delim sysconfdir!$sysconfdir$ac_delim sharedstatedir!$sharedstatedir$ac_delim localstatedir!$localstatedir$ac_delim includedir!$includedir$ac_delim oldincludedir!$oldincludedir$ac_delim docdir!$docdir$ac_delim infodir!$infodir$ac_delim htmldir!$htmldir$ac_delim dvidir!$dvidir$ac_delim pdfdir!$pdfdir$ac_delim psdir!$psdir$ac_delim libdir!$libdir$ac_delim localedir!$localedir$ac_delim mandir!$mandir$ac_delim DEFS!$DEFS$ac_delim ECHO_C!$ECHO_C$ac_delim ECHO_N!$ECHO_N$ac_delim ECHO_T!$ECHO_T$ac_delim LIBS!$LIBS$ac_delim build_alias!$build_alias$ac_delim host_alias!$host_alias$ac_delim target_alias!$target_alias$ac_delim CC!$CC$ac_delim CFLAGS!$CFLAGS$ac_delim LDFLAGS!$LDFLAGS$ac_delim CPPFLAGS!$CPPFLAGS$ac_delim ac_ct_CC!$ac_ct_CC$ac_delim EXEEXT!$EXEEXT$ac_delim OBJEXT!$OBJEXT$ac_delim CPP!$CPP$ac_delim GREP!$GREP$ac_delim EGREP!$EGREP$ac_delim ippool_ldflags!$ippool_ldflags$ac_delim ippool_cflags!$ippool_cflags$ac_delim targetname!$targetname$ac_delim ippool_utils!$ippool_utils$ac_delim ippool_install!$ippool_install$ac_delim LIBOBJS!$LIBOBJS$ac_delim LTLIBOBJS!$LTLIBOBJS$ac_delim _ACEOF if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 54; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` if test -n "$ac_eof"; then ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` ac_eof=`expr $ac_eof + 1` fi cat >>$CONFIG_STATUS <<_ACEOF cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof /@[a-zA-Z_][a-zA-Z_0-9]*@/!b end _ACEOF sed ' s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g s/^/s,@/; s/!/@,|#_!!_#|/ :n t n s/'"$ac_delim"'$/,g/; t s/$/\\/; p N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n ' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF :end s/|#_!!_#|//g CEOF$ac_eof _ACEOF # VPATH may cause trouble with some makes, so we remove $(srcdir), # ${srcdir} and @srcdir@ 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[ ]*=/{ s/:*\$(srcdir):*/:/ s/:*\${srcdir}:*/:/ s/:*@srcdir@:*/:/ s/^\([^=]*=[ ]*\):*/\1/ s/:*$// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF fi # test -n "$CONFIG_FILES" for ac_tag in :F $CONFIG_FILES :H $CONFIG_HEADERS do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5 echo "$as_me: error: Invalid tag $ac_tag." >&2;} { (exit 1); exit 1; }; };; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 echo "$as_me: error: cannot find input file: $ac_f" >&2;} { (exit 1); exit 1; }; };; esac ac_file_inputs="$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 "`IFS=: echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure." if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { echo "$as_me:$LINENO: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} fi case $ac_tag in *:-:* | *:-) cat >"$tmp/stdin";; 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 || 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" case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`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 || 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" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 echo "$as_me: error: cannot create directory $as_dir" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`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 # _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # 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= case `sed -n '/datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p ' $ac_file_inputs` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF 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 sed "$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s&@configure_input@&$configure_input&;t t s&@top_builddir@&$ac_top_builddir_sub&;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 $ac_datarootdir_hack " $ac_file_inputs | sed -f "$tmp/subs-1.sed" >$tmp/out test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&5 echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&2;} rm -f "$tmp/stdin" case $ac_file in -) cat "$tmp/out"; rm -f "$tmp/out";; *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;; esac ;; :H) # # CONFIG_HEADER # _ACEOF # Transform confdefs.h into a sed script `conftest.defines', that # substitutes the proper values into config.h.in to produce config.h. rm -f conftest.defines conftest.tail # First, append a space to every undef/define line, to ease matching. echo 's/$/ /' >conftest.defines # Then, protect against being on the right side of a sed subst, or in # an unquoted here document, in config.status. If some macros were # called several times there might be several #defines for the same # symbol, which is useless. But do not sort them, since the last # AC_DEFINE must be honored. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* # These sed commands are passed to sed as "A NAME B PARAMS C VALUE D", where # NAME is the cpp macro being defined, VALUE is the value it is being given. # PARAMS is the parameter list in the macro definition--in most cases, it's # just an empty string. ac_dA='s,^\\([ #]*\\)[^ ]*\\([ ]*' ac_dB='\\)[ (].*,\\1define\\2' ac_dC=' ' ac_dD=' ,' uniq confdefs.h | sed -n ' t rset :rset s/^[ ]*#[ ]*define[ ][ ]*// t ok d :ok s/[\\&,]/\\&/g s/^\('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/ '"$ac_dA"'\1'"$ac_dB"'\2'"${ac_dC}"'\3'"$ac_dD"'/p s/^\('"$ac_word_re"'\)[ ]*\(.*\)/'"$ac_dA"'\1'"$ac_dB$ac_dC"'\2'"$ac_dD"'/p ' >>conftest.defines # Remove the space that was appended to ease matching. # Then 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. # (The regexp can be short, since the line contains either #define or #undef.) echo 's/ $// s,^[ #]*u.*,/* & */,' >>conftest.defines # Break up conftest.defines: ac_max_sed_lines=50 # First sed command is: sed -f defines.sed $ac_file_inputs >"$tmp/out1" # Second one is: sed -f defines.sed "$tmp/out1" >"$tmp/out2" # Third one will be: sed -f defines.sed "$tmp/out2" >"$tmp/out1" # et cetera. ac_in='$ac_file_inputs' ac_out='"$tmp/out1"' ac_nxt='"$tmp/out2"' while : do # Write a here document: cat >>$CONFIG_STATUS <<_ACEOF # First, check the format of the line: cat >"\$tmp/defines.sed" <<\\CEOF /^[ ]*#[ ]*undef[ ][ ]*$ac_word_re[ ]*\$/b def /^[ ]*#[ ]*define[ ][ ]*$ac_word_re[( ]/b def b :def _ACEOF sed ${ac_max_sed_lines}q conftest.defines >>$CONFIG_STATUS echo 'CEOF sed -f "$tmp/defines.sed"' "$ac_in >$ac_out" >>$CONFIG_STATUS ac_in=$ac_out; ac_out=$ac_nxt; ac_nxt=$ac_in sed 1,${ac_max_sed_lines}d conftest.defines >conftest.tail grep . conftest.tail >/dev/null || break rm -f conftest.defines mv conftest.tail conftest.defines done rm -f conftest.defines conftest.tail echo "ac_result=$ac_in" >>$CONFIG_STATUS cat >>$CONFIG_STATUS <<\_ACEOF if test x"$ac_file" != x-; then echo "/* $configure_input */" >"$tmp/config.h" cat "$ac_result" >>"$tmp/config.h" if diff $ac_file "$tmp/config.h" >/dev/null 2>&1; then { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 echo "$as_me: $ac_file is unchanged" >&6;} else rm -f $ac_file mv "$tmp/config.h" $ac_file fi else echo "/* $configure_input */" cat "$ac_result" fi rm -f "$tmp/out12" ;; esac done # for ac_tag { (exit 0); exit 0; } _ACEOF chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save # 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 || { (exit 1); exit 1; } fi freeradius-server/src/modules/rlm_ippool/configure.in000066400000000000000000000030651257552170400234530ustar00rootroot00000000000000AC_PREREQ([2.53]) AC_INIT(rlm_ippool.c) AC_REVISION($Revision$) AC_DEFUN(modname,[rlm_ippool]) if test x$with_[]modname != xno; then AC_PROG_CC AC_PROG_CPP FR_SMART_CHECK_INCLUDE(gdbm.h) FR_SMART_CHECK_LIB(gdbm, gdbm_open) if test "x$ac_cv_lib_gdbm_gdbm_open" != "xyes"; then fail="$fail libgdbm" fi if test "x$fail" = "x"; then AC_MSG_CHECKING(to see GDBM_SYNC status) AC_EGREP_CPP(found-gdbm-sync, [ #include #ifdef GDBM_SYNC found-gdbm-sync! #else not found. this version must use sync by default. #endif ], [ AC_DEFINE(NEED_GDBM_SYNC, yes, [do we need GDBM_SYNC]) AC_MSG_RESULT(needs it.) ], [ AC_MSG_RESULT(SYNCs by default.) ] ) fi old_LIBS=$LIBS LIBS="$LIBS $SMART_LIBS" AC_CHECK_FUNC(gdbm_fdesc) if test "x$ac_cv_func_gdbm_fdesc" = "xyes"; then AC_DEFINE(HAVE_GDBM_FDESC, [], [do we have gdbm_fdesc]) fi LIBS=$old_LIBS targetname=modname else targetname= echo \*\*\* module modname is disabled. fi if test x"$fail" != x""; then if test x"${enable_strict_dependencies}" = x"yes"; then AC_MSG_ERROR([set --without-]modname[ to disable it explicitly.]) else AC_MSG_WARN([silently not building ]modname[.]) AC_MSG_WARN([FAILURE: ]modname[ requires: $fail.]); targetname="" fi fi if test x"$targetname" != x""; then ippool_utils="rlm_ippool_tool" ippool_install="rlm_ippool_install" fi ippool_ldflags=$SMART_LIBS ippool_cflags=$SMART_CFLAGS AC_SUBST(ippool_ldflags) AC_SUBST(ippool_cflags) AC_SUBST(targetname) AC_SUBST(ippool_utils) AC_SUBST(ippool_install) AC_CONFIG_HEADER(config.h) AC_OUTPUT(Makefile) freeradius-server/src/modules/rlm_ippool/rlm_ippool.c000066400000000000000000000607501257552170400234660ustar00rootroot00000000000000/* * rlm_ippool.c * * Version: $Id$ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2001,2006 The FreeRADIUS server project * Copyright 2002 Kostas Kalevras * * March 2002, Kostas Kalevras * - Initial release * April 2002, Kostas Kalevras * - Add support for the Pool-Name attribute * May 2002, Kostas Kalevras * - Check the return value of a gdbm_fetch() we didn't check * - Change the nas entry in the ippool_key structure from uint32 to string[64] * That should allow us to also use the NAS-Identifier attribute * Sep 2002, Kostas Kalevras * - Move from authorize to post-auth * - Use mutex locks when accessing the gdbm files * - Fail if we don't find nas port information * Oct 2002, Kostas Kalevras * - Do a memset(0) on the key.nas before doing searches. Nusty bug * Jul 2003, Kostas Kalevras * - Make Multilink work this time * - Instead of locking file operations, lock transactions. That means we only keep * one big transaction lock instead of per file locks (mutexes). * Sep 2003, Kostas Kalevras * - Fix postauth to not leak ip's * Add an extra attribute in each entry signifying if we need to delete this * entry in the accounting phase. This is only true in case we are doing MPPP * Various other code changes. Code comments should explain things * Highly experimental at this phase. * Mar 2004, Kostas Kalevras * - Add a timestamp and a timeout attribute in ippool_info. When we assign an ip we set timestamp * to request->timestamp and timeout to %{Session-Timeout:-0}. When we search for a free entry * we check if timeout has expired. If it has then we free the entry. We also add a maximum * timeout configuration directive. If it is non zero then we also use that one to free entries. * Jul 2004, Kostas Kalevras * - If Pool-Name is set to DEFAULT then always run. * Mar 2005, Kostas Kalevras * - Make the key an MD5 of a configurable xlated string. This closes Bug #42 */ #include RCSID("$Id$") #include #include #include "config.h" #include #include "../../include/md5.h" #include #ifdef NEEDS_GDBM_SYNC # define GDBM_SYNCOPT GDBM_SYNC #else # define GDBM_SYNCOPT 0 #endif #ifdef GDBM_NOLOCK #define GDBM_IPPOOL_OPTS (GDBM_SYNCOPT | GDBM_NOLOCK) #else #define GDBM_IPPOOL_OPTS (GDBM_SYNCOPT) #endif #define MAX_NAS_NAME_SIZE 64 /* * Define a structure for our module configuration. * * These variables do not need to be in a structure, but it's * a lot cleaner to do so, and a pointer to the structure can * be used as the instance handle. */ typedef struct rlm_ippool_t { char *session_db; char *ip_index; char *name; char *key; uint32_t range_start; uint32_t range_stop; uint32_t netmask; time_t max_timeout; int cache_size; int override; GDBM_FILE gdbm; GDBM_FILE ip; #ifdef HAVE_PTHREAD_H pthread_mutex_t op_mutex; #endif } rlm_ippool_t; #ifndef HAVE_PTHREAD_H /* * This is easier than ifdef's throughout the code. */ #define pthread_mutex_init(_x, _y) #define pthread_mutex_destroy(_x) #define pthread_mutex_lock(_x) #define pthread_mutex_unlock(_x) #endif typedef struct ippool_info { uint32_t ipaddr; char active; char cli[32]; char extra; time_t timestamp; time_t timeout; } ippool_info; typedef struct ippool_key { char key[16]; } ippool_key; /* * A mapping of configuration file names to internal variables. * * Note that the string is dynamically allocated, so it MUST * be freed. When the configuration file parse re-reads the string, * it free's the old one, and strdup's the new one, placing the pointer * to the strdup'd string into 'config.string'. This gets around * buffer over-flows. */ static const CONF_PARSER module_config[] = { { "session-db", PW_TYPE_STRING_PTR, offsetof(rlm_ippool_t,session_db), NULL, NULL }, { "ip-index", PW_TYPE_STRING_PTR, offsetof(rlm_ippool_t,ip_index), NULL, NULL }, { "key", PW_TYPE_STRING_PTR, offsetof(rlm_ippool_t,key), NULL, "%{NAS-IP-Address} %{NAS-Port}" }, { "range-start", PW_TYPE_IPADDR, offsetof(rlm_ippool_t,range_start), NULL, "0" }, { "range-stop", PW_TYPE_IPADDR, offsetof(rlm_ippool_t,range_stop), NULL, "0" }, { "netmask", PW_TYPE_IPADDR, offsetof(rlm_ippool_t,netmask), NULL, "0" }, { "cache-size", PW_TYPE_INTEGER, offsetof(rlm_ippool_t,cache_size), NULL, "1000" }, { "override", PW_TYPE_BOOLEAN, offsetof(rlm_ippool_t,override), NULL, "no" }, { "maximum-timeout", PW_TYPE_INTEGER, offsetof(rlm_ippool_t,max_timeout), NULL, "0" }, { NULL, -1, 0, NULL, NULL } }; /* * Do any per-module initialization that is separate to each * configured instance of the module. e.g. set up connections * to external databases, read configuration files, set up * dictionary entries, etc. * * If configuration information is given in the config section * that must be referenced in later calls, store a handle to it * in *instance otherwise put a null pointer there. */ static int ippool_instantiate(CONF_SECTION *conf, void **instance) { rlm_ippool_t *data; int cache_size; ippool_info entry; ippool_key key; datum key_datum; datum data_datum; const char *cli = "0"; const char *pool_name = NULL; /* * Set up a storage area for instance data */ data = rad_malloc(sizeof(*data)); if (!data) { return -1; } memset(data, 0, sizeof(*data)); /* * If the configuration parameters can't be parsed, then * fail. */ if (cf_section_parse(conf, data, module_config) < 0) { free(data); return -1; } cache_size = data->cache_size; if (data->session_db == NULL) { radlog(L_ERR, "rlm_ippool: 'session-db' must be set."); free(data); return -1; } if (data->ip_index == NULL) { radlog(L_ERR, "rlm_ippool: 'ip-index' must be set."); free(data); return -1; } data->range_start = htonl(data->range_start); data->range_stop = htonl(data->range_stop); data->netmask = htonl(data->netmask); if (data->range_start == 0 || data->range_stop == 0 || \ data->range_start >= data->range_stop ) { radlog(L_ERR, "rlm_ippool: Invalid configuration data given."); free(data); return -1; } data->gdbm = gdbm_open(data->session_db, sizeof(int), GDBM_WRCREAT | GDBM_IPPOOL_OPTS, 0600, NULL); if (data->gdbm == NULL) { radlog(L_ERR, "rlm_ippool: Failed to open file %s: %s", data->session_db, strerror(errno)); return -1; } data->ip = gdbm_open(data->ip_index, sizeof(int), GDBM_WRCREAT | GDBM_IPPOOL_OPTS, 0600, NULL); if (data->ip == NULL) { radlog(L_ERR, "rlm_ippool: Failed to open file %s: %s", data->ip_index, strerror(errno)); return -1; } if (gdbm_setopt(data->gdbm, GDBM_CACHESIZE, &cache_size, sizeof(int)) == -1) radlog(L_ERR, "rlm_ippool: Failed to set cache size"); if (gdbm_setopt(data->ip, GDBM_CACHESIZE, &cache_size, sizeof(int)) == -1) radlog(L_ERR, "rlm_ippool: Failed to set cache size"); key_datum = gdbm_firstkey(data->gdbm); if (key_datum.dptr == NULL){ /* * If the database does not exist initialize it. * We set the nas/port pairs to not existent values and * active = 0 */ int rcode; uint32_t i, j; uint32_t or_result; char str[32]; char init_str[17]; DEBUG("rlm_ippool: Initializing database"); for(i=data->range_start,j=~0;i<=data->range_stop;i++,j--){ /* * Net and Broadcast addresses are excluded */ or_result = i | data->netmask; if (~data->netmask != 0 && (or_result == data->netmask || (~or_result == 0))) { DEBUG("rlm_ippool: IP %s excluded", ip_ntoa(str, ntohl(i))); continue; } sprintf(init_str,"%016d",j); DEBUG("rlm_ippool: Initialized bucket: %s",init_str); memcpy(key.key, init_str,16); key_datum.dptr = (char *) &key; key_datum.dsize = sizeof(ippool_key); entry.ipaddr = ntohl(i); entry.active = 0; entry.extra = 0; entry.timestamp = 0; entry.timeout = 0; strcpy(entry.cli,cli); data_datum.dptr = (char *) &entry; data_datum.dsize = sizeof(ippool_info); rcode = gdbm_store(data->gdbm, key_datum, data_datum, GDBM_REPLACE); if (rcode < 0) { radlog(L_ERR, "rlm_ippool: Failed storing data to %s: %s", data->session_db, gdbm_strerror(gdbm_errno)); gdbm_close(data->gdbm); gdbm_close(data->ip); free(data); return -1; } } } else free(key_datum.dptr); /* Add the ip pool name */ data->name = NULL; pool_name = cf_section_name2(conf); if (pool_name != NULL) data->name = strdup(pool_name); pthread_mutex_init(&data->op_mutex, NULL); *instance = data; return 0; } /* * Check for an Accounting-Stop * If we find one and we have allocated an IP to this nas/port combination, deallocate it. */ static int ippool_accounting(void *instance, REQUEST *request) { rlm_ippool_t *data = (rlm_ippool_t *)instance; datum key_datum; datum data_datum; datum save_datum; int acctstatustype = 0; int rcode; ippool_info entry; ippool_key key; int num = 0; VALUE_PAIR *vp; char str[32]; uint8_t key_str[17]; char hex_str[35]; char xlat_str[MAX_STRING_LEN]; FR_MD5_CTX md5_context; if ((vp = pairfind(request->packet->vps, PW_ACCT_STATUS_TYPE)) != NULL) acctstatustype = vp->vp_integer; else { RDEBUG("Could not find account status type in packet. Return NOOP."); return RLM_MODULE_NOOP; } switch(acctstatustype){ case PW_STATUS_STOP: if (!radius_xlat(xlat_str,MAX_STRING_LEN,data->key, request, NULL)){ RDEBUG("xlat on the 'key' directive failed"); return RLM_MODULE_NOOP; } fr_MD5Init(&md5_context); fr_MD5Update(&md5_context, xlat_str, strlen(xlat_str)); fr_MD5Final(key_str, &md5_context); key_str[16] = '\0'; fr_bin2hex(key_str,hex_str,16); hex_str[32] = '\0'; RDEBUG("MD5 on 'key' directive maps to: %s",hex_str); memcpy(key.key,key_str,16); break; default: /* We don't care about any other accounting packet */ RDEBUG("This is not an Accounting-Stop. Return NOOP."); return RLM_MODULE_NOOP; } RDEBUG("Searching for an entry for key: '%s'",xlat_str); key_datum.dptr = (char *) &key; key_datum.dsize = sizeof(ippool_key); pthread_mutex_lock(&data->op_mutex); data_datum = gdbm_fetch(data->gdbm, key_datum); if (data_datum.dptr != NULL){ /* * If the entry was found set active to zero */ memcpy(&entry, data_datum.dptr, sizeof(ippool_info)); free(data_datum.dptr); RDEBUG("Deallocated entry for ip: %s",ip_ntoa(str,entry.ipaddr)); entry.active = 0; entry.timestamp = 0; entry.timeout = 0; /* * Save the reference to the entry */ save_datum.dptr = key_datum.dptr; save_datum.dsize = key_datum.dsize; data_datum.dptr = (char *) &entry; data_datum.dsize = sizeof(ippool_info); rcode = gdbm_store(data->gdbm, key_datum, data_datum, GDBM_REPLACE); if (rcode < 0) { radlog(L_ERR, "rlm_ippool: Failed storing data to %s: %s", data->session_db, gdbm_strerror(gdbm_errno)); pthread_mutex_unlock(&data->op_mutex); return RLM_MODULE_FAIL; } /* * Decrease allocated count from the ip index */ key_datum.dptr = (char *) &entry.ipaddr; key_datum.dsize = sizeof(uint32_t); data_datum = gdbm_fetch(data->ip, key_datum); if (data_datum.dptr != NULL){ memcpy(&num, data_datum.dptr, sizeof(int)); free(data_datum.dptr); if (num >0){ num--; RDEBUG("num: %d",num); data_datum.dptr = (char *) # data_datum.dsize = sizeof(int); rcode = gdbm_store(data->ip, key_datum, data_datum, GDBM_REPLACE); if (rcode < 0) { radlog(L_ERR, "rlm_ippool: Failed storing data to %s: %s", data->ip_index, gdbm_strerror(gdbm_errno)); pthread_mutex_unlock(&data->op_mutex); return RLM_MODULE_FAIL; } if (num >0 && entry.extra == 1){ /* * We are doing MPPP and we still have nas/port entries referencing * this ip. Delete this entry so that eventually we only keep one * reference to this ip. */ gdbm_delete(data->gdbm,save_datum); } } } pthread_mutex_unlock(&data->op_mutex); } else{ pthread_mutex_unlock(&data->op_mutex); RDEBUG("Entry not found"); } return RLM_MODULE_OK; } static int ippool_postauth(void *instance, REQUEST *request) { rlm_ippool_t *data = (rlm_ippool_t *) instance; int delete = 0; int found = 0; int mppp = 0; int extra = 0; int rcode; int num = 0; datum key_datum; datum nextkey; datum data_datum; datum save_datum; ippool_key key; ippool_info entry; VALUE_PAIR *vp; char *cli = NULL; char str[32]; uint8_t key_str[17]; char hex_str[35]; char xlat_str[MAX_STRING_LEN]; FR_MD5_CTX md5_context; /* quiet the compiler */ instance = instance; request = request; /* Check if Pool-Name attribute exists. If it exists check our name and * run only if they match */ if ((vp = pairfind(request->config_items, PW_POOL_NAME)) != NULL){ if (data->name == NULL || (strcmp(data->name,vp->vp_strvalue) && strcmp(vp->vp_strvalue,"DEFAULT"))) return RLM_MODULE_NOOP; } else { RDEBUG("Could not find Pool-Name attribute."); return RLM_MODULE_NOOP; } /* * Find the caller id */ if ((vp = pairfind(request->packet->vps, PW_CALLING_STATION_ID)) != NULL) cli = vp->vp_strvalue; if (!radius_xlat(xlat_str,MAX_STRING_LEN,data->key, request, NULL)){ RDEBUG("xlat on the 'key' directive failed"); return RLM_MODULE_NOOP; } fr_MD5Init(&md5_context); fr_MD5Update(&md5_context, xlat_str, strlen(xlat_str)); fr_MD5Final(key_str, &md5_context); key_str[16] = '\0'; fr_bin2hex(key_str,hex_str,16); hex_str[32] = '\0'; RDEBUG("MD5 on 'key' directive maps to: %s",hex_str); memcpy(key.key,key_str,16); RDEBUG("Searching for an entry for key: '%s'",hex_str); key_datum.dptr = (char *) &key; key_datum.dsize = sizeof(ippool_key); pthread_mutex_lock(&data->op_mutex); data_datum = gdbm_fetch(data->gdbm, key_datum); if (data_datum.dptr != NULL){ /* * If there is a corresponding entry in the database with active=1 it is stale. * Set active to zero */ found = 1; memcpy(&entry, data_datum.dptr, sizeof(ippool_info)); free(data_datum.dptr); if (entry.active){ RDEBUG("Found a stale entry for ip: %s",ip_ntoa(str,entry.ipaddr)); entry.active = 0; entry.timestamp = 0; entry.timeout = 0; /* * Save the reference to the entry */ save_datum.dptr = key_datum.dptr; save_datum.dsize = key_datum.dsize; data_datum.dptr = (char *) &entry; data_datum.dsize = sizeof(ippool_info); rcode = gdbm_store(data->gdbm, key_datum, data_datum, GDBM_REPLACE); if (rcode < 0) { radlog(L_ERR, "rlm_ippool: Failed storing data to %s: %s", data->session_db, gdbm_strerror(gdbm_errno)); pthread_mutex_unlock(&data->op_mutex); return RLM_MODULE_FAIL; } /* Decrease allocated count from the ip index */ key_datum.dptr = (char *) &entry.ipaddr; key_datum.dsize = sizeof(uint32_t); data_datum = gdbm_fetch(data->ip, key_datum); if (data_datum.dptr != NULL){ memcpy(&num, data_datum.dptr, sizeof(int)); free(data_datum.dptr); if (num >0){ num--; RDEBUG("num: %d",num); data_datum.dptr = (char *) # data_datum.dsize = sizeof(int); rcode = gdbm_store(data->ip, key_datum, data_datum, GDBM_REPLACE); if (rcode < 0) { radlog(L_ERR, "rlm_ippool: Failed storing data to %s: %s", data->ip_index, gdbm_strerror(gdbm_errno)); pthread_mutex_unlock(&data->op_mutex); return RLM_MODULE_FAIL; } if (num >0 && entry.extra == 1){ /* * We are doing MPPP and we still have nas/port entries referencing * this ip. Delete this entry so that eventually we only keep one * reference to this ip. */ gdbm_delete(data->gdbm,save_datum); } } } } } pthread_mutex_unlock(&data->op_mutex); /* * If there is a Framed-IP-Address attribute in the reply, check for override */ if (pairfind(request->reply->vps, PW_FRAMED_IP_ADDRESS) != NULL) { RDEBUG("Found Framed-IP-Address attribute in reply attribute list."); if (data->override) { /* Override supplied Framed-IP-Address */ RDEBUG("override is set to yes. Override the existing Framed-IP-Address attribute."); pairdelete(&request->reply->vps, PW_FRAMED_IP_ADDRESS); } else { /* Abort */ RDEBUG("override is set to no. Return NOOP."); return RLM_MODULE_NOOP; } } /* * Walk through the database searching for an active=0 entry. * We search twice. Once to see if we have an active entry with the same callerid * so that MPPP can work ok and then once again to find a free entry. */ pthread_mutex_lock(&data->op_mutex); key_datum.dptr = NULL; if (cli != NULL){ key_datum = gdbm_firstkey(data->gdbm); while(key_datum.dptr){ data_datum = gdbm_fetch(data->gdbm, key_datum); if (data_datum.dptr){ memcpy(&entry,data_datum.dptr, sizeof(ippool_info)); free(data_datum.dptr); /* * If we find an entry for the same caller-id with active=1 * then we use that for multilink (MPPP) to work properly. */ if (strcmp(entry.cli,cli) == 0 && entry.active){ mppp = 1; break; } } nextkey = gdbm_nextkey(data->gdbm, key_datum); free(key_datum.dptr); key_datum = nextkey; } } if (key_datum.dptr == NULL){ key_datum = gdbm_firstkey(data->gdbm); while(key_datum.dptr){ data_datum = gdbm_fetch(data->gdbm, key_datum); if (data_datum.dptr){ memcpy(&entry,data_datum.dptr, sizeof(ippool_info)); free(data_datum.dptr); /* * Find an entry with active == 0 * or an entry that has expired */ if (entry.active == 0 || (entry.timestamp && ((entry.timeout && request->timestamp >= (entry.timestamp + entry.timeout)) || (data->max_timeout && request->timestamp >= (entry.timestamp + data->max_timeout))))){ datum tmp; tmp.dptr = (char *) &entry.ipaddr; tmp.dsize = sizeof(uint32_t); data_datum = gdbm_fetch(data->ip, tmp); /* * If we find an entry in the ip index and the number is zero (meaning * that we haven't allocated the same ip address to another nas/port pair) * or if we don't find an entry then delete the session entry so * that we can change the key * Else we don't delete the session entry since we haven't yet deallocated the * corresponding ip address and we continue our search. */ if (data_datum.dptr){ memcpy(&num,data_datum.dptr, sizeof(int)); free(data_datum.dptr); if (num == 0){ delete = 1; break; } } else{ delete = 1; break; } } } nextkey = gdbm_nextkey(data->gdbm, key_datum); free(key_datum.dptr); key_datum = nextkey; } } /* * If we have found a free entry set active to 1 then add a Framed-IP-Address attribute to * the reply * We keep the operation mutex locked until after we have set the corresponding entry active */ if (key_datum.dptr){ if (found && !mppp){ /* * Found == 1 means we have the nas/port combination entry in our database * We exchange the ip address between the nas/port entry and the free entry * Afterwards we will save the free ip address to the nas/port entry. * That is: * --------------------------------------------- * - NAS/PORT Entry |||| Free Entry ||| Time * - IP1 IP2(Free) BEFORE * - IP2(Free) IP1 AFTER * --------------------------------------------- * * We only do this if we are NOT doing MPPP * */ datum key_datum_tmp; datum data_datum_tmp; ippool_key key_tmp; memcpy(key_tmp.key,key_str,16); key_datum_tmp.dptr = (char *) &key_tmp; key_datum_tmp.dsize = sizeof(ippool_key); data_datum_tmp = gdbm_fetch(data->gdbm, key_datum_tmp); if (data_datum_tmp.dptr != NULL){ rcode = gdbm_store(data->gdbm, key_datum, data_datum_tmp, GDBM_REPLACE); free(data_datum_tmp.dptr); if (rcode < 0) { radlog(L_ERR, "rlm_ippool: Failed storing data to %s: %s", data->session_db, gdbm_strerror(gdbm_errno)); pthread_mutex_unlock(&data->op_mutex); return RLM_MODULE_FAIL; } } } else{ /* * We have not found the nas/port combination */ if (delete){ /* * Delete the entry so that we can change the key * All is well. We delete one entry and we add one entry */ gdbm_delete(data->gdbm, key_datum); } else{ /* * We are doing MPPP. (mppp should be 1) * We don't do anything. * We will create an extra not needed entry in the database in this case * but we don't really care since we always also use the ip_index database * when we search for a free entry. * We will also delete that entry on the accounting section so that we only * have one nas/port entry referencing each ip */ if (mppp) extra = 1; if (!mppp) radlog(L_ERR, "rlm_ippool: mppp is not one. Please report this behaviour."); } } free(key_datum.dptr); entry.active = 1; entry.timestamp = request->timestamp; if ((vp = pairfind(request->reply->vps, PW_SESSION_TIMEOUT)) != NULL) entry.timeout = (time_t) vp->vp_integer; else entry.timeout = 0; if (extra) entry.extra = 1; data_datum.dptr = (char *) &entry; data_datum.dsize = sizeof(ippool_info); memcpy(key.key, key_str, 16); key_datum.dptr = (char *) &key; key_datum.dsize = sizeof(ippool_key); DEBUG2("rlm_ippool: Allocating ip to key: '%s'",hex_str); rcode = gdbm_store(data->gdbm, key_datum, data_datum, GDBM_REPLACE); if (rcode < 0) { radlog(L_ERR, "rlm_ippool: Failed storing data to %s: %s", data->session_db, gdbm_strerror(gdbm_errno)); pthread_mutex_unlock(&data->op_mutex); return RLM_MODULE_FAIL; } /* Increase the ip index count */ key_datum.dptr = (char *) &entry.ipaddr; key_datum.dsize = sizeof(uint32_t); data_datum = gdbm_fetch(data->ip, key_datum); if (data_datum.dptr){ memcpy(&num,data_datum.dptr,sizeof(int)); free(data_datum.dptr); } else num = 0; num++; RDEBUG("num: %d",num); data_datum.dptr = (char *) # data_datum.dsize = sizeof(int); rcode = gdbm_store(data->ip, key_datum, data_datum, GDBM_REPLACE); if (rcode < 0) { radlog(L_ERR, "rlm_ippool: Failed storing data to %s: %s", data->ip_index, gdbm_strerror(gdbm_errno)); pthread_mutex_unlock(&data->op_mutex); return RLM_MODULE_FAIL; } pthread_mutex_unlock(&data->op_mutex); RDEBUG("Allocated ip %s to client key: %s",ip_ntoa(str,entry.ipaddr),hex_str); vp = radius_paircreate(request, &request->reply->vps, PW_FRAMED_IP_ADDRESS, PW_TYPE_IPADDR); vp->vp_ipaddr = entry.ipaddr; /* * If there is no Framed-Netmask attribute in the * reply, add one */ if (pairfind(request->reply->vps, PW_FRAMED_IP_NETMASK) == NULL) { vp = radius_paircreate(request, &request->reply->vps, PW_FRAMED_IP_NETMASK, PW_TYPE_IPADDR); vp->vp_ipaddr = ntohl(data->netmask); } } else{ pthread_mutex_unlock(&data->op_mutex); RDEBUG("No available ip addresses in pool."); return RLM_MODULE_NOTFOUND; } return RLM_MODULE_OK; } static int ippool_detach(void *instance) { rlm_ippool_t *data = (rlm_ippool_t *) instance; gdbm_close(data->gdbm); gdbm_close(data->ip); pthread_mutex_destroy(&data->op_mutex); free(instance); return 0; } /* * The module name should be the only globally exported symbol. * That is, everything else should be 'static'. * * If the module needs to temporarily modify it's instantiation * data, the type should be changed to RLM_TYPE_THREAD_UNSAFE. * The server will then take care of ensuring that the module * is single-threaded. */ module_t rlm_ippool = { RLM_MODULE_INIT, "ippool", RLM_TYPE_THREAD_SAFE, /* type */ ippool_instantiate, /* instantiation */ ippool_detach, /* detach */ { NULL, /* authentication */ NULL, /* authorization */ NULL, /* preaccounting */ ippool_accounting, /* accounting */ NULL, /* checksimul */ NULL, /* pre-proxy */ NULL, /* post-proxy */ ippool_postauth /* post-auth */ }, }; freeradius-server/src/modules/rlm_ippool/rlm_ippool_tool.8000066400000000000000000000056241257552170400244470ustar00rootroot00000000000000.TH RLM_IPPOOL_TOOL 8 .SH NAME rlm_ippool_tool - dump the contents of the FreeRadius ippool database files .SH SYNOPSIS .P If an ipaddress is specified then that address is used to limit the actions or output. .B rlm_ippool_tool .RB [ \-a ] .RB [ \-c ] .RB [ \-o ] .RB [ \-v ] \fIsession-db\fP \fIindex-db\fP [\fIipaddress\fP] .P Mark the entry nasIP/nasPort as having ipaddress .B rlm_ippool_tool \-n \fIsession-db\fP \fIindex-db\fP \fIipaddress\fP \fInasIP\fP \fInasPort\fP .P Update old format database to new. .B rlm_ippool_tool \-u \fIsession-db\fP \fInew-session-db\fP .SH DESCRIPTION \fBrlm_ippool_tool\fP dumps the contents of the FreeRADIUS ippool databases for analyses or for removal of active (stuck?) entries. .P Or with the \fB\-n\fP argument adds a usage entry to the FreeRADIUS ippool databases. .SH OPTIONS .IP \-a Print all active entries. .IP \-c Report number of active entries. .IP \-r Remove active entries. .IP \-v Verbose report of all entries. .IP \-o Assume old database format (nas/port pair, not md5 output). .IP \-n Mark the entry nasIP/nasPort as having ipaddress. .IP \-u Update old format database to new. .SH EXAMPLES .P Given the syntax in the FreeRadius radiusd.conf: .IP .nf ippool myippool { range-start = 192.168.1.0 range-stop = 192.168.1.255 [...] session-db = ${raddbdir}/ip-pool.db ip-index = ${raddbdir}/ip-index.db } .fi .P To see the number of active entries in this pool, use: .IP .nf $ rlm_ippool_tool -c ip-pool.db ip-index.db 13 .fi .P To see all active entries in this pool, use: .IP .nf $ rlm_ippool_tool -a ip-pool.db ip-index.db 192.168.1.5 192.168.1.82 192.168.1.244 192.168.1.57 192.168.1.120 192.168.1.27 [...] .fi .P To see all information about the active entries in the use, use: .IP .nf $ rlm_ippool_tool -av ip-pool.db ip-index.db NAS:172.16.1.1 port:0x2e8 - ipaddr:192.168.1.5 active:1 cli:0 num:1 NAS:172.16.1.1 port:0x17c - ipaddr:192.168.1.82 active:1 cli:0 num:1 NAS:172.16.1.1 port:0x106 - ipaddr:192.168.1.244 active:1 cli:0 num:1 NAS:172.16.1.1 port:0x157 - ipaddr:192.168.1.57 active:1 cli:0 num:1 NAS:172.16.1.1 port:0x2d8 - ipaddr:192.168.1.120 active:1 cli:0 num:1 NAS:172.16.1.1 port:0x162 - ipaddr:192.168.1.27 active:1 cli:0 num:1 [...] .fi .P To see only information of one entry, use: .IP .nf $ rlm_ippool_tool -v ip-pool.db ip-index.db 192.168.1.1 NAS:172.16.1.1 port:0x90 - ipaddr:192.168.1.1 active:0 cli:0 num:0 .fi .P To add an IP address usage entry, use: .IP .nf $ rlm_ippool_tool -n ip-pool.db ip-index.db 192.168.1.1 172.16.1.1 0x90 rlm_ippool_tool: Allocating ip to nas/port: 172.16.1.1/144 rlm_ippool_tool: num: 1 rlm_ippool_tool: Allocated ip 192.168.1.1 to client on nas 172.16.1.1,port 144 .fi .SH SEE ALSO radiusd(8) .SH AUTHORS Currently part of the FreeRADIUS Project (http://www.freeradius.org) Originally by Edwin Groothuis, edwin@mavetju.org (http://www.mavetju.org) Mailing list details are at http://www.freeradius.org/ freeradius-server/src/modules/rlm_ippool/rlm_ippool_tool.c000066400000000000000000000420451257552170400245200ustar00rootroot00000000000000/* * rlm_ippool_tool.c * * Version: $Id$ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2003,2006 FreeRADIUS Project, http://www.freeradius.org/ * Copyright 2003 Edwin Groothuis, edwin@mavetju.org * Permission from Edwin Groothuis for release under GPL is archived here: * http://lists.cistron.nl/archives/freeradius-devel/2003/09/frm00247.html * */ /* The original license follows. This license applies to the tarball at http://www.mavetju.org/unix/general.php Copyright 2003 by Edwin Groothuis, edwin@mavetju.org 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. THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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. */ #include RCSID("$Id$") #include #include #include #include "../../include/md5.h" int active=0; int aflag=0; int cflag=0; int rflag=0; int vflag=0; int nflag=0; int oflag=0; int uflag=0; typedef struct ippool_info { uint32_t ipaddr; char active; char cli[32]; char extra; } ippool_info; #define MAX_NAS_NAME_SIZE 64 typedef struct old_ippool_key { char nas[MAX_NAS_NAME_SIZE]; unsigned int port; } old_ippool_key; typedef struct ippool_key { char key[16]; } ippool_key; #define MATCH_IP(ip1,ip2) ((ip1)==NULL || strcmp((ip1),(ip2))==0) #define MATCH_ACTIVE(info) ((info).active==1 || !aflag) void addip(char *sessiondbname,char *indexdbname,char *ipaddress, char* NASname, char*NASport,int old); void viewdb(char *sessiondbname,char *indexdbname,char *ipaddress, int old); void tonewformat(char *sessiondbname,char *newsessiondbname); void usage(char *argv0); void addip(char *sessiondbname,char *indexdbname,char *ipaddress, char* NASname, char*NASport, int old) { GDBM_FILE sessiondb; GDBM_FILE indexdb; datum key_datum,data_datum,save_datum; datum nextkey; ippool_key key; old_ippool_key old_key; ippool_info entry; struct in_addr ipaddr; uint8_t key_str[17]; char hex_str[35]; int num=0; int mppp=0; int mode=GDBM_WRITER; signed int rcode; int delete = 0; int port; int extra = 0; int found = 0; sessiondb=gdbm_open(sessiondbname,512,mode,0,NULL); indexdb=gdbm_open(indexdbname,512,mode,0,NULL); if (inet_aton(ipaddress, &ipaddr) == 0) { printf("rlm_ippool_tool: Unable to convert IP address '%s'\n", ipaddress); return; } if (sessiondb==NULL) { printf("rlm_ippool_tool: Unable to open DB '%s'\n", sessiondbname); return; } if (indexdb==NULL) { printf("rlm_ippool_tool: Unable to open DB '%s'\n", indexdbname); return; } port = strtoul(NASport,NULL,0); /* Basically from rlm_ippool.c */ if (old){ strlcpy(old_key.nas,NASname,sizeof(old_key.nas)); old_key.port = port; key_datum.dptr = (char *) &old_key; key_datum.dsize = sizeof(old_ippool_key); } else{ char md5_input_str[MAX_STRING_LEN]; FR_MD5_CTX md5_context; snprintf(md5_input_str,MAX_STRING_LEN, "%s %s",NASname,NASport); fr_MD5Init(&md5_context); fr_MD5Update(&md5_context, md5_input_str, strlen(md5_input_str)); fr_MD5Final(key_str, &md5_context); memcpy(key.key,key_str,16); fr_bin2hex(key_str,hex_str,16); hex_str[32] = '\0'; key_datum.dptr = (char *) &key; key_datum.dsize = sizeof(ippool_key); } data_datum = gdbm_fetch(sessiondb, key_datum); if (data_datum.dptr != NULL){ found = 1; memcpy(&entry,data_datum.dptr, sizeof(ippool_info)); free(data_datum.dptr); if (entry.active){ if (old) printf("rlm_ippool_tool: Deleting stale entry for ip/port %s/%u", ipaddress, port); else printf("rlm_ippool_tool: Deleting stale entry for key: '%s'",hex_str); entry.active = 0; save_datum.dptr = key_datum.dptr; save_datum.dsize = key_datum.dsize; data_datum.dptr = (char*) &entry; data_datum.dsize = sizeof(ippool_info); rcode = gdbm_store(sessiondb, key_datum, data_datum, GDBM_REPLACE); if (rcode < 0) { printf("rlm_ippool_tool: Failed storing data to %s: %s\n", sessiondbname, gdbm_strerror(gdbm_errno)); gdbm_close(indexdb); gdbm_close(sessiondb); return; } key_datum.dptr = (char *) &entry.ipaddr; key_datum.dsize = sizeof(uint32_t); data_datum = gdbm_fetch(indexdb, key_datum); if (data_datum.dptr != NULL) { memcpy(&num, data_datum.dptr, sizeof(int)); free(data_datum.dptr); if (num > 0) { num--; data_datum.dptr = (char *) # data_datum.dsize = sizeof(int); rcode = gdbm_store(indexdb, key_datum, data_datum, GDBM_REPLACE); if (rcode < 0) { printf("rlm_ippool_tool: Failed storing data to %s: %s\n", indexdbname, gdbm_strerror(gdbm_errno)); gdbm_close(indexdb); gdbm_close(sessiondb); return; } if (num > 0 && entry.extra == 1) { gdbm_delete(sessiondb, save_datum); } } } } } key_datum.dptr = NULL; if (key_datum.dptr == NULL) { key_datum = gdbm_firstkey(sessiondb); while (key_datum.dptr) { data_datum = gdbm_fetch(sessiondb, key_datum); if (data_datum.dptr != NULL) { memcpy(&entry, data_datum.dptr, sizeof(ippool_info)); free(data_datum.dptr); if (entry.active == 0 && entry.ipaddr == ipaddr.s_addr) { datum tmp; tmp.dptr = (char *) &entry.ipaddr; tmp.dsize = sizeof(uint32_t); data_datum = gdbm_fetch(indexdb, tmp); if (data_datum.dptr){ memcpy(&num, data_datum.dptr, sizeof(int)); free(data_datum.dptr); if (num == 0){ delete = 1; break; } } else { delete = 1; break; } } } nextkey = gdbm_nextkey(sessiondb, key_datum); free(key_datum.dptr); key_datum = nextkey; } } if (key_datum.dptr){ if (found && ! mppp){ datum key_datum_tmp,data_datum_tmp; old_ippool_key old_key_tmp; ippool_key key_tmp; if (old){ strlcpy(old_key_tmp.nas,NASname, sizeof(old_key_tmp.nas)); old_key_tmp.port=port; key_datum_tmp.dptr = (char *) &old_key_tmp; key_datum_tmp.dsize = sizeof(old_ippool_key); } else{ memcpy(key_tmp.key,key_str,16); key_datum_tmp.dptr = (char *) &key_tmp; key_datum_tmp.dsize = sizeof(ippool_key); } data_datum_tmp = gdbm_fetch(sessiondb, key_datum_tmp); if (data_datum_tmp.dptr != NULL) { rcode = gdbm_store(sessiondb, key_datum, data_datum_tmp, GDBM_REPLACE); if (rcode < 0) { printf("rlm_ippool_tool: Failed storing data to %s: %s\n", sessiondbname, gdbm_strerror(gdbm_errno)); gdbm_close(indexdb); gdbm_close(sessiondb); return; } free(data_datum_tmp.dptr); } } else { if (delete) gdbm_delete(sessiondb, key_datum); else { if (mppp) extra = 1; #if 0 if (!mppp) printf("Error in if statements!!!\n"); #endif } } free(key_datum.dptr); entry.active=1; if (extra) entry.extra=1; data_datum.dptr = (char *) &entry; data_datum.dsize = sizeof(ippool_info); if (old){ strlcpy(old_key.nas,NASname,sizeof(old_key.nas)); old_key.port = port; key_datum.dptr = (char *) &old_key; key_datum.dsize = sizeof(old_ippool_key); printf("rlm_ippool_tool: Allocating ip to nas/port: %s/%u\n",old_key.nas,old_key.port); } else{ memcpy(key.key,key_str,16); key_datum.dptr = (char *) &key; key_datum.dsize = sizeof(ippool_key); printf("rlm_ippool_tool: Allocating ip to key: '%s'\n",hex_str); } rcode = gdbm_store(sessiondb, key_datum, data_datum, GDBM_REPLACE); if (rcode < 0) { printf("rlm_ippool_tool: Failed storing data to %s: %s\n", sessiondbname, gdbm_strerror(gdbm_errno)); gdbm_close(indexdb); gdbm_close(sessiondb); return; } /* Increase the ip index count */ key_datum.dptr = (char *) &entry.ipaddr; key_datum.dsize = sizeof(uint32_t); data_datum = gdbm_fetch(indexdb, key_datum); if (data_datum.dptr){ memcpy(&num,data_datum.dptr,sizeof(int)); free(data_datum.dptr); } else num = 0; num++; printf("rlm_ippool_tool: num: %d\n",num); data_datum.dptr = (char *) # data_datum.dsize = sizeof(int); rcode = gdbm_store(indexdb, key_datum, data_datum, GDBM_REPLACE); if (rcode < 0) { printf("rlm_ippool_tool: Failed storing data to %s: %s\n", indexdbname, gdbm_strerror(gdbm_errno)); gdbm_close(indexdb); gdbm_close(sessiondb); return; } if (old) printf("rlm_ippool_tool: Allocated ip %s to client on nas %s,port %u\n", ipaddress, old_key.nas,port); else printf("rlm_ippool_tool: Allocated ip %s to key '%s'\n",ipaddress,hex_str); } gdbm_close(indexdb); gdbm_close(sessiondb); } void tonewformat(char *sessiondbname,char *newsessiondbname){ GDBM_FILE sessiondb; GDBM_FILE newsessiondb; datum key_datum,keynext_datum,data_datum,newkey_datum; old_ippool_key old_key; ippool_key key; uint8_t key_str[17]; char hex_str[35]; int rcode; sessiondb=gdbm_open(sessiondbname,512,GDBM_READER,0,NULL); newsessiondb=gdbm_open(newsessiondbname,512,GDBM_NEWDB,0,NULL); if (sessiondb==NULL || newsessiondb==NULL) return; memset(key_str,0,17); key_datum=gdbm_firstkey(sessiondb); while (key_datum.dptr) { keynext_datum=gdbm_nextkey(sessiondb,key_datum); if (key_datum.dsize==sizeof(struct old_ippool_key)) { char md5_input_str[MAX_STRING_LEN]; FR_MD5_CTX md5_context; memcpy(&old_key,key_datum.dptr,sizeof(struct old_ippool_key)); snprintf(md5_input_str,MAX_STRING_LEN, "%s %d",old_key.nas,old_key.port); fr_MD5Init(&md5_context); fr_MD5Update(&md5_context, md5_input_str, strlen(md5_input_str)); fr_MD5Final(key_str, &md5_context); memcpy(key.key,key_str,16); fr_bin2hex(key_str,hex_str,16); hex_str[32] = '\0'; printf("rlm_ippool_tool: Transforming pair nas/port (%s/%d) to md5 '%s'\n", old_key.nas,old_key.port,hex_str); newkey_datum.dptr = (char *) &key; newkey_datum.dsize = sizeof(ippool_key); data_datum=gdbm_fetch(sessiondb,key_datum); if (data_datum.dptr!=NULL){ rcode=gdbm_store(newsessiondb,newkey_datum,data_datum,GDBM_REPLACE); if (rcode < 0) { printf("Failed to update new file %s: %s\n",newsessiondbname,gdbm_strerror(gdbm_errno)); gdbm_close(newsessiondb); gdbm_close(sessiondb); return; } } } key_datum=keynext_datum; } gdbm_close(newsessiondb); gdbm_close(sessiondb); } void viewdb(char *sessiondbname,char *indexdbname,char *ipaddress, int old) { GDBM_FILE sessiondb; GDBM_FILE indexdb; datum key_datum,keynext_datum,data_datum,save_datum; old_ippool_key old_key; ippool_key key; ippool_info info; struct in_addr ipaddr; int num; uint8_t key_str[17]; char hex_str[35]; char *ip; int mode=GDBM_READER; int rcode; if (rflag) mode=GDBM_WRITER; sessiondb=gdbm_open(sessiondbname,512,mode,0,NULL); indexdb=gdbm_open(indexdbname,512,mode,0,NULL); if (sessiondb==NULL || indexdb==NULL) return; memset(key_str,0,17); key_datum=gdbm_firstkey(sessiondb); while (key_datum.dptr) { keynext_datum=gdbm_nextkey(sessiondb,key_datum); if (key_datum.dsize==sizeof(struct ippool_key) || key_datum.dsize==sizeof(struct old_ippool_key)) { if (old) memcpy(&old_key,key_datum.dptr,sizeof(struct old_ippool_key)); else memcpy(&key,key_datum.dptr,sizeof(struct ippool_key)); data_datum=gdbm_fetch(sessiondb,key_datum); if (data_datum.dptr!=NULL) { memcpy(&info,data_datum.dptr,sizeof(struct ippool_info)); memcpy(&ipaddr,&info.ipaddr,4); ip=inet_ntoa(ipaddr); if (info.active) active++; if (vflag && MATCH_IP(ipaddress,ip) && MATCH_ACTIVE(info)){ if (old) printf("NAS:%s port:0x%x - ",old_key.nas,old_key.port); else{ memcpy(key_str,key.key,16); fr_bin2hex(key_str,hex_str,16); hex_str[32] = '\0'; printf("KEY: '%s' - ",hex_str); } } if (!vflag && aflag && info.active && MATCH_IP(ipaddress,ip)) printf("%s\n",ip); else if (vflag && MATCH_IP(ipaddress,ip) && MATCH_ACTIVE(info)) printf("ipaddr:%s active:%d cli:%s", inet_ntoa(ipaddr),info.active,info.cli); /* * algorythm copied from rlm_ippool.c: * - set active to zero * - set number of sessions to zero */ if (rflag && MATCH_IP(ipaddress,ip)) { info.active=0; save_datum.dptr = key_datum.dptr; save_datum.dsize = key_datum.dsize; data_datum.dptr = (char *) &info; data_datum.dsize = sizeof(ippool_info); rcode=gdbm_store(sessiondb,key_datum,data_datum,GDBM_REPLACE); if (rcode < 0) { printf("Failed to update %s: %s\n",ip,gdbm_strerror(gdbm_errno)); gdbm_close(indexdb); gdbm_close(sessiondb); return; } key_datum.dptr=(char *)&info.ipaddr; key_datum.dsize = sizeof(uint32_t); data_datum=gdbm_fetch(indexdb,key_datum); if (data_datum.dptr!=NULL) { memcpy(&num, data_datum.dptr, sizeof(int)); if (num>0) { num--; data_datum.dptr = (char *) # data_datum.dsize = sizeof(int); rcode = gdbm_store(indexdb, key_datum, data_datum, GDBM_REPLACE); if (rcode < 0) { printf("Failed to update %s: %s\n",ip,gdbm_strerror(gdbm_errno)); gdbm_close(indexdb); gdbm_close(sessiondb); return; } if (num > 0 && info.extra == 1) { gdbm_delete(sessiondb, save_datum); } } } } key_datum.dptr=(char *)&info.ipaddr; key_datum.dsize = sizeof(uint32_t); data_datum=gdbm_fetch(indexdb,key_datum); if (data_datum.dptr!=NULL) { memcpy(&num, data_datum.dptr, sizeof(int)); if (vflag && MATCH_IP(ipaddress,ip) && MATCH_ACTIVE(info)) printf(" num:%d",num); } if (vflag && MATCH_IP(ipaddress,ip) && MATCH_ACTIVE(info)) printf("\n"); } else if (vflag && ipaddress==NULL){ if (old) printf("NAS:%s port:0x%x\n",old_key.nas,old_key.port); else{ memcpy(key_str,key.key,16); fr_bin2hex(key_str,hex_str,16); hex_str[32] = '\0'; printf("KEY: '%s' - ",hex_str); } } } key_datum=keynext_datum; } gdbm_close(indexdb); gdbm_close(sessiondb); } void NEVER_RETURNS usage(char *argv0) { printf("Usage: %s [-a] [-c] [-o] [-v] [ipaddress]\n",argv0); printf("-a: print all active entries\n"); printf("-c: report number of active entries\n"); printf("-r: remove active entries\n"); printf("-v: verbose report of all entries\n"); printf("-o: Assume old database format (nas/port pair, not md5 output)\n"); printf("If an ipaddress is specified then that address is used to\n"); printf("limit the actions or output.\n"); printf("Usage: %s -n \n",argv0); printf("-n: Mark the entry nasIP/nasPort as having ipaddress\n"); printf("Usage: %s -u \n",argv0); printf("-u: Update old format database to new.\n"); exit(0); } int main(int argc,char **argv) { int ch; char *argv0=argv[0]; while ((ch=getopt(argc,argv,"acrvnou"))!=-1) switch (ch) { case 'a': aflag++;break; case 'c': cflag++;break; case 'r': rflag++;break; case 'v': vflag=1;break; case 'n': nflag=1;break; case 'o': oflag=1;break; case 'u': uflag=1;break; default: usage(argv0); } argc -= optind; argv += optind; if ((argc==2 || argc==3) && !nflag && !uflag) { viewdb(argv[0],argv[1],argv[2],oflag); if (cflag) printf("%d\n",active); } else if (argc==5 && nflag) addip(argv[0],argv[1],argv[2],argv[3],argv[4],oflag); else if (argc==2 && uflag) tonewformat(argv[0],argv[1]); else usage(argv0); return 0; } freeradius-server/src/modules/rlm_jradius/000077500000000000000000000000001257552170400212755ustar00rootroot00000000000000freeradius-server/src/modules/rlm_jradius/Makefile000066400000000000000000000004111257552170400227310ustar00rootroot00000000000000TARGET = rlm_jradius SRCS = rlm_jradius.c HEADERS = RLM_CFLAGS = -DEXTENDED_FMT RLM_LIBS = ## this uses the RLM_CFLAGS and RLM_LIBS and SRCS defs to make TARGET. include ../rules.mak $(STATIC_OBJS): $(HEADERS) $(DYNAMIC_OBJS): $(HEADERS) freeradius-server/src/modules/rlm_jradius/jradius.conf000066400000000000000000000020601257552170400236030ustar00rootroot00000000000000 jradius { name = "example" # Name of the JRadius Application # (known as "Sender" in JRadius) primary = "127.0.0.1" # Primary JRadius Server # (using default port of 1814) secondary = "192.168.1.2:1815" # Secondary JRadius Server (port 1815) tertiary = "192.168.1.2:1816" # Tertiary JRadius Server timeout = 1 # JRadius Server Connect Timeout (default 5) onfail = NOOP # What to do if no JRadius # Server is found. Options are: # FAIL (default), OK, REJECT, NOOP keepalive = yes # Keep connections to JRadius pooled connections = 8 # Number of pooled JRadius connections allow_codechange = yes # Allow the changing the RADIUS code/type allow_idchange = yes # Allow the change of the RADIUS pkt id } freeradius-server/src/modules/rlm_jradius/rlm_jradius.c000066400000000000000000000672461257552170400237730ustar00rootroot00000000000000/** * rlm_jradius - The FreeRADIUS JRadius Server Module * Copyright (C) 2004-2006 PicoPoint, B.V. * Copyright (c) 2007-2008 David Bird * * 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 * * This module is used to connect FreeRADIUS to the JRadius server. * JRadius is a Java RADIUS client and server framework, see doc/rlm_jradius * and http://jradius.net/ for more information. * * Author(s): David Bird * * Connection pooling code based on rlm_sql, see rlm_sql/sql.c for copyright and license. */ #include #include #include #include #include #include #include #include RCSID("$Id$") #include #include #include #include #include #ifdef HAVE_PTHREAD_H #include #endif #ifdef HAVE_SYS_SOCKET_H #include #endif #ifndef O_NONBLOCK #define O_NONBLOCK O_NDELAY #endif static const int JRADIUS_PORT = 1814; static const int HALF_MESSAGE_LEN = 16384; static const int MESSAGE_LEN = 32768; static const int JRADIUS_authenticate = 1; static const int JRADIUS_authorize = 2; static const int JRADIUS_preacct = 3; static const int JRADIUS_accounting = 4; static const int JRADIUS_checksimul = 5; static const int JRADIUS_pre_proxy = 6; static const int JRADIUS_post_proxy = 7; static const int JRADIUS_post_auth = 8; #ifdef WITH_COA static const int JRADIUS_recv_coa = 9; static const int JRADIUS_send_coa = 10; #endif #define LOG_PREFIX "rlm_jradius: " #define MAX_HOSTS 4 typedef struct jradius_socket { int id; #ifdef HAVE_PTHREAD_H pthread_mutex_t mutex; #endif struct jradius_socket *next; enum { is_connected, not_connected } state; union { int sock; } con; } JRSOCK; typedef struct jradius_inst { time_t connect_after; JRSOCK * sock_pool; JRSOCK * last_used; char * name; char * host [MAX_HOSTS]; uint32_t ipaddr [MAX_HOSTS]; int port [MAX_HOSTS]; int timeout; int read_timeout; int write_timeout; int allow_codechange; int allow_idchange; int onfail; char * onfail_s; int keepalive; int jrsock_cnt; } JRADIUS; typedef struct _byte_array { unsigned int size; unsigned int pos; unsigned int left; unsigned char * b; } byte_array; static CONF_PARSER module_config[] = { { "name", PW_TYPE_STRING_PTR, offsetof(JRADIUS, name), NULL, "localhost"}, { "primary", PW_TYPE_STRING_PTR, offsetof(JRADIUS, host[0]), NULL, "localhost"}, { "secondary", PW_TYPE_STRING_PTR, offsetof(JRADIUS, host[1]), NULL, NULL}, { "tertiary", PW_TYPE_STRING_PTR, offsetof(JRADIUS, host[2]), NULL, NULL}, { "timeout", PW_TYPE_INTEGER, offsetof(JRADIUS, timeout), NULL, "5"}, { "read_timeout", PW_TYPE_INTEGER, offsetof(JRADIUS, read_timeout), NULL, "90"}, { "write_timeout",PW_TYPE_INTEGER, offsetof(JRADIUS, write_timeout),NULL, "90"}, { "onfail", PW_TYPE_STRING_PTR, offsetof(JRADIUS, onfail_s), NULL, NULL}, { "keepalive", PW_TYPE_BOOLEAN, offsetof(JRADIUS, keepalive), NULL, "yes"}, { "connections", PW_TYPE_INTEGER, offsetof(JRADIUS, jrsock_cnt), NULL, "8"}, { "allow_codechange", PW_TYPE_BOOLEAN, offsetof(JRADIUS, allow_codechange), NULL, "no"}, { "allow_idchange", PW_TYPE_BOOLEAN, offsetof(JRADIUS, allow_idchange), NULL, "no"}, { NULL, -1, 0, NULL, NULL } }; static int sock_read(JRADIUS * inst, JRSOCK *jrsock, uint8_t *b, size_t blen) { int fd = jrsock->con.sock; int timeout = inst->read_timeout; struct timeval tv; ssize_t c; size_t recd = 0; fd_set fds; while (recd < blen) { tv.tv_sec = timeout; tv.tv_usec = 0; FD_ZERO(&fds); FD_SET(fd, &fds); if (select(fd + 1, &fds, (fd_set *) 0, (fd_set *) 0, &tv) == -1) return -1; if (FD_ISSET(fd, &fds)) #ifdef WIN32 c = recv(fd, b + recd, blen-recd, 0); #else c = read(fd, b + recd, blen-recd); #endif else return -1; if (c <= 0) return -1; recd += c; } if (recd < blen) return -1; return recd; } static int sock_write(JRADIUS * inst, JRSOCK *jrsock, char *b, size_t blen) { int fd = jrsock->con.sock; int timeout = inst->write_timeout; struct timeval tv; ssize_t c; size_t sent = 0; fd_set fds; while (sent < blen) { tv.tv_sec = timeout; tv.tv_usec = 0; FD_ZERO(&fds); FD_SET(fd, &fds); if (select(fd + 1, (fd_set *) 0, &fds, (fd_set *) 0, &tv) == -1) return -1; if (FD_ISSET(fd, &fds)) #ifdef WIN32 c = send(fd, b+sent, blen-sent, 0); #else c = write(fd, b+sent, blen-sent); #endif else return -1; if (c <= 0) return -1; sent += c; } if (sent != blen) return -1; return sent; } static int connect_socket(JRSOCK *jrsock, JRADIUS *inst) { struct sockaddr_in local_addr, serv_addr; int i, connected = 0; char buff[128]; int sock; /* * Connect to jradius servers until we succeed or die trying */ for (i = 0; !connected && i < MAX_HOSTS && inst->ipaddr[i] > 0; i++) { /* * Allocate a TCP socket */ if ((sock = socket(AF_INET, SOCK_STREAM, 0)) == -1) { radlog(L_ERR, LOG_PREFIX "could not allocate TCP socket"); goto failed; } /* * If we have a timeout value set, make the socket non-blocking */ if (inst->timeout > 0 && fcntl(sock, F_SETFL, fcntl(sock, F_GETFL, 0) | O_NONBLOCK) == -1) { radlog(L_ERR, LOG_PREFIX "could not set non-blocking on socket"); goto failed; } /* * Bind to any local port */ memset(&local_addr, 0, sizeof(local_addr)); local_addr.sin_family = AF_INET; local_addr.sin_addr.s_addr = htonl(INADDR_ANY); local_addr.sin_port = htons(0); if (bind(sock, (struct sockaddr *) &local_addr, sizeof(local_addr)) < 0) { radlog(L_ERR, LOG_PREFIX "could not locally bind TCP socket"); goto failed; } /* * Attempt connection to remote server */ memset(&serv_addr, 0, sizeof(serv_addr)); serv_addr.sin_family = AF_INET; memcpy((char *) &serv_addr.sin_addr, &(inst->ipaddr[i]), 4); serv_addr.sin_port = htons(inst->port[i]); if (connect(sock, (struct sockaddr *)&serv_addr, sizeof(serv_addr)) < 0) { if (inst->timeout > 0 && (errno == EINPROGRESS || errno == EWOULDBLOCK)) { /* * Wait to see if non-blocking socket connects or times-out */ struct pollfd pfd; memset(&pfd, 0, sizeof(pfd)); pfd.fd = sock; pfd.events = POLLOUT; if (poll(&pfd, 1, inst->timeout * 1000) == 1 && pfd.revents) { /* * Lets make absolutely sure we are connected */ struct sockaddr_in sa; unsigned int salen = sizeof(sa); if (getpeername(sock, (struct sockaddr *) &sa, &salen) != -1) { /* * CONNECTED! break out of for-loop */ connected = 1; break; } } } /* * Timed-out */ radlog(L_ERR, LOG_PREFIX "could not connect to %s:%d", ip_ntoa(buff, inst->ipaddr[i]), inst->port[i]); } else { /* * CONNECTED (instantly)! break out of for-loop */ connected = 1; break; } /* * Unable to connect, cleanup and start over */ close(sock); sock=0; } if (!connected) { radlog(L_ERR, LOG_PREFIX "could not find any jradius server!"); goto failed; } /* * If we previously set the socket to non-blocking, restore blocking if (inst->timeout > 0 && fcntl(sock, F_SETFL, fcntl(sock, F_GETFL, 0) & ~O_NONBLOCK) == -1) { radlog(L_ERR, LOG_PREFIX "could not set blocking on socket"); goto failed; } */ jrsock->state = is_connected; jrsock->con.sock = sock; return 1; failed: if (sock > 0) { shutdown(sock, 2); close(sock); } jrsock->state = not_connected; return 0; } static void close_socket(UNUSED JRADIUS * inst, JRSOCK *jrsock) { radlog(L_INFO, "rlm_jradius: Closing JRadius connection %d", jrsock->id); if (jrsock->con.sock > 0) { shutdown(jrsock->con.sock, 2); close(jrsock->con.sock); } jrsock->state = not_connected; jrsock->con.sock = 0; } static void free_socket(JRADIUS * inst, JRSOCK *jrsock) { close_socket(inst, jrsock); if (inst->keepalive) { #ifdef HAVE_PTHREAD_H pthread_mutex_destroy(&jrsock->mutex); #endif free(jrsock); } } static int init_socketpool(JRADIUS * inst) { int i, rcode; int success = 0; JRSOCK *jrsock; inst->connect_after = 0; inst->sock_pool = NULL; for (i = 0; i < inst->jrsock_cnt; i++) { radlog(L_INFO, "rlm_jradius: starting JRadius connection %d", i); if ((jrsock = rad_malloc(sizeof(*jrsock))) == 0) return -1; memset(jrsock, 0, sizeof(*jrsock)); jrsock->id = i; jrsock->state = not_connected; #ifdef HAVE_PTHREAD_H rcode = pthread_mutex_init(&jrsock->mutex,NULL); if (rcode != 0) { radlog(L_ERR, "rlm_jradius: Failed to init lock: %s", strerror(errno)); return 0; } #endif if (time(NULL) > inst->connect_after) if (connect_socket(jrsock, inst)) success = 1; jrsock->next = inst->sock_pool; inst->sock_pool = jrsock; } inst->last_used = NULL; if (!success) { radlog(L_DBG, "rlm_jradius: Failed to connect to JRadius server."); } return 1; } static void free_socketpool(JRADIUS * inst) { JRSOCK *cur; JRSOCK *next; for (cur = inst->sock_pool; cur; cur = next) { next = cur->next; free_socket(inst, cur); } inst->sock_pool = NULL; } static JRSOCK * get_socket(JRADIUS * inst) { JRSOCK *cur, *start; int tried_to_connect = 0; int unconnected = 0; start = inst->last_used; if (!start) start = inst->sock_pool; cur = start; while (cur) { #ifdef HAVE_PTHREAD_H if (pthread_mutex_trylock(&cur->mutex) != 0) { goto next; } #endif if ((cur->state == not_connected) && (time(NULL) > inst->connect_after)) { radlog(L_INFO, "rlm_jradius: Trying to (re)connect unconnected handle %d", cur->id); tried_to_connect++; connect_socket(cur, inst); } if (cur->state == not_connected) { radlog(L_DBG, "rlm_jradius: Ignoring unconnected handle %d", cur->id); unconnected++; #ifdef HAVE_PTHREAD_H pthread_mutex_unlock(&cur->mutex); #endif goto next; } radlog(L_DBG, "rlm_jradius: Reserving JRadius socket id: %d", cur->id); if (unconnected != 0 || tried_to_connect != 0) { radlog(L_INFO, "rlm_jradius: got socket %d after skipping %d unconnected handles, tried to reconnect %d though", cur->id, unconnected, tried_to_connect); } inst->last_used = cur->next; return cur; next: cur = cur->next; if (!cur) cur = inst->sock_pool; if (cur == start) break; } radlog(L_INFO, "rlm_jradius: There are no sockets to use! skipped %d, tried to connect %d", unconnected, tried_to_connect); return NULL; } static int release_socket(UNUSED JRADIUS * inst, JRSOCK * jrsock) { #ifdef HAVE_PTHREAD_H pthread_mutex_unlock(&jrsock->mutex); #endif radlog(L_DBG, "rlm_jradius: Released JRadius socket id: %d", jrsock->id); return 0; } /* * Initialize the jradius module */ static int jradius_instantiate(CONF_SECTION *conf, void **instance) { JRADIUS *inst = (JRADIUS *) instance; char host[128], b[128], *h; int i, p, idx, port; inst = rad_malloc(sizeof(JRADIUS)); memset(inst, 0, sizeof(JRADIUS)); if (cf_section_parse(conf, inst, module_config) < 0) { free(inst); return -1; } for (i = 0, idx = 0; i < MAX_HOSTS; i++) { if (inst->host[i] && strlen(inst->host[i]) < sizeof(host)) { h = inst->host[i]; p = JRADIUS_PORT; strcpy(b, h); if (sscanf(b, "%[^:]:%d", host, &port) == 2) { h = host; p = port; } if (h) { fr_ipaddr_t ipaddr; if (ip_hton(h, AF_INET, &ipaddr) < 0) { radlog(L_ERR, "Can't find IP address for host %s", h); continue; } if ((inst->ipaddr[idx] = ipaddr.ipaddr.ip4addr.s_addr) != htonl(INADDR_NONE)) { inst->port[idx] = p; radlog(L_INFO, LOG_PREFIX "configuring jradius server %s:%d", h, p); idx++; } else { radlog(L_ERR, LOG_PREFIX "invalid jradius server %s", h); } } } } if (inst->keepalive) init_socketpool(inst); inst->onfail = RLM_MODULE_FAIL; if (inst->onfail_s) { if (!strcmp(inst->onfail_s, "NOOP")) inst->onfail = RLM_MODULE_NOOP; else if (!strcmp(inst->onfail_s, "REJECT")) inst->onfail = RLM_MODULE_REJECT; else if (!strcmp(inst->onfail_s, "OK")) inst->onfail = RLM_MODULE_OK; else if (!strcmp(inst->onfail_s, "FAIL")) inst->onfail = RLM_MODULE_FAIL; else radlog(L_ERR, LOG_PREFIX "invalid jradius 'onfail' state %s", inst->onfail_s); } *instance = inst; return 0; } /* * Initialize a byte array buffer structure */ static void init_byte_array(byte_array * ba, unsigned char *b, int blen) { ba->b = b; ba->size = ba->left = blen; ba->pos = 0; } /* * Pack a single byte into a byte array buffer */ static int pack_byte(byte_array * ba, unsigned char c) { if (ba->left < 1) return -1; ba->b[ba->pos] = c; ba->pos++; ba->left--; return 0; } /* * Pack an array of bytes into a byte array buffer */ static int pack_bytes(byte_array * ba, unsigned char *d, unsigned int dlen) { if (ba->left < dlen) return -1; memcpy((void *)(ba->b + ba->pos), d, dlen); ba->pos += dlen; ba->left -= dlen; return 0; } /* * Pack an integer into a byte array buffer (adjusting for byte-order) */ static int pack_uint32(byte_array * ba, uint32_t i) { if (ba->left < 4) return -1; i = htonl(i); memcpy((void *)(ba->b + ba->pos), (void *)&i, 4); ba->pos += 4; ba->left -= 4; return 0; } /* * Pack a short into a byte array buffer (adjusting for byte-order) */ static int pack_uint16(byte_array * ba, uint16_t i) { if (ba->left < 2) return -1; i = htons(i); memcpy((void *)(ba->b + ba->pos), (void *)&i, 2); ba->pos += 2; ba->left -= 2; return 0; } /* * Pack a byte into a byte array buffer */ static int pack_uint8(byte_array * ba, uint8_t i) { if (ba->left < 1) return -1; memcpy((void *)(ba->b + ba->pos), (void *)&i, 1); ba->pos += 1; ba->left -= 1; return 0; } /* * Pack one byte array buffer into another byte array buffer */ static int pack_array(byte_array * ba, byte_array * a) { if (ba->left < a->pos) return -1; memcpy((void *)(ba->b + ba->pos), (void *)a->b, a->pos); ba->pos += a->pos; ba->left -= a->pos; return 0; } /* * Pack radius attributes into a byte array buffer */ static int pack_vps(byte_array * ba, VALUE_PAIR * vps) { uint32_t i; VALUE_PAIR * vp; for (vp = vps; vp != NULL; vp = vp->next) { radlog(L_DBG, LOG_PREFIX "packing attribute %s (type: %d; len: %d)", vp->name, vp->attribute, vp->length); i = vp->attribute; /* element is int, not uint32_t */ if (pack_uint32(ba, i) == -1) return -1; i = vp->length; if (pack_uint32(ba, i) == -1) return -1; i = vp->operator; if (pack_uint32(ba, i) == -1) return -1; switch (vp->type) { case PW_TYPE_BYTE: if (pack_uint8(ba, vp->lvalue) == -1) return -1; break; case PW_TYPE_SHORT: if (pack_uint16(ba, vp->lvalue) == -1) return -1; break; case PW_TYPE_INTEGER: case PW_TYPE_DATE: if (pack_uint32(ba, vp->lvalue) == -1) return -1; break; case PW_TYPE_IPADDR: if (pack_bytes(ba, (void *)&vp->vp_ipaddr, vp->length) == -1) return -1; break; default: if (pack_bytes(ba, (void *)vp->vp_octets, vp->length) == -1) return -1; break; } } return 0; } /* * Pack a radius packet into a byte array buffer */ static int pack_packet(byte_array * ba, RADIUS_PACKET * p) { /*unsigned char code = p->code;*/ unsigned char buff[HALF_MESSAGE_LEN]; byte_array pba; init_byte_array(&pba, buff, sizeof(buff)); if (pack_vps(&pba, p->vps) == -1) return -1; radlog(L_DBG, LOG_PREFIX "packing packet with code: %d (attr length: %d)", p->code, pba.pos); #ifdef EXTENDED_FMT if (pack_uint32(ba, p->code) == -1) return -1; if (pack_uint32(ba, p->id) == -1) return -1; #else if (pack_byte(ba, p->code) == -1) return -1; if (pack_byte(ba, p->id) == -1) return -1; #endif if (pack_uint32(ba, pba.pos) == -1) return -1; if (pba.pos == 0) return 0; if (pack_array(ba, &pba) == -1) return -1; return 0; } static int pack_request(byte_array * ba, REQUEST *r) { unsigned char buff[HALF_MESSAGE_LEN]; byte_array pba; init_byte_array(&pba, buff, sizeof(buff)); if (pack_vps(&pba, r->config_items) == -1) return -1; if (pack_uint32(ba, pba.pos) == -1) return -1; if (pba.pos == 0) return 0; if (pack_array(ba, &pba) == -1) return -1; return 0; } static uint32_t unpack_uint32(unsigned char *c) { uint32_t ii; memcpy((void *)&ii, c, 4); return ntohl(ii); } static uint16_t unpack_uint16(unsigned char *c) { uint16_t ii; memcpy((void *)&ii, c, 2); return ntohs(ii); } static uint8_t unpack_uint8(unsigned char *c) { uint8_t ii; memcpy((void *)&ii, c, 1); return ii; } /* * Read a single byte from socket */ static int read_byte(JRADIUS *inst, JRSOCK *jrsock, uint8_t *b) { return (sock_read(inst, jrsock, b, 1) == 1) ? 0 : -1; } /* * Read an integer from the socket (adjusting for byte-order) */ static int read_uint32(JRADIUS *inst, JRSOCK *jrsock, uint32_t *i) { uint32_t ii; if (sock_read(inst, jrsock, (uint8_t *)&ii, 4) != 4) return -1; *i = ntohl(ii); return 0; } /* * Read a value-pair list from the socket */ static int read_vps(JRADIUS *inst, JRSOCK *jrsock, VALUE_PAIR **pl, int plen) { VALUE_PAIR *vp; unsigned char buff[MESSAGE_LEN]; uint32_t alen, atype, aop; int rlen = 0; while (rlen < plen) { if (read_uint32(inst, jrsock, &atype) == -1) return -1; rlen += 4; if (read_uint32(inst, jrsock, &alen) == -1) return -1; rlen += 4; if (read_uint32(inst, jrsock, &aop) == -1) return -1; rlen += 4; radlog(L_DBG, LOG_PREFIX "reading attribute: type=%d; len=%d", atype, alen); if (alen >= sizeof(buff)) { radlog(L_ERR, LOG_PREFIX "packet value too large (len: %d)", alen); return -1; } if (sock_read(inst, jrsock, buff, alen) != (int)alen) return -1; rlen += alen; buff[alen]=0; /* * Create new attribute */ vp = paircreate(atype, -1); vp->operator = aop; if (vp->type == -1) { /* * FreeRADIUS should know about the same attributes that JRadius knows */ radlog(L_ERR, LOG_PREFIX "received attribute we do not recognize (type: %d)", atype); pairbasicfree(vp); continue; } /* * WiMAX combo-ip address * paircreate() cannot recognize the real type of the address. * ..ugly code... */ if (vp->type==PW_TYPE_COMBO_IP) { switch (alen) { case 4: vp->type = PW_TYPE_IPADDR; break; case 16: vp->type = PW_TYPE_IPV6ADDR; break; } } /* * Fill in the attribute value based on type */ switch (vp->type) { case PW_TYPE_BYTE: vp->lvalue = unpack_uint8(buff); vp->length = 1; break; case PW_TYPE_SHORT: vp->lvalue = unpack_uint16(buff); vp->length = 2; break; case PW_TYPE_INTEGER: case PW_TYPE_DATE: vp->lvalue = unpack_uint32(buff); vp->length = 4; break; case PW_TYPE_IPADDR: memcpy((void *)&vp->vp_ipaddr, buff, 4); vp->length = 4; break; default: if (alen >= sizeof(vp->vp_octets)) alen = sizeof(vp->vp_octets) - 1; memcpy((void *)vp->vp_octets, buff, alen); vp->length = alen; break; } /* * Add the attribute to the packet */ pairadd(pl, vp); } return rlen; } /* * Read a radius packet from the socket */ static int read_packet(JRADIUS * inst, JRSOCK *jrsock, RADIUS_PACKET *p) { uint32_t code; uint32_t id; uint32_t plen; #ifdef EXTENDED_FMT if (read_uint32(inst, jrsock, &code) == -1) return -1; if (read_uint32(inst, jrsock, &id) == -1) return -1; #else { uint8_t c = 0; if (read_byte(inst, jrsock, &c) == -1) return -1; code = c; if (read_byte(inst, jrsock, &c) == -1) return -1; id = c; } #endif if (read_uint32(inst, jrsock, &plen) == -1) return -1; radlog(L_DBG, LOG_PREFIX "reading packet: code=%d len=%d", (int)code, plen); if (inst->allow_codechange) if (code != p->code) { radlog(L_INFO, LOG_PREFIX "changing packet code from %d to %d", p->code, code); p->code = code; } if (inst->allow_idchange) if ((int)id != p->id) { radlog(L_INFO, LOG_PREFIX "changing packet id from %d to %d", p->id, id); p->id = (int)id; } /* * Delete previous attribute list */ pairfree(&p->vps); if (plen == 0) return 0; if (read_vps(inst, jrsock, &p->vps, plen) == -1) return -1; return 0; } static int read_request(JRADIUS *inst, JRSOCK *jrsock, REQUEST *p) { unsigned int plen; if (read_uint32(inst, jrsock, &plen) == -1) return -1; radlog(L_DBG, LOG_PREFIX "reading request: config_item: len=%d", plen); /* * Delete previous attribute list */ pairfree(&p->config_items); if (plen == 0) return 0; if (read_vps(inst, jrsock, &p->config_items, plen) == -1) return -1; return 0; } static int rlm_jradius_call(char func, void *instance, REQUEST *req, int isproxy) { JRADIUS * inst = instance; RADIUS_PACKET * request = isproxy ? req->proxy : req->packet; RADIUS_PACKET * reply = isproxy ? req->proxy_reply : req->reply; JRSOCK * jrsock = 0; JRSOCK sjrsock; int exitstatus = inst->onfail; unsigned char rcode, pcount; unsigned char buff[MESSAGE_LEN]; byte_array ba; char * n = inst->name; unsigned int nlen = strlen(n); const char * err = 0; int rc, attempt2=0; #define W_ERR(s) { err=s; goto packerror; } #define R_ERR(s) { err=s; goto parseerror; } if (inst->keepalive) { jrsock = get_socket(inst); if (!jrsock) return exitstatus; } else { jrsock = &sjrsock; memset(jrsock, 0, sizeof(*jrsock)); jrsock->state = not_connected; } init_byte_array(&ba, buff, sizeof(buff)); pcount = 0; if (request) pcount++; if (reply) pcount++; /* * Create byte array to send to jradius */ if ((rc = pack_uint32 (&ba, nlen)) == -1) W_ERR("pack_uint32(nlen)"); if ((rc = pack_bytes (&ba, (void *)n, nlen)) == -1) W_ERR("pack_bytes(name)"); if ((rc = pack_byte (&ba, func)) == -1) W_ERR("pack_byte(fun)"); if ((rc = pack_byte (&ba, pcount)) == -1) W_ERR("pack_byte(pcnt)"); if (pcount > 0 && (rc = pack_packet (&ba, request)) == -1) W_ERR("pack_packet(req)"); if (pcount > 1 && (rc = pack_packet (&ba, reply)) == -1) W_ERR("pack_packet(rep)"); if ((rc = pack_request(&ba, req)) == -1) W_ERR("pack_request()"); /* * Send data */ start_over: if (jrsock->state == not_connected) { if (attempt2) radlog(L_ERR, LOG_PREFIX "reconnecting socket id %d", jrsock->id); if (!connect_socket(jrsock, inst)) { if (attempt2) radlog(L_ERR, LOG_PREFIX "could not reconnect socket %d, giving up", jrsock->id); goto cleanup; } } radlog(L_DBG, LOG_PREFIX "sending %d bytes to socket %d", ba.pos, jrsock->id); if (sock_write(inst, jrsock, ba.b, ba.pos) != (int)ba.pos || (rc = read_byte(inst, jrsock, &rcode)) == -1) { /* * With an error on the write or the first read, try closing the socket * and reconnecting to see if that improves matters any (tries this only once) */ radlog(L_ERR, LOG_PREFIX "error sending request with socket %d", jrsock->id); if (!inst->keepalive || attempt2) W_ERR("socket_send/first_read"); close_socket(inst, jrsock); attempt2 = 1; goto start_over; } /* * Read result */ if ((rc = read_byte(inst, jrsock, &pcount)) == -1) R_ERR("read_byte(pcnt)"); radlog(L_DBG, LOG_PREFIX "return code %d; receiving %d packets", (int)rcode, (int)pcount); if (pcount > 0 && request) if ((rc = read_packet (inst, jrsock, request)) == -1) R_ERR("read_packet(req)"); if (pcount > 1 && reply) if ((rc = read_packet (inst, jrsock, reply)) == -1) R_ERR("read_packet(rep)"); if ((rc = read_request(inst, jrsock, req)) == -1) R_ERR("read_request()"); /* * Since we deleted all the attribute lists in the request, * we need to reconfigure a few pointers in the REQUEST object */ if (req->username) { req->username = pairfind(request->vps, PW_USER_NAME); } if (req->password) { req->password = pairfind(request->vps, PW_PASSWORD); if (!req->password) req->password = pairfind(request->vps, PW_CHAP_PASSWORD); } /* * All done, set return code and cleanup */ exitstatus = (int)rcode; goto cleanup; parseerror: radlog(L_ERR, LOG_PREFIX "problem parsing the data [%s]",err); if (inst->keepalive) close_socket(inst, jrsock); goto cleanup; packerror: radlog(L_ERR, LOG_PREFIX "problem packing the data[%s]",err); if (inst->keepalive) close_socket(inst, jrsock); cleanup: if (inst->keepalive) release_socket(inst, jrsock); else close_socket(inst, jrsock); return exitstatus; } static int jradius_authenticate(void *instance, REQUEST *request) { return rlm_jradius_call(JRADIUS_authenticate, instance, request, 0); } static int jradius_authorize(void *instance, REQUEST *request) { return rlm_jradius_call(JRADIUS_authorize, instance, request, 0); } static int jradius_preacct(void *instance, REQUEST *request) { return rlm_jradius_call(JRADIUS_preacct, instance, request, 0); } static int jradius_accounting(void *instance, REQUEST *request) { return rlm_jradius_call(JRADIUS_accounting, instance, request, 0); } static int jradius_checksimul(void *instance, REQUEST *request) { return rlm_jradius_call(JRADIUS_checksimul, instance, request, 0); } static int jradius_pre_proxy(void *instance, REQUEST *request) { return rlm_jradius_call(JRADIUS_pre_proxy, instance, request, 1); } static int jradius_post_proxy(void *instance, REQUEST *request) { return rlm_jradius_call(JRADIUS_post_proxy, instance, request, 1); } static int jradius_post_auth(void *instance, REQUEST *request) { return rlm_jradius_call(JRADIUS_post_auth, instance, request, 0); } #ifdef WITH_COA static int jradius_recv_coa(void *instance, REQUEST *request) { return rlm_jradius_call(JRADIUS_recv_coa, instance, request, 0); } static int jradius_send_coa(void *instance, REQUEST *request) { return rlm_jradius_call(JRADIUS_send_coa, instance, request, 0); } #endif static int jradius_detach(void *instance) { JRADIUS *inst = (JRADIUS *) instance; free_socketpool(inst); free(inst); return 0; } module_t rlm_jradius = { RLM_MODULE_INIT, "jradius", RLM_TYPE_THREAD_SAFE, jradius_instantiate, jradius_detach, { jradius_authenticate, jradius_authorize, jradius_preacct, jradius_accounting, jradius_checksimul, jradius_pre_proxy, jradius_post_proxy, jradius_post_auth #ifdef WITH_COA , jradius_recv_coa, jradius_send_coa #endif }, }; freeradius-server/src/modules/rlm_krb5/000077500000000000000000000000001257552170400204775ustar00rootroot00000000000000freeradius-server/src/modules/rlm_krb5/.gitignore000066400000000000000000000000111257552170400224570ustar00rootroot00000000000000Makefile freeradius-server/src/modules/rlm_krb5/Makefile.in000066400000000000000000000003241257552170400225430ustar00rootroot00000000000000# # $Id$ # TARGET = @targetname@ SRCS = rlm_krb5.c HEADERS = RLM_LIBS = @krb5_ldflags@ RLM_CFLAGS = @krb5_cflags@ -I/usr/include/et -DKRB5_DEPRECATED include ../rules.mak $(LT_OBJS): $(HEADERS) freeradius-server/src/modules/rlm_krb5/configure000077500000000000000000004074261257552170400224230ustar00rootroot00000000000000#! /bin/sh # From configure.in Revision. # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.61. # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, # 2002, 2003, 2004, 2005, 2006 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=: # 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 # PATH needs CR # 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 # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false 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.) as_nl=' ' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. 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 # Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # CDPATH. $as_unset CDPATH if test "x$CONFIG_SHELL" = x; then if (eval ":") 2>/dev/null; then as_have_required=yes else as_have_required=no fi if test $as_have_required = yes && (eval ": (as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=\$LINENO as_lineno_2=\$LINENO test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } ") 2> /dev/null; then : else as_candidate_shells= as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. case $as_dir in /*) for as_base in sh bash ksh sh5; do as_candidate_shells="$as_candidate_shells $as_dir/$as_base" done;; esac done IFS=$as_save_IFS for as_shell in $as_candidate_shells $SHELL; do # Try only shells that exist, to save several forks. if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { ("$as_shell") 2> /dev/null <<\_ASEOF 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 : _ASEOF }; then CONFIG_SHELL=$as_shell as_have_required=yes if { "$as_shell" 2> /dev/null <<\_ASEOF 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 : (as_func_return () { (exit $1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = "$1" ); then : else exitcode=1 echo positional parameters were not saved. fi test $exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } _ASEOF }; then break fi fi done if test "x$CONFIG_SHELL" != x; then for as_var in BASH_ENV ENV do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done export CONFIG_SHELL exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} fi if test $as_have_required = no; then echo This script requires a shell more modern than all the echo shells that I found on your system. Please install a echo modern shell, or manually run the script under such a echo shell if you do have one. { (exit 1); exit 1; } fi fi fi (eval "as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0") || { echo No shell found that supports shell functions. echo Please tell autoconf@gnu.org about your system, echo including any error possibly output before this echo message } as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, and appends # trailing '-' during substitution so that $LINENO is not a special # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # scripts with optimization help from Paolo Bonzini. 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" || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi 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 fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi 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=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, 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= SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME= PACKAGE_TARNAME= PACKAGE_VERSION= PACKAGE_STRING= PACKAGE_BUGREPORT= ac_unique_file="rlm_krb5.c" ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datarootdir datadir sysconfdir sharedstatedir localstatedir includedir oldincludedir docdir infodir htmldir dvidir pdfdir psdir libdir localedir mandir DEFS ECHO_C ECHO_N ECHO_T LIBS build_alias host_alias target_alias CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP krb5_cflags krb5_ldflags targetname LIBOBJS LTLIBOBJS' ac_subst_files='' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CPP' # Initialize some variables set by options. ac_init_help= ac_init_version=false # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *) ac_optarg=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_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` eval enable_$ac_feature=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_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` eval enable_$ac_feature=\$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_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/[-.]/_/g'` eval with_$ac_package=\$ac_optarg ;; -without-* | --without-*) ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/[-.]/_/g'` eval with_$ac_package=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 ;; -*) { echo "$as_me: error: unrecognized option: $ac_option Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && 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'` { echo "$as_me: error: missing argument to $ac_option" >&2 { (exit 1); exit 1; }; } fi # Be sure to have absolute directory names. 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 case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; } 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 echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || { echo "$as_me: error: Working directory cannot be determined" >&2 { (exit 1); exit 1; }; } test "X$ac_ls_di" = "X$ac_pwd_ls_di" || { echo "$as_me: error: pwd does not report name of working directory" >&2 { (exit 1); exit 1; }; } # 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 -- "$0" || $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$0" : 'X\(//\)[^/]' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X"$0" | 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 .." { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2 { (exit 1); exit 1; }; } pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures this package to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF _ACEOF fi if test -n "$ac_init_help"; then cat <<\_ACEOF Optional Features: --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-heimdal-krb5 Enable if you have heimdal krb5 Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-rlm-krb5-lib-dir=DIR Directory for krb5 library files --with-rlm-krb5-include-dir=DIR Directory for krb5 include files 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 C/C++/Objective C preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. _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" || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`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 echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF configure generated by GNU Autoconf 2.61 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 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 cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by $as_me, which was generated by GNU Autoconf 2.61. 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=. 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=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; 2) ac_configure_args1="$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 ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac done done $as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } $as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export 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 cat <<\_ASBOX ## ---------------- ## ## Cache variables. ## ## ---------------- ## _ASBOX 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_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( *) $as_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 cat <<\_ASBOX ## ----------------- ## ## Output variables. ## ## ----------------- ## _ASBOX echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then cat <<\_ASBOX ## ------------------- ## ## File substitutions. ## ## ------------------- ## _ASBOX echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then cat <<\_ASBOX ## ----------- ## ## confdefs.h. ## ## ----------- ## _ASBOX echo cat confdefs.h echo fi test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" 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'; { (exit 1); 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 # 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 # Let the site file select an alternate cache file if it wants to. # Prefer explicitly selected file to automatically selected ones. if test -n "$CONFIG_SITE"; then set x "$CONFIG_SITE" elif test "x$prefix" != xNONE; then set x "$prefix/share/config.site" "$prefix/etc/config.site" else set x "$ac_default_prefix/share/config.site" \ "$ac_default_prefix/etc/config.site" fi shift for ac_site_file do if test -r "$ac_site_file"; then { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" 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. if test -f "$cache_file"; then { echo "$as_me:$LINENO: loading cache $cache_file" >&5 echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { echo "$as_me:$LINENO: creating cache $cache_file" >&5 echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 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 { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 echo "$as_me: former value: $ac_old_val" >&2;} { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 echo "$as_me: current value: $ac_new_val" >&2;} ac_cache_corrupted=: fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`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. *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 echo "$as_me: error: changes in the environment can compromise the build" >&2;} { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} { (exit 1); exit 1; }; } 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 x$with_rlm_krb5 != xno; then 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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}gcc" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="gcc" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}cc" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="$ac_prog" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&5 echo "$as_me: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } # Provide some information about the compiler. echo "$as_me:$LINENO: checking for C compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (ac_try="$ac_compiler --version >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -v >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -V >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out 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. { echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6; } ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # # List of possible output files, starting from the most likely. # The algorithm is not robust to junk in `.', hence go to wildcards (a.*) # only as a last resort. b.out is created by i960 compilers. ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out' # # The IRIX 6 linker writes into existing files which may not be # executable, retaining their permissions. Remove them first so a # subsequent execution test works. ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link_default") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; 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 | *.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 { echo "$as_me:$LINENO: result: $ac_file" >&5 echo "${ECHO_T}$ac_file" >&6; } if test -z "$ac_file"; then echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: C compiler cannot create executables See \`config.log' for more details." >&5 echo "$as_me: error: C compiler cannot create executables See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } fi ac_exeext=$ac_cv_exeext # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { echo "$as_me:$LINENO: checking whether the C compiler works" >&5 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6; } # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then if { ac_try='./$ac_file' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { echo "$as_me:$LINENO: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&5 echo "$as_me: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi fi fi { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } rm -f a.out a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; } { echo "$as_me:$LINENO: result: $cross_compiling" >&5 echo "${ECHO_T}$cross_compiling" >&6; } { echo "$as_me:$LINENO: checking for suffix of executables" >&5 echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; } if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; 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 | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest$ac_cv_exeext { echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 echo "${ECHO_T}$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT { echo "$as_me:$LINENO: checking for suffix of object files" >&5 echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; } if test "${ac_cv_objext+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; 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 ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 echo "${ECHO_T}$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; } if test "${ac_cv_c_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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 { echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; } GCC=`test $ac_compiler_gnu = yes && echo yes` ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CFLAGS="" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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 { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 echo "${ECHO_T}$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 { echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_c89+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_c89=$ac_arg else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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) { echo "$as_me:$LINENO: result: none needed" >&5 echo "${ECHO_T}none needed" >&6; } ;; xno) { echo "$as_me:$LINENO: result: unsupported" >&5 echo "${ECHO_T}unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;; 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 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 { echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if test "${ac_cv_prog_CPP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f 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 { echo "$as_me:$LINENO: result: $CPP" >&5 echo "${ECHO_T}$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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&5 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } 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 rlm_krb5_lib_dir= # Check whether --with-rlm-krb5-lib-dir was given. if test "${with_rlm_krb5_lib_dir+set}" = set; then withval=$with_rlm_krb5_lib_dir; case "$withval" in no) { { echo "$as_me:$LINENO: error: Need rlm-krb5-lib-dir" >&5 echo "$as_me: error: Need rlm-krb5-lib-dir" >&2;} { (exit 1); exit 1; }; } ;; yes) ;; *) rlm_krb5_lib_dir="$withval" ;; esac fi rlm_krb5_inc_dir= # Check whether --with-rlm-krb5-include-dir was given. if test "${with_rlm_krb5_include_dir+set}" = set; then withval=$with_rlm_krb5_include_dir; case "$withval" in no) { { echo "$as_me:$LINENO: error: Need rlm-krb5-include-dir" >&5 echo "$as_me: error: Need rlm-krb5-include-dir" >&2;} { (exit 1); exit 1; }; } ;; yes) ;; *) rlm_krb5_include_dir="$withval" ;; esac fi # Check whether --enable-heimdal-krb5 was given. if test "${enable_heimdal_krb5+set}" = set; then enableval=$enable_heimdal_krb5; case "$enableval" in yes) krb5_h_cflags="-DHEIMDAL_KRB5" ;; esac fi smart_try_dir=$rlm_krb5_include_dir ac_safe=`echo "krb5.h" | sed 'y%./+-%__pm%'` { echo "$as_me:$LINENO: checking for krb5.h" >&5 echo $ECHO_N "checking for krb5.h... $ECHO_C" >&6; } old_CFLAGS="$CFLAGS" smart_include= smart_include_dir= if test "x$smart_try_dir" != "x"; then for try in $smart_try_dir; do CFLAGS="$old_CFLAGS -I$try" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { int a = 1; ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then smart_include="-I$try" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 smart_include= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test "x$smart_include" != "x"; then break; fi done CFLAGS="$old_CFLAGS" fi if test "x$smart_include" = "x"; then cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { int a = 1; ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then smart_include=" " else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 smart_include= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test "x$smart_include" = "x"; then if test "x$LOCATE" != "x"; then DIRS= file=krb5.h for x in `${LOCATE} $file 2>/dev/null`; do base=`echo $x | sed "s%/${file}%%"` if test "x$x" = "x$base"; then continue; fi dir=`${DIRNAME} $x 2>/dev/null` exclude=`echo ${dir} | ${GREP} /home` if test "x$exclude" != "x"; then continue fi already=`echo \$smart_include_dir ${DIRS} | ${GREP} ${dir}` if test "x$already" = "x"; then DIRS="$DIRS $dir" fi done fi eval "smart_include_dir=\"\$smart_include_dir $DIRS\"" for try in $smart_include_dir /usr/local/include /opt/include; do CFLAGS="$old_CFLAGS -I$try" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { int a = 1; ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then smart_include="-I$try" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 smart_include= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test "x$smart_include" != "x"; then break; fi done CFLAGS="$old_CFLAGS" fi if test "x$smart_include" != "x"; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } eval "ac_cv_header_$ac_safe=yes" CFLAGS="$old_CFLAGS $smart_include" SMART_CFLAGS="$SMART_CFLAGS $smart_include" else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "$ac_cv_header_krb5_h" != "yes"; then fail="$fail krb5.h" fi krb5libcrypto= smart_try_dir=$rlm_krb5_lib_dir sm_lib_safe=`echo "k5crypto" | sed 'y%./+-%__p_%'` sm_func_safe=`echo "krb5_encrypt_data" | sed 'y%./+-%__p_%'` { echo "$as_me:$LINENO: checking for krb5_encrypt_data in -lk5crypto" >&5 echo $ECHO_N "checking for krb5_encrypt_data in -lk5crypto... $ECHO_C" >&6; } old_LIBS="$LIBS" smart_lib= smart_lib_dir= if test "x$smart_try_dir" != "x"; then for try in $smart_try_dir; do LIBS="-L$try -lk5crypto $old_LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ extern char krb5_encrypt_data(); int main () { krb5_encrypt_data() ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then smart_lib="-L$try -lk5crypto" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test "x$smart_lib" != "x"; then break; fi done LIBS="$old_LIBS" fi if test "x$smart_lib" = "x"; then LIBS="-lk5crypto $old_LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ extern char krb5_encrypt_data(); int main () { krb5_encrypt_data() ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then smart_lib="-lk5crypto" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS="$old_LIBS" fi if test "x$smart_lib" = "x"; then if test "x$LOCATE" != "x"; then DIRS= file=libk5crypto${libltdl_cv_shlibext} for x in `${LOCATE} $file 2>/dev/null`; do base=`echo $x | sed "s%/${file}%%"` if test "x$x" = "x$base"; then continue; fi dir=`${DIRNAME} $x 2>/dev/null` exclude=`echo ${dir} | ${GREP} /home` if test "x$exclude" != "x"; then continue fi already=`echo \$smart_lib_dir ${DIRS} | ${GREP} ${dir}` if test "x$already" = "x"; then DIRS="$DIRS $dir" fi done fi eval "smart_lib_dir=\"\$smart_lib_dir $DIRS\"" if test "x$LOCATE" != "x"; then DIRS= file=libk5crypto.a for x in `${LOCATE} $file 2>/dev/null`; do base=`echo $x | sed "s%/${file}%%"` if test "x$x" = "x$base"; then continue; fi dir=`${DIRNAME} $x 2>/dev/null` exclude=`echo ${dir} | ${GREP} /home` if test "x$exclude" != "x"; then continue fi already=`echo \$smart_lib_dir ${DIRS} | ${GREP} ${dir}` if test "x$already" = "x"; then DIRS="$DIRS $dir" fi done fi eval "smart_lib_dir=\"\$smart_lib_dir $DIRS\"" for try in $smart_lib_dir /usr/local/lib /opt/lib; do LIBS="-L$try -lk5crypto $old_LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ extern char krb5_encrypt_data(); int main () { krb5_encrypt_data() ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then smart_lib="-L$try -lk5crypto" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test "x$smart_lib" != "x"; then break; fi done LIBS="$old_LIBS" fi if test "x$smart_lib" != "x"; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } eval "ac_cv_lib_${sm_lib_safe}_${sm_func_safe}=yes" LIBS="$smart_lib $old_LIBS" SMART_LIBS="$smart_lib $SMART_LIBS" else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_cv_lib_k5crypto_krb5_encrypt_data" = xyes; then krb5libcrypto="-lk5crypto" fi if test "x$krb5libcrypto" = x; then sm_lib_safe=`echo "crypto" | sed 'y%./+-%__p_%'` sm_func_safe=`echo "DH_new" | sed 'y%./+-%__p_%'` { echo "$as_me:$LINENO: checking for DH_new in -lcrypto" >&5 echo $ECHO_N "checking for DH_new in -lcrypto... $ECHO_C" >&6; } old_LIBS="$LIBS" smart_lib= smart_lib_dir= if test "x$smart_try_dir" != "x"; then for try in $smart_try_dir; do LIBS="-L$try -lcrypto $old_LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ extern char DH_new(); int main () { DH_new() ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then smart_lib="-L$try -lcrypto" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test "x$smart_lib" != "x"; then break; fi done LIBS="$old_LIBS" fi if test "x$smart_lib" = "x"; then LIBS="-lcrypto $old_LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ extern char DH_new(); int main () { DH_new() ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then smart_lib="-lcrypto" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS="$old_LIBS" fi if test "x$smart_lib" = "x"; then if test "x$LOCATE" != "x"; then DIRS= file=libcrypto${libltdl_cv_shlibext} for x in `${LOCATE} $file 2>/dev/null`; do base=`echo $x | sed "s%/${file}%%"` if test "x$x" = "x$base"; then continue; fi dir=`${DIRNAME} $x 2>/dev/null` exclude=`echo ${dir} | ${GREP} /home` if test "x$exclude" != "x"; then continue fi already=`echo \$smart_lib_dir ${DIRS} | ${GREP} ${dir}` if test "x$already" = "x"; then DIRS="$DIRS $dir" fi done fi eval "smart_lib_dir=\"\$smart_lib_dir $DIRS\"" if test "x$LOCATE" != "x"; then DIRS= file=libcrypto.a for x in `${LOCATE} $file 2>/dev/null`; do base=`echo $x | sed "s%/${file}%%"` if test "x$x" = "x$base"; then continue; fi dir=`${DIRNAME} $x 2>/dev/null` exclude=`echo ${dir} | ${GREP} /home` if test "x$exclude" != "x"; then continue fi already=`echo \$smart_lib_dir ${DIRS} | ${GREP} ${dir}` if test "x$already" = "x"; then DIRS="$DIRS $dir" fi done fi eval "smart_lib_dir=\"\$smart_lib_dir $DIRS\"" for try in $smart_lib_dir /usr/local/lib /opt/lib; do LIBS="-L$try -lcrypto $old_LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ extern char DH_new(); int main () { DH_new() ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then smart_lib="-L$try -lcrypto" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test "x$smart_lib" != "x"; then break; fi done LIBS="$old_LIBS" fi if test "x$smart_lib" != "x"; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } eval "ac_cv_lib_${sm_lib_safe}_${sm_func_safe}=yes" LIBS="$smart_lib $old_LIBS" SMART_LIBS="$smart_lib $SMART_LIBS" else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_cv_lib_crypto_DH_new" = xyes; then krb5libcrypto="-lcrypto" fi fi if test "x$krb5libcrypto" = x; then { echo "$as_me:$LINENO: WARNING: neither krb5 'k5crypto' nor 'crypto' libraries are found!" >&5 echo "$as_me: WARNING: neither krb5 'k5crypto' nor 'crypto' libraries are found!" >&2;} fi sm_lib_safe=`echo "com_err" | sed 'y%./+-%__p_%'` sm_func_safe=`echo "set_com_err_hook" | sed 'y%./+-%__p_%'` { echo "$as_me:$LINENO: checking for set_com_err_hook in -lcom_err" >&5 echo $ECHO_N "checking for set_com_err_hook in -lcom_err... $ECHO_C" >&6; } old_LIBS="$LIBS" smart_lib= smart_lib_dir= if test "x$smart_try_dir" != "x"; then for try in $smart_try_dir; do LIBS="-L$try -lcom_err $old_LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ extern char set_com_err_hook(); int main () { set_com_err_hook() ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then smart_lib="-L$try -lcom_err" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test "x$smart_lib" != "x"; then break; fi done LIBS="$old_LIBS" fi if test "x$smart_lib" = "x"; then LIBS="-lcom_err $old_LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ extern char set_com_err_hook(); int main () { set_com_err_hook() ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then smart_lib="-lcom_err" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS="$old_LIBS" fi if test "x$smart_lib" = "x"; then if test "x$LOCATE" != "x"; then DIRS= file=libcom_err${libltdl_cv_shlibext} for x in `${LOCATE} $file 2>/dev/null`; do base=`echo $x | sed "s%/${file}%%"` if test "x$x" = "x$base"; then continue; fi dir=`${DIRNAME} $x 2>/dev/null` exclude=`echo ${dir} | ${GREP} /home` if test "x$exclude" != "x"; then continue fi already=`echo \$smart_lib_dir ${DIRS} | ${GREP} ${dir}` if test "x$already" = "x"; then DIRS="$DIRS $dir" fi done fi eval "smart_lib_dir=\"\$smart_lib_dir $DIRS\"" if test "x$LOCATE" != "x"; then DIRS= file=libcom_err.a for x in `${LOCATE} $file 2>/dev/null`; do base=`echo $x | sed "s%/${file}%%"` if test "x$x" = "x$base"; then continue; fi dir=`${DIRNAME} $x 2>/dev/null` exclude=`echo ${dir} | ${GREP} /home` if test "x$exclude" != "x"; then continue fi already=`echo \$smart_lib_dir ${DIRS} | ${GREP} ${dir}` if test "x$already" = "x"; then DIRS="$DIRS $dir" fi done fi eval "smart_lib_dir=\"\$smart_lib_dir $DIRS\"" for try in $smart_lib_dir /usr/local/lib /opt/lib; do LIBS="-L$try -lcom_err $old_LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ extern char set_com_err_hook(); int main () { set_com_err_hook() ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then smart_lib="-L$try -lcom_err" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test "x$smart_lib" != "x"; then break; fi done LIBS="$old_LIBS" fi if test "x$smart_lib" != "x"; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } eval "ac_cv_lib_${sm_lib_safe}_${sm_func_safe}=yes" LIBS="$smart_lib $old_LIBS" SMART_LIBS="$smart_lib $SMART_LIBS" else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_cv_lib_com_err_set_com_err_hook" != xyes; then { echo "$as_me:$LINENO: WARNING: the comm_err library isn't found!" >&5 echo "$as_me: WARNING: the comm_err library isn't found!" >&2;} fi sm_lib_safe=`echo "krb5" | sed 'y%./+-%__p_%'` sm_func_safe=`echo "krb5_init_context" | sed 'y%./+-%__p_%'` { echo "$as_me:$LINENO: checking for krb5_init_context in -lkrb5" >&5 echo $ECHO_N "checking for krb5_init_context in -lkrb5... $ECHO_C" >&6; } old_LIBS="$LIBS" smart_lib= smart_lib_dir= if test "x$smart_try_dir" != "x"; then for try in $smart_try_dir; do LIBS="-L$try -lkrb5 $old_LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ extern char krb5_init_context(); int main () { krb5_init_context() ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then smart_lib="-L$try -lkrb5" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test "x$smart_lib" != "x"; then break; fi done LIBS="$old_LIBS" fi if test "x$smart_lib" = "x"; then LIBS="-lkrb5 $old_LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ extern char krb5_init_context(); int main () { krb5_init_context() ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then smart_lib="-lkrb5" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS="$old_LIBS" fi if test "x$smart_lib" = "x"; then if test "x$LOCATE" != "x"; then DIRS= file=libkrb5${libltdl_cv_shlibext} for x in `${LOCATE} $file 2>/dev/null`; do base=`echo $x | sed "s%/${file}%%"` if test "x$x" = "x$base"; then continue; fi dir=`${DIRNAME} $x 2>/dev/null` exclude=`echo ${dir} | ${GREP} /home` if test "x$exclude" != "x"; then continue fi already=`echo \$smart_lib_dir ${DIRS} | ${GREP} ${dir}` if test "x$already" = "x"; then DIRS="$DIRS $dir" fi done fi eval "smart_lib_dir=\"\$smart_lib_dir $DIRS\"" if test "x$LOCATE" != "x"; then DIRS= file=libkrb5.a for x in `${LOCATE} $file 2>/dev/null`; do base=`echo $x | sed "s%/${file}%%"` if test "x$x" = "x$base"; then continue; fi dir=`${DIRNAME} $x 2>/dev/null` exclude=`echo ${dir} | ${GREP} /home` if test "x$exclude" != "x"; then continue fi already=`echo \$smart_lib_dir ${DIRS} | ${GREP} ${dir}` if test "x$already" = "x"; then DIRS="$DIRS $dir" fi done fi eval "smart_lib_dir=\"\$smart_lib_dir $DIRS\"" for try in $smart_lib_dir /usr/local/lib /opt/lib; do LIBS="-L$try -lkrb5 $old_LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ extern char krb5_init_context(); int main () { krb5_init_context() ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then smart_lib="-L$try -lkrb5" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test "x$smart_lib" != "x"; then break; fi done LIBS="$old_LIBS" fi if test "x$smart_lib" != "x"; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } eval "ac_cv_lib_${sm_lib_safe}_${sm_func_safe}=yes" LIBS="$smart_lib $old_LIBS" SMART_LIBS="$smart_lib $SMART_LIBS" else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_cv_lib_krb5_krb5_init_context" != xyes; then fail="$fail krb5" fi targetname=rlm_krb5 else targetname= echo \*\*\* module rlm_krb5 is disabled. fi if test x"$fail" != x""; then if test x"${enable_strict_dependencies}" = x"yes"; then { { echo "$as_me:$LINENO: error: set --without-rlm_krb5 to disable it explicitly." >&5 echo "$as_me: error: set --without-rlm_krb5 to disable it explicitly." >&2;} { (exit 1); exit 1; }; } else { echo "$as_me:$LINENO: WARNING: silently not building rlm_krb5." >&5 echo "$as_me: WARNING: silently not building rlm_krb5." >&2;} { echo "$as_me:$LINENO: WARNING: FAILURE: rlm_krb5 requires: $fail." >&5 echo "$as_me: WARNING: FAILURE: rlm_krb5 requires: $fail." >&2;}; targetname="" fi fi krb5_ldflags=$SMART_LIBS krb5_cflags="${krb5_h_cflags} $SMART_CFLAGS" unset ac_cv_env_LIBS_set unset ac_cv_env_LIBS_value ac_config_files="$ac_config_files 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_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( *) $as_unset $ac_var ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then test "x$cache_file" != "x/dev/null" && { echo "$as_me:$LINENO: updating cache $cache_file" >&5 echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 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}' # Transform confdefs.h into DEFS. # Protect against shell expansion while executing Makefile rules. # Protect against Makefile macro expansion. # # If the first sed substitution is executed (which looks for macros that # take arguments), then branch to the quote section. Otherwise, # look for a macro that doesn't take arguments. ac_script=' t clear :clear s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g t quote s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g t quote b any :quote s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g s/\[/\\&/g s/\]/\\&/g s/\$/$$/g H :any ${ g s/^\n// s/\n/ /g p } ' DEFS=`sed -n "$ac_script" confdefs.h` ac_libobjs= ac_ltlibobjs= 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=`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. ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs : ${CONFIG_STATUS=./config.status} ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >$CONFIG_STATUS <<_ACEOF #! $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} _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ## --------------------- ## ## 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=: # 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 # PATH needs CR # 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 # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false 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.) as_nl=' ' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. 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 # Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # CDPATH. $as_unset CDPATH as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, and appends # trailing '-' during substitution so that $LINENO is not a special # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # scripts with optimization help from Paolo Bonzini. 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" || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi 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 fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi 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=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 # Save the log message, to keep $[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by $as_me, which was generated by GNU Autoconf 2.61. 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 cat >>$CONFIG_STATUS <<_ACEOF # Files that config.status was made for. config_files="$ac_config_files" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit -q, --quiet 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 Configuration files: $config_files Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ config.status configured by $0, generated by GNU Autoconf 2.61, with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" Copyright (C) 2006 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' _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # If no file are specified by the user, then we need to provide default # value. By we need to know if files were specified by the user. 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=$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 ) echo "$ac_cs_version"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift CONFIG_FILES="$CONFIG_FILES $ac_optarg" ac_need_defaults=false;; --he | --h | --help | --hel | -h ) 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. -*) { echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *) ac_config_targets="$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 if \$ac_cs_recheck; then echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 CONFIG_SHELL=$SHELL export CONFIG_SHELL exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; 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 fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= trap 'exit_status=$? { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status ' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || { echo "$me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } # # Set up the sed scripts for CONFIG_FILES section. # # No need to generate the scripts if there are no CONFIG_FILES. # This happens for instance when ./config.status config.h if test -n "$CONFIG_FILES"; then _ACEOF ac_delim='%!_!# ' for ac_last_try in false false false false false :; do cat >conf$$subs.sed <<_ACEOF SHELL!$SHELL$ac_delim PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim PACKAGE_NAME!$PACKAGE_NAME$ac_delim PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim PACKAGE_STRING!$PACKAGE_STRING$ac_delim PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim exec_prefix!$exec_prefix$ac_delim prefix!$prefix$ac_delim program_transform_name!$program_transform_name$ac_delim bindir!$bindir$ac_delim sbindir!$sbindir$ac_delim libexecdir!$libexecdir$ac_delim datarootdir!$datarootdir$ac_delim datadir!$datadir$ac_delim sysconfdir!$sysconfdir$ac_delim sharedstatedir!$sharedstatedir$ac_delim localstatedir!$localstatedir$ac_delim includedir!$includedir$ac_delim oldincludedir!$oldincludedir$ac_delim docdir!$docdir$ac_delim infodir!$infodir$ac_delim htmldir!$htmldir$ac_delim dvidir!$dvidir$ac_delim pdfdir!$pdfdir$ac_delim psdir!$psdir$ac_delim libdir!$libdir$ac_delim localedir!$localedir$ac_delim mandir!$mandir$ac_delim DEFS!$DEFS$ac_delim ECHO_C!$ECHO_C$ac_delim ECHO_N!$ECHO_N$ac_delim ECHO_T!$ECHO_T$ac_delim LIBS!$LIBS$ac_delim build_alias!$build_alias$ac_delim host_alias!$host_alias$ac_delim target_alias!$target_alias$ac_delim CC!$CC$ac_delim CFLAGS!$CFLAGS$ac_delim LDFLAGS!$LDFLAGS$ac_delim CPPFLAGS!$CPPFLAGS$ac_delim ac_ct_CC!$ac_ct_CC$ac_delim EXEEXT!$EXEEXT$ac_delim OBJEXT!$OBJEXT$ac_delim CPP!$CPP$ac_delim krb5_cflags!$krb5_cflags$ac_delim krb5_ldflags!$krb5_ldflags$ac_delim targetname!$targetname$ac_delim LIBOBJS!$LIBOBJS$ac_delim LTLIBOBJS!$LTLIBOBJS$ac_delim _ACEOF if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 50; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` if test -n "$ac_eof"; then ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` ac_eof=`expr $ac_eof + 1` fi cat >>$CONFIG_STATUS <<_ACEOF cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof /@[a-zA-Z_][a-zA-Z_0-9]*@/!b end _ACEOF sed ' s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g s/^/s,@/; s/!/@,|#_!!_#|/ :n t n s/'"$ac_delim"'$/,g/; t s/$/\\/; p N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n ' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF :end s/|#_!!_#|//g CEOF$ac_eof _ACEOF # VPATH may cause trouble with some makes, so we remove $(srcdir), # ${srcdir} and @srcdir@ 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[ ]*=/{ s/:*\$(srcdir):*/:/ s/:*\${srcdir}:*/:/ s/:*@srcdir@:*/:/ s/^\([^=]*=[ ]*\):*/\1/ s/:*$// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF fi # test -n "$CONFIG_FILES" for ac_tag in :F $CONFIG_FILES do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5 echo "$as_me: error: Invalid tag $ac_tag." >&2;} { (exit 1); exit 1; }; };; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 echo "$as_me: error: cannot find input file: $ac_f" >&2;} { (exit 1); exit 1; }; };; esac ac_file_inputs="$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 "`IFS=: echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure." if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { echo "$as_me:$LINENO: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} fi case $ac_tag in *:-:* | *:-) cat >"$tmp/stdin";; 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 || 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" case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`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 || 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" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 echo "$as_me: error: cannot create directory $as_dir" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`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 # _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # 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= case `sed -n '/datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p ' $ac_file_inputs` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF 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 sed "$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s&@configure_input@&$configure_input&;t t s&@top_builddir@&$ac_top_builddir_sub&;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 $ac_datarootdir_hack " $ac_file_inputs | sed -f "$tmp/subs-1.sed" >$tmp/out test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&5 echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&2;} rm -f "$tmp/stdin" case $ac_file in -) cat "$tmp/out"; rm -f "$tmp/out";; *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;; esac ;; esac done # for ac_tag { (exit 0); exit 0; } _ACEOF chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save # 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 || { (exit 1); exit 1; } fi freeradius-server/src/modules/rlm_krb5/configure.in000066400000000000000000000050101257552170400230040ustar00rootroot00000000000000AC_PREREQ([2.53]) AC_INIT(rlm_krb5.c) AC_REVISION($Revision$) AC_DEFUN(modname,[rlm_krb5]) if test x$with_[]modname != xno; then AC_PROG_CC AC_PROG_CPP dnl extra argument: --with-rlm-krb5-lib-dir rlm_krb5_lib_dir= AC_ARG_WITH(rlm-krb5-lib-dir, [ --with-rlm-krb5-lib-dir=DIR Directory for krb5 library files []], [ case "$withval" in no) AC_MSG_ERROR(Need rlm-krb5-lib-dir) ;; yes) ;; *) rlm_krb5_lib_dir="$withval" ;; esac ] ) dnl extra argument: --with-rlm-krb5-include-dir rlm_krb5_inc_dir= AC_ARG_WITH(rlm-krb5-include-dir, [ --with-rlm-krb5-include-dir=DIR Directory for krb5 include files []], [ case "$withval" in no) AC_MSG_ERROR(Need rlm-krb5-include-dir) ;; yes) ;; *) rlm_krb5_include_dir="$withval" ;; esac ] ) dnl extra argument: --enable-heimdal-krb5 AC_ARG_ENABLE(heimdal-krb5, [ --enable-heimdal-krb5 Enable if you have heimdal krb5], [ case "$enableval" in yes) krb5_h_cflags="-DHEIMDAL_KRB5" ;; esac ] ) smart_try_dir=$rlm_krb5_include_dir FR_SMART_CHECK_INCLUDE(krb5.h) if test "$ac_cv_header_krb5_h" != "yes"; then fail="$fail krb5.h" fi krb5libcrypto= smart_try_dir=$rlm_krb5_lib_dir FR_SMART_CHECK_LIB(k5crypto, krb5_encrypt_data) if test "x$ac_cv_lib_k5crypto_krb5_encrypt_data" = xyes; then krb5libcrypto="-lk5crypto" fi if test "x$krb5libcrypto" = x; then FR_SMART_CHECK_LIB(crypto, DH_new) if test "x$ac_cv_lib_crypto_DH_new" = xyes; then krb5libcrypto="-lcrypto" fi fi if test "x$krb5libcrypto" = x; then AC_MSG_WARN([neither krb5 'k5crypto' nor 'crypto' libraries are found!]) fi FR_SMART_CHECK_LIB(com_err, set_com_err_hook) if test "x$ac_cv_lib_com_err_set_com_err_hook" != xyes; then AC_MSG_WARN([the comm_err library isn't found!]) fi FR_SMART_CHECK_LIB(krb5, krb5_init_context) if test "x$ac_cv_lib_krb5_krb5_init_context" != xyes; then fail="$fail krb5" fi targetname=modname else targetname= echo \*\*\* module modname is disabled. fi if test x"$fail" != x""; then if test x"${enable_strict_dependencies}" = x"yes"; then AC_MSG_ERROR([set --without-]modname[ to disable it explicitly.]) else AC_MSG_WARN([silently not building ]modname[.]) AC_MSG_WARN([FAILURE: ]modname[ requires: $fail.]); targetname="" fi fi krb5_ldflags=$SMART_LIBS krb5_cflags="${krb5_h_cflags} $SMART_CFLAGS" AC_SUBST(krb5_cflags) AC_SUBST(krb5_ldflags) AC_SUBST(targetname) AC_OUTPUT(Makefile) freeradius-server/src/modules/rlm_krb5/rlm_krb5.c000066400000000000000000000326331257552170400223670ustar00rootroot00000000000000/* * rlm_krb5.c module to authenticate against krb5 * * Version: $Id$ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2000,2006,2012 The FreeRADIUS server project * Copyright 2000 Nathan Neulinger * Copyright 2000 Alan DeKok */ #include RCSID("$Id$") #include #include /* krb5 includes */ #include #include /* Arbitrary 64char limit on service names */ #define SERVICE_NAME_LEN 64 typedef struct rlm_krb5_t { const char *keytab; const char *service_princ; const char *cache; krb5_context *context; } rlm_krb5_t; static const CONF_PARSER module_config[] = { { "keytab", PW_TYPE_STRING_PTR, offsetof(rlm_krb5_t,keytab), NULL, NULL }, { "service_principal", PW_TYPE_STRING_PTR, offsetof(rlm_krb5_t,service_princ), NULL, NULL }, { "cache", PW_TYPE_BOOLEAN, offsetof(rlm_krb5_t,cache), NULL, "yes" }, { NULL, -1, 0, NULL, NULL } }; #ifndef HEIMDAL_KRB5 static int krb5_build_auth_context(rlm_krb5_t *inst, krb5_context context, krb5_auth_context *auth_context) { int ret; krb5_int32 flags; ret = krb5_auth_con_init(context, auth_context); if (ret) return ret; ret = krb5_auth_con_getflags(context, *auth_context, &flags); if (ret) return ret; if (!inst->cache && (flags & KRB5_AUTH_CONTEXT_DO_TIME)) { ret = krb5_auth_con_setflags(context, *auth_context, flags & ~KRB5_AUTH_CONTEXT_DO_TIME); if (ret) return ret; } return 0; } static int verify_krb5_tgt(krb5_context context, rlm_krb5_t *inst, const char *user, krb5_ccache ccache) { int rcode; int ret; char phost[BUFSIZ]; krb5_principal princ; krb5_keyblock *keyblock = 0; krb5_data packet, *server; krb5_auth_context auth_context = NULL; krb5_keytab keytab; char service[SERVICE_NAME_LEN] = "host"; char *server_name = NULL; char *keytab_name; /* krb5_kt_read_service_key lacks const qualifier */ memcpy(&keytab_name, &inst->keytab, sizeof(keytab_name)); if (inst->service_princ != NULL) { server_name = strchr(inst->service_princ, '/'); if (server_name != NULL) { *server_name = '\0'; } strlcpy(service, inst->service_princ, sizeof(service)); if (server_name != NULL) { *server_name = '/'; server_name++; } } memset(&packet, 0, sizeof packet); ret = krb5_sname_to_principal(context, server_name, service, KRB5_NT_SRV_HST, &princ); if (ret) { radlog(L_DBG, "rlm_krb5: [%s] krb5_sname_to_principal failed: %s", user, error_message(ret)); return RLM_MODULE_REJECT; } server = krb5_princ_component(c, princ, 1); if (!server) { radlog(L_DBG, "rlm_krb5: [%s] krb5_princ_component failed.", user); return RLM_MODULE_REJECT; } strlcpy(phost, server->data, sizeof(phost)); /* * Do we have host/ keys? * (use default/configured keytab, kvno IGNORE_VNO to get the * first match, and enctype is currently ignored anyhow.) */ ret = krb5_kt_read_service_key(context, keytab_name, princ, 0, ENCTYPE_DES_CBC_MD5, &keyblock); if (ret) { /* Keytab or service key does not exist */ radlog(L_DBG, "rlm_krb5: verify_krb_v5_tgt: host key not found : %s", error_message(ret)); return RLM_MODULE_OK; } if (keyblock) krb5_free_keyblock(context, keyblock); /* * Talk to the kdc and construct the ticket. */ ret = krb5_build_auth_context(inst, context, &auth_context); if (ret) { radlog(L_DBG, "rlm_krb5: [%s] krb5_build_auth_context() failed: %s", user, error_message(ret)); rcode = RLM_MODULE_REJECT; goto cleanup; } ret = krb5_mk_req(context, &auth_context, 0, service, phost, NULL, ccache, &packet); if (auth_context) { krb5_auth_con_free(context, auth_context); auth_context = NULL; /* setup for rd_req */ } if (ret) { radlog(L_DBG, "rlm_krb5: [%s] krb5_mk_req() failed: %s", user, error_message(ret)); rcode = RLM_MODULE_REJECT; goto cleanup; } if (keytab_name != NULL) { ret = krb5_kt_resolve(context, keytab_name, &keytab); } if (keytab_name == NULL || ret) { ret = krb5_kt_default(context, &keytab); } /* Hmm? The keytab was just fine a second ago! */ if (ret) { radlog(L_AUTH, "rlm_krb5: [%s] krb5_kt_resolve failed: %s", user, error_message(ret)); rcode = RLM_MODULE_REJECT; goto cleanup; } /* Try to use the ticket. */ ret = krb5_build_auth_context(inst, context, &auth_context); if (ret) { radlog(L_DBG, "rlm_krb5: [%s] krb5_build_auth_context() failed: %s", user, error_message(ret)); rcode = RLM_MODULE_REJECT; goto cleanup; } ret = krb5_rd_req(context, &auth_context, &packet, princ, keytab, NULL, NULL); if (auth_context) krb5_auth_con_free(context, auth_context); krb5_kt_close(context, keytab); if (ret) { radlog(L_AUTH, "rlm_krb5: [%s] krb5_rd_req() failed: %s", user, error_message(ret)); rcode = RLM_MODULE_REJECT; } else { rcode = RLM_MODULE_OK; } cleanup: if (packet.data) { krb5_free_data_contents(context, &packet); } return rcode; } #endif static int krb5_instantiate(CONF_SECTION *conf, void **instance) { int ret; rlm_krb5_t *data; krb5_context *context; data = rad_malloc(sizeof(*data)); memset(data, 0, sizeof(*data)); if (cf_section_parse(conf, data, module_config) < 0) { free(data); return -1; } context = data->context = rad_malloc(sizeof(*context)); ret = krb5_init_context(context); if (ret) { radlog(L_AUTH, "rlm_krb5: krb5_init failed: %s", error_message(ret)); free(data); return -1; } else { radlog(L_AUTH, "rlm_krb5: krb5_init ok"); } *instance = data; return 0; } static int krb5_detach(void *instance) { free(((rlm_krb5_t *)instance)->context); free(instance); return 0; } /* * Validate userid/passwd (MIT) */ #ifndef HEIMDAL_KRB5 static int krb5_auth(void *instance, REQUEST *request) { rlm_krb5_t *inst = instance; int ret; static char tgs_name[] = KRB5_TGS_NAME; krb5_data tgtname = { 0, KRB5_TGS_NAME_SIZE, tgs_name }; krb5_creds kcreds; krb5_ccache ccache; /* MEMORY: + unsigned int (20) + NULL */ char cache_name[28]; krb5_context context = *(inst->context); /* copy data */ const char *user, *pass; /* * We can only authenticate user requests which HAVE * a User-Name attribute. */ if (!request->username) { radlog(L_AUTH, "rlm_krb5: Attribute \"User-Name\" is required for authentication."); return RLM_MODULE_INVALID; } /* * We can only authenticate user requests which HAVE * a User-Password attribute. */ if (!request->password) { radlog(L_AUTH, "rlm_krb5: Attribute \"User-Password\" is required for authentication."); return RLM_MODULE_INVALID; } /* * Ensure that we're being passed a plain-text password, * and not anything else. */ if (request->password->attribute != PW_USER_PASSWORD) { radlog(L_AUTH, "rlm_krb5: Attribute \"User-Password\" is required for authentication. Cannot use \"%s\".", request->password->name); return RLM_MODULE_INVALID; } user = request->username->vp_strvalue; pass = request->password->vp_strvalue; /* * Generate a unique cache_name. */ snprintf(cache_name, sizeof(cache_name), "MEMORY:%u", request->number); ret = krb5_cc_resolve(context, cache_name, &ccache); if (ret) { radlog(L_AUTH, "rlm_krb5: [%s] krb5_cc_resolve(): %s", user, error_message(ret)); return RLM_MODULE_REJECT; } /* * Actually perform the authentication. */ memset((char *)&kcreds, 0, sizeof(kcreds)); ret = krb5_parse_name(context, user, &kcreds.client); if (ret) { radlog(L_AUTH, "rlm_krb5: [%s] krb5_parse_name failed: %s", user, error_message(ret)); return RLM_MODULE_REJECT; } ret = krb5_cc_initialize(context, ccache, kcreds.client); if (ret) { radlog(L_AUTH, "rlm_krb5: [%s] krb5_cc_initialize(): %s", user, error_message(ret)); return RLM_MODULE_REJECT; } /* * MIT krb5 verification. */ ret = krb5_build_principal_ext(context, &kcreds.server, krb5_princ_realm(context, kcreds.client)->length, krb5_princ_realm(context, kcreds.client)->data, tgtname.length, tgtname.data, krb5_princ_realm(context, kcreds.client)->length, krb5_princ_realm(context, kcreds.client)->data, 0); if (ret) { radlog(L_AUTH, "rlm_krb5: [%s] krb5_build_principal_ext failed: %s", user, error_message(ret)); krb5_cc_destroy(context, ccache); return RLM_MODULE_REJECT; } ret = krb5_get_in_tkt_with_password(context, 0, NULL, NULL, NULL, pass, ccache, &kcreds, 0); if (ret) { radlog(L_AUTH, "rlm_krb5: [%s] krb5_g_i_t_w_p failed: %s", user, error_message(ret)); krb5_free_cred_contents(context, &kcreds); krb5_cc_destroy(context, ccache); return RLM_MODULE_REJECT; } /* * Now verify the KDC's identity. */ ret = verify_krb5_tgt(context, inst, user, ccache); krb5_free_cred_contents(context, &kcreds); krb5_cc_destroy(context, ccache); return ret; } #else /* HEIMDAL_KRB5 */ /* * validate user/pass (Heimdal) */ static int krb5_auth(void *instance, REQUEST *request) { rlm_krb5_t *inst = instance; krb5_error_code ret; krb5_ccache id; krb5_principal userP; krb5_context context = *(inst->context); /* copy data */ const char *user, *pass; char service[SERVICE_NAME_LEN] = "host"; char *server_name = NULL; char *princ_name; krb5_verify_opt krb_verify_options; krb5_keytab keytab; if (inst->service_princ != NULL) { server_name = strchr(inst->service_princ, '/'); if (server_name != NULL) { *server_name = '\0'; } strlcpy(service, inst->service_princ, sizeof(service)); if (server_name != NULL) { *server_name = '/'; server_name++; } } /* * We can only authenticate user requests which HAVE * a User-Name attribute. */ if (!request->username) { radlog(L_AUTH, "rlm_krb5: Attribute \"User-Name\" is required for authentication."); return RLM_MODULE_INVALID; } /* * We can only authenticate user requests which HAVE * a User-Password attribute. */ if (!request->password) { radlog(L_AUTH, "rlm_krb5: Attribute \"User-Password\" is required for authentication."); return RLM_MODULE_INVALID; } /* * Ensure that we're being passed a plain-text password, * and not anything else. */ if (request->password->attribute != PW_USER_PASSWORD) { radlog(L_AUTH, "rlm_krb5: Attribute \"User-Password\" is required for authentication. Cannot use \"%s\".", request->password->name); return RLM_MODULE_INVALID; } user = request->username->vp_strvalue; pass = request->password->vp_strvalue; ret = krb5_parse_name(context, user, &userP); if (ret) { radlog(L_AUTH, "rlm_krb5: [%s] krb5_parse_name failed: %s", user, error_message(ret)); return RLM_MODULE_REJECT; } /* * Heimdal krb5 verification. */ /* * The following bit allows us to also log user/instance@REALM if someone * logs in using an instance. */ ret = krb5_unparse_name(context, userP, &princ_name); if (ret != 0) { radlog(L_AUTH, "rlm_krb5: Unparsable name"); } else { radlog(L_AUTH, "rlm_krb5: Parsed name is: %s", princ_name); free(princ_name); } krb5_cc_default(context, &id); /* * Set up krb5_verify_user options. */ krb5_verify_opt_init(&krb_verify_options); krb5_verify_opt_set_ccache(&krb_verify_options, id); /* * Resolve keytab name. This allows us to use something other than * the default system keytab */ if (inst->keytab != NULL) { ret = krb5_kt_resolve(context, inst->keytab, &keytab); if (ret) { radlog(L_AUTH, "rlm_krb5: unable to resolve keytab %s: %s", inst->keytab, error_message(ret)); krb5_kt_close(context, keytab); return RLM_MODULE_REJECT; } krb5_verify_opt_set_keytab(&krb_verify_options, keytab); } /* * Verify aquired credentials against the keytab. */ krb5_verify_opt_set_secure(&krb_verify_options, 1); /* * Allow us to use an arbitrary service name. */ krb5_verify_opt_set_service(&krb_verify_options, service); /* * Verify the user, using the above set options. */ ret = krb5_verify_user_opt(context, userP, pass, &krb_verify_options); /* * We are done with the keytab, close it. */ krb5_kt_close(context, keytab); if (ret == 0) return RLM_MODULE_OK; radlog(L_AUTH, "rlm_krb5: failed verify_user: %s (%s@%s)", error_message(ret), *userP->name.name_string.val, userP->realm); return RLM_MODULE_REJECT; } #endif /* HEIMDAL_KRB5 */ module_t rlm_krb5 = { RLM_MODULE_INIT, "Kerberos", RLM_TYPE_THREAD_UNSAFE, /* type: not thread safe */ krb5_instantiate, /* instantiation */ krb5_detach, /* detach */ { krb5_auth, /* authenticate */ NULL, /* authorize */ NULL, /* pre-accounting */ NULL, /* accounting */ NULL, /* checksimul */ NULL, /* pre-proxy */ NULL, /* post-proxy */ NULL /* post-auth */ }, }; freeradius-server/src/modules/rlm_ldap/000077500000000000000000000000001257552170400205545ustar00rootroot00000000000000freeradius-server/src/modules/rlm_ldap/.gitignore000066400000000000000000000000111257552170400225340ustar00rootroot00000000000000Makefile freeradius-server/src/modules/rlm_ldap/Makefile.in000066400000000000000000000002671257552170400226260ustar00rootroot00000000000000# # $Id$ # TARGET = @targetname@ SRCS = rlm_ldap.c @edir@ HEADERS = RLM_CFLAGS = @ldap_cflags@ RLM_LIBS = @ldap_ldflags@ include ../rules.mak $(LT_OBJS): $(HEADERS) freeradius-server/src/modules/rlm_ldap/configure000077500000000000000000004063451257552170400224770ustar00rootroot00000000000000#! /bin/sh # From configure.in Revision. # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.61. # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, # 2002, 2003, 2004, 2005, 2006 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=: # 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 # PATH needs CR # 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 # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false 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.) as_nl=' ' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. 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 # Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # CDPATH. $as_unset CDPATH if test "x$CONFIG_SHELL" = x; then if (eval ":") 2>/dev/null; then as_have_required=yes else as_have_required=no fi if test $as_have_required = yes && (eval ": (as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=\$LINENO as_lineno_2=\$LINENO test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } ") 2> /dev/null; then : else as_candidate_shells= as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. case $as_dir in /*) for as_base in sh bash ksh sh5; do as_candidate_shells="$as_candidate_shells $as_dir/$as_base" done;; esac done IFS=$as_save_IFS for as_shell in $as_candidate_shells $SHELL; do # Try only shells that exist, to save several forks. if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { ("$as_shell") 2> /dev/null <<\_ASEOF 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 : _ASEOF }; then CONFIG_SHELL=$as_shell as_have_required=yes if { "$as_shell" 2> /dev/null <<\_ASEOF 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 : (as_func_return () { (exit $1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = "$1" ); then : else exitcode=1 echo positional parameters were not saved. fi test $exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } _ASEOF }; then break fi fi done if test "x$CONFIG_SHELL" != x; then for as_var in BASH_ENV ENV do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done export CONFIG_SHELL exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} fi if test $as_have_required = no; then echo This script requires a shell more modern than all the echo shells that I found on your system. Please install a echo modern shell, or manually run the script under such a echo shell if you do have one. { (exit 1); exit 1; } fi fi fi (eval "as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0") || { echo No shell found that supports shell functions. echo Please tell autoconf@gnu.org about your system, echo including any error possibly output before this echo message } as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, and appends # trailing '-' during substitution so that $LINENO is not a special # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # scripts with optimization help from Paolo Bonzini. 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" || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi 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 fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi 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=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, 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= SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME= PACKAGE_TARNAME= PACKAGE_VERSION= PACKAGE_STRING= PACKAGE_BUGREPORT= ac_unique_file="rlm_ldap.c" ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datarootdir datadir sysconfdir sharedstatedir localstatedir includedir oldincludedir docdir infodir htmldir dvidir pdfdir psdir libdir localedir mandir DEFS ECHO_C ECHO_N ECHO_T LIBS build_alias host_alias target_alias CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT edir ldap_ldflags ldap_cflags targetname LIBOBJS LTLIBOBJS' ac_subst_files='' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS' # Initialize some variables set by options. ac_init_help= ac_init_version=false # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *) ac_optarg=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_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` eval enable_$ac_feature=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_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` eval enable_$ac_feature=\$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_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/[-.]/_/g'` eval with_$ac_package=\$ac_optarg ;; -without-* | --without-*) ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/[-.]/_/g'` eval with_$ac_package=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 ;; -*) { echo "$as_me: error: unrecognized option: $ac_option Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && 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'` { echo "$as_me: error: missing argument to $ac_option" >&2 { (exit 1); exit 1; }; } fi # Be sure to have absolute directory names. 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 case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; } 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 echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || { echo "$as_me: error: Working directory cannot be determined" >&2 { (exit 1); exit 1; }; } test "X$ac_ls_di" = "X$ac_pwd_ls_di" || { echo "$as_me: error: pwd does not report name of working directory" >&2 { (exit 1); exit 1; }; } # 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 -- "$0" || $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$0" : 'X\(//\)[^/]' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X"$0" | 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 .." { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2 { (exit 1); exit 1; }; } pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures this package to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF _ACEOF fi if test -n "$ac_init_help"; then cat <<\_ACEOF Optional Features: --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-shared[=PKGS] build shared libraries [default=yes] Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-rlm-ldap-lib-dir=DIR directory for LDAP library files --with-rlm-ldap-include-dir=DIR directory for LDAP include files --with-threads use threads, if available. (default=yes) --with-edir enable Novell eDirectory integration. (default=no) Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory LIBS libraries to pass to the linker, e.g. -l CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I if you have headers in a nonstandard directory Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. _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" || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`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 echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF configure generated by GNU Autoconf 2.61 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 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 cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by $as_me, which was generated by GNU Autoconf 2.61. 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=. 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=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; 2) ac_configure_args1="$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 ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac done done $as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } $as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export 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 cat <<\_ASBOX ## ---------------- ## ## Cache variables. ## ## ---------------- ## _ASBOX 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_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( *) $as_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 cat <<\_ASBOX ## ----------------- ## ## Output variables. ## ## ----------------- ## _ASBOX echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then cat <<\_ASBOX ## ------------------- ## ## File substitutions. ## ## ------------------- ## _ASBOX echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then cat <<\_ASBOX ## ----------- ## ## confdefs.h. ## ## ----------- ## _ASBOX echo cat confdefs.h echo fi test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" 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'; { (exit 1); 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 # 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 # Let the site file select an alternate cache file if it wants to. # Prefer explicitly selected file to automatically selected ones. if test -n "$CONFIG_SITE"; then set x "$CONFIG_SITE" elif test "x$prefix" != xNONE; then set x "$prefix/share/config.site" "$prefix/etc/config.site" else set x "$ac_default_prefix/share/config.site" \ "$ac_default_prefix/etc/config.site" fi shift for ac_site_file do if test -r "$ac_site_file"; then { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" 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. if test -f "$cache_file"; then { echo "$as_me:$LINENO: loading cache $cache_file" >&5 echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { echo "$as_me:$LINENO: creating cache $cache_file" >&5 echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 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 { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 echo "$as_me: former value: $ac_old_val" >&2;} { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 echo "$as_me: current value: $ac_new_val" >&2;} ac_cache_corrupted=: fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`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. *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 echo "$as_me: error: changes in the environment can compromise the build" >&2;} { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} { (exit 1); exit 1; }; } 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 fail= SMART_LIBS= SMART_CLFAGS= if test x$with_rlm_ldap != xno; then 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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}gcc" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="gcc" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}cc" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="$ac_prog" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&5 echo "$as_me: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } # Provide some information about the compiler. echo "$as_me:$LINENO: checking for C compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (ac_try="$ac_compiler --version >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -v >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -V >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out 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. { echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6; } ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # # List of possible output files, starting from the most likely. # The algorithm is not robust to junk in `.', hence go to wildcards (a.*) # only as a last resort. b.out is created by i960 compilers. ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out' # # The IRIX 6 linker writes into existing files which may not be # executable, retaining their permissions. Remove them first so a # subsequent execution test works. ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link_default") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; 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 | *.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 { echo "$as_me:$LINENO: result: $ac_file" >&5 echo "${ECHO_T}$ac_file" >&6; } if test -z "$ac_file"; then echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: C compiler cannot create executables See \`config.log' for more details." >&5 echo "$as_me: error: C compiler cannot create executables See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } fi ac_exeext=$ac_cv_exeext # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { echo "$as_me:$LINENO: checking whether the C compiler works" >&5 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6; } # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then if { ac_try='./$ac_file' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { echo "$as_me:$LINENO: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&5 echo "$as_me: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi fi fi { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } rm -f a.out a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; } { echo "$as_me:$LINENO: result: $cross_compiling" >&5 echo "${ECHO_T}$cross_compiling" >&6; } { echo "$as_me:$LINENO: checking for suffix of executables" >&5 echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; } if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; 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 | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest$ac_cv_exeext { echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 echo "${ECHO_T}$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT { echo "$as_me:$LINENO: checking for suffix of object files" >&5 echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; } if test "${ac_cv_objext+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; 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 ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 echo "${ECHO_T}$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; } if test "${ac_cv_c_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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 { echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; } GCC=`test $ac_compiler_gnu = yes && echo yes` ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CFLAGS="" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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 { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 echo "${ECHO_T}$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 { echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_c89+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_c89=$ac_arg else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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) { echo "$as_me:$LINENO: result: none needed" >&5 echo "${ECHO_T}none needed" >&6; } ;; xno) { echo "$as_me:$LINENO: result: unsupported" >&5 echo "${ECHO_T}unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;; 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 rlm_ldap_lib_dir= # Check whether --with-rlm-ldap-lib-dir was given. if test "${with_rlm_ldap_lib_dir+set}" = set; then withval=$with_rlm_ldap_lib_dir; case "$withval" in no) { { echo "$as_me:$LINENO: error: Need rlm-ldap-lib-dir" >&5 echo "$as_me: error: Need rlm-ldap-lib-dir" >&2;} { (exit 1); exit 1; }; } ;; yes) ;; *) rlm_ldap_lib_dir="$withval" ;; esac fi rlm_ldap_include_dir= # Check whether --with-rlm-ldap-include-dir was given. if test "${with_rlm_ldap_include_dir+set}" = set; then withval=$with_rlm_ldap_include_dir; case "$withval" in no) { { echo "$as_me:$LINENO: error: Need rlm-ldap-include-dir" >&5 echo "$as_me: error: Need rlm-ldap-include-dir" >&2;} { (exit 1); exit 1; }; } ;; yes) ;; *) rlm_ldap_include_dir="$withval" ;; esac fi # 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 if test "x$enable_shared" = "xno"; then { echo "$as_me:$LINENO: WARNING: Static linking with libldap will probably result in unresolved symbols." >&5 echo "$as_me: WARNING: Static linking with libldap will probably result in unresolved symbols." >&2;} fi rlm_ldap_with_threads=yes # Check whether --with-threads was given. if test "${with_threads+set}" = set; then withval=$with_threads; case "$withval" in no) rlm_ldap_with_threads=no ;; *) ;; esac fi if test "x$rlm_ldap_with_threads" = "xyes"; then { echo "$as_me:$LINENO: checking for pthread_create in -lpthread" >&5 echo $ECHO_N "checking for pthread_create in -lpthread... $ECHO_C" >&6; } if test "${ac_cv_lib_pthread_pthread_create+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpthread $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char pthread_create (); int main () { return pthread_create (); ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_pthread_pthread_create=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_pthread_pthread_create=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_pthread_pthread_create" >&5 echo "${ECHO_T}$ac_cv_lib_pthread_pthread_create" >&6; } if test $ac_cv_lib_pthread_pthread_create = yes; then LIBS="-lpthread $LIBS" else { echo "$as_me:$LINENO: checking for pthread_create in -lc_r" >&5 echo $ECHO_N "checking for pthread_create in -lc_r... $ECHO_C" >&6; } if test "${ac_cv_lib_c_r_pthread_create+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lc_r $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char pthread_create (); int main () { return pthread_create (); ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_c_r_pthread_create=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_c_r_pthread_create=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_c_r_pthread_create" >&5 echo "${ECHO_T}$ac_cv_lib_c_r_pthread_create" >&6; } if test $ac_cv_lib_c_r_pthread_create = yes; then LIBS="-lc_r $LIBS" else rlm_ldap_with_threads="no" fi fi fi smart_try_dir=$rlm_ldap_lib_dir if test "x$rlm_ldap_with_threads" = "xyes"; then sm_lib_safe=`echo "ldap_r" | sed 'y%./+-%__p_%'` sm_func_safe=`echo "ldap_init" | sed 'y%./+-%__p_%'` { echo "$as_me:$LINENO: checking for ldap_init in -lldap_r" >&5 echo $ECHO_N "checking for ldap_init in -lldap_r... $ECHO_C" >&6; } old_LIBS="$LIBS" smart_lib= smart_lib_dir= if test "x$smart_try_dir" != "x"; then for try in $smart_try_dir; do LIBS="-L$try -lldap_r $old_LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ extern char ldap_init(); int main () { ldap_init() ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then smart_lib="-L$try -lldap_r" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test "x$smart_lib" != "x"; then break; fi done LIBS="$old_LIBS" fi if test "x$smart_lib" = "x"; then LIBS="-lldap_r $old_LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ extern char ldap_init(); int main () { ldap_init() ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then smart_lib="-lldap_r" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS="$old_LIBS" fi if test "x$smart_lib" = "x"; then if test "x$LOCATE" != "x"; then DIRS= file=libldap_r${libltdl_cv_shlibext} for x in `${LOCATE} $file 2>/dev/null`; do base=`echo $x | sed "s%/${file}%%"` if test "x$x" = "x$base"; then continue; fi dir=`${DIRNAME} $x 2>/dev/null` exclude=`echo ${dir} | ${GREP} /home` if test "x$exclude" != "x"; then continue fi already=`echo \$smart_lib_dir ${DIRS} | ${GREP} ${dir}` if test "x$already" = "x"; then DIRS="$DIRS $dir" fi done fi eval "smart_lib_dir=\"\$smart_lib_dir $DIRS\"" if test "x$LOCATE" != "x"; then DIRS= file=libldap_r.a for x in `${LOCATE} $file 2>/dev/null`; do base=`echo $x | sed "s%/${file}%%"` if test "x$x" = "x$base"; then continue; fi dir=`${DIRNAME} $x 2>/dev/null` exclude=`echo ${dir} | ${GREP} /home` if test "x$exclude" != "x"; then continue fi already=`echo \$smart_lib_dir ${DIRS} | ${GREP} ${dir}` if test "x$already" = "x"; then DIRS="$DIRS $dir" fi done fi eval "smart_lib_dir=\"\$smart_lib_dir $DIRS\"" for try in $smart_lib_dir /usr/local/lib /opt/lib; do LIBS="-L$try -lldap_r $old_LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ extern char ldap_init(); int main () { ldap_init() ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then smart_lib="-L$try -lldap_r" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test "x$smart_lib" != "x"; then break; fi done LIBS="$old_LIBS" fi if test "x$smart_lib" != "x"; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } eval "ac_cv_lib_${sm_lib_safe}_${sm_func_safe}=yes" LIBS="$smart_lib $old_LIBS" SMART_LIBS="$smart_lib $SMART_LIBS" else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_cv_lib_ldap_r_ldap_init" != "xyes"; then fail="$fail libldap_r" fi else sm_lib_safe=`echo "ldap" | sed 'y%./+-%__p_%'` sm_func_safe=`echo "ldap_init" | sed 'y%./+-%__p_%'` { echo "$as_me:$LINENO: checking for ldap_init in -lldap" >&5 echo $ECHO_N "checking for ldap_init in -lldap... $ECHO_C" >&6; } old_LIBS="$LIBS" smart_lib= smart_lib_dir= if test "x$smart_try_dir" != "x"; then for try in $smart_try_dir; do LIBS="-L$try -lldap $old_LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ extern char ldap_init(); int main () { ldap_init() ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then smart_lib="-L$try -lldap" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test "x$smart_lib" != "x"; then break; fi done LIBS="$old_LIBS" fi if test "x$smart_lib" = "x"; then LIBS="-lldap $old_LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ extern char ldap_init(); int main () { ldap_init() ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then smart_lib="-lldap" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS="$old_LIBS" fi if test "x$smart_lib" = "x"; then if test "x$LOCATE" != "x"; then DIRS= file=libldap${libltdl_cv_shlibext} for x in `${LOCATE} $file 2>/dev/null`; do base=`echo $x | sed "s%/${file}%%"` if test "x$x" = "x$base"; then continue; fi dir=`${DIRNAME} $x 2>/dev/null` exclude=`echo ${dir} | ${GREP} /home` if test "x$exclude" != "x"; then continue fi already=`echo \$smart_lib_dir ${DIRS} | ${GREP} ${dir}` if test "x$already" = "x"; then DIRS="$DIRS $dir" fi done fi eval "smart_lib_dir=\"\$smart_lib_dir $DIRS\"" if test "x$LOCATE" != "x"; then DIRS= file=libldap.a for x in `${LOCATE} $file 2>/dev/null`; do base=`echo $x | sed "s%/${file}%%"` if test "x$x" = "x$base"; then continue; fi dir=`${DIRNAME} $x 2>/dev/null` exclude=`echo ${dir} | ${GREP} /home` if test "x$exclude" != "x"; then continue fi already=`echo \$smart_lib_dir ${DIRS} | ${GREP} ${dir}` if test "x$already" = "x"; then DIRS="$DIRS $dir" fi done fi eval "smart_lib_dir=\"\$smart_lib_dir $DIRS\"" for try in $smart_lib_dir /usr/local/lib /opt/lib; do LIBS="-L$try -lldap $old_LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ extern char ldap_init(); int main () { ldap_init() ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then smart_lib="-L$try -lldap" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test "x$smart_lib" != "x"; then break; fi done LIBS="$old_LIBS" fi if test "x$smart_lib" != "x"; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } eval "ac_cv_lib_${sm_lib_safe}_${sm_func_safe}=yes" LIBS="$smart_lib $old_LIBS" SMART_LIBS="$smart_lib $SMART_LIBS" else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_cv_lib_ldap_ldap_init" != "xyes"; then fail="$fail libldap" fi fi smart_try_dir=$rlm_ldap_include_dir ac_safe=`echo "ldap.h" | sed 'y%./+-%__pm%'` { echo "$as_me:$LINENO: checking for ldap.h" >&5 echo $ECHO_N "checking for ldap.h... $ECHO_C" >&6; } old_CFLAGS="$CFLAGS" smart_include= smart_include_dir= if test "x$smart_try_dir" != "x"; then for try in $smart_try_dir; do CFLAGS="$old_CFLAGS -I$try" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { int a = 1; ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then smart_include="-I$try" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 smart_include= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test "x$smart_include" != "x"; then break; fi done CFLAGS="$old_CFLAGS" fi if test "x$smart_include" = "x"; then cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { int a = 1; ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then smart_include=" " else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 smart_include= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test "x$smart_include" = "x"; then if test "x$LOCATE" != "x"; then DIRS= file=ldap.h for x in `${LOCATE} $file 2>/dev/null`; do base=`echo $x | sed "s%/${file}%%"` if test "x$x" = "x$base"; then continue; fi dir=`${DIRNAME} $x 2>/dev/null` exclude=`echo ${dir} | ${GREP} /home` if test "x$exclude" != "x"; then continue fi already=`echo \$smart_include_dir ${DIRS} | ${GREP} ${dir}` if test "x$already" = "x"; then DIRS="$DIRS $dir" fi done fi eval "smart_include_dir=\"\$smart_include_dir $DIRS\"" for try in $smart_include_dir /usr/local/include /opt/include; do CFLAGS="$old_CFLAGS -I$try" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { int a = 1; ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then smart_include="-I$try" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 smart_include= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test "x$smart_include" != "x"; then break; fi done CFLAGS="$old_CFLAGS" fi if test "x$smart_include" != "x"; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } eval "ac_cv_header_$ac_safe=yes" CFLAGS="$old_CFLAGS $smart_include" SMART_CFLAGS="$SMART_CFLAGS $smart_include" else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "$ac_cv_header_ldap_h" != "yes"; then fail="$fail ldap.h" fi if test "x$fail" = "x"; then { echo "$as_me:$LINENO: checking for ldap_start_tls_s" >&5 echo $ECHO_N "checking for ldap_start_tls_s... $ECHO_C" >&6; } if test "${ac_cv_func_ldap_start_tls_s+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define ldap_start_tls_s to an innocuous variant, in case declares ldap_start_tls_s. For example, HP-UX 11i declares gettimeofday. */ #define ldap_start_tls_s innocuous_ldap_start_tls_s /* System header to define __stub macros and hopefully few prototypes, which can conflict with char ldap_start_tls_s (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef ldap_start_tls_s /* 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 ldap_start_tls_s (); /* 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_ldap_start_tls_s || defined __stub___ldap_start_tls_s choke me #endif int main () { return ldap_start_tls_s (); ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_func_ldap_start_tls_s=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_ldap_start_tls_s=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_func_ldap_start_tls_s" >&5 echo "${ECHO_T}$ac_cv_func_ldap_start_tls_s" >&6; } if test $ac_cv_func_ldap_start_tls_s = yes; then SMART_CFLAGS="$SMART_CFLAGS -DHAVE_LDAP_START_TLS" fi { echo "$as_me:$LINENO: checking for ldap_initialize" >&5 echo $ECHO_N "checking for ldap_initialize... $ECHO_C" >&6; } if test "${ac_cv_func_ldap_initialize+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define ldap_initialize to an innocuous variant, in case declares ldap_initialize. For example, HP-UX 11i declares gettimeofday. */ #define ldap_initialize innocuous_ldap_initialize /* System header to define __stub macros and hopefully few prototypes, which can conflict with char ldap_initialize (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef ldap_initialize /* 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 ldap_initialize (); /* 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_ldap_initialize || defined __stub___ldap_initialize choke me #endif int main () { return ldap_initialize (); ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_func_ldap_initialize=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_ldap_initialize=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_func_ldap_initialize" >&5 echo "${ECHO_T}$ac_cv_func_ldap_initialize" >&6; } if test $ac_cv_func_ldap_initialize = yes; then SMART_CFLAGS="$SMART_CFLAGS -DHAVE_LDAP_INITIALIZE" fi { echo "$as_me:$LINENO: checking for ldap_int_tls_config" >&5 echo $ECHO_N "checking for ldap_int_tls_config... $ECHO_C" >&6; } if test "${ac_cv_func_ldap_int_tls_config+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define ldap_int_tls_config to an innocuous variant, in case declares ldap_int_tls_config. For example, HP-UX 11i declares gettimeofday. */ #define ldap_int_tls_config innocuous_ldap_int_tls_config /* System header to define __stub macros and hopefully few prototypes, which can conflict with char ldap_int_tls_config (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef ldap_int_tls_config /* 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 ldap_int_tls_config (); /* 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_ldap_int_tls_config || defined __stub___ldap_int_tls_config choke me #endif int main () { return ldap_int_tls_config (); ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_func_ldap_int_tls_config=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_ldap_int_tls_config=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_func_ldap_int_tls_config" >&5 echo "${ECHO_T}$ac_cv_func_ldap_int_tls_config" >&6; } if test $ac_cv_func_ldap_int_tls_config = yes; then SMART_CFLAGS="$SMART_CFLAGS -DHAVE_LDAP_INT_TLS_CONFIG" fi for ac_func in ldap_set_rebind_proc do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* 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 $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$ac_func || defined __stub___$ac_func choke me #endif int main () { return $ac_func (); ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_var'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done { echo "$as_me:$LINENO: checking whether ldap_set_rebind_proc takes 3 arguments" >&5 echo $ECHO_N "checking whether ldap_set_rebind_proc takes 3 arguments... $ECHO_C" >&6; } if test "${ac_cv_ldap_set_rebind_proc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { ldap_set_rebind_proc(0, 0, 0); ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_ldap_set_rebind_proc=3 else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_ldap_set_rebind_proc=2 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_ldap_set_rebind_proc" >&5 echo "${ECHO_T}$ac_cv_ldap_set_rebind_proc" >&6; } fi targetname=rlm_ldap else targetname= echo \*\*\* module rlm_ldap is disabled. fi if test x"$fail" != x""; then if test x"${enable_strict_dependencies}" = x"yes"; then { { echo "$as_me:$LINENO: error: set --without-rlm_ldap to disable it explicitly." >&5 echo "$as_me: error: set --without-rlm_ldap to disable it explicitly." >&2;} { (exit 1); exit 1; }; } else { echo "$as_me:$LINENO: WARNING: silently not building rlm_ldap." >&5 echo "$as_me: WARNING: silently not building rlm_ldap." >&2;} { echo "$as_me:$LINENO: WARNING: FAILURE: rlm_ldap requires: $fail." >&5 echo "$as_me: WARNING: FAILURE: rlm_ldap requires: $fail." >&2;} if test x"$headersuggestion" != x; then { echo "$as_me:$LINENO: WARNING: $headersuggestion" >&5 echo "$as_me: WARNING: $headersuggestion" >&2;} fi if test x"$libsuggestion" != x; then { echo "$as_me:$LINENO: WARNING: $libsuggestion" >&5 echo "$as_me: WARNING: $libsuggestion" >&2;} fi targetname="" fi fi WITH_EDIRECTORY=no # Check whether --with-edir was given. if test "${with_edir+set}" = set; then withval=$with_edir; case "$withval" in yes) SMART_CFLAGS="$SMART_CFLAGS -DNOVELL_UNIVERSAL_PASSWORD -DNOVELL" edir="edir_ldapext.c" ;; *) ;; esac fi ldap_ldflags=$SMART_LIBS ldap_cflags="$SMART_CFLAGS -DLDAP_DEPRECATED -DLDAP_SET_REBIND_PROC_ARGS=$ac_cv_ldap_set_rebind_proc" unset ac_cv_env_LIBS_set unset ac_cv_env_LIBS_value ac_config_files="$ac_config_files 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_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( *) $as_unset $ac_var ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then test "x$cache_file" != "x/dev/null" && { echo "$as_me:$LINENO: updating cache $cache_file" >&5 echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 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}' # Transform confdefs.h into DEFS. # Protect against shell expansion while executing Makefile rules. # Protect against Makefile macro expansion. # # If the first sed substitution is executed (which looks for macros that # take arguments), then branch to the quote section. Otherwise, # look for a macro that doesn't take arguments. ac_script=' t clear :clear s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g t quote s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g t quote b any :quote s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g s/\[/\\&/g s/\]/\\&/g s/\$/$$/g H :any ${ g s/^\n// s/\n/ /g p } ' DEFS=`sed -n "$ac_script" confdefs.h` ac_libobjs= ac_ltlibobjs= 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=`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. ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs : ${CONFIG_STATUS=./config.status} ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >$CONFIG_STATUS <<_ACEOF #! $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} _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ## --------------------- ## ## 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=: # 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 # PATH needs CR # 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 # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false 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.) as_nl=' ' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. 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 # Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # CDPATH. $as_unset CDPATH as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, and appends # trailing '-' during substitution so that $LINENO is not a special # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # scripts with optimization help from Paolo Bonzini. 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" || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi 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 fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi 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=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 # Save the log message, to keep $[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by $as_me, which was generated by GNU Autoconf 2.61. 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 cat >>$CONFIG_STATUS <<_ACEOF # Files that config.status was made for. config_files="$ac_config_files" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit -q, --quiet 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 Configuration files: $config_files Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ config.status configured by $0, generated by GNU Autoconf 2.61, with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" Copyright (C) 2006 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' _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # If no file are specified by the user, then we need to provide default # value. By we need to know if files were specified by the user. 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=$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 ) echo "$ac_cs_version"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift CONFIG_FILES="$CONFIG_FILES $ac_optarg" ac_need_defaults=false;; --he | --h | --help | --hel | -h ) 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. -*) { echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *) ac_config_targets="$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 if \$ac_cs_recheck; then echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 CONFIG_SHELL=$SHELL export CONFIG_SHELL exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; 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 fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= trap 'exit_status=$? { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status ' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || { echo "$me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } # # Set up the sed scripts for CONFIG_FILES section. # # No need to generate the scripts if there are no CONFIG_FILES. # This happens for instance when ./config.status config.h if test -n "$CONFIG_FILES"; then _ACEOF ac_delim='%!_!# ' for ac_last_try in false false false false false :; do cat >conf$$subs.sed <<_ACEOF SHELL!$SHELL$ac_delim PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim PACKAGE_NAME!$PACKAGE_NAME$ac_delim PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim PACKAGE_STRING!$PACKAGE_STRING$ac_delim PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim exec_prefix!$exec_prefix$ac_delim prefix!$prefix$ac_delim program_transform_name!$program_transform_name$ac_delim bindir!$bindir$ac_delim sbindir!$sbindir$ac_delim libexecdir!$libexecdir$ac_delim datarootdir!$datarootdir$ac_delim datadir!$datadir$ac_delim sysconfdir!$sysconfdir$ac_delim sharedstatedir!$sharedstatedir$ac_delim localstatedir!$localstatedir$ac_delim includedir!$includedir$ac_delim oldincludedir!$oldincludedir$ac_delim docdir!$docdir$ac_delim infodir!$infodir$ac_delim htmldir!$htmldir$ac_delim dvidir!$dvidir$ac_delim pdfdir!$pdfdir$ac_delim psdir!$psdir$ac_delim libdir!$libdir$ac_delim localedir!$localedir$ac_delim mandir!$mandir$ac_delim DEFS!$DEFS$ac_delim ECHO_C!$ECHO_C$ac_delim ECHO_N!$ECHO_N$ac_delim ECHO_T!$ECHO_T$ac_delim LIBS!$LIBS$ac_delim build_alias!$build_alias$ac_delim host_alias!$host_alias$ac_delim target_alias!$target_alias$ac_delim CC!$CC$ac_delim CFLAGS!$CFLAGS$ac_delim LDFLAGS!$LDFLAGS$ac_delim CPPFLAGS!$CPPFLAGS$ac_delim ac_ct_CC!$ac_ct_CC$ac_delim EXEEXT!$EXEEXT$ac_delim OBJEXT!$OBJEXT$ac_delim edir!$edir$ac_delim ldap_ldflags!$ldap_ldflags$ac_delim ldap_cflags!$ldap_cflags$ac_delim targetname!$targetname$ac_delim LIBOBJS!$LIBOBJS$ac_delim LTLIBOBJS!$LTLIBOBJS$ac_delim _ACEOF if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 50; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` if test -n "$ac_eof"; then ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` ac_eof=`expr $ac_eof + 1` fi cat >>$CONFIG_STATUS <<_ACEOF cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof /@[a-zA-Z_][a-zA-Z_0-9]*@/!b end _ACEOF sed ' s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g s/^/s,@/; s/!/@,|#_!!_#|/ :n t n s/'"$ac_delim"'$/,g/; t s/$/\\/; p N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n ' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF :end s/|#_!!_#|//g CEOF$ac_eof _ACEOF # VPATH may cause trouble with some makes, so we remove $(srcdir), # ${srcdir} and @srcdir@ 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[ ]*=/{ s/:*\$(srcdir):*/:/ s/:*\${srcdir}:*/:/ s/:*@srcdir@:*/:/ s/^\([^=]*=[ ]*\):*/\1/ s/:*$// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF fi # test -n "$CONFIG_FILES" for ac_tag in :F $CONFIG_FILES do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5 echo "$as_me: error: Invalid tag $ac_tag." >&2;} { (exit 1); exit 1; }; };; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 echo "$as_me: error: cannot find input file: $ac_f" >&2;} { (exit 1); exit 1; }; };; esac ac_file_inputs="$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 "`IFS=: echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure." if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { echo "$as_me:$LINENO: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} fi case $ac_tag in *:-:* | *:-) cat >"$tmp/stdin";; 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 || 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" case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`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 || 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" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 echo "$as_me: error: cannot create directory $as_dir" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`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 # _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # 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= case `sed -n '/datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p ' $ac_file_inputs` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF 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 sed "$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s&@configure_input@&$configure_input&;t t s&@top_builddir@&$ac_top_builddir_sub&;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 $ac_datarootdir_hack " $ac_file_inputs | sed -f "$tmp/subs-1.sed" >$tmp/out test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&5 echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&2;} rm -f "$tmp/stdin" case $ac_file in -) cat "$tmp/out"; rm -f "$tmp/out";; *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;; esac ;; esac done # for ac_tag { (exit 0); exit 0; } _ACEOF chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save # 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 || { (exit 1); exit 1; } fi freeradius-server/src/modules/rlm_ldap/configure.in000066400000000000000000000116531257552170400230730ustar00rootroot00000000000000AC_PREREQ([2.53]) AC_INIT(rlm_ldap.c) AC_REVISION($Revision$) AC_DEFUN(modname,[rlm_ldap]) fail= SMART_LIBS= SMART_CLFAGS= if test x$with_[]modname != xno; then dnl ############################################################ dnl # Check for compiler dnl ############################################################ AC_PROG_CC dnl ############################################################ dnl # Check for command line options dnl ############################################################ dnl extra argument: --with-rlm-ldap-lib-dir rlm_ldap_lib_dir= AC_ARG_WITH(rlm-ldap-lib-dir, [ --with-rlm-ldap-lib-dir=DIR directory for LDAP library files []], [ case "$withval" in no) AC_MSG_ERROR(Need rlm-ldap-lib-dir) ;; yes) ;; *) rlm_ldap_lib_dir="$withval" ;; esac ] ) dnl extra argument: --with-rlm-ldap-include-dir rlm_ldap_include_dir= AC_ARG_WITH(rlm-ldap-include-dir, [ --with-rlm-ldap-include-dir=DIR directory for LDAP include files []], [ case "$withval" in no) AC_MSG_ERROR(Need rlm-ldap-include-dir) ;; yes) ;; *) rlm_ldap_include_dir="$withval" ;; esac ] ) dnl extra argument: --enable-shared --disable-shared AC_ENABLE_SHARED dnl OpenLDAP doesn't provide an autoconf test for their libldap, dnl and we can't reasonably check for all the dependancies for dnl every version and every set of options. if test "x$enable_shared" = "xno"; then AC_MSG_WARN(Static linking with libldap will probably result in unresolved symbols.) fi dnl extra argument: --with-threads rlm_ldap_with_threads=yes AC_ARG_WITH(threads, [ --with-threads use threads, if available. (default=yes) ], [ case "$withval" in no) rlm_ldap_with_threads=no ;; *) ;; esac ]) dnl ############################################################ dnl # Check for libraries dnl ############################################################ dnl pthread stuff is usually in -lpthread dnl or in -lc_r, on *BSD if test "x$rlm_ldap_with_threads" = "xyes"; then AC_CHECK_LIB(pthread, pthread_create, [ LIBS="-lpthread $LIBS" ], AC_CHECK_LIB(c_r, pthread_create, [ LIBS="-lc_r $LIBS" ], [ rlm_ldap_with_threads="no" ] ) ) fi dnl Try only "-lldap_r" or "-lldap" dnl Static linking will probably not work, but nobody ever dnl complained about it. smart_try_dir=$rlm_ldap_lib_dir if test "x$rlm_ldap_with_threads" = "xyes"; then FR_SMART_CHECK_LIB(ldap_r, ldap_init) if test "x$ac_cv_lib_ldap_r_ldap_init" != "xyes"; then fail="$fail libldap_r" fi else FR_SMART_CHECK_LIB(ldap, ldap_init) if test "x$ac_cv_lib_ldap_ldap_init" != "xyes"; then fail="$fail libldap" fi fi dnl ############################################################ dnl # Check for header files dnl ############################################################ smart_try_dir=$rlm_ldap_include_dir FR_SMART_CHECK_INCLUDE(ldap.h) if test "$ac_cv_header_ldap_h" != "yes"; then fail="$fail ldap.h" fi dnl ############################################################ dnl # Check for library functions dnl ############################################################ if test "x$fail" = "x"; then AC_CHECK_FUNC(ldap_start_tls_s, [ SMART_CFLAGS="$SMART_CFLAGS -DHAVE_LDAP_START_TLS" ]) AC_CHECK_FUNC(ldap_initialize, [ SMART_CFLAGS="$SMART_CFLAGS -DHAVE_LDAP_INITIALIZE" ]) AC_CHECK_FUNC(ldap_int_tls_config, [ SMART_CFLAGS="$SMART_CFLAGS -DHAVE_LDAP_INT_TLS_CONFIG" ]) AC_CHECK_FUNCS(ldap_set_rebind_proc) AC_CACHE_CHECK(whether ldap_set_rebind_proc takes 3 arguments, ac_cv_ldap_set_rebind_proc, [ AC_TRY_COMPILE([ #include #include ], [ldap_set_rebind_proc(0, 0, 0);], [ac_cv_ldap_set_rebind_proc=3], [ac_cv_ldap_set_rebind_proc=2]) ]) fi targetname=modname else targetname= echo \*\*\* module modname is disabled. fi if test x"$fail" != x""; then if test x"${enable_strict_dependencies}" = x"yes"; then AC_MSG_ERROR([set --without-]modname[ to disable it explicitly.]) else AC_MSG_WARN([silently not building ]modname[.]) AC_MSG_WARN([FAILURE: ]modname[ requires: $fail.]) if test x"$headersuggestion" != x; then AC_MSG_WARN([$headersuggestion]) fi if test x"$libsuggestion" != x; then AC_MSG_WARN([$libsuggestion]) fi targetname="" fi fi dnl extra argument: --with-edir dnl If using Novell eDirectory, enable UP and Novell specific code WITH_EDIRECTORY=no AC_ARG_WITH(edir, [ --with-edir enable Novell eDirectory integration. (default=no) ], [ case "$withval" in yes) SMART_CFLAGS="$SMART_CFLAGS -DNOVELL_UNIVERSAL_PASSWORD -DNOVELL" edir="edir_ldapext.c" ;; *) ;; esac ] ) ldap_ldflags=$SMART_LIBS ldap_cflags="$SMART_CFLAGS -DLDAP_DEPRECATED -DLDAP_SET_REBIND_PROC_ARGS=$ac_cv_ldap_set_rebind_proc" AC_SUBST(edir) AC_SUBST(ldap_ldflags) AC_SUBST(ldap_cflags) AC_SUBST(targetname) AC_OUTPUT(Makefile) freeradius-server/src/modules/rlm_ldap/edir_ldapext.c000066400000000000000000000433701257552170400233730ustar00rootroot00000000000000/* * Copyright (C) 2002-2004 Novell, Inc. * * edir_ldapext.c LDAP extension for reading eDirectory universal password * * This program is free software; you can redistribute it and/or modify it * under the terms of version 2 of the GNU General Public License as published * by the Free Software Foundation. * * 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, contact Novell, Inc. * * To contact Novell about this file by physical or electronic mail, you may * find current contact information at www.novell.com. * * Copyright 2006 The FreeRADIUS Server Project. */ #include RCSID("$Id$") #include #include #include #include #include /* NMAS error codes */ #define NMAS_E_BASE (-1600) #define NMAS_SUCCESS 0 #define NMAS_E_SUCCESS NMAS_SUCCESS /* Alias */ #define NMAS_OK NMAS_SUCCESS /* Alias */ #define NMAS_E_FRAG_FAILURE (NMAS_E_BASE-31) /* -1631 0xFFFFF9A1 */ #define NMAS_E_BUFFER_OVERFLOW (NMAS_E_BASE-33) /* -1633 0xFFFFF99F */ #define NMAS_E_SYSTEM_RESOURCES (NMAS_E_BASE-34) /* -1634 0xFFFFF99E */ #define NMAS_E_INSUFFICIENT_MEMORY (NMAS_E_BASE-35) /* -1635 0xFFFFF99D */ #define NMAS_E_NOT_SUPPORTED (NMAS_E_BASE-36) /* -1636 0xFFFFF99C */ #define NMAS_E_INVALID_PARAMETER (NMAS_E_BASE-43) /* -1643 0xFFFFF995 */ #define NMAS_E_INVALID_VERSION (NMAS_E_BASE-52) /* -1652 0xFFFFF98C */ /* OID of LDAP extenstion calls to read Universal Password */ #define NMASLDAP_GET_PASSWORD_REQUEST "2.16.840.1.113719.1.39.42.100.13" #define NMASLDAP_GET_PASSWORD_RESPONSE "2.16.840.1.113719.1.39.42.100.14" #define NMAS_LDAP_EXT_VERSION 1 /* OID of LDAP extension call to perform NMAS authentication */ #define RADAUTH_OID_NMAS_AUTH_REQUEST "2.16.840.1.113719.1.510.100.1" #define RADAUTH_OID_NMAS_AUTH_REPLY "2.16.840.1.113719.1.510.100.2" #define RADAUTH_LDAP_EXT_VERSION 1 #define REQUEST_CHALLENGED 1 /* ------------------------------------------------------------------------ * berEncodePasswordData * ============================== * RequestBer contents: * clientVersion INTEGER * targetObjectDN OCTET STRING * password1 OCTET STRING * password2 OCTET STRING * * Description: * This function takes the request BER value and input data items * and BER encodes the data into the BER value * * ------------------------------------------------------------------------ */ int berEncodePasswordData( struct berval **requestBV, char *objectDN, char *password, char *password2) { int err = 0, rc=0; BerElement *requestBer = NULL; char * utf8ObjPtr = NULL; int utf8ObjSize = 0; char * utf8PwdPtr = NULL; int utf8PwdSize = 0; char * utf8Pwd2Ptr = NULL; int utf8Pwd2Size = 0; utf8ObjSize = strlen(objectDN)+1; utf8ObjPtr = objectDN; if (password != NULL) { utf8PwdSize = strlen(password)+1; utf8PwdPtr = password; } if (password2 != NULL) { utf8Pwd2Size = strlen(password2)+1; utf8Pwd2Ptr = password2; } /* Allocate a BerElement for the request parameters.*/ if((requestBer = ber_alloc()) == NULL) { err = NMAS_E_FRAG_FAILURE; goto Cleanup; } if (password != NULL && password2 != NULL) { /* BER encode the NMAS Version, the objectDN, and the password */ rc = ber_printf(requestBer, "{iooo}", NMAS_LDAP_EXT_VERSION, utf8ObjPtr, utf8ObjSize, utf8PwdPtr, utf8PwdSize, utf8Pwd2Ptr, utf8Pwd2Size); } else if (password != NULL) { /* BER encode the NMAS Version, the objectDN, and the password */ rc = ber_printf(requestBer, "{ioo}", NMAS_LDAP_EXT_VERSION, utf8ObjPtr, utf8ObjSize, utf8PwdPtr, utf8PwdSize); } else { /* BER encode the NMAS Version and the objectDN */ rc = ber_printf(requestBer, "{io}", NMAS_LDAP_EXT_VERSION, utf8ObjPtr, utf8ObjSize); } if (rc < 0) { err = NMAS_E_FRAG_FAILURE; goto Cleanup; } else { err = 0; } /* * Convert the BER we just built to a berval that we'll send with the extended request. */ if(ber_flatten(requestBer, requestBV) == LBER_ERROR) { err = NMAS_E_FRAG_FAILURE; goto Cleanup; } Cleanup: if(requestBer) { ber_free(requestBer, 1); } return err; } /* End of berEncodePasswordData */ /* ------------------------------------------------------------------------ * berDecodeLoginData() * ============================== * ResponseBer contents: * serverVersion INTEGER * error INTEGER * data OCTET STRING * * Description: * This function takes the reply BER Value and decodes the * NMAS server version and return code and if a non null retData * buffer was supplied, tries to decode the the return data and length * * ------------------------------------------------------------------------ */ int berDecodeLoginData( struct berval *replyBV, int *serverVersion, size_t *retDataLen, void *retData ) { int rc=0, err = 0; BerElement *replyBer = NULL; char *retOctStr = NULL; size_t retOctStrLen = 0; if((replyBer = ber_init(replyBV)) == NULL) { err = NMAS_E_SYSTEM_RESOURCES; goto Cleanup; } if(retData) { retOctStrLen = *retDataLen + 1; retOctStr = (char *)malloc(retOctStrLen); if(!retOctStr) { err = NMAS_E_SYSTEM_RESOURCES; goto Cleanup; } if( (rc = ber_scanf(replyBer, "{iis}", serverVersion, &err, retOctStr, &retOctStrLen)) != -1) { if (*retDataLen >= retOctStrLen) { memcpy(retData, retOctStr, retOctStrLen); } else if (!err) { err = NMAS_E_BUFFER_OVERFLOW; } *retDataLen = retOctStrLen; } else if (!err) { err = NMAS_E_FRAG_FAILURE; } } else { if( (rc = ber_scanf(replyBer, "{ii}", serverVersion, &err)) == -1) { if (!err) { err = NMAS_E_FRAG_FAILURE; } } } Cleanup: if(replyBer) { ber_free(replyBer, 1); } if (retOctStr != NULL) { memset(retOctStr, 0, retOctStrLen); free(retOctStr); } return err; } /* End of berDecodeLoginData */ /* ----------------------------------------------------------------------- * nmasldap_get_password() * ============================== * * Description: * This API attempts to get the universal password * * ------------------------------------------------------------------------ */ int nmasldap_get_password( LDAP *ld, char *objectDN, size_t *pwdSize, // in bytes char *pwd ) { int err = 0; struct berval *requestBV = NULL; char *replyOID = NULL; struct berval *replyBV = NULL; int serverVersion; char *pwdBuf; size_t pwdBufLen, bufferLen; #ifdef NOT_N_PLAT_NLM int currentThreadGroupID; #endif /* Validate char parameters. */ if(objectDN == NULL || (strlen(objectDN) == 0) || pwdSize == NULL || ld == NULL) { return NMAS_E_INVALID_PARAMETER; } bufferLen = pwdBufLen = *pwdSize; pwdBuf = (char *)malloc(pwdBufLen+2); if(pwdBuf == NULL) { return NMAS_E_INSUFFICIENT_MEMORY; } #ifdef NOT_N_PLAT_NLM currentThreadGroupID = SetThreadGroupID(nmasLDAPThreadGroupID); #endif err = berEncodePasswordData(&requestBV, objectDN, NULL, NULL); if(err) { goto Cleanup; } /* Call the ldap_extended_operation (synchronously) */ if((err = ldap_extended_operation_s(ld, NMASLDAP_GET_PASSWORD_REQUEST, requestBV, NULL, NULL, &replyOID, &replyBV))) { goto Cleanup; } /* Make sure there is a return OID */ if(!replyOID) { err = NMAS_E_NOT_SUPPORTED; goto Cleanup; } /* Is this what we were expecting to get back. */ if(strcmp(replyOID, NMASLDAP_GET_PASSWORD_RESPONSE)) { err = NMAS_E_NOT_SUPPORTED; goto Cleanup; } /* Do we have a good returned berval? */ if(!replyBV) { /* * No; returned berval means we experienced a rather drastic error. * Return operations error. */ err = NMAS_E_SYSTEM_RESOURCES; goto Cleanup; } err = berDecodeLoginData(replyBV, &serverVersion, &pwdBufLen, pwdBuf); if(serverVersion != NMAS_LDAP_EXT_VERSION) { err = NMAS_E_INVALID_VERSION; goto Cleanup; } if (!err && pwdBufLen != 0) { if (*pwdSize >= pwdBufLen+1 && pwd != NULL) { memcpy(pwd, pwdBuf, pwdBufLen); pwd[pwdBufLen] = 0; /* add null termination */ } *pwdSize = pwdBufLen; /* does not include null termination */ } Cleanup: if(replyBV) { ber_bvfree(replyBV); } /* Free the return OID string if one was returned. */ if(replyOID) { ldap_memfree(replyOID); } /* Free memory allocated while building the request ber and berval. */ if(requestBV) { ber_bvfree(requestBV); } if (pwdBuf != NULL) { memset(pwdBuf, 0, bufferLen); free(pwdBuf); } #ifdef NOT_N_PLAT_NLM SetThreadGroupID(currentThreadGroupID); #endif /* Return the appropriate error/success code. */ return err; } /* end of nmasldap_get_password */ /* ------------------------------------------------------------------------ * berEncodeAuthData * ============================== * RequestBer contents: * targetObjectDN OCTET STRING * pwd OCTET STRING * NasIP OCTET STRING * stete OCTET STRING * * Description: * This function takes the request BER value and input data items * and BER encodes the data into the BER value * * ------------------------------------------------------------------------ */ int berEncodeAuthData( struct berval **requestBV, char *objectDN, char *pwd, char *sequence, char *NasIP, char *state, int *auth_state) { int err = 0, rc=0; BerElement *requestBer = NULL; char * utf8ObjPtr = NULL; int utf8ObjSize = 0; char * utf8PwdPtr = NULL; int utf8PwdSize = 0; char * utf8NasIPPtr = NULL; int utf8NasIPSize = 0; char * utf8StatePtr = NULL; int utf8StateSize = 0; char * utf8SeqPtr = NULL; int utf8SeqSize = 0; int state_present = 0; utf8ObjSize = strlen(objectDN)+1; utf8ObjPtr = objectDN; utf8PwdSize = strlen(pwd); utf8PwdPtr = pwd; utf8SeqSize = strlen(sequence)+1; utf8SeqPtr = sequence; utf8NasIPSize = strlen(NasIP)+1; utf8NasIPPtr = NasIP; /* Allocate a BerElement for the request parameters.*/ if((requestBer = ber_alloc()) == NULL) { err = NMAS_E_FRAG_FAILURE; goto Cleanup; } /* BER encode the NMAS Version, the objectDN, and the password */ rc = ber_printf(requestBer, "{i", RADAUTH_LDAP_EXT_VERSION); rc = ber_printf(requestBer, "o", utf8ObjPtr, utf8ObjSize); rc = ber_printf(requestBer, "o", utf8PwdPtr, utf8PwdSize); rc = ber_printf(requestBer, "o", utf8SeqPtr, utf8SeqSize); rc = ber_printf(requestBer, "o", utf8NasIPPtr, utf8NasIPSize); if( *auth_state == -2) { utf8StateSize = strlen(state)+1; utf8StatePtr = state; state_present = 1; rc = ber_printf(requestBer, "io}", state_present, utf8StatePtr, utf8StateSize); } else { rc = ber_printf(requestBer, "i}", state_present); } if (rc < 0) { err = NMAS_E_FRAG_FAILURE; goto Cleanup; } else { err = 0; } /* * Convert the BER we just built to a berval that we'll send with the extended request. */ if(ber_flatten(requestBer, requestBV) == -1) { err = NMAS_E_FRAG_FAILURE; goto Cleanup; } Cleanup: if(requestBer) { ber_free(requestBer, 1); } return err; } /* End of berEncodeAuthData */ /* ------------------------------------------------------------------------ * berDecodeAuthData() * ============================== * ResponseBer contents: * serverVersion INTEGER * auth_state INTEGER * challenge_data OCTET STRING * * Description: * This function takes the reply BER Value and decodes the * server version and return code and if a non null retData * buffer was supplied, tries to decode the the return data and length * * ------------------------------------------------------------------------ */ int berDecodeAuthData( struct berval *replyBV, int *errCode, size_t *retDataLen, char *retData, int *auth_state ) { int rc=0, err = 0; BerElement *replyBer = NULL; struct berval challenge = {0}; if((replyBer = ber_init(replyBV)) == NULL) { err = NMAS_E_SYSTEM_RESOURCES; // fix err code goto Cleanup; } if( (rc = ber_scanf(replyBer, "{ii", errCode, auth_state)) != -1) { if ( *auth_state != REQUEST_CHALLENGED ) { if( (rc = ber_scanf(replyBer, "}")) != -1) return err; } else { if( (rc = ber_scanf(replyBer, "o}", &challenge)) != -1) { if (*retDataLen >= challenge.bv_len) { memcpy(retData, challenge.bv_val, challenge.bv_len); } *retDataLen = challenge.bv_len; } } } Cleanup: if(replyBer) { ber_free(replyBer, 1); } return err; }/* End of berDecodeLoginData */ /* ----------------------------------------------------------------------- * radLdapXtnNMASAuth() * ============================== * * Description: * This API attempts to perform NMAS authentication. * * ------------------------------------------------------------------------ */ int radLdapXtnNMASAuth( LDAP *ld, char *objectDN, char *pwd, char *sequence, char *NasIPaddr, size_t *statesize, char *state, int *auth_state ) { int err = 0; struct berval *requestBV = NULL; char *replyOID = NULL; struct berval *replyBV = NULL; int errCode; char *challenge; size_t challengesize; challengesize = *statesize; challenge = (char *)malloc(challengesize+2); if(challenge == NULL) { return NMAS_E_INSUFFICIENT_MEMORY; } /* Validate char parameters. */ if(objectDN == NULL || (strlen(objectDN) == 0) || statesize == NULL || NasIPaddr == NULL || ld == NULL) { return NMAS_E_INVALID_PARAMETER; } err = berEncodeAuthData(&requestBV, objectDN, pwd, sequence, NasIPaddr, state, auth_state); if(err) { goto Cleanup; } /* Call the ldap_extended_operation (synchronously) */ if((err = ldap_extended_operation_s(ld, RADAUTH_OID_NMAS_AUTH_REQUEST, requestBV, NULL, NULL, &replyOID, &replyBV))!=0) { goto Cleanup; } /* Make sure there is a return OID */ if(!replyOID) { err = NMAS_E_NOT_SUPPORTED; // change error values goto Cleanup; } /* Is this what we were expecting to get back. */ if(strcmp(replyOID, RADAUTH_OID_NMAS_AUTH_REPLY)) { err = NMAS_E_NOT_SUPPORTED; // change return value goto Cleanup; } /* Do we have a good returned berval? */ if(!replyBV) { /* * No; returned berval means we experienced a rather drastic error. * Return operations error. */ err = NMAS_E_SYSTEM_RESOURCES; //change return value goto Cleanup; } err = berDecodeAuthData(replyBV, &errCode, &challengesize, challenge, auth_state); /* errCode return error in case of AUTH-REJECT */ if (!err && challengesize!= 0) { if (*statesize >= challengesize+1 && challenge != NULL) { memcpy(state, challenge, challengesize); state[challengesize] = 0; /* add null termination */ } *statesize = challengesize; /* does not include null termination */ } Cleanup: /* Free memory allocated for challenge */ if(challenge) { free(challenge); } if(replyBV) { ber_bvfree(replyBV); } /* Free the return OID string if one was returned. */ if(replyOID) { ldap_memfree(replyOID); } /* Free memory allocated while building the request ber and berval. */ if(requestBV) { ber_bvfree(requestBV); } #ifdef NOT_N_PLAT_NLM SetThreadGroupID(currentThreadGroupID); #endif /* Return the appropriate error/success code. */ return err; }/* End of radLdapXtnNMASAuth */ freeradius-server/src/modules/rlm_ldap/rlm_ldap.c000066400000000000000000002540011257552170400225140ustar00rootroot00000000000000/* * rlm_ldap.c LDAP authorization and authentication module. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2004,2006 The FreeRADIUS Server Project. */ #include RCSID("$Id$") #include #include #include #include #include #include #include #ifndef HAVE_PTHREAD_H /* * This is a lot simpler than putting ifdef's around * every use of the pthread functions. */ #define pthread_mutex_lock(a) #define pthread_mutex_trylock(a) (0) #define pthread_mutex_unlock(a) #define pthread_mutex_init(a,b) #define pthread_mutex_destroy(a) #else #include #endif #define MAX_FILTER_STR_LEN 1024 #define TIMELIMIT 5 /* * These are used in case ldap_search returns LDAP_SERVER_DOWN * In that case we do conn->failed_conns++ and then check it: * If conn->failed_conns <= MAX_FAILED_CONNS_START then we try * to reconnect * conn->failed_conns is also checked on entrance in perform_search: * If conn->failed_conns > MAX_FAILED_CONNS_START then we don't * try to do anything and we just do conn->failed_conns++ and * return RLM_MODULE_FAIL * if conn->failed_conns >= MAX_FAILED_CONNS_END then we give it * another chance and we set it to MAX_FAILED_CONNS_RESTART and * try to reconnect. * * * We are assuming that the majority of the LDAP_SERVER_DOWN cases * will either be an ldap connection timeout or a temporary ldap * server problem. * As a result we make a few attempts to reconnect hoping that the problem * will soon go away. If it does not go away then we just return * RLM_MODULE_FAIL on entrance in perform_search until conn->failed_conns * gets to MAX_FAILED_CONNS_END. After that we give it one more chance by * going back to MAX_FAILED_CONNS_RESTART * */ #define MAX_FAILED_CONNS_END 20 #define MAX_FAILED_CONNS_RESTART 4 #define MAX_FAILED_CONNS_START 5 #ifdef NOVELL_UNIVERSAL_PASSWORD /* Universal Password Length */ #define UNIVERSAL_PASS_LEN 256 int nmasldap_get_password( LDAP *ld, char *objectDN, size_t *pwdSize, /* in bytes */ char *pwd ); #endif #ifdef NOVELL #define REQUEST_ACCEPTED 0 #define REQUEST_CHALLENGED 1 #define REQUEST_REJECTED 2 #define MAX_CHALLENGE_LEN 128 int radLdapXtnNMASAuth( LDAP *, char *, char *, char *, char *, size_t *, char *, int * ); #endif /* linked list of mappings between RADIUS attributes and LDAP attributes */ struct TLDAP_RADIUS { char* attr; char* radius_attr; FR_TOKEN operator; struct TLDAP_RADIUS* next; }; typedef struct TLDAP_RADIUS TLDAP_RADIUS; typedef struct ldap_conn { LDAP *ld; char bound; char locked; int failed_conns; int uses; #ifdef HAVE_PTHREAD_H pthread_mutex_t mutex; #endif } LDAP_CONN; typedef struct { char *server; int port; int timelimit; int max_uses; int net_timeout; int timeout; int debug; int tls_mode; int start_tls; int num_conns; int do_comp; int do_xlat; int default_allow; int failed_conns; int is_url; int chase_referrals; int rebind; int expect_password; char *login; char *password; char *filter; char *base_filter; char *basedn; char *default_profile; char *profile_attr; char *access_attr; char *passwd_hdr; char *passwd_attr; int auto_header; char *dictionary_mapping; char *groupname_attr; char *groupmemb_filt; char *groupmemb_attr; char **atts; TLDAP_RADIUS *check_item_map; TLDAP_RADIUS *reply_item_map; LDAP_CONN *conns; #ifdef NOVELL LDAP_CONN *apc_conns; #endif int ldap_debug; /* Debug flag for LDAP SDK */ char *xlat_name; /* name used to xlat */ char *auth_type; char *tls_cacertfile; char *tls_cacertdir; char *tls_certfile; char *tls_keyfile; char *tls_randfile; char *tls_require_cert; #ifdef NOVELL int edir_account_policy_check; #endif int set_auth_type; /* * For keep-alives. */ #ifdef LDAP_OPT_X_KEEPALIVE_IDLE int keepalive_idle; #endif #ifdef LDAP_OPT_X_KEEPALIVE_PROBES int keepalive_probes; #endif #ifdef LDAP_OPT_ERROR_NUMBER int keepalive_interval; #endif } ldap_instance; /* The default setting for TLS Certificate Verification */ #define TLS_DEFAULT_VERIFY "allow" #if defined(LDAP_OPT_X_KEEPALIVE_IDLE) || defined(LDAP_OPT_X_KEEPALIVE_PROBES) || defined (LDAP_OPT_ERROR_NUMBER) static CONF_PARSER keepalive_config[] = { #ifdef LDAP_OPT_X_KEEPALIVE_IDLE {"idle", PW_TYPE_INTEGER, offsetof(ldap_instance,keepalive_idle), NULL, "60"}, #endif #ifdef LDAP_OPT_X_KEEPALIVE_PROBES {"probes", PW_TYPE_INTEGER, offsetof(ldap_instance,keepalive_probes), NULL, "3"}, #endif #ifdef LDAP_OPT_ERROR_NUMBER {"interval", PW_TYPE_INTEGER, offsetof(ldap_instance,keepalive_interval), NULL, "30"}, #endif { NULL, -1, 0, NULL, NULL } }; #endif /* KEEPALIVE */ static CONF_PARSER tls_config[] = { {"start_tls", PW_TYPE_BOOLEAN, offsetof(ldap_instance,start_tls), NULL, "no"}, {"cacertfile", PW_TYPE_FILENAME, offsetof(ldap_instance,tls_cacertfile), NULL, NULL}, {"cacertdir", PW_TYPE_FILENAME, offsetof(ldap_instance,tls_cacertdir), NULL, NULL}, {"certfile", PW_TYPE_FILENAME, offsetof(ldap_instance,tls_certfile), NULL, NULL}, {"keyfile", PW_TYPE_FILENAME, offsetof(ldap_instance,tls_keyfile), NULL, NULL}, {"randfile", PW_TYPE_STRING_PTR, /* OK if it changes on HUP */ offsetof(ldap_instance,tls_randfile), NULL, NULL}, {"require_cert", PW_TYPE_STRING_PTR, offsetof(ldap_instance,tls_require_cert), NULL, TLS_DEFAULT_VERIFY}, { NULL, -1, 0, NULL, NULL } }; static const CONF_PARSER module_config[] = { {"server", PW_TYPE_STRING_PTR, offsetof(ldap_instance,server), NULL, "localhost"}, {"port", PW_TYPE_INTEGER, offsetof(ldap_instance,port), NULL, "389"}, {"password", PW_TYPE_STRING_PTR, offsetof(ldap_instance,password), NULL, ""}, {"expect_password", PW_TYPE_BOOLEAN, offsetof(ldap_instance,expect_password), NULL, "yes"}, {"identity", PW_TYPE_STRING_PTR, offsetof(ldap_instance,login), NULL, ""}, /* * Timeouts & stuff. */ /* wait forever on network activity */ {"net_timeout", PW_TYPE_INTEGER, offsetof(ldap_instance,net_timeout), NULL, "10"}, /* wait forever for search results */ {"timeout", PW_TYPE_INTEGER, offsetof(ldap_instance,timeout), NULL, "20"}, /* allow server unlimited time for search (server-side limit) */ {"timelimit", PW_TYPE_INTEGER, offsetof(ldap_instance,timelimit), NULL, "20"}, /* how many times the connection can be used before being re-established */ {"max_uses", PW_TYPE_INTEGER, offsetof(ldap_instance,max_uses), NULL, "0"}, /* * TLS configuration The first few are here for backwards * compatibility. The last is the new subsection. */ {"tls_mode", PW_TYPE_BOOLEAN, offsetof(ldap_instance,tls_mode), NULL, "no"}, {"start_tls", PW_TYPE_BOOLEAN, offsetof(ldap_instance,start_tls), NULL, "no"}, {"tls_cacertfile", PW_TYPE_FILENAME, offsetof(ldap_instance,tls_cacertfile), NULL, NULL}, {"tls_cacertdir", PW_TYPE_FILENAME, offsetof(ldap_instance,tls_cacertdir), NULL, NULL}, {"tls_certfile", PW_TYPE_FILENAME, offsetof(ldap_instance,tls_certfile), NULL, NULL}, {"tls_keyfile", PW_TYPE_FILENAME, offsetof(ldap_instance,tls_keyfile), NULL, NULL}, {"tls_randfile", PW_TYPE_STRING_PTR, /* OK if it changes on HUP */ offsetof(ldap_instance,tls_randfile), NULL, NULL}, {"tls_require_cert", PW_TYPE_STRING_PTR, offsetof(ldap_instance,tls_require_cert), NULL, TLS_DEFAULT_VERIFY}, { "tls", PW_TYPE_SUBSECTION, 0, NULL, (const void *) tls_config }, /* * DN's and filters. */ {"basedn", PW_TYPE_STRING_PTR, offsetof(ldap_instance,basedn), NULL, NULL}, {"filter", PW_TYPE_STRING_PTR, offsetof(ldap_instance,filter), NULL, "(uid=%u)"}, {"base_filter", PW_TYPE_STRING_PTR, offsetof(ldap_instance,base_filter), NULL, "(objectclass=radiusprofile)"}, {"default_profile", PW_TYPE_STRING_PTR, offsetof(ldap_instance,default_profile), NULL, NULL}, {"profile_attribute", PW_TYPE_STRING_PTR, offsetof(ldap_instance,profile_attr), NULL, NULL}, /* * Getting passwords from the database */ {"password_header", PW_TYPE_STRING_PTR, offsetof(ldap_instance,passwd_hdr), NULL, NULL}, {"password_attribute", PW_TYPE_STRING_PTR, offsetof(ldap_instance,passwd_attr), NULL, NULL}, {"auto_header", PW_TYPE_BOOLEAN, offsetof(ldap_instance,auto_header), NULL, "no"}, /* * Access limitations */ /* LDAP attribute name that controls remote access */ {"access_attr", PW_TYPE_STRING_PTR, offsetof(ldap_instance,access_attr), NULL, NULL}, {"access_attr_used_for_allow", PW_TYPE_BOOLEAN, offsetof(ldap_instance,default_allow), NULL, "yes"}, {"chase_referrals", PW_TYPE_BOOLEAN, offsetof(ldap_instance,chase_referrals), NULL, NULL}, {"rebind", PW_TYPE_BOOLEAN, offsetof(ldap_instance,rebind), NULL, NULL}, /* * Group checks. These could probably be done * via dynamic xlat's. */ {"groupname_attribute", PW_TYPE_STRING_PTR, offsetof(ldap_instance,groupname_attr), NULL, "cn"}, {"groupmembership_filter", PW_TYPE_STRING_PTR, offsetof(ldap_instance,groupmemb_filt), NULL, "(|(&(objectClass=GroupOfNames)(member=%{Ldap-UserDn}))(&(objectClass=GroupOfUniqueNames)(uniquemember=%{Ldap-UserDn})))"}, {"groupmembership_attribute", PW_TYPE_STRING_PTR, offsetof(ldap_instance,groupmemb_attr), NULL, NULL}, /* file with mapping between LDAP and RADIUS attributes */ {"dictionary_mapping", PW_TYPE_FILENAME, offsetof(ldap_instance,dictionary_mapping), NULL, "${confdir}/ldap.attrmap"}, /* * Debugging flags to the server */ {"ldap_debug", PW_TYPE_INTEGER, offsetof(ldap_instance,ldap_debug), NULL, "0x0000"}, {"ldap_connections_number", PW_TYPE_INTEGER, offsetof(ldap_instance,num_conns), NULL, "5"}, {"compare_check_items", PW_TYPE_BOOLEAN, offsetof(ldap_instance,do_comp), NULL, "no"}, {"do_xlat", PW_TYPE_BOOLEAN, offsetof(ldap_instance,do_xlat), NULL, "yes"}, #ifdef NOVELL /* * Novell magic. */ {"edir_account_policy_check", PW_TYPE_BOOLEAN, offsetof(ldap_instance,edir_account_policy_check), NULL, "yes"}, #endif {"set_auth_type", PW_TYPE_BOOLEAN, offsetof(ldap_instance,set_auth_type), NULL, "yes"}, #if defined(LDAP_OPT_X_KEEPALIVE_IDLE) || defined(LDAP_OPT_X_KEEPALIVE_PROBES) || defined (LDAP_OPT_ERROR_NUMBER) { "keepalive", PW_TYPE_SUBSECTION, 0, NULL, (const void *) keepalive_config }, #endif {NULL, -1, 0, NULL, NULL} }; #define ld_valid ld_options.ldo_valid #define LDAP_VALID_SESSION 0x2 #define LDAP_VALID(ld) ( (ld)->ld_valid == LDAP_VALID_SESSION ) #ifdef FIELDCPY static void fieldcpy(char *, char **); #endif static VALUE_PAIR *ldap_pairget(LDAP *, LDAPMessage *, TLDAP_RADIUS *,VALUE_PAIR **,int, ldap_instance *); static int ldap_groupcmp(void *, REQUEST *, VALUE_PAIR *, VALUE_PAIR *, VALUE_PAIR *, VALUE_PAIR **); static size_t ldap_xlat(void *, REQUEST *, char *, char *, size_t, RADIUS_ESCAPE_STRING); static LDAP *ldap_connect(void *instance, const char *, const char *, int, int *, char **); static int read_mappings(ldap_instance* inst); static inline int ldap_get_conn(LDAP_CONN *conns,LDAP_CONN **ret, ldap_instance *inst) { register int i = 0; for(i=0;inum_conns;i++){ DEBUG(" [%s] ldap_get_conn: Checking Id: %d", inst->xlat_name, i); if ((pthread_mutex_trylock(&conns[i].mutex) == 0)) { if (conns[i].locked == 1) { /* connection is already being used */ pthread_mutex_unlock(&(conns[i].mutex)); continue; } /* found an unused connection */ *ret = &conns[i]; conns[i].uses++; conns[i].locked = 1; DEBUG(" [%s] ldap_get_conn: Got Id: %d", inst->xlat_name, i); return i; } } return -1; } static inline void ldap_release_conn(int i, ldap_instance *inst) { LDAP_CONN *conns = inst->conns; DEBUG(" [%s] ldap_release_conn: Release Id: %d", inst->xlat_name, i); if ((inst->max_uses > 0) && (conns[i].uses >= inst->max_uses)) { if (conns[i].ld){ DEBUG(" [%s] ldap_release_conn: Hit max usage limit, closing Id: %d", inst->xlat_name, i); ldap_unbind_s(conns[i].ld); conns[i].ld = NULL; } conns[i].bound = 0; conns[i].uses = 0; } conns[i].locked = 0; pthread_mutex_unlock(&(conns[i].mutex)); } #ifdef NOVELL static inline void ldap_release_apc_conn(int i, ldap_instance *inst) { LDAP_CONN *conns = inst->apc_conns; DEBUG(" [%s] ldap_release_conn: Release Id: %d", inst->xlat_name, i); conns[i].locked = 0; pthread_mutex_unlock(&(conns[i].mutex)); } #endif /************************************************************************* * * Function: rlm_ldap_instantiate * * Purpose: Uses section of radiusd config file passed as parameter * to create an instance of the module. * *************************************************************************/ static int ldap_instantiate(CONF_SECTION * conf, void **instance) { ldap_instance *inst; int i = 0; int atts_num = 0; int reply_map_num = 0; int check_map_num = 0; int att_map[3] = {0,0,0}; TLDAP_RADIUS *pair; ATTR_FLAGS flags; const char *xlat_name; inst = rad_malloc(sizeof *inst); if (!inst) { return -1; } memset(inst, 0, sizeof(*inst)); inst->chase_referrals = 2; /* use OpenLDAP defaults */ inst->rebind = 2; if (cf_section_parse(conf, inst, module_config) < 0) { free(inst); return -1; } if (inst->server == NULL) { radlog(L_ERR, "rlm_ldap: missing 'server' directive."); free(inst); /* FIXME: detach */ return -1; } inst->is_url = 0; if (ldap_is_ldap_url(inst->server)){ #ifdef HAVE_LDAP_INITIALIZE inst->is_url = 1; inst->port = 0; #else radlog(L_ERR, "rlm_ldap: 'server' directive is in URL form but ldap_initialize() is not available."); free(inst); /* FIXME: detach */ return -1; #endif } /* workaround for servers which support LDAPS but not START TLS */ if(inst->port == LDAPS_PORT || inst->tls_mode) inst->tls_mode = LDAP_OPT_X_TLS_HARD; else inst->tls_mode = 0; inst->reply_item_map = NULL; inst->check_item_map = NULL; inst->conns = NULL; inst->failed_conns = 0; #if LDAP_SET_REBIND_PROC_ARGS != 3 /* * The 2-argument rebind doesn't take an instance * variable. Our rebind function needs the instance * variable for the username, password, etc. */ if (inst->rebind == 1) { radlog(L_ERR, "rlm_ldap: Cannot use 'rebind' directive as this version of libldap does not support the API that we need."); free(inst); return -1; } #endif DEBUG("rlm_ldap: Registering ldap_groupcmp for Ldap-Group"); paircompare_register(PW_LDAP_GROUP, PW_USER_NAME, ldap_groupcmp, inst); memset(&flags, 0, sizeof(flags)); xlat_name = cf_section_name2(conf); if (xlat_name != NULL){ char *group_name; DICT_ATTR *dattr; /* * Allocate room for -Ldap-Group */ group_name = rad_malloc((strlen(xlat_name) + 1 + 11) * sizeof(char)); sprintf(group_name,"%s-Ldap-Group",xlat_name); DEBUG("rlm_ldap: Creating new attribute %s",group_name); dict_addattr(group_name, 0, PW_TYPE_STRING, -1, flags); dattr = dict_attrbyname(group_name); if (dattr == NULL){ radlog(L_ERR, "rlm_ldap: Failed to create attribute %s",group_name); free(group_name); free(inst); /* FIXME: detach */ return -1; } DEBUG("rlm_ldap: Registering ldap_groupcmp for %s",group_name); paircompare_register(dattr->attr, PW_USER_NAME, ldap_groupcmp, inst); free(group_name); } else { xlat_name = cf_section_name1(conf); rad_assert(xlat_name != NULL); /* or all hell breaks loose */ } inst->xlat_name = strdup(xlat_name); DEBUG("rlm_ldap: Registering ldap_xlat with xlat_name %s",xlat_name); xlat_register(xlat_name,ldap_xlat,inst); /* * Over-ride set_auth_type if there's no Auth-Type of our name. * This automagically catches the case where LDAP is listed * in "authorize", but not "authenticate". */ if (inst->set_auth_type) { DICT_VALUE *dv = dict_valbyname(PW_AUTH_TYPE, xlat_name); /* * No section of *my* name, but maybe there's an * LDAP section... */ if (!dv) dv = dict_valbyname(PW_AUTH_TYPE, "LDAP"); if (!dv) { DEBUG2("rlm_ldap: Over-riding set_auth_type, as there is no module %s listed in the \"authenticate\" section.", xlat_name); inst->set_auth_type = 0; } else { inst->auth_type = dv->name; /* doesn't change on HUP */ } } /* else no need to look up the value */ #ifdef NOVELL /* * (LDAP_Instance, V1) attribute-value pair in the config * items list means that the 'authorize' method of the * instance 'V1' of the LDAP module has processed this * request. */ dict_addattr("LDAP-Instance", 0, PW_TYPE_STRING, -1, flags); /* * ('eDir-APC', '1') in config items list * Do not perform eDirectory account policy check (APC) * * ('eDir-APC', '2') in config items list * Perform eDirectory APC * * ('eDir-APC', '3') in config items list * eDirectory APC has been completed */ dict_addattr("eDir-APC", 0, PW_TYPE_STRING, -1, flags); /* * eDir-Auth-Option allows for a different NMAS Authentication method to be used instead of password */ dict_addattr("eDir-Auth-Option", 0, PW_TYPE_STRING, -1, flags); #endif if (inst->num_conns <= 0){ radlog(L_ERR, "rlm_ldap: Invalid ldap connections number passed."); free(inst); /* FIXME: detach */ return -1; } inst->conns = malloc(sizeof(*(inst->conns))*inst->num_conns); if (inst->conns == NULL){ radlog(L_ERR, "rlm_ldap: Could not allocate memory. Aborting."); free(inst); /* FIXME: detach */ return -1; } for(i = 0; i < inst->num_conns; i++){ inst->conns[i].bound = 0; inst->conns[i].locked = 0; inst->conns[i].failed_conns = 0; inst->conns[i].ld = NULL; pthread_mutex_init(&inst->conns[i].mutex, NULL); } #ifdef NOVELL /* * 'inst->apc_conns' is a separate connection pool to be * used for performing eDirectory account policy check in * the 'postauth' method. This avoids changing the * (RADIUS server) credentials associated with the * 'inst->conns' connection pool. */ inst->apc_conns = malloc(sizeof(*(inst->apc_conns))*inst->num_conns); if (inst->apc_conns == NULL){ radlog(L_ERR, "rlm_ldap: Could not allocate memory. Aborting."); free(inst); /* FIXME: detach */ return -1; } for(i = 0; i < inst->num_conns; i++){ inst->apc_conns[i].bound = 0; inst->apc_conns[i].locked = 0; inst->apc_conns[i].failed_conns = 0; inst->apc_conns[i].ld = NULL; pthread_mutex_init(&inst->apc_conns[i].mutex, NULL); } #endif if (read_mappings(inst) != 0) { radlog(L_ERR, "rlm_ldap: Reading dictionary mappings from file %s failed", inst->dictionary_mapping); free(inst); /* FIXME: detach */ return -1; } if ((inst->check_item_map == NULL) && (inst->reply_item_map == NULL)) { radlog(L_ERR, "rlm_ldap: dictionary mappings file %s did not contain any mappings", inst->dictionary_mapping); free(inst); /* FIXME: detach */ return -1; } pair = inst->check_item_map; while(pair != NULL){ atts_num++; pair = pair->next; } check_map_num = (atts_num - 1); pair = inst->reply_item_map; while(pair != NULL){ atts_num++; pair = pair->next; } reply_map_num = (atts_num - 1); if (inst->profile_attr) atts_num++; if (inst->passwd_attr) atts_num++; if (inst->access_attr) atts_num++; #ifdef NOVELL atts_num++; /* eDirectory Authentication Option attribute */ #endif inst->atts = (char **)malloc(sizeof(char *)*(atts_num + 1)); if (inst->atts == NULL){ radlog(L_ERR, "rlm_ldap: Could not allocate memory. Aborting."); free(inst); /* FIXME: detach */ return -1; } pair = inst->check_item_map; if (pair == NULL) pair = inst->reply_item_map; #ifdef NOVELL for(i=0;iatts[i] = pair->attr; if (i == check_map_num) pair = inst->reply_item_map; else pair = pair->next; } else if (i <= reply_map_num){ inst->atts[i] = pair->attr; pair = pair->next; } else{ if (inst->profile_attr && !att_map[0]){ inst->atts[i] = inst->profile_attr; att_map[0] = 1; } else if (inst->passwd_attr && !att_map[1]){ inst->atts[i] = inst->passwd_attr; att_map[1] = 1; } else if (inst->access_attr && !att_map[2]){ inst->atts[i] = inst->access_attr; att_map[2] = 1; } } } #ifdef NOVELL inst->atts[atts_num - 1] = "sasdefaultloginsequence"; #endif inst->atts[atts_num] = NULL; DEBUG("conns: %p",inst->conns); *instance = inst; return 0; } /* * read_mappings(...) reads a ldap<->radius mappings file to * inst->reply_item_map and inst->check_item_map */ #define MAX_LINE_LEN 160 #define GENERIC_ATTRIBUTE_ID "$GENERIC$" static int read_mappings(ldap_instance* inst) { FILE* mapfile; char *filename; /* * All buffers are of MAX_LINE_LEN so we can use sscanf * without being afraid of buffer overflows */ char buf[MAX_LINE_LEN], itemType[MAX_LINE_LEN]; char radiusAttribute[MAX_LINE_LEN], ldapAttribute[MAX_LINE_LEN]; int linenumber; FR_TOKEN operator; char opstring[MAX_LINE_LEN]; /* open the mappings file for reading */ filename = inst->dictionary_mapping; DEBUG("rlm_ldap: reading ldap<->radius mappings from file %s", filename); mapfile = fopen(filename, "r"); if (mapfile == NULL) { radlog(L_ERR, "rlm_ldap: Opening file %s failed: %s", filename, strerror(errno)); return -1; /* error */ } /* * read file line by line. Note that if line length * exceeds MAX_LINE_LEN, line numbers will be mixed up */ linenumber = 0; while (fgets(buf, sizeof buf, mapfile)!=NULL) { char* ptr; int token_count; TLDAP_RADIUS* pair; linenumber++; /* strip comments */ ptr = strchr(buf, '#'); if (ptr) *ptr = 0; /* empty line */ if (buf[0] == 0) continue; /* extract tokens from the string */ token_count = sscanf(buf, "%s %s %s %s", itemType, radiusAttribute, ldapAttribute, opstring); if (token_count <= 0) /* no tokens */ continue; if ((token_count < 3) || (token_count > 4)) { radlog(L_ERR, "rlm_ldap: Skipping %s line %i: %s", filename, linenumber, buf); radlog(L_ERR, "rlm_ldap: Expected 3 to 4 tokens " "(Item type, RADIUS Attribute and LDAP Attribute) but found only %i", token_count); continue; } if (token_count == 3) { operator = T_OP_INVALID; /* use defaults */ } else { ptr = opstring; operator = gettoken(&ptr, buf, sizeof(buf)); if ((operator < T_OP_ADD) || (operator > T_OP_CMP_EQ)) { radlog(L_ERR, "rlm_ldap: file %s: skipping line %i: unknown or invalid operator %s", filename, linenumber, opstring); continue; } } /* create new TLDAP_RADIUS list node */ pair = rad_malloc(sizeof(*pair)); pair->attr = strdup(ldapAttribute); pair->radius_attr = strdup(radiusAttribute); pair->operator = operator; if ( (pair->attr == NULL) || (pair->radius_attr == NULL) ) { radlog(L_ERR, "rlm_ldap: Out of memory"); if (pair->attr) free(pair->attr); if (pair->radius_attr) free(pair->radius_attr); free(pair); fclose(mapfile); return -1; } /* push node to correct list */ if (strcasecmp(itemType, "checkItem") == 0) { pair->next = inst->check_item_map; inst->check_item_map = pair; } else if (strcasecmp(itemType, "replyItem") == 0) { pair->next = inst->reply_item_map; inst->reply_item_map = pair; } else { radlog(L_ERR, "rlm_ldap: file %s: skipping line %i: unknown itemType %s", filename, linenumber, itemType); free(pair->attr); free(pair->radius_attr); free(pair); continue; } DEBUG("rlm_ldap: LDAP %s mapped to RADIUS %s", pair->attr, pair->radius_attr); } fclose(mapfile); return 0; /* success */ } static int perform_search(void *instance, LDAP_CONN *conn, char *search_basedn, int scope, char *filter, char **attrs, LDAPMessage ** result) { int res = RLM_MODULE_OK; int ldap_errno = 0; ldap_instance *inst = instance; int search_retry = 0; struct timeval tv; *result = NULL; if (!conn){ radlog(L_ERR, " [%s] NULL connection handle passed", inst->xlat_name); return RLM_MODULE_FAIL; } if (conn->failed_conns > MAX_FAILED_CONNS_START){ conn->failed_conns++; if (conn->failed_conns >= MAX_FAILED_CONNS_END){ conn->failed_conns = MAX_FAILED_CONNS_RESTART; conn->bound = 0; } } retry: if (!conn->bound || conn->ld == NULL) { DEBUG2(" [%s] attempting LDAP reconnection", inst->xlat_name); if (conn->ld){ DEBUG2(" [%s] closing existing LDAP connection", inst->xlat_name); ldap_unbind_s(conn->ld); } if ((conn->ld = ldap_connect(instance, inst->login, inst->password, 0, &res, NULL)) == NULL) { radlog(L_ERR, " [%s] (re)connection attempt failed", inst->xlat_name); if (search_retry == 0) conn->failed_conns++; return (RLM_MODULE_FAIL); } conn->bound = 1; conn->failed_conns = 0; } tv.tv_sec = inst->timeout; tv.tv_usec = 0; DEBUG2(" [%s] performing search in %s, with filter %s", inst->xlat_name, search_basedn ? search_basedn : "(null)" , filter); switch (ldap_search_st(conn->ld, search_basedn, scope, filter, attrs, 0, &tv, result)) { case LDAP_SUCCESS: case LDAP_NO_SUCH_OBJECT: break; case LDAP_SERVER_DOWN: radlog(L_ERR, " [%s] ldap_search() failed: LDAP connection lost.", inst->xlat_name); conn->failed_conns++; if (search_retry == 0){ if (conn->failed_conns <= MAX_FAILED_CONNS_START){ radlog(L_INFO, " [%s] Attempting reconnect", inst->xlat_name); search_retry = 1; conn->bound = 0; ldap_msgfree(*result); goto retry; } } ldap_msgfree(*result); return RLM_MODULE_FAIL; case LDAP_INSUFFICIENT_ACCESS: radlog(L_ERR, " [%s] ldap_search() failed: Insufficient access. Check the identity and password configuration directives.", inst->xlat_name); ldap_msgfree(*result); return RLM_MODULE_FAIL; case LDAP_TIMEOUT: radlog(L_ERR, " [%s] ldap_search() failed: Timed out while waiting for server to respond. Please increase the timeout.", inst->xlat_name); ldap_msgfree(*result); return RLM_MODULE_FAIL; case LDAP_FILTER_ERROR: radlog(L_ERR, " [%s] ldap_search() failed: Bad search filter: %s", inst->xlat_name,filter); ldap_msgfree(*result); return RLM_MODULE_FAIL; case LDAP_TIMELIMIT_EXCEEDED: case LDAP_BUSY: case LDAP_UNAVAILABLE: /* We don't need to reconnect in these cases so we don't set conn->bound */ ldap_get_option(conn->ld, LDAP_OPT_ERROR_NUMBER, &ldap_errno); radlog(L_ERR, " [%s] ldap_search() failed: %s", inst->xlat_name, ldap_err2string(ldap_errno)); ldap_msgfree(*result); return (RLM_MODULE_FAIL); case LDAP_OPERATIONS_ERROR: DEBUG("WARNING: Please set 'chase_referrals=yes' and 'rebind=yes'"); DEBUG("WARNING: See the ldap module configuration for details"); /* FALL-THROUGH */ default: ldap_get_option(conn->ld, LDAP_OPT_ERROR_NUMBER, &ldap_errno); radlog(L_ERR, " [%s] ldap_search() failed: %s", inst->xlat_name, ldap_err2string(ldap_errno)); conn->bound = 0; ldap_msgfree(*result); return (RLM_MODULE_FAIL); } ldap_errno = ldap_count_entries(conn->ld, *result); if (ldap_errno != 1) { if (ldap_errno == 0) { DEBUG(" [%s] object not found", inst->xlat_name); } else { DEBUG(" [%s] got ambiguous search result (%d results)", inst->xlat_name, ldap_errno); } res = RLM_MODULE_NOTFOUND; ldap_msgfree(*result); } return res; } /* * Translate the LDAP queries. */ static size_t ldap_escape_func(char *out, size_t outlen, const char *in) { size_t len = 0; while (in[0]) { /* * Encode unsafe characters. */ if (((len == 0) && ((in[0] == ' ') || (in[0] == '#'))) || (strchr(",+\"\\<>;*=()", *in))) { static const char hex[] = "0123456789abcdef"; /* * Only 3 or less bytes available. */ if (outlen <= 3) { break; } *(out++) = '\\'; *(out++) = hex[((*in) >> 4) & 0x0f]; *(out++) = hex[(*in) & 0x0f]; outlen -= 3; len += 3; in++; continue; } /* * Only one byte left. */ if (outlen <= 1) { break; } /* * Allowed character. */ *(out++) = *(in++); outlen--; len++; } *out = '\0'; return len; } /* * ldap_groupcmp(). Implement the Ldap-Group == "group" filter */ static int ldap_groupcmp(void *instance, REQUEST *req, UNUSED VALUE_PAIR *request, VALUE_PAIR *check, UNUSED VALUE_PAIR *check_pairs, UNUSED VALUE_PAIR **reply_pairs) { char filter[MAX_FILTER_STR_LEN]; char gr_filter[MAX_FILTER_STR_LEN]; int res; LDAPMessage *result = NULL; LDAPMessage *msg = NULL; char basedn[MAX_FILTER_STR_LEN]; char *attrs[] = {"dn",NULL}; char **vals; ldap_instance *inst = instance; char *group_attrs[] = {inst->groupmemb_attr,NULL}; LDAP_CONN *conn; int conn_id = -1; VALUE_PAIR *vp_user_dn; VALUE_PAIR **request_pairs; basedn[0] = '\0'; request_pairs = &req->config_items; DEBUG(" [%s] Entering ldap_groupcmp()", inst->xlat_name); if (check->length == 0){ DEBUG("rlm_ldap::ldap_groupcmp: Illegal group name"); return 1; } if (req == NULL){ DEBUG("rlm_ldap::ldap_groupcmp: NULL request"); return 1; } if (inst->basedn && !radius_xlat(basedn, sizeof(basedn), inst->basedn, req, ldap_escape_func)) { DEBUG("rlm_ldap::ldap_groupcmp: unable to create basedn."); return 1; } while((vp_user_dn = pairfind(*request_pairs, PW_LDAP_USERDN)) == NULL){ char *user_dn = NULL; if (!radius_xlat(filter, sizeof(filter), inst->filter, req, ldap_escape_func)){ DEBUG("rlm_ldap::ldap_groupcmp: unable to create filter"); return 1; } if ((conn_id = ldap_get_conn(inst->conns,&conn,inst)) == -1){ radlog(L_ERR, " [%s] All ldap connections are in use", inst->xlat_name); return 1; } if ((res = perform_search(inst, conn, basedn, LDAP_SCOPE_SUBTREE, filter, attrs, &result)) != RLM_MODULE_OK){ DEBUG("rlm_ldap::ldap_groupcmp: search failed"); ldap_release_conn(conn_id,inst); return 1; } if ((msg = ldap_first_entry(conn->ld, result)) == NULL) { DEBUG("rlm_ldap::ldap_groupcmp: ldap_first_entry() failed"); ldap_release_conn(conn_id,inst); ldap_msgfree(result); return 1; } if ((user_dn = ldap_get_dn(conn->ld, msg)) == NULL) { DEBUG("rlm_ldap:ldap_groupcmp:: ldap_get_dn() failed"); ldap_release_conn(conn_id,inst); ldap_msgfree(result); return 1; } ldap_release_conn(conn_id,inst); /* * Adding new attribute containing DN for LDAP * object associated with given username */ pairadd(request_pairs, pairmake("Ldap-UserDn", user_dn, T_OP_EQ)); ldap_memfree(user_dn); ldap_msgfree(result); } if(!radius_xlat(gr_filter, sizeof(gr_filter), inst->groupmemb_filt, req, ldap_escape_func)) { DEBUG("rlm_ldap::ldap_groupcmp: unable to create filter."); return 1; } if (strchr((char *)check->vp_strvalue,',') != NULL) { /* This looks like a DN */ snprintf(filter,sizeof(filter), "%s",gr_filter); snprintf(basedn,sizeof(basedn), "%s",(char *)check->vp_strvalue); } else snprintf(filter,sizeof(filter), "(&(%s=%s)%s)", inst->groupname_attr, (char *)check->vp_strvalue,gr_filter); if ((conn_id = ldap_get_conn(inst->conns,&conn,inst)) == -1) { radlog(L_ERR, " [%s] All ldap connections are in use", inst->xlat_name); return 1; } if ((res = perform_search(inst, conn, basedn, LDAP_SCOPE_SUBTREE, filter, attrs, &result)) == RLM_MODULE_OK) { DEBUG("rlm_ldap::ldap_groupcmp: User found in group %s", (char *)check->vp_strvalue); ldap_msgfree(result); ldap_release_conn(conn_id,inst); return 0; } ldap_release_conn(conn_id,inst); if (res != RLM_MODULE_NOTFOUND ) { DEBUG("rlm_ldap::ldap_groupcmp: Search returned error"); return 1; } if (inst->groupmemb_attr == NULL){ /* * Search returned NOTFOUND and searching for * membership using user object attributes is not * specified in config file */ DEBUG("rlm_ldap::ldap_groupcmp: Group %s not found or user is not a member.",(char *)check->vp_strvalue); return 1; } snprintf(filter,sizeof(filter), "(objectclass=*)"); if ((conn_id = ldap_get_conn(inst->conns,&conn,inst)) == -1){ radlog(L_ERR, " [%s] Add ldap connections are in use", inst->xlat_name); return 1; } if ((res = perform_search(inst, conn, vp_user_dn->vp_strvalue, LDAP_SCOPE_BASE, filter, group_attrs, &result)) != RLM_MODULE_OK) { DEBUG("rlm_ldap::ldap_groupcmp: Search returned error"); ldap_release_conn(conn_id, inst); return 1; } if ((msg = ldap_first_entry(conn->ld, result)) == NULL) { DEBUG("rlm_ldap::ldap_groupcmp: ldap_first_entry() failed"); ldap_release_conn(conn_id,inst); ldap_msgfree(result); return 1; } if ((vals = ldap_get_values(conn->ld, msg, inst->groupmemb_attr)) != NULL) { int i = 0; char found = 0; for (;i < ldap_count_values(vals);i++){ if (strchr(vals[i],',') != NULL){ /* This looks like a DN */ LDAPMessage *gr_result = NULL; snprintf(filter,sizeof(filter), "(%s=%s)", inst->groupname_attr, (char *)check->vp_strvalue); if ((res = perform_search(inst, conn, vals[i], LDAP_SCOPE_BASE, filter, attrs, &gr_result)) != RLM_MODULE_OK){ if (res != RLM_MODULE_NOTFOUND) { DEBUG("rlm_ldap::ldap_groupcmp: Search returned error"); ldap_value_free(vals); ldap_msgfree(result); ldap_release_conn(conn_id,inst); return 1; } } else { ldap_msgfree(gr_result); found = 1; break; } } else { if (strcmp(vals[i],(char *)check->vp_strvalue) == 0){ found = 1; break; } } } ldap_value_free(vals); ldap_msgfree(result); if (found == 0){ DEBUG("rlm_ldap::groupcmp: Group %s not found or user not a member", (char *)check->vp_strvalue); ldap_release_conn(conn_id,inst); return 1; } } else { DEBUG("rlm_ldap::ldap_groupcmp: ldap_get_values() failed"); ldap_msgfree(result); ldap_release_conn(conn_id,inst); return 1; } DEBUG("rlm_ldap::ldap_groupcmp: User found in group %s",(char *)check->vp_strvalue); ldap_release_conn(conn_id,inst); return 0; } /* * ldap_xlat() * Do an xlat on an LDAP URL */ static size_t ldap_xlat(void *instance, REQUEST *request, char *fmt, char *out, size_t freespace, RADIUS_ESCAPE_STRING func) { char url[MAX_FILTER_STR_LEN]; int res; size_t ret = 0; ldap_instance *inst = instance; LDAPURLDesc *ldap_url; LDAPMessage *result = NULL; LDAPMessage *msg = NULL; char **vals; int conn_id = -1; LDAP_CONN *conn; DEBUG(" [%s] - ldap_xlat", inst->xlat_name); if (!radius_xlat(url, sizeof(url), fmt, request, func)) { radlog (L_ERR, " [%s] Unable to create LDAP URL.\n", inst->xlat_name); return 0; } if (!ldap_is_ldap_url(url)){ radlog (L_ERR, " [%s] String passed does not look like an LDAP URL.\n", inst->xlat_name); return 0; } if (ldap_url_parse(url,&ldap_url)){ radlog (L_ERR, " [%s] LDAP URL parse failed.\n", inst->xlat_name); return 0; } if (ldap_url->lud_attrs == NULL || ldap_url->lud_attrs[0] == NULL || ( ldap_url->lud_attrs[1] != NULL || ( !*ldap_url->lud_attrs[0] || ! strcmp(ldap_url->lud_attrs[0],"*") ) ) ){ radlog (L_ERR, " [%s] Invalid Attribute(s) request.\n", inst->xlat_name); ldap_free_urldesc(ldap_url); return 0; } if (ldap_url->lud_host){ if (strncmp(inst->server,ldap_url->lud_host, strlen(inst->server)) != 0 || ldap_url->lud_port != inst->port) { DEBUG(" [%s] Requested server/port is not known to this module instance.", inst->xlat_name); ldap_free_urldesc(ldap_url); return 0; } } if ((conn_id = ldap_get_conn(inst->conns,&conn,inst)) == -1){ radlog(L_ERR, " [%s] All ldap connections are in use", inst->xlat_name); ldap_free_urldesc(ldap_url); return 0; } if ((res = perform_search(inst, conn, ldap_url->lud_dn, ldap_url->lud_scope, ldap_url->lud_filter, ldap_url->lud_attrs, &result)) != RLM_MODULE_OK){ if (res == RLM_MODULE_NOTFOUND){ DEBUG(" [%s] Search returned not found", inst->xlat_name); ldap_free_urldesc(ldap_url); ldap_release_conn(conn_id,inst); return 0; } DEBUG(" [%s] Search returned error", inst->xlat_name); ldap_free_urldesc(ldap_url); ldap_release_conn(conn_id,inst); return 0; } if ((msg = ldap_first_entry(conn->ld, result)) == NULL){ DEBUG(" [%s] ldap_first_entry() failed", inst->xlat_name); ldap_msgfree(result); ldap_free_urldesc(ldap_url); ldap_release_conn(conn_id,inst); return 0; } if ((vals = ldap_get_values(conn->ld, msg, ldap_url->lud_attrs[0])) != NULL) { ret = strlen(vals[0]); if (ret >= freespace){ DEBUG(" [%s] Insufficient string space", inst->xlat_name); ldap_free_urldesc(ldap_url); ldap_value_free(vals); ldap_msgfree(result); ldap_release_conn(conn_id,inst); return 0; } DEBUG(" [%s] Adding attribute %s, value: %s", inst->xlat_name,ldap_url->lud_attrs[0],vals[0]); strlcpy(out,vals[0],freespace); ldap_value_free(vals); } else ret = 0; ldap_msgfree(result); ldap_free_urldesc(ldap_url); ldap_release_conn(conn_id,inst); DEBUG(" [%s] - ldap_xlat end", inst->xlat_name); return ret; } /* * For auto-header discovery. */ static const FR_NAME_NUMBER header_names[] = { { "{clear}", PW_CLEARTEXT_PASSWORD }, { "{cleartext}", PW_CLEARTEXT_PASSWORD }, { "{md5}", PW_MD5_PASSWORD }, { "{BASE64_MD5}", PW_MD5_PASSWORD }, { "{smd5}", PW_SMD5_PASSWORD }, { "{crypt}", PW_CRYPT_PASSWORD }, { "{sha}", PW_SHA_PASSWORD }, { "{ssha}", PW_SSHA_PASSWORD }, { "{nt}", PW_NT_PASSWORD }, { "{ns-mta-md5}", PW_NS_MTA_MD5_PASSWORD }, { NULL, 0 } }; /****************************************************************************** * * Function: rlm_ldap_authorize * * Purpose: Check if user is authorized for remote access * ******************************************************************************/ static int ldap_authorize(void *instance, REQUEST * request) { LDAPMessage *result = NULL; LDAPMessage *msg = NULL; LDAPMessage *def_msg = NULL; LDAPMessage *def_attr_msg = NULL; LDAPMessage *def_result = NULL; LDAPMessage *def_attr_result = NULL; ldap_instance *inst = instance; char *user_dn = NULL; char filter[MAX_FILTER_STR_LEN]; char basedn[MAX_FILTER_STR_LEN]; VALUE_PAIR *check_tmp; VALUE_PAIR *reply_tmp; int res; VALUE_PAIR **check_pairs, **reply_pairs; char **vals; VALUE_PAIR *module_fmsg_vp; VALUE_PAIR *user_profile; char module_fmsg[MAX_STRING_LEN]; LDAP_CONN *conn; int conn_id = -1; int added_known_password = 0; basedn[0] = '\0'; if (!request->username){ RDEBUG2("Attribute \"User-Name\" is required for authorization.\n"); return RLM_MODULE_NOOP; } check_pairs = &request->config_items; reply_pairs = &request->reply->vps; /* * Check for valid input, zero length names not permitted */ if (request->username->length == 0) { DEBUG2("zero length username not permitted\n"); return RLM_MODULE_INVALID; } RDEBUG("performing user authorization for %s", request->username->vp_strvalue); if (!radius_xlat(filter, sizeof(filter), inst->filter, request, ldap_escape_func)) { radlog(L_ERR, " [%s] unable to create filter.\n", inst->xlat_name); return RLM_MODULE_INVALID; } if (inst->basedn && !radius_xlat(basedn, sizeof(basedn), inst->basedn, request, ldap_escape_func)) { radlog(L_ERR, " [%s] unable to create basedn.\n", inst->xlat_name); return RLM_MODULE_INVALID; } if ((conn_id = ldap_get_conn(inst->conns,&conn,inst)) == -1){ radlog(L_ERR, " [%s] All ldap connections are in use", inst->xlat_name); return RLM_MODULE_FAIL; } if ((res = perform_search(instance, conn, basedn, LDAP_SCOPE_SUBTREE, filter, inst->atts, &result)) != RLM_MODULE_OK) { RDEBUG("search failed"); if (res == RLM_MODULE_NOTFOUND){ snprintf(module_fmsg,sizeof(module_fmsg)," [%s] User not found", inst->xlat_name); module_fmsg_vp = pairmake("Module-Failure-Message", module_fmsg, T_OP_EQ); pairadd(&request->packet->vps, module_fmsg_vp); } ldap_release_conn(conn_id,inst); return (res); } if ((msg = ldap_first_entry(conn->ld, result)) == NULL) { RDEBUG("ldap_first_entry() failed"); ldap_msgfree(result); ldap_release_conn(conn_id,inst); return RLM_MODULE_FAIL; } if ((user_dn = ldap_get_dn(conn->ld, msg)) == NULL) { RDEBUG("ldap_get_dn() failed"); ldap_msgfree(result); ldap_release_conn(conn_id,inst); return RLM_MODULE_FAIL; } /* * Adding new attribute containing DN for LDAP object associated with * given username */ pairadd(check_pairs, pairmake("Ldap-UserDn", user_dn, T_OP_EQ)); ldap_memfree(user_dn); /* Remote access is controled by attribute of the user object */ if (inst->access_attr) { if ((vals = ldap_get_values(conn->ld, msg, inst->access_attr)) != NULL) { if (inst->default_allow){ RDEBUG("checking if remote access for %s is allowed by %s", request->username->vp_strvalue, inst->access_attr); if (!strncmp(vals[0], "FALSE", 5)) { RDEBUG("dialup access disabled"); snprintf(module_fmsg,sizeof(module_fmsg)," [%s] Access Attribute denies access", inst->xlat_name); module_fmsg_vp = pairmake("Module-Failure-Message", module_fmsg, T_OP_EQ); pairadd(&request->packet->vps, module_fmsg_vp); ldap_msgfree(result); ldap_value_free(vals); ldap_release_conn(conn_id,inst); return RLM_MODULE_USERLOCK; } ldap_value_free(vals); } else{ RDEBUG("%s attribute exists - access denied by default", inst->access_attr); snprintf(module_fmsg,sizeof(module_fmsg)," [%s] Access Attribute denies access", inst->xlat_name); module_fmsg_vp = pairmake("Module-Failure-Message", module_fmsg, T_OP_EQ); pairadd(&request->packet->vps, module_fmsg_vp); ldap_msgfree(result); ldap_value_free(vals); ldap_release_conn(conn_id,inst); return RLM_MODULE_USERLOCK; } } else { if (inst->default_allow){ RDEBUG("no %s attribute - access denied by default", inst->access_attr); snprintf(module_fmsg,sizeof(module_fmsg)," [%s] Access Attribute denies access", inst->xlat_name); module_fmsg_vp = pairmake("Module-Failure-Message", module_fmsg, T_OP_EQ); pairadd(&request->packet->vps, module_fmsg_vp); ldap_msgfree(result); ldap_release_conn(conn_id,inst); return RLM_MODULE_USERLOCK; } } } /* * Check for the default profile entry. If it exists then add the * attributes it contains in the check and reply pairs */ user_profile = pairfind(request->config_items, PW_USER_PROFILE); if (inst->default_profile || user_profile){ char *profile = inst->default_profile; strlcpy(filter,inst->base_filter,sizeof(filter)); if (user_profile) profile = user_profile->vp_strvalue; if (profile && *profile){ if ((res = perform_search(instance, conn, profile, LDAP_SCOPE_BASE, filter, inst->atts, &def_result)) == RLM_MODULE_OK){ if ((def_msg = ldap_first_entry(conn->ld,def_result))){ if ((check_tmp = ldap_pairget(conn->ld,def_msg,inst->check_item_map,check_pairs,1, inst))) { if (inst->do_xlat){ pairxlatmove(request, check_pairs, &check_tmp); pairfree(&check_tmp); } else pairadd(check_pairs,check_tmp); } if ((reply_tmp = ldap_pairget(conn->ld,def_msg,inst->reply_item_map,reply_pairs,0, inst))) { if (inst->do_xlat){ pairxlatmove(request, reply_pairs, &reply_tmp); pairfree(&reply_tmp); } else pairadd(reply_pairs,reply_tmp); } } ldap_msgfree(def_result); } else RDEBUG("default_profile/user-profile search failed"); } } /* * Check for the profile attribute. If it exists, we assume that it * contains the DN of an entry containg a profile for the user. That * way we can have different general profiles for various user groups * (students,faculty,staff etc) */ if (inst->profile_attr){ if ((vals = ldap_get_values(conn->ld, msg, inst->profile_attr)) != NULL) { unsigned int i=0; strlcpy(filter,inst->base_filter,sizeof(filter)); while(vals[i] && *vals[i]){ if ((res = perform_search(instance, conn, vals[i], LDAP_SCOPE_BASE, filter, inst->atts, &def_attr_result)) == RLM_MODULE_OK){ if ((def_attr_msg = ldap_first_entry(conn->ld,def_attr_result))){ if ((check_tmp = ldap_pairget(conn->ld,def_attr_msg,inst->check_item_map,check_pairs,1, inst))) { if (inst->do_xlat){ pairxlatmove(request, check_pairs, &check_tmp); pairfree(&check_tmp); } else pairadd(check_pairs,check_tmp); } if ((reply_tmp = ldap_pairget(conn->ld,def_attr_msg,inst->reply_item_map,reply_pairs,0, inst))) { if (inst->do_xlat){ pairxlatmove(request, reply_pairs, &reply_tmp); pairfree(&reply_tmp); } else pairadd(reply_pairs,reply_tmp); } } ldap_msgfree(def_attr_result); } else RDEBUG("profile_attribute search failed"); i++; } ldap_value_free(vals); } } if (inst->passwd_attr && *inst->passwd_attr) { #ifdef NOVELL_UNIVERSAL_PASSWORD if (strcasecmp(inst->passwd_attr,"nspmPassword") != 0) { #endif VALUE_PAIR *passwd_item; char **passwd_vals; char *value = NULL; int i; /* * Read the password from the DB, and * add it to the request. */ passwd_vals = ldap_get_values(conn->ld,msg, inst->passwd_attr); /* * Loop over what we received, and parse it. */ if (passwd_vals) for (i = 0; passwd_vals[i] != NULL; i++) { int attr = PW_USER_PASSWORD; if (!*passwd_vals[i]) continue; value = passwd_vals[i]; if (inst->auto_header) { char *p; char autobuf[16]; p = strchr(value, '}'); if (!p) continue; if ((size_t)(p - value + 1) >= sizeof(autobuf)) continue; /* paranoia */ memcpy(autobuf, value, p - value + 1); autobuf[p - value + 1] = '\0'; attr = fr_str2int(header_names, autobuf, 0); if (!attr) continue; value = p + 1; goto create_attr; } else if (inst->passwd_hdr && *inst->passwd_hdr) { if (strncasecmp(value, inst->passwd_hdr, strlen(inst->passwd_hdr)) == 0) { value += strlen(inst->passwd_hdr); } else { RDEBUG("Password header not found in password %s for user %s", passwd_vals[0], request->username->vp_strvalue); } } if (!value) continue; create_attr: passwd_item = radius_paircreate(request, &request->config_items, attr, PW_TYPE_STRING); strlcpy(passwd_item->vp_strvalue, value, sizeof(passwd_item->vp_strvalue)); passwd_item->length = strlen(passwd_item->vp_strvalue); RDEBUG("Added %s = %s in check items", passwd_item->name, passwd_item->vp_strvalue); added_known_password = 1; } ldap_value_free(passwd_vals); #ifdef NOVELL_UNIVERSAL_PASSWORD } else{ /* * Read Universal Password from eDirectory */ VALUE_PAIR *passwd_item; VALUE_PAIR *vp_user_dn; char *universal_password = NULL; size_t universal_password_len = UNIVERSAL_PASS_LEN; char *passwd_val = NULL; res = 0; if ((passwd_item = pairfind(request->config_items, PW_CLEARTEXT_PASSWORD)) == NULL){ universal_password = rad_malloc(universal_password_len); memset(universal_password, 0, universal_password_len); vp_user_dn = pairfind(request->config_items,PW_LDAP_USERDN); res = nmasldap_get_password(conn->ld,vp_user_dn->vp_strvalue,&universal_password_len,universal_password); if (res == 0){ passwd_val = universal_password; if (inst->passwd_hdr && *inst->passwd_hdr){ passwd_val = strstr(passwd_val,inst->passwd_hdr); if (passwd_val != NULL) passwd_val += strlen((char*)inst->passwd_hdr); else RDEBUG("Password header not found in password %s for user %s ",passwd_val,request->username->vp_strvalue); } if (passwd_val){ passwd_item = radius_paircreate(request, &request->config_items, PW_CLEARTEXT_PASSWORD, PW_TYPE_STRING); strlcpy(passwd_item->vp_strvalue,passwd_val,sizeof(passwd_item->vp_strvalue)); passwd_item->length = strlen(passwd_item->vp_strvalue); added_known_password = 1; #ifdef NOVELL { DICT_ATTR *dattr; VALUE_PAIR *vp_inst, *vp_apc; int inst_attr, apc_attr; dattr = dict_attrbyname("LDAP-Instance"); inst_attr = dattr->attr; dattr = dict_attrbyname("eDir-APC"); apc_attr = dattr->attr; vp_inst = pairfind(request->config_items, inst_attr); if(vp_inst == NULL){ /* * The authorize method of no other LDAP module instance has * processed this request. */ vp_inst = radius_paircreate(request, &request->config_items, inst_attr, PW_TYPE_STRING); strlcpy(vp_inst->vp_strvalue, inst->xlat_name, sizeof(vp_inst->vp_strvalue)); vp_inst->length = strlen(vp_inst->vp_strvalue); /* * Inform the authenticate / post-auth method about the presence * of UP in the config items list and whether eDirectory account * policy check is to be performed or not. */ vp_apc = radius_paircreate(request, &request->config_items, apc_attr, PW_TYPE_STRING); if(!inst->edir_account_policy_check){ /* Do nothing */ strcpy(vp_apc->vp_strvalue, "1"); }else{ /* Perform eDirectory account-policy check */ strcpy(vp_apc->vp_strvalue, "2"); } vp_apc->length = 1; } } #endif RDEBUG("Added the eDirectory password %s in check items as %s",passwd_item->vp_strvalue,passwd_item->name); } } else { RDEBUG("Error reading Universal Password.Return Code = %d",res); } memset(universal_password, 0, universal_password_len); free(universal_password); } } #endif } #ifdef NOVELL { VALUE_PAIR *vp_auth_opt; DICT_ATTR *dattr; char **auth_option; int auth_opt_attr; dattr = dict_attrbyname("eDir-Auth-Option"); auth_opt_attr = dattr->attr; if(pairfind(*check_pairs, auth_opt_attr) == NULL){ if ((auth_option = ldap_get_values(conn->ld, msg, "sasDefaultLoginSequence")) != NULL) { if ((vp_auth_opt = paircreate(auth_opt_attr, PW_TYPE_STRING)) == NULL){ radlog(L_ERR, " [%s] Could not allocate memory. Aborting.", inst->xlat_name); ldap_msgfree(result); ldap_release_conn(conn_id, inst); } strcpy(vp_auth_opt->vp_strvalue, auth_option[0]); vp_auth_opt->length = strlen(auth_option[0]); pairadd(&request->config_items, vp_auth_opt); }else{ RDEBUG("No default NMAS login sequence"); } } } #endif RDEBUG("looking for check items in directory..."); if ((check_tmp = ldap_pairget(conn->ld, msg, inst->check_item_map,check_pairs,1, inst)) != NULL) { if (inst->do_xlat){ pairxlatmove(request, check_pairs, &check_tmp); pairfree(&check_tmp); } else pairadd(check_pairs,check_tmp); } RDEBUG("looking for reply items in directory..."); if ((reply_tmp = ldap_pairget(conn->ld, msg, inst->reply_item_map,reply_pairs,0, inst)) != NULL) { if (inst->do_xlat){ pairxlatmove(request, reply_pairs, &reply_tmp); pairfree(&reply_tmp); } else pairadd(reply_pairs,reply_tmp); } if (inst->do_comp && paircompare(request,request->packet->vps,*check_pairs,reply_pairs) != 0){ #ifdef NOVELL /* Don't perform eDirectory APC if RADIUS authorize fails */ int apc_attr; VALUE_PAIR *vp_apc; DICT_ATTR *dattr; dattr = dict_attrbyname("eDir-APC"); apc_attr = dattr->attr; vp_apc = pairfind(request->config_items, apc_attr); if(vp_apc) vp_apc->vp_strvalue[0] = '1'; #endif RDEBUG("Pairs do not match. Rejecting user."); snprintf(module_fmsg,sizeof(module_fmsg)," [%s] Pairs do not match", inst->xlat_name); module_fmsg_vp = pairmake("Module-Failure-Message", module_fmsg, T_OP_EQ); pairadd(&request->packet->vps, module_fmsg_vp); ldap_msgfree(result); ldap_release_conn(conn_id,inst); return RLM_MODULE_REJECT; } /* * More warning messages for people who can't be bothered * to read the documentation. */ if (inst->expect_password && (debug_flag > 1)) { if (!pairfind(request->config_items, PW_CLEARTEXT_PASSWORD) && !pairfind(request->config_items, PW_NT_PASSWORD) && !pairfind(request->config_items, PW_USER_PASSWORD) && !pairfind(request->config_items, PW_PASSWORD_WITH_HEADER) && !pairfind(request->config_items, PW_CRYPT_PASSWORD)) { DEBUG("WARNING: No \"known good\" password was found in LDAP. Are you sure that the user is configured correctly?"); } } /* * Module should default to LDAP authentication if no Auth-Type * specified. Note that we do this ONLY if configured, AND we * set the Auth-Type to our module name, which allows multiple * ldap instances to work. */ if (inst->set_auth_type && (pairfind(*check_pairs, PW_AUTH_TYPE) == NULL) && request->password && (request->password->attribute == PW_USER_PASSWORD) && !added_known_password) { pairadd(check_pairs, pairmake("Auth-Type", inst->auth_type, T_OP_EQ)); RDEBUG("Setting Auth-Type = %s", inst->auth_type); } if (inst->access_attr) RDEBUG("user %s authorized to use remote access", request->username->vp_strvalue); ldap_msgfree(result); ldap_release_conn(conn_id,inst); return RLM_MODULE_OK; } /***************************************************************************** * * Function: rlm_ldap_authenticate * * Purpose: Check the user's password against ldap database * *****************************************************************************/ static int ldap_authenticate(void *instance, REQUEST * request) { LDAP *ld_user; LDAPMessage *result, *msg; ldap_instance *inst = instance; char *user_dn, *attrs[] = {"uid", NULL}; char filter[MAX_FILTER_STR_LEN]; char basedn[MAX_FILTER_STR_LEN]; int res; VALUE_PAIR *vp_user_dn; VALUE_PAIR *module_fmsg_vp; char module_fmsg[MAX_STRING_LEN]; LDAP_CONN *conn; int conn_id = -1; #ifdef NOVELL char *err = NULL; #endif basedn[0] = '\0'; /* * Ensure that we're being passed a plain-text password, and not * anything else. */ if (!request->username) { radlog(L_AUTH, " [%s] Attribute \"User-Name\" is required for authentication.\n", inst->xlat_name); return RLM_MODULE_INVALID; } if (!request->password){ radlog(L_AUTH, " [%s] Attribute \"User-Password\" is required for authentication.", inst->xlat_name); DEBUG2(" You seem to have set \"Auth-Type := LDAP\" somewhere."); DEBUG2(" THAT CONFIGURATION IS WRONG. DELETE IT."); DEBUG2(" YOU ARE PREVENTING THE SERVER FROM WORKING PROPERLY."); return RLM_MODULE_INVALID; } if(request->password->attribute != PW_USER_PASSWORD) { radlog(L_AUTH, " [%s] Attribute \"User-Password\" is required for authentication. Cannot use \"%s\".", inst->xlat_name, request->password->name); return RLM_MODULE_INVALID; } if (request->password->length == 0) { snprintf(module_fmsg,sizeof(module_fmsg)," [%s] empty password supplied", inst->xlat_name); module_fmsg_vp = pairmake("Module-Failure-Message", module_fmsg, T_OP_EQ); pairadd(&request->packet->vps, module_fmsg_vp); return RLM_MODULE_INVALID; } /* * Check that we don't have any failed connections. If we do there's no real need * of runing. Also give it another chance if we have a lot of failed connections. */ if (inst->failed_conns > MAX_FAILED_CONNS_END) inst->failed_conns = 0; if (inst->failed_conns > MAX_FAILED_CONNS_START){ inst->failed_conns++; return RLM_MODULE_FAIL; } RDEBUG("login attempt by \"%s\" with password \"%s\"", request->username->vp_strvalue, request->password->vp_strvalue); while ((vp_user_dn = pairfind(request->config_items, PW_LDAP_USERDN)) == NULL) { if (!radius_xlat(filter, sizeof(filter), inst->filter, request, ldap_escape_func)) { radlog(L_ERR, " [%s] unable to create filter.\n", inst->xlat_name); return RLM_MODULE_INVALID; } if (inst->basedn && !radius_xlat(basedn, sizeof(basedn), inst->basedn, request, ldap_escape_func)) { radlog(L_ERR, " [%s] unable to create basedn.\n", inst->xlat_name); return RLM_MODULE_INVALID; } if ((conn_id = ldap_get_conn(inst->conns,&conn,inst)) == -1){ radlog(L_ERR, " [%s] All ldap connections are in use", inst->xlat_name); return RLM_MODULE_FAIL; } if ((res = perform_search(instance, conn, basedn, LDAP_SCOPE_SUBTREE, filter, attrs, &result)) != RLM_MODULE_OK) { if (res == RLM_MODULE_NOTFOUND){ snprintf(module_fmsg,sizeof(module_fmsg)," [%s] User not found", inst->xlat_name); module_fmsg_vp = pairmake("Module-Failure-Message", module_fmsg, T_OP_EQ); pairadd(&request->packet->vps, module_fmsg_vp); } ldap_release_conn(conn_id,inst); return (res); } if ((msg = ldap_first_entry(conn->ld, result)) == NULL) { ldap_msgfree(result); ldap_release_conn(conn_id,inst); return RLM_MODULE_FAIL; } if ((user_dn = ldap_get_dn(conn->ld, msg)) == NULL) { RDEBUG("ldap_get_dn() failed"); ldap_msgfree(result); ldap_release_conn(conn_id,inst); return RLM_MODULE_FAIL; } ldap_release_conn(conn_id,inst); pairadd(&request->config_items, pairmake("Ldap-UserDn", user_dn, T_OP_EQ)); ldap_memfree(user_dn); ldap_msgfree(result); } user_dn = vp_user_dn->vp_strvalue; RDEBUG("user DN: %s", user_dn); #ifndef NOVELL ld_user = ldap_connect(instance, user_dn, request->password->vp_strvalue, 1, &res, NULL); #else /* Don't perform eDirectory APC again after attempting to bind here. */ { int apc_attr; DICT_ATTR *dattr; VALUE_PAIR *vp_apc; VALUE_PAIR *vp_auth_opt, *vp_state; int auth_opt_attr; char seq[256]; char host_ipaddr[32]; LDAP_CONN *conn1; int auth_state = -1; char *challenge = NULL; size_t challenge_len = MAX_CHALLENGE_LEN; char *state = NULL; dattr = dict_attrbyname("eDir-APC"); apc_attr = dattr->attr; vp_apc = pairfind(request->config_items, apc_attr); if(vp_apc && vp_apc->vp_strvalue[0] == '2') vp_apc->vp_strvalue[0] = '3'; res = 0; dattr = dict_attrbyname("eDir-Auth-Option"); auth_opt_attr = dattr->attr; vp_auth_opt = pairfind(request->config_items, auth_opt_attr); if(vp_auth_opt ) { RDEBUG("ldap auth option = %s", vp_auth_opt->vp_strvalue); strncpy(seq, vp_auth_opt->vp_strvalue, vp_auth_opt->length); seq[vp_auth_opt->length] = '\0'; if( strcasecmp(seq, "") ){ /* Get the client IP address to check for packet validity */ inet_ntop(AF_INET, &request->packet->src_ipaddr, host_ipaddr, sizeof(host_ipaddr)); /* challenge variable is used to receive the challenge from the * Token method (if any) and also to send the state attribute * in case the request packet is a reply to a challenge */ challenge = rad_malloc(MAX_CHALLENGE_LEN); /* If state attribute present in request it is a reply to challenge. */ if((vp_state = pairfind(request->packet->vps, PW_STATE))!= NULL ){ RDEBUG("Response to Access-Challenge"); strncpy(challenge, vp_state->vp_strvalue, sizeof(challenge)); challenge_len = vp_state->length; challenge[challenge_len] = 0; auth_state = -2; } if ((conn_id = ldap_get_conn(inst->conns, &conn1, inst)) == -1){ radlog(L_ERR, " [%s] All ldap connections are in use", inst->xlat_name); res = RLM_MODULE_FAIL; } if(!conn1){ radlog(L_ERR, " [%s] NULL connection handle passed", inst->xlat_name); return RLM_MODULE_FAIL; } if (conn1->failed_conns > MAX_FAILED_CONNS_START){ conn1->failed_conns++; if (conn1->failed_conns >= MAX_FAILED_CONNS_END){ conn1->failed_conns = MAX_FAILED_CONNS_RESTART; conn1->bound = 0; } } retry: if (!conn1->bound || conn1->ld == NULL) { DEBUG2(" [%s] attempting LDAP reconnection", inst->xlat_name); if (conn1->ld){ DEBUG2(" [%s] closing existing LDAP connection", inst->xlat_name); ldap_unbind_s(conn1->ld); } if ((conn1->ld = ldap_connect(instance, inst->login,inst->password, 0, &res, NULL)) == NULL) { radlog(L_ERR, " [%s] (re)connection attempt failed", inst->xlat_name); conn1->failed_conns++; return (RLM_MODULE_FAIL); } conn1->bound = 1; conn1->failed_conns = 0; } RDEBUG("Performing NMAS Authentication for user: %s, seq: %s \n", user_dn,seq); res = radLdapXtnNMASAuth(conn1->ld, user_dn, request->password->vp_strvalue, seq, host_ipaddr, &challenge_len, challenge, &auth_state ); switch(res){ case LDAP_SUCCESS: ldap_release_conn(conn_id,inst); if ( auth_state == -1) res = RLM_MODULE_FAIL; if ( auth_state != REQUEST_CHALLENGED){ if (auth_state == REQUEST_ACCEPTED){ RDEBUG("user %s authenticated succesfully",request->username->vp_strvalue); res = RLM_MODULE_OK; }else if(auth_state == REQUEST_REJECTED){ RDEBUG("user %s authentication failed",request->username->vp_strvalue); res = RLM_MODULE_REJECT; } }else{ /* Request challenged. Generate Reply-Message attribute with challenge data */ pairadd(&request->reply->vps,pairmake("Reply-Message", challenge, T_OP_EQ)); /* Generate state attribute */ state = rad_malloc(MAX_CHALLENGE_LEN); (void) sprintf(state, "%s%s", challenge, challenge); vp_state = paircreate(PW_STATE, PW_TYPE_OCTETS); memcpy(vp_state->vp_strvalue, state, strlen(state)); vp_state->length = strlen(state); pairadd(&request->reply->vps, vp_state); free(state); /* Mark the packet as a Acceess-Challenge Packet */ request->reply->code = PW_ACCESS_CHALLENGE; RDEBUG("Sending Access-Challenge."); res = RLM_MODULE_HANDLED; } if(challenge) free(challenge); return res; case LDAP_SERVER_DOWN: radlog(L_ERR, " [%s] nmas authentication failed: LDAP connection lost.", inst->xlat_name); conn->failed_conns++; if (conn->failed_conns <= MAX_FAILED_CONNS_START){ radlog(L_INFO, " [%s] Attempting reconnect", inst->xlat_name); conn->bound = 0; goto retry; } if(challenge) free(challenge); return RLM_MODULE_FAIL; default: ldap_release_conn(conn_id,inst); if(challenge) free(challenge); return RLM_MODULE_FAIL; } } } } ld_user = ldap_connect(instance, user_dn, request->password->vp_strvalue, 1, &res, &err); if(err != NULL){ /* 'err' contains the LDAP connection error description */ RDEBUG("%s", err); pairadd(&request->reply->vps, pairmake("Reply-Message", err, T_OP_EQ)); ldap_memfree((void *)err); } #endif if (ld_user == NULL){ if (res == RLM_MODULE_REJECT){ inst->failed_conns = 0; snprintf(module_fmsg,sizeof(module_fmsg)," [%s] Bind as user failed", inst->xlat_name); module_fmsg_vp = pairmake("Module-Failure-Message", module_fmsg, T_OP_EQ); pairadd(&request->packet->vps, module_fmsg_vp); } if (res == RLM_MODULE_FAIL){ RDEBUG("ldap_connect() failed"); inst->failed_conns++; } return (res); } RDEBUG("user %s authenticated succesfully", request->username->vp_strvalue); ldap_unbind_s(ld_user); inst->failed_conns = 0; return RLM_MODULE_OK; } #ifdef NOVELL /***************************************************************************** * * Function: rlm_ldap_postauth * * Purpose: Perform eDirectory account policy check and failed-login reporting * to eDirectory. * *****************************************************************************/ static int ldap_postauth(void *instance, REQUEST * request) { int res = RLM_MODULE_FAIL; int inst_attr, apc_attr; char password[UNIVERSAL_PASS_LEN]; ldap_instance *inst = instance; LDAP_CONN *conn; VALUE_PAIR *vp_inst, *vp_apc; DICT_ATTR *dattr; dattr = dict_attrbyname("LDAP-Instance"); inst_attr = dattr->attr; dattr = dict_attrbyname("eDir-APC"); apc_attr = dattr->attr; vp_inst = pairfind(request->config_items, inst_attr); /* * Check if the password in the config items list is the user's UP which has * been read in the authorize method of this instance of the LDAP module. */ if((vp_inst == NULL) || strcmp(vp_inst->vp_strvalue, inst->xlat_name)) return RLM_MODULE_NOOP; vp_apc = pairfind(request->config_items, apc_attr); switch(vp_apc->vp_strvalue[0]){ case '1': /* Account policy check not enabled */ case '3': /* Account policy check has been completed */ res = RLM_MODULE_NOOP; break; case '2': { int err, conn_id = -1; char *error_msg = NULL; VALUE_PAIR *vp_fdn, *vp_pwd; DICT_ATTR *da; if (request->reply->code == PW_AUTHENTICATION_REJECT) { /* Bind to eDirectory as the RADIUS user with a wrong password. */ vp_pwd = pairfind(request->config_items, PW_CLEARTEXT_PASSWORD); if (vp_pwd && *vp_pwd->vp_strvalue) { strcpy(password, vp_pwd->vp_strvalue); if (password[0] != 'a') { password[0] = 'a'; } else { password[0] = 'b'; } } else { strcpy(password, "dummy_password"); } res = RLM_MODULE_REJECT; } else { /* Bind to eDirectory as the RADIUS user using the user's UP */ vp_pwd = pairfind(request->config_items, PW_CLEARTEXT_PASSWORD); if (vp_pwd == NULL) { RDEBUG("User's Universal Password not in config items list."); return RLM_MODULE_FAIL; } strcpy(password, vp_pwd->vp_strvalue); } if ((da = dict_attrbyname("Ldap-UserDn")) == NULL) { RDEBUG("Attribute for user FDN not found in dictionary. Unable to proceed"); return RLM_MODULE_FAIL; } vp_fdn = pairfind(request->config_items, da->attr); if (vp_fdn == NULL) { RDEBUG("User's FQDN not in config items list."); return RLM_MODULE_FAIL; } if ((conn_id = ldap_get_conn(inst->apc_conns, &conn, inst)) == -1){ radlog(L_ERR, " [%s] All ldap connections are in use", inst->xlat_name); return RLM_MODULE_FAIL; } /* * If there is an existing LDAP * connection to the directory, * bind over it. Otherwise, * establish a new connection. */ postauth_reconnect: if (!conn->bound || conn->ld == NULL) { DEBUG2(" [%s] attempting LDAP reconnection", inst->xlat_name); if (conn->ld){ DEBUG2(" [%s] closing existing LDAP connection", inst->xlat_name); ldap_unbind_s(conn->ld); } if ((conn->ld = ldap_connect(instance, (char *)vp_fdn->vp_strvalue, password, 0, &res, &error_msg)) == NULL) { radlog(L_ERR, " [%s] eDirectory account policy check failed.", inst->xlat_name); if (error_msg != NULL) { RDEBUG("%s", error_msg); pairadd(&request->reply->vps, pairmake("Reply-Message", error_msg, T_OP_EQ)); ldap_memfree((void *)error_msg); } vp_apc->vp_strvalue[0] = '3'; ldap_release_apc_conn(conn_id, inst); return RLM_MODULE_REJECT; } conn->bound = 1; } else if((err = ldap_simple_bind_s(conn->ld, (char *)vp_fdn->vp_strvalue, password)) != LDAP_SUCCESS) { if (err == LDAP_SERVER_DOWN) { conn->bound = 0; goto postauth_reconnect; } RDEBUG("eDirectory account policy check failed."); ldap_get_option(conn->ld, LDAP_OPT_ERROR_STRING, &error_msg); if (error_msg != NULL) { RDEBUG("%s", error_msg); pairadd(&request->reply->vps, pairmake("Reply-Message", error_msg, T_OP_EQ)); ldap_memfree((void *)error_msg); } vp_apc->vp_strvalue[0] = '3'; ldap_release_apc_conn(conn_id, inst); return RLM_MODULE_REJECT; } vp_apc->vp_strvalue[0] = '3'; ldap_release_apc_conn(conn_id, inst); return RLM_MODULE_OK; } } return res; } #endif #if LDAP_SET_REBIND_PROC_ARGS == 3 static int ldap_rebind(LDAP *ld, LDAP_CONST char *url, UNUSED ber_tag_t request, UNUSED ber_int_t msgid, void *params ) { ldap_instance *inst = params; DEBUG(" [%s] rebind to URL %s", inst->xlat_name,url); return ldap_bind_s(ld, inst->login, inst->password, LDAP_AUTH_SIMPLE); } #endif static LDAP *ldap_connect(void *instance, const char *dn, const char *password, int auth, int *result, char **err) { ldap_instance *inst = instance; LDAP *ld = NULL; int msgid, rc, ldap_version; int ldap_errno = 0; LDAPMessage *res; struct timeval tv; if (inst->is_url){ #ifdef HAVE_LDAP_INITIALIZE DEBUG(" [%s] (re)connect to %s, authentication %d", inst->xlat_name, inst->server, auth); if (ldap_initialize(&ld, inst->server) != LDAP_SUCCESS) { radlog(L_ERR, " [%s] ldap_initialize() failed", inst->xlat_name); *result = RLM_MODULE_FAIL; return (NULL); } #endif } else { DEBUG(" [%s] (re)connect to %s:%d, authentication %d", inst->xlat_name, inst->server, inst->port, auth); if ((ld = ldap_init(inst->server, inst->port)) == NULL) { radlog(L_ERR, " [%s] ldap_init() failed", inst->xlat_name); *result = RLM_MODULE_FAIL; return (NULL); } } tv.tv_sec = inst->net_timeout; tv.tv_usec = 0; if (ldap_set_option(ld, LDAP_OPT_NETWORK_TIMEOUT, (void *) &tv) != LDAP_OPT_SUCCESS) { ldap_get_option(ld, LDAP_OPT_ERROR_NUMBER, &ldap_errno); radlog(L_ERR, " [%s] Could not set LDAP_OPT_NETWORK_TIMEOUT %d: %s", inst->xlat_name, inst->net_timeout, ldap_err2string(ldap_errno)); } /* * Leave "chase_referrals" unset to use the OpenLDAP * default. */ if (inst->chase_referrals != 2) { if (inst->chase_referrals) { rc=ldap_set_option(ld, LDAP_OPT_REFERRALS, LDAP_OPT_ON); #if LDAP_SET_REBIND_PROC_ARGS == 3 if (inst->rebind == 1) { ldap_set_rebind_proc(ld, ldap_rebind, inst); } #endif } else { rc=ldap_set_option(ld, LDAP_OPT_REFERRALS, LDAP_OPT_OFF); } if (rc != LDAP_OPT_SUCCESS) { ldap_get_option(ld, LDAP_OPT_ERROR_NUMBER, &ldap_errno); radlog(L_ERR, " [%s] Could not set LDAP_OPT_REFERRALS=%d %s", inst->xlat_name, inst->chase_referrals, ldap_err2string(ldap_errno)); } } if (ldap_set_option(ld, LDAP_OPT_TIMELIMIT, (void *) &(inst->timelimit)) != LDAP_OPT_SUCCESS) { ldap_get_option(ld, LDAP_OPT_ERROR_NUMBER, &ldap_errno); radlog(L_ERR, " [%s] Could not set LDAP_OPT_TIMELIMIT %d: %s", inst->xlat_name, inst->timelimit, ldap_err2string(ldap_errno)); } if (inst->ldap_debug && ldap_set_option(NULL, LDAP_OPT_DEBUG_LEVEL, &(inst->ldap_debug)) != LDAP_OPT_SUCCESS) { ldap_get_option(ld, LDAP_OPT_ERROR_NUMBER, &ldap_errno); radlog(L_ERR, " [%s] Could not set LDAP_OPT_DEBUG_LEVEL %d: %s", inst->xlat_name, inst->ldap_debug, ldap_err2string(ldap_errno)); } ldap_version = LDAP_VERSION3; if (ldap_set_option(ld, LDAP_OPT_PROTOCOL_VERSION, &ldap_version) != LDAP_OPT_SUCCESS) { ldap_get_option(ld, LDAP_OPT_ERROR_NUMBER, &ldap_errno); radlog(L_ERR, " [%s] Could not set LDAP version to V3: %s", inst->xlat_name, ldap_err2string(ldap_errno)); } #ifdef LDAP_OPT_X_KEEPALIVE_IDLE if (ldap_set_option(ld, LDAP_OPT_X_KEEPALIVE_IDLE, (void *) &(inst->keepalive_idle)) != LDAP_OPT_SUCCESS) { ldap_get_option(ld, LDAP_OPT_ERROR_NUMBER, &ldap_errno); radlog(L_ERR, " [%s] Could not set LDAP_OPT_X_KEEPALIVE_IDLE %d: %s", inst->xlat_name, inst->keepalive_idle, ldap_err2string(ldap_errno)); } #endif #ifdef LDAP_OPT_X_KEEPALIVE_PROBES if (ldap_set_option(ld, LDAP_OPT_X_KEEPALIVE_PROBES, (void *) &(inst->keepalive_probes)) != LDAP_OPT_SUCCESS) { ldap_get_option(ld, LDAP_OPT_ERROR_NUMBER, &ldap_errno); radlog(L_ERR, " [%s] Could not set LDAP_OPT_X_KEEPALIVE_PROBES %d: %s", inst->xlat_name, inst->keepalive_probes, ldap_err2string(ldap_errno)); } #endif #ifdef LDAP_OPT_X_KEEPALIVE_INTERVAL if (ldap_set_option(ld, LDAP_OPT_X_KEEPALIVE_INTERVAL, (void *) &(inst->keepalive_interval)) != LDAP_OPT_SUCCESS) { ldap_get_option(ld, LDAP_OPT_ERROR_NUMBER, &ldap_errno); radlog(L_ERR, " [%s] Could not set LDAP_OPT_X_KEEPALIVE_INTERVAL %d: %s", inst->xlat_name, inst->keepalive_interval, ldap_err2string(ldap_errno)); } #endif #ifdef HAVE_LDAP_START_TLS if (inst->tls_mode) { DEBUG(" [%s] setting TLS mode to %d", inst->xlat_name, inst->tls_mode); if (ldap_set_option(ld, LDAP_OPT_X_TLS, (void *) &(inst->tls_mode)) != LDAP_OPT_SUCCESS) { ldap_get_option(ld, LDAP_OPT_ERROR_NUMBER, &ldap_errno); radlog(L_ERR, " [%s] could not set LDAP_OPT_X_TLS option %s:", inst->xlat_name, ldap_err2string(ldap_errno)); } } if (inst->tls_cacertfile != NULL) { DEBUG(" [%s] setting TLS CACert File to %s", inst->xlat_name, inst->tls_cacertfile); if ( ldap_set_option( NULL, LDAP_OPT_X_TLS_CACERTFILE, (void *) inst->tls_cacertfile ) != LDAP_OPT_SUCCESS) { ldap_get_option(ld, LDAP_OPT_ERROR_NUMBER, &ldap_errno); radlog(L_ERR, " [%s] could not set " "LDAP_OPT_X_TLS_CACERTFILE option to %s: %s", inst->xlat_name, inst->tls_cacertfile, ldap_err2string(ldap_errno)); } } if (inst->tls_cacertdir != NULL) { DEBUG(" [%s] setting TLS CACert Directory to %s", inst->xlat_name, inst->tls_cacertdir); if ( ldap_set_option( NULL, LDAP_OPT_X_TLS_CACERTDIR, (void *) inst->tls_cacertdir ) != LDAP_OPT_SUCCESS) { ldap_get_option(ld, LDAP_OPT_ERROR_NUMBER, &ldap_errno); radlog(L_ERR, " [%s] could not set " "LDAP_OPT_X_TLS_CACERTDIR option to %s: %s", inst->xlat_name, inst->tls_cacertdir, ldap_err2string(ldap_errno)); } } if (strcmp(TLS_DEFAULT_VERIFY, inst->tls_require_cert ) != 0 ) { DEBUG(" [%s] setting TLS Require Cert to %s", inst->xlat_name, inst->tls_require_cert); } #ifdef HAVE_LDAP_INT_TLS_CONFIG if (ldap_int_tls_config(NULL, LDAP_OPT_X_TLS_REQUIRE_CERT, (inst->tls_require_cert)) != LDAP_OPT_SUCCESS) { ldap_get_option(ld, LDAP_OPT_ERROR_NUMBER, &ldap_errno); radlog(L_ERR, " [%s] could not set ", "LDAP_OPT_X_TLS_REQUIRE_CERT option to %s: %s", inst->xlat_name, inst->tls_require_cert, ldap_err2string(ldap_errno)); } #endif if (inst->tls_certfile != NULL) { DEBUG(" [%s] setting TLS Cert File to %s", inst->xlat_name, inst->tls_certfile); if (ldap_set_option(NULL, LDAP_OPT_X_TLS_CERTFILE, (void *) inst->tls_certfile) != LDAP_OPT_SUCCESS) { ldap_get_option(ld, LDAP_OPT_ERROR_NUMBER, &ldap_errno); radlog(L_ERR, " [%s] could not set " "LDAP_OPT_X_TLS_CERTFILE option to %s: %s", inst->xlat_name, inst->tls_certfile, ldap_err2string(ldap_errno)); } } if (inst->tls_keyfile != NULL) { DEBUG(" [%s] setting TLS Key File to %s", inst->xlat_name, inst->tls_keyfile); if ( ldap_set_option( NULL, LDAP_OPT_X_TLS_KEYFILE, (void *) inst->tls_keyfile ) != LDAP_OPT_SUCCESS) { ldap_get_option(ld, LDAP_OPT_ERROR_NUMBER, &ldap_errno); radlog(L_ERR, " [%s] could not set " "LDAP_OPT_X_TLS_KEYFILE option to %s: %s", inst->xlat_name, inst->tls_keyfile, ldap_err2string(ldap_errno)); } } if (inst->tls_randfile != NULL) { DEBUG(" [%s] setting TLS Rand File to %s", inst->xlat_name, inst->tls_randfile); if (ldap_set_option(NULL, LDAP_OPT_X_TLS_RANDOM_FILE, (void *) inst->tls_randfile) != LDAP_OPT_SUCCESS) { ldap_get_option(ld, LDAP_OPT_ERROR_NUMBER, &ldap_errno); radlog(L_ERR, " [%s] could not set " "LDAP_OPT_X_TLS_RANDOM_FILE option to %s: %s", inst->xlat_name, inst->tls_randfile, ldap_err2string(ldap_errno)); } } if (inst->start_tls) { DEBUG(" [%s] starting TLS", inst->xlat_name); rc = ldap_start_tls_s(ld, NULL, NULL); if (rc != LDAP_SUCCESS) { DEBUG(" [%s] ldap_start_tls_s()", inst->xlat_name); ldap_get_option(ld, LDAP_OPT_ERROR_NUMBER, &ldap_errno); radlog(L_ERR, " [%s] could not start TLS %s", inst->xlat_name, ldap_err2string(ldap_errno)); *result = RLM_MODULE_FAIL; ldap_unbind_s(ld); return (NULL); } } #endif /* HAVE_LDAP_START_TLS */ if (inst->is_url){ DEBUG(" [%s] bind as %s/%s to %s", inst->xlat_name, dn, password, inst->server); } else { DEBUG(" [%s] bind as %s/%s to %s:%d", inst->xlat_name, dn, password, inst->server, inst->port); } msgid = ldap_bind(ld, dn, password,LDAP_AUTH_SIMPLE); if (msgid == -1) { ldap_get_option(ld, LDAP_OPT_ERROR_NUMBER, &ldap_errno); if(err != NULL){ ldap_get_option(ld, LDAP_OPT_ERROR_STRING, err); } if (inst->is_url) { radlog(L_ERR, " [%s] %s bind to %s failed: %s", inst->xlat_name, dn, inst->server, ldap_err2string(ldap_errno)); } else { radlog(L_ERR, " [%s] %s bind to %s:%d failed: %s", inst->xlat_name, dn, inst->server, inst->port, ldap_err2string(ldap_errno)); } *result = RLM_MODULE_FAIL; ldap_unbind_s(ld); return (NULL); } DEBUG(" [%s] waiting for bind result ...", inst->xlat_name); tv.tv_sec = inst->timeout; tv.tv_usec = 0; rc = ldap_result(ld, msgid, 1, &tv, &res); if (rc < 1) { DEBUG(" [%s] ldap_result()", inst->xlat_name); ldap_get_option(ld, LDAP_OPT_ERROR_NUMBER, &ldap_errno); if(err != NULL){ ldap_get_option(ld, LDAP_OPT_ERROR_STRING, err); } if (inst->is_url) { radlog(L_ERR, " [%s] %s bind to %s failed: %s", inst->xlat_name, dn, inst->server, (rc == 0) ? "timeout" : ldap_err2string(ldap_errno)); } else { radlog(L_ERR, " [%s] %s bind to %s:%d failed: %s", inst->xlat_name, dn, inst->server, inst->port, (rc == 0) ? "timeout" : ldap_err2string(ldap_errno)); } *result = RLM_MODULE_FAIL; ldap_unbind_s(ld); return (NULL); } ldap_errno = ldap_result2error(ld, res, 1); switch (ldap_errno) { case LDAP_SUCCESS: DEBUG(" [%s] Bind was successful", inst->xlat_name); *result = RLM_MODULE_OK; break; case LDAP_INVALID_CREDENTIALS: if (auth){ DEBUG(" [%s] Bind failed with invalid credentials", inst->xlat_name); *result = RLM_MODULE_REJECT; } else { radlog(L_ERR, " [%s] LDAP login failed: check identity, password settings in ldap module configuration", inst->xlat_name); *result = RLM_MODULE_FAIL; } if(err != NULL){ ldap_get_option(ld, LDAP_OPT_ERROR_STRING, err); } break; case LDAP_CONSTRAINT_VIOLATION: DEBUG("rlm_ldap: Bind failed with constraint violation"); *result = RLM_MODULE_REJECT; if(err != NULL){ ldap_get_option(ld, LDAP_OPT_ERROR_STRING, err); } break; default: if (inst->is_url) { radlog(L_ERR," [%s] %s bind to %s failed %s", inst->xlat_name, dn, inst->server, ldap_err2string(ldap_errno)); } else { radlog(L_ERR," [%s] %s bind to %s:%d failed %s", inst->xlat_name, dn, inst->server, inst->port, ldap_err2string(ldap_errno)); } *result = RLM_MODULE_FAIL; if(err != NULL){ ldap_get_option(ld, LDAP_OPT_ERROR_STRING, err); } } if (*result != RLM_MODULE_OK) { ldap_unbind_s(ld); ld = NULL; } return ld; } /***************************************************************************** * * Detach from the LDAP server and cleanup internal state. * *****************************************************************************/ static int ldap_detach(void *instance) { ldap_instance *inst = instance; TLDAP_RADIUS *pair, *nextpair; if (inst->conns) { int i; for (i = 0;i < inst->num_conns; i++) { if (inst->conns[i].locked) return -1; if (inst->conns[i].ld){ ldap_unbind_s(inst->conns[i].ld); } pthread_mutex_destroy(&inst->conns[i].mutex); } free(inst->conns); } #ifdef NOVELL if (inst->apc_conns){ int i; for (i = 0; i < inst->num_conns; i++) { if (inst->apc_conns[i].locked) return -1; if (inst->apc_conns[i].ld){ ldap_unbind_s(inst->apc_conns[i].ld); } pthread_mutex_destroy(&inst->apc_conns[i].mutex); } free(inst->apc_conns); } #endif pair = inst->check_item_map; while (pair != NULL) { nextpair = pair->next; free(pair->attr); free(pair->radius_attr); free(pair); pair = nextpair; } pair = inst->reply_item_map; while (pair != NULL) { nextpair = pair->next; free(pair->attr); free(pair->radius_attr); free(pair); pair = nextpair; } if (inst->atts) free(inst->atts); paircompare_unregister(PW_LDAP_GROUP, ldap_groupcmp); xlat_unregister(inst->xlat_name,ldap_xlat, instance); free(inst->xlat_name); free(inst); return 0; } #ifdef FIELDCPY static void fieldcpy(char *string, char **uptr) { char *ptr; ptr = *uptr; while (*ptr == ' ' || *ptr == '\t') { ptr++; } if (*ptr == '"') { ptr++; while (*ptr != '"' && *ptr != '\0' && *ptr != '\n') { *string++ = *ptr++; } *string = '\0'; if (*ptr == '"') { ptr++; } *uptr = ptr; return; } while (*ptr != ' ' && *ptr != '\t' && *ptr != '\0' && *ptr != '\n' && *ptr != '=' && *ptr != ',') { *string++ = *ptr++; } *string = '\0'; *uptr = ptr; return; } #endif /* * Copied from src/lib/token.c */ static const FR_NAME_NUMBER tokens[] = { { "=~", T_OP_REG_EQ, }, /* order is important! */ { "!~", T_OP_REG_NE, }, { "{", T_LCBRACE, }, { "}", T_RCBRACE, }, { "(", T_LBRACE, }, { ")", T_RBRACE, }, { ",", T_COMMA, }, { "+=", T_OP_ADD, }, { "-=", T_OP_SUB, }, { ":=", T_OP_SET, }, { "=*", T_OP_CMP_TRUE, }, { "!*", T_OP_CMP_FALSE, }, { "==", T_OP_CMP_EQ, }, { "=", T_OP_EQ, }, { "!=", T_OP_NE, }, { ">=", T_OP_GE, }, { ">", T_OP_GT, }, { "<=", T_OP_LE, }, { "<", T_OP_LT, }, { NULL, 0} }; /***************************************************************************** * Get RADIUS attributes from LDAP object * ( according to draft-adoba-radius-05.txt * ) * *****************************************************************************/ static VALUE_PAIR *ldap_pairget(LDAP *ld, LDAPMessage *entry, TLDAP_RADIUS *item_map, VALUE_PAIR **pairs, int is_check, ldap_instance *inst) { char **vals; int vals_count; int vals_idx; const char *ptr; const char *value; TLDAP_RADIUS *element; FR_TOKEN token, operator; int is_generic_attribute; char buf[MAX_STRING_LEN]; VALUE_PAIR *pairlist = NULL; VALUE_PAIR *newpair = NULL; char do_xlat = FALSE; char print_buffer[2048]; /* * check if there is a mapping from this LDAP attribute * to a RADIUS attribute */ for (element = item_map; element != NULL; element = element->next) { /* * No mapping, skip it. */ if ((vals = ldap_get_values(ld,entry,element->attr)) == NULL) continue; /* * Check whether this is a one-to-one-mapped ldap * attribute or a generic attribute and set flag * accordingly. */ if (strcasecmp(element->radius_attr, GENERIC_ATTRIBUTE_ID)==0) is_generic_attribute = 1; else is_generic_attribute = 0; /* * Find out how many values there are for the * attribute and extract all of them. */ vals_count = ldap_count_values(vals); for (vals_idx = 0; vals_idx < vals_count; vals_idx++) { value = vals[vals_idx]; if (is_generic_attribute) { /* * This is a generic attribute. */ FR_TOKEN dummy; /* makes pairread happy */ /* not sure if using pairread here is ok ... */ if ( (newpair = pairread(&value, &dummy)) != NULL) { DEBUG(" [%s] extracted attribute %s from generic item %s", inst->xlat_name, newpair->name, vals[vals_idx]); pairadd(&pairlist, newpair); } else { radlog(L_ERR, " [%s] parsing %s failed: %s", inst->xlat_name, element->attr, vals[vals_idx]); } } else { /* * This is a one-to-one-mapped attribute */ ptr = value; operator = gettoken(&ptr, buf, sizeof(buf)); if (operator < T_EQSTART || operator > T_EQEND) { /* no leading operator found */ if (element->operator != T_OP_INVALID) operator = element->operator; else if (is_check) operator = T_OP_CMP_EQ; else operator = T_OP_EQ; } else { /* the value is after the operator */ value = ptr; } /* * Do xlat if the *entire* string * is quoted. */ if ((value[0] == '\'' || value[0] == '"' || value[0] == '`') && (value[0] == value[strlen(value)-1])) { ptr = value; token = gettoken(&ptr, buf, sizeof(buf)); switch (token) { /* take the unquoted string */ case T_SINGLE_QUOTED_STRING: case T_DOUBLE_QUOTED_STRING: value = buf; break; /* the value will be xlat'ed later */ case T_BACK_QUOTED_STRING: value = buf; do_xlat = TRUE; break; /* keep the original string */ default: break; } } if (value[0] == '\0') { DEBUG(" [%s] Attribute %s has no value", inst->xlat_name, element->attr); continue; } /* * Create the pair. */ newpair = pairmake(element->radius_attr, do_xlat ? NULL : value, operator); if (newpair == NULL) { radlog(L_ERR, " [%s] Failed to create the pair: %s", inst->xlat_name, fr_strerror()); continue; } if (do_xlat) { newpair->flags.do_xlat = 1; strlcpy(newpair->vp_strvalue, buf, sizeof(newpair->vp_strvalue)); newpair->length = 0; } vp_prints(print_buffer, sizeof(print_buffer), newpair); DEBUG(" [%s] %s -> %s", inst->xlat_name, element->attr, print_buffer); /* * Add the pair into the packet. */ if (!vals_idx){ pairdelete(pairs, newpair->attribute); } pairadd(&pairlist, newpair); } } ldap_value_free(vals); } return (pairlist); } /* globally exported name */ module_t rlm_ldap = { RLM_MODULE_INIT, "LDAP", RLM_TYPE_THREAD_SAFE, /* type: reserved */ ldap_instantiate, /* instantiation */ ldap_detach, /* detach */ { ldap_authenticate, /* authentication */ ldap_authorize, /* authorization */ NULL, /* preaccounting */ NULL, /* accounting */ NULL, /* checksimul */ NULL, /* pre-proxy */ NULL, /* post-proxy */ #ifdef NOVELL ldap_postauth /* post-auth */ #else NULL #endif }, }; freeradius-server/src/modules/rlm_linelog/000077500000000000000000000000001257552170400212655ustar00rootroot00000000000000freeradius-server/src/modules/rlm_linelog/Makefile000077500000000000000000000001441257552170400227270ustar00rootroot00000000000000# # Makefile # # Version: $Id$ # TARGET = rlm_linelog SRCS = rlm_linelog.c include ../rules.mak freeradius-server/src/modules/rlm_linelog/rlm_linelog.c000066400000000000000000000172551257552170400237460ustar00rootroot00000000000000/* * rlm_linelog.c * * Version: $Id$ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2004,2006 The FreeRADIUS server project * Copyright 2004 Alan DeKok */ #include RCSID("$Id$") #include #include #ifdef HAVE_FCNTL_H #include #endif #ifdef HAVE_UNISTD_H #include #endif #ifdef HAVE_GRP_H #include #endif #ifdef HAVE_SYSLOG_H #include #ifndef LOG_INFO #define LOG_INFO (0) #endif #endif /* * Syslog facilities from main/mainconfig.c */ extern const FR_NAME_NUMBER syslog_str2fac[]; /* * Define a structure for our module configuration. */ typedef struct rlm_linelog_t { CONF_SECTION *cs; char *filename; char *syslog_facility; int facility; int permissions; char *group; char *line; char *reference; } rlm_linelog_t; /* * A mapping of configuration file names to internal variables. * * Note that the string is dynamically allocated, so it MUST * be freed. When the configuration file parse re-reads the string, * it free's the old one, and strdup's the new one, placing the pointer * to the strdup'd string into 'config.string'. This gets around * buffer over-flows. */ static const CONF_PARSER module_config[] = { { "filename", PW_TYPE_STRING_PTR, offsetof(rlm_linelog_t,filename), NULL, NULL}, { "syslog_facility", PW_TYPE_STRING_PTR, offsetof(rlm_linelog_t,syslog_facility), NULL, NULL}, { "permissions", PW_TYPE_INTEGER, offsetof(rlm_linelog_t,permissions), NULL, "0600"}, { "group", PW_TYPE_STRING_PTR, offsetof(rlm_linelog_t,group), NULL, NULL}, { "format", PW_TYPE_STRING_PTR, offsetof(rlm_linelog_t,line), NULL, NULL}, { "reference", PW_TYPE_STRING_PTR, offsetof(rlm_linelog_t,reference), NULL, NULL}, { NULL, -1, 0, NULL, NULL } /* end the list */ }; static int linelog_detach(void *instance) { rlm_linelog_t *inst = instance; free(inst); return 0; } /* * Instantiate the module. */ static int linelog_instantiate(CONF_SECTION *conf, void **instance) { rlm_linelog_t *inst; /* * Set up a storage area for instance data */ inst = rad_malloc(sizeof(*inst)); memset(inst, 0, sizeof(*inst)); /* * If the configuration parameters can't be parsed, then * fail. */ if (cf_section_parse(conf, inst, module_config) < 0) { linelog_detach(inst); return -1; } if (!inst->filename) { radlog(L_ERR, "rlm_linelog: Must specify an output filename"); linelog_detach(inst); return -1; } #ifndef HAVE_SYSLOG_H if (strcmp(inst->filename, "syslog") == 0) { radlog(L_ERR, "rlm_linelog: Syslog output is not supported"); linelog_detach(inst); return -1; } #else inst->facility = 0; if (inst->syslog_facility) { inst->facility = fr_str2int(syslog_str2fac, inst->syslog_facility, -1); if (inst->facility < 0) { radlog(L_ERR, "rlm_linelog: Bad syslog facility '%s'", inst->syslog_facility); linelog_detach(inst); return -1; } } inst->facility |= LOG_INFO; #endif if (!inst->line) { radlog(L_ERR, "rlm_linelog: Must specify a log format"); linelog_detach(inst); return -1; } inst->cs = conf; *instance = inst; return 0; } /* * Escape unprintable characters. */ static size_t linelog_escape_func(char *out, size_t outlen, const char *in) { int len = 0; if (outlen == 0) return 0; if (outlen == 1) { *out = '\0'; return 0; } while (in[0]) { if (in[0] >= ' ') { if (in[0] == '\\') { if (outlen <= 2) break; outlen--; *out++ = '\\'; len++; } outlen--; if (outlen == 1) break; *out++ = *in++; len++; continue; } switch (in[0]) { case '\n': if (outlen <= 2) break; *out++ = '\\'; *out++ = 'n'; in++; len += 2; break; case '\r': if (outlen <= 2) break; *out++ = '\\'; *out++ = 'r'; in++; len += 2; break; default: if (outlen <= 4) break; snprintf(out, outlen, "\\%03o", (uint8_t) *in); in++; out += 4; outlen -= 4; len += 4; break; } } *out = '\0'; return len; } static int do_linelog(void *instance, REQUEST *request) { int fd = -1; char buffer[4096]; char *p; char line[1024]; rlm_linelog_t *inst = (rlm_linelog_t*) instance; const char *value = inst->line; #ifdef HAVE_GRP_H gid_t gid; struct group *grp; char *endptr; #endif if (inst->reference) { CONF_ITEM *ci; CONF_PAIR *cp; radius_xlat(line + 1, sizeof(line) - 2, inst->reference, request, linelog_escape_func); line[0] = '.'; /* force to be in current section */ /* * Don't allow it to go back up */ if (line[1] == '.') goto do_log; ci = cf_reference_item(NULL, inst->cs, line); if (!ci) { RDEBUG2("No such entry \"%s\"", line); return RLM_MODULE_NOOP; } if (!cf_item_is_pair(ci)) { RDEBUG2("Entry \"%s\" is not a variable assignment ", line); goto do_log; } cp = cf_itemtopair(ci); value = cf_pair_value(cp); if (!value) { RDEBUG2("Entry \"%s\" has no value", line); goto do_log; } /* * Value exists, but is empty. Don't log anything. */ if (!*value) return RLM_MODULE_OK; } do_log: /* * FIXME: Check length. */ if (strcmp(inst->filename, "syslog") != 0) { radius_xlat(buffer, sizeof(buffer), inst->filename, request, rad_filename_escape); /* check path and eventually create subdirs */ p = strrchr(buffer,'/'); if (p) { *p = '\0'; if (rad_mkdir(buffer, 0700) < 0) { radlog_request(L_ERR, 0, request, "rlm_linelog: Failed to create directory %s: %s", buffer, strerror(errno)); return RLM_MODULE_FAIL; } *p = '/'; } fd = open(buffer, O_WRONLY | O_APPEND | O_CREAT, inst->permissions); if (fd == -1) { radlog(L_ERR, "rlm_linelog: Failed to open %s: %s", buffer, strerror(errno)); return RLM_MODULE_FAIL; } #ifdef HAVE_GRP_H if (inst->group != NULL) { gid = strtol(inst->group, &endptr, 10); if (*endptr != '\0') { grp = getgrnam(inst->group); if (grp == NULL) { RDEBUG2("Unable to find system group \"%s\"", inst->group); goto skip_group; } gid = grp->gr_gid; } if (chown(buffer, -1, gid) == -1) { RDEBUG2("Unable to change system group of \"%s\"", buffer); } } #endif } skip_group: /* * FIXME: Check length. */ radius_xlat(line, sizeof(line) - 1, value, request, linelog_escape_func); if (fd >= 0) { strcat(line, "\n"); write(fd, line, strlen(line)); close(fd); #ifdef HAVE_SYSLOG_H } else { syslog(inst->facility, "%s", line); #endif } return RLM_MODULE_OK; } /* * Externally visible module definition. */ module_t rlm_linelog = { RLM_MODULE_INIT, "linelog", RLM_TYPE_CHECK_CONFIG_SAFE, /* type */ linelog_instantiate, /* instantiation */ linelog_detach, /* detach */ { do_linelog, /* authentication */ do_linelog, /* authorization */ do_linelog, /* preaccounting */ do_linelog, /* accounting */ NULL, /* checksimul */ do_linelog, /* pre-proxy */ do_linelog, /* post-proxy */ do_linelog /* post-auth */ #ifdef WITH_COA , do_linelog, /* recv-coa */ do_linelog /* send-coa */ #endif }, }; freeradius-server/src/modules/rlm_logintime/000077500000000000000000000000001257552170400216235ustar00rootroot00000000000000freeradius-server/src/modules/rlm_logintime/Makefile000066400000000000000000000001221257552170400232560ustar00rootroot00000000000000TARGET = rlm_logintime SRCS = rlm_logintime.c timestr.c include ../rules.mak freeradius-server/src/modules/rlm_logintime/rlm_logintime.c000066400000000000000000000210331257552170400246270ustar00rootroot00000000000000/* * rlm_logintime.c * * Version: $Id$ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2001,2006 The FreeRADIUS server project * Copyright 2004 Kostas Kalevras */ #include RCSID("$Id$") #include #include #include /* * Define a structure for our module configuration. * * These variables do not need to be in a structure, but it's * a lot cleaner to do so, and a pointer to the structure can * be used as the instance handle. */ typedef struct rlm_logintime_t { char *msg; /* The Reply-Message passed back to the user * if the account is outside allowed timestamp */ int min_time; } rlm_logintime_t; /* * A mapping of configuration file names to internal variables. * * Note that the string is dynamically allocated, so it MUST * be freed. When the configuration file parse re-reads the string, * it free's the old one, and strdup's the new one, placing the pointer * to the strdup'd string into 'config.string'. This gets around * buffer over-flows. */ static const CONF_PARSER module_config[] = { { "reply-message", PW_TYPE_STRING_PTR, offsetof(rlm_logintime_t,msg), NULL, "You are calling outside your allowed timespan\r\n"}, { "minimum-timeout", PW_TYPE_INTEGER, offsetof(rlm_logintime_t,min_time), NULL, "60" }, { NULL, -1, 0, NULL, NULL } }; static int logintime_detach(void *instance); /* * Compare the current time to a range. */ static int timecmp(void *instance, REQUEST *req, VALUE_PAIR *request, VALUE_PAIR *check, VALUE_PAIR *check_pairs, VALUE_PAIR **reply_pairs) { instance = instance; request = request; /* shut the compiler up */ check_pairs = check_pairs; reply_pairs = reply_pairs; /* * If there's a request, use that timestamp. */ if (timestr_match((char *)check->vp_strvalue, req ? req->timestamp : time(NULL)) >= 0) return 0; return -1; } /* * Time-Of-Day support */ static int time_of_day(void *instance, REQUEST *req, VALUE_PAIR *request, VALUE_PAIR *check, VALUE_PAIR *check_pairs, VALUE_PAIR **reply_pairs) { int scan; int hhmmss, when; char *p; struct tm *tm, s_tm; instance = instance; request = request; /* shut the compiler up */ check_pairs = check_pairs; reply_pairs = reply_pairs; /* * Must be called with a request pointer. */ if (!req) return -1; if (strspn(check->vp_strvalue, "0123456789: ") != strlen(check->vp_strvalue)) { DEBUG("rlm_logintime: Bad Time-Of-Day value \"%s\"", check->vp_strvalue); return -1; } tm = localtime_r(&req->timestamp, &s_tm); hhmmss = (tm->tm_hour * 3600) + (tm->tm_min * 60) + tm->tm_sec; /* * Time of day is a 24-hour clock */ p = check->vp_strvalue; scan = atoi(p); p = strchr(p, ':'); if ((scan > 23) || !p) { DEBUG("rlm_logintime: Bad Time-Of-Day value \"%s\"", check->vp_strvalue); return -1; } when = scan * 3600; p++; scan = atoi(p); if (scan > 59) { DEBUG("rlm_logintime: Bad Time-Of-Day value \"%s\"", check->vp_strvalue); return -1; } when += scan * 60; p = strchr(p, ':'); if (p) { scan = atoi(p + 1); if (scan > 59) { DEBUG("rlm_logintime: Bad Time-Of-Day value \"%s\"", check->vp_strvalue); return -1; } when += scan; } fprintf(stderr, "returning %d - %d\n", hhmmss, when); return hhmmss - when; } /* * Check if account has expired, and if user may login now. */ static int logintime_authorize(void *instance, REQUEST *request) { rlm_logintime_t *data = (rlm_logintime_t *)instance; VALUE_PAIR *check_item = NULL; int r; if ((check_item = pairfind(request->config_items, PW_LOGIN_TIME)) != NULL) { /* * Authentication is OK. Now see if this * user may login at this time of the day. */ DEBUG("rlm_logintime: Checking Login-Time: '%s'",check_item->vp_strvalue); r = timestr_match((char *)check_item->vp_strvalue, request->timestamp); if (r == 0) { /* unlimited */ /* * Do nothing: login-time is OK. */ /* * Session-Timeout needs to be at least * 60 seconds, some terminal servers * ignore smaller values. */ DEBUG("rlm_logintime: timestr returned unlimited"); } else if (r < data->min_time) { char logstr[MAX_STRING_LEN]; VALUE_PAIR *module_fmsg_vp; /* * User called outside allowed time interval. */ DEBUG("rlm_logintime: timestr returned reject"); if (data->msg && data->msg[0]){ char msg[MAX_STRING_LEN]; VALUE_PAIR *tmp; if (!radius_xlat(msg, sizeof(msg), data->msg, request, NULL)) { radlog(L_ERR, "rlm_logintime: xlat failed."); return RLM_MODULE_FAIL; } pairfree(&request->reply->vps); tmp = pairmake("Reply-Message", msg, T_OP_SET); request->reply->vps = tmp; } snprintf(logstr, sizeof(logstr), "Outside allowed timespan (time allowed %s)", check_item->vp_strvalue); module_fmsg_vp = pairmake("Module-Failure-Message", logstr, T_OP_EQ); pairadd(&request->packet->vps, module_fmsg_vp); return RLM_MODULE_REJECT; } else if (r > 0) { VALUE_PAIR *reply_item; /* * User is allowed, but set Session-Timeout. */ DEBUG("rlm_logintime: timestr returned accept"); if ((reply_item = pairfind(request->reply->vps, PW_SESSION_TIMEOUT)) != NULL) { if (reply_item->vp_integer > (unsigned) r) reply_item->vp_integer = r; } else { reply_item = radius_paircreate(request, &request->reply->vps, PW_SESSION_TIMEOUT, PW_TYPE_INTEGER); reply_item->vp_integer = r; } DEBUG("rlm_logintime: Session-Timeout set to: %d",r); } } else return RLM_MODULE_NOOP; return RLM_MODULE_OK; } /* * Do any per-module initialization that is separate to each * configured instance of the module. e.g. set up connections * to external databases, read configuration files, set up * dictionary entries, etc. * * If configuration information is given in the config section * that must be referenced in later calls, store a handle to it * in *instance otherwise put a null pointer there. */ static int logintime_instantiate(CONF_SECTION *conf, void **instance) { rlm_logintime_t *data; /* * Set up a storage area for instance data */ data = rad_malloc(sizeof(*data)); if (!data) { radlog(L_ERR, "rlm_logintime: rad_malloc() failed."); return -1; } memset(data, 0, sizeof(*data)); /* * If the configuration parameters can't be parsed, then * fail. */ if (cf_section_parse(conf, data, module_config) < 0) { free(data); radlog(L_ERR, "rlm_logintime: Configuration parsing failed."); return -1; } if (data->min_time == 0){ radlog(L_ERR, "rlm_logintime: Minimum timeout should be non zero."); free(data); return -1; } /* * Register a Current-Time comparison function */ paircompare_register(PW_CURRENT_TIME, 0, timecmp, data); paircompare_register(PW_TIME_OF_DAY, 0, time_of_day, data); *instance = data; return 0; } static int logintime_detach(void *instance) { paircompare_unregister(PW_CURRENT_TIME, timecmp); paircompare_unregister(PW_TIME_OF_DAY, time_of_day); free(instance); return 0; } /* * The module name should be the only globally exported symbol. * That is, everything else should be 'static'. * * If the module needs to temporarily modify it's instantiation * data, the type should be changed to RLM_TYPE_THREAD_UNSAFE. * The server will then take care of ensuring that the module * is single-threaded. */ module_t rlm_logintime = { RLM_MODULE_INIT, "logintime", RLM_TYPE_CHECK_CONFIG_SAFE, /* type */ logintime_instantiate, /* instantiation */ logintime_detach, /* detach */ { NULL, /* authentication */ logintime_authorize, /* authorization */ NULL, /* preaccounting */ NULL, /* accounting */ NULL, /* checksimul */ NULL, /* pre-proxy */ NULL, /* post-proxy */ logintime_authorize /* post-auth */ }, }; freeradius-server/src/modules/rlm_logintime/timestr.c000066400000000000000000000124031257552170400234560ustar00rootroot00000000000000/* * timestr.c See if a string like 'Su2300-0700' matches (UUCP style). * * Version: $Id$ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2000,2006 The FreeRADIUS server project * Copyright 2000 Alan DeKok */ #include RCSID("$Id$") #include #include static const char *days[] = { "su", "mo", "tu", "we", "th", "fr", "sa", "wk", "any", "al" }; #define DAYMIN (24*60) #define WEEKMIN (24*60*7) #define val(x) (( (x) < 48 || (x) > 57) ? 0 : ((x) - 48)) #if 0 /* Set to 1 if you're a developer and want to debug this code */ # define timestr_debug DEBUG2 # define do_timestr_debug 1 #else # define timestr_debug if (0) printf #endif /* * String code. */ static int strcode (const char **str) { int i; size_t l; timestr_debug("strcode %s called\n", *str); for (i = 0; i < 10; i++) { l = strlen(days[i]); if (l > strlen(*str)) continue; if (strncmp(*str, days[i], l) == 0) { *str += l; break; } } timestr_debug("strcode result %d\n", i); return (i >= 10) ? -1 : i; } /* * Fill bitmap with hours/mins. */ static int hour_fill(char *bitmap, const char *tm) { char *p; int start, end; int i, bit, byte; timestr_debug("hour_fill called for %s\n", tm); /* * Get timerange in start and end. */ end = -1; if ((p = strchr(tm, '-')) != NULL) { p++; if (p - tm != 5 || strlen(p) < 4 || !isdigit((int) *p)) return 0; end = 600 * val(p[0]) + 60 * val(p[1]) + atoi(p + 2); } if (*tm == 0) { start = 0; end = DAYMIN - 1; } else { if (strlen(tm) < 4 || !isdigit((int) *tm)) return 0; start = 600 * val(tm[0]) + 60 * val(tm[1]) + atoi(tm + 2); if (end < 0) end = start; } /* Treat 2400 as 0000, and do some more silent error checks. */ if (end < 0) end = 0; if (start < 0) start = 0; if (end >= DAYMIN) end = DAYMIN - 1; if (start >= DAYMIN) start = DAYMIN - 1; timestr_debug("hour_fill: range from %d to %d\n", start, end); /* * Fill bitmap. */ i = start; while (1) { byte = (i / 8); bit = i % 8; timestr_debug("setting byte %d, bit %d\n", byte, bit); bitmap[byte] |= (1 << bit); if (i == end) break; i++; i %= DAYMIN; } return 1; } /* * Call the fill bitmap function for every day listed. */ static int day_fill(char *bitmap, const char *tm) { const char *hr; int n; int start, end; for (hr = tm; *hr; hr++) if (isdigit((int) *hr)) break; if (hr == tm) tm = "Al"; timestr_debug("dayfill: hr %s tm %s\n", hr, tm); while ((start = strcode(&tm)) >= 0) { /* * Find start and end weekdays and * build a valid range 0 - 6. */ if (*tm == '-') { tm++; if ((end = strcode(&tm)) < 0) break; } else end = start; if (start == 7) { start = 1; end = 5; } if (start > 7) { start = 0; end = 6; } n = start; timestr_debug("day_fill: range from %d to %d\n", start, end); while (1) { hour_fill(bitmap + 180 * n, hr); if (n == end) break; n++; n %= 7; } } return 1; } /* * Fill the week bitmap with allowed times. */ static int week_fill(char *bitmap, char *tm) { char *s; char tmp[256]; strlcpy(tmp, tm, sizeof(tmp)); for (s = tmp; *s; s++) if (isupper(*s)) *s = tolower(*s); s = strtok(tmp, ",|"); while (s) { day_fill(bitmap, s); s = strtok(NULL, ",|"); } return 0; } /* * Match a timestring and return seconds left. * -1 for no match, 0 for unlimited. */ int timestr_match(char *tmstr, time_t t) { struct tm *tm, s_tm; char bitmap[WEEKMIN / 8]; int now, tot, i; int byte, bit; #ifdef do_timestr_debug int y; char *s; char null[8]; #endif tm = localtime_r(&t, &s_tm); now = tm->tm_wday * DAYMIN + tm->tm_hour * 60 + tm->tm_min; tot = 0; memset(bitmap, 0, sizeof(bitmap)); week_fill(bitmap, tmstr); #ifdef do_timestr_debug memset(null, 0, 8); for (i = 0; i < 7; i++) { timestr_debug("%d: ", i); s = bitmap + 180 * i; for (y = 0; y < 23; y++) { s = bitmap + 180 * i + (75 * y) / 10; timestr_debug("%c", memcmp(s, null, 8) == 0 ? '.' : '#'); } timestr_debug("\n"); } #endif /* * See how many minutes we have. */ i = now; while (1) { byte = i / 8; bit = i % 8; timestr_debug("READ: checking byte %d bit %d\n", byte, bit); if (!(bitmap[byte] & (1 << bit))) break; tot += 60; i++; i %= WEEKMIN; if (i == now) break; } if (tot == 0) return -1; return (i == now) ? 0 : tot; } #ifdef STANDALONE int main(int argc, char **argv) { int l; if (argc != 2) { fprintf(stderr, "Usage: test timestring\n"); exit(1); } l = timestr_match(argv[1], time(NULL)); printf ("%s: %d seconds left\n", argv[1], l); return 0; } #endif freeradius-server/src/modules/rlm_mschap/000077500000000000000000000000001257552170400211075ustar00rootroot00000000000000freeradius-server/src/modules/rlm_mschap/.gitignore000066400000000000000000000000131257552170400230710ustar00rootroot00000000000000smbencrypt freeradius-server/src/modules/rlm_mschap/Makefile000066400000000000000000000012321257552170400225450ustar00rootroot00000000000000# # Makefile # # Version: $Id$ # TARGET = rlm_mschap SRCS = rlm_mschap.c mschap.c smbdes.c opendir.c HEADERS = mschap.h smbdes.h RLM_CFLAGS = RLM_LDFLAGS = RLM_LIBS = RLM_UTILS = smbencrypt$(EXEEXT) RLM_INSTALL = smbencrypt-install # over-ride the previous assignment if we're not building anything include ../rules.mak $(LT_OBJS): $(HEADERS) smbencrypt$(EXEEXT): smbencrypt.lo smbdes.lo $(LIBRADIUS) $(LIBTOOL) --mode=link --tag=CC $(CC) $(LDFLAGS) $(RLM_LDFLAGS) \ -o $@ $^ $(RLM_LIBS) $(LIBS) smbencrypt-install: $(INSTALL) -d -m 755 $(R)$(bindir) $(LIBTOOL) --mode=install $(INSTALL) -m 755 $(INSTALLSTRIP) \ smbencrypt$(EXEEXT) $(R)$(bindir) freeradius-server/src/modules/rlm_mschap/README000066400000000000000000000104421257552170400217700ustar00rootroot00000000000000New features were added: + LM support to MS-CHAP + support for SAMBA passwd files. It introduces new files smbpass.c and smbpass.h + support for MS-CHAPv2. SHA1 digest support was added (sha1.c, sha1.h) ! module is configurable via radiusd.conf and supports instances ! module supports both authorization and authentication. Authorization sets authentication to MS-CHAP if any NTLM-related things found. During authorization new attributes added to config_items: LM-Password - LM-encoded password NT-Password - NT-encoded password SMB-Account-CTRL - account control flags in SAMBA format During authentication these attributes are checked against data provided by NAS. - RFC 2433 text with MS-CHAPv1 removed. Microsoft attributes are covered by RFC 2458, MS-CHAPv2 - RFC 2759. You can obtain them from www.rfceditor.org ZARAZA, 3APA3A@security.nnov.ru Below is original README by Jay Miller This is a partial implementation of MS-CHAP for FreeRadius. The patch was designed for Cistron-Radius 1.6.4, but the changes to source are pretty minimal and should work with previous versions. It is based on RFC 2433, which is included with this package. I have tested this successfully using Windows 98 and Windows 2000 with Cisco AS5300 terminal servers. I have not tested it in any other environment, so I can't guarantee it's success everywhere. I also don't have time to do much troubleshooting, though I am interested to hear about problems anyone might have. If you can fix a problem, then I will incorporate the fix into the distribution. Files included: mschap.c - MS-CHAP functions mschap.h - Definitions and prototypes md4c.c, md4.h - RSA Data Security, Inc. MD4 Message-Digest Algorithm desport.c, deskey.c, des.h - Fast DES by Phil Karn (portable C version) rfc2433.txt - RFC upon which this algorithm is based ABOUT MS-CHAP I was driven to write this when a large customer demanded that they be able to check "Require Encrypted Password" in their Windows Dial-up Networking. Testing showed me that, in Windows 2000 at least, this meant MS-CHAP. If you want to specify CHAP, then Windows 2000 requires you to select "Allow unencrypted password". Duh. MS-CHAP is similar to CHAP. The NAS creates a challenge string and gives it to the client. The client then uses the password to encrypt the challenge and gives it back to the NAS, who then gives them both to Radius. Radius performs the same encryption of the challenge string using the locally stored password, then compares the result to the response from the client. The difference between MS-CHAP and CHAP is in the encryption method. CHAP performs one MD5 hash to get the response. MS-CHAP first encrypts the password with MD4. It then pads the 16-byte hash out to 21 bytes and divides this string into 3 parts. Each 7-byte part is used as a key for a DES encryption of the challenge string. The 8-byte results are then concatonated together into a 24-byte response. The method just described is called NT-encryption by the RFC. MS-CHAP is actually designed for compatability with Microsoft LAN Manager as well. The response returned by the client actually contains an LM encrypted response as well as the NT-encrypted password. This implementation only uses the NT-encrypted response, which seems to work fine for Windows 98 and Windows 2000. The RFC also has a number of other specs for allowing the user to change password and things like that. None of that has been implemented here. A useful extension of this would be in the local storage of passwords. Theoretically you should be able to store the MD4 hash rather than the plain text password. Then the algorithm could pick it up at the next step and still calculate the result. The trouble is that MD4 produces a binary hash. That is, any values from 0 to 255 is a valid byte, and I don't know how to store this in a users file. If it can be done, then we could add a check attribute called "MS-CHAP-Hash" instead of password and get both an encrypted protocol and encrypted password storage at the same time (CHAP requires plain text passwords, while Crypt-Pass requires an unencrypted protocol). If you find this useful, please send me a note just so I can feel good about myself. Jay Miller Columbia, MO, US jaymiller@socket.net freeradius-server/src/modules/rlm_mschap/mschap.c000066400000000000000000000104351257552170400225310ustar00rootroot00000000000000/* * mschap.c * * Version: $Id$ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2000,2001,2006,2010 The FreeRADIUS server project */ /* * This implements MS-CHAP, as described in RFC 2548 * * http://www.freeradius.org/rfc/rfc2548.txt * */ #include RCSID("$Id$") #include #include #include #include #include #include #include "smbdes.h" /* * ntpwdhash converts Unicode password to 16-byte NT hash * with MD4 */ void mschap_ntpwdhash (uint8_t *szHash, const char *szPassword) { char szUnicodePass[513]; int nPasswordLen; int i; /* * NT passwords are unicode. Convert plain text password * to unicode by inserting a zero every other byte */ nPasswordLen = strlen(szPassword); for (i = 0; i < nPasswordLen; i++) { szUnicodePass[i << 1] = szPassword[i]; szUnicodePass[(i << 1) + 1] = 0; } /* Encrypt Unicode password to a 16-byte MD4 hash */ fr_md4_calc(szHash, (uint8_t *) szUnicodePass, (nPasswordLen<<1) ); } /* * challenge_hash() is used by mschap2() and auth_response() * implements RFC2759 ChallengeHash() * generates 64 bit challenge */ void mschap_challenge_hash( const uint8_t *peer_challenge, const uint8_t *auth_challenge, const char *user_name, uint8_t *challenge ) { fr_SHA1_CTX Context; uint8_t hash[20]; fr_SHA1Init(&Context); fr_SHA1Update(&Context, peer_challenge, 16); fr_SHA1Update(&Context, auth_challenge, 16); fr_SHA1Update(&Context, (const uint8_t *) user_name, strlen(user_name)); fr_SHA1Final(hash, &Context); memcpy(challenge, hash, 8); } /* * auth_response() generates MS-CHAP v2 SUCCESS response * according to RFC 2759 GenerateAuthenticatorResponse() * returns 42-octet response string */ void mschap_auth_response(const char *username, const uint8_t *nt_hash_hash, uint8_t *ntresponse, uint8_t *peer_challenge, uint8_t *auth_challenge, char *response) { fr_SHA1_CTX Context; static const uint8_t magic1[39] = {0x4D, 0x61, 0x67, 0x69, 0x63, 0x20, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x74, 0x6F, 0x20, 0x63, 0x6C, 0x69, 0x65, 0x6E, 0x74, 0x20, 0x73, 0x69, 0x67, 0x6E, 0x69, 0x6E, 0x67, 0x20, 0x63, 0x6F, 0x6E, 0x73, 0x74, 0x61, 0x6E, 0x74}; static const uint8_t magic2[41] = {0x50, 0x61, 0x64, 0x20, 0x74, 0x6F, 0x20, 0x6D, 0x61, 0x6B, 0x65, 0x20, 0x69, 0x74, 0x20, 0x64, 0x6F, 0x20, 0x6D, 0x6F, 0x72, 0x65, 0x20, 0x74, 0x68, 0x61, 0x6E, 0x20, 0x6F, 0x6E, 0x65, 0x20, 0x69, 0x74, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6F, 0x6E}; static const char hex[16] = "0123456789ABCDEF"; size_t i; uint8_t challenge[8]; uint8_t digest[20]; fr_SHA1Init(&Context); fr_SHA1Update(&Context, nt_hash_hash, 16); fr_SHA1Update(&Context, ntresponse, 24); fr_SHA1Update(&Context, magic1, 39); fr_SHA1Final(digest, &Context); mschap_challenge_hash(peer_challenge, auth_challenge, username, challenge); fr_SHA1Init(&Context); fr_SHA1Update(&Context, digest, 20); fr_SHA1Update(&Context, challenge, 8); fr_SHA1Update(&Context, magic2, 41); fr_SHA1Final(digest, &Context); /* * Encode the value of 'Digest' as "S=" followed by * 40 ASCII hexadecimal digits and return it in * AuthenticatorResponse. * For example, * "S=0123456789ABCDEF0123456789ABCDEF01234567" */ response[0] = 'S'; response[1] = '='; /* * The hexadecimal digits [A-F] MUST be uppercase. */ for (i = 0; i < sizeof(digest); i++) { response[2 + (i * 2)] = hex[(digest[i] >> 4) & 0x0f]; response[3 + (i * 2)] = hex[digest[i] & 0x0f]; } } freeradius-server/src/modules/rlm_mschap/mschap.h000066400000000000000000000010761257552170400225370ustar00rootroot00000000000000/* Copyright 2006 The FreeRADIUS server project */ #ifndef _MSCHAP_H #define _MSCHAP_H #include RCSIDH(mschap_h, "$Id$") void mschap_ntpwdhash (uint8_t *szHash, const char *szPassword); void mschap_challenge_hash( const uint8_t *peer_challenge, const uint8_t *auth_challenge, const char *user_name, uint8_t *challenge ); void mschap_auth_response(const char *username, const uint8_t *nt_hash_hash, uint8_t *ntresponse, uint8_t *peer_challenge, uint8_t *auth_challenge, char *response); #endif /*_MSCHAP_H*/ freeradius-server/src/modules/rlm_mschap/opendir.c000066400000000000000000000322371257552170400227220ustar00rootroot00000000000000#ifdef __APPLE__ /* * Open Directory support from Apple Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 only, as published by * the Free Software Foundation. * * 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 version 2 * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Copyright 2007 Apple Inc. */ #include RCSID("$Id$") #include #include #include #include #include #include "smbdes.h" #include #define kActiveDirLoc "/Active Directory/" static int getUserNodeRef(char* inUserName, char **outUserName, tDirNodeReference* userNodeRef, tDirReference dsRef) { tDataBuffer *tDataBuff = NULL; tDirNodeReference nodeRef = 0; long status = eDSNoErr; tContextData context = 0; unsigned long nodeCount = 0; uint32_t attrIndex = 0; tDataList *nodeName = NULL; tAttributeEntryPtr pAttrEntry = NULL; tDataList *pRecName = NULL; tDataList *pRecType = NULL; tDataList *pAttrType = NULL; unsigned long recCount = 0; tRecordEntry *pRecEntry = NULL; tAttributeListRef attrListRef = 0; char *pUserLocation = NULL; tAttributeValueListRef valueRef = 0; tAttributeValueEntry *pValueEntry = NULL; tDataList *pUserNode = NULL; int result = RLM_MODULE_FAIL; if (inUserName == NULL) { radlog(L_ERR, "rlm_mschap: getUserNodeRef(): no username"); return RLM_MODULE_FAIL; } tDataBuff = dsDataBufferAllocate(dsRef, 4096); if (tDataBuff == NULL) { radlog(L_ERR, "rlm_mschap: getUserNodeRef(): dsDataBufferAllocate() status = %ld", status); return RLM_MODULE_FAIL; } do { /* find on search node */ status = dsFindDirNodes(dsRef, tDataBuff, NULL, eDSAuthenticationSearchNodeName, &nodeCount, &context); if (status != eDSNoErr) { radlog(L_ERR,"rlm_mschap: getUserNodeRef(): no node found? status = %ld", status); result = RLM_MODULE_FAIL; break; } if (nodeCount < 1) { radlog(L_ERR,"rlm_mschap: getUserNodeRef(): nodeCount < 1, status = %ld", status); result = RLM_MODULE_FAIL; break; } status = dsGetDirNodeName(dsRef, tDataBuff, 1, &nodeName); if (status != eDSNoErr) { radlog(L_ERR,"rlm_mschap: getUserNodeRef(): dsGetDirNodeName() status = %ld", status); result = RLM_MODULE_FAIL; break; } status = dsOpenDirNode(dsRef, nodeName, &nodeRef); dsDataListDeallocate(dsRef, nodeName); free(nodeName); nodeName = NULL; if (status != eDSNoErr) { radlog(L_ERR,"rlm_mschap: getUserNodeRef(): dsOpenDirNode() status = %ld", status); result = RLM_MODULE_FAIL; break; } pRecName = dsBuildListFromStrings(dsRef, inUserName, NULL); pRecType = dsBuildListFromStrings(dsRef, kDSStdRecordTypeUsers, NULL); pAttrType = dsBuildListFromStrings(dsRef, kDSNAttrMetaNodeLocation, kDSNAttrRecordName, NULL); recCount = 1; status = dsGetRecordList(nodeRef, tDataBuff, pRecName, eDSExact, pRecType, pAttrType, 0, &recCount, &context); if (status != eDSNoErr || recCount == 0) { radlog(L_ERR,"rlm_mschap: getUserNodeRef(): dsGetRecordList() status = %ld, recCount=%lu", status, recCount); result = RLM_MODULE_FAIL; break; } status = dsGetRecordEntry(nodeRef, tDataBuff, 1, &attrListRef, &pRecEntry); if (status != eDSNoErr) { radlog(L_ERR,"rlm_mschap: getUserNodeRef(): dsGetRecordEntry() status = %ld", status); result = RLM_MODULE_FAIL; break; } for (attrIndex = 1; (attrIndex <= pRecEntry->fRecordAttributeCount) && (status == eDSNoErr); attrIndex++) { status = dsGetAttributeEntry(nodeRef, tDataBuff, attrListRef, attrIndex, &valueRef, &pAttrEntry); if (status == eDSNoErr && pAttrEntry != NULL) { if (strcmp(pAttrEntry->fAttributeSignature.fBufferData, kDSNAttrMetaNodeLocation) == 0) { status = dsGetAttributeValue(nodeRef, tDataBuff, 1, valueRef, &pValueEntry); if (status == eDSNoErr && pValueEntry != NULL) { pUserLocation = (char *) calloc(pValueEntry->fAttributeValueData.fBufferLength + 1, sizeof(char)); memcpy(pUserLocation, pValueEntry->fAttributeValueData.fBufferData, pValueEntry->fAttributeValueData.fBufferLength); } } else if (strcmp(pAttrEntry->fAttributeSignature.fBufferData, kDSNAttrRecordName) == 0) { status = dsGetAttributeValue(nodeRef, tDataBuff, 1, valueRef, &pValueEntry); if (status == eDSNoErr && pValueEntry != NULL) { *outUserName = (char *) malloc(pValueEntry->fAttributeValueData.fBufferLength + 1); bzero(*outUserName,pValueEntry->fAttributeValueData.fBufferLength + 1); memcpy(*outUserName, pValueEntry->fAttributeValueData.fBufferData, pValueEntry->fAttributeValueData.fBufferLength); } } if (pValueEntry != NULL) { dsDeallocAttributeValueEntry(dsRef, pValueEntry); pValueEntry = NULL; } dsDeallocAttributeEntry(dsRef, pAttrEntry); pAttrEntry = NULL; dsCloseAttributeValueList(valueRef); valueRef = 0; } } /* OpenDirectory doesn't support mschapv2 authentication against * Active Directory. AD users need to be authenticated using the * normal freeradius AD path (i.e. ntlm_auth). */ if (strncmp(pUserLocation, kActiveDirLoc, strlen(kActiveDirLoc)) == 0) { DEBUG2("[mschap] OpenDirectory authentication returning noop. OD doesn't support MSCHAPv2 for ActiveDirectory users."); result = RLM_MODULE_NOOP; break; } pUserNode = dsBuildFromPath(dsRef, pUserLocation, "/"); if (pUserNode == NULL) { radlog(L_ERR,"rlm_mschap: getUserNodeRef(): dsBuildFromPath() returned NULL"); result = RLM_MODULE_FAIL; break; } status = dsOpenDirNode(dsRef, pUserNode, userNodeRef); dsDataListDeallocate(dsRef, pUserNode); free(pUserNode); if (status != eDSNoErr) { radlog(L_ERR,"rlm_mschap: getUserNodeRef(): dsOpenDirNode() status = %ld", status); result = RLM_MODULE_FAIL; break; } result = RLM_MODULE_OK; } while (0); if (pRecEntry != NULL) dsDeallocRecordEntry(dsRef, pRecEntry); if (tDataBuff != NULL) dsDataBufferDeAllocate(dsRef, tDataBuff); if (pUserLocation != NULL) free(pUserLocation); if (pRecName != NULL) { dsDataListDeallocate(dsRef, pRecName); free(pRecName); } if (pRecType != NULL) { dsDataListDeallocate(dsRef, pRecType); free(pRecType); } if (pAttrType != NULL) { dsDataListDeallocate(dsRef, pAttrType); free(pAttrType); } if (nodeRef != 0) dsCloseDirNode(nodeRef); return result; } int od_mschap_auth(REQUEST *request, VALUE_PAIR *challenge, VALUE_PAIR * usernamepair) { tDirStatus status = eDSNoErr; tDirReference dsRef = 0; tDirNodeReference userNodeRef = 0; tDataBuffer *tDataBuff = NULL; tDataBuffer *pStepBuff = NULL; tDataNode *pAuthType = NULL; uint32_t uiCurr = 0; uint32_t uiLen = 0; char *username_string = NULL; char *shortUserName = NULL; VALUE_PAIR *response = pairfind(request->packet->vps, PW_MSCHAP2_RESPONSE); #ifndef NDEBUG int t; #endif username_string = (char *) malloc(usernamepair->length + 1); if (username_string == NULL) return RLM_MODULE_FAIL; strlcpy(username_string, (char *)usernamepair->vp_strvalue, usernamepair->length + 1); status = dsOpenDirService(&dsRef); if (status != eDSNoErr) { free(username_string); radlog(L_ERR,"rlm_mschap: od_mschap_auth(): dsOpenDirService = %d", status); return RLM_MODULE_FAIL; } status = getUserNodeRef(username_string, &shortUserName, &userNodeRef, dsRef); if(status != RLM_MODULE_OK) { if (status != RLM_MODULE_NOOP) { RDEBUG2("od_mschap_auth: getUserNodeRef() failed"); } if (username_string != NULL) free(username_string); if (dsRef != 0) dsCloseDirService(dsRef); return status; } /* We got a node; fill the stepBuffer kDSStdAuthMSCHAP2 MS-CHAPv2 authentication method. The Open Directory plug-in generates the reply data for the client. The input buffer format consists of a four byte length specifying the length of the user name that follows, the user name, a four byte value specifying the length of the server challenge that follows, the server challenge, a four byte value specifying the length of the peer challenge that follows, the peer challenge, a four byte value specifying the length of the client's digest that follows, and the client's digest. The output buffer consists of a four byte value specifying the length of the return digest for the client's challenge. r = FillAuthBuff(pAuthBuff, 5, strlen(inName), inName, // Directory Services long or short name strlen(schal), schal, // server challenge strlen(peerchal), peerchal, // client challenge strlen(p24), p24, // P24 NT-Response 4, "User"); // must match the username that was used for the hash inName = username_string schal = challenge->vp_strvalue peerchal = response->vp_strvalue + 2 (16 octets) p24 = response->vp_strvalue + 26 (24 octets) */ pStepBuff = dsDataBufferAllocate(dsRef, 4096); tDataBuff = dsDataBufferAllocate(dsRef, 4096); pAuthType = dsDataNodeAllocateString(dsRef, kDSStdAuthMSCHAP2); uiCurr = 0; RDEBUG2("OD username_string = %s, OD shortUserName=%s (length = %lu)\n", username_string, shortUserName, strlen(shortUserName)); /* User name length + username */ uiLen = (uint32_t)strlen(shortUserName); memcpy(&(tDataBuff->fBufferData[uiCurr]), &uiLen, sizeof(uiLen)); uiCurr += sizeof(uiLen); memcpy(&(tDataBuff->fBufferData[uiCurr]), shortUserName, uiLen); uiCurr += uiLen; #ifndef NDEBUG RDEBUG2(" stepbuf server challenge:\t"); for (t = 0; t < challenge->length; t++) { fprintf(stderr, "%02x", challenge->vp_strvalue[t]); } fprintf(stderr, "\n"); #endif /* server challenge (ie. my (freeRADIUS) challenge) */ uiLen = 16; memcpy(&(tDataBuff->fBufferData[uiCurr]), &uiLen, sizeof(uiLen)); uiCurr += sizeof(uiLen); memcpy(&(tDataBuff->fBufferData[uiCurr]), &(challenge->vp_strvalue[0]), uiLen); uiCurr += uiLen; #ifndef NDEBUG RDEBUG2(" stepbuf peer challenge:\t\t"); for (t = 2; t < 18; t++) { fprintf(stderr, "%02x", response->vp_strvalue[t]); } fprintf(stderr, "\n"); #endif /* peer challenge (ie. the client-generated response) */ uiLen = 16; memcpy(&(tDataBuff->fBufferData[uiCurr]), &uiLen, sizeof(uiLen)); uiCurr += sizeof(uiLen); memcpy(&(tDataBuff->fBufferData[uiCurr]), &(response->vp_strvalue[2]), uiLen); uiCurr += uiLen; #ifndef NDEBUG RDEBUG2(" stepbuf p24:\t\t"); for (t = 26; t < 50; t++) { fprintf(stderr, "%02x", response->vp_strvalue[t]); } fprintf(stderr, "\n"); #endif /* p24 (ie. second part of client-generated response) */ uiLen = 24; /* strlen(&(response->vp_strvalue[26])); may contain NULL byte in the middle. */ memcpy(&(tDataBuff->fBufferData[uiCurr]), &uiLen, sizeof(uiLen)); uiCurr += sizeof(uiLen); memcpy(&(tDataBuff->fBufferData[uiCurr]), &(response->vp_strvalue[26]), uiLen); uiCurr += uiLen; /* Client generated use name (short name?) */ uiLen = (uint32_t)strlen(username_string); memcpy(&(tDataBuff->fBufferData[uiCurr]), &uiLen, sizeof(uiLen)); uiCurr += sizeof(uiLen); memcpy(&(tDataBuff->fBufferData[uiCurr]), username_string, uiLen); uiCurr += uiLen; tDataBuff->fBufferLength = uiCurr; status = dsDoDirNodeAuth(userNodeRef, pAuthType, 1, tDataBuff, pStepBuff, NULL); if (status == eDSNoErr) { if (pStepBuff->fBufferLength > 4) { uint32_t len; memcpy(&len, pStepBuff->fBufferData, sizeof(len)); if (len == 40) { char mschap_reply[42] = { '\0' }; pStepBuff->fBufferData[len+4] = '\0'; mschap_reply[0] = 'S'; mschap_reply[1] = '='; memcpy(&(mschap_reply[2]), &(pStepBuff->fBufferData[4]), len); mschap_add_reply(request, &request->reply->vps, *response->vp_strvalue, "MS-CHAP2-Success", mschap_reply, len+2); RDEBUG2("dsDoDirNodeAuth returns stepbuff: %s (len=%ld)\n", mschap_reply, len); } } } /* clean up */ if (username_string != NULL) free(username_string); if (shortUserName != NULL) free(shortUserName); if (tDataBuff != NULL) dsDataBufferDeAllocate(dsRef, tDataBuff); if (pStepBuff != NULL) dsDataBufferDeAllocate(dsRef, pStepBuff); if (pAuthType != NULL) dsDataNodeDeAllocate(dsRef, pAuthType); if (userNodeRef != 0) dsCloseDirNode(userNodeRef); if (dsRef != 0) dsCloseDirService(dsRef); if (status != eDSNoErr) { errno = EACCES; radlog(L_ERR, "rlm_mschap: authentication failed %d", status); /* <-- returns -14091 (eDSAuthMethodNotSupported) -14090 */ return RLM_MODULE_REJECT; } return RLM_MODULE_OK; } #endif /* __APPLE__ */ freeradius-server/src/modules/rlm_mschap/rlm_mschap.c000066400000000000000000001144501257552170400234050ustar00rootroot00000000000000/* * rlm_mschap.c * * Version: $Id$ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2000,2001,2006 The FreeRADIUS server project */ /* MPPE support from Takahiro Wagatsuma */ #include RCSID("$Id$") #include #include #include #include #include #include #include "mschap.h" #include "smbdes.h" #ifdef __APPLE__ extern int od_mschap_auth(REQUEST *request, VALUE_PAIR *challenge, VALUE_PAIR * usernamepair); #endif /* Allowable account control bits */ #define ACB_DISABLED 0x0001 /* 1 = User account disabled */ #define ACB_HOMDIRREQ 0x0002 /* 1 = Home directory required */ #define ACB_PWNOTREQ 0x0004 /* 1 = User password not required */ #define ACB_TEMPDUP 0x0008 /* 1 = Temporary duplicate account */ #define ACB_NORMAL 0x0010 /* 1 = Normal user account */ #define ACB_MNS 0x0020 /* 1 = MNS logon user account */ #define ACB_DOMTRUST 0x0040 /* 1 = Interdomain trust account */ #define ACB_WSTRUST 0x0080 /* 1 = Workstation trust account */ #define ACB_SVRTRUST 0x0100 /* 1 = Server trust account */ #define ACB_PWNOEXP 0x0200 /* 1 = User password does not expire */ #define ACB_AUTOLOCK 0x0400 /* 1 = Account auto locked */ static int pdb_decode_acct_ctrl(const char *p) { int acct_ctrl = 0; int finished = 0; /* * Check if the account type bits have been encoded after the * NT password (in the form [NDHTUWSLXI]). */ if (*p != '[') return 0; for (p++; *p && !finished; p++) { switch (*p) { case 'N': /* 'N'o password. */ acct_ctrl |= ACB_PWNOTREQ; break; case 'D': /* 'D'isabled. */ acct_ctrl |= ACB_DISABLED ; break; case 'H': /* 'H'omedir required. */ acct_ctrl |= ACB_HOMDIRREQ; break; case 'T': /* 'T'emp account. */ acct_ctrl |= ACB_TEMPDUP; break; case 'U': /* 'U'ser account (normal). */ acct_ctrl |= ACB_NORMAL; break; case 'M': /* 'M'NS logon user account. What is this? */ acct_ctrl |= ACB_MNS; break; case 'W': /* 'W'orkstation account. */ acct_ctrl |= ACB_WSTRUST; break; case 'S': /* 'S'erver account. */ acct_ctrl |= ACB_SVRTRUST; break; case 'L': /* 'L'ocked account. */ acct_ctrl |= ACB_AUTOLOCK; break; case 'X': /* No 'X'piry on password */ acct_ctrl |= ACB_PWNOEXP; break; case 'I': /* 'I'nterdomain trust account. */ acct_ctrl |= ACB_DOMTRUST; break; case ' ': /* ignore spaces */ break; case ':': case '\n': case '\0': case ']': default: finished = 1; break; } } return acct_ctrl; } typedef struct rlm_mschap_t { int use_mppe; int require_encryption; int require_strong; int with_ntdomain_hack; /* this should be in another module */ char *passwd_file; const char *xlat_name; char *ntlm_auth; int ntlm_auth_timeout; const char *auth_type; int allow_retry; char *retry_msg; #ifdef __APPLE__ int open_directory; #endif } rlm_mschap_t; /* * Does dynamic translation of strings. * * Pulls NT-Response, LM-Response, or Challenge from MSCHAP * attributes. */ static size_t mschap_xlat(void *instance, REQUEST *request, char *fmt, char *out, size_t outlen, RADIUS_ESCAPE_STRING func) { size_t i, data_len; uint8_t *data = NULL; uint8_t buffer[32]; VALUE_PAIR *user_name; VALUE_PAIR *chap_challenge, *response; rlm_mschap_t *inst = instance; response = NULL; func = func; /* -Wunused */ /* * Challenge means MS-CHAPv1 challenge, or * hash of MS-CHAPv2 challenge, and peer challenge. */ if (strncasecmp(fmt, "Challenge", 9) == 0) { chap_challenge = pairfind(request->packet->vps, PW_MSCHAP_CHALLENGE); if (!chap_challenge) { RDEBUG2("No MS-CHAP-Challenge in the request."); return 0; } /* * MS-CHAP-Challenges are 8 octets, * for MS-CHAPv2 */ if (chap_challenge->length == 8) { RDEBUG2(" mschap1: %02x", chap_challenge->vp_octets[0]); data = chap_challenge->vp_octets; data_len = 8; /* * MS-CHAP-Challenges are 16 octets, * for MS-CHAPv2. */ } else if (chap_challenge->length == 16) { VALUE_PAIR *name_attr, *response_name; char *username_string; response = pairfind(request->packet->vps, PW_MSCHAP2_RESPONSE); if (!response) { RDEBUG2("MS-CHAP2-Response is required to calculate MS-CHAPv1 challenge."); return 0; } /* * FIXME: Much of this is copied from * below. We should put it into a * separate function. */ /* * Responses are 50 octets. */ if (response->length < 50) { radlog_request(L_AUTH, 0, request, "MS-CHAP-Response has the wrong format."); return 0; } user_name = pairfind(request->packet->vps, PW_USER_NAME); if (!user_name) { RDEBUG2("User-Name is required to calculate MS-CHAPv1 Challenge."); return 0; } /* * Check for MS-CHAP-User-Name and if found, use it * to construct the MSCHAPv1 challenge. This is * set by rlm_eap_mschap to the MS-CHAP Response * packet Name field. * * We prefer this to the User-Name in the * packet. */ response_name = pairfind(request->packet->vps, PW_MS_CHAP_USER_NAME); if (response_name) { name_attr = response_name; } else { name_attr = user_name; } /* * with_ntdomain_hack moved here, too. */ if ((username_string = strchr(name_attr->vp_strvalue, '\\')) != NULL) { if (inst->with_ntdomain_hack) { username_string++; } else { RDEBUG2("NT Domain delimeter found, should we have enabled with_ntdomain_hack?"); username_string = name_attr->vp_strvalue; } } else { username_string = name_attr->vp_strvalue; } if (response_name && ((user_name->length != response_name->length) || (strncasecmp(user_name->vp_strvalue, response_name->vp_strvalue, user_name->length) != 0))) { RDEBUG("WARNING: User-Name (%s) is not the same as MS-CHAP Name (%s) from EAP-MSCHAPv2", user_name->vp_strvalue, response_name->vp_strvalue); } /* * Get the MS-CHAPv1 challenge * from the MS-CHAPv2 peer challenge, * our challenge, and the user name. */ RDEBUG2("Creating challenge hash with username: %s", username_string); mschap_challenge_hash(response->vp_octets + 2, chap_challenge->vp_octets, username_string, buffer); data = buffer; data_len = 8; } else { RDEBUG2("Invalid MS-CHAP challenge length"); return 0; } /* * Get the MS-CHAPv1 response, or the MS-CHAPv2 * response. */ } else if (strncasecmp(fmt, "NT-Response", 11) == 0) { response = pairfind(request->packet->vps, PW_MSCHAP_RESPONSE); if (!response) response = pairfind(request->packet->vps, PW_MSCHAP2_RESPONSE); if (!response) { RDEBUG2("No MS-CHAP-Response or MS-CHAP2-Response was found in the request."); return 0; } /* * For MS-CHAPv1, the NT-Response exists only * if the second octet says so. */ if ((response->attribute == PW_MSCHAP_RESPONSE) && ((response->vp_octets[1] & 0x01) == 0)) { RDEBUG2("No NT-Response in MS-CHAP-Response"); return 0; } /* * MS-CHAP-Response and MS-CHAP2-Response have * the NT-Response at the same offset, and are * the same length. */ data = response->vp_octets + 26; data_len = 24; /* * LM-Response is deprecated, and exists only * in MS-CHAPv1, and not often there. */ } else if (strncasecmp(fmt, "LM-Response", 11) == 0) { response = pairfind(request->packet->vps, PW_MSCHAP_RESPONSE); if (!response) { RDEBUG2("No MS-CHAP-Response was found in the request."); return 0; } /* * For MS-CHAPv1, the NT-Response exists only * if the second octet says so. */ if ((response->vp_octets[1] & 0x01) != 0) { RDEBUG2("No LM-Response in MS-CHAP-Response"); return 0; } data = response->vp_octets + 2; data_len = 24; /* * Pull the NT-Domain out of the User-Name, if it exists. */ } else if (strncasecmp(fmt, "NT-Domain", 9) == 0) { char *p, *q; user_name = pairfind(request->packet->vps, PW_USER_NAME); if (!user_name) { RDEBUG2("No User-Name was found in the request."); return 0; } /* * First check to see if this is a host/ style User-Name * (a la Kerberos host principal) */ if (strncmp(user_name->vp_strvalue, "host/", 5) == 0) { /* * If we're getting a User-Name formatted in this way, * it's likely due to PEAP. The Windows Domain will be * the first domain component following the hostname, * or the machine name itself if only a hostname is supplied */ p = strchr(user_name->vp_strvalue, '.'); if (!p) { RDEBUG2("setting NT-Domain to same as machine name"); strlcpy(out, user_name->vp_strvalue + 5, outlen); } else { p++; /* skip the period */ q = strchr(p, '.'); /* * use the same hack as below * only if another period was found */ if (q) *q = '\0'; strlcpy(out, p, outlen); if (q) *q = '.'; } } else { p = strchr(user_name->vp_strvalue, '\\'); if (!p) { RDEBUG2("No NT-Domain was found in the User-Name."); return 0; } /* * Hack. This is simpler than the alternatives. */ *p = '\0'; strlcpy(out, user_name->vp_strvalue, outlen); *p = '\\'; } return strlen(out); /* * Pull the User-Name out of the User-Name... */ } else if (strncasecmp(fmt, "User-Name", 9) == 0) { char *p; user_name = pairfind(request->packet->vps, PW_USER_NAME); if (!user_name) { RDEBUG2("No User-Name was found in the request."); return 0; } /* * First check to see if this is a host/ style User-Name * (a la Kerberos host principal) */ if (strncmp(user_name->vp_strvalue, "host/", 5) == 0) { /* * If we're getting a User-Name formatted in this way, * it's likely due to PEAP. When authenticating this against * a Domain, Windows will expect the User-Name to be in the * format of hostname$, the SAM version of the name, so we * have to convert it to that here. We do so by stripping * off the first 5 characters (host/), and copying everything * from that point to the first period into a string and appending * a $ to the end. */ p = strchr(user_name->vp_strvalue, '.'); /* * use the same hack as above * only if a period was found */ if (p) *p = '\0'; snprintf(out, outlen, "%s$", user_name->vp_strvalue + 5); if (p) *p = '.'; } else { p = strchr(user_name->vp_strvalue, '\\'); if (p) { p++; /* skip the backslash */ } else { p = user_name->vp_strvalue; /* use the whole User-Name */ } strlcpy(out, p, outlen); } return strlen(out); /* * Return the NT-Hash of the passed string */ } else if (strncasecmp(fmt, "NT-Hash ", 8) == 0) { char *p; char buf2[1024]; p = fmt + 8; /* 7 is the length of 'NT-Hash' */ if ((p == '\0') || (outlen <= 32)) return 0; while (isspace(*p)) p++; if (!radius_xlat(buf2, sizeof(buf2),p,request,NULL)) { RDEBUG("xlat failed"); *buffer = '\0'; return 0; } mschap_ntpwdhash(buffer,buf2); fr_bin2hex(buffer, out, 16); out[32] = '\0'; RDEBUG("NT-Hash of %s = %s", buf2, out); return 32; /* * Return the LM-Hash of the passed string */ } else if (strncasecmp(fmt, "LM-Hash ", 8) == 0) { char *p; char buf2[1024]; p = fmt + 8; /* 7 is the length of 'LM-Hash' */ if ((p == '\0') || (outlen <= 32)) return 0; while (isspace(*p)) p++; if (!radius_xlat(buf2, sizeof(buf2),p,request,NULL)) { RDEBUG("xlat failed"); *buffer = '\0'; return 0; } smbdes_lmpwdhash(buf2, buffer); fr_bin2hex(buffer, out, 16); out[32] = '\0'; RDEBUG("LM-Hash of %s = %s", buf2, out); return 32; } else { RDEBUG2("Unknown expansion string \"%s\"", fmt); return 0; } if (outlen == 0) return 0; /* nowhere to go, don't do anything */ /* * Didn't set anything: this is bad. */ if (!data) { RDEBUG2("Failed to do anything intelligent"); return 0; } /* * Check the output length. */ if (outlen < ((data_len * 2) + 1)) { data_len = (outlen - 1) / 2; } /* * */ for (i = 0; i < data_len; i++) { sprintf(out + (2 * i), "%02x", data[i]); } out[data_len * 2] = '\0'; return data_len * 2; } static const CONF_PARSER module_config[] = { /* * Cache the password by default. */ { "use_mppe", PW_TYPE_BOOLEAN, offsetof(rlm_mschap_t,use_mppe), NULL, "yes" }, { "require_encryption", PW_TYPE_BOOLEAN, offsetof(rlm_mschap_t,require_encryption), NULL, "no" }, { "require_strong", PW_TYPE_BOOLEAN, offsetof(rlm_mschap_t,require_strong), NULL, "no" }, { "with_ntdomain_hack", PW_TYPE_BOOLEAN, offsetof(rlm_mschap_t,with_ntdomain_hack), NULL, "no" }, { "passwd", PW_TYPE_STRING_PTR, offsetof(rlm_mschap_t, passwd_file), NULL, NULL }, { "ntlm_auth", PW_TYPE_STRING_PTR, offsetof(rlm_mschap_t, ntlm_auth), NULL, NULL }, { "ntlm_auth_timeout", PW_TYPE_INTEGER, offsetof(rlm_mschap_t, ntlm_auth_timeout), NULL, NULL }, { "allow_retry", PW_TYPE_BOOLEAN, offsetof(rlm_mschap_t, allow_retry), NULL, "yes" }, { "retry_msg", PW_TYPE_STRING_PTR, offsetof(rlm_mschap_t, retry_msg), NULL, NULL }, #ifdef __APPLE__ { "use_open_directory", PW_TYPE_BOOLEAN, offsetof(rlm_mschap_t,open_directory), NULL, "yes" }, #endif { NULL, -1, 0, NULL, NULL } /* end the list */ }; /* * deinstantiate module, free all memory allocated during * mschap_instantiate() */ static int mschap_detach(void *instance){ #define inst ((rlm_mschap_t *)instance) if (inst->xlat_name) { xlat_unregister(inst->xlat_name, mschap_xlat, instance); free(inst->xlat_name); } free(instance); return 0; #undef inst } /* * Create instance for our module. Allocate space for * instance structure and read configuration parameters */ static int mschap_instantiate(CONF_SECTION *conf, void **instance) { rlm_mschap_t *inst; inst = *instance = rad_malloc(sizeof(*inst)); if (!inst) { return -1; } memset(inst, 0, sizeof(*inst)); if (cf_section_parse(conf, inst, module_config) < 0) { free(inst); return -1; } /* * This module used to support SMB Password files, but it * made it too complicated. If the user tries to * configure an SMB Password file, then die, with an * error message. */ if (inst->passwd_file) { radlog(L_ERR, "rlm_mschap: SMB password file is no longer supported in this module. Use rlm_passwd module instead"); mschap_detach(inst); return -1; } /* * Create the dynamic translation. */ inst->xlat_name = cf_section_name2(conf); if (!inst->xlat_name) inst->xlat_name = cf_section_name1(conf); inst->xlat_name = strdup(inst->xlat_name); xlat_register(inst->xlat_name, mschap_xlat, inst); /* * For backwards compatibility */ if (!dict_valbyname(PW_AUTH_TYPE, inst->xlat_name)) { inst->auth_type = "MS-CHAP"; } else { inst->auth_type = inst->xlat_name; } /* * Check ntlm_auth_timeout is sane */ if (!inst->ntlm_auth_timeout) { inst->ntlm_auth_timeout = EXEC_TIMEOUT; } if (inst->ntlm_auth_timeout < 1) { radlog(L_ERR, "rlm_mschap: ntml_auth_timeout '%d' is too small (minimum: 1)", inst->ntlm_auth_timeout); return -1; } if (inst->ntlm_auth_timeout > 10) { radlog(L_ERR, "rlm_mschap: ntlm_auth_timeout '%d' is too large (maximum: 10)", inst->ntlm_auth_timeout); return -1; } return 0; } /* * add_reply() adds either MS-CHAP2-Success or MS-CHAP-Error * attribute to reply packet */ void mschap_add_reply(REQUEST *request, VALUE_PAIR** vp, unsigned char ident, const char* name, const char* value, int len) { VALUE_PAIR *reply_attr; reply_attr = pairmake(name, "", T_OP_EQ); if (!reply_attr) { RDEBUG("Failed to create attribute %s: %s\n", name, fr_strerror()); return; } reply_attr->vp_octets[0] = ident; memcpy(reply_attr->vp_octets + 1, value, len); reply_attr->length = len + 1; pairadd(vp, reply_attr); } /* * Add MPPE attributes to the reply. */ static void mppe_add_reply(REQUEST *request, const char* name, const uint8_t * value, int len) { VALUE_PAIR *vp; vp = radius_pairmake(request, &request->reply->vps, name, "", T_OP_EQ); if (!vp) { RDEBUG("rlm_mschap: mppe_add_reply failed to create attribute %s: %s\n", name, fr_strerror()); return; } memcpy(vp->vp_octets, value, len); vp->length = len; } /* * Do the MS-CHAP stuff. * * This function is here so that all of the MS-CHAP related * authentication is in one place, and we can perhaps later replace * it with code to call winbindd, or something similar. */ static int do_mschap(rlm_mschap_t *inst, REQUEST *request, VALUE_PAIR *password, uint8_t *challenge, uint8_t *response, uint8_t *nthashhash, int do_ntlm_auth) { uint8_t calculated[24]; /* * Do normal authentication. */ if (!do_ntlm_auth) { /* * No password: can't do authentication. */ if (!password) { RDEBUG2("FAILED: No NT/LM-Password. Cannot perform authentication."); return -1; } smbdes_mschap(password->vp_strvalue, challenge, calculated); if (rad_digest_cmp(response, calculated, 24) != 0) { return -1; } /* * If the password exists, and is an NT-Password, * then calculate the hash of the NT hash. Doing this * here minimizes work for later. */ if (password && (password->attribute == PW_NT_PASSWORD)) { fr_md4_calc(nthashhash, password->vp_octets, 16); } else { memset(nthashhash, 0, 16); } } else { /* run ntlm_auth */ int result; char buffer[256]; memset(nthashhash, 0, 16); /* * Run the program, and expect that we get 16 */ result = radius_exec_program(inst->ntlm_auth, request, TRUE, /* wait */ buffer, sizeof(buffer), inst->ntlm_auth_timeout, NULL, NULL, 1); if (result != 0) { char *p; VALUE_PAIR *vp = NULL; RDEBUG2("External script failed."); vp = pairmake("Module-Failure-Message", "", T_OP_EQ); if (!vp) { radlog_request(L_ERR, 0, request, "No memory to allocate Module-Failure-Message"); return RLM_MODULE_FAIL; } p = strchr(buffer, '\n'); if (p) *p = '\0'; snprintf(vp->vp_strvalue, sizeof(vp->vp_strvalue), "%s: External script says %s", inst->xlat_name, buffer); vp->length = strlen(vp->vp_strvalue); pairadd(&request->packet->vps, vp); return -1; } /* * Parse the answer as an nthashhash. * * ntlm_auth currently returns: * NT_KEY: 000102030405060708090a0b0c0d0e0f */ if (memcmp(buffer, "NT_KEY: ", 8) != 0) { RDEBUG2("Invalid output from ntlm_auth: expecting NT_KEY"); return -1; } /* * Check the length. It should be at least 32, * with an LF at the end. */ if (strlen(buffer + 8) < 32) { RDEBUG2("Invalid output from ntlm_auth: NT_KEY has unexpected length"); return -1; } /* * Update the NT hash hash, from the NT key. */ if (fr_hex2bin(buffer + 8, nthashhash, 16) != 16) { RDEBUG2("Invalid output from ntlm_auth: NT_KEY has non-hex values"); return -1; } } return 0; } /* * Data for the hashes. */ static const uint8_t SHSpad1[40] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; static const uint8_t SHSpad2[40] = { 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2 }; static const uint8_t magic1[27] = { 0x54, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20, 0x74, 0x68, 0x65, 0x20, 0x4d, 0x50, 0x50, 0x45, 0x20, 0x4d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x20, 0x4b, 0x65, 0x79 }; static const uint8_t magic2[84] = { 0x4f, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x20, 0x73, 0x69, 0x64, 0x65, 0x2c, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20, 0x74, 0x68, 0x65, 0x20, 0x73, 0x65, 0x6e, 0x64, 0x20, 0x6b, 0x65, 0x79, 0x3b, 0x20, 0x6f, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x73, 0x69, 0x64, 0x65, 0x2c, 0x20, 0x69, 0x74, 0x20, 0x69, 0x73, 0x20, 0x74, 0x68, 0x65, 0x20, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x20, 0x6b, 0x65, 0x79, 0x2e }; static const uint8_t magic3[84] = { 0x4f, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x20, 0x73, 0x69, 0x64, 0x65, 0x2c, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20, 0x74, 0x68, 0x65, 0x20, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x20, 0x6b, 0x65, 0x79, 0x3b, 0x20, 0x6f, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x73, 0x69, 0x64, 0x65, 0x2c, 0x20, 0x69, 0x74, 0x20, 0x69, 0x73, 0x20, 0x74, 0x68, 0x65, 0x20, 0x73, 0x65, 0x6e, 0x64, 0x20, 0x6b, 0x65, 0x79, 0x2e }; static void mppe_GetMasterKey(uint8_t *nt_hashhash,uint8_t *nt_response, uint8_t *masterkey) { uint8_t digest[20]; fr_SHA1_CTX Context; fr_SHA1Init(&Context); fr_SHA1Update(&Context,nt_hashhash,16); fr_SHA1Update(&Context,nt_response,24); fr_SHA1Update(&Context,magic1,27); fr_SHA1Final(digest,&Context); memcpy(masterkey,digest,16); } static void mppe_GetAsymmetricStartKey(uint8_t *masterkey,uint8_t *sesskey, int keylen,int issend) { uint8_t digest[20]; const uint8_t *s; fr_SHA1_CTX Context; memset(digest,0,20); if(issend) { s = magic3; } else { s = magic2; } fr_SHA1Init(&Context); fr_SHA1Update(&Context,masterkey,16); fr_SHA1Update(&Context,SHSpad1,40); fr_SHA1Update(&Context,s,84); fr_SHA1Update(&Context,SHSpad2,40); fr_SHA1Final(digest,&Context); memcpy(sesskey,digest,keylen); } static void mppe_chap2_get_keys128(uint8_t *nt_hashhash,uint8_t *nt_response, uint8_t *sendkey,uint8_t *recvkey) { uint8_t masterkey[16]; mppe_GetMasterKey(nt_hashhash,nt_response,masterkey); mppe_GetAsymmetricStartKey(masterkey,sendkey,16,1); mppe_GetAsymmetricStartKey(masterkey,recvkey,16,0); } /* * Generate MPPE keys. */ static void mppe_chap2_gen_keys128(uint8_t *nt_hashhash,uint8_t *response, uint8_t *sendkey,uint8_t *recvkey) { uint8_t enckey1[16]; uint8_t enckey2[16]; mppe_chap2_get_keys128(nt_hashhash,response,enckey1,enckey2); /* * dictionary.microsoft defines these attributes as * 'encrypt=2'. The functions in src/lib/radius.c will * take care of encrypting/decrypting them as appropriate, * so that we don't have to. */ memcpy (sendkey, enckey1, 16); memcpy (recvkey, enckey2, 16); } /* * mschap_authorize() - authorize user if we can authenticate * it later. Add Auth-Type attribute if present in module * configuration (usually Auth-Type must be "MS-CHAP") */ static int mschap_authorize(void * instance, REQUEST *request) { #define inst ((rlm_mschap_t *)instance) VALUE_PAIR *challenge = NULL, *response = NULL; challenge = pairfind(request->packet->vps, PW_MSCHAP_CHALLENGE); if (!challenge) { return RLM_MODULE_NOOP; } response = pairfind(request->packet->vps, PW_MSCHAP_RESPONSE); if (!response) response = pairfind(request->packet->vps, PW_MSCHAP2_RESPONSE); /* * Nothing we recognize. Don't do anything. */ if (!response) { RDEBUG2("Found MS-CHAP-Challenge, but no MS-CHAP-Response."); return RLM_MODULE_NOOP; } if (pairfind(request->config_items, PW_AUTH_TYPE)) { RDEBUG2("WARNING: Auth-Type already set. Not setting to MS-CHAP"); return RLM_MODULE_NOOP; } RDEBUG2("Found MS-CHAP attributes. Setting 'Auth-Type = %s'", inst->xlat_name); /* * Set Auth-Type to MS-CHAP. The authentication code * will take care of turning clear-text passwords into * NT/LM passwords. */ if (!radius_pairmake(request, &request->config_items, "Auth-Type", inst->auth_type, T_OP_EQ)) { return RLM_MODULE_FAIL; } return RLM_MODULE_OK; #undef inst } /* * mschap_authenticate() - authenticate user based on given * attributes and configuration. * We will try to find out password in configuration * or in configured passwd file. * If one is found we will check paraneters given by NAS. * * If PW_SMB_ACCOUNT_CTRL is not set to ACB_PWNOTREQ we must have * one of: * PAP: PW_USER_PASSWORD or * MS-CHAP: PW_MSCHAP_CHALLENGE and PW_MSCHAP_RESPONSE or * MS-CHAP2: PW_MSCHAP_CHALLENGE and PW_MSCHAP2_RESPONSE * In case of password mismatch or locked account we MAY return * PW_MSCHAP_ERROR for MS-CHAP or MS-CHAP v2 * If MS-CHAP2 succeeds we MUST return * PW_MSCHAP2_SUCCESS */ static int mschap_authenticate(void * instance, REQUEST *request) { #define inst ((rlm_mschap_t *)instance) VALUE_PAIR *challenge = NULL; VALUE_PAIR *response = NULL; VALUE_PAIR *password = NULL; VALUE_PAIR *lm_password, *nt_password, *smb_ctrl; VALUE_PAIR *username; uint8_t nthashhash[16]; char msch2resp[42]; char *username_string; int chap = 0; int do_ntlm_auth; /* * If we have ntlm_auth configured, use it unless told * otherwise */ do_ntlm_auth = (inst->ntlm_auth != NULL); /* * If we have an ntlm_auth configuration, then we may * want to suppress it. */ if (do_ntlm_auth) { VALUE_PAIR *vp = pairfind(request->config_items, PW_MS_CHAP_USE_NTLM_AUTH); if (vp) do_ntlm_auth = vp->vp_integer; } /* * Find the SMB-Account-Ctrl attribute, or the * SMB-Account-Ctrl-Text attribute. */ smb_ctrl = pairfind(request->config_items, PW_SMB_ACCOUNT_CTRL); if (!smb_ctrl) { password = pairfind(request->config_items, PW_SMB_ACCOUNT_CTRL_TEXT); if (password) { smb_ctrl = radius_pairmake(request, &request->config_items, "SMB-Account-CTRL", "0", T_OP_SET); if (smb_ctrl) { smb_ctrl->vp_integer = pdb_decode_acct_ctrl(password->vp_strvalue); } } } /* * We're configured to do MS-CHAP authentication. * and account control information exists. Enforce it. */ if (smb_ctrl) { /* * Password is not required. */ if ((smb_ctrl->vp_integer & ACB_PWNOTREQ) != 0) { RDEBUG2("SMB-Account-Ctrl says no password is required."); return RLM_MODULE_OK; } } /* * Decide how to get the passwords. */ password = pairfind(request->config_items, PW_CLEARTEXT_PASSWORD); /* * We need an LM-Password. */ lm_password = pairfind(request->config_items, PW_LM_PASSWORD); if (lm_password) { /* * Allow raw octets. */ if ((lm_password->length == 16) || ((lm_password->length == 32) && (fr_hex2bin(lm_password->vp_strvalue, lm_password->vp_octets, 16) == 16))) { RDEBUG2("Found LM-Password"); lm_password->length = 16; } else { radlog_request(L_ERR, 0, request, "Invalid LM-Password"); lm_password = NULL; } } else if (!password) { if (!do_ntlm_auth) RDEBUG2("No Cleartext-Password configured. Cannot create LM-Password."); } else { /* there is a configured Cleartext-Password */ lm_password = radius_pairmake(request, &request->config_items, "LM-Password", "", T_OP_EQ); if (!lm_password) { radlog_request(L_ERR, 0, request, "No memory"); } else { smbdes_lmpwdhash(password->vp_strvalue, lm_password->vp_octets); lm_password->length = 16; } } /* * We need an NT-Password. */ nt_password = pairfind(request->config_items, PW_NT_PASSWORD); if (nt_password) { if ((nt_password->length == 16) || ((nt_password->length == 32) && (fr_hex2bin(nt_password->vp_strvalue, nt_password->vp_octets, 16) == 16))) { RDEBUG2("Found NT-Password"); nt_password->length = 16; } else { radlog_request(L_ERR, 0, request, "Invalid NT-Password"); nt_password = NULL; } } else if (!password) { if (!do_ntlm_auth) RDEBUG2("No Cleartext-Password configured. Cannot create NT-Password."); } else { /* there is a configured Cleartext-Password */ nt_password = radius_pairmake(request, &request->config_items, "NT-Password", "", T_OP_EQ); if (!nt_password) { radlog_request(L_ERR, 0, request, "No memory"); return RLM_MODULE_FAIL; } else { mschap_ntpwdhash(nt_password->vp_octets, password->vp_strvalue); nt_password->length = 16; } } challenge = pairfind(request->packet->vps, PW_MSCHAP_CHALLENGE); if (!challenge) { RDEBUG("ERROR: You set 'Auth-Type = MS-CHAP' for a request that does not contain any MS-CHAP attributes!"); return RLM_MODULE_REJECT; } /* * We also require an MS-CHAP-Response. */ response = pairfind(request->packet->vps, PW_MSCHAP_RESPONSE); /* * MS-CHAP-Response, means MS-CHAPv1 */ if (response) { int offset; /* * MS-CHAPv1 challenges are 8 octets. */ if (challenge->length < 8) { radlog_request(L_AUTH, 0, request, "MS-CHAP-Challenge has the wrong format."); return RLM_MODULE_INVALID; } /* * Responses are 50 octets. */ if (response->length < 50) { radlog_request(L_AUTH, 0, request, "MS-CHAP-Response has the wrong format."); return RLM_MODULE_INVALID; } /* * We are doing MS-CHAP. Calculate the MS-CHAP * response */ if (response->vp_octets[1] & 0x01) { RDEBUG2("Client is using MS-CHAPv1 with NT-Password"); password = nt_password; offset = 26; } else { RDEBUG2("Client is using MS-CHAPv1 with LM-Password"); password = lm_password; offset = 2; } /* * Do the MS-CHAP authentication. */ if (do_mschap(inst, request, password, challenge->vp_octets, response->vp_octets + offset, nthashhash, do_ntlm_auth) < 0) { RDEBUG2("MS-CHAP-Response is incorrect."); goto do_error; } chap = 1; } else if ((response = pairfind(request->packet->vps, PW_MSCHAP2_RESPONSE)) != NULL) { uint8_t mschapv1_challenge[16]; VALUE_PAIR *name_attr, *response_name; /* * MS-CHAPv2 challenges are 16 octets. */ if (challenge->length < 16) { radlog_request(L_AUTH, 0, request, "MS-CHAP-Challenge has the wrong format."); return RLM_MODULE_INVALID; } /* * Responses are 50 octets. */ if (response->length < 50) { radlog_request(L_AUTH, 0, request, "MS-CHAP-Response has the wrong format."); return RLM_MODULE_INVALID; } /* * We also require a User-Name */ username = pairfind(request->packet->vps, PW_USER_NAME); if (!username) { radlog_request(L_AUTH, 0, request, "We require a User-Name for MS-CHAPv2"); return RLM_MODULE_INVALID; } /* * Check for MS-CHAP-User-Name and if found, use it * to construct the MSCHAPv1 challenge. This is * set by rlm_eap_mschap to the MS-CHAP Response * packet Name field. * * We prefer this to the User-Name in the * packet. */ response_name = pairfind(request->packet->vps, PW_MS_CHAP_USER_NAME); if (response_name) { name_attr = response_name; } else { name_attr = username; } /* * with_ntdomain_hack moved here, too. */ if ((username_string = strchr(name_attr->vp_strvalue, '\\')) != NULL) { if (inst->with_ntdomain_hack) { username_string++; } else { RDEBUG2("NT Domain delimeter found, should we have enabled with_ntdomain_hack?"); username_string = name_attr->vp_strvalue; } } else { username_string = name_attr->vp_strvalue; } /* * When the names are ASCII, they should be * identical. When the names are non-ASCII, * User-Name is UTF-8, and MS-CHAP-User-Name is * some local Windows character set. So they * can't be identical. And because you don't * know what the MS-CHAP character set is, * there's no way to do ANY kind of comparison. * They could be "bob" and "doug", and you'd have * no idea. */ if (response_name && ((username->length != response_name->length) || (strncasecmp(username->vp_strvalue, response_name->vp_strvalue, username->length) != 0))) { RDEBUG("WARNING: User-Name (%s) is not the same as MS-CHAP Name (%s) from EAP-MSCHAPv2", username->vp_strvalue, response_name->vp_strvalue); } #ifdef __APPLE__ /* * No "known good" NT-Password attribute. Try to do * OpenDirectory authentication. * * If OD determines the user is an AD user it will return noop, which * indicates the auth process should continue directly to AD. * Otherwise OD will determine auth success/fail. */ if (!nt_password && inst->open_directory) { RDEBUG2("No NT-Password configured. Trying OpenDirectory Authentication."); int odStatus = od_mschap_auth(request, challenge, username); if (odStatus != RLM_MODULE_NOOP) { return odStatus; } } #endif /* * The old "mschapv2" function has been moved to * here. * * MS-CHAPv2 takes some additional data to create an * MS-CHAPv1 challenge, and then does MS-CHAPv1. */ RDEBUG2("Creating challenge hash with username: %s", username_string); mschap_challenge_hash(response->vp_octets + 2, /* peer challenge */ challenge->vp_octets, /* our challenge */ username_string, /* user name */ mschapv1_challenge); /* resulting challenge */ RDEBUG2("Client is using MS-CHAPv2 for %s, we need NT-Password", username_string); if (do_mschap(inst, request, nt_password, mschapv1_challenge, response->vp_octets + 26, nthashhash, do_ntlm_auth) < 0) { int i; char buffer[128]; RDEBUG2("FAILED: MS-CHAP2-Response is incorrect"); do_error: snprintf(buffer, sizeof(buffer), "E=691 R=%d", inst->allow_retry); if (inst->retry_msg) { snprintf(buffer + 9, sizeof(buffer) - 9, " C="); for (i = 0; i < 16; i++) { snprintf(buffer + 12 + i*2, sizeof(buffer) - 12 - i*2, "%02x", fr_rand() & 0xff); } snprintf(buffer + 44, sizeof(buffer) - 44, " V=3 M=%s", inst->retry_msg); } mschap_add_reply(request, &request->reply->vps, *response->vp_octets, "MS-CHAP-Error", buffer, strlen(buffer)); return RLM_MODULE_REJECT; } mschap_auth_response(username_string, /* without the domain */ nthashhash, /* nt-hash-hash */ response->vp_octets + 26, /* peer response */ response->vp_octets + 2, /* peer challenge */ challenge->vp_octets, /* our challenge */ msch2resp); /* calculated MPPE key */ mschap_add_reply(request, &request->reply->vps, *response->vp_octets, "MS-CHAP2-Success", msch2resp, 42); chap = 2; } else { /* Neither CHAPv1 or CHAPv2 response: die */ RDEBUG("ERROR: You set 'Auth-Type = MS-CHAP' for a request that does not contain any MS-CHAP attributes!"); return RLM_MODULE_INVALID; } /* * We have a CHAP response, but the account may be * disabled. Reject the user with the same error code * we use when their password is invalid. */ if (smb_ctrl) { /* * Account is disabled. * * They're found, but they don't exist, so we * return 'not found'. */ if (((smb_ctrl->vp_integer & ACB_DISABLED) != 0) || ((smb_ctrl->vp_integer & (ACB_NORMAL|ACB_WSTRUST)) == 0)) { RDEBUG2("SMB-Account-Ctrl says that the account is disabled, or is not a normal or workstatin trust account."); mschap_add_reply(request, &request->reply->vps, *response->vp_octets, "MS-CHAP-Error", "E=691 R=1", 9); return RLM_MODULE_NOTFOUND; } /* * User is locked out. */ if ((smb_ctrl->vp_integer & ACB_AUTOLOCK) != 0) { RDEBUG2("SMB-Account-Ctrl says that the account is locked out."); mschap_add_reply(request, &request->reply->vps, *response->vp_octets, "MS-CHAP-Error", "E=647 R=0", 9); return RLM_MODULE_USERLOCK; } } /* now create MPPE attributes */ if (inst->use_mppe) { uint8_t mppe_sendkey[34]; uint8_t mppe_recvkey[34]; if (chap == 1){ RDEBUG2("adding MS-CHAPv1 MPPE keys"); memset(mppe_sendkey, 0, 32); if (lm_password) { memcpy(mppe_sendkey, lm_password->vp_octets, 8); } /* * According to RFC 2548 we * should send NT hash. But in * practice it doesn't work. * Instead, we should send nthashhash * * This is an error on RFC 2548. */ /* * do_mschap cares to zero nthashhash if NT hash * is not available. */ memcpy(mppe_sendkey + 8, nthashhash, 16); mppe_add_reply(request, "MS-CHAP-MPPE-Keys", mppe_sendkey, 32); } else if (chap == 2) { RDEBUG2("adding MS-CHAPv2 MPPE keys"); mppe_chap2_gen_keys128(nthashhash, response->vp_octets + 26, mppe_sendkey, mppe_recvkey); mppe_add_reply(request, "MS-MPPE-Recv-Key", mppe_recvkey, 16); mppe_add_reply(request, "MS-MPPE-Send-Key", mppe_sendkey, 16); } radius_pairmake(request, &request->reply->vps, "MS-MPPE-Encryption-Policy", (inst->require_encryption)? "0x00000002":"0x00000001", T_OP_EQ); radius_pairmake(request, &request->reply->vps, "MS-MPPE-Encryption-Types", (inst->require_strong)? "0x00000004":"0x00000006", T_OP_EQ); } /* else we weren't asked to use MPPE */ return RLM_MODULE_OK; #undef inst } module_t rlm_mschap = { RLM_MODULE_INIT, "MS-CHAP", RLM_TYPE_THREAD_SAFE | RLM_TYPE_HUP_SAFE, /* type */ mschap_instantiate, /* instantiation */ mschap_detach, /* detach */ { mschap_authenticate, /* authenticate */ mschap_authorize, /* authorize */ NULL, /* pre-accounting */ NULL, /* accounting */ NULL, /* checksimul */ NULL, /* pre-proxy */ NULL, /* post-proxy */ NULL /* post-auth */ }, }; freeradius-server/src/modules/rlm_mschap/smbdes.c000066400000000000000000000234711257552170400225370ustar00rootroot00000000000000/* Unix SMB/CIFS implementation. a partial implementation of DES designed for use in the SMB authentication protocol Copyright (C) Andrew Tridgell 1998 This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. Copyright 2006 The FreeRADIUS server project */ /* NOTES: This code makes no attempt to be fast! In fact, it is a very slow implementation This code is NOT a complete DES implementation. It implements only the minimum necessary for SMB authentication, as used by all SMB products (including every copy of Microsoft Windows95 ever sold) In particular, it can only do a unchained forward DES pass. This means it is not possible to use this code for encryption/decryption of data, instead it is only useful as a "hash" algorithm. There is no entry point into this code that allows normal DES operation. I believe this means that this code does not come under ITAR regulations but this is NOT a legal opinion. If you are concerned about the applicability of ITAR regulations to this code then you should confirm it for yourself (and maybe let me know if you come up with a different answer to the one above) */ #include RCSID("$Id$") #include #include #include "smbdes.h" #define uchar unsigned char static const uchar perm1[56] = {57, 49, 41, 33, 25, 17, 9, 1, 58, 50, 42, 34, 26, 18, 10, 2, 59, 51, 43, 35, 27, 19, 11, 3, 60, 52, 44, 36, 63, 55, 47, 39, 31, 23, 15, 7, 62, 54, 46, 38, 30, 22, 14, 6, 61, 53, 45, 37, 29, 21, 13, 5, 28, 20, 12, 4}; static const uchar perm2[48] = {14, 17, 11, 24, 1, 5, 3, 28, 15, 6, 21, 10, 23, 19, 12, 4, 26, 8, 16, 7, 27, 20, 13, 2, 41, 52, 31, 37, 47, 55, 30, 40, 51, 45, 33, 48, 44, 49, 39, 56, 34, 53, 46, 42, 50, 36, 29, 32}; static const uchar perm3[64] = {58, 50, 42, 34, 26, 18, 10, 2, 60, 52, 44, 36, 28, 20, 12, 4, 62, 54, 46, 38, 30, 22, 14, 6, 64, 56, 48, 40, 32, 24, 16, 8, 57, 49, 41, 33, 25, 17, 9, 1, 59, 51, 43, 35, 27, 19, 11, 3, 61, 53, 45, 37, 29, 21, 13, 5, 63, 55, 47, 39, 31, 23, 15, 7}; static const uchar perm4[48] = { 32, 1, 2, 3, 4, 5, 4, 5, 6, 7, 8, 9, 8, 9, 10, 11, 12, 13, 12, 13, 14, 15, 16, 17, 16, 17, 18, 19, 20, 21, 20, 21, 22, 23, 24, 25, 24, 25, 26, 27, 28, 29, 28, 29, 30, 31, 32, 1}; static const uchar perm5[32] = { 16, 7, 20, 21, 29, 12, 28, 17, 1, 15, 23, 26, 5, 18, 31, 10, 2, 8, 24, 14, 32, 27, 3, 9, 19, 13, 30, 6, 22, 11, 4, 25}; static const uchar perm6[64] ={ 40, 8, 48, 16, 56, 24, 64, 32, 39, 7, 47, 15, 55, 23, 63, 31, 38, 6, 46, 14, 54, 22, 62, 30, 37, 5, 45, 13, 53, 21, 61, 29, 36, 4, 44, 12, 52, 20, 60, 28, 35, 3, 43, 11, 51, 19, 59, 27, 34, 2, 42, 10, 50, 18, 58, 26, 33, 1, 41, 9, 49, 17, 57, 25}; static const uchar sc[16] = {1, 1, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 1}; static const uchar sbox[8][4][16] = { {{14, 4, 13, 1, 2, 15, 11, 8, 3, 10, 6, 12, 5, 9, 0, 7}, {0, 15, 7, 4, 14, 2, 13, 1, 10, 6, 12, 11, 9, 5, 3, 8}, {4, 1, 14, 8, 13, 6, 2, 11, 15, 12, 9, 7, 3, 10, 5, 0}, {15, 12, 8, 2, 4, 9, 1, 7, 5, 11, 3, 14, 10, 0, 6, 13}}, {{15, 1, 8, 14, 6, 11, 3, 4, 9, 7, 2, 13, 12, 0, 5, 10}, {3, 13, 4, 7, 15, 2, 8, 14, 12, 0, 1, 10, 6, 9, 11, 5}, {0, 14, 7, 11, 10, 4, 13, 1, 5, 8, 12, 6, 9, 3, 2, 15}, {13, 8, 10, 1, 3, 15, 4, 2, 11, 6, 7, 12, 0, 5, 14, 9}}, {{10, 0, 9, 14, 6, 3, 15, 5, 1, 13, 12, 7, 11, 4, 2, 8}, {13, 7, 0, 9, 3, 4, 6, 10, 2, 8, 5, 14, 12, 11, 15, 1}, {13, 6, 4, 9, 8, 15, 3, 0, 11, 1, 2, 12, 5, 10, 14, 7}, {1, 10, 13, 0, 6, 9, 8, 7, 4, 15, 14, 3, 11, 5, 2, 12}}, {{7, 13, 14, 3, 0, 6, 9, 10, 1, 2, 8, 5, 11, 12, 4, 15}, {13, 8, 11, 5, 6, 15, 0, 3, 4, 7, 2, 12, 1, 10, 14, 9}, {10, 6, 9, 0, 12, 11, 7, 13, 15, 1, 3, 14, 5, 2, 8, 4}, {3, 15, 0, 6, 10, 1, 13, 8, 9, 4, 5, 11, 12, 7, 2, 14}}, {{2, 12, 4, 1, 7, 10, 11, 6, 8, 5, 3, 15, 13, 0, 14, 9}, {14, 11, 2, 12, 4, 7, 13, 1, 5, 0, 15, 10, 3, 9, 8, 6}, {4, 2, 1, 11, 10, 13, 7, 8, 15, 9, 12, 5, 6, 3, 0, 14}, {11, 8, 12, 7, 1, 14, 2, 13, 6, 15, 0, 9, 10, 4, 5, 3}}, {{12, 1, 10, 15, 9, 2, 6, 8, 0, 13, 3, 4, 14, 7, 5, 11}, {10, 15, 4, 2, 7, 12, 9, 5, 6, 1, 13, 14, 0, 11, 3, 8}, {9, 14, 15, 5, 2, 8, 12, 3, 7, 0, 4, 10, 1, 13, 11, 6}, {4, 3, 2, 12, 9, 5, 15, 10, 11, 14, 1, 7, 6, 0, 8, 13}}, {{4, 11, 2, 14, 15, 0, 8, 13, 3, 12, 9, 7, 5, 10, 6, 1}, {13, 0, 11, 7, 4, 9, 1, 10, 14, 3, 5, 12, 2, 15, 8, 6}, {1, 4, 11, 13, 12, 3, 7, 14, 10, 15, 6, 8, 0, 5, 9, 2}, {6, 11, 13, 8, 1, 4, 10, 7, 9, 5, 0, 15, 14, 2, 3, 12}}, {{13, 2, 8, 4, 6, 15, 11, 1, 10, 9, 3, 14, 5, 0, 12, 7}, {1, 15, 13, 8, 10, 3, 7, 4, 12, 5, 6, 11, 0, 14, 9, 2}, {7, 11, 4, 1, 9, 12, 14, 2, 0, 6, 10, 13, 15, 3, 5, 8}, {2, 1, 14, 7, 4, 10, 8, 13, 15, 12, 9, 0, 3, 5, 6, 11}}}; static void permute(char *out, const char *in, const uchar *p, int n) { int i; for (i=0;i>1; key[1] = ((str[0]&0x01)<<6) | (str[1]>>2); key[2] = ((str[1]&0x03)<<5) | (str[2]>>3); key[3] = ((str[2]&0x07)<<4) | (str[3]>>4); key[4] = ((str[3]&0x0F)<<3) | (str[4]>>5); key[5] = ((str[4]&0x1F)<<2) | (str[5]>>6); key[6] = ((str[5]&0x3F)<<1) | (str[6]>>7); key[7] = str[6]&0x7F; for (i=0;i<8;i++) { key[i] = (key[i]<<1); } } static void smbhash(unsigned char *out, const unsigned char *in, unsigned char *key) { int i; char outb[64]; char inb[64]; char keyb[64]; unsigned char key2[8]; str_to_key(key, key2); for (i=0;i<64;i++) { inb[i] = (in[i/8] & (1<<(7-(i%8)))) ? 1 : 0; keyb[i] = (key2[i/8] & (1<<(7-(i%8)))) ? 1 : 0; outb[i] = 0; } dohash(outb, inb, keyb); for (i=0;i<8;i++) { out[i] = 0; } for (i=0;i<64;i++) { if (outb[i]) out[i/8] |= (1<<(7-(i%8))); } } /* * Converts the password to uppercase, and creates the LM * password hash. */ void smbdes_lmpwdhash(const char *password, uint8_t *lmhash) { int i; uint8_t p14[14]; static uint8_t sp8[8] = {0x4b, 0x47, 0x53, 0x21, 0x40, 0x23, 0x24, 0x25}; memset(p14, 0, sizeof(p14)); for (i = 0; i < 14 && password[i]; i++) { p14[i] = toupper((int) password[i]); } smbhash(lmhash, sp8, p14); smbhash(lmhash+8, sp8, p14+7); } /* * Take the NT or LM password, and return the MSCHAP response * * The win_password MUST be exactly 16 bytes long. */ void smbdes_mschap(const char *win_password, const uint8_t *challenge, uint8_t *response) { uint8_t p21[21]; memset(p21, 0, sizeof(p21)); memcpy(p21, win_password, 16); smbhash(response, challenge, p21); smbhash(response+8, challenge, p21+7); smbhash(response+16, challenge, p21+14); } freeradius-server/src/modules/rlm_mschap/smbdes.h000066400000000000000000000005111257552170400225320ustar00rootroot00000000000000/* Copyright 2006 The FreeRADIUS server project */ #ifndef _SMBDES_H #define _SMBDES_H #include RCSIDH(smbdes_h, "$Id$") void smbdes_lmpwdhash(const char *password, uint8_t *lmhash); void smbdes_mschap(const char *win_password, const uint8_t *challenge, uint8_t *response); #endif /*_SMBDES_H*/ freeradius-server/src/modules/rlm_mschap/smbencrypt.c000066400000000000000000000050371257552170400234460ustar00rootroot00000000000000/* * smbencrypt.c Produces LM-Password and NT-Password from * cleartext password * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2002 3APA3A for FreeRADIUS project Copyright 2006 The FreeRADIUS server project */ #include RCSID("$Id$") #include #include #include #include #include #include "smbdes.h" static const char * hex = "0123456789ABCDEF"; /* * FIXME: use functions in freeradius */ static void tohex (const unsigned char * src, size_t len, char *dst) { size_t i; for (i=0; i> 4)]; dst[(i*2) + 1] = hex[(src[i]&0x0F)]; } dst[(i*2)] = 0; } static void ntpwdhash (uint8_t *szHash, const char *szPassword) { char szUnicodePass[513]; char nPasswordLen; int i; /* * NT passwords are unicode. Convert plain text password * to unicode by inserting a zero every other byte */ nPasswordLen = strlen(szPassword); for (i = 0; i < nPasswordLen; i++) { szUnicodePass[i << 1] = szPassword[i]; szUnicodePass[(i << 1) + 1] = 0; } /* Encrypt Unicode password to a 16-byte MD4 hash */ fr_md4_calc(szHash, (uint8_t *) szUnicodePass, (nPasswordLen<<1) ); } int main (int argc, char *argv[]) { int i, l; char password[1024]; uint8_t hash[16]; char ntpass[33]; char lmpass[33]; fprintf(stderr, "LM Hash \tNT Hash\n"); fprintf(stderr, "--------------------------------\t--------------------------------\n"); fflush(stderr); for (i = 1; i < argc; i++ ) { l = strlen(password); if (l && password[l-1] == '\n') password [l-1] = 0; smbdes_lmpwdhash(argv[i], hash); tohex (hash, 16, lmpass); ntpwdhash (hash, argv[i]); tohex (hash, 16, ntpass); printf("%s\t%s\n", lmpass, ntpass); } return 0; } freeradius-server/src/modules/rlm_opendirectory/000077500000000000000000000000001257552170400225225ustar00rootroot00000000000000freeradius-server/src/modules/rlm_opendirectory/.gitignore000066400000000000000000000000111257552170400245020ustar00rootroot00000000000000Makefile freeradius-server/src/modules/rlm_opendirectory/Makefile.in000066400000000000000000000003131257552170400245640ustar00rootroot00000000000000TARGET = @targetname@ SRCS = rlm_opendirectory.c HEADERS = RLM_LIBS = @od_ldflags@ RLM_CFLAGS = @od_cflags@ include ../rules.mak $(STATIC_OBJS): $(HEADERS) $(DYNAMIC_OBJS): $(HEADERS) freeradius-server/src/modules/rlm_opendirectory/configure000077500000000000000000003304351257552170400244410ustar00rootroot00000000000000#! /bin/sh # From configure.in Revision. # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.61. # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, # 2002, 2003, 2004, 2005, 2006 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=: # 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 # PATH needs CR # 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 # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false 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.) as_nl=' ' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. 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 # Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # CDPATH. $as_unset CDPATH if test "x$CONFIG_SHELL" = x; then if (eval ":") 2>/dev/null; then as_have_required=yes else as_have_required=no fi if test $as_have_required = yes && (eval ": (as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=\$LINENO as_lineno_2=\$LINENO test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } ") 2> /dev/null; then : else as_candidate_shells= as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. case $as_dir in /*) for as_base in sh bash ksh sh5; do as_candidate_shells="$as_candidate_shells $as_dir/$as_base" done;; esac done IFS=$as_save_IFS for as_shell in $as_candidate_shells $SHELL; do # Try only shells that exist, to save several forks. if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { ("$as_shell") 2> /dev/null <<\_ASEOF 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 : _ASEOF }; then CONFIG_SHELL=$as_shell as_have_required=yes if { "$as_shell" 2> /dev/null <<\_ASEOF 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 : (as_func_return () { (exit $1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = "$1" ); then : else exitcode=1 echo positional parameters were not saved. fi test $exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } _ASEOF }; then break fi fi done if test "x$CONFIG_SHELL" != x; then for as_var in BASH_ENV ENV do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done export CONFIG_SHELL exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} fi if test $as_have_required = no; then echo This script requires a shell more modern than all the echo shells that I found on your system. Please install a echo modern shell, or manually run the script under such a echo shell if you do have one. { (exit 1); exit 1; } fi fi fi (eval "as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0") || { echo No shell found that supports shell functions. echo Please tell autoconf@gnu.org about your system, echo including any error possibly output before this echo message } as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, and appends # trailing '-' during substitution so that $LINENO is not a special # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # scripts with optimization help from Paolo Bonzini. 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" || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi 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 fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi 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=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, 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= SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME= PACKAGE_TARNAME= PACKAGE_VERSION= PACKAGE_STRING= PACKAGE_BUGREPORT= ac_unique_file="rlm_opendirectory.c" ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datarootdir datadir sysconfdir sharedstatedir localstatedir includedir oldincludedir docdir infodir htmldir dvidir pdfdir psdir libdir localedir mandir DEFS ECHO_C ECHO_N ECHO_T LIBS build_alias host_alias target_alias CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP od_ldflags od_cflags targetname LIBOBJS LTLIBOBJS' ac_subst_files='' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CPP' # Initialize some variables set by options. ac_init_help= ac_init_version=false # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *) ac_optarg=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_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` eval enable_$ac_feature=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_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` eval enable_$ac_feature=\$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_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/[-.]/_/g'` eval with_$ac_package=\$ac_optarg ;; -without-* | --without-*) ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/[-.]/_/g'` eval with_$ac_package=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 ;; -*) { echo "$as_me: error: unrecognized option: $ac_option Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && 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'` { echo "$as_me: error: missing argument to $ac_option" >&2 { (exit 1); exit 1; }; } fi # Be sure to have absolute directory names. 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 case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; } 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 echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || { echo "$as_me: error: Working directory cannot be determined" >&2 { (exit 1); exit 1; }; } test "X$ac_ls_di" = "X$ac_pwd_ls_di" || { echo "$as_me: error: pwd does not report name of working directory" >&2 { (exit 1); exit 1; }; } # 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 -- "$0" || $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$0" : 'X\(//\)[^/]' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X"$0" | 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 .." { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2 { (exit 1); exit 1; }; } pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures this package to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF _ACEOF fi if test -n "$ac_init_help"; then cat <<\_ACEOF 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 C/C++/Objective C preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. _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" || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`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 echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF configure generated by GNU Autoconf 2.61 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 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 cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by $as_me, which was generated by GNU Autoconf 2.61. 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=. 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=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; 2) ac_configure_args1="$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 ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac done done $as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } $as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export 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 cat <<\_ASBOX ## ---------------- ## ## Cache variables. ## ## ---------------- ## _ASBOX 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_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( *) $as_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 cat <<\_ASBOX ## ----------------- ## ## Output variables. ## ## ----------------- ## _ASBOX echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then cat <<\_ASBOX ## ------------------- ## ## File substitutions. ## ## ------------------- ## _ASBOX echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then cat <<\_ASBOX ## ----------- ## ## confdefs.h. ## ## ----------- ## _ASBOX echo cat confdefs.h echo fi test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" 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'; { (exit 1); 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 # 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 # Let the site file select an alternate cache file if it wants to. # Prefer explicitly selected file to automatically selected ones. if test -n "$CONFIG_SITE"; then set x "$CONFIG_SITE" elif test "x$prefix" != xNONE; then set x "$prefix/share/config.site" "$prefix/etc/config.site" else set x "$ac_default_prefix/share/config.site" \ "$ac_default_prefix/etc/config.site" fi shift for ac_site_file do if test -r "$ac_site_file"; then { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" 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. if test -f "$cache_file"; then { echo "$as_me:$LINENO: loading cache $cache_file" >&5 echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { echo "$as_me:$LINENO: creating cache $cache_file" >&5 echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 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 { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 echo "$as_me: former value: $ac_old_val" >&2;} { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 echo "$as_me: current value: $ac_new_val" >&2;} ac_cache_corrupted=: fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`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. *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 echo "$as_me: error: changes in the environment can compromise the build" >&2;} { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} { (exit 1); exit 1; }; } 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 x$with_rlm_opendirectory != xno; then 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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}gcc" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="gcc" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}cc" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="$ac_prog" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&5 echo "$as_me: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } # Provide some information about the compiler. echo "$as_me:$LINENO: checking for C compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (ac_try="$ac_compiler --version >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -v >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -V >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out 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. { echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6; } ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # # List of possible output files, starting from the most likely. # The algorithm is not robust to junk in `.', hence go to wildcards (a.*) # only as a last resort. b.out is created by i960 compilers. ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out' # # The IRIX 6 linker writes into existing files which may not be # executable, retaining their permissions. Remove them first so a # subsequent execution test works. ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link_default") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; 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 | *.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 { echo "$as_me:$LINENO: result: $ac_file" >&5 echo "${ECHO_T}$ac_file" >&6; } if test -z "$ac_file"; then echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: C compiler cannot create executables See \`config.log' for more details." >&5 echo "$as_me: error: C compiler cannot create executables See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } fi ac_exeext=$ac_cv_exeext # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { echo "$as_me:$LINENO: checking whether the C compiler works" >&5 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6; } # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then if { ac_try='./$ac_file' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { echo "$as_me:$LINENO: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&5 echo "$as_me: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi fi fi { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } rm -f a.out a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; } { echo "$as_me:$LINENO: result: $cross_compiling" >&5 echo "${ECHO_T}$cross_compiling" >&6; } { echo "$as_me:$LINENO: checking for suffix of executables" >&5 echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; } if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; 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 | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest$ac_cv_exeext { echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 echo "${ECHO_T}$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT { echo "$as_me:$LINENO: checking for suffix of object files" >&5 echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; } if test "${ac_cv_objext+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; 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 ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 echo "${ECHO_T}$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; } if test "${ac_cv_c_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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 { echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; } GCC=`test $ac_compiler_gnu = yes && echo yes` ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CFLAGS="" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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 { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 echo "${ECHO_T}$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 { echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_c89+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_c89=$ac_arg else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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) { echo "$as_me:$LINENO: result: none needed" >&5 echo "${ECHO_T}none needed" >&6; } ;; xno) { echo "$as_me:$LINENO: result: unsupported" >&5 echo "${ECHO_T}unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;; 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 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 { echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if test "${ac_cv_prog_CPP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f 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 { echo "$as_me:$LINENO: result: $CPP" >&5 echo "${ECHO_T}$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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&5 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } 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 od_ldflags="${od_ldflags} -framework DirectoryService" ac_safe=`echo "membership.h" | sed 'y%./+-%__pm%'` { echo "$as_me:$LINENO: checking for membership.h" >&5 echo $ECHO_N "checking for membership.h... $ECHO_C" >&6; } old_CFLAGS="$CFLAGS" smart_include= smart_include_dir= if test "x$smart_try_dir" != "x"; then for try in $smart_try_dir; do CFLAGS="$old_CFLAGS -I$try" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { int a = 1; ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then smart_include="-I$try" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 smart_include= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test "x$smart_include" != "x"; then break; fi done CFLAGS="$old_CFLAGS" fi if test "x$smart_include" = "x"; then cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { int a = 1; ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then smart_include=" " else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 smart_include= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test "x$smart_include" = "x"; then if test "x$LOCATE" != "x"; then DIRS= file=membership.h for x in `${LOCATE} $file 2>/dev/null`; do base=`echo $x | sed "s%/${file}%%"` if test "x$x" = "x$base"; then continue; fi dir=`${DIRNAME} $x 2>/dev/null` exclude=`echo ${dir} | ${GREP} /home` if test "x$exclude" != "x"; then continue fi already=`echo \$smart_include_dir ${DIRS} | ${GREP} ${dir}` if test "x$already" = "x"; then DIRS="$DIRS $dir" fi done fi eval "smart_include_dir=\"\$smart_include_dir $DIRS\"" for try in $smart_include_dir /usr/local/include /opt/include; do CFLAGS="$old_CFLAGS -I$try" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { int a = 1; ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then smart_include="-I$try" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 smart_include= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test "x$smart_include" != "x"; then break; fi done CFLAGS="$old_CFLAGS" fi if test "x$smart_include" != "x"; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } eval "ac_cv_header_$ac_safe=yes" CFLAGS="$old_CFLAGS $smart_include" SMART_CFLAGS="$SMART_CFLAGS $smart_include" else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "$ac_cv_header_membership_h" != "yes"; then fail="$fail membership.h" fi targetname=rlm_opendirectory else targetname= echo \*\*\* module rlm_opendirectory is disabled. fi if test x"$fail" != x""; then if test x"${enable_strict_dependencies}" = x"yes"; then { { echo "$as_me:$LINENO: error: set --without-rlm_opendirectory to disable it explicitly." >&5 echo "$as_me: error: set --without-rlm_opendirectory to disable it explicitly." >&2;} { (exit 1); exit 1; }; } else { echo "$as_me:$LINENO: WARNING: silently not building rlm_opendirectory." >&5 echo "$as_me: WARNING: silently not building rlm_opendirectory." >&2;} { echo "$as_me:$LINENO: WARNING: FAILURE: rlm_opendirectory requires: $fail." >&5 echo "$as_me: WARNING: FAILURE: rlm_opendirectory requires: $fail." >&2;}; targetname="" fi fi unset ac_cv_env_LIBS_set unset ac_cv_env_LIBS_value ac_config_files="$ac_config_files 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_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( *) $as_unset $ac_var ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then test "x$cache_file" != "x/dev/null" && { echo "$as_me:$LINENO: updating cache $cache_file" >&5 echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 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}' # Transform confdefs.h into DEFS. # Protect against shell expansion while executing Makefile rules. # Protect against Makefile macro expansion. # # If the first sed substitution is executed (which looks for macros that # take arguments), then branch to the quote section. Otherwise, # look for a macro that doesn't take arguments. ac_script=' t clear :clear s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g t quote s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g t quote b any :quote s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g s/\[/\\&/g s/\]/\\&/g s/\$/$$/g H :any ${ g s/^\n// s/\n/ /g p } ' DEFS=`sed -n "$ac_script" confdefs.h` ac_libobjs= ac_ltlibobjs= 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=`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. ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs : ${CONFIG_STATUS=./config.status} ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >$CONFIG_STATUS <<_ACEOF #! $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} _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ## --------------------- ## ## 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=: # 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 # PATH needs CR # 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 # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false 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.) as_nl=' ' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. 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 # Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # CDPATH. $as_unset CDPATH as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, and appends # trailing '-' during substitution so that $LINENO is not a special # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # scripts with optimization help from Paolo Bonzini. 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" || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi 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 fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi 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=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 # Save the log message, to keep $[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by $as_me, which was generated by GNU Autoconf 2.61. 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 cat >>$CONFIG_STATUS <<_ACEOF # Files that config.status was made for. config_files="$ac_config_files" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit -q, --quiet 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 Configuration files: $config_files Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ config.status configured by $0, generated by GNU Autoconf 2.61, with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" Copyright (C) 2006 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' _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # If no file are specified by the user, then we need to provide default # value. By we need to know if files were specified by the user. 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=$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 ) echo "$ac_cs_version"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift CONFIG_FILES="$CONFIG_FILES $ac_optarg" ac_need_defaults=false;; --he | --h | --help | --hel | -h ) 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. -*) { echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *) ac_config_targets="$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 if \$ac_cs_recheck; then echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 CONFIG_SHELL=$SHELL export CONFIG_SHELL exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; 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 fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= trap 'exit_status=$? { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status ' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || { echo "$me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } # # Set up the sed scripts for CONFIG_FILES section. # # No need to generate the scripts if there are no CONFIG_FILES. # This happens for instance when ./config.status config.h if test -n "$CONFIG_FILES"; then _ACEOF ac_delim='%!_!# ' for ac_last_try in false false false false false :; do cat >conf$$subs.sed <<_ACEOF SHELL!$SHELL$ac_delim PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim PACKAGE_NAME!$PACKAGE_NAME$ac_delim PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim PACKAGE_STRING!$PACKAGE_STRING$ac_delim PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim exec_prefix!$exec_prefix$ac_delim prefix!$prefix$ac_delim program_transform_name!$program_transform_name$ac_delim bindir!$bindir$ac_delim sbindir!$sbindir$ac_delim libexecdir!$libexecdir$ac_delim datarootdir!$datarootdir$ac_delim datadir!$datadir$ac_delim sysconfdir!$sysconfdir$ac_delim sharedstatedir!$sharedstatedir$ac_delim localstatedir!$localstatedir$ac_delim includedir!$includedir$ac_delim oldincludedir!$oldincludedir$ac_delim docdir!$docdir$ac_delim infodir!$infodir$ac_delim htmldir!$htmldir$ac_delim dvidir!$dvidir$ac_delim pdfdir!$pdfdir$ac_delim psdir!$psdir$ac_delim libdir!$libdir$ac_delim localedir!$localedir$ac_delim mandir!$mandir$ac_delim DEFS!$DEFS$ac_delim ECHO_C!$ECHO_C$ac_delim ECHO_N!$ECHO_N$ac_delim ECHO_T!$ECHO_T$ac_delim LIBS!$LIBS$ac_delim build_alias!$build_alias$ac_delim host_alias!$host_alias$ac_delim target_alias!$target_alias$ac_delim CC!$CC$ac_delim CFLAGS!$CFLAGS$ac_delim LDFLAGS!$LDFLAGS$ac_delim CPPFLAGS!$CPPFLAGS$ac_delim ac_ct_CC!$ac_ct_CC$ac_delim EXEEXT!$EXEEXT$ac_delim OBJEXT!$OBJEXT$ac_delim CPP!$CPP$ac_delim od_ldflags!$od_ldflags$ac_delim od_cflags!$od_cflags$ac_delim targetname!$targetname$ac_delim LIBOBJS!$LIBOBJS$ac_delim LTLIBOBJS!$LTLIBOBJS$ac_delim _ACEOF if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 50; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` if test -n "$ac_eof"; then ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` ac_eof=`expr $ac_eof + 1` fi cat >>$CONFIG_STATUS <<_ACEOF cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof /@[a-zA-Z_][a-zA-Z_0-9]*@/!b end _ACEOF sed ' s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g s/^/s,@/; s/!/@,|#_!!_#|/ :n t n s/'"$ac_delim"'$/,g/; t s/$/\\/; p N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n ' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF :end s/|#_!!_#|//g CEOF$ac_eof _ACEOF # VPATH may cause trouble with some makes, so we remove $(srcdir), # ${srcdir} and @srcdir@ 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[ ]*=/{ s/:*\$(srcdir):*/:/ s/:*\${srcdir}:*/:/ s/:*@srcdir@:*/:/ s/^\([^=]*=[ ]*\):*/\1/ s/:*$// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF fi # test -n "$CONFIG_FILES" for ac_tag in :F $CONFIG_FILES do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5 echo "$as_me: error: Invalid tag $ac_tag." >&2;} { (exit 1); exit 1; }; };; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 echo "$as_me: error: cannot find input file: $ac_f" >&2;} { (exit 1); exit 1; }; };; esac ac_file_inputs="$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 "`IFS=: echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure." if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { echo "$as_me:$LINENO: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} fi case $ac_tag in *:-:* | *:-) cat >"$tmp/stdin";; 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 || 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" case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`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 || 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" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 echo "$as_me: error: cannot create directory $as_dir" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`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 # _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # 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= case `sed -n '/datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p ' $ac_file_inputs` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF 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 sed "$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s&@configure_input@&$configure_input&;t t s&@top_builddir@&$ac_top_builddir_sub&;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 $ac_datarootdir_hack " $ac_file_inputs | sed -f "$tmp/subs-1.sed" >$tmp/out test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&5 echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&2;} rm -f "$tmp/stdin" case $ac_file in -) cat "$tmp/out"; rm -f "$tmp/out";; *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;; esac ;; esac done # for ac_tag { (exit 0); exit 0; } _ACEOF chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save # 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 || { (exit 1); exit 1; } fi freeradius-server/src/modules/rlm_opendirectory/configure.in000066400000000000000000000014331257552170400250340ustar00rootroot00000000000000AC_INIT(rlm_opendirectory.c) AC_REVISION($Revision$) AC_DEFUN(modname,[rlm_opendirectory]) if test x$with_[]modname != xno; then AC_PROG_CC AC_PROG_CPP od_ldflags="${od_ldflags} -framework DirectoryService" FR_SMART_CHECK_INCLUDE(membership.h) if test "$ac_cv_header_membership_h" != "yes"; then fail="$fail membership.h" fi targetname=modname else targetname= echo \*\*\* module modname is disabled. fi if test x"$fail" != x""; then if test x"${enable_strict_dependencies}" = x"yes"; then AC_MSG_ERROR([set --without-]modname[ to disable it explicitly.]) else AC_MSG_WARN([silently not building ]modname[.]) AC_MSG_WARN([FAILURE: ]modname[ requires: $fail.]); targetname="" fi fi AC_SUBST(od_ldflags) AC_SUBST(od_cflags) AC_SUBST(targetname) AC_OUTPUT(Makefile) freeradius-server/src/modules/rlm_opendirectory/rlm_opendirectory.c000066400000000000000000000334331257552170400264340ustar00rootroot00000000000000/* * rlm_opendirectory.c * authentication: Apple Open Directory authentication * authorization: enforces ACLs * * Version: $Id$ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 only, as published by * the Free Software Foundation. * * 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 version 2 * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Copyright 2007 Apple Inc. */ /* * For a typical Makefile, add linker flag like this: * LDFLAGS = -framework DirectoryService */ #include #include #include #include #include #include #include #include #include #include #include #include #if HAVE_APPLE_SPI #include #else int mbr_check_service_membership(const uuid_t user, const char *servicename, int *ismember); int mbr_check_membership_refresh(const uuid_t user, uuid_t group, int *ismember); #endif /* RADIUS service ACL constants */ #define kRadiusSACLName "com.apple.access_radius" #define kRadiusServiceName "radius" #define kAuthType "opendirectory" /* * od_check_passwd * * Returns: ds err */ static long od_check_passwd(const char *uname, const char *password) { long result = eDSAuthFailed; tDirReference dsRef = 0; tDataBuffer *tDataBuff = NULL; tDirNodeReference nodeRef = 0; long status = eDSNoErr; tContextData context = 0; unsigned long nodeCount = 0; uint32_t attrIndex = 0; tDataList *nodeName = NULL; tAttributeEntryPtr pAttrEntry = NULL; tDataList *pRecName = NULL; tDataList *pRecType = NULL; tDataList *pAttrType = NULL; unsigned long recCount = 0; tRecordEntry *pRecEntry = NULL; tAttributeListRef attrListRef = 0; char *pUserLocation = NULL; char *pUserName = NULL; tAttributeValueListRef valueRef = 0; tAttributeValueEntry *pValueEntry = NULL; tDataList *pUserNode = NULL; tDirNodeReference userNodeRef = 0; tDataBuffer *pStepBuff = NULL; tDataNode *pAuthType = NULL; tAttributeValueEntry *pRecordType = NULL; uint32_t uiCurr = 0; uint32_t uiLen = 0; uint32_t pwLen = 0; if (uname == NULL || password == NULL) return result; do { status = dsOpenDirService( &dsRef ); if ( status != eDSNoErr ) return result; tDataBuff = dsDataBufferAllocate( dsRef, 4096 ); if (tDataBuff == NULL) break; /* find user on search node */ status = dsFindDirNodes( dsRef, tDataBuff, NULL, eDSSearchNodeName, &nodeCount, &context ); if (status != eDSNoErr || nodeCount < 1) break; status = dsGetDirNodeName( dsRef, tDataBuff, 1, &nodeName ); if (status != eDSNoErr) break; status = dsOpenDirNode( dsRef, nodeName, &nodeRef ); dsDataListDeallocate( dsRef, nodeName ); free( nodeName ); nodeName = NULL; if (status != eDSNoErr) break; pRecName = dsBuildListFromStrings( dsRef, uname, NULL ); pRecType = dsBuildListFromStrings( dsRef, kDSStdRecordTypeUsers, kDSStdRecordTypeComputers, kDSStdRecordTypeMachines, NULL ); pAttrType = dsBuildListFromStrings( dsRef, kDSNAttrMetaNodeLocation, kDSNAttrRecordName, kDSNAttrRecordType, NULL ); recCount = 1; status = dsGetRecordList( nodeRef, tDataBuff, pRecName, eDSExact, pRecType, pAttrType, 0, &recCount, &context ); if ( status != eDSNoErr || recCount == 0 ) break; status = dsGetRecordEntry( nodeRef, tDataBuff, 1, &attrListRef, &pRecEntry ); if ( status != eDSNoErr ) break; for ( attrIndex = 1; (attrIndex <= pRecEntry->fRecordAttributeCount) && (status == eDSNoErr); attrIndex++ ) { status = dsGetAttributeEntry( nodeRef, tDataBuff, attrListRef, attrIndex, &valueRef, &pAttrEntry ); if ( status == eDSNoErr && pAttrEntry != NULL ) { if ( strcmp( pAttrEntry->fAttributeSignature.fBufferData, kDSNAttrMetaNodeLocation ) == 0 ) { status = dsGetAttributeValue( nodeRef, tDataBuff, 1, valueRef, &pValueEntry ); if ( status == eDSNoErr && pValueEntry != NULL ) { pUserLocation = (char *) calloc( pValueEntry->fAttributeValueData.fBufferLength + 1, sizeof(char) ); memcpy( pUserLocation, pValueEntry->fAttributeValueData.fBufferData, pValueEntry->fAttributeValueData.fBufferLength ); } } else if ( strcmp( pAttrEntry->fAttributeSignature.fBufferData, kDSNAttrRecordName ) == 0 ) { status = dsGetAttributeValue( nodeRef, tDataBuff, 1, valueRef, &pValueEntry ); if ( status == eDSNoErr && pValueEntry != NULL ) { pUserName = (char *) calloc( pValueEntry->fAttributeValueData.fBufferLength + 1, sizeof(char) ); memcpy( pUserName, pValueEntry->fAttributeValueData.fBufferData, pValueEntry->fAttributeValueData.fBufferLength ); } } else if ( strcmp( pAttrEntry->fAttributeSignature.fBufferData, kDSNAttrRecordType ) == 0 ) { status = dsGetAttributeValue( nodeRef, tDataBuff, 1, valueRef, &pValueEntry ); if ( status == eDSNoErr && pValueEntry != NULL ) { pRecordType = pValueEntry; pValueEntry = NULL; } } if ( pValueEntry != NULL ) { dsDeallocAttributeValueEntry( dsRef, pValueEntry ); pValueEntry = NULL; } if ( pAttrEntry != NULL ) { dsDeallocAttributeEntry( dsRef, pAttrEntry ); pAttrEntry = NULL; } dsCloseAttributeValueList( valueRef ); valueRef = 0; } } pUserNode = dsBuildFromPath( dsRef, pUserLocation, "/" ); status = dsOpenDirNode( dsRef, pUserNode, &userNodeRef ); dsDataListDeallocate( dsRef, pUserNode ); free( pUserNode ); pUserNode = NULL; if ( status != eDSNoErr ) break; pStepBuff = dsDataBufferAllocate( dsRef, 128 ); pAuthType = dsDataNodeAllocateString( dsRef, kDSStdAuthNodeNativeClearTextOK ); uiCurr = 0; /* User name */ uiLen = (uint32_t)strlen( pUserName ); memcpy( &(tDataBuff->fBufferData[ uiCurr ]), &uiLen, sizeof(uiLen) ); uiCurr += (uint32_t)sizeof( uiLen ); memcpy( &(tDataBuff->fBufferData[ uiCurr ]), pUserName, uiLen ); uiCurr += uiLen; /* pw */ pwLen = (uint32_t)strlen( password ); memcpy( &(tDataBuff->fBufferData[ uiCurr ]), &pwLen, sizeof(pwLen) ); uiCurr += (uint32_t)sizeof( pwLen ); memcpy( &(tDataBuff->fBufferData[ uiCurr ]), password, pwLen ); uiCurr += pwLen; tDataBuff->fBufferLength = uiCurr; result = dsDoDirNodeAuthOnRecordType( userNodeRef, pAuthType, 1, tDataBuff, pStepBuff, NULL, &pRecordType->fAttributeValueData ); } while ( 0 ); /* clean up */ if (pAuthType != NULL) { dsDataNodeDeAllocate( dsRef, pAuthType ); pAuthType = NULL; } if (pRecordType != NULL) { dsDeallocAttributeValueEntry( dsRef, pRecordType ); pRecordType = NULL; } if (tDataBuff != NULL) { bzero( tDataBuff, tDataBuff->fBufferSize ); dsDataBufferDeAllocate( dsRef, tDataBuff ); tDataBuff = NULL; } if (pStepBuff != NULL) { dsDataBufferDeAllocate( dsRef, pStepBuff ); pStepBuff = NULL; } if (pUserLocation != NULL) { free(pUserLocation); pUserLocation = NULL; } if (pRecName != NULL) { dsDataListDeallocate( dsRef, pRecName ); free( pRecName ); pRecName = NULL; } if (pRecType != NULL) { dsDataListDeallocate( dsRef, pRecType ); free( pRecType ); pRecType = NULL; } if (pAttrType != NULL) { dsDataListDeallocate( dsRef, pAttrType ); free( pAttrType ); pAttrType = NULL; } if (nodeRef != 0) { dsCloseDirNode(nodeRef); nodeRef = 0; } if (dsRef != 0) { dsCloseDirService(dsRef); dsRef = 0; } return result; } /* * Check the users password against the standard UNIX * password table. */ static int od_authenticate(UNUSED void *instance, REQUEST *request) { char *name, *passwd; int ret; long odResult = eDSAuthFailed; /* * We can only authenticate user requests which HAVE * a User-Name attribute. */ if (!request->username) { RDEBUG("ERROR: You set 'Auth-Type = OpenDirectory' for a request that does not contain a User-Name attribute!"); return RLM_MODULE_INVALID; } /* * Can't do OpenDirectory if there's no password. */ if (!request->password || (request->password->attribute != PW_PASSWORD)) { RDEBUG("ERROR: You set 'Auth-Type = OpenDirectory' for a request that does not contain a User-Password attribute!"); return RLM_MODULE_INVALID; } name = (char *)request->username->vp_strvalue; passwd = (char *)request->password->vp_strvalue; odResult = od_check_passwd(name, passwd); switch(odResult) { case eDSNoErr: ret = RLM_MODULE_OK; break; case eDSAuthUnknownUser: case eDSAuthInvalidUserName: case eDSAuthNewPasswordRequired: case eDSAuthPasswordExpired: case eDSAuthAccountDisabled: case eDSAuthAccountExpired: case eDSAuthAccountInactive: case eDSAuthInvalidLogonHours: case eDSAuthInvalidComputer: ret = RLM_MODULE_USERLOCK; break; default: ret = RLM_MODULE_REJECT; break; } if (ret != RLM_MODULE_OK) { RDEBUG("[%s]: Invalid password", name); return ret; } return RLM_MODULE_OK; } /* * member of the radius group? */ static int od_authorize(UNUSED void *instance, REQUEST *request) { char *name = NULL; struct passwd *userdata = NULL; struct group *groupdata = NULL; int ismember = 0; RADCLIENT *rad_client = NULL; uuid_t uuid; uuid_t guid_sacl; uuid_t guid_nasgroup; int err; char host_ipaddr[128] = {0}; if (!request || !request->username) { RDEBUG("OpenDirectory requires a User-Name attribute."); return RLM_MODULE_NOOP; } /* resolve SACL */ uuid_clear(guid_sacl); groupdata = getgrnam(kRadiusSACLName); if (groupdata != NULL) { err = mbr_gid_to_uuid(groupdata->gr_gid, guid_sacl); if (err != 0) { radlog(L_ERR, "rlm_opendirectory: The group \"%s\" does not have a GUID.", kRadiusSACLName); return RLM_MODULE_FAIL; } } else { RDEBUG("The SACL group \"%s\" does not exist on this system.", kRadiusSACLName); } /* resolve client access list */ uuid_clear(guid_nasgroup); rad_client = request->client; #if 0 if (rad_client->community[0] != '\0' ) { /* * The "community" can be a GUID (Globally Unique ID) or * a group name */ if (uuid_parse(rad_client->community, guid_nasgroup) != 0) { /* attempt to resolve the name */ groupdata = getgrnam(rad_client->community); if (groupdata == NULL) { radlog(L_AUTH, "rlm_opendirectory: The group \"%s\" does not exist on this system.", rad_client->community); return RLM_MODULE_FAIL; } err = mbr_gid_to_uuid(groupdata->gr_gid, guid_nasgroup); if (err != 0) { radlog(L_AUTH, "rlm_opendirectory: The group \"%s\" does not have a GUID.", rad_client->community); return RLM_MODULE_FAIL; } } } else #endif { if (rad_client == NULL) { RDEBUG("The client record could not be found for host %s.", ip_ntoh(&request->packet->src_ipaddr, host_ipaddr, sizeof(host_ipaddr))); } else { RDEBUG("The host %s does not have an access group.", ip_ntoh(&request->packet->src_ipaddr, host_ipaddr, sizeof(host_ipaddr))); } } if (uuid_is_null(guid_sacl) && uuid_is_null(guid_nasgroup)) { RDEBUG("no access control groups, all users allowed."); if (pairfind(request->config_items, PW_AUTH_TYPE) == NULL) { pairadd(&request->config_items, pairmake("Auth-Type", kAuthType, T_OP_EQ)); RDEBUG("Setting Auth-Type = %s", kAuthType); } return RLM_MODULE_OK; } /* resolve user */ uuid_clear(uuid); name = (char *)request->username->vp_strvalue; rad_assert(name != NULL); userdata = getpwnam(name); if (userdata != NULL) { err = mbr_uid_to_uuid(userdata->pw_uid, uuid); if (err != 0) uuid_clear(uuid); } if (uuid_is_null(uuid)) { radius_pairmake(request, &request->packet->vps, "Module-Failure-Message", "Could not get the user's uuid", T_OP_EQ); return RLM_MODULE_NOTFOUND; } if (!uuid_is_null(guid_sacl)) { err = mbr_check_service_membership(uuid, kRadiusServiceName, &ismember); if (err != 0) { radius_pairmake(request, &request->packet->vps, "Module-Failure-Message", "Failed to check group membership", T_OP_EQ); return RLM_MODULE_FAIL; } if (ismember == 0) { radius_pairmake(request, &request->packet->vps, "Module-Failure-Message", "User is not authorized", T_OP_EQ); return RLM_MODULE_USERLOCK; } } if (!uuid_is_null(guid_nasgroup)) { err = mbr_check_membership_refresh(uuid, guid_nasgroup, &ismember); if (err != 0) { radius_pairmake(request, &request->packet->vps, "Module-Failure-Message", "Failed to check group membership", T_OP_EQ); return RLM_MODULE_FAIL; } if (ismember == 0) { radius_pairmake(request, &request->packet->vps, "Module-Failure-Message", "User is not authorized", T_OP_EQ); return RLM_MODULE_USERLOCK; } } if (pairfind(request->config_items, PW_AUTH_TYPE) == NULL) { pairadd(&request->config_items, pairmake("Auth-Type", kAuthType, T_OP_EQ)); RDEBUG("Setting Auth-Type = %s", kAuthType); } return RLM_MODULE_OK; } /* globally exported name */ module_t rlm_opendirectory = { RLM_MODULE_INIT, "opendirectory", RLM_TYPE_THREAD_SAFE, /* type */ NULL, /* instantiation */ NULL, /* detach */ { od_authenticate, /* authentication */ od_authorize, /* authorization */ NULL, /* preaccounting */ NULL, /* accounting */ NULL, /* checksimul */ NULL, /* pre-proxy */ NULL, /* post-proxy */ NULL /* post-auth */ }, }; freeradius-server/src/modules/rlm_otp/000077500000000000000000000000001257552170400204365ustar00rootroot00000000000000freeradius-server/src/modules/rlm_otp/.gitignore000066400000000000000000000000111257552170400224160ustar00rootroot00000000000000Makefile freeradius-server/src/modules/rlm_otp/Makefile.in000066400000000000000000000024621257552170400225070ustar00rootroot00000000000000####################################################################### # # TARGET should be set by autoconf only. Don't touch it. # # The SRCS definition should list ALL source files. # # The HEADERS definition should list ALL header files # # RLM_CFLAGS defines addition C compiler flags. You usually don't # want to modify this, though. Get it from autoconf. # # The RLM_LIBS definition should list ALL required libraries. # These libraries really should be pulled from the 'config.mak' # definitions, if at all possible. These definitions are also # echoed into another file in ../lib, where they're picked up by # ../main/Makefile for building the version of the server with # statically linked modules. Get it from autoconf. # # RLM_INSTALL is the names of additional rules you need to install # some particular portion of the module. Usually, leave it blank. # ####################################################################### TARGET = @targetname@ SRCS = otp_rlm.c otp_radstate.c otp_pwe.c otp_pw_valid.c SRCS += otp_util.c otp_mppe.c HEADERS = extern.h otp_pw_valid.h otp_mppe.h RLM_CFLAGS = @otp_cflags@ RLM_LIBS = @otp_ldflags@ ## this uses the RLM_CFLAGS and RLM_LIBS and SRCS defs to make TARGET. include ../rules.mak $(LT_OBJS): $(HEADERS) $(CARDOPS_LTLIBS) freeradius-server/src/modules/rlm_otp/configure000077500000000000000000003771601257552170400223630ustar00rootroot00000000000000#! /bin/sh # From configure.in Revision. # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.61. # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, # 2002, 2003, 2004, 2005, 2006 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=: # 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 # PATH needs CR # 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 # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false 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.) as_nl=' ' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. 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 # Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # CDPATH. $as_unset CDPATH if test "x$CONFIG_SHELL" = x; then if (eval ":") 2>/dev/null; then as_have_required=yes else as_have_required=no fi if test $as_have_required = yes && (eval ": (as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=\$LINENO as_lineno_2=\$LINENO test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } ") 2> /dev/null; then : else as_candidate_shells= as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. case $as_dir in /*) for as_base in sh bash ksh sh5; do as_candidate_shells="$as_candidate_shells $as_dir/$as_base" done;; esac done IFS=$as_save_IFS for as_shell in $as_candidate_shells $SHELL; do # Try only shells that exist, to save several forks. if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { ("$as_shell") 2> /dev/null <<\_ASEOF 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 : _ASEOF }; then CONFIG_SHELL=$as_shell as_have_required=yes if { "$as_shell" 2> /dev/null <<\_ASEOF 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 : (as_func_return () { (exit $1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = "$1" ); then : else exitcode=1 echo positional parameters were not saved. fi test $exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } _ASEOF }; then break fi fi done if test "x$CONFIG_SHELL" != x; then for as_var in BASH_ENV ENV do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done export CONFIG_SHELL exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} fi if test $as_have_required = no; then echo This script requires a shell more modern than all the echo shells that I found on your system. Please install a echo modern shell, or manually run the script under such a echo shell if you do have one. { (exit 1); exit 1; } fi fi fi (eval "as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0") || { echo No shell found that supports shell functions. echo Please tell autoconf@gnu.org about your system, echo including any error possibly output before this echo message } as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, and appends # trailing '-' during substitution so that $LINENO is not a special # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # scripts with optimization help from Paolo Bonzini. 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" || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi 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 fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi 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=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, 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= SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME= PACKAGE_TARNAME= PACKAGE_VERSION= PACKAGE_STRING= PACKAGE_BUGREPORT= ac_unique_file="otp_rlm.c" # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef STDC_HEADERS # include # include #else # ifdef HAVE_STDLIB_H # include # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datarootdir datadir sysconfdir sharedstatedir localstatedir includedir oldincludedir docdir infodir htmldir dvidir pdfdir psdir libdir localedir mandir DEFS ECHO_C ECHO_N ECHO_T LIBS build_alias host_alias target_alias CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP GREP EGREP otp_cflags otp_ldflags targetname LIBOBJS LTLIBOBJS' ac_subst_files='' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CPP' # Initialize some variables set by options. ac_init_help= ac_init_version=false # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *) ac_optarg=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_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` eval enable_$ac_feature=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_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` eval enable_$ac_feature=\$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_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/[-.]/_/g'` eval with_$ac_package=\$ac_optarg ;; -without-* | --without-*) ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/[-.]/_/g'` eval with_$ac_package=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 ;; -*) { echo "$as_me: error: unrecognized option: $ac_option Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && 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'` { echo "$as_me: error: missing argument to $ac_option" >&2 { (exit 1); exit 1; }; } fi # Be sure to have absolute directory names. 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 case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; } 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 echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || { echo "$as_me: error: Working directory cannot be determined" >&2 { (exit 1); exit 1; }; } test "X$ac_ls_di" = "X$ac_pwd_ls_di" || { echo "$as_me: error: pwd does not report name of working directory" >&2 { (exit 1); exit 1; }; } # 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 -- "$0" || $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$0" : 'X\(//\)[^/]' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X"$0" | 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 .." { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2 { (exit 1); exit 1; }; } pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures this package to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF _ACEOF fi if test -n "$ac_init_help"; then cat <<\_ACEOF Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-rlm-otp-lib-dir directory for otp libs --with-rlm-otp-include-dir directory for otp includes --with-openssl-libraries=DIR directory to look for OpenSSL library files --with-openssl-includes=DIR directory to look for OpenSSL include files 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 C/C++/Objective C preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. _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" || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`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 echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF configure generated by GNU Autoconf 2.61 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 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 cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by $as_me, which was generated by GNU Autoconf 2.61. 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=. 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=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; 2) ac_configure_args1="$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 ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac done done $as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } $as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export 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 cat <<\_ASBOX ## ---------------- ## ## Cache variables. ## ## ---------------- ## _ASBOX 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_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( *) $as_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 cat <<\_ASBOX ## ----------------- ## ## Output variables. ## ## ----------------- ## _ASBOX echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then cat <<\_ASBOX ## ------------------- ## ## File substitutions. ## ## ------------------- ## _ASBOX echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then cat <<\_ASBOX ## ----------- ## ## confdefs.h. ## ## ----------- ## _ASBOX echo cat confdefs.h echo fi test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" 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'; { (exit 1); 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 # 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 # Let the site file select an alternate cache file if it wants to. # Prefer explicitly selected file to automatically selected ones. if test -n "$CONFIG_SITE"; then set x "$CONFIG_SITE" elif test "x$prefix" != xNONE; then set x "$prefix/share/config.site" "$prefix/etc/config.site" else set x "$ac_default_prefix/share/config.site" \ "$ac_default_prefix/etc/config.site" fi shift for ac_site_file do if test -r "$ac_site_file"; then { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" 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. if test -f "$cache_file"; then { echo "$as_me:$LINENO: loading cache $cache_file" >&5 echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { echo "$as_me:$LINENO: creating cache $cache_file" >&5 echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 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 { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 echo "$as_me: former value: $ac_old_val" >&2;} { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 echo "$as_me: current value: $ac_new_val" >&2;} ac_cache_corrupted=: fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`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. *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 echo "$as_me: error: changes in the environment can compromise the build" >&2;} { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} { (exit 1); exit 1; }; } 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 otp_cflags= otp_ldflags= if test x$with_rlm_otp != xno; then 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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}gcc" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="gcc" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}cc" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="$ac_prog" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&5 echo "$as_me: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } # Provide some information about the compiler. echo "$as_me:$LINENO: checking for C compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (ac_try="$ac_compiler --version >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -v >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -V >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out 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. { echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6; } ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # # List of possible output files, starting from the most likely. # The algorithm is not robust to junk in `.', hence go to wildcards (a.*) # only as a last resort. b.out is created by i960 compilers. ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out' # # The IRIX 6 linker writes into existing files which may not be # executable, retaining their permissions. Remove them first so a # subsequent execution test works. ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link_default") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; 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 | *.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 { echo "$as_me:$LINENO: result: $ac_file" >&5 echo "${ECHO_T}$ac_file" >&6; } if test -z "$ac_file"; then echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: C compiler cannot create executables See \`config.log' for more details." >&5 echo "$as_me: error: C compiler cannot create executables See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } fi ac_exeext=$ac_cv_exeext # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { echo "$as_me:$LINENO: checking whether the C compiler works" >&5 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6; } # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then if { ac_try='./$ac_file' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { echo "$as_me:$LINENO: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&5 echo "$as_me: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi fi fi { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } rm -f a.out a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; } { echo "$as_me:$LINENO: result: $cross_compiling" >&5 echo "${ECHO_T}$cross_compiling" >&6; } { echo "$as_me:$LINENO: checking for suffix of executables" >&5 echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; } if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; 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 | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest$ac_cv_exeext { echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 echo "${ECHO_T}$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT { echo "$as_me:$LINENO: checking for suffix of object files" >&5 echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; } if test "${ac_cv_objext+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; 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 ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 echo "${ECHO_T}$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; } if test "${ac_cv_c_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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 { echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; } GCC=`test $ac_compiler_gnu = yes && echo yes` ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CFLAGS="" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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 { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 echo "${ECHO_T}$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 { echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_c89+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_c89=$ac_arg else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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) { echo "$as_me:$LINENO: result: none needed" >&5 echo "${ECHO_T}none needed" >&6; } ;; xno) { echo "$as_me:$LINENO: result: unsupported" >&5 echo "${ECHO_T}unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;; 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 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 { echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if test "${ac_cv_prog_CPP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f 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 { echo "$as_me:$LINENO: result: $CPP" >&5 echo "${ECHO_T}$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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&5 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } 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 { echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5 echo $ECHO_N "checking for grep that handles long lines and -e... $ECHO_C" >&6; } if test "${ac_cv_path_GREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Extract the first word of "grep ggrep" to use in msg output if test -z "$GREP"; then set dummy grep ggrep; ac_prog_name=$2 if test "${ac_cv_path_GREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" 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 ac_count=`expr $ac_count + 1` 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 fi GREP="$ac_cv_path_GREP" if test -z "$GREP"; then { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} { (exit 1); exit 1; }; } fi else ac_cv_path_GREP=$GREP fi fi { echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5 echo "${ECHO_T}$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { echo "$as_me:$LINENO: checking for egrep" >&5 echo $ECHO_N "checking for egrep... $ECHO_C" >&6; } if test "${ac_cv_path_EGREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else # Extract the first word of "egrep" to use in msg output if test -z "$EGREP"; then set dummy egrep; ac_prog_name=$2 if test "${ac_cv_path_EGREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" 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 ac_count=`expr $ac_count + 1` 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 fi EGREP="$ac_cv_path_EGREP" if test -z "$EGREP"; then { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} { (exit 1); exit 1; }; } fi else ac_cv_path_EGREP=$EGREP fi fi fi { echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 echo "${ECHO_T}$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" { echo "$as_me:$LINENO: checking for ANSI C header files" >&5 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; } if test "${ac_cv_header_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_header_stdc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* 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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* 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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* 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 rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi { echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 echo "${ECHO_T}$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then cat >>confdefs.h <<\_ACEOF #define STDC_HEADERS 1 _ACEOF 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=`echo "ac_cv_header_$ac_header" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Header=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done if test "${ac_cv_header_inttypes_h+set}" = set; then { echo "$as_me:$LINENO: checking for inttypes.h" >&5 echo $ECHO_N "checking for inttypes.h... $ECHO_C" >&6; } if test "${ac_cv_header_inttypes_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi { echo "$as_me:$LINENO: result: $ac_cv_header_inttypes_h" >&5 echo "${ECHO_T}$ac_cv_header_inttypes_h" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking inttypes.h usability" >&5 echo $ECHO_N "checking inttypes.h usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? { echo "$as_me:$LINENO: checking inttypes.h presence" >&5 echo $ECHO_N "checking inttypes.h presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: inttypes.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: inttypes.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: inttypes.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: inttypes.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: inttypes.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: inttypes.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: inttypes.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: inttypes.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: inttypes.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: inttypes.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: inttypes.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: inttypes.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: inttypes.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: inttypes.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: inttypes.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: inttypes.h: in the future, the compiler will take precedence" >&2;} ;; esac { echo "$as_me:$LINENO: checking for inttypes.h" >&5 echo $ECHO_N "checking for inttypes.h... $ECHO_C" >&6; } if test "${ac_cv_header_inttypes_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_inttypes_h=$ac_header_preproc fi { echo "$as_me:$LINENO: result: $ac_cv_header_inttypes_h" >&5 echo "${ECHO_T}$ac_cv_header_inttypes_h" >&6; } fi if test $ac_cv_header_inttypes_h = yes; then : else fail="$fail inttypes.h" fi # Check whether --with-rlm-otp-lib-dir was given. if test "${with_rlm_otp_lib_dir+set}" = set; then withval=$with_rlm_otp_lib_dir; otp_ldflags="-L$withval $otp_ldflags" fi # Check whether --with-rlm-otp-include-dir was given. if test "${with_rlm_otp_include_dir+set}" = set; then withval=$with_rlm_otp_include_dir; otp_cflags="$otp_cflags -I$withval" fi # Check whether --with-openssl-libraries was given. if test "${with_openssl_libraries+set}" = set; then withval=$with_openssl_libraries; otp_ldflags="-L$withval $otp_ldflags" fi # Check whether --with-openssl-includes was given. if test "${with_openssl_includes+set}" = set; then withval=$with_openssl_includes; otp_cflags="$otp_cflags -I$withval" fi old_LDFLAGS="$LDFLAGS" LDFLAGS="$otp_ldflags $LDFLAGS" { echo "$as_me:$LINENO: checking for SSL_new in -lssl" >&5 echo $ECHO_N "checking for SSL_new in -lssl... $ECHO_C" >&6; } if test "${ac_cv_lib_ssl_SSL_new+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lssl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any 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_new (); int main () { return SSL_new (); ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_ssl_SSL_new=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_ssl_SSL_new=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_ssl_SSL_new" >&5 echo "${ECHO_T}$ac_cv_lib_ssl_SSL_new" >&6; } if test $ac_cv_lib_ssl_SSL_new = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBSSL 1 _ACEOF LIBS="-lssl $LIBS" else fail="$fail openssl-libs" fi LDFLAGS="$old_LDFLAGS" old_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $otp_cflags" for ac_header in \ openssl/des.h \ openssl/hmac.h \ openssl/md4.h \ openssl/md5.h \ openssl/sha.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? { echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ;; esac { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF else fail="$fail openssl-includes" fi done CFLAGS="$old_CFLAGS" targetname=rlm_otp # keep this! Don't change! else targetname= # keep this! Don't change! echo \*\*\* module rlm_otp is disabled. # keep this! Don't change! fi if test x"$fail" != x""; then if test x"${enable_strict_dependencies}" = x"yes"; then { { echo "$as_me:$LINENO: error: set --without-rlm_otp to disable it explicitly." >&5 echo "$as_me: error: set --without-rlm_otp to disable it explicitly." >&2;} { (exit 1); exit 1; }; } else { echo "$as_me:$LINENO: WARNING: silently not building rlm_otp." >&5 echo "$as_me: WARNING: silently not building rlm_otp." >&2;} { echo "$as_me:$LINENO: WARNING: FAILURE: rlm_otp requires: $fail." >&5 echo "$as_me: WARNING: FAILURE: rlm_otp requires: $fail." >&2;} targetname="" fi fi # keep this! Don't change! unset ac_cv_env_LIBS_set unset ac_cv_env_LIBS_value ac_config_files="$ac_config_files 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_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( *) $as_unset $ac_var ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then test "x$cache_file" != "x/dev/null" && { echo "$as_me:$LINENO: updating cache $cache_file" >&5 echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 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}' # Transform confdefs.h into DEFS. # Protect against shell expansion while executing Makefile rules. # Protect against Makefile macro expansion. # # If the first sed substitution is executed (which looks for macros that # take arguments), then branch to the quote section. Otherwise, # look for a macro that doesn't take arguments. ac_script=' t clear :clear s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g t quote s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g t quote b any :quote s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g s/\[/\\&/g s/\]/\\&/g s/\$/$$/g H :any ${ g s/^\n// s/\n/ /g p } ' DEFS=`sed -n "$ac_script" confdefs.h` ac_libobjs= ac_ltlibobjs= 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=`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. ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs : ${CONFIG_STATUS=./config.status} ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >$CONFIG_STATUS <<_ACEOF #! $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} _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ## --------------------- ## ## 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=: # 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 # PATH needs CR # 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 # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false 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.) as_nl=' ' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. 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 # Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # CDPATH. $as_unset CDPATH as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, and appends # trailing '-' during substitution so that $LINENO is not a special # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # scripts with optimization help from Paolo Bonzini. 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" || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi 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 fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi 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=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 # Save the log message, to keep $[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by $as_me, which was generated by GNU Autoconf 2.61. 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 cat >>$CONFIG_STATUS <<_ACEOF # Files that config.status was made for. config_files="$ac_config_files" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit -q, --quiet 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 Configuration files: $config_files Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ config.status configured by $0, generated by GNU Autoconf 2.61, with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" Copyright (C) 2006 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' _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # If no file are specified by the user, then we need to provide default # value. By we need to know if files were specified by the user. 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=$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 ) echo "$ac_cs_version"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift CONFIG_FILES="$CONFIG_FILES $ac_optarg" ac_need_defaults=false;; --he | --h | --help | --hel | -h ) 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. -*) { echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *) ac_config_targets="$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 if \$ac_cs_recheck; then echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 CONFIG_SHELL=$SHELL export CONFIG_SHELL exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; 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 fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= trap 'exit_status=$? { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status ' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || { echo "$me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } # # Set up the sed scripts for CONFIG_FILES section. # # No need to generate the scripts if there are no CONFIG_FILES. # This happens for instance when ./config.status config.h if test -n "$CONFIG_FILES"; then _ACEOF ac_delim='%!_!# ' for ac_last_try in false false false false false :; do cat >conf$$subs.sed <<_ACEOF SHELL!$SHELL$ac_delim PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim PACKAGE_NAME!$PACKAGE_NAME$ac_delim PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim PACKAGE_STRING!$PACKAGE_STRING$ac_delim PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim exec_prefix!$exec_prefix$ac_delim prefix!$prefix$ac_delim program_transform_name!$program_transform_name$ac_delim bindir!$bindir$ac_delim sbindir!$sbindir$ac_delim libexecdir!$libexecdir$ac_delim datarootdir!$datarootdir$ac_delim datadir!$datadir$ac_delim sysconfdir!$sysconfdir$ac_delim sharedstatedir!$sharedstatedir$ac_delim localstatedir!$localstatedir$ac_delim includedir!$includedir$ac_delim oldincludedir!$oldincludedir$ac_delim docdir!$docdir$ac_delim infodir!$infodir$ac_delim htmldir!$htmldir$ac_delim dvidir!$dvidir$ac_delim pdfdir!$pdfdir$ac_delim psdir!$psdir$ac_delim libdir!$libdir$ac_delim localedir!$localedir$ac_delim mandir!$mandir$ac_delim DEFS!$DEFS$ac_delim ECHO_C!$ECHO_C$ac_delim ECHO_N!$ECHO_N$ac_delim ECHO_T!$ECHO_T$ac_delim LIBS!$LIBS$ac_delim build_alias!$build_alias$ac_delim host_alias!$host_alias$ac_delim target_alias!$target_alias$ac_delim CC!$CC$ac_delim CFLAGS!$CFLAGS$ac_delim LDFLAGS!$LDFLAGS$ac_delim CPPFLAGS!$CPPFLAGS$ac_delim ac_ct_CC!$ac_ct_CC$ac_delim EXEEXT!$EXEEXT$ac_delim OBJEXT!$OBJEXT$ac_delim CPP!$CPP$ac_delim GREP!$GREP$ac_delim EGREP!$EGREP$ac_delim otp_cflags!$otp_cflags$ac_delim otp_ldflags!$otp_ldflags$ac_delim targetname!$targetname$ac_delim LIBOBJS!$LIBOBJS$ac_delim LTLIBOBJS!$LTLIBOBJS$ac_delim _ACEOF if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 52; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` if test -n "$ac_eof"; then ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` ac_eof=`expr $ac_eof + 1` fi cat >>$CONFIG_STATUS <<_ACEOF cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof /@[a-zA-Z_][a-zA-Z_0-9]*@/!b end _ACEOF sed ' s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g s/^/s,@/; s/!/@,|#_!!_#|/ :n t n s/'"$ac_delim"'$/,g/; t s/$/\\/; p N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n ' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF :end s/|#_!!_#|//g CEOF$ac_eof _ACEOF # VPATH may cause trouble with some makes, so we remove $(srcdir), # ${srcdir} and @srcdir@ 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[ ]*=/{ s/:*\$(srcdir):*/:/ s/:*\${srcdir}:*/:/ s/:*@srcdir@:*/:/ s/^\([^=]*=[ ]*\):*/\1/ s/:*$// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF fi # test -n "$CONFIG_FILES" for ac_tag in :F $CONFIG_FILES do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5 echo "$as_me: error: Invalid tag $ac_tag." >&2;} { (exit 1); exit 1; }; };; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 echo "$as_me: error: cannot find input file: $ac_f" >&2;} { (exit 1); exit 1; }; };; esac ac_file_inputs="$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 "`IFS=: echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure." if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { echo "$as_me:$LINENO: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} fi case $ac_tag in *:-:* | *:-) cat >"$tmp/stdin";; 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 || 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" case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`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 || 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" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 echo "$as_me: error: cannot create directory $as_dir" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`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 # _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # 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= case `sed -n '/datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p ' $ac_file_inputs` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF 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 sed "$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s&@configure_input@&$configure_input&;t t s&@top_builddir@&$ac_top_builddir_sub&;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 $ac_datarootdir_hack " $ac_file_inputs | sed -f "$tmp/subs-1.sed" >$tmp/out test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&5 echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&2;} rm -f "$tmp/stdin" case $ac_file in -) cat "$tmp/out"; rm -f "$tmp/out";; *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;; esac ;; esac done # for ac_tag { (exit 0); exit 0; } _ACEOF chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save # 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 || { (exit 1); exit 1; } fi # keep this! Don't change! freeradius-server/src/modules/rlm_otp/configure.in000066400000000000000000000050431257552170400227510ustar00rootroot00000000000000AC_PREREQ([2.53]) AC_INIT(otp_rlm.c) AC_REVISION($Revision$) AC_DEFUN(modname,[rlm_otp]) otp_cflags= otp_ldflags= if test x$with_[]modname != xno; then dnl put configuration checks here. dnl set $fail to what's missing, on fatal errors. dnl use AC_MSG_WARN() on important messages. dnl test for almost-c99 compliant compiler AC_CHECK_HEADER(inttypes.h, , [ fail="$fail inttypes.h" ] ) dnl ############################################################ dnl # Check for command line options dnl ############################################################ dnl mostly for openssl AC_ARG_WITH(rlm-otp-lib-dir, [ --with-rlm-otp-lib-dir directory for otp libs], otp_ldflags="-L$withval $otp_ldflags") AC_ARG_WITH(rlm-otp-include-dir, [ --with-rlm-otp-include-dir directory for otp includes], otp_cflags="$otp_cflags -I$withval") dnl extra argument: --openssl-libraries=dir AC_ARG_WITH(openssl-libraries, [ --with-openssl-libraries=DIR directory to look for OpenSSL library files], otp_ldflags="-L$withval $otp_ldflags") dnl extra argument: --openssl-includes=dir AC_ARG_WITH(openssl-includes, [ --with-openssl-includes=DIR directory to look for OpenSSL include files], otp_cflags="$otp_cflags -I$withval") dnl ############################################################ dnl # Check for libraries dnl ############################################################ old_LDFLAGS="$LDFLAGS" LDFLAGS="$otp_ldflags $LDFLAGS" AC_CHECK_LIB(ssl, SSL_new, [], [ fail="$fail openssl-libs" ]) LDFLAGS="$old_LDFLAGS" dnl ############################################################ dnl # Check for header files dnl ############################################################ old_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $otp_cflags" AC_CHECK_HEADERS( \ openssl/des.h \ openssl/hmac.h \ openssl/md4.h \ openssl/md5.h \ openssl/sha.h, [], [ fail="$fail openssl-includes" ] ) CFLAGS="$old_CFLAGS" targetname=modname # keep this! Don't change! else targetname= # keep this! Don't change! echo \*\*\* module modname is disabled. # keep this! Don't change! fi dnl Don't change this section. if test x"$fail" != x""; then if test x"${enable_strict_dependencies}" = x"yes"; then AC_MSG_ERROR([set --without-]modname[ to disable it explicitly.]) else AC_MSG_WARN([silently not building ]modname[.]) AC_MSG_WARN([FAILURE: ]modname[ requires: $fail.]) targetname="" fi fi AC_SUBST(otp_cflags) AC_SUBST(otp_ldflags) AC_SUBST(targetname) # keep this! Don't change! AC_OUTPUT(Makefile) # keep this! Don't change! freeradius-server/src/modules/rlm_otp/extern.h000066400000000000000000000075321257552170400221230ustar00rootroot00000000000000/* * $Id$ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2001,2002 Google, Inc. * Copyright 2005,2006 TRI-D Systems, Inc. */ #ifndef EXTERN_H #define EXTERN_H #include RCSIDH(extern_h, "$Id$") #include #include #include #include #include #include "otp.h" /* OTP_MAX_CHALLENGE_LEN, otp_pwe_t */ /* otpd rendezvous point */ #define OTP_OTPD_RP "/var/run/otpd/socket" /* Default prompt for presentation of challenge */ #define OTP_CHALLENGE_PROMPT "Challenge: %s\n Response: " /* * You shouldn't change anything past this point */ /* struct used for instance/option data */ typedef struct otp_option_t { const char *name; /* instance name for otp_token_authorize() */ char *otpd_rp; /* otpd rendezvous point */ char *chal_prompt; /* text to present challenge to user, must have %s */ int challenge_len; /* challenge length, min 5 digits */ int challenge_delay; /* max delay time for response, in seconds */ int allow_sync; /* useful to override pwdfile card_type settings */ int allow_async; /* C/R mode allowed? */ int mschapv2_mppe_policy; /* whether or not do to mppe for mschapv2 */ int mschapv2_mppe_types; /* key type/length for mschapv2/mppe */ int mschap_mppe_policy; /* whether or not do to mppe for mschap */ int mschap_mppe_types; /* key type/length for mschap/mppe */ } otp_option_t; /* otp_mppe.c */ void otp_mppe(REQUEST *, otp_pwe_t, const otp_option_t *, const char *); /* otp_pw_valid.c */ extern int otp_pw_valid(REQUEST *, int, const char *, const otp_option_t *, char []); /* otp_radstate.c */ #define OTP_MAX_RADSTATE_LEN 2 + (OTP_MAX_CHALLENGE_LEN * 2 + 8 + 8 + 32)*2 + 1 extern int otp_gen_state(char [OTP_MAX_RADSTATE_LEN], unsigned char [OTP_MAX_RADSTATE_LEN], const unsigned char [OTP_MAX_CHALLENGE_LEN], size_t, int32_t, int32_t, const unsigned char [16]); /* otp_pwe.c */ extern int pwattr[8]; extern void otp_pwe_init(void); extern otp_pwe_t otp_pwe_present(const REQUEST *); /* otp_util.c */ extern void otp_get_random(char *, size_t); extern void otp_async_challenge(char [OTP_MAX_CHALLENGE_LEN + 1], int); extern int otp_a2x(const char *, unsigned char *); extern void otp_x2a(const unsigned char *, size_t, char *); extern void _otp_pthread_mutex_init(pthread_mutex_t *, const pthread_mutexattr_t *, const char *); extern void _otp_pthread_mutex_lock(pthread_mutex_t *, const char *); extern int _otp_pthread_mutex_trylock(pthread_mutex_t *, const char *); extern void _otp_pthread_mutex_unlock(pthread_mutex_t *, const char *); #define otp_pthread_mutex_init(a, b) _otp_pthread_mutex_init((a), (b), __func__) #define otp_pthread_mutex_lock(a) _otp_pthread_mutex_lock((a), __func__) #define otp_pthread_mutex_trylock(a) _otp_pthread_mutex_trylock((a), __func__) #define otp_pthread_mutex_unlock(a) _otp_pthread_mutex_unlock((a), __func__) #endif /* EXTERN_H */ freeradius-server/src/modules/rlm_otp/otp.h000066400000000000000000000051221257552170400214110ustar00rootroot00000000000000/* * $Id$ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * For alternative licensing terms, contact licensing@tri-dsystems.com. * * Copyright 2005-2007 TRI-D Systems, Inc. */ #ifndef OTP_H #define OTP_H #include RCSIDH(otp_h, "$Id$") #include /* * NOTE: This file must be synced between plugins/otpd/lsmd/gsmd/changepin. */ #ifndef OTP_MAX_CHALLENGE_LEN #define OTP_MAX_CHALLENGE_LEN 16 #elif OTP_MAX_CHALLENGE_LEN != 16 #error OTP_MAX_CHALLENGE_LEN #endif #define OTP_RC_OK 0 #define OTP_RC_USER_UNKNOWN 1 #define OTP_RC_AUTHINFO_UNAVAIL 2 #define OTP_RC_AUTH_ERR 3 #define OTP_RC_MAXTRIES 4 #define OTP_RC_SERVICE_ERR 5 #define OTP_RC_NEXTPASSCODE 6 #define OTP_RC_IPIN 7 #define OTP_MAX_USERNAME_LEN 31 /* only needs to be MAX_PIN_LEN (16) + MAX_RESPONSE_LEN (16) */ #define OTP_MAX_PASSCODE_LEN 47 #define OTP_MAX_CHAP_CHALLENGE_LEN 16 #define OTP_MAX_CHAP_RESPONSE_LEN 50 typedef enum otp_pwe_t { PWE_PAP = 1, PWE_CHAP = 3, PWE_MSCHAP = 5, PWE_MSCHAP2 = 7, } otp_pwe_t; typedef struct otp_request_t { int version; /* 2 */ char username[OTP_MAX_USERNAME_LEN + 1]; char challenge[OTP_MAX_CHALLENGE_LEN + 1]; /* USER challenge */ struct { otp_pwe_t pwe; union { struct { char passcode[OTP_MAX_PASSCODE_LEN + 1]; } pap; struct { unsigned char challenge[OTP_MAX_CHAP_CHALLENGE_LEN]; /* CHAP chal */ size_t clen; unsigned char response[OTP_MAX_CHAP_RESPONSE_LEN]; size_t rlen; } chap; } u; } pwe; int allow_async; /* async auth allowed? */ int allow_sync; /* sync auth allowed? */ unsigned challenge_delay; /* min delay between async auths */ int resync; /* resync on async auth? */ } otp_request_t; typedef struct otp_reply_t { int version; /* 1 */ int rc; char passcode[OTP_MAX_PASSCODE_LEN + 1]; } otp_reply_t; #endif /* OTP_H */ freeradius-server/src/modules/rlm_otp/otp_mppe.c000066400000000000000000000446621257552170400224410ustar00rootroot00000000000000/* * $Id$ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2001,2002 Google, Inc. * Copyright 2005,2006 TRI-D Systems, Inc. */ #include RCSID("$Id$") /* avoid inclusion of these FR headers which conflict w/ OpenSSL */ #define _FR_MD4_H #define _FR_SHA1_H #include #include "extern.h" #include "otp.h" #include "otp_mppe.h" #include #include #include #include #include /* * Add MPPE attributes to a request, if required. */ void otp_mppe(REQUEST *request, otp_pwe_t pwe, const otp_option_t *opt, const char *passcode) { VALUE_PAIR **avp = &request->reply->vps; VALUE_PAIR *cvp, *rvp, *vp; cvp = pairfind(request->packet->vps, pwattr[pwe - 1]); rvp = pairfind(request->packet->vps, pwattr[pwe]); switch (pwe) { case PWE_PAP: case PWE_CHAP: return; case PWE_MSCHAP: /* First, set some related attributes. */ vp = pairmake("MS-MPPE-Encryption-Policy", otp_mppe_policy[opt->mschap_mppe_policy], T_OP_EQ); rad_assert(vp != NULL); pairadd(avp, vp); vp = pairmake("MS-MPPE-Encryption-Types", otp_mppe_types[opt->mschap_mppe_types], T_OP_EQ); rad_assert(vp != NULL); pairadd(avp, vp); /* If no MPPE, we're done. */ if (!opt->mschap_mppe_policy) return; /* * Generate the MS-CHAP-MPPE-Keys attribute. This is not specified * anywhere -- RFC 2548, par. 2.4.1 is the authority but it has * typos and omissions that make this unimplementable. The * code here is based on experimental results provided by * Takahiro Wagatsuma . * We only support 128-bit keys derived from the NT hash; 40-bit * and 56-bit keys are derived from the LM hash, which besides * being deprecated, has severe security problems. */ { size_t i, passcode_len; unsigned char password_unicode[2 * OTP_MAX_PASSCODE_LEN]; unsigned char password_md[MD4_DIGEST_LENGTH]; unsigned char mppe_keys[32]; /* 0x ASCII(mppe_keys) '\0' */ char mppe_keys_string[2 + (2 * sizeof(mppe_keys)) + 1]; /* Zero the LM-Key sub-field (and padding). */ (void) memset(mppe_keys, 0, sizeof(mppe_keys)); /* * The NT-Key sub-field is MD4(MD4(unicode(password))). * Start by hashing the unicode passcode. * This is broken because unicode chars are machine-ordered, * but the spec (RFC 2433) doesn't say how to prepare * the password for md4 (other than by example values). */ passcode_len = strlen(passcode); for (i = 0; i < passcode_len; ++i) { /* Set the high order 8 bits to 0 (little-endian) */ password_unicode[i * 2] = *passcode++; password_unicode[i * 2 + 1] = 0; } /* first md4 */ (void) MD4(password_unicode, 2 * passcode_len, password_md); /* second md4 */ (void) MD4(password_md, MD4_DIGEST_LENGTH, &mppe_keys[8]); #if 0 /* encoding now handled in lib/radius.c:rad_pwencode() */ { unsigned char md5_md[MD5_DIGEST_LENGTH]; unsigned char encode_buf[AUTH_VECTOR_LEN + MAX_STRING_LEN]; int secretlen; /* Now we must encode the key as User-Password is encoded. */ secretlen = strlen(request->secret); (void) memcpy(encode_buf, request->secret, secretlen); (void) memcpy(encode_buf + secretlen, request->packet->vector, AUTH_VECTOR_LEN); (void) MD5(encode_buf, secretlen + AUTH_VECTOR_LEN, md5_md); for (i = 0; i < 16; ++i) mppe_keys[i] ^= md5_md[i]; (void) memcpy(encode_buf + secretlen, mppe_keys, MD5_DIGEST_LENGTH); (void) MD5(encode_buf, secretlen + MD5_DIGEST_LENGTH, md5_md); for (i = 0; i < 16; ++i) mppe_keys[i + 16] ^= md5_md[i]; } #endif /* 0 */ /* Whew. Now stringify it for pairmake(). */ mppe_keys_string[0] = '0'; mppe_keys_string[1] = 'x'; for (i = 0; i < 32; ++i) (void) sprintf(&mppe_keys_string[i*2+2], "%02X", mppe_keys[i]); vp = pairmake("MS-CHAP-MPPE-Keys", mppe_keys_string, T_OP_EQ); rad_assert(vp != NULL); pairadd(avp, vp); } /* (doing mppe) */ break; /* PWE_MSCHAP */ case PWE_MSCHAP2: { size_t i; unsigned char password_md_md[MD4_DIGEST_LENGTH]; /* * MS-CHAPv2 requires mutual authentication; we must prove * that we know the secret. This is a bit circuitous: set * MD1 = SHA(MD4(MD4(unicode(password)))|NT_RESPONSE|MAGIC1), * MD2 = MSB8(SHA(PEER_CHALLENGE|MS_CHAP_CHALLENGE|USERNAME)), * and finally use SHA(MD1|MD2|MAGIC2) as the authenticator. * The authenticator is returned as the string "S=", * is the authenticator expressed as [uppercase] ASCII. * See RFC 2759. */ { size_t passcode_len; unsigned char password_unicode[2 * OTP_MAX_PASSCODE_LEN]; unsigned char password_md[MD4_DIGEST_LENGTH]; SHA_CTX ctx; unsigned char md1[SHA_DIGEST_LENGTH]; unsigned char md2[SHA_DIGEST_LENGTH]; unsigned char auth_md[SHA_DIGEST_LENGTH]; /* S= ( ASCII(auth_md) ) \0 */ char auth_md_string[2 + (2 * sizeof(auth_md)) + 1]; /* * ugh. The ASCII authenticator (auth_md_string) is sent * along with a single (useless) binary byte (the ID). * So we must "stringify" it again (for pairmake()) since the * binary byte requires the attribute to be of type "octets". */ /* 0x (ID) ( ASCII("S="ASCII(auth_md))) */ char auth_octet_string[2 + 2 + (2 * sizeof(auth_md_string))]; char *username = request->username->vp_strvalue; int username_len = request->username->length; /* "Magic server to client signing constant" */ unsigned char magic1[39] = { 0x4D, 0x61, 0x67, 0x69, 0x63, 0x20, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x74, 0x6F, 0x20, 0x63, 0x6C, 0x69, 0x65, 0x6E, 0x74, 0x20, 0x73, 0x69, 0x67, 0x6E, 0x69, 0x6E, 0x67, 0x20, 0x63, 0x6F, 0x6E, 0x73, 0x74, 0x61, 0x6E, 0x74 }; /* "Pad to make it do more than one iteration" */ unsigned char magic2[41] = { 0x50, 0x61, 0x64, 0x20, 0x74, 0x6F, 0x20, 0x6D, 0x61, 0x6B, 0x65, 0x20, 0x69, 0x74, 0x20, 0x64, 0x6F, 0x20, 0x6D, 0x6F, 0x72, 0x65, 0x20, 0x74, 0x68, 0x61, 0x6E, 0x20, 0x6F, 0x6E, 0x65, 0x20, 0x69, 0x74, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6F, 0x6E }; /* * Start by hashing the unicode passcode. * This is broken because unicode chars are machine-ordered, * but the spec (RFC 2759) doesn't say how to prepare * the password for md4 (other than by example values). */ passcode_len = strlen(passcode); for (i = 0; i < passcode_len; ++i) { /* Set the high order 8 bits to 0 (little-endian) */ password_unicode[i * 2] = *passcode++; password_unicode[i * 2 + 1] = 0; } /* first md4 */ (void) MD4(password_unicode, 2 * passcode_len, password_md); /* second md4 */ (void) MD4(password_md, MD4_DIGEST_LENGTH, password_md_md); /* MD1 */ SHA1_Init(&ctx); SHA1_Update(&ctx, password_md_md, MD4_DIGEST_LENGTH); SHA1_Update(&ctx, rvp->vp_strvalue + 26, 24); SHA1_Update(&ctx, magic1, sizeof(magic1)); SHA1_Final(md1, &ctx); /* MD2 */ SHA1_Init(&ctx); SHA1_Update(&ctx, rvp->vp_strvalue + 2, 16); SHA1_Update(&ctx, cvp->vp_strvalue, 16); SHA1_Update(&ctx, username, username_len); SHA1_Final(md2, &ctx); /* The Authenticator */ SHA1_Init(&ctx); SHA1_Update(&ctx, md1, SHA_DIGEST_LENGTH); SHA1_Update(&ctx, md2, 8); SHA1_Update(&ctx, magic2, sizeof(magic2)); SHA1_Final(auth_md, &ctx); /* String conversion. */ auth_md_string[0] = 'S'; auth_md_string[1] = '='; for (i = 0; i < sizeof(auth_md); ++i) (void) sprintf(&auth_md_string[i * 2 + 2], "%02X", auth_md[i]); /* And then octet conversion. Ugh! */ auth_octet_string[0] = '0'; auth_octet_string[1] = 'x'; (void) sprintf(&auth_octet_string[2], "%02X", rvp->vp_strvalue[0]); for (i = 0; i < sizeof(auth_md_string) - 1; ++i) (void) sprintf(&auth_octet_string[i * 2 +4], "%02X", auth_md_string[i]); vp = pairmake("MS-CHAP2-Success", auth_octet_string, T_OP_EQ); rad_assert(vp != NULL); pairadd(avp, vp); } /* Generate mutual auth info. */ /* * Now, set some MPPE related attributes. */ vp = pairmake("MS-MPPE-Encryption-Policy", otp_mppe_policy[opt->mschapv2_mppe_policy], T_OP_EQ); rad_assert(vp != NULL); pairadd(avp, vp); vp = pairmake("MS-MPPE-Encryption-Types", otp_mppe_types[opt->mschapv2_mppe_types], T_OP_EQ); rad_assert(vp != NULL); pairadd(avp, vp); /* If no MPPE, we're done. */ if (!opt->mschapv2_mppe_policy) return; /* * Generate the MPPE initial session key, per RFC 3079. * (Although, RFC 2548 leaves us guessing at how to generate this.) * For MS-CHAPv2 we support all key lengths (40-, 56- and 128-bit), * although MPPE via RADIUS supports only 40- and 128-bit keys. * This is a bit more complicated than MS-CHAP. Start by generating * a "master session key" * MSB16(SHA(NTPasswordHashHash|NT_RESPONSE|MAGIC1)), where * NTPasswordHashHash is MD4(MD4(unicode(password))), NT_RESPONSE * is from the MS-CHAP2-Response attribute, and MAGIC1 is a * constant from RFC 3079. Then, we derive asymmetric send/receive * keys from the master session key. The "master send key" is * MSBx(SHA(MASTERKEY|SHSPAD1|MAGIC3|SHSPAD2)), * and the "master receive key" is * MSBx(SHA(MASTERKEY|SHSPAD1|MAGIC2|SHSPAD2)), where * MASTERKEY is the "master session key" generated above, and the * other values are constants from RFC 3079. MSBx is the x-most * significant bytes, where x is 5, 7, or 16 as appropriate for * the desired key length. We always generate 16 byte (128-bit) * keys, the NAS is required to truncate as needed. */ { /* These constants and key vars are named from RFC 3079. */ /* "This is the MPPE Master Key" */ unsigned char Magic1[27] = { 0x54, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20, 0x74, 0x68, 0x65, 0x20, 0x4d, 0x50, 0x50, 0x45, 0x20, 0x4d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x20, 0x4b, 0x65, 0x79 }; /* "On the client side, this is the send key; " "on the server side, it is the receive key." */ unsigned char Magic2[84] = { 0x4f, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x20, 0x73, 0x69, 0x64, 0x65, 0x2c, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20, 0x74, 0x68, 0x65, 0x20, 0x73, 0x65, 0x6e, 0x64, 0x20, 0x6b, 0x65, 0x79, 0x3b, 0x20, 0x6f, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x73, 0x69, 0x64, 0x65, 0x2c, 0x20, 0x69, 0x74, 0x20, 0x69, 0x73, 0x20, 0x74, 0x68, 0x65, 0x20, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x20, 0x6b, 0x65, 0x79, 0x2e }; /* "On the client side, this is the receive key; " "on the server side, it is the send key." */ unsigned char Magic3[84] = { 0x4f, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x20, 0x73, 0x69, 0x64, 0x65, 0x2c, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20, 0x74, 0x68, 0x65, 0x20, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x20, 0x6b, 0x65, 0x79, 0x3b, 0x20, 0x6f, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x73, 0x69, 0x64, 0x65, 0x2c, 0x20, 0x69, 0x74, 0x20, 0x69, 0x73, 0x20, 0x74, 0x68, 0x65, 0x20, 0x73, 0x65, 0x6e, 0x64, 0x20, 0x6b, 0x65, 0x79, 0x2e }; unsigned char SHSpad1[40] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; unsigned char SHSpad2[40] = { 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2 }; unsigned char MasterKey[16]; unsigned char MasterSendKey[16]; unsigned char MasterReceiveKey[16]; SHA_CTX ctx; unsigned char sha_md[SHA_DIGEST_LENGTH]; #if 0 /* salting/encoding now handled in lib/radius.c:tunnel_pwencode() */ unsigned char md5_md[MD5_DIGEST_LENGTH]; /* From RFC 2548: S R A */ unsigned char encode_buf[MAX_STRING_LEN + AUTH_VECTOR_LEN + 2]; int secretlen; /* A useless value required by RFC 2548. */ unsigned char salt[2]; unsigned char mppe_key[32]; /* 1 + 16 + padding */ /* 0x ( ASCII(salt) ) */ unsigned char mppe_key_string[2 + (2 * sizeof(salt)) + /* ( ASCII(mppe_key) ) \0 */ (2 * sizeof(mppe_key)) + 1]; #else /* 0 */ /* 0x ( ASCII(mppe_key) ) \0 */ unsigned char mppe_key_string[2 + (2 * sizeof(MasterKey)) + 1]; #endif /* else !0 */ /* Generate the master session key. */ SHA1_Init(&ctx); SHA1_Update(&ctx, password_md_md, MD4_DIGEST_LENGTH); SHA1_Update(&ctx, rvp->vp_strvalue + 26, 24); SHA1_Update(&ctx, Magic1, sizeof(Magic1)); SHA1_Final(sha_md, &ctx); (void) memcpy(MasterKey, sha_md, 16); /* Generate the master send key. */ SHA1_Init(&ctx); SHA1_Update(&ctx, MasterKey, 16); SHA1_Update(&ctx, SHSpad1, 40); SHA1_Update(&ctx, Magic3, sizeof(Magic3)); SHA1_Update(&ctx, SHSpad2, 40); SHA1_Final(sha_md, &ctx); (void) memcpy(MasterSendKey, sha_md, 16); /* Generate the master receive key. */ SHA1_Init(&ctx); SHA1_Update(&ctx, MasterKey, 16); SHA1_Update(&ctx, SHSpad1, 40); SHA1_Update(&ctx, Magic2, sizeof(Magic3)); SHA1_Update(&ctx, SHSpad2, 40); SHA1_Final(sha_md, &ctx); (void) memcpy(MasterReceiveKey, sha_md, 16); /* * Now, generate the MS-MPPE-Send-Key attribute. */ #if 0 /* Setup the salt value. */ salt[0] = 0x80; salt[1] = 0x01; /* Encode the key. */ (void) memset(mppe_key, 0, sizeof(mppe_key)); mppe_key[0] = 16; /* length */ (void) memcpy(&mppe_key[1], MasterSendKey, 16); secretlen = strlen(request->secret); (void) memcpy(encode_buf, request->secret, secretlen); (void) memcpy(encode_buf + secretlen, request->packet->vector, AUTH_VECTOR_LEN); (void) memcpy(encode_buf + secretlen + 16, salt, 2); (void) MD5(encode_buf, secretlen + AUTH_VECTOR_LEN + 2, md5_md); for (i = 0; i < 16; ++i) mppe_key[i] ^= md5_md[i]; (void) memcpy(encode_buf + secretlen, mppe_key, 16); (void) MD5(encode_buf, secretlen + 16, md5_md); for (i = 0; i < 16; ++i) mppe_key[i + 16] ^= md5_md[i]; /* Whew. Now stringify it for pairmake(). */ mppe_key_string[0] = '0'; mppe_key_string[1] = 'x'; (void) sprintf(&mppe_key_string[2], "%02X", salt[0]); (void) sprintf(&mppe_key_string[4], "%02X", salt[1]); for (i = 0; i < sizeof(mppe_key); ++i) (void) sprintf(&mppe_key_string[i*2+6], "%02X", mppe_key[i]); #else /* 0 */ mppe_key_string[0] = '0'; mppe_key_string[1] = 'x'; for (i = 0; i < sizeof(MasterSendKey); ++i) (void) sprintf(&mppe_key_string[i*2+2], "%02X", MasterSendKey[i]); #endif /* else !0 */ vp = pairmake("MS-MPPE-Send-Key", mppe_key_string, T_OP_EQ); rad_assert(vp != NULL); pairadd(avp, vp); /* * Generate the MS-MPPE-Recv-Key attribute. */ #if 0 /* Setup the salt value. */ salt[0] = 0x80; salt[1] = 0x02; /* Encode the key. */ (void) memset(mppe_key, 0, sizeof(mppe_key)); mppe_key[0] = 16; /* length */ (void) memcpy(&mppe_key[1], MasterReceiveKey, 16); secretlen = strlen(request->secret); (void) memcpy(encode_buf, request->secret, secretlen); (void) memcpy(encode_buf + secretlen, request->packet->vector, AUTH_VECTOR_LEN); (void) memcpy(encode_buf + secretlen + 16, salt, 2); (void) MD5(encode_buf, secretlen + AUTH_VECTOR_LEN + 2, md5_md); for (i = 0; i < 16; ++i) mppe_key[i] ^= md5_md[i]; (void) memcpy(encode_buf + secretlen, mppe_key, 16); (void) MD5(encode_buf, secretlen + 16, md5_md); for (i = 0; i < 16; ++i) mppe_key[i + 16] ^= md5_md[i]; /* Whew. Now stringify it for pairmake(). */ mppe_key_string[0] = '0'; mppe_key_string[1] = 'x'; (void) sprintf(&mppe_key_string[2], "%02X", salt[0]); (void) sprintf(&mppe_key_string[4], "%02X", salt[1]); for (i = 0; i < sizeof(mppe_key); ++i) (void) sprintf(&mppe_key_string[i*2+6], "%02X", mppe_key[i]); #else /* 0 */ mppe_key_string[0] = '0'; mppe_key_string[1] = 'x'; for (i = 0; i < sizeof(MasterReceiveKey); ++i) (void) sprintf(&mppe_key_string[i*2+2], "%02X", MasterReceiveKey[i]); #endif /* else !0 */ vp = pairmake("MS-MPPE-Recv-Key", mppe_key_string, T_OP_EQ); rad_assert(vp != NULL); pairadd(avp, vp); } /* (doing mppe) */ } /* PWE_MSCHAP2 */ break; /* PWE_MSCHAP2 */ } /* switch (pwe) */ return; } freeradius-server/src/modules/rlm_otp/otp_mppe.h000066400000000000000000000035241257552170400224360ustar00rootroot00000000000000/* * $Id$ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2001,2002 Google, Inc. * Copyright 2005,2006 TRI-D Systems, Inc. */ #ifndef OTP_MPPE_H #define OTP_MPPE_H #include RCSIDH(otp_mppe_h, "$Id$") /* Some hardcoding here ... because not all types have #defines */ #define PW_MS_CHAP_CHALLENGE ((311 << 16) | 11) #define PW_MS_CHAP_RESPONSE ((311 << 16) | 1) #define PW_MS_CHAP2_RESPONSE ((311 << 16) | 25) /* MPPE encryption policy */ #define MPPE_ENC_POL_ENCRYPTION_FORBIDDEN "0x00000000" #define MPPE_ENC_POL_ENCRYPTION_ALLOWED "0x00000001" #define MPPE_ENC_POL_ENCRYPTION_REQUIRED "0x00000002" /* MPPE encryption types */ #define MPPE_ENC_TYPES_RC4_40 "0x00000002" #define MPPE_ENC_TYPES_RC4_128 "0x00000004" #define MPPE_ENC_TYPES_RC4_40_128 "0x00000006" /* Translate the above into something easily usable. */ static const char *otp_mppe_policy[3] = { MPPE_ENC_POL_ENCRYPTION_FORBIDDEN, MPPE_ENC_POL_ENCRYPTION_ALLOWED, MPPE_ENC_POL_ENCRYPTION_REQUIRED }; static const char *otp_mppe_types[3] = { MPPE_ENC_TYPES_RC4_40, MPPE_ENC_TYPES_RC4_128, MPPE_ENC_TYPES_RC4_40_128 }; #endif /* OTP_MPPE_H */ freeradius-server/src/modules/rlm_otp/otp_pw_valid.c000066400000000000000000000262001257552170400232710ustar00rootroot00000000000000/* * $Id$ * * Passcode verification function (otpd client) for rlm_otp. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * * Copyright 2006,2007 TRI-D Systems, Inc. */ #include RCSID("$Id$") #include #include #include "extern.h" #include "otp.h" #include "otp_pw_valid.h" #ifdef HAVE_PTHREAD_H #include #endif #include /* transform otpd return codes into rlm return codes */ static int otprc2rlmrc(int rc) { switch (rc) { case OTP_RC_OK: return RLM_MODULE_OK; case OTP_RC_USER_UNKNOWN: return RLM_MODULE_REJECT; case OTP_RC_AUTHINFO_UNAVAIL: return RLM_MODULE_REJECT; case OTP_RC_AUTH_ERR: return RLM_MODULE_REJECT; case OTP_RC_MAXTRIES: return RLM_MODULE_USERLOCK; case OTP_RC_NEXTPASSCODE: return RLM_MODULE_USERLOCK; case OTP_RC_IPIN: return RLM_MODULE_REJECT; case OTP_RC_SERVICE_ERR: return RLM_MODULE_FAIL; default: return RLM_MODULE_FAIL; } } static otp_fd_t *otp_fd_head; static pthread_mutex_t otp_fd_head_mutex = PTHREAD_MUTEX_INITIALIZER; /* * Test for passcode validity by asking otpd. * * If challenge is supplied, it is used to generate the card response * against which the passcode will be compared. If challenge is not * supplied, or if the comparison fails, synchronous responses are * generated and tested. NOTE: for async authentications, sync mode * responses are still considered valid! (Assuming module configuration * allows sync mode.) * * Returns one of the RLM_MODULE_* codes. passcode is filled in. * NB: The returned passcode will contain the PIN! DO NOT LOG! */ int otp_pw_valid(REQUEST *request, int pwe, const char *challenge, const otp_option_t *opt, char passcode[OTP_MAX_PASSCODE_LEN + 1]) { otp_request_t otp_request; otp_reply_t otp_reply; VALUE_PAIR *cvp, *rvp; char *username = request->username->vp_strvalue; int rc; if (request->username->length > OTP_MAX_USERNAME_LEN) { (void) radlog(L_AUTH, "rlm_otp: username [%s] too long", username); return RLM_MODULE_REJECT; } /* we already know challenge is short enough */ otp_request.version = 2; (void) strcpy(otp_request.username, username); (void) strcpy(otp_request.challenge, challenge); otp_request.pwe.pwe = pwe; /* otp_pwe_present() (done by caller) guarantees that both of these exist */ cvp = pairfind(request->packet->vps, pwattr[pwe - 1]); rvp = pairfind(request->packet->vps, pwattr[pwe]); /* this is just to quiet Coverity */ if (!rvp || !cvp) return RLM_MODULE_REJECT; /* * Validate available vps based on pwe type. * Unfortunately (?) otpd must do this also. */ switch (otp_request.pwe.pwe) { case PWE_PAP: if (rvp->length >= sizeof(otp_request.pwe.u.pap.passcode)) { (void) radlog(L_AUTH, "rlm_otp: passcode for [%s] too long", username); return RLM_MODULE_REJECT; } (void) strcpy(otp_request.pwe.u.pap.passcode, rvp->vp_strvalue); break; case PWE_CHAP: if (cvp->length > 16) { (void) radlog(L_AUTH, "rlm_otp: CHAP challenge for [%s] too long", username); return RLM_MODULE_INVALID; } if (rvp->length != 17) { (void) radlog(L_AUTH, "rlm_otp: CHAP response for [%s] wrong size", username); return RLM_MODULE_INVALID; } (void) memcpy(otp_request.pwe.u.chap.challenge, cvp->vp_strvalue, cvp->length); otp_request.pwe.u.chap.clen = cvp->length; (void) memcpy(otp_request.pwe.u.chap.response, rvp->vp_strvalue, rvp->length); otp_request.pwe.u.chap.rlen = rvp->length; break; case PWE_MSCHAP: if (cvp->length != 8) { (void) radlog(L_AUTH, "rlm_otp: MS-CHAP challenge for [%s] wrong size", username); return RLM_MODULE_INVALID; } if (rvp->length != 50) { (void) radlog(L_AUTH, "rlm_otp: MS-CHAP response for [%s] wrong size", username); return RLM_MODULE_INVALID; } (void) memcpy(otp_request.pwe.u.chap.challenge, cvp->vp_strvalue, cvp->length); otp_request.pwe.u.chap.clen = cvp->length; (void) memcpy(otp_request.pwe.u.chap.response, rvp->vp_strvalue, rvp->length); otp_request.pwe.u.chap.rlen = rvp->length; break; case PWE_MSCHAP2: if (cvp->length != 16) { (void) radlog(L_AUTH, "rlm_otp: MS-CHAP2 challenge for [%s] wrong size", username); return RLM_MODULE_INVALID; } if (rvp->length != 50) { (void) radlog(L_AUTH, "rlm_otp: MS-CHAP2 response for [%s] wrong size", username); return RLM_MODULE_INVALID; } (void) memcpy(otp_request.pwe.u.chap.challenge, cvp->vp_strvalue, cvp->length); otp_request.pwe.u.chap.clen = cvp->length; (void) memcpy(otp_request.pwe.u.chap.response, rvp->vp_strvalue, rvp->length); otp_request.pwe.u.chap.rlen = rvp->length; break; } /* switch (otp_request.pwe.pwe) */ /* last byte must also be a terminator so otpd can verify length easily */ otp_request.username[OTP_MAX_USERNAME_LEN] = '\0'; otp_request.challenge[OTP_MAX_CHALLENGE_LEN] = '\0'; if (otp_request.pwe.pwe == PWE_PAP) otp_request.pwe.u.pap.passcode[OTP_MAX_PASSCODE_LEN] = '\0'; otp_request.allow_sync = opt->allow_sync; otp_request.allow_async = opt->allow_async; otp_request.challenge_delay = opt->challenge_delay; otp_request.resync = 1; rc = otp_verify(opt, &otp_request, &otp_reply); if (rc == OTP_RC_OK) (void) strcpy(passcode, otp_reply.passcode); return otprc2rlmrc(rc); } /* * Verify an otp by asking otpd. * Returns an OTP_* code, or -1 on system failure. * Fills in reply. */ static int otp_verify(const otp_option_t *opt, const otp_request_t *request, otp_reply_t *reply) { otp_fd_t *fdp; int rc; int tryagain = 2; retry: if (!tryagain--) return -1; fdp = otp_getfd(opt); if (!fdp || fdp->fd == -1) return -1; if ((rc = otp_write(fdp, (const char *) request, sizeof(*request))) != sizeof(*request)) { if (rc == 0) goto retry; /* otpd disconnect */ /*TODO: pause */ else return -1; } if ((rc = otp_read(fdp, (char *) reply, sizeof(*reply))) != sizeof(*reply)) { if (rc == 0) goto retry; /* otpd disconnect */ /*TODO: pause */ else return -1; } /* validate the reply */ if (reply->version != 1) { (void) radlog(L_AUTH, "rlm_otp: otpd reply for [%s] invalid " "(version %d != 1)", request->username, reply->version); otp_putfd(fdp, 1); return -1; } if (reply->passcode[OTP_MAX_PASSCODE_LEN] != '\0') { (void) radlog(L_AUTH, "rlm_otp: otpd reply for [%s] invalid (passcode)", request->username); otp_putfd(fdp, 1); return -1; } otp_putfd(fdp, 0); return reply->rc; } /* * Full read with logging, and close on failure. * Returns nread on success, 0 on EOF, -1 on other failures. */ static int otp_read(otp_fd_t *fdp, char *buf, size_t len) { ssize_t n; size_t nread = 0; /* bytes read into buf */ while (nread < len) { if ((n = read(fdp->fd, &buf[nread], len - nread)) == -1) { if (errno == EINTR) { continue; } else { (void) radlog(L_ERR, "rlm_otp: %s: read from otpd: %s", __func__, strerror(errno)); otp_putfd(fdp, 1); return -1; } } if (!n) { (void) radlog(L_ERR, "rlm_otp: %s: otpd disconnect", __func__); otp_putfd(fdp, 1); return 0; } nread += n; } /* while (more to read) */ return nread; } /* * Full write with logging, and close on failure. * Returns 0 on success, errno on failure. */ static int otp_write(otp_fd_t *fdp, const char *buf, size_t len) { size_t nleft = len; ssize_t nwrote; while (nleft) { if ((nwrote = write(fdp->fd, &buf[len - nleft], nleft)) == -1) { if (errno == EINTR) { continue; } else { (void) radlog(L_ERR, "rlm_otp: %s: write to otpd: %s", __func__, strerror(errno)); otp_putfd(fdp, 1); return errno; } } nleft -= nwrote; } return 0; } /* connect to otpd and return fd */ static int otp_connect(const char *path) { int fd; struct sockaddr_un sa; size_t sp_len; /* sun_path length (strlen) */ /* setup for unix domain socket */ sp_len = strlen(path); if (sp_len > sizeof(sa.sun_path) - 1) { (void) radlog(L_ERR, "rlm_otp: %s: rendezvous point name too long", __func__); return -1; } sa.sun_family = AF_UNIX; (void) strcpy(sa.sun_path, path); /* connect to otpd */ if ((fd = socket(PF_UNIX, SOCK_STREAM, 0)) == -1) { (void) radlog(L_ERR, "rlm_otp: %s: socket: %s", __func__, strerror(errno)); return -1; } if (connect(fd, (struct sockaddr *) &sa, sizeof(sa.sun_family) + sp_len) == -1) { (void) radlog(L_ERR, "rlm_otp: %s: connect(%s): %s", __func__, path, strerror(errno)); (void) close(fd); return -1; } return fd; } /* * Retrieve an fd (from pool) to use for otpd connection. * It'd be simpler to use TLS but FR can have lots of threads * and we don't want to waste fd's that way. * We can't have a global fd because we'd then be pipelining * requests to otpd and we have no way to demultiplex * the responses. */ static otp_fd_t * otp_getfd(const otp_option_t *opt) { int rc; otp_fd_t *fdp; /* walk the connection pool looking for an available fd */ for (fdp = otp_fd_head; fdp; fdp = fdp->next) { rc = otp_pthread_mutex_trylock(&fdp->mutex); if (!rc) if (!strcmp(fdp->path, opt->otpd_rp)) /* could just use == */ break; } if (!fdp) { /* no fd was available, add a new one */ fdp = rad_malloc(sizeof(*fdp)); otp_pthread_mutex_init(&fdp->mutex, NULL); otp_pthread_mutex_lock(&fdp->mutex); /* insert new fd at head */ otp_pthread_mutex_lock(&otp_fd_head_mutex); fdp->next = otp_fd_head; otp_fd_head = fdp; otp_pthread_mutex_unlock(&otp_fd_head_mutex); /* initialize */ fdp->path = opt->otpd_rp; fdp->fd = -1; } /* establish connection */ if (fdp->fd == -1) fdp->fd = otp_connect(fdp->path); return fdp; } /* release fd, and optionally disconnect from otpd */ static void otp_putfd(otp_fd_t *fdp, int disconnect) { if (disconnect) { (void) close(fdp->fd); fdp->fd = -1; } /* make connection available to another thread */ otp_pthread_mutex_unlock(&fdp->mutex); } freeradius-server/src/modules/rlm_otp/otp_pw_valid.h000066400000000000000000000031101257552170400232710ustar00rootroot00000000000000/* * $Id$ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2006 TRI-D Systems, Inc. */ #ifndef OTP_PW_VALID_H #define OTP_PW_VALID_H #include RCSIDH(otp_pw_valid_h, "$Id$") #include #include #include "extern.h" /* otp_option_t */ #include "otp.h" /* otp_request_t, otp_reply_t */ typedef struct otp_fd_t { pthread_mutex_t mutex; const char *path; /* allows diff instances to use diff otpds */ int fd; struct otp_fd_t *next; } otp_fd_t; static int otprc2rlmrc(int); static int otp_verify(const otp_option_t *, const otp_request_t *, otp_reply_t *); static int otp_read(otp_fd_t *, char *, size_t); static int otp_write(otp_fd_t *, const char *, size_t); static int otp_connect(const char *); static otp_fd_t *otp_getfd(const otp_option_t *); static void otp_putfd(otp_fd_t *, int); #endif /* OTP_PW_VALID_H */ freeradius-server/src/modules/rlm_otp/otp_pwe.c000066400000000000000000000064721257552170400222700ustar00rootroot00000000000000/* * $Id$ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2001,2002 Google, Inc. * Copyright 2005,2006 TRI-D Systems, Inc. */ /* * This file implements passcode (password) checking functions for each * supported encoding (PAP, CHAP, etc.). The current libradius interface * is not sufficient for X9.9 use. */ #include RCSID("$Id$") /* avoid inclusion of these FR headers which conflict w/ OpenSSL */ #define _FR_MD4_H #define _FR_SHA1_H #include #include #include "extern.h" #include #include #include #include #include /* Attribute IDs for supported password encodings. */ #define SIZEOF_PWATTR (4 * 2) int pwattr[SIZEOF_PWATTR]; /* Initialize the pwattr array for supported password encodings. */ void otp_pwe_init(void) { DICT_ATTR *da; /* * Setup known password types. These are pairs. * NB: Increase pwattr array size when adding a type. * It should be sized as (number of password types * 2) * NB: Array indices must match otp_pwe_t! (see otp.h) */ (void) memset(pwattr, 0, sizeof(pwattr)); /* PAP */ if ((da = dict_attrbyname("User-Password")) != NULL) { pwattr[0] = da->attr; pwattr[1] = da->attr; } /* CHAP */ if ((da = dict_attrbyname("CHAP-Challenge")) != NULL) { pwattr[2] = da->attr; if ((da = dict_attrbyname("CHAP-Password")) != NULL) pwattr[3] = da->attr; else pwattr[2] = 0; } #if 0 /* MS-CHAP (recommended not to use) */ if ((da = dict_attrbyname("MS-CHAP-Challenge")) != NULL) { pwattr[4] = da->attr; if ((da = dict_attrbyname("MS-CHAP-Response")) != NULL) pwattr[5] = da->attr; else pwattr[4] = 0; } #endif /* 0 */ /* MS-CHAPv2 */ if ((da = dict_attrbyname("MS-CHAP-Challenge")) != NULL) { pwattr[6] = da->attr; if ((da = dict_attrbyname("MS-CHAP2-Response")) != NULL) pwattr[7] = da->attr; else pwattr[6] = 0; } } /* * Test for password presence in an Access-Request packet. * Returns 0 for "no supported password present", or the * password encoding type. */ otp_pwe_t otp_pwe_present(const REQUEST *request) { unsigned i; for (i = 0; i < SIZEOF_PWATTR; i += 2) { if (pairfind(request->packet->vps, pwattr[i]) && pairfind(request->packet->vps, pwattr[i + 1])) { DEBUG("rlm_otp: %s: password attributes %d, %d", __func__, pwattr[i], pwattr[i + 1]); return i + 1; /* Can't return 0 (indicates failure) */ } } DEBUG("rlm_otp: %s: no password attributes present", __func__); return 0; } freeradius-server/src/modules/rlm_otp/otp_radstate.c000066400000000000000000000134321257552170400232760ustar00rootroot00000000000000/* * $Id$ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2001,2002 Google, Inc. * Copyright 2005,2006 TRI-D Systems, Inc. */ #include RCSID("$Id$") /* avoid inclusion of these FR headers which conflict w/ OpenSSL */ #define _FR_MD4_H #define _FR_SHA1_H #include "extern.h" #include #include /* des_cblock */ #include #include /* * Generate the State attribute, suitable for passing to pairmake(). * 'challenge' must be a null terminated string, and be sized at least * as large as indicated in the function definition. * * Returns 0 on success, non-zero otherwise. For successful returns, * 'rad_state' (suitable for passing to pairmake()) and 'raw_state', * if non-NULL, will be filled in. * * In the simplest implementation, we would just use the challenge as state. * Unfortunately, the RADIUS secret protects only the User-Password * attribute; an attacker that can remove packets from the wire and insert * new ones can simply insert a replayed state without having to know * the secret. If not for an attacker that can remove packets from the * network, I believe trivial state to be secure. * * So, we have to make up for that deficiency by signing our state with * data unique to this specific request. A NAS would use the Request * Authenticator, but we don't know what that will be when the State is * returned to us, so we'll use the time. So our replay prevention * is limited to a time interval (inst->challenge_delay). We could keep * track of all challenges issued over that time interval for * better protection. * * Our state, then, is * (challenge + flags + time + hmac(challenge + resync + time, key)), * where '+' denotes concatentation, 'challenge' is ... the challenge, * 'flags' is a 32-bit value that can be used to record additional info, * 'time' is the 32-bit time (LSB if time_t is 64 bits), and 'key' is a * random key, generated in otp_instantiate(). 'flags' and 'time' are * in network byte order. * * As the signing key is unique to each server, only the server which * generates a challenge can verify it; this should be OK if your NAS's * load balance across RADIUS servers using a "first available" algorithm. * If your NAS's round-robin and don't "stick" to the same server if they * see a State attribute (ugh), you could use the RADIUS secret instead, * but read RFC 2104 first, and make very sure you really want to do this. * * Since only the "same server" can verify State, 'flags' and 'time' doesn't * really need to be in network byte order, but we do it anyway. * * The State attribute is an octet string, however some versions of Cisco * IOS and Catalyst OS (at least IOS 12.1(26)E4 and CatOS 7.6.12) treat it * as an ASCII string (they only return data up to the first NUL byte). * So we must handle state as an ASCII string (0x00 -> 0x3030). */ int otp_gen_state(char rad_state[OTP_MAX_RADSTATE_LEN], unsigned char raw_state[OTP_MAX_RADSTATE_LEN], const unsigned char challenge[OTP_MAX_CHALLENGE_LEN], size_t clen, int32_t flags, int32_t when, const unsigned char key[16]) { HMAC_CTX hmac_ctx; unsigned char hmac[MD5_DIGEST_LENGTH]; char *p; char state[OTP_MAX_RADSTATE_LEN]; /* * Generate the hmac. We already have a dependency on openssl for * DES, so we'll use it's hmac functionality also -- saves us from * having to collect the data to be signed into one contiguous piece. */ HMAC_Init(&hmac_ctx, key, sizeof(key[0]) * 16, EVP_md5()); HMAC_Update(&hmac_ctx, challenge, clen); HMAC_Update(&hmac_ctx, (unsigned char *) &flags, 4); HMAC_Update(&hmac_ctx, (unsigned char *) &when, 4); HMAC_Final(&hmac_ctx, hmac, NULL); HMAC_cleanup(&hmac_ctx); /* * Generate the state. Note that it is in ASCII. The challenge * value doesn't have to be ASCII encoded, as it is already * ASCII, but we do it anyway, for consistency. */ #if 0 /* * We used to malloc() state (here and in callers). We leave this * here to show how OTP_MAX_RADSTATE_LEN is composed. Note that * it has to be double all the values below to account for an * extra ASCII expansion (see Cisco notes, below). */ state = rad_malloc(clen * 2 + /* challenge */ 8 + /* flags */ 8 + /* time */ sizeof(hmac) * 2 + /* hmac */ 1); /* '\0' */ #endif p = state; /* Add the challenge. */ otp_x2a(challenge, clen, p); p += clen * 2; /* Add the flags and time. */ otp_x2a((unsigned char *) &flags, 4, p); p += 8; otp_x2a((unsigned char *) &when, 4, p); p += 8; /* Add the hmac. */ otp_x2a(hmac, 16, p); /* * Expand state (already ASCII) into ASCII again (0x31 -> 0x3331). * pairmake() forces us to do this (it will reduce it back to binary), * and to include a leading "0x". */ if (rad_state) { (void) sprintf(rad_state, "0x"); p = rad_state + 2; otp_x2a(state, strlen(state), p); } if (raw_state) (void) memcpy(raw_state, state, sizeof(state)); return 0; } freeradius-server/src/modules/rlm_otp/otp_rlm.c000066400000000000000000000330351257552170400222620ustar00rootroot00000000000000/* * $Id$ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2000,2001,2002 The FreeRADIUS server project * Copyright 2001,2002 Google, Inc. * Copyright 2005-2007 TRI-D Systems, Inc. */ #include RCSID("$Id$") #include #include #include "extern.h" #include "otp.h" /* Global data */ static unsigned char hmac_key[16]; /* to protect State attribute */ static int ninstance = 0; /* #instances, for global init */ /* A mapping of configuration file names to internal variables. */ static const CONF_PARSER module_config[] = { { "otpd_rp", PW_TYPE_STRING_PTR, offsetof(otp_option_t, otpd_rp), NULL, OTP_OTPD_RP }, { "challenge_prompt", PW_TYPE_STRING_PTR,offsetof(otp_option_t, chal_prompt), NULL, OTP_CHALLENGE_PROMPT }, { "challenge_length", PW_TYPE_INTEGER, offsetof(otp_option_t, challenge_len), NULL, "6" }, { "challenge_delay", PW_TYPE_INTEGER, offsetof(otp_option_t, challenge_delay), NULL, "30" }, { "allow_sync", PW_TYPE_BOOLEAN, offsetof(otp_option_t, allow_sync), NULL, "yes" }, { "allow_async", PW_TYPE_BOOLEAN, offsetof(otp_option_t, allow_async), NULL, "no" }, { "mschapv2_mppe", PW_TYPE_INTEGER, offsetof(otp_option_t, mschapv2_mppe_policy), NULL, "2" }, { "mschapv2_mppe_bits", PW_TYPE_INTEGER, offsetof(otp_option_t, mschapv2_mppe_types), NULL, "2" }, { "mschap_mppe", PW_TYPE_INTEGER, offsetof(otp_option_t, mschap_mppe_policy), NULL, "2" }, { "mschap_mppe_bits", PW_TYPE_INTEGER, offsetof(otp_option_t, mschap_mppe_types), NULL, "2" }, { NULL, -1, 0, NULL, NULL } /* end the list */ }; /* per-instance initialization */ static int otp_instantiate(CONF_SECTION *conf, void **instance) { otp_option_t *opt; char *p; /* Set up a storage area for instance data. */ opt = rad_malloc(sizeof(*opt)); (void) memset(opt, 0, sizeof(*opt)); /* If the configuration parameters can't be parsed, then fail. */ if (cf_section_parse(conf, opt, module_config) < 0) { free(opt); return -1; } /* Onetime initialization. */ if (!ninstance) { /* Generate a random key, used to protect the State attribute. */ otp_get_random(hmac_key, sizeof(hmac_key)); /* Initialize the passcode encoding/checking functions. */ otp_pwe_init(); /* * Don't do this again. * Only the main thread instantiates and detaches instances, * so this does not need mutex protection. */ ninstance++; } /* Verify ranges for those vars that are limited. */ if ((opt->challenge_len < 5) || (opt->challenge_len > OTP_MAX_CHALLENGE_LEN)) { opt->challenge_len = 6; (void) radlog(L_ERR, "rlm_otp: %s: invalid challenge_length, range 5-%d, " "using default of 6", __func__, OTP_MAX_CHALLENGE_LEN); } /* Enforce a single "%" sequence, which must be "%s" */ p = strchr(opt->chal_prompt, '%'); if ((p == NULL) || (p != strrchr(opt->chal_prompt, '%')) || strncmp(p,"%s",2)) { free(opt->chal_prompt); opt->chal_prompt = strdup(OTP_CHALLENGE_PROMPT); (void) radlog(L_ERR, "rlm_otp: %s: invalid challenge_prompt, " "using default of \"%s\"", __func__, OTP_CHALLENGE_PROMPT); } if (!opt->allow_sync && !opt->allow_async) { (void) radlog(L_ERR, "rlm_otp: %s: at least one of " "{allow_async, allow_sync} must be set", __func__); free(opt); return -1; } if ((opt->mschapv2_mppe_policy > 2) || (opt->mschapv2_mppe_policy < 0)) { opt->mschapv2_mppe_policy = 2; (void) radlog(L_ERR, "rlm_otp: %s: invalid value for mschapv2_mppe, " "using default of 2", __func__); } if ((opt->mschapv2_mppe_types > 2) || (opt->mschapv2_mppe_types < 0)) { opt->mschapv2_mppe_types = 2; (void) radlog(L_ERR, "rlm_otp: %s: invalid value for mschapv2_mppe_bits, " "using default of 2", __func__); } if ((opt->mschap_mppe_policy > 2) || (opt->mschap_mppe_policy < 0)) { opt->mschap_mppe_policy = 2; (void) radlog(L_ERR, "rlm_otp: %s: invalid value for mschap_mppe, " "using default of 2", __func__); } if (opt->mschap_mppe_types != 2) { opt->mschap_mppe_types = 2; (void) radlog(L_ERR, "rlm_otp: %s: invalid value for mschap_mppe_bits, " "using default of 2", __func__); } /* set the instance name (for use with authorize()) */ opt->name = cf_section_name2(conf); if (!opt->name) opt->name = cf_section_name1(conf); if (!opt->name) { (void) radlog(L_ERR|L_CONS, "rlm_otp: %s: no instance name (this can't happen)", __func__); free(opt); return -1; } *instance = opt; return 0; } /* Generate a challenge to be presented to the user. */ static int otp_authorize(void *instance, REQUEST *request) { otp_option_t *inst = (otp_option_t *) instance; char challenge[OTP_MAX_CHALLENGE_LEN + 1]; /* +1 for '\0' terminator */ int auth_type_found; /* Early exit if Auth-Type != inst->name */ { VALUE_PAIR *vp; auth_type_found = 0; if ((vp = pairfind(request->config_items, PW_AUTHTYPE)) != NULL) { auth_type_found = 1; if (strcmp(vp->vp_strvalue, inst->name)) return RLM_MODULE_NOOP; } } /* The State attribute will be present if this is a response. */ if (pairfind(request->packet->vps, PW_STATE) != NULL) { DEBUG("rlm_otp: autz: Found response to Access-Challenge"); return RLM_MODULE_OK; } /* User-Name attribute required. */ if (!request->username) { (void) radlog(L_AUTH, "rlm_otp: %s: Attribute \"User-Name\" required " "for authentication.", __func__); return RLM_MODULE_INVALID; } if (otp_pwe_present(request) == 0) { (void) radlog(L_AUTH, "rlm_otp: %s: Attribute \"User-Password\" " "or equivalent required for authentication.", __func__); return RLM_MODULE_INVALID; } /* * We used to check for special "challenge" and "resync" passcodes * here, but these are complicated to explain and application is * limited. More importantly, since we've removed all actual OTP * code (now we ask otpd), it's awkward for us to support them. * Should the need arise to reinstate these options, the most likely * choice is to duplicate some otpd code here. */ if (inst->allow_sync && !inst->allow_async) { /* This is the token sync response. */ if (!auth_type_found) pairadd(&request->config_items, pairmake("Auth-Type", inst->name, T_OP_EQ)); return RLM_MODULE_OK; } /* Generate a random challenge. */ otp_async_challenge(challenge, inst->challenge_len); /* * Create the State attribute, which will be returned to us along with * the response. We will need this to verify the response. It must * be hmac protected to prevent insertion of arbitrary State by an * inside attacker. If we won't actually use the State (server config * doesn't allow async), we just use a trivial State. We always create * at least a trivial State, so otp_authorize() can quickly pass on to * otp_authenticate(). */ { int32_t now = htonl(time(NULL)); /* low-order 32 bits on LP64 */ char state[OTP_MAX_RADSTATE_LEN]; if (otp_gen_state(state, NULL, challenge, inst->challenge_len, 0, now, hmac_key) != 0) { (void) radlog(L_ERR, "rlm_otp: %s: failed to generate radstate",__func__); return RLM_MODULE_FAIL; } pairadd(&request->reply->vps, pairmake("State", state, T_OP_EQ)); } /* Add the challenge to the reply. */ { char *u_challenge; /* challenge with addt'l presentation text */ u_challenge = rad_malloc(strlen(inst->chal_prompt) + OTP_MAX_CHALLENGE_LEN + 1); (void) sprintf(u_challenge, inst->chal_prompt, challenge); pairadd(&request->reply->vps, pairmake("Reply-Message", u_challenge, T_OP_EQ)); free(u_challenge); } /* * Mark the packet as an Access-Challenge packet. * The server will take care of sending it to the user. */ request->reply->code = PW_ACCESS_CHALLENGE; DEBUG("rlm_otp: Sending Access-Challenge."); if (!auth_type_found) pairadd(&request->config_items, pairmake("Auth-Type", inst->name, T_OP_EQ)); return RLM_MODULE_HANDLED; } /* Verify the response entered by the user. */ static int otp_authenticate(void *instance, REQUEST *request) { otp_option_t *inst = (otp_option_t *) instance; char *username; int rc; otp_pwe_t pwe; VALUE_PAIR *vp; unsigned char challenge[OTP_MAX_CHALLENGE_LEN]; /* cf. authorize() */ char passcode[OTP_MAX_PASSCODE_LEN + 1]; challenge[0] = '\0'; /* initialize for otp_pw_valid() */ /* User-Name attribute required. */ if (!request->username) { (void) radlog(L_AUTH, "rlm_otp: %s: Attribute \"User-Name\" required " "for authentication.", __func__); return RLM_MODULE_INVALID; } username = request->username->vp_strvalue; if ((pwe = otp_pwe_present(request)) == 0) { (void) radlog(L_AUTH, "rlm_otp: %s: Attribute \"User-Password\" " "or equivalent required for authentication.", __func__); return RLM_MODULE_INVALID; } /* Add a message to the auth log. */ pairadd(&request->packet->vps, pairmake("Module-Failure-Message", "rlm_otp", T_OP_EQ)); pairadd(&request->packet->vps, pairmake("Module-Success-Message", "rlm_otp", T_OP_EQ)); /* Retrieve the challenge (from State attribute). */ if ((vp = pairfind(request->packet->vps, PW_STATE)) != NULL) { unsigned char state[OTP_MAX_RADSTATE_LEN]; unsigned char raw_state[OTP_MAX_RADSTATE_LEN]; unsigned char rad_state[OTP_MAX_RADSTATE_LEN]; int32_t then; /* state timestamp */ int e_length; /* expected State length */ /* set expected State length */ e_length = inst->challenge_len * 2 + 8 + 8 + 32; /* see otp_gen_state() */ if (vp->length != e_length) { (void) radlog(L_AUTH, "rlm_otp: %s: bad radstate for [%s]: length", __func__, username); return RLM_MODULE_INVALID; } /* * Verify the state. */ /* ASCII decode; this is why OTP_MAX_RADSTATE_LEN has +1 */ (void) memcpy(rad_state, vp->vp_strvalue, vp->length); rad_state[e_length] = '\0'; if (otp_a2x(rad_state, raw_state) == -1) { (void) radlog(L_AUTH, "rlm_otp: %s: bad radstate for [%s]: not hex", __func__, username); return RLM_MODULE_INVALID; } /* extract data from State */ (void) memcpy(challenge, raw_state, inst->challenge_len); /* skip flag data */ (void) memcpy(&then, raw_state + inst->challenge_len + 4, 4); /* generate new state from returned input data */ if (otp_gen_state(NULL, state, challenge, inst->challenge_len, 0, then, hmac_key) != 0) { (void) radlog(L_ERR, "rlm_otp: %s: failed to generate radstate", __func__); return RLM_MODULE_FAIL; } /* compare generated state against returned state to verify hmac */ if (memcmp(state, vp->vp_strvalue, vp->length)) { (void) radlog(L_AUTH, "rlm_otp: %s: bad radstate for [%s]: hmac", __func__, username); return RLM_MODULE_REJECT; } /* State is valid, but check expiry. */ then = ntohl(then); if (time(NULL) - then > inst->challenge_delay) { (void) radlog(L_AUTH, "rlm_otp: %s: bad radstate for [%s]: expired", __func__, username); return RLM_MODULE_REJECT; } } /* if (State present) */ /* do it */ rc = otp_pw_valid(request, pwe, challenge, inst, passcode); /* Add MPPE data as needed. */ if (rc == RLM_MODULE_OK) otp_mppe(request, pwe, inst, passcode); return rc; } /* per-instance destruction */ static int otp_detach(void *instance) { free(instance); /* * Only the main thread instantiates and detaches instances, * so this does not need mutex protection. */ if (--ninstance == 0) (void) memset(hmac_key, 0, sizeof(hmac_key)); return 0; } /* * If the module needs to temporarily modify it's instantiation * data, the type should be changed to RLM_TYPE_THREAD_UNSAFE. * The server will then take care of ensuring that the module * is single-threaded. */ module_t rlm_otp = { RLM_MODULE_INIT, "otp", RLM_TYPE_THREAD_SAFE, /* type */ otp_instantiate, /* instantiation */ otp_detach, /* detach */ { otp_authenticate, /* authentication */ otp_authorize, /* authorization */ NULL, /* preaccounting */ NULL, /* accounting */ NULL, /* checksimul */ NULL, /* pre-proxy */ NULL, /* post-proxy */ NULL /* post-auth */ }, }; freeradius-server/src/modules/rlm_otp/otp_util.c000066400000000000000000000116351257552170400224470ustar00rootroot00000000000000/* * $Id$ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2001,2002 Google, Inc. * Copyright 2005,2006 TRI-D Systems, Inc. */ #include RCSID("$Id$") #include "extern.h" #include #include #include #include #include /* * Return some random bytes. */ void otp_get_random(char *rnd_data, size_t len) { size_t bytes_read = 0; while (bytes_read < len) { int n; unsigned int bytes_left = len - bytes_read; uint32_t r = fr_rand(); n = sizeof(r) < bytes_left ? sizeof(r) : bytes_left; (void) memcpy(rnd_data + bytes_read, &r, n); bytes_read += n; } } /* * Return a random challenge. * NOTE: This is really cryptocard-specific (automatic ASCII conversion * and null termination). */ void otp_async_challenge(char challenge[OTP_MAX_CHALLENGE_LEN + 1], int len) { unsigned char rawchallenge[OTP_MAX_CHALLENGE_LEN]; int i; otp_get_random(rawchallenge, len); /* Convert the raw bytes to ASCII decimal. */ for (i = 0; i < len; ++i) challenge[i] = '0' + rawchallenge[i] % 10; challenge[len] = '\0'; } /* ascii to hex; returns HEXlen on success or -1 on error */ int otp_a2x(const char *s, unsigned char x[]) { unsigned i; size_t l = strlen(s); /* * We could just use sscanf, but we do this a lot, and have very * specific needs, and it's easy to implement, so let's go for it! */ for (i = 0; i < l / 2; ++i) { unsigned int n[2]; int j; /* extract 2 nibbles */ n[0] = *s++; n[1] = *s++; /* verify range */ for (j = 0; j < 2; ++j) { if ((n[j] >= '0' && n[j] <= '9') || (n[j] >= 'A' && n[j] <= 'F') || (n[j] >= 'a' && n[j] <= 'f')) continue; return -1; } /* convert ASCII hex digits to numeric values */ n[0] -= '0'; n[1] -= '0'; if (n[0] > 9) { if (n[0] > 'F' - '0') n[0] -= 'a' - '9' - 1; else n[0] -= 'A' - '9' - 1; } if (n[1] > 9) { if (n[1] > 'F' - '0') n[1] -= 'a' - '9' - 1; else n[1] -= 'A' - '9' - 1; } /* store as octets */ x[i] = n[0] << 4; x[i] += n[1]; } /* for (each octet) */ return l/2; } /* Character maps for generic hex and vendor specific decimal modes */ static const char otp_hex_conversion[] = "0123456789abcdef"; #if 0 /* just for reference */ static const char otp_cc_dec_conversion[] = "0123456789012345"; static const char otp_snk_dec_conversion[] = "0123456789222333"; static const char otp_sc_friendly_conversion[] = "0123456789ahcpef"; #endif /* * hex to ascii * Fills in s, which must point to at least len*2+1 bytes of space. */ void otp_x2a(const unsigned char *x, size_t len, char *s) { unsigned i; for (i = 0; i < len; ++i) { unsigned n[2]; n[0] = (x[i] >> 4) & 0x0f; n[1] = x[i] & 0x0f; s[2 * i + 0] = otp_hex_conversion[n[0]]; s[2 * i + 1] = otp_hex_conversion[n[1]]; } s[2 * len] = '\0'; } /* guaranteed initialization */ void _otp_pthread_mutex_init(pthread_mutex_t *mutexp, const pthread_mutexattr_t *attr, const char *caller) { int rc; if ((rc = pthread_mutex_init(mutexp, attr))) { (void) radlog(L_ERR|L_CONS, "rlm_otp: %s: pthread_mutex_init: %s", caller, strerror(rc)); exit(1); } } /* guaranteed lock */ void _otp_pthread_mutex_lock(pthread_mutex_t *mutexp, const char *caller) { int rc; if ((rc = pthread_mutex_lock(mutexp))) { (void) radlog(L_ERR|L_CONS, "rlm_otp: %s: pthread_mutex_lock: %s", caller, strerror(rc)); exit(1); } } /* guaranteed trylock */ int _otp_pthread_mutex_trylock(pthread_mutex_t *mutexp, const char *caller) { int rc; rc = pthread_mutex_trylock(mutexp); if (rc && rc != EBUSY) { (void) radlog(L_ERR|L_CONS, "rlm_otp: %s: pthread_mutex_trylock: %s", caller, strerror(rc)); exit(1); } return rc; } /* guaranteed unlock */ void _otp_pthread_mutex_unlock(pthread_mutex_t *mutexp, const char *caller) { int rc; if ((rc = pthread_mutex_unlock(mutexp))) { (void) radlog(L_ERR|L_CONS, "rlm_otp: %s: pthread_mutex_unlock: %s", caller, strerror(rc)); exit(1); } } freeradius-server/src/modules/rlm_pam/000077500000000000000000000000001257552170400204115ustar00rootroot00000000000000freeradius-server/src/modules/rlm_pam/.gitignore000066400000000000000000000000221257552170400223730ustar00rootroot00000000000000Makefile config.h freeradius-server/src/modules/rlm_pam/Makefile.in000066400000000000000000000002551257552170400224600ustar00rootroot00000000000000# # $Id$ # TARGET = @targetname@ SRCS = rlm_pam.c HEADERS = RLM_LIBS = @pam_ldflags@ RLM_CFLAGS = @pam_cflags@ include ../rules.mak $(LT_OBJS): $(HEADERS) freeradius-server/src/modules/rlm_pam/config.h.in000066400000000000000000000027051257552170400224400ustar00rootroot00000000000000/* config.h.in. Generated from configure.in by autoheader. */ /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Define to 1 if you have the header file. */ #undef HAVE_PAM_PAM_APPL_H /* Define to 1 if you have the header file. */ #undef HAVE_SECURITY_PAM_APPL_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 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_UNISTD_H /* 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 version of this package. */ #undef PACKAGE_VERSION /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS freeradius-server/src/modules/rlm_pam/configure000077500000000000000000003744661257552170400223440ustar00rootroot00000000000000#! /bin/sh # From configure.in Revision. # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.61. # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, # 2002, 2003, 2004, 2005, 2006 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=: # 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 # PATH needs CR # 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 # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false 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.) as_nl=' ' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. 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 # Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # CDPATH. $as_unset CDPATH if test "x$CONFIG_SHELL" = x; then if (eval ":") 2>/dev/null; then as_have_required=yes else as_have_required=no fi if test $as_have_required = yes && (eval ": (as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=\$LINENO as_lineno_2=\$LINENO test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } ") 2> /dev/null; then : else as_candidate_shells= as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. case $as_dir in /*) for as_base in sh bash ksh sh5; do as_candidate_shells="$as_candidate_shells $as_dir/$as_base" done;; esac done IFS=$as_save_IFS for as_shell in $as_candidate_shells $SHELL; do # Try only shells that exist, to save several forks. if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { ("$as_shell") 2> /dev/null <<\_ASEOF 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 : _ASEOF }; then CONFIG_SHELL=$as_shell as_have_required=yes if { "$as_shell" 2> /dev/null <<\_ASEOF 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 : (as_func_return () { (exit $1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = "$1" ); then : else exitcode=1 echo positional parameters were not saved. fi test $exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } _ASEOF }; then break fi fi done if test "x$CONFIG_SHELL" != x; then for as_var in BASH_ENV ENV do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done export CONFIG_SHELL exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} fi if test $as_have_required = no; then echo This script requires a shell more modern than all the echo shells that I found on your system. Please install a echo modern shell, or manually run the script under such a echo shell if you do have one. { (exit 1); exit 1; } fi fi fi (eval "as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0") || { echo No shell found that supports shell functions. echo Please tell autoconf@gnu.org about your system, echo including any error possibly output before this echo message } as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, and appends # trailing '-' during substitution so that $LINENO is not a special # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # scripts with optimization help from Paolo Bonzini. 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" || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi 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 fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi 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=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, 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= SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME= PACKAGE_TARNAME= PACKAGE_VERSION= PACKAGE_STRING= PACKAGE_BUGREPORT= ac_unique_file="rlm_pam.c" # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef STDC_HEADERS # include # include #else # ifdef HAVE_STDLIB_H # include # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datarootdir datadir sysconfdir sharedstatedir localstatedir includedir oldincludedir docdir infodir htmldir dvidir pdfdir psdir libdir localedir mandir DEFS ECHO_C ECHO_N ECHO_T LIBS build_alias host_alias target_alias CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP GREP EGREP pam_ldflags pam_cflags targetname LIBOBJS LTLIBOBJS' ac_subst_files='' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CPP' # Initialize some variables set by options. ac_init_help= ac_init_version=false # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *) ac_optarg=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_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` eval enable_$ac_feature=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_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` eval enable_$ac_feature=\$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_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/[-.]/_/g'` eval with_$ac_package=\$ac_optarg ;; -without-* | --without-*) ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/[-.]/_/g'` eval with_$ac_package=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 ;; -*) { echo "$as_me: error: unrecognized option: $ac_option Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && 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'` { echo "$as_me: error: missing argument to $ac_option" >&2 { (exit 1); exit 1; }; } fi # Be sure to have absolute directory names. 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 case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; } 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 echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || { echo "$as_me: error: Working directory cannot be determined" >&2 { (exit 1); exit 1; }; } test "X$ac_ls_di" = "X$ac_pwd_ls_di" || { echo "$as_me: error: pwd does not report name of working directory" >&2 { (exit 1); exit 1; }; } # 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 -- "$0" || $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$0" : 'X\(//\)[^/]' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X"$0" | 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 .." { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2 { (exit 1); exit 1; }; } pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures this package to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF _ACEOF fi if test -n "$ac_init_help"; then cat <<\_ACEOF 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 C/C++/Objective C preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. _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" || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`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 echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF configure generated by GNU Autoconf 2.61 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 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 cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by $as_me, which was generated by GNU Autoconf 2.61. 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=. 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=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; 2) ac_configure_args1="$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 ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac done done $as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } $as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export 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 cat <<\_ASBOX ## ---------------- ## ## Cache variables. ## ## ---------------- ## _ASBOX 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_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( *) $as_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 cat <<\_ASBOX ## ----------------- ## ## Output variables. ## ## ----------------- ## _ASBOX echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then cat <<\_ASBOX ## ------------------- ## ## File substitutions. ## ## ------------------- ## _ASBOX echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then cat <<\_ASBOX ## ----------- ## ## confdefs.h. ## ## ----------- ## _ASBOX echo cat confdefs.h echo fi test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" 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'; { (exit 1); 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 # 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 # Let the site file select an alternate cache file if it wants to. # Prefer explicitly selected file to automatically selected ones. if test -n "$CONFIG_SITE"; then set x "$CONFIG_SITE" elif test "x$prefix" != xNONE; then set x "$prefix/share/config.site" "$prefix/etc/config.site" else set x "$ac_default_prefix/share/config.site" \ "$ac_default_prefix/etc/config.site" fi shift for ac_site_file do if test -r "$ac_site_file"; then { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" 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. if test -f "$cache_file"; then { echo "$as_me:$LINENO: loading cache $cache_file" >&5 echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { echo "$as_me:$LINENO: creating cache $cache_file" >&5 echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 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 { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 echo "$as_me: former value: $ac_old_val" >&2;} { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 echo "$as_me: current value: $ac_new_val" >&2;} ac_cache_corrupted=: fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`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. *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 echo "$as_me: error: changes in the environment can compromise the build" >&2;} { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} { (exit 1); exit 1; }; } 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 x$with_rlm_pam != xno; then 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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}gcc" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="gcc" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}cc" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="$ac_prog" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&5 echo "$as_me: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } # Provide some information about the compiler. echo "$as_me:$LINENO: checking for C compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (ac_try="$ac_compiler --version >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -v >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -V >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out 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. { echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6; } ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # # List of possible output files, starting from the most likely. # The algorithm is not robust to junk in `.', hence go to wildcards (a.*) # only as a last resort. b.out is created by i960 compilers. ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out' # # The IRIX 6 linker writes into existing files which may not be # executable, retaining their permissions. Remove them first so a # subsequent execution test works. ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link_default") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; 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 | *.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 { echo "$as_me:$LINENO: result: $ac_file" >&5 echo "${ECHO_T}$ac_file" >&6; } if test -z "$ac_file"; then echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: C compiler cannot create executables See \`config.log' for more details." >&5 echo "$as_me: error: C compiler cannot create executables See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } fi ac_exeext=$ac_cv_exeext # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { echo "$as_me:$LINENO: checking whether the C compiler works" >&5 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6; } # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then if { ac_try='./$ac_file' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { echo "$as_me:$LINENO: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&5 echo "$as_me: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi fi fi { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } rm -f a.out a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; } { echo "$as_me:$LINENO: result: $cross_compiling" >&5 echo "${ECHO_T}$cross_compiling" >&6; } { echo "$as_me:$LINENO: checking for suffix of executables" >&5 echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; } if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; 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 | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest$ac_cv_exeext { echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 echo "${ECHO_T}$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT { echo "$as_me:$LINENO: checking for suffix of object files" >&5 echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; } if test "${ac_cv_objext+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; 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 ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 echo "${ECHO_T}$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; } if test "${ac_cv_c_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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 { echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; } GCC=`test $ac_compiler_gnu = yes && echo yes` ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CFLAGS="" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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 { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 echo "${ECHO_T}$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 { echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_c89+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_c89=$ac_arg else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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) { echo "$as_me:$LINENO: result: none needed" >&5 echo "${ECHO_T}none needed" >&6; } ;; xno) { echo "$as_me:$LINENO: result: unsupported" >&5 echo "${ECHO_T}unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;; 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 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 { echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if test "${ac_cv_prog_CPP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f 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 { echo "$as_me:$LINENO: result: $CPP" >&5 echo "${ECHO_T}$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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&5 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } 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 { echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6; } if test "${ac_cv_lib_dl_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any 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 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_dl_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dl_dlopen=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6; } if test $ac_cv_lib_dl_dlopen = yes; then pam_ldflags="-ldl" fi { echo "$as_me:$LINENO: checking for pam_start in -lpam" >&5 echo $ECHO_N "checking for pam_start in -lpam... $ECHO_C" >&6; } if test "${ac_cv_lib_pam_pam_start+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpam $pam_ldflags $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any 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 pam_start (); int main () { return pam_start (); ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_pam_pam_start=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_pam_pam_start=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_pam_pam_start" >&5 echo "${ECHO_T}$ac_cv_lib_pam_pam_start" >&6; } if test $ac_cv_lib_pam_pam_start = yes; then pam_ldflags="-lpam $pam_ldflags" else fail=$fail" libpam" fi { echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5 echo $ECHO_N "checking for grep that handles long lines and -e... $ECHO_C" >&6; } if test "${ac_cv_path_GREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Extract the first word of "grep ggrep" to use in msg output if test -z "$GREP"; then set dummy grep ggrep; ac_prog_name=$2 if test "${ac_cv_path_GREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" 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 ac_count=`expr $ac_count + 1` 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 fi GREP="$ac_cv_path_GREP" if test -z "$GREP"; then { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} { (exit 1); exit 1; }; } fi else ac_cv_path_GREP=$GREP fi fi { echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5 echo "${ECHO_T}$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { echo "$as_me:$LINENO: checking for egrep" >&5 echo $ECHO_N "checking for egrep... $ECHO_C" >&6; } if test "${ac_cv_path_EGREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else # Extract the first word of "egrep" to use in msg output if test -z "$EGREP"; then set dummy egrep; ac_prog_name=$2 if test "${ac_cv_path_EGREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" 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 ac_count=`expr $ac_count + 1` 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 fi EGREP="$ac_cv_path_EGREP" if test -z "$EGREP"; then { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} { (exit 1); exit 1; }; } fi else ac_cv_path_EGREP=$EGREP fi fi fi { echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 echo "${ECHO_T}$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" { echo "$as_me:$LINENO: checking for ANSI C header files" >&5 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; } if test "${ac_cv_header_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_header_stdc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* 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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* 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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* 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 rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi { echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 echo "${ECHO_T}$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then cat >>confdefs.h <<\_ACEOF #define STDC_HEADERS 1 _ACEOF 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=`echo "ac_cv_header_$ac_header" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Header=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in \ security/pam_appl.h \ pam/pam_appl.h \ do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? { echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ;; esac { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done pam_cflags="-I." targetname=rlm_pam else targetname= echo \*\*\* module rlm_pam is disabled. fi if test x"$fail" != x""; then if test x"${enable_strict_dependencies}" = x"yes"; then { { echo "$as_me:$LINENO: error: set --without-rlm_pam to disable it explicitly." >&5 echo "$as_me: error: set --without-rlm_pam to disable it explicitly." >&2;} { (exit 1); exit 1; }; } else { echo "$as_me:$LINENO: WARNING: silently not building rlm_pam." >&5 echo "$as_me: WARNING: silently not building rlm_pam." >&2;} { echo "$as_me:$LINENO: WARNING: FAILURE: rlm_pam requires: $fail." >&5 echo "$as_me: WARNING: FAILURE: rlm_pam requires: $fail." >&2;}; targetname="" fi fi ac_config_headers="$ac_config_headers config.h" unset ac_cv_env_LIBS_set unset ac_cv_env_LIBS_value ac_config_files="$ac_config_files 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_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( *) $as_unset $ac_var ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then test "x$cache_file" != "x/dev/null" && { echo "$as_me:$LINENO: updating cache $cache_file" >&5 echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 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= 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=`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. ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs : ${CONFIG_STATUS=./config.status} ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >$CONFIG_STATUS <<_ACEOF #! $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} _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ## --------------------- ## ## 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=: # 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 # PATH needs CR # 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 # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false 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.) as_nl=' ' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. 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 # Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # CDPATH. $as_unset CDPATH as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, and appends # trailing '-' during substitution so that $LINENO is not a special # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # scripts with optimization help from Paolo Bonzini. 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" || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi 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 fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi 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=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 # Save the log message, to keep $[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by $as_me, which was generated by GNU Autoconf 2.61. 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 cat >>$CONFIG_STATUS <<_ACEOF # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ config.status configured by $0, generated by GNU Autoconf 2.61, with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" Copyright (C) 2006 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' _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # If no file are specified by the user, then we need to provide default # value. By we need to know if files were specified by the user. 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=$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 ) echo "$ac_cs_version"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift CONFIG_FILES="$CONFIG_FILES $ac_optarg" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header { echo "$as_me: error: ambiguous option: $1 Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; };; --help | --hel | -h ) 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. -*) { echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *) ac_config_targets="$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 if \$ac_cs_recheck; then echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 CONFIG_SHELL=$SHELL export CONFIG_SHELL exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # 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" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= trap 'exit_status=$? { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status ' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || { echo "$me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } # # Set up the sed scripts for CONFIG_FILES section. # # No need to generate the scripts if there are no CONFIG_FILES. # This happens for instance when ./config.status config.h if test -n "$CONFIG_FILES"; then _ACEOF ac_delim='%!_!# ' for ac_last_try in false false false false false :; do cat >conf$$subs.sed <<_ACEOF SHELL!$SHELL$ac_delim PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim PACKAGE_NAME!$PACKAGE_NAME$ac_delim PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim PACKAGE_STRING!$PACKAGE_STRING$ac_delim PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim exec_prefix!$exec_prefix$ac_delim prefix!$prefix$ac_delim program_transform_name!$program_transform_name$ac_delim bindir!$bindir$ac_delim sbindir!$sbindir$ac_delim libexecdir!$libexecdir$ac_delim datarootdir!$datarootdir$ac_delim datadir!$datadir$ac_delim sysconfdir!$sysconfdir$ac_delim sharedstatedir!$sharedstatedir$ac_delim localstatedir!$localstatedir$ac_delim includedir!$includedir$ac_delim oldincludedir!$oldincludedir$ac_delim docdir!$docdir$ac_delim infodir!$infodir$ac_delim htmldir!$htmldir$ac_delim dvidir!$dvidir$ac_delim pdfdir!$pdfdir$ac_delim psdir!$psdir$ac_delim libdir!$libdir$ac_delim localedir!$localedir$ac_delim mandir!$mandir$ac_delim DEFS!$DEFS$ac_delim ECHO_C!$ECHO_C$ac_delim ECHO_N!$ECHO_N$ac_delim ECHO_T!$ECHO_T$ac_delim LIBS!$LIBS$ac_delim build_alias!$build_alias$ac_delim host_alias!$host_alias$ac_delim target_alias!$target_alias$ac_delim CC!$CC$ac_delim CFLAGS!$CFLAGS$ac_delim LDFLAGS!$LDFLAGS$ac_delim CPPFLAGS!$CPPFLAGS$ac_delim ac_ct_CC!$ac_ct_CC$ac_delim EXEEXT!$EXEEXT$ac_delim OBJEXT!$OBJEXT$ac_delim CPP!$CPP$ac_delim GREP!$GREP$ac_delim EGREP!$EGREP$ac_delim pam_ldflags!$pam_ldflags$ac_delim pam_cflags!$pam_cflags$ac_delim targetname!$targetname$ac_delim LIBOBJS!$LIBOBJS$ac_delim LTLIBOBJS!$LTLIBOBJS$ac_delim _ACEOF if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 52; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` if test -n "$ac_eof"; then ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` ac_eof=`expr $ac_eof + 1` fi cat >>$CONFIG_STATUS <<_ACEOF cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof /@[a-zA-Z_][a-zA-Z_0-9]*@/!b end _ACEOF sed ' s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g s/^/s,@/; s/!/@,|#_!!_#|/ :n t n s/'"$ac_delim"'$/,g/; t s/$/\\/; p N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n ' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF :end s/|#_!!_#|//g CEOF$ac_eof _ACEOF # VPATH may cause trouble with some makes, so we remove $(srcdir), # ${srcdir} and @srcdir@ 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[ ]*=/{ s/:*\$(srcdir):*/:/ s/:*\${srcdir}:*/:/ s/:*@srcdir@:*/:/ s/^\([^=]*=[ ]*\):*/\1/ s/:*$// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF fi # test -n "$CONFIG_FILES" for ac_tag in :F $CONFIG_FILES :H $CONFIG_HEADERS do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5 echo "$as_me: error: Invalid tag $ac_tag." >&2;} { (exit 1); exit 1; }; };; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 echo "$as_me: error: cannot find input file: $ac_f" >&2;} { (exit 1); exit 1; }; };; esac ac_file_inputs="$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 "`IFS=: echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure." if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { echo "$as_me:$LINENO: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} fi case $ac_tag in *:-:* | *:-) cat >"$tmp/stdin";; 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 || 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" case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`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 || 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" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 echo "$as_me: error: cannot create directory $as_dir" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`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 # _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # 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= case `sed -n '/datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p ' $ac_file_inputs` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF 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 sed "$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s&@configure_input@&$configure_input&;t t s&@top_builddir@&$ac_top_builddir_sub&;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 $ac_datarootdir_hack " $ac_file_inputs | sed -f "$tmp/subs-1.sed" >$tmp/out test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&5 echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&2;} rm -f "$tmp/stdin" case $ac_file in -) cat "$tmp/out"; rm -f "$tmp/out";; *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;; esac ;; :H) # # CONFIG_HEADER # _ACEOF # Transform confdefs.h into a sed script `conftest.defines', that # substitutes the proper values into config.h.in to produce config.h. rm -f conftest.defines conftest.tail # First, append a space to every undef/define line, to ease matching. echo 's/$/ /' >conftest.defines # Then, protect against being on the right side of a sed subst, or in # an unquoted here document, in config.status. If some macros were # called several times there might be several #defines for the same # symbol, which is useless. But do not sort them, since the last # AC_DEFINE must be honored. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* # These sed commands are passed to sed as "A NAME B PARAMS C VALUE D", where # NAME is the cpp macro being defined, VALUE is the value it is being given. # PARAMS is the parameter list in the macro definition--in most cases, it's # just an empty string. ac_dA='s,^\\([ #]*\\)[^ ]*\\([ ]*' ac_dB='\\)[ (].*,\\1define\\2' ac_dC=' ' ac_dD=' ,' uniq confdefs.h | sed -n ' t rset :rset s/^[ ]*#[ ]*define[ ][ ]*// t ok d :ok s/[\\&,]/\\&/g s/^\('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/ '"$ac_dA"'\1'"$ac_dB"'\2'"${ac_dC}"'\3'"$ac_dD"'/p s/^\('"$ac_word_re"'\)[ ]*\(.*\)/'"$ac_dA"'\1'"$ac_dB$ac_dC"'\2'"$ac_dD"'/p ' >>conftest.defines # Remove the space that was appended to ease matching. # Then 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. # (The regexp can be short, since the line contains either #define or #undef.) echo 's/ $// s,^[ #]*u.*,/* & */,' >>conftest.defines # Break up conftest.defines: ac_max_sed_lines=50 # First sed command is: sed -f defines.sed $ac_file_inputs >"$tmp/out1" # Second one is: sed -f defines.sed "$tmp/out1" >"$tmp/out2" # Third one will be: sed -f defines.sed "$tmp/out2" >"$tmp/out1" # et cetera. ac_in='$ac_file_inputs' ac_out='"$tmp/out1"' ac_nxt='"$tmp/out2"' while : do # Write a here document: cat >>$CONFIG_STATUS <<_ACEOF # First, check the format of the line: cat >"\$tmp/defines.sed" <<\\CEOF /^[ ]*#[ ]*undef[ ][ ]*$ac_word_re[ ]*\$/b def /^[ ]*#[ ]*define[ ][ ]*$ac_word_re[( ]/b def b :def _ACEOF sed ${ac_max_sed_lines}q conftest.defines >>$CONFIG_STATUS echo 'CEOF sed -f "$tmp/defines.sed"' "$ac_in >$ac_out" >>$CONFIG_STATUS ac_in=$ac_out; ac_out=$ac_nxt; ac_nxt=$ac_in sed 1,${ac_max_sed_lines}d conftest.defines >conftest.tail grep . conftest.tail >/dev/null || break rm -f conftest.defines mv conftest.tail conftest.defines done rm -f conftest.defines conftest.tail echo "ac_result=$ac_in" >>$CONFIG_STATUS cat >>$CONFIG_STATUS <<\_ACEOF if test x"$ac_file" != x-; then echo "/* $configure_input */" >"$tmp/config.h" cat "$ac_result" >>"$tmp/config.h" if diff $ac_file "$tmp/config.h" >/dev/null 2>&1; then { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 echo "$as_me: $ac_file is unchanged" >&6;} else rm -f $ac_file mv "$tmp/config.h" $ac_file fi else echo "/* $configure_input */" cat "$ac_result" fi rm -f "$tmp/out12" ;; esac done # for ac_tag { (exit 0); exit 0; } _ACEOF chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save # 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 || { (exit 1); exit 1; } fi freeradius-server/src/modules/rlm_pam/configure.in000066400000000000000000000017641257552170400227320ustar00rootroot00000000000000AC_PREREQ([2.53]) AC_INIT(rlm_pam.c) AC_REVISION($Revision$) AC_DEFUN(modname,[rlm_pam]) if test x$with_[]modname != xno; then AC_PROG_CC AC_PROG_CPP AC_CHECK_LIB(dl, dlopen, [ pam_ldflags="-ldl" ] ) AC_CHECK_LIB(pam, pam_start, [ pam_ldflags="-lpam $pam_ldflags" ], [ fail=$fail" libpam" ], [ $pam_ldflags ] ) dnl # dnl # Yes, these DO have to be on seperate lines, dnl # otherwise autoheader won't pick them up. dnl # AC_CHECK_HEADERS( \ security/pam_appl.h \ pam/pam_appl.h \ ) pam_cflags="-I." targetname=modname else targetname= echo \*\*\* module modname is disabled. fi if test x"$fail" != x""; then if test x"${enable_strict_dependencies}" = x"yes"; then AC_MSG_ERROR([set --without-]modname[ to disable it explicitly.]) else AC_MSG_WARN([silently not building ]modname[.]) AC_MSG_WARN([FAILURE: ]modname[ requires: $fail.]); targetname="" fi fi AC_SUBST(pam_ldflags) AC_SUBST(pam_cflags) AC_SUBST(targetname) AC_CONFIG_HEADER(config.h) AC_OUTPUT(Makefile) freeradius-server/src/modules/rlm_pam/rlm_pam.c000066400000000000000000000176671257552170400222250ustar00rootroot00000000000000/* * pam.c Functions to access the PAM library. This was taken * from the hacks that miguel a.l. paraz * did on radiusd-cistron-1.5.3 and migrated to a * separate file. * * That, in fact, was again based on the original stuff * from Jeph Blaize done in May 1997. * * Version: $Id$ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2000,2006 The FreeRADIUS server project * Copyright 1997 Jeph Blaize * Copyright 1999 miguel a.l. paraz */ #include RCSID("$Id$") #include #include #include "config.h" #ifdef HAVE_SECURITY_PAM_APPL_H #include #endif #ifdef HAVE_PAM_PAM_APPL_H #include #endif #ifdef HAVE_SYSLOG_H #include #endif typedef struct rlm_pam_t { const char *pam_auth_name; } rlm_pam_t; static const CONF_PARSER module_config[] = { { "pam_auth", PW_TYPE_STRING_PTR, offsetof(rlm_pam_t,pam_auth_name), NULL, "radiusd" }, { NULL, -1, 0, NULL, NULL } }; /* * (Re-)read radiusd.conf into memory. */ static int pam_instantiate(CONF_SECTION *conf, void **instance) { rlm_pam_t *data; data = rad_malloc(sizeof(*data)); if (!data) { return -1; } memset(data, 0, sizeof(*data)); if (cf_section_parse(conf, data, module_config) < 0) { free(data); return -1; } *instance = data; return 0; } /* * Clean up. */ static int pam_detach(void *instance) { rlm_pam_t *data = (rlm_pam_t *) instance; free((char *) data); return 0; } /************************************************************************* * * Function: PAM_conv * * Purpose: Dialogue between RADIUS and PAM modules. * * jab - stolen from pop3d * * Alan DeKok: modified to use PAM's appdata_ptr, so that we're * multi-threaded safe, and don't have any nasty static * variables hanging around. * *************************************************************************/ typedef struct my_PAM { const char *username; const char *password; int error; } my_PAM; static int PAM_conv (int num_msg, const struct pam_message **msg, struct pam_response **resp, void *appdata_ptr) { int count; struct pam_response *reply; my_PAM *pam_config = (my_PAM *) appdata_ptr; /* strdup(NULL) doesn't work on some platforms */ #define COPY_STRING(s) ((s) ? strdup(s) : NULL) reply = rad_malloc(num_msg * sizeof(struct pam_response)); memset(reply, 0, num_msg * sizeof(struct pam_response)); for (count = 0; count < num_msg; count++) { switch (msg[count]->msg_style) { case PAM_PROMPT_ECHO_ON: reply[count].resp_retcode = PAM_SUCCESS; reply[count].resp = COPY_STRING(pam_config->username); break; case PAM_PROMPT_ECHO_OFF: reply[count].resp_retcode = PAM_SUCCESS; reply[count].resp = COPY_STRING(pam_config->password); break; case PAM_TEXT_INFO: /* ignore it... */ break; case PAM_ERROR_MSG: default: /* Must be an error of some sort... */ for (count = 0; count < num_msg; count++) { if (reply[count].resp) { /* could be a password, let's be sanitary */ memset(reply[count].resp, 0, strlen(reply[count].resp)); free(reply[count].resp); } } free(reply); pam_config->error = 1; return PAM_CONV_ERR; } } *resp = reply; /* PAM frees reply (including reply[].resp) */ return PAM_SUCCESS; } /************************************************************************* * * Function: pam_pass * * Purpose: Check the users password against the standard UNIX * password table + PAM. * * jab start 19970529 *************************************************************************/ /* cjd 19980706 * * for most flexibility, passing a pamauth type to this function * allows you to have multiple authentication types (i.e. multiple * files associated with radius in /etc/pam.d) */ static int pam_pass(const char *name, const char *passwd, const char *pamauth) { pam_handle_t *pamh=NULL; int retval; my_PAM pam_config; struct pam_conv conv; /* * Initialize the structures. */ conv.conv = PAM_conv; conv.appdata_ptr = &pam_config; pam_config.username = name; pam_config.password = passwd; pam_config.error = 0; DEBUG("pam_pass: using pamauth string <%s> for pam.conf lookup", pamauth); retval = pam_start(pamauth, name, &conv, &pamh); if (retval != PAM_SUCCESS) { DEBUG("pam_pass: function pam_start FAILED for <%s>. Reason: %s", name, pam_strerror(pamh, retval)); return -1; } retval = pam_authenticate(pamh, 0); if (retval != PAM_SUCCESS) { DEBUG("pam_pass: function pam_authenticate FAILED for <%s>. Reason: %s", name, pam_strerror(pamh, retval)); pam_end(pamh, retval); return -1; } /* * FreeBSD 3.x doesn't have account and session management * functions in PAM, while 4.0 does. */ #if !defined(__FreeBSD_version) || (__FreeBSD_version >= 400000) retval = pam_acct_mgmt(pamh, 0); if (retval != PAM_SUCCESS) { DEBUG("pam_pass: function pam_acct_mgmt FAILED for <%s>. Reason: %s", name, pam_strerror(pamh, retval)); pam_end(pamh, retval); return -1; } #endif DEBUG("pam_pass: authentication succeeded for <%s>", name); pam_end(pamh, retval); return 0; } /* translate between function declarations */ static int pam_auth(void *instance, REQUEST *request) { int r; VALUE_PAIR *pair; rlm_pam_t *data = (rlm_pam_t *) instance; const char *pam_auth_string = data->pam_auth_name; /* * We can only authenticate user requests which HAVE * a User-Name attribute. */ if (!request->username) { radlog(L_AUTH, "rlm_pam: Attribute \"User-Name\" is required for authentication."); return RLM_MODULE_INVALID; } /* * We can only authenticate user requests which HAVE * a User-Password attribute. */ if (!request->password) { radlog(L_AUTH, "rlm_pam: Attribute \"User-Password\" is required for authentication."); return RLM_MODULE_INVALID; } /* * Ensure that we're being passed a plain-text password, * and not anything else. */ if (request->password->attribute != PW_USER_PASSWORD) { radlog(L_AUTH, "rlm_pam: Attribute \"User-Password\" is required for authentication. Cannot use \"%s\".", request->password->name); return RLM_MODULE_INVALID; } /* * Let the 'users' file over-ride the PAM auth name string, * for backwards compatibility. */ pair = pairfind(request->config_items, PAM_AUTH_ATTR); if (pair) pam_auth_string = (char *)pair->vp_strvalue; r = pam_pass((char *)request->username->vp_strvalue, (char *)request->password->vp_strvalue, pam_auth_string); if (r == 0) { return RLM_MODULE_OK; } return RLM_MODULE_REJECT; } module_t rlm_pam = { RLM_MODULE_INIT, "pam", RLM_TYPE_THREAD_UNSAFE, /* The PAM libraries are not thread-safe */ pam_instantiate, /* instantiation */ pam_detach, /* detach */ { pam_auth, /* authenticate */ NULL, /* authorize */ NULL, /* pre-accounting */ NULL, /* accounting */ NULL, /* checksimul */ NULL, /* pre-proxy */ NULL, /* post-proxy */ NULL /* post-auth */ }, }; freeradius-server/src/modules/rlm_pap/000077500000000000000000000000001257552170400204145ustar00rootroot00000000000000freeradius-server/src/modules/rlm_pap/Makefile000066400000000000000000000001461257552170400220550ustar00rootroot00000000000000# # Makefile # # Version: $Id$ # TARGET = rlm_pap SRCS = rlm_pap.c include ../rules.mak freeradius-server/src/modules/rlm_pap/rlm_pap.c000066400000000000000000000542011257552170400222140ustar00rootroot00000000000000/* * rlm_pap.c * * Version: $Id$ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2001,2006 The FreeRADIUS server project * Copyright 2001 Kostas Kalevras */ #include RCSID("$Id$") #include #include #include #include "../../include/md5.h" #include "../../include/sha1.h" #define PAP_ENC_INVALID -1 #define PAP_ENC_CLEAR 0 #define PAP_ENC_CRYPT 1 #define PAP_ENC_MD5 2 #define PAP_ENC_SHA1 3 #define PAP_ENC_NT 4 #define PAP_ENC_LM 5 #define PAP_ENC_SMD5 6 #define PAP_ENC_SSHA 7 #define PAP_ENC_NS_MTA_MD5 8 #define PAP_ENC_AUTO 9 #define PAP_MAX_ENC 9 /* * Define a structure for our module configuration. * * These variables do not need to be in a structure, but it's * a lot cleaner to do so, and a pointer to the structure can * be used as the instance handle. */ typedef struct rlm_pap_t { const char *name; /* CONF_SECTION->name, not strdup'd */ char *scheme; /* password encryption scheme */ int sch; char norm_passwd; int auto_header; int auth_type; } rlm_pap_t; /* * A mapping of configuration file names to internal variables. * * Note that the string is dynamically allocated, so it MUST * be freed. When the configuration file parse re-reads the string, * it free's the old one, and strdup's the new one, placing the pointer * to the strdup'd string into 'config.string'. This gets around * buffer over-flows. */ static const CONF_PARSER module_config[] = { { "encryption_scheme", PW_TYPE_STRING_PTR, offsetof(rlm_pap_t,scheme), NULL, "auto" }, { "auto_header", PW_TYPE_BOOLEAN, offsetof(rlm_pap_t,auto_header), NULL, "no" }, { NULL, -1, 0, NULL, NULL } }; static const FR_NAME_NUMBER schemes[] = { { "clear", PAP_ENC_CLEAR }, { "crypt", PAP_ENC_CRYPT }, { "md5", PAP_ENC_MD5 }, { "sha1", PAP_ENC_SHA1 }, { "nt", PAP_ENC_NT }, { "lm", PAP_ENC_LM }, { "smd5", PAP_ENC_SMD5 }, { "ssha", PAP_ENC_SSHA }, { "auto", PAP_ENC_AUTO }, { NULL, PAP_ENC_INVALID } }; /* * For auto-header discovery. */ static const FR_NAME_NUMBER header_names[] = { { "{clear}", PW_CLEARTEXT_PASSWORD }, { "{cleartext}", PW_CLEARTEXT_PASSWORD }, { "{md5}", PW_MD5_PASSWORD }, { "{BASE64_MD5}", PW_MD5_PASSWORD }, { "{smd5}", PW_SMD5_PASSWORD }, { "{crypt}", PW_CRYPT_PASSWORD }, { "{sha}", PW_SHA_PASSWORD }, { "{ssha}", PW_SSHA_PASSWORD }, { "{nt}", PW_NT_PASSWORD }, { "{md4}", PW_NT_PASSWORD }, { "{nthash}", PW_NT_PASSWORD }, { "{x-nthash}", PW_NT_PASSWORD }, { "{ns-mta-md5}", PW_NS_MTA_MD5_PASSWORD }, { "{x- orcllmv}", PW_LM_PASSWORD }, { "{X- ORCLNTV}", PW_NT_PASSWORD }, { NULL, 0 } }; static int pap_detach(void *instance) { rlm_pap_t *inst = (rlm_pap_t *) instance; free(inst); return 0; } static int pap_instantiate(CONF_SECTION *conf, void **instance) { rlm_pap_t *inst; DICT_VALUE *dval; /* * Set up a storage area for instance data */ inst = rad_malloc(sizeof(*inst)); if (!inst) { return -1; } memset(inst, 0, sizeof(*inst)); /* * If the configuration parameters can't be parsed, then * fail. */ if (cf_section_parse(conf, inst, module_config) < 0) { pap_detach(inst); return -1; } if (!inst->scheme || !*inst->scheme) { radlog(L_ERR, "rlm_pap: No scheme defined"); pap_detach(inst); return -1; } inst->sch = fr_str2int(schemes, inst->scheme, PAP_ENC_INVALID); if (inst->sch == PAP_ENC_INVALID) { radlog(L_ERR, "rlm_pap: Unknown scheme \"%s\"", inst->scheme); pap_detach(inst); return -1; } inst->name = cf_section_name2(conf); if (!inst->name) { inst->name = cf_section_name1(conf); } dval = dict_valbyname(PW_AUTH_TYPE, inst->name); if (dval) { inst->auth_type = dval->value; } else { inst->auth_type = 0; } *instance = inst; return 0; } /* * Decode one base64 chunk */ static int decode_it(const char *src, uint8_t *dst) { int i; unsigned int x = 0; for(i = 0; i < 4; i++) { if (src[i] >= 'A' && src[i] <= 'Z') x = (x << 6) + (unsigned int)(src[i] - 'A' + 0); else if (src[i] >= 'a' && src[i] <= 'z') x = (x << 6) + (unsigned int)(src[i] - 'a' + 26); else if(src[i] >= '0' && src[i] <= '9') x = (x << 6) + (unsigned int)(src[i] - '0' + 52); else if(src[i] == '+') x = (x << 6) + 62; else if (src[i] == '/') x = (x << 6) + 63; else if (src[i] == '=') x = (x << 6); else return 0; } dst[2] = (unsigned char)(x & 255); x >>= 8; dst[1] = (unsigned char)(x & 255); x >>= 8; dst[0] = (unsigned char)(x & 255); return 1; } /* * Base64 decoding. */ static int base64_decode (const char *src, uint8_t *dst) { int length, equals; int i, num; uint8_t last[3]; length = equals = 0; while (src[length] && src[length] != '=') length++; while (src[length + equals] == '=') equals++; num = (length + equals) / 4; if (!num || (num > MAX_STRING_LEN)) return 0; for (i = 0; i < num - 1; i++) { if (!decode_it(src, dst)) return 0; src += 4; dst += 3; } decode_it(src, last); for (i = 0; i < (3 - equals); i++) { dst[i] = last[i]; } return (num * 3) - equals; } /* * Hex or base64 or bin auto-discovery. */ static void normify(REQUEST *request, VALUE_PAIR *vp, size_t min_length) { size_t decoded; uint8_t buffer[256]; char raw[sizeof(vp->vp_strvalue) + 1]; char *value; if (min_length >= sizeof(buffer)) return; /* paranoia */ /* * fr_hex2bin and base64_decode don't deal well with non * \0 terminated buffers. */ if (vp->type == PW_TYPE_OCTETS) { if (vp->length >= sizeof(raw)) return; memcpy(raw, vp->vp_octets, vp->length); raw[vp->length] = '\0'; value = raw; } else if (vp->type == PW_TYPE_STRING) { value = vp->vp_strvalue; } else { return; } /* * Hex encoding. */ if (vp->length >= (2 * min_length)) { decoded = fr_hex2bin(value, buffer, sizeof(buffer)); if (decoded == (vp->length >> 1)) { RDEBUG2("Normalizing %s from hex encoding", vp->name); memcpy(vp->vp_octets, buffer, decoded); vp->length = decoded; return; } } /* * Base 64 encoding. It's at least 4/3 the original size, * and we want to avoid division... */ if (((vp->length * 3) >= ((min_length * 4))) && ((decoded = base64_decode(value, buffer)) > 0) && (decoded >= min_length)) { RDEBUG2("Normalizing %s from base64 encoding", vp->name); memcpy(vp->vp_octets, buffer, decoded); vp->length = decoded; return; } /* * Else unknown encoding, or already binary. Leave it. */ } /* * Authorize the user for PAP authentication. * * This isn't strictly necessary, but it does make the * server simpler to configure. */ static int pap_authorize(void *instance, REQUEST *request) { rlm_pap_t *inst = instance; int auth_type = FALSE; int found_pw = FALSE; VALUE_PAIR *vp, *next; for (vp = request->config_items; vp != NULL; vp = next) { next = vp->next; switch (vp->attribute) { case PW_USER_PASSWORD: /* deprecated */ found_pw = TRUE; /* * Look for '{foo}', and use them */ if (!inst->auto_header || (vp->vp_strvalue[0] != '{')) { break; } /* FALL-THROUGH */ case PW_PASSWORD_WITH_HEADER: /* preferred */ { int attr; char *p, *q; char buffer[128]; VALUE_PAIR *new_vp; found_pw = TRUE; redo: q = vp->vp_strvalue; p = strchr(q + 1, '}'); if (!p) { int decoded; /* * Password already exists: use * that instead of this one. */ if (pairfind(request->config_items, PW_USER_PASSWORD) || pairfind(request->config_items, PW_CLEARTEXT_PASSWORD)) { RDEBUG("Config already contains \"known good\" password. Ignoring Password-With-Header"); break; } /* * If it's binary, it may be * base64 encoded. Decode it, * and re-write the attribute to * have the decoded value. */ decoded = base64_decode(vp->vp_strvalue, buffer); if ((decoded > 0) && (buffer[0] == '{') && (strchr(buffer, '}') != NULL)) { memcpy(vp->vp_octets, buffer, decoded); vp->length = decoded; goto redo; } RDEBUG("No {...} in Password-With-Header = \"%s\", re-writing to Cleartext-Password", vp->vp_strvalue); radius_pairmake(request, &request->config_items, "Cleartext-Password", vp->vp_strvalue, T_OP_SET); break; } if ((size_t) (p - q) > sizeof(buffer)) break; memcpy(buffer, q, p - q + 1); buffer[p - q + 1] = '\0'; attr = fr_str2int(header_names, buffer, 0); if (!attr) { RDEBUG2("Found unknown header {%s}: Not doing anything", buffer); break; } new_vp = radius_paircreate(request, &request->config_items, attr, PW_TYPE_STRING); /* * The data after the '}' may be binary, * so we copy it via memcpy. */ new_vp->length = vp->length; new_vp->length -= (p - q + 1); memcpy(new_vp->vp_strvalue, p + 1, new_vp->length); /* * May be old-style User-Password with header. * We've found the header & created the proper * attribute, so we should delete the old * User-Password here. */ pairdelete(&request->config_items, PW_USER_PASSWORD); } break; case PW_CLEARTEXT_PASSWORD: case PW_CRYPT_PASSWORD: case PW_NS_MTA_MD5_PASSWORD: found_pw = TRUE; break; /* don't touch these */ case PW_MD5_PASSWORD: case PW_SMD5_PASSWORD: case PW_NT_PASSWORD: case PW_LM_PASSWORD: normify(request, vp, 16); /* ensure it's in the right format */ found_pw = TRUE; break; case PW_SHA_PASSWORD: case PW_SSHA_PASSWORD: normify(request, vp, 20); /* ensure it's in the right format */ found_pw = TRUE; break; /* * If it's proxied somewhere, don't complain * about not having passwords or Auth-Type. */ case PW_PROXY_TO_REALM: { REALM *realm = realm_find(vp->vp_strvalue); if (realm && realm->auth_pool) { return RLM_MODULE_NOOP; } break; } case PW_AUTH_TYPE: auth_type = TRUE; /* * Auth-Type := Accept * Auth-Type := Reject */ if ((vp->vp_integer == 254) || (vp->vp_integer == 4)) { found_pw = 1; } break; default: break; /* ignore it */ } } /* * Print helpful warnings if there was no password. */ if (!found_pw) { /* * Likely going to be proxied. Avoid printing * warning message. */ if (pairfind(request->config_items, PW_REALM) || (pairfind(request->config_items, PW_PROXY_TO_REALM))) { return RLM_MODULE_NOOP; } /* * The TLS types don't need passwords. */ vp = pairfind(request->packet->vps, PW_EAP_TYPE); if (vp && ((vp->vp_integer == 13) || /* EAP-TLS */ (vp->vp_integer == 21) || /* EAP-TTLS */ (vp->vp_integer == 25))) { /* PEAP */ return RLM_MODULE_NOOP; } RDEBUG("WARNING! No \"known good\" password found for the user. Authentication may fail because of this."); return RLM_MODULE_NOOP; } /* * Don't touch existing Auth-Types. */ if (auth_type) { RDEBUG2("WARNING: Auth-Type already set. Not setting to PAP"); return RLM_MODULE_NOOP; } /* * Can't do PAP if there's no password. */ if (!request->password || (request->password->attribute != PW_USER_PASSWORD)) { /* * Don't print out debugging messages if we know * they're useless. */ if (request->packet->code == PW_ACCESS_CHALLENGE) { return RLM_MODULE_NOOP; } RDEBUG2("No User-Password attribute in the request. Cannot do PAP."); return RLM_MODULE_NOOP; } if (inst->auth_type) { vp = radius_paircreate(request, &request->config_items, PW_AUTH_TYPE, PW_TYPE_INTEGER); vp->vp_integer = inst->auth_type; } return RLM_MODULE_UPDATED; } /* * Authenticate the user via one of any well-known password. */ static int pap_authenticate(void *instance, REQUEST *request) { rlm_pap_t *inst = instance; VALUE_PAIR *vp; VALUE_PAIR *module_fmsg_vp; char module_fmsg[MAX_STRING_LEN]; FR_MD5_CTX md5_context; fr_SHA1_CTX sha1_context; uint8_t digest[40]; char buff[MAX_STRING_LEN]; char buff2[MAX_STRING_LEN + 50]; int scheme = PAP_ENC_INVALID; if (!request->password || (request->password->attribute != PW_USER_PASSWORD)) { RDEBUG("ERROR: You set 'Auth-Type = PAP' for a request that does not contain a User-Password attribute!"); return RLM_MODULE_INVALID; } /* * The user MUST supply a non-zero-length password. */ if (request->password->length == 0) { snprintf(module_fmsg,sizeof(module_fmsg),"rlm_pap: empty password supplied"); module_fmsg_vp = pairmake("Module-Failure-Message", module_fmsg, T_OP_EQ); pairadd(&request->packet->vps, module_fmsg_vp); return RLM_MODULE_INVALID; } RDEBUG("login attempt with password \"%s\"", request->password->vp_strvalue); /* * First, auto-detect passwords, by attribute in the * config items. */ if (inst->sch == PAP_ENC_AUTO) { for (vp = request->config_items; vp != NULL; vp = vp->next) { switch (vp->attribute) { case PW_USER_PASSWORD: /* deprecated */ case PW_CLEARTEXT_PASSWORD: /* preferred */ goto do_clear; case PW_CRYPT_PASSWORD: goto do_crypt; case PW_MD5_PASSWORD: goto do_md5; case PW_SHA_PASSWORD: goto do_sha; case PW_NT_PASSWORD: goto do_nt; case PW_LM_PASSWORD: goto do_lm; case PW_SMD5_PASSWORD: goto do_smd5; case PW_SSHA_PASSWORD: goto do_ssha; case PW_NS_MTA_MD5_PASSWORD: goto do_ns_mta_md5; default: break; /* ignore it */ } } fail: RDEBUG("No password configured for the user. Cannot do authentication"); return RLM_MODULE_FAIL; } else { vp = NULL; if (inst->sch == PAP_ENC_CRYPT) { vp = pairfind(request->config_items, PW_CRYPT_PASSWORD); } /* * Old-style: all passwords are in User-Password. */ if (!vp) { vp = pairfind(request->config_items, PW_USER_PASSWORD); if (!vp) goto fail; } } /* * Now that we've decided what to do, go do it. */ switch (scheme) { case PAP_ENC_CLEAR: do_clear: RDEBUG("Using clear text password \"%s\"", vp->vp_strvalue); if ((vp->length != request->password->length) || (rad_digest_cmp(vp->vp_strvalue, request->password->vp_strvalue, vp->length) != 0)) { snprintf(module_fmsg,sizeof(module_fmsg),"rlm_pap: CLEAR TEXT password check failed"); goto make_msg; } done: RDEBUG("User authenticated successfully"); return RLM_MODULE_OK; break; case PAP_ENC_CRYPT: do_crypt: RDEBUG("Using CRYPT password \"%s\"", vp->vp_strvalue); if (fr_crypt_check(request->password->vp_strvalue, vp->vp_strvalue) != 0) { snprintf(module_fmsg,sizeof(module_fmsg),"rlm_pap: CRYPT password check failed"); goto make_msg; } goto done; break; case PW_MD5_PASSWORD: do_md5: RDEBUG("Using MD5 encryption."); normify(request, vp, 16); if (vp->length != 16) { RDEBUG("Configured MD5 password has incorrect length"); snprintf(module_fmsg,sizeof(module_fmsg),"rlm_pap: Configured MD5 password has incorrect length"); goto make_msg; } fr_MD5Init(&md5_context); fr_MD5Update(&md5_context, request->password->vp_octets, request->password->length); fr_MD5Final(digest, &md5_context); if (rad_digest_cmp(digest, vp->vp_octets, vp->length) != 0) { snprintf(module_fmsg,sizeof(module_fmsg),"rlm_pap: MD5 password check failed"); goto make_msg; } goto done; break; case PW_SMD5_PASSWORD: do_smd5: RDEBUG("Using SMD5 encryption."); normify(request, vp, 16); if (vp->length <= 16) { RDEBUG("Configured SMD5 password has incorrect length"); snprintf(module_fmsg,sizeof(module_fmsg),"rlm_pap: Configured SMD5 password has incorrect length"); goto make_msg; } fr_MD5Init(&md5_context); fr_MD5Update(&md5_context, request->password->vp_octets, request->password->length); fr_MD5Update(&md5_context, &vp->vp_octets[16], vp->length - 16); fr_MD5Final(digest, &md5_context); /* * Compare only the MD5 hash results, not the salt. */ if (rad_digest_cmp(digest, vp->vp_octets, 16) != 0) { snprintf(module_fmsg,sizeof(module_fmsg),"rlm_pap: SMD5 password check failed"); goto make_msg; } goto done; break; case PW_SHA_PASSWORD: do_sha: RDEBUG("Using SHA1 encryption."); normify(request, vp, 20); if (vp->length != 20) { RDEBUG("Configured SHA1 password has incorrect length"); snprintf(module_fmsg,sizeof(module_fmsg),"rlm_pap: Configured SHA1 password has incorrect length"); goto make_msg; } fr_SHA1Init(&sha1_context); fr_SHA1Update(&sha1_context, request->password->vp_octets, request->password->length); fr_SHA1Final(digest,&sha1_context); if (rad_digest_cmp(digest, vp->vp_octets, vp->length) != 0) { snprintf(module_fmsg,sizeof(module_fmsg),"rlm_pap: SHA1 password check failed"); goto make_msg; } goto done; break; case PW_SSHA_PASSWORD: do_ssha: RDEBUG("Using SSHA encryption."); normify(request, vp, 20); if (vp->length <= 20) { RDEBUG("Configured SSHA password has incorrect length"); snprintf(module_fmsg,sizeof(module_fmsg),"rlm_pap: Configured SHA password has incorrect length"); goto make_msg; } fr_SHA1Init(&sha1_context); fr_SHA1Update(&sha1_context, request->password->vp_octets, request->password->length); fr_SHA1Update(&sha1_context, &vp->vp_octets[20], vp->length - 20); fr_SHA1Final(digest,&sha1_context); if (rad_digest_cmp(digest, vp->vp_octets, 20) != 0) { snprintf(module_fmsg,sizeof(module_fmsg),"rlm_pap: SSHA password check failed"); goto make_msg; } goto done; break; case PW_NT_PASSWORD: do_nt: RDEBUG("Using NT encryption."); normify(request, vp, 16); if (vp->length != 16) { RDEBUG("Configured NT-Password has incorrect length"); snprintf(module_fmsg,sizeof(module_fmsg),"rlm_pap: Configured NT-Password has incorrect length"); goto make_msg; } strlcpy(buff2, "%{mschap:NT-Hash %{User-Password}}", sizeof(buff2)); if (!radius_xlat(digest, sizeof(digest),buff2,request,NULL)){ RDEBUG("mschap xlat failed"); snprintf(module_fmsg,sizeof(module_fmsg),"rlm_pap: mschap xlat failed"); goto make_msg; } if ((fr_hex2bin(digest, digest, 16) != vp->length) || (rad_digest_cmp(digest, vp->vp_octets, vp->length) != 0)) { snprintf(module_fmsg,sizeof(module_fmsg),"rlm_pap: NT password check failed"); goto make_msg; } goto done; break; case PW_LM_PASSWORD: do_lm: RDEBUG("Using LM encryption."); normify(request, vp, 16); if (vp->length != 16) { RDEBUG("Configured LM-Password has incorrect length"); snprintf(module_fmsg,sizeof(module_fmsg),"rlm_pap: Configured LM-Password has incorrect length"); goto make_msg; } strlcpy(buff2, "%{mschap:LM-Hash %{User-Password}}", sizeof(buff2)); if (!radius_xlat(digest,sizeof(digest),buff2,request,NULL)){ RDEBUG("mschap xlat failed"); snprintf(module_fmsg,sizeof(module_fmsg),"rlm_pap: mschap xlat failed"); goto make_msg; } if ((fr_hex2bin(digest, digest, 16) != vp->length) || (rad_digest_cmp(digest, vp->vp_octets, vp->length) != 0)) { snprintf(module_fmsg,sizeof(module_fmsg),"rlm_pap: LM password check failed"); make_msg: RDEBUG("Passwords don't match"); module_fmsg_vp = pairmake("Module-Failure-Message", module_fmsg, T_OP_EQ); pairadd(&request->packet->vps, module_fmsg_vp); return RLM_MODULE_REJECT; } goto done; break; case PAP_ENC_NS_MTA_MD5: do_ns_mta_md5: RDEBUG("Using NT-MTA-MD5 password"); if (vp->length != 64) { RDEBUG("Configured NS-MTA-MD5-Password has incorrect length"); snprintf(module_fmsg,sizeof(module_fmsg),"rlm_pap: Configured NS-MTA-MD5-Password has incorrect length"); goto make_msg; } /* * Sanity check the value of NS-MTA-MD5-Password */ if (fr_hex2bin(vp->vp_strvalue, buff, 32) != 16) { RDEBUG("Configured NS-MTA-MD5-Password has invalid value"); snprintf(module_fmsg,sizeof(module_fmsg),"rlm_pap: Configured NS-MTA-MD5-Password has invalid value"); goto make_msg; } /* * Ensure we don't have buffer overflows. * * This really: sizeof(buff) - 2 - 2*32 - strlen(passwd) */ if (strlen(request->password->vp_strvalue) >= (sizeof(buff2) - 2 - 2 * 32)) { RDEBUG("Configured password is too long"); snprintf(module_fmsg,sizeof(module_fmsg),"rlm_pap: password is too long"); goto make_msg; } /* * Set up the algorithm. */ { char *p = buff2; memcpy(p, &vp->vp_octets[32], 32); p += 32; *(p++) = 89; strcpy(p, request->password->vp_strvalue); p += strlen(p); *(p++) = 247; memcpy(p, &vp->vp_octets[32], 32); p += 32; fr_MD5Init(&md5_context); fr_MD5Update(&md5_context, (uint8_t *) buff2, p - buff2); fr_MD5Final(digest, &md5_context); } if (rad_digest_cmp(digest, buff, 16) != 0) { snprintf(module_fmsg,sizeof(module_fmsg),"rlm_pap: NS-MTA-MD5 password check failed"); goto make_msg; } goto done; default: break; } RDEBUG("No password configured for the user. Cannot do authentication"); return RLM_MODULE_FAIL; } /* * The module name should be the only globally exported symbol. * That is, everything else should be 'static'. * * If the module needs to temporarily modify it's instantiation * data, the type should be changed to RLM_TYPE_THREAD_UNSAFE. * The server will then take care of ensuring that the module * is single-threaded. */ module_t rlm_pap = { RLM_MODULE_INIT, "PAP", RLM_TYPE_CHECK_CONFIG_SAFE | RLM_TYPE_HUP_SAFE, /* type */ pap_instantiate, /* instantiation */ pap_detach, /* detach */ { pap_authenticate, /* authentication */ pap_authorize, /* authorization */ NULL, /* preaccounting */ NULL, /* accounting */ NULL, /* checksimul */ NULL, /* pre-proxy */ NULL, /* post-proxy */ NULL /* post-auth */ }, }; freeradius-server/src/modules/rlm_passwd/000077500000000000000000000000001257552170400211355ustar00rootroot00000000000000freeradius-server/src/modules/rlm_passwd/Makefile000066400000000000000000000001521257552170400225730ustar00rootroot00000000000000# # Makefile # # Version: $Id$ # TARGET = rlm_passwd SRCS = rlm_passwd.c include ../rules.mak freeradius-server/src/modules/rlm_passwd/rlm_passwd.c000066400000000000000000000365221257552170400234640ustar00rootroot00000000000000/* * rlm_passwd.c * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2000,2006 The FreeRADIUS server project */ #include RCSID("$Id$") #include #include struct mypasswd { struct mypasswd *next; char *listflag; char *field[1]; }; struct hashtable { int tablesize; int keyfield; int nfields; int islist; int ignorenis; char * filename; struct mypasswd **table; char buffer[1024]; FILE *fp; char delimiter; }; #ifdef TEST #define rad_malloc(s) malloc(s) void printpw(struct mypasswd *pw, int nfields){ int i; if (pw) { for( i = 0; i < nfields; i++ ) printf("%s:", pw->field[i]); printf("\n"); } else printf ("Not found\n"); fflush(stdout); } #endif static struct mypasswd * mypasswd_malloc(const char* buffer, int nfields, size_t* len) { struct mypasswd *t; /* reserve memory for (struct mypasswd) + listflag (nfields * sizeof (char*)) + ** fields (nfields * sizeof (char)) + strlen (inst->format) + 1 */ *len=sizeof (struct mypasswd) + nfields * sizeof (char*) + nfields * sizeof (char ) + strlen(buffer) + 1; t = (struct mypasswd *) rad_malloc(*len); if (t) memset(t, 0, *len); return (t); } static int string_to_entry(const char* string, int nfields, char delimiter, struct mypasswd *passwd, size_t bufferlen) { char *str; size_t len, i; int fn=0; char *data_beg; len = strlen(string); if(!len) return 0; if (string[len-1] == '\n') len--; if(!len) return 0; if (string[len-1] == '\r') len--; if(!len) return 0; if (!len || !passwd || bufferlen < (len + nfields * sizeof (char*) + nfields * sizeof (char) + sizeof (struct mypasswd) + 1) ) return 0; passwd->next = NULL; data_beg=(char *)passwd + sizeof(struct mypasswd); str = data_beg + nfields * sizeof (char) + nfields * sizeof (char*); memcpy (str, string, len); str[len] = 0; passwd->field[fn++] = str; passwd->listflag = data_beg + nfields * sizeof (char *); for(i=0; i < len; i++){ if (str[i] == delimiter) { str[i] = 0; passwd->field[fn++] = str + i + 1; if (fn == nfields) break; } } for (; fn < nfields; fn++) passwd->field[fn] = NULL; return len + nfields * sizeof (char) + nfields * sizeof (char*) + sizeof (struct mypasswd) + 1; } static void destroy_password (struct mypasswd * pass) { struct mypasswd *p; while ((p=pass)!=NULL) { pass = pass->next; free(p); } } static unsigned int hash(const char * username, unsigned int tablesize) { int h=1; while (*username) { h = h * 7907 + *username++; } return h%tablesize; } static void release_hash_table(struct hashtable * ht){ int i; if (ht == NULL) return; for (i = 0; i < ht->tablesize; i++) if (ht->table[i]) destroy_password(ht->table[i]); if (ht->table) { free(ht->table); ht->table = NULL; } if (ht->fp) { fclose(ht->fp); ht->fp = NULL; } ht->tablesize = 0; } static void release_ht(struct hashtable * ht){ if (!ht) return; release_hash_table(ht); if (ht->filename) free(ht->filename); free(ht); } static struct hashtable * build_hash_table (const char * file, int nfields, int keyfield, int islist, int tablesize, int ignorenis, char delimiter) { #define passwd ((struct mypasswd *) ht->buffer) char buffer[1024]; struct hashtable* ht; size_t len; unsigned int h; struct mypasswd *hashentry, *hashentry1; char *list; char *nextlist=0; int i; ht = (struct hashtable *) rad_malloc(sizeof(struct hashtable)); if(!ht) { return NULL; } memset(ht, 0, sizeof(struct hashtable)); ht->filename = strdup(file); if(!ht->filename) { free(ht); return NULL; } ht->tablesize = tablesize; ht->nfields = nfields; ht->keyfield = keyfield; ht->islist = islist; ht->ignorenis = ignorenis; if (delimiter) ht->delimiter = delimiter; else ht->delimiter = ':'; if(!tablesize) return ht; if(!(ht->fp = fopen(file,"r"))) { free(ht->filename); free(ht); return NULL; } memset(ht->buffer, 0, 1024); ht->table = (struct mypasswd **) rad_malloc (tablesize * sizeof(struct mypasswd *)); if (!ht->table) { /* * Unable allocate memory for hash table * Still work without it */ ht->tablesize = 0; return ht; } memset(ht->table, 0, tablesize * sizeof(struct mypasswd *)); while (fgets(buffer, 1024, ht->fp)) { if(*buffer && *buffer!='\n' && (!ignorenis || (*buffer != '+' && *buffer != '-')) ){ if(!(hashentry = mypasswd_malloc(buffer, nfields, &len))){ release_hash_table(ht); return ht; } len = string_to_entry(buffer, nfields, ht->delimiter, hashentry, len); if(!hashentry->field[keyfield] || *hashentry->field[keyfield] == '\0') { free(hashentry); continue; } if (islist) { list = hashentry->field[keyfield]; for (nextlist = list; *nextlist && *nextlist!=','; nextlist++); if (*nextlist) *nextlist++ = 0; else nextlist = 0; } h = hash(hashentry->field[keyfield], tablesize); hashentry->next = ht->table[h]; ht->table[h] = hashentry; if (islist) { for(list=nextlist; nextlist; list = nextlist){ for (nextlist = list; *nextlist && *nextlist!=','; nextlist++); if (*nextlist) *nextlist++ = 0; else nextlist = 0; if(!(hashentry1 = mypasswd_malloc("", nfields, &len))){ release_hash_table(ht); return ht; } for (i=0; ifield[i] = hashentry->field[i]; hashentry1->field[keyfield] = list; h = hash(list, tablesize); hashentry1->next = ht->table[h]; ht->table[h] = hashentry1; } } } } fclose(ht->fp); ht->fp = NULL; return ht; #undef passwd } static struct mypasswd * get_next(char *name, struct hashtable *ht, struct mypasswd **last_found) { #define passwd ((struct mypasswd *) ht->buffer) struct mypasswd * hashentry; char buffer[1024]; int len; char *list, *nextlist; if (ht->tablesize > 0) { /* get saved address of next item to check from buffer */ hashentry = *last_found; for (; hashentry; hashentry = hashentry->next) { if (!strcmp(hashentry->field[ht->keyfield], name)) { /* save new address */ *last_found = hashentry->next; return hashentry; } } return NULL; } /* printf("try to find in file\n"); */ if (!ht->fp) return NULL; while (fgets(buffer, 1024,ht->fp)) { if(*buffer && *buffer!='\n' && (len = string_to_entry(buffer, ht->nfields, ht->delimiter, passwd, sizeof(ht->buffer)-1)) && (!ht->ignorenis || (*buffer !='-' && *buffer != '+') ) ){ if(!ht->islist) { if(!strcmp(passwd->field[ht->keyfield], name)) return passwd; } else { for (list = passwd->field[ht->keyfield], nextlist = list; nextlist; list = nextlist) { for(nextlist = list; *nextlist && *nextlist!=','; nextlist++); if(!*nextlist)nextlist = 0; else *nextlist++ = 0; if(!strcmp(list, name)) return passwd; } } } } fclose(ht->fp); ht->fp = NULL; return NULL; #undef passwd } static struct mypasswd * get_pw_nam(char * name, struct hashtable* ht, struct mypasswd **last_found) { int h; struct mypasswd * hashentry; if (!ht || !name || *name == '\0') return NULL; *last_found = NULL; if (ht->tablesize > 0) { h = hash (name, ht->tablesize); for (hashentry = ht->table[h]; hashentry; hashentry = hashentry->next) if (!strcmp(hashentry->field[ht->keyfield], name)){ /* save address of next item to check into buffer */ *last_found=hashentry->next; return hashentry; } return NULL; } if (ht->fp) { fclose(ht->fp); ht->fp = NULL; } if (!(ht->fp=fopen(ht->filename, "r"))) return NULL; return get_next(name, ht, last_found); } #ifdef TEST #define MALLOC_CHECK_ 1 int main(void){ struct hashtable *ht; char *buffer; struct mypasswd* pw, *last_found; int i; ht = build_hash_table("/etc/group", 4, 3, 1, 100, 0, ":"); if(!ht) { printf("Hash table not built\n"); return -1; } for (i=0; itablesize; i++) if (ht->table[i]) { printf("%d:\n", i); for(pw=ht->table[i]; pw; pw=pw->next) printpw(pw, 4); } while(fgets(buffer, 1024, stdin)){ buffer[strlen(buffer)-1] = 0; pw = get_pw_nam(buffer, ht, &last_found); printpw(pw,4); while (pw = get_next(buffer, ht, &last_found)) printpw(pw,4); } release_ht(ht); } #else /* TEST */ struct passwd_instance { struct hashtable *ht; struct mypasswd *pwdfmt; char *filename; char *format; char * delimiter; int allowmultiple; int ignorenislike; int hashsize; int nfields; int keyfield; int listable; int keyattr; int keyattrtype; int ignoreempty; }; static const CONF_PARSER module_config[] = { { "filename", PW_TYPE_FILENAME, offsetof(struct passwd_instance, filename), NULL, NULL }, { "format", PW_TYPE_STRING_PTR, offsetof(struct passwd_instance, format), NULL, NULL }, { "delimiter", PW_TYPE_STRING_PTR, offsetof(struct passwd_instance, delimiter), NULL, ":" }, { "ignorenislike", PW_TYPE_BOOLEAN, offsetof(struct passwd_instance, ignorenislike), NULL, "yes" }, { "ignoreempty", PW_TYPE_BOOLEAN, offsetof(struct passwd_instance, ignoreempty), NULL, "yes" }, { "allowmultiplekeys", PW_TYPE_BOOLEAN, offsetof(struct passwd_instance, allowmultiple), NULL, "no" }, { "hashsize", PW_TYPE_INTEGER, offsetof(struct passwd_instance, hashsize), NULL, "100" }, { NULL, -1, 0, NULL, NULL } }; static int passwd_instantiate(CONF_SECTION *conf, void **instance) { #define inst ((struct passwd_instance *)*instance) int nfields=0, keyfield=-1, listable=0; char *s; char *lf=NULL; /* destination list flags temporary */ size_t len; int i; DICT_ATTR * da; *instance = rad_malloc(sizeof(struct passwd_instance)); if ( !*instance) { radlog(L_ERR, "rlm_passwd: cann't alloc instance"); return -1; } memset(*instance, 0, sizeof(struct passwd_instance)); if (cf_section_parse(conf, inst, module_config) < 0) { free(inst); radlog(L_ERR, "rlm_passwd: cann't parse configuration"); return -1; } if(!inst->filename || *inst->filename == '\0' || !inst->format || *inst->format == '\0') { radlog(L_ERR, "rlm_passwd: can't find passwd file and/or format in configuration"); free(inst); return -1; } if (inst->hashsize == 0) { radlog(L_ERR, "rlm_passwd: hashsize=0 is no longer permitted as it will break the server."); free(inst); return -1; } lf=strdup(inst->format); if ( lf == NULL) { radlog(L_ERR, "rlm_passwd: memory allocation failed for lf"); free(inst); return -1; } memset(lf, 0, strlen(inst->format)); s = inst->format - 1; do { if(s == inst->format - 1 || *s == ':'){ if(*(s+1) == '*'){ keyfield = nfields; s++; } if(*(s+1) == ','){ listable = 1; s++; } if(*(s+1) == '='){ lf[nfields]=1; s++; } if(*(s+1) == '~'){ lf[nfields]=2; s++; } nfields++; } s++; }while(*s); if(keyfield < 0) { radlog(L_ERR, "rlm_passwd: no field market as key in format: %s", inst->format); free(lf); return -1; } if (! (inst->ht = build_hash_table (inst->filename, nfields, keyfield, listable, inst->hashsize, inst->ignorenislike, *inst->delimiter)) ){ radlog(L_ERR, "rlm_passwd: can't build hashtable from passwd file"); free(lf); return -1; } if (! (inst->pwdfmt = mypasswd_malloc(inst->format, nfields, &len)) ){ radlog(L_ERR, "rlm_passwd: memory allocation failed"); release_ht(inst->ht); free(lf); return -1; } if (!string_to_entry(inst->format, nfields, ':', inst->pwdfmt , len)) { radlog(L_ERR, "rlm_passwd: unable to convert format entry"); release_ht(inst->ht); free(lf); return -1; } memcpy(inst->pwdfmt->listflag, lf, nfields); free(lf); for (i=0; ipwdfmt->field[i] == '*') inst->pwdfmt->field[i]++; if (*inst->pwdfmt->field[i] == ',') inst->pwdfmt->field[i]++; if (*inst->pwdfmt->field[i] == '=') inst->pwdfmt->field[i]++; if (*inst->pwdfmt->field[i] == '~') inst->pwdfmt->field[i]++; } if (!*inst->pwdfmt->field[keyfield]) { radlog(L_ERR, "rlm_passwd: key field is empty"); release_ht(inst->ht); return -1; } if (! (da = dict_attrbyname (inst->pwdfmt->field[keyfield])) ) { radlog(L_ERR, "rlm_passwd: unable to resolve attribute: %s", inst->pwdfmt->field[keyfield]); release_ht(inst->ht); return -1; } inst->keyattr = da->attr; inst->keyattrtype = da->type; inst->nfields = nfields; inst->keyfield = keyfield; inst->listable = listable; DEBUG("rlm_passwd: nfields: %d keyfield %d(%s) listable: %s", nfields, keyfield, inst->pwdfmt->field[keyfield], listable?"yes":"no"); return 0; #undef inst } static int passwd_detach (void *instance) { #define inst ((struct passwd_instance *)instance) if(inst->ht) release_ht(inst->ht); free(instance); return 0; #undef inst } static void addresult (struct passwd_instance * inst, REQUEST *request, VALUE_PAIR ** vp, struct mypasswd * pw, char when, const char *listname) { int i; VALUE_PAIR *newpair; for (i=0; infields; i++) { if (inst->pwdfmt->field[i] && *inst->pwdfmt->field[i] && pw->field[i] && i != inst->keyfield && inst->pwdfmt->listflag[i] == when) { if ( !inst->ignoreempty || pw->field[i][0] != 0 ) { /* if value in key/value pair is not empty */ if (! (newpair = pairmake (inst->pwdfmt->field[i], pw->field[i], T_OP_EQ))) { radlog(L_AUTH, "rlm_passwd: Unable to create %s: %s", inst->pwdfmt->field[i], pw->field[i]); return; } RDEBUG("Added %s: '%s' to %s ", inst->pwdfmt->field[i], pw->field[i], listname); pairadd (vp, newpair); } else RDEBUG("NOOP %s: '%s' to %s ", inst->pwdfmt->field[i], pw->field[i], listname); } } } static int passwd_map(void *instance, REQUEST *request) { #define inst ((struct passwd_instance *)instance) char buffer[1024]; VALUE_PAIR * key; struct mypasswd * pw, *last_found; int found = 0; for (key = request->packet->vps; key && (key = pairfind (key, inst->keyattr)); key = key->next ){ /* * Ensure we have the string form of the attribute */ vp_prints_value(buffer, sizeof(buffer), key, 0); if (! (pw = get_pw_nam(buffer, inst->ht, &last_found)) ) { continue; } do { addresult(inst, request, &request->config_items, pw, 0, "config_items"); addresult(inst, request, &request->reply->vps, pw, 1, "reply_items"); addresult(inst, request, &request->packet->vps, pw, 2, "request_items"); } while ( (pw = get_next(buffer, inst->ht, &last_found)) ); found++; if (!inst->allowmultiple) break; } if(!found) { return RLM_MODULE_NOTFOUND; } return RLM_MODULE_OK; #undef inst } module_t rlm_passwd = { RLM_MODULE_INIT, "passwd", RLM_TYPE_CHECK_CONFIG_SAFE | RLM_TYPE_HUP_SAFE, /* type */ passwd_instantiate, /* instantiation */ passwd_detach, /* detach */ { NULL, /* authentication */ passwd_map, /* authorization */ NULL, /* pre-accounting */ passwd_map, /* accounting */ NULL, /* checksimul */ NULL, /* pre-proxy */ NULL, /* post-proxy */ passwd_map /* post-auth */ #ifdef WITH_COA , passwd_map, passwd_map #endif }, }; #endif /* TEST */ freeradius-server/src/modules/rlm_perl/000077500000000000000000000000001257552170400205765ustar00rootroot00000000000000freeradius-server/src/modules/rlm_perl/.gitignore000066400000000000000000000000221257552170400225600ustar00rootroot00000000000000Makefile config.h freeradius-server/src/modules/rlm_perl/Makefile.in000066400000000000000000000005321257552170400226430ustar00rootroot00000000000000# # $Id$ # TARGET = @targetname@ SRCS = rlm_perl.c HEADERS = RLM_CFLAGS = @perl_cflags@ RLM_LIBS = @perl_ldflags@ RLM_INSTALL = install-scripts ## this uses the RLM_CFLAGS and RLM_LIBS and SRCS defs to make TARGET. include ../rules.mak $(LT_OBJS): $(HEADERS) install-scripts: $(INSTALL) -m 755 example.pl $(R)$(raddbdir) freeradius-server/src/modules/rlm_perl/config.h.in000066400000000000000000000007271257552170400226270ustar00rootroot00000000000000/* config.h.in. Generated from configure.in by autoheader. */ /* 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 version of this package. */ #undef PACKAGE_VERSION freeradius-server/src/modules/rlm_perl/configure000077500000000000000000003567331257552170400225260ustar00rootroot00000000000000#! /bin/sh # From configure.in Revision. # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.61. # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, # 2002, 2003, 2004, 2005, 2006 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=: # 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 # PATH needs CR # 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 # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false 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.) as_nl=' ' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. 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 # Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # CDPATH. $as_unset CDPATH if test "x$CONFIG_SHELL" = x; then if (eval ":") 2>/dev/null; then as_have_required=yes else as_have_required=no fi if test $as_have_required = yes && (eval ": (as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=\$LINENO as_lineno_2=\$LINENO test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } ") 2> /dev/null; then : else as_candidate_shells= as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. case $as_dir in /*) for as_base in sh bash ksh sh5; do as_candidate_shells="$as_candidate_shells $as_dir/$as_base" done;; esac done IFS=$as_save_IFS for as_shell in $as_candidate_shells $SHELL; do # Try only shells that exist, to save several forks. if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { ("$as_shell") 2> /dev/null <<\_ASEOF 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 : _ASEOF }; then CONFIG_SHELL=$as_shell as_have_required=yes if { "$as_shell" 2> /dev/null <<\_ASEOF 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 : (as_func_return () { (exit $1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = "$1" ); then : else exitcode=1 echo positional parameters were not saved. fi test $exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } _ASEOF }; then break fi fi done if test "x$CONFIG_SHELL" != x; then for as_var in BASH_ENV ENV do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done export CONFIG_SHELL exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} fi if test $as_have_required = no; then echo This script requires a shell more modern than all the echo shells that I found on your system. Please install a echo modern shell, or manually run the script under such a echo shell if you do have one. { (exit 1); exit 1; } fi fi fi (eval "as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0") || { echo No shell found that supports shell functions. echo Please tell autoconf@gnu.org about your system, echo including any error possibly output before this echo message } as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, and appends # trailing '-' during substitution so that $LINENO is not a special # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # scripts with optimization help from Paolo Bonzini. 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" || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi 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 fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi 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=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, 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= SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME= PACKAGE_TARNAME= PACKAGE_VERSION= PACKAGE_STRING= PACKAGE_BUGREPORT= ac_unique_file="rlm_perl.c" ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datarootdir datadir sysconfdir sharedstatedir localstatedir includedir oldincludedir docdir infodir htmldir dvidir pdfdir psdir libdir localedir mandir DEFS ECHO_C ECHO_N ECHO_T LIBS build_alias host_alias target_alias CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP PERL perl_cflags perl_ldflags targetname LIBOBJS LTLIBOBJS' ac_subst_files='' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CPP' # Initialize some variables set by options. ac_init_help= ac_init_version=false # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *) ac_optarg=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_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` eval enable_$ac_feature=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_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` eval enable_$ac_feature=\$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_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/[-.]/_/g'` eval with_$ac_package=\$ac_optarg ;; -without-* | --without-*) ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/[-.]/_/g'` eval with_$ac_package=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 ;; -*) { echo "$as_me: error: unrecognized option: $ac_option Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && 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'` { echo "$as_me: error: missing argument to $ac_option" >&2 { (exit 1); exit 1; }; } fi # Be sure to have absolute directory names. 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 case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; } 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 echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || { echo "$as_me: error: Working directory cannot be determined" >&2 { (exit 1); exit 1; }; } test "X$ac_ls_di" = "X$ac_pwd_ls_di" || { echo "$as_me: error: pwd does not report name of working directory" >&2 { (exit 1); exit 1; }; } # 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 -- "$0" || $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$0" : 'X\(//\)[^/]' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X"$0" | 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 .." { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2 { (exit 1); exit 1; }; } pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures this package to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF _ACEOF fi if test -n "$ac_init_help"; then cat <<\_ACEOF 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 C/C++/Objective C preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. _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" || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`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 echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF configure generated by GNU Autoconf 2.61 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 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 cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by $as_me, which was generated by GNU Autoconf 2.61. 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=. 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=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; 2) ac_configure_args1="$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 ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac done done $as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } $as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export 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 cat <<\_ASBOX ## ---------------- ## ## Cache variables. ## ## ---------------- ## _ASBOX 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_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( *) $as_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 cat <<\_ASBOX ## ----------------- ## ## Output variables. ## ## ----------------- ## _ASBOX echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then cat <<\_ASBOX ## ------------------- ## ## File substitutions. ## ## ------------------- ## _ASBOX echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then cat <<\_ASBOX ## ----------- ## ## confdefs.h. ## ## ----------- ## _ASBOX echo cat confdefs.h echo fi test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" 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'; { (exit 1); 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 # 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 # Let the site file select an alternate cache file if it wants to. # Prefer explicitly selected file to automatically selected ones. if test -n "$CONFIG_SITE"; then set x "$CONFIG_SITE" elif test "x$prefix" != xNONE; then set x "$prefix/share/config.site" "$prefix/etc/config.site" else set x "$ac_default_prefix/share/config.site" \ "$ac_default_prefix/etc/config.site" fi shift for ac_site_file do if test -r "$ac_site_file"; then { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" 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. if test -f "$cache_file"; then { echo "$as_me:$LINENO: loading cache $cache_file" >&5 echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { echo "$as_me:$LINENO: creating cache $cache_file" >&5 echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 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 { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 echo "$as_me: former value: $ac_old_val" >&2;} { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 echo "$as_me: current value: $ac_new_val" >&2;} ac_cache_corrupted=: fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`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. *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 echo "$as_me: error: changes in the environment can compromise the build" >&2;} { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} { (exit 1); exit 1; }; } 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 x$with_rlm_perl != xno; then 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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}gcc" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="gcc" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}cc" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="$ac_prog" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&5 echo "$as_me: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } # Provide some information about the compiler. echo "$as_me:$LINENO: checking for C compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (ac_try="$ac_compiler --version >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -v >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -V >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out 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. { echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6; } ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # # List of possible output files, starting from the most likely. # The algorithm is not robust to junk in `.', hence go to wildcards (a.*) # only as a last resort. b.out is created by i960 compilers. ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out' # # The IRIX 6 linker writes into existing files which may not be # executable, retaining their permissions. Remove them first so a # subsequent execution test works. ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link_default") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; 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 | *.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 { echo "$as_me:$LINENO: result: $ac_file" >&5 echo "${ECHO_T}$ac_file" >&6; } if test -z "$ac_file"; then echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: C compiler cannot create executables See \`config.log' for more details." >&5 echo "$as_me: error: C compiler cannot create executables See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } fi ac_exeext=$ac_cv_exeext # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { echo "$as_me:$LINENO: checking whether the C compiler works" >&5 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6; } # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then if { ac_try='./$ac_file' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { echo "$as_me:$LINENO: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&5 echo "$as_me: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi fi fi { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } rm -f a.out a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; } { echo "$as_me:$LINENO: result: $cross_compiling" >&5 echo "${ECHO_T}$cross_compiling" >&6; } { echo "$as_me:$LINENO: checking for suffix of executables" >&5 echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; } if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; 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 | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest$ac_cv_exeext { echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 echo "${ECHO_T}$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT { echo "$as_me:$LINENO: checking for suffix of object files" >&5 echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; } if test "${ac_cv_objext+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; 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 ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 echo "${ECHO_T}$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; } if test "${ac_cv_c_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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 { echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; } GCC=`test $ac_compiler_gnu = yes && echo yes` ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CFLAGS="" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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 { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 echo "${ECHO_T}$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 { echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_c89+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_c89=$ac_arg else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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) { echo "$as_me:$LINENO: result: none needed" >&5 echo "${ECHO_T}none needed" >&6; } ;; xno) { echo "$as_me:$LINENO: result: unsupported" >&5 echo "${ECHO_T}unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;; 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 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 { echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if test "${ac_cv_prog_CPP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f 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 { echo "$as_me:$LINENO: result: $CPP" >&5 echo "${ECHO_T}$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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&5 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } 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 # Extract the first word of "perl", so it can be a program name with args. set dummy perl; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_PERL+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$PERL"; then ac_cv_prog_PERL="$PERL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_PERL="yes" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_PERL" && ac_cv_prog_PERL="no" fi fi PERL=$ac_cv_prog_PERL if test -n "$PERL"; then { echo "$as_me:$LINENO: result: $PERL" >&5 echo "${ECHO_T}$PERL" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "$PERL" = "no"; then fail=$fail" perl" else old_CFLAGS=$CFLAGS CFLAGS="$CFLAGS `perl -MExtUtils::Embed -e ccopts`" smart_try_dir= ac_safe=`echo "EXTERN.h" | sed 'y%./+-%__pm%'` { echo "$as_me:$LINENO: checking for EXTERN.h" >&5 echo $ECHO_N "checking for EXTERN.h... $ECHO_C" >&6; } old_CFLAGS="$CFLAGS" smart_include= smart_include_dir= if test "x$smart_try_dir" != "x"; then for try in $smart_try_dir; do CFLAGS="$old_CFLAGS -I$try" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { int a = 1; ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then smart_include="-I$try" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 smart_include= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test "x$smart_include" != "x"; then break; fi done CFLAGS="$old_CFLAGS" fi if test "x$smart_include" = "x"; then cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { int a = 1; ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then smart_include=" " else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 smart_include= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test "x$smart_include" = "x"; then if test "x$LOCATE" != "x"; then DIRS= file=EXTERN.h for x in `${LOCATE} $file 2>/dev/null`; do base=`echo $x | sed "s%/${file}%%"` if test "x$x" = "x$base"; then continue; fi dir=`${DIRNAME} $x 2>/dev/null` exclude=`echo ${dir} | ${GREP} /home` if test "x$exclude" != "x"; then continue fi already=`echo \$smart_include_dir ${DIRS} | ${GREP} ${dir}` if test "x$already" = "x"; then DIRS="$DIRS $dir" fi done fi eval "smart_include_dir=\"\$smart_include_dir $DIRS\"" for try in $smart_include_dir /usr/local/include /opt/include; do CFLAGS="$old_CFLAGS -I$try" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { int a = 1; ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then smart_include="-I$try" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 smart_include= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test "x$smart_include" != "x"; then break; fi done CFLAGS="$old_CFLAGS" fi if test "x$smart_include" != "x"; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } eval "ac_cv_header_$ac_safe=yes" CFLAGS="$old_CFLAGS $smart_include" SMART_CFLAGS="$SMART_CFLAGS $smart_include" else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_cv_header_EXTERN_h" = "xyes"; then perl_cflags='`perl -MExtUtils::Embed -e ccopts`' else fail="$fail EXTERN.h" targetname= fi ac_safe=`echo "perl.h" | sed 'y%./+-%__pm%'` { echo "$as_me:$LINENO: checking for perl.h" >&5 echo $ECHO_N "checking for perl.h... $ECHO_C" >&6; } old_CFLAGS="$CFLAGS" smart_include= smart_include_dir= if test "x$smart_try_dir" != "x"; then for try in $smart_try_dir; do CFLAGS="$old_CFLAGS -I$try" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { int a = 1; ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then smart_include="-I$try" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 smart_include= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test "x$smart_include" != "x"; then break; fi done CFLAGS="$old_CFLAGS" fi if test "x$smart_include" = "x"; then cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { int a = 1; ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then smart_include=" " else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 smart_include= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test "x$smart_include" = "x"; then if test "x$LOCATE" != "x"; then DIRS= file=perl.h for x in `${LOCATE} $file 2>/dev/null`; do base=`echo $x | sed "s%/${file}%%"` if test "x$x" = "x$base"; then continue; fi dir=`${DIRNAME} $x 2>/dev/null` exclude=`echo ${dir} | ${GREP} /home` if test "x$exclude" != "x"; then continue fi already=`echo \$smart_include_dir ${DIRS} | ${GREP} ${dir}` if test "x$already" = "x"; then DIRS="$DIRS $dir" fi done fi eval "smart_include_dir=\"\$smart_include_dir $DIRS\"" for try in $smart_include_dir /usr/local/include /opt/include; do CFLAGS="$old_CFLAGS -I$try" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { int a = 1; ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then smart_include="-I$try" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 smart_include= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test "x$smart_include" != "x"; then break; fi done CFLAGS="$old_CFLAGS" fi if test "x$smart_include" != "x"; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } eval "ac_cv_header_$ac_safe=yes" CFLAGS="$old_CFLAGS $smart_include" SMART_CFLAGS="$SMART_CFLAGS $smart_include" else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_cv_header_perl_h" = "xyes"; then perl_cflags='`perl -MExtUtils::Embed -e ccopts`' else fail="$fail perl.h" targetname= fi old_LIBS="$LIBS" LIBS="$old_LIBS `perl -MExtUtils::Embed -e ldopts`" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ extern char boot_DynaLoader(); int main () { boot_DynaLoader() ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then BROKEN= else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 BROKEN="yes" fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test "x$BROKEN" = "x"; then perl_ldflags='`perl -MExtUtils::Embed -e ldopts`' else fail="$fail libperl.so" targetname= fi cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ extern char Perl_hv_store(); int main () { Perl_hv_store() ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then BROKEN= else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 BROKEN="yes" fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test "x$BROKEN" != "x"; then fail="$fail libperl.so" targetname= fi CFLAGS=$old_CFLAGS fi targetname=rlm_perl else targetname= echo \*\*\* module rlm_perl is disabled. # keep this! Don't change! fi if test x"$fail" != x""; then if test x"${enable_strict_dependencies}" = x"yes"; then { { echo "$as_me:$LINENO: error: set --without-rlm_perl to disable it explicitly." >&5 echo "$as_me: error: set --without-rlm_perl to disable it explicitly." >&2;} { (exit 1); exit 1; }; } else { echo "$as_me:$LINENO: WARNING: silently not building rlm_perl." >&5 echo "$as_me: WARNING: silently not building rlm_perl." >&2;} { echo "$as_me:$LINENO: WARNING: FAILURE: rlm_perl requires: $fail." >&5 echo "$as_me: WARNING: FAILURE: rlm_perl requires: $fail." >&2;}; targetname="" perl_cflags="" perl_ldflags="" fi fi ac_config_headers="$ac_config_headers config.h" unset ac_cv_env_LIBS_set unset ac_cv_env_LIBS_value ac_config_files="$ac_config_files 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_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( *) $as_unset $ac_var ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then test "x$cache_file" != "x/dev/null" && { echo "$as_me:$LINENO: updating cache $cache_file" >&5 echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 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= 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=`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. ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs : ${CONFIG_STATUS=./config.status} ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >$CONFIG_STATUS <<_ACEOF #! $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} _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ## --------------------- ## ## 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=: # 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 # PATH needs CR # 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 # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false 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.) as_nl=' ' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. 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 # Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # CDPATH. $as_unset CDPATH as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, and appends # trailing '-' during substitution so that $LINENO is not a special # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # scripts with optimization help from Paolo Bonzini. 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" || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi 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 fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi 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=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 # Save the log message, to keep $[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by $as_me, which was generated by GNU Autoconf 2.61. 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 cat >>$CONFIG_STATUS <<_ACEOF # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ config.status configured by $0, generated by GNU Autoconf 2.61, with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" Copyright (C) 2006 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' _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # If no file are specified by the user, then we need to provide default # value. By we need to know if files were specified by the user. 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=$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 ) echo "$ac_cs_version"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift CONFIG_FILES="$CONFIG_FILES $ac_optarg" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header { echo "$as_me: error: ambiguous option: $1 Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; };; --help | --hel | -h ) 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. -*) { echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *) ac_config_targets="$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 if \$ac_cs_recheck; then echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 CONFIG_SHELL=$SHELL export CONFIG_SHELL exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # 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" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= trap 'exit_status=$? { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status ' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || { echo "$me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } # # Set up the sed scripts for CONFIG_FILES section. # # No need to generate the scripts if there are no CONFIG_FILES. # This happens for instance when ./config.status config.h if test -n "$CONFIG_FILES"; then _ACEOF ac_delim='%!_!# ' for ac_last_try in false false false false false :; do cat >conf$$subs.sed <<_ACEOF SHELL!$SHELL$ac_delim PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim PACKAGE_NAME!$PACKAGE_NAME$ac_delim PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim PACKAGE_STRING!$PACKAGE_STRING$ac_delim PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim exec_prefix!$exec_prefix$ac_delim prefix!$prefix$ac_delim program_transform_name!$program_transform_name$ac_delim bindir!$bindir$ac_delim sbindir!$sbindir$ac_delim libexecdir!$libexecdir$ac_delim datarootdir!$datarootdir$ac_delim datadir!$datadir$ac_delim sysconfdir!$sysconfdir$ac_delim sharedstatedir!$sharedstatedir$ac_delim localstatedir!$localstatedir$ac_delim includedir!$includedir$ac_delim oldincludedir!$oldincludedir$ac_delim docdir!$docdir$ac_delim infodir!$infodir$ac_delim htmldir!$htmldir$ac_delim dvidir!$dvidir$ac_delim pdfdir!$pdfdir$ac_delim psdir!$psdir$ac_delim libdir!$libdir$ac_delim localedir!$localedir$ac_delim mandir!$mandir$ac_delim DEFS!$DEFS$ac_delim ECHO_C!$ECHO_C$ac_delim ECHO_N!$ECHO_N$ac_delim ECHO_T!$ECHO_T$ac_delim LIBS!$LIBS$ac_delim build_alias!$build_alias$ac_delim host_alias!$host_alias$ac_delim target_alias!$target_alias$ac_delim CC!$CC$ac_delim CFLAGS!$CFLAGS$ac_delim LDFLAGS!$LDFLAGS$ac_delim CPPFLAGS!$CPPFLAGS$ac_delim ac_ct_CC!$ac_ct_CC$ac_delim EXEEXT!$EXEEXT$ac_delim OBJEXT!$OBJEXT$ac_delim CPP!$CPP$ac_delim PERL!$PERL$ac_delim perl_cflags!$perl_cflags$ac_delim perl_ldflags!$perl_ldflags$ac_delim targetname!$targetname$ac_delim LIBOBJS!$LIBOBJS$ac_delim LTLIBOBJS!$LTLIBOBJS$ac_delim _ACEOF if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 51; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` if test -n "$ac_eof"; then ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` ac_eof=`expr $ac_eof + 1` fi cat >>$CONFIG_STATUS <<_ACEOF cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof /@[a-zA-Z_][a-zA-Z_0-9]*@/!b end _ACEOF sed ' s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g s/^/s,@/; s/!/@,|#_!!_#|/ :n t n s/'"$ac_delim"'$/,g/; t s/$/\\/; p N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n ' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF :end s/|#_!!_#|//g CEOF$ac_eof _ACEOF # VPATH may cause trouble with some makes, so we remove $(srcdir), # ${srcdir} and @srcdir@ 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[ ]*=/{ s/:*\$(srcdir):*/:/ s/:*\${srcdir}:*/:/ s/:*@srcdir@:*/:/ s/^\([^=]*=[ ]*\):*/\1/ s/:*$// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF fi # test -n "$CONFIG_FILES" for ac_tag in :F $CONFIG_FILES :H $CONFIG_HEADERS do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5 echo "$as_me: error: Invalid tag $ac_tag." >&2;} { (exit 1); exit 1; }; };; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 echo "$as_me: error: cannot find input file: $ac_f" >&2;} { (exit 1); exit 1; }; };; esac ac_file_inputs="$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 "`IFS=: echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure." if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { echo "$as_me:$LINENO: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} fi case $ac_tag in *:-:* | *:-) cat >"$tmp/stdin";; 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 || 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" case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`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 || 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" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 echo "$as_me: error: cannot create directory $as_dir" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`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 # _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # 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= case `sed -n '/datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p ' $ac_file_inputs` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF 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 sed "$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s&@configure_input@&$configure_input&;t t s&@top_builddir@&$ac_top_builddir_sub&;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 $ac_datarootdir_hack " $ac_file_inputs | sed -f "$tmp/subs-1.sed" >$tmp/out test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&5 echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&2;} rm -f "$tmp/stdin" case $ac_file in -) cat "$tmp/out"; rm -f "$tmp/out";; *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;; esac ;; :H) # # CONFIG_HEADER # _ACEOF # Transform confdefs.h into a sed script `conftest.defines', that # substitutes the proper values into config.h.in to produce config.h. rm -f conftest.defines conftest.tail # First, append a space to every undef/define line, to ease matching. echo 's/$/ /' >conftest.defines # Then, protect against being on the right side of a sed subst, or in # an unquoted here document, in config.status. If some macros were # called several times there might be several #defines for the same # symbol, which is useless. But do not sort them, since the last # AC_DEFINE must be honored. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* # These sed commands are passed to sed as "A NAME B PARAMS C VALUE D", where # NAME is the cpp macro being defined, VALUE is the value it is being given. # PARAMS is the parameter list in the macro definition--in most cases, it's # just an empty string. ac_dA='s,^\\([ #]*\\)[^ ]*\\([ ]*' ac_dB='\\)[ (].*,\\1define\\2' ac_dC=' ' ac_dD=' ,' uniq confdefs.h | sed -n ' t rset :rset s/^[ ]*#[ ]*define[ ][ ]*// t ok d :ok s/[\\&,]/\\&/g s/^\('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/ '"$ac_dA"'\1'"$ac_dB"'\2'"${ac_dC}"'\3'"$ac_dD"'/p s/^\('"$ac_word_re"'\)[ ]*\(.*\)/'"$ac_dA"'\1'"$ac_dB$ac_dC"'\2'"$ac_dD"'/p ' >>conftest.defines # Remove the space that was appended to ease matching. # Then 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. # (The regexp can be short, since the line contains either #define or #undef.) echo 's/ $// s,^[ #]*u.*,/* & */,' >>conftest.defines # Break up conftest.defines: ac_max_sed_lines=50 # First sed command is: sed -f defines.sed $ac_file_inputs >"$tmp/out1" # Second one is: sed -f defines.sed "$tmp/out1" >"$tmp/out2" # Third one will be: sed -f defines.sed "$tmp/out2" >"$tmp/out1" # et cetera. ac_in='$ac_file_inputs' ac_out='"$tmp/out1"' ac_nxt='"$tmp/out2"' while : do # Write a here document: cat >>$CONFIG_STATUS <<_ACEOF # First, check the format of the line: cat >"\$tmp/defines.sed" <<\\CEOF /^[ ]*#[ ]*undef[ ][ ]*$ac_word_re[ ]*\$/b def /^[ ]*#[ ]*define[ ][ ]*$ac_word_re[( ]/b def b :def _ACEOF sed ${ac_max_sed_lines}q conftest.defines >>$CONFIG_STATUS echo 'CEOF sed -f "$tmp/defines.sed"' "$ac_in >$ac_out" >>$CONFIG_STATUS ac_in=$ac_out; ac_out=$ac_nxt; ac_nxt=$ac_in sed 1,${ac_max_sed_lines}d conftest.defines >conftest.tail grep . conftest.tail >/dev/null || break rm -f conftest.defines mv conftest.tail conftest.defines done rm -f conftest.defines conftest.tail echo "ac_result=$ac_in" >>$CONFIG_STATUS cat >>$CONFIG_STATUS <<\_ACEOF if test x"$ac_file" != x-; then echo "/* $configure_input */" >"$tmp/config.h" cat "$ac_result" >>"$tmp/config.h" if diff $ac_file "$tmp/config.h" >/dev/null 2>&1; then { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 echo "$as_me: $ac_file is unchanged" >&6;} else rm -f $ac_file mv "$tmp/config.h" $ac_file fi else echo "/* $configure_input */" cat "$ac_result" fi rm -f "$tmp/out12" ;; esac done # for ac_tag { (exit 0); exit 0; } _ACEOF chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save # 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 || { (exit 1); exit 1; } fi freeradius-server/src/modules/rlm_perl/configure.in000066400000000000000000000040321257552170400231060ustar00rootroot00000000000000AC_PREREQ([2.53]) AC_INIT(rlm_perl.c) AC_REVISION($Revision$) AC_DEFUN(modname,[rlm_perl]) if test x$with_[]modname != xno; then AC_PROG_CC AC_PROG_CPP dnl put configuration checks here. dnl set $fail to what's missing, on fatal errors. dnl use AC_MSG_WARN() on important messages. AC_CHECK_PROG(PERL, perl, yes, no) if test "$PERL" = "no"; then fail=$fail" perl" else old_CFLAGS=$CFLAGS CFLAGS="$CFLAGS `perl -MExtUtils::Embed -e ccopts`" smart_try_dir= FR_SMART_CHECK_INCLUDE(EXTERN.h) if test "x$ac_cv_header_EXTERN_h" = "xyes"; then perl_cflags='`perl -MExtUtils::Embed -e ccopts`' else fail="$fail EXTERN.h" targetname= fi FR_SMART_CHECK_INCLUDE(perl.h, [#include ]) if test "x$ac_cv_header_perl_h" = "xyes"; then perl_cflags='`perl -MExtUtils::Embed -e ccopts`' else fail="$fail perl.h" targetname= fi old_LIBS="$LIBS" LIBS="$old_LIBS `perl -MExtUtils::Embed -e ldopts`" AC_TRY_LINK([extern char boot_DynaLoader();], [ boot_DynaLoader()], BROKEN=, BROKEN="yes") if test "x$BROKEN" = "x"; then perl_ldflags='`perl -MExtUtils::Embed -e ldopts`' else fail="$fail libperl.so" targetname= fi AC_TRY_LINK([extern char Perl_hv_store();], [ Perl_hv_store()], BROKEN=, BROKEN="yes") if test "x$BROKEN" != "x"; then fail="$fail libperl.so" targetname= fi CFLAGS=$old_CFLAGS fi targetname=modname else targetname= echo \*\*\* module modname is disabled. # keep this! Don't change! fi dnl Don't change this section. if test x"$fail" != x""; then if test x"${enable_strict_dependencies}" = x"yes"; then AC_MSG_ERROR([set --without-]modname[ to disable it explicitly.]) else AC_MSG_WARN([silently not building ]modname[.]) AC_MSG_WARN([FAILURE: ]modname[ requires: $fail.]); targetname="" perl_cflags="" perl_ldflags="" fi fi AC_SUBST(perl_cflags) AC_SUBST(perl_ldflags) AC_CONFIG_HEADER(config.h) AC_SUBST(targetname) AC_OUTPUT(Makefile) freeradius-server/src/modules/rlm_perl/example.pl000066400000000000000000000117611257552170400225740ustar00rootroot00000000000000# # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA # # Copyright 2002 The FreeRADIUS server project # Copyright 2002 Boian Jordanov # # # Example code for use with rlm_perl # # You can use every module that comes with your perl distribution! # # If you are using DBI and do some queries to DB, please be sure to # use the CLONE function to initialize the DBI connection to DB. # use strict; # use ... # This is very important ! Without this script will not get the filled hashesh from main. use vars qw(%RAD_REQUEST %RAD_REPLY %RAD_CHECK); use Data::Dumper; # This is hash wich hold original request from radius #my %RAD_REQUEST; # In this hash you add values that will be returned to NAS. #my %RAD_REPLY; #This is for check items #my %RAD_CHECK; # # This the remapping of return values # use constant RLM_MODULE_REJECT=> 0;# /* immediately reject the request */ use constant RLM_MODULE_FAIL=> 1;# /* module failed, don't reply */ use constant RLM_MODULE_OK=> 2;# /* the module is OK, continue */ use constant RLM_MODULE_HANDLED=> 3;# /* the module handled the request, so stop. */ use constant RLM_MODULE_INVALID=> 4;# /* the module considers the request invalid. */ use constant RLM_MODULE_USERLOCK=> 5;# /* reject the request (user is locked out) */ use constant RLM_MODULE_NOTFOUND=> 6;# /* user not found */ use constant RLM_MODULE_NOOP=> 7;# /* module succeeded without doing anything */ use constant RLM_MODULE_UPDATED=> 8;# /* OK (pairs modified) */ use constant RLM_MODULE_NUMCODES=> 9;# /* How many return codes there are */ # Same as src/include/radiusd.h use constant L_DBG=> 1; use constant L_AUTH=> 2; use constant L_INFO=> 3; use constant L_ERR=> 4; use constant L_PROXY=> 5; use constant L_ACCT=> 6; # Global variables can persist across different calls to the module. # # # { # my %static_global_hash = (); # # sub post_auth { # ... # } # ... # } # Function to handle authorize sub authorize { # For debugging purposes only # &log_request_attributes; # Here's where your authorization code comes # You can call another function from here: &test_call; return RLM_MODULE_OK; } # Function to handle authenticate sub authenticate { # For debugging purposes only # &log_request_attributes; if ($RAD_REQUEST{'User-Name'} =~ /^baduser/i) { # Reject user and tell him why $RAD_REPLY{'Reply-Message'} = "Denied access by rlm_perl function"; return RLM_MODULE_REJECT; } else { # Accept user and set some attribute $RAD_REPLY{'h323-credit-amount'} = "100"; return RLM_MODULE_OK; } } # Function to handle preacct sub preacct { # For debugging purposes only # &log_request_attributes; return RLM_MODULE_OK; } # Function to handle accounting sub accounting { # For debugging purposes only # &log_request_attributes; # You can call another subroutine from here &test_call; return RLM_MODULE_OK; } # Function to handle checksimul sub checksimul { # For debugging purposes only # &log_request_attributes; return RLM_MODULE_OK; } # Function to handle pre_proxy sub pre_proxy { # For debugging purposes only # &log_request_attributes; return RLM_MODULE_OK; } # Function to handle post_proxy sub post_proxy { # For debugging purposes only # &log_request_attributes; return RLM_MODULE_OK; } # Function to handle post_auth sub post_auth { # For debugging purposes only # &log_request_attributes; return RLM_MODULE_OK; } # Function to handle xlat sub xlat { # For debugging purposes only # &log_request_attributes; # Loads some external perl and evaluate it my ($filename,$a,$b,$c,$d) = @_; &radiusd::radlog(L_DBG, "From xlat $filename "); &radiusd::radlog(L_DBG,"From xlat $a $b $c $d "); local *FH; open FH, $filename or die "open '$filename' $!"; local($/) = undef; my $sub = ; close FH; my $eval = qq{ sub handler{ $sub;} }; eval $eval; eval {main->handler;}; } # Function to handle detach sub detach { # For debugging purposes only # &log_request_attributes; # Do some logging. &radiusd::radlog(L_DBG,"rlm_perl::Detaching. Reloading. Done."); } # # Some functions that can be called from other functions # sub test_call { # Some code goes here } sub log_request_attributes { # This shouldn't be done in production environments! # This is only meant for debugging! for (keys %RAD_REQUEST) { &radiusd::radlog(L_DBG, "RAD_REQUEST: $_ = $RAD_REQUEST{$_}"); } } freeradius-server/src/modules/rlm_perl/rlm_perl.c000066400000000000000000000563111257552170400225640ustar00rootroot00000000000000 /* * rlm_perl.c * * Version: $Id$ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2002,2006 The FreeRADIUS server project * Copyright 2002 Boian Jordanov */ #include RCSID("$Id$") #include #include #ifdef DEBUG #undef DEBUG #endif #ifdef INADDR_ANY #undef INADDR_ANY #endif #include #include #include #include #include #ifdef __APPLE__ extern char **environ; #endif /* * Define a structure for our module configuration. * * These variables do not need to be in a structure, but it's * a lot cleaner to do so, and a pointer to the structure can * be used as the instance handle. */ typedef struct perl_inst { /* Name of the perl module */ char *module; /* Name of the functions for each module method */ char *func_authorize; char *func_authenticate; char *func_accounting; char *func_start_accounting; char *func_stop_accounting; char *func_preacct; char *func_checksimul; char *func_detach; char *func_xlat; char *func_pre_proxy; char *func_post_proxy; char *func_post_auth; #ifdef WITH_COA char *func_recv_coa; char *func_send_coa; #endif char *xlat_name; char *perl_flags; PerlInterpreter *perl; pthread_key_t *thread_key; pthread_mutex_t clone_mutex; } PERL_INST; /* * A mapping of configuration file names to internal variables. * * Note that the string is dynamically allocated, so it MUST * be freed. When the configuration file parse re-reads the string, * it free's the old one, and strdup's the new one, placing the pointer * to the strdup'd string into 'config.string'. This gets around * buffer over-flows. */ static const CONF_PARSER module_config[] = { { "module", PW_TYPE_FILENAME, offsetof(PERL_INST,module), NULL, "module"}, { "func_authorize", PW_TYPE_STRING_PTR, offsetof(PERL_INST,func_authorize), NULL, "authorize"}, { "func_authenticate", PW_TYPE_STRING_PTR, offsetof(PERL_INST,func_authenticate), NULL, "authenticate"}, { "func_accounting", PW_TYPE_STRING_PTR, offsetof(PERL_INST,func_accounting), NULL, "accounting"}, { "func_preacct", PW_TYPE_STRING_PTR, offsetof(PERL_INST,func_preacct), NULL, "preacct"}, { "func_checksimul", PW_TYPE_STRING_PTR, offsetof(PERL_INST,func_checksimul), NULL, "checksimul"}, { "func_detach", PW_TYPE_STRING_PTR, offsetof(PERL_INST,func_detach), NULL, "detach"}, { "func_xlat", PW_TYPE_STRING_PTR, offsetof(PERL_INST,func_xlat), NULL, "xlat"}, { "func_pre_proxy", PW_TYPE_STRING_PTR, offsetof(PERL_INST,func_pre_proxy), NULL, "pre_proxy"}, { "func_post_proxy", PW_TYPE_STRING_PTR, offsetof(PERL_INST,func_post_proxy), NULL, "post_proxy"}, { "func_post_auth", PW_TYPE_STRING_PTR, offsetof(PERL_INST,func_post_auth), NULL, "post_auth"}, #ifdef WITH_COA { "func_recv_coa", PW_TYPE_STRING_PTR, offsetof(PERL_INST,func_recv_coa), NULL, "recv_coa"}, { "func_send_coa", PW_TYPE_STRING_PTR, offsetof(PERL_INST,func_send_coa), NULL, "send_coa"}, #endif { "perl_flags", PW_TYPE_STRING_PTR, offsetof(PERL_INST,perl_flags), NULL, NULL}, { "func_start_accounting", PW_TYPE_STRING_PTR, offsetof(PERL_INST,func_start_accounting), NULL, NULL}, { "func_stop_accounting", PW_TYPE_STRING_PTR, offsetof(PERL_INST,func_stop_accounting), NULL, NULL}, { NULL, -1, 0, NULL, NULL } /* end the list */ }; /* * man perlembed */ EXTERN_C void boot_DynaLoader(pTHX_ CV* cv); #ifdef USE_ITHREADS #define dl_librefs "DynaLoader::dl_librefs" #define dl_modules "DynaLoader::dl_modules" static void rlm_perl_clear_handles(pTHX) { AV *librefs = get_av(dl_librefs, FALSE); if (librefs) { av_clear(librefs); } } static void **rlm_perl_get_handles(pTHX) { I32 i; AV *librefs = get_av(dl_librefs, FALSE); AV *modules = get_av(dl_modules, FALSE); void **handles; if (!librefs) return NULL; if (!(AvFILL(librefs) >= 0)) { return NULL; } handles = (void **)rad_malloc(sizeof(void *) * (AvFILL(librefs)+2)); for (i=0; i<=AvFILL(librefs); i++) { void *handle; SV *handle_sv = *av_fetch(librefs, i, FALSE); if(!handle_sv) { radlog(L_ERR, "Could not fetch $%s[%d]!\n", dl_librefs, (int)i); continue; } handle = (void *)SvIV(handle_sv); if (handle) { handles[i] = handle; } } av_clear(modules); av_clear(librefs); handles[i] = (void *)0; return handles; } static void rlm_perl_close_handles(void **handles) { int i; if (!handles) { return; } for (i=0; handles[i]; i++) { radlog(L_DBG, "close %p\n", handles[i]); dlclose(handles[i]); } free(handles); } static void rlm_perl_destruct(PerlInterpreter *perl) { dTHXa(perl); PERL_SET_CONTEXT(perl); PL_perl_destruct_level = 2; PL_origenviron = environ; { dTHXa(perl); } /* * FIXME: This shouldn't happen * */ while (PL_scopestack_ix > 1 ){ LEAVE; } perl_destruct(perl); perl_free(perl); } static void rlm_destroy_perl(PerlInterpreter *perl) { void **handles; dTHXa(perl); PERL_SET_CONTEXT(perl); handles = rlm_perl_get_handles(aTHX); if (handles) rlm_perl_close_handles(handles); rlm_perl_destruct(perl); } /* Create Key */ static void rlm_perl_make_key(pthread_key_t *key) { pthread_key_create(key, rlm_destroy_perl); } static PerlInterpreter *rlm_perl_clone(PerlInterpreter *perl, pthread_key_t *key) { PerlInterpreter *interp; UV clone_flags = 0; PERL_SET_CONTEXT(perl); interp = pthread_getspecific(*key); if (interp) return interp; interp = perl_clone(perl, clone_flags); { dTHXa(interp); } #if PERL_REVISION >= 5 && PERL_VERSION <8 call_pv("CLONE",0); #endif ptr_table_free(PL_ptr_table); PL_ptr_table = NULL; PERL_SET_CONTEXT(aTHX); rlm_perl_clear_handles(aTHX); pthread_setspecific(*key, interp); return interp; } #endif /* * * This is wrapper for radlog * Now users can call radiusd::radlog(level,msg) wich is the same * calling radlog from C code. * Boyan */ static XS(XS_radiusd_radlog) { dXSARGS; if (items !=2) croak("Usage: radiusd::radlog(level, message)"); { int level; char *msg; level = (int) SvIV(ST(0)); msg = (char *) SvPV(ST(1), PL_na); /* * Because 'msg' is a 'char *', we don't want '%s', etc. * in it to give us printf-style vulnerabilities. */ radlog(level, "rlm_perl: %s", msg); } XSRETURN_NO; } static void xs_init(pTHX) { char *file = __FILE__; /* DynaLoader is a special case */ newXS("DynaLoader::boot_DynaLoader", boot_DynaLoader, file); newXS("radiusd::radlog",XS_radiusd_radlog, "rlm_perl"); } /* * The xlat function */ static size_t perl_xlat(void *instance, REQUEST *request, char *fmt, char *out, size_t freespace, RADIUS_ESCAPE_STRING func) { PERL_INST *inst= (PERL_INST *) instance; char params[1024], *tmp; char const *p, *q; int count; size_t ret = 0; STRLEN n_a; /* * Do an xlat on the provided string (nice recursive operation). */ if (!radius_xlat(params, sizeof(params), fmt, request, func)) { radlog(L_ERR, "rlm_perl: xlat failed."); return 0; } #ifdef USE_ITHREADS pthread_mutex_lock(&inst->clone_mutex); PerlInterpreter *interp; interp = rlm_perl_clone(inst->perl,inst->thread_key); { dTHXa(interp); PERL_SET_CONTEXT(interp); } pthread_mutex_unlock(&inst->clone_mutex); #else PERL_SET_CONTEXT(inst->perl); #endif { dSP; ENTER;SAVETMPS; PUSHMARK(SP); p = fmt; while ((q = strchr(p, ' '))) { XPUSHs(sv_2mortal(newSVpv(p, p - q))); p = q + 1; } PUTBACK; count = call_pv(inst->func_xlat, G_SCALAR | G_EVAL); SPAGAIN; if (SvTRUE(ERRSV)) { RDEBUG("ERROR: Exit %s", SvPV(ERRSV,n_a)); (void)POPs; } else if (count > 0) { tmp = POPp; strlcpy(out, tmp, freespace); ret = strlen(out); RDEBUG("Len is %zu , out is %s freespace is %zu", ret, out, freespace); } PUTBACK ; FREETMPS ; LEAVE ; } return ret; } /* * Do any per-module initialization that is separate to each * configured instance of the module. e.g. set up connections * to external databases, read configuration files, set up * dictionary entries, etc. * * If configuration information is given in the config section * that must be referenced in later calls, store a handle to it * in *instance otherwise put a null pointer there. * * Boyan: * Setup a hashes wich we will use later * parse a module and give him a chance to live * */ static int perl_instantiate(CONF_SECTION *conf, void **instance) { PERL_INST *inst = (PERL_INST *) instance; HV *rad_reply_hv; HV *rad_check_hv; HV *rad_config_hv; HV *rad_request_hv; HV *rad_request_proxy_hv; HV *rad_request_proxy_reply_hv; AV *end_AV; char **embed; char **envp = NULL; const char *xlat_name; int exitstatus = 0, argc=0; embed = rad_malloc(4 * sizeof(char *)); memset(embed, 0, 4 *sizeof(char *)); /* * Set up a storage area for instance data */ inst = rad_malloc(sizeof(PERL_INST)); memset(inst, 0, sizeof(PERL_INST)); /* * If the configuration parameters can't be parsed, then * fail. */ if (cf_section_parse(conf, inst, module_config) < 0) { free(embed); free(inst); return -1; } /* * Create pthread key. This key will be stored in instance */ #ifdef USE_ITHREADS pthread_mutex_init(&inst->clone_mutex, NULL); inst->thread_key = rad_malloc(sizeof(*inst->thread_key)); memset(inst->thread_key,0,sizeof(*inst->thread_key)); rlm_perl_make_key(inst->thread_key); #endif embed[0] = NULL; if (inst->perl_flags) { embed[1] = inst->perl_flags; embed[2] = inst->module; embed[3] = "0"; argc = 4; } else { embed[1] = inst->module; embed[2] = "0"; argc = 3; } PERL_SYS_INIT3(&argc, &embed, &envp); #ifdef USE_ITHREADS if ((inst->perl = perl_alloc()) == NULL) { radlog(L_DBG, "rlm_perl: No memory for allocating new perl !"); free(embed); free(inst); return (-1); } perl_construct(inst->perl); PL_perl_destruct_level = 2; { dTHXa(inst->perl); } PERL_SET_CONTEXT(inst->perl); #else if ((inst->perl = perl_alloc()) == NULL) { radlog(L_ERR, "rlm_perl: No memory for allocating new perl !"); free(embed); free(inst); return -1; } perl_construct(inst->perl); #endif #if PERL_REVISION >= 5 && PERL_VERSION >=8 PL_exit_flags |= PERL_EXIT_DESTRUCT_END; #endif exitstatus = perl_parse(inst->perl, xs_init, argc, embed, NULL); end_AV = PL_endav; PL_endav = Nullav; if(!exitstatus) { exitstatus = perl_run(inst->perl); } else { radlog(L_ERR,"rlm_perl: perl_parse failed: %s not found or has syntax errors. \n", inst->module); free(embed); free(inst); return (-1); } PL_endav = end_AV; rad_reply_hv = newHV(); rad_check_hv = newHV(); rad_config_hv = newHV(); rad_request_hv = newHV(); rad_request_proxy_hv = newHV(); rad_request_proxy_reply_hv = newHV(); rad_reply_hv = get_hv("RAD_REPLY",1); rad_check_hv = get_hv("RAD_CHECK",1); rad_config_hv = get_hv("RAD_CONFIG",1); rad_request_hv = get_hv("RAD_REQUEST",1); rad_request_proxy_hv = get_hv("RAD_REQUEST_PROXY",1); rad_request_proxy_reply_hv = get_hv("RAD_REQUEST_PROXY_REPLY",1); xlat_name = cf_section_name2(conf); if (xlat_name == NULL) xlat_name = cf_section_name1(conf); if (xlat_name){ inst->xlat_name = strdup(xlat_name); xlat_register(xlat_name, perl_xlat, inst); } *instance = inst; return 0; } /* * get the vps and put them in perl hash * If one VP have multiple values it is added as array_ref * Example for this is Cisco-AVPair that holds multiple values. * Which will be available as array_ref in $RAD_REQUEST{'Cisco-AVPair'} */ static void perl_store_vps(VALUE_PAIR *vp, HV *rad_hv) { VALUE_PAIR *nvp, *vpa, *vpn; AV *av; char namebuf[256]; const char *name; char buffer[1024]; int attr, len; size_t namelen; hv_undef(rad_hv); nvp = paircopy(vp); while (nvp != NULL) { name = nvp->name; attr = nvp->attribute; vpa = paircopy2(nvp,attr); /* * Get the name for this attribute. */ if ((vpa->flags.has_tag) && (vpa->flags.tag != 0)) { snprintf(namebuf, sizeof(namebuf), "%s:%d", vpa->name, vpa->flags.tag); name = namebuf; } else { name = vpa->name; } namelen = strlen(name); if (vpa->next) { /* * There may be many instances of this * attribute. If so, create an * intermediate array, and store them * all. */ av = newAV(); for (vpn = vpa; vpn != NULL; vpn = vpn->next) { len = vp_prints_value(buffer, sizeof(buffer), vpn, FALSE); av_push(av, newSVpv(buffer, len)); } hv_store(rad_hv, name, namelen, newRV_noinc((SV *) av), 0); } else { len = vp_prints_value(buffer, sizeof(buffer), vpa, FALSE); hv_store(rad_hv, name, namelen, newSVpv(buffer, len), 0); } pairfree(&vpa); vpa = nvp; while ((vpa != NULL) && (vpa->attribute == attr)) vpa = vpa->next; pairdelete(&nvp, attr); nvp = vpa; } } /* * * Verify that a Perl SV is a string and save it in FreeRadius * Value Pair Format * */ static int pairadd_sv(VALUE_PAIR **vp, char *key, SV *sv, int operator) { char *val; VALUE_PAIR *vpp; if (SvOK(sv)) { val = SvPV_nolen(sv); vpp = pairmake(key, val, operator); if (vpp != NULL) { pairadd(vp, vpp); radlog(L_DBG, "rlm_perl: Added pair %s = %s", key, val); return 1; } else { radlog(L_DBG, "rlm_perl: ERROR: Failed to create pair %s = %s", key, val); } } return 0; } /* * Boyan : * Gets the content from hashes */ static int get_hv_content(HV *my_hv, VALUE_PAIR **vp) { SV *res_sv, **av_sv; AV *av; char *key; I32 key_len, len, i, j; int ret=0; *vp = NULL; for (i = hv_iterinit(my_hv); i > 0; i--) { res_sv = hv_iternextsv(my_hv,&key,&key_len); if (SvROK(res_sv) && (SvTYPE(SvRV(res_sv)) == SVt_PVAV)) { av = (AV*)SvRV(res_sv); len = av_len(av); for (j = 0; j <= len; j++) { av_sv = av_fetch(av, j, 0); ret = pairadd_sv(vp, key, *av_sv, T_OP_ADD) + ret; } } else ret = pairadd_sv(vp, key, res_sv, T_OP_EQ) + ret; } return ret; } /* * Call the function_name inside the module * Store all vps in hashes %RAD_CHECK %RAD_REPLY %RAD_REQUEST * */ static int rlmperl_call(void *instance, REQUEST *request, char *function_name) { PERL_INST *inst = instance; VALUE_PAIR *vp; int exitstatus=0, count; STRLEN n_a; HV *rad_reply_hv; HV *rad_check_hv; HV *rad_config_hv; HV *rad_request_hv; HV *rad_request_proxy_hv; HV *rad_request_proxy_reply_hv; #ifdef USE_ITHREADS pthread_mutex_lock(&inst->clone_mutex); PerlInterpreter *interp; interp = rlm_perl_clone(inst->perl,inst->thread_key); { dTHXa(interp); PERL_SET_CONTEXT(interp); } pthread_mutex_unlock(&inst->clone_mutex); #else PERL_SET_CONTEXT(inst->perl); #endif { dSP; ENTER; SAVETMPS; /* * Radius has told us to call this function, but none * is defined. */ if (!function_name) { return RLM_MODULE_FAIL; } rad_reply_hv = get_hv("RAD_REPLY",1); rad_check_hv = get_hv("RAD_CHECK",1); rad_config_hv = get_hv("RAD_CONFIG",1); rad_request_hv = get_hv("RAD_REQUEST",1); rad_request_proxy_hv = get_hv("RAD_REQUEST_PROXY",1); rad_request_proxy_reply_hv = get_hv("RAD_REQUEST_PROXY_REPLY",1); perl_store_vps(request->reply->vps, rad_reply_hv); perl_store_vps(request->config_items, rad_check_hv); perl_store_vps(request->packet->vps, rad_request_hv); perl_store_vps(request->config_items, rad_config_hv); if (request->proxy != NULL) { perl_store_vps(request->proxy->vps, rad_request_proxy_hv); } else { hv_undef(rad_request_proxy_hv); } if (request->proxy_reply !=NULL) { perl_store_vps(request->proxy_reply->vps, rad_request_proxy_reply_hv); } else { hv_undef(rad_request_proxy_reply_hv); } PUSHMARK(SP); /* * This way %RAD_xx can be pushed onto stack as sub parameters. * XPUSHs( newRV_noinc((SV *)rad_request_hv) ); * XPUSHs( newRV_noinc((SV *)rad_reply_hv) ); * XPUSHs( newRV_noinc((SV *)rad_check_hv) ); * PUTBACK; */ count = call_pv(function_name, G_SCALAR | G_EVAL | G_NOARGS); SPAGAIN; if (SvTRUE(ERRSV)) { radlog(L_ERR, "rlm_perl: perl_embed:: module = %s , func = %s exit status= %s\n", inst->module, function_name, SvPV(ERRSV,n_a)); POPs; } if (count == 1) { exitstatus = POPi; if (exitstatus >= 100 || exitstatus < 0) { exitstatus = RLM_MODULE_FAIL; } } PUTBACK; FREETMPS; LEAVE; vp = NULL; if ((get_hv_content(rad_request_hv, &vp)) > 0 ) { pairfree(&request->packet->vps); request->packet->vps = vp; vp = NULL; /* * Update cached copies */ request->username = pairfind(request->packet->vps, PW_USER_NAME); request->password = pairfind(request->packet->vps, PW_USER_PASSWORD); if (!request->password) request->password = pairfind(request->packet->vps, PW_CHAP_PASSWORD); } if ((get_hv_content(rad_reply_hv, &vp)) > 0 ) { pairfree(&request->reply->vps); request->reply->vps = vp; vp = NULL; } if ((get_hv_content(rad_check_hv, &vp)) > 0 ) { pairfree(&request->config_items); request->config_items = vp; vp = NULL; } if (request->proxy && (get_hv_content(rad_request_proxy_hv, &vp) > 0)) { pairfree(&request->proxy->vps); request->proxy->vps = vp; vp = NULL; } if (request->proxy_reply && (get_hv_content(rad_request_proxy_reply_hv, &vp) > 0)) { pairfree(&request->proxy_reply->vps); request->proxy_reply->vps = vp; vp = NULL; } } return exitstatus; } /* * Find the named user in this modules database. Create the set * of attribute-value pairs to check and reply with for this user * from the database. The authentication code only needs to check * the password, the rest is done here. */ static int perl_authorize(void *instance, REQUEST *request) { return rlmperl_call(instance, request, ((PERL_INST *)instance)->func_authorize); } /* * Authenticate the user with the given password. */ static int perl_authenticate(void *instance, REQUEST *request) { return rlmperl_call(instance, request, ((PERL_INST *)instance)->func_authenticate); } /* * Massage the request before recording it or proxying it */ static int perl_preacct(void *instance, REQUEST *request) { return rlmperl_call(instance, request, ((PERL_INST *)instance)->func_preacct); } /* * Write accounting information to this modules database. */ static int perl_accounting(void *instance, REQUEST *request) { VALUE_PAIR *pair; int acctstatustype=0; if ((pair = pairfind(request->packet->vps, PW_ACCT_STATUS_TYPE)) != NULL) { acctstatustype = pair->vp_integer; } else { radlog(L_ERR, "Invalid Accounting Packet"); return RLM_MODULE_INVALID; } switch (acctstatustype) { case PW_STATUS_START: if (((PERL_INST *)instance)->func_start_accounting) { return rlmperl_call(instance, request, ((PERL_INST *)instance)->func_start_accounting); } else { return rlmperl_call(instance, request, ((PERL_INST *)instance)->func_accounting); } break; case PW_STATUS_STOP: if (((PERL_INST *)instance)->func_stop_accounting) { return rlmperl_call(instance, request, ((PERL_INST *)instance)->func_stop_accounting); } else { return rlmperl_call(instance, request, ((PERL_INST *)instance)->func_accounting); } break; default: return rlmperl_call(instance, request, ((PERL_INST *)instance)->func_accounting); } } /* * Check for simultaneouse-use */ static int perl_checksimul(void *instance, REQUEST *request) { return rlmperl_call(instance, request, ((PERL_INST *)instance)->func_checksimul); } /* * Pre-Proxy request */ static int perl_pre_proxy(void *instance, REQUEST *request) { return rlmperl_call(instance, request, ((PERL_INST *)instance)->func_pre_proxy); } /* * Post-Proxy request */ static int perl_post_proxy(void *instance, REQUEST *request) { return rlmperl_call(instance, request, ((PERL_INST *)instance)->func_post_proxy); } /* * Pre-Auth request */ static int perl_post_auth(void *instance, REQUEST *request) { return rlmperl_call(instance, request, ((PERL_INST *)instance)->func_post_auth); } #ifdef WITH_COA /* * Recv CoA request */ static int perl_recv_coa(void *instance, REQUEST *request) { return rlmperl_call(instance, request, ((PERL_INST *)instance)->func_recv_coa); } /* * Send CoA request */ static int perl_send_coa(void *instance, REQUEST *request) { return rlmperl_call(instance, request, ((PERL_INST *)instance)->func_send_coa); } #endif /* * Detach a instance give a chance to a module to make some internal setup ... */ static int perl_detach(void *instance) { PERL_INST *inst = (PERL_INST *) instance; int exitstatus = 0, count = 0; #if 0 /* * FIXME: Call this in the destruct function? */ { dTHXa(handle->clone); PERL_SET_CONTEXT(handle->clone); { dSP; ENTER; SAVETMPS; PUSHMARK(SP); count = call_pv(inst->func_detach, G_SCALAR | G_EVAL ); SPAGAIN; if (count == 1) { exitstatus = POPi; /* * FIXME: bug in perl * */ if (exitstatus >= 100 || exitstatus < 0) { exitstatus = RLM_MODULE_FAIL; } } PUTBACK; FREETMPS; LEAVE; } } #endif if (inst->func_detach) { dTHXa(inst->perl); PERL_SET_CONTEXT(inst->perl); { dSP; ENTER; SAVETMPS; PUSHMARK(SP); count = call_pv(inst->func_detach, G_SCALAR | G_EVAL ); SPAGAIN; if (count == 1) { exitstatus = POPi; if (exitstatus >= 100 || exitstatus < 0) { exitstatus = RLM_MODULE_FAIL; } } PUTBACK; FREETMPS; LEAVE; } } xlat_unregister(inst->xlat_name, perl_xlat, instance); free(inst->xlat_name); #ifdef USE_ITHREADS rlm_perl_destruct(inst->perl); pthread_mutex_destroy(&inst->clone_mutex); #else perl_destruct(inst->perl); perl_free(inst->perl); #endif PERL_SYS_TERM(); free(inst); return exitstatus; } /* * The module name should be the only globally exported symbol. * That is, everything else should be 'static'. * * If the module needs to temporarily modify it's instantiation * data, the type should be changed to RLM_TYPE_THREAD_UNSAFE. * The server will then take care of ensuring that the module * is single-threaded. */ module_t rlm_perl = { RLM_MODULE_INIT, "perl", /* Name */ #ifdef USE_ITHREADS RLM_TYPE_THREAD_SAFE, /* type */ #else RLM_TYPE_THREAD_UNSAFE, #endif perl_instantiate, /* instantiation */ perl_detach, /* detach */ { perl_authenticate, /* authenticate */ perl_authorize, /* authorize */ perl_preacct, /* preacct */ perl_accounting, /* accounting */ perl_checksimul, /* check simul */ perl_pre_proxy, /* pre-proxy */ perl_post_proxy, /* post-proxy */ perl_post_auth /* post-auth */ #ifdef WITH_COA , perl_recv_coa, perl_send_coa #endif }, }; freeradius-server/src/modules/rlm_policy/000077500000000000000000000000001257552170400211335ustar00rootroot00000000000000freeradius-server/src/modules/rlm_policy/Makefile000066400000000000000000000002751257552170400225770ustar00rootroot00000000000000# # Makefile # # Version: $Id$ # TARGET = rlm_policy SRCS = rlm_policy.c parse.c evaluate.c HEADERS = rlm_policy.h RLM_CFLAGS = RLM_LIBS = include ../rules.mak $(LT_OBJS): $(HEADERS) freeradius-server/src/modules/rlm_policy/evaluate.c000066400000000000000000000662411257552170400231160ustar00rootroot00000000000000/* * evaluate.c Evaluate a policy language * * Version: $Id$ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2004 Alan DeKok * Copyright 2006 The FreeRADIUS server project */ #include RCSID("$Id$") #include "rlm_policy.h" #ifdef HAVE_REGEX_H #include #endif #define debug_evaluate if (0) printf /* * Print stuff we've parsed */ static void policy_print(const policy_item_t *item, int indent) { if (!item) { if (indent) fprintf(fr_log_fp, "%*s", indent, " "); fprintf(fr_log_fp, "[NULL]\n"); return; } while (item) { switch (item->type) { case POLICY_TYPE_BAD: if (indent) fprintf(fr_log_fp, "%*s", indent, " "); fprintf(fr_log_fp, "[BAD STATEMENT]"); break; case POLICY_TYPE_PRINT: if (indent) fprintf(fr_log_fp, "%*s", indent, " "); { const policy_print_t *this; this = (const policy_print_t *) item; if (this->rhs_type == POLICY_LEX_BARE_WORD) { fprintf(fr_log_fp, "print %s\n", this->rhs); } else { fprintf(fr_log_fp, "print \"%s\"\n", this->rhs); } } break; case POLICY_TYPE_ASSIGNMENT: { const policy_assignment_t *assign; assign = (const policy_assignment_t *) item; if (indent) fprintf(fr_log_fp, "%*s", indent, " "); fprintf(fr_log_fp, "\t%s %s ", assign->lhs, fr_int2str(rlm_policy_tokens, assign->assign, "?")); if (assign->rhs_type == POLICY_LEX_BARE_WORD) { fprintf(fr_log_fp, "%s\n", assign->rhs); } else { /* * FIXME: escape " */ fprintf(fr_log_fp, "\"%s\"\n", assign->rhs); } } break; case POLICY_TYPE_CONDITIONAL: /* no indentation here */ { const policy_condition_t *condition; condition = (const policy_condition_t *) item; fprintf(fr_log_fp, "("); if (condition->sense) { fprintf(fr_log_fp, "!"); } /* * Nested conditions. */ if (condition->compare == POLICY_LEX_L_BRACKET) { policy_print(condition->child, indent); fprintf(fr_log_fp, ")"); break; } if (condition->compare == POLICY_LEX_L_NOT) { fprintf(fr_log_fp, "!"); policy_print(condition->child, indent); fprintf(fr_log_fp, ")"); break; } if (condition->compare == POLICY_LEX_CMP_TRUE) { fprintf(fr_log_fp, "%s)", condition->lhs); break; } if (condition->lhs_type == POLICY_LEX_FUNCTION) { fprintf(fr_log_fp, "%s()", condition->lhs); } else { /* * FIXME: escape ", * and move all of this logic * to a function. */ fprintf(fr_log_fp, "\"%s\"", condition->lhs); } /* * We always print this condition. */ fprintf(fr_log_fp, " %s ", fr_int2str(rlm_policy_tokens, condition->compare, "?")); if (condition->rhs_type == POLICY_LEX_BARE_WORD) { fprintf(fr_log_fp, "%s", condition->rhs); } else { /* * FIXME: escape ", * and move all of this logic * to a function. */ fprintf(fr_log_fp, "\"%s\"", condition->rhs); } fprintf(fr_log_fp, ")"); if ((condition->child_condition != POLICY_LEX_BAD) && (condition->child_condition != POLICY_LEX_BARE_WORD)) { fprintf(fr_log_fp, " %s ", fr_int2str(rlm_policy_tokens, condition->child_condition, "?")); policy_print(condition->child, indent); } } break; case POLICY_TYPE_IF: { const policy_if_t *statement; statement = (const policy_if_t *) item; if (indent) fprintf(fr_log_fp, "%*s", indent, " "); fprintf(fr_log_fp, "if "); policy_print(statement->condition, indent); fprintf(fr_log_fp, " {\n"); policy_print(statement->if_true, indent + 1); if (indent) fprintf(fr_log_fp, "%*s", indent, " "); if (statement->if_false) { fprintf(fr_log_fp, "} else "); if (statement->if_false->type == POLICY_TYPE_ASSIGNMENT) { fprintf(fr_log_fp, " { "); policy_print(statement->if_false, indent + 1); if (indent) fprintf(fr_log_fp, "%*s", indent, " "); fprintf(fr_log_fp, " }"); } else { policy_print(statement->if_false, indent + 1); } } else { fprintf(fr_log_fp, "}\n"); } } break; case POLICY_TYPE_ATTRIBUTE_LIST: { const policy_attributes_t *this; this = (const policy_attributes_t *) item; if (indent) fprintf(fr_log_fp, "%*s", indent, " "); fprintf(fr_log_fp, "%s %s {\n", fr_int2str(policy_reserved_words, this->where, "?"), fr_int2str(rlm_policy_tokens, this->how, "?")); policy_print(this->attributes, indent + 1); if (indent) fprintf(fr_log_fp, "%*s", indent, " "); fprintf(fr_log_fp, "}\n"); } break; case POLICY_TYPE_NAMED_POLICY: { const policy_named_t *this; this = (const policy_named_t *) item; if (indent) fprintf(fr_log_fp, "%*s", indent, " "); fprintf(fr_log_fp, "policy %s {\n", this->name); policy_print(this->policy, indent + 1); if (indent) fprintf(fr_log_fp, "%*s", indent, " "); fprintf(fr_log_fp, "}\n"); } break; case POLICY_TYPE_CALL: { const policy_call_t *this; this = (const policy_call_t *) item; if (indent) fprintf(fr_log_fp, "%*s", indent, " "); fprintf(fr_log_fp, "call %s\n", this->name); } break; case POLICY_TYPE_RETURN: { const policy_return_t *this; this = (const policy_return_t *) item; if (indent) fprintf(fr_log_fp, "%*s", indent, " "); fprintf(fr_log_fp, "return %s\n", fr_int2str(policy_return_codes, this->rcode, "???")); } break; case POLICY_TYPE_MODULE: { const policy_module_t *this; this = (const policy_module_t *) item; if (indent) fprintf(fr_log_fp, "%*s", indent, " "); fprintf(fr_log_fp, "module %s \n", fr_int2str(policy_component_names, this->component, "???")); } break; default: if (indent) fprintf(fr_log_fp, "%*s", indent, " "); fprintf(fr_log_fp, "[HUH?]\n"); break; } item = item->next; } } void rlm_policy_print(const policy_item_t *item) { if (!fr_log_fp) return; fprintf(fr_log_fp, "# rlm_policy \n"); policy_print(item, 0); } /* * Internal stack of things to do. This lets us have function * calls... * * Yes, we should learn lex, yacc, etc. */ #define POLICY_MAX_STACK 16 typedef struct policy_state_t { rlm_policy_t *inst; REQUEST *request; /* so it's not passed on the C stack */ int rcode; /* for functions, etc. */ int component; /* for calling other modules */ int depth; const policy_item_t *stack[POLICY_MAX_STACK]; } policy_state_t; static int policy_evaluate_name(policy_state_t *state, const char *name); /* * Push an item onto the state. */ static int policy_stack_push(policy_state_t *state, const policy_item_t *item) { rad_assert(state->depth >= 0); /* * Asked to push nothing. Don't push it. */ if (!item) return 1; /* * State is full. Die. */ if (state->depth >= POLICY_MAX_STACK) { return 0; } /* * Walk back up the stack, looking for previous ocurrances * of this name. If found, we have infinite recursion, * which we stop dead in the water! * * This isn't strictly necessary right now, as we look up * policies by name when they're first referenced. This * means that ALL references are backwards (to the start * of the file), which means that there are no circular * references. */ if (item->type == POLICY_TYPE_NAMED_POLICY) { int i; for (i = 0; i < state->depth; i++) { /* * Check for circular references, by seeing * if the function is already on the stack. * * Hmmm... do we want to do this for any type? */ if (state->stack[i] == item) { debug_evaluate("Circular call to policy %s\n", ((const policy_named_t *) item)->name); return 0; } } } debug_evaluate("push %d %p\n", state->depth, item); state->stack[state->depth] = item; state->depth++; /* points to unused entry */ return 1; } /* * Pop an item from the state. */ static int policy_stack_pop(policy_state_t *state, const policy_item_t **pitem) { rad_assert(pitem != NULL); rad_assert(state->depth >= 0); redo: if (state->depth == 0) { *pitem = NULL; return 0; } *pitem = state->stack[state->depth - 1]; /* * Named policies are on the stack for catching recursion. */ if ((*pitem)->type == POLICY_TYPE_NAMED_POLICY) { state->depth--; goto redo; } /* * Process the whole item list. */ if ((*pitem)->next) { state->stack[state->depth - 1] = (*pitem)->next; debug_evaluate("pop/push %d %p\n", state->depth - 1, *pitem); } else { state->depth--; /* points to unused entry */ debug_evaluate("pop %d %p\n", state->depth, *pitem); } return 1; } /* * Evaluate a print statement */ static int evaluate_print(policy_state_t *state, const policy_item_t *item) { const policy_print_t *this; if (!fr_log_fp) return 1; this = (const policy_print_t *) item; if (this->rhs_type == POLICY_LEX_BARE_WORD) { fprintf(fr_log_fp, "%s\n", this->rhs); } else { char buffer[1024]; radius_xlat(buffer, sizeof(buffer), this->rhs, state->request, NULL); fprintf(fr_log_fp, "%s", buffer); if (!strchr(buffer, '\n')) fprintf(fr_log_fp, "\n"); } /* * Doesn't change state->rcode */ return 1; } /* * Return a VALUE_PAIR, given an attribute name. * * FIXME: Have it return the N'th one, too, like * doc/variables.txt? * * The amount of duplicated code is getting annoying... */ static VALUE_PAIR *find_vp(REQUEST *request, const char *name) { const char *p; const DICT_ATTR *dattr; VALUE_PAIR *vps; p = name; vps = request->packet->vps;; /* * FIXME: use names from reserved word list? */ if (strncasecmp(name, "request:", 8) == 0) { p += 8; } else if (strncasecmp(name, "reply:", 6) == 0) { p += 6; vps = request->reply->vps; } else if (strncasecmp(name, "proxy-request:", 14) == 0) { p += 14; if (request->proxy) { vps = request->proxy->vps; } } else if (strncasecmp(name, "proxy-reply:", 12) == 0) { p += 12; if (request->proxy_reply) { vps = request->proxy_reply->vps; } } else if (strncasecmp(name, "control:", 8) == 0) { p += 8; vps = request->config_items; } /* else it must be a bare attribute name */ if (!vps) { return NULL; } dattr = dict_attrbyname(p); if (!dattr) { fprintf(stderr, "No such attribute %s\n", p); return NULL; /* no such attribute */ } return pairfind(vps, dattr->attr); } /* * Evaluate an assignment * * Not really used much... */ static int evaluate_assignment(UNUSED policy_state_t *state, const policy_item_t *item) { const policy_assignment_t *this; #if 0 const DICT_ATTR *dattr; #endif this = (const policy_assignment_t *) item; rad_assert(this->lhs != NULL); rad_assert(this->rhs != NULL); #if 0 dattr = dict_attrbyname(this->lhs); if (!dattr) { fprintf(stderr, "HUH?\n"); return 0; } #endif return 1; } /* * Evaluate a condition */ static int evaluate_condition(policy_state_t *state, const policy_item_t *item) { int rcode; const policy_condition_t *this; VALUE_PAIR *vp = NULL; const char *data = NULL; int compare; #ifdef HAVE_REGEX_H regex_t reg; #endif char buffer[256]; char lhs_buffer[2048]; this = (const policy_condition_t *) item; redo: /* * FIXME: Don't always do this... */ if (this->compare != POLICY_LEX_L_BRACKET) { if (this->lhs_type == POLICY_LEX_FUNCTION) { /* * We can't call evaluate_call here, * because that just pushes stuff onto * the stack, and we want to actually * evaluate all of it... */ rcode = policy_evaluate_name(state, this->lhs); data = fr_int2str(policy_return_codes, rcode, "???"); strlcpy(lhs_buffer, data, sizeof(lhs_buffer)); /* FIXME: yuck */ } else if (this->lhs_type == POLICY_LEX_DOUBLE_QUOTED_STRING) { if (radius_xlat(lhs_buffer, sizeof(lhs_buffer), this->lhs, state->request, NULL) > 0) { data = lhs_buffer; } } } switch (this->compare) { case POLICY_LEX_L_BRACKET: /* nested brackets are a special case */ rcode = evaluate_condition(state, this->child); break; case POLICY_LEX_L_NOT: rcode = evaluate_condition(state, this->child); rcode = (rcode == FALSE); /* reverse sense of test */ break; case POLICY_LEX_CMP_FALSE: /* non-existence */ if (this->lhs_type == POLICY_LEX_BARE_WORD) { vp = find_vp(state->request, this->lhs); rcode = (vp == NULL); } else { rcode = (data == NULL); } break; case POLICY_LEX_CMP_TRUE: /* existence */ if (this->lhs_type == POLICY_LEX_BARE_WORD) { vp = find_vp(state->request, this->lhs); rcode = (vp != NULL); } else { rcode = (data != NULL); } break; default: /* process other comparisons */ if ((this->compare != POLICY_LEX_CMP_EQUALS) && #ifdef HAVE_REGEX_H (this->compare != POLICY_LEX_RX_EQUALS) && (this->compare != POLICY_LEX_RX_NOT_EQUALS) && #endif (this->compare != POLICY_LEX_LT) && (this->compare != POLICY_LEX_GT) && (this->compare != POLICY_LEX_LE) && (this->compare != POLICY_LEX_GE) && (this->compare != POLICY_LEX_CMP_NOT_EQUALS)) { fprintf(stderr, "%d: bad comparison\n", this->item.lineno); return FALSE; } if (this->lhs_type == POLICY_LEX_BARE_WORD) { VALUE_PAIR *myvp; vp = find_vp(state->request, this->lhs); /* * A op B is FALSE if A doesn't * exist. */ if (!vp) { rcode = FALSE; break; } /* * FIXME: Move sanity checks to * post-parse code, so we don't do * it on every packet. */ vp_prints_value(buffer, sizeof(buffer), vp, 0); myvp = pairmake(vp->name, this->rhs, T_OP_EQ); if (!myvp) return FALSE; /* memory failure */ data = buffer; /* * FIXME: What to do about comparisons * where vp doesn't exist? Right now, * "simplepaircmp" returns -1, which is * probably a bad idea. it should * instead take an operator, a pointer to * the comparison result, and return * "true/false" for "comparions * succeeded/failed", which are different * error codes than "comparison is less * than, equal to, or greater than zero". */ compare = radius_callback_compare(state->request, vp, myvp, NULL, NULL); pairfree(&myvp); } else { /* * FIXME: Do something for RHS type? */ fr_printf_log("CMP %s %s\n", lhs_buffer, this->rhs); compare = strcmp(lhs_buffer, this->rhs); } debug_evaluate("CONDITION COMPARE %d\n", compare); switch (this->compare) { case POLICY_LEX_CMP_EQUALS: rcode = (compare == 0); break; case POLICY_LEX_CMP_NOT_EQUALS: rcode = (compare != 0); break; case POLICY_LEX_LT: rcode = (compare < 0); break; case POLICY_LEX_GT: rcode = (compare > 0); break; case POLICY_LEX_LE: rcode =(compare <= 0); break; case POLICY_LEX_GE: rcode = (compare >= 0); break; #ifdef HAVE_REGEX_H case POLICY_LEX_RX_EQUALS: { /* FIXME: copied from src/main/valuepair.c */ int i; regmatch_t rxmatch[REQUEST_MAX_REGEX + 1]; /* * Include substring matches. */ if (regcomp(®, this->rhs, REG_EXTENDED) != 0) { /* FIXME: print error */ return FALSE; } rad_assert(data != NULL); rcode = regexec(®, data, REQUEST_MAX_REGEX + 1, rxmatch, 0); rcode = (rcode == 0); regfree(®); /* * Add %{0}, %{1}, etc. */ for (i = 0; i <= REQUEST_MAX_REGEX; i++) { char *p; char rxbuffer[256]; /* * Didn't match: delete old * match, if it existed. */ if (!rcode || (rxmatch[i].rm_so == -1)) { p = request_data_get(state->request, state->request, REQUEST_DATA_REGEX | i); if (p) { free(p); continue; } /* * No previous match * to delete, stop. */ break; } /* * Copy substring into buffer. */ memcpy(rxbuffer, data + rxmatch[i].rm_so, rxmatch[i].rm_eo - rxmatch[i].rm_so); rxbuffer[rxmatch[i].rm_eo - rxmatch[i].rm_so] = '\0'; /* * Copy substring, and add it to * the request. * * Note that we don't check * for out of memory, which is * the only error we can get... */ p = strdup(rxbuffer); request_data_add(state->request, state->request, REQUEST_DATA_REGEX | i, p, free); } } break; case POLICY_LEX_RX_NOT_EQUALS: regcomp(®, this->rhs, REG_EXTENDED|REG_NOSUB); rad_assert(data != NULL); rcode = regexec(®, data, 0, NULL, 0); rcode = (rcode != 0); regfree(®); break; #endif /* HAVE_REGEX_H */ default: rcode = FALSE; break; } /* switch over comparison operators */ break; /* default from first switch over compare */ } if (this->sense) rcode = (rcode == FALSE); /* reverse sense of test */ /* * No trailing &&, || */ switch (this->child_condition) { default: return rcode; case POLICY_LEX_L_AND: if (!rcode) return rcode; /* FALSE && x == FALSE */ break; case POLICY_LEX_L_OR: if (rcode) return rcode; /* TRUE && x == TRUE */ break; } /* * Tail recursion. */ this = (const policy_condition_t *) this->child; goto redo; return 1; /* should never reach here */ } /* * Evaluate an 'if' statement */ static int evaluate_if(policy_state_t *state, const policy_item_t *item) { int rcode; const policy_if_t *this; this = (const policy_if_t *) item; /* * evaluate_condition calls itself recursively. * We should probably allocate a new state, instead. */ rcode = evaluate_condition(state, this->condition); debug_evaluate("IF condition returned %s\n", rcode ? "true" : "false"); if (rcode) { rcode = policy_stack_push(state, this->if_true); if (!rcode) return rcode; } else if (this->if_false) { rcode = policy_stack_push(state, this->if_false); if (!rcode) return rcode; } /* * 'if' can fail, if the block it's processing fails. */ return 1;; } /* * Make a VALUE_PAIR from a policy_assignment_t* * * The assignment operator has to be '='. */ static VALUE_PAIR *assign2vp(REQUEST *request, const policy_assignment_t *assign) { VALUE_PAIR *vp; FR_TOKEN operator = T_OP_EQ; const char *value = assign->rhs; char buffer[2048]; if ((assign->rhs_type == POLICY_LEX_DOUBLE_QUOTED_STRING) && (strchr(assign->rhs, '%') != NULL)) { radius_xlat(buffer, sizeof(buffer), assign->rhs, request, NULL); value = buffer; } /* * This is crappy.. fix it. */ switch (assign->assign) { case POLICY_LEX_ASSIGN: operator = T_OP_EQ; break; case POLICY_LEX_SET_EQUALS: operator = T_OP_SET; break; case POLICY_LEX_PLUS_EQUALS: operator = T_OP_ADD; break; default: fprintf(stderr, "Expected '=' for operator, not '%s' at line %d\n", fr_int2str(rlm_policy_tokens, assign->assign, "?"), assign->item.lineno); return NULL; } vp = pairmake(assign->lhs, value, operator); if (!vp) { fprintf(stderr, "Failed creating pair: %s %s\n", value, fr_strerror()); } return vp; } /* * Evaluate a 'packet .= {attrs}' statement */ static int evaluate_attr_list(policy_state_t *state, const policy_item_t *item) { const policy_attributes_t *this; VALUE_PAIR **vps = NULL; VALUE_PAIR *vp, *head, **tail; const policy_item_t *attr; policy_lex_t this_how; this = (const policy_attributes_t *) item; switch (this->where) { case POLICY_RESERVED_CONTROL: vps = &(state->request->config_items); break; case POLICY_RESERVED_REQUEST: vps = &(state->request->packet->vps); break; case POLICY_RESERVED_REPLY: vps = &(state->request->reply->vps); break; case POLICY_RESERVED_PROXY_REQUEST: if (!state->request->proxy) return 0; /* FIXME: print error */ vps = &(state->request->proxy->vps); break; case POLICY_RESERVED_PROXY_REPLY: if (!state->request->proxy_reply) return 0; /* FIXME: print error */ vps = &(state->request->proxy_reply->vps); break; default: return 0; } head = NULL; tail = &head; for (attr = this->attributes; attr != NULL; attr = attr->next) { if (attr->type != POLICY_TYPE_ASSIGNMENT) { fprintf(stderr, "bad assignment in attribute list at line %d\n", attr->lineno); pairfree(&head); return 0; } vp = assign2vp(state->request, (const policy_assignment_t *) attr); if (!vp) { fprintf(stderr, "Failed to allocate VP\n"); pairfree(&head); return 0; } *tail = vp; tail = &(vp->next); } this_how = this->how; retry_how: switch (this_how) { case POLICY_LEX_SET_EQUALS: /* dangerous: removes all previous things! */ pairfree(vps); *vps = head; break; case POLICY_LEX_AFTER_TAIL_ASSIGN: pairmove(vps, &head); pairfree(&head); break; case POLICY_LEX_ASSIGN: /* 'union' */ pairmove(vps, &head); pairfree(&head); break; case POLICY_LEX_BEFORE_HEAD_ASSIGN: pairmove(&head, vps); pairfree(vps); *vps = head; break; case POLICY_LEX_AFTER_TAIL_EQUALS: case POLICY_LEX_CONCAT_EQUALS: pairadd(vps, head); break; case POLICY_LEX_BEFORE_HEAD_EQUALS: pairadd(&head, *vps); *vps = head; break; case POLICY_LEX_BEFORE_WHERE_EQUALS: case POLICY_LEX_AFTER_WHERE_EQUALS: case POLICY_LEX_BEFORE_WHERE_ASSIGN: case POLICY_LEX_AFTER_WHERE_ASSIGN: /* find location*/ { VALUE_PAIR *vpprev = NULL, *vpnext = NULL, *lvp; for(lvp = *vps; lvp; vpprev = lvp, lvp = lvp->next) { vpnext = lvp->next; lvp->next = NULL; if (evaluate_condition(state, this->where_loc)) break; lvp->next = vpnext; } if (lvp) { switch(this_how) { case POLICY_LEX_BEFORE_WHERE_EQUALS: case POLICY_LEX_BEFORE_WHERE_ASSIGN: if (vpprev) { lvp->next = vpnext; vpnext = lvp; vpprev->next = NULL; lvp = vpprev; } default: /* always reached */ break; } switch(this_how) { case POLICY_LEX_BEFORE_WHERE_EQUALS: if (vpprev) pairadd(&lvp, head); else *vps = lvp = head; break; case POLICY_LEX_AFTER_WHERE_EQUALS: pairadd(&lvp, head); break; case POLICY_LEX_BEFORE_WHERE_ASSIGN: if (vpprev) { pairmove(&lvp, &head); pairfree(&head); } else *vps = lvp = head; break; case POLICY_LEX_AFTER_WHERE_ASSIGN: pairmove(&lvp, &head); pairfree(&head); break; default:/*never reached*/ break; } for( ; lvp && lvp->next; lvp = lvp->next); if (lvp) lvp->next = vpnext; break; } switch(this_how) { case POLICY_LEX_BEFORE_WHERE_EQUALS: this_how = POLICY_LEX_BEFORE_HEAD_EQUALS; break; case POLICY_LEX_AFTER_WHERE_EQUALS: this_how = POLICY_LEX_AFTER_TAIL_EQUALS; break; case POLICY_LEX_BEFORE_WHERE_ASSIGN: this_how = POLICY_LEX_BEFORE_HEAD_ASSIGN; break; case POLICY_LEX_AFTER_WHERE_ASSIGN: this_how = POLICY_LEX_AFTER_TAIL_ASSIGN; break; default: /*never reached*/ break; } goto retry_how; } /* FALL-THROUGH */ default: fprintf(stderr, "HUH?\n"); pairfree(&head); return 0; } state->rcode = RLM_MODULE_UPDATED; /* we did stuff */ return 1; } /* * Evaluate a reference call to a module. */ static int evaluate_call(policy_state_t *state, const policy_item_t *item) { int rcode; const policy_call_t *this; const policy_named_t *policy; this = (const policy_call_t *) item; policy = rlm_policy_find(state->inst->policies, this->name); if (!policy) return 0; /* not found... */ DEBUG2("rlm_policy: Evaluating policy %s", this->name); rad_assert(policy->policy->type != POLICY_TYPE_BAD); rad_assert(policy->policy->type < POLICY_TYPE_NUM_TYPES); /* * Push the name of the function onto the stack, * so that we can catch recursive calls. * * The "pop" function will skip over it when it sees it. */ rcode = policy_stack_push(state, (const policy_item_t *) policy); if (!rcode) { return rcode; } /* * Push it onto the stack. Other code will take care of * calling it. */ rcode = policy_stack_push(state, policy->policy); if (!rcode) { return rcode; } return 1; } /* * Evaluate a return statement */ static int evaluate_return(policy_state_t *state, const policy_item_t *item) { const policy_return_t *this; this = (const policy_return_t *) item; state->rcode = this->rcode; return 1; /* we succeeded */ } /* * Evaluate a module statement */ static int evaluate_module(policy_state_t *state, const policy_item_t *item) { const policy_module_t *this; this = (const policy_module_t *) item; /* * Just to be paranoid. Maybe we want to loosen this * restriction in the future? */ if (this->component != state->component) { DEBUG2("rlm_policy: Cannot mix & match components"); return 0; } DEBUG2("rlm_policy: begin nested call"); state->rcode = modcall(this->component, this->mc, state->request); DEBUG2("rlm_policy: end nested call"); return 1; /* we succeeded */ } /* * State machine stuff. */ typedef int (*policy_evaluate_type_t)(policy_state_t *, const policy_item_t *); /* * MUST be kept in sync with policy_type_t */ static policy_evaluate_type_t evaluate_functions[POLICY_TYPE_NUM_TYPES] = { NULL, /* POLICY_TYPE_BAD */ evaluate_if, evaluate_condition, evaluate_assignment, evaluate_attr_list, evaluate_print, NULL, /* define a named policy.. */ evaluate_call, evaluate_return, evaluate_module }; /* * Evaluate a policy, keyed by name. */ static int policy_evaluate_name(policy_state_t *state, const char *name) { int rcode; const policy_item_t *this; policy_named_t mypolicy, *policy; mypolicy.name = name; policy = rbtree_finddata(state->inst->policies, &mypolicy); if (!policy) return RLM_MODULE_FAIL; DEBUG2("rlm_policy: Evaluating policy %s", name); rad_assert(policy->item.type != POLICY_TYPE_BAD); rad_assert(policy->item.type < POLICY_TYPE_NUM_TYPES); rcode = policy_stack_push(state, policy->policy); if (!rcode) { return RLM_MODULE_FAIL; } /* * FIXME: Look for magic keywords like "return", * where the packet gets accepted/rejected/whatever */ while (policy_stack_pop(state, &this)) { rad_assert(this != NULL); rad_assert(this->type != POLICY_TYPE_BAD); rad_assert(this->type < POLICY_TYPE_NUM_TYPES); debug_evaluate("Evaluating at line %d\n", this->lineno); rcode = (*evaluate_functions[this->type])(state, this); if (!rcode) { return RLM_MODULE_FAIL; } } /* loop until the stack is empty */ return state->rcode; } /* * Evaluate, which is pretty close to print, but we look at what * we're printing. */ int rlm_policy_evaluate(rlm_policy_t *inst, REQUEST *request, const char *name) { int rcode; policy_state_t *state; state = rad_malloc(sizeof(*state)); memset(state, 0, sizeof(*state)); state->request = request; state->inst = inst; state->rcode = RLM_MODULE_OK; state->component = fr_str2int(policy_component_names, name, RLM_COMPONENT_COUNT); rcode = policy_evaluate_name(state, name); free(state); return rcode; /* evaluated OK. */ } freeradius-server/src/modules/rlm_policy/parse.c000066400000000000000000001137411257552170400224200ustar00rootroot00000000000000/* * parse.c Parse a policy language * * Version: $Id$ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2004 Alan DeKok * Copyright 2006 The FreeRADIUS server project */ #include RCSID("$Id$") #include "rlm_policy.h" #ifdef HAVE_DIRENT_H #include #ifdef HAVE_SYS_STAT_H #include #endif #endif #include const FR_NAME_NUMBER policy_return_codes[] = { { "reject", RLM_MODULE_REJECT }, { "fail", RLM_MODULE_FAIL }, { "ok", RLM_MODULE_OK }, { "handled", RLM_MODULE_HANDLED }, { "invalid", RLM_MODULE_INVALID }, { "userlock", RLM_MODULE_USERLOCK }, { "notfound", RLM_MODULE_NOTFOUND }, { "noop", RLM_MODULE_NOOP }, { "updated", RLM_MODULE_UPDATED }, { NULL, RLM_MODULE_NUMCODES } }; /* * Explanations of what the lexical tokens are. */ static const FR_NAME_NUMBER policy_explanations[] = { { "invalid input", POLICY_LEX_BAD }, { "end of file", POLICY_LEX_EOF }, { "end of line", POLICY_LEX_EOL }, { "whitespace", POLICY_LEX_WHITESPACE }, { "hash mark", POLICY_LEX_HASH }, { "left bracket", POLICY_LEX_L_BRACKET }, { "right bracket", POLICY_LEX_R_BRACKET }, { "{", POLICY_LEX_LC_BRACKET }, { "}", POLICY_LEX_RC_BRACKET }, { "comma", POLICY_LEX_COMMA }, { "logical AND", POLICY_LEX_L_AND }, { "logical OR", POLICY_LEX_L_OR }, { "AND", POLICY_LEX_AND }, { "OR", POLICY_LEX_OR }, { "logical NOT", POLICY_LEX_L_NOT }, { "assignment", POLICY_LEX_ASSIGN }, { "comparison", POLICY_LEX_CMP_EQUALS }, { "comparison", POLICY_LEX_CMP_NOT_EQUALS }, { "comparison", POLICY_LEX_LT }, { "comparison", POLICY_LEX_GT }, { "comparison", POLICY_LEX_LE }, { "comparison", POLICY_LEX_GT }, { "comparison", POLICY_LEX_RX_EQUALS }, { "comparison", POLICY_LEX_RX_NOT_EQUALS }, { "double quoted string", POLICY_LEX_DOUBLE_QUOTED_STRING }, { "single quoted string", POLICY_LEX_SINGLE_QUOTED_STRING }, { "back quoted string", POLICY_LEX_BACK_QUOTED_STRING }, { "bare word", POLICY_LEX_BARE_WORD }, { NULL, -1 } }; const FR_NAME_NUMBER rlm_policy_tokens[] = { { "EOF", POLICY_LEX_EOF }, { "#", POLICY_LEX_HASH }, { "(", POLICY_LEX_L_BRACKET }, { ")", POLICY_LEX_R_BRACKET }, { "{", POLICY_LEX_LC_BRACKET }, { "}", POLICY_LEX_RC_BRACKET }, { ",", POLICY_LEX_COMMA }, { "&&", POLICY_LEX_L_AND }, { "||", POLICY_LEX_L_OR }, { "&", POLICY_LEX_AND }, { "|", POLICY_LEX_OR }, { "!", POLICY_LEX_L_NOT }, { "=", POLICY_LEX_ASSIGN }, { "==", POLICY_LEX_CMP_EQUALS }, { "!=", POLICY_LEX_CMP_NOT_EQUALS }, { "=*", POLICY_LEX_CMP_TRUE }, { "!*", POLICY_LEX_CMP_FALSE }, { "<", POLICY_LEX_LT }, { ">", POLICY_LEX_GT }, { "<=", POLICY_LEX_LE }, { ">=", POLICY_LEX_GT }, { "=~", POLICY_LEX_RX_EQUALS }, { "!~", POLICY_LEX_RX_NOT_EQUALS }, { "^=", POLICY_LEX_BEFORE_HEAD_ASSIGN }, { "^==", POLICY_LEX_BEFORE_WHERE_ASSIGN }, { "^.", POLICY_LEX_BEFORE_HEAD_EQUALS }, { "^.=", POLICY_LEX_BEFORE_WHERE_EQUALS }, { "$=", POLICY_LEX_AFTER_TAIL_ASSIGN }, { "$==", POLICY_LEX_AFTER_WHERE_ASSIGN }, { "$.", POLICY_LEX_AFTER_TAIL_EQUALS }, { "$.=", POLICY_LEX_AFTER_WHERE_EQUALS }, { ".=", POLICY_LEX_CONCAT_EQUALS }, { ":=", POLICY_LEX_SET_EQUALS }, { "double quoted string", POLICY_LEX_DOUBLE_QUOTED_STRING }, { "single quoted string", POLICY_LEX_SINGLE_QUOTED_STRING }, { "back quoted string", POLICY_LEX_BACK_QUOTED_STRING }, { "bare word", POLICY_LEX_BARE_WORD }, { NULL, -1 } }; /* * Hand-coded lexical analysis of a string. * Handed input string, updates token, possible a decoded * string in buffer, and returns the pointer to the next token. * * Lexical tokens cannot cross a string boundary. */ static const char *policy_lex_string(const char *input, policy_lex_t *token, char *buffer, size_t buflen) { rad_assert(input != NULL); switch (*input) { case '\0': *token = POLICY_LEX_EOL; return NULL; /* nothing more to do */ case ' ': case '\t': case '\r': case '\n': /* * Skip over all of the whitespace in one swell foop. */ *token = POLICY_LEX_WHITESPACE; while ((*input == ' ') || (*input == '\t') || (*input == '\r') || (*input == '\n')) input++; return input; /* point to next non-whitespace character */ case '#': /* ignore everything to the end of the line */ *token = POLICY_LEX_EOL; return NULL; case '(': *token = POLICY_LEX_L_BRACKET; return input + 1; case ')': *token = POLICY_LEX_R_BRACKET; return input + 1; case '{': *token = POLICY_LEX_LC_BRACKET; return input + 1; case '}': *token = POLICY_LEX_RC_BRACKET; return input + 1; case ',': *token = POLICY_LEX_COMMA; return input + 1; case '+': switch (input[1]) { case '=': *token = POLICY_LEX_PLUS_EQUALS; input++; break; default: *token = POLICY_LEX_PLUS; break; } return input + 1; case '-': switch (input[1]) { case '=': *token = POLICY_LEX_MINUS_EQUALS; input++; break; default: *token = POLICY_LEX_MINUS; break; } return input + 1; case '.': if (input[1] == '=') { *token = POLICY_LEX_CONCAT_EQUALS; return input + 2; } *token = POLICY_LEX_BAD; return input + 1; case '^': if (input[1] == '.' ) { if (input[2] == '=') { *token = POLICY_LEX_BEFORE_WHERE_EQUALS; return input + 3; } else { *token = POLICY_LEX_BEFORE_HEAD_EQUALS; return input + 2; } } else if (input[1] == '=') { if (input[2] == '=') { *token = POLICY_LEX_BEFORE_WHERE_ASSIGN; return input + 3; } else { *token = POLICY_LEX_BEFORE_HEAD_ASSIGN; return input + 2; } } *token = POLICY_LEX_BAD; return input + 1; case '$': if (input[1] == '.' ) { if (input[2] == '=') { *token = POLICY_LEX_AFTER_WHERE_EQUALS; return input + 3; } else { *token = POLICY_LEX_AFTER_TAIL_EQUALS; return input + 2; } } else if (input[1] == '=') { if (input[2] == '=') { *token = POLICY_LEX_AFTER_WHERE_ASSIGN; return input + 3; } else { *token = POLICY_LEX_AFTER_TAIL_ASSIGN; return input + 2; } } *token = POLICY_LEX_BAD; return input + 1; case ':': if (input[1] == '=') { *token = POLICY_LEX_SET_EQUALS; return input + 2; } *token = POLICY_LEX_BAD; return input + 1; case '&': switch (input[1]) { case '&': *token = POLICY_LEX_L_AND; input++; break; case '=': *token = POLICY_LEX_AND_EQUALS; input++; break; default: *token = POLICY_LEX_AND; } return input + 1; case '|': switch (input[1]) { case '|': *token = POLICY_LEX_L_OR; input++; break; case '=': *token = POLICY_LEX_OR_EQUALS; input++; break; default: *token = POLICY_LEX_OR; } return input + 1; case '!': switch (input[1]) { case '=': input++; *token = POLICY_LEX_CMP_NOT_EQUALS; break; case '~': input++; *token = POLICY_LEX_RX_NOT_EQUALS; break; case '*': input++; *token = POLICY_LEX_CMP_FALSE; break; default: *token = POLICY_LEX_L_NOT; } return input + 1; case '=': switch (input[1]) { case '=': input++; *token = POLICY_LEX_CMP_EQUALS; break; case '~': input++; *token = POLICY_LEX_RX_EQUALS; break; case '*': input++; *token = POLICY_LEX_CMP_TRUE; break; default: *token = POLICY_LEX_ASSIGN; } return input + 1; case '<': if (input[1] == '=') { input++; *token = POLICY_LEX_LE; } else { *token = POLICY_LEX_LT; } return input + 1; case '>': if (input[1] == '=') { input++; *token = POLICY_LEX_GE; } else { *token = POLICY_LEX_GT; } return input + 1; case '"': if (!buffer || (buflen < 2)) { *token = POLICY_LEX_BAD; return input + 1; } input++; while (*input != '"') { /* * Strings can't pass EOL. */ if (!*input) { return POLICY_LEX_BAD; } /* * FIXME: Embedded quotes? */ *(buffer++) = *(input++); buflen--; /* * FIXME: Print more warnings? */ if (buflen == 1) { break; } } *buffer = '\0'; *token = POLICY_LEX_DOUBLE_QUOTED_STRING; return input + 1; /* skip trailing '"' */ default: /* bare word */ break; } /* * It's a bare word, with nowhere to put it. Die. */ if (!buffer) { *token = POLICY_LEX_BAD; return input + 1; } /* * Getting one character is stupid. */ if (buflen < 2) { *token = POLICY_LEX_BAD; return input + 1; } /* * Bare words are [-a-zA-Z0-9.]+ */ while (*input) { if (!(((*input >= '0') && (*input <= '9')) || ((*input >= 'a') && (*input <= 'z')) || ((*input >= 'A') && (*input <= 'Z')) || (*input == '-') || (*input == '.') || (*input == ':') || (*input == '_'))) { break; } *(buffer++) = *(input++); buflen--; /* * FIXME: Print more warnings? */ if (buflen == 1) { break; } } *buffer = '\0'; *token = POLICY_LEX_BARE_WORD; return input; } /* * We want to lexically analyze a file, so we need a wrapper * around the lexical analysis of strings. */ typedef struct policy_lex_file_t { FILE *fp; const char *parse; const char *filename; int lineno; int debug; rbtree_t *policies; policy_lex_t token; char buffer[1024]; } policy_lex_file_t; #define POLICY_LEX_FLAG_RETURN_EOL (1 << 0) #define POLICY_LEX_FLAG_PEEK (1 << 1) #define POLICY_LEX_FLAG_PRINT_TOKEN (1 << 2) #define debug_tokens if ((lexer->debug & POLICY_DEBUG_PRINT_TOKENS) && fr_log_fp) fr_printf_log /* * Function to return a token saying what it read, and possibly * a buffer of the quoted string or bare word. */ static policy_lex_t policy_lex_file(policy_lex_file_t *lexer, int flags, char *mystring, size_t mystringlen) { policy_lex_t token = POLICY_LEX_BARE_WORD; /* to prime it */ if (lexer->debug & POLICY_DEBUG_PRINT_TOKENS) { flags |= POLICY_LEX_FLAG_PRINT_TOKEN; } if (!lexer->fp) { return POLICY_LEX_EOF; } /* * Starting off, the buffer needs to be primed. */ if (!lexer->parse) { lexer->parse = fgets(lexer->buffer, sizeof(lexer->buffer), lexer->fp); if (!lexer->parse) { return POLICY_LEX_EOF; } lexer->lineno = 1; } /* buffer is primed, read stuff */ if (lexer->token != POLICY_LEX_BAD) { token = lexer->token; lexer->token = POLICY_LEX_BAD; return token; } /* * Ignore whitespace, and keep filling the buffer */ while (lexer->parse) { const char *next; next = policy_lex_string(lexer->parse, &token, mystring, mystringlen); switch (token) { case POLICY_LEX_WHITESPACE: /* skip whitespace */ lexer->parse = next; continue; case POLICY_LEX_EOL: /* read another line */ lexer->parse = fgets(lexer->buffer, sizeof(lexer->buffer), lexer->fp); lexer->lineno++; if (flags & POLICY_LEX_FLAG_RETURN_EOL) { return POLICY_LEX_EOL; } break; /* read another token */ default: /* return the token */ if (!(flags & POLICY_LEX_FLAG_PEEK)) { lexer->parse = next; } if (flags & POLICY_LEX_FLAG_PRINT_TOKEN) { debug_tokens("[%s token %s] ", (flags & POLICY_LEX_FLAG_PEEK) ? "peek " : "", fr_int2str(rlm_policy_tokens, token, "?")); } return token; break; } } /* loop until EOF */ /* * Close it for the user. */ fclose(lexer->fp); lexer->fp = NULL; return POLICY_LEX_EOF; } /* * Push a token back onto the input. * * FIXME: Push words, too? */ static int policy_lex_push_token(policy_lex_file_t *lexer, policy_lex_t token) { if (lexer->token != POLICY_LEX_BAD) { rad_assert(0 == 1); return 0; } lexer->token = token; return 1; } /* * Forward declarations. */ static int parse_block(policy_lex_file_t *lexer, policy_item_t **tail); /* * Map reserved words to tokens, and vice versa. */ const FR_NAME_NUMBER policy_reserved_words[] = { { "if", POLICY_RESERVED_IF }, { "else", POLICY_RESERVED_ELSE }, { "debug", POLICY_RESERVED_DEBUG }, { "print", POLICY_RESERVED_PRINT }, { "policy", POLICY_RESERVED_POLICY }, { "control", POLICY_RESERVED_CONTROL }, { "request", POLICY_RESERVED_REQUEST }, { "reply", POLICY_RESERVED_REPLY }, { "proxy-request", POLICY_RESERVED_PROXY_REQUEST }, { "proxy-reply", POLICY_RESERVED_PROXY_REPLY }, { "include", POLICY_RESERVED_INCLUDE }, { "return", POLICY_RESERVED_RETURN }, { "module", POLICY_RESERVED_MODULE }, { NULL, POLICY_RESERVED_UNKNOWN } }; /* * Simplifies some later coding */ static int policy_lex_str2int(policy_lex_file_t *lexer, const FR_NAME_NUMBER *table, int default_value) { policy_lex_t token; char buffer[256]; token = policy_lex_file(lexer, 0, buffer, sizeof(buffer)); if (token != POLICY_LEX_BARE_WORD) { fprintf(stderr, "%s[%d]: Unexpected token\n", lexer->filename, lexer->lineno); return default_value; } return fr_str2int(table, buffer, default_value); } /* * print foo * print "foo" */ static int parse_print(policy_lex_file_t *lexer, policy_item_t **tail) { policy_lex_t token; char mystring[1024]; policy_print_t *this; debug_tokens("[PRINT] "); this = rad_malloc(sizeof(*this)); memset(this, 0, sizeof(*this)); this->item.type = POLICY_TYPE_PRINT; this->item.lineno = lexer->lineno; token = policy_lex_file(lexer, 0, mystring, sizeof(mystring)); if ((token != POLICY_LEX_BARE_WORD) && (token != POLICY_LEX_DOUBLE_QUOTED_STRING)) { fprintf(stderr, "%s[%d]: Bad print command\n", lexer->filename, lexer->lineno); rlm_policy_free_item((policy_item_t *) this); return 0; } this->rhs_type = token; this->rhs = strdup(mystring); *tail = (policy_item_t *) this; return 1; } /* * (foo == bar), with nested conditionals. */ static int parse_condition(policy_lex_file_t *lexer, policy_item_t **tail) { int rcode, seen_not = FALSE; policy_lex_t token, compare; char lhs[256], rhs[256]; policy_condition_t *this; token = policy_lex_file(lexer, 0, lhs, sizeof(lhs)); if (token != POLICY_LEX_L_BRACKET) { fprintf(stderr, "%s[%d]: Expected '(', got \"%s\"\n", lexer->filename, lexer->lineno, fr_int2str(rlm_policy_tokens, token, lhs)); return 0; } this = rad_malloc(sizeof(*this)); memset(this, 0, sizeof(*this)); this->item.type = POLICY_TYPE_CONDITIONAL; this->item.lineno = lexer->lineno; redo: token = policy_lex_file(lexer, 0, lhs, sizeof(lhs)); switch (token) { case POLICY_LEX_L_BRACKET: if (!policy_lex_push_token(lexer, token)) { rlm_policy_free_item((policy_item_t *) this); return 0; } this->compare = POLICY_LEX_L_BRACKET; this->child_condition = POLICY_LEX_L_BRACKET; rcode = parse_condition(lexer, &(this->child)); if (!rcode) { rlm_policy_free_item((policy_item_t *) this); return rcode; } break; case POLICY_LEX_L_NOT: if (seen_not) { fprintf(stderr, "%s[%d]: Syntax error at \"!!\"\n", lexer->filename, lexer->lineno); rlm_policy_free_item((policy_item_t *) this); return 0; } debug_tokens("[NOT] "); token = policy_lex_file(lexer, POLICY_LEX_FLAG_PEEK, NULL, 0); if (token != POLICY_LEX_L_BRACKET) { seen_not = this->sense = 1; goto redo; } this->compare = POLICY_LEX_L_NOT; rcode = parse_condition(lexer, &(this->child)); if (!rcode) { rlm_policy_free_item((policy_item_t *) this); return rcode; } break; case POLICY_LEX_BARE_WORD: this->lhs_type = token; token = policy_lex_file(lexer, POLICY_LEX_FLAG_PEEK, NULL, 0); if (token == POLICY_LEX_L_BRACKET) { debug_tokens("[IF-CALL %s] ", lhs); /* * Function call. */ if (rlm_policy_find(lexer->policies, lhs) == NULL) { fprintf(stderr, "%s[%d]: Undefined function \"%s\"\n", lexer->filename, lexer->lineno, lhs); rlm_policy_free_item((policy_item_t *) this); return 0; } /* * this->lhs set up below, after "check" */ this->lhs_type = POLICY_LEX_FUNCTION; /* * Copied from parse_call */ token = policy_lex_file(lexer, 0, NULL, 0); if (token != POLICY_LEX_L_BRACKET) { fprintf(stderr, "%s[%d]: Expected left bracket, got \"%s\"\n", lexer->filename, lexer->lineno, fr_int2str(rlm_policy_tokens, token, "?")); rlm_policy_free_item((policy_item_t *) this); return 0; } token = policy_lex_file(lexer, 0, NULL, 0); if (token != POLICY_LEX_R_BRACKET) { fprintf(stderr, "%s[%d]: Expected right bracket, got \"%s\"\n", lexer->filename, lexer->lineno, fr_int2str(rlm_policy_tokens, token, "?")); rlm_policy_free_item((policy_item_t *) this); return 0; } } /* else it's a comparison? */ goto check; case POLICY_LEX_DOUBLE_QUOTED_STRING: this->lhs_type = token; /* * Got word. May just be test for existence. */ check: token = policy_lex_file(lexer, POLICY_LEX_FLAG_PEEK, NULL, 0); if (token == POLICY_LEX_R_BRACKET) { debug_tokens("[TEST %s] ", lhs); this->lhs = strdup(lhs); this->compare = POLICY_LEX_CMP_TRUE; break; } compare = policy_lex_file(lexer, 0, rhs, sizeof(rhs)); switch (compare) { case POLICY_LEX_CMP_EQUALS: case POLICY_LEX_CMP_NOT_EQUALS: case POLICY_LEX_RX_EQUALS: case POLICY_LEX_RX_NOT_EQUALS: case POLICY_LEX_CMP_TRUE: case POLICY_LEX_CMP_FALSE: case POLICY_LEX_LT: case POLICY_LEX_GT: case POLICY_LEX_LE: case POLICY_LEX_GE: break; default: fprintf(stderr, "%s[%d]: Invalid operator \"%s\"\n", lexer->filename, lexer->lineno, fr_int2str(rlm_policy_tokens, compare, rhs)); rlm_policy_free_item((policy_item_t *) this); return 0; } token = policy_lex_file(lexer, 0, rhs, sizeof(rhs)); if ((token != POLICY_LEX_BARE_WORD) && (token != POLICY_LEX_DOUBLE_QUOTED_STRING)) { fprintf(stderr, "%s[%d]: Unexpected rhs token\n", lexer->filename, lexer->lineno); rlm_policy_free_item((policy_item_t *) this); return 0; } debug_tokens("[COMPARE (%s %s %s)] ", lhs, fr_int2str(rlm_policy_tokens, compare, "?"), rhs); this->lhs = strdup(lhs); this->compare = compare; this->rhs_type = token; this->rhs = strdup(rhs); break; default: fprintf(stderr, "%s[%d]: Unexpected lhs token\n", lexer->filename, lexer->lineno); rlm_policy_free_item((policy_item_t *) this); return 0; } token = policy_lex_file(lexer, 0, NULL, 0); if (token != POLICY_LEX_R_BRACKET) { fprintf(stderr, "%s[%d]: Expected ')', got \"%s\"\n", lexer->filename, lexer->lineno, fr_int2str(rlm_policy_tokens, token, "?")); rlm_policy_free_item((policy_item_t *) this); return 0; } /* * After the end of condition, we MAY have && or || */ token = policy_lex_file(lexer, POLICY_LEX_FLAG_PEEK, NULL, 0); if ((token == POLICY_LEX_L_AND) || (token == POLICY_LEX_L_OR)) { token = policy_lex_file(lexer, 0, NULL, 0); /* skip over it */ debug_tokens("[%s] ", fr_int2str(rlm_policy_tokens, token, "?")); this->child_condition = token; rcode = parse_condition(lexer, &(this->child)); if (!rcode) { rlm_policy_free_item((policy_item_t *) this); return 0; } } *tail = (policy_item_t *) this; return 1; } /* * if (...) {...} * if (...) {...} else {...} * if (...) {...} else if ... */ static int parse_if(policy_lex_file_t *lexer, policy_item_t **tail) { int rcode; policy_lex_t token; char mystring[256]; policy_if_t *this; debug_tokens("[IF] "); this = rad_malloc(sizeof(*this)); memset(this, 0, sizeof(*this)); this->item.type = POLICY_TYPE_IF; this->item.lineno = lexer->lineno; rcode = parse_condition(lexer, &(this->condition)); if (!rcode) { rlm_policy_free_item((policy_item_t *) this); return rcode; } rcode = parse_block(lexer, &(this->if_true)); if (!rcode) { rlm_policy_free_item((policy_item_t *) this); return rcode; } token = policy_lex_file(lexer, POLICY_LEX_FLAG_PEEK, mystring, sizeof(mystring)); if ((token == POLICY_LEX_BARE_WORD) && (fr_str2int(policy_reserved_words, mystring, POLICY_RESERVED_UNKNOWN) == POLICY_RESERVED_ELSE)) { debug_tokens("[ELSE] "); token = policy_lex_file(lexer, 0, mystring, sizeof(mystring)); rad_assert(token == POLICY_LEX_BARE_WORD); token = policy_lex_file(lexer, POLICY_LEX_FLAG_PEEK, mystring, sizeof(mystring)); if ((token == POLICY_LEX_BARE_WORD) && (fr_str2int(policy_reserved_words, mystring, POLICY_RESERVED_UNKNOWN) == POLICY_RESERVED_IF)) { token = policy_lex_file(lexer, 0, mystring, sizeof(mystring)); rad_assert(token == POLICY_LEX_BARE_WORD); rcode = parse_if(lexer, &(this->if_false)); } else { rcode = parse_block(lexer, &(this->if_false)); } if (!rcode) { rlm_policy_free_item((policy_item_t *) this); return rcode; } } debug_tokens("\n"); /* * Empty "if" condition, don't even bother remembering * it. */ if (!this->if_true && !this->if_false) { debug_tokens("Discarding empty \"if\" statement at line %d\n", this->item.lineno); rlm_policy_free_item((policy_item_t *) this); return 1; } *tail = (policy_item_t *) this; return 1; } /* * Parse a reference to a named policy "foo()" */ static int parse_call(policy_lex_file_t *lexer, policy_item_t **tail, const char *name) { policy_lex_t token; policy_call_t *this; debug_tokens("[CALL] "); token = policy_lex_file(lexer, 0, NULL, 0); if (token != POLICY_LEX_L_BRACKET) { fprintf(stderr, "%s[%d]: Expected left bracket, got \"%s\"\n", lexer->filename, lexer->lineno, fr_int2str(rlm_policy_tokens, token, "?")); return 0; } token = policy_lex_file(lexer, 0, NULL, 0); if (token != POLICY_LEX_R_BRACKET) { fprintf(stderr, "%s[%d]: Expected right bracket, got \"%s\"\n", lexer->filename, lexer->lineno, fr_int2str(rlm_policy_tokens, token, "?")); return 0; } this = rad_malloc(sizeof(*this)); memset(this, 0, sizeof(*this)); this->item.type = POLICY_TYPE_CALL; this->item.lineno = lexer->lineno; this->name = strdup(name); *tail = (policy_item_t *) this; return 1; } /* * Edit/update/replace an attribute list */ static int parse_attribute_block(policy_lex_file_t *lexer, policy_item_t **tail, policy_reserved_word_t where) { policy_lex_t token; policy_attributes_t *this; char buffer[32]; this = rad_malloc(sizeof(*this)); if (!this) { return 0; } memset(this, 0, sizeof(*this)); this->item.type = POLICY_TYPE_ATTRIBUTE_LIST; this->item.lineno = lexer->lineno; this->where = where; token = policy_lex_file(lexer, 0, buffer, sizeof(buffer)); this->how = token; switch (token) { case POLICY_LEX_BEFORE_WHERE_EQUALS: case POLICY_LEX_AFTER_WHERE_EQUALS: case POLICY_LEX_BEFORE_WHERE_ASSIGN: case POLICY_LEX_AFTER_WHERE_ASSIGN: if (!parse_condition(lexer, &(this->where_loc))) { rlm_policy_free_item((policy_item_t *)this); return 0; } break; case POLICY_LEX_BEFORE_HEAD_EQUALS: case POLICY_LEX_AFTER_TAIL_EQUALS: case POLICY_LEX_BEFORE_HEAD_ASSIGN: case POLICY_LEX_AFTER_TAIL_ASSIGN: case POLICY_LEX_ASSIGN: case POLICY_LEX_SET_EQUALS: case POLICY_LEX_CONCAT_EQUALS: break; default: fprintf(stderr, "%s[%d]: Unexpected token %s\n", lexer->filename, lexer->lineno, fr_int2str(rlm_policy_tokens, token, "?")); rlm_policy_free_item((policy_item_t *)this); return 0; /* unknown */ } if (!parse_block(lexer, &(this->attributes))) { rlm_policy_free_item((policy_item_t *) this); return 0; } *tail = (policy_item_t *) this; return 1; } /* * Parse a return statement. */ static int parse_return(policy_lex_file_t *lexer, policy_item_t **tail) { int rcode; policy_lex_t token; policy_return_t *this; rcode = policy_lex_str2int(lexer, policy_return_codes, RLM_MODULE_NUMCODES); if (rcode == RLM_MODULE_NUMCODES) { fprintf(stderr, "%s[%d]: Invalid return code\n", lexer->filename, lexer->lineno); return 0; } /* * Look for more sutff */ token = policy_lex_file(lexer, POLICY_LEX_FLAG_PEEK, NULL, sizeof(0)); if (token != POLICY_LEX_RC_BRACKET) { fprintf(stderr, "%s[%d]: return statement must be the last statement in a policy.\n", lexer->filename, lexer->lineno); return 0; } this = rad_malloc(sizeof(*this)); memset(this, 0, sizeof(*this)); this->item.type = POLICY_TYPE_RETURN; this->item.lineno = lexer->lineno; this->rcode = rcode; *tail = (policy_item_t *) this; return 1; } const FR_NAME_NUMBER policy_component_names[] = { { "authenticate", RLM_COMPONENT_AUTH }, { "authorize", RLM_COMPONENT_AUTZ }, { "preacct", RLM_COMPONENT_PREACCT }, { "accounting", RLM_COMPONENT_ACCT }, { "session", RLM_COMPONENT_SESS }, { "pre-proxy", RLM_COMPONENT_PRE_PROXY }, { "post-proxy", RLM_COMPONENT_POST_PROXY }, { "post-auth", RLM_COMPONENT_POST_AUTH }, #ifdef WITH_COA { "recv-coa", RLM_COMPONENT_RECV_COA }, { "send-coa", RLM_COMPONENT_SEND_COA }, #endif { NULL, RLM_COMPONENT_COUNT } }; /* * Parse a module statement. */ static int parse_module(policy_lex_file_t *lexer, policy_item_t **tail) { int component; policy_lex_t token; policy_module_t *this; char *p; const char *section_name; char filename[1024]; char buffer[2048]; CONF_SECTION *cs, *subcs; modcallable *mc; /* * And the filename */ token = policy_lex_file(lexer, 0, filename, sizeof(filename)); if (token != POLICY_LEX_DOUBLE_QUOTED_STRING) { fprintf(stderr, "%s[%d]: Expected filename, got \"%s\"\n", lexer->filename, lexer->lineno, fr_int2str(rlm_policy_tokens, token, "?")); return 0; } /* * See if we're including all of the files in a subdirectory. */ strlcpy(buffer, lexer->filename, sizeof(buffer)); p = strrchr(buffer, '/'); if (p) { strlcpy(p + 1, filename, sizeof(buffer) - 1 - (p - buffer)); } else { snprintf(buffer, sizeof(buffer), "%s/%s", radius_dir, filename); } /* * Include section calling a module. */ debug_tokens("including module section from file %s\n", buffer); cs = cf_file_read(buffer); if (!cs) { return 0; /* it prints out error messages */ } /* * The outer section is called "main", and can be ignored. * It should be a section, so there should be a subsection. */ subcs = cf_subsection_find_next(cs, NULL, NULL); if (!subcs) { fprintf(stderr, "%s[%d]: Expected section containing modules\n", lexer->filename, lexer->lineno); cf_section_free(&cs); return 0; } section_name = cf_section_name1(subcs); rad_assert(section_name != NULL); component = fr_str2int(policy_component_names, section_name, RLM_COMPONENT_COUNT); if (component == RLM_COMPONENT_COUNT) { fprintf(stderr, "%s[%d]: Invalid section name \"%s\"\n", lexer->filename, lexer->lineno, section_name); cf_section_free(&cs); return 0; } /* * Compile the module entry. */ mc = compile_modgroup(NULL, component, subcs); if (!mc) { cf_section_free(&cs); return 0; /* more often results in calling exit... */ } this = rad_malloc(sizeof(*this)); memset(this, 0, sizeof(*this)); this->item.type = POLICY_TYPE_MODULE; this->item.lineno = lexer->lineno; this->component = component; this->cs = cs; this->mc = mc; *tail = (policy_item_t *) this; return 1; } /* * Parse one statement. 'foo = bar', or 'if (...) {...}', or '{...}', * and so on. */ static int parse_statement(policy_lex_file_t *lexer, policy_item_t **tail) { int rcode; policy_reserved_word_t reserved; policy_lex_t token, assign; char lhs[256], rhs[256]; policy_assignment_t *this; /* * See what kind of token we have. */ token = policy_lex_file(lexer, 0, lhs, sizeof(lhs)); switch (token) { case POLICY_LEX_LC_BRACKET: rcode = parse_block(lexer, tail); if (!rcode) { return 0; } break; case POLICY_LEX_BARE_WORD: reserved = fr_str2int(policy_reserved_words, lhs, POLICY_RESERVED_UNKNOWN); switch (reserved) { case POLICY_RESERVED_IF: if (parse_if(lexer, tail)) { return 1; } return 0; break; case POLICY_RESERVED_CONTROL: case POLICY_RESERVED_REQUEST: case POLICY_RESERVED_REPLY: case POLICY_RESERVED_PROXY_REQUEST: case POLICY_RESERVED_PROXY_REPLY: if (parse_attribute_block(lexer, tail, reserved)) return 1; return 0; break; case POLICY_RESERVED_PRINT: if (parse_print(lexer, tail)) { return 1; } return 0; break; case POLICY_RESERVED_RETURN: if (parse_return(lexer, tail)) { return 1; } return 0; break; case POLICY_RESERVED_MODULE: if (parse_module(lexer, tail)) { return 1; } return 0; break; case POLICY_RESERVED_UNKNOWN: /* wasn't a reserved word */ /* * Is a named policy, parse the reference to it. */ if (rlm_policy_find(lexer->policies, lhs) != NULL) { if (!parse_call(lexer, tail, lhs)) { return 0; } return 1; } { const DICT_ATTR *dattr; /* * Bare words MUST be dictionary attributes */ dattr = dict_attrbyname(lhs); if (!dattr) { fprintf(stderr, "%s[%d]: Expected attribute name, got \"%s\"\n", lexer->filename, lexer->lineno, lhs); return 0; } debug_tokens("%s[%d]: Got attribute %s\n", lexer->filename, lexer->lineno, lhs); } break; default: fprintf(stderr, "%s[%d]: Unexpected reserved word \"%s\"\n", lexer->filename, lexer->lineno, lhs); return 0; } /* switch over reserved words */ break; /* * Return from nested blocks. */ case POLICY_LEX_RC_BRACKET: policy_lex_push_token(lexer, token); return 2; /* magic */ case POLICY_LEX_EOF: /* nothing more to do */ return 3; default: fprintf(stderr, "%s[%d]: Unexpected %s\n", lexer->filename, lexer->lineno, fr_int2str(policy_explanations, token, "string")); break; } /* * Parse a bare statement. */ assign = policy_lex_file(lexer, 0, rhs, sizeof(rhs)); switch (assign) { case POLICY_LEX_ASSIGN: case POLICY_LEX_SET_EQUALS: case POLICY_LEX_AND_EQUALS: case POLICY_LEX_OR_EQUALS: case POLICY_LEX_PLUS_EQUALS: break; default: fprintf(stderr, "%s[%d]: Unexpected assign %s\n", lexer->filename, lexer->lineno, fr_int2str(policy_explanations, assign, "string")); return 0; } this = rad_malloc(sizeof(*this)); memset(this, 0, sizeof(*this)); this->item.type = POLICY_TYPE_ASSIGNMENT; this->item.lineno = lexer->lineno; token = policy_lex_file(lexer, 0, rhs, sizeof(rhs)); if ((token != POLICY_LEX_BARE_WORD) && (token != POLICY_LEX_DOUBLE_QUOTED_STRING)) { fprintf(stderr, "%s[%d]: Unexpected rhs %s\n", lexer->filename, lexer->lineno, fr_int2str(policy_explanations, token, "string")); rlm_policy_free_item((policy_item_t *) this); return 0; } this->rhs_type = token; this->rhs = strdup(rhs); token = policy_lex_file(lexer, POLICY_LEX_FLAG_RETURN_EOL, rhs, sizeof(rhs)); if (token != POLICY_LEX_EOL) { fprintf(stderr, "%s[%d]: Expected EOL\n", lexer->filename, lexer->lineno); rlm_policy_free_item((policy_item_t *) this); return 0; } debug_tokens("[ASSIGN %s %s %s]\n", lhs, fr_int2str(rlm_policy_tokens, assign, "?"), rhs); /* * Fill in the assignment struct */ this->lhs = strdup(lhs); this->assign = assign; *tail = (policy_item_t *) this; return 1; } /* * Parse block of statements. The block has already been checked * to begin with a '{'. */ static int parse_block(policy_lex_file_t *lexer, policy_item_t **tail) { int rcode; policy_lex_t token; debug_tokens("[BLOCK] "); token = policy_lex_file(lexer, 0, NULL, 0); if (token != POLICY_LEX_LC_BRACKET) { fprintf(stderr, "%s[%d]: Expected '{'\n", lexer->filename, lexer->lineno); return 0; } while ((rcode = parse_statement(lexer, tail)) != 0) { if (rcode == 2) { token = policy_lex_file(lexer, 0, NULL, 0); if (token != POLICY_LEX_RC_BRACKET) { fprintf(stderr, "%s[%d]: Expected '}'\n", lexer->filename, lexer->lineno); return 0; } return 1; } rad_assert(*tail != NULL); /* parse_statement must fill this in */ while (*tail) tail = &((*tail)->next); } debug_tokens("\n"); /* * Parse statement failed. */ return 0; } /* * Parse debugging statements */ static int parse_debug(policy_lex_file_t *lexer) { int rcode = 0; policy_lex_t token; char buffer[32]; token = policy_lex_file(lexer, 0, buffer, sizeof(buffer)); if (token != POLICY_LEX_BARE_WORD) { fprintf(stderr, "%s[%d]: Bad debug command\n", lexer->filename, lexer->lineno); return 0; } if (strcasecmp(buffer, "none") == 0) { lexer->debug = POLICY_DEBUG_NONE; rcode = 1; } else if (strcasecmp(buffer, "peek") == 0) { lexer->debug |= POLICY_DEBUG_PEEK; rcode = 1; } else if (strcasecmp(buffer, "print_tokens") == 0) { lexer->debug |= POLICY_DEBUG_PRINT_TOKENS; rcode = 1; } else if (strcasecmp(buffer, "print_policy") == 0) { lexer->debug |= POLICY_DEBUG_PRINT_POLICY; rcode = 1; } else if (strcasecmp(buffer, "evaluate") == 0) { lexer->debug |= POLICY_DEBUG_EVALUATE; rcode = 1; } if (rcode) { token = policy_lex_file(lexer, POLICY_LEX_FLAG_RETURN_EOL, NULL, 0); if (token != POLICY_LEX_EOL) { fprintf(stderr, "%s[%d]: Expected EOL\n", lexer->filename, lexer->lineno); return 0; } } else { fprintf(stderr, "%s[%d]: Bad debug command \"%s\"\n", lexer->filename, lexer->lineno, buffer); return 0; } return 1; } /* * Parse a named policy "policy foo {...}" */ static int parse_named_policy(policy_lex_file_t *lexer) { int rcode; policy_lex_t token; char mystring[256]; policy_named_t *this; DICT_ATTR *dattr; debug_tokens("[POLICY] "); this = rad_malloc(sizeof(*this)); memset(this, 0, sizeof(*this)); this->item.type = POLICY_TYPE_NAMED_POLICY; this->item.lineno = lexer->lineno; token = policy_lex_file(lexer, 0, mystring, sizeof(mystring)); if (token != POLICY_LEX_BARE_WORD) { fprintf(stderr, "%s[%d]: Expected policy name, got \"%s\"\n", lexer->filename, lexer->lineno, fr_int2str(rlm_policy_tokens, token, "?")); rlm_policy_free_item((policy_item_t *) this); return 0; } dattr = dict_attrbyname(mystring); if (dattr) { fprintf(stderr, "%s[%d]: Invalid policy name \"%s\": it is already defined as a dictionary attribute\n", lexer->filename, lexer->lineno, mystring); rlm_policy_free_item((policy_item_t *) this); return 0; } this->name = strdup(mystring); rcode = parse_block(lexer, &(this->policy)); if (!rcode) { rlm_policy_free_item((policy_item_t *) this); return rcode; } /* * And insert it into the tree of policies. * * For now, policy names aren't scoped, they're global. */ if (!rlm_policy_insert(lexer->policies, this)) { radlog(L_ERR, "Failed to insert policy \"%s\"", this->name); rlm_policy_free_item((policy_item_t *) this); return 0; } if ((lexer->debug & POLICY_DEBUG_PRINT_POLICY) != 0) { rlm_policy_print(this); } return 1; } /* * Parse an "include filename" statement * * FIXME: Tie this file into the CONF_SECTION for HUP handling! */ static int parse_include(policy_lex_file_t *lexer) { char *p; policy_lex_t token; char filename[1024]; char buffer[2048]; token = policy_lex_file(lexer, 0, filename, sizeof(filename)); if (token != POLICY_LEX_DOUBLE_QUOTED_STRING) { fprintf(stderr, "%s[%d]: Expected filename, got \"%s\"\n", lexer->filename, lexer->lineno, fr_int2str(rlm_policy_tokens, token, "?")); return 0; } /* * See if we're including all of the files in a subdirectory. */ strlcpy(buffer, lexer->filename, sizeof(buffer)); p = strrchr(buffer, '/'); if (p) { strlcpy(p + 1, filename, sizeof(buffer) - 1 - (p - buffer)); #ifdef HAVE_DIRENT_H p = strrchr(p + 1, '/'); if (p && !p[1]) { DIR *dir; struct dirent *dp; p++; dir = opendir(buffer); if (!dir) { fprintf(stderr, "%s[%d]: Error opening %s:%s\n", lexer->filename, lexer->lineno, buffer, strerror(errno)); return 0; } /* * Read the directory, ignoring "." files. */ while ((dp = readdir(dir)) != NULL) { struct stat buf; if (cf_exclude_file(dp->d_name)) continue; strlcpy(p, dp->d_name, sizeof(buffer) - (p - buffer)); if ((stat(buffer, &buf) != 0) || S_ISDIR(buf.st_mode)) continue; debug_tokens("\nincluding file %s\n", buffer); if (!rlm_policy_parse(lexer->policies, buffer)) { closedir(dir); return 0; } } closedir(dir); return 1; } /* else it must have been a normalx file */ #endif } else { snprintf(buffer, sizeof(buffer), "%s/%s", radius_dir, filename); } /* * Handle one include file. */ debug_tokens("\nincluding file %s\n", buffer); if (!rlm_policy_parse(lexer->policies, buffer)) { return 0; } return 1; } /* * Parse data from a file into a policy language. */ int rlm_policy_parse(rbtree_t *policies, const char *filename) { FILE *fp; policy_lex_t token; policy_lex_file_t mylexer, *lexer = NULL; char buffer[32]; fp = fopen(filename, "r"); if (!fp) { fprintf(stderr, "Failed to open %s: %s\n", filename, strerror(errno)); return 0; } lexer = &mylexer; memset(lexer, 0, sizeof(*lexer)); lexer->filename = filename; lexer->fp = fp; lexer->token = POLICY_LEX_BAD; lexer->parse = NULL; /* initial input */ lexer->policies = policies; do { int reserved; token = policy_lex_file(lexer, 0, buffer, sizeof(buffer)); switch (token) { case POLICY_LEX_BARE_WORD: reserved = fr_str2int(policy_reserved_words, buffer, POLICY_RESERVED_UNKNOWN); switch (reserved) { case POLICY_RESERVED_POLICY: if (!parse_named_policy(lexer)) { return 0; } break; case POLICY_RESERVED_INCLUDE: if (!parse_include(lexer)) { return 0; } break; case POLICY_RESERVED_DEBUG: if (!parse_debug(lexer)) { return 0; } break; default: fprintf(stderr, "%s[%d]: Unexpected word \"%s\"\n", lexer->filename, lexer->lineno, buffer); return 0; break; } /* switch over reserved words */ case POLICY_LEX_EOF: break; default: fprintf(stderr, "%s[%d]: Illegal input\n", lexer->filename, lexer->lineno); return 0; } } while (token != POLICY_LEX_EOF); if (((lexer->debug & POLICY_DEBUG_PRINT_POLICY) != 0) && fr_log_fp) { fprintf(fr_log_fp, "# rlm_policy \n"); } debug_tokens("--------------------------------------------------\n"); return 1; } freeradius-server/src/modules/rlm_policy/rlm_policy.c000066400000000000000000000174261257552170400234620ustar00rootroot00000000000000/* * rlm_policy.c Implements a policy language * * Version: $Id$ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2004 Alan DeKok * Copyright 2006 The FreeRADIUS server project */ #include RCSID("$Id$") #include #include #include "rlm_policy.h" /* * A mapping of configuration file names to internal variables. * * Note that the string is dynamically allocated, so it MUST * be freed. When the configuration file parse re-reads the string, * it free's the old one, and strdup's the new one, placing the pointer * to the strdup'd string into 'config.string'. This gets around * buffer over-flows. */ static const CONF_PARSER module_config[] = { { "filename", PW_TYPE_FILENAME, offsetof(rlm_policy_t,filename), NULL, "${confdir}/policy.txt"}, { NULL, -1, 0, NULL, NULL } /* end the list */ }; /* * Callbacks for red-black trees. */ static int policyname_cmp(const void *a, const void *b) { return strcmp(((const policy_named_t *)a)->name, ((const policy_named_t *)b)->name); } /* * Detach a policy. */ static int policy_detach(void *instance) { rlm_policy_t *inst = instance; if (inst->policies) rbtree_free(inst->policies); free(instance); return 0; } /* * Do any per-module initialization that is separate to each * configured instance of the module. e.g. set up connections * to external databases, read configuration files, set up * dictionary entries, etc. * * If configuration information is given in the config section * that must be referenced in later calls, store a handle to it * in *instance otherwise put a null pointer there. */ static int policy_instantiate(CONF_SECTION *conf, void **instance) { rlm_policy_t *inst; /* * Set up a storage area for instance data */ inst = rad_malloc(sizeof(*inst)); if (!inst) { return -1; } memset(inst, 0, sizeof(*inst)); /* * If the configuration parameters can't be parsed, then * fail. */ if (cf_section_parse(conf, inst, module_config) < 0) { policy_detach(inst); return -1; } inst->policies = rbtree_create(policyname_cmp, rlm_policy_free_item, 0); if (!inst->policies) { policy_detach(inst); return -1; } /* * Parse the policy from the file. */ if (!rlm_policy_parse(inst->policies, inst->filename)) { policy_detach(inst); return -1; } *instance = inst; return 0; } /* * Insert a named policy into a list. */ int rlm_policy_insert(rbtree_t *head, policy_named_t *policy) { if (!rbtree_insert(head, policy)) { return 0; } return 1; } /* * Find a named policy */ policy_named_t *rlm_policy_find(rbtree_t *head, const char *name) { policy_named_t mypolicy; mypolicy.name = name; return rbtree_finddata(head, &mypolicy); } /* * Find the named user in this modules database. Create the set * of attribute-value pairs to check and reply with for this user * from the database. The authentication code only needs to check * the password, the rest is done here. */ static int policy_authorize(void *instance, REQUEST *request) { return rlm_policy_evaluate((rlm_policy_t *) instance, request, "authorize"); } static int policy_preacct(void *instance, REQUEST *request) { return rlm_policy_evaluate((rlm_policy_t *) instance, request, "preacct"); } static int policy_accounting(void *instance, REQUEST *request) { return rlm_policy_evaluate((rlm_policy_t *) instance, request, "accounting"); } static int policy_post_auth(void *instance, REQUEST *request) { return rlm_policy_evaluate((rlm_policy_t *) instance, request, "post-auth"); } static int policy_pre_proxy(void *instance, REQUEST *request) { return rlm_policy_evaluate((rlm_policy_t *) instance, request, "pre-proxy"); } static int policy_post_proxy(void *instance, REQUEST *request) { return rlm_policy_evaluate((rlm_policy_t *) instance, request, "post-proxy"); } #ifdef WITH_COA static int policy_recv_coa(void *instance, REQUEST *request) { return rlm_policy_evaluate((rlm_policy_t *) instance, request, "recv-coa"); } static int policy_send_coa(void *instance, REQUEST *request) { return rlm_policy_evaluate((rlm_policy_t *) instance, request, "send-coa"); } #endif /* * The "free" functions are here, for no particular reason. */ void rlm_policy_free_item(policy_item_t *item) { while (item) { policy_item_t *next = item->next; switch (item->type) { default: case POLICY_TYPE_BAD: break; case POLICY_TYPE_ASSIGNMENT: { policy_assignment_t *this; this = (policy_assignment_t *) item; if (this->lhs) free(this->lhs); if (this->rhs) free(this->rhs); } break; case POLICY_TYPE_CONDITIONAL: { policy_condition_t *this; this = (policy_condition_t *) item; if (this->lhs) free(this->lhs); if (this->rhs) free(this->rhs); if (this->child) { rlm_policy_free_item(this->child); this->child = NULL; } } break; case POLICY_TYPE_IF: { policy_if_t *this; this = (policy_if_t *) item; if (this->condition) { rlm_policy_free_item(this->condition); this->condition = NULL; } if (this->if_true) { rlm_policy_free_item(this->if_true); this->if_true = NULL; } if (this->if_false) { rlm_policy_free_item(this->if_false); this->if_false = NULL; } } break; case POLICY_TYPE_ATTRIBUTE_LIST: { policy_attributes_t *this; this = (policy_attributes_t *) item; rlm_policy_free_item(this->attributes); } break; case POLICY_TYPE_NAMED_POLICY: { policy_named_t *this; this = (policy_named_t *) item; rad_assert(this->name != NULL); free(this->name); rlm_policy_free_item(this->policy); } break; case POLICY_TYPE_CALL: { policy_call_t *this; this = (policy_call_t *) item; if (this->name) free(this->name); } break; case POLICY_TYPE_RETURN: break; /* do nothing */ case POLICY_TYPE_MODULE: { policy_module_t *this; this = (policy_module_t *) item; if (this->cs) cf_section_free(&this->cs); if (this->mc) modcallable_free(&this->mc); } break; } /* switch over type */ item->next = NULL; /* for debugging & sanity checks */ item->type = POLICY_TYPE_BAD; free(item); item = next; } } /* * The module name should be the only globally exported symbol. * That is, everything else should be 'static'. * * If the module needs to temporarily modify it's instantiation * data, the type should be changed to RLM_TYPE_THREAD_UNSAFE. * The server will then take care of ensuring that the module * is single-threaded. */ module_t rlm_policy = { RLM_MODULE_INIT, "policy", RLM_TYPE_CHECK_CONFIG_SAFE | RLM_TYPE_HUP_SAFE, /* type */ policy_instantiate, /* instantiation */ policy_detach, /* detach */ { NULL, /* authentication */ policy_authorize, /* authorization */ policy_preacct, /* preaccounting */ policy_accounting, /* accounting */ NULL, /* checksimul */ policy_pre_proxy, /* pre-proxy */ policy_post_proxy, /* post-proxy */ policy_post_auth /* post-auth */ #ifdef WITH_COA , policy_recv_coa, policy_send_coa #endif }, }; freeradius-server/src/modules/rlm_policy/rlm_policy.h000066400000000000000000000154271257552170400234660ustar00rootroot00000000000000/* * rlm_policy.h Header file for policy module * * Version: $Id$ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2004 Alan DeKok * Copyright 2006 The FreeRADIUS server project */ #ifndef _RLM_POLICY_H #define _RLM_POLICY_H #include RCSIDH(rlm_policy_h, "$Id$") #include #include #include #include /* * Internal lexer. */ typedef enum policy_lex_t { POLICY_LEX_BAD = 0, POLICY_LEX_EOF, /* end of the file/input */ POLICY_LEX_EOL, /* end of the line */ POLICY_LEX_WHITESPACE, POLICY_LEX_HASH, POLICY_LEX_L_BRACKET, POLICY_LEX_R_BRACKET, POLICY_LEX_LC_BRACKET, /* left curly bracket */ POLICY_LEX_RC_BRACKET, /* right curly bracket */ POLICY_LEX_COMMA, POLICY_LEX_L_AND, /* logical AND */ POLICY_LEX_L_OR, /* logical OR */ POLICY_LEX_AND, /* bit-wise AND */ POLICY_LEX_OR, /* bit-wise OR */ POLICY_LEX_L_NOT, POLICY_LEX_PLUS, /* + */ POLICY_LEX_MINUS, /* - */ POLICY_LEX_ASSIGN, /* = */ POLICY_LEX_CMP_EQUALS, POLICY_LEX_CMP_NOT_EQUALS, POLICY_LEX_CMP_TRUE, POLICY_LEX_CMP_FALSE, POLICY_LEX_LT, POLICY_LEX_GT, POLICY_LEX_LE, POLICY_LEX_GE, POLICY_LEX_RX_EQUALS, POLICY_LEX_RX_NOT_EQUALS, POLICY_LEX_SET_EQUALS, /* := */ POLICY_LEX_AND_EQUALS, /* &= */ POLICY_LEX_OR_EQUALS, /* |= */ POLICY_LEX_PLUS_EQUALS, /* += */ POLICY_LEX_MINUS_EQUALS, /* -= */ POLICY_LEX_CONCAT_EQUALS, /* .= */ POLICY_LEX_VARIABLE, /* %{foo} */ POLICY_LEX_FUNCTION, /* Hmmm... */ POLICY_LEX_BEFORE_HEAD_ASSIGN, /* ^= */ POLICY_LEX_BEFORE_WHERE_ASSIGN, /* ^== */ POLICY_LEX_BEFORE_HEAD_EQUALS, /* ^. */ POLICY_LEX_BEFORE_WHERE_EQUALS, /* ^.= */ POLICY_LEX_AFTER_TAIL_ASSIGN, /* $= */ POLICY_LEX_AFTER_WHERE_ASSIGN, /* $== */ POLICY_LEX_AFTER_TAIL_EQUALS, /* $. */ POLICY_LEX_AFTER_WHERE_EQUALS, /* $.= */ POLICY_LEX_DOUBLE_QUOTED_STRING, POLICY_LEX_SINGLE_QUOTED_STRING, POLICY_LEX_BACK_QUOTED_STRING, POLICY_LEX_BARE_WORD } policy_lex_t; typedef enum policy_type_t { POLICY_TYPE_BAD = 0, POLICY_TYPE_IF, POLICY_TYPE_CONDITIONAL, POLICY_TYPE_ASSIGNMENT, POLICY_TYPE_ATTRIBUTE_LIST, POLICY_TYPE_PRINT, POLICY_TYPE_NAMED_POLICY, POLICY_TYPE_CALL, POLICY_TYPE_RETURN, POLICY_TYPE_MODULE, POLICY_TYPE_NUM_TYPES } policy_type_t; /* * For our policy language, we want to have some reserved words. */ typedef enum policy_reserved_word_t { POLICY_RESERVED_UNKNOWN = 0, POLICY_RESERVED_CONTROL, POLICY_RESERVED_REQUEST, POLICY_RESERVED_REPLY, POLICY_RESERVED_PROXY_REQUEST, POLICY_RESERVED_PROXY_REPLY, POLICY_RESERVED_IF, POLICY_RESERVED_ELSE, POLICY_RESERVED_DEBUG, POLICY_RESERVED_PRINT, POLICY_RESERVED_POLICY, POLICY_RESERVED_INCLUDE, POLICY_RESERVED_RETURN, POLICY_RESERVED_MODULE, POLICY_RESERVED_NUM_WORDS } policy_reserved_word_t; #define POLICY_DEBUG_NONE 0 #define POLICY_DEBUG_PEEK (1 << 0) #define POLICY_DEBUG_PRINT_TOKENS (1 << 1) #define POLICY_DEBUG_PRINT_POLICY (1 << 2) #define POLICY_DEBUG_EVALUATE (1 << 3) /* * A policy item */ typedef struct policy_item_t { struct policy_item_t *next; policy_type_t type; int lineno; } policy_item_t; /* * A list of attributes to add/replace/whatever in a packet. */ typedef struct policy_print_t { policy_item_t item; policy_lex_t rhs_type; const char *rhs; } policy_print_t; /* * A list of attributes to add/replace/whatever in a packet. */ typedef struct policy_attributes_t { policy_item_t item; policy_reserved_word_t where; /* where to do it */ policy_lex_t how; /* how to do */ policy_item_t *attributes; /* things to do */ policy_item_t *where_loc; /* search for location in list*/ /* FIXME: VALUE_PAIR *vps; */ } policy_attributes_t; /* * Holds a named policy */ typedef struct policy_named_t { policy_item_t item; const char *name; policy_item_t *policy; } policy_named_t; /* * Reference to a named policy */ typedef struct policy_call_t { policy_item_t item; const char *name; } policy_call_t; /* * Hold a return code */ typedef struct policy_return_t { policy_item_t item; int rcode; } policy_return_t; /* * Holds an assignment. */ typedef struct policy_assignment_t { policy_item_t item; char *lhs; policy_lex_t assign; /* operator for the assignment */ policy_lex_t rhs_type; char *rhs; } policy_assignment_t; /* * Condition */ typedef struct policy_condition_t { policy_item_t item; policy_lex_t lhs_type; char *lhs; policy_lex_t compare; policy_lex_t rhs_type; /* bare word, quoted string, etc. */ char *rhs; int sense; /* whether to flip match or not */ policy_lex_t child_condition; policy_item_t *child; } policy_condition_t; /* * Holds an "if" statement. The "else" may be a block, or another "if" */ typedef struct policy_if_t { policy_item_t item; policy_item_t *condition; policy_item_t *if_true; policy_item_t *if_false; /* assignment, or other 'if' */ } policy_if_t; /* * Holds a reference to calling other modules... wild. */ typedef struct policy_module_t { policy_item_t item; int component; /* authorize, authenticate, etc. */ CONF_SECTION *cs; modcallable *mc; } policy_module_t; /* * Define a structure for our module configuration. * * These variables do not need to be in a structure, but it's * a lot cleaner to do so, and a pointer to the structure can * be used as the instance handle. */ typedef struct rlm_policy_t { char *filename; rbtree_t *policies; } rlm_policy_t; /* * Functions. */ extern const FR_NAME_NUMBER rlm_policy_tokens[]; extern const FR_NAME_NUMBER policy_reserved_words[]; extern const FR_NAME_NUMBER policy_return_codes[]; extern const FR_NAME_NUMBER policy_component_names[]; extern int rlm_policy_insert(rbtree_t *head, policy_named_t *policy); extern policy_named_t *rlm_policy_find(rbtree_t *head, const char *name); extern int rlm_policy_parse(rbtree_t *policies, const char *filename); extern void rlm_policy_free_item(policy_item_t *item); extern void rlm_policy_print(const policy_item_t *item); extern int rlm_policy_evaluate(rlm_policy_t *inst, REQUEST *request, const char *name); #endif /* _RLM_POLICY_H */ freeradius-server/src/modules/rlm_preprocess/000077500000000000000000000000001257552170400220215ustar00rootroot00000000000000freeradius-server/src/modules/rlm_preprocess/Makefile000066400000000000000000000001061257552170400234560ustar00rootroot00000000000000TARGET = rlm_preprocess SRCS = rlm_preprocess.c include ../rules.mak freeradius-server/src/modules/rlm_preprocess/rlm_preprocess.c000066400000000000000000000413271257552170400252330ustar00rootroot00000000000000/* * rlm_preprocess.c * Contains the functions for the "huntgroups" and "hints" * files. * * Version: $Id$ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2000,2006 The FreeRADIUS server project * Copyright 2000 Alan DeKok */ #include RCSID("$Id$") #include #include #include #include typedef struct rlm_preprocess_t { char *huntgroup_file; char *hints_file; PAIR_LIST *huntgroups; PAIR_LIST *hints; int with_ascend_hack; int ascend_channels_per_line; int with_ntdomain_hack; int with_specialix_jetstream_hack; int with_cisco_vsa_hack; int with_alvarion_vsa_hack; } rlm_preprocess_t; static const CONF_PARSER module_config[] = { { "huntgroups", PW_TYPE_FILENAME, offsetof(rlm_preprocess_t,huntgroup_file), NULL, NULL }, { "hints", PW_TYPE_FILENAME, offsetof(rlm_preprocess_t,hints_file), NULL, NULL }, { "with_ascend_hack", PW_TYPE_BOOLEAN, offsetof(rlm_preprocess_t,with_ascend_hack), NULL, "no" }, { "ascend_channels_per_line", PW_TYPE_INTEGER, offsetof(rlm_preprocess_t,ascend_channels_per_line), NULL, "23" }, { "with_ntdomain_hack", PW_TYPE_BOOLEAN, offsetof(rlm_preprocess_t,with_ntdomain_hack), NULL, "no" }, { "with_specialix_jetstream_hack", PW_TYPE_BOOLEAN, offsetof(rlm_preprocess_t,with_specialix_jetstream_hack), NULL, "no" }, { "with_cisco_vsa_hack", PW_TYPE_BOOLEAN, offsetof(rlm_preprocess_t,with_cisco_vsa_hack), NULL, "no" }, { "with_alvarion_vsa_hack", PW_TYPE_BOOLEAN, offsetof(rlm_preprocess_t,with_alvarion_vsa_hack), NULL, "no" }, { NULL, -1, 0, NULL, NULL } }; /* * See if a VALUE_PAIR list contains Fall-Through = Yes */ static int fallthrough(VALUE_PAIR *vp) { VALUE_PAIR *tmp; tmp = pairfind(vp, PW_FALL_THROUGH); return tmp ? tmp->lvalue : 0; } /* * dgreer -- * This hack changes Ascend's wierd port numberings * to standard 0-??? port numbers so that the "+" works * for IP address assignments. */ static void ascend_nasport_hack(VALUE_PAIR *nas_port, int channels_per_line) { int service; int line; int channel; if (!nas_port) { return; } if (nas_port->vp_integer > 9999) { service = nas_port->vp_integer/10000; /* 1=digital 2=analog */ line = (nas_port->vp_integer - (10000 * service)) / 100; channel = nas_port->vp_integer-((10000 * service)+(100 * line)); nas_port->vp_integer = (channel - 1) + (line - 1) * channels_per_line; } } /* * ThomasJ -- * This hack strips out Cisco's VSA duplicities in lines * (Cisco not implemented VSA's in standard way. * * Cisco sends it's VSA attributes with the attribute name *again* * in the string, like: H323-Attribute = "h323-attribute=value". * This sort of behaviour is nonsense. */ static void cisco_vsa_hack(VALUE_PAIR *vp) { int vendorcode; char *ptr; char newattr[MAX_STRING_LEN]; for ( ; vp != NULL; vp = vp->next) { vendorcode = VENDOR(vp->attribute); if (!((vendorcode == 9) || (vendorcode == 6618))) continue; /* not a Cisco or Quintum VSA, continue */ if (vp->type != PW_TYPE_STRING) continue; /* * No weird packing. Ignore it. */ ptr = strchr(vp->vp_strvalue, '='); /* find an '=' */ if (!ptr) continue; /* * Cisco-AVPair's get packed as: * * Cisco-AVPair = "h323-foo-bar = baz" * Cisco-AVPair = "h323-foo-bar=baz" * * which makes sense only if you're a lunatic. * This code looks for the attribute named inside * of the string, and if it exists, adds it as a new * attribute. */ if ((vp->attribute & 0xffff) == 1) { const char *p; DICT_ATTR *dattr; p = vp->vp_strvalue; gettoken(&p, newattr, sizeof(newattr)); if ((dattr = dict_attrbyname(newattr)) != NULL) { VALUE_PAIR *newvp; /* * Make a new attribute. */ newvp = pairmake(newattr, ptr + 1, T_OP_EQ); if (newvp) { pairadd(&vp, newvp); } } } else { /* h322-foo-bar = "h323-foo-bar = baz" */ /* * We strip out the duplicity from the * value field, we use only the value on * the right side of the '=' character. */ strlcpy(newattr, ptr + 1, sizeof(newattr)); strlcpy((char *)vp->vp_strvalue, newattr, sizeof(vp->vp_strvalue)); vp->length = strlen((char *)vp->vp_strvalue); } } } /* * Don't even ask what this is doing... */ static void alvarion_vsa_hack(VALUE_PAIR *vp) { int vendorcode; int number = 1; for ( ; vp != NULL; vp = vp->next) { DICT_ATTR *da; vendorcode = VENDOR(vp->attribute); if (vendorcode != 12394) continue; if (vp->type != PW_TYPE_STRING) continue; da = dict_attrbyvalue(number | (12394 << 16)); if (!da) continue; vp->attribute = da->attr; vp->name = da->name; number++; } } /* * Mangle username if needed, IN PLACE. */ static void rad_mangle(rlm_preprocess_t *data, REQUEST *request) { int num_proxy_state; VALUE_PAIR *namepair; VALUE_PAIR *request_pairs; VALUE_PAIR *tmp; /* * Get the username from the request * If it isn't there, then we can't mangle the request. */ request_pairs = request->packet->vps; namepair = pairfind(request_pairs, PW_USER_NAME); if ((namepair == NULL) || (namepair->length <= 0)) { return; } if (data->with_ntdomain_hack) { char *ptr; char newname[MAX_STRING_LEN]; /* * Windows NT machines often authenticate themselves as * NT_DOMAIN\username. Try to be smart about this. * * FIXME: should we handle this as a REALM ? */ if ((ptr = strchr(namepair->vp_strvalue, '\\')) != NULL) { strlcpy(newname, ptr + 1, sizeof(newname)); /* Same size */ strcpy(namepair->vp_strvalue, newname); namepair->length = strlen(newname); } } if (data->with_specialix_jetstream_hack) { char *ptr; /* * Specialix Jetstream 8500 24 port access server. * If the user name is 10 characters or longer, a "/" * and the excess characters after the 10th are * appended to the user name. * * Reported by Lucas Heise */ if ((strlen((char *)namepair->vp_strvalue) > 10) && (namepair->vp_strvalue[10] == '/')) { for (ptr = (char *)namepair->vp_strvalue + 11; *ptr; ptr++) *(ptr - 1) = *ptr; *(ptr - 1) = 0; namepair->length = strlen((char *)namepair->vp_strvalue); } } /* * Small check: if Framed-Protocol present but Service-Type * is missing, add Service-Type = Framed-User. */ if (pairfind(request_pairs, PW_FRAMED_PROTOCOL) != NULL && pairfind(request_pairs, PW_SERVICE_TYPE) == NULL) { tmp = radius_paircreate(request, &request->packet->vps, PW_SERVICE_TYPE, PW_TYPE_INTEGER); tmp->vp_integer = PW_FRAMED_USER; } num_proxy_state = 0; for (tmp = request->packet->vps; tmp != NULL; tmp = tmp->next) { if (tmp->vendor != 0) continue; if (tmp->attribute != PW_PROXY_STATE) continue; num_proxy_state++; } if (num_proxy_state > 10) { DEBUG("WARNING: There are more than 10 Proxy-State attributes in the request."); DEBUG("WARNING: You have likely configured an infinite proxy loop."); } } /* * Compare the request with the "reply" part in the * huntgroup, which normally only contains username or group. * At least one of the "reply" items has to match. */ static int hunt_paircmp(REQUEST *req, VALUE_PAIR *request, VALUE_PAIR *check) { VALUE_PAIR *check_item = check; VALUE_PAIR *tmp; int result = -1; if (check == NULL) return 0; while (result != 0 && check_item != NULL) { tmp = check_item->next; check_item->next = NULL; result = paircompare(req, request, check_item, NULL); check_item->next = tmp; check_item = check_item->next; } return result; } /* * Add hints to the info sent by the terminal server * based on the pattern of the username, and other attributes. */ static int hints_setup(PAIR_LIST *hints, REQUEST *request) { char *name; VALUE_PAIR *add; VALUE_PAIR *tmp; PAIR_LIST *i; VALUE_PAIR *request_pairs; int updated = 0, ft; request_pairs = request->packet->vps; if (hints == NULL || request_pairs == NULL) return RLM_MODULE_NOOP; /* * Check for valid input, zero length names not permitted */ if ((tmp = pairfind(request_pairs, PW_USER_NAME)) == NULL) name = NULL; else name = (char *)tmp->vp_strvalue; if (name == NULL || name[0] == 0) /* * No name, nothing to do. */ return RLM_MODULE_NOOP; for (i = hints; i; i = i->next) { /* * Use "paircompare", which is a little more general... */ if (((strcmp(i->name, "DEFAULT") == 0) || (strcmp(i->name, name) == 0)) && (paircompare(request, request_pairs, i->check, NULL) == 0)) { RDEBUG2(" hints: Matched %s at %d", i->name, i->lineno); /* * Now add all attributes to the request list, * except PW_STRIP_USER_NAME and PW_FALL_THROUGH * and xlat them. */ add = paircopy(i->reply); ft = fallthrough(add); pairdelete(&add, PW_STRIP_USER_NAME); pairdelete(&add, PW_FALL_THROUGH); pairxlatmove(request, &request->packet->vps, &add); pairfree(&add); updated = 1; if (!ft) break; } } if (updated == 0) return RLM_MODULE_NOOP; return RLM_MODULE_UPDATED; } /* * See if we have access to the huntgroup. */ static int huntgroup_access(REQUEST *request, PAIR_LIST *huntgroups) { PAIR_LIST *i; int r = RLM_MODULE_OK; VALUE_PAIR *request_pairs = request->packet->vps; /* * We're not controlling access by huntgroups: * Allow them in. */ if (huntgroups == NULL) return RLM_MODULE_OK; for(i = huntgroups; i; i = i->next) { /* * See if this entry matches. */ if (paircompare(request, request_pairs, i->check, NULL) != 0) continue; /* * Now check for access. */ r = RLM_MODULE_REJECT; if (hunt_paircmp(request, request_pairs, i->reply) == 0) { VALUE_PAIR *vp; /* * We've matched the huntgroup, so add it in * to the list of request pairs. */ vp = pairfind(request_pairs, PW_HUNTGROUP_NAME); if (!vp) { vp = radius_paircreate(request, &request->packet->vps, PW_HUNTGROUP_NAME, PW_TYPE_STRING); strlcpy(vp->vp_strvalue, i->name, sizeof(vp->vp_strvalue)); vp->length = strlen(vp->vp_strvalue); } r = RLM_MODULE_OK; } break; } return r; } /* * If the NAS wasn't smart enought to add a NAS-IP-Address * to the request, then add it ourselves. */ static int add_nas_attr(REQUEST *request) { VALUE_PAIR *nas; switch (request->packet->src_ipaddr.af) { case AF_INET: nas = pairfind(request->packet->vps, PW_NAS_IP_ADDRESS); if (!nas) { nas = radius_paircreate(request, &request->packet->vps, PW_NAS_IP_ADDRESS, PW_TYPE_IPADDR); nas->vp_ipaddr = request->packet->src_ipaddr.ipaddr.ip4addr.s_addr; } break; case AF_INET6: nas = pairfind(request->packet->vps, PW_NAS_IPV6_ADDRESS); if (!nas) { nas = radius_paircreate(request, &request->packet->vps, PW_NAS_IPV6_ADDRESS, PW_TYPE_IPV6ADDR); memcpy(nas->vp_strvalue, &request->packet->src_ipaddr.ipaddr, sizeof(request->packet->src_ipaddr.ipaddr)); } break; default: radlog(L_ERR, "Unknown address family for packet"); return -1; } return 0; } /* * Initialize. */ static int preprocess_instantiate(CONF_SECTION *conf, void **instance) { int rcode; rlm_preprocess_t *data; /* * Allocate room to put the module's instantiation data. */ data = (rlm_preprocess_t *) rad_malloc(sizeof(*data)); memset(data, 0, sizeof(*data)); /* * Read this modules configuration data. */ if (cf_section_parse(conf, data, module_config) < 0) { free(data); return -1; } data->huntgroups = NULL; data->hints = NULL; /* * Read the huntgroups file. */ if (data->huntgroup_file) { rcode = pairlist_read(data->huntgroup_file, &(data->huntgroups), 0); if (rcode < 0) { radlog(L_ERR|L_CONS, "rlm_preprocess: Error reading %s", data->huntgroup_file); return -1; } } /* * Read the hints file. */ if (data->hints_file) { rcode = pairlist_read(data->hints_file, &(data->hints), 0); if (rcode < 0) { radlog(L_ERR|L_CONS, "rlm_preprocess: Error reading %s", data->hints_file); return -1; } } /* * Save the instantiation data for later. */ *instance = data; return 0; } /* * Preprocess a request. */ static int preprocess_authorize(void *instance, REQUEST *request) { int r; rlm_preprocess_t *data = (rlm_preprocess_t *) instance; /* * Mangle the username, to get rid of stupid implementation * bugs. */ rad_mangle(data, request); if (data->with_ascend_hack) { /* * If we're using Ascend systems, hack the NAS-Port-Id * in place, to go from Ascend's weird values to something * approaching rationality. */ ascend_nasport_hack(pairfind(request->packet->vps, PW_NAS_PORT), data->ascend_channels_per_line); } if (data->with_cisco_vsa_hack) { /* * We need to run this hack because the h323-conf-id * attribute should be used. */ cisco_vsa_hack(request->packet->vps); } if (data->with_alvarion_vsa_hack) { /* * We need to run this hack because the Alvarion * people are crazy. */ alvarion_vsa_hack(request->packet->vps); } /* * Note that we add the Request-Src-IP-Address to the request * structure BEFORE checking huntgroup access. This allows * the Request-Src-IP-Address to be used for huntgroup * comparisons. */ if (add_nas_attr(request) < 0) { return RLM_MODULE_FAIL; } hints_setup(data->hints, request); /* * If there is a PW_CHAP_PASSWORD attribute but there * is PW_CHAP_CHALLENGE we need to add it so that other * modules can use it as a normal attribute. */ if (pairfind(request->packet->vps, PW_CHAP_PASSWORD) && pairfind(request->packet->vps, PW_CHAP_CHALLENGE) == NULL) { VALUE_PAIR *vp; vp = radius_paircreate(request, &request->packet->vps, PW_CHAP_CHALLENGE, PW_TYPE_OCTETS); vp->length = AUTH_VECTOR_LEN; memcpy(vp->vp_strvalue, request->packet->vector, AUTH_VECTOR_LEN); } if ((r = huntgroup_access(request, data->huntgroups)) != RLM_MODULE_OK) { char buf[1024]; radlog_request(L_AUTH, 0, request, "No huntgroup access: [%s] (%s)", request->username ? request->username->vp_strvalue : "", auth_name(buf, sizeof(buf), request, 1)); return r; } return RLM_MODULE_OK; /* Meaning: try next authorization module */ } /* * Preprocess a request before accounting */ static int preprocess_preaccounting(void *instance, REQUEST *request) { int r; rlm_preprocess_t *data = (rlm_preprocess_t *) instance; /* * Ensure that we have the SAME user name for both * authentication && accounting. */ rad_mangle(data, request); if (data->with_cisco_vsa_hack) { /* * We need to run this hack because the h323-conf-id * attribute should be used. */ cisco_vsa_hack(request->packet->vps); } if (data->with_alvarion_vsa_hack) { /* * We need to run this hack because the Alvarion * people are crazy. */ alvarion_vsa_hack(request->packet->vps); } /* * Ensure that we log the NAS IP Address in the packet. */ if (add_nas_attr(request) < 0) { return RLM_MODULE_FAIL; } hints_setup(data->hints, request); if ((r = huntgroup_access(request, data->huntgroups)) != RLM_MODULE_OK) { char buf[1024]; radlog_request(L_INFO, 0, request, "No huntgroup access: [%s] (%s)", request->username ? request->username->vp_strvalue : "", auth_name(buf, sizeof(buf), request, 1)); return r; } return r; } /* * Clean up the module's instance. */ static int preprocess_detach(void *instance) { rlm_preprocess_t *data = (rlm_preprocess_t *) instance; pairlist_free(&(data->huntgroups)); pairlist_free(&(data->hints)); free(data); return 0; } /* globally exported name */ module_t rlm_preprocess = { RLM_MODULE_INIT, "preprocess", RLM_TYPE_CHECK_CONFIG_SAFE, /* type */ preprocess_instantiate, /* instantiation */ preprocess_detach, /* detach */ { NULL, /* authentication */ preprocess_authorize, /* authorization */ preprocess_preaccounting, /* pre-accounting */ NULL, /* accounting */ NULL, /* checksimul */ NULL, /* pre-proxy */ NULL, /* post-proxy */ NULL /* post-auth */ }, }; freeradius-server/src/modules/rlm_protocol_filter/000077500000000000000000000000001257552170400230425ustar00rootroot00000000000000freeradius-server/src/modules/rlm_protocol_filter/Makefile000077500000000000000000000001641257552170400245060ustar00rootroot00000000000000# # Makefile # # Version: $Id$ # TARGET = rlm_protocol_filter SRCS = rlm_protocol_filter.c include ../rules.mak freeradius-server/src/modules/rlm_protocol_filter/rlm_protocol_filter.c000066400000000000000000000161231257552170400272710ustar00rootroot00000000000000/* * rlm_protocol_filter.c * * Version: $Id$ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2004 Cladju Consulting, Inc. * Copyright 2006 The FreeRADIUS server project */ #include RCSID("$Id$") #include #include /* * Define a structure for our module configuration. * */ typedef struct rlm_protocol_filter_t { char *filename; char *key; CONF_SECTION *cs; } rlm_protocol_filter_t; /* * A mapping of configuration file names to internal variables. * * Note that the string is dynamically allocated, so it MUST * be freed. When the configuration file parse re-reads the string, * it free's the old one, and strdup's the new one, placing the pointer * to the strdup'd string into 'config.string'. This gets around * buffer over-flows. */ static const CONF_PARSER module_config[] = { { "filename", PW_TYPE_FILENAME, offsetof(rlm_protocol_filter_t,filename), NULL, "${raddbdir}/protocol_filter.conf"}, { "key", PW_TYPE_STRING_PTR, offsetof(rlm_protocol_filter_t,key), NULL, "%{Realm:-DEFAULT}"}, { NULL, -1, 0, NULL, NULL } /* end the list */ }; static int filter_detach(void *instance) { rlm_protocol_filter_t *inst = instance; if (inst->cs) cf_section_free(&(inst->cs)); free(instance); return 0; } /* * Do any per-module initialization that is separate to each * configured instance of the module. e.g. set up connections * to external databases, read configuration files, set up * dictionary entries, etc. * * If configuration information is given in the config section * that must be referenced in later calls, store a handle to it * in *instance otherwise put a null pointer there. */ static int filter_instantiate(CONF_SECTION *conf, void **instance) { rlm_protocol_filter_t *inst; /* * Set up a storage area for instance data */ inst = rad_malloc(sizeof(*inst)); if (!inst) { return -1; } memset(inst, 0, sizeof(*inst)); /* * If the configuration parameters can't be parsed, then * fail. */ if (cf_section_parse(conf, inst, module_config) < 0) { filter_detach(inst); return -1; } inst->cs = cf_file_read(inst->filename); if (!inst->cs) { filter_detach(inst); return -1; } *instance = inst; return 0; } /* * Return permission. */ static int str2sense(const char *str) { if (strcasecmp(str, "permit") == 0) return 1; if (strcasecmp(str, "deny") == 0) return 0; return -1; } /* * Apply a subsection to a request. * Returns permit/deny/error. */ static int apply_subsection(rlm_protocol_filter_t *inst, REQUEST *request, CONF_SECTION *cs, const char *name) { int sense; CONF_PAIR *cp; const char *value; char keybuf[256]; DEBUG2(" rlm_protocol_filter: Found subsection %s", name); cp = cf_pair_find(cs, "key"); if (!cp) { radlog(L_ERR, "rlm_protocol_filter: %s[%d]: No key defined in subsection %s", inst->filename, cf_section_lineno(cs), name); return RLM_MODULE_FAIL; } radius_xlat(keybuf, sizeof(keybuf), cf_pair_value(cp), request, NULL); if (!*keybuf) { DEBUG2(" rlm_protocol_filter: %s[%d]: subsection %s, key is empty, doing nothing.", inst->filename, cf_section_lineno(cs), name); return RLM_MODULE_NOOP; } DEBUG2(" rlm_protocol_filter: %s[%d]: subsection %s, using key %s", inst->filename, cf_section_lineno(cs), name, keybuf); /* * And repeat some of the above code. */ cp = cf_pair_find(cs, keybuf); if (!cp) { CONF_SECTION *subcs; /* * Maybe it has a subsection, too. */ subcs = cf_section_sub_find(cs, keybuf); if (subcs) { return apply_subsection(inst, request, subcs, keybuf); } /* it was a subsection */ DEBUG2(" rlm_protocol_filter: %s[%d]: subsection %s, rule not found, doing nothing.", inst->filename, cf_section_lineno(cs), name); return RLM_MODULE_NOOP; } value = cf_pair_value(cp); sense = str2sense(value); if (sense < 0) { radlog(L_ERR, "rlm_protocol_filter: %s[%d]: Unknwn directive %s", inst->filename, cf_pair_lineno(cp), value); return RLM_MODULE_FAIL; } if (!sense) return RLM_MODULE_REJECT; return RLM_MODULE_OK; } /* * Authorize the user. */ static int filter_authorize(void *instance, REQUEST *request) { int sense; VALUE_PAIR *vp; CONF_SECTION *cs; CONF_PAIR *cp; char keybuf[1024]; rlm_protocol_filter_t *inst = instance; radius_xlat(keybuf, sizeof(keybuf), inst->key, request, NULL); if (!*keybuf) { DEBUG2(" rlm_protocol_filter: key is empty"); return RLM_MODULE_NOOP; } DEBUG2(" rlm_protocol_filter: Using key %s", keybuf); cs = cf_section_sub_find(inst->cs, keybuf); if (!cs) { DEBUG2(" rlm_protocol_filter: No such key in %s", inst->filename); return RLM_MODULE_NOTFOUND; } /* * Walk through the list of attributes, seeing if they're * permitted/denied. */ for (vp = request->packet->vps; vp != NULL; vp = vp->next) { const char *value; CONF_SECTION *subcs; cp = cf_pair_find(cs, vp->name); if (cp) { value = cf_pair_value(cp); sense = str2sense(value); if (sense < 0) { radlog(L_ERR, "rlm_protocol_filter %s[%d]: Unknown directive %s", inst->filename, cf_pair_lineno(cp), value); return RLM_MODULE_FAIL; } if (!sense) return RLM_MODULE_REJECT; continue; /* was permitted */ } /* else no pair was found */ /* * Maybe it has a subsection */ subcs = cf_section_sub_find(cs, vp->name); if (subcs) { sense = apply_subsection(inst, request, subcs, vp->name); if ((sense == RLM_MODULE_OK) || (sense == RLM_MODULE_NOOP)) { continue; } return sense; } /* it was a subsection */ /* * Not found, must be "permit" */ } return RLM_MODULE_OK; } /* * The module name should be the only globally exported symbol. * That is, everything else should be 'static'. * * If the module needs to temporarily modify it's instantiation * data, the type should be changed to RLM_TYPE_THREAD_UNSAFE. * The server will then take care of ensuring that the module * is single-threaded. */ module_t rlm_protocol_filter = { RLM_MODULE_INIT, "protocol_filter", RLM_TYPE_THREAD_SAFE, /* type */ filter_instantiate, /* instantiation */ filter_detach, /* detach */ { NULL, /* authentication */ filter_authorize, /* authorization */ NULL, /* preaccounting */ NULL, /* accounting */ NULL, /* checksimul */ NULL, /* pre-proxy */ NULL, /* post-proxy */ NULL /* post-auth */ }, }; freeradius-server/src/modules/rlm_python/000077500000000000000000000000001257552170400211555ustar00rootroot00000000000000freeradius-server/src/modules/rlm_python/.gitignore000066400000000000000000000000111257552170400231350ustar00rootroot00000000000000Makefile freeradius-server/src/modules/rlm_python/Makefile.in000066400000000000000000000002661257552170400232260ustar00rootroot00000000000000# # $Id$ # TARGET = @targetname@ SRCS = rlm_python.c HEADERS = RLM_LIBS = @python_ldflags@ RLM_CFLAGS = @python_cflags@ include ../rules.mak $(LT_OBJS): $(HEADERS) freeradius-server/src/modules/rlm_python/configure000077500000000000000000003526431257552170400231010ustar00rootroot00000000000000#! /bin/sh # From configure.in Revision. # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.61. # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, # 2002, 2003, 2004, 2005, 2006 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=: # 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 # PATH needs CR # 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 # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false 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.) as_nl=' ' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. 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 # Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # CDPATH. $as_unset CDPATH if test "x$CONFIG_SHELL" = x; then if (eval ":") 2>/dev/null; then as_have_required=yes else as_have_required=no fi if test $as_have_required = yes && (eval ": (as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=\$LINENO as_lineno_2=\$LINENO test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } ") 2> /dev/null; then : else as_candidate_shells= as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. case $as_dir in /*) for as_base in sh bash ksh sh5; do as_candidate_shells="$as_candidate_shells $as_dir/$as_base" done;; esac done IFS=$as_save_IFS for as_shell in $as_candidate_shells $SHELL; do # Try only shells that exist, to save several forks. if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { ("$as_shell") 2> /dev/null <<\_ASEOF 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 : _ASEOF }; then CONFIG_SHELL=$as_shell as_have_required=yes if { "$as_shell" 2> /dev/null <<\_ASEOF 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 : (as_func_return () { (exit $1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = "$1" ); then : else exitcode=1 echo positional parameters were not saved. fi test $exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } _ASEOF }; then break fi fi done if test "x$CONFIG_SHELL" != x; then for as_var in BASH_ENV ENV do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done export CONFIG_SHELL exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} fi if test $as_have_required = no; then echo This script requires a shell more modern than all the echo shells that I found on your system. Please install a echo modern shell, or manually run the script under such a echo shell if you do have one. { (exit 1); exit 1; } fi fi fi (eval "as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0") || { echo No shell found that supports shell functions. echo Please tell autoconf@gnu.org about your system, echo including any error possibly output before this echo message } as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, and appends # trailing '-' during substitution so that $LINENO is not a special # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # scripts with optimization help from Paolo Bonzini. 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" || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi 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 fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi 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=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, 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= SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME= PACKAGE_TARNAME= PACKAGE_VERSION= PACKAGE_STRING= PACKAGE_BUGREPORT= ac_unique_file="rlm_python.c" ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datarootdir datadir sysconfdir sharedstatedir localstatedir includedir oldincludedir docdir infodir htmldir dvidir pdfdir psdir libdir localedir mandir DEFS ECHO_C ECHO_N ECHO_T LIBS build_alias host_alias target_alias CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP PYTHONBIN python_ldflags python_cflags targetname LIBOBJS LTLIBOBJS' ac_subst_files='' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CPP' # Initialize some variables set by options. ac_init_help= ac_init_version=false # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *) ac_optarg=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_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` eval enable_$ac_feature=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_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` eval enable_$ac_feature=\$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_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/[-.]/_/g'` eval with_$ac_package=\$ac_optarg ;; -without-* | --without-*) ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/[-.]/_/g'` eval with_$ac_package=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 ;; -*) { echo "$as_me: error: unrecognized option: $ac_option Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && 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'` { echo "$as_me: error: missing argument to $ac_option" >&2 { (exit 1); exit 1; }; } fi # Be sure to have absolute directory names. 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 case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; } 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 echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || { echo "$as_me: error: Working directory cannot be determined" >&2 { (exit 1); exit 1; }; } test "X$ac_ls_di" = "X$ac_pwd_ls_di" || { echo "$as_me: error: pwd does not report name of working directory" >&2 { (exit 1); exit 1; }; } # 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 -- "$0" || $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$0" : 'X\(//\)[^/]' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X"$0" | 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 .." { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2 { (exit 1); exit 1; }; } pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures this package to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF _ACEOF fi if test -n "$ac_init_help"; then cat <<\_ACEOF Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-rlm-python-lib-dir=DIR Directory for Python library files --with-rlm-python-include-dir=DIR Directory for Python include files 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 C/C++/Objective C preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. _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" || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`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 echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF configure generated by GNU Autoconf 2.61 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 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 cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by $as_me, which was generated by GNU Autoconf 2.61. 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=. 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=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; 2) ac_configure_args1="$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 ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac done done $as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } $as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export 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 cat <<\_ASBOX ## ---------------- ## ## Cache variables. ## ## ---------------- ## _ASBOX 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_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( *) $as_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 cat <<\_ASBOX ## ----------------- ## ## Output variables. ## ## ----------------- ## _ASBOX echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then cat <<\_ASBOX ## ------------------- ## ## File substitutions. ## ## ------------------- ## _ASBOX echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then cat <<\_ASBOX ## ----------- ## ## confdefs.h. ## ## ----------- ## _ASBOX echo cat confdefs.h echo fi test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" 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'; { (exit 1); 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 # 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 # Let the site file select an alternate cache file if it wants to. # Prefer explicitly selected file to automatically selected ones. if test -n "$CONFIG_SITE"; then set x "$CONFIG_SITE" elif test "x$prefix" != xNONE; then set x "$prefix/share/config.site" "$prefix/etc/config.site" else set x "$ac_default_prefix/share/config.site" \ "$ac_default_prefix/etc/config.site" fi shift for ac_site_file do if test -r "$ac_site_file"; then { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" 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. if test -f "$cache_file"; then { echo "$as_me:$LINENO: loading cache $cache_file" >&5 echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { echo "$as_me:$LINENO: creating cache $cache_file" >&5 echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 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 { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 echo "$as_me: former value: $ac_old_val" >&2;} { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 echo "$as_me: current value: $ac_new_val" >&2;} ac_cache_corrupted=: fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`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. *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 echo "$as_me: error: changes in the environment can compromise the build" >&2;} { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} { (exit 1); exit 1; }; } 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 x$with_rlm_python != xno; then 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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}gcc" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="gcc" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}cc" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="$ac_prog" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&5 echo "$as_me: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } # Provide some information about the compiler. echo "$as_me:$LINENO: checking for C compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (ac_try="$ac_compiler --version >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -v >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -V >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out 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. { echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6; } ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # # List of possible output files, starting from the most likely. # The algorithm is not robust to junk in `.', hence go to wildcards (a.*) # only as a last resort. b.out is created by i960 compilers. ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out' # # The IRIX 6 linker writes into existing files which may not be # executable, retaining their permissions. Remove them first so a # subsequent execution test works. ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link_default") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; 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 | *.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 { echo "$as_me:$LINENO: result: $ac_file" >&5 echo "${ECHO_T}$ac_file" >&6; } if test -z "$ac_file"; then echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: C compiler cannot create executables See \`config.log' for more details." >&5 echo "$as_me: error: C compiler cannot create executables See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } fi ac_exeext=$ac_cv_exeext # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { echo "$as_me:$LINENO: checking whether the C compiler works" >&5 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6; } # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then if { ac_try='./$ac_file' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { echo "$as_me:$LINENO: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&5 echo "$as_me: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi fi fi { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } rm -f a.out a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; } { echo "$as_me:$LINENO: result: $cross_compiling" >&5 echo "${ECHO_T}$cross_compiling" >&6; } { echo "$as_me:$LINENO: checking for suffix of executables" >&5 echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; } if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; 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 | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest$ac_cv_exeext { echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 echo "${ECHO_T}$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT { echo "$as_me:$LINENO: checking for suffix of object files" >&5 echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; } if test "${ac_cv_objext+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; 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 ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 echo "${ECHO_T}$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; } if test "${ac_cv_c_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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 { echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; } GCC=`test $ac_compiler_gnu = yes && echo yes` ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CFLAGS="" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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 { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 echo "${ECHO_T}$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 { echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_c89+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_c89=$ac_arg else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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) { echo "$as_me:$LINENO: result: none needed" >&5 echo "${ECHO_T}none needed" >&6; } ;; xno) { echo "$as_me:$LINENO: result: unsupported" >&5 echo "${ECHO_T}unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;; 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 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 { echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if test "${ac_cv_prog_CPP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f 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 { echo "$as_me:$LINENO: result: $CPP" >&5 echo "${ECHO_T}$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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&5 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } 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 for ac_prog in python2.3 python2.2 python2.1 python1.5 python do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_PYTHONBIN+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$PYTHONBIN"; then ac_cv_prog_PYTHONBIN="$PYTHONBIN" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_dummy="${PATH}:/usr/bin:/usr/local/bin" for as_dir in $as_dummy do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_PYTHONBIN="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi PYTHONBIN=$ac_cv_prog_PYTHONBIN if test -n "$PYTHONBIN"; then { echo "$as_me:$LINENO: result: $PYTHONBIN" >&5 echo "${ECHO_T}$PYTHONBIN" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi test -n "$PYTHONBIN" && break done test -n "$PYTHONBIN" || PYTHONBIN="not-found" if test x$PYTHONBIN = xnot-found; then fail="python-binary" fi PY_LIB_DIR= # Check whether --with-rlm-python-lib-dir was given. if test "${with_rlm_python_lib_dir+set}" = set; then withval=$with_rlm_python_lib_dir; case "$withval" in no) { { echo "$as_me:$LINENO: error: Need rlm-python-lib-dir" >&5 echo "$as_me: error: Need rlm-python-lib-dir" >&2;} { (exit 1); exit 1; }; } ;; yes) ;; *) PY_LIB_DIR="$withval" ;; esac fi PY_INC_DIR= # Check whether --with-rlm-python-include-dir was given. if test "${with_rlm_python_include_dir+set}" = set; then withval=$with_rlm_python_include_dir; case "$withval" in no) { { echo "$as_me:$LINENO: error: Need rlm-python-include-dir" >&5 echo "$as_me: error: Need rlm-python-include-dir" >&2;} { (exit 1); exit 1; }; } ;; yes) ;; *) PY_INC_DIR="$withval" ;; esac fi if test x$fail = x; then PY_PREFIX=`${PYTHONBIN} -c 'import sys ; print sys.prefix'` PY_EXEC_PREFIX=`${PYTHONBIN} -c 'import sys ; print sys.exec_prefix'` PY_VERSION=`${PYTHONBIN} -c 'import sys ; print sys.version[0:3]'` PY_LIBS="-lpython$PY_VERSION" PY_LIB_DIR="$PY_EXEC_PREFIX/lib/python$PY_VERSION/config" PY_LIB_LOC="-L$PY_EXEC_PREFIX/lib/python$PY_VERSION/config" PY_INC_DIR="$PY_PREFIX/include/python$PY_VERSION" PY_CFLAGS="-I$PY_PREFIX/include/python$PY_VERSION" PY_MAKEFILE="$PY_EXEC_PREFIX/lib/python$PY_VERSION/config/Makefile" if test -f ${PY_MAKEFILE}; then PY_LOCALMODLIBS=`sed -n -e 's/^LOCALMODLIBS=\(.*\)/\1/p' $PY_MAKEFILE` PY_BASEMODLIBS=`sed -n -e 's/^BASEMODLIBS=\(.*\)/\1/p' $PY_MAKEFILE` PY_OTHER_LIBS=`sed -n -e 's/^LIBS=\(.*\)/\1/p' $PY_MAKEFILE` PY_OTHER_LDFLAGS=`sed -n -e 's/^LINKFORSHARED=\(.*\)/\1/p' $PY_MAKEFILE` fi PY_EXTRA_LIBS="$PY_LOCALMODLIBS $PY_BASEMODLIBS $PY_OTHER_LIBS" old_CFLAGS=$CFLAGS CFLAGS="$CFLAGS $PY_CFLAGS" smart_try_dir=$PY_INC_DIR ac_safe=`echo "Python.h" | sed 'y%./+-%__pm%'` { echo "$as_me:$LINENO: checking for Python.h" >&5 echo $ECHO_N "checking for Python.h... $ECHO_C" >&6; } old_CFLAGS="$CFLAGS" smart_include= smart_include_dir= if test "x$smart_try_dir" != "x"; then for try in $smart_try_dir; do CFLAGS="$old_CFLAGS -I$try" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { int a = 1; ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then smart_include="-I$try" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 smart_include= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test "x$smart_include" != "x"; then break; fi done CFLAGS="$old_CFLAGS" fi if test "x$smart_include" = "x"; then cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { int a = 1; ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then smart_include=" " else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 smart_include= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test "x$smart_include" = "x"; then if test "x$LOCATE" != "x"; then DIRS= file=Python.h for x in `${LOCATE} $file 2>/dev/null`; do base=`echo $x | sed "s%/${file}%%"` if test "x$x" = "x$base"; then continue; fi dir=`${DIRNAME} $x 2>/dev/null` exclude=`echo ${dir} | ${GREP} /home` if test "x$exclude" != "x"; then continue fi already=`echo \$smart_include_dir ${DIRS} | ${GREP} ${dir}` if test "x$already" = "x"; then DIRS="$DIRS $dir" fi done fi eval "smart_include_dir=\"\$smart_include_dir $DIRS\"" for try in $smart_include_dir /usr/local/include /opt/include; do CFLAGS="$old_CFLAGS -I$try" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { int a = 1; ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then smart_include="-I$try" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 smart_include= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test "x$smart_include" != "x"; then break; fi done CFLAGS="$old_CFLAGS" fi if test "x$smart_include" != "x"; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } eval "ac_cv_header_$ac_safe=yes" CFLAGS="$old_CFLAGS $smart_include" SMART_CFLAGS="$SMART_CFLAGS $smart_include" else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi CFLAGS=$old_CFLAGS if test "x$ac_cv_header_Python_h" = "xyes"; then python_cflags=$PY_CFLAGS else fail="$fail Python.h" targetname= fi old_LIBS=$LIBS LIBS="$LIBS $PY_LIB_LOC $PY_EXTRA_LIBS -lm" smart_try_dir=$PY_LIB_DIR sm_lib_safe=`echo "python${PY_VERSION}" | sed 'y%./+-%__p_%'` sm_func_safe=`echo "Py_Initialize" | sed 'y%./+-%__p_%'` { echo "$as_me:$LINENO: checking for Py_Initialize in -lpython${PY_VERSION}" >&5 echo $ECHO_N "checking for Py_Initialize in -lpython${PY_VERSION}... $ECHO_C" >&6; } old_LIBS="$LIBS" smart_lib= smart_lib_dir= if test "x$smart_try_dir" != "x"; then for try in $smart_try_dir; do LIBS="-L$try -lpython${PY_VERSION} $old_LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ extern char Py_Initialize(); int main () { Py_Initialize() ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then smart_lib="-L$try -lpython${PY_VERSION}" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test "x$smart_lib" != "x"; then break; fi done LIBS="$old_LIBS" fi if test "x$smart_lib" = "x"; then LIBS="-lpython${PY_VERSION} $old_LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ extern char Py_Initialize(); int main () { Py_Initialize() ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then smart_lib="-lpython${PY_VERSION}" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS="$old_LIBS" fi if test "x$smart_lib" = "x"; then if test "x$LOCATE" != "x"; then DIRS= file=libpython${PY_VERSION}${libltdl_cv_shlibext} for x in `${LOCATE} $file 2>/dev/null`; do base=`echo $x | sed "s%/${file}%%"` if test "x$x" = "x$base"; then continue; fi dir=`${DIRNAME} $x 2>/dev/null` exclude=`echo ${dir} | ${GREP} /home` if test "x$exclude" != "x"; then continue fi already=`echo \$smart_lib_dir ${DIRS} | ${GREP} ${dir}` if test "x$already" = "x"; then DIRS="$DIRS $dir" fi done fi eval "smart_lib_dir=\"\$smart_lib_dir $DIRS\"" if test "x$LOCATE" != "x"; then DIRS= file=libpython${PY_VERSION}.a for x in `${LOCATE} $file 2>/dev/null`; do base=`echo $x | sed "s%/${file}%%"` if test "x$x" = "x$base"; then continue; fi dir=`${DIRNAME} $x 2>/dev/null` exclude=`echo ${dir} | ${GREP} /home` if test "x$exclude" != "x"; then continue fi already=`echo \$smart_lib_dir ${DIRS} | ${GREP} ${dir}` if test "x$already" = "x"; then DIRS="$DIRS $dir" fi done fi eval "smart_lib_dir=\"\$smart_lib_dir $DIRS\"" for try in $smart_lib_dir /usr/local/lib /opt/lib; do LIBS="-L$try -lpython${PY_VERSION} $old_LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ extern char Py_Initialize(); int main () { Py_Initialize() ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then smart_lib="-L$try -lpython${PY_VERSION}" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test "x$smart_lib" != "x"; then break; fi done LIBS="$old_LIBS" fi if test "x$smart_lib" != "x"; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } eval "ac_cv_lib_${sm_lib_safe}_${sm_func_safe}=yes" LIBS="$smart_lib $old_LIBS" SMART_LIBS="$smart_lib $SMART_LIBS" else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi LIBS=$old_LIBS eval t=\${ac_cv_lib_${sm_lib_safe}_${sm_func_safe}} if test "x$t" = "xyes"; then python_ldflags="$PY_LIB_LOC $PY_EXTRA_LIBS -lpython${PY_VERSION} -lm" targetname=rlm_python else targetname= fail="$fail libpython$PY_VERSION" fi fi else targetname= echo \*\*\* module rlm_python is disabled. fi if test x"$fail" != x""; then if test x"${enable_strict_dependencies}" = x"yes"; then { { echo "$as_me:$LINENO: error: set --without-rlm_python to disable it explicitly." >&5 echo "$as_me: error: set --without-rlm_python to disable it explicitly." >&2;} { (exit 1); exit 1; }; } else { echo "$as_me:$LINENO: WARNING: silently not building rlm_python." >&5 echo "$as_me: WARNING: silently not building rlm_python." >&2;} { echo "$as_me:$LINENO: WARNING: FAILURE: rlm_python requires: $fail." >&5 echo "$as_me: WARNING: FAILURE: rlm_python requires: $fail." >&2;}; targetname="" fi fi unset ac_cv_env_LIBS_set unset ac_cv_env_LIBS_value ac_config_files="$ac_config_files 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_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( *) $as_unset $ac_var ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then test "x$cache_file" != "x/dev/null" && { echo "$as_me:$LINENO: updating cache $cache_file" >&5 echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 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}' # Transform confdefs.h into DEFS. # Protect against shell expansion while executing Makefile rules. # Protect against Makefile macro expansion. # # If the first sed substitution is executed (which looks for macros that # take arguments), then branch to the quote section. Otherwise, # look for a macro that doesn't take arguments. ac_script=' t clear :clear s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g t quote s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g t quote b any :quote s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g s/\[/\\&/g s/\]/\\&/g s/\$/$$/g H :any ${ g s/^\n// s/\n/ /g p } ' DEFS=`sed -n "$ac_script" confdefs.h` ac_libobjs= ac_ltlibobjs= 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=`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. ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs : ${CONFIG_STATUS=./config.status} ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >$CONFIG_STATUS <<_ACEOF #! $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} _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ## --------------------- ## ## 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=: # 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 # PATH needs CR # 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 # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false 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.) as_nl=' ' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. 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 # Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # CDPATH. $as_unset CDPATH as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, and appends # trailing '-' during substitution so that $LINENO is not a special # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # scripts with optimization help from Paolo Bonzini. 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" || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi 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 fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi 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=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 # Save the log message, to keep $[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by $as_me, which was generated by GNU Autoconf 2.61. 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 cat >>$CONFIG_STATUS <<_ACEOF # Files that config.status was made for. config_files="$ac_config_files" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit -q, --quiet 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 Configuration files: $config_files Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ config.status configured by $0, generated by GNU Autoconf 2.61, with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" Copyright (C) 2006 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' _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # If no file are specified by the user, then we need to provide default # value. By we need to know if files were specified by the user. 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=$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 ) echo "$ac_cs_version"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift CONFIG_FILES="$CONFIG_FILES $ac_optarg" ac_need_defaults=false;; --he | --h | --help | --hel | -h ) 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. -*) { echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *) ac_config_targets="$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 if \$ac_cs_recheck; then echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 CONFIG_SHELL=$SHELL export CONFIG_SHELL exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; 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 fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= trap 'exit_status=$? { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status ' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || { echo "$me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } # # Set up the sed scripts for CONFIG_FILES section. # # No need to generate the scripts if there are no CONFIG_FILES. # This happens for instance when ./config.status config.h if test -n "$CONFIG_FILES"; then _ACEOF ac_delim='%!_!# ' for ac_last_try in false false false false false :; do cat >conf$$subs.sed <<_ACEOF SHELL!$SHELL$ac_delim PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim PACKAGE_NAME!$PACKAGE_NAME$ac_delim PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim PACKAGE_STRING!$PACKAGE_STRING$ac_delim PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim exec_prefix!$exec_prefix$ac_delim prefix!$prefix$ac_delim program_transform_name!$program_transform_name$ac_delim bindir!$bindir$ac_delim sbindir!$sbindir$ac_delim libexecdir!$libexecdir$ac_delim datarootdir!$datarootdir$ac_delim datadir!$datadir$ac_delim sysconfdir!$sysconfdir$ac_delim sharedstatedir!$sharedstatedir$ac_delim localstatedir!$localstatedir$ac_delim includedir!$includedir$ac_delim oldincludedir!$oldincludedir$ac_delim docdir!$docdir$ac_delim infodir!$infodir$ac_delim htmldir!$htmldir$ac_delim dvidir!$dvidir$ac_delim pdfdir!$pdfdir$ac_delim psdir!$psdir$ac_delim libdir!$libdir$ac_delim localedir!$localedir$ac_delim mandir!$mandir$ac_delim DEFS!$DEFS$ac_delim ECHO_C!$ECHO_C$ac_delim ECHO_N!$ECHO_N$ac_delim ECHO_T!$ECHO_T$ac_delim LIBS!$LIBS$ac_delim build_alias!$build_alias$ac_delim host_alias!$host_alias$ac_delim target_alias!$target_alias$ac_delim CC!$CC$ac_delim CFLAGS!$CFLAGS$ac_delim LDFLAGS!$LDFLAGS$ac_delim CPPFLAGS!$CPPFLAGS$ac_delim ac_ct_CC!$ac_ct_CC$ac_delim EXEEXT!$EXEEXT$ac_delim OBJEXT!$OBJEXT$ac_delim CPP!$CPP$ac_delim PYTHONBIN!$PYTHONBIN$ac_delim python_ldflags!$python_ldflags$ac_delim python_cflags!$python_cflags$ac_delim targetname!$targetname$ac_delim LIBOBJS!$LIBOBJS$ac_delim LTLIBOBJS!$LTLIBOBJS$ac_delim _ACEOF if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 51; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` if test -n "$ac_eof"; then ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` ac_eof=`expr $ac_eof + 1` fi cat >>$CONFIG_STATUS <<_ACEOF cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof /@[a-zA-Z_][a-zA-Z_0-9]*@/!b end _ACEOF sed ' s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g s/^/s,@/; s/!/@,|#_!!_#|/ :n t n s/'"$ac_delim"'$/,g/; t s/$/\\/; p N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n ' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF :end s/|#_!!_#|//g CEOF$ac_eof _ACEOF # VPATH may cause trouble with some makes, so we remove $(srcdir), # ${srcdir} and @srcdir@ 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[ ]*=/{ s/:*\$(srcdir):*/:/ s/:*\${srcdir}:*/:/ s/:*@srcdir@:*/:/ s/^\([^=]*=[ ]*\):*/\1/ s/:*$// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF fi # test -n "$CONFIG_FILES" for ac_tag in :F $CONFIG_FILES do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5 echo "$as_me: error: Invalid tag $ac_tag." >&2;} { (exit 1); exit 1; }; };; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 echo "$as_me: error: cannot find input file: $ac_f" >&2;} { (exit 1); exit 1; }; };; esac ac_file_inputs="$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 "`IFS=: echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure." if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { echo "$as_me:$LINENO: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} fi case $ac_tag in *:-:* | *:-) cat >"$tmp/stdin";; 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 || 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" case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`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 || 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" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 echo "$as_me: error: cannot create directory $as_dir" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`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 # _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # 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= case `sed -n '/datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p ' $ac_file_inputs` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF 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 sed "$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s&@configure_input@&$configure_input&;t t s&@top_builddir@&$ac_top_builddir_sub&;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 $ac_datarootdir_hack " $ac_file_inputs | sed -f "$tmp/subs-1.sed" >$tmp/out test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&5 echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&2;} rm -f "$tmp/stdin" case $ac_file in -) cat "$tmp/out"; rm -f "$tmp/out";; *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;; esac ;; esac done # for ac_tag { (exit 0); exit 0; } _ACEOF chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save # 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 || { (exit 1); exit 1; } fi freeradius-server/src/modules/rlm_python/configure.in000066400000000000000000000060611257552170400234710ustar00rootroot00000000000000AC_PREREQ([2.53]) AC_INIT(rlm_python.c) AC_REVISION($Revision$) AC_DEFUN(modname,[rlm_python]) if test x$with_[]modname != xno; then AC_PROG_CC AC_PROG_CPP AC_CHECK_PROGS(PYTHONBIN, [ python2.3 python2.2 python2.1 python1.5 python ], not-found, [${PATH}:/usr/bin:/usr/local/bin]) if test x$PYTHONBIN = xnot-found; then fail="python-binary" fi dnl extra argument: --with-rlm-python-lib-dir PY_LIB_DIR= AC_ARG_WITH(rlm-python-lib-dir, [ --with-rlm-python-lib-dir=DIR Directory for Python library files []], [ case "$withval" in no) AC_MSG_ERROR(Need rlm-python-lib-dir) ;; yes) ;; *) PY_LIB_DIR="$withval" ;; esac ] ) dnl extra argument: --with-rlm-python-include-dir PY_INC_DIR= AC_ARG_WITH(rlm-python-include-dir, [ --with-rlm-python-include-dir=DIR Directory for Python include files []], [ case "$withval" in no) AC_MSG_ERROR(Need rlm-python-include-dir) ;; yes) ;; *) PY_INC_DIR="$withval" ;; esac ] ) if test x$fail = x; then PY_PREFIX=`${PYTHONBIN} -c 'import sys ; print sys.prefix'` PY_EXEC_PREFIX=`${PYTHONBIN} -c 'import sys ; print sys.exec_prefix'` changequote(<<, >>)dnl PY_VERSION=`${PYTHONBIN} -c 'import sys ; print sys.version[0:3]'` changequote([, ])dnl PY_LIBS="-lpython$PY_VERSION" PY_LIB_DIR="$PY_EXEC_PREFIX/lib/python$PY_VERSION/config" PY_LIB_LOC="-L$PY_EXEC_PREFIX/lib/python$PY_VERSION/config" PY_INC_DIR="$PY_PREFIX/include/python$PY_VERSION" PY_CFLAGS="-I$PY_PREFIX/include/python$PY_VERSION" PY_MAKEFILE="$PY_EXEC_PREFIX/lib/python$PY_VERSION/config/Makefile" if test -f ${PY_MAKEFILE}; then PY_LOCALMODLIBS=`sed -n -e 's/^LOCALMODLIBS=\(.*\)/\1/p' $PY_MAKEFILE` PY_BASEMODLIBS=`sed -n -e 's/^BASEMODLIBS=\(.*\)/\1/p' $PY_MAKEFILE` PY_OTHER_LIBS=`sed -n -e 's/^LIBS=\(.*\)/\1/p' $PY_MAKEFILE` PY_OTHER_LDFLAGS=`sed -n -e 's/^LINKFORSHARED=\(.*\)/\1/p' $PY_MAKEFILE` fi PY_EXTRA_LIBS="$PY_LOCALMODLIBS $PY_BASEMODLIBS $PY_OTHER_LIBS" old_CFLAGS=$CFLAGS CFLAGS="$CFLAGS $PY_CFLAGS" smart_try_dir=$PY_INC_DIR FR_SMART_CHECK_INCLUDE(Python.h) CFLAGS=$old_CFLAGS if test "x$ac_cv_header_Python_h" = "xyes"; then python_cflags=$PY_CFLAGS else fail="$fail Python.h" targetname= fi old_LIBS=$LIBS LIBS="$LIBS $PY_LIB_LOC $PY_EXTRA_LIBS -lm" smart_try_dir=$PY_LIB_DIR FR_SMART_CHECK_LIB(python${PY_VERSION}, Py_Initialize) LIBS=$old_LIBS eval t=\${ac_cv_lib_${sm_lib_safe}_${sm_func_safe}} if test "x$t" = "xyes"; then python_ldflags="$PY_LIB_LOC $PY_EXTRA_LIBS -lpython${PY_VERSION} -lm" targetname=modname else targetname= fail="$fail libpython$PY_VERSION" fi fi else targetname= echo \*\*\* module modname is disabled. fi if test x"$fail" != x""; then if test x"${enable_strict_dependencies}" = x"yes"; then AC_MSG_ERROR([set --without-]modname[ to disable it explicitly.]) else AC_MSG_WARN([silently not building ]modname[.]) AC_MSG_WARN([FAILURE: ]modname[ requires: $fail.]); targetname="" fi fi AC_SUBST(python_ldflags) AC_SUBST(python_cflags) AC_SUBST(targetname) AC_OUTPUT(Makefile) freeradius-server/src/modules/rlm_python/prepaid.py000066400000000000000000000147721257552170400231660ustar00rootroot00000000000000#! /usr/bin/env python # # Example Python module for prepaid usage using MySQL # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA # # Copyright 2002 Miguel A.L. Paraz # Copyright 2002 Imperium Technology, Inc. # # $Id$ import radiusd import MySQLdb # Configuration configDb = 'python' # Database name configHost = 'localhost' # Database host configUser = 'python' # Database user and password configPasswd = 'python' # xxx Database # Globals dbHandle = None def log(level, s): """Log function.""" radiusd.radlog(level, 'prepaid.py: ' + s) def instantiate(p): """Module Instantiation. 0 for success, -1 for failure. p is a dummy variable here.""" global dbHandle p = p try: dbHandle = MySQLdb.connect(db=configDb, host=configHost, user=configUser, passwd=configPasswd) except MySQLdb.OperationalError, e: # Report the error and return -1 for failure. # xxx A more advanced module would retry the database. log(radiusd.L_ERR, str(e)) return -1 log(radiusd.L_INFO, 'db connection: ' + str(dbHandle)) return 0 def authorize(authData): """Authorization and authentication are done in one step.""" # Extract the data we need. userName = None userPasswd = None for t in authData: if t[0] == 'User-Name': userName = t[1] elif t[0] == 'Password': userPasswd = t[1] # Build and log the SQL statement # radiusd puts double quotes (") around the string representation of # the RADIUS packet. sql = 'select passwd, maxseconds from users where username = ' + userName log(radiusd.L_DBG, sql) # Get a cursor # xxx Or should this be one cursor all throughout? try: dbCursor = dbHandle.cursor() except MySQLdb.OperationalError, e: log(radiusd.L_ERR, str(e)) return radiusd.RLM_MODULE_FAIL # Execute the SQL statement try: dbCursor.execute(sql) except MySQLdb.OperationalError, e: log(radiusd.L_ERR, str(e)) dbCursor.close() return radiusd.RLM_MODULE_FAIL # Get the result. (passwd, maxseconds) result = dbCursor.fetchone() if not result: # User not found log(radiusd.L_INFO, 'user not found: ' + userName) dbCursor.close() return radiusd.RLM_MODULE_NOTFOUND # Compare passwords # Ignore the quotes around userPasswd. if result[0] != userPasswd[1:-1]: log(radiusd.L_DBG, 'user password mismatch: ' + userName) return radiusd.RLM_MODULE_REJECT maxSeconds = result[1] # Compute their session limit # Build and log the SQL statement sql = 'select sum(seconds) from sessions where username = ' + userName log(radiusd.L_DBG, sql) # Execute the SQL statement try: dbCursor.execute(sql) except MySQLdb.OperationalError, e: log(radiusd.L_ERR, str(e)) dbCursor.close() return radiusd.RLM_MODULE_FAIL # Get the result. (sum,) result = dbCursor.fetchone() if (not result) or (not result[0]): # No usage yet secondsUsed = 0 else: secondsUsed = result[0] # Done with cursor dbCursor.close() # Note that MySQL returns the result of SUM() as a float. sessionTimeout = maxSeconds - int(secondsUsed) if sessionTimeout <= 0: # No more time, reject outright log(radiusd.L_INFO, 'user out of time: ' + userName) return radiusd.RLM_MODULE_REJECT # Log the success log(radiusd.L_DBG, 'user accepted: %s, %d seconds' % (userName, sessionTimeout)) # We are adding to the RADIUS packet # Note that the session timeout integer must be converted to string. # We need to set an Auth-Type. return (radiusd.RLM_MODULE_UPDATED, (('Session-Timeout', str(sessionTimeout)),), (('Auth-Type', 'python'),)) # If you want to use different operators # you can do # return (radiusd.RLM_MODULE_UPDATED, # radiusd.resolve( # 'Session-Timeout := %s' % str(sessionTimeout), # 'Some-other-option -= Value', # ), # radiusd.resolve( # 'Auth-Type := python' # ) # ) # Edit operators you need in OP_TRY in radiusd.py def authenticate(p): p = p return radiusd.RLM_MODULE_OK def preacct(p): p = p return radiusd.RLM_MODULE_OK def accounting(acctData): """Accounting.""" # Extract the data we need. userName = None acctSessionTime = None acctStatusType = None # xxx A dict would make this nice. for t in acctData: if t[0] == 'User-Name': userName = t[1] elif t[0] == 'Acct-Session-Time': acctSessionTime = t[1] elif t[0] == 'Acct-Status-Type': acctStatusType = t[1] # We will not deal with Start for now. # We may later, for simultaneous checks and the like. if acctStatusType == 'Start': return radiusd.RLM_MODULE_OK # Build and log the SQL statement # radiusd puts double quotes (") around the string representation of # the RADIUS packet. # # xxx This is simplistic as it does not record the time, etc. # sql = 'insert into sessions (username, seconds) values (%s, %d)' % \ (userName, int(acctSessionTime)) log(radiusd.L_DBG, sql) # Get a cursor # xxx Or should this be one cursor all throughout? try: dbCursor = dbHandle.cursor() except MySQLdb.OperationalError, e: log(radiusd.L_ERR, str(e)) return radiusd.RLM_MODULE_FAIL # Execute the SQL statement try: dbCursor.execute(sql) except MySQLdb.OperationalError, e: log(radiusd.L_ERR, str(e)) dbCursor.close() return radiusd.RLM_MODULE_FAIL return radiusd.RLM_MODULE_OK def detach(): """Detach and clean up.""" # Shut down the database connection. global dbHandle log(radiusd.L_DBG, 'closing database handle: ' + str(dbHandle)) dbHandle.close() return radiusd.RLM_MODULE_OK # Test the modules if __name__ == '__main__': instantiate(None) print authorize((('User-Name', '"map"'), ('User-Password', '"abc"'))) freeradius-server/src/modules/rlm_python/prepaid.sql000066400000000000000000000014241257552170400233230ustar00rootroot00000000000000# MySQL dump 8.13 # # Host: localhost Database: python #-------------------------------------------------------- # Server version 3.23.36 # # Table structure for table 'sessions' # CREATE TABLE sessions ( username char(32) default NULL, seconds int(11) default NULL ) TYPE=MyISAM; # # Dumping data for table 'sessions' # INSERT INTO sessions VALUES ('map',10); INSERT INTO sessions VALUES ('map',10); INSERT INTO sessions VALUES ('map',10); INSERT INTO sessions VALUES ('map',10); # # Table structure for table 'users' # CREATE TABLE users ( username char(32) NOT NULL default '', passwd char(32) default NULL, maxseconds int(11) default NULL, PRIMARY KEY (username) ) TYPE=MyISAM; # # Dumping data for table 'users' # INSERT INTO users VALUES ('map','abc',100); freeradius-server/src/modules/rlm_python/radiusd.py000066400000000000000000000023431257552170400231640ustar00rootroot00000000000000#! /usr/bin/env python # # Definitions for RADIUS programs # # Copyright 2002 Miguel A.L. Paraz # # This should only be used when testing modules. # Inside freeradius, the 'radiusd' Python module is created by the C module # and the definitions are automatically created. # # $Id$ # from modules.h RLM_MODULE_REJECT = 0 RLM_MODULE_FAIL = 1 RLM_MODULE_OK = 2 RLM_MODULE_HANDLED = 3 RLM_MODULE_INVALID = 4 RLM_MODULE_USERLOCK = 5 RLM_MODULE_NOTFOUND = 6 RLM_MODULE_NOOP = 7 RLM_MODULE_UPDATED = 8 RLM_MODULE_NUMCODES = 9 # from radiusd.h L_DBG = 1 L_AUTH = 2 L_INFO = 3 L_ERR = 4 L_PROXY = 5 L_CONS = 128 OP={ '{':2, '}':3, '(':4, ')':5, ',':6, ';':7, '+=':8, '-=':9, ':=':10, '=':11, '!=':12, '>=':13, '>':14, '<=':15, '<':16, '=~':17, '!~':18, '=*':19, '!*':20, '==':21 , '#':22 } OP_TRY = (':=', '+=', '-=', '=' ) def resolve(*lines): tuples = [] for line in lines: for op in OP_TRY: arr = line.rsplit(op) if len(arr)==2: tuples.append((str(arr[0].strip()),OP[op],str(arr[1].strip()))) break return tuple(tuples) # log function def radlog(level, msg): import sys sys.stdout.write(msg + '\n') level = level freeradius-server/src/modules/rlm_python/radiusd_test.py000066400000000000000000000021661257552170400242260ustar00rootroot00000000000000#! /usr/bin/env python # # Python module test # Miguel A.L. Paraz # # $Id$ import radiusd def instantiate(p): print "*** instantiate ***" print p def authorize(p): print "*** authorize ***" print radiusd.radlog(radiusd.L_INFO, '*** radlog call in authorize ***') print print p return radiusd.RLM_MODULE_OK def preacct(p): print "*** preacct ***" print p return radiusd.RLM_MODULE_OK def accounting(p): print "*** accounting ***" radiusd.radlog(radiusd.L_INFO, '*** radlog call in accounting (0) ***') print print p return radiusd.RLM_MODULE_OK def pre_proxy(p): print "*** pre_proxy ***" print p return radiusd.RLM_MODULE_OK def post_proxy(p): print "*** post_proxy ***" print p return radiusd.RLM_MODULE_OK def post_auth(p): print "*** post_auth ***" print p return radiusd.RLM_MODULE_OK def recv_coa(p): print "*** recv_coa ***" print p return radiusd.RLM_MODULE_OK def send_coa(p): print "*** send_coa ***" print p return radiusd.RLM_MODULE_OK def detach(): print "*** goodbye from radiusd_test.py ***" return radiusd.RLM_MODULE_OK freeradius-server/src/modules/rlm_python/rlm_python.c000066400000000000000000000435631257552170400235270ustar00rootroot00000000000000/* * rlm_python.c * * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2000,2006 The FreeRADIUS server project * Copyright 2002 Miguel A.L. Paraz * Copyright 2002 Imperium Technology, Inc. * - rewritten by Paul P. Komkoff Jr */ #include RCSID("$Id$") #include #include #include #ifdef HAVE_PTHREAD_H #define Pyx_BLOCK_THREADS {PyGILState_STATE __gstate = PyGILState_Ensure(); #define Pyx_UNBLOCK_THREADS PyGILState_Release(__gstate);} #else #define Pyx_BLOCK_THREADS #define Pyx_UNBLOCK_THREADS #endif /* * TODO: The only needed thing here is function. Anything else is * required for initialization only. I will remove it, putting a * symbolic constant here instead. */ struct py_function_def { PyObject *module; PyObject *function; char *module_name; char *function_name; }; typedef struct rlm_python_t { PyThreadState *main_thread_state; struct py_function_def instantiate, authorize, authenticate, preacct, accounting, checksimul, pre_proxy, post_proxy, post_auth, #ifdef WITH_COA recv_coa, send_coa, #endif detach; } rlm_python_t; /* * A mapping of configuration file names to internal variables. * * Note that the string is dynamically allocated, so it MUST * be freed. When the configuration file parse re-reads the string, * it free's the old one, and strdup's the new one, placing the pointer * to the strdup'd string into 'config.string'. This gets around * buffer over-flows. */ static CONF_PARSER module_config[] = { #define A(x) { "mod_" #x, PW_TYPE_STRING_PTR, offsetof(rlm_python_t, x.module_name), NULL, NULL }, \ { "func_" #x, PW_TYPE_STRING_PTR, offsetof(rlm_python_t, x.function_name), NULL, NULL }, A(instantiate) A(authorize) A(authenticate) A(preacct) A(accounting) A(checksimul) A(pre_proxy) A(post_proxy) A(post_auth) #ifdef WITH_COA A(recv_coa) A(send_coa) #endif A(detach) #undef A { NULL, -1, 0, NULL, NULL } /* end the list */ }; static struct { const char *name; int value; } radiusd_constants[] = { #define A(x) { #x, x }, A(L_DBG) A(L_AUTH) A(L_INFO) A(L_ERR) A(L_PROXY) A(L_CONS) A(RLM_MODULE_REJECT) A(RLM_MODULE_FAIL) A(RLM_MODULE_OK) A(RLM_MODULE_HANDLED) A(RLM_MODULE_INVALID) A(RLM_MODULE_USERLOCK) A(RLM_MODULE_NOTFOUND) A(RLM_MODULE_NOOP) A(RLM_MODULE_UPDATED) A(RLM_MODULE_NUMCODES) #undef A { NULL, 0 }, }; /* * This allows us to initialise PyThreadState on a per thread basis */ fr_thread_local_setup(PyThreadState *, local_thread_state); /* macro */ /* * Let assume that radiusd module is only one since we have only * one intepreter */ static PyObject *radiusd_module = NULL; /* * radiusd Python functions */ /* radlog wrapper */ static PyObject *python_radlog(UNUSED PyObject *module, PyObject *args) { int status; char *msg; if (!PyArg_ParseTuple(args, "is", &status, &msg)) { return NULL; } radlog(status, "%s", msg); Py_INCREF(Py_None); return Py_None; } static PyMethodDef radiusd_methods[] = { { "radlog", &python_radlog, METH_VARARGS, "radiusd.radlog(level, msg)\n\n" \ "Print a message using radiusd logging system. level should be one of the\n" \ "constants L_DBG, L_AUTH, L_INFO, L_ERR, L_PROXY, L_CONS\n" }, { NULL, NULL, 0, NULL }, }; static void python_error(void) { PyObject *pType = NULL, *pValue = NULL, *pTraceback = NULL, *pStr1 = NULL, *pStr2 = NULL; /* This will be called with the GIL lock held */ PyErr_Fetch(&pType, &pValue, &pTraceback); if (pType == NULL || pValue == NULL) goto failed; if (((pStr1 = PyObject_Str(pType)) == NULL) || ((pStr2 = PyObject_Str(pValue)) == NULL)) goto failed; radlog(L_ERR, "rlm_python:EXCEPT:%s: %s", PyString_AsString(pStr1), PyString_AsString(pStr2)); failed: Py_XDECREF(pStr1); Py_XDECREF(pStr2); Py_XDECREF(pType); Py_XDECREF(pValue); Py_XDECREF(pTraceback); } static int python_init(rlm_python_t *inst) { int i; static char name[] = "radiusd"; if (radiusd_module) return 0; Py_SetProgramName(name); #ifdef HAVE_PTHREAD_H Py_InitializeEx(0); /* Don't override signal handlers */ PyEval_InitThreads(); /* This also grabs a lock */ inst->main_thread_state = PyThreadState_Get(); /* We need this for setting up thread local stuff */ #endif if ((radiusd_module = Py_InitModule3("radiusd", radiusd_methods, "FreeRADIUS Module.")) == NULL) goto failed; for (i = 0; radiusd_constants[i].name; i++) if ((PyModule_AddIntConstant(radiusd_module, radiusd_constants[i].name, radiusd_constants[i].value)) < 0) goto failed; #ifdef HAVE_PTHREAD_H PyThreadState_Swap(NULL); /* We have to swap out the current thread else we get deadlocks */ PyEval_ReleaseLock(); /* Drop lock grabbed by InitThreads */ #endif radlog(L_DBG, "python_init done"); return 0; failed: Py_XDECREF(radiusd_module); #ifdef HAVE_PTHREAD_H PyEval_ReleaseLock(); #endif Pyx_BLOCK_THREADS python_error(); Pyx_UNBLOCK_THREADS radiusd_module = NULL; Py_Finalize(); return -1; } #if 0 static int python_destroy(void) { Pyx_BLOCK_THREADS Py_XDECREF(radiusd_module); Py_Finalize(); Pyx_UNBLOCK_THREADS return 0; } /* * This will need reconsidering in a future. Maybe we'll need to * have our own reference counting for radiusd_module */ #endif /* TODO: Convert this function to accept any iterable objects? */ static void python_vptuple(VALUE_PAIR **vpp, PyObject *pValue, const char *funcname) { int i; int tuplesize; VALUE_PAIR *vp; /* * If the Python function gave us None for the tuple, * then just return. */ if (pValue == Py_None) return; if (!PyTuple_CheckExact(pValue)) { radlog(L_ERR, "rlm_python:%s: non-tuple passed", funcname); return; } /* Get the tuple tuplesize. */ tuplesize = PyTuple_GET_SIZE(pValue); for (i = 0; i < tuplesize; i++) { PyObject *pTupleElement = PyTuple_GET_ITEM(pValue, i); PyObject *pStr1; PyObject *pStr2; PyObject *pOp; int pairsize; const char *s1; const char *s2; long op; if (!PyTuple_CheckExact(pTupleElement)) { radlog(L_ERR, "rlm_python:%s: tuple element %d is not a tuple", funcname, i); continue; } /* Check if it's a pair */ pairsize = PyTuple_GET_SIZE(pTupleElement); if ((pairsize < 2) || (pairsize > 3)) { radlog(L_ERR, "rlm_python:%s: tuple element %d is a tuple of size %d. Must be 2 or 3.", funcname, i, pairsize); continue; } if (pairsize == 2) { pStr1 = PyTuple_GET_ITEM(pTupleElement, 0); pStr2 = PyTuple_GET_ITEM(pTupleElement, 1); op = T_OP_EQ; } else { pStr1 = PyTuple_GET_ITEM(pTupleElement, 0); pStr2 = PyTuple_GET_ITEM(pTupleElement, 2); pOp = PyTuple_GET_ITEM(pTupleElement, 1); op = PyInt_AsLong(pOp); } if ((!PyString_CheckExact(pStr1)) || (!PyString_CheckExact(pStr2))) { radlog(L_ERR, "rlm_python:%s: tuple element %d must be as (str, str)", funcname, i); continue; } s1 = PyString_AsString(pStr1); s2 = PyString_AsString(pStr2); vp = pairmake(s1, s2, op); if (vp != NULL) { pairadd(vpp, vp); radlog(L_DBG, "rlm_python:%s: '%s' = '%s'", funcname, s1, s2); } else { radlog(L_DBG, "rlm_python:%s: Failed: '%s' = '%s'", funcname, s1, s2); } } } /* * This is the core Python function that the others wrap around. * Pass the value-pair print strings in a tuple. * * FIXME: We're not checking the errors. If we have errors, what * do we do? */ static int python_populate_vptuple(PyObject *pPair, VALUE_PAIR *vp) { PyObject *pStr = NULL; char buf[1024]; /* Look at the vp_print_name? */ if (vp->flags.has_tag) pStr = PyString_FromFormat("%s:%d", vp->name, vp->flags.tag); else pStr = PyString_FromString(vp->name); if (pStr == NULL) goto failed; PyTuple_SET_ITEM(pPair, 0, pStr); vp_prints_value(buf, sizeof(buf), vp, 1); if ((pStr = PyString_FromString(buf)) == NULL) goto failed; PyTuple_SET_ITEM(pPair, 1, pStr); return 0; failed: return -1; } #ifdef HAVE_PTHREAD_H /** Cleanup any thread local storage on pthread_exit() */ static void do_python_cleanup(void *arg) { PyThreadState *my_thread_state = arg; PyEval_AcquireLock(); PyThreadState_Swap(NULL); /* Not entirely sure this is needed */ PyThreadState_Clear(my_thread_state); PyThreadState_Delete(my_thread_state); PyEval_ReleaseLock(); } #endif static int do_python(rlm_python_t *inst, REQUEST *request, PyObject *pFunc, char const *funcname, int worker) { VALUE_PAIR *vp; PyObject *pRet = NULL; PyObject *pArgs = NULL; int tuplelen; int ret; PyGILState_STATE gstate; PyThreadState *prev_thread_state = NULL; /* -Wuninitialized */ memset(&gstate, 0, sizeof(gstate)); /* -Wuninitialized */ /* Return with "OK, continue" if the function is not defined. */ if (!pFunc) return RLM_MODULE_NOOP; #ifdef HAVE_PTHREAD_H gstate = PyGILState_Ensure(); if (worker) { PyThreadState *my_thread_state; my_thread_state = fr_thread_local_init(local_thread_state, do_python_cleanup); if (!my_thread_state) { my_thread_state = PyThreadState_New(inst->main_thread_state->interp); if (!my_thread_state) { radlog(L_ERR, "Failed initialising local PyThreadState on first run"); PyGILState_Release(gstate); return RLM_MODULE_FAIL; } ret = fr_thread_local_set(local_thread_state, my_thread_state); if (ret != 0) { radlog(L_ERR, "Failed storing PyThreadState in TLS: %s", strerror(ret)); PyThreadState_Clear(my_thread_state); PyThreadState_Delete(my_thread_state); PyGILState_Release(gstate); return RLM_MODULE_FAIL; } } prev_thread_state = PyThreadState_Swap(my_thread_state); /* Swap in our local thread state */ } #endif /* Default return value is "OK, continue" */ ret = RLM_MODULE_OK; /* * We will pass a tuple containing (name, value) tuples * We can safely use the Python function to build up a * tuple, since the tuple is not used elsewhere. * * Determine the size of our tuple by walking through the packet. * If request is NULL, pass None. */ tuplelen = 0; if (request != NULL) { for (vp = request->packet->vps; vp; vp = vp->next) tuplelen++; } if (tuplelen == 0) { Py_INCREF(Py_None); pArgs = Py_None; } else { int i = 0; if ((pArgs = PyTuple_New(tuplelen)) == NULL) { ret = RLM_MODULE_FAIL; goto finish; } for (vp = request->packet->vps; vp != NULL; vp = vp->next, i++) { PyObject *pPair; /* The inside tuple has two only: */ if ((pPair = PyTuple_New(2)) == NULL) { ret = RLM_MODULE_FAIL; goto finish; } if (python_populate_vptuple(pPair, vp) == 0) { /* Put the tuple inside the container */ PyTuple_SET_ITEM(pArgs, i, pPair); } else { Py_INCREF(Py_None); PyTuple_SET_ITEM(pArgs, i, Py_None); Py_DECREF(pPair); } } } /* Call Python function. */ pRet = PyObject_CallFunctionObjArgs(pFunc, pArgs, NULL); if (!pRet) { ret = RLM_MODULE_FAIL; goto finish; } if (!request) { ret = RLM_MODULE_FAIL; goto finish; } /* * The function returns either: * 1. (returnvalue, replyTuple, configTuple), where * - returnvalue is one of the constants RLM_* * - replyTuple and configTuple are tuples of string * tuples of size 2 * * 2. the function return value alone * * 3. None - default return value is set * * xxx This code is messy! */ if (PyTuple_CheckExact(pRet)) { PyObject *pTupleInt; if (PyTuple_GET_SIZE(pRet) != 3) { radlog(L_ERR, "rlm_python:%s: tuple must be (return, replyTuple, configTuple)", funcname); ret = RLM_MODULE_FAIL; goto finish; } pTupleInt = PyTuple_GET_ITEM(pRet, 0); if (!PyInt_CheckExact(pTupleInt)) { radlog(L_ERR, "rlm_python:%s: first tuple element not an integer", funcname); ret = RLM_MODULE_FAIL; goto finish; } /* Now have the return value */ ret = PyInt_AsLong(pTupleInt); /* Reply item tuple */ python_vptuple(&request->reply->vps, PyTuple_GET_ITEM(pRet, 1), funcname); /* Config item tuple */ python_vptuple(&request->config_items, PyTuple_GET_ITEM(pRet, 2), funcname); } else if (PyInt_CheckExact(pRet)) { /* Just an integer */ ret = PyInt_AsLong(pRet); } else if (pRet == Py_None) { /* returned 'None', return value defaults to "OK, continue." */ ret = RLM_MODULE_OK; } else { /* Not tuple or None */ radlog(L_ERR, "rlm_python:%s: function did not return a tuple or None", funcname); ret = RLM_MODULE_FAIL; goto finish; } finish: Py_XDECREF(pArgs); Py_XDECREF(pRet); #ifdef HAVE_PTHREAD_H if (worker) { PyThreadState_Swap(prev_thread_state); } PyGILState_Release(gstate); #endif return ret; } /* * Import a user module and load a function from it */ static int python_load_function(struct py_function_def *def) { const char *funcname = "python_load_function"; PyGILState_STATE gstate; gstate = PyGILState_Ensure(); if (def->module_name != NULL && def->function_name != NULL) { if ((def->module = PyImport_ImportModule(def->module_name)) == NULL) { radlog(L_ERR, "rlm_python:%s: module '%s' is not found", funcname, def->module_name); goto failed; } if ((def->function = PyObject_GetAttrString(def->module, def->function_name)) == NULL) { radlog(L_ERR, "rlm_python:%s: function '%s.%s' is not found", funcname, def->module_name, def->function_name); goto failed; } if (!PyCallable_Check(def->function)) { radlog(L_ERR, "rlm_python:%s: function '%s.%s' is not callable", funcname, def->module_name, def->function_name); goto failed; } } PyGILState_Release(gstate); return 0; failed: python_error(); radlog(L_ERR, "rlm_python:%s: failed to import python function '%s.%s'", funcname, def->module_name, def->function_name); Py_XDECREF(def->function); def->function = NULL; Py_XDECREF(def->module); def->module = NULL; PyGILState_Release(gstate); return -1; } static void python_objclear(PyObject **ob) { if (*ob != NULL) { Pyx_BLOCK_THREADS Py_DECREF(*ob); Pyx_UNBLOCK_THREADS *ob = NULL; } } static void free_and_null(char **p) { if (*p != NULL) { free(*p); *p = NULL; } } static void python_funcdef_clear(struct py_function_def *def) { python_objclear(&def->function); python_objclear(&def->module); free_and_null(&def->function_name); free_and_null(&def->module_name); } static void python_instance_clear(struct rlm_python_t *data) { #define A(x) python_funcdef_clear(&data->x) A(instantiate); A(authorize); A(authenticate); A(preacct); A(accounting); A(checksimul); A(detach); #undef A } /* * Do any per-module initialization that is separate to each * configured instance of the module. e.g. set up connections * to external databases, read configuration files, set up * dictionary entries, etc. * * If configuration information is given in the config section * that must be referenced in later calls, store a handle to it * in *instance otherwise put a null pointer there. * */ static int python_instantiate(CONF_SECTION *conf, void **instance) { struct rlm_python_t *data = NULL; /* * Set up a storage area for instance data */ if ((data = malloc(sizeof(*data))) == NULL) return -1; memset(data, 0, sizeof(*data)); if (python_init(data) != 0) { free(data); return -1; } /* * If the configuration parameters can't be parsed, then * fail. */ if (cf_section_parse(conf, data, module_config) < 0) { free(data); return -1; } #define A(x) if (python_load_function(&data->x) < 0) goto failed A(instantiate); A(authenticate); A(authorize); A(preacct); A(accounting); A(checksimul); A(pre_proxy); A(post_proxy); A(post_auth); #ifdef WITH_COA A(recv_coa); A(send_coa); #endif A(detach); #undef A *instance = data; /* * Call the instantiate function. No request. Use the * return value. */ return do_python(data, NULL, data->instantiate.function, "instantiate", 0); failed: Pyx_BLOCK_THREADS python_error(); Pyx_UNBLOCK_THREADS python_instance_clear(data); free(data); return -1; } static int python_detach(void *instance) { struct rlm_python_t *data = (struct rlm_python_t *) instance; int ret; ret = do_python(data, NULL, data->detach.function, "detach", 0); python_instance_clear(data); free(data); return ret; } #define A(x) static int python_##x(void *instance, REQUEST *request) { \ return do_python((rlm_python_t *)instance, request, ((struct rlm_python_t *)instance)->x.function, #x, 1); \ } A(authenticate) A(authorize) A(preacct) A(accounting) A(checksimul) A(pre_proxy) A(post_proxy) A(post_auth) #ifdef WITH_COA A(recv_coa) A(send_coa) #endif #undef A /* * The module name should be the only globally exported symbol. * That is, everything else should be 'static'. * * If the module needs to temporarily modify it's instantiation * data, the type should be changed to RLM_TYPE_THREAD_UNSAFE. * The server will then take care of ensuring that the module * is single-threaded. */ module_t rlm_python = { RLM_MODULE_INIT, "python", RLM_TYPE_THREAD_UNSAFE, /* type */ python_instantiate, /* instantiation */ python_detach, { python_authenticate, /* authentication */ python_authorize, /* authorization */ python_preacct, /* preaccounting */ python_accounting, /* accounting */ python_checksimul, /* checksimul */ python_pre_proxy, /* pre-proxy */ python_post_proxy, /* post-proxy */ python_post_auth /* post-auth */ #ifdef WITH_COA , python_recv_coa, python_send_coa #endif } }; freeradius-server/src/modules/rlm_radutmp/000077500000000000000000000000001257552170400213105ustar00rootroot00000000000000freeradius-server/src/modules/rlm_radutmp/.gitignore000066400000000000000000000000221257552170400232720ustar00rootroot00000000000000Makefile config.h freeradius-server/src/modules/rlm_radutmp/Makefile.in000066400000000000000000000002711257552170400233550ustar00rootroot00000000000000# # $Id$ # TARGET = @targetname@ SRCS = rlm_radutmp.c HEADERS = RLM_CFLAGS = @radutmp_cflags@ RLM_LIBS = @radutmp_ldflags@ include ../rules.mak $(LT_OBJS): $(HEADERS) freeradius-server/src/modules/rlm_radutmp/config.h.in000066400000000000000000000025271257552170400233410ustar00rootroot00000000000000/* config.h.in. Generated from configure.in by autoheader. */ /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Define to 1 if you have the header file. */ #undef HAVE_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 header file. */ #undef HAVE_SYS_MMAN_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_UNISTD_H /* 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 version of this package. */ #undef PACKAGE_VERSION /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS freeradius-server/src/modules/rlm_radutmp/configure000077500000000000000000003644021257552170400232300ustar00rootroot00000000000000#! /bin/sh # From configure.in Revision. # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.61. # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, # 2002, 2003, 2004, 2005, 2006 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=: # 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 # PATH needs CR # 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 # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false 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.) as_nl=' ' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. 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 # Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # CDPATH. $as_unset CDPATH if test "x$CONFIG_SHELL" = x; then if (eval ":") 2>/dev/null; then as_have_required=yes else as_have_required=no fi if test $as_have_required = yes && (eval ": (as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=\$LINENO as_lineno_2=\$LINENO test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } ") 2> /dev/null; then : else as_candidate_shells= as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. case $as_dir in /*) for as_base in sh bash ksh sh5; do as_candidate_shells="$as_candidate_shells $as_dir/$as_base" done;; esac done IFS=$as_save_IFS for as_shell in $as_candidate_shells $SHELL; do # Try only shells that exist, to save several forks. if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { ("$as_shell") 2> /dev/null <<\_ASEOF 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 : _ASEOF }; then CONFIG_SHELL=$as_shell as_have_required=yes if { "$as_shell" 2> /dev/null <<\_ASEOF 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 : (as_func_return () { (exit $1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = "$1" ); then : else exitcode=1 echo positional parameters were not saved. fi test $exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } _ASEOF }; then break fi fi done if test "x$CONFIG_SHELL" != x; then for as_var in BASH_ENV ENV do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done export CONFIG_SHELL exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} fi if test $as_have_required = no; then echo This script requires a shell more modern than all the echo shells that I found on your system. Please install a echo modern shell, or manually run the script under such a echo shell if you do have one. { (exit 1); exit 1; } fi fi fi (eval "as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0") || { echo No shell found that supports shell functions. echo Please tell autoconf@gnu.org about your system, echo including any error possibly output before this echo message } as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, and appends # trailing '-' during substitution so that $LINENO is not a special # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # scripts with optimization help from Paolo Bonzini. 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" || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi 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 fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi 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=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, 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= SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME= PACKAGE_TARNAME= PACKAGE_VERSION= PACKAGE_STRING= PACKAGE_BUGREPORT= ac_unique_file="rlm_radutmp.c" # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef STDC_HEADERS # include # include #else # ifdef HAVE_STDLIB_H # include # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datarootdir datadir sysconfdir sharedstatedir localstatedir includedir oldincludedir docdir infodir htmldir dvidir pdfdir psdir libdir localedir mandir DEFS ECHO_C ECHO_N ECHO_T LIBS build_alias host_alias target_alias CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP GREP EGREP radutmp_ldflags radutmp_cflags targetname LIBOBJS LTLIBOBJS' ac_subst_files='' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CPP' # Initialize some variables set by options. ac_init_help= ac_init_version=false # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *) ac_optarg=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_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` eval enable_$ac_feature=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_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` eval enable_$ac_feature=\$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_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/[-.]/_/g'` eval with_$ac_package=\$ac_optarg ;; -without-* | --without-*) ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/[-.]/_/g'` eval with_$ac_package=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 ;; -*) { echo "$as_me: error: unrecognized option: $ac_option Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && 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'` { echo "$as_me: error: missing argument to $ac_option" >&2 { (exit 1); exit 1; }; } fi # Be sure to have absolute directory names. 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 case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; } 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 echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || { echo "$as_me: error: Working directory cannot be determined" >&2 { (exit 1); exit 1; }; } test "X$ac_ls_di" = "X$ac_pwd_ls_di" || { echo "$as_me: error: pwd does not report name of working directory" >&2 { (exit 1); exit 1; }; } # 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 -- "$0" || $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$0" : 'X\(//\)[^/]' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X"$0" | 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 .." { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2 { (exit 1); exit 1; }; } pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures this package to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF _ACEOF fi if test -n "$ac_init_help"; then cat <<\_ACEOF 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 C/C++/Objective C preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. _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" || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`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 echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF configure generated by GNU Autoconf 2.61 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 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 cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by $as_me, which was generated by GNU Autoconf 2.61. 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=. 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=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; 2) ac_configure_args1="$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 ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac done done $as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } $as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export 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 cat <<\_ASBOX ## ---------------- ## ## Cache variables. ## ## ---------------- ## _ASBOX 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_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( *) $as_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 cat <<\_ASBOX ## ----------------- ## ## Output variables. ## ## ----------------- ## _ASBOX echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then cat <<\_ASBOX ## ------------------- ## ## File substitutions. ## ## ------------------- ## _ASBOX echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then cat <<\_ASBOX ## ----------- ## ## confdefs.h. ## ## ----------- ## _ASBOX echo cat confdefs.h echo fi test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" 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'; { (exit 1); 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 # 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 # Let the site file select an alternate cache file if it wants to. # Prefer explicitly selected file to automatically selected ones. if test -n "$CONFIG_SITE"; then set x "$CONFIG_SITE" elif test "x$prefix" != xNONE; then set x "$prefix/share/config.site" "$prefix/etc/config.site" else set x "$ac_default_prefix/share/config.site" \ "$ac_default_prefix/etc/config.site" fi shift for ac_site_file do if test -r "$ac_site_file"; then { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" 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. if test -f "$cache_file"; then { echo "$as_me:$LINENO: loading cache $cache_file" >&5 echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { echo "$as_me:$LINENO: creating cache $cache_file" >&5 echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 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 { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 echo "$as_me: former value: $ac_old_val" >&2;} { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 echo "$as_me: current value: $ac_new_val" >&2;} ac_cache_corrupted=: fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`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. *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 echo "$as_me: error: changes in the environment can compromise the build" >&2;} { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} { (exit 1); exit 1; }; } 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 x$with_rlm_radutmp != xno; then 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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}gcc" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="gcc" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}cc" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="$ac_prog" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&5 echo "$as_me: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } # Provide some information about the compiler. echo "$as_me:$LINENO: checking for C compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (ac_try="$ac_compiler --version >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -v >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -V >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out 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. { echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6; } ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # # List of possible output files, starting from the most likely. # The algorithm is not robust to junk in `.', hence go to wildcards (a.*) # only as a last resort. b.out is created by i960 compilers. ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out' # # The IRIX 6 linker writes into existing files which may not be # executable, retaining their permissions. Remove them first so a # subsequent execution test works. ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link_default") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; 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 | *.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 { echo "$as_me:$LINENO: result: $ac_file" >&5 echo "${ECHO_T}$ac_file" >&6; } if test -z "$ac_file"; then echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: C compiler cannot create executables See \`config.log' for more details." >&5 echo "$as_me: error: C compiler cannot create executables See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } fi ac_exeext=$ac_cv_exeext # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { echo "$as_me:$LINENO: checking whether the C compiler works" >&5 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6; } # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then if { ac_try='./$ac_file' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { echo "$as_me:$LINENO: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&5 echo "$as_me: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi fi fi { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } rm -f a.out a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; } { echo "$as_me:$LINENO: result: $cross_compiling" >&5 echo "${ECHO_T}$cross_compiling" >&6; } { echo "$as_me:$LINENO: checking for suffix of executables" >&5 echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; } if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; 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 | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest$ac_cv_exeext { echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 echo "${ECHO_T}$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT { echo "$as_me:$LINENO: checking for suffix of object files" >&5 echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; } if test "${ac_cv_objext+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; 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 ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 echo "${ECHO_T}$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; } if test "${ac_cv_c_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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 { echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; } GCC=`test $ac_compiler_gnu = yes && echo yes` ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CFLAGS="" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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 { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 echo "${ECHO_T}$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 { echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_c89+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_c89=$ac_arg else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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) { echo "$as_me:$LINENO: result: none needed" >&5 echo "${ECHO_T}none needed" >&6; } ;; xno) { echo "$as_me:$LINENO: result: unsupported" >&5 echo "${ECHO_T}unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;; 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 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 { echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if test "${ac_cv_prog_CPP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f 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 { echo "$as_me:$LINENO: result: $CPP" >&5 echo "${ECHO_T}$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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&5 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } 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 { echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5 echo $ECHO_N "checking for grep that handles long lines and -e... $ECHO_C" >&6; } if test "${ac_cv_path_GREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Extract the first word of "grep ggrep" to use in msg output if test -z "$GREP"; then set dummy grep ggrep; ac_prog_name=$2 if test "${ac_cv_path_GREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" 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 ac_count=`expr $ac_count + 1` 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 fi GREP="$ac_cv_path_GREP" if test -z "$GREP"; then { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} { (exit 1); exit 1; }; } fi else ac_cv_path_GREP=$GREP fi fi { echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5 echo "${ECHO_T}$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { echo "$as_me:$LINENO: checking for egrep" >&5 echo $ECHO_N "checking for egrep... $ECHO_C" >&6; } if test "${ac_cv_path_EGREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else # Extract the first word of "egrep" to use in msg output if test -z "$EGREP"; then set dummy egrep; ac_prog_name=$2 if test "${ac_cv_path_EGREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" 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 ac_count=`expr $ac_count + 1` 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 fi EGREP="$ac_cv_path_EGREP" if test -z "$EGREP"; then { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} { (exit 1); exit 1; }; } fi else ac_cv_path_EGREP=$EGREP fi fi fi { echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 echo "${ECHO_T}$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" { echo "$as_me:$LINENO: checking for ANSI C header files" >&5 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; } if test "${ac_cv_header_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_header_stdc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* 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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* 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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* 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 rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi { echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 echo "${ECHO_T}$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then cat >>confdefs.h <<\_ACEOF #define STDC_HEADERS 1 _ACEOF 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=`echo "ac_cv_header_$ac_header" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Header=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in sys/mman.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? { echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ;; esac { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done targetname=rlm_radutmp else targetname= echo \*\*\* module rlm_radutmp is disabled. fi ac_config_headers="$ac_config_headers config.h" unset ac_cv_env_LIBS_set unset ac_cv_env_LIBS_value ac_config_files="$ac_config_files 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_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( *) $as_unset $ac_var ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then test "x$cache_file" != "x/dev/null" && { echo "$as_me:$LINENO: updating cache $cache_file" >&5 echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 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= 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=`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. ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs : ${CONFIG_STATUS=./config.status} ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >$CONFIG_STATUS <<_ACEOF #! $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} _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ## --------------------- ## ## 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=: # 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 # PATH needs CR # 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 # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false 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.) as_nl=' ' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. 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 # Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # CDPATH. $as_unset CDPATH as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, and appends # trailing '-' during substitution so that $LINENO is not a special # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # scripts with optimization help from Paolo Bonzini. 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" || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi 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 fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi 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=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 # Save the log message, to keep $[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by $as_me, which was generated by GNU Autoconf 2.61. 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 cat >>$CONFIG_STATUS <<_ACEOF # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ config.status configured by $0, generated by GNU Autoconf 2.61, with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" Copyright (C) 2006 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' _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # If no file are specified by the user, then we need to provide default # value. By we need to know if files were specified by the user. 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=$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 ) echo "$ac_cs_version"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift CONFIG_FILES="$CONFIG_FILES $ac_optarg" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header { echo "$as_me: error: ambiguous option: $1 Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; };; --help | --hel | -h ) 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. -*) { echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *) ac_config_targets="$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 if \$ac_cs_recheck; then echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 CONFIG_SHELL=$SHELL export CONFIG_SHELL exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # 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" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= trap 'exit_status=$? { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status ' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || { echo "$me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } # # Set up the sed scripts for CONFIG_FILES section. # # No need to generate the scripts if there are no CONFIG_FILES. # This happens for instance when ./config.status config.h if test -n "$CONFIG_FILES"; then _ACEOF ac_delim='%!_!# ' for ac_last_try in false false false false false :; do cat >conf$$subs.sed <<_ACEOF SHELL!$SHELL$ac_delim PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim PACKAGE_NAME!$PACKAGE_NAME$ac_delim PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim PACKAGE_STRING!$PACKAGE_STRING$ac_delim PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim exec_prefix!$exec_prefix$ac_delim prefix!$prefix$ac_delim program_transform_name!$program_transform_name$ac_delim bindir!$bindir$ac_delim sbindir!$sbindir$ac_delim libexecdir!$libexecdir$ac_delim datarootdir!$datarootdir$ac_delim datadir!$datadir$ac_delim sysconfdir!$sysconfdir$ac_delim sharedstatedir!$sharedstatedir$ac_delim localstatedir!$localstatedir$ac_delim includedir!$includedir$ac_delim oldincludedir!$oldincludedir$ac_delim docdir!$docdir$ac_delim infodir!$infodir$ac_delim htmldir!$htmldir$ac_delim dvidir!$dvidir$ac_delim pdfdir!$pdfdir$ac_delim psdir!$psdir$ac_delim libdir!$libdir$ac_delim localedir!$localedir$ac_delim mandir!$mandir$ac_delim DEFS!$DEFS$ac_delim ECHO_C!$ECHO_C$ac_delim ECHO_N!$ECHO_N$ac_delim ECHO_T!$ECHO_T$ac_delim LIBS!$LIBS$ac_delim build_alias!$build_alias$ac_delim host_alias!$host_alias$ac_delim target_alias!$target_alias$ac_delim CC!$CC$ac_delim CFLAGS!$CFLAGS$ac_delim LDFLAGS!$LDFLAGS$ac_delim CPPFLAGS!$CPPFLAGS$ac_delim ac_ct_CC!$ac_ct_CC$ac_delim EXEEXT!$EXEEXT$ac_delim OBJEXT!$OBJEXT$ac_delim CPP!$CPP$ac_delim GREP!$GREP$ac_delim EGREP!$EGREP$ac_delim radutmp_ldflags!$radutmp_ldflags$ac_delim radutmp_cflags!$radutmp_cflags$ac_delim targetname!$targetname$ac_delim LIBOBJS!$LIBOBJS$ac_delim LTLIBOBJS!$LTLIBOBJS$ac_delim _ACEOF if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 52; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` if test -n "$ac_eof"; then ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` ac_eof=`expr $ac_eof + 1` fi cat >>$CONFIG_STATUS <<_ACEOF cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof /@[a-zA-Z_][a-zA-Z_0-9]*@/!b end _ACEOF sed ' s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g s/^/s,@/; s/!/@,|#_!!_#|/ :n t n s/'"$ac_delim"'$/,g/; t s/$/\\/; p N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n ' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF :end s/|#_!!_#|//g CEOF$ac_eof _ACEOF # VPATH may cause trouble with some makes, so we remove $(srcdir), # ${srcdir} and @srcdir@ 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[ ]*=/{ s/:*\$(srcdir):*/:/ s/:*\${srcdir}:*/:/ s/:*@srcdir@:*/:/ s/^\([^=]*=[ ]*\):*/\1/ s/:*$// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF fi # test -n "$CONFIG_FILES" for ac_tag in :F $CONFIG_FILES :H $CONFIG_HEADERS do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5 echo "$as_me: error: Invalid tag $ac_tag." >&2;} { (exit 1); exit 1; }; };; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 echo "$as_me: error: cannot find input file: $ac_f" >&2;} { (exit 1); exit 1; }; };; esac ac_file_inputs="$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 "`IFS=: echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure." if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { echo "$as_me:$LINENO: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} fi case $ac_tag in *:-:* | *:-) cat >"$tmp/stdin";; 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 || 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" case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`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 || 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" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 echo "$as_me: error: cannot create directory $as_dir" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`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 # _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # 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= case `sed -n '/datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p ' $ac_file_inputs` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF 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 sed "$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s&@configure_input@&$configure_input&;t t s&@top_builddir@&$ac_top_builddir_sub&;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 $ac_datarootdir_hack " $ac_file_inputs | sed -f "$tmp/subs-1.sed" >$tmp/out test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&5 echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&2;} rm -f "$tmp/stdin" case $ac_file in -) cat "$tmp/out"; rm -f "$tmp/out";; *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;; esac ;; :H) # # CONFIG_HEADER # _ACEOF # Transform confdefs.h into a sed script `conftest.defines', that # substitutes the proper values into config.h.in to produce config.h. rm -f conftest.defines conftest.tail # First, append a space to every undef/define line, to ease matching. echo 's/$/ /' >conftest.defines # Then, protect against being on the right side of a sed subst, or in # an unquoted here document, in config.status. If some macros were # called several times there might be several #defines for the same # symbol, which is useless. But do not sort them, since the last # AC_DEFINE must be honored. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* # These sed commands are passed to sed as "A NAME B PARAMS C VALUE D", where # NAME is the cpp macro being defined, VALUE is the value it is being given. # PARAMS is the parameter list in the macro definition--in most cases, it's # just an empty string. ac_dA='s,^\\([ #]*\\)[^ ]*\\([ ]*' ac_dB='\\)[ (].*,\\1define\\2' ac_dC=' ' ac_dD=' ,' uniq confdefs.h | sed -n ' t rset :rset s/^[ ]*#[ ]*define[ ][ ]*// t ok d :ok s/[\\&,]/\\&/g s/^\('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/ '"$ac_dA"'\1'"$ac_dB"'\2'"${ac_dC}"'\3'"$ac_dD"'/p s/^\('"$ac_word_re"'\)[ ]*\(.*\)/'"$ac_dA"'\1'"$ac_dB$ac_dC"'\2'"$ac_dD"'/p ' >>conftest.defines # Remove the space that was appended to ease matching. # Then 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. # (The regexp can be short, since the line contains either #define or #undef.) echo 's/ $// s,^[ #]*u.*,/* & */,' >>conftest.defines # Break up conftest.defines: ac_max_sed_lines=50 # First sed command is: sed -f defines.sed $ac_file_inputs >"$tmp/out1" # Second one is: sed -f defines.sed "$tmp/out1" >"$tmp/out2" # Third one will be: sed -f defines.sed "$tmp/out2" >"$tmp/out1" # et cetera. ac_in='$ac_file_inputs' ac_out='"$tmp/out1"' ac_nxt='"$tmp/out2"' while : do # Write a here document: cat >>$CONFIG_STATUS <<_ACEOF # First, check the format of the line: cat >"\$tmp/defines.sed" <<\\CEOF /^[ ]*#[ ]*undef[ ][ ]*$ac_word_re[ ]*\$/b def /^[ ]*#[ ]*define[ ][ ]*$ac_word_re[( ]/b def b :def _ACEOF sed ${ac_max_sed_lines}q conftest.defines >>$CONFIG_STATUS echo 'CEOF sed -f "$tmp/defines.sed"' "$ac_in >$ac_out" >>$CONFIG_STATUS ac_in=$ac_out; ac_out=$ac_nxt; ac_nxt=$ac_in sed 1,${ac_max_sed_lines}d conftest.defines >conftest.tail grep . conftest.tail >/dev/null || break rm -f conftest.defines mv conftest.tail conftest.defines done rm -f conftest.defines conftest.tail echo "ac_result=$ac_in" >>$CONFIG_STATUS cat >>$CONFIG_STATUS <<\_ACEOF if test x"$ac_file" != x-; then echo "/* $configure_input */" >"$tmp/config.h" cat "$ac_result" >>"$tmp/config.h" if diff $ac_file "$tmp/config.h" >/dev/null 2>&1; then { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 echo "$as_me: $ac_file is unchanged" >&6;} else rm -f $ac_file mv "$tmp/config.h" $ac_file fi else echo "/* $configure_input */" cat "$ac_result" fi rm -f "$tmp/out12" ;; esac done # for ac_tag { (exit 0); exit 0; } _ACEOF chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save # 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 || { (exit 1); exit 1; } fi freeradius-server/src/modules/rlm_radutmp/configure.in000066400000000000000000000005621257552170400236240ustar00rootroot00000000000000AC_PREREQ([2.53]) AC_INIT(rlm_radutmp.c) AC_REVISION($Revision$) AC_DEFUN(modname,[rlm_radutmp]) if test x$with_[]modname != xno; then AC_CHECK_HEADERS(sys/mman.h) targetname=modname else targetname= echo \*\*\* module modname is disabled. fi AC_SUBST(radutmp_ldflags) AC_SUBST(radutmp_cflags) AC_SUBST(targetname) AC_CONFIG_HEADER(config.h) AC_OUTPUT(Makefile) freeradius-server/src/modules/rlm_radutmp/rlm_radutmp.c000066400000000000000000000447051257552170400240140ustar00rootroot00000000000000/* * rlm_radutmp.c * * Version: $Id$ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2000,2006 The FreeRADIUS server project * FIXME add copyrights */ #include RCSID("$Id$") #include #include #include #include #include #include #include "config.h" #define LOCK_LEN sizeof(struct radutmp) static const char porttypes[] = "ASITX"; /* * used for caching radutmp lookups in the accounting component. The * session (checksimul) component doesn't use it, but probably should. */ typedef struct nas_port { uint32_t nasaddr; unsigned int port; off_t offset; struct nas_port *next; } NAS_PORT; typedef struct rlm_radutmp_t { NAS_PORT *nas_port_list; char *filename; char *username; int case_sensitive; int check_nas; int permission; int callerid_ok; } rlm_radutmp_t; static const CONF_PARSER module_config[] = { { "filename", PW_TYPE_STRING_PTR, offsetof(rlm_radutmp_t,filename), NULL, RADUTMP }, { "username", PW_TYPE_STRING_PTR, offsetof(rlm_radutmp_t,username), NULL, "%{User-Name}"}, { "case_sensitive", PW_TYPE_BOOLEAN, offsetof(rlm_radutmp_t,case_sensitive), NULL, "yes"}, { "check_with_nas", PW_TYPE_BOOLEAN, offsetof(rlm_radutmp_t,check_nas), NULL, "yes"}, { "perm", PW_TYPE_INTEGER, offsetof(rlm_radutmp_t,permission), NULL, "0644" }, { "callerid", PW_TYPE_BOOLEAN, offsetof(rlm_radutmp_t,callerid_ok), NULL, "no" }, { NULL, -1, 0, NULL, NULL } /* end the list */ }; static int radutmp_instantiate(CONF_SECTION *conf, void **instance) { rlm_radutmp_t *inst; inst = rad_malloc(sizeof(*inst)); if (!inst) { return -1; } memset(inst, 0, sizeof(*inst)); if (cf_section_parse(conf, inst, module_config)) { free(inst); return -1; } inst->nas_port_list = NULL; *instance = inst; return 0; } /* * Detach. */ static int radutmp_detach(void *instance) { NAS_PORT *p, *next; rlm_radutmp_t *inst = instance; for (p = inst->nas_port_list ; p ; p=next) { next = p->next; free(p); } free(inst); return 0; } /* * Zap all users on a NAS from the radutmp file. */ static int radutmp_zap(UNUSED rlm_radutmp_t *inst, const char *filename, uint32_t nasaddr, time_t t) { struct radutmp u; int fd; if (t == 0) time(&t); fd = open(filename, O_RDWR); if (fd < 0) { radlog(L_ERR, "rlm_radutmp: Error accessing file %s: %s", filename, strerror(errno)); return RLM_MODULE_FAIL; } /* * Lock the utmp file, prefer lockf() over flock(). */ rad_lockfd(fd, LOCK_LEN); /* * Find the entry for this NAS / portno combination. */ while (read(fd, &u, sizeof(u)) == sizeof(u)) { if ((nasaddr != 0 && nasaddr != u.nas_address) || u.type != P_LOGIN) continue; /* * Match. Zap it. */ if (lseek(fd, -(off_t)sizeof(u), SEEK_CUR) < 0) { radlog(L_ERR, "rlm_radutmp: radutmp_zap: negative lseek!"); lseek(fd, (off_t)0, SEEK_SET); } u.type = P_IDLE; u.time = t; write(fd, &u, sizeof(u)); } close(fd); /* and implicitely release the locks */ return 0; } /* * Lookup a NAS_PORT in the nas_port_list */ static NAS_PORT *nas_port_find(NAS_PORT *nas_port_list, uint32_t nasaddr, unsigned int port) { NAS_PORT *cl; for(cl = nas_port_list; cl; cl = cl->next) if (nasaddr == cl->nasaddr && port == cl->port) break; return cl; } /* * Store logins in the RADIUS utmp file. */ static int radutmp_accounting(void *instance, REQUEST *request) { struct radutmp ut, u; VALUE_PAIR *vp; int status = -1; int protocol = -1; time_t t; int fd; int port_seen = 0; int off; rlm_radutmp_t *inst = instance; char buffer[256]; char filename[1024]; char ip_name[32]; /* 255.255.255.255 */ const char *nas; NAS_PORT *cache; int r; if (request->packet->src_ipaddr.af != AF_INET) { DEBUG("rlm_radutmp: IPv6 not supported!"); return RLM_MODULE_NOOP; } /* * Which type is this. */ if ((vp = pairfind(request->packet->vps, PW_ACCT_STATUS_TYPE)) == NULL) { RDEBUG("No Accounting-Status-Type record."); return RLM_MODULE_NOOP; } status = vp->vp_integer; /* * Look for weird reboot packets. * * ComOS (up to and including 3.5.1b20) does not send * standard PW_STATUS_ACCOUNTING_XXX messages. * * Check for: o no Acct-Session-Time, or time of 0 * o Acct-Session-Id of "00000000". * * We could also check for NAS-Port, that attribute * should NOT be present (but we don't right now). */ if ((status != PW_STATUS_ACCOUNTING_ON) && (status != PW_STATUS_ACCOUNTING_OFF)) do { int check1 = 0; int check2 = 0; if ((vp = pairfind(request->packet->vps, PW_ACCT_SESSION_TIME)) == NULL || vp->vp_date == 0) check1 = 1; if ((vp = pairfind(request->packet->vps, PW_ACCT_SESSION_ID)) != NULL && vp->length == 8 && memcmp(vp->vp_strvalue, "00000000", 8) == 0) check2 = 1; if (check1 == 0 || check2 == 0) { #if 0 /* Cisco sometimes sends START records without username. */ radlog(L_ERR, "rlm_radutmp: no username in record"); return RLM_MODULE_FAIL; #else break; #endif } radlog(L_INFO, "rlm_radutmp: converting reboot records."); if (status == PW_STATUS_STOP) status = PW_STATUS_ACCOUNTING_OFF; if (status == PW_STATUS_START) status = PW_STATUS_ACCOUNTING_ON; } while(0); time(&t); memset(&ut, 0, sizeof(ut)); ut.porttype = 'A'; ut.nas_address = htonl(INADDR_NONE); /* * First, find the interesting attributes. */ for (vp = request->packet->vps; vp; vp = vp->next) { switch (vp->attribute) { case PW_LOGIN_IP_HOST: case PW_FRAMED_IP_ADDRESS: ut.framed_address = vp->vp_ipaddr; break; case PW_FRAMED_PROTOCOL: protocol = vp->vp_integer; break; case PW_NAS_IP_ADDRESS: ut.nas_address = vp->vp_ipaddr; break; case PW_NAS_PORT: ut.nas_port = vp->vp_integer; port_seen = 1; break; case PW_ACCT_DELAY_TIME: ut.delay = vp->vp_integer; break; case PW_ACCT_SESSION_ID: /* * If length > 8, only store the * last 8 bytes. */ off = vp->length - sizeof(ut.session_id); /* * Ascend is br0ken - it adds a \0 * to the end of any string. * Compensate. */ if (vp->length > 0 && vp->vp_strvalue[vp->length - 1] == 0) off--; if (off < 0) off = 0; memcpy(ut.session_id, vp->vp_strvalue + off, sizeof(ut.session_id)); break; case PW_NAS_PORT_TYPE: if (vp->vp_integer <= 4) ut.porttype = porttypes[vp->vp_integer]; break; case PW_CALLING_STATION_ID: if(inst->callerid_ok) strlcpy(ut.caller_id, (char *)vp->vp_strvalue, sizeof(ut.caller_id)); break; } } /* * If we didn't find out the NAS address, use the * originator's IP address. */ if (ut.nas_address == htonl(INADDR_NONE)) { ut.nas_address = request->packet->src_ipaddr.ipaddr.ip4addr.s_addr; nas = request->client->shortname; } else if (request->packet->src_ipaddr.ipaddr.ip4addr.s_addr == ut.nas_address) { /* might be a client, might not be. */ nas = request->client->shortname; } else { /* * The NAS isn't a client, it's behind * a proxy server. In that case, just * get the IP address. */ nas = ip_ntoa(ip_name, ut.nas_address); } /* * Set the protocol field. */ if (protocol == PW_PPP) ut.proto = 'P'; else if (protocol == PW_SLIP) ut.proto = 'S'; else ut.proto = 'T'; ut.time = t - ut.delay; /* * Get the utmp filename, via xlat. */ radius_xlat(filename, sizeof(filename), inst->filename, request, NULL); /* * See if this was a reboot. * * Hmm... we may not want to zap all of the users when * the NAS comes up, because of issues with receiving * UDP packets out of order. */ if (status == PW_STATUS_ACCOUNTING_ON && (ut.nas_address != htonl(INADDR_NONE))) { radlog(L_INFO, "rlm_radutmp: NAS %s restarted (Accounting-On packet seen)", nas); radutmp_zap(inst, filename, ut.nas_address, ut.time); return RLM_MODULE_OK; } if (status == PW_STATUS_ACCOUNTING_OFF && (ut.nas_address != htonl(INADDR_NONE))) { radlog(L_INFO, "rlm_radutmp: NAS %s rebooted (Accounting-Off packet seen)", nas); radutmp_zap(inst, filename, ut.nas_address, ut.time); return RLM_MODULE_OK; } /* * If we don't know this type of entry pretend we succeeded. */ if (status != PW_STATUS_START && status != PW_STATUS_STOP && status != PW_STATUS_ALIVE) { radlog(L_ERR, "rlm_radutmp: NAS %s port %u unknown packet type %d)", nas, ut.nas_port, status); return RLM_MODULE_NOOP; } /* * Translate the User-Name attribute, or whatever else * they told us to use. */ *buffer = '\0'; radius_xlat(buffer, sizeof(buffer), inst->username, request, NULL); /* * Copy the previous translated user name. */ strlcpy(ut.login, buffer, RUT_NAMESIZE); /* * Perhaps we don't want to store this record into * radutmp. We skip records: * * - without a NAS-Port (telnet / tcp access) * - with the username "!root" (console admin login) */ if (!port_seen) { DEBUG2(" rlm_radutmp: No NAS-Port seen. Cannot do anything."); DEBUG2(" rlm_radumtp: WARNING: checkrad will probably not work!"); return RLM_MODULE_NOOP; } if (strncmp(ut.login, "!root", RUT_NAMESIZE) == 0) { DEBUG2(" rlm_radutmp: Not recording administrative user"); return RLM_MODULE_NOOP; } /* * Enter into the radutmp file. */ fd = open(filename, O_RDWR|O_CREAT, inst->permission); if (fd < 0) { radlog(L_ERR, "rlm_radutmp: Error accessing file %s: %s", filename, strerror(errno)); return RLM_MODULE_FAIL; } /* * Lock the utmp file, prefer lockf() over flock(). */ rad_lockfd(fd, LOCK_LEN); /* * Find the entry for this NAS / portno combination. */ if ((cache = nas_port_find(inst->nas_port_list, ut.nas_address, ut.nas_port)) != NULL) { lseek(fd, (off_t)cache->offset, SEEK_SET); } r = 0; off = 0; while (read(fd, &u, sizeof(u)) == sizeof(u)) { off += sizeof(u); if (u.nas_address != ut.nas_address || u.nas_port != ut.nas_port) continue; /* * Don't compare stop records to unused entries. */ if (status == PW_STATUS_STOP && u.type == P_IDLE) { continue; } if (status == PW_STATUS_STOP && strncmp(ut.session_id, u.session_id, sizeof(u.session_id)) != 0) { /* * Don't complain if this is not a * login record (some clients can * send _only_ logout records). */ if (u.type == P_LOGIN) radlog(L_ERR, "rlm_radutmp: Logout entry for NAS %s port %u has wrong ID", nas, u.nas_port); r = -1; break; } if (status == PW_STATUS_START && strncmp(ut.session_id, u.session_id, sizeof(u.session_id)) == 0 && u.time >= ut.time) { if (u.type == P_LOGIN) { radlog(L_INFO, "rlm_radutmp: Login entry for NAS %s port %u duplicate", nas, u.nas_port); r = -1; break; } radlog(L_ERR, "rlm_radutmp: Login entry for NAS %s port %u wrong order", nas, u.nas_port); r = -1; break; } /* * FIXME: the ALIVE record could need * some more checking, but anyway I'd * rather rewrite this mess -- miquels. */ if (status == PW_STATUS_ALIVE && strncmp(ut.session_id, u.session_id, sizeof(u.session_id)) == 0 && u.type == P_LOGIN) { /* * Keep the original login time. */ ut.time = u.time; } if (lseek(fd, -(off_t)sizeof(u), SEEK_CUR) < 0) { radlog(L_ERR, "rlm_radutmp: negative lseek!"); lseek(fd, (off_t)0, SEEK_SET); off = 0; } else off -= sizeof(u); r = 1; break; } /* read the file until we find a match */ /* * Found the entry, do start/update it with * the information from the packet. */ if (r >= 0 && (status == PW_STATUS_START || status == PW_STATUS_ALIVE)) { /* * Remember where the entry was, because it's * easier than searching through the entire file. */ if (cache == NULL) { cache = rad_malloc(sizeof(NAS_PORT)); cache->nasaddr = ut.nas_address; cache->port = ut.nas_port; cache->offset = off; cache->next = inst->nas_port_list; inst->nas_port_list = cache; } ut.type = P_LOGIN; write(fd, &ut, sizeof(u)); } /* * The user has logged off, delete the entry by * re-writing it in place. */ if (status == PW_STATUS_STOP) { if (r > 0) { u.type = P_IDLE; u.time = ut.time; u.delay = ut.delay; write(fd, &u, sizeof(u)); } else if (r == 0) { radlog(L_ERR, "rlm_radutmp: Logout for NAS %s port %u, but no Login record", nas, ut.nas_port); } } close(fd); /* and implicitely release the locks */ return RLM_MODULE_OK; } /* * See if a user is already logged in. Sets request->simul_count to the * current session count for this user and sets request->simul_mpp to 2 * if it looks like a multilink attempt based on the requested IP * address, otherwise leaves request->simul_mpp alone. * * Check twice. If on the first pass the user exceeds his * max. number of logins, do a second pass and validate all * logins by querying the terminal server (using eg. SNMP). */ static int radutmp_checksimul(void *instance, REQUEST *request) { struct radutmp u; int fd; VALUE_PAIR *vp; uint32_t ipno = 0; char *call_num = NULL; int rcode; rlm_radutmp_t *inst = instance; char login[256]; char filename[1024]; /* * Get the filename, via xlat. */ radius_xlat(filename, sizeof(filename), inst->filename, request, NULL); if ((fd = open(filename, O_RDWR)) < 0) { /* * If the file doesn't exist, then no users * are logged in. */ if (errno == ENOENT) { request->simul_count=0; return RLM_MODULE_OK; } /* * Error accessing the file. */ radlog(L_ERR, "rlm_radumtp: Error accessing file %s: %s", filename, strerror(errno)); return RLM_MODULE_FAIL; } *login = '\0'; radius_xlat(login, sizeof(login), inst->username, request, NULL); if (!*login) { close(fd); return RLM_MODULE_NOOP; } /* * WTF? This is probably wrong... we probably want to * be able to check users across multiple session accounting * methods. */ request->simul_count = 0; /* * Loop over utmp, counting how many people MAY be logged in. */ while (read(fd, &u, sizeof(u)) == sizeof(u)) { if (((strncmp(login, u.login, RUT_NAMESIZE) == 0) || (!inst->case_sensitive && (strncasecmp(login, u.login, RUT_NAMESIZE) == 0))) && (u.type == P_LOGIN)) { ++request->simul_count; } } /* * The number of users logged in is OK, * OR, we've been told to not check the NAS. */ if ((request->simul_count < request->simul_max) || !inst->check_nas) { close(fd); return RLM_MODULE_OK; } lseek(fd, (off_t)0, SEEK_SET); /* * Setup some stuff, like for MPP detection. */ if ((vp = pairfind(request->packet->vps, PW_FRAMED_IP_ADDRESS)) != NULL) ipno = vp->vp_ipaddr; if ((vp = pairfind(request->packet->vps, PW_CALLING_STATION_ID)) != NULL) call_num = vp->vp_strvalue; /* * lock the file while reading/writing. */ rad_lockfd(fd, LOCK_LEN); /* * FIXME: If we get a 'Start' for a user/nas/port which is * listed, but for which we did NOT get a 'Stop', then * it's not a duplicate session. This happens with * static IP's like DSL. */ request->simul_count = 0; while (read(fd, &u, sizeof(u)) == sizeof(u)) { if (((strncmp(login, u.login, RUT_NAMESIZE) == 0) || (!inst->case_sensitive && (strncasecmp(login, u.login, RUT_NAMESIZE) == 0))) && (u.type == P_LOGIN)) { char session_id[sizeof(u.session_id) + 1]; char utmp_login[sizeof(u.login) + 1]; strlcpy(session_id, u.session_id, sizeof(session_id)); /* * The login name MAY fill the whole field, * and thus won't be zero-filled. * * Note that we take the user name from * the utmp file, as that's the canonical * form. The 'login' variable may contain * a string which is an upper/lowercase * version of u.login. When we call the * routine to check the terminal server, * the NAS may be case sensitive. * * e.g. We ask if "bob" is using a port, * and the NAS says "no", because "BOB" * is using the port. */ strlcpy(utmp_login, u.login, sizeof(u.login)); /* * rad_check_ts may take seconds * to return, and we don't want * to block everyone else while * that's happening. */ rad_unlockfd(fd, LOCK_LEN); rcode = rad_check_ts(u.nas_address, u.nas_port, utmp_login, session_id); rad_lockfd(fd, LOCK_LEN); if (rcode == 0) { /* * Stale record - zap it. */ session_zap(request, u.nas_address, u.nas_port, login, session_id, u.framed_address, u.proto,0); } else if (rcode == 1) { /* * User is still logged in. */ ++request->simul_count; /* * Does it look like a MPP attempt? */ if (strchr("SCPA", u.proto) && ipno && u.framed_address == ipno) request->simul_mpp = 2; else if (strchr("SCPA", u.proto) && call_num && !strncmp(u.caller_id,call_num,16)) request->simul_mpp = 2; } else { /* * Failed to check the terminal * server for duplicate logins: * Return an error. */ close(fd); radlog(L_ERR, "rlm_radutmp: Failed to check the terminal server for user '%s'.", utmp_login); return RLM_MODULE_FAIL; } } } close(fd); /* and implicitely release the locks */ return RLM_MODULE_OK; } /* globally exported name */ module_t rlm_radutmp = { RLM_MODULE_INIT, "radutmp", RLM_TYPE_THREAD_UNSAFE | RLM_TYPE_CHECK_CONFIG_SAFE | RLM_TYPE_HUP_SAFE, /* type */ radutmp_instantiate, /* instantiation */ radutmp_detach, /* detach */ { NULL, /* authentication */ NULL, /* authorization */ NULL, /* preaccounting */ radutmp_accounting, /* accounting */ radutmp_checksimul, /* checksimul */ NULL, /* pre-proxy */ NULL, /* post-proxy */ NULL /* post-auth */ }, }; freeradius-server/src/modules/rlm_radutmp/rlm_radutmp2.c000066400000000000000000001065771257552170400241040ustar00rootroot00000000000000/* * rlm_radutmp.c * * Version: $Id$ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2000,2001,2002,2003,2004,2006 The FreeRADIUS server project */ #include RCSID("$Id$") #include #include #include #include #include #include #include "config.h" #define LOCK_LEN sizeof(struct radutmp) static const char porttypes[] = "ASITX"; /* * Used for caching radutmp lookups in the accounting * component. The session (checksimul) component doesn't use it, * but probably should, though we're not sure how... * * The intent here is to keep this structure as small as * possible, so that it doesn't take up too much memory. */ typedef struct nas_port { uint32_t nas_address; unsigned int nas_port; off_t offset; struct nas_port *next; /* for the free list */ } NAS_PORT; /* * Per-file information. * * Hmm... having multiple filenames managed by one instance * of the module makes it difficult for the module to do * simultaneous-use checking, without more code edits. */ typedef struct radutmp_cache_t { const char *filename; /* for future reference */ time_t last_used; /* for future reference */ rbtree_t *nas_ports; NAS_PORT *free_offsets; off_t max_offset; int cached_file; int permission; #ifdef HAVE_PTHREAD_H pthread_mutex_t mutex; #endif } radutmp_cache_t; /* * We cache the users, too, so that we only have to read radutmp * once. */ typedef struct radutmp_simul_t { char login[sizeof(((struct radutmp *) NULL)->login) + 1]; int simul_count; } radutmp_simul_t; /* * Data we store per module. */ typedef struct rlm_radutmp_t { char *filename; char *username; int case_sensitive; int check_nas; int permission; int callerid_ok; rbtree_t *user_tree; /* for simultaneous-use */ /* * As the filenames can be dynamically translated, * we want to keep track of them in a separate data * structure, so that we can have per-file caches. */ radutmp_cache_t cache; } rlm_radutmp_t; #ifndef HAVE_PTHREAD_H /* * This is easier than ifdef's throughout the code. */ #define pthread_mutex_init(_x, _y) #define pthread_mutex_destroy(_x) #define pthread_mutex_lock(_x) #define pthread_mutex_unlock(_x) #endif static const CONF_PARSER module_config[] = { { "filename", PW_TYPE_STRING_PTR, offsetof(rlm_radutmp_t,filename), NULL, RADUTMP }, { "username", PW_TYPE_STRING_PTR, offsetof(rlm_radutmp_t,username), NULL, "%{User-Name}"}, { "case_sensitive", PW_TYPE_BOOLEAN, offsetof(rlm_radutmp_t,case_sensitive), NULL, "yes"}, { "check_with_nas", PW_TYPE_BOOLEAN, offsetof(rlm_radutmp_t,check_nas), NULL, "yes"}, { "perm", PW_TYPE_INTEGER, offsetof(rlm_radutmp_t,permission), NULL, "0644" }, { "callerid", PW_TYPE_BOOLEAN, offsetof(rlm_radutmp_t,callerid_ok), NULL, "no" }, { NULL, -1, 0, NULL, NULL } /* end the list */ }; /* * NAS PORT cmp */ static int nas_port_cmp(const void *a, const void *b) { const NAS_PORT *one = a; const NAS_PORT *two = b; if (one->nas_address < two->nas_address) return -1; if (one->nas_address > two->nas_address) return +1; if (one->nas_port < two->nas_port) return -1; if (one->nas_port > two->nas_port) return +1; return 0; } /* * Compare two user names. */ static int user_cmp(const void *a, const void *b) { const radutmp_simul_t *one = a; const radutmp_simul_t *two = b; return strcmp(one->login, two->login); } /* * Compare two user names, case insensitive. */ static int user_case_cmp(const void *a, const void *b) { const radutmp_simul_t *one = a; const radutmp_simul_t *two = b; return strcasecmp(one->login, two->login); } /* * Detach. */ static int radutmp_detach(void *instance) { NAS_PORT *this, *next; rlm_radutmp_t *inst = instance; rbtree_free(inst->cache.nas_ports); for (this = inst->cache.free_offsets; this != NULL; this = next) { next = this->next; free(this); } if (inst->cache.filename) free(inst->cache.filename); pthread_mutex_destroy(&(inst->cache.mutex)); rbtree_free(inst->user_tree); free(inst); return 0; } /* * Instantiate. */ static int radutmp_instantiate(CONF_SECTION *conf, void **instance) { rlm_radutmp_t *inst; inst = rad_malloc(sizeof(*inst)); if (!inst) { return -1; } memset(inst, 0, sizeof(*inst)); if (cf_section_parse(conf, inst, module_config)) { radutmp_detach(inst); return -1; } inst->cache.nas_ports = rbtree_create(nas_port_cmp, free, 0); if (!inst->cache.nas_ports) { radlog(L_ERR, "rlm_radutmp: Failed to create nas tree"); radutmp_detach(inst); return -1; } pthread_mutex_init(&(inst->cache.mutex), NULL); inst->cache.permission = inst->permission; if (inst->case_sensitive) { inst->user_tree = rbtree_create(user_cmp, free, 0); } else { inst->user_tree = rbtree_create(user_case_cmp, free, 0); } if (!inst->user_tree) { radlog(L_ERR, "rlm_radutmp: Failed to create user tree"); radutmp_detach(inst); return -1; } *instance = inst; return 0; } /* * Reset the cached entries. */ static int cache_reset(rlm_radutmp_t *inst, radutmp_cache_t *cache) { NAS_PORT *this, *next; /* * Cache is already reset, do nothing. */ if ((rbtree_num_elements(cache->nas_ports) == 0) && (cache->free_offsets == NULL)) { DEBUG2(" rlm_radutmp: Not resetting the cache"); return 1; } DEBUG2(" rlm_radutmp: Resetting the cache"); pthread_mutex_lock(&cache->mutex); rbtree_free(inst->user_tree); rbtree_free(cache->nas_ports); for (this = cache->free_offsets; this != NULL; this = next) { next = this->next; free(this); } cache->free_offsets = NULL; /* * Re-create the caches. */ cache->nas_ports = rbtree_create(nas_port_cmp, free, 0); if (!cache->nas_ports) { pthread_mutex_unlock(&cache->mutex); radlog(L_ERR, "rlm_radutmp: No memory"); return 0; } cache->max_offset = 0; cache->cached_file = 1; if (inst->case_sensitive) { inst->user_tree = rbtree_create(user_cmp, free, 0); } else { inst->user_tree = rbtree_create(user_case_cmp, free, 0); } if (!inst->user_tree) { pthread_mutex_unlock(&cache->mutex); radlog(L_ERR, "rlm_radutmp: No memory"); return 0; } pthread_mutex_unlock(&cache->mutex); return 1; } /* * Compare two offsets in a tree. */ static int offset_cmp(const void *a, const void *b) { const NAS_PORT *one = a; const NAS_PORT *two = b; if (one->offset < two->offset) return -1; if (one->offset > two->offset) return +1; return 0; } /* * Data structure to use when walking the trees, for zap. */ typedef struct offset_walk_t { rlm_radutmp_t *inst; radutmp_cache_t *cache; rbtree_t *offset_tree; uint32_t nas_address; int fd; time_t now; } offset_walk_t; /* * Walk over the cache, finding entries with the matching NAS IP address. */ static int nas_port_walk(void *context, void *data) { offset_walk_t *walk = context; NAS_PORT *nas_port = data; /* * Doesn't match, keep going. */ if (walk->nas_address != nas_port->nas_address) return 0; /* * Insert it into the offset tree, for later deletion. */ if (rbtree_insert(walk->offset_tree, nas_port) != 1) { DEBUG2(" rlm_radumtp: Insertion failed in nas port walk."); return 1; } return 0; } /* * Walk through the offset tree, operating on the cache */ static int offset_walk(void *context, void *data) { offset_walk_t *walk = context; NAS_PORT *nas_port = data; struct radutmp utmp; radutmp_simul_t *user, myUser; /* * Seek to the entry, and possibly re-write it. */ if (lseek(walk->fd, nas_port->offset, SEEK_SET) < 0) { rad_assert(0 == 1); } if (read(walk->fd, &utmp, sizeof(utmp)) != sizeof(utmp)) { rad_assert(0 == 1); } /* * If the entry in the file is NEWER than the reboot * packet, don't re-write it, and don't delete it. */ if (utmp.time > walk->now) { return 0; } utmp.type = P_IDLE; utmp.time = walk->now; if (lseek(walk->fd, -(off_t)sizeof(utmp), SEEK_CUR) < 0) { radlog(L_ERR, "rlm_radutmp: offset_walk: failed in lseek: %s", strerror(errno)); return 1; } write(walk->fd, &utmp, sizeof(utmp)); strlcpy(myUser.login, utmp.login, sizeof(myUser.login)); user = rbtree_finddata(walk->inst->user_tree, &myUser); rad_assert(user != NULL); rad_assert(user->simul_count > 0); user->simul_count--; if (user->simul_count == 0) { rbtree_deletebydata(walk->inst->user_tree, user); } if (rbtree_deletebydata(walk->cache->nas_ports, nas_port) == 0) { radlog(L_ERR, "rlm_radutmp: Failed to delete entry from cache"); return 1; } /* * Insert the entry into the free list. */ nas_port->next = walk->cache->free_offsets; walk->cache->free_offsets = nas_port; return 0; } /* * Zap all users on a NAS from the radutmp file. */ static int radutmp_zap(rlm_radutmp_t *inst, radutmp_cache_t *cache, uint32_t nas_address, time_t now) { int rcode; rbtree_t *offset_tree; offset_walk_t walk; rad_assert(now != 0); /* * If there's nothing in the file, do nothing, * but truncate the file, just to be safe. */ if (rbtree_num_elements(cache->nas_ports) == 0) { truncate(cache->filename, (off_t) 0); DEBUG2(" rlm_radutmp: No entries in file. Quenching zap."); return 1; } /* * Create the offset tree, as we want to delete utmp * entries starting from the start of the file, and we * can't delete nodes from an rbtree while we're walking * it. */ offset_tree = rbtree_create(offset_cmp, NULL, 0); if (!offset_tree) { radlog(L_ERR, "rlm_radutmp: Out of memory"); return 0; } pthread_mutex_lock(&cache->mutex); /* * Walk through the cache, finding entries for this NAS, * and add those entries to the offset tree. */ memset(&walk, 0, sizeof(walk)); walk.inst = inst; walk.offset_tree = offset_tree; walk.nas_address = nas_address; rcode = rbtree_walk(cache->nas_ports, PreOrder, nas_port_walk, &walk); if (rcode != 0) { pthread_mutex_unlock(&cache->mutex); rbtree_free(offset_tree); radlog(L_ERR, "rlm_radutmp: Failed walking the cache."); return 0; } /* * If both trees have the same number of elements, then * don't do anything special, as UDP packets may be * received out of order, by several seconds. The * "offset_walk" routine MAY NOT delete the entries, if * it sees that the entries in the file are newer than * the reboot packet. */ /* * If there's nothing to do, don't do anything. */ if (rbtree_num_elements(offset_tree) == 0) { DEBUG2(" rlm_radutmp: NAS IP %08x has no users recorded in file %s.", htonl(nas_address), cache->filename); pthread_mutex_unlock(&cache->mutex); rbtree_free(offset_tree); return 1; } /* * Open the file, to re-write only a few of the entries. */ walk.fd = open(cache->filename, O_RDWR); if (walk.fd < 0) { pthread_mutex_unlock(&cache->mutex); rbtree_free(offset_tree); radlog(L_ERR, "rlm_radutmp: Error accessing file %s: %s", cache->filename, strerror(errno)); return 0; } /* * Lock the utmp file, prefer lockf() over flock(). * * FIXME: maybe we want to lock per-record? */ rad_lockfd(walk.fd, LOCK_LEN); /* * Walk through the offset tree, from start to finish, * deleting entries from the NAS tree, adding them to * the "free offset" cache, and lseek'ing to that offset * in the file, and clearing out the data. */ walk.cache = cache; walk.now = now; rcode = rbtree_walk(offset_tree, InOrder, offset_walk, &walk); rbtree_free(offset_tree); if (rcode != 0) { radlog(L_ERR, "rlm_radutmp: Failed walking the offsets."); return 0; } close(walk.fd); /* and implicitly release the locks */ /* * Just to clean up the file. If it's empty, * nuke everything. */ if (rbtree_num_elements(cache->nas_ports) == 0) { NAS_PORT *this, *next; /* too many copies of code */ for (this = inst->cache.free_offsets; this != NULL; this = next) { next = this->next; free(this); } truncate(cache->filename, 0); rad_assert(rbtree_num_elements(inst->user_tree) == 0); } pthread_mutex_unlock(&cache->mutex); return 1; } /* * Read a file, to cache all of its entries. */ static int cache_file(rlm_radutmp_t *inst, radutmp_cache_t *cache) { int fd; int read_size; struct stat buf; struct radutmp utmp; NAS_PORT **tail; rad_assert(cache->max_offset == 0); rad_assert(cache->free_offsets == NULL); /* * Doesn't exist, we're fine. */ if (stat(cache->filename, &buf) < 0) { if (errno == ENOENT) { cache->cached_file = 1; return 0; } radlog(L_ERR, "rlm_radutmp: Cannot stat %s: %s", cache->filename, strerror(errno)); return 1; } /* * Nothing's there, we're OK. */ if (buf.st_size == 0) { cache->cached_file = 1; return 0; } /* * Don't let others much around with our data. */ pthread_mutex_lock(&cache->mutex); /* * Read the file and cache it's entries. */ fd = open(cache->filename, O_RDONLY, cache->permission); if (fd < 0) { pthread_mutex_unlock(&cache->mutex); radlog(L_ERR, "rlm_radutmp: Error opening %s: %s", cache->filename, strerror(errno)); return 1; } /* * Insert free entries into the tail, so that entries * get used from the start. */ tail = &(cache->free_offsets); /* * Don't lock the file, as we're only reading it. */ do { read_size = read(fd, &utmp, sizeof(utmp)); /* * Read one record. */ if (read_size == sizeof(utmp)) { radutmp_simul_t *user, myUser; NAS_PORT *nas_port = rad_malloc(sizeof(*nas_port)); memset(nas_port, 0, sizeof(nas_port)); nas_port->offset = cache->max_offset; cache->max_offset += sizeof(utmp); /* * Idle. Add it to the list of free * offsets. */ if (utmp.type == P_IDLE) { *tail = nas_port; tail = &(nas_port->next); continue; } /* * It's a login record, */ nas_port->nas_address = utmp.nas_address; nas_port->nas_port = utmp.nas_port; if (!rbtree_insert(cache->nas_ports, nas_port)) { rad_assert(0 == 1); } /* * Adds a trailing \0, so myUser.login has * an extra char allocated.. */ strlcpy(myUser.login, utmp.login, sizeof(myUser.login)); user = rbtree_finddata(inst->user_tree, &myUser); if (user) { user->simul_count++; } else { /* * Allocate new entry, and add it * to the tree. */ user = rad_malloc(sizeof(user)); strlcpy(user->login, utmp.login, sizeof(user->login)); user->simul_count = 1; if (!rbtree_insert(inst->user_tree, user)) { rad_assert(0 == 1); } } continue; } /* * We've read a partial record. WTF? */ if (read_size != 0) { pthread_mutex_unlock(&cache->mutex); close(fd); radlog(L_ERR, "rlm_radutmp: Badly formed file %s", cache->filename); return 1; } /* * Read nothing, stop. */ } while (read_size != 0); pthread_mutex_unlock(&cache->mutex); close(fd); /* and release the lock. */ cache->cached_file = 1; return 0; } /* * Store logins in the RADIUS utmp file. */ static int radutmp_accounting(void *instance, REQUEST *request) { rlm_radutmp_t *inst = instance; struct radutmp utmp, u; VALUE_PAIR *vp; int status = -1; uint32_t nas_address = 0; uint32_t framed_address = 0; int protocol = -1; int fd; int port_seen = 0; char buffer[256]; char filename[1024]; char ip_name[32]; /* 255.255.255.255 */ const char *nas; NAS_PORT *nas_port, myPort; radutmp_cache_t *cache; int read_size; rbnode_t *node; /* * Which type is this. */ if ((vp = pairfind(request->packet->vps, PW_ACCT_STATUS_TYPE)) == NULL) { radlog(L_ERR, "rlm_radutmp: No Accounting-Status-Type record."); return RLM_MODULE_NOOP; } status = vp->vp_integer; /* * Look for weird reboot packets. * * ComOS (up to and including 3.5.1b20) does not send * standard PW_STATUS_ACCOUNTING_* messages. * * Check for: o no Acct-Session-Time, or time of 0 * o Acct-Session-Id of "00000000". * * We could also check for NAS-Port, that attribute * should NOT be present (but we don't right now). */ if ((status != PW_STATUS_ACCOUNTING_ON) && (status != PW_STATUS_ACCOUNTING_OFF)) do { int check1 = 0; int check2 = 0; if ((vp = pairfind(request->packet->vps, PW_ACCT_SESSION_TIME)) == NULL || vp->vp_date == 0) check1 = 1; if ((vp = pairfind(request->packet->vps, PW_ACCT_SESSION_ID)) != NULL && vp->length == 8 && memcmp(vp->vp_strvalue, "00000000", 8) == 0) check2 = 1; if (check1 == 0 || check2 == 0) { #if 0 /* Cisco sometimes sends START records without username. */ radlog(L_ERR, "rlm_radutmp: no username in record"); return RLM_MODULE_FAIL; #else break; #endif } radlog(L_INFO, "rlm_radutmp: converting reboot records."); if (status == PW_STATUS_STOP) status = PW_STATUS_ACCOUNTING_OFF; if (status == PW_STATUS_START) status = PW_STATUS_ACCOUNTING_ON; } while(0); memset(&utmp, 0, sizeof(utmp)); utmp.porttype = 'A'; /* * First, find the interesting attributes. */ for (vp = request->packet->vps; vp; vp = vp->next) { switch (vp->attribute) { case PW_LOGIN_IP_HOST: case PW_FRAMED_IP_ADDRESS: framed_address = vp->vp_ipaddr; utmp.framed_address = vp->vp_ipaddr; break; case PW_FRAMED_PROTOCOL: protocol = vp->vp_integer; break; case PW_NAS_IP_ADDRESS: nas_address = vp->vp_ipaddr; utmp.nas_address = vp->vp_ipaddr; break; case PW_NAS_PORT: utmp.nas_port = vp->vp_integer; port_seen = 1; break; case PW_ACCT_DELAY_TIME: utmp.delay = vp->vp_integer; break; case PW_ACCT_SESSION_ID: /* * If it's too big, only use the * last bit. */ if (vp->length > sizeof(utmp.session_id)) { int length = vp->length - sizeof(utmp.session_id); /* * Ascend is br0ken - it * adds a \0 to the end * of any string. * Compensate. */ if (vp->vp_strvalue[vp->length - 1] == 0) { length--; } memcpy(utmp.session_id, vp->vp_strvalue + length, sizeof(utmp.session_id)); } else { memset(utmp.session_id, 0, sizeof(utmp.session_id)); memcpy(utmp.session_id, vp->vp_strvalue, vp->length); } break; case PW_NAS_PORT_TYPE: if (vp->vp_integer <= 4) utmp.porttype = porttypes[vp->vp_integer]; break; case PW_CALLING_STATION_ID: if(inst->callerid_ok) strlcpy(utmp.caller_id, (char *)vp->vp_strvalue, sizeof(utmp.caller_id)); break; } } /* * If we didn't find out the NAS address, use the * originator's IP address. */ if (nas_address == 0) { nas_address = request->packet->src_ipaddr; utmp.nas_address = nas_address; nas = request->client->shortname; } else if (request->packet->src_ipaddr.ipaddr.ip4addr.s_addr == nas_address) { /* might be a client, might not be. */ nas = request->client->shortname; } else { /* * The NAS isn't a client, it's behind * a proxy server. In that case, just * get the IP address. */ nas = ip_ntoa(ip_name, nas_address); } /* * Set the protocol field. */ if (protocol == PW_PPP) utmp.proto = 'P'; else if (protocol == PW_SLIP) utmp.proto = 'S'; else utmp.proto = 'T'; utmp.time = request->timestamp - utmp.delay; /* * Get the utmp filename, via xlat. */ radius_xlat(filename, sizeof(filename), inst->filename, request, NULL); /* * Future: look up filename in filename tree, to get * radutmp_cache_t pointer */ cache = &inst->cache; /* * For now, double-check the filename, to be sure it isn't * changing. */ if (!cache->filename) { cache->filename = strdup(filename); rad_assert(cache->filename != NULL); } else if (strcmp(cache->filename, filename) != 0) { radlog(L_ERR, "rlm_radutmp: We do not support dynamically named files."); return RLM_MODULE_FAIL; } /* * If the lookup failed, create a new one, and add it * to the filename tree, and cache the file, as below. */ /* * For aging, in the future. */ cache->last_used = request->timestamp; /* * If we haven't already read the file, then read the * entire file, in order to cache its entries. */ if (!cache->cached_file) { cache_file(inst, cache); } /* * See if this was a reboot. * * Hmm... we may not want to zap all of the users when * the NAS comes up, because of issues with receiving * UDP packets out of order. */ if (status == PW_STATUS_ACCOUNTING_ON && nas_address) { radlog(L_INFO, "rlm_radutmp: NAS %s restarted (Accounting-On packet seen)", nas); if (!radutmp_zap(inst, cache, nas_address, utmp.time)) { rad_assert(0 == 1); } return RLM_MODULE_OK; } if (status == PW_STATUS_ACCOUNTING_OFF && nas_address) { radlog(L_INFO, "rlm_radutmp: NAS %s rebooted (Accounting-Off packet seen)", nas); if (!radutmp_zap(inst, cache, nas_address, utmp.time)) { rad_assert(0 == 1); } return RLM_MODULE_OK; } /* * If we don't know this type of entry, then pretend we * succeeded. */ if (status != PW_STATUS_START && status != PW_STATUS_STOP && status != PW_STATUS_ALIVE) { radlog(L_ERR, "rlm_radutmp: NAS %s port %u unknown packet type %d, ignoring it.", nas, utmp.nas_port, status); return RLM_MODULE_NOOP; } /* * Perhaps we don't want to store this record into * radutmp. We skip records: * * - without a NAS-Port (telnet / tcp access) * - with the username "!root" (console admin login) */ if (!port_seen) { DEBUG2(" rlm_radutmp: No NAS-Port in the packet. Cannot do anything."); DEBUG2(" rlm_radumtp: WARNING: checkrad will probably not work!"); return RLM_MODULE_NOOP; } /* * Translate the User-Name attribute, or whatever else * they told us to use. */ *buffer = '\0'; radius_xlat(buffer, sizeof(buffer), inst->username, request, NULL); /* * Don't log certain things... */ if (strcmp(buffer, "!root") == 0) { DEBUG2(" rlm_radutmp: Not recording administrative user"); return RLM_MODULE_NOOP; } strlcpy(utmp.login, buffer, RUT_NAMESIZE); /* * First, try to open the file. If it doesn't exist, * nuke the existing caches, and try to create it. * * FIXME: Create any intermediate directories, as * appropriate. See rlm_detail. */ fd = open(cache->filename, O_RDWR, inst->permission); if (fd < 0) { if (errno == ENOENT) { DEBUG2(" rlm_radutmp: File %s doesn't exist, creating it.", cache->filename); if (!cache_reset(inst, cache)) return RLM_MODULE_FAIL; /* * Try to create the file. */ fd = open(cache->filename, O_RDWR | O_CREAT, inst->permission); } } else { /* exists, but may be empty */ struct stat buf; /* * If the file is empty, reset the cache. */ if ((stat(cache->filename, &buf) == 0) && (buf.st_size == 0) && (!cache_reset(inst, cache))) { return RLM_MODULE_FAIL; } DEBUG2(" rlm_radutmp: File %s was truncated. Resetting cache.", cache->filename); } /* * Error from creation, or error other than ENOENT: die. */ if (fd < 0) { radlog(L_ERR, "rlm_radutmp: Error accessing file %s: %s", cache->filename, strerror(errno)); return RLM_MODULE_FAIL; } /* * OK. Now that we've prepared everything we want to do, * let's see if we've cached the entry. */ myPort.nas_address = utmp.nas_address; myPort.nas_port = utmp.nas_port; pthread_mutex_lock(&cache->mutex); node = rbtree_find(cache->nas_ports, &myPort); pthread_mutex_unlock(&cache->mutex); if (node) { nas_port = rbtree_node2data(cache->nas_ports, node); #if 0 /* * stat the file, and get excited if it's been * truncated. * * i.e wipe out the cache, and re-read the file. */ /* * Now find the new entry. */ pthread_mutex_lock(&cache->mutex); node = rbtree_find(cache->nas_ports, &myPort); pthread_mutex_unlock(&cache->mutex); #endif } if (!node) { radutmp_simul_t *user; /* * Not found in the cache, and we're trying to * delete an existing record: ignore it. */ if (status == PW_STATUS_STOP) { DEBUG2(" rlm_radumtp: Logout entry for NAS %s port %u with no Login: ignoring it.", nas, utmp.nas_port); return RLM_MODULE_NOOP; } pthread_mutex_lock(&cache->mutex); /* * It's a START or ALIVE. Try to find a free * offset where we can store the new entry, or * create one, if one doesn't already exist. */ if (!cache->free_offsets) { cache->free_offsets = rad_malloc(sizeof(NAS_PORT)); memset(cache->free_offsets, 0, sizeof(*(cache->free_offsets))); cache->free_offsets->offset = cache->max_offset; cache->max_offset += sizeof(u); } /* * Grab the offset, and put it into the various * caches. */ nas_port = cache->free_offsets; cache->free_offsets = nas_port->next; nas_port->nas_address = nas_address; nas_port->nas_port = utmp.nas_port; if (!rbtree_insert(cache->nas_ports, nas_port)) { rad_assert(0 == 1); } /* * Allocate new entry, and add it * to the tree. */ user = rad_malloc(sizeof(user)); strlcpy(user->login, utmp.login, sizeof(user->login)); user->simul_count = 1; if (!rbtree_insert(inst->user_tree, user)) { rad_assert(0 == 1); } pthread_mutex_unlock(&cache->mutex); } /* * Entry was found, or newly created in the cache. * Seek to the place in the file. */ lseek(fd, nas_port->offset, SEEK_SET); /* * Lock the utmp file, prefer lockf() over flock(). */ rad_lockfd(fd, LOCK_LEN); /* * If it WAS found in the cache, double-check it against * what is in the file. */ if (node) { /* * If we didn't read anything, then this entry * doesn't exist. * * Similarly, if the entry in the file doesn't * match what we recall, then nuke the cache * entry. */ read_size = read(fd, &u, sizeof(u)); if ((read_size < 0) || ((read_size > 0) && (read_size != sizeof(u)))) { /* * Bad read, or bad record. */ radlog(L_ERR, "rlm_radutmp: Badly formed file %s", cache->filename); close(fd); return RLM_MODULE_FAIL; } rad_assert(read_size != 0); /* * We've read a record, go poke at it. */ if (read_size > 0) { /* * If these aren't true, then * * a) we have cached a "logout" entry, * which we don't do. * * b) we have cached the wrong NAS address * * c) we have cached the wrong NAS port. */ rad_assert(u.type == P_LOGIN); rad_assert(u.nas_address == utmp.nas_address); rad_assert(u.nas_port == utmp.nas_port); /* * An update for the same session. */ if (strncmp(utmp.session_id, u.session_id, sizeof(u.session_id)) == 0) { /* * It's a duplicate start, so we * don't bother writing it. */ if (status == PW_STATUS_START) { DEBUG2(" rlm_radutmp: Login entry for NAS %s port %u duplicate, ignoring it.", nas, u.nas_port); close(fd); return RLM_MODULE_OK; /* * ALIVE for this session, keep the * original login time. */ } else if (status == PW_STATUS_ALIVE) { utmp.time = u.time; /* * Stop: delete it from our cache. */ } else if (status == PW_STATUS_STOP) { radutmp_simul_t *user, myUser; pthread_mutex_lock(&cache->mutex); rbtree_deletebydata(cache->nas_ports, nas_port); strlcpy(myUser.login, u.login, sizeof(myUser.login)); user = rbtree_finddata(inst->user_tree, &myUser); rad_assert(user != NULL); rad_assert(user->simul_count > 0); user->simul_count--; if (user->simul_count == 0) { rbtree_deletebydata(inst->user_tree, user); } pthread_mutex_unlock(&cache->mutex); } else { /* * We don't know how to * handle this. */ rad_assert(0 == 1); } } else { /* session ID doesn't match */ /* * STOP for the right NAS & port, * but the Acct-Session-Id is * different. This means that * we missed the original "stop", * and a new "start". */ if (status == PW_STATUS_STOP) { radlog(L_ERR, "rlm_radutmp: Logout entry for NAS %s port %u has old Acct-Session-ID, ignoring it.", nas, u.nas_port); close(fd); return RLM_MODULE_OK; } } /* checked session ID's */ } /* else we haven't read anything from the file. */ } /* else the entry wasn't cached, but could have been inserted */ /* * Hmm... we may have received a start or alive packet * AFTER a stop or nas-down, in that case, we want to * discard the new packet. However, the original code * could over-write an idle record with a new login * record for another NAS && port, so we won't worry * about this case too much. */ /* * Seek to where the entry is, and write it blindly. */ lseek(fd, nas_port->offset, SEEK_SET); /* FIXME: err */ if (status != PW_STATUS_STOP) { utmp.type = P_LOGIN; rad_assert(nas_port != NULL); /* it WAS cached */ } else { /* FIXME: maybe assert that the entry was deleted... */ memcpy(&utmp, &u, sizeof(utmp)); utmp.type = P_IDLE; } write(fd, &utmp, sizeof(utmp)); /* FIXME: err */ close(fd); /* and implicitly release the locks */ return RLM_MODULE_OK; } /* * See if a user is already logged in. Sets request->simul_count * to the current session count for this user and sets * request->simul_mpp to 2 if it looks like a multilink attempt * based on the requested IP address, otherwise leaves * request->simul_mpp alone. * * Check twice. If on the first pass the user exceeds his * max. number of logins, do a second pass and validate all * logins by querying the terminal server (using eg. SNMP). */ static int radutmp_checksimul(void *instance, REQUEST *request) { struct radutmp u; int fd; VALUE_PAIR *vp; uint32_t ipno = 0; char *call_num = NULL; int rcode; rlm_radutmp_t *inst = instance; char login[256]; char filename[1024]; radutmp_cache_t *cache; radutmp_simul_t *user, myUser; /* * Get the filename, via xlat. */ radius_xlat(filename, sizeof(filename), inst->filename, request, NULL); /* * Future: look up filename in filename tree, to get * radutmp_cache_t pointer */ cache = &inst->cache; /* * For now, double-check the filename, to be sure it isn't * changing. */ if (!cache->filename) { cache->filename = strdup(filename); rad_assert(cache->filename != NULL); } else if (strcmp(cache->filename, filename) != 0) { radlog(L_ERR, "rlm_radutmp: We do not support dynamically named files."); return RLM_MODULE_FAIL; } *login = '\0'; radius_xlat(login, sizeof(login), inst->username, request, NULL); if (!*login) { return RLM_MODULE_NOOP; } /* * WTF? This is probably wrong... we probably want to * be able to check users across multiple session accounting * methods. */ request->simul_count = 0; strlcpy(myUser.login, login, sizeof(myUser.login)); pthread_mutex_lock(&inst->cache.mutex); user = rbtree_finddata(inst->user_tree, &myUser); if (user) request->simul_count = user->simul_count; user = NULL; /* someone else may delete it */ pthread_mutex_unlock(&inst->cache.mutex); /* * The number of users logged in is OK, * OR, we've been told to not check the NAS. */ if ((request->simul_count < request->simul_max) || !inst->check_nas) { return RLM_MODULE_OK; } /* * The user is logged in at least N times, and * we're told to check the NAS. In that case, * we've got to read the file, and check each * NAS port by hand. */ if ((fd = open(cache->filename, O_RDWR)) < 0) { /* * If the file doesn't exist, then no users * are logged in. */ if (errno == ENOENT) { request->simul_count = 0; return RLM_MODULE_OK; } /* * Error accessing the file. */ radlog(L_ERR, "rlm_radumtp: Error accessing file %s: %s", cache->filename, strerror(errno)); return RLM_MODULE_FAIL; } /* * Setup some stuff, like for MPP detection. */ if ((vp = pairfind(request->packet->vps, PW_FRAMED_IP_ADDRESS)) != NULL) ipno = vp->vp_ipaddr; if ((vp = pairfind(request->packet->vps, PW_CALLING_STATION_ID)) != NULL) call_num = vp->vp_strvalue; /* * lock the file while reading/writing. */ rad_lockfd(fd, LOCK_LEN); /* * FIXME: If we get a 'Start' for a user/nas/port which is * listed, but for which we did NOT get a 'Stop', then * it's not a duplicate session. This happens with * static IP's like DSL. */ request->simul_count = 0; while (read(fd, &u, sizeof(u)) == sizeof(u)) { if (((strncmp(login, u.login, RUT_NAMESIZE) == 0) || (!inst->case_sensitive && (strncasecmp(login, u.login, RUT_NAMESIZE) == 0))) && (u.type == P_LOGIN)) { char session_id[sizeof(u.session_id) + 1]; char utmp_login[sizeof(u.login) + 1]; strlcpy(session_id, u.session_id, sizeof(session_id)); /* * The login name MAY fill the whole field, * and thus won't be zero-filled. * * Note that we take the user name from * the utmp file, as that's the canonical * form. The 'login' variable may contain * a string which is an upper/lowercase * version of u.login. When we call the * routine to check the terminal server, * the NAS may be case sensitive. * * e.g. We ask if "bob" is using a port, * and the NAS says "no", because "BOB" * is using the port. */ strlcpy(utmp_login, u.login, sizeof(u.login)); /* * rad_check_ts may take seconds * to return, and we don't want * to block everyone else while * that's happening. */ rad_unlockfd(fd, LOCK_LEN); rcode = rad_check_ts(u.nas_address, u.nas_port, utmp_login, session_id); rad_lockfd(fd, LOCK_LEN); if (rcode == 0) { /* * Stale record - zap it. * * Hmm... this ends up calling * the accounting section * recursively... */ session_zap(request, u.nas_address, u.nas_port, login, session_id, u.framed_address, u.proto,0); } else if (rcode == 1) { /* * User is still logged in. */ ++request->simul_count; /* * Does it look like a MPP attempt? */ if (strchr("SCPA", u.proto) && ipno && u.framed_address == ipno) request->simul_mpp = 2; else if (strchr("SCPA", u.proto) && call_num && !strncmp(u.caller_id,call_num,16)) request->simul_mpp = 2; } else { /* * Failed to check the terminal * server for duplicate logins: * Return an error. */ close(fd); radlog(L_ERR, "rlm_radutmp: Failed to check the terminal server for user '%s'.", utmp_login); return RLM_MODULE_FAIL; } } } close(fd); /* and implicitly release the locks */ return RLM_MODULE_OK; } /* globally exported name */ module_t rlm_radutmp = { "radutmp", 0, /* type: reserved */ NULL, /* initialization */ radutmp_instantiate, /* instantiation */ { NULL, /* authentication */ NULL, /* authorization */ NULL, /* preaccounting */ radutmp_accounting, /* accounting */ radutmp_checksimul, /* checksimul */ NULL, /* pre-proxy */ NULL, /* post-proxy */ NULL /* post-auth */ }, radutmp_detach, /* detach */ NULL, /* destroy */ }; freeradius-server/src/modules/rlm_realm/000077500000000000000000000000001257552170400207345ustar00rootroot00000000000000freeradius-server/src/modules/rlm_realm/Makefile000066400000000000000000000001401257552170400223670ustar00rootroot00000000000000# # Makefile # # Version: $Id$ # TARGET = rlm_realm SRCS = rlm_realm.c include ../rules.mak freeradius-server/src/modules/rlm_realm/rlm_realm.c000066400000000000000000000302721257552170400230560ustar00rootroot00000000000000/* * rlm_realm.c * * Version: $Id$ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2000,2006 The FreeRADIUS server project * FIXME add copyrights */ #include RCSID("$Id$") #include #include #define REALM_FORMAT_PREFIX 0 #define REALM_FORMAT_SUFFIX 1 typedef struct realm_config_t { int format; char *formatstring; char *delim; int ignore_default; int ignore_null; } realm_config_t; static CONF_PARSER module_config[] = { { "format", PW_TYPE_STRING_PTR, offsetof(realm_config_t,formatstring), NULL, "suffix" }, { "delimiter", PW_TYPE_STRING_PTR, offsetof(realm_config_t,delim), NULL, "@" }, { "ignore_default", PW_TYPE_BOOLEAN, offsetof(realm_config_t,ignore_default), NULL, "no" }, { "ignore_null", PW_TYPE_BOOLEAN, offsetof(realm_config_t,ignore_null), NULL, "no" }, { NULL, -1, 0, NULL, NULL } /* end the list */ }; /* * Internal function to cut down on duplicated code. * * Returns -1 on failure, 0 on no failure. returnrealm * is NULL on don't proxy, realm otherwise. */ static int check_for_realm(void *instance, REQUEST *request, REALM **returnrealm) { char namebuf[MAX_STRING_LEN]; char *username; char *realmname = NULL; char *ptr; VALUE_PAIR *vp; REALM *realm; struct realm_config_t *inst = instance; /* initiate returnrealm */ *returnrealm = NULL; /* * If the request has a proxy entry, then it's a proxy * reply, and we're walking through the module list again. * * In that case, don't bother trying to proxy the request * again. * * Also, if there's no User-Name attribute, we can't * proxy it, either. */ if ((request->proxy != NULL) || (request->username == NULL)) { RDEBUG2("Proxy reply, or no User-Name. Ignoring."); return RLM_MODULE_OK; } /* * Check for 'Realm' attribute. If it exists, then we've proxied * it already ( via another rlm_realm instance ) and should return. */ if (pairfind(request->packet->vps, PW_REALM) != NULL ) { RDEBUG2("Request already proxied. Ignoring."); return RLM_MODULE_OK; } /* * We will be modifing this later, so we want our own copy * of it. */ strlcpy(namebuf, (char *)request->username->vp_strvalue, sizeof(namebuf)); username = namebuf; switch(inst->format) { case REALM_FORMAT_SUFFIX: /* DEBUG2(" rlm_realm: Checking for suffix after \"%c\"", inst->delim[0]); */ realmname = strrchr(username, inst->delim[0]); if (realmname) { *realmname = '\0'; realmname++; } break; case REALM_FORMAT_PREFIX: /* DEBUG2(" rlm_realm: Checking for prefix before \"%c\"", inst->delim[0]); */ ptr = strchr(username, inst->delim[0]); if (ptr) { *ptr = '\0'; ptr++; realmname = username; username = ptr; } break; default: realmname = NULL; break; } /* * Print out excruciatingly descriptive debugging messages * for the people who find it too difficult to think about * what's going on. */ if (realmname) { RDEBUG2("Looking up realm \"%s\" for User-Name = \"%s\"", realmname, request->username->vp_strvalue); } else { if( inst->ignore_null ) { RDEBUG2("No '%c' in User-Name = \"%s\", skipping NULL due to config.", inst->delim[0], request->username->vp_strvalue); return RLM_MODULE_NOOP; } RDEBUG2("No '%c' in User-Name = \"%s\", looking up realm NULL", inst->delim[0], request->username->vp_strvalue); } /* * Allow DEFAULT realms unless told not to. */ realm = realm_find(realmname); if (!realm) { RDEBUG2("No such realm \"%s\"", (realmname == NULL) ? "NULL" : realmname); return RLM_MODULE_NOOP; } if( inst->ignore_default && (strcmp(realm->name, "DEFAULT")) == 0) { RDEBUG2("Found DEFAULT, but skipping due to config."); return RLM_MODULE_NOOP; } RDEBUG2("Found realm \"%s\"", realm->name); /* * If we've been told to strip the realm off, then do so. */ if (realm->striprealm) { /* * Create the Stripped-User-Name attribute, if it * doesn't exist. * */ if (request->username->attribute != PW_STRIPPED_USER_NAME) { vp = radius_paircreate(request, &request->packet->vps, PW_STRIPPED_USER_NAME, PW_TYPE_STRING); RDEBUG2("Adding Stripped-User-Name = \"%s\"", username); } else { vp = request->username; RDEBUG2("Setting Stripped-User-Name = \"%s\"", username); } strcpy(vp->vp_strvalue, username); vp->length = strlen((char *)vp->vp_strvalue); request->username = vp; } /* * Add the realm name to the request. * If the realm is a regex, the use the realm as entered * by the user. Otherwise, use the configured realm name, * as realm name comparison is case insensitive. We want * to use the configured name, rather than what the user * entered. */ if (realm->name[0] != '~') realmname = realm->name; pairadd(&request->packet->vps, pairmake("Realm", realmname, T_OP_EQ)); RDEBUG2("Adding Realm = \"%s\"", realmname); /* * Figure out what to do with the request. */ switch (request->packet->code) { default: RDEBUG2("Unknown packet code %d\n", request->packet->code); return RLM_MODULE_OK; /* don't do anything */ /* * Perhaps accounting proxying was turned off. */ case PW_ACCOUNTING_REQUEST: if (!realm->acct_pool) { RDEBUG2("Accounting realm is LOCAL."); return RLM_MODULE_OK; } break; /* * Perhaps authentication proxying was turned off. */ case PW_AUTHENTICATION_REQUEST: if (!realm->auth_pool) { RDEBUG2("Authentication realm is LOCAL."); return RLM_MODULE_OK; } break; } RDEBUG2("Proxying request from user %s to realm %s", username, realm->name); /* * Skip additional checks if it's not an accounting * request. */ if (request->packet->code != PW_ACCOUNTING_REQUEST) { *returnrealm = realm; return RLM_MODULE_UPDATED; } /* * FIXME: Each server should have a unique server key, * and put it in the accounting packet. Every server * should know about the keys, and NOT proxy requests to * a server with key X if the packet already contains key * X. */ /* * If this request has arrived from another freeradius server * that has already proxied the request, we don't need to do * it again. */ vp = pairfind(request->packet->vps, PW_FREERADIUS_PROXIED_TO); if (vp && (request->packet->src_ipaddr.af == AF_INET)) { int i; fr_ipaddr_t my_ipaddr; my_ipaddr.af = AF_INET; my_ipaddr.ipaddr.ip4addr.s_addr = vp->vp_ipaddr; /* * Loop over the home accounting servers for this * realm. If one of them has the same IP as the * FreeRADIUS-Proxied-To attribute, then the * packet has already been sent there. Don't * send it there again. */ for (i = 0; i < realm->acct_pool->num_home_servers; i++) { if (fr_ipaddr_cmp(&realm->acct_pool->servers[i]->ipaddr, &my_ipaddr) == 0) { RDEBUG2("Suppressing proxy due to FreeRADIUS-Proxied-To"); return RLM_MODULE_OK; } } /* * See detail_recv() in src/main/listen.c for the * additional checks. */ } else if ((request->listener->type == RAD_LISTEN_DETAIL) && ((request->packet->src_ipaddr.af == AF_INET6) || (request->packet->src_ipaddr.ipaddr.ip4addr.s_addr != htonl(INADDR_NONE)))) { int i; /* * Loop over the home accounting servers for this * realm. If one of them has the same IP as the * FreeRADIUS-Proxied-To attribute, then the * packet has already been sent there. Don't * send it there again. */ for (i = 0; i < realm->acct_pool->num_home_servers; i++) { if ((fr_ipaddr_cmp(&realm->acct_pool->servers[i]->ipaddr, &request->packet->src_ipaddr) == 0) && (realm->acct_pool->servers[i]->port == request->packet->src_port)) { RDEBUG2("Suppressing proxy because packet was already sent to a server in that realm"); return RLM_MODULE_OK; } } } /* * We got this far, which means we have a realm, set returnrealm */ *returnrealm = realm; return RLM_MODULE_UPDATED; } /* * Add a "Proxy-To-Realm" attribute to the request. */ static void add_proxy_to_realm(VALUE_PAIR **vps, REALM *realm) { VALUE_PAIR *vp; /* * Tell the server to proxy this request to another * realm. */ vp = pairmake("Proxy-To-Realm", realm->name, T_OP_EQ); if (!vp) { radlog(L_ERR|L_CONS, "no memory"); exit(1); } /* * Add it, even if it's already present. */ pairadd(vps, vp); } /* * Perform the realm module instantiation. Configuration info is * stored in *instance for later use. */ static int realm_instantiate(CONF_SECTION *conf, void **instance) { struct realm_config_t *inst; /* setup a storage area for instance data */ inst = rad_malloc(sizeof(*inst)); if (!inst) { return -1; } memset(inst, 0, sizeof(*inst)); if(cf_section_parse(conf, inst, module_config) < 0) { free(inst); return -1; } if(strcasecmp(inst->formatstring, "suffix") == 0) { inst->format = REALM_FORMAT_SUFFIX; } else if(strcasecmp(inst->formatstring, "prefix") == 0) { inst->format = REALM_FORMAT_PREFIX; } else { radlog(L_ERR, "Bad value \"%s\" for realm format value", inst->formatstring); free(inst); return -1; } if(strlen(inst->delim) != 1) { radlog(L_ERR, "Bad value \"%s\" for realm delimiter value", inst->delim); free(inst); return -1; } *instance = inst; return 0; } /* * Examine a request for a username with an realm, and if it * corresponds to something in the realms file, set that realm as * Proxy-To. * * This should very nearly duplicate the old proxy_send() code */ static int realm_authorize(void *instance, REQUEST *request) { int rcode; REALM *realm; /* * Check if we've got to proxy the request. * If not, return without adding a Proxy-To-Realm * attribute. */ rcode = check_for_realm(instance, request, &realm); if (rcode != RLM_MODULE_UPDATED) return rcode; if (!realm) return RLM_MODULE_NOOP; /* * Maybe add a Proxy-To-Realm attribute to the request. */ RDEBUG2("Preparing to proxy authentication request to realm \"%s\"\n", realm->name); add_proxy_to_realm(&request->config_items, realm); return RLM_MODULE_UPDATED; /* try the next module */ } /* * This does the exact same thing as the realm_authorize, it's just called * differently. */ static int realm_preacct(void *instance, REQUEST *request) { int rcode; const char *name = (char *)request->username->vp_strvalue; REALM *realm; if (!name) return RLM_MODULE_OK; /* * Check if we've got to proxy the request. * If not, return without adding a Proxy-To-Realm * attribute. */ rcode = check_for_realm(instance, request, &realm); if (rcode != RLM_MODULE_UPDATED) return rcode; if (!realm) return RLM_MODULE_NOOP; /* * Maybe add a Proxy-To-Realm attribute to the request. */ RDEBUG2("Preparing to proxy accounting request to realm \"%s\"\n", realm->name); add_proxy_to_realm(&request->config_items, realm); return RLM_MODULE_UPDATED; /* try the next module */ } static int realm_detach(void *instance) { free(instance); return 0; } /* globally exported name */ module_t rlm_realm = { RLM_MODULE_INIT, "realm", RLM_TYPE_CHECK_CONFIG_SAFE | RLM_TYPE_HUP_SAFE, /* type */ realm_instantiate, /* instantiation */ realm_detach, /* detach */ { NULL, /* authentication */ realm_authorize, /* authorization */ realm_preacct, /* preaccounting */ NULL, /* accounting */ NULL, /* checksimul */ NULL, /* pre-proxy */ NULL, /* post-proxy */ NULL /* post-auth */ }, }; freeradius-server/src/modules/rlm_redis/000077500000000000000000000000001257552170400207425ustar00rootroot00000000000000freeradius-server/src/modules/rlm_redis/.gitignore000066400000000000000000000000111257552170400227220ustar00rootroot00000000000000Makefile freeradius-server/src/modules/rlm_redis/Makefile.in000066400000000000000000000002701257552170400230060ustar00rootroot00000000000000TARGET = @targetname@ SRCS = rlm_redis.c HEADERS = rlm_redis.h RLM_CFLAGS = @redis_cflags@ RLM_LIBS = @redis_ldflags@ include ../rules.mak $(LT_OBJS): $(HEADERS) freeradius-server/src/modules/rlm_redis/configure000077500000000000000000003456361257552170400226720ustar00rootroot00000000000000#! /bin/sh # From configure.in Revision. # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.69. # # # 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" 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 about your system, $0: including any error possibly output before this $0: message. Then install a modern shell, or manually run $0: the script under such a shell if you do have one." fi exit 1 fi fi fi SHELL=${CONFIG_SHELL-/bin/sh} export SHELL # Unset more variables known to interfere with behavior of common tools. CLICOLOR_FORCE= GREP_OPTIONS= unset CLICOLOR_FORCE GREP_OPTIONS ## --------------------- ## ## M4sh Shell Functions. ## ## --------------------- ## # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # If we had to re-execute with $CONFIG_SHELL, we're ensured to have # already done that, so ensure we don't try to do so again and fall # in an infinite loop. This has already happened in practice. _as_can_reexec=no; export _as_can_reexec # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= # Identity of this package. PACKAGE_NAME= PACKAGE_TARNAME= PACKAGE_VERSION= PACKAGE_STRING= PACKAGE_BUGREPORT= PACKAGE_URL= ac_unique_file="rlm_redis.c" ac_subst_vars='LTLIBOBJS LIBOBJS targetname redis_cflags redis_ldflags OBJEXT EXEEXT ac_ct_CC CPPFLAGS LDFLAGS CFLAGS CC target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking with_redis_include_dir with_redis_lib_dir with_redis_dir ' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *=) ac_optarg= ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) as_fn_error $? "unrecognized option: \`$ac_option' Try \`$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error $? "pwd does not report name of working directory" # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures this package to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking ...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF _ACEOF fi if test -n "$ac_init_help"; then cat <<\_ACEOF Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-redis-include-dir=DIR Directory where the redis includes may be found --with-redis-lib-dir=DIR Directory where the redis libraries may be found --with-redis-dir=DIR Base directory where redis is installed 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 Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to the package provider. _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF configure generated by GNU Autoconf 2.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 cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by $as_me, which was generated by GNU Autoconf 2.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 # 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 fail= SMART_LIBS= SMART_CLFAGS= if test x$with_rlm_redis != xno; then redis_include_dir= # Check whether --with-redis-include-dir was given. if test "${with_redis_include_dir+set}" = set; then : withval=$with_redis_include_dir; case "$withval" in no) as_fn_error $? "Need redis-include-dir" "$LINENO" 5 ;; yes) ;; *) redis_include_dir="$withval" ;; esac fi redis_lib_dir= # Check whether --with-redis-lib-dir was given. if test "${with_redis_lib_dir+set}" = set; then : withval=$with_redis_lib_dir; case "$withval" in no) as_fn_error $? "Need redis-lib-dir" "$LINENO" 5 ;; yes) ;; *) redis_lib_dir="$withval" ;; esac fi # Check whether --with-redis-dir was given. if test "${with_redis_dir+set}" = set; then : withval=$with_redis_dir; case "$withval" in no) as_fn_error $? "Need redis-dir" "$LINENO" 5 ;; yes) ;; *) redis_lib_dir="$withval/lib" redis_include_dir="$withval/include" ;; esac 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 smart_try_dir="${redis_include_dir}" ac_safe=`echo "hiredis/hiredis.h" | sed 'y%./+-%__pm%'` { $as_echo "$as_me:${as_lineno-$LINENO}: checking for hiredis/hiredis.h" >&5 $as_echo_n "checking for hiredis/hiredis.h... " >&6; } old_CFLAGS="$CFLAGS" smart_include= smart_include_dir= if test "x$smart_try_dir" != "x"; then for try in $smart_try_dir; do CFLAGS="$old_CFLAGS -I$try" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { int a = 1; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : smart_include="-I$try" else smart_include= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test "x$smart_include" != "x"; then break; fi done CFLAGS="$old_CFLAGS" fi if test "x$smart_include" = "x"; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { int a = 1; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : smart_include=" " else smart_include= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test "x$smart_include" = "x"; then if test "x$LOCATE" != "x"; then DIRS= file=hiredis/hiredis.h for x in `${LOCATE} $file 2>/dev/null`; do base=`echo $x | sed "s%/${file}%%"` if test "x$x" = "x$base"; then continue; fi dir=`${DIRNAME} $x 2>/dev/null` exclude=`echo ${dir} | ${GREP} /home` if test "x$exclude" != "x"; then continue fi already=`echo \$smart_include_dir ${DIRS} | ${GREP} ${dir}` if test "x$already" = "x"; then DIRS="$DIRS $dir" fi done fi eval "smart_include_dir=\"\$smart_include_dir $DIRS\"" for try in $smart_include_dir /usr/local/include /opt/include; do CFLAGS="$old_CFLAGS -I$try" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { int a = 1; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : smart_include="-I$try" else smart_include= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test "x$smart_include" != "x"; then break; fi done CFLAGS="$old_CFLAGS" fi if test "x$smart_include" != "x"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } eval "ac_cv_header_$ac_safe=yes" CFLAGS="$old_CFLAGS $smart_include" SMART_CFLAGS="$SMART_CFLAGS $smart_include" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_cv_header_hiredis_hiredis_h" != "xyes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: hiredis headers not found. Use --with-redis-include-dir=." >&5 $as_echo "$as_me: WARNING: hiredis headers not found. Use --with-redis-include-dir=." >&2;} fail="$fail hiredis.h" fi smart_try_dir="$redis_lib_dir" sm_lib_safe=`echo "hiredis" | sed 'y%./+-%__p_%'` sm_func_safe=`echo "redisConnect" | sed 'y%./+-%__p_%'` { $as_echo "$as_me:${as_lineno-$LINENO}: checking for redisConnect in -lhiredis" >&5 $as_echo_n "checking for redisConnect in -lhiredis... " >&6; } old_LIBS="$LIBS" smart_lib= smart_lib_dir= if test "x$smart_try_dir" != "x"; then for try in $smart_try_dir; do LIBS="-L$try -lhiredis $old_LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ extern char redisConnect(); int main () { redisConnect() ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : smart_lib="-L$try -lhiredis" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test "x$smart_lib" != "x"; then break; fi done LIBS="$old_LIBS" fi if test "x$smart_lib" = "x"; then LIBS="-lhiredis $old_LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ extern char redisConnect(); int main () { redisConnect() ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : smart_lib="-lhiredis" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS="$old_LIBS" fi if test "x$smart_lib" = "x"; then if test "x$LOCATE" != "x"; then DIRS= file=libhiredis${libltdl_cv_shlibext} for x in `${LOCATE} $file 2>/dev/null`; do base=`echo $x | sed "s%/${file}%%"` if test "x$x" = "x$base"; then continue; fi dir=`${DIRNAME} $x 2>/dev/null` exclude=`echo ${dir} | ${GREP} /home` if test "x$exclude" != "x"; then continue fi already=`echo \$smart_lib_dir ${DIRS} | ${GREP} ${dir}` if test "x$already" = "x"; then DIRS="$DIRS $dir" fi done fi eval "smart_lib_dir=\"\$smart_lib_dir $DIRS\"" if test "x$LOCATE" != "x"; then DIRS= file=libhiredis.a for x in `${LOCATE} $file 2>/dev/null`; do base=`echo $x | sed "s%/${file}%%"` if test "x$x" = "x$base"; then continue; fi dir=`${DIRNAME} $x 2>/dev/null` exclude=`echo ${dir} | ${GREP} /home` if test "x$exclude" != "x"; then continue fi already=`echo \$smart_lib_dir ${DIRS} | ${GREP} ${dir}` if test "x$already" = "x"; then DIRS="$DIRS $dir" fi done fi eval "smart_lib_dir=\"\$smart_lib_dir $DIRS\"" for try in $smart_lib_dir /usr/local/lib /opt/lib; do LIBS="-L$try -lhiredis $old_LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ extern char redisConnect(); int main () { redisConnect() ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : smart_lib="-L$try -lhiredis" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test "x$smart_lib" != "x"; then break; fi done LIBS="$old_LIBS" fi if test "x$smart_lib" != "x"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } eval "ac_cv_lib_${sm_lib_safe}_${sm_func_safe}=yes" LIBS="$smart_lib $old_LIBS" SMART_LIBS="$smart_lib $SMART_LIBS" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_cv_lib_hiredis_redisConnect" != "xyes" then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: hiredis libraries not found. Use --with-redis-lib-dir=." >&5 $as_echo "$as_me: WARNING: hiredis libraries not found. Use --with-redis-lib-dir=." >&2;} fail="$fail libhiredis" fi targetname=rlm_redis else targetname= echo \*\*\* module rlm_redis is disabled. fi if test "x$fail" != x; then if test "x${enable_strict_dependencies}" = xyes; then as_fn_error $? "set --without-rlm_redis to disable it explicitly." "$LINENO" 5 else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: silently not building rlm_redis." >&5 $as_echo "$as_me: WARNING: silently not building rlm_redis." >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: FAILURE: rlm_redis requires:$fail." >&5 $as_echo "$as_me: WARNING: FAILURE: rlm_redis requires:$fail." >&2;}; targetname= fi fi redis_ldflags="$SMART_LIBS" redis_cflags="$SMART_CFLAGS" unset ac_cv_env_LIBS_set unset ac_cv_env_LIBS_value ac_config_files="$ac_config_files 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}' # Transform confdefs.h into DEFS. # Protect against shell expansion while executing Makefile rules. # Protect against Makefile macro expansion. # # If the first sed substitution is executed (which looks for macros that # take arguments), then branch to the quote section. Otherwise, # look for a macro that doesn't take arguments. ac_script=' :mline /\\$/{ N s,\\\n,, b mline } t clear :clear s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g t quote s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g t quote b any :quote s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g s/\[/\\&/g s/\]/\\&/g s/\$/$$/g H :any ${ g s/^\n// s/\n/ /g p } ' DEFS=`sed -n "$ac_script" confdefs.h` ac_libobjs= ac_ltlibobjs= U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## _ASEOF test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by $as_me, 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 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" _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 Configuration files: $config_files Report bugs to the package provider." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ config.status configured by $0, generated by GNU Autoconf 2.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' 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;; --he | --h | --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX $as_echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "Makefile") CONFIG_FILES="$CONFIG_FILES 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 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" eval set X " :F $CONFIG_FILES " 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 # _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 $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 ;; 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 freeradius-server/src/modules/rlm_redis/configure.in000066400000000000000000000056521257552170400232630ustar00rootroot00000000000000AC_PREREQ([2.61]) AC_INIT(rlm_redis.c) AC_REVISION($Revision$) AC_DEFUN(modname,[rlm_redis]) fail= SMART_LIBS= SMART_CLFAGS= if test x$with_[]modname != xno; then dnl ############################################################ dnl # Check for command line options dnl ############################################################ dnl extra argument: --with-redis-include-dir=DIR redis_include_dir= AC_ARG_WITH(redis-include-dir, [AS_HELP_STRING([--with-redis-include-dir=DIR], [Directory where the redis includes may be found])], [case "$withval" in no) AC_MSG_ERROR(Need redis-include-dir) ;; yes) ;; *) redis_include_dir="$withval" ;; esac]) dnl extra argument: --with-redis-lib-dir=DIR redis_lib_dir= AC_ARG_WITH(redis-lib-dir, [AS_HELP_STRING([--with-redis-lib-dir=DIR], [Directory where the redis libraries may be found])], [case "$withval" in no) AC_MSG_ERROR(Need redis-lib-dir) ;; yes) ;; *) redis_lib_dir="$withval" ;; esac]) dnl extra argument: --with-redis-dir=DIR AC_ARG_WITH(redis-dir, [AS_HELP_STRING([--with-redis-dir=DIR], [Base directory where redis is installed])], [case "$withval" in no) AC_MSG_ERROR(Need redis-dir) ;; yes) ;; *) redis_lib_dir="$withval/lib" redis_include_dir="$withval/include" ;; esac]) dnl ############################################################ dnl # Check for programs dnl ############################################################ AC_PROG_CC dnl ############################################################ dnl # Check for header files dnl ############################################################ smart_try_dir="${redis_include_dir}" FR_SMART_CHECK_INCLUDE([hiredis/hiredis.h]) if test "x$ac_cv_header_hiredis_hiredis_h" != "xyes"; then AC_MSG_WARN([hiredis headers not found. Use --with-redis-include-dir=.]) fail="$fail hiredis.h" fi dnl ############################################################ dnl # Check for libraries dnl ############################################################ smart_try_dir="$redis_lib_dir" FR_SMART_CHECK_LIB(hiredis, redisConnect) if test "x$ac_cv_lib_hiredis_redisConnect" != "xyes" then AC_MSG_WARN([hiredis libraries not found. Use --with-redis-lib-dir=.]) fail="$fail libhiredis" fi targetname=modname else targetname= echo \*\*\* module modname is disabled. fi dnl Don't change this section. if test "x$fail" != x; then if test "x${enable_strict_dependencies}" = xyes; then AC_MSG_ERROR([set --without-]modname[ to disable it explicitly.]) else AC_MSG_WARN([silently not building ]modname[.]) AC_MSG_WARN([FAILURE: ]modname[ requires:$fail.]); targetname= fi fi redis_ldflags="$SMART_LIBS" redis_cflags="$SMART_CFLAGS" AC_SUBST(redis_ldflags) AC_SUBST(redis_cflags) AC_SUBST(targetname) AC_OUTPUT(Makefile) freeradius-server/src/modules/rlm_redis/rlm_redis.c000066400000000000000000000365621257552170400231020ustar00rootroot00000000000000/* * rlm_redis.c * * Version: $Id$ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2000,2006 The FreeRADIUS server project * Copyright 2011 TekSavvy Solutions */ #include RCSID("$Id$") #include #include #include "rlm_redis.h" static const CONF_PARSER module_config[] = { { "num_connections", PW_TYPE_INTEGER, offsetof(REDIS_INST, numconnections), NULL, "20"}, { "hostname", PW_TYPE_STRING_PTR, offsetof(REDIS_INST, hostname), NULL, "127.0.0.1"}, { "port", PW_TYPE_INTEGER, offsetof(REDIS_INST, port), NULL, "6379"}, { "database", PW_TYPE_INTEGER, offsetof(REDIS_INST, database), NULL, "0"}, { "password", PW_TYPE_STRING_PTR, offsetof(REDIS_INST, password), NULL, NULL}, {"connect_failure_retry_delay", PW_TYPE_INTEGER, offsetof(REDIS_INST, connect_failure_retry_delay), NULL, "60"}, {"lifetime", PW_TYPE_INTEGER, offsetof(REDIS_INST, lifetime), NULL, "0"}, {"max_queries", PW_TYPE_INTEGER, offsetof(REDIS_INST, max_queries), NULL, "0"}, { NULL, -1, 0, NULL, NULL} /* end the list */ }; static int redis_close_socket(REDIS_INST *inst, REDISSOCK *dissocket) { radlog(L_INFO, "rlm_redis (%s): Closing socket %d", inst->xlat_name, dissocket->id); if (dissocket->state == sockconnected) { redisFree(dissocket->conn); } #ifdef HAVE_PTHREAD_H pthread_mutex_destroy(&dissocket->mutex); #endif free(dissocket); return 1; } static int connect_single_socket(REDIS_INST *inst, REDISSOCK *dissocket) { char buffer[1024]; radlog(L_INFO, "rlm_redis (%s): Attempting to connect #%d", inst->xlat_name, dissocket->id); dissocket->conn = redisConnect(inst->hostname, inst->port); /* * Error, or redis is DOWN. */ if (dissocket->conn->err) { radlog(L_CONS | L_ERR, "rlm_redis (%s): Failed to connect DB handle #%d", inst->xlat_name, dissocket->id); inst->connect_after = time(NULL) + inst->connect_failure_retry_delay; dissocket->state = sockunconnected; return -1; } if (inst->password) { snprintf(buffer, sizeof(buffer), "AUTH %s", inst->password); dissocket->reply = redisCommand(dissocket->conn, buffer); if (!dissocket->reply) { radlog(L_ERR, "rlm_redis (%s): Failed to run AUTH", inst->xlat_name); redis_close_socket(inst, dissocket); return -1; } switch (dissocket->reply->type) { case REDIS_REPLY_STATUS: if (strcmp(dissocket->reply->str, "OK") != 0) { radlog(L_ERR, "rlm_redis (%s): Failed authentication: reply %s", inst->xlat_name, dissocket->reply->str); redis_close_socket(inst, dissocket); return -1; } break; /* else it's OK */ default: radlog(L_ERR, "rlm_redis (%s): Unexpected reply to AUTH", inst->xlat_name); redis_close_socket(inst, dissocket); return -1; } } if (inst->database) { snprintf(buffer, sizeof(buffer), "SELECT %d", inst->database); dissocket->reply = redisCommand(dissocket->conn, buffer); if (!dissocket->reply) { radlog(L_ERR, "rlm_redis (%s): Failed select database", inst->xlat_name); redis_close_socket(inst, dissocket); return -1; } switch (dissocket->reply->type) { case REDIS_REPLY_STATUS: if (strcmp(dissocket->reply->str, "OK") != 0) { radlog(L_ERR, "rlm_redis (%s): Failed SELECT %u : reply %s", inst->xlat_name, inst->database, dissocket->reply->str); redis_close_socket(inst, dissocket); return -1; } break; /* else it's OK */ default: radlog(L_ERR, "rlm_redis (%s): Unexpected reply to SELECT", inst->xlat_name); redis_close_socket(inst, dissocket); return -1; } } radlog(L_INFO, "rlm_redis (%s): Connected new DB handle, #%d", inst->xlat_name, dissocket->id); dissocket->state = sockconnected; if (inst->lifetime) time(&dissocket->connected); dissocket->queries = 0; return 0; } static void redis_poolfree(REDIS_INST * inst) { REDISSOCK *cur; REDISSOCK *next; for (cur = inst->redispool; cur; cur = next) { next = cur->next; redis_close_socket(inst, cur); } inst->redispool = NULL; } static int redis_xlat(void *instance, REQUEST *request, char *fmt, char *out, size_t freespace, UNUSED RADIUS_ESCAPE_STRING func) { REDIS_INST *inst = instance; REDISSOCK *dissocket; size_t ret = 0; char *buffer_ptr; char buffer[21]; if ((dissocket = redis_get_socket(inst)) == NULL) { radlog(L_ERR, "rlm_redis (%s): redis_get_socket() failed", inst->xlat_name); return 0; } /* Query failed for some reason, release socket and return */ if (rlm_redis_query(dissocket, inst, fmt, request) < 0) { rlm_redis_finish_query(dissocket); redis_release_socket(inst,dissocket); return 0; } switch (dissocket->reply->type) { case REDIS_REPLY_INTEGER: buffer_ptr = buffer; snprintf(buffer_ptr, sizeof(buffer), "%lld", dissocket->reply->integer); ret = strlen(buffer_ptr); break; case REDIS_REPLY_STATUS: case REDIS_REPLY_STRING: buffer_ptr = dissocket->reply->str; ret = dissocket->reply->len; break; default: buffer_ptr = NULL; break; } if ((ret >= freespace) || (buffer_ptr == NULL)) { RDEBUG("rlm_redis (%s): Can't write result, insufficient space or unsupported result\n", inst->xlat_name); rlm_redis_finish_query(dissocket); redis_release_socket(inst,dissocket); return 0; } strlcpy(out,buffer_ptr,freespace); rlm_redis_finish_query(dissocket); redis_release_socket(inst,dissocket); return ret; } /* * Only free memory we allocated. The strings allocated via * cf_section_parse() do not need to be freed. */ static int redis_detach(void *instance) { REDIS_INST *inst = instance; redis_poolfree(inst); if (inst->xlat_name) { xlat_unregister(inst->xlat_name, (RAD_XLAT_FUNC)redis_xlat, instance); free(inst->xlat_name); } free(inst->xlat_name); free(inst); return 0; } static int redis_init_socketpool(REDIS_INST *inst) { int i, rcode; int success = 0; REDISSOCK *dissocket; inst->connect_after = 0; inst->redispool = NULL; for (i = 0; i < inst->numconnections; i++) { radlog(L_DBG, "rlm_redis (%s): starting %d", inst->xlat_name, i); dissocket = rad_malloc(sizeof (*dissocket)); if (dissocket == NULL) { return -1; } memset(dissocket, 0, sizeof (*dissocket)); dissocket->conn = NULL; dissocket->id = i; dissocket->state = sockunconnected; #ifdef HAVE_PTHREAD_H rcode = pthread_mutex_init(&dissocket->mutex, NULL); if (rcode != 0) { free(dissocket); radlog(L_ERR, "rlm_redis: Failed to init lock: %s", strerror(errno)); return 0; } #endif if (time(NULL) > inst->connect_after) { /* * This sets the dissocket->state, and * possibly also inst->connect_after */ if (connect_single_socket(inst, dissocket) == 0) { success = 1; } } /* Add "dis" socket to the list of sockets * pun intended */ dissocket->next = inst->redispool; inst->redispool = dissocket; } inst->last_used = NULL; if (!success) { radlog(L_DBG, "rlm_redis (%s): Failed to connect to any redis server.", inst->xlat_name); } return 1; } /* * Peform a redis query. Split into args and pass each one through xlat. */ int rlm_redis_query(REDISSOCK *dissocket, REDIS_INST *inst, const char *query, REQUEST *request) { int argc; const char *argv[MAX_REDIS_ARGS]; char argv_buf[MAX_QUERY_LEN]; if (!query || !*query) { return -1; } argc = rad_expand_xlat(request, query, MAX_REDIS_ARGS, argv, 0, sizeof(argv_buf), argv_buf); if (argc <= 0) return -1; DEBUG2("executing %s ...", argv[0]); dissocket->reply = redisCommandArgv(dissocket->conn, argc, argv, NULL); if (dissocket->reply == NULL) { radlog(L_ERR, "rlm_redis: (%s) REDIS error: %s", inst->xlat_name, dissocket->conn->errstr); /* close the socket that failed */ if (dissocket->state == sockconnected) { redisFree(dissocket->conn); dissocket->state = sockunconnected; } /* reconnect the socket */ if (connect_single_socket(inst, dissocket) < 0) { radlog(L_ERR, "rlm_redis (%s): reconnect failed, database down?", inst->xlat_name); return -1; } DEBUG2("executing query %s", query); /* retry the query on the newly connected socket */ dissocket->reply = redisCommand(dissocket->conn, query); if (dissocket->reply == NULL) { radlog(L_ERR, "rlm_redis (%s): failed after re-connect", inst->xlat_name); return -1; } } if (dissocket->reply->type == REDIS_REPLY_ERROR) { radlog(L_ERR, "rlm_redis (%s): query failed, %s", inst->xlat_name, query); return -1; } return 0; } /* * Clear the redis reply object if any */ int rlm_redis_finish_query(REDISSOCK *dissocket) { if (dissocket == NULL) { return -1; } if (dissocket->reply != NULL) { freeReplyObject(dissocket->reply); } else { return -1; } return 0; } static time_t last_logged_failure = 0; /************************************************************************* * * Function: redis_get_socket * * Purpose: Return a REDIS socket from the connection pool * *************************************************************************/ REDISSOCK *redis_get_socket(REDIS_INST *inst) { REDISSOCK *cur, *start; int tried_to_connect = 0; int unconnected = 0; time_t now = time(NULL); /* * Start at the last place we left off. */ start = inst->last_used; if (!start) start = inst->redispool; cur = start; while (cur) { #ifdef HAVE_PTHREAD_H /* * If this socket is in use by another thread, * skip it, and try another socket. * * If it isn't used, then grab it ourselves. */ if (pthread_mutex_trylock(&cur->mutex) != 0) { goto next; } /* else we now have the lock */ #endif /* * If the socket has outlived its lifetime, and * is connected, close it, and mark it as open for * reconnections. */ if (inst->lifetime && (cur->state == sockconnected) && ((cur->connected + inst->lifetime) < now)) { DEBUG2("Closing socket %d as its lifetime has been exceeded", cur->id); redisFree(cur->conn); cur->state = sockunconnected; goto reconnect; } /* * If we have performed too many queries over this * socket, then close it. */ if (inst->max_queries && (cur->state == sockconnected) && (cur->queries >= inst->max_queries)) { DEBUG2("Closing socket %d as its max_queries has been exceeded", cur->id); redisFree(cur->conn); cur->state = sockunconnected; goto reconnect; } /* * If we happen upon an unconnected socket, and * this instance's grace period on * (re)connecting has expired, then try to * connect it. This should be really rare. */ if ((cur->state == sockunconnected) && (now > inst->connect_after)) { reconnect: radlog(L_INFO, "rlm_redis (%s): Trying to (re)connect unconnected handle %d..", inst->xlat_name, cur->id); tried_to_connect++; connect_single_socket(inst, cur); } /* if we still aren't connected, ignore this handle */ if (cur->state == sockunconnected) { DEBUG("rlm_redis (%s): Ignoring unconnected handle %d..", inst->xlat_name, cur->id); unconnected++; #ifdef HAVE_PTHREAD_H pthread_mutex_unlock(&cur->mutex); #endif goto next; } /* should be connected, grab it */ DEBUG("rlm_redis (%s): Reserving redis socket id: %d", inst->xlat_name, cur->id); if (unconnected != 0 || tried_to_connect != 0) { DEBUG("rlm_redis (%s): got socket %d after skipping %d unconnected handles, tried to reconnect %d though", inst->xlat_name, cur->id, unconnected, tried_to_connect); } /* * The socket is returned in the locked * state. * * We also remember where we left off, * so that the next search can start from * here. * * Note that multiple threads MAY over-write * the 'inst->last_used' variable. This is OK, * as it's a pointer only used for reading. */ inst->last_used = cur->next; cur->queries++; return cur; /* move along the list */ next: cur = cur->next; /* * Because we didnt start at the start, once we * hit the end of the linklist, we should go * back to the beginning and work toward the * middle! */ if (!cur) { cur = inst->redispool; } /* * If we're at the socket we started */ if (cur == start) { break; } } /* * Suppress most of the log messages. We don't want to * flood the log with this message for EVERY packet. * Instead, write to the log only once a second or so. * * This code has race conditions when threaded, but the * only result is that a few more messages are logged. */ if (now <= last_logged_failure) return NULL; last_logged_failure = now; /* We get here if every DB handle is unconnected and unconnectABLE */ radlog(L_INFO, "rlm_redis (%s): There are no DB handles to use! skipped %d, tried to connect %d", inst->xlat_name, unconnected, tried_to_connect); return NULL; } /************************************************************************* * * Function: redis_release_socket * * Purpose: Frees a REDIS socket back to the connection pool * *************************************************************************/ int redis_release_socket(REDIS_INST *inst, REDISSOCK *dissocket) { #ifdef HAVE_PTHREAD_H pthread_mutex_unlock(&dissocket->mutex); #endif radlog(L_DBG, "rlm_redis (%s): Released redis socket id: %d", inst->xlat_name, dissocket->id); return 0; } static int redis_instantiate(CONF_SECTION *conf, void **instance) { REDIS_INST *inst; const char *xlat_name; /* * Set up a storage area for instance data */ inst = rad_malloc(sizeof (REDIS_INST)); if (!inst) { return -1; } memset(inst, 0, sizeof (*inst)); /* * If the configuration parameters can't be parsed, then * fail. */ if (cf_section_parse(conf, inst, module_config) < 0) { free(inst); return -1; } xlat_name = cf_section_name2(conf); if (!xlat_name) xlat_name = cf_section_name1(conf); inst->xlat_name = strdup(xlat_name); xlat_register(inst->xlat_name, (RAD_XLAT_FUNC)redis_xlat, inst); if (redis_init_socketpool(inst) < 0) { redis_detach(inst); return -1; } inst->redis_query = rlm_redis_query; inst->redis_finish_query = rlm_redis_finish_query; inst->redis_get_socket = redis_get_socket; inst->redis_release_socket = redis_release_socket; *instance = inst; return 0; } module_t rlm_redis = { RLM_MODULE_INIT, "redis", RLM_TYPE_THREAD_SAFE, /* type */ redis_instantiate, /* instantiation */ redis_detach, /* detach */ { NULL, /* authentication */ NULL, /* authorization */ NULL, /* preaccounting */ NULL, /* accounting */ NULL, /* checksimul */ NULL, /* pre-proxy */ NULL, /* post-proxy */ NULL /* post-auth */ }, }; freeradius-server/src/modules/rlm_redis/rlm_redis.h000066400000000000000000000047341257552170400231030ustar00rootroot00000000000000/* * rlm_redis.h * * Version: $Id$ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2000,2006 The FreeRADIUS server project * Copyright 2011 TekSavvy Solutions */ #ifndef RLM_REDIS_H #define RLM_REDIS_H #include RCSIDH(rlm_redis_h, "$Id$") #ifdef HAVE_PTHREAD_H #include #endif #include #include typedef struct redis_socket { int id; #ifdef HAVE_PTHREAD_H pthread_mutex_t mutex; #endif struct redis_socket *next; enum { sockconnected, sockunconnected } state; redisContext *conn; redisReply *reply; time_t connected; int queries; } REDISSOCK; typedef struct rlm_redis_t REDIS_INST; typedef struct rlm_redis_t { time_t connect_after; REDISSOCK *redispool; REDISSOCK *last_used; char *xlat_name; int numconnections; int connect_failure_retry_delay; int lifetime; int max_queries; char *hostname; int port; int database; char *password; REDISSOCK *(*redis_get_socket)(REDIS_INST * inst); int (*redis_release_socket)(REDIS_INST * inst, REDISSOCK *dissocket); int (*redis_query)(REDISSOCK *dissocket, REDIS_INST *inst, const char *query, REQUEST *request); int (*redis_finish_query)(REDISSOCK *dissocket); } rlm_redis_t; #define MAX_QUERY_LEN 4096 #define MAX_REDIS_ARGS 16 int rlm_redis_query(REDISSOCK *dissocket, REDIS_INST *inst, const char *query, REQUEST *request); int rlm_redis_finish_query(REDISSOCK *dissocket); REDISSOCK * redis_get_socket(REDIS_INST * inst); int redis_release_socket(REDIS_INST * inst, REDISSOCK *dissocket); #endif /* RLM_REDIS_H */ freeradius-server/src/modules/rlm_rediswho/000077500000000000000000000000001257552170400214605ustar00rootroot00000000000000freeradius-server/src/modules/rlm_rediswho/.gitignore000066400000000000000000000000111257552170400234400ustar00rootroot00000000000000Makefile freeradius-server/src/modules/rlm_rediswho/Makefile.in000066400000000000000000000004271257552170400235300ustar00rootroot00000000000000TARGET = @targetname@ SRCS = rlm_rediswho.c HEADERS = $(top_builddir)/src/modules/rlm_redis/rlm_redis.h RLM_CFLAGS = -I$(top_builddir)/src/modules/rlm_redis @redis_cflags@ RLM_LIBS = @redis_ldflags@ RLM_INSTALL = include ../rules.mak $(LT_OBJS): $(HEADERS) freeradius-server/src/modules/rlm_rediswho/configure000077500000000000000000003456711257552170400234070ustar00rootroot00000000000000#! /bin/sh # From configure.in Revision. # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.69. # # # 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" 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 about your system, $0: including any error possibly output before this $0: message. Then install a modern shell, or manually run $0: the script under such a shell if you do have one." fi exit 1 fi fi fi SHELL=${CONFIG_SHELL-/bin/sh} export SHELL # Unset more variables known to interfere with behavior of common tools. CLICOLOR_FORCE= GREP_OPTIONS= unset CLICOLOR_FORCE GREP_OPTIONS ## --------------------- ## ## M4sh Shell Functions. ## ## --------------------- ## # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # If we had to re-execute with $CONFIG_SHELL, we're ensured to have # already done that, so ensure we don't try to do so again and fall # in an infinite loop. This has already happened in practice. _as_can_reexec=no; export _as_can_reexec # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= # Identity of this package. PACKAGE_NAME= PACKAGE_TARNAME= PACKAGE_VERSION= PACKAGE_STRING= PACKAGE_BUGREPORT= PACKAGE_URL= ac_unique_file="rlm_rediswho.c" ac_subst_vars='LTLIBOBJS LIBOBJS targetname redis_cflags redis_ldflags OBJEXT EXEEXT ac_ct_CC CPPFLAGS LDFLAGS CFLAGS CC target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking with_redis_include_dir with_redis_lib_dir with_redis_dir ' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *=) ac_optarg= ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) as_fn_error $? "unrecognized option: \`$ac_option' Try \`$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error $? "pwd does not report name of working directory" # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures this package to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking ...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF _ACEOF fi if test -n "$ac_init_help"; then cat <<\_ACEOF Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-redis-include-dir=DIR Directory where the redis includes may be found --with-redis-lib-dir=DIR Directory where the redis libraries may be found --with-redis-dir=DIR Base directory where redis is installed 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 Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to the package provider. _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF configure generated by GNU Autoconf 2.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 cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by $as_me, which was generated by GNU Autoconf 2.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 # 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 fail= SMART_LIBS= SMART_CLFAGS= if test x$with_rlm_rediswho != xno; then redis_include_dir= # Check whether --with-redis-include-dir was given. if test "${with_redis_include_dir+set}" = set; then : withval=$with_redis_include_dir; case "$withval" in no) as_fn_error $? "Need redis-include-dir" "$LINENO" 5 ;; yes) ;; *) redis_include_dir="$withval" ;; esac fi redis_lib_dir= # Check whether --with-redis-lib-dir was given. if test "${with_redis_lib_dir+set}" = set; then : withval=$with_redis_lib_dir; case "$withval" in no) as_fn_error $? "Need redis-lib-dir" "$LINENO" 5 ;; yes) ;; *) redis_lib_dir="$withval" ;; esac fi # Check whether --with-redis-dir was given. if test "${with_redis_dir+set}" = set; then : withval=$with_redis_dir; case "$withval" in no) as_fn_error $? "Need redis-dir" "$LINENO" 5 ;; yes) ;; *) redis_lib_dir="$withval/lib" redis_include_dir="$withval/include" ;; esac 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 smart_try_dir="${redis_include_dir}" ac_safe=`echo "hiredis/hiredis.h" | sed 'y%./+-%__pm%'` { $as_echo "$as_me:${as_lineno-$LINENO}: checking for hiredis/hiredis.h" >&5 $as_echo_n "checking for hiredis/hiredis.h... " >&6; } old_CFLAGS="$CFLAGS" smart_include= smart_include_dir= if test "x$smart_try_dir" != "x"; then for try in $smart_try_dir; do CFLAGS="$old_CFLAGS -I$try" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { int a = 1; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : smart_include="-I$try" else smart_include= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test "x$smart_include" != "x"; then break; fi done CFLAGS="$old_CFLAGS" fi if test "x$smart_include" = "x"; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { int a = 1; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : smart_include=" " else smart_include= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test "x$smart_include" = "x"; then if test "x$LOCATE" != "x"; then DIRS= file=hiredis/hiredis.h for x in `${LOCATE} $file 2>/dev/null`; do base=`echo $x | sed "s%/${file}%%"` if test "x$x" = "x$base"; then continue; fi dir=`${DIRNAME} $x 2>/dev/null` exclude=`echo ${dir} | ${GREP} /home` if test "x$exclude" != "x"; then continue fi already=`echo \$smart_include_dir ${DIRS} | ${GREP} ${dir}` if test "x$already" = "x"; then DIRS="$DIRS $dir" fi done fi eval "smart_include_dir=\"\$smart_include_dir $DIRS\"" for try in $smart_include_dir /usr/local/include /opt/include; do CFLAGS="$old_CFLAGS -I$try" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { int a = 1; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : smart_include="-I$try" else smart_include= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test "x$smart_include" != "x"; then break; fi done CFLAGS="$old_CFLAGS" fi if test "x$smart_include" != "x"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } eval "ac_cv_header_$ac_safe=yes" CFLAGS="$old_CFLAGS $smart_include" SMART_CFLAGS="$SMART_CFLAGS $smart_include" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_cv_header_hiredis_hiredis_h" != "xyes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: hiredis headers not found. Use --with-redis-include-dir=." >&5 $as_echo "$as_me: WARNING: hiredis headers not found. Use --with-redis-include-dir=." >&2;} fail="$fail hiredis.h" fi smart_try_dir="$redis_lib_dir" sm_lib_safe=`echo "hiredis" | sed 'y%./+-%__p_%'` sm_func_safe=`echo "redisConnect" | sed 'y%./+-%__p_%'` { $as_echo "$as_me:${as_lineno-$LINENO}: checking for redisConnect in -lhiredis" >&5 $as_echo_n "checking for redisConnect in -lhiredis... " >&6; } old_LIBS="$LIBS" smart_lib= smart_lib_dir= if test "x$smart_try_dir" != "x"; then for try in $smart_try_dir; do LIBS="-L$try -lhiredis $old_LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ extern char redisConnect(); int main () { redisConnect() ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : smart_lib="-L$try -lhiredis" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test "x$smart_lib" != "x"; then break; fi done LIBS="$old_LIBS" fi if test "x$smart_lib" = "x"; then LIBS="-lhiredis $old_LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ extern char redisConnect(); int main () { redisConnect() ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : smart_lib="-lhiredis" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS="$old_LIBS" fi if test "x$smart_lib" = "x"; then if test "x$LOCATE" != "x"; then DIRS= file=libhiredis${libltdl_cv_shlibext} for x in `${LOCATE} $file 2>/dev/null`; do base=`echo $x | sed "s%/${file}%%"` if test "x$x" = "x$base"; then continue; fi dir=`${DIRNAME} $x 2>/dev/null` exclude=`echo ${dir} | ${GREP} /home` if test "x$exclude" != "x"; then continue fi already=`echo \$smart_lib_dir ${DIRS} | ${GREP} ${dir}` if test "x$already" = "x"; then DIRS="$DIRS $dir" fi done fi eval "smart_lib_dir=\"\$smart_lib_dir $DIRS\"" if test "x$LOCATE" != "x"; then DIRS= file=libhiredis.a for x in `${LOCATE} $file 2>/dev/null`; do base=`echo $x | sed "s%/${file}%%"` if test "x$x" = "x$base"; then continue; fi dir=`${DIRNAME} $x 2>/dev/null` exclude=`echo ${dir} | ${GREP} /home` if test "x$exclude" != "x"; then continue fi already=`echo \$smart_lib_dir ${DIRS} | ${GREP} ${dir}` if test "x$already" = "x"; then DIRS="$DIRS $dir" fi done fi eval "smart_lib_dir=\"\$smart_lib_dir $DIRS\"" for try in $smart_lib_dir /usr/local/lib /opt/lib; do LIBS="-L$try -lhiredis $old_LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ extern char redisConnect(); int main () { redisConnect() ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : smart_lib="-L$try -lhiredis" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test "x$smart_lib" != "x"; then break; fi done LIBS="$old_LIBS" fi if test "x$smart_lib" != "x"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } eval "ac_cv_lib_${sm_lib_safe}_${sm_func_safe}=yes" LIBS="$smart_lib $old_LIBS" SMART_LIBS="$smart_lib $SMART_LIBS" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_cv_lib_hiredis_redisConnect" != "xyes" then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: hiredis libraries not found. Use --with-redis-lib-dir=." >&5 $as_echo "$as_me: WARNING: hiredis libraries not found. Use --with-redis-lib-dir=." >&2;} fail="$fail libhiredis" fi targetname=rlm_rediswho else targetname= echo \*\*\* module rlm_rediswho is disabled. fi if test "x$fail" != x; then if test "x${enable_strict_dependencies}" = xyes; then as_fn_error $? "set --without-rlm_rediswho to disable it explicitly." "$LINENO" 5 else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: silently not building rlm_rediswho." >&5 $as_echo "$as_me: WARNING: silently not building rlm_rediswho." >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: FAILURE: rlm_rediswho requires:$fail." >&5 $as_echo "$as_me: WARNING: FAILURE: rlm_rediswho requires:$fail." >&2;}; targetname= fi fi redis_ldflags="$SMART_LIBS" redis_cflags="$SMART_CFLAGS" unset ac_cv_env_LIBS_set unset ac_cv_env_LIBS_value ac_config_files="$ac_config_files 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}' # Transform confdefs.h into DEFS. # Protect against shell expansion while executing Makefile rules. # Protect against Makefile macro expansion. # # If the first sed substitution is executed (which looks for macros that # take arguments), then branch to the quote section. Otherwise, # look for a macro that doesn't take arguments. ac_script=' :mline /\\$/{ N s,\\\n,, b mline } t clear :clear s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g t quote s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g t quote b any :quote s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g s/\[/\\&/g s/\]/\\&/g s/\$/$$/g H :any ${ g s/^\n// s/\n/ /g p } ' DEFS=`sed -n "$ac_script" confdefs.h` ac_libobjs= ac_ltlibobjs= U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## _ASEOF test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by $as_me, 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 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" _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 Configuration files: $config_files Report bugs to the package provider." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ config.status configured by $0, generated by GNU Autoconf 2.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' 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;; --he | --h | --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX $as_echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "Makefile") CONFIG_FILES="$CONFIG_FILES 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 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" eval set X " :F $CONFIG_FILES " 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 # _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 $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 ;; 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 freeradius-server/src/modules/rlm_rediswho/configure.in000066400000000000000000000056601257552170400240000ustar00rootroot00000000000000AC_PREREQ([2.61]) AC_INIT(rlm_rediswho.c) AC_REVISION($Revision$) AC_DEFUN(modname,[rlm_rediswho]) fail= SMART_LIBS= SMART_CLFAGS= if test x$with_[]modname != xno; then dnl ############################################################ dnl # Check for command line options dnl ############################################################ dnl extra argument: --with-redis-include-dir=DIR redis_include_dir= AC_ARG_WITH(redis-include-dir, [AS_HELP_STRING([--with-redis-include-dir=DIR], [Directory where the redis includes may be found])], [case "$withval" in no) AC_MSG_ERROR(Need redis-include-dir) ;; yes) ;; *) redis_include_dir="$withval" ;; esac]) dnl extra argument: --with-redis-lib-dir=DIR redis_lib_dir= AC_ARG_WITH(redis-lib-dir, [AS_HELP_STRING([--with-redis-lib-dir=DIR], [Directory where the redis libraries may be found])], [case "$withval" in no) AC_MSG_ERROR(Need redis-lib-dir) ;; yes) ;; *) redis_lib_dir="$withval" ;; esac]) dnl extra argument: --with-redis-dir=DIR AC_ARG_WITH(redis-dir, [AS_HELP_STRING([--with-redis-dir=DIR], [Base directory where redis is installed])], [case "$withval" in no) AC_MSG_ERROR(Need redis-dir) ;; yes) ;; *) redis_lib_dir="$withval/lib" redis_include_dir="$withval/include" ;; esac]) dnl ############################################################ dnl # Check for programs dnl ############################################################ AC_PROG_CC dnl ############################################################ dnl # Check for header files dnl ############################################################ smart_try_dir="${redis_include_dir}" FR_SMART_CHECK_INCLUDE([hiredis/hiredis.h]) if test "x$ac_cv_header_hiredis_hiredis_h" != "xyes"; then AC_MSG_WARN([hiredis headers not found. Use --with-redis-include-dir=.]) fail="$fail hiredis.h" fi dnl ############################################################ dnl # Check for libraries dnl ############################################################ smart_try_dir="$redis_lib_dir" FR_SMART_CHECK_LIB(hiredis, redisConnect) if test "x$ac_cv_lib_hiredis_redisConnect" != "xyes" then AC_MSG_WARN([hiredis libraries not found. Use --with-redis-lib-dir=.]) fail="$fail libhiredis" fi targetname=modname else targetname= echo \*\*\* module modname is disabled. fi dnl Don't change this section. if test "x$fail" != x; then if test "x${enable_strict_dependencies}" = xyes; then AC_MSG_ERROR([set --without-]modname[ to disable it explicitly.]) else AC_MSG_WARN([silently not building ]modname[.]) AC_MSG_WARN([FAILURE: ]modname[ requires:$fail.]); targetname= fi fi redis_ldflags="$SMART_LIBS" redis_cflags="$SMART_CFLAGS" AC_SUBST(redis_ldflags) AC_SUBST(redis_cflags) AC_SUBST(targetname) AC_OUTPUT(Makefile) freeradius-server/src/modules/rlm_rediswho/rlm_rediswho.c000066400000000000000000000234721257552170400243320ustar00rootroot00000000000000/* * rlm_rediswho.c rlm_rediswho - FreeRADIUS redis/bashtable "radwho" Module * * Version: $Id$ * * 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 * * Copyright 2006 The FreeRADIUS server project * Copyright 2011 TekSavvy Solutions Inc */ #include RCSID("$Id$") #include #include #include typedef struct rlm_rediswho_t { const char *xlat_name; char *redis_instance_name; REDIS_INST *redis_inst; /* * expiry time in seconds if no updates are received for a user */ int expiry_time; /* * How many session updates to keep track of per user */ int trim_count; char *start_insert; char *start_trim; char *start_expire; char *alive_insert; char *alive_trim; char *alive_expire; char *stop_insert; char *stop_trim; char *stop_expire; } rlm_rediswho_t; static CONF_PARSER module_config[] = { { "redis-instance-name", PW_TYPE_STRING_PTR, offsetof(rlm_rediswho_t, redis_instance_name), NULL, "redis"}, { "expiry-time", PW_TYPE_INTEGER, offsetof(rlm_rediswho_t, expiry_time), NULL, "86400"}, { "trim-count", PW_TYPE_INTEGER, offsetof(rlm_rediswho_t, trim_count), NULL, "100"}, { "start-insert", PW_TYPE_STRING_PTR, offsetof(rlm_rediswho_t, start_insert), NULL, ""}, { "start-trim", PW_TYPE_STRING_PTR, offsetof(rlm_rediswho_t, start_trim), NULL, ""}, { "start-expire", PW_TYPE_STRING_PTR, offsetof(rlm_rediswho_t, start_expire), NULL, ""}, { "alive-insert", PW_TYPE_STRING_PTR, offsetof(rlm_rediswho_t, alive_insert), NULL, ""}, { "alive-trim", PW_TYPE_STRING_PTR, offsetof(rlm_rediswho_t, alive_trim), NULL, ""}, { "alive-expire", PW_TYPE_STRING_PTR, offsetof(rlm_rediswho_t, alive_expire), NULL, ""}, { "stop-insert", PW_TYPE_STRING_PTR, offsetof(rlm_rediswho_t, stop_insert), NULL, ""}, { "stop-trim", PW_TYPE_STRING_PTR, offsetof(rlm_rediswho_t, stop_trim), NULL, ""}, { "stop-expire", PW_TYPE_STRING_PTR, offsetof(rlm_rediswho_t, stop_expire), NULL, ""}, { NULL, -1, 0, NULL, NULL} }; /* * Query the database executing a command. * If the result is a positive integer, return that value. */ static int rediswho_command(const char *fmt, REDISSOCK *dissocket, rlm_rediswho_t *data, REQUEST *request) { int result = 0; if (data->redis_inst->redis_query(dissocket, data->redis_inst, fmt, request) < 0) { radlog(L_ERR, "rediswho_command: database query error in: '%s'", fmt); return -1; } switch (dissocket->reply->type) { case REDIS_REPLY_INTEGER: DEBUG("rediswho_command: query response %lld\n", dissocket->reply->integer); if (dissocket->reply->integer > 0) result = dissocket->reply->integer; break; case REDIS_REPLY_STATUS: case REDIS_REPLY_STRING: DEBUG("rediswho_command: query response %s\n", dissocket->reply->str); break; default: break; } (data->redis_inst->redis_finish_query)(dissocket); return result; } static int rediswho_detach(void *instance) { rlm_rediswho_t *inst; inst = instance; free(inst); return 0; } static int rediswho_instantiate(CONF_SECTION * conf, void ** instance) { module_instance_t *modinst; rlm_rediswho_t *inst; /* * Set up a storage area for instance data */ inst = *instance = rad_malloc(sizeof (*inst)); memset(inst, 0, sizeof (*inst)); /* * If the configuration parameters can't be parsed, then * fail. */ if (cf_section_parse(conf, inst, module_config) < 0) { free(inst); return -1; } inst->xlat_name = cf_section_name2(conf); if (!inst->xlat_name) inst->xlat_name = cf_section_name1(conf); inst->xlat_name = strdup(inst->xlat_name); DEBUG("xlat name %s\n", inst->xlat_name); /* * Check that all the queries are in place */ if ((inst->start_insert == NULL) || !*inst->start_insert) { radlog(L_ERR, "rlm_rediswho: the 'start_insert' statement must be set."); rediswho_detach(inst); return -1; } if ((inst->start_trim == NULL) || !*inst->start_trim) { radlog(L_ERR, "rlm_rediswho: the 'start_trim' statement must be set."); rediswho_detach(inst); return -1; } if ((inst->start_expire == NULL) || !*inst->start_expire) { radlog(L_ERR, "rlm_rediswho: the 'start_expire' statement must be set."); rediswho_detach(inst); return -1; } if ((inst->alive_insert == NULL) || !*inst->alive_insert) { radlog(L_ERR, "rlm_rediswho: the 'alive_insert' statement must be set."); rediswho_detach(inst); return -1; } if ((inst->alive_trim == NULL) || !*inst->alive_trim) { radlog(L_ERR, "rlm_rediswho: the 'alive_trim' statement must be set."); rediswho_detach(inst); return -1; } if ((inst->alive_expire == NULL) || !*inst->alive_expire) { radlog(L_ERR, "rlm_rediswho: the 'alive_expire' statement must be set."); rediswho_detach(inst); return -1; } if ((inst->stop_insert == NULL) || !*inst->stop_insert) { radlog(L_ERR, "rlm_rediswho: the 'stop_insert' statement must be set."); rediswho_detach(inst); return -1; } if ((inst->stop_trim == NULL) || !*inst->stop_trim) { radlog(L_ERR, "rlm_rediswho: the 'stop_trim' statement must be set."); rediswho_detach(inst); return -1; } if ((inst->stop_expire == NULL) || !*inst->stop_expire) { radlog(L_ERR, "rlm_rediswho: the 'stop_expire' statement must be set."); rediswho_detach(inst); return -1; } modinst = find_module_instance(cf_section_find("modules"), inst->redis_instance_name, 1); if (!modinst) { radlog(L_ERR, "rediswho: failed to find module instance \"%s\"", inst->redis_instance_name); rediswho_detach(inst); return -1; } if (strcmp(modinst->entry->name, "rlm_redis") != 0) { radlog(L_ERR, "rediswho: Module \"%s\"" " is not an instance of the redis module", inst->redis_instance_name); rediswho_detach(inst); return -1; } inst->redis_inst = (REDIS_INST *) modinst->insthandle; return 0; } #define REDISWHO_COMMAND(_a, _b, _c, _d) rc = rediswho_command(_a, _b, _c, _d); if (rc < 0) return RLM_MODULE_FAIL static int rediswho_accounting_start(REDISSOCK *dissocket, rlm_rediswho_t *data, REQUEST *request) { int rc; REDISWHO_COMMAND(data->start_insert, dissocket, data, request); /* Only trim if necessary */ if (rc > data->trim_count) { rediswho_command(data->start_trim, dissocket, data, request); } REDISWHO_COMMAND(data->start_expire, dissocket, data, request); return RLM_MODULE_OK; } static int rediswho_accounting_alive(REDISSOCK *dissocket, rlm_rediswho_t *data, REQUEST *request) { int rc; REDISWHO_COMMAND(data->alive_insert, dissocket, data, request); /* Only trim if necessary */ if (rc > data->trim_count) { rediswho_command(data->alive_trim, dissocket, data, request); } REDISWHO_COMMAND(data->alive_expire, dissocket, data, request); return RLM_MODULE_OK; } static int rediswho_accounting_stop(REDISSOCK *dissocket, rlm_rediswho_t *data, REQUEST *request) { int rc; REDISWHO_COMMAND(data->stop_insert, dissocket, data, request); /* Only trim if necessary */ if (rc > data->trim_count) { rediswho_command(data->stop_trim, dissocket, data, request); } REDISWHO_COMMAND(data->stop_expire, dissocket, data, request); return RLM_MODULE_OK; } static int rediswho_accounting(void * instance, REQUEST * request) { int rcode = RLM_MODULE_NOOP; VALUE_PAIR * vp; int acct_status_type; rlm_rediswho_t * data = (rlm_rediswho_t *) instance; REDISSOCK *dissocket; vp = pairfind(request->packet->vps, PW_ACCT_STATUS_TYPE); if (!vp) { RDEBUG("Could not find account status type in packet."); return RLM_MODULE_NOOP; } acct_status_type = vp->vp_integer; switch (acct_status_type) { case PW_STATUS_START: case PW_STATUS_ALIVE: case PW_STATUS_STOP: case PW_STATUS_ACCOUNTING_ON: case PW_STATUS_ACCOUNTING_OFF: break; default: /* We don't care about any other accounting packet */ return RLM_MODULE_NOOP; } /* * Some nonsensical security checks. */ if (!request->username) { RDEBUG("User-Name is required"); return RLM_MODULE_NOOP; } dissocket = data->redis_inst->redis_get_socket(data->redis_inst); if (dissocket == NULL) { RDEBUG("cannot allocate redis connection"); return RLM_MODULE_FAIL; } switch (acct_status_type) { case PW_STATUS_START: rcode = rediswho_accounting_start(dissocket, data, request); break; case PW_STATUS_ALIVE: rcode = rediswho_accounting_alive(dissocket, data, request); break; case PW_STATUS_STOP: rcode = rediswho_accounting_stop(dissocket, data, request); break; case PW_STATUS_ACCOUNTING_ON: case PW_STATUS_ACCOUNTING_OFF: /* TODO */ break; } data->redis_inst->redis_release_socket(data->redis_inst, dissocket); return rcode; } module_t rlm_rediswho = { RLM_MODULE_INIT, "rediswho", RLM_TYPE_THREAD_SAFE, /* type */ rediswho_instantiate, /* instantiation */ rediswho_detach, /* detach */ { NULL, /* authentication */ NULL, /* authorization */ NULL, /* preaccounting */ rediswho_accounting, /* accounting */ NULL, /* checksimul */ NULL, /* pre-proxy */ NULL, /* post-proxy */ NULL /* post-auth */ }, }; freeradius-server/src/modules/rlm_replicate/000077500000000000000000000000001257552170400216045ustar00rootroot00000000000000freeradius-server/src/modules/rlm_replicate/Makefile000066400000000000000000000002441257552170400232440ustar00rootroot00000000000000TARGET = rlm_replicate SRCS = rlm_replicate.c HEADERS = RLM_CFLAGS = RLM_LIBS = include ../rules.mak $(STATIC_OBJS): $(HEADERS) $(DYNAMIC_OBJS): $(HEADERS) freeradius-server/src/modules/rlm_replicate/rlm_replicate.c000066400000000000000000000126761257552170400246060ustar00rootroot00000000000000/* * rlm_replicate.c * * Version: $Id$ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2000,2006 The FreeRADIUS server project * Copyright 2000 your name */ #include RCSID("$Id$") #include #include #include static void cleanup(RADIUS_PACKET **packet) { if (!packet || !*packet) return; if ((*packet)->sockfd >= 0) close((*packet)->sockfd); rad_free(packet); } /* * Write accounting information to this modules database. */ static int replicate_packet(void *instance, REQUEST *request) { int rcode = RLM_MODULE_NOOP; VALUE_PAIR *vp, *last; home_server *home; REALM *realm; home_pool_t *pool; RADIUS_PACKET *packet = NULL; instance = instance; /* -Wunused */ last = request->config_items; rad_assert(request->proxy == NULL); /* * Send as many packets as necessary to different * destinations. */ while (1) { vp = pairfind(last, PW_REPLICATE_TO_REALM); if (!vp) break; last = vp->next; realm = realm_find2(vp->vp_strvalue); if (!realm) { RDEBUG2("ERROR: Cannot Replicate to unknown realm %s", vp->vp_strvalue); continue; } /* * We shouldn't really do this on every loop. */ switch (request->packet->code) { default: pool = NULL; RDEBUG2("ERROR: Cannot replicate unknown packet code %d", request->packet->code); cleanup(&packet); rcode = RLM_MODULE_FAIL; break; case PW_AUTHENTICATION_REQUEST: pool = realm->auth_pool; break; #ifdef WITH_ACCOUNTING case PW_ACCOUNTING_REQUEST: pool = realm->acct_pool; break; #endif #ifdef WITH_COA case PW_COA_REQUEST: case PW_DISCONNECT_REQUEST: pool = realm->acct_pool; break; #endif } if (!pool) { RDEBUG2(" WARNING: Cancelling replication to Realm %s, as the realm is local.", realm->name); continue; } home = home_server_ldb(realm->name, pool, request); if (!home) { RDEBUG2("ERROR: Failed to find live home server for realm %s", realm->name); continue; } if (!packet) { packet = rad_alloc(1); if (!packet) { rcode = RLM_MODULE_FAIL; break; } packet->sockfd = -1; packet->code = request->packet->code; packet->id = fr_rand() & 0xff; packet->sockfd = fr_socket(&home->src_ipaddr, 0); if (packet->sockfd < 0) { RDEBUG("ERROR: Failed opening socket: %s", fr_strerror()); cleanup(&packet); rcode = RLM_MODULE_FAIL; break; } packet->vps = paircopy(request->packet->vps); if (!packet->vps) { RDEBUG("ERROR: Out of memory!"); cleanup(&packet); rcode = RLM_MODULE_FAIL; break; } /* * For CHAP, create the CHAP-Challenge if * it doesn't exist. */ if ((request->packet->code == PW_AUTHENTICATION_REQUEST) && (pairfind(request->packet->vps, PW_CHAP_PASSWORD) != NULL) && (pairfind(request->packet->vps, PW_CHAP_CHALLENGE) == NULL)) { vp = radius_paircreate(request, &packet->vps, PW_CHAP_CHALLENGE, PW_TYPE_OCTETS); vp->length = AUTH_VECTOR_LEN; memcpy(vp->vp_strvalue, request->packet->vector, AUTH_VECTOR_LEN); } } else { size_t i; for (i = 0; i < sizeof(packet->vector); i++) { packet->vector[i] = fr_rand() & 0xff; } packet->id++; free(packet->data); packet->data = NULL; packet->data_len = 0; } /* * (Re)-Write these. */ packet->dst_ipaddr = home->ipaddr; packet->dst_port = home->port; memset(&packet->src_ipaddr, 0, sizeof(packet->src_ipaddr)); packet->src_port = 0; /* * Encode, sign and then send the packet. */ RDEBUG("Replicating packet to Realm %s", realm->name); if (rad_send(packet, NULL, home->secret) < 0) { RDEBUG("ERROR: Failed replicating packet: %s", fr_strerror()); cleanup(&packet); rcode = RLM_MODULE_FAIL; break; } /* * We've sent it to at least one destination. */ rcode = RLM_MODULE_OK; } cleanup(&packet); rad_free(&request->proxy); return rcode; } /* * The module name should be the only globally exported symbol. * That is, everything else should be 'static'. * * If the module needs to temporarily modify it's instantiation * data, the type should be changed to RLM_TYPE_THREAD_UNSAFE. * The server will then take care of ensuring that the module * is single-threaded. */ module_t rlm_replicate = { RLM_MODULE_INIT, "replicate", RLM_TYPE_THREAD_SAFE, /* type */ NULL, /* instantiation */ NULL, /* detach */ { NULL, /* authentication */ replicate_packet, /* authorization */ NULL, /* preaccounting */ replicate_packet, /* accounting */ NULL, /* checksimul */ NULL, /* pre-proxy */ NULL, /* post-proxy */ NULL /* post-auth */ #ifdef WITH_COA , replicate_packet, NULL #endif }, }; freeradius-server/src/modules/rlm_ruby/000077500000000000000000000000001257552170400206155ustar00rootroot00000000000000freeradius-server/src/modules/rlm_ruby/Makefile.in000066400000000000000000000002641257552170400226640ustar00rootroot00000000000000 TARGET = @targetname@ SRCS = rlm_ruby.c HEADERS = @ruby_headers@ RLM_LIBS = @ruby_ldflags@ RLM_CFLAGS = @ruby_cflags@ include ../rules.mak $(LT_OBJS): $(HEADERS) freeradius-server/src/modules/rlm_ruby/configure000077500000000000000000003511771257552170400225420ustar00rootroot00000000000000#! /bin/sh # From configure.in Revision: 1.9 . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.69. # # # 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" 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 about your system, $0: including any error possibly output before this $0: message. Then install a modern shell, or manually run $0: the script under such a shell if you do have one." fi exit 1 fi fi fi SHELL=${CONFIG_SHELL-/bin/sh} export SHELL # Unset more variables known to interfere with behavior of common tools. CLICOLOR_FORCE= GREP_OPTIONS= unset CLICOLOR_FORCE GREP_OPTIONS ## --------------------- ## ## M4sh Shell Functions. ## ## --------------------- ## # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # If we had to re-execute with $CONFIG_SHELL, we're ensured to have # already done that, so ensure we don't try to do so again and fall # in an infinite loop. This has already happened in practice. _as_can_reexec=no; export _as_can_reexec # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= # Identity of this package. PACKAGE_NAME= PACKAGE_TARNAME= PACKAGE_VERSION= PACKAGE_STRING= PACKAGE_BUGREPORT= PACKAGE_URL= ac_unique_file="rlm_ruby.c" ac_subst_vars='LTLIBOBJS LIBOBJS targetname ruby_headers ruby_cflags ruby_ldflags RUBYBIN CPP OBJEXT EXEEXT ac_ct_CC CPPFLAGS LDFLAGS CFLAGS CC target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking with_rlm_ruby_bin ' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CPP' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *=) ac_optarg= ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) as_fn_error $? "unrecognized option: \`$ac_option' Try \`$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error $? "pwd does not report name of working directory" # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures this package to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking ...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF _ACEOF fi if test -n "$ac_init_help"; then cat <<\_ACEOF Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-rlm-ruby-bin=DIR Path to the ruby binary Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory LIBS libraries to pass to the linker, e.g. -l CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to the package provider. _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF configure generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## # ac_fn_c_try_compile LINENO # -------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_compile # ac_fn_c_try_cpp LINENO # ---------------------- # Try to preprocess conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } > conftest.i && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_cpp cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by $as_me, which was generated by GNU Autoconf 2.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 # 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 if test x$with_rlm_ruby != xno; then 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 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 RUBYBIN= # Check whether --with-rlm-ruby-bin was given. if test "${with_rlm_ruby_bin+set}" = set; then : withval=$with_rlm_ruby_bin; case "$withval" in no) as_fn_error $? "Need rlm-ruby-bin-dir" "$LINENO" 5 ;; yes) ;; *) RUBYBIN="$withval" ;; esac fi if test "x$RUBYBIN" = "x"; then for ac_prog in ruby ruby1.8 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_RUBYBIN+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$RUBYBIN"; then ac_cv_prog_RUBYBIN="$RUBYBIN" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_dummy="${PATH}:/usr/bin:/usr/local/bin" for as_dir in $as_dummy 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_RUBYBIN="$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 RUBYBIN=$ac_cv_prog_RUBYBIN if test -n "$RUBYBIN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RUBYBIN" >&5 $as_echo "$RUBYBIN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$RUBYBIN" && break done test -n "$RUBYBIN" || RUBYBIN="not-found" if test x$RUBYBIN = xnot-found; then fail="ruby-binary" fi fi if test x$fail = x; then #We use fetch, cause [] are disapearing somewere RB_PREFIX=`${RUBYBIN} -e "require 'rbconfig'; puts RbConfig::CONFIG.fetch('prefix')"` RB_EXEC_PREFIX=`${RUBYBIN} -e "require 'rbconfig'; puts RbConfig::CONFIG.fetch('exec_prefix')"` RB_VERSION=`${RUBYBIN} -e 'puts RUBY_VERSION'` { $as_echo "$as_me:${as_lineno-$LINENO}: version: $RB_VERSION" >&5 $as_echo "$as_me: version: $RB_VERSION" >&6;} # RB_LIBS=`${RUBYBIN} -e "require 'rbconfig'; puts Config::CONFIG.fetch('LIBRUBY')"` # RB_LIB_DIR=`${RUBYBIN} -e "require 'rbconfig'; puts Config::CONFIG.fetch('libdir')"` # RB_EXTRA_LIBS=`${RUBYBIN} -e "require 'rbconfig'; puts Config::CONFIG.fetch('LIBS')"` RB_LIBS=`${RUBYBIN} -e "require 'rbconfig'; puts RbConfig::CONFIG.fetch('LIBRUBYARG_SHARED')"` { $as_echo "$as_me:${as_lineno-$LINENO}: libs: $RB_LIBS" >&5 $as_echo "$as_me: libs: $RB_LIBS" >&6;} RB_INC_DIR=`${RUBYBIN} -e "require 'rbconfig'; puts RbConfig::CONFIG.fetch('includedir')"` { $as_echo "$as_me:${as_lineno-$LINENO}: include: $RB_INC_DIR" >&5 $as_echo "$as_me: include: $RB_INC_DIR" >&6;} RB_CFLAGS=`${RUBYBIN} -e "require 'rbconfig'; puts RbConfig::CONFIG.fetch('CFLAGS')"` { $as_echo "$as_me:${as_lineno-$LINENO}: cflags: $RB_FLAGS" >&5 $as_echo "$as_me: cflags: $RB_FLAGS" >&6;} RB_ARCH_DIR=`${RUBYBIN} -e "require 'rbconfig'; puts RbConfig::CONFIG.fetch('archdir')"` { $as_echo "$as_me:${as_lineno-$LINENO}: arch: $RB_ARCH_DIR" >&5 $as_echo "$as_me: arch: $RB_ARCH_DIR" >&6;} old_CFLAGS=$CFLAGS CFLAGS="$CFLAGS $RB_CFLAGS -I${RB_ARCH_DIR} -I${RB_INC_DIR} -I${RB_INC_DIR}/ruby-${RB_VERSION}" { $as_echo "$as_me:${as_lineno-$LINENO}: \"$CFLAGS\"" >&5 $as_echo "$as_me: \"$CFLAGS\"" >&6;}; ac_safe=`echo "ruby.h" | sed 'y%./+-%__pm%'` { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ruby.h" >&5 $as_echo_n "checking for ruby.h... " >&6; } old_CFLAGS="$CFLAGS" smart_include= smart_include_dir= if test "x$smart_try_dir" != "x"; then for try in $smart_try_dir; do CFLAGS="$old_CFLAGS -I$try" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { int a = 1; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : smart_include="-I$try" else smart_include= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test "x$smart_include" != "x"; then break; fi done CFLAGS="$old_CFLAGS" fi if test "x$smart_include" = "x"; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { int a = 1; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : smart_include=" " else smart_include= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test "x$smart_include" = "x"; then if test "x$LOCATE" != "x"; then DIRS= file=ruby.h for x in `${LOCATE} $file 2>/dev/null`; do base=`echo $x | sed "s%/${file}%%"` if test "x$x" = "x$base"; then continue; fi dir=`${DIRNAME} $x 2>/dev/null` exclude=`echo ${dir} | ${GREP} /home` if test "x$exclude" != "x"; then continue fi already=`echo \$smart_include_dir ${DIRS} | ${GREP} ${dir}` if test "x$already" = "x"; then DIRS="$DIRS $dir" fi done fi eval "smart_include_dir=\"\$smart_include_dir $DIRS\"" for try in $smart_include_dir /usr/local/include /opt/include; do CFLAGS="$old_CFLAGS -I$try" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { int a = 1; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : smart_include="-I$try" else smart_include= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test "x$smart_include" != "x"; then break; fi done CFLAGS="$old_CFLAGS" fi if test "x$smart_include" != "x"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } eval "ac_cv_header_$ac_safe=yes" CFLAGS="$old_CFLAGS $smart_include" SMART_CFLAGS="$SMART_CFLAGS $smart_include" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_cv_header_ruby_h" != "xyes"; then fail="$fail ruby.h" targetname= fi ruby_cflags=$CFLAGS CFLAGS=$old_CFLAGS old_LIBS=$LIBS # LIBS="$RB_LIBS $RB_LIB_DIR $RB_EXTRA_LIBS -lm" LIBS="$RB_LIBS" # smart_try_dir=$RB_LIB_DIR ruby_ldflags=$LIBS LIBS=$old_LIBS targetname=rlm_ruby # ruby_headers="${RB_INC_DIR} ${RB_ARCH_DIR}" fi else targetname= echo \*\*\* module rlm_ruby is disabled. fi if test x"$fail" != x""; then if test x"${enable_strict_dependencies}" = x"yes"; then as_fn_error $? "set --without-rlm_ruby to disable it explicitly." "$LINENO" 5 else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: silently not building rlm_ruby." >&5 $as_echo "$as_me: WARNING: silently not building rlm_ruby." >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: FAILURE: rlm_ruby requires: $fail." >&5 $as_echo "$as_me: WARNING: FAILURE: rlm_ruby requires: $fail." >&2;}; targetname="" fi fi unset ac_cv_env_LIBS_set unset ac_cv_env_LIBS_value ac_config_files="$ac_config_files 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}' # Transform confdefs.h into DEFS. # Protect against shell expansion while executing Makefile rules. # Protect against Makefile macro expansion. # # If the first sed substitution is executed (which looks for macros that # take arguments), then branch to the quote section. Otherwise, # look for a macro that doesn't take arguments. ac_script=' :mline /\\$/{ N s,\\\n,, b mline } t clear :clear s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g t quote s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g t quote b any :quote s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g s/\[/\\&/g s/\]/\\&/g s/\$/$$/g H :any ${ g s/^\n// s/\n/ /g p } ' DEFS=`sed -n "$ac_script" confdefs.h` ac_libobjs= ac_ltlibobjs= U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## _ASEOF test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by $as_me, 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 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" _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 Configuration files: $config_files Report bugs to the package provider." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ config.status configured by $0, generated by GNU Autoconf 2.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' 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;; --he | --h | --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX $as_echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "Makefile") CONFIG_FILES="$CONFIG_FILES 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 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" eval set X " :F $CONFIG_FILES " 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 # _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 $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 ;; 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 freeradius-server/src/modules/rlm_ruby/configure.in000066400000000000000000000054121257552170400231300ustar00rootroot00000000000000AC_PREREQ([2.53]) AC_INIT(rlm_ruby.c) AC_REVISION($Revision: 1.9 $) AC_DEFUN(modname,[rlm_ruby]) if test x$with_[]modname != xno; then AC_PROG_CC AC_PROG_CPP dnl extra argument: --with-rlm-ruby-bin RUBYBIN= AC_ARG_WITH(rlm-ruby-bin, [ --with-rlm-ruby-bin=DIR Path to the ruby binary []], [ case "$withval" in no) AC_MSG_ERROR(Need rlm-ruby-bin-dir) ;; yes) ;; *) RUBYBIN="$withval" ;; esac ] ) if test "x$RUBYBIN" = "x"; then AC_CHECK_PROGS(RUBYBIN, [ ruby ruby1.8 ], not-found, [${PATH}:/usr/bin:/usr/local/bin]) if test x$RUBYBIN = xnot-found; then fail="ruby-binary" fi fi if test x$fail = x; then #We use fetch, cause [] are disapearing somewere RB_PREFIX=`${RUBYBIN} -e "require 'rbconfig'; puts RbConfig::CONFIG.fetch('prefix')"` RB_EXEC_PREFIX=`${RUBYBIN} -e "require 'rbconfig'; puts RbConfig::CONFIG.fetch('exec_prefix')"` changequote(<<, >>)dnl RB_VERSION=`${RUBYBIN} -e 'puts RUBY_VERSION'` changequote([, ])dnl AC_MSG_NOTICE([version: $RB_VERSION]) # RB_LIBS=`${RUBYBIN} -e "require 'rbconfig'; puts Config::CONFIG.fetch('LIBRUBY')"` # RB_LIB_DIR=`${RUBYBIN} -e "require 'rbconfig'; puts Config::CONFIG.fetch('libdir')"` # RB_EXTRA_LIBS=`${RUBYBIN} -e "require 'rbconfig'; puts Config::CONFIG.fetch('LIBS')"` RB_LIBS=`${RUBYBIN} -e "require 'rbconfig'; puts RbConfig::CONFIG.fetch('LIBRUBYARG_SHARED')"` AC_MSG_NOTICE([libs: $RB_LIBS]) RB_INC_DIR=`${RUBYBIN} -e "require 'rbconfig'; puts RbConfig::CONFIG.fetch('includedir')"` AC_MSG_NOTICE([include: $RB_INC_DIR]) RB_CFLAGS=`${RUBYBIN} -e "require 'rbconfig'; puts RbConfig::CONFIG.fetch('CFLAGS')"` AC_MSG_NOTICE([cflags: $RB_FLAGS]) RB_ARCH_DIR=`${RUBYBIN} -e "require 'rbconfig'; puts RbConfig::CONFIG.fetch('archdir')"` AC_MSG_NOTICE([arch: $RB_ARCH_DIR]) old_CFLAGS=$CFLAGS CFLAGS="$CFLAGS $RB_CFLAGS -I${RB_ARCH_DIR} -I${RB_INC_DIR} -I${RB_INC_DIR}/ruby-${RB_VERSION}" AC_MSG_NOTICE("$CFLAGS"); FR_SMART_CHECK_INCLUDE(ruby.h) if test "x$ac_cv_header_ruby_h" != "xyes"; then fail="$fail ruby.h" targetname= fi ruby_cflags=$CFLAGS CFLAGS=$old_CFLAGS old_LIBS=$LIBS # LIBS="$RB_LIBS $RB_LIB_DIR $RB_EXTRA_LIBS -lm" LIBS="$RB_LIBS" # smart_try_dir=$RB_LIB_DIR ruby_ldflags=$LIBS LIBS=$old_LIBS targetname=modname # ruby_headers="${RB_INC_DIR} ${RB_ARCH_DIR}" fi else targetname= echo \*\*\* module modname is disabled. fi if test x"$fail" != x""; then if test x"${enable_strict_dependencies}" = x"yes"; then AC_MSG_ERROR([set --without-]modname[ to disable it explicitly.]) else AC_MSG_WARN([silently not building ]modname[.]) AC_MSG_WARN([FAILURE: ]modname[ requires: $fail.]); targetname="" fi fi AC_SUBST(ruby_ldflags) AC_SUBST(ruby_cflags) AC_SUBST(ruby_headers) AC_SUBST(targetname) AC_OUTPUT(Makefile) freeradius-server/src/modules/rlm_ruby/example.rb000066400000000000000000000013051257552170400225740ustar00rootroot00000000000000#This is example radius.rb script module Radiusd def Radiusd.instantiate(arg) radlog(L_DBG,"[ruby]Running ruby instantiate") p arg return Radiusd::RLM_MODULE_OK end def Radiusd.authenticate(arg) radlog(L_DBG,"[ruby]Running ruby authenticate") p arg return Radiusd::RLM_MODULE_NOOP end def Radiusd.authorize(arg) radlog(L_DBG,"[ruby]Running ruby authorize") p arg #Here we return Cleartext-Password, which could have been retrieved from DB. return [Radiusd::RLM_MODULE_UPDATED, [],[["Cleartext-Password","pass"]]] end def Radiusd.accounting(arg) radlog(L_DBG,"[ruby]Running ruby accounting") p arg return Radiusd::RLM_MODULE_NOOP end end freeradius-server/src/modules/rlm_ruby/rlm_ruby.c000066400000000000000000000344631257552170400226260ustar00rootroot00000000000000/* * rlm_ruby.c * * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2008 Andriy Dmytrenko aka Antti, BuzhNET */ #include RCSID("$Id$") #include #include #include /* * Define a structure for our module configuration. * * These variables do not need to be in a structure, but it's * a lot cleaner to do so, and a pointer to the structure can * be used as the instance handle. */ typedef struct rlm_ruby_t { #define RLM_RUBY_STRUCT(foo) int func_##foo RLM_RUBY_STRUCT(instantiate); RLM_RUBY_STRUCT(authorize); RLM_RUBY_STRUCT(authenticate); RLM_RUBY_STRUCT(preacct); RLM_RUBY_STRUCT(accounting); RLM_RUBY_STRUCT(checksimul); RLM_RUBY_STRUCT(preproxy); RLM_RUBY_STRUCT(postproxy); RLM_RUBY_STRUCT(postauth); #ifdef WITH_COA RLM_RUBY_STRUCT(recvcoa); RLM_RUBY_STRUCT(sendcoa); #endif RLM_RUBY_STRUCT(detach); char *scriptFile; char *moduleName; VALUE pModule_builtin; } rlm_ruby_t; /* * A mapping of configuration file names to internal variables. * * Note that the string is dynamically allocated, so it MUST * be freed. When the configuration file parse re-reads the string, * it free's the old one, and strdup's the new one, placing the pointer * to the strdup'd string into 'config.string'. This gets around * buffer over-flows. */ static const CONF_PARSER module_config[] = { { "scriptfile", PW_TYPE_FILENAME, offsetof(struct rlm_ruby_t, scriptFile), NULL, NULL}, { "modulename", PW_TYPE_STRING_PTR, offsetof(struct rlm_ruby_t, moduleName), NULL, "Radiusd"}, { NULL, -1, 0, NULL, NULL} /* end of module_config */ }; /* * radiusd Ruby functions */ /* radlog wrapper */ static VALUE radlog_rb(VALUE self, VALUE msg_type, VALUE rb_msg) { int status; char *msg; status = FIX2INT(msg_type); msg = STR2CSTR(rb_msg); radlog(status, msg); return Qnil; } /* Tuple to value pair conversion */ static void add_vp_tuple(VALUE_PAIR **vpp, VALUE rb_value, const char *function_name) { int i, outertuplesize; VALUE_PAIR *vp; /* If the Ruby function gave us nil for the tuple, then just return. */ if (NIL_P(rb_value)) { return; } if (TYPE(rb_value) != T_ARRAY) { radlog(L_ERR, "add_vp_tuple, %s: non-array passed", function_name); return; } /* Get the array size. */ outertuplesize = RARRAY(rb_value)->len; for (i = 0; i < outertuplesize; i++) { VALUE pTupleElement = rb_ary_entry(rb_value, i); if ((pTupleElement != 0) && (TYPE(pTupleElement) == T_ARRAY)) { /* Check if it's a pair */ int tuplesize; if ((tuplesize = RARRAY(pTupleElement)->len) != 2) { radlog(L_ERR, "%s: tuple element %d is a tuple " " of size %d. must be 2\n", function_name, i, tuplesize); } else { VALUE pString1, pString2; pString1 = rb_ary_entry(pTupleElement, 0); pString2 = rb_ary_entry(pTupleElement, 1); if ((TYPE(pString1) == T_STRING) && (TYPE(pString2) == T_STRING)) { const char *s1, *s2; /* pairmake() will convert and find any * errors in the pair. */ s1 = STR2CSTR(pString1); s2 = STR2CSTR(pString2); if ((s1 != NULL) && (s2 != NULL)) { radlog(L_DBG, "%s: %s = %s ", function_name, s1, s2); /* xxx Might need to support other T_OP */ vp = pairmake(s1, s2, T_OP_EQ); if (vp != NULL) { pairadd(vpp, vp); radlog(L_DBG, "%s: s1, s2 OK\n", function_name); } else { radlog(L_DBG, "%s: s1, s2 FAILED\n", function_name); } } else { radlog(L_ERR, "%s: string conv failed\n", function_name); } } else { radlog(L_ERR, "%s: tuple element %d must be " "(string, string)", function_name, i); } } } else { radlog(L_ERR, "%s: tuple element %d is not a tuple\n", function_name, i); } } } /* This is the core Ruby function that the others wrap around. * Pass the value-pair print strings in a tuple. * xxx We're not checking the errors. If we have errors, what do we do? */ static int ruby_function(REQUEST *request, int func, VALUE module, const char *function_name) { #define BUF_SIZE 1024 char buf[BUF_SIZE]; /* same size as vp_print buffer */ VALUE_PAIR *vp; VALUE rb_request, rb_result, rb_reply_items, rb_config_items; int n_tuple, return_value; radlog(L_DBG, "Calling ruby function %s which has id: %d\n", function_name, func); /* Return with "OK, continue" if the function is not defined. * TODO: Should check with rb_respond_to each time, just because ruby can define function dynamicly? */ if (func == 0) { return RLM_MODULE_OK; } /* Default return value is "OK, continue" */ return_value = RLM_MODULE_OK; n_tuple = 0; if (request != NULL) { for (vp = request->packet->vps; vp; vp = vp->next) { n_tuple++; } } /* Creating ruby array, that contains arrays of [name,value] Maybe we should use hash instead? Can this names repeat? */ rb_request = rb_ary_new2(n_tuple); if (request != NULL) { for (vp = request->packet->vps; vp; vp = vp->next) { VALUE tmp = rb_ary_new2(2); /* The name. logic from vp_prints, lib/print.c */ if (vp->flags.has_tag) { snprintf(buf, BUF_SIZE, "%s:%d", vp->name, vp->flags.tag); } else { strcpy(buf, vp->name); } VALUE rbString1 = rb_str_new2(buf); /* The value. Use delimiter - don't know what that means */ vp_prints_value(buf, sizeof (buf), vp, 1); VALUE rbString2 = rb_str_new2(buf); rb_ary_push(tmp, rbString1); rb_ary_push(tmp, rbString2); rb_ary_push(rb_request, tmp); } } /* Calling corresponding ruby function, passing request and catching result */ rb_result = rb_funcall(module, func, 1, rb_request); /* Checking result, it can be array of type [result, [array of reply pairs],[array of config pairs]], * It can also be just a fixnum, which is a result itself. */ if (TYPE(rb_result) == T_ARRAY) { if (!FIXNUM_P(rb_ary_entry(rb_result, 0))) { radlog(L_ERR, "First element of an array was not a FIXNUM(Which has to be a return_value)"); } else return_value = FIX2INT(rb_ary_entry(rb_result, 0)); rb_reply_items = rb_ary_entry(rb_result, 1); rb_config_items = rb_ary_entry(rb_result, 2); add_vp_tuple(&request->reply->vps, rb_reply_items, function_name); add_vp_tuple(&request->config_items, rb_config_items, function_name); } else if (FIXNUM_P(rb_result)) { return_value = FIX2INT(rb_result); } return return_value; } static struct varlookup { const char* name; int value; } constants[] = { { "L_DBG", L_DBG}, { "L_AUTH", L_AUTH}, { "L_INFO", L_INFO}, { "L_ERR", L_ERR}, { "L_PROXY", L_PROXY}, { "L_CONS", L_CONS}, { "RLM_MODULE_REJECT", RLM_MODULE_REJECT}, { "RLM_MODULE_FAIL", RLM_MODULE_FAIL}, { "RLM_MODULE_OK", RLM_MODULE_OK}, { "RLM_MODULE_HANDLED", RLM_MODULE_HANDLED}, { "RLM_MODULE_INVALID", RLM_MODULE_INVALID}, { "RLM_MODULE_USERLOCK", RLM_MODULE_USERLOCK}, { "RLM_MODULE_NOTFOUND", RLM_MODULE_NOTFOUND}, { "RLM_MODULE_NOOP", RLM_MODULE_NOOP}, { "RLM_MODULE_UPDATED", RLM_MODULE_UPDATED}, { "RLM_MODULE_NUMCODES", RLM_MODULE_NUMCODES}, { NULL, 0}, }; /* * Import a user module and load a function from it */ static int load_ruby_function(const char *f_name, int *func, VALUE module) { if (f_name == NULL) { *func = 0; } else { *func = rb_intern(f_name); /* rb_intern returns a symbol of a function, not a function itself it can be aplied to any recipient, so we should check it for our module recipient */ if (!rb_respond_to(module, *func)) *func = 0; } radlog(L_DBG, "load_ruby_function %s, result: %d", f_name, *func); return 0; } /* * Do any per-module initialization that is separate to each * configured instance of the module. e.g. set up connections * to external databases, read configuration files, set up * dictionary entries, etc. * * If configuration information is given in the config section * that must be referenced in later calls, store a handle to it * in *instance otherwise put a null pointer there. * */ static int ruby_instantiate(CONF_SECTION *conf, void **instance) { rlm_ruby_t *data; VALUE module; int idx; /* * Initialize Ruby interpreter. Fatal error if this fails. */ radlog(L_DBG, "[rlm_ruby]: ruby_instantiate"); ruby_init(); ruby_init_loadpath(); ruby_script("radiusd"); #warning FIXME: Disabling GC, it will eat your memory, but at least it will be stable. rb_gc_disable(); int status; /* * Set up a storage area for instance data */ data = rad_malloc(sizeof (*data)); if (!data) { return -1; } memset(data, 0, sizeof (*data)); /* * If the configuration parameters can't be parsed, then * fail. */ if (cf_section_parse(conf, data, module_config) < 0) { free(data); return -1; } /* * Setup our 'radiusd' module. */ if ((module = data->pModule_builtin = rb_define_module(data->moduleName)) == 0) { radlog(L_ERR, "Ruby rb_define_module failed"); free(data); return -1; } /* * Load constants into module */ for (idx = 0; constants[idx].name; idx++) rb_define_const(module, constants[idx].name, INT2NUM(constants[idx].value)); /* Add functions into module */ rb_define_module_function(module, "radlog", radlog_rb, 2); if (data->scriptFile == NULL) { /* TODO: What actualy should we do? Exit with module fail? Or continue... but what the point then? */ radlog(L_ERR, "Script File was not set"); } else { radlog(L_DBG, "Loading file %s...", data->scriptFile); rb_load_protect(rb_str_new2(data->scriptFile), 0, &status); if (!status) radlog(L_DBG, "Loaded file %s", data->scriptFile); else radlog(L_ERR, "Error loading file %s status: %d", data->scriptFile, status); } /* * Import user modules. */ #define RLM_RUBY_LOAD(foo) if (load_ruby_function(#foo, &data->func_##foo, data->pModule_builtin)==-1) { \ /* TODO: check if we need to cleanup data */ \ return -1; \ } RLM_RUBY_LOAD(instantiate); RLM_RUBY_LOAD(authenticate); RLM_RUBY_LOAD(authorize); RLM_RUBY_LOAD(preacct); RLM_RUBY_LOAD(accounting); RLM_RUBY_LOAD(checksimul); RLM_RUBY_LOAD(preproxy); RLM_RUBY_LOAD(postproxy); RLM_RUBY_LOAD(postauth); #ifdef WITH_COA RLM_RUBY_LOAD(recvcoa); RLM_RUBY_LOAD(sendcoa); #endif RLM_RUBY_LOAD(detach); *instance = data; /* Call the instantiate function. No request. Use the return value. */ return ruby_function(NULL, data->func_instantiate, data->pModule_builtin, "instantiate"); } #define RLM_RUBY_FUNC(foo) static int ruby_##foo(void *instance, REQUEST *request) \ { \ return ruby_function(request, \ ((struct rlm_ruby_t *)instance)->func_##foo,((struct rlm_ruby_t *)instance)->pModule_builtin, \ #foo); \ } RLM_RUBY_FUNC(authorize) RLM_RUBY_FUNC(authenticate) RLM_RUBY_FUNC(preacct) RLM_RUBY_FUNC(accounting) RLM_RUBY_FUNC(checksimul) RLM_RUBY_FUNC(preproxy) RLM_RUBY_FUNC(postproxy) RLM_RUBY_FUNC(postauth) #ifdef WITH_COA RLM_RUBY_FUNC(recvcoa) RLM_RUBY_FUNC(sendcoa) #endif static int ruby_detach(void *instance) { int return_value; /* Default return value is failure */ return_value = -1; free(instance); ruby_finalize(); ruby_cleanup(0); radlog(L_DBG, "ruby_detach done"); //Ok, we cheat, and returon ok value for now :) return_value = RLM_MODULE_OK; /* Return the specified by the Ruby module */ return return_value; } /* * The module name should be the only globally exported symbol. * That is, everything else should be 'static'. * * If the module needs to temporarily modify it's instantiation * data, the type should be changed to RLM_TYPE_THREAD_UNSAFE. * The server will then take care of ensuring that the module * is single-threaded. */ module_t rlm_ruby = { RLM_MODULE_INIT, "ruby", // RLM_TYPE_THREAD_SAFE, /* type */ RLM_TYPE_THREAD_UNSAFE, /* type, ok, let's be honest, MRI is not yet treadsafe */ ruby_instantiate, /* instantiation */ ruby_detach, /* detach */ { ruby_authenticate, /* authentication */ ruby_authorize, /* authorization */ ruby_preacct, /* preaccounting */ ruby_accounting, /* accounting */ ruby_checksimul, /* checksimul */ ruby_preproxy, /* pre-proxy */ ruby_postproxy, /* post-proxy */ ruby_postauth /* post-auth */ #ifdef WITH_COA , ruby_recvcoa, ruby_sendcoa #endif }, }; freeradius-server/src/modules/rlm_securid/000077500000000000000000000000001257552170400212725ustar00rootroot00000000000000freeradius-server/src/modules/rlm_securid/Makefile000066400000000000000000000010261257552170400227310ustar00rootroot00000000000000# # Makefile # # You MUST edit this file by hand to make it work. # There is NO "configure" script available. # # Version: $Id$ # # # SET THE TARGET # TARGET = #TARGET = rlm_securid SRCS = rlm_securid.c mem.c # # SET THE CORRECT PATH TO THE SECURID FILES # ACE_PATH = /path/to/SECURID81 ARCH = lnx HEADERS = rlm_securid.h RLM_LIBS = -laceclnt # # YOU WILL PROBABLY NEED TO COPY $(ACE_PATH/lib/$(ARCH) to /usr/lib # RLM_CFLAGS = -I$(ACE_PATH)/inc -DUNIX include ../rules.mak $(LT_OBJS): $(HEADERS) freeradius-server/src/modules/rlm_securid/README000066400000000000000000000025641257552170400221610ustar00rootroot00000000000000 This module implements SecurID token checking. It should be listed in the "aythenticate" section. The module configuration is in the "securid" file. You will need to copy it by hand to the raddb/modules/directory. There is no "configure" script. Instead, you MUST edit the "Makefile" by hand in order to build the module. See the Makefile for instructions. Many people will wonder about the license issues involved in distributing this module. The short answer is that the source can be distributed, the binaries cannot be distributed. The explanation is given below. This module falls under the GPLv2 license. The primary goal of this license is largely to ensure that you have access to the source code, which is included here. A secondary goal of this license is to ensure that binary distributions can be re-built from the existing source code. This is done by requiring binary distributions to offer source code for the GPLd binary, and to distribute ALL DEPENDENT LIBRARIES. The RSA libraries are proprietary to RSA, and cannot be distributed. Therefore, any library (rlm_securid.a, rlm_securid.so, etc.) CANNOT be distributed by ANYONE. The module is still useful, of course. The GPL restriction on distribution apply only on distribution to third parties. This means that building the module, and using it within your organization is allowed under the GPL. freeradius-server/src/modules/rlm_securid/mem.c000066400000000000000000000204151257552170400222160ustar00rootroot00000000000000/* * mem.c Session handling, mostly taken from src/modules/rlm_eap/mem.c * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2011 The FreeRADIUS server project * Copyright 201 Alan DeKok */ #include #include #include "rlm_securid.h" static void securid_sessionlist_clean_expired(rlm_securid_t *inst, REQUEST *request, time_t timestamp); static SECURID_SESSION* securid_sessionlist_delete(rlm_securid_t *inst, SECURID_SESSION *session); SECURID_SESSION* securid_session_alloc(void) { SECURID_SESSION *session; session = rad_malloc(sizeof(SECURID_SESSION)); memset(session, 0, sizeof(SECURID_SESSION)); session->sdiHandle = SDI_HANDLE_NONE; return session; } void securid_session_free(rlm_securid_t *inst,REQUEST *request, SECURID_SESSION *session) { if (!session) return; RDEBUG2("Freeing session id=%d identity='%s' state='%s'", session->session_id,SAFE_STR(session->identity),session->state); if (session->identity) { free(session->identity); session->identity = NULL; } if (session->pin) { free(session->pin); session->pin = NULL; } if (session->sdiHandle != SDI_HANDLE_NONE) { SD_Close(session->sdiHandle); session->sdiHandle = SDI_HANDLE_NONE; } free(session); } void securid_sessionlist_free(rlm_securid_t *inst,REQUEST *request) { SECURID_SESSION *node, *next; pthread_mutex_lock(&(inst->session_mutex)); for (node = inst->session_head; node != NULL; node = next) { next = node->next; securid_session_free(inst,request,node); } inst->session_head = inst->session_tail = NULL; pthread_mutex_unlock(&(inst->session_mutex)); } /* * Add a session to the set of active sessions. * * Since we're adding it to the list, we guess that this means * the packet needs a State attribute. So add one. */ int securid_sessionlist_add(rlm_securid_t *inst,REQUEST *request, SECURID_SESSION *session) { int status = 0; VALUE_PAIR *state; rad_assert(session != NULL); rad_assert(request != NULL); /* * The time at which this request was made was the time * at which it was received by the RADIUS server. */ session->timestamp = request->timestamp; session->src_ipaddr = request->packet->src_ipaddr; /* * Playing with a data structure shared among threads * means that we need a lock, to avoid conflict. */ pthread_mutex_lock(&(inst->session_mutex)); /* * If we have a DoS attack, discard new sessions. */ if (rbtree_num_elements(inst->session_tree) >= inst->max_sessions) { securid_sessionlist_clean_expired(inst, request, session->timestamp); goto done; } if (session->session_id == 0) { /* this is a NEW session (we are not inserting an updated session) */ inst->last_session_id++; session->session_id = inst->last_session_id; RDEBUG2("Creating a new session with id=%d\n",session->session_id); } snprintf(session->state,sizeof(session->state)-1,"FRR-CH %d|%d",session->session_id,session->trips+1); RDEBUG2("Inserting session id=%d identity='%s' state='%s' to the session list", session->session_id,SAFE_STR(session->identity),session->state); /* * Generate State, since we've been asked to add it to * the list. */ state = pairmake("State", session->state, T_OP_EQ); if (!state) return -1; state->length = SECURID_STATE_LEN; status = rbtree_insert(inst->session_tree, session); if (status) { /* tree insert SUCCESS */ /* insert the session to the linked list of sessions */ SECURID_SESSION *prev; prev = inst->session_tail; if (prev) { /* insert to the tail of the list */ prev->next = session; session->prev = prev; session->next = NULL; inst->session_tail = session; } else { /* 1st time */ inst->session_head = inst->session_tail = session; session->next = session->prev = NULL; } } /* * Now that we've finished mucking with the list, * unlock it. */ done: pthread_mutex_unlock(&(inst->session_mutex)); if (!status) { pairfree(&state); radlog(L_ERR, "rlm_securid: Failed to store session"); return -1; } pairadd(&(request->reply->vps), state); return 0; } /* * Find existing session if any which matches the State variable in current AccessRequest * Then, release the session from the list, and return it to * the caller. * */ SECURID_SESSION *securid_sessionlist_find(rlm_securid_t *inst, REQUEST *request) { VALUE_PAIR *state; SECURID_SESSION* session; SECURID_SESSION mySession; /* clean expired sessions if any */ pthread_mutex_lock(&(inst->session_mutex)); securid_sessionlist_clean_expired(inst, request, request->timestamp); pthread_mutex_unlock(&(inst->session_mutex)); /* * We key the sessions off of the 'state' attribute */ state = pairfind(request->packet->vps, PW_STATE); if (!state) { return NULL; } if (state->length != SECURID_STATE_LEN) { radlog(L_ERR,"rlm_securid: Invalid State variable. length=%d",state->length); return NULL; } memset(&mySession,0,sizeof(mySession)); mySession.src_ipaddr = request->packet->src_ipaddr; memcpy(mySession.state, state->vp_strvalue, sizeof(mySession.state)); /* * Playing with a data structure shared among threads * means that we need a lock, to avoid conflict. */ pthread_mutex_lock(&(inst->session_mutex)); session = securid_sessionlist_delete(inst, &mySession); pthread_mutex_unlock(&(inst->session_mutex)); /* * Might not have been there. */ if (!session) { radlog(L_ERR,"rlm_securid: No SECURID session matching the State variable."); return NULL; } RDEBUG2("Session found identity='%s' state='%s', released from the list", SAFE_STR(session->identity),session->state); if (session->trips >= inst->max_trips_per_session) { RDEBUG2("More than %d authentication packets for this SECURID session. Aborted.",inst->max_trips_per_session); securid_session_free(inst,request,session); return NULL; } session->trips++; return session; } /************ private functions *************/ static SECURID_SESSION *securid_sessionlist_delete(rlm_securid_t *inst, SECURID_SESSION *session) { rbnode_t *node; node = rbtree_find(inst->session_tree, session); if (!node) return NULL; session = rbtree_node2data(inst->session_tree, node); /* * Delete old session from the tree. */ rbtree_delete(inst->session_tree, node); /* * And unsplice it from the linked list. */ if (session->prev) { session->prev->next = session->next; } else { inst->session_head = session->next; } if (session->next) { session->next->prev = session->prev; } else { inst->session_tail = session->prev; } session->prev = session->next = NULL; return session; } static void securid_sessionlist_clean_expired(rlm_securid_t *inst, REQUEST *request, time_t timestamp) { int num_sessions; SECURID_SESSION *session; num_sessions = rbtree_num_elements(inst->session_tree); RDEBUG2("There are %d sessions in the tree\n",num_sessions); /* * Delete old sessions from the list * */ while((session = inst->session_head)) { if ((timestamp - session->timestamp) > inst->timer_limit) { rbnode_t *node; node = rbtree_find(inst->session_tree, session); rad_assert(node != NULL); rbtree_delete(inst->session_tree, node); /* * session == inst->session_head */ inst->session_head = session->next; if (session->next) { session->next->prev = NULL; } else { inst->session_head = NULL; inst->session_tail = NULL; } RDEBUG2("Cleaning expired session: identity='%s' state='%s'\n", SAFE_STR(session->identity),session->state); securid_session_free(inst,request,session); } else { /* no need to check all sessions since they are sorted by age */ break; } } } freeradius-server/src/modules/rlm_securid/rlm_securid.c000066400000000000000000000443511257552170400237550ustar00rootroot00000000000000/* * rlm_securid.c * * Version: $Id$ * * supports "next-token code" and "new-pin" modes * * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2011 The FreeRADIUS server project * Copyright 2011 Alan DeKok */ #include #include #include #include #include "rlm_securid.h" typedef enum { RC_SECURID_AUTH_SUCCESS = 0, RC_SECURID_AUTH_FAILURE = -3, RC_SECURID_AUTH_ACCESS_DENIED_FAILURE = -4, RC_SECURID_AUTH_INVALID_SERVER_FAILURE = -5, RC_SECURID_AUTH_CHALLENGE = -17 } SECURID_AUTH_RC; static const CONF_PARSER module_config[] = { { "timer_expire", PW_TYPE_INTEGER, offsetof(rlm_securid_t, timer_limit), NULL, "600"}, { "max_sessions", PW_TYPE_INTEGER, offsetof(rlm_securid_t, max_sessions), NULL, "2048"}, { "max_trips_per_session", PW_TYPE_INTEGER, offsetof(rlm_securid_t, max_trips_per_session), NULL, NULL}, { "max_round_trips", PW_TYPE_INTEGER, offsetof(rlm_securid_t, max_trips_per_session), NULL, "6"}, { NULL, -1, 0, NULL, NULL } /* end the list */ }; /* comparison function to find session in the tree */ static int securid_session_cmp(const void *a, const void *b) { int rcode; const SECURID_SESSION *one = a; const SECURID_SESSION *two = b; rad_assert(one != NULL); rad_assert(two != NULL); rcode = fr_ipaddr_cmp(&one->src_ipaddr, &two->src_ipaddr); if (rcode != 0) return rcode; return memcmp(one->state, two->state, sizeof(one->state)); } static SECURID_AUTH_RC securidAuth(void *instance, REQUEST *request, const char* username, const char* passcode, char* replyMsgBuffer,int replyMsgBufferSize) { rlm_securid_t *inst = (rlm_securid_t *) instance; int acmRet; SD_PIN pinParams; char newPin[10]; char format[30]; SECURID_SESSION *pSecurid_session=NULL; int rc=-1; if (!username) { radlog(L_ERR, "SecurID username is NULL"); return RC_SECURID_AUTH_FAILURE; } if (!passcode) { radlog(L_ERR, "SecurID passcode is NULL for %s user",username); return RC_SECURID_AUTH_FAILURE; } *replyMsgBuffer = '\0'; pSecurid_session = securid_sessionlist_find(inst,request); if (pSecurid_session == NULL) { /* securid session not found */ SDI_HANDLE sdiHandle = SDI_HANDLE_NONE; acmRet = SD_Init(&sdiHandle); if (acmRet != ACM_OK) { radlog(L_ERR, "Cannot communicate with the ACE/Server"); return -1; } acmRet = SD_Lock(sdiHandle, (SD_CHAR*)username); if (acmRet != ACM_OK) { radlog(L_ERR,"SecurID: Access denied. Name [%s] lock failed.",username); return -2; } acmRet = SD_Check(sdiHandle, (SD_CHAR*) passcode, (SD_CHAR*) username); switch (acmRet) { case ACM_OK: /* we are in now */ RDEBUG("SecurID authentication successful for %s.", username); SD_Close(sdiHandle); return RC_SECURID_AUTH_SUCCESS; case ACM_ACCESS_DENIED: /* not this time */ RDEBUG("SecurID Access denied for %s", username); SD_Close(sdiHandle); return RC_SECURID_AUTH_ACCESS_DENIED_FAILURE; case ACM_INVALID_SERVER: radlog(L_ERR,"SecurID: Invalid ACE server."); return RC_SECURID_AUTH_INVALID_SERVER_FAILURE; case ACM_NEW_PIN_REQUIRED: RDEBUG2("SecurID new pin required for %s", username); /* create a new session */ pSecurid_session = securid_session_alloc(); pSecurid_session->sdiHandle = sdiHandle; /* save ACE handle for future use */ pSecurid_session->securidSessionState = NEW_PIN_REQUIRED_STATE; pSecurid_session->identity = strdup(username); /* Get PIN requirements */ acmRet = AceGetPinParams(sdiHandle, &pinParams); /* If a system-generated PIN is required */ if (pinParams.Selectable == CANNOT_CHOOSE_PIN) { /* Prompt user to accept a system generated PIN */ snprintf(replyMsgBuffer, replyMsgBufferSize, "\r\nAre you prepared to accept a new system-generated PIN [y/n]?"); pSecurid_session->securidSessionState = NEW_PIN_SYSTEM_ACCEPT_STATE; } else if (pinParams.Selectable == USER_SELECTABLE) { //may be returned by AM 6.x servers. snprintf(replyMsgBuffer, replyMsgBufferSize, "\r\nPress 'y' to generate a new PIN\r\nOR\r\n'n'to enter a new PIN yourself [y/n]"); pSecurid_session->securidSessionState = NEW_PIN_USER_SELECT_STATE; } else { if (pinParams.Alphanumeric) { strcpy(format, "alphanumeric characters"); } else { strcpy(format, "digits"); } snprintf(replyMsgBuffer, replyMsgBufferSize, " \r\n Enter your new PIN of %d to %d %s,\r\n or\r\n to cancel the New PIN procedure:", pinParams.Min, pinParams.Max, format); } /* insert new session in the session list */ securid_sessionlist_add(inst,request,pSecurid_session); return RC_SECURID_AUTH_CHALLENGE; case ACM_NEXT_CODE_REQUIRED: RDEBUG2("Next securid token code required for %s", username); /* create a new session */ pSecurid_session = securid_session_alloc(); pSecurid_session->sdiHandle = sdiHandle; pSecurid_session->securidSessionState = NEXT_CODE_REQUIRED_STATE; pSecurid_session->identity = strdup(username); /* insert new session in the session list */ securid_sessionlist_add(inst,request,pSecurid_session); strlcpy(replyMsgBuffer, "\r\nPlease Enter the Next Code from Your Token:", replyMsgBufferSize); return RC_SECURID_AUTH_CHALLENGE; default: radlog(L_ERR,"SecurID: Unexpected error from ACE/Agent API acmRet=%d",acmRet); return RC_SECURID_AUTH_FAILURE; } } else { /* existing session found */ RDEBUG("Continuing previous session found for user [%s]",username); /* continue previous session */ switch (pSecurid_session->securidSessionState) { case NEXT_CODE_REQUIRED_STATE: DEBUG2("Securid NEXT_CODE_REQUIRED_STATE: User [%s]",username); /* next token code mode */ acmRet = SD_Next(pSecurid_session->sdiHandle, (SD_CHAR*)passcode); if (acmRet == ACM_OK) { radlog(L_INFO,"Next SecurID token accepted for [%s].",pSecurid_session->identity); rc = RC_SECURID_AUTH_SUCCESS; } else { radlog(L_INFO,"SecurID: Next token rejected for [%s].",pSecurid_session->identity); rc = RC_SECURID_AUTH_FAILURE; } /* deallocate session */ securid_session_free(inst,request,pSecurid_session); return rc; case NEW_PIN_REQUIRED_STATE: RDEBUG2("SecurID NEW_PIN_REQUIRED_STATE for %s", username); /* save the previous pin */ if (pSecurid_session->pin) { free(pSecurid_session->pin); pSecurid_session->pin = NULL; } pSecurid_session->pin = strdup(passcode); strlcpy(replyMsgBuffer,"\r\n Please re-enter new PIN:", replyMsgBufferSize); /* set next state */ pSecurid_session->securidSessionState = NEW_PIN_USER_CONFIRM_STATE; /* insert the updated session in the session list */ securid_sessionlist_add(inst,request,pSecurid_session); return RC_SECURID_AUTH_CHALLENGE; case NEW_PIN_USER_CONFIRM_STATE: RDEBUG2("SecurID NEW_PIN_USER_CONFIRM_STATE: User [%s]",username); /* compare previous pin and current pin */ if (!pSecurid_session->pin || strcmp(pSecurid_session->pin,passcode)) { RDEBUG2("Pin confirmation failed. Pins do not match [%s] and [%s]", SAFE_STR(pSecurid_session->pin), passcode); /* pins do not match */ /* challenge the user again */ AceGetPinParams(pSecurid_session->sdiHandle, &pinParams); if (pinParams.Alphanumeric) { strcpy(format, "alphanumeric characters"); } else { strcpy(format, "digits"); } snprintf(replyMsgBuffer, replyMsgBufferSize, " \r\n Pins do not match--Please try again.\r\n Enter your new PIN of %d to %d %s,\r\n or\r\n to cancel the New PIN procedure:", pinParams.Min, pinParams.Max, format); pSecurid_session->securidSessionState = NEW_PIN_REQUIRED_STATE; /* insert the updated session in the session list */ securid_sessionlist_add(inst,request,pSecurid_session); rc = RC_SECURID_AUTH_CHALLENGE; } else { /* pins match */ RDEBUG2("Pin confirmation succeeded. Pins match"); acmRet = SD_Pin(pSecurid_session->sdiHandle, (SD_CHAR*)passcode); if (acmRet == ACM_NEW_PIN_ACCEPTED) { RDEBUG("New SecurID pin accepted for %s.",pSecurid_session->identity); pSecurid_session->securidSessionState = NEW_PIN_AUTH_VALIDATE_STATE; /* insert the updated session in the session list */ securid_sessionlist_add(inst,request,pSecurid_session); rc = RC_SECURID_AUTH_CHALLENGE; strlcpy(replyMsgBuffer," \r\n\r\nWait for the code on your card to change, then enter new PIN and TokenCode\r\n\r\nEnter PASSCODE:", replyMsgBufferSize); } else { RDEBUG("SecurID: New SecurID pin rejected for %s.",pSecurid_session->identity); SD_Pin(pSecurid_session->sdiHandle, (SD_CHAR*)""); /* cancel PIN */ rc = RC_SECURID_AUTH_FAILURE; /* deallocate session */ securid_session_free(inst, request, pSecurid_session); } } return rc; case NEW_PIN_AUTH_VALIDATE_STATE: acmRet = SD_Check(pSecurid_session->sdiHandle, (SD_CHAR*)passcode, (SD_CHAR*)username); if (acmRet == ACM_OK) { RDEBUG("New SecurID passcode accepted for %s.", pSecurid_session->identity); rc = RC_SECURID_AUTH_SUCCESS; } else { radlog(L_INFO,"SecurID: New passcode rejected for [%s].",pSecurid_session->identity); rc = RC_SECURID_AUTH_FAILURE; } /* deallocate session */ securid_session_free(inst,request,pSecurid_session); return rc; case NEW_PIN_SYSTEM_ACCEPT_STATE: if (!strcmp(passcode, "y")) { AceGetSystemPin(pSecurid_session->sdiHandle, newPin); /* Save the PIN for the next session * continuation */ if (pSecurid_session->pin) { free(pSecurid_session->pin); pSecurid_session->pin = NULL; } pSecurid_session->pin = strdup(newPin); snprintf(replyMsgBuffer, replyMsgBufferSize, "\r\nYour new PIN is: %s\r\nDo you accept this [y/n]?", newPin); pSecurid_session->securidSessionState = NEW_PIN_SYSTEM_CONFIRM_STATE; /* insert the updated session in the * session list */ securid_sessionlist_add(inst, request, pSecurid_session); rc = RC_SECURID_AUTH_CHALLENGE; } else { SD_Pin(pSecurid_session->sdiHandle, (SD_CHAR*)""); //Cancel new PIN /* deallocate session */ securid_session_free(inst, request, pSecurid_session); rc = RC_SECURID_AUTH_FAILURE; } return rc; case NEW_PIN_SYSTEM_CONFIRM_STATE: acmRet = SD_Pin(pSecurid_session->sdiHandle, (SD_CHAR*)pSecurid_session->pin); if (acmRet == ACM_NEW_PIN_ACCEPTED) { strlcpy(replyMsgBuffer," \r\n\r\nPin Accepted. Wait for the code on your card to change, then enter new PIN and TokenCode\r\n\r\nEnter PASSCODE:",replyMsgBufferSize); pSecurid_session->securidSessionState = NEW_PIN_AUTH_VALIDATE_STATE; /* insert the updated session in the session list */ securid_sessionlist_add(inst,request,pSecurid_session); rc = RC_SECURID_AUTH_CHALLENGE; } else { SD_Pin(pSecurid_session->sdiHandle, (SD_CHAR*)""); //Cancel new PIN strlcpy(replyMsgBuffer," \r\n\r\nPin Rejected. Wait for the code on your card to change, then try again.\r\n\r\nEnter PASSCODE:",replyMsgBufferSize); /* deallocate session */ securid_session_free(inst, request, pSecurid_session); rc = RC_SECURID_AUTH_FAILURE; } return rc; /* USER_SELECTABLE state should be implemented to preserve compatibility with AM 6.x servers, which can return this state */ case NEW_PIN_USER_SELECT_STATE: if (!strcmp(passcode, "y")) { /* User has opted for a system-generated PIN */ AceGetSystemPin(pSecurid_session->sdiHandle, newPin); snprintf(replyMsgBuffer, replyMsgBufferSize, "\r\nYour new PIN is: %s\r\nDo you accept this [y/n]?", newPin); pSecurid_session->securidSessionState = NEW_PIN_SYSTEM_CONFIRM_STATE; /* insert the updated session in the session list */ securid_sessionlist_add(inst, request, pSecurid_session); rc = RC_SECURID_AUTH_CHALLENGE; } else { /* User has opted for a user-defined PIN */ AceGetPinParams(pSecurid_session->sdiHandle, &pinParams); if (pinParams.Alphanumeric) { strcpy(format, "alphanumeric characters"); } else { strcpy(format, "digits"); } snprintf(replyMsgBuffer, replyMsgBufferSize, " \r\n Enter your new PIN of %d to %d %s,\r\n or\r\n to cancel the New PIN procedure:", pinParams.Min, pinParams.Max, format); pSecurid_session->securidSessionState = NEW_PIN_REQUIRED_STATE; /* insert the updated session in the session list */ securid_sessionlist_add(inst, request, pSecurid_session); rc = RC_SECURID_AUTH_CHALLENGE; } return rc; default: radlog(L_ERR|L_CONS, "rlm_securid: Invalid session state %d for user [%s]", pSecurid_session->securidSessionState, username); break; } } return 0; } /******************************************/ static int securid_detach(void *instance) { rlm_securid_t *inst = (rlm_securid_t *) instance; /* delete session tree */ if (inst->session_tree) { rbtree_free(inst->session_tree); inst->session_tree = NULL; } pthread_mutex_destroy(&(inst->session_mutex)); free(inst); return 0; } static int securid_instantiate(CONF_SECTION *conf, void **instance) { rlm_securid_t *inst; /* Set up a storage area for instance data */ inst = rad_malloc(sizeof(*inst)); if (!inst) return -1; memset(inst, 0, sizeof(*inst)); /* If the configuration parameters can't be parsed, then fail. */ if (cf_section_parse(conf, inst, module_config) < 0) { radlog(L_ERR|L_CONS, "rlm_securid: Unable to parse configuration section."); securid_detach(inst); return -1; } /* * Lookup sessions in the tree. We don't free them in * the tree, as that's taken care of elsewhere... */ inst->session_tree = rbtree_create(securid_session_cmp, NULL, 0); if (!inst->session_tree) { radlog(L_ERR|L_CONS, "rlm_securid: Cannot initialize session tree."); securid_detach(inst); return -1; } pthread_mutex_init(&(inst->session_mutex), NULL); *instance = inst; return 0; } /* * Authenticate the user via one of any well-known password. */ static int securid_authenticate(void *instance, REQUEST *request) { int rcode; rlm_securid_t *inst = instance; VALUE_PAIR *module_fmsg_vp; VALUE_PAIR *vp; char buffer[MAX_STRING_LEN]=""; const char *username=NULL, *password=NULL; char module_fmsg[MAX_STRING_LEN]=""; /* * We can only authenticate user requests which HAVE * a User-Name attribute. */ if (!request->username) { radlog(L_AUTH, "rlm_securid: Attribute \"User-Name\" is required for authentication."); return RLM_MODULE_INVALID; } if (!request->password) { radlog_request(L_AUTH, 0, request, "Attribute \"Password\" is required for authentication."); return RLM_MODULE_INVALID; } /* * Clear-text passwords are the only ones we support. */ if (request->password->attribute != PW_USER_PASSWORD) { radlog_request(L_AUTH, 0, request, "Attribute \"User-Password\" is required for authentication. Cannot use \"%s\".", request->password->name); return RLM_MODULE_INVALID; } /* * The user MUST supply a non-zero-length password. */ if (request->password->length == 0) { snprintf(module_fmsg,sizeof(module_fmsg),"rlm_securid: empty password supplied"); module_fmsg_vp = pairmake("Module-Failure-Message", module_fmsg, T_OP_EQ); pairadd(&request->packet->vps, module_fmsg_vp); return RLM_MODULE_INVALID; } /* * shortcuts */ username = request->username->vp_strvalue; password = request->password->vp_strvalue; RDEBUG("User [%s] login attempt with password [%s]", username, password); rcode = securidAuth(inst, request, username, password, buffer, sizeof(buffer)); switch (rcode) { case RC_SECURID_AUTH_SUCCESS: rcode = RLM_MODULE_OK; break; case RC_SECURID_AUTH_CHALLENGE: /* reply with Access-challenge message code (11) */ /* Generate Prompt attribute */ vp = paircreate(PW_PROMPT, PW_TYPE_INTEGER); rad_assert(vp != NULL); vp->vp_integer = 0; /* no echo */ pairadd(&request->reply->vps, vp); /* Mark the packet as a Acceess-Challenge Packet */ request->reply->code = PW_ACCESS_CHALLENGE; RDEBUG("Sending Access-Challenge."); rcode = RLM_MODULE_HANDLED; break; case RC_SECURID_AUTH_FAILURE: case RC_SECURID_AUTH_ACCESS_DENIED_FAILURE: case RC_SECURID_AUTH_INVALID_SERVER_FAILURE: default: rcode = RLM_MODULE_REJECT; break; } if (*buffer) { /* Generate Reply-Message attribute with reply message data */ vp = pairmake("Reply-Message", buffer, T_OP_EQ); /* make sure message ends with '\0' */ if (vp->length < (int) sizeof(vp->vp_strvalue)) { vp->vp_strvalue[vp->length] = '\0'; vp->length++; } pairadd(&request->reply->vps,vp); } return rcode; } /* * The module name should be the only globally exported symbol. * That is, everything else should be 'static'. * * If the module needs to temporarily modify it's instantiation * data, the type should be changed to RLM_TYPE_THREAD_UNSAFE. * The server will then take care of ensuring that the module * is single-threaded. */ module_t rlm_securid = { RLM_MODULE_INIT, "securid", RLM_TYPE_CHECK_CONFIG_SAFE | RLM_TYPE_HUP_SAFE, /* type */ securid_instantiate, /* instantiation */ securid_detach, /* detach */ { securid_authenticate, /* authentication */ NULL, /* authorization */ NULL, /* preaccounting */ NULL, /* accounting */ NULL, /* checksimul */ NULL, /* pre-proxy */ NULL, /* post-proxy */ NULL /* post-auth */ }, }; freeradius-server/src/modules/rlm_securid/rlm_securid.h000066400000000000000000000052371257552170400237620ustar00rootroot00000000000000#ifndef _RLM_SECURID_H #define _RLM_SECURID_H #include #include #include #include #include "acexport.h" #define SAFE_STR(s) s==NULL?"EMPTY":s typedef enum { INITIAL_STATE = 0, NEXT_CODE_REQUIRED_STATE = 100, NEW_PIN_REQUIRED_STATE = 200, NEW_PIN_USER_CONFIRM_STATE = 201, NEW_PIN_AUTH_VALIDATE_STATE = 202, NEW_PIN_SYSTEM_ACCEPT_STATE = 203, NEW_PIN_SYSTEM_CONFIRM_STATE = 204, NEW_PIN_USER_SELECT_STATE = 205 } SECURID_SESSION_STATE; /* * SECURID_SESSION is used to identify existing securID sessions * to continue Next-Token code and New-Pin conversations with a client * * next = pointer to next * state = state attribute from the reply we sent * state_len = length of data in the state attribute. * src_ipaddr = client which sent us the RADIUS request containing * this SecurID conversation. * timestamp = timestamp when this handler was last used. * trips = number of trips * identity = Identity of the user * request = RADIUS request data structure */ #define SECURID_STATE_LEN 32 typedef struct _securid_session_t { struct _securid_session_t *prev, *next; SDI_HANDLE sdiHandle; SECURID_SESSION_STATE securidSessionState; uint8_t state[SECURID_STATE_LEN]; fr_ipaddr_t src_ipaddr; time_t timestamp; unsigned int session_id; int trips; char *pin; /* previous pin if user entered it during NEW-PIN mode process */ char *identity; /* save user's identity name for future use */ } SECURID_SESSION; /* * Define a structure for our module configuration. * * These variables do not need to be in a structure, but it's * a lot cleaner to do so, and a pointer to the structure can * be used as the instance handle. * sessions = remembered sessions, in a tree for speed. * mutex = ensure only one thread is updating the sessions list */ typedef struct rlm_securid_t { pthread_mutex_t session_mutex; rbtree_t* session_tree; SECURID_SESSION *session_head, *session_tail; unsigned int last_session_id; /* * Configuration items. */ int timer_limit; int max_sessions; int max_trips_per_session; } rlm_securid_t; /* Memory Management */ SECURID_SESSION* securid_session_alloc(void); void securid_session_free(rlm_securid_t *inst, REQUEST *request,SECURID_SESSION *session); void securid_sessionlist_free(rlm_securid_t *inst,REQUEST *request); int securid_sessionlist_add(rlm_securid_t *inst, REQUEST *request, SECURID_SESSION *session); SECURID_SESSION* securid_sessionlist_find(rlm_securid_t *inst, REQUEST *request); #endif freeradius-server/src/modules/rlm_securid/securid000066400000000000000000000006741257552170400226620ustar00rootroot00000000000000# # This is the configuration for the "securid" module. # It should be copied to raddb/modules/ # securid { # How long the module waits before expiring a session. # timer_expire = 600 # The sessions are tracked internally. This configuration # item limits the total number of allowed sessions. # max_sessions = 2048 # How many round trips are allowed before the authentication # is forced to fail. # max_round_trips = 6 } freeradius-server/src/modules/rlm_sim_files/000077500000000000000000000000001257552170400216065ustar00rootroot00000000000000freeradius-server/src/modules/rlm_sim_files/Makefile000066400000000000000000000001041257552170400232410ustar00rootroot00000000000000TARGET = rlm_sim_files SRCS = rlm_sim_files.c include ../rules.mak freeradius-server/src/modules/rlm_sim_files/rlm_sim_files.c000066400000000000000000000147211257552170400246030ustar00rootroot00000000000000/* * rlm_sim_files.c authorization: Find a SIM user in the "simtriplets" * file. * * Version: $Id$ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2004 Michael Richardson * Copyright 2006 The FreeRADIUS server project * * (Adapted from rlm_files/rlm_files.c ) */ /* * this is an authorization-only module that walks the file every time. * * this is an example of getting data for rlm_eap_sim from an external * place. * * in a real system, this would be replaced with a lookup to the SS7 * network, but those interfaces are distinctly non-standard, and might * even be totally proprietary * */ /* FILE FORMAT * * * The triplets file contains records of the form: * * IMSI RAND SRES Kc * 232420100000015,30000000000000000000000000000000,30112233,445566778899AABB * * there must be *three* entries for every IMSI for it to be considered valid. * * Lines starting with # are ignored. * * Conveniently, this file format is produced by XXXX. * */ #include RCSID("$Id$") #include #include #include #include #include #include #include #include "../rlm_eap/libeap/eap_sim.h" struct sim_file_instance { /* autz */ char *file; }; static const CONF_PARSER module_config[] = { { "simtriplets", PW_TYPE_STRING_PTR, offsetof(struct sim_file_instance, file), NULL, "${raddbdir}/simtriplets.dat" }, { NULL, -1, 0, NULL, NULL } }; /* * (Re-)read the "users" file into memory. */ static int sim_file_instantiate(CONF_SECTION *conf, void **instance) { struct sim_file_instance *inst; inst = rad_malloc(sizeof *inst); if (!inst) { return -1; } memset(inst, 0, sizeof(*inst)); if (cf_section_parse(conf, inst, module_config) < 0) { free(inst); return -1; } *instance = inst; return 0; } /* * Find the named user in the database. Create the * set of attribute-value pairs to check and reply with * for this user from the database. The main code only * needs to check the password, the rest is done here. */ static int sim_file_authorize(void *instance, REQUEST *request) { VALUE_PAIR *namepair; VALUE_PAIR *reply_tmp; const char *name; struct sim_file_instance *inst = instance; VALUE_PAIR **reply_pairs; VALUE_PAIR **config_pairs; FILE *triplets; char tripbuf[sizeof("232420100000015,30000000000000000000000000000000,30112233,445566778899AABB")*2]; char imsi[128], chal[256], kc[128], sres[128]; int imsicount; int fieldcount; int lineno; reply_pairs = &request->reply->vps; config_pairs = &request->config_items; /* * Grab the canonical user name. */ namepair = request->username; name = namepair ? (char *) namepair->vp_strvalue : "NONE"; triplets = fopen(inst->file, "r"); if(triplets == NULL) { radlog(L_ERR, "can not open %s: %s", inst->file, strerror(errno)); return RLM_MODULE_NOTFOUND; } imsicount = 0; lineno = 0; while(fgets(tripbuf, sizeof(tripbuf), triplets) == tripbuf && imsicount < 3) { char *f; char *l; VALUE_PAIR *r, *k, *s; lineno++; if(tripbuf[0]=='#') continue; l = tripbuf; fieldcount = 0; chal[0]='0'; chal[1]='x'; kc[0]='0'; kc[1]='x'; sres[0]='0'; sres[1]='x'; f = strsep(&l, ","); if(f) { strlcpy(imsi, f, sizeof(imsi)); fieldcount++; } if(strcmp(imsi, name) != 0) { continue; } /* we found one */ f = strsep(&l, ","); if(f) { strlcpy(chal + 2, f, sizeof(chal) - 2); fieldcount++; } f = strsep(&l, ","); if(f) { strlcpy(sres + 2, f, sizeof(sres) - 2); fieldcount++; } f = strsep(&l, ",\n"); if(f) { strlcpy(kc + 2, f, sizeof(kc) - 2); fieldcount++; } if(fieldcount != 4) { radlog(L_ERR, "invalid number of fields %d at line %d", fieldcount, lineno); /* complain about malformed line */ continue; } r = paircreate(ATTRIBUTE_EAP_SIM_RAND1 + imsicount, PW_TYPE_OCTETS); r = pairparsevalue(r, chal); pairadd(reply_pairs, r); k = paircreate(ATTRIBUTE_EAP_SIM_KC1 + imsicount, PW_TYPE_OCTETS); k = pairparsevalue(k, kc); if (!k) { DEBUG("ERROR: Syntax error in line %d", lineno); break; } pairadd(reply_pairs, k); s = paircreate(ATTRIBUTE_EAP_SIM_SRES1 + imsicount, PW_TYPE_OCTETS); s = pairparsevalue(s, sres); pairadd(reply_pairs, s); imsicount++; } fclose(triplets); if (imsicount < 3) { DEBUG("rlm_sim_files: " "insufficient number of challenges for imsi %s: %d\n", name, imsicount); return RLM_MODULE_NOTFOUND; } DEBUG("rlm_sim_files: " "authorized user/imsi %s\n", name); /* * EAP module will also grab based upon presence of EAP packet * and it will add the Autz-Type entry. */ if((reply_tmp = pairmake ("EAP-Type", "SIM", T_OP_EQ))) { radlog(L_INFO, "rlm_sim_files: Adding EAP-Type: eap-sim"); pairadd (config_pairs, reply_tmp); } #if 0 DEBUG("rlm_sim_files: saw config"); debug_pair_list(*config_pairs); DEBUG("rlm_sim_files: saw reply"); debug_pair_list(*reply_pairs); #endif return RLM_MODULE_OK; } /* * Clean up. */ static int sim_file_detach(void *instance) { struct sim_file_instance *inst = instance; free(inst); return 0; } /* globally exported name */ module_t rlm_sim_files = { RLM_MODULE_INIT, "sim_files", 0, /* type: reserved */ sim_file_instantiate, /* instantiation */ sim_file_detach, /* detach */ { NULL, /* authentication */ sim_file_authorize, /* authorization */ NULL, /* preaccounting */ NULL, /* accounting */ NULL, /* checksimul */ NULL, /* pre-proxy */ NULL, /* post-proxy */ NULL /* post-auth */ }, }; freeradius-server/src/modules/rlm_smb/000077500000000000000000000000001257552170400204155ustar00rootroot00000000000000freeradius-server/src/modules/rlm_smb/Makefile.in000066400000000000000000000007171257552170400224670ustar00rootroot00000000000000# # $Id$ # # Edit this by hand if you want it to build. TARGET = SRCS = rlm_smb.c rfcnb-io.c rfcnb-util.c rlm_smb.c session.c \ smbdes.c smbencrypt.c smblib.c smblib-util.c valid.c HEADERS = byteorder.h rfcnb-common.h rfcnb-error.h rfcnb.h rfcnb-io.h \ rfcnb-priv.h rfcnb-util.h smblib-common.h smblib.h \ smblib-priv.h std-includes.h valid.h RLM_LIBS = @smb_ldflags@ RLM_CFLAGS = @smb_cflags@ include ../rules.mak $(LT_OBJS): $(HEADERS) freeradius-server/src/modules/rlm_smb/README000066400000000000000000000007341257552170400213010ustar00rootroot00000000000000 Other than the make file and rlm_smb.c, these source code in this directory was taken from pam_smb, version 1.1.6, located at: http://www.csn.ul.ie/~airlied/pam_smb/ If there are ANY discrepancies between these files and pam_smb, then pam_smb SHOULD be taken to be the definitive source code. rfcnb-util.c has been modified to use FreeRADIUS's ip_getaddr function which does both inet_addr and gethostbyname{,_r} and returns just the uint32_t or INADDR_ANY on failure. freeradius-server/src/modules/rlm_smb/byteorder.h000066400000000000000000000060141257552170400225660ustar00rootroot00000000000000/* Unix SMB/Netbios implementation. Version 1.9. SMB Byte handling Copyright (C) Andrew Tridgell 1992-1995 Copyright 2006 The FreeRADIUS server project This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* This file implements macros for machine independent short and int manipulation */ #include RCSIDH(byteorder_h, "$Id$") #undef CAREFUL_ALIGNMENT /* we know that the 386 can handle misalignment and has the "right" byteorder */ #ifdef __i386__ #define CAREFUL_ALIGNMENT 0 #endif #ifndef CAREFUL_ALIGNMENT #define CAREFUL_ALIGNMENT 1 #endif #define CVAL(buf,pos) (((unsigned char *)(buf))[pos]) #define PVAL(buf,pos) ((unsigned)CVAL(buf,pos)) #define SCVAL(buf,pos,val) (CVAL(buf,pos) = (val)) #if CAREFUL_ALIGNMENT #define SVAL(buf,pos) (PVAL(buf,pos)|PVAL(buf,(pos)+1)<<8) #define IVAL(buf,pos) (SVAL(buf,pos)|SVAL(buf,(pos)+2)<<16) #define SSVALX(buf,pos,val) (CVAL(buf,pos)=(val)&0xFF,CVAL(buf,pos+1)=(val)>>8) #define SIVALX(buf,pos,val) (SSVALX(buf,pos,val&0xFFFF),SSVALX(buf,pos+2,val>>16)) #define SVALS(buf,pos) ((int16)SVAL(buf,pos)) #define IVALS(buf,pos) ((int32)IVAL(buf,pos)) #define SSVAL(buf,pos,val) SSVALX((buf),(pos),((uint16)(val))) #define SIVAL(buf,pos,val) SIVALX((buf),(pos),((uint32)(val))) #define SSVALS(buf,pos,val) SSVALX((buf),(pos),((int16)(val))) #define SIVALS(buf,pos,val) SIVALX((buf),(pos),((int32)(val))) #else /* this handles things for architectures like the 386 that can handle alignment errors */ /* WARNING: This section is dependent on the length of int16 and int32 being correct */ #define SVAL(buf,pos) (*(uint16 *)((char *)(buf) + (pos))) #define IVAL(buf,pos) (*(uint32 *)((char *)(buf) + (pos))) #define SVALS(buf,pos) (*(int16 *)((char *)(buf) + (pos))) #define IVALS(buf,pos) (*(int32 *)((char *)(buf) + (pos))) #define SSVAL(buf,pos,val) SVAL(buf,pos)=((uint16)(val)) #define SIVAL(buf,pos,val) IVAL(buf,pos)=((uint32)(val)) #define SSVALS(buf,pos,val) SVALS(buf,pos)=((int16)(val)) #define SIVALS(buf,pos,val) IVALS(buf,pos)=((int32)(val)) #endif /* now the reverse routines - these are used in nmb packets (mostly) */ #define SREV(x) ((((x)&0xFF)<<8) | (((x)>>8)&0xFF)) #define IREV(x) ((SREV(x)<<16) | (SREV((x)>>16))) #define RSVAL(buf,pos) SREV(SVAL(buf,pos)) #define RIVAL(buf,pos) IREV(IVAL(buf,pos)) #define RSSVAL(buf,pos,val) SSVAL(buf,pos,SREV(val)) #define RSIVAL(buf,pos,val) SIVAL(buf,pos,IREV(val)) freeradius-server/src/modules/rlm_smb/config.h.in000066400000000000000000000042331257552170400224420ustar00rootroot00000000000000/* config.h.in. Generated from configure.in by autoheader. */ /* Define to 1 if you have the header file. */ #undef HAVE_ARPA_INET_H /* Define to 1 if you have the header file. */ #undef HAVE_CTYPE_H /* Define to 1 if you have the header file. */ #undef HAVE_DIRENT_H /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Define to 1 if you have the header file. */ #undef HAVE_NETDB_H /* Define to 1 if you have the header file. */ #undef HAVE_NETINET_IN_H /* Define to 1 if you have the header file. */ #undef HAVE_NETINET_TCP_H /* Define to 1 if you have the header file. */ #undef HAVE_SIGNAL_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 header file. */ #undef HAVE_SYS_SIGNAL_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_SOCKET_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_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_UIO_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_VFS_H /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* 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 version of this package. */ #undef PACKAGE_VERSION /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS freeradius-server/src/modules/rlm_smb/configure000077500000000000000000003700631257552170400223350ustar00rootroot00000000000000#! /bin/sh # From configure.in Revision. # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.61. # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, # 2002, 2003, 2004, 2005, 2006 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=: # 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 # PATH needs CR # 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 # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false 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.) as_nl=' ' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. 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 # Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # CDPATH. $as_unset CDPATH if test "x$CONFIG_SHELL" = x; then if (eval ":") 2>/dev/null; then as_have_required=yes else as_have_required=no fi if test $as_have_required = yes && (eval ": (as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=\$LINENO as_lineno_2=\$LINENO test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } ") 2> /dev/null; then : else as_candidate_shells= as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. case $as_dir in /*) for as_base in sh bash ksh sh5; do as_candidate_shells="$as_candidate_shells $as_dir/$as_base" done;; esac done IFS=$as_save_IFS for as_shell in $as_candidate_shells $SHELL; do # Try only shells that exist, to save several forks. if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { ("$as_shell") 2> /dev/null <<\_ASEOF 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 : _ASEOF }; then CONFIG_SHELL=$as_shell as_have_required=yes if { "$as_shell" 2> /dev/null <<\_ASEOF 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 : (as_func_return () { (exit $1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = "$1" ); then : else exitcode=1 echo positional parameters were not saved. fi test $exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } _ASEOF }; then break fi fi done if test "x$CONFIG_SHELL" != x; then for as_var in BASH_ENV ENV do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done export CONFIG_SHELL exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} fi if test $as_have_required = no; then echo This script requires a shell more modern than all the echo shells that I found on your system. Please install a echo modern shell, or manually run the script under such a echo shell if you do have one. { (exit 1); exit 1; } fi fi fi (eval "as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0") || { echo No shell found that supports shell functions. echo Please tell autoconf@gnu.org about your system, echo including any error possibly output before this echo message } as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, and appends # trailing '-' during substitution so that $LINENO is not a special # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # scripts with optimization help from Paolo Bonzini. 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" || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi 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 fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi 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=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, 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= SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME= PACKAGE_TARNAME= PACKAGE_VERSION= PACKAGE_STRING= PACKAGE_BUGREPORT= ac_unique_file="rlm_smb.c" # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef STDC_HEADERS # include # include #else # ifdef HAVE_STDLIB_H # include # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datarootdir datadir sysconfdir sharedstatedir localstatedir includedir oldincludedir docdir infodir htmldir dvidir pdfdir psdir libdir localedir mandir DEFS ECHO_C ECHO_N ECHO_T LIBS build_alias host_alias target_alias CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP GREP EGREP smb_cflags smb_ldflags targetname LIBOBJS LTLIBOBJS' ac_subst_files='' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CPP' # Initialize some variables set by options. ac_init_help= ac_init_version=false # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *) ac_optarg=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_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` eval enable_$ac_feature=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_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` eval enable_$ac_feature=\$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_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/[-.]/_/g'` eval with_$ac_package=\$ac_optarg ;; -without-* | --without-*) ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/[-.]/_/g'` eval with_$ac_package=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 ;; -*) { echo "$as_me: error: unrecognized option: $ac_option Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && 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'` { echo "$as_me: error: missing argument to $ac_option" >&2 { (exit 1); exit 1; }; } fi # Be sure to have absolute directory names. 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 case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; } 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 echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || { echo "$as_me: error: Working directory cannot be determined" >&2 { (exit 1); exit 1; }; } test "X$ac_ls_di" = "X$ac_pwd_ls_di" || { echo "$as_me: error: pwd does not report name of working directory" >&2 { (exit 1); exit 1; }; } # 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 -- "$0" || $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$0" : 'X\(//\)[^/]' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X"$0" | 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 .." { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2 { (exit 1); exit 1; }; } pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures this package to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF _ACEOF fi if test -n "$ac_init_help"; then cat <<\_ACEOF Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-rlm-smb-lib-dir=DIR Directory for samba library files --with-rlm-smb-include-dir=DIR Directory for samba include files 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 C/C++/Objective C preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. _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" || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`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 echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF configure generated by GNU Autoconf 2.61 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 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 cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by $as_me, which was generated by GNU Autoconf 2.61. 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=. 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=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; 2) ac_configure_args1="$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 ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac done done $as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } $as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export 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 cat <<\_ASBOX ## ---------------- ## ## Cache variables. ## ## ---------------- ## _ASBOX 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_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( *) $as_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 cat <<\_ASBOX ## ----------------- ## ## Output variables. ## ## ----------------- ## _ASBOX echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then cat <<\_ASBOX ## ------------------- ## ## File substitutions. ## ## ------------------- ## _ASBOX echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then cat <<\_ASBOX ## ----------- ## ## confdefs.h. ## ## ----------- ## _ASBOX echo cat confdefs.h echo fi test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" 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'; { (exit 1); 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 # 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 # Let the site file select an alternate cache file if it wants to. # Prefer explicitly selected file to automatically selected ones. if test -n "$CONFIG_SITE"; then set x "$CONFIG_SITE" elif test "x$prefix" != xNONE; then set x "$prefix/share/config.site" "$prefix/etc/config.site" else set x "$ac_default_prefix/share/config.site" \ "$ac_default_prefix/etc/config.site" fi shift for ac_site_file do if test -r "$ac_site_file"; then { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" 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. if test -f "$cache_file"; then { echo "$as_me:$LINENO: loading cache $cache_file" >&5 echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { echo "$as_me:$LINENO: creating cache $cache_file" >&5 echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 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 { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 echo "$as_me: former value: $ac_old_val" >&2;} { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 echo "$as_me: current value: $ac_new_val" >&2;} ac_cache_corrupted=: fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`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. *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 echo "$as_me: error: changes in the environment can compromise the build" >&2;} { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} { (exit 1); exit 1; }; } 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_config_headers="$ac_config_headers config.h" if test x$with_rlm_smb != xno; then 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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}gcc" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="gcc" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}cc" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="$ac_prog" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&5 echo "$as_me: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } # Provide some information about the compiler. echo "$as_me:$LINENO: checking for C compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (ac_try="$ac_compiler --version >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -v >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -V >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out 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. { echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6; } ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # # List of possible output files, starting from the most likely. # The algorithm is not robust to junk in `.', hence go to wildcards (a.*) # only as a last resort. b.out is created by i960 compilers. ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out' # # The IRIX 6 linker writes into existing files which may not be # executable, retaining their permissions. Remove them first so a # subsequent execution test works. ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link_default") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; 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 | *.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 { echo "$as_me:$LINENO: result: $ac_file" >&5 echo "${ECHO_T}$ac_file" >&6; } if test -z "$ac_file"; then echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: C compiler cannot create executables See \`config.log' for more details." >&5 echo "$as_me: error: C compiler cannot create executables See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } fi ac_exeext=$ac_cv_exeext # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { echo "$as_me:$LINENO: checking whether the C compiler works" >&5 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6; } # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then if { ac_try='./$ac_file' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { echo "$as_me:$LINENO: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&5 echo "$as_me: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi fi fi { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } rm -f a.out a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; } { echo "$as_me:$LINENO: result: $cross_compiling" >&5 echo "${ECHO_T}$cross_compiling" >&6; } { echo "$as_me:$LINENO: checking for suffix of executables" >&5 echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; } if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; 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 | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest$ac_cv_exeext { echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 echo "${ECHO_T}$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT { echo "$as_me:$LINENO: checking for suffix of object files" >&5 echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; } if test "${ac_cv_objext+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; 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 ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 echo "${ECHO_T}$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; } if test "${ac_cv_c_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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 { echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; } GCC=`test $ac_compiler_gnu = yes && echo yes` ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CFLAGS="" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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 { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 echo "${ECHO_T}$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 { echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_c89+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_c89=$ac_arg else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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) { echo "$as_me:$LINENO: result: none needed" >&5 echo "${ECHO_T}none needed" >&6; } ;; xno) { echo "$as_me:$LINENO: result: unsupported" >&5 echo "${ECHO_T}unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;; 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 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 { echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if test "${ac_cv_prog_CPP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f 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 { echo "$as_me:$LINENO: result: $CPP" >&5 echo "${ECHO_T}$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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&5 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } 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 rlm_smb_lib_dir= # Check whether --with-rlm-smb-lib-dir was given. if test "${with_rlm_smb_lib_dir+set}" = set; then withval=$with_rlm_smb_lib_dir; case "$withval" in no) { { echo "$as_me:$LINENO: error: Need rlm-smb-lib-dir" >&5 echo "$as_me: error: Need rlm-smb-lib-dir" >&2;} { (exit 1); exit 1; }; } ;; yes) ;; *) rlm_smb_lib_dir="$withval" ;; esac fi rlm_smb_inc_dir= # Check whether --with-rlm-smb-include-dir was given. if test "${with_rlm_smb_include_dir+set}" = set; then withval=$with_rlm_smb_include_dir; case "$withval" in no) { { echo "$as_me:$LINENO: error: Need rlm-smb-include-dir" >&5 echo "$as_me: error: Need rlm-smb-include-dir" >&2;} { (exit 1); exit 1; }; } ;; yes) ;; *) rlm_smb_include_dir="$withval" ;; esac fi { echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5 echo $ECHO_N "checking for grep that handles long lines and -e... $ECHO_C" >&6; } if test "${ac_cv_path_GREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Extract the first word of "grep ggrep" to use in msg output if test -z "$GREP"; then set dummy grep ggrep; ac_prog_name=$2 if test "${ac_cv_path_GREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" 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 ac_count=`expr $ac_count + 1` 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 fi GREP="$ac_cv_path_GREP" if test -z "$GREP"; then { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} { (exit 1); exit 1; }; } fi else ac_cv_path_GREP=$GREP fi fi { echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5 echo "${ECHO_T}$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { echo "$as_me:$LINENO: checking for egrep" >&5 echo $ECHO_N "checking for egrep... $ECHO_C" >&6; } if test "${ac_cv_path_EGREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else # Extract the first word of "egrep" to use in msg output if test -z "$EGREP"; then set dummy egrep; ac_prog_name=$2 if test "${ac_cv_path_EGREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" 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 ac_count=`expr $ac_count + 1` 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 fi EGREP="$ac_cv_path_EGREP" if test -z "$EGREP"; then { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} { (exit 1); exit 1; }; } fi else ac_cv_path_EGREP=$EGREP fi fi fi { echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 echo "${ECHO_T}$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" { echo "$as_me:$LINENO: checking for ANSI C header files" >&5 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; } if test "${ac_cv_header_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_header_stdc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* 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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* 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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* 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 rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi { echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 echo "${ECHO_T}$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then cat >>confdefs.h <<\_ACEOF #define STDC_HEADERS 1 _ACEOF 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=`echo "ac_cv_header_$ac_header" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Header=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in arpa/inet.h \ dirent.h \ sys/vfs.h \ netinet/in.h \ netinet/tcp.h \ sys/uio.h \ sys/signal.h \ sys/socket.h \ unistd.h \ ctype.h \ netdb.h \ signal.h \ do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? { echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ;; esac { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done targetname=rlm_smb smb_cflags="-I." else targetname= echo \*\*\* module rlm_smb is disabled. fi if test x"$fail" != x""; then if test x"${enable_strict_dependencies}" = x"yes"; then { { echo "$as_me:$LINENO: error: set --without-rlm_smb to disable it explicitly." >&5 echo "$as_me: error: set --without-rlm_smb to disable it explicitly." >&2;} { (exit 1); exit 1; }; } else { echo "$as_me:$LINENO: WARNING: silently not building rlm_smb." >&5 echo "$as_me: WARNING: silently not building rlm_smb." >&2;} { echo "$as_me:$LINENO: WARNING: FAILURE: rlm_smb requires: $fail." >&5 echo "$as_me: WARNING: FAILURE: rlm_smb requires: $fail." >&2;}; targetname="" fi fi unset ac_cv_env_LIBS_set unset ac_cv_env_LIBS_value ac_config_files="$ac_config_files 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_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( *) $as_unset $ac_var ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then test "x$cache_file" != "x/dev/null" && { echo "$as_me:$LINENO: updating cache $cache_file" >&5 echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 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= 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=`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. ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs : ${CONFIG_STATUS=./config.status} ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >$CONFIG_STATUS <<_ACEOF #! $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} _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ## --------------------- ## ## 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=: # 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 # PATH needs CR # 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 # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false 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.) as_nl=' ' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. 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 # Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # CDPATH. $as_unset CDPATH as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, and appends # trailing '-' during substitution so that $LINENO is not a special # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # scripts with optimization help from Paolo Bonzini. 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" || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi 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 fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi 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=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 # Save the log message, to keep $[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by $as_me, which was generated by GNU Autoconf 2.61. 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 cat >>$CONFIG_STATUS <<_ACEOF # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ config.status configured by $0, generated by GNU Autoconf 2.61, with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" Copyright (C) 2006 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' _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # If no file are specified by the user, then we need to provide default # value. By we need to know if files were specified by the user. 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=$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 ) echo "$ac_cs_version"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift CONFIG_FILES="$CONFIG_FILES $ac_optarg" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header { echo "$as_me: error: ambiguous option: $1 Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; };; --help | --hel | -h ) 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. -*) { echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *) ac_config_targets="$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 if \$ac_cs_recheck; then echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 CONFIG_SHELL=$SHELL export CONFIG_SHELL exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # 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" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= trap 'exit_status=$? { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status ' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || { echo "$me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } # # Set up the sed scripts for CONFIG_FILES section. # # No need to generate the scripts if there are no CONFIG_FILES. # This happens for instance when ./config.status config.h if test -n "$CONFIG_FILES"; then _ACEOF ac_delim='%!_!# ' for ac_last_try in false false false false false :; do cat >conf$$subs.sed <<_ACEOF SHELL!$SHELL$ac_delim PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim PACKAGE_NAME!$PACKAGE_NAME$ac_delim PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim PACKAGE_STRING!$PACKAGE_STRING$ac_delim PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim exec_prefix!$exec_prefix$ac_delim prefix!$prefix$ac_delim program_transform_name!$program_transform_name$ac_delim bindir!$bindir$ac_delim sbindir!$sbindir$ac_delim libexecdir!$libexecdir$ac_delim datarootdir!$datarootdir$ac_delim datadir!$datadir$ac_delim sysconfdir!$sysconfdir$ac_delim sharedstatedir!$sharedstatedir$ac_delim localstatedir!$localstatedir$ac_delim includedir!$includedir$ac_delim oldincludedir!$oldincludedir$ac_delim docdir!$docdir$ac_delim infodir!$infodir$ac_delim htmldir!$htmldir$ac_delim dvidir!$dvidir$ac_delim pdfdir!$pdfdir$ac_delim psdir!$psdir$ac_delim libdir!$libdir$ac_delim localedir!$localedir$ac_delim mandir!$mandir$ac_delim DEFS!$DEFS$ac_delim ECHO_C!$ECHO_C$ac_delim ECHO_N!$ECHO_N$ac_delim ECHO_T!$ECHO_T$ac_delim LIBS!$LIBS$ac_delim build_alias!$build_alias$ac_delim host_alias!$host_alias$ac_delim target_alias!$target_alias$ac_delim CC!$CC$ac_delim CFLAGS!$CFLAGS$ac_delim LDFLAGS!$LDFLAGS$ac_delim CPPFLAGS!$CPPFLAGS$ac_delim ac_ct_CC!$ac_ct_CC$ac_delim EXEEXT!$EXEEXT$ac_delim OBJEXT!$OBJEXT$ac_delim CPP!$CPP$ac_delim GREP!$GREP$ac_delim EGREP!$EGREP$ac_delim smb_cflags!$smb_cflags$ac_delim smb_ldflags!$smb_ldflags$ac_delim targetname!$targetname$ac_delim LIBOBJS!$LIBOBJS$ac_delim LTLIBOBJS!$LTLIBOBJS$ac_delim _ACEOF if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 52; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` if test -n "$ac_eof"; then ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` ac_eof=`expr $ac_eof + 1` fi cat >>$CONFIG_STATUS <<_ACEOF cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof /@[a-zA-Z_][a-zA-Z_0-9]*@/!b end _ACEOF sed ' s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g s/^/s,@/; s/!/@,|#_!!_#|/ :n t n s/'"$ac_delim"'$/,g/; t s/$/\\/; p N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n ' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF :end s/|#_!!_#|//g CEOF$ac_eof _ACEOF # VPATH may cause trouble with some makes, so we remove $(srcdir), # ${srcdir} and @srcdir@ 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[ ]*=/{ s/:*\$(srcdir):*/:/ s/:*\${srcdir}:*/:/ s/:*@srcdir@:*/:/ s/^\([^=]*=[ ]*\):*/\1/ s/:*$// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF fi # test -n "$CONFIG_FILES" for ac_tag in :F $CONFIG_FILES :H $CONFIG_HEADERS do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5 echo "$as_me: error: Invalid tag $ac_tag." >&2;} { (exit 1); exit 1; }; };; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 echo "$as_me: error: cannot find input file: $ac_f" >&2;} { (exit 1); exit 1; }; };; esac ac_file_inputs="$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 "`IFS=: echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure." if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { echo "$as_me:$LINENO: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} fi case $ac_tag in *:-:* | *:-) cat >"$tmp/stdin";; 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 || 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" case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`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 || 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" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 echo "$as_me: error: cannot create directory $as_dir" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`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 # _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # 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= case `sed -n '/datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p ' $ac_file_inputs` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF 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 sed "$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s&@configure_input@&$configure_input&;t t s&@top_builddir@&$ac_top_builddir_sub&;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 $ac_datarootdir_hack " $ac_file_inputs | sed -f "$tmp/subs-1.sed" >$tmp/out test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&5 echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&2;} rm -f "$tmp/stdin" case $ac_file in -) cat "$tmp/out"; rm -f "$tmp/out";; *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;; esac ;; :H) # # CONFIG_HEADER # _ACEOF # Transform confdefs.h into a sed script `conftest.defines', that # substitutes the proper values into config.h.in to produce config.h. rm -f conftest.defines conftest.tail # First, append a space to every undef/define line, to ease matching. echo 's/$/ /' >conftest.defines # Then, protect against being on the right side of a sed subst, or in # an unquoted here document, in config.status. If some macros were # called several times there might be several #defines for the same # symbol, which is useless. But do not sort them, since the last # AC_DEFINE must be honored. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* # These sed commands are passed to sed as "A NAME B PARAMS C VALUE D", where # NAME is the cpp macro being defined, VALUE is the value it is being given. # PARAMS is the parameter list in the macro definition--in most cases, it's # just an empty string. ac_dA='s,^\\([ #]*\\)[^ ]*\\([ ]*' ac_dB='\\)[ (].*,\\1define\\2' ac_dC=' ' ac_dD=' ,' uniq confdefs.h | sed -n ' t rset :rset s/^[ ]*#[ ]*define[ ][ ]*// t ok d :ok s/[\\&,]/\\&/g s/^\('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/ '"$ac_dA"'\1'"$ac_dB"'\2'"${ac_dC}"'\3'"$ac_dD"'/p s/^\('"$ac_word_re"'\)[ ]*\(.*\)/'"$ac_dA"'\1'"$ac_dB$ac_dC"'\2'"$ac_dD"'/p ' >>conftest.defines # Remove the space that was appended to ease matching. # Then 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. # (The regexp can be short, since the line contains either #define or #undef.) echo 's/ $// s,^[ #]*u.*,/* & */,' >>conftest.defines # Break up conftest.defines: ac_max_sed_lines=50 # First sed command is: sed -f defines.sed $ac_file_inputs >"$tmp/out1" # Second one is: sed -f defines.sed "$tmp/out1" >"$tmp/out2" # Third one will be: sed -f defines.sed "$tmp/out2" >"$tmp/out1" # et cetera. ac_in='$ac_file_inputs' ac_out='"$tmp/out1"' ac_nxt='"$tmp/out2"' while : do # Write a here document: cat >>$CONFIG_STATUS <<_ACEOF # First, check the format of the line: cat >"\$tmp/defines.sed" <<\\CEOF /^[ ]*#[ ]*undef[ ][ ]*$ac_word_re[ ]*\$/b def /^[ ]*#[ ]*define[ ][ ]*$ac_word_re[( ]/b def b :def _ACEOF sed ${ac_max_sed_lines}q conftest.defines >>$CONFIG_STATUS echo 'CEOF sed -f "$tmp/defines.sed"' "$ac_in >$ac_out" >>$CONFIG_STATUS ac_in=$ac_out; ac_out=$ac_nxt; ac_nxt=$ac_in sed 1,${ac_max_sed_lines}d conftest.defines >conftest.tail grep . conftest.tail >/dev/null || break rm -f conftest.defines mv conftest.tail conftest.defines done rm -f conftest.defines conftest.tail echo "ac_result=$ac_in" >>$CONFIG_STATUS cat >>$CONFIG_STATUS <<\_ACEOF if test x"$ac_file" != x-; then echo "/* $configure_input */" >"$tmp/config.h" cat "$ac_result" >>"$tmp/config.h" if diff $ac_file "$tmp/config.h" >/dev/null 2>&1; then { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 echo "$as_me: $ac_file is unchanged" >&6;} else rm -f $ac_file mv "$tmp/config.h" $ac_file fi else echo "/* $configure_input */" cat "$ac_result" fi rm -f "$tmp/out12" ;; esac done # for ac_tag { (exit 0); exit 0; } _ACEOF chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save # 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 || { (exit 1); exit 1; } fi freeradius-server/src/modules/rlm_smb/configure.in000066400000000000000000000027411257552170400227320ustar00rootroot00000000000000AC_PREREQ([2.53]) AC_INIT(rlm_smb.c) AC_CONFIG_HEADER(config.h) AC_REVISION($Revision$) AC_DEFUN(modname,[rlm_smb]) if test x$with_[]modname != xno; then AC_PROG_CC AC_PROG_CPP dnl extra argument: --with-rlm-smb-lib-dir rlm_smb_lib_dir= AC_ARG_WITH(rlm-smb-lib-dir, [ --with-rlm-smb-lib-dir=DIR Directory for samba library files []], [ case "$withval" in no) AC_MSG_ERROR(Need rlm-smb-lib-dir) ;; yes) ;; *) rlm_smb_lib_dir="$withval" ;; esac ] ) dnl extra argument: --with-rlm-smb-include-dir rlm_smb_inc_dir= AC_ARG_WITH(rlm-smb-include-dir, [ --with-rlm-smb-include-dir=DIR Directory for samba include files []], [ case "$withval" in no) AC_MSG_ERROR(Need rlm-smb-include-dir) ;; yes) ;; *) rlm_smb_include_dir="$withval" ;; esac ] ) AC_CHECK_HEADERS(arpa/inet.h \ dirent.h \ sys/vfs.h \ netinet/in.h \ netinet/tcp.h \ sys/uio.h \ sys/signal.h \ sys/socket.h \ unistd.h \ ctype.h \ netdb.h \ signal.h \ ) targetname=modname smb_cflags="-I." else targetname= echo \*\*\* module modname is disabled. fi if test x"$fail" != x""; then if test x"${enable_strict_dependencies}" = x"yes"; then AC_MSG_ERROR([set --without-]modname[ to disable it explicitly.]) else AC_MSG_WARN([silently not building ]modname[.]) AC_MSG_WARN([FAILURE: ]modname[ requires: $fail.]); targetname="" fi fi AC_SUBST(smb_cflags) AC_SUBST(smb_ldflags) AC_SUBST(targetname) AC_OUTPUT(Makefile) freeradius-server/src/modules/rlm_smb/rfcnb-common.h000066400000000000000000000021521257552170400231460ustar00rootroot00000000000000/* UNIX RFCNB (RFC1001/RFC1002) NetBIOS implementation Version 1.0 RFCNB Common Structures etc Defines Copyright (C) Richard Sharpe 1996 Copyright 2006 The FreeRADIUS server project */ /* This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include RCSIDH(rfcnb_common_h, "$Id$") /* A data structure we need */ typedef struct RFCNB_Pkt { char * data; /* The data in this portion */ int len; struct RFCNB_Pkt *next; } RFCNB_Pkt; freeradius-server/src/modules/rlm_smb/rfcnb-error.h000066400000000000000000000066641257552170400230230ustar00rootroot00000000000000/* UNIX RFCNB (RFC1001/RFC1002) NetBIOS implementation Version 1.0 RFCNB Error Response Defines Copyright (C) Richard Sharpe 1996 Copyright 2006 The FreeRADIUS server project */ /* This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include RCSIDH(rfcnb_error_h, "$Id$") /* Error responses */ #define RFCNBE_Bad -1 /* Bad response */ #define RFCNBE_OK 0 /* these should follow the spec ... is there one ?*/ #define RFCNBE_NoSpace 1 /* Could not allocate space for a struct */ #define RFCNBE_BadName 2 /* Could not translate a name */ #define RFCNBE_BadRead 3 /* Read sys call failed */ #define RFCNBE_BadWrite 4 /* Write Sys call failed */ #define RFCNBE_ProtErr 5 /* Protocol Error */ #define RFCNBE_ConGone 6 /* Connection dropped */ #define RFCNBE_BadHandle 7 /* Handle passed was bad */ #define RFCNBE_BadSocket 8 /* Problems creating socket */ #define RFCNBE_ConnectFailed 9 /* Connect failed */ #define RFCNBE_CallRejNLOCN 10 /* Call rejected, not listening on CN */ #define RFCNBE_CallRejNLFCN 11 /* Call rejected, not listening for CN */ #define RFCNBE_CallRejCNNP 12 /* Call rejected, called name not present */ #define RFCNBE_CallRejInfRes 13/* Call rejetced, name ok, no resources */ #define RFCNBE_CallRejUnSpec 14/* Call rejected, unspecified error */ #define RFCNBE_BadParam 15/* Bad parameters passed ... */ #define RFCNBE_Timeout 16/* IO Timed out */ /* Text strings for the error responses */ static const char *RFCNB_Error_Strings[] = { "RFCNBE_OK: Routine completed successfully.", "RFCNBE_NoSpace: No space available for a malloc call.", "RFCNBE_BadName: NetBIOS name could not be translated to IP address.", "RFCNBE_BadRead: Read system call returned an error. Check errno.", "RFCNBE_BadWrite: Write system call returned an error. Check errno.", "RFCNBE_ProtErr: A protocol error has occurred.", "RFCNBE_ConGone: Connection dropped during a read or write system call.", "RFCNBE_BadHandle: Bad connection handle passed.", "RFCNBE_BadSocket: Problems creating socket.", "RFCNBE_ConnectFailed: Connection failed. See errno.", "RFCNBE_CallRejNLOCN: Call rejected. Not listening on called name.", "RFCNBE_CallRejNLFCN: Call rejected. Not listening for called name.", "RFCNBE_CallRejCNNP: Call rejected. Called name not present.", "RFCNBE_CallRejInfRes: Call rejected. Name present, but insufficient resources.", "RFCNBE_CallRejUnSpec: Call rejected. Unspecified error.", "RFCNBE_BadParam: Bad parameters passed to a routine.", "RFCNBE_Timeout: IO Operation timed out ..." }; freeradius-server/src/modules/rlm_smb/rfcnb-io.c000066400000000000000000000231451257552170400222650ustar00rootroot00000000000000/* UNIX RFCNB (RFC1001/RFC1002) NEtBIOS implementation Version 1.0 RFCNB IO Routines ... Copyright (C) Richard Sharpe 1996 Copyright 2006 The FreeRADIUS server project */ /* This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include RCSID("$Id$") /* #include */ #include "std-includes.h" #include "rfcnb-priv.h" #include "rfcnb-util.h" #include "rfcnb-io.h" #ifdef HAVE_SYS_UIO_H #include #endif #ifdef HAVE_SYS_SIGNAL_H #include #endif #include int RFCNB_Timeout = 0; /* Timeout in seconds ... */ void rfcnb_alarm(int sig) { fprintf(stderr, "IO Timed out ...\n"); } /* Set timeout value and setup signal handling */ int RFCNB_Set_Timeout(int seconds) { /* If we are on a Bezerkeley system, use sigvec, else sigaction */ #ifndef SA_RESTART struct sigvec invec, outvec; #else struct sigaction inact, outact; #endif RFCNB_Timeout = seconds; if (RFCNB_Timeout > 0) { /* Set up handler to ignore but not restart */ #ifndef SA_RESTART invec.sv_handler = (void (*)())rfcnb_alarm; invec.sv_mask = 0; invec.sv_flags = SV_INTERRUPT; if (sigvec(SIGALRM, &invec, &outvec) < 0) return(-1); #else inact.sa_handler = (void (*)())rfcnb_alarm; sigemptyset(&inact.sa_mask); inact.sa_flags = 0; /* Don't restart */ if (sigaction(SIGALRM, &inact, &outact) < 0) return(-1); #endif } return(0); } /* Discard the rest of an incoming packet as we do not have space for it in the buffer we allocated or were passed ... */ int RFCNB_Discard_Rest(struct RFCNB_Con *con, int len) { char temp[100]; /* Read into here */ int rest, this_read, bytes_read; /* len is the amount we should read */ #ifdef RFCNB_DEBUG fprintf(stderr, "Discard_Rest called to discard: %i\n", len); #endif rest = len; while (rest > 0) { this_read = (rest > sizeof(temp)?sizeof(temp):rest); bytes_read = read(con -> fd, temp, this_read); if (bytes_read <= 0) { /* Error so return */ if (bytes_read < 0) RFCNB_errno = RFCNBE_BadRead; else RFCNB_errno = RFCNBE_ConGone; RFCNB_saved_errno = errno; return(RFCNBE_Bad); } rest = rest - bytes_read; } return(0); } /* Send an RFCNB packet to the connection. We just send each of the blocks linked together ... If we can, try to send it as one iovec ... */ int RFCNB_Put_Pkt(struct RFCNB_Con *con, struct RFCNB_Pkt *pkt, int len) { int len_sent, tot_sent, this_len; struct RFCNB_Pkt *pkt_ptr; char *this_data; int i; struct iovec io_list[10]; /* We should never have more */ /* If we do, this will blow up ...*/ /* Try to send the data ... We only send as many bytes as len claims */ /* We should try to stuff it into an IOVEC and send as one write */ pkt_ptr = pkt; len_sent = tot_sent = 0; /* Nothing sent so far */ i = 0; while ((pkt_ptr != NULL) & (i < 10)) { /* Watch that magic number! */ this_len = pkt_ptr -> len; this_data = pkt_ptr -> data; if ((tot_sent + this_len) > len) this_len = len - tot_sent; /* Adjust so we don't send too much */ /* Now plug into the iovec ... */ io_list[i].iov_len = this_len; io_list[i].iov_base = this_data; i++; tot_sent += this_len; if (tot_sent == len) break; /* Let's not send too much */ pkt_ptr = pkt_ptr -> next; } #ifdef RFCNB_DEBUG fprintf(stderr, "Frags = %i, tot_sent = %i\n", i, tot_sent); #endif /* Set up an alarm if timeouts are set ... */ if (RFCNB_Timeout > 0) alarm(RFCNB_Timeout); if ((len_sent = writev(con -> fd, io_list, i)) < 0) { /* An error */ con -> rfc_errno = errno; if (errno == EINTR) /* We were interrupted ... */ RFCNB_errno = RFCNBE_Timeout; else RFCNB_errno = RFCNBE_BadWrite; RFCNB_saved_errno = errno; return(RFCNBE_Bad); } if (len_sent < tot_sent) { /* Less than we wanted */ if (errno == EINTR) /* We were interrupted */ RFCNB_errno = RFCNBE_Timeout; else RFCNB_errno = RFCNBE_BadWrite; RFCNB_saved_errno = errno; return(RFCNBE_Bad); } if (RFCNB_Timeout > 0) alarm(0); /* Reset that sucker */ #ifdef RFCNB_DEBUG fprintf(stderr, "Len sent = %i ...\n", len_sent); RFCNB_Print_Pkt(stderr, "sent", pkt, len_sent); /* Print what send ... */ #endif return(len_sent); } /* Read an RFCNB packet off the connection. We read the first 4 bytes, that tells us the length, then read the rest. We should implement a timeout, but we don't just yet */ int RFCNB_Get_Pkt(struct RFCNB_Con *con, struct RFCNB_Pkt *pkt, int len) { int read_len, pkt_len; char hdr[RFCNB_Pkt_Hdr_Len]; /* Local space for the header */ struct RFCNB_Pkt *pkt_frag; int more, this_time, offset, frag_len, this_len; BOOL seen_keep_alive = TRUE; /* Read that header straight into the buffer */ if (len < RFCNB_Pkt_Hdr_Len) { /* What a bozo */ #ifdef RFCNB_DEBUG fprintf(stderr, "Trying to read less than a packet:"); perror(""); #endif RFCNB_errno = RFCNBE_BadParam; return(RFCNBE_Bad); } /* We discard keep alives here ... */ if (RFCNB_Timeout > 0) alarm(RFCNB_Timeout); while (seen_keep_alive) { if ((read_len = read(con -> fd, hdr, sizeof(hdr))) < 0) { /* Problems */ #ifdef RFCNB_DEBUG fprintf(stderr, "Reading the packet, we got:"); perror(""); #endif if (errno == EINTR) RFCNB_errno = RFCNBE_Timeout; else RFCNB_errno = RFCNBE_BadRead; RFCNB_saved_errno = errno; return(RFCNBE_Bad); } /* Now we check out what we got */ if (read_len == 0) { /* Connection closed, send back eof? */ #ifdef RFCNB_DEBUG fprintf(stderr, "Connection closed reading\n"); #endif if (errno == EINTR) RFCNB_errno = RFCNBE_Timeout; else RFCNB_errno = RFCNBE_ConGone; RFCNB_saved_errno = errno; return(RFCNBE_Bad); } if (RFCNB_Pkt_Type(hdr) == RFCNB_SESSION_KEEP_ALIVE) { #ifdef RFCNB_DEBUG fprintf(stderr, "RFCNB KEEP ALIVE received\n"); #endif } else { seen_keep_alive = FALSE; } } /* What if we got less than or equal to a hdr size in bytes? */ if (read_len < sizeof(hdr)) { /* We got a small packet */ /* Now we need to copy the hdr portion we got into the supplied packet */ memcpy(pkt -> data, hdr, read_len); /*Copy data */ #ifdef RFCNB_DEBUG RFCNB_Print_Pkt(stderr, "rcvd", pkt, read_len); #endif return(read_len); } /* Now, if we got at least a hdr size, alloc space for rest, if we need it */ pkt_len = RFCNB_Pkt_Len(hdr); #ifdef RFCNB_DEBUG fprintf(stderr, "Reading Pkt: Length = %i\n", pkt_len); #endif /* Now copy in the hdr */ memcpy(pkt -> data, hdr, sizeof(hdr)); /* Get the rest of the packet ... first figure out how big our buf is? */ /* And make sure that we handle the fragments properly ... Sure should */ /* use an iovec ... */ if (len < pkt_len) /* Only get as much as we have space for */ more = len - RFCNB_Pkt_Hdr_Len; else more = pkt_len; this_time = 0; /* We read for each fragment ... */ if (pkt -> len == read_len){ /* If this frag was exact size */ pkt_frag = pkt -> next; /* Stick next lot in next frag */ offset = 0; /* then we start at 0 in next */ } else { pkt_frag = pkt; /* Otherwise use rest of this frag */ offset = RFCNB_Pkt_Hdr_Len; /* Otherwise skip the header */ } frag_len = pkt_frag -> len; if (more <= frag_len) /* If len left to get less than frag space */ this_len = more; /* Get the rest ... */ else this_len = frag_len - offset; while (more > 0) { if ((this_time = read(con -> fd, (pkt_frag -> data) + offset, this_len)) <= 0) { /* Problems */ if (errno == EINTR) { RFCNB_errno = RFCNB_Timeout; } else { if (this_time < 0) RFCNB_errno = RFCNBE_BadRead; else RFCNB_errno = RFCNBE_ConGone; } RFCNB_saved_errno = errno; return(RFCNBE_Bad); } #ifdef RFCNB_DEBUG fprintf(stderr, "Frag_Len = %i, this_time = %i, this_len = %i, more = %i\n", frag_len, this_time, this_len, more); #endif read_len = read_len + this_time; /* How much have we read ... */ /* Now set up the next part */ if (pkt_frag -> next == NULL) break; /* That's it here */ pkt_frag = pkt_frag -> next; this_len = pkt_frag -> len; offset = 0; more = more - this_time; } #ifdef RFCNB_DEBUG fprintf(stderr,"Pkt Len = %i, read_len = %i\n", pkt_len, read_len); RFCNB_Print_Pkt(stderr, "rcvd", pkt, read_len + sizeof(hdr)); #endif if (read_len < (pkt_len + sizeof(hdr))) { /* Discard the rest */ return(RFCNB_Discard_Rest(con, (pkt_len + sizeof(hdr)) - read_len)); } if (RFCNB_Timeout > 0) alarm(0); /* Reset that sucker */ return(read_len + sizeof(RFCNB_Hdr)); } freeradius-server/src/modules/rlm_smb/rfcnb-io.h000066400000000000000000000021201257552170400222600ustar00rootroot00000000000000/* UNIX RFCNB (RFC1001/RFC1002) NetBIOS implementation Version 1.0 RFCNB IO Routines Defines Copyright (C) Richard Sharpe 1996 Copyright 2006 The FreeRADIUS server project */ /* This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include RCSIDH(rfcnb_io_h, "$Id$") int RFCNB_Put_Pkt(struct RFCNB_Con *con, struct RFCNB_Pkt *pkt, int len); int RFCNB_Get_Pkt(struct RFCNB_Con *con, struct RFCNB_Pkt *pkt, int len); freeradius-server/src/modules/rlm_smb/rfcnb-priv.h000066400000000000000000000100701257552170400226340ustar00rootroot00000000000000/* UNIX RFCNB (RFC1001/RFC1002) NetBIOS implementation Version 1.0 RFCNB Defines Copyright (C) Richard Sharpe 1996 Copyright 2006 The FreeRADIUS server project */ /* This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include RCSIDH(rfcnb_priv_h, "$Id$") /* Defines we need */ typedef unsigned short uint16; #define GLOBAL extern #include "rfcnb-error.h" #include "rfcnb-common.h" #include "byteorder.h" #ifdef RFCNB_PORT #define RFCNB_Default_Port RFCNB_PORT #else #define RFCNB_Default_Port 139 #endif #define RFCNB_MAX_STATS 1 /* Protocol defines we need */ #define RFCNB_SESSION_MESSAGE 0 #define RFCNB_SESSION_REQUEST 0x81 #define RFCNB_SESSION_ACK 0x82 #define RFCNB_SESSION_REJ 0x83 #define RFCNB_SESSION_RETARGET 0x84 #define RFCNB_SESSION_KEEP_ALIVE 0x85 /* Structures */ typedef struct redirect_addr * redirect_ptr; struct redirect_addr { struct in_addr ip_addr; int port; redirect_ptr next; }; typedef struct RFCNB_Con { int fd; /* File descripter for TCP/IP connection */ int rfc_errno; /* last error */ int timeout; /* How many milli-secs before IO times out */ int redirects; /* How many times we were redirected */ struct redirect_addr *redirect_list; /* First is first address */ struct redirect_addr *last_addr; } RFCNB_Con; typedef char RFCNB_Hdr[4]; /* The header is 4 bytes long with */ /* char[0] as the type, char[1] the */ /* flags, and char[2..3] the length */ /* Macros to extract things from the header. These are for portability between architecture types where we are worried about byte order */ #define RFCNB_Pkt_Hdr_Len 4 #define RFCNB_Pkt_Sess_Len 72 #define RFCNB_Pkt_Retarg_Len 10 #define RFCNB_Pkt_Nack_Len 5 #define RFCNB_Pkt_Type_Offset 0 #define RFCNB_Pkt_Flags_Offset 1 #define RFCNB_Pkt_Len_Offset 2 /* Length is 2 bytes plus a flag bit */ #define RFCNB_Pkt_N1Len_Offset 4 #define RFCNB_Pkt_Called_Offset 5 #define RFCNB_Pkt_N2Len_Offset 38 #define RFCNB_Pkt_Calling_Offset 39 #define RFCNB_Pkt_Error_Offset 4 #define RFCNB_Pkt_IP_Offset 4 #define RFCNB_Pkt_Port_Offset 8 /* The next macro isolates the length of a packet, including the bit in the flags */ #define RFCNB_Pkt_Len(p) (PVAL(p, 3) | (PVAL(p, 2) << 8) | \ ((PVAL(p, RFCNB_Pkt_Flags_Offset) & 0x01) << 16)) #define RFCNB_Put_Pkt_Len(p, v) (p[1] = ((v >> 16) & 1)); \ (p[2] = ((v >> 8) & 0xFF)); \ (p[3] = (v & 0xFF)); #define RFCNB_Pkt_Type(p) (CVAL(p, RFCNB_Pkt_Type_Offset)) /*typedef struct RFCNB_Hdr { unsigned char type; unsigned char flags; int16 len; } RFCNB_Hdr; typedef struct RFCNB_Sess_Pkt { unsigned char type; unsigned char flags; int16 length; unsigned char n1_len; char called_name[33]; unsigned char n2_len; char calling_name[33]; } RFCNB_Sess_Pkt; typedef struct RFCNB_Nack_Pkt { struct RFCNB_Hdr hdr; unsigned char error; } RFCNB_Nack_Pkt; typedef struct RFCNB_Retarget_Pkt { struct RFCNB_Hdr hdr; int dest_ip; unsigned char port; } RFCNB_Redir_Pkt; */ /* Static variables */ /* Only declare this if not defined */ #ifndef RFCNB_ERRNO extern int RFCNB_errno; extern int RFCNB_saved_errno; /* Save this from point of error */ #endif freeradius-server/src/modules/rlm_smb/rfcnb-util.c000066400000000000000000000247171257552170400226410ustar00rootroot00000000000000/* UNIX RFCNB (RFC1001/RFC1002) NetBIOS implementation Version 1.0 RFCNB Utility Routines ... Copyright (C) Richard Sharpe 1996 Copyright 2006 The FreeRADIUS server project */ /* This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include RCSID("$Id$") #include #include #include "std-includes.h" #include "rfcnb-priv.h" #include "rfcnb-util.h" #include "rfcnb-io.h" extern void (*Prot_Print_Routine)(); /* Pointer to protocol print routine */ /* Convert name and pad to 16 chars as needed */ /* Name 1 is a C string with null termination, name 2 may not be */ /* If SysName is true, then put a <00> on end, else space> */ void RFCNB_CvtPad_Name(char *name1, char *name2) { char c, c1, c2; int i, len; len = strlen(name1); for (i = 0; i < 16; i++) { if (i >= len) { c1 = 'C'; c2 = 'A'; /* CA is a space */ } else { c = name1[i]; c1 = (char)((int)c/16 + (int)'A'); c2 = (char)((int)c%16 + (int)'A'); } name2[i*2] = c1; name2[i*2+1] = c2; } name2[32] = 0; /* Put in the nll ...*/ } /* Converts an Ascii NB Name (16 chars) to an RFCNB Name (32 chars) Uses the encoding in RFC1001. Each nibble of byte is added to 'A' to produce the next byte in the name. This routine assumes that AName is 16 bytes long and that NBName has space for 32 chars, so be careful ... */ void RFCNB_AName_To_NBName(char *AName, char *NBName) { char c, c1, c2; int i; for (i=0; i < 16; i++) { c = AName[i]; c1 = (char)((c >> 4) + 'A'); c2 = (char)((c & 0xF) + 'A'); NBName[i*2] = c1; NBName[i*2+1] = c2; } NBName[32] = 0; /* Put in a null */ } /* Do the reverse of the above ... */ void RFCNB_NBName_To_AName(char *NBName, char *AName) { char c, c1, c2; int i; for (i=0; i < 16; i++) { c1 = NBName[i*2]; c2 = NBName[i*2+1]; c = (char)(((int)c1 - (int)'A') * 16 + ((int)c2 - (int)'A')); AName[i] = c; } AName[i] = 0; /* Put a null on the end ... */ } /* Print a string of bytes in HEX etc */ void RFCNB_Print_Hex(FILE *fd, struct RFCNB_Pkt *pkt, int Offset, int Len) { char c1, c2, outbuf1[33]; unsigned char c; int i, j; struct RFCNB_Pkt *pkt_ptr = pkt; static char Hex_List[17] = "0123456789ABCDEF"; j = 0; /* We only want to print as much as sepcified in Len */ while (pkt_ptr != NULL) { for (i = 0; i < ((Len > (pkt_ptr -> len)?pkt_ptr -> len:Len) - Offset); i++) { c = pkt_ptr -> data[i + Offset]; c1 = Hex_List[c >> 4]; c2 = Hex_List[c & 0xF]; outbuf1[j++] = c1; outbuf1[j++] = c2; if (j == 32){ /* Print and reset */ outbuf1[j] = 0; fprintf(fd, " %s\n", outbuf1); j = 0; } } Offset = 0; Len = Len - pkt_ptr -> len; /* Reduce amount by this much */ pkt_ptr = pkt_ptr -> next; } /* Print last lot in the buffer ... */ if (j > 0) { outbuf1[j] = 0; fprintf(fd, " %s\n", outbuf1); } fprintf(fd, "\n"); } /* Get a packet of size n */ struct RFCNB_Pkt *RFCNB_Alloc_Pkt(int n) { RFCNB_Pkt *pkt; if ((pkt = (struct RFCNB_Pkt *)malloc(sizeof(struct RFCNB_Pkt))) == NULL) { RFCNB_errno = RFCNBE_NoSpace; RFCNB_saved_errno = errno; return(NULL); } pkt -> next = NULL; pkt -> len = n; if (n == 0) return(pkt); if ((pkt -> data = (char *)malloc(n)) == NULL) { RFCNB_errno = RFCNBE_NoSpace; RFCNB_saved_errno = errno; free(pkt); return(NULL); } return(pkt); } /* Free up a packet */ int RFCNB_Free_Pkt(struct RFCNB_Pkt *pkt) { struct RFCNB_Pkt *pkt_next; char *data_ptr; while (pkt != NULL) { pkt_next = pkt -> next; data_ptr = pkt -> data; if (data_ptr != NULL) free(data_ptr); free(pkt); pkt = pkt_next; } } /* Print an RFCNB packet */ void RFCNB_Print_Pkt(FILE *fd, char *dirn, struct RFCNB_Pkt *pkt, int len) { char lname[17]; /* We assume that the first fragment is the RFCNB Header */ /* We should loop through the fragments printing them out */ fprintf(fd, "RFCNB Pkt %s:", dirn); switch (RFCNB_Pkt_Type(pkt -> data)) { case RFCNB_SESSION_MESSAGE: fprintf(fd, "SESSION MESSAGE: Length = %i\n", RFCNB_Pkt_Len(pkt -> data)); RFCNB_Print_Hex(fd, pkt, RFCNB_Pkt_Hdr_Len, #ifdef RFCNB_PRINT_DATA RFCNB_Pkt_Len(pkt -> data) - RFCNB_Pkt_Hdr_Len #else 40 #endif ); if (Prot_Print_Routine != 0) { /* Print the rest of the packet */ Prot_Print_Routine(fd, strcmp(dirn, "sent"), pkt, RFCNB_Pkt_Hdr_Len, RFCNB_Pkt_Len(pkt -> data) - RFCNB_Pkt_Hdr_Len); } break; case RFCNB_SESSION_REQUEST: fprintf(fd, "SESSION REQUEST: Length = %i\n", RFCNB_Pkt_Len(pkt -> data)); RFCNB_NBName_To_AName((char *)(pkt -> data + RFCNB_Pkt_Called_Offset), lname); fprintf(fd, " Called Name: %s\n", lname); RFCNB_NBName_To_AName((char *)(pkt -> data + RFCNB_Pkt_Calling_Offset), lname); fprintf(fd, " Calling Name: %s\n", lname); break; case RFCNB_SESSION_ACK: fprintf(fd, "RFCNB SESSION ACK: Length = %i\n", RFCNB_Pkt_Len(pkt -> data)); break; case RFCNB_SESSION_REJ: fprintf(fd, "RFCNB SESSION REJECT: Length = %i\n", RFCNB_Pkt_Len(pkt -> data)); if (RFCNB_Pkt_Len(pkt -> data) < 1) { fprintf(fd, " Protocol Error, short Reject packet!\n"); } else { fprintf(fd, " Error = %x\n", CVAL(pkt -> data, RFCNB_Pkt_Error_Offset)); } break; case RFCNB_SESSION_RETARGET: fprintf(fd, "RFCNB SESSION RETARGET: Length = %i\n", RFCNB_Pkt_Len(pkt -> data)); /* Print out the IP address etc and the port? */ break; case RFCNB_SESSION_KEEP_ALIVE: fprintf(fd, "RFCNB SESSION KEEP ALIVE: Length = %i\n", RFCNB_Pkt_Len(pkt -> data)); break; default: break; } } /* Resolve a name into an address */ int RFCNB_Name_To_IP(char *host, struct in_addr *Dest_IP) { fr_ipaddr_t ipaddr; if (ip_hton(host, AF_INET, &ipaddr) < 0) { /* Try NetBIOS name lookup, how the hell do we do that? */ RFCNB_errno = RFCNBE_BadName; /* Is this right? */ RFCNB_saved_errno = errno; return(RFCNBE_Bad); } memcpy(Dest_IP, &ipaddr.ipaddr.ip4addr, sizeof(struct in_addr)); return 0; } /* Disconnect the TCP connection to the server */ int RFCNB_Close(int socket) { close(socket); /* If we want to do error recovery, here is where we put it */ return 0; } /* Connect to the server specified in the IP address. Not sure how to handle socket options etc. */ int RFCNB_IP_Connect(struct in_addr Dest_IP, int port) { struct sockaddr_in Socket; int fd; /* Create a socket */ if ((fd = socket(PF_INET, SOCK_STREAM, 0)) < 0) { /* Handle the error */ RFCNB_errno = RFCNBE_BadSocket; RFCNB_saved_errno = errno; return(RFCNBE_Bad); } bzero((char *)&Socket, sizeof(Socket)); memcpy((char *)&Socket.sin_addr, (char *)&Dest_IP, sizeof(Dest_IP)); Socket.sin_port = htons(port); Socket.sin_family = PF_INET; /* Now connect to the destination */ if (connect(fd, (struct sockaddr *)&Socket, sizeof(Socket)) < 0) { /* Error */ close(fd); RFCNB_errno = RFCNBE_ConnectFailed; RFCNB_saved_errno = errno; return(RFCNBE_Bad); } return(fd); } /* handle the details of establishing the RFCNB session with remote end */ int RFCNB_Session_Req(struct RFCNB_Con *con, char *Called_Name, char *Calling_Name, BOOL *redirect, struct in_addr *Dest_IP, int * port) { char *sess_pkt; /* Response packet should be no more than 9 bytes, make 16 jic */ char resp[16]; int len; struct RFCNB_Pkt *pkt, res_pkt; /* We build and send the session request, then read the response */ pkt = RFCNB_Alloc_Pkt(RFCNB_Pkt_Sess_Len); if (pkt == NULL) { return(RFCNBE_Bad); /* Leave the error that RFCNB_Alloc_Pkt gives) */ } sess_pkt = pkt -> data; /* Get pointer to packet proper */ sess_pkt[RFCNB_Pkt_Type_Offset] = RFCNB_SESSION_REQUEST; RFCNB_Put_Pkt_Len(sess_pkt, RFCNB_Pkt_Sess_Len-RFCNB_Pkt_Hdr_Len); sess_pkt[RFCNB_Pkt_N1Len_Offset] = 32; sess_pkt[RFCNB_Pkt_N2Len_Offset] = 32; RFCNB_CvtPad_Name(Called_Name, (sess_pkt + RFCNB_Pkt_Called_Offset)); RFCNB_CvtPad_Name(Calling_Name, (sess_pkt + RFCNB_Pkt_Calling_Offset)); /* Now send the packet */ #ifdef RFCNB_DEBUG fprintf(stderr, "Sending packet: "); #endif if ((len = RFCNB_Put_Pkt(con, pkt, RFCNB_Pkt_Sess_Len)) < 0) { return(RFCNBE_Bad); /* Should be able to write that lot ... */ } #ifdef RFCNB_DEBUG fprintf(stderr, "Getting packet.\n"); #endif res_pkt.data = resp; res_pkt.len = sizeof(resp); res_pkt.next = NULL; if ((len = RFCNB_Get_Pkt(con, &res_pkt, sizeof(resp))) < 0) { return(RFCNBE_Bad); } /* Now analyze the packet ... */ switch (RFCNB_Pkt_Type(resp)) { case RFCNB_SESSION_REJ: /* Didnt like us ... too bad */ /* Why did we get rejected ? */ switch (CVAL(resp,RFCNB_Pkt_Error_Offset)) { case 0x80: RFCNB_errno = RFCNBE_CallRejNLOCN; break; case 0x81: RFCNB_errno = RFCNBE_CallRejNLFCN; break; case 0x82: RFCNB_errno = RFCNBE_CallRejCNNP; break; case 0x83: RFCNB_errno = RFCNBE_CallRejInfRes; break; case 0x8F: RFCNB_errno = RFCNBE_CallRejUnSpec; break; default: RFCNB_errno = RFCNBE_ProtErr; break; } return(RFCNBE_Bad); break; case RFCNB_SESSION_ACK: /* Got what we wanted ... */ return(0); break; case RFCNB_SESSION_RETARGET: /* Go elsewhere */ *redirect = TRUE; /* Copy port and ip addr */ memcpy(Dest_IP, (resp + RFCNB_Pkt_IP_Offset), sizeof(struct in_addr)); *port = SVAL(resp, RFCNB_Pkt_Port_Offset); return(0); break; default: /* A protocol error */ RFCNB_errno = RFCNBE_ProtErr; return(RFCNBE_Bad); break; } } freeradius-server/src/modules/rlm_smb/rfcnb-util.h000066400000000000000000000031471257552170400226400ustar00rootroot00000000000000/* UNIX RFCNB (RFC1001/RFC1002) NetBIOS implementation Version 1.0 RFCNB Utility Defines Copyright (C) Richard Sharpe 1996 Copyright 2006 The FreeRADIUS server project */ /* This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include RCSIDH(rfcnb_util_h, "$Id$") void RFCNB_CvtPad_Name(char *name1, char *name2); void RFCNB_AName_To_NBName(char *AName, char *NBName); void RFCNB_NBName_To_AName(char *NBName, char *AName); void RFCNB_Print_Hex(FILE *fd, struct RFCNB_Pkt *pkt, int Offset, int Len); struct RFCNB_Pkt *RFCNB_Alloc_Pkt(int n); void RFCNB_Print_Pkt(FILE *fd, char *dirn, struct RFCNB_Pkt *pkt, int len); int RFCNB_Name_To_IP(char *host, struct in_addr *Dest_IP); int RFCNB_Close(int socket); int RFCNB_IP_Connect(struct in_addr Dest_IP, int port); int RFCNB_Session_Req(struct RFCNB_Con *con, char *Called_Name, char *Calling_Name, BOOL *redirect, struct in_addr *Dest_IP, int * port); freeradius-server/src/modules/rlm_smb/rfcnb.h000066400000000000000000000027311257552170400216630ustar00rootroot00000000000000/* UNIX RFCNB (RFC1001/RFC1002) NetBIOS implementation Version 1.0 RFCNB Defines Copyright (C) Richard Sharpe 1996 Copyright 2006 The FreeRADIUS server project */ /* This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include RCSIDH(rfcnb_h, "$Id$") /* Error responses */ #include "rfcnb-error.h" #include "rfcnb-common.h" /* Defines we need */ #define RFCNB_Default_Port 139 /* Definition of routines we define */ void *RFCNB_Call(char *Called_Name, char *Calling_Name, char *Called_Address, int port); int RFCNB_Send(void *Con_Handle, struct RFCNB_Pkt *Data, int Length); int RFCNB_Recv(void *Con_Handle, struct RFCNB_Pkt *Data, int Length); int RFCNB_Hangup(void *con_Handle); void *RFCNB_Listen(); void RFCNB_Get_Error(char *buffer, int buf_len); struct RFCNB_Pkt *RFCNB_Alloc_Pkt(int n); freeradius-server/src/modules/rlm_smb/rlm_smb.c000066400000000000000000000121511257552170400222140ustar00rootroot00000000000000/* * rlm_smb.c * * Version: $Id$ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2002,2006 The FreeRADIUS server project * Copyright 2002 Alan DeKok */ #include RCSID("$Id$") #include #include #include "valid.h" /* * Define a structure for our module configuration. * * These variables do not need to be in a structure, but it's * a lot cleaner to do so, and a pointer to the structure can * be used as the instance handle. */ typedef struct rlm_smb_t { char *server; char *backup; char *domain; } rlm_smb_t; /* * A mapping of configuration file names to internal variables. * * Note that the string is dynamically allocated, so it MUST * be freed. When the configuration file parse re-reads the string, * it free's the old one, and strdup's the new one, placing the pointer * to the strdup'd string into 'config.string'. This gets around * buffer over-flows. */ static const CONF_PARSER module_config[] = { { "server", PW_TYPE_STRING_PTR, offsetof(rlm_smb_t,server), NULL, NULL}, { "backup", PW_TYPE_STRING_PTR, offsetof(rlm_smb_t,backup), NULL, NULL}, { "domain", PW_TYPE_STRING_PTR, offsetof(rlm_smb_t,domain), NULL, NULL}, { NULL, -1, 0, NULL, NULL } /* end the list */ }; /* * Do any per-module initialization that is separate to each * configured instance of the module. e.g. set up connections * to external databases, read configuration files, set up * dictionary entries, etc. * * If configuration information is given in the config section * that must be referenced in later calls, store a handle to it * in *instance otherwise put a null pointer there. */ static int smb_instantiate(CONF_SECTION *conf, void **instance) { rlm_smb_t *data; /* * Set up a storage area for instance data */ data = rad_malloc(sizeof(*data)); if (!data) { return -1; } memset(data, 0, sizeof(*data)); /* * If the configuration parameters can't be parsed, then * fail. */ if (cf_section_parse(conf, data, module_config) < 0) { free(data); return -1; } *instance = data; return 0; } /* * Authenticate the user with the given password. */ static int smb_authenticate(void *instance, REQUEST *request) { rlm_smb_t *data = (rlm_smb_t *) instance; int rcode; /* * We can only authenticate user requests which HAVE * a User-Name attribute. */ if (!request->username) { radlog(L_AUTH, "rlm_smb: Attribute \"User-Name\" is required for authentication."); return RLM_MODULE_INVALID; } /* * We can only authenticate user requests which HAVE * a User-Password attribute. */ if (!request->password) { radlog(L_AUTH, "rlm_smb: Attribute \"User-Password\" is required for authentication."); return RLM_MODULE_INVALID; } /* * Ensure that we're being passed a plain-text password, * and not anything else. */ if (request->password->attribute != PW_USER_PASSWORD) { radlog(L_AUTH, "rlm_smb: Attribute \"User-Password\" is required for authentication. Cannot use \"%s\".", request->password->name); return RLM_MODULE_INVALID; } /* * Call the SMB magic to do the work. */ rcode = Valid_User(request->username->vp_strvalue, request->password->vp_strvalue, data->server, data->backup, data->domain); switch (rcode) { case 0: /* success */ return RLM_MODULE_OK; break; case 1: /* network failure */ case 2: /* protocol failure */ return RLM_MODULE_FAIL; break; case 3: /* invalid user name or password */ return RLM_MODULE_REJECT; } /* * Something weird happened. Give up. */ return RLM_MODULE_INVALID; } static int smb_detach(void *instance) { rlm_smb_t *data = (rlm_smb_t *) instance; free(instance); return 0; } /* * The module name should be the only globally exported symbol. * That is, everything else should be 'static'. * * If the module needs to temporarily modify it's instantiation * data, the type should be changed to RLM_TYPE_THREAD_UNSAFE. * The server will then take care of ensuring that the module * is single-threaded. */ module_t rlm_smb = { RLM_MODULE_INIT, "SMB", RLM_TYPE_THREAD_UNSAFE, /* type */ smb_instantiate, /* instantiation */ smb_detach, /* detach */ { smb_authenticate, /* authentication */ NULL, /* authorization */ NULL, /* preaccounting */ NULL, /* accounting */ NULL, /* checksimul */ NULL, /* pre-proxy */ NULL, /* post-proxy */ NULL /* post-auth */ }, }; freeradius-server/src/modules/rlm_smb/session.c000066400000000000000000000207321257552170400222500ustar00rootroot00000000000000/* UNIX RFCNB (RFC1001/RFC1002) NetBIOS implementation Version 1.0 Session Routines ... Copyright (C) Richard Sharpe 1996 Copyright 2006 The FreeRADIUS server project */ /* This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include RCSID("$Id$") #include int RFCNB_errno = 0; int RFCNB_saved_errno = 0; #define RFCNB_ERRNO #include "std-includes.h" #ifdef HAVE_NETINET_TCP_H #include #endif #include "rfcnb-priv.h" #include "rfcnb-util.h" int RFCNB_Stats[RFCNB_MAX_STATS]; void (*Prot_Print_Routine)() = NULL; /* Pointer to print routine */ /* Set up a session with a remote name. We are passed Called_Name as a string which we convert to a NetBIOS name, ie space terminated, up to 16 characters only if we need to. If Called_Address is not empty, then we use it to connect to the remote end, but put in Called_Name ... Called Address can be a DNS based name, or a TCP/IP address ... */ void *RFCNB_Call(char *Called_Name, char *Calling_Name, char *Called_Address, int port) { struct RFCNB_Con *con; struct in_addr Dest_IP; int Client; BOOL redirect; struct redirect_addr *redir_addr; char *Service_Address; /* Now, we really should look up the port in /etc/services ... */ if (port == 0) port = RFCNB_Default_Port; /* Create a connection structure first */ if ((con = (struct RFCNB_Con *)malloc(sizeof(struct RFCNB_Con))) == NULL) { /* Error in size */ RFCNB_errno = RFCNBE_NoSpace; RFCNB_saved_errno = errno; return(NULL); } con -> fd = -0; /* no descriptor yet */ con -> rfc_errno = 0; /* no error yet */ con -> timeout = 0; /* no timeout */ con -> redirects = 0; con -> redirect_list = NULL; /* Fix bug still in version 0.50 */ /* Resolve that name into an IP address */ Service_Address = Called_Name; if (strcmp(Called_Address, "") != 0) { /* If the Called Address = "" */ Service_Address = Called_Address; } if ((errno = RFCNB_Name_To_IP(Service_Address, &Dest_IP)) < 0) { /* Error */ /* No need to modify RFCNB_errno as it was done by RFCNB_Name_To_IP */ return(NULL); } /* Now connect to the remote end */ redirect = TRUE; /* Fudge this one so we go once through */ while (redirect) { /* Connect and get session info etc */ redirect = FALSE; /* Assume all OK */ /* Build the redirect info. First one is first addr called */ /* And tack it onto the list of addresses we called */ if ((redir_addr = (struct redirect_addr *)malloc(sizeof(struct redirect_addr))) == NULL) { /* Could not get space */ RFCNB_errno = RFCNBE_NoSpace; RFCNB_saved_errno = errno; return(NULL); } memcpy((char *)&(redir_addr -> ip_addr), (char *)&Dest_IP, sizeof(Dest_IP)); redir_addr -> port = port; redir_addr -> next = NULL; if (con -> redirect_list == NULL) { /* Stick on head */ con -> redirect_list = con -> last_addr = redir_addr; } else { con -> last_addr -> next = redir_addr; con -> last_addr = redir_addr; } /* Now, make that connection */ if ((Client = RFCNB_IP_Connect(Dest_IP, port)) < 0) { /* Error */ /* No need to modify RFCNB_errno as it was done by RFCNB_IP_Connect */ return(NULL); } con -> fd = Client; /* Now send and handle the RFCNB session request */ /* If we get a redirect, we will comeback with redirect true and a new IP address in DEST_IP */ if ((errno = RFCNB_Session_Req(con, Called_Name, Calling_Name, &redirect, &Dest_IP, &port)) < 0) { /* No need to modify RFCNB_errno as it was done by RFCNB_Session.. */ return(NULL); } if (redirect) { /* We have to close the connection, and then try again */ (con -> redirects)++; RFCNB_Close(con -> fd); /* Close it */ } } return(con); } /* We send a packet to the other end ... for the moment, we treat the data as a series of pointers to blocks of data ... we should check the length ... */ int RFCNB_Send(struct RFCNB_Con *Con_Handle, struct RFCNB_Pkt *udata, int Length) { struct RFCNB_Pkt *pkt; char *hdr; int len; /* Plug in the header and send the data */ pkt = RFCNB_Alloc_Pkt(RFCNB_Pkt_Hdr_Len); if (pkt == NULL) { RFCNB_errno = RFCNBE_NoSpace; RFCNB_saved_errno = errno; return(RFCNBE_Bad); } pkt -> next = udata; /* The user data we want to send */ hdr = pkt -> data; /* Following crap is for portability across multiple UNIX machines */ *(hdr + RFCNB_Pkt_Type_Offset) = RFCNB_SESSION_MESSAGE; RFCNB_Put_Pkt_Len(hdr, Length); #ifdef RFCNB_DEBUG fprintf(stderr, "Sending packet: "); #endif if ((len = RFCNB_Put_Pkt(Con_Handle, pkt, Length + RFCNB_Pkt_Hdr_Len)) < 0) { /* No need to change RFCNB_errno as it was done by put_pkt ... */ return(RFCNBE_Bad); /* Should be able to write that lot ... */ } /* Now we have sent that lot, let's get rid of the RFCNB Header and return */ pkt -> next = NULL; RFCNB_Free_Pkt(pkt); return(len); } /* We pick up a message from the internet ... We have to worry about non-message packets ... */ int RFCNB_Recv(void *con_Handle, struct RFCNB_Pkt *Data, int Length) { struct RFCNB_Pkt *pkt; int ret_len; if (con_Handle == NULL){ RFCNB_errno = RFCNBE_BadHandle; RFCNB_saved_errno = errno; return(RFCNBE_Bad); } /* Now get a packet from below. We allocate a header first */ /* Plug in the header and send the data */ pkt = RFCNB_Alloc_Pkt(RFCNB_Pkt_Hdr_Len); if (pkt == NULL) { RFCNB_errno = RFCNBE_NoSpace; RFCNB_saved_errno = errno; return(RFCNBE_Bad); } pkt -> next = Data; /* Plug in the data portion */ if ((ret_len = RFCNB_Get_Pkt(con_Handle, pkt, Length + RFCNB_Pkt_Hdr_Len)) < 0) { #ifdef RFCNB_DEBUG fprintf(stderr, "Bad packet return in RFCNB_Recv... \n"); #endif return(RFCNBE_Bad); } /* We should check that we go a message and not a keep alive */ pkt -> next = NULL; RFCNB_Free_Pkt(pkt); return(ret_len); } /* We just disconnect from the other end, as there is nothing in the RFCNB */ /* protocol that specifies any exchange as far as I can see */ int RFCNB_Hangup(struct RFCNB_Con *con_Handle) { if (con_Handle != NULL) { RFCNB_Close(con_Handle -> fd); /* Could this fail? */ free(con_Handle); } return 0; } /* Set TCP_NODELAY on the socket */ int RFCNB_Set_Sock_NoDelay(struct RFCNB_Con *con_Handle, BOOL yn) { return(setsockopt(con_Handle -> fd, IPPROTO_TCP, TCP_NODELAY, (char *)&yn, sizeof(yn))); } /* Listen for a connection on a port???, when */ /* the connection comes in, we return with the connection */ void *RFCNB_Listen() { } /* Pick up the last error response as a string, hmmm, this routine should */ /* have been different ... */ void RFCNB_Get_Error(char *buffer, int buf_len) { if (RFCNB_saved_errno <= 0) { sprintf(buffer, "%s", RFCNB_Error_Strings[RFCNB_errno]); } else { sprintf(buffer, "%s\n\terrno:%s", RFCNB_Error_Strings[RFCNB_errno], strerror(RFCNB_saved_errno)); } } /* Pick up the last error response and returns as a code */ int RFCNB_Get_Last_Error() { return(RFCNB_errno); } /* Pick up saved errno as well */ int RFCNB_Get_Last_Errno() { return(RFCNB_saved_errno); } /* Pick up the last error response and return in string ... */ int RFCNB_Get_Error_Msg(int code, char *msg_buf, int len) { strncpy(msg_buf, RFCNB_Error_Strings[abs(code)], len); } /* Register a higher level protocol print routine */ void RFCNB_Register_Print_Routine(void (*fn)()) { Prot_Print_Routine = fn; } freeradius-server/src/modules/rlm_smb/smbdes.c000066400000000000000000000227631257552170400220500ustar00rootroot00000000000000/* Unix SMB/Netbios implementation. Version 1.9. a partial implementation of DES designed for use in the SMB authentication protocol Copyright (C) Andrew Tridgell 1997 Copyright 2006 The FreeRADIUS server project This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* NOTES: This code makes no attempt to be fast! In fact, it is a very slow implementation This code is NOT a complete DES implementation. It implements only the minimum necessary for SMB authentication, as used by all SMB products (including every copy of Microsoft Windows95 ever sold) In particular, it can only do a unchained forward DES pass. This means it is not possible to use this code for encryption/decryption of data, instead it is only useful as a "hash" algorithm. There is no entry point into this code that allows normal DES operation. I believe this means that this code does not come under ITAR regulations but this is NOT a legal opinion. If you are concerned about the applicability of ITAR regulations to this code then you should confirm it for yourself (and maybe let me know if you come up with a different answer to the one above) */ #include RCSID("$Id$") static int perm1[56] = {57, 49, 41, 33, 25, 17, 9, 1, 58, 50, 42, 34, 26, 18, 10, 2, 59, 51, 43, 35, 27, 19, 11, 3, 60, 52, 44, 36, 63, 55, 47, 39, 31, 23, 15, 7, 62, 54, 46, 38, 30, 22, 14, 6, 61, 53, 45, 37, 29, 21, 13, 5, 28, 20, 12, 4}; static int perm2[48] = {14, 17, 11, 24, 1, 5, 3, 28, 15, 6, 21, 10, 23, 19, 12, 4, 26, 8, 16, 7, 27, 20, 13, 2, 41, 52, 31, 37, 47, 55, 30, 40, 51, 45, 33, 48, 44, 49, 39, 56, 34, 53, 46, 42, 50, 36, 29, 32}; static int perm3[64] = {58, 50, 42, 34, 26, 18, 10, 2, 60, 52, 44, 36, 28, 20, 12, 4, 62, 54, 46, 38, 30, 22, 14, 6, 64, 56, 48, 40, 32, 24, 16, 8, 57, 49, 41, 33, 25, 17, 9, 1, 59, 51, 43, 35, 27, 19, 11, 3, 61, 53, 45, 37, 29, 21, 13, 5, 63, 55, 47, 39, 31, 23, 15, 7}; static int perm4[48] = { 32, 1, 2, 3, 4, 5, 4, 5, 6, 7, 8, 9, 8, 9, 10, 11, 12, 13, 12, 13, 14, 15, 16, 17, 16, 17, 18, 19, 20, 21, 20, 21, 22, 23, 24, 25, 24, 25, 26, 27, 28, 29, 28, 29, 30, 31, 32, 1}; static int perm5[32] = { 16, 7, 20, 21, 29, 12, 28, 17, 1, 15, 23, 26, 5, 18, 31, 10, 2, 8, 24, 14, 32, 27, 3, 9, 19, 13, 30, 6, 22, 11, 4, 25}; static int perm6[64] ={ 40, 8, 48, 16, 56, 24, 64, 32, 39, 7, 47, 15, 55, 23, 63, 31, 38, 6, 46, 14, 54, 22, 62, 30, 37, 5, 45, 13, 53, 21, 61, 29, 36, 4, 44, 12, 52, 20, 60, 28, 35, 3, 43, 11, 51, 19, 59, 27, 34, 2, 42, 10, 50, 18, 58, 26, 33, 1, 41, 9, 49, 17, 57, 25}; static int sc[16] = {1, 1, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 1}; static int sbox[8][4][16] = { {{14, 4, 13, 1, 2, 15, 11, 8, 3, 10, 6, 12, 5, 9, 0, 7}, {0, 15, 7, 4, 14, 2, 13, 1, 10, 6, 12, 11, 9, 5, 3, 8}, {4, 1, 14, 8, 13, 6, 2, 11, 15, 12, 9, 7, 3, 10, 5, 0}, {15, 12, 8, 2, 4, 9, 1, 7, 5, 11, 3, 14, 10, 0, 6, 13}}, {{15, 1, 8, 14, 6, 11, 3, 4, 9, 7, 2, 13, 12, 0, 5, 10}, {3, 13, 4, 7, 15, 2, 8, 14, 12, 0, 1, 10, 6, 9, 11, 5}, {0, 14, 7, 11, 10, 4, 13, 1, 5, 8, 12, 6, 9, 3, 2, 15}, {13, 8, 10, 1, 3, 15, 4, 2, 11, 6, 7, 12, 0, 5, 14, 9}}, {{10, 0, 9, 14, 6, 3, 15, 5, 1, 13, 12, 7, 11, 4, 2, 8}, {13, 7, 0, 9, 3, 4, 6, 10, 2, 8, 5, 14, 12, 11, 15, 1}, {13, 6, 4, 9, 8, 15, 3, 0, 11, 1, 2, 12, 5, 10, 14, 7}, {1, 10, 13, 0, 6, 9, 8, 7, 4, 15, 14, 3, 11, 5, 2, 12}}, {{7, 13, 14, 3, 0, 6, 9, 10, 1, 2, 8, 5, 11, 12, 4, 15}, {13, 8, 11, 5, 6, 15, 0, 3, 4, 7, 2, 12, 1, 10, 14, 9}, {10, 6, 9, 0, 12, 11, 7, 13, 15, 1, 3, 14, 5, 2, 8, 4}, {3, 15, 0, 6, 10, 1, 13, 8, 9, 4, 5, 11, 12, 7, 2, 14}}, {{2, 12, 4, 1, 7, 10, 11, 6, 8, 5, 3, 15, 13, 0, 14, 9}, {14, 11, 2, 12, 4, 7, 13, 1, 5, 0, 15, 10, 3, 9, 8, 6}, {4, 2, 1, 11, 10, 13, 7, 8, 15, 9, 12, 5, 6, 3, 0, 14}, {11, 8, 12, 7, 1, 14, 2, 13, 6, 15, 0, 9, 10, 4, 5, 3}}, {{12, 1, 10, 15, 9, 2, 6, 8, 0, 13, 3, 4, 14, 7, 5, 11}, {10, 15, 4, 2, 7, 12, 9, 5, 6, 1, 13, 14, 0, 11, 3, 8}, {9, 14, 15, 5, 2, 8, 12, 3, 7, 0, 4, 10, 1, 13, 11, 6}, {4, 3, 2, 12, 9, 5, 15, 10, 11, 14, 1, 7, 6, 0, 8, 13}}, {{4, 11, 2, 14, 15, 0, 8, 13, 3, 12, 9, 7, 5, 10, 6, 1}, {13, 0, 11, 7, 4, 9, 1, 10, 14, 3, 5, 12, 2, 15, 8, 6}, {1, 4, 11, 13, 12, 3, 7, 14, 10, 15, 6, 8, 0, 5, 9, 2}, {6, 11, 13, 8, 1, 4, 10, 7, 9, 5, 0, 15, 14, 2, 3, 12}}, {{13, 2, 8, 4, 6, 15, 11, 1, 10, 9, 3, 14, 5, 0, 12, 7}, {1, 15, 13, 8, 10, 3, 7, 4, 12, 5, 6, 11, 0, 14, 9, 2}, {7, 11, 4, 1, 9, 12, 14, 2, 0, 6, 10, 13, 15, 3, 5, 8}, {2, 1, 14, 7, 4, 10, 8, 13, 15, 12, 9, 0, 3, 5, 6, 11}}}; static void permute(char *out, char *in, int *p, int n) { int i; for (i=0;i>1; key[1] = ((str[0]&0x01)<<6) | (str[1]>>2); key[2] = ((str[1]&0x03)<<5) | (str[2]>>3); key[3] = ((str[2]&0x07)<<4) | (str[3]>>4); key[4] = ((str[3]&0x0F)<<3) | (str[4]>>5); key[5] = ((str[4]&0x1F)<<2) | (str[5]>>6); key[6] = ((str[5]&0x3F)<<1) | (str[6]>>7); key[7] = str[6]&0x7F; for (i=0;i<8;i++) { key[i] = (key[i]<<1); } } static void smbhash(unsigned char *out, unsigned char *in, unsigned char *key) { int i; char outb[64]; char inb[64]; char keyb[64]; unsigned char key2[8]; str_to_key(key, key2); for (i=0;i<64;i++) { inb[i] = (in[i/8] & (1<<(7-(i%8)))) ? 1 : 0; keyb[i] = (key2[i/8] & (1<<(7-(i%8)))) ? 1 : 0; outb[i] = 0; } dohash(outb, inb, keyb); for (i=0;i<8;i++) { out[i] = 0; } for (i=0;i<64;i++) { if (outb[i]) out[i/8] |= (1<<(7-(i%8))); } } void E_P16(unsigned char *p14,unsigned char *p16) { unsigned char sp8[8] = {0x4b, 0x47, 0x53, 0x21, 0x40, 0x23, 0x24, 0x25}; smbhash(p16, sp8, p14); smbhash(p16+8, sp8, p14+7); } void E_P24(unsigned char *p21, unsigned char *c8, unsigned char *p24) { smbhash(p24, c8, p21); smbhash(p24+8, c8, p21+7); smbhash(p24+16, c8, p21+14); } void cred_hash1(unsigned char *out,unsigned char *in,unsigned char *key) { unsigned char buf[8]; smbhash(buf, in, key); smbhash(out, buf, key+9); } void cred_hash2(unsigned char *out,unsigned char *in,unsigned char *key) { unsigned char buf[8]; static unsigned char key2[8]; smbhash(buf, in, key); key2[0] = key[7]; smbhash(out, buf, key2); } freeradius-server/src/modules/rlm_smb/smbencrypt.c000066400000000000000000000075261257552170400227610ustar00rootroot00000000000000/* Unix SMB/Netbios implementation. Version 1.9. SMB parameters and setup Copyright (C) Andrew Tridgell 1992-1997 Modified by Jeremy Allison 1995. Copyright 2006 The FreeRADIUS server project This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include RCSID("$Id$") #include #ifdef HAVE_SYS_VFS_H #include #endif #include "smblib-priv.h" #define uchar unsigned char extern int DEBUGLEVEL; void strupper(char *s); /* This implements the X/Open SMB password encryption It takes a password, a 8 byte "crypt key" and puts 24 bytes of encrypted password into p24 */ void SMBencrypt(uchar *passwd, uchar *c8, uchar *p24) { uchar p14[15], p21[21]; memset(p21,'\0',21); memset(p14,'\0',14); strlcpy((char *)p14,(char *)passwd,14); strupper((char *)p14); E_P16(p14, p21); E_P24(p21, c8, p24); } /* Routines for Windows NT MD4 Hash functions. */ static int _my_wcslen(int16 *str) { int len = 0; while(*str++ != 0) len++; return len; } /* * Convert a string into an NT UNICODE string. * Note that regardless of processor type * this must be in intel (little-endian) * format. */ static int _my_mbstowcs(int16 *dst, uchar *src, int len) { int i; int16 val; for(i = 0; i < len; i++) { val = *src; SSVAL(dst,0,val); dst++; src++; if(val == 0) break; } return i; } /* * Creates the MD4 Hash of the users password in NT UNICODE. */ void E_md4hash(uchar *passwd, uchar *p16) { int len; int16 wpwd[129]; /* Password cannot be longer than 128 characters */ len = strlen((char *)passwd); if(len > 128) len = 128; /* Password must be converted to NT unicode */ _my_mbstowcs(wpwd, passwd, len); wpwd[len] = 0; /* Ensure string is null terminated */ /* Calculate length in bytes */ len = _my_wcslen(wpwd) * sizeof(int16); mdfour(p16, (unsigned char *)wpwd, len); } /* Does the NT MD4 hash then des encryption. */ void SMBNTencrypt(uchar *passwd, uchar *c8, uchar *p24) { uchar p21[21]; memset(p21,'\0',21); E_md4hash(passwd, p21); E_P24(p21, c8, p24); } /* Does both the NT and LM owfs of a user's password */ void nt_lm_owf_gen(char *pwd, char *nt_p16, char *p16) { char passwd[130]; strlcpy(passwd, pwd, sizeof(passwd)); /* Calculate the MD4 hash (NT compatible) of the password */ memset(nt_p16, '\0', 16); E_md4hash((uchar *)passwd, (uchar *)nt_p16); /* Mangle the passwords into Lanman format */ passwd[14] = '\0'; strupper(passwd); /* Calculate the SMB (lanman) hash functions of the password */ memset(p16, '\0', 16); E_P16((uchar *) passwd, (uchar *)p16); /* clear out local copy of user's password (just being paranoid). */ bzero(passwd, sizeof(passwd)); } void strupper(char *s) { while (*s) { /* #if !defined(KANJI_WIN95_COMPATIBILITY) if(lp_client_code_page() == KANJI_CODEPAGE) { if (is_shift_jis (*s)) { if (is_sj_lower (s[0], s[1])) s[1] = sj_toupper2 (s[1]); s += 2; } else if (is_kana (*s)) { s++; } else { if (islower(*s)) *s = toupper(*s); s++; } } else #endif */ /* KANJI_WIN95_COMPATIBILITY */ { if (islower(*s)) *s = toupper(*s); s++; } } } freeradius-server/src/modules/rlm_smb/smblib-common.h000066400000000000000000000147621257552170400233360ustar00rootroot00000000000000/* UNIX SMBlib NetBIOS implementation Version 1.0 SMBlib Common Defines Copyright (C) Richard Sharpe 1996 Copyright 2006 The FreeRADIUS server project */ /* This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include RCSIDH(smblib_common_h, "$Id$") /* To get the error class we want the first 8 bits */ /* Because we just grab 4bytes from the SMB header, we have to re-order */ /* here, but it makes the NtStatus part easier in future */ #define SMBlib_Error_Class(p) (p & 0x000000FF) /* To get the error code, we want the bottom 16 bits */ #define SMBlib_Error_Code(p) (((unsigned int)p & 0xFFFF0000) >>16) /* Error CLASS codes and etc ... */ #define SMBC_SUCCESS 0 #define SMBC_ERRDOS 0x01 #define SMBC_ERRSRV 0x02 #define SMBC_ERRHRD 0x03 #define SMBC_ERRCMD 0xFF /* Success error codes */ #define SMBS_BUFFERED 0x54 #define SMBS_LOGGED 0x55 #define SMBS_DISPLAYED 0x56 /* ERRDOS Error codes */ #define SMBD_badfunc 0x01 #define SMBD_badfile 0x02 #define SMBD_badpath 0x03 #define SMBD_nofids 0x04 #define SMBD_noaccess 0x05 #define SMBD_badfid 0x06 #define SMBD_badmcb 0x07 #define SMBD_nomem 0x08 #define SMBD_badmem 0x09 #define SMBD_badenv 0x0A #define SMBD_badformat 0x0B #define SMBD_badaccess 0x0C #define SMBD_baddata 0x0D #define SMBD_reserved 0x0E #define SMBD_baddrive 0x0F #define SMBD_remcd 0x10 #define SMBD_diffdevice 0x11 #define SMBD_nofiles 0x12 #define SMBD_badshare 0x20 #define SMBD_errlock 0x21 #define SMBD_filexists 0x50 /* Server errors ... */ #define SMBV_error 0x01 /* Generic error */ #define SMBV_badpw 0x02 #define SMBV_badtype 0x03 #define SMBV_access 0x04 #define SMBV_invnid 0x05 #define SMBV_invnetname 0x06 #define SMBV_invdevice 0x07 #define SMBV_qfull 0x31 #define SMBV_qtoobig 0x32 #define SMBV_qeof 0x33 #define SMBV_invpfid 0x34 #define SMBV_paused 0x51 #define SMBV_msgoff 0x52 #define SMBV_noroom 0x53 #define SMBV_rmuns 0x57 #define SMBV_nosupport 0xFFFF /* Hardware error codes ... */ #define SMBH_nowrite 0x13 #define SMBH_badunit 0x14 #define SMBH_notready 0x15 #define SMBH_badcmd 0x16 #define SMBH_data 0x17 #define SMBH_badreq 0x18 #define SMBH_seek 0x19 #define SMBH_badmedia 0x1A #define SMBH_badsector 0x1B #define SMBH_nopaper 0x1C #define SMBH_write 0x1D #define SMBH_read 0x1E #define SMBH_general 0x1F #define SMBH_badshare 0x20 /* Access mode defines ... */ #define SMB_AMODE_WTRU 0x4000 #define SMB_AMODE_NOCACHE 0x1000 #define SMB_AMODE_COMPAT 0x0000 #define SMB_AMODE_DENYRWX 0x0010 #define SMB_AMODE_DENYW 0x0020 #define SMB_AMODE_DENYRX 0x0030 #define SMB_AMODE_DENYNONE 0x0040 #define SMB_AMODE_OPENR 0x0000 #define SMB_AMODE_OPENW 0x0001 #define SMB_AMODE_OPENRW 0x0002 #define SMB_AMODE_OPENX 0x0003 #define SMB_AMODE_FCBOPEN 0x00FF #define SMB_AMODE_LOCUNKN 0x0000 #define SMB_AMODE_LOCMSEQ 0x0100 #define SMB_AMODE_LOCMRAN 0x0200 #define SMB_AMODE_LOCRAL 0x0300 /* File attribute encoding ... */ #define SMB_FA_ORD 0x00 #define SMB_FA_ROF 0x01 #define SMB_FA_HID 0x02 #define SMB_FA_SYS 0x04 #define SMB_FA_VOL 0x08 #define SMB_FA_DIR 0x10 #define SMB_FA_ARC 0x20 /* Define the protocol types ... */ #define SMB_P_Unknown -1 /* Hmmm, is this smart? */ #define SMB_P_Core 0 #define SMB_P_CorePlus 1 #define SMB_P_DOSLanMan1 2 #define SMB_P_LanMan1 3 #define SMB_P_DOSLanMan2 4 #define SMB_P_LanMan2 5 #define SMB_P_DOSLanMan2_1 6 #define SMB_P_LanMan2_1 7 #define SMB_P_NT1 8 /* SMBlib return codes */ /* We want something that indicates whether or not the return code was a */ /* remote error, a local error in SMBlib or returned from lower layer ... */ /* Wonder if this will work ... */ /* SMBlibE_Remote = 1 indicates remote error */ /* SMBlibE_ values < 0 indicate local error with more info available */ /* SMBlibE_ values >1 indicate local from SMBlib code errors? */ #define SMBlibE_Success 0 #define SMBlibE_Remote 1 /* Remote error, get more info from con */ #define SMBlibE_BAD -1 #define SMBlibE_LowerLayer 2 /* Lower layer error */ #define SMBlibE_NotImpl 3 /* Function not yet implemented */ #define SMBlibE_ProtLow 4 /* Protocol negotiated does not support req */ #define SMBlibE_NoSpace 5 /* No space to allocate a structure */ #define SMBlibE_BadParam 6 /* Bad parameters */ #define SMBlibE_NegNoProt 7 /* None of our protocols was liked */ #define SMBlibE_SendFailed 8 /* Sending an SMB failed */ #define SMBlibE_RecvFailed 9 /* Receiving an SMB failed */ #define SMBlibE_GuestOnly 10 /* Logged in as guest */ #define SMBlibE_CallFailed 11 /* Call remote end failed */ #define SMBlibE_ProtUnknown 12 /* Protocol unknown */ #define SMBlibE_NoSuchMsg 13 /* Keep this up to date */ typedef struct { /* A structure for a Dirent */ unsigned char resume_key[21]; /* Don't touch this */ unsigned char file_attributes; /* Attributes of file */ unsigned int date_time; /* date and time of last mod */ unsigned int size; char filename[13]; /* The name of the file */ } SMB_CP_dirent; freeradius-server/src/modules/rlm_smb/smblib-priv.h000066400000000000000000000703641257552170400230260ustar00rootroot00000000000000/* UNIX SMBlib NetBIOS implementation Version 1.0 SMBlib private Defines Copyright (C) Richard Sharpe 1996 Copyright 2006 The FreeRADIUS server project */ /* This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include RCSIDH(smblib_priv_h, "$Id$") #include "std-includes.h" #include "smblib-common.h" typedef unsigned short uint16; typedef unsigned int uint32; #include "byteorder.h" /* Hmmm ... hot good */ #define max(a,b) (a < b ? b : a) #define SMB_DEF_IDF 0x424D53FF /* "\377SMB" */ /* Core protocol commands */ #define SMBmkdir 0x00 /* create directory */ #define SMBrmdir 0x01 /* delete directory */ #define SMBopen 0x02 /* open file */ #define SMBcreate 0x03 /* create file */ #define SMBclose 0x04 /* close file */ #define SMBflush 0x05 /* flush file */ #define SMBunlink 0x06 /* delete file */ #define SMBmv 0x07 /* rename file */ #define SMBgetatr 0x08 /* get file attributes */ #define SMBsetatr 0x09 /* set file attributes */ #define SMBread 0x0A /* read from file */ #define SMBwrite 0x0B /* write to file */ #define SMBlock 0x0C /* lock byte range */ #define SMBunlock 0x0D /* unlock byte range */ #define SMBctemp 0x0E /* create temporary file */ #define SMBmknew 0x0F /* make new file */ #define SMBchkpth 0x10 /* check directory path */ #define SMBexit 0x11 /* process exit */ #define SMBlseek 0x12 /* seek */ #define SMBtcon 0x70 /* tree connect */ #define SMBtdis 0x71 /* tree disconnect */ #define SMBnegprot 0x72 /* negotiate protocol */ #define SMBdskattr 0x80 /* get disk attributes */ #define SMBsearch 0x81 /* search directory */ #define SMBsplopen 0xC0 /* open print spool file */ #define SMBsplwr 0xC1 /* write to print spool file */ #define SMBsplclose 0xC2 /* close print spool file */ #define SMBsplretq 0xC3 /* return print queue */ #define SMBsends 0xD0 /* send single block message */ #define SMBsendb 0xD1 /* send broadcast message */ #define SMBfwdname 0xD2 /* forward user name */ #define SMBcancelf 0xD3 /* cancel forward */ #define SMBgetmac 0xD4 /* get machine name */ #define SMBsendstrt 0xD5 /* send start of multi-block message */ #define SMBsendend 0xD6 /* send end of multi-block message */ #define SMBsendtxt 0xD7 /* send text of multi-block message */ /* CorePlus protocol */ #define SMBlockread 0x13 /* Lock a range and read it */ #define SMBwriteunlock 0x14 /* Unlock a range and then write */ #define SMBreadbraw 0x1a /* read a block of data without smb header ohead*/ #define SMBwritebraw 0x1d /* write a block of data without smb header ohead*/ #define SMBwritec 0x20 /* secondary write request */ #define SMBwriteclose 0x2c /* write a file and then close it */ /* DOS Extended Protocol */ #define SMBreadBraw 0x1A /* read block raw */ #define SMBreadBmpx 0x1B /* read block multiplexed */ #define SMBreadBs 0x1C /* read block (secondary response) */ #define SMBwriteBraw 0x1D /* write block raw */ #define SMBwriteBmpx 0x1E /* write block multiplexed */ #define SMBwriteBs 0x1F /* write block (secondary request) */ #define SMBwriteC 0x20 /* write complete response */ #define SMBsetattrE 0x22 /* set file attributes expanded */ #define SMBgetattrE 0x23 /* get file attributes expanded */ #define SMBlockingX 0x24 /* lock/unlock byte ranges and X */ #define SMBtrans 0x25 /* transaction - name, bytes in/out */ #define SMBtranss 0x26 /* transaction (secondary request/response) */ #define SMBioctl 0x27 /* IOCTL */ #define SMBioctls 0x28 /* IOCTL (secondary request/response) */ #define SMBcopy 0x29 /* copy */ #define SMBmove 0x2A /* move */ #define SMBecho 0x2B /* echo */ #define SMBopenX 0x2D /* open and X */ #define SMBreadX 0x2E /* read and X */ #define SMBwriteX 0x2F /* write and X */ #define SMBsesssetupX 0x73 /* Session Set Up & X (including User Logon) */ #define SMBtconX 0x75 /* tree connect and X */ #define SMBffirst 0x82 /* find first */ #define SMBfunique 0x83 /* find unique */ #define SMBfclose 0x84 /* find close */ #define SMBinvalid 0xFE /* invalid command */ /* Any more ? */ #define SMBdatablockID 0x01 /* A data block identifier */ #define SMBdialectID 0x02 /* A dialect id */ #define SMBpathnameID 0x03 /* A pathname ID */ #define SMBasciiID 0x04 /* An ascii string ID */ #define SMBvariableblockID 0x05 /* A variable block ID */ /* some other defines we need */ /* Flags defines ... */ #define SMB_FLG2_NON_DOS 0x01 /* We know non dos names */ #define SMB_FLG2_EXT_ATR 0x02 /* We know about Extended Attributes */ #define SMB_FLG2_LNG_NAM 0x04 /* Long names ? */ typedef unsigned short WORD; typedef unsigned short UWORD; typedef unsigned int ULONG; typedef unsigned char BYTE; typedef unsigned char UCHAR; /* Some macros to allow access to actual packet data so that we */ /* can change the underlying representation of packets. */ /* */ /* The current formats vying for attention are a fragment */ /* approach where the SMB header is a fragment linked to the */ /* data portion with the transport protocol (rfcnb or whatever) */ /* being linked on the front. */ /* */ /* The other approach is where the whole packet is one array */ /* of bytes with space allowed on the front for the packet */ /* headers. */ #define SMB_Hdr(p) (char *)(p -> data) /* SMB Hdr def for File Sharing Protocol? From MS and Intel, */ /* Intel PN 138446 Doc Version 2.0, Nov 7, 1988. This def also */ /* applies to LANMAN1.0 as well as the Core Protocol */ /* The spec states that wct and bcc must be present, even if 0 */ /* We define these as offsets into a char SMB[] array for the */ /* sake of portability */ /* NOTE!. Some of the lenght defines, SMB__len do not include */ /* the data that follows in the SMB packet, so the code will have to */ /* take that into account. */ #define SMB_hdr_idf_offset 0 /* 0xFF,'SMB' 0-3 */ #define SMB_hdr_com_offset 4 /* BYTE 4 */ #define SMB_hdr_rcls_offset 5 /* BYTE 5 */ #define SMB_hdr_reh_offset 6 /* BYTE 6 */ #define SMB_hdr_err_offset 7 /* WORD 7 */ #define SMB_hdr_reb_offset 9 /* BYTE 9 */ #define SMB_hdr_flg_offset 9 /* same as reb ...*/ #define SMB_hdr_res_offset 10 /* 7 WORDs 10 */ #define SMB_hdr_res0_offset 10 /* WORD 10 */ #define SMB_hdr_flg2_offset 10 /* WORD */ #define SMB_hdr_res1_offset 12 /* WORD 12 */ #define SMB_hdr_res2_offset 14 #define SMB_hdr_res3_offset 16 #define SMB_hdr_res4_offset 18 #define SMB_hdr_res5_offset 20 #define SMB_hdr_res6_offset 22 #define SMB_hdr_tid_offset 24 #define SMB_hdr_pid_offset 26 #define SMB_hdr_uid_offset 28 #define SMB_hdr_mid_offset 30 #define SMB_hdr_wct_offset 32 #define SMB_hdr_len 33 /* 33 byte header? */ #define SMB_hdr_axc_offset 33 /* AndX Command */ #define SMB_hdr_axr_offset 34 /* AndX Reserved */ #define SMB_hdr_axo_offset 35 /* Offset from start to WCT of AndX cmd */ /* Format of the Negotiate Protocol SMB */ #define SMB_negp_bcc_offset 33 #define SMB_negp_buf_offset 35 /* Where the buffer starts */ #define SMB_negp_len 35 /* plus the data */ /* Format of the Negotiate Response SMB, for CoreProtocol, LM1.2 and */ /* NT LM 0.12. wct will be 1 for CoreProtocol, 13 for LM 1.2, and 17 */ /* for NT LM 0.12 */ #define SMB_negrCP_idx_offset 33 /* Response to the neg req */ #define SMB_negrCP_bcc_offset 35 #define SMB_negrLM_idx_offset 33 /* dialect index */ #define SMB_negrLM_sec_offset 35 /* Security mode */ #define SMB_sec_user_mask 0x01 /* 0 = share, 1 = user */ #define SMB_sec_encrypt_mask 0x02 /* pick out encrypt */ #define SMB_negrLM_mbs_offset 37 /* max buffer size */ #define SMB_negrLM_mmc_offset 39 /* max mpx count */ #define SMB_negrLM_mnv_offset 41 /* max number of VCs */ #define SMB_negrLM_rm_offset 43 /* raw mode support bit vec*/ #define SMB_read_raw_mask 0x01 #define SMB_write_raw_mask 0x02 #define SMB_negrLM_sk_offset 45 /* session key, 32 bits */ #define SMB_negrLM_st_offset 49 /* Current server time */ #define SMB_negrLM_sd_offset 51 /* Current server date */ #define SMB_negrLM_stz_offset 53 /* Server Time Zone */ #define SMB_negrLM_ekl_offset 55 /* encryption key length */ #define SMB_negrLM_res_offset 57 /* reserved */ #define SMB_negrLM_bcc_offset 59 /* bcc */ #define SMB_negrLM_len 61 /* 61 bytes ? */ #define SMB_negrLM_buf_offset 61 /* Where the fun begins */ #define SMB_negrNTLM_idx_offset 33 /* Selected protocol */ #define SMB_negrNTLM_sec_offset 35 /* Security more */ #define SMB_negrNTLM_mmc_offset 36 /* Different format above */ #define SMB_negrNTLM_mnv_offset 38 /* Max VCs */ #define SMB_negrNTLM_mbs_offset 40 /* MBS now a long */ #define SMB_negrNTLM_mrs_offset 44 /* Max raw size */ #define SMB_negrNTLM_sk_offset 48 /* Session Key */ #define SMB_negrNTLM_cap_offset 52 /* Capabilities */ #define SMB_negrNTLM_stl_offset 56 /* Server time low */ #define SMB_negrNTLM_sth_offset 60 /* Server time high */ #define SMB_negrNTLM_stz_offset 64 /* Server time zone */ #define SMB_negrNTLM_ekl_offset 66 /* Encrypt key len */ #define SMB_negrNTLM_bcc_offset 67 /* Bcc */ #define SMB_negrNTLM_len 69 #define SMB_negrNTLM_buf_offset 69 /* Offsets related to Tree Connect */ #define SMB_tcon_bcc_offset 33 #define SMB_tcon_buf_offset 35 /* where the data is for tcon */ #define SMB_tcon_len 35 /* plus the data */ #define SMB_tconr_mbs_offset 33 /* max buffer size */ #define SMB_tconr_tid_offset 35 /* returned tree id */ #define SMB_tconr_bcc_offset 37 #define SMB_tconr_len 39 #define SMB_tconx_axc_offset 33 /* And X Command */ #define SMB_tconx_axr_offset 34 /* reserved */ #define SMB_tconx_axo_offset 35 /* Next command offset */ #define SMB_tconx_flg_offset 37 /* Flags, bit0=1 means disc TID */ #define SMB_tconx_pwl_offset 39 /* Password length */ #define SMB_tconx_bcc_offset 41 /* bcc */ #define SMB_tconx_buf_offset 43 /* buffer */ #define SMB_tconx_len 43 /* up to data ... */ #define SMB_tconxr_axc_offset 33 /* Where the AndX Command is */ #define SMB_tconxr_axr_offset 34 /* Reserved */ #define SMB_tconxr_axo_offset 35 /* AndX offset location */ /* Offsets related to tree_disconnect */ #define SMB_tdis_bcc_offset 33 /* bcc */ #define SMB_tdis_len 35 /* total len */ #define SMB_tdisr_bcc_offset 33 /* bcc */ #define SMB_tdisr_len 35 /* Offsets related to Open Request */ #define SMB_open_mod_offset 33 /* Mode to open with */ #define SMB_open_atr_offset 35 /* Attributes of file */ #define SMB_open_bcc_offset 37 /* bcc */ #define SMB_open_buf_offset 39 /* File name */ #define SMB_open_len 39 /* Plus the file name */ #define SMB_openx_axc_offset 33 /* Next command */ #define SMB_openx_axr_offset 34 /* Reserved */ #define SMB_openx_axo_offset 35 /* offset of next wct */ #define SMB_openx_flg_offset 37 /* Flags, bit0 = need more info */ /* bit1 = exclusive oplock */ /* bit2 = batch oplock */ #define SMB_openx_mod_offset 39 /* mode to open with */ #define SMB_openx_atr_offset 41 /* search attributes */ #define SMB_openx_fat_offset 43 /* File attributes */ #define SMB_openx_tim_offset 45 /* time and date of creat */ #define SMB_openx_ofn_offset 49 /* Open function */ #define SMB_openx_als_offset 51 /* Space to allocate on */ #define SMB_openx_res_offset 55 /* reserved */ #define SMB_openx_bcc_offset 63 /* bcc */ #define SMB_openx_buf_offset 65 /* Where file name goes */ #define SMB_openx_len 65 #define SMB_openr_fid_offset 33 /* FID returned */ #define SMB_openr_atr_offset 35 /* Attributes opened with */ #define SMB_openr_tim_offset 37 /* Last mod time of file */ #define SMB_openr_fsz_offset 41 /* File size 4 bytes */ #define SMB_openr_acc_offset 45 /* Access allowed */ #define SMB_openr_bcc_offset 47 #define SMB_openr_len 49 #define SMB_openxr_axc_offset 33 /* And X command */ #define SMB_openxr_axr_offset 34 /* reserved */ #define SMB_openxr_axo_offset 35 /* offset to next command */ #define SMB_openxr_fid_offset 37 /* FID returned */ #define SMB_openxr_fat_offset 39 /* File attributes returned*/ #define SMB_openxr_tim_offset 41 /* File creation date etc */ #define SMB_openxr_fsz_offset 45 /* Size of file */ #define SMB_openxr_acc_offset 49 /* Access granted */ #define SMB_clos_fid_offset 33 /* FID to close */ #define SMB_clos_tim_offset 35 /* Last mod time */ #define SMB_clos_bcc_offset 39 /* bcc */ #define SMB_clos_len 41 /* Offsets related to Write requests */ #define SMB_write_fid_offset 33 /* FID to write */ #define SMB_write_cnt_offset 35 /* bytes to write */ #define SMB_write_ofs_offset 37 /* location to write to */ #define SMB_write_clf_offset 41 /* advisory count left */ #define SMB_write_bcc_offset 43 /* bcc = data bytes + 3 */ #define SMB_write_buf_offset 45 /* Data=0x01, len, data */ #define SMB_write_len 45 /* plus the data ... */ #define SMB_writr_cnt_offset 33 /* Count of bytes written */ #define SMB_writr_bcc_offset 35 /* bcc */ #define SMB_writr_len 37 /* Offsets related to read requests */ #define SMB_read_fid_offset 33 /* FID of file to read */ #define SMB_read_cnt_offset 35 /* count of words to read */ #define SMB_read_ofs_offset 37 /* Where to read from */ #define SMB_read_clf_offset 41 /* Advisory count to go */ #define SMB_read_bcc_offset 43 #define SMB_read_len 45 #define SMB_readr_cnt_offset 33 /* Count of bytes returned */ #define SMB_readr_res_offset 35 /* 4 shorts reserved, 8 bytes */ #define SMB_readr_bcc_offset 43 /* bcc */ #define SMB_readr_bff_offset 45 /* buffer format char = 0x01 */ #define SMB_readr_len_offset 46 /* buffer len */ #define SMB_readr_len 45 /* length of the readr before data */ /* Offsets for Create file */ #define SMB_creat_atr_offset 33 /* Attributes of new file ... */ #define SMB_creat_tim_offset 35 /* Time of creation */ #define SMB_creat_dat_offset 37 /* 4004BCE :-) */ #define SMB_creat_bcc_offset 39 /* bcc */ #define SMB_creat_buf_offset 41 #define SMB_creat_len 41 /* Before the data */ #define SMB_creatr_fid_offset 33 /* FID of created file */ /* Offsets for Delete file */ #define SMB_delet_sat_offset 33 /* search attribites */ #define SMB_delet_bcc_offset 35 /* bcc */ #define SMB_delet_buf_offset 37 #define SMB_delet_len 37 /* Offsets for SESSION_SETUP_ANDX for both LM and NT LM protocols */ #define SMB_ssetpLM_mbs_offset 37 /* Max buffer Size, allow for AndX */ #define SMB_ssetpLM_mmc_offset 39 /* max multiplex count */ #define SMB_ssetpLM_vcn_offset 41 /* VC number if new VC */ #define SMB_ssetpLM_snk_offset 43 /* Session Key */ #define SMB_ssetpLM_pwl_offset 47 /* password length */ #define SMB_ssetpLM_res_offset 49 /* reserved */ #define SMB_ssetpLM_bcc_offset 53 /* bcc */ #define SMB_ssetpLM_len 55 /* before data ... */ #define SMB_ssetpLM_buf_offset 55 #define SMB_ssetpNTLM_mbs_offset 37 /* Max Buffer Size for NT LM 0.12 */ /* and above */ #define SMB_ssetpNTLM_mmc_offset 39 /* Max Multiplex count */ #define SMB_ssetpNTLM_vcn_offset 41 /* VC Number */ #define SMB_ssetpNTLM_snk_offset 43 /* Session key */ #define SMB_ssetpNTLM_cipl_offset 47 /* Case Insensitive PW Len */ #define SMB_ssetpNTLM_cspl_offset 49 /* Unicode pw len */ #define SMB_ssetpNTLM_res_offset 51 /* reserved */ #define SMB_ssetpNTLM_cap_offset 55 /* server capabilities */ #define SMB_ssetpNTLM_bcc_offset 59 /* bcc */ #define SMB_ssetpNTLM_len 61 /* before data */ #define SMB_ssetpNTLM_buf_offset 61 #define SMB_ssetpr_axo_offset 35 /* Offset of next response ... */ #define SMB_ssetpr_act_offset 37 /* action, bit 0 = 1 => guest */ #define SMB_ssetpr_bcc_offset 39 /* bcc */ #define SMB_ssetpr_buf_offset 41 /* Native OS etc */ /* Offsets for SMB create directory */ #define SMB_creatdir_bcc_offset 33 /* only a bcc here */ #define SMB_creatdir_buf_offset 35 /* Where things start */ #define SMB_creatdir_len 35 /* Offsets for SMB delete directory */ #define SMB_deletdir_bcc_offset 33 /* only a bcc here */ #define SMB_deletdir_buf_offset 35 /* where things start */ #define SMB_deletdir_len 35 /* Offsets for SMB check directory */ #define SMB_checkdir_bcc_offset 33 /* Only a bcc here */ #define SMB_checkdir_buf_offset 35 /* where things start */ #define SMB_checkdir_len 35 /* Offsets for SMB search */ #define SMB_search_mdc_offset 33 /* Max Dir ents to return */ #define SMB_search_atr_offset 35 /* Search attributes */ #define SMB_search_bcc_offset 37 /* bcc */ #define SMB_search_buf_offset 39 /* where the action is */ #define SMB_search_len 39 #define SMB_searchr_dec_offset 33 /* Dir ents returned */ #define SMB_searchr_bcc_offset 35 /* bcc */ #define SMB_searchr_buf_offset 37 /* Where the action starts */ #define SMB_searchr_len 37 /* before the dir ents */ #define SMB_searchr_dirent_len 43 /* 53 bytes */ /* Defines for SMB transact and transact2 calls */ #define SMB_trans_tpc_offset 33 /* Total param count */ #define SMB_trans_tdc_offset 35 /* total Data count */ #define SMB_trans_mpc_offset 37 /* Max params bytes to return */ #define SMB_trans_mdc_offset 39 /* Max data bytes to return */ #define SMB_trans_msc_offset 41 /* Max setup words to return */ #define SMB_trans_rs1_offset 42 /* Reserved byte */ #define SMB_trans_flg_offset 43 /* flags */ #define SMB_trans_tmo_offset 45 /* Timeout, long */ #define SMB_trans_rs2_offset 49 /* Next reserved */ #define SMB_trans_pbc_offset 51 /* Param Byte count in buf */ #define SMB_trans_pbo_offset 53 /* Offset to param bytes */ #define SMB_trans_dbc_offset 55 /* Data byte count in buf */ #define SMB_trans_dbo_offset 57 /* Data byte offset */ #define SMB_trans_suc_offset 59 /* Setup count - byte */ #define SMB_trans_rs3_offset 60 /* Reserved to pad ... */ #define SMB_trans_len 61 /* Up to setup, still need bcc */ #define SMB_transr_tpc_offset 33 /* Total param bytes returned */ #define SMB_transr_tdc_offset 35 #define SMB_transr_rs1_offset 37 #define SMB_transr_pbc_offset 39 #define SMB_transr_pbo_offset 41 #define SMB_transr_pdi_offset 43 /* parameter displacement */ #define SMB_transr_dbc_offset 45 #define SMB_transr_dbo_offset 47 #define SMB_transr_ddi_offset 49 #define SMB_transr_suc_offset 51 #define SMB_transr_rs2_offset 52 #define SMB_transr_len 53 /* Bit masks for SMB Capabilities ... */ #define SMB_cap_raw_mode 0x0001 #define SMB_cap_mpx_mode 0x0002 #define SMB_cap_unicode 0x0004 #define SMB_cap_large_files 0x0008 #define SMB_cap_nt_smbs 0x0010 #define SMB_rpc_remote_apis 0x0020 #define SMB_cap_nt_status 0x0040 #define SMB_cap_level_II_oplocks 0x0080 #define SMB_cap_lock_and_read 0x0100 #define SMB_cap_nt_find 0x0200 /* SMB LANMAN api call defines */ #define SMB_LMapi_SetUserInfo 0x0072 #define SMB_LMapi_UserPasswordSet 0x0073 /* Structures and defines we use in the client interface */ /* The protocols we might support. Perhaps a bit ambitious, as only RFCNB */ /* has any support so far 0(sometimes called NBT) */ typedef enum {SMB_RFCNB, SMB_IPXNB, SMB_NETBEUI, SMB_X25} SMB_Transport_Types; typedef enum {SMB_Con_FShare, SMB_Con_PShare, SMB_Con_IPC} SMB_Con_Types; typedef enum {SMB_State_NoState, SMB_State_Stopped, SMB_State_Started} SMB_State_Types; /* The following two arrays need to be in step! */ /* We must make it possible for callers to specify these ... */ static const char *SMB_Prots[] = {"PC NETWORK PROGRAM 1.0", "MICROSOFT NETWORKS 1.03", "MICROSOFT NETWORKS 3.0", "DOS LANMAN1.0", "LANMAN1.0", "DOS LM1.2X002", "LM1.2X002", "DOS LANMAN2.1", "LANMAN2.1", "Samba", "NT LM 0.12", "NT LANMAN 1.0", NULL}; static const int SMB_Types[] = {SMB_P_Core, SMB_P_CorePlus, SMB_P_DOSLanMan1, SMB_P_DOSLanMan1, SMB_P_LanMan1, SMB_P_DOSLanMan2, SMB_P_LanMan2, SMB_P_LanMan2_1, SMB_P_LanMan2_1, SMB_P_NT1, SMB_P_NT1, SMB_P_NT1, -1}; typedef struct SMB_Status { union { struct { unsigned char ErrorClass; unsigned char Reserved; unsigned short Error; } DosError; unsigned int NtStatus; } status; } SMB_Status; typedef struct SMB_Tree_Structure * SMB_Tree_Handle; typedef struct SMB_Connect_Def * SMB_Handle_Type; struct SMB_Connect_Def { SMB_Handle_Type Next_Con, Prev_Con; /* Next and previous conn */ int protocol; /* What is the protocol */ int prot_IDX; /* And what is the index */ void *Trans_Connect; /* The connection */ /* All these strings should be malloc'd */ char service[80], username[80], password[80], desthost[80], sock_options[80]; char address[80], myname[80]; SMB_Tree_Handle first_tree, last_tree; /* List of trees on this server */ int gid; /* Group ID, do we need it? */ int mid; /* Multiplex ID? We might need one per con */ int pid; /* Process ID */ int uid; /* Authenticated user id. */ /* It is pretty clear that we need to bust some of */ /* these out into a per TCon record, as there may */ /* be multiple TCon's per server, etc ... later */ int port; /* port to use in case not default, this is a TCPism! */ int max_xmit; /* Max xmit permitted by server */ int Security; /* 0 = share, 1 = user */ int Raw_Support; /* bit 0 = 1 = Read Raw supported, 1 = 1 Write raw */ BOOL encrypt_passwords; /* FALSE = don't */ int MaxMPX, MaxVC, MaxRaw; unsigned int SessionKey, Capabilities; int SvrTZ; /* Server Time Zone */ int Encrypt_Key_Len; char Encrypt_Key[80], Domain[80], PDomain[80], OSName[80], LMType[40]; char Svr_OS[80], Svr_LMType[80], Svr_PDom[80]; }; #define SMBLIB_DEFAULT_DOMAIN "STAFF" #define SMBLIB_DEFAULT_OSNAME "UNIX of some type" #define SMBLIB_DEFAULT_LMTYPE "SMBlib LM2.1 minus a bit" #define SMBLIB_MAX_XMIT 65535 #define SMB_Sec_Mode_Share 0 #define SMB_Sec_Mode_User 1 /* A Tree_Structure */ struct SMB_Tree_Structure { SMB_Tree_Handle next, prev; SMB_Handle_Type con; char path[129]; char device_type[20]; int mbs; /* Local MBS */ int tid; }; typedef struct SMB_File_Def SMB_File; struct SMB_File_Def { SMB_Tree_Handle tree; char filename[256]; /* We should malloc this ... */ UWORD fid; unsigned int lastmod; unsigned int size; /* Could blow up if 64bit files supported */ UWORD access; off_t fileloc; }; /* global Variables for the library */ extern SMB_State_Types SMBlib_State; #ifndef SMBLIB_ERRNO extern int SMBlib_errno; extern int SMBlib_SMB_Error; /* last Error */ #endif SMB_Tree_Handle SMB_TreeConnect(SMB_Handle_Type con, SMB_Tree_Handle tree, char *path, char *password, char *dev); freeradius-server/src/modules/rlm_smb/smblib-util.c000066400000000000000000000500311257552170400230030ustar00rootroot00000000000000/* UNIX SMBlib NetBIOS implementation Version 1.0 SMBlib Utility Routines Copyright (C) Richard Sharpe 1996 Copyright 2006 The FreeRADIUS server project */ /* This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include RCSID("$Id$") #include #include "smblib-priv.h" #include "rfcnb.h" /* Print out an SMB pkt in all its gory detail ... */ void SMB_Print_Pkt(FILE fd, RFCNB_Pkt *pkt, BOOL command, int Offset, int Len) { /* Well, just how do we do this ... print it I suppose */ /* Print out the SMB header ... */ /* Print the command */ /* Print the other bits in the header */ /* etc */ } /* Convert a DOS Date_Time to a local host type date time for printing */ char *SMB_DOSTimToStr(int DOS_time) { static char SMB_Time_Temp[48]; int DOS_sec, DOS_min, DOS_hour, DOS_day, DOS_month, DOS_year; SMB_Time_Temp[0] = 0; DOS_sec = (DOS_time & 0x001F) * 2; DOS_min = (DOS_time & 0x07E0) >> 5; DOS_hour = ((DOS_time & 0xF800) >> 11); DOS_day = (DOS_time & 0x001F0000) >> 16; DOS_month = (DOS_time & 0x01E00000) >> 21; DOS_year = ((DOS_time & 0xFE000000) >> 25) + 80; sprintf(SMB_Time_Temp, "%2d/%02d/%2d %2d:%02d:%02d", DOS_day, DOS_month, DOS_year, DOS_hour, DOS_min, DOS_sec); return(SMB_Time_Temp); } /* Convert an attribute byte/word etc to a string ... We return a pointer to a static string which we guarantee is long enough. If verbose is true, we print out long form of strings ... */ char *SMB_AtrToStr(int attribs, BOOL verbose) { static char SMB_Attrib_Temp[128]; SMB_Attrib_Temp[0] = 0; if (attribs & SMB_FA_ROF) strcat(SMB_Attrib_Temp, (verbose?"Read Only ":"R")); if (attribs & SMB_FA_HID) strcat(SMB_Attrib_Temp, (verbose?"Hidden ":"H")); if (attribs & SMB_FA_SYS) strcat(SMB_Attrib_Temp, (verbose?"System ":"S")); if (attribs & SMB_FA_VOL) strcat(SMB_Attrib_Temp, (verbose?"Volume ":"V")); if (attribs & SMB_FA_DIR) strcat(SMB_Attrib_Temp, (verbose?"Directory ":"D")); if (attribs & SMB_FA_ARC) strcat(SMB_Attrib_Temp, (verbose?"Archive ":"A")); return(SMB_Attrib_Temp); } /* Pick up the Max Buffer Size from the Tree Structure ... */ int SMB_Get_Tree_MBS(SMB_Tree_Handle tree) { if (tree != NULL) { return(tree -> mbs); } else { return(SMBlibE_BAD); } } /* Pick up the Max buffer size */ int SMB_Get_Max_Buf_Siz(SMB_Handle_Type Con_Handle) { if (Con_Handle != NULL) { return(Con_Handle -> max_xmit); } else { return(SMBlibE_BAD); } } /* Pickup the protocol index from the connection structure */ int SMB_Get_Protocol_IDX(SMB_Handle_Type Con_Handle) { if (Con_Handle != NULL) { return(Con_Handle -> prot_IDX); } else { return(0xFFFF); /* Invalid protocol */ } } /* Pick up the protocol from the connection structure */ int SMB_Get_Protocol(SMB_Handle_Type Con_Handle) { if (Con_Handle != NULL) { return(Con_Handle -> protocol); } else { return(0xFFFF); /* Invalid protocol */ } } /* Figure out what protocol was accepted, given the list of dialect strings */ /* We offered, and the index back from the server. We allow for a user */ /* supplied list, and assume that it is a subset of our list */ int SMB_Figure_Protocol(char *dialects[], int prot_index) { int i; if (dialects == SMB_Prots) { /* The jobs is easy, just index into table */ return(SMB_Types[prot_index]); } else { /* Search through SMB_Prots looking for a match */ for (i = 0; SMB_Prots[i] != NULL; i++) { if (strcmp(dialects[prot_index], SMB_Prots[i]) == 0) { /* A match */ return(SMB_Types[i]); } } /* If we got here, then we are in trouble, because the protocol was not */ /* One we understand ... */ return(SMB_P_Unknown); } } /* Negotiate the protocol we will use from the list passed in Prots */ /* we return the index of the accepted protocol in NegProt, -1 indicates */ /* none acceptible, and our return value is 0 if ok, <0 if problems */ int SMB_Negotiate(SMB_Handle_Type Con_Handle, char *Prots[]) { struct RFCNB_Pkt *pkt; int prots_len, i, pkt_len, prot, alloc_len; char *p; /* Figure out how long the prot list will be and allocate space for it */ prots_len = 0; for (i = 0; Prots[i] != NULL; i++) { prots_len = prots_len + strlen(Prots[i]) + 2; /* Account for null etc */ } /* The -1 accounts for the one byte smb_buf we have because some systems */ /* don't like char msg_buf[] */ pkt_len = SMB_negp_len + prots_len; /* Make sure that the pkt len is long enough for the max response ... */ /* Which is a problem, because the encryption key len eec may be long */ if (pkt_len < (SMB_hdr_wct_offset + (19 * 2) + 40)) { alloc_len = SMB_hdr_wct_offset + (19 * 2) + 40; } else { alloc_len = pkt_len; } pkt = (struct RFCNB_Pkt *)RFCNB_Alloc_Pkt(alloc_len); if (pkt == NULL) { SMBlib_errno = SMBlibE_NoSpace; return(SMBlibE_BAD); } /* Now plug in the bits we need */ bzero(SMB_Hdr(pkt), SMB_negp_len); SIVAL(SMB_Hdr(pkt), SMB_hdr_idf_offset, SMB_DEF_IDF); /* Plunk in IDF */ *(SMB_Hdr(pkt) + SMB_hdr_com_offset) = SMBnegprot; SSVAL(SMB_Hdr(pkt), SMB_hdr_pid_offset, Con_Handle -> pid); SSVAL(SMB_Hdr(pkt), SMB_hdr_tid_offset, 0); SSVAL(SMB_Hdr(pkt), SMB_hdr_mid_offset, Con_Handle -> mid); SSVAL(SMB_Hdr(pkt), SMB_hdr_uid_offset, Con_Handle -> uid); *(SMB_Hdr(pkt) + SMB_hdr_wct_offset) = 0; SSVAL(SMB_Hdr(pkt), SMB_negp_bcc_offset, prots_len); /* Now copy the prot strings in with the right stuff */ p = (char *)(SMB_Hdr(pkt) + SMB_negp_buf_offset); for (i = 0; Prots[i] != NULL; i++) { *p = SMBdialectID; strcpy(p + 1, Prots[i]); p = p + strlen(Prots[i]) + 2; /* Adjust len of p for null plus dialectID */ } /* Now send the packet and sit back ... */ if (RFCNB_Send(Con_Handle -> Trans_Connect, pkt, pkt_len) < 0){ #ifdef DEBUG fprintf(stderr, "Error sending negotiate protocol\n"); #endif RFCNB_Free_Pkt(pkt); SMBlib_errno = -SMBlibE_SendFailed; /* Failed, check lower layer errno */ return(SMBlibE_BAD); } /* Now get the response ... */ if (RFCNB_Recv(Con_Handle -> Trans_Connect, pkt, alloc_len) < 0) { #ifdef DEBUG fprintf(stderr, "Error receiving response to negotiate\n"); #endif RFCNB_Free_Pkt(pkt); SMBlib_errno = -SMBlibE_RecvFailed; /* Failed, check lower layer errno */ return(SMBlibE_BAD); } if (CVAL(SMB_Hdr(pkt), SMB_hdr_rcls_offset) != SMBC_SUCCESS) { /* Process error */ #ifdef DEBUG fprintf(stderr, "SMB_Negotiate failed with errorclass = %i, Error Code = %i\n", CVAL(SMB_Hdr(pkt), SMB_hdr_rcls_offset), SVAL(SMB_Hdr(pkt), SMB_hdr_err_offset)); #endif SMBlib_SMB_Error = IVAL(SMB_Hdr(pkt), SMB_hdr_rcls_offset); RFCNB_Free_Pkt(pkt); SMBlib_errno = SMBlibE_Remote; return(SMBlibE_BAD); } if (SVAL(SMB_Hdr(pkt), SMB_negrCP_idx_offset) == 0xFFFF) { #ifdef DEBUG fprintf(stderr, "None of our protocols was accepted ... "); #endif RFCNB_Free_Pkt(pkt); SMBlib_errno = SMBlibE_NegNoProt; return(SMBlibE_BAD); } /* Now, unpack the info from the response, if any and evaluate the proto */ /* selected. We must make sure it is one we like ... */ Con_Handle -> prot_IDX = prot = SVAL(SMB_Hdr(pkt), SMB_negrCP_idx_offset); Con_Handle -> protocol = SMB_Figure_Protocol(Prots, prot); if (Con_Handle -> protocol == SMB_P_Unknown) { /* No good ... */ RFCNB_Free_Pkt(pkt); SMBlib_errno = SMBlibE_ProtUnknown; return(SMBlibE_BAD); } switch (CVAL(SMB_Hdr(pkt), SMB_hdr_wct_offset)) { case 0x01: /* No more info ... */ break; case 13: /* Up to and including LanMan 2.1 */ Con_Handle -> Security = SVAL(SMB_Hdr(pkt), SMB_negrLM_sec_offset); Con_Handle -> encrypt_passwords = ((Con_Handle -> Security & SMB_sec_encrypt_mask) != 0x00); Con_Handle -> Security = Con_Handle -> Security & SMB_sec_user_mask; Con_Handle -> max_xmit = SVAL(SMB_Hdr(pkt), SMB_negrLM_mbs_offset); Con_Handle -> MaxMPX = SVAL(SMB_Hdr(pkt), SMB_negrLM_mmc_offset); Con_Handle -> MaxVC = SVAL(SMB_Hdr(pkt), SMB_negrLM_mnv_offset); Con_Handle -> Raw_Support = SVAL(SMB_Hdr(pkt), SMB_negrLM_rm_offset); Con_Handle -> SessionKey = IVAL(SMB_Hdr(pkt), SMB_negrLM_sk_offset); Con_Handle -> SvrTZ = SVAL(SMB_Hdr(pkt), SMB_negrLM_stz_offset); Con_Handle -> Encrypt_Key_Len = SVAL(SMB_Hdr(pkt), SMB_negrLM_ekl_offset); p = (SMB_Hdr(pkt) + SMB_negrLM_buf_offset); fprintf(stderr, "%s", (char *)(SMB_Hdr(pkt) + SMB_negrLM_buf_offset)); memcpy(Con_Handle->Encrypt_Key, p, 8); p = (SMB_Hdr(pkt) + SMB_negrLM_buf_offset + Con_Handle -> Encrypt_Key_Len); strncpy(p, Con_Handle -> Svr_PDom, sizeof(Con_Handle -> Svr_PDom) - 1); break; case 17: /* NT LM 0.12 and LN LM 1.0 */ Con_Handle -> Security = SVAL(SMB_Hdr(pkt), SMB_negrNTLM_sec_offset); Con_Handle -> encrypt_passwords = ((Con_Handle -> Security & SMB_sec_encrypt_mask) != 0x00); Con_Handle -> Security = Con_Handle -> Security & SMB_sec_user_mask; Con_Handle -> max_xmit = IVAL(SMB_Hdr(pkt), SMB_negrNTLM_mbs_offset); Con_Handle -> MaxMPX = SVAL(SMB_Hdr(pkt), SMB_negrNTLM_mmc_offset); Con_Handle -> MaxVC = SVAL(SMB_Hdr(pkt), SMB_negrNTLM_mnv_offset); Con_Handle -> MaxRaw = IVAL(SMB_Hdr(pkt), SMB_negrNTLM_mrs_offset); Con_Handle -> SessionKey = IVAL(SMB_Hdr(pkt), SMB_negrNTLM_sk_offset); Con_Handle -> SvrTZ = SVAL(SMB_Hdr(pkt), SMB_negrNTLM_stz_offset); Con_Handle -> Encrypt_Key_Len = CVAL(SMB_Hdr(pkt), SMB_negrNTLM_ekl_offset); p = (SMB_Hdr(pkt) + SMB_negrNTLM_buf_offset ); memcpy(Con_Handle -> Encrypt_Key, p, 8); p = (SMB_Hdr(pkt) + SMB_negrNTLM_buf_offset + Con_Handle -> Encrypt_Key_Len); strncpy(p, Con_Handle -> Svr_PDom, sizeof(Con_Handle -> Svr_PDom) - 1); break; default: #ifdef DEBUG fprintf(stderr, "Unknown NegProt response format ... Ignored\n"); fprintf(stderr, " wct = %i\n", CVAL(SMB_Hdr(pkt), SMB_hdr_wct_offset)); #endif break; } #ifdef DEBUG fprintf(stderr, "Protocol selected is: %i:%s\n", prot, Prots[prot]); #endif RFCNB_Free_Pkt(pkt); return(0); } /* Get our hostname */ void SMB_Get_My_Name(char *name, int len) { if (gethostname(name, len) < 0) { /* Error getting name */ strncpy(name, "unknown", len); /* Should check the error */ #ifdef DEBUG fprintf(stderr, "gethostname in SMB_Get_My_Name returned error:"); perror(""); #endif } /* only keep the portion up to the first "." */ } /* Send a TCON to the remote server ... */ SMB_Tree_Handle SMB_TreeConnect(SMB_Handle_Type Con_Handle, SMB_Tree_Handle Tree_Handle, char *path, char *password, char *device) { struct RFCNB_Pkt *pkt; int param_len, pkt_len; char *p; SMB_Tree_Handle tree; /* Figure out how much space is needed for path, password, dev ... */ if (path == NULL | password == NULL | device == NULL) { #ifdef DEBUG fprintf(stderr, "Bad parameter passed to SMB_TreeConnect\n"); #endif SMBlib_errno = SMBlibE_BadParam; return(NULL); } /* The + 2 is because of the \0 and the marker ... */ param_len = strlen(path) + 2 + strlen(password) + 2 + strlen(device) + 2; /* The -1 accounts for the one byte smb_buf we have because some systems */ /* don't like char msg_buf[] */ pkt_len = SMB_tcon_len + param_len; pkt = (struct RFCNB_Pkt *)RFCNB_Alloc_Pkt(pkt_len); if (pkt == NULL) { SMBlib_errno = SMBlibE_NoSpace; return(NULL); /* Should handle the error */ } /* Now allocate a tree for this to go into ... */ if (Tree_Handle == NULL) { tree = (SMB_Tree_Handle)malloc(sizeof(struct SMB_Tree_Structure)); if (tree == NULL) { RFCNB_Free_Pkt(pkt); SMBlib_errno = SMBlibE_NoSpace; return(NULL); } } else { tree = Tree_Handle; } tree -> next = tree -> prev = NULL; tree -> con = Con_Handle; strncpy(tree -> path, path, sizeof(tree -> path)); strncpy(tree -> device_type, device, sizeof(tree -> device_type)); /* Now plug in the values ... */ bzero(SMB_Hdr(pkt), SMB_tcon_len); SIVAL(SMB_Hdr(pkt), SMB_hdr_idf_offset, SMB_DEF_IDF); /* Plunk in IDF */ *(SMB_Hdr(pkt) + SMB_hdr_com_offset) = SMBtcon; SSVAL(SMB_Hdr(pkt), SMB_hdr_pid_offset, Con_Handle -> pid); SSVAL(SMB_Hdr(pkt), SMB_hdr_tid_offset, 0); SSVAL(SMB_Hdr(pkt), SMB_hdr_mid_offset, Con_Handle -> mid); SSVAL(SMB_Hdr(pkt), SMB_hdr_uid_offset, Con_Handle -> uid); *(SMB_Hdr(pkt) + SMB_hdr_wct_offset) = 0; SSVAL(SMB_Hdr(pkt), SMB_tcon_bcc_offset, param_len); /* Now copy the param strings in with the right stuff */ p = (char *)(SMB_Hdr(pkt) + SMB_tcon_buf_offset); *p = SMBasciiID; strcpy(p + 1, path); p = p + strlen(path) + 2; *p = SMBasciiID; strcpy(p + 1, password); p = p + strlen(password) + 2; *p = SMBasciiID; strcpy(p + 1, device); /* Now send the packet and sit back ... */ if (RFCNB_Send(Con_Handle -> Trans_Connect, pkt, pkt_len) < 0){ #ifdef DEBUG fprintf(stderr, "Error sending TCon request\n"); #endif if (Tree_Handle == NULL) free(tree); RFCNB_Free_Pkt(pkt); SMBlib_errno = -SMBlibE_SendFailed; return(NULL); } /* Now get the response ... */ if (RFCNB_Recv(Con_Handle -> Trans_Connect, pkt, pkt_len) < 0) { #ifdef DEBUG fprintf(stderr, "Error receiving response to TCon\n"); #endif if (Tree_Handle == NULL) free(tree); RFCNB_Free_Pkt(pkt); SMBlib_errno = -SMBlibE_RecvFailed; return(NULL); } /* Check out the response type ... */ if (CVAL(SMB_Hdr(pkt), SMB_hdr_rcls_offset) != SMBC_SUCCESS) { /* Process error */ #ifdef DEBUG fprintf(stderr, "SMB_TCon failed with errorclass = %i, Error Code = %i\n", CVAL(SMB_Hdr(pkt), SMB_hdr_rcls_offset), SVAL(SMB_Hdr(pkt), SMB_hdr_err_offset)); #endif if (Tree_Handle == NULL) free(tree); SMBlib_SMB_Error = IVAL(SMB_Hdr(pkt), SMB_hdr_rcls_offset); RFCNB_Free_Pkt(pkt); SMBlib_errno = SMBlibE_Remote; return(NULL); } tree -> tid = SVAL(SMB_Hdr(pkt), SMB_tconr_tid_offset); tree -> mbs = SVAL(SMB_Hdr(pkt), SMB_tconr_mbs_offset); #ifdef DEBUG fprintf(stderr, "TConn succeeded, with TID=%i, Max Xmit=%i\n", tree -> tid, tree -> mbs); #endif /* Now link the Tree to the Server Structure ... */ if (Con_Handle -> first_tree == NULL) { Con_Handle -> first_tree = tree; Con_Handle -> last_tree = tree; } else { Con_Handle -> last_tree -> next = tree; tree -> prev = Con_Handle -> last_tree; Con_Handle -> last_tree = tree; } RFCNB_Free_Pkt(pkt); return(tree); } int SMB_TreeDisconnect(SMB_Tree_Handle Tree_Handle, BOOL discard) { struct RFCNB_Pkt *pkt; int pkt_len; pkt_len = SMB_tdis_len; pkt = (struct RFCNB_Pkt *)RFCNB_Alloc_Pkt(pkt_len); if (pkt == NULL) { SMBlib_errno = SMBlibE_NoSpace; return(SMBlibE_BAD); /* Should handle the error */ } /* Now plug in the values ... */ bzero(SMB_Hdr(pkt), SMB_tdis_len); SIVAL(SMB_Hdr(pkt), SMB_hdr_idf_offset, SMB_DEF_IDF); /* Plunk in IDF */ *(SMB_Hdr(pkt) + SMB_hdr_com_offset) = SMBtdis; SSVAL(SMB_Hdr(pkt), SMB_hdr_pid_offset, Tree_Handle -> con -> pid); SSVAL(SMB_Hdr(pkt), SMB_hdr_mid_offset, Tree_Handle -> con -> mid); SSVAL(SMB_Hdr(pkt), SMB_hdr_uid_offset, Tree_Handle -> con -> uid); *(SMB_Hdr(pkt) + SMB_hdr_wct_offset) = 0; SSVAL(SMB_Hdr(pkt), SMB_hdr_tid_offset, Tree_Handle -> tid); SSVAL(SMB_Hdr(pkt), SMB_tcon_bcc_offset, 0); /* Now send the packet and sit back ... */ if (RFCNB_Send(Tree_Handle -> con -> Trans_Connect, pkt, pkt_len) < 0){ #ifdef DEBUG fprintf(stderr, "Error sending TDis request\n"); #endif RFCNB_Free_Pkt(pkt); SMBlib_errno = -SMBlibE_SendFailed; return(SMBlibE_BAD); } /* Now get the response ... */ if (RFCNB_Recv(Tree_Handle -> con -> Trans_Connect, pkt, pkt_len) < 0) { #ifdef DEBUG fprintf(stderr, "Error receiving response to TCon\n"); #endif RFCNB_Free_Pkt(pkt); SMBlib_errno = -SMBlibE_RecvFailed; return(SMBlibE_BAD); } /* Check out the response type ... */ if (CVAL(SMB_Hdr(pkt), SMB_hdr_rcls_offset) != SMBC_SUCCESS) { /* Process error */ #ifdef DEBUG fprintf(stderr, "SMB_TDis failed with errorclass = %i, Error Code = %i\n", CVAL(SMB_Hdr(pkt), SMB_hdr_rcls_offset), SVAL(SMB_Hdr(pkt), SMB_hdr_err_offset)); #endif SMBlib_SMB_Error = IVAL(SMB_Hdr(pkt), SMB_hdr_rcls_offset); RFCNB_Free_Pkt(pkt); SMBlib_errno = SMBlibE_Remote; return(SMBlibE_BAD); } Tree_Handle -> tid = 0xFFFF; /* Invalid TID */ Tree_Handle -> mbs = 0; /* Invalid */ #ifdef DEBUG fprintf(stderr, "Tree disconnect successful ...\n"); #endif /* What about the tree handle ? */ if (discard == TRUE) { /* Unlink it and free it ... */ if (Tree_Handle -> next == NULL) Tree_Handle -> con -> first_tree = Tree_Handle -> prev; else Tree_Handle -> next -> prev = Tree_Handle -> prev; if (Tree_Handle -> prev == NULL) Tree_Handle -> con -> last_tree = Tree_Handle -> next; else Tree_Handle -> prev -> next = Tree_Handle -> next; } RFCNB_Free_Pkt(pkt); return(0); } /* Pick up the last LMBlib error ... */ int SMB_Get_Last_Error() { return(SMBlib_errno); } /* Pick up the last error returned in an SMB packet */ /* We will need macros to extract error class and error code */ int SMB_Get_Last_SMB_Err() { return(SMBlib_SMB_Error); } /* Pick up the error message associated with an error from SMBlib */ /* Keep this table in sync with the message codes in smblib-common.h */ static const char *SMBlib_Error_Messages[] = { "Request completed sucessfully.", "Server returned a non-zero SMB Error Class and Code.", "A lower layer protocol error occurred.", "Function not yet implemented.", "The protocol negotiated does not support the request.", "No space available for operation.", "One or more bad parameters passed.", "None of the protocols we offered were accepted.", "The attempt to send an SMB request failed. See protocol error info.", "The attempt to get an SMB response failed. See protocol error info.", "The logon request failed, but you were logged in as guest.", "The attempt to call the remote server failed. See protocol error info.", "The protocol dialect specified in a NegProt and accepted by the server is unknown.", /* This next one simplifies error handling */ "No such error code.", NULL}; int SMB_Get_Error_Msg(int msg, char *msgbuf, int len) { if (msg >= 0) { strncpy(msgbuf, SMBlib_Error_Messages[msg>SMBlibE_NoSuchMsg?SMBlibE_NoSuchMsg:msg], len - 1); msgbuf[len - 1] = 0; /* Make sure it is a string */ } else { /* Add the lower layer message ... */ char prot_msg[1024]; msg = -msg; /* Make it positive */ strncpy(msgbuf, SMBlib_Error_Messages[msg>SMBlibE_NoSuchMsg?SMBlibE_NoSuchMsg:msg], len - 1); msgbuf[len - 1] = 0; /* make sure it is a string */ if (strlen(msgbuf) < len) { /* If there is space, put rest in */ strncat(msgbuf, "\n\t", len - strlen(msgbuf)); RFCNB_Get_Error(prot_msg, sizeof(prot_msg) - 1); strncat(msgbuf, prot_msg, len - strlen(msgbuf)); } } return 0; } freeradius-server/src/modules/rlm_smb/smblib.c000066400000000000000000000340361257552170400220370ustar00rootroot00000000000000/* UNIX SMBlib NetBIOS implementation Version 1.0 SMBlib Routines Copyright (C) Richard Sharpe 1996 Copyright 2006 The FreeRADIUS server project */ /* This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include RCSID("$Id$") #include #include #include "smblib-priv.h" #include "rfcnb.h" #define SMBLIB_ERRNO #define uchar unsigned char int SMBlib_errno; int SMBlib_SMB_Error; SMB_State_Types SMBlib_State; /* Initialize the SMBlib package */ int SMB_Init() { SMBlib_State = SMB_State_Started; signal(SIGPIPE, SIG_IGN); /* Ignore these ... */ /* If SMBLIB_Instrument is defines, turn on the instrumentation stuff */ #ifdef SMBLIB_INSTRUMENT SMBlib_Instrument_Init(); #endif return 0; } int SMB_Term() { #ifdef SMBLIB_INSTRUMENT SMBlib_Instrument_Term(); /* Clean up and print results */ #endif return 0; } /* SMB_Create: Create a connection structure and return for later use */ /* We have other helper routines to set variables */ SMB_Handle_Type SMB_Create_Con_Handle() { SMBlib_errno = SMBlibE_NotImpl; return(NULL); } int SMBlib_Set_Sock_NoDelay(SMB_Handle_Type Con_Handle, BOOL yn) { if (RFCNB_Set_Sock_NoDelay(Con_Handle -> Trans_Connect, yn) < 0) { #ifdef DEBUG #endif fprintf(stderr, "Setting no-delay on TCP socket failed ...\n"); } return(0); } /* SMB_Connect_Server: Connect to a server, but don't negotiate protocol */ /* or anything else ... */ SMB_Handle_Type SMB_Connect_Server(SMB_Handle_Type Con_Handle, char *server, char *NTdomain) { SMB_Handle_Type con; char called[80], calling[80], *address; int i; /* Get a connection structure if one does not exist */ con = Con_Handle; if (Con_Handle == NULL) { if ((con = (struct SMB_Connect_Def *)malloc(sizeof(struct SMB_Connect_Def))) == NULL) { SMBlib_errno = SMBlibE_NoSpace; return NULL; } } /* Init some things ... */ strcpy(con -> service, ""); strcpy(con -> username, ""); strcpy(con -> password, ""); strcpy(con -> sock_options, ""); strcpy(con -> address, ""); strcpy(con -> desthost, server); strcpy(con -> PDomain, NTdomain); strcpy(con -> OSName, SMBLIB_DEFAULT_OSNAME); strcpy(con -> LMType, SMBLIB_DEFAULT_LMTYPE); con -> first_tree = con -> last_tree = NULL; SMB_Get_My_Name(con -> myname, sizeof(con -> myname)); con -> port = 0; /* No port selected */ /* Get some things we need for the SMB Header */ con -> pid = getpid(); con -> mid = con -> pid; /* This will do for now ... */ con -> uid = 0; /* Until we have done a logon, no uid ... */ con -> gid = getgid(); /* Now connect to the remote end, but first upper case the name of the service we are going to call, sine some servers want it in uppercase */ for (i=0; i < strlen(server); i++) called[i] = toupper(server[i]); called[strlen(server)] = 0; /* Make it a string */ for (i=0; i < strlen(con -> myname); i++) calling[i] = toupper(con -> myname[i]); calling[strlen(con -> myname)] = 0; /* Make it a string */ if (strcmp(con -> address, "") == 0) address = con -> desthost; else address = con -> address; con -> Trans_Connect = RFCNB_Call(called, calling, address, /* Protocol specific */ con -> port); /* Did we get one? */ if (con -> Trans_Connect == NULL) { if (Con_Handle == NULL) { Con_Handle = NULL; free(con); } SMBlib_errno = -SMBlibE_CallFailed; return NULL; } return(con); } /* SMB_Connect: Connect to the indicated server */ /* If Con_Handle == NULL then create a handle and connect, otherwise */ /* use the handle passed */ static const char *SMB_Prots_Restrict[] = {"PC NETWORK PROGRAM 1.0", NULL}; SMB_Handle_Type SMB_Connect(SMB_Handle_Type Con_Handle, SMB_Tree_Handle *tree, char *service, char *username, char *password) { SMB_Handle_Type con; char *host, *address; char temp[80], called[80], calling[80]; int i; /* Get a connection structure if one does not exist */ con = Con_Handle; if (Con_Handle == NULL) { if ((con = (struct SMB_Connect_Def *)malloc(sizeof(struct SMB_Connect_Def))) == NULL) { SMBlib_errno = SMBlibE_NoSpace; return NULL; } } /* Init some things ... */ strcpy(con -> service, service); strcpy(con -> username, username); strcpy(con -> password, password); strcpy(con -> sock_options, ""); strcpy(con -> address, ""); strcpy(con -> PDomain, SMBLIB_DEFAULT_DOMAIN); strcpy(con -> OSName, SMBLIB_DEFAULT_OSNAME); strcpy(con -> LMType, SMBLIB_DEFAULT_LMTYPE); con -> first_tree = con -> last_tree = NULL; SMB_Get_My_Name(con -> myname, sizeof(con -> myname)); con -> port = 0; /* No port selected */ /* Get some things we need for the SMB Header */ con -> pid = getpid(); con -> mid = con -> pid; /* This will do for now ... */ con -> uid = 0; /* Until we have done a logon, no uid */ con -> gid = getgid(); /* Now figure out the host portion of the service */ strcpy(temp, service); host = strtok(temp, "/\\"); /* Separate host name portion */ strcpy(con -> desthost, host); /* Now connect to the remote end, but first upper case the name of the service we are going to call, sine some servers want it in uppercase */ for (i=0; i < strlen(host); i++) called[i] = toupper(host[i]); called[strlen(host)] = 0; /* Make it a string */ for (i=0; i < strlen(con -> myname); i++) calling[i] = toupper(con -> myname[i]); calling[strlen(con -> myname)] = 0; /* Make it a string */ if (strcmp(con -> address, "") == 0) address = con -> desthost; else address = con -> address; con -> Trans_Connect = RFCNB_Call(called, calling, address, /* Protocol specific */ con -> port); /* Did we get one? */ if (con -> Trans_Connect == NULL) { if (Con_Handle == NULL) { free(con); Con_Handle = NULL; } SMBlib_errno = -SMBlibE_CallFailed; return NULL; } /* Now, negotiate the protocol */ if (SMB_Negotiate(con, SMB_Prots_Restrict) < 0) { /* Hmmm what should we do here ... We have a connection, but could not negotiate ... */ return NULL; } /* Now connect to the service ... */ if ((*tree = SMB_TreeConnect(con, NULL, service, password, "A:")) == NULL) { return NULL; } return(con); } /* Logon to the server. That is, do a session setup if we can. We do not do */ /* Unicode yet! */ int SMB_Logon_Server(SMB_Handle_Type Con_Handle, char *UserName, char *PassWord) { struct RFCNB_Pkt *pkt; int param_len, pkt_len, pass_len; char *p, pword[256]; /* First we need a packet etc ... but we need to know what protocol has */ /* been negotiated to figure out if we can do it and what SMB format to */ /* use ... */ if (Con_Handle -> protocol < SMB_P_LanMan1) { SMBlib_errno = SMBlibE_ProtLow; return(SMBlibE_BAD); } strcpy(pword, PassWord); if (Con_Handle -> encrypt_passwords) { pass_len=24; SMBencrypt((uchar *) PassWord, (uchar *)Con_Handle -> Encrypt_Key,(uchar *)pword); } else pass_len=strlen(pword); /* Now build the correct structure */ if (Con_Handle -> protocol < SMB_P_NT1) { param_len = strlen(UserName) + 1 + pass_len + 1 + strlen(Con_Handle -> PDomain) + 1 + strlen(Con_Handle -> OSName) + 1; pkt_len = SMB_ssetpLM_len + param_len; pkt = (struct RFCNB_Pkt *)RFCNB_Alloc_Pkt(pkt_len); if (pkt == NULL) { SMBlib_errno = SMBlibE_NoSpace; return(SMBlibE_BAD); /* Should handle the error */ } bzero(SMB_Hdr(pkt), SMB_ssetpLM_len); SIVAL(SMB_Hdr(pkt), SMB_hdr_idf_offset, SMB_DEF_IDF); /* Plunk in IDF */ *(SMB_Hdr(pkt) + SMB_hdr_com_offset) = SMBsesssetupX; SSVAL(SMB_Hdr(pkt), SMB_hdr_pid_offset, Con_Handle -> pid); SSVAL(SMB_Hdr(pkt), SMB_hdr_tid_offset, 0); SSVAL(SMB_Hdr(pkt), SMB_hdr_mid_offset, Con_Handle -> mid); SSVAL(SMB_Hdr(pkt), SMB_hdr_uid_offset, Con_Handle -> uid); *(SMB_Hdr(pkt) + SMB_hdr_wct_offset) = 10; *(SMB_Hdr(pkt) + SMB_hdr_axc_offset) = 0xFF; /* No extra command */ SSVAL(SMB_Hdr(pkt), SMB_hdr_axo_offset, 0); SSVAL(SMB_Hdr(pkt), SMB_ssetpLM_mbs_offset, SMBLIB_MAX_XMIT); SSVAL(SMB_Hdr(pkt), SMB_ssetpLM_mmc_offset, 2); SSVAL(SMB_Hdr(pkt), SMB_ssetpLM_vcn_offset, Con_Handle -> pid); SIVAL(SMB_Hdr(pkt), SMB_ssetpLM_snk_offset, 0); SSVAL(SMB_Hdr(pkt), SMB_ssetpLM_pwl_offset, pass_len + 1); SIVAL(SMB_Hdr(pkt), SMB_ssetpLM_res_offset, 0); SSVAL(SMB_Hdr(pkt), SMB_ssetpLM_bcc_offset, param_len); /* Now copy the param strings in with the right stuff */ p = (char *)(SMB_Hdr(pkt) + SMB_ssetpLM_buf_offset); /* Copy in password, then the rest. Password has a null at end */ memcpy(p, pword, pass_len); p = p + pass_len + 1; strcpy(p, UserName); p = p + strlen(UserName); *p = 0; p = p + 1; strcpy(p, Con_Handle -> PDomain); p = p + strlen(Con_Handle -> PDomain); *p = 0; p = p + 1; strcpy(p, Con_Handle -> OSName); p = p + strlen(Con_Handle -> OSName); *p = 0; } else { /* We don't admit to UNICODE support ... */ param_len = strlen(UserName) + 1 + pass_len + strlen(Con_Handle -> PDomain) + 1 + strlen(Con_Handle -> OSName) + 1 + strlen(Con_Handle -> LMType) + 1; pkt_len = SMB_ssetpNTLM_len + param_len; pkt = (struct RFCNB_Pkt *)RFCNB_Alloc_Pkt(pkt_len); if (pkt == NULL) { SMBlib_errno = SMBlibE_NoSpace; return(-1); /* Should handle the error */ } bzero(SMB_Hdr(pkt), SMB_ssetpNTLM_len); SIVAL(SMB_Hdr(pkt), SMB_hdr_idf_offset, SMB_DEF_IDF); /* Plunk in IDF */ *(SMB_Hdr(pkt) + SMB_hdr_com_offset) = SMBsesssetupX; SSVAL(SMB_Hdr(pkt), SMB_hdr_pid_offset, Con_Handle -> pid); SSVAL(SMB_Hdr(pkt), SMB_hdr_tid_offset, 0); SSVAL(SMB_Hdr(pkt), SMB_hdr_mid_offset, Con_Handle -> mid); SSVAL(SMB_Hdr(pkt), SMB_hdr_uid_offset, Con_Handle -> uid); *(SMB_Hdr(pkt) + SMB_hdr_wct_offset) = 13; *(SMB_Hdr(pkt) + SMB_hdr_axc_offset) = 0xFF; /* No extra command */ SSVAL(SMB_Hdr(pkt), SMB_hdr_axo_offset, 0); SSVAL(SMB_Hdr(pkt), SMB_ssetpNTLM_mbs_offset, SMBLIB_MAX_XMIT); SSVAL(SMB_Hdr(pkt), SMB_ssetpNTLM_mmc_offset, 0); SSVAL(SMB_Hdr(pkt), SMB_ssetpNTLM_vcn_offset, 0); SIVAL(SMB_Hdr(pkt), SMB_ssetpNTLM_snk_offset, 0); SSVAL(SMB_Hdr(pkt), SMB_ssetpNTLM_cipl_offset, pass_len); SSVAL(SMB_Hdr(pkt), SMB_ssetpNTLM_cspl_offset, 0); SIVAL(SMB_Hdr(pkt), SMB_ssetpNTLM_res_offset, 0); SIVAL(SMB_Hdr(pkt), SMB_ssetpNTLM_cap_offset, 0); SSVAL(SMB_Hdr(pkt), SMB_ssetpNTLM_bcc_offset, param_len); /* Now copy the param strings in with the right stuff */ p = (char *)(SMB_Hdr(pkt) + SMB_ssetpNTLM_buf_offset); /* Copy in password, then the rest. Password has no null at end */ memcpy(p, pword, pass_len); p = p + pass_len; strcpy(p, UserName); p = p + strlen(UserName); *p = 0; p = p + 1; strcpy(p, Con_Handle -> PDomain); p = p + strlen(Con_Handle -> PDomain); *p = 0; p = p + 1; strcpy(p, Con_Handle -> OSName); p = p + strlen(Con_Handle -> OSName); *p = 0; p = p + 1; strcpy(p, Con_Handle -> LMType); p = p + strlen(Con_Handle -> LMType); *p = 0; } /* Now send it and get a response */ if (RFCNB_Send(Con_Handle -> Trans_Connect, pkt, pkt_len) < 0){ #ifdef DEBUG fprintf(stderr, "Error sending SessSetupX request\n"); #endif RFCNB_Free_Pkt(pkt); SMBlib_errno = SMBlibE_SendFailed; return(SMBlibE_BAD); } /* Now get the response ... */ if (RFCNB_Recv(Con_Handle -> Trans_Connect, pkt, pkt_len) < 0) { #ifdef DEBUG fprintf(stderr, "Error receiving response to SessSetupAndX\n"); #endif RFCNB_Free_Pkt(pkt); SMBlib_errno = SMBlibE_RecvFailed; return(SMBlibE_BAD); } /* Check out the response type ... */ if (CVAL(SMB_Hdr(pkt), SMB_hdr_rcls_offset) != SMBC_SUCCESS) { /* Process error */ #ifdef DEBUG fprintf(stderr, "SMB_SessSetupAndX failed with errorclass = %i, Error Code = %i\n", CVAL(SMB_Hdr(pkt), SMB_hdr_rcls_offset), SVAL(SMB_Hdr(pkt), SMB_hdr_err_offset)); #endif SMBlib_SMB_Error = IVAL(SMB_Hdr(pkt), SMB_hdr_rcls_offset); RFCNB_Free_Pkt(pkt); SMBlib_errno = SMBlibE_Remote; return(SMBlibE_BAD); } /** @@@ mdz: check for guest login { **/ if (SVAL(SMB_Hdr(pkt), SMB_ssetpr_act_offset) & 0x1) { /* do we allow guest login? NO! */ return(SMBlibE_BAD); } /** @@@ mdz: } **/ #ifdef DEBUG fprintf(stderr, "SessSetupAndX response. Action = %i\n", SVAL(SMB_Hdr(pkt), SMB_ssetpr_act_offset)); #endif /* Now pick up the UID for future reference ... */ Con_Handle -> uid = SVAL(SMB_Hdr(pkt), SMB_hdr_uid_offset); RFCNB_Free_Pkt(pkt); return(0); } /* Disconnect from the server, and disconnect all tree connects */ int SMB_Discon(SMB_Handle_Type Con_Handle, BOOL KeepHandle) { /* We just disconnect the connection for now ... */ RFCNB_Hangup(Con_Handle -> Trans_Connect); if (!KeepHandle) free(Con_Handle); return(0); } freeradius-server/src/modules/rlm_smb/smblib.h000066400000000000000000000057431257552170400220470ustar00rootroot00000000000000/* UNIX SMBlib NetBIOS implementation Version 1.0 SMBlib Defines Copyright (C) Richard Sharpe 1996 Copyright 2006 The FreeRADIUS server project */ /* This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include RCSIDH(smblib_h, "$Id$") #include "std-defines.h" #include "smblib-common.h" /* Just define all the entry points */ /* Create a handle to allow us to set/override some parameters ... */ void *SMB_Create_Con_Handle(); /* Connect to a server, but do not do a tree con etc ... */ void *SMB_Connect_Server(void *Con, char *server, char *NTdomain); /* Connect to a server and give us back a handle. If Con == NULL, create */ /* The handle and populate it with defaults */ void *SMB_Connect(void *Con, void **tree, char *name, char *User, char *Password); /* Negotiate a protocol */ int SMB_Negotiate(void *Con_Handle, char *Prots[]); /* Connect to a tree ... */ void *SMB_TreeConnect(void *con_handle, void *tree_handle, char *path, char *password, char *dev); /* Disconnect a tree ... */ int SMB_TreeDisconect(void *tree_handle); /* Open a file */ void *SMB_Open(void *tree_handle, void *file_handle, char *file_name, unsigned short mode, unsigned short search); /* Close a file */ int SMB_Close(void *file_handle); /* Disconnect from server. Has flag to specify whether or not we keep the */ /* handle. */ int SMB_Discon(void *Con, BOOL KeepHandle); void *SMB_Create(void *Tree_Handle, void *File_Handle, char *file_name, short search); int SMB_Delete(void *tree, char *file_name, short search); int SMB_Create_Dir(void *tree, char *dir_name); int SMB_Delete_Dir(void *tree, char *dir_name); int SMB_Check_Dir(void *tree, char *dir_name); int SMB_Get_Last_Error(); int SMB_Get_Last_SMB_Err(); int SMB_Get_Error_Msg(int msg, char *msgbuf, int len); void *SMB_Logon_And_TCon(void *con, void *tree, char *user, char *pass, char *service, char *st); #define SMBLIB_DEFAULT_DOMAIN "anydom" freeradius-server/src/modules/rlm_smb/std-includes.h000066400000000000000000000030221257552170400231610ustar00rootroot00000000000000/* RFCNB Standard includes ... */ /* RFCNB Standard Includes Copyright (C) 1996, Richard Sharpe Copyright 2006 The FreeRADIUS server project One day we will conditionalize these on OS types ... This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include RCSIDH(std_includes_h, "$Id$") #include "config.h" #define BOOL int typedef short int16; #ifdef HAVE_NETDB_H #include #endif #ifdef HAVE_SYS_TYPES_H #include #endif #ifdef HAVE_NETINET_IN_H #include #endif #ifdef HAVE_SYS_SOCKET_H #include #endif #ifdef HAVE_ARPA_INET_H #include #endif #include #include #include #include #ifdef HAVE_UNISTD_H #include #endif #define TRUE 1 #define FALSE 0 /* Pick up define for INADDR_NONE */ #ifndef INADDR_NONE #define INADDR_NONE -1 #endif freeradius-server/src/modules/rlm_smb/valid.c000066400000000000000000000037671257552170400216750ustar00rootroot00000000000000/* * valid.c * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2000,2006 The FreeRADIUS server project */ #include RCSID("$Id$") #include #include #include "smblib-priv.h" #include "valid.h" SMB_Handle_Type SMB_Connect_Server(void *, char *, char *); int Valid_User(char *USERNAME,char *PASSWORD,char *SERVER,char *BACKUP, char *DOMAIN) { char *SMB_Prots[] = {"PC NETWORK PROGRAM 1.0", "MICROSOFT NETWORKS 1.03", "MICROSOFT NETWORKS 3.0", "LANMAN1.0", "LM1.2X002", "Samba", "NT LM 0.12", "NT LANMAN 1.0", NULL}; SMB_Handle_Type con; SMB_Init(); con = SMB_Connect_Server(NULL, SERVER, DOMAIN); if (con == NULL) { /* Error ... */ con = SMB_Connect_Server(NULL, BACKUP, DOMAIN); if (con == NULL) { return(NTV_SERVER_ERROR); } } if (SMB_Negotiate(con, SMB_Prots) < 0) { /* An error */ SMB_Discon(con,0); return(NTV_PROTOCOL_ERROR); } /* Test for a server in share level mode do not authenticate against it */ if (con -> Security == 0) { SMB_Discon(con,0); return(NTV_PROTOCOL_ERROR); } if (SMB_Logon_Server(con, USERNAME, PASSWORD) < 0) { SMB_Discon(con,0); return(NTV_LOGON_ERROR); } SMB_Discon(con,0); return(NTV_NO_ERROR); } freeradius-server/src/modules/rlm_smb/valid.h000066400000000000000000000006061257552170400216670ustar00rootroot00000000000000/* Copyright 2006 The FreeRADIUS server project */ #ifndef _VALID_H_ #define _VALID_H_ #include RCSIDH(valid_h, "$Id$") /* SMB User verification function */ #define NTV_NO_ERROR 0 #define NTV_SERVER_ERROR 1 #define NTV_PROTOCOL_ERROR 2 #define NTV_LOGON_ERROR 3 int Valid_User(char *USERNAME,char *PASSWORD,char *SERVER, char *BACKUP, char *DOMAIN); #endif freeradius-server/src/modules/rlm_smsotp/000077500000000000000000000000001257552170400211615ustar00rootroot00000000000000freeradius-server/src/modules/rlm_smsotp/Makefile.in000066400000000000000000000004061257552170400232260ustar00rootroot00000000000000TARGET = @targetname@ SRCS = rlm_smsotp.c HEADERS = RLM_CFLAGS = @smsotp_cflags@ RLM_LIBS = @smsotp_ldflags@ RLM_INSTALL = ## this uses the RLM_CFLAGS and RLM_LIBS and SRCS defs to make TARGET. include ../rules.mak $(LT_OBJS): $(HEADERS) freeradius-server/src/modules/rlm_smsotp/config.h.in000066400000000000000000000025231257552170400232060ustar00rootroot00000000000000/* config.h.in. Generated from configure.in by autoheader. */ /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Define to 1 if you have the header file. */ #undef HAVE_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 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_UN_H /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* 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 version of this package. */ #undef PACKAGE_VERSION /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS freeradius-server/src/modules/rlm_smsotp/configure000066400000000000000000003663271257552170400231060ustar00rootroot00000000000000#! /bin/sh # From configure.in Revision: 0.1 . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.61. # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, # 2002, 2003, 2004, 2005, 2006 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=: # 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 # PATH needs CR # 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 # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false 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.) as_nl=' ' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. 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 # Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # CDPATH. $as_unset CDPATH if test "x$CONFIG_SHELL" = x; then if (eval ":") 2>/dev/null; then as_have_required=yes else as_have_required=no fi if test $as_have_required = yes && (eval ": (as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=\$LINENO as_lineno_2=\$LINENO test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } ") 2> /dev/null; then : else as_candidate_shells= as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. case $as_dir in /*) for as_base in sh bash ksh sh5; do as_candidate_shells="$as_candidate_shells $as_dir/$as_base" done;; esac done IFS=$as_save_IFS for as_shell in $as_candidate_shells $SHELL; do # Try only shells that exist, to save several forks. if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { ("$as_shell") 2> /dev/null <<\_ASEOF 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 : _ASEOF }; then CONFIG_SHELL=$as_shell as_have_required=yes if { "$as_shell" 2> /dev/null <<\_ASEOF 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 : (as_func_return () { (exit $1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = "$1" ); then : else exitcode=1 echo positional parameters were not saved. fi test $exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } _ASEOF }; then break fi fi done if test "x$CONFIG_SHELL" != x; then for as_var in BASH_ENV ENV do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done export CONFIG_SHELL exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} fi if test $as_have_required = no; then echo This script requires a shell more modern than all the echo shells that I found on your system. Please install a echo modern shell, or manually run the script under such a echo shell if you do have one. { (exit 1); exit 1; } fi fi fi (eval "as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0") || { echo No shell found that supports shell functions. echo Please tell autoconf@gnu.org about your system, echo including any error possibly output before this echo message } as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, and appends # trailing '-' during substitution so that $LINENO is not a special # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # scripts with optimization help from Paolo Bonzini. 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" || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi 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 fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi 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=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, 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= SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME= PACKAGE_TARNAME= PACKAGE_VERSION= PACKAGE_STRING= PACKAGE_BUGREPORT= ac_unique_file="rlm_smsotp.c" # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef STDC_HEADERS # include # include #else # ifdef HAVE_STDLIB_H # include # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datarootdir datadir sysconfdir sharedstatedir localstatedir includedir oldincludedir docdir infodir htmldir dvidir pdfdir psdir libdir localedir mandir DEFS ECHO_C ECHO_N ECHO_T LIBS build_alias host_alias target_alias CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP GREP EGREP smsotp_cflags smsotp_ldflags targetname LIBOBJS LTLIBOBJS' ac_subst_files='' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CPP' # Initialize some variables set by options. ac_init_help= ac_init_version=false # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *) ac_optarg=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_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` eval enable_$ac_feature=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_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` eval enable_$ac_feature=\$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_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/[-.]/_/g'` eval with_$ac_package=\$ac_optarg ;; -without-* | --without-*) ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/[-.]/_/g'` eval with_$ac_package=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 ;; -*) { echo "$as_me: error: unrecognized option: $ac_option Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && 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'` { echo "$as_me: error: missing argument to $ac_option" >&2 { (exit 1); exit 1; }; } fi # Be sure to have absolute directory names. 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 case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; } 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 echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || { echo "$as_me: error: Working directory cannot be determined" >&2 { (exit 1); exit 1; }; } test "X$ac_ls_di" = "X$ac_pwd_ls_di" || { echo "$as_me: error: pwd does not report name of working directory" >&2 { (exit 1); exit 1; }; } # 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 -- "$0" || $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$0" : 'X\(//\)[^/]' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X"$0" | 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 .." { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2 { (exit 1); exit 1; }; } pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures this package to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF _ACEOF fi if test -n "$ac_init_help"; then cat <<\_ACEOF 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 C/C++/Objective C preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. _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" || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`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 echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF configure generated by GNU Autoconf 2.61 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 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 cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by $as_me, which was generated by GNU Autoconf 2.61. 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=. 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=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; 2) ac_configure_args1="$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 ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac done done $as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } $as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export 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 cat <<\_ASBOX ## ---------------- ## ## Cache variables. ## ## ---------------- ## _ASBOX 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_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( *) $as_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 cat <<\_ASBOX ## ----------------- ## ## Output variables. ## ## ----------------- ## _ASBOX echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then cat <<\_ASBOX ## ------------------- ## ## File substitutions. ## ## ------------------- ## _ASBOX echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then cat <<\_ASBOX ## ----------- ## ## confdefs.h. ## ## ----------- ## _ASBOX echo cat confdefs.h echo fi test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" 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'; { (exit 1); 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 # 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 # Let the site file select an alternate cache file if it wants to. # Prefer explicitly selected file to automatically selected ones. if test -n "$CONFIG_SITE"; then set x "$CONFIG_SITE" elif test "x$prefix" != xNONE; then set x "$prefix/share/config.site" "$prefix/etc/config.site" else set x "$ac_default_prefix/share/config.site" \ "$ac_default_prefix/etc/config.site" fi shift for ac_site_file do if test -r "$ac_site_file"; then { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" 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. if test -f "$cache_file"; then { echo "$as_me:$LINENO: loading cache $cache_file" >&5 echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { echo "$as_me:$LINENO: creating cache $cache_file" >&5 echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 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 { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 echo "$as_me: former value: $ac_old_val" >&2;} { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 echo "$as_me: current value: $ac_new_val" >&2;} ac_cache_corrupted=: fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`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. *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 echo "$as_me: error: changes in the environment can compromise the build" >&2;} { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} { (exit 1); exit 1; }; } 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 # change 'example' # change 'example' if test x$with_rlm_smsotp != xno; then 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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}gcc" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="gcc" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}cc" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="$ac_prog" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&5 echo "$as_me: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } # Provide some information about the compiler. echo "$as_me:$LINENO: checking for C compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (ac_try="$ac_compiler --version >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -v >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -V >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out 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. { echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6; } ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # # List of possible output files, starting from the most likely. # The algorithm is not robust to junk in `.', hence go to wildcards (a.*) # only as a last resort. b.out is created by i960 compilers. ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out' # # The IRIX 6 linker writes into existing files which may not be # executable, retaining their permissions. Remove them first so a # subsequent execution test works. ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link_default") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; 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 | *.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 { echo "$as_me:$LINENO: result: $ac_file" >&5 echo "${ECHO_T}$ac_file" >&6; } if test -z "$ac_file"; then echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: C compiler cannot create executables See \`config.log' for more details." >&5 echo "$as_me: error: C compiler cannot create executables See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } fi ac_exeext=$ac_cv_exeext # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { echo "$as_me:$LINENO: checking whether the C compiler works" >&5 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6; } # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then if { ac_try='./$ac_file' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { echo "$as_me:$LINENO: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&5 echo "$as_me: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi fi fi { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } rm -f a.out a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; } { echo "$as_me:$LINENO: result: $cross_compiling" >&5 echo "${ECHO_T}$cross_compiling" >&6; } { echo "$as_me:$LINENO: checking for suffix of executables" >&5 echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; } if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; 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 | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest$ac_cv_exeext { echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 echo "${ECHO_T}$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT { echo "$as_me:$LINENO: checking for suffix of object files" >&5 echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; } if test "${ac_cv_objext+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; 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 ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 echo "${ECHO_T}$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; } if test "${ac_cv_c_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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 { echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; } GCC=`test $ac_compiler_gnu = yes && echo yes` ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CFLAGS="" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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 { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 echo "${ECHO_T}$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 { echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_c89+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_c89=$ac_arg else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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) { echo "$as_me:$LINENO: result: none needed" >&5 echo "${ECHO_T}none needed" >&6; } ;; xno) { echo "$as_me:$LINENO: result: unsupported" >&5 echo "${ECHO_T}unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;; 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 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 { echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if test "${ac_cv_prog_CPP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f 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 { echo "$as_me:$LINENO: result: $CPP" >&5 echo "${ECHO_T}$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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&5 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } 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 { echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5 echo $ECHO_N "checking for grep that handles long lines and -e... $ECHO_C" >&6; } if test "${ac_cv_path_GREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Extract the first word of "grep ggrep" to use in msg output if test -z "$GREP"; then set dummy grep ggrep; ac_prog_name=$2 if test "${ac_cv_path_GREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" 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 ac_count=`expr $ac_count + 1` 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 fi GREP="$ac_cv_path_GREP" if test -z "$GREP"; then { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} { (exit 1); exit 1; }; } fi else ac_cv_path_GREP=$GREP fi fi { echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5 echo "${ECHO_T}$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { echo "$as_me:$LINENO: checking for egrep" >&5 echo $ECHO_N "checking for egrep... $ECHO_C" >&6; } if test "${ac_cv_path_EGREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else # Extract the first word of "egrep" to use in msg output if test -z "$EGREP"; then set dummy egrep; ac_prog_name=$2 if test "${ac_cv_path_EGREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" 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 ac_count=`expr $ac_count + 1` 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 fi EGREP="$ac_cv_path_EGREP" if test -z "$EGREP"; then { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} { (exit 1); exit 1; }; } fi else ac_cv_path_EGREP=$EGREP fi fi fi { echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 echo "${ECHO_T}$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" { echo "$as_me:$LINENO: checking for ANSI C header files" >&5 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; } if test "${ac_cv_header_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_header_stdc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* 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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* 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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* 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 rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi { echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 echo "${ECHO_T}$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then cat >>confdefs.h <<\_ACEOF #define STDC_HEADERS 1 _ACEOF 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=`echo "ac_cv_header_$ac_header" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Header=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in sys/un.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? { echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ;; esac { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done # for the config.h defs if test "$ac_cv_header_sys_un_h" != "yes"; then fail="$fail sys/un.h" fi targetname=rlm_smsotp # keep this! Don't change! else targetname= # keep this! Don't change! echo \*\*\* module rlm_smsotp is disabled. # keep this! Don't change! fi if test x"$fail" != x""; then if test x"${enable_strict_dependencies}" = x"yes"; then { { echo "$as_me:$LINENO: error: set --without-rlm_smsotp to disable it explicitly." >&5 echo "$as_me: error: set --without-rlm_smsotp to disable it explicitly." >&2;} { (exit 1); exit 1; }; } else { echo "$as_me:$LINENO: WARNING: silently not building rlm_smsotp." >&5 echo "$as_me: WARNING: silently not building rlm_smsotp." >&2;} { echo "$as_me:$LINENO: WARNING: FAILURE: rlm_smsotp requires: $fail." >&5 echo "$as_me: WARNING: FAILURE: rlm_smsotp requires: $fail." >&2;}; targetname="" fi fi # change 'example' # change 'example' ac_config_headers="$ac_config_headers config.h" # delete if you don't want a config.h file. # keep this! Don't change! unset ac_cv_env_LIBS_set unset ac_cv_env_LIBS_value ac_config_files="$ac_config_files 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_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( *) $as_unset $ac_var ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then test "x$cache_file" != "x/dev/null" && { echo "$as_me:$LINENO: updating cache $cache_file" >&5 echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 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= 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=`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. ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs : ${CONFIG_STATUS=./config.status} ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >$CONFIG_STATUS <<_ACEOF #! $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} _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ## --------------------- ## ## 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=: # 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 # PATH needs CR # 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 # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false 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.) as_nl=' ' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. 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 # Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # CDPATH. $as_unset CDPATH as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, and appends # trailing '-' during substitution so that $LINENO is not a special # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # scripts with optimization help from Paolo Bonzini. 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" || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi 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 fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi 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=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 # Save the log message, to keep $[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by $as_me, which was generated by GNU Autoconf 2.61. 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 cat >>$CONFIG_STATUS <<_ACEOF # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ config.status configured by $0, generated by GNU Autoconf 2.61, with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" Copyright (C) 2006 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' _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # If no file are specified by the user, then we need to provide default # value. By we need to know if files were specified by the user. 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=$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 ) echo "$ac_cs_version"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift CONFIG_FILES="$CONFIG_FILES $ac_optarg" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header { echo "$as_me: error: ambiguous option: $1 Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; };; --help | --hel | -h ) 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. -*) { echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *) ac_config_targets="$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 if \$ac_cs_recheck; then echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 CONFIG_SHELL=$SHELL export CONFIG_SHELL exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # 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" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= trap 'exit_status=$? { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status ' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || { echo "$me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } # # Set up the sed scripts for CONFIG_FILES section. # # No need to generate the scripts if there are no CONFIG_FILES. # This happens for instance when ./config.status config.h if test -n "$CONFIG_FILES"; then _ACEOF ac_delim='%!_!# ' for ac_last_try in false false false false false :; do cat >conf$$subs.sed <<_ACEOF SHELL!$SHELL$ac_delim PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim PACKAGE_NAME!$PACKAGE_NAME$ac_delim PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim PACKAGE_STRING!$PACKAGE_STRING$ac_delim PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim exec_prefix!$exec_prefix$ac_delim prefix!$prefix$ac_delim program_transform_name!$program_transform_name$ac_delim bindir!$bindir$ac_delim sbindir!$sbindir$ac_delim libexecdir!$libexecdir$ac_delim datarootdir!$datarootdir$ac_delim datadir!$datadir$ac_delim sysconfdir!$sysconfdir$ac_delim sharedstatedir!$sharedstatedir$ac_delim localstatedir!$localstatedir$ac_delim includedir!$includedir$ac_delim oldincludedir!$oldincludedir$ac_delim docdir!$docdir$ac_delim infodir!$infodir$ac_delim htmldir!$htmldir$ac_delim dvidir!$dvidir$ac_delim pdfdir!$pdfdir$ac_delim psdir!$psdir$ac_delim libdir!$libdir$ac_delim localedir!$localedir$ac_delim mandir!$mandir$ac_delim DEFS!$DEFS$ac_delim ECHO_C!$ECHO_C$ac_delim ECHO_N!$ECHO_N$ac_delim ECHO_T!$ECHO_T$ac_delim LIBS!$LIBS$ac_delim build_alias!$build_alias$ac_delim host_alias!$host_alias$ac_delim target_alias!$target_alias$ac_delim CC!$CC$ac_delim CFLAGS!$CFLAGS$ac_delim LDFLAGS!$LDFLAGS$ac_delim CPPFLAGS!$CPPFLAGS$ac_delim ac_ct_CC!$ac_ct_CC$ac_delim EXEEXT!$EXEEXT$ac_delim OBJEXT!$OBJEXT$ac_delim CPP!$CPP$ac_delim GREP!$GREP$ac_delim EGREP!$EGREP$ac_delim smsotp_cflags!$smsotp_cflags$ac_delim smsotp_ldflags!$smsotp_ldflags$ac_delim targetname!$targetname$ac_delim LIBOBJS!$LIBOBJS$ac_delim LTLIBOBJS!$LTLIBOBJS$ac_delim _ACEOF if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 52; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` if test -n "$ac_eof"; then ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` ac_eof=`expr $ac_eof + 1` fi cat >>$CONFIG_STATUS <<_ACEOF cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof /@[a-zA-Z_][a-zA-Z_0-9]*@/!b end _ACEOF sed ' s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g s/^/s,@/; s/!/@,|#_!!_#|/ :n t n s/'"$ac_delim"'$/,g/; t s/$/\\/; p N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n ' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF :end s/|#_!!_#|//g CEOF$ac_eof _ACEOF # VPATH may cause trouble with some makes, so we remove $(srcdir), # ${srcdir} and @srcdir@ 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[ ]*=/{ s/:*\$(srcdir):*/:/ s/:*\${srcdir}:*/:/ s/:*@srcdir@:*/:/ s/^\([^=]*=[ ]*\):*/\1/ s/:*$// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF fi # test -n "$CONFIG_FILES" for ac_tag in :F $CONFIG_FILES :H $CONFIG_HEADERS do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5 echo "$as_me: error: Invalid tag $ac_tag." >&2;} { (exit 1); exit 1; }; };; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 echo "$as_me: error: cannot find input file: $ac_f" >&2;} { (exit 1); exit 1; }; };; esac ac_file_inputs="$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 "`IFS=: echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure." if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { echo "$as_me:$LINENO: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} fi case $ac_tag in *:-:* | *:-) cat >"$tmp/stdin";; 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 || 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" case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`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 || 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" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 echo "$as_me: error: cannot create directory $as_dir" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`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 # _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # 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= case `sed -n '/datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p ' $ac_file_inputs` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF 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 sed "$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s&@configure_input@&$configure_input&;t t s&@top_builddir@&$ac_top_builddir_sub&;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 $ac_datarootdir_hack " $ac_file_inputs | sed -f "$tmp/subs-1.sed" >$tmp/out test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&5 echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&2;} rm -f "$tmp/stdin" case $ac_file in -) cat "$tmp/out"; rm -f "$tmp/out";; *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;; esac ;; :H) # # CONFIG_HEADER # _ACEOF # Transform confdefs.h into a sed script `conftest.defines', that # substitutes the proper values into config.h.in to produce config.h. rm -f conftest.defines conftest.tail # First, append a space to every undef/define line, to ease matching. echo 's/$/ /' >conftest.defines # Then, protect against being on the right side of a sed subst, or in # an unquoted here document, in config.status. If some macros were # called several times there might be several #defines for the same # symbol, which is useless. But do not sort them, since the last # AC_DEFINE must be honored. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* # These sed commands are passed to sed as "A NAME B PARAMS C VALUE D", where # NAME is the cpp macro being defined, VALUE is the value it is being given. # PARAMS is the parameter list in the macro definition--in most cases, it's # just an empty string. ac_dA='s,^\\([ #]*\\)[^ ]*\\([ ]*' ac_dB='\\)[ (].*,\\1define\\2' ac_dC=' ' ac_dD=' ,' uniq confdefs.h | sed -n ' t rset :rset s/^[ ]*#[ ]*define[ ][ ]*// t ok d :ok s/[\\&,]/\\&/g s/^\('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/ '"$ac_dA"'\1'"$ac_dB"'\2'"${ac_dC}"'\3'"$ac_dD"'/p s/^\('"$ac_word_re"'\)[ ]*\(.*\)/'"$ac_dA"'\1'"$ac_dB$ac_dC"'\2'"$ac_dD"'/p ' >>conftest.defines # Remove the space that was appended to ease matching. # Then 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. # (The regexp can be short, since the line contains either #define or #undef.) echo 's/ $// s,^[ #]*u.*,/* & */,' >>conftest.defines # Break up conftest.defines: ac_max_sed_lines=50 # First sed command is: sed -f defines.sed $ac_file_inputs >"$tmp/out1" # Second one is: sed -f defines.sed "$tmp/out1" >"$tmp/out2" # Third one will be: sed -f defines.sed "$tmp/out2" >"$tmp/out1" # et cetera. ac_in='$ac_file_inputs' ac_out='"$tmp/out1"' ac_nxt='"$tmp/out2"' while : do # Write a here document: cat >>$CONFIG_STATUS <<_ACEOF # First, check the format of the line: cat >"\$tmp/defines.sed" <<\\CEOF /^[ ]*#[ ]*undef[ ][ ]*$ac_word_re[ ]*\$/b def /^[ ]*#[ ]*define[ ][ ]*$ac_word_re[( ]/b def b :def _ACEOF sed ${ac_max_sed_lines}q conftest.defines >>$CONFIG_STATUS echo 'CEOF sed -f "$tmp/defines.sed"' "$ac_in >$ac_out" >>$CONFIG_STATUS ac_in=$ac_out; ac_out=$ac_nxt; ac_nxt=$ac_in sed 1,${ac_max_sed_lines}d conftest.defines >conftest.tail grep . conftest.tail >/dev/null || break rm -f conftest.defines mv conftest.tail conftest.defines done rm -f conftest.defines conftest.tail echo "ac_result=$ac_in" >>$CONFIG_STATUS cat >>$CONFIG_STATUS <<\_ACEOF if test x"$ac_file" != x-; then echo "/* $configure_input */" >"$tmp/config.h" cat "$ac_result" >>"$tmp/config.h" if diff $ac_file "$tmp/config.h" >/dev/null 2>&1; then { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 echo "$as_me: $ac_file is unchanged" >&6;} else rm -f $ac_file mv "$tmp/config.h" $ac_file fi else echo "/* $configure_input */" cat "$ac_result" fi rm -f "$tmp/out12" ;; esac done # for ac_tag { (exit 0); exit 0; } _ACEOF chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save # 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 || { (exit 1); exit 1; } fi # keep this! Don't change! freeradius-server/src/modules/rlm_smsotp/configure.in000066400000000000000000000021201257552170400234650ustar00rootroot00000000000000AC_PREREQ([2.53]) AC_INIT(rlm_smsotp.c) # change 'example' AC_REVISION($Revision: 0.1 $) AC_DEFUN(modname,[rlm_smsotp]) # change 'example' if test x$with_[]modname != xno; then AC_PROG_CC AC_PROG_CPP AC_CHECK_HEADERS(sys/un.h) # for the config.h defs if test "$ac_cv_header_sys_un_h" != "yes"; then fail="$fail sys/un.h" fi targetname=modname # keep this! Don't change! else targetname= # keep this! Don't change! echo \*\*\* module modname is disabled. # keep this! Don't change! fi dnl Don't change this section. if test x"$fail" != x""; then if test x"${enable_strict_dependencies}" = x"yes"; then AC_MSG_ERROR([set --without-]modname[ to disable it explicitly.]) else AC_MSG_WARN([silently not building ]modname[.]) AC_MSG_WARN([FAILURE: ]modname[ requires: $fail.]); targetname="" fi fi AC_SUBST(smsotp_cflags) # change 'example' AC_SUBST(smsotp_ldflags) # change 'example' AC_CONFIG_HEADER(config.h) # delete if you don't want a config.h file. AC_SUBST(targetname) # keep this! Don't change! AC_OUTPUT(Makefile) # keep this! Don't change! freeradius-server/src/modules/rlm_smsotp/rlm_smsotp.c000066400000000000000000000325041257552170400235300ustar00rootroot00000000000000/* * rlm_smsotp.c * * Version: $Id$ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2000,2006 The FreeRADIUS server project * Copyright 2009 Siemens AG, Holger Wolff holger.wolff@siemens.com */ #include RCSID("$Id$") #include #include #include #include "rlm_smsotp.h" /* * A mapping of configuration file names to internal variables. * * Note that the string is dynamically allocated, so it MUST * be freed. When the configuration file parse re-reads the string, * it free's the old one, and strdup's the new one, placing the pointer * to the strdup'd string into 'config.string'. This gets around * buffer over-flows. */ static const CONF_PARSER module_config[] = { { "socket", PW_TYPE_STRING_PTR, offsetof(rlm_smsotp_t, smsotp_socket), NULL, SMSOTP_SOCKET }, { "challenge_message", PW_TYPE_STRING_PTR, offsetof(rlm_smsotp_t, smsotp_challengemessage), NULL, SMSOTP_CHALLENGEMESSAGE }, { "challenge_type", PW_TYPE_STRING_PTR, offsetof(rlm_smsotp_t, smsotp_authtype), NULL, SMSOTP_AUTHTYPE }, { NULL, -1, 0, NULL, NULL } /* end the list */ }; /* socket forward declarations begin */ static int smsotp_connect(const char *path); static smsotp_fd_t * smsotp_getfd(const rlm_smsotp_t *opt); static void smsotp_putfd(smsotp_fd_t *fdp, int disconnect); static int smsotp_read(smsotp_fd_t *fdp, char *buf, size_t len); static int smsotp_write(smsotp_fd_t *fdp, const char *buf, size_t len); /* socket forward declarations end */ /* * Do any per-module initialization that is separate to each * configured instance of the module. e.g. set up connections * to external databases, read configuration files, set up * dictionary entries, etc. * * If configuration information is given in the config section * that must be referenced in later calls, store a handle to it * in *instance otherwise put a null pointer there. */ static int smsotp_instantiate(CONF_SECTION *conf, void **instance) { rlm_smsotp_t *data; /* * Set up a storage area for instance data */ data = rad_malloc(sizeof(*data)); if (!data) { return -1; } memset(data, 0, sizeof(*data)); /* * If the configuration parameters can't be parsed, then * fail. */ if (cf_section_parse(conf, data, module_config) < 0) { free(data); return -1; } *instance = data; return 0; } /* * Authenticate the user with the given password. */ static int smsotp_authenticate(void *instance, REQUEST *request) { VALUE_PAIR *state; VALUE_PAIR *reply; rlm_smsotp_t *opt = instance; char SocketReply[1000]; int SocketReplyLen; /* quiet the compiler */ instance = instance; request = request; smsotp_fd_t *fdp; fdp = smsotp_getfd(instance); if (!fdp || fdp->fd == -1) return RLM_MODULE_FAIL; /* Get greeting */ SocketReplyLen = smsotp_read(fdp, (char *) SocketReply, sizeof(SocketReply)); /* * Look for the 'state' attribute. */ state = pairfind(request->packet->vps, PW_STATE); if (state != NULL) { DEBUG("rlm_smsotp: Found reply to access challenge"); /* set username */ smsotp_write(fdp, "check otp for ", 14); smsotp_write(fdp, (const char *) request->username->vp_strvalue, sizeof(request->username->vp_strvalue)); smsotp_write(fdp, "\n", 1); SocketReplyLen = smsotp_read(fdp, (char *) SocketReply, sizeof(SocketReply)); /* set otp password */ smsotp_write(fdp, "user otp is ", 12); smsotp_write(fdp, (const char *) request->password->vp_strvalue, sizeof(request->password->vp_strvalue)); smsotp_write(fdp, "\n", 1); SocketReplyLen = smsotp_read(fdp, (char *) SocketReply, sizeof(SocketReply)); /* set uuid */ smsotp_write(fdp, "otp id is ", 10); smsotp_write(fdp, (const char *) state->vp_strvalue, 36); /* smsotp_write(fdp, (const char *) state->vp_strvalue, sizeof(state->vp_strvalue)); */ smsotp_write(fdp, "\n", 1); SocketReplyLen = smsotp_read(fdp, (char *) SocketReply, sizeof(SocketReply)); /* now check the otp */ smsotp_write(fdp, "get check result\n", 17); SocketReplyLen = smsotp_read(fdp, (char *) SocketReply, sizeof(SocketReply)); /* end the sesssion */ smsotp_write(fdp, "quit\n", 5); smsotp_putfd(fdp, 1); (void) radlog(L_AUTH, "rlm_smsotp: SocketReply is %s ",SocketReply); if (strcmp(SocketReply,"OK") == 0) return RLM_MODULE_OK; return RLM_MODULE_FAIL; } DEBUG("rlm_smsotp: Generate OTP"); /* set username */ smsotp_write(fdp, "generate otp for ", 17); smsotp_write(fdp, (const char *) request->username->vp_strvalue, sizeof(request->username->vp_strvalue)); smsotp_write(fdp, "\n", 1); SocketReplyLen = smsotp_read(fdp, (char *) SocketReply, sizeof(SocketReply)); /* end the sesssion */ smsotp_write(fdp, "quit\n", 5); smsotp_putfd(fdp, 1); (void) radlog(L_AUTH, "rlm_smsotp: Uniq id is %s ",SocketReply); /* check the return string */ if (strcmp(SocketReply,"FAILED") == 0) { /* smsotp script returns a error */ return RLM_MODULE_FAIL; } else { /* * Create the challenge, and add it to the reply. */ reply = pairmake("Reply-Message", opt->smsotp_challengemessage, T_OP_EQ); pairadd(&request->reply->vps, reply); state = pairmake("State", SocketReply, T_OP_EQ); pairadd(&request->reply->vps, state); /* * Mark the packet as an Access-Challenge packet. * * The server will take care of sending it to the user. */ request->reply->code = PW_ACCESS_CHALLENGE; DEBUG("rlm_smsotp: Sending Access-Challenge."); return RLM_MODULE_HANDLED; } } /* * Find the named user in this modules database. Create the set * of attribute-value pairs to check and reply with for this user * from the database. The authentication code only needs to check * the password, the rest is done here. */ static int smsotp_authorize(void *instance, REQUEST *request) { VALUE_PAIR *state; rlm_smsotp_t *opt = instance; /* quiet the compiler */ instance = instance; request = request; /* * Look for the 'state' attribute. */ state = pairfind(request->packet->vps, PW_STATE); if (state != NULL) { DEBUG("rlm_smsotp: Found reply to access challenge (AUTZ), Adding Auth-Type '%s'",opt->smsotp_authtype); pairdelete(&request->config_items, PW_AUTH_TYPE); /* delete old auth-type */ pairadd(&request->config_items, pairmake("Auth-Type", opt->smsotp_authtype, T_OP_SET)); } return RLM_MODULE_OK; } /* * Only free memory we allocated. The strings allocated via * cf_section_parse() do not need to be freed. */ static int smsotp_detach(void *instance) { free(instance); return 0; } /* forward declarations */ static smsotp_fd_t *smsotp_fd_head = NULL; static pthread_mutex_t smsotp_fd_head_mutex = PTHREAD_MUTEX_INITIALIZER; /* forward declarations end */ /* socket functions begin */ /* connect to socket and return fd */ static int smsotp_connect(const char *path) { int fd; struct sockaddr_un sa; size_t sp_len; /* sun_path length (strlen) */ /* setup for unix domain socket */ sp_len = strlen(path); if (sp_len > sizeof(sa.sun_path) - 1) { (void) radlog(L_ERR, "rlm_smsotp: %s: socket name too long", __func__); return -1; } sa.sun_family = AF_UNIX; (void) strcpy(sa.sun_path, path); /* connect to socket */ if ((fd = socket(PF_UNIX, SOCK_STREAM, 0)) == -1) { (void) radlog(L_ERR, "rlm_smsotp: %s: socket: %s", __func__, strerror(errno)); return -1; } if (connect(fd, (struct sockaddr *) &sa, sizeof(sa.sun_family) + sp_len) == -1) { (void) radlog(L_ERR, "rlm_smsotp: %s: connect(%s): %s", __func__, path, strerror(errno)); (void) close(fd); return -1; } return fd; } /* * Retrieve an fd (from pool) to use for socket connection. * It'd be simpler to use TLS but FR can have lots of threads * and we don't want to waste fd's that way. * We can't have a global fd because we'd then be pipelining * requests to otpd and we have no way to demultiplex * the responses. */ static smsotp_fd_t * smsotp_getfd(const rlm_smsotp_t *opt) { int rc; smsotp_fd_t *fdp; /* walk the connection pool looking for an available fd */ for (fdp = smsotp_fd_head; fdp; fdp = fdp->next) { rc = smsotp_pthread_mutex_trylock(&fdp->mutex); if (!rc) if (!strcmp(fdp->path, opt->smsotp_socket)) /* could just use == */ break; } if (!fdp) { /* no fd was available, add a new one */ fdp = rad_malloc(sizeof(*fdp)); smsotp_pthread_mutex_init(&fdp->mutex, NULL); smsotp_pthread_mutex_lock(&fdp->mutex); /* insert new fd at head */ smsotp_pthread_mutex_lock(&smsotp_fd_head_mutex); fdp->next = smsotp_fd_head; smsotp_fd_head = fdp; smsotp_pthread_mutex_unlock(&smsotp_fd_head_mutex); /* initialize */ fdp->path = opt->smsotp_socket; fdp->fd = -1; } /* establish connection */ if (fdp->fd == -1) fdp->fd = smsotp_connect(fdp->path); return fdp; } /* release fd, and optionally disconnect from otpd */ static void smsotp_putfd(smsotp_fd_t *fdp, int disconnect) { if (disconnect) { (void) close(fdp->fd); fdp->fd = -1; } /* make connection available to another thread */ smsotp_pthread_mutex_unlock(&fdp->mutex); } /* * Full read with logging, and close on failure. * Returns nread on success, 0 on EOF, -1 on other failures. */ static int smsotp_read(smsotp_fd_t *fdp, char *buf, size_t len) { ssize_t n; size_t nread = 0; /* bytes read into buf */ fd_set rfds; struct timeval tv; int retval; FD_ZERO(&rfds); FD_SET(fdp->fd, &rfds); tv.tv_sec = 0; tv.tv_usec = 0; while (nread < len) { if ((n = read(fdp->fd, &buf[nread], len - nread)) == -1) { if (errno == EINTR) { continue; } else { (void) radlog(L_ERR, "rlm_smsotp: %s: read from socket: %s", __func__, strerror(errno)); smsotp_putfd(fdp, 1); return -1; } } if (!n) { (void) radlog(L_ERR, "rlm_smsotp: %s: socket disconnect", __func__); smsotp_putfd(fdp, 1); return 0; } nread += n; // DEBUG("smsotp_read ... read more ?"); // check if more data is avalible retval = select(1, &rfds, NULL, NULL, &tv); if (!retval) { buf[nread]= '\0'; break; } // DEBUG("smsotp_read ... read more ! YES !"); } /*while (more to read) */ return nread; } /* * Full write with logging, and close on failure. * Returns 0 on success, errno on failure. */ static int smsotp_write(smsotp_fd_t *fdp, const char *buf, size_t len) { size_t nleft = len; ssize_t nwrote; while (nleft) { if ((nwrote = write(fdp->fd, &buf[len - nleft], nleft)) == -1) { if (errno == EINTR || errno == EPIPE) { continue; } else { (void) radlog(L_ERR, "rlm_smsotp: %s: write to socket: %s", __func__, strerror(errno)); smsotp_putfd(fdp, 1); return errno; } } nleft -= nwrote; } return 0; } /* socket functions end */ /* mutex functions begin*/ /* guaranteed initialization */ static void _smsotp_pthread_mutex_init(pthread_mutex_t *mutexp, const pthread_mutexattr_t *attr, const char *caller) { int rc; if ((rc = pthread_mutex_init(mutexp, attr))) { (void) radlog(L_ERR|L_CONS, "rlm_smsotp: %s: pthread_mutex_init: %s", caller, strerror(rc)); exit(1); } } /* guaranteed lock */ static void _smsotp_pthread_mutex_lock(pthread_mutex_t *mutexp, const char *caller) { int rc; if ((rc = pthread_mutex_lock(mutexp))) { (void) radlog(L_ERR|L_CONS, "rlm_smsotp: %s: pthread_mutex_lock: %s", caller, strerror(rc)); exit(1); } } /* guaranteed trylock */ static int _smsotp_pthread_mutex_trylock(pthread_mutex_t *mutexp, const char *caller) { int rc; rc = pthread_mutex_trylock(mutexp); if (rc && rc != EBUSY) { (void) radlog(L_ERR|L_CONS, "rlm_smsotp: %s: pthread_mutex_trylock: %s", caller, strerror(rc)); exit(1); } return rc; } /* guaranteed unlock */ static void _smsotp_pthread_mutex_unlock(pthread_mutex_t *mutexp, const char *caller) { int rc; if ((rc = pthread_mutex_unlock(mutexp))) { (void) radlog(L_ERR|L_CONS, "rlm_smsotp: %s: pthread_mutex_unlock: %s", caller, strerror(rc)); exit(1); } } /* mutex functions end */ /* * The module name should be the only globally exported symbol. * That is, everything else should be 'static'. * * If the module needs to temporarily modify it's instantiation * data, the type should be changed to RLM_TYPE_THREAD_UNSAFE. * The server will then take care of ensuring that the module * is single-threaded. */ module_t rlm_smsotp = { RLM_MODULE_INIT, "smsotp", RLM_TYPE_THREAD_SAFE, /* type */ smsotp_instantiate, /* instantiation */ smsotp_detach, /* detach */ { smsotp_authenticate, /* authentication */ smsotp_authorize, /* authorization */ NULL, /* preaccounting */ NULL, /* accounting */ NULL, /* checksimul */ NULL, /* pre-proxy */ NULL, /* post-proxy */ NULL /* post-auth */ }, }; freeradius-server/src/modules/rlm_smsotp/rlm_smsotp.h000066400000000000000000000024551257552170400235370ustar00rootroot00000000000000#define SMSOTP_SOCKET "/var/run/smsotp_socket" #define SMSOTP_CHALLENGEMESSAGE "Enter Mobile PIN" #define SMSOTP_AUTHTYPE "smsotp-reply" /* * Define a structure for our module configuration. * * These variables do not need to be in a structure, but it's * a lot cleaner to do so, and a pointer to the structure can * be used as the instance handle. */ typedef struct smsotp_fd_t { pthread_mutex_t mutex; const char *path; /* allows diff instances to use diff sockets */ int fd; struct smsotp_fd_t *next; } smsotp_fd_t; typedef struct rlm_smsotp_t { char *smsotp_socket; char *smsotp_challengemessage; char *smsotp_authtype; } rlm_smsotp_t; static void _smsotp_pthread_mutex_init(pthread_mutex_t *, const pthread_mutexattr_t *, const char *); static void _smsotp_pthread_mutex_lock(pthread_mutex_t *, const char *); static int _smsotp_pthread_mutex_trylock(pthread_mutex_t *, const char *); static void _smsotp_pthread_mutex_unlock(pthread_mutex_t *, const char *); #define smsotp_pthread_mutex_init(a, b) _smsotp_pthread_mutex_init((a), (b), __func__) #define smsotp_pthread_mutex_lock(a) _smsotp_pthread_mutex_lock((a), __func__) #define smsotp_pthread_mutex_trylock(a) _smsotp_pthread_mutex_trylock((a), __func__) #define smsotp_pthread_mutex_unlock(a) _smsotp_pthread_mutex_unlock((a), __func__) freeradius-server/src/modules/rlm_soh/000077500000000000000000000000001257552170400204255ustar00rootroot00000000000000freeradius-server/src/modules/rlm_soh/Makefile000066400000000000000000000001341257552170400220630ustar00rootroot00000000000000# # Makefile # # Version: $Id$ # TARGET = rlm_soh SRCS = rlm_soh.c include ../rules.mak freeradius-server/src/modules/rlm_soh/rlm_soh.c000066400000000000000000000131621257552170400222370ustar00rootroot00000000000000/* * rlm_soh.c * * Version: $Id$ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2010 Phil Mayers */ #include RCSID("$Id$") #include #include #include #include typedef struct rlm_soh_t { const char *xlat_name; int dhcp; } rlm_soh_t; /* * Not sure how to make this useful yet... */ static size_t soh_xlat(UNUSED void *instance, REQUEST *request, char *fmt, char *out, size_t outlen, UNUSED RADIUS_ESCAPE_STRING func) { VALUE_PAIR* vp[6]; const char *osname; /* there will be no point unless SoH-Supported = yes * * FIXME: should have a #define for the attribute... * SoH-Supported == 2119 in dictionary.freeradius.internal */ vp[0] = pairfind(request->packet->vps, 2119); if (!vp[0]) return 0; if (strncasecmp(fmt, "OS", 2) == 0) { /* OS vendor */ vp[0] = pairfind(request->packet->vps, 2100); vp[1] = pairfind(request->packet->vps, 2101); vp[2] = pairfind(request->packet->vps, 2102); vp[3] = pairfind(request->packet->vps, 2103); vp[4] = pairfind(request->packet->vps, 2104); vp[5] = pairfind(request->packet->vps, 2105); if (vp[0] && vp[0]->vp_integer == 311) { if (!vp[1]) { snprintf(out, outlen, "Windows unknown"); } else { switch (vp[1]->vp_integer) { case 7: osname = "7"; break; case 6: osname = "Vista"; break; case 5: osname = "XP"; break; default: osname = "Other"; break; } snprintf(out, outlen, "Windows %s %d.%d.%d sp %d.%d", osname, vp[1]->vp_integer, vp[2] ? vp[2]->vp_integer : 0, vp[3] ? vp[3]->vp_integer : 0, vp[4] ? vp[4]->vp_integer : 0, vp[5] ? vp[5]->vp_integer : 0 ); } return strlen(out); } } return 0; } static const CONF_PARSER module_config[] = { /* * Do SoH over DHCP? */ { "dhcp", PW_TYPE_BOOLEAN, offsetof(rlm_soh_t,dhcp), NULL, "no" }, { NULL, -1, 0, NULL, NULL } /* end the list */ }; static int soh_detach(void *instance) { rlm_soh_t *inst = instance; if (inst->xlat_name) { xlat_unregister(inst->xlat_name, soh_xlat, instance); free(inst->xlat_name); } free(instance); return 0; } static int soh_instantiate(CONF_SECTION *conf, void **instance) { rlm_soh_t *inst; inst = *instance = rad_malloc(sizeof(*inst)); if (!inst) { return -1; } memset(inst, 0, sizeof(*inst)); if (cf_section_parse(conf, inst, module_config) < 0) { free(inst); return -1; } inst->xlat_name = cf_section_name2(conf); if (!inst->xlat_name) inst->xlat_name = cf_section_name1(conf); inst->xlat_name = strdup(inst->xlat_name); xlat_register(inst->xlat_name, soh_xlat, inst); return 0; } static int soh_postauth(UNUSED void * instance, REQUEST *request) { #ifdef WITH_DHCP int rcode; VALUE_PAIR *vp; vp = pairfind(request->packet->vps, DHCP2ATTR(43)); if (vp) { /* * vendor-specific options contain * * vendor opt 220/0xdc - SoH payload, or null byte to probe, or string * "NAP" to indicate server-side support for SoH in OFFERs * * vendor opt 222/0xde - SoH correlation ID as utf-16 string, yuck... */ uint8_t vopt, vlen, *data; data = vp->vp_octets; while (data < vp->vp_octets + vp->length) { vopt = *data++; vlen = *data++; switch (vopt) { case 220: if (vlen <= 1) { RDEBUG("SoH adding NAP marker to DHCP reply"); /* client probe; send "NAP" in the reply */ vp = paircreate(DHCP2ATTR(43), PW_TYPE_OCTETS); vp->vp_octets[0] = 220; vp->vp_octets[1] = 3; vp->vp_octets[4] = 'N'; vp->vp_octets[3] = 'A'; vp->vp_octets[2] = 'P'; vp->length = 5; pairadd(&request->reply->vps, vp); } else { RDEBUG("SoH decoding NAP from DHCP request"); /* SoH payload */ rcode = soh_verify(request, request->packet->vps, data, vlen); if (rcode < 0) { return RLM_MODULE_FAIL; } } break; default: /* nothing to do */ break; } data += vlen; } return RLM_MODULE_OK; } #endif return RLM_MODULE_NOOP; } static int soh_authorize(UNUSED void * instance, REQUEST *request) { VALUE_PAIR *vp; int rv; /* try to find the MS-SoH payload */ vp = pairfind(request->packet->vps, (311 << 16) | 55); if (!vp) { RDEBUG("SoH radius VP not found"); return RLM_MODULE_NOOP; } RDEBUG("SoH radius VP found"); /* decode it */ rv = soh_verify(request, request->packet->vps, vp->vp_octets, vp->length); if (rv < 0) { return RLM_MODULE_FAIL; } return RLM_MODULE_OK; } module_t rlm_soh = { RLM_MODULE_INIT, "SoH", RLM_TYPE_THREAD_SAFE, /* type */ soh_instantiate, /* instantiation */ soh_detach, /* detach */ { NULL, /* authenticate */ soh_authorize, /* authorize */ NULL, /* pre-accounting */ NULL, /* accounting */ NULL, /* checksimul */ NULL, /* pre-proxy */ NULL, /* post-proxy */ soh_postauth /* post-auth */ }, }; freeradius-server/src/modules/rlm_sql/000077500000000000000000000000001257552170400204335ustar00rootroot00000000000000freeradius-server/src/modules/rlm_sql/.gitignore000066400000000000000000000000111257552170400224130ustar00rootroot00000000000000Makefile freeradius-server/src/modules/rlm_sql/Makefile.in000066400000000000000000000013631257552170400225030ustar00rootroot00000000000000# # $Id$ # TARGET = @targetname@ SRCS = rlm_sql.c sql.c HEADERS = rlm_sql.h conf.h RLM_INSTALL = install-drivers RLM_CFLAGS = -I$(top_builddir)/src/modules/rlm_sql RLM_LIBS = $(LIBLTDL) RLM_SUBDIRS = drivers # # Not using shared libraries, add in ALL known static modules # at build time. # #ifneq ($(USE_SHARED_LIBS),yes) #RLM_LIBS += $(shell for x in drivers/rlm_*/rlm_*.la;do echo -dlpreopen $$x;done) #endif # this uses the RLM_CFLAGS and RLM_LIBS and SRCS defs to make TARGET. include ../rules.mak $(LT_OBJS): $(HEADERS) install-drivers: @$(MAKE) $(MFLAGS) WHAT_TO_MAKE=install common .PHONY: common $(RLM_SUBDIRS) common: $(RLM_SUBDIRS) $(RLM_SUBDIRS): @echo "Making $(WHAT_TO_MAKE) in $@..." @$(MAKE) $(MFLAGS) -C $@ $(WHAT_TO_MAKE) freeradius-server/src/modules/rlm_sql/README000066400000000000000000000021421257552170400213120ustar00rootroot00000000000000FreeRADIUS SQL Module The core rlm_sql code handles database indepenent stuff and links the specific database drivers depending on your config. Sample sql configurations can be found in the raddb/sql.conf file. Mike Machado mike@innercite.com InnerCite Inc. Engineering Director / CTO Returning 'SQL_DOWN' allows sql.c to reconnect and try again, in most cases sql_select_query: returns -1 on failure, SQL_DOWN on 'socket not connected' sql_query: returns -1 on failure, SQL_DOWN on 'socket not connected' sql_store_result: returns -1 on failure, SQL_DOWN on 'socket not connected' sql_num_fields: cannot return an error, complains if zero fields sql_finish_select_query: returns 0 always sql_finish_query: does nothing, returns 0 sql_free_result: returns 0 always, mysql_free_result has no return value sql_release_socket: returns 1 always sql_fetch_row: returns 0 if ok, SQL_DOWN on 'socket not connected', row is in sqlsocket->row now TODO: db2/iodbc/unixodbc: for the above functions, where it can return SQL_DOWN, determine if an error with the database exists, if it is down, and return SQL_DOWN freeradius-server/src/modules/rlm_sql/conf.h000066400000000000000000000062171257552170400215370ustar00rootroot00000000000000#ifndef SQL_CONF_H #define SQL_CONF_H /*************************************************************************** * conf.h rlm_sql - FreeRADIUS SQL Module * * * * Configuration options for the SQL module * * * * Mike Machado * ***************************************************************************/ #include RCSIDH(conf_h, "$Id$") typedef struct sql_config { char *sql_driver; char *sql_server; char *sql_port; char *sql_login; char *sql_password; char *sql_db; char *sql_file; /* for sqlite */ char *query_user; char *default_profile; char *nas_query; char *authorize_check_query; char *authorize_reply_query; char *authorize_group_check_query; char *authorize_group_reply_query; char *accounting_onoff_query; char *accounting_update_query; char *accounting_update_query_alt; char *accounting_start_query; char *accounting_start_query_alt; char *accounting_stop_query; char *accounting_stop_query_alt; char *simul_count_query; char *simul_verify_query; char *groupmemb_query; int sqltrace; int do_clients; int read_groups; char *tracefile; char *xlat_name; int deletestalesessions; int num_sql_socks; int lifetime; int max_queries; int connect_failure_retry_delay; char *postauth_query; char *allowed_chars; int query_timeout; /* individual driver config */ void *localcfg; } SQL_CONFIG; #define CHECKRAD1 "/usr/sbin/checkrad" #define CHECKRAD2 "/usr/local/sbin/checkrad" /* Hack for funky ascend ports on MAX 4048 (and probably others) The "NAS-Port-Id" value is "xyyzz" where "x" = 1 for digital, 2 for analog; "yy" = line number (1 for first PRI/T1/E1, 2 for second, so on); "zz" = channel number (on the PRI or Channelized T1/E1). This should work with normal terminal servers, unless you have a TS with more than 9999 ports ;^). The "ASCEND_CHANNELS_PER_LINE" is the number of channels for each line into the unit. For my US/PRI that's 23. A US/T1 would be 24, and a European E1 would be 30 (I think ... never had one ;^). This will NOT change the "NAS-Port-Id" reported in the detail log. This is simply to fix the dynamic IP assignments a la Cistron. WARNING: This hack works for me, but I only have one PRI!!! I've not tested it on 2 or more (or with models other than the Max 4048) Use at your own risk! -- dgreer@austintx.com */ #define ASCEND_PORT_HACK #define ASCEND_CHANNELS_PER_LINE 23 #define CISCO_ACCOUNTING_HACK /* SQL defines */ #define MAX_QUERY_LEN 4096 #define SQL_LOCK_LEN MAX_QUERY_LEN #define SQLTRACEFILE RADLOG_DIR "/sqltrace.sql" /* SQL Errors */ #define SQL_DOWN 1 /* for re-connect */ #define MAX_COMMUNITY_LEN 50 #define MAX_SQL_SOCKS 256 #define MAX_TABLE_LEN 20 #define MAX_AUTH_QUERY_LEN 256 #define AUTH_STRING_LEN 128 #endif /* SQL_CONF_H */ freeradius-server/src/modules/rlm_sql/configure000077500000000000000000003235451257552170400223560ustar00rootroot00000000000000#! /bin/sh # From configure.in Revision. # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.61. # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, # 2002, 2003, 2004, 2005, 2006 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=: # 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 # PATH needs CR # 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 # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false 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.) as_nl=' ' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. 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 # Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # CDPATH. $as_unset CDPATH if test "x$CONFIG_SHELL" = x; then if (eval ":") 2>/dev/null; then as_have_required=yes else as_have_required=no fi if test $as_have_required = yes && (eval ": (as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=\$LINENO as_lineno_2=\$LINENO test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } ") 2> /dev/null; then : else as_candidate_shells= as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. case $as_dir in /*) for as_base in sh bash ksh sh5; do as_candidate_shells="$as_candidate_shells $as_dir/$as_base" done;; esac done IFS=$as_save_IFS for as_shell in $as_candidate_shells $SHELL; do # Try only shells that exist, to save several forks. if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { ("$as_shell") 2> /dev/null <<\_ASEOF 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 : _ASEOF }; then CONFIG_SHELL=$as_shell as_have_required=yes if { "$as_shell" 2> /dev/null <<\_ASEOF 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 : (as_func_return () { (exit $1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = "$1" ); then : else exitcode=1 echo positional parameters were not saved. fi test $exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } _ASEOF }; then break fi fi done if test "x$CONFIG_SHELL" != x; then for as_var in BASH_ENV ENV do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done export CONFIG_SHELL exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} fi if test $as_have_required = no; then echo This script requires a shell more modern than all the echo shells that I found on your system. Please install a echo modern shell, or manually run the script under such a echo shell if you do have one. { (exit 1); exit 1; } fi fi fi (eval "as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0") || { echo No shell found that supports shell functions. echo Please tell autoconf@gnu.org about your system, echo including any error possibly output before this echo message } as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, and appends # trailing '-' during substitution so that $LINENO is not a special # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # scripts with optimization help from Paolo Bonzini. 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" || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi 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 fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi 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=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, 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= SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME= PACKAGE_TARNAME= PACKAGE_VERSION= PACKAGE_STRING= PACKAGE_BUGREPORT= ac_unique_file="rlm_sql.c" ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datarootdir datadir sysconfdir sharedstatedir localstatedir includedir oldincludedir docdir infodir htmldir dvidir pdfdir psdir libdir localedir mandir DEFS ECHO_C ECHO_N ECHO_T LIBS build_alias host_alias target_alias CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT subdirs sql_ldflags sql_cflags targetname SQL_MODULES LIBOBJS LTLIBOBJS' ac_subst_files='' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS' ac_subdirs_all='$mysubdirs' # Initialize some variables set by options. ac_init_help= ac_init_version=false # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *) ac_optarg=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_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` eval enable_$ac_feature=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_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` eval enable_$ac_feature=\$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_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/[-.]/_/g'` eval with_$ac_package=\$ac_optarg ;; -without-* | --without-*) ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/[-.]/_/g'` eval with_$ac_package=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 ;; -*) { echo "$as_me: error: unrecognized option: $ac_option Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && 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'` { echo "$as_me: error: missing argument to $ac_option" >&2 { (exit 1); exit 1; }; } fi # Be sure to have absolute directory names. 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 case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; } 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 echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || { echo "$as_me: error: Working directory cannot be determined" >&2 { (exit 1); exit 1; }; } test "X$ac_ls_di" = "X$ac_pwd_ls_di" || { echo "$as_me: error: pwd does not report name of working directory" >&2 { (exit 1); exit 1; }; } # 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 -- "$0" || $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$0" : 'X\(//\)[^/]' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X"$0" | 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 .." { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2 { (exit 1); exit 1; }; } pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures this package to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF _ACEOF fi if test -n "$ac_init_help"; then cat <<\_ACEOF Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-experimental-modules Use experimental and unstable modules. (default=no) Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory LIBS libraries to pass to the linker, e.g. -l CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I if you have headers in a nonstandard directory Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. _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" || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`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 echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF configure generated by GNU Autoconf 2.61 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 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 cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by $as_me, which was generated by GNU Autoconf 2.61. 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=. 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=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; 2) ac_configure_args1="$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 ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac done done $as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } $as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export 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 cat <<\_ASBOX ## ---------------- ## ## Cache variables. ## ## ---------------- ## _ASBOX 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_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( *) $as_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 cat <<\_ASBOX ## ----------------- ## ## Output variables. ## ## ----------------- ## _ASBOX echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then cat <<\_ASBOX ## ------------------- ## ## File substitutions. ## ## ------------------- ## _ASBOX echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then cat <<\_ASBOX ## ----------- ## ## confdefs.h. ## ## ----------- ## _ASBOX echo cat confdefs.h echo fi test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" 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'; { (exit 1); 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 # 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 # Let the site file select an alternate cache file if it wants to. # Prefer explicitly selected file to automatically selected ones. if test -n "$CONFIG_SITE"; then set x "$CONFIG_SITE" elif test "x$prefix" != xNONE; then set x "$prefix/share/config.site" "$prefix/etc/config.site" else set x "$ac_default_prefix/share/config.site" \ "$ac_default_prefix/etc/config.site" fi shift for ac_site_file do if test -r "$ac_site_file"; then { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" 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. if test -f "$cache_file"; then { echo "$as_me:$LINENO: loading cache $cache_file" >&5 echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { echo "$as_me:$LINENO: creating cache $cache_file" >&5 echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 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 { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 echo "$as_me: former value: $ac_old_val" >&2;} { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 echo "$as_me: current value: $ac_new_val" >&2;} ac_cache_corrupted=: fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`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. *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 echo "$as_me: error: changes in the environment can compromise the build" >&2;} { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} { (exit 1); exit 1; }; } 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 fail= SMART_LIBS= SMART_CLFAGS= if test x$with_rlm_sql != xno; then 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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}gcc" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="gcc" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}cc" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="$ac_prog" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&5 echo "$as_me: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } # Provide some information about the compiler. echo "$as_me:$LINENO: checking for C compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (ac_try="$ac_compiler --version >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -v >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -V >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out 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. { echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6; } ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # # List of possible output files, starting from the most likely. # The algorithm is not robust to junk in `.', hence go to wildcards (a.*) # only as a last resort. b.out is created by i960 compilers. ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out' # # The IRIX 6 linker writes into existing files which may not be # executable, retaining their permissions. Remove them first so a # subsequent execution test works. ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link_default") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; 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 | *.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 { echo "$as_me:$LINENO: result: $ac_file" >&5 echo "${ECHO_T}$ac_file" >&6; } if test -z "$ac_file"; then echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: C compiler cannot create executables See \`config.log' for more details." >&5 echo "$as_me: error: C compiler cannot create executables See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } fi ac_exeext=$ac_cv_exeext # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { echo "$as_me:$LINENO: checking whether the C compiler works" >&5 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6; } # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then if { ac_try='./$ac_file' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { echo "$as_me:$LINENO: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&5 echo "$as_me: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi fi fi { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } rm -f a.out a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; } { echo "$as_me:$LINENO: result: $cross_compiling" >&5 echo "${ECHO_T}$cross_compiling" >&6; } { echo "$as_me:$LINENO: checking for suffix of executables" >&5 echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; } if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; 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 | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest$ac_cv_exeext { echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 echo "${ECHO_T}$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT { echo "$as_me:$LINENO: checking for suffix of object files" >&5 echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; } if test "${ac_cv_objext+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; 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 ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 echo "${ECHO_T}$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; } if test "${ac_cv_c_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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 { echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; } GCC=`test $ac_compiler_gnu = yes && echo yes` ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CFLAGS="" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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 { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 echo "${ECHO_T}$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 { echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_c89+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_c89=$ac_arg else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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) { echo "$as_me:$LINENO: result: none needed" >&5 echo "${ECHO_T}none needed" >&6; } ;; xno) { echo "$as_me:$LINENO: result: unsupported" >&5 echo "${ECHO_T}unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;; 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 EXPERIMENTAL= # Check whether --with-experimental-modules was given. if test "${with_experimental_modules+set}" = set; then withval=$with_experimental_modules; case "$withval" in yes) EXPERIMENTAL=yes ;; *) esac fi mysubdirs= if test "x$EXPERIMENTAL" = "xyes"; then for foo in `find ./drivers -name configure -print`; do bar=`echo $foo | sed 's%/configure$%%g'` mysubdirs="$mysubdirs $bar" done else for foo in `cat stable`; do mysubdirs="$mysubdirs ./drivers/$foo" done fi SQL_MODULES= if test "x$EXPERIMENTAL" = "xyes"; then for foo in `ls ./drivers/rlm_*/Makefile* | sed 's/.*rlm/rlm/;s,/Make.*,,' | sort -u`; do SQL_MODULES="$SQL_MODULES $foo" done else for foo in `cat stable`; do SQL_MODULES="$SQL_MODULES $foo" done fi ln -s ../../../install-sh install-sh 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 { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5 echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;} { (exit 1); exit 1; }; } 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. subdirs="$subdirs $mysubdirs" rm install-sh targetname=rlm_sql else targetname= echo \*\*\* module rlm_sql is disabled. fi if test x"$fail" != x""; then if test x"${enable_strict_dependencies}" = x"yes"; then { { echo "$as_me:$LINENO: error: set --without-rlm_sql to disable it explicitly." >&5 echo "$as_me: error: set --without-rlm_sql to disable it explicitly." >&2;} { (exit 1); exit 1; }; } else { echo "$as_me:$LINENO: WARNING: silently not building rlm_sql." >&5 echo "$as_me: WARNING: silently not building rlm_sql." >&2;} { echo "$as_me:$LINENO: WARNING: FAILURE: rlm_sql requires: $fail." >&5 echo "$as_me: WARNING: FAILURE: rlm_sql requires: $fail." >&2;} if test x"$headersuggestion" != x; then { echo "$as_me:$LINENO: WARNING: $headersuggestion" >&5 echo "$as_me: WARNING: $headersuggestion" >&2;} fi if test x"$libsuggestion" != x; then { echo "$as_me:$LINENO: WARNING: $libsuggestion" >&5 echo "$as_me: WARNING: $libsuggestion" >&2;} fi targetname="" fi fi sql_ldflags=$SMART_LIBS sql_cflags=$SMART_CFLAGS unset ac_cv_env_LIBS_set unset ac_cv_env_LIBS_value ac_config_files="$ac_config_files ./Makefile ./drivers/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_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( *) $as_unset $ac_var ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then test "x$cache_file" != "x/dev/null" && { echo "$as_me:$LINENO: updating cache $cache_file" >&5 echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 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}' # Transform confdefs.h into DEFS. # Protect against shell expansion while executing Makefile rules. # Protect against Makefile macro expansion. # # If the first sed substitution is executed (which looks for macros that # take arguments), then branch to the quote section. Otherwise, # look for a macro that doesn't take arguments. ac_script=' t clear :clear s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g t quote s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g t quote b any :quote s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g s/\[/\\&/g s/\]/\\&/g s/\$/$$/g H :any ${ g s/^\n// s/\n/ /g p } ' DEFS=`sed -n "$ac_script" confdefs.h` ac_libobjs= ac_ltlibobjs= 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=`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. ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs : ${CONFIG_STATUS=./config.status} ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >$CONFIG_STATUS <<_ACEOF #! $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} _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ## --------------------- ## ## 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=: # 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 # PATH needs CR # 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 # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false 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.) as_nl=' ' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. 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 # Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # CDPATH. $as_unset CDPATH as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, and appends # trailing '-' during substitution so that $LINENO is not a special # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # scripts with optimization help from Paolo Bonzini. 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" || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi 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 fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi 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=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 # Save the log message, to keep $[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by $as_me, which was generated by GNU Autoconf 2.61. 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 cat >>$CONFIG_STATUS <<_ACEOF # Files that config.status was made for. config_files="$ac_config_files" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit -q, --quiet 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 Configuration files: $config_files Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ config.status configured by $0, generated by GNU Autoconf 2.61, with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" Copyright (C) 2006 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' _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # If no file are specified by the user, then we need to provide default # value. By we need to know if files were specified by the user. 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=$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 ) echo "$ac_cs_version"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift CONFIG_FILES="$CONFIG_FILES $ac_optarg" ac_need_defaults=false;; --he | --h | --help | --hel | -h ) 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. -*) { echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *) ac_config_targets="$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 if \$ac_cs_recheck; then echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 CONFIG_SHELL=$SHELL export CONFIG_SHELL exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "./Makefile") CONFIG_FILES="$CONFIG_FILES ./Makefile" ;; "./drivers/Makefile") CONFIG_FILES="$CONFIG_FILES ./drivers/Makefile" ;; *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; 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 fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= trap 'exit_status=$? { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status ' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || { echo "$me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } # # Set up the sed scripts for CONFIG_FILES section. # # No need to generate the scripts if there are no CONFIG_FILES. # This happens for instance when ./config.status config.h if test -n "$CONFIG_FILES"; then _ACEOF ac_delim='%!_!# ' for ac_last_try in false false false false false :; do cat >conf$$subs.sed <<_ACEOF SHELL!$SHELL$ac_delim PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim PACKAGE_NAME!$PACKAGE_NAME$ac_delim PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim PACKAGE_STRING!$PACKAGE_STRING$ac_delim PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim exec_prefix!$exec_prefix$ac_delim prefix!$prefix$ac_delim program_transform_name!$program_transform_name$ac_delim bindir!$bindir$ac_delim sbindir!$sbindir$ac_delim libexecdir!$libexecdir$ac_delim datarootdir!$datarootdir$ac_delim datadir!$datadir$ac_delim sysconfdir!$sysconfdir$ac_delim sharedstatedir!$sharedstatedir$ac_delim localstatedir!$localstatedir$ac_delim includedir!$includedir$ac_delim oldincludedir!$oldincludedir$ac_delim docdir!$docdir$ac_delim infodir!$infodir$ac_delim htmldir!$htmldir$ac_delim dvidir!$dvidir$ac_delim pdfdir!$pdfdir$ac_delim psdir!$psdir$ac_delim libdir!$libdir$ac_delim localedir!$localedir$ac_delim mandir!$mandir$ac_delim DEFS!$DEFS$ac_delim ECHO_C!$ECHO_C$ac_delim ECHO_N!$ECHO_N$ac_delim ECHO_T!$ECHO_T$ac_delim LIBS!$LIBS$ac_delim build_alias!$build_alias$ac_delim host_alias!$host_alias$ac_delim target_alias!$target_alias$ac_delim CC!$CC$ac_delim CFLAGS!$CFLAGS$ac_delim LDFLAGS!$LDFLAGS$ac_delim CPPFLAGS!$CPPFLAGS$ac_delim ac_ct_CC!$ac_ct_CC$ac_delim EXEEXT!$EXEEXT$ac_delim OBJEXT!$OBJEXT$ac_delim subdirs!$subdirs$ac_delim sql_ldflags!$sql_ldflags$ac_delim sql_cflags!$sql_cflags$ac_delim targetname!$targetname$ac_delim SQL_MODULES!$SQL_MODULES$ac_delim LIBOBJS!$LIBOBJS$ac_delim LTLIBOBJS!$LTLIBOBJS$ac_delim _ACEOF if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 51; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` if test -n "$ac_eof"; then ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` ac_eof=`expr $ac_eof + 1` fi cat >>$CONFIG_STATUS <<_ACEOF cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof /@[a-zA-Z_][a-zA-Z_0-9]*@/!b end _ACEOF sed ' s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g s/^/s,@/; s/!/@,|#_!!_#|/ :n t n s/'"$ac_delim"'$/,g/; t s/$/\\/; p N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n ' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF :end s/|#_!!_#|//g CEOF$ac_eof _ACEOF # VPATH may cause trouble with some makes, so we remove $(srcdir), # ${srcdir} and @srcdir@ 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[ ]*=/{ s/:*\$(srcdir):*/:/ s/:*\${srcdir}:*/:/ s/:*@srcdir@:*/:/ s/^\([^=]*=[ ]*\):*/\1/ s/:*$// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF fi # test -n "$CONFIG_FILES" for ac_tag in :F $CONFIG_FILES do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5 echo "$as_me: error: Invalid tag $ac_tag." >&2;} { (exit 1); exit 1; }; };; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 echo "$as_me: error: cannot find input file: $ac_f" >&2;} { (exit 1); exit 1; }; };; esac ac_file_inputs="$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 "`IFS=: echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure." if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { echo "$as_me:$LINENO: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} fi case $ac_tag in *:-:* | *:-) cat >"$tmp/stdin";; 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 || 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" case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`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 || 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" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 echo "$as_me: error: cannot create directory $as_dir" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`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 # _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # 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= case `sed -n '/datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p ' $ac_file_inputs` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF 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 sed "$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s&@configure_input@&$configure_input&;t t s&@top_builddir@&$ac_top_builddir_sub&;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 $ac_datarootdir_hack " $ac_file_inputs | sed -f "$tmp/subs-1.sed" >$tmp/out test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&5 echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&2;} rm -f "$tmp/stdin" case $ac_file in -) cat "$tmp/out"; rm -f "$tmp/out";; *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;; esac ;; esac done # for ac_tag { (exit 0); exit 0; } _ACEOF chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save # 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 || { (exit 1); exit 1; } fi # # CONFIG_SUBDIRS section. # if test "$no_recursion" != yes; then # Remove --cache-file and --srcdir arguments so they do not pile up. ac_sub_configure_args= ac_prev= eval "set x $ac_configure_args" shift for ac_arg do if test -n "$ac_prev"; then ac_prev= continue fi case $ac_arg in -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=*) ;; --config-cache | -C) ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) ;; *) case $ac_arg in *\'*) ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac ac_sub_configure_args="$ac_sub_configure_args '$ac_arg'" ;; esac done # Always prepend --prefix to ensure using the same prefix # in subdir configurations. ac_arg="--prefix=$prefix" case $ac_arg in *\'*) ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac ac_sub_configure_args="'$ac_arg' $ac_sub_configure_args" # Pass --silent if test "$silent" = yes; then ac_sub_configure_args="--silent $ac_sub_configure_args" fi ac_popdir=`pwd` for ac_dir in : $subdirs; do test "x$ac_dir" = x: && continue # Do not complain, so a configure script can configure whichever # parts of a large source tree are present. test -d "$srcdir/$ac_dir" || continue ac_msg="=== configuring in $ac_dir (`pwd`/$ac_dir)" echo "$as_me:$LINENO: $ac_msg" >&5 echo "$ac_msg" >&6 { as_dir="$ac_dir" case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`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 || 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" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 echo "$as_me: error: cannot create directory $as_dir" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`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" # Check for guested configure; otherwise get Cygnus style configure. if test -f "$ac_srcdir/configure.gnu"; then ac_sub_configure=$ac_srcdir/configure.gnu elif test -f "$ac_srcdir/configure"; then ac_sub_configure=$ac_srcdir/configure elif test -f "$ac_srcdir/configure.in"; then # This should be Cygnus configure. ac_sub_configure=$ac_aux_dir/configure else { echo "$as_me:$LINENO: WARNING: no configuration information is in $ac_dir" >&5 echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2;} ac_sub_configure= fi # The recursion is here. if test -n "$ac_sub_configure"; then # Make the cache file name correct relative to the subdirectory. case $cache_file in [\\/]* | ?:[\\/]* ) ac_sub_cache_file=$cache_file ;; *) # Relative name. ac_sub_cache_file=$ac_top_build_prefix$cache_file ;; esac { echo "$as_me:$LINENO: running $SHELL $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_srcdir" >&5 echo "$as_me: running $SHELL $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_srcdir" >&6;} # The eval makes quoting arguments work. eval "\$SHELL \"\$ac_sub_configure\" $ac_sub_configure_args \ --cache-file=\"\$ac_sub_cache_file\" --srcdir=\"\$ac_srcdir\"" || { { echo "$as_me:$LINENO: error: $ac_sub_configure failed for $ac_dir" >&5 echo "$as_me: error: $ac_sub_configure failed for $ac_dir" >&2;} { (exit 1); exit 1; }; } fi cd "$ac_popdir" done fi freeradius-server/src/modules/rlm_sql/configure.in000066400000000000000000000040521257552170400227450ustar00rootroot00000000000000AC_PREREQ([2.53]) AC_INIT(rlm_sql.c) AC_REVISION($Revision$) AC_DEFUN(modname,[rlm_sql]) fail= SMART_LIBS= SMART_CLFAGS= if test x$with_[]modname != xno; then AC_PROG_CC dnl extra argument: --with-experimental-modules EXPERIMENTAL= AC_ARG_WITH(experimental-modules, [ --with-experimental-modules Use experimental and unstable modules. (default=no) ], [ case "$withval" in yes) EXPERIMENTAL=yes ;; *) esac ] ) mysubdirs= if test "x$EXPERIMENTAL" = "xyes"; then for foo in `find ./drivers -name configure -print`; do bar=`echo $foo | sed 's%/configure$%%g'` mysubdirs="$mysubdirs $bar" done else for foo in `cat stable`; do mysubdirs="$mysubdirs ./drivers/$foo" done fi SQL_MODULES= if test "x$EXPERIMENTAL" = "xyes"; then for foo in `ls ./drivers/rlm_*/Makefile* | sed 's/.*rlm/rlm/;s,/Make.*,,' | sort -u`; do SQL_MODULES="$SQL_MODULES $foo" done else for foo in `cat stable`; do SQL_MODULES="$SQL_MODULES $foo" done fi dnl # don't ask... this is done to avoid autoconf stupidities. ln -s ../../../install-sh install-sh dnl # dnl # Don't change the variable name here. Autoconf goes bonkers dnl # if you do. dnl # AC_CONFIG_SUBDIRS($mysubdirs) rm install-sh dnl # dnl # Don't bother looking for errors in the child directories dnl # targetname=modname else targetname= echo \*\*\* module modname is disabled. fi if test x"$fail" != x""; then if test x"${enable_strict_dependencies}" = x"yes"; then AC_MSG_ERROR([set --without-]modname[ to disable it explicitly.]) else AC_MSG_WARN([silently not building ]modname[.]) AC_MSG_WARN([FAILURE: ]modname[ requires: $fail.]) if test x"$headersuggestion" != x; then AC_MSG_WARN([$headersuggestion]) fi if test x"$libsuggestion" != x; then AC_MSG_WARN([$libsuggestion]) fi targetname="" fi fi sql_ldflags=$SMART_LIBS sql_cflags=$SMART_CFLAGS AC_SUBST(sql_ldflags) AC_SUBST(sql_cflags) AC_SUBST(targetname) AC_SUBST(SQL_MODULES) AC_OUTPUT(\ ./Makefile \ ./drivers/Makefile ) freeradius-server/src/modules/rlm_sql/drivers/000077500000000000000000000000001257552170400221115ustar00rootroot00000000000000freeradius-server/src/modules/rlm_sql/drivers/.gitignore000066400000000000000000000000111257552170400240710ustar00rootroot00000000000000Makefile freeradius-server/src/modules/rlm_sql/drivers/Makefile.in000066400000000000000000000006531257552170400241620ustar00rootroot00000000000000SUBDIRS = @SQL_MODULES@ .PHONY: all clean all: $(MAKE) $(MFLAGS) WHAT_TO_MAKE=$@ common clean: $(MAKE) $(MFLAGS) WHAT_TO_MAKE=$@ common @rm -rf lib install: $(MAKE) $(MFLAGS) WHAT_TO_MAKE=$@ common reconfig: $(MAKE) $(MFLAGS) WHAT_TO_MAKE=$@ common .PHONY: common $(SUBDIRS) common: $(SUBDIRS) @[ -d lib/ ] || mkdir lib $(SUBDIRS): @echo "Making $(WHAT_TO_MAKE) in $@." @$(MAKE) $(MFLAGS) -C $@ $(WHAT_TO_MAKE) freeradius-server/src/modules/rlm_sql/drivers/rlm_sql_db2/000077500000000000000000000000001257552170400243115ustar00rootroot00000000000000freeradius-server/src/modules/rlm_sql/drivers/rlm_sql_db2/Makefile.in000066400000000000000000000002731257552170400263600ustar00rootroot00000000000000include ../../../../../Make.inc TARGET = @targetname@ SRCS = sql_db2.c RLM_SQL_CFLAGS = @sql_ibmdb2_cflags@ RLM_SQL_LIBS = @sql_ibmdb2_ldflags@ include ../rules.mak freeradius-server/src/modules/rlm_sql/drivers/rlm_sql_db2/configure000077500000000000000000003320011257552170400262170ustar00rootroot00000000000000#! /bin/sh # From configure.in Revision. # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.61. # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, # 2002, 2003, 2004, 2005, 2006 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=: # 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 # PATH needs CR # 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 # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false 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.) as_nl=' ' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. 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 # Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # CDPATH. $as_unset CDPATH if test "x$CONFIG_SHELL" = x; then if (eval ":") 2>/dev/null; then as_have_required=yes else as_have_required=no fi if test $as_have_required = yes && (eval ": (as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=\$LINENO as_lineno_2=\$LINENO test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } ") 2> /dev/null; then : else as_candidate_shells= as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. case $as_dir in /*) for as_base in sh bash ksh sh5; do as_candidate_shells="$as_candidate_shells $as_dir/$as_base" done;; esac done IFS=$as_save_IFS for as_shell in $as_candidate_shells $SHELL; do # Try only shells that exist, to save several forks. if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { ("$as_shell") 2> /dev/null <<\_ASEOF 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 : _ASEOF }; then CONFIG_SHELL=$as_shell as_have_required=yes if { "$as_shell" 2> /dev/null <<\_ASEOF 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 : (as_func_return () { (exit $1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = "$1" ); then : else exitcode=1 echo positional parameters were not saved. fi test $exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } _ASEOF }; then break fi fi done if test "x$CONFIG_SHELL" != x; then for as_var in BASH_ENV ENV do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done export CONFIG_SHELL exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} fi if test $as_have_required = no; then echo This script requires a shell more modern than all the echo shells that I found on your system. Please install a echo modern shell, or manually run the script under such a echo shell if you do have one. { (exit 1); exit 1; } fi fi fi (eval "as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0") || { echo No shell found that supports shell functions. echo Please tell autoconf@gnu.org about your system, echo including any error possibly output before this echo message } as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, and appends # trailing '-' during substitution so that $LINENO is not a special # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # scripts with optimization help from Paolo Bonzini. 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" || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi 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 fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi 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=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, 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= SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME= PACKAGE_TARNAME= PACKAGE_VERSION= PACKAGE_STRING= PACKAGE_BUGREPORT= ac_unique_file="sql_db2.c" ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datarootdir datadir sysconfdir sharedstatedir localstatedir includedir oldincludedir docdir infodir htmldir dvidir pdfdir psdir libdir localedir mandir DEFS ECHO_C ECHO_N ECHO_T LIBS build_alias host_alias target_alias CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT sql_ibmdb2_ldflags sql_ibmdb2_cflags targetname LIBOBJS LTLIBOBJS' ac_subst_files='' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS' # Initialize some variables set by options. ac_init_help= ac_init_version=false # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *) ac_optarg=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_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` eval enable_$ac_feature=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_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` eval enable_$ac_feature=\$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_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/[-.]/_/g'` eval with_$ac_package=\$ac_optarg ;; -without-* | --without-*) ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/[-.]/_/g'` eval with_$ac_package=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 ;; -*) { echo "$as_me: error: unrecognized option: $ac_option Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && 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'` { echo "$as_me: error: missing argument to $ac_option" >&2 { (exit 1); exit 1; }; } fi # Be sure to have absolute directory names. 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 case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; } 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 echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || { echo "$as_me: error: Working directory cannot be determined" >&2 { (exit 1); exit 1; }; } test "X$ac_ls_di" = "X$ac_pwd_ls_di" || { echo "$as_me: error: pwd does not report name of working directory" >&2 { (exit 1); exit 1; }; } # 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 -- "$0" || $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$0" : 'X\(//\)[^/]' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X"$0" | 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 .." { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2 { (exit 1); exit 1; }; } pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures this package to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF _ACEOF fi if test -n "$ac_init_help"; then cat <<\_ACEOF Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-ibmdb2-include-dir=DIR Directory where the IBM-DB2 includes may be found --with-ibmdb2-lib-dir=DIR Directory where the IBM-DB2 libraries may be found --with-ibmdb2-dir=DIR Base directory where IBM-DB2 is installed 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 C/C++/Objective C preprocessor flags, e.g. -I if you have headers in a nonstandard directory Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. _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" || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`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 echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF configure generated by GNU Autoconf 2.61 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 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 cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by $as_me, which was generated by GNU Autoconf 2.61. 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=. 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=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; 2) ac_configure_args1="$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 ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac done done $as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } $as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export 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 cat <<\_ASBOX ## ---------------- ## ## Cache variables. ## ## ---------------- ## _ASBOX 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_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( *) $as_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 cat <<\_ASBOX ## ----------------- ## ## Output variables. ## ## ----------------- ## _ASBOX echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then cat <<\_ASBOX ## ------------------- ## ## File substitutions. ## ## ------------------- ## _ASBOX echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then cat <<\_ASBOX ## ----------- ## ## confdefs.h. ## ## ----------- ## _ASBOX echo cat confdefs.h echo fi test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" 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'; { (exit 1); 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 # 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 # Let the site file select an alternate cache file if it wants to. # Prefer explicitly selected file to automatically selected ones. if test -n "$CONFIG_SITE"; then set x "$CONFIG_SITE" elif test "x$prefix" != xNONE; then set x "$prefix/share/config.site" "$prefix/etc/config.site" else set x "$ac_default_prefix/share/config.site" \ "$ac_default_prefix/etc/config.site" fi shift for ac_site_file do if test -r "$ac_site_file"; then { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" 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. if test -f "$cache_file"; then { echo "$as_me:$LINENO: loading cache $cache_file" >&5 echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { echo "$as_me:$LINENO: creating cache $cache_file" >&5 echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 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 { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 echo "$as_me: former value: $ac_old_val" >&2;} { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 echo "$as_me: current value: $ac_new_val" >&2;} ac_cache_corrupted=: fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`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. *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 echo "$as_me: error: changes in the environment can compromise the build" >&2;} { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} { (exit 1); exit 1; }; } 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 fail= SMART_LIBS= SMART_CLFAGS= if test x$with_rlm_sql_db2 != xno; then ibmdb2_include_dir= # Check whether --with-ibmdb2-include-dir was given. if test "${with_ibmdb2_include_dir+set}" = set; then withval=$with_ibmdb2_include_dir; case "$withval" in no) { { echo "$as_me:$LINENO: error: Need ibmdb2-include-dir" >&5 echo "$as_me: error: Need ibmdb2-include-dir" >&2;} { (exit 1); exit 1; }; } ;; yes) ;; *) ibmdb2_include_dir="$withval" ;; esac fi ibmdb2_lib_dir= # Check whether --with-ibmdb2-lib-dir was given. if test "${with_ibmdb2_lib_dir+set}" = set; then withval=$with_ibmdb2_lib_dir; case "$withval" in no) { { echo "$as_me:$LINENO: error: Need ibmdb2-lib-dir" >&5 echo "$as_me: error: Need ibmdb2-lib-dir" >&2;} { (exit 1); exit 1; }; } ;; yes) ;; *) ibmdb2_lib_dir="$withval" ;; esac fi # Check whether --with-ibmdb2-dir was given. if test "${with_ibmdb2_dir+set}" = set; then withval=$with_ibmdb2_dir; case "$withval" in no) { { echo "$as_me:$LINENO: error: Need ibmdb2-dir" >&5 echo "$as_me: error: Need ibmdb2-dir" >&2;} { (exit 1); exit 1; }; } ;; yes) ;; *) ibmdb2_lib_dir="$withval/lib" ibmdb2_include_dir="$withval/include" ;; esac fi smart_try_dir="$ibmdb2_lib_dir /usr/IBMdb2/V7.1/lib" 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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}gcc" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="gcc" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}cc" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="$ac_prog" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&5 echo "$as_me: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } # Provide some information about the compiler. echo "$as_me:$LINENO: checking for C compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (ac_try="$ac_compiler --version >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -v >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -V >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out 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. { echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6; } ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # # List of possible output files, starting from the most likely. # The algorithm is not robust to junk in `.', hence go to wildcards (a.*) # only as a last resort. b.out is created by i960 compilers. ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out' # # The IRIX 6 linker writes into existing files which may not be # executable, retaining their permissions. Remove them first so a # subsequent execution test works. ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link_default") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; 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 | *.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 { echo "$as_me:$LINENO: result: $ac_file" >&5 echo "${ECHO_T}$ac_file" >&6; } if test -z "$ac_file"; then echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: C compiler cannot create executables See \`config.log' for more details." >&5 echo "$as_me: error: C compiler cannot create executables See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } fi ac_exeext=$ac_cv_exeext # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { echo "$as_me:$LINENO: checking whether the C compiler works" >&5 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6; } # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then if { ac_try='./$ac_file' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { echo "$as_me:$LINENO: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&5 echo "$as_me: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi fi fi { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } rm -f a.out a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; } { echo "$as_me:$LINENO: result: $cross_compiling" >&5 echo "${ECHO_T}$cross_compiling" >&6; } { echo "$as_me:$LINENO: checking for suffix of executables" >&5 echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; } if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; 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 | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest$ac_cv_exeext { echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 echo "${ECHO_T}$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT { echo "$as_me:$LINENO: checking for suffix of object files" >&5 echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; } if test "${ac_cv_objext+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; 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 ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 echo "${ECHO_T}$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; } if test "${ac_cv_c_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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 { echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; } GCC=`test $ac_compiler_gnu = yes && echo yes` ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CFLAGS="" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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 { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 echo "${ECHO_T}$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 { echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_c89+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_c89=$ac_arg else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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) { echo "$as_me:$LINENO: result: none needed" >&5 echo "${ECHO_T}none needed" >&6; } ;; xno) { echo "$as_me:$LINENO: result: unsupported" >&5 echo "${ECHO_T}unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;; 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 sm_lib_safe=`echo "db2" | sed 'y%./+-%__p_%'` sm_func_safe=`echo "SQLConnect" | sed 'y%./+-%__p_%'` { echo "$as_me:$LINENO: checking for SQLConnect in -ldb2" >&5 echo $ECHO_N "checking for SQLConnect in -ldb2... $ECHO_C" >&6; } old_LIBS="$LIBS" smart_lib= smart_lib_dir= if test "x$smart_try_dir" != "x"; then for try in $smart_try_dir; do LIBS="-L$try -ldb2 $old_LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ extern char SQLConnect(); int main () { SQLConnect() ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then smart_lib="-L$try -ldb2" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test "x$smart_lib" != "x"; then break; fi done LIBS="$old_LIBS" fi if test "x$smart_lib" = "x"; then LIBS="-ldb2 $old_LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ extern char SQLConnect(); int main () { SQLConnect() ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then smart_lib="-ldb2" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS="$old_LIBS" fi if test "x$smart_lib" = "x"; then if test "x$LOCATE" != "x"; then DIRS= file=libdb2${libltdl_cv_shlibext} for x in `${LOCATE} $file 2>/dev/null`; do base=`echo $x | sed "s%/${file}%%"` if test "x$x" = "x$base"; then continue; fi dir=`${DIRNAME} $x 2>/dev/null` exclude=`echo ${dir} | ${GREP} /home` if test "x$exclude" != "x"; then continue fi already=`echo \$smart_lib_dir ${DIRS} | ${GREP} ${dir}` if test "x$already" = "x"; then DIRS="$DIRS $dir" fi done fi eval "smart_lib_dir=\"\$smart_lib_dir $DIRS\"" if test "x$LOCATE" != "x"; then DIRS= file=libdb2.a for x in `${LOCATE} $file 2>/dev/null`; do base=`echo $x | sed "s%/${file}%%"` if test "x$x" = "x$base"; then continue; fi dir=`${DIRNAME} $x 2>/dev/null` exclude=`echo ${dir} | ${GREP} /home` if test "x$exclude" != "x"; then continue fi already=`echo \$smart_lib_dir ${DIRS} | ${GREP} ${dir}` if test "x$already" = "x"; then DIRS="$DIRS $dir" fi done fi eval "smart_lib_dir=\"\$smart_lib_dir $DIRS\"" for try in $smart_lib_dir /usr/local/lib /opt/lib; do LIBS="-L$try -ldb2 $old_LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ extern char SQLConnect(); int main () { SQLConnect() ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then smart_lib="-L$try -ldb2" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test "x$smart_lib" != "x"; then break; fi done LIBS="$old_LIBS" fi if test "x$smart_lib" != "x"; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } eval "ac_cv_lib_${sm_lib_safe}_${sm_func_safe}=yes" LIBS="$smart_lib $old_LIBS" SMART_LIBS="$smart_lib $SMART_LIBS" else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_cv_lib_db2_SQLConnect" != xyes; then fail="$fail libdb2" fi smart_try_dir="$ibmdb2_include_dir /usr/IBMdb2/V7.1/include" ac_safe=`echo "sqlcli.h" | sed 'y%./+-%__pm%'` { echo "$as_me:$LINENO: checking for sqlcli.h" >&5 echo $ECHO_N "checking for sqlcli.h... $ECHO_C" >&6; } old_CFLAGS="$CFLAGS" smart_include= smart_include_dir= if test "x$smart_try_dir" != "x"; then for try in $smart_try_dir; do CFLAGS="$old_CFLAGS -I$try" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { int a = 1; ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then smart_include="-I$try" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 smart_include= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test "x$smart_include" != "x"; then break; fi done CFLAGS="$old_CFLAGS" fi if test "x$smart_include" = "x"; then cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { int a = 1; ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then smart_include=" " else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 smart_include= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test "x$smart_include" = "x"; then if test "x$LOCATE" != "x"; then DIRS= file=sqlcli.h for x in `${LOCATE} $file 2>/dev/null`; do base=`echo $x | sed "s%/${file}%%"` if test "x$x" = "x$base"; then continue; fi dir=`${DIRNAME} $x 2>/dev/null` exclude=`echo ${dir} | ${GREP} /home` if test "x$exclude" != "x"; then continue fi already=`echo \$smart_include_dir ${DIRS} | ${GREP} ${dir}` if test "x$already" = "x"; then DIRS="$DIRS $dir" fi done fi eval "smart_include_dir=\"\$smart_include_dir $DIRS\"" for try in $smart_include_dir /usr/local/include /opt/include; do CFLAGS="$old_CFLAGS -I$try" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { int a = 1; ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then smart_include="-I$try" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 smart_include= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test "x$smart_include" != "x"; then break; fi done CFLAGS="$old_CFLAGS" fi if test "x$smart_include" != "x"; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } eval "ac_cv_header_$ac_safe=yes" CFLAGS="$old_CFLAGS $smart_include" SMART_CFLAGS="$SMART_CFLAGS $smart_include" else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_cv_header_sqlcli_h" != xyes; then fail="$fail sqlcli.h" fi targetname=rlm_sql_db2 else targetname= echo \*\*\* module rlm_sql_db2 is disabled. fi if test "x$fail" != x; then if test "x${enable_strict_dependencies}" = xyes; then { { echo "$as_me:$LINENO: error: set --without-rlm_sql_db2 to disable it explicitly." >&5 echo "$as_me: error: set --without-rlm_sql_db2 to disable it explicitly." >&2;} { (exit 1); exit 1; }; } else { echo "$as_me:$LINENO: WARNING: silently not building rlm_sql_db2." >&5 echo "$as_me: WARNING: silently not building rlm_sql_db2." >&2;} { echo "$as_me:$LINENO: WARNING: FAILURE: rlm_sql_db2 requires:$fail." >&5 echo "$as_me: WARNING: FAILURE: rlm_sql_db2 requires:$fail." >&2;}; targetname= fi fi sql_ibmdb2_ldflags="$SMART_LIBS" sql_ibmdb2_cflags="$SMART_CFLAGS" unset ac_cv_env_LIBS_set unset ac_cv_env_LIBS_value ac_config_files="$ac_config_files 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_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( *) $as_unset $ac_var ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then test "x$cache_file" != "x/dev/null" && { echo "$as_me:$LINENO: updating cache $cache_file" >&5 echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 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}' # Transform confdefs.h into DEFS. # Protect against shell expansion while executing Makefile rules. # Protect against Makefile macro expansion. # # If the first sed substitution is executed (which looks for macros that # take arguments), then branch to the quote section. Otherwise, # look for a macro that doesn't take arguments. ac_script=' t clear :clear s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g t quote s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g t quote b any :quote s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g s/\[/\\&/g s/\]/\\&/g s/\$/$$/g H :any ${ g s/^\n// s/\n/ /g p } ' DEFS=`sed -n "$ac_script" confdefs.h` ac_libobjs= ac_ltlibobjs= 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=`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. ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs : ${CONFIG_STATUS=./config.status} ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >$CONFIG_STATUS <<_ACEOF #! $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} _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ## --------------------- ## ## 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=: # 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 # PATH needs CR # 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 # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false 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.) as_nl=' ' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. 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 # Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # CDPATH. $as_unset CDPATH as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, and appends # trailing '-' during substitution so that $LINENO is not a special # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # scripts with optimization help from Paolo Bonzini. 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" || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi 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 fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi 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=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 # Save the log message, to keep $[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by $as_me, which was generated by GNU Autoconf 2.61. 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 cat >>$CONFIG_STATUS <<_ACEOF # Files that config.status was made for. config_files="$ac_config_files" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit -q, --quiet 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 Configuration files: $config_files Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ config.status configured by $0, generated by GNU Autoconf 2.61, with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" Copyright (C) 2006 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' _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # If no file are specified by the user, then we need to provide default # value. By we need to know if files were specified by the user. 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=$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 ) echo "$ac_cs_version"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift CONFIG_FILES="$CONFIG_FILES $ac_optarg" ac_need_defaults=false;; --he | --h | --help | --hel | -h ) 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. -*) { echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *) ac_config_targets="$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 if \$ac_cs_recheck; then echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 CONFIG_SHELL=$SHELL export CONFIG_SHELL exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; 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 fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= trap 'exit_status=$? { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status ' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || { echo "$me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } # # Set up the sed scripts for CONFIG_FILES section. # # No need to generate the scripts if there are no CONFIG_FILES. # This happens for instance when ./config.status config.h if test -n "$CONFIG_FILES"; then _ACEOF ac_delim='%!_!# ' for ac_last_try in false false false false false :; do cat >conf$$subs.sed <<_ACEOF SHELL!$SHELL$ac_delim PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim PACKAGE_NAME!$PACKAGE_NAME$ac_delim PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim PACKAGE_STRING!$PACKAGE_STRING$ac_delim PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim exec_prefix!$exec_prefix$ac_delim prefix!$prefix$ac_delim program_transform_name!$program_transform_name$ac_delim bindir!$bindir$ac_delim sbindir!$sbindir$ac_delim libexecdir!$libexecdir$ac_delim datarootdir!$datarootdir$ac_delim datadir!$datadir$ac_delim sysconfdir!$sysconfdir$ac_delim sharedstatedir!$sharedstatedir$ac_delim localstatedir!$localstatedir$ac_delim includedir!$includedir$ac_delim oldincludedir!$oldincludedir$ac_delim docdir!$docdir$ac_delim infodir!$infodir$ac_delim htmldir!$htmldir$ac_delim dvidir!$dvidir$ac_delim pdfdir!$pdfdir$ac_delim psdir!$psdir$ac_delim libdir!$libdir$ac_delim localedir!$localedir$ac_delim mandir!$mandir$ac_delim DEFS!$DEFS$ac_delim ECHO_C!$ECHO_C$ac_delim ECHO_N!$ECHO_N$ac_delim ECHO_T!$ECHO_T$ac_delim LIBS!$LIBS$ac_delim build_alias!$build_alias$ac_delim host_alias!$host_alias$ac_delim target_alias!$target_alias$ac_delim CC!$CC$ac_delim CFLAGS!$CFLAGS$ac_delim LDFLAGS!$LDFLAGS$ac_delim CPPFLAGS!$CPPFLAGS$ac_delim ac_ct_CC!$ac_ct_CC$ac_delim EXEEXT!$EXEEXT$ac_delim OBJEXT!$OBJEXT$ac_delim sql_ibmdb2_ldflags!$sql_ibmdb2_ldflags$ac_delim sql_ibmdb2_cflags!$sql_ibmdb2_cflags$ac_delim targetname!$targetname$ac_delim LIBOBJS!$LIBOBJS$ac_delim LTLIBOBJS!$LTLIBOBJS$ac_delim _ACEOF if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 49; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` if test -n "$ac_eof"; then ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` ac_eof=`expr $ac_eof + 1` fi cat >>$CONFIG_STATUS <<_ACEOF cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof /@[a-zA-Z_][a-zA-Z_0-9]*@/!b end _ACEOF sed ' s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g s/^/s,@/; s/!/@,|#_!!_#|/ :n t n s/'"$ac_delim"'$/,g/; t s/$/\\/; p N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n ' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF :end s/|#_!!_#|//g CEOF$ac_eof _ACEOF # VPATH may cause trouble with some makes, so we remove $(srcdir), # ${srcdir} and @srcdir@ 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[ ]*=/{ s/:*\$(srcdir):*/:/ s/:*\${srcdir}:*/:/ s/:*@srcdir@:*/:/ s/^\([^=]*=[ ]*\):*/\1/ s/:*$// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF fi # test -n "$CONFIG_FILES" for ac_tag in :F $CONFIG_FILES do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5 echo "$as_me: error: Invalid tag $ac_tag." >&2;} { (exit 1); exit 1; }; };; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 echo "$as_me: error: cannot find input file: $ac_f" >&2;} { (exit 1); exit 1; }; };; esac ac_file_inputs="$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 "`IFS=: echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure." if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { echo "$as_me:$LINENO: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} fi case $ac_tag in *:-:* | *:-) cat >"$tmp/stdin";; 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 || 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" case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`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 || 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" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 echo "$as_me: error: cannot create directory $as_dir" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`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 # _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # 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= case `sed -n '/datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p ' $ac_file_inputs` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF 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 sed "$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s&@configure_input@&$configure_input&;t t s&@top_builddir@&$ac_top_builddir_sub&;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 $ac_datarootdir_hack " $ac_file_inputs | sed -f "$tmp/subs-1.sed" >$tmp/out test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&5 echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&2;} rm -f "$tmp/stdin" case $ac_file in -) cat "$tmp/out"; rm -f "$tmp/out";; *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;; esac ;; esac done # for ac_tag { (exit 0); exit 0; } _ACEOF chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save # 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 || { (exit 1); exit 1; } fi freeradius-server/src/modules/rlm_sql/drivers/rlm_sql_db2/configure.in000066400000000000000000000042021257552170400266200ustar00rootroot00000000000000AC_PREREQ([2.59]) AC_INIT(sql_db2.c) AC_REVISION($Revision$) AC_DEFUN(modname,[rlm_sql_db2]) fail= SMART_LIBS= SMART_CLFAGS= if test x$with_[]modname != xno; then dnl extra argument: --with-ibmdb2-include-dir ibmdb2_include_dir= AC_ARG_WITH(ibmdb2-include-dir, [AS_HELP_STRING([--with-ibmdb2-include-dir=DIR], [Directory where the IBM-DB2 includes may be found])], [case "$withval" in no) AC_MSG_ERROR(Need ibmdb2-include-dir) ;; yes) ;; *) ibmdb2_include_dir="$withval" ;; esac]) dnl extra argument: --with-ibmdb2-lib-dir ibmdb2_lib_dir= AC_ARG_WITH(ibmdb2-lib-dir, [AS_HELP_STRING([--with-ibmdb2-lib-dir=DIR], [Directory where the IBM-DB2 libraries may be found])], [case "$withval" in no) AC_MSG_ERROR(Need ibmdb2-lib-dir) ;; yes) ;; *) ibmdb2_lib_dir="$withval" ;; esac]) dnl extra argument: --with-ibmdb2-dir AC_ARG_WITH(ibmdb2-dir, [AS_HELP_STRING([--with-ibmdb2-dir=DIR], [Base directory where IBM-DB2 is installed])], [case "$withval" in no) AC_MSG_ERROR(Need ibmdb2-dir) ;; yes) ;; *) ibmdb2_lib_dir="$withval/lib" ibmdb2_include_dir="$withval/include" ;; esac]) dnl Check for SQLConnect in -ldb2 smart_try_dir="$ibmdb2_lib_dir /usr/IBMdb2/V7.1/lib" FR_SMART_CHECK_LIB(db2, SQLConnect) if test "x$ac_cv_lib_db2_SQLConnect" != xyes; then fail="$fail libdb2" fi dnl Check for sqlcli.h smart_try_dir="$ibmdb2_include_dir /usr/IBMdb2/V7.1/include" FR_SMART_CHECK_INCLUDE(sqlcli.h) if test "x$ac_cv_header_sqlcli_h" != xyes; then fail="$fail sqlcli.h" fi targetname=modname else targetname= echo \*\*\* module modname is disabled. fi dnl Don't change this section. if test "x$fail" != x; then if test "x${enable_strict_dependencies}" = xyes; then AC_MSG_ERROR([set --without-]modname[ to disable it explicitly.]) else AC_MSG_WARN([silently not building ]modname[.]) AC_MSG_WARN([FAILURE: ]modname[ requires:$fail.]); targetname= fi fi sql_ibmdb2_ldflags="$SMART_LIBS" sql_ibmdb2_cflags="$SMART_CFLAGS" AC_SUBST(sql_ibmdb2_ldflags) AC_SUBST(sql_ibmdb2_cflags) AC_SUBST(targetname) AC_OUTPUT(Makefile) freeradius-server/src/modules/rlm_sql/drivers/rlm_sql_db2/sql_db2.c000066400000000000000000000225271257552170400260130ustar00rootroot00000000000000/* * sql_db2.c IBM DB2 rlm_sql driver * * Version: $Id$ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2000,2006 The FreeRADIUS server project * Copyright 2000 Mike Machado * Copyright 2000 Alan DeKok * Copyright 2001 Joerg Wendland */ /* * Modification of rlm_sql_db2 to handle IBM DB2 UDB V7 * by Joerg Wendland */ #include RCSID("$Id$") #include #include #include #include #include "rlm_sql.h" typedef struct rlm_sql_db2_sock { SQLHANDLE hdbc; SQLHANDLE henv; SQLHANDLE stmt; } rlm_sql_db2_sock; /************************************************************************* * * Function: sql_create_socket * * Purpose: Establish connection to the db * *************************************************************************/ static int sql_init_socket(SQLSOCK *sqlsocket, SQL_CONFIG *config) { SQLRETURN retval; rlm_sql_db2_sock *sock; /* allocate socket */ if (!sqlsocket->conn) { sqlsocket->conn = (rlm_sql_db2_sock*)rad_malloc(sizeof(rlm_sql_db2_sock)); if (!sqlsocket->conn) { return -1; } } sock = sqlsocket->conn; memset(sock, 0, sizeof(*sock)); /* allocate handles */ SQLAllocHandle(SQL_HANDLE_ENV, SQL_NULL_HANDLE, &(sock->henv)); SQLAllocHandle(SQL_HANDLE_DBC, sock->henv, &(sock->hdbc)); /* connect to database */ retval = SQLConnect(sock->hdbc, config->sql_server, SQL_NTS, config->sql_login, SQL_NTS, config->sql_password, SQL_NTS); if(retval != SQL_SUCCESS) { radlog(L_ERR, "could not connect to DB2 server %s\n", config->sql_server); SQLDisconnect(sock->hdbc); SQLFreeHandle(SQL_HANDLE_DBC, sock->hdbc); SQLFreeHandle(SQL_HANDLE_ENV, sock->henv); return -1; } return 0; } /************************************************************************* * * Function: sql_destroy_socket * * Purpose: Free socket and private connection data * *************************************************************************/ static int sql_destroy_socket(SQLSOCK *sqlsocket, SQL_CONFIG *config) { free(sqlsocket->conn); sqlsocket->conn = NULL; return 0; } /************************************************************************* * * Function: sql_query * * Purpose: Issue a query to the database * *************************************************************************/ static int sql_query(SQLSOCK * sqlsocket, SQL_CONFIG *config, char *querystr) { SQLRETURN retval; rlm_sql_db2_sock *sock; sock = sqlsocket->conn; if (config->sqltrace) radlog(L_DBG,"query:\n%s", querystr); /* allocate handle for statement */ SQLAllocHandle(SQL_HANDLE_STMT, sock->hdbc, &(sock->stmt)); /* execute query */ retval = SQLExecDirect(sock->stmt, querystr, SQL_NTS); if(retval != SQL_SUCCESS) { /* XXX Check if retval means we should return SQL_DOWN */ radlog(L_ERR, "could not execute statement \"%s\"\n", querystr); return -1; } return 0; } /************************************************************************* * * Function: sql_select_query * * Purpose: Issue a select query to the database * *************************************************************************/ static int sql_select_query(SQLSOCK * sqlsocket, SQL_CONFIG *config, char *querystr) { return sql_query(sqlsocket, config, querystr); } /************************************************************************* * * Function: sql_store_result * * Purpose: database specific store_result function. Returns a result * set for the query. * *************************************************************************/ static int sql_store_result(SQLSOCK * sqlsocket, SQL_CONFIG *config) { return 0; } /************************************************************************* * * Function: sql_num_fields * * Purpose: database specific num_fields function. Returns number * of columns from query * *************************************************************************/ static int sql_num_fields(SQLSOCK * sqlsocket, SQL_CONFIG *config) { SQLSMALLINT c; rlm_sql_db2_sock *sock; sock = sqlsocket->conn; SQLNumResultCols(sock->stmt, &c); return c; } /************************************************************************* * * Function: sql_fetch_row * * Purpose: database specific fetch_row. Returns a SQL_ROW struct * with all the data for the query in 'sqlsocket->row'. Returns * 0 on success, -1 on failure, SQL_DOWN if 'database is down' * *************************************************************************/ static int sql_fetch_row(SQLSOCK * sqlsocket, SQL_CONFIG *config) { int c, i; SQLINTEGER len, slen; SQL_ROW retval; rlm_sql_db2_sock *sock; sock = sqlsocket->conn; c = sql_num_fields(sqlsocket, config); retval = (SQL_ROW)rad_malloc(c*sizeof(char*)+1); /* advance cursor */ if(SQLFetch(sock->stmt) == SQL_NO_DATA_FOUND) { sqlsocket->row = NULL; return 0; } for(i = 0; i < c; i++) { /* get column length */ SQLColAttribute(sock->stmt, i+1, SQL_DESC_DISPLAY_SIZE, NULL, 0, NULL, &len); retval[i] = (char*)rad_malloc(len+1); /* get the actual column */ SQLGetData(sock->stmt, i+1, SQL_C_CHAR, retval[i], len+1, &slen); if(slen == SQL_NULL_DATA) retval[i][0] = '\0'; } sqlsocket->row = retval; return 0; } /************************************************************************* * * Function: sql_free_result * * Purpose: database specific free_result. Frees memory allocated * for a result set * *************************************************************************/ static int sql_free_result(SQLSOCK * sqlsocket, SQL_CONFIG *config) { rlm_sql_db2_sock *sock; sock = sqlsocket->conn; SQLFreeHandle(SQL_HANDLE_STMT, sock->stmt); return 0; } /************************************************************************* * * Function: sql_error * * Purpose: database specific error. Returns error associated with * connection * *************************************************************************/ static char *sql_error(SQLSOCK * sqlsocket, SQL_CONFIG *config) { /* this should really be enough, if not, you still got the sqlstate */ #define MSGLEN 512 char sqlstate[6]; char msg[MSGLEN]; char *retval; SQLINTEGER err; SQLSMALLINT rl; rlm_sql_db2_sock *sock; sock = sqlsocket->conn; SQLGetDiagRec(SQL_HANDLE_STMT, sock->stmt, 1, sqlstate, &err, msg, MSGLEN, &rl); retval = (char*)rad_malloc(strlen(msg)+20); sprintf(retval, "SQLSTATE %s: %s", sqlstate, msg); return retval; } /************************************************************************* * * Function: sql_close * * Purpose: database specific close. Closes an open database * connection * *************************************************************************/ static int sql_close(SQLSOCK * sqlsocket, SQL_CONFIG *config) { rlm_sql_db2_sock *sock; sock = sqlsocket->conn; SQLFreeHandle(SQL_HANDLE_DBC, sock->hdbc); SQLFreeHandle(SQL_HANDLE_ENV, sock->henv); return 0; } /************************************************************************* * * Function: sql_finish_query * * Purpose: End the query, such as freeing memory * *************************************************************************/ static int sql_finish_query(SQLSOCK * sqlsocket, SQL_CONFIG *config) { return 0; } /************************************************************************* * * Function: sql_finish_select_query * * Purpose: End the select query, such as freeing memory or result * *************************************************************************/ static int sql_finish_select_query(SQLSOCK * sqlsocket, SQL_CONFIG *config) { return sql_finish_query(sqlsocket, config); } /************************************************************************* * * Function: sql_affected_rows * * Purpose: Return the number of rows affected by the last query. * *************************************************************************/ static int sql_affected_rows(SQLSOCK * sqlsocket, SQL_CONFIG *config) { SQLINTEGER c; rlm_sql_db2_sock *sock; sock = sqlsocket->conn; SQLRowCount(sock->stmt, &c); return c; } static int not_implemented(SQLSOCK * sqlsocket, SQL_CONFIG *config) { radlog(L_ERR, "sql_db2: calling unimplemented function"); exit(1); } /* Exported to rlm_sql */ rlm_sql_module_t rlm_sql_db2 = { "rlm_sql_db2", sql_init_socket, sql_destroy_socket, /* sql_destroy_socket*/ sql_query, sql_select_query, not_implemented, /* sql_store_result */ sql_num_fields, not_implemented, /* sql_num_rows */ sql_fetch_row, sql_free_result, sql_error, sql_close, sql_finish_query, sql_finish_select_query, sql_affected_rows, }; freeradius-server/src/modules/rlm_sql/drivers/rlm_sql_firebird/000077500000000000000000000000001257552170400254305ustar00rootroot00000000000000freeradius-server/src/modules/rlm_sql/drivers/rlm_sql_firebird/Makefile.in000066400000000000000000000005071257552170400274770ustar00rootroot00000000000000# # $Id$ # include ../../../../../Make.inc TARGET = @targetname@ SRCS = sql_firebird.c sql_fbapi.c HEADERS = sql_fbapi.h RLM_SQL_CFLAGS = @sql_firebird_cflags@ RLM_SQL_LIBS = @sql_firebird_ldflags@ # this uses the RLM_SQL_CFLAGS and RLM_SQL_LIBS and SRCS defs to make TARGET. include ../rules.mak $(LT_OBJS): $(HEADERS) freeradius-server/src/modules/rlm_sql/drivers/rlm_sql_firebird/configure000077500000000000000000003325011257552170400273430ustar00rootroot00000000000000#! /bin/sh # From configure.in Revision. # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.61. # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, # 2002, 2003, 2004, 2005, 2006 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=: # 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 # PATH needs CR # 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 # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false 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.) as_nl=' ' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. 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 # Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # CDPATH. $as_unset CDPATH if test "x$CONFIG_SHELL" = x; then if (eval ":") 2>/dev/null; then as_have_required=yes else as_have_required=no fi if test $as_have_required = yes && (eval ": (as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=\$LINENO as_lineno_2=\$LINENO test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } ") 2> /dev/null; then : else as_candidate_shells= as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. case $as_dir in /*) for as_base in sh bash ksh sh5; do as_candidate_shells="$as_candidate_shells $as_dir/$as_base" done;; esac done IFS=$as_save_IFS for as_shell in $as_candidate_shells $SHELL; do # Try only shells that exist, to save several forks. if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { ("$as_shell") 2> /dev/null <<\_ASEOF 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 : _ASEOF }; then CONFIG_SHELL=$as_shell as_have_required=yes if { "$as_shell" 2> /dev/null <<\_ASEOF 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 : (as_func_return () { (exit $1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = "$1" ); then : else exitcode=1 echo positional parameters were not saved. fi test $exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } _ASEOF }; then break fi fi done if test "x$CONFIG_SHELL" != x; then for as_var in BASH_ENV ENV do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done export CONFIG_SHELL exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} fi if test $as_have_required = no; then echo This script requires a shell more modern than all the echo shells that I found on your system. Please install a echo modern shell, or manually run the script under such a echo shell if you do have one. { (exit 1); exit 1; } fi fi fi (eval "as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0") || { echo No shell found that supports shell functions. echo Please tell autoconf@gnu.org about your system, echo including any error possibly output before this echo message } as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, and appends # trailing '-' during substitution so that $LINENO is not a special # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # scripts with optimization help from Paolo Bonzini. 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" || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi 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 fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi 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=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, 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= SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME= PACKAGE_TARNAME= PACKAGE_VERSION= PACKAGE_STRING= PACKAGE_BUGREPORT= ac_unique_file="sql_firebird.c" ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datarootdir datadir sysconfdir sharedstatedir localstatedir includedir oldincludedir docdir infodir htmldir dvidir pdfdir psdir libdir localedir mandir DEFS ECHO_C ECHO_N ECHO_T LIBS build_alias host_alias target_alias CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT sql_firebird_ldflags sql_firebird_cflags targetname LIBOBJS LTLIBOBJS' ac_subst_files='' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS' # Initialize some variables set by options. ac_init_help= ac_init_version=false # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *) ac_optarg=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_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` eval enable_$ac_feature=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_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` eval enable_$ac_feature=\$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_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/[-.]/_/g'` eval with_$ac_package=\$ac_optarg ;; -without-* | --without-*) ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/[-.]/_/g'` eval with_$ac_package=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 ;; -*) { echo "$as_me: error: unrecognized option: $ac_option Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && 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'` { echo "$as_me: error: missing argument to $ac_option" >&2 { (exit 1); exit 1; }; } fi # Be sure to have absolute directory names. 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 case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; } 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 echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || { echo "$as_me: error: Working directory cannot be determined" >&2 { (exit 1); exit 1; }; } test "X$ac_ls_di" = "X$ac_pwd_ls_di" || { echo "$as_me: error: pwd does not report name of working directory" >&2 { (exit 1); exit 1; }; } # 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 -- "$0" || $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$0" : 'X\(//\)[^/]' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X"$0" | 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 .." { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2 { (exit 1); exit 1; }; } pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures this package to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF _ACEOF fi if test -n "$ac_init_help"; then cat <<\_ACEOF Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-firebird-include-dir=DIR Directory where the firebird includes may be found --with-firebird-lib-dir=DIR Directory where the firebird libraries may be found --with-firebird-dir=DIR Base directory where firebird is installed 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 C/C++/Objective C preprocessor flags, e.g. -I if you have headers in a nonstandard directory Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. _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" || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`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 echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF configure generated by GNU Autoconf 2.61 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 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 cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by $as_me, which was generated by GNU Autoconf 2.61. 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=. 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=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; 2) ac_configure_args1="$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 ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac done done $as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } $as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export 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 cat <<\_ASBOX ## ---------------- ## ## Cache variables. ## ## ---------------- ## _ASBOX 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_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( *) $as_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 cat <<\_ASBOX ## ----------------- ## ## Output variables. ## ## ----------------- ## _ASBOX echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then cat <<\_ASBOX ## ------------------- ## ## File substitutions. ## ## ------------------- ## _ASBOX echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then cat <<\_ASBOX ## ----------- ## ## confdefs.h. ## ## ----------- ## _ASBOX echo cat confdefs.h echo fi test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" 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'; { (exit 1); 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 # 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 # Let the site file select an alternate cache file if it wants to. # Prefer explicitly selected file to automatically selected ones. if test -n "$CONFIG_SITE"; then set x "$CONFIG_SITE" elif test "x$prefix" != xNONE; then set x "$prefix/share/config.site" "$prefix/etc/config.site" else set x "$ac_default_prefix/share/config.site" \ "$ac_default_prefix/etc/config.site" fi shift for ac_site_file do if test -r "$ac_site_file"; then { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" 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. if test -f "$cache_file"; then { echo "$as_me:$LINENO: loading cache $cache_file" >&5 echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { echo "$as_me:$LINENO: creating cache $cache_file" >&5 echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 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 { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 echo "$as_me: former value: $ac_old_val" >&2;} { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 echo "$as_me: current value: $ac_new_val" >&2;} ac_cache_corrupted=: fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`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. *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 echo "$as_me: error: changes in the environment can compromise the build" >&2;} { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} { (exit 1); exit 1; }; } 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 fail= SMART_LIBS= SMART_CLFAGS= if test x$with_rlm_sql_firebird != xno; then firebird_include_dir= # Check whether --with-firebird-include-dir was given. if test "${with_firebird_include_dir+set}" = set; then withval=$with_firebird_include_dir; case "$withval" in no) { { echo "$as_me:$LINENO: error: Need firebird-include-dir" >&5 echo "$as_me: error: Need firebird-include-dir" >&2;} { (exit 1); exit 1; }; } ;; yes) ;; *) firebird_include_dir="$withval" ;; esac fi firebird_lib_dir= # Check whether --with-firebird-lib-dir was given. if test "${with_firebird_lib_dir+set}" = set; then withval=$with_firebird_lib_dir; case "$withval" in no) { { echo "$as_me:$LINENO: error: Need firebird-lib-dir" >&5 echo "$as_me: error: Need firebird-lib-dir" >&2;} { (exit 1); exit 1; }; } ;; yes) ;; *) firebird_lib_dir="$withval" ;; esac fi # Check whether --with-firebird-dir was given. if test "${with_firebird_dir+set}" = set; then withval=$with_firebird_dir; case "$withval" in no) { { echo "$as_me:$LINENO: error: Need firebird-dir" >&5 echo "$as_me: error: Need firebird-dir" >&2;} { (exit 1); exit 1; }; } ;; yes) ;; *) firebird_lib_dir="$withval/lib" firebird_include_dir="$withval/include" ;; esac fi smart_try_dir="$firebird_lib_dir /usr/lib/firebird2/lib /usr/local/firebird/lib" 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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}gcc" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="gcc" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}cc" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="$ac_prog" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&5 echo "$as_me: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } # Provide some information about the compiler. echo "$as_me:$LINENO: checking for C compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (ac_try="$ac_compiler --version >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -v >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -V >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out 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. { echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6; } ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # # List of possible output files, starting from the most likely. # The algorithm is not robust to junk in `.', hence go to wildcards (a.*) # only as a last resort. b.out is created by i960 compilers. ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out' # # The IRIX 6 linker writes into existing files which may not be # executable, retaining their permissions. Remove them first so a # subsequent execution test works. ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link_default") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; 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 | *.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 { echo "$as_me:$LINENO: result: $ac_file" >&5 echo "${ECHO_T}$ac_file" >&6; } if test -z "$ac_file"; then echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: C compiler cannot create executables See \`config.log' for more details." >&5 echo "$as_me: error: C compiler cannot create executables See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } fi ac_exeext=$ac_cv_exeext # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { echo "$as_me:$LINENO: checking whether the C compiler works" >&5 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6; } # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then if { ac_try='./$ac_file' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { echo "$as_me:$LINENO: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&5 echo "$as_me: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi fi fi { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } rm -f a.out a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; } { echo "$as_me:$LINENO: result: $cross_compiling" >&5 echo "${ECHO_T}$cross_compiling" >&6; } { echo "$as_me:$LINENO: checking for suffix of executables" >&5 echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; } if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; 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 | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest$ac_cv_exeext { echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 echo "${ECHO_T}$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT { echo "$as_me:$LINENO: checking for suffix of object files" >&5 echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; } if test "${ac_cv_objext+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; 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 ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 echo "${ECHO_T}$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; } if test "${ac_cv_c_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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 { echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; } GCC=`test $ac_compiler_gnu = yes && echo yes` ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CFLAGS="" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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 { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 echo "${ECHO_T}$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 { echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_c89+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_c89=$ac_arg else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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) { echo "$as_me:$LINENO: result: none needed" >&5 echo "${ECHO_T}none needed" >&6; } ;; xno) { echo "$as_me:$LINENO: result: unsupported" >&5 echo "${ECHO_T}unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;; 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 sm_lib_safe=`echo "fbclient" | sed 'y%./+-%__p_%'` sm_func_safe=`echo "isc_attach_database" | sed 'y%./+-%__p_%'` { echo "$as_me:$LINENO: checking for isc_attach_database in -lfbclient" >&5 echo $ECHO_N "checking for isc_attach_database in -lfbclient... $ECHO_C" >&6; } old_LIBS="$LIBS" smart_lib= smart_lib_dir= if test "x$smart_try_dir" != "x"; then for try in $smart_try_dir; do LIBS="-L$try -lfbclient $old_LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ extern char isc_attach_database(); int main () { isc_attach_database() ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then smart_lib="-L$try -lfbclient" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test "x$smart_lib" != "x"; then break; fi done LIBS="$old_LIBS" fi if test "x$smart_lib" = "x"; then LIBS="-lfbclient $old_LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ extern char isc_attach_database(); int main () { isc_attach_database() ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then smart_lib="-lfbclient" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS="$old_LIBS" fi if test "x$smart_lib" = "x"; then if test "x$LOCATE" != "x"; then DIRS= file=libfbclient${libltdl_cv_shlibext} for x in `${LOCATE} $file 2>/dev/null`; do base=`echo $x | sed "s%/${file}%%"` if test "x$x" = "x$base"; then continue; fi dir=`${DIRNAME} $x 2>/dev/null` exclude=`echo ${dir} | ${GREP} /home` if test "x$exclude" != "x"; then continue fi already=`echo \$smart_lib_dir ${DIRS} | ${GREP} ${dir}` if test "x$already" = "x"; then DIRS="$DIRS $dir" fi done fi eval "smart_lib_dir=\"\$smart_lib_dir $DIRS\"" if test "x$LOCATE" != "x"; then DIRS= file=libfbclient.a for x in `${LOCATE} $file 2>/dev/null`; do base=`echo $x | sed "s%/${file}%%"` if test "x$x" = "x$base"; then continue; fi dir=`${DIRNAME} $x 2>/dev/null` exclude=`echo ${dir} | ${GREP} /home` if test "x$exclude" != "x"; then continue fi already=`echo \$smart_lib_dir ${DIRS} | ${GREP} ${dir}` if test "x$already" = "x"; then DIRS="$DIRS $dir" fi done fi eval "smart_lib_dir=\"\$smart_lib_dir $DIRS\"" for try in $smart_lib_dir /usr/local/lib /opt/lib; do LIBS="-L$try -lfbclient $old_LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ extern char isc_attach_database(); int main () { isc_attach_database() ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then smart_lib="-L$try -lfbclient" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test "x$smart_lib" != "x"; then break; fi done LIBS="$old_LIBS" fi if test "x$smart_lib" != "x"; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } eval "ac_cv_lib_${sm_lib_safe}_${sm_func_safe}=yes" LIBS="$smart_lib $old_LIBS" SMART_LIBS="$smart_lib $SMART_LIBS" else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_cv_lib_fbclient_isc_attach_database" != xyes; then fail="$fail libfbclient" fi smart_try_dir="$firebird_include_dir /usr/lib/firebird2/include /usr/local/firebird/include" ac_safe=`echo "ibase.h" | sed 'y%./+-%__pm%'` { echo "$as_me:$LINENO: checking for ibase.h" >&5 echo $ECHO_N "checking for ibase.h... $ECHO_C" >&6; } old_CFLAGS="$CFLAGS" smart_include= smart_include_dir= if test "x$smart_try_dir" != "x"; then for try in $smart_try_dir; do CFLAGS="$old_CFLAGS -I$try" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { int a = 1; ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then smart_include="-I$try" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 smart_include= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test "x$smart_include" != "x"; then break; fi done CFLAGS="$old_CFLAGS" fi if test "x$smart_include" = "x"; then cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { int a = 1; ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then smart_include=" " else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 smart_include= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test "x$smart_include" = "x"; then if test "x$LOCATE" != "x"; then DIRS= file=ibase.h for x in `${LOCATE} $file 2>/dev/null`; do base=`echo $x | sed "s%/${file}%%"` if test "x$x" = "x$base"; then continue; fi dir=`${DIRNAME} $x 2>/dev/null` exclude=`echo ${dir} | ${GREP} /home` if test "x$exclude" != "x"; then continue fi already=`echo \$smart_include_dir ${DIRS} | ${GREP} ${dir}` if test "x$already" = "x"; then DIRS="$DIRS $dir" fi done fi eval "smart_include_dir=\"\$smart_include_dir $DIRS\"" for try in $smart_include_dir /usr/local/include /opt/include; do CFLAGS="$old_CFLAGS -I$try" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { int a = 1; ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then smart_include="-I$try" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 smart_include= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test "x$smart_include" != "x"; then break; fi done CFLAGS="$old_CFLAGS" fi if test "x$smart_include" != "x"; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } eval "ac_cv_header_$ac_safe=yes" CFLAGS="$old_CFLAGS $smart_include" SMART_CFLAGS="$SMART_CFLAGS $smart_include" else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_cv_header_ibase_h" != xyes; then fail="$fail ibase.h" fi targetname=rlm_sql_firebird else targetname= echo \*\*\* module rlm_sql_firebird is disabled. fi if test "x$fail" != x; then if test "x${enable_strict_dependencies}" = xyes; then { { echo "$as_me:$LINENO: error: set --without-rlm_sql_firebird to disable it explicitly." >&5 echo "$as_me: error: set --without-rlm_sql_firebird to disable it explicitly." >&2;} { (exit 1); exit 1; }; } else { echo "$as_me:$LINENO: WARNING: silently not building rlm_sql_firebird." >&5 echo "$as_me: WARNING: silently not building rlm_sql_firebird." >&2;} { echo "$as_me:$LINENO: WARNING: FAILURE: rlm_sql_firebird requires:$fail." >&5 echo "$as_me: WARNING: FAILURE: rlm_sql_firebird requires:$fail." >&2;}; targetname= fi fi sql_firebird_ldflags="$SMART_LIBS" sql_firebird_cflags="$SMART_CFLAGS" unset ac_cv_env_LIBS_set unset ac_cv_env_LIBS_value ac_config_files="$ac_config_files 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_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( *) $as_unset $ac_var ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then test "x$cache_file" != "x/dev/null" && { echo "$as_me:$LINENO: updating cache $cache_file" >&5 echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 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}' # Transform confdefs.h into DEFS. # Protect against shell expansion while executing Makefile rules. # Protect against Makefile macro expansion. # # If the first sed substitution is executed (which looks for macros that # take arguments), then branch to the quote section. Otherwise, # look for a macro that doesn't take arguments. ac_script=' t clear :clear s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g t quote s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g t quote b any :quote s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g s/\[/\\&/g s/\]/\\&/g s/\$/$$/g H :any ${ g s/^\n// s/\n/ /g p } ' DEFS=`sed -n "$ac_script" confdefs.h` ac_libobjs= ac_ltlibobjs= 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=`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. ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs : ${CONFIG_STATUS=./config.status} ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >$CONFIG_STATUS <<_ACEOF #! $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} _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ## --------------------- ## ## 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=: # 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 # PATH needs CR # 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 # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false 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.) as_nl=' ' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. 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 # Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # CDPATH. $as_unset CDPATH as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, and appends # trailing '-' during substitution so that $LINENO is not a special # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # scripts with optimization help from Paolo Bonzini. 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" || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi 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 fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi 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=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 # Save the log message, to keep $[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by $as_me, which was generated by GNU Autoconf 2.61. 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 cat >>$CONFIG_STATUS <<_ACEOF # Files that config.status was made for. config_files="$ac_config_files" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit -q, --quiet 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 Configuration files: $config_files Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ config.status configured by $0, generated by GNU Autoconf 2.61, with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" Copyright (C) 2006 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' _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # If no file are specified by the user, then we need to provide default # value. By we need to know if files were specified by the user. 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=$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 ) echo "$ac_cs_version"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift CONFIG_FILES="$CONFIG_FILES $ac_optarg" ac_need_defaults=false;; --he | --h | --help | --hel | -h ) 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. -*) { echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *) ac_config_targets="$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 if \$ac_cs_recheck; then echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 CONFIG_SHELL=$SHELL export CONFIG_SHELL exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; 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 fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= trap 'exit_status=$? { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status ' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || { echo "$me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } # # Set up the sed scripts for CONFIG_FILES section. # # No need to generate the scripts if there are no CONFIG_FILES. # This happens for instance when ./config.status config.h if test -n "$CONFIG_FILES"; then _ACEOF ac_delim='%!_!# ' for ac_last_try in false false false false false :; do cat >conf$$subs.sed <<_ACEOF SHELL!$SHELL$ac_delim PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim PACKAGE_NAME!$PACKAGE_NAME$ac_delim PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim PACKAGE_STRING!$PACKAGE_STRING$ac_delim PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim exec_prefix!$exec_prefix$ac_delim prefix!$prefix$ac_delim program_transform_name!$program_transform_name$ac_delim bindir!$bindir$ac_delim sbindir!$sbindir$ac_delim libexecdir!$libexecdir$ac_delim datarootdir!$datarootdir$ac_delim datadir!$datadir$ac_delim sysconfdir!$sysconfdir$ac_delim sharedstatedir!$sharedstatedir$ac_delim localstatedir!$localstatedir$ac_delim includedir!$includedir$ac_delim oldincludedir!$oldincludedir$ac_delim docdir!$docdir$ac_delim infodir!$infodir$ac_delim htmldir!$htmldir$ac_delim dvidir!$dvidir$ac_delim pdfdir!$pdfdir$ac_delim psdir!$psdir$ac_delim libdir!$libdir$ac_delim localedir!$localedir$ac_delim mandir!$mandir$ac_delim DEFS!$DEFS$ac_delim ECHO_C!$ECHO_C$ac_delim ECHO_N!$ECHO_N$ac_delim ECHO_T!$ECHO_T$ac_delim LIBS!$LIBS$ac_delim build_alias!$build_alias$ac_delim host_alias!$host_alias$ac_delim target_alias!$target_alias$ac_delim CC!$CC$ac_delim CFLAGS!$CFLAGS$ac_delim LDFLAGS!$LDFLAGS$ac_delim CPPFLAGS!$CPPFLAGS$ac_delim ac_ct_CC!$ac_ct_CC$ac_delim EXEEXT!$EXEEXT$ac_delim OBJEXT!$OBJEXT$ac_delim sql_firebird_ldflags!$sql_firebird_ldflags$ac_delim sql_firebird_cflags!$sql_firebird_cflags$ac_delim targetname!$targetname$ac_delim LIBOBJS!$LIBOBJS$ac_delim LTLIBOBJS!$LTLIBOBJS$ac_delim _ACEOF if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 49; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` if test -n "$ac_eof"; then ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` ac_eof=`expr $ac_eof + 1` fi cat >>$CONFIG_STATUS <<_ACEOF cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof /@[a-zA-Z_][a-zA-Z_0-9]*@/!b end _ACEOF sed ' s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g s/^/s,@/; s/!/@,|#_!!_#|/ :n t n s/'"$ac_delim"'$/,g/; t s/$/\\/; p N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n ' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF :end s/|#_!!_#|//g CEOF$ac_eof _ACEOF # VPATH may cause trouble with some makes, so we remove $(srcdir), # ${srcdir} and @srcdir@ 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[ ]*=/{ s/:*\$(srcdir):*/:/ s/:*\${srcdir}:*/:/ s/:*@srcdir@:*/:/ s/^\([^=]*=[ ]*\):*/\1/ s/:*$// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF fi # test -n "$CONFIG_FILES" for ac_tag in :F $CONFIG_FILES do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5 echo "$as_me: error: Invalid tag $ac_tag." >&2;} { (exit 1); exit 1; }; };; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 echo "$as_me: error: cannot find input file: $ac_f" >&2;} { (exit 1); exit 1; }; };; esac ac_file_inputs="$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 "`IFS=: echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure." if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { echo "$as_me:$LINENO: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} fi case $ac_tag in *:-:* | *:-) cat >"$tmp/stdin";; 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 || 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" case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`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 || 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" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 echo "$as_me: error: cannot create directory $as_dir" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`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 # _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # 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= case `sed -n '/datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p ' $ac_file_inputs` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF 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 sed "$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s&@configure_input@&$configure_input&;t t s&@top_builddir@&$ac_top_builddir_sub&;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 $ac_datarootdir_hack " $ac_file_inputs | sed -f "$tmp/subs-1.sed" >$tmp/out test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&5 echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&2;} rm -f "$tmp/stdin" case $ac_file in -) cat "$tmp/out"; rm -f "$tmp/out";; *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;; esac ;; esac done # for ac_tag { (exit 0); exit 0; } _ACEOF chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save # 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 || { (exit 1); exit 1; } fi freeradius-server/src/modules/rlm_sql/drivers/rlm_sql_firebird/configure.in000066400000000000000000000044411257552170400277440ustar00rootroot00000000000000AC_PREREQ([2.59]) AC_INIT(sql_firebird.c) AC_REVISION($Revision$) AC_DEFUN(modname,[rlm_sql_firebird]) fail= SMART_LIBS= SMART_CLFAGS= if test x$with_[]modname != xno; then dnl extra argument: --with-firebird-include-dir firebird_include_dir= AC_ARG_WITH(firebird-include-dir, [AS_HELP_STRING([--with-firebird-include-dir=DIR], [Directory where the firebird includes may be found])], [case "$withval" in no) AC_MSG_ERROR(Need firebird-include-dir) ;; yes) ;; *) firebird_include_dir="$withval" ;; esac]) dnl extra argument: --with-firebird-lib-dir firebird_lib_dir= AC_ARG_WITH(firebird-lib-dir, [AS_HELP_STRING([--with-firebird-lib-dir=DIR], [Directory where the firebird libraries may be found])], [case "$withval" in no) AC_MSG_ERROR(Need firebird-lib-dir) ;; yes) ;; *) firebird_lib_dir="$withval" ;; esac]) dnl extra argument: --with-firebird-dir AC_ARG_WITH(firebird-dir, [AS_HELP_STRING([--with-firebird-dir=DIR], [Base directory where firebird is installed])], [case "$withval" in no) AC_MSG_ERROR(Need firebird-dir) ;; yes) ;; *) firebird_lib_dir="$withval/lib" firebird_include_dir="$withval/include" ;; esac]) dnl Check for isc_attach_database in -lfbclient smart_try_dir="$firebird_lib_dir /usr/lib/firebird2/lib /usr/local/firebird/lib" FR_SMART_CHECK_LIB(fbclient, isc_attach_database) if test "x$ac_cv_lib_fbclient_isc_attach_database" != xyes; then fail="$fail libfbclient" fi dnl Check for ibase.h smart_try_dir="$firebird_include_dir /usr/lib/firebird2/include /usr/local/firebird/include" FR_SMART_CHECK_INCLUDE(ibase.h) if test "x$ac_cv_header_ibase_h" != xyes; then fail="$fail ibase.h" fi targetname=modname else targetname= echo \*\*\* module modname is disabled. fi dnl Don't change this section. if test "x$fail" != x; then if test "x${enable_strict_dependencies}" = xyes; then AC_MSG_ERROR([set --without-]modname[ to disable it explicitly.]) else AC_MSG_WARN([silently not building ]modname[.]) AC_MSG_WARN([FAILURE: ]modname[ requires:$fail.]); targetname= fi fi sql_firebird_ldflags="$SMART_LIBS" sql_firebird_cflags="$SMART_CFLAGS" AC_SUBST(sql_firebird_ldflags) AC_SUBST(sql_firebird_cflags) AC_SUBST(targetname) AC_OUTPUT(Makefile) freeradius-server/src/modules/rlm_sql/drivers/rlm_sql_firebird/sql_fbapi.c000066400000000000000000000331271257552170400275420ustar00rootroot00000000000000/* * sql_fbapi.c Part of Firebird rlm_sql driver * * 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 * * Copyright 2006 The FreeRADIUS server project * Copyright 2006 Vitaly Bodzhgua */ #include RCSID("$Id$") #include "sql_fbapi.h" #include int fb_lasterror(rlm_sql_firebird_sock *sock) { char msg[512+2]; int l; ISC_LONG *pstatus; char *p=0; sock->sql_code=0; if (IS_ISC_ERROR(sock->status)) { //if error occured, free the previous error's text and create a new one pstatus=sock->status; if (sock->lasterror) free(sock->lasterror); sock->lasterror=0; sock->sql_code=isc_sqlcode(sock->status); isc_interprete(msg,&pstatus); p=strdup(msg); msg[0]='.';msg[1]=' '; while (isc_interprete(msg+2,&pstatus)) { l=strlen(p); p=(char *) realloc(p,l+strlen(msg)+2); strcat(p,msg); } sock->lasterror=p; } else { //return empty (but not null) string if there are no error if (sock->lasterror) *sock->lasterror=0; else sock->lasterror=strdup(""); } return sock->sql_code; } void fb_set_tpb(rlm_sql_firebird_sock * sock, int count,...) { int i; va_list arg; va_start(arg,count); sock->tpb=(char *) malloc(count); for (i=0; itpb[i]=(char ) va_arg(arg,int); } sock->tpb_len=count; } void fb_dpb_add_str(char **dpb, char name, char *value) { int l; if (!value) return; l=strlen(value); *(*dpb)++ = name; *(*dpb)++ = (char ) l; memmove(*dpb,value,l); *dpb+=l; } void fb_free_sqlda(XSQLDA *sqlda) { int i; for (i=0; isqld; i++) { free(sqlda->sqlvar[i].sqldata); free(sqlda->sqlvar[i].sqlind); } sqlda->sqld=0; } void fb_set_sqlda(XSQLDA *sqlda) { int i; for (i=0; isqld; i++) { if ((sqlda->sqlvar[i].sqltype & ~1)==SQL_VARYING) sqlda->sqlvar[i].sqldata = (char*)malloc(sqlda->sqlvar[i].sqllen + sizeof(short)); else sqlda->sqlvar[i].sqldata = (char*)malloc(sqlda->sqlvar[i].sqllen); if (sqlda->sqlvar[i].sqltype & 1) sqlda->sqlvar[i].sqlind = (short*)calloc(sizeof(short),1); else sqlda->sqlvar[i].sqlind = 0; } } //Macro for NULLs check #define IS_NULL(x) (x->sqltype & 1) && (*x->sqlind < 0) //Structure to manage a SQL_VARYING Firebird's data types typedef struct vary_fb { short vary_length; char vary_string[1]; } VARY; //function fb_store_row based on fiebird's apifull example void fb_store_row(rlm_sql_firebird_sock *sock) { int dtype; struct tm times; ISC_QUAD bid; int i; XSQLVAR *var; VARY * vary; //assumed: id,username,attribute,value,op if (sock->row_fcountsqlda_out->sqld) { i=sock->row_fcount; sock->row_fcount=sock->sqlda_out->sqld; sock->row=(char **) realloc(sock->row,sock->row_fcount*sizeof(char *)); sock->row_sizes=(int *) realloc(sock->row_sizes,sock->row_fcount*sizeof(int)); while(irow_fcount) { sock->row[i]=0; sock->row_sizes[i++]=0; } } for (i=0, var=sock->sqlda_out->sqlvar; isqlda_out->sqld; var++,i++) { //Initial buffer size to store field's data is 256 bytes if (sock->row_sizes[i]<256) { sock->row[i]=(char *) realloc(sock->row[i],256); sock->row_sizes[i]=256; } if (IS_NULL(var)) { strcpy(sock->row[i],"NULL"); continue; } dtype=var->sqltype & ~1; switch (dtype) { case SQL_TEXT: if (sock->row_sizes[i]<=var->sqllen) { sock->row_sizes[i]=var->sqllen+1; sock->row[i]=(char *) realloc(sock->row[i],sock->row_sizes[i]); } memmove(sock->row[i],var->sqldata,var->sqllen); sock->row[i][var->sqllen]=0; break; case SQL_VARYING: vary = (VARY*) var->sqldata; if (sock->row_sizes[i]<=vary->vary_length) { sock->row_sizes[i]=vary->vary_length+1; sock->row[i]=(char *) realloc(sock->row[i],sock->row_sizes[i]); } memmove(sock->row[i],vary->vary_string,vary->vary_length); sock->row[i][vary->vary_length] =0; break; case SQL_FLOAT: snprintf(sock->row[i],sock->row_sizes[i], "%15g", *(float ISC_FAR *) (var->sqldata)); break; case SQL_SHORT: case SQL_LONG: case SQL_INT64: { ISC_INT64 value = 0; short field_width = 0; short dscale = 0; char *p; p=sock->row[i]; switch (dtype) { case SQL_SHORT: value = (ISC_INT64) *(short *) var->sqldata; field_width = 6; break; case SQL_LONG: value = (ISC_INT64) *(int *) var->sqldata; field_width = 11; break; case SQL_INT64: value = (ISC_INT64) *(ISC_INT64 *) var->sqldata; field_width = 21; break; } dscale = var->sqlscale; if (dscale < 0) { ISC_INT64 tens; short j; tens = 1; for (j = 0; j > dscale; j--) tens *= 10; if (value >= 0) sprintf (p, "%*lld.%0*lld", field_width - 1 + dscale, (ISC_INT64) value / tens, -dscale, (ISC_INT64) value % tens); else if ((value / tens) != 0) sprintf (p, "%*lld.%0*lld", field_width - 1 + dscale, (ISC_INT64) (value / tens), -dscale, (ISC_INT64) -(value % tens)); else sprintf (p, "%*s.%0*lld", field_width - 1 + dscale, "-0", -dscale, (ISC_INT64) -(value % tens)); } else if (dscale) sprintf (p, "%*lld%0*d", field_width, (ISC_INT64) value, dscale, 0); else sprintf (p, "%*lld", field_width, (ISC_INT64) value); } break; case SQL_DOUBLE: case SQL_D_FLOAT: snprintf(sock->row[i],sock->row_sizes[i], "%24f", *(double ISC_FAR *) (var->sqldata)); break; case SQL_TIMESTAMP: isc_decode_timestamp((ISC_TIMESTAMP ISC_FAR *)var->sqldata, ×); snprintf(sock->row[i],sock->row_sizes[i],"%04d-%02d-%02d %02d:%02d:%02d.%04d", times.tm_year + 1900, times.tm_mon+1, times.tm_mday, times.tm_hour, times.tm_min, times.tm_sec, ((ISC_TIMESTAMP *)var->sqldata)->timestamp_time % 10000); break; case SQL_TYPE_DATE: isc_decode_sql_date((ISC_DATE ISC_FAR *)var->sqldata, ×); snprintf(sock->row[i],sock->row_sizes[i], "%04d-%02d-%02d", times.tm_year + 1900, times.tm_mon+1, times.tm_mday); break; case SQL_TYPE_TIME: isc_decode_sql_time((ISC_TIME ISC_FAR *)var->sqldata, ×); snprintf(sock->row[i],sock->row_sizes[i], "%02d:%02d:%02d.%04d", times.tm_hour, times.tm_min, times.tm_sec, (*((ISC_TIME *)var->sqldata)) % 10000); break; case SQL_BLOB: case SQL_ARRAY: /* Print the blob id on blobs or arrays */ bid = *(ISC_QUAD ISC_FAR *) var->sqldata; snprintf(sock->row[i],sock->row_sizes[i],"%08lx:%08lx", bid.gds_quad_high, bid.gds_quad_low); break; } //END SWITCH } //END FOR } //================= int fb_init_socket(rlm_sql_firebird_sock *sock) { memset(sock, 0, sizeof(*sock)); sock->sqlda_out = (XSQLDA ISC_FAR *) calloc(XSQLDA_LENGTH (5),1); sock->sqlda_out->sqln = 5; sock->sqlda_out->version = SQLDA_VERSION1; sock->sql_dialect=3; #ifdef _PTHREAD_H pthread_mutex_init (&sock->mut, NULL); radlog(L_DBG,"Init mutex %p\n",&sock->mut); #endif //set tpb to read_committed/wait/no_rec_version fb_set_tpb(sock,5, isc_tpb_version3, isc_tpb_wait, isc_tpb_write, isc_tpb_read_committed, isc_tpb_no_rec_version); if (!sock->tpb) return -1; return 0; } int fb_connect(rlm_sql_firebird_sock * sock,SQL_CONFIG *config) { char *p; char * database; sock->dpb_len=4; if (config->sql_login) sock->dpb_len+=strlen(config->sql_login)+2; if (config->sql_password) sock->dpb_len+=strlen(config->sql_password)+2; sock->dpb=(char *) malloc(sock->dpb_len); p=sock->dpb; *sock->dpb++ = isc_dpb_version1; *sock->dpb++ = isc_dpb_num_buffers; *sock->dpb++ = 1; *sock->dpb++ = 90; fb_dpb_add_str(&sock->dpb,isc_dpb_user_name,config->sql_login); fb_dpb_add_str(&sock->dpb,isc_dpb_password,config->sql_password); sock->dpb=p; // Check if database and server in the form of server:database. // If config->sql_server contains ':', then config->sql_db // parameter ignored if (strchr(config->sql_server,':')) database=strdup(config->sql_server); else { // Make database and server to be in the form of server:database int ls=strlen(config->sql_server); int ld=strlen(config->sql_db); database=(char *) calloc(ls+ld+2,1); strcpy(database,config->sql_server); database[ls]=':'; memmove(database+ls+1,config->sql_db,ld); } isc_attach_database(sock->status, 0, database, &sock->dbh, sock->dpb_len, sock->dpb); free(database); return fb_lasterror(sock); } int fb_fetch(rlm_sql_firebird_sock *sock) { long fetch_stat; if (sock->statement_type!=isc_info_sql_stmt_select) return 100; fetch_stat=isc_dsql_fetch(sock->status, &sock->stmt, SQL_DIALECT_V6, sock->sqlda_out); if (fetch_stat) { if (fetch_stat!=100L) fb_lasterror(sock); else sock->sql_code=0; } return fetch_stat; } int fb_prepare(rlm_sql_firebird_sock *sock,char *sqlstr) { static char stmt_info[] = { isc_info_sql_stmt_type }; char info_buffer[128]; short l; if (!sock->trh) { isc_start_transaction(sock->status,&sock->trh,1,&sock->dbh,sock->tpb_len,sock->tpb); if (!sock->trh) return -4; } fb_free_statement(sock); if (!sock->stmt) { isc_dsql_allocate_statement(sock->status, &sock->dbh, &sock->stmt); if (!sock->stmt) return -1; } fb_free_sqlda(sock->sqlda_out); isc_dsql_prepare(sock->status, &sock->trh, &sock->stmt, 0, sqlstr, sock->sql_dialect, sock->sqlda_out); if (IS_ISC_ERROR(sock->status)) return -2; if (sock->sqlda_out->sqlnsqlda_out->sqld) { sock->sqlda_out->sqln=sock->sqlda_out->sqld; sock->sqlda_out = (XSQLDA ISC_FAR *) realloc(sock->sqlda_out, XSQLDA_LENGTH (sock->sqlda_out->sqld)); isc_dsql_describe(sock->status,&sock->stmt,SQL_DIALECT_V6,sock->sqlda_out); if (IS_ISC_ERROR(sock->status)) return -3; } //get statement type isc_dsql_sql_info(sock->status, &sock->stmt, sizeof (stmt_info), stmt_info,sizeof (info_buffer), info_buffer); if (IS_ISC_ERROR(sock->status)) return -4; l = (short) isc_vax_integer((char ISC_FAR *) info_buffer + 1, 2); sock->statement_type = isc_vax_integer((char ISC_FAR *) info_buffer + 3, l); if (sock->sqlda_out->sqld) fb_set_sqlda(sock->sqlda_out); //set out sqlda return 0; } int fb_sql_query(rlm_sql_firebird_sock *sock,char *sqlstr) { if (fb_prepare(sock,sqlstr)) return fb_lasterror(sock); switch (sock->statement_type) { case isc_info_sql_stmt_exec_procedure: isc_dsql_execute2(sock->status, &sock->trh, &sock->stmt, SQL_DIALECT_V6,0,sock->sqlda_out); break; default: isc_dsql_execute(sock->status, &sock->trh, &sock->stmt, SQL_DIALECT_V6,0); break; } return fb_lasterror(sock); } int fb_affected_rows(rlm_sql_firebird_sock *sock) { static char count_info[] = {isc_info_sql_records}; char info_buffer[128]; char *p ; int affected_rows=-1; if (!sock->stmt) return -1; isc_dsql_sql_info(sock->status, &sock->stmt, sizeof (count_info), count_info,sizeof (info_buffer), info_buffer); if (IS_ISC_ERROR(sock->status)) return fb_lasterror(sock); p=info_buffer+3; while (*p != isc_info_end) { p++; short len = (short)isc_vax_integer(p,2); p+=2; affected_rows = isc_vax_integer(p,len); if (affected_rows>0) break; p += len; } return affected_rows; } int fb_close_cursor(rlm_sql_firebird_sock *sock) { isc_dsql_free_statement(sock->status, &sock->stmt, DSQL_close); return fb_lasterror(sock); } void fb_free_statement(rlm_sql_firebird_sock *sock) { if (sock->stmt) { isc_dsql_free_statement(sock->status, &sock->stmt, DSQL_drop); sock->stmt=0; } } int fb_rollback(rlm_sql_firebird_sock *sock) { sock->sql_code=0; if (sock->trh) { isc_rollback_transaction (sock->status,&sock->trh); // sock->in_use=0; #ifdef _PTHREAD_H pthread_mutex_unlock(&sock->mut); #endif if (IS_ISC_ERROR(sock->status)) { return fb_lasterror(sock); } } return sock->sql_code; } int fb_commit(rlm_sql_firebird_sock *sock) { sock->sql_code=0; if (sock->trh) { isc_commit_transaction (sock->status,&sock->trh); if (IS_ISC_ERROR(sock->status)) { fb_lasterror(sock); radlog(L_ERR,"Fail to commit. Error: %s. Try to rollback.\n",sock->lasterror); return fb_rollback(sock); } } // sock->in_use=0; #ifdef _PTHREAD_H pthread_mutex_unlock(&sock->mut); #endif return sock->sql_code; } int fb_disconnect(rlm_sql_firebird_sock *sock) { if (sock->dbh) { fb_free_statement(sock); isc_detach_database(sock->status,&sock->dbh); return fb_lasterror(sock); } return 0; } void fb_destroy_socket(rlm_sql_firebird_sock *sock) { int i; fb_commit(sock); if (fb_disconnect(sock)) { radlog(L_ERR,"Fatal. Fail to disconnect DB. Error :%s\n",sock->lasterror); } #ifdef _PTHREAD_H pthread_mutex_destroy (&sock->mut); #endif for (i=0; irow_fcount;i++) free(sock->row[i]); free(sock->row);free(sock->row_sizes); fb_free_sqlda(sock->sqlda_out); free(sock->sqlda_out); free(sock->tpb); free(sock->dpb); if (sock->lasterror) free(sock->lasterror); memset(sock,0,sizeof(rlm_sql_firebird_sock)); } freeradius-server/src/modules/rlm_sql/drivers/rlm_sql_firebird/sql_fbapi.h000066400000000000000000000045461257552170400275520ustar00rootroot00000000000000/* * sql_fbapi.h Part of Firebird rlm_sql driver * * 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 * * Copyright 2006 The FreeRADIUS server project * Copyright 2006 Vitaly Bodzhgua */ #ifndef _SQL_FBAPI_H_ #define _SQL_FBAPI_H_ #include RCSIDH(sql_fbapi_h, "$Id$") #include #include #include #include #include #include "rlm_sql.h" #define IS_ISC_ERROR(status) (status[0] == 1 && status[1]) #define DEADLOCK_SQL_CODE -913 #define DOWN_SQL_CODE -902 typedef struct rlm_sql_firebird_sock { isc_db_handle dbh; isc_stmt_handle stmt; isc_tr_handle trh; ISC_STATUS status[20]; ISC_LONG sql_code; XSQLDA *sqlda_out; int sql_dialect; int statement_type; char *tpb; int tpb_len; char *dpb; int dpb_len; char *lasterror; SQL_ROW row; int *row_sizes; int row_fcount; #ifdef _PTHREAD_H pthread_mutex_t mut; #endif } rlm_sql_firebird_sock; int fb_free_result(rlm_sql_firebird_sock *sock); int fb_lasterror(rlm_sql_firebird_sock *); int fb_init_socket(rlm_sql_firebird_sock *sock); int fb_connect(rlm_sql_firebird_sock * sock,SQL_CONFIG *config); int fb_disconnect(rlm_sql_firebird_sock * sock); int fb_sql_query(rlm_sql_firebird_sock * sock,char *sqlstr); int fb_affected_rows(rlm_sql_firebird_sock * sock); int fb_fetch(rlm_sql_firebird_sock * sock); void fb_free_statement(rlm_sql_firebird_sock *sock); int fb_close_cursor(rlm_sql_firebird_sock *sock); int fb_rollback(rlm_sql_firebird_sock * sock); int fb_commit(rlm_sql_firebird_sock * sock); void fb_destroy_socket(rlm_sql_firebird_sock *); void fb_store_row(rlm_sql_firebird_sock *sock); #endif freeradius-server/src/modules/rlm_sql/drivers/rlm_sql_firebird/sql_firebird.c000066400000000000000000000236651257552170400302550ustar00rootroot00000000000000/* * sql_firebird.c Part of Firebird rlm_sql driver * * 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 * * Copyright 2006 The FreeRADIUS server project * Copyright 2006 Vitaly Bodzhgua */ #include RCSID("$Id$") #include "sql_fbapi.h" /* Forward declarations */ static const char *sql_error(SQLSOCK *sqlsocket, SQL_CONFIG *config); static int sql_free_result(SQLSOCK *sqlsocket, SQL_CONFIG *config); static int sql_affected_rows(SQLSOCK *sqlsocket, SQL_CONFIG *config); static int sql_num_fields(SQLSOCK *sqlsocket, SQL_CONFIG *config); static int sql_finish_query(SQLSOCK *sqlsocket, SQL_CONFIG *config); /************************************************************************* * * Function: sql_init_socket * * Purpose: Establish connection to the db * *************************************************************************/ static int sql_init_socket(SQLSOCK *sqlsocket, SQL_CONFIG *config) { rlm_sql_firebird_sock *firebird_sock; long res; if (!sqlsocket->conn) { sqlsocket->conn = (rlm_sql_firebird_sock *)rad_malloc(sizeof(rlm_sql_firebird_sock)); if (!sqlsocket->conn) return -1; } firebird_sock = sqlsocket->conn; res=fb_init_socket(firebird_sock); if (res) return -1; if (fb_connect(firebird_sock,config)) { radlog(L_ERR, "rlm_sql_firebird: Connection failed %s\n", firebird_sock->lasterror); return SQL_DOWN; } return 0; } /************************************************************************* * * Function: sql_destroy_socket * * Purpose: Free socket and private connection data * *************************************************************************/ static int sql_destroy_socket(SQLSOCK *sqlsocket, SQL_CONFIG *config) { free(sqlsocket->conn); sqlsocket->conn = NULL; return 0; } /************************************************************************* * * Function: sql_query * * Purpose: Issue a non-SELECT query (ie: update/delete/insert) to * the database. * *************************************************************************/ static int sql_query(SQLSOCK *sqlsocket, SQL_CONFIG *config, char *querystr) { rlm_sql_firebird_sock *firebird_sock = sqlsocket->conn; int deadlock=0; if (config->sqltrace) radlog(L_DBG, "sock_id %i: query: %s", sqlsocket->id,querystr); #ifdef _PTHREAD_H pthread_mutex_lock(&firebird_sock->mut); #endif TryAgain: if (fb_sql_query(firebird_sock,querystr)) { //Try again query when deadlock, beacuse in any case it will be retried. // but may be lost for short sessions if ((firebird_sock->sql_code==DEADLOCK_SQL_CODE) && !deadlock) { radlog(L_DBG,"sock_id %i: deadlock. Retry query %s\n",sqlsocket->id,querystr); //For non READ_COMMITED transactions put rollback here // fb_rollback(sock); deadlock=1; goto TryAgain; } radlog(L_ERR, "sock_id %i: rlm_sql_firebird,sql_query error:sql_code=%li, error='%s', query=%s\n", sqlsocket->id, firebird_sock->sql_code, firebird_sock->lasterror, querystr); if ((firebird_sock->sql_code==DOWN_SQL_CODE)) return SQL_DOWN; //free problem query if (fb_rollback(firebird_sock)) { //assume the network is down if rollback had failed radlog(L_ERR,"Fail to rollback transaction after previous error. Error: %s\n", firebird_sock->lasterror); return SQL_DOWN; } // firebird_sock->in_use=0; return -1; } if (firebird_sock->statement_type!=isc_info_sql_stmt_select) { if (fb_commit(firebird_sock)) return -1; } return 0; } /************************************************************************* * * Function: sql_select_query * * Purpose: Issue a select query to the database * *************************************************************************/ static int sql_select_query(SQLSOCK *sqlsocket, SQL_CONFIG *config, char *querystr) { // rlm_sql_firebird_sock *firebird_sock = sqlsocket->conn; return (sql_query(sqlsocket, config, querystr)); } /************************************************************************* * * Function: sql_store_result * * Purpose: database specific store_result function. Returns a result * set for the query. * *************************************************************************/ static int sql_store_result(SQLSOCK *sqlsocket, SQL_CONFIG *config) { /* Not used */ return 0; } /************************************************************************* * * Function: sql_num_fields * * Purpose: database specific num_fields function. Returns number * of columns from query * *************************************************************************/ static int sql_num_fields(SQLSOCK *sqlsocket, SQL_CONFIG *config) { return ((rlm_sql_firebird_sock *) sqlsocket->conn)->sqlda_out->sqld; } /************************************************************************* * * Function: sql_num_rows * * Purpose: database specific num_rows. Returns number of rows in * query * *************************************************************************/ static int sql_num_rows(SQLSOCK *sqlsocket, SQL_CONFIG *config) { int res=sql_affected_rows(sqlsocket, config); radlog(L_DBG,"sock_id %i: sql_num_rows: %i\n",sqlsocket->id,res); return res; } /************************************************************************* * * Function: sql_fetch_row * * Purpose: database specific fetch_row. Returns a SQL_ROW struct * with all the data for the query in 'sqlsocket->row'. Returns * 0 on success, -1 on failure, SQL_DOWN if 'database is down'. * *************************************************************************/ static int sql_fetch_row(SQLSOCK *sqlsocket, SQL_CONFIG *config) { rlm_sql_firebird_sock *firebird_sock = sqlsocket->conn; int res; sqlsocket->row = NULL; if (firebird_sock->statement_type!=isc_info_sql_stmt_exec_procedure) { res=fb_fetch(firebird_sock); if (res==100) return 0; if (res) { radlog(L_ERR, "rlm_sql_firebird. Fetch problem:'%s'\n", firebird_sock->lasterror); return -1; } } else firebird_sock->statement_type=0; fb_store_row(firebird_sock); sqlsocket->row = firebird_sock->row; return 0; } /************************************************************************* * * Function: sql_finish_select_query * * Purpose: End the select query, such as freeing memory or result * *************************************************************************/ static int sql_finish_select_query(SQLSOCK * sqlsocket, SQL_CONFIG *config) { rlm_sql_firebird_sock *sock=(rlm_sql_firebird_sock *) sqlsocket->conn; fb_commit(sock); fb_close_cursor(sock); return 0; } /************************************************************************* * * Function: sql_finish_query * * Purpose: End the query, such as freeing memory * *************************************************************************/ static int sql_finish_query(SQLSOCK *sqlsocket, SQL_CONFIG *config) { // sql_free_result(sqlsocket,config); return 0; } /************************************************************************* * * Function: sql_free_result * * Purpose: database specific free_result. Frees memory allocated * for a result set * *************************************************************************/ static int sql_free_result(SQLSOCK *sqlsocket, SQL_CONFIG *config) { return 0; } /************************************************************************* * * Function: sql_close * * Purpose: database specific close. Closes an open database * connection and cleans up any open handles. * *************************************************************************/ static int sql_close(SQLSOCK *sqlsocket, SQL_CONFIG *config) { // radlog(L_INFO,"Closing sql\n"); fb_destroy_socket((rlm_sql_firebird_sock *) sqlsocket->conn); return 0; } /************************************************************************* * * Function: sql_error * * Purpose: database specific error. Returns error associated with * connection * *************************************************************************/ static const char *sql_error(SQLSOCK *sqlsocket, SQL_CONFIG *config) { rlm_sql_firebird_sock *firebird_sock = sqlsocket->conn; return firebird_sock->lasterror; } /************************************************************************* * * Function: sql_affected_rows * * Purpose: Return the number of rows affected by the query (update, * or insert) * *************************************************************************/ static int sql_affected_rows(SQLSOCK *sqlsocket, SQL_CONFIG *config) { int affected_rows=fb_affected_rows(sqlsocket->conn); if (affected_rows<0) radlog(L_ERR, "sql_affected_rows, rlm_sql_firebird. error:%s\n", sql_error(sqlsocket,config)); radlog(L_DBG,"sock_id %i: affected_rows: %i\n",sqlsocket->id,affected_rows); return affected_rows; } /* Exported to rlm_sql */ rlm_sql_module_t rlm_sql_firebird = { "rlm_sql_firebird", sql_init_socket, sql_destroy_socket, sql_query, sql_select_query, sql_store_result, sql_num_fields, sql_num_rows, sql_fetch_row, sql_free_result, sql_error, sql_close, sql_finish_query, sql_finish_select_query, sql_affected_rows }; freeradius-server/src/modules/rlm_sql/drivers/rlm_sql_freetds/000077500000000000000000000000001257552170400252765ustar00rootroot00000000000000freeradius-server/src/modules/rlm_sql/drivers/rlm_sql_freetds/sql_freetds.c000066400000000000000000000242471257552170400277660ustar00rootroot00000000000000/* * sql_freetds.c * freeradius * * Version: $Id$ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 only, as published by * the Free Software Foundation. * * 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 version 2 * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Copyright 2009 Gabriel Blanchard gabe@teksavvy.com */ #include RCSID("$Id$") #include #include #include #include #include #include "rlm_sql.h" static int query_timeout_handler(void *dbproc); static int err_handler(UNUSED DBPROCESS *dbproc, UNUSED int severity, UNUSED int dberr, UNUSED int oserr, char *dberrstr, char *oserrstr); // As defined in tds.h #define TDS_INT_CONTINUE 1 #define TDS_INT_CANCEL 2 #define TDS_INT_TIMEOUT 3 typedef struct rlm_sql_freetds_sock { DBPROCESS *dbproc; } rlm_sql_freetds_sock; /* * FreeTDS calls this handler when dbsqlexec() or dbsqlok() blocks every seconds * This ensures that FreeTDS doesn't stay stuck on the same query for ever. */ static int query_timeout_handler(void *dbproc) { return TDS_INT_CONTINUE; } static int err_handler(UNUSED DBPROCESS *dbproc, UNUSED int severity, UNUSED int dberr, UNUSED int oserr, char *dberrstr, char *oserrstr) { radlog(L_ERR, "rlm_sql_freetds: FreeTDS error: %s\n", dberrstr); radlog(L_ERR, "rlm_sql_freetds: OS error: %s\n", oserrstr); } /************************************************************************* * * Function: sql_create_socket * * Purpose: Establish connection to the db * *************************************************************************/ static int sql_init_socket(SQLSOCK *sqlsocket, SQL_CONFIG *config) { LOGINREC *login; rlm_sql_freetds_sock *freetds_sock; if (!sqlsocket->conn) { sqlsocket->conn = (rlm_sql_freetds_sock *)rad_malloc(sizeof(struct rlm_sql_freetds_sock)); if (!sqlsocket->conn) { return -1; } } if (dbinit() == FAIL) { radlog(L_ERR, "rlm_sql_freetds: Unable to init FreeTDS"); return -1; } dbsetversion(DBVERSION_80); dberrhandle(err_handler); // Timeout so that FreeTDS doesn't wait for ever. dbsetlogintime((unsigned long)config->query_timeout); dbsettime((unsigned long)config->query_timeout); freetds_sock = sqlsocket->conn; memset(freetds_sock, 0, sizeof(*freetds_sock)); radlog(L_INFO, "rlm_sql_freetds (%s): Starting connect to FreeTDS/MSSQL server for #%d", config->xlat_name, sqlsocket->id); if (!(login = dblogin())) { radlog(L_ERR, "rlm_sql_freetds (%s): Unable to allocate login record", config->xlat_name); return -1; } DBSETLUSER(login, config->sql_login); DBSETLPWD(login, config->sql_password); if ((freetds_sock->dbproc = dbopen(login, config->sql_server)) == FAIL) { radlog(L_ERR, "rlm_sql_freetds (%s): Unable to connect to FreeTDS/MSSQL server %s@%s", config->xlat_name, config->sql_login, config->sql_server); dbloginfree(login); return -1; } dbloginfree(login); if ((dbuse(freetds_sock->dbproc, config->sql_db)) == FAIL) { radlog(L_ERR, "rlm_sql_freetds (%s): Unable to select database on FreeTDS/MSSQL server %s@%s:%s", config->xlat_name, config->sql_login, config->sql_server, config->sql_db); return -1; } /* I know this may look strange, but it sets a pointer to the freetds_sock struct so that it can be used within the query_timeout_handler function to be able to timeout properly */ dbsetinterrupt(freetds_sock->dbproc, query_timeout_handler, query_timeout_handler); dbsetuserdata(freetds_sock->dbproc, (BYTE *)freetds_sock); return 0; } /************************************************************************* * * Function: sql_destroy_socket * * Purpose: Free socket and any private connection data * *************************************************************************/ static int sql_destroy_socket(SQLSOCK *sqlsocket, UNUSED SQL_CONFIG *config) { free(sqlsocket->conn); sqlsocket->conn = NULL; return 0; } /************************************************************************* * * Function: sql_query * * Purpose: Issue a query to the database * *************************************************************************/ static int sql_query(SQLSOCK *sqlsocket, SQL_CONFIG *config, char *querystr) { rlm_sql_freetds_sock *freetds_sock = sqlsocket->conn; if (config->sqltrace) radlog(L_DBG,"rlm_sql_freetds: query: %s", querystr); if (freetds_sock->dbproc == NULL || DBDEAD(freetds_sock->dbproc)) { radlog(L_ERR, "rlm_sql_freetds (%s): Socket not connected", config->xlat_name); return SQL_DOWN; } if ((dbcmd(freetds_sock->dbproc, querystr)) == FAIL) { radlog(L_ERR, "rlm_sql_freetds (%s): Unable to allocate SQL query", config->xlat_name); return -1; } if ((dbsqlexec(freetds_sock->dbproc)) == FAIL) { radlog(L_ERR, "rlm_sql_freetds (%s): SQL query failed", config->xlat_name); return -1; } return 0; } /************************************************************************* * * Function: sql_select_query * * Purpose: Issue a select query to the database * *************************************************************************/ static int sql_select_query(SQLSOCK *sqlsocket, SQL_CONFIG *config, char *querystr) { radlog(L_ERR, "rlm_sql_freetds sql_select_query(): unsupported"); return -1; } /************************************************************************* * * Function: sql_store_result * * Purpose: database specific store_result function. Returns a result * set for the query. * *************************************************************************/ static int sql_store_result(UNUSED SQLSOCK *sqlsocket, UNUSED SQL_CONFIG *config) { radlog(L_ERR, "rlm_sql_freetds sql_store_result(): unsupported"); return -1; } /************************************************************************* * * Function: sql_num_fields * * Purpose: database specific num_fields function. Returns number * of columns from query * *************************************************************************/ static int sql_num_fields(SQLSOCK *sqlsocket, UNUSED SQL_CONFIG *config) { rlm_sql_freetds_sock *freetds_sock = sqlsocket->conn; return dbnumcols(freetds_sock->dbproc); } /************************************************************************* * * Function: sql_num_rows * * Purpose: database specific num_rows. Returns number of rows in * query * *************************************************************************/ static int sql_num_rows(UNUSED SQLSOCK *sqlsocket, UNUSED SQL_CONFIG *config) { return 0; } /************************************************************************* * * Function: sql_fetch_row * * Purpose: database specific fetch_row. Returns a SQL_ROW struct * with all the data for the query in 'sqlsocket->row'. Returns * 0 on success, -1 on failure, SQL_DOWN if database is down. * *************************************************************************/ static int sql_fetch_row(UNUSED SQLSOCK *sqlsocket, UNUSED SQL_CONFIG *config) { return 0; } /************************************************************************* * * Function: sql_free_result * * Purpose: database specific free_result. Frees memory allocated * for a result set * *************************************************************************/ static int sql_free_result(UNUSED SQLSOCK *sqlsocket, UNUSED SQL_CONFIG *config) { return 0; } /************************************************************************* * * Function: sql_error * * Purpose: database specific error. Returns error associated with * connection * *************************************************************************/ static const char *sql_error(UNUSED SQLSOCK *sqlsocket, UNUSED SQL_CONFIG *config) { return NULL; } /************************************************************************* * * Function: sql_close * * Purpose: database specific close. Closes an open database * connection * *************************************************************************/ static int sql_close(SQLSOCK *sqlsocket, UNUSED SQL_CONFIG *config) { rlm_sql_freetds_sock *freetds_sock = sqlsocket->conn; if (freetds_sock && freetds_sock->dbproc){ dbclose(freetds_sock->dbproc); freetds_sock->dbproc = NULL; } return 0; } /************************************************************************* * * Function: sql_finish_query * * Purpose: End the query, such as freeing memory * *************************************************************************/ static int sql_finish_query(UNUSED SQLSOCK *sqlsocket, UNUSED SQL_CONFIG *config) { return 0; } /************************************************************************* * * Function: sql_finish_select_query * * Purpose: End the select query, such as freeing memory or result * *************************************************************************/ static int sql_finish_select_query(SQLSOCK *sqlsocket, SQL_CONFIG *config) { return sql_finish_query(sqlsocket, config); } /************************************************************************* * * Function: sql_affected_rows * * Purpose: End the select query, such as freeing memory or result * *************************************************************************/ static int sql_affected_rows(SQLSOCK *sqlsocket, UNUSED SQL_CONFIG *config) { rlm_sql_freetds_sock *freetds_sock = sqlsocket->conn; return dbcount(freetds_sock->dbproc); } /* Exported to rlm_sql */ rlm_sql_module_t rlm_sql_freetds = { "rlm_sql_freetds", sql_init_socket, sql_destroy_socket, sql_query, sql_select_query, sql_store_result, sql_num_fields, sql_num_rows, sql_fetch_row, sql_free_result, sql_error, sql_close, sql_finish_query, sql_finish_select_query, sql_affected_rows }; freeradius-server/src/modules/rlm_sql/drivers/rlm_sql_iodbc/000077500000000000000000000000001257552170400247225ustar00rootroot00000000000000freeradius-server/src/modules/rlm_sql/drivers/rlm_sql_iodbc/.gitignore000066400000000000000000000000111257552170400267020ustar00rootroot00000000000000Makefile freeradius-server/src/modules/rlm_sql/drivers/rlm_sql_iodbc/Makefile.in000066400000000000000000000002731257552170400267710ustar00rootroot00000000000000include ../../../../../Make.inc TARGET = @targetname@ SRCS = sql_iodbc.c RLM_SQL_CFLAGS = @sql_iodbc_cflags@ RLM_SQL_LIBS = @sql_iodbc_ldflags@ include ../rules.mak freeradius-server/src/modules/rlm_sql/drivers/rlm_sql_iodbc/configure000077500000000000000000003320511257552170400266350ustar00rootroot00000000000000#! /bin/sh # From configure.in Revision. # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.61. # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, # 2002, 2003, 2004, 2005, 2006 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=: # 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 # PATH needs CR # 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 # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false 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.) as_nl=' ' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. 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 # Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # CDPATH. $as_unset CDPATH if test "x$CONFIG_SHELL" = x; then if (eval ":") 2>/dev/null; then as_have_required=yes else as_have_required=no fi if test $as_have_required = yes && (eval ": (as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=\$LINENO as_lineno_2=\$LINENO test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } ") 2> /dev/null; then : else as_candidate_shells= as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. case $as_dir in /*) for as_base in sh bash ksh sh5; do as_candidate_shells="$as_candidate_shells $as_dir/$as_base" done;; esac done IFS=$as_save_IFS for as_shell in $as_candidate_shells $SHELL; do # Try only shells that exist, to save several forks. if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { ("$as_shell") 2> /dev/null <<\_ASEOF 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 : _ASEOF }; then CONFIG_SHELL=$as_shell as_have_required=yes if { "$as_shell" 2> /dev/null <<\_ASEOF 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 : (as_func_return () { (exit $1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = "$1" ); then : else exitcode=1 echo positional parameters were not saved. fi test $exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } _ASEOF }; then break fi fi done if test "x$CONFIG_SHELL" != x; then for as_var in BASH_ENV ENV do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done export CONFIG_SHELL exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} fi if test $as_have_required = no; then echo This script requires a shell more modern than all the echo shells that I found on your system. Please install a echo modern shell, or manually run the script under such a echo shell if you do have one. { (exit 1); exit 1; } fi fi fi (eval "as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0") || { echo No shell found that supports shell functions. echo Please tell autoconf@gnu.org about your system, echo including any error possibly output before this echo message } as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, and appends # trailing '-' during substitution so that $LINENO is not a special # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # scripts with optimization help from Paolo Bonzini. 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" || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi 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 fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi 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=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, 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= SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME= PACKAGE_TARNAME= PACKAGE_VERSION= PACKAGE_STRING= PACKAGE_BUGREPORT= ac_unique_file="sql_iodbc.c" ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datarootdir datadir sysconfdir sharedstatedir localstatedir includedir oldincludedir docdir infodir htmldir dvidir pdfdir psdir libdir localedir mandir DEFS ECHO_C ECHO_N ECHO_T LIBS build_alias host_alias target_alias CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT sql_iodbc_ldflags sql_iodbc_cflags targetname LIBOBJS LTLIBOBJS' ac_subst_files='' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS' # Initialize some variables set by options. ac_init_help= ac_init_version=false # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *) ac_optarg=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_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` eval enable_$ac_feature=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_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` eval enable_$ac_feature=\$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_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/[-.]/_/g'` eval with_$ac_package=\$ac_optarg ;; -without-* | --without-*) ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/[-.]/_/g'` eval with_$ac_package=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 ;; -*) { echo "$as_me: error: unrecognized option: $ac_option Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && 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'` { echo "$as_me: error: missing argument to $ac_option" >&2 { (exit 1); exit 1; }; } fi # Be sure to have absolute directory names. 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 case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; } 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 echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || { echo "$as_me: error: Working directory cannot be determined" >&2 { (exit 1); exit 1; }; } test "X$ac_ls_di" = "X$ac_pwd_ls_di" || { echo "$as_me: error: pwd does not report name of working directory" >&2 { (exit 1); exit 1; }; } # 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 -- "$0" || $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$0" : 'X\(//\)[^/]' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X"$0" | 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 .." { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2 { (exit 1); exit 1; }; } pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures this package to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF _ACEOF fi if test -n "$ac_init_help"; then cat <<\_ACEOF Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-iodbc-include-dir=DIR Directory where the Iodbc includes may be found --with-iodbc-lib-dir=DIR Directory where the Iodbc libraries may be found --with-iodbc-dir=DIR Base directory where Iodbc is installed 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 C/C++/Objective C preprocessor flags, e.g. -I if you have headers in a nonstandard directory Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. _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" || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`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 echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF configure generated by GNU Autoconf 2.61 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 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 cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by $as_me, which was generated by GNU Autoconf 2.61. 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=. 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=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; 2) ac_configure_args1="$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 ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac done done $as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } $as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export 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 cat <<\_ASBOX ## ---------------- ## ## Cache variables. ## ## ---------------- ## _ASBOX 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_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( *) $as_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 cat <<\_ASBOX ## ----------------- ## ## Output variables. ## ## ----------------- ## _ASBOX echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then cat <<\_ASBOX ## ------------------- ## ## File substitutions. ## ## ------------------- ## _ASBOX echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then cat <<\_ASBOX ## ----------- ## ## confdefs.h. ## ## ----------- ## _ASBOX echo cat confdefs.h echo fi test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" 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'; { (exit 1); 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 # 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 # Let the site file select an alternate cache file if it wants to. # Prefer explicitly selected file to automatically selected ones. if test -n "$CONFIG_SITE"; then set x "$CONFIG_SITE" elif test "x$prefix" != xNONE; then set x "$prefix/share/config.site" "$prefix/etc/config.site" else set x "$ac_default_prefix/share/config.site" \ "$ac_default_prefix/etc/config.site" fi shift for ac_site_file do if test -r "$ac_site_file"; then { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" 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. if test -f "$cache_file"; then { echo "$as_me:$LINENO: loading cache $cache_file" >&5 echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { echo "$as_me:$LINENO: creating cache $cache_file" >&5 echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 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 { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 echo "$as_me: former value: $ac_old_val" >&2;} { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 echo "$as_me: current value: $ac_new_val" >&2;} ac_cache_corrupted=: fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`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. *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 echo "$as_me: error: changes in the environment can compromise the build" >&2;} { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} { (exit 1); exit 1; }; } 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 fail= SMART_LIBS= SMART_CLFAGS= if test x$with_rlm_sql_iodbc != xno; then iodbc_include_dir= # Check whether --with-iodbc-include-dir was given. if test "${with_iodbc_include_dir+set}" = set; then withval=$with_iodbc_include_dir; case "$withval" in no) { { echo "$as_me:$LINENO: error: Need iodbc-include-dir" >&5 echo "$as_me: error: Need iodbc-include-dir" >&2;} { (exit 1); exit 1; }; } ;; yes) ;; *) iodbc_include_dir="$withval" ;; esac fi iodbc_lib_dir= # Check whether --with-iodbc-lib-dir was given. if test "${with_iodbc_lib_dir+set}" = set; then withval=$with_iodbc_lib_dir; case "$withval" in no) { { echo "$as_me:$LINENO: error: Need iodbc-lib-dir" >&5 echo "$as_me: error: Need iodbc-lib-dir" >&2;} { (exit 1); exit 1; }; } ;; yes) ;; *) iodbc_lib_dir="$withval" ;; esac fi # Check whether --with-iodbc-dir was given. if test "${with_iodbc_dir+set}" = set; then withval=$with_iodbc_dir; case "$withval" in no) { { echo "$as_me:$LINENO: error: Need iodbc-dir" >&5 echo "$as_me: error: Need iodbc-dir" >&2;} { (exit 1); exit 1; }; } ;; yes) ;; *) iodbc_lib_dir="$withval/lib" iodbc_include_dir="$withval/include" ;; esac fi smart_try_dir="$iodbc_lib_dir /usr/lib /usr/lib/iodbc /usr/local/lib/iodbc /usr/local/iodbc/lib/iodbc" 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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}gcc" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="gcc" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}cc" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="$ac_prog" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&5 echo "$as_me: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } # Provide some information about the compiler. echo "$as_me:$LINENO: checking for C compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (ac_try="$ac_compiler --version >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -v >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -V >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out 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. { echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6; } ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # # List of possible output files, starting from the most likely. # The algorithm is not robust to junk in `.', hence go to wildcards (a.*) # only as a last resort. b.out is created by i960 compilers. ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out' # # The IRIX 6 linker writes into existing files which may not be # executable, retaining their permissions. Remove them first so a # subsequent execution test works. ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link_default") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; 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 | *.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 { echo "$as_me:$LINENO: result: $ac_file" >&5 echo "${ECHO_T}$ac_file" >&6; } if test -z "$ac_file"; then echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: C compiler cannot create executables See \`config.log' for more details." >&5 echo "$as_me: error: C compiler cannot create executables See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } fi ac_exeext=$ac_cv_exeext # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { echo "$as_me:$LINENO: checking whether the C compiler works" >&5 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6; } # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then if { ac_try='./$ac_file' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { echo "$as_me:$LINENO: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&5 echo "$as_me: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi fi fi { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } rm -f a.out a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; } { echo "$as_me:$LINENO: result: $cross_compiling" >&5 echo "${ECHO_T}$cross_compiling" >&6; } { echo "$as_me:$LINENO: checking for suffix of executables" >&5 echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; } if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; 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 | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest$ac_cv_exeext { echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 echo "${ECHO_T}$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT { echo "$as_me:$LINENO: checking for suffix of object files" >&5 echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; } if test "${ac_cv_objext+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; 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 ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 echo "${ECHO_T}$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; } if test "${ac_cv_c_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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 { echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; } GCC=`test $ac_compiler_gnu = yes && echo yes` ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CFLAGS="" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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 { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 echo "${ECHO_T}$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 { echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_c89+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_c89=$ac_arg else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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) { echo "$as_me:$LINENO: result: none needed" >&5 echo "${ECHO_T}none needed" >&6; } ;; xno) { echo "$as_me:$LINENO: result: unsupported" >&5 echo "${ECHO_T}unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;; 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 sm_lib_safe=`echo "iodbc" | sed 'y%./+-%__p_%'` sm_func_safe=`echo "SQLConnect" | sed 'y%./+-%__p_%'` { echo "$as_me:$LINENO: checking for SQLConnect in -liodbc" >&5 echo $ECHO_N "checking for SQLConnect in -liodbc... $ECHO_C" >&6; } old_LIBS="$LIBS" smart_lib= smart_lib_dir= if test "x$smart_try_dir" != "x"; then for try in $smart_try_dir; do LIBS="-L$try -liodbc $old_LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ extern char SQLConnect(); int main () { SQLConnect() ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then smart_lib="-L$try -liodbc" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test "x$smart_lib" != "x"; then break; fi done LIBS="$old_LIBS" fi if test "x$smart_lib" = "x"; then LIBS="-liodbc $old_LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ extern char SQLConnect(); int main () { SQLConnect() ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then smart_lib="-liodbc" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS="$old_LIBS" fi if test "x$smart_lib" = "x"; then if test "x$LOCATE" != "x"; then DIRS= file=libiodbc${libltdl_cv_shlibext} for x in `${LOCATE} $file 2>/dev/null`; do base=`echo $x | sed "s%/${file}%%"` if test "x$x" = "x$base"; then continue; fi dir=`${DIRNAME} $x 2>/dev/null` exclude=`echo ${dir} | ${GREP} /home` if test "x$exclude" != "x"; then continue fi already=`echo \$smart_lib_dir ${DIRS} | ${GREP} ${dir}` if test "x$already" = "x"; then DIRS="$DIRS $dir" fi done fi eval "smart_lib_dir=\"\$smart_lib_dir $DIRS\"" if test "x$LOCATE" != "x"; then DIRS= file=libiodbc.a for x in `${LOCATE} $file 2>/dev/null`; do base=`echo $x | sed "s%/${file}%%"` if test "x$x" = "x$base"; then continue; fi dir=`${DIRNAME} $x 2>/dev/null` exclude=`echo ${dir} | ${GREP} /home` if test "x$exclude" != "x"; then continue fi already=`echo \$smart_lib_dir ${DIRS} | ${GREP} ${dir}` if test "x$already" = "x"; then DIRS="$DIRS $dir" fi done fi eval "smart_lib_dir=\"\$smart_lib_dir $DIRS\"" for try in $smart_lib_dir /usr/local/lib /opt/lib; do LIBS="-L$try -liodbc $old_LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ extern char SQLConnect(); int main () { SQLConnect() ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then smart_lib="-L$try -liodbc" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test "x$smart_lib" != "x"; then break; fi done LIBS="$old_LIBS" fi if test "x$smart_lib" != "x"; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } eval "ac_cv_lib_${sm_lib_safe}_${sm_func_safe}=yes" LIBS="$smart_lib $old_LIBS" SMART_LIBS="$smart_lib $SMART_LIBS" else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_cv_lib_iodbc_SQLConnect" != xyes; then fail="$fail libiodbc" fi smart_try_dir="$iodbc_include_dir /usr/local/iodbc/include" ac_safe=`echo "isql.h" | sed 'y%./+-%__pm%'` { echo "$as_me:$LINENO: checking for isql.h" >&5 echo $ECHO_N "checking for isql.h... $ECHO_C" >&6; } old_CFLAGS="$CFLAGS" smart_include= smart_include_dir= if test "x$smart_try_dir" != "x"; then for try in $smart_try_dir; do CFLAGS="$old_CFLAGS -I$try" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { int a = 1; ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then smart_include="-I$try" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 smart_include= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test "x$smart_include" != "x"; then break; fi done CFLAGS="$old_CFLAGS" fi if test "x$smart_include" = "x"; then cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { int a = 1; ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then smart_include=" " else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 smart_include= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test "x$smart_include" = "x"; then if test "x$LOCATE" != "x"; then DIRS= file=isql.h for x in `${LOCATE} $file 2>/dev/null`; do base=`echo $x | sed "s%/${file}%%"` if test "x$x" = "x$base"; then continue; fi dir=`${DIRNAME} $x 2>/dev/null` exclude=`echo ${dir} | ${GREP} /home` if test "x$exclude" != "x"; then continue fi already=`echo \$smart_include_dir ${DIRS} | ${GREP} ${dir}` if test "x$already" = "x"; then DIRS="$DIRS $dir" fi done fi eval "smart_include_dir=\"\$smart_include_dir $DIRS\"" for try in $smart_include_dir /usr/local/include /opt/include; do CFLAGS="$old_CFLAGS -I$try" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { int a = 1; ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then smart_include="-I$try" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 smart_include= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test "x$smart_include" != "x"; then break; fi done CFLAGS="$old_CFLAGS" fi if test "x$smart_include" != "x"; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } eval "ac_cv_header_$ac_safe=yes" CFLAGS="$old_CFLAGS $smart_include" SMART_CFLAGS="$SMART_CFLAGS $smart_include" else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_cv_header_isql_h" != xyes; then fail="$fail isql.h" fi targetname=rlm_sql_iodbc else targetname= echo \*\*\* module rlm_sql_iodbc is disabled. fi if test "x$fail" != x; then if test "x${enable_strict_dependencies}" = xyes; then { { echo "$as_me:$LINENO: error: set --without-rlm_sql_iodbc to disable it explicitly." >&5 echo "$as_me: error: set --without-rlm_sql_iodbc to disable it explicitly." >&2;} { (exit 1); exit 1; }; } else { echo "$as_me:$LINENO: WARNING: silently not building rlm_sql_iodbc." >&5 echo "$as_me: WARNING: silently not building rlm_sql_iodbc." >&2;} { echo "$as_me:$LINENO: WARNING: FAILURE: rlm_sql_iodbc requires:$fail." >&5 echo "$as_me: WARNING: FAILURE: rlm_sql_iodbc requires:$fail." >&2;}; targetname= fi fi sql_iodbc_ldflags="$SMART_LIBS" sql_iodbc_cflags="$SMART_CFLAGS" unset ac_cv_env_LIBS_set unset ac_cv_env_LIBS_value ac_config_files="$ac_config_files 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_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( *) $as_unset $ac_var ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then test "x$cache_file" != "x/dev/null" && { echo "$as_me:$LINENO: updating cache $cache_file" >&5 echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 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}' # Transform confdefs.h into DEFS. # Protect against shell expansion while executing Makefile rules. # Protect against Makefile macro expansion. # # If the first sed substitution is executed (which looks for macros that # take arguments), then branch to the quote section. Otherwise, # look for a macro that doesn't take arguments. ac_script=' t clear :clear s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g t quote s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g t quote b any :quote s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g s/\[/\\&/g s/\]/\\&/g s/\$/$$/g H :any ${ g s/^\n// s/\n/ /g p } ' DEFS=`sed -n "$ac_script" confdefs.h` ac_libobjs= ac_ltlibobjs= 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=`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. ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs : ${CONFIG_STATUS=./config.status} ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >$CONFIG_STATUS <<_ACEOF #! $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} _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ## --------------------- ## ## 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=: # 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 # PATH needs CR # 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 # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false 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.) as_nl=' ' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. 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 # Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # CDPATH. $as_unset CDPATH as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, and appends # trailing '-' during substitution so that $LINENO is not a special # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # scripts with optimization help from Paolo Bonzini. 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" || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi 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 fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi 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=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 # Save the log message, to keep $[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by $as_me, which was generated by GNU Autoconf 2.61. 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 cat >>$CONFIG_STATUS <<_ACEOF # Files that config.status was made for. config_files="$ac_config_files" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit -q, --quiet 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 Configuration files: $config_files Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ config.status configured by $0, generated by GNU Autoconf 2.61, with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" Copyright (C) 2006 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' _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # If no file are specified by the user, then we need to provide default # value. By we need to know if files were specified by the user. 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=$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 ) echo "$ac_cs_version"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift CONFIG_FILES="$CONFIG_FILES $ac_optarg" ac_need_defaults=false;; --he | --h | --help | --hel | -h ) 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. -*) { echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *) ac_config_targets="$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 if \$ac_cs_recheck; then echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 CONFIG_SHELL=$SHELL export CONFIG_SHELL exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; 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 fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= trap 'exit_status=$? { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status ' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || { echo "$me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } # # Set up the sed scripts for CONFIG_FILES section. # # No need to generate the scripts if there are no CONFIG_FILES. # This happens for instance when ./config.status config.h if test -n "$CONFIG_FILES"; then _ACEOF ac_delim='%!_!# ' for ac_last_try in false false false false false :; do cat >conf$$subs.sed <<_ACEOF SHELL!$SHELL$ac_delim PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim PACKAGE_NAME!$PACKAGE_NAME$ac_delim PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim PACKAGE_STRING!$PACKAGE_STRING$ac_delim PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim exec_prefix!$exec_prefix$ac_delim prefix!$prefix$ac_delim program_transform_name!$program_transform_name$ac_delim bindir!$bindir$ac_delim sbindir!$sbindir$ac_delim libexecdir!$libexecdir$ac_delim datarootdir!$datarootdir$ac_delim datadir!$datadir$ac_delim sysconfdir!$sysconfdir$ac_delim sharedstatedir!$sharedstatedir$ac_delim localstatedir!$localstatedir$ac_delim includedir!$includedir$ac_delim oldincludedir!$oldincludedir$ac_delim docdir!$docdir$ac_delim infodir!$infodir$ac_delim htmldir!$htmldir$ac_delim dvidir!$dvidir$ac_delim pdfdir!$pdfdir$ac_delim psdir!$psdir$ac_delim libdir!$libdir$ac_delim localedir!$localedir$ac_delim mandir!$mandir$ac_delim DEFS!$DEFS$ac_delim ECHO_C!$ECHO_C$ac_delim ECHO_N!$ECHO_N$ac_delim ECHO_T!$ECHO_T$ac_delim LIBS!$LIBS$ac_delim build_alias!$build_alias$ac_delim host_alias!$host_alias$ac_delim target_alias!$target_alias$ac_delim CC!$CC$ac_delim CFLAGS!$CFLAGS$ac_delim LDFLAGS!$LDFLAGS$ac_delim CPPFLAGS!$CPPFLAGS$ac_delim ac_ct_CC!$ac_ct_CC$ac_delim EXEEXT!$EXEEXT$ac_delim OBJEXT!$OBJEXT$ac_delim sql_iodbc_ldflags!$sql_iodbc_ldflags$ac_delim sql_iodbc_cflags!$sql_iodbc_cflags$ac_delim targetname!$targetname$ac_delim LIBOBJS!$LIBOBJS$ac_delim LTLIBOBJS!$LTLIBOBJS$ac_delim _ACEOF if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 49; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` if test -n "$ac_eof"; then ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` ac_eof=`expr $ac_eof + 1` fi cat >>$CONFIG_STATUS <<_ACEOF cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof /@[a-zA-Z_][a-zA-Z_0-9]*@/!b end _ACEOF sed ' s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g s/^/s,@/; s/!/@,|#_!!_#|/ :n t n s/'"$ac_delim"'$/,g/; t s/$/\\/; p N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n ' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF :end s/|#_!!_#|//g CEOF$ac_eof _ACEOF # VPATH may cause trouble with some makes, so we remove $(srcdir), # ${srcdir} and @srcdir@ 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[ ]*=/{ s/:*\$(srcdir):*/:/ s/:*\${srcdir}:*/:/ s/:*@srcdir@:*/:/ s/^\([^=]*=[ ]*\):*/\1/ s/:*$// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF fi # test -n "$CONFIG_FILES" for ac_tag in :F $CONFIG_FILES do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5 echo "$as_me: error: Invalid tag $ac_tag." >&2;} { (exit 1); exit 1; }; };; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 echo "$as_me: error: cannot find input file: $ac_f" >&2;} { (exit 1); exit 1; }; };; esac ac_file_inputs="$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 "`IFS=: echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure." if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { echo "$as_me:$LINENO: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} fi case $ac_tag in *:-:* | *:-) cat >"$tmp/stdin";; 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 || 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" case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`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 || 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" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 echo "$as_me: error: cannot create directory $as_dir" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`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 # _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # 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= case `sed -n '/datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p ' $ac_file_inputs` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF 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 sed "$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s&@configure_input@&$configure_input&;t t s&@top_builddir@&$ac_top_builddir_sub&;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 $ac_datarootdir_hack " $ac_file_inputs | sed -f "$tmp/subs-1.sed" >$tmp/out test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&5 echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&2;} rm -f "$tmp/stdin" case $ac_file in -) cat "$tmp/out"; rm -f "$tmp/out";; *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;; esac ;; esac done # for ac_tag { (exit 0); exit 0; } _ACEOF chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save # 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 || { (exit 1); exit 1; } fi freeradius-server/src/modules/rlm_sql/drivers/rlm_sql_iodbc/configure.in000066400000000000000000000042331257552170400272350ustar00rootroot00000000000000AC_PREREQ([2.59]) AC_INIT(sql_iodbc.c) AC_REVISION($Revision$) AC_DEFUN(modname,[rlm_sql_iodbc]) fail= SMART_LIBS= SMART_CLFAGS= if test x$with_[]modname != xno; then dnl extra argument: --with-iodbc-include-dir iodbc_include_dir= AC_ARG_WITH(iodbc-include-dir, [AS_HELP_STRING([--with-iodbc-include-dir=DIR], [Directory where the Iodbc includes may be found])], [case "$withval" in no) AC_MSG_ERROR(Need iodbc-include-dir) ;; yes) ;; *) iodbc_include_dir="$withval" ;; esac]) dnl extra argument: --with-iodbc-lib-dir iodbc_lib_dir= AC_ARG_WITH(iodbc-lib-dir, [AS_HELP_STRING([--with-iodbc-lib-dir=DIR], [Directory where the Iodbc libraries may be found])], [case "$withval" in no) AC_MSG_ERROR(Need iodbc-lib-dir) ;; yes) ;; *) iodbc_lib_dir="$withval" ;; esac]) dnl extra argument: --with-iodbc-dir AC_ARG_WITH(iodbc-dir, [AS_HELP_STRING([--with-iodbc-dir=DIR], [Base directory where Iodbc is installed])], [case "$withval" in no) AC_MSG_ERROR(Need iodbc-dir) ;; yes) ;; *) iodbc_lib_dir="$withval/lib" iodbc_include_dir="$withval/include" ;; esac]) dnl Check for SQLConnect in -liodbc smart_try_dir="$iodbc_lib_dir /usr/lib /usr/lib/iodbc /usr/local/lib/iodbc /usr/local/iodbc/lib/iodbc" FR_SMART_CHECK_LIB(iodbc, SQLConnect) if test "x$ac_cv_lib_iodbc_SQLConnect" != xyes; then fail="$fail libiodbc" fi dnl Check for isql.h smart_try_dir="$iodbc_include_dir /usr/local/iodbc/include" FR_SMART_CHECK_INCLUDE(isql.h) if test "x$ac_cv_header_isql_h" != xyes; then fail="$fail isql.h" fi targetname=modname else targetname= echo \*\*\* module modname is disabled. fi dnl Don't change this section. if test "x$fail" != x; then if test "x${enable_strict_dependencies}" = xyes; then AC_MSG_ERROR([set --without-]modname[ to disable it explicitly.]) else AC_MSG_WARN([silently not building ]modname[.]) AC_MSG_WARN([FAILURE: ]modname[ requires:$fail.]); targetname= fi fi sql_iodbc_ldflags="$SMART_LIBS" sql_iodbc_cflags="$SMART_CFLAGS" AC_SUBST(sql_iodbc_ldflags) AC_SUBST(sql_iodbc_cflags) AC_SUBST(targetname) AC_OUTPUT(Makefile) freeradius-server/src/modules/rlm_sql/drivers/rlm_sql_iodbc/sql_iodbc.c000066400000000000000000000262051257552170400270320ustar00rootroot00000000000000/* * sql_iodbc.c iODBC support for FreeRadius * * Version: $Id$ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2000,2006 The FreeRADIUS server project * Copyright 2000 Jeff Carneal */ #include RCSID("$Id$") #include #include #include #include #include #include "rlm_sql.h" typedef struct rlm_sql_iodbc_sock { HENV env_handle; HDBC dbc_handle; HSTMT stmt_handle; int id; SQL_ROW row; struct sql_socket *next; void *conn; } rlm_sql_iodbc_sock;; static const char *sql_error(SQLSOCK *sqlsocket, SQL_CONFIG *config); static int sql_num_fields(SQLSOCK *sqlsocket, SQL_CONFIG *config); /************************************************************************* * * Function: sql_init_socket * * Purpose: Establish connection to the db * *************************************************************************/ static int sql_init_socket(SQLSOCK *sqlsocket, SQL_CONFIG *config) { rlm_sql_iodbc_sock *iodbc_sock; SQLRETURN rcode; if (!sqlsocket->conn) { sqlsocket->conn = (rlm_sql_iodbc_sock *)rad_malloc(sizeof(rlm_sql_iodbc_sock)); if (!sqlsocket->conn) { return -1; } } iodbc_sock = sqlsocket->conn; memset(iodbc_sock, 0, sizeof(*iodbc_sock)); rcode = SQLAllocEnv(&iodbc_sock->env_handle); if (!SQL_SUCCEEDED(rcode)) { radlog(L_CONS|L_ERR, "sql_create_socket: SQLAllocEnv failed: %s", sql_error(sqlsocket, config)); return -1; } rcode = SQLAllocConnect(iodbc_sock->env_handle, &iodbc_sock->dbc_handle); if (!SQL_SUCCEEDED(rcode)) { radlog(L_CONS|L_ERR, "sql_create_socket: SQLAllocConnect failed: %s", sql_error(sqlsocket, config)); return -1; } rcode = SQLConnect(iodbc_sock->dbc_handle, config->sql_server, SQL_NTS, config->sql_login, SQL_NTS, config->sql_password, SQL_NTS); if (!SQL_SUCCEEDED(rcode)) { radlog(L_CONS|L_ERR, "sql_create_socket: SQLConnectfailed: %s", sql_error(sqlsocket, config)); return -1; } return 0; } /************************************************************************* * * Function: sql_destroy_socket * * Purpose: Free socket and private connection data * *************************************************************************/ static int sql_destroy_socket(SQLSOCK *sqlsocket, UNUSED SQL_CONFIG *config) { free(sqlsocket->conn); sqlsocket->conn = NULL; return 0; } /************************************************************************* * * Function: sql_query * * Purpose: Issue a non-SELECT query (ie: update/delete/insert) to * the database. * *************************************************************************/ static int sql_query(SQLSOCK *sqlsocket, SQL_CONFIG *config, char *querystr) { rlm_sql_iodbc_sock *iodbc_sock = sqlsocket->conn; SQLRETURN rcode; rcode = SQLAllocStmt(iodbc_sock->dbc_handle, &iodbc_sock->stmt_handle); if (!SQL_SUCCEEDED(rcode)) { radlog(L_CONS|L_ERR, "sql_create_socket: SQLAllocStmt failed: %s", sql_error(sqlsocket, config)); return -1; } if (config->sqltrace) radlog(L_DBG, "rlm_sql: %s", querystr); if (iodbc_sock->dbc_handle == NULL) { radlog(L_ERR, "sql_query: Socket not connected"); return -1; } rcode = SQLExecDirect(iodbc_sock->stmt_handle, querystr, SQL_NTS); if (!SQL_SUCCEEDED(rcode)) { radlog(L_CONS|L_ERR, "sql_query: failed: %s", sql_error(sqlsocket, config)); return -1; } return 0; } /************************************************************************* * * Function: sql_select_query * * Purpose: Issue a select query to the database * *************************************************************************/ static int sql_select_query(SQLSOCK *sqlsocket, SQL_CONFIG *config, char *querystr) { int numfields = 0; int i=0; char **row=NULL; SQLINTEGER len=0; rlm_sql_iodbc_sock *iodbc_sock = sqlsocket->conn; if(sql_query(sqlsocket, config, querystr) < 0) { return -1; } numfields = sql_num_fields(sqlsocket, config); row = (char **) rad_malloc(sizeof(char *) * (numfields+1)); memset(row, 0, (sizeof(char *) * (numfields))); row[numfields] = NULL; for(i=1; i<=numfields; i++) { SQLColAttributes(iodbc_sock->stmt_handle, ((SQLUSMALLINT) i), SQL_COLUMN_LENGTH, NULL, 0, NULL, &len); len++; /* * Allocate space for each column */ row[i-1] = (SQLCHAR*)rad_malloc((int)len); /* * This makes me feel dirty, but, according to Microsoft, it works. * Any ODBC datatype can be converted to a 'char *' according to * the following: * * http://msdn.microsoft.com/library/psdk/dasdk/odap4o4z.htm */ SQLBindCol(iodbc_sock->stmt_handle, i, SQL_C_CHAR, (SQLCHAR *)row[i-1], len, 0); } iodbc_sock->row = row; return 0; } /************************************************************************* * * Function: sql_store_result * * Purpose: database specific store_result function. Returns a result * set for the query. * *************************************************************************/ static int sql_store_result(UNUSED SQLSOCK *sqlsocket, UNUSED SQL_CONFIG *config) { return 0; } /************************************************************************* * * Function: sql_num_fields * * Purpose: database specific num_fields function. Returns number * of columns from query * *************************************************************************/ static int sql_num_fields(SQLSOCK *sqlsocket, UNUSED SQL_CONFIG *config) { SQLSMALLINT count=0; rlm_sql_iodbc_sock *iodbc_sock = sqlsocket->conn; SQLNumResultCols(iodbc_sock->stmt_handle, &count); return (int)count; } /************************************************************************* * * Function: sql_num_rows * * Purpose: database specific num_rows. Returns number of rows in * query * *************************************************************************/ static int sql_num_rows(UNUSED SQLSOCK *sqlsocket, UNUSED SQL_CONFIG *config) { /* * I presume this function is used to determine the number of * rows in a result set *before* fetching them. I don't think * this is possible in ODBC 2.x, but I'd be happy to be proven * wrong. If you know how to do this, email me at jeff@apex.net */ return 0; } /************************************************************************* * * Function: sql_fetch_row * * Purpose: database specific fetch_row. Returns a SQL_ROW struct * with all the data for the query in 'sqlsocket->row'. Returns * 0 on success, -1 on failure, SQL_DOWN if 'database is down' * *************************************************************************/ static int sql_fetch_row(SQLSOCK *sqlsocket, UNUSED SQL_CONFIG *config) { SQLRETURN rc; rlm_sql_iodbc_sock *iodbc_sock = sqlsocket->conn; sqlsocket->row = NULL; if((rc = SQLFetch(iodbc_sock->stmt_handle)) == SQL_NO_DATA_FOUND) { return 0; } /* XXX Check rc for database down, if so, return SQL_DOWN */ sqlsocket->row = iodbc_sock->row; return 0; } /************************************************************************* * * Function: sql_free_result * * Purpose: database specific free_result. Frees memory allocated * for a result set * *************************************************************************/ static int sql_free_result(SQLSOCK *sqlsocket, SQL_CONFIG *config) { int i=0; rlm_sql_iodbc_sock *iodbc_sock = sqlsocket->conn; for(i=0; irow[i]); } free(iodbc_sock->row); iodbc_sock->row=NULL; SQLFreeStmt( iodbc_sock->stmt_handle, SQL_DROP ); return 0; } /************************************************************************* * * Function: sql_error * * Purpose: database specific error. Returns error associated with * connection * *************************************************************************/ static const char *sql_error(SQLSOCK *sqlsocket, UNUSED SQL_CONFIG *config) { SQLINTEGER errornum = 0; SQLSMALLINT length = 0; SQLCHAR state[256] = ""; static SQLCHAR error[256] = ""; rlm_sql_iodbc_sock *iodbc_sock = sqlsocket->conn; SQLError(iodbc_sock->env_handle, iodbc_sock->dbc_handle, iodbc_sock->stmt_handle, state, &errornum, error, 256, &length); return error; } /************************************************************************* * * Function: sql_close * * Purpose: database specific close. Closes an open database * connection and cleans up any open handles. * *************************************************************************/ static int sql_close(SQLSOCK *sqlsocket, UNUSED SQL_CONFIG *config) { rlm_sql_iodbc_sock *iodbc_sock = sqlsocket->conn; SQLFreeStmt(iodbc_sock->stmt_handle, SQL_DROP); SQLDisconnect(iodbc_sock->dbc_handle); SQLFreeConnect(iodbc_sock->dbc_handle); SQLFreeEnv(iodbc_sock->env_handle); iodbc_sock->stmt_handle = NULL; iodbc_sock->dbc_handle = NULL; iodbc_sock->env_handle = NULL; return 0; } /************************************************************************* * * Function: sql_finish_query * * Purpose: End the query, such as freeing memory * *************************************************************************/ static int sql_finish_query(SQLSOCK *sqlsocket, SQL_CONFIG *config) { return sql_free_result(sqlsocket, config); } /************************************************************************* * * Function: sql_finish_select_query * * Purpose: End the select query, such as freeing memory or result * *************************************************************************/ static int sql_finish_select_query(SQLSOCK *sqlsocket, SQL_CONFIG *config) { return sql_free_result(sqlsocket, config); } /************************************************************************* * * Function: sql_affected_rows * * Purpose: Return the number of rows affected by the query (update, * or insert) * *************************************************************************/ static int sql_affected_rows(SQLSOCK *sqlsocket, UNUSED SQL_CONFIG *config) { SQLINTEGER count; rlm_sql_iodbc_sock *iodbc_sock = sqlsocket->conn; SQLRowCount(iodbc_sock->stmt_handle, &count); return (int)count; } /* Exported to rlm_sql */ rlm_sql_module_t rlm_sql_iodbc = { "rlm_sql_iodbc", sql_init_socket, sql_destroy_socket, sql_query, sql_select_query, sql_store_result, sql_num_fields, sql_num_rows, sql_fetch_row, sql_free_result, sql_error, sql_close, sql_finish_query, sql_finish_select_query, sql_affected_rows }; freeradius-server/src/modules/rlm_sql/drivers/rlm_sql_mysql/000077500000000000000000000000001257552170400250075ustar00rootroot00000000000000freeradius-server/src/modules/rlm_sql/drivers/rlm_sql_mysql/.gitignore000066400000000000000000000000221257552170400267710ustar00rootroot00000000000000Makefile config.h freeradius-server/src/modules/rlm_sql/drivers/rlm_sql_mysql/Makefile.in000066400000000000000000000002731257552170400270560ustar00rootroot00000000000000include ../../../../../Make.inc TARGET = @targetname@ SRCS = sql_mysql.c RLM_SQL_CFLAGS = @sql_mysql_cflags@ RLM_SQL_LIBS = @sql_mysql_ldflags@ include ../rules.mak freeradius-server/src/modules/rlm_sql/drivers/rlm_sql_mysql/config.h.in000066400000000000000000000011231257552170400270270ustar00rootroot00000000000000/* config.h.in. Generated from configure.in by autoheader. */ /* Define if you have */ #undef HAVE_MYSQL_H /* Define if you have */ #undef HAVE_MYSQL_MYSQL_H /* 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 version of this package. */ #undef PACKAGE_VERSION freeradius-server/src/modules/rlm_sql/drivers/rlm_sql_mysql/configure000077500000000000000000004050331257552170400267230ustar00rootroot00000000000000#! /bin/sh # From configure.in Revision. # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.61. # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, # 2002, 2003, 2004, 2005, 2006 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=: # 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 # PATH needs CR # 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 # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false 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.) as_nl=' ' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. 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 # Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # CDPATH. $as_unset CDPATH if test "x$CONFIG_SHELL" = x; then if (eval ":") 2>/dev/null; then as_have_required=yes else as_have_required=no fi if test $as_have_required = yes && (eval ": (as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=\$LINENO as_lineno_2=\$LINENO test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } ") 2> /dev/null; then : else as_candidate_shells= as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. case $as_dir in /*) for as_base in sh bash ksh sh5; do as_candidate_shells="$as_candidate_shells $as_dir/$as_base" done;; esac done IFS=$as_save_IFS for as_shell in $as_candidate_shells $SHELL; do # Try only shells that exist, to save several forks. if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { ("$as_shell") 2> /dev/null <<\_ASEOF 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 : _ASEOF }; then CONFIG_SHELL=$as_shell as_have_required=yes if { "$as_shell" 2> /dev/null <<\_ASEOF 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 : (as_func_return () { (exit $1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = "$1" ); then : else exitcode=1 echo positional parameters were not saved. fi test $exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } _ASEOF }; then break fi fi done if test "x$CONFIG_SHELL" != x; then for as_var in BASH_ENV ENV do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done export CONFIG_SHELL exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} fi if test $as_have_required = no; then echo This script requires a shell more modern than all the echo shells that I found on your system. Please install a echo modern shell, or manually run the script under such a echo shell if you do have one. { (exit 1); exit 1; } fi fi fi (eval "as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0") || { echo No shell found that supports shell functions. echo Please tell autoconf@gnu.org about your system, echo including any error possibly output before this echo message } as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, and appends # trailing '-' during substitution so that $LINENO is not a special # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # scripts with optimization help from Paolo Bonzini. 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" || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi 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 fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi 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=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, 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= SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME= PACKAGE_TARNAME= PACKAGE_VERSION= PACKAGE_STRING= PACKAGE_BUGREPORT= ac_unique_file="sql_mysql.c" ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datarootdir datadir sysconfdir sharedstatedir localstatedir includedir oldincludedir docdir infodir htmldir dvidir pdfdir psdir libdir localedir mandir DEFS ECHO_C ECHO_N ECHO_T LIBS build_alias host_alias target_alias CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT MYSQL_CONFIG sql_mysql_ldflags sql_mysql_cflags targetname LIBOBJS LTLIBOBJS' ac_subst_files='' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS' # Initialize some variables set by options. ac_init_help= ac_init_version=false # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *) ac_optarg=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_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` eval enable_$ac_feature=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_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` eval enable_$ac_feature=\$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_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/[-.]/_/g'` eval with_$ac_package=\$ac_optarg ;; -without-* | --without-*) ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/[-.]/_/g'` eval with_$ac_package=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 ;; -*) { echo "$as_me: error: unrecognized option: $ac_option Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && 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'` { echo "$as_me: error: missing argument to $ac_option" >&2 { (exit 1); exit 1; }; } fi # Be sure to have absolute directory names. 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 case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; } 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 echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || { echo "$as_me: error: Working directory cannot be determined" >&2 { (exit 1); exit 1; }; } test "X$ac_ls_di" = "X$ac_pwd_ls_di" || { echo "$as_me: error: pwd does not report name of working directory" >&2 { (exit 1); exit 1; }; } # 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 -- "$0" || $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$0" : 'X\(//\)[^/]' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X"$0" | 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 .." { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2 { (exit 1); exit 1; }; } pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures this package to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF _ACEOF fi if test -n "$ac_init_help"; then cat <<\_ACEOF Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-mysql-include-dir=DIR Directory where the mysql includes may be found --with-mysql-lib-dir=DIR Directory where the mysql libraries may be found --with-mysql-dir=DIR Base directory where mysql is installed --with-threads use threads, if available. (default=yes) 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 C/C++/Objective C preprocessor flags, e.g. -I if you have headers in a nonstandard directory Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. _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" || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`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 echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF configure generated by GNU Autoconf 2.61 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 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 cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by $as_me, which was generated by GNU Autoconf 2.61. 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=. 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=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; 2) ac_configure_args1="$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 ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac done done $as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } $as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export 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 cat <<\_ASBOX ## ---------------- ## ## Cache variables. ## ## ---------------- ## _ASBOX 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_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( *) $as_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 cat <<\_ASBOX ## ----------------- ## ## Output variables. ## ## ----------------- ## _ASBOX echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then cat <<\_ASBOX ## ------------------- ## ## File substitutions. ## ## ------------------- ## _ASBOX echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then cat <<\_ASBOX ## ----------- ## ## confdefs.h. ## ## ----------- ## _ASBOX echo cat confdefs.h echo fi test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" 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'; { (exit 1); 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 # 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 # Let the site file select an alternate cache file if it wants to. # Prefer explicitly selected file to automatically selected ones. if test -n "$CONFIG_SITE"; then set x "$CONFIG_SITE" elif test "x$prefix" != xNONE; then set x "$prefix/share/config.site" "$prefix/etc/config.site" else set x "$ac_default_prefix/share/config.site" \ "$ac_default_prefix/etc/config.site" fi shift for ac_site_file do if test -r "$ac_site_file"; then { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" 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. if test -f "$cache_file"; then { echo "$as_me:$LINENO: loading cache $cache_file" >&5 echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { echo "$as_me:$LINENO: creating cache $cache_file" >&5 echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 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 { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 echo "$as_me: former value: $ac_old_val" >&2;} { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 echo "$as_me: current value: $ac_new_val" >&2;} ac_cache_corrupted=: fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`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. *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 echo "$as_me: error: changes in the environment can compromise the build" >&2;} { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} { (exit 1); exit 1; }; } 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_config_headers="$ac_config_headers config.h" fail= SMART_LIBS= SMART_CLFAGS= if test x$with_rlm_sql_mysql != xno; then mysql_include_dir= # Check whether --with-mysql-include-dir was given. if test "${with_mysql_include_dir+set}" = set; then withval=$with_mysql_include_dir; case "$withval" in no) { { echo "$as_me:$LINENO: error: Need mysql-include-dir" >&5 echo "$as_me: error: Need mysql-include-dir" >&2;} { (exit 1); exit 1; }; } ;; yes) ;; *) mysql_include_dir="$withval" ;; esac fi mysql_lib_dir= # Check whether --with-mysql-lib-dir was given. if test "${with_mysql_lib_dir+set}" = set; then withval=$with_mysql_lib_dir; case "$withval" in no) { { echo "$as_me:$LINENO: error: Need mysql-lib-dir" >&5 echo "$as_me: error: Need mysql-lib-dir" >&2;} { (exit 1); exit 1; }; } ;; yes) ;; *) mysql_lib_dir="$withval" ;; esac fi # Check whether --with-mysql-dir was given. if test "${with_mysql_dir+set}" = set; then withval=$with_mysql_dir; case "$withval" in no) { { echo "$as_me:$LINENO: error: Need mysql-dir" >&5 echo "$as_me: error: Need mysql-dir" >&2;} { (exit 1); exit 1; }; } ;; yes) ;; *) mysql_lib_dir="$withval/lib" mysql_include_dir="$withval/include" ;; esac fi mysql_with_threads=yes # Check whether --with-threads was given. if test "${with_threads+set}" = set; then withval=$with_threads; case "$withval" in no) mysql_with_threads=no ;; *) ;; esac 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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}gcc" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="gcc" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}cc" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="$ac_prog" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&5 echo "$as_me: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } # Provide some information about the compiler. echo "$as_me:$LINENO: checking for C compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (ac_try="$ac_compiler --version >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -v >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -V >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out 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. { echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6; } ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # # List of possible output files, starting from the most likely. # The algorithm is not robust to junk in `.', hence go to wildcards (a.*) # only as a last resort. b.out is created by i960 compilers. ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out' # # The IRIX 6 linker writes into existing files which may not be # executable, retaining their permissions. Remove them first so a # subsequent execution test works. ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link_default") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; 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 | *.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 { echo "$as_me:$LINENO: result: $ac_file" >&5 echo "${ECHO_T}$ac_file" >&6; } if test -z "$ac_file"; then echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: C compiler cannot create executables See \`config.log' for more details." >&5 echo "$as_me: error: C compiler cannot create executables See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } fi ac_exeext=$ac_cv_exeext # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { echo "$as_me:$LINENO: checking whether the C compiler works" >&5 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6; } # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then if { ac_try='./$ac_file' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { echo "$as_me:$LINENO: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&5 echo "$as_me: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi fi fi { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } rm -f a.out a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; } { echo "$as_me:$LINENO: result: $cross_compiling" >&5 echo "${ECHO_T}$cross_compiling" >&6; } { echo "$as_me:$LINENO: checking for suffix of executables" >&5 echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; } if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; 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 | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest$ac_cv_exeext { echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 echo "${ECHO_T}$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT { echo "$as_me:$LINENO: checking for suffix of object files" >&5 echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; } if test "${ac_cv_objext+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; 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 ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 echo "${ECHO_T}$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; } if test "${ac_cv_c_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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 { echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; } GCC=`test $ac_compiler_gnu = yes && echo yes` ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CFLAGS="" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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 { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 echo "${ECHO_T}$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 { echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_c89+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_c89=$ac_arg else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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) { echo "$as_me:$LINENO: result: none needed" >&5 echo "${ECHO_T}none needed" >&6; } ;; xno) { echo "$as_me:$LINENO: result: unsupported" >&5 echo "${ECHO_T}unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;; 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 # Extract the first word of "mysql_config", so it can be a program name with args. set dummy mysql_config; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_MYSQL_CONFIG+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$MYSQL_CONFIG"; then ac_cv_prog_MYSQL_CONFIG="$MYSQL_CONFIG" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_MYSQL_CONFIG="yes" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_MYSQL_CONFIG" && ac_cv_prog_MYSQL_CONFIG="no" fi fi MYSQL_CONFIG=$ac_cv_prog_MYSQL_CONFIG if test -n "$MYSQL_CONFIG"; then { echo "$as_me:$LINENO: result: $MYSQL_CONFIG" >&5 echo "${ECHO_T}$MYSQL_CONFIG" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$mysql_with_threads" = "xyes"; then { echo "$as_me:$LINENO: checking for pthread_create in -lpthread" >&5 echo $ECHO_N "checking for pthread_create in -lpthread... $ECHO_C" >&6; } if test "${ac_cv_lib_pthread_pthread_create+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpthread $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char pthread_create (); int main () { return pthread_create (); ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_pthread_pthread_create=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_pthread_pthread_create=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_pthread_pthread_create" >&5 echo "${ECHO_T}$ac_cv_lib_pthread_pthread_create" >&6; } if test $ac_cv_lib_pthread_pthread_create = yes; then LIBS="-lpthread $LIBS" else { echo "$as_me:$LINENO: checking for pthread_create in -lc_r" >&5 echo $ECHO_N "checking for pthread_create in -lc_r... $ECHO_C" >&6; } if test "${ac_cv_lib_c_r_pthread_create+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lc_r $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char pthread_create (); int main () { return pthread_create (); ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_c_r_pthread_create=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_c_r_pthread_create=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_c_r_pthread_create" >&5 echo "${ECHO_T}$ac_cv_lib_c_r_pthread_create" >&6; } if test $ac_cv_lib_c_r_pthread_create = yes; then LIBS="-lc_r $LIBS" else mysql_with_threads=no fi fi fi if test "x$mysql_with_threads" = "xyes"; then if test "x$MYSQL_CONFIG" = "xyes"; then mysql_libs="$(mysql_config --libs_r)" old_LIBS="$LIBS" LIBS="$mysql_libs $LIBS" { echo "$as_me:$LINENO: checking for mysql_init in -lmysqlclient_r (using mysql_config)" >&5 echo $ECHO_N "checking for mysql_init in -lmysqlclient_r (using mysql_config)... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* 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 mysql_init (); int main () { return mysql_init (); ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then have_libmysqlclient_r=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS="$old_LIBS" if test "x$have_libmysqlclient_r" = "xyes"; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } SMART_LIBS="$mysql_libs $SMART_LIBS" else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi if test "x$have_libmysqlclient_r" != "xyes"; then smart_try_dir="$mysql_lib_dir /usr/lib /usr/lib/mysql \ /usr/local/lib/mysql /usr/local/mysql/lib/mysql" sm_lib_safe=`echo "mysqlclient_r" | sed 'y%./+-%__p_%'` sm_func_safe=`echo "mysql_init" | sed 'y%./+-%__p_%'` { echo "$as_me:$LINENO: checking for mysql_init in -lmysqlclient_r" >&5 echo $ECHO_N "checking for mysql_init in -lmysqlclient_r... $ECHO_C" >&6; } old_LIBS="$LIBS" smart_lib= smart_lib_dir= if test "x$smart_try_dir" != "x"; then for try in $smart_try_dir; do LIBS="-L$try -lmysqlclient_r $old_LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ extern char mysql_init(); int main () { mysql_init() ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then smart_lib="-L$try -lmysqlclient_r" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test "x$smart_lib" != "x"; then break; fi done LIBS="$old_LIBS" fi if test "x$smart_lib" = "x"; then LIBS="-lmysqlclient_r $old_LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ extern char mysql_init(); int main () { mysql_init() ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then smart_lib="-lmysqlclient_r" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS="$old_LIBS" fi if test "x$smart_lib" = "x"; then if test "x$LOCATE" != "x"; then DIRS= file=libmysqlclient_r${libltdl_cv_shlibext} for x in `${LOCATE} $file 2>/dev/null`; do base=`echo $x | sed "s%/${file}%%"` if test "x$x" = "x$base"; then continue; fi dir=`${DIRNAME} $x 2>/dev/null` exclude=`echo ${dir} | ${GREP} /home` if test "x$exclude" != "x"; then continue fi already=`echo \$smart_lib_dir ${DIRS} | ${GREP} ${dir}` if test "x$already" = "x"; then DIRS="$DIRS $dir" fi done fi eval "smart_lib_dir=\"\$smart_lib_dir $DIRS\"" if test "x$LOCATE" != "x"; then DIRS= file=libmysqlclient_r.a for x in `${LOCATE} $file 2>/dev/null`; do base=`echo $x | sed "s%/${file}%%"` if test "x$x" = "x$base"; then continue; fi dir=`${DIRNAME} $x 2>/dev/null` exclude=`echo ${dir} | ${GREP} /home` if test "x$exclude" != "x"; then continue fi already=`echo \$smart_lib_dir ${DIRS} | ${GREP} ${dir}` if test "x$already" = "x"; then DIRS="$DIRS $dir" fi done fi eval "smart_lib_dir=\"\$smart_lib_dir $DIRS\"" for try in $smart_lib_dir /usr/local/lib /opt/lib; do LIBS="-L$try -lmysqlclient_r $old_LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ extern char mysql_init(); int main () { mysql_init() ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then smart_lib="-L$try -lmysqlclient_r" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test "x$smart_lib" != "x"; then break; fi done LIBS="$old_LIBS" fi if test "x$smart_lib" != "x"; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } eval "ac_cv_lib_${sm_lib_safe}_${sm_func_safe}=yes" LIBS="$smart_lib $old_LIBS" SMART_LIBS="$smart_lib $SMART_LIBS" else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_cv_lib_mysqlclient_r_mysql_init" != "xyes" then { echo "$as_me:$LINENO: WARNING: MySQL libraries not found. Use --with-mysql-lib-dir=." >&5 echo "$as_me: WARNING: MySQL libraries not found. Use --with-mysql-lib-dir=." >&2;} fail="$fail libmysqlclient_r" fi fi else if test "x$MYSQL_CONFIG" = "xyes"; then mysql_libs="$(mysql_config --libs)" old_LIBS="$LIBS" LIBS="$mysql_libs $LIBS" { echo "$as_me:$LINENO: checking for mysql_init in -lmysqlclient (using mysql_config)" >&5 echo $ECHO_N "checking for mysql_init in -lmysqlclient (using mysql_config)... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* 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 mysql_init (); int main () { return mysql_init (); ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then have_libmysqlclient=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS="$old_LIBS" if test "x$have_libmysqlclient" = "xyes"; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } SMART_LIBS="$mysql_libs $SMART_LIBS" else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi if test "x$have_libmysqlclient" != "xyes"; then smart_try_dir="$mysql_lib_dir /usr/lib /usr/lib/mysql \ /usr/local/lib/mysql /usr/local/mysql/lib/mysql" sm_lib_safe=`echo "mysqlclient" | sed 'y%./+-%__p_%'` sm_func_safe=`echo "mysql_init" | sed 'y%./+-%__p_%'` { echo "$as_me:$LINENO: checking for mysql_init in -lmysqlclient" >&5 echo $ECHO_N "checking for mysql_init in -lmysqlclient... $ECHO_C" >&6; } old_LIBS="$LIBS" smart_lib= smart_lib_dir= if test "x$smart_try_dir" != "x"; then for try in $smart_try_dir; do LIBS="-L$try -lmysqlclient $old_LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ extern char mysql_init(); int main () { mysql_init() ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then smart_lib="-L$try -lmysqlclient" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test "x$smart_lib" != "x"; then break; fi done LIBS="$old_LIBS" fi if test "x$smart_lib" = "x"; then LIBS="-lmysqlclient $old_LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ extern char mysql_init(); int main () { mysql_init() ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then smart_lib="-lmysqlclient" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS="$old_LIBS" fi if test "x$smart_lib" = "x"; then if test "x$LOCATE" != "x"; then DIRS= file=libmysqlclient${libltdl_cv_shlibext} for x in `${LOCATE} $file 2>/dev/null`; do base=`echo $x | sed "s%/${file}%%"` if test "x$x" = "x$base"; then continue; fi dir=`${DIRNAME} $x 2>/dev/null` exclude=`echo ${dir} | ${GREP} /home` if test "x$exclude" != "x"; then continue fi already=`echo \$smart_lib_dir ${DIRS} | ${GREP} ${dir}` if test "x$already" = "x"; then DIRS="$DIRS $dir" fi done fi eval "smart_lib_dir=\"\$smart_lib_dir $DIRS\"" if test "x$LOCATE" != "x"; then DIRS= file=libmysqlclient.a for x in `${LOCATE} $file 2>/dev/null`; do base=`echo $x | sed "s%/${file}%%"` if test "x$x" = "x$base"; then continue; fi dir=`${DIRNAME} $x 2>/dev/null` exclude=`echo ${dir} | ${GREP} /home` if test "x$exclude" != "x"; then continue fi already=`echo \$smart_lib_dir ${DIRS} | ${GREP} ${dir}` if test "x$already" = "x"; then DIRS="$DIRS $dir" fi done fi eval "smart_lib_dir=\"\$smart_lib_dir $DIRS\"" for try in $smart_lib_dir /usr/local/lib /opt/lib; do LIBS="-L$try -lmysqlclient $old_LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ extern char mysql_init(); int main () { mysql_init() ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then smart_lib="-L$try -lmysqlclient" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test "x$smart_lib" != "x"; then break; fi done LIBS="$old_LIBS" fi if test "x$smart_lib" != "x"; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } eval "ac_cv_lib_${sm_lib_safe}_${sm_func_safe}=yes" LIBS="$smart_lib $old_LIBS" SMART_LIBS="$smart_lib $SMART_LIBS" else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_cv_lib_mysqlclient_mysql_init" != "xyes" then { echo "$as_me:$LINENO: WARNING: MySQL libraries not found. Use --with-mysql-lib-dir=." >&5 echo "$as_me: WARNING: MySQL libraries not found. Use --with-mysql-lib-dir=." >&2;} fail="$fail libmysqlclient" fi fi fi if test "x$MYSQL_CONFIG" = "xyes"; then mysql_cflags="$(mysql_config --cflags)" old_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $mysql_cflags" { echo "$as_me:$LINENO: checking for mysql.h (using mysql_config --cflags)" >&5 echo $ECHO_N "checking for mysql.h (using mysql_config --cflags)... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { int a = 1; ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then have_mysql_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test "x$have_mysql_h" = "xyes"; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } cat >>confdefs.h <<\_ACEOF #define HAVE_MYSQL_H _ACEOF SMART_CFLAGS="$SMART_CFLAGS $mysql_cflags" else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } mysql_cflags="$(mysql_config --include)" CFLAGS="$old_CFLAGS $mysql_cflags" { echo "$as_me:$LINENO: checking for mysql.h (using mysql_config --include)" >&5 echo $ECHO_N "checking for mysql.h (using mysql_config --include)... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { int a = 1; ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then have_mysql_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test "x$have_mysql_h" = "xyes"; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } cat >>confdefs.h <<\_ACEOF #define HAVE_MYSQL_H _ACEOF SMART_CFLAGS="$SMART_CFLAGS $mysql_cflags" else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi CFLAGS="$old_CFLAGS" fi if test "x$have_mysql_h" != "xyes"; then smart_try_dir="$mysql_include_dir /usr/local/include \ /usr/local/mysql/include" ac_safe=`echo "mysql/mysql.h" | sed 'y%./+-%__pm%'` { echo "$as_me:$LINENO: checking for mysql/mysql.h" >&5 echo $ECHO_N "checking for mysql/mysql.h... $ECHO_C" >&6; } old_CFLAGS="$CFLAGS" smart_include= smart_include_dir= if test "x$smart_try_dir" != "x"; then for try in $smart_try_dir; do CFLAGS="$old_CFLAGS -I$try" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { int a = 1; ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then smart_include="-I$try" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 smart_include= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test "x$smart_include" != "x"; then break; fi done CFLAGS="$old_CFLAGS" fi if test "x$smart_include" = "x"; then cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { int a = 1; ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then smart_include=" " else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 smart_include= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test "x$smart_include" = "x"; then if test "x$LOCATE" != "x"; then DIRS= file=mysql/mysql.h for x in `${LOCATE} $file 2>/dev/null`; do base=`echo $x | sed "s%/${file}%%"` if test "x$x" = "x$base"; then continue; fi dir=`${DIRNAME} $x 2>/dev/null` exclude=`echo ${dir} | ${GREP} /home` if test "x$exclude" != "x"; then continue fi already=`echo \$smart_include_dir ${DIRS} | ${GREP} ${dir}` if test "x$already" = "x"; then DIRS="$DIRS $dir" fi done fi eval "smart_include_dir=\"\$smart_include_dir $DIRS\"" for try in $smart_include_dir /usr/local/include /opt/include; do CFLAGS="$old_CFLAGS -I$try" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { int a = 1; ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then smart_include="-I$try" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 smart_include= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test "x$smart_include" != "x"; then break; fi done CFLAGS="$old_CFLAGS" fi if test "x$smart_include" != "x"; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } eval "ac_cv_header_$ac_safe=yes" CFLAGS="$old_CFLAGS $smart_include" SMART_CFLAGS="$SMART_CFLAGS $smart_include" else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_cv_header_mysql_mysql_h" = "xyes"; then cat >>confdefs.h <<\_ACEOF #define HAVE_MYSQL_MYSQL_H _ACEOF else { echo "$as_me:$LINENO: WARNING: MySQL headers not found. Use --with-mysql-include-dir=." >&5 echo "$as_me: WARNING: MySQL headers not found. Use --with-mysql-include-dir=." >&2;} fail="$fail mysql.h" fi fi targetname=rlm_sql_mysql else targetname= echo \*\*\* module rlm_sql_mysql is disabled. fi if test "x$fail" != x; then if test "x${enable_strict_dependencies}" = xyes; then { { echo "$as_me:$LINENO: error: set --without-rlm_sql_mysql to disable it explicitly." >&5 echo "$as_me: error: set --without-rlm_sql_mysql to disable it explicitly." >&2;} { (exit 1); exit 1; }; } else { echo "$as_me:$LINENO: WARNING: silently not building rlm_sql_mysql." >&5 echo "$as_me: WARNING: silently not building rlm_sql_mysql." >&2;} { echo "$as_me:$LINENO: WARNING: FAILURE: rlm_sql_mysql requires:$fail." >&5 echo "$as_me: WARNING: FAILURE: rlm_sql_mysql requires:$fail." >&2;}; targetname= fi fi sql_mysql_ldflags="$SMART_LIBS" sql_mysql_cflags="$SMART_CFLAGS" unset ac_cv_env_LIBS_set unset ac_cv_env_LIBS_value ac_config_files="$ac_config_files 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_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( *) $as_unset $ac_var ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then test "x$cache_file" != "x/dev/null" && { echo "$as_me:$LINENO: updating cache $cache_file" >&5 echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 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= 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=`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. ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs : ${CONFIG_STATUS=./config.status} ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >$CONFIG_STATUS <<_ACEOF #! $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} _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ## --------------------- ## ## 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=: # 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 # PATH needs CR # 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 # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false 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.) as_nl=' ' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. 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 # Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # CDPATH. $as_unset CDPATH as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, and appends # trailing '-' during substitution so that $LINENO is not a special # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # scripts with optimization help from Paolo Bonzini. 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" || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi 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 fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi 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=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 # Save the log message, to keep $[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by $as_me, which was generated by GNU Autoconf 2.61. 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 cat >>$CONFIG_STATUS <<_ACEOF # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ config.status configured by $0, generated by GNU Autoconf 2.61, with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" Copyright (C) 2006 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' _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # If no file are specified by the user, then we need to provide default # value. By we need to know if files were specified by the user. 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=$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 ) echo "$ac_cs_version"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift CONFIG_FILES="$CONFIG_FILES $ac_optarg" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header { echo "$as_me: error: ambiguous option: $1 Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; };; --help | --hel | -h ) 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. -*) { echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *) ac_config_targets="$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 if \$ac_cs_recheck; then echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 CONFIG_SHELL=$SHELL export CONFIG_SHELL exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # 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" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= trap 'exit_status=$? { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status ' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || { echo "$me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } # # Set up the sed scripts for CONFIG_FILES section. # # No need to generate the scripts if there are no CONFIG_FILES. # This happens for instance when ./config.status config.h if test -n "$CONFIG_FILES"; then _ACEOF ac_delim='%!_!# ' for ac_last_try in false false false false false :; do cat >conf$$subs.sed <<_ACEOF SHELL!$SHELL$ac_delim PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim PACKAGE_NAME!$PACKAGE_NAME$ac_delim PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim PACKAGE_STRING!$PACKAGE_STRING$ac_delim PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim exec_prefix!$exec_prefix$ac_delim prefix!$prefix$ac_delim program_transform_name!$program_transform_name$ac_delim bindir!$bindir$ac_delim sbindir!$sbindir$ac_delim libexecdir!$libexecdir$ac_delim datarootdir!$datarootdir$ac_delim datadir!$datadir$ac_delim sysconfdir!$sysconfdir$ac_delim sharedstatedir!$sharedstatedir$ac_delim localstatedir!$localstatedir$ac_delim includedir!$includedir$ac_delim oldincludedir!$oldincludedir$ac_delim docdir!$docdir$ac_delim infodir!$infodir$ac_delim htmldir!$htmldir$ac_delim dvidir!$dvidir$ac_delim pdfdir!$pdfdir$ac_delim psdir!$psdir$ac_delim libdir!$libdir$ac_delim localedir!$localedir$ac_delim mandir!$mandir$ac_delim DEFS!$DEFS$ac_delim ECHO_C!$ECHO_C$ac_delim ECHO_N!$ECHO_N$ac_delim ECHO_T!$ECHO_T$ac_delim LIBS!$LIBS$ac_delim build_alias!$build_alias$ac_delim host_alias!$host_alias$ac_delim target_alias!$target_alias$ac_delim CC!$CC$ac_delim CFLAGS!$CFLAGS$ac_delim LDFLAGS!$LDFLAGS$ac_delim CPPFLAGS!$CPPFLAGS$ac_delim ac_ct_CC!$ac_ct_CC$ac_delim EXEEXT!$EXEEXT$ac_delim OBJEXT!$OBJEXT$ac_delim MYSQL_CONFIG!$MYSQL_CONFIG$ac_delim sql_mysql_ldflags!$sql_mysql_ldflags$ac_delim sql_mysql_cflags!$sql_mysql_cflags$ac_delim targetname!$targetname$ac_delim LIBOBJS!$LIBOBJS$ac_delim LTLIBOBJS!$LTLIBOBJS$ac_delim _ACEOF if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 50; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` if test -n "$ac_eof"; then ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` ac_eof=`expr $ac_eof + 1` fi cat >>$CONFIG_STATUS <<_ACEOF cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof /@[a-zA-Z_][a-zA-Z_0-9]*@/!b end _ACEOF sed ' s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g s/^/s,@/; s/!/@,|#_!!_#|/ :n t n s/'"$ac_delim"'$/,g/; t s/$/\\/; p N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n ' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF :end s/|#_!!_#|//g CEOF$ac_eof _ACEOF # VPATH may cause trouble with some makes, so we remove $(srcdir), # ${srcdir} and @srcdir@ 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[ ]*=/{ s/:*\$(srcdir):*/:/ s/:*\${srcdir}:*/:/ s/:*@srcdir@:*/:/ s/^\([^=]*=[ ]*\):*/\1/ s/:*$// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF fi # test -n "$CONFIG_FILES" for ac_tag in :F $CONFIG_FILES :H $CONFIG_HEADERS do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5 echo "$as_me: error: Invalid tag $ac_tag." >&2;} { (exit 1); exit 1; }; };; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 echo "$as_me: error: cannot find input file: $ac_f" >&2;} { (exit 1); exit 1; }; };; esac ac_file_inputs="$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 "`IFS=: echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure." if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { echo "$as_me:$LINENO: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} fi case $ac_tag in *:-:* | *:-) cat >"$tmp/stdin";; 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 || 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" case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`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 || 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" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 echo "$as_me: error: cannot create directory $as_dir" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`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 # _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # 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= case `sed -n '/datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p ' $ac_file_inputs` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF 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 sed "$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s&@configure_input@&$configure_input&;t t s&@top_builddir@&$ac_top_builddir_sub&;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 $ac_datarootdir_hack " $ac_file_inputs | sed -f "$tmp/subs-1.sed" >$tmp/out test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&5 echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&2;} rm -f "$tmp/stdin" case $ac_file in -) cat "$tmp/out"; rm -f "$tmp/out";; *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;; esac ;; :H) # # CONFIG_HEADER # _ACEOF # Transform confdefs.h into a sed script `conftest.defines', that # substitutes the proper values into config.h.in to produce config.h. rm -f conftest.defines conftest.tail # First, append a space to every undef/define line, to ease matching. echo 's/$/ /' >conftest.defines # Then, protect against being on the right side of a sed subst, or in # an unquoted here document, in config.status. If some macros were # called several times there might be several #defines for the same # symbol, which is useless. But do not sort them, since the last # AC_DEFINE must be honored. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* # These sed commands are passed to sed as "A NAME B PARAMS C VALUE D", where # NAME is the cpp macro being defined, VALUE is the value it is being given. # PARAMS is the parameter list in the macro definition--in most cases, it's # just an empty string. ac_dA='s,^\\([ #]*\\)[^ ]*\\([ ]*' ac_dB='\\)[ (].*,\\1define\\2' ac_dC=' ' ac_dD=' ,' uniq confdefs.h | sed -n ' t rset :rset s/^[ ]*#[ ]*define[ ][ ]*// t ok d :ok s/[\\&,]/\\&/g s/^\('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/ '"$ac_dA"'\1'"$ac_dB"'\2'"${ac_dC}"'\3'"$ac_dD"'/p s/^\('"$ac_word_re"'\)[ ]*\(.*\)/'"$ac_dA"'\1'"$ac_dB$ac_dC"'\2'"$ac_dD"'/p ' >>conftest.defines # Remove the space that was appended to ease matching. # Then 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. # (The regexp can be short, since the line contains either #define or #undef.) echo 's/ $// s,^[ #]*u.*,/* & */,' >>conftest.defines # Break up conftest.defines: ac_max_sed_lines=50 # First sed command is: sed -f defines.sed $ac_file_inputs >"$tmp/out1" # Second one is: sed -f defines.sed "$tmp/out1" >"$tmp/out2" # Third one will be: sed -f defines.sed "$tmp/out2" >"$tmp/out1" # et cetera. ac_in='$ac_file_inputs' ac_out='"$tmp/out1"' ac_nxt='"$tmp/out2"' while : do # Write a here document: cat >>$CONFIG_STATUS <<_ACEOF # First, check the format of the line: cat >"\$tmp/defines.sed" <<\\CEOF /^[ ]*#[ ]*undef[ ][ ]*$ac_word_re[ ]*\$/b def /^[ ]*#[ ]*define[ ][ ]*$ac_word_re[( ]/b def b :def _ACEOF sed ${ac_max_sed_lines}q conftest.defines >>$CONFIG_STATUS echo 'CEOF sed -f "$tmp/defines.sed"' "$ac_in >$ac_out" >>$CONFIG_STATUS ac_in=$ac_out; ac_out=$ac_nxt; ac_nxt=$ac_in sed 1,${ac_max_sed_lines}d conftest.defines >conftest.tail grep . conftest.tail >/dev/null || break rm -f conftest.defines mv conftest.tail conftest.defines done rm -f conftest.defines conftest.tail echo "ac_result=$ac_in" >>$CONFIG_STATUS cat >>$CONFIG_STATUS <<\_ACEOF if test x"$ac_file" != x-; then echo "/* $configure_input */" >"$tmp/config.h" cat "$ac_result" >>"$tmp/config.h" if diff $ac_file "$tmp/config.h" >/dev/null 2>&1; then { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 echo "$as_me: $ac_file is unchanged" >&6;} else rm -f $ac_file mv "$tmp/config.h" $ac_file fi else echo "/* $configure_input */" cat "$ac_result" fi rm -f "$tmp/out12" ;; esac done # for ac_tag { (exit 0); exit 0; } _ACEOF chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save # 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 || { (exit 1); exit 1; } fi freeradius-server/src/modules/rlm_sql/drivers/rlm_sql_mysql/configure.in000066400000000000000000000147311257552170400273260ustar00rootroot00000000000000AC_PREREQ([2.59]) AC_INIT(sql_mysql.c) AC_REVISION($Revision$) AC_DEFUN(modname,[rlm_sql_mysql]) AC_CONFIG_HEADER(config.h) fail= SMART_LIBS= SMART_CLFAGS= if test x$with_[]modname != xno; then dnl ############################################################ dnl # Check for command line options dnl ############################################################ dnl extra argument: --with-mysql-include-dir=DIR mysql_include_dir= AC_ARG_WITH(mysql-include-dir, [AS_HELP_STRING([--with-mysql-include-dir=DIR], [Directory where the mysql includes may be found])], [case "$withval" in no) AC_MSG_ERROR(Need mysql-include-dir) ;; yes) ;; *) mysql_include_dir="$withval" ;; esac]) dnl extra argument: --with-mysql-lib-dir=DIR mysql_lib_dir= AC_ARG_WITH(mysql-lib-dir, [AS_HELP_STRING([--with-mysql-lib-dir=DIR], [Directory where the mysql libraries may be found])], [case "$withval" in no) AC_MSG_ERROR(Need mysql-lib-dir) ;; yes) ;; *) mysql_lib_dir="$withval" ;; esac]) dnl extra argument: --with-mysql-dir=DIR AC_ARG_WITH(mysql-dir, [AS_HELP_STRING([--with-mysql-dir=DIR], [Base directory where mysql is installed])], [case "$withval" in no) AC_MSG_ERROR(Need mysql-dir) ;; yes) ;; *) mysql_lib_dir="$withval/lib" mysql_include_dir="$withval/include" ;; esac]) dnl extra argument: --with-threads mysql_with_threads=yes AC_ARG_WITH(threads, [AS_HELP_STRING([--with-threads], [use threads, if available. (default=yes)])], [case "$withval" in no) mysql_with_threads=no ;; *) ;; esac]) dnl ############################################################ dnl # Check for programs dnl ############################################################ AC_PROG_CC AC_CHECK_PROG(MYSQL_CONFIG, mysql_config, yes, no) dnl ############################################################ dnl # Check for libraries dnl ############################################################ dnl pthread stuff is usually in -lpthread dnl or in -lc_r, on *BSD if test "x$mysql_with_threads" = "xyes"; then AC_CHECK_LIB(pthread, pthread_create, [ LIBS="-lpthread $LIBS" ], AC_CHECK_LIB(c_r, pthread_create, [ LIBS="-lc_r $LIBS" ], [ mysql_with_threads=no ] ) ) fi if test "x$mysql_with_threads" = "xyes"; then dnl try to link to libmysqlclient_r if test "x$MYSQL_CONFIG" = "xyes"; then mysql_libs="$(mysql_config --libs_r)" old_LIBS="$LIBS" LIBS="$mysql_libs $LIBS" AC_MSG_CHECKING([for mysql_init in -lmysqlclient_r (using mysql_config)]) AC_TRY_LINK_FUNC(mysql_init, have_libmysqlclient_r=yes) LIBS="$old_LIBS" if test "x$have_libmysqlclient_r" = "xyes"; then AC_MSG_RESULT(yes) SMART_LIBS="$mysql_libs $SMART_LIBS" else AC_MSG_RESULT(no) fi fi if test "x$have_libmysqlclient_r" != "xyes"; then dnl mysql_config didn't work :( smart_try_dir="$mysql_lib_dir /usr/lib /usr/lib/mysql \ /usr/local/lib/mysql /usr/local/mysql/lib/mysql" FR_SMART_CHECK_LIB(mysqlclient_r, mysql_init) if test "x$ac_cv_lib_mysqlclient_r_mysql_init" != "xyes" then dnl nothing worked :( AC_MSG_WARN([MySQL libraries not found. Use --with-mysql-lib-dir=.]) fail="$fail libmysqlclient_r" fi fi else dnl try to link to libmysqlclient (without threads support) if test "x$MYSQL_CONFIG" = "xyes"; then mysql_libs="$(mysql_config --libs)" old_LIBS="$LIBS" LIBS="$mysql_libs $LIBS" AC_MSG_CHECKING([for mysql_init in -lmysqlclient (using mysql_config)]) AC_TRY_LINK_FUNC(mysql_init, have_libmysqlclient=yes) LIBS="$old_LIBS" if test "x$have_libmysqlclient" = "xyes"; then AC_MSG_RESULT(yes) SMART_LIBS="$mysql_libs $SMART_LIBS" else AC_MSG_RESULT(no) fi fi if test "x$have_libmysqlclient" != "xyes"; then dnl mysql_config didn't work :( smart_try_dir="$mysql_lib_dir /usr/lib /usr/lib/mysql \ /usr/local/lib/mysql /usr/local/mysql/lib/mysql" FR_SMART_CHECK_LIB(mysqlclient, mysql_init) if test "x$ac_cv_lib_mysqlclient_mysql_init" != "xyes" then dnl nothing worked :( AC_MSG_WARN([MySQL libraries not found. Use --with-mysql-lib-dir=.]) fail="$fail libmysqlclient" fi fi fi dnl ############################################################ dnl # Check for header files dnl ############################################################ if test "x$MYSQL_CONFIG" = "xyes"; then mysql_cflags="$(mysql_config --cflags)" old_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $mysql_cflags" AC_MSG_CHECKING([for mysql.h (using mysql_config --cflags)]) AC_TRY_COMPILE([#include ], [int a = 1;], have_mysql_h=yes) if test "x$have_mysql_h" = "xyes"; then AC_MSG_RESULT(yes) AC_DEFINE(HAVE_MYSQL_H, [], [Define if you have ]) SMART_CFLAGS="$SMART_CFLAGS $mysql_cflags" else AC_MSG_RESULT(no) mysql_cflags="$(mysql_config --include)" CFLAGS="$old_CFLAGS $mysql_cflags" AC_MSG_CHECKING([for mysql.h (using mysql_config --include)]) AC_TRY_COMPILE([#include ], [int a = 1;], have_mysql_h=yes) if test "x$have_mysql_h" = "xyes"; then AC_MSG_RESULT(yes) AC_DEFINE(HAVE_MYSQL_H, [], [Define if you have ]) SMART_CFLAGS="$SMART_CFLAGS $mysql_cflags" else AC_MSG_RESULT(no) fi fi CFLAGS="$old_CFLAGS" fi if test "x$have_mysql_h" != "xyes"; then dnl mysql_config didn't work :( smart_try_dir="$mysql_include_dir /usr/local/include \ /usr/local/mysql/include" FR_SMART_CHECK_INCLUDE(mysql/mysql.h) if test "x$ac_cv_header_mysql_mysql_h" = "xyes"; then AC_DEFINE(HAVE_MYSQL_MYSQL_H, [], [Define if you have ]) else dnl nothing worked :( AC_MSG_WARN([MySQL headers not found. Use --with-mysql-include-dir=.]) fail="$fail mysql.h" fi fi targetname=modname else targetname= echo \*\*\* module modname is disabled. fi dnl Don't change this section. if test "x$fail" != x; then if test "x${enable_strict_dependencies}" = xyes; then AC_MSG_ERROR([set --without-]modname[ to disable it explicitly.]) else AC_MSG_WARN([silently not building ]modname[.]) AC_MSG_WARN([FAILURE: ]modname[ requires:$fail.]); targetname= fi fi sql_mysql_ldflags="$SMART_LIBS" sql_mysql_cflags="$SMART_CFLAGS" AC_SUBST(sql_mysql_ldflags) AC_SUBST(sql_mysql_cflags) AC_SUBST(targetname) AC_OUTPUT(Makefile) freeradius-server/src/modules/rlm_sql/drivers/rlm_sql_mysql/sql_mysql.c000066400000000000000000000344271257552170400272110ustar00rootroot00000000000000/* * sql_mysql.c SQL Module * * Version: $Id$ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2000-2007 The FreeRADIUS server project * Copyright 2000 Mike Machado * Copyright 2000 Alan DeKok */ #include RCSID("$Id$") #include #include #include "config.h" #ifdef HAVE_MYSQL_MYSQL_H #include #include #include #else #ifdef HAVE_MYSQL_H #include #include #include #endif #endif #include "rlm_sql.h" typedef struct rlm_sql_mysql_sock { MYSQL conn; MYSQL *sock; MYSQL_RES *result; SQL_ROW row; } rlm_sql_mysql_sock; /* Prototypes */ static int sql_free_result(SQLSOCK*, SQL_CONFIG*); /************************************************************************* * * Function: sql_create_socket * * Purpose: Establish connection to the db * *************************************************************************/ static int sql_init_socket(SQLSOCK *sqlsocket, SQL_CONFIG *config) { rlm_sql_mysql_sock *mysql_sock; unsigned long sql_flags; if (!sqlsocket->conn) { sqlsocket->conn = (rlm_sql_mysql_sock *)rad_malloc(sizeof(rlm_sql_mysql_sock)); if (!sqlsocket->conn) { return -1; } } mysql_sock = sqlsocket->conn; memset(mysql_sock, 0, sizeof(*mysql_sock)); radlog(L_INFO, "rlm_sql_mysql: Starting connect to MySQL server for #%d", sqlsocket->id); mysql_init(&(mysql_sock->conn)); mysql_options(&(mysql_sock->conn), MYSQL_READ_DEFAULT_GROUP, "freeradius"); #if (MYSQL_VERSION_ID >= 50000) if (config->query_timeout) { unsigned int timeout = config->query_timeout; /* * 3 retries are hard-coded into the MySQL library. * We ensure that the REAL timeout is what the user * set by accounting for that. */ if (timeout > 3) timeout /= 3; mysql_options(&(mysql_sock->conn), MYSQL_OPT_CONNECT_TIMEOUT, &timeout); mysql_options(&(mysql_sock->conn), MYSQL_OPT_READ_TIMEOUT, &timeout); mysql_options(&(mysql_sock->conn), MYSQL_OPT_WRITE_TIMEOUT, &timeout); } #endif #if (MYSQL_VERSION_ID >= 40100) sql_flags = CLIENT_MULTI_RESULTS | CLIENT_FOUND_ROWS; #else sql_flags = CLIENT_FOUND_ROWS; #endif #ifdef CLIENT_MULTI_STATEMENTS sql_flags |= CLIENT_MULTI_STATEMENTS; #endif if (!(mysql_sock->sock = mysql_real_connect(&(mysql_sock->conn), config->sql_server, config->sql_login, config->sql_password, config->sql_db, atoi(config->sql_port), NULL, sql_flags))) { radlog(L_ERR, "rlm_sql_mysql: Couldn't connect socket to MySQL server %s@%s:%s", config->sql_login, config->sql_server, config->sql_db); radlog(L_ERR, "rlm_sql_mysql: Mysql error '%s'", mysql_error(&mysql_sock->conn)); mysql_sock->sock = NULL; return -1; } return 0; } /************************************************************************* * * Function: sql_destroy_socket * * Purpose: Free socket and any private connection data * *************************************************************************/ static int sql_destroy_socket(SQLSOCK *sqlsocket, UNUSED SQL_CONFIG *config) { free(sqlsocket->conn); sqlsocket->conn = NULL; return 0; } /************************************************************************* * * Function: sql_check_error * * Purpose: check the error to see if the server is down * *************************************************************************/ static int sql_check_error(int error) { switch(error) { case CR_SERVER_GONE_ERROR: case CR_SERVER_LOST: case -1: radlog(L_DBG, "rlm_sql_mysql: MYSQL check_error: %d, returning SQL_DOWN", error); return SQL_DOWN; break; case 0: return 0; break; case CR_OUT_OF_MEMORY: case CR_COMMANDS_OUT_OF_SYNC: case CR_UNKNOWN_ERROR: default: radlog(L_DBG, "rlm_sql_mysql: MYSQL check_error: %d received", error); return -1; break; } } /************************************************************************* * * Function: sql_query * * Purpose: Issue a query to the database * *************************************************************************/ static int sql_query(SQLSOCK * sqlsocket, SQL_CONFIG *config, char *querystr) { rlm_sql_mysql_sock *mysql_sock = sqlsocket->conn; if (config->sqltrace) radlog(L_DBG,"rlm_sql_mysql: query: %s", querystr); if (mysql_sock->sock == NULL) { radlog(L_ERR, "rlm_sql_mysql: Socket not connected"); return SQL_DOWN; } mysql_query(mysql_sock->sock, querystr); return sql_check_error(mysql_errno(mysql_sock->sock)); } /************************************************************************* * * Function: sql_store_result * * Purpose: database specific store_result function. Returns a result * set for the query. In case of multiple results, get the * first non-empty one. * *************************************************************************/ static int sql_store_result(SQLSOCK * sqlsocket, UNUSED SQL_CONFIG *config) { rlm_sql_mysql_sock *mysql_sock = sqlsocket->conn; int status; if (mysql_sock->sock == NULL) { radlog(L_ERR, "rlm_sql_mysql: Socket not connected"); return SQL_DOWN; } retry_store_result: if (!(mysql_sock->result = mysql_store_result(mysql_sock->sock))) { status = sql_check_error(mysql_errno(mysql_sock->sock)); if (status != 0) { radlog(L_ERR, "rlm_sql_mysql: Cannot store result"); radlog(L_ERR, "rlm_sql_mysql: MySQL error '%s'", mysql_error(mysql_sock->sock)); return status; } #if (MYSQL_VERSION_ID >= 40100) status = mysql_next_result(mysql_sock->sock); if (status == 0) { /* there are more results */ goto retry_store_result; } else if (status > 0) { radlog(L_ERR, "rlm_sql_mysql: Cannot get next result"); radlog(L_ERR, "rlm_sql_mysql: MySQL error '%s'", mysql_error(mysql_sock->sock)); return sql_check_error(status); } #endif } return 0; } /************************************************************************* * * Function: sql_num_fields * * Purpose: database specific num_fields function. Returns number * of columns from query * *************************************************************************/ static int sql_num_fields(SQLSOCK * sqlsocket, UNUSED SQL_CONFIG *config) { int num = 0; rlm_sql_mysql_sock *mysql_sock = sqlsocket->conn; #if MYSQL_VERSION_ID >= 32224 if (!(num = mysql_field_count(mysql_sock->sock))) { #else if (!(num = mysql_num_fields(mysql_sock->sock))) { #endif radlog(L_ERR, "rlm_sql_mysql: MYSQL Error: No Fields"); radlog(L_ERR, "rlm_sql_mysql: MYSQL error: %s", mysql_error(mysql_sock->sock)); } return num; } /************************************************************************* * * Function: sql_select_query * * Purpose: Issue a select query to the database * *************************************************************************/ static int sql_select_query(SQLSOCK *sqlsocket, SQL_CONFIG *config, char *querystr) { int ret; ret = sql_query(sqlsocket, config, querystr); if(ret) return ret; ret = sql_store_result(sqlsocket, config); if (ret) { return ret; } /* Why? Per http://www.mysql.com/doc/n/o/node_591.html, * this cannot return an error. Perhaps just to complain if no * fields are found? */ sql_num_fields(sqlsocket, config); return ret; } /************************************************************************* * * Function: sql_num_rows * * Purpose: database specific num_rows. Returns number of rows in * query * *************************************************************************/ static int sql_num_rows(SQLSOCK * sqlsocket, UNUSED SQL_CONFIG *config) { rlm_sql_mysql_sock *mysql_sock = sqlsocket->conn; if (mysql_sock->result) return mysql_num_rows(mysql_sock->result); return 0; } /************************************************************************* * * Function: sql_fetch_row * * Purpose: database specific fetch_row. Returns a SQL_ROW struct * with all the data for the query in 'sqlsocket->row'. Returns * 0 on success, -1 on failure, SQL_DOWN if database is down. * *************************************************************************/ static int sql_fetch_row(SQLSOCK * sqlsocket, UNUSED SQL_CONFIG *config) { rlm_sql_mysql_sock *mysql_sock = sqlsocket->conn; int status; /* * Check pointer before de-referencing it. */ if (!mysql_sock->result) { return SQL_DOWN; } retry_fetch_row: sqlsocket->row = mysql_fetch_row(mysql_sock->result); if (sqlsocket->row == NULL) { status = sql_check_error(mysql_errno(mysql_sock->sock)); if (status != 0) { radlog(L_ERR, "rlm_sql_mysql: Cannot fetch row"); radlog(L_ERR, "rlm_sql_mysql: MySQL error '%s'", mysql_error(mysql_sock->sock)); return status; } #if (MYSQL_VERSION_ID >= 40100) sql_free_result(sqlsocket, config); status = mysql_next_result(mysql_sock->sock); if (status == 0) { /* there are more results */ if ((sql_store_result(sqlsocket, config) == 0) && (mysql_sock->result != NULL)) goto retry_fetch_row; } else if (status > 0) { radlog(L_ERR, "rlm_sql_mysql: Cannot get next result"); radlog(L_ERR, "rlm_sql_mysql: MySQL error '%s'", mysql_error(mysql_sock->sock)); return sql_check_error(status); } #endif } return 0; } /************************************************************************* * * Function: sql_free_result * * Purpose: database specific free_result. Frees memory allocated * for a result set * *************************************************************************/ static int sql_free_result(SQLSOCK * sqlsocket, UNUSED SQL_CONFIG *config) { rlm_sql_mysql_sock *mysql_sock = sqlsocket->conn; if (mysql_sock->result) { mysql_free_result(mysql_sock->result); mysql_sock->result = NULL; } return 0; } /************************************************************************* * * Function: sql_error * * Purpose: database specific error. Returns error associated with * connection * *************************************************************************/ static const char *sql_error(SQLSOCK * sqlsocket, UNUSED SQL_CONFIG *config) { rlm_sql_mysql_sock *mysql_sock = sqlsocket->conn; if (mysql_sock == NULL || mysql_sock->sock == NULL) { return "rlm_sql_mysql: no connection to db"; } return mysql_error(mysql_sock->sock); } /************************************************************************* * * Function: sql_close * * Purpose: database specific close. Closes an open database * connection * *************************************************************************/ static int sql_close(SQLSOCK * sqlsocket, UNUSED SQL_CONFIG *config) { rlm_sql_mysql_sock *mysql_sock = sqlsocket->conn; if (mysql_sock && mysql_sock->sock){ mysql_close(mysql_sock->sock); mysql_sock->sock = NULL; } return 0; } /************************************************************************* * * Function: sql_finish_query * * Purpose: As a single SQL statement may return multiple results * sets, (for example stored procedures) it is necessary to check * whether more results exist and process them in turn if so. * *************************************************************************/ static int sql_finish_query(SQLSOCK * sqlsocket, UNUSED SQL_CONFIG *config) { #if (MYSQL_VERSION_ID >= 40100) rlm_sql_mysql_sock *mysql_sock = sqlsocket->conn; int status; skip_next_result: status = sql_store_result(sqlsocket, config); if (status != 0) { return status; } else if (mysql_sock->result != NULL) { radlog(L_DBG, "rlm_sql_mysql: SQL statement returned unexpected result"); sql_free_result(sqlsocket, config); } status = mysql_next_result(mysql_sock->sock); if (status == 0) { /* there are more results */ goto skip_next_result; } else if (status > 0) { radlog(L_ERR, "rlm_sql_mysql: Cannot get next result"); radlog(L_ERR, "rlm_sql_mysql: MySQL error '%s'", mysql_error(mysql_sock->sock)); return sql_check_error(status); } #endif return 0; } /************************************************************************* * * Function: sql_finish_select_query * * Purpose: End the select query, such as freeing memory or result * *************************************************************************/ static int sql_finish_select_query(SQLSOCK * sqlsocket, SQL_CONFIG *config) { #if (MYSQL_VERSION_ID >= 40100) int status; rlm_sql_mysql_sock *mysql_sock = sqlsocket->conn; #endif sql_free_result(sqlsocket, config); #if (MYSQL_VERSION_ID >= 40100) status = mysql_next_result(mysql_sock->sock); if (status == 0) { /* there are more results */ sql_finish_query(sqlsocket, config); } else if (status > 0) { radlog(L_ERR, "rlm_sql_mysql: Cannot get next result"); radlog(L_ERR, "rlm_sql_mysql: MySQL error '%s'", mysql_error(mysql_sock->sock)); return sql_check_error(status); } #endif return 0; } /************************************************************************* * * Function: sql_affected_rows * * Purpose: End the select query, such as freeing memory or result * *************************************************************************/ static int sql_affected_rows(SQLSOCK * sqlsocket, UNUSED SQL_CONFIG *config) { rlm_sql_mysql_sock *mysql_sock = sqlsocket->conn; return mysql_affected_rows(mysql_sock->sock); } /* Exported to rlm_sql */ rlm_sql_module_t rlm_sql_mysql = { "rlm_sql_mysql", sql_init_socket, sql_destroy_socket, sql_query, sql_select_query, sql_store_result, sql_num_fields, sql_num_rows, sql_fetch_row, sql_free_result, sql_error, sql_close, sql_finish_query, sql_finish_select_query, sql_affected_rows }; freeradius-server/src/modules/rlm_sql/drivers/rlm_sql_oracle/000077500000000000000000000000001257552170400251075ustar00rootroot00000000000000freeradius-server/src/modules/rlm_sql/drivers/rlm_sql_oracle/.gitignore000066400000000000000000000000111257552170400270670ustar00rootroot00000000000000Makefile freeradius-server/src/modules/rlm_sql/drivers/rlm_sql_oracle/Makefile.in000066400000000000000000000002761257552170400271610ustar00rootroot00000000000000include ../../../../../Make.inc TARGET = @targetname@ SRCS = sql_oracle.c RLM_SQL_CFLAGS = @sql_oracle_cflags@ RLM_SQL_LIBS = @sql_oracle_ldflags@ include ../rules.mak freeradius-server/src/modules/rlm_sql/drivers/rlm_sql_oracle/configure000077500000000000000000003211001257552170400270130ustar00rootroot00000000000000#! /bin/sh # From configure.in Revision: 1.10 . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.61. # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, # 2002, 2003, 2004, 2005, 2006 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=: # 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 # PATH needs CR # 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 # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false 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.) as_nl=' ' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. 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 # Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # CDPATH. $as_unset CDPATH if test "x$CONFIG_SHELL" = x; then if (eval ":") 2>/dev/null; then as_have_required=yes else as_have_required=no fi if test $as_have_required = yes && (eval ": (as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=\$LINENO as_lineno_2=\$LINENO test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } ") 2> /dev/null; then : else as_candidate_shells= as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. case $as_dir in /*) for as_base in sh bash ksh sh5; do as_candidate_shells="$as_candidate_shells $as_dir/$as_base" done;; esac done IFS=$as_save_IFS for as_shell in $as_candidate_shells $SHELL; do # Try only shells that exist, to save several forks. if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { ("$as_shell") 2> /dev/null <<\_ASEOF 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 : _ASEOF }; then CONFIG_SHELL=$as_shell as_have_required=yes if { "$as_shell" 2> /dev/null <<\_ASEOF 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 : (as_func_return () { (exit $1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = "$1" ); then : else exitcode=1 echo positional parameters were not saved. fi test $exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } _ASEOF }; then break fi fi done if test "x$CONFIG_SHELL" != x; then for as_var in BASH_ENV ENV do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done export CONFIG_SHELL exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} fi if test $as_have_required = no; then echo This script requires a shell more modern than all the echo shells that I found on your system. Please install a echo modern shell, or manually run the script under such a echo shell if you do have one. { (exit 1); exit 1; } fi fi fi (eval "as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0") || { echo No shell found that supports shell functions. echo Please tell autoconf@gnu.org about your system, echo including any error possibly output before this echo message } as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, and appends # trailing '-' during substitution so that $LINENO is not a special # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # scripts with optimization help from Paolo Bonzini. 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" || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi 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 fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi 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=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, 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= SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME= PACKAGE_TARNAME= PACKAGE_VERSION= PACKAGE_STRING= PACKAGE_BUGREPORT= ac_unique_file="sql_oracle.c" ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datarootdir datadir sysconfdir sharedstatedir localstatedir includedir oldincludedir docdir infodir htmldir dvidir pdfdir psdir libdir localedir mandir DEFS ECHO_C ECHO_N ECHO_T LIBS build_alias host_alias target_alias CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT sql_oracle_ldflags sql_oracle_cflags targetname LIBOBJS LTLIBOBJS' ac_subst_files='' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS' # Initialize some variables set by options. ac_init_help= ac_init_version=false # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *) ac_optarg=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_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` eval enable_$ac_feature=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_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` eval enable_$ac_feature=\$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_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/[-.]/_/g'` eval with_$ac_package=\$ac_optarg ;; -without-* | --without-*) ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/[-.]/_/g'` eval with_$ac_package=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 ;; -*) { echo "$as_me: error: unrecognized option: $ac_option Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && 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'` { echo "$as_me: error: missing argument to $ac_option" >&2 { (exit 1); exit 1; }; } fi # Be sure to have absolute directory names. 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 case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; } 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 echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || { echo "$as_me: error: Working directory cannot be determined" >&2 { (exit 1); exit 1; }; } test "X$ac_ls_di" = "X$ac_pwd_ls_di" || { echo "$as_me: error: pwd does not report name of working directory" >&2 { (exit 1); exit 1; }; } # 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 -- "$0" || $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$0" : 'X\(//\)[^/]' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X"$0" | 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 .." { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2 { (exit 1); exit 1; }; } pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures this package to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF _ACEOF fi if test -n "$ac_init_help"; then cat <<\_ACEOF Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-oracle-include-dir=DIR Directory where the Oracle includes may be found. It should be located under ORACLE_HOME if you have client SDK installed. Use --with-oracle-include-dir=yes if you are sure that your compiler include path includes Oracle include dir. Hint: you might try to do: locate oci.h --with-oracle-lib-dir=DIR Directory where the oracle libraries may be found. It should be located under ORACLE_HOME. iUse --with-oracle-lib-dir=yes if you are sure that your linker will find the necessary Oracle client libs. Hint: you might try to do: locate libclntsh.so 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 C/C++/Objective C preprocessor flags, e.g. -I if you have headers in a nonstandard directory Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. _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" || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`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 echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF configure generated by GNU Autoconf 2.61 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 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 cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by $as_me, which was generated by GNU Autoconf 2.61. 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=. 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=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; 2) ac_configure_args1="$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 ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac done done $as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } $as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export 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 cat <<\_ASBOX ## ---------------- ## ## Cache variables. ## ## ---------------- ## _ASBOX 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_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( *) $as_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 cat <<\_ASBOX ## ----------------- ## ## Output variables. ## ## ----------------- ## _ASBOX echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then cat <<\_ASBOX ## ------------------- ## ## File substitutions. ## ## ------------------- ## _ASBOX echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then cat <<\_ASBOX ## ----------- ## ## confdefs.h. ## ## ----------- ## _ASBOX echo cat confdefs.h echo fi test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" 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'; { (exit 1); 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 # 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 # Let the site file select an alternate cache file if it wants to. # Prefer explicitly selected file to automatically selected ones. if test -n "$CONFIG_SITE"; then set x "$CONFIG_SITE" elif test "x$prefix" != xNONE; then set x "$prefix/share/config.site" "$prefix/etc/config.site" else set x "$ac_default_prefix/share/config.site" \ "$ac_default_prefix/etc/config.site" fi shift for ac_site_file do if test -r "$ac_site_file"; then { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" 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. if test -f "$cache_file"; then { echo "$as_me:$LINENO: loading cache $cache_file" >&5 echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { echo "$as_me:$LINENO: creating cache $cache_file" >&5 echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 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 { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 echo "$as_me: former value: $ac_old_val" >&2;} { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 echo "$as_me: current value: $ac_new_val" >&2;} ac_cache_corrupted=: fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`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. *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 echo "$as_me: error: changes in the environment can compromise the build" >&2;} { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} { (exit 1); exit 1; }; } 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 fail= sql_oracle_ldflags= sql_oracle_cflags= if test x$with_rlm_sql_oracle != xno; then { echo "$as_me:$LINENO: checking for oci.h" >&5 echo $ECHO_N "checking for oci.h... $ECHO_C" >&6; } oracle_include_dir= # Check whether --with-oracle-include-dir was given. if test "${with_oracle_include_dir+set}" = set; then withval=$with_oracle_include_dir; case "$withval" in no) { { echo "$as_me:$LINENO: error: Need oracle-include-dir" >&5 echo "$as_me: error: Need oracle-include-dir" >&2;} { (exit 1); exit 1; }; } ;; yes) ;; *) oracle_include_dir="$withval" ;; esac fi oracle_lib_dir= # Check whether --with-oracle-lib-dir was given. if test "${with_oracle_lib_dir+set}" = set; then withval=$with_oracle_lib_dir; case "$withval" in no) { { echo "$as_me:$LINENO: error: Need oracle-lib-dir" >&5 echo "$as_me: error: Need oracle-lib-dir" >&2;} { (exit 1); exit 1; }; } ;; yes) ;; *) oracle_lib_dir="$withval" ;; esac 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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}gcc" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="gcc" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}cc" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="$ac_prog" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&5 echo "$as_me: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } # Provide some information about the compiler. echo "$as_me:$LINENO: checking for C compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (ac_try="$ac_compiler --version >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -v >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -V >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out 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. { echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6; } ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # # List of possible output files, starting from the most likely. # The algorithm is not robust to junk in `.', hence go to wildcards (a.*) # only as a last resort. b.out is created by i960 compilers. ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out' # # The IRIX 6 linker writes into existing files which may not be # executable, retaining their permissions. Remove them first so a # subsequent execution test works. ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link_default") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; 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 | *.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 { echo "$as_me:$LINENO: result: $ac_file" >&5 echo "${ECHO_T}$ac_file" >&6; } if test -z "$ac_file"; then echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: C compiler cannot create executables See \`config.log' for more details." >&5 echo "$as_me: error: C compiler cannot create executables See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } fi ac_exeext=$ac_cv_exeext # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { echo "$as_me:$LINENO: checking whether the C compiler works" >&5 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6; } # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then if { ac_try='./$ac_file' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { echo "$as_me:$LINENO: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&5 echo "$as_me: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi fi fi { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } rm -f a.out a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; } { echo "$as_me:$LINENO: result: $cross_compiling" >&5 echo "${ECHO_T}$cross_compiling" >&6; } { echo "$as_me:$LINENO: checking for suffix of executables" >&5 echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; } if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; 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 | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest$ac_cv_exeext { echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 echo "${ECHO_T}$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT { echo "$as_me:$LINENO: checking for suffix of object files" >&5 echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; } if test "${ac_cv_objext+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; 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 ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 echo "${ECHO_T}$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; } if test "${ac_cv_c_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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 { echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; } GCC=`test $ac_compiler_gnu = yes && echo yes` ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CFLAGS="" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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 { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 echo "${ECHO_T}$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 { echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_c89+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_c89=$ac_arg else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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) { echo "$as_me:$LINENO: result: none needed" >&5 echo "${ECHO_T}none needed" >&6; } ;; xno) { echo "$as_me:$LINENO: result: unsupported" >&5 echo "${ECHO_T}unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;; 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 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { int a = 1; ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ORACLE_INCLUDE=" " else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ORACLE_INCLUDE= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext RLM_SQL_ORA_WORKING_CFLAGS_FOR_LINKING_TEST= if test "x$ORACLE_INCLUDE" = "x" ; then old_CFLAGS="$CFLAGS" CFLAGS="$old_CFLAGS -I$oracle_include_dir" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { int a = 1; ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ORACLE_INCLUDE="-I$oracle_include_dir" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ORACLE_INCLUDE= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext RLM_SQL_ORA_WORKING_CFLAGS_FOR_LINKING_TEST="$CFLAGS" CFLAGS="$old_CFLAGS" fi # Proceed to linking makes only sense if include dir is OK. if test "x$ORACLE_INCLUDE" != "x" ; then old_LIBS="$LIBS" old_CFLAGS="$CFLAGS" CFLAGS="$RLM_SQL_ORA_WORKING_CFLAGS_FOR_LINKING_TEST" ORACLE_LIBDIR_SWITCH= if test "x$oracle_lib_dir" != "x" ; then ORACLE_LIBDIR_SWITCH="-L${oracle_lib_dir} " fi for oracle_version in 10 11 9 ""; do LIBS="$old_LIBS $ORACLE_LIBDIR_SWITCH -lclntsh -lnnz${oracle_version}" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include static OCIEnv *p_env; static OCIError *p_err; static OCISvcCtx *p_svc; static OCIStmt *p_sql; static OCIDefine *p_dfn = (OCIDefine *) 0; static OCIBind *p_bnd = (OCIBind *) 0; int main () { int p_bvi; char p_sli[20]; int rc; char errbuf[100]; int errcode; rc = OCIInitialize((ub4) OCI_DEFAULT, (dvoid *)0, /* Initialize OCI */ (dvoid * (*)(dvoid *, size_t)) 0, (dvoid * (*)(dvoid *, dvoid *, size_t))0, (void (*)(dvoid *, dvoid *)) 0 ); ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ORACLE_LIBS="$ORACLE_LIBDIR_SWITCH -lclntsh -lnnz${oracle_version}" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ORACLE_LIBS= fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test "x$ORACLE_LIBS" != "x"; then break fi done LIBS="$old_LIBS" CFLAGS="$old_CFLAGS" fi if test "x$ORACLE_INCLUDE" = "x"; then { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } { echo "$as_me:$LINENO: WARNING: oracle headers not found. Use --with-oracle-include-dir=." >&5 echo "$as_me: WARNING: oracle headers not found. Use --with-oracle-include-dir=." >&2;} fail="$fail oci.h" else sql_oracle_cflags="${sql_oracle_cflags} ${ORACLE_INCLUDE}" { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } if test "x$ORACLE_LIBS" = "x"; then { echo "$as_me:$LINENO: WARNING: oracle libraries not found. Use --with-oracle-lib-dir=." >&5 echo "$as_me: WARNING: oracle libraries not found. Use --with-oracle-lib-dir=." >&2;} fail="$fail libclntsh libnnz${oracle_version}" else sql_oracle_ldflags="${sql_oracle_ldflags} $ORACLE_LIBS" { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } fi fi targetname=rlm_sql_oracle else targetname= echo \*\*\* module rlm_sql_oracle is disabled. fi if test "x$fail" != x; then if test "x${enable_strict_dependencies}" = xyes; then { { echo "$as_me:$LINENO: error: set --without-rlm_sql_oracle to disable it explicitly." >&5 echo "$as_me: error: set --without-rlm_sql_oracle to disable it explicitly." >&2;} { (exit 1); exit 1; }; } else { echo "$as_me:$LINENO: WARNING: silently not building rlm_sql_oracle." >&5 echo "$as_me: WARNING: silently not building rlm_sql_oracle." >&2;} { echo "$as_me:$LINENO: WARNING: FAILURE: rlm_sql_oracle requires:$fail." >&5 echo "$as_me: WARNING: FAILURE: rlm_sql_oracle requires:$fail." >&2;}; targetname= fi fi ac_config_files="$ac_config_files 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_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( *) $as_unset $ac_var ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then test "x$cache_file" != "x/dev/null" && { echo "$as_me:$LINENO: updating cache $cache_file" >&5 echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 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}' # Transform confdefs.h into DEFS. # Protect against shell expansion while executing Makefile rules. # Protect against Makefile macro expansion. # # If the first sed substitution is executed (which looks for macros that # take arguments), then branch to the quote section. Otherwise, # look for a macro that doesn't take arguments. ac_script=' t clear :clear s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g t quote s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g t quote b any :quote s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g s/\[/\\&/g s/\]/\\&/g s/\$/$$/g H :any ${ g s/^\n// s/\n/ /g p } ' DEFS=`sed -n "$ac_script" confdefs.h` ac_libobjs= ac_ltlibobjs= 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=`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. ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs : ${CONFIG_STATUS=./config.status} ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >$CONFIG_STATUS <<_ACEOF #! $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} _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ## --------------------- ## ## 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=: # 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 # PATH needs CR # 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 # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false 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.) as_nl=' ' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. 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 # Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # CDPATH. $as_unset CDPATH as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, and appends # trailing '-' during substitution so that $LINENO is not a special # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # scripts with optimization help from Paolo Bonzini. 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" || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi 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 fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi 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=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 # Save the log message, to keep $[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by $as_me, which was generated by GNU Autoconf 2.61. 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 cat >>$CONFIG_STATUS <<_ACEOF # Files that config.status was made for. config_files="$ac_config_files" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit -q, --quiet 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 Configuration files: $config_files Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ config.status configured by $0, generated by GNU Autoconf 2.61, with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" Copyright (C) 2006 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' _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # If no file are specified by the user, then we need to provide default # value. By we need to know if files were specified by the user. 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=$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 ) echo "$ac_cs_version"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift CONFIG_FILES="$CONFIG_FILES $ac_optarg" ac_need_defaults=false;; --he | --h | --help | --hel | -h ) 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. -*) { echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *) ac_config_targets="$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 if \$ac_cs_recheck; then echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 CONFIG_SHELL=$SHELL export CONFIG_SHELL exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; 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 fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= trap 'exit_status=$? { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status ' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || { echo "$me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } # # Set up the sed scripts for CONFIG_FILES section. # # No need to generate the scripts if there are no CONFIG_FILES. # This happens for instance when ./config.status config.h if test -n "$CONFIG_FILES"; then _ACEOF ac_delim='%!_!# ' for ac_last_try in false false false false false :; do cat >conf$$subs.sed <<_ACEOF SHELL!$SHELL$ac_delim PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim PACKAGE_NAME!$PACKAGE_NAME$ac_delim PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim PACKAGE_STRING!$PACKAGE_STRING$ac_delim PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim exec_prefix!$exec_prefix$ac_delim prefix!$prefix$ac_delim program_transform_name!$program_transform_name$ac_delim bindir!$bindir$ac_delim sbindir!$sbindir$ac_delim libexecdir!$libexecdir$ac_delim datarootdir!$datarootdir$ac_delim datadir!$datadir$ac_delim sysconfdir!$sysconfdir$ac_delim sharedstatedir!$sharedstatedir$ac_delim localstatedir!$localstatedir$ac_delim includedir!$includedir$ac_delim oldincludedir!$oldincludedir$ac_delim docdir!$docdir$ac_delim infodir!$infodir$ac_delim htmldir!$htmldir$ac_delim dvidir!$dvidir$ac_delim pdfdir!$pdfdir$ac_delim psdir!$psdir$ac_delim libdir!$libdir$ac_delim localedir!$localedir$ac_delim mandir!$mandir$ac_delim DEFS!$DEFS$ac_delim ECHO_C!$ECHO_C$ac_delim ECHO_N!$ECHO_N$ac_delim ECHO_T!$ECHO_T$ac_delim LIBS!$LIBS$ac_delim build_alias!$build_alias$ac_delim host_alias!$host_alias$ac_delim target_alias!$target_alias$ac_delim CC!$CC$ac_delim CFLAGS!$CFLAGS$ac_delim LDFLAGS!$LDFLAGS$ac_delim CPPFLAGS!$CPPFLAGS$ac_delim ac_ct_CC!$ac_ct_CC$ac_delim EXEEXT!$EXEEXT$ac_delim OBJEXT!$OBJEXT$ac_delim sql_oracle_ldflags!$sql_oracle_ldflags$ac_delim sql_oracle_cflags!$sql_oracle_cflags$ac_delim targetname!$targetname$ac_delim LIBOBJS!$LIBOBJS$ac_delim LTLIBOBJS!$LTLIBOBJS$ac_delim _ACEOF if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 49; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` if test -n "$ac_eof"; then ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` ac_eof=`expr $ac_eof + 1` fi cat >>$CONFIG_STATUS <<_ACEOF cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof /@[a-zA-Z_][a-zA-Z_0-9]*@/!b end _ACEOF sed ' s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g s/^/s,@/; s/!/@,|#_!!_#|/ :n t n s/'"$ac_delim"'$/,g/; t s/$/\\/; p N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n ' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF :end s/|#_!!_#|//g CEOF$ac_eof _ACEOF # VPATH may cause trouble with some makes, so we remove $(srcdir), # ${srcdir} and @srcdir@ 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[ ]*=/{ s/:*\$(srcdir):*/:/ s/:*\${srcdir}:*/:/ s/:*@srcdir@:*/:/ s/^\([^=]*=[ ]*\):*/\1/ s/:*$// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF fi # test -n "$CONFIG_FILES" for ac_tag in :F $CONFIG_FILES do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5 echo "$as_me: error: Invalid tag $ac_tag." >&2;} { (exit 1); exit 1; }; };; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 echo "$as_me: error: cannot find input file: $ac_f" >&2;} { (exit 1); exit 1; }; };; esac ac_file_inputs="$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 "`IFS=: echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure." if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { echo "$as_me:$LINENO: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} fi case $ac_tag in *:-:* | *:-) cat >"$tmp/stdin";; 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 || 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" case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`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 || 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" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 echo "$as_me: error: cannot create directory $as_dir" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`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 # _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # 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= case `sed -n '/datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p ' $ac_file_inputs` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF 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 sed "$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s&@configure_input@&$configure_input&;t t s&@top_builddir@&$ac_top_builddir_sub&;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 $ac_datarootdir_hack " $ac_file_inputs | sed -f "$tmp/subs-1.sed" >$tmp/out test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&5 echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&2;} rm -f "$tmp/stdin" case $ac_file in -) cat "$tmp/out"; rm -f "$tmp/out";; *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;; esac ;; esac done # for ac_tag { (exit 0); exit 0; } _ACEOF chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save # 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 || { (exit 1); exit 1; } fi freeradius-server/src/modules/rlm_sql/drivers/rlm_sql_oracle/configure.in000066400000000000000000000111511257552170400274170ustar00rootroot00000000000000AC_INIT(sql_oracle.c) AC_REVISION($Revision: 1.10 $) AC_DEFUN(modname,[rlm_sql_oracle]) fail= sql_oracle_ldflags= sql_oracle_cflags= if test x$with_[]modname != xno; then AC_MSG_CHECKING([for oci.h]) dnl # dnl # See if the user passed in the oracle_home_dir option and dnl # use that first. If not, use $ORACLE_HOME. If that's dnl # not defined, give up. There's no point in blindly dnl # hunting around for Oracle - there's no standard place dnl # for it. Any sane Oracle user/developer should have $ORACLE_HOME dnl # defined anyways. dnl # dnl ############################################################ dnl # Check for command line options dnl ############################################################ dnl extra argument: --with-oracle-include-dir=DIR oracle_include_dir= AC_ARG_WITH(oracle-include-dir, [AS_HELP_STRING([--with-oracle-include-dir=DIR], [Directory where the Oracle includes may be found. It should be located under ORACLE_HOME if you have client SDK installed. Use --with-oracle-include-dir=yes if you are sure that your compiler include path includes Oracle include dir. Hint: you might try to do: locate oci.h])], [case "$withval" in no) AC_MSG_ERROR(Need oracle-include-dir) ;; yes) ;; *) oracle_include_dir="$withval" ;; esac]) dnl extra argument: --with-oracle-lib-dir=DIR oracle_lib_dir= AC_ARG_WITH(oracle-lib-dir, [AS_HELP_STRING([--with-oracle-lib-dir=DIR], [Directory where the oracle libraries may be found. It should be located under ORACLE_HOME. iUse --with-oracle-lib-dir=yes if you are sure that your linker will find the necessary Oracle client libs. Hint: you might try to do: locate libclntsh.so])], [case "$withval" in no) AC_MSG_ERROR(Need oracle-lib-dir) ;; yes) ;; *) oracle_lib_dir="$withval" ;; esac]) AC_TRY_COMPILE([#include ], [ int a = 1;], ORACLE_INCLUDE=" ", ORACLE_INCLUDE= ) RLM_SQL_ORA_WORKING_CFLAGS_FOR_LINKING_TEST= if test "x$ORACLE_INCLUDE" = "x" ; then old_CFLAGS="$CFLAGS" CFLAGS="$old_CFLAGS -I$oracle_include_dir" AC_TRY_COMPILE([#include ], [ int a = 1;], ORACLE_INCLUDE="-I$oracle_include_dir", ORACLE_INCLUDE= ) RLM_SQL_ORA_WORKING_CFLAGS_FOR_LINKING_TEST="$CFLAGS" CFLAGS="$old_CFLAGS" fi # Proceed to linking makes only sense if include dir is OK. if test "x$ORACLE_INCLUDE" != "x" ; then old_LIBS="$LIBS" old_CFLAGS="$CFLAGS" CFLAGS="$RLM_SQL_ORA_WORKING_CFLAGS_FOR_LINKING_TEST" ORACLE_LIBDIR_SWITCH= if test "x$oracle_lib_dir" != "x" ; then ORACLE_LIBDIR_SWITCH="-L${oracle_lib_dir} " fi for oracle_version in 10 11 9 ""; do LIBS="$old_LIBS $ORACLE_LIBDIR_SWITCH -lclntsh -lnnz${oracle_version}" AC_TRY_LINK([#include static OCIEnv *p_env; static OCIError *p_err; static OCISvcCtx *p_svc; static OCIStmt *p_sql; static OCIDefine *p_dfn = (OCIDefine *) 0; static OCIBind *p_bnd = (OCIBind *) 0; ], [ int p_bvi; char p_sli[20]; int rc; char errbuf[100]; int errcode; rc = OCIInitialize((ub4) OCI_DEFAULT, (dvoid *)0, /* Initialize OCI */ (dvoid * (*)(dvoid *, size_t)) 0, (dvoid * (*)(dvoid *, dvoid *, size_t))0, (void (*)(dvoid *, dvoid *)) 0 ); ], ORACLE_LIBS="$ORACLE_LIBDIR_SWITCH -lclntsh -lnnz${oracle_version}", ORACLE_LIBS= ) if test "x$ORACLE_LIBS" != "x"; then break fi done LIBS="$old_LIBS" CFLAGS="$old_CFLAGS" fi if test "x$ORACLE_INCLUDE" = "x"; then AC_MSG_RESULT(no) AC_MSG_WARN([oracle headers not found. Use --with-oracle-include-dir=.]) fail="$fail oci.h" else sql_oracle_cflags="${sql_oracle_cflags} ${ORACLE_INCLUDE}" AC_MSG_RESULT(yes) if test "x$ORACLE_LIBS" = "x"; then AC_MSG_WARN([oracle libraries not found. Use --with-oracle-lib-dir=.]) fail="$fail libclntsh libnnz${oracle_version}" else sql_oracle_ldflags="${sql_oracle_ldflags} $ORACLE_LIBS" AC_MSG_RESULT(yes) fi fi targetname=modname else targetname= echo \*\*\* module modname is disabled. fi dnl Don't change this section. if test "x$fail" != x; then if test "x${enable_strict_dependencies}" = xyes; then AC_MSG_ERROR([set --without-]modname[ to disable it explicitly.]) else AC_MSG_WARN([silently not building ]modname[.]) AC_MSG_WARN([FAILURE: ]modname[ requires:$fail.]); targetname= fi fi AC_SUBST(sql_oracle_ldflags) AC_SUBST(sql_oracle_cflags) AC_SUBST(targetname) AC_OUTPUT(Makefile) freeradius-server/src/modules/rlm_sql/drivers/rlm_sql_oracle/sql_oracle.c000066400000000000000000000406411257552170400274040ustar00rootroot00000000000000/* * sql_oracle.c Oracle (OCI) routines for rlm_sql * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2000,2006 The FreeRADIUS server project * Copyright 2000 David Kerry */ #include RCSID("$Id$") #include #include #include #include "rlm_sql.h" typedef struct rlm_sql_oracle_sock { OCIEnv *env; OCIError *errHandle; OCISvcCtx *conn; OCIStmt *queryHandle; sb2 *indicators; char **results; int id; int in_use; struct timeval tv; } rlm_sql_oracle_sock; #define MAX_DATASTR_LEN 64 /************************************************************************* * * Function: sql_error * * Purpose: database specific error. Returns error associated with * connection * *************************************************************************/ static const char *sql_error(SQLSOCK *sqlsocket, SQL_CONFIG *config) { static char msgbuf[512]; sb4 errcode = 0; rlm_sql_oracle_sock *oracle_sock = sqlsocket->conn; if (!oracle_sock) return "rlm_sql_oracle: no connection to db"; memset((void *) msgbuf, (int)'\0', sizeof(msgbuf)); OCIErrorGet((dvoid *) oracle_sock->errHandle, (ub4) 1, (text *) NULL, &errcode, msgbuf, (ub4) sizeof(msgbuf), (ub4) OCI_HTYPE_ERROR); if (errcode) { return msgbuf; } else { return NULL; } } /************************************************************************* * * Function: sql_check_error * * Purpose: check the error to see if the server is down * *************************************************************************/ static int sql_check_error(SQLSOCK *sqlsocket, SQL_CONFIG *config) { if (strstr(sql_error(sqlsocket, config), "ORA-03113") || strstr(sql_error(sqlsocket, config), "ORA-03114")) { radlog(L_ERR,"rlm_sql_oracle: OCI_SERVER_NOT_CONNECTED"); return SQL_DOWN; } else { radlog(L_ERR,"rlm_sql_oracle: OCI_SERVER_NORMAL"); return -1; } } /************************************************************************* * * Function: sql_close * * Purpose: database specific close. Closes an open database * connection and cleans up any open handles. * *************************************************************************/ static int sql_close(SQLSOCK *sqlsocket, SQL_CONFIG *config) { rlm_sql_oracle_sock *oracle_sock = sqlsocket->conn; if (oracle_sock->conn) { OCILogoff (oracle_sock->conn, oracle_sock->errHandle); } if (oracle_sock->queryHandle) { OCIHandleFree((dvoid *)oracle_sock->queryHandle, (ub4) OCI_HTYPE_STMT); } if (oracle_sock->errHandle) { OCIHandleFree((dvoid *)oracle_sock->errHandle, (ub4) OCI_HTYPE_ERROR); } if (oracle_sock->env) { OCIHandleFree((dvoid *)oracle_sock->env, (ub4) OCI_HTYPE_ENV); } oracle_sock->conn = NULL; free(oracle_sock); sqlsocket->conn = NULL; return 0; } /************************************************************************* * * Function: sql_init_socket * * Purpose: Establish connection to the db * *************************************************************************/ static int sql_init_socket(SQLSOCK *sqlsocket, SQL_CONFIG *config) { rlm_sql_oracle_sock *oracle_sock; if (!sqlsocket->conn) { sqlsocket->conn = (rlm_sql_oracle_sock *)rad_malloc(sizeof(rlm_sql_oracle_sock)); if (!sqlsocket->conn) { return -1; } } memset(sqlsocket->conn,0,sizeof(rlm_sql_oracle_sock)); oracle_sock = sqlsocket->conn; if (OCIEnvCreate(&oracle_sock->env, OCI_DEFAULT|OCI_THREADED, (dvoid *)0, (dvoid * (*)(dvoid *, size_t)) 0, (dvoid * (*)(dvoid *, dvoid *, size_t))0, (void (*)(dvoid *, dvoid *)) 0, 0, (dvoid **)0 )) { radlog(L_ERR,"rlm_sql_oracle: Couldn't init Oracle OCI environment (OCIEnvCreate())"); return -1; } if (OCIHandleAlloc((dvoid *) oracle_sock->env, (dvoid **) &oracle_sock->errHandle, (ub4) OCI_HTYPE_ERROR, (size_t) 0, (dvoid **) 0)) { radlog(L_ERR,"rlm_sql_oracle: Couldn't init Oracle ERROR handle (OCIHandleAlloc())"); return -1; } /* Allocate handles for select and update queries */ if (OCIHandleAlloc((dvoid *)oracle_sock->env, (dvoid **) &oracle_sock->queryHandle, (ub4)OCI_HTYPE_STMT, (CONST size_t) 0, (dvoid **) 0)) { radlog(L_ERR,"rlm_sql_oracle: Couldn't init Oracle query handles: %s", sql_error(sqlsocket, config)); return -1; } if (OCILogon(oracle_sock->env, oracle_sock->errHandle, &oracle_sock->conn, config->sql_login, strlen(config->sql_login), config->sql_password, strlen(config->sql_password), config->sql_db, strlen(config->sql_db))) { radlog(L_ERR,"rlm_sql_oracle: Oracle logon failed: '%s'", sql_error(sqlsocket, config)); sql_close(sqlsocket,config); return -1; } return 0; } /************************************************************************* * * Function: sql_destroy_socket * * Purpose: Free socket and private connection data * *************************************************************************/ static int sql_destroy_socket(SQLSOCK *sqlsocket, SQL_CONFIG *config) { free(sqlsocket->conn); sqlsocket->conn = NULL; return 0; } /************************************************************************* * * Function: sql_num_fields * * Purpose: database specific num_fields function. Returns number * of columns from query * *************************************************************************/ static int sql_num_fields(SQLSOCK *sqlsocket, SQL_CONFIG *config) { ub4 count; rlm_sql_oracle_sock *oracle_sock = sqlsocket->conn; /* get the number of columns in the select list */ if (OCIAttrGet ((dvoid *)oracle_sock->queryHandle, (ub4)OCI_HTYPE_STMT, (dvoid *) &count, (ub4 *) 0, (ub4)OCI_ATTR_PARAM_COUNT, oracle_sock->errHandle)) { radlog(L_ERR,"rlm_sql_oracle: Error retrieving column count in sql_num_fields: %s", sql_error(sqlsocket, config)); return -1; } return count; } /************************************************************************* * * Function: sql_query * * Purpose: Issue a non-SELECT query (ie: update/delete/insert) to * the database. * *************************************************************************/ static int sql_query(SQLSOCK *sqlsocket, SQL_CONFIG *config, char *querystr) { int x; rlm_sql_oracle_sock *oracle_sock = sqlsocket->conn; if (config->sqltrace) DEBUG(querystr); if (oracle_sock->conn == NULL) { radlog(L_ERR, "rlm_sql_oracle: Socket not connected"); return SQL_DOWN; } if (OCIStmtPrepare (oracle_sock->queryHandle, oracle_sock->errHandle, querystr, strlen(querystr), OCI_NTV_SYNTAX, OCI_DEFAULT)) { radlog(L_ERR,"rlm_sql_oracle: prepare failed in sql_query: %s",sql_error(sqlsocket, config)); return -1; } x = OCIStmtExecute(oracle_sock->conn, oracle_sock->queryHandle, oracle_sock->errHandle, (ub4) 1, (ub4) 0, (OCISnapshot *) NULL, (OCISnapshot *) NULL, (ub4) OCI_COMMIT_ON_SUCCESS); if (x == OCI_SUCCESS) { return 0; } if (x == OCI_ERROR) { radlog(L_ERR,"rlm_sql_oracle: execute query failed in sql_query: %s", sql_error(sqlsocket, config)); return sql_check_error(sqlsocket, config); } else { return -1; } } /************************************************************************* * * Function: sql_select_query * * Purpose: Issue a select query to the database * *************************************************************************/ static int sql_select_query(SQLSOCK *sqlsocket, SQL_CONFIG *config, char *querystr) { int x; int y; int colcount; OCIParam *param; OCIDefine *define; ub2 dtype; ub2 dsize; char **rowdata=NULL; sb2 *indicators; rlm_sql_oracle_sock *oracle_sock = sqlsocket->conn; if (config->sqltrace) DEBUG(querystr); if (oracle_sock->conn == NULL) { radlog(L_ERR, "rlm_sql_oracle: Socket not connected"); return SQL_DOWN; } if (OCIStmtPrepare (oracle_sock->queryHandle, oracle_sock->errHandle, querystr, strlen(querystr), OCI_NTV_SYNTAX, OCI_DEFAULT)) { radlog(L_ERR,"rlm_sql_oracle: prepare failed in sql_select_query: %s",sql_error(sqlsocket, config)); return -1; } /* Query only one row by default (for now) */ x = OCIStmtExecute(oracle_sock->conn, oracle_sock->queryHandle, oracle_sock->errHandle, (ub4) 0, (ub4) 0, (OCISnapshot *) NULL, (OCISnapshot *) NULL, (ub4) OCI_DEFAULT); if (x == OCI_NO_DATA) { /* Nothing to fetch */ return 0; } if (x != OCI_SUCCESS) { radlog(L_ERR,"rlm_sql_oracle: query failed in sql_select_query: %s", sql_error(sqlsocket, config)); return sql_check_error(sqlsocket, config); } /* * Define where the output from fetch calls will go * * This is a gross hack, but it works - we convert * all data to strings for ease of use. Fortunately, most * of the data we deal with is already in string format. */ colcount = sql_num_fields(sqlsocket, config); /* DEBUG2("sql_select_query(): colcount=%d",colcount); */ /* * FIXME: These malloc's can probably go, as the schema * is fixed... */ rowdata=(char **)rad_malloc(sizeof(char *) * (colcount+1) ); memset(rowdata, 0, (sizeof(char *) * (colcount+1) )); indicators = (sb2 *) rad_malloc(sizeof(sb2) * (colcount+1) ); memset(indicators, 0, sizeof(sb2) * (colcount+1)); for (y=1; y <= colcount; y++) { x=OCIParamGet(oracle_sock->queryHandle, OCI_HTYPE_STMT, oracle_sock->errHandle, (dvoid **)¶m, (ub4) y); if (x != OCI_SUCCESS) { radlog(L_ERR,"rlm_sql_oracle: OCIParamGet() failed in sql_select_query: %s", sql_error(sqlsocket, config)); return -1; } x=OCIAttrGet((dvoid*)param, OCI_DTYPE_PARAM, (dvoid*)&dtype, (ub4*)0, OCI_ATTR_DATA_TYPE, oracle_sock->errHandle); if (x != OCI_SUCCESS) { radlog(L_ERR,"rlm_sql_oracle: OCIAttrGet() failed in sql_select_query: %s", sql_error(sqlsocket, config)); return -1; } dsize=MAX_DATASTR_LEN; /* * Use the retrieved length of dname to allocate an output * buffer, and then define the output variable (but only * for char/string type columns). */ switch(dtype) { #ifdef SQLT_AFC case SQLT_AFC: /* ansii fixed char */ #endif #ifdef SQLT_AFV case SQLT_AFV: /* ansii var char */ #endif case SQLT_VCS: /* var char */ case SQLT_CHR: /* char */ case SQLT_STR: /* string */ x=OCIAttrGet((dvoid*)param, (ub4) OCI_DTYPE_PARAM, (dvoid*) &dsize, (ub4 *)0, (ub4) OCI_ATTR_DATA_SIZE, oracle_sock->errHandle); if (x != OCI_SUCCESS) { radlog(L_ERR,"rlm_sql_oracle: OCIAttrGet() failed in sql_select_query: %s", sql_error(sqlsocket, config)); return -1; } rowdata[y-1]=rad_malloc(dsize+1); memset(rowdata[y-1], 0, dsize+1); break; case SQLT_DAT: case SQLT_INT: case SQLT_UIN: case SQLT_FLT: case SQLT_PDN: case SQLT_BIN: case SQLT_NUM: rowdata[y-1]=rad_malloc(dsize+1); memset(rowdata[y-1], 0, dsize+1); break; default: dsize=0; rowdata[y-1]=NULL; break; } indicators[y-1] = 0; x=OCIDefineByPos(oracle_sock->queryHandle, &define, oracle_sock->errHandle, y, (ub1 *) rowdata[y-1], dsize+1, SQLT_STR, &indicators[y-1], (dvoid *) 0, (dvoid *) 0, OCI_DEFAULT); /* * FIXME: memory leaks of indicators & rowdata? */ if (x != OCI_SUCCESS) { radlog(L_ERR,"rlm_sql_oracle: OCIDefineByPos() failed in sql_select_query: %s", sql_error(sqlsocket, config)); return -1; } } oracle_sock->results=rowdata; oracle_sock->indicators=indicators; return 0; } /************************************************************************* * * Function: sql_store_result * * Purpose: database specific store_result function. Returns a result * set for the query. * *************************************************************************/ static int sql_store_result(SQLSOCK *sqlsocket, SQL_CONFIG *config) { /* Not needed for Oracle */ return 0; } /************************************************************************* * * Function: sql_num_rows * * Purpose: database specific num_rows. Returns number of rows in * query * *************************************************************************/ static int sql_num_rows(SQLSOCK *sqlsocket, SQL_CONFIG *config) { ub4 rows=0; rlm_sql_oracle_sock *oracle_sock = sqlsocket->conn; OCIAttrGet((CONST dvoid *)oracle_sock->queryHandle, OCI_HTYPE_STMT, (dvoid *)&rows, (ub4 *) sizeof(ub4), OCI_ATTR_ROW_COUNT, oracle_sock->errHandle); return rows; } /************************************************************************* * * Function: sql_fetch_row * * Purpose: database specific fetch_row. Returns a SQL_ROW struct * with all the data for the query in 'sqlsocket->row'. Returns * 0 on success, -1 on failure, SQL_DOWN if database is down. * *************************************************************************/ static int sql_fetch_row(SQLSOCK *sqlsocket, SQL_CONFIG *config) { int x; rlm_sql_oracle_sock *oracle_sock = sqlsocket->conn; if (oracle_sock->conn == NULL) { radlog(L_ERR, "rlm_sql_oracle: Socket not connected"); return SQL_DOWN; } sqlsocket->row = NULL; x=OCIStmtFetch(oracle_sock->queryHandle, oracle_sock->errHandle, 1, OCI_FETCH_NEXT, OCI_DEFAULT); if (x == OCI_SUCCESS) { sqlsocket->row = oracle_sock->results; return 0; } if (x == OCI_ERROR) { radlog(L_ERR,"rlm_sql_oracle: fetch failed in sql_fetch_row: %s", sql_error(sqlsocket, config)); return sql_check_error(sqlsocket, config); } else { return -1; } } /************************************************************************* * * Function: sql_free_result * * Purpose: database specific free_result. Frees memory allocated * for a result set * *************************************************************************/ static int sql_free_result(SQLSOCK *sqlsocket, SQL_CONFIG *config) { int x; int num_fields; rlm_sql_oracle_sock *oracle_sock = sqlsocket->conn; /* Cancel the cursor first */ x=OCIStmtFetch(oracle_sock->queryHandle, oracle_sock->errHandle, 0, OCI_FETCH_NEXT, OCI_DEFAULT); num_fields = sql_num_fields(sqlsocket, config); if (num_fields >= 0) { for(x=0; x < num_fields; x++) { free(oracle_sock->results[x]); } free(oracle_sock->results); free(oracle_sock->indicators); } oracle_sock->results=NULL; return 0; } /************************************************************************* * * Function: sql_finish_query * * Purpose: End the query, such as freeing memory * *************************************************************************/ static int sql_finish_query(SQLSOCK *sqlsocket, SQL_CONFIG *config) { return 0; } /************************************************************************* * * Function: sql_finish_select_query * * Purpose: End the select query, such as freeing memory or result * *************************************************************************/ static int sql_finish_select_query(SQLSOCK *sqlsocket, SQL_CONFIG *config) { int x=0; rlm_sql_oracle_sock *oracle_sock = sqlsocket->conn; if (oracle_sock->results) { while(oracle_sock->results[x]) free(oracle_sock->results[x++]); free(oracle_sock->results); free(oracle_sock->indicators); oracle_sock->results=NULL; } return 0; } /************************************************************************* * * Function: sql_affected_rows * * Purpose: Return the number of rows affected by the query (update, * or insert) * *************************************************************************/ static int sql_affected_rows(SQLSOCK *sqlsocket, SQL_CONFIG *config) { return sql_num_rows(sqlsocket, config); } /* Exported to rlm_sql */ rlm_sql_module_t rlm_sql_oracle = { "rlm_sql_oracle", sql_init_socket, sql_destroy_socket, sql_query, sql_select_query, sql_store_result, sql_num_fields, sql_num_rows, sql_fetch_row, sql_free_result, sql_error, sql_close, sql_finish_query, sql_finish_select_query, sql_affected_rows }; freeradius-server/src/modules/rlm_sql/drivers/rlm_sql_postgresql/000077500000000000000000000000001257552170400260455ustar00rootroot00000000000000freeradius-server/src/modules/rlm_sql/drivers/rlm_sql_postgresql/.gitignore000066400000000000000000000000111257552170400300250ustar00rootroot00000000000000Makefile freeradius-server/src/modules/rlm_sql/drivers/rlm_sql_postgresql/Makefile.in000066400000000000000000000002601257552170400301100ustar00rootroot00000000000000include ../../../../../Make.inc TARGET = @targetname@ SRCS = sql_postgresql.c RLM_SQL_CFLAGS = @postgresql_cflags@ RLM_SQL_LIBS = @postgresql_ldflags@ include ../rules.mak freeradius-server/src/modules/rlm_sql/drivers/rlm_sql_postgresql/configure000077500000000000000000003322011257552170400277550ustar00rootroot00000000000000#! /bin/sh # From configure.in Revision. # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.61. # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, # 2002, 2003, 2004, 2005, 2006 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=: # 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 # PATH needs CR # 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 # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false 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.) as_nl=' ' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. 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 # Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # CDPATH. $as_unset CDPATH if test "x$CONFIG_SHELL" = x; then if (eval ":") 2>/dev/null; then as_have_required=yes else as_have_required=no fi if test $as_have_required = yes && (eval ": (as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=\$LINENO as_lineno_2=\$LINENO test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } ") 2> /dev/null; then : else as_candidate_shells= as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. case $as_dir in /*) for as_base in sh bash ksh sh5; do as_candidate_shells="$as_candidate_shells $as_dir/$as_base" done;; esac done IFS=$as_save_IFS for as_shell in $as_candidate_shells $SHELL; do # Try only shells that exist, to save several forks. if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { ("$as_shell") 2> /dev/null <<\_ASEOF 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 : _ASEOF }; then CONFIG_SHELL=$as_shell as_have_required=yes if { "$as_shell" 2> /dev/null <<\_ASEOF 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 : (as_func_return () { (exit $1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = "$1" ); then : else exitcode=1 echo positional parameters were not saved. fi test $exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } _ASEOF }; then break fi fi done if test "x$CONFIG_SHELL" != x; then for as_var in BASH_ENV ENV do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done export CONFIG_SHELL exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} fi if test $as_have_required = no; then echo This script requires a shell more modern than all the echo shells that I found on your system. Please install a echo modern shell, or manually run the script under such a echo shell if you do have one. { (exit 1); exit 1; } fi fi fi (eval "as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0") || { echo No shell found that supports shell functions. echo Please tell autoconf@gnu.org about your system, echo including any error possibly output before this echo message } as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, and appends # trailing '-' during substitution so that $LINENO is not a special # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # scripts with optimization help from Paolo Bonzini. 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" || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi 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 fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi 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=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, 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= SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME= PACKAGE_TARNAME= PACKAGE_VERSION= PACKAGE_STRING= PACKAGE_BUGREPORT= ac_unique_file="sql_postgresql.c" ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datarootdir datadir sysconfdir sharedstatedir localstatedir includedir oldincludedir docdir infodir htmldir dvidir pdfdir psdir libdir localedir mandir DEFS ECHO_C ECHO_N ECHO_T LIBS build_alias host_alias target_alias CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT postgresql_ldflags postgresql_cflags targetname LIBOBJS LTLIBOBJS' ac_subst_files='' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS' # Initialize some variables set by options. ac_init_help= ac_init_version=false # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *) ac_optarg=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_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` eval enable_$ac_feature=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_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` eval enable_$ac_feature=\$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_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/[-.]/_/g'` eval with_$ac_package=\$ac_optarg ;; -without-* | --without-*) ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/[-.]/_/g'` eval with_$ac_package=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 ;; -*) { echo "$as_me: error: unrecognized option: $ac_option Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && 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'` { echo "$as_me: error: missing argument to $ac_option" >&2 { (exit 1); exit 1; }; } fi # Be sure to have absolute directory names. 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 case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; } 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 echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || { echo "$as_me: error: Working directory cannot be determined" >&2 { (exit 1); exit 1; }; } test "X$ac_ls_di" = "X$ac_pwd_ls_di" || { echo "$as_me: error: pwd does not report name of working directory" >&2 { (exit 1); exit 1; }; } # 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 -- "$0" || $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$0" : 'X\(//\)[^/]' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X"$0" | 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 .." { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2 { (exit 1); exit 1; }; } pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures this package to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF _ACEOF fi if test -n "$ac_init_help"; then cat <<\_ACEOF Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-rlm-sql-postgresql-lib-dir=DIR Directory for PostgreSQL library files --with-rlm-sql-postgresql-include-dir=DIR Directory for PostgreSQL include files 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 C/C++/Objective C preprocessor flags, e.g. -I if you have headers in a nonstandard directory Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. _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" || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`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 echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF configure generated by GNU Autoconf 2.61 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 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 cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by $as_me, which was generated by GNU Autoconf 2.61. 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=. 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=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; 2) ac_configure_args1="$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 ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac done done $as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } $as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export 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 cat <<\_ASBOX ## ---------------- ## ## Cache variables. ## ## ---------------- ## _ASBOX 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_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( *) $as_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 cat <<\_ASBOX ## ----------------- ## ## Output variables. ## ## ----------------- ## _ASBOX echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then cat <<\_ASBOX ## ------------------- ## ## File substitutions. ## ## ------------------- ## _ASBOX echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then cat <<\_ASBOX ## ----------- ## ## confdefs.h. ## ## ----------- ## _ASBOX echo cat confdefs.h echo fi test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" 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'; { (exit 1); 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 # 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 # Let the site file select an alternate cache file if it wants to. # Prefer explicitly selected file to automatically selected ones. if test -n "$CONFIG_SITE"; then set x "$CONFIG_SITE" elif test "x$prefix" != xNONE; then set x "$prefix/share/config.site" "$prefix/etc/config.site" else set x "$ac_default_prefix/share/config.site" \ "$ac_default_prefix/etc/config.site" fi shift for ac_site_file do if test -r "$ac_site_file"; then { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" 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. if test -f "$cache_file"; then { echo "$as_me:$LINENO: loading cache $cache_file" >&5 echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { echo "$as_me:$LINENO: creating cache $cache_file" >&5 echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 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 { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 echo "$as_me: former value: $ac_old_val" >&2;} { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 echo "$as_me: current value: $ac_new_val" >&2;} ac_cache_corrupted=: fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`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. *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 echo "$as_me: error: changes in the environment can compromise the build" >&2;} { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} { (exit 1); exit 1; }; } 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 fail= SMART_LIBS= SMART_CLFAGS= if test x$with_rlm_sql_postgresql != xno; then 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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}gcc" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="gcc" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}cc" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="$ac_prog" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&5 echo "$as_me: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } # Provide some information about the compiler. echo "$as_me:$LINENO: checking for C compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (ac_try="$ac_compiler --version >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -v >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -V >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out 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. { echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6; } ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # # List of possible output files, starting from the most likely. # The algorithm is not robust to junk in `.', hence go to wildcards (a.*) # only as a last resort. b.out is created by i960 compilers. ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out' # # The IRIX 6 linker writes into existing files which may not be # executable, retaining their permissions. Remove them first so a # subsequent execution test works. ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link_default") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; 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 | *.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 { echo "$as_me:$LINENO: result: $ac_file" >&5 echo "${ECHO_T}$ac_file" >&6; } if test -z "$ac_file"; then echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: C compiler cannot create executables See \`config.log' for more details." >&5 echo "$as_me: error: C compiler cannot create executables See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } fi ac_exeext=$ac_cv_exeext # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { echo "$as_me:$LINENO: checking whether the C compiler works" >&5 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6; } # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then if { ac_try='./$ac_file' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { echo "$as_me:$LINENO: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&5 echo "$as_me: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi fi fi { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } rm -f a.out a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; } { echo "$as_me:$LINENO: result: $cross_compiling" >&5 echo "${ECHO_T}$cross_compiling" >&6; } { echo "$as_me:$LINENO: checking for suffix of executables" >&5 echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; } if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; 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 | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest$ac_cv_exeext { echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 echo "${ECHO_T}$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT { echo "$as_me:$LINENO: checking for suffix of object files" >&5 echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; } if test "${ac_cv_objext+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; 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 ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 echo "${ECHO_T}$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; } if test "${ac_cv_c_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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 { echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; } GCC=`test $ac_compiler_gnu = yes && echo yes` ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CFLAGS="" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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 { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 echo "${ECHO_T}$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 { echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_c89+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_c89=$ac_arg else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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) { echo "$as_me:$LINENO: result: none needed" >&5 echo "${ECHO_T}none needed" >&6; } ;; xno) { echo "$as_me:$LINENO: result: unsupported" >&5 echo "${ECHO_T}unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;; 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 rlm_sql_postgresql_lib_dir= # Check whether --with-rlm-sql-postgresql-lib-dir was given. if test "${with_rlm_sql_postgresql_lib_dir+set}" = set; then withval=$with_rlm_sql_postgresql_lib_dir; case "$withval" in no) { { echo "$as_me:$LINENO: error: Need rlm-sql-postgresql-lib-dir" >&5 echo "$as_me: error: Need rlm-sql-postgresql-lib-dir" >&2;} { (exit 1); exit 1; }; } ;; yes) ;; *) rlm_sql_postgresql_lib_dir="$withval" ;; esac fi rlm_sql_postgresql_include_dir= # Check whether --with-rlm-sql-postgresql-include-dir was given. if test "${with_rlm_sql_postgresql_include_dir+set}" = set; then withval=$with_rlm_sql_postgresql_include_dir; case "$withval" in no) { { echo "$as_me:$LINENO: error: Need rlm-sql-postgresql-include-dir" >&5 echo "$as_me: error: Need rlm-sql-postgresql-include-dir" >&2;} { (exit 1); exit 1; }; } ;; yes) ;; *) rlm_sql_postgresql_include_dir="$withval" ;; esac fi smart_try_dir="$rlm_sql_postgresql_include_dir /usr/include/postgresql /usr/local/pgsql/include /usr/include/pgsql" ac_safe=`echo "libpq-fe.h" | sed 'y%./+-%__pm%'` { echo "$as_me:$LINENO: checking for libpq-fe.h" >&5 echo $ECHO_N "checking for libpq-fe.h... $ECHO_C" >&6; } old_CFLAGS="$CFLAGS" smart_include= smart_include_dir= if test "x$smart_try_dir" != "x"; then for try in $smart_try_dir; do CFLAGS="$old_CFLAGS -I$try" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { int a = 1; ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then smart_include="-I$try" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 smart_include= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test "x$smart_include" != "x"; then break; fi done CFLAGS="$old_CFLAGS" fi if test "x$smart_include" = "x"; then cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { int a = 1; ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then smart_include=" " else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 smart_include= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test "x$smart_include" = "x"; then if test "x$LOCATE" != "x"; then DIRS= file=libpq-fe.h for x in `${LOCATE} $file 2>/dev/null`; do base=`echo $x | sed "s%/${file}%%"` if test "x$x" = "x$base"; then continue; fi dir=`${DIRNAME} $x 2>/dev/null` exclude=`echo ${dir} | ${GREP} /home` if test "x$exclude" != "x"; then continue fi already=`echo \$smart_include_dir ${DIRS} | ${GREP} ${dir}` if test "x$already" = "x"; then DIRS="$DIRS $dir" fi done fi eval "smart_include_dir=\"\$smart_include_dir $DIRS\"" for try in $smart_include_dir /usr/local/include /opt/include; do CFLAGS="$old_CFLAGS -I$try" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { int a = 1; ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then smart_include="-I$try" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 smart_include= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test "x$smart_include" != "x"; then break; fi done CFLAGS="$old_CFLAGS" fi if test "x$smart_include" != "x"; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } eval "ac_cv_header_$ac_safe=yes" CFLAGS="$old_CFLAGS $smart_include" SMART_CFLAGS="$SMART_CFLAGS $smart_include" else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_cv_header_libpqmfe_h" != "xyes"; then fail="$fail libpq-fe.h" fi smart_try_dir="$rlm_sql_postgresql_lib_dir /usr/lib /usr/local/pgsql/lib" sm_lib_safe=`echo "pq" | sed 'y%./+-%__p_%'` sm_func_safe=`echo "PQconnectdb" | sed 'y%./+-%__p_%'` { echo "$as_me:$LINENO: checking for PQconnectdb in -lpq" >&5 echo $ECHO_N "checking for PQconnectdb in -lpq... $ECHO_C" >&6; } old_LIBS="$LIBS" smart_lib= smart_lib_dir= if test "x$smart_try_dir" != "x"; then for try in $smart_try_dir; do LIBS="-L$try -lpq $old_LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ extern char PQconnectdb(); int main () { PQconnectdb() ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then smart_lib="-L$try -lpq" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test "x$smart_lib" != "x"; then break; fi done LIBS="$old_LIBS" fi if test "x$smart_lib" = "x"; then LIBS="-lpq $old_LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ extern char PQconnectdb(); int main () { PQconnectdb() ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then smart_lib="-lpq" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS="$old_LIBS" fi if test "x$smart_lib" = "x"; then if test "x$LOCATE" != "x"; then DIRS= file=libpq${libltdl_cv_shlibext} for x in `${LOCATE} $file 2>/dev/null`; do base=`echo $x | sed "s%/${file}%%"` if test "x$x" = "x$base"; then continue; fi dir=`${DIRNAME} $x 2>/dev/null` exclude=`echo ${dir} | ${GREP} /home` if test "x$exclude" != "x"; then continue fi already=`echo \$smart_lib_dir ${DIRS} | ${GREP} ${dir}` if test "x$already" = "x"; then DIRS="$DIRS $dir" fi done fi eval "smart_lib_dir=\"\$smart_lib_dir $DIRS\"" if test "x$LOCATE" != "x"; then DIRS= file=libpq.a for x in `${LOCATE} $file 2>/dev/null`; do base=`echo $x | sed "s%/${file}%%"` if test "x$x" = "x$base"; then continue; fi dir=`${DIRNAME} $x 2>/dev/null` exclude=`echo ${dir} | ${GREP} /home` if test "x$exclude" != "x"; then continue fi already=`echo \$smart_lib_dir ${DIRS} | ${GREP} ${dir}` if test "x$already" = "x"; then DIRS="$DIRS $dir" fi done fi eval "smart_lib_dir=\"\$smart_lib_dir $DIRS\"" for try in $smart_lib_dir /usr/local/lib /opt/lib; do LIBS="-L$try -lpq $old_LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ extern char PQconnectdb(); int main () { PQconnectdb() ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then smart_lib="-L$try -lpq" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test "x$smart_lib" != "x"; then break; fi done LIBS="$old_LIBS" fi if test "x$smart_lib" != "x"; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } eval "ac_cv_lib_${sm_lib_safe}_${sm_func_safe}=yes" LIBS="$smart_lib $old_LIBS" SMART_LIBS="$smart_lib $SMART_LIBS" else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_cv_lib_pq_PQconnectdb" != "xyes"; then fail="$fail libpq" fi targetname=rlm_sql_postgresql else targetname= echo \*\*\* module rlm_sql_postgresql is disabled. fi if test x"$fail" != x""; then if test x"${enable_strict_dependencies}" = x"yes"; then { { echo "$as_me:$LINENO: error: set --without-rlm_sql_postgresql to disable it explicitly." >&5 echo "$as_me: error: set --without-rlm_sql_postgresql to disable it explicitly." >&2;} { (exit 1); exit 1; }; } else { echo "$as_me:$LINENO: WARNING: silently not building rlm_sql_postgresql." >&5 echo "$as_me: WARNING: silently not building rlm_sql_postgresql." >&2;} { echo "$as_me:$LINENO: WARNING: FAILURE: rlm_sql_postgresql requires: $fail." >&5 echo "$as_me: WARNING: FAILURE: rlm_sql_postgresql requires: $fail." >&2;} if test x"$headersuggestion" != x; then { echo "$as_me:$LINENO: WARNING: $headersuggestion" >&5 echo "$as_me: WARNING: $headersuggestion" >&2;} fi if test x"$libsuggestion" != x; then { echo "$as_me:$LINENO: WARNING: $libsuggestion" >&5 echo "$as_me: WARNING: $libsuggestion" >&2;} fi targetname="" fi fi postgresql_ldflags=$SMART_LIBS postgresql_cflags=$SMART_CFLAGS unset ac_cv_env_LIBS_set unset ac_cv_env_LIBS_value ac_config_files="$ac_config_files 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_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( *) $as_unset $ac_var ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then test "x$cache_file" != "x/dev/null" && { echo "$as_me:$LINENO: updating cache $cache_file" >&5 echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 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}' # Transform confdefs.h into DEFS. # Protect against shell expansion while executing Makefile rules. # Protect against Makefile macro expansion. # # If the first sed substitution is executed (which looks for macros that # take arguments), then branch to the quote section. Otherwise, # look for a macro that doesn't take arguments. ac_script=' t clear :clear s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g t quote s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g t quote b any :quote s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g s/\[/\\&/g s/\]/\\&/g s/\$/$$/g H :any ${ g s/^\n// s/\n/ /g p } ' DEFS=`sed -n "$ac_script" confdefs.h` ac_libobjs= ac_ltlibobjs= 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=`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. ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs : ${CONFIG_STATUS=./config.status} ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >$CONFIG_STATUS <<_ACEOF #! $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} _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ## --------------------- ## ## 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=: # 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 # PATH needs CR # 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 # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false 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.) as_nl=' ' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. 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 # Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # CDPATH. $as_unset CDPATH as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, and appends # trailing '-' during substitution so that $LINENO is not a special # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # scripts with optimization help from Paolo Bonzini. 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" || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi 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 fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi 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=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 # Save the log message, to keep $[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by $as_me, which was generated by GNU Autoconf 2.61. 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 cat >>$CONFIG_STATUS <<_ACEOF # Files that config.status was made for. config_files="$ac_config_files" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit -q, --quiet 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 Configuration files: $config_files Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ config.status configured by $0, generated by GNU Autoconf 2.61, with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" Copyright (C) 2006 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' _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # If no file are specified by the user, then we need to provide default # value. By we need to know if files were specified by the user. 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=$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 ) echo "$ac_cs_version"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift CONFIG_FILES="$CONFIG_FILES $ac_optarg" ac_need_defaults=false;; --he | --h | --help | --hel | -h ) 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. -*) { echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *) ac_config_targets="$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 if \$ac_cs_recheck; then echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 CONFIG_SHELL=$SHELL export CONFIG_SHELL exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; 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 fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= trap 'exit_status=$? { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status ' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || { echo "$me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } # # Set up the sed scripts for CONFIG_FILES section. # # No need to generate the scripts if there are no CONFIG_FILES. # This happens for instance when ./config.status config.h if test -n "$CONFIG_FILES"; then _ACEOF ac_delim='%!_!# ' for ac_last_try in false false false false false :; do cat >conf$$subs.sed <<_ACEOF SHELL!$SHELL$ac_delim PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim PACKAGE_NAME!$PACKAGE_NAME$ac_delim PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim PACKAGE_STRING!$PACKAGE_STRING$ac_delim PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim exec_prefix!$exec_prefix$ac_delim prefix!$prefix$ac_delim program_transform_name!$program_transform_name$ac_delim bindir!$bindir$ac_delim sbindir!$sbindir$ac_delim libexecdir!$libexecdir$ac_delim datarootdir!$datarootdir$ac_delim datadir!$datadir$ac_delim sysconfdir!$sysconfdir$ac_delim sharedstatedir!$sharedstatedir$ac_delim localstatedir!$localstatedir$ac_delim includedir!$includedir$ac_delim oldincludedir!$oldincludedir$ac_delim docdir!$docdir$ac_delim infodir!$infodir$ac_delim htmldir!$htmldir$ac_delim dvidir!$dvidir$ac_delim pdfdir!$pdfdir$ac_delim psdir!$psdir$ac_delim libdir!$libdir$ac_delim localedir!$localedir$ac_delim mandir!$mandir$ac_delim DEFS!$DEFS$ac_delim ECHO_C!$ECHO_C$ac_delim ECHO_N!$ECHO_N$ac_delim ECHO_T!$ECHO_T$ac_delim LIBS!$LIBS$ac_delim build_alias!$build_alias$ac_delim host_alias!$host_alias$ac_delim target_alias!$target_alias$ac_delim CC!$CC$ac_delim CFLAGS!$CFLAGS$ac_delim LDFLAGS!$LDFLAGS$ac_delim CPPFLAGS!$CPPFLAGS$ac_delim ac_ct_CC!$ac_ct_CC$ac_delim EXEEXT!$EXEEXT$ac_delim OBJEXT!$OBJEXT$ac_delim postgresql_ldflags!$postgresql_ldflags$ac_delim postgresql_cflags!$postgresql_cflags$ac_delim targetname!$targetname$ac_delim LIBOBJS!$LIBOBJS$ac_delim LTLIBOBJS!$LTLIBOBJS$ac_delim _ACEOF if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 49; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` if test -n "$ac_eof"; then ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` ac_eof=`expr $ac_eof + 1` fi cat >>$CONFIG_STATUS <<_ACEOF cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof /@[a-zA-Z_][a-zA-Z_0-9]*@/!b end _ACEOF sed ' s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g s/^/s,@/; s/!/@,|#_!!_#|/ :n t n s/'"$ac_delim"'$/,g/; t s/$/\\/; p N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n ' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF :end s/|#_!!_#|//g CEOF$ac_eof _ACEOF # VPATH may cause trouble with some makes, so we remove $(srcdir), # ${srcdir} and @srcdir@ 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[ ]*=/{ s/:*\$(srcdir):*/:/ s/:*\${srcdir}:*/:/ s/:*@srcdir@:*/:/ s/^\([^=]*=[ ]*\):*/\1/ s/:*$// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF fi # test -n "$CONFIG_FILES" for ac_tag in :F $CONFIG_FILES do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5 echo "$as_me: error: Invalid tag $ac_tag." >&2;} { (exit 1); exit 1; }; };; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 echo "$as_me: error: cannot find input file: $ac_f" >&2;} { (exit 1); exit 1; }; };; esac ac_file_inputs="$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 "`IFS=: echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure." if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { echo "$as_me:$LINENO: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} fi case $ac_tag in *:-:* | *:-) cat >"$tmp/stdin";; 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 || 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" case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`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 || 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" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 echo "$as_me: error: cannot create directory $as_dir" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`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 # _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # 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= case `sed -n '/datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p ' $ac_file_inputs` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF 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 sed "$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s&@configure_input@&$configure_input&;t t s&@top_builddir@&$ac_top_builddir_sub&;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 $ac_datarootdir_hack " $ac_file_inputs | sed -f "$tmp/subs-1.sed" >$tmp/out test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&5 echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&2;} rm -f "$tmp/stdin" case $ac_file in -) cat "$tmp/out"; rm -f "$tmp/out";; *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;; esac ;; esac done # for ac_tag { (exit 0); exit 0; } _ACEOF chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save # 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 || { (exit 1); exit 1; } fi freeradius-server/src/modules/rlm_sql/drivers/rlm_sql_postgresql/configure.in000066400000000000000000000040611257552170400303570ustar00rootroot00000000000000AC_INIT(sql_postgresql.c) AC_REVISION($Revision$) AC_DEFUN(modname,[rlm_sql_postgresql]) fail= SMART_LIBS= SMART_CLFAGS= if test x$with_[]modname != xno; then AC_PROG_CC dnl extra argument: --with-rlm-sql-postgresql-lib-dir rlm_sql_postgresql_lib_dir= AC_ARG_WITH(rlm-sql-postgresql-lib-dir, [ --with-rlm-sql-postgresql-lib-dir=DIR Directory for PostgreSQL library files []], [ case "$withval" in no) AC_MSG_ERROR(Need rlm-sql-postgresql-lib-dir) ;; yes) ;; *) rlm_sql_postgresql_lib_dir="$withval" ;; esac ] ) dnl extra argument: --with-rlm-sql-postgresql-include-dir rlm_sql_postgresql_include_dir= AC_ARG_WITH(rlm-sql-postgresql-include-dir, [ --with-rlm-sql-postgresql-include-dir=DIR Directory for PostgreSQL include files []], [ case "$withval" in no) AC_MSG_ERROR(Need rlm-sql-postgresql-include-dir) ;; yes) ;; *) rlm_sql_postgresql_include_dir="$withval" ;; esac ] ) smart_try_dir="$rlm_sql_postgresql_include_dir /usr/include/postgresql /usr/local/pgsql/include /usr/include/pgsql" FR_SMART_CHECK_INCLUDE(libpq-fe.h) if test "x$ac_cv_header_libpqmfe_h" != "xyes"; then fail="$fail libpq-fe.h" fi smart_try_dir="$rlm_sql_postgresql_lib_dir /usr/lib /usr/local/pgsql/lib" FR_SMART_CHECK_LIB(pq, PQconnectdb) if test "x$ac_cv_lib_pq_PQconnectdb" != "xyes"; then fail="$fail libpq" fi targetname=modname else targetname= echo \*\*\* module modname is disabled. fi if test x"$fail" != x""; then if test x"${enable_strict_dependencies}" = x"yes"; then AC_MSG_ERROR([set --without-]modname[ to disable it explicitly.]) else AC_MSG_WARN([silently not building ]modname[.]) AC_MSG_WARN([FAILURE: ]modname[ requires: $fail.]) if test x"$headersuggestion" != x; then AC_MSG_WARN([$headersuggestion]) fi if test x"$libsuggestion" != x; then AC_MSG_WARN([$libsuggestion]) fi targetname="" fi fi postgresql_ldflags=$SMART_LIBS postgresql_cflags=$SMART_CFLAGS AC_SUBST(postgresql_ldflags) AC_SUBST(postgresql_cflags) AC_SUBST(targetname) AC_OUTPUT(Makefile) freeradius-server/src/modules/rlm_sql/drivers/rlm_sql_postgresql/sql_postgresql.c000066400000000000000000000350131257552170400312750ustar00rootroot00000000000000/* * sql_postgresql.c Postgresql rlm_sql driver * * Version: $Id$ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2000,2006 The FreeRADIUS server project * Copyright 2000 Mike Machado * Copyright 2000 Alan DeKok */ /* * April 2001: * * Use blocking queries and delete unused functions. In * rlm_sql_postgresql replace all functions that are not really used * with the not_implemented function. * * Add a new field to the rlm_sql_postgres_sock struct to store the * number of rows affected by a query because the sql module calls * finish_query before it retrieves the number of affected rows from the * driver * * Bernhard Herzog */ #include RCSID("$Id$") #include #include #include #include "rlm_sql.h" #include "sql_postgresql.h" typedef struct rlm_sql_postgres_sock { PGconn *conn; PGresult *result; int cur_row; int num_fields; int affected_rows; char **row; } rlm_sql_postgres_sock; /* Prototypes */ static int sql_close(SQLSOCK *sqlsocket, SQL_CONFIG *config); /* Internal function. Return true if the postgresql status value * indicates successful completion of the query. Return false otherwise static int status_is_ok(ExecStatusType status) { return status == PGRES_COMMAND_OK || status == PGRES_TUPLES_OK; } */ /* Internal function. Return the number of affected rows of the result * as an int instead of the string that postgresql provides */ static int affected_rows(PGresult * result) { return atoi(PQcmdTuples(result)); } /* Internal function. Free the row of the current result that's stored * in the pg_sock struct. */ static void free_result_row(rlm_sql_postgres_sock * pg_sock) { int i; if (pg_sock->row != NULL) { for (i = pg_sock->num_fields-1; i >= 0; i--) { if (pg_sock->row[i] != NULL) { free(pg_sock->row[i]); } } free((char*)pg_sock->row); pg_sock->row = NULL; pg_sock->num_fields = 0; } } /************************************************************************* * Function: check_fatal_error * * Purpose: Check error type and behave accordingly * *************************************************************************/ static int check_fatal_error (char *errorcode) { int x = 0; /* Check the error code to see if we should reconnect or not Error Code table taken from http://www.postgresql.org/docs/8.1/interactive/errcodes-appendix.html */ if (!errorcode) return -1; while(errorcodes[x].errorcode != NULL){ if (strcmp(errorcodes[x].errorcode, errorcode) == 0){ radlog(L_DBG, "rlm_sql_postgresql: Postgresql Fatal Error: [%s: %s] Occurred!!", errorcode, errorcodes[x].meaning); if (errorcodes[x].shouldreconnect == 1) return SQL_DOWN; else return -1; } x++; } radlog(L_DBG, "rlm_sql_postgresql: Postgresql Fatal Error: [%s] Occurred!!", errorcode); /* We don't seem to have a matching error class/code */ return -1; } /************************************************************************* * * Function: sql_create_socket * * Purpose: Establish connection to the db * *************************************************************************/ static int sql_init_socket(SQLSOCK *sqlsocket, SQL_CONFIG *config) { char connstring[2048]; const char *port, *host; rlm_sql_postgres_sock *pg_sock; #ifdef HAVE_OPENSSL_CRYPTO_H static int ssl_init = 0; if (!ssl_init) { PQinitSSL(0); ssl_init = 1; } #endif if (config->sql_server[0] != '\0') { host = " host="; } else { host = ""; } if (config->sql_port[0] != '\0') { port = " port="; } else { port = ""; } if (!sqlsocket->conn) { sqlsocket->conn = (rlm_sql_postgres_sock *)rad_malloc(sizeof(rlm_sql_postgres_sock)); if (!sqlsocket->conn) { return -1; } } pg_sock = sqlsocket->conn; memset(pg_sock, 0, sizeof(*pg_sock)); snprintf(connstring, sizeof(connstring), "dbname=%s%s%s%s%s user=%s password=%s", config->sql_db, host, config->sql_server, port, config->sql_port, config->sql_login, config->sql_password); pg_sock->row=NULL; pg_sock->result=NULL; pg_sock->conn=PQconnectdb(connstring); if (PQstatus(pg_sock->conn) != CONNECTION_OK) { radlog(L_ERR, "rlm_sql_postgresql: Couldn't connect socket to PostgreSQL server %s@%s:%s", config->sql_login, config->sql_server, config->sql_db); /*radlog(L_ERR, "rlm_sql_postgresql: Postgresql error '%s'", PQerrorMessage(pg_sock->conn));*/ sql_close(sqlsocket, config); return SQL_DOWN; } return 0; } /************************************************************************* * * Function: sql_query * * Purpose: Issue a query to the database * *************************************************************************/ static int sql_query(SQLSOCK * sqlsocket, SQL_CONFIG *config, char *querystr) { rlm_sql_postgres_sock *pg_sock = sqlsocket->conn; int numfields = 0; char *errorcode; char *errormsg; if (config->sqltrace) radlog(L_DBG,"rlm_sql_postgresql: query:\n%s", querystr); if (pg_sock->conn == NULL) { radlog(L_ERR, "rlm_sql_postgresql: Socket not connected"); return SQL_DOWN; } pg_sock->result = PQexec(pg_sock->conn, querystr); /* * Returns a PGresult pointer or possibly a null pointer. * A non-null pointer will generally be returned except in * out-of-memory conditions or serious errors such as inability * to send the command to the server. If a null pointer is * returned, it should be treated like a PGRES_FATAL_ERROR * result. */ if (!pg_sock->result) { radlog(L_ERR, "rlm_sql_postgresql: PostgreSQL Query failed Error: %s", PQerrorMessage(pg_sock->conn)); /* As this error COULD be a connection error OR an out-of-memory * condition return value WILL be wrong SOME of the time regardless! * Pick your poison.... */ return SQL_DOWN; } else { ExecStatusType status = PQresultStatus(pg_sock->result); radlog(L_DBG, "rlm_sql_postgresql: Status: %s", PQresStatus(status)); switch (status){ case PGRES_COMMAND_OK: /*Successful completion of a command returning no data.*/ /*affected_rows function only returns the number of affected rows of a command returning no data... */ pg_sock->affected_rows = affected_rows(pg_sock->result); radlog(L_DBG, "rlm_sql_postgresql: query affected rows = %i", pg_sock->affected_rows); return 0; break; case PGRES_TUPLES_OK: /*Successful completion of a command returning data (such as a SELECT or SHOW).*/ pg_sock->cur_row = 0; pg_sock->affected_rows = PQntuples(pg_sock->result); numfields = PQnfields(pg_sock->result); /*Check row storing functions..*/ radlog(L_DBG, "rlm_sql_postgresql: query affected rows = %i , fields = %i", pg_sock->affected_rows, numfields); return 0; break; case PGRES_BAD_RESPONSE: /*The server's response was not understood.*/ radlog(L_DBG, "rlm_sql_postgresql: Bad Response From Server!!"); return -1; break; case PGRES_NONFATAL_ERROR: /*A nonfatal error (a notice or warning) occurred. Possibly never returns*/ return -1; break; case PGRES_FATAL_ERROR: #if defined(PG_DIAG_SQLSTATE) && defined(PG_DIAG_MESSAGE_PRIMARY) /*A fatal error occurred.*/ errorcode = PQresultErrorField(pg_sock->result, PG_DIAG_SQLSTATE); errormsg = PQresultErrorField(pg_sock->result, PG_DIAG_MESSAGE_PRIMARY); radlog(L_DBG, "rlm_sql_postgresql: Error %s", errormsg); return check_fatal_error(errorcode); #endif break; default: /* FIXME: An unhandled error occurred.*/ /* PGRES_EMPTY_QUERY PGRES_COPY_OUT PGRES_COPY_IN */ return -1; break; } /* Note to self ... sql_store_result returns 0 anyway after setting the sqlsocket->affected_rows.. sql_num_fields returns 0 at worst case which means the check below has a really small chance to return false.. lets remove it then .. yuck!! */ /* } else { if ((sql_store_result(sqlsocket, config) == 0) && (sql_num_fields(sqlsocket, config) >= 0)) return 0; else return -1; } */ } return -1; } /************************************************************************* * * Function: sql_select_query * * Purpose: Issue a select query to the database * *************************************************************************/ static int sql_select_query(SQLSOCK * sqlsocket, SQL_CONFIG *config, char *querystr) { return sql_query(sqlsocket, config, querystr); } /************************************************************************* * * Function: sql_destroy_socket * * Purpose: Free socket and private connection data * *************************************************************************/ static int sql_destroy_socket(SQLSOCK *sqlsocket, UNUSED SQL_CONFIG *config) { free(sqlsocket->conn); sqlsocket->conn = NULL; return 0; } /************************************************************************* * * Function: sql_fetch_row * * Purpose: database specific fetch_row. Returns a SQL_ROW struct * with all the data for the query in 'sqlsocket->row'. Returns * 0 on success, -1 on failure, SQL_DOWN if 'database is down'. * *************************************************************************/ static int sql_fetch_row(SQLSOCK * sqlsocket, UNUSED SQL_CONFIG *config) { int records, i, len; rlm_sql_postgres_sock *pg_sock = sqlsocket->conn; sqlsocket->row = NULL; if (pg_sock->cur_row >= PQntuples(pg_sock->result)) return 0; free_result_row(pg_sock); records = PQnfields(pg_sock->result); pg_sock->num_fields = records; if ((PQntuples(pg_sock->result) > 0) && (records > 0)) { pg_sock->row = (char **)rad_malloc((records+1)*sizeof(char *)); memset(pg_sock->row, '\0', (records+1)*sizeof(char *)); for (i = 0; i < records; i++) { len = PQgetlength(pg_sock->result, pg_sock->cur_row, i); pg_sock->row[i] = (char *)rad_malloc(len+1); memset(pg_sock->row[i], '\0', len+1); strlcpy(pg_sock->row[i], PQgetvalue(pg_sock->result, pg_sock->cur_row,i),len + 1); } pg_sock->cur_row++; sqlsocket->row = pg_sock->row; } return 0; } /************************************************************************* * * Function: sql_num_fields * * Purpose: database specific num_fields. Returns number of rows in * query * *************************************************************************/ static int sql_num_fields(SQLSOCK * sqlsocket, UNUSED SQL_CONFIG *config) { rlm_sql_postgres_sock *pg_sock = sqlsocket->conn; pg_sock->affected_rows = PQntuples(pg_sock->result); if (pg_sock->result) return PQnfields(pg_sock->result); return 0; } /************************************************************************* * * Function: sql_free_result * * Purpose: database specific free_result. Frees memory allocated * for a result set * *************************************************************************/ static int sql_free_result(SQLSOCK * sqlsocket, UNUSED SQL_CONFIG *config) { rlm_sql_postgres_sock *pg_sock = sqlsocket->conn; if (pg_sock->result) { PQclear(pg_sock->result); pg_sock->result = NULL; } free_result_row(pg_sock); return 0; } /************************************************************************* * * Function: sql_error * * Purpose: database specific error. Returns error associated with * connection * *************************************************************************/ static const char *sql_error(SQLSOCK * sqlsocket, UNUSED SQL_CONFIG *config) { rlm_sql_postgres_sock *pg_sock = sqlsocket->conn; return PQerrorMessage(pg_sock->conn); } /************************************************************************* * * Function: sql_close * * Purpose: database specific close. Closes an open database * connection * *************************************************************************/ static int sql_close(SQLSOCK * sqlsocket, UNUSED SQL_CONFIG *config) { rlm_sql_postgres_sock *pg_sock = sqlsocket->conn; if (!pg_sock->conn) return 0; /* PQfinish also frees the memory used by the PGconn structure */ PQfinish(pg_sock->conn); pg_sock->conn = NULL; return 0; } /************************************************************************* * * Function: sql_finish_query * * Purpose: End the query, such as freeing memory * *************************************************************************/ static int sql_finish_query(SQLSOCK * sqlsocket, SQL_CONFIG *config) { return sql_free_result(sqlsocket, config); } /************************************************************************* * * Function: sql_finish_select_query * * Purpose: End the select query, such as freeing memory or result * *************************************************************************/ static int sql_finish_select_query(SQLSOCK * sqlsocket, SQL_CONFIG *config) { return sql_free_result(sqlsocket, config); } /************************************************************************* * * Function: sql_affected_rows * * Purpose: Return the number of rows affected by the last query. * *************************************************************************/ static int sql_affected_rows(SQLSOCK * sqlsocket, UNUSED SQL_CONFIG *config) { rlm_sql_postgres_sock *pg_sock = sqlsocket->conn; return pg_sock->affected_rows; } static int NEVER_RETURNS not_implemented(UNUSED SQLSOCK * sqlsocket, UNUSED SQL_CONFIG *config) { radlog(L_ERR, "sql_postgresql: calling unimplemented function"); exit(1); } /* Exported to rlm_sql */ rlm_sql_module_t rlm_sql_postgresql = { "rlm_sql_postgresql", sql_init_socket, sql_destroy_socket, sql_query, sql_select_query, not_implemented, /* sql_store_result */ sql_num_fields, not_implemented, /* sql_num_rows */ sql_fetch_row, not_implemented, /* sql_free_result */ sql_error, sql_close, sql_finish_query, sql_finish_select_query, sql_affected_rows, }; freeradius-server/src/modules/rlm_sql/drivers/rlm_sql_postgresql/sql_postgresql.h000066400000000000000000000211631257552170400313030ustar00rootroot00000000000000/* Copyright 2006 The FreeRADIUS server project */ #ifndef _SQL_POSTGRESQL_H_ #define _SQL_POSTGRESQL_H_ #include RCSIDH(sql_postgresql_h, "$Id$") /************************************************** * Error Codes and required information Lookup table * Does this shite ever needed? Lets c.. ***************************************************/ typedef struct pgsql_error{ const char *errorcode; const char *meaning; int shouldreconnect; }pgerror; pgerror errorcodes[]= { { "1000", "WARNING", 0, }, { "0100C", "DYNAMIC RESULT SETS RETURNED", 0, }, { "1008", "IMPLICIT ZERO BIT PADDING", 0, }, { "1003", "NULL VALUE ELIMINATED IN SET FUNCTION", 0, }, { "1007", "PRIVILEGE NOT GRANTED", 0, }, { "1006", "PRIVILEGE NOT REVOKED", 0, }, { "1004", "STRING DATA RIGHT TRUNCATION", 0, }, { "01P01", "DEPRECATED FEATURE", 0, }, { "2000", "NO DATA", 0, }, { "2001", "NO ADDITIONAL DYNAMIC RESULT SETS RETURNED", 0, }, { "3000", "SQL STATEMENT NOT YET COMPLETE", 0, }, { "8000", "CONNECTION EXCEPTION", 0, }, { "8003", "CONNECTION DOES NOT EXIST", 0, }, { "8006", "CONNECTION FAILURE", 0, }, { "8001", "SQLCLIENT UNABLE TO ESTABLISH SQLCONNECTION", 0, }, { "8004", "SQLSERVER REJECTED ESTABLISHMENT OF SQLCONNECTION", 0, }, { "8007", "TRANSACTION RESOLUTION UNKNOWN", 0, }, { "08P01", "PROTOCOL VIOLATION", 0, }, { "9000", "TRIGGERED ACTION EXCEPTION", 0, }, { "0A000", "FEATURE NOT SUPPORTED", 0, }, { "0B000", "INVALID TRANSACTION INITIATION", 0, }, { "0F000", "LOCATOR EXCEPTION", 0, }, { "0F001", "INVALID LOCATOR SPECIFICATION", 0, }, { "0L000", "INVALID GRANTOR", 0, }, { "0LP01", "INVALID GRANT OPERATION", 0, }, { "21000", "CARDINALITY VIOLATION", 0, }, { "22000", "DATA EXCEPTION", 0, }, { "2202E", "ARRAY SUBSCRIPT ERROR", 0, }, { "22021", "CHARACTER NOT IN REPERTOIRE", 0, }, { "22008", "DATETIME FIELD OVERFLOW", 0, }, { "22012", "DIVISION BY ZERO", 0, }, { "22005", "ERROR IN ASSIGNMENT", 0, }, { "2200B", "ESCAPE CHARACTER CONFLICT", 0, }, { "22022", "INDICATOR OVERFLOW", 0, }, { "22015", "INTERVAL FIELD OVERFLOW", 0, }, { "2201E", "INVALID ARGUMENT FOR LOGARITHM", 0, }, { "2201F", "INVALID ARGUMENT FOR POWER FUNCTION", 0, }, { "2201G", "INVALID ARGUMENT FOR WIDTH BUCKET FUNCTION", 0, }, { "22018", "INVALID CHARACTER VALUE FOR CAST", 0, }, { "22007", "INVALID DATETIME FORMAT", 0, }, { "22019", "INVALID ESCAPE CHARACTER", 0, }, { "2200D", "INVALID ESCAPE OCTET", 0, }, { "22025", "INVALID ESCAPE SEQUENCE", 0, }, { "22P06", "NONSTANDARD USE OF ESCAPE CHARACTER", 0, }, { "22010", "INVALID INDICATOR PARAMETER VALUE", 0, }, { "22020", "INVALID LIMIT VALUE", 0, }, { "22023", "INVALID PARAMETER VALUE", 0, }, { "2201B", "INVALID REGULAR EXPRESSION", 0, }, { "22009", "INVALID TIME ZONE DISPLACEMENT VALUE", 0, }, { "2200C", "INVALID USE OF ESCAPE CHARACTER", 0, }, { "2200G", "MOST SPECIFIC TYPE MISMATCH", 0, }, { "22004", "NULL VALUE NOT ALLOWED", 0, }, { "22002", "NULL VALUE NO INDICATOR PARAMETER", 0, }, { "22003", "NUMERIC VALUE OUT OF RANGE", 0, }, { "22026", "STRING DATA LENGTH MISMATCH", 0, }, { "22001", "STRING DATA RIGHT TRUNCATION", 0, }, { "22011", "SUBSTRING ERROR", 0, }, { "22027", "TRIM ERROR", 0, }, { "22024", "UNTERMINATED C STRING", 0, }, { "2200F", "ZERO LENGTH CHARACTER STRING", 0, }, { "22P01", "FLOATING POINT EXCEPTION", 0, }, { "22P02", "INVALID TEXT REPRESENTATION", 0, }, { "22P03", "INVALID BINARY REPRESENTATION", 0, }, { "22P04", "BAD COPY FILE FORMAT", 0, }, { "22P05", "UNTRANSLATABLE CHARACTER", 0, }, { "23000", "INTEGRITY CONSTRAINT VIOLATION", 0, }, { "23001", "RESTRICT VIOLATION", 0, }, { "23502", "NOT NULL VIOLATION", 0, }, { "23503", "FOREIGN KEY VIOLATION", 0, }, { "23505", "UNIQUE VIOLATION", 0, }, { "23514", "CHECK VIOLATION", 0, }, { "24000", "INVALID CURSOR STATE", 0, }, { "25000", "INVALID TRANSACTION STATE", 0, }, { "25001", "ACTIVE SQL TRANSACTION", 0, }, { "25002", "BRANCH TRANSACTION ALREADY ACTIVE", 0, }, { "25008", "HELD CURSOR REQUIRES SAME ISOLATION LEVEL", 0, }, { "25003", "INAPPROPRIATE ACCESS MODE FOR BRANCH TRANSACTION", 0, }, { "25004", "INAPPROPRIATE ISOLATION LEVEL FOR BRANCH TRANSACTION", 0, }, { "25005", "NO ACTIVE SQL TRANSACTION FOR BRANCH TRANSACTION", 0, }, { "25006", "READ ONLY SQL TRANSACTION", 0, }, { "25007", "SCHEMA AND DATA STATEMENT MIXING NOT SUPPORTED", 0, }, { "25P01", "NO ACTIVE SQL TRANSACTION", 0, }, { "25P02", "IN FAILED SQL TRANSACTION", 0, }, { "26000", "INVALID SQL STATEMENT NAME", 0, }, { "27000", "TRIGGERED DATA CHANGE VIOLATION", 0, }, { "28000", "INVALID AUTHORIZATION SPECIFICATION", 0, }, { "2B000", "DEPENDENT PRIVILEGE DESCRIPTORS STILL EXIST", 0, }, { "2BP01", "DEPENDENT OBJECTS STILL EXIST", 0, }, { "2D000", "INVALID TRANSACTION TERMINATION", 0, }, { "2F000", "SQL ROUTINE EXCEPTION", 0, }, { "2F005", "FUNCTION EXECUTED NO RETURN STATEMENT", 0, }, { "2F002", "MODIFYING SQL DATA NOT PERMITTED", 0, }, { "2F003", "PROHIBITED SQL STATEMENT ATTEMPTED", 0, }, { "2F004", "READING SQL DATA NOT PERMITTED", 0, }, { "34000", "INVALID CURSOR NAME", 0, }, { "38000", "EXTERNAL ROUTINE EXCEPTION", 0, }, { "38001", "CONTAINING SQL NOT PERMITTED", 0, }, { "38002", "MODIFYING SQL DATA NOT PERMITTED", 0, }, { "38003", "PROHIBITED SQL STATEMENT ATTEMPTED", 0, }, { "38004", "READING SQL DATA NOT PERMITTED", 0, }, { "39000", "EXTERNAL ROUTINE INVOCATION EXCEPTION", 0, }, { "39001", "INVALID SQLSTATE RETURNED", 0, }, { "39004", "NULL VALUE NOT ALLOWED", 0, }, { "39P01", "TRIGGER PROTOCOL VIOLATED", 0, }, { "39P02", "SRF PROTOCOL VIOLATED", 0, }, { "3B000", "SAVEPOINT EXCEPTION", 0, }, { "3B001", "INVALID SAVEPOINT SPECIFICATION", 0, }, { "3D000", "INVALID CATALOG NAME", 0, }, { "3F000", "INVALID SCHEMA NAME", 0, }, { "40000", "TRANSACTION ROLLBACK", 0, }, { "40002", "TRANSACTION INTEGRITY CONSTRAINT VIOLATION", 0, }, { "40001", "SERIALIZATION FAILURE", 0, }, { "40003", "STATEMENT COMPLETION UNKNOWN", 0, }, { "40P01", "DEADLOCK DETECTED", 0, }, { "44000", "WITH CHECK OPTION VIOLATION", 0, }, { "53000", "INSUFFICIENT RESOURCES", 0, }, { "53100", "DISK FULL", 0, }, { "53200", "OUT OF MEMORY", 0, }, { "53300", "TOO MANY CONNECTIONS", 0, }, { "54000", "PROGRAM LIMIT EXCEEDED", 0, }, { "54001", "STATEMENT TOO COMPLEX", 0, }, { "54011", "TOO MANY COLUMNS", 0, }, { "54023", "TOO MANY ARGUMENTS", 0, }, { "55000", "OBJECT NOT IN PREREQUISITE STATE", 0, }, { "55006", "OBJECT IN USE", 0, }, { "55P02", "CANT CHANGE RUNTIME PARAM", 0, }, { "55P03", "LOCK NOT AVAILABLE", 0, }, { "57000", "OPERATOR INTERVENTION", 1, }, { "57014", "QUERY CANCELED", 1, }, { "57P01", "ADMIN SHUTDOWN", 1, }, { "57P02", "CRASH SHUTDOWN", 1, }, { "57P03", "CANNOT CONNECT NOW", 1, }, { "58030", "IO ERROR", 1, }, { "58P01", "UNDEFINED FILE", 1, }, { "58P02", "DUPLICATE FILE", 1, }, { "F0000", "CONFIG FILE ERROR", 1, }, { "F0001", "LOCK FILE EXISTS", 1, }, { "P0000", "PLPGSQL ERROR", 0, }, { "P0001", "RAISE EXCEPTION", 0, }, { "42000", "SYNTAX ERROR OR ACCESS RULE VIOLATION", 0, }, { "42601", "SYNTAX ERROR", 0, }, { "42501", "INSUFFICIENT PRIVILEGE", 0, }, { "42846", "CANNOT COERCE", 0, }, { "42803", "GROUPING ERROR", 0, }, { "42830", "INVALID FOREIGN KEY", 0, }, { "42602", "INVALID NAME", 0, }, { "42622", "NAME TOO LONG", 0, }, { "42939", "RESERVED NAME", 0, }, { "42804", "DATATYPE MISMATCH", 0, }, { "42P18", "INDETERMINATE DATATYPE", 0, }, { "42809", "WRONG OBJECT TYPE", 0, }, { "42703", "UNDEFINED COLUMN", 0, }, { "42883", "UNDEFINED FUNCTION", 0, }, { "42P01", "UNDEFINED TABLE", 0, }, { "42P02", "UNDEFINED PARAMETER", 0, }, { "42704", "UNDEFINED OBJECT", 0, }, { "42701", "DUPLICATE COLUMN", 0, }, { "42P03", "DUPLICATE CURSOR", 0, }, { "42P04", "DUPLICATE DATABASE", 0, }, { "42723", "DUPLICATE FUNCTION", 0, }, { "42P05", "DUPLICATE PREPARED STATEMENT", 0, }, { "42P06", "DUPLICATE SCHEMA", 0, }, { "42P07", "DUPLICATE TABLE", 0, }, { "42712", "DUPLICATE ALIAS", 0, }, { "42710", "DUPLICATE OBJECT", 0, }, { "42702", "AMBIGUOUS COLUMN", 0, }, { "42725", "AMBIGUOUS FUNCTION", 0, }, { "42P08", "AMBIGUOUS PARAMETER", 0, }, { "42P09", "AMBIGUOUS ALIAS", 0, }, { "42P10", "INVALID COLUMN REFERENCE", 0, }, { "42611", "INVALID COLUMN DEFINITION", 0, }, { "42P11", "INVALID CURSOR DEFINITION", 0, }, { "42P12", "INVALID DATABASE DEFINITION", 0, }, { "42P13", "INVALID FUNCTION DEFINITION", 0, }, { "42P14", "INVALID PREPARED STATEMENT DEFINITION", 0, }, { "42P15", "INVALID SCHEMA DEFINITION", 0, }, { "42P16", "INVALID TABLE DEFINITION", 0, }, { "42P17", "INVALID OBJECT DEFINITION", 0, }, { "XX000", "INTERNAL ERROR", 0, }, { "XX001", "DATA CORRUPTED", 0, }, { "XX002", "INDEX CORRUPTED", 0, }, { NULL, NULL, 0 } }; #endif /*_SQL_POSTGRESQL_H_*/ freeradius-server/src/modules/rlm_sql/drivers/rlm_sql_sqlite/000077500000000000000000000000001257552170400251435ustar00rootroot00000000000000freeradius-server/src/modules/rlm_sql/drivers/rlm_sql_sqlite/Makefile.in000066400000000000000000000002761257552170400272150ustar00rootroot00000000000000include ../../../../../Make.inc TARGET = @targetname@ SRCS = sql_sqlite.c RLM_SQL_CFLAGS = @sql_sqlite_cflags@ RLM_SQL_LIBS = @sql_sqlite_ldflags@ include ../rules.mak freeradius-server/src/modules/rlm_sql/drivers/rlm_sql_sqlite/configure000077500000000000000000003327621257552170400270670ustar00rootroot00000000000000#! /bin/sh # From configure.in Revision. # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.61. # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, # 2002, 2003, 2004, 2005, 2006 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=: # 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 # PATH needs CR # 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 # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false 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.) as_nl=' ' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. 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 # Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # CDPATH. $as_unset CDPATH if test "x$CONFIG_SHELL" = x; then if (eval ":") 2>/dev/null; then as_have_required=yes else as_have_required=no fi if test $as_have_required = yes && (eval ": (as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=\$LINENO as_lineno_2=\$LINENO test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } ") 2> /dev/null; then : else as_candidate_shells= as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. case $as_dir in /*) for as_base in sh bash ksh sh5; do as_candidate_shells="$as_candidate_shells $as_dir/$as_base" done;; esac done IFS=$as_save_IFS for as_shell in $as_candidate_shells $SHELL; do # Try only shells that exist, to save several forks. if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { ("$as_shell") 2> /dev/null <<\_ASEOF 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 : _ASEOF }; then CONFIG_SHELL=$as_shell as_have_required=yes if { "$as_shell" 2> /dev/null <<\_ASEOF 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 : (as_func_return () { (exit $1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = "$1" ); then : else exitcode=1 echo positional parameters were not saved. fi test $exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } _ASEOF }; then break fi fi done if test "x$CONFIG_SHELL" != x; then for as_var in BASH_ENV ENV do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done export CONFIG_SHELL exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} fi if test $as_have_required = no; then echo This script requires a shell more modern than all the echo shells that I found on your system. Please install a echo modern shell, or manually run the script under such a echo shell if you do have one. { (exit 1); exit 1; } fi fi fi (eval "as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0") || { echo No shell found that supports shell functions. echo Please tell autoconf@gnu.org about your system, echo including any error possibly output before this echo message } as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, and appends # trailing '-' during substitution so that $LINENO is not a special # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # scripts with optimization help from Paolo Bonzini. 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" || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi 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 fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi 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=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, 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= SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME= PACKAGE_TARNAME= PACKAGE_VERSION= PACKAGE_STRING= PACKAGE_BUGREPORT= ac_unique_file="sql_sqlite.c" ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datarootdir datadir sysconfdir sharedstatedir localstatedir includedir oldincludedir docdir infodir htmldir dvidir pdfdir psdir libdir localedir mandir DEFS ECHO_C ECHO_N ECHO_T LIBS build_alias host_alias target_alias CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT sql_sqlite_ldflags sql_sqlite_cflags targetname LIBOBJS LTLIBOBJS' ac_subst_files='' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS' # Initialize some variables set by options. ac_init_help= ac_init_version=false # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *) ac_optarg=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_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` eval enable_$ac_feature=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_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` eval enable_$ac_feature=\$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_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/[-.]/_/g'` eval with_$ac_package=\$ac_optarg ;; -without-* | --without-*) ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/[-.]/_/g'` eval with_$ac_package=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 ;; -*) { echo "$as_me: error: unrecognized option: $ac_option Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && 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'` { echo "$as_me: error: missing argument to $ac_option" >&2 { (exit 1); exit 1; }; } fi # Be sure to have absolute directory names. 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 case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; } 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 echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || { echo "$as_me: error: Working directory cannot be determined" >&2 { (exit 1); exit 1; }; } test "X$ac_ls_di" = "X$ac_pwd_ls_di" || { echo "$as_me: error: pwd does not report name of working directory" >&2 { (exit 1); exit 1; }; } # 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 -- "$0" || $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$0" : 'X\(//\)[^/]' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X"$0" | 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 .." { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2 { (exit 1); exit 1; }; } pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures this package to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF _ACEOF fi if test -n "$ac_init_help"; then cat <<\_ACEOF Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-sqlite-include-dir=DIR Directory where the sqlite includes may be found --with-sqlite-lib-dir=DIR Directory where the sqlite libraries may be found --with-sqlite-dir=DIR Base directory where sqlite is installed 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 C/C++/Objective C preprocessor flags, e.g. -I if you have headers in a nonstandard directory Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. _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" || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`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 echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF configure generated by GNU Autoconf 2.61 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 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 cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by $as_me, which was generated by GNU Autoconf 2.61. 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=. 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=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; 2) ac_configure_args1="$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 ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac done done $as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } $as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export 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 cat <<\_ASBOX ## ---------------- ## ## Cache variables. ## ## ---------------- ## _ASBOX 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_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( *) $as_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 cat <<\_ASBOX ## ----------------- ## ## Output variables. ## ## ----------------- ## _ASBOX echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then cat <<\_ASBOX ## ------------------- ## ## File substitutions. ## ## ------------------- ## _ASBOX echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then cat <<\_ASBOX ## ----------- ## ## confdefs.h. ## ## ----------- ## _ASBOX echo cat confdefs.h echo fi test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" 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'; { (exit 1); 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 # 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 # Let the site file select an alternate cache file if it wants to. # Prefer explicitly selected file to automatically selected ones. if test -n "$CONFIG_SITE"; then set x "$CONFIG_SITE" elif test "x$prefix" != xNONE; then set x "$prefix/share/config.site" "$prefix/etc/config.site" else set x "$ac_default_prefix/share/config.site" \ "$ac_default_prefix/etc/config.site" fi shift for ac_site_file do if test -r "$ac_site_file"; then { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" 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. if test -f "$cache_file"; then { echo "$as_me:$LINENO: loading cache $cache_file" >&5 echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { echo "$as_me:$LINENO: creating cache $cache_file" >&5 echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 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 { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 echo "$as_me: former value: $ac_old_val" >&2;} { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 echo "$as_me: current value: $ac_new_val" >&2;} ac_cache_corrupted=: fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`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. *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 echo "$as_me: error: changes in the environment can compromise the build" >&2;} { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} { (exit 1); exit 1; }; } 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 fail= SMART_LIBS= SMART_CLFAGS= if test x$with_rlm_sql_sqlite != xno; then sqlite_include_dir= # Check whether --with-sqlite-include-dir was given. if test "${with_sqlite_include_dir+set}" = set; then withval=$with_sqlite_include_dir; case "$withval" in no) { { echo "$as_me:$LINENO: error: Need sqlite-include-dir" >&5 echo "$as_me: error: Need sqlite-include-dir" >&2;} { (exit 1); exit 1; }; } ;; yes) ;; *) sqlite_include_dir="$withval" ;; esac fi sqlite_lib_dir= # Check whether --with-sqlite-lib-dir was given. if test "${with_sqlite_lib_dir+set}" = set; then withval=$with_sqlite_lib_dir; case "$withval" in no) { { echo "$as_me:$LINENO: error: Need sqlite-lib-dir" >&5 echo "$as_me: error: Need sqlite-lib-dir" >&2;} { (exit 1); exit 1; }; } ;; yes) ;; *) sqlite_lib_dir="$withval" ;; esac fi # Check whether --with-sqlite-dir was given. if test "${with_sqlite_dir+set}" = set; then withval=$with_sqlite_dir; case "$withval" in no) { { echo "$as_me:$LINENO: error: Need sqlite-dir" >&5 echo "$as_me: error: Need sqlite-dir" >&2;} { (exit 1); exit 1; }; } ;; yes) ;; *) sqlite_lib_dir="$withval/lib" sqlite_include_dir="$withval/include" ;; esac 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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}gcc" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="gcc" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}cc" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="$ac_prog" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&5 echo "$as_me: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } # Provide some information about the compiler. echo "$as_me:$LINENO: checking for C compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (ac_try="$ac_compiler --version >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -v >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -V >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out 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. { echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6; } ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # # List of possible output files, starting from the most likely. # The algorithm is not robust to junk in `.', hence go to wildcards (a.*) # only as a last resort. b.out is created by i960 compilers. ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out' # # The IRIX 6 linker writes into existing files which may not be # executable, retaining their permissions. Remove them first so a # subsequent execution test works. ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link_default") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; 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 | *.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 { echo "$as_me:$LINENO: result: $ac_file" >&5 echo "${ECHO_T}$ac_file" >&6; } if test -z "$ac_file"; then echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: C compiler cannot create executables See \`config.log' for more details." >&5 echo "$as_me: error: C compiler cannot create executables See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } fi ac_exeext=$ac_cv_exeext # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { echo "$as_me:$LINENO: checking whether the C compiler works" >&5 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6; } # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then if { ac_try='./$ac_file' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { echo "$as_me:$LINENO: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&5 echo "$as_me: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi fi fi { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } rm -f a.out a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; } { echo "$as_me:$LINENO: result: $cross_compiling" >&5 echo "${ECHO_T}$cross_compiling" >&6; } { echo "$as_me:$LINENO: checking for suffix of executables" >&5 echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; } if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; 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 | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest$ac_cv_exeext { echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 echo "${ECHO_T}$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT { echo "$as_me:$LINENO: checking for suffix of object files" >&5 echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; } if test "${ac_cv_objext+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; 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 ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 echo "${ECHO_T}$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; } if test "${ac_cv_c_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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 { echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; } GCC=`test $ac_compiler_gnu = yes && echo yes` ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CFLAGS="" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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 { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 echo "${ECHO_T}$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 { echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_c89+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_c89=$ac_arg else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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) { echo "$as_me:$LINENO: result: none needed" >&5 echo "${ECHO_T}none needed" >&6; } ;; xno) { echo "$as_me:$LINENO: result: unsupported" >&5 echo "${ECHO_T}unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;; 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 smart_try_dir="$sqlite_lib_dir" sm_lib_safe=`echo "sqlite3" | sed 'y%./+-%__p_%'` sm_func_safe=`echo "sqlite3_open" | sed 'y%./+-%__p_%'` { echo "$as_me:$LINENO: checking for sqlite3_open in -lsqlite3" >&5 echo $ECHO_N "checking for sqlite3_open in -lsqlite3... $ECHO_C" >&6; } old_LIBS="$LIBS" smart_lib= smart_lib_dir= if test "x$smart_try_dir" != "x"; then for try in $smart_try_dir; do LIBS="-L$try -lsqlite3 $old_LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ extern char sqlite3_open(); int main () { sqlite3_open() ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then smart_lib="-L$try -lsqlite3" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test "x$smart_lib" != "x"; then break; fi done LIBS="$old_LIBS" fi if test "x$smart_lib" = "x"; then LIBS="-lsqlite3 $old_LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ extern char sqlite3_open(); int main () { sqlite3_open() ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then smart_lib="-lsqlite3" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS="$old_LIBS" fi if test "x$smart_lib" = "x"; then if test "x$LOCATE" != "x"; then DIRS= file=libsqlite3${libltdl_cv_shlibext} for x in `${LOCATE} $file 2>/dev/null`; do base=`echo $x | sed "s%/${file}%%"` if test "x$x" = "x$base"; then continue; fi dir=`${DIRNAME} $x 2>/dev/null` exclude=`echo ${dir} | ${GREP} /home` if test "x$exclude" != "x"; then continue fi already=`echo \$smart_lib_dir ${DIRS} | ${GREP} ${dir}` if test "x$already" = "x"; then DIRS="$DIRS $dir" fi done fi eval "smart_lib_dir=\"\$smart_lib_dir $DIRS\"" if test "x$LOCATE" != "x"; then DIRS= file=libsqlite3.a for x in `${LOCATE} $file 2>/dev/null`; do base=`echo $x | sed "s%/${file}%%"` if test "x$x" = "x$base"; then continue; fi dir=`${DIRNAME} $x 2>/dev/null` exclude=`echo ${dir} | ${GREP} /home` if test "x$exclude" != "x"; then continue fi already=`echo \$smart_lib_dir ${DIRS} | ${GREP} ${dir}` if test "x$already" = "x"; then DIRS="$DIRS $dir" fi done fi eval "smart_lib_dir=\"\$smart_lib_dir $DIRS\"" for try in $smart_lib_dir /usr/local/lib /opt/lib; do LIBS="-L$try -lsqlite3 $old_LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ extern char sqlite3_open(); int main () { sqlite3_open() ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then smart_lib="-L$try -lsqlite3" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test "x$smart_lib" != "x"; then break; fi done LIBS="$old_LIBS" fi if test "x$smart_lib" != "x"; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } eval "ac_cv_lib_${sm_lib_safe}_${sm_func_safe}=yes" LIBS="$smart_lib $old_LIBS" SMART_LIBS="$smart_lib $SMART_LIBS" else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_cv_lib_sqlite3_sqlite3_open" != "xyes" then { echo "$as_me:$LINENO: WARNING: Sqlite libraries not found. Use --with-sqlite-lib-dir=." >&5 echo "$as_me: WARNING: Sqlite libraries not found. Use --with-sqlite-lib-dir=." >&2;} fail="$fail libsqlite3" fi smart_try_dir="$sqlite_include_dir" ac_safe=`echo "sqlite3.h" | sed 'y%./+-%__pm%'` { echo "$as_me:$LINENO: checking for sqlite3.h" >&5 echo $ECHO_N "checking for sqlite3.h... $ECHO_C" >&6; } old_CFLAGS="$CFLAGS" smart_include= smart_include_dir= if test "x$smart_try_dir" != "x"; then for try in $smart_try_dir; do CFLAGS="$old_CFLAGS -I$try" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { int a = 1; ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then smart_include="-I$try" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 smart_include= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test "x$smart_include" != "x"; then break; fi done CFLAGS="$old_CFLAGS" fi if test "x$smart_include" = "x"; then cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { int a = 1; ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then smart_include=" " else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 smart_include= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test "x$smart_include" = "x"; then if test "x$LOCATE" != "x"; then DIRS= file=sqlite3.h for x in `${LOCATE} $file 2>/dev/null`; do base=`echo $x | sed "s%/${file}%%"` if test "x$x" = "x$base"; then continue; fi dir=`${DIRNAME} $x 2>/dev/null` exclude=`echo ${dir} | ${GREP} /home` if test "x$exclude" != "x"; then continue fi already=`echo \$smart_include_dir ${DIRS} | ${GREP} ${dir}` if test "x$already" = "x"; then DIRS="$DIRS $dir" fi done fi eval "smart_include_dir=\"\$smart_include_dir $DIRS\"" for try in $smart_include_dir /usr/local/include /opt/include; do CFLAGS="$old_CFLAGS -I$try" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { int a = 1; ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then smart_include="-I$try" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 smart_include= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test "x$smart_include" != "x"; then break; fi done CFLAGS="$old_CFLAGS" fi if test "x$smart_include" != "x"; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } eval "ac_cv_header_$ac_safe=yes" CFLAGS="$old_CFLAGS $smart_include" SMART_CFLAGS="$SMART_CFLAGS $smart_include" else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_cv_header_sqlite3_h" != "xyes"; then { echo "$as_me:$LINENO: WARNING: Sqlite headers not found. Use --with-sqlite-include-dir=." >&5 echo "$as_me: WARNING: Sqlite headers not found. Use --with-sqlite-include-dir=." >&2;} fail="$fail sqlite.h" fi targetname=rlm_sql_sqlite else targetname= echo \*\*\* module rlm_sql_sqlite is disabled. fi if test "x$fail" != x; then if test "x${enable_strict_dependencies}" = xyes; then { { echo "$as_me:$LINENO: error: set --without-rlm_sql_sqlite to disable it explicitly." >&5 echo "$as_me: error: set --without-rlm_sql_sqlite to disable it explicitly." >&2;} { (exit 1); exit 1; }; } else { echo "$as_me:$LINENO: WARNING: silently not building rlm_sql_sqlite." >&5 echo "$as_me: WARNING: silently not building rlm_sql_sqlite." >&2;} { echo "$as_me:$LINENO: WARNING: FAILURE: rlm_sql_sqlite requires:$fail." >&5 echo "$as_me: WARNING: FAILURE: rlm_sql_sqlite requires:$fail." >&2;}; targetname= fi fi sql_sqlite_ldflags="$SMART_LIBS" sql_sqlite_cflags="$SMART_CFLAGS" unset ac_cv_env_LIBS_set unset ac_cv_env_LIBS_value ac_config_files="$ac_config_files 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_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( *) $as_unset $ac_var ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then test "x$cache_file" != "x/dev/null" && { echo "$as_me:$LINENO: updating cache $cache_file" >&5 echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 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}' # Transform confdefs.h into DEFS. # Protect against shell expansion while executing Makefile rules. # Protect against Makefile macro expansion. # # If the first sed substitution is executed (which looks for macros that # take arguments), then branch to the quote section. Otherwise, # look for a macro that doesn't take arguments. ac_script=' t clear :clear s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g t quote s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g t quote b any :quote s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g s/\[/\\&/g s/\]/\\&/g s/\$/$$/g H :any ${ g s/^\n// s/\n/ /g p } ' DEFS=`sed -n "$ac_script" confdefs.h` ac_libobjs= ac_ltlibobjs= 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=`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. ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs : ${CONFIG_STATUS=./config.status} ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >$CONFIG_STATUS <<_ACEOF #! $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} _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ## --------------------- ## ## 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=: # 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 # PATH needs CR # 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 # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false 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.) as_nl=' ' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. 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 # Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # CDPATH. $as_unset CDPATH as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, and appends # trailing '-' during substitution so that $LINENO is not a special # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # scripts with optimization help from Paolo Bonzini. 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" || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi 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 fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi 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=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 # Save the log message, to keep $[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by $as_me, which was generated by GNU Autoconf 2.61. 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 cat >>$CONFIG_STATUS <<_ACEOF # Files that config.status was made for. config_files="$ac_config_files" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit -q, --quiet 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 Configuration files: $config_files Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ config.status configured by $0, generated by GNU Autoconf 2.61, with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" Copyright (C) 2006 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' _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # If no file are specified by the user, then we need to provide default # value. By we need to know if files were specified by the user. 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=$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 ) echo "$ac_cs_version"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift CONFIG_FILES="$CONFIG_FILES $ac_optarg" ac_need_defaults=false;; --he | --h | --help | --hel | -h ) 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. -*) { echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *) ac_config_targets="$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 if \$ac_cs_recheck; then echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 CONFIG_SHELL=$SHELL export CONFIG_SHELL exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; 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 fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= trap 'exit_status=$? { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status ' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || { echo "$me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } # # Set up the sed scripts for CONFIG_FILES section. # # No need to generate the scripts if there are no CONFIG_FILES. # This happens for instance when ./config.status config.h if test -n "$CONFIG_FILES"; then _ACEOF ac_delim='%!_!# ' for ac_last_try in false false false false false :; do cat >conf$$subs.sed <<_ACEOF SHELL!$SHELL$ac_delim PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim PACKAGE_NAME!$PACKAGE_NAME$ac_delim PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim PACKAGE_STRING!$PACKAGE_STRING$ac_delim PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim exec_prefix!$exec_prefix$ac_delim prefix!$prefix$ac_delim program_transform_name!$program_transform_name$ac_delim bindir!$bindir$ac_delim sbindir!$sbindir$ac_delim libexecdir!$libexecdir$ac_delim datarootdir!$datarootdir$ac_delim datadir!$datadir$ac_delim sysconfdir!$sysconfdir$ac_delim sharedstatedir!$sharedstatedir$ac_delim localstatedir!$localstatedir$ac_delim includedir!$includedir$ac_delim oldincludedir!$oldincludedir$ac_delim docdir!$docdir$ac_delim infodir!$infodir$ac_delim htmldir!$htmldir$ac_delim dvidir!$dvidir$ac_delim pdfdir!$pdfdir$ac_delim psdir!$psdir$ac_delim libdir!$libdir$ac_delim localedir!$localedir$ac_delim mandir!$mandir$ac_delim DEFS!$DEFS$ac_delim ECHO_C!$ECHO_C$ac_delim ECHO_N!$ECHO_N$ac_delim ECHO_T!$ECHO_T$ac_delim LIBS!$LIBS$ac_delim build_alias!$build_alias$ac_delim host_alias!$host_alias$ac_delim target_alias!$target_alias$ac_delim CC!$CC$ac_delim CFLAGS!$CFLAGS$ac_delim LDFLAGS!$LDFLAGS$ac_delim CPPFLAGS!$CPPFLAGS$ac_delim ac_ct_CC!$ac_ct_CC$ac_delim EXEEXT!$EXEEXT$ac_delim OBJEXT!$OBJEXT$ac_delim sql_sqlite_ldflags!$sql_sqlite_ldflags$ac_delim sql_sqlite_cflags!$sql_sqlite_cflags$ac_delim targetname!$targetname$ac_delim LIBOBJS!$LIBOBJS$ac_delim LTLIBOBJS!$LTLIBOBJS$ac_delim _ACEOF if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 49; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` if test -n "$ac_eof"; then ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` ac_eof=`expr $ac_eof + 1` fi cat >>$CONFIG_STATUS <<_ACEOF cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof /@[a-zA-Z_][a-zA-Z_0-9]*@/!b end _ACEOF sed ' s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g s/^/s,@/; s/!/@,|#_!!_#|/ :n t n s/'"$ac_delim"'$/,g/; t s/$/\\/; p N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n ' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF :end s/|#_!!_#|//g CEOF$ac_eof _ACEOF # VPATH may cause trouble with some makes, so we remove $(srcdir), # ${srcdir} and @srcdir@ 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[ ]*=/{ s/:*\$(srcdir):*/:/ s/:*\${srcdir}:*/:/ s/:*@srcdir@:*/:/ s/^\([^=]*=[ ]*\):*/\1/ s/:*$// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF fi # test -n "$CONFIG_FILES" for ac_tag in :F $CONFIG_FILES do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5 echo "$as_me: error: Invalid tag $ac_tag." >&2;} { (exit 1); exit 1; }; };; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 echo "$as_me: error: cannot find input file: $ac_f" >&2;} { (exit 1); exit 1; }; };; esac ac_file_inputs="$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 "`IFS=: echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure." if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { echo "$as_me:$LINENO: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} fi case $ac_tag in *:-:* | *:-) cat >"$tmp/stdin";; 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 || 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" case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`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 || 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" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 echo "$as_me: error: cannot create directory $as_dir" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`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 # _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # 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= case `sed -n '/datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p ' $ac_file_inputs` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF 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 sed "$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s&@configure_input@&$configure_input&;t t s&@top_builddir@&$ac_top_builddir_sub&;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 $ac_datarootdir_hack " $ac_file_inputs | sed -f "$tmp/subs-1.sed" >$tmp/out test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&5 echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&2;} rm -f "$tmp/stdin" case $ac_file in -) cat "$tmp/out"; rm -f "$tmp/out";; *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;; esac ;; esac done # for ac_tag { (exit 0); exit 0; } _ACEOF chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save # 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 || { (exit 1); exit 1; } fi freeradius-server/src/modules/rlm_sql/drivers/rlm_sql_sqlite/configure.in000066400000000000000000000057501257552170400274630ustar00rootroot00000000000000AC_PREREQ([2.59]) AC_INIT(sql_sqlite.c) AC_REVISION($Revision$) AC_DEFUN(modname,[rlm_sql_sqlite]) fail= SMART_LIBS= SMART_CLFAGS= if test x$with_[]modname != xno; then dnl ############################################################ dnl # Check for command line options dnl ############################################################ dnl extra argument: --with-sqlite-include-dir=DIR sqlite_include_dir= AC_ARG_WITH(sqlite-include-dir, [AS_HELP_STRING([--with-sqlite-include-dir=DIR], [Directory where the sqlite includes may be found])], [case "$withval" in no) AC_MSG_ERROR(Need sqlite-include-dir) ;; yes) ;; *) sqlite_include_dir="$withval" ;; esac]) dnl extra argument: --with-sqlite-lib-dir=DIR sqlite_lib_dir= AC_ARG_WITH(sqlite-lib-dir, [AS_HELP_STRING([--with-sqlite-lib-dir=DIR], [Directory where the sqlite libraries may be found])], [case "$withval" in no) AC_MSG_ERROR(Need sqlite-lib-dir) ;; yes) ;; *) sqlite_lib_dir="$withval" ;; esac]) dnl extra argument: --with-sqlite-dir=DIR AC_ARG_WITH(sqlite-dir, [AS_HELP_STRING([--with-sqlite-dir=DIR], [Base directory where sqlite is installed])], [case "$withval" in no) AC_MSG_ERROR(Need sqlite-dir) ;; yes) ;; *) sqlite_lib_dir="$withval/lib" sqlite_include_dir="$withval/include" ;; esac]) dnl ############################################################ dnl # Check for programs dnl ############################################################ AC_PROG_CC dnl ############################################################ dnl # Check for libraries dnl ############################################################ dnl try to link to libsqlite3 smart_try_dir="$sqlite_lib_dir" FR_SMART_CHECK_LIB(sqlite3, sqlite3_open) if test "x$ac_cv_lib_sqlite3_sqlite3_open" != "xyes" then AC_MSG_WARN([Sqlite libraries not found. Use --with-sqlite-lib-dir=.]) fail="$fail libsqlite3" fi dnl ############################################################ dnl # Check for header files dnl ############################################################ smart_try_dir="$sqlite_include_dir" FR_SMART_CHECK_INCLUDE(sqlite3.h) if test "x$ac_cv_header_sqlite3_h" != "xyes"; then AC_MSG_WARN([Sqlite headers not found. Use --with-sqlite-include-dir=.]) fail="$fail sqlite.h" fi targetname=modname else targetname= echo \*\*\* module modname is disabled. fi dnl Don't change this section. if test "x$fail" != x; then if test "x${enable_strict_dependencies}" = xyes; then AC_MSG_ERROR([set --without-]modname[ to disable it explicitly.]) else AC_MSG_WARN([silently not building ]modname[.]) AC_MSG_WARN([FAILURE: ]modname[ requires:$fail.]); targetname= fi fi sql_sqlite_ldflags="$SMART_LIBS" sql_sqlite_cflags="$SMART_CFLAGS" AC_SUBST(sql_sqlite_ldflags) AC_SUBST(sql_sqlite_cflags) AC_SUBST(targetname) AC_OUTPUT(Makefile) freeradius-server/src/modules/rlm_sql/drivers/rlm_sql_sqlite/sql_sqlite.c000066400000000000000000000275421257552170400275010ustar00rootroot00000000000000/* * sql_sqlite.c * freeradius * * Version: $Id$ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 only, as published by * the Free Software Foundation. * * 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 version 2 * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Copyright 2007 Apple Inc. */ #include RCSID("$Id$") #include #include #include #include "rlm_sql.h" typedef struct rlm_sql_sqlite_sock { sqlite3 *pDb; sqlite3_stmt *pStmt; int columnCount; } rlm_sql_sqlite_sock; /************************************************************************* * * Function: sql_create_socket * * Purpose: Establish connection to the db * *************************************************************************/ static int sql_init_socket(SQLSOCK *sqlsocket, SQL_CONFIG *config) { int status; rlm_sql_sqlite_sock *sqlite_sock; char *filename; char buffer[2048]; if (!sqlsocket->conn) { sqlsocket->conn = (rlm_sql_sqlite_sock *)rad_malloc(sizeof(rlm_sql_sqlite_sock)); if (!sqlsocket->conn) { return -1; } } sqlite_sock = sqlsocket->conn; memset(sqlite_sock, 0, sizeof(rlm_sql_sqlite_sock)); filename = config->sql_file; if (!filename) { snprintf(buffer, sizeof(buffer), "%s/sqlite_radius_client_database", radius_dir); filename = buffer; } radlog(L_INFO, "rlm_sql_sqlite: Opening sqlite database %s for #%d", filename, sqlsocket->id); status = sqlite3_open(filename, &sqlite_sock->pDb); radlog(L_INFO, "rlm_sql_sqlite: sqlite3_open() = %d\n", status); return (status != SQLITE_OK) * -1; } /************************************************************************* * * Function: sql_destroy_socket * * Purpose: Free socket and any private connection data * *************************************************************************/ static int sql_destroy_socket(SQLSOCK *sqlsocket, UNUSED SQL_CONFIG *config) { int status = 0; rlm_sql_sqlite_sock *sqlite_sock = sqlsocket->conn; if (sqlite_sock && sqlite_sock->pDb) { status = sqlite3_close(sqlite_sock->pDb); radlog(L_INFO, "rlm_sql_sqlite: sqlite3_close() = %d\n", status); } else { radlog(L_INFO, "rlm_sql_sqlite: sql_destroy_socket noop.\n"); } return 0; } /************************************************************************* * * Function: sql_query * * Purpose: Issue a query to the database * *************************************************************************/ static int sql_query(SQLSOCK * sqlsocket, SQL_CONFIG *config, char *querystr) { int status; rlm_sql_sqlite_sock *sqlite_sock = sqlsocket->conn; const char *zTail; if (config->sqltrace) radlog(L_DBG,"rlm_sql_sqlite: query: %s", querystr); if (sqlite_sock->pDb == NULL) { radlog(L_ERR, "rlm_sql_sqlite: Socket not connected"); return SQL_DOWN; } status = sqlite3_prepare(sqlite_sock->pDb, querystr, strlen(querystr), &sqlite_sock->pStmt, &zTail); radlog(L_DBG, "rlm_sql_sqlite: sqlite3_prepare() = %d\n", status); sqlite_sock->columnCount = 0; return (status == SQLITE_OK) ? 0 : SQL_DOWN; } /************************************************************************* * * Function: sql_select_query * * Purpose: Issue a select query to the database * *************************************************************************/ static int sql_select_query(SQLSOCK *sqlsocket, SQL_CONFIG *config, char *querystr) { return sql_query(sqlsocket, config, querystr); } /************************************************************************* * * Function: sql_store_result * * Purpose: database specific store_result function. Returns a result * set for the query. * *************************************************************************/ static int sql_store_result(UNUSED SQLSOCK * sqlsocket, UNUSED SQL_CONFIG *config) { return 0; } /************************************************************************* * * Function: sql_num_fields * * Purpose: database specific num_fields function. Returns number * of columns from query * *************************************************************************/ static int sql_num_fields(SQLSOCK * sqlsocket, UNUSED SQL_CONFIG *config) { rlm_sql_sqlite_sock *sqlite_sock = sqlsocket->conn; if (sqlite_sock->pStmt) return sqlite3_column_count(sqlite_sock->pStmt); return 0; } /************************************************************************* * * Function: sql_num_rows * * Purpose: database specific num_rows. Returns number of rows in * query * *************************************************************************/ static int sql_num_rows(SQLSOCK * sqlsocket, UNUSED SQL_CONFIG *config) { rlm_sql_sqlite_sock *sqlite_sock = sqlsocket->conn; if (sqlite_sock->pStmt) return sqlite3_data_count(sqlite_sock->pStmt); return 0; } /************************************************************************* * Function: sql_free_rowdata *************************************************************************/ static void sql_free_rowdata(SQLSOCK * sqlsocket, int colcount) { char **rowdata = sqlsocket->row; int colindex; if (rowdata != NULL) { for (colindex = 0; colindex < colcount; colindex++) { if (rowdata[colindex] != NULL) { free(rowdata[colindex]); rowdata[colindex] = NULL; } } free(sqlsocket->row); sqlsocket->row = NULL; } } /************************************************************************* * * Function: sql_fetch_row * * Purpose: database specific fetch_row. Returns a SQL_ROW struct * with all the data for the query in 'sqlsocket->row'. Returns * 0 on success, -1 on failure, SQL_DOWN if database is down. * *************************************************************************/ static int sql_fetch_row(SQLSOCK * sqlsocket, SQL_CONFIG *config) { int returnCode = -1; rlm_sql_sqlite_sock *sqlite_sock = sqlsocket->conn; const char *blob; int blobLen; int status; int colindex = 0; int colcount = 0; int coltype = 0; int colintvalue = 0; int ret_blob_size = 0; char **rowdata = NULL; const unsigned char *textStr; char intStr[256]; status = sqlite3_step(sqlite_sock->pStmt); radlog(L_DBG, "rlm_sql_sqlite: sqlite3_step = %d\n", status); if (status == SQLITE_DONE) { sql_free_rowdata(sqlsocket, sqlite_sock->columnCount); return 0; } else if (status == SQLITE_ROW) { if (sqlite_sock->columnCount == 0) { sqlite_sock->columnCount = sql_num_fields(sqlsocket, config); } colcount = sqlite_sock->columnCount; if (colcount == 0) return -1; sql_free_rowdata(sqlsocket, colcount); ret_blob_size = sizeof(char *) * (colcount+1); rowdata = (char **)rad_malloc(ret_blob_size); /* Space for pointers */ if (rowdata != NULL) { memset(rowdata, 0, ret_blob_size); /* NULL-pad the pointers */ sqlsocket->row = rowdata; } for (colindex = 0; colindex < colcount; colindex++) { coltype = sqlite3_column_type(sqlite_sock->pStmt, colindex); switch (coltype) { case SQLITE_INTEGER: colintvalue = sqlite3_column_int(sqlite_sock->pStmt, colindex); snprintf(intStr, sizeof(intStr), "%d", colintvalue); rowdata[colindex] = strdup(intStr); break; case SQLITE_TEXT: textStr = sqlite3_column_text(sqlite_sock->pStmt, colindex); if (textStr != NULL) rowdata[colindex] = strdup((const char *)textStr); break; case SQLITE_BLOB: blob = sqlite3_column_blob(sqlite_sock->pStmt, colindex); if (blob != NULL) { blobLen = sqlite3_column_bytes(sqlite_sock->pStmt, colindex); rowdata[colindex] = (char *)rad_malloc(blobLen + 1); if (rowdata[colindex] != NULL) { memcpy(rowdata[colindex], blob, blobLen); } } break; default: break; } } returnCode = 0; } return returnCode; } /************************************************************************* * * Function: sql_free_result * * Purpose: database specific free_result. Frees memory allocated * for a result set * *************************************************************************/ static int sql_free_result(SQLSOCK * sqlsocket, UNUSED SQL_CONFIG *config) { int status = 0; rlm_sql_sqlite_sock *sqlite_sock = sqlsocket->conn; if (sqlite_sock->pStmt != NULL) { sql_free_rowdata(sqlsocket, sqlite_sock->columnCount); status = sqlite3_finalize(sqlite_sock->pStmt); sqlite_sock->pStmt = NULL; radlog(L_DBG, "rlm_sql_sqlite: sqlite3_finalize() = %d\n", status); } return status; } /************************************************************************* * * Function: sql_error * * Purpose: database specific error. Returns error associated with * connection * *************************************************************************/ static const char *sql_error(SQLSOCK * sqlsocket, UNUSED SQL_CONFIG *config) { rlm_sql_sqlite_sock *sqlite_sock = sqlsocket->conn; if (sqlite_sock->pDb != NULL) { return sqlite3_errmsg(sqlite_sock->pDb); } radlog(L_ERR, "rlm_sql_sqlite: Socket not connected"); return NULL; } /************************************************************************* * * Function: sql_close * * Purpose: database specific close. Closes an open database * connection * *************************************************************************/ static int sql_close(SQLSOCK * sqlsocket, UNUSED SQL_CONFIG *config) { int status = 0; rlm_sql_sqlite_sock *sqlite_sock = sqlsocket->conn; if (sqlite_sock && sqlite_sock->pDb) { status = sqlite3_close(sqlite_sock->pDb); sqlite_sock->pDb = NULL; } return status; } /************************************************************************* * * Function: sql_finish_query * * Purpose: End the query, such as freeing memory * *************************************************************************/ static int sql_finish_query(SQLSOCK * sqlsocket, UNUSED SQL_CONFIG *config) { int status = 0; rlm_sql_sqlite_sock *sqlite_sock = sqlsocket->conn; if (sqlite_sock->pStmt) { status = sqlite3_finalize(sqlite_sock->pStmt); sqlite_sock->pStmt = NULL; radlog(L_DBG, "rlm_sql_sqlite: sqlite3_finalize() = %d\n", status); } return status; } /************************************************************************* * * Function: sql_finish_select_query * * Purpose: End the select query, such as freeing memory or result * *************************************************************************/ static int sql_finish_select_query(SQLSOCK * sqlsocket, SQL_CONFIG *config) { return sql_finish_query(sqlsocket, config); } /************************************************************************* * * Function: sql_affected_rows * * Purpose: Requests the number of rows affected by the last executed * statement * *************************************************************************/ static int sql_affected_rows(SQLSOCK * sqlsocket, UNUSED SQL_CONFIG *config) { int result = -1; rlm_sql_sqlite_sock *sqlite_sock = sqlsocket->conn; if (sqlite_sock->pDb != NULL) { result = sqlite3_changes(sqlite_sock->pDb); DEBUG3("rlm_sql_sqlite: sql_affected_rows() = %i\n", result); } return result; } /* Exported to rlm_sql */ rlm_sql_module_t rlm_sql_sqlite = { "rlm_sql_sqlite", sql_init_socket, sql_destroy_socket, sql_query, sql_select_query, sql_store_result, sql_num_fields, sql_num_rows, sql_fetch_row, sql_free_result, sql_error, sql_close, sql_finish_query, sql_finish_select_query, sql_affected_rows }; freeradius-server/src/modules/rlm_sql/drivers/rlm_sql_sybase/000077500000000000000000000000001257552170400251305ustar00rootroot00000000000000freeradius-server/src/modules/rlm_sql/drivers/rlm_sql_sybase/Makefile000066400000000000000000000006661257552170400266000ustar00rootroot00000000000000# # This module is in the source, but not yet fully integrated with # the configure scripts. For now, manual editing of this file is # required to get it to build. # include ../../../../../Make.inc TARGET = #TARGET = rlm_sql_sybase SRCS = sql_sybase.c RLM_SQL_CFLAGS = -I/opt/sybase/OCS-12_0/include RLM_SQL_LIBS = -L/opt/sybase/OCS-12_0/lib -ltcl -lcomn -lintl -lnsl -ldl -lm -lcs -lct include ../rules.mak freeradius-server/src/modules/rlm_sql/drivers/rlm_sql_sybase/sql_sybase.c000066400000000000000000000703321257552170400274460ustar00rootroot00000000000000/* * sql_sybase.c Sybase (ctlibrary) routines for rlm_sql * Error handling stolen from Sybase example code "firstapp.c" * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2000,2006 The FreeRADIUS server project * Copyright 2000 Mattias Sjostrom */ #include RCSID("$Id$") #include #include #include #include "rlm_sql.h" typedef struct rlm_sql_sybase_sock { CS_CONTEXT *context; CS_CONNECTION *connection; CS_COMMAND *command; char **results; int id; int in_use; struct timeval tv; } rlm_sql_sybase_sock; #define MAX_DATASTR_LEN 256 /************************************************************************ * Handler for server messages. Client-Library will call this * routine when it receives a message from the server. ************************************************************************/ static CS_RETCODE CS_PUBLIC servermsg_callback(cp, chp, msgp) CS_CONTEXT *cp; CS_CONNECTION *chp; CS_SERVERMSG *msgp; { /* ** Print the message info. */ radlog(L_ERR, "Sybase Server message:\n"); radlog(L_ERR, "number(%ld) severity(%ld) state(%ld) line(%ld)\n", (long)msgp->msgnumber, (long)msgp->severity, (long)msgp->state, (long)msgp->line); /* ** Print the server and procedure names if supplied. */ if (msgp->svrnlen > 0 && msgp->proclen > 0) radlog(L_ERR, "Server name: %s Procedure name: %s", msgp->svrname, msgp->proc); /* ** Print the null terminated message. */ radlog(L_ERR, "%s\n", msgp->text); /* ** Server message callbacks must return CS_SUCCEED. */ return (CS_SUCCEED); } /************************************************************************ * Client-Library error handler. ************************************************************************/ static CS_RETCODE CS_PUBLIC clientmsg_callback(context, conn, emsgp) CS_CONTEXT *context; CS_CONNECTION *conn; CS_CLIENTMSG *emsgp; { /* ** Error number: Print the error's severity, number, origin, and ** layer. These four numbers uniquely identify the error. */ radlog(L_ERR, "Client Library error:\n"); radlog(L_ERR, "severity(%ld) number(%ld) origin(%ld) layer(%ld)\n", (long)CS_SEVERITY(emsgp->severity), (long)CS_NUMBER(emsgp->msgnumber), (long)CS_ORIGIN(emsgp->msgnumber), (long)CS_LAYER(emsgp->msgnumber)); /* ** Error text: Print the error text. */ radlog(L_ERR, "%s\n", emsgp->msgstring); if (emsgp->osstringlen > 0) { radlog(L_ERR, "Operating system error number(%ld):\n", (long)emsgp->osnumber); radlog(L_ERR, "%s\n", emsgp->osstring); } return (CS_SUCCEED); } /************************************************************************ * CS-Library error handler. This function will be invoked * when CS-Library has detected an error. ************************************************************************/ static CS_RETCODE CS_PUBLIC csmsg_callback(context, emsgp) CS_CONTEXT *context; CS_CLIENTMSG *emsgp; { /* ** Print the error number and message. */ radlog(L_ERR, "CS-Library error:\n"); radlog(L_ERR, "\tseverity(%ld) layer(%ld) origin(%ld) number(%ld)", (long)CS_SEVERITY(emsgp->msgnumber), (long)CS_LAYER(emsgp->msgnumber), (long)CS_ORIGIN(emsgp->msgnumber), (long)CS_NUMBER(emsgp->msgnumber)); radlog(L_ERR, "%s\n", emsgp->msgstring); /* ** Print any operating system error information. */ if (emsgp->osstringlen > 0) { radlog(L_ERR, "Operating System Error: %s\n", emsgp->osstring); } return (CS_SUCCEED); } /************************************************************************* * * Function: sql_init_socket * * Purpose: Establish connection to the db * *************************************************************************/ static int sql_init_socket(SQLSOCK *sqlsocket, SQL_CONFIG *config) { rlm_sql_sybase_sock *sybase_sock; if (!sqlsocket->conn) { sqlsocket->conn = (rlm_sql_sybase_sock *)rad_malloc(sizeof(rlm_sql_sybase_sock)); if (!sqlsocket->conn) { return -1; } } sybase_sock = sqlsocket->conn; memset(sybase_sock, 0, sizeof(*sybase_sock)); sybase_sock->results=NULL; /* Allocate a CS context structure. This should really only be done once, but because of the connection pooling design of rlm_sql, we'll have to go with one context per connection */ if (cs_ctx_alloc(CS_VERSION_100, &sybase_sock->context) != CS_SUCCEED) { radlog(L_ERR,"rlm_sql_sybase(sql_init_socket): Unable to allocate CS context structure (cs_ctx_alloc())"); return -1; } /* Initialize ctlib */ if (ct_init(sybase_sock->context, CS_VERSION_100) != CS_SUCCEED) { radlog(L_ERR,"rlm_sql_sybase(sql_init_socket): Unable to initialize Client-Library (ct_init())"); if (sybase_sock->context != (CS_CONTEXT *)NULL) { cs_ctx_drop(sybase_sock->context); } return -1; } /* Install callback functions for error-handling */ if (cs_config(sybase_sock->context, CS_SET, CS_MESSAGE_CB, (CS_VOID *)csmsg_callback, CS_UNUSED, NULL) != CS_SUCCEED) { radlog(L_ERR,"rlm_sql_sybase(sql_init_socket): Unable to install CS Library error callback"); if (sybase_sock->context != (CS_CONTEXT *)NULL) { ct_exit(sybase_sock->context, CS_FORCE_EXIT); cs_ctx_drop(sybase_sock->context); } return -1; } if (ct_callback(sybase_sock->context, NULL, CS_SET, CS_CLIENTMSG_CB, (CS_VOID *)clientmsg_callback) != CS_SUCCEED) { radlog(L_ERR,"rlm_sql_sybase(sql_init_socket): Unable to install client message callback"); if (sybase_sock->context != (CS_CONTEXT *)NULL) { ct_exit(sybase_sock->context, CS_FORCE_EXIT); cs_ctx_drop(sybase_sock->context); } return -1; } if (ct_callback(sybase_sock->context, NULL, CS_SET, CS_SERVERMSG_CB, (CS_VOID *)servermsg_callback) != CS_SUCCEED) { radlog(L_ERR,"rlm_sql_sybase(sql_init_socket): Unable to install client message callback"); if (sybase_sock->context != (CS_CONTEXT *)NULL) { ct_exit(sybase_sock->context, CS_FORCE_EXIT); cs_ctx_drop(sybase_sock->context); } return -1; } /* Allocate a ctlib connection structure */ if (ct_con_alloc(sybase_sock->context, &sybase_sock->connection) != CS_SUCCEED) { radlog(L_ERR,"rlm_sql_sybase(sql_init_socket): Unable to allocate connection structure (ct_con_alloc())"); if (sybase_sock->context != (CS_CONTEXT *)NULL) { ct_exit(sybase_sock->context, CS_FORCE_EXIT); cs_ctx_drop(sybase_sock->context); } return -1; } /* Initialize inline error handling for the connection */ /* if (ct_diag(sybase_sock->connection, CS_INIT, CS_UNUSED, CS_UNUSED, NULL) != CS_SUCCEED) { radlog(L_ERR,"rlm_sql_sybase(sql_init_socket): Unable to initialize error handling (ct_diag())"); if (sybase_sock->context != (CS_CONTEXT *)NULL) { ct_exit(sybase_sock->context, CS_FORCE_EXIT); cs_ctx_drop(sybase_sock->context); } return -1; } */ /* Set User and Password properties for the connection */ if (ct_con_props(sybase_sock->connection, CS_SET, CS_USERNAME, config->sql_login, strlen(config->sql_login), NULL) != CS_SUCCEED) { radlog(L_ERR,"rlm_sql_sybase(sql_init_socket): Unable to set username for connection (ct_con_props())\n%s", sql_error(sqlsocket, config)); if (sybase_sock->context != (CS_CONTEXT *)NULL) { ct_exit(sybase_sock->context, CS_FORCE_EXIT); cs_ctx_drop(sybase_sock->context); } return -1; } if (ct_con_props(sybase_sock->connection, CS_SET, CS_PASSWORD, config->sql_password, strlen(config->sql_password), NULL) != CS_SUCCEED) { radlog(L_ERR,"rlm_sql_sybase(sql_init_socket): Unable to set password for connection (ct_con_props())\n%s", sql_error(sqlsocket, config)); if (sybase_sock->context != (CS_CONTEXT *)NULL) { ct_exit(sybase_sock->context, CS_FORCE_EXIT); cs_ctx_drop(sybase_sock->context); } return -1; } /* Establish the connection */ if (ct_connect(sybase_sock->connection, config->sql_server, strlen(config->sql_server)) != CS_SUCCEED) { radlog(L_ERR,"rlm_sql_sybase(sql_init_socket): Unable to establish connection to symbolic servername %s\n%s", config->sql_server, sql_error(sqlsocket, config)); if (sybase_sock->context != (CS_CONTEXT *)NULL) { ct_exit(sybase_sock->context, CS_FORCE_EXIT); cs_ctx_drop(sybase_sock->context); } return -1; } return 0; } /************************************************************************* * * Function: sql_destroy_socket * * Purpose: Free socket and private connection data * *************************************************************************/ static int sql_destroy_socket(SQLSOCK *sqlsocket, SQL_CONFIG *config) { free(sqlsocket->conn); sqlsocket->conn = NULL; return 0; } /************************************************************************* * * Function: sql_query * * Purpose: Issue a non-SELECT query (ie: update/delete/insert) to * the database. * *************************************************************************/ static int sql_query(SQLSOCK *sqlsocket, SQL_CONFIG *config, char *querystr) { rlm_sql_sybase_sock *sybase_sock = sqlsocket->conn; CS_RETCODE ret, results_ret; CS_INT result_type; if (config->sqltrace) DEBUG(querystr); if (sybase_sock->connection == NULL) { radlog(L_ERR, "Socket not connected"); return -1; } if (ct_cmd_alloc(sybase_sock->connection, &sybase_sock->command) != CS_SUCCEED) { radlog(L_ERR,"rlm_sql_sybase(sql_query): Unable to allocate command structure (ct_cmd_alloc())\n%s", sql_error(sqlsocket, config)); return -1; } if (ct_command(sybase_sock->command, CS_LANG_CMD, querystr, CS_NULLTERM, CS_UNUSED) != CS_SUCCEED) { radlog(L_ERR,"rlm_sql_sybase(sql_query): Unable to initiate command structure (ct_command())\n%s", sql_error(sqlsocket, config)); return -1; } if (ct_send(sybase_sock->command) != CS_SUCCEED) { radlog(L_ERR,"rlm_sql_sybase(sql_query): Unable to send command (ct_send())\n%s", sql_error(sqlsocket, config)); return -1; } /* ** We'll make three calls to ct_results, first to get a success indicator, secondly to get a done indicator, and ** thirdly to get a "nothing left to handle" status. */ /* ** First call to ct_results, ** we need returncode CS_SUCCEED ** and result_type CS_CMD_SUCCEED. */ if ((results_ret = ct_results(sybase_sock->command, &result_type)) == CS_SUCCEED) { if (result_type != CS_CMD_SUCCEED) { if (result_type == CS_ROW_RESULT) { radlog(L_ERR,"rlm_sql_sybase(sql_query): sql_query processed a query returning rows. Use sql_select_query instead!"); } radlog(L_ERR,"rlm_sql_sybase(sql_query): Result failure or unexpected result type from query\n%s", sql_error(sqlsocket, config)); return -1; } } else { switch ((int) results_ret) { case CS_FAIL: /* Serious failure, sybase requires us to cancel and maybe even close connection */ radlog(L_ERR,"rlm_sql_sybase(sql_query): Failure retrieving query results\n%s" , sql_error(sqlsocket, config)); if ((ret = ct_cancel(NULL, sybase_sock->command, CS_CANCEL_ALL)) == CS_FAIL) { radlog(L_ERR,"rlm_sql_sybase(sql_query): cleaning up."); ct_close(sybase_sock->connection, CS_FORCE_CLOSE); sql_close(sqlsocket, config); } return -1; break; default: radlog(L_ERR,"rlm_sql_sybase(sql_query): Unexpected return value from ct_results()\n%s", sql_error(sqlsocket, config)); return -1; } } /* ** Second call to ct_results, ** we need returncode CS_SUCCEED ** and result_type CS_CMD_DONE. */ if ((results_ret = ct_results(sybase_sock->command, &result_type)) == CS_SUCCEED) { if (result_type != CS_CMD_DONE) { radlog(L_ERR,"rlm_sql_sybase(sql_query): Result failure or unexpected result type from query\n%s", sql_error(sqlsocket, config)); return -1; } } else { switch ((int) results_ret) { case CS_FAIL: /* Serious failure, sybase requires us to cancel and maybe even close connection */ radlog(L_ERR,"rlm_sql_sybase(sql_query): Failure retrieving query results\n%s" , sql_error(sqlsocket, config)); if ((ret = ct_cancel(NULL, sybase_sock->command, CS_CANCEL_ALL)) == CS_FAIL) { radlog(L_ERR,"rlm_sql_sybase(sql_query): cleaning up."); ct_close(sybase_sock->connection, CS_FORCE_CLOSE); sql_close(sqlsocket, config); } return -1; break; default: radlog(L_ERR,"rlm_sql_sybase(sql_query): Unexpected return value from ct_results()\n%s", sql_error(sqlsocket, config)); return -1; } } /* ** Third call to ct_results, ** we need returncode CS_END_RESULTS ** result_type will be ignored. */ results_ret = ct_results(sybase_sock->command, &result_type); switch ((int) results_ret) { case CS_FAIL: /* Serious failure, sybase requires us to cancel and maybe even close connection */ radlog(L_ERR,"rlm_sql_sybase(sql_query): Failure retrieving query results\n%s" , sql_error(sqlsocket, config)); if ((ret = ct_cancel(NULL, sybase_sock->command, CS_CANCEL_ALL)) == CS_FAIL) { radlog(L_ERR,"rlm_sql_sybase(sql_query): cleaning up."); ct_close(sybase_sock->connection, CS_FORCE_CLOSE); sql_close(sqlsocket, config); } return -1; break; case CS_END_RESULTS: /* This is where we want to end up */ break; default: radlog(L_ERR,"rlm_sql_sybase(sql_query): Unexpected return value from ct_results()\n%s", sql_error(sqlsocket, config)); return -1; break; } return 0; } /************************************************************************* * * Function: sql_select_query * * Purpose: Issue a select query to the database * * Note: Only the first row from queries returning several rows * will be returned by this function, consequitive rows will * be discarded. * *************************************************************************/ static int sql_select_query(SQLSOCK *sqlsocket, SQL_CONFIG *config, char *querystr) { rlm_sql_sybase_sock *sybase_sock = sqlsocket->conn; CS_RETCODE ret, results_ret; CS_INT result_type; CS_DATAFMT descriptor; int colcount,i; char **rowdata; if (config->sqltrace) DEBUG(querystr); if (sybase_sock->connection == NULL) { radlog(L_ERR, "Socket not connected"); return -1; } if (ct_cmd_alloc(sybase_sock->connection, &sybase_sock->command) != CS_SUCCEED) { radlog(L_ERR,"rlm_sql_sybase(sql_select_query): Unable to allocate command structure (ct_cmd_alloc())\n%s", sql_error(sqlsocket, config)); return -1; } if (ct_command(sybase_sock->command, CS_LANG_CMD, querystr, CS_NULLTERM, CS_UNUSED) != CS_SUCCEED) { radlog(L_ERR,"rlm_sql_sybase(sql_select_query): Unable to initiate command structure (ct_command())\n%s", sql_error(sqlsocket, config)); return -1; } if (ct_send(sybase_sock->command) != CS_SUCCEED) { radlog(L_ERR,"rlm_sql_sybase(sql_select_query): Unable to send command (ct_send())\n%s", sql_error(sqlsocket, config)); return -1; } results_ret = ct_results(sybase_sock->command, &result_type); switch (results_ret) { case CS_SUCCEED: switch (result_type) { case CS_ROW_RESULT: /* ** Houston, we have a row. ** ** We set up a target buffer for the results data, and ** associate the buffer with the results, but the actual ** fetching takes place in sql_fetch_row. The layer above ** MUST call sql_fetch_row and/or sql_finish_select_query ** or this socket will be unusable and may cause segfaults ** if reused later on. */ /* ** Set up the DATAFMT structure that describes our target array ** and tells sybase what we want future ct_fetch calls to do. */ descriptor.datatype = CS_CHAR_TYPE; /* The target buffer is a string */ descriptor.format = CS_FMT_NULLTERM; /* Null termination please */ descriptor.maxlength = MAX_DATASTR_LEN; /* The string arrays are this large */ descriptor.count = 1; /* Fetch one row of data */ descriptor.locale = NULL; /* Don't do NLS stuff */ colcount = sql_num_fields(sqlsocket, config); /* Get number of elements in row result */ rowdata=(char **)rad_malloc(sizeof(char *) * (colcount+1)); /* Space for pointers */ memset(rowdata, 0, (sizeof(char *) * colcount+1)); /* NULL-pad the pointers */ for (i=0; i < colcount; i++) { rowdata[i]=rad_malloc((MAX_DATASTR_LEN * sizeof(char))+1); /* Space to hold the result data */ /* Associate the target buffer with the data */ if (ct_bind(sybase_sock->command, i+1, &descriptor, rowdata[i], NULL, NULL) != CS_SUCCEED) { radlog(L_ERR,"rlm_sql_sybase(sql_select_query): ct_bind() failed)\n%s", sql_error(sqlsocket, config)); return -1; } } rowdata[i]=NULL; /* Terminate the array */ sybase_sock->results=rowdata; break; case CS_CMD_SUCCEED: case CS_CMD_DONE: radlog(L_ERR,"rlm_sql_sybase(sql_select_query): Query returned no data"); break; default: radlog(L_ERR,"rlm_sql_sybase(sql_select_query): Unexpected result type from query\n%s", sql_error(sqlsocket, config)); sql_finish_select_query(sqlsocket, config); return -1; break; } break; case CS_FAIL: /* ** Serious failure, sybase requires us to cancel ** the results and maybe even close the connection. */ radlog(L_ERR,"rlm_sql_sybase(sql_select_query): Failure retrieving query results\n%s" , sql_error(sqlsocket, config)); if ((ret = ct_cancel(NULL, sybase_sock->command, CS_CANCEL_ALL)) == CS_FAIL) { radlog(L_ERR,"rlm_sql_sybase(sql_select_query): cleaning up."); ct_close(sybase_sock->connection, CS_FORCE_CLOSE); sql_close(sqlsocket, config); } return -1; break; default: radlog(L_ERR,"rlm_sql_sybase(sql_select_query): Unexpected return value from ct_results()\n%s", sql_error(sqlsocket, config)); return -1; break; } return 0; } /************************************************************************* * * Function: sql_store_result * * Purpose: database specific store_result function. Returns a result * set for the query. * *************************************************************************/ static int sql_store_result(SQLSOCK *sqlsocket, SQL_CONFIG *config) { /* ** Not needed for Sybase, code that may have gone here is ** in sql_select_query and sql_fetch_row */ return 0; } /************************************************************************* * * Function: sql_num_fields * * Purpose: database specific num_fields function. Returns number * of columns from query * *************************************************************************/ static int sql_num_fields(SQLSOCK *sqlsocket, SQL_CONFIG *config) { rlm_sql_sybase_sock *sybase_sock = sqlsocket->conn; int num; if (ct_res_info(sybase_sock->command, CS_NUMDATA, (CS_INT *)&num, CS_UNUSED, NULL) != CS_SUCCEED) { radlog(L_ERR,"rlm_sql_sybase(sql_num_fields): error retrieving column count: %s", sql_error(sqlsocket, config)); return -1; } return num; } /************************************************************************* * * Function: sql_num_rows * * Purpose: database specific num_rows. Returns number of rows in * query * *************************************************************************/ static int sql_num_rows(SQLSOCK *sqlsocket, SQL_CONFIG *config) { rlm_sql_sybase_sock *sybase_sock = sqlsocket->conn; int num; if (ct_res_info(sybase_sock->command, CS_ROW_COUNT, (CS_INT *)&num, CS_UNUSED, NULL) != CS_SUCCEED) { radlog(L_ERR,"rlm_sql_sybase(sql_num_rows): error retrieving row count: %s", sql_error(sqlsocket, config)); return -1; } return num; } /************************************************************************* * * Function: sql_fetch_row * * Purpose: database specific fetch_row. Returns a SQL_ROW struct * with all the data for the query in 'sqlsocket->row'. Returns * 0 on success, -1 on failure, SQL_DOWN if 'database is down'. * *************************************************************************/ int sql_fetch_row(SQLSOCK *sqlsocket, SQL_CONFIG *config) { rlm_sql_sybase_sock *sybase_sock = sqlsocket->conn; CS_INT ret, count; sqlsocket->row = NULL; ret = ct_fetch(sybase_sock->command, CS_UNUSED, CS_UNUSED, CS_UNUSED, &count); switch (ret) { case CS_FAIL: /* ** Serious failure, sybase requires us to cancel ** the results and maybe even close the connection. */ radlog(L_ERR,"rlm_sql_sybase(sql_fetch_row): Failure fething row data\n%s" , sql_error(sqlsocket, config)); if ((ret = ct_cancel(NULL, sybase_sock->command, CS_CANCEL_ALL)) == CS_FAIL) { radlog(L_ERR,"rlm_sql_sybase(sql_fetch_row): cleaning up."); ct_close(sybase_sock->connection, CS_FORCE_CLOSE); sql_close(sqlsocket, config); } return SQL_DOWN; break; case CS_END_DATA: return 0; break; case CS_SUCCEED: sqlsocket->row = sybase_sock->results; return 0; break; case CS_ROW_FAIL: radlog(L_ERR,"rlm_sql_sybase(sql_fetch_row): Recoverable failure fething row data, try again perhaps?"); return -1; default: radlog(L_ERR,"rlm_sql_sybase(sql_fetch_row): Unexpected returncode from ct_fetch"); return -1; break; } } /************************************************************************* * * Function: sql_free_result * * Purpose: database specific free_result. Frees memory allocated * for a result set * *************************************************************************/ static int sql_free_result(SQLSOCK *sqlsocket, SQL_CONFIG *config) { /* ** Not implemented, never called from rlm_sql anyway ** result buffer is freed in the finish_query functions. */ return 0; } /************************************************************************* * * Function: sql_error * * Purpose: database specific error. Returns error associated with * connection * *************************************************************************/ static const char *sql_error(SQLSOCK *sqlsocket, SQL_CONFIG *config) { static char msg='\0'; /* static char msgbuf[2048]; rlm_sql_sybase_sock *sybase_sock = sqlsocket->conn; CS_INT msgcount; CS_CLIENTMSG cmsg; CS_SERVERMSG smsg; int i; char ctempbuf[2][512]; char stempbuf[2][512]; msgbuf[0]=(char)NULL; ctempbuf[0][0]=(char)NULL; ctempbuf[1][0]=(char)NULL; stempbuf[0][0]=(char)NULL; stempbuf[1][0]=(char)NULL; if (ct_diag(sybase_sock->connection, CS_STATUS, CS_CLIENTMSG_TYPE, CS_UNUSED, &msgcount) != CS_SUCCEED) { radlog(L_ERR,"rlm_sql_sybase(sql_error): Failed to get number of pending Client messages"); return msgbuf; } radlog(L_ERR,"rlm_sql_sybase(sql_error): Number of pending Client messages: %d", (int)msgcount); for (i=1; i<=msgcount; i++) { if (ct_diag(sybase_sock->connection, CS_GET, CS_CLIENTMSG_TYPE, (CS_INT)i, &cmsg) != CS_SUCCEED) { radlog(L_ERR,"rlm_sql_sybase(sql_error): Failed to retrieve pending Client message"); return msgbuf; } sprintf(ctempbuf[i-1],"rlm_sql_sybase: Client Library Error: severity(%ld) number(%ld) origin(%ld) layer(%ld):\n%s", (long)CS_SEVERITY(cmsg.severity), (long)CS_NUMBER(cmsg.msgnumber), (long)CS_ORIGIN(cmsg.msgnumber), (long)CS_LAYER(cmsg.msgnumber), cmsg.msgstring); } if (ct_diag(sybase_sock->connection, CS_STATUS, CS_SERVERMSG_TYPE, CS_UNUSED, &msgcount) != CS_SUCCEED) { radlog(L_ERR,"rlm_sql_sybase(sql_error): Failed to get number of pending Server messages"); return msgbuf; } radlog(L_ERR,"rlm_sql_sybase(sql_error): Number of pending Server messages: %d", (int)msgcount); for (i=1; i<=msgcount; i++) { if (ct_diag(sybase_sock->connection, CS_GET, CS_SERVERMSG_TYPE, (CS_INT)i, &smsg) != CS_SUCCEED) { radlog(L_ERR,"rlm_sql_sybase(sql_error): Failed to retrieve pending Server message"); return msgbuf; } sprintf(stempbuf[i-1],"rlm_sql_sybase: Server message: severity(%ld) number(%ld) origin(%ld) layer(%ld):\n%s", (long)CS_SEVERITY(cmsg.severity), (long)CS_NUMBER(cmsg.msgnumber), (long)CS_ORIGIN(cmsg.msgnumber), (long)CS_LAYER(cmsg.msgnumber), cmsg.msgstring); } sprintf(msgbuf,"%s || %s || %s || %s", ctempbuf[1], ctempbuf[2], stempbuf[1], stempbuf[2]); return msgbuf; */ return &msg; } /************************************************************************* * * Function: sql_close * * Purpose: database specific close. Closes an open database * connection and cleans up any open handles. * *************************************************************************/ static int sql_close(SQLSOCK *sqlsocket, SQL_CONFIG *config) { /* rlm_sql_oracle_sock *oracle_sock = sqlsocket->conn; if (oracle_sock->conn) { OCILogoff (oracle_sock->conn, oracle_sock->errHandle); } if (oracle_sock->queryHandle) { OCIHandleFree((dvoid *)oracle_sock->queryHandle, (ub4) OCI_HTYPE_STMT); } if (oracle_sock->errHandle) { OCIHandleFree((dvoid *)oracle_sock->errHandle, (ub4) OCI_HTYPE_ERROR); } if (oracle_sock->env) { OCIHandleFree((dvoid *)oracle_sock->env, (ub4) OCI_HTYPE_ENV); } oracle_sock->conn = NULL; */ return 0; } /************************************************************************* * * Function: sql_finish_query * * Purpose: End the query, such as freeing memory * *************************************************************************/ static int sql_finish_query(SQLSOCK *sqlsocket, SQL_CONFIG *config) { rlm_sql_sybase_sock *sybase_sock = sqlsocket->conn; ct_cancel(NULL, sybase_sock->command, CS_CANCEL_ALL); if (ct_cmd_drop(sybase_sock->command) != CS_SUCCEED) { radlog(L_ERR,"rlm_sql_sybase(sql_finish_query): Freeing command structure failed."); return -1; } return 0; } /************************************************************************* * * Function: sql_finish_select_query * * Purpose: End the select query, such as freeing memory or result * *************************************************************************/ static int sql_finish_select_query(SQLSOCK *sqlsocket, SQL_CONFIG *config) { rlm_sql_sybase_sock *sybase_sock = sqlsocket->conn; int i=0; ct_cancel(NULL, sybase_sock->command, CS_CANCEL_ALL); if (ct_cmd_drop(sybase_sock->command) != CS_SUCCEED) { radlog(L_ERR,"rlm_sql_sybase(sql_finish_select_query): Freeing command structure failed."); return -1; } if (sybase_sock->results) { while(sybase_sock->results[i]) free(sybase_sock->results[i++]); free(sybase_sock->results); sybase_sock->results=NULL; } return 0; } /************************************************************************* * * Function: sql_affected_rows * * Purpose: Return the number of rows affected by the query (update, * or insert) * *************************************************************************/ static int sql_affected_rows(SQLSOCK *sqlsocket, SQL_CONFIG *config) { return sql_num_rows(sqlsocket, config); } /* Exported to rlm_sql */ rlm_sql_module_t rlm_sql_sybase = { "rlm_sql_sybase", sql_init_socket, sql_destroy_socket, sql_query, sql_select_query, sql_store_result, sql_num_fields, sql_num_rows, sql_fetch_row, sql_free_result, sql_error, sql_close, sql_finish_query, sql_finish_select_query, sql_affected_rows }; freeradius-server/src/modules/rlm_sql/drivers/rlm_sql_unixodbc/000077500000000000000000000000001257552170400254555ustar00rootroot00000000000000freeradius-server/src/modules/rlm_sql/drivers/rlm_sql_unixodbc/.gitignore000066400000000000000000000000111257552170400274350ustar00rootroot00000000000000Makefile freeradius-server/src/modules/rlm_sql/drivers/rlm_sql_unixodbc/Makefile.in000066400000000000000000000002621257552170400275220ustar00rootroot00000000000000include ../../../../../Make.inc TARGET = @targetname@ SRCS = sql_unixodbc.c RLM_SQL_CFLAGS = @sql_unixodbc_cflags@ RLM_SQL_LIBS = @sql_unixodbc_ldflags@ include ../rules.mak freeradius-server/src/modules/rlm_sql/drivers/rlm_sql_unixodbc/configure000077500000000000000000003320741257552170400273750ustar00rootroot00000000000000#! /bin/sh # From configure.in Revision. # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.61. # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, # 2002, 2003, 2004, 2005, 2006 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=: # 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 # PATH needs CR # 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 # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false 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.) as_nl=' ' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. 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 # Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # CDPATH. $as_unset CDPATH if test "x$CONFIG_SHELL" = x; then if (eval ":") 2>/dev/null; then as_have_required=yes else as_have_required=no fi if test $as_have_required = yes && (eval ": (as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=\$LINENO as_lineno_2=\$LINENO test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } ") 2> /dev/null; then : else as_candidate_shells= as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. case $as_dir in /*) for as_base in sh bash ksh sh5; do as_candidate_shells="$as_candidate_shells $as_dir/$as_base" done;; esac done IFS=$as_save_IFS for as_shell in $as_candidate_shells $SHELL; do # Try only shells that exist, to save several forks. if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { ("$as_shell") 2> /dev/null <<\_ASEOF 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 : _ASEOF }; then CONFIG_SHELL=$as_shell as_have_required=yes if { "$as_shell" 2> /dev/null <<\_ASEOF 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 : (as_func_return () { (exit $1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = "$1" ); then : else exitcode=1 echo positional parameters were not saved. fi test $exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } _ASEOF }; then break fi fi done if test "x$CONFIG_SHELL" != x; then for as_var in BASH_ENV ENV do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done export CONFIG_SHELL exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} fi if test $as_have_required = no; then echo This script requires a shell more modern than all the echo shells that I found on your system. Please install a echo modern shell, or manually run the script under such a echo shell if you do have one. { (exit 1); exit 1; } fi fi fi (eval "as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0") || { echo No shell found that supports shell functions. echo Please tell autoconf@gnu.org about your system, echo including any error possibly output before this echo message } as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, and appends # trailing '-' during substitution so that $LINENO is not a special # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # scripts with optimization help from Paolo Bonzini. 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" || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi 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 fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi 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=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, 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= SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME= PACKAGE_TARNAME= PACKAGE_VERSION= PACKAGE_STRING= PACKAGE_BUGREPORT= ac_unique_file="sql_unixodbc.c" ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datarootdir datadir sysconfdir sharedstatedir localstatedir includedir oldincludedir docdir infodir htmldir dvidir pdfdir psdir libdir localedir mandir DEFS ECHO_C ECHO_N ECHO_T LIBS build_alias host_alias target_alias CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT sql_unixodbc_ldflags sql_unixodbc_cflags targetname LIBOBJS LTLIBOBJS' ac_subst_files='' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS' # Initialize some variables set by options. ac_init_help= ac_init_version=false # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *) ac_optarg=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_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` eval enable_$ac_feature=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_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` eval enable_$ac_feature=\$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_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/[-.]/_/g'` eval with_$ac_package=\$ac_optarg ;; -without-* | --without-*) ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/[-.]/_/g'` eval with_$ac_package=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 ;; -*) { echo "$as_me: error: unrecognized option: $ac_option Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && 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'` { echo "$as_me: error: missing argument to $ac_option" >&2 { (exit 1); exit 1; }; } fi # Be sure to have absolute directory names. 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 case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; } 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 echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || { echo "$as_me: error: Working directory cannot be determined" >&2 { (exit 1); exit 1; }; } test "X$ac_ls_di" = "X$ac_pwd_ls_di" || { echo "$as_me: error: pwd does not report name of working directory" >&2 { (exit 1); exit 1; }; } # 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 -- "$0" || $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$0" : 'X\(//\)[^/]' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X"$0" | 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 .." { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2 { (exit 1); exit 1; }; } pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures this package to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF _ACEOF fi if test -n "$ac_init_help"; then cat <<\_ACEOF Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-unixodbc-include-dir=DIR Directory where the unixODBC includes may be found --with-unixodbc-lib-dir=DIR Directory where the unixODBC libraries may be found --with-unixodbc-dir=DIR Base directory where unixODBC is installed 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 C/C++/Objective C preprocessor flags, e.g. -I if you have headers in a nonstandard directory Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. _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" || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`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 echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF configure generated by GNU Autoconf 2.61 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 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 cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by $as_me, which was generated by GNU Autoconf 2.61. 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=. 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=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; 2) ac_configure_args1="$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 ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac done done $as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } $as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export 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 cat <<\_ASBOX ## ---------------- ## ## Cache variables. ## ## ---------------- ## _ASBOX 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_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( *) $as_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 cat <<\_ASBOX ## ----------------- ## ## Output variables. ## ## ----------------- ## _ASBOX echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then cat <<\_ASBOX ## ------------------- ## ## File substitutions. ## ## ------------------- ## _ASBOX echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then cat <<\_ASBOX ## ----------- ## ## confdefs.h. ## ## ----------- ## _ASBOX echo cat confdefs.h echo fi test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" 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'; { (exit 1); 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 # 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 # Let the site file select an alternate cache file if it wants to. # Prefer explicitly selected file to automatically selected ones. if test -n "$CONFIG_SITE"; then set x "$CONFIG_SITE" elif test "x$prefix" != xNONE; then set x "$prefix/share/config.site" "$prefix/etc/config.site" else set x "$ac_default_prefix/share/config.site" \ "$ac_default_prefix/etc/config.site" fi shift for ac_site_file do if test -r "$ac_site_file"; then { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" 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. if test -f "$cache_file"; then { echo "$as_me:$LINENO: loading cache $cache_file" >&5 echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { echo "$as_me:$LINENO: creating cache $cache_file" >&5 echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 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 { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 echo "$as_me: former value: $ac_old_val" >&2;} { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 echo "$as_me: current value: $ac_new_val" >&2;} ac_cache_corrupted=: fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`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. *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 echo "$as_me: error: changes in the environment can compromise the build" >&2;} { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} { (exit 1); exit 1; }; } 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 fail= SMART_LIBS= SMART_CLFAGS= if test x$with_rlm_sql_unixodbc != xno; then unixodbc_include_dir= # Check whether --with-unixodbc-include-dir was given. if test "${with_unixodbc_include_dir+set}" = set; then withval=$with_unixodbc_include_dir; case "$withval" in no) { { echo "$as_me:$LINENO: error: Need unixodbc-include-dir" >&5 echo "$as_me: error: Need unixodbc-include-dir" >&2;} { (exit 1); exit 1; }; } ;; yes) ;; *) unixodbc_include_dir="$withval" ;; esac fi unixodbc_lib_dir= # Check whether --with-unixodbc-lib-dir was given. if test "${with_unixodbc_lib_dir+set}" = set; then withval=$with_unixodbc_lib_dir; case "$withval" in no) { { echo "$as_me:$LINENO: error: Need unixodbc-lib-dir" >&5 echo "$as_me: error: Need unixodbc-lib-dir" >&2;} { (exit 1); exit 1; }; } ;; yes) ;; *) unixodbc_lib_dir="$withval" ;; esac fi # Check whether --with-unixodbc-dir was given. if test "${with_unixodbc_dir+set}" = set; then withval=$with_unixodbc_dir; case "$withval" in no) { { echo "$as_me:$LINENO: error: Need unixodbc-dir" >&5 echo "$as_me: error: Need unixodbc-dir" >&2;} { (exit 1); exit 1; }; } ;; yes) ;; *) unixodbc_lib_dir="$withval/lib" unixodbc_include_dir="$withval/include" ;; esac fi smart_try_dir="$unixodbc_lib_dir" 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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}gcc" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="gcc" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}cc" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="$ac_prog" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&5 echo "$as_me: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } # Provide some information about the compiler. echo "$as_me:$LINENO: checking for C compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (ac_try="$ac_compiler --version >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -v >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -V >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out 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. { echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6; } ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # # List of possible output files, starting from the most likely. # The algorithm is not robust to junk in `.', hence go to wildcards (a.*) # only as a last resort. b.out is created by i960 compilers. ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out' # # The IRIX 6 linker writes into existing files which may not be # executable, retaining their permissions. Remove them first so a # subsequent execution test works. ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link_default") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; 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 | *.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 { echo "$as_me:$LINENO: result: $ac_file" >&5 echo "${ECHO_T}$ac_file" >&6; } if test -z "$ac_file"; then echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: C compiler cannot create executables See \`config.log' for more details." >&5 echo "$as_me: error: C compiler cannot create executables See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } fi ac_exeext=$ac_cv_exeext # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { echo "$as_me:$LINENO: checking whether the C compiler works" >&5 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6; } # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then if { ac_try='./$ac_file' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { echo "$as_me:$LINENO: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&5 echo "$as_me: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi fi fi { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } rm -f a.out a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; } { echo "$as_me:$LINENO: result: $cross_compiling" >&5 echo "${ECHO_T}$cross_compiling" >&6; } { echo "$as_me:$LINENO: checking for suffix of executables" >&5 echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; } if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; 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 | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest$ac_cv_exeext { echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 echo "${ECHO_T}$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT { echo "$as_me:$LINENO: checking for suffix of object files" >&5 echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; } if test "${ac_cv_objext+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; 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 ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 echo "${ECHO_T}$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; } if test "${ac_cv_c_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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 { echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; } GCC=`test $ac_compiler_gnu = yes && echo yes` ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CFLAGS="" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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 { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 echo "${ECHO_T}$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 { echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_c89+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_c89=$ac_arg else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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) { echo "$as_me:$LINENO: result: none needed" >&5 echo "${ECHO_T}none needed" >&6; } ;; xno) { echo "$as_me:$LINENO: result: unsupported" >&5 echo "${ECHO_T}unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;; 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 sm_lib_safe=`echo "odbc" | sed 'y%./+-%__p_%'` sm_func_safe=`echo "SQLConnect" | sed 'y%./+-%__p_%'` { echo "$as_me:$LINENO: checking for SQLConnect in -lodbc" >&5 echo $ECHO_N "checking for SQLConnect in -lodbc... $ECHO_C" >&6; } old_LIBS="$LIBS" smart_lib= smart_lib_dir= if test "x$smart_try_dir" != "x"; then for try in $smart_try_dir; do LIBS="-L$try -lodbc $old_LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ extern char SQLConnect(); int main () { SQLConnect() ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then smart_lib="-L$try -lodbc" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test "x$smart_lib" != "x"; then break; fi done LIBS="$old_LIBS" fi if test "x$smart_lib" = "x"; then LIBS="-lodbc $old_LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ extern char SQLConnect(); int main () { SQLConnect() ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then smart_lib="-lodbc" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS="$old_LIBS" fi if test "x$smart_lib" = "x"; then if test "x$LOCATE" != "x"; then DIRS= file=libodbc${libltdl_cv_shlibext} for x in `${LOCATE} $file 2>/dev/null`; do base=`echo $x | sed "s%/${file}%%"` if test "x$x" = "x$base"; then continue; fi dir=`${DIRNAME} $x 2>/dev/null` exclude=`echo ${dir} | ${GREP} /home` if test "x$exclude" != "x"; then continue fi already=`echo \$smart_lib_dir ${DIRS} | ${GREP} ${dir}` if test "x$already" = "x"; then DIRS="$DIRS $dir" fi done fi eval "smart_lib_dir=\"\$smart_lib_dir $DIRS\"" if test "x$LOCATE" != "x"; then DIRS= file=libodbc.a for x in `${LOCATE} $file 2>/dev/null`; do base=`echo $x | sed "s%/${file}%%"` if test "x$x" = "x$base"; then continue; fi dir=`${DIRNAME} $x 2>/dev/null` exclude=`echo ${dir} | ${GREP} /home` if test "x$exclude" != "x"; then continue fi already=`echo \$smart_lib_dir ${DIRS} | ${GREP} ${dir}` if test "x$already" = "x"; then DIRS="$DIRS $dir" fi done fi eval "smart_lib_dir=\"\$smart_lib_dir $DIRS\"" for try in $smart_lib_dir /usr/local/lib /opt/lib; do LIBS="-L$try -lodbc $old_LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ extern char SQLConnect(); int main () { SQLConnect() ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then smart_lib="-L$try -lodbc" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test "x$smart_lib" != "x"; then break; fi done LIBS="$old_LIBS" fi if test "x$smart_lib" != "x"; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } eval "ac_cv_lib_${sm_lib_safe}_${sm_func_safe}=yes" LIBS="$smart_lib $old_LIBS" SMART_LIBS="$smart_lib $SMART_LIBS" else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_cv_lib_odbc_SQLConnect" != xyes; then fail="$fail libodbc" fi smart_try_dir="$unixodbc_include_dir" ac_safe=`echo "sql.h" | sed 'y%./+-%__pm%'` { echo "$as_me:$LINENO: checking for sql.h" >&5 echo $ECHO_N "checking for sql.h... $ECHO_C" >&6; } old_CFLAGS="$CFLAGS" smart_include= smart_include_dir= if test "x$smart_try_dir" != "x"; then for try in $smart_try_dir; do CFLAGS="$old_CFLAGS -I$try" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { int a = 1; ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then smart_include="-I$try" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 smart_include= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test "x$smart_include" != "x"; then break; fi done CFLAGS="$old_CFLAGS" fi if test "x$smart_include" = "x"; then cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { int a = 1; ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then smart_include=" " else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 smart_include= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test "x$smart_include" = "x"; then if test "x$LOCATE" != "x"; then DIRS= file=sql.h for x in `${LOCATE} $file 2>/dev/null`; do base=`echo $x | sed "s%/${file}%%"` if test "x$x" = "x$base"; then continue; fi dir=`${DIRNAME} $x 2>/dev/null` exclude=`echo ${dir} | ${GREP} /home` if test "x$exclude" != "x"; then continue fi already=`echo \$smart_include_dir ${DIRS} | ${GREP} ${dir}` if test "x$already" = "x"; then DIRS="$DIRS $dir" fi done fi eval "smart_include_dir=\"\$smart_include_dir $DIRS\"" for try in $smart_include_dir /usr/local/include /opt/include; do CFLAGS="$old_CFLAGS -I$try" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { int a = 1; ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then smart_include="-I$try" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 smart_include= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test "x$smart_include" != "x"; then break; fi done CFLAGS="$old_CFLAGS" fi if test "x$smart_include" != "x"; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } eval "ac_cv_header_$ac_safe=yes" CFLAGS="$old_CFLAGS $smart_include" SMART_CFLAGS="$SMART_CFLAGS $smart_include" else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_cv_header_sql_h" != xyes; then fail="$fail sql.h" fi targetname=rlm_sql_unixodbc else targetname= echo \*\*\* module rlm_sql_unixodbc is disabled. fi if test "x$fail" != x; then if test "x${enable_strict_dependencies}" = xyes; then { { echo "$as_me:$LINENO: error: set --without-rlm_sql_unixodbc to disable it explicitly." >&5 echo "$as_me: error: set --without-rlm_sql_unixodbc to disable it explicitly." >&2;} { (exit 1); exit 1; }; } else { echo "$as_me:$LINENO: WARNING: silently not building rlm_sql_unixodbc." >&5 echo "$as_me: WARNING: silently not building rlm_sql_unixodbc." >&2;} { echo "$as_me:$LINENO: WARNING: FAILURE: rlm_sql_unixodbc requires:$fail." >&5 echo "$as_me: WARNING: FAILURE: rlm_sql_unixodbc requires:$fail." >&2;}; targetname= fi fi sql_unixodbc_ldflags="$SMART_LIBS" sql_unixodbc_cflags="$SMART_CFLAGS" unset ac_cv_env_LIBS_set unset ac_cv_env_LIBS_value ac_config_files="$ac_config_files 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_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( *) $as_unset $ac_var ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then test "x$cache_file" != "x/dev/null" && { echo "$as_me:$LINENO: updating cache $cache_file" >&5 echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 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}' # Transform confdefs.h into DEFS. # Protect against shell expansion while executing Makefile rules. # Protect against Makefile macro expansion. # # If the first sed substitution is executed (which looks for macros that # take arguments), then branch to the quote section. Otherwise, # look for a macro that doesn't take arguments. ac_script=' t clear :clear s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g t quote s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g t quote b any :quote s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g s/\[/\\&/g s/\]/\\&/g s/\$/$$/g H :any ${ g s/^\n// s/\n/ /g p } ' DEFS=`sed -n "$ac_script" confdefs.h` ac_libobjs= ac_ltlibobjs= 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=`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. ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs : ${CONFIG_STATUS=./config.status} ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >$CONFIG_STATUS <<_ACEOF #! $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} _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ## --------------------- ## ## 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=: # 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 # PATH needs CR # 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 # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false 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.) as_nl=' ' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. 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 # Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # CDPATH. $as_unset CDPATH as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, and appends # trailing '-' during substitution so that $LINENO is not a special # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # scripts with optimization help from Paolo Bonzini. 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" || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi 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 fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi 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=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 # Save the log message, to keep $[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by $as_me, which was generated by GNU Autoconf 2.61. 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 cat >>$CONFIG_STATUS <<_ACEOF # Files that config.status was made for. config_files="$ac_config_files" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit -q, --quiet 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 Configuration files: $config_files Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ config.status configured by $0, generated by GNU Autoconf 2.61, with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" Copyright (C) 2006 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' _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # If no file are specified by the user, then we need to provide default # value. By we need to know if files were specified by the user. 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=$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 ) echo "$ac_cs_version"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift CONFIG_FILES="$CONFIG_FILES $ac_optarg" ac_need_defaults=false;; --he | --h | --help | --hel | -h ) 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. -*) { echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *) ac_config_targets="$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 if \$ac_cs_recheck; then echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 CONFIG_SHELL=$SHELL export CONFIG_SHELL exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; 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 fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= trap 'exit_status=$? { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status ' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || { echo "$me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } # # Set up the sed scripts for CONFIG_FILES section. # # No need to generate the scripts if there are no CONFIG_FILES. # This happens for instance when ./config.status config.h if test -n "$CONFIG_FILES"; then _ACEOF ac_delim='%!_!# ' for ac_last_try in false false false false false :; do cat >conf$$subs.sed <<_ACEOF SHELL!$SHELL$ac_delim PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim PACKAGE_NAME!$PACKAGE_NAME$ac_delim PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim PACKAGE_STRING!$PACKAGE_STRING$ac_delim PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim exec_prefix!$exec_prefix$ac_delim prefix!$prefix$ac_delim program_transform_name!$program_transform_name$ac_delim bindir!$bindir$ac_delim sbindir!$sbindir$ac_delim libexecdir!$libexecdir$ac_delim datarootdir!$datarootdir$ac_delim datadir!$datadir$ac_delim sysconfdir!$sysconfdir$ac_delim sharedstatedir!$sharedstatedir$ac_delim localstatedir!$localstatedir$ac_delim includedir!$includedir$ac_delim oldincludedir!$oldincludedir$ac_delim docdir!$docdir$ac_delim infodir!$infodir$ac_delim htmldir!$htmldir$ac_delim dvidir!$dvidir$ac_delim pdfdir!$pdfdir$ac_delim psdir!$psdir$ac_delim libdir!$libdir$ac_delim localedir!$localedir$ac_delim mandir!$mandir$ac_delim DEFS!$DEFS$ac_delim ECHO_C!$ECHO_C$ac_delim ECHO_N!$ECHO_N$ac_delim ECHO_T!$ECHO_T$ac_delim LIBS!$LIBS$ac_delim build_alias!$build_alias$ac_delim host_alias!$host_alias$ac_delim target_alias!$target_alias$ac_delim CC!$CC$ac_delim CFLAGS!$CFLAGS$ac_delim LDFLAGS!$LDFLAGS$ac_delim CPPFLAGS!$CPPFLAGS$ac_delim ac_ct_CC!$ac_ct_CC$ac_delim EXEEXT!$EXEEXT$ac_delim OBJEXT!$OBJEXT$ac_delim sql_unixodbc_ldflags!$sql_unixodbc_ldflags$ac_delim sql_unixodbc_cflags!$sql_unixodbc_cflags$ac_delim targetname!$targetname$ac_delim LIBOBJS!$LIBOBJS$ac_delim LTLIBOBJS!$LTLIBOBJS$ac_delim _ACEOF if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 49; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` if test -n "$ac_eof"; then ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` ac_eof=`expr $ac_eof + 1` fi cat >>$CONFIG_STATUS <<_ACEOF cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof /@[a-zA-Z_][a-zA-Z_0-9]*@/!b end _ACEOF sed ' s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g s/^/s,@/; s/!/@,|#_!!_#|/ :n t n s/'"$ac_delim"'$/,g/; t s/$/\\/; p N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n ' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF :end s/|#_!!_#|//g CEOF$ac_eof _ACEOF # VPATH may cause trouble with some makes, so we remove $(srcdir), # ${srcdir} and @srcdir@ 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[ ]*=/{ s/:*\$(srcdir):*/:/ s/:*\${srcdir}:*/:/ s/:*@srcdir@:*/:/ s/^\([^=]*=[ ]*\):*/\1/ s/:*$// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF fi # test -n "$CONFIG_FILES" for ac_tag in :F $CONFIG_FILES do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5 echo "$as_me: error: Invalid tag $ac_tag." >&2;} { (exit 1); exit 1; }; };; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 echo "$as_me: error: cannot find input file: $ac_f" >&2;} { (exit 1); exit 1; }; };; esac ac_file_inputs="$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 "`IFS=: echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure." if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { echo "$as_me:$LINENO: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} fi case $ac_tag in *:-:* | *:-) cat >"$tmp/stdin";; 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 || 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" case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`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 || 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" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 echo "$as_me: error: cannot create directory $as_dir" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`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 # _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # 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= case `sed -n '/datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p ' $ac_file_inputs` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF 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 sed "$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s&@configure_input@&$configure_input&;t t s&@top_builddir@&$ac_top_builddir_sub&;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 $ac_datarootdir_hack " $ac_file_inputs | sed -f "$tmp/subs-1.sed" >$tmp/out test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&5 echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&2;} rm -f "$tmp/stdin" case $ac_file in -) cat "$tmp/out"; rm -f "$tmp/out";; *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;; esac ;; esac done # for ac_tag { (exit 0); exit 0; } _ACEOF chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save # 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 || { (exit 1); exit 1; } fi freeradius-server/src/modules/rlm_sql/drivers/rlm_sql_unixodbc/configure.in000066400000000000000000000042111257552170400277640ustar00rootroot00000000000000AC_PREREQ([2.59]) AC_INIT(sql_unixodbc.c) AC_REVISION($Revision$) AC_DEFUN(modname,[rlm_sql_unixodbc]) fail= SMART_LIBS= SMART_CLFAGS= if test x$with_[]modname != xno; then dnl extra argument: --with-unixodbc-include-dir unixodbc_include_dir= AC_ARG_WITH(unixodbc-include-dir, [AS_HELP_STRING([--with-unixodbc-include-dir=DIR], [Directory where the unixODBC includes may be found])], [case "$withval" in no) AC_MSG_ERROR(Need unixodbc-include-dir) ;; yes) ;; *) unixodbc_include_dir="$withval" ;; esac]) dnl extra argument: --with-unixodbc-lib-dir unixodbc_lib_dir= AC_ARG_WITH(unixodbc-lib-dir, [AS_HELP_STRING([--with-unixodbc-lib-dir=DIR], [Directory where the unixODBC libraries may be found])], [case "$withval" in no) AC_MSG_ERROR(Need unixodbc-lib-dir) ;; yes) ;; *) unixodbc_lib_dir="$withval" ;; esac]) dnl extra argument: --with-unixodbc-dir AC_ARG_WITH(unixodbc-dir, [AS_HELP_STRING([--with-unixodbc-dir=DIR], [Base directory where unixODBC is installed])], [case "$withval" in no) AC_MSG_ERROR(Need unixodbc-dir) ;; yes) ;; *) unixodbc_lib_dir="$withval/lib" unixodbc_include_dir="$withval/include" ;; esac]) dnl Check for SQLConnect in -lodbc smart_try_dir="$unixodbc_lib_dir" FR_SMART_CHECK_LIB(odbc, SQLConnect) if test "x$ac_cv_lib_odbc_SQLConnect" != xyes; then fail="$fail libodbc" fi dnl Check for sql.h smart_try_dir="$unixodbc_include_dir" FR_SMART_CHECK_INCLUDE(sql.h) if test "x$ac_cv_header_sql_h" != xyes; then fail="$fail sql.h" fi targetname=modname else targetname= echo \*\*\* module modname is disabled. fi dnl Don't change this section. if test "x$fail" != x; then if test "x${enable_strict_dependencies}" = xyes; then AC_MSG_ERROR([set --without-]modname[ to disable it explicitly.]) else AC_MSG_WARN([silently not building ]modname[.]) AC_MSG_WARN([FAILURE: ]modname[ requires:$fail.]); targetname= fi fi sql_unixodbc_ldflags="$SMART_LIBS" sql_unixodbc_cflags="$SMART_CFLAGS" AC_SUBST(sql_unixodbc_ldflags) AC_SUBST(sql_unixodbc_cflags) AC_SUBST(targetname) AC_OUTPUT(Makefile) freeradius-server/src/modules/rlm_sql/drivers/rlm_sql_unixodbc/sql_unixodbc.c000066400000000000000000000343111257552170400303150ustar00rootroot00000000000000/* * sql_unixodbc.c unixODBC rlm_sql driver * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2000,2006 The FreeRADIUS server project * Copyright 2000 Dmitri Ageev */ #include RCSID("$Id$") #include #include #include "rlm_sql.h" typedef struct rlm_sql_unixodbc_sock { SQLHENV env_handle; SQLHDBC dbc_handle; SQLHSTMT stmt_handle; SQL_ROW row; void *conn; } rlm_sql_unixodbc_sock; #include #include /* Forward declarations */ static const char *sql_error(SQLSOCK *sqlsocket, SQL_CONFIG *config); static int sql_state(long err_handle, SQLSOCK *sqlsocket, SQL_CONFIG *config); static int sql_free_result(SQLSOCK *sqlsocket, SQL_CONFIG *config); static int sql_affected_rows(SQLSOCK *sqlsocket, SQL_CONFIG *config); static int sql_num_fields(SQLSOCK *sqlsocket, SQL_CONFIG *config); /************************************************************************* * * Function: sql_init_socket * * Purpose: Establish connection to the db * *************************************************************************/ static int sql_init_socket(SQLSOCK *sqlsocket, SQL_CONFIG *config) { rlm_sql_unixodbc_sock *unixodbc_sock; long err_handle; if (!sqlsocket->conn) { sqlsocket->conn = (rlm_sql_unixodbc_sock *)rad_malloc(sizeof(rlm_sql_unixodbc_sock)); if (!sqlsocket->conn) { return -1; } } unixodbc_sock = sqlsocket->conn; memset(unixodbc_sock, 0, sizeof(*unixodbc_sock)); /* 1. Allocate environment handle and register version */ err_handle = SQLAllocHandle(SQL_HANDLE_ENV,SQL_NULL_HANDLE,&unixodbc_sock->env_handle); if (sql_state(err_handle, sqlsocket, config)) { radlog(L_ERR, "rlm_sql_unixodbc: Can't allocate environment handle\n"); return -1; } err_handle = SQLSetEnvAttr(unixodbc_sock->env_handle, SQL_ATTR_ODBC_VERSION, (void*)SQL_OV_ODBC3, 0); if (sql_state(err_handle, sqlsocket, config)) { radlog(L_ERR, "rlm_sql_unixodbc: Can't register ODBC version\n"); SQLFreeHandle(SQL_HANDLE_ENV, unixodbc_sock->env_handle); return -1; } /* 2. Allocate connection handle */ err_handle = SQLAllocHandle(SQL_HANDLE_DBC, unixodbc_sock->env_handle, &unixodbc_sock->dbc_handle); if (sql_state(err_handle, sqlsocket, config)) { radlog(L_ERR, "rlm_sql_unixodbc: Can't allocate connection handle\n"); SQLFreeHandle(SQL_HANDLE_ENV, unixodbc_sock->env_handle); return -1; } /* 3. Connect to the datasource */ err_handle = SQLConnect(unixodbc_sock->dbc_handle, (SQLCHAR*) config->sql_server, strlen(config->sql_server), (SQLCHAR*) config->sql_login, strlen(config->sql_login), (SQLCHAR*) config->sql_password, strlen(config->sql_password)); if (sql_state(err_handle, sqlsocket, config)) { radlog(L_ERR, "rlm_sql_unixodbc: Connection failed\n"); SQLFreeHandle(SQL_HANDLE_DBC, unixodbc_sock->dbc_handle); SQLFreeHandle(SQL_HANDLE_ENV, unixodbc_sock->env_handle); return -1; } /* 4. Allocate the statement */ err_handle = SQLAllocStmt(unixodbc_sock->dbc_handle, &unixodbc_sock->stmt_handle); if (sql_state(err_handle, sqlsocket, config)) { radlog(L_ERR, "rlm_sql_unixodbc: Can't allocate the statement\n"); return -1; } return 0; } /************************************************************************* * * Function: sql_destroy_socket * * Purpose: Free socket and private connection data * *************************************************************************/ static int sql_destroy_socket(SQLSOCK *sqlsocket, UNUSED SQL_CONFIG *config) { free(sqlsocket->conn); sqlsocket->conn = NULL; return 0; } /************************************************************************* * * Function: sql_query * * Purpose: Issue a non-SELECT query (ie: update/delete/insert) to * the database. * *************************************************************************/ static int sql_query(SQLSOCK *sqlsocket, SQL_CONFIG *config, char *querystr) { rlm_sql_unixodbc_sock *unixodbc_sock = sqlsocket->conn; long err_handle; int state; if (config->sqltrace) radlog(L_DBG, "query: %s", querystr); /* Executing query */ err_handle = SQLExecDirect(unixodbc_sock->stmt_handle, (SQLCHAR *)querystr, strlen(querystr)); if ((state = sql_state(err_handle, sqlsocket, config))) { if(state == SQL_DOWN) radlog(L_INFO, "rlm_sql_unixodbc: rlm_sql will attempt to reconnect\n"); return state; } return 0; } /************************************************************************* * * Function: sql_select_query * * Purpose: Issue a select query to the database * *************************************************************************/ static int sql_select_query(SQLSOCK *sqlsocket, SQL_CONFIG *config, char *querystr) { rlm_sql_unixodbc_sock *unixodbc_sock = sqlsocket->conn; SQLINTEGER column; SQLLEN len; int numfields; int state; /* Only state = 0 means success */ if((state = sql_query(sqlsocket, config, querystr))) return state; numfields=sql_num_fields(sqlsocket, config); if(numfields < 0) return -1; /* Reserving memory for result */ unixodbc_sock->row = (char **) rad_malloc((numfields+1)*sizeof(char *)); unixodbc_sock->row[numfields] = NULL; for(column=1; column<=numfields; column++) { SQLColAttributes(unixodbc_sock->stmt_handle,((SQLUSMALLINT) column),SQL_COLUMN_LENGTH,NULL,0,NULL,&len); unixodbc_sock->row[column-1] = (char*)rad_malloc((int)++len); SQLBindCol(unixodbc_sock->stmt_handle, column, SQL_C_CHAR, (SQLCHAR *)unixodbc_sock->row[column-1], len, NULL); } return 0; } /************************************************************************* * * Function: sql_store_result * * Purpose: database specific store_result function. Returns a result * set for the query. * *************************************************************************/ static int sql_store_result(UNUSED SQLSOCK *sqlsocket, UNUSED SQL_CONFIG *config) { /* Not used */ return 0; } /************************************************************************* * * Function: sql_num_fields * * Purpose: database specific num_fields function. Returns number * of columns from query * *************************************************************************/ static int sql_num_fields(SQLSOCK *sqlsocket, SQL_CONFIG *config) { rlm_sql_unixodbc_sock *unixodbc_sock = sqlsocket->conn; long err_handle; SQLSMALLINT num_fields = 0; err_handle = SQLNumResultCols(unixodbc_sock->stmt_handle,&num_fields); if (sql_state(err_handle, sqlsocket, config)) return -1; return num_fields; } /************************************************************************* * * Function: sql_num_rows * * Purpose: database specific num_rows. Returns number of rows in * query * *************************************************************************/ static int sql_num_rows(SQLSOCK *sqlsocket, SQL_CONFIG *config) { return sql_affected_rows(sqlsocket, config); } /************************************************************************* * * Function: sql_fetch_row * * Purpose: database specific fetch_row. Returns a SQL_ROW struct * with all the data for the query in 'sqlsocket->row'. Returns * 0 on success, -1 on failure, SQL_DOWN if 'database is down'. * *************************************************************************/ static int sql_fetch_row(SQLSOCK *sqlsocket, SQL_CONFIG *config) { rlm_sql_unixodbc_sock *unixodbc_sock = sqlsocket->conn; long err_handle; int state; sqlsocket->row = NULL; err_handle = SQLFetch(unixodbc_sock->stmt_handle); if(err_handle == SQL_NO_DATA_FOUND) return 0; if ((state = sql_state(err_handle, sqlsocket, config))) { if(state == SQL_DOWN) radlog(L_INFO, "rlm_sql_unixodbc: rlm_sql will attempt to reconnect\n"); return state; } sqlsocket->row = unixodbc_sock->row; return 0; } /************************************************************************* * * Function: sql_finish_select_query * * Purpose: End the select query, such as freeing memory or result * *************************************************************************/ static int sql_finish_select_query(SQLSOCK * sqlsocket, SQL_CONFIG *config) { rlm_sql_unixodbc_sock *unixodbc_sock = sqlsocket->conn; sql_free_result(sqlsocket, config); SQLFreeStmt(unixodbc_sock->stmt_handle, SQL_CLOSE); return 0; } /************************************************************************* * * Function: sql_finish_query * * Purpose: End the query, such as freeing memory * *************************************************************************/ static int sql_finish_query(SQLSOCK *sqlsocket, UNUSED SQL_CONFIG *config) { rlm_sql_unixodbc_sock *unixodbc_sock = sqlsocket->conn; SQLFreeStmt(unixodbc_sock->stmt_handle, SQL_CLOSE); return 0; } /************************************************************************* * * Function: sql_free_result * * Purpose: database specific free_result. Frees memory allocated * for a result set * *************************************************************************/ static int sql_free_result(SQLSOCK *sqlsocket, SQL_CONFIG *config) { rlm_sql_unixodbc_sock *unixodbc_sock = sqlsocket->conn; int column, numfileds=sql_num_fields(sqlsocket, config); /* Freeing reserved memory */ if(unixodbc_sock->row != NULL) { for(column=0; columnrow[column] != NULL) { free(unixodbc_sock->row[column]); unixodbc_sock->row[column] = NULL; } } free(unixodbc_sock->row); unixodbc_sock->row = NULL; } return 0; } /************************************************************************* * * Function: sql_close * * Purpose: database specific close. Closes an open database * connection and cleans up any open handles. * *************************************************************************/ static int sql_close(SQLSOCK *sqlsocket, UNUSED SQL_CONFIG *config) { rlm_sql_unixodbc_sock *unixodbc_sock = sqlsocket->conn; SQLFreeStmt(unixodbc_sock->stmt_handle, SQL_DROP); SQLDisconnect(unixodbc_sock->dbc_handle); SQLFreeConnect(unixodbc_sock->dbc_handle); SQLFreeEnv(unixodbc_sock->env_handle); return 0; } /************************************************************************* * * Function: sql_error * * Purpose: database specific error. Returns error associated with * connection * *************************************************************************/ static const char *sql_error(SQLSOCK *sqlsocket, UNUSED SQL_CONFIG *config) { SQLCHAR state[256]; SQLCHAR error[256]; SQLINTEGER errornum = 0; SQLSMALLINT length = 255; static char result[1024]; /* NOT thread-safe! */ rlm_sql_unixodbc_sock *unixodbc_sock = sqlsocket->conn; error[0] = state[0] = '\0'; SQLError( unixodbc_sock->env_handle, unixodbc_sock->dbc_handle, unixodbc_sock->stmt_handle, state, &errornum, error, 256, &length); sprintf(result, "%s %s", state, error); result[sizeof(result) - 1] = '\0'; /* catch idiot thread issues */ return result; } /************************************************************************* * * Function: sql_state * * Purpose: Returns 0 for success, SQL_DOWN if the error was * connection related or -1 for other errors * *************************************************************************/ static int sql_state(long err_handle, SQLSOCK *sqlsocket, UNUSED SQL_CONFIG *config) { SQLCHAR state[256]; SQLCHAR error[256]; SQLINTEGER errornum = 0; SQLSMALLINT length = 255; int res = -1; rlm_sql_unixodbc_sock *unixodbc_sock = sqlsocket->conn; if(SQL_SUCCEEDED(err_handle)) return 0; /* on success, just return 0 */ error[0] = state[0] = '\0'; SQLError( unixodbc_sock->env_handle, unixodbc_sock->dbc_handle, unixodbc_sock->stmt_handle, state, &errornum, error, 256, &length); if(state[0] == '0') { switch(state[1]) { case '1': /* SQLSTATE 01 class contains info and warning messages */ radlog(L_INFO, "rlm_sql_unixodbc: %s %s\n", state, error); case '0': /* SQLSTATE 00 class means success */ res = 0; break; case '8': /* SQLSTATE 08 class describes various connection errors */ radlog(L_ERR, "rlm_sql_unixodbc: SQL down %s %s\n", state, error); res = SQL_DOWN; break; default: /* any other SQLSTATE means error */ radlog(L_ERR, "rlm_sql_unixodbc: %s %s\n", state, error); res = -1; break; } } return res; } /************************************************************************* * * Function: sql_affected_rows * * Purpose: Return the number of rows affected by the query (update, * or insert) * *************************************************************************/ static int sql_affected_rows(SQLSOCK *sqlsocket, SQL_CONFIG *config) { rlm_sql_unixodbc_sock *unixodbc_sock = sqlsocket->conn; long err_handle; SQLLEN affected_rows; err_handle = SQLRowCount(unixodbc_sock->stmt_handle, &affected_rows); if (sql_state(err_handle, sqlsocket, config)) return -1; return affected_rows; } /* Exported to rlm_sql */ rlm_sql_module_t rlm_sql_unixodbc = { "rlm_sql_unixodbc", sql_init_socket, sql_destroy_socket, sql_query, sql_select_query, sql_store_result, sql_num_fields, sql_num_rows, sql_fetch_row, sql_free_result, sql_error, sql_close, sql_finish_query, sql_finish_select_query, sql_affected_rows }; freeradius-server/src/modules/rlm_sql/drivers/rules.mak000066400000000000000000000103321257552170400237340ustar00rootroot00000000000000####################################################################### # # $Id$ # # Each module should have a few common defines at the TOP of the # Makefile, and the 'include ../rules.mak' # # e.g. # ########################## # TARGET = rlm_foo # SRCS = rlm_foo.c other.c # # include ../rules.mak # # CFLAGS += my_c_flags ########################## # # and everything will be automagically built # ####################################################################### .PHONY: all build-module clean distclean install reconfig all: build-module ####################################################################### # # definitions for new dependencies on suffixes # ####################################################################### .SUFFIXES: .lo .o .la .a ####################################################################### # # define libtool objects for the libraries, # along with a number of other useful definitions. # ####################################################################### LT_OBJS = $(SRCS:.c=.lo) CFLAGS += -I../.. -I$(top_builddir)/src/ ####################################################################### # # Ensure that the modules get re-built if the server header files # change. # ####################################################################### SERVER_HEADERS = ../../rlm_sql.h $(LT_OBJS): $(SERVER_HEADERS) ####################################################################### # # define new rules # ####################################################################### %.lo: %.c $(LIBTOOL) --mode=compile --tag=CC $(CC) $(CFLAGS) $(RLM_SQL_CFLAGS) -c $< ifneq ($(TARGET),) ####################################################################### # # Define a number of new targets # ####################################################################### # # If the module is in the list of static modules, then the "dynamic" # library is built statically, so that the '.la' file contains the # libraries that the module depends on. # # Yes, this is a horrible hack. # ifeq ($(findstring $(TARGET),$(STATIC_MODULES)),) LINK_MODE=-export-dynamic else LINK_MODE=-static endif # # Also, if we're NOT using shared libraries, then force the # link mode to static. # ifneq ($(USE_SHARED_LIBS),yes) LINK_MODE=-static endif ####################################################################### # # Generic targets so we can sweep through all modules # without knowing what their names are. # # These rules also allow us to copy the '.a' or '.la' up # a level, to the 'src/modules' directory, for general consumption. # ####################################################################### build-module: $(TARGET).la @for x in .libs/* $^; do \ rm -f $(top_builddir)/src/modules/lib/$$x; \ ln -s $(top_builddir)/src/modules/rlm_sql/drivers/$(TARGET)/$$x $(top_builddir)/src/modules/lib/$$x; \ done $(TARGET).la: $(LT_OBJS) $(LIBTOOL) --mode=link --tag=CC $(CC) -release $(RADIUSD_VERSION_STRING) \ -module $(LINK_MODE) $(LDFLAGS) $(RLM_SQL_LDFLAGS) -o $@ \ -rpath $(libdir) $^ $(RLM_SQL_LIBS) ####################################################################### # # It's a dummy target: don't build it # ####################################################################### else build-module: # if $(TARGET) == "" endif ####################################################################### # # clean and install rules # ####################################################################### clean: @rm -f *.a *.o *.lo *.la *~ @rm -rf .libs _libs @rm -f config.log config.status config.cache distclean: clean @rm -f config.h config.mak reconfig: @if [ -f configure.in ]; then \ [ "x$(AUTOCONF)" != "x" ] && $(AUTOCONF) -I $(top_builddir); \ fi @if [ -f config.h.in ]; then \ [ "x$(AUTOHEADER)" != "x" ] && $(AUTOHEADER); \ fi # # Do any module-specific installation. # # If there isn't a TARGET defined, then don't do anything. # Otherwise, install the libraries into $(libdir) # install: if [ "x$(TARGET)" != "x" ]; then \ $(LIBTOOL) --mode=install $(INSTALL) -c \ $(TARGET).la $(R)$(libdir)/$(TARGET).la || exit $$?; \ rm -f $(R)$(libdir)/$(TARGET)-$(RADIUSD_VERSION_STRING).la; \ ln -s $(TARGET).la $(R)$(libdir)/$(TARGET)-$(RADIUSD_VERSION_STRING).la || exit $$?; \ fi freeradius-server/src/modules/rlm_sql/rlm_sql.c000066400000000000000000001421061257552170400222540ustar00rootroot00000000000000/* * rlm_sql.c SQL Module * Main SQL module file. Most ICRADIUS code is located in sql.c * * Version: $Id$ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2000,2006 The FreeRADIUS server project * Copyright 2000 Mike Machado * Copyright 2000 Alan DeKok */ #include RCSID("$Id$") #include #include #include #include #include "rlm_sql.h" static char *allowed_chars = NULL; static const CONF_PARSER module_config[] = { {"driver",PW_TYPE_STRING_PTR, offsetof(SQL_CONFIG,sql_driver), NULL, "mysql"}, {"server",PW_TYPE_STRING_PTR, offsetof(SQL_CONFIG,sql_server), NULL, "localhost"}, {"port",PW_TYPE_STRING_PTR, offsetof(SQL_CONFIG,sql_port), NULL, ""}, {"login", PW_TYPE_STRING_PTR, offsetof(SQL_CONFIG,sql_login), NULL, ""}, {"password", PW_TYPE_STRING_PTR, offsetof(SQL_CONFIG,sql_password), NULL, ""}, {"radius_db", PW_TYPE_STRING_PTR, offsetof(SQL_CONFIG,sql_db), NULL, "radius"}, {"filename", PW_TYPE_FILENAME, /* for sqlite */ offsetof(SQL_CONFIG,sql_file), NULL, NULL}, {"read_groups", PW_TYPE_BOOLEAN, offsetof(SQL_CONFIG,read_groups), NULL, "yes"}, {"sqltrace", PW_TYPE_BOOLEAN, offsetof(SQL_CONFIG,sqltrace), NULL, "no"}, {"sqltracefile", PW_TYPE_STRING_PTR, offsetof(SQL_CONFIG,tracefile), NULL, SQLTRACEFILE}, {"readclients", PW_TYPE_BOOLEAN, offsetof(SQL_CONFIG,do_clients), NULL, "no"}, {"deletestalesessions", PW_TYPE_BOOLEAN, offsetof(SQL_CONFIG,deletestalesessions), NULL, "yes"}, {"num_sql_socks", PW_TYPE_INTEGER, offsetof(SQL_CONFIG,num_sql_socks), NULL, "5"}, {"lifetime", PW_TYPE_INTEGER, offsetof(SQL_CONFIG,lifetime), NULL, "0"}, {"max_queries", PW_TYPE_INTEGER, offsetof(SQL_CONFIG,max_queries), NULL, "0"}, {"sql_user_name", PW_TYPE_STRING_PTR, offsetof(SQL_CONFIG,query_user), NULL, ""}, {"default_user_profile", PW_TYPE_STRING_PTR, offsetof(SQL_CONFIG,default_profile), NULL, ""}, {"nas_query", PW_TYPE_STRING_PTR, offsetof(SQL_CONFIG,nas_query), NULL, "SELECT id,nasname,shortname,type,secret FROM nas"}, {"authorize_check_query", PW_TYPE_STRING_PTR, offsetof(SQL_CONFIG,authorize_check_query), NULL, ""}, {"authorize_reply_query", PW_TYPE_STRING_PTR, offsetof(SQL_CONFIG,authorize_reply_query), NULL, NULL}, {"authorize_group_check_query", PW_TYPE_STRING_PTR, offsetof(SQL_CONFIG,authorize_group_check_query), NULL, ""}, {"authorize_group_reply_query", PW_TYPE_STRING_PTR, offsetof(SQL_CONFIG,authorize_group_reply_query), NULL, ""}, {"accounting_onoff_query", PW_TYPE_STRING_PTR, offsetof(SQL_CONFIG,accounting_onoff_query), NULL, ""}, {"accounting_update_query", PW_TYPE_STRING_PTR, offsetof(SQL_CONFIG,accounting_update_query), NULL, ""}, {"accounting_update_query_alt", PW_TYPE_STRING_PTR, offsetof(SQL_CONFIG,accounting_update_query_alt), NULL, ""}, {"accounting_start_query", PW_TYPE_STRING_PTR, offsetof(SQL_CONFIG,accounting_start_query), NULL, ""}, {"accounting_start_query_alt", PW_TYPE_STRING_PTR, offsetof(SQL_CONFIG,accounting_start_query_alt), NULL, ""}, {"accounting_stop_query", PW_TYPE_STRING_PTR, offsetof(SQL_CONFIG,accounting_stop_query), NULL, ""}, {"accounting_stop_query_alt", PW_TYPE_STRING_PTR, offsetof(SQL_CONFIG,accounting_stop_query_alt), NULL, ""}, {"group_membership_query", PW_TYPE_STRING_PTR, offsetof(SQL_CONFIG,groupmemb_query), NULL, NULL}, {"connect_failure_retry_delay", PW_TYPE_INTEGER, offsetof(SQL_CONFIG,connect_failure_retry_delay), NULL, "60"}, {"simul_count_query", PW_TYPE_STRING_PTR, offsetof(SQL_CONFIG,simul_count_query), NULL, ""}, {"simul_verify_query", PW_TYPE_STRING_PTR, offsetof(SQL_CONFIG,simul_verify_query), NULL, ""}, {"postauth_query", PW_TYPE_STRING_PTR, offsetof(SQL_CONFIG,postauth_query), NULL, ""}, {"safe-characters", PW_TYPE_STRING_PTR, offsetof(SQL_CONFIG,allowed_chars), NULL, "@abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.-_: /"}, /* * This only works for a few drivers. */ {"query_timeout", PW_TYPE_INTEGER, offsetof(SQL_CONFIG,query_timeout), NULL, NULL}, {NULL, -1, 0, NULL, NULL} }; /* * Fall-Through checking function from rlm_files.c */ static int fallthrough(VALUE_PAIR *vp) { VALUE_PAIR *tmp; tmp = pairfind(vp, PW_FALL_THROUGH); return tmp ? tmp->vp_integer : 0; } /* * Yucky prototype. */ static int generate_sql_clients(SQL_INST *inst); static size_t sql_escape_func(char *out, size_t outlen, const char *in); /* * sql xlat function. Right now only SELECTs are supported. Only * the first element of the SELECT result will be used. * * For other statements (insert, update, delete, etc.), the * number of affected rows will be returned. */ static int sql_xlat(void *instance, REQUEST *request, char *fmt, char *out, size_t freespace, UNUSED RADIUS_ESCAPE_STRING func) { SQLSOCK *sqlsocket; SQL_ROW row; SQL_INST *inst = instance; char querystr[MAX_QUERY_LEN]; char sqlusername[MAX_STRING_LEN]; size_t ret = 0; RDEBUG("sql_xlat"); /* * Add SQL-User-Name attribute just in case it is needed * We could search the string fmt for SQL-User-Name to see if this is * needed or not */ sql_set_user(inst, request, sqlusername, NULL); /* * Do an xlat on the provided string (nice recursive operation). */ if (!radius_xlat(querystr, sizeof(querystr), fmt, request, sql_escape_func)) { radlog(L_ERR, "rlm_sql (%s): xlat failed.", inst->config->xlat_name); return 0; } query_log(request, inst,querystr); sqlsocket = sql_get_socket(inst); if (sqlsocket == NULL) return 0; /* * If the query starts with any of the following prefixes, * then return the number of rows affected */ if ((strncasecmp(querystr, "insert", 6) == 0) || (strncasecmp(querystr, "update", 6) == 0) || (strncasecmp(querystr, "delete", 6) == 0)) { int numaffected; char buffer[21]; /* 64bit max is 20 decimal chars + null byte */ if (rlm_sql_query(sqlsocket,inst,querystr)) { radlog(L_ERR, "rlm_sql (%s): database query error, %s: %s", inst->config->xlat_name, querystr, (inst->module->sql_error)(sqlsocket, inst->config)); sql_release_socket(inst,sqlsocket); return 0; } numaffected = (inst->module->sql_affected_rows)(sqlsocket, inst->config); if (numaffected < 1) { RDEBUG("rlm_sql (%s): SQL query affected no rows", inst->config->xlat_name); } /* * Don't chop the returned number if freespace is * too small. This hack is necessary because * some implementations of snprintf return the * size of the written data, and others return * the size of the data they *would* have written * if the output buffer was large enough. */ snprintf(buffer, sizeof(buffer), "%d", numaffected); ret = strlen(buffer); if (ret >= freespace){ RDEBUG("rlm_sql (%s): Can't write result, insufficient string space", inst->config->xlat_name); (inst->module->sql_finish_query)(sqlsocket, inst->config); sql_release_socket(inst,sqlsocket); return 0; } memcpy(out, buffer, ret + 1); /* we did bounds checking above */ (inst->module->sql_finish_query)(sqlsocket, inst->config); sql_release_socket(inst,sqlsocket); return ret; } /* else it's a SELECT statement */ if (rlm_sql_select_query(sqlsocket,inst,querystr)){ radlog(L_ERR, "rlm_sql (%s): database query error, %s: %s", inst->config->xlat_name,querystr, (inst->module->sql_error)(sqlsocket, inst->config)); sql_release_socket(inst,sqlsocket); return 0; } ret = rlm_sql_fetch_row(sqlsocket, inst); if (ret) { RDEBUG("SQL query did not succeed"); (inst->module->sql_finish_select_query)(sqlsocket, inst->config); sql_release_socket(inst,sqlsocket); return 0; } row = sqlsocket->row; if (row == NULL) { RDEBUG("SQL query did not return any results"); (inst->module->sql_finish_select_query)(sqlsocket, inst->config); sql_release_socket(inst,sqlsocket); return 0; } if (row[0] == NULL){ RDEBUG("row[0] returned NULL"); (inst->module->sql_finish_select_query)(sqlsocket, inst->config); sql_release_socket(inst,sqlsocket); return 0; } ret = strlen(row[0]); if (ret >= freespace){ RDEBUG("Insufficient string space"); (inst->module->sql_finish_select_query)(sqlsocket, inst->config); sql_release_socket(inst,sqlsocket); return 0; } strlcpy(out,row[0],freespace); RDEBUG("sql_xlat finished"); (inst->module->sql_finish_select_query)(sqlsocket, inst->config); sql_release_socket(inst,sqlsocket); return ret; } static int generate_sql_clients(SQL_INST *inst) { SQLSOCK *sqlsocket; SQL_ROW row; char querystr[MAX_QUERY_LEN]; RADCLIENT *c; char *prefix_ptr = NULL; unsigned int i = 0; int numf = 0; DEBUG("rlm_sql (%s): Processing generate_sql_clients", inst->config->xlat_name); /* NAS query isn't xlat'ed */ strlcpy(querystr, inst->config->nas_query, sizeof(querystr)); DEBUG("rlm_sql (%s) in generate_sql_clients: query is %s", inst->config->xlat_name, querystr); sqlsocket = sql_get_socket(inst); if (sqlsocket == NULL) return -1; if (rlm_sql_select_query(sqlsocket,inst,querystr)){ radlog(L_ERR, "rlm_sql (%s): database query error, %s: %s", inst->config->xlat_name,querystr, (inst->module->sql_error)(sqlsocket, inst->config)); sql_release_socket(inst,sqlsocket); return -1; } while(rlm_sql_fetch_row(sqlsocket, inst) == 0) { i++; row = sqlsocket->row; if (row == NULL) break; /* * The return data for each row MUST be in the following order: * * 0. Row ID (currently unused) * 1. Name (or IP address) * 2. Shortname * 3. Type * 4. Secret * 5. Virtual Server (optional) */ if (!row[0]){ radlog(L_ERR, "rlm_sql (%s): No row id found on pass %d",inst->config->xlat_name,i); continue; } if (!row[1]){ radlog(L_ERR, "rlm_sql (%s): No nasname found for row %s",inst->config->xlat_name,row[0]); continue; } if (!row[2]){ radlog(L_ERR, "rlm_sql (%s): No short name found for row %s",inst->config->xlat_name,row[0]); continue; } if (!row[4]){ radlog(L_ERR, "rlm_sql (%s): No secret found for row %s",inst->config->xlat_name,row[0]); continue; } DEBUG("rlm_sql (%s): Read entry nasname=%s,shortname=%s,secret=%s",inst->config->xlat_name, row[1],row[2],row[4]); c = rad_malloc(sizeof(*c)); memset(c, 0, sizeof(*c)); #ifdef WITH_DYNAMIC_CLIENTS c->dynamic = 1; #endif /* * Look for prefixes */ c->prefix = -1; prefix_ptr = strchr(row[1], '/'); if (prefix_ptr) { c->prefix = atoi(prefix_ptr + 1); if ((c->prefix < 0) || (c->prefix > 128)) { radlog(L_ERR, "rlm_sql (%s): Invalid Prefix value '%s' for IP.", inst->config->xlat_name, prefix_ptr + 1); free(c); continue; } /* Replace '/' with '\0' */ *prefix_ptr = '\0'; } /* * Always get the numeric representation of IP */ if (ip_hton(row[1], AF_UNSPEC, &c->ipaddr) < 0) { radlog(L_CONS|L_ERR, "rlm_sql (%s): Failed to look up hostname %s: %s", inst->config->xlat_name, row[1], fr_strerror()); free(c); continue; } else { char buffer[256]; ip_ntoh(&c->ipaddr, buffer, sizeof(buffer)); c->longname = strdup(buffer); } if (c->prefix < 0) switch (c->ipaddr.af) { case AF_INET: c->prefix = 32; break; case AF_INET6: c->prefix = 128; break; default: break; } /* * Other values (secret, shortname, nastype, virtual_server) */ c->secret = strdup(row[4]); c->shortname = strdup(row[2]); if(row[3] != NULL) c->nastype = strdup(row[3]); numf = (inst->module->sql_num_fields)(sqlsocket, inst->config); if ((numf > 5) && (row[5] != NULL) && *row[5]) c->server = strdup(row[5]); DEBUG("rlm_sql (%s): Adding client %s (%s, server=%s) to clients list", inst->config->xlat_name, c->longname,c->shortname, c->server ? c->server : ""); if (!client_add(NULL, c)) { sql_release_socket(inst, sqlsocket); DEBUG("rlm_sql (%s): Failed to add client %s (%s) to clients list. Maybe there's a duplicate?", inst->config->xlat_name, c->longname,c->shortname); client_free(c); return -1; } } (inst->module->sql_finish_select_query)(sqlsocket, inst->config); sql_release_socket(inst, sqlsocket); return 0; } /* * Translate the SQL queries. */ static size_t sql_escape_func(char *out, size_t outlen, const char *in) { size_t len = 0; while (in[0]) { size_t utf8_len; /* * Allow all multi-byte UTF8 characters. */ utf8_len = fr_utf8_char((uint8_t const *) in); if (utf8_len > 1) { if (outlen <= utf8_len) break; memcpy(out, in, utf8_len); in += utf8_len; out += utf8_len; outlen -= utf8_len; len += utf8_len; continue; } /* * Non-printable characters get replaced with their * mime-encoded equivalents. */ if ((in[0] < 32) || strchr(allowed_chars, *in) == NULL) { /* * Only 3 or less bytes available. */ if (outlen <= 3) { break; } snprintf(out, outlen, "=%02X", (unsigned char) in[0]); in++; out += 3; outlen -= 3; len += 3; continue; } /* * Only one byte left. */ if (outlen <= 1) { break; } /* * Allowed character. */ *out = *in; out++; in++; outlen--; len++; } *out = '\0'; return len; } /* * Set the SQL user name. * * We don't call the escape function here. The resulting string * will be escaped later in the queries xlat so we don't need to * escape it twice. (it will make things wrong if we have an * escape candidate character in the username) */ int sql_set_user(SQL_INST *inst, REQUEST *request, char *sqlusername, const char *username) { VALUE_PAIR *vp=NULL; char tmpuser[MAX_STRING_LEN]; tmpuser[0] = '\0'; sqlusername[0]= '\0'; /* Remove any user attr we added previously */ pairdelete(&request->packet->vps, PW_SQL_USER_NAME); if (username != NULL) { strlcpy(tmpuser, username, sizeof(tmpuser)); } else if (strlen(inst->config->query_user)) { radius_xlat(tmpuser, sizeof(tmpuser), inst->config->query_user, request, NULL); } else { return 0; } strlcpy(sqlusername, tmpuser, MAX_STRING_LEN); RDEBUG2("sql_set_user escaped user --> '%s'", sqlusername); vp = radius_pairmake(request, &request->packet->vps, "SQL-User-Name", NULL, 0); if (!vp) { radlog(L_ERR, "%s", fr_strerror()); return -1; } strlcpy(vp->vp_strvalue, tmpuser, sizeof(vp->vp_strvalue)); vp->length = strlen(vp->vp_strvalue); return 0; } static void sql_grouplist_free (SQL_GROUPLIST **group_list) { SQL_GROUPLIST *last; while(*group_list) { last = *group_list; *group_list = (*group_list)->next; free(last); } } static int sql_get_grouplist (SQL_INST *inst, SQLSOCK *sqlsocket, REQUEST *request, SQL_GROUPLIST **group_list) { char querystr[MAX_QUERY_LEN]; int num_groups = 0; SQL_ROW row; SQL_GROUPLIST *group_list_tmp; /* NOTE: sql_set_user should have been run before calling this function */ group_list_tmp = *group_list = NULL; if (!inst->config->groupmemb_query || (inst->config->groupmemb_query[0] == 0)) return 0; if (!radius_xlat(querystr, sizeof(querystr), inst->config->groupmemb_query, request, sql_escape_func)) { radlog_request(L_ERR, 0, request, "xlat \"%s\" failed.", inst->config->groupmemb_query); return -1; } if (rlm_sql_select_query(sqlsocket, inst, querystr) < 0) { radlog_request(L_ERR, 0, request, "database query error, %s: %s", querystr, (inst->module->sql_error)(sqlsocket,inst->config)); return -1; } while (rlm_sql_fetch_row(sqlsocket, inst) == 0) { row = sqlsocket->row; if (row == NULL) break; if (row[0] == NULL){ RDEBUG("row[0] returned NULL"); (inst->module->sql_finish_select_query)(sqlsocket, inst->config); sql_grouplist_free(group_list); return -1; } if (*group_list == NULL) { *group_list = rad_malloc(sizeof(SQL_GROUPLIST)); group_list_tmp = *group_list; } else { rad_assert(group_list_tmp != NULL); group_list_tmp->next = rad_malloc(sizeof(SQL_GROUPLIST)); group_list_tmp = group_list_tmp->next; } group_list_tmp->next = NULL; strlcpy(group_list_tmp->groupname, row[0], MAX_STRING_LEN); } (inst->module->sql_finish_select_query)(sqlsocket, inst->config); return num_groups; } /* * sql groupcmp function. That way we can do group comparisons (in the users file for example) * with the group memberships reciding in sql * The group membership query should only return one element which is the username. The returned * username will then be checked with the passed check string. */ static int sql_groupcmp(void *instance, REQUEST *request, VALUE_PAIR *request_vp, VALUE_PAIR *check, VALUE_PAIR *check_pairs, VALUE_PAIR **reply_pairs) { SQLSOCK *sqlsocket; SQL_INST *inst = instance; char sqlusername[MAX_STRING_LEN]; SQL_GROUPLIST *group_list, *group_list_tmp; check_pairs = check_pairs; reply_pairs = reply_pairs; request_vp = request_vp; RDEBUG("sql_groupcmp"); if (!check || !check->vp_strvalue || !check->length){ RDEBUG("sql_groupcmp: Illegal group name"); return 1; } if (!request){ RDEBUG("sql_groupcmp: NULL request"); return 1; } /* * Set, escape, and check the user attr here */ if (sql_set_user(inst, request, sqlusername, NULL) < 0) return 1; /* * Get a socket for this lookup */ sqlsocket = sql_get_socket(inst); if (sqlsocket == NULL) { /* Remove the username we (maybe) added above */ pairdelete(&request->packet->vps, PW_SQL_USER_NAME); return 1; } /* * Get the list of groups this user is a member of */ if (sql_get_grouplist(inst, sqlsocket, request, &group_list) < 0) { radlog_request(L_ERR, 0, request, "Error getting group membership"); /* Remove the username we (maybe) added above */ pairdelete(&request->packet->vps, PW_SQL_USER_NAME); sql_release_socket(inst, sqlsocket); return 1; } for (group_list_tmp = group_list; group_list_tmp != NULL; group_list_tmp = group_list_tmp->next) { if (strcmp(group_list_tmp->groupname, check->vp_strvalue) == 0){ RDEBUG("sql_groupcmp finished: User is a member of group %s", check->vp_strvalue); /* Free the grouplist */ sql_grouplist_free(&group_list); /* Remove the username we (maybe) added above */ pairdelete(&request->packet->vps, PW_SQL_USER_NAME); sql_release_socket(inst, sqlsocket); return 0; } } /* Free the grouplist */ sql_grouplist_free(&group_list); /* Remove the username we (maybe) added above */ pairdelete(&request->packet->vps, PW_SQL_USER_NAME); sql_release_socket(inst,sqlsocket); RDEBUG("sql_groupcmp finished: User is NOT a member of group %s", check->vp_strvalue); return 1; } static int rlm_sql_process_groups(SQL_INST *inst, REQUEST *request, SQLSOCK *sqlsocket, int *dofallthrough) { VALUE_PAIR *check_tmp = NULL; VALUE_PAIR *reply_tmp = NULL; SQL_GROUPLIST *group_list, *group_list_tmp; VALUE_PAIR *sql_group = NULL; char querystr[MAX_QUERY_LEN]; int found = 0; int rows; /* * Get the list of groups this user is a member of */ if (sql_get_grouplist(inst, sqlsocket, request, &group_list) < 0) { radlog_request(L_ERR, 0, request, "Error retrieving group list"); return -1; } for (group_list_tmp = group_list; group_list_tmp != NULL && *dofallthrough != 0; group_list_tmp = group_list_tmp->next) { /* * Add the Sql-Group attribute to the request list so we know * which group we're retrieving attributes for */ sql_group = pairmake("Sql-Group", group_list_tmp->groupname, T_OP_EQ); if (!sql_group) { radlog_request(L_ERR, 0, request, "Error creating Sql-Group attribute"); sql_grouplist_free(&group_list); return -1; } pairadd(&request->packet->vps, sql_group); if (!radius_xlat(querystr, sizeof(querystr), inst->config->authorize_group_check_query, request, sql_escape_func)) { radlog_request(L_ERR, 0, request, "Error generating query; rejecting user"); /* Remove the grouup we added above */ pairdelete(&request->packet->vps, PW_SQL_GROUP); sql_grouplist_free(&group_list); return -1; } rows = sql_getvpdata(inst, sqlsocket, &check_tmp, querystr); if (rows < 0) { radlog_request(L_ERR, 0, request, "Error retrieving check pairs for group %s", group_list_tmp->groupname); /* Remove the grouup we added above */ pairdelete(&request->packet->vps, PW_SQL_GROUP); pairfree(&check_tmp); sql_grouplist_free(&group_list); return -1; } else if (rows > 0) { /* * Only do this if *some* check pairs were returned */ if (paircompare(request, request->packet->vps, check_tmp, &request->reply->vps) == 0) { found = 1; RDEBUG2("User found in group %s", group_list_tmp->groupname); /* * Now get the reply pairs since the paircompare matched */ if (!radius_xlat(querystr, sizeof(querystr), inst->config->authorize_group_reply_query, request, sql_escape_func)) { radlog_request(L_ERR, 0, request, "Error generating query; rejecting user"); /* Remove the grouup we added above */ pairdelete(&request->packet->vps, PW_SQL_GROUP); pairfree(&check_tmp); sql_grouplist_free(&group_list); return -1; } if (sql_getvpdata(inst, sqlsocket, &reply_tmp, querystr) < 0) { radlog_request(L_ERR, 0, request, "Error retrieving reply pairs for group %s", group_list_tmp->groupname); /* Remove the grouup we added above */ pairdelete(&request->packet->vps, PW_SQL_GROUP); pairfree(&check_tmp); pairfree(&reply_tmp); sql_grouplist_free(&group_list); return -1; } *dofallthrough = fallthrough(reply_tmp); pairxlatmove(request, &request->reply->vps, &reply_tmp); pairxlatmove(request, &request->config_items, &check_tmp); } } else { /* * rows == 0. This is like having the username on a line * in the user's file with no check vp's. As such, we treat * it as found and add the reply attributes, so that we * match expected behavior */ found = 1; RDEBUG2("User found in group %s", group_list_tmp->groupname); /* * Now get the reply pairs since the paircompare matched */ if (!radius_xlat(querystr, sizeof(querystr), inst->config->authorize_group_reply_query, request, sql_escape_func)) { radlog_request(L_ERR, 0, request, "Error generating query; rejecting user"); /* Remove the grouup we added above */ pairdelete(&request->packet->vps, PW_SQL_GROUP); pairfree(&check_tmp); sql_grouplist_free(&group_list); return -1; } if (sql_getvpdata(inst, sqlsocket, &reply_tmp, querystr) < 0) { radlog_request(L_ERR, 0, request, "Error retrieving reply pairs for group %s", group_list_tmp->groupname); /* Remove the grouup we added above */ pairdelete(&request->packet->vps, PW_SQL_GROUP); pairfree(&check_tmp); pairfree(&reply_tmp); sql_grouplist_free(&group_list); return -1; } *dofallthrough = fallthrough(reply_tmp); pairxlatmove(request, &request->reply->vps, &reply_tmp); pairxlatmove(request, &request->config_items, &check_tmp); } /* * Delete the Sql-Group we added above * And clear out the pairlists */ pairdelete(&request->packet->vps, PW_SQL_GROUP); pairfree(&check_tmp); pairfree(&reply_tmp); } sql_grouplist_free(&group_list); return found; } static int rlm_sql_detach(void *instance) { SQL_INST *inst = instance; paircompare_unregister(PW_SQL_GROUP, sql_groupcmp); if (inst->config) { if (inst->sqlpool) { sql_poolfree(inst); } if (inst->config->xlat_name) { xlat_unregister(inst->config->xlat_name,(RAD_XLAT_FUNC)sql_xlat, instance); free(inst->config->xlat_name); } /* * Catch multiple instances of the module. */ if (allowed_chars == inst->config->allowed_chars) { allowed_chars = NULL; } } if (inst->handle) { #if 0 /* * FIXME: Call the modules 'destroy' function? */ lt_dlclose(inst->handle); /* ignore any errors */ #endif } free(inst); return 0; } static int rlm_sql_instantiate(CONF_SECTION * conf, void **instance) { int i; SQL_INST *inst; const char *xlat_name; inst = rad_malloc(sizeof(SQL_INST)); memset(inst, 0, sizeof(SQL_INST)); /* * The server core expects to be able to do * cf_section_parse_free(inst). So this hack is * necessary. */ inst->config = &inst->myconfig; /* * Export these methods, too. This avoids RTDL_GLOBAL. */ inst->sql_set_user = sql_set_user; inst->sql_get_socket = sql_get_socket; inst->sql_release_socket = sql_release_socket; inst->sql_escape_func = sql_escape_func; inst->sql_query = rlm_sql_query; inst->sql_select_query = rlm_sql_select_query; inst->sql_fetch_row = rlm_sql_fetch_row; /* * If the configuration parameters can't be parsed, then * fail. */ if (cf_section_parse(conf, inst->config, module_config) < 0) { rlm_sql_detach(inst); return -1; } xlat_name = cf_section_name2(conf); if (xlat_name == NULL) { xlat_name = cf_section_name1(conf); } else { char *group_name; DICT_ATTR *dattr; ATTR_FLAGS flags; /* * Allocate room for -SQL-Group */ group_name = rad_malloc((strlen(xlat_name) + 1 + 11) * sizeof(char)); sprintf(group_name,"%s-SQL-Group",xlat_name); DEBUG("rlm_sql Creating new attribute %s",group_name); memset(&flags, 0, sizeof(flags)); dict_addattr(group_name, 0, PW_TYPE_STRING, -1, flags); dattr = dict_attrbyname(group_name); if (dattr == NULL){ radlog(L_ERR, "rlm_sql: Failed to create attribute %s",group_name); free(group_name); free(inst); /* FIXME: detach */ return -1; } if (inst->config->groupmemb_query && inst->config->groupmemb_query[0]) { DEBUG("rlm_sql: Registering sql_groupcmp for %s",group_name); paircompare_register(dattr->attr, PW_USER_NAME, sql_groupcmp, inst); } free(group_name); } if (xlat_name){ inst->config->xlat_name = strdup(xlat_name); xlat_register(xlat_name, (RAD_XLAT_FUNC)sql_xlat, inst); } if (inst->config->num_sql_socks > MAX_SQL_SOCKS) { radlog(L_ERR, "rlm_sql (%s): sql_instantiate: number of sqlsockets cannot exceed MAX_SQL_SOCKS, %d", inst->config->xlat_name, MAX_SQL_SOCKS); rlm_sql_detach(inst); return -1; } /* * Sanity check for crazy people. */ if (strncmp(inst->config->sql_driver, "rlm_sql_", 8) != 0) { radlog(L_ERR, "\"%s\" is NOT an SQL driver!", inst->config->sql_driver); rlm_sql_detach(inst); return -1; } inst->handle = lt_dlopenext(inst->config->sql_driver); if (inst->handle == NULL) { radlog(L_ERR, "Could not link driver %s: %s", inst->config->sql_driver, lt_dlerror()); radlog(L_ERR, "Make sure it (and all its dependent libraries!) are in the search path of your system's ld."); rlm_sql_detach(inst); return -1; } inst->module = (rlm_sql_module_t *) lt_dlsym(inst->handle, inst->config->sql_driver); if (!inst->module) { radlog(L_ERR, "Could not link symbol %s: %s", inst->config->sql_driver, lt_dlerror()); rlm_sql_detach(inst); return -1; } radlog(L_INFO, "rlm_sql (%s): Driver %s (module %s) loaded and linked", inst->config->xlat_name, inst->config->sql_driver, inst->module->name); radlog(L_INFO, "rlm_sql (%s): Attempting to connect to %s@%s:%s/%s", inst->config->xlat_name, inst->config->sql_login, inst->config->sql_server, inst->config->sql_port, inst->config->sql_db); if (sql_init_socketpool(inst) < 0) { rlm_sql_detach(inst); return -1; } if (inst->config->groupmemb_query && inst->config->groupmemb_query[0]) { paircompare_register(PW_SQL_GROUP, PW_USER_NAME, sql_groupcmp, inst); } if (inst->config->do_clients){ if (generate_sql_clients(inst) == -1){ radlog(L_ERR, "Failed to load clients from SQL."); rlm_sql_detach(inst); return -1; } } allowed_chars = inst->config->allowed_chars; for (i = 0; module_config[i].name != NULL; i++) { char **p; if (module_config[i].type != PW_TYPE_STRING_PTR) continue; if (strstr(module_config[i].name, "_query") != NULL) continue; p = (char **) (((char *)inst->config) + module_config[i].offset); if (!*p) continue; if (strlen(*p) > ((2 * MAX_QUERY_LEN) / 3)) { DEBUG("%s: WARNING Query '%s' is probably too long!", inst->config->xlat_name, module_config[i].name); } } *instance = inst; return RLM_MODULE_OK; } static int rlm_sql_authorize(void *instance, REQUEST * request) { VALUE_PAIR *check_tmp = NULL; VALUE_PAIR *reply_tmp = NULL; VALUE_PAIR *user_profile = NULL; int found = 0; int dofallthrough = 1; int rows; SQLSOCK *sqlsocket; SQL_INST *inst = instance; char querystr[MAX_QUERY_LEN]; char sqlusername[MAX_STRING_LEN]; /* * the profile username is used as the sqlusername during * profile checking so that we don't overwrite the orignal * sqlusername string */ char profileusername[MAX_STRING_LEN]; /* * Set, escape, and check the user attr here */ if (sql_set_user(inst, request, sqlusername, NULL) < 0) return RLM_MODULE_FAIL; /* * reserve a socket */ sqlsocket = sql_get_socket(inst); if (sqlsocket == NULL) { /* Remove the username we (maybe) added above */ pairdelete(&request->packet->vps, PW_SQL_USER_NAME); return RLM_MODULE_FAIL; } /* * After this point, ALL 'return's MUST release the SQL socket! */ /* * Alright, start by getting the specific entry for the user */ if (!radius_xlat(querystr, sizeof(querystr), inst->config->authorize_check_query, request, sql_escape_func)) { radlog_request(L_ERR, 0, request, "Error generating query; rejecting user"); sql_release_socket(inst, sqlsocket); /* Remove the username we (maybe) added above */ pairdelete(&request->packet->vps, PW_SQL_USER_NAME); return RLM_MODULE_FAIL; } rows = sql_getvpdata(inst, sqlsocket, &check_tmp, querystr); if (rows < 0) { radlog_request(L_ERR, 0, request, "SQL query error; rejecting user"); sql_release_socket(inst, sqlsocket); /* Remove the username we (maybe) added above */ pairdelete(&request->packet->vps, PW_SQL_USER_NAME); pairfree(&check_tmp); return RLM_MODULE_FAIL; } else if (rows > 0) { /* * Only do this if *some* check pairs were returned */ if (paircompare(request, request->packet->vps, check_tmp, &request->reply->vps) == 0) { found = 1; RDEBUG2("User found in radcheck table"); if (inst->config->authorize_reply_query && *inst->config->authorize_reply_query) { /* * Now get the reply pairs since the paircompare matched */ if (!radius_xlat(querystr, sizeof(querystr), inst->config->authorize_reply_query, request, sql_escape_func)) { radlog_request(L_ERR, 0, request, "Error generating query; rejecting user"); sql_release_socket(inst, sqlsocket); /* Remove the username we (maybe) added above */ pairdelete(&request->packet->vps, PW_SQL_USER_NAME); pairfree(&check_tmp); return RLM_MODULE_FAIL; } if (sql_getvpdata(inst, sqlsocket, &reply_tmp, querystr) < 0) { radlog_request(L_ERR, 0, request, "SQL query error; rejecting user"); sql_release_socket(inst, sqlsocket); /* Remove the username we (maybe) added above */ pairdelete(&request->packet->vps, PW_SQL_USER_NAME); pairfree(&check_tmp); pairfree(&reply_tmp); return RLM_MODULE_FAIL; } if (!inst->config->read_groups) dofallthrough = fallthrough(reply_tmp); pairxlatmove(request, &request->reply->vps, &reply_tmp); } pairxlatmove(request, &request->config_items, &check_tmp); } } /* * Clear out the pairlists */ pairfree(&check_tmp); pairfree(&reply_tmp); /* * dofallthrough is set to 1 by default so that if the user information * is not found, we will still process groups. If the user information, * however, *is* found, Fall-Through must be set in order to process * the groups as well */ if (dofallthrough) { rows = rlm_sql_process_groups(inst, request, sqlsocket, &dofallthrough); if (rows < 0) { radlog_request(L_ERR, 0, request, "Error processing groups; rejecting user"); sql_release_socket(inst, sqlsocket); /* Remove the username we (maybe) added above */ pairdelete(&request->packet->vps, PW_SQL_USER_NAME); return RLM_MODULE_FAIL; } else if (rows > 0) { found = 1; } } /* * repeat the above process with the default profile or User-Profile */ if (dofallthrough) { int profile_found = 0; /* * Check for a default_profile or for a User-Profile. */ user_profile = pairfind(request->config_items, PW_USER_PROFILE); if (inst->config->default_profile[0] != 0 || user_profile != NULL){ char *profile = inst->config->default_profile; if (user_profile != NULL) profile = user_profile->vp_strvalue; if (profile && strlen(profile)){ RDEBUG("Checking profile %s", profile); if (sql_set_user(inst, request, profileusername, profile) < 0) { radlog_request(L_ERR, 0, request, "Error setting profile; rejecting user"); sql_release_socket(inst, sqlsocket); /* Remove the username we (maybe) added above */ pairdelete(&request->packet->vps, PW_SQL_USER_NAME); return RLM_MODULE_FAIL; } else { profile_found = 1; } } } if (profile_found) { rows = rlm_sql_process_groups(inst, request, sqlsocket, &dofallthrough); if (rows < 0) { radlog_request(L_ERR, 0, request, "Error processing profile groups; rejecting user"); sql_release_socket(inst, sqlsocket); /* Remove the username we (maybe) added above */ pairdelete(&request->packet->vps, PW_SQL_USER_NAME); return RLM_MODULE_FAIL; } else if (rows > 0) { found = 1; } } } /* Remove the username we (maybe) added above */ pairdelete(&request->packet->vps, PW_SQL_USER_NAME); sql_release_socket(inst, sqlsocket); if (!found) { RDEBUG("User %s not found", sqlusername); return RLM_MODULE_NOTFOUND; } else { return RLM_MODULE_OK; } } /* * Accounting: save the account data to our sql table */ static int rlm_sql_accounting(void *instance, REQUEST * request) { SQLSOCK *sqlsocket = NULL; VALUE_PAIR *pair; SQL_INST *inst = instance; int ret = RLM_MODULE_OK; int numaffected = 0; int acctstatustype = 0; char querystr[MAX_QUERY_LEN]; char logstr[MAX_QUERY_LEN]; char sqlusername[MAX_STRING_LEN]; #ifdef CISCO_ACCOUNTING_HACK int acctsessiontime = 0; #endif memset(querystr, 0, MAX_QUERY_LEN); /* * Find the Acct Status Type */ if ((pair = pairfind(request->packet->vps, PW_ACCT_STATUS_TYPE)) != NULL) { acctstatustype = pair->vp_integer; } else { radius_xlat(logstr, sizeof(logstr), "packet has no accounting status type. [user '%{User-Name}', nas '%{NAS-IP-Address}']", request, NULL); radlog_request(L_ERR, 0, request, "%s", logstr); return RLM_MODULE_INVALID; } switch (acctstatustype) { /* * The Terminal server informed us that it was rebooted * STOP all records from this NAS */ case PW_STATUS_ACCOUNTING_ON: case PW_STATUS_ACCOUNTING_OFF: RDEBUG("Received Acct On/Off packet"); radius_xlat(querystr, sizeof(querystr), inst->config->accounting_onoff_query, request, sql_escape_func); query_log(request, inst, querystr); sqlsocket = sql_get_socket(inst); if (sqlsocket == NULL) return(RLM_MODULE_FAIL); if (*querystr) { /* non-empty query */ if (rlm_sql_query(sqlsocket, inst, querystr)) { radlog_request(L_ERR, 0, request, "Couldn't update SQL accounting for Acct On/Off packet - %s", (inst->module->sql_error)(sqlsocket, inst->config)); ret = RLM_MODULE_FAIL; } /* * If no one is online, num_affected_rows * will be zero, which is OK. */ (inst->module->sql_finish_query)(sqlsocket, inst->config); } break; /* * Got an update accounting packet */ case PW_STATUS_ALIVE: /* * Set, escape, and check the user attr here */ sql_set_user(inst, request, sqlusername, NULL); radius_xlat(querystr, sizeof(querystr), inst->config->accounting_update_query, request, sql_escape_func); query_log(request, inst, querystr); sqlsocket = sql_get_socket(inst); if (sqlsocket == NULL) return(RLM_MODULE_FAIL); if (*querystr) { /* non-empty query */ if (rlm_sql_query(sqlsocket, inst, querystr)) { radlog_request(L_ERR, 0, request, "Couldn't update SQL accounting ALIVE record - %s", (inst->module->sql_error)(sqlsocket, inst->config)); ret = RLM_MODULE_FAIL; } else { numaffected = (inst->module->sql_affected_rows)(sqlsocket, inst->config); if (numaffected < 1) { /* * If our update above didn't match anything * we assume it's because we haven't seen a * matching Start record. So we have to * insert this update rather than do an update */ radius_xlat(querystr, sizeof(querystr), inst->config->accounting_update_query_alt, request, sql_escape_func); query_log(request, inst, querystr); if (*querystr) { /* non-empty query */ if (rlm_sql_query(sqlsocket, inst, querystr)) { radlog_request(L_ERR, 0, request, "Couldn't insert SQL accounting ALIVE record - %s", (inst->module->sql_error)(sqlsocket, inst->config)); ret = RLM_MODULE_FAIL; } else { numaffected = (inst->module->sql_affected_rows)(sqlsocket, inst->config); if (numaffected < 1) { ret = RLM_MODULE_NOOP; } } } } } (inst->module->sql_finish_query)(sqlsocket, inst->config); } break; /* * Got accounting start packet */ case PW_STATUS_START: /* * Set, escape, and check the user attr here */ sql_set_user(inst, request, sqlusername, NULL); radius_xlat(querystr, sizeof(querystr), inst->config->accounting_start_query, request, sql_escape_func); query_log(request, inst, querystr); sqlsocket = sql_get_socket(inst); if (sqlsocket == NULL) return(RLM_MODULE_FAIL); if (*querystr) { /* non-empty query */ if (rlm_sql_query(sqlsocket, inst, querystr)) { radlog_request(L_ERR, 0, request, "Couldn't insert SQL accounting START record - %s", (inst->module->sql_error)(sqlsocket, inst->config)); /* * We failed the insert above. It's probably because * the stop record came before the start. We try * our alternate query now (typically an UPDATE) */ radius_xlat(querystr, sizeof(querystr), inst->config->accounting_start_query_alt, request, sql_escape_func); query_log(request, inst, querystr); if (*querystr) { /* non-empty query */ if (rlm_sql_query(sqlsocket, inst, querystr)) { radlog_request(L_ERR, 0, request, "Couldn't update SQL accounting START record - %s", (inst->module->sql_error)(sqlsocket, inst->config)); ret = RLM_MODULE_FAIL; } } } else { numaffected = (inst->module->sql_affected_rows)(sqlsocket, inst->config); if (numaffected < 1) { ret = RLM_MODULE_NOOP; } } (inst->module->sql_finish_query)(sqlsocket, inst->config); } break; /* * Got accounting stop packet */ case PW_STATUS_STOP: /* * Set, escape, and check the user attr here */ sql_set_user(inst, request, sqlusername, NULL); radius_xlat(querystr, sizeof(querystr), inst->config->accounting_stop_query, request, sql_escape_func); query_log(request, inst, querystr); sqlsocket = sql_get_socket(inst); if (sqlsocket == NULL) return(RLM_MODULE_FAIL); if (*querystr) { /* non-empty query */ if (rlm_sql_query(sqlsocket, inst, querystr)) { radlog_request(L_ERR, 0, request, "Couldn't update SQL accounting STOP record - %s", (inst->module->sql_error)(sqlsocket, inst->config)); ret = RLM_MODULE_FAIL; } else { numaffected = (inst->module->sql_affected_rows)(sqlsocket, inst->config); if (numaffected < 1) { /* * If our update above didn't match anything * we assume it's because we haven't seen a * matching Start record. So we have to * insert this stop rather than do an update */ #ifdef CISCO_ACCOUNTING_HACK /* * If stop but zero session length AND no previous * session found, drop it as in invalid packet * This is to fix CISCO's aaa from filling our * table with bogus crap */ if ((pair = pairfind(request->packet->vps, PW_ACCT_SESSION_TIME)) != NULL) acctsessiontime = pair->vp_integer; if (acctsessiontime <= 0) { radius_xlat(logstr, sizeof(logstr), "stop packet with zero session length. [user '%{User-Name}', nas '%{NAS-IP-Address}']", request, NULL); radlog_request(L_DBG, 0, request, "%s", logstr); sql_release_socket(inst, sqlsocket); return RLM_MODULE_NOOP; } #endif radius_xlat(querystr, sizeof(querystr), inst->config->accounting_stop_query_alt, request, sql_escape_func); query_log(request, inst, querystr); if (*querystr) { /* non-empty query */ if (rlm_sql_query(sqlsocket, inst, querystr)) { radlog_request(L_ERR, 0, request, "Couldn't insert SQL accounting STOP record - %s", (inst->module->sql_error)(sqlsocket, inst->config)); ret = RLM_MODULE_FAIL; } else { numaffected = (inst->module->sql_affected_rows)(sqlsocket, inst->config); if (numaffected < 1) { ret = RLM_MODULE_NOOP; } } } } } (inst->module->sql_finish_query)(sqlsocket, inst->config); } break; /* * Anything else is ignored. */ default: RDEBUG("Unsupported Acct-Status-Type = %d", acctstatustype); return RLM_MODULE_NOOP; break; } sql_release_socket(inst, sqlsocket); return ret; } /* * See if a user is already logged in. Sets request->simul_count to the * current session count for this user. * * Check twice. If on the first pass the user exceeds his * max. number of logins, do a second pass and validate all * logins by querying the terminal server (using eg. SNMP). */ static int rlm_sql_checksimul(void *instance, REQUEST * request) { SQLSOCK *sqlsocket; SQL_INST *inst = instance; SQL_ROW row; char querystr[MAX_QUERY_LEN]; char sqlusername[MAX_STRING_LEN]; int check = 0; uint32_t ipno = 0; char *call_num = NULL; VALUE_PAIR *vp; int ret; uint32_t nas_addr = 0; int nas_port = 0; /* If simul_count_query is not defined, we don't do any checking */ if (!inst->config->simul_count_query || (inst->config->simul_count_query[0] == 0)) { return RLM_MODULE_NOOP; } if((request->username == NULL) || (request->username->length == 0)) { radlog_request(L_ERR, 0, request, "Zero Length username not permitted\n"); return RLM_MODULE_INVALID; } if(sql_set_user(inst, request, sqlusername, NULL) < 0) return RLM_MODULE_FAIL; radius_xlat(querystr, sizeof(querystr), inst->config->simul_count_query, request, sql_escape_func); /* initialize the sql socket */ sqlsocket = sql_get_socket(inst); if(sqlsocket == NULL) return RLM_MODULE_FAIL; if(rlm_sql_select_query(sqlsocket, inst, querystr)) { radlog(L_ERR, "rlm_sql (%s) sql_checksimul: Database query failed", inst->config->xlat_name); sql_release_socket(inst, sqlsocket); return RLM_MODULE_FAIL; } ret = rlm_sql_fetch_row(sqlsocket, inst); if (ret != 0) { (inst->module->sql_finish_select_query)(sqlsocket, inst->config); sql_release_socket(inst, sqlsocket); return RLM_MODULE_FAIL; } row = sqlsocket->row; if (row == NULL) { (inst->module->sql_finish_select_query)(sqlsocket, inst->config); sql_release_socket(inst, sqlsocket); return RLM_MODULE_FAIL; } request->simul_count = atoi(row[0]); (inst->module->sql_finish_select_query)(sqlsocket, inst->config); if(request->simul_count < request->simul_max) { sql_release_socket(inst, sqlsocket); return RLM_MODULE_OK; } /* * Looks like too many sessions, so let's start verifying * them, unless told to rely on count query only. */ if (!inst->config->simul_verify_query || (inst->config->simul_verify_query[0] == '\0')) { sql_release_socket(inst, sqlsocket); return RLM_MODULE_OK; } radius_xlat(querystr, sizeof(querystr), inst->config->simul_verify_query, request, sql_escape_func); if(rlm_sql_select_query(sqlsocket, inst, querystr)) { radlog_request(L_ERR, 0, request, "Database query error"); sql_release_socket(inst, sqlsocket); return RLM_MODULE_FAIL; } /* * Setup some stuff, like for MPP detection. */ request->simul_count = 0; if ((vp = pairfind(request->packet->vps, PW_FRAMED_IP_ADDRESS)) != NULL) ipno = vp->vp_ipaddr; if ((vp = pairfind(request->packet->vps, PW_CALLING_STATION_ID)) != NULL) call_num = vp->vp_strvalue; while (rlm_sql_fetch_row(sqlsocket, inst) == 0) { row = sqlsocket->row; if (row == NULL) break; if (!row[2]){ (inst->module->sql_finish_select_query)(sqlsocket, inst->config); sql_release_socket(inst, sqlsocket); RDEBUG("Cannot zap stale entry. No username present in entry.", inst->config->xlat_name); return RLM_MODULE_FAIL; } if (!row[1]){ (inst->module->sql_finish_select_query)(sqlsocket, inst->config); sql_release_socket(inst, sqlsocket); RDEBUG("Cannot zap stale entry. No session id in entry.", inst->config->xlat_name); return RLM_MODULE_FAIL; } if (row[3]) nas_addr = inet_addr(row[3]); if (row[4]) nas_port = atoi(row[4]); check = rad_check_ts(nas_addr, nas_port, row[2], row[1]); if (check == 0) { /* * Stale record - zap it. */ if (inst->config->deletestalesessions == TRUE) { uint32_t framed_addr = 0; char proto = 0; int sess_time = 0; if (row[5]) framed_addr = inet_addr(row[5]); if (row[7]){ if (strcmp(row[7], "PPP") == 0) proto = 'P'; else if (strcmp(row[7], "SLIP") == 0) proto = 'S'; } if (row[8]) sess_time = atoi(row[8]); session_zap(request, nas_addr, nas_port, row[2], row[1], framed_addr, proto, sess_time); } } else if (check == 1) { /* * User is still logged in. */ ++request->simul_count; /* * Does it look like a MPP attempt? */ if (row[5] && ipno && inet_addr(row[5]) == ipno) request->simul_mpp = 2; else if (row[6] && call_num && !strncmp(row[6],call_num,16)) request->simul_mpp = 2; } else { /* * Failed to check the terminal server for * duplicate logins: return an error. */ (inst->module->sql_finish_select_query)(sqlsocket, inst->config); sql_release_socket(inst, sqlsocket); radlog_request(L_ERR, 0, request, "Failed to check the terminal server for user '%s'.", row[2]); return RLM_MODULE_FAIL; } } (inst->module->sql_finish_select_query)(sqlsocket, inst->config); sql_release_socket(inst, sqlsocket); /* * The Auth module apparently looks at request->simul_count, * not the return value of this module when deciding to deny * a call for too many sessions. */ return RLM_MODULE_OK; } /* * Execute postauth_query after authentication */ static int rlm_sql_postauth(void *instance, REQUEST *request) { SQLSOCK *sqlsocket = NULL; SQL_INST *inst = instance; char querystr[MAX_QUERY_LEN]; char sqlusername[MAX_STRING_LEN]; if(sql_set_user(inst, request, sqlusername, NULL) < 0) return RLM_MODULE_FAIL; /* If postauth_query is not defined, we stop here */ if (!inst->config->postauth_query || (inst->config->postauth_query[0] == '\0')) return RLM_MODULE_NOOP; /* Expand variables in the query */ memset(querystr, 0, MAX_QUERY_LEN); radius_xlat(querystr, sizeof(querystr), inst->config->postauth_query, request, sql_escape_func); query_log(request, inst, querystr); DEBUG2("rlm_sql (%s) in sql_postauth: query is %s", inst->config->xlat_name, querystr); /* Initialize the sql socket */ sqlsocket = sql_get_socket(inst); if (sqlsocket == NULL) return RLM_MODULE_FAIL; /* Process the query */ if (rlm_sql_query(sqlsocket, inst, querystr)) { radlog(L_ERR, "rlm_sql (%s) in sql_postauth: Database query error - %s", inst->config->xlat_name, (inst->module->sql_error)(sqlsocket, inst->config)); sql_release_socket(inst, sqlsocket); return RLM_MODULE_FAIL; } (inst->module->sql_finish_query)(sqlsocket, inst->config); sql_release_socket(inst, sqlsocket); return RLM_MODULE_OK; } /* globally exported name */ module_t rlm_sql = { RLM_MODULE_INIT, "SQL", RLM_TYPE_THREAD_SAFE, /* type: reserved */ rlm_sql_instantiate, /* instantiation */ rlm_sql_detach, /* detach */ { NULL, /* authentication */ rlm_sql_authorize, /* authorization */ NULL, /* preaccounting */ rlm_sql_accounting, /* accounting */ rlm_sql_checksimul, /* checksimul */ NULL, /* pre-proxy */ NULL, /* post-proxy */ rlm_sql_postauth /* post-auth */ }, }; freeradius-server/src/modules/rlm_sql/rlm_sql.h000066400000000000000000000075741257552170400222720ustar00rootroot00000000000000/*************************************************************************** * rlm_sql.h rlm_sql - FreeRADIUS SQL Module * * * * Header for main SQL module file * * * * Mike Machado * ***************************************************************************/ #ifndef _RLM_SQL_H #define _RLM_SQL_H #include RCSIDH(rlm_sql_h, "$Id$") #ifdef HAVE_PTHREAD_H #include #endif #include #include "conf.h" #define SQLSOCK_LOCKED 0 #define SQLSOCK_UNLOCKED 1 #define PW_ITEM_CHECK 0 #define PW_ITEM_REPLY 1 typedef char** SQL_ROW; typedef struct sql_socket { int id; #ifdef HAVE_PTHREAD_H pthread_mutex_t mutex; #endif struct sql_socket *next; enum { sockconnected, sockunconnected } state; void *conn; SQL_ROW row; time_t connected; int queries; } SQLSOCK; typedef struct rlm_sql_module_t { const char *name; int (*sql_init_socket)(SQLSOCK *sqlsocket, SQL_CONFIG *config); int (*sql_destroy_socket)(SQLSOCK *sqlsocket, SQL_CONFIG *config); int (*sql_query)(SQLSOCK *sqlsocket, SQL_CONFIG *config, char *query); int (*sql_select_query)(SQLSOCK *sqlsocket, SQL_CONFIG *config, char *query); int (*sql_store_result)(SQLSOCK *sqlsocket, SQL_CONFIG *config); int (*sql_num_fields)(SQLSOCK *sqlsocket, SQL_CONFIG *config); int (*sql_num_rows)(SQLSOCK *sqlsocket, SQL_CONFIG *config); int (*sql_fetch_row)(SQLSOCK *sqlsocket, SQL_CONFIG *config); int (*sql_free_result)(SQLSOCK *sqlsocket, SQL_CONFIG *config); const char *(*sql_error)(SQLSOCK *sqlsocket, SQL_CONFIG *config); int (*sql_close)(SQLSOCK *sqlsocket, SQL_CONFIG *config); int (*sql_finish_query)(SQLSOCK *sqlsocket, SQL_CONFIG *config); int (*sql_finish_select_query)(SQLSOCK *sqlsocket, SQL_CONFIG *config); int (*sql_affected_rows)(SQLSOCK *sqlsocket, SQL_CONFIG *config); } rlm_sql_module_t; typedef struct sql_inst SQL_INST; struct sql_inst { SQL_CONFIG myconfig; /* HACK */ time_t connect_after; SQLSOCK *sqlpool; SQLSOCK *last_used; SQL_CONFIG *config; /* pointer to myconfig (HACK) */ lt_dlhandle handle; rlm_sql_module_t *module; int (*sql_set_user)(SQL_INST *inst, REQUEST *request, char *sqlusername, const char *username); SQLSOCK *(*sql_get_socket)(SQL_INST * inst); int (*sql_release_socket)(SQL_INST * inst, SQLSOCK * sqlsocket); size_t (*sql_escape_func)(char *out, size_t outlen, const char *in); int (*sql_query)(SQLSOCK *sqlsocket, SQL_INST *inst, char *query); int (*sql_select_query)(SQLSOCK *sqlsocket, SQL_INST *inst, char *query); int (*sql_fetch_row)(SQLSOCK *sqlsocket, SQL_INST *inst); }; typedef struct sql_grouplist { char groupname[MAX_STRING_LEN]; struct sql_grouplist *next; } SQL_GROUPLIST; int sql_init_socketpool(SQL_INST * inst); void sql_poolfree(SQL_INST * inst); int sql_close_socket(SQL_INST *inst, SQLSOCK * sqlsocket); SQLSOCK *sql_get_socket(SQL_INST * inst); int sql_release_socket(SQL_INST * inst, SQLSOCK * sqlsocket); int sql_userparse(VALUE_PAIR ** first_pair, SQL_ROW row); int sql_read_realms(SQLSOCK * sqlsocket); int sql_getvpdata(SQL_INST * inst, SQLSOCK * sqlsocket, VALUE_PAIR **pair, char *query); int sql_read_naslist(SQLSOCK * sqlsocket); int sql_read_clients(SQLSOCK * sqlsocket); int sql_dict_init(SQLSOCK * sqlsocket); void query_log(REQUEST *request, SQL_INST * inst, char *querystr); int rlm_sql_select_query(SQLSOCK *sqlsocket, SQL_INST *inst, char *query); int rlm_sql_query(SQLSOCK *sqlsocket, SQL_INST *inst, char *query); int rlm_sql_fetch_row(SQLSOCK *sqlsocket, SQL_INST *inst); int sql_set_user(SQL_INST *inst, REQUEST *request, char *sqlusername, const char *username); #endif freeradius-server/src/modules/rlm_sql/sql.c000066400000000000000000000414611257552170400214040ustar00rootroot00000000000000/* * sql.c rlm_sql - FreeRADIUS SQL Module * Main code directly taken from ICRADIUS * * Version: $Id$ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2001,2006 The FreeRADIUS server project * Copyright 2000 Mike Machado * Copyright 2000 Alan DeKok * Copyright 2001 Chad Miller */ #include RCSID("$Id$") #include #include #include #include #include "rlm_sql.h" #ifdef HAVE_PTHREAD_H #endif /* * Connect to a server. If error, set this socket's state to be * "sockunconnected" and set a grace period, during which we won't try * connecting again (to prevent unduly lagging the server and being * impolite to a DB server that may be having other issues). If * successful in connecting, set state to sockconnected. * - chad */ static int connect_single_socket(SQLSOCK *sqlsocket, SQL_INST *inst) { int rcode; radlog(L_INFO, "rlm_sql (%s): Attempting to connect %s #%d", inst->config->xlat_name, inst->module->name, sqlsocket->id); rcode = (inst->module->sql_init_socket)(sqlsocket, inst->config); if (rcode == 0) { radlog(L_INFO, "rlm_sql (%s): Connected new DB handle, #%d", inst->config->xlat_name, sqlsocket->id); sqlsocket->state = sockconnected; if (inst->config->lifetime) time(&sqlsocket->connected); sqlsocket->queries = 0; return(0); } /* * Error, or SQL_DOWN. */ radlog(L_CONS | L_ERR, "rlm_sql (%s): Failed to connect DB handle #%d", inst->config->xlat_name, sqlsocket->id); inst->connect_after = time(NULL) + inst->config->connect_failure_retry_delay; sqlsocket->state = sockunconnected; return(-1); } /************************************************************************* * * Function: sql_init_socketpool * * Purpose: Connect to the sql server, if possible * *************************************************************************/ int sql_init_socketpool(SQL_INST * inst) { int i, rcode; int success = 0; SQLSOCK *sqlsocket; inst->connect_after = 0; inst->sqlpool = NULL; for (i = 0; i < inst->config->num_sql_socks; i++) { radlog(L_DBG, "rlm_sql (%s): starting %d", inst->config->xlat_name, i); sqlsocket = rad_malloc(sizeof(*sqlsocket)); if (sqlsocket == NULL) { return -1; } memset(sqlsocket, 0, sizeof(*sqlsocket)); sqlsocket->conn = NULL; sqlsocket->id = i; sqlsocket->state = sockunconnected; #ifdef HAVE_PTHREAD_H rcode = pthread_mutex_init(&sqlsocket->mutex,NULL); if (rcode != 0) { free(sqlsocket); radlog(L_ERR, "rlm_sql: Failed to init lock: %s", strerror(errno)); return -1; } #endif if (time(NULL) > inst->connect_after) { /* * This sets the sqlsocket->state, and * possibly also inst->connect_after */ if (connect_single_socket(sqlsocket, inst) == 0) { success = 1; } } /* Add this socket to the list of sockets */ sqlsocket->next = inst->sqlpool; inst->sqlpool = sqlsocket; } inst->last_used = NULL; if (!success) { radlog(L_DBG, "rlm_sql (%s): Failed to connect to any SQL server.", inst->config->xlat_name); } return 1; } /************************************************************************* * * Function: sql_poolfree * * Purpose: Clean up and free sql pool * *************************************************************************/ void sql_poolfree(SQL_INST * inst) { SQLSOCK *cur; SQLSOCK *next; for (cur = inst->sqlpool; cur; cur = next) { next = cur->next; sql_close_socket(inst, cur); } inst->sqlpool = NULL; } /************************************************************************* * * Function: sql_close_socket * * Purpose: Close and free a sql sqlsocket * *************************************************************************/ int sql_close_socket(SQL_INST *inst, SQLSOCK * sqlsocket) { radlog(L_INFO, "rlm_sql (%s): Closing sqlsocket %d", inst->config->xlat_name, sqlsocket->id); if (sqlsocket->state == sockconnected) { (inst->module->sql_close)(sqlsocket, inst->config); } if (inst->module->sql_destroy_socket) { (inst->module->sql_destroy_socket)(sqlsocket, inst->config); } #ifdef HAVE_PTHREAD_H pthread_mutex_destroy(&sqlsocket->mutex); #endif free(sqlsocket); return 1; } static time_t last_logged_failure = 0; /************************************************************************* * * Function: sql_get_socket * * Purpose: Return a SQL sqlsocket from the connection pool * *************************************************************************/ SQLSOCK * sql_get_socket(SQL_INST * inst) { SQLSOCK *cur, *start; int tried_to_connect = 0; int unconnected = 0; time_t now = time(NULL); /* * Start at the last place we left off. */ start = inst->last_used; if (!start) start = inst->sqlpool; cur = start; while (cur) { #ifdef HAVE_PTHREAD_H /* * If this socket is in use by another thread, * skip it, and try another socket. * * If it isn't used, then grab it ourselves. */ if (pthread_mutex_trylock(&cur->mutex) != 0) { goto next; } /* else we now have the lock */ #endif /* * If the socket has outlived its lifetime, and * is connected, close it, and mark it as open for * reconnections. */ if (inst->config->lifetime && (cur->state == sockconnected) && ((cur->connected + inst->config->lifetime) < now)) { DEBUG2("Closing socket %d as its lifetime has been exceeded", cur->id); (inst->module->sql_close)(cur, inst->config); cur->state = sockunconnected; goto reconnect; } /* * If we have performed too many queries over this * socket, then close it. */ if (inst->config->max_queries && (cur->state == sockconnected) && (cur->queries >= inst->config->max_queries)) { DEBUG2("Closing socket %d as its max_queries has been exceeded", cur->id); (inst->module->sql_close)(cur, inst->config); cur->state = sockunconnected; goto reconnect; } /* * If we happen upon an unconnected socket, and * this instance's grace period on * (re)connecting has expired, then try to * connect it. This should be really rare. */ if ((cur->state == sockunconnected) && (now > inst->connect_after)) { reconnect: radlog(L_INFO, "rlm_sql (%s): Trying to (re)connect unconnected handle %d..", inst->config->xlat_name, cur->id); tried_to_connect++; connect_single_socket(cur, inst); } /* if we still aren't connected, ignore this handle */ if (cur->state == sockunconnected) { DEBUG("rlm_sql (%s): Ignoring unconnected handle %d..", inst->config->xlat_name, cur->id); unconnected++; #ifdef HAVE_PTHREAD_H pthread_mutex_unlock(&cur->mutex); #endif goto next; } /* should be connected, grab it */ DEBUG("rlm_sql (%s): Reserving sql socket id: %d", inst->config->xlat_name, cur->id); if (unconnected != 0 || tried_to_connect != 0) { DEBUG("rlm_sql (%s): got socket %d after skipping %d unconnected handles, tried to reconnect %d though", inst->config->xlat_name, cur->id, unconnected, tried_to_connect); } /* * The socket is returned in the locked * state. * * We also remember where we left off, * so that the next search can start from * here. * * Note that multiple threads MAY over-write * the 'inst->last_used' variable. This is OK, * as it's a pointer only used for reading. */ inst->last_used = cur->next; cur->queries++; return cur; /* move along the list */ next: cur = cur->next; /* * Because we didnt start at the start, once we * hit the end of the linklist, we should go * back to the beginning and work toward the * middle! */ if (!cur) { cur = inst->sqlpool; } /* * If we're at the socket we started */ if (cur == start) { break; } } /* * Suppress most of the log messages. We don't want to * flood the log with this message for EVERY packet. * Instead, write to the log only once a second or so. * * This code has race conditions when threaded, but the * only result is that a few more messages are logged. */ if (now <= last_logged_failure) return NULL; last_logged_failure = now; /* We get here if every DB handle is unconnected and unconnectABLE */ radlog(L_ERR, "rlm_sql (%s): There are no DB handles to use! skipped %d, tried to connect %d", inst->config->xlat_name, unconnected, tried_to_connect); return NULL; } /************************************************************************* * * Function: sql_release_socket * * Purpose: Frees a SQL sqlsocket back to the connection pool * *************************************************************************/ int sql_release_socket(SQL_INST * inst, SQLSOCK * sqlsocket) { #ifdef HAVE_PTHREAD_H pthread_mutex_unlock(&sqlsocket->mutex); #endif radlog(L_DBG, "rlm_sql (%s): Released sql socket id: %d", inst->config->xlat_name, sqlsocket->id); return 0; } /************************************************************************* * * Function: sql_userparse * * Purpose: Read entries from the database and fill VALUE_PAIR structures * *************************************************************************/ int sql_userparse(VALUE_PAIR ** first_pair, SQL_ROW row) { VALUE_PAIR *pair; const char *ptr, *value; char buf[MAX_STRING_LEN]; char do_xlat = 0; FR_TOKEN token, operator = T_EOL; /* * Verify the 'Attribute' field */ if (row[2] == NULL || row[2][0] == '\0') { radlog(L_ERR, "rlm_sql: The 'Attribute' field is empty or NULL, skipping the entire row."); return -1; } /* * Verify the 'op' field */ if (row[4] != NULL && row[4][0] != '\0') { ptr = row[4]; operator = gettoken(&ptr, buf, sizeof(buf)); if ((operator < T_OP_ADD) || (operator > T_OP_CMP_EQ)) { radlog(L_ERR, "rlm_sql: Invalid operator \"%s\" for attribute %s", row[4], row[2]); return -1; } } else { /* * Complain about empty or invalid 'op' field */ operator = T_OP_CMP_EQ; radlog(L_ERR, "rlm_sql: The 'op' field for attribute '%s = %s' is NULL, or non-existent.", row[2], row[3]); radlog(L_ERR, "rlm_sql: You MUST FIX THIS if you want the configuration to behave as you expect."); } /* * The 'Value' field may be empty or NULL */ value = row[3]; /* * If we have a new-style quoted string, where the * *entire* string is quoted, do xlat's. */ if (row[3] != NULL && ((row[3][0] == '\'') || (row[3][0] == '`') || (row[3][0] == '"')) && (row[3][0] == row[3][strlen(row[3])-1])) { token = gettoken(&value, buf, sizeof(buf)); switch (token) { /* * Take the unquoted string. */ case T_SINGLE_QUOTED_STRING: case T_DOUBLE_QUOTED_STRING: value = buf; break; /* * Mark the pair to be allocated later. */ case T_BACK_QUOTED_STRING: value = NULL; do_xlat = 1; break; /* * Keep the original string. */ default: value = row[3]; break; } } /* * Create the pair */ pair = pairmake(row[2], value, operator); if (pair == NULL) { radlog(L_ERR, "rlm_sql: Failed to create the pair: %s", fr_strerror()); return -1; } if (do_xlat) { pair->flags.do_xlat = 1; strlcpy(pair->vp_strvalue, buf, sizeof(pair->vp_strvalue)); pair->length = 0; } /* * Add the pair into the packet */ pairadd(first_pair, pair); return 0; } /************************************************************************* * * Function: rlm_sql_fetch_row * * Purpose: call the module's sql_fetch_row and implement re-connect * *************************************************************************/ int rlm_sql_fetch_row(SQLSOCK *sqlsocket, SQL_INST *inst) { int ret; if (sqlsocket->conn) { ret = (inst->module->sql_fetch_row)(sqlsocket, inst->config); } else { ret = SQL_DOWN; } if (ret == SQL_DOWN) { /* close the socket that failed, but only if it was open */ if (sqlsocket->conn) { (inst->module->sql_close)(sqlsocket, inst->config); } /* reconnect the socket */ if (connect_single_socket(sqlsocket, inst) < 0) { radlog(L_ERR, "rlm_sql (%s): reconnect failed, database down?", inst->config->xlat_name); return -1; } /* retry the query on the newly connected socket */ ret = (inst->module->sql_fetch_row)(sqlsocket, inst->config); if (ret) { radlog(L_ERR, "rlm_sql (%s): failed after re-connect", inst->config->xlat_name); return -1; } } return ret; } /************************************************************************* * * Function: rlm_sql_query * * Purpose: call the module's sql_query and implement re-connect * *************************************************************************/ int rlm_sql_query(SQLSOCK *sqlsocket, SQL_INST *inst, char *query) { int ret; /* * If there's no query, return an error. */ if (!query || !*query) { return -1; } if (sqlsocket->conn) { ret = (inst->module->sql_query)(sqlsocket, inst->config, query); } else { ret = SQL_DOWN; } if (ret == SQL_DOWN) { /* close the socket that failed */ if (sqlsocket->state == sockconnected) { (inst->module->sql_close)(sqlsocket, inst->config); } /* reconnect the socket */ if (connect_single_socket(sqlsocket, inst) < 0) { radlog(L_ERR, "rlm_sql (%s): reconnect failed, database down?", inst->config->xlat_name); return -1; } /* retry the query on the newly connected socket */ ret = (inst->module->sql_query)(sqlsocket, inst->config, query); if (ret) { radlog(L_ERR, "rlm_sql (%s): failed after re-connect", inst->config->xlat_name); return -1; } } return ret; } /************************************************************************* * * Function: rlm_sql_select_query * * Purpose: call the module's sql_select_query and implement re-connect * *************************************************************************/ int rlm_sql_select_query(SQLSOCK *sqlsocket, SQL_INST *inst, char *query) { int ret; /* * If there's no query, return an error. */ if (!query || !*query) { return -1; } if (sqlsocket->conn) { ret = (inst->module->sql_select_query)(sqlsocket, inst->config, query); } else { ret = SQL_DOWN; } if (ret == SQL_DOWN) { /* close the socket that failed */ if (sqlsocket->state == sockconnected) { (inst->module->sql_close)(sqlsocket, inst->config); } /* reconnect the socket */ if (connect_single_socket(sqlsocket, inst) < 0) { radlog(L_ERR, "rlm_sql (%s): reconnect failed, database down?", inst->config->xlat_name); return -1; } /* retry the query on the newly connected socket */ ret = (inst->module->sql_select_query)(sqlsocket, inst->config, query); if (ret) { radlog(L_ERR, "rlm_sql (%s): failed after re-connect", inst->config->xlat_name); return -1; } } return ret; } /************************************************************************* * * Function: sql_getvpdata * * Purpose: Get any group check or reply pairs * *************************************************************************/ int sql_getvpdata(SQL_INST * inst, SQLSOCK * sqlsocket, VALUE_PAIR **pair, char *query) { SQL_ROW row; int rows = 0; if (rlm_sql_select_query(sqlsocket, inst, query)) { radlog(L_ERR, "rlm_sql_getvpdata: database query error"); return -1; } while (rlm_sql_fetch_row(sqlsocket, inst)==0) { row = sqlsocket->row; if (!row) break; if (sql_userparse(pair, row) != 0) { radlog(L_ERR | L_CONS, "rlm_sql (%s): Error getting data from database", inst->config->xlat_name); (inst->module->sql_finish_select_query)(sqlsocket, inst->config); return -1; } rows++; } (inst->module->sql_finish_select_query)(sqlsocket, inst->config); return rows; } void query_log(REQUEST *request, SQL_INST *inst, char *querystr) { FILE *sqlfile = NULL; if (inst->config->sqltrace) { char buffer[8192]; if (!radius_xlat(buffer, sizeof(buffer), inst->config->tracefile, request, NULL)) { radlog(L_ERR, "rlm_sql (%s): xlat failed.", inst->config->xlat_name); return; } if ((sqlfile = fopen(buffer, "a")) == (FILE *) NULL) { radlog(L_ERR, "rlm_sql (%s): Couldn't open file %s", inst->config->xlat_name, buffer); } else { int fd = fileno(sqlfile); rad_lockfd(fd, MAX_QUERY_LEN); fputs(querystr, sqlfile); fputs(";\n", sqlfile); fclose(sqlfile); /* and release the lock */ } } } freeradius-server/src/modules/rlm_sql/stable000066400000000000000000000001171257552170400216270ustar00rootroot00000000000000rlm_sql_iodbc rlm_sql_mysql rlm_sql_postgresql rlm_sql_oracle rlm_sql_unixodbc freeradius-server/src/modules/rlm_sql_log/000077500000000000000000000000001257552170400212745ustar00rootroot00000000000000freeradius-server/src/modules/rlm_sql_log/Makefile000066400000000000000000000001561257552170400227360ustar00rootroot00000000000000# # Makefile # # Version: $Id$ # TARGET = rlm_sql_log SRCS = rlm_sql_log.c include ../rules.mak freeradius-server/src/modules/rlm_sql_log/rlm_sql_log.c000066400000000000000000000277631257552170400237710ustar00rootroot00000000000000/* * rlm_sql_log.c Append the SQL queries in a log file which * is read later by the radsqlrelay program * * Version: $Id$ * * Author: Nicolas Baradakis * * Copyright (C) 2005 Cegetel * Copyright 2006 The FreeRADIUS server project * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ #include RCSID("$Id$") #include #include #include #include #include static int sql_log_instantiate(CONF_SECTION *conf, void **instance); static int sql_log_detach(void *instance); static int sql_log_accounting(void *instance, REQUEST *request); static int sql_log_postauth(void *instance, REQUEST *request); #define MAX_QUERY_LEN 4096 /* * Define a structure for our module configuration. */ typedef struct rlm_sql_log_t { char *path; char *postauth_query; char *sql_user_name; int utf8; char *allowed_chars; CONF_SECTION *conf_section; } rlm_sql_log_t; /* * A mapping of configuration file names to internal variables. */ static const CONF_PARSER module_config[] = { {"path", PW_TYPE_STRING_PTR, offsetof(rlm_sql_log_t,path), NULL, "${radacctdir}/sql-relay"}, {"Post-Auth", PW_TYPE_STRING_PTR, offsetof(rlm_sql_log_t,postauth_query), NULL, ""}, {"sql_user_name", PW_TYPE_STRING_PTR, offsetof(rlm_sql_log_t,sql_user_name), NULL, ""}, {"utf8", PW_TYPE_BOOLEAN, offsetof(rlm_sql_log_t,utf8), NULL, "no"}, {"safe-characters", PW_TYPE_STRING_PTR, offsetof(rlm_sql_log_t,allowed_chars), NULL, "@abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.-_: /"}, { NULL, -1, 0, NULL, NULL } /* end the list */ }; static char *allowed_chars = NULL; /* * Do any per-module initialization that is separate to each * configured instance of the module. e.g. set up connections * to external databases, read configuration files, set up * dictionary entries, etc. * * If configuration information is given in the config section * that must be referenced in later calls, store a handle to it * in *instance otherwise put a null pointer there. */ static int sql_log_instantiate(CONF_SECTION *conf, void **instance) { rlm_sql_log_t *inst; /* * Set up a storage area for instance data. */ inst = calloc(1, sizeof(rlm_sql_log_t)); if (inst == NULL) { radlog(L_ERR, "rlm_sql_log: Not enough memory"); return -1; } /* * If the configuration parameters can't be parsed, * then fail. */ if (cf_section_parse(conf, inst, module_config) < 0) { radlog(L_ERR, "rlm_sql_log: Unable to parse parameters"); sql_log_detach(inst); return -1; } inst->conf_section = conf; allowed_chars = inst->allowed_chars; *instance = inst; return 0; } /* * Say goodbye to the cruel world. */ static int sql_log_detach(void *instance) { int i; char **p; rlm_sql_log_t *inst = (rlm_sql_log_t *)instance; /* * Free up dynamically allocated string pointers. */ for (i = 0; module_config[i].name != NULL; i++) { if (module_config[i].type != PW_TYPE_STRING_PTR) { continue; } /* * Treat 'config' as an opaque array of bytes, * and take the offset into it. There's a * (char*) pointer at that offset, and we want * to point to it. */ p = (char **) (((char *)inst) + module_config[i].offset); if (!*p) { /* nothing allocated */ continue; } free(*p); *p = NULL; } free(inst); return 0; } /* * Translate the SQL queries. */ static size_t sql_escape_func(char *out, size_t outlen, const char *in) { int len = 0; while (in[0]) { /* * Non-printable characters get replaced with their * mime-encoded equivalents. */ if ((in[0] < 32) || strchr(allowed_chars, *in) == NULL) { /* * Only 3 or less bytes available. */ if (outlen <= 3) { break; } snprintf(out, outlen, "=%02X", (unsigned char) in[0]); in++; out += 3; outlen -= 3; len += 3; continue; } /* * Only one byte left. */ if (outlen <= 1) { break; } /* * Allowed character. */ *out = *in; out++; in++; outlen--; len++; } *out = '\0'; return len; } static size_t sql_utf8_escape_func(char *out, size_t outlen, const char *in) { int len = 0; int utf8 = 0; while (in[0]) { /* * Skip over UTF8 characters */ utf8 = fr_utf8_char((const uint8_t *)in); if (utf8) { if (outlen <= utf8) { break; } while (utf8-- > 0) { *out = *in; out++; in++; outlen--; len++; } continue; } /* * Non-printable characters get replaced with their * mime-encoded equivalents. */ if ((in[0] < 32) || strchr(allowed_chars, *in) == NULL) { /* * Only 3 or less bytes available. */ if (outlen <= 3) { break; } snprintf(out, outlen, "=%02X", (unsigned char) in[0]); in++; out += 3; outlen -= 3; len += 3; continue; } /* * Only one byte left. */ if (outlen <= 1) { break; } /* * Allowed character. */ *out = *in; out++; in++; outlen--; len++; } *out = '\0'; return len; } /* * Add the 'SQL-User-Name' attribute to the packet. */ static int sql_set_user(rlm_sql_log_t *inst, REQUEST *request, char *sqlusername, const char *username) { VALUE_PAIR *vp=NULL; char tmpuser[MAX_STRING_LEN]; tmpuser[0] = '\0'; sqlusername[0] = '\0'; rad_assert(request != NULL); rad_assert(request->packet != NULL); /* Remove any user attr we added previously */ pairdelete(&request->packet->vps, PW_SQL_USER_NAME); if (username != NULL) { strlcpy(tmpuser, username, MAX_STRING_LEN); } else if (inst->sql_user_name[0] != '\0') { radius_xlat(tmpuser, sizeof(tmpuser), inst->sql_user_name, request, NULL); } else { return 0; } if (tmpuser[0] != '\0') { strlcpy(sqlusername, tmpuser, sizeof(tmpuser)); RDEBUG2("sql_set_user escaped user --> '%s'", sqlusername); vp = pairmake("SQL-User-Name", sqlusername, 0); if (vp == NULL) { radlog(L_ERR, "%s", fr_strerror()); return -1; } pairadd(&request->packet->vps, vp); return 0; } return -1; } /* * Replace % in the query. */ static int sql_xlat_query(rlm_sql_log_t *inst, REQUEST *request, const char *query, char *xlat_query, size_t len) { char sqlusername[MAX_STRING_LEN]; /* If query is not defined, we stop here */ if (query[0] == '\0') return RLM_MODULE_NOOP; /* Add attribute 'SQL-User-Name' */ if (sql_set_user(inst, request, sqlusername, NULL) <0) { radlog_request(L_ERR, 0, request, "Couldn't add SQL-User-Name attribute"); return RLM_MODULE_FAIL; } /* Expand variables in the query */ xlat_query[0] = '\0'; radius_xlat(xlat_query, len, query, request, inst->utf8 ? sql_utf8_escape_func : sql_escape_func); if (xlat_query[0] == '\0') { radlog_request(L_ERR, 0, request, "Couldn't xlat the query %s", query); return RLM_MODULE_FAIL; } return RLM_MODULE_OK; } /* * The Perl version of radsqlrelay uses fcntl locks. */ static int setlock(int fd) { #ifdef F_WRLCK struct flock fl; memset(&fl, 0, sizeof(fl)); fl.l_start = 0; fl.l_len = 0; fl.l_type = F_WRLCK; fl.l_whence = SEEK_SET; return fcntl(fd, F_SETLKW, &fl); #else return -1; #endif } /* * Write the line into file (with lock) */ static int sql_log_write(rlm_sql_log_t *inst, REQUEST *request, const char *line) { int fd; FILE *fp; int locked = 0; struct stat st; char *p, path[1024]; path[0] = '\0'; radius_xlat(path, sizeof(path), inst->path, request, NULL); if (path[0] == '\0') { return RLM_MODULE_FAIL; } p = strrchr(path, '/'); if (p) { *p = '\0'; if (rad_mkdir(path, 0755) < 0) { radlog_request(L_ERR, 0, request, "Failed creating %s: %s", path, strerror(errno)); return RLM_MODULE_FAIL; } *p = '/'; } while (!locked) { if ((fd = open(path, O_WRONLY | O_APPEND | O_CREAT, 0666)) < 0) { radlog_request(L_ERR, 0, request, "Couldn't open file %s: %s", path, strerror(errno)); return RLM_MODULE_FAIL; } if (setlock(fd) != 0) { radlog_request(L_ERR, 0, request, "Couldn't lock file %s: %s", path, strerror(errno)); close(fd); return RLM_MODULE_FAIL; } if (fstat(fd, &st) != 0) { radlog_request(L_ERR, 0, request, "Couldn't stat file %s: %s", path, strerror(errno)); close(fd); return RLM_MODULE_FAIL; } if (st.st_nlink == 0) { RDEBUG("File %s removed by another program, retrying", path); close(fd); continue; } locked = 1; } if ((fp = fdopen(fd, "a")) == NULL) { radlog_request(L_ERR, 0, request, "Couldn't associate a stream with file %s: %s", path, strerror(errno)); close(fd); return RLM_MODULE_FAIL; } fputs(line, fp); putc('\n', fp); fclose(fp); /* and unlock */ return RLM_MODULE_OK; } /* * Write accounting information to this module's database. */ static int sql_log_accounting(void *instance, REQUEST *request) { int ret; char querystr[MAX_QUERY_LEN]; const char *cfquery; rlm_sql_log_t *inst = (rlm_sql_log_t *)instance; VALUE_PAIR *pair; DICT_VALUE *dval; CONF_PAIR *cp; rad_assert(request != NULL); rad_assert(request->packet != NULL); RDEBUG("Processing sql_log_accounting"); /* Find the Acct Status Type. */ if ((pair = pairfind(request->packet->vps, PW_ACCT_STATUS_TYPE)) == NULL) { radlog_request(L_ERR, 0, request, "Packet has no account status type"); return RLM_MODULE_INVALID; } /* Search the query in conf section of the module */ if ((dval = dict_valbyattr(PW_ACCT_STATUS_TYPE, pair->vp_integer)) == NULL) { radlog_request(L_ERR, 0, request, "Unsupported Acct-Status-Type = %d", pair->vp_integer); return RLM_MODULE_NOOP; } if ((cp = cf_pair_find(inst->conf_section, dval->name)) == NULL) { RDEBUG("Couldn't find an entry %s in the config section", dval->name); return RLM_MODULE_NOOP; } cfquery = cf_pair_value(cp); /* Xlat the query */ ret = sql_xlat_query(inst, request, cfquery, querystr, sizeof(querystr)); if (ret != RLM_MODULE_OK) return ret; /* Write query into sql-relay file */ return sql_log_write(inst, request, querystr); } /* * Write post-auth information to this module's database. */ static int sql_log_postauth(void *instance, REQUEST *request) { int ret; char querystr[MAX_QUERY_LEN]; rlm_sql_log_t *inst = (rlm_sql_log_t *)instance; rad_assert(request != NULL); RDEBUG("Processing sql_log_postauth"); /* Xlat the query */ ret = sql_xlat_query(inst, request, inst->postauth_query, querystr, sizeof(querystr)); if (ret != RLM_MODULE_OK) return ret; /* Write query into sql-relay file */ return sql_log_write(inst, request, querystr); } /* * The module name should be the only globally exported symbol. * That is, everything else should be 'static'. * * If the module needs to temporarily modify it's instantiation * data, the type should be changed to RLM_TYPE_THREAD_UNSAFE. * The server will then take care of ensuring that the module * is single-threaded. */ module_t rlm_sql_log = { RLM_MODULE_INIT, "sql_log", RLM_TYPE_THREAD_UNSAFE | RLM_TYPE_CHECK_CONFIG_SAFE | RLM_TYPE_HUP_SAFE, /* type */ sql_log_instantiate, /* instantiation */ sql_log_detach, /* detach */ { NULL, /* authentication */ NULL, /* authorization */ NULL, /* preaccounting */ sql_log_accounting, /* accounting */ NULL, /* checksimul */ NULL, /* pre-proxy */ NULL, /* post-proxy */ sql_log_postauth /* post-auth */ }, }; freeradius-server/src/modules/rlm_sqlcounter/000077500000000000000000000000001257552170400220335ustar00rootroot00000000000000freeradius-server/src/modules/rlm_sqlcounter/.gitignore000066400000000000000000000000111257552170400240130ustar00rootroot00000000000000Makefile freeradius-server/src/modules/rlm_sqlcounter/Makefile.in000066400000000000000000000003251257552170400241000ustar00rootroot00000000000000# # $Id$ # TARGET = @targetname@ SRCS = rlm_sqlcounter.c HEADERS = RLM_CFLAGS = @sqlcounter_cflags@ RLM_LIBS = @sqlcounter_ldflags@ RLM_INSTALL = include ../rules.mak $(LT_OBJS): $(HEADERS) freeradius-server/src/modules/rlm_sqlcounter/configure000066400000000000000000003176171257552170400237560ustar00rootroot00000000000000#! /bin/sh # From configure.in Revision. # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.61. # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, # 2002, 2003, 2004, 2005, 2006 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=: # 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 # PATH needs CR # 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 # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false 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.) as_nl=' ' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. 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 # Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # CDPATH. $as_unset CDPATH if test "x$CONFIG_SHELL" = x; then if (eval ":") 2>/dev/null; then as_have_required=yes else as_have_required=no fi if test $as_have_required = yes && (eval ": (as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=\$LINENO as_lineno_2=\$LINENO test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } ") 2> /dev/null; then : else as_candidate_shells= as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. case $as_dir in /*) for as_base in sh bash ksh sh5; do as_candidate_shells="$as_candidate_shells $as_dir/$as_base" done;; esac done IFS=$as_save_IFS for as_shell in $as_candidate_shells $SHELL; do # Try only shells that exist, to save several forks. if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { ("$as_shell") 2> /dev/null <<\_ASEOF 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 : _ASEOF }; then CONFIG_SHELL=$as_shell as_have_required=yes if { "$as_shell" 2> /dev/null <<\_ASEOF 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 : (as_func_return () { (exit $1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = "$1" ); then : else exitcode=1 echo positional parameters were not saved. fi test $exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } _ASEOF }; then break fi fi done if test "x$CONFIG_SHELL" != x; then for as_var in BASH_ENV ENV do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done export CONFIG_SHELL exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} fi if test $as_have_required = no; then echo This script requires a shell more modern than all the echo shells that I found on your system. Please install a echo modern shell, or manually run the script under such a echo shell if you do have one. { (exit 1); exit 1; } fi fi fi (eval "as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0") || { echo No shell found that supports shell functions. echo Please tell autoconf@gnu.org about your system, echo including any error possibly output before this echo message } as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, and appends # trailing '-' during substitution so that $LINENO is not a special # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # scripts with optimization help from Paolo Bonzini. 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" || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi 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 fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi 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=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, 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= SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME= PACKAGE_TARNAME= PACKAGE_VERSION= PACKAGE_STRING= PACKAGE_BUGREPORT= ac_unique_file="rlm_sqlcounter.c" ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datarootdir datadir sysconfdir sharedstatedir localstatedir includedir oldincludedir docdir infodir htmldir dvidir pdfdir psdir libdir localedir mandir DEFS ECHO_C ECHO_N ECHO_T LIBS build_alias host_alias target_alias CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP sqlcounter_ldflags sqlcounter_cflags targetname LIBOBJS LTLIBOBJS' ac_subst_files='' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CPP' # Initialize some variables set by options. ac_init_help= ac_init_version=false # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *) ac_optarg=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_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` eval enable_$ac_feature=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_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` eval enable_$ac_feature=\$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_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/[-.]/_/g'` eval with_$ac_package=\$ac_optarg ;; -without-* | --without-*) ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/[-.]/_/g'` eval with_$ac_package=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 ;; -*) { echo "$as_me: error: unrecognized option: $ac_option Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && 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'` { echo "$as_me: error: missing argument to $ac_option" >&2 { (exit 1); exit 1; }; } fi # Be sure to have absolute directory names. 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 case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; } 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 echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || { echo "$as_me: error: Working directory cannot be determined" >&2 { (exit 1); exit 1; }; } test "X$ac_ls_di" = "X$ac_pwd_ls_di" || { echo "$as_me: error: pwd does not report name of working directory" >&2 { (exit 1); exit 1; }; } # 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 -- "$0" || $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$0" : 'X\(//\)[^/]' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X"$0" | 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 .." { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2 { (exit 1); exit 1; }; } pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures this package to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF _ACEOF fi if test -n "$ac_init_help"; then cat <<\_ACEOF 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 C/C++/Objective C preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. _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" || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`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 echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF configure generated by GNU Autoconf 2.61 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 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 cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by $as_me, which was generated by GNU Autoconf 2.61. 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=. 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=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; 2) ac_configure_args1="$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 ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac done done $as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } $as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export 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 cat <<\_ASBOX ## ---------------- ## ## Cache variables. ## ## ---------------- ## _ASBOX 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_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( *) $as_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 cat <<\_ASBOX ## ----------------- ## ## Output variables. ## ## ----------------- ## _ASBOX echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then cat <<\_ASBOX ## ------------------- ## ## File substitutions. ## ## ------------------- ## _ASBOX echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then cat <<\_ASBOX ## ----------- ## ## confdefs.h. ## ## ----------- ## _ASBOX echo cat confdefs.h echo fi test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" 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'; { (exit 1); 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 # 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 # Let the site file select an alternate cache file if it wants to. # Prefer explicitly selected file to automatically selected ones. if test -n "$CONFIG_SITE"; then set x "$CONFIG_SITE" elif test "x$prefix" != xNONE; then set x "$prefix/share/config.site" "$prefix/etc/config.site" else set x "$ac_default_prefix/share/config.site" \ "$ac_default_prefix/etc/config.site" fi shift for ac_site_file do if test -r "$ac_site_file"; then { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" 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. if test -f "$cache_file"; then { echo "$as_me:$LINENO: loading cache $cache_file" >&5 echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { echo "$as_me:$LINENO: creating cache $cache_file" >&5 echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 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 { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 echo "$as_me: former value: $ac_old_val" >&2;} { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 echo "$as_me: current value: $ac_new_val" >&2;} ac_cache_corrupted=: fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`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. *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 echo "$as_me: error: changes in the environment can compromise the build" >&2;} { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} { (exit 1); exit 1; }; } 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 x$with_rlm_sqlcounter != xno; then 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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}gcc" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="gcc" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}cc" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="$ac_prog" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&5 echo "$as_me: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } # Provide some information about the compiler. echo "$as_me:$LINENO: checking for C compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (ac_try="$ac_compiler --version >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -v >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -V >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out 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. { echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6; } ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # # List of possible output files, starting from the most likely. # The algorithm is not robust to junk in `.', hence go to wildcards (a.*) # only as a last resort. b.out is created by i960 compilers. ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out' # # The IRIX 6 linker writes into existing files which may not be # executable, retaining their permissions. Remove them first so a # subsequent execution test works. ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link_default") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; 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 | *.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 { echo "$as_me:$LINENO: result: $ac_file" >&5 echo "${ECHO_T}$ac_file" >&6; } if test -z "$ac_file"; then echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: C compiler cannot create executables See \`config.log' for more details." >&5 echo "$as_me: error: C compiler cannot create executables See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } fi ac_exeext=$ac_cv_exeext # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { echo "$as_me:$LINENO: checking whether the C compiler works" >&5 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6; } # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then if { ac_try='./$ac_file' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { echo "$as_me:$LINENO: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&5 echo "$as_me: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi fi fi { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } rm -f a.out a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; } { echo "$as_me:$LINENO: result: $cross_compiling" >&5 echo "${ECHO_T}$cross_compiling" >&6; } { echo "$as_me:$LINENO: checking for suffix of executables" >&5 echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; } if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; 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 | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest$ac_cv_exeext { echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 echo "${ECHO_T}$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT { echo "$as_me:$LINENO: checking for suffix of object files" >&5 echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; } if test "${ac_cv_objext+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; 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 ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 echo "${ECHO_T}$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; } if test "${ac_cv_c_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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 { echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; } GCC=`test $ac_compiler_gnu = yes && echo yes` ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CFLAGS="" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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 { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 echo "${ECHO_T}$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 { echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_c89+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_c89=$ac_arg else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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) { echo "$as_me:$LINENO: result: none needed" >&5 echo "${ECHO_T}none needed" >&6; } ;; xno) { echo "$as_me:$LINENO: result: unsupported" >&5 echo "${ECHO_T}unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;; 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 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 { echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if test "${ac_cv_prog_CPP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f 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 { echo "$as_me:$LINENO: result: $CPP" >&5 echo "${ECHO_T}$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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&5 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } 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 targetname=rlm_sqlcounter else targetname= echo \*\*\* module rlm_sqlcounter is disabled. fi if test x"$fail" != x""; then if test x"${enable_strict_dependencies}" = x"yes"; then { { echo "$as_me:$LINENO: error: set --without-rlm_sqlcounter to disable it explicitly." >&5 echo "$as_me: error: set --without-rlm_sqlcounter to disable it explicitly." >&2;} { (exit 1); exit 1; }; } else { echo "$as_me:$LINENO: WARNING: silently not building rlm_sqlcounter." >&5 echo "$as_me: WARNING: silently not building rlm_sqlcounter." >&2;} { echo "$as_me:$LINENO: WARNING: FAILURE: rlm_sqlcounter requires: $fail." >&5 echo "$as_me: WARNING: FAILURE: rlm_sqlcounter requires: $fail." >&2;}; targetname="" fi fi sqlcounter_ldflags=$SMART_LIBS sqlcounter_cflags=$SMART_CFLAGS unset ac_cv_env_LIBS_set unset ac_cv_env_LIBS_value ac_config_files="$ac_config_files 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_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( *) $as_unset $ac_var ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then test "x$cache_file" != "x/dev/null" && { echo "$as_me:$LINENO: updating cache $cache_file" >&5 echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 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}' # Transform confdefs.h into DEFS. # Protect against shell expansion while executing Makefile rules. # Protect against Makefile macro expansion. # # If the first sed substitution is executed (which looks for macros that # take arguments), then branch to the quote section. Otherwise, # look for a macro that doesn't take arguments. ac_script=' t clear :clear s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g t quote s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g t quote b any :quote s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g s/\[/\\&/g s/\]/\\&/g s/\$/$$/g H :any ${ g s/^\n// s/\n/ /g p } ' DEFS=`sed -n "$ac_script" confdefs.h` ac_libobjs= ac_ltlibobjs= 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=`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. ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs : ${CONFIG_STATUS=./config.status} ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >$CONFIG_STATUS <<_ACEOF #! $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} _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ## --------------------- ## ## 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=: # 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 # PATH needs CR # 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 # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false 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.) as_nl=' ' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. 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 # Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # CDPATH. $as_unset CDPATH as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, and appends # trailing '-' during substitution so that $LINENO is not a special # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # scripts with optimization help from Paolo Bonzini. 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" || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi 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 fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi 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=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 # Save the log message, to keep $[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by $as_me, which was generated by GNU Autoconf 2.61. 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 cat >>$CONFIG_STATUS <<_ACEOF # Files that config.status was made for. config_files="$ac_config_files" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit -q, --quiet 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 Configuration files: $config_files Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ config.status configured by $0, generated by GNU Autoconf 2.61, with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" Copyright (C) 2006 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' _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # If no file are specified by the user, then we need to provide default # value. By we need to know if files were specified by the user. 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=$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 ) echo "$ac_cs_version"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift CONFIG_FILES="$CONFIG_FILES $ac_optarg" ac_need_defaults=false;; --he | --h | --help | --hel | -h ) 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. -*) { echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *) ac_config_targets="$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 if \$ac_cs_recheck; then echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 CONFIG_SHELL=$SHELL export CONFIG_SHELL exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; 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 fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= trap 'exit_status=$? { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status ' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || { echo "$me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } # # Set up the sed scripts for CONFIG_FILES section. # # No need to generate the scripts if there are no CONFIG_FILES. # This happens for instance when ./config.status config.h if test -n "$CONFIG_FILES"; then _ACEOF ac_delim='%!_!# ' for ac_last_try in false false false false false :; do cat >conf$$subs.sed <<_ACEOF SHELL!$SHELL$ac_delim PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim PACKAGE_NAME!$PACKAGE_NAME$ac_delim PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim PACKAGE_STRING!$PACKAGE_STRING$ac_delim PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim exec_prefix!$exec_prefix$ac_delim prefix!$prefix$ac_delim program_transform_name!$program_transform_name$ac_delim bindir!$bindir$ac_delim sbindir!$sbindir$ac_delim libexecdir!$libexecdir$ac_delim datarootdir!$datarootdir$ac_delim datadir!$datadir$ac_delim sysconfdir!$sysconfdir$ac_delim sharedstatedir!$sharedstatedir$ac_delim localstatedir!$localstatedir$ac_delim includedir!$includedir$ac_delim oldincludedir!$oldincludedir$ac_delim docdir!$docdir$ac_delim infodir!$infodir$ac_delim htmldir!$htmldir$ac_delim dvidir!$dvidir$ac_delim pdfdir!$pdfdir$ac_delim psdir!$psdir$ac_delim libdir!$libdir$ac_delim localedir!$localedir$ac_delim mandir!$mandir$ac_delim DEFS!$DEFS$ac_delim ECHO_C!$ECHO_C$ac_delim ECHO_N!$ECHO_N$ac_delim ECHO_T!$ECHO_T$ac_delim LIBS!$LIBS$ac_delim build_alias!$build_alias$ac_delim host_alias!$host_alias$ac_delim target_alias!$target_alias$ac_delim CC!$CC$ac_delim CFLAGS!$CFLAGS$ac_delim LDFLAGS!$LDFLAGS$ac_delim CPPFLAGS!$CPPFLAGS$ac_delim ac_ct_CC!$ac_ct_CC$ac_delim EXEEXT!$EXEEXT$ac_delim OBJEXT!$OBJEXT$ac_delim CPP!$CPP$ac_delim sqlcounter_ldflags!$sqlcounter_ldflags$ac_delim sqlcounter_cflags!$sqlcounter_cflags$ac_delim targetname!$targetname$ac_delim LIBOBJS!$LIBOBJS$ac_delim LTLIBOBJS!$LTLIBOBJS$ac_delim _ACEOF if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 50; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` if test -n "$ac_eof"; then ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` ac_eof=`expr $ac_eof + 1` fi cat >>$CONFIG_STATUS <<_ACEOF cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof /@[a-zA-Z_][a-zA-Z_0-9]*@/!b end _ACEOF sed ' s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g s/^/s,@/; s/!/@,|#_!!_#|/ :n t n s/'"$ac_delim"'$/,g/; t s/$/\\/; p N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n ' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF :end s/|#_!!_#|//g CEOF$ac_eof _ACEOF # VPATH may cause trouble with some makes, so we remove $(srcdir), # ${srcdir} and @srcdir@ 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[ ]*=/{ s/:*\$(srcdir):*/:/ s/:*\${srcdir}:*/:/ s/:*@srcdir@:*/:/ s/^\([^=]*=[ ]*\):*/\1/ s/:*$// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF fi # test -n "$CONFIG_FILES" for ac_tag in :F $CONFIG_FILES do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5 echo "$as_me: error: Invalid tag $ac_tag." >&2;} { (exit 1); exit 1; }; };; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 echo "$as_me: error: cannot find input file: $ac_f" >&2;} { (exit 1); exit 1; }; };; esac ac_file_inputs="$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 "`IFS=: echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure." if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { echo "$as_me:$LINENO: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} fi case $ac_tag in *:-:* | *:-) cat >"$tmp/stdin";; 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 || 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" case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`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 || 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" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 echo "$as_me: error: cannot create directory $as_dir" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`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 # _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # 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= case `sed -n '/datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p ' $ac_file_inputs` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF 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 sed "$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s&@configure_input@&$configure_input&;t t s&@top_builddir@&$ac_top_builddir_sub&;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 $ac_datarootdir_hack " $ac_file_inputs | sed -f "$tmp/subs-1.sed" >$tmp/out test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&5 echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&2;} rm -f "$tmp/stdin" case $ac_file in -) cat "$tmp/out"; rm -f "$tmp/out";; *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;; esac ;; esac done # for ac_tag { (exit 0); exit 0; } _ACEOF chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save # 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 || { (exit 1); exit 1; } fi freeradius-server/src/modules/rlm_sqlcounter/configure.in000066400000000000000000000012761257552170400243520ustar00rootroot00000000000000AC_PREREQ([2.53]) AC_INIT(rlm_sqlcounter.c) AC_REVISION($Revision$) AC_DEFUN(modname,[rlm_sqlcounter]) if test x$with_[]modname != xno; then AC_PROG_CC AC_PROG_CPP targetname=modname else targetname= echo \*\*\* module modname is disabled. fi if test x"$fail" != x""; then if test x"${enable_strict_dependencies}" = x"yes"; then AC_MSG_ERROR([set --without-]modname[ to disable it explicitly.]) else AC_MSG_WARN([silently not building ]modname[.]) AC_MSG_WARN([FAILURE: ]modname[ requires: $fail.]); targetname="" fi fi sqlcounter_ldflags=$SMART_LIBS sqlcounter_cflags=$SMART_CFLAGS AC_SUBST(sqlcounter_ldflags) AC_SUBST(sqlcounter_cflags) AC_SUBST(targetname) AC_OUTPUT(Makefile) freeradius-server/src/modules/rlm_sqlcounter/rlm_sqlcounter.c000066400000000000000000000534351257552170400252620ustar00rootroot00000000000000/* * rlm_sqlcounter.c * * Version: $Id$ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2001,2006 The FreeRADIUS server project * Copyright 2001 Alan DeKok */ /* This module is based directly on the rlm_counter module */ #include RCSID("$Id$") #include #include #include #define MAX_QUERY_LEN 1024 static int sqlcounter_detach(void *instance); /* * Note: When your counter spans more than 1 period (ie 3 months * or 2 weeks), this module probably does NOT do what you want! It * calculates the range of dates to count across by first calculating * the End of the Current period and then subtracting the number of * periods you specify from that to determine the beginning of the * range. * * For example, if you specify a 3 month counter and today is June 15th, * the end of the current period is June 30. Subtracting 3 months from * that gives April 1st. So, the counter will sum radacct entries from * April 1st to June 30. Then, next month, it will sum entries from * May 1st to July 31st. * * To fix this behavior, we need to add some way of storing the Next * Reset Time. */ /* * Define a structure for our module configuration. * * These variables do not need to be in a structure, but it's * a lot cleaner to do so, and a pointer to the structure can * be used as the instance handle. */ typedef struct rlm_sqlcounter_t { char *counter_name; /* Daily-Session-Time */ char *check_name; /* Max-Daily-Session */ char *reply_name; /* Session-Timeout */ char *key_name; /* User-Name */ char *sqlmod_inst; /* instance of SQL module to use, usually just 'sql' */ char *query; /* SQL query to retrieve current session time */ char *reset; /* daily, weekly, monthly, never or user defined */ char *allowed_chars; /* safe characters list for SQL queries */ time_t reset_time; time_t last_reset; const DICT_ATTR *key_attr; /* attribute for key field */ const DICT_ATTR *dict_attr; /* attribute for the counter. */ const DICT_ATTR *reply_attr; /* attribute for the reply */ } rlm_sqlcounter_t; /* * A mapping of configuration file names to internal variables. * * Note that the string is dynamically allocated, so it MUST * be freed. When the configuration file parse re-reads the string, * it free's the old one, and strdup's the new one, placing the pointer * to the strdup'd string into 'config.string'. This gets around * buffer over-flows. */ static const CONF_PARSER module_config[] = { { "counter-name", PW_TYPE_STRING_PTR, offsetof(rlm_sqlcounter_t,counter_name), NULL, NULL }, { "check-name", PW_TYPE_STRING_PTR, offsetof(rlm_sqlcounter_t,check_name), NULL, NULL }, { "reply-name", PW_TYPE_STRING_PTR, offsetof(rlm_sqlcounter_t,reply_name), NULL, "Session-Timeout" }, { "key", PW_TYPE_STRING_PTR, offsetof(rlm_sqlcounter_t,key_name), NULL, NULL }, { "sqlmod-inst", PW_TYPE_STRING_PTR, offsetof(rlm_sqlcounter_t,sqlmod_inst), NULL, NULL }, { "query", PW_TYPE_STRING_PTR, offsetof(rlm_sqlcounter_t,query), NULL, NULL }, { "reset", PW_TYPE_STRING_PTR, offsetof(rlm_sqlcounter_t,reset), NULL, NULL }, { "safe-characters", PW_TYPE_STRING_PTR, offsetof(rlm_sqlcounter_t,allowed_chars), NULL, "@abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.-_: /"}, { NULL, -1, 0, NULL, NULL } }; static char *allowed_chars = NULL; /* * Translate the SQL queries. */ static size_t sql_escape_func(char *out, size_t outlen, const char *in) { int len = 0; while (in[0]) { /* * Non-printable characters get replaced with their * mime-encoded equivalents. */ if ((in[0] < 32) || strchr(allowed_chars, *in) == NULL) { /* * Only 3 or less bytes available. */ if (outlen <= 3) { break; } snprintf(out, outlen, "=%02X", (unsigned char) in[0]); in++; out += 3; outlen -= 3; len += 3; continue; } /* * Only one byte left. */ if (outlen <= 1) { break; } /* * Allowed character. */ *out = *in; out++; in++; outlen--; len++; } *out = '\0'; return len; } static int find_next_reset(rlm_sqlcounter_t *data, time_t timeval) { int ret = 0; size_t len; unsigned int num = 1; char last = '\0'; struct tm *tm, s_tm; char sCurrentTime[40], sNextTime[40]; tm = localtime_r(&timeval, &s_tm); len = strftime(sCurrentTime, sizeof(sCurrentTime), "%Y-%m-%d %H:%M:%S", tm); if (len == 0) *sCurrentTime = '\0'; tm->tm_sec = tm->tm_min = 0; if (data->reset == NULL) return -1; if (isdigit((int) data->reset[0])){ len = strlen(data->reset); if (len == 0) return -1; last = data->reset[len - 1]; if (!isalpha((int) last)) last = 'd'; num = atoi(data->reset); DEBUG("rlm_sqlcounter: num=%d, last=%c",num,last); } if (strcmp(data->reset, "hourly") == 0 || last == 'h') { /* * Round up to the next nearest hour. */ tm->tm_hour += num; data->reset_time = mktime(tm); } else if (strcmp(data->reset, "daily") == 0 || last == 'd') { /* * Round up to the next nearest day. */ tm->tm_hour = 0; tm->tm_mday += num; data->reset_time = mktime(tm); } else if (strcmp(data->reset, "weekly") == 0 || last == 'w') { /* * Round up to the next nearest week. */ tm->tm_hour = 0; tm->tm_mday += (7 - tm->tm_wday) +(7*(num-1)); data->reset_time = mktime(tm); } else if (strcmp(data->reset, "monthly") == 0 || last == 'm') { tm->tm_hour = 0; tm->tm_mday = 1; tm->tm_mon += num; data->reset_time = mktime(tm); } else if (strcmp(data->reset, "never") == 0) { data->reset_time = 0; } else { radlog(L_ERR, "rlm_sqlcounter: Unknown reset timer \"%s\"", data->reset); return -1; } len = strftime(sNextTime, sizeof(sNextTime),"%Y-%m-%d %H:%M:%S",tm); if (len == 0) *sNextTime = '\0'; DEBUG2("rlm_sqlcounter: Current Time: %li [%s], Next reset %li [%s]", timeval, sCurrentTime, data->reset_time, sNextTime); return ret; } /* I don't believe that this routine handles Daylight Saving Time adjustments properly. Any suggestions? */ static int find_prev_reset(rlm_sqlcounter_t *data, time_t timeval) { int ret = 0; size_t len; unsigned int num = 1; char last = '\0'; struct tm *tm, s_tm; char sCurrentTime[40], sPrevTime[40]; tm = localtime_r(&timeval, &s_tm); len = strftime(sCurrentTime, sizeof(sCurrentTime), "%Y-%m-%d %H:%M:%S", tm); if (len == 0) *sCurrentTime = '\0'; tm->tm_sec = tm->tm_min = 0; if (data->reset == NULL) return -1; if (isdigit((int) data->reset[0])){ len = strlen(data->reset); if (len == 0) return -1; last = data->reset[len - 1]; if (!isalpha((int) last)) last = 'd'; num = atoi(data->reset); DEBUG("rlm_sqlcounter: num=%d, last=%c",num,last); } if (strcmp(data->reset, "hourly") == 0 || last == 'h') { /* * Round down to the prev nearest hour. */ tm->tm_hour -= num - 1; data->last_reset = mktime(tm); } else if (strcmp(data->reset, "daily") == 0 || last == 'd') { /* * Round down to the prev nearest day. */ tm->tm_hour = 0; tm->tm_mday -= num - 1; data->last_reset = mktime(tm); } else if (strcmp(data->reset, "weekly") == 0 || last == 'w') { /* * Round down to the prev nearest week. */ tm->tm_hour = 0; tm->tm_mday -= (7 - tm->tm_wday) +(7*(num-1)); data->last_reset = mktime(tm); } else if (strcmp(data->reset, "monthly") == 0 || last == 'm') { tm->tm_hour = 0; tm->tm_mday = 1; tm->tm_mon -= num - 1; data->last_reset = mktime(tm); } else if (strcmp(data->reset, "never") == 0) { data->reset_time = 0; } else { radlog(L_ERR, "rlm_sqlcounter: Unknown reset timer \"%s\"", data->reset); return -1; } len = strftime(sPrevTime, sizeof(sPrevTime), "%Y-%m-%d %H:%M:%S", tm); if (len == 0) *sPrevTime = '\0'; DEBUG2("rlm_sqlcounter: Current Time: %li [%s], Prev reset %li [%s]", timeval, sCurrentTime, data->last_reset, sPrevTime); return ret; } /* * Replace % in a string. * * %b last_reset * %e reset_time * %k key_name * %S sqlmod_inst * */ static int sqlcounter_expand(char *out, int outlen, const char *fmt, void *instance) { rlm_sqlcounter_t *data = (rlm_sqlcounter_t *) instance; int c,freespace; const char *p; char *q; char tmpdt[40]; /* For temporary storing of dates */ q = out; for (p = fmt; *p ; p++) { /* Calculate freespace in output */ freespace = outlen - (q - out); if (freespace <= 1) break; c = *p; if ((c != '%') && (c != '\\')) { *q++ = *p; continue; } if (*++p == '\0') break; if (c == '\\') switch(*p) { case '\\': *q++ = *p; break; case 't': *q++ = '\t'; break; case 'n': *q++ = '\n'; break; default: *q++ = c; *q++ = *p; break; } else if (c == '%') switch(*p) { case '%': *q++ = *p; break; case 'b': /* last_reset */ snprintf(tmpdt, sizeof(tmpdt), "%lu", data->last_reset); strlcpy(q, tmpdt, freespace); q += strlen(q); break; case 'e': /* reset_time */ snprintf(tmpdt, sizeof(tmpdt), "%lu", data->reset_time); strlcpy(q, tmpdt, freespace); q += strlen(q); break; case 'k': /* Key Name */ DEBUG2("WARNING: Please replace '%%k' with '${key}'"); strlcpy(q, data->key_name, freespace); q += strlen(q); break; case 'S': /* SQL module instance */ DEBUG2("WARNING: Please replace '%%S' with '${sqlmod-inst}'"); strlcpy(q, data->sqlmod_inst, freespace); q += strlen(q); break; default: *q++ = '%'; *q++ = *p; break; } } *q = '\0'; DEBUG2("sqlcounter_expand: '%s'", out); return strlen(out); } /* * See if the counter matches. */ static int sqlcounter_cmp(void *instance, REQUEST *req, UNUSED VALUE_PAIR *request, VALUE_PAIR *check, VALUE_PAIR *check_pairs, VALUE_PAIR **reply_pairs) { rlm_sqlcounter_t *data = (rlm_sqlcounter_t *) instance; int counter; char querystr[MAX_QUERY_LEN]; char responsestr[MAX_QUERY_LEN]; check_pairs = check_pairs; /* shut the compiler up */ reply_pairs = reply_pairs; /* first, expand %k, %b and %e in query */ sqlcounter_expand(querystr, MAX_QUERY_LEN, data->query, instance); /* second, xlat any request attribs in query */ radius_xlat(responsestr, MAX_QUERY_LEN, querystr, req, sql_escape_func); /* third, wrap query with sql module call & expand */ snprintf(querystr, sizeof(querystr), "%%{%%S:%s}", responsestr); sqlcounter_expand(responsestr, MAX_QUERY_LEN, querystr, instance); /* Finally, xlat resulting SQL query */ radius_xlat(querystr, MAX_QUERY_LEN, responsestr, req, sql_escape_func); counter = atoi(querystr); return counter - check->vp_integer; } /* * Do any per-module initialization that is separate to each * configured instance of the module. e.g. set up connections * to external databases, read configuration files, set up * dictionary entries, etc. * * If configuration information is given in the config section * that must be referenced in later calls, store a handle to it * in *instance otherwise put a null pointer there. */ static int sqlcounter_instantiate(CONF_SECTION *conf, void **instance) { rlm_sqlcounter_t *data; DICT_ATTR *dattr; ATTR_FLAGS flags; time_t now; char buffer[MAX_STRING_LEN]; /* * Set up a storage area for instance data */ data = rad_malloc(sizeof(*data)); if (!data) { radlog(L_ERR, "rlm_sqlcounter: Not enough memory."); return -1; } memset(data, 0, sizeof(*data)); /* * If the configuration parameters can't be parsed, then * fail. */ if (cf_section_parse(conf, data, module_config) < 0) { radlog(L_ERR, "rlm_sqlcounter: Unable to parse parameters."); sqlcounter_detach(data); return -1; } /* * No query, die. */ if (data->query == NULL) { radlog(L_ERR, "rlm_sqlcounter: 'query' must be set."); sqlcounter_detach(data); return -1; } /* * Safe characters list for sql queries. Everything else is * replaced with their mime-encoded equivalents. */ allowed_chars = data->allowed_chars; /* * Discover the attribute number of the key. */ if (data->key_name == NULL) { radlog(L_ERR, "rlm_sqlcounter: 'key' must be set."); sqlcounter_detach(data); return -1; } sql_escape_func(buffer, sizeof(buffer), data->key_name); if (strcmp(buffer, data->key_name) != 0) { radlog(L_ERR, "rlm_sqlcounter: The value for option 'key' is too long or contains unsafe characters."); sqlcounter_detach(data); return -1; } dattr = dict_attrbyname(data->key_name); if (dattr == NULL) { radlog(L_ERR, "rlm_sqlcounter: No such attribute %s", data->key_name); sqlcounter_detach(data); return -1; } data->key_attr = dattr; dattr = dict_attrbyname(data->reply_name); if (!dattr) { radlog(L_ERR, "rlm_sqlcounter: No such attribute %s", data->reply_name); sqlcounter_detach(data); return -1; } if (dattr->type != PW_TYPE_INTEGER) { radlog(L_ERR, "rlm_sqlcounter: Reply attribute %s is not 'integer'", data->reply_name); sqlcounter_detach(data); return -1; } data->reply_attr = dattr; /* * Check the "sqlmod-inst" option. */ if (data->sqlmod_inst == NULL) { radlog(L_ERR, "rlm_sqlcounter: 'sqlmod-inst' must be set."); sqlcounter_detach(data); return -1; } sql_escape_func(buffer, sizeof(buffer), data->sqlmod_inst); if (strcmp(buffer, data->sqlmod_inst) != 0) { radlog(L_ERR, "rlm_sqlcounter: The value for option 'sqlmod-inst' is too long or contains unsafe characters."); sqlcounter_detach(data); return -1; } /* * Create a new attribute for the counter. */ if (data->counter_name == NULL) { radlog(L_ERR, "rlm_sqlcounter: 'counter-name' must be set."); sqlcounter_detach(data); return -1; } memset(&flags, 0, sizeof(flags)); dict_addattr(data->counter_name, 0, PW_TYPE_INTEGER, -1, flags); dattr = dict_attrbyname(data->counter_name); if (dattr == NULL) { radlog(L_ERR, "rlm_sqlcounter: Failed to create counter attribute %s", data->counter_name); sqlcounter_detach(data); return -1; } data->dict_attr = dattr; /* * Create a new attribute for the check item. */ if (data->check_name == NULL) { radlog(L_ERR, "rlm_sqlcounter: 'check-name' must be set."); sqlcounter_detach(data); return -1; } dict_addattr(data->check_name, 0, PW_TYPE_INTEGER, -1, flags); dattr = dict_attrbyname(data->check_name); if (dattr == NULL) { radlog(L_ERR, "rlm_sqlcounter: Failed to create check attribute %s", data->check_name); sqlcounter_detach(data); return -1; } DEBUG2("rlm_sqlcounter: Check attribute %s is number %d", data->check_name, dattr->attr); /* * Discover the end of the current time period. */ if (data->reset == NULL) { radlog(L_ERR, "rlm_sqlcounter: 'reset' must be set."); sqlcounter_detach(data); return -1; } now = time(NULL); data->reset_time = 0; if (find_next_reset(data,now) == -1) { radlog(L_ERR, "rlm_sqlcounter: Failed to find the next reset time."); sqlcounter_detach(data); return -1; } /* * Discover the beginning of the current time period. */ data->last_reset = 0; if (find_prev_reset(data,now) == -1) { radlog(L_ERR, "rlm_sqlcounter: Failed to find the previous reset time."); sqlcounter_detach(data); return -1; } /* * Register the counter comparison operation. */ paircompare_register(data->dict_attr->attr, 0, sqlcounter_cmp, data); *instance = data; return 0; } /* * Find the named user in this modules database. Create the set * of attribute-value pairs to check and reply with for this user * from the database. The authentication code only needs to check * the password, the rest is done here. */ static int sqlcounter_authorize(void *instance, REQUEST *request) { rlm_sqlcounter_t *data = (rlm_sqlcounter_t *) instance; int ret=RLM_MODULE_NOOP; unsigned int counter; DICT_ATTR *dattr; VALUE_PAIR *key_vp, *check_vp; VALUE_PAIR *reply_item; char msg[128]; char querystr[MAX_QUERY_LEN]; char responsestr[MAX_QUERY_LEN]; /* quiet the compiler */ instance = instance; request = request; /* * Before doing anything else, see if we have to reset * the counters. */ if (data->reset_time && (data->reset_time <= request->timestamp)) { /* * Re-set the next time and prev_time for this counters range */ data->last_reset = data->reset_time; find_next_reset(data,request->timestamp); } /* * Look for the key. User-Name is special. It means * The REAL username, after stripping. */ DEBUG2("rlm_sqlcounter: Entering module authorize code"); key_vp = pairfind(request->packet->vps, data->key_attr->attr); if (key_vp == NULL) { DEBUG2("rlm_sqlcounter: Could not find Key value pair"); return ret; } /* * Look for the check item */ if ((dattr = dict_attrbyname(data->check_name)) == NULL) { return ret; } /* DEBUG2("rlm_sqlcounter: Found Check item attribute %d", dattr->attr); */ if ((check_vp= pairfind(request->config_items, dattr->attr)) == NULL) { DEBUG2("rlm_sqlcounter: Could not find Check item value pair"); return ret; } /* first, expand %k, %b and %e in query */ sqlcounter_expand(querystr, MAX_QUERY_LEN, data->query, instance); /* second, xlat any request attribs in query */ radius_xlat(responsestr, MAX_QUERY_LEN, querystr, request, sql_escape_func); /* third, wrap query with sql module & expand */ snprintf(querystr, sizeof(querystr), "%%{%%S:%s}", responsestr); sqlcounter_expand(responsestr, MAX_QUERY_LEN, querystr, instance); /* Finally, xlat resulting SQL query */ radius_xlat(querystr, MAX_QUERY_LEN, responsestr, request, sql_escape_func); if (sscanf(querystr, "%u", &counter) != 1) { DEBUG2("rlm_sqlcounter: No integer found in string \"%s\"", querystr); return RLM_MODULE_NOOP; } /* * Check if check item > counter */ if (check_vp->vp_integer > counter) { unsigned int res = check_vp->vp_integer - counter; DEBUG2("rlm_sqlcounter: Check item is greater than query result"); /* * We are assuming that simultaneous-use=1. But * even if that does not happen then our user * could login at max for 2*max-usage-time Is * that acceptable? */ /* * If we are near a reset then add the next * limit, so that the user will not need to login * again. Do this only for Session-Timeout. */ if ((data->reply_attr->attr == PW_SESSION_TIMEOUT) && data->reset_time && (res >= (data->reset_time - request->timestamp))) { res = data->reset_time - request->timestamp; res += check_vp->vp_integer; } /* * Limit the reply attribute to the minimum of * the existing value, or this new one. */ reply_item = pairfind(request->reply->vps, data->reply_attr->attr); if (reply_item) { if (reply_item->vp_integer > res) reply_item->vp_integer = res; } else { reply_item = radius_paircreate(request, &request->reply->vps, data->reply_attr->attr, PW_TYPE_INTEGER); reply_item->vp_integer = res; } ret=RLM_MODULE_OK; DEBUG2("rlm_sqlcounter: Authorized user %s, check_item=%u, counter=%u", key_vp->vp_strvalue,check_vp->vp_integer,counter); DEBUG2("rlm_sqlcounter: Sent Reply-Item for user %s, Type=%s, value=%u", key_vp->vp_strvalue,data->reply_name,reply_item->vp_integer); } else{ char module_fmsg[MAX_STRING_LEN]; VALUE_PAIR *module_fmsg_vp; DEBUG2("rlm_sqlcounter: (Check item - counter) is less than zero"); /* * User is denied access, send back a reply message */ snprintf(msg, sizeof(msg), "Your maximum %s usage time has been reached", data->reset); reply_item=pairmake("Reply-Message", msg, T_OP_EQ); pairadd(&request->reply->vps, reply_item); snprintf(module_fmsg, sizeof(module_fmsg), "rlm_sqlcounter: Maximum %s usage time reached", data->reset); module_fmsg_vp = pairmake("Module-Failure-Message", module_fmsg, T_OP_EQ); pairadd(&request->packet->vps, module_fmsg_vp); ret=RLM_MODULE_REJECT; DEBUG2("rlm_sqlcounter: Rejected user %s, check_item=%u, counter=%u", key_vp->vp_strvalue,check_vp->vp_integer,counter); } return ret; } static int sqlcounter_detach(void *instance) { int i; char **p; rlm_sqlcounter_t *inst = (rlm_sqlcounter_t *)instance; allowed_chars = NULL; paircompare_unregister(inst->dict_attr->attr, sqlcounter_cmp); /* * Free up dynamically allocated string pointers. */ for (i = 0; module_config[i].name != NULL; i++) { if (module_config[i].type != PW_TYPE_STRING_PTR) { continue; } /* * Treat 'config' as an opaque array of bytes, * and take the offset into it. There's a * (char*) pointer at that offset, and we want * to point to it. */ p = (char **) (((char *)inst) + module_config[i].offset); if (!*p) { /* nothing allocated */ continue; } free(*p); *p = NULL; } free(inst); return 0; } /* * The module name should be the only globally exported symbol. * That is, everything else should be 'static'. * * If the module needs to temporarily modify it's instantiation * data, the type should be changed to RLM_TYPE_THREAD_UNSAFE. * The server will then take care of ensuring that the module * is single-threaded. */ module_t rlm_sqlcounter = { RLM_MODULE_INIT, "SQL Counter", RLM_TYPE_THREAD_SAFE, /* type */ sqlcounter_instantiate, /* instantiation */ sqlcounter_detach, /* detach */ { NULL, /* authentication */ sqlcounter_authorize, /* authorization */ NULL, /* preaccounting */ NULL, /* accounting */ NULL, /* checksimul */ NULL, /* pre-proxy */ NULL, /* post-proxy */ NULL /* post-auth */ }, }; freeradius-server/src/modules/rlm_sqlhpwippool/000077500000000000000000000000001257552170400223755ustar00rootroot00000000000000freeradius-server/src/modules/rlm_sqlhpwippool/Makefile.in000066400000000000000000000004411257552170400244410ustar00rootroot00000000000000TARGET = @targetname@ SRCS = rlm_sqlhpwippool.c HEADERS = RLM_CFLAGS = @sqlhpwippool_cflags@ -I$(top_builddir)/src/modules/rlm_sql RLM_LIBS = $(LIBLTDL) @sqlhpwippool_ldflags@ RLM_INSTALL = include ../rules.mak $(STATIC_OBJS): $(HEADERS) $(DYNAMIC_OBJS): $(HEADERS) freeradius-server/src/modules/rlm_sqlhpwippool/config.h.in000066400000000000000000000007271257552170400244260ustar00rootroot00000000000000/* config.h.in. Generated from configure.in by autoheader. */ /* 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 version of this package. */ #undef PACKAGE_VERSION freeradius-server/src/modules/rlm_sqlhpwippool/configure000077500000000000000000003260771257552170400243230ustar00rootroot00000000000000#! /bin/sh # From configure.in Revision. # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.61. # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, # 2002, 2003, 2004, 2005, 2006 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=: # 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 # PATH needs CR # 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 # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false 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.) as_nl=' ' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. 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 # Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # CDPATH. $as_unset CDPATH if test "x$CONFIG_SHELL" = x; then if (eval ":") 2>/dev/null; then as_have_required=yes else as_have_required=no fi if test $as_have_required = yes && (eval ": (as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=\$LINENO as_lineno_2=\$LINENO test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } ") 2> /dev/null; then : else as_candidate_shells= as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. case $as_dir in /*) for as_base in sh bash ksh sh5; do as_candidate_shells="$as_candidate_shells $as_dir/$as_base" done;; esac done IFS=$as_save_IFS for as_shell in $as_candidate_shells $SHELL; do # Try only shells that exist, to save several forks. if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { ("$as_shell") 2> /dev/null <<\_ASEOF 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 : _ASEOF }; then CONFIG_SHELL=$as_shell as_have_required=yes if { "$as_shell" 2> /dev/null <<\_ASEOF 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 : (as_func_return () { (exit $1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = "$1" ); then : else exitcode=1 echo positional parameters were not saved. fi test $exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } _ASEOF }; then break fi fi done if test "x$CONFIG_SHELL" != x; then for as_var in BASH_ENV ENV do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done export CONFIG_SHELL exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} fi if test $as_have_required = no; then echo This script requires a shell more modern than all the echo shells that I found on your system. Please install a echo modern shell, or manually run the script under such a echo shell if you do have one. { (exit 1); exit 1; } fi fi fi (eval "as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0") || { echo No shell found that supports shell functions. echo Please tell autoconf@gnu.org about your system, echo including any error possibly output before this echo message } as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, and appends # trailing '-' during substitution so that $LINENO is not a special # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # scripts with optimization help from Paolo Bonzini. 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" || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi 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 fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi 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=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, 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= SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME= PACKAGE_TARNAME= PACKAGE_VERSION= PACKAGE_STRING= PACKAGE_BUGREPORT= ac_unique_file="rlm_sqlhpwippool.c" ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datarootdir datadir sysconfdir sharedstatedir localstatedir includedir oldincludedir docdir infodir htmldir dvidir pdfdir psdir libdir localedir mandir DEFS ECHO_C ECHO_N ECHO_T LIBS build_alias host_alias target_alias CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP sqlhpwippool_ldflags sqlhpwippool_cflags targetname LIBOBJS LTLIBOBJS' ac_subst_files='' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CPP' # Initialize some variables set by options. ac_init_help= ac_init_version=false # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *) ac_optarg=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_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` eval enable_$ac_feature=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_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` eval enable_$ac_feature=\$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_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/[-.]/_/g'` eval with_$ac_package=\$ac_optarg ;; -without-* | --without-*) ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/[-.]/_/g'` eval with_$ac_package=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 ;; -*) { echo "$as_me: error: unrecognized option: $ac_option Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && 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'` { echo "$as_me: error: missing argument to $ac_option" >&2 { (exit 1); exit 1; }; } fi # Be sure to have absolute directory names. 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 case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; } 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 echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || { echo "$as_me: error: Working directory cannot be determined" >&2 { (exit 1); exit 1; }; } test "X$ac_ls_di" = "X$ac_pwd_ls_di" || { echo "$as_me: error: pwd does not report name of working directory" >&2 { (exit 1); exit 1; }; } # 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 -- "$0" || $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$0" : 'X\(//\)[^/]' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X"$0" | 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 .." { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2 { (exit 1); exit 1; }; } pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures this package to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF _ACEOF fi if test -n "$ac_init_help"; then cat <<\_ACEOF 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 C/C++/Objective C preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. _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" || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`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 echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF configure generated by GNU Autoconf 2.61 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 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 cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by $as_me, which was generated by GNU Autoconf 2.61. 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=. 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=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; 2) ac_configure_args1="$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 ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac done done $as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } $as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export 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 cat <<\_ASBOX ## ---------------- ## ## Cache variables. ## ## ---------------- ## _ASBOX 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_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( *) $as_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 cat <<\_ASBOX ## ----------------- ## ## Output variables. ## ## ----------------- ## _ASBOX echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then cat <<\_ASBOX ## ------------------- ## ## File substitutions. ## ## ------------------- ## _ASBOX echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then cat <<\_ASBOX ## ----------- ## ## confdefs.h. ## ## ----------- ## _ASBOX echo cat confdefs.h echo fi test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" 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'; { (exit 1); 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 # 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 # Let the site file select an alternate cache file if it wants to. # Prefer explicitly selected file to automatically selected ones. if test -n "$CONFIG_SITE"; then set x "$CONFIG_SITE" elif test "x$prefix" != xNONE; then set x "$prefix/share/config.site" "$prefix/etc/config.site" else set x "$ac_default_prefix/share/config.site" \ "$ac_default_prefix/etc/config.site" fi shift for ac_site_file do if test -r "$ac_site_file"; then { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" 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. if test -f "$cache_file"; then { echo "$as_me:$LINENO: loading cache $cache_file" >&5 echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { echo "$as_me:$LINENO: creating cache $cache_file" >&5 echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 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 { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 echo "$as_me: former value: $ac_old_val" >&2;} { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 echo "$as_me: current value: $ac_new_val" >&2;} ac_cache_corrupted=: fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`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. *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 echo "$as_me: error: changes in the environment can compromise the build" >&2;} { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} { (exit 1); exit 1; }; } 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 x$with_rlm_sqlhpwippool != xno; then 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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}gcc" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="gcc" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}cc" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="$ac_prog" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&5 echo "$as_me: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } # Provide some information about the compiler. echo "$as_me:$LINENO: checking for C compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (ac_try="$ac_compiler --version >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -v >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -V >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out 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. { echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6; } ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # # List of possible output files, starting from the most likely. # The algorithm is not robust to junk in `.', hence go to wildcards (a.*) # only as a last resort. b.out is created by i960 compilers. ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out' # # The IRIX 6 linker writes into existing files which may not be # executable, retaining their permissions. Remove them first so a # subsequent execution test works. ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link_default") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; 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 | *.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 { echo "$as_me:$LINENO: result: $ac_file" >&5 echo "${ECHO_T}$ac_file" >&6; } if test -z "$ac_file"; then echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: C compiler cannot create executables See \`config.log' for more details." >&5 echo "$as_me: error: C compiler cannot create executables See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } fi ac_exeext=$ac_cv_exeext # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { echo "$as_me:$LINENO: checking whether the C compiler works" >&5 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6; } # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then if { ac_try='./$ac_file' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { echo "$as_me:$LINENO: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&5 echo "$as_me: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi fi fi { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } rm -f a.out a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; } { echo "$as_me:$LINENO: result: $cross_compiling" >&5 echo "${ECHO_T}$cross_compiling" >&6; } { echo "$as_me:$LINENO: checking for suffix of executables" >&5 echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; } if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; 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 | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest$ac_cv_exeext { echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 echo "${ECHO_T}$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT { echo "$as_me:$LINENO: checking for suffix of object files" >&5 echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; } if test "${ac_cv_objext+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; 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 ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 echo "${ECHO_T}$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; } if test "${ac_cv_c_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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 { echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; } GCC=`test $ac_compiler_gnu = yes && echo yes` ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CFLAGS="" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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 { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 echo "${ECHO_T}$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 { echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_c89+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_c89=$ac_arg else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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) { echo "$as_me:$LINENO: result: none needed" >&5 echo "${ECHO_T}none needed" >&6; } ;; xno) { echo "$as_me:$LINENO: result: unsupported" >&5 echo "${ECHO_T}unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;; 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 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 { echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if test "${ac_cv_prog_CPP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f 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 { echo "$as_me:$LINENO: result: $CPP" >&5 echo "${ECHO_T}$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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&5 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } 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 targetname=rlm_sqlhpwippool else targetname= echo \*\*\* module rlm_sqlhpwippool is disabled. fi if test x"$fail" != x""; then if test x"${enable_strict_dependencies}" = x"yes"; then { { echo "$as_me:$LINENO: error: set --without-rlm_sqlhpwippool to disable it explicitly." >&5 echo "$as_me: error: set --without-rlm_sqlhpwippool to disable it explicitly." >&2;} { (exit 1); exit 1; }; } else { echo "$as_me:$LINENO: WARNING: silently not building rlm_sqlhpwippool." >&5 echo "$as_me: WARNING: silently not building rlm_sqlhpwippool." >&2;} { echo "$as_me:$LINENO: WARNING: FAILURE: rlm_sqlhpwippool requires: $fail." >&5 echo "$as_me: WARNING: FAILURE: rlm_sqlhpwippool requires: $fail." >&2;}; targetname="" fi fi sqlhpwippool_ldflags=$SMART_LIBS sqlhpwippool_cflags=$SMART_CFLAGS ac_config_headers="$ac_config_headers config.h" unset ac_cv_env_LIBS_set unset ac_cv_env_LIBS_value ac_config_files="$ac_config_files 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_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( *) $as_unset $ac_var ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then test "x$cache_file" != "x/dev/null" && { echo "$as_me:$LINENO: updating cache $cache_file" >&5 echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 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= 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=`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. ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs : ${CONFIG_STATUS=./config.status} ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >$CONFIG_STATUS <<_ACEOF #! $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} _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ## --------------------- ## ## 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=: # 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 # PATH needs CR # 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 # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false 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.) as_nl=' ' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. 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 # Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # CDPATH. $as_unset CDPATH as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, and appends # trailing '-' during substitution so that $LINENO is not a special # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # scripts with optimization help from Paolo Bonzini. 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" || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi 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 fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi 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=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 # Save the log message, to keep $[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by $as_me, which was generated by GNU Autoconf 2.61. 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 cat >>$CONFIG_STATUS <<_ACEOF # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ config.status configured by $0, generated by GNU Autoconf 2.61, with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" Copyright (C) 2006 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' _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # If no file are specified by the user, then we need to provide default # value. By we need to know if files were specified by the user. 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=$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 ) echo "$ac_cs_version"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift CONFIG_FILES="$CONFIG_FILES $ac_optarg" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header { echo "$as_me: error: ambiguous option: $1 Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; };; --help | --hel | -h ) 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. -*) { echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *) ac_config_targets="$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 if \$ac_cs_recheck; then echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 CONFIG_SHELL=$SHELL export CONFIG_SHELL exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # 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" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= trap 'exit_status=$? { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status ' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || { echo "$me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } # # Set up the sed scripts for CONFIG_FILES section. # # No need to generate the scripts if there are no CONFIG_FILES. # This happens for instance when ./config.status config.h if test -n "$CONFIG_FILES"; then _ACEOF ac_delim='%!_!# ' for ac_last_try in false false false false false :; do cat >conf$$subs.sed <<_ACEOF SHELL!$SHELL$ac_delim PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim PACKAGE_NAME!$PACKAGE_NAME$ac_delim PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim PACKAGE_STRING!$PACKAGE_STRING$ac_delim PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim exec_prefix!$exec_prefix$ac_delim prefix!$prefix$ac_delim program_transform_name!$program_transform_name$ac_delim bindir!$bindir$ac_delim sbindir!$sbindir$ac_delim libexecdir!$libexecdir$ac_delim datarootdir!$datarootdir$ac_delim datadir!$datadir$ac_delim sysconfdir!$sysconfdir$ac_delim sharedstatedir!$sharedstatedir$ac_delim localstatedir!$localstatedir$ac_delim includedir!$includedir$ac_delim oldincludedir!$oldincludedir$ac_delim docdir!$docdir$ac_delim infodir!$infodir$ac_delim htmldir!$htmldir$ac_delim dvidir!$dvidir$ac_delim pdfdir!$pdfdir$ac_delim psdir!$psdir$ac_delim libdir!$libdir$ac_delim localedir!$localedir$ac_delim mandir!$mandir$ac_delim DEFS!$DEFS$ac_delim ECHO_C!$ECHO_C$ac_delim ECHO_N!$ECHO_N$ac_delim ECHO_T!$ECHO_T$ac_delim LIBS!$LIBS$ac_delim build_alias!$build_alias$ac_delim host_alias!$host_alias$ac_delim target_alias!$target_alias$ac_delim CC!$CC$ac_delim CFLAGS!$CFLAGS$ac_delim LDFLAGS!$LDFLAGS$ac_delim CPPFLAGS!$CPPFLAGS$ac_delim ac_ct_CC!$ac_ct_CC$ac_delim EXEEXT!$EXEEXT$ac_delim OBJEXT!$OBJEXT$ac_delim CPP!$CPP$ac_delim sqlhpwippool_ldflags!$sqlhpwippool_ldflags$ac_delim sqlhpwippool_cflags!$sqlhpwippool_cflags$ac_delim targetname!$targetname$ac_delim LIBOBJS!$LIBOBJS$ac_delim LTLIBOBJS!$LTLIBOBJS$ac_delim _ACEOF if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 50; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` if test -n "$ac_eof"; then ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` ac_eof=`expr $ac_eof + 1` fi cat >>$CONFIG_STATUS <<_ACEOF cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof /@[a-zA-Z_][a-zA-Z_0-9]*@/!b end _ACEOF sed ' s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g s/^/s,@/; s/!/@,|#_!!_#|/ :n t n s/'"$ac_delim"'$/,g/; t s/$/\\/; p N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n ' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF :end s/|#_!!_#|//g CEOF$ac_eof _ACEOF # VPATH may cause trouble with some makes, so we remove $(srcdir), # ${srcdir} and @srcdir@ 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[ ]*=/{ s/:*\$(srcdir):*/:/ s/:*\${srcdir}:*/:/ s/:*@srcdir@:*/:/ s/^\([^=]*=[ ]*\):*/\1/ s/:*$// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF fi # test -n "$CONFIG_FILES" for ac_tag in :F $CONFIG_FILES :H $CONFIG_HEADERS do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5 echo "$as_me: error: Invalid tag $ac_tag." >&2;} { (exit 1); exit 1; }; };; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 echo "$as_me: error: cannot find input file: $ac_f" >&2;} { (exit 1); exit 1; }; };; esac ac_file_inputs="$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 "`IFS=: echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure." if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { echo "$as_me:$LINENO: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} fi case $ac_tag in *:-:* | *:-) cat >"$tmp/stdin";; 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 || 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" case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`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 || 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" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 echo "$as_me: error: cannot create directory $as_dir" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`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 # _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # 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= case `sed -n '/datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p ' $ac_file_inputs` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF 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 sed "$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s&@configure_input@&$configure_input&;t t s&@top_builddir@&$ac_top_builddir_sub&;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 $ac_datarootdir_hack " $ac_file_inputs | sed -f "$tmp/subs-1.sed" >$tmp/out test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&5 echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&2;} rm -f "$tmp/stdin" case $ac_file in -) cat "$tmp/out"; rm -f "$tmp/out";; *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;; esac ;; :H) # # CONFIG_HEADER # _ACEOF # Transform confdefs.h into a sed script `conftest.defines', that # substitutes the proper values into config.h.in to produce config.h. rm -f conftest.defines conftest.tail # First, append a space to every undef/define line, to ease matching. echo 's/$/ /' >conftest.defines # Then, protect against being on the right side of a sed subst, or in # an unquoted here document, in config.status. If some macros were # called several times there might be several #defines for the same # symbol, which is useless. But do not sort them, since the last # AC_DEFINE must be honored. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* # These sed commands are passed to sed as "A NAME B PARAMS C VALUE D", where # NAME is the cpp macro being defined, VALUE is the value it is being given. # PARAMS is the parameter list in the macro definition--in most cases, it's # just an empty string. ac_dA='s,^\\([ #]*\\)[^ ]*\\([ ]*' ac_dB='\\)[ (].*,\\1define\\2' ac_dC=' ' ac_dD=' ,' uniq confdefs.h | sed -n ' t rset :rset s/^[ ]*#[ ]*define[ ][ ]*// t ok d :ok s/[\\&,]/\\&/g s/^\('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/ '"$ac_dA"'\1'"$ac_dB"'\2'"${ac_dC}"'\3'"$ac_dD"'/p s/^\('"$ac_word_re"'\)[ ]*\(.*\)/'"$ac_dA"'\1'"$ac_dB$ac_dC"'\2'"$ac_dD"'/p ' >>conftest.defines # Remove the space that was appended to ease matching. # Then 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. # (The regexp can be short, since the line contains either #define or #undef.) echo 's/ $// s,^[ #]*u.*,/* & */,' >>conftest.defines # Break up conftest.defines: ac_max_sed_lines=50 # First sed command is: sed -f defines.sed $ac_file_inputs >"$tmp/out1" # Second one is: sed -f defines.sed "$tmp/out1" >"$tmp/out2" # Third one will be: sed -f defines.sed "$tmp/out2" >"$tmp/out1" # et cetera. ac_in='$ac_file_inputs' ac_out='"$tmp/out1"' ac_nxt='"$tmp/out2"' while : do # Write a here document: cat >>$CONFIG_STATUS <<_ACEOF # First, check the format of the line: cat >"\$tmp/defines.sed" <<\\CEOF /^[ ]*#[ ]*undef[ ][ ]*$ac_word_re[ ]*\$/b def /^[ ]*#[ ]*define[ ][ ]*$ac_word_re[( ]/b def b :def _ACEOF sed ${ac_max_sed_lines}q conftest.defines >>$CONFIG_STATUS echo 'CEOF sed -f "$tmp/defines.sed"' "$ac_in >$ac_out" >>$CONFIG_STATUS ac_in=$ac_out; ac_out=$ac_nxt; ac_nxt=$ac_in sed 1,${ac_max_sed_lines}d conftest.defines >conftest.tail grep . conftest.tail >/dev/null || break rm -f conftest.defines mv conftest.tail conftest.defines done rm -f conftest.defines conftest.tail echo "ac_result=$ac_in" >>$CONFIG_STATUS cat >>$CONFIG_STATUS <<\_ACEOF if test x"$ac_file" != x-; then echo "/* $configure_input */" >"$tmp/config.h" cat "$ac_result" >>"$tmp/config.h" if diff $ac_file "$tmp/config.h" >/dev/null 2>&1; then { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 echo "$as_me: $ac_file is unchanged" >&6;} else rm -f $ac_file mv "$tmp/config.h" $ac_file fi else echo "/* $configure_input */" cat "$ac_result" fi rm -f "$tmp/out12" ;; esac done # for ac_tag { (exit 0); exit 0; } _ACEOF chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save # 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 || { (exit 1); exit 1; } fi freeradius-server/src/modules/rlm_sqlhpwippool/configure.in000066400000000000000000000013231257552170400247050ustar00rootroot00000000000000AC_INIT(rlm_sqlhpwippool.c) AC_REVISION($Revision$) AC_DEFUN(modname,[rlm_sqlhpwippool]) if test x$with_[]modname != xno; then AC_PROG_CC AC_PROG_CPP targetname=modname else targetname= echo \*\*\* module modname is disabled. fi if test x"$fail" != x""; then if test x"${enable_strict_dependencies}" = x"yes"; then AC_MSG_ERROR([set --without-]modname[ to disable it explicitly.]) else AC_MSG_WARN([silently not building ]modname[.]) AC_MSG_WARN([FAILURE: ]modname[ requires: $fail.]); targetname="" fi fi sqlhpwippool_ldflags=$SMART_LIBS sqlhpwippool_cflags=$SMART_CFLAGS AC_SUBST(sqlhpwippool_ldflags) AC_SUBST(sqlhpwippool_cflags) AC_SUBST(targetname) AC_CONFIG_HEADER(config.h) AC_OUTPUT(Makefile) freeradius-server/src/modules/rlm_sqlhpwippool/rlm_sqlhpwippool.c000066400000000000000000000610751257552170400261650ustar00rootroot00000000000000/* * rlm_sqlhpwippool.c * Chooses an IPv4 address from pools defined in ASN Netvim * * Version: $Id$ * * 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 * * Copyright (c) 2005-2006 Pawel Foremski , * 2000-2006 The FreeRADIUS server project * * Current bugs/limits: * - probably works only with newer versions of MySQL (subqueries) * - requires FreeRADIUS' SQL user to have proper permissions on proper tables * from Netvim database * - of course uses dirty hacks to get access to the database * - queries and table names are not configurable * - IPv4 only (I don't even care about IPv6 by now) * - pool names (fetched from database) are not "escaped" * - you have to set encoding of radius.acctuniqueid to same as * netvim.ips.rsv_by */ #include "config.h" #include #include #include #include #include "rlm_sql.h" #define VENDOR_ASN 23782 #define ASN_IP_POOL_NAME 1 #define PW_ASN_IP_POOL_NAME (ASN_IP_POOL_NAME | (VENDOR_ASN << 16)) #define RLM_NETVIM_LOG_FMT "rlm_sqlhpwippool(%s, line %u): %s" #define RLM_NETVIM_MAX_ROWS 1000000 #define RLM_NETVIM_TMP_PREFIX "auth-tmp-" static const char rcsid[] = "$Id$"; typedef struct rlm_sqlhpwippool_t { const char *myname; /* name of this instance */ SQL_INST *sqlinst; /* SQL_INST for requested instance */ rlm_sql_module_t *db; /* here the fun takes place ;-) */ #ifdef HAVE_PTHREAD_D pthread_mutex_t mutex; /* used "with" syncafter */ #endif int sincesync; /* req. done so far since last free IP sync. */ /* from config */ char *sqlinst_name; /* rlm_sql instance to use */ char *db_name; /* netvim database */ int nofreefail; /* fail if no free IP addresses found */ int freeafter; /* how many seconds an IP should not be used after freeing */ int syncafter; /* how often to sync with radacct */ } rlm_sqlhpwippool_t; /* char *name, int type, * size_t offset, void *data, char *dflt */ static CONF_PARSER module_config[] = { { "sqlinst_name", PW_TYPE_STRING_PTR, offsetof(rlm_sqlhpwippool_t, sqlinst_name), NULL, "sql" }, { "db_name", PW_TYPE_STRING_PTR, offsetof(rlm_sqlhpwippool_t, db_name), NULL, "netvim" }, { "nofreefail", PW_TYPE_BOOLEAN, offsetof(rlm_sqlhpwippool_t, nofreefail), NULL, "yes" }, { "freeafter", PW_TYPE_INTEGER, offsetof(rlm_sqlhpwippool_t, freeafter), NULL, "300" }, { "syncafter", PW_TYPE_INTEGER, offsetof(rlm_sqlhpwippool_t, syncafter), NULL, "25" }, { NULL, -1, 0, NULL, NULL } /* end */ }; /* wrapper around radlog which adds prefix with module and instance name */ static int nvp_log(unsigned int line, rlm_sqlhpwippool_t *data, int lvl, const char *fmt, ...) { va_list ap; int r; char pfmt[4096]; /* prefix log message with RLM_NETVIM_LOG_FMT */ snprintf(pfmt, sizeof(pfmt), RLM_NETVIM_LOG_FMT, data->myname, line, fmt); va_start(ap, fmt); r = vradlog(lvl, pfmt, ap); va_end(ap); return r; } /* handy SQL query tool */ static int nvp_vquery(unsigned int line, rlm_sqlhpwippool_t *data, SQLSOCK *sqlsock, const char *fmt, va_list ap) { char query[MAX_QUERY_LEN]; vsnprintf(query, MAX_QUERY_LEN, fmt, ap); if (rlm_sql_query(sqlsock, data->sqlinst, query)) { nvp_log(__LINE__, data, L_ERR, "nvp_vquery(): query from line %u: %s", line, (char *)(data->db->sql_error)(sqlsock, data->sqlinst->config)); return 0; } return 1; } /* wrapper around nvp_vquery */ static int nvp_query(unsigned int line, rlm_sqlhpwippool_t *data, SQLSOCK *sqlsock, const char *fmt, ...) { int r; va_list ap; va_start(ap, fmt); r = nvp_vquery(line, data, sqlsock, fmt, ap); va_end(ap); return r; } /* handy wrapper around data->db->sql_finish_query() */ static int nvp_finish(rlm_sqlhpwippool_t *data, SQLSOCK *sqlsock) { return (data->db->sql_finish_query)(sqlsock, data->sqlinst->config); } /* executes query and fetches first row * -1 on no results * 0 on db error * 1 on success */ static int nvp_select(unsigned int line, rlm_sqlhpwippool_t *data, SQLSOCK *sqlsock, const char *fmt, ...) { va_list ap; va_start(ap, fmt); if (!nvp_vquery(line, data, sqlsock, fmt, ap)) { va_end(ap); return 0; } va_end(ap); if ((data->db->sql_store_result)(sqlsock, data->sqlinst->config)) { nvp_log(__LINE__, data, L_ERR, "nvp_select(): error while saving results of query from line %u", line); return 0; } if ((data->db->sql_num_rows)(sqlsock, data->sqlinst->config) < 1) { nvp_log(__LINE__, data, L_DBG, "nvp_select(): no results in query from line %u", line); return -1; } if ((data->db->sql_fetch_row)(sqlsock, data->sqlinst->config)) { nvp_log(__LINE__, data, L_ERR, "nvp_select(): couldn't fetch row " "from results of query from line %u", line); return 0; } return 1; } static int nvp_select_finish(rlm_sqlhpwippool_t *data, SQLSOCK *sqlsock) { return ((data->db->sql_free_result)(sqlsock, data->sqlinst->config) || nvp_finish(data, sqlsock)); } /* frees IPs of closed sessions (eg. by external modifications to db) */ static int nvp_freeclosed(rlm_sqlhpwippool_t *data, SQLSOCK *sqlsock) { if (!nvp_query(__LINE__, data, sqlsock, "UPDATE `%s`.`ips`, `radacct` " "SET " "`ips`.`rsv_until` = `radacct`.`acctstoptime` + INTERVAL %u SECOND " "WHERE " "`radacct`.`acctstoptime` IS NOT NULL AND " /* session is closed */ "(" /* address is being used */ "`ips`.`pid` IS NOT NULL AND " "(`rsv_until` = 0 OR `rsv_until` > NOW())" ") AND " "`radacct`.`acctuniqueid` = `ips`.`rsv_by`", data->db_name, data->freeafter)) { return 0; } nvp_finish(data, sqlsock); return 1; } /* updates number of free IP addresses in pools */ static int nvp_syncfree(rlm_sqlhpwippool_t *data, SQLSOCK *sqlsock) { if (!nvp_query(__LINE__, data, sqlsock, "UPDATE `%s`.`ip_pools` " "SET `ip_pools`.`free` = " "(SELECT COUNT(*) " "FROM `%1$s`.`ips` " "WHERE " "`ips`.`ip` BETWEEN " "`ip_pools`.`ip_start` AND `ip_pools`.`ip_stop` AND " "(" "`ips`.`pid` IS NULL OR " "(`ips`.`rsv_until` > 0 AND `ips`.`rsv_until` < NOW())" "))", data->db_name)) { return 0; } nvp_finish(data, sqlsock); return 1; } /* cleanup IP pools and sync them with radacct */ static int nvp_cleanup(rlm_sqlhpwippool_t *data) { SQLSOCK *sqlsock; /* initialize the SQL socket */ sqlsock = sql_get_socket(data->sqlinst); if (!sqlsock) { nvp_log(__LINE__, data, L_ERR, "nvp_cleanup(): error while " "requesting new SQL connection"); return 0; } /* free IPs of closed sessions */ if (!nvp_freeclosed(data, sqlsock)) { sql_release_socket(data->sqlinst, sqlsock); return 0; } /* add sessions opened in the meantime */ if (!nvp_query(__LINE__, data, sqlsock, "UPDATE `%s`.`ips`, `radacct` " "SET " "`ips`.`pid` = 0, " "`ips`.`rsv_by` = `radacct`.`acctuniqueid`, " "`ips`.`rsv_since` = `radacct`.`acctstarttime`, " "`ips`.`rsv_until` = 0 " "WHERE " "`radacct`.`acctstoptime` IS NULL AND " /* session is opened */ "`ips`.`ip` = INET_ATON(`radacct`.`framedipaddress`) AND " "(" "`ips`.`pid` IS NULL OR " /* "(`ips`.`rsv_until` > 0 AND `ips.`rsv_until` < NOW()) " */ "`ips`.`rsv_until` != 0" /* no acct pkt received yet */ ")", data->db_name)) { sql_release_socket(data->sqlinst, sqlsock); return 0; } else { nvp_finish(data, sqlsock); } /* count number of free IP addresses in IP pools */ if (!nvp_syncfree(data, sqlsock)) { sql_release_socket(data->sqlinst, sqlsock); return 0; } sql_release_socket(data->sqlinst, sqlsock); return 1; } static int sqlhpwippool_detach(void *instance) { rlm_sqlhpwippool_t *data = (rlm_sqlhpwippool_t *) instance; /* (*data) is zeroed on instantiation */ if (data->sqlinst_name) free(data->sqlinst_name); if (data->db_name) free(data->db_name); free(data); return 0; } /* standard foobar code */ static int sqlhpwippool_instantiate(CONF_SECTION *conf, void **instance) { rlm_sqlhpwippool_t *data; module_instance_t *modinst; /* set up a storage area for instance data */ data = rad_malloc(sizeof(*data)); if (!data) return -1; memset(data, 0, sizeof(*data)); /* so _detach will know what to free */ /* fail if the configuration parameters can't be parsed */ if (cf_section_parse(conf, data, module_config) < 0) { sqlhpwippool_detach(*instance); return -1; } /* save my name */ data->myname = cf_section_name2(conf); if (!data->myname) { data->myname = "(no name)"; } data->sincesync = 0; modinst = find_module_instance(cf_section_find("modules"), (data->sqlinst_name), 1 ); if (!modinst) { nvp_log(__LINE__, data, L_ERR, "sqlhpwippool_instantiate(): cannot find module instance " "named \"%s\"", data->sqlinst_name); return -1; } /* check if the given instance is really a rlm_sql instance */ if (strcmp(modinst->entry->name, "rlm_sql") != 0) { nvp_log(__LINE__, data, L_ERR, "sqlhpwippool_instantiate(): given instance (%s) is not " "an instance of the rlm_sql module", data->sqlinst_name); return -1; } /* save pointers to useful "objects" */ data->sqlinst = (SQL_INST *) modinst->insthandle; data->db = (rlm_sql_module_t *) data->sqlinst->module; /* everything went ok, cleanup pool */ *instance = data; return ((nvp_cleanup(data)) ? 0 : -1); } /* assign new IP address, if required */ static int sqlhpwippool_postauth(void *instance, REQUEST *request) { VALUE_PAIR *vp; unsigned char *pname; /* name of requested IP pool */ uint32_t nasip; /* NAS IP in host byte order */ struct in_addr ip = {0}; /* reserved IP for client (net. byte order) */ SQLSOCK *sqlsock; unsigned long s_gid, /* _s_elected in sql result set */ s_prio, /* as above */ s_pid, /* as above */ gid, /* real integer value */ pid, /* as above */ weights_sum, used_sum, ip_start, ip_stop, connid; long prio; rlm_sqlhpwippool_t *data = (rlm_sqlhpwippool_t *) instance; /* if IP is already there, then nothing to do */ vp = pairfind(request->reply->vps, PW_FRAMED_IP_ADDRESS); if (vp) { nvp_log(__LINE__, data, L_DBG, "sqlhpwippool_postauth(): IP address " "already in the reply packet - exiting"); return RLM_MODULE_NOOP; } /* if no pool name, we don't need to do anything */ vp = pairfind(request->reply->vps, PW_ASN_IP_POOL_NAME); if (vp) { pname = vp->vp_strvalue; nvp_log(__LINE__, data, L_DBG, "sqlhpwippool_postauth(): pool name = '%s'", pname); } else { nvp_log(__LINE__, data, L_DBG, "sqlhpwippool_postauth(): no IP pool name - exiting"); return RLM_MODULE_NOOP; } /* if no NAS IP address, assign 0 */ vp = pairfind(request->packet->vps, PW_NAS_IP_ADDRESS); if (vp) { nasip = ntohl(vp->vp_ipaddr); } else { nasip = 0; nvp_log(__LINE__, data, L_DBG, "sqlhpwippool_postauth(): no NAS IP address in " "the request packet - using \"0.0.0.0/0\" (any)"); } /* get our database connection */ sqlsock = sql_get_socket(data->sqlinst); if (!sqlsock) { nvp_log(__LINE__, data, L_ERR, "sqlhpwippool_postauth(): error while requesting an SQL socket"); return RLM_MODULE_FAIL; } /* get connection id as temporary unique integer */ if (nvp_select(__LINE__, data, sqlsock, "SELECT CONNECTION_ID()") < 1) { nvp_log(__LINE__, data, L_ERR, "sqlhpwippool_postauth(): WTF ;-)!"); nvp_select_finish(data, sqlsock); sql_release_socket(data->sqlinst, sqlsock); return RLM_MODULE_FAIL; } connid = strtoul(sqlsock->row[0], (char **) NULL, 10); nvp_select_finish(data, sqlsock); /* synchronize with radacct db, if needed */ if (++data->sincesync >= data->syncafter #ifdef HAVE_PTHREAD_D && (pthread_mutex_trylock(&data->mutex)) == 0 #endif ) { int r; data->sincesync = 0; nvp_log(__LINE__, data, L_DBG, "sqlhpwippool_postauth(): syncing with radacct table"); r = (nvp_freeclosed(data, sqlsock) && nvp_syncfree(data, sqlsock)); #ifdef HAVE_PTHREAD_D pthread_mutex_unlock(&data->mutex); #endif if (!r) { nvp_log(__LINE__, data, L_ERR, "sqlhpwippool_postauth(): synchronization failed"); sql_release_socket(data->sqlinst, sqlsock); return RLM_MODULE_FAIL; } } for (s_gid = 0; s_gid < RLM_NETVIM_MAX_ROWS && !(ip.s_addr); s_gid++) { nvp_log(__LINE__, data, L_DBG, "sqlhpwippool_postauth(): selecting gid on position %lu", s_gid); /* find the most specific group which NAS belongs to */ switch (nvp_select(__LINE__, data, sqlsock, "SELECT `host_groups`.`gid` " "FROM " "`%s`.`host_groups`, " "`%1$s`.`gid_ip`, " "`%1$s`.`ids` " "WHERE " "`host_groups`.`gid` = `ids`.`id` AND " "`ids`.`enabled` = 1 AND " "`host_groups`.`gid` = `gid_ip`.`gid` AND " "%lu BETWEEN `gid_ip`.`ip_start` AND `gid_ip`.`ip_stop` " "ORDER BY (`gid_ip`.`ip_stop` - `gid_ip`.`ip_start`) ASC " "LIMIT %lu, 1", data->db_name, nasip, s_gid)) { case -1: nvp_log(__LINE__, data, L_ERR, "sqlhpwippool_postauth(): couldn't find " "any more matching host groups"); goto end_gid; /* exit the main loop */ case 0: sql_release_socket(data->sqlinst, sqlsock); return RLM_MODULE_FAIL; } /* store the group ID and free memory occupied by results */ gid = strtoul(sqlsock->row[0], (char **) NULL, 10); nvp_select_finish(data, sqlsock); for (s_prio = 0; s_prio < RLM_NETVIM_MAX_ROWS && !(ip.s_addr); s_prio++) { nvp_log(__LINE__, data, L_DBG, "sqlhpwippool_postauth(): selecting prio on position %lu", s_prio); /* prepare to search for best fit pool */ switch (nvp_select(__LINE__, data, sqlsock, "SELECT " "`ip_pools`.`prio`, " "SUM(`ip_pools`.`weight`) AS `weights_sum`, " "(SUM(`ip_pools`.`total`) - " "SUM(`ip_pools`.`free`)) AS `used_sum` " "FROM " "`%s`.`ip_pools`, " "`%1$s`.`ids`, " "`%1$s`.`pool_names` " "WHERE " "`ip_pools`.`gid` = %lu AND " "`ids`.`id` = `ip_pools`.`pid` AND " "`ids`.`enabled` = 1 AND " "`pool_names`.`pnid` = `ip_pools`.`pnid` AND " "`pool_names`.`name` = '%s' AND " "`ip_pools`.`free` > 0 " "GROUP BY `prio` " "ORDER BY `prio` ASC " "LIMIT %lu, 1", data->db_name, gid, pname, s_prio)) { case -1: nvp_log(__LINE__, data, L_DBG, "sqlhpwippool_postauth(): couldn't find " "any more matching pools for gid = %u", gid); goto end_prio; /* select next gid */ case 0: sql_release_socket(data->sqlinst, sqlsock); return RLM_MODULE_FAIL; } /* store the prio and weights sum */ prio = strtol(sqlsock->row[0], (char **) NULL, 10); weights_sum = strtoul(sqlsock->row[1], (char **) NULL, 10); used_sum = strtoul(sqlsock->row[2], (char **) NULL, 10); /* free memory */ nvp_select_finish(data, sqlsock); for (s_pid = 0; s_pid < RLM_NETVIM_MAX_ROWS && !(ip.s_addr); s_pid++) { nvp_log(__LINE__, data, L_DBG, "sqlhpwippool_postauth(): selecting PID on position %lu", s_pid); /* search for best fit pool */ switch (nvp_select(__LINE__, data, sqlsock, "SELECT " "`ip_pools`.`pid`, " "`ip_pools`.`ip_start`, " "`ip_pools`.`ip_stop` " "FROM " "`%s`.`ip_pools`, " "`%1$s`.`ids`, " "`%1$s`.`pool_names` " "WHERE " "`ip_pools`.`gid` = %lu AND " "`ids`.`id` = `ip_pools`.`pid` AND " "`ids`.`enabled` = 1 AND " "`pool_names`.`pnid` = `ip_pools`.`pnid` AND " "`pool_names`.`name` = '%s' AND " "`ip_pools`.`free` > 0 AND " "`prio` = %ld " "ORDER BY (`weight`/%lu.0000 - (`total` - `free`)/%lu) DESC " "LIMIT %lu, 1", data->db_name, gid, pname, prio, weights_sum, used_sum, s_pid)) { case -1: nvp_log(__LINE__, data, L_DBG, "sqlhpwippool_postauth(): couldn't find any more " "matching pools of prio = %ld for gid = %lu", prio, gid); goto end_pid; /* select next prio */ case 0: sql_release_socket(data->sqlinst, sqlsock); return RLM_MODULE_FAIL; } /* store the data and free memory occupied by results */ pid = strtoul(sqlsock->row[0], (char **) NULL, 10); ip_start = strtoul(sqlsock->row[1], (char **) NULL, 10); ip_stop = strtoul(sqlsock->row[2], (char **) NULL, 10); nvp_select_finish(data, sqlsock); /* reserve an IP address */ if (!nvp_query(__LINE__, data, sqlsock, "UPDATE `%s`.`ips` " "SET " "`pid` = %lu, " "`rsv_since` = NOW(), " "`rsv_by` = '" RLM_NETVIM_TMP_PREFIX "%lu', " "`rsv_until` = NOW() + INTERVAL %d SECOND " "WHERE " "`ip` BETWEEN %lu AND %lu AND " "(" "`pid` IS NULL OR " "(`rsv_until` > 0 AND `rsv_until` < NOW())" ") " "ORDER BY RAND() " "LIMIT 1", data->db_name, pid, connid, data->freeafter, ip_start, ip_stop)) { sql_release_socket(data->sqlinst, sqlsock); return RLM_MODULE_FAIL; } else { nvp_finish(data, sqlsock); } /* select assigned IP address */ switch (nvp_select(__LINE__, data, sqlsock, "SELECT `ip` " "FROM `%s`.`ips` " "WHERE `rsv_by` = '" RLM_NETVIM_TMP_PREFIX "%lu' " "ORDER BY `rsv_since` DESC " "LIMIT 1", data->db_name, connid)) { case -1: nvp_log(__LINE__, data, L_ERR, "sqlhpwippool_postauth(): couldn't reserve an IP address " "from pool of pid = %lu (prio = %ld, gid = %lu)", pid, prio, gid); continue; /* select next pid */ case 0: sql_release_socket(data->sqlinst, sqlsock); return RLM_MODULE_FAIL; } /* update free IPs count */ if (!nvp_query(__LINE__, data, sqlsock, "UPDATE `%s`.`ip_pools` " "SET " "`free` = `free` - 1 " "WHERE " "`pid` = %lu " "LIMIT 1", data->db_name, pid)) { sql_release_socket(data->sqlinst, sqlsock); return RLM_MODULE_FAIL; } else { nvp_finish(data, sqlsock); } /* get assigned IP and free memory */ ip.s_addr = htonl(strtoul(sqlsock->row[0], (char **) NULL, 10)); nvp_select_finish(data, sqlsock); } /* pid */ end_pid: continue; /* stupid */ } /* prio */ end_prio: continue; /* stupid */ } /* gid */ end_gid: /* release SQL socket */ sql_release_socket(data->sqlinst, sqlsock); /* no free IP address found */ if (!ip.s_addr) { nvp_log(__LINE__, data, L_INFO, "sqlhpwippool_postauth(): no free IP address found!"); if (data->nofreefail) { nvp_log(__LINE__, data, L_DBG, "sqlhpwippool_postauth(): rejecting user"); return RLM_MODULE_REJECT; } else { nvp_log(__LINE__, data, L_DBG, "sqlhpwippool_postauth(): exiting"); return RLM_MODULE_NOOP; } } /* add IP address to reply packet */ vp = radius_paircreate(request, &request->reply->vps, PW_FRAMED_IP_ADDRESS, PW_TYPE_IPADDR); vp->vp_ipaddr = ip.s_addr; nvp_log(__LINE__, data, L_DBG, "sqlhpwippool_postauth(): returning %s", inet_ntoa(ip)); return RLM_MODULE_OK; } static int sqlhpwippool_accounting(void *instance, REQUEST *request) { VALUE_PAIR *vp; SQLSOCK *sqlsock; struct in_addr nasip; /* NAS IP */ unsigned char *sessid; /* unique session id */ char nasipstr[16]; /* NAS IP in string format */ uint32_t framedip = 0; /* client's IP, host byte order */ uint32_t acct_type; rlm_sqlhpwippool_t *data = (rlm_sqlhpwippool_t *) instance; /* if no unique session ID, don't even try */ vp = pairfind(request->packet->vps, PW_ACCT_UNIQUE_SESSION_ID); if (vp) { sessid = vp->vp_strvalue; } else { nvp_log(__LINE__, data, L_ERR, "sqlhpwippool_accounting(): unique session ID not found"); return RLM_MODULE_FAIL; } vp = pairfind(request->packet->vps, PW_ACCT_STATUS_TYPE); if (vp) { acct_type = vp->vp_integer; } else { nvp_log(__LINE__, data, L_ERR, "sqlhpwippool_accounting(): " "couldn't find type of accounting packet"); return RLM_MODULE_FAIL; } if (!(acct_type == PW_STATUS_START || acct_type == PW_STATUS_ALIVE || acct_type == PW_STATUS_STOP || acct_type == PW_STATUS_ACCOUNTING_OFF || acct_type == PW_STATUS_ACCOUNTING_ON)) { return RLM_MODULE_NOOP; } /* connect to database */ sqlsock = sql_get_socket(data->sqlinst); if (!sqlsock) { nvp_log(__LINE__, data, L_ERR, "sqlhpwippool_accounting(): couldn't connect to database"); return RLM_MODULE_FAIL; } switch (acct_type) { case PW_STATUS_START: case PW_STATUS_ALIVE: vp = pairfind(request->packet->vps, PW_FRAMED_IP_ADDRESS); if (!vp) { nvp_log(__LINE__, data, L_ERR, "sqlhpwippool_accounting(): no framed IP"); sql_release_socket(data->sqlinst, sqlsock); return RLM_MODULE_FAIL; } framedip = ntohl(vp->vp_ipaddr); if (!nvp_query(__LINE__, data, sqlsock, "UPDATE `%s`.`ips` " "SET " "`rsv_until` = 0, " "`rsv_by` = '%s' " "WHERE `ip` = %lu", data->db_name, sessid, framedip)) { sql_release_socket(data->sqlinst, sqlsock); return RLM_MODULE_FAIL; } nvp_finish(data, sqlsock); break; case PW_STATUS_STOP: if (!nvp_query(__LINE__, data, sqlsock, "UPDATE `%s`.`ips`, `%1$s`.`ip_pools` " "SET " "`ips`.`rsv_until` = NOW() + INTERVAL %u SECOND, " "`ip_pools`.`free` = `ip_pools`.`free` + 1 " "WHERE " "`ips`.`rsv_by` = '%s' AND " "`ips`.`ip` BETWEEN `ip_pools`.`ip_start` AND `ip_pools`.`ip_stop`", data->db_name, data->freeafter, sessid)) { sql_release_socket(data->sqlinst, sqlsock); return RLM_MODULE_FAIL; } nvp_finish(data, sqlsock); break; case PW_STATUS_ACCOUNTING_OFF: case PW_STATUS_ACCOUNTING_ON: vp = pairfind(request->packet->vps, PW_NAS_IP_ADDRESS); if (!vp) { nvp_log(__LINE__, data, L_ERR, "sqlhpwippool_accounting(): no NAS IP"); sql_release_socket(data->sqlinst, sqlsock); return RLM_MODULE_FAIL; } nasip.s_addr = vp->vp_ipaddr; strlcpy(nasipstr, inet_ntoa(nasip), sizeof(nasipstr)); if (!nvp_query(__LINE__, data, sqlsock, "UPDATE `%s`.`ips`, `radacct` " "SET `ips`.`rsv_until` = NOW() + INTERVAL %u SECOND " "WHERE " "`radacct`.`nasipaddress` = '%s' AND " "`ips`.`rsv_by` = `radacct`.`acctuniqueid`", data->db_name, data->freeafter, nasipstr)) { sql_release_socket(data->sqlinst, sqlsock); return RLM_MODULE_FAIL; } nvp_finish(data, sqlsock); break; } sql_release_socket(data->sqlinst, sqlsock); return RLM_MODULE_OK; } module_t rlm_sqlhpwippool = { RLM_MODULE_INIT, "sqlhpwippool", /* name */ RLM_TYPE_THREAD_SAFE, /* type */ sqlhpwippool_instantiate, /* instantiation */ sqlhpwippool_detach, /* detach */ { NULL, /* authentication */ NULL, /* authorization */ NULL, /* preaccounting */ sqlhpwippool_accounting,/* accounting */ NULL, /* checksimul */ NULL, /* pre-proxy */ NULL, /* post-proxy */ sqlhpwippool_postauth /* post-auth */ }, }; freeradius-server/src/modules/rlm_sqlhpwippool/sqlhpwippool.sql000066400000000000000000000061711257552170400256640ustar00rootroot00000000000000--- --- Draft of Netvim SQL schema just for rlm_sqlhpwippool --- CREATE DATABASE `netvim` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci; USE netvim; CREATE TABLE `gid_ip` ( `gid` int(10) unsigned NOT NULL default '0' COMMENT 'Host group ID', `ip_start` bigint(20) unsigned NOT NULL default '0' COMMENT 'Beginning of IP range', `ip_stop` bigint(20) unsigned NOT NULL default '0' COMMENT 'End of IP range', KEY `gid` (`gid`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Netvim: host groups to IP ranges relations'; CREATE TABLE `host_groups` ( `gid` int(10) unsigned NOT NULL default '0' COMMENT 'Host group ID', `parent` int(10) unsigned default NULL COMMENT 'ID of parent group', `name` varchar(128) NOT NULL default '' COMMENT 'Host group UNIX name', PRIMARY KEY (`gid`), UNIQUE KEY `group_name` (`name`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Netvim: host groups'; CREATE TABLE `ids` ( `id` int(10) unsigned NOT NULL auto_increment COMMENT 'The One True ID', `enabled` tinyint(1) NOT NULL default '1' COMMENT 'If 0, ignore the object', `modified` datetime NOT NULL default '0000-00-00 00:00:00' COMMENT 'Time when any of object properties were modified', `created` datetime NOT NULL default '0000-00-00 00:00:00' COMMENT 'Object creation date', `type` varchar(64) default NULL COMMENT 'Link to an ef action', PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Entity: the source of ID numbers'; CREATE TABLE `ip_pools` ( `pid` int(10) unsigned NOT NULL default '0' COMMENT 'Named pool ID', `gid` int(10) unsigned NOT NULL default '0' COMMENT 'Host group ID', `pnid` int(10) unsigned NOT NULL default '0' COMMENT 'Pool name ID', `ip_start` bigint(20) unsigned NOT NULL default '0' COMMENT 'Beginning of IP range', `ip_stop` bigint(20) unsigned NOT NULL default '0' COMMENT 'End of IP range', `prio` int(11) NOT NULL default '0' COMMENT 'Pool priority', `weight` int(10) unsigned NOT NULL default '1' COMMENT 'Pool weight', `total` bigint(20) unsigned NOT NULL default '0' COMMENT 'Total number of IPs in pool', `free` bigint(20) unsigned NOT NULL default '0' COMMENT 'Number of free IPs in pool', PRIMARY KEY (`pid`), KEY `gid` (`gid`,`pnid`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Netvim: named IP pools assigned to given host group'; CREATE TABLE `ips` ( `ip` bigint(20) unsigned NOT NULL default '0' COMMENT 'IP address', `pid` int(10) unsigned NOT NULL default '0' COMMENT 'Named pool ID', `rsv_since` datetime NOT NULL default '0000-00-00 00:00:00' COMMENT 'Time when IP was reserved', `rsv_by` varchar(64) default NULL COMMENT 'Who/what reserved IP', `rsv_until` datetime NOT NULL default '0000-00-00 00:00:00' COMMENT 'Reservation timeout', PRIMARY KEY (`ip`), KEY `pid` (`pid`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Netvim: states of single IP addresses'; CREATE TABLE `pool_names` ( `pnid` int(10) unsigned NOT NULL default '0' COMMENT 'Named pool ID', `name` varchar(128) NOT NULL default '' COMMENT 'Pool UNIX name', PRIMARY KEY (`pnid`), UNIQUE KEY `pool_name` (`name`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Netvim: definitions of pool names'; freeradius-server/src/modules/rlm_sqlippool/000077500000000000000000000000001257552170400216565ustar00rootroot00000000000000freeradius-server/src/modules/rlm_sqlippool/.gitignore000066400000000000000000000000111257552170400236360ustar00rootroot00000000000000Makefile freeradius-server/src/modules/rlm_sqlippool/Makefile.in000066400000000000000000000004411257552170400237220ustar00rootroot00000000000000# # $Id$ # INCLUDE += -I/usr/local/include/ TARGET = @targetname@ SRCS = rlm_sqlippool.c HEADERS = $(top_builddir)/src/modules/rlm_sql/rlm_sql.h RLM_CFLAGS = -I$(top_builddir)/src/modules/rlm_sql RLM_LIBS = RLM_INSTALL = include ../rules.mak $(LT_OBJS): $(HEADERS) freeradius-server/src/modules/rlm_sqlippool/configure000077500000000000000000002151171257552170400235740ustar00rootroot00000000000000#! /bin/sh # From configure.in Revision. # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.61. # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, # 2002, 2003, 2004, 2005, 2006 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=: # 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 # PATH needs CR # 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 # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false 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.) as_nl=' ' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. 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 # Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # CDPATH. $as_unset CDPATH if test "x$CONFIG_SHELL" = x; then if (eval ":") 2>/dev/null; then as_have_required=yes else as_have_required=no fi if test $as_have_required = yes && (eval ": (as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=\$LINENO as_lineno_2=\$LINENO test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } ") 2> /dev/null; then : else as_candidate_shells= as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. case $as_dir in /*) for as_base in sh bash ksh sh5; do as_candidate_shells="$as_candidate_shells $as_dir/$as_base" done;; esac done IFS=$as_save_IFS for as_shell in $as_candidate_shells $SHELL; do # Try only shells that exist, to save several forks. if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { ("$as_shell") 2> /dev/null <<\_ASEOF 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 : _ASEOF }; then CONFIG_SHELL=$as_shell as_have_required=yes if { "$as_shell" 2> /dev/null <<\_ASEOF 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 : (as_func_return () { (exit $1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = "$1" ); then : else exitcode=1 echo positional parameters were not saved. fi test $exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } _ASEOF }; then break fi fi done if test "x$CONFIG_SHELL" != x; then for as_var in BASH_ENV ENV do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done export CONFIG_SHELL exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} fi if test $as_have_required = no; then echo This script requires a shell more modern than all the echo shells that I found on your system. Please install a echo modern shell, or manually run the script under such a echo shell if you do have one. { (exit 1); exit 1; } fi fi fi (eval "as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0") || { echo No shell found that supports shell functions. echo Please tell autoconf@gnu.org about your system, echo including any error possibly output before this echo message } as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, and appends # trailing '-' during substitution so that $LINENO is not a special # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # scripts with optimization help from Paolo Bonzini. 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" || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi 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 fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi 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=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, 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= SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME= PACKAGE_TARNAME= PACKAGE_VERSION= PACKAGE_STRING= PACKAGE_BUGREPORT= ac_unique_file="rlm_sqlippool.c" ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datarootdir datadir sysconfdir sharedstatedir localstatedir includedir oldincludedir docdir infodir htmldir dvidir pdfdir psdir libdir localedir mandir DEFS ECHO_C ECHO_N ECHO_T LIBS build_alias host_alias target_alias targetname LIBOBJS LTLIBOBJS' ac_subst_files='' ac_precious_vars='build_alias host_alias target_alias' # Initialize some variables set by options. ac_init_help= ac_init_version=false # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *) ac_optarg=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_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` eval enable_$ac_feature=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_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` eval enable_$ac_feature=\$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_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/[-.]/_/g'` eval with_$ac_package=\$ac_optarg ;; -without-* | --without-*) ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/[-.]/_/g'` eval with_$ac_package=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 ;; -*) { echo "$as_me: error: unrecognized option: $ac_option Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && 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'` { echo "$as_me: error: missing argument to $ac_option" >&2 { (exit 1); exit 1; }; } fi # Be sure to have absolute directory names. 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 case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; } 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 echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || { echo "$as_me: error: Working directory cannot be determined" >&2 { (exit 1); exit 1; }; } test "X$ac_ls_di" = "X$ac_pwd_ls_di" || { echo "$as_me: error: pwd does not report name of working directory" >&2 { (exit 1); exit 1; }; } # 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 -- "$0" || $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$0" : 'X\(//\)[^/]' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X"$0" | 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 .." { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2 { (exit 1); exit 1; }; } pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures this package to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF _ACEOF fi if test -n "$ac_init_help"; then cat <<\_ACEOF _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" || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`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 echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF configure generated by GNU Autoconf 2.61 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 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 cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by $as_me, which was generated by GNU Autoconf 2.61. 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=. 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=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; 2) ac_configure_args1="$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 ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac done done $as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } $as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export 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 cat <<\_ASBOX ## ---------------- ## ## Cache variables. ## ## ---------------- ## _ASBOX 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_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( *) $as_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 cat <<\_ASBOX ## ----------------- ## ## Output variables. ## ## ----------------- ## _ASBOX echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then cat <<\_ASBOX ## ------------------- ## ## File substitutions. ## ## ------------------- ## _ASBOX echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then cat <<\_ASBOX ## ----------- ## ## confdefs.h. ## ## ----------- ## _ASBOX echo cat confdefs.h echo fi test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" 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'; { (exit 1); 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 # 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 # Let the site file select an alternate cache file if it wants to. # Prefer explicitly selected file to automatically selected ones. if test -n "$CONFIG_SITE"; then set x "$CONFIG_SITE" elif test "x$prefix" != xNONE; then set x "$prefix/share/config.site" "$prefix/etc/config.site" else set x "$ac_default_prefix/share/config.site" \ "$ac_default_prefix/etc/config.site" fi shift for ac_site_file do if test -r "$ac_site_file"; then { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" 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. if test -f "$cache_file"; then { echo "$as_me:$LINENO: loading cache $cache_file" >&5 echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { echo "$as_me:$LINENO: creating cache $cache_file" >&5 echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 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 { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 echo "$as_me: former value: $ac_old_val" >&2;} { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 echo "$as_me: current value: $ac_new_val" >&2;} ac_cache_corrupted=: fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`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. *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 echo "$as_me: error: changes in the environment can compromise the build" >&2;} { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} { (exit 1); exit 1; }; } 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 x$with_rlm_sqlippool != xno; then targetname=rlm_sqlippool else targetname= echo \*\*\* module rlm_sqlippool is disabled. fi unset ac_cv_env_LIBS_set unset ac_cv_env_LIBS_value ac_config_files="$ac_config_files 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_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( *) $as_unset $ac_var ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then test "x$cache_file" != "x/dev/null" && { echo "$as_me:$LINENO: updating cache $cache_file" >&5 echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 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}' # Transform confdefs.h into DEFS. # Protect against shell expansion while executing Makefile rules. # Protect against Makefile macro expansion. # # If the first sed substitution is executed (which looks for macros that # take arguments), then branch to the quote section. Otherwise, # look for a macro that doesn't take arguments. ac_script=' t clear :clear s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g t quote s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g t quote b any :quote s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g s/\[/\\&/g s/\]/\\&/g s/\$/$$/g H :any ${ g s/^\n// s/\n/ /g p } ' DEFS=`sed -n "$ac_script" confdefs.h` ac_libobjs= ac_ltlibobjs= 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=`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. ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs : ${CONFIG_STATUS=./config.status} ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >$CONFIG_STATUS <<_ACEOF #! $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} _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ## --------------------- ## ## 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=: # 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 # PATH needs CR # 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 # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false 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.) as_nl=' ' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. 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 # Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # CDPATH. $as_unset CDPATH as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, and appends # trailing '-' during substitution so that $LINENO is not a special # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # scripts with optimization help from Paolo Bonzini. 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" || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi 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 fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi 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=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 # Save the log message, to keep $[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by $as_me, which was generated by GNU Autoconf 2.61. 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 cat >>$CONFIG_STATUS <<_ACEOF # Files that config.status was made for. config_files="$ac_config_files" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit -q, --quiet 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 Configuration files: $config_files Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ config.status configured by $0, generated by GNU Autoconf 2.61, with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" Copyright (C) 2006 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' _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # If no file are specified by the user, then we need to provide default # value. By we need to know if files were specified by the user. 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=$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 ) echo "$ac_cs_version"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift CONFIG_FILES="$CONFIG_FILES $ac_optarg" ac_need_defaults=false;; --he | --h | --help | --hel | -h ) 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. -*) { echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *) ac_config_targets="$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 if \$ac_cs_recheck; then echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 CONFIG_SHELL=$SHELL export CONFIG_SHELL exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; 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 fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= trap 'exit_status=$? { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status ' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || { echo "$me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } # # Set up the sed scripts for CONFIG_FILES section. # # No need to generate the scripts if there are no CONFIG_FILES. # This happens for instance when ./config.status config.h if test -n "$CONFIG_FILES"; then _ACEOF ac_delim='%!_!# ' for ac_last_try in false false false false false :; do cat >conf$$subs.sed <<_ACEOF SHELL!$SHELL$ac_delim PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim PACKAGE_NAME!$PACKAGE_NAME$ac_delim PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim PACKAGE_STRING!$PACKAGE_STRING$ac_delim PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim exec_prefix!$exec_prefix$ac_delim prefix!$prefix$ac_delim program_transform_name!$program_transform_name$ac_delim bindir!$bindir$ac_delim sbindir!$sbindir$ac_delim libexecdir!$libexecdir$ac_delim datarootdir!$datarootdir$ac_delim datadir!$datadir$ac_delim sysconfdir!$sysconfdir$ac_delim sharedstatedir!$sharedstatedir$ac_delim localstatedir!$localstatedir$ac_delim includedir!$includedir$ac_delim oldincludedir!$oldincludedir$ac_delim docdir!$docdir$ac_delim infodir!$infodir$ac_delim htmldir!$htmldir$ac_delim dvidir!$dvidir$ac_delim pdfdir!$pdfdir$ac_delim psdir!$psdir$ac_delim libdir!$libdir$ac_delim localedir!$localedir$ac_delim mandir!$mandir$ac_delim DEFS!$DEFS$ac_delim ECHO_C!$ECHO_C$ac_delim ECHO_N!$ECHO_N$ac_delim ECHO_T!$ECHO_T$ac_delim LIBS!$LIBS$ac_delim build_alias!$build_alias$ac_delim host_alias!$host_alias$ac_delim target_alias!$target_alias$ac_delim targetname!$targetname$ac_delim LIBOBJS!$LIBOBJS$ac_delim LTLIBOBJS!$LTLIBOBJS$ac_delim _ACEOF if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 40; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` if test -n "$ac_eof"; then ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` ac_eof=`expr $ac_eof + 1` fi cat >>$CONFIG_STATUS <<_ACEOF cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof /@[a-zA-Z_][a-zA-Z_0-9]*@/!b end _ACEOF sed ' s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g s/^/s,@/; s/!/@,|#_!!_#|/ :n t n s/'"$ac_delim"'$/,g/; t s/$/\\/; p N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n ' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF :end s/|#_!!_#|//g CEOF$ac_eof _ACEOF # VPATH may cause trouble with some makes, so we remove $(srcdir), # ${srcdir} and @srcdir@ 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[ ]*=/{ s/:*\$(srcdir):*/:/ s/:*\${srcdir}:*/:/ s/:*@srcdir@:*/:/ s/^\([^=]*=[ ]*\):*/\1/ s/:*$// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF fi # test -n "$CONFIG_FILES" for ac_tag in :F $CONFIG_FILES do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5 echo "$as_me: error: Invalid tag $ac_tag." >&2;} { (exit 1); exit 1; }; };; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 echo "$as_me: error: cannot find input file: $ac_f" >&2;} { (exit 1); exit 1; }; };; esac ac_file_inputs="$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 "`IFS=: echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure." if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { echo "$as_me:$LINENO: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} fi case $ac_tag in *:-:* | *:-) cat >"$tmp/stdin";; 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 || 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" case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`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 || 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" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 echo "$as_me: error: cannot create directory $as_dir" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`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 # _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # 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= case `sed -n '/datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p ' $ac_file_inputs` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF 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 sed "$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s&@configure_input@&$configure_input&;t t s&@top_builddir@&$ac_top_builddir_sub&;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 $ac_datarootdir_hack " $ac_file_inputs | sed -f "$tmp/subs-1.sed" >$tmp/out test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&5 echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&2;} rm -f "$tmp/stdin" case $ac_file in -) cat "$tmp/out"; rm -f "$tmp/out";; *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;; esac ;; esac done # for ac_tag { (exit 0); exit 0; } _ACEOF chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save # 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 || { (exit 1); exit 1; } fi freeradius-server/src/modules/rlm_sqlippool/configure.in000066400000000000000000000006341257552170400241720ustar00rootroot00000000000000# # Autoconf input file. # # Version: $Id$ # AC_PREREQ([2.59]) AC_INIT(rlm_sqlippool.c) AC_REVISION($Revision$) AC_DEFUN(modname,[rlm_sqlippool]) if test x$with_[]modname != xno; then dnl This module doesn't need any autoconf test which is not already dnl in top-level configure. targetname=modname else targetname= echo \*\*\* module modname is disabled. fi AC_SUBST(targetname) AC_OUTPUT(Makefile) freeradius-server/src/modules/rlm_sqlippool/rlm_sqlippool.c000066400000000000000000000610551257552170400247250ustar00rootroot00000000000000/* * rlm_sqlippool.c rlm_sqlippool - FreeRADIUS SQL IP Pool Module * * Version: $Id$ * * 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 * * Copyright 2002 Globe.Net Communications Limited * Copyright 2006 The FreeRADIUS server project * Copyright 2006 Suntel Communications */ #include RCSID("$Id$") #include #include #include /* * Define a structure for our module configuration. */ typedef struct rlm_sqlippool_t { char *sql_instance_name; int lease_duration; SQL_INST *sql_inst; char *pool_name; /* We ended up removing the init queries so that its up to user to create the db structure and put the required information in there */ /* Allocation sequence */ time_t last_clear; /* so we only do it once a second */ char *allocate_begin; /* SQL query to begin */ char *allocate_clear; /* SQL query to clear an IP */ char *allocate_find; /* SQL query to find an unused IP */ char *allocate_update; /* SQL query to mark an IP as used */ char *allocate_commit; /* SQL query to commit */ char *allocate_rollback; /* SQL query to rollback */ char *pool_check; /* Query to check for the existence of the pool */ /* Start sequence */ char *start_begin; /* SQL query to begin */ char *start_update; /* SQL query to update an IP entry */ char *start_commit; /* SQL query to commit */ char *start_rollback; /* SQL query to rollback */ /* Alive sequence */ char *alive_begin; /* SQL query to begin */ char *alive_update; /* SQL query to update an IP entry */ char *alive_commit; /* SQL query to commit */ char *alive_rollback; /* SQL query to rollback */ /* Stop sequence */ char *stop_begin; /* SQL query to begin */ char *stop_clear; /* SQL query to clear an IP */ char *stop_commit; /* SQL query to commit */ char *stop_rollback; /* SQL query to rollback */ /* On sequence */ char *on_begin; /* SQL query to begin */ char *on_clear; /* SQL query to clear an entire NAS */ char *on_commit; /* SQL query to commit */ char *on_rollback; /* SQL query to rollback */ /* Off sequence */ char *off_begin; /* SQL query to begin */ char *off_clear; /* SQL query to clear an entire NAS */ char *off_commit; /* SQL query to commit */ char *off_rollback; /* SQL query to rollback */ /* Logging Section */ char *log_exists; /* There was an ip address already assigned */ char *log_success; /* We successfully allocated ip address from pool */ char *log_clear; /* We successfully deallocated ip address from pool */ char *log_failed; /* Failed to allocate ip from the pool */ char *log_nopool; /* There was no Framed-IP-Address but also no Pool-Name */ /* Reserved to handle 255.255.255.254 Requests */ char *defaultpool; /* Default Pool-Name if there is none in the check items */ } rlm_sqlippool_t; /* * A mapping of configuration file names to internal variables. * * Note that the string is dynamically allocated, so it MUST * be freed. When the configuration file parse re-reads the string, * it free's the old one, and strdup's the new one, placing the pointer * to the strdup'd string into 'config.string'. This gets around * buffer over-flows. */ static CONF_PARSER module_config[] = { {"sql-instance-name",PW_TYPE_STRING_PTR, offsetof(rlm_sqlippool_t,sql_instance_name), NULL, "sql"}, { "lease-duration", PW_TYPE_INTEGER, offsetof(rlm_sqlippool_t,lease_duration), NULL, "86400"}, { "pool-name" , PW_TYPE_STRING_PTR, offsetof(rlm_sqlippool_t, pool_name), NULL, ""}, { "allocate-begin", PW_TYPE_STRING_PTR, offsetof(rlm_sqlippool_t,allocate_begin), NULL, "START TRANSACTION" }, { "allocate-clear", PW_TYPE_STRING_PTR, offsetof(rlm_sqlippool_t,allocate_clear), NULL, "" }, { "allocate-find", PW_TYPE_STRING_PTR, offsetof(rlm_sqlippool_t,allocate_find), NULL, "" }, { "allocate-update", PW_TYPE_STRING_PTR, offsetof(rlm_sqlippool_t,allocate_update), NULL, "" }, { "allocate-commit", PW_TYPE_STRING_PTR, offsetof(rlm_sqlippool_t,allocate_commit), NULL, "COMMIT" }, { "allocate-rollback", PW_TYPE_STRING_PTR, offsetof(rlm_sqlippool_t,allocate_rollback), NULL, "ROLLBACK" }, { "pool-check", PW_TYPE_STRING_PTR, offsetof(rlm_sqlippool_t,pool_check), NULL, "" }, { "start-begin", PW_TYPE_STRING_PTR, offsetof(rlm_sqlippool_t,start_begin), NULL, "START TRANSACTION" }, { "start-update", PW_TYPE_STRING_PTR, offsetof(rlm_sqlippool_t,start_update), NULL, "" }, { "start-commit", PW_TYPE_STRING_PTR, offsetof(rlm_sqlippool_t,start_commit), NULL, "COMMIT" }, { "start-rollback", PW_TYPE_STRING_PTR, offsetof(rlm_sqlippool_t,start_rollback), NULL, "ROLLBACK" }, { "alive-begin", PW_TYPE_STRING_PTR, offsetof(rlm_sqlippool_t,alive_begin), NULL, "START TRANSACTION" }, { "alive-update", PW_TYPE_STRING_PTR, offsetof(rlm_sqlippool_t,alive_update), NULL, "" }, { "alive-commit", PW_TYPE_STRING_PTR, offsetof(rlm_sqlippool_t,alive_commit), NULL, "COMMIT" }, { "alive-rollback", PW_TYPE_STRING_PTR, offsetof(rlm_sqlippool_t,alive_rollback), NULL, "ROLLBACK" }, { "stop-begin", PW_TYPE_STRING_PTR, offsetof(rlm_sqlippool_t,stop_begin), NULL, "START TRANSACTION" }, { "stop-clear", PW_TYPE_STRING_PTR, offsetof(rlm_sqlippool_t,stop_clear), NULL, "" }, { "stop-commit", PW_TYPE_STRING_PTR, offsetof(rlm_sqlippool_t,stop_commit), NULL, "COMMIT" }, { "stop-rollback", PW_TYPE_STRING_PTR, offsetof(rlm_sqlippool_t,stop_rollback), NULL, "ROLLBACK" }, { "on-begin", PW_TYPE_STRING_PTR, offsetof(rlm_sqlippool_t,on_begin), NULL, "START TRANSACTION" }, { "on-clear", PW_TYPE_STRING_PTR, offsetof(rlm_sqlippool_t,on_clear), NULL, "" }, { "on-commit", PW_TYPE_STRING_PTR, offsetof(rlm_sqlippool_t,on_commit), NULL, "COMMIT" }, { "on-rollback", PW_TYPE_STRING_PTR, offsetof(rlm_sqlippool_t,on_rollback), NULL, "ROLLBACK" }, { "off-begin", PW_TYPE_STRING_PTR, offsetof(rlm_sqlippool_t,off_begin), NULL, "START TRANSACTION" }, { "off-clear", PW_TYPE_STRING_PTR, offsetof(rlm_sqlippool_t,off_clear), NULL, "" }, { "off-commit", PW_TYPE_STRING_PTR, offsetof(rlm_sqlippool_t,off_commit), NULL, "COMMIT" }, { "off-rollback", PW_TYPE_STRING_PTR, offsetof(rlm_sqlippool_t,off_rollback), NULL, "ROLLBACK" }, { "sqlippool_log_exists", PW_TYPE_STRING_PTR, offsetof(rlm_sqlippool_t, log_exists), NULL, "" }, { "sqlippool_log_success", PW_TYPE_STRING_PTR, offsetof(rlm_sqlippool_t, log_success), NULL, "" }, { "sqlippool_log_clear", PW_TYPE_STRING_PTR, offsetof(rlm_sqlippool_t, log_clear), NULL, "" }, { "sqlippool_log_failed", PW_TYPE_STRING_PTR, offsetof(rlm_sqlippool_t, log_failed), NULL, "" }, { "sqlippool_log_nopool", PW_TYPE_STRING_PTR, offsetof(rlm_sqlippool_t, log_nopool), NULL, "" }, { "defaultpool", PW_TYPE_STRING_PTR, offsetof(rlm_sqlippool_t, defaultpool), NULL, "main_pool" }, { NULL, -1, 0, NULL, NULL } }; /* * Replace % in a string. * * %P pool_name * %I param * %J lease_duration * */ static int sqlippool_expand(char * out, int outlen, const char * fmt, rlm_sqlippool_t *data, char * param, int param_len) { char *q; const char *p; char tmp[40]; /* For temporary storing of integers */ q = out; for (p = fmt; *p ; p++) { int freespace; int c; /* Calculate freespace in output */ freespace = outlen - (q - out); if (freespace <= 1) break; c = *p; if (c != '%' && c != '$' && c != '\\') { *q++ = *p; continue; } if (*++p == '\0') break; if (c == '\\') { switch(*p) { case '\\': *q++ = '\\'; break; case 't': *q++ = '\t'; break; case 'n': *q++ = '\n'; break; default: *q++ = c; *q++ = *p; break; } } else if (c == '%') { switch(*p) { case '%': *q++ = *p; break; case 'P': /* pool name */ strlcpy(q, data->pool_name, freespace); q += strlen(q); break; case 'I': /* IP address */ if (param && param_len > 0) { if (param_len > freespace) { strlcpy(q, param, freespace); q += strlen(q); } else { memcpy(q, param, param_len); q += param_len; } } break; case 'J': /* lease duration */ sprintf(tmp, "%d", data->lease_duration); strlcpy(q, tmp, freespace); q += strlen(q); break; default: *q++ = '%'; *q++ = *p; break; } } } *q = '\0'; #if 0 DEBUG2("sqlippool_expand: '%s'", out); #endif return strlen(out); } /* * Query the database executing a command with no result rows */ static int sqlippool_command(const char * fmt, SQLSOCK * sqlsocket, rlm_sqlippool_t *data, REQUEST * request, char * param, int param_len) { char expansion[MAX_QUERY_LEN]; char query[MAX_QUERY_LEN]; sqlippool_expand(expansion, sizeof(expansion), fmt, data, param, param_len); /* * Do an xlat on the provided string */ if (request) { if (!radius_xlat(query, sizeof(query), expansion, request, data->sql_inst->sql_escape_func)) { radlog(L_ERR, "sqlippool_command: xlat failed on: '%s'", query); return 0; } } else { strcpy(query, expansion); } #if 0 DEBUG2("sqlippool_command: '%s'", query); #endif if (data->sql_inst->sql_query(sqlsocket, data->sql_inst, query)){ radlog(L_ERR, "sqlippool_command: database query error in: '%s'", query); return 0; } (data->sql_inst->module->sql_finish_query)(sqlsocket, data->sql_inst->config); return 0; } /* * Query the database expecting a single result row */ static int sqlippool_query1(char * out, int outlen, const char * fmt, SQLSOCK * sqlsocket, rlm_sqlippool_t *data, REQUEST * request, char * param, int param_len) { char expansion[MAX_QUERY_LEN]; char query[MAX_QUERY_LEN]; int rlen, retval = 0; sqlippool_expand(expansion, sizeof(expansion), fmt, data, param, param_len); /* * Do an xlat on the provided string */ if (request) { if (!radius_xlat(query, sizeof(query), expansion, request, data->sql_inst->sql_escape_func)) { radlog(L_ERR, "sqlippool_command: xlat failed."); out[0] = '\0'; return 0; } } else { strcpy(query, expansion); } if (data->sql_inst->sql_select_query(sqlsocket, data->sql_inst, query)){ radlog(L_ERR, "sqlippool_query1: database query error"); out[0] = '\0'; return 0; } out[0] = '\0'; if (!data->sql_inst->sql_fetch_row(sqlsocket, data->sql_inst)) { if (sqlsocket->row) { if (sqlsocket->row[0]) { if ((rlen = strlen(sqlsocket->row[0])) < outlen) { strcpy(out, sqlsocket->row[0]); retval = rlen; } else { RDEBUG("insufficient string space"); } } else { RDEBUG("row[0] returned NULL"); } } else { RDEBUG("SQL query did not return any results"); } } else { RDEBUG("SQL query did not succeed"); } (data->sql_inst->module->sql_finish_select_query)(sqlsocket, data->sql_inst->config); return retval; } static int sqlippool_detach(void *instance) { free(instance); return 0; } #define IS_EMPTY(_x) (!_x ||!*_x) /* * Do any per-module initialization that is separate to each * configured instance of the module. e.g. set up connections * to external databases, read configuration files, set up * dictionary entries, etc. * * If configuration information is given in the config section * that must be referenced in later calls, store a handle to it * in *instance otherwise put a null pointer there. */ static int sqlippool_instantiate(CONF_SECTION * conf, void ** instance) { module_instance_t *modinst; rlm_sqlippool_t * data; const char * pool_name = NULL; /* * Set up a storage area for instance data */ data = rad_malloc(sizeof(*data)); memset(data, 0, sizeof(*data)); /* * If the configuration parameters can't be parsed, then * fail. */ if (cf_section_parse(conf, data, module_config) < 0) { free(data); return -1; } if (IS_EMPTY(data->sql_instance_name)) { radlog(L_ERR, "rlm_sqlippool: the 'sql-instance-name' variable must be set."); sqlippool_detach(data); return -1; } /* * Check that all the queries are in place */ if (IS_EMPTY(data->allocate_clear)) { radlog(L_ERR, "rlm_sqlippool: the 'allocate-clear' statement must be set."); sqlippool_detach(data); return -1; } if (IS_EMPTY(data->allocate_find)) { radlog(L_ERR, "rlm_sqlippool: the 'allocate-find' statement must be set."); sqlippool_detach(data); return -1; } if (IS_EMPTY(data->allocate_update)) { radlog(L_ERR, "rlm_sqlippool: the 'allocate-update' statement must be set."); sqlippool_detach(data); return -1; } if (IS_EMPTY(data->start_update)) { radlog(L_ERR, "rlm_sqlippool: the 'start-update' statement must be set."); sqlippool_detach(data); return -1; } if (IS_EMPTY(data->alive_update)) { radlog(L_ERR, "rlm_sqlippool: the 'alive-update' statement must be set."); sqlippool_detach(data); return -1; } if (IS_EMPTY(data->stop_clear)) { radlog(L_ERR, "rlm_sqlippool: the 'stop-clear' statement must be set."); sqlippool_detach(data); return -1; } if (IS_EMPTY(data->on_clear)) { radlog(L_ERR, "rlm_sqlippool: the 'on-clear' statement must be set."); sqlippool_detach(data); return -1; } if (IS_EMPTY(data->off_clear)) { radlog(L_ERR, "rlm_sqlippool: the 'off-clear' statement must be set."); sqlippool_detach(data); return -1; } pool_name = cf_section_name2(conf); if (pool_name != NULL) data->pool_name = strdup(pool_name); else data->pool_name = strdup("ippool"); modinst = find_module_instance(cf_section_find("modules"), data->sql_instance_name, 1); if (!modinst) { radlog(L_ERR, "sqlippool_instantiate: failed to find sql instance named %s", data->sql_instance_name); sqlippool_detach(data); return -1; } if (strcmp(modinst->entry->name, "rlm_sql") != 0) { radlog(L_ERR, "sqlippool_instantiate: Module \"%s\"" " is not an instance of the rlm_sql module", data->sql_instance_name); sqlippool_detach(data); return -1; } data->sql_inst = (SQL_INST *) modinst->insthandle; *instance = data; return 0; } /* * if we have something to log, then we log it * otherwise we return the retcode as soon as possible */ static int do_logging(char *str, int retcode) { if (str && (*str != '\0')) radlog(L_INFO,"%s", str); return retcode; } /* * Allocate an IP number from the pool. */ static int sqlippool_postauth(void *instance, REQUEST * request) { rlm_sqlippool_t * data = (rlm_sqlippool_t *) instance; char allocation[MAX_STRING_LEN]; int allocation_len; uint32_t ip_allocation; VALUE_PAIR * vp; SQLSOCK * sqlsocket; fr_ipaddr_t ipaddr; time_t now; char logstr[MAX_STRING_LEN]; char sqlusername[MAX_STRING_LEN]; /* * If there is a Framed-IP-Address attribute in the reply do nothing */ if (pairfind(request->reply->vps, PW_FRAMED_IP_ADDRESS) != NULL) { /* We already have a Framed-IP-Address */ radius_xlat(logstr, sizeof(logstr), data->log_exists, request, NULL); RDEBUG("Framed-IP-Address already exists"); return do_logging(logstr, RLM_MODULE_NOOP); } if (pairfind(request->config_items, PW_POOL_NAME) == NULL) { RDEBUG("No Pool-Name defined."); radius_xlat(logstr, sizeof(logstr), data->log_nopool, request, NULL); return do_logging(logstr, RLM_MODULE_NOOP); } sqlsocket = data->sql_inst->sql_get_socket(data->sql_inst); if (sqlsocket == NULL) { RDEBUG("cannot allocate sql connection"); return RLM_MODULE_FAIL; } if (data->sql_inst->sql_set_user(data->sql_inst, request, sqlusername, NULL) < 0) { return RLM_MODULE_FAIL; } /* * Limit the number of clears we do. There are minor * race conditions for the check, but so what. The * actual work is protected by a transaction. The idea * here is that if we're allocating 100 IPs a second, * we're only do 1 CLEAR per second. */ now = time(NULL); if (data->last_clear < now) { data->last_clear = now; /* * BEGIN */ sqlippool_command(data->allocate_begin, sqlsocket, data, request, (char *) NULL, 0); /* * CLEAR */ sqlippool_command(data->allocate_clear, sqlsocket, data, request, (char *) NULL, 0); /* * COMMIT */ sqlippool_command(data->allocate_commit, sqlsocket, data, request, (char *) NULL, 0); } /* * BEGIN */ sqlippool_command(data->allocate_begin, sqlsocket, data, request, (char *) NULL, 0); /* * FIND */ allocation_len = sqlippool_query1(allocation, sizeof(allocation), data->allocate_find, sqlsocket, data, request, (char *) NULL, 0); /* * Nothing found... */ if (allocation_len == 0) { /* * COMMIT */ sqlippool_command(data->allocate_commit, sqlsocket, instance, request, (char *) NULL, 0); /* * Should we perform pool-check ? */ if (data->pool_check && *data->pool_check) { /* * Ok, so the allocate-find query found nothing ... * Let's check if the pool exists at all */ allocation_len = sqlippool_query1(allocation, sizeof(allocation), data->pool_check, sqlsocket, data, request, (char *) NULL, 0); data->sql_inst->sql_release_socket(data->sql_inst, sqlsocket); if (allocation_len) { /* * Pool exists after all... So, * the failure to allocate the IP * address was most likely due to * the depletion of the pool. In * that case, we should return * NOTFOUND */ RDEBUG("pool appears to be full"); radius_xlat(logstr, sizeof(logstr), data->log_failed, request, NULL); return do_logging(logstr, RLM_MODULE_NOTFOUND); } /* * Pool doesn't exist in the table. It * may be handled by some other instance of * sqlippool, so we should just ignore this * allocation failure and return NOOP */ RDEBUG("IP address could not be allocated as no pool exists with that name."); return RLM_MODULE_NOOP; } data->sql_inst->sql_release_socket(data->sql_inst, sqlsocket); RDEBUG("IP address could not be allocated."); radius_xlat(logstr, sizeof(logstr), data->log_failed, request, NULL); return do_logging(logstr, RLM_MODULE_NOOP); } /* * FIXME: Make it work with the ipv6 addresses */ if ((ip_hton(allocation, AF_INET, &ipaddr) < 0) || ((ip_allocation = ipaddr.ipaddr.ip4addr.s_addr) == INADDR_NONE)) { /* * COMMIT */ sqlippool_command(data->allocate_commit, sqlsocket, instance, request, (char *) NULL, 0); RDEBUG("Invalid IP number [%s] returned from database query.", allocation); data->sql_inst->sql_release_socket(data->sql_inst, sqlsocket); radius_xlat(logstr, sizeof(logstr), data->log_failed, request, NULL); return do_logging(logstr, RLM_MODULE_NOOP); } /* * UPDATE */ sqlippool_command(data->allocate_update, sqlsocket, data, request, allocation, allocation_len); RDEBUG("Allocated IP %s [%08x]", allocation, ip_allocation); vp = radius_paircreate(request, &request->reply->vps, PW_FRAMED_IP_ADDRESS, PW_TYPE_IPADDR); vp->vp_ipaddr = ip_allocation; /* * COMMIT */ sqlippool_command(data->allocate_commit, sqlsocket, data, request, (char *) NULL, 0); data->sql_inst->sql_release_socket(data->sql_inst, sqlsocket); radius_xlat(logstr, sizeof(logstr), data->log_success, request, NULL); return do_logging(logstr, RLM_MODULE_OK); } static int sqlippool_accounting_start(SQLSOCK * sqlsocket, rlm_sqlippool_t *data, REQUEST *request) { /* * BEGIN */ sqlippool_command(data->start_begin, sqlsocket, data, request, (char *) NULL, 0); /* * UPDATE */ sqlippool_command(data->start_update, sqlsocket, data, request, (char *) NULL, 0); /* * COMMIT */ sqlippool_command(data->start_commit, sqlsocket, data, request, (char *) NULL, 0); return RLM_MODULE_OK; } static int sqlippool_accounting_alive(SQLSOCK * sqlsocket, rlm_sqlippool_t *data, REQUEST *request) { /* * BEGIN */ sqlippool_command(data->alive_begin, sqlsocket, data, request, (char *) NULL, 0); /* * UPDATE */ sqlippool_command(data->alive_update, sqlsocket, data, request, (char *) NULL, 0); /* * COMMIT */ sqlippool_command(data->alive_commit, sqlsocket, data, request, (char *) NULL, 0); return RLM_MODULE_OK; } static int sqlippool_accounting_stop(SQLSOCK * sqlsocket, rlm_sqlippool_t *data, REQUEST *request) { char logstr[MAX_STRING_LEN]; /* * BEGIN */ sqlippool_command(data->stop_begin, sqlsocket, data, request, (char *) NULL, 0); /* * CLEAR */ sqlippool_command(data->stop_clear, sqlsocket, data, request, (char *) NULL, 0); /* * COMMIT */ sqlippool_command(data->stop_commit, sqlsocket, data, request, (char *) NULL, 0); radius_xlat(logstr, sizeof(logstr), data->log_clear, request, NULL); return do_logging(logstr, RLM_MODULE_OK); } static int sqlippool_accounting_on(SQLSOCK * sqlsocket, rlm_sqlippool_t *data, REQUEST *request) { /* * BEGIN */ sqlippool_command(data->on_begin, sqlsocket, data, request, (char *) NULL, 0); /* * CLEAR */ sqlippool_command(data->on_clear, sqlsocket, data, request, (char *) NULL, 0); /* * COMMIT */ sqlippool_command(data->on_commit, sqlsocket, data, request, (char *) NULL, 0); return RLM_MODULE_OK; } static int sqlippool_accounting_off(SQLSOCK * sqlsocket, rlm_sqlippool_t *data, REQUEST *request) { /* * BEGIN */ sqlippool_command(data->off_begin, sqlsocket, data, request, (char *) NULL, 0); /* * CLEAR */ sqlippool_command(data->off_clear, sqlsocket, data, request, (char *) NULL, 0); /* * COMMIT */ sqlippool_command(data->off_commit, sqlsocket, data, request, (char *) NULL, 0); return RLM_MODULE_OK; } /* * Check for an Accounting-Stop * If we find one and we have allocated an IP to this nas/port * combination, then deallocate it. */ static int sqlippool_accounting(void * instance, REQUEST * request) { int rcode; VALUE_PAIR * vp; int acct_status_type; rlm_sqlippool_t * data = (rlm_sqlippool_t *) instance; SQLSOCK * sqlsocket; char sqlusername[MAX_STRING_LEN]; vp = pairfind(request->packet->vps, PW_ACCT_STATUS_TYPE); if (!vp) { RDEBUG("Could not find account status type in packet."); return RLM_MODULE_NOOP; } acct_status_type = vp->vp_integer; switch (acct_status_type) { case PW_STATUS_START: case PW_STATUS_ALIVE: case PW_STATUS_STOP: case PW_STATUS_ACCOUNTING_ON: case PW_STATUS_ACCOUNTING_OFF: break; /* continue through to the next section */ default: /* We don't care about any other accounting packet */ return RLM_MODULE_NOOP; } sqlsocket = data->sql_inst->sql_get_socket(data->sql_inst); if (sqlsocket == NULL) { RDEBUG("cannot allocate sql connection"); return RLM_MODULE_NOOP; } if (data->sql_inst->sql_set_user(data->sql_inst, request, sqlusername, NULL) < 0) { return RLM_MODULE_FAIL; } switch (acct_status_type) { case PW_STATUS_START: rcode = sqlippool_accounting_start(sqlsocket, data, request); break; case PW_STATUS_ALIVE: rcode = sqlippool_accounting_alive(sqlsocket, data, request); break; case PW_STATUS_STOP: rcode = sqlippool_accounting_stop(sqlsocket, data, request); break; case PW_STATUS_ACCOUNTING_ON: rcode = sqlippool_accounting_on(sqlsocket, data, request); break; case PW_STATUS_ACCOUNTING_OFF: rcode = sqlippool_accounting_off(sqlsocket, data, request); break; default: /* We don't care about any other accounting packet */ return RLM_MODULE_NOOP; } data->sql_inst->sql_release_socket(data->sql_inst, sqlsocket); return rcode; } /* * The module name should be the only globally exported symbol. * That is, everything else should be 'static'. * * If the module needs to temporarily modify it's instantiation * data, the type should be changed to RLM_TYPE_THREAD_UNSAFE. * The server will then take care of ensuring that the module * is single-threaded. */ module_t rlm_sqlippool = { RLM_MODULE_INIT, "SQL IP Pool", RLM_TYPE_THREAD_SAFE, /* type */ sqlippool_instantiate, /* instantiation */ sqlippool_detach, /* detach */ { NULL, /* authentication */ NULL, /* authorization */ NULL, /* preaccounting */ sqlippool_accounting, /* accounting */ NULL, /* checksimul */ NULL, /* pre-proxy */ NULL, /* post-proxy */ sqlippool_postauth /* post-auth */ }, }; freeradius-server/src/modules/rlm_unix/000077500000000000000000000000001257552170400206175ustar00rootroot00000000000000freeradius-server/src/modules/rlm_unix/.gitignore000066400000000000000000000000221257552170400226010ustar00rootroot00000000000000Makefile config.h freeradius-server/src/modules/rlm_unix/Makefile.in000066400000000000000000000002601257552170400226620ustar00rootroot00000000000000# # $Id$ # TARGET = @targetname@ SRCS = rlm_unix.c HEADERS = RLM_LIBS = @unix_ldflags@ RLM_CFLAGS = @unix_cflags@ include ../rules.mak $(LT_OBJS): $(HEADERS) freeradius-server/src/modules/rlm_unix/config.h.in000066400000000000000000000032111257552170400226370ustar00rootroot00000000000000/* config.h.in. Generated from configure.in by autoheader. */ /* Define to 1 if you have the `getspnam' function. */ #undef HAVE_GETSPNAM /* Define to 1 if you have the `getusershell' function. */ #undef HAVE_GETUSERSHELL /* Define to 1 if you have the header file. */ #undef HAVE_GRP_H /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Define to 1 if you have the header file. */ #undef HAVE_PWD_H /* Define to 1 if you have the header file. */ #undef HAVE_SHADOW_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 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_UNISTD_H /* 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 version of this package. */ #undef PACKAGE_VERSION /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS freeradius-server/src/modules/rlm_unix/configure000077500000000000000000004004471257552170400225370ustar00rootroot00000000000000#! /bin/sh # From configure.in Revision. # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.61. # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, # 2002, 2003, 2004, 2005, 2006 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=: # 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 # PATH needs CR # 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 # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false 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.) as_nl=' ' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. 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 # Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # CDPATH. $as_unset CDPATH if test "x$CONFIG_SHELL" = x; then if (eval ":") 2>/dev/null; then as_have_required=yes else as_have_required=no fi if test $as_have_required = yes && (eval ": (as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=\$LINENO as_lineno_2=\$LINENO test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } ") 2> /dev/null; then : else as_candidate_shells= as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. case $as_dir in /*) for as_base in sh bash ksh sh5; do as_candidate_shells="$as_candidate_shells $as_dir/$as_base" done;; esac done IFS=$as_save_IFS for as_shell in $as_candidate_shells $SHELL; do # Try only shells that exist, to save several forks. if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { ("$as_shell") 2> /dev/null <<\_ASEOF 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 : _ASEOF }; then CONFIG_SHELL=$as_shell as_have_required=yes if { "$as_shell" 2> /dev/null <<\_ASEOF 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 : (as_func_return () { (exit $1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = "$1" ); then : else exitcode=1 echo positional parameters were not saved. fi test $exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } _ASEOF }; then break fi fi done if test "x$CONFIG_SHELL" != x; then for as_var in BASH_ENV ENV do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done export CONFIG_SHELL exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} fi if test $as_have_required = no; then echo This script requires a shell more modern than all the echo shells that I found on your system. Please install a echo modern shell, or manually run the script under such a echo shell if you do have one. { (exit 1); exit 1; } fi fi fi (eval "as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0") || { echo No shell found that supports shell functions. echo Please tell autoconf@gnu.org about your system, echo including any error possibly output before this echo message } as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, and appends # trailing '-' during substitution so that $LINENO is not a special # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # scripts with optimization help from Paolo Bonzini. 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" || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi 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 fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi 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=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, 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= SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME= PACKAGE_TARNAME= PACKAGE_VERSION= PACKAGE_STRING= PACKAGE_BUGREPORT= ac_unique_file="rlm_unix.c" # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef STDC_HEADERS # include # include #else # ifdef HAVE_STDLIB_H # include # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datarootdir datadir sysconfdir sharedstatedir localstatedir includedir oldincludedir docdir infodir htmldir dvidir pdfdir psdir libdir localedir mandir DEFS ECHO_C ECHO_N ECHO_T LIBS build_alias host_alias target_alias CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP GREP EGREP unix_ldflags unix_cflags targetname LIBOBJS LTLIBOBJS' ac_subst_files='' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CPP' # Initialize some variables set by options. ac_init_help= ac_init_version=false # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *) ac_optarg=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_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` eval enable_$ac_feature=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_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` eval enable_$ac_feature=\$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_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/[-.]/_/g'` eval with_$ac_package=\$ac_optarg ;; -without-* | --without-*) ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/[-.]/_/g'` eval with_$ac_package=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 ;; -*) { echo "$as_me: error: unrecognized option: $ac_option Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && 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'` { echo "$as_me: error: missing argument to $ac_option" >&2 { (exit 1); exit 1; }; } fi # Be sure to have absolute directory names. 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 case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; } 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 echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || { echo "$as_me: error: Working directory cannot be determined" >&2 { (exit 1); exit 1; }; } test "X$ac_ls_di" = "X$ac_pwd_ls_di" || { echo "$as_me: error: pwd does not report name of working directory" >&2 { (exit 1); exit 1; }; } # 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 -- "$0" || $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$0" : 'X\(//\)[^/]' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X"$0" | 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 .." { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2 { (exit 1); exit 1; }; } pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures this package to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF _ACEOF fi if test -n "$ac_init_help"; then cat <<\_ACEOF 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 C/C++/Objective C preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. _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" || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`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 echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF configure generated by GNU Autoconf 2.61 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 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 cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by $as_me, which was generated by GNU Autoconf 2.61. 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=. 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=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; 2) ac_configure_args1="$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 ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac done done $as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } $as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export 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 cat <<\_ASBOX ## ---------------- ## ## Cache variables. ## ## ---------------- ## _ASBOX 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_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( *) $as_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 cat <<\_ASBOX ## ----------------- ## ## Output variables. ## ## ----------------- ## _ASBOX echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then cat <<\_ASBOX ## ------------------- ## ## File substitutions. ## ## ------------------- ## _ASBOX echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then cat <<\_ASBOX ## ----------- ## ## confdefs.h. ## ## ----------- ## _ASBOX echo cat confdefs.h echo fi test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" 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'; { (exit 1); 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 # 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 # Let the site file select an alternate cache file if it wants to. # Prefer explicitly selected file to automatically selected ones. if test -n "$CONFIG_SITE"; then set x "$CONFIG_SITE" elif test "x$prefix" != xNONE; then set x "$prefix/share/config.site" "$prefix/etc/config.site" else set x "$ac_default_prefix/share/config.site" \ "$ac_default_prefix/etc/config.site" fi shift for ac_site_file do if test -r "$ac_site_file"; then { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" 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. if test -f "$cache_file"; then { echo "$as_me:$LINENO: loading cache $cache_file" >&5 echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { echo "$as_me:$LINENO: creating cache $cache_file" >&5 echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 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 { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 echo "$as_me: former value: $ac_old_val" >&2;} { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 echo "$as_me: current value: $ac_new_val" >&2;} ac_cache_corrupted=: fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`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. *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 echo "$as_me: error: changes in the environment can compromise the build" >&2;} { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} { (exit 1); exit 1; }; } 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 x$with_rlm_unix != xno; then 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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}gcc" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="gcc" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}cc" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="$ac_prog" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&5 echo "$as_me: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } # Provide some information about the compiler. echo "$as_me:$LINENO: checking for C compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (ac_try="$ac_compiler --version >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -v >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -V >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out 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. { echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6; } ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # # List of possible output files, starting from the most likely. # The algorithm is not robust to junk in `.', hence go to wildcards (a.*) # only as a last resort. b.out is created by i960 compilers. ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out' # # The IRIX 6 linker writes into existing files which may not be # executable, retaining their permissions. Remove them first so a # subsequent execution test works. ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link_default") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; 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 | *.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 { echo "$as_me:$LINENO: result: $ac_file" >&5 echo "${ECHO_T}$ac_file" >&6; } if test -z "$ac_file"; then echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: C compiler cannot create executables See \`config.log' for more details." >&5 echo "$as_me: error: C compiler cannot create executables See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } fi ac_exeext=$ac_cv_exeext # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { echo "$as_me:$LINENO: checking whether the C compiler works" >&5 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6; } # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then if { ac_try='./$ac_file' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { echo "$as_me:$LINENO: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&5 echo "$as_me: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi fi fi { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } rm -f a.out a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; } { echo "$as_me:$LINENO: result: $cross_compiling" >&5 echo "${ECHO_T}$cross_compiling" >&6; } { echo "$as_me:$LINENO: checking for suffix of executables" >&5 echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; } if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; 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 | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest$ac_cv_exeext { echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 echo "${ECHO_T}$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT { echo "$as_me:$LINENO: checking for suffix of object files" >&5 echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; } if test "${ac_cv_objext+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; 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 ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 echo "${ECHO_T}$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; } if test "${ac_cv_c_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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 { echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; } GCC=`test $ac_compiler_gnu = yes && echo yes` ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CFLAGS="" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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 { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 echo "${ECHO_T}$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 { echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_c89+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_c89=$ac_arg else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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) { echo "$as_me:$LINENO: result: none needed" >&5 echo "${ECHO_T}none needed" >&6; } ;; xno) { echo "$as_me:$LINENO: result: unsupported" >&5 echo "${ECHO_T}unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;; 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 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 { echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if test "${ac_cv_prog_CPP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f 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 { echo "$as_me:$LINENO: result: $CPP" >&5 echo "${ECHO_T}$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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&5 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } 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 { echo "$as_me:$LINENO: checking for system password file" >&5 echo $ECHO_N "checking for system password file... $ECHO_C" >&6; } if test -f /etc/passwd; then { echo "$as_me:$LINENO: result: /etc/passwd" >&5 echo "${ECHO_T}/etc/passwd" >&6; } else { echo "$as_me:$LINENO: result: no /etc/passwd file." >&5 echo "${ECHO_T}no /etc/passwd file." >&6; } fail=$fail" /etc/passwd" fi { echo "$as_me:$LINENO: checking for system shadow password file" >&5 echo $ECHO_N "checking for system shadow password file... $ECHO_C" >&6; } if test -f /etc/shadow; then { echo "$as_me:$LINENO: result: /etc/shadow" >&5 echo "${ECHO_T}/etc/shadow" >&6; } else { echo "$as_me:$LINENO: result: no /etc/shadow file." >&5 echo "${ECHO_T}no /etc/shadow file." >&6; } fi { echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5 echo $ECHO_N "checking for grep that handles long lines and -e... $ECHO_C" >&6; } if test "${ac_cv_path_GREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Extract the first word of "grep ggrep" to use in msg output if test -z "$GREP"; then set dummy grep ggrep; ac_prog_name=$2 if test "${ac_cv_path_GREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" 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 ac_count=`expr $ac_count + 1` 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 fi GREP="$ac_cv_path_GREP" if test -z "$GREP"; then { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} { (exit 1); exit 1; }; } fi else ac_cv_path_GREP=$GREP fi fi { echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5 echo "${ECHO_T}$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { echo "$as_me:$LINENO: checking for egrep" >&5 echo $ECHO_N "checking for egrep... $ECHO_C" >&6; } if test "${ac_cv_path_EGREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else # Extract the first word of "egrep" to use in msg output if test -z "$EGREP"; then set dummy egrep; ac_prog_name=$2 if test "${ac_cv_path_EGREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" 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 ac_count=`expr $ac_count + 1` 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 fi EGREP="$ac_cv_path_EGREP" if test -z "$EGREP"; then { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} { (exit 1); exit 1; }; } fi else ac_cv_path_EGREP=$EGREP fi fi fi { echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 echo "${ECHO_T}$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" { echo "$as_me:$LINENO: checking for ANSI C header files" >&5 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; } if test "${ac_cv_header_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_header_stdc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* 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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* 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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* 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 rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi { echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 echo "${ECHO_T}$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then cat >>confdefs.h <<\_ACEOF #define STDC_HEADERS 1 _ACEOF 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=`echo "ac_cv_header_$ac_header" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Header=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in shadow.h pwd.h grp.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? { echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ;; esac { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_func in getspnam getusershell getpwnam do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* 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 $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$ac_func || defined __stub___$ac_func choke me #endif int main () { return $ac_func (); ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_var'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done if test "$ac_cv_func_getpwnam" != "yes"; then { echo "$as_me:$LINENO: result: no getpwnam" >&5 echo "${ECHO_T}no getpwnam" >&6; } fail=$fail" getpwnam" fi if test "$ac_cv_header_pwd_h" != "yes"; then { echo "$as_me:$LINENO: result: no pwd.h" >&5 echo "${ECHO_T}no pwd.h" >&6; } fail=$fail" pwd.h" fi { echo "$as_me:$LINENO: checking for getspnam in -lshadow" >&5 echo $ECHO_N "checking for getspnam in -lshadow... $ECHO_C" >&6; } if test "${ac_cv_lib_shadow_getspnam+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lshadow $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any 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 getspnam (); int main () { return getspnam (); ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_shadow_getspnam=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_shadow_getspnam=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_shadow_getspnam" >&5 echo "${ECHO_T}$ac_cv_lib_shadow_getspnam" >&6; } if test $ac_cv_lib_shadow_getspnam = yes; then unix_ldflags="${unix_ldflags} -lshadow" cat >>confdefs.h <<\_ACEOF #define HAVE_GETSPNAM 1 _ACEOF fi targetname=rlm_unix else targetname= echo \*\*\* module rlm_unix is disabled. fi if test x"$fail" != x""; then if test x"${enable_strict_dependencies}" = x"yes"; then { { echo "$as_me:$LINENO: error: set --without-rlm_unix to disable it explicitly." >&5 echo "$as_me: error: set --without-rlm_unix to disable it explicitly." >&2;} { (exit 1); exit 1; }; } else { echo "$as_me:$LINENO: WARNING: silently not building rlm_unix." >&5 echo "$as_me: WARNING: silently not building rlm_unix." >&2;} { echo "$as_me:$LINENO: WARNING: FAILURE: rlm_unix requires: $fail." >&5 echo "$as_me: WARNING: FAILURE: rlm_unix requires: $fail." >&2;}; targetname="" fi fi ac_config_headers="$ac_config_headers config.h" unset ac_cv_env_LIBS_set unset ac_cv_env_LIBS_value ac_config_files="$ac_config_files 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_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( *) $as_unset $ac_var ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then test "x$cache_file" != "x/dev/null" && { echo "$as_me:$LINENO: updating cache $cache_file" >&5 echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 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= 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=`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. ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs : ${CONFIG_STATUS=./config.status} ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >$CONFIG_STATUS <<_ACEOF #! $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} _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ## --------------------- ## ## 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=: # 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 # PATH needs CR # 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 # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false 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.) as_nl=' ' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. 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 # Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # CDPATH. $as_unset CDPATH as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, and appends # trailing '-' during substitution so that $LINENO is not a special # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # scripts with optimization help from Paolo Bonzini. 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" || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi 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 fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi 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=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 # Save the log message, to keep $[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by $as_me, which was generated by GNU Autoconf 2.61. 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 cat >>$CONFIG_STATUS <<_ACEOF # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ config.status configured by $0, generated by GNU Autoconf 2.61, with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" Copyright (C) 2006 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' _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # If no file are specified by the user, then we need to provide default # value. By we need to know if files were specified by the user. 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=$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 ) echo "$ac_cs_version"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift CONFIG_FILES="$CONFIG_FILES $ac_optarg" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header { echo "$as_me: error: ambiguous option: $1 Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; };; --help | --hel | -h ) 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. -*) { echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *) ac_config_targets="$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 if \$ac_cs_recheck; then echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 CONFIG_SHELL=$SHELL export CONFIG_SHELL exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # 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" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= trap 'exit_status=$? { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status ' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || { echo "$me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } # # Set up the sed scripts for CONFIG_FILES section. # # No need to generate the scripts if there are no CONFIG_FILES. # This happens for instance when ./config.status config.h if test -n "$CONFIG_FILES"; then _ACEOF ac_delim='%!_!# ' for ac_last_try in false false false false false :; do cat >conf$$subs.sed <<_ACEOF SHELL!$SHELL$ac_delim PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim PACKAGE_NAME!$PACKAGE_NAME$ac_delim PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim PACKAGE_STRING!$PACKAGE_STRING$ac_delim PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim exec_prefix!$exec_prefix$ac_delim prefix!$prefix$ac_delim program_transform_name!$program_transform_name$ac_delim bindir!$bindir$ac_delim sbindir!$sbindir$ac_delim libexecdir!$libexecdir$ac_delim datarootdir!$datarootdir$ac_delim datadir!$datadir$ac_delim sysconfdir!$sysconfdir$ac_delim sharedstatedir!$sharedstatedir$ac_delim localstatedir!$localstatedir$ac_delim includedir!$includedir$ac_delim oldincludedir!$oldincludedir$ac_delim docdir!$docdir$ac_delim infodir!$infodir$ac_delim htmldir!$htmldir$ac_delim dvidir!$dvidir$ac_delim pdfdir!$pdfdir$ac_delim psdir!$psdir$ac_delim libdir!$libdir$ac_delim localedir!$localedir$ac_delim mandir!$mandir$ac_delim DEFS!$DEFS$ac_delim ECHO_C!$ECHO_C$ac_delim ECHO_N!$ECHO_N$ac_delim ECHO_T!$ECHO_T$ac_delim LIBS!$LIBS$ac_delim build_alias!$build_alias$ac_delim host_alias!$host_alias$ac_delim target_alias!$target_alias$ac_delim CC!$CC$ac_delim CFLAGS!$CFLAGS$ac_delim LDFLAGS!$LDFLAGS$ac_delim CPPFLAGS!$CPPFLAGS$ac_delim ac_ct_CC!$ac_ct_CC$ac_delim EXEEXT!$EXEEXT$ac_delim OBJEXT!$OBJEXT$ac_delim CPP!$CPP$ac_delim GREP!$GREP$ac_delim EGREP!$EGREP$ac_delim unix_ldflags!$unix_ldflags$ac_delim unix_cflags!$unix_cflags$ac_delim targetname!$targetname$ac_delim LIBOBJS!$LIBOBJS$ac_delim LTLIBOBJS!$LTLIBOBJS$ac_delim _ACEOF if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 52; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` if test -n "$ac_eof"; then ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` ac_eof=`expr $ac_eof + 1` fi cat >>$CONFIG_STATUS <<_ACEOF cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof /@[a-zA-Z_][a-zA-Z_0-9]*@/!b end _ACEOF sed ' s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g s/^/s,@/; s/!/@,|#_!!_#|/ :n t n s/'"$ac_delim"'$/,g/; t s/$/\\/; p N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n ' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF :end s/|#_!!_#|//g CEOF$ac_eof _ACEOF # VPATH may cause trouble with some makes, so we remove $(srcdir), # ${srcdir} and @srcdir@ 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[ ]*=/{ s/:*\$(srcdir):*/:/ s/:*\${srcdir}:*/:/ s/:*@srcdir@:*/:/ s/^\([^=]*=[ ]*\):*/\1/ s/:*$// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF fi # test -n "$CONFIG_FILES" for ac_tag in :F $CONFIG_FILES :H $CONFIG_HEADERS do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5 echo "$as_me: error: Invalid tag $ac_tag." >&2;} { (exit 1); exit 1; }; };; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 echo "$as_me: error: cannot find input file: $ac_f" >&2;} { (exit 1); exit 1; }; };; esac ac_file_inputs="$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 "`IFS=: echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure." if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { echo "$as_me:$LINENO: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} fi case $ac_tag in *:-:* | *:-) cat >"$tmp/stdin";; 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 || 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" case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`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 || 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" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 echo "$as_me: error: cannot create directory $as_dir" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`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 # _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # 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= case `sed -n '/datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p ' $ac_file_inputs` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF 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 sed "$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s&@configure_input@&$configure_input&;t t s&@top_builddir@&$ac_top_builddir_sub&;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 $ac_datarootdir_hack " $ac_file_inputs | sed -f "$tmp/subs-1.sed" >$tmp/out test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&5 echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&2;} rm -f "$tmp/stdin" case $ac_file in -) cat "$tmp/out"; rm -f "$tmp/out";; *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;; esac ;; :H) # # CONFIG_HEADER # _ACEOF # Transform confdefs.h into a sed script `conftest.defines', that # substitutes the proper values into config.h.in to produce config.h. rm -f conftest.defines conftest.tail # First, append a space to every undef/define line, to ease matching. echo 's/$/ /' >conftest.defines # Then, protect against being on the right side of a sed subst, or in # an unquoted here document, in config.status. If some macros were # called several times there might be several #defines for the same # symbol, which is useless. But do not sort them, since the last # AC_DEFINE must be honored. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* # These sed commands are passed to sed as "A NAME B PARAMS C VALUE D", where # NAME is the cpp macro being defined, VALUE is the value it is being given. # PARAMS is the parameter list in the macro definition--in most cases, it's # just an empty string. ac_dA='s,^\\([ #]*\\)[^ ]*\\([ ]*' ac_dB='\\)[ (].*,\\1define\\2' ac_dC=' ' ac_dD=' ,' uniq confdefs.h | sed -n ' t rset :rset s/^[ ]*#[ ]*define[ ][ ]*// t ok d :ok s/[\\&,]/\\&/g s/^\('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/ '"$ac_dA"'\1'"$ac_dB"'\2'"${ac_dC}"'\3'"$ac_dD"'/p s/^\('"$ac_word_re"'\)[ ]*\(.*\)/'"$ac_dA"'\1'"$ac_dB$ac_dC"'\2'"$ac_dD"'/p ' >>conftest.defines # Remove the space that was appended to ease matching. # Then 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. # (The regexp can be short, since the line contains either #define or #undef.) echo 's/ $// s,^[ #]*u.*,/* & */,' >>conftest.defines # Break up conftest.defines: ac_max_sed_lines=50 # First sed command is: sed -f defines.sed $ac_file_inputs >"$tmp/out1" # Second one is: sed -f defines.sed "$tmp/out1" >"$tmp/out2" # Third one will be: sed -f defines.sed "$tmp/out2" >"$tmp/out1" # et cetera. ac_in='$ac_file_inputs' ac_out='"$tmp/out1"' ac_nxt='"$tmp/out2"' while : do # Write a here document: cat >>$CONFIG_STATUS <<_ACEOF # First, check the format of the line: cat >"\$tmp/defines.sed" <<\\CEOF /^[ ]*#[ ]*undef[ ][ ]*$ac_word_re[ ]*\$/b def /^[ ]*#[ ]*define[ ][ ]*$ac_word_re[( ]/b def b :def _ACEOF sed ${ac_max_sed_lines}q conftest.defines >>$CONFIG_STATUS echo 'CEOF sed -f "$tmp/defines.sed"' "$ac_in >$ac_out" >>$CONFIG_STATUS ac_in=$ac_out; ac_out=$ac_nxt; ac_nxt=$ac_in sed 1,${ac_max_sed_lines}d conftest.defines >conftest.tail grep . conftest.tail >/dev/null || break rm -f conftest.defines mv conftest.tail conftest.defines done rm -f conftest.defines conftest.tail echo "ac_result=$ac_in" >>$CONFIG_STATUS cat >>$CONFIG_STATUS <<\_ACEOF if test x"$ac_file" != x-; then echo "/* $configure_input */" >"$tmp/config.h" cat "$ac_result" >>"$tmp/config.h" if diff $ac_file "$tmp/config.h" >/dev/null 2>&1; then { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 echo "$as_me: $ac_file is unchanged" >&6;} else rm -f $ac_file mv "$tmp/config.h" $ac_file fi else echo "/* $configure_input */" cat "$ac_result" fi rm -f "$tmp/out12" ;; esac done # for ac_tag { (exit 0); exit 0; } _ACEOF chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save # 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 || { (exit 1); exit 1; } fi freeradius-server/src/modules/rlm_unix/configure.in000066400000000000000000000026131257552170400231320ustar00rootroot00000000000000AC_PREREQ([2.53]) AC_INIT(rlm_unix.c) AC_REVISION($Revision$) AC_DEFUN(modname,[rlm_unix]) if test x$with_[]modname != xno; then AC_PROG_CC AC_PROG_CPP AC_MSG_CHECKING(for system password file) if test -f /etc/passwd; then AC_MSG_RESULT(/etc/passwd) else AC_MSG_RESULT(no /etc/passwd file.) [ fail=$fail" /etc/passwd" ] fi dnl useless? AC_MSG_CHECKING(for system shadow password file) if test -f /etc/shadow; then AC_MSG_RESULT(/etc/shadow) else AC_MSG_RESULT(no /etc/shadow file.) fi AC_CHECK_HEADERS(shadow.h pwd.h grp.h) AC_CHECK_FUNCS(getspnam getusershell getpwnam) if test "$ac_cv_func_getpwnam" != "yes"; then AC_MSG_RESULT(no getpwnam) [ fail=$fail" getpwnam" ] fi if test "$ac_cv_header_pwd_h" != "yes"; then AC_MSG_RESULT(no pwd.h) [ fail=$fail" pwd.h" ] fi AC_CHECK_LIB(shadow, getspnam, [ unix_ldflags="${unix_ldflags} -lshadow" AC_DEFINE(HAVE_GETSPNAM) ] ) targetname=modname else targetname= echo \*\*\* module modname is disabled. fi if test x"$fail" != x""; then if test x"${enable_strict_dependencies}" = x"yes"; then AC_MSG_ERROR([set --without-]modname[ to disable it explicitly.]) else AC_MSG_WARN([silently not building ]modname[.]) AC_MSG_WARN([FAILURE: ]modname[ requires: $fail.]); targetname="" fi fi AC_SUBST(unix_ldflags) AC_SUBST(unix_cflags) AC_SUBST(targetname) AC_CONFIG_HEADER(config.h) AC_OUTPUT(Makefile) freeradius-server/src/modules/rlm_unix/rlm_unix.c000066400000000000000000000335061257552170400226270ustar00rootroot00000000000000/* * rlm_unix.c authentication: Unix user authentication * accounting: Functions to write radwtmp file. * Also contains handler for "Group". * * Version: $Id$ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * Copyright 2000,2006 The FreeRADIUS server project * Copyright 2000 Jeff Carneal * Copyright 2000 Alan Curry */ #include RCSID("$Id$") #include #include #include #include #include "config.h" #ifdef HAVE_SHADOW_H # include #endif #ifdef OSFC2 # include # include #endif #ifdef OSFSIA # include # include #endif #include #include static char trans[64] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; #define ENC(c) trans[c] struct unix_instance { const char *radwtmp; }; static const CONF_PARSER module_config[] = { { "radwtmp", PW_TYPE_STRING_PTR, offsetof(struct unix_instance,radwtmp), NULL, "NULL" }, { NULL, -1, 0, NULL, NULL } /* end the list */ }; /* * The Group = handler. */ static int groupcmp(void *instance, REQUEST *req, VALUE_PAIR *request, VALUE_PAIR *check, VALUE_PAIR *check_pairs, VALUE_PAIR **reply_pairs) { struct passwd *pwd; struct group *grp; char **member; char *username; int retval; VALUE_PAIR *vp; instance = instance; check_pairs = check_pairs; reply_pairs = reply_pairs; /* * No user name, doesn't compare. */ if (!req->username) { return -1; } pwd = getpwnam(req->username->vp_strvalue); if (pwd == NULL) return -1; grp = getgrnam(check->vp_strvalue); if (grp == NULL) return -1; retval = (pwd->pw_gid == grp->gr_gid) ? 0 : -1; if (retval < 0) { for (member = grp->gr_mem; *member && retval; member++) { if (strcmp(*member, pwd->pw_name) == 0) retval = 0; } } return retval; } /* * Detach. */ static int unix_detach(void *instance) { #define inst ((struct unix_instance *)instance) paircompare_unregister(PW_GROUP, groupcmp); #ifdef PW_GROUP_NAME paircompare_unregister(PW_GROUP_NAME, groupcmp); #endif #undef inst free(instance); return 0; } /* * Read the config */ static int unix_instantiate(CONF_SECTION *conf, void **instance) { struct unix_instance *inst; /* * Allocate room for the instance. */ inst = *instance = rad_malloc(sizeof(*inst)); if (!inst) { return -1; } memset(inst, 0, sizeof(*inst)); /* * Parse the configuration, failing if we can't do so. */ if (cf_section_parse(conf, inst, module_config) < 0) { unix_detach(inst); return -1; } /* FIXME - delay these until a group file has been read so we know * groupcmp can actually do something */ paircompare_register(PW_GROUP, PW_USER_NAME, groupcmp, NULL); #ifdef PW_GROUP_NAME /* compat */ paircompare_register(PW_GROUP_NAME, PW_USER_NAME, groupcmp, NULL); #endif #undef inst return 0; } /* * Pull the users password from where-ever, and add it to * the given vp list. */ static int unix_getpw(UNUSED void *instance, REQUEST *request, VALUE_PAIR **vp_list) { const char *name; const char *encrypted_pass; #ifdef HAVE_GETSPNAM struct spwd *spwd = NULL; #endif #ifdef OSFC2 struct pr_passwd *pr_pw; #else struct passwd *pwd; #endif #ifdef HAVE_GETUSERSHELL char *shell; #endif VALUE_PAIR *vp; /* * We can only authenticate user requests which HAVE * a User-Name attribute. */ if (!request->username) { return RLM_MODULE_NOOP; } name = (char *)request->username->vp_strvalue; encrypted_pass = NULL; #ifdef OSFC2 if ((pr_pw = getprpwnam(name)) == NULL) return RLM_MODULE_NOTFOUND; encrypted_pass = pr_pw->ufld.fd_encrypt; /* * Check if account is locked. */ if (pr_pw->uflg.fg_lock!=1) { radlog(L_AUTH, "rlm_unix: [%s]: account locked", name); return RLM_MODULE_USERLOCK; } #else /* OSFC2 */ if ((pwd = getpwnam(name)) == NULL) { return RLM_MODULE_NOTFOUND; } encrypted_pass = pwd->pw_passwd; #endif /* OSFC2 */ #ifdef HAVE_GETSPNAM /* * See if there is a shadow password. * * Only query the _system_ shadow file if the encrypted * password from the passwd file is < 10 characters (i.e. * a valid password would never crypt() to it). This will * prevents users from using NULL password fields as things * stand right now. */ if ((encrypted_pass == NULL) || (strlen(encrypted_pass) < 10)) { if ((spwd = getspnam(name)) == NULL) { return RLM_MODULE_NOTFOUND; } encrypted_pass = spwd->sp_pwdp; } #endif /* HAVE_GETSPNAM */ /* * These require 'pwd != NULL', which isn't true on OSFC2 */ #ifndef OSFC2 #ifdef DENY_SHELL /* * Users with a particular shell are denied access */ if (strcmp(pwd->pw_shell, DENY_SHELL) == 0) { radlog_request(L_AUTH, 0, request, "rlm_unix: [%s]: invalid shell", name); return RLM_MODULE_REJECT; } #endif #ifdef HAVE_GETUSERSHELL /* * Check /etc/shells for a valid shell. If that file * contains /RADIUSD/ANY/SHELL then any shell will do. */ while ((shell = getusershell()) != NULL) { if (strcmp(shell, pwd->pw_shell) == 0 || strcmp(shell, "/RADIUSD/ANY/SHELL") == 0) { break; } } endusershell(); if (shell == NULL) { radlog_request(L_AUTH, 0, request, "[%s]: invalid shell [%s]", name, pwd->pw_shell); return RLM_MODULE_REJECT; } #endif #endif /* OSFC2 */ #if defined(HAVE_GETSPNAM) && !defined(M_UNIX) /* * Check if password has expired. */ if (spwd && spwd->sp_lstchg > 0 && spwd->sp_max >= 0 && (request->timestamp / 86400) > (spwd->sp_lstchg + spwd->sp_max)) { radlog_request(L_AUTH, 0, request, "[%s]: password has expired", name); return RLM_MODULE_REJECT; } /* * Check if account has expired. */ if (spwd && spwd->sp_expire > 0 && (request->timestamp / 86400) > spwd->sp_expire) { radlog_request(L_AUTH, 0, request, "[%s]: account has expired", name); return RLM_MODULE_REJECT; } #endif #if defined(__FreeBSD__) || defined(bsdi) || defined(_PWF_EXPIRE) /* * Check if password has expired. */ if ((pwd->pw_expire > 0) && (request->timestamp > pwd->pw_expire)) { radlog_request(L_AUTH, 0, request, "[%s]: password has expired", name); return RLM_MODULE_REJECT; } #endif /* * We might have a passwordless account. * * FIXME: Maybe add Auth-Type := Accept? */ if (encrypted_pass[0] == 0) return RLM_MODULE_NOOP; vp = pairmake("Crypt-Password", encrypted_pass, T_OP_SET); if (!vp) return RLM_MODULE_FAIL; pairmove(vp_list, &vp); pairfree(&vp); /* might not be NULL; */ return RLM_MODULE_UPDATED; } /* * Pull the users password from where-ever, and add it to * the given vp list. */ static int unix_authorize(void *instance, REQUEST *request) { return unix_getpw(instance, request, &request->config_items); } /* * Pull the users password from where-ever, and add it to * the given vp list. */ static int unix_authenticate(void *instance, REQUEST *request) { #ifdef OSFSIA char *info[2]; char *progname = "radius"; SIAENTITY *ent = NULL; info[0] = progname; info[1] = NULL; if (sia_ses_init (&ent, 1, info, NULL, name, NULL, 0, NULL) != SIASUCCESS) return RLM_MODULE_NOTFOUND; if ((ret = sia_ses_authent (NULL, passwd, ent)) != SIASUCCESS) { if (ret & SIASTOP) sia_ses_release (&ent); return RLM_MODULE_NOTFOUND; } if (sia_ses_estab (NULL, ent) != SIASUCCESS) { sia_ses_release (&ent); return RLM_MODULE_NOTFOUND; } #else /* OSFSIA */ int rcode; VALUE_PAIR *vp = NULL; if (!request->password || (request->password->attribute != PW_USER_PASSWORD)) { radlog_request(L_AUTH, 0, request, "Attribute \"User-Password\" is required for authentication."); return RLM_MODULE_INVALID; } rcode = unix_getpw(instance, request, &vp); if (rcode != RLM_MODULE_UPDATED) return rcode; /* * 0 means "ok" */ if (fr_crypt_check((char *) request->password->vp_strvalue, (char *) vp->vp_strvalue) != 0) { radlog_request(L_AUTH, 0, request, "invalid password \"%s\"", request->password->vp_strvalue); return RLM_MODULE_REJECT; } #endif /* OSFFIA */ return RLM_MODULE_OK; } /* * UUencode 4 bits base64. We use this to turn a 4 byte field * (an IP address) into 6 bytes of ASCII. This is used for the * wtmp file if we didn't find a short name in the naslist file. */ static char *uue(void *in) { int i; static unsigned char res[7]; unsigned char *data = (unsigned char *)in; res[0] = ENC( data[0] >> 2 ); res[1] = ENC( ((data[0] << 4) & 060) + ((data[1] >> 4) & 017) ); res[2] = ENC( ((data[1] << 2) & 074) + ((data[2] >> 6) & 03) ); res[3] = ENC( data[2] & 077 ); res[4] = ENC( data[3] >> 2 ); res[5] = ENC( (data[3] << 4) & 060 ); res[6] = 0; for(i = 0; i < 6; i++) { if (res[i] == ' ') res[i] = '`'; if (res[i] < 32 || res[i] > 127) printf("uue: protocol error ?!\n"); } return (char *)res; } /* * Unix accounting - write a wtmp file. */ static int unix_accounting(void *instance, REQUEST *request) { VALUE_PAIR *vp; FILE *fp; struct utmp ut; time_t t; char buf[64]; const char *s; int delay = 0; int status = -1; int nas_address = 0; int framed_address = 0; #ifdef USER_PROCESS int protocol = -1; #endif int nas_port = 0; int port_seen = 0; struct unix_instance *inst = (struct unix_instance *) instance; /* * No radwtmp. Don't do anything. */ if (!inst->radwtmp) { RDEBUG2("No radwtmp file configured. Ignoring accounting request."); return RLM_MODULE_NOOP; } if (request->packet->src_ipaddr.af != AF_INET) { RDEBUG2("IPv6 is not supported!"); return RLM_MODULE_NOOP; } /* * Which type is this. */ if ((vp = pairfind(request->packet->vps, PW_ACCT_STATUS_TYPE))==NULL) { RDEBUG("no Accounting-Status-Type attribute in request."); return RLM_MODULE_NOOP; } status = vp->vp_integer; /* * FIXME: handle PW_STATUS_ALIVE like 1.5.4.3 did. */ if (status != PW_STATUS_START && status != PW_STATUS_STOP) return RLM_MODULE_NOOP; /* * We're only interested in accounting messages * with a username in it. */ if (pairfind(request->packet->vps, PW_USER_NAME) == NULL) return RLM_MODULE_NOOP; t = request->timestamp; memset(&ut, 0, sizeof(ut)); /* * First, find the interesting attributes. */ for (vp = request->packet->vps; vp; vp = vp->next) { switch (vp->attribute) { case PW_USER_NAME: if (vp->length >= sizeof(ut.ut_name)) { memcpy(ut.ut_name, (char *)vp->vp_strvalue, sizeof(ut.ut_name)); } else { strlcpy(ut.ut_name, (char *)vp->vp_strvalue, sizeof(ut.ut_name)); } break; case PW_LOGIN_IP_HOST: case PW_FRAMED_IP_ADDRESS: framed_address = vp->vp_ipaddr; break; #ifdef USER_PROCESS case PW_FRAMED_PROTOCOL: protocol = vp->vp_integer; break; #endif case PW_NAS_IP_ADDRESS: nas_address = vp->vp_ipaddr; break; case PW_NAS_PORT: nas_port = vp->vp_integer; port_seen = 1; break; case PW_ACCT_DELAY_TIME: delay = vp->vp_ipaddr; break; } } /* * We don't store !root sessions, or sessions * where we didn't see a NAS-Port attribute. */ if (strncmp(ut.ut_name, "!root", sizeof(ut.ut_name)) == 0 || !port_seen) return RLM_MODULE_NOOP; /* * If we didn't find out the NAS address, use the * originator's IP address. */ if (nas_address == 0) { nas_address = request->packet->src_ipaddr.ipaddr.ip4addr.s_addr; } s = request->client->shortname; if (!s || s[0] == 0) s = uue(&(nas_address)); #ifdef __linux__ /* * Linux has a field for the client address. */ ut.ut_addr = framed_address; #endif /* * We use the tty field to store the terminal servers' port * and address so that the tty field is unique. */ snprintf(buf, sizeof(buf), "%03d:%s", nas_port, s); strlcpy(ut.ut_line, buf, sizeof(ut.ut_line)); /* * We store the dynamic IP address in the hostname field. */ #ifdef UT_HOSTSIZE if (framed_address) { ip_ntoa(buf, framed_address); strlcpy(ut.ut_host, buf, sizeof(ut.ut_host)); } #endif #ifdef HAVE_UTMPX_H ut.ut_xtime = t- delay; #else ut.ut_time = t - delay; #endif #ifdef USER_PROCESS /* * And we can use the ID field to store * the protocol. */ if (protocol == PW_PPP) strcpy(ut.ut_id, "P"); else if (protocol == PW_SLIP) strcpy(ut.ut_id, "S"); else strcpy(ut.ut_id, "T"); ut.ut_type = status == PW_STATUS_STOP ? DEAD_PROCESS : USER_PROCESS; #endif if (status == PW_STATUS_STOP) ut.ut_name[0] = 0; /* * Write a RADIUS wtmp log file. * * Try to open the file if we can't, we don't write the * wtmp file. If we can try to write. If we fail, * return RLM_MODULE_FAIL .. */ if ((fp = fopen(inst->radwtmp, "a")) != NULL) { if ((fwrite(&ut, sizeof(ut), 1, fp)) != 1) { fclose(fp); return RLM_MODULE_FAIL; } fclose(fp); } else return RLM_MODULE_FAIL; return RLM_MODULE_OK; } /* globally exported name */ module_t rlm_unix = { RLM_MODULE_INIT, "System", RLM_TYPE_THREAD_UNSAFE | RLM_TYPE_CHECK_CONFIG_SAFE, unix_instantiate, /* instantiation */ unix_detach, /* detach */ { unix_authenticate, /* authentication */ unix_authorize, /* authorization */ NULL, /* preaccounting */ unix_accounting, /* accounting */ NULL, /* checksimul */ NULL, /* pre-proxy */ NULL, /* post-proxy */ NULL /* post-auth */ }, }; freeradius-server/src/modules/rlm_wimax/000077500000000000000000000000001257552170400207615ustar00rootroot00000000000000freeradius-server/src/modules/rlm_wimax/.gitignore000066400000000000000000000000111257552170400227410ustar00rootroot00000000000000Makefile freeradius-server/src/modules/rlm_wimax/Makefile.in000066400000000000000000000002361257552170400230270ustar00rootroot00000000000000TARGET = @targetname@ SRCS = rlm_wimax.c HEADERS = RLM_CFLAGS = RLM_LIBS = include ../rules.mak $(STATIC_OBJS): $(HEADERS) $(DYNAMIC_OBJS): $(HEADERS) freeradius-server/src/modules/rlm_wimax/configure000077500000000000000000003575271257552170400227130ustar00rootroot00000000000000#! /bin/sh # From configure.in Revision. # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.61. # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, # 2002, 2003, 2004, 2005, 2006 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=: # 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 # PATH needs CR # 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 # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false 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.) as_nl=' ' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. 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 # Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # CDPATH. $as_unset CDPATH if test "x$CONFIG_SHELL" = x; then if (eval ":") 2>/dev/null; then as_have_required=yes else as_have_required=no fi if test $as_have_required = yes && (eval ": (as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=\$LINENO as_lineno_2=\$LINENO test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } ") 2> /dev/null; then : else as_candidate_shells= as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. case $as_dir in /*) for as_base in sh bash ksh sh5; do as_candidate_shells="$as_candidate_shells $as_dir/$as_base" done;; esac done IFS=$as_save_IFS for as_shell in $as_candidate_shells $SHELL; do # Try only shells that exist, to save several forks. if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { ("$as_shell") 2> /dev/null <<\_ASEOF 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 : _ASEOF }; then CONFIG_SHELL=$as_shell as_have_required=yes if { "$as_shell" 2> /dev/null <<\_ASEOF 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 : (as_func_return () { (exit $1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = "$1" ); then : else exitcode=1 echo positional parameters were not saved. fi test $exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } _ASEOF }; then break fi fi done if test "x$CONFIG_SHELL" != x; then for as_var in BASH_ENV ENV do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done export CONFIG_SHELL exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} fi if test $as_have_required = no; then echo This script requires a shell more modern than all the echo shells that I found on your system. Please install a echo modern shell, or manually run the script under such a echo shell if you do have one. { (exit 1); exit 1; } fi fi fi (eval "as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0") || { echo No shell found that supports shell functions. echo Please tell autoconf@gnu.org about your system, echo including any error possibly output before this echo message } as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, and appends # trailing '-' during substitution so that $LINENO is not a special # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # scripts with optimization help from Paolo Bonzini. 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" || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi 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 fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi 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=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, 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= SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME= PACKAGE_TARNAME= PACKAGE_VERSION= PACKAGE_STRING= PACKAGE_BUGREPORT= ac_unique_file="rlm_wimax.c" # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef STDC_HEADERS # include # include #else # ifdef HAVE_STDLIB_H # include # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datarootdir datadir sysconfdir sharedstatedir localstatedir includedir oldincludedir docdir infodir htmldir dvidir pdfdir psdir libdir localedir mandir DEFS ECHO_C ECHO_N ECHO_T LIBS build_alias host_alias target_alias CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP GREP EGREP wimax_cflags wimax_ldflags targetname LIBOBJS LTLIBOBJS' ac_subst_files='' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CPP' # Initialize some variables set by options. ac_init_help= ac_init_version=false # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *) ac_optarg=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_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` eval enable_$ac_feature=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_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` eval enable_$ac_feature=\$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_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/[-.]/_/g'` eval with_$ac_package=\$ac_optarg ;; -without-* | --without-*) ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/[-.]/_/g'` eval with_$ac_package=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 ;; -*) { echo "$as_me: error: unrecognized option: $ac_option Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && 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'` { echo "$as_me: error: missing argument to $ac_option" >&2 { (exit 1); exit 1; }; } fi # Be sure to have absolute directory names. 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 case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; } 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 echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || { echo "$as_me: error: Working directory cannot be determined" >&2 { (exit 1); exit 1; }; } test "X$ac_ls_di" = "X$ac_pwd_ls_di" || { echo "$as_me: error: pwd does not report name of working directory" >&2 { (exit 1); exit 1; }; } # 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 -- "$0" || $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$0" : 'X\(//\)[^/]' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X"$0" | 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 .." { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2 { (exit 1); exit 1; }; } pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures this package to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF _ACEOF fi if test -n "$ac_init_help"; then cat <<\_ACEOF 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 C/C++/Objective C preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. _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" || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`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 echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF configure generated by GNU Autoconf 2.61 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 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 cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by $as_me, which was generated by GNU Autoconf 2.61. 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=. 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=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; 2) ac_configure_args1="$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 ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac done done $as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } $as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export 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 cat <<\_ASBOX ## ---------------- ## ## Cache variables. ## ## ---------------- ## _ASBOX 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_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( *) $as_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 cat <<\_ASBOX ## ----------------- ## ## Output variables. ## ## ----------------- ## _ASBOX echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then cat <<\_ASBOX ## ------------------- ## ## File substitutions. ## ## ------------------- ## _ASBOX echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then cat <<\_ASBOX ## ----------- ## ## confdefs.h. ## ## ----------- ## _ASBOX echo cat confdefs.h echo fi test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" 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'; { (exit 1); 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 # 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 # Let the site file select an alternate cache file if it wants to. # Prefer explicitly selected file to automatically selected ones. if test -n "$CONFIG_SITE"; then set x "$CONFIG_SITE" elif test "x$prefix" != xNONE; then set x "$prefix/share/config.site" "$prefix/etc/config.site" else set x "$ac_default_prefix/share/config.site" \ "$ac_default_prefix/etc/config.site" fi shift for ac_site_file do if test -r "$ac_site_file"; then { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" 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. if test -f "$cache_file"; then { echo "$as_me:$LINENO: loading cache $cache_file" >&5 echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { echo "$as_me:$LINENO: creating cache $cache_file" >&5 echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 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 { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 echo "$as_me: former value: $ac_old_val" >&2;} { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 echo "$as_me: current value: $ac_new_val" >&2;} ac_cache_corrupted=: fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`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. *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 echo "$as_me: error: changes in the environment can compromise the build" >&2;} { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} { (exit 1); exit 1; }; } 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 # change 'wimax' # change 'wimax' if test x$with_rlm_wimax != xno; then 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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}gcc" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="gcc" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}cc" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="$ac_prog" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&5 echo "$as_me: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } # Provide some information about the compiler. echo "$as_me:$LINENO: checking for C compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (ac_try="$ac_compiler --version >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -v >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -V >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out 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. { echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6; } ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # # List of possible output files, starting from the most likely. # The algorithm is not robust to junk in `.', hence go to wildcards (a.*) # only as a last resort. b.out is created by i960 compilers. ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out' # # The IRIX 6 linker writes into existing files which may not be # executable, retaining their permissions. Remove them first so a # subsequent execution test works. ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link_default") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; 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 | *.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 { echo "$as_me:$LINENO: result: $ac_file" >&5 echo "${ECHO_T}$ac_file" >&6; } if test -z "$ac_file"; then echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: C compiler cannot create executables See \`config.log' for more details." >&5 echo "$as_me: error: C compiler cannot create executables See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } fi ac_exeext=$ac_cv_exeext # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { echo "$as_me:$LINENO: checking whether the C compiler works" >&5 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6; } # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then if { ac_try='./$ac_file' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { echo "$as_me:$LINENO: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&5 echo "$as_me: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi fi fi { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } rm -f a.out a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; } { echo "$as_me:$LINENO: result: $cross_compiling" >&5 echo "${ECHO_T}$cross_compiling" >&6; } { echo "$as_me:$LINENO: checking for suffix of executables" >&5 echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; } if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; 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 | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest$ac_cv_exeext { echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 echo "${ECHO_T}$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT { echo "$as_me:$LINENO: checking for suffix of object files" >&5 echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; } if test "${ac_cv_objext+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; 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 ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 echo "${ECHO_T}$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; } if test "${ac_cv_c_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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 { echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; } GCC=`test $ac_compiler_gnu = yes && echo yes` ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CFLAGS="" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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 { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 echo "${ECHO_T}$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 { echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_c89+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_c89=$ac_arg else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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) { echo "$as_me:$LINENO: result: none needed" >&5 echo "${ECHO_T}none needed" >&6; } ;; xno) { echo "$as_me:$LINENO: result: unsupported" >&5 echo "${ECHO_T}unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;; 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 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 { echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if test "${ac_cv_prog_CPP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f 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 { echo "$as_me:$LINENO: result: $CPP" >&5 echo "${ECHO_T}$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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&5 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } 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 { echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5 echo $ECHO_N "checking for grep that handles long lines and -e... $ECHO_C" >&6; } if test "${ac_cv_path_GREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Extract the first word of "grep ggrep" to use in msg output if test -z "$GREP"; then set dummy grep ggrep; ac_prog_name=$2 if test "${ac_cv_path_GREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" 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 ac_count=`expr $ac_count + 1` 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 fi GREP="$ac_cv_path_GREP" if test -z "$GREP"; then { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} { (exit 1); exit 1; }; } fi else ac_cv_path_GREP=$GREP fi fi { echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5 echo "${ECHO_T}$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { echo "$as_me:$LINENO: checking for egrep" >&5 echo $ECHO_N "checking for egrep... $ECHO_C" >&6; } if test "${ac_cv_path_EGREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else # Extract the first word of "egrep" to use in msg output if test -z "$EGREP"; then set dummy egrep; ac_prog_name=$2 if test "${ac_cv_path_EGREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" 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 ac_count=`expr $ac_count + 1` 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 fi EGREP="$ac_cv_path_EGREP" if test -z "$EGREP"; then { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} { (exit 1); exit 1; }; } fi else ac_cv_path_EGREP=$EGREP fi fi fi { echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 echo "${ECHO_T}$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" { echo "$as_me:$LINENO: checking for ANSI C header files" >&5 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; } if test "${ac_cv_header_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_header_stdc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* 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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* 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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* 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 rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi { echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 echo "${ECHO_T}$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then cat >>confdefs.h <<\_ACEOF #define STDC_HEADERS 1 _ACEOF 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=`echo "ac_cv_header_$ac_header" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Header=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done if test "${ac_cv_header_openssl_hmac_h+set}" = set; then { echo "$as_me:$LINENO: checking for openssl/hmac.h" >&5 echo $ECHO_N "checking for openssl/hmac.h... $ECHO_C" >&6; } if test "${ac_cv_header_openssl_hmac_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi { echo "$as_me:$LINENO: result: $ac_cv_header_openssl_hmac_h" >&5 echo "${ECHO_T}$ac_cv_header_openssl_hmac_h" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking openssl/hmac.h usability" >&5 echo $ECHO_N "checking openssl/hmac.h usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? { echo "$as_me:$LINENO: checking openssl/hmac.h presence" >&5 echo $ECHO_N "checking openssl/hmac.h presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: openssl/hmac.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: openssl/hmac.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: openssl/hmac.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: openssl/hmac.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: openssl/hmac.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: openssl/hmac.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: openssl/hmac.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: openssl/hmac.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: openssl/hmac.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: openssl/hmac.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: openssl/hmac.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: openssl/hmac.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: openssl/hmac.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: openssl/hmac.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: openssl/hmac.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: openssl/hmac.h: in the future, the compiler will take precedence" >&2;} ;; esac { echo "$as_me:$LINENO: checking for openssl/hmac.h" >&5 echo $ECHO_N "checking for openssl/hmac.h... $ECHO_C" >&6; } if test "${ac_cv_header_openssl_hmac_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_openssl_hmac_h=$ac_header_preproc fi { echo "$as_me:$LINENO: result: $ac_cv_header_openssl_hmac_h" >&5 echo "${ECHO_T}$ac_cv_header_openssl_hmac_h" >&6; } fi if test $ac_cv_header_openssl_hmac_h = yes; then wimax_cflags="$wimax_cflags" else fail=$fail" openssl/hmac.h" fi targetname=rlm_wimax # keep this! Don't change! else targetname= # keep this! Don't change! echo \*\*\* module rlm_wimax is disabled. # keep this! Don't change! fi if test x"$fail" != x""; then if test x"${enable_strict_dependencies}" = x"yes"; then { { echo "$as_me:$LINENO: error: set --without-rlm_wimax to disable it explicitly." >&5 echo "$as_me: error: set --without-rlm_wimax to disable it explicitly." >&2;} { (exit 1); exit 1; }; } else { echo "$as_me:$LINENO: WARNING: silently not building rlm_wimax." >&5 echo "$as_me: WARNING: silently not building rlm_wimax." >&2;} { echo "$as_me:$LINENO: WARNING: FAILURE: rlm_wimax requires: $fail." >&5 echo "$as_me: WARNING: FAILURE: rlm_wimax requires: $fail." >&2;}; targetname="" fi fi # change 'wimax' # change 'wimax' # keep this! Don't change! unset ac_cv_env_LIBS_set unset ac_cv_env_LIBS_value ac_config_files="$ac_config_files 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_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( *) $as_unset $ac_var ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then test "x$cache_file" != "x/dev/null" && { echo "$as_me:$LINENO: updating cache $cache_file" >&5 echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 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}' # Transform confdefs.h into DEFS. # Protect against shell expansion while executing Makefile rules. # Protect against Makefile macro expansion. # # If the first sed substitution is executed (which looks for macros that # take arguments), then branch to the quote section. Otherwise, # look for a macro that doesn't take arguments. ac_script=' t clear :clear s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g t quote s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g t quote b any :quote s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g s/\[/\\&/g s/\]/\\&/g s/\$/$$/g H :any ${ g s/^\n// s/\n/ /g p } ' DEFS=`sed -n "$ac_script" confdefs.h` ac_libobjs= ac_ltlibobjs= 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=`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. ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs : ${CONFIG_STATUS=./config.status} ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >$CONFIG_STATUS <<_ACEOF #! $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} _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ## --------------------- ## ## 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=: # 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 # PATH needs CR # 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 # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false 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.) as_nl=' ' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. 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 # Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # CDPATH. $as_unset CDPATH as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, and appends # trailing '-' during substitution so that $LINENO is not a special # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # scripts with optimization help from Paolo Bonzini. 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" || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi 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 fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi 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=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 # Save the log message, to keep $[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by $as_me, which was generated by GNU Autoconf 2.61. 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 cat >>$CONFIG_STATUS <<_ACEOF # Files that config.status was made for. config_files="$ac_config_files" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit -q, --quiet 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 Configuration files: $config_files Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ config.status configured by $0, generated by GNU Autoconf 2.61, with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" Copyright (C) 2006 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' _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # If no file are specified by the user, then we need to provide default # value. By we need to know if files were specified by the user. 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=$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 ) echo "$ac_cs_version"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift CONFIG_FILES="$CONFIG_FILES $ac_optarg" ac_need_defaults=false;; --he | --h | --help | --hel | -h ) 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. -*) { echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *) ac_config_targets="$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 if \$ac_cs_recheck; then echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 CONFIG_SHELL=$SHELL export CONFIG_SHELL exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; 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 fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= trap 'exit_status=$? { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status ' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || { echo "$me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } # # Set up the sed scripts for CONFIG_FILES section. # # No need to generate the scripts if there are no CONFIG_FILES. # This happens for instance when ./config.status config.h if test -n "$CONFIG_FILES"; then _ACEOF ac_delim='%!_!# ' for ac_last_try in false false false false false :; do cat >conf$$subs.sed <<_ACEOF SHELL!$SHELL$ac_delim PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim PACKAGE_NAME!$PACKAGE_NAME$ac_delim PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim PACKAGE_STRING!$PACKAGE_STRING$ac_delim PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim exec_prefix!$exec_prefix$ac_delim prefix!$prefix$ac_delim program_transform_name!$program_transform_name$ac_delim bindir!$bindir$ac_delim sbindir!$sbindir$ac_delim libexecdir!$libexecdir$ac_delim datarootdir!$datarootdir$ac_delim datadir!$datadir$ac_delim sysconfdir!$sysconfdir$ac_delim sharedstatedir!$sharedstatedir$ac_delim localstatedir!$localstatedir$ac_delim includedir!$includedir$ac_delim oldincludedir!$oldincludedir$ac_delim docdir!$docdir$ac_delim infodir!$infodir$ac_delim htmldir!$htmldir$ac_delim dvidir!$dvidir$ac_delim pdfdir!$pdfdir$ac_delim psdir!$psdir$ac_delim libdir!$libdir$ac_delim localedir!$localedir$ac_delim mandir!$mandir$ac_delim DEFS!$DEFS$ac_delim ECHO_C!$ECHO_C$ac_delim ECHO_N!$ECHO_N$ac_delim ECHO_T!$ECHO_T$ac_delim LIBS!$LIBS$ac_delim build_alias!$build_alias$ac_delim host_alias!$host_alias$ac_delim target_alias!$target_alias$ac_delim CC!$CC$ac_delim CFLAGS!$CFLAGS$ac_delim LDFLAGS!$LDFLAGS$ac_delim CPPFLAGS!$CPPFLAGS$ac_delim ac_ct_CC!$ac_ct_CC$ac_delim EXEEXT!$EXEEXT$ac_delim OBJEXT!$OBJEXT$ac_delim CPP!$CPP$ac_delim GREP!$GREP$ac_delim EGREP!$EGREP$ac_delim wimax_cflags!$wimax_cflags$ac_delim wimax_ldflags!$wimax_ldflags$ac_delim targetname!$targetname$ac_delim LIBOBJS!$LIBOBJS$ac_delim LTLIBOBJS!$LTLIBOBJS$ac_delim _ACEOF if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 52; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` if test -n "$ac_eof"; then ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` ac_eof=`expr $ac_eof + 1` fi cat >>$CONFIG_STATUS <<_ACEOF cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof /@[a-zA-Z_][a-zA-Z_0-9]*@/!b end _ACEOF sed ' s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g s/^/s,@/; s/!/@,|#_!!_#|/ :n t n s/'"$ac_delim"'$/,g/; t s/$/\\/; p N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n ' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF :end s/|#_!!_#|//g CEOF$ac_eof _ACEOF # VPATH may cause trouble with some makes, so we remove $(srcdir), # ${srcdir} and @srcdir@ 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[ ]*=/{ s/:*\$(srcdir):*/:/ s/:*\${srcdir}:*/:/ s/:*@srcdir@:*/:/ s/^\([^=]*=[ ]*\):*/\1/ s/:*$// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF fi # test -n "$CONFIG_FILES" for ac_tag in :F $CONFIG_FILES do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5 echo "$as_me: error: Invalid tag $ac_tag." >&2;} { (exit 1); exit 1; }; };; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 echo "$as_me: error: cannot find input file: $ac_f" >&2;} { (exit 1); exit 1; }; };; esac ac_file_inputs="$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 "`IFS=: echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure." if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { echo "$as_me:$LINENO: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} fi case $ac_tag in *:-:* | *:-) cat >"$tmp/stdin";; 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 || 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" case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`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 || 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" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 echo "$as_me: error: cannot create directory $as_dir" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`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 # _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # 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= case `sed -n '/datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p ' $ac_file_inputs` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF 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 sed "$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s&@configure_input@&$configure_input&;t t s&@top_builddir@&$ac_top_builddir_sub&;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 $ac_datarootdir_hack " $ac_file_inputs | sed -f "$tmp/subs-1.sed" >$tmp/out test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&5 echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&2;} rm -f "$tmp/stdin" case $ac_file in -) cat "$tmp/out"; rm -f "$tmp/out";; *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;; esac ;; esac done # for ac_tag { (exit 0); exit 0; } _ACEOF chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save # 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 || { (exit 1); exit 1; } fi # keep this! Don't change! freeradius-server/src/modules/rlm_wimax/configure.in000066400000000000000000000021411257552170400232700ustar00rootroot00000000000000AC_PREREQ([2.53]) AC_INIT(rlm_wimax.c) # change 'wimax' AC_REVISION($Revision$) AC_DEFUN(modname,[rlm_wimax]) # change 'wimax' if test x$with_[]modname != xno; then AC_PROG_CC AC_PROG_CPP dnl put configuration checks here. dnl set $fail to what's missing, on fatal errors. dnl use AC_MSG_WARN() on important messages. AC_CHECK_HEADER(openssl/hmac.h, [ wimax_cflags="$wimax_cflags" ], [ fail=$fail" openssl/hmac.h" ] ) targetname=modname # keep this! Don't change! else targetname= # keep this! Don't change! echo \*\*\* module modname is disabled. # keep this! Don't change! fi dnl Don't change this section. if test x"$fail" != x""; then if test x"${enable_strict_dependencies}" = x"yes"; then AC_MSG_ERROR([set --without-]modname[ to disable it explicitly.]) else AC_MSG_WARN([silently not building ]modname[.]) AC_MSG_WARN([FAILURE: ]modname[ requires: $fail.]); targetname="" fi fi AC_SUBST(wimax_cflags) # change 'wimax' AC_SUBST(wimax_ldflags) # change 'wimax' AC_SUBST(targetname) # keep this! Don't change! AC_OUTPUT(Makefile) # keep this! Don't change! freeradius-server/src/modules/rlm_wimax/rlm_wimax.c000066400000000000000000000334051257552170400231310ustar00rootroot00000000000000/* * rlm_wimax.c * * Version: $Id$ * * Copyright (C) 2008 Alan DeKok * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT * OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR * IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #include RCSID("$Id$") #include #include /* * FIXME: Add check for this header to configure.in */ #include /* * FIXME: Fix the build system to create definitions from names. */ #define WIMAX2ATTR(x) ((24757 << 16) | (x)) typedef struct rlm_wimax_t { int delete_mppe_keys; } rlm_wimax_t; /* * A mapping of configuration file names to internal variables. * * Note that the string is dynamically allocated, so it MUST * be freed. When the configuration file parse re-reads the string, * it free's the old one, and strdup's the new one, placing the pointer * to the strdup'd string into 'config.string'. This gets around * buffer over-flows. */ static const CONF_PARSER module_config[] = { { "delete_mppe_keys", PW_TYPE_BOOLEAN, offsetof(rlm_wimax_t,delete_mppe_keys), NULL, "no" }, { NULL, -1, 0, NULL, NULL } /* end the list */ }; /* * Only free memory we allocated. The strings allocated via * cf_section_parse() do not need to be freed. */ static int wimax_detach(void *instance) { free(instance); return 0; } /* * Do any per-module initialization that is separate to each * configured instance of the module. e.g. set up connections * to external databases, read configuration files, set up * dictionary entries, etc. * * If configuration information is given in the config section * that must be referenced in later calls, store a handle to it * in *instance otherwise put a null pointer there. */ static int wimax_instantiate(CONF_SECTION *conf, void **instance) { rlm_wimax_t *inst; /* * Set up a storage area for instance data */ inst = rad_malloc(sizeof(*inst)); if (!inst) { return -1; } memset(inst, 0, sizeof(*inst)); /* * If the configuration parameters can't be parsed, then * fail. */ if (cf_section_parse(conf, inst, module_config) < 0) { wimax_detach(inst); return -1; } *instance = inst; return 0; } /* * Find the named user in this modules database. Create the set * of attribute-value pairs to check and reply with for this user * from the database. The authentication code only needs to check * the password, the rest is done here. */ static int wimax_authorize(void *instance, REQUEST *request) { VALUE_PAIR *vp; /* quiet the compiler */ instance = instance; request = request; /* * Fix Calling-Station-Id. Damn you, WiMAX! */ vp = pairfind(request->packet->vps, PW_CALLING_STATION_ID); if (vp && (vp->length == 6)) { int i; uint8_t buffer[6]; memcpy(buffer, vp->vp_octets, 6); /* * RFC 3580 Section 3.20 says this is the preferred * format. Everyone *SANE* is using this format, * so we fix it here. */ for (i = 0; i < 6; i++) { fr_bin2hex(&buffer[i], &vp->vp_strvalue[i * 3], 1); vp->vp_strvalue[(i * 3) + 2] = '-'; } vp->vp_strvalue[(5*3)+2] = '\0'; vp->length = (5*3)+2; DEBUG2("rlm_wimax: Fixing WiMAX binary Calling-Station-Id to %s", vp->vp_strvalue); } return RLM_MODULE_OK; } /* * Massage the request before recording it or proxying it */ static int wimax_preacct(void *instance, REQUEST *request) { return wimax_authorize(instance, request); } /* * Write accounting information to this modules database. */ static int wimax_accounting(void *instance, REQUEST *request) { /* quiet the compiler */ instance = instance; request = request; return RLM_MODULE_OK; } /* * Generate the keys after the user has been authenticated. */ static int wimax_postauth(void *instance, REQUEST *request) { rlm_wimax_t *inst = instance; VALUE_PAIR *msk, *emsk, *vp; VALUE_PAIR *mn_nai, *ip, *fa_rk; HMAC_CTX hmac; unsigned int rk1_len, rk2_len, rk_len; int rk_lifetime = 3600; /* ? */ uint32_t mip_spi; uint8_t usage_data[24]; uint8_t mip_rk_1[EVP_MAX_MD_SIZE], mip_rk_2[EVP_MAX_MD_SIZE]; uint8_t mip_rk[2 * EVP_MAX_MD_SIZE]; msk = pairfind(request->reply->vps, 1129); emsk = pairfind(request->reply->vps, 1130); if (!msk || !emsk) { RDEBUG("No EAP-MSK or EAP-EMSK. Cannot create WiMAX keys."); return RLM_MODULE_NOOP; } /* * If we delete the MS-MPPE-*-Key attributes, then add in * the WiMAX-MSK so that the client has a key available. */ if (inst->delete_mppe_keys) { pairdelete(&request->reply->vps, ((311 << 16) | 16)); pairdelete(&request->reply->vps, ((311 << 16) | 17)); vp = radius_pairmake(request, &request->reply->vps, "WiMAX-MSK", "0x00", T_OP_EQ); if (vp) { memcpy(vp->vp_octets, msk->vp_octets, msk->length); vp->length = msk->length; } } /* * Initialize usage data. */ memcpy(usage_data, "miprk@wimaxforum.org", 21); /* with trailing \0 */ usage_data[21] = 0x02; usage_data[22] = 0x00; usage_data[23] = 0x01; /* * MIP-RK-1 = HMAC-SSHA256(EMSK, usage-data | 0x01) */ HMAC_CTX_init(&hmac); HMAC_Init_ex(&hmac, emsk->vp_octets, emsk->length, EVP_sha256(), NULL); HMAC_Update(&hmac, &usage_data[0], sizeof(usage_data)); HMAC_Final(&hmac, &mip_rk_1[0], &rk1_len); /* * MIP-RK-2 = HMAC-SSHA256(EMSK, MIP-RK-1 | usage-data | 0x01) */ HMAC_Init_ex(&hmac, emsk->vp_octets, emsk->length, EVP_sha256(), NULL); HMAC_Update(&hmac, (const uint8_t *) &mip_rk_1, rk1_len); HMAC_Update(&hmac, &usage_data[0], sizeof(usage_data)); HMAC_Final(&hmac, &mip_rk_2[0], &rk2_len); vp = pairfind(request->reply->vps, PW_SESSION_TIMEOUT); if (vp) rk_lifetime = vp->vp_integer; memcpy(mip_rk, mip_rk_1, rk1_len); memcpy(mip_rk + rk1_len, mip_rk_2, rk2_len); rk_len = rk1_len + rk2_len; /* * MIP-SPI = HMAC-SSHA256(MIP-RK, "SPI CMIP PMIP"); */ HMAC_Init_ex(&hmac, mip_rk, rk_len, EVP_sha256(), NULL); HMAC_Update(&hmac, (const uint8_t *) "SPI CMIP PMIP", 12); HMAC_Final(&hmac, &mip_rk_1[0], &rk1_len); /* * Take the 4 most significant octets. * If less than 256, add 256. */ mip_spi = ((mip_rk_1[0] << 24) | (mip_rk_1[1] << 16) | (mip_rk_1[2] << 8) | mip_rk_1[3]); if (mip_spi < 256) mip_spi += 256; if (debug_flag) { int len = rk_len; char buffer[512]; if (len > 128) len = 128; /* buffer size */ fr_bin2hex(mip_rk, buffer, len); radlog_request(L_DBG, 0, request, "MIP-RK = 0x%s", buffer); radlog_request(L_DBG, 0, request, "MIP-SPI = %08x", ntohl(mip_spi)); } /* * FIXME: Perform SPI collision prevention */ /* * Calculate mobility keys */ mn_nai = pairfind(request->packet->vps, 1900); if (!mn_nai) mn_nai = pairfind(request->reply->vps, 1900); if (!mn_nai) { RDEBUG("WARNING: WiMAX-MN-NAI was not found in the request or in the reply."); RDEBUG("WARNING: We cannot calculate MN-HA keys."); } /* * WiMAX-IP-Technology */ vp = NULL; if (mn_nai) vp = pairfind(request->reply->vps, WIMAX2ATTR(23)); if (!vp) { RDEBUG("WARNING: WiMAX-IP-Technology not found in reply."); RDEBUG("WARNING: Not calculating MN-HA keys"); } if (vp) switch (vp->vp_integer) { case 2: /* PMIP4 */ /* * Look for WiMAX-hHA-IP-MIP4 */ ip = pairfind(request->reply->vps, WIMAX2ATTR(6)); if (!ip) { RDEBUG("WARNING: WiMAX-hHA-IP-MIP4 not found. Cannot calculate MN-HA-PMIP4 key"); break; } /* * MN-HA-PMIP4 = * H(MIP-RK, "PMIP4 MN HA" | HA-IPv4 | MN-NAI); */ HMAC_Init_ex(&hmac, mip_rk, rk_len, EVP_sha1(), NULL); HMAC_Update(&hmac, (const uint8_t *) "PMIP4 MN HA", 11); HMAC_Update(&hmac, (const uint8_t *) &ip->vp_ipaddr, 4); HMAC_Update(&hmac, (const uint8_t *) &mn_nai->vp_strvalue, mn_nai->length); HMAC_Final(&hmac, &mip_rk_1[0], &rk1_len); /* * Put MN-HA-PMIP4 into WiMAX-MN-hHA-MIP4-Key */ vp = pairfind(request->reply->vps, WIMAX2ATTR(10)); if (!vp) { vp = radius_paircreate(request, &request->reply->vps, WIMAX2ATTR(10), PW_TYPE_OCTETS); } if (!vp) { RDEBUG("WARNING: Failed creating WiMAX-MN-hHA-MIP4-Key"); break; } memcpy(vp->vp_octets, &mip_rk_1[0], rk1_len); vp->length = rk1_len; /* * Put MN-HA-PMIP4-SPI into WiMAX-MN-hHA-MIP4-SPI */ vp = pairfind(request->reply->vps, WIMAX2ATTR(11)); if (!vp) { vp = radius_paircreate(request, &request->reply->vps, WIMAX2ATTR(11), PW_TYPE_INTEGER); } if (!vp) { RDEBUG("WARNING: Failed creating WiMAX-MN-hHA-MIP4-SPI"); break; } vp->vp_integer = mip_spi + 1; break; case 3: /* CMIP4 */ /* * Look for WiMAX-hHA-IP-MIP4 */ ip = pairfind(request->reply->vps, WIMAX2ATTR(6)); if (!ip) { RDEBUG("WARNING: WiMAX-hHA-IP-MIP4 not found. Cannot calculate MN-HA-CMIP4 key"); break; } /* * MN-HA-CMIP4 = * H(MIP-RK, "CMIP4 MN HA" | HA-IPv4 | MN-NAI); */ HMAC_Init_ex(&hmac, mip_rk, rk_len, EVP_sha1(), NULL); HMAC_Update(&hmac, (const uint8_t *) "CMIP4 MN HA", 11); HMAC_Update(&hmac, (const uint8_t *) &ip->vp_ipaddr, 4); HMAC_Update(&hmac, (const uint8_t *) &mn_nai->vp_strvalue, mn_nai->length); HMAC_Final(&hmac, &mip_rk_1[0], &rk1_len); /* * Put MN-HA-CMIP4 into WiMAX-MN-hHA-MIP4-Key */ vp = pairfind(request->reply->vps, WIMAX2ATTR(10)); if (!vp) { vp = radius_paircreate(request, &request->reply->vps, WIMAX2ATTR(10), PW_TYPE_OCTETS); } if (!vp) { RDEBUG("WARNING: Failed creating WiMAX-MN-hHA-MIP4-Key"); break; } memcpy(vp->vp_octets, &mip_rk_1[0], rk1_len); vp->length = rk1_len; /* * Put MN-HA-CMIP4-SPI into WiMAX-MN-hHA-MIP4-SPI */ vp = pairfind(request->reply->vps, WIMAX2ATTR(11)); if (!vp) { vp = radius_paircreate(request, &request->reply->vps, WIMAX2ATTR(11), PW_TYPE_INTEGER); } if (!vp) { RDEBUG("WARNING: Failed creating WiMAX-MN-hHA-MIP4-SPI"); break; } vp->vp_integer = mip_spi; break; case 4: /* CMIP6 */ /* * Look for WiMAX-hHA-IP-MIP6 */ ip = pairfind(request->reply->vps, WIMAX2ATTR(7)); if (!ip) { RDEBUG("WARNING: WiMAX-hHA-IP-MIP6 not found. Cannot calculate MN-HA-CMIP6 key"); break; } /* * MN-HA-CMIP6 = * H(MIP-RK, "CMIP6 MN HA" | HA-IPv6 | MN-NAI); */ HMAC_Init_ex(&hmac, mip_rk, rk_len, EVP_sha1(), NULL); HMAC_Update(&hmac, (const uint8_t *) "CMIP6 MN HA", 11); HMAC_Update(&hmac, (const uint8_t *) &ip->vp_ipv6addr, 16); HMAC_Update(&hmac, (const uint8_t *) &mn_nai->vp_strvalue, mn_nai->length); HMAC_Final(&hmac, &mip_rk_1[0], &rk1_len); /* * Put MN-HA-CMIP6 into WiMAX-MN-hHA-MIP6-Key */ vp = pairfind(request->reply->vps, WIMAX2ATTR(12)); if (!vp) { vp = radius_paircreate(request, &request->reply->vps, WIMAX2ATTR(12), PW_TYPE_OCTETS); } if (!vp) { RDEBUG("WARNING: Failed creating WiMAX-MN-hHA-MIP6-Key"); break; } memcpy(vp->vp_octets, &mip_rk_1[0], rk1_len); vp->length = rk1_len; /* * Put MN-HA-CMIP6-SPI into WiMAX-MN-hHA-MIP6-SPI */ vp = pairfind(request->reply->vps, WIMAX2ATTR(13)); if (!vp) { vp = radius_paircreate(request, &request->reply->vps, WIMAX2ATTR(13), PW_TYPE_INTEGER); } if (!vp) { RDEBUG("WARNING: Failed creating WiMAX-MN-hHA-MIP6-SPI"); break; } vp->vp_integer = mip_spi + 2; break; default: break; /* do nothing */ } /* * Generate FA-RK, if requested. * * FA-RK= H(MIP-RK, "FA-RK") */ fa_rk = pairfind(request->reply->vps, WIMAX2ATTR(14)); if (fa_rk && (fa_rk->length <= 1)) { HMAC_Init_ex(&hmac, mip_rk, rk_len, EVP_sha1(), NULL); HMAC_Update(&hmac, (const uint8_t *) "FA-RK", 5); HMAC_Final(&hmac, &mip_rk_1[0], &rk1_len); memcpy(fa_rk->vp_octets, &mip_rk_1[0], rk1_len); fa_rk->length = rk1_len; } /* * Create FA-RK-SPI, which is really SPI-CMIP4, which is * really MIP-SPI. Clear? Of course. This is WiMAX. */ if (fa_rk) { vp = pairfind(request->reply->vps, WIMAX2ATTR(61)); if (!vp) { vp = radius_paircreate(request, &request->reply->vps, WIMAX2ATTR(61), PW_TYPE_INTEGER); } if (!vp) { RDEBUG("WARNING: Failed creating WiMAX-FA-RK-SPI"); } else { vp->vp_integer = mip_spi; } } /* * Give additional information about requests && responses * * WiMAX-RRQ-MN-HA-SPI */ vp = pairfind(request->packet->vps, WIMAX2ATTR(20)); if (vp) { RDEBUG("Client requested MN-HA key: Should use SPI to look up key from storage."); if (!mn_nai) { RDEBUG("WARNING: MN-NAI was not found!"); } /* * WiMAX-RRQ-HA-IP */ if (!pairfind(request->packet->vps, WIMAX2ATTR(18))) { RDEBUG("WARNING: HA-IP was not found!"); } /* * WiMAX-HA-RK-Key-Requested */ vp = pairfind(request->packet->vps, WIMAX2ATTR(58)); if (vp && (vp->vp_integer == 1)) { RDEBUG("Client requested HA-RK: Should use IP to look it up from storage."); } } /* * Wipe the context of all sensitive information. */ HMAC_CTX_cleanup(&hmac); return RLM_MODULE_UPDATED; } /* * The module name should be the only globally exported symbol. * That is, everything else should be 'static'. * * If the module needs to temporarily modify it's instantiation * data, the type should be changed to RLM_TYPE_THREAD_UNSAFE. * The server will then take care of ensuring that the module * is single-threaded. */ module_t rlm_wimax = { RLM_MODULE_INIT, "wimax", RLM_TYPE_THREAD_SAFE, /* type */ wimax_instantiate, /* instantiation */ wimax_detach, /* detach */ { NULL, /* authentication */ wimax_authorize, /* authorization */ wimax_preacct, /* preaccounting */ wimax_accounting, /* accounting */ NULL, /* checksimul */ NULL, /* pre-proxy */ NULL, /* post-proxy */ wimax_postauth /* post-auth */ }, }; freeradius-server/src/modules/rules.mak000066400000000000000000000120461257552170400206110ustar00rootroot00000000000000####################################################################### # # $Id$ # # Each module should have a few common defines at the TOP of the # Makefile, and the 'include ../rules.mak' # # e.g. # ############################ # TARGET = rlm_foo # SRCS = rlm_foo.c other.c # # include ../rules.mak # # RLM_CFLAGS = my_cflags # RLM_LDLAGS = my_ldflags ############################ # # and everything will be automagically built # ####################################################################### include $(RLM_DIR)../../../Make.inc .PHONY: all build-module clean distclean install reconfig all: build-module ####################################################################### # # definitions for new dependencies on suffixes # ####################################################################### .SUFFIXES: .lo .o .la .a ####################################################################### # # define libtool objects for the libraries, # along with a number of other useful definitions. # ####################################################################### LT_OBJS += $(SRCS:.c=.lo) LT_OBJS += $(SRCS:.cpp=.lo) CFLAGS += -I$(top_builddir)/src $(INCLTDL) ####################################################################### # # Ensure that the modules get re-built if the server header files # change. # ####################################################################### SERVER_HEADERS = $(top_builddir)/src/include/radius.h \ $(top_builddir)/src/include/radiusd.h \ $(top_builddir)/src/include/modules.h \ $(top_builddir)/src/include/libradius.h $(LT_OBJS): $(SERVER_HEADERS) ####################################################################### # # define new rules # ####################################################################### %.lo: %.c $(LIBTOOL) --mode=compile --tag=CC $(CC) $(CFLAGS) $(RLM_CFLAGS) -c $< %.lo: %.cpp $(LIBTOOL) --mode=compile --tag=CXX $(CXX) $(CFLAGS) $(RLM_CFLAGS) -c $< ifneq ($(TARGET),) ####################################################################### # # Define a number of new targets # ####################################################################### # # If the module is in the list of static modules, then the "dynamic" # library is built statically, so that the '.la' file contains the # libraries that the module depends on. # # Yes, this is a horrible hack. # ifeq ($(findstring $(TARGET),$(STATIC_MODULES)),) LINK_MODE = -export-dynamic else LINK_MODE = -static endif # # Also, if we're NOT using shared libraries, then force the # link mode to static. # ifneq ($(USE_SHARED_LIBS),yes) LINK_MODE = -static endif ####################################################################### # # Generic targets so we can sweep through all modules # without knowing what their names are. # # These rules also allow us to copy the '.a' or '.la' up # a level, to the 'src/modules' directory, for general consumption. # ####################################################################### # # We can't use $(PWD), because that's apparently where the "make" # started. Any child builds (make -C foo) don't change PWD. # WHERE=$(shell pwd) build-module: $(TARGET).la $(RLM_UTILS) @[ -d $(top_builddir)/src/modules/lib/.libs ] || mkdir $(top_builddir)/src/modules/lib/.libs for x in .libs/* $^; do \ rm -rf $(top_builddir)/src/modules/lib/$$x; \ ln -s $(WHERE)/$$x $(top_builddir)/src/modules/lib/$$x; \ done $(TARGET).la: $(RLM_SUBDIRS) $(LT_OBJS) $(LIBTOOL) --mode=link --tag=CC $(CC) -release $(RADIUSD_VERSION_STRING) \ -module $(LINK_MODE) $(LDFLAGS) $(RLM_LDFLAGS) -o $@ \ -rpath $(libdir) $^ $(LIBRADIUS) $(RLM_LIBS) $(LIBS) ####################################################################### # # It's a dummy target: don't build it # ####################################################################### else build-module: # if $(TARGET) == "" endif ####################################################################### # # clean and install rules # ####################################################################### clean: @rm -f *.a *.o *.lo *.la *~ @rm -rf .libs _libs @rm -f config.cache config.log config.status $(RLM_UTILS) @[ "x$(RLM_SUBDIRS)" = "x" ] || $(MAKE) $(MFLAGS) WHAT_TO_MAKE=clean common distclean: clean @rm -f config.h config.mak @test -f Makefile.in && rm -f Makefile reconfig: @if [ -f configure.in ]; then \ [ "x$(AUTOCONF)" != "x" ] && $(AUTOCONF) -I $(top_builddir); \ fi @[ "x$(AUTOHEADER)" != "x" ] && [ -f ./configure.in ] && \ if grep AC_CONFIG_HEADERS configure.in >/dev/null; then\ $(AUTOHEADER);\ fi # # Do any module-specific installation. # # If there isn't a TARGET defined, then don't do anything. # Otherwise, install the libraries into $(libdir) # install: @[ "x$(RLM_INSTALL)" = "x" ] || $(MAKE) $(MFLAGS) $(RLM_INSTALL) if [ "x$(TARGET)" != "x" ]; then \ $(LIBTOOL) --mode=install $(INSTALL) -c \ $(TARGET).la $(R)$(libdir)/$(TARGET).la || exit $$?; \ rm -f $(R)$(libdir)/$(TARGET)-$(RADIUSD_VERSION_STRING).la; \ ln -s $(TARGET).la $(R)$(libdir)/$(TARGET)-$(RADIUSD_VERSION_STRING).la || exit $$?; \ fi freeradius-server/src/modules/stable000066400000000000000000000010111257552170400201500ustar00rootroot00000000000000rlm_acctlog rlm_acct_unique rlm_always rlm_attr_filter rlm_attr_rewrite rlm_cache rlm_chap rlm_checkval rlm_copy_packet rlm_counter rlm_dbm rlm_detail rlm_digest rlm_dynamic_clients rlm_eap rlm_exec rlm_expiration rlm_expr rlm_fastusers rlm_files rlm_ippool rlm_krb5 rlm_ldap rlm_linelog rlm_logintime rlm_mschap rlm_ns_mta_md5 rlm_otp rlm_pam rlm_pap rlm_passwd rlm_perl rlm_policy rlm_preprocess rlm_python rlm_radutmp rlm_realm rlm_replicate rlm_soh rlm_sql rlm_sqlcounter rlm_sqlippool rlm_sql_log rlm_unix rlm_wimax freeradius-server/src/tests/000077500000000000000000000000001257552170400164545ustar00rootroot00000000000000freeradius-server/src/tests/.gitignore000066400000000000000000000000471257552170400204450ustar00rootroot00000000000000.cache dictionary test.conf radius.log freeradius-server/src/tests/Makefile000066400000000000000000000060361257552170400201210ustar00rootroot00000000000000# -*- text -*- ## ## Makefile -- Build and run tests for the server. ## ## http://www.freeradius.org/ ## $Id$ ## # include ../../Make.inc TESTS = user_password chap mschapv1 digest-01/digest* test.example.com \ wimax PORT = 12340 ACCTPORT = $(shell expr $(PORT) + 1) # example.com stripped.example.com EAPOL_TEST = eapol_test EAP_TLS_TESTS = eap-ttls-pap.conf eap-mschapv2.conf \ eap-ttls-mschapv2.conf peap-mschapv2.conf SECRET = testing123 .PHONY: all eap dictionary clean # # Build the directory for testing the server # all: tests clean: @rm -f $(top_builddir)/raddb/test.conf test.conf dictionary dictionary: @echo "# test dictionary not install. Delete at any time." > dictionary @echo '$$INCLUDE ' $(top_builddir)/share/dictionary >> dictionary @echo '$$INCLUDE ' $(top_builddir)/src/tests/dictionary.test >> dictionary test.conf: dictionary @echo "# test configuration file. Do not install. Delete at any time." > test.conf @echo "libdir =" $(top_builddir)/src/modules/lib/.libs/ >> test.conf @echo "testdir =" $(top_builddir)/src/tests/ >> test.conf @echo 'dictionary = $${testdir}' >> test.conf @echo 'logdir = $${testdir}' >> test.conf @echo 'radacctdir = $${testdir}' >> test.conf @echo 'pidfile = $${testdir}/radiusd.pid' >> test.conf @echo 'security {' >> $@ @echo ' allow_vulnerable_openssl = yes' >> $@ @echo '}' >> $@ @echo >> $@ @echo '$$INCLUDE radiusd.conf' >> test.conf @echo '$$INCLUDE $${testdir}/config/' >> test.conf radiusd.pid: ../../raddb/test.conf test.conf @$(top_builddir)/src/main/radiusd -txxl `pwd`/radius.log -md $(top_builddir)/raddb/ -n test -i 127.0.0.1 -p $(PORT) || tail -n 20 `pwd`/radius.log # We can't make this depend on radiusd.pid, because then make will create # radiusd.pid when we make radiusd.kill, which we don't want. .PHONY: radiusd.kill radiusd.kill: @if [ -f radiusd.pid ]; then \ (kill -TERM `cat radiusd.pid` >/dev/null 2>&1) || exit 0; \ fi @rm -f radiusd.pid # Link from the main database directory to here $(top_builddir)/raddb/test.conf: test.conf @[ -f $(top_builddir)/raddb/test.conf ] || ln -s $(top_builddir)/src/tests/test.conf $(top_builddir)/raddb/ # kill the server (if it's running) # start the server # run the tests (ignoring any failures) # kill the server # remove the changes to raddb/ tests: $(top_builddir)/raddb/test.conf radiusd.kill @chmod a+x runtests.sh @rm -f radius.log @$(MAKE) radiusd.pid @./runtests.sh $(TESTS) @$(MAKE) radiusd.kill @rm -f $(top_builddir)/raddb/test.conf tests.eap: $(top_builddir)/raddb/test.conf radiusd.kill @chmod a+x runtests.sh @rm -f radius.log @$(MAKE) radiusd.pid @$(MAKE) eap @$(MAKE) radiusd.kill @rm -f $(top_buildir)/raddb/test.conf eap: $(EAP_TLS_TESTS) for x in $(EAP_TLS_TESTS); do \ $(EAPOL_TEST) -c $$x -p $(PORT) -s $(SECRET); \ done md5: $(EAPOL_TEST) -c eap-md5.conf -s $(SECRET) tls: $(EAPOL_TEST) -c eap-ttls-tls.conf -s $(SECRET) ttls: $(EAPOL_TEST) -c eap-ttls-pap.conf -s $(SECRET) peap: $(EAPOL_TEST) -c peap-mschapv2.conf -s $(SECRET) leap: $(EAPOL_TEST) -c leap.conf -s $(SECRET) freeradius-server/src/tests/README000066400000000000000000000002411257552170400173310ustar00rootroot00000000000000 This is a preliminary test harness for the server. $ make tests makes all of the tests config/* virtual server configuration that is used for the tests freeradius-server/src/tests/chap000066400000000000000000000000711257552170400173100ustar00rootroot00000000000000# # TESTS 1 # User-Name = "bob", CHAP-Password := "bob" freeradius-server/src/tests/config/000077500000000000000000000000001257552170400177215ustar00rootroot00000000000000freeradius-server/src/tests/config/test.conf000066400000000000000000000026061257552170400215530ustar00rootroot00000000000000# -*- text -*- ## ## test.conf -- Virtual server configuration for testing radiusd. ## ## $Id$ ## test_port = 10000 realm test.example.com { authhost = 127.0.0.1:${test_port} secret = testing123 } # # This virtual server is chosen for processing requests when using: # # radiusd -Xd src/tests/ -i 127.0.0.1 -p 12340 -n test # server test { listen { type = detail filename = ${radacctdir}/detail load_factor = 10 } listen { ipaddr = 127.0.0.1 port = ${test_port} type = auth } authorize { update reply { Test-Server-Port = "%{Packet-Dst-Port}" } if (User-Name == "bob") { # # Digest-* tests have a password of "zanzibar" # Or, a hashed version thereof. # if (Digest-Response) { if ("%{Test-Number}" == "1") { update control { Cleartext-Password := "zanzibar" } } elsif (Test-Number == "2") { update control { Digest-HA1 := 12af60467a33e8518da5c68bbff12b11 } } } else { update control { Cleartext-Password := "bob" } } } if (User-Name =~ /^(.*)@test\.example\.com$/) { update request { Stripped-User-Name := "%{1}" } update control { Proxy-To-Realm := test.example.com } } chap mschap digest eap pap } authenticate { pap chap mschap digest eap } accounting { if (Packet-Src-IP-Address != 255.255.255.255) { detail } ok } } freeradius-server/src/tests/dictionary.test000066400000000000000000000002721257552170400215230ustar00rootroot00000000000000# # Used for internal testing # VENDOR TEST 32000 BEGIN-VENDOR TEST ATTRIBUTE Test-Name 1 string ATTRIBUTE Test-Number 2 integer ATTRIBUTE Test-Server-Port 3 integer END-VENDOR TEST freeradius-server/src/tests/digest-01/000077500000000000000000000000001257552170400201515ustar00rootroot00000000000000freeradius-server/src/tests/digest-01/digest000066400000000000000000000004261257552170400213550ustar00rootroot00000000000000User-Name = "test", Digest-Response = "631d6d73147add2f9e437f59bbc3aeb7", Digest-Realm = "testrealm", Digest-Nonce = "1234abcd", Digest-Method = "INVITE", Digest-URI = "sip:5555551212@example.com", Digest-Algorithm = "MD5", Digest-User-Name = "test", Message-Authenticator = "" freeradius-server/src/tests/digest-01/digest-auth-MD5000066400000000000000000000012411257552170400226730ustar00rootroot00000000000000# # http://ftp6.us.freebsd.org/pub/rfc/internet-drafts/draft-smith-sipping-auth-examples-01.txt # # Section 3.3 # # # In the "users" file: # # bob Cleartext-Password := "zanzibar" # Or bob Digest-HA1 := "12af60467a33e8518da5c68bbff12b11" # # # # How many tests we have for this input file # # TESTS 1 2 # User-Name = "bob", Digest-Response = "89eb0059246c02b2f6ee02c7961d5ea3", Digest-Realm = "biloxi.com", Digest-Nonce = "dcd98b7102dd2f0e8b11d0f600bfb0c093", Digest-Method = "INVITE", Digest-URI = "sip:bob@biloxi.com", Digest-User-Name = "bob", Digest-QOP = "auth", Digest-Algorithm = "MD5", Digest-Nonce-Count = "00000001", Digest-CNonce = "0a4f113b", freeradius-server/src/tests/digest-01/digest-auth-MD5_Sess000066400000000000000000000011441257552170400236720ustar00rootroot00000000000000# # http://ftp6.us.freebsd.org/pub/rfc/internet-drafts/draft-smith-sipping-auth-examples-01.txt ## # 3.4 # # # In the "users" file: # bob User-Password := "zanzibar" # Or bob Digest-HA1 := "12af60467a33e8518da5c68bbff12b11" # # TESTS 1 2 # User-Name = "bob", Digest-Response = "e4e4ea61d186d07a92c9e1f6919902e9", Digest-Realm = "biloxi.com", Digest-Nonce = "dcd98b7102dd2f0e8b11d0f600bfb0c093", Digest-Method = "INVITE", Digest-URI = "sip:bob@biloxi.com", Digest-User-Name = "bob", Digest-QOP = "auth", Digest-Algorithm = "MD5-Sess", Digest-Nonce-Count = "00000001", Digest-CNonce = "0a4f113b", freeradius-server/src/tests/digest-01/digest-auth-int000066400000000000000000000011601257552170400231000ustar00rootroot00000000000000# # http://ftp6.us.freebsd.org/pub/rfc/internet-drafts/draft-smith-sipping-auth-examples-01.txt # # 3.5.2 # # # In the "users" file: bob Cleartext-Password := "zanzibar" # # TESTS 1 # User-Name = "bob", Digest-Response = "bdbeebb2da6adb6bca02599c2239e192" Digest-Realm = "biloxi.com", Digest-Nonce = "dcd98b7102dd2f0e8b11d0f600bfb0c093", Digest-Method = "INVITE", Digest-URI = "sip:bob@biloxi.com", Digest-Algorithm = "MD5", Digest-User-Name = "bob", Digest-QOP = "auth-int", Digest-Nonce-Count = "00000001", Digest-CNonce = "0a4f113b", Digest-Body-Digest = "c1ed018b8ec4a3b170c0921f5b564e48", Message-Authenticator = "" freeradius-server/src/tests/digest-01/digest-auth-noalgo000066400000000000000000000011001257552170400235570ustar00rootroot00000000000000# # http://ftp6.us.freebsd.org/pub/rfc/internet-drafts/draft-smith-sipping-auth-examples-01.txt # # 3.2 # # In the "users" file: # bob User-Password := "zanzibar" # Or bob Digest-HA1 := "12af60467a33e8518da5c68bbff12b11" # # TESTS 1 # User-Name = "bob", Digest-Response = "89eb0059246c02b2f6ee02c7961d5ea3", Digest-Realm = "biloxi.com", Digest-Nonce = "dcd98b7102dd2f0e8b11d0f600bfb0c093", Digest-Method = "INVITE", Digest-URI = "sip:bob@biloxi.com", Digest-User-Name = "bob", Digest-QOP = "auth", Digest-Nonce-Count = "00000001", Digest-CNonce = "0a4f113b", freeradius-server/src/tests/digest-01/digest-auth_int-MD5000066400000000000000000000012321257552170400235450ustar00rootroot00000000000000# # http://ftp6.us.freebsd.org/pub/rfc/internet-drafts/draft-smith-sipping-auth-examples-01.txt # # 3.5.2 # # In the "users" file: # bob User-Password := "zanzibar" # Or bob Digest-HA1 := "12af60467a33e8518da5c68bbff12b11" # # TESTS 1 2 # User-Name = "bob", Digest-Response = "bdbeebb2da6adb6bca02599c2239e192" Digest-Realm = "biloxi.com", Digest-Nonce = "dcd98b7102dd2f0e8b11d0f600bfb0c093", Digest-Method = "INVITE", Digest-URI = "sip:bob@biloxi.com", Digest-Algorithm = "MD5", Digest-User-Name = "bob", Digest-QOP = "auth-int", Digest-Nonce-Count = "00000001", Digest-CNonce = "0a4f113b", Digest-Body-Digest = "c1ed018b8ec4a3b170c0921f5b564e48", freeradius-server/src/tests/digest-01/digest-auth_int-MD5_Sess000066400000000000000000000012411257552170400245420ustar00rootroot00000000000000# # http://ftp6.us.freebsd.org/pub/rfc/internet-drafts/draft-smith-sipping-auth-examples-01.txt ## # 3.6 # # In the "users" file: # bob User-Password := "zanzibar" # Or bob Digest-HA1 := "12af60467a33e8518da5c68bbff12b11" # # # TESTS 1 2 # User-Name = "bob", Digest-Response = "91984da2d8663716e91554859c22ca70", Digest-Realm = "biloxi.com", Digest-Nonce = "dcd98b7102dd2f0e8b11d0f600bfb0c093", Digest-Method = "INVITE", Digest-URI = "sip:bob@biloxi.com", Digest-User-Name = "bob", Digest-QOP = "auth-int", Digest-Algorithm = "MD5-Sess", Digest-Nonce-Count = "00000001", Digest-CNonce = "0a4f113b", Digest-Body-Digest = "c1ed018b8ec4a3b170c0921f5b564e48", freeradius-server/src/tests/digest-01/digest-auth_int-noalgo000066400000000000000000000012001257552170400244320ustar00rootroot00000000000000# # http://ftp6.us.freebsd.org/pub/rfc/internet-drafts/draft-smith-sipping-auth-examples-01.txt # # 3.5.2 # # In the "users" file: # bob User-Password := "zanzibar" # Or bob Digest-HA1 := "12af60467a33e8518da5c68bbff12b11" # # TESTS 1 2 # User-Name = "bob", Digest-Response = "bdbeebb2da6adb6bca02599c2239e192" Digest-Realm = "biloxi.com", Digest-Nonce = "dcd98b7102dd2f0e8b11d0f600bfb0c093", Digest-Method = "INVITE", Digest-URI = "sip:bob@biloxi.com", Digest-User-Name = "bob", Digest-QOP = "auth-int", Digest-Nonce-Count = "00000001", Digest-CNonce = "0a4f113b", Digest-Body-Digest = "c1ed018b8ec4a3b170c0921f5b564e48", freeradius-server/src/tests/digest-01/digest-md5-sess000066400000000000000000000010331257552170400230060ustar00rootroot00000000000000# # http://ftp6.us.freebsd.org/pub/rfc/internet-drafts/draft-smith-sipping-auth-examples-01.txt # # ?? # # # In the "users" file: bob Cleartext-Password := "zanzibar" # # TESTS 1 # User-name = "bob", Digest-Response = "e4e4ea61d186d07a92c9e1f6919902e9", Digest-Realm = "biloxi.com", Digest-Nonce = "dcd98b7102dd2f0e8b11d0f600bfb0c093", Digest-Method = "INVITE", Digest-URI = "sip:bob@biloxi.com", Digest-Algorithm = "MD5-sess", Digest-User-Name = "bob", Digest-QOP = "auth", Digest-Nonce-Count = "00000001", Digest-CNonce = "0a4f113b" freeradius-server/src/tests/eap-md5.conf000066400000000000000000000002261257552170400205530ustar00rootroot00000000000000# # eapol_test -c eap-md5.conf -s testing123 -n # network={ key_mgmt=NONE eap=MD5 identity="bob" password="hello" } freeradius-server/src/tests/eap-mschapv2.conf000066400000000000000000000002651257552170400216140ustar00rootroot00000000000000# # eapol_test -c eap-mschapv2.conf -s testing123 # network={ ssid="example" key_mgmt=WPA-EAP eap=MSCHAPV2 identity="bob" password="bob" } freeradius-server/src/tests/eap-tls.conf000066400000000000000000000005611257552170400206720ustar00rootroot00000000000000# # eapol_test -c eap-tls.conf -s testing123 # # Set also "nostrip" in raddb/proxy.conf, realm "example.com" # And make it a LOCAL realm. # network={ key_mgmt=WPA-EAP eap=TLS identity="user@example.com" ca_cert="../../raddb/certs/ca.pem" client_cert="../../raddb/certs/client.crt" private_key="../../raddb/certs/client.key" private_key_passwd="whatever" } freeradius-server/src/tests/eap-ttls-eap-mschapv2.conf000066400000000000000000000003771257552170400233470ustar00rootroot00000000000000# # eapol_test -c eap-ttls-mschapv2.conf -s testing123 # network={ ssid="example" key_mgmt=WPA-EAP eap=TTLS identity="bob" anonymous_identity="anonymous" password="bob" phase2="autheap=MSCHAPV2" } freeradius-server/src/tests/eap-ttls-mschapv2.conf000066400000000000000000000003741257552170400226010ustar00rootroot00000000000000# # eapol_test -c eap-ttls-mschapv2.conf -s testing123 # network={ ssid="example" key_mgmt=WPA-EAP eap=TTLS identity="bob" anonymous_identity="anonymous" password="bob" phase2="auth=MSCHAPV2" } freeradius-server/src/tests/eap-ttls-pap.conf000066400000000000000000000003331257552170400216310ustar00rootroot00000000000000# # eapol_test -c eap-ttls-pap.conf -s testing123 # network={ key_mgmt=WPA-EAP eap=TTLS identity="bob" anonymous_identity="anonymous" password="bob" phase2="auth=PAP" } freeradius-server/src/tests/eapcrypto-01/000077500000000000000000000000001257552170400207005ustar00rootroot00000000000000freeradius-server/src/tests/eapcrypto-01/eapcrypto-out.txt000066400000000000000000000044151257552170400242600ustar00rootroot00000000000000SHA1buffer was: 65617073_696d0011_22334455_66771021_32435465_ 76873041_52637485_96a74d6c_40de483a_dd995090_ 2c4024ce_765e0002_00010001 Input was: identity: (len=6)65617073696d nonce_mt: 4d6c40de483add9950902c4024ce765e rand0: 89abcdef89abcdef89abcdef89abcdef rand1: 9abcdef89abcdef89abcdef89abcdef8 rand2: abcdef89abcdef89abcdef89abcdef89 sres0: 1234abcd sres1: 1234abcd sres2: 234abcd1 Kc0: 0011223344556677 Kc1: 1021324354657687 Kc2: 30415263748596a7 versionlist[4]: 00020001 select 00 01 Output mk: d1cdd6d3_574ef82e_c1e83879_559e89f8_de8e6e90 K_aut: 54323970_481b5159_48d00a34_422bbe3c K_encr: 72469fd8_bb6c2a4a_93ac42e5_b4668acb msk: 0a572a3f_2baeea10_640598c9_41901995_f842097a cbb13272_bc949b66_8fb4f5a3_deefed09_3947fe64 c88f7df8_dadcab5f_8d003913_8e9bcff7_1a810316 11eeb959 emsk: 207256b3_9ada49ef_c1850c12_30461921_d700f9f7 83a0f5a9_cff155bd_6c8f1aa5_072b7530_af44f515 3cb983b0_8343effa_2eb161e2_7d3543bc_5bd6db22 993af27b SHA1buffer was: 31323434_30373031_30303030_30303031_40656170_ 73696d2e_666f6fa0_a1a2a3a4_a5a6a7b0_b1b2b3b4_ b5b6b7c0_c1c2c3c4_c5c6c701_23456789_abcdeffe_ dcba9876_54321000_010001 Input was: identity: (len=27)313234343037303130303030303030314065617073696d2e666f6f nonce_mt: 0123456789abcdeffedcba9876543210 rand0: 101112131415161718191a1b1c1d1e1f rand1: 202122232425262728292a2b2c2d2e2f rand2: 303132333435363738393a3b3c3d3e3f sres0: d1d2d3d4 sres1: e1e2e3e4 sres2: f1f2f3f4 Kc0: a0a1a2a3a4a5a6a7 Kc1: b0b1b2b3b4b5b6b7 Kc2: c0c1c2c3c4c5c6c7 versionlist[2]: 0001 select 00 01 Output mk: e576d5ca_332e9930_018bf1ba_ee2763c7_95b3c712 K_aut: 25af1942_efcbf4bc_72b39434_21f2a974 K_encr: 536e5ebc_4465582a_a6a8ec99_86ebb620 msk: 39d45aea_f4e30601_983e972b_6cfd46d1_c3637733 65690d09_cd44976b_525f47d3_a60a985e_955c53b0 90b2e4b7_3719196a_40254296_8fd14a88_8f46b9a7 886e4488 emsk: 5949eab0_fff69d52_315c6c63_4fd14a7f_0d52023d 56f79698_fa6596ab_eed4f93f_bb48eb53_4d985414 ceed0d9a_8ed33c38_7c9dfdab_92ffbdf2_40fcecf6 5a2c93b9 freeradius-server/src/tests/eapmd5-01/000077500000000000000000000000001257552170400200455ustar00rootroot00000000000000freeradius-server/src/tests/eapmd5-01/client.gdb000066400000000000000000000001221257552170400217740ustar00rootroot00000000000000file ../../main/radeapclient set args -s -x localhost auth testing123 About to send encoded packet: User-Name = "eapsim" NAS-IP-Address = marajade.sandelman.ottawa.on.ca EAP-Code = Response EAP-Type-Identity = "eapsim" Message-Authenticator = 0xABCDABCDABCDABCDABCDABCDABCDABCD NAS-Port = 0 EAP-Sim-Rand1 = 0xabcd1234abcd1234abcd1234abcd1234 EAP-Sim-Rand2 = 0xbcd1234abcd1234abcd1234abcd1234a EAP-Sim-Rand3 = 0xcd1234abcd1234abcd1234abcd1234ab EAP-Sim-SRES1 = 0x1234abcd EAP-Sim-SRES2 = 0x234abcd1 EAP-Sim-SRES3 = 0x34abcd12 EAP-Sim-KC1 = 0x0011223344556677 EAP-Sim-KC2 = 0x1021324354657687 EAP-Sim-KC3 = 0x30415263748596a7 Sending Access-Request of id 999 to 127.0.0.1:1812 User-Name = "eapsim" NAS-IP-Address = marajade.sandelman.ottawa.on.ca Message-Authenticator = 0xABCDABCDABCDABCDABCDABCDABCDABCD NAS-Port = 0 EAP-Message = 0x02XX rad_recv: Access-Challenge packet from host 127.0.0.1:1812, id=999, length=78 EAP-Message = 0x01XX Message-Authenticator = 0xABCDABCDABCDABCDABCDABCDABCDABCD State = 0xABCDABCDABCDABCDABCDABCDABCDABCD <+++ EAP decoded packet: EAP-Message = 0x01XX Message-Authenticator = 0xABCDABCDABCDABCDABCDABCDABCDABCD State = 0xABCDABCDABCDABCDABCDABCDABCDABCD EAP-Id = YY EAP-Code = Request EAP-Type-SIM = 0x0a00000f0200020001000011010100 <+++ EAP-sim decoded packet: EAP-Message = 0x01XX Message-Authenticator = 0xABCDABCDABCDABCDABCDABCDABCDABCD State = 0xABCDABCDABCDABCDABCDABCDABCDABCD EAP-Id = YY EAP-Code = Request EAP-Type-SIM = 0x0a00000f0200020001000011010100 EAP-Sim-Subtype = Start EAP-Sim-VERSION_LIST = 0x000200010000 EAP-Sim-FULLAUTH_ID_REQ = 0x0100 +++> About to send encoded packet: User-Name = "eapsim" NAS-IP-Address = marajade.sandelman.ottawa.on.ca EAP-Code = Response Message-Authenticator = 0xABCDABCDABCDABCDABCDABCDABCDABCD NAS-Port = 0 EAP-Sim-Rand1 = 0xabcd1234abcd1234abcd1234abcd1234 EAP-Sim-Rand2 = 0xbcd1234abcd1234abcd1234abcd1234a EAP-Sim-Rand3 = 0xcd1234abcd1234abcd1234abcd1234ab EAP-Sim-SRES1 = 0x1234abcd EAP-Sim-SRES2 = 0x234abcd1 EAP-Sim-SRES3 = 0x34abcd12 EAP-Sim-KC1 = 0x0011223344556677 EAP-Sim-KC2 = 0x1021324354657687 EAP-Sim-KC3 = 0x30415263748596a7 EAP-Sim-State = 1 EAP-Sim-Subtype = Start EAP-Sim-SELECTED_VERSION = 0x0001 EAP-Sim-NONCE_MT = 0x000000a3f6b4e832cf46b4d3e0d090623e22 EAP-Sim-IDENTITY = 0x000665617073696d EAP-Id = YY EAP-Message = 0x02XX State = 0xABCDABCDABCDABCDABCDABCDABCDABCD Sending Access-Request of id 999 to 127.0.0.1:1812 User-Name = "eapsim" NAS-IP-Address = marajade.sandelman.ottawa.on.ca Message-Authenticator = 0xABCDABCDABCDABCDABCDABCDABCDABCD NAS-Port = 0 EAP-Message = 0x02XX State = 0xABCDABCDABCDABCDABCDABCDABCDABCD rad_recv: Access-Challenge packet from host 127.0.0.1:1812, id=999, length=138 EAP-Message = 0x01XX Message-Authenticator = 0xABCDABCDABCDABCDABCDABCDABCDABCD State = 0xABCDABCDABCDABCDABCDABCDABCDABCD <+++ EAP decoded packet: EAP-Message = 0x01XX Message-Authenticator = 0xABCDABCDABCDABCDABCDABCDABCDABCD State = 0xABCDABCDABCDABCDABCDABCDABCDABCD EAP-Id = YY EAP-Code = Request EAP-Type-SIM = 0x0b0000010d0000abcd1234abcd1234abcd1234abcd1234bcd1234abcd1234abcd1234abcd1234acd1234abcd1234abcd1234abcd1234ab0b050000XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX <+++ EAP-sim decoded packet: EAP-Message = 0x01XX Message-Authenticator = 0xABCDABCDABCDABCDABCDABCDABCDABCD State = 0xABCDABCDABCDABCDABCDABCDABCDABCD EAP-Id = YY EAP-Code = Request EAP-Type-SIM = 0x0b0000010d0000abcd1234abcd1234abcd1234abcd1234bcd1234abcd1234abcd1234abcd1234acd1234abcd1234abcd1234abcd1234ab0b050000XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX EAP-Sim-Subtype = Challenge EAP-Sim-RAND = 0x0000abcd1234abcd1234abcd1234abcd1234bcd1234abcd1234abcd1234abcd1234acd1234abcd1234abcd1234abcd1234ab EAP-Sim-MAC = 0xYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY Input was: identity: (len=6)65617073696d nonce_mt: 00a3f6b4e832cf46b4d3e0d090623e22 rand0: 00000000000000000000000000000000 rand1: 00000000000000000000000000000000 rand2: 00000000000000000000000000000000 sres0: 1234abcd sres1: 234abcd1 sres2: 34abcd12 Kc0: 0011223344556677 Kc1: 1021324354657687 Kc2: 30415263748596a7 versionlist[2]: 0001 select 00 01 Output mk: 85153a7d_7dfe0a4f_f3bf72f3_3521ff76_b048dbb2 K_aut: 72cd7e8c_f2086e24_a98c1780_bc3d745b K_encr: be789668_329769c3_73c0b64b_beffd665 msk: 9be9fbc9_5415fa9e_f9d52563_bddd9758_65a3fadb 47a5815a_7310cf3f_10123d4e_ccaf9d4b_30b13c80 4dd130e5_117f35ae_a0e50b43_9a08b80d_dd15922c f7fd9956 emsk: 5dd5a779_65415b21_69aa1300_09dc6ba4_96433d1e 72065983_cbe8bc1d_6d744c99_dc76f16f_24324709 cb731af2_fbe69c6a_dd302662_a083d7e2_7c05c7cd 279c3f66 MAC check succeed +++> About to send encoded packet: User-Name = "eapsim" NAS-IP-Address = marajade.sandelman.ottawa.on.ca EAP-Code = Response Message-Authenticator = 0xABCDABCDABCDABCDABCDABCDABCDABCD NAS-Port = 0 EAP-Sim-Rand1 = 0xabcd1234abcd1234abcd1234abcd1234 EAP-Sim-Rand2 = 0xbcd1234abcd1234abcd1234abcd1234a EAP-Sim-Rand3 = 0xcd1234abcd1234abcd1234abcd1234ab EAP-Sim-SRES1 = 0x1234abcd EAP-Sim-SRES2 = 0x234abcd1 EAP-Sim-SRES3 = 0x34abcd12 EAP-Sim-KC1 = 0x0011223344556677 EAP-Sim-KC2 = 0x1021324354657687 EAP-Sim-KC3 = 0x30415263748596a7 EAP-Sim-State = 1 EAP-Sim-Subtype = Challenge EAP-Id = YY State = 0xABCDABCDABCDABCDABCDABCDABCDABCD EAP-Sim-MAC = 0x1234abcd234abcd134abcd12 EAP-Sim-KEY = 0x72cd7e8cf2086e24a98c1780bc3d745b EAP-Message = 0x02XX Sending Access-Request of id 999 to 127.0.0.1:1812 User-Name = "eapsim" NAS-IP-Address = marajade.sandelman.ottawa.on.ca Message-Authenticator = 0xABCDABCDABCDABCDABCDABCDABCDABCD NAS-Port = 0 State = 0xABCDABCDABCDABCDABCDABCDABCDABCD EAP-Message = 0x02XX rad_recv: Access-Accept packet from host 127.0.0.1:1812, id=999, length=168 MS-MPPE-Recv-Key = 0x9be9fbc95415fa9ef9d52563bddd975865a3fadb47a5815a7310cf3f10123d4e MS-MPPE-Send-Key = 0xccaf9d4b30b13c804dd130e5117f35aea0e50b439a08b80ddd15922cf7fd9956 EAP-Message = 0x03XX Message-Authenticator = 0xABCDABCDABCDABCDABCDABCDABCDABCD User-Name = "eapsim" <+++ EAP decoded packet: MS-MPPE-Recv-Key = 0x9be9fbc95415fa9ef9d52563bddd975865a3fadb47a5815a7310cf3f10123d4e MS-MPPE-Send-Key = 0xccaf9d4b30b13c804dd130e5117f35aea0e50b439a08b80ddd15922cf7fd9956 EAP-Message = 0x03XX Message-Authenticator = 0xABCDABCDABCDABCDABCDABCDABCDABCD User-Name = "eapsim" EAP-Id = YY EAP-Code = Success freeradius-server/src/tests/eapsim-03/eapsim-in.txt000066400000000000000000000007551257552170400226040ustar00rootroot00000000000000User-Name = "eapsim" NAS-IP-Address = marajade.sandelman.ottawa.on.ca EAP-Code = Response EAP-Type-Identity = "eapsim" Message-Authenticator = 0 NAS-Port = 0 EAP-Sim-Rand1 = 0xabcd1234abcd1234abcd1234abcd1234 EAP-Sim-Rand2 = 0xbcd1234abcd1234abcd1234abcd1234a EAP-Sim-Rand3 = 0xcd1234abcd1234abcd1234abcd1234ab EAP-Sim-Sres1 = 0x1234abcd EAP-Sim-Sres2 = 0x234abcd1 EAP-Sim-Sres3 = 0x34abcd12 EAP-Sim-KC1 = 0x0011223344556677 EAP-Sim-KC2 = 0x1021324354657687 EAP-Sim-KC3 = 0x30415263748596a7 freeradius-server/src/tests/eapsim-03/eapsim-out.txt000066400000000000000000000144221257552170400230010ustar00rootroot00000000000000 +++> About to send encoded packet: User-Name = "eapsim" NAS-IP-Address = marajade.sandelman.ottawa.on.ca EAP-Code = Response EAP-Type-Identity = "eapsim" Message-Authenticator = 0xABCDABCDABCDABCDABCDABCDABCDABCD NAS-Port = 0 EAP-Sim-Rand1 = 0xabcd1234abcd1234abcd1234abcd1234 EAP-Sim-Rand2 = 0xbcd1234abcd1234abcd1234abcd1234a EAP-Sim-Rand3 = 0xcd1234abcd1234abcd1234abcd1234ab EAP-Sim-SRES1 = 0x1234abcd EAP-Sim-SRES2 = 0x234abcd1 EAP-Sim-SRES3 = 0x34abcd12 EAP-Sim-KC1 = 0x0011223344556677 EAP-Sim-KC2 = 0x1021324354657687 EAP-Sim-KC3 = 0x30415263748596a7 Sending Access-Request of id 999 to 127.0.0.1:1812 User-Name = "eapsim" NAS-IP-Address = marajade.sandelman.ottawa.on.ca Message-Authenticator = 0xABCDABCDABCDABCDABCDABCDABCDABCD NAS-Port = 0 EAP-Message = 0x02XX rad_recv: Access-Challenge packet from host 127.0.0.1:1812, id=999, length=78 EAP-Message = 0x01XX Message-Authenticator = 0xABCDABCDABCDABCDABCDABCDABCDABCD State = 0xABCDABCDABCDABCDABCDABCDABCDABCD <+++ EAP decoded packet: EAP-Message = 0x01XX Message-Authenticator = 0xABCDABCDABCDABCDABCDABCDABCDABCD State = 0xABCDABCDABCDABCDABCDABCDABCDABCD EAP-Id = YY EAP-Code = Request EAP-Type-SIM = 0x0a00000f0200020001000011010100 <+++ EAP-sim decoded packet: EAP-Message = 0x01XX Message-Authenticator = 0xABCDABCDABCDABCDABCDABCDABCDABCD State = 0xABCDABCDABCDABCDABCDABCDABCDABCD EAP-Id = YY EAP-Code = Request EAP-Type-SIM = 0x0a00000f0200020001000011010100 EAP-Sim-Subtype = Start EAP-Sim-VERSION_LIST = 0x000200010000 EAP-Sim-FULLAUTH_ID_REQ = 0x0100 +++> About to send encoded packet: User-Name = "eapsim" NAS-IP-Address = marajade.sandelman.ottawa.on.ca EAP-Code = Response Message-Authenticator = 0xABCDABCDABCDABCDABCDABCDABCDABCD NAS-Port = 0 EAP-Sim-Rand1 = 0xabcd1234abcd1234abcd1234abcd1234 EAP-Sim-Rand2 = 0xbcd1234abcd1234abcd1234abcd1234a EAP-Sim-Rand3 = 0xcd1234abcd1234abcd1234abcd1234ab EAP-Sim-SRES1 = 0x1234abcd EAP-Sim-SRES2 = 0x234abcd1 EAP-Sim-SRES3 = 0x34abcd12 EAP-Sim-KC1 = 0x0011223344556677 EAP-Sim-KC2 = 0x1021324354657687 EAP-Sim-KC3 = 0x30415263748596a7 EAP-Sim-State = 1 EAP-Sim-Subtype = Start EAP-Sim-SELECTED_VERSION = 0x0001 EAP-Sim-NONCE_MT = 0x000000a3f6b4e832cf46b4d3e0d090623e22 EAP-Sim-IDENTITY = 0x000665617073696d EAP-Id = YY EAP-Message = 0x02XX State = 0xABCDABCDABCDABCDABCDABCDABCDABCD Sending Access-Request of id 999 to 127.0.0.1:1812 User-Name = "eapsim" NAS-IP-Address = marajade.sandelman.ottawa.on.ca Message-Authenticator = 0xABCDABCDABCDABCDABCDABCDABCDABCD NAS-Port = 0 EAP-Message = 0x02XX State = 0xABCDABCDABCDABCDABCDABCDABCDABCD rad_recv: Access-Challenge packet from host 127.0.0.1:1812, id=999, length=138 EAP-Message = 0x01XX Message-Authenticator = 0xABCDABCDABCDABCDABCDABCDABCDABCD State = 0xABCDABCDABCDABCDABCDABCDABCDABCD <+++ EAP decoded packet: EAP-Message = 0x01XX Message-Authenticator = 0xABCDABCDABCDABCDABCDABCDABCDABCD State = 0xABCDABCDABCDABCDABCDABCDABCDABCD EAP-Id = YY EAP-Code = Request EAP-Type-SIM = 0x0b0000010d0000abcd1234abcd1234abcd1234abcd1234bcd1234abcd1234abcd1234abcd1234acd1234abcd1234abcd1234abcd1234ab0b050000XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX <+++ EAP-sim decoded packet: EAP-Message = 0x01XX Message-Authenticator = 0xABCDABCDABCDABCDABCDABCDABCDABCD State = 0xABCDABCDABCDABCDABCDABCDABCDABCD EAP-Id = YY EAP-Code = Request EAP-Type-SIM = 0x0b0000010d0000abcd1234abcd1234abcd1234abcd1234bcd1234abcd1234abcd1234abcd1234acd1234abcd1234abcd1234abcd1234ab0b050000XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX EAP-Sim-Subtype = Challenge EAP-Sim-RAND = 0x0000abcd1234abcd1234abcd1234abcd1234bcd1234abcd1234abcd1234abcd1234acd1234abcd1234abcd1234abcd1234ab EAP-Sim-MAC = 0xYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY Input was: identity: (len=6)65617073696d nonce_mt: 00a3f6b4e832cf46b4d3e0d090623e22 rand0: 00000000000000000000000000000000 rand1: 00000000000000000000000000000000 rand2: 00000000000000000000000000000000 sres0: 1234abcd sres1: 234abcd1 sres2: 34abcd12 Kc0: 0011223344556677 Kc1: 1021324354657687 Kc2: 30415263748596a7 versionlist[2]: 0001 select 00 01 Output mk: 85153a7d_7dfe0a4f_f3bf72f3_3521ff76_b048dbb2 K_aut: 72cd7e8c_f2086e24_a98c1780_bc3d745b K_encr: be789668_329769c3_73c0b64b_beffd665 msk: 9be9fbc9_5415fa9e_f9d52563_bddd9758_65a3fadb 47a5815a_7310cf3f_10123d4e_ccaf9d4b_30b13c80 4dd130e5_117f35ae_a0e50b43_9a08b80d_dd15922c f7fd9956 emsk: 5dd5a779_65415b21_69aa1300_09dc6ba4_96433d1e 72065983_cbe8bc1d_6d744c99_dc76f16f_24324709 cb731af2_fbe69c6a_dd302662_a083d7e2_7c05c7cd 279c3f66 MAC check succeed +++> About to send encoded packet: User-Name = "eapsim" NAS-IP-Address = marajade.sandelman.ottawa.on.ca EAP-Code = Response Message-Authenticator = 0xABCDABCDABCDABCDABCDABCDABCDABCD NAS-Port = 0 EAP-Sim-Rand1 = 0xabcd1234abcd1234abcd1234abcd1234 EAP-Sim-Rand2 = 0xbcd1234abcd1234abcd1234abcd1234a EAP-Sim-Rand3 = 0xcd1234abcd1234abcd1234abcd1234ab EAP-Sim-SRES1 = 0x1234abcd EAP-Sim-SRES2 = 0x234abcd1 EAP-Sim-SRES3 = 0x34abcd12 EAP-Sim-KC1 = 0x0011223344556677 EAP-Sim-KC2 = 0x1021324354657687 EAP-Sim-KC3 = 0x30415263748596a7 EAP-Sim-State = 1 EAP-Sim-Subtype = Challenge EAP-Id = YY State = 0xABCDABCDABCDABCDABCDABCDABCDABCD EAP-Sim-MAC = 0x1234abcd234abcd134abcd12 EAP-Sim-KEY = 0x72cd7e8cf2086e24a98c1780bc3d745b EAP-Message = 0x02XX Sending Access-Request of id 999 to 127.0.0.1:1812 User-Name = "eapsim" NAS-IP-Address = marajade.sandelman.ottawa.on.ca Message-Authenticator = 0xABCDABCDABCDABCDABCDABCDABCDABCD NAS-Port = 0 State = 0xABCDABCDABCDABCDABCDABCDABCDABCD EAP-Message = 0x02XX rad_recv: Access-Accept packet from host 127.0.0.1:1812, id=999, length=168 MS-MPPE-Recv-Key = 0x9be9fbc95415fa9ef9d52563bddd975865a3fadb47a5815a7310cf3f10123d4e MS-MPPE-Send-Key = 0xccaf9d4b30b13c804dd130e5117f35aea0e50b439a08b80ddd15922cf7fd9956 EAP-Message = 0x03XX Message-Authenticator = 0xABCDABCDABCDABCDABCDABCDABCDABCD User-Name = "eapsim" <+++ EAP decoded packet: MS-MPPE-Recv-Key = 0x9be9fbc95415fa9ef9d52563bddd975865a3fadb47a5815a7310cf3f10123d4e MS-MPPE-Send-Key = 0xccaf9d4b30b13c804dd130e5117f35aea0e50b439a08b80ddd15922cf7fd9956 EAP-Message = 0x03XX Message-Authenticator = 0xABCDABCDABCDABCDABCDABCDABCDABCD User-Name = "eapsim" EAP-Id = YY EAP-Code = Success freeradius-server/src/tests/eapsim-03/eapsim-sanitize.sed000066400000000000000000000026221257552170400237530ustar00rootroot00000000000000s/\(Sending Access-Request of id\).*\(to 127.0.0.1:1812\)/\1 999 \2/ s/\(Message-Authenticator = 0x\).*/\1ABCDABCDABCDABCDABCDABCDABCDABCD/ s/\(State = 0x\).*/\1ABCDABCDABCDABCDABCDABCDABCDABCD/ s/\(rad_recv: Access-Challenge packet from host 127.0.0.1:1812, id\)=.*,\( length=.*\)/\1=999,\2/ s/\(rad_recv: Access-Accept packet from host 127.0.0.1:1812, id\)=.*,\( length=.*\)/\1=999,\2/ s/\(EAP-Message = 0x..\)\(.*\)/\1XX/ s/\(EAP-Id = \).*/\1YY/ s/\(EAP-Type-MD5 = \).*/\1MD5/ s/\(EAP-Type-SIM = 0x0b0000010d0000abcd1234abcd1234abcd1234abcd1234bcd1234abcd1234abcd1234abcd1234acd1234abcd1234abcd1234abcd1234ab0b050000\)................................/\1XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/ s/\(EAP-Type-SIM = 0x0b0000010d0000101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f0b050000\)................................/\1XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/ s/\(EAP-Type-SIM = 0x0b0000010d00003000000000000000000000000000000031000000000000000000000000000000320000000000000000000000000000000b050000\)................................/\1XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/ s/\(EAP-Sim-MAC = 0x\)..................................../\1YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY/ s/DATA: (96) 01../DATA: (96) 01YY/ s/DATA: (40) 02../DATA: (40) 02YY/ s/hmac-sha1 mac(20): ........_........_........_........_......../hmac-sha1 mac(20): XXXXXXXX_XXXXXXXX_XXXXXXXX_XXXXXXXX_XXXXXXXX/ freeradius-server/src/tests/eapsim-03/radiusd-example.txt000066400000000000000000001344241257552170400240070ustar00rootroot00000000000000## ## radiusd.conf -- FreeRADIUS server configuration file. ## ## http://www.freeradius.org/ ## $Id$ ## # This is the radiusd.conf file used for testing EAP-SIM stuff. # # # The location of other config files and # logfiles are declared in this file # # Also general configuration for modules can be done # in this file, it is exported through the API to # modules that ask for it. # # The configuration variables defined here are of the form ${foo} # They are local to this file, and do not change from request to # request. # # The per-request variables are of the form %{Attribute-Name}, and # are taken from the values of the attribute in the incoming # request. See 'doc/variables.txt' for more information. prefix = /elros/mcr/root exec_prefix = ${prefix} sysconfdir = ${prefix}/etc localstatedir = ${prefix}/var sbindir = ${exec_prefix}/sbin logdir = ${localstatedir}/log/radius raddbdir = ${sysconfdir}/raddb radacctdir = ${logdir}/radacct # Location of config and logfiles. confdir = ${raddbdir} run_dir = ${localstatedir}/run/radiusd # # The logging messages for the server are appended to the # tail of this file. # log_file = ${logdir}/radius.log # # libdir: Where to find the rlm_* modules. # # This should be automatically set at configuration time. # # If the server builds and installs, but fails at execution time # with an 'undefined symbol' error, then you can use the libdir # directive to work around the problem. # # The cause is usually that a library has been installed on your # system in a place where the dynamic linker CANNOT find it. When # executing as root (or another user), your personal environment MAY # be set up to allow the dynamic linker to find the library. When # executing as a daemon, FreeRADIUS MAY NOT have the same # personalized configuration. # # To work around the problem, find out which library contains that symbol, # and add the directory containing that library to the end of 'libdir', # with a colon separating the directory names. NO spaces are allowed. # # e.g. libdir = /usr/local/lib:/opt/package/lib # # You can also try setting the LD_LIBRARY_PATH environment variable # in a script which starts the server. # # If that does not work, then you can re-configure and re-build the # server to NOT use shared libraries, via: # # ./configure --disable-shared # make # make install # libdir = ${exec_prefix}/lib # pidfile: Where to place the PID of the RADIUS server. # # The server may be signalled while it's running by using this # file. # # This file is written when ONLY running in daemon mode. # # e.g.: kill -HUP `cat /var/run/radiusd/radiusd.pid` # pidfile = ${run_dir}/radiusd.pid # user/group: The name (or #number) of the user/group to run radiusd as. # # If these are commented out, the server will run as the user/group # that started it. In order to change to a different user/group, you # MUST be root ( or have root privleges ) to start the server. # # We STRONGLY recommend that you run the server with as few permissions # as possible. That is, if you're not using shadow passwords, the # user and group items below should be set to 'nobody'. # # On SCO (ODT 3) use "user = nouser" and "group = nogroup". # # NOTE that some kernels refuse to setgid(group) when the value of # (unsigned)group is above 60000; don't use group nobody on these systems! # # On systems with shadow passwords, you might have to set 'group = shadow' # for the server to be able to read the shadow password file. If you can # authenticate users while in debug mode, but not in daemon mode, it may be # that the debugging mode server is running as a user that can read the # shadow info, and the user listed below can not. # #user = nobody #group = nobody # max_request_time: The maximum time (in seconds) to handle a request. # # Requests which take more time than this to process may be killed, and # a REJECT message is returned. # # WARNING: If you notice that requests take a long time to be handled, # then this MAY INDICATE a bug in the server, in one of the modules # used to handle a request, OR in your local configuration. # # This problem is most often seen when using an SQL database. If it takes # more than a second or two to receive an answer from the SQL database, # then it probably means that you haven't indexed the database. See your # SQL server documentation for more information. # # Useful range of values: 5 to 120 # max_request_time = 30 # cleanup_delay: The time to wait (in seconds) before cleaning up # a reply which was sent to the NAS. # # The RADIUS request is normally cached internally for a short period # of time, after the reply is sent to the NAS. The reply packet may be # lost in the network, and the NAS will not see it. The NAS will then # re-send the request, and the server will respond quickly with the # cached reply. # # If this value is set too low, then duplicate requests from the NAS # MAY NOT be detected, and will instead be handled as seperate requests. # # If this value is set too high, then the server will cache too many # requests, and some new requests may get blocked. (See 'max_requests'.) # # Useful range of values: 2 to 10 # cleanup_delay = 5 # max_requests: The maximum number of requests which the server keeps # track of. This should be 256 multiplied by the number of clients. # e.g. With 4 clients, this number should be 1024. # # If this number is too low, then when the server becomes busy, # it will not respond to any new requests, until the 'cleanup_delay' # time has passed, and it has removed the old requests. # # If this number is set too high, then the server will use a bit more # memory for no real benefit. # # If you aren't sure what it should be set to, it's better to set it # too high than too low. Setting it to 1000 per client is probably # the highest it should be. # # Useful range of values: 256 to infinity # max_requests = 1024 # bind_address: Make the server listen on a particular IP address, and # send replies out from that address. This directive is most useful # for machines with multiple IP addresses on one interface. # # It can either contain "*", or an IP address, or a fully qualified # Internet domain name. The default is "*" # bind_address = * # port: Allows you to bind FreeRADIUS to a specific port. # # The default port that most NAS boxes use is 1645, which is historical. # RFC 2138 defines 1812 to be the new port. Many new servers and # NAS boxes use 1812, which can create interoperability problems. # # The port is defined here to be 0 so that the server will pick up # the machine's local configuration for the radius port, as defined # in /etc/services. # # If you want to use the default RADIUS port as defined on your server, # (usually through 'grep radius /etc/services') set this to 0 (zero). # # A port given on the command-line via '-p' over-rides this one. # port = 0 # hostname_lookups: Log the names of clients or just their IP addresses # e.g., www.freeradius.org (on) or 206.47.27.232 (off). # # The default is 'off' because it would be overall better for the net # if people had to knowingly turn this feature on, since enabling it # means that each client request will result in AT LEAST one lookup # request to the nameserver. Enabling hostname_lookups will also # mean that your server may stop randomly for 30 seconds from time # to time, if the DNS requests take too long. # # Turning hostname lookups off also means that the server won't block # for 30 seconds, if it sees an IP address which has no name associated # with it. # # allowed values: {no, yes} # hostname_lookups = no # Core dumps are a bad thing. This should only be set to 'yes' # if you're debugging a problem with the server. # # allowed values: {no, yes} # allow_core_dumps = yes # Regular expressions # # These items are set at configure time. If they're set to "yes", # then setting them to "no" turns off regular expression support. # # If they're set to "no" at configure time, then setting them to "yes" # WILL NOT WORK. It will give you an error. # regular_expressions = yes extended_expressions = yes # Log the full User-Name attribute, as it was found in the request. # # allowed values: {no, yes} # log_stripped_names = no # Log authentication requests to the log file. # # allowed values: {no, yes} # log_auth = no # Log passwords with the authentication requests. # log_auth_badpass - logs password if it's rejected # log_auth_goodpass - logs password if it's correct # # allowed values: {no, yes} # log_auth_badpass = no log_auth_goodpass = no # usercollide: Turn "username collision" code on and off. See the # "doc/duplicate-users" file # usercollide = no # lower_user / lower_pass: # Lower case the username/password "before" or "after" # attempting to authenticate. # # If "before", the server will first modify the request and then try # to auth the user. If "after", the server will first auth using the # values provided by the user. If that fails it will reprocess the # request after modifying it as you specify below. # # This is as close as we can get to case insensitivity. It is the # admin's job to ensure that the username on the auth db side is # *also* lowercase to make this work # # Default is 'no' (don't lowercase values) # Valid values = "before" / "after" / "no" # lower_user = no lower_pass = no # nospace_user / nospace_pass: # # Some users like to enter spaces in their username or password # incorrectly. To save yourself the tech support call, you can # eliminate those spaces here: # # Default is 'no' (don't remove spaces) # Valid values = "before" / "after" / "no" (explanation above) # nospace_user = no nospace_pass = no # The program to execute to do concurrency checks. checkrad = ${sbindir}/checkrad # SECURITY CONFIGURATION # # There may be multiple methods of attacking on the server. This # section holds the configuration items which minimize the impact # of those attacks # security { # # max_attributes: The maximum number of attributes # permitted in a RADIUS packet. Packets which have MORE # than this number of attributes in them will be dropped. # # If this number is set too low, then no RADIUS packets # will be accepted. # # If this number is set too high, then an attacker may be # able to send a small number of packets which will cause # the server to use all available memory on the machine. # # Setting this number to 0 means "allow any number of attributes" max_attributes = 200 # # reject_delay: When sending an Access-Reject, it can be # delayed for a few seconds. This may help slow down a DoS # attack. It also helps to slow down people trying to brute-force # crack a users password. # # Setting this number to 0 means "send rejects immediately" # # If this number is set higher than 'cleanup_delay', then the # rejects will be sent at 'cleanup_delay' time, when the request # is deleted from the internal cache of requests. # # Useful ranges: 1 to 5 reject_delay = 1 # # status_server: Whether or not the server will respond # to Status-Server requests. # # Normally this should be set to "no", because they're useless. # See: http://www.freeradius.org/rfc/rfc2865.html#Keep-Alives # # However, certain NAS boxes may require them. # # When sent a Status-Server message, the server responds with # and Access-Accept packet, containing a Reply-Message attribute, # which is a string describing how long the server has been # running. # status_server = no } # PROXY CONFIGURATION # # proxy_requests: Turns proxying of RADIUS requests on or off. # # The server has proxying turned on by default. If your system is NOT # set up to proxy requests to another server, then you can turn proxying # off here. This will save a small amount of resources on the server. # # If you have proxying turned off, and your configuration files say # to proxy a request, then an error message will be logged. # # To disable proxying, change the "yes" to "no", and comment the # $INCLUDE line. # # allowed values: {no, yes} # proxy_requests = yes $INCLUDE ${confdir}/proxy.conf # CLIENTS CONFIGURATION # # Client configuration is defined in "clients.conf". # # The 'clients.conf' file contains all of the information from the old # 'clients' and 'naslist' configuration files. We recommend that you # do NOT use 'client's or 'naslist', although they are still # supported. # # Anything listed in 'clients.conf' will take precedence over the # information from the old-style configuration files. # $INCLUDE ${confdir}/clients.conf # SNMP CONFIGURATION # # Snmp configuration is only valid if SNMP support was enabled # at compile time. # # To enable SNMP querying of the server, set the value of the # 'snmp' attribute to 'yes' # snmp = no $INCLUDE ${confdir}/snmp.conf # THREAD POOL CONFIGURATION # # The thread pool is a long-lived group of threads which # take turns (round-robin) handling any incoming requests. # # You probably want to have a few spare threads around, # so that high-load situations can be handled immediately. If you # don't have any spare threads, then the request handling will # be delayed while a new thread is created, and added to the pool. # # You probably don't want too many spare threads around, # otherwise they'll be sitting there taking up resources, and # not doing anything productive. # # The numbers given below should be adequate for most situations. # thread pool { # Number of servers to start initially --- should be a reasonable # ballpark figure. start_servers = 5 # Limit on the total number of servers running. # # If this limit is ever reached, clients will be LOCKED OUT, so it # should NOT BE SET TOO LOW. It is intended mainly as a brake to # keep a runaway server from taking the system with it as it spirals # down... # # You may find that the server is regularly reaching the # 'max_servers' number of threads, and that increasing # 'max_servers' doesn't seem to make much difference. # # If this is the case, then the problem is MOST LIKELY that # your back-end databases are taking too long to respond, and # are preventing the server from responding in a timely manner. # # The solution is NOT do keep increasing the 'max_servers' # value, but instead to fix the underlying cause of the # problem: slow database, or 'hostname_lookups=yes'. # # For more information, see 'max_request_time', above. # max_servers = 32 # Server-pool size regulation. Rather than making you guess # how many servers you need, FreeRADIUS dynamically adapts to # the load it sees, that is, it tries to maintain enough # servers to handle the current load, plus a few spare # servers to handle transient load spikes. # # It does this by periodically checking how many servers are # waiting for a request. If there are fewer than # min_spare_servers, it creates a new spare. If there are # more than max_spare_servers, some of the spares die off. # The default values are probably OK for most sites. # min_spare_servers = 3 max_spare_servers = 10 # There may be memory leaks or resource allocation problems with # the server. If so, set this value to 300 or so, so that the # resources will be cleaned up periodically. # # This should only be necessary if there are serious bugs in the # server which have not yet been fixed. # # '0' is a special value meaning 'infinity', or 'the servers never # exit' max_requests_per_server = 0 } # MODULE CONFIGURATION # # The names and configuration of each module is located in this section. # # After the modules are defined here, they may be referred to by name, # in other sections of this configuration file. # modules { # # Each module has a configuration as follows: # # name [ instance ] { # config_item = value # ... # } # # The 'name' is used to load the 'rlm_name' library # which implements the functionality of the module. # # The 'instance' is optional. To have two different instances # of a module, it first must be referred to by 'name'. # The different copies of the module are then created by # inventing two 'instance' names, e.g. 'instance1' and 'instance2' # # The instance names can then be used in later configuration # INSTEAD of the original 'name'. See the 'radutmp' configuration # below for an example. # # PAP module to authenticate users based on their stored password # # Supports multiple encryption schemes # clear: Clear text # crypt: Unix crypt # md5: MD5 ecnryption # sha1: SHA1 encryption. # DEFAULT: crypt pap { encryption_scheme = crypt } # CHAP module # # To authenticate requests containing a CHAP-Password attribute. # chap { authtype = CHAP } # Pluggable Authentication Modules # # For Linux, see: # http://www.kernel.org/pub/linux/libs/pam/index.html # pam { # # The name to use for PAM authentication. # PAM looks in /etc/pam.d/${pam_auth_name} # for it's configuration. See 'redhat/radiusd-pam' # for a sample PAM configuration file. # # Note that any Pam-Auth attribute set in the 'authorize' # section will over-ride this one. # pam_auth = radiusd } # Unix /etc/passwd style authentication # unix { # # Cache /etc/passwd, /etc/shadow, and /etc/group # # The default is to NOT cache them. # # For FreeBSD, you do NOT want to enable the cache, # as it's password lookups are done via a database, so # set this value to 'no'. # # Some systems (e.g. RedHat Linux with pam_pwbd) can # take *seconds* to check a password, from a passwd # file containing 1000's of entries. For those systems, # you should set the cache value to 'yes', and set # the locations of the 'passwd', 'shadow', and 'group' # files, below. # # allowed values: {no, yes} cache = no # Reload the cache every 600 seconds (10mins). 0 to disable. cache_reload = 600 # # Define the locations of the normal passwd, shadow, and # group files. # # 'shadow' is commented out by default, because not all # systems have shadow passwords. # # To force the module to use the system password functions, # instead of reading the files, leave the following entries # commented out. # # This is required for some systems, like FreeBSD, # and Mac OSX. # # passwd = /etc/passwd # shadow = /etc/shadow # group = /etc/group # # Where the 'wtmp' file is located. # This should be moved to it's own module soon. # # The only use for 'radlast'. If you don't use # 'radlast', then you can comment out this item. # radwtmp = ${logdir}/radwtmp } # Extensible Authentication Protocol # # For all EAP related authentications eap { # Invoke the default supported EAP type when # EAP-Identity response is received. # # The incoming EAP messages MAY NOT specify which EAP # type they will be using, so it MUST be set here. # # For now, only one default EAP type may be used at a time. # default_eap_type = md5 # Default expiry time to clean the EAP list, # It is maintained to correlate the # EAP-response for each EAP-request sent. timer_expire = 60 # Supported EAP-types md5 { } sim { } # Cisco LEAP # # Cisco LEAP uses the MS-CHAP algorithm (but not # the MS-CHAP attributes) to perform it's authentication. # # As a result, LEAP *requires* access to the plain-text # User-Password, or the NT-Password attributes. # 'System' authentication is impossible with LEAP. # leap { } ## EAP-TLS is highly experimental EAP-Type at the moment. # Please give feedback on the mailing list. #tls { # private_key_password = password # private_key_file = /path/filename # If Private key & Certificate are located in the # same file, then private_key_file & certificate_file # must contain the same file name. # certificate_file = /path/filename # Trusted Root CA list #CA_file = /path/filename # dh_file = /path/filename #random_file = /path/filename # # This can never exceed MAX_RADIUS_LEN (4096) # preferably half the MAX_RADIUS_LEN, to # accomodate other attributes in RADIUS packet. # On most APs the MAX packet length is configured # between 1500 - 1600. In these cases, fragment # size should be <= 1024. # # fragment_size = 1024 # include_length is a flag which is by default set to yes # If set to yes, Total Length of the message is included # in EVERY packet we send. # If set to no, Total Length of the message is included # ONLY in the First packet of a fragment series. # # include_length = yes #} } # Microsoft CHAP authentication # # This module supports MS-CHAP and MS-CHAPv2 authentication. # It also enforces the SMB-Account-Ctrl attribute. # mschap { # # As of 0.9, the mschap module does NOT support # reading from /etc/smbpasswd. # # If you are using /etc/smbpasswd, see the 'passwd' # module for an example of how to use /etc/smbpasswd # authtype value, if present, will be used # to overwrite (or add) Auth-Type during # authorization. Normally should be MS-CHAP authtype = MS-CHAP # if use_mppe is not set to no mschap will # add MS-CHAP-MPPE-Keys for MS-CHAPv1 and # MS-MPPE-Recv-Key/MS-MPPE-Send-Key for MS-CHAPv2 # use_mppe = no # if mppe is enabled require_encryption makes # encryption moderate # require_encryption = yes # require_strong always requires 128 bit key # encryption # require_strong = yes } # Lightweight Directory Access Protocol (LDAP) # # This module definition allows you to use LDAP for # authorization and authentication (Auth-Type := LDAP) # # See doc/rlm_ldap for description of configuration options # and sample authorize{} and authenticate{} blocks ldap { server = "ldap.your.domain" # identity = "cn=admin,o=My Org,c=UA" # password = mypass basedn = "o=My Org,c=UA" filter = "(uid=%{Stripped-User-Name:-%{User-Name}})" # set this to 'yes' to use TLS encrypted connections # to the LDAP database by using the StartTLS extended # operation. # The StartTLS operation is supposed to be used with normal # ldap connections instead of using ldaps (port 689) connections start_tls = no # default_profile = "cn=radprofile,ou=dialup,o=My Org,c=UA" # profile_attribute = "radiusProfileDn" access_attr = "dialupAccess" # Mapping of RADIUS dictionary attributes to LDAP # directory attributes. dictionary_mapping = ${raddbdir}/ldap.attrmap ldap_connections_number = 5 # password_header = "{clear}" # password_attribute = userPassword # groupname_attribute = cn # groupmembership_filter = "(|(&(objectClass=GroupOfNames)(member=%{Ldap-UserDn}))(&(objectClass=GroupOfUniqueNames)(uniquemember=%{Ldap-UserDn})))" # groupmembership_attribute = radiusGroupName timeout = 4 timelimit = 3 net_timeout = 1 # compare_check_items = yes # access_attr_used_for_allow = yes } # passwd module allows to do authorization via any passwd-like # file and to extract any attributes from these modules # # parameters are: # filename - path to filename # format - format for filename record. This parameters # correlates record in the passwd file and RADIUS # attributes. # # Field marked as '*' is key field. That is, the parameter # with this name from the request is used to search for # the record from passwd file # Attribute marked as '=' is added to reply_itmes instead # of default configure_itmes # Attribute marked as '~' is added to request_items # # Field marked as ',' may contain a comma separated list # of attributes. # authtype - if record found this Auth-Type is used to authenticate # user # hashsize - hashtable size. If 0 or not specified records are not # stored in memory and file is red on every request. # allowmultiplekeys - if few records for every key are allowed # ignorenislike - ignore NIS-related records # delimiter - symbol to use as a field separator in passwd file, # for format ':' symbol is always used. '\0', '\n' are # not allowed # # An example configuration for using /etc/smbpasswd. # #passwd etc_smbpasswd { # filename = /etc/smbpasswd # format = "*User-Name::LM-Password:NT-Password:SMB-Account-CTRL-TEXT::" # authtype = MS-CHAP # hashsize = 100 # ignorenislike = no # allowmultiplekeys = no #} # Similar configuration, for the /etc/group file. Adds a Group-Name # attribute for every group that the user is member of. # #passwd etc_group { # filename = /etc/group # format = "=Group-Name:::*,User-Name" # hashsize = 50 # ignorenislike = yes # allowmultiplekeys = yes # delimiter = ":" #} # Realm module, for proxying. # # You can have multiple instances of the realm module to # support multiple realm syntaxs at the same time. The # search order is defined the order in the authorize and # preacct blocks after the module config block. # # Two config options: # format - must be 'prefix' or 'suffix' # delimiter - must be a single character # 'realm/username' # # Using this entry, IPASS users have their realm set to "IPASS". realm realmslash { format = prefix delimiter = "/" } # 'username@realm' # realm suffix { format = suffix delimiter = "@" } # 'username%realm' # realm realmpercent { format = suffix delimiter = "%" } # rewrite arbitrary packets. Useful in accounting and authorization. # ## This module is highly experimental at the moment. Please give ## feedback to the mailing list. # # The module can also use the Rewrite-Rule attribute. If it # is set and matches the name of the module instance, then # that module instance will be the only one which runs. # # Also if new_attribute is set to yes then a new attribute # will be created containing the value replacewith and it # will be added to searchin (packet, reply or config). # searchfor,ignore_case and max_matches will be ignored in that case. # #attr_rewrite sanecallerid { # attribute = Called-Station-Id # may be "packet", "reply", or "config" # searchin = packet # searchfor = "[+ ]" # replacewith = "" # ignore_case = no # new_attribute = no # max_matches = 10 # ## If set to yes then the replace string will be appended to the original string # append = no #} # Preprocess the incoming RADIUS request, before handing it off # to other modules. # # This module processes the 'huntgroups' and 'hints' files. # In addition, it re-writes some weird attributes created # by some NASes, and converts the attributes into a form which # is a little more standard. # preprocess { huntgroups = ${confdir}/huntgroups hints = ${confdir}/hints # This hack changes Ascend's wierd port numberings # to standard 0-??? port numbers so that the "+" works # for IP address assignments. with_ascend_hack = no ascend_channels_per_line = 23 # Windows NT machines often authenticate themselves as # NT_DOMAIN\username # # If this is set to 'yes', then the NT_DOMAIN portion # of the user-name is silently discarded. with_ntdomain_hack = no # Specialix Jetstream 8500 24 port access server. # # If the user name is 10 characters or longer, a "/" # and the excess characters after the 10th are # appended to the user name. # # If you're not running that NAS, you don't need # this hack. with_specialix_jetstream_hack = no # Cisco sends it's VSA attributes with the attribute # name *again* in the string, like: # # H323-Attribute = "h323-attribute=value". # # If this configuration item is set to 'yes', then # the redundant data in the the attribute text is stripped # out. The result is: # # H323-Attribute = "value" # # If you're not running a Cisco NAS, you don't need # this hack. with_cisco_vsa_hack = no } # Livingston-style 'users' file # files { usersfile = ${confdir}/users acctusersfile = ${confdir}/acct_users # If you want to use the old Cistron 'users' file # with FreeRADIUS, you should change the next line # to 'compat = cistron'. You can the copy your 'users' # file from Cistron. compat = no } # Write a detailed log of all accounting records received. # detail { # Note that we do NOT use NAS-IP-Address here, as # that attribute MAY BE from the originating NAS, and # NOT from the proxy which actually sent us the # request. The Client-IP-Address attribute is ALWAYS # the address of the client which sent us the # request. # # The following line creates a new detail file for # every radius client (by IP address or hostname). # In addition, a new detail file is created every # day, so that the detail file doesn't have to go # through a 'log rotation' # # If your detail files are large, you may also want # to add a ':%H' (see doc/variables.txt) to the end # of it, to create a new detail file every hour, e.g.: # # ..../detail-%Y%m%d:%H # # This will create a new detail file for every hour. # detailfile = ${radacctdir}/%{Client-IP-Address}/detail-%Y%m%d # # The Unix-style permissions on the 'detail' file. # # The detail file often contains secret or private # information about users. So by keeping the file # permissions restrictive, we can prevent unwanted # people from seeing that information. detailperm = 0600 } # Create a unique accounting session Id. Many NASes re-use or # repeat values for Acct-Session-Id, causing no end of # confusion. # # This module will add a (probably) unique session id # to an accounting packet based on the attributes listed # below found in the packet. See doc/rlm_acct_unique for # more information. # acct_unique { key = "User-Name, Acct-Session-Id, NAS-IP-Address, Client-IP-Address, NAS-Port-Id" } # Include another file that has the SQL-related configuration. # This is another file only because it tends to be big. # # The following configuration file is for use with MySQL. # # For Postgresql, use: ${confdir}/postgresql.conf # For MS-SQL, use: ${confdir}/mssql.conf # For Oracle, use: ${confdir}/oraclesql.conf # $INCLUDE ${confdir}/sql.conf # Write a 'utmp' style file, of which users are currently # logged in, and where they've logged in from. # # This file is used mainly for Simultaneous-Use checking, # and also 'radwho', to see who's currently logged in. # radutmp { # Where the file is stored. It's not a log file, # so it doesn't need rotating. # filename = ${logdir}/radutmp # The field in the packet to key on for the # 'user' name, If you have other fields which you want # to use to key on to control Simultaneous-Use, # then you can use them here. # # Note, however, that the size of the field in the # 'utmp' data structure is small, around 32 # characters, so that will limit the possible choices # of keys. # username = %{User-Name} # Whether or not we want to treat "user" the same # as "USER", or "User". Some systems have problems # with case sensitivity, so this should be set to # 'no' to enable the comparisons of the key attribute # to be case insensitive. # case_sensitive = yes # Accounting information may be lost, so the user MAY # have logged off of the NAS, but we haven't noticed. # If so, we can verify this information with the NAS, # # If we want to believe the 'utmp' file, then this # configuration entry can be set to 'no'. # check_with_nas = yes # Set the file permissions, as the contents of this file # are usually private. perm = 0600 callerid = "yes" } # "Safe" radutmp - does not contain caller ID, so it can be # world-readable, and radwho can work for normal users, without # exposing any information that isn't already exposed by who(1). # # This is another 'instance' of the radutmp module, but it is given # then name "sradutmp" to identify it later in the "accounting" # section. radutmp sradutmp { filename = ${logdir}/sradutmp perm = 0644 callerid = "no" } # attr_filter - filters the attributes received in replies from # proxied servers, to make sure we send back to our RADIUS client # only allowed attributes. attr_filter { attrsfile = ${confdir}/attrs } # counter module: # This module takes an attribute (count-attribute). # It also takes a key, and creates a counter for each unique # key. The count is incremented when accounting packets are # received by the server. The value of the increment depends # on the attribute type. # If the attribute is Acct-Session-Time or of an integer type we add the # value of the attribute. If it is anything else we increase the # counter by one. # # The 'reset' parameter defines when the counters are all reset to # zero. It can be hourly, daily, weekly, monthly or never. # # hourly: Reset on 00:00 of every hour # daily: Reset on 00:00:00 every day # weekly: Reset on 00:00:00 on sunday # monthly: Reset on 00:00:00 of the first day of each month # # It can also be user defined. It should be of the form: # num[hdwm] where: # h: hours, d: days, w: weeks, m: months # If the letter is ommited days will be assumed. In example: # reset = 10h (reset every 10 hours) # reset = 12 (reset every 12 days) # # # The check-name attribute defines an attribute which will be # registered by the counter module and can be used to set the # maximum allowed value for the counter after which the user # is rejected. # Something like: # # DEFAULT Max-Daily-Session := 36000 # Fall-Through = 1 # # You should add the counter module in the instantiate # section so that it registers check-name before the files # module reads the users file. # # If check-name is set and the user is to be rejected then we # send back a Reply-Message and we log a Failure-Message in # the radius.log # If the count attribute is Acct-Session-Time then on each login # we send back the remaining online time as a Session-Timeout attribute # # The counter-name can also be used instead of using the check-name # like below: # # DEFAULT Daily-Session-Time > 3600, Auth-Type = Reject # Reply-Message = "You've used up more than one hour today" # # The allowed-servicetype attribute can be used to only take # into account specific sessions. For example if a user first # logs in through a login menu and then selects ppp there will # be two sessions. One for Login-User and one for Framed-User # service type. We only need to take into account the second one. # # The module should be added in the instantiate, authorize and # accounting sections. Make sure that in the authorize # section it comes after any module which sets the # 'check-name' attribute. # counter daily { filename = ${raddbdir}/db.daily key = User-Name count-attribute = Acct-Session-Time reset = daily counter-name = Daily-Session-Time check-name = Max-Daily-Session allowed-servicetype = Framed-User cache-size = 5000 } # The "always" module is here for debugging purposes. Each # instance simply returns the same result, always, without # doing anything. always fail { rcode = fail } always reject { rcode = reject } always ok { rcode = ok simulcount = 0 mpp = no } # # The 'expression' module currently has no configuration. expr { } # # The 'digest' module currently has no configuration. # # "Digest" authentication against a Cisco SIP server. # See 'doc/rfc/draft-sterman-aaa-sip-00.txt' for details # on performing digest authentication for Cisco SIP servers. # digest { } # # Execute external programs # # The first example is useful only for 'xlat'. To use it, # put 'exec' into the 'instantiate' section. You can then # do dynamic translation of attributes like: # # Attribute-Name = `{%exec:/path/to/program args}` # # The value of the attribute will be replaced with the output # of the program which is executed. Due to RADIUS protocol # limitations, any output over 253 bytes will be ignored. # # The RADIUS attributes from the user request will be placed # into environment variables of the executed program, as # described in 'doc/variables.txt' # exec { wait = yes input_pairs = request } # # This is a more general example of the execute module. # # If you wish to execute an external program in more than # one section (e.g. 'authorize', 'pre_proxy', etc), then it # is probably best to define a different instance of the # 'exec' module for every section. # exec echo { # # Wait for the program to finish. # # If we do NOT wait, then the program is "fire and # forget", and any output attributes from it are ignored. # # If we are looking for the program to output # attributes, and want to add those attributes to the # request, then we MUST wait for the program to # finish, and therefore set 'wait=yes' # # allowed values: {no, yes} wait = yes # # The name of the program to execute, and it's # arguments. Dynamic translation is done on this # field, so things like the following example will # work. # program = "/bin/echo %{User-Name}" # # The attributes which are placed into the # environment variables for the program. # # Allowed values are: # # request attributes from the request # reply attributes from the reply # proxy-request attributes from the proxy request # proxy-reply attributes from the proxy reply # # Note that some attributes may not exist at some # stages. e.g. There may be no proxy-reply # attributes if this module is used in the # 'authorize' section. # input_pairs = request # # Where to place the output attributes (if any) from # the executed program. The values allowed, and the # restrictions as to availability, are the same as # for the input_pairs. # output_pairs = reply # # When to execute the program. If the packet # type does NOT match what's listed here, then # the module does NOT execute the program. # # For a list of allowed packet types, see # the 'dictionary' file, and look for VALUEs # of the Packet-Type attribute. # # By default, the module executes on ANY packet. # Un-comment out the following line to tell the # module to execute only if an Access-Accept is # being sent to the NAS. # #packet_type = Access-Accept } # Do server side ip pool management. Should be added in post-auth and # accounting sections. # # The module also requires the existance of the Pool-Name # attribute. That way the administrator can add the Pool-Name # attribute in the user profiles and use different pools # for different users. The Pool-Name attribute is a *check* item not # a reply item. # # Example: # radiusd.conf: ippool students { [...] } # users file : DEFAULT Group == students, Pool-Name := "students" # # ********* IF YOU CHANGE THE RANGE PARAMETERS YOU MUST THEN ERASE THE DB FILES ******* # ippool main_pool { # range-start,range-stop: The start and end ip # addresses for the ip pool range-start = 192.168.1.1 range-stop = 192.168.3.254 # netmask: The network mask used for the ip's netmask = 255.255.255.0 # cache-size: The gdbm cache size for the db # files. Should be equal to the number of ip's # available in the ip pool cache-size = 800 # session-db: The main db file used to allocate ip's to clients session-db = ${raddbdir}/db.ippool # ip-index: Helper db index file used in multilink ip-index = ${raddbdir}/db.ipindex # override: Will this ippool override a Framed-IP-Address already set override = no } # ANSI X9.9 token support. Not included by default. # $INCLUDE ${confdir}/x99.conf } # Instantiation # # This section orders the loading of the modules. Modules # listed here will get loaded BEFORE the later sections like # authorize, authenticate, etc. get examined. # # This section is not strictly needed. When a section like # authorize refers to a module, it's automatically loaded and # initialized. However, some modules may not be listed in any # of the following sections, so they can be listed here. # # Also, listing modules here ensures that you have control over # the order in which they are initalized. If one module needs # something defined by another module, you can list them in order # here, and ensure that the configuration will be OK. # instantiate { # # The expression module doesn't do authorization, # authentication, or accounting. It only does dynamic # translation, of the form: # # Session-Timeout = `%{expr:2 + 3}` # # So the module needs to be instantiated, but CANNOT be # listed in any other section. See 'doc/rlm_expr' for # more information. # expr # # We add the counter module here so that it registers # the check-name attribute before any module which sets # it # daily } # Authorization. First preprocess (hints and huntgroups files), # then realms, and finally look in the "users" file. # # The order of the realm modules will determine the order that # we try to find a matching realm. # # Make *sure* that 'preprocess' comes before any realm if you # need to setup hints for the remote radius server authorize { # # The preprocess module takes care of sanitizing some bizarre # attributes in the request, and turning them into attributes # which are more standard. # # It takes care of processing the 'raddb/hints' and the # 'raddb/huntgroups' files. # # It also adds a Client-IP-Address attribute to the request. preprocess # # The chap module will set 'Auth-Type := CHAP' if we are # handling a CHAP request and Auth-Type has not already been set chap # attr_filter # # This module takes care of EAP-MD5, EAP-TLS, and EAP-LEAP # authentication. eap # # If you have a Cisco SIP server authenticating against # FreeRADIUS, uncomment the following line. # digest # # Look for IPASS style 'realm/', and if not found, look for # '@realm', and decide whether or not to proxy, based on # that. # realmslash suffix # # Read the 'users' file files # # If you are using /etc/smbpasswd, and are also doing # mschap authentication, the un-comment this line, and # configure the 'etc_smbpasswd' module, above. # etc_smbpasswd # # If the users are logging in with an MS-CHAP-Challenge # attribute for authentication, the mschap module will find # the MS-CHAP-Challenge attribute, and add 'Auth-Type := MS-CHAP' # to the request, which will cause the server to then use # the mschap module for authentication. mschap # The ldap module will set Auth-Type to LDAP if it has not already been set # ldap # daily } # Authentication. # # This section lists which modules are available for authentication. # Note that it does NOT mean 'try each module in order'. It means # that you have to have a module from the 'authorize' section add # a configuration attribute 'Auth-Type := FOO'. That authentication type # is then used to pick the apropriate module from the list below. # # The default Auth-Type is Local. That is, whatever is not included inside # an authtype section will be called only if Auth-Type is set to Local. # # So you should do the following: # - Set Auth-Type to an appropriate value in the authorize modules above. # For example, the chap module will set Auth-Type to CHAP, ldap to LDAP, etc. # - After that create corresponding authtype sections in the # authenticate section below and call the appropriate modules. authenticate { # # PAP authentication, when a back-end database listed # in the 'authorize' section supplies a password. The # password can be clear-text, or encrypted. Auth-Type PAP { pap } # # Most people want CHAP authentication # A back-end database listed in the 'authorize' section # MUST supply a CLEAR TEXT password. Encrypted passwords # won't work. Auth-Type CHAP { chap } # # MSCHAP authentication. Auth-Type MS-CHAP { mschap } # # If you have a Cisco SIP server authenticating against # FreeRADIUS, uncomment the following line. # digest # # Pluggable Authentication Modules. # pam # # See 'man getpwent' for information on how the 'unix' # module checks the users password. Note that packets # containing CHAP-Password attributes CANNOT be authenticated # against /etc/passwd! See the FAQ for details. # unix # Uncomment it if you want to use ldap for authentication # Auth-Type LDAP { # ldap # } # # Allow EAP authentication. eap } # # Pre-accounting. Decide which accounting type to use. # preacct { preprocess # # Look for IPASS-style 'realm/', and if not found, look for # '@realm', and decide whether or not to proxy, based on # that. # # Accounting requests are generally proxied to the same # home server as authentication requests. # realmslash suffix # # Read the 'acct_users' file files } # # Accounting. Log the accounting data. # accounting { # # Ensure that we have a semi-unique identifier for every # request, and many NAS boxes are broken. acct_unique # # Create a 'detail'ed log of the packets. # Note that accounting requests which are proxied # are also logged in the detail file. detail # daily unix # wtmp file # # For Simultaneous-Use tracking. # # Due to packet losses in the network, the data here # may be incorrect. There's little we can do about it. radutmp # sradutmp # Return an address to the IP Pool when we see a stop record. # main_pool } # Session database, used for checking Simultaneous-Use. Either the radutmp # or rlm_sql module can handle this. # The rlm_sql module is *much* faster session { radutmp # sql } # Post-Authentication # Once we KNOW that the user has been authenticated, there are # additional steps we can take. post-auth { # Get an address from the IP Pool. # main_pool } # # When the server decides to proxy a request to a home server, # the proxied request is first passed through the pre-proxy # stage. This stage can re-write the request, or decide to # cancel the proxy. # # Only a few modules currently have this method. # pre-proxy { # attr_rewrite } # # When the server receives a reply to a request it proxied # to a home server, the request may be massaged here, in the # post-proxy stage. # post-proxy { # attr_rewrite # # If you are proxing LEAP, you MUST configure the EAP # module, and you MUST list it here, in the post-proxy # stage. # # You MUST also use the 'nostrip' option in the 'realm' # configuration. Otherwise, the User-Name attribute # in the proxied request will not match the user name # hidden inside of the EAP packet, and the end server will # reject the EAP request. # eap } freeradius-server/src/tests/eapsim-03/users-example.txt000066400000000000000000000025701257552170400235110ustar00rootroot000000000000001244070100000001@eapsim.foo Auth-Type := EAP, Autz-Type:= EAP, EAP-Type := SIM EAP-Sim-Rand1 = 0x101112131415161718191a1b1c1d1e1f, EAP-Sim-SRES1 = 0xd1d2d3d4, EAP-Sim-Rand2 = 0x202122232425262728292a2b2c2d2e2f, EAP-Sim-SRES2 = 0xe1e2e3e4, EAP-Sim-Rand3 = 0x303132333435363738393a3b3c3d3e3f, EAP-Sim-SRES3 = 0xf1f2f3f4, EAP-Sim-KC1 = 0xa0a1a2a3a4a5a6a7, EAP-Sim-KC2 = 0xb0b1b2b3b4b5b6b7, EAP-Sim-KC3 = 0xc0c1c2c3c4c5c6c7, 1232420100000015 Auth-Type := EAP, Autz-Type:=EAP, EAP-Type := SIM EAP-Sim-Rand1 = 0x30000000000000000000000000000000, EAP-Sim-SRES1 = 0x30112233, EAP-Sim-KC1 = 0x445566778899AABB, EAP-Sim-Rand2 = 0x31000000000000000000000000000000, EAP-Sim-SRES2 = 0x31112233, EAP-Sim-KC2 = 0x445566778899AABB, EAP-Sim-Rand3 = 0x32000000000000000000000000000000, EAP-Sim-SRES3 = 0x32112233, EAP-Sim-KC3 = 0x445566778899AABB, eapsim Auth-Type := EAP, Autz-Type:=EAP, EAP-Type := SIM EAP-Sim-Rand1 = 0xabcd1234abcd1234abcd1234abcd1234, EAP-Sim-SRES1 = 0x1234abcd, EAP-Sim-KC1 = 0x0011223344556677, EAP-Sim-Rand2 = 0xbcd1234abcd1234abcd1234abcd1234a, EAP-Sim-SRES2 = 0x234abcd1, EAP-Sim-KC2 = 0x1021324354657687, EAP-Sim-Rand3 = 0xcd1234abcd1234abcd1234abcd1234ab, EAP-Sim-SRES3 = 0x34abcd12, EAP-Sim-KC3 = 0x30415263748596a7 freeradius-server/src/tests/eapsim-04/000077500000000000000000000000001257552170400201535ustar00rootroot00000000000000freeradius-server/src/tests/eapsim-04/client.sh000066400000000000000000000001221257552170400217600ustar00rootroot00000000000000#!/bin/sh ../../main/radeapclient -x localhost auth testing123 About to send encoded packet: User-Name = "1244070100000001@eapsim.foo" NAS-IP-Address = marajade.sandelman.ottawa.on.ca EAP-Code = Response EAP-Type-Identity = "1244070100000001@eapsim.foo" Message-Authenticator = 0xABCDABCDABCDABCDABCDABCDABCDABCD NAS-Port = 0 EAP-Sim-Rand1 = 0x101112131415161718191a1b1c1d1e1f EAP-Sim-SRES1 = 0xd1d2d3d4 EAP-Sim-Rand2 = 0x202122232425262728292a2b2c2d2e2f EAP-Sim-SRES2 = 0xe1e2e3e4 EAP-Sim-Rand3 = 0x303132333435363738393a3b3c3d3e3f EAP-Sim-SRES3 = 0xf1f2f3f4 EAP-Sim-KC1 = 0xa0a1a2a3a4a5a6a7 EAP-Sim-KC2 = 0xb0b1b2b3b4b5b6b7 EAP-Sim-KC3 = 0xc0c1c2c3c4c5c6c7 Sending Access-Request of id 999 to 127.0.0.1:1812 User-Name = "1244070100000001@eapsim.foo" NAS-IP-Address = marajade.sandelman.ottawa.on.ca Message-Authenticator = 0xABCDABCDABCDABCDABCDABCDABCDABCD NAS-Port = 0 EAP-Message = 0x02XX rad_recv: Access-Challenge packet from host 127.0.0.1:1812, id=999, length=78 EAP-Message = 0x01XX Message-Authenticator = 0xABCDABCDABCDABCDABCDABCDABCDABCD State = 0xABCDABCDABCDABCDABCDABCDABCDABCD <+++ EAP decoded packet: EAP-Message = 0x01XX Message-Authenticator = 0xABCDABCDABCDABCDABCDABCDABCDABCD State = 0xABCDABCDABCDABCDABCDABCDABCDABCD EAP-Id = YY EAP-Code = Request EAP-Type-SIM = 0x0a00000f0200020001000011010100 <+++ EAP-sim decoded packet: EAP-Message = 0x01XX Message-Authenticator = 0xABCDABCDABCDABCDABCDABCDABCDABCD State = 0xABCDABCDABCDABCDABCDABCDABCDABCD EAP-Id = YY EAP-Code = Request EAP-Type-SIM = 0x0a00000f0200020001000011010100 EAP-Sim-Subtype = Start EAP-Sim-VERSION_LIST = 0x000200010000 EAP-Sim-FULLAUTH_ID_REQ = 0x0100 +++> About to send encoded packet: User-Name = "1244070100000001@eapsim.foo" NAS-IP-Address = marajade.sandelman.ottawa.on.ca EAP-Code = Response Message-Authenticator = 0xABCDABCDABCDABCDABCDABCDABCDABCD NAS-Port = 0 EAP-Sim-Rand1 = 0x101112131415161718191a1b1c1d1e1f EAP-Sim-SRES1 = 0xd1d2d3d4 EAP-Sim-Rand2 = 0x202122232425262728292a2b2c2d2e2f EAP-Sim-SRES2 = 0xe1e2e3e4 EAP-Sim-Rand3 = 0x303132333435363738393a3b3c3d3e3f EAP-Sim-SRES3 = 0xf1f2f3f4 EAP-Sim-KC1 = 0xa0a1a2a3a4a5a6a7 EAP-Sim-KC2 = 0xb0b1b2b3b4b5b6b7 EAP-Sim-KC3 = 0xc0c1c2c3c4c5c6c7 EAP-Sim-State = 1 EAP-Sim-Subtype = Start EAP-Sim-SELECTED_VERSION = 0x0001 EAP-Sim-NONCE_MT = 0x000000a3f6b4e832cf46b4d3e0d090623e22 EAP-Sim-IDENTITY = 0x001b313234343037303130303030303030314065617073696d2e666f6f EAP-Id = YY EAP-Message = 0x02XX State = 0xABCDABCDABCDABCDABCDABCDABCDABCD Sending Access-Request of id 999 to 127.0.0.1:1812 User-Name = "1244070100000001@eapsim.foo" NAS-IP-Address = marajade.sandelman.ottawa.on.ca Message-Authenticator = 0xABCDABCDABCDABCDABCDABCDABCDABCD NAS-Port = 0 EAP-Message = 0x02XX State = 0xABCDABCDABCDABCDABCDABCDABCDABCD rad_recv: Access-Challenge packet from host 127.0.0.1:1812, id=999, length=138 EAP-Message = 0x01XX Message-Authenticator = 0xABCDABCDABCDABCDABCDABCDABCDABCD State = 0xABCDABCDABCDABCDABCDABCDABCDABCD <+++ EAP decoded packet: EAP-Message = 0x01XX Message-Authenticator = 0xABCDABCDABCDABCDABCDABCDABCDABCD State = 0xABCDABCDABCDABCDABCDABCDABCDABCD EAP-Id = YY EAP-Code = Request EAP-Type-SIM = 0x0b0000010d0000101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f0b050000XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX <+++ EAP-sim decoded packet: EAP-Message = 0x01XX Message-Authenticator = 0xABCDABCDABCDABCDABCDABCDABCDABCD State = 0xABCDABCDABCDABCDABCDABCDABCDABCD EAP-Id = YY EAP-Code = Request EAP-Type-SIM = 0x0b0000010d0000101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f0b050000XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX EAP-Sim-Subtype = Challenge EAP-Sim-RAND = 0x0000101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f EAP-Sim-MAC = 0xYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY Input was: identity: (len=27)313234343037303130303030303030314065617073696d2e666f6f nonce_mt: 00a3f6b4e832cf46b4d3e0d090623e22 rand0: 00000000000000000000000000000000 rand1: 00000000000000000000000000000000 rand2: 00000000000000000000000000000000 sres0: d1d2d3d4 sres1: e1e2e3e4 sres2: f1f2f3f4 Kc0: a0a1a2a3a4a5a6a7 Kc1: b0b1b2b3b4b5b6b7 Kc2: c0c1c2c3c4c5c6c7 versionlist[2]: 0001 select 00 01 Output mk: 2a56fd95_adac4bf7_645c2e60_7296a8af_9e1214a1 K_aut: 2853a70a_4ca089cc_0cf8a24a_45ecec93 K_encr: 77987afb_1cfd251d_749d2f16_0611338e msk: e8adff17_1d82d5e6_9a78d526_1e86ee56_93cbe646 59332585_1f1f58f0_598c3a0c_1640339b_c3407fb4 56a14ada_a4791445_e8a3cf40_49b4628f_8e9f597a 7891e9d2 emsk: b33c4a19_c1df9108_17196271_7c4b7f98_e53a64ba a67d4e23_5ff142cb_6e427434_8a71358a_3c2b1313 4cec6be3_a99e60c8_ae543fdd_52ecd7b3_0542e1df 5d10c5f7 MAC check succeed +++> About to send encoded packet: User-Name = "1244070100000001@eapsim.foo" NAS-IP-Address = marajade.sandelman.ottawa.on.ca EAP-Code = Response Message-Authenticator = 0xABCDABCDABCDABCDABCDABCDABCDABCD NAS-Port = 0 EAP-Sim-Rand1 = 0x101112131415161718191a1b1c1d1e1f EAP-Sim-SRES1 = 0xd1d2d3d4 EAP-Sim-Rand2 = 0x202122232425262728292a2b2c2d2e2f EAP-Sim-SRES2 = 0xe1e2e3e4 EAP-Sim-Rand3 = 0x303132333435363738393a3b3c3d3e3f EAP-Sim-SRES3 = 0xf1f2f3f4 EAP-Sim-KC1 = 0xa0a1a2a3a4a5a6a7 EAP-Sim-KC2 = 0xb0b1b2b3b4b5b6b7 EAP-Sim-KC3 = 0xc0c1c2c3c4c5c6c7 EAP-Sim-State = 1 EAP-Sim-Subtype = Challenge EAP-Id = YY State = 0xABCDABCDABCDABCDABCDABCDABCDABCD EAP-Sim-MAC = 0xd1d2d3d4e1e2e3e4f1f2f3f4 EAP-Sim-KEY = 0x2853a70a4ca089cc0cf8a24a45ecec93 EAP-Message = 0x02XX Sending Access-Request of id 999 to 127.0.0.1:1812 User-Name = "1244070100000001@eapsim.foo" NAS-IP-Address = marajade.sandelman.ottawa.on.ca Message-Authenticator = 0xABCDABCDABCDABCDABCDABCDABCDABCD NAS-Port = 0 State = 0xABCDABCDABCDABCDABCDABCDABCDABCD EAP-Message = 0x02XX rad_recv: Access-Accept packet from host 127.0.0.1:1812, id=999, length=189 MS-MPPE-Recv-Key = 0xe8adff171d82d5e69a78d5261e86ee5693cbe646593325851f1f58f0598c3a0c MS-MPPE-Send-Key = 0x1640339bc3407fb456a14adaa4791445e8a3cf4049b4628f8e9f597a7891e9d2 EAP-Message = 0x03XX Message-Authenticator = 0xABCDABCDABCDABCDABCDABCDABCDABCD User-Name = "1244070100000001@eapsim.foo" <+++ EAP decoded packet: MS-MPPE-Recv-Key = 0xe8adff171d82d5e69a78d5261e86ee5693cbe646593325851f1f58f0598c3a0c MS-MPPE-Send-Key = 0x1640339bc3407fb456a14adaa4791445e8a3cf4049b4628f8e9f597a7891e9d2 EAP-Message = 0x03XX Message-Authenticator = 0xABCDABCDABCDABCDABCDABCDABCDABCD User-Name = "1244070100000001@eapsim.foo" EAP-Id = YY EAP-Code = Success freeradius-server/src/tests/eapsim-04/eapsim-in.txt000066400000000000000000000010271257552170400225760ustar00rootroot00000000000000User-Name = "1244070100000001@eapsim.foo" NAS-IP-Address = marajade.sandelman.ottawa.on.ca EAP-Code = Response EAP-Type-Identity = "1244070100000001@eapsim.foo" Message-Authenticator = 0 NAS-Port = 0 EAP-Sim-Rand1 = 0x101112131415161718191a1b1c1d1e1f EAP-Sim-SRES1 = 0xd1d2d3d4 EAP-Sim-Rand2 = 0x202122232425262728292a2b2c2d2e2f EAP-Sim-SRES2 = 0xe1e2e3e4 EAP-Sim-Rand3 = 0x303132333435363738393a3b3c3d3e3f EAP-Sim-SRES3 = 0xf1f2f3f4 EAP-Sim-KC1 = 0xa0a1a2a3a4a5a6a7 EAP-Sim-KC2 = 0xb0b1b2b3b4b5b6b7 EAP-Sim-KC3 = 0xc0c1c2c3c4c5c6c7 freeradius-server/src/tests/eapsim-04/myvectors.txt000066400000000000000000000116111257552170400227470ustar00rootroot00000000000000+Input was: + identity: (len=27)313234343037303130303030303030314065617073696d2e666f6f + nonce_mt: 0123456789abcdeffedcba9876543201 + chal0: 101112131415161718191a1b1c1d1e1f + chal1: 202122232425262728292a2b2c2d2e2f + chal2: 303132333435363738393a3b3c3d3e3f + sres0: d1d2d3d4 + sres1: e1e2e3e4 + sres2: f1f2f3f4 + Kc0: a0a1a2a3a4a5a6a7 + Kc1: b0b1b2b3b4b5b6b7 + Kc2: c0c1c2c3c4c5c6c7 + versionlist[4]: 00020001 + select 00 01 + + +Output +mk: c21b4e4f_4e43619b_891e711f_f84f5e37_5e296d1a +K_aut: cdd4e489_a7ae78da_67b593bd_8c231102 +K_encr: c322b087_a282de07_b0079dab_8e65d96f +msk: eeea3a75_8d74d4f4_a7a77b98_5733806e_8093c8f9 + 6a733668_70fcfb7e_4b0d7ab3_e8657531_25de1aa1 + 318e21c4_57346f82_ba047e35_16ea4648_22f8039e + aa6cc9be +emsk: fdc00fa1_d159910d_99251485_5d057d84_a4b1bd00 + 4d34bef5_f7070000_cb380340_e8f00240_fcf9ffbf + c0970040_fdb20408_00000000_58e50640_003b3731 + fcf9ffbf +SHA1buffer was: 31323434_30373031_30303030_30303031_40656170_ + 73696d2e_666f6fa0_a1a2a3a4_a5a6a7b0_b1b2b3b4_ + b5b6b7c0_c1c2c3c4_c5c6c701_23456789_abcdeffe_ + dcba9876_54320100_010001 VERSION is 1 byte: +SHA1buffer was: 31323434_30373031_30303030_30303031_40656170_ + 73696d2e_666f6fa0_a1a2a3a4_a5a6a7b0_b1b2b3b4_ + b5b6b7c0_c1c2c3c4_c5c6c701_23456789_abcdeffe_ + dcba9876_54320100_0101 +Input was: + identity: (len=27)313234343037303130303030303030314065617073696d2e666f6f + nonce_mt: 0123456789abcdeffedcba9876543201 + rand0: 101112131415161718191a1b1c1d1e1f + rand1: 202122232425262728292a2b2c2d2e2f + rand2: 303132333435363738393a3b3c3d3e3f + sres0: d1d2d3d4 + sres1: e1e2e3e4 + sres2: f1f2f3f4 + Kc0: a0a1a2a3a4a5a6a7 + Kc1: b0b1b2b3b4b5b6b7 + Kc2: c0c1c2c3c4c5c6c7 + versionlist[2]: 0001 + select 00 01 + + +Output +mk: cfe4d5bc_fb87bcab_4d83ebea_90c179df_3cfee43c +K_aut: 32aa4046_770c30ed_bce21212_d7d9393c +K_encr: e3810875_f8c40f7f_cb2544ed_d0d873c3 +msk: 3a8dd0fb_411d15e1_4d485c8b_bd94ab23_a8ea3e5a + d888521c_d1a3fa7d_1fabd7e2_afd062f6_75c3de8b + 5adda978_91d78a3d_2efcb988_265ceee3_fa924279 + 43fa0125 +emsk: 5296957b_61bc72f8_5c2acbd5_501299d1_b7e2b04f + 39127a69_003b0140_f8200340_003b0140_03000000 + 98bb0240_003b0140_e8f9ffbf_a4810408_bc373731 + fcf9ffbf 1-byte: +SHA1buffer was: 31323434_30373031_30303030_30303031_40656170_ + 73696d2e_666f6fa0_a1a2a3a4_a5a6a7b0_b1b2b3b4_ + b5b6b7c0_c1c2c3c4_c5c6c701_23456789_abcdeffe_ + dcba9876_54321000_0101 +Input was: + identity: (len=27)313234343037303130303030303030314065617073696d2e666f6f + nonce_mt: 0123456789abcdeffedcba9876543210 + rand0: 101112131415161718191a1b1c1d1e1f + rand1: 202122232425262728292a2b2c2d2e2f + rand2: 303132333435363738393a3b3c3d3e3f + sres0: d1d2d3d4 + sres1: e1e2e3e4 + sres2: f1f2f3f4 + Kc0: a0a1a2a3a4a5a6a7 + Kc1: b0b1b2b3b4b5b6b7 + Kc2: c0c1c2c3c4c5c6c7 + versionlist[2]: 0001 + select 00 01 + + +Output +mk: d328f534_d9292b67_0e73c798_591e1e09_04c0c8cc +K_aut: aa19e454_833aa2ea_ccc116db_9312b543 +K_encr: 51fc0641_e4d9fa43_23f9516d_15b9f618 +msk: ced8e588_7d883785_ee2d2e41_f1aeb82d_1cfca277 + 7309b411_30047c52_130807c0_bdf0e56e_205433e0 + 58b2f48e_2337809d_e1b2681c_e30932d9_2a62cbe8 + 40bfb568 +emsk: a273b6f5_47d12da7_c1d0dff4_746e0ded_70e74a83 + 520b22a8_003b0140_f8200340_003b0140_03000000 + 98bb0240_003b0140_e8f9ffbf_a4810408_bc373731 + fcf9ffbf 2-bytes: +SHA1buffer was: 31323434_30373031_30303030_30303031_40656170_ + 73696d2e_666f6fa0_a1a2a3a4_a5a6a7b0_b1b2b3b4_ + b5b6b7c0_c1c2c3c4_c5c6c701_23456789_abcdeffe_ + dcba9876_54321000_010001 +Input was: + identity: (len=27)313234343037303130303030303030314065617073696d2e666f6f + nonce_mt: 0123456789abcdeffedcba9876543210 + rand0: 101112131415161718191a1b1c1d1e1f + rand1: 202122232425262728292a2b2c2d2e2f + rand2: 303132333435363738393a3b3c3d3e3f + sres0: d1d2d3d4 + sres1: e1e2e3e4 + sres2: f1f2f3f4 + Kc0: a0a1a2a3a4a5a6a7 + Kc1: b0b1b2b3b4b5b6b7 + Kc2: c0c1c2c3c4c5c6c7 + versionlist[2]: 0001 + select 00 01 + + +Output +mk: e576d5ca_332e9930_018bf1ba_ee2763c7_95b3c712 +K_aut: 536e5ebc_4465582a_a6a8ec99_86ebb620 +K_encr: 25af1942_efcbf4bc_72b39434_21f2a974 +msk: 39d45aea_f4e30601_983e972b_6cfd46d1_c3637733 + 65690d09_cd44976b_525f47d3_a60a985e_955c53b0 + 90b2e4b7_3719196a_40254296_8fd14a88_8f46b9a7 + 886e4488 +emsk: 5949eab0_fff69d52_315c6c63_4fd14a7f_0d52023d + 56f79698_003b0140_f8200340_003b0140_03000000 + 98bb0240_003b0140_e8f9ffbf_a4810408_bc373731 + fcf9ffbf freeradius-server/src/tests/eapsim-04/users.txt000066400000000000000000000011201257552170400220470ustar00rootroot000000000000001244070100000001@eapsim.foo Auth-Type := EAP, EAP-Type := SIM EAP-Sim-Chal1 = 0x101112131415161718191a1b1c1d1e1f, EAP-Sim-SRES1 = 0xd1d2d3d4, EAP-Sim-Chal2 = 0x202122232425262728292a2b2c2d2e2f, EAP-Sim-SRES2 = 0xe1e2e3e4, EAP-Sim-Chal3 = 0x303132333435363738393a3b3c3d3e3f, EAP-Sim-SRES3 = 0xf1f2f3f4, EAP-Sim-KC1 = 0xa0a1a2a3a4a5a6a7, EAP-Sim-KC2 = 0xb0b1b2b3b4b5b6b7, EAP-Sim-KC3 = 0xc0c1c2c3c4c5c6c7, Service-Type = Framed-User, Framed-Protocol = PPP, Framed-IP-Address = 172.16.3.34, Framed-IP-Netmask = 255.255.255.0, Framed-Routing = Broadcast-Listen, Framed-MTU = 1234 freeradius-server/src/tests/eapsim-05/000077500000000000000000000000001257552170400201545ustar00rootroot00000000000000freeradius-server/src/tests/eapsim-05/check.gdb000066400000000000000000000001211257552170400217010ustar00rootroot00000000000000file ../../main/radeapclient set args -x localhost auth testing123 About to send encoded packet: User-Name = "eapsim" NAS-IP-Address = marajade.sandelman.ottawa.on.ca EAP-Code = Response EAP-Type-Identity = "eapsim" Message-Authenticator = 0xABCDABCDABCDABCDABCDABCDABCDABCD NAS-Port = 0 EAP-Sim-Rand1 = 0x89abcbeef9abcdef89abcdef89abcdef EAP-Sim-Rand2 = 0x9abcdef89abcdef89abcdef89abcdef8 EAP-Sim-Rand3 = 0xabcdef89abcdef89abcdef89abcdef89 EAP-Sim-SRES1 = 0x1234abcd EAP-Sim-SRES2 = 0x234abcd1 EAP-Sim-SRES3 = 0x34abcd12 EAP-Sim-KC1 = 0x0011223344556677 EAP-Sim-KC2 = 0x1021324354657687 EAP-Sim-KC3 = 0x30415263748596a7 Sending Access-Request of id 999 to 127.0.0.1:1812 User-Name = "eapsim" NAS-IP-Address = marajade.sandelman.ottawa.on.ca Message-Authenticator = 0xABCDABCDABCDABCDABCDABCDABCDABCD NAS-Port = 0 EAP-Message = 0x02XX rad_recv: Access-Challenge packet from host 127.0.0.1:1812, id=999, length=78 EAP-Message = 0x01XX Message-Authenticator = 0xABCDABCDABCDABCDABCDABCDABCDABCD State = 0xABCDABCDABCDABCDABCDABCDABCDABCD <+++ EAP decoded packet: EAP-Message = 0x01XX Message-Authenticator = 0xABCDABCDABCDABCDABCDABCDABCDABCD State = 0xABCDABCDABCDABCDABCDABCDABCDABCD EAP-Id = YY EAP-Code = Request EAP-Type-SIM = 0x0a00000f0200020001000011010100 <+++ EAP-sim decoded packet: EAP-Message = 0x01XX Message-Authenticator = 0xABCDABCDABCDABCDABCDABCDABCDABCD State = 0xABCDABCDABCDABCDABCDABCDABCDABCD EAP-Id = YY EAP-Code = Request EAP-Type-SIM = 0x0a00000f0200020001000011010100 EAP-Sim-Subtype = Start EAP-Sim-VERSION_LIST = 0x000200010000 EAP-Sim-FULLAUTH_ID_REQ = 0x0100 +++> About to send encoded packet: User-Name = "eapsim" NAS-IP-Address = marajade.sandelman.ottawa.on.ca EAP-Code = Response Message-Authenticator = 0xABCDABCDABCDABCDABCDABCDABCDABCD NAS-Port = 0 EAP-Sim-Rand1 = 0x89abcbeef9abcdef89abcdef89abcdef EAP-Sim-Rand2 = 0x9abcdef89abcdef89abcdef89abcdef8 EAP-Sim-Rand3 = 0xabcdef89abcdef89abcdef89abcdef89 EAP-Sim-SRES1 = 0x1234abcd EAP-Sim-SRES2 = 0x234abcd1 EAP-Sim-SRES3 = 0x34abcd12 EAP-Sim-KC1 = 0x0011223344556677 EAP-Sim-KC2 = 0x1021324354657687 EAP-Sim-KC3 = 0x30415263748596a7 EAP-Sim-State = 1 EAP-Sim-Subtype = Start EAP-Sim-SELECTED_VERSION = 0x0001 EAP-Sim-NONCE_MT = 0x000000a3f6b4e832cf46b4d3e0d090623e22 EAP-Sim-IDENTITY = 0x000665617073696d EAP-Id = YY EAP-Message = 0x02XX State = 0xABCDABCDABCDABCDABCDABCDABCDABCD Sending Access-Request of id 999 to 127.0.0.1:1812 User-Name = "eapsim" NAS-IP-Address = marajade.sandelman.ottawa.on.ca Message-Authenticator = 0xABCDABCDABCDABCDABCDABCDABCDABCD NAS-Port = 0 EAP-Message = 0x02XX State = 0xABCDABCDABCDABCDABCDABCDABCDABCD rad_recv: Access-Challenge packet from host 127.0.0.1:1812, id=999, length=138 EAP-Message = 0x01XX Message-Authenticator = 0xABCDABCDABCDABCDABCDABCDABCDABCD State = 0xABCDABCDABCDABCDABCDABCDABCDABCD <+++ EAP decoded packet: EAP-Message = 0x01XX Message-Authenticator = 0xABCDABCDABCDABCDABCDABCDABCDABCD State = 0xABCDABCDABCDABCDABCDABCDABCDABCD EAP-Id = YY EAP-Code = Request EAP-Type-SIM = 0x0b0000010d0000abcd1234abcd1234abcd1234abcd1234bcd1234abcd1234abcd1234abcd1234acd1234abcd1234abcd1234abcd1234ab0b050000XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX <+++ EAP-sim decoded packet: EAP-Message = 0x01XX Message-Authenticator = 0xABCDABCDABCDABCDABCDABCDABCDABCD State = 0xABCDABCDABCDABCDABCDABCDABCDABCD EAP-Id = YY EAP-Code = Request EAP-Type-SIM = 0x0b0000010d0000abcd1234abcd1234abcd1234abcd1234bcd1234abcd1234abcd1234abcd1234acd1234abcd1234abcd1234abcd1234ab0b050000XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX EAP-Sim-Subtype = Challenge EAP-Sim-RAND = 0x0000abcd1234abcd1234abcd1234abcd1234bcd1234abcd1234abcd1234abcd1234acd1234abcd1234abcd1234abcd1234ab EAP-Sim-MAC = 0xYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY __________________ +++> About to send encoded packet: User-Name = "eapsim" NAS-IP-Address = marajade.sandelman.ottawa.on.ca EAP-Code = Response Message-Authenticator = 0xABCDABCDABCDABCDABCDABCDABCDABCD NAS-Port = 0 EAP-Sim-Rand1 = 0x89abcbeef9abcdef89abcdef89abcdef EAP-Sim-Rand2 = 0x9abcdef89abcdef89abcdef89abcdef8 EAP-Sim-Rand3 = 0xabcdef89abcdef89abcdef89abcdef89 EAP-Sim-SRES1 = 0x1234abcd EAP-Sim-SRES2 = 0x234abcd1 EAP-Sim-SRES3 = 0x34abcd12 EAP-Sim-KC1 = 0x0011223344556677 EAP-Sim-KC2 = 0x1021324354657687 EAP-Sim-KC3 = 0x30415263748596a7 EAP-Sim-State = 0 EAP-Sim-Subtype = Start EAP-Sim-SELECTED_VERSION = 0x0001 EAP-Sim-NONCE_MT = 0x000000a3f6b4e832cf46b4d3e0d090623e22 EAP-Sim-IDENTITY = 0x000665617073696d EAP-Id = YY State = 0xABCDABCDABCDABCDABCDABCDABCDABCD EAP-Message = 0x02XX Sending Access-Request of id 999 to 127.0.0.1:1812 User-Name = "eapsim" NAS-IP-Address = marajade.sandelman.ottawa.on.ca Message-Authenticator = 0xABCDABCDABCDABCDABCDABCDABCDABCD NAS-Port = 0 State = 0xABCDABCDABCDABCDABCDABCDABCDABCD EAP-Message = 0x02XX rad_recv: Access-Challenge packet from host 127.0.0.1:1812, id=999, length=138 EAP-Message = 0x01XX Message-Authenticator = 0xABCDABCDABCDABCDABCDABCDABCDABCD State = 0xABCDABCDABCDABCDABCDABCDABCDABCD <+++ EAP decoded packet: EAP-Message = 0x01XX Message-Authenticator = 0xABCDABCDABCDABCDABCDABCDABCDABCD State = 0xABCDABCDABCDABCDABCDABCDABCDABCD EAP-Id = YY EAP-Code = Request EAP-Type-SIM = 0x0b0000010d0000abcd1234abcd1234abcd1234abcd1234bcd1234abcd1234abcd1234abcd1234acd1234abcd1234abcd1234abcd1234ab0b050000XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX <+++ EAP-sim decoded packet: EAP-Message = 0x01XX Message-Authenticator = 0xABCDABCDABCDABCDABCDABCDABCDABCD State = 0xABCDABCDABCDABCDABCDABCDABCDABCD EAP-Id = YY EAP-Code = Request EAP-Type-SIM = 0x0b0000010d0000abcd1234abcd1234abcd1234abcd1234bcd1234abcd1234abcd1234abcd1234acd1234abcd1234abcd1234abcd1234ab0b050000XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX EAP-Sim-Subtype = Challenge EAP-Sim-RAND = 0x0000abcd1234abcd1234abcd1234abcd1234bcd1234abcd1234abcd1234abcd1234acd1234abcd1234abcd1234abcd1234ab EAP-Sim-MAC = 0xYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY freeradius-server/src/tests/eapsim-05/eapsim-in.txt000066400000000000000000000007531257552170400226040ustar00rootroot00000000000000User-Name = "eapsim" NAS-IP-Address = marajade.sandelman.ottawa.on.ca EAP-Code = Response EAP-Type-Identity = "eapsim" Message-Authenticator = 0 NAS-Port = 0 EAP-Sim-Rand1 = 0x89abcBEEF9abcdef89abcdef89abcdef EAP-Sim-Rand2 = 0x9abcdef89abcdef89abcdef89abcdef8 EAP-Sim-Rand3 = 0xabcdef89abcdef89abcdef89abcdef89 EAP-Sim-Sres1 = 0x1234abcd EAP-Sim-Sres2 = 0x234abcd1 EAP-Sim-Sres3 = 0x34abcd12 EAP-Sim-KC1 = 0x0011223344556677 EAP-Sim-KC2 = 0x1021324354657687 EAP-Sim-KC3 = 0x30415263748596a7 freeradius-server/src/tests/eapsim-05/eapsim-out.txt000066400000000000000000000134661257552170400230120ustar00rootroot00000000000000 +++> About to send encoded packet: User-Name = "eapsim" NAS-IP-Address = marajade.sandelman.ottawa.on.ca EAP-Code = Response EAP-Type-Identity = "eapsim" Message-Authenticator = 0xABCDABCDABCDABCDABCDABCDABCDABCD NAS-Port = 0 EAP-Sim-Rand1 = 0x89abcbeef9abcdef89abcdef89abcdef EAP-Sim-Rand2 = 0x9abcdef89abcdef89abcdef89abcdef8 EAP-Sim-Rand3 = 0xabcdef89abcdef89abcdef89abcdef89 EAP-Sim-SRES1 = 0x1234abcd EAP-Sim-SRES2 = 0x234abcd1 EAP-Sim-SRES3 = 0x34abcd12 EAP-Sim-KC1 = 0x0011223344556677 EAP-Sim-KC2 = 0x1021324354657687 EAP-Sim-KC3 = 0x30415263748596a7 Sending Access-Request of id 999 to 127.0.0.1:1812 User-Name = "eapsim" NAS-IP-Address = marajade.sandelman.ottawa.on.ca Message-Authenticator = 0xABCDABCDABCDABCDABCDABCDABCDABCD NAS-Port = 0 EAP-Message = 0x02XX rad_recv: Access-Challenge packet from host 127.0.0.1:1812, id=999, length=78 EAP-Message = 0x01XX Message-Authenticator = 0xABCDABCDABCDABCDABCDABCDABCDABCD State = 0xABCDABCDABCDABCDABCDABCDABCDABCD <+++ EAP decoded packet: EAP-Message = 0x01XX Message-Authenticator = 0xABCDABCDABCDABCDABCDABCDABCDABCD State = 0xABCDABCDABCDABCDABCDABCDABCDABCD EAP-Id = YY EAP-Code = Request EAP-Type-SIM = 0x0a00000f0200020001000011010100 <+++ EAP-sim decoded packet: EAP-Message = 0x01XX Message-Authenticator = 0xABCDABCDABCDABCDABCDABCDABCDABCD State = 0xABCDABCDABCDABCDABCDABCDABCDABCD EAP-Id = YY EAP-Code = Request EAP-Type-SIM = 0x0a00000f0200020001000011010100 EAP-Sim-Subtype = Start EAP-Sim-VERSION_LIST = 0x000200010000 EAP-Sim-FULLAUTH_ID_REQ = 0x0100 +++> About to send encoded packet: User-Name = "eapsim" NAS-IP-Address = marajade.sandelman.ottawa.on.ca EAP-Code = Response Message-Authenticator = 0xABCDABCDABCDABCDABCDABCDABCDABCD NAS-Port = 0 EAP-Sim-Rand1 = 0x89abcbeef9abcdef89abcdef89abcdef EAP-Sim-Rand2 = 0x9abcdef89abcdef89abcdef89abcdef8 EAP-Sim-Rand3 = 0xabcdef89abcdef89abcdef89abcdef89 EAP-Sim-SRES1 = 0x1234abcd EAP-Sim-SRES2 = 0x234abcd1 EAP-Sim-SRES3 = 0x34abcd12 EAP-Sim-KC1 = 0x0011223344556677 EAP-Sim-KC2 = 0x1021324354657687 EAP-Sim-KC3 = 0x30415263748596a7 EAP-Sim-State = 1 EAP-Sim-Subtype = Start EAP-Sim-SELECTED_VERSION = 0x0001 EAP-Sim-NONCE_MT = 0x000000a3f6b4e832cf46b4d3e0d090623e22 EAP-Sim-IDENTITY = 0x000665617073696d EAP-Id = YY EAP-Message = 0x02XX State = 0xABCDABCDABCDABCDABCDABCDABCDABCD Sending Access-Request of id 999 to 127.0.0.1:1812 User-Name = "eapsim" NAS-IP-Address = marajade.sandelman.ottawa.on.ca Message-Authenticator = 0xABCDABCDABCDABCDABCDABCDABCDABCD NAS-Port = 0 EAP-Message = 0x02XX State = 0xABCDABCDABCDABCDABCDABCDABCDABCD rad_recv: Access-Challenge packet from host 127.0.0.1:1812, id=999, length=138 EAP-Message = 0x01XX Message-Authenticator = 0xABCDABCDABCDABCDABCDABCDABCDABCD State = 0xABCDABCDABCDABCDABCDABCDABCDABCD <+++ EAP decoded packet: EAP-Message = 0x01XX Message-Authenticator = 0xABCDABCDABCDABCDABCDABCDABCDABCD State = 0xABCDABCDABCDABCDABCDABCDABCDABCD EAP-Id = YY EAP-Code = Request EAP-Type-SIM = 0x0b0000010d0000abcd1234abcd1234abcd1234abcd1234bcd1234abcd1234abcd1234abcd1234acd1234abcd1234abcd1234abcd1234ab0b050000XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX <+++ EAP-sim decoded packet: EAP-Message = 0x01XX Message-Authenticator = 0xABCDABCDABCDABCDABCDABCDABCDABCD State = 0xABCDABCDABCDABCDABCDABCDABCDABCD EAP-Id = YY EAP-Code = Request EAP-Type-SIM = 0x0b0000010d0000abcd1234abcd1234abcd1234abcd1234bcd1234abcd1234abcd1234abcd1234acd1234abcd1234abcd1234abcd1234ab0b050000XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX EAP-Sim-Subtype = Challenge EAP-Sim-RAND = 0x0000abcd1234abcd1234abcd1234abcd1234bcd1234abcd1234abcd1234abcd1234acd1234abcd1234abcd1234abcd1234ab EAP-Sim-MAC = 0xYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY __________________ +++> About to send encoded packet: User-Name = "eapsim" NAS-IP-Address = marajade.sandelman.ottawa.on.ca EAP-Code = Response Message-Authenticator = 0xABCDABCDABCDABCDABCDABCDABCDABCD NAS-Port = 0 EAP-Sim-Rand1 = 0x89abcbeef9abcdef89abcdef89abcdef EAP-Sim-Rand2 = 0x9abcdef89abcdef89abcdef89abcdef8 EAP-Sim-Rand3 = 0xabcdef89abcdef89abcdef89abcdef89 EAP-Sim-SRES1 = 0x1234abcd EAP-Sim-SRES2 = 0x234abcd1 EAP-Sim-SRES3 = 0x34abcd12 EAP-Sim-KC1 = 0x0011223344556677 EAP-Sim-KC2 = 0x1021324354657687 EAP-Sim-KC3 = 0x30415263748596a7 EAP-Sim-State = 0 EAP-Sim-Subtype = Start EAP-Sim-SELECTED_VERSION = 0x0001 EAP-Sim-NONCE_MT = 0x000000a3f6b4e832cf46b4d3e0d090623e22 EAP-Sim-IDENTITY = 0x000665617073696d EAP-Id = YY State = 0xABCDABCDABCDABCDABCDABCDABCDABCD EAP-Message = 0x02XX Sending Access-Request of id 999 to 127.0.0.1:1812 User-Name = "eapsim" NAS-IP-Address = marajade.sandelman.ottawa.on.ca Message-Authenticator = 0xABCDABCDABCDABCDABCDABCDABCDABCD NAS-Port = 0 State = 0xABCDABCDABCDABCDABCDABCDABCDABCD EAP-Message = 0x02XX rad_recv: Access-Challenge packet from host 127.0.0.1:1812, id=999, length=138 EAP-Message = 0x01XX Message-Authenticator = 0xABCDABCDABCDABCDABCDABCDABCDABCD State = 0xABCDABCDABCDABCDABCDABCDABCDABCD <+++ EAP decoded packet: EAP-Message = 0x01XX Message-Authenticator = 0xABCDABCDABCDABCDABCDABCDABCDABCD State = 0xABCDABCDABCDABCDABCDABCDABCDABCD EAP-Id = YY EAP-Code = Request EAP-Type-SIM = 0x0b0000010d0000abcd1234abcd1234abcd1234abcd1234bcd1234abcd1234abcd1234abcd1234acd1234abcd1234abcd1234abcd1234ab0b050000XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX <+++ EAP-sim decoded packet: EAP-Message = 0x01XX Message-Authenticator = 0xABCDABCDABCDABCDABCDABCDABCDABCD State = 0xABCDABCDABCDABCDABCDABCDABCDABCD EAP-Id = YY EAP-Code = Request EAP-Type-SIM = 0x0b0000010d0000abcd1234abcd1234abcd1234abcd1234bcd1234abcd1234abcd1234abcd1234acd1234abcd1234abcd1234abcd1234ab0b050000XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX EAP-Sim-Subtype = Challenge EAP-Sim-RAND = 0x0000abcd1234abcd1234abcd1234abcd1234bcd1234abcd1234abcd1234abcd1234acd1234abcd1234abcd1234abcd1234ab EAP-Sim-MAC = 0xYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY freeradius-server/src/tests/eapsim-05/eapsim-raw.txt000066400000000000000000000162321257552170400227660ustar00rootroot00000000000000 +++> About to send encoded packet: User-Name = "eapsim" NAS-IP-Address = marajade.sandelman.ottawa.on.ca EAP-Code = Response EAP-Type-Identity = "eapsim" Message-Authenticator = 0x30 NAS-Port = 0 EAP-Sim-Rand1 = 0x89abcbeef9abcdef89abcdef89abcdef EAP-Sim-Rand2 = 0x9abcdef89abcdef89abcdef89abcdef8 EAP-Sim-Rand3 = 0xabcdef89abcdef89abcdef89abcdef89 EAP-Sim-SRES1 = 0x1234abcd EAP-Sim-SRES2 = 0x234abcd1 EAP-Sim-SRES3 = 0x34abcd12 EAP-Sim-KC1 = 0x0011223344556677 EAP-Sim-KC2 = 0x1021324354657687 EAP-Sim-KC3 = 0x30415263748596a7 Sending Access-Request of id 204 to 127.0.0.1:1812 User-Name = "eapsim" NAS-IP-Address = marajade.sandelman.ottawa.on.ca Message-Authenticator = 0x00000000000000000000000000000000 NAS-Port = 0 EAP-Message = 0x02cb000b0165617073696d rad_recv: Access-Challenge packet from host 127.0.0.1:1812, id=204, length=78 EAP-Message = 0x01a70014120a00000f0200020001000011010100 Message-Authenticator = 0xce4f705db940a4a61c0896712e259ecb State = 0xc313c2aa36347b14bc248a365651d25f <+++ EAP decoded packet: EAP-Message = 0x01a70014120a00000f0200020001000011010100 Message-Authenticator = 0xce4f705db940a4a61c0896712e259ecb State = 0xc313c2aa36347b14bc248a365651d25f EAP-Id = 167 EAP-Code = Request EAP-Type-SIM = 0x0a00000f0200020001000011010100 <+++ EAP-sim decoded packet: EAP-Message = 0x01a70014120a00000f0200020001000011010100 Message-Authenticator = 0xce4f705db940a4a61c0896712e259ecb State = 0xc313c2aa36347b14bc248a365651d25f EAP-Id = 167 EAP-Code = Request EAP-Type-SIM = 0x0a00000f0200020001000011010100 EAP-Sim-Subtype = Start EAP-Sim-VERSION_LIST = 0x000200010000 EAP-Sim-FULLAUTH_ID_REQ = 0x0100 +++> About to send encoded packet: User-Name = "eapsim" NAS-IP-Address = marajade.sandelman.ottawa.on.ca EAP-Code = Response Message-Authenticator = 0x00000000000000000000000000000000 NAS-Port = 0 EAP-Sim-Rand1 = 0x89abcbeef9abcdef89abcdef89abcdef EAP-Sim-Rand2 = 0x9abcdef89abcdef89abcdef89abcdef8 EAP-Sim-Rand3 = 0xabcdef89abcdef89abcdef89abcdef89 EAP-Sim-SRES1 = 0x1234abcd EAP-Sim-SRES2 = 0x234abcd1 EAP-Sim-SRES3 = 0x34abcd12 EAP-Sim-KC1 = 0x0011223344556677 EAP-Sim-KC2 = 0x1021324354657687 EAP-Sim-KC3 = 0x30415263748596a7 EAP-Sim-State = 1 EAP-Sim-Subtype = Start EAP-Sim-SELECTED_VERSION = 0x0001 EAP-Sim-NONCE_MT = 0x000000a3f6b4e832cf46b4d3e0d090623e22 EAP-Sim-IDENTITY = 0x000665617073696d EAP-Id = 167 EAP-Message = 0x02a7002c120a0000100100010705000000a3f6b4e832cf46b4d3e0d090623e220e03000665617073696d0000 State = 0xc313c2aa36347b14bc248a365651d25f Sending Access-Request of id 205 to 127.0.0.1:1812 User-Name = "eapsim" NAS-IP-Address = marajade.sandelman.ottawa.on.ca Message-Authenticator = 0x00000000000000000000000000000000 NAS-Port = 0 EAP-Message = 0x02a7002c120a0000100100010705000000a3f6b4e832cf46b4d3e0d090623e220e03000665617073696d0000 State = 0xc313c2aa36347b14bc248a365651d25f rad_recv: Access-Challenge packet from host 127.0.0.1:1812, id=205, length=138 EAP-Message = 0x01a80050120b0000010d0000abcd1234abcd1234abcd1234abcd1234bcd1234abcd1234abcd1234abcd1234acd1234abcd1234abcd1234abcd1234ab0b0500004295110227f46b83717e6d2f64ecd5f5 Message-Authenticator = 0xe76cfc6fb346d107b4b1d313faac212e State = 0xf94335155e78fbfc00ee2fab6d277167 <+++ EAP decoded packet: EAP-Message = 0x01a80050120b0000010d0000abcd1234abcd1234abcd1234abcd1234bcd1234abcd1234abcd1234abcd1234acd1234abcd1234abcd1234abcd1234ab0b0500004295110227f46b83717e6d2f64ecd5f5 Message-Authenticator = 0xe76cfc6fb346d107b4b1d313faac212e State = 0xf94335155e78fbfc00ee2fab6d277167 EAP-Id = 168 EAP-Code = Request EAP-Type-SIM = 0x0b0000010d0000abcd1234abcd1234abcd1234abcd1234bcd1234abcd1234abcd1234abcd1234acd1234abcd1234abcd1234abcd1234ab0b0500004295110227f46b83717e6d2f64ecd5f5 <+++ EAP-sim decoded packet: EAP-Message = 0x01a80050120b0000010d0000abcd1234abcd1234abcd1234abcd1234bcd1234abcd1234abcd1234abcd1234acd1234abcd1234abcd1234abcd1234ab0b0500004295110227f46b83717e6d2f64ecd5f5 Message-Authenticator = 0xe76cfc6fb346d107b4b1d313faac212e State = 0xf94335155e78fbfc00ee2fab6d277167 EAP-Id = 168 EAP-Code = Request EAP-Type-SIM = 0x0b0000010d0000abcd1234abcd1234abcd1234abcd1234bcd1234abcd1234abcd1234abcd1234acd1234abcd1234abcd1234abcd1234ab0b0500004295110227f46b83717e6d2f64ecd5f5 EAP-Sim-Subtype = Challenge EAP-Sim-RAND = 0x0000abcd1234abcd1234abcd1234abcd1234bcd1234abcd1234abcd1234abcd1234acd1234abcd1234abcd1234abcd1234ab EAP-Sim-MAC = 0x00004295110227f46b83717e6d2f64ecd5f5 __________________ +++> About to send encoded packet: User-Name = "eapsim" NAS-IP-Address = marajade.sandelman.ottawa.on.ca EAP-Code = Response Message-Authenticator = 0x00000000000000000000000000000000 NAS-Port = 0 EAP-Sim-Rand1 = 0x89abcbeef9abcdef89abcdef89abcdef EAP-Sim-Rand2 = 0x9abcdef89abcdef89abcdef89abcdef8 EAP-Sim-Rand3 = 0xabcdef89abcdef89abcdef89abcdef89 EAP-Sim-SRES1 = 0x1234abcd EAP-Sim-SRES2 = 0x234abcd1 EAP-Sim-SRES3 = 0x34abcd12 EAP-Sim-KC1 = 0x0011223344556677 EAP-Sim-KC2 = 0x1021324354657687 EAP-Sim-KC3 = 0x30415263748596a7 EAP-Sim-State = 0 EAP-Sim-Subtype = Start EAP-Sim-SELECTED_VERSION = 0x0001 EAP-Sim-NONCE_MT = 0x000000a3f6b4e832cf46b4d3e0d090623e22 EAP-Sim-IDENTITY = 0x000665617073696d EAP-Id = 168 State = 0xf94335155e78fbfc00ee2fab6d277167 EAP-Message = 0x02a8002c120a0000100100010705000000a3f6b4e832cf46b4d3e0d090623e220e03000665617073696d0000 Sending Access-Request of id 206 to 127.0.0.1:1812 User-Name = "eapsim" NAS-IP-Address = marajade.sandelman.ottawa.on.ca Message-Authenticator = 0x00000000000000000000000000000000 NAS-Port = 0 State = 0xf94335155e78fbfc00ee2fab6d277167 EAP-Message = 0x02a8002c120a0000100100010705000000a3f6b4e832cf46b4d3e0d090623e220e03000665617073696d0000 rad_recv: Access-Challenge packet from host 127.0.0.1:1812, id=206, length=138 EAP-Message = 0x01a90050120b0000010d0000abcd1234abcd1234abcd1234abcd1234bcd1234abcd1234abcd1234abcd1234acd1234abcd1234abcd1234abcd1234ab0b050000d7c75f997bf27cd7a46f3b34f8a8f5b3 Message-Authenticator = 0x16fc76638c72e04b8b43ab48edcf5088 State = 0xb9449aca40be007b0a641b9fa5b1f761 <+++ EAP decoded packet: EAP-Message = 0x01a90050120b0000010d0000abcd1234abcd1234abcd1234abcd1234bcd1234abcd1234abcd1234abcd1234acd1234abcd1234abcd1234abcd1234ab0b050000d7c75f997bf27cd7a46f3b34f8a8f5b3 Message-Authenticator = 0x16fc76638c72e04b8b43ab48edcf5088 State = 0xb9449aca40be007b0a641b9fa5b1f761 EAP-Id = 169 EAP-Code = Request EAP-Type-SIM = 0x0b0000010d0000abcd1234abcd1234abcd1234abcd1234bcd1234abcd1234abcd1234abcd1234acd1234abcd1234abcd1234abcd1234ab0b050000d7c75f997bf27cd7a46f3b34f8a8f5b3 <+++ EAP-sim decoded packet: EAP-Message = 0x01a90050120b0000010d0000abcd1234abcd1234abcd1234abcd1234bcd1234abcd1234abcd1234abcd1234acd1234abcd1234abcd1234abcd1234ab0b050000d7c75f997bf27cd7a46f3b34f8a8f5b3 Message-Authenticator = 0x16fc76638c72e04b8b43ab48edcf5088 State = 0xb9449aca40be007b0a641b9fa5b1f761 EAP-Id = 169 EAP-Code = Request EAP-Type-SIM = 0x0b0000010d0000abcd1234abcd1234abcd1234abcd1234bcd1234abcd1234abcd1234abcd1234acd1234abcd1234abcd1234abcd1234ab0b050000d7c75f997bf27cd7a46f3b34f8a8f5b3 EAP-Sim-Subtype = Challenge EAP-Sim-RAND = 0x0000abcd1234abcd1234abcd1234abcd1234bcd1234abcd1234abcd1234abcd1234acd1234abcd1234abcd1234abcd1234ab EAP-Sim-MAC = 0x0000d7c75f997bf27cd7a46f3b34f8a8f5b3 freeradius-server/src/tests/eapsim-05/eapsim-sanitize.sed000066400000000000000000000007421257552170400237560ustar00rootroot00000000000000s/\(Sending Access-Request of id\).*\(to 127.0.0.1:1812\)/\1 999 \2/ s/\(Message-Authenticator = 0x\).*/\1ABCDABCDABCDABCDABCDABCDABCDABCD/ s/\(State = 0x\).*/\1ABCDABCDABCDABCDABCDABCDABCDABCD/ s/\(rad_recv: Access-Challenge packet from host 127.0.0.1:1812, id\)=.*,\( length=.*\)/\1=999,\2/ s/\(rad_recv: Access-Accept packet from host 127.0.0.1:1812, id\)=.*,\( length=.*\)/\1=999,\2/ s/\(EAP-Message = 0x..\)\(.*\)/\1XX/ s/\(EAP-Id = \).*/\1YY/ s/\(EAP-Type-MD5 = \).*/\1MD5/ freeradius-server/src/tests/eapsim-06/000077500000000000000000000000001257552170400201555ustar00rootroot00000000000000freeradius-server/src/tests/eapsim-06/check.gdb000066400000000000000000000001341257552170400217060ustar00rootroot00000000000000file ../../modules/rlm_eap/radeapclient set args -x localhost auth testing123 About to send encoded packet: User-Name = "232420100000015" NAS-IP-Address = marajade.sandelman.ottawa.on.ca EAP-Code = Response EAP-Type-Identity = "232420100000015" Message-Authenticator = 0xABCDABCDABCDABCDABCDABCDABCDABCD NAS-Port = 0 EAP-Sim-Rand1 = 0x30000000000000000000000000000000 EAP-Sim-Rand2 = 0x31000000000000000000000000000000 EAP-Sim-Rand3 = 0x32000000000000000000000000000000 EAP-Sim-SRES1 = 0x30112233 EAP-Sim-SRES2 = 0x31112233 EAP-Sim-SRES3 = 0x32112233 EAP-Sim-KC1 = 0x445566778899aabb EAP-Sim-KC2 = 0x445566778899aabb EAP-Sim-KC3 = 0x445566778899aabb Sending Access-Request of id 999 to 127.0.0.1:1812 User-Name = "232420100000015" NAS-IP-Address = marajade.sandelman.ottawa.on.ca Message-Authenticator = 0xABCDABCDABCDABCDABCDABCDABCDABCD NAS-Port = 0 EAP-Message = 0x02XX rad_recv: Access-Challenge packet from host 127.0.0.1:1812, id=999, length=78 EAP-Message = 0x01XX Message-Authenticator = 0xABCDABCDABCDABCDABCDABCDABCDABCD State = 0xABCDABCDABCDABCDABCDABCDABCDABCD <+++ EAP decoded packet: EAP-Message = 0x01XX Message-Authenticator = 0xABCDABCDABCDABCDABCDABCDABCDABCD State = 0xABCDABCDABCDABCDABCDABCDABCDABCD EAP-Id = YY EAP-Code = Request EAP-Type-SIM = 0x0a00000f0200020001000011010100 <+++ EAP-sim decoded packet: EAP-Message = 0x01XX Message-Authenticator = 0xABCDABCDABCDABCDABCDABCDABCDABCD State = 0xABCDABCDABCDABCDABCDABCDABCDABCD EAP-Id = YY EAP-Code = Request EAP-Type-SIM = 0x0a00000f0200020001000011010100 EAP-Sim-Subtype = Start EAP-Sim-VERSION_LIST = 0x000200010000 EAP-Sim-FULLAUTH_ID_REQ = 0x0100 +++> About to send encoded packet: User-Name = "232420100000015" NAS-IP-Address = marajade.sandelman.ottawa.on.ca EAP-Code = Response Message-Authenticator = 0xABCDABCDABCDABCDABCDABCDABCDABCD NAS-Port = 0 EAP-Sim-Rand1 = 0x30000000000000000000000000000000 EAP-Sim-Rand2 = 0x31000000000000000000000000000000 EAP-Sim-Rand3 = 0x32000000000000000000000000000000 EAP-Sim-SRES1 = 0x30112233 EAP-Sim-SRES2 = 0x31112233 EAP-Sim-SRES3 = 0x32112233 EAP-Sim-KC1 = 0x445566778899aabb EAP-Sim-KC2 = 0x445566778899aabb EAP-Sim-KC3 = 0x445566778899aabb EAP-Sim-State = 1 EAP-Sim-Subtype = Start EAP-Sim-SELECTED_VERSION = 0x0001 EAP-Sim-NONCE_MT = 0x00001b764ea5668faa4b0e7dd876d25753f8 EAP-Sim-IDENTITY = 0x000f323332343230313030303030303135 EAP-Id = YY EAP-Message = 0x02XX State = 0xABCDABCDABCDABCDABCDABCDABCDABCD Sending Access-Request of id 999 to 127.0.0.1:1812 User-Name = "232420100000015" NAS-IP-Address = marajade.sandelman.ottawa.on.ca Message-Authenticator = 0xABCDABCDABCDABCDABCDABCDABCDABCD NAS-Port = 0 EAP-Message = 0x02XX State = 0xABCDABCDABCDABCDABCDABCDABCDABCD rad_recv: Access-Challenge packet from host 127.0.0.1:1812, id=999, length=138 EAP-Message = 0x01XX Message-Authenticator = 0xABCDABCDABCDABCDABCDABCDABCDABCD State = 0xABCDABCDABCDABCDABCDABCDABCDABCD <+++ EAP decoded packet: EAP-Message = 0x01XX Message-Authenticator = 0xABCDABCDABCDABCDABCDABCDABCDABCD State = 0xABCDABCDABCDABCDABCDABCDABCDABCD EAP-Id = YY EAP-Code = Request EAP-Type-SIM = 0x0b0000010d00003000000000000000000000000000000031000000000000000000000000000000320000000000000000000000000000000b050000XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX <+++ EAP-sim decoded packet: EAP-Message = 0x01XX Message-Authenticator = 0xABCDABCDABCDABCDABCDABCDABCDABCD State = 0xABCDABCDABCDABCDABCDABCDABCDABCD EAP-Id = YY EAP-Code = Request EAP-Type-SIM = 0x0b0000010d00003000000000000000000000000000000031000000000000000000000000000000320000000000000000000000000000000b050000XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX EAP-Sim-Subtype = Challenge EAP-Sim-RAND = 0x0000300000000000000000000000000000003100000000000000000000000000000032000000000000000000000000000000 EAP-Sim-MAC = 0xYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY Input was: identity: (len=15)323332343230313030303030303135 nonce_mt: 1b764ea5668faa4b0e7dd876d25753f8 rand0: 00000000000000000000000000000000 rand1: 00000000000000000000000000000000 rand2: 00000000000000000000000000000000 sres0: 30112233 sres1: 31112233 sres2: 32112233 Kc0: 445566778899aabb Kc1: 445566778899aabb Kc2: 445566778899aabb versionlist[2]: 0001 select 00 01 Output mk: a444d7cc_dd514568_da171dd4_229ed4d1_a088c470 K_aut: a4c96a3c_1b4e1932_acc3878d_ecb5d9c6 K_encr: f544a796_43c4d95f_90aaa5b7_74267742 msk: 8000f5e4_ed05a9bf_17b9ec6a_27f92d9d_f104966b 03689665_de45db49_82ecdcc4_85c26910_e886de4f bdfa4218_b4ef2f64_319c9b41_b77b3c90_69d616f9 0781438a emsk: 3c87c92f_44193e35_dd18e906_3d7cff8f_cb6d6002 bf233300_5df66776_70086929_f0d27970_3e59c480 675d6b45_0dc6a79a_51dc34b0_7091a5ff_8ca145ce 98accef2 hmac-sha1 key(16): a4c96a3c_1b4e1932_acc3878d_ecb5d9c6 DATA: (96) 01YY0050_120b0000_010d0000_30000000_00000000 00000000_00000000_31000000_00000000_00000000 00000000_32000000_00000000_00000000_00000000 0b050000_00000000_00000000_00000000_00000000 1b764ea5_668faa4b_0e7dd876_d25753f8 hmac-sha1 mac(20): XXXXXXXX_XXXXXXXX_XXXXXXXX_XXXXXXXX_XXXXXXXX MAC check succeed hmac-sha1 key(16): a4c96a3c_1b4e1932_acc3878d_ecb5d9c6 DATA: (40) 02YY001c_120b0000_0b050000_00000000_00000000 00000000_00000000_30112233_31112233_32112233 hmac-sha1 mac(20): XXXXXXXX_XXXXXXXX_XXXXXXXX_XXXXXXXX_XXXXXXXX +++> About to send encoded packet: User-Name = "232420100000015" NAS-IP-Address = marajade.sandelman.ottawa.on.ca EAP-Code = Response Message-Authenticator = 0xABCDABCDABCDABCDABCDABCDABCDABCD NAS-Port = 0 EAP-Sim-Rand1 = 0x30000000000000000000000000000000 EAP-Sim-Rand2 = 0x31000000000000000000000000000000 EAP-Sim-Rand3 = 0x32000000000000000000000000000000 EAP-Sim-SRES1 = 0x30112233 EAP-Sim-SRES2 = 0x31112233 EAP-Sim-SRES3 = 0x32112233 EAP-Sim-KC1 = 0x445566778899aabb EAP-Sim-KC2 = 0x445566778899aabb EAP-Sim-KC3 = 0x445566778899aabb EAP-Sim-State = 1 EAP-Sim-Subtype = Challenge EAP-Id = YY State = 0xABCDABCDABCDABCDABCDABCDABCDABCD EAP-Sim-MAC = 0x301122333111223332112233 EAP-Sim-KEY = 0xa4c96a3c1b4e1932acc3878decb5d9c6 EAP-Message = 0x02XX Sending Access-Request of id 999 to 127.0.0.1:1812 User-Name = "232420100000015" NAS-IP-Address = marajade.sandelman.ottawa.on.ca Message-Authenticator = 0xABCDABCDABCDABCDABCDABCDABCDABCD NAS-Port = 0 State = 0xABCDABCDABCDABCDABCDABCDABCDABCD EAP-Message = 0x02XX rad_recv: Access-Accept packet from host 127.0.0.1:1812, id=999, length=177 MS-MPPE-Recv-Key = 0x8000f5e4ed05a9bf17b9ec6a27f92d9df104966b03689665de45db4982ecdcc4 MS-MPPE-Send-Key = 0x85c26910e886de4fbdfa4218b4ef2f64319c9b41b77b3c9069d616f90781438a EAP-Message = 0x03XX Message-Authenticator = 0xABCDABCDABCDABCDABCDABCDABCDABCD User-Name = "232420100000015" <+++ EAP decoded packet: MS-MPPE-Recv-Key = 0x8000f5e4ed05a9bf17b9ec6a27f92d9df104966b03689665de45db4982ecdcc4 MS-MPPE-Send-Key = 0x85c26910e886de4fbdfa4218b4ef2f64319c9b41b77b3c9069d616f90781438a EAP-Message = 0x03XX Message-Authenticator = 0xABCDABCDABCDABCDABCDABCDABCDABCD User-Name = "232420100000015" EAP-Id = YY EAP-Code = Success freeradius-server/src/tests/eapsim-06/eapsim-in.txt000066400000000000000000000007751257552170400226110ustar00rootroot00000000000000User-Name = "232420100000015" NAS-IP-Address = marajade.sandelman.ottawa.on.ca EAP-Code = Response EAP-Type-Identity = "232420100000015" Message-Authenticator = 0 NAS-Port = 0 EAP-Sim-Rand1 = 0x30000000000000000000000000000000 EAP-Sim-Rand2 = 0x31000000000000000000000000000000 EAP-Sim-Rand3 = 0x32000000000000000000000000000000 EAP-Sim-Sres1 = 0x30112233 EAP-Sim-Sres2 = 0x31112233 EAP-Sim-Sres3 = 0x32112233 EAP-Sim-KC1 = 0x445566778899AABB EAP-Sim-KC2 = 0x445566778899AABB EAP-Sim-KC3 = 0x445566778899AABB freeradius-server/src/tests/eapsim-06/eapsim-out.txt000066400000000000000000000160041257552170400230020ustar00rootroot00000000000000 +++> About to send encoded packet: User-Name = "232420100000015" NAS-IP-Address = marajade.sandelman.ottawa.on.ca EAP-Code = Response EAP-Type-Identity = "232420100000015" Message-Authenticator = 0xABCDABCDABCDABCDABCDABCDABCDABCD NAS-Port = 0 EAP-Sim-Rand1 = 0x30000000000000000000000000000000 EAP-Sim-Rand2 = 0x31000000000000000000000000000000 EAP-Sim-Rand3 = 0x32000000000000000000000000000000 EAP-Sim-SRES1 = 0x30112233 EAP-Sim-SRES2 = 0x31112233 EAP-Sim-SRES3 = 0x32112233 EAP-Sim-KC1 = 0x445566778899aabb EAP-Sim-KC2 = 0x445566778899aabb EAP-Sim-KC3 = 0x445566778899aabb Sending Access-Request of id 999 to 127.0.0.1:1812 User-Name = "232420100000015" NAS-IP-Address = marajade.sandelman.ottawa.on.ca Message-Authenticator = 0xABCDABCDABCDABCDABCDABCDABCDABCD NAS-Port = 0 EAP-Message = 0x02XX rad_recv: Access-Challenge packet from host 127.0.0.1:1812, id=999, length=78 EAP-Message = 0x01XX Message-Authenticator = 0xABCDABCDABCDABCDABCDABCDABCDABCD State = 0xABCDABCDABCDABCDABCDABCDABCDABCD <+++ EAP decoded packet: EAP-Message = 0x01XX Message-Authenticator = 0xABCDABCDABCDABCDABCDABCDABCDABCD State = 0xABCDABCDABCDABCDABCDABCDABCDABCD EAP-Id = YY EAP-Code = Request EAP-Type-SIM = 0x0a00000f0200020001000011010100 <+++ EAP-sim decoded packet: EAP-Message = 0x01XX Message-Authenticator = 0xABCDABCDABCDABCDABCDABCDABCDABCD State = 0xABCDABCDABCDABCDABCDABCDABCDABCD EAP-Id = YY EAP-Code = Request EAP-Type-SIM = 0x0a00000f0200020001000011010100 EAP-Sim-Subtype = Start EAP-Sim-VERSION_LIST = 0x000200010000 EAP-Sim-FULLAUTH_ID_REQ = 0x0100 +++> About to send encoded packet: User-Name = "232420100000015" NAS-IP-Address = marajade.sandelman.ottawa.on.ca EAP-Code = Response Message-Authenticator = 0xABCDABCDABCDABCDABCDABCDABCDABCD NAS-Port = 0 EAP-Sim-Rand1 = 0x30000000000000000000000000000000 EAP-Sim-Rand2 = 0x31000000000000000000000000000000 EAP-Sim-Rand3 = 0x32000000000000000000000000000000 EAP-Sim-SRES1 = 0x30112233 EAP-Sim-SRES2 = 0x31112233 EAP-Sim-SRES3 = 0x32112233 EAP-Sim-KC1 = 0x445566778899aabb EAP-Sim-KC2 = 0x445566778899aabb EAP-Sim-KC3 = 0x445566778899aabb EAP-Sim-State = 1 EAP-Sim-Subtype = Start EAP-Sim-SELECTED_VERSION = 0x0001 EAP-Sim-NONCE_MT = 0x00001b764ea5668faa4b0e7dd876d25753f8 EAP-Sim-IDENTITY = 0x000f323332343230313030303030303135 EAP-Id = YY EAP-Message = 0x02XX State = 0xABCDABCDABCDABCDABCDABCDABCDABCD Sending Access-Request of id 999 to 127.0.0.1:1812 User-Name = "232420100000015" NAS-IP-Address = marajade.sandelman.ottawa.on.ca Message-Authenticator = 0xABCDABCDABCDABCDABCDABCDABCDABCD NAS-Port = 0 EAP-Message = 0x02XX State = 0xABCDABCDABCDABCDABCDABCDABCDABCD rad_recv: Access-Challenge packet from host 127.0.0.1:1812, id=999, length=138 EAP-Message = 0x01XX Message-Authenticator = 0xABCDABCDABCDABCDABCDABCDABCDABCD State = 0xABCDABCDABCDABCDABCDABCDABCDABCD <+++ EAP decoded packet: EAP-Message = 0x01XX Message-Authenticator = 0xABCDABCDABCDABCDABCDABCDABCDABCD State = 0xABCDABCDABCDABCDABCDABCDABCDABCD EAP-Id = YY EAP-Code = Request EAP-Type-SIM = 0x0b0000010d00003000000000000000000000000000000031000000000000000000000000000000320000000000000000000000000000000b050000XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX <+++ EAP-sim decoded packet: EAP-Message = 0x01XX Message-Authenticator = 0xABCDABCDABCDABCDABCDABCDABCDABCD State = 0xABCDABCDABCDABCDABCDABCDABCDABCD EAP-Id = YY EAP-Code = Request EAP-Type-SIM = 0x0b0000010d00003000000000000000000000000000000031000000000000000000000000000000320000000000000000000000000000000b050000XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX EAP-Sim-Subtype = Challenge EAP-Sim-RAND = 0x0000300000000000000000000000000000003100000000000000000000000000000032000000000000000000000000000000 EAP-Sim-MAC = 0xYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY Input was: identity: (len=15)323332343230313030303030303135 nonce_mt: 1b764ea5668faa4b0e7dd876d25753f8 rand0: 00000000000000000000000000000000 rand1: 00000000000000000000000000000000 rand2: 00000000000000000000000000000000 sres0: 30112233 sres1: 31112233 sres2: 32112233 Kc0: 445566778899aabb Kc1: 445566778899aabb Kc2: 445566778899aabb versionlist[2]: 0001 select 00 01 Output mk: a444d7cc_dd514568_da171dd4_229ed4d1_a088c470 K_aut: a4c96a3c_1b4e1932_acc3878d_ecb5d9c6 K_encr: f544a796_43c4d95f_90aaa5b7_74267742 msk: 8000f5e4_ed05a9bf_17b9ec6a_27f92d9d_f104966b 03689665_de45db49_82ecdcc4_85c26910_e886de4f bdfa4218_b4ef2f64_319c9b41_b77b3c90_69d616f9 0781438a emsk: 3c87c92f_44193e35_dd18e906_3d7cff8f_cb6d6002 bf233300_5df66776_70086929_f0d27970_3e59c480 675d6b45_0dc6a79a_51dc34b0_7091a5ff_8ca145ce 98accef2 hmac-sha1 key(16): a4c96a3c_1b4e1932_acc3878d_ecb5d9c6 DATA: (96) 01YY0050_120b0000_010d0000_30000000_00000000 00000000_00000000_31000000_00000000_00000000 00000000_32000000_00000000_00000000_00000000 0b050000_00000000_00000000_00000000_00000000 1b764ea5_668faa4b_0e7dd876_d25753f8 hmac-sha1 mac(20): XXXXXXXX_XXXXXXXX_XXXXXXXX_XXXXXXXX_XXXXXXXX MAC check succeed hmac-sha1 key(16): a4c96a3c_1b4e1932_acc3878d_ecb5d9c6 DATA: (40) 02YY001c_120b0000_0b050000_00000000_00000000 00000000_00000000_30112233_31112233_32112233 hmac-sha1 mac(20): XXXXXXXX_XXXXXXXX_XXXXXXXX_XXXXXXXX_XXXXXXXX +++> About to send encoded packet: User-Name = "232420100000015" NAS-IP-Address = marajade.sandelman.ottawa.on.ca EAP-Code = Response Message-Authenticator = 0xABCDABCDABCDABCDABCDABCDABCDABCD NAS-Port = 0 EAP-Sim-Rand1 = 0x30000000000000000000000000000000 EAP-Sim-Rand2 = 0x31000000000000000000000000000000 EAP-Sim-Rand3 = 0x32000000000000000000000000000000 EAP-Sim-SRES1 = 0x30112233 EAP-Sim-SRES2 = 0x31112233 EAP-Sim-SRES3 = 0x32112233 EAP-Sim-KC1 = 0x445566778899aabb EAP-Sim-KC2 = 0x445566778899aabb EAP-Sim-KC3 = 0x445566778899aabb EAP-Sim-State = 1 EAP-Sim-Subtype = Challenge EAP-Id = YY State = 0xABCDABCDABCDABCDABCDABCDABCDABCD EAP-Sim-MAC = 0x301122333111223332112233 EAP-Sim-KEY = 0xa4c96a3c1b4e1932acc3878decb5d9c6 EAP-Message = 0x02XX Sending Access-Request of id 999 to 127.0.0.1:1812 User-Name = "232420100000015" NAS-IP-Address = marajade.sandelman.ottawa.on.ca Message-Authenticator = 0xABCDABCDABCDABCDABCDABCDABCDABCD NAS-Port = 0 State = 0xABCDABCDABCDABCDABCDABCDABCDABCD EAP-Message = 0x02XX rad_recv: Access-Accept packet from host 127.0.0.1:1812, id=999, length=177 MS-MPPE-Recv-Key = 0x8000f5e4ed05a9bf17b9ec6a27f92d9df104966b03689665de45db4982ecdcc4 MS-MPPE-Send-Key = 0x85c26910e886de4fbdfa4218b4ef2f64319c9b41b77b3c9069d616f90781438a EAP-Message = 0x03XX Message-Authenticator = 0xABCDABCDABCDABCDABCDABCDABCDABCD User-Name = "232420100000015" <+++ EAP decoded packet: MS-MPPE-Recv-Key = 0x8000f5e4ed05a9bf17b9ec6a27f92d9df104966b03689665de45db4982ecdcc4 MS-MPPE-Send-Key = 0x85c26910e886de4fbdfa4218b4ef2f64319c9b41b77b3c9069d616f90781438a EAP-Message = 0x03XX Message-Authenticator = 0xABCDABCDABCDABCDABCDABCDABCDABCD User-Name = "232420100000015" EAP-Id = YY EAP-Code = Success freeradius-server/src/tests/eapsim-06/eapsim-raw.txt000066400000000000000000000175751257552170400230020ustar00rootroot00000000000000 +++> About to send encoded packet: User-Name = "232420100000015" NAS-IP-Address = marajade.sandelman.ottawa.on.ca EAP-Code = Response EAP-Type-Identity = "232420100000015" Message-Authenticator = 0x30 NAS-Port = 0 EAP-Sim-Rand1 = 0x30000000000000000000000000000000 EAP-Sim-Rand2 = 0x31000000000000000000000000000000 EAP-Sim-Rand3 = 0x32000000000000000000000000000000 EAP-Sim-SRES1 = 0x30112233 EAP-Sim-SRES2 = 0x31112233 EAP-Sim-SRES3 = 0x32112233 EAP-Sim-KC1 = 0x445566778899aabb EAP-Sim-KC2 = 0x445566778899aabb EAP-Sim-KC3 = 0x445566778899aabb Sending Access-Request of id 22 to 127.0.0.1:1812 User-Name = "232420100000015" NAS-IP-Address = marajade.sandelman.ottawa.on.ca Message-Authenticator = 0x00000000000000000000000000000000 NAS-Port = 0 EAP-Message = 0x0215001401323332343230313030303030303135 rad_recv: Access-Challenge packet from host 127.0.0.1:1812, id=22, length=78 EAP-Message = 0x01270014120a00000f0200020001000011010100 Message-Authenticator = 0x77ea02a9c89f5e87f5ce65c10877232f State = 0xf0524fef7731860cc1d28b0dc573017c <+++ EAP decoded packet: EAP-Message = 0x01270014120a00000f0200020001000011010100 Message-Authenticator = 0x77ea02a9c89f5e87f5ce65c10877232f State = 0xf0524fef7731860cc1d28b0dc573017c EAP-Id = 39 EAP-Code = Request EAP-Type-SIM = 0x0a00000f0200020001000011010100 <+++ EAP-sim decoded packet: EAP-Message = 0x01270014120a00000f0200020001000011010100 Message-Authenticator = 0x77ea02a9c89f5e87f5ce65c10877232f State = 0xf0524fef7731860cc1d28b0dc573017c EAP-Id = 39 EAP-Code = Request EAP-Type-SIM = 0x0a00000f0200020001000011010100 EAP-Sim-Subtype = Start EAP-Sim-VERSION_LIST = 0x000200010000 EAP-Sim-FULLAUTH_ID_REQ = 0x0100 +++> About to send encoded packet: User-Name = "232420100000015" NAS-IP-Address = marajade.sandelman.ottawa.on.ca EAP-Code = Response Message-Authenticator = 0x00000000000000000000000000000000 NAS-Port = 0 EAP-Sim-Rand1 = 0x30000000000000000000000000000000 EAP-Sim-Rand2 = 0x31000000000000000000000000000000 EAP-Sim-Rand3 = 0x32000000000000000000000000000000 EAP-Sim-SRES1 = 0x30112233 EAP-Sim-SRES2 = 0x31112233 EAP-Sim-SRES3 = 0x32112233 EAP-Sim-KC1 = 0x445566778899aabb EAP-Sim-KC2 = 0x445566778899aabb EAP-Sim-KC3 = 0x445566778899aabb EAP-Sim-State = 1 EAP-Sim-Subtype = Start EAP-Sim-SELECTED_VERSION = 0x0001 EAP-Sim-NONCE_MT = 0x00001b764ea5668faa4b0e7dd876d25753f8 EAP-Sim-IDENTITY = 0x000f323332343230313030303030303135 EAP-Id = 39 EAP-Message = 0x02270034120a000010010001070500001b764ea5668faa4b0e7dd876d25753f80e05000f32333234323031303030303030313500 State = 0xf0524fef7731860cc1d28b0dc573017c Sending Access-Request of id 23 to 127.0.0.1:1812 User-Name = "232420100000015" NAS-IP-Address = marajade.sandelman.ottawa.on.ca Message-Authenticator = 0x00000000000000000000000000000000 NAS-Port = 0 EAP-Message = 0x02270034120a000010010001070500001b764ea5668faa4b0e7dd876d25753f80e05000f32333234323031303030303030313500 State = 0xf0524fef7731860cc1d28b0dc573017c rad_recv: Access-Challenge packet from host 127.0.0.1:1812, id=23, length=138 EAP-Message = 0x01280050120b0000010d00003000000000000000000000000000000031000000000000000000000000000000320000000000000000000000000000000b050000a91362adf370809ac998c123ebcb32bd Message-Authenticator = 0x2a36d73274543865af44e142fcce7723 State = 0x73765e7615012c333beac9182696279c <+++ EAP decoded packet: EAP-Message = 0x01280050120b0000010d00003000000000000000000000000000000031000000000000000000000000000000320000000000000000000000000000000b050000a91362adf370809ac998c123ebcb32bd Message-Authenticator = 0x2a36d73274543865af44e142fcce7723 State = 0x73765e7615012c333beac9182696279c EAP-Id = 40 EAP-Code = Request EAP-Type-SIM = 0x0b0000010d00003000000000000000000000000000000031000000000000000000000000000000320000000000000000000000000000000b050000a91362adf370809ac998c123ebcb32bd <+++ EAP-sim decoded packet: EAP-Message = 0x01280050120b0000010d00003000000000000000000000000000000031000000000000000000000000000000320000000000000000000000000000000b050000a91362adf370809ac998c123ebcb32bd Message-Authenticator = 0x2a36d73274543865af44e142fcce7723 State = 0x73765e7615012c333beac9182696279c EAP-Id = 40 EAP-Code = Request EAP-Type-SIM = 0x0b0000010d00003000000000000000000000000000000031000000000000000000000000000000320000000000000000000000000000000b050000a91362adf370809ac998c123ebcb32bd EAP-Sim-Subtype = Challenge EAP-Sim-RAND = 0x0000300000000000000000000000000000003100000000000000000000000000000032000000000000000000000000000000 EAP-Sim-MAC = 0x0000a91362adf370809ac998c123ebcb32bd Input was: identity: (len=15)323332343230313030303030303135 nonce_mt: 1b764ea5668faa4b0e7dd876d25753f8 rand0: 00000000000000000000000000000000 rand1: 00000000000000000000000000000000 rand2: 00000000000000000000000000000000 sres0: 30112233 sres1: 31112233 sres2: 32112233 Kc0: 445566778899aabb Kc1: 445566778899aabb Kc2: 445566778899aabb versionlist[2]: 0001 select 00 01 Output mk: a444d7cc_dd514568_da171dd4_229ed4d1_a088c470 K_aut: a4c96a3c_1b4e1932_acc3878d_ecb5d9c6 K_encr: f544a796_43c4d95f_90aaa5b7_74267742 msk: 8000f5e4_ed05a9bf_17b9ec6a_27f92d9d_f104966b 03689665_de45db49_82ecdcc4_85c26910_e886de4f bdfa4218_b4ef2f64_319c9b41_b77b3c90_69d616f9 0781438a emsk: 3c87c92f_44193e35_dd18e906_3d7cff8f_cb6d6002 bf233300_5df66776_70086929_f0d27970_3e59c480 675d6b45_0dc6a79a_51dc34b0_7091a5ff_8ca145ce 98accef2 hmac-sha1 key(16): a4c96a3c_1b4e1932_acc3878d_ecb5d9c6 DATA: (96) 01280050_120b0000_010d0000_30000000_00000000 00000000_00000000_31000000_00000000_00000000 00000000_32000000_00000000_00000000_00000000 0b050000_00000000_00000000_00000000_00000000 1b764ea5_668faa4b_0e7dd876_d25753f8 hmac-sha1 mac(20): a91362ad_f370809a_c998c123_ebcb32bd_6a2915c2 MAC check succeed hmac-sha1 key(16): a4c96a3c_1b4e1932_acc3878d_ecb5d9c6 DATA: (40) 0228001c_120b0000_0b050000_00000000_00000000 00000000_00000000_30112233_31112233_32112233 hmac-sha1 mac(20): 7a3818ad_17959b80_99cd84eb_64e45346_d63098e9 +++> About to send encoded packet: User-Name = "232420100000015" NAS-IP-Address = marajade.sandelman.ottawa.on.ca EAP-Code = Response Message-Authenticator = 0x00000000000000000000000000000000 NAS-Port = 0 EAP-Sim-Rand1 = 0x30000000000000000000000000000000 EAP-Sim-Rand2 = 0x31000000000000000000000000000000 EAP-Sim-Rand3 = 0x32000000000000000000000000000000 EAP-Sim-SRES1 = 0x30112233 EAP-Sim-SRES2 = 0x31112233 EAP-Sim-SRES3 = 0x32112233 EAP-Sim-KC1 = 0x445566778899aabb EAP-Sim-KC2 = 0x445566778899aabb EAP-Sim-KC3 = 0x445566778899aabb EAP-Sim-State = 1 EAP-Sim-Subtype = Challenge EAP-Id = 40 State = 0x73765e7615012c333beac9182696279c EAP-Sim-MAC = 0x301122333111223332112233 EAP-Sim-KEY = 0xa4c96a3c1b4e1932acc3878decb5d9c6 EAP-Message = 0x0228001c120b00000b0500007a3818ad17959b8099cd84eb64e45346 Sending Access-Request of id 24 to 127.0.0.1:1812 User-Name = "232420100000015" NAS-IP-Address = marajade.sandelman.ottawa.on.ca Message-Authenticator = 0x00000000000000000000000000000000 NAS-Port = 0 State = 0x73765e7615012c333beac9182696279c EAP-Message = 0x0228001c120b00000b0500007a3818ad17959b8099cd84eb64e45346 rad_recv: Access-Accept packet from host 127.0.0.1:1812, id=24, length=177 MS-MPPE-Recv-Key = 0x8000f5e4ed05a9bf17b9ec6a27f92d9df104966b03689665de45db4982ecdcc4 MS-MPPE-Send-Key = 0x85c26910e886de4fbdfa4218b4ef2f64319c9b41b77b3c9069d616f90781438a EAP-Message = 0x03000004 Message-Authenticator = 0xc34c14d1a9c794cbc3f7c5c274831277 User-Name = "232420100000015" <+++ EAP decoded packet: MS-MPPE-Recv-Key = 0x8000f5e4ed05a9bf17b9ec6a27f92d9df104966b03689665de45db4982ecdcc4 MS-MPPE-Send-Key = 0x85c26910e886de4fbdfa4218b4ef2f64319c9b41b77b3c9069d616f90781438a EAP-Message = 0x03000004 Message-Authenticator = 0xc34c14d1a9c794cbc3f7c5c274831277 User-Name = "232420100000015" EAP-Id = 0 EAP-Code = Success freeradius-server/src/tests/eapsim-06/simtriplets.dat000066400000000000000000000005671257552170400232360ustar00rootroot00000000000000232420100000015,30000000000000000000000000000000,30112233,445566778899AABB 232420100000015,31000000000000000000000000000000,31112233,445566778899AABB 232420100000015,32000000000000000000000000000000,32112233,445566778899AABB 232420100000015,33000000000000000000000000000000,33112233,445566778899AABB 232420100000015,34000000000000000000000000000000,34112233,445566778899AABB freeradius-server/src/tests/example.com000066400000000000000000000001021257552170400206000ustar00rootroot00000000000000# # TESTS 1 # User-Name = "bob@example.com" User-Password = "bob" freeradius-server/src/tests/fips186-02/000077500000000000000000000000001257552170400200735ustar00rootroot00000000000000freeradius-server/src/tests/fips186-02/description.txt000066400000000000000000000001271257552170400231570ustar00rootroot00000000000000Test vectors were from http://csrc.nist.gov/CryptoToolkit/dss/Examples-1024bit.pdf freeradius-server/src/tests/fips186-02/fips186-2.txt000066400000000000000000000010021257552170400221640ustar00rootroot00000000000000Input was: |bd029bbe_7f51960b_cf9edb2b_61f06f0f_eb5a38b6| Output was: 2070b322_3dba372f_de1c0ffc_7b2e3b49_8b260614 3c6c18ba_cb0f6c55_babb1378_8e20d737_a3275116 c9ec5c2f_3261cba3_98384ecf_9189707c_20dbe3b6 8d6fc9d2_37313854_7338c3f5_7cf68f38_683aea5b f9e60c0d_73b177bc_69edde1b_eb3f596a_9555fee9 0d570204_a3044bb5_a67f6509_25f14c1d_0446b252 78360140_28faffbf_49840408_ccb30408_00b40408 38faffbf_18ef0440_48ae1340_c0970040_48faffbf freeradius-server/src/tests/hmac-md5-01/000077500000000000000000000000001257552170400202655ustar00rootroot00000000000000freeradius-server/src/tests/hmac-md5-01/digest1.txt000066400000000000000000000000411257552170400223610ustar00rootroot00000000000000750c783e6ab0b503eaa86e310a5db738 freeradius-server/src/tests/hmac-sha1-01/000077500000000000000000000000001257552170400204345ustar00rootroot00000000000000freeradius-server/src/tests/hmac-sha1-01/digest1.txt000066400000000000000000000000511257552170400225310ustar00rootroot00000000000000effcdf6ae5eb2fa2d27416d5f184df9c259a7c79 freeradius-server/src/tests/mschapv1000066400000000000000000000007321257552170400201230ustar00rootroot00000000000000# # bob Cleartext-Password := "bob" # # TESTS 1 # # SHOULD get: # # MS-CHAP-MPPE-Keys = 0x4318b176c3d8e3de9a936faf344359a0f1e3c9b5585b9f1f0000000000000000 # MS-MPPE-Encryption-Policy = 0x00000001 # MS-MPPE-Encryption-Types = 0x00000006 # # NT Hash hash = 0x9a936faf344359a0f1e3c9b5585b9f1f # User-Name = "bob", MS-CHAP-Challenge = 0xb9634adc358b2ab3, MS-CHAP-Response = 0xb9010000000000000000000000000000000000000000000000007a42408782f745ef90a86fd21b0d9294132750f4af66a419 freeradius-server/src/tests/peap-mschapv2.conf000066400000000000000000000004221257552170400217670ustar00rootroot00000000000000# # ./eapol_test -c eap-ttls-mschapv2.conf -s testing123 # network={ ssid="example" key_mgmt=WPA-EAP eap=PEAP identity="bob" anonymous_identity="anonymous" password="bob" phase2="auth=MSCHAPV2" phase1="peapver=0" } freeradius-server/src/tests/proxy.conf000066400000000000000000000016121257552170400205040ustar00rootroot00000000000000# # This is a LOCAL realm # realm example.com { nostrip } # # And another one, where we strip the realm # realm stripped.example.com { } # # Some home servers, server pools, and realms. This tests that # the server can load them. Functionality is in another test. # home_server auth_one { type = auth ipaddr = 127.0.0.1 port = 12360 secret = testing123 } home_server auth_two { type = auth ipaddr = 127.0.0.1 port = 12370 secret = testing123 } server_pool fail-over { type = fail-over home_server = auth_one home_server = auth_two } server_pool load-balance { type = load-balance home_server = auth_one home_server = auth_two } server_pool client-balance { type = client-balance home_server = auth_one home_server = auth_two } realm fail-over { auth_pool = fail-over } realm load-balance { auth_pool = load-balance } realm client-balance { auth_pool = client-balance } freeradius-server/src/tests/runtests.sh000077500000000000000000000021731257552170400207050ustar00rootroot00000000000000#!/bin/bash PORT=12340 HOME_PORT=12350 SECRET=testing123 rm -f verbose.log RCODE=0 rm -rf .cache mkdir .cache # # Bootstrap the tests # for NAME in $@ do TOTAL=`grep TESTS $NAME | sed 's/.*TESTS//'` # # Each test may have multiple variants. # for NUMBER in `echo $TOTAL` do cp $NAME .request BASE=`echo $NAME | sed 's,.*/,,'` # # Add the name of the test, and the variant to the request # echo "Test-Name = \"$BASE\"," >> .request echo 'Test-Number = ' $NUMBER >> .request mv .request .cache/$BASE:$NUMBER done done echo "Running tests..." (cd .cache;ls -1 > ../.foo) rm -f .bar for x in `cat .foo` do echo "-f .cache/$x" >> .bar done ../main/radclient `cat .bar` -xFd . 127.0.0.1:$PORT auth $SECRET > radclient.log 2>&1 for x in `cat .foo` do RESULT=`egrep ^\\.cache/$x radclient.log | sed 's/.* //'` if [ "$RESULT" = "2" ]; then echo "$x : Success" else echo "$x : FAILED" RCODE=1 fi done if [ "$RCODE" = "0" ] then rm -f radiusd.log radclient.log echo "All tests succeeded" else echo "See radclient.log for more details" fi exit $RCODE freeradius-server/src/tests/stripped.example.com000066400000000000000000000001141257552170400224340ustar00rootroot00000000000000# # TESTS 1 # User-Name = "bob@stripped.example.com", User-Password = "bob" freeradius-server/src/tests/test.example.com000066400000000000000000000001521257552170400215630ustar00rootroot00000000000000# # Tests for clear-text password # # TESTS 1 # User-Name = "bob@test.example.com" User-Password = "bob" freeradius-server/src/tests/user_password000066400000000000000000000001321257552170400212730ustar00rootroot00000000000000# # Tests for clear-text password # # TESTS 1 # User-Name = "bob", User-Password = "bob" freeradius-server/src/tests/wimax000066400000000000000000000023321257552170400175240ustar00rootroot00000000000000# # Tests for WiMAX attributes # # TESTS 1 # User-Name = "bob" User-Password = "bob" WiMAX-GMT-Timezone-offset = -1 WiMAX-AAA-Session-Id = 0x01020304 WiMAX-hHA-IP-MIP4 = 192.0.2.1 # # Manually encoded capability # WiMAX-Capability = 0x01ff45454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545040301 # # Automatically encoded capability # WiMAX-Accounting-Capabilities = 2 WiMAX-Release = "1.0" WiMAX-Packet-Data-Flow-Id = 1 # # Long string # WiMAX-Hotline-Indicator = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxaaaaaaaaaabbbbbbbbbbcccccccccc123" WiMAX-Service-Data-Flow-Id = 2 WiMAX-hHA-IP-MIP4 = 192.0.2.2 freeradius-server/suse/000077500000000000000000000000001257552170400155025ustar00rootroot00000000000000freeradius-server/suse/README.SuSE000066400000000000000000000006741257552170400172070ustar00rootroot00000000000000 Please note that the radiusd does run as user 'radiusd' and group 'radiusd' per default after installation. (/etc/raddb/radiusd.conf) This was done because of security reasons and is possible with many authentication types (users, LDAP, SQL ...) If you would like to use unix (shadow) authentication (Auth-Type = System) or PAM (Auth-Type = Pam) you have to change the values to run the daemon as user/group root: user = root group = root freeradius-server/suse/admin-httpd.conf000066400000000000000000000010121257552170400205540ustar00rootroot00000000000000Alias /radius/ /usr/share/dialup_admin/htdocs/ Options None order deny,allow deny from all allow from 127.0.0.1 # RECOMMENDED # For SSL-servers and user authentication # # Options None # SSLRequireSSL # order deny,allow # deny from all # AuthType Basic # AuthUserFile /site/cfg/passwd # AuthGroupFile /site/cfg/group # AuthName "Radius" # require group radius # Satisfy Any # freeradius-server/suse/freeradius-server-2.1.6-suseinit.patch000066400000000000000000000022201257552170400244570ustar00rootroot00000000000000diff --git a/suse/rcradius-relayd b/suse/rcradius-relayd index 4ebe557..ea28188 100644 --- suse/rcradius-relayd +++ suse/rcradius-relayd @@ -13,7 +13,9 @@ ### BEGIN INIT INFO # Provides: radius-relayd # Required-Start: $network $syslog $remotefs -# Required-Stop: +# Should-Start: $time ypbind smtp +# Required-Stop: $syslog $remote_fs +# Should-Stop: ypbind smtp # Default-Start: 3 5 # Default-Stop: 0 1 2 6 # Short-Description: RADIUS Relay Server diff --git a/suse/rcradiusd b/suse/rcradiusd index 83e2af0..06adba5 100644 --- suse/rcradiusd +++ suse/rcradiusd @@ -13,13 +13,16 @@ ### BEGIN INIT INFO # Provides: radiusd # Required-Start: $network $syslog $remotefs -# Required-Stop: +# Should-Start: $time ypbind smtp +# Required-Stop: $syslog $remote_fs +# Should-Stop: ypbind smtp # Default-Start: 3 5 # Default-Stop: 0 1 2 6 # Short-Description: RADIUS-Server # Description: Remote Authentication Dialin User Server ### END INIT INFO + RADIUSD_BIN=/usr/sbin/radiusd test -x $RADIUSD_BIN || { echo "$RADIUSD_BIN not installed"; \ if [ "$1" = "stop" ]; then exit 0; freeradius-server/suse/freeradius-server-rpmlintrc000066400000000000000000000005541257552170400230760ustar00rootroot00000000000000#freeradius-server.x86_64: E: dir-or-file-in-var-run (Badness: 900) /var/run/radiusd #A file or directory in the package is located in /var/run. It's not permitted #for packages to install files in this directory as it might be created as #tmpfs during boot. Modify your package to create the necessary files during #runtime. addFilter("dir-or-file-in-var-run") freeradius-server/suse/freeradius-server-tmpfiles.conf000066400000000000000000000000521257552170400236240ustar00rootroot00000000000000D /var/run/radiusd 0710 radiusd radiusd - freeradius-server/suse/freeradius.spec000066400000000000000000000377531257552170400205260ustar00rootroot00000000000000# # spec file for package freeradius-server (Version 2.1.8) # Name: freeradius-server Version: 2.2.8 Release: 0 License: GPLv2 ; LGPLv2.1 Group: Productivity/Networking/Radius/Servers Provides: radiusd Provides: freeradius = %{version} Obsoletes: freeradius < %{version} Conflicts: radiusd-livingston radiusd-cistron icradius Url: http://www.freeradius.org/ Summary: Very Highly Configurable Radius Server Source: ftp://ftp.freeradius.org/pub/freeradius/%{name}-%{version}.tar.bz2 Source90: %{name}-rpmlintrc Source104: %{name}-tmpfiles.conf Patch0: freeradius-server-2.1.6-suseinit.patch PreReq: /usr/sbin/useradd /usr/sbin/groupadd PreReq: perl PreReq: %insserv_prereq %fillup_prereq BuildRoot: %{_tmppath}/%{name}-%{version}-build %define _oracle_support 0 %define apache2_sysconfdir /etc/apache2 Requires: %{name}-libs = %{version} Requires: python Recommends: logrotate BuildRequires: cyrus-sasl-devel BuildRequires: db-devel BuildRequires: gcc-c++ BuildRequires: gdbm-devel BuildRequires: gettext-devel BuildRequires: glibc-devel BuildRequires: libtool BuildRequires: ncurses-devel BuildRequires: net-snmp-devel BuildRequires: openldap2-devel BuildRequires: openssl BuildRequires: openssl-devel BuildRequires: pam-devel BuildRequires: perl BuildRequires: postgresql-devel BuildRequires: python-devel BuildRequires: sed BuildRequires: unixODBC-devel %if 0%{?suse_version} > 910 BuildRequires: krb5-devel %endif %if 0%{?suse_version} > 930 BuildRequires: libcom_err %endif %if 0%{?suse_version} > 1000 BuildRequires: libapr1-devel %endif %if 0%{?suse_version} > 1020 BuildRequires: libmysqlclient-devel %endif %if 0%{?suse_version} > 1100 BuildRequires: libpcap-devel BuildRequires: sqlite3-devel %endif %description The FreeRADIUS server has a number of features found in other servers, and additional features not found in any other server. Rather than doing a feature by feature comparison, we will simply list the features of the server, and let you decide if they satisfy your needs. Support for RFC and VSA Attributes Additional server configuration attributes Selecting a particular configuration Authentication methods Accounting methods %if %_oracle_support == 1 %package oracle BuildRequires: oracle-instantclient-basic oracle-instantclient-devel Group: Productivity/Networking/Radius/Servers Summary: FreeRADIUS Oracle database support Requires: oracle-instantclient-basic Requires: %{name}-libs = %{version} Requires: %{name} = %{version} %description oracle The FreeRADIUS server has a number of features found in other servers, and additional features not found in any other server. Rather than doing a feature by feature comparison, we will simply list the features of the server, and let you decide if they satisfy your needs. Support for RFC and VSA Attributes Additional server configuration attributes Selecting a particular configuration Authentication methods %endif %package libs License: GPLv2 ; LGPLv2.1 Group: Productivity/Networking/Radius/Servers Summary: FreeRADIUS shared library %description libs The FreeRADIUS shared library Authors: -------- Miquel van Smoorenburg Alan DeKok Mike Machado Alan Curry various other people %package utils License: GPLv2 ; LGPLv2.1 Group: Productivity/Networking/Radius/Clients Summary: FreeRADIUS Clients Requires: %{name}-libs = %{version} %description utils The FreeRADIUS server has a number of features found in other servers and additional features not found in any other server. Rather than doing a feature by feature comparison, we will simply list the features of the server, and let you decide if they satisfy your needs. Support for RFC and VSA Attributes Additional server configuration attributes Selecting a particular configuration Authentication methods %package dialupadmin License: GPLv2 ; LGPLv2.1 Group: Productivity/Networking/Radius/Servers Summary: Web management for FreeRADIUS Requires: http_daemon Requires: perl-DateManip %if 0%{?suse_version} > 1000 Requires: apache2-mod_php5 Requires: php5 Requires: php5-ldap Requires: php5-mysql Requires: php5-pgsql %else Requires: apache2-mod_php4 Requires: php4 Requires: php4-ldap Requires: php4-mysql Requires: php4-pgsql Requires: php4-session %endif %description dialupadmin Dialup Admin supports users either in SQL (MySQL or PostgreSQL are supported) or in LDAP. Apart from the web pages, it also includes a number of scripts to make the administrator's life a lot easier. Authors: -------- Kostas Kalevras Basilis Pappas Panagiotis Christias Thanasis Duitsis %package devel License: GPLv2 ; LGPLv2.1 Group: Development/Libraries/C and C++ Summary: FreeRADIUS Development Files (static libs) Requires: %{name}-libs = %{version} %description devel These are the static libraries for the FreeRADIUS package. Authors: -------- Miquel van Smoorenburg Alan DeKok Mike Machado Alan Curry various other people %package doc License: GPLv2 ; LGPLv2.1 Group: Productivity/Networking/Radius/Servers Summary: FreeRADIUS Documentation Requires: %{name} %description doc This package contains FreeRADIUS Documentation Authors: -------- Miquel van Smoorenburg Alan DeKok Mike Machado Alan Curry various other people %prep %setup -q %patch0 %build # This package failed when testing with -Wl,-as-needed being default. # So we disable it here, if you want to retest, just delete this comment and the line below. export SUSE_ASNEEDED=0 export CFLAGS="$RPM_OPT_FLAGS -fstack-protector -fno-strict-aliasing" %ifarch x86_64 ppc ppc64 s390 s390x export CFLAGS="$CFLAGS -fPIC -DPIC" %endif export LDFLAGS="-pie" %configure \ --libdir=%{_libdir}/freeradius \ --disable-ltdl-install \ --with-edir \ --with-experimental-modules \ --with-gnu-ld \ --with-system-libtool \ --with-system-libltdl \ --with-udpfromto \ --with-rlm-krb5-lib-dir=%{_libdir} \ --without-rlm_opendirectory \ --without-rlm_sqlhpwippool \ %if 0%{?suse_version} <= 920 --without-rlm_sql_mysql \ --without-rlm_krb5 \ %endif %if %{_oracle_support} == 1 --with-rlm_sql_oracle \ --with-oracle-lib-dir=%{_libdir}/oracle/10.1.0.3/client/lib/ %else --without-rlm_sql_oracle %endif # no parallel build possible make %install mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/lib/radiusd make install R=$RPM_BUILD_ROOT INSTALLSTRIP= # modify default configuration RADDB=$RPM_BUILD_ROOT%{_sysconfdir}/raddb perl -i -pe 's/^#user =.*$/user = radiusd/' $RADDB/radiusd.conf perl -i -pe 's/^#group =.*$/group = radiusd/' $RADDB/radiusd.conf /sbin/ldconfig -n $RPM_BUILD_ROOT%{_libdir}/freeradius # logs touch $RPM_BUILD_ROOT%{_localstatedir}/log/radius/radutmp touch $RPM_BUILD_ROOT%{_localstatedir}/log/radius/radius.log # SuSE install -d $RPM_BUILD_ROOT%{_sysconfdir}/pam.d install -d $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d install -m 644 suse/radiusd-pam $RPM_BUILD_ROOT%{_sysconfdir}/pam.d/radiusd install -m 644 suse/radiusd-logrotate $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/freeradius-server install -d -m 755 $RPM_BUILD_ROOT%{_sysconfdir}/init.d #install -m 744 suse/rcradiusd $RPM_BUILD_ROOT%{_sysconfdir}/init.d/freeradius #ln -sf ../..%{_sysconfdir}/init.d/freeradius $RPM_BUILD_ROOT%{_sbindir}/rcfreeradius install -m 744 suse/rcradiusd $RPM_BUILD_ROOT%{_sysconfdir}/init.d/radiusd ln -sf ../..%{_sysconfdir}/init.d/radiusd $RPM_BUILD_ROOT%{_sbindir}/rcradiusd install -d %{buildroot}%{_sysconfdir}/tmpfiles.d install -m 0644 %{SOURCE104} %{buildroot}%{_sysconfdir}/tmpfiles.d/radiusd.conf # install dialup_admin DIALUPADMIN=$RPM_BUILD_ROOT%{_datadir}/dialup_admin mkdir -p $DIALUPADMIN cp -r dialup_admin/* $RPM_BUILD_ROOT%{_datadir}/dialup_admin perl -i -pe 's/^#general_base_dir\:.*$/general_base_dir\: \/usr\/share\/freeradius-dialupadmin/' $DIALUPADMIN/conf/admin.conf perl -i -pe 's/^#general_radiusd_base_dir\:.*$/general_radiusd_base_dir\: \//' $DIALUPADMIN/conf/admin.conf perl -i -pe 's/^#general_snmpwalk_command\:.*$/general_snmpwalk_command\: \/usr\/bin\/snmpwalk/' $DIALUPADMIN/conf/admin.conf perl -i -pe 's/^#general_snmpget_command\:.*$/general_snmpget_command\: \/usr\/bin\/snmpget/' $DIALUPADMIN/conf/admin.conf # apache2 config install -d -m 755 $RPM_BUILD_ROOT%{apache2_sysconfdir}/conf.d install -m 644 suse/admin-httpd.conf $RPM_BUILD_ROOT%{apache2_sysconfdir}/conf.d/radius.conf # remove unneeded stuff rm -rf doc/00-OLD rm -f $RPM_BUILD_ROOT%{_sbindir}/rc.radiusd rm -rf $RPM_BUILD_ROOT%{_datadir}/doc/freeradius* rm -rf $RPM_BUILD_ROOT%{_libdir}/freeradius/*.*a %pre %{_sbindir}/groupadd -r radiusd 2> /dev/null || : %{_sbindir}/useradd -r -g radiusd -s /bin/false -c "Radius daemon" -d \ %{_localstatedir}/lib/radiusd radiusd 2> /dev/null || : %post %ifarch x86_64 # Modify old installs to look for /usr/lib64/freeradius /usr/bin/perl -i -pe "s:/usr/lib/freeradius:/usr/lib64/freeradius:" /etc/raddb/radiusd.conf %endif # Generate default certificates if [ $1 -eq 1 ]; then /etc/raddb/certs/bootstrap fi chgrp radiusd /etc/raddb/certs/* %{fillup_and_insserv radiusd} %preun %stop_on_removal radiusd %postun %restart_on_update radiusd %{insserv_cleanup} %clean rm -rf $RPM_BUILD_ROOT %files doc %defattr(-,root,root) %doc doc/* %files %defattr(-,root,root) # doc %doc suse/README.SuSE %doc COPYRIGHT CREDITS LICENSE README.rst doc/ChangeLog %doc doc/examples/* # SuSE #%{_sysconfdir}/init.d/freeradius %{_sysconfdir}/init.d/radiusd %config %{_sysconfdir}/pam.d/radiusd %config %{_sysconfdir}/logrotate.d/freeradius-server %dir %{_sysconfdir}/tmpfiles.d %config %{_sysconfdir}/tmpfiles.d/radiusd.conf %{_sbindir}/rcradiusd %dir %attr(755,radiusd,radiusd) %{_localstatedir}/lib/radiusd # configs %dir %attr(750,root,radiusd) %{_sysconfdir}/raddb %defattr(-,root,radiusd) %config(noreplace) %{_sysconfdir}/raddb/dictionary %config(noreplace) %{_sysconfdir}/raddb/acct_users %config(noreplace) %{_sysconfdir}/raddb/attrs %config(noreplace) %{_sysconfdir}/raddb/attrs.access_reject %config(noreplace) %{_sysconfdir}/raddb/attrs.accounting_response %config(noreplace) %{_sysconfdir}/raddb/attrs.pre-proxy %config(noreplace) %{_sysconfdir}/raddb/attrs.access_challenge %attr(640,root,radiusd) %config(noreplace) %{_sysconfdir}/raddb/clients.conf %config(noreplace) %{_sysconfdir}/raddb/hints %config(noreplace) %{_sysconfdir}/raddb/huntgroups %config(noreplace) %{_sysconfdir}/raddb/ldap.attrmap %attr(640,root,radiusd) %config(noreplace) %{_sysconfdir}/raddb/sqlippool.conf %attr(640,root,radiusd) %config(noreplace) %{_sysconfdir}/raddb/preproxy_users %attr(640,root,radiusd) %config(noreplace) %{_sysconfdir}/raddb/proxy.conf %attr(640,root,radiusd) %config(noreplace) %{_sysconfdir}/raddb/radiusd.conf %attr(640,root,radiusd) %config(noreplace) %{_sysconfdir}/raddb/sql.conf %dir %attr(750,root,radiusd) %{_sysconfdir}/raddb/modules %attr(640,root,radiusd) %config(noreplace) %{_sysconfdir}/raddb/modules/* %dir %attr(750,root,radiusd) %{_sysconfdir}/raddb/sql %dir %attr(750,root,radiusd) %{_sysconfdir}/raddb/sql/mssql %dir %attr(750,root,radiusd) %{_sysconfdir}/raddb/sql/mysql %dir %attr(750,root,radiusd) %{_sysconfdir}/raddb/sql/oracle %dir %attr(750,root,radiusd) %{_sysconfdir}/raddb/sql/postgresql %dir %attr(750,root,radiusd) %{_sysconfdir}/raddb/sql/ndb %{_sysconfdir}/raddb/sql/ndb/README %attr(640,root,radiusd) %config(noreplace) %{_sysconfdir}/raddb/sql/*/*.conf %attr(640,root,radiusd) %config(noreplace) %{_sysconfdir}/raddb/sql/*/*.sql %{_sysconfdir}/raddb/sql/oracle/msqlippool.txt %attr(640,root,radiusd) %config(noreplace) %{_sysconfdir}/raddb/users %attr(640,root,radiusd) %config(noreplace) %{_sysconfdir}/raddb/experimental.conf %dir %attr(750,root,radiusd) %{_sysconfdir}/raddb/certs %{_sysconfdir}/raddb/certs/Makefile %{_sysconfdir}/raddb/certs/README %{_sysconfdir}/raddb/certs/xpextensions %attr(640,root,radiusd) %config(noreplace) %{_sysconfdir}/raddb/certs/*.cnf %attr(750,root,radiusd) %{_sysconfdir}/raddb/certs/bootstrap %dir %attr(750,root,radiusd) %{_sysconfdir}/raddb/sites-available %attr(640,root,radiusd) %{_sysconfdir}/raddb/sites-available/* %attr(640,root,radiusd) %config(noreplace) %{_sysconfdir}/raddb/sites-available/* %dir %attr(750,root,radiusd) %{_sysconfdir}/raddb/sites-enabled %attr(640,root,radiusd) %config(noreplace) %{_sysconfdir}/raddb/sites-enabled/* %attr(640,root,radiusd) %config(noreplace) %{_sysconfdir}/raddb/eap.conf %attr(640,root,radiusd) %{_sysconfdir}/raddb/example.pl %attr(640,root,radiusd) %config(noreplace) %{_sysconfdir}/raddb/panic.gdb %attr(640,root,radiusd) %config(noreplace) %{_sysconfdir}/raddb/policy.conf %{_sysconfdir}/raddb/policy.txt %attr(640,root,radiusd) %config(noreplace) %{_sysconfdir}/raddb/templates.conf %attr(700,radiusd,radiusd) %dir %{_localstatedir}/run/radiusd/ # binaries %defattr(-,root,root) %{_sbindir}/checkrad %{_sbindir}/radiusd %{_sbindir}/radmin %{_sbindir}/radwatch %{_sbindir}/raddebug # man-pages %doc %{_mandir}/man5/* %doc %{_mandir}/man8/* # dictionaries %attr(755,root,root) %dir %{_datadir}/freeradius %{_datadir}/freeradius/* # logs %attr(700,radiusd,radiusd) %dir %{_localstatedir}/log/radius/ %attr(700,radiusd,radiusd) %dir %{_localstatedir}/log/radius/radacct/ %attr(644,radiusd,radiusd) %{_localstatedir}/log/radius/radutmp %config(noreplace) %attr(600,radiusd,radiusd) %{_localstatedir}/log/radius/radius.log # RADIUS Loadable Modules %attr(755,root,root) %dir %{_libdir}/freeradius %attr(755,root,root) %{_libdir}/freeradius/rlm_*.so* %files utils %defattr(-,root,root) %doc %{_mandir}/man1/* %{_bindir}/* %files libs %defattr(-,root,root) # RADIUS shared libs %attr(755,root,root) %dir %{_libdir}/freeradius %attr(755,root,root) %{_libdir}/freeradius/lib*.so* %if %{_oracle_support} == 1 %files oracle %defattr(-,radiusd,radiusd) %attr(755,root,root) %dir %{_libdir}/freeradius %attr(755,root,root) %{_libdir}/freeradius/rlm_sql_oracle*.so* %endif %files dialupadmin %defattr(-,root,root) %dir %{_datadir}/dialup_admin/ %{_datadir}/dialup_admin/Makefile %{_datadir}/dialup_admin/bin/ %{_datadir}/dialup_admin/doc/ %{_datadir}/dialup_admin/htdocs/ %{_datadir}/dialup_admin/html/ %{_datadir}/dialup_admin/lib/ %{_datadir}/dialup_admin/sql/ %dir %{_datadir}/dialup_admin/conf/ %config(noreplace) %{_datadir}/dialup_admin/conf/* %dir %{apache2_sysconfdir} %dir %{apache2_sysconfdir}/conf.d %config(noreplace) %{apache2_sysconfdir}/conf.d/radius.conf %{_datadir}/dialup_admin/Changelog %{_datadir}/dialup_admin/README %files devel %defattr(-,root,root) %dir %attr(755,root,root) %{_includedir}/freeradius %attr(644,root,root) %{_includedir}/freeradius/*.h %changelog * Fri Feb 10 2012 nix@opensuse.org - Add a /var/run/radiusd tmpfile.d config - Add -fno-strict-aliasing to compiler flags to fix warning - Remove -DLDAP_DEPRECATED from compiler flags - Disable rlm_sqlhpwippool as there don't seem to be many users and it is throwing a compiler warning at present * Tue Feb 7 2012 nix@opensuse.org - addFilter("dir-or-file-in-var-run") to rpmlintrc to enable builds on newer versions of openSUSE. Need to investigate fixing this.. * Tue Feb 7 2012 nix@opensuse.org - Rename freeradius init script to radiusd to match package standards * Tue Feb 7 2012 nix@opensuse.org - rename logrotate script to match package name * Tue Feb 7 2012 nix@opensuse.org - Remove radrelay related stuff as it is now handled internallly rather than as a separate process * Sat Nov 19 2011 nix@opensuse.org - Update to version 2.1.12 * Tue Aug 23 2011 nix@opensuse.org - Update to version 2.1.11 * Wed Mar 17 2010 puzel@novell.com - remove unused patches: - freeradius-1.1.0-python.patch - ltdl.patch - radius_logger_apn.patch - token-support-freeradius-1.1.6.patch - specfile cleanup as preparation to merge with obs://networking/freeradius-server * Wed Mar 10 2010 nix@opensuse.org - Upgrade to version 2.1.8 freeradius-server/suse/radiusd-logrotate000066400000000000000000000023651257552170400210640ustar00rootroot00000000000000# There are different detail-rotating strategies you can use. One is # to write to a single detail file per IP and use the rotate config # below. Another is to write to a daily detail file per IP with: # detailfile = ${radacctdir}/%{Client-IP-Address}/%Y%m%d-detail # (or similar) in radiusd.conf, without rotation. If you go with the # second technique, you will need another cron job that removes old # detail files. You do not need to comment out the below for method #2. /var/log/radius/radacct/*/detail { compress dateext maxage 365 rotate 99 size=+1024k notifempty missingok } /var/log/radius/radius.log { compress dateext maxage 365 rotate 99 size=+1024k notifempty missingok create postrotate kill -HUP `cat /var/run/radiusd/radiusd.pid` endscript } /var/log/radius/radwatch.log { compress dateext maxage 365 rotate 99 size=+1024k notifempty missingok copytruncate } /var/log/radius/radwtmp { compress dateext maxage 365 rotate 99 size=+2048k notifempty missingok create } /var/log/radius/sqltrace.sql { compress dateext maxage 365 rotate 99 size=+2048k notifempty missingok create } freeradius-server/suse/radiusd-pam000066400000000000000000000003131257552170400176300ustar00rootroot00000000000000#%PAM-1.0 auth requisite pam_nologin.so auth include common-auth account include common-account password include common-password session include common-session freeradius-server/suse/radiusd-pam-old000066400000000000000000000004261257552170400204110ustar00rootroot00000000000000#%PAM-1.0 auth required pam_unix2.so nullok auth required pam_nologin.so account required pam_unix2.so password required pam_pwcheck.so nullok use_cracklib password required pam_unix2.so nullok use_first_pass use_authtok session required pam_unix2.so none freeradius-server/suse/rcradius-relayd000066400000000000000000000042541257552170400205240ustar00rootroot00000000000000#! /bin/sh # Copyright (c) 2001 SuSE GmbH Nuernberg, Germany. # 2002, 2003 SuSE Linux AG, Nuernberg, Germany. # # Author: Wolfgang Rosenauer, 2000-2003 # # /etc/init.d/radius-relayd # # and symbolic its link # # /usr/bin/rcradius-relayd # ### BEGIN INIT INFO # Provides: radius-relayd # Required-Start: $network $syslog $remotefs # Required-Stop: # Default-Start: 3 5 # Default-Stop: 0 1 2 6 # Short-Description: RADIUS Relay Server # Description: Remote Authentication Dialin User Server Relay Service ### END INIT INFO RADIUSD_BIN=/usr/sbin/radrelay test -x $RADIUSD_BIN || { echo "$RADIUSD_BIN not installed"; \ if [ "$1" = "stop" ]; then exit 0; else exit 5; fi; } . /etc/rc.status rc_reset case "$1" in start) echo -n "Starting RADIUS Relay daemon " startproc $RADIUSD_BIN -s -n radrelay >/dev/null rc_status -v ;; stop) echo -n "Shutting down RADIUS Relay daemon " killproc -TERM $RADIUSD_BIN rc_status -v ;; try-restart|condrestart) ## If first returns OK call the second, if first or ## second command fails, set echo return value. if test "$1" = "condrestart"; then echo "${attn} Use try-restart ${done}(LSB)${attn} rather than condrestart ${warn}(RH)${norm}" fi $0 status if test $? = 0; then $0 restart else rc_reset # Not running is not a failure. fi rc_status ;; restart) ## Stop the service and regardless of whether it was ## running or not, start it again. $0 stop $0 start rc_status ;; force-reload) ## Signal the daemon to reload its config. Most daemons ## do this on signal 1 (SIGHUP). ## If it does not support it, restart. echo -n "Reload RADIUS Relay daemon " killproc -HUP $RADIUSD_BIN rc_status -v ;; reload) ## Like force-reload, but if daemon does not support ## signalling, do nothing (!) echo -n "Reload RADIUS Relay daemon " killproc -HUP $RADIUSD_BIN rc_status -v ;; status) echo -n "Checking for service radius-relayd " checkproc $RADIUSD_BIN rc_status -v ;; *) echo "Usage: $0 {start|stop|status|try-restart|restart|force-reload|reload}" exit 1 ;; esac rc_exit freeradius-server/suse/rcradiusd000066400000000000000000000041301257552170400174030ustar00rootroot00000000000000#! /bin/sh # Copyright (c) 2001 SuSE GmbH Nuernberg, Germany. # 2002, 2003 SuSE Linux AG, Nuernberg, Germany. # # Author: Wolfgang Rosenauer, 2000-2003 # # /etc/init.d/radiusd # # and symbolic its link # # /usr/bin/rcradiusd # ### BEGIN INIT INFO # Provides: radiusd # Required-Start: $network $syslog $remotefs # Required-Stop: # Default-Start: 3 5 # Default-Stop: 0 1 2 6 # Short-Description: RADIUS-Server # Description: Remote Authentication Dialin User Server ### END INIT INFO RADIUSD_BIN=/usr/sbin/radiusd test -x $RADIUSD_BIN || { echo "$RADIUSD_BIN not installed"; \ if [ "$1" = "stop" ]; then exit 0; else exit 5; fi; } . /etc/rc.status rc_reset case "$1" in start) echo -n "Starting RADIUS daemon " startproc $RADIUSD_BIN >/dev/null rc_status -v ;; stop) echo -n "Shutting down RADIUS daemon " killproc -TERM $RADIUSD_BIN rc_status -v ;; try-restart|condrestart) ## If first returns OK call the second, if first or ## second command fails, set echo return value. if test "$1" = "condrestart"; then echo "${attn} Use try-restart ${done}(LSB)${attn} rather than condrestart ${warn}(RH)${norm}" fi $0 status if test $? = 0; then $0 restart else rc_reset # Not running is not a failure. fi rc_status ;; restart) ## Stop the service and regardless of whether it was ## running or not, start it again. $0 stop $0 start rc_status ;; force-reload) ## Signal the daemon to reload its config. Most daemons ## do this on signal 1 (SIGHUP). ## If it does not support it, restart. echo -n "Reload RADIUS daemon " killproc -HUP $RADIUSD_BIN rc_status -v ;; reload) ## Like force-reload, but if daemon does not support ## signalling, do nothing (!) echo -n "Reload RADIUS daemon " killproc -HUP $RADIUSD_BIN rc_status -v ;; status) echo -n "Checking for service radiusd " checkproc $RADIUSD_BIN rc_status -v ;; *) echo "Usage: $0 {start|stop|status|try-restart|restart|force-reload|reload}" exit 1 ;; esac rc_exit freeradius-server/todo/000077500000000000000000000000001257552170400154705ustar00rootroot00000000000000freeradius-server/todo/TODO000066400000000000000000000125151257552170400161640ustar00rootroot00000000000000URGENT: o scan ALL modules, so that they use consistent names for structures and variables in their instantiation (rlm_foo_t *inst), and that they call rlm_foo_detach() if anything goes wrong, instead of just free()'ing 'inst'. The cf_parse_section().. code may have malloc'd memory, and that needs to be free'd, too. o Stop unloading modules on HUP so that we can have persistant handles/socketc/etc from module_init(). Alan D. and Alan C. had a good plan for when to load/reload modules on the list recently...I say run with that. o double-check Cistron 'compat' mode, so that all current users of Cistron can upgrade "out of the box" to FreeRADIUS MEDIUM PRIORITY o go through all of the code and reformat it, for project standards o go through all of the code, removing unnecessary #include's, and generating a standard include file order which will work across all platforms. o rad_malloc() fixes: child processes/threads ALWAYS kill themselves if malloc() fails. The main server process does a 'sleep' for N seconds, and tries again. After T tries, it gives up, and calls exit(). LOW PRIORITY: o Write better documentation o Manual pages for the daemon, utilities and conffiles (some done) o Fix all FIXME's in the source. o better SNMP statistics support, for the auth/acct servers, and for each client. WAIT UNTIL NEXT RELEASE: o UPDATE accounting requests aren't handled as in 1.5.4.3 for wtmp Is this a problem ? Need to fix in rlm_unix.c o New module: rlm_fastradwtmp. with a radutmp-style active session database to guarantee wtmp records are always written in matching pairs. Because radlast is slow. o replace the module_t method table with a set of register_* functions (so different instances of the same module can offer different methods) o enable server to run with child processes (This is a little more difficult than the threading changes) o switch all timers from time() to gettimeofday() so processing is less bursty o SNMP support for querying users who are on-line. o New module: rlm_nsupdate (dyndns). Because dynamic addresses are cruel. WILL NOT DO: o module initialization AFTER forking, not before. --- The modules should NOT be setting up any process-dependent --- information. o there should be a way that radius itself could rotate the wtmp file properly. It should write "logout" records for all users, move the file to wtmp.0, and create a new wtmp file with "login" records for all currently online users. --- This work is for an external process to do --- DONE: o IPv6 o proxy receive rbtree stuff o rlm_perl o "listen" directive o fix radwho to read modules{radutmp{filename = }} o Add 'initialize' list in modules, so explicitely give initialization order. o merge OSF/OSFIA patches from Cistron. o Fix DBM support: - Put DBM into its own module - Multiple defaults (done) - Fallthrough (hard for not DEFAULT entries) o modular radutmp and radwtmp, as per Alan Curry's old patches. o Fix multiple/conflicting VALUE names as pointed out on the list. e.g. 'Rlogin' has different values when used with different ATTRIBUTEs, o go through *.c and *.h, adding comments at the top with a copyright, and a GPL license. o Integrated Alan Curry's module failover patch. o add more support for new configuration files o Fixed potentially long locks on radutmp file by radcheck thread This means unlocking the file, forking checkrad, and then locking the file again. o get rlm_unix to work with multiple instances o partial split of rlm_files into rlm_fastusers and rlm_detail o enable server to run in threaded mode o rlm_realm module for COMPLETE control of proxying on any attribute o re-transmits of proxied packets o operator support in pairmove. o stripping Prefix/Suffix in accounting o new configuration file /etc/raddb/radius.conf o Radius proxy support. o Max-Simultaneous-Use parameter to avoid double logins. o Specify a program to be run on succesful login o Prefix/Suffix support o Change radutmp format to v2 (see radutmp.h) o move radutmp to /var/log ? o Compatibility with radius-2.0 o Support for pidfile o Configurable logging: both radutmp/radwtmp and details files o session_id is not numeric but an 8-byte (?) string ! o Detect reboot packet sent by portmaster and clear radutmp / wtmp o Seperate /etc/raddb/clients into public and private file (secret == secret!) Add ts-type field to clients file for checklogin.pl Better: return clients to old form (no shortname) and add a new file, "nas" or so. Matching on this file is done based on Nas-Ip-Address instead of the IP address of the sender. Better if there's a proxy in between. o Allow spaces in usernames (using " or \ to escape) o Return Proxy-State A/V pairs, in the right order. o retransmits from the terminal server get proxied with a new ID and random_vector. We should check for this! o Limit logins based on time/date (for example, Login-Hour = 8-18, Login-Day = 0-5 for business hours) o take out host-order IP addresses o Support Connect-Rate o have a config file (or section in radiusd.conf) that tells rlm_sql what the names of the tables and columns are instead of hardcoding them o split rlm_files into rlm_users, rlm_fastusers (in-memory hash), rlm_detail, they all should share as much code as possible though, not be big cut-and-paste jobs o fix the request list walking code, to scan each element no more than once per second. freeradius-server/todo/serverside-ip-pools000066400000000000000000000064011257552170400213270ustar00rootroot00000000000000From: miquels@cistron-office.nl (Miquel van Smoorenburg) Subject: Serverside IP pools design [was: Re: Questions on IP address allocation] Date: Tue, 13 Nov 2001 13:29:24 +0000 (UTC) Message-ID: <9sr77k$ofn$1@ncc1701.cistron.net> To: freeradius-devel@lists.cistron.nl,freeradius-users@lists.cistron.nl In article , John Padula wrote: >I'm still looking into IP address allocation via the "+" option. >I wanted to check if there's any sense of a lease or expiration on the >IP address >given out. No, and that's not really neccesary either, since other than with DHCP you have strictly defined session start- and stop points. >I've checked the RFC and didn't see any mention of this, but >wanted to >make sure. Because IP address allocation is completely outside the scope of the Radius RFC / protocol. >Coming from the DHCP world, where there's a large blob of >processing >devoted to lease negotiation, it seems strange that (a) we just give out >an IP 'forever' Not forever - until the end of the session. >and (b) we just keep incrementing based on nas-port-id. There's no way >to define >a range of IPs. That's because it really is an ugly hack. >Is there any way to establish a hook (in the 'module' model) where >a user could call some external function that would return an IP and >possibly manage that IP? It's hard but not impossible. You would have to write a routine/module that knows about several pools (probably defined in radius.conf) and keeps an on-disk database that accounts for the IP addresses given out. It should look at all accounting-stop messages and mark the IP as free at the end of a session. There is also the problem of 'lost packets'. If an accounting-stop packet gets lost, or if authentication fails on the NAS after you've send an authentication ack so that start and stop packets might not be sent at all, the IP address you allocated will not be freed - ever. So when the pool reaches a high watermark (>90%) then you will need to scan all sessions in the pool to see if they are still active, using "checkrad", until you're under the low watermark (<80%) again. High and low watermarks would presumably be defined as part of the pool definition in radius.conf Other ways to keep the pool clean is to also check all authentication and accounting start packets for NAS/portno combination and if that matches with a presumably still active pool allocation, kill the allocation, since the original user is gone anyway. And perhaps a time-limit - use a minimum "Session-Timeout = 86400" for all sessions with addresses from the pool and periodically clean up all session that are older than (86400 * 1.2) or so. That should also be made part of the pool definition in radius.conf ip-pool pool1 { range-start = 192.168.10.10 range-end = 192.168.10.19 cleanup-start = 90% cleanup-end = 80% session-timeout = 86400 session-stale = 90000 session-db = /var/log/radius/pool1.db } .. or something. You get the idea. The above is a description of how you could make serverside IP pools possible. Now someone needs to write the code. Mike. -- "Only two things are infinite, the universe and human stupidity, and I'm not sure about the former" -- Albert Einstein.